@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/repeat.js
CHANGED
|
@@ -1,341 +1,567 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { O as y, l as $, U as H, e as O, M as E, m as S, p as q, q as D, t as x, H as P } from "./vivid-element.js";
|
|
2
|
+
import { n as B } from "./normalize.js";
|
|
3
|
+
class p {
|
|
4
|
+
/**
|
|
5
|
+
* Creates a splice.
|
|
6
|
+
* @param index - The index that the splice occurs at.
|
|
7
|
+
* @param removed - The items that were removed.
|
|
8
|
+
* @param addedCount - The number of items that were added.
|
|
9
|
+
*/
|
|
10
|
+
constructor(e, t, s) {
|
|
11
|
+
this.index = e, this.removed = t, this.addedCount = s;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Adjusts the splice index based on the provided array.
|
|
15
|
+
* @param array - The array to adjust to.
|
|
16
|
+
* @returns The same splice, mutated based on the reference array.
|
|
17
|
+
*/
|
|
18
|
+
adjustTo(e) {
|
|
19
|
+
let t = this.index;
|
|
20
|
+
const s = e.length;
|
|
21
|
+
return t > s ? t = s - this.addedCount : t < 0 && (t = s + this.removed.length + t - this.addedCount), this.index = t < 0 ? 0 : t, this;
|
|
22
|
+
}
|
|
8
23
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
for (let l = 1; l < c; ++l)
|
|
18
|
-
for (let u = 1; u < f; ++u)
|
|
19
|
-
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);
|
|
20
|
-
return n;
|
|
24
|
+
class N {
|
|
25
|
+
/**
|
|
26
|
+
* Creates a sort update.
|
|
27
|
+
* @param sorted - The updated index of sorted items.
|
|
28
|
+
*/
|
|
29
|
+
constructor(e) {
|
|
30
|
+
this.sorted = e;
|
|
31
|
+
}
|
|
21
32
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
33
|
+
const Q = Object.freeze({
|
|
34
|
+
/**
|
|
35
|
+
* Only supports resets.
|
|
36
|
+
*/
|
|
37
|
+
reset: 1,
|
|
38
|
+
/**
|
|
39
|
+
* Supports tracking splices and resets.
|
|
40
|
+
*/
|
|
41
|
+
splice: 2,
|
|
42
|
+
/**
|
|
43
|
+
* Supports tracking splices and resets, while applying some form
|
|
44
|
+
* of optimization, such as merging, to the splices.
|
|
45
|
+
*/
|
|
46
|
+
optimized: 3
|
|
47
|
+
}), z = new p(0, O, 0);
|
|
48
|
+
z.reset = !0;
|
|
49
|
+
const U = [z];
|
|
50
|
+
function W(i, e, t, s, o, n) {
|
|
51
|
+
const l = n - o + 1, h = t - e + 1, d = new Array(l);
|
|
52
|
+
let a, c;
|
|
53
|
+
for (let r = 0; r < l; ++r)
|
|
54
|
+
d[r] = new Array(h), d[r][0] = r;
|
|
55
|
+
for (let r = 0; r < h; ++r)
|
|
56
|
+
d[0][r] = r;
|
|
57
|
+
for (let r = 1; r < l; ++r)
|
|
58
|
+
for (let u = 1; u < h; ++u)
|
|
59
|
+
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);
|
|
60
|
+
return d;
|
|
61
|
+
}
|
|
62
|
+
function F(i) {
|
|
63
|
+
let e = i.length - 1, t = i[0].length - 1, s = i[e][t];
|
|
64
|
+
const o = [];
|
|
25
65
|
for (; e > 0 || t > 0; ) {
|
|
26
66
|
if (e === 0) {
|
|
27
|
-
|
|
67
|
+
o.push(
|
|
68
|
+
2
|
|
69
|
+
/* Edit.add */
|
|
70
|
+
), t--;
|
|
28
71
|
continue;
|
|
29
72
|
}
|
|
30
73
|
if (t === 0) {
|
|
31
|
-
|
|
74
|
+
o.push(
|
|
75
|
+
3
|
|
76
|
+
/* Edit.delete */
|
|
77
|
+
), e--;
|
|
32
78
|
continue;
|
|
33
79
|
}
|
|
34
|
-
const
|
|
35
|
-
let
|
|
36
|
-
|
|
80
|
+
const n = i[e - 1][t - 1], l = i[e - 1][t], h = i[e][t - 1];
|
|
81
|
+
let d;
|
|
82
|
+
l < h ? d = l < n ? l : n : d = h < n ? h : n, d === n ? (n === s ? o.push(
|
|
83
|
+
0
|
|
84
|
+
/* Edit.leave */
|
|
85
|
+
) : (o.push(
|
|
86
|
+
1
|
|
87
|
+
/* Edit.update */
|
|
88
|
+
), s = n), e--, t--) : d === l ? (o.push(
|
|
89
|
+
3
|
|
90
|
+
/* Edit.delete */
|
|
91
|
+
), e--, s = l) : (o.push(
|
|
92
|
+
2
|
|
93
|
+
/* Edit.add */
|
|
94
|
+
), t--, s = h);
|
|
37
95
|
}
|
|
38
|
-
return
|
|
96
|
+
return o.reverse();
|
|
39
97
|
}
|
|
40
|
-
function
|
|
41
|
-
for (let
|
|
42
|
-
if (i[
|
|
43
|
-
return
|
|
98
|
+
function X(i, e, t) {
|
|
99
|
+
for (let s = 0; s < t; ++s)
|
|
100
|
+
if (i[s] !== e[s])
|
|
101
|
+
return s;
|
|
44
102
|
return t;
|
|
45
103
|
}
|
|
46
|
-
function
|
|
47
|
-
let
|
|
48
|
-
for (;
|
|
49
|
-
|
|
50
|
-
return
|
|
104
|
+
function G(i, e, t) {
|
|
105
|
+
let s = i.length, o = e.length, n = 0;
|
|
106
|
+
for (; n < t && i[--s] === e[--o]; )
|
|
107
|
+
n++;
|
|
108
|
+
return n;
|
|
51
109
|
}
|
|
52
|
-
function
|
|
53
|
-
return e < t ||
|
|
110
|
+
function J(i, e, t, s) {
|
|
111
|
+
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;
|
|
54
112
|
}
|
|
55
|
-
function
|
|
56
|
-
let
|
|
57
|
-
const
|
|
58
|
-
if (e === 0 &&
|
|
59
|
-
return
|
|
113
|
+
function K(i, e, t, s, o, n) {
|
|
114
|
+
let l = 0, h = 0;
|
|
115
|
+
const d = Math.min(t - e, n - o);
|
|
116
|
+
if (e === 0 && o === 0 && (l = X(i, s, d)), t === i.length && n === s.length && (h = G(i, s, d - l)), e += l, o += l, t -= h, n -= h, t - e === 0 && n - o === 0)
|
|
117
|
+
return O;
|
|
60
118
|
if (e === t) {
|
|
61
|
-
const v = p(e, [], 0);
|
|
62
|
-
for (;
|
|
63
|
-
v.removed.push(o
|
|
119
|
+
const v = new p(e, [], 0);
|
|
120
|
+
for (; o < n; )
|
|
121
|
+
v.removed.push(s[o++]);
|
|
64
122
|
return [v];
|
|
65
|
-
} else if (
|
|
66
|
-
return [p(e, [], t - e)];
|
|
67
|
-
const
|
|
68
|
-
let
|
|
69
|
-
for (let v = 0; v <
|
|
70
|
-
switch (
|
|
71
|
-
case
|
|
72
|
-
|
|
123
|
+
} else if (o === n)
|
|
124
|
+
return [new p(e, [], t - e)];
|
|
125
|
+
const a = F(W(i, e, t, s, o, n)), c = [];
|
|
126
|
+
let r, u = e, f = o;
|
|
127
|
+
for (let v = 0; v < a.length; ++v)
|
|
128
|
+
switch (a[v]) {
|
|
129
|
+
case 0:
|
|
130
|
+
r !== void 0 && (c.push(r), r = void 0), u++, f++;
|
|
73
131
|
break;
|
|
74
|
-
case
|
|
75
|
-
|
|
132
|
+
case 1:
|
|
133
|
+
r === void 0 && (r = new p(u, [], 0)), r.addedCount++, u++, r.removed.push(s[f]), f++;
|
|
76
134
|
break;
|
|
77
|
-
case
|
|
78
|
-
|
|
135
|
+
case 2:
|
|
136
|
+
r === void 0 && (r = new p(u, [], 0)), r.addedCount++, u++;
|
|
79
137
|
break;
|
|
80
|
-
case
|
|
81
|
-
|
|
138
|
+
case 3:
|
|
139
|
+
r === void 0 && (r = new p(u, [], 0)), r.removed.push(s[f]), f++;
|
|
82
140
|
break;
|
|
83
141
|
}
|
|
84
|
-
return
|
|
142
|
+
return r !== void 0 && c.push(r), c;
|
|
85
143
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const n = i[f];
|
|
92
|
-
if (n.index += c, d)
|
|
144
|
+
function Y(i, e) {
|
|
145
|
+
let t = !1, s = 0;
|
|
146
|
+
for (let o = 0; o < e.length; o++) {
|
|
147
|
+
const n = e[o];
|
|
148
|
+
if (n.index += s, t)
|
|
93
149
|
continue;
|
|
94
|
-
const
|
|
95
|
-
if (
|
|
96
|
-
|
|
97
|
-
const h =
|
|
98
|
-
if (!
|
|
99
|
-
|
|
150
|
+
const l = J(i.index, i.index + i.removed.length, n.index, n.index + n.addedCount);
|
|
151
|
+
if (l >= 0) {
|
|
152
|
+
e.splice(o, 1), o--, s -= n.addedCount - n.removed.length, i.addedCount += n.addedCount - l;
|
|
153
|
+
const h = i.removed.length + n.removed.length - l;
|
|
154
|
+
if (!i.addedCount && !h)
|
|
155
|
+
t = !0;
|
|
100
156
|
else {
|
|
101
|
-
let
|
|
102
|
-
if (
|
|
103
|
-
const
|
|
104
|
-
|
|
157
|
+
let d = n.removed;
|
|
158
|
+
if (i.index < n.index) {
|
|
159
|
+
const a = i.removed.slice(0, n.index - i.index);
|
|
160
|
+
a.push(...d), d = a;
|
|
105
161
|
}
|
|
106
|
-
if (
|
|
107
|
-
const
|
|
108
|
-
|
|
162
|
+
if (i.index + i.removed.length > n.index + n.addedCount) {
|
|
163
|
+
const a = i.removed.slice(n.index + n.addedCount - i.index);
|
|
164
|
+
d.push(...a);
|
|
109
165
|
}
|
|
110
|
-
|
|
166
|
+
i.removed = d, n.index < i.index && (i.index = n.index);
|
|
111
167
|
}
|
|
112
|
-
} else if (
|
|
113
|
-
|
|
114
|
-
const h =
|
|
115
|
-
n.index += h,
|
|
168
|
+
} else if (i.index < n.index) {
|
|
169
|
+
t = !0, e.splice(o, 0, i), o++;
|
|
170
|
+
const h = i.addedCount - i.removed.length;
|
|
171
|
+
n.index += h, s += h;
|
|
116
172
|
}
|
|
117
173
|
}
|
|
118
|
-
|
|
174
|
+
t || e.push(i);
|
|
119
175
|
}
|
|
120
|
-
function
|
|
121
|
-
const e = [];
|
|
122
|
-
for (let t = 0, o = i.length; t < o; t++) {
|
|
123
|
-
const s = i[t];
|
|
124
|
-
F(e, s.index, s.removed, s.addedCount);
|
|
125
|
-
}
|
|
126
|
-
return e;
|
|
127
|
-
}
|
|
128
|
-
function z(i, e) {
|
|
176
|
+
function Z(i, e) {
|
|
129
177
|
let t = [];
|
|
130
|
-
const
|
|
131
|
-
for (let
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
178
|
+
const s = [];
|
|
179
|
+
for (let o = 0, n = e.length; o < n; o++)
|
|
180
|
+
Y(e[o], s);
|
|
181
|
+
for (let o = 0, n = s.length; o < n; ++o) {
|
|
182
|
+
const l = s[o];
|
|
183
|
+
if (l.addedCount === 1 && l.removed.length === 1) {
|
|
184
|
+
l.removed[0] !== i[l.index] && t.push(l);
|
|
135
185
|
continue;
|
|
136
186
|
}
|
|
137
|
-
t = t.concat(
|
|
187
|
+
t = t.concat(K(i, l.index, l.index + l.addedCount, l.removed, 0, l.removed.length));
|
|
138
188
|
}
|
|
139
189
|
return t;
|
|
140
190
|
}
|
|
141
|
-
let I =
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
191
|
+
let I = Object.freeze({
|
|
192
|
+
support: Q.optimized,
|
|
193
|
+
normalize(i, e, t) {
|
|
194
|
+
return i === void 0 ? t === void 0 ? O : Z(e, t) : U;
|
|
195
|
+
},
|
|
196
|
+
pop(i, e, t, s) {
|
|
197
|
+
const o = i.length > 0, n = t.apply(i, s);
|
|
198
|
+
return o && e.addSplice(new p(i.length, [n], 0)), n;
|
|
199
|
+
},
|
|
200
|
+
push(i, e, t, s) {
|
|
201
|
+
const o = t.apply(i, s);
|
|
202
|
+
return e.addSplice(new p(i.length - s.length, [], s.length).adjustTo(i)), o;
|
|
203
|
+
},
|
|
204
|
+
reverse(i, e, t, s) {
|
|
205
|
+
const o = t.apply(i, s);
|
|
206
|
+
i.sorted++;
|
|
207
|
+
const n = [];
|
|
208
|
+
for (let l = i.length - 1; l >= 0; l--)
|
|
209
|
+
n.push(l);
|
|
210
|
+
return e.addSort(new N(n)), o;
|
|
211
|
+
},
|
|
212
|
+
shift(i, e, t, s) {
|
|
213
|
+
const o = i.length > 0, n = t.apply(i, s);
|
|
214
|
+
return o && e.addSplice(new p(0, [n], 0)), n;
|
|
215
|
+
},
|
|
216
|
+
sort(i, e, t, s) {
|
|
217
|
+
const o = /* @__PURE__ */ new Map();
|
|
218
|
+
for (let h = 0, d = i.length; h < d; ++h) {
|
|
219
|
+
const a = o.get(i[h]) || [];
|
|
220
|
+
o.set(i[h], [...a, h]);
|
|
221
|
+
}
|
|
222
|
+
const n = t.apply(i, s);
|
|
223
|
+
i.sorted++;
|
|
224
|
+
const l = [];
|
|
225
|
+
for (let h = 0, d = i.length; h < d; ++h) {
|
|
226
|
+
const a = o.get(i[h]);
|
|
227
|
+
l.push(a[0]), o.set(i[h], a.splice(1));
|
|
228
|
+
}
|
|
229
|
+
return e.addSort(new N(l)), n;
|
|
230
|
+
},
|
|
231
|
+
splice(i, e, t, s) {
|
|
232
|
+
const o = t.apply(i, s);
|
|
233
|
+
return e.addSplice(new p(+s[0], o, s.length > 2 ? s.length - 2 : 0).adjustTo(i)), o;
|
|
234
|
+
},
|
|
235
|
+
unshift(i, e, t, s) {
|
|
236
|
+
const o = t.apply(i, s);
|
|
237
|
+
return e.addSplice(new p(0, [], s.length).adjustTo(i)), o;
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
function C(i, e, t, s = !0) {
|
|
241
|
+
Reflect.defineProperty(i, e, {
|
|
242
|
+
value: t,
|
|
243
|
+
enumerable: !1,
|
|
244
|
+
writable: s
|
|
245
|
+
});
|
|
146
246
|
}
|
|
147
|
-
class
|
|
247
|
+
class ee extends $ {
|
|
148
248
|
constructor(e) {
|
|
149
|
-
super(e), this.oldCollection = void 0, this.splices = void 0, this.needsQueue = !0, this.call = this.flush,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
249
|
+
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, C(e, "$fastController", this);
|
|
250
|
+
}
|
|
251
|
+
get strategy() {
|
|
252
|
+
return this._strategy;
|
|
253
|
+
}
|
|
254
|
+
set strategy(e) {
|
|
255
|
+
this._strategy = e;
|
|
256
|
+
}
|
|
257
|
+
get lengthObserver() {
|
|
258
|
+
let e = this._lengthObserver;
|
|
259
|
+
if (e === void 0) {
|
|
260
|
+
const t = this.subject;
|
|
261
|
+
this._lengthObserver = e = {
|
|
262
|
+
length: t.length,
|
|
263
|
+
handleChange() {
|
|
264
|
+
this.length !== t.length && (this.length = t.length, y.notify(e, "length"));
|
|
265
|
+
}
|
|
266
|
+
}, this.subscribe(e);
|
|
267
|
+
}
|
|
268
|
+
return e;
|
|
269
|
+
}
|
|
270
|
+
get sortObserver() {
|
|
271
|
+
let e = this._sortObserver;
|
|
272
|
+
if (e === void 0) {
|
|
273
|
+
const t = this.subject;
|
|
274
|
+
this._sortObserver = e = {
|
|
275
|
+
sorted: t.sorted,
|
|
276
|
+
handleChange() {
|
|
277
|
+
this.sorted !== t.sorted && (this.sorted = t.sorted, y.notify(e, "sorted"));
|
|
278
|
+
}
|
|
279
|
+
}, this.subscribe(e);
|
|
280
|
+
}
|
|
281
|
+
return e;
|
|
153
282
|
}
|
|
154
283
|
subscribe(e) {
|
|
155
284
|
this.flush(), super.subscribe(e);
|
|
156
285
|
}
|
|
157
286
|
addSplice(e) {
|
|
158
|
-
this.splices === void 0 ? this.splices = [e] : this.splices.push(e), this.
|
|
287
|
+
this.splices === void 0 ? this.splices = [e] : this.splices.push(e), this.enqueue();
|
|
288
|
+
}
|
|
289
|
+
addSort(e) {
|
|
290
|
+
this.sorts === void 0 ? this.sorts = [e] : this.sorts.push(e), this.enqueue();
|
|
159
291
|
}
|
|
160
292
|
reset(e) {
|
|
161
|
-
this.oldCollection = e, this.
|
|
293
|
+
this.oldCollection = e, this.enqueue();
|
|
162
294
|
}
|
|
163
295
|
flush() {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
this.
|
|
296
|
+
var e;
|
|
297
|
+
const t = this.splices, s = this.sorts, o = this.oldCollection;
|
|
298
|
+
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 : I).normalize(o, this.subject, t)));
|
|
299
|
+
}
|
|
300
|
+
enqueue() {
|
|
301
|
+
this.needsQueue && (this.needsQueue = !1, H.enqueue(this));
|
|
170
302
|
}
|
|
171
303
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
return r !== void 0 && r.reset(n), h;
|
|
205
|
-
}, i.splice = function() {
|
|
206
|
-
const n = c.apply(this, arguments), r = this.$fastController;
|
|
207
|
-
return r !== void 0 && r.addSplice(w(p(+arguments[0], n, arguments.length > 2 ? arguments.length - 2 : 0), this)), n;
|
|
208
|
-
}, i.unshift = function() {
|
|
209
|
-
const n = f.apply(this, arguments), r = this.$fastController;
|
|
210
|
-
return r !== void 0 && r.addSplice(w(p(0, [], arguments.length), this)), n;
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
const D = Object.freeze({
|
|
304
|
+
let j = !1;
|
|
305
|
+
const te = Object.freeze({
|
|
306
|
+
sorted: 0,
|
|
307
|
+
/**
|
|
308
|
+
* Enables the array observation mechanism.
|
|
309
|
+
* @remarks
|
|
310
|
+
* Array observation is enabled automatically when using the
|
|
311
|
+
* {@link RepeatDirective}, so calling this API manually is
|
|
312
|
+
* not typically necessary.
|
|
313
|
+
*/
|
|
314
|
+
enable() {
|
|
315
|
+
if (j)
|
|
316
|
+
return;
|
|
317
|
+
j = !0, y.setArrayObserverFactory((e) => new ee(e));
|
|
318
|
+
const i = Array.prototype;
|
|
319
|
+
i.$fastPatch || (C(i, "$fastPatch", 1), C(i, "sorted", 0), [
|
|
320
|
+
i.pop,
|
|
321
|
+
i.push,
|
|
322
|
+
i.reverse,
|
|
323
|
+
i.shift,
|
|
324
|
+
i.sort,
|
|
325
|
+
i.splice,
|
|
326
|
+
i.unshift
|
|
327
|
+
].forEach((e) => {
|
|
328
|
+
i[e.name] = function(...t) {
|
|
329
|
+
var s;
|
|
330
|
+
const o = this.$fastController;
|
|
331
|
+
return o === void 0 ? e.apply(this, t) : ((s = o.strategy) !== null && s !== void 0 ? s : I)[e.name](this, o, e, t);
|
|
332
|
+
};
|
|
333
|
+
}));
|
|
334
|
+
}
|
|
335
|
+
}), M = Object.freeze({
|
|
214
336
|
positioning: !1,
|
|
215
337
|
recycle: !0
|
|
216
338
|
});
|
|
217
|
-
function
|
|
218
|
-
i.bind(e[t]
|
|
339
|
+
function ie(i, e, t, s) {
|
|
340
|
+
i.context.parent = s.source, i.context.parentContext = s.context, i.bind(e[t]);
|
|
219
341
|
}
|
|
220
|
-
function
|
|
221
|
-
|
|
222
|
-
s.index = t, s.length = e.length, i.bind(e[t], s);
|
|
342
|
+
function se(i, e, t, s) {
|
|
343
|
+
i.context.parent = s.source, i.context.parentContext = s.context, i.context.length = e.length, i.context.index = t, i.bind(e[t]);
|
|
223
344
|
}
|
|
224
|
-
|
|
345
|
+
function R(i) {
|
|
346
|
+
return i.nodeType === Node.COMMENT_NODE;
|
|
347
|
+
}
|
|
348
|
+
class A extends Error {
|
|
349
|
+
constructor(e, t) {
|
|
350
|
+
super(e), this.propertyBag = t;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
class ne {
|
|
225
354
|
/**
|
|
226
355
|
* Creates an instance of RepeatBehavior.
|
|
227
356
|
* @param location - The location in the DOM to render the repeat.
|
|
228
|
-
* @param
|
|
357
|
+
* @param dataBinding - The array to render.
|
|
229
358
|
* @param isItemsBindingVolatile - Indicates whether the items binding has volatile dependencies.
|
|
230
359
|
* @param templateBinding - The template to render for each item.
|
|
231
360
|
* @param isTemplateBindingVolatile - Indicates whether the template binding has volatile dependencies.
|
|
232
361
|
* @param options - Options used to turn on special repeat features.
|
|
233
362
|
*/
|
|
234
|
-
constructor(e
|
|
235
|
-
this.
|
|
363
|
+
constructor(e) {
|
|
364
|
+
this.directive = e, this.items = null, this.itemsObserver = null, this.bindView = ie, this.views = [], this.itemsBindingObserver = e.dataBinding.createObserver(this, e), this.templateBindingObserver = e.templateBinding.createObserver(this, e), e.options.positioning && (this.bindView = se);
|
|
236
365
|
}
|
|
237
366
|
/**
|
|
238
|
-
* Bind this behavior
|
|
239
|
-
* @param
|
|
240
|
-
* @param context - The execution context that the binding is operating within.
|
|
367
|
+
* Bind this behavior.
|
|
368
|
+
* @param controller - The view controller that manages the lifecycle of this behavior.
|
|
241
369
|
*/
|
|
242
|
-
bind(e
|
|
243
|
-
this.
|
|
370
|
+
bind(e) {
|
|
371
|
+
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), S(this.template) && S(e) && e.hydrationStage !== q.hydrated ? this.hydrateViews(this.template) : this.refreshAllViews(), e.onUnbind(this);
|
|
244
372
|
}
|
|
245
373
|
/**
|
|
246
|
-
* Unbinds this behavior
|
|
247
|
-
* @param source - The source to unbind from.
|
|
374
|
+
* Unbinds this behavior.
|
|
248
375
|
*/
|
|
249
376
|
unbind() {
|
|
250
|
-
this.
|
|
377
|
+
this.itemsObserver !== null && this.itemsObserver.unsubscribe(this), this.unbindAllViews();
|
|
251
378
|
}
|
|
252
|
-
/**
|
|
379
|
+
/**
|
|
380
|
+
* Handles changes in the array, its items, and the repeat template.
|
|
381
|
+
* @param source - The source of the change.
|
|
382
|
+
* @param args - The details about what was changed.
|
|
383
|
+
*/
|
|
253
384
|
handleChange(e, t) {
|
|
254
|
-
|
|
385
|
+
if (t === this.itemsBindingObserver)
|
|
386
|
+
this.items = this.itemsBindingObserver.bind(this.controller), this.observeItems(), this.refreshAllViews();
|
|
387
|
+
else if (t === this.templateBindingObserver)
|
|
388
|
+
this.template = this.templateBindingObserver.bind(this.controller), this.refreshAllViews(!0);
|
|
389
|
+
else if (t[0])
|
|
390
|
+
t[0].reset ? this.refreshAllViews() : t[0].sorted ? this.updateSortedViews(t) : this.updateSplicedViews(t);
|
|
391
|
+
else return;
|
|
255
392
|
}
|
|
256
393
|
observeItems(e = !1) {
|
|
257
394
|
if (!this.items) {
|
|
258
|
-
this.items =
|
|
395
|
+
this.items = O;
|
|
259
396
|
return;
|
|
260
397
|
}
|
|
261
|
-
const t = this.itemsObserver,
|
|
262
|
-
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
const t = this.
|
|
266
|
-
let
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
398
|
+
const t = this.itemsObserver, s = this.itemsObserver = y.getNotifier(this.items), o = t !== s;
|
|
399
|
+
o && t !== null && t.unsubscribe(this), (o || e) && s.subscribe(this);
|
|
400
|
+
}
|
|
401
|
+
updateSortedViews(e) {
|
|
402
|
+
const t = this.views;
|
|
403
|
+
for (let s = 0, o = e.length; s < o; ++s) {
|
|
404
|
+
const n = e[s].sorted.slice(), l = n.slice().sort();
|
|
405
|
+
for (let h = 0, d = n.length; h < d; ++h) {
|
|
406
|
+
const a = n.find((c) => n[h] === l[c]);
|
|
407
|
+
if (a !== h) {
|
|
408
|
+
const c = l.splice(a, 1);
|
|
409
|
+
l.splice(h, 0, ...c);
|
|
410
|
+
const r = t[h], u = r ? r.firstChild : this.location;
|
|
411
|
+
t[a].remove(), t[a].insertBefore(u);
|
|
412
|
+
const f = t.splice(a, 1);
|
|
413
|
+
t.splice(h, 0, ...f);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
updateSplicedViews(e) {
|
|
419
|
+
const t = this.views, s = this.bindView, o = this.items, n = this.template, l = this.controller, h = this.directive.options.recycle, d = [];
|
|
420
|
+
let a = 0, c = 0;
|
|
421
|
+
for (let r = 0, u = e.length; r < u; ++r) {
|
|
422
|
+
const f = e[r], v = f.removed;
|
|
423
|
+
let b = 0, g = f.index;
|
|
424
|
+
const T = g + f.addedCount, w = t.splice(f.index, v.length), _ = c = d.length + w.length;
|
|
425
|
+
for (; g < T; ++g) {
|
|
426
|
+
const V = t[g], L = V ? V.firstChild : this.location;
|
|
427
|
+
let m;
|
|
428
|
+
h && c > 0 ? (b <= _ && w.length > 0 ? (m = w[b], b++) : (m = d[a], a++), c--) : m = n.create(), t.splice(g, 0, m), s(m, o, g, l), m.insertBefore(L);
|
|
275
429
|
}
|
|
276
|
-
|
|
430
|
+
w[b] && d.push(...w.slice(b));
|
|
277
431
|
}
|
|
278
|
-
for (let
|
|
279
|
-
|
|
280
|
-
if (this.options.positioning)
|
|
281
|
-
for (let
|
|
282
|
-
const
|
|
283
|
-
|
|
432
|
+
for (let r = a, u = d.length; r < u; ++r)
|
|
433
|
+
d[r].dispose();
|
|
434
|
+
if (this.directive.options.positioning)
|
|
435
|
+
for (let r = 0, u = t.length; r < u; ++r) {
|
|
436
|
+
const f = t[r].context;
|
|
437
|
+
f.length = u, f.index = r;
|
|
284
438
|
}
|
|
285
439
|
}
|
|
286
440
|
refreshAllViews(e = !1) {
|
|
287
|
-
const t = this.items,
|
|
288
|
-
let
|
|
289
|
-
if ((
|
|
290
|
-
this.views =
|
|
291
|
-
for (let
|
|
292
|
-
const
|
|
293
|
-
|
|
441
|
+
const t = this.items, s = this.template, o = this.location, n = this.bindView, l = this.controller;
|
|
442
|
+
let h = t.length, d = this.views, a = d.length;
|
|
443
|
+
if ((h === 0 || e || !this.directive.options.recycle) && (D.disposeContiguousBatch(d), a = 0), a === 0) {
|
|
444
|
+
this.views = d = new Array(h);
|
|
445
|
+
for (let c = 0; c < h; ++c) {
|
|
446
|
+
const r = s.create();
|
|
447
|
+
n(r, t, c, l), d[c] = r, r.insertBefore(o);
|
|
294
448
|
}
|
|
295
449
|
} else {
|
|
296
|
-
let
|
|
297
|
-
for (;
|
|
298
|
-
if (
|
|
299
|
-
const u =
|
|
300
|
-
|
|
450
|
+
let c = 0;
|
|
451
|
+
for (; c < h; ++c)
|
|
452
|
+
if (c < a) {
|
|
453
|
+
const u = d[c];
|
|
454
|
+
if (!u) {
|
|
455
|
+
const f = new XMLSerializer();
|
|
456
|
+
throw new A(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`, {
|
|
457
|
+
index: c,
|
|
458
|
+
hydrationStage: this.controller.hydrationStage,
|
|
459
|
+
itemsLength: h,
|
|
460
|
+
viewsState: d.map((v) => v ? "hydrated" : "empty"),
|
|
461
|
+
viewTemplateString: f.serializeToString(s.create().fragment),
|
|
462
|
+
rootNodeContent: f.serializeToString(this.location.getRootNode())
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
n(u, t, c, l);
|
|
301
466
|
} else {
|
|
302
467
|
const u = s.create();
|
|
303
|
-
|
|
468
|
+
n(u, t, c, l), d.push(u), u.insertBefore(o);
|
|
304
469
|
}
|
|
305
|
-
const
|
|
306
|
-
for (
|
|
307
|
-
|
|
470
|
+
const r = d.splice(c, a - c);
|
|
471
|
+
for (c = 0, h = r.length; c < h; ++c)
|
|
472
|
+
r[c].dispose();
|
|
308
473
|
}
|
|
309
474
|
}
|
|
310
475
|
unbindAllViews() {
|
|
311
476
|
const e = this.views;
|
|
312
|
-
for (let t = 0,
|
|
313
|
-
e[t]
|
|
477
|
+
for (let t = 0, s = e.length; t < s; ++t) {
|
|
478
|
+
const o = e[t];
|
|
479
|
+
if (!o) {
|
|
480
|
+
const n = new XMLSerializer();
|
|
481
|
+
throw new A(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`, {
|
|
482
|
+
index: t,
|
|
483
|
+
hydrationStage: this.controller.hydrationStage,
|
|
484
|
+
viewsState: e.map((l) => l ? "hydrated" : "empty"),
|
|
485
|
+
rootNodeContent: n.serializeToString(this.location.getRootNode())
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
o.unbind();
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
hydrateViews(e) {
|
|
492
|
+
if (!this.items)
|
|
493
|
+
return;
|
|
494
|
+
this.views = new Array(this.items.length);
|
|
495
|
+
let t = this.location.previousSibling;
|
|
496
|
+
for (; t !== null; ) {
|
|
497
|
+
if (!R(t)) {
|
|
498
|
+
t = t.previousSibling;
|
|
499
|
+
continue;
|
|
500
|
+
}
|
|
501
|
+
const s = x.parseRepeatEndMarker(t.data);
|
|
502
|
+
if (s === null) {
|
|
503
|
+
t = t.previousSibling;
|
|
504
|
+
continue;
|
|
505
|
+
}
|
|
506
|
+
t.data = "";
|
|
507
|
+
const o = t.previousSibling;
|
|
508
|
+
if (!o)
|
|
509
|
+
throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": end should never be null.`);
|
|
510
|
+
let n = o, l = 0;
|
|
511
|
+
for (; n !== null; ) {
|
|
512
|
+
if (R(n)) {
|
|
513
|
+
if (x.isRepeatViewEndMarker(n.data))
|
|
514
|
+
l++;
|
|
515
|
+
else if (x.isRepeatViewStartMarker(n.data))
|
|
516
|
+
if (l)
|
|
517
|
+
l--;
|
|
518
|
+
else {
|
|
519
|
+
if (x.parseRepeatStartMarker(n.data) !== s)
|
|
520
|
+
throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": Mismatched start and end markers.`);
|
|
521
|
+
n.data = "", t = n.previousSibling, n = n.nextSibling;
|
|
522
|
+
const h = e.hydrate(n, o);
|
|
523
|
+
this.views[s] = h, this.bindView(h, this.items, s, this.controller);
|
|
524
|
+
break;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
n = n.previousSibling;
|
|
528
|
+
}
|
|
529
|
+
if (!n)
|
|
530
|
+
throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": start should never be null.`);
|
|
531
|
+
}
|
|
314
532
|
}
|
|
315
533
|
}
|
|
316
|
-
class
|
|
534
|
+
class k {
|
|
317
535
|
/**
|
|
318
536
|
* Creates an instance of RepeatDirective.
|
|
319
|
-
* @param
|
|
537
|
+
* @param dataBinding - The binding that provides the array to render.
|
|
320
538
|
* @param templateBinding - The template binding used to obtain a template to render for each item in the array.
|
|
321
539
|
* @param options - Options used to turn on special repeat features.
|
|
322
540
|
*/
|
|
323
|
-
constructor(e, t,
|
|
324
|
-
|
|
541
|
+
constructor(e, t, s) {
|
|
542
|
+
this.dataBinding = e, this.templateBinding = t, this.options = s, te.enable();
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Creates a placeholder string based on the directive's index within the template.
|
|
546
|
+
* @param index - The index of the directive within the template.
|
|
547
|
+
*/
|
|
548
|
+
createHTML(e) {
|
|
549
|
+
return E.comment(e(this));
|
|
325
550
|
}
|
|
326
551
|
/**
|
|
327
552
|
* Creates a behavior for the provided target node.
|
|
328
553
|
* @param target - The node instance to create the behavior for.
|
|
329
554
|
*/
|
|
330
|
-
createBehavior(
|
|
331
|
-
return new
|
|
555
|
+
createBehavior() {
|
|
556
|
+
return new ne(this);
|
|
332
557
|
}
|
|
333
558
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
559
|
+
P.define(k);
|
|
560
|
+
function le(i, e, t = M) {
|
|
561
|
+
const s = B(i), o = B(e);
|
|
562
|
+
return new k(s, o, Object.assign(Object.assign({}, M), t));
|
|
337
563
|
}
|
|
338
564
|
export {
|
|
339
|
-
|
|
340
|
-
|
|
565
|
+
k as R,
|
|
566
|
+
le as r
|
|
341
567
|
};
|