@vonage/vivid 5.2.0 → 5.4.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/accordion-item/definition.cjs +2 -1
- package/accordion-item/definition.js +3 -2
- package/alert/definition.cjs +1 -1
- package/alert/definition.js +2 -2
- package/alert/index.cjs +1 -1
- package/alert/index.js +1 -1
- package/audio-player/definition.cjs +4 -2
- package/audio-player/definition.js +4 -2
- package/audio-player/index.cjs +5 -3
- package/audio-player/index.js +5 -3
- package/badge/definition.js +1 -1
- package/badge/index.cjs +2 -2
- package/badge/index.js +4 -4
- package/banner/definition.js +1 -1
- package/banner/index.cjs +3 -3
- package/banner/index.js +6 -6
- package/breadcrumb-item/index.cjs +1 -1
- package/breadcrumb-item/index.js +1 -1
- package/bundled/affix.cjs +7 -7
- package/bundled/affix.js +5 -5
- package/bundled/anchored.cjs +1 -1
- package/bundled/anchored.js +6 -6
- package/bundled/attribute-binding-behaviour.cjs +1 -1
- package/bundled/attribute-binding-behaviour.js +15 -13
- package/bundled/base-color-picker.cjs +13 -0
- package/bundled/base-color-picker.js +194 -0
- package/bundled/button.cjs +1 -1
- package/bundled/button.js +2 -2
- package/bundled/calendar-picker.template.cjs +7 -7
- package/bundled/calendar-picker.template.js +118 -118
- package/bundled/char-count.cjs +1 -1
- package/bundled/char-count.js +1 -1
- package/bundled/children.cjs +1 -1
- package/bundled/children.js +28 -20
- package/bundled/definition.cjs +3 -3
- package/bundled/definition.js +38 -38
- package/bundled/definition10.cjs +72 -18
- package/bundled/definition10.js +351 -65
- package/bundled/definition11.cjs +19 -10
- package/bundled/definition11.js +217 -36
- package/bundled/definition12.cjs +10 -1
- package/bundled/definition12.js +38 -14
- package/bundled/definition13.cjs +1 -73
- package/bundled/definition13.js +15 -354
- package/bundled/definition15.cjs +1 -1
- package/bundled/definition15.js +1 -1
- package/bundled/definition16.cjs +2 -2
- package/bundled/definition16.js +8 -8
- package/bundled/definition17.cjs +7 -7
- package/bundled/definition17.js +17 -17
- package/bundled/definition19.cjs +23 -24
- package/bundled/definition19.js +151 -163
- package/bundled/definition2.cjs +9 -5
- package/bundled/definition2.js +21 -17
- package/bundled/definition22.cjs +9 -9
- package/bundled/definition22.js +31 -31
- package/bundled/definition3.cjs +1 -1
- package/bundled/definition3.js +1 -1
- package/bundled/definition6.cjs +3 -3
- package/bundled/definition6.js +28 -28
- package/bundled/definition7.cjs +1 -1
- package/bundled/definition7.js +6 -6
- package/bundled/definition8.cjs +2 -2
- package/bundled/definition8.js +4 -4
- package/bundled/definition9.cjs +5 -5
- package/bundled/definition9.js +394 -392
- package/bundled/delegates-aria.cjs +1 -1
- package/bundled/delegates-aria.js +59 -46
- package/bundled/form-associated.cjs +1 -1
- package/bundled/form-associated.js +3 -3
- package/bundled/host-semantics.cjs +1 -1
- package/bundled/host-semantics.js +48 -34
- package/bundled/listbox.cjs +1 -1
- package/bundled/listbox.js +82 -102
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +51 -36
- package/bundled/mixins.cjs +18 -18
- package/bundled/mixins.js +99 -93
- package/bundled/normalize.cjs +1 -0
- package/bundled/normalize.js +7 -0
- package/bundled/picker-field.template.cjs +1 -1
- package/bundled/picker-field.template.js +4 -4
- package/bundled/ref.cjs +1 -1
- package/bundled/ref.js +8 -25
- package/bundled/repeat.cjs +1 -1
- package/bundled/repeat.js +459 -233
- package/bundled/slider.template.cjs +1 -1
- package/bundled/slider.template.js +2 -2
- package/bundled/slotted.cjs +1 -1
- package/bundled/slotted.js +62 -45
- package/bundled/time-selection-picker.template.cjs +1 -1
- package/bundled/time-selection-picker.template.js +5 -5
- package/bundled/vivid-element.cjs +5 -1
- package/bundled/vivid-element.js +2159 -1162
- package/bundled/when.cjs +1 -1
- package/bundled/when.js +8 -7
- package/calendar/definition.cjs +1 -1
- package/calendar/definition.js +2 -2
- package/calendar/index.cjs +1 -1
- package/calendar/index.js +15 -15
- package/calendar-event/index.cjs +1 -1
- package/calendar-event/index.js +1 -1
- package/card/definition.cjs +11 -3
- package/card/definition.js +11 -3
- package/card/index.cjs +19 -11
- package/card/index.js +35 -27
- package/color-picker/definition.cjs +1079 -0
- package/color-picker/definition.js +1073 -0
- package/color-picker/index.cjs +127 -0
- package/color-picker/index.js +726 -0
- package/combobox/definition.cjs +8 -28
- package/combobox/definition.js +10 -30
- package/combobox/index.cjs +7 -7
- package/combobox/index.js +60 -74
- package/contextual-help/index.cjs +1 -1
- package/contextual-help/index.js +1 -1
- package/custom-elements.json +1670 -163
- package/data-grid/definition.cjs +862 -27
- package/data-grid/definition.js +863 -28
- package/data-grid/index.cjs +25 -25
- package/data-grid/index.js +175 -168
- package/date-picker/definition.cjs +1 -1
- package/date-picker/definition.js +1 -1
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +2 -2
- package/date-range-picker/definition.cjs +1 -1
- package/date-range-picker/definition.js +1 -1
- package/date-range-picker/index.cjs +1 -1
- package/date-range-picker/index.js +2 -2
- package/date-time-picker/definition.cjs +1 -1
- package/date-time-picker/definition.js +1 -1
- package/date-time-picker/index.cjs +1 -1
- package/date-time-picker/index.js +2 -2
- package/dial-pad/definition.cjs +4 -0
- package/dial-pad/definition.js +4 -0
- package/dial-pad/index.cjs +3 -3
- package/dial-pad/index.js +42 -39
- package/dialog/definition.cjs +6 -3
- package/dialog/definition.js +6 -3
- package/dialog/index.cjs +22 -19
- package/dialog/index.js +48 -45
- package/elevation/definition.cjs +1 -1
- package/elevation/definition.js +1 -1
- package/empty-state/definition.cjs +7 -2
- package/empty-state/definition.js +7 -2
- package/empty-state/index.cjs +10 -5
- package/empty-state/index.js +18 -13
- package/fab/definition.js +1 -1
- package/fab/index.cjs +2 -2
- package/fab/index.js +4 -4
- package/file-picker/definition.cjs +2 -2
- package/file-picker/definition.js +3 -3
- package/file-picker/index.cjs +1 -1
- package/file-picker/index.js +4 -4
- package/header/definition.cjs +1 -1
- package/header/definition.js +1 -1
- package/icon/definition.cjs +10 -6
- package/icon/definition.js +10 -6
- package/index.cjs +7 -4
- package/index.js +3 -3
- package/lib/accordion/accordion.d.ts +1 -1
- package/lib/accordion/definition.d.ts +1 -1
- package/lib/accordion-item/accordion-item.d.ts +2 -2
- package/lib/action-group/action-group.d.ts +2 -2
- package/lib/alert/alert.d.ts +4 -4
- package/lib/audio-player/audio-player.d.ts +3 -3
- package/lib/avatar/avatar.d.ts +2 -2
- package/lib/badge/badge.d.ts +2 -2
- package/lib/banner/banner.d.ts +6 -6
- package/lib/breadcrumb/breadcrumb.d.ts +2 -2
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +2 -2
- package/lib/button/button.d.ts +6 -6
- package/lib/button/button.template.d.ts +2 -1
- package/lib/calendar/calendar.d.ts +1 -1
- package/lib/calendar-event/calendar-event.d.ts +2 -2
- package/lib/card/card.d.ts +2 -2
- package/lib/checkbox/checkbox.d.ts +12 -12
- package/lib/color-picker/color-picker.d.ts +2420 -0
- package/lib/color-picker/color-picker.template.d.ts +3 -0
- package/lib/color-picker/definition.d.ts +4 -0
- package/lib/color-picker/locale.d.ts +9 -0
- package/lib/combobox/combobox.d.ts +15 -14
- package/lib/combobox/combobox.options.d.ts +1 -1
- package/lib/components.d.ts +1 -0
- package/lib/data-grid/data-grid-cell.d.ts +4 -4
- package/lib/data-grid/data-grid-row.d.ts +3 -4
- package/lib/data-grid/data-grid.d.ts +1 -2
- package/lib/date-picker/date-picker.d.ts +54 -54
- package/lib/date-range-picker/date-range-picker.d.ts +28 -28
- package/lib/date-time-picker/date-time-picker.d.ts +56 -56
- package/lib/dial-pad/dial-pad.d.ts +3 -2
- package/lib/dialog/dialog.d.ts +4 -4
- package/lib/divider/divider.d.ts +3 -3
- package/lib/fab/fab.d.ts +2 -2
- package/lib/file-picker/file-picker.d.ts +14 -14
- package/lib/header/header.d.ts +2 -2
- package/lib/menu/menu.d.ts +4 -4
- package/lib/menu-item/menu-item-role.d.ts +1 -1
- package/lib/menu-item/menu-item.d.ts +4 -4
- package/lib/nav/nav.d.ts +2 -2
- package/lib/nav-disclosure/nav-disclosure.d.ts +4 -4
- package/lib/nav-item/nav-item.d.ts +4 -4
- package/lib/note/note.d.ts +2 -2
- package/lib/number-field/number-field.d.ts +18 -18
- package/lib/option/option.d.ts +4 -4
- package/lib/pagination/pagination.d.ts +2 -2
- package/lib/popup/popup.d.ts +1 -1
- package/lib/progress/progress.d.ts +2 -2
- package/lib/progress-ring/progress-ring.d.ts +2 -2
- package/lib/radio/radio.d.ts +6 -6
- package/lib/radio-group/radio-group.d.ts +2 -2
- package/lib/range-slider/range-slider.d.ts +6 -6
- package/lib/rich-text-editor/menubar/menubar.d.ts +2 -2
- package/lib/rich-text-editor/rich-text-editor.d.ts +2 -2
- package/lib/searchable-select/locale.d.ts +4 -0
- package/lib/searchable-select/option-tag.d.ts +2 -2
- package/lib/searchable-select/searchable-select.d.ts +21 -18
- package/lib/select/select.d.ts +19 -17
- package/lib/selectable-box/selectable-box.d.ts +2 -2
- package/lib/simple-color-picker/locale.d.ts +0 -1
- package/lib/simple-color-picker/simple-color-picker.d.ts +47 -821
- package/lib/slider/slider.d.ts +7 -7
- package/lib/split-button/split-button.d.ts +6 -6
- package/lib/switch/switch.d.ts +4 -4
- package/lib/tab/tab.d.ts +6 -6
- package/lib/tab-panel/tab-panel.d.ts +2 -2
- package/lib/tabs/tabs.d.ts +2 -2
- package/lib/tag/tag.d.ts +6 -6
- package/lib/tag-group/tag-group.d.ts +2 -2
- package/lib/tag-name-map.d.ts +2 -1
- package/lib/text-area/text-area.d.ts +17 -17
- package/lib/text-field/text-field.d.ts +19 -19
- package/lib/time-picker/time-picker.d.ts +28 -28
- package/lib/toggletip/toggletip.d.ts +4 -4
- package/lib/tooltip/tooltip.d.ts +2 -2
- package/lib/tree-item/tree-item.d.ts +4 -4
- package/lib/tree-view/tree-view.d.ts +2 -2
- package/lib/video-player/video-player.d.ts +2 -2
- package/locales/de-DE.cjs +17 -2
- package/locales/de-DE.js +17 -2
- package/locales/en-GB.cjs +17 -2
- package/locales/en-GB.js +17 -2
- package/locales/en-US.cjs +17 -2
- package/locales/en-US.js +17 -2
- package/locales/ja-JP.cjs +17 -2
- package/locales/ja-JP.js +17 -2
- package/locales/zh-CN.cjs +17 -2
- package/locales/zh-CN.js +17 -2
- package/menu/definition.cjs +6 -6
- package/menu/definition.js +7 -7
- package/nav-disclosure/definition.js +1 -1
- package/nav-item/definition.js +1 -1
- package/note/definition.js +1 -1
- package/note/index.cjs +2 -2
- package/note/index.js +4 -4
- package/number-field/definition.cjs +1 -1
- package/number-field/definition.js +3 -3
- package/number-field/index.cjs +5 -5
- package/number-field/index.js +21 -21
- package/option/definition.cjs +6 -77
- package/option/definition.js +3 -78
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +34 -8
- package/pagination/definition.cjs +2 -1
- package/pagination/definition.js +2 -1
- package/pagination/index.cjs +12 -12
- package/pagination/index.js +59 -59
- package/popup/definition.cjs +2 -2
- package/popup/definition.js +2 -2
- package/progress/index.cjs +1 -1
- package/progress/index.js +1 -1
- package/radio/definition.cjs +9 -9
- package/radio/definition.js +10 -10
- package/radio-group/definition.cjs +2 -1
- package/radio-group/definition.js +2 -1
- package/radio-group/index.cjs +5 -5
- package/radio-group/index.js +80 -77
- package/range-slider/definition.cjs +1 -1
- package/range-slider/definition.js +1 -1
- package/range-slider/index.cjs +1 -1
- package/range-slider/index.js +1 -1
- package/rich-text-editor/definition.cjs +3 -4
- package/rich-text-editor/definition.js +3 -4
- package/rich-text-editor/index.cjs +27 -27
- package/rich-text-editor/index.js +1208 -1198
- package/searchable-select/definition.cjs +106 -14
- package/searchable-select/definition.js +107 -15
- package/searchable-select/index.cjs +81 -69
- package/searchable-select/index.js +362 -276
- package/select/definition.cjs +25 -42
- package/select/definition.js +26 -43
- package/selectable-box/definition.cjs +1 -1
- package/selectable-box/definition.js +1 -1
- package/selectable-box/index.cjs +3 -3
- package/selectable-box/index.js +20 -20
- package/shared/aria/aria-change-subscription.d.ts +0 -1
- package/shared/aria/aria-mixin.d.ts +3 -3
- package/shared/aria/delegate-aria-behavior.d.ts +5 -10
- package/shared/aria/delegates-aria.d.ts +3 -3
- package/shared/aria/host-semantics-behavior.d.ts +5 -8
- package/shared/aria/host-semantics.d.ts +3 -3
- package/shared/color-picker/base-color-picker.d.ts +436 -0
- package/shared/color-picker/index.d.ts +1 -0
- package/shared/color-picker/locale.d.ts +3 -0
- package/shared/color-picker/utils.d.ts +1 -0
- package/shared/deprecation/replaced-props.d.ts +317 -2
- package/shared/design-system/defineVividComponent.d.ts +2 -2
- package/shared/feedback/feedback-message.d.ts +2 -2
- package/shared/feedback/mixins.d.ts +4 -4
- package/shared/foundation/button/button.d.ts +4 -4
- package/shared/foundation/form-associated/form-associated.d.ts +4 -4
- package/shared/foundation/listbox/listbox.d.ts +4 -0
- package/shared/foundation/vivid-element/vivid-element.d.ts +335 -8
- package/shared/localization/Locale.d.ts +4 -0
- package/shared/patterns/affix.d.ts +4 -4
- package/shared/patterns/anchored.d.ts +4 -4
- package/shared/patterns/char-count/char-count.d.ts +2 -2
- package/shared/patterns/form-elements/form-element.d.ts +4 -4
- package/shared/patterns/form-elements/with-contextual-help.d.ts +6 -6
- package/shared/patterns/form-elements/with-error-text.d.ts +6 -6
- package/shared/patterns/form-elements/with-success-text.d.ts +2 -2
- package/shared/patterns/linkable.d.ts +2 -2
- package/shared/patterns/localized.d.ts +2 -2
- package/shared/patterns/trapped-focus.d.ts +2 -2
- package/shared/picker-field/mixins/calendar-picker.d.ts +14 -14
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +14 -14
- package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +2 -2
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +28 -28
- package/shared/picker-field/mixins/single-date-picker.d.ts +40 -40
- package/shared/picker-field/mixins/single-value-picker.d.ts +12 -12
- package/shared/picker-field/mixins/time-selection-picker.d.ts +29 -29
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +28 -28
- package/shared/picker-field/picker-field.d.ts +14 -14
- package/shared/templating/attribute-binding-behaviour.d.ts +3 -4
- package/shared/templating/render-in-light-dom.d.ts +13 -12
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/simple-color-picker/definition.cjs +29 -216
- package/simple-color-picker/definition.js +30 -217
- package/simple-color-picker/index.cjs +9 -21
- package/simple-color-picker/index.js +71 -185
- package/slider/definition.cjs +1 -1
- package/slider/definition.js +1 -1
- package/split-button/definition.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 +2 -2
- package/switch/index.js +4 -4
- package/tab/definition.js +1 -1
- package/tabs/definition.cjs +1 -1
- package/tabs/definition.js +2 -2
- package/tabs/index.cjs +2 -2
- package/tabs/index.js +16 -16
- package/tag/definition.js +1 -1
- package/tag/index.cjs +1 -1
- package/tag/index.js +1 -1
- package/text-area/index.cjs +3 -3
- package/text-area/index.js +8 -8
- package/text-field/definition.cjs +2 -2
- package/text-field/definition.js +4 -4
- package/text-field/index.cjs +1 -1
- package/text-field/index.js +1 -1
- package/time-picker/definition.cjs +1 -1
- package/time-picker/definition.js +1 -1
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +2 -2
- package/toggletip/definition.cjs +2 -2
- package/toggletip/definition.js +3 -3
- package/tooltip/definition.cjs +1 -1
- package/tooltip/definition.js +1 -1
- package/tree-item/definition.cjs +1 -1
- package/tree-item/definition.js +1 -1
- package/tree-view/definition.cjs +2 -2
- package/tree-view/definition.js +3 -3
- package/tree-view/index.cjs +2 -2
- package/tree-view/index.js +6 -6
- package/unbundled/_commonjsHelpers.cjs +36 -0
- package/unbundled/_commonjsHelpers.js +32 -0
- package/unbundled/affix.cjs +1 -1
- package/unbundled/affix.js +2 -2
- package/unbundled/attribute-binding-behaviour.cjs +11 -10
- package/unbundled/attribute-binding-behaviour.js +11 -10
- package/unbundled/base-color-picker.cjs +278 -0
- package/unbundled/base-color-picker.js +275 -0
- package/unbundled/button.cjs +1 -1
- package/unbundled/button.js +2 -2
- package/unbundled/calendar-picker.template.cjs +4 -4
- package/unbundled/calendar-picker.template.js +5 -5
- package/unbundled/definition.js +1 -1
- package/unbundled/definition2.cjs +1 -1
- package/unbundled/definition2.js +3 -3
- package/unbundled/definition3.cjs +222 -140
- package/unbundled/definition3.js +220 -138
- package/unbundled/definition4.cjs +145 -235
- package/unbundled/definition4.js +143 -233
- package/unbundled/definition5.cjs +269 -27
- package/unbundled/definition5.js +267 -26
- package/unbundled/definition6.cjs +56 -0
- package/unbundled/definition6.js +52 -0
- package/unbundled/delegates-aria.cjs +67 -33
- package/unbundled/delegates-aria.js +69 -35
- package/unbundled/form-associated.cjs +2 -2
- package/unbundled/form-associated.js +3 -3
- package/unbundled/host-semantics.cjs +47 -22
- package/unbundled/host-semantics.js +48 -23
- package/unbundled/listbox.cjs +41 -63
- package/unbundled/listbox.js +39 -61
- package/unbundled/mixins.cjs +34 -27
- package/unbundled/mixins.js +35 -28
- package/unbundled/picker-field.template.cjs +3 -3
- package/unbundled/picker-field.template.js +4 -4
- package/unbundled/slider.template.cjs +1 -1
- package/unbundled/slider.template.js +1 -1
- package/unbundled/time-selection-picker.template.cjs +4 -4
- package/unbundled/time-selection-picker.template.js +5 -5
- package/unbundled/vivid-element.cjs +22 -15
- package/unbundled/vivid-element.js +23 -15
- package/video-player/definition.cjs +69047 -1
- package/video-player/definition.js +69047 -1
- package/video-player/index.cjs +36 -36
- package/video-player/index.js +1895 -1905
- package/visually-hidden/index.cjs +1 -1
- package/visually-hidden/index.js +1 -1
- package/vivid.api.json +719 -224
- package/bundled/option.cjs +0 -1
- package/bundled/option.js +0 -158
- package/unbundled/option.cjs +0 -217
- package/unbundled/option.js +0 -214
package/bundled/mixins.js
CHANGED
|
@@ -1,102 +1,108 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { w as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { n as k } from "./normalize.js";
|
|
2
|
+
import { d as _, h as d, V as $, a as y, M as F, H as I, o as f } from "./vivid-element.js";
|
|
3
|
+
import { i as w, I as D } from "./definition2.js";
|
|
4
|
+
import { v as C } from "./definition13.js";
|
|
5
|
+
import { w as m } from "./when.js";
|
|
6
|
+
import { c as B } from "./class-names.js";
|
|
7
|
+
import { L as H } from "./localized.js";
|
|
8
|
+
import { s as x } from "./slotted.js";
|
|
9
|
+
const S = ":host{display:contents}.message{display:flex;contain:inline-size;font:var(--vvd-typography-base-condensed);gap:4px;grid-column:1/-1}.message.none-message{display:none}.message.helper-message{color:var(--_low-ink-color)}.message.error-message,.message.success-message{color:var(--vvd-color-canvas-text)}slot{display:inline}.icon{font-size:16px}.error-message .icon{color:var(--vvd-color-alert-500)}.success-message .icon{color:var(--vvd-color-success-500)}.announcement{display:contents}";
|
|
10
|
+
var M = Object.defineProperty, O = (t, e, o, s) => {
|
|
11
|
+
for (var n = void 0, r = t.length - 1, a; r >= 0; r--)
|
|
12
|
+
(a = t[r]) && (n = a(e, o, n) || n);
|
|
13
|
+
return n && M(e, o, n), n;
|
|
13
14
|
};
|
|
14
|
-
class l extends
|
|
15
|
+
class l extends H($) {
|
|
15
16
|
constructor() {
|
|
16
17
|
super(...arguments), this.type = "none";
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
+
O([
|
|
20
21
|
y
|
|
21
22
|
], l.prototype, "type");
|
|
22
|
-
function
|
|
23
|
-
const
|
|
24
|
-
return d`<${
|
|
23
|
+
function u(t, e, o) {
|
|
24
|
+
const s = t.tagFor(D);
|
|
25
|
+
return d`<${s} class="icon" name="${e}" label="${(n) => n.locale.feedbackMessage[o]}"></${s}>`;
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
-
const
|
|
27
|
+
function U(t) {
|
|
28
|
+
const e = {
|
|
28
29
|
none: "",
|
|
29
30
|
helper: "",
|
|
30
|
-
error:
|
|
31
|
-
success:
|
|
31
|
+
error: u(t, "info-line", "errorIconText"),
|
|
32
|
+
success: u(t, "check-circle-line", "successIconText")
|
|
32
33
|
};
|
|
33
|
-
return d`${(
|
|
34
|
+
return d`${(o) => e[o.type]}`;
|
|
34
35
|
}
|
|
35
|
-
const g = (
|
|
36
|
-
const
|
|
37
|
-
class="${(
|
|
36
|
+
const g = (t) => t === "error", L = (t) => {
|
|
37
|
+
const e = d`<div
|
|
38
|
+
class="${(o) => B("message", `${o.type}-message`)}"
|
|
38
39
|
>
|
|
39
|
-
${
|
|
40
|
+
${U(t)}<slot></slot>
|
|
40
41
|
</div>`;
|
|
41
|
-
return d`${
|
|
42
|
+
return d`${m((o) => !g(o.type), e)}
|
|
42
43
|
<span class="announcement" role="status" aria-live="polite">
|
|
43
|
-
${
|
|
44
|
+
${m((o) => g(o.type), e)}
|
|
44
45
|
</span>`;
|
|
45
|
-
},
|
|
46
|
+
}, ee = _(
|
|
46
47
|
"feedback-message",
|
|
47
48
|
l,
|
|
48
|
-
|
|
49
|
-
[
|
|
49
|
+
L,
|
|
50
|
+
[w, C],
|
|
50
51
|
{
|
|
51
|
-
styles:
|
|
52
|
+
styles: S
|
|
52
53
|
}
|
|
53
54
|
);
|
|
54
55
|
class P {
|
|
55
|
-
constructor(
|
|
56
|
-
this.source = null, this.templateBindingObserver =
|
|
57
|
-
t,
|
|
56
|
+
constructor(e) {
|
|
57
|
+
this.source = null, this.templateBindingObserver = e.templateBinding.createObserver(
|
|
58
58
|
this,
|
|
59
|
-
|
|
59
|
+
e
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
|
-
bind(
|
|
63
|
-
this.source =
|
|
64
|
-
}
|
|
65
|
-
unbind() {
|
|
66
|
-
this.source = null, this.view.unbind(), this.templateBindingObserver.disconnect();
|
|
62
|
+
bind(e) {
|
|
63
|
+
this.source = e.source, this.context = e.context, this.controller = e, this.insertionPoint || (this.insertionPoint = document.createComment(""), this.source.appendChild(this.insertionPoint)), this.templateBindingObserver.bind(e), this.handleChange(this.source, this.templateBindingObserver);
|
|
67
64
|
}
|
|
65
|
+
// unbind(): void {
|
|
66
|
+
// this.source = null;
|
|
67
|
+
// if (this.view) {
|
|
68
|
+
// this.view.unbind();
|
|
69
|
+
// }
|
|
70
|
+
// // The observer will be automatically cleaned up when the behavior is destroyed
|
|
71
|
+
// }
|
|
68
72
|
/**
|
|
69
73
|
* Handles change of the template itself.
|
|
70
74
|
*/
|
|
71
|
-
handleChange() {
|
|
72
|
-
this.
|
|
73
|
-
this.templateBindingObserver.
|
|
74
|
-
|
|
75
|
+
handleChange(e, o) {
|
|
76
|
+
if (o === this.templateBindingObserver) {
|
|
77
|
+
const s = this.templateBindingObserver.bind(this.controller);
|
|
78
|
+
this.instantiateTemplate(s);
|
|
79
|
+
}
|
|
75
80
|
}
|
|
76
|
-
instantiateTemplate(
|
|
77
|
-
this.view && this.view.dispose(), this.view =
|
|
81
|
+
instantiateTemplate(e) {
|
|
82
|
+
this.view && this.view.dispose(), this.view = e.create(), this.view.bind(this.source, this.context), this.view.insertBefore(this.insertionPoint);
|
|
78
83
|
}
|
|
79
84
|
}
|
|
80
|
-
class
|
|
81
|
-
constructor(
|
|
82
|
-
|
|
85
|
+
class T {
|
|
86
|
+
constructor(e) {
|
|
87
|
+
this.targetNodeId = "", this.templateBinding = e, this.dataBinding = e;
|
|
88
|
+
}
|
|
89
|
+
createHTML(e) {
|
|
90
|
+
return F.comment(e(this));
|
|
83
91
|
}
|
|
84
92
|
createBehavior() {
|
|
85
|
-
return new P(
|
|
86
|
-
this.templateBinding,
|
|
87
|
-
this.isTemplateBindingVolatile
|
|
88
|
-
);
|
|
93
|
+
return new P(this);
|
|
89
94
|
}
|
|
90
95
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
96
|
+
I.define(T);
|
|
97
|
+
function R(t) {
|
|
98
|
+
const e = k(t);
|
|
99
|
+
return new T(e);
|
|
94
100
|
}
|
|
95
101
|
const i = [];
|
|
96
|
-
for (let
|
|
97
|
-
i.push((
|
|
98
|
-
function
|
|
99
|
-
return (i[e
|
|
102
|
+
for (let t = 0; t < 256; ++t)
|
|
103
|
+
i.push((t + 256).toString(16).slice(1));
|
|
104
|
+
function V(t, e = 0) {
|
|
105
|
+
return (i[t[e + 0]] + i[t[e + 1]] + i[t[e + 2]] + i[t[e + 3]] + "-" + i[t[e + 4]] + i[t[e + 5]] + "-" + i[t[e + 6]] + i[t[e + 7]] + "-" + i[t[e + 8]] + i[t[e + 9]] + "-" + i[t[e + 10]] + i[t[e + 11]] + i[t[e + 12]] + i[t[e + 13]] + i[t[e + 14]] + i[t[e + 15]]).toLowerCase();
|
|
100
106
|
}
|
|
101
107
|
let p;
|
|
102
108
|
const E = new Uint8Array(16);
|
|
@@ -109,23 +115,23 @@ function W() {
|
|
|
109
115
|
return p(E);
|
|
110
116
|
}
|
|
111
117
|
const j = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), b = { randomUUID: j };
|
|
112
|
-
function z(
|
|
113
|
-
if (b.randomUUID && !
|
|
118
|
+
function z(t, e, o) {
|
|
119
|
+
if (b.randomUUID && !t)
|
|
114
120
|
return b.randomUUID();
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
121
|
+
t = t || {};
|
|
122
|
+
const s = t.random ?? t.rng?.() ?? W();
|
|
123
|
+
if (s.length < 16)
|
|
118
124
|
throw new Error("Random bytes length must be >= 16");
|
|
119
|
-
return
|
|
125
|
+
return s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, V(s);
|
|
120
126
|
}
|
|
121
127
|
const v = () => z();
|
|
122
|
-
var A = Object.defineProperty, h = (e,
|
|
123
|
-
for (var n = void 0, r =
|
|
124
|
-
(a =
|
|
125
|
-
return n && A(
|
|
128
|
+
var A = Object.defineProperty, h = (t, e, o, s) => {
|
|
129
|
+
for (var n = void 0, r = t.length - 1, a; r >= 0; r--)
|
|
130
|
+
(a = t[r]) && (n = a(e, o, n) || n);
|
|
131
|
+
return n && A(e, o, n), n;
|
|
126
132
|
};
|
|
127
|
-
const N = (
|
|
128
|
-
class
|
|
133
|
+
const N = (t) => {
|
|
134
|
+
class e extends t {
|
|
129
135
|
/**
|
|
130
136
|
* Ids of the feedback content that the control should use for aria-describedby.
|
|
131
137
|
*
|
|
@@ -138,8 +144,8 @@ const N = (e) => {
|
|
|
138
144
|
* @internal
|
|
139
145
|
*/
|
|
140
146
|
_internalFeedback() {
|
|
141
|
-
const
|
|
142
|
-
return r ? { type: "success", message: r } : n ? { type: "error", message: n } :
|
|
147
|
+
const s = this._helperTextSlottedContent?.length ? "" : this.helperText, n = this.errorValidationMessage, r = this.successText;
|
|
148
|
+
return r ? { type: "success", message: r } : n ? { type: "error", message: n } : s ? { type: "helper", message: s } : { type: "none", message: "" };
|
|
143
149
|
}
|
|
144
150
|
/**
|
|
145
151
|
* @internal
|
|
@@ -150,8 +156,8 @@ const N = (e) => {
|
|
|
150
156
|
/**
|
|
151
157
|
* @internal
|
|
152
158
|
*/
|
|
153
|
-
_getFeedbackTemplate(
|
|
154
|
-
const n =
|
|
159
|
+
_getFeedbackTemplate(s) {
|
|
160
|
+
const n = s.tagFor(l);
|
|
155
161
|
return d`
|
|
156
162
|
<${n} id="feedback" :type="${(r) => r._internalFeedback().type}">
|
|
157
163
|
${(r) => r._internalFeedback().message}
|
|
@@ -160,28 +166,28 @@ const N = (e) => {
|
|
|
160
166
|
id="slotted-helper-text-feedback"
|
|
161
167
|
:type="${(r) => r._slottedHelperTextFeedbackType()}"
|
|
162
168
|
>
|
|
163
|
-
<slot name="helper-text" ${
|
|
169
|
+
<slot name="helper-text" ${x("_helperTextSlottedContent")}></slot>
|
|
164
170
|
</${n}>
|
|
165
171
|
`;
|
|
166
172
|
}
|
|
167
173
|
}
|
|
168
174
|
return h([
|
|
169
175
|
y({ attribute: "helper-text" })
|
|
170
|
-
],
|
|
171
|
-
|
|
172
|
-
],
|
|
173
|
-
},
|
|
174
|
-
const
|
|
175
|
-
class
|
|
176
|
+
], e.prototype, "helperText"), h([
|
|
177
|
+
f
|
|
178
|
+
], e.prototype, "_helperTextSlottedContent"), e;
|
|
179
|
+
}, te = (t) => {
|
|
180
|
+
const e = () => `vvd-feedback-${v()}`, o = () => `vvd-slotted-feedback-${v()}`;
|
|
181
|
+
class s extends N(t) {
|
|
176
182
|
constructor() {
|
|
177
|
-
super(...arguments), this._slottedHelperTextIds = [], this._feedbackId =
|
|
183
|
+
super(...arguments), this._slottedHelperTextIds = [], this._feedbackId = e();
|
|
178
184
|
}
|
|
179
185
|
/**
|
|
180
186
|
* @internal
|
|
181
187
|
*/
|
|
182
188
|
_helperTextSlottedContentChanged(r, a) {
|
|
183
189
|
for (const c of a)
|
|
184
|
-
c.id || (c.id =
|
|
190
|
+
c.id || (c.id = o());
|
|
185
191
|
this._slottedHelperTextIds = a.map((c) => c.id);
|
|
186
192
|
}
|
|
187
193
|
/**
|
|
@@ -197,7 +203,7 @@ const N = (e) => {
|
|
|
197
203
|
const a = r.tagFor(l);
|
|
198
204
|
return d`
|
|
199
205
|
<slot name="_feedback"></slot>
|
|
200
|
-
${
|
|
206
|
+
${R(d`<${a}
|
|
201
207
|
slot="_feedback"
|
|
202
208
|
id="${(c) => c._feedbackId}"
|
|
203
209
|
:type="${(c) => c._internalFeedback().type}"
|
|
@@ -207,20 +213,20 @@ const N = (e) => {
|
|
|
207
213
|
<${a} :type="${(c) => c._slottedHelperTextFeedbackType()}">
|
|
208
214
|
<slot
|
|
209
215
|
name="helper-text"
|
|
210
|
-
${
|
|
216
|
+
${x("_helperTextSlottedContent")}
|
|
211
217
|
></slot>
|
|
212
218
|
</${a}>
|
|
213
219
|
`;
|
|
214
220
|
}
|
|
215
221
|
}
|
|
216
222
|
return h([
|
|
217
|
-
|
|
218
|
-
],
|
|
223
|
+
f
|
|
224
|
+
], s.prototype, "_slottedHelperTextIds"), s;
|
|
219
225
|
};
|
|
220
226
|
export {
|
|
221
227
|
N as W,
|
|
222
|
-
|
|
223
|
-
|
|
228
|
+
te as a,
|
|
229
|
+
ee as f,
|
|
224
230
|
v as g,
|
|
225
|
-
|
|
231
|
+
R as r
|
|
226
232
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("./vivid-element.cjs");function e(n){return i.isFunction(n)?i.oneWay(n):n instanceof i.Binding?n:i.oneTime(()=>n)}exports.normalizeBinding=e;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const _=require("./index.cjs"),v=require("./mixins.cjs"),g=require("./form-associated.cjs"),r=require("./vivid-element.cjs"),$=require("./with-contextual-help.cjs"),x=require("./with-error-text.cjs"),m=require("./form-element.cjs"),k=require("./localized.cjs"),F=require("./definition9.cjs"),E=require("./
|
|
1
|
+
"use strict";const _=require("./index.cjs"),v=require("./mixins.cjs"),g=require("./form-associated.cjs"),r=require("./vivid-element.cjs"),$=require("./with-contextual-help.cjs"),x=require("./with-error-text.cjs"),m=require("./form-element.cjs"),k=require("./localized.cjs"),F=require("./definition9.cjs"),E=require("./definition10.cjs"),y=require("./definition3.cjs"),p=require("./ref.cjs"),h=require("./slotted.cjs"),f=require("./class-names.cjs"),b=new WeakSet,C=l=>{b.add(l)},O=l=>{class t extends l{_trappedFocus(a,i){if(!b.has(a)&&a.key==="Tab"){const s=i(),o=s[0],e=s[s.length-1];if(a.shiftKey){if(this.shadowRoot.activeElement===o)return e.focus(),!0}else if(this.shadowRoot.activeElement===e)return o.focus(),!0}return!1}}return t},T=":host{display:inline-block}.base{display:inline-block;inline-size:100%}.control{inline-size:100%}.dialog{display:inline-flex;flex-direction:column}.dialog--padded{padding:12px;gap:12px}.dialog .footer{display:flex;align-items:center;justify-content:flex-end;padding:8px;gap:8px}.dialog .footer--with-separator{border-top:1px solid var(--vvd-color-neutral-200)}";var P=Object.defineProperty,u=(l,t,n,a)=>{for(var i=void 0,s=l.length-1,o;s>=0;s--)(o=l[s])&&(i=o(t,n,i)||i);return i&&P(t,n,i),i};class c extends $.WithContextualHelp(v.WithFeedback(x.WithErrorText(m.FormElement(O(k.Localized(g.FormAssociated(r.VividElement))))))){constructor(){super(),this.readOnly=!1,this.#e=()=>{this.$emit("focus",void 0,{bubbles:!1})},this.#t=()=>{this.$emit("blur",void 0,{bubbles:!1})},this.proxy=document.createElement("input"),this.#l={handleChange:()=>{this._updatePresentationValue()}},this._popupOpen=!1,this.#o=t=>{if(!this._popupOpen)return;const n=t.composedPath();[this._dialogEl,this._pickerButtonEl].some(i=>n.includes(i))||this._closePopup(!1)},this._presentationValue="",this.value=""}readOnlyChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.readOnly=this.readOnly,this.validate())}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.#o),this.addEventListener("focusin",this.#e),this.addEventListener("focusout",this.#t),this.#s()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.#o),this.removeEventListener("focusin",this.#e),this.removeEventListener("focusout",this.#t),this.#n()}#e;#t;validate(){this.proxy&&this.proxy.setCustomValidity(this._getCustomValidationError()??""),super.validate(this._textFieldEl?.querySelector("input")??void 0)}#l;#i;#s(){this.#i=r.Observable.binding(()=>this.locale,this.#l),this.#i.observe(this,r.ExecutionContext.default)}#n(){this.#i.dispose()}#o;#a(){this.readOnly||(this._popupOpen=!0)}_closePopup(t=!0){this._popupOpen=!1,t&&this._textFieldEl.focus()}_onBaseKeyDown(t){return this._popupOpen&&_.handleEscapeKeyAndStopPropogation(t)?(this._closePopup(),!1):!this._trappedFocus(t,()=>this._focusableElsWithinDialog())}_presentationValueChanged(){this.dirtyValue=!0,this.validate()}_onTextFieldInput(t){const n=t.currentTarget;this._presentationValue=n.value}_onPickerButtonClick(){this._popupOpen?this._closePopup():this.#a()}_onOkClick(){this._closePopup()}_onClearClick(){this.$emit("clear-click")}}u([r.attr({attribute:"readonly",mode:"boolean"})],c.prototype,"readOnly");u([r.observable],c.prototype,"_popupOpen");u([r.observable],c.prototype,"_presentationValue");const q=(l,t,{withSeparator:n,padded:a})=>{const i=l.tagFor(F.Popup),s=l.tagFor(E.TextField),o=l.tagFor(y.Button);return r.html`
|
|
2
2
|
<div class='base' @keydown='${(e,{event:d})=>e._onBaseKeyDown(d)}'>
|
|
3
3
|
<${s} id='text-field'
|
|
4
4
|
${p.ref("_textFieldEl")}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { h as b } from "./index.js";
|
|
2
2
|
import { W as _ } from "./mixins.js";
|
|
3
3
|
import { F as g } from "./form-associated.js";
|
|
4
|
-
import { V as v, O as $,
|
|
4
|
+
import { V as v, O as $, E as x, a as k, o as f, h as F } from "./vivid-element.js";
|
|
5
5
|
import { W as y } from "./with-contextual-help.js";
|
|
6
6
|
import { W as C } from "./with-error-text.js";
|
|
7
7
|
import { F as E } from "./form-element.js";
|
|
8
8
|
import { L as O } from "./localized.js";
|
|
9
9
|
import { P as T } from "./definition9.js";
|
|
10
|
-
import { T as P } from "./
|
|
10
|
+
import { T as P } from "./definition10.js";
|
|
11
11
|
import { B as L } from "./definition3.js";
|
|
12
12
|
import { r as p } from "./ref.js";
|
|
13
13
|
import { s as u } from "./slotted.js";
|
|
@@ -95,10 +95,10 @@ class c extends y(
|
|
|
95
95
|
this.#o = $.binding(
|
|
96
96
|
() => this.locale,
|
|
97
97
|
this.#s
|
|
98
|
-
), this.#o.observe(this, x);
|
|
98
|
+
), this.#o.observe(this, x.default);
|
|
99
99
|
}
|
|
100
100
|
#a() {
|
|
101
|
-
this.#o.
|
|
101
|
+
this.#o.dispose();
|
|
102
102
|
}
|
|
103
103
|
#i;
|
|
104
104
|
#n() {
|
package/bundled/ref.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("./vivid-element.cjs");class s{
|
|
1
|
+
"use strict";const i=require("./vivid-element.cjs");class s extends i.StatelessAttachedAttributeDirective{bind(t){t.source[this.options]=t.targets[this.targetNodeId]}}i.HTMLDirective.define(s);const r=e=>new s(e);exports.ref=r;
|
package/bundled/ref.js
CHANGED
|
@@ -1,32 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
class
|
|
1
|
+
import { S as i, H as r } from "./vivid-element.js";
|
|
2
|
+
class s extends i {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* @param
|
|
6
|
-
* @param propertyName - The name of the property to assign the reference to.
|
|
7
|
-
*/
|
|
8
|
-
constructor(t, e) {
|
|
9
|
-
this.target = t, this.propertyName = e;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Bind this behavior to the source.
|
|
13
|
-
* @param source - The source to bind to.
|
|
14
|
-
* @param context - The execution context that the binding is operating within.
|
|
4
|
+
* Bind this behavior.
|
|
5
|
+
* @param controller - The view controller that manages the lifecycle of this behavior.
|
|
15
6
|
*/
|
|
16
7
|
bind(t) {
|
|
17
|
-
t[this.
|
|
8
|
+
t.source[this.options] = t.targets[this.targetNodeId];
|
|
18
9
|
}
|
|
19
|
-
/**
|
|
20
|
-
* Unbinds this behavior from the source.
|
|
21
|
-
* @param source - The source to unbind from.
|
|
22
|
-
*/
|
|
23
|
-
/* eslint-disable-next-line @typescript-eslint/no-empty-function */
|
|
24
|
-
unbind() {
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
function s(r) {
|
|
28
|
-
return new i("fast-ref", a, r);
|
|
29
10
|
}
|
|
11
|
+
r.define(s);
|
|
12
|
+
const c = (e) => new s(e);
|
|
30
13
|
export {
|
|
31
|
-
|
|
14
|
+
c as r
|
|
32
15
|
};
|
package/bundled/repeat.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const a=require("./vivid-element.cjs");function v(i,e,t){return{index:i,removed:e,addedCount:t}}const I=0,$=1,y=2,O=3;function M(i,e,t,o,s,d){const c=d-s+1,f=t-e+1,n=new Array(c);let r,h;for(let l=0;l<c;++l)n[l]=new Array(f),n[l][0]=l;for(let l=0;l<f;++l)n[0][l]=l;for(let l=1;l<c;++l)for(let u=1;u<f;++u)i[e+u-1]===o[s+l-1]?n[l][u]=n[l-1][u-1]:(r=n[l-1][u]+1,h=n[l][u-1]+1,n[l][u]=r<h?r:h);return n}function Q(i){let e=i.length-1,t=i[0].length-1,o=i[e][t];const s=[];for(;e>0||t>0;){if(e===0){s.push(y),t--;continue}if(t===0){s.push(O),e--;continue}const d=i[e-1][t-1],c=i[e-1][t],f=i[e][t-1];let n;c<f?n=c<d?c:d:n=f<d?f:d,n===d?(d===o?s.push(I):(s.push($),o=d),e--,t--):n===c?(s.push(O),e--,o=c):(s.push(y),t--,o=f)}return s.reverse(),s}function k(i,e,t){for(let o=0;o<t;++o)if(i[o]!==e[o])return o;return t}function E(i,e,t){let o=i.length,s=e.length,d=0;for(;d<t&&i[--o]===e[--s];)d++;return d}function _(i,e,t,o){return e<t||o<i?-1:e===t||o===i?0:i<t?e<o?e-t:o-t:o<e?o-i:e-i}function j(i,e,t,o,s,d){let c=0,f=0;const n=Math.min(t-e,d-s);if(e===0&&s===0&&(c=k(i,o,n)),t===i.length&&d===o.length&&(f=E(i,o,n-c)),e+=c,s+=c,t-=f,d-=f,t-e===0&&d-s===0)return a.emptyArray;if(e===t){const m=v(e,[],0);for(;s<d;)m.removed.push(o[s++]);return[m]}else if(s===d)return[v(e,[],t-e)];const r=Q(M(i,e,t,o,s,d)),h=[];let l,u=e,p=s;for(let m=0;m<r.length;++m)switch(r[m]){case I:l!==void 0&&(h.push(l),l=void 0),u++,p++;break;case $:l===void 0&&(l=v(u,[],0)),l.addedCount++,u++,l.removed.push(o[p]),p++;break;case y:l===void 0&&(l=v(u,[],0)),l.addedCount++,u++;break;case O:l===void 0&&(l=v(u,[],0)),l.removed.push(o[p]),p++;break}return l!==void 0&&h.push(l),h}const B=Array.prototype.push;function q(i,e,t,o){const s=v(e,t,o);let d=!1,c=0;for(let f=0;f<i.length;f++){const n=i[f];if(n.index+=c,d)continue;const r=_(s.index,s.index+s.removed.length,n.index,n.index+n.addedCount);if(r>=0){i.splice(f,1),f--,c-=n.addedCount-n.removed.length,s.addedCount+=n.addedCount-r;const h=s.removed.length+n.removed.length-r;if(!s.addedCount&&!h)d=!0;else{let l=n.removed;if(s.index<n.index){const u=s.removed.slice(0,n.index-s.index);B.apply(u,l),l=u}if(s.index+s.removed.length>n.index+n.addedCount){const u=s.removed.slice(n.index+n.addedCount-s.index);B.apply(l,u)}s.removed=l,n.index<s.index&&(s.index=n.index)}}else if(s.index<n.index){d=!0,i.splice(f,0,s),f++;const h=s.addedCount-s.removed.length;n.index+=h,c+=h}}d||i.push(s)}function U(i){const e=[];for(let t=0,o=i.length;t<o;t++){const s=i[t];q(e,s.index,s.removed,s.addedCount)}return e}function W(i,e){let t=[];const o=U(e);for(let s=0,d=o.length;s<d;++s){const c=o[s];if(c.addedCount===1&&c.removed.length===1){c.removed[0]!==i[c.index]&&t.push(c);continue}t=t.concat(j(i,c.index,c.index+c.addedCount,c.removed,0,c.removed.length))}return t}let A=!1;function w(i,e){let t=i.index;const o=e.length;return t>o?t=o-i.addedCount:t<0&&(t=o+i.removed.length+t-i.addedCount),t<0&&(t=0),i.index=t,i}class F extends a.SubscriberSet{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.needsQueue=!0,this.call=this.flush,Reflect.defineProperty(e,"$fastController",{value:this,enumerable:!1})}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){this.splices===void 0?this.splices=[e]:this.splices.push(e),this.needsQueue&&(this.needsQueue=!1,a.DOM.queueUpdate(this))}reset(e){this.oldCollection=e,this.needsQueue&&(this.needsQueue=!1,a.DOM.queueUpdate(this))}flush(){const e=this.splices,t=this.oldCollection;if(e===void 0&&t===void 0)return;this.needsQueue=!0,this.splices=void 0,this.oldCollection=void 0;const o=t===void 0?W(this.source,e):j(this.source,0,this.source.length,t,0,t.length);this.notify(o)}}function H(){if(A)return;A=!0,a.Observable.setArrayObserverFactory(n=>new F(n));const i=Array.prototype;if(i.$fastPatch)return;Reflect.defineProperty(i,"$fastPatch",{value:1,enumerable:!1});const e=i.pop,t=i.push,o=i.reverse,s=i.shift,d=i.sort,c=i.splice,f=i.unshift;i.pop=function(){const n=this.length>0,r=e.apply(this,arguments),h=this.$fastController;return h!==void 0&&n&&h.addSplice(v(this.length,[r],0)),r},i.push=function(){const n=t.apply(this,arguments),r=this.$fastController;return r!==void 0&&r.addSplice(w(v(this.length-arguments.length,[],arguments.length),this)),n},i.reverse=function(){let n;const r=this.$fastController;r!==void 0&&(r.flush(),n=this.slice());const h=o.apply(this,arguments);return r!==void 0&&r.reset(n),h},i.shift=function(){const n=this.length>0,r=s.apply(this,arguments),h=this.$fastController;return h!==void 0&&n&&h.addSplice(v(0,[r],0)),r},i.sort=function(){let n;const r=this.$fastController;r!==void 0&&(r.flush(),n=this.slice());const h=d.apply(this,arguments);return r!==void 0&&r.reset(n),h},i.splice=function(){const n=c.apply(this,arguments),r=this.$fastController;return r!==void 0&&r.addSplice(w(v(+arguments[0],n,arguments.length>2?arguments.length-2:0),this)),n},i.unshift=function(){const n=f.apply(this,arguments),r=this.$fastController;return r!==void 0&&r.addSplice(w(v(0,[],arguments.length),this)),n}}const D=Object.freeze({positioning:!1,recycle:!0});function N(i,e,t,o){i.bind(e[t],o)}function z(i,e,t,o){const s=Object.create(o);s.index=t,s.length=e.length,i.bind(e[t],s)}class G{constructor(e,t,o,s,d,c){this.location=e,this.itemsBinding=t,this.templateBinding=s,this.options=c,this.source=null,this.views=[],this.items=null,this.itemsObserver=null,this.originalContext=void 0,this.childContext=void 0,this.bindView=N,this.itemsBindingObserver=a.Observable.binding(t,this,o),this.templateBindingObserver=a.Observable.binding(s,this,d),c.positioning&&(this.bindView=z)}bind(e,t){this.source=e,this.originalContext=t,this.childContext=Object.create(t),this.childContext.parent=e,this.childContext.parentContext=this.originalContext,this.items=this.itemsBindingObserver.observe(e,this.originalContext),this.template=this.templateBindingObserver.observe(e,this.originalContext),this.observeItems(!0),this.refreshAllViews()}unbind(){this.source=null,this.items=null,this.itemsObserver!==null&&this.itemsObserver.unsubscribe(this),this.unbindAllViews(),this.itemsBindingObserver.disconnect(),this.templateBindingObserver.disconnect()}handleChange(e,t){e===this.itemsBinding?(this.items=this.itemsBindingObserver.observe(this.source,this.originalContext),this.observeItems(),this.refreshAllViews()):e===this.templateBinding?(this.template=this.templateBindingObserver.observe(this.source,this.originalContext),this.refreshAllViews(!0)):this.updateViews(t)}observeItems(e=!1){if(!this.items){this.items=a.emptyArray;return}const t=this.itemsObserver,o=this.itemsObserver=a.Observable.getNotifier(this.items),s=t!==o;s&&t!==null&&t.unsubscribe(this),(s||e)&&o.subscribe(this)}updateViews(e){const t=this.childContext,o=this.views,s=this.bindView,d=this.items,c=this.template,f=this.options.recycle,n=[];let r=0,h=0;for(let l=0,u=e.length;l<u;++l){const p=e[l],m=p.removed;let C=0,g=p.index;const R=g+p.addedCount,x=o.splice(p.index,m.length),T=h=n.length+x.length;for(;g<R;++g){const V=o[g],L=V?V.firstChild:this.location;let b;f&&h>0?(C<=T&&x.length>0?(b=x[C],C++):(b=n[r],r++),h--):b=c.create(),o.splice(g,0,b),s(b,d,g,t),b.insertBefore(L)}x[C]&&n.push(...x.slice(C))}for(let l=r,u=n.length;l<u;++l)n[l].dispose();if(this.options.positioning)for(let l=0,u=o.length;l<u;++l){const p=o[l].context;p.length=u,p.index=l}}refreshAllViews(e=!1){const t=this.items,o=this.childContext,s=this.template,d=this.location,c=this.bindView;let f=t.length,n=this.views,r=n.length;if((f===0||e||!this.options.recycle)&&(a.HTMLView.disposeContiguousBatch(n),r=0),r===0){this.views=n=new Array(f);for(let h=0;h<f;++h){const l=s.create();c(l,t,h,o),n[h]=l,l.insertBefore(d)}}else{let h=0;for(;h<f;++h)if(h<r){const u=n[h];c(u,t,h,o)}else{const u=s.create();c(u,t,h,o),n.push(u),u.insertBefore(d)}const l=n.splice(h,r-h);for(h=0,f=l.length;h<f;++h)l[h].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,o=e.length;t<o;++t)e[t].unbind()}}class P extends a.HTMLDirective{constructor(e,t,o){super(),this.itemsBinding=e,this.templateBinding=t,this.options=o,this.createPlaceholder=a.DOM.createBlockPlaceholder,H(),this.isItemsBindingVolatile=a.Observable.isVolatileBinding(e),this.isTemplateBindingVolatile=a.Observable.isVolatileBinding(t)}createBehavior(e){return new G(e,this.itemsBinding,this.isItemsBindingVolatile,this.templateBinding,this.isTemplateBindingVolatile,this.options)}}function J(i,e,t=D){const o=typeof e=="function"?e:()=>e;return new P(i,o,Object.assign(Object.assign({},D),t))}exports.RepeatDirective=P;exports.repeat=J;
|
|
1
|
+
"use strict";const f=require("./vivid-element.cjs"),V=require("./normalize.cjs");class v{constructor(e,t,s){this.index=e,this.removed=t,this.addedCount=s}adjustTo(e){let t=this.index;const s=e.length;return t>s?t=s-this.addedCount:t<0&&(t=s+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}class S{constructor(e){this.sorted=e}}const T=Object.freeze({reset:1,splice:2,optimized:3}),j=new v(0,f.emptyArray,0);j.reset=!0;const _=[j];function H(i,e,t,s,o,n){const l=n-o+1,h=t-e+1,d=new Array(l);let a,c;for(let r=0;r<l;++r)d[r]=new Array(h),d[r][0]=r;for(let r=0;r<h;++r)d[0][r]=r;for(let r=1;r<l;++r)for(let u=1;u<h;++u)i[e+u-1]===s[o+r-1]?d[r][u]=d[r-1][u-1]:(a=d[r-1][u]+1,c=d[r][u-1]+1,d[r][u]=a<c?a:c);return d}function L(i){let e=i.length-1,t=i[0].length-1,s=i[e][t];const o=[];for(;e>0||t>0;){if(e===0){o.push(2),t--;continue}if(t===0){o.push(3),e--;continue}const n=i[e-1][t-1],l=i[e-1][t],h=i[e][t-1];let d;l<h?d=l<n?l:n:d=h<n?h:n,d===n?(n===s?o.push(0):(o.push(1),s=n),e--,t--):d===l?(o.push(3),e--,s=l):(o.push(2),t--,s=h)}return o.reverse()}function $(i,e,t){for(let s=0;s<t;++s)if(i[s]!==e[s])return s;return t}function E(i,e,t){let s=i.length,o=e.length,n=0;for(;n<t&&i[--s]===e[--o];)n++;return n}function q(i,e,t,s){return e<t||s<i?-1:e===t||s===i?0:i<t?e<s?e-t:s-t:s<e?s-i:e-i}function D(i,e,t,s,o,n){let l=0,h=0;const d=Math.min(t-e,n-o);if(e===0&&o===0&&(l=$(i,s,d)),t===i.length&&n===s.length&&(h=E(i,s,d-l)),e+=l,o+=l,t-=h,n-=h,t-e===0&&n-o===0)return f.emptyArray;if(e===t){const g=new v(e,[],0);for(;o<n;)g.removed.push(s[o++]);return[g]}else if(o===n)return[new v(e,[],t-e)];const a=L(H(i,e,t,s,o,n)),c=[];let r,u=e,p=o;for(let g=0;g<a.length;++g)switch(a[g]){case 0:r!==void 0&&(c.push(r),r=void 0),u++,p++;break;case 1:r===void 0&&(r=new v(u,[],0)),r.addedCount++,u++,r.removed.push(s[p]),p++;break;case 2:r===void 0&&(r=new v(u,[],0)),r.addedCount++,u++;break;case 3:r===void 0&&(r=new v(u,[],0)),r.removed.push(s[p]),p++;break}return r!==void 0&&c.push(r),c}function P(i,e){let t=!1,s=0;for(let o=0;o<e.length;o++){const n=e[o];if(n.index+=s,t)continue;const l=q(i.index,i.index+i.removed.length,n.index,n.index+n.addedCount);if(l>=0){e.splice(o,1),o--,s-=n.addedCount-n.removed.length,i.addedCount+=n.addedCount-l;const h=i.removed.length+n.removed.length-l;if(!i.addedCount&&!h)t=!0;else{let d=n.removed;if(i.index<n.index){const a=i.removed.slice(0,n.index-i.index);a.push(...d),d=a}if(i.index+i.removed.length>n.index+n.addedCount){const a=i.removed.slice(n.index+n.addedCount-i.index);d.push(...a)}i.removed=d,n.index<i.index&&(i.index=n.index)}}else if(i.index<n.index){t=!0,e.splice(o,0,i),o++;const h=i.addedCount-i.removed.length;n.index+=h,s+=h}}t||e.push(i)}function Q(i,e){let t=[];const s=[];for(let o=0,n=e.length;o<n;o++)P(e[o],s);for(let o=0,n=s.length;o<n;++o){const l=s[o];if(l.addedCount===1&&l.removed.length===1){l.removed[0]!==i[l.index]&&t.push(l);continue}t=t.concat(D(i,l.index,l.index+l.addedCount,l.removed,0,l.removed.length))}return t}let z=Object.freeze({support:T.optimized,normalize(i,e,t){return i===void 0?t===void 0?f.emptyArray:Q(e,t):_},pop(i,e,t,s){const o=i.length>0,n=t.apply(i,s);return o&&e.addSplice(new v(i.length,[n],0)),n},push(i,e,t,s){const o=t.apply(i,s);return e.addSplice(new v(i.length-s.length,[],s.length).adjustTo(i)),o},reverse(i,e,t,s){const o=t.apply(i,s);i.sorted++;const n=[];for(let l=i.length-1;l>=0;l--)n.push(l);return e.addSort(new S(n)),o},shift(i,e,t,s){const o=i.length>0,n=t.apply(i,s);return o&&e.addSplice(new v(0,[n],0)),n},sort(i,e,t,s){const o=new Map;for(let h=0,d=i.length;h<d;++h){const a=o.get(i[h])||[];o.set(i[h],[...a,h])}const n=t.apply(i,s);i.sorted++;const l=[];for(let h=0,d=i.length;h<d;++h){const a=o.get(i[h]);l.push(a[0]),o.set(i[h],a.splice(1))}return e.addSort(new S(l)),n},splice(i,e,t,s){const o=t.apply(i,s);return e.addSplice(new v(+s[0],o,s.length>2?s.length-2:0).adjustTo(i)),o},unshift(i,e,t,s){const o=t.apply(i,s);return e.addSplice(new v(0,[],s.length).adjustTo(i)),o}});function y(i,e,t,s=!0){Reflect.defineProperty(i,e,{value:t,enumerable:!1,writable:s})}class W extends f.SubscriberSet{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.sorts=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this._sortObserver=void 0,this.call=this.flush,y(e,"$fastController",this)}get strategy(){return this._strategy}set strategy(e){this._strategy=e}get lengthObserver(){let e=this._lengthObserver;if(e===void 0){const t=this.subject;this._lengthObserver=e={length:t.length,handleChange(){this.length!==t.length&&(this.length=t.length,f.Observable.notify(e,"length"))}},this.subscribe(e)}return e}get sortObserver(){let e=this._sortObserver;if(e===void 0){const t=this.subject;this._sortObserver=e={sorted:t.sorted,handleChange(){this.sorted!==t.sorted&&(this.sorted=t.sorted,f.Observable.notify(e,"sorted"))}},this.subscribe(e)}return e}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){this.splices===void 0?this.splices=[e]:this.splices.push(e),this.enqueue()}addSort(e){this.sorts===void 0?this.sorts=[e]:this.sorts.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.sorts,o=this.oldCollection;t===void 0&&o===void 0&&s===void 0||(this.needsQueue=!0,this.splices=void 0,this.sorts=void 0,this.oldCollection=void 0,s!==void 0?this.notify(s):this.notify(((e=this._strategy)!==null&&e!==void 0?e:z).normalize(o,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,f.Updates.enqueue(this))}}let B=!1;const F=Object.freeze({sorted:0,enable(){if(B)return;B=!0,f.Observable.setArrayObserverFactory(e=>new W(e));const i=Array.prototype;i.$fastPatch||(y(i,"$fastPatch",1),y(i,"sorted",0),[i.pop,i.push,i.reverse,i.shift,i.sort,i.splice,i.unshift].forEach(e=>{i[e.name]=function(...t){var s;const o=this.$fastController;return o===void 0?e.apply(this,t):((s=o.strategy)!==null&&s!==void 0?s:z)[e.name](this,o,e,t)}}))}}),N=Object.freeze({positioning:!1,recycle:!0});function U(i,e,t,s){i.context.parent=s.source,i.context.parentContext=s.context,i.bind(e[t])}function X(i,e,t,s){i.context.parent=s.source,i.context.parentContext=s.context,i.context.length=e.length,i.context.index=t,i.bind(e[t])}function M(i){return i.nodeType===Node.COMMENT_NODE}class A extends Error{constructor(e,t){super(e),this.propertyBag=t}}class G{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=U,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=X)}bind(e){this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.items=this.itemsBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),this.observeItems(!0),f.isHydratable(this.template)&&f.isHydratable(e)&&e.hydrationStage!==f.HydrationStage.hydrated?this.hydrateViews(this.template):this.refreshAllViews(),e.onUnbind(this)}unbind(){this.itemsObserver!==null&&this.itemsObserver.unsubscribe(this),this.unbindAllViews()}handleChange(e,t){if(t===this.itemsBindingObserver)this.items=this.itemsBindingObserver.bind(this.controller),this.observeItems(),this.refreshAllViews();else if(t===this.templateBindingObserver)this.template=this.templateBindingObserver.bind(this.controller),this.refreshAllViews(!0);else if(t[0])t[0].reset?this.refreshAllViews():t[0].sorted?this.updateSortedViews(t):this.updateSplicedViews(t);else return}observeItems(e=!1){if(!this.items){this.items=f.emptyArray;return}const t=this.itemsObserver,s=this.itemsObserver=f.Observable.getNotifier(this.items),o=t!==s;o&&t!==null&&t.unsubscribe(this),(o||e)&&s.subscribe(this)}updateSortedViews(e){const t=this.views;for(let s=0,o=e.length;s<o;++s){const n=e[s].sorted.slice(),l=n.slice().sort();for(let h=0,d=n.length;h<d;++h){const a=n.find(c=>n[h]===l[c]);if(a!==h){const c=l.splice(a,1);l.splice(h,0,...c);const r=t[h],u=r?r.firstChild:this.location;t[a].remove(),t[a].insertBefore(u);const p=t.splice(a,1);t.splice(h,0,...p)}}}}updateSplicedViews(e){const t=this.views,s=this.bindView,o=this.items,n=this.template,l=this.controller,h=this.directive.options.recycle,d=[];let a=0,c=0;for(let r=0,u=e.length;r<u;++r){const p=e[r],g=p.removed;let w=0,m=p.index;const R=m+p.addedCount,x=t.splice(p.index,g.length),k=c=d.length+x.length;for(;m<R;++m){const C=t[m],I=C?C.firstChild:this.location;let b;h&&c>0?(w<=k&&x.length>0?(b=x[w],w++):(b=d[a],a++),c--):b=n.create(),t.splice(m,0,b),s(b,o,m,l),b.insertBefore(I)}x[w]&&d.push(...x.slice(w))}for(let r=a,u=d.length;r<u;++r)d[r].dispose();if(this.directive.options.positioning)for(let r=0,u=t.length;r<u;++r){const p=t[r].context;p.length=u,p.index=r}}refreshAllViews(e=!1){const t=this.items,s=this.template,o=this.location,n=this.bindView,l=this.controller;let h=t.length,d=this.views,a=d.length;if((h===0||e||!this.directive.options.recycle)&&(f.HTMLView.disposeContiguousBatch(d),a=0),a===0){this.views=d=new Array(h);for(let c=0;c<h;++c){const r=s.create();n(r,t,c,l),d[c]=r,r.insertBefore(o)}}else{let c=0;for(;c<h;++c)if(c<a){const u=d[c];if(!u){const p=new XMLSerializer;throw new A(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:c,hydrationStage:this.controller.hydrationStage,itemsLength:h,viewsState:d.map(g=>g?"hydrated":"empty"),viewTemplateString:p.serializeToString(s.create().fragment),rootNodeContent:p.serializeToString(this.location.getRootNode())})}n(u,t,c,l)}else{const u=s.create();n(u,t,c,l),d.push(u),u.insertBefore(o)}const r=d.splice(c,a-c);for(c=0,h=r.length;c<h;++c)r[c].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,s=e.length;t<s;++t){const o=e[t];if(!o){const n=new XMLSerializer;throw new A(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:t,hydrationStage:this.controller.hydrationStage,viewsState:e.map(l=>l?"hydrated":"empty"),rootNodeContent:n.serializeToString(this.location.getRootNode())})}o.unbind()}}hydrateViews(e){if(!this.items)return;this.views=new Array(this.items.length);let t=this.location.previousSibling;for(;t!==null;){if(!M(t)){t=t.previousSibling;continue}const s=f.HydrationMarkup.parseRepeatEndMarker(t.data);if(s===null){t=t.previousSibling;continue}t.data="";const o=t.previousSibling;if(!o)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": end should never be null.`);let n=o,l=0;for(;n!==null;){if(M(n)){if(f.HydrationMarkup.isRepeatViewEndMarker(n.data))l++;else if(f.HydrationMarkup.isRepeatViewStartMarker(n.data))if(l)l--;else{if(f.HydrationMarkup.parseRepeatStartMarker(n.data)!==s)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": Mismatched start and end markers.`);n.data="",t=n.previousSibling,n=n.nextSibling;const h=e.hydrate(n,o);this.views[s]=h,this.bindView(h,this.items,s,this.controller);break}}n=n.previousSibling}if(!n)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": start should never be null.`)}}}class O{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,F.enable()}createHTML(e){return f.Markup.comment(e(this))}createBehavior(){return new G(this)}}f.HTMLDirective.define(O);function J(i,e,t=N){const s=V.normalizeBinding(i),o=V.normalizeBinding(e);return new O(s,o,Object.assign(Object.assign({},N),t))}exports.RepeatDirective=O;exports.repeat=J;
|