diff --git a/packages/stencil-library/src/components/dnn-fieldset/dnn-fieldset.scss b/packages/stencil-library/src/components/dnn-fieldset/dnn-fieldset.scss index 695341605..62507cd6c 100644 --- a/packages/stencil-library/src/components/dnn-fieldset/dnn-fieldset.scss +++ b/packages/stencil-library/src/components/dnn-fieldset/dnn-fieldset.scss @@ -34,7 +34,6 @@ position: relative; width: 100%; background-color: var(--fieldset-background); - max-width: calc(100% - 1em); height: calc(100% - 1em); } label{ diff --git a/packages/stencil-library/src/components/examples/dnn-example-form/dnn-example-form.scss b/packages/stencil-library/src/components/examples/dnn-example-form/dnn-example-form.scss index 61626c3ea..defe2c090 100644 --- a/packages/stencil-library/src/components/examples/dnn-example-form/dnn-example-form.scss +++ b/packages/stencil-library/src/components/examples/dnn-example-form/dnn-example-form.scss @@ -43,4 +43,22 @@ svg { .full-form-width{ grid-column: 1 / -1; +} + +.filename{ + display: flex; + gap: 1rem; + align-items: center; +} + +.profile-pic{ + display: flex; + flex-direction: column; + gap: 1rem; + dnn-button { + margin: 0 auto; + } + img { + max-width: 100%; + } } \ No newline at end of file diff --git a/packages/stencil-library/src/components/examples/dnn-example-form/dnn-example-form.tsx b/packages/stencil-library/src/components/examples/dnn-example-form/dnn-example-form.tsx index 256f95745..7e5dac8fc 100644 --- a/packages/stencil-library/src/components/examples/dnn-example-form/dnn-example-form.tsx +++ b/packages/stencil-library/src/components/examples/dnn-example-form/dnn-example-form.tsx @@ -1,4 +1,4 @@ -import { Component, Host, h } from '@stencil/core'; +import { Component, Host, h, State } from '@stencil/core'; /** Do not use this component in production, it is meant for testing purposes only and is not distributed in the production package. */ @Component({ @@ -6,8 +6,21 @@ import { Component, Host, h } from '@stencil/core'; styleUrl: 'dnn-example-form.scss', }) export class DnnExampleForm { + @State() resume: File; + @State() profilePicData: string; + @State() profilePicConfirmed = false; + private fieldset: HTMLDnnFieldsetElement; + private resumeDropped(detail: File[]): void { + var singleFile = detail[0]; + this.resume = singleFile; + } + + private profilePicCropped(imageData: string): void { + this.profilePicData = imageData; + } + render() { return ( @@ -165,14 +178,43 @@ export class DnnExampleForm { Subscribe to our newsletter - - + + {this.resume === undefined && + this.resumeDropped(e.detail)} /> + } + {this.resume && +

+ File: {this.resume.name} + this.resume = undefined}>Remove +

+ } +
+ +
+ {this.profilePicConfirmed === false && + this.profilePicCropped(e.detail)}/> + } + {this.profilePicConfirmed === false && this.profilePicData != undefined && + this.profilePicConfirmed = true}>Confirm Crop + } + {this.profilePicConfirmed && + [ + Profile Picture + , + { + this.profilePicData = undefined; + this.profilePicConfirmed = false; + } + } + > + Remove + + ] + } +
+
); } - } diff --git a/packages/stencil-library/src/components/examples/dnn-example-form/readme.md b/packages/stencil-library/src/components/examples/dnn-example-form/readme.md index a20b3aeba..dc4e31af4 100644 --- a/packages/stencil-library/src/components/examples/dnn-example-form/readme.md +++ b/packages/stencil-library/src/components/examples/dnn-example-form/readme.md @@ -21,10 +21,10 @@ Do not use this component in production, it is meant for testing purposes only a - [dnn-textarea](../../dnn-textarea) - [dnn-toggle](../../dnn-toggle) - [dnn-dropzone](../../dnn-dropzone) +- [dnn-button](../../dnn-button) - [dnn-image-cropper](../../dnn-image-cropper) - [dnn-monaco-editor](../../dnn-monaco-editor) - [dnn-richtext](../../dnn-richtext) -- [dnn-button](../../dnn-button) ### Graph ```mermaid @@ -37,10 +37,10 @@ graph TD; dnn-example-form --> dnn-textarea dnn-example-form --> dnn-toggle dnn-example-form --> dnn-dropzone + dnn-example-form --> dnn-button dnn-example-form --> dnn-image-cropper dnn-example-form --> dnn-monaco-editor dnn-example-form --> dnn-richtext - dnn-example-form --> dnn-button dnn-input --> dnn-fieldset dnn-color-input --> dnn-fieldset dnn-color-input --> dnn-modal