@vonage/vivid 4.16.2 → 4.18.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 +8857 -5894
- package/date-time-picker/index.cjs +5 -0
- package/date-time-picker/index.js +3 -0
- package/dial-pad/index.cjs +1 -1
- package/dial-pad/index.js +1 -1
- package/dialog/index.cjs +1 -1
- package/dialog/index.js +1 -1
- package/divider/index.cjs +1 -1
- package/divider/index.js +1 -1
- package/elevation/index.cjs +1 -1
- package/elevation/index.js +1 -1
- package/empty-state/index.cjs +1 -1
- package/empty-state/index.js +1 -1
- package/fab/index.cjs +1 -1
- package/fab/index.js +1 -1
- package/file-picker/index.cjs +1 -1
- package/file-picker/index.js +1 -1
- package/header/index.cjs +1 -1
- package/header/index.js +1 -1
- package/icon/index.cjs +1 -1
- package/icon/index.js +1 -1
- package/index.cjs +198 -87
- package/index.js +66 -60
- package/layout/index.cjs +1 -1
- package/layout/index.js +1 -1
- package/lib/accordion/definition.d.ts +2 -0
- package/lib/accordion-item/definition.d.ts +2 -0
- package/lib/action-group/action-group.d.ts +449 -3
- 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/banner.d.ts +449 -3
- package/lib/banner/definition.d.ts +2 -0
- package/lib/breadcrumb/definition.d.ts +2 -0
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +449 -1
- 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/checkbox.d.ts +449 -4
- package/lib/checkbox/definition.d.ts +2 -0
- package/lib/combobox/definition.d.ts +2 -0
- package/lib/components.d.ts +2 -0
- package/lib/data-grid/definition.d.ts +4 -0
- package/lib/date-picker/date-picker.d.ts +2182 -4
- package/lib/date-picker/date-picker.template.d.ts +2 -0
- package/lib/date-picker/definition.d.ts +2 -0
- package/lib/date-range-picker/date-range-picker.d.ts +1110 -4
- package/lib/date-range-picker/date-range-picker.template.d.ts +2 -0
- package/lib/date-range-picker/definition.d.ts +2 -0
- package/lib/date-time-picker/date-time-picker.d.ts +2175 -0
- package/lib/date-time-picker/date-time-picker.template.d.ts +2 -0
- package/lib/date-time-picker/definition.d.ts +1 -0
- package/lib/date-time-picker/locale.d.ts +9 -0
- package/lib/dial-pad/definition.d.ts +2 -0
- package/lib/dialog/definition.d.ts +2 -0
- package/lib/dialog/dialog.d.ts +449 -2
- package/lib/divider/definition.d.ts +2 -0
- package/lib/divider/divider.d.ts +448 -1
- 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 +900 -5
- 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-disclosure/nav-disclosure.d.ts +449 -2
- 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/number-field/number-field.d.ts +450 -3
- package/lib/option/definition.d.ts +2 -0
- package/lib/option/option.d.ts +1 -11
- 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/progress.d.ts +449 -2
- package/lib/progress-ring/definition.d.ts +2 -0
- package/lib/progress-ring/progress-ring.d.ts +449 -2
- 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 +8 -0
- package/lib/rich-text-editor/rich-text-editor.d.ts +16 -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/select/select.d.ts +1 -5
- package/lib/selectable-box/definition.d.ts +2 -0
- package/lib/selectable-box/selectable-box.d.ts +449 -2
- package/lib/side-drawer/definition.d.ts +2 -0
- package/lib/slider/definition.d.ts +2 -0
- package/lib/slider/slider.d.ts +449 -3
- package/lib/split-button/definition.d.ts +2 -0
- package/lib/split-button/split-button.d.ts +449 -3
- package/lib/switch/definition.d.ts +2 -0
- package/lib/switch/switch.d.ts +449 -2
- 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/tag-group/tag-group.d.ts +449 -2
- package/lib/text-anchor/text-anchor.d.ts +449 -1
- package/lib/text-area/definition.d.ts +2 -0
- package/lib/text-area/text-area.d.ts +450 -3
- package/lib/text-field/definition.d.ts +2 -0
- package/lib/text-field/text-field.d.ts +450 -7
- package/lib/time-picker/definition.d.ts +2 -0
- package/lib/time-picker/locale.d.ts +0 -2
- package/lib/time-picker/time-picker.d.ts +1053 -9
- package/lib/time-picker/time-picker.template.d.ts +2 -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/locales/de-DE.cjs +29 -5
- package/locales/de-DE.js +29 -5
- package/locales/en-GB.cjs +29 -5
- package/locales/en-GB.js +29 -5
- package/locales/en-US.cjs +29 -5
- package/locales/en-US.js +29 -5
- package/locales/ja-JP.cjs +29 -5
- package/locales/ja-JP.js +29 -5
- package/locales/zh-CN.cjs +29 -5
- package/locales/zh-CN.js +29 -5
- package/menu/index.cjs +1 -1
- package/menu/index.js +1 -1
- package/menu-item/index.cjs +1 -1
- package/menu-item/index.js +1 -1
- package/nav/index.cjs +1 -1
- package/nav/index.js +1 -1
- package/nav-disclosure/index.cjs +1 -1
- package/nav-disclosure/index.js +1 -1
- package/nav-item/index.cjs +1 -1
- package/nav-item/index.js +1 -1
- package/note/index.cjs +1 -1
- package/note/index.js +1 -1
- package/number-field/index.cjs +1 -1
- package/number-field/index.js +1 -1
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +7 -2
- package/pagination/index.cjs +1 -1
- package/pagination/index.js +1 -1
- package/popup/index.cjs +1 -1
- package/popup/index.js +1 -1
- package/progress/index.cjs +1 -1
- package/progress/index.js +1 -1
- package/progress-ring/index.cjs +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.cjs +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.cjs +1 -1
- package/radio-group/index.js +1 -1
- package/range-slider/index.cjs +1 -1
- package/range-slider/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/Reflector.cjs +71 -0
- package/shared/Reflector.js +69 -0
- package/shared/affix.cjs +2 -4
- package/shared/affix.js +3 -5
- package/shared/anchor.cjs +0 -10
- package/shared/anchor.js +0 -10
- package/shared/anchored.cjs +12 -9
- package/shared/anchored.js +13 -10
- package/shared/aria/delegates-aria.d.ts +454 -0
- package/shared/base-progress.js +1 -1
- package/shared/breadcrumb-item.cjs +2 -1
- package/shared/breadcrumb-item.js +2 -1
- package/shared/button.cjs +2 -13
- package/shared/button.js +2 -13
- package/shared/{presentationDate.cjs → calendar-picker.template.cjs} +681 -853
- package/shared/{presentationDate.js → calendar-picker.template.js} +673 -848
- package/shared/datetime/dateTimeStr.d.ts +6 -0
- package/shared/datetime/presentationDate.d.ts +4 -0
- package/shared/{date-picker/calendar → datetime}/presentationDateRange.d.ts +3 -3
- package/shared/datetime/presentationDateTime.d.ts +4 -0
- package/{lib/time-picker/time → shared/datetime}/time.d.ts +1 -0
- package/shared/definition.cjs +1 -1
- package/shared/definition.js +2 -2
- package/shared/definition10.cjs +1 -0
- package/shared/definition10.js +2 -2
- package/shared/definition11.cjs +9 -12
- package/shared/definition11.js +10 -13
- 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 +4 -3
- package/shared/definition14.js +5 -5
- package/shared/definition15.cjs +4 -11
- package/shared/definition15.js +5 -12
- package/shared/definition16.cjs +44 -48
- package/shared/definition16.js +32 -36
- package/shared/definition17.cjs +4 -1
- package/shared/definition17.js +3 -3
- package/shared/definition18.cjs +59 -94
- package/shared/definition18.js +58 -93
- package/shared/definition19.cjs +79 -43
- package/shared/definition19.js +60 -24
- package/shared/definition2.cjs +1 -0
- package/shared/definition2.js +2 -2
- package/shared/definition20.cjs +253 -219
- package/shared/definition20.js +254 -220
- package/shared/definition21.cjs +201 -286
- package/shared/definition21.js +199 -285
- package/shared/definition22.cjs +302 -31
- package/shared/definition22.js +301 -30
- package/shared/definition23.cjs +37 -57
- package/shared/definition23.js +36 -57
- package/shared/definition24.cjs +50 -69
- package/shared/definition24.js +49 -69
- package/shared/definition25.cjs +75 -2475
- package/shared/definition25.js +74 -2475
- package/shared/definition26.cjs +2480 -49
- package/shared/definition26.js +2480 -49
- package/shared/definition27.cjs +53 -271
- package/shared/definition27.js +52 -269
- package/shared/definition28.cjs +271 -47
- package/shared/definition28.js +269 -47
- package/shared/definition29.cjs +37 -772
- package/shared/definition29.js +36 -767
- package/shared/definition3.cjs +3 -9
- package/shared/definition3.js +4 -11
- package/shared/definition30.cjs +739 -56
- package/shared/definition30.js +733 -56
- package/shared/definition31.cjs +93 -21
- package/shared/definition31.js +92 -21
- package/shared/definition32.cjs +28 -9
- package/shared/definition32.js +27 -9
- package/shared/definition33.cjs +10 -51
- package/shared/definition33.js +9 -51
- package/shared/definition34.cjs +31 -412
- package/shared/definition34.js +31 -413
- package/shared/definition35.cjs +423 -53
- package/shared/definition35.js +424 -54
- package/shared/definition36.cjs +53 -215
- package/shared/definition36.js +53 -215
- package/shared/definition37.cjs +202 -72
- package/shared/definition37.js +201 -71
- package/shared/definition38.cjs +54 -48
- package/shared/definition38.js +53 -48
- package/shared/definition39.cjs +57 -262
- package/shared/definition39.js +56 -262
- package/shared/definition4.cjs +4 -3
- package/shared/definition4.js +5 -5
- package/shared/definition40.cjs +220 -148
- package/shared/definition40.js +220 -148
- package/shared/definition41.cjs +144 -568
- package/shared/definition41.js +144 -569
- package/shared/definition42.cjs +476 -967
- package/shared/definition42.js +477 -969
- package/shared/definition43.cjs +13508 -851
- package/shared/definition43.js +13508 -851
- package/shared/definition44.cjs +1111 -103
- package/shared/definition44.js +1112 -103
- package/shared/definition45.cjs +849 -80
- package/shared/definition45.js +849 -80
- package/shared/definition46.cjs +108 -464
- package/shared/definition46.js +107 -463
- package/shared/definition47.cjs +96 -118
- package/shared/definition47.js +95 -118
- package/shared/definition48.cjs +430 -82
- package/shared/definition48.js +430 -83
- package/shared/definition49.cjs +135 -15
- package/shared/definition49.js +134 -15
- package/shared/definition5.cjs +5 -4
- package/shared/definition5.js +6 -6
- package/shared/definition50.cjs +109 -85
- package/shared/definition50.js +108 -85
- package/shared/definition51.cjs +14 -519
- package/shared/definition51.js +13 -519
- package/shared/definition52.cjs +96 -23
- package/shared/definition52.js +95 -23
- package/shared/definition53.cjs +480 -99
- package/shared/definition53.js +479 -99
- package/shared/definition54.cjs +24 -296
- package/shared/definition54.js +23 -296
- package/shared/definition55.cjs +126 -69
- package/shared/definition55.js +125 -69
- package/shared/definition56.cjs +186 -775
- package/shared/definition56.js +187 -776
- package/shared/definition57.cjs +511 -107
- package/shared/definition57.js +511 -107
- package/shared/definition58.cjs +27 -128
- package/shared/definition58.js +27 -128
- package/shared/definition59.cjs +106 -162
- package/shared/definition59.js +105 -160
- package/shared/definition6.cjs +3 -2
- package/shared/definition6.js +4 -4
- package/shared/definition60.cjs +81 -252
- package/shared/definition60.js +80 -252
- package/shared/definition61.cjs +156 -70156
- package/shared/definition61.js +154 -70156
- package/shared/definition62.cjs +271 -29
- package/shared/definition62.js +270 -28
- package/shared/definition63.cjs +69236 -2018
- package/shared/definition63.js +69235 -2016
- package/shared/definition64.cjs +55 -0
- package/shared/definition64.js +51 -0
- package/shared/definition65.cjs +2195 -0
- package/shared/definition65.js +2190 -0
- package/shared/definition7.cjs +3 -2
- package/shared/definition7.js +4 -4
- package/shared/definition8.cjs +5 -10
- package/shared/definition8.js +6 -12
- package/shared/definition9.cjs +2 -2
- package/shared/definition9.js +3 -3
- package/shared/delegates-aria.cjs +69 -0
- package/shared/delegates-aria.js +67 -0
- package/shared/enums.cjs +8 -0
- package/shared/enums.js +8 -1
- package/shared/form-elements.cjs +8 -8
- package/shared/form-elements.js +9 -9
- package/shared/foundation/anchor/anchor.d.ts +0 -8
- package/shared/foundation/button/button.d.ts +449 -7
- package/shared/foundation/listbox/listbox.d.ts +0 -9
- package/shared/foundation/vivid-element/vivid-element.d.ts +1 -0
- package/shared/listbox.cjs +4 -30
- package/shared/listbox.js +4 -30
- package/shared/localization/Locale.d.ts +6 -2
- package/shared/option.cjs +1 -38
- package/shared/option.js +1 -38
- package/shared/patterns/anchored.d.ts +891 -10
- package/shared/patterns/trapped-focus.d.ts +2 -0
- package/shared/picker-field/locale.d.ts +4 -0
- package/shared/picker-field/mixins/calendar-picker.d.ts +558 -0
- package/shared/{date-picker/locale.d.ts → picker-field/mixins/calendar-picker.locale.d.ts} +1 -3
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +555 -0
- package/shared/picker-field/mixins/calendar-segments/calendarGrid.d.ts +17 -0
- package/shared/{date-picker/calendar → picker-field/mixins/calendar-segments}/monthPickerGrid.d.ts +3 -3
- package/shared/picker-field/mixins/inline-time-picker/columns.d.ts +13 -0
- package/shared/picker-field/mixins/inline-time-picker/definition.d.ts +1 -0
- package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +15 -0
- package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.template.d.ts +5 -0
- package/{lib/time-picker/time/picker.d.ts → shared/picker-field/mixins/inline-time-picker/picker-option.d.ts} +1 -1
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +1110 -0
- package/shared/picker-field/mixins/single-date-picker.d.ts +1626 -0
- package/shared/picker-field/mixins/single-value-picker.d.ts +518 -0
- package/shared/picker-field/mixins/time-selection-picker.d.ts +1053 -0
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +1050 -0
- package/shared/picker-field/picker-field.d.ts +11 -0
- package/shared/picker-field/picker-field.form-associated.d.ts +11 -0
- package/shared/picker-field/picker-field.template.d.ts +7 -0
- package/shared/picker-field.template.cjs +315 -0
- package/shared/picker-field.template.js +310 -0
- package/shared/single-date-picker.cjs +46 -0
- package/shared/single-date-picker.js +44 -0
- package/shared/single-value-picker.cjs +77 -0
- package/shared/single-value-picker.js +75 -0
- package/shared/slider.template.cjs +6 -6
- package/shared/slider.template.js +6 -6
- package/shared/text-anchor.cjs +2 -1
- package/shared/text-anchor.js +2 -1
- package/shared/text-anchor.template.cjs +5 -7
- package/shared/text-anchor.template.js +5 -7
- package/shared/time-selection-picker.template.cjs +776 -0
- package/shared/time-selection-picker.template.js +767 -0
- 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.cjs +1 -1
- package/text-anchor/index.js +2 -2
- 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 +21748 -1
- package/lib/time-picker/time-picker.form-associated.d.ts +0 -11
- package/shared/aria-global.cjs +0 -93
- package/shared/aria-global.js +0 -91
- package/shared/date-picker/calendar/calendarGrid.d.ts +0 -17
- package/shared/date-picker/calendar/presentationDate.d.ts +0 -4
- package/shared/date-picker/date-picker-base.d.ts +0 -21
- package/shared/date-picker/date-picker-base.form-associated.d.ts +0 -11
- package/shared/date-picker/date-picker-base.template.d.ts +0 -3
- package/shared/foundation/patterns/aria-global.d.ts +0 -21
- package/shared/foundation/patterns/index.d.ts +0 -1
- package/shared/text-field2.cjs +0 -575
- package/shared/text-field2.js +0 -572
- package/shared/trapped-focus.cjs +0 -29
- package/shared/trapped-focus.js +0 -27
- /package/shared/{date-picker/calendar → datetime}/dateRange.d.ts +0 -0
- /package/shared/{date-picker/calendar → datetime}/dateStr.d.ts +0 -0
- /package/shared/{date-picker/calendar → datetime}/month.d.ts +0 -0
- /package/{lib/time-picker/time → shared/datetime}/presentationTime.d.ts +0 -0
- /package/shared/{date-picker/calendar → datetime}/year.d.ts +0 -0
- /package/shared/{date-picker/calendar → picker-field/mixins/calendar-segments}/segment.d.ts +0 -0
package/shared/definition56.js
CHANGED
|
@@ -1,221 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { V as VividElement, O as Observable, i as defaultExecutionContext, D as DOM, a as attr, v as volatile, o as observable, n as nullableNumberConverter, h as html, d as defineVividComponent, f as createRegisterFunction } from './vivid-element.js';
|
|
1
|
+
import { i as iconDefinition } from './definition28.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 } from './Reflector.js';
|
|
5
4
|
import { a as applyMixinsWithObservables } from './applyMixinsWithObservables.js';
|
|
6
|
-
import {
|
|
7
|
-
import { s as scrollIntoView } from './scrollIntoView.js';
|
|
5
|
+
import { D as DelegatesAria } from './delegates-aria.js';
|
|
8
6
|
import { F as FormAssociated } from './form-associated.js';
|
|
9
|
-
import { e as errorText, f as formElements,
|
|
10
|
-
import { T as TrappedFocus } from './trapped-focus.js';
|
|
11
|
-
import { L as Localized } from './localized.js';
|
|
12
|
-
import { T as TextField } from './text-field2.js';
|
|
13
|
-
import { r as ref } from './ref.js';
|
|
14
|
-
import { s as slotted } from './slotted.js';
|
|
15
|
-
import { w as when } from './when.js';
|
|
16
|
-
import { r as repeat } from './repeat.js';
|
|
7
|
+
import { F as FormElementSuccessText, a as FormElementHelperText, b as FormElementCharCount, e as errorText, f as formElements, g as getFeedbackTemplate } from './form-elements.js';
|
|
17
8
|
import { c as classNames } from './class-names.js';
|
|
9
|
+
import { w as when } from './when.js';
|
|
10
|
+
import { r as ref } from './ref.js';
|
|
18
11
|
|
|
19
|
-
const styles = ":host{display:inline-block}.base
|
|
12
|
+
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}";
|
|
20
13
|
|
|
21
|
-
class
|
|
14
|
+
class _TextArea extends VividElement {
|
|
22
15
|
}
|
|
23
|
-
class
|
|
16
|
+
class FormAssociatedTextArea extends FormAssociated(_TextArea) {
|
|
24
17
|
constructor() {
|
|
25
18
|
super(...arguments);
|
|
26
|
-
this.proxy = document.createElement("
|
|
19
|
+
this.proxy = document.createElement("textarea");
|
|
27
20
|
}
|
|
28
21
|
}
|
|
29
22
|
|
|
30
|
-
const isValidTimeStr = (timeStr) => {
|
|
31
|
-
const parts = timeStr.split(":");
|
|
32
|
-
if (parts.length !== 3) {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
const [hours, minutes, seconds] = parts;
|
|
36
|
-
if (hours.length !== 2 || minutes.length !== 2 || seconds.length !== 2) {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
const hoursNum = parseInt(hours, 10);
|
|
40
|
-
const minutesNum = parseInt(minutes, 10);
|
|
41
|
-
const secondsNum = parseInt(seconds, 10);
|
|
42
|
-
if (isNaN(hoursNum) || isNaN(minutesNum) || isNaN(secondsNum)) {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
if (hoursNum < 0 || hoursNum > 23) {
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
if (minutesNum < 0 || minutesNum > 59) {
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
if (secondsNum < 0 || secondsNum > 59) {
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
return true;
|
|
55
|
-
};
|
|
56
|
-
const parseTimePart = (partStr) => Number.parseInt(partStr, 10);
|
|
57
|
-
const formatTimePart = (part) => part.toString().padStart(2, "0");
|
|
58
|
-
const parseTimeStr = (timeStr) => {
|
|
59
|
-
const [hoursStr, minutesStr, secondsStr] = timeStr.split(":");
|
|
60
|
-
const hours = parseTimePart(hoursStr);
|
|
61
|
-
const minutes = parseTimePart(minutesStr);
|
|
62
|
-
const seconds = parseTimePart(secondsStr);
|
|
63
|
-
return {
|
|
64
|
-
hourStr: hoursStr,
|
|
65
|
-
hours,
|
|
66
|
-
minuteStr: minutesStr,
|
|
67
|
-
minutes,
|
|
68
|
-
secondStr: secondsStr,
|
|
69
|
-
seconds,
|
|
70
|
-
meridiem: hours < 12 ? "AM" : "PM"
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
const hoursAs12hClock = (hour) => hour % 12 || 12;
|
|
74
|
-
|
|
75
|
-
const formatPresentationTime = (timeStr, includeSeconds, use12HourClock) => {
|
|
76
|
-
const time = parseTimeStr(timeStr);
|
|
77
|
-
const hoursStr = formatTimePart(
|
|
78
|
-
use12HourClock ? hoursAs12hClock(time.hours) : time.hours
|
|
79
|
-
);
|
|
80
|
-
let result = `${hoursStr}:${time.minuteStr}`;
|
|
81
|
-
if (includeSeconds) {
|
|
82
|
-
result += `:${time.secondStr}`;
|
|
83
|
-
}
|
|
84
|
-
if (use12HourClock) {
|
|
85
|
-
result += ` ${time.meridiem}`;
|
|
86
|
-
}
|
|
87
|
-
return result;
|
|
88
|
-
};
|
|
89
|
-
const isDigit = (char) => char >= "0" && char <= "9";
|
|
90
|
-
const parsePresentationTime = (input, use12HourClock) => {
|
|
91
|
-
const cleanedInput = input.toLowerCase();
|
|
92
|
-
const numerals = [];
|
|
93
|
-
let meridiem;
|
|
94
|
-
for (let i = 0; i < cleanedInput.length; i++) {
|
|
95
|
-
const char = cleanedInput[i];
|
|
96
|
-
if (char === "a" && cleanedInput[i + 1] === "m") {
|
|
97
|
-
i++;
|
|
98
|
-
meridiem = "AM";
|
|
99
|
-
}
|
|
100
|
-
if (char === "p" && cleanedInput[i + 1] === "m") {
|
|
101
|
-
i++;
|
|
102
|
-
meridiem = "PM";
|
|
103
|
-
}
|
|
104
|
-
if (isDigit(char)) {
|
|
105
|
-
let numeral = char;
|
|
106
|
-
while (isDigit(cleanedInput[i + 1])) {
|
|
107
|
-
i++;
|
|
108
|
-
numeral += cleanedInput[i];
|
|
109
|
-
}
|
|
110
|
-
numerals.push(Number.parseInt(numeral, 10));
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
if (numerals.length === 0 || numerals.length > 3) {
|
|
114
|
-
throw new Error("Invalid time format");
|
|
115
|
-
}
|
|
116
|
-
if (meridiem && (numerals[0] < 1 || numerals[0] > 12)) {
|
|
117
|
-
throw new Error("Invalid time format");
|
|
118
|
-
}
|
|
119
|
-
if (meridiem || use12HourClock) {
|
|
120
|
-
if (numerals[0] === 12) {
|
|
121
|
-
numerals[0] = 0;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
if (meridiem === "PM") {
|
|
125
|
-
numerals[0] = numerals[0] + 12;
|
|
126
|
-
}
|
|
127
|
-
const [hours, minutes = 0, seconds = 0] = numerals;
|
|
128
|
-
if (hours > 23 || minutes > 59 || seconds > 59) {
|
|
129
|
-
throw new Error("Invalid value");
|
|
130
|
-
}
|
|
131
|
-
return [hours, minutes, seconds].map(formatTimePart).join(":");
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
const fallsIntoMeridiem = (meridiem, hour) => meridiem === "AM" && hour < 12 || meridiem === "PM" && hour >= 12;
|
|
135
|
-
const getHoursOptions = (min, max, forMeridiem) => {
|
|
136
|
-
const result = [];
|
|
137
|
-
const minHour = min ? parseTimeStr(min).hours : 0;
|
|
138
|
-
const maxHour = max ? parseTimeStr(max).hours : 23;
|
|
139
|
-
for (let i = minHour; i <= maxHour; i++) {
|
|
140
|
-
if (forMeridiem && !fallsIntoMeridiem(forMeridiem, i)) {
|
|
141
|
-
continue;
|
|
142
|
-
}
|
|
143
|
-
result.push({
|
|
144
|
-
value: formatTimePart(i),
|
|
145
|
-
label: formatTimePart(forMeridiem ? hoursAs12hClock(i) : i)
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
return result;
|
|
149
|
-
};
|
|
150
|
-
const getMinutesOptions = (step, value, min, max) => {
|
|
151
|
-
const result = [];
|
|
152
|
-
let minMinute = 0;
|
|
153
|
-
let maxMinute = 59;
|
|
154
|
-
if (min) {
|
|
155
|
-
const { hourStr: minHourStr, minutes: minMinutes } = parseTimeStr(min);
|
|
156
|
-
if (value && parseTimeStr(value).hourStr === minHourStr) {
|
|
157
|
-
minMinute = minMinutes;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
if (max) {
|
|
161
|
-
const { hourStr: maxHourStr, minutes: maxMinutes } = parseTimeStr(max);
|
|
162
|
-
if (value && parseTimeStr(value).hourStr === maxHourStr) {
|
|
163
|
-
maxMinute = maxMinutes;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
for (let i = minMinute; i <= maxMinute; i += Math.max(1, step ?? 1)) {
|
|
167
|
-
const minutes = formatTimePart(i);
|
|
168
|
-
result.push({
|
|
169
|
-
value: minutes,
|
|
170
|
-
label: minutes
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
return result;
|
|
174
|
-
};
|
|
175
|
-
const getSecondsOptions = (step, value, min, max) => {
|
|
176
|
-
const result = [];
|
|
177
|
-
let minSecond = 0;
|
|
178
|
-
let maxSecond = 59;
|
|
179
|
-
if (min) {
|
|
180
|
-
const minTime = parseTimeStr(min);
|
|
181
|
-
if (value && (parseTimeStr(value).hourStr === minTime.hourStr && parseTimeStr(value).minuteStr) === minTime.minuteStr) {
|
|
182
|
-
minSecond = minTime.seconds;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
if (max) {
|
|
186
|
-
const maxTime = parseTimeStr(max);
|
|
187
|
-
if (value && (parseTimeStr(value).hourStr === maxTime.hourStr && parseTimeStr(value).minuteStr) === maxTime.minuteStr) {
|
|
188
|
-
maxSecond = maxTime.seconds;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
for (let i = minSecond; i <= maxSecond; i += Math.max(1, step)) {
|
|
192
|
-
const seconds = formatTimePart(i);
|
|
193
|
-
result.push({
|
|
194
|
-
value: seconds,
|
|
195
|
-
label: seconds
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
return result;
|
|
199
|
-
};
|
|
200
|
-
const getMeridiesOptions = (min, max) => {
|
|
201
|
-
const result = [];
|
|
202
|
-
const hideAM = min ? parseTimeStr(min).meridiem === "PM" : false;
|
|
203
|
-
if (!hideAM) {
|
|
204
|
-
result.push({
|
|
205
|
-
value: "AM",
|
|
206
|
-
label: "AM"
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
const hidePM = max ? parseTimeStr(max).meridiem === "AM" : false;
|
|
210
|
-
if (!hidePM) {
|
|
211
|
-
result.push({
|
|
212
|
-
value: "PM",
|
|
213
|
-
label: "PM"
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
return result;
|
|
217
|
-
};
|
|
218
|
-
|
|
219
23
|
var __defProp = Object.defineProperty;
|
|
220
24
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
221
25
|
var __typeError = (msg) => {
|
|
@@ -233,641 +37,248 @@ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot
|
|
|
233
37
|
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
234
38
|
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);
|
|
235
39
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
|
|
236
|
-
var
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
return "";
|
|
244
|
-
},
|
|
245
|
-
toView(value) {
|
|
246
|
-
return value;
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
|
-
let TimePicker = class extends FormAssociatedTimePicker {
|
|
40
|
+
var _reflectToTextArea;
|
|
41
|
+
const TextAreaResize = {
|
|
42
|
+
/**
|
|
43
|
+
* No resize.
|
|
44
|
+
*/
|
|
45
|
+
none: "none"};
|
|
46
|
+
let TextArea = class extends DelegatesAria(FormAssociatedTextArea) {
|
|
250
47
|
constructor() {
|
|
251
|
-
super();
|
|
252
|
-
|
|
253
|
-
this.
|
|
254
|
-
this.
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
this._displaySeconds,
|
|
263
|
-
this._use12hClock
|
|
264
|
-
);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
});
|
|
268
|
-
__privateAdd(this, _clockChangeObserver);
|
|
269
|
-
__privateAdd(this, _getFocusableEls, () => this.shadowRoot.querySelectorAll(`
|
|
270
|
-
.dialog [tabindex="0"],
|
|
271
|
-
.dialog .vwc-button:not(:disabled)
|
|
272
|
-
`));
|
|
273
|
-
__privateAdd(this, _onFocusIn, () => {
|
|
274
|
-
this.$emit("focus", void 0, { bubbles: false });
|
|
275
|
-
});
|
|
276
|
-
__privateAdd(this, _onFocusOut, () => {
|
|
277
|
-
this.$emit("blur", void 0, { bubbles: false });
|
|
278
|
-
});
|
|
279
|
-
this._popupOpen = false;
|
|
280
|
-
__privateAdd(this, _dismissOnClickOutside, (event) => {
|
|
281
|
-
if (!this._popupOpen) {
|
|
282
|
-
return;
|
|
283
|
-
}
|
|
284
|
-
const path = event.composedPath();
|
|
285
|
-
const elementsToIgnoreClicksOn = [this._dialogEl, this._clockButtonEl];
|
|
286
|
-
if (!elementsToIgnoreClicksOn.some((element) => path.includes(element))) {
|
|
287
|
-
this._closePopup(false);
|
|
288
|
-
}
|
|
289
|
-
});
|
|
290
|
-
this._presentationValue = "";
|
|
291
|
-
this.value = "";
|
|
292
|
-
this.min = "";
|
|
293
|
-
this.max = "";
|
|
294
|
-
this.proxy.type = "time";
|
|
295
|
-
this.proxy.step = "1";
|
|
48
|
+
super(...arguments);
|
|
49
|
+
// eslint-disable-next-line @nrwl/nx/workspace/no-attribute-default-value
|
|
50
|
+
this.resize = TextAreaResize.none;
|
|
51
|
+
this.cols = 20;
|
|
52
|
+
/**
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
this.handleTextInput = () => {
|
|
56
|
+
this.value = this.control.value;
|
|
57
|
+
};
|
|
58
|
+
__privateAdd(this, _reflectToTextArea);
|
|
296
59
|
}
|
|
297
60
|
/**
|
|
298
61
|
* @internal
|
|
299
62
|
*/
|
|
300
63
|
readOnlyChanged() {
|
|
301
|
-
if (this.proxy instanceof
|
|
64
|
+
if (this.proxy instanceof HTMLTextAreaElement) {
|
|
302
65
|
this.proxy.readOnly = this.readOnly;
|
|
303
|
-
this.validate();
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
/**
|
|
307
|
-
* @internal
|
|
308
|
-
*/
|
|
309
|
-
minChanged(_, newMin) {
|
|
310
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
311
|
-
this.proxy.min = newMin;
|
|
312
|
-
this.validate();
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* @internal
|
|
317
|
-
*/
|
|
318
|
-
maxChanged(_, newMax) {
|
|
319
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
320
|
-
this.proxy.max = newMax;
|
|
321
|
-
this.validate();
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
// --- Core ---
|
|
325
|
-
/**
|
|
326
|
-
* @internal
|
|
327
|
-
*/
|
|
328
|
-
get _displaySeconds() {
|
|
329
|
-
return this.secondsStep !== null;
|
|
330
|
-
}
|
|
331
|
-
get _use12hClock() {
|
|
332
|
-
return this.clock ? this.clock === "12h" : this.locale.timePicker.defaultTo12HourClock;
|
|
333
|
-
}
|
|
334
|
-
/**
|
|
335
|
-
* @internal
|
|
336
|
-
*/
|
|
337
|
-
valueChanged(previous, next) {
|
|
338
|
-
super.valueChanged(previous, next);
|
|
339
|
-
if (this.value) {
|
|
340
|
-
if (!isValidTimeStr(this.value)) {
|
|
341
|
-
this.value = "";
|
|
342
|
-
return;
|
|
343
|
-
}
|
|
344
|
-
this._presentationValue = formatPresentationTime(
|
|
345
|
-
this.value,
|
|
346
|
-
this._displaySeconds,
|
|
347
|
-
this._use12hClock
|
|
348
|
-
);
|
|
349
|
-
} else {
|
|
350
|
-
this._presentationValue = "";
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
connectedCallback() {
|
|
354
|
-
super.connectedCallback();
|
|
355
|
-
document.addEventListener("click", __privateGet(this, _dismissOnClickOutside));
|
|
356
|
-
this.addEventListener("focusin", __privateGet(this, _onFocusIn));
|
|
357
|
-
this.addEventListener("focusout", __privateGet(this, _onFocusOut));
|
|
358
|
-
__privateSet(this, _clockChangeObserver, Observable.binding(
|
|
359
|
-
() => this._use12hClock,
|
|
360
|
-
__privateGet(this, _clockChangeHandler)
|
|
361
|
-
));
|
|
362
|
-
__privateGet(this, _clockChangeObserver).observe(this, defaultExecutionContext);
|
|
363
|
-
}
|
|
364
|
-
disconnectedCallback() {
|
|
365
|
-
super.disconnectedCallback();
|
|
366
|
-
document.removeEventListener("click", __privateGet(this, _dismissOnClickOutside));
|
|
367
|
-
this.removeEventListener("focusin", __privateGet(this, _onFocusIn));
|
|
368
|
-
this.removeEventListener("focusout", __privateGet(this, _onFocusOut));
|
|
369
|
-
__privateGet(this, _clockChangeObserver).disconnect();
|
|
370
|
-
}
|
|
371
|
-
/**
|
|
372
|
-
* @internal
|
|
373
|
-
*/
|
|
374
|
-
_closePopup(restoreFocusToTextField = true) {
|
|
375
|
-
this._popupOpen = false;
|
|
376
|
-
if (restoreFocusToTextField) {
|
|
377
|
-
this._textFieldEl.focus();
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
/**
|
|
381
|
-
* On keydown anywhere in the time picker.
|
|
382
|
-
* @internal
|
|
383
|
-
*/
|
|
384
|
-
_onBaseKeyDown(event) {
|
|
385
|
-
if (handleEscapeKeyAndStopPropogation(event)) {
|
|
386
|
-
this._closePopup();
|
|
387
|
-
return false;
|
|
388
|
-
}
|
|
389
|
-
if (this._trappedFocus(event, __privateGet(this, _getFocusableEls))) {
|
|
390
|
-
return false;
|
|
391
|
-
}
|
|
392
|
-
return true;
|
|
393
|
-
}
|
|
394
|
-
/**
|
|
395
|
-
* @internal
|
|
396
|
-
*/
|
|
397
|
-
_presentationValueChanged() {
|
|
398
|
-
this.dirtyValue = true;
|
|
399
|
-
this.validate();
|
|
400
|
-
}
|
|
401
|
-
/**
|
|
402
|
-
* @internal
|
|
403
|
-
*/
|
|
404
|
-
get _textFieldPlaceholder() {
|
|
405
|
-
let format = "hh:mm";
|
|
406
|
-
if (this._displaySeconds) {
|
|
407
|
-
format += ":ss";
|
|
408
|
-
}
|
|
409
|
-
if (this._use12hClock) {
|
|
410
|
-
format += " aa";
|
|
411
66
|
}
|
|
412
|
-
return format;
|
|
413
67
|
}
|
|
414
68
|
/**
|
|
415
69
|
* @internal
|
|
416
70
|
*/
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
}
|
|
421
|
-
/**
|
|
422
|
-
* @internal
|
|
423
|
-
*/
|
|
424
|
-
_onTextFieldChange() {
|
|
425
|
-
if (this._presentationValue === "") {
|
|
426
|
-
__privateMethod(this, _TimePicker_instances, updateValueDueToUserInteraction_fn).call(this, "");
|
|
427
|
-
return;
|
|
428
|
-
}
|
|
429
|
-
try {
|
|
430
|
-
__privateMethod(this, _TimePicker_instances, updateValueDueToUserInteraction_fn).call(this, parsePresentationTime(this._presentationValue, this._use12hClock));
|
|
431
|
-
} catch (_) {
|
|
432
|
-
return;
|
|
71
|
+
autofocusChanged() {
|
|
72
|
+
if (this.proxy instanceof HTMLTextAreaElement) {
|
|
73
|
+
this.proxy.autofocus = this.autofocus;
|
|
433
74
|
}
|
|
434
75
|
}
|
|
435
|
-
// --- Clock button ---
|
|
436
76
|
/**
|
|
437
77
|
* @internal
|
|
438
78
|
*/
|
|
439
|
-
|
|
440
|
-
if (this.
|
|
441
|
-
|
|
442
|
-
formatPresentationTime(
|
|
443
|
-
this.value,
|
|
444
|
-
this._displaySeconds,
|
|
445
|
-
this._use12hClock
|
|
446
|
-
)
|
|
447
|
-
);
|
|
79
|
+
listChanged() {
|
|
80
|
+
if (this.proxy instanceof HTMLTextAreaElement) {
|
|
81
|
+
this.proxy.setAttribute("list", this.list);
|
|
448
82
|
}
|
|
449
|
-
return this.locale.timePicker.chooseTimeLabel;
|
|
450
83
|
}
|
|
451
84
|
/**
|
|
452
85
|
* @internal
|
|
453
86
|
*/
|
|
454
|
-
|
|
455
|
-
if (this.
|
|
456
|
-
this.
|
|
457
|
-
} else {
|
|
458
|
-
__privateMethod(this, _TimePicker_instances, openPopupIfPossible_fn).call(this);
|
|
459
|
-
DOM.processUpdates();
|
|
460
|
-
if (this._selectedHour) {
|
|
461
|
-
__privateMethod(this, _TimePicker_instances, scrollToItem_fn).call(this, "hours", this._selectedHour, "start");
|
|
462
|
-
}
|
|
463
|
-
if (this._selectedMinute) {
|
|
464
|
-
__privateMethod(this, _TimePicker_instances, scrollToItem_fn).call(this, "minutes", this._selectedMinute, "start");
|
|
465
|
-
}
|
|
466
|
-
if (this._displaySeconds && this._selectedSecond) {
|
|
467
|
-
__privateMethod(this, _TimePicker_instances, scrollToItem_fn).call(this, "seconds", this._selectedSecond, "start");
|
|
468
|
-
}
|
|
469
|
-
if (this._use12hClock && this._selectedMeridiem) {
|
|
470
|
-
__privateMethod(this, _TimePicker_instances, scrollToItem_fn).call(this, "meridies", this._selectedMeridiem, "start");
|
|
471
|
-
}
|
|
472
|
-
__privateGet(this, _getFocusableEls).call(this)[0].focus();
|
|
87
|
+
maxlengthChanged() {
|
|
88
|
+
if (this.proxy instanceof HTMLTextAreaElement) {
|
|
89
|
+
this.proxy.maxLength = this.maxlength;
|
|
473
90
|
}
|
|
474
91
|
}
|
|
475
|
-
// --- Pickers ---
|
|
476
|
-
/**
|
|
477
|
-
* @internal
|
|
478
|
-
*/
|
|
479
|
-
get _hours() {
|
|
480
|
-
return getHoursOptions(
|
|
481
|
-
this.min,
|
|
482
|
-
this.max,
|
|
483
|
-
this._use12hClock ? this._selectedMeridiem ?? this._meridies[0].value : void 0
|
|
484
|
-
);
|
|
485
|
-
}
|
|
486
92
|
/**
|
|
487
93
|
* @internal
|
|
488
94
|
*/
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
/**
|
|
493
|
-
* @internal
|
|
494
|
-
*/
|
|
495
|
-
set _selectedHour(value) {
|
|
496
|
-
if (this.value) {
|
|
497
|
-
const { minuteStr, secondStr } = parseTimeStr(this.value);
|
|
498
|
-
this.value = `${value}:${minuteStr}:${secondStr}`;
|
|
499
|
-
} else {
|
|
500
|
-
this.value = `${value}:00:00`;
|
|
95
|
+
minlengthChanged() {
|
|
96
|
+
if (this.proxy instanceof HTMLTextAreaElement) {
|
|
97
|
+
this.proxy.minLength = this.minlength;
|
|
501
98
|
}
|
|
502
99
|
}
|
|
503
100
|
/**
|
|
504
101
|
* @internal
|
|
505
102
|
*/
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
/**
|
|
510
|
-
* @internal
|
|
511
|
-
*/
|
|
512
|
-
get _selectedMinute() {
|
|
513
|
-
return this.value ? parseTimeStr(this.value).minuteStr : void 0;
|
|
514
|
-
}
|
|
515
|
-
/**
|
|
516
|
-
* @internal
|
|
517
|
-
*/
|
|
518
|
-
set _selectedMinute(value) {
|
|
519
|
-
if (this.value) {
|
|
520
|
-
const { hourStr, secondStr } = parseTimeStr(this.value);
|
|
521
|
-
this.value = `${hourStr}:${value}:${secondStr}`;
|
|
522
|
-
} else {
|
|
523
|
-
this.value = `00:${value}:00`;
|
|
103
|
+
spellcheckChanged() {
|
|
104
|
+
if (this.proxy instanceof HTMLTextAreaElement) {
|
|
105
|
+
this.proxy.spellcheck = this.spellcheck;
|
|
524
106
|
}
|
|
525
107
|
}
|
|
526
108
|
/**
|
|
527
|
-
*
|
|
109
|
+
* Selects all the text in the text area
|
|
110
|
+
*
|
|
111
|
+
* @public
|
|
528
112
|
*/
|
|
529
|
-
|
|
530
|
-
|
|
113
|
+
select() {
|
|
114
|
+
this.control.select();
|
|
531
115
|
}
|
|
532
116
|
/**
|
|
117
|
+
* Change event handler for inner control.
|
|
118
|
+
* @remarks
|
|
119
|
+
* "Change" events are not `composable` so they will not
|
|
120
|
+
* permeate the shadow DOM boundary. This fn effectively proxies
|
|
121
|
+
* the change event, emitting a `change` event whenever the internal
|
|
122
|
+
* control emits a `change` event
|
|
533
123
|
* @internal
|
|
534
124
|
*/
|
|
535
|
-
|
|
536
|
-
|
|
125
|
+
handleChange() {
|
|
126
|
+
this.$emit("change");
|
|
537
127
|
}
|
|
538
|
-
/**
|
|
539
|
-
* @internal
|
|
540
|
-
*/
|
|
541
|
-
set _selectedSecond(value) {
|
|
542
|
-
if (this.value) {
|
|
543
|
-
const { hourStr, minuteStr } = parseTimeStr(this.value);
|
|
544
|
-
this.value = `${hourStr}:${minuteStr}:${value}`;
|
|
545
|
-
} else {
|
|
546
|
-
this.value = `00:00:${value}`;
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
/**
|
|
550
|
-
* @internal
|
|
551
|
-
*/
|
|
552
|
-
get _meridies() {
|
|
553
|
-
return getMeridiesOptions(this.min, this.max);
|
|
554
|
-
}
|
|
555
|
-
/**
|
|
556
|
-
* @internal
|
|
557
|
-
*/
|
|
558
|
-
get _selectedMeridiem() {
|
|
559
|
-
return this.value ? parseTimeStr(this.value).meridiem : void 0;
|
|
560
|
-
}
|
|
561
|
-
/**
|
|
562
|
-
* @internal
|
|
563
|
-
*/
|
|
564
|
-
set _selectedMeridiem(value) {
|
|
565
|
-
if (this.value) {
|
|
566
|
-
const { hours, minuteStr, secondStr } = parseTimeStr(this.value);
|
|
567
|
-
let adjustedHours = hours;
|
|
568
|
-
if (value === "AM" && hours >= 12) {
|
|
569
|
-
adjustedHours -= 12;
|
|
570
|
-
} else if (value === "PM" && hours < 12) {
|
|
571
|
-
adjustedHours += 12;
|
|
572
|
-
}
|
|
573
|
-
this.value = `${formatTimePart(adjustedHours)}:${minuteStr}:${secondStr}`;
|
|
574
|
-
} else {
|
|
575
|
-
if (value === "AM") {
|
|
576
|
-
this.value = "00:00:00";
|
|
577
|
-
} else {
|
|
578
|
-
this.value = "12:00:00";
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
/**
|
|
583
|
-
* @internal
|
|
584
|
-
*/
|
|
585
|
-
_onPickerKeyDown(picker, options, selectedValue, setSelectedValue, event) {
|
|
586
|
-
const offset = {
|
|
587
|
-
ArrowUp: -1,
|
|
588
|
-
ArrowDown: 1
|
|
589
|
-
}[event.key];
|
|
590
|
-
if (offset) {
|
|
591
|
-
event.preventDefault();
|
|
592
|
-
const index = options.findIndex((h) => h.value === selectedValue);
|
|
593
|
-
const newRawIndex = index === -1 ? 0 : index + offset;
|
|
594
|
-
const newIndex = (newRawIndex + options.length) % options.length;
|
|
595
|
-
const newValue = options[newIndex].value;
|
|
596
|
-
setSelectedValue(newValue);
|
|
597
|
-
__privateMethod(this, _TimePicker_instances, scrollToItem_fn).call(this, picker, newValue, "nearest");
|
|
598
|
-
__privateMethod(this, _TimePicker_instances, updateValueDueToUserInteraction_fn).call(this, this.value);
|
|
599
|
-
}
|
|
600
|
-
return true;
|
|
601
|
-
}
|
|
602
|
-
/**
|
|
603
|
-
* @internal
|
|
604
|
-
*/
|
|
605
|
-
_onPickerItemClick(picker, setSelectedValue, value) {
|
|
606
|
-
setSelectedValue(value);
|
|
607
|
-
__privateMethod(this, _TimePicker_instances, scrollToItem_fn).call(this, picker, value, "start");
|
|
608
|
-
__privateMethod(this, _TimePicker_instances, updateValueDueToUserInteraction_fn).call(this, this.value);
|
|
609
|
-
const nextPickerEl = this.shadowRoot.querySelector(
|
|
610
|
-
`#${picker} + .picker`
|
|
611
|
-
);
|
|
612
|
-
if (nextPickerEl) {
|
|
613
|
-
nextPickerEl.focus();
|
|
614
|
-
} else {
|
|
615
|
-
this._closePopup();
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
// --- Dialog footer ---
|
|
619
|
-
/**
|
|
620
|
-
* @internal
|
|
621
|
-
*/
|
|
622
|
-
_onOkClick() {
|
|
623
|
-
this._closePopup();
|
|
624
|
-
}
|
|
625
|
-
/**
|
|
626
|
-
* @internal
|
|
627
|
-
*/
|
|
628
|
-
_onClearClick() {
|
|
629
|
-
__privateMethod(this, _TimePicker_instances, updateValueDueToUserInteraction_fn).call(this, "");
|
|
630
|
-
this._closePopup();
|
|
631
|
-
}
|
|
632
|
-
// --- Validation ---
|
|
633
|
-
/**
|
|
634
|
-
* @internal
|
|
635
|
-
*/
|
|
128
|
+
/** {@inheritDoc (FormAssociated:interface).validate} */
|
|
636
129
|
validate() {
|
|
637
|
-
|
|
638
|
-
this.proxy.setCustomValidity(this._getCustomValidationError() ?? "");
|
|
639
|
-
}
|
|
640
|
-
super.validate(this._textFieldEl?.querySelector("input") ?? void 0);
|
|
641
|
-
}
|
|
642
|
-
/**
|
|
643
|
-
* @internal
|
|
644
|
-
*/
|
|
645
|
-
_getCustomValidationError() {
|
|
646
|
-
if (this._isPresentationValueInvalid()) {
|
|
647
|
-
return this.locale.timePicker.invalidTimeError;
|
|
648
|
-
}
|
|
649
|
-
return null;
|
|
650
|
-
}
|
|
651
|
-
/**
|
|
652
|
-
* @internal
|
|
653
|
-
*/
|
|
654
|
-
_isPresentationValueInvalid() {
|
|
655
|
-
if (this._presentationValue === "") {
|
|
656
|
-
return false;
|
|
657
|
-
}
|
|
658
|
-
try {
|
|
659
|
-
parsePresentationTime(this._presentationValue, this._use12hClock);
|
|
660
|
-
return false;
|
|
661
|
-
} catch (_) {
|
|
662
|
-
return true;
|
|
663
|
-
}
|
|
130
|
+
super.validate(this.control);
|
|
664
131
|
}
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
_TimePicker_instances = new WeakSet();
|
|
670
|
-
updateValueDueToUserInteraction_fn = function(newValue) {
|
|
671
|
-
this.value = newValue;
|
|
672
|
-
this.$emit("change");
|
|
673
|
-
this.$emit("input");
|
|
674
|
-
};
|
|
675
|
-
_onFocusIn = new WeakMap();
|
|
676
|
-
_onFocusOut = new WeakMap();
|
|
677
|
-
_dismissOnClickOutside = new WeakMap();
|
|
678
|
-
openPopupIfPossible_fn = function() {
|
|
679
|
-
if (!this.readOnly) {
|
|
680
|
-
this._popupOpen = true;
|
|
132
|
+
connectedCallback() {
|
|
133
|
+
super.connectedCallback();
|
|
134
|
+
__privateSet(this, _reflectToTextArea, new Reflector(this, this.control));
|
|
135
|
+
__privateGet(this, _reflectToTextArea).property("value", "value", true);
|
|
681
136
|
}
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
`#${picker}-${selectedValue}`
|
|
686
|
-
);
|
|
687
|
-
if (!element) {
|
|
688
|
-
return;
|
|
137
|
+
disconnectedCallback() {
|
|
138
|
+
super.disconnectedCallback();
|
|
139
|
+
__privateGet(this, _reflectToTextArea).destroy();
|
|
689
140
|
}
|
|
690
|
-
scrollIntoView(element, element.parentElement, position);
|
|
691
141
|
};
|
|
142
|
+
_reflectToTextArea = new WeakMap();
|
|
143
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
144
|
+
__decorateClass([
|
|
145
|
+
attr({ mode: "boolean" })
|
|
146
|
+
], TextArea.prototype, "readOnly", 2);
|
|
692
147
|
__decorateClass([
|
|
693
|
-
attr
|
|
694
|
-
],
|
|
148
|
+
attr
|
|
149
|
+
], TextArea.prototype, "resize", 2);
|
|
150
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
695
151
|
__decorateClass([
|
|
696
|
-
attr({
|
|
697
|
-
],
|
|
152
|
+
attr({ mode: "boolean" })
|
|
153
|
+
], TextArea.prototype, "autofocus", 2);
|
|
154
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
698
155
|
__decorateClass([
|
|
699
|
-
attr({ attribute: "
|
|
700
|
-
],
|
|
156
|
+
attr({ attribute: "form" })
|
|
157
|
+
], TextArea.prototype, "formId", 2);
|
|
158
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
701
159
|
__decorateClass([
|
|
702
160
|
attr
|
|
703
|
-
],
|
|
161
|
+
], TextArea.prototype, "list", 2);
|
|
162
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
704
163
|
__decorateClass([
|
|
705
|
-
attr({ converter:
|
|
706
|
-
],
|
|
164
|
+
attr({ converter: nullableNumberConverter })
|
|
165
|
+
], TextArea.prototype, "maxlength", 2);
|
|
166
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
707
167
|
__decorateClass([
|
|
708
|
-
attr({ converter:
|
|
709
|
-
],
|
|
168
|
+
attr({ converter: nullableNumberConverter })
|
|
169
|
+
], TextArea.prototype, "minlength", 2);
|
|
170
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
710
171
|
__decorateClass([
|
|
711
|
-
|
|
712
|
-
],
|
|
172
|
+
attr
|
|
173
|
+
], TextArea.prototype, "name", 2);
|
|
174
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
713
175
|
__decorateClass([
|
|
714
|
-
|
|
715
|
-
],
|
|
176
|
+
attr
|
|
177
|
+
], TextArea.prototype, "placeholder", 2);
|
|
178
|
+
__decorateClass([
|
|
179
|
+
attr({ converter: nullableNumberConverter, mode: "fromView" })
|
|
180
|
+
], TextArea.prototype, "cols", 2);
|
|
181
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
182
|
+
__decorateClass([
|
|
183
|
+
attr({ converter: nullableNumberConverter, mode: "fromView" })
|
|
184
|
+
], TextArea.prototype, "rows", 2);
|
|
185
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
186
|
+
__decorateClass([
|
|
187
|
+
attr({ mode: "boolean" })
|
|
188
|
+
], TextArea.prototype, "spellcheck", 2);
|
|
716
189
|
__decorateClass([
|
|
717
190
|
observable
|
|
718
|
-
],
|
|
719
|
-
|
|
191
|
+
], TextArea.prototype, "defaultSlottedNodes", 2);
|
|
192
|
+
__decorateClass([
|
|
193
|
+
attr
|
|
194
|
+
], TextArea.prototype, "wrap", 2);
|
|
195
|
+
TextArea = __decorateClass([
|
|
720
196
|
errorText,
|
|
721
197
|
formElements
|
|
722
|
-
],
|
|
198
|
+
], TextArea);
|
|
723
199
|
applyMixinsWithObservables(
|
|
724
|
-
|
|
725
|
-
|
|
200
|
+
TextArea,
|
|
201
|
+
FormElementCharCount,
|
|
726
202
|
FormElementHelperText,
|
|
727
|
-
|
|
203
|
+
FormElementSuccessText
|
|
728
204
|
);
|
|
729
205
|
|
|
730
|
-
const
|
|
206
|
+
const getClasses = ({
|
|
207
|
+
value,
|
|
208
|
+
errorValidationMessage,
|
|
209
|
+
disabled,
|
|
210
|
+
placeholder,
|
|
211
|
+
readOnly,
|
|
212
|
+
successText
|
|
213
|
+
}) => classNames(
|
|
214
|
+
"base",
|
|
215
|
+
["readonly", readOnly],
|
|
216
|
+
["placeholder", Boolean(placeholder)],
|
|
217
|
+
["disabled", disabled],
|
|
218
|
+
["error", Boolean(errorValidationMessage)],
|
|
219
|
+
["has-value", Boolean(value)],
|
|
220
|
+
["success", !!successText]
|
|
221
|
+
);
|
|
222
|
+
function renderLabel() {
|
|
223
|
+
return html` <label for="control" class="label">
|
|
224
|
+
${(x) => x.label}
|
|
225
|
+
</label>`;
|
|
226
|
+
}
|
|
227
|
+
function renderCharCount() {
|
|
731
228
|
return html`
|
|
732
|
-
<
|
|
733
|
-
|
|
734
|
-
class="picker"
|
|
735
|
-
role="listbox"
|
|
736
|
-
tabindex="0"
|
|
737
|
-
aria-label="${getLabel}"
|
|
738
|
-
aria-activedescendant="${(x) => getSelected(x) ? `${id}-${getSelected(x)}` : void 0}"
|
|
739
|
-
@keydown="${(x, c) => x._onPickerKeyDown(
|
|
740
|
-
id,
|
|
741
|
-
getOptions(x),
|
|
742
|
-
getSelected(x),
|
|
743
|
-
setSelected(x),
|
|
744
|
-
c.event
|
|
745
|
-
)}"
|
|
229
|
+
<span class="char-count"
|
|
230
|
+
>${(x) => x.value ? x.value.length : 0} / ${(x) => x.maxlength}</span
|
|
746
231
|
>
|
|
747
|
-
${repeat(
|
|
748
|
-
getOptions,
|
|
749
|
-
html`
|
|
750
|
-
<li
|
|
751
|
-
id="${(x) => `${id}-${x.value}`}"
|
|
752
|
-
class="${(x, c) => classNames("item", [
|
|
753
|
-
"selected",
|
|
754
|
-
getSelected(c.parent) === x.value
|
|
755
|
-
])}"
|
|
756
|
-
role="option"
|
|
757
|
-
aria-selected="${(x, c) => getSelected(c.parent) === x.value}"
|
|
758
|
-
@click="${(x, c) => c.parent._onPickerItemClick(id, setSelected(c.parent), x.value)}"
|
|
759
|
-
>
|
|
760
|
-
${(x) => x.label}
|
|
761
|
-
</li>
|
|
762
|
-
`
|
|
763
|
-
)}
|
|
764
|
-
</ul>
|
|
765
232
|
`;
|
|
766
|
-
}
|
|
767
|
-
const
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
${
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
${
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
aria-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
"_dialogEl"
|
|
809
|
-
)} aria-modal="true" aria-label="${(x) => x.locale.timePicker.chooseTimeLabel}">
|
|
810
|
-
<div class="time-pickers">
|
|
811
|
-
${renderPicker(
|
|
812
|
-
"hours",
|
|
813
|
-
(x) => x.locale.timePicker.hoursLabel,
|
|
814
|
-
(x) => x._selectedHour,
|
|
815
|
-
(x) => (v) => x._selectedHour = v,
|
|
816
|
-
(x) => x._hours
|
|
817
|
-
)}
|
|
818
|
-
${renderPicker(
|
|
819
|
-
"minutes",
|
|
820
|
-
(x) => x.locale.timePicker.minutesLabel,
|
|
821
|
-
(x) => x._selectedMinute,
|
|
822
|
-
(x) => (v) => x._selectedMinute = v,
|
|
823
|
-
(x) => x._minutes
|
|
824
|
-
)}
|
|
825
|
-
${when(
|
|
826
|
-
(x) => x._displaySeconds,
|
|
827
|
-
renderPicker(
|
|
828
|
-
"seconds",
|
|
829
|
-
(x) => x.locale.timePicker.secondsLabel,
|
|
830
|
-
(x) => x._selectedSecond,
|
|
831
|
-
(x) => (v) => x._selectedSecond = v,
|
|
832
|
-
(x) => x._seconds
|
|
833
|
-
)
|
|
834
|
-
)}
|
|
835
|
-
${when(
|
|
836
|
-
(x) => x._use12hClock,
|
|
837
|
-
renderPicker(
|
|
838
|
-
"meridies",
|
|
839
|
-
(x) => x.locale.timePicker.meridiesLabel,
|
|
840
|
-
(x) => x._selectedMeridiem,
|
|
841
|
-
(x) => (v) => x._selectedMeridiem = v,
|
|
842
|
-
(x) => x._meridies
|
|
843
|
-
)
|
|
844
|
-
)}
|
|
845
|
-
</div>
|
|
846
|
-
<div class="footer">
|
|
847
|
-
<${buttonTag}
|
|
848
|
-
class="vwc-button"
|
|
849
|
-
size="condensed"
|
|
850
|
-
label="${(x) => x.locale.timePicker.clearLabel}"
|
|
851
|
-
@click="${(x) => x._onClearClick()}"
|
|
852
|
-
></${buttonTag}>
|
|
853
|
-
<${buttonTag}
|
|
854
|
-
class="vwc-button"
|
|
855
|
-
size="condensed"
|
|
856
|
-
appearance="filled"
|
|
857
|
-
label="${(x) => x.locale.timePicker.okLabel}"
|
|
858
|
-
@click="${(x) => x._onOkClick()}"
|
|
859
|
-
></${buttonTag}>
|
|
860
|
-
</div>
|
|
861
|
-
</div>
|
|
862
|
-
</${popupTag}>
|
|
863
|
-
</div>`;
|
|
233
|
+
}
|
|
234
|
+
const TextAreaTemplate = (context) => {
|
|
235
|
+
return html`
|
|
236
|
+
<div class="${getClasses}">
|
|
237
|
+
${when((x) => x.charCount && x.maxlength, renderCharCount())}
|
|
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-disabled="${(x) => x.ariaDisabled}"
|
|
259
|
+
aria-haspopup="${(x) => x.ariaHasPopup}"
|
|
260
|
+
aria-hidden="${(x) => x.ariaHidden}"
|
|
261
|
+
aria-invalid="${(x) => x.ariaInvalid}"
|
|
262
|
+
aria-keyshortcuts="${(x) => x.ariaKeyShortcuts}"
|
|
263
|
+
aria-label="${(x) => x.ariaLabel}"
|
|
264
|
+
aria-live="${(x) => x.ariaLive}"
|
|
265
|
+
aria-relevant="${(x) => x.ariaRelevant}"
|
|
266
|
+
aria-roledescription="${(x) => x.ariaRoleDescription}"
|
|
267
|
+
@input="${(x) => x.handleTextInput()}"
|
|
268
|
+
@change="${(x) => x.handleChange()}"
|
|
269
|
+
${ref("control")}
|
|
270
|
+
>
|
|
271
|
+
</textarea>
|
|
272
|
+
${getFeedbackTemplate(context)}
|
|
273
|
+
</div>
|
|
274
|
+
`;
|
|
864
275
|
};
|
|
865
276
|
|
|
866
|
-
const
|
|
867
|
-
"
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
[
|
|
277
|
+
const textAreaDefinition = defineVividComponent(
|
|
278
|
+
"text-area",
|
|
279
|
+
TextArea,
|
|
280
|
+
TextAreaTemplate,
|
|
281
|
+
[iconDefinition],
|
|
871
282
|
{
|
|
872
283
|
styles,
|
|
873
284
|
shadowOptions: {
|
|
@@ -875,6 +286,6 @@ const timePickerDefinition = defineVividComponent(
|
|
|
875
286
|
}
|
|
876
287
|
}
|
|
877
288
|
);
|
|
878
|
-
const
|
|
289
|
+
const registerTextArea = createRegisterFunction(textAreaDefinition);
|
|
879
290
|
|
|
880
|
-
export {
|
|
291
|
+
export { TextArea as T, registerTextArea as r, textAreaDefinition as t };
|