@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/definition34.js
CHANGED
|
@@ -1,439 +1,57 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { D as DelegatesARIATextbox } from './text-field.js';
|
|
6
|
-
import { a as applyMixinsWithObservables } from './applyMixinsWithObservables.js';
|
|
7
|
-
import { F as FormAssociated } from './form-associated.js';
|
|
8
|
-
import { f as keyArrowDown, e as keyArrowUp } from './key-codes.js';
|
|
9
|
-
import { F as FormElementSuccessText, a as FormElementHelperText, b as FormElementCharCount, e as errorText, f as formElements, g as getFeedbackTemplate } from './form-elements.js';
|
|
10
|
-
import { b as AffixIcon } from './affix.js';
|
|
11
|
-
import { L as Localized } from './localized.js';
|
|
12
|
-
import { S as Shape } from './enums.js';
|
|
1
|
+
import { i as iconDefinition } from './definition28.js';
|
|
2
|
+
import { V as VividElement, a as attr, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
|
|
3
|
+
import { a as applyMixins } from './apply-mixins.js';
|
|
4
|
+
import { b as AffixIcon, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
|
|
13
5
|
import { c as classNames } from './class-names.js';
|
|
14
6
|
import { w as when } from './when.js';
|
|
15
|
-
import { r as ref } from './ref.js';
|
|
16
7
|
|
|
17
|
-
const styles = "
|
|
18
|
-
|
|
19
|
-
class _NumberField extends VividElement {
|
|
20
|
-
}
|
|
21
|
-
class FormAssociatedNumberField extends FormAssociated(_NumberField) {
|
|
22
|
-
constructor() {
|
|
23
|
-
super(...arguments);
|
|
24
|
-
this.proxy = document.createElement("input");
|
|
25
|
-
}
|
|
26
|
-
}
|
|
8
|
+
const styles = ".base.connotation-success{--_connotation-color-intermediate: var(--vvd-note-success-intermediate, var(--vvd-color-success-500));--_connotation-color-faint: var(--vvd-note-success-faint, var(--vvd-color-success-50));--_connotation-color-fierce: var(--vvd-note-success-fierce, var(--vvd-color-success-700))}.base.connotation-information{--_connotation-color-intermediate: var(--vvd-note-information-intermediate, var(--vvd-color-information-500));--_connotation-color-faint: var(--vvd-note-information-faint, var(--vvd-color-information-50));--_connotation-color-fierce: var(--vvd-note-information-fierce, var(--vvd-color-information-700))}.base.connotation-alert{--_connotation-color-intermediate: var(--vvd-note-alert-intermediate, var(--vvd-color-alert-500));--_connotation-color-faint: var(--vvd-note-alert-faint, var(--vvd-color-alert-50));--_connotation-color-fierce: var(--vvd-note-alert-fierce, var(--vvd-color-alert-700))}.base.connotation-warning{--_connotation-color-intermediate: var(--vvd-note-warning-intermediate, var(--vvd-color-warning-300));--_connotation-color-faint: var(--vvd-note-warning-faint, var(--vvd-color-warning-50));--_connotation-color-fierce: var(--vvd-note-warning-fierce, var(--vvd-color-warning-700))}.base.connotation-announcement{--_connotation-color-intermediate: var(--vvd-note-announcement-intermediate, var(--vvd-color-announcement-500));--_connotation-color-faint: var(--vvd-note-announcement-faint, var(--vvd-color-announcement-50));--_connotation-color-fierce: var(--vvd-note-announcement-fierce, var(--vvd-color-announcement-700))}.base:not(.connotation-success,.connotation-information,.connotation-alert,.connotation-warning,.connotation-announcement){--_connotation-color-intermediate: var(--vvd-note-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-faint: var(--vvd-note-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-fierce: var(--vvd-note-accent-fierce, var(--vvd-color-neutral-700))}.base{--_appearance-color-text: var(--_connotation-color-fierce);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: var(--_connotation-color-intermediate)}.base{display:flex;align-items:flex-start;padding:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)));border-radius:8px;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--vvd-color-canvas-text);column-gap:16px}@supports (contain: content){.base{contain:content}}@supports not (contain: content){.base{overflow:hidden}}slot[name=icon]{color:var(--_appearance-color-outline);font-size:calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.text{display:flex;min-height:24px;flex-direction:column;flex-grow:1;align-items:flex-start;justify-content:center;gap:4px;text-align:start}.text .headline{font:var(--vvd-typography-base-bold)}.text .message{font:var(--vvd-typography-base)}";
|
|
27
9
|
|
|
28
10
|
var __defProp = Object.defineProperty;
|
|
29
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
30
|
-
var __typeError = (msg) => {
|
|
31
|
-
throw TypeError(msg);
|
|
32
|
-
};
|
|
33
11
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
34
|
-
var result =
|
|
12
|
+
var result = void 0 ;
|
|
35
13
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
36
14
|
if (decorator = decorators[i])
|
|
37
|
-
result = (
|
|
38
|
-
if (
|
|
15
|
+
result = (decorator(target, key, result) ) || result;
|
|
16
|
+
if (result) __defProp(target, key, result);
|
|
39
17
|
return result;
|
|
40
18
|
};
|
|
41
|
-
|
|
42
|
-
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);
|
|
43
|
-
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
44
|
-
var _NumberField_instances, valueToPresentationValue_fn, inputToPresentationValue_fn, presentationValueToValue_fn;
|
|
45
|
-
const STEP_DIRECTION = {
|
|
46
|
-
up: 1,
|
|
47
|
-
down: -1
|
|
48
|
-
};
|
|
49
|
-
function makeStep(element, direction) {
|
|
50
|
-
const value = parseFloat(element.value);
|
|
51
|
-
const stepUpValue = !isNaN(value) ? value + direction * element.step : element.min > 0 ? element.min : element.max < 0 ? element.max : !element.min ? direction * element.step : 0;
|
|
52
|
-
element.value = Number(stepUpValue.toFixed(12)).toString();
|
|
19
|
+
class Note extends VividElement {
|
|
53
20
|
}
|
|
54
|
-
const buildNumberPatterns = (decimalSeparator) => {
|
|
55
|
-
const ds = decimalSeparator.source;
|
|
56
|
-
return {
|
|
57
|
-
invalidCharacters: new RegExp(`[^0-9\\-+e${ds}]`, "g"),
|
|
58
|
-
additionalDecimalSeparators: new RegExp(`(?<=${ds}.*)${ds}`, "g"),
|
|
59
|
-
trailingDecimalSeparator: new RegExp(`${ds}$`),
|
|
60
|
-
decimalSeparator
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
const numberPatternsWithPeriod = buildNumberPatterns(/\./);
|
|
64
|
-
const numberPatternsWithComma = buildNumberPatterns(/,/);
|
|
65
|
-
const validNumber = /^-?((\d*\.\d+)|(\d+))$/;
|
|
66
|
-
let NumberField = class extends FormAssociatedNumberField {
|
|
67
|
-
constructor() {
|
|
68
|
-
super(...arguments);
|
|
69
|
-
__privateAdd(this, _NumberField_instances);
|
|
70
|
-
this.readOnly = false;
|
|
71
|
-
this.autofocus = false;
|
|
72
|
-
// eslint-disable-next-line @nrwl/nx/workspace/no-attribute-default-value
|
|
73
|
-
this.step = 1;
|
|
74
|
-
/**
|
|
75
|
-
* Flag to indicate that the value change is from the user input
|
|
76
|
-
* @internal
|
|
77
|
-
*/
|
|
78
|
-
this.isUserInput = false;
|
|
79
|
-
this._presentationValue = "";
|
|
80
|
-
this.incrementButtonAriaLabel = null;
|
|
81
|
-
this.decrementButtonAriaLabel = null;
|
|
82
|
-
}
|
|
83
|
-
stepChanged(_, next) {
|
|
84
|
-
this.proxy.setAttribute(
|
|
85
|
-
"step",
|
|
86
|
-
Number.isFinite(next) ? next.toString() : ""
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Ensures that the max is greater than the min and that the value
|
|
91
|
-
* is less than the max
|
|
92
|
-
*
|
|
93
|
-
* @internal
|
|
94
|
-
*/
|
|
95
|
-
maxChanged(_, next) {
|
|
96
|
-
this.max = Math.max(next, this.min ?? next);
|
|
97
|
-
this.proxy.max = this.max.toString();
|
|
98
|
-
this.validate();
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Ensures that the min is less than the max and that the value
|
|
102
|
-
* is greater than the min
|
|
103
|
-
*
|
|
104
|
-
* @internal
|
|
105
|
-
*/
|
|
106
|
-
minChanged(_, next) {
|
|
107
|
-
this.min = Math.min(next, this.max ?? next);
|
|
108
|
-
this.proxy.min = this.min.toString();
|
|
109
|
-
this.validate();
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* The value property, typed as a number.
|
|
113
|
-
*
|
|
114
|
-
* @public
|
|
115
|
-
*/
|
|
116
|
-
get valueAsNumber() {
|
|
117
|
-
return parseFloat(super.value);
|
|
118
|
-
}
|
|
119
|
-
set valueAsNumber(next) {
|
|
120
|
-
this.value = next.toString();
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* @internal
|
|
124
|
-
*/
|
|
125
|
-
valueChanged(previous, next) {
|
|
126
|
-
this.value = validNumber.test(next) ? next : "";
|
|
127
|
-
if (next !== this.value) {
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
if (this.control && !this.isUserInput) {
|
|
131
|
-
this._presentationValue = __privateMethod(this, _NumberField_instances, valueToPresentationValue_fn).call(this, this.value);
|
|
132
|
-
}
|
|
133
|
-
super.valueChanged(previous, this.value);
|
|
134
|
-
if (previous !== void 0 && !this.isUserInput) {
|
|
135
|
-
this.$emit("input");
|
|
136
|
-
this.$emit("change");
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* @internal
|
|
141
|
-
*/
|
|
142
|
-
get _numberPatterns() {
|
|
143
|
-
return this.locale.common.useCommaAsDecimalSeparator ? numberPatternsWithComma : numberPatternsWithPeriod;
|
|
144
|
-
}
|
|
145
|
-
/** {@inheritDoc (FormAssociated:interface).validate} */
|
|
146
|
-
validate() {
|
|
147
|
-
super.validate(this.control);
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Increments the value using the step value
|
|
151
|
-
*
|
|
152
|
-
* @public
|
|
153
|
-
*/
|
|
154
|
-
stepUp() {
|
|
155
|
-
makeStep(this, STEP_DIRECTION.up);
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Decrements the value using the step value
|
|
159
|
-
*
|
|
160
|
-
* @public
|
|
161
|
-
*/
|
|
162
|
-
stepDown() {
|
|
163
|
-
makeStep(this, STEP_DIRECTION.down);
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Sets up the initial state of the number field
|
|
167
|
-
* @internal
|
|
168
|
-
*/
|
|
169
|
-
connectedCallback() {
|
|
170
|
-
super.connectedCallback();
|
|
171
|
-
this.proxy.setAttribute("type", "number");
|
|
172
|
-
this.validate();
|
|
173
|
-
this._presentationValue = __privateMethod(this, _NumberField_instances, valueToPresentationValue_fn).call(this, this.value);
|
|
174
|
-
if (this.autofocus) {
|
|
175
|
-
DOM.queueUpdate(() => {
|
|
176
|
-
this.focus();
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Selects all the text in the number field
|
|
182
|
-
*
|
|
183
|
-
* @public
|
|
184
|
-
*/
|
|
185
|
-
select() {
|
|
186
|
-
this.control.select();
|
|
187
|
-
this.$emit("select");
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Handles the internal control's `input` event
|
|
191
|
-
* @internal
|
|
192
|
-
*/
|
|
193
|
-
handleTextInput() {
|
|
194
|
-
this._presentationValue = __privateMethod(this, _NumberField_instances, inputToPresentationValue_fn).call(this, this.control.value);
|
|
195
|
-
if (this.control.value !== this._presentationValue) {
|
|
196
|
-
this.control.value = this._presentationValue;
|
|
197
|
-
}
|
|
198
|
-
this.isUserInput = true;
|
|
199
|
-
this.value = __privateMethod(this, _NumberField_instances, presentationValueToValue_fn).call(this, this._presentationValue);
|
|
200
|
-
this.isUserInput = false;
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Change event handler for inner control.
|
|
204
|
-
* @remarks
|
|
205
|
-
* "Change" events are not `composable` so they will not
|
|
206
|
-
* permeate the shadow DOM boundary. This fn effectively proxies
|
|
207
|
-
* the change event, emitting a `change` event whenever the internal
|
|
208
|
-
* control emits a `change` event
|
|
209
|
-
* @internal
|
|
210
|
-
*/
|
|
211
|
-
handleChange() {
|
|
212
|
-
this.$emit("change");
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* Handles the internal control's `keydown` event
|
|
216
|
-
* @internal
|
|
217
|
-
*/
|
|
218
|
-
handleKeyDown(e) {
|
|
219
|
-
const key = e.key;
|
|
220
|
-
switch (key) {
|
|
221
|
-
case keyArrowUp:
|
|
222
|
-
this.stepUp();
|
|
223
|
-
return false;
|
|
224
|
-
case keyArrowDown:
|
|
225
|
-
this.stepDown();
|
|
226
|
-
return false;
|
|
227
|
-
}
|
|
228
|
-
return true;
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
_NumberField_instances = new WeakSet();
|
|
232
|
-
valueToPresentationValue_fn = function(value) {
|
|
233
|
-
return value.replace(
|
|
234
|
-
".",
|
|
235
|
-
this.locale.common.useCommaAsDecimalSeparator ? "," : "."
|
|
236
|
-
);
|
|
237
|
-
};
|
|
238
|
-
inputToPresentationValue_fn = function(input) {
|
|
239
|
-
return input.replace(this._numberPatterns.invalidCharacters, "").replace(this._numberPatterns.additionalDecimalSeparators, "");
|
|
240
|
-
};
|
|
241
|
-
presentationValueToValue_fn = function(presentationValue) {
|
|
242
|
-
const candidate = presentationValue.replace(this._numberPatterns.trailingDecimalSeparator, "").replace(this._numberPatterns.decimalSeparator, ".");
|
|
243
|
-
return validNumber.test(candidate) ? candidate : "";
|
|
244
|
-
};
|
|
245
|
-
__decorateClass([
|
|
246
|
-
attr({ attribute: "readonly", mode: "boolean" })
|
|
247
|
-
], NumberField.prototype, "readOnly", 2);
|
|
248
|
-
__decorateClass([
|
|
249
|
-
attr({ mode: "boolean" })
|
|
250
|
-
], NumberField.prototype, "autofocus", 2);
|
|
251
21
|
__decorateClass([
|
|
252
22
|
attr
|
|
253
|
-
],
|
|
23
|
+
], Note.prototype, "headline");
|
|
254
24
|
__decorateClass([
|
|
255
25
|
attr
|
|
256
|
-
],
|
|
257
|
-
|
|
258
|
-
attr({ converter: nullableNumberConverter })
|
|
259
|
-
], NumberField.prototype, "maxlength", 2);
|
|
260
|
-
__decorateClass([
|
|
261
|
-
attr({ converter: nullableNumberConverter })
|
|
262
|
-
], NumberField.prototype, "minlength", 2);
|
|
263
|
-
__decorateClass([
|
|
264
|
-
attr({ converter: nullableNumberConverter })
|
|
265
|
-
], NumberField.prototype, "size", 2);
|
|
266
|
-
__decorateClass([
|
|
267
|
-
attr()
|
|
268
|
-
], NumberField.prototype, "scale", 2);
|
|
269
|
-
__decorateClass([
|
|
270
|
-
attr({ converter: nullableNumberConverter })
|
|
271
|
-
], NumberField.prototype, "step", 2);
|
|
272
|
-
__decorateClass([
|
|
273
|
-
attr({ converter: nullableNumberConverter })
|
|
274
|
-
], NumberField.prototype, "max", 2);
|
|
275
|
-
__decorateClass([
|
|
276
|
-
attr({ converter: nullableNumberConverter })
|
|
277
|
-
], NumberField.prototype, "min", 2);
|
|
278
|
-
__decorateClass([
|
|
279
|
-
observable
|
|
280
|
-
], NumberField.prototype, "defaultSlottedNodes", 2);
|
|
281
|
-
__decorateClass([
|
|
282
|
-
observable
|
|
283
|
-
], NumberField.prototype, "_presentationValue", 2);
|
|
284
|
-
__decorateClass([
|
|
285
|
-
attr({ attribute: "increment-button-aria-label" })
|
|
286
|
-
], NumberField.prototype, "incrementButtonAriaLabel", 2);
|
|
287
|
-
__decorateClass([
|
|
288
|
-
attr({ attribute: "decrement-button-aria-label" })
|
|
289
|
-
], NumberField.prototype, "decrementButtonAriaLabel", 2);
|
|
290
|
-
__decorateClass([
|
|
291
|
-
attr
|
|
292
|
-
], NumberField.prototype, "appearance", 2);
|
|
293
|
-
__decorateClass([
|
|
294
|
-
attr
|
|
295
|
-
], NumberField.prototype, "shape", 2);
|
|
296
|
-
__decorateClass([
|
|
297
|
-
attr
|
|
298
|
-
], NumberField.prototype, "autoComplete", 2);
|
|
299
|
-
NumberField = __decorateClass([
|
|
300
|
-
errorText,
|
|
301
|
-
formElements
|
|
302
|
-
], NumberField);
|
|
303
|
-
applyMixinsWithObservables(
|
|
304
|
-
NumberField,
|
|
305
|
-
Localized,
|
|
306
|
-
AffixIcon,
|
|
307
|
-
FormElementCharCount,
|
|
308
|
-
FormElementHelperText,
|
|
309
|
-
FormElementSuccessText,
|
|
310
|
-
DelegatesARIATextbox
|
|
311
|
-
);
|
|
26
|
+
], Note.prototype, "connotation");
|
|
27
|
+
applyMixins(Note, AffixIcon);
|
|
312
28
|
|
|
313
|
-
const
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
value,
|
|
317
|
-
readOnly,
|
|
318
|
-
placeholder,
|
|
319
|
-
appearance,
|
|
320
|
-
shape,
|
|
321
|
-
label,
|
|
322
|
-
successText,
|
|
323
|
-
scale
|
|
324
|
-
}) => classNames(
|
|
325
|
-
["error", Boolean(errorValidationMessage)],
|
|
326
|
-
["disabled", disabled],
|
|
327
|
-
["has-value", Boolean(value)],
|
|
328
|
-
["readonly", readOnly],
|
|
329
|
-
["placeholder", Boolean(placeholder)],
|
|
330
|
-
[`appearance-${appearance}`, Boolean(appearance)],
|
|
331
|
-
[`shape-${shape}`, Boolean(shape)],
|
|
332
|
-
["no-label", !label],
|
|
333
|
-
["success", !!successText],
|
|
334
|
-
[`size-${scale}`, Boolean(scale)]
|
|
335
|
-
);
|
|
336
|
-
function renderLabel() {
|
|
337
|
-
return html` <label for="control" class="label">
|
|
338
|
-
${(x) => x.label}
|
|
339
|
-
</label>`;
|
|
29
|
+
const getClasses = ({ connotation }) => classNames("base", `connotation-${connotation}`);
|
|
30
|
+
function getHeaderTemplate() {
|
|
31
|
+
return html`<div class="headline">${(x) => x.headline}</div>`;
|
|
340
32
|
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
}
|
|
344
|
-
function getTabIndex(numberField) {
|
|
345
|
-
return numberField.disabled || numberField.readOnly ? "-1" : null;
|
|
346
|
-
}
|
|
347
|
-
function numberControlButtons(context) {
|
|
348
|
-
const buttonTag = context.tagFor(Button);
|
|
349
|
-
const dividerTag = context.tagFor(Divider);
|
|
350
|
-
return html`
|
|
351
|
-
<div class="control-buttons"
|
|
352
|
-
?inert="${(x) => x.disabled || x.readOnly}">
|
|
353
|
-
<${buttonTag} id="subtract" icon="minus-line"
|
|
354
|
-
?disabled="${(x) => x.disabled || x.readOnly}"
|
|
355
|
-
aria-label=${(x) => x.decrementButtonAriaLabel || x.locale.numberField.decrementButtonLabel}
|
|
356
|
-
shape="${setControlButtonShape}"
|
|
357
|
-
type="button"
|
|
358
|
-
size="${(x) => x.scale === "condensed" ? "super-condensed" : "condensed"}"
|
|
359
|
-
tabindex="${getTabIndex}"
|
|
360
|
-
@click="${(x) => x.stepDown()}"></${buttonTag}>
|
|
361
|
-
<${dividerTag} class="divider" orientation="vertical"></${dividerTag}>
|
|
362
|
-
<${buttonTag} id="add" icon="plus-line"
|
|
363
|
-
?disabled="${(x) => x.disabled || x.readOnly}"
|
|
364
|
-
aria-label=${(x) => x.incrementButtonAriaLabel || x.locale.numberField.incrementButtonLabel}
|
|
365
|
-
shape="${setControlButtonShape}"
|
|
366
|
-
type="button"
|
|
367
|
-
size="${(x) => x.scale === "condensed" ? "super-condensed" : "condensed"}"
|
|
368
|
-
tabindex="${getTabIndex}"
|
|
369
|
-
@click="${(x) => x.stepUp()}"></${buttonTag}>
|
|
370
|
-
</div>
|
|
371
|
-
`;
|
|
372
|
-
}
|
|
373
|
-
const NumberFieldTemplate = (context) => {
|
|
33
|
+
const NoteTemplate = (context) => {
|
|
34
|
+
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
374
35
|
return html`
|
|
375
|
-
<div class="
|
|
376
|
-
${
|
|
377
|
-
<div class="
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
class="control"
|
|
381
|
-
id="control"
|
|
382
|
-
@input="${(x) => x.handleTextInput()}"
|
|
383
|
-
@change="${(x) => x.handleChange()}"
|
|
384
|
-
@keydown="${(x, c) => x.handleKeyDown(c.event)}"
|
|
385
|
-
?autofocus="${(x) => x.autofocus}"
|
|
386
|
-
?disabled="${(x) => x.disabled}"
|
|
387
|
-
list="${(x) => x.list}"
|
|
388
|
-
maxlength="${(x) => x.maxlength}"
|
|
389
|
-
minlength="${(x) => x.minlength}"
|
|
390
|
-
placeholder="${(x) => x.placeholder}"
|
|
391
|
-
?readonly="${(x) => x.readOnly}"
|
|
392
|
-
?required="${(x) => x.required}"
|
|
393
|
-
size="${(x) => x.size}"
|
|
394
|
-
autocomplete="${(x) => x.autoComplete}"
|
|
395
|
-
name="${(x) => x.name}"
|
|
396
|
-
?spellcheck="${(x) => x.spellcheck}"
|
|
397
|
-
:value="${(x) => x._presentationValue}"
|
|
398
|
-
type="text"
|
|
399
|
-
aria-atomic="${(x) => x.ariaAtomic}"
|
|
400
|
-
aria-busy="${(x) => x.ariaBusy}"
|
|
401
|
-
aria-current="${(x) => x.ariaCurrent}"
|
|
402
|
-
aria-details="${(x) => x.ariaDetails}"
|
|
403
|
-
aria-disabled="${(x) => x.ariaDisabled}"
|
|
404
|
-
aria-errormessage="${(x) => x.ariaErrormessage}"
|
|
405
|
-
aria-haspopup="${(x) => x.ariaHaspopup}"
|
|
406
|
-
aria-hidden="${(x) => x.ariaHidden}"
|
|
407
|
-
aria-invalid="${(x) => x.ariaInvalid}"
|
|
408
|
-
aria-keyshortcuts="${(x) => x.ariaKeyshortcuts}"
|
|
409
|
-
aria-label="${(x) => x.ariaLabel}"
|
|
410
|
-
aria-live="${(x) => x.ariaLive}"
|
|
411
|
-
aria-relevant="${(x) => x.ariaRelevant}"
|
|
412
|
-
aria-roledescription="${(x) => x.ariaRoledescription}"
|
|
413
|
-
${ref("control")}
|
|
414
|
-
/>
|
|
415
|
-
</div>
|
|
416
|
-
${() => numberControlButtons(context)}
|
|
36
|
+
<div class="${getClasses}">
|
|
37
|
+
${(x) => affixIconTemplate(x.icon, IconWrapper.Slot)}
|
|
38
|
+
<div class="text">
|
|
39
|
+
${when((x) => x.headline, getHeaderTemplate())}
|
|
40
|
+
<slot class="message"></slot>
|
|
417
41
|
</div>
|
|
418
|
-
${getFeedbackTemplate(context)}
|
|
419
42
|
</div>
|
|
420
43
|
`;
|
|
421
44
|
};
|
|
422
45
|
|
|
423
|
-
const
|
|
424
|
-
"
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
[
|
|
46
|
+
const noteDefinition = defineVividComponent(
|
|
47
|
+
"note",
|
|
48
|
+
Note,
|
|
49
|
+
NoteTemplate,
|
|
50
|
+
[iconDefinition],
|
|
428
51
|
{
|
|
429
|
-
styles
|
|
430
|
-
shadowOptions: {
|
|
431
|
-
delegatesFocus: true
|
|
432
|
-
}
|
|
52
|
+
styles
|
|
433
53
|
}
|
|
434
54
|
);
|
|
435
|
-
const
|
|
436
|
-
numberFieldDefinition
|
|
437
|
-
);
|
|
55
|
+
const registerNote = createRegisterFunction(noteDefinition);
|
|
438
56
|
|
|
439
|
-
export {
|
|
57
|
+
export { Note as N, noteDefinition as n, registerNote as r };
|