igniteui-webcomponents 6.1.1 → 6.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/animations/player.d.ts +1 -1
- package/animations/player.js.map +1 -1
- package/components/calendar/calendar.d.ts +1 -0
- package/components/calendar/calendar.js +5 -8
- package/components/calendar/calendar.js.map +1 -1
- package/components/calendar/themes/calendar.base.css.js +1 -1
- package/components/calendar/themes/calendar.base.css.js.map +1 -1
- package/components/calendar/themes/dark/calendar.bootstrap.css.js +1 -1
- package/components/calendar/themes/dark/calendar.bootstrap.css.js.map +1 -1
- package/components/calendar/themes/dark/calendar.fluent.css.js +1 -1
- package/components/calendar/themes/dark/calendar.fluent.css.js.map +1 -1
- package/components/calendar/themes/dark/calendar.indigo.css.js +1 -1
- package/components/calendar/themes/dark/calendar.indigo.css.js.map +1 -1
- package/components/calendar/themes/dark/calendar.material.css.js +1 -1
- package/components/calendar/themes/dark/calendar.material.css.js.map +1 -1
- package/components/calendar/themes/light/calendar.bootstrap.css.js +1 -1
- package/components/calendar/themes/light/calendar.bootstrap.css.js.map +1 -1
- package/components/calendar/themes/light/calendar.fluent.css.js +1 -1
- package/components/calendar/themes/light/calendar.fluent.css.js.map +1 -1
- package/components/calendar/themes/light/calendar.indigo.css.js +1 -1
- package/components/calendar/themes/light/calendar.indigo.css.js.map +1 -1
- package/components/calendar/themes/light/calendar.material.css.js +1 -1
- package/components/calendar/themes/light/calendar.material.css.js.map +1 -1
- package/components/calendar/themes/shared/bootstrap/calendar.bootstrap.css.js +1 -1
- package/components/calendar/themes/shared/bootstrap/calendar.bootstrap.css.js.map +1 -1
- package/components/calendar/themes/shared/fluent/calendar.fluent.css.js +1 -1
- package/components/calendar/themes/shared/fluent/calendar.fluent.css.js.map +1 -1
- package/components/calendar/themes/shared/indigo/calendar.indigo.css.js +1 -1
- package/components/calendar/themes/shared/indigo/calendar.indigo.css.js.map +1 -1
- package/components/calendar/themes/shared/material/calendar.material.css.js +1 -1
- package/components/calendar/themes/shared/material/calendar.material.css.js.map +1 -1
- package/components/carousel/carousel.d.ts +4 -6
- package/components/carousel/carousel.js +29 -50
- package/components/carousel/carousel.js.map +1 -1
- package/components/combo/themes/dark/combo.bootstrap.css.js +1 -1
- package/components/combo/themes/dark/combo.bootstrap.css.js.map +1 -1
- package/components/combo/themes/light/combo.bootstrap.css.js +1 -1
- package/components/combo/themes/light/combo.bootstrap.css.js.map +1 -1
- package/components/combo/themes/light/combo.shared.css.js +1 -1
- package/components/combo/themes/light/combo.shared.css.js.map +1 -1
- package/components/common/mixins/alert.d.ts +7 -8
- package/components/common/mixins/alert.js +23 -34
- package/components/common/mixins/alert.js.map +1 -1
- package/components/date-picker/themes/dark/date-picker.bootstrap.css.js +1 -1
- package/components/date-picker/themes/dark/date-picker.bootstrap.css.js.map +1 -1
- package/components/date-picker/themes/dark/date-picker.fluent.css.js +1 -1
- package/components/date-picker/themes/dark/date-picker.fluent.css.js.map +1 -1
- package/components/date-picker/themes/dark/date-picker.indigo.css.js +1 -1
- package/components/date-picker/themes/dark/date-picker.indigo.css.js.map +1 -1
- package/components/date-picker/themes/dark/date-picker.material.css.js +1 -1
- package/components/date-picker/themes/dark/date-picker.material.css.js.map +1 -1
- package/components/date-picker/themes/light/date-picker.bootstrap.css.js +1 -1
- package/components/date-picker/themes/light/date-picker.bootstrap.css.js.map +1 -1
- package/components/date-picker/themes/light/date-picker.fluent.css.js +1 -1
- package/components/date-picker/themes/light/date-picker.fluent.css.js.map +1 -1
- package/components/date-picker/themes/light/date-picker.indigo.css.js +1 -1
- package/components/date-picker/themes/light/date-picker.indigo.css.js.map +1 -1
- package/components/date-picker/themes/light/date-picker.material.css.js +1 -1
- package/components/date-picker/themes/light/date-picker.material.css.js.map +1 -1
- package/components/date-picker/themes/shared/date-picker.bootstrap.css.js +1 -1
- package/components/date-picker/themes/shared/date-picker.bootstrap.css.js.map +1 -1
- package/components/date-picker/themes/shared/date-picker.common.css.js +1 -1
- package/components/date-picker/themes/shared/date-picker.common.css.js.map +1 -1
- package/components/date-picker/themes/shared/date-picker.fluent.css.js +1 -1
- package/components/date-picker/themes/shared/date-picker.fluent.css.js.map +1 -1
- package/components/date-picker/themes/shared/date-picker.indigo.css.js +1 -1
- package/components/date-picker/themes/shared/date-picker.indigo.css.js.map +1 -1
- package/components/date-range-picker/themes/dark/date-range-picker.bootstrap.css.js +1 -1
- package/components/date-range-picker/themes/dark/date-range-picker.bootstrap.css.js.map +1 -1
- package/components/date-range-picker/themes/dark/date-range-picker.fluent.css.js +1 -1
- package/components/date-range-picker/themes/dark/date-range-picker.fluent.css.js.map +1 -1
- package/components/date-range-picker/themes/dark/date-range-picker.indigo.css.js +1 -1
- package/components/date-range-picker/themes/dark/date-range-picker.indigo.css.js.map +1 -1
- package/components/date-range-picker/themes/dark/date-range-picker.material.css.js +1 -1
- package/components/date-range-picker/themes/dark/date-range-picker.material.css.js.map +1 -1
- package/components/date-range-picker/themes/shared/date-range-picker.bootstrap.css.js +1 -1
- package/components/date-range-picker/themes/shared/date-range-picker.bootstrap.css.js.map +1 -1
- package/components/date-range-picker/themes/shared/date-range-picker.common.css.js +1 -1
- package/components/date-range-picker/themes/shared/date-range-picker.common.css.js.map +1 -1
- package/components/date-range-picker/themes/shared/date-range-picker.fluent.css.js +1 -1
- package/components/date-range-picker/themes/shared/date-range-picker.fluent.css.js.map +1 -1
- package/components/date-range-picker/themes/shared/date-range-picker.indigo.css.js +1 -1
- package/components/date-range-picker/themes/shared/date-range-picker.indigo.css.js.map +1 -1
- package/components/file-input/themes/dark/file-input.bootstrap.css.d.ts +1 -0
- package/components/file-input/themes/dark/file-input.bootstrap.css.js +3 -0
- package/components/file-input/themes/dark/file-input.bootstrap.css.js.map +1 -0
- package/components/file-input/themes/dark/file-input.fluent.css.d.ts +1 -0
- package/components/file-input/themes/dark/file-input.fluent.css.js +3 -0
- package/components/file-input/themes/dark/file-input.fluent.css.js.map +1 -0
- package/components/file-input/themes/dark/file-input.indigo.css.d.ts +1 -0
- package/components/file-input/themes/dark/file-input.indigo.css.js +3 -0
- package/components/file-input/themes/dark/file-input.indigo.css.js.map +1 -0
- package/components/file-input/themes/dark/file-input.material.css.d.ts +1 -0
- package/components/file-input/themes/dark/file-input.material.css.js +3 -0
- package/components/file-input/themes/dark/file-input.material.css.js.map +1 -0
- package/components/file-input/themes/file-input.base.css.js +1 -1
- package/components/file-input/themes/file-input.base.css.js.map +1 -1
- package/components/file-input/themes/light/file-input.bootstrap.css.d.ts +1 -0
- package/components/file-input/themes/light/file-input.bootstrap.css.js +3 -0
- package/components/file-input/themes/light/file-input.bootstrap.css.js.map +1 -0
- package/components/file-input/themes/light/file-input.fluent.css.d.ts +1 -0
- package/components/file-input/themes/light/file-input.fluent.css.js +3 -0
- package/components/file-input/themes/light/file-input.fluent.css.js.map +1 -0
- package/components/file-input/themes/light/file-input.indigo.css.d.ts +1 -0
- package/components/file-input/themes/light/file-input.indigo.css.js +3 -0
- package/components/file-input/themes/light/file-input.indigo.css.js.map +1 -0
- package/components/file-input/themes/light/file-input.material.css.d.ts +1 -0
- package/components/file-input/themes/light/file-input.material.css.js +3 -0
- package/components/file-input/themes/light/file-input.material.css.js.map +1 -0
- package/components/file-input/themes/light/file-input.shared.css.d.ts +1 -0
- package/components/file-input/themes/light/file-input.shared.css.js +3 -0
- package/components/file-input/themes/light/file-input.shared.css.js.map +1 -0
- package/components/file-input/themes/shared/file-input.bootstrap.css.js +1 -1
- package/components/file-input/themes/shared/file-input.bootstrap.css.js.map +1 -1
- package/components/file-input/themes/shared/file-input.indigo.css.js +1 -1
- package/components/file-input/themes/shared/file-input.indigo.css.js.map +1 -1
- package/components/file-input/themes/themes.js +19 -0
- package/components/file-input/themes/themes.js.map +1 -1
- package/components/input/themes/shared/input.bootstrap.css.js +1 -1
- package/components/input/themes/shared/input.bootstrap.css.js.map +1 -1
- package/components/input/themes/shared/input.indigo.css.js +1 -1
- package/components/input/themes/shared/input.indigo.css.js.map +1 -1
- package/components/select/themes/shared/select.bootstrap.css.js +1 -1
- package/components/select/themes/shared/select.bootstrap.css.js.map +1 -1
- package/components/snackbar/snackbar.d.ts +3 -5
- package/components/snackbar/snackbar.js +5 -5
- package/components/snackbar/snackbar.js.map +1 -1
- package/components/stepper/stepper.d.ts +1 -0
- package/components/stepper/stepper.js +9 -0
- package/components/stepper/stepper.js.map +1 -1
- package/components/textarea/themes/shared/textarea.bootstrap.css.js +1 -1
- package/components/textarea/themes/shared/textarea.bootstrap.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.common.css.js +1 -1
- package/components/textarea/themes/shared/textarea.common.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.fluent.css.js +1 -1
- package/components/textarea/themes/shared/textarea.fluent.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.indigo.css.js +1 -1
- package/components/textarea/themes/shared/textarea.indigo.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.material.css.js +1 -1
- package/components/textarea/themes/shared/textarea.material.css.js.map +1 -1
- package/components/toast/toast.d.ts +1 -2
- package/components/toast/toast.js +1 -1
- package/components/toast/toast.js.map +1 -1
- package/components/validation-container/validation-container.d.ts +7 -5
- package/components/validation-container/validation-container.js +48 -35
- package/components/validation-container/validation-container.js.map +1 -1
- package/custom-elements.json +199 -128
- package/igniteui-webcomponents.css-data.json +1 -1
- package/igniteui-webcomponents.html-data.json +1 -1
- package/package.json +1 -1
- package/web-types.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.material.css.js","sourceRoot":"","sources":["../../../../../src/components/textarea/themes/shared/textarea.material.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,84WAA84W,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host{font-family:var(--ig-subtitle-1-font-family, var(--ig-font-family));font-size:var(--ig-subtitle-1-font-size);font-weight:var(--ig-subtitle-1-font-weight);font-style:var(--ig-subtitle-1-font-style);line-height:var(--ig-subtitle-1-line-height);letter-spacing:var(--ig-subtitle-1-letter-spacing);text-transform:var(--ig-subtitle-1-text-transform);margin-top:var(--ig-subtitle-1-margin-top);margin-bottom:var(--ig-subtitle-1-margin-bottom);--component-size: var(--ig-size, var(--default-size))}:host ::part(helper-text){font-family:var(--ig-caption-font-family, var(--ig-font-family));font-size:var(--ig-caption-font-size);font-weight:var(--ig-caption-font-weight);font-style:var(--ig-caption-font-style);line-height:var(--ig-caption-line-height);letter-spacing:var(--ig-caption-letter-spacing);text-transform:var(--ig-caption-text-transform);margin-top:var(--ig-caption-margin-top);margin-bottom:var(--ig-caption-margin-bottom);color:var(--helper-text-color);grid-auto-rows:minmax(1.125rem, auto);margin-block-start:.25rem;padding-inline:max(var(--is-large, 1)*max(1.125rem, -1 * 1.125rem)*var(--ig-spacing-inline-large, var(--ig-spacing-inline, --ig-spacing)),var(--is-medium, 1)*max(1rem, -1 * 1rem)*var(--ig-spacing-inline-medium, var(--ig-spacing-inline, --ig-spacing)),var(--is-small, 1)*max(0.875rem, -1 * 0.875rem)*var(--ig-spacing-inline-small, var(--ig-spacing-inline, --ig-spacing)))}textarea{border:none;padding:0;overflow:auto;margin-block-start:1.25rem;grid-area:1/2/span 1/span 2;flex-grow:1;position:relative;max-width:inherit;padding-inline:.25rem}[part=label]{position:absolute;transform-origin:top left;inset-block-start:calc(1.25rem - 0.125rem);padding-inline-end:.25rem;transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1),font-size 150ms cubic-bezier(0.4, 0, 0.2, 1);will-change:transform,translate}:host(:focus-within) [part~=label],:host(:not([outlined])) [part~=placeholder] [part=label],:host(:not([outlined])) [part~=filled] [part=label]{font-family:var(--ig-caption-font-family, var(--ig-font-family));font-size:var(--ig-caption-font-size);font-weight:var(--ig-caption-font-weight);font-style:var(--ig-caption-font-style);line-height:var(--ig-caption-line-height);letter-spacing:var(--ig-caption-letter-spacing);text-transform:var(--ig-caption-text-transform);margin-top:var(--ig-caption-margin-top);margin-bottom:var(--ig-caption-margin-bottom);translate:0;inset-block-start:calc(1.25rem/4)}:host([outlined]:focus-within) [part=label],:host([outlined]) [part~=placeholder] [part=label],:host([outlined]) [part~=filled] [part=label]{font-family:var(--ig-caption-font-family, var(--ig-font-family));font-size:var(--ig-caption-font-size);font-weight:var(--ig-caption-font-weight);font-style:var(--ig-caption-font-style);line-height:var(--ig-caption-line-height);letter-spacing:var(--ig-caption-letter-spacing);text-transform:var(--ig-caption-text-transform);margin-top:var(--ig-caption-margin-top);margin-bottom:var(--ig-caption-margin-bottom);margin-block-end:0;display:inline-block;position:relative;inset-block:0;translate:0 calc(var(--textarea-label-position)*-1);padding-inline-end:0}:host(:not([outlined])) [part~=container]{overflow:hidden;border-start-start-radius:var(--box-border-radius);border-start-end-radius:var(--box-border-radius);background:var(--box-background);padding-inline-end:.0625rem}:host(:not([outlined])) [part~=container]::after{content:\"\";position:absolute;bottom:0%;width:100%;border-block-end:.0625rem solid var(--idle-bottom-line-color);transition:all .25s cubic-bezier(0.215, 0.61, 0.355, 1)}:host(:not([outlined])) [part~=container]:not([part~=suffixed]) textarea{margin-block-end:.125rem;grid-area:1/2/span 1/span 3}:host(:not([outlined]):hover) [part~=container]{background:var(--box-background-hover)}:host(:not([outlined]):hover) [part~=container]::after{border-block-end-width:.0625rem;border-block-end-color:var(--hover-bottom-line-color)}:host(:disabled:not([outlined])) [part~=container],:host([disabled]:not([outlined])) [part~=container]{background:var(--box-disabled-background)}:host(:disabled:not([outlined])) [part~=container]::after,:host([disabled]:not([outlined])) [part~=container]::after{border-block-end-color:var(--disabled-bottom-line-color);border-block-end-style:dashed}:host([invalid]:not(:disabled)) [part~=container]::after,:host([invalid]:not([disabled])) [part~=container]::after{border-block-end-color:var(--error-secondary-color)}:host([invalid]:not(:disabled)) [part~=label],:host([invalid]:not([disabled])) [part~=label]{color:var(--error-secondary-color)}:host([invalid]:not(:disabled)) ::part(helper-text),:host([invalid]:not([disabled])) ::part(helper-text){color:var(--error-secondary-color)}:host(:focus-within) [part~=label]{color:var(--focused-secondary-color)}:host(:not([outlined]):focus-within){color:var(--input-prefix-color--focused)}:host(:not([outlined]):focus-within) [part~=container]{background:var(--box-background-focus)}:host(:not([outlined]):focus-within) [part~=container]::after{border-block-end-width:.125rem;border-block-end-color:var(--focused-bottom-line-color)}:host(:not([outlined]):focus-within) [part~=prefix]{color:var(--input-prefix-color--focused);background:var(--input-prefix-background--focused)}:host(:not([outlined]):focus-within) [part~=suffix]{color:var(--input-suffix-color--focused);background:var(--input-suffix-background--focused)}:host([invalid]:not([outlined]):focus-within) [part~=container]::after{border-block-end-color:var(--error-secondary-color)}[part=start],[part=end]{display:flex;align-items:center;min-width:max(var(--is-large, 1)*max(0.875rem, -1 * 0.875rem)*var(--ig-spacing-large, var(--ig-spacing, --ig-spacing)),var(--is-medium, 1)*max(0.75rem, -1 * 0.75rem)*var(--ig-spacing-medium, var(--ig-spacing, --ig-spacing)),var(--is-small, 1)*max(0.625rem, -1 * 0.625rem)*var(--ig-spacing-small, var(--ig-spacing, --ig-spacing)));min-height:100%;overflow:hidden}[part=start]{grid-area:1/1}[part=notch]{display:flex;align-items:flex-start;width:auto;min-width:0;height:100%;position:relative;grid-area:1/2;padding-inline:.25rem}[part=filler]{grid-area:1/3}[part=end]{grid-area:1/4}[part~=prefixed] [part~=prefix]{padding-inline:max(var(--is-large, 1)*max(1rem, -1 * 1rem)*var(--ig-spacing-inline-large, var(--ig-spacing-inline, --ig-spacing)),var(--is-medium, 1)*max(0.875rem, -1 * 0.875rem)*var(--ig-spacing-inline-medium, var(--ig-spacing-inline, --ig-spacing)),var(--is-small, 1)*max(0.75rem, -1 * 0.75rem)*var(--ig-spacing-inline-small, var(--ig-spacing-inline, --ig-spacing)))}[part~=suffixed] [part~=suffix]{padding-inline:max(var(--is-large, 1)*max(1rem, -1 * 1rem)*var(--ig-spacing-inline-large, var(--ig-spacing-inline, --ig-spacing)),var(--is-medium, 1)*max(0.875rem, -1 * 0.875rem)*var(--ig-spacing-inline-medium, var(--ig-spacing-inline, --ig-spacing)),var(--is-small, 1)*max(0.75rem, -1 * 0.75rem)*var(--ig-spacing-inline-small, var(--ig-spacing-inline, --ig-spacing)))}[part~=filled]{color:var(--input-prefix-color--filled)}:host([outlined]){--textarea-label-position: calc(50% + (0.0625rem));align-items:initial;padding:0;box-shadow:none;border-radius:var(--border-border-radius);background:var(--border-background);overflow:initial}:host([outlined]) [part~=container]{grid-template-columns:auto auto 1fr auto;display:grid}:host([outlined]) [part~=container]:not([part~=suffixed]) textarea{grid-column:2/-1;max-width:calc(100% - 0.125rem)}:host([outlined]) [part~=container][part~=filled] [part=notch],:host([outlined]) [part~=container][part~=placeholder] [part=notch]{border-block-start:.125rem solid rgba(0,0,0,0)}:host([outlined]) [part=start]{width:auto;border-color:var(--border-color);border-style:solid;border-inline-start-width:.0625rem;border-inline-end-width:0;border-block-start-width:.0625rem;border-block-end-width:.0625rem;border-start-start-radius:var(--border-border-radius);border-end-start-radius:var(--border-border-radius)}:host([outlined]) [part=filler]{border-width:.0625rem;border-style:solid;border-color:var(--border-color);border-left:none;border-right:none}:host([outlined]) [part=notch]{border-block:.0625rem solid var(--border-color);padding:0 .25rem}:host([outlined]) [part=notch]:empty{display:none}:host([outlined]) [part=end]{display:flex;justify-content:flex-end;flex-grow:1;height:100%;grid-area:1/4;border-color:var(--border-color);border-style:solid;border-inline-start-width:0;border-inline-end-width:.0625rem;border-block-start-width:.0625rem;border-block-end-width:.0625rem;border-start-end-radius:var(--border-border-radius);border-end-end-radius:var(--border-border-radius)}:host([outlined]) textarea{bottom:.125rem}:host([outlined]:hover) [part=notch],:host([outlined]:hover) [part=start],:host([outlined]:hover) [part=end],:host([outlined]:hover) [part=filler]{border-color:var(--hover-border-color)}:host([outlined]:hover) [part~=container][part~=filled] [part=notch],:host([outlined]:hover) [part~=container][part~=placeholder] [part=notch]{border-block-start-color:rgba(0,0,0,0)}:host([outlined]:focus-within) [part=filler],:host([outlined]:focus-within) [part=notch]{border-block-width:.125rem}:host([outlined]:focus-within) [part=filler]{border-block-color:var(--focused-border-color)}:host([outlined]:focus-within) [part=notch]{border-block-start-color:rgba(0,0,0,0);border-block-end-color:var(--focused-border-color)}:host([outlined]:focus-within) [part=start]{border-color:var(--focused-border-color);border-inline-start-width:.125rem;border-inline-end-width:0;border-block-start-width:.125rem;border-block-end-width:.125rem}:host([outlined]:focus-within) [part=end]{border-color:var(--focused-border-color);border-inline-start-width:0;border-inline-end-width:.125rem;border-block-start-width:.125rem;border-block-end-width:.125rem}:host([outlined]:focus-within) [part~=prefix]{margin-inline-start:-0.0625rem}:host([outlined]:focus-within) [part~=suffix]{margin-inline-end:-0.0625rem}:host([invalid][outlined]:not(:disabled)) [part=start],:host([invalid][outlined]:not(:disabled)) [part=filler],:host([invalid][outlined]:not(:disabled)) [part=end],:host([invalid][outlined]:not(:disabled)) [part=notch],:host([invalid][outlined]:not(:disabled):focus-within) [part=start],:host([invalid][outlined]:not(:disabled):focus-within) [part=filler],:host([invalid][outlined]:not(:disabled):focus-within) [part=end],:host([invalid][outlined]:not(:disabled):focus-within) [part=notch],:host([invalid][outlined]:not([disabled])) [part=start],:host([invalid][outlined]:not([disabled])) [part=filler],:host([invalid][outlined]:not([disabled])) [part=end],:host([invalid][outlined]:not([disabled])) [part=notch],:host([invalid][outlined]:not([disabled]):focus-within) [part=start],:host([invalid][outlined]:not([disabled]):focus-within) [part=filler],:host([invalid][outlined]:not([disabled]):focus-within) [part=end],:host([invalid][outlined]:not([disabled]):focus-within) [part=notch]{border-color:var(--error-secondary-color)}:host([invalid][outlined]:not([disabled]):focus-within) [part=notch],:host([invalid][outlined]:not([disabled])) [part~=placeholder] [part=notch]{border-block-start-color:rgba(0,0,0,0)}:host(:disabled[outlined]) [part~=container],:host([disabled][outlined]) [part~=container]{background:var(--border-disabled-background)}:host(:disabled[outlined]) [part=start],:host(:disabled[outlined]) [part=filler],:host(:disabled[outlined]) [part=notch],:host(:disabled[outlined]) [part=end],:host([disabled][outlined]) [part=start],:host([disabled][outlined]) [part=filler],:host([disabled][outlined]) [part=notch],:host([disabled][outlined]) [part=end]{border-color:var(--disabled-border-color)}`;\n"]}
|
|
1
|
+
{"version":3,"file":"textarea.material.css.js","sourceRoot":"","sources":["../../../../../src/components/textarea/themes/shared/textarea.material.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,ghaAAgha,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host{font-family:var(--ig-subtitle-1-font-family, var(--ig-font-family));font-size:var(--ig-subtitle-1-font-size);font-weight:var(--ig-subtitle-1-font-weight);font-style:var(--ig-subtitle-1-font-style);line-height:var(--ig-subtitle-1-line-height);letter-spacing:var(--ig-subtitle-1-letter-spacing);text-transform:var(--ig-subtitle-1-text-transform);margin-top:var(--ig-subtitle-1-margin-top);margin-bottom:var(--ig-subtitle-1-margin-bottom);--component-size: var(--ig-size, var(--default-size))}:host ::part(helper-text){font-family:var(--ig-caption-font-family, var(--ig-font-family));font-size:var(--ig-caption-font-size);font-weight:var(--ig-caption-font-weight);font-style:var(--ig-caption-font-style);line-height:var(--ig-caption-line-height);letter-spacing:var(--ig-caption-letter-spacing);text-transform:var(--ig-caption-text-transform);margin-top:var(--ig-caption-margin-top);margin-bottom:var(--ig-caption-margin-bottom);color:var(--helper-text-color);grid-auto-rows:minmax(1.125rem, auto);margin-block-start:.25rem;padding-inline:max(var(--is-large, 1)*max(1.125rem, -1 * 1.125rem)*var(--ig-spacing-inline-large, var(--ig-spacing-inline, --ig-spacing)),var(--is-medium, 1)*max(1rem, -1 * 1rem)*var(--ig-spacing-inline-medium, var(--ig-spacing-inline, --ig-spacing)),var(--is-small, 1)*max(0.875rem, -1 * 0.875rem)*var(--ig-spacing-inline-small, var(--ig-spacing-inline, --ig-spacing)))}textarea{border:none;padding:0;overflow:auto;margin-block-start:1.25rem;grid-area:1/2/span 1/span 2;flex-grow:1;position:relative;max-width:inherit;padding-inline:.25rem}[part=label]{position:absolute;transform-origin:top left;inset-block-start:calc(1.25rem - 0.125rem);padding-inline-end:.25rem;transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1),font-size 150ms cubic-bezier(0.4, 0, 0.2, 1);will-change:transform,translate}:host(:not([readonly]):focus-within) [part~=label],:host(:not([outlined])) [part~=placeholder] [part=label],:host(:not([outlined])) [part~=filled] [part=label]{font-family:var(--ig-caption-font-family, var(--ig-font-family));font-size:var(--ig-caption-font-size);font-weight:var(--ig-caption-font-weight);font-style:var(--ig-caption-font-style);line-height:var(--ig-caption-line-height);letter-spacing:var(--ig-caption-letter-spacing);text-transform:var(--ig-caption-text-transform);margin-top:var(--ig-caption-margin-top);margin-bottom:var(--ig-caption-margin-bottom);translate:0;inset-block-start:calc(1.25rem/4)}:host([readonly][outlined]) [part~=container][part~=filled] [part=label],:host([readonly][outlined]) [part~=container][part~=placeholder] [part=label],:host(:not([readonly])[outlined]:focus-within) [part=label],:host([outlined]) [part~=placeholder] [part=label],:host([outlined]) [part~=filled] [part=label]{font-family:var(--ig-caption-font-family, var(--ig-font-family));font-size:var(--ig-caption-font-size);font-weight:var(--ig-caption-font-weight);font-style:var(--ig-caption-font-style);line-height:var(--ig-caption-line-height);letter-spacing:var(--ig-caption-letter-spacing);text-transform:var(--ig-caption-text-transform);margin-top:var(--ig-caption-margin-top);margin-bottom:var(--ig-caption-margin-bottom);margin-block-end:0;display:inline-block;position:relative;inset-block:0;translate:0 calc(var(--textarea-label-position)*-1);padding-inline-end:0}:host(:not([outlined])) [part~=container]{overflow:hidden;border-start-start-radius:var(--box-border-radius);border-start-end-radius:var(--box-border-radius);background:var(--box-background);padding-inline-end:.0625rem}:host(:not([outlined])) [part~=container]::after{content:\"\";position:absolute;bottom:0%;width:100%;border-block-end:.0625rem solid var(--idle-bottom-line-color);transition:all .25s cubic-bezier(0.215, 0.61, 0.355, 1)}:host(:not([outlined])) [part~=container]:not([part~=suffixed]) textarea{margin-block-end:.125rem;grid-area:1/2/span 1/span 3}:host(:not([outlined],[readonly]):hover) [part~=container]{background:var(--box-background-hover)}:host(:not([outlined],[readonly]):hover) [part~=container]::after{border-block-end-width:.0625rem;border-block-end-color:var(--hover-bottom-line-color)}:host(:disabled:not([outlined])) [part~=container],:host([disabled]:not([outlined])) [part~=container]{background:var(--box-disabled-background)}:host(:disabled:not([outlined])) [part~=container]::after,:host([disabled]:not([outlined])) [part~=container]::after{border-block-end-color:var(--disabled-bottom-line-color);border-block-end-style:dashed}:host([invalid]:not(:disabled)) [part~=container]::after,:host([invalid]:not([disabled])) [part~=container]::after{border-block-end-color:var(--error-secondary-color)}:host([invalid]:not(:disabled)) [part~=label],:host([invalid]:not([disabled])) [part~=label]{color:var(--error-secondary-color)}:host([invalid]:not(:disabled)) ::part(helper-text),:host([invalid]:not([disabled])) ::part(helper-text){color:var(--error-secondary-color)}:host(:focus-within) [part~=label]{color:var(--focused-secondary-color)}:host(:not([outlined]):focus-within){color:var(--input-prefix-color--focused)}:host(:not([outlined]):focus-within) [part~=container]{background:var(--box-background-focus)}:host(:not([outlined]):focus-within) [part~=container]::after{border-block-end-width:.125rem;border-block-end-color:var(--focused-bottom-line-color)}:host(:not([outlined],[readonly]):focus-within) [part~=prefix]{color:var(--input-prefix-color--focused);background:var(--input-prefix-background--focused)}:host(:not([outlined],[readonly]):focus-within) [part~=suffix]{color:var(--input-suffix-color--focused);background:var(--input-suffix-background--focused)}:host(:not([outlined],[disabled])[readonly]) [part~=container]{background:var(--box-background-focus)}:host([invalid]:not([outlined]):focus-within) [part~=container]::after{border-block-end-color:var(--error-secondary-color)}[part=start],[part=end]{display:flex;align-items:center;min-width:max(var(--is-large, 1)*max(0.875rem, -1 * 0.875rem)*var(--ig-spacing-large, var(--ig-spacing, --ig-spacing)),var(--is-medium, 1)*max(0.75rem, -1 * 0.75rem)*var(--ig-spacing-medium, var(--ig-spacing, --ig-spacing)),var(--is-small, 1)*max(0.625rem, -1 * 0.625rem)*var(--ig-spacing-small, var(--ig-spacing, --ig-spacing)));min-height:100%;overflow:hidden}[part=start]{grid-area:1/1}[part=notch]{display:flex;align-items:flex-start;width:auto;min-width:0;height:100%;position:relative;grid-area:1/2;padding-inline:.25rem}[part=filler]{grid-area:1/3}[part=end]{grid-area:1/4}[part~=prefixed] [part~=prefix]{padding-inline:max(var(--is-large, 1)*max(1rem, -1 * 1rem)*var(--ig-spacing-inline-large, var(--ig-spacing-inline, --ig-spacing)),var(--is-medium, 1)*max(0.875rem, -1 * 0.875rem)*var(--ig-spacing-inline-medium, var(--ig-spacing-inline, --ig-spacing)),var(--is-small, 1)*max(0.75rem, -1 * 0.75rem)*var(--ig-spacing-inline-small, var(--ig-spacing-inline, --ig-spacing)))}[part~=suffixed] [part~=suffix]{padding-inline:max(var(--is-large, 1)*max(1rem, -1 * 1rem)*var(--ig-spacing-inline-large, var(--ig-spacing-inline, --ig-spacing)),var(--is-medium, 1)*max(0.875rem, -1 * 0.875rem)*var(--ig-spacing-inline-medium, var(--ig-spacing-inline, --ig-spacing)),var(--is-small, 1)*max(0.75rem, -1 * 0.75rem)*var(--ig-spacing-inline-small, var(--ig-spacing-inline, --ig-spacing)))}[part~=filled]{color:var(--input-prefix-color--filled)}:host([outlined]){--textarea-label-position: calc(50% + (0.0625rem));align-items:initial;padding:0;box-shadow:none;border-radius:var(--border-border-radius);background:var(--border-background);overflow:initial}:host([outlined]) [part~=container]{grid-template-columns:auto auto 1fr auto;display:grid}:host([outlined]) [part~=container]:not([part~=suffixed]) textarea{grid-column:2/-1;max-width:calc(100% - 0.125rem)}:host([outlined]) [part~=container][part~=filled] [part=notch],:host([outlined]) [part~=container][part~=placeholder] [part=notch]{border-block-start:.125rem solid rgba(0,0,0,0)}:host([outlined]) [part=start]{width:auto;border-color:var(--border-color);border-style:solid;border-inline-start-width:.0625rem;border-inline-end-width:0;border-block-start-width:.0625rem;border-block-end-width:.0625rem;border-start-start-radius:var(--border-border-radius);border-end-start-radius:var(--border-border-radius)}:host([outlined]) [part=filler]{border-width:.0625rem;border-style:solid;border-color:var(--border-color);border-left:none;border-right:none}:host([outlined]) [part=notch]{border-block:.0625rem solid var(--border-color);padding:0 .25rem}:host([outlined]) [part=notch]:empty{display:none}:host([outlined]) [part=end]{display:flex;justify-content:flex-end;flex-grow:1;height:100%;grid-area:1/4;border-color:var(--border-color);border-style:solid;border-inline-start-width:0;border-inline-end-width:.0625rem;border-block-start-width:.0625rem;border-block-end-width:.0625rem;border-start-end-radius:var(--border-border-radius);border-end-end-radius:var(--border-border-radius)}:host([outlined]) textarea{bottom:.125rem}:host(:not([readonly],:focus-within)[outlined]:hover) [part=notch],:host(:not([readonly],:focus-within)[outlined]:hover) [part=start],:host(:not([readonly],:focus-within)[outlined]:hover) [part=end],:host(:not([readonly],:focus-within)[outlined]:hover) [part=filler]{border-color:var(--hover-border-color)}:host(:not([readonly],:focus-within)[outlined]:hover) [part~=container][part~=filled] [part=notch],:host(:not([readonly],:focus-within)[outlined]:hover) [part~=container][part~=placeholder] [part=notch]{border-block-start-color:rgba(0,0,0,0)}:host(:not([readonly])[outlined]:focus-within) [part=notch]{border-block-start-color:rgba(0,0,0,0)}:host([readonly][outlined]) [part~=container][part~=filled] [part=notch],:host([readonly][outlined]) [part~=container][part~=placeholder] [part=notch]{border-block-start-color:rgba(0,0,0,0)}:host([readonly][outlined]:focus-within) [part=label]{inset-block-start:calc(1.25rem - 0.1875rem)}:host([readonly][outlined]:focus-within) [part=notch]{border-block-start-color:var(--focused-border-color)}:host(:not(:disabled)[readonly][outlined][invalid]:focus-within) [part=notch],:host(:not([disabled])[readonly][outlined][invalid]:focus-within) [part=notch]{border-block-start-color:var(--error-secondary-color)}:host(:not(:disabled)[readonly][outlined][invalid]:focus-within) [part~=container][part~=filled] [part=notch],:host(:not(:disabled)[readonly][outlined][invalid]:focus-within) [part~=container][part~=placeholder] [part=notch],:host(:not([disabled])[readonly][outlined][invalid]:focus-within) [part~=container][part~=filled] [part=notch],:host(:not([disabled])[readonly][outlined][invalid]:focus-within) [part~=container][part~=placeholder] [part=notch]{border-block-start-color:rgba(0,0,0,0)}:host([outlined]:focus-within) [part=filler],:host([outlined]:focus-within) [part=notch]{border-block-width:.125rem}:host([outlined]:focus-within) [part=filler]{border-block-color:var(--focused-border-color)}:host([outlined]:focus-within) [part=notch]{border-block-end-color:var(--focused-border-color)}:host([outlined]:focus-within) [part=start]{border-color:var(--focused-border-color);border-inline-start-width:.125rem;border-inline-end-width:0;border-block-start-width:.125rem;border-block-end-width:.125rem}:host([outlined]:focus-within) [part=end]{border-color:var(--focused-border-color);border-inline-start-width:0;border-inline-end-width:.125rem;border-block-start-width:.125rem;border-block-end-width:.125rem}:host([outlined]:focus-within) [part~=prefix]{margin-inline-start:-0.0625rem}:host([outlined]:focus-within) [part~=suffix]{margin-inline-end:-0.0625rem}:host([invalid][outlined]:not(:disabled)) [part=start],:host([invalid][outlined]:not(:disabled)) [part=filler],:host([invalid][outlined]:not(:disabled)) [part=end],:host([invalid][outlined]:not(:disabled)) [part=notch],:host([invalid][outlined]:not(:disabled):focus-within) [part=start],:host([invalid][outlined]:not(:disabled):focus-within) [part=filler],:host([invalid][outlined]:not(:disabled):focus-within) [part=end],:host([invalid][outlined]:not(:disabled):focus-within) [part=notch],:host([invalid][outlined]:not([disabled])) [part=start],:host([invalid][outlined]:not([disabled])) [part=filler],:host([invalid][outlined]:not([disabled])) [part=end],:host([invalid][outlined]:not([disabled])) [part=notch],:host([invalid][outlined]:not([disabled]):focus-within) [part=start],:host([invalid][outlined]:not([disabled]):focus-within) [part=filler],:host([invalid][outlined]:not([disabled]):focus-within) [part=end],:host([invalid][outlined]:not([disabled]):focus-within) [part=notch]{border-color:var(--error-secondary-color)}:host([invalid][outlined]:not([disabled]):focus-within) [part=notch],:host([invalid][outlined]:not([disabled])) [part~=placeholder] [part=notch]{border-block-start-color:rgba(0,0,0,0)}:host(:disabled[outlined]) [part~=container],:host([disabled][outlined]) [part~=container]{background:var(--border-disabled-background)}:host(:disabled[outlined]) [part=start],:host(:disabled[outlined]) [part=filler],:host(:disabled[outlined]) [part=notch],:host(:disabled[outlined]) [part=end],:host([disabled][outlined]) [part=start],:host([disabled][outlined]) [part=filler],:host([disabled][outlined]) [part=notch],:host([disabled][outlined]) [part=end]{border-color:var(--disabled-border-color)}`;\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { addAnimationController } from '../../animations/player.js';
|
|
2
1
|
import { IgcBaseAlertLikeComponent } from '../common/mixins/alert.js';
|
|
3
2
|
/**
|
|
4
3
|
* A toast component is used to show a notification
|
|
@@ -10,7 +9,7 @@ import { IgcBaseAlertLikeComponent } from '../common/mixins/alert.js';
|
|
|
10
9
|
export default class IgcToastComponent extends IgcBaseAlertLikeComponent {
|
|
11
10
|
static readonly tagName = "igc-toast";
|
|
12
11
|
static styles: import("lit").CSSResult[];
|
|
13
|
-
protected
|
|
12
|
+
protected readonly _player: import("../../animations/player.js").AnimationController;
|
|
14
13
|
static register(): void;
|
|
15
14
|
constructor();
|
|
16
15
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.js","sourceRoot":"","sources":["../../../src/components/toast/toast.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"toast.js","sourceRoot":"","sources":["../../../src/components/toast/toast.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AASpD,MAAqB,iBAAkB,SAAQ,yBAAyB;IAO/D,MAAM,CAAC,QAAQ;QACpB,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;IAED;QACE,KAAK,EAAE,CAAC;QARkB,YAAO,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAC;QASjE,oBAAoB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAClC,CAAC;IAEkB,MAAM;QACvB,OAAO,IAAI,CAAA,gBAAgB,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC;IAClD,CAAC;;AAjBsB,yBAAO,GAAG,WAAW,AAAd,CAAe;AACtB,wBAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,AAAnB,CAAoB;eAF9B,iBAAiB","sourcesContent":["import { html } from 'lit';\nimport { addAnimationController } from '../../animations/player.js';\nimport { addThemingController } from '../../theming/theming-controller.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport { IgcBaseAlertLikeComponent } from '../common/mixins/alert.js';\nimport { styles as shared } from './themes/shared/toast.common.css.js';\nimport { all } from './themes/themes.js';\nimport { styles } from './themes/toast.base.css.js';\n\n/**\n * A toast component is used to show a notification\n *\n * @element igc-toast\n *\n * @csspart base - The base wrapper of the toast.\n */\nexport default class IgcToastComponent extends IgcBaseAlertLikeComponent {\n public static readonly tagName = 'igc-toast';\n public static override styles = [styles, shared];\n\n protected override readonly _player = addAnimationController(this);\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(IgcToastComponent);\n }\n\n constructor() {\n super();\n addThemingController(this, all);\n }\n\n protected override render() {\n return html`<slot .inert=${!this.open}></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-toast': IgcToastComponent;\n }\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement, nothing, type TemplateResult } from 'lit';
|
|
2
2
|
import type { IgcFormControl } from '../common/mixins/forms/types.js';
|
|
3
|
+
/** Configuration for the validation container. */
|
|
3
4
|
interface ValidationContainerConfig {
|
|
4
5
|
/** The id attribute for the validation container. */
|
|
5
6
|
id?: string;
|
|
@@ -29,11 +30,12 @@ export default class IgcValidationContainerComponent extends LitElement {
|
|
|
29
30
|
get target(): IgcFormControl;
|
|
30
31
|
constructor();
|
|
31
32
|
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
protected
|
|
35
|
-
protected
|
|
36
|
-
protected
|
|
33
|
+
/** @internal */
|
|
34
|
+
handleEvent(event: Event): void;
|
|
35
|
+
protected _renderValidationMessage(slotName: string): TemplateResult;
|
|
36
|
+
protected _renderValidationSlots(validity: ValidityState, projected?: boolean): Generator<TemplateResult>;
|
|
37
|
+
protected _renderHelper(): TemplateResult | typeof nothing;
|
|
38
|
+
protected render(): TemplateResult;
|
|
37
39
|
}
|
|
38
40
|
declare global {
|
|
39
41
|
interface HTMLElementTagNameMap {
|
|
@@ -15,20 +15,24 @@ import IgcIconComponent from '../icon/icon.js';
|
|
|
15
15
|
import { styles as shared } from './themes/shared/validator.common.css.js';
|
|
16
16
|
import { all } from './themes/themes.js';
|
|
17
17
|
import { styles } from './themes/validator.base.css.js';
|
|
18
|
+
const VALIDATION_SLOTS_SELECTOR = 'slot:not([name="helper-text"])';
|
|
19
|
+
const ALL_SLOTS_SELECTOR = 'slot';
|
|
18
20
|
function getValidationSlots(element) {
|
|
19
|
-
return element.renderRoot.querySelectorAll(
|
|
21
|
+
return element.renderRoot.querySelectorAll(VALIDATION_SLOTS_SELECTOR);
|
|
20
22
|
}
|
|
21
23
|
function hasProjection(element) {
|
|
22
|
-
|
|
24
|
+
const allSlots = element.renderRoot.querySelectorAll(ALL_SLOTS_SELECTOR);
|
|
25
|
+
return Array.from(allSlots).every((slot) => isEmpty(slot.assignedElements({ flatten: true })));
|
|
23
26
|
}
|
|
24
27
|
function hasProjectedValidation(element, slotName) {
|
|
25
|
-
const config = { flatten: true };
|
|
26
28
|
const slots = Array.from(getValidationSlots(element));
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
const config = { flatten: true };
|
|
30
|
+
if (slotName) {
|
|
31
|
+
return slots
|
|
29
32
|
.filter((slot) => slot.name === slotName)
|
|
30
|
-
.some((slot) => slot.assignedElements(config)
|
|
31
|
-
|
|
33
|
+
.some((slot) => !isEmpty(slot.assignedElements(config)));
|
|
34
|
+
}
|
|
35
|
+
return slots.some((slot) => !isEmpty(slot.assignedElements(config)));
|
|
32
36
|
}
|
|
33
37
|
class IgcValidationContainerComponent extends LitElement {
|
|
34
38
|
static register() {
|
|
@@ -38,20 +42,20 @@ class IgcValidationContainerComponent extends LitElement {
|
|
|
38
42
|
id: 'helper-text',
|
|
39
43
|
hasHelperText: true,
|
|
40
44
|
}) {
|
|
41
|
-
const { renderValidationSlots } = IgcValidationContainerComponent.prototype;
|
|
42
45
|
const helperText = config.hasHelperText
|
|
43
46
|
? html `<slot name="helper-text" slot="helper-text"></slot>`
|
|
44
|
-
:
|
|
47
|
+
: nothing;
|
|
48
|
+
const validationSlots = IgcValidationContainerComponent.prototype._renderValidationSlots(host.validity, true);
|
|
45
49
|
return html `
|
|
46
50
|
<igc-validator
|
|
47
51
|
id=${ifDefined(config.id)}
|
|
48
52
|
part=${ifDefined(config.part)}
|
|
49
53
|
slot=${ifDefined(config.slot)}
|
|
50
|
-
.target=${host}
|
|
51
54
|
?invalid=${host.invalid}
|
|
55
|
+
.target=${host}
|
|
52
56
|
exportparts="helper-text validation-message validation-icon"
|
|
53
57
|
>
|
|
54
|
-
${helperText}${
|
|
58
|
+
${helperText}${validationSlots}
|
|
55
59
|
</igc-validator>
|
|
56
60
|
`;
|
|
57
61
|
}
|
|
@@ -77,60 +81,69 @@ class IgcValidationContainerComponent extends LitElement {
|
|
|
77
81
|
root.addEventListener('slotchange', this);
|
|
78
82
|
return root;
|
|
79
83
|
}
|
|
80
|
-
handleEvent(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
handleEvent(event) {
|
|
85
|
+
switch (event.type) {
|
|
86
|
+
case 'invalid':
|
|
87
|
+
if (!this.invalid) {
|
|
88
|
+
this.invalid = true;
|
|
89
|
+
}
|
|
90
|
+
break;
|
|
91
|
+
case 'slotchange': {
|
|
92
|
+
const newHasSlottedContent = hasProjectedValidation(this);
|
|
93
|
+
if (this._hasSlottedContent !== newHasSlottedContent) {
|
|
94
|
+
this._hasSlottedContent = newHasSlottedContent;
|
|
95
|
+
}
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
86
98
|
}
|
|
87
99
|
this.requestUpdate();
|
|
88
100
|
}
|
|
89
|
-
|
|
90
|
-
const
|
|
101
|
+
_renderValidationMessage(slotName) {
|
|
102
|
+
const hasProjectedIcon = hasProjectedValidation(this, slotName);
|
|
103
|
+
const parts = { 'validation-message': true, empty: !hasProjectedIcon };
|
|
104
|
+
const icon = hasProjectedIcon
|
|
91
105
|
? html `
|
|
92
106
|
<igc-icon
|
|
93
107
|
aria-hidden="true"
|
|
94
108
|
name="error"
|
|
95
|
-
collection="default"
|
|
96
109
|
part="validation-icon"
|
|
97
110
|
></igc-icon>
|
|
98
111
|
`
|
|
99
|
-
:
|
|
112
|
+
: nothing;
|
|
100
113
|
return html `
|
|
101
|
-
<div part=${partMap(
|
|
114
|
+
<div part=${partMap(parts)}>
|
|
102
115
|
${icon}
|
|
103
116
|
<slot name=${slotName}></slot>
|
|
104
117
|
</div>
|
|
105
118
|
`;
|
|
106
119
|
}
|
|
107
|
-
*
|
|
120
|
+
*_renderValidationSlots(validity, projected = false) {
|
|
121
|
+
if (!validity.valid) {
|
|
122
|
+
yield projected
|
|
123
|
+
? html `<slot name="invalid" slot="invalid"></slot>`
|
|
124
|
+
: this._renderValidationMessage('invalid');
|
|
125
|
+
}
|
|
108
126
|
for (const key in validity) {
|
|
109
|
-
if (key
|
|
110
|
-
yield projected
|
|
111
|
-
? html `<slot name="invalid" slot="invalid"></slot>`
|
|
112
|
-
: this.renderValidationMessage('invalid');
|
|
113
|
-
}
|
|
114
|
-
else if (validity[key]) {
|
|
127
|
+
if (key !== 'valid' && validity[key]) {
|
|
115
128
|
const name = toKebabCase(key);
|
|
116
129
|
yield projected
|
|
117
130
|
? html `<slot name=${name} slot=${name}></slot>`
|
|
118
|
-
: this.
|
|
131
|
+
: this._renderValidationMessage(name);
|
|
119
132
|
}
|
|
120
133
|
}
|
|
121
134
|
}
|
|
122
|
-
|
|
135
|
+
_renderHelper() {
|
|
123
136
|
return this.invalid && this._hasSlottedContent
|
|
124
137
|
? nothing
|
|
125
138
|
: html `<slot name="helper-text"></slot>`;
|
|
126
139
|
}
|
|
127
140
|
render() {
|
|
141
|
+
const slots = this.invalid
|
|
142
|
+
? this._renderValidationSlots(this.target.validity)
|
|
143
|
+
: nothing;
|
|
128
144
|
return html `
|
|
129
145
|
<div part=${partMap({ 'helper-text': true, empty: hasProjection(this) })}>
|
|
130
|
-
${this.
|
|
131
|
-
? this.renderValidationSlots(this.target.validity)
|
|
132
|
-
: nothing}
|
|
133
|
-
${this.renderHelper()}
|
|
146
|
+
${slots}${this._renderHelper()}
|
|
134
147
|
</div>
|
|
135
148
|
`;
|
|
136
149
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation-container.js","sourceRoot":"","sources":["../../../src/components/validation-container/validation-container.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,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;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;6DAS9B","sourcesContent":["import { html, LitElement, nothing, type TemplateResult } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { addThemingController } from '../../theming/theming-controller.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport type { IgcFormControl } from '../common/mixins/forms/types.js';\nimport { partMap } from '../common/part-map.js';\nimport { isEmpty, toKebabCase } from '../common/util.js';\nimport IgcIconComponent from '../icon/icon.js';\nimport { styles as shared } from './themes/shared/validator.common.css.js';\nimport { all } from './themes/themes.js';\nimport { styles } from './themes/validator.base.css.js';\n\ninterface ValidationContainerConfig {\n /** The id attribute for the validation container. */\n id?: string;\n /** Project the validation container to the given slot inside the host shadow DOM. */\n slot?: string;\n /** Additional part(s) that should be bound to the validation container. */\n part?: string;\n /** Whether the validation container should expose a helper-text slot. */\n hasHelperText?: boolean;\n}\n\nfunction getValidationSlots(element: IgcValidationContainerComponent) {\n return element.renderRoot.querySelectorAll<HTMLSlotElement>(\n \"slot:not([name='helper-text'])\"\n );\n}\n\nfunction hasProjection(element: IgcValidationContainerComponent) {\n return Array.from(\n element.renderRoot.querySelectorAll<HTMLSlotElement>('slot')\n ).every((slot) => isEmpty(slot.assignedElements({ flatten: true })));\n}\n\nfunction hasProjectedValidation(\n element: IgcValidationContainerComponent,\n slotName?: string\n) {\n const config: AssignedNodesOptions = { flatten: true };\n const slots = Array.from(getValidationSlots(element));\n return slotName\n ? slots\n .filter((slot) => slot.name === slotName)\n .some((slot) => slot.assignedElements(config).length > 0)\n : slots.some((slot) => slot.assignedElements(config).length > 0);\n}\n\n/* blazorSuppress */\n/**\n * @element igc-validator\n *\n * @csspart helper-text - The base wrapper\n * @csspart validation-message - The validation error message container\n * @csspart validation-icon - The validation error icon\n */\nexport default class IgcValidationContainerComponent extends LitElement {\n public static readonly tagName = 'igc-validator';\n public static override styles = [styles, shared];\n\n /* blazorSuppress */\n public static register() {\n registerComponent(IgcValidationContainerComponent, IgcIconComponent);\n }\n\n public static create(\n host: IgcFormControl,\n config: ValidationContainerConfig = {\n id: 'helper-text',\n hasHelperText: true,\n }\n ): TemplateResult {\n const { renderValidationSlots } = IgcValidationContainerComponent.prototype;\n const helperText = config.hasHelperText\n ? html`<slot name=\"helper-text\" slot=\"helper-text\"></slot>`\n : null;\n\n return html`\n <igc-validator\n id=${ifDefined(config.id)}\n part=${ifDefined(config.part)}\n slot=${ifDefined(config.slot)}\n .target=${host}\n ?invalid=${host.invalid}\n exportparts=\"helper-text validation-message validation-icon\"\n >\n ${helperText}${renderValidationSlots(host.validity, true)}\n </igc-validator>\n `;\n }\n\n private _target!: IgcFormControl;\n\n @state()\n private _hasSlottedContent = false;\n\n @property({ type: Boolean })\n public invalid = false;\n\n @property({ attribute: false })\n public set target(value: IgcFormControl) {\n if (this._target === value) {\n return;\n }\n\n this._target?.removeEventListener('invalid', this);\n this._target = value;\n this._target.addEventListener('invalid', this);\n }\n\n public get target() {\n return this._target;\n }\n\n constructor() {\n super();\n addThemingController(this, all);\n }\n\n protected override createRenderRoot() {\n const root = super.createRenderRoot();\n root.addEventListener('slotchange', this);\n return root;\n }\n\n public handleEvent({ type }: Event) {\n const isInvalid = type === 'invalid';\n const isSlotChange = type === 'slotchange';\n\n if (isInvalid || isSlotChange) {\n this.invalid = isInvalid ? true : this.invalid;\n this._hasSlottedContent = hasProjectedValidation(this);\n }\n\n this.requestUpdate();\n }\n\n protected renderValidationMessage(slotName: string) {\n const icon = hasProjectedValidation(this, slotName)\n ? html`\n <igc-icon\n aria-hidden=\"true\"\n name=\"error\"\n collection=\"default\"\n part=\"validation-icon\"\n ></igc-icon>\n `\n : null;\n\n return html`\n <div part=${partMap({ 'validation-message': true, empty: !icon })}>\n ${icon}\n <slot name=${slotName}></slot>\n </div>\n `;\n }\n\n protected *renderValidationSlots(validity: ValidityState, projected = false) {\n for (const key in validity) {\n if (key === 'valid' && !validity[key]) {\n yield projected\n ? html`<slot name=\"invalid\" slot=\"invalid\"></slot>`\n : this.renderValidationMessage('invalid');\n } else if (validity[key as keyof ValidityState]) {\n const name = toKebabCase(key);\n\n yield projected\n ? html`<slot name=${name} slot=${name}></slot>`\n : this.renderValidationMessage(name);\n }\n }\n }\n\n protected renderHelper() {\n return this.invalid && this._hasSlottedContent\n ? nothing\n : html`<slot name=\"helper-text\"></slot>`;\n }\n\n protected override render() {\n return html`\n <div part=${partMap({ 'helper-text': true, empty: hasProjection(this) })}>\n ${this.invalid\n ? this.renderValidationSlots(this.target.validity)\n : nothing}\n ${this.renderHelper()}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-validator': IgcValidationContainerComponent;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"validation-container.js","sourceRoot":"","sources":["../../../src/components/validation-container/validation-container.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,gBAAgB,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAcxD,MAAM,yBAAyB,GAAG,gCAAgC,CAAC;AACnE,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,GAAG,KAAK,OAAO,IAAI,QAAQ,CAAC,GAA0B,CAAC,EAAE,CAAC;gBAC5D,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;gBAC9B,MAAM,SAAS;oBACb,CAAC,CAAC,IAAI,CAAA,cAAc,IAAI,SAAS,IAAI,UAAU;oBAC/C,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;YAC1C,CAAC;QACH,CAAC;IACH,CAAC;IAES,aAAa;QACrB,OAAO,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,kBAAkB;YAC5C,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,IAAI,CAAA,kCAAkC,CAAC;IAC7C,CAAC;IAEkB,MAAM;QACvB,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO;YACxB,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;YACnD,CAAC,CAAC,OAAO,CAAC;QAEZ,OAAO,IAAI,CAAA;kBACG,OAAO,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;UACpE,KAAK,GAAG,IAAI,CAAC,aAAa,EAAE;;KAEjC,CAAC;IACJ,CAAC;;AAtJsB,uCAAO,GAAG,eAAe,AAAlB,CAAmB;AAC1B,sCAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,AAAnB,CAAoB;eAF9B,+BAA+B;AA2C1C;IADP,KAAK,EAAE;2EAC2B;AAG5B;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;gEACL;AAGvB;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;6DAS9B","sourcesContent":["import { html, LitElement, nothing, type TemplateResult } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { addThemingController } from '../../theming/theming-controller.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport type { IgcFormControl } from '../common/mixins/forms/types.js';\nimport { partMap } from '../common/part-map.js';\nimport { isEmpty, toKebabCase } from '../common/util.js';\nimport IgcIconComponent from '../icon/icon.js';\nimport { styles as shared } from './themes/shared/validator.common.css.js';\nimport { all } from './themes/themes.js';\nimport { styles } from './themes/validator.base.css.js';\n\n/** Configuration for the validation container. */\ninterface ValidationContainerConfig {\n /** The id attribute for the validation container. */\n id?: string;\n /** Project the validation container to the given slot inside the host shadow DOM. */\n slot?: string;\n /** Additional part(s) that should be bound to the validation container. */\n part?: string;\n /** Whether the validation container should expose a helper-text slot. */\n hasHelperText?: boolean;\n}\n\nconst VALIDATION_SLOTS_SELECTOR = 'slot:not([name=\"helper-text\"])';\nconst ALL_SLOTS_SELECTOR = 'slot';\n\nfunction getValidationSlots(\n element: IgcValidationContainerComponent\n): NodeListOf<HTMLSlotElement> {\n return element.renderRoot.querySelectorAll<HTMLSlotElement>(\n VALIDATION_SLOTS_SELECTOR\n );\n}\n\nfunction hasProjection(element: IgcValidationContainerComponent): boolean {\n const allSlots =\n element.renderRoot.querySelectorAll<HTMLSlotElement>(ALL_SLOTS_SELECTOR);\n return Array.from(allSlots).every((slot) =>\n isEmpty(slot.assignedElements({ flatten: true }))\n );\n}\n\nfunction hasProjectedValidation(\n element: IgcValidationContainerComponent,\n slotName?: string\n): boolean {\n const slots = Array.from(getValidationSlots(element));\n const config: AssignedNodesOptions = { flatten: true };\n\n if (slotName) {\n return slots\n .filter((slot) => slot.name === slotName)\n .some((slot) => !isEmpty(slot.assignedElements(config)));\n }\n\n return slots.some((slot) => !isEmpty(slot.assignedElements(config)));\n}\n\n/* blazorSuppress */\n/**\n * @element igc-validator\n *\n * @csspart helper-text - The base wrapper\n * @csspart validation-message - The validation error message container\n * @csspart validation-icon - The validation error icon\n */\nexport default class IgcValidationContainerComponent extends LitElement {\n public static readonly tagName = 'igc-validator';\n public static override styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(IgcValidationContainerComponent, IgcIconComponent);\n }\n\n public static create(\n host: IgcFormControl,\n config: ValidationContainerConfig = {\n id: 'helper-text',\n hasHelperText: true,\n }\n ): TemplateResult {\n const helperText = config.hasHelperText\n ? html`<slot name=\"helper-text\" slot=\"helper-text\"></slot>`\n : nothing;\n\n const validationSlots =\n IgcValidationContainerComponent.prototype._renderValidationSlots(\n host.validity,\n true\n );\n\n return html`\n <igc-validator\n id=${ifDefined(config.id)}\n part=${ifDefined(config.part)}\n slot=${ifDefined(config.slot)}\n ?invalid=${host.invalid}\n .target=${host}\n exportparts=\"helper-text validation-message validation-icon\"\n >\n ${helperText}${validationSlots}\n </igc-validator>\n `;\n }\n\n private _target!: IgcFormControl;\n\n @state()\n private _hasSlottedContent = false;\n\n @property({ type: Boolean })\n public invalid = false;\n\n @property({ attribute: false })\n public set target(value: IgcFormControl) {\n if (this._target === value) {\n return;\n }\n\n this._target?.removeEventListener('invalid', this);\n this._target = value;\n this._target.addEventListener('invalid', this);\n }\n\n public get target(): IgcFormControl {\n return this._target;\n }\n\n constructor() {\n super();\n addThemingController(this, all);\n }\n\n protected override createRenderRoot(): HTMLElement | DocumentFragment {\n const root = super.createRenderRoot();\n root.addEventListener('slotchange', this);\n return root;\n }\n\n /** @internal */\n public handleEvent(event: Event): void {\n switch (event.type) {\n case 'invalid':\n if (!this.invalid) {\n this.invalid = true;\n }\n break;\n case 'slotchange': {\n const newHasSlottedContent = hasProjectedValidation(this);\n if (this._hasSlottedContent !== newHasSlottedContent) {\n this._hasSlottedContent = newHasSlottedContent;\n }\n break;\n }\n }\n\n this.requestUpdate();\n }\n\n protected _renderValidationMessage(slotName: string): TemplateResult {\n const hasProjectedIcon = hasProjectedValidation(this, slotName);\n const parts = { 'validation-message': true, empty: !hasProjectedIcon };\n const icon = hasProjectedIcon\n ? html`\n <igc-icon\n aria-hidden=\"true\"\n name=\"error\"\n part=\"validation-icon\"\n ></igc-icon>\n `\n : nothing;\n\n return html`\n <div part=${partMap(parts)}>\n ${icon}\n <slot name=${slotName}></slot>\n </div>\n `;\n }\n\n protected *_renderValidationSlots(\n validity: ValidityState,\n projected = false\n ): Generator<TemplateResult> {\n if (!validity.valid) {\n yield projected\n ? html`<slot name=\"invalid\" slot=\"invalid\"></slot>`\n : this._renderValidationMessage('invalid');\n }\n\n for (const key in validity) {\n if (key !== 'valid' && validity[key as keyof ValidityState]) {\n const name = toKebabCase(key);\n yield projected\n ? html`<slot name=${name} slot=${name}></slot>`\n : this._renderValidationMessage(name);\n }\n }\n }\n\n protected _renderHelper(): TemplateResult | typeof nothing {\n return this.invalid && this._hasSlottedContent\n ? nothing\n : html`<slot name=\"helper-text\"></slot>`;\n }\n\n protected override render(): TemplateResult {\n const slots = this.invalid\n ? this._renderValidationSlots(this.target.validity)\n : nothing;\n\n return html`\n <div part=${partMap({ 'helper-text': true, empty: hasProjection(this) })}>\n ${slots}${this._renderHelper()}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-validator': IgcValidationContainerComponent;\n }\n}\n"]}
|