@vonage/vivid 4.16.2 → 4.17.0
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/custom-elements.json +3426 -506
- package/elevation/index.cjs +1 -1
- package/elevation/index.js +1 -1
- package/index.cjs +147 -39
- package/index.js +64 -59
- package/lib/accordion/definition.d.ts +2 -0
- package/lib/accordion-item/definition.d.ts +2 -0
- package/lib/action-group/definition.d.ts +2 -0
- package/lib/alert/definition.d.ts +2 -0
- package/lib/audio-player/definition.d.ts +2 -0
- package/lib/avatar/definition.d.ts +2 -0
- package/lib/badge/definition.d.ts +2 -0
- package/lib/banner/definition.d.ts +2 -0
- package/lib/breadcrumb/definition.d.ts +2 -0
- package/lib/breadcrumb-item/definition.d.ts +2 -0
- package/lib/button/definition.d.ts +2 -0
- package/lib/calendar/calendar.d.ts +2 -0
- package/lib/calendar/definition.d.ts +2 -0
- package/lib/calendar-event/definition.d.ts +2 -0
- package/lib/card/definition.d.ts +2 -0
- package/lib/checkbox/definition.d.ts +2 -0
- package/lib/combobox/definition.d.ts +2 -0
- package/lib/components.d.ts +1 -0
- package/lib/data-grid/definition.d.ts +4 -0
- package/lib/date-picker/definition.d.ts +2 -0
- package/lib/date-range-picker/definition.d.ts +2 -0
- package/lib/dial-pad/definition.d.ts +2 -0
- package/lib/dialog/definition.d.ts +2 -0
- package/lib/divider/definition.d.ts +2 -0
- package/lib/empty-state/definition.d.ts +2 -0
- package/lib/enums.d.ts +6 -0
- package/lib/fab/definition.d.ts +2 -0
- package/lib/file-picker/definition.d.ts +2 -0
- package/lib/header/definition.d.ts +2 -0
- package/lib/icon/definition.d.ts +2 -0
- package/lib/layout/definition.d.ts +2 -0
- package/lib/menu/definition.d.ts +2 -0
- package/lib/menu/menu.d.ts +454 -4
- package/lib/menu-item/definition.d.ts +2 -0
- package/lib/nav/definition.d.ts +2 -0
- package/lib/nav-disclosure/definition.d.ts +2 -0
- package/lib/nav-item/definition.d.ts +2 -0
- package/lib/note/definition.d.ts +2 -0
- package/lib/number-field/definition.d.ts +2 -0
- package/lib/option/definition.d.ts +2 -0
- package/lib/pagination/definition.d.ts +2 -0
- package/lib/popup/definition.d.ts +0 -1
- package/lib/popup/popup.d.ts +25 -0
- package/lib/progress/definition.d.ts +2 -0
- package/lib/progress-ring/definition.d.ts +2 -0
- package/lib/radio/definition.d.ts +2 -0
- package/lib/radio-group/definition.d.ts +2 -0
- package/lib/range-slider/definition.d.ts +2 -0
- package/lib/rich-text-editor/definition.d.ts +2 -0
- package/lib/rich-text-editor/facades/prose-mirror-vivid.schema.d.ts +2 -0
- package/lib/rich-text-editor/facades/vivid-prose-mirror.facade.d.ts +7 -0
- package/lib/rich-text-editor/rich-text-editor.d.ts +13 -0
- package/lib/rich-text-editor/rich-text-editor.template.d.ts +4 -0
- package/lib/searchable-select/definition.d.ts +2 -0
- package/lib/select/definition.d.ts +2 -0
- package/lib/selectable-box/definition.d.ts +2 -0
- package/lib/side-drawer/definition.d.ts +2 -0
- package/lib/slider/definition.d.ts +2 -0
- package/lib/split-button/definition.d.ts +2 -0
- package/lib/switch/definition.d.ts +2 -0
- package/lib/tab/definition.d.ts +2 -0
- package/lib/tab-panel/definition.d.ts +2 -0
- package/lib/tabs/definition.d.ts +2 -0
- package/lib/tag/definition.d.ts +2 -0
- package/lib/tag-group/definition.d.ts +2 -0
- package/lib/text-area/definition.d.ts +2 -0
- package/lib/text-field/definition.d.ts +2 -0
- package/lib/time-picker/definition.d.ts +2 -0
- package/lib/time-picker/inline-time-picker/columns.d.ts +13 -0
- package/lib/time-picker/inline-time-picker/definition.d.ts +1 -0
- package/lib/time-picker/inline-time-picker/inline-time-picker.d.ts +15 -0
- package/lib/time-picker/inline-time-picker/inline-time-picker.template.d.ts +5 -0
- package/lib/time-picker/time-picker.template.d.ts +1 -2
- package/lib/toggletip/definition.d.ts +2 -0
- package/lib/toggletip/toggletip.d.ts +454 -4
- package/lib/tooltip/definition.d.ts +2 -0
- package/lib/tooltip/tooltip.d.ts +454 -4
- package/lib/tree-item/definition.d.ts +2 -0
- package/lib/tree-view/definition.d.ts +2 -0
- package/lib/video-player/definition.d.ts +2 -0
- package/menu/index.js +1 -1
- package/package.json +7 -2
- package/popup/index.cjs +1 -1
- package/popup/index.js +1 -1
- package/rich-text-editor/index.cjs +5 -0
- package/rich-text-editor/index.js +3 -0
- package/searchable-select/index.cjs +1 -1
- package/searchable-select/index.js +1 -1
- package/select/index.cjs +1 -1
- package/select/index.js +1 -1
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +1 -1
- package/shared/affix.cjs +1 -3
- package/shared/affix.js +2 -4
- package/shared/anchored.cjs +12 -9
- package/shared/anchored.js +13 -10
- package/shared/definition.js +1 -1
- package/shared/definition10.cjs +1 -0
- package/shared/definition10.js +2 -2
- package/shared/definition11.cjs +1 -1
- package/shared/definition11.js +2 -2
- package/shared/definition12.cjs +1 -1
- package/shared/definition12.js +2 -2
- package/shared/definition13.cjs +15 -2
- package/shared/definition13.js +16 -4
- package/shared/definition14.cjs +3 -2
- package/shared/definition14.js +4 -4
- package/shared/definition15.cjs +1 -1
- package/shared/definition15.js +2 -2
- package/shared/definition16.cjs +18 -18
- package/shared/definition16.js +6 -6
- package/shared/definition17.cjs +3 -0
- package/shared/definition17.js +2 -2
- package/shared/definition18.cjs +7 -7
- package/shared/definition18.js +4 -4
- package/shared/definition19.cjs +15 -15
- package/shared/definition19.js +4 -4
- package/shared/definition2.cjs +1 -0
- package/shared/definition2.js +2 -2
- package/shared/definition20.cjs +5 -4
- package/shared/definition20.js +6 -6
- package/shared/definition21.cjs +3 -2
- package/shared/definition21.js +4 -4
- package/shared/definition22.js +1 -1
- package/shared/definition23.cjs +2 -1
- package/shared/definition23.js +3 -3
- package/shared/definition24.cjs +2 -1
- package/shared/definition24.js +3 -3
- package/shared/definition25.cjs +14 -14
- package/shared/definition25.js +3 -3
- package/shared/definition26.cjs +2 -1
- package/shared/definition26.js +3 -3
- package/shared/definition27.cjs +1 -1
- package/shared/definition27.js +2 -2
- package/shared/definition28.cjs +1 -0
- package/shared/definition28.js +2 -2
- package/shared/definition29.cjs +53 -61
- package/shared/definition29.js +54 -63
- package/shared/definition3.cjs +1 -0
- package/shared/definition3.js +2 -2
- package/shared/definition30.cjs +1 -0
- package/shared/definition30.js +2 -2
- package/shared/definition31.cjs +1 -0
- package/shared/definition31.js +2 -2
- package/shared/definition32.cjs +1 -0
- package/shared/definition32.js +2 -2
- package/shared/definition33.cjs +2 -1
- package/shared/definition33.js +3 -3
- package/shared/definition34.cjs +25 -25
- package/shared/definition34.js +5 -5
- package/shared/definition35.cjs +1 -1
- package/shared/definition35.js +2 -2
- package/shared/definition36.cjs +2 -1
- package/shared/definition36.js +3 -3
- package/shared/definition37.cjs +1 -1
- package/shared/definition37.js +2 -2
- package/shared/definition38.cjs +2 -1
- package/shared/definition38.js +3 -3
- package/shared/definition39.cjs +1 -0
- package/shared/definition39.js +2 -2
- package/shared/definition4.cjs +3 -2
- package/shared/definition4.js +4 -4
- package/shared/definition40.cjs +1 -1
- package/shared/definition40.js +2 -2
- package/shared/definition41.cjs +30 -30
- package/shared/definition41.js +5 -5
- package/shared/definition42.cjs +12538 -1052
- package/shared/definition42.js +12538 -1053
- package/shared/definition43.cjs +927 -701
- package/shared/definition43.js +929 -702
- package/shared/definition44.cjs +874 -104
- package/shared/definition44.js +874 -104
- package/shared/definition45.cjs +114 -90
- package/shared/definition45.js +113 -90
- package/shared/definition46.cjs +88 -464
- package/shared/definition46.js +87 -463
- package/shared/definition47.cjs +463 -109
- package/shared/definition47.js +462 -109
- package/shared/definition48.cjs +108 -106
- package/shared/definition48.js +107 -106
- package/shared/definition49.cjs +139 -13
- package/shared/definition49.js +138 -13
- package/shared/definition5.cjs +3 -2
- package/shared/definition5.js +5 -5
- package/shared/definition50.cjs +16 -114
- package/shared/definition50.js +15 -114
- package/shared/definition51.cjs +79 -485
- package/shared/definition51.js +78 -485
- package/shared/definition52.cjs +503 -23
- package/shared/definition52.js +502 -23
- package/shared/definition53.cjs +25 -123
- package/shared/definition53.js +24 -123
- package/shared/definition54.cjs +96 -254
- package/shared/definition54.js +96 -255
- package/shared/definition55.cjs +261 -59
- package/shared/definition55.js +262 -60
- package/shared/definition56.cjs +72 -861
- package/shared/definition56.js +72 -861
- package/shared/definition57.cjs +880 -107
- package/shared/definition57.js +880 -107
- package/shared/definition58.cjs +104 -88
- package/shared/definition58.js +104 -89
- package/shared/definition59.cjs +80 -165
- package/shared/definition59.js +79 -163
- package/shared/definition6.cjs +2 -1
- package/shared/definition6.js +3 -3
- package/shared/definition60.cjs +142 -228
- package/shared/definition60.js +141 -229
- package/shared/definition61.cjs +233 -70146
- package/shared/definition61.js +232 -70146
- package/shared/definition62.cjs +69381 -28
- package/shared/definition62.js +69380 -27
- package/shared/definition63.cjs +28 -2163
- package/shared/definition63.js +27 -2161
- package/shared/definition64.cjs +2195 -0
- package/shared/definition64.js +2190 -0
- package/shared/definition7.cjs +2 -1
- package/shared/definition7.js +3 -3
- package/shared/definition8.cjs +2 -1
- package/shared/definition8.js +3 -3
- package/shared/definition9.cjs +1 -1
- package/shared/definition9.js +2 -2
- package/shared/enums.cjs +8 -0
- package/shared/enums.js +8 -1
- package/shared/form-associated.js +1 -1
- package/shared/form-elements.cjs +7 -7
- package/shared/form-elements.js +8 -8
- package/shared/foundation/vivid-element/vivid-element.d.ts +1 -0
- package/shared/patterns/anchored.d.ts +891 -10
- package/shared/patterns/trapped-focus.d.ts +2 -0
- package/shared/presentationDate.cjs +5 -7
- package/shared/presentationDate.js +5 -7
- package/shared/slider.template.cjs +4 -4
- package/shared/slider.template.js +4 -4
- package/shared/text-anchor.template.cjs +2 -2
- package/shared/text-anchor.template.js +2 -2
- package/shared/text-field.cjs +555 -2
- package/shared/text-field.js +554 -2
- package/shared/text-field2.cjs +2 -572
- package/shared/text-field2.js +2 -571
- package/shared/trapped-focus.cjs +7 -1
- package/shared/trapped-focus.js +7 -1
- package/shared/utils/mixins.d.ts +3 -0
- package/shared/vivid-element.cjs +3 -0
- package/shared/vivid-element.js +4 -1
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.cjs +1 -1
- package/slider/index.js +1 -1
- package/split-button/index.cjs +1 -1
- package/split-button/index.js +1 -1
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/switch/index.cjs +1 -1
- package/switch/index.js +1 -1
- package/tab/index.cjs +1 -1
- package/tab/index.js +1 -1
- package/tab-panel/index.cjs +1 -1
- package/tab-panel/index.js +1 -1
- package/tabs/index.cjs +1 -1
- package/tabs/index.js +1 -1
- package/tag/index.cjs +1 -1
- package/tag/index.js +1 -1
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +1 -1
- package/text-anchor/index.js +1 -1
- package/text-area/index.cjs +1 -1
- package/text-area/index.js +1 -1
- package/text-field/index.cjs +1 -1
- package/text-field/index.js +1 -1
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +1 -1
- package/toggletip/index.cjs +1 -1
- package/toggletip/index.js +1 -1
- package/tooltip/index.cjs +1 -1
- package/tooltip/index.js +1 -1
- package/tree-item/index.cjs +1 -1
- package/tree-item/index.js +1 -1
- package/tree-view/index.cjs +1 -1
- package/tree-view/index.js +1 -1
- package/video-player/index.cjs +1 -1
- package/video-player/index.js +1 -1
- package/vivid.api.json +22795 -1
package/shared/definition55.js
CHANGED
|
@@ -1,43 +1,229 @@
|
|
|
1
1
|
import { i as iconDefinition } from './definition27.js';
|
|
2
|
-
import { h as html, d as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { s as slotted } from './slotted.js';
|
|
8
|
-
import { g as getFeedbackTemplate } from './form-elements.js';
|
|
2
|
+
import { V as VividElement, a as attr, n as nullableNumberConverter, o as observable, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
|
|
3
|
+
import { R as Reflector, D as DelegatesARIATextbox } from './text-field.js';
|
|
4
|
+
import { a as applyMixinsWithObservables } from './applyMixinsWithObservables.js';
|
|
5
|
+
import { F as FormAssociated } from './form-associated.js';
|
|
6
|
+
import { F as FormElementSuccessText, a as FormElementHelperText, b as FormElementCharCount, e as errorText, f as formElements, g as getFeedbackTemplate } from './form-elements.js';
|
|
9
7
|
import { c as classNames } from './class-names.js';
|
|
8
|
+
import { w as when } from './when.js';
|
|
9
|
+
import { r as ref } from './ref.js';
|
|
10
|
+
|
|
11
|
+
const styles = ":host{display:inline-block}.base{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.base.appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-fierce)}.base:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)).appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.base:where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.base:where(.disabled,:disabled).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.readonly):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: var(--vvd-color-neutral-400)}.base:where(.readonly):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-600);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.error):where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: var(--vvd-color-alert-500)}.base:where(.error):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: transparent}.base:where(.success):where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: var(--vvd-color-success-500)}.base:where(.success):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: transparent}.base.connotation-success{--_connotation-color-primary: var(--vvd-text-area-success-primary, var(--vvd-color-success-500));--_connotation-color-primary-text: var(--vvd-text-area-success-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-text-area-success-primary-increment, var(--vvd-color-success-600));--_connotation-color-intermediate: var(--vvd-text-area-success-intermediate, var(--vvd-color-success-500));--_connotation-color-firm: var(--vvd-text-area-success-firm, var(--vvd-color-success-600));--_connotation-color-fierce: var(--vvd-text-area-success-fierce, var(--vvd-color-success-700));--_connotation-color-faint: var(--vvd-text-area-success-faint, var(--vvd-color-success-50));--_connotation-color-soft: var(--vvd-text-area-success-soft, var(--vvd-color-success-100))}.base.connotation-alert{--_connotation-color-primary: var(--vvd-text-area-alert-primary, var(--vvd-color-alert-500));--_connotation-color-primary-text: var(--vvd-text-area-alert-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-text-area-alert-primary-increment, var(--vvd-color-alert-600));--_connotation-color-intermediate: var(--vvd-text-area-alert-intermediate, var(--vvd-color-alert-500));--_connotation-color-firm: var(--vvd-text-area-alert-firm, var(--vvd-color-alert-600));--_connotation-color-fierce: var(--vvd-text-area-alert-fierce, var(--vvd-color-alert-700));--_connotation-color-faint: var(--vvd-text-area-alert-faint, var(--vvd-color-alert-50));--_connotation-color-soft: var(--vvd-text-area-alert-soft, var(--vvd-color-alert-100))}.base:not(.connotation-success,.connotation-alert){--_connotation-color-primary: var(--vvd-text-area-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-text-area-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-text-area-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-intermediate: var(--vvd-text-area-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-firm: var(--vvd-text-area-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-fierce: var(--vvd-text-area-accent-fierce, var(--vvd-color-neutral-700));--_connotation-color-faint: var(--vvd-text-area-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-text-area-accent-soft, var(--vvd-color-neutral-100))}.base{display:inline-grid;grid-template-columns:1fr max-content;inline-size:100%;row-gap:4px}@supports (user-select: none){.base{user-select:none}}.base:not(.disabled){--_low-ink-color: var(--vvd-color-neutral-600)}.base.disabled{--_low-ink-color: var(--_appearance-color-text);cursor:not-allowed}.label{color:var(--vvd-color-canvas-text);contain:inline-size;font:var(--vvd-typography-base);grid-column:1/2;grid-row:1;line-height:20px}.char-count{color:var(--_low-ink-color);font:var(--vvd-typography-base);grid-column:2/-1}.control{--scrollbar-track-color: transparent;--scrollbar-thumb-color: color-mix(in srgb, var(--vvd-color-neutral-950), transparent 70%)}.control{scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);scrollbar-width:thin}.control ::-webkit-scrollbar{width:4px}.control ::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.control ::-webkit-scrollbar-thumb{border:0;border-radius:4px;background-color:var(--scrollbar-thumb-color)}.control{box-sizing:border-box;padding:8px 16px;border:0 none;border-radius:8px;appearance:none;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--_appearance-color-text);font:var(--vvd-typography-base);grid-column:1/-1;min-block-size:calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2)));resize:none;transition:box-shadow .2s,background-color .2s,color .2s}@supports selector(::-webkit-resizer){.control::-webkit-resizer{background-image:linear-gradient(315deg,transparent 0,transparent 2px,var(--vvd-color-canvas-text) 2px,var(--vvd-color-canvas-text) 3px,transparent 3px,transparent 5px,var(--vvd-color-canvas-text) 5px,var(--vvd-color-canvas-text) 6px,transparent 6px,transparent 8px,transparent 100%);background-repeat:no-repeat;background-size:10px 10px;block-size:10px;inline-size:10px}}.control:disabled{opacity:1;pointer-events:none;-webkit-text-fill-color:var(--_appearance-color-text)}.control::placeholder,.control:disabled::placeholder{opacity:1;pointer-events:none;-webkit-text-fill-color:var(--_low-ink-color)}.control:focus-visible{--focus-stroke-gap-color: transparent;box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px))}:host([resize=both]) .control{resize:both}:host([resize=horizontal]) .control{resize:horizontal}:host([resize=vertical]) .control{resize:vertical}";
|
|
12
|
+
|
|
13
|
+
class _TextArea extends VividElement {
|
|
14
|
+
}
|
|
15
|
+
class FormAssociatedTextArea extends FormAssociated(_TextArea) {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.proxy = document.createElement("textarea");
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
var __defProp = Object.defineProperty;
|
|
23
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
24
|
+
var __typeError = (msg) => {
|
|
25
|
+
throw TypeError(msg);
|
|
26
|
+
};
|
|
27
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
28
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
29
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
30
|
+
if (decorator = decorators[i])
|
|
31
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
32
|
+
if (kind && result) __defProp(target, key, result);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
36
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
37
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
38
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
|
|
39
|
+
var _reflectToTextArea;
|
|
40
|
+
const TextAreaResize = {
|
|
41
|
+
/**
|
|
42
|
+
* No resize.
|
|
43
|
+
*/
|
|
44
|
+
none: "none"};
|
|
45
|
+
let TextArea = class extends FormAssociatedTextArea {
|
|
46
|
+
constructor() {
|
|
47
|
+
super(...arguments);
|
|
48
|
+
// eslint-disable-next-line @nrwl/nx/workspace/no-attribute-default-value
|
|
49
|
+
this.resize = TextAreaResize.none;
|
|
50
|
+
this.cols = 20;
|
|
51
|
+
/**
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
54
|
+
this.handleTextInput = () => {
|
|
55
|
+
this.value = this.control.value;
|
|
56
|
+
};
|
|
57
|
+
__privateAdd(this, _reflectToTextArea);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
readOnlyChanged() {
|
|
63
|
+
if (this.proxy instanceof HTMLTextAreaElement) {
|
|
64
|
+
this.proxy.readOnly = this.readOnly;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
autofocusChanged() {
|
|
71
|
+
if (this.proxy instanceof HTMLTextAreaElement) {
|
|
72
|
+
this.proxy.autofocus = this.autofocus;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* @internal
|
|
77
|
+
*/
|
|
78
|
+
listChanged() {
|
|
79
|
+
if (this.proxy instanceof HTMLTextAreaElement) {
|
|
80
|
+
this.proxy.setAttribute("list", this.list);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* @internal
|
|
85
|
+
*/
|
|
86
|
+
maxlengthChanged() {
|
|
87
|
+
if (this.proxy instanceof HTMLTextAreaElement) {
|
|
88
|
+
this.proxy.maxLength = this.maxlength;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* @internal
|
|
93
|
+
*/
|
|
94
|
+
minlengthChanged() {
|
|
95
|
+
if (this.proxy instanceof HTMLTextAreaElement) {
|
|
96
|
+
this.proxy.minLength = this.minlength;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* @internal
|
|
101
|
+
*/
|
|
102
|
+
spellcheckChanged() {
|
|
103
|
+
if (this.proxy instanceof HTMLTextAreaElement) {
|
|
104
|
+
this.proxy.spellcheck = this.spellcheck;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Selects all the text in the text area
|
|
109
|
+
*
|
|
110
|
+
* @public
|
|
111
|
+
*/
|
|
112
|
+
select() {
|
|
113
|
+
this.control.select();
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Change event handler for inner control.
|
|
117
|
+
* @remarks
|
|
118
|
+
* "Change" events are not `composable` so they will not
|
|
119
|
+
* permeate the shadow DOM boundary. This fn effectively proxies
|
|
120
|
+
* the change event, emitting a `change` event whenever the internal
|
|
121
|
+
* control emits a `change` event
|
|
122
|
+
* @internal
|
|
123
|
+
*/
|
|
124
|
+
handleChange() {
|
|
125
|
+
this.$emit("change");
|
|
126
|
+
}
|
|
127
|
+
/** {@inheritDoc (FormAssociated:interface).validate} */
|
|
128
|
+
validate() {
|
|
129
|
+
super.validate(this.control);
|
|
130
|
+
}
|
|
131
|
+
connectedCallback() {
|
|
132
|
+
super.connectedCallback();
|
|
133
|
+
__privateSet(this, _reflectToTextArea, new Reflector(this, this.control));
|
|
134
|
+
__privateGet(this, _reflectToTextArea).property("value", "value", true);
|
|
135
|
+
}
|
|
136
|
+
disconnectedCallback() {
|
|
137
|
+
super.disconnectedCallback();
|
|
138
|
+
__privateGet(this, _reflectToTextArea).destroy();
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
_reflectToTextArea = new WeakMap();
|
|
142
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
143
|
+
__decorateClass([
|
|
144
|
+
attr({ mode: "boolean" })
|
|
145
|
+
], TextArea.prototype, "readOnly", 2);
|
|
146
|
+
__decorateClass([
|
|
147
|
+
attr
|
|
148
|
+
], TextArea.prototype, "resize", 2);
|
|
149
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
150
|
+
__decorateClass([
|
|
151
|
+
attr({ mode: "boolean" })
|
|
152
|
+
], TextArea.prototype, "autofocus", 2);
|
|
153
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
154
|
+
__decorateClass([
|
|
155
|
+
attr({ attribute: "form" })
|
|
156
|
+
], TextArea.prototype, "formId", 2);
|
|
157
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
158
|
+
__decorateClass([
|
|
159
|
+
attr
|
|
160
|
+
], TextArea.prototype, "list", 2);
|
|
161
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
162
|
+
__decorateClass([
|
|
163
|
+
attr({ converter: nullableNumberConverter })
|
|
164
|
+
], TextArea.prototype, "maxlength", 2);
|
|
165
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
166
|
+
__decorateClass([
|
|
167
|
+
attr({ converter: nullableNumberConverter })
|
|
168
|
+
], TextArea.prototype, "minlength", 2);
|
|
169
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
170
|
+
__decorateClass([
|
|
171
|
+
attr
|
|
172
|
+
], TextArea.prototype, "name", 2);
|
|
173
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
174
|
+
__decorateClass([
|
|
175
|
+
attr
|
|
176
|
+
], TextArea.prototype, "placeholder", 2);
|
|
177
|
+
__decorateClass([
|
|
178
|
+
attr({ converter: nullableNumberConverter, mode: "fromView" })
|
|
179
|
+
], TextArea.prototype, "cols", 2);
|
|
180
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
181
|
+
__decorateClass([
|
|
182
|
+
attr({ converter: nullableNumberConverter, mode: "fromView" })
|
|
183
|
+
], TextArea.prototype, "rows", 2);
|
|
184
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
185
|
+
__decorateClass([
|
|
186
|
+
attr({ mode: "boolean" })
|
|
187
|
+
], TextArea.prototype, "spellcheck", 2);
|
|
188
|
+
__decorateClass([
|
|
189
|
+
observable
|
|
190
|
+
], TextArea.prototype, "defaultSlottedNodes", 2);
|
|
191
|
+
__decorateClass([
|
|
192
|
+
attr
|
|
193
|
+
], TextArea.prototype, "wrap", 2);
|
|
194
|
+
TextArea = __decorateClass([
|
|
195
|
+
errorText,
|
|
196
|
+
formElements
|
|
197
|
+
], TextArea);
|
|
198
|
+
applyMixinsWithObservables(
|
|
199
|
+
TextArea,
|
|
200
|
+
FormElementCharCount,
|
|
201
|
+
FormElementHelperText,
|
|
202
|
+
FormElementSuccessText,
|
|
203
|
+
DelegatesARIATextbox
|
|
204
|
+
);
|
|
10
205
|
|
|
11
|
-
const
|
|
206
|
+
const getClasses = ({
|
|
207
|
+
value,
|
|
12
208
|
errorValidationMessage,
|
|
13
209
|
disabled,
|
|
14
|
-
value,
|
|
15
|
-
readOnly,
|
|
16
210
|
placeholder,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
label,
|
|
20
|
-
successText,
|
|
21
|
-
actionItemsSlottedContent,
|
|
22
|
-
leadingActionItemsSlottedContent,
|
|
23
|
-
icon,
|
|
24
|
-
scale
|
|
211
|
+
readOnly,
|
|
212
|
+
successText
|
|
25
213
|
}) => classNames(
|
|
26
|
-
|
|
27
|
-
["disabled", disabled],
|
|
28
|
-
["has-value", Boolean(value)],
|
|
214
|
+
"base",
|
|
29
215
|
["readonly", readOnly],
|
|
30
216
|
["placeholder", Boolean(placeholder)],
|
|
31
|
-
[
|
|
32
|
-
[
|
|
33
|
-
["
|
|
34
|
-
["
|
|
35
|
-
["success", Boolean(successText)],
|
|
36
|
-
["action-items", !!actionItemsSlottedContent?.length],
|
|
37
|
-
["leading-action-items", !!leadingActionItemsSlottedContent?.length],
|
|
38
|
-
["no-leading", !(leadingActionItemsSlottedContent?.length || icon)],
|
|
39
|
-
[`size-${scale}`, Boolean(scale)]
|
|
217
|
+
["disabled", disabled],
|
|
218
|
+
["error", Boolean(errorValidationMessage)],
|
|
219
|
+
["has-value", Boolean(value)],
|
|
220
|
+
["success", !!successText]
|
|
40
221
|
);
|
|
222
|
+
function renderLabel() {
|
|
223
|
+
return html` <label for="control" class="label">
|
|
224
|
+
${(x) => x.label}
|
|
225
|
+
</label>`;
|
|
226
|
+
}
|
|
41
227
|
function renderCharCount() {
|
|
42
228
|
return html`
|
|
43
229
|
<span class="char-count"
|
|
@@ -45,39 +231,55 @@ function renderCharCount() {
|
|
|
45
231
|
>
|
|
46
232
|
`;
|
|
47
233
|
}
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
234
|
+
const TextAreaTemplate = (context) => {
|
|
235
|
+
return html`
|
|
236
|
+
<div class="${getClasses}">
|
|
51
237
|
${when((x) => x.charCount && x.maxlength, renderCharCount())}
|
|
52
|
-
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
238
|
+
${when((x) => x.label, renderLabel())}
|
|
239
|
+
<textarea
|
|
240
|
+
class="control"
|
|
241
|
+
id="control"
|
|
242
|
+
?autofocus="${(x) => x.autofocus}"
|
|
243
|
+
placeholder="${(x) => x.placeholder ? x.placeholder : null}"
|
|
244
|
+
name="${(x) => x.name ? x.name : null}"
|
|
245
|
+
list="${(x) => x.list}"
|
|
246
|
+
minlength="${(x) => x.minlength ? x.minlength : null}"
|
|
247
|
+
maxlength="${(x) => x.maxlength ? x.maxlength : null}"
|
|
248
|
+
rows="${(x) => x.rows ? x.rows : null}"
|
|
249
|
+
cols="${(x) => x.cols ? x.cols : null}"
|
|
250
|
+
wrap="${(x) => x.wrap ? x.wrap : null}"
|
|
251
|
+
?readonly="${(x) => x.readOnly}"
|
|
252
|
+
?disabled="${(x) => x.disabled}"
|
|
253
|
+
?required="${(x) => x.required}"
|
|
254
|
+
?spellcheck="${(x) => x.spellcheck}"
|
|
255
|
+
aria-atomic="${(x) => x.ariaAtomic}"
|
|
256
|
+
aria-busy="${(x) => x.ariaBusy}"
|
|
257
|
+
aria-current="${(x) => x.ariaCurrent}"
|
|
258
|
+
aria-details="${(x) => x.ariaDetails}"
|
|
259
|
+
aria-disabled="${(x) => x.ariaDisabled}"
|
|
260
|
+
aria-errormessage="${(x) => x.ariaErrormessage}"
|
|
261
|
+
aria-haspopup="${(x) => x.ariaHaspopup}"
|
|
262
|
+
aria-hidden="${(x) => x.ariaHidden}"
|
|
263
|
+
aria-invalid="${(x) => x.ariaInvalid}"
|
|
264
|
+
aria-keyshortcuts="${(x) => x.ariaKeyshortcuts}"
|
|
265
|
+
aria-label="${(x) => x.ariaLabel}"
|
|
266
|
+
aria-live="${(x) => x.ariaLive}"
|
|
267
|
+
aria-relevant="${(x) => x.ariaRelevant}"
|
|
268
|
+
aria-roledescription="${(x) => x.ariaRoledescription}"
|
|
269
|
+
@input="${(x) => x.handleTextInput()}"
|
|
270
|
+
@change="${(x) => x.handleChange()}"
|
|
271
|
+
${ref("control")}
|
|
272
|
+
>
|
|
273
|
+
</textarea>
|
|
72
274
|
${getFeedbackTemplate(context)}
|
|
73
275
|
</div>
|
|
74
|
-
|
|
276
|
+
`;
|
|
75
277
|
};
|
|
76
278
|
|
|
77
|
-
const
|
|
78
|
-
"text-
|
|
79
|
-
|
|
80
|
-
|
|
279
|
+
const textAreaDefinition = defineVividComponent(
|
|
280
|
+
"text-area",
|
|
281
|
+
TextArea,
|
|
282
|
+
TextAreaTemplate,
|
|
81
283
|
[iconDefinition],
|
|
82
284
|
{
|
|
83
285
|
styles,
|
|
@@ -86,6 +288,6 @@ const textFieldDefinition = defineVividComponent(
|
|
|
86
288
|
}
|
|
87
289
|
}
|
|
88
290
|
);
|
|
89
|
-
const
|
|
291
|
+
const registerTextArea = createRegisterFunction(textAreaDefinition);
|
|
90
292
|
|
|
91
|
-
export {
|
|
293
|
+
export { TextArea as T, registerTextArea as r, textAreaDefinition as t };
|