@vonage/vivid 4.17.0 → 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 +3903 -3860
- 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 +136 -133
- package/index.js +45 -44
- package/layout/index.cjs +1 -1
- package/layout/index.js +1 -1
- package/lib/action-group/action-group.d.ts +449 -3
- package/lib/banner/banner.d.ts +449 -3
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +449 -1
- package/lib/checkbox/checkbox.d.ts +449 -4
- package/lib/components.d.ts +1 -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-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-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/dialog/dialog.d.ts +449 -2
- package/lib/divider/divider.d.ts +448 -1
- package/lib/menu/menu.d.ts +446 -1
- package/lib/nav-disclosure/nav-disclosure.d.ts +449 -2
- package/lib/number-field/number-field.d.ts +450 -3
- package/lib/option/option.d.ts +1 -11
- package/lib/progress/progress.d.ts +449 -2
- package/lib/progress-ring/progress-ring.d.ts +449 -2
- package/lib/rich-text-editor/facades/vivid-prose-mirror.facade.d.ts +1 -0
- package/lib/rich-text-editor/rich-text-editor.d.ts +7 -4
- package/lib/select/select.d.ts +1 -5
- package/lib/selectable-box/selectable-box.d.ts +449 -2
- package/lib/slider/slider.d.ts +449 -3
- package/lib/split-button/split-button.d.ts +449 -3
- package/lib/switch/switch.d.ts +449 -2
- package/lib/tag-group/tag-group.d.ts +449 -2
- package/lib/text-anchor/text-anchor.d.ts +449 -1
- package/lib/text-area/text-area.d.ts +450 -3
- package/lib/text-field/text-field.d.ts +450 -7
- 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 -1
- 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 +1 -1
- 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 +1 -1
- package/rich-text-editor/index.js +1 -1
- 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 +1 -1
- package/shared/affix.js +1 -1
- package/shared/anchor.cjs +0 -10
- package/shared/anchor.js +0 -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} +730 -900
- package/shared/{presentationDate.js → calendar-picker.template.js} +672 -845
- 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 +1 -1
- package/shared/definition11.cjs +8 -11
- package/shared/definition11.js +8 -11
- package/shared/definition14.cjs +2 -2
- package/shared/definition14.js +2 -2
- package/shared/definition15.cjs +3 -10
- package/shared/definition15.js +3 -10
- package/shared/definition16.cjs +29 -33
- package/shared/definition16.js +29 -33
- package/shared/definition17.cjs +1 -1
- package/shared/definition17.js +1 -1
- package/shared/definition18.cjs +56 -91
- package/shared/definition18.js +56 -91
- package/shared/definition19.cjs +68 -32
- package/shared/definition19.js +58 -22
- package/shared/definition20.cjs +253 -220
- package/shared/definition20.js +254 -220
- package/shared/definition21.cjs +200 -286
- package/shared/definition21.js +198 -284
- package/shared/definition22.cjs +302 -31
- package/shared/definition22.js +301 -30
- package/shared/definition23.cjs +37 -58
- package/shared/definition23.js +36 -57
- package/shared/definition24.cjs +50 -70
- package/shared/definition24.js +49 -69
- package/shared/definition25.cjs +75 -2475
- package/shared/definition25.js +74 -2475
- package/shared/definition26.cjs +2480 -50
- package/shared/definition26.js +2479 -48
- package/shared/definition27.cjs +53 -271
- package/shared/definition27.js +52 -269
- package/shared/definition28.cjs +271 -48
- package/shared/definition28.js +269 -47
- package/shared/definition29.cjs +37 -764
- package/shared/definition29.js +36 -758
- package/shared/definition3.cjs +2 -9
- package/shared/definition3.js +2 -9
- package/shared/definition30.cjs +739 -57
- package/shared/definition30.js +733 -56
- package/shared/definition31.cjs +93 -22
- package/shared/definition31.js +92 -21
- package/shared/definition32.cjs +28 -10
- package/shared/definition32.js +27 -9
- package/shared/definition33.cjs +10 -52
- package/shared/definition33.js +9 -51
- package/shared/definition34.cjs +30 -411
- package/shared/definition34.js +30 -412
- package/shared/definition35.cjs +422 -52
- package/shared/definition35.js +423 -53
- package/shared/definition36.cjs +53 -216
- package/shared/definition36.js +53 -215
- package/shared/definition37.cjs +201 -71
- package/shared/definition37.js +200 -70
- package/shared/definition38.cjs +53 -48
- package/shared/definition38.js +51 -46
- package/shared/definition39.cjs +57 -263
- package/shared/definition39.js +56 -262
- package/shared/definition4.cjs +2 -2
- package/shared/definition4.js +2 -2
- package/shared/definition40.cjs +220 -148
- package/shared/definition40.js +220 -148
- package/shared/definition41.cjs +143 -567
- package/shared/definition41.js +143 -568
- package/shared/definition42.cjs +596 -12573
- package/shared/definition42.js +596 -12573
- package/shared/definition43.cjs +13489 -1058
- package/shared/definition43.js +13489 -1059
- package/shared/definition44.cjs +936 -698
- package/shared/definition44.js +937 -698
- package/shared/definition45.cjs +850 -105
- package/shared/definition45.js +850 -104
- package/shared/definition46.cjs +110 -90
- package/shared/definition46.js +108 -88
- package/shared/definition47.cjs +88 -464
- package/shared/definition47.js +87 -463
- package/shared/definition48.cjs +457 -111
- package/shared/definition48.js +456 -110
- package/shared/definition49.cjs +103 -109
- package/shared/definition49.js +102 -108
- package/shared/definition5.cjs +3 -3
- package/shared/definition5.js +3 -3
- package/shared/definition50.cjs +136 -14
- package/shared/definition50.js +135 -13
- package/shared/definition51.cjs +16 -115
- package/shared/definition51.js +15 -114
- package/shared/definition52.cjs +79 -486
- package/shared/definition52.js +78 -485
- package/shared/definition53.cjs +503 -24
- package/shared/definition53.js +502 -23
- package/shared/definition54.cjs +23 -137
- package/shared/definition54.js +22 -136
- package/shared/definition55.cjs +96 -241
- package/shared/definition55.js +95 -241
- package/shared/definition56.cjs +261 -61
- package/shared/definition56.js +260 -60
- package/shared/definition57.cjs +419 -788
- package/shared/definition57.js +420 -789
- package/shared/definition58.cjs +27 -144
- package/shared/definition58.js +27 -143
- package/shared/definition59.cjs +83 -54
- package/shared/definition59.js +82 -53
- package/shared/definition6.cjs +1 -1
- package/shared/definition6.js +1 -1
- package/shared/definition60.cjs +80 -165
- package/shared/definition60.js +79 -163
- package/shared/definition61.cjs +143 -230
- package/shared/definition61.js +141 -229
- package/shared/definition62.cjs +233 -69344
- package/shared/definition62.js +232 -69343
- package/shared/definition63.cjs +69381 -28
- package/shared/definition63.js +69379 -26
- package/shared/definition64.cjs +28 -2168
- package/shared/definition64.js +27 -2166
- package/shared/definition65.cjs +2195 -0
- package/shared/definition65.js +2190 -0
- package/shared/definition7.cjs +1 -1
- package/shared/definition7.js +1 -1
- package/shared/definition8.cjs +3 -9
- package/shared/definition8.js +3 -9
- package/shared/definition9.cjs +1 -1
- package/shared/definition9.js +1 -1
- package/shared/delegates-aria.cjs +69 -0
- package/shared/delegates-aria.js +67 -0
- package/shared/form-associated.js +1 -1
- package/shared/form-elements.cjs +1 -1
- package/shared/form-elements.js +1 -1
- 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/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/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/{lib/time-picker → shared/picker-field/mixins}/inline-time-picker/columns.d.ts +1 -1
- package/{lib/time-picker → shared/picker-field/mixins}/inline-time-picker/inline-time-picker.d.ts +2 -2
- 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 +3 -3
- package/shared/slider.template.js +3 -3
- package/shared/text-anchor.cjs +2 -1
- package/shared/text-anchor.js +2 -1
- package/shared/text-anchor.template.cjs +3 -5
- package/shared/text-anchor.template.js +3 -5
- package/shared/text-field.cjs +2 -555
- package/shared/text-field.js +2 -554
- package/shared/time-selection-picker.template.cjs +776 -0
- package/shared/time-selection-picker.template.js +767 -0
- package/shared/vivid-element.cjs +1 -1
- package/shared/vivid-element.js +1 -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 +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 +105 -1152
- 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 -5
- package/shared/text-field2.js +0 -3
- package/shared/trapped-focus.cjs +0 -35
- package/shared/trapped-focus.js +0 -33
- /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/{lib/time-picker → shared/picker-field/mixins}/inline-time-picker/definition.d.ts +0 -0
- /package/{lib/time-picker → shared/picker-field/mixins}/inline-time-picker/inline-time-picker.template.d.ts +0 -0
package/shared/definition35.cjs
CHANGED
|
@@ -1,69 +1,439 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const definition = require('./
|
|
3
|
+
const definition = require('./definition11.cjs');
|
|
4
|
+
const definition$1 = require('./definition23.cjs');
|
|
4
5
|
const vividElement = require('./vivid-element.cjs');
|
|
5
|
-
const
|
|
6
|
+
const definition$2 = require('./definition28.cjs');
|
|
7
|
+
const applyMixinsWithObservables = require('./applyMixinsWithObservables.cjs');
|
|
8
|
+
const delegatesAria = require('./delegates-aria.cjs');
|
|
9
|
+
const formAssociated = require('./form-associated.cjs');
|
|
10
|
+
const keyCodes = require('./key-codes.cjs');
|
|
11
|
+
const formElements = require('./form-elements.cjs');
|
|
6
12
|
const affix = require('./affix.cjs');
|
|
13
|
+
const localized = require('./localized.cjs');
|
|
14
|
+
const enums = require('./enums.cjs');
|
|
7
15
|
const classNames = require('./class-names.cjs');
|
|
8
16
|
const when = require('./when.cjs');
|
|
17
|
+
const ref = require('./ref.cjs');
|
|
9
18
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
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-color-primary: var(--vvd-text-field-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-text-field-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-text-field-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-intermediate: var(--vvd-text-field-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-firm: var(--vvd-text-field-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-fierce: var(--vvd-text-field-accent-fierce, var(--vvd-color-neutral-700));--_connotation-color-faint: var(--vvd-text-field-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-text-field-accent-soft, var(--vvd-color-neutral-100))}.base{--_text-field-gutter-start: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))*.4) ;--_text-field-gutter-end: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))*.4) ;--_text-field-icon-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))/2) ;--_text-field-block-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;--_text-field-border-radius: 8px;--_text-field-pill-border-radius: 24px;display:inline-grid;width:100%;gap:4px;grid-template-columns:min-content 1fr max-content}.base.size-condensed{--_text-field-gutter-start: calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))/2) ;--_text-field-gutter-end: calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))/2) ;--_text-field-icon-size: calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))/2) ;--_text-field-block-size: calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;--_text-field-border-radius: 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)}.label:not(slot),.label::slotted(label){box-sizing:initial!important;padding:initial!important;margin:initial!important;color:var(--vvd-color-canvas-text)!important;contain:inline-size!important;font:var(--vvd-typography-base);grid-column:1/4;grid-row:1}.char-count+.label:not(slot),.char-count+.label::slotted(label){grid-column:1/3}.char-count{color:var(--_low-ink-color);font:var(--vvd-typography-base);grid-column:3/4}.fieldset{position:relative;display:flex;align-items:center;background-color:var(--_appearance-color-fill);font:var(--vvd-typography-base);grid-column:1/4;padding-block:0;transition:color .2s,background-color .2s}.fieldset:after{position:absolute;display:block;border-radius:inherit;block-size:100%;box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);content:\"\";inline-size:100%;pointer-events:none;transition:box-shadow .2s}.fieldset:focus-visible{outline:none}.base>.fieldset{block-size:var(--_text-field-block-size)}.base:not(.shape-pill) .fieldset{border-radius:var(--_text-field-border-radius)}.base.shape-pill .fieldset{border-radius:var(--_text-field-pill-border-radius)}.wrapper{border-radius:inherit;block-size:100%;inline-size:100%}.control{border-radius:inherit;text-align:start}.control:not(slot),.control::slotted(input){width:100%!important;box-sizing:border-box!important;border:0 none!important;border-radius:inherit!important;margin:initial!important;appearance:none!important;background-color:transparent!important;block-size:100%!important;color:inherit!important;font:inherit;outline:transparent;padding-block:0!important;padding-inline:var(--_text-field-gutter-start) var(--_text-field-gutter-end)!important;text-align:inherit}.control:not(slot):disabled,.control::slotted(input:disabled){cursor:not-allowed!important;opacity:1!important;-webkit-text-fill-color:var(--_appearance-color-text)!important}.control:not(slot)::placeholder{opacity:1!important;-webkit-text-fill-color:var(--_low-ink-color)!important}.control::slotted(input:-webkit-autofill),.control:not(slot):-webkit-autofill{-webkit-box-shadow:0 0 0 1000px var(--_appearance-color-fill) inset;-webkit-text-fill-color:var(--_appearance-color-text)!important}.has-icon .control:not(slot),.has-icon .control::slotted(input){padding-inline-start:calc(var(--_text-field-icon-size) + var(--_text-field-gutter-start) * 2)!important}.icon{position:absolute;z-index:1;color:var(--_low-ink-color);font-size:var(--_text-field-icon-size);inset-block-start:50%;inset-inline-start:calc(100% + var(--_text-field-gutter-start));line-height:1;transform:translateY(-50%)}.leading-items-wrapper{position:relative}.base.no-leading .leading-items-wrapper{display:none}.action-items-wrapper{margin-inline-end:4px}.base:not(.action-items) .action-items-wrapper{display:none}@supports selector(:has(*)){.fieldset:has(.wrapper .control:focus-within):after{--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))}}@supports not selector(:has(*)){.wrapper:focus-within:after{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));--focus-stroke-gap-color: transparent;position:absolute;z-index:1;display:block;border-radius:inherit;content:\"\";inset:0;pointer-events:none}}:host([internal-part]) .fieldset{background-color:transparent;font:var(--vvd-typography-heading-4);line-height:1.1}:host([internal-part]) .fieldset:not(:focus-within):after{block-size:1px;inset-block-end:0}@supports selector(:has(*)){:host([internal-part]) .fieldset:has(.action-items-wrapper:focus-within):after{block-size:1px;inset-block-end:0}}:host([internal-part]) .control{text-align:center}slot[name=_mirrored-helper-text]{display:none}.base{--_text-field-gutter-end: 70px}.control::-webkit-outer-spin-button,.control::-webkit-inner-spin-button{appearance:none}.control-buttons{position:absolute;z-index:1;right:3px;display:flex}.readonly .control-buttons,.disabled .control-buttons{pointer-events:none}.control-buttons .divider{margin-block:8px}.control-buttons>*{flex-shrink:0}";
|
|
20
|
+
|
|
21
|
+
class _NumberField extends vividElement.VividElement {
|
|
22
|
+
}
|
|
23
|
+
class FormAssociatedNumberField extends formAssociated.FormAssociated(_NumberField) {
|
|
24
|
+
constructor() {
|
|
25
|
+
super(...arguments);
|
|
26
|
+
this.proxy = document.createElement("input");
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var __defProp = Object.defineProperty;
|
|
31
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
32
|
+
var __typeError = (msg) => {
|
|
33
|
+
throw TypeError(msg);
|
|
34
|
+
};
|
|
35
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
36
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
37
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
38
|
+
if (decorator = decorators[i])
|
|
39
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
40
|
+
if (kind && result) __defProp(target, key, result);
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
44
|
+
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);
|
|
45
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
46
|
+
var _NumberField_instances, valueToPresentationValue_fn, inputToPresentationValue_fn, presentationValueToValue_fn;
|
|
47
|
+
const STEP_DIRECTION = {
|
|
48
|
+
up: 1,
|
|
49
|
+
down: -1
|
|
50
|
+
};
|
|
51
|
+
function makeStep(element, direction) {
|
|
52
|
+
const value = parseFloat(element.value);
|
|
53
|
+
const stepUpValue = !isNaN(value) ? value + direction * element.step : element.min > 0 ? element.min : element.max < 0 ? element.max : !element.min ? direction * element.step : 0;
|
|
54
|
+
element.value = Number(stepUpValue.toFixed(12)).toString();
|
|
55
|
+
}
|
|
56
|
+
const buildNumberPatterns = (decimalSeparator) => {
|
|
57
|
+
const ds = decimalSeparator.source;
|
|
58
|
+
return {
|
|
59
|
+
invalidCharacters: new RegExp(`[^0-9\\-+e${ds}]`, "g"),
|
|
60
|
+
additionalDecimalSeparators: new RegExp(`(?<=${ds}.*)${ds}`, "g"),
|
|
61
|
+
trailingDecimalSeparator: new RegExp(`${ds}$`),
|
|
62
|
+
decimalSeparator
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
const numberPatternsWithPeriod = buildNumberPatterns(/\./);
|
|
66
|
+
const numberPatternsWithComma = buildNumberPatterns(/,/);
|
|
67
|
+
const validNumber = /^-?((\d*\.\d+)|(\d+))$/;
|
|
68
|
+
exports.NumberField = class NumberField extends delegatesAria.DelegatesAria(FormAssociatedNumberField) {
|
|
69
|
+
constructor() {
|
|
70
|
+
super(...arguments);
|
|
71
|
+
__privateAdd(this, _NumberField_instances);
|
|
72
|
+
this.readOnly = false;
|
|
73
|
+
this.autofocus = false;
|
|
74
|
+
// eslint-disable-next-line @nrwl/nx/workspace/no-attribute-default-value
|
|
75
|
+
this.step = 1;
|
|
76
|
+
/**
|
|
77
|
+
* Flag to indicate that the value change is from the user input
|
|
78
|
+
* @internal
|
|
79
|
+
*/
|
|
80
|
+
this.isUserInput = false;
|
|
81
|
+
this._presentationValue = "";
|
|
82
|
+
this.incrementButtonAriaLabel = null;
|
|
83
|
+
this.decrementButtonAriaLabel = null;
|
|
84
|
+
}
|
|
85
|
+
stepChanged(_, next) {
|
|
86
|
+
this.proxy.setAttribute(
|
|
87
|
+
"step",
|
|
88
|
+
Number.isFinite(next) ? next.toString() : ""
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Ensures that the max is greater than the min and that the value
|
|
93
|
+
* is less than the max
|
|
94
|
+
*
|
|
95
|
+
* @internal
|
|
96
|
+
*/
|
|
97
|
+
maxChanged(_, next) {
|
|
98
|
+
this.max = Math.max(next, this.min ?? next);
|
|
99
|
+
this.proxy.max = this.max.toString();
|
|
100
|
+
this.validate();
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Ensures that the min is less than the max and that the value
|
|
104
|
+
* is greater than the min
|
|
105
|
+
*
|
|
106
|
+
* @internal
|
|
107
|
+
*/
|
|
108
|
+
minChanged(_, next) {
|
|
109
|
+
this.min = Math.min(next, this.max ?? next);
|
|
110
|
+
this.proxy.min = this.min.toString();
|
|
111
|
+
this.validate();
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The value property, typed as a number.
|
|
115
|
+
*
|
|
116
|
+
* @public
|
|
117
|
+
*/
|
|
118
|
+
get valueAsNumber() {
|
|
119
|
+
return parseFloat(super.value);
|
|
120
|
+
}
|
|
121
|
+
set valueAsNumber(next) {
|
|
122
|
+
this.value = next.toString();
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* @internal
|
|
126
|
+
*/
|
|
127
|
+
valueChanged(previous, next) {
|
|
128
|
+
this.value = validNumber.test(next) ? next : "";
|
|
129
|
+
if (next !== this.value) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (this.control && !this.isUserInput) {
|
|
133
|
+
this._presentationValue = __privateMethod(this, _NumberField_instances, valueToPresentationValue_fn).call(this, this.value);
|
|
134
|
+
}
|
|
135
|
+
super.valueChanged(previous, this.value);
|
|
136
|
+
if (previous !== void 0 && !this.isUserInput) {
|
|
137
|
+
this.$emit("input");
|
|
138
|
+
this.$emit("change");
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* @internal
|
|
143
|
+
*/
|
|
144
|
+
get _numberPatterns() {
|
|
145
|
+
return this.locale.common.useCommaAsDecimalSeparator ? numberPatternsWithComma : numberPatternsWithPeriod;
|
|
146
|
+
}
|
|
147
|
+
/** {@inheritDoc (FormAssociated:interface).validate} */
|
|
148
|
+
validate() {
|
|
149
|
+
super.validate(this.control);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Increments the value using the step value
|
|
153
|
+
*
|
|
154
|
+
* @public
|
|
155
|
+
*/
|
|
156
|
+
stepUp() {
|
|
157
|
+
makeStep(this, STEP_DIRECTION.up);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Decrements the value using the step value
|
|
161
|
+
*
|
|
162
|
+
* @public
|
|
163
|
+
*/
|
|
164
|
+
stepDown() {
|
|
165
|
+
makeStep(this, STEP_DIRECTION.down);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Sets up the initial state of the number field
|
|
169
|
+
* @internal
|
|
170
|
+
*/
|
|
171
|
+
connectedCallback() {
|
|
172
|
+
super.connectedCallback();
|
|
173
|
+
this.proxy.setAttribute("type", "number");
|
|
174
|
+
this.validate();
|
|
175
|
+
this._presentationValue = __privateMethod(this, _NumberField_instances, valueToPresentationValue_fn).call(this, this.value);
|
|
176
|
+
if (this.autofocus) {
|
|
177
|
+
vividElement.DOM.queueUpdate(() => {
|
|
178
|
+
this.focus();
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Selects all the text in the number field
|
|
184
|
+
*
|
|
185
|
+
* @public
|
|
186
|
+
*/
|
|
187
|
+
select() {
|
|
188
|
+
this.control.select();
|
|
189
|
+
this.$emit("select");
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Handles the internal control's `input` event
|
|
193
|
+
* @internal
|
|
194
|
+
*/
|
|
195
|
+
handleTextInput() {
|
|
196
|
+
this._presentationValue = __privateMethod(this, _NumberField_instances, inputToPresentationValue_fn).call(this, this.control.value);
|
|
197
|
+
if (this.control.value !== this._presentationValue) {
|
|
198
|
+
this.control.value = this._presentationValue;
|
|
199
|
+
}
|
|
200
|
+
this.isUserInput = true;
|
|
201
|
+
this.value = __privateMethod(this, _NumberField_instances, presentationValueToValue_fn).call(this, this._presentationValue);
|
|
202
|
+
this.isUserInput = false;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Change event handler for inner control.
|
|
206
|
+
* @remarks
|
|
207
|
+
* "Change" events are not `composable` so they will not
|
|
208
|
+
* permeate the shadow DOM boundary. This fn effectively proxies
|
|
209
|
+
* the change event, emitting a `change` event whenever the internal
|
|
210
|
+
* control emits a `change` event
|
|
211
|
+
* @internal
|
|
212
|
+
*/
|
|
213
|
+
handleChange() {
|
|
214
|
+
this.$emit("change");
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Handles the internal control's `keydown` event
|
|
218
|
+
* @internal
|
|
219
|
+
*/
|
|
220
|
+
handleKeyDown(e) {
|
|
221
|
+
const key = e.key;
|
|
222
|
+
switch (key) {
|
|
223
|
+
case keyCodes.keyArrowUp:
|
|
224
|
+
this.stepUp();
|
|
225
|
+
return false;
|
|
226
|
+
case keyCodes.keyArrowDown:
|
|
227
|
+
this.stepDown();
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
return true;
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
_NumberField_instances = new WeakSet();
|
|
234
|
+
valueToPresentationValue_fn = function(value) {
|
|
235
|
+
return value.replace(
|
|
236
|
+
".",
|
|
237
|
+
this.locale.common.useCommaAsDecimalSeparator ? "," : "."
|
|
238
|
+
);
|
|
239
|
+
};
|
|
240
|
+
inputToPresentationValue_fn = function(input) {
|
|
241
|
+
return input.replace(this._numberPatterns.invalidCharacters, "").replace(this._numberPatterns.additionalDecimalSeparators, "");
|
|
242
|
+
};
|
|
243
|
+
presentationValueToValue_fn = function(presentationValue) {
|
|
244
|
+
const candidate = presentationValue.replace(this._numberPatterns.trailingDecimalSeparator, "").replace(this._numberPatterns.decimalSeparator, ".");
|
|
245
|
+
return validNumber.test(candidate) ? candidate : "";
|
|
246
|
+
};
|
|
247
|
+
__decorateClass([
|
|
248
|
+
vividElement.attr({ attribute: "readonly", mode: "boolean" })
|
|
249
|
+
], exports.NumberField.prototype, "readOnly", 2);
|
|
250
|
+
__decorateClass([
|
|
251
|
+
vividElement.attr({ mode: "boolean" })
|
|
252
|
+
], exports.NumberField.prototype, "autofocus", 2);
|
|
253
|
+
__decorateClass([
|
|
254
|
+
vividElement.attr
|
|
255
|
+
], exports.NumberField.prototype, "placeholder", 2);
|
|
256
|
+
__decorateClass([
|
|
257
|
+
vividElement.attr
|
|
258
|
+
], exports.NumberField.prototype, "list", 2);
|
|
259
|
+
__decorateClass([
|
|
260
|
+
vividElement.attr({ converter: vividElement.nullableNumberConverter })
|
|
261
|
+
], exports.NumberField.prototype, "maxlength", 2);
|
|
262
|
+
__decorateClass([
|
|
263
|
+
vividElement.attr({ converter: vividElement.nullableNumberConverter })
|
|
264
|
+
], exports.NumberField.prototype, "minlength", 2);
|
|
265
|
+
__decorateClass([
|
|
266
|
+
vividElement.attr({ converter: vividElement.nullableNumberConverter })
|
|
267
|
+
], exports.NumberField.prototype, "size", 2);
|
|
268
|
+
__decorateClass([
|
|
269
|
+
vividElement.attr()
|
|
270
|
+
], exports.NumberField.prototype, "scale", 2);
|
|
271
|
+
__decorateClass([
|
|
272
|
+
vividElement.attr({ converter: vividElement.nullableNumberConverter })
|
|
273
|
+
], exports.NumberField.prototype, "step", 2);
|
|
274
|
+
__decorateClass([
|
|
275
|
+
vividElement.attr({ converter: vividElement.nullableNumberConverter })
|
|
276
|
+
], exports.NumberField.prototype, "max", 2);
|
|
277
|
+
__decorateClass([
|
|
278
|
+
vividElement.attr({ converter: vividElement.nullableNumberConverter })
|
|
279
|
+
], exports.NumberField.prototype, "min", 2);
|
|
280
|
+
__decorateClass([
|
|
281
|
+
vividElement.observable
|
|
282
|
+
], exports.NumberField.prototype, "defaultSlottedNodes", 2);
|
|
283
|
+
__decorateClass([
|
|
284
|
+
vividElement.observable
|
|
285
|
+
], exports.NumberField.prototype, "_presentationValue", 2);
|
|
286
|
+
__decorateClass([
|
|
287
|
+
vividElement.attr({ attribute: "increment-button-aria-label" })
|
|
288
|
+
], exports.NumberField.prototype, "incrementButtonAriaLabel", 2);
|
|
289
|
+
__decorateClass([
|
|
290
|
+
vividElement.attr({ attribute: "decrement-button-aria-label" })
|
|
291
|
+
], exports.NumberField.prototype, "decrementButtonAriaLabel", 2);
|
|
292
|
+
__decorateClass([
|
|
293
|
+
vividElement.attr
|
|
294
|
+
], exports.NumberField.prototype, "appearance", 2);
|
|
295
|
+
__decorateClass([
|
|
296
|
+
vividElement.attr
|
|
297
|
+
], exports.NumberField.prototype, "shape", 2);
|
|
298
|
+
__decorateClass([
|
|
299
|
+
vividElement.attr
|
|
300
|
+
], exports.NumberField.prototype, "autoComplete", 2);
|
|
301
|
+
exports.NumberField = __decorateClass([
|
|
302
|
+
formElements.errorText,
|
|
303
|
+
formElements.formElements
|
|
304
|
+
], exports.NumberField);
|
|
305
|
+
applyMixinsWithObservables.applyMixinsWithObservables(
|
|
306
|
+
exports.NumberField,
|
|
307
|
+
localized.Localized,
|
|
308
|
+
affix.AffixIcon,
|
|
309
|
+
formElements.FormElementCharCount,
|
|
310
|
+
formElements.FormElementHelperText,
|
|
311
|
+
formElements.FormElementSuccessText
|
|
312
|
+
);
|
|
313
|
+
|
|
314
|
+
const getStateClasses = ({
|
|
315
|
+
errorValidationMessage,
|
|
316
|
+
disabled,
|
|
317
|
+
value,
|
|
318
|
+
readOnly,
|
|
319
|
+
placeholder,
|
|
320
|
+
appearance,
|
|
321
|
+
shape,
|
|
322
|
+
label,
|
|
323
|
+
successText,
|
|
324
|
+
scale
|
|
325
|
+
}) => classNames.classNames(
|
|
326
|
+
["error", Boolean(errorValidationMessage)],
|
|
327
|
+
["disabled", disabled],
|
|
328
|
+
["has-value", Boolean(value)],
|
|
329
|
+
["readonly", readOnly],
|
|
330
|
+
["placeholder", Boolean(placeholder)],
|
|
331
|
+
[`appearance-${appearance}`, Boolean(appearance)],
|
|
332
|
+
[`shape-${shape}`, Boolean(shape)],
|
|
333
|
+
["no-label", !label],
|
|
334
|
+
["success", !!successText],
|
|
335
|
+
[`size-${scale}`, Boolean(scale)]
|
|
17
336
|
);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
337
|
+
function renderLabel() {
|
|
338
|
+
return vividElement.html` <label for="control" class="label">
|
|
339
|
+
${(x) => x.label}
|
|
340
|
+
</label>`;
|
|
341
|
+
}
|
|
342
|
+
function setControlButtonShape(numberField) {
|
|
343
|
+
return numberField.shape === enums.Shape.Pill ? enums.Shape.Pill : null;
|
|
344
|
+
}
|
|
345
|
+
function getTabIndex(numberField) {
|
|
346
|
+
return numberField.disabled || numberField.readOnly ? "-1" : null;
|
|
347
|
+
}
|
|
348
|
+
function numberControlButtons(context) {
|
|
349
|
+
const buttonTag = context.tagFor(definition.Button);
|
|
350
|
+
const dividerTag = context.tagFor(definition$1.Divider);
|
|
21
351
|
return vividElement.html`
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
352
|
+
<div class="control-buttons"
|
|
353
|
+
?inert="${(x) => x.disabled || x.readOnly}">
|
|
354
|
+
<${buttonTag} id="subtract" icon="minus-line"
|
|
355
|
+
?disabled="${(x) => x.disabled || x.readOnly}"
|
|
356
|
+
aria-label=${(x) => x.decrementButtonAriaLabel || x.locale.numberField.decrementButtonLabel}
|
|
357
|
+
shape="${setControlButtonShape}"
|
|
358
|
+
type="button"
|
|
359
|
+
size="${(x) => x.scale === "condensed" ? "super-condensed" : "condensed"}"
|
|
360
|
+
tabindex="${getTabIndex}"
|
|
361
|
+
@click="${(x) => x.stepDown()}"></${buttonTag}>
|
|
362
|
+
<${dividerTag} class="divider" orientation="vertical"></${dividerTag}>
|
|
363
|
+
<${buttonTag} id="add" icon="plus-line"
|
|
364
|
+
?disabled="${(x) => x.disabled || x.readOnly}"
|
|
365
|
+
aria-label=${(x) => x.incrementButtonAriaLabel || x.locale.numberField.incrementButtonLabel}
|
|
366
|
+
shape="${setControlButtonShape}"
|
|
367
|
+
type="button"
|
|
368
|
+
size="${(x) => x.scale === "condensed" ? "super-condensed" : "condensed"}"
|
|
369
|
+
tabindex="${getTabIndex}"
|
|
370
|
+
@click="${(x) => x.stepUp()}"></${buttonTag}>
|
|
371
|
+
</div>
|
|
372
|
+
`;
|
|
373
|
+
}
|
|
374
|
+
const NumberFieldTemplate = (context) => {
|
|
375
|
+
return vividElement.html`
|
|
376
|
+
<div class="base ${getStateClasses}">
|
|
377
|
+
${when.when((x) => x.label, renderLabel())}
|
|
378
|
+
<div class="fieldset">
|
|
379
|
+
<div class="wrapper">
|
|
380
|
+
<input
|
|
381
|
+
class="control"
|
|
382
|
+
id="control"
|
|
383
|
+
@input="${(x) => x.handleTextInput()}"
|
|
384
|
+
@change="${(x) => x.handleChange()}"
|
|
385
|
+
@keydown="${(x, c) => x.handleKeyDown(c.event)}"
|
|
386
|
+
?autofocus="${(x) => x.autofocus}"
|
|
387
|
+
?disabled="${(x) => x.disabled}"
|
|
388
|
+
list="${(x) => x.list}"
|
|
389
|
+
maxlength="${(x) => x.maxlength}"
|
|
390
|
+
minlength="${(x) => x.minlength}"
|
|
391
|
+
placeholder="${(x) => x.placeholder}"
|
|
392
|
+
?readonly="${(x) => x.readOnly}"
|
|
393
|
+
?required="${(x) => x.required}"
|
|
394
|
+
size="${(x) => x.size}"
|
|
395
|
+
autocomplete="${(x) => x.autoComplete}"
|
|
396
|
+
name="${(x) => x.name}"
|
|
397
|
+
?spellcheck="${(x) => x.spellcheck}"
|
|
398
|
+
:value="${(x) => x._presentationValue}"
|
|
399
|
+
type="text"
|
|
400
|
+
aria-atomic="${(x) => x.ariaAtomic}"
|
|
401
|
+
aria-busy="${(x) => x.ariaBusy}"
|
|
402
|
+
aria-current="${(x) => x.ariaCurrent}"
|
|
403
|
+
aria-disabled="${(x) => x.ariaDisabled}"
|
|
404
|
+
aria-haspopup="${(x) => x.ariaHasPopup}"
|
|
405
|
+
aria-hidden="${(x) => x.ariaHidden}"
|
|
406
|
+
aria-invalid="${(x) => x.ariaInvalid}"
|
|
407
|
+
aria-keyshortcuts="${(x) => x.ariaKeyShortcuts}"
|
|
408
|
+
aria-label="${(x) => x.ariaLabel}"
|
|
409
|
+
aria-live="${(x) => x.ariaLive}"
|
|
410
|
+
aria-relevant="${(x) => x.ariaRelevant}"
|
|
411
|
+
aria-roledescription="${(x) => x.ariaRoleDescription}"
|
|
412
|
+
${ref.ref("control")}
|
|
413
|
+
/>
|
|
414
|
+
</div>
|
|
415
|
+
${() => numberControlButtons(context)}
|
|
50
416
|
</div>
|
|
51
|
-
|
|
417
|
+
${formElements.getFeedbackTemplate(context)}
|
|
418
|
+
</div>
|
|
52
419
|
`;
|
|
53
420
|
};
|
|
54
421
|
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
ListboxOptionTemplate,
|
|
61
|
-
[definition.iconDefinition],
|
|
422
|
+
const numberFieldDefinition = vividElement.defineVividComponent(
|
|
423
|
+
"number-field",
|
|
424
|
+
exports.NumberField,
|
|
425
|
+
NumberFieldTemplate,
|
|
426
|
+
[definition.buttonDefinition, definition$1.dividerDefinition, definition$2.iconDefinition],
|
|
62
427
|
{
|
|
63
|
-
styles
|
|
428
|
+
styles,
|
|
429
|
+
shadowOptions: {
|
|
430
|
+
delegatesFocus: true
|
|
431
|
+
}
|
|
64
432
|
}
|
|
65
433
|
);
|
|
66
|
-
const
|
|
434
|
+
const registerNumberField = vividElement.createRegisterFunction(
|
|
435
|
+
numberFieldDefinition
|
|
436
|
+
);
|
|
67
437
|
|
|
68
|
-
exports.
|
|
69
|
-
exports.
|
|
438
|
+
exports.numberFieldDefinition = numberFieldDefinition;
|
|
439
|
+
exports.registerNumberField = registerNumberField;
|