@sprawlify/primitives 0.0.1
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/dist/anatomy.cjs +3 -0
- package/dist/anatomy.d.cts +2 -0
- package/dist/anatomy.d.mts +2 -0
- package/dist/anatomy.mjs +3 -0
- package/dist/aria-hidden-DqYx0f_y.mjs +177 -0
- package/dist/aria-hidden-DtLU6hSU.cjs +182 -0
- package/dist/aria-hidden.cjs +4 -0
- package/dist/aria-hidden.d.cts +16 -0
- package/dist/aria-hidden.d.mts +16 -0
- package/dist/aria-hidden.mjs +4 -0
- package/dist/auto-resize-D3qHtFy1.mjs +114 -0
- package/dist/auto-resize-xzlPFDyD.cjs +125 -0
- package/dist/auto-resize.cjs +5 -0
- package/dist/auto-resize.d.cts +17 -0
- package/dist/auto-resize.d.mts +17 -0
- package/dist/auto-resize.mjs +4 -0
- package/dist/chunk-CbDLau6x.cjs +34 -0
- package/dist/collection-8XqaNHs_.mjs +1279 -0
- package/dist/collection-DIoIDISa.cjs +1326 -0
- package/dist/collection.cjs +11 -0
- package/dist/collection.d.cts +5 -0
- package/dist/collection.d.mts +5 -0
- package/dist/collection.mjs +4 -0
- package/dist/color-BkAP1Tkd.d.mts +60 -0
- package/dist/color-VKewNv2e.d.cts +60 -0
- package/dist/color-utils-Cc5GVXZh.mjs +657 -0
- package/dist/color-utils-LER_6Zwu.cjs +680 -0
- package/dist/color-utils.cjs +7 -0
- package/dist/color-utils.d.cts +19 -0
- package/dist/color-utils.d.mts +19 -0
- package/dist/color-utils.mjs +4 -0
- package/dist/core-30pJjyC2.d.mts +49 -0
- package/dist/core-CQFbMdTl.cjs +176 -0
- package/dist/core-CefBjbst.d.cts +49 -0
- package/dist/core-DCFNMTZF.mjs +129 -0
- package/dist/core.cjs +12 -0
- package/dist/core.d.cts +3 -0
- package/dist/core.d.mts +3 -0
- package/dist/core.mjs +5 -0
- package/dist/create-anatomy-B3XYc-qG.d.mts +70 -0
- package/dist/create-anatomy-BGQ8pv8J.d.cts +70 -0
- package/dist/create-anatomy-BbDZbHpC.mjs +39 -0
- package/dist/create-anatomy-CDsIFUXg.cjs +45 -0
- package/dist/create-props-BnF_vl-E.mjs +5 -0
- package/dist/create-props-YKy7JIKj.cjs +11 -0
- package/dist/data-url-C3ITPVRX.d.cts +10 -0
- package/dist/data-url-DLwZ9M77.d.mts +10 -0
- package/dist/date-utils-D2xPHa_I.cjs +738 -0
- package/dist/date-utils-wEa1hhpc.mjs +474 -0
- package/dist/date-utils.cjs +46 -0
- package/dist/date-utils.d.cts +101 -0
- package/dist/date-utils.d.mts +2 -0
- package/dist/date-utils.mjs +3 -0
- package/dist/defineProperty-BoUOT9Ie.cjs +49 -0
- package/dist/defineProperty-DrXfyjd4.mjs +43 -0
- package/dist/dismissable-CTfKZ4OG.cjs +282 -0
- package/dist/dismissable-DDrx0xnH.mjs +271 -0
- package/dist/dismissable-layer-C7pZU2wi.d.cts +39 -0
- package/dist/dismissable-layer-t_b0fk-p.d.mts +39 -0
- package/dist/dismissable.cjs +7 -0
- package/dist/dismissable.d.cts +3 -0
- package/dist/dismissable.d.mts +3 -0
- package/dist/dismissable.mjs +6 -0
- package/dist/dom-query-CWZdWUGp.cjs +2141 -0
- package/dist/dom-query-DFCRhyj1.mjs +1374 -0
- package/dist/dom-query.cjs +130 -0
- package/dist/dom-query.d.cts +307 -0
- package/dist/dom-query.d.mts +307 -0
- package/dist/dom-query.mjs +3 -0
- package/dist/file-utils.cjs +220 -0
- package/dist/file-utils.d.cts +51 -0
- package/dist/file-utils.d.mts +51 -0
- package/dist/file-utils.mjs +210 -0
- package/dist/focus-trap-D-bypQEJ.mjs +485 -0
- package/dist/focus-trap-D4i52S9A.cjs +496 -0
- package/dist/focus-trap.cjs +5 -0
- package/dist/focus-trap.d.cts +88 -0
- package/dist/focus-trap.d.mts +88 -0
- package/dist/focus-trap.mjs +4 -0
- package/dist/focus-visible-DYTWdWpa.cjs +210 -0
- package/dist/focus-visible-irppYatv.mjs +175 -0
- package/dist/focus-visible.cjs +9 -0
- package/dist/focus-visible.d.cts +31 -0
- package/dist/focus-visible.d.mts +31 -0
- package/dist/focus-visible.mjs +4 -0
- package/dist/functions-BOkTDEFM.d.cts +15 -0
- package/dist/functions-IZtWcC8Q.d.mts +15 -0
- package/dist/highlight-word.cjs +100 -0
- package/dist/highlight-word.d.cts +24 -0
- package/dist/highlight-word.d.mts +24 -0
- package/dist/highlight-word.mjs +99 -0
- package/dist/hotkeys.cjs +758 -0
- package/dist/hotkeys.d.cts +130 -0
- package/dist/hotkeys.d.mts +130 -0
- package/dist/hotkeys.mjs +754 -0
- package/dist/i18n-utils.cjs +450 -0
- package/dist/i18n-utils.d.cts +61 -0
- package/dist/i18n-utils.d.mts +61 -0
- package/dist/i18n-utils.mjs +440 -0
- package/dist/index-BkzYij2j.d.mts +25 -0
- package/dist/index-Bqw3r34-.d.cts +1383 -0
- package/dist/index-C0MKXQmE.d.mts +1383 -0
- package/dist/index-C9-feK5c.d.cts +25 -0
- package/dist/index-CD5FN7kY.d.mts +114 -0
- package/dist/index-CJji6wHl.d.cts +15 -0
- package/dist/index-CNi5FkPe.d.mts +15 -0
- package/dist/index-D96rs8B0.d.mts +115 -0
- package/dist/index.cjs +0 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +1 -0
- package/dist/interact-outside-BplxR9cR.mjs +200 -0
- package/dist/interact-outside-C8-oFBpB.cjs +205 -0
- package/dist/interact-outside.cjs +5 -0
- package/dist/interact-outside.d.cts +2 -0
- package/dist/interact-outside.d.mts +2 -0
- package/dist/interact-outside.mjs +5 -0
- package/dist/json-tree-utils.cjs +1512 -0
- package/dist/json-tree-utils.d.cts +117 -0
- package/dist/json-tree-utils.d.mts +117 -0
- package/dist/json-tree-utils.mjs +1463 -0
- package/dist/list-collection-BIMJGQjn.d.cts +61 -0
- package/dist/list-collection-Db3eixRU.d.mts +61 -0
- package/dist/live-region-CcZPGo89.cjs +52 -0
- package/dist/live-region-CnPh21WH.mjs +46 -0
- package/dist/live-region.cjs +3 -0
- package/dist/live-region.d.cts +2 -0
- package/dist/live-region.d.mts +2 -0
- package/dist/live-region.mjs +3 -0
- package/dist/machines/accordion/index.cjs +328 -0
- package/dist/machines/accordion/index.d.cts +83 -0
- package/dist/machines/accordion/index.d.mts +83 -0
- package/dist/machines/accordion/index.mjs +322 -0
- package/dist/machines/async-list/index.cjs +311 -0
- package/dist/machines/async-list/index.d.cts +89 -0
- package/dist/machines/async-list/index.d.mts +89 -0
- package/dist/machines/async-list/index.mjs +310 -0
- package/dist/machines/avatar/index.cjs +169 -0
- package/dist/machines/avatar/index.d.cts +63 -0
- package/dist/machines/avatar/index.d.mts +63 -0
- package/dist/machines/avatar/index.mjs +165 -0
- package/dist/machines/bottom-sheet/index.cjs +676 -0
- package/dist/machines/bottom-sheet/index.d.cts +239 -0
- package/dist/machines/bottom-sheet/index.d.mts +239 -0
- package/dist/machines/bottom-sheet/index.mjs +672 -0
- package/dist/machines/carousel/index.cjs +859 -0
- package/dist/machines/carousel/index.d.cts +146 -0
- package/dist/machines/carousel/index.d.mts +146 -0
- package/dist/machines/carousel/index.mjs +851 -0
- package/dist/machines/checkbox/index.cjs +316 -0
- package/dist/machines/checkbox/index.d.cts +81 -0
- package/dist/machines/checkbox/index.d.mts +81 -0
- package/dist/machines/checkbox/index.mjs +312 -0
- package/dist/machines/clipboard/index.cjs +225 -0
- package/dist/machines/clipboard/index.d.cts +68 -0
- package/dist/machines/clipboard/index.d.mts +68 -0
- package/dist/machines/clipboard/index.mjs +219 -0
- package/dist/machines/collapsible/index.cjs +362 -0
- package/dist/machines/collapsible/index.d.cts +82 -0
- package/dist/machines/collapsible/index.d.mts +82 -0
- package/dist/machines/collapsible/index.mjs +358 -0
- package/dist/machines/color-picker/index.cjs +1529 -0
- package/dist/machines/color-picker/index.d.cts +205 -0
- package/dist/machines/color-picker/index.d.mts +205 -0
- package/dist/machines/color-picker/index.mjs +1514 -0
- package/dist/machines/combobox/index.cjs +1593 -0
- package/dist/machines/combobox/index.d.cts +214 -0
- package/dist/machines/combobox/index.d.mts +214 -0
- package/dist/machines/combobox/index.mjs +1582 -0
- package/dist/machines/date-picker/index.cjs +2177 -0
- package/dist/machines/date-picker/index.d.cts +350 -0
- package/dist/machines/date-picker/index.d.mts +350 -0
- package/dist/machines/date-picker/index.mjs +2161 -0
- package/dist/machines/dialog/index.cjs +325 -0
- package/dist/machines/dialog/index.d.cts +80 -0
- package/dist/machines/dialog/index.d.mts +80 -0
- package/dist/machines/dialog/index.mjs +321 -0
- package/dist/machines/editable/index.cjs +551 -0
- package/dist/machines/editable/index.d.cts +114 -0
- package/dist/machines/editable/index.d.mts +114 -0
- package/dist/machines/editable/index.mjs +547 -0
- package/dist/machines/floating-panel/index.cjs +995 -0
- package/dist/machines/floating-panel/index.d.cts +147 -0
- package/dist/machines/floating-panel/index.d.mts +147 -0
- package/dist/machines/floating-panel/index.mjs +988 -0
- package/dist/machines/hover-card/index.cjs +383 -0
- package/dist/machines/hover-card/index.d.cts +69 -0
- package/dist/machines/hover-card/index.d.mts +69 -0
- package/dist/machines/hover-card/index.mjs +379 -0
- package/dist/machines/image-cropper/index.cjs +1995 -0
- package/dist/machines/image-cropper/index.d.cts +182 -0
- package/dist/machines/image-cropper/index.d.mts +182 -0
- package/dist/machines/image-cropper/index.mjs +1990 -0
- package/dist/machines/listbox/index.cjs +794 -0
- package/dist/machines/listbox/index.d.cts +168 -0
- package/dist/machines/listbox/index.d.mts +168 -0
- package/dist/machines/listbox/index.mjs +782 -0
- package/dist/machines/marquee/index.cjs +395 -0
- package/dist/machines/marquee/index.d.cts +102 -0
- package/dist/machines/marquee/index.d.mts +102 -0
- package/dist/machines/marquee/index.mjs +391 -0
- package/dist/machines/menu/index.cjs +1298 -0
- package/dist/machines/menu/index.d.cts +175 -0
- package/dist/machines/menu/index.d.mts +175 -0
- package/dist/machines/menu/index.mjs +1286 -0
- package/dist/machines/navigation-menu/index.cjs +861 -0
- package/dist/machines/navigation-menu/index.d.cts +127 -0
- package/dist/machines/navigation-menu/index.d.mts +127 -0
- package/dist/machines/navigation-menu/index.mjs +857 -0
- package/dist/machines/number-input/index.cjs +996 -0
- package/dist/machines/number-input/index.d.cts +134 -0
- package/dist/machines/number-input/index.d.mts +134 -0
- package/dist/machines/number-input/index.mjs +991 -0
- package/dist/machines/pagination/index.cjs +419 -0
- package/dist/machines/pagination/index.d.cts +139 -0
- package/dist/machines/pagination/index.d.mts +139 -0
- package/dist/machines/pagination/index.mjs +411 -0
- package/dist/machines/password-input/index.cjs +228 -0
- package/dist/machines/password-input/index.d.cts +71 -0
- package/dist/machines/password-input/index.d.mts +71 -0
- package/dist/machines/password-input/index.mjs +224 -0
- package/dist/machines/pin-input/index.cjs +523 -0
- package/dist/machines/pin-input/index.d.cts +105 -0
- package/dist/machines/pin-input/index.d.mts +105 -0
- package/dist/machines/pin-input/index.mjs +519 -0
- package/dist/machines/popover/index.cjs +430 -0
- package/dist/machines/popover/index.d.cts +88 -0
- package/dist/machines/popover/index.d.mts +88 -0
- package/dist/machines/popover/index.mjs +426 -0
- package/dist/machines/presence/index.cjs +192 -0
- package/dist/machines/presence/index.d.cts +44 -0
- package/dist/machines/presence/index.d.mts +44 -0
- package/dist/machines/presence/index.mjs +190 -0
- package/dist/machines/progress/index.cjs +288 -0
- package/dist/machines/progress/index.d.cts +96 -0
- package/dist/machines/progress/index.d.mts +96 -0
- package/dist/machines/progress/index.mjs +284 -0
- package/dist/machines/qr-code/index.cjs +172 -0
- package/dist/machines/qr-code/index.d.cts +70 -0
- package/dist/machines/qr-code/index.d.mts +70 -0
- package/dist/machines/qr-code/index.mjs +167 -0
- package/dist/machines/radio-group/index.cjs +436 -0
- package/dist/machines/radio-group/index.d.cts +106 -0
- package/dist/machines/radio-group/index.d.mts +106 -0
- package/dist/machines/radio-group/index.mjs +430 -0
- package/dist/machines/rating-group/index.cjs +405 -0
- package/dist/machines/rating-group/index.d.cts +101 -0
- package/dist/machines/rating-group/index.d.mts +101 -0
- package/dist/machines/rating-group/index.mjs +399 -0
- package/dist/machines/scroll-area/index.cjs +857 -0
- package/dist/machines/scroll-area/index.d.cts +159 -0
- package/dist/machines/scroll-area/index.d.mts +159 -0
- package/dist/machines/scroll-area/index.mjs +853 -0
- package/dist/machines/select/index.cjs +1165 -0
- package/dist/machines/select/index.d.cts +183 -0
- package/dist/machines/select/index.d.mts +183 -0
- package/dist/machines/select/index.mjs +1154 -0
- package/dist/machines/signature-pad/index.cjs +334 -0
- package/dist/machines/signature-pad/index.d.cts +108 -0
- package/dist/machines/signature-pad/index.d.mts +108 -0
- package/dist/machines/signature-pad/index.mjs +328 -0
- package/dist/machines/slider/index.cjs +957 -0
- package/dist/machines/slider/index.d.cts +149 -0
- package/dist/machines/slider/index.d.mts +149 -0
- package/dist/machines/slider/index.mjs +949 -0
- package/dist/machines/splitter/index.cjs +1112 -0
- package/dist/machines/splitter/index.d.cts +155 -0
- package/dist/machines/splitter/index.d.mts +155 -0
- package/dist/machines/splitter/index.mjs +1103 -0
- package/dist/machines/steps/index.cjs +289 -0
- package/dist/machines/steps/index.d.cts +97 -0
- package/dist/machines/steps/index.d.mts +97 -0
- package/dist/machines/steps/index.mjs +285 -0
- package/dist/machines/switch/index.cjs +305 -0
- package/dist/machines/switch/index.d.cts +80 -0
- package/dist/machines/switch/index.d.mts +80 -0
- package/dist/machines/switch/index.mjs +301 -0
- package/dist/machines/tabs/index.cjs +508 -0
- package/dist/machines/tabs/index.d.cts +111 -0
- package/dist/machines/tabs/index.d.mts +111 -0
- package/dist/machines/tabs/index.mjs +500 -0
- package/dist/machines/tags-input/index.cjs +1127 -0
- package/dist/machines/tags-input/index.d.cts +179 -0
- package/dist/machines/tags-input/index.d.mts +179 -0
- package/dist/machines/tags-input/index.mjs +1121 -0
- package/dist/machines/timer/index.cjs +329 -0
- package/dist/machines/timer/index.d.cts +98 -0
- package/dist/machines/timer/index.d.mts +98 -0
- package/dist/machines/timer/index.mjs +324 -0
- package/dist/machines/toast/index.cjs +1155 -0
- package/dist/machines/toast/index.d.cts +195 -0
- package/dist/machines/toast/index.d.mts +195 -0
- package/dist/machines/toast/index.mjs +1151 -0
- package/dist/machines/toggle/index.cjs +103 -0
- package/dist/machines/toggle/index.d.cts +46 -0
- package/dist/machines/toggle/index.d.mts +46 -0
- package/dist/machines/toggle/index.mjs +99 -0
- package/dist/machines/toggle-group/index.cjs +328 -0
- package/dist/machines/toggle-group/index.d.cts +81 -0
- package/dist/machines/toggle-group/index.d.mts +81 -0
- package/dist/machines/toggle-group/index.mjs +322 -0
- package/dist/machines/tooltip/index.cjs +516 -0
- package/dist/machines/tooltip/index.d.cts +71 -0
- package/dist/machines/tooltip/index.d.mts +71 -0
- package/dist/machines/tooltip/index.mjs +512 -0
- package/dist/machines/tour/index.cjs +1108 -0
- package/dist/machines/tour/index.d.cts +206 -0
- package/dist/machines/tour/index.d.mts +206 -0
- package/dist/machines/tour/index.mjs +1101 -0
- package/dist/machines/tree-view/index.cjs +1271 -0
- package/dist/machines/tree-view/index.d.cts +215 -0
- package/dist/machines/tree-view/index.d.mts +215 -0
- package/dist/machines/tree-view/index.mjs +1263 -0
- package/dist/node-BctU8GXk.d.mts +24 -0
- package/dist/node-CSsuPZVZ.d.cts +24 -0
- package/dist/popper-BPJeAtcA.mjs +349 -0
- package/dist/popper-D0FAW_p7.cjs +373 -0
- package/dist/popper.cjs +8 -0
- package/dist/popper.d.cts +74 -0
- package/dist/popper.d.mts +2 -0
- package/dist/popper.mjs +5 -0
- package/dist/raf-BnlYUlDi.d.mts +15 -0
- package/dist/raf-Cd2FGy0z.d.cts +15 -0
- package/dist/rect-utils-0ellN0a_.mjs +854 -0
- package/dist/rect-utils-DKLRhP8G.cjs +1147 -0
- package/dist/rect-utils.cjs +51 -0
- package/dist/rect-utils.d.cts +198 -0
- package/dist/rect-utils.d.mts +198 -0
- package/dist/rect-utils.mjs +3 -0
- package/dist/remove-scroll-Lrfv79X_.mjs +58 -0
- package/dist/remove-scroll-Uvzg1L9r.cjs +63 -0
- package/dist/remove-scroll.cjs +0 -0
- package/dist/remove-scroll.d.cts +1 -0
- package/dist/remove-scroll.d.mts +1 -0
- package/dist/remove-scroll.mjs +1 -0
- package/dist/scroll-snap-CrTmQRzA.mjs +152 -0
- package/dist/scroll-snap-zyiZLv7W.cjs +175 -0
- package/dist/scroll-snap.cjs +7 -0
- package/dist/scroll-snap.d.cts +14 -0
- package/dist/scroll-snap.d.mts +14 -0
- package/dist/scroll-snap.mjs +4 -0
- package/dist/selection-BIhSzkF7.d.mts +50 -0
- package/dist/selection-CS1GBp8e.d.cts +50 -0
- package/dist/store-BZcXv49B.cjs +305 -0
- package/dist/store-DEojWy9H.mjs +263 -0
- package/dist/store.cjs +9 -0
- package/dist/store.d.cts +26 -0
- package/dist/store.d.mts +26 -0
- package/dist/store.mjs +3 -0
- package/dist/stringify-state.cjs +49 -0
- package/dist/stringify-state.d.cts +8 -0
- package/dist/stringify-state.d.mts +8 -0
- package/dist/stringify-state.mjs +46 -0
- package/dist/tree-collection-BwU5WhGQ.d.mts +78 -0
- package/dist/tree-collection-DP_eznnI.d.cts +78 -0
- package/dist/typeahead-BdNwVP09.d.cts +45 -0
- package/dist/typeahead-XN6lZ7G9.d.mts +45 -0
- package/dist/types-BivBkYg9.d.cts +57 -0
- package/dist/types-Bl_6JtPQ.d.mts +57 -0
- package/dist/types-CPUMVt7c.d.mts +54 -0
- package/dist/types-CT_W6HWr.d.cts +54 -0
- package/dist/types-DDTcG99l.d.mts +201 -0
- package/dist/types-DejIu60O.d.cts +201 -0
- package/dist/types-DiIdKZ3K.d.cts +45 -0
- package/dist/types-GxLIgJib.d.cts +17 -0
- package/dist/types.cjs +15 -0
- package/dist/types.d.cts +2 -0
- package/dist/types.d.mts +2 -0
- package/dist/types.mjs +14 -0
- package/dist/utils-BZyrxWWR.mjs +525 -0
- package/dist/utils-_6frwjgJ.cjs +1040 -0
- package/dist/utils.cjs +88 -0
- package/dist/utils.d.cts +144 -0
- package/dist/utils.d.mts +144 -0
- package/dist/utils.mjs +3 -0
- package/dist/wait-for-CMjPsqWk.d.cts +10 -0
- package/dist/wait-for-D2nkdD4z.d.mts +10 -0
- package/package.json +399 -0
|
@@ -0,0 +1,1326 @@
|
|
|
1
|
+
const require_defineProperty = require('./defineProperty-BoUOT9Ie.cjs');
|
|
2
|
+
const require_utils = require('./utils-_6frwjgJ.cjs');
|
|
3
|
+
|
|
4
|
+
//#region src/shared/collection/list-collection.ts
|
|
5
|
+
let _Symbol$iterator;
|
|
6
|
+
const fallback = {
|
|
7
|
+
itemToValue(item) {
|
|
8
|
+
if (typeof item === "string") return item;
|
|
9
|
+
if (require_utils.isObject(item) && require_utils.hasProp(item, "value")) return item.value;
|
|
10
|
+
return "";
|
|
11
|
+
},
|
|
12
|
+
itemToString(item) {
|
|
13
|
+
if (typeof item === "string") return item;
|
|
14
|
+
if (require_utils.isObject(item) && require_utils.hasProp(item, "label")) return item.label;
|
|
15
|
+
return fallback.itemToValue(item);
|
|
16
|
+
},
|
|
17
|
+
isItemDisabled(item) {
|
|
18
|
+
if (require_utils.isObject(item) && require_utils.hasProp(item, "disabled")) return !!item.disabled;
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
_Symbol$iterator = Symbol.iterator;
|
|
23
|
+
var ListCollection = class ListCollection {
|
|
24
|
+
constructor(options) {
|
|
25
|
+
this.options = options;
|
|
26
|
+
require_defineProperty._defineProperty(this, "items", void 0);
|
|
27
|
+
require_defineProperty._defineProperty(this, "indexMap", null);
|
|
28
|
+
require_defineProperty._defineProperty(this, "copy", (items) => {
|
|
29
|
+
return new ListCollection({
|
|
30
|
+
...this.options,
|
|
31
|
+
items: items ?? [...this.items]
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
require_defineProperty._defineProperty(this, "isEqual", (other) => {
|
|
35
|
+
return require_utils.isEqual(this.items, other.items);
|
|
36
|
+
});
|
|
37
|
+
require_defineProperty._defineProperty(this, "setItems", (items) => {
|
|
38
|
+
return this.copy(items);
|
|
39
|
+
});
|
|
40
|
+
require_defineProperty._defineProperty(this, "getValues", (items = this.items) => {
|
|
41
|
+
const values = [];
|
|
42
|
+
for (const item of items) {
|
|
43
|
+
const value = this.getItemValue(item);
|
|
44
|
+
if (value != null) values.push(value);
|
|
45
|
+
}
|
|
46
|
+
return values;
|
|
47
|
+
});
|
|
48
|
+
require_defineProperty._defineProperty(this, "find", (value) => {
|
|
49
|
+
if (value == null) return null;
|
|
50
|
+
const index = this.indexOf(value);
|
|
51
|
+
return index !== -1 ? this.at(index) : null;
|
|
52
|
+
});
|
|
53
|
+
require_defineProperty._defineProperty(this, "findMany", (values) => {
|
|
54
|
+
const result = [];
|
|
55
|
+
for (const value of values) {
|
|
56
|
+
const item = this.find(value);
|
|
57
|
+
if (item != null) result.push(item);
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
});
|
|
61
|
+
require_defineProperty._defineProperty(this, "at", (index) => {
|
|
62
|
+
if (!this.options.groupBy && !this.options.groupSort) return this.items[index] ?? null;
|
|
63
|
+
let idx = 0;
|
|
64
|
+
const groups = this.group();
|
|
65
|
+
for (const [, items] of groups) for (const item of items) {
|
|
66
|
+
if (idx === index) return item;
|
|
67
|
+
idx++;
|
|
68
|
+
}
|
|
69
|
+
return null;
|
|
70
|
+
});
|
|
71
|
+
require_defineProperty._defineProperty(this, "sortFn", (valueA, valueB) => {
|
|
72
|
+
const indexA = this.indexOf(valueA);
|
|
73
|
+
const indexB = this.indexOf(valueB);
|
|
74
|
+
return (indexA ?? 0) - (indexB ?? 0);
|
|
75
|
+
});
|
|
76
|
+
require_defineProperty._defineProperty(this, "sort", (values) => {
|
|
77
|
+
return [...values].sort(this.sortFn.bind(this));
|
|
78
|
+
});
|
|
79
|
+
require_defineProperty._defineProperty(this, "getItemValue", (item) => {
|
|
80
|
+
if (item == null) return null;
|
|
81
|
+
return this.options.itemToValue?.(item) ?? fallback.itemToValue(item);
|
|
82
|
+
});
|
|
83
|
+
require_defineProperty._defineProperty(this, "getItemDisabled", (item) => {
|
|
84
|
+
if (item == null) return false;
|
|
85
|
+
return this.options.isItemDisabled?.(item) ?? fallback.isItemDisabled(item);
|
|
86
|
+
});
|
|
87
|
+
require_defineProperty._defineProperty(this, "stringifyItem", (item) => {
|
|
88
|
+
if (item == null) return null;
|
|
89
|
+
return this.options.itemToString?.(item) ?? fallback.itemToString(item);
|
|
90
|
+
});
|
|
91
|
+
require_defineProperty._defineProperty(this, "stringify", (value) => {
|
|
92
|
+
if (value == null) return null;
|
|
93
|
+
return this.stringifyItem(this.find(value));
|
|
94
|
+
});
|
|
95
|
+
require_defineProperty._defineProperty(this, "stringifyItems", (items, separator = ", ") => {
|
|
96
|
+
const strs = [];
|
|
97
|
+
for (const item of items) {
|
|
98
|
+
const str = this.stringifyItem(item);
|
|
99
|
+
if (str != null) strs.push(str);
|
|
100
|
+
}
|
|
101
|
+
return strs.join(separator);
|
|
102
|
+
});
|
|
103
|
+
require_defineProperty._defineProperty(this, "stringifyMany", (value, separator) => {
|
|
104
|
+
return this.stringifyItems(this.findMany(value), separator);
|
|
105
|
+
});
|
|
106
|
+
require_defineProperty._defineProperty(this, "has", (value) => {
|
|
107
|
+
return this.indexOf(value) !== -1;
|
|
108
|
+
});
|
|
109
|
+
require_defineProperty._defineProperty(this, "hasItem", (item) => {
|
|
110
|
+
if (item == null) return false;
|
|
111
|
+
return this.has(this.getItemValue(item));
|
|
112
|
+
});
|
|
113
|
+
require_defineProperty._defineProperty(this, "group", () => {
|
|
114
|
+
const { groupBy, groupSort } = this.options;
|
|
115
|
+
if (!groupBy) return [["", [...this.items]]];
|
|
116
|
+
const groups = /* @__PURE__ */ new Map();
|
|
117
|
+
this.items.forEach((item, index) => {
|
|
118
|
+
const groupKey = groupBy(item, index);
|
|
119
|
+
if (!groups.has(groupKey)) groups.set(groupKey, []);
|
|
120
|
+
groups.get(groupKey).push(item);
|
|
121
|
+
});
|
|
122
|
+
let entries = Array.from(groups.entries());
|
|
123
|
+
if (groupSort) entries.sort(([a], [b]) => {
|
|
124
|
+
if (typeof groupSort === "function") return groupSort(a, b);
|
|
125
|
+
if (Array.isArray(groupSort)) {
|
|
126
|
+
const indexA = groupSort.indexOf(a);
|
|
127
|
+
const indexB = groupSort.indexOf(b);
|
|
128
|
+
if (indexA === -1) return 1;
|
|
129
|
+
if (indexB === -1) return -1;
|
|
130
|
+
return indexA - indexB;
|
|
131
|
+
}
|
|
132
|
+
if (groupSort === "asc") return a.localeCompare(b);
|
|
133
|
+
if (groupSort === "desc") return b.localeCompare(a);
|
|
134
|
+
return 0;
|
|
135
|
+
});
|
|
136
|
+
return entries;
|
|
137
|
+
});
|
|
138
|
+
require_defineProperty._defineProperty(this, "getNextValue", (value, step = 1, clamp = false) => {
|
|
139
|
+
let index = this.indexOf(value);
|
|
140
|
+
if (index === -1) return null;
|
|
141
|
+
index = clamp ? Math.min(index + step, this.size - 1) : index + step;
|
|
142
|
+
while (index <= this.size && this.getItemDisabled(this.at(index))) index++;
|
|
143
|
+
return this.getItemValue(this.at(index));
|
|
144
|
+
});
|
|
145
|
+
require_defineProperty._defineProperty(this, "getPreviousValue", (value, step = 1, clamp = false) => {
|
|
146
|
+
let index = this.indexOf(value);
|
|
147
|
+
if (index === -1) return null;
|
|
148
|
+
index = clamp ? Math.max(index - step, 0) : index - step;
|
|
149
|
+
while (index >= 0 && this.getItemDisabled(this.at(index))) index--;
|
|
150
|
+
return this.getItemValue(this.at(index));
|
|
151
|
+
});
|
|
152
|
+
require_defineProperty._defineProperty(this, "indexOf", (value) => {
|
|
153
|
+
if (value == null) return -1;
|
|
154
|
+
if (!this.options.groupBy && !this.options.groupSort) return this.items.findIndex((item) => this.getItemValue(item) === value);
|
|
155
|
+
if (!this.indexMap) {
|
|
156
|
+
this.indexMap = /* @__PURE__ */ new Map();
|
|
157
|
+
let idx = 0;
|
|
158
|
+
const groups = this.group();
|
|
159
|
+
for (const [, items] of groups) for (const item of items) {
|
|
160
|
+
const itemValue = this.getItemValue(item);
|
|
161
|
+
if (itemValue != null) this.indexMap.set(itemValue, idx);
|
|
162
|
+
idx++;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return this.indexMap.get(value) ?? -1;
|
|
166
|
+
});
|
|
167
|
+
require_defineProperty._defineProperty(this, "getByText", (text, current) => {
|
|
168
|
+
const currentIndex = current != null ? this.indexOf(current) : -1;
|
|
169
|
+
const isSingleKey = text.length === 1;
|
|
170
|
+
for (let i = 0; i < this.items.length; i++) {
|
|
171
|
+
const item = this.items[(currentIndex + i + 1) % this.items.length];
|
|
172
|
+
if (isSingleKey && this.getItemValue(item) === current) continue;
|
|
173
|
+
if (this.getItemDisabled(item)) continue;
|
|
174
|
+
if (match(this.stringifyItem(item), text)) return item;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
require_defineProperty._defineProperty(this, "search", (queryString, options$1) => {
|
|
178
|
+
const { state, currentValue, timeout = 350 } = options$1;
|
|
179
|
+
const search = state.keysSoFar + queryString;
|
|
180
|
+
const query = search.length > 1 && Array.from(search).every((char) => char === search[0]) ? search[0] : search;
|
|
181
|
+
const item = this.getByText(query, currentValue);
|
|
182
|
+
const value = this.getItemValue(item);
|
|
183
|
+
function cleanup() {
|
|
184
|
+
clearTimeout(state.timer);
|
|
185
|
+
state.timer = -1;
|
|
186
|
+
}
|
|
187
|
+
function update(value$1) {
|
|
188
|
+
state.keysSoFar = value$1;
|
|
189
|
+
cleanup();
|
|
190
|
+
if (value$1 !== "") state.timer = +setTimeout(() => {
|
|
191
|
+
update("");
|
|
192
|
+
cleanup();
|
|
193
|
+
}, timeout);
|
|
194
|
+
}
|
|
195
|
+
update(search);
|
|
196
|
+
return value;
|
|
197
|
+
});
|
|
198
|
+
require_defineProperty._defineProperty(this, "update", (value, item) => {
|
|
199
|
+
let index = this.indexOf(value);
|
|
200
|
+
if (index === -1) return this;
|
|
201
|
+
return this.copy([
|
|
202
|
+
...this.items.slice(0, index),
|
|
203
|
+
item,
|
|
204
|
+
...this.items.slice(index + 1)
|
|
205
|
+
]);
|
|
206
|
+
});
|
|
207
|
+
require_defineProperty._defineProperty(this, "upsert", (value, item, mode = "append") => {
|
|
208
|
+
let index = this.indexOf(value);
|
|
209
|
+
if (index === -1) return (mode === "append" ? this.append : this.prepend)(item);
|
|
210
|
+
return this.copy([
|
|
211
|
+
...this.items.slice(0, index),
|
|
212
|
+
item,
|
|
213
|
+
...this.items.slice(index + 1)
|
|
214
|
+
]);
|
|
215
|
+
});
|
|
216
|
+
require_defineProperty._defineProperty(this, "insert", (index, ...items) => {
|
|
217
|
+
return this.copy(insert$1(this.items, index, ...items));
|
|
218
|
+
});
|
|
219
|
+
require_defineProperty._defineProperty(this, "insertBefore", (value, ...items) => {
|
|
220
|
+
let toIndex = this.indexOf(value);
|
|
221
|
+
if (toIndex === -1) if (this.items.length === 0) toIndex = 0;
|
|
222
|
+
else return this;
|
|
223
|
+
return this.copy(insert$1(this.items, toIndex, ...items));
|
|
224
|
+
});
|
|
225
|
+
require_defineProperty._defineProperty(this, "insertAfter", (value, ...items) => {
|
|
226
|
+
let toIndex = this.indexOf(value);
|
|
227
|
+
if (toIndex === -1) if (this.items.length === 0) toIndex = 0;
|
|
228
|
+
else return this;
|
|
229
|
+
return this.copy(insert$1(this.items, toIndex + 1, ...items));
|
|
230
|
+
});
|
|
231
|
+
require_defineProperty._defineProperty(this, "prepend", (...items) => {
|
|
232
|
+
return this.copy(insert$1(this.items, 0, ...items));
|
|
233
|
+
});
|
|
234
|
+
require_defineProperty._defineProperty(this, "append", (...items) => {
|
|
235
|
+
return this.copy(insert$1(this.items, this.items.length, ...items));
|
|
236
|
+
});
|
|
237
|
+
require_defineProperty._defineProperty(this, "filter", (fn) => {
|
|
238
|
+
const filteredItems = this.items.filter((item, index) => fn(this.stringifyItem(item), index, item));
|
|
239
|
+
return this.copy(filteredItems);
|
|
240
|
+
});
|
|
241
|
+
require_defineProperty._defineProperty(this, "remove", (...itemsOrValues) => {
|
|
242
|
+
const values = itemsOrValues.map((itemOrValue) => typeof itemOrValue === "string" ? itemOrValue : this.getItemValue(itemOrValue));
|
|
243
|
+
return this.copy(this.items.filter((item) => {
|
|
244
|
+
const value = this.getItemValue(item);
|
|
245
|
+
if (value == null) return false;
|
|
246
|
+
return !values.includes(value);
|
|
247
|
+
}));
|
|
248
|
+
});
|
|
249
|
+
require_defineProperty._defineProperty(this, "move", (value, toIndex) => {
|
|
250
|
+
const fromIndex = this.indexOf(value);
|
|
251
|
+
if (fromIndex === -1) return this;
|
|
252
|
+
return this.copy(move$1(this.items, [fromIndex], toIndex));
|
|
253
|
+
});
|
|
254
|
+
require_defineProperty._defineProperty(this, "moveBefore", (value, ...values) => {
|
|
255
|
+
let toIndex = this.items.findIndex((item) => this.getItemValue(item) === value);
|
|
256
|
+
if (toIndex === -1) return this;
|
|
257
|
+
let indices = values.map((value$1) => this.items.findIndex((item) => this.getItemValue(item) === value$1)).sort((a, b) => a - b);
|
|
258
|
+
return this.copy(move$1(this.items, indices, toIndex));
|
|
259
|
+
});
|
|
260
|
+
require_defineProperty._defineProperty(this, "moveAfter", (value, ...values) => {
|
|
261
|
+
let toIndex = this.items.findIndex((item) => this.getItemValue(item) === value);
|
|
262
|
+
if (toIndex === -1) return this;
|
|
263
|
+
let indices = values.map((value$1) => this.items.findIndex((item) => this.getItemValue(item) === value$1)).sort((a, b) => a - b);
|
|
264
|
+
return this.copy(move$1(this.items, indices, toIndex + 1));
|
|
265
|
+
});
|
|
266
|
+
require_defineProperty._defineProperty(this, "reorder", (fromIndex, toIndex) => {
|
|
267
|
+
return this.copy(move$1(this.items, [fromIndex], toIndex));
|
|
268
|
+
});
|
|
269
|
+
require_defineProperty._defineProperty(this, "compareValue", (a, b) => {
|
|
270
|
+
const indexA = this.indexOf(a);
|
|
271
|
+
const indexB = this.indexOf(b);
|
|
272
|
+
if (indexA < indexB) return -1;
|
|
273
|
+
if (indexA > indexB) return 1;
|
|
274
|
+
return 0;
|
|
275
|
+
});
|
|
276
|
+
require_defineProperty._defineProperty(this, "range", (from, to) => {
|
|
277
|
+
let keys = [];
|
|
278
|
+
let key = from;
|
|
279
|
+
while (key != null) {
|
|
280
|
+
if (this.find(key)) keys.push(key);
|
|
281
|
+
if (key === to) return keys;
|
|
282
|
+
key = this.getNextValue(key);
|
|
283
|
+
}
|
|
284
|
+
return [];
|
|
285
|
+
});
|
|
286
|
+
require_defineProperty._defineProperty(this, "getValueRange", (from, to) => {
|
|
287
|
+
if (from && to) {
|
|
288
|
+
if (this.compareValue(from, to) <= 0) return this.range(from, to);
|
|
289
|
+
return this.range(to, from);
|
|
290
|
+
}
|
|
291
|
+
return [];
|
|
292
|
+
});
|
|
293
|
+
require_defineProperty._defineProperty(this, "toString", () => {
|
|
294
|
+
let result = "";
|
|
295
|
+
for (const item of this.items) {
|
|
296
|
+
const itemString = [
|
|
297
|
+
this.getItemValue(item),
|
|
298
|
+
this.stringifyItem(item),
|
|
299
|
+
this.getItemDisabled(item)
|
|
300
|
+
].filter(Boolean).join(":");
|
|
301
|
+
result += itemString + ",";
|
|
302
|
+
}
|
|
303
|
+
return result;
|
|
304
|
+
});
|
|
305
|
+
require_defineProperty._defineProperty(this, "toJSON", () => {
|
|
306
|
+
return {
|
|
307
|
+
size: this.size,
|
|
308
|
+
first: this.firstValue,
|
|
309
|
+
last: this.lastValue
|
|
310
|
+
};
|
|
311
|
+
});
|
|
312
|
+
this.items = [...options.items];
|
|
313
|
+
}
|
|
314
|
+
get size() {
|
|
315
|
+
return this.items.length;
|
|
316
|
+
}
|
|
317
|
+
get firstValue() {
|
|
318
|
+
let index = 0;
|
|
319
|
+
while (this.getItemDisabled(this.at(index))) index++;
|
|
320
|
+
return this.getItemValue(this.at(index));
|
|
321
|
+
}
|
|
322
|
+
get lastValue() {
|
|
323
|
+
let index = this.size - 1;
|
|
324
|
+
while (this.getItemDisabled(this.at(index))) index--;
|
|
325
|
+
return this.getItemValue(this.at(index));
|
|
326
|
+
}
|
|
327
|
+
*[_Symbol$iterator]() {
|
|
328
|
+
yield* this.items;
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
const match = (label, query) => {
|
|
332
|
+
return !!label?.toLowerCase().startsWith(query.toLowerCase());
|
|
333
|
+
};
|
|
334
|
+
function isListCollection(v) {
|
|
335
|
+
return v instanceof ListCollection;
|
|
336
|
+
}
|
|
337
|
+
function insert$1(items, index, ...values) {
|
|
338
|
+
return [
|
|
339
|
+
...items.slice(0, index),
|
|
340
|
+
...values,
|
|
341
|
+
...items.slice(index)
|
|
342
|
+
];
|
|
343
|
+
}
|
|
344
|
+
function move$1(items, indices, toIndex) {
|
|
345
|
+
indices = [...indices].sort((a, b) => a - b);
|
|
346
|
+
const itemsToMove = indices.map((i) => items[i]);
|
|
347
|
+
for (let i = indices.length - 1; i >= 0; i--) items = [...items.slice(0, indices[i]), ...items.slice(indices[i] + 1)];
|
|
348
|
+
toIndex = Math.max(0, toIndex - indices.filter((i) => i < toIndex).length);
|
|
349
|
+
return [
|
|
350
|
+
...items.slice(0, toIndex),
|
|
351
|
+
...itemsToMove,
|
|
352
|
+
...items.slice(toIndex)
|
|
353
|
+
];
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
//#endregion
|
|
357
|
+
//#region src/shared/collection/grid-collection.ts
|
|
358
|
+
var GridCollection = class extends ListCollection {
|
|
359
|
+
constructor(options) {
|
|
360
|
+
const { columnCount } = options;
|
|
361
|
+
super(options);
|
|
362
|
+
require_defineProperty._defineProperty(this, "columnCount", void 0);
|
|
363
|
+
require_defineProperty._defineProperty(this, "rows", null);
|
|
364
|
+
require_defineProperty._defineProperty(this, "getRows", () => {
|
|
365
|
+
if (!this.rows) this.rows = require_utils.chunk([...this.items], this.columnCount);
|
|
366
|
+
return this.rows;
|
|
367
|
+
});
|
|
368
|
+
require_defineProperty._defineProperty(this, "getRowCount", () => {
|
|
369
|
+
return Math.ceil(this.items.length / this.columnCount);
|
|
370
|
+
});
|
|
371
|
+
require_defineProperty._defineProperty(this, "getCellIndex", (row, column) => {
|
|
372
|
+
return row * this.columnCount + column;
|
|
373
|
+
});
|
|
374
|
+
require_defineProperty._defineProperty(this, "getCell", (row, column) => {
|
|
375
|
+
return this.at(this.getCellIndex(row, column));
|
|
376
|
+
});
|
|
377
|
+
require_defineProperty._defineProperty(this, "getValueCell", (value) => {
|
|
378
|
+
const index = this.indexOf(value);
|
|
379
|
+
if (index === -1) return null;
|
|
380
|
+
return {
|
|
381
|
+
row: Math.floor(index / this.columnCount),
|
|
382
|
+
column: index % this.columnCount
|
|
383
|
+
};
|
|
384
|
+
});
|
|
385
|
+
require_defineProperty._defineProperty(this, "getLastEnabledColumnIndex", (row) => {
|
|
386
|
+
for (let col = this.columnCount - 1; col >= 0; col--) {
|
|
387
|
+
const cell = this.getCell(row, col);
|
|
388
|
+
if (cell && !this.getItemDisabled(cell)) return col;
|
|
389
|
+
}
|
|
390
|
+
return null;
|
|
391
|
+
});
|
|
392
|
+
require_defineProperty._defineProperty(this, "getFirstEnabledColumnIndex", (row) => {
|
|
393
|
+
for (let col = 0; col < this.columnCount; col++) {
|
|
394
|
+
const cell = this.getCell(row, col);
|
|
395
|
+
if (cell && !this.getItemDisabled(cell)) return col;
|
|
396
|
+
}
|
|
397
|
+
return null;
|
|
398
|
+
});
|
|
399
|
+
require_defineProperty._defineProperty(this, "getPreviousRowValue", (value, loop = false) => {
|
|
400
|
+
const currentCell = this.getValueCell(value);
|
|
401
|
+
if (currentCell === null) return null;
|
|
402
|
+
const rows = this.getRows();
|
|
403
|
+
const rowCount = rows.length;
|
|
404
|
+
let prevRowIndex = currentCell.row;
|
|
405
|
+
let prevColumnIndex = currentCell.column;
|
|
406
|
+
for (let i = 1; i <= rowCount; i++) {
|
|
407
|
+
prevRowIndex = require_utils.prevIndex(rows, prevRowIndex, { loop });
|
|
408
|
+
const prevRow = rows[prevRowIndex];
|
|
409
|
+
if (!prevRow) continue;
|
|
410
|
+
if (!prevRow[prevColumnIndex]) {
|
|
411
|
+
const lastColumnIndex = this.getLastEnabledColumnIndex(prevRowIndex);
|
|
412
|
+
if (lastColumnIndex != null) prevColumnIndex = lastColumnIndex;
|
|
413
|
+
}
|
|
414
|
+
const cell = this.getCell(prevRowIndex, prevColumnIndex);
|
|
415
|
+
if (!this.getItemDisabled(cell)) return this.getItemValue(cell);
|
|
416
|
+
}
|
|
417
|
+
return this.firstValue;
|
|
418
|
+
});
|
|
419
|
+
require_defineProperty._defineProperty(this, "getNextRowValue", (value, loop = false) => {
|
|
420
|
+
const currentCell = this.getValueCell(value);
|
|
421
|
+
if (currentCell === null) return null;
|
|
422
|
+
const rows = this.getRows();
|
|
423
|
+
const rowCount = rows.length;
|
|
424
|
+
let nextRowIndex = currentCell.row;
|
|
425
|
+
let nextColumnIndex = currentCell.column;
|
|
426
|
+
for (let i = 1; i <= rowCount; i++) {
|
|
427
|
+
nextRowIndex = require_utils.nextIndex(rows, nextRowIndex, { loop });
|
|
428
|
+
const nextRow = rows[nextRowIndex];
|
|
429
|
+
if (!nextRow) continue;
|
|
430
|
+
if (!nextRow[nextColumnIndex]) {
|
|
431
|
+
const lastColumnIndex = this.getLastEnabledColumnIndex(nextRowIndex);
|
|
432
|
+
if (lastColumnIndex != null) nextColumnIndex = lastColumnIndex;
|
|
433
|
+
}
|
|
434
|
+
const cell = this.getCell(nextRowIndex, nextColumnIndex);
|
|
435
|
+
if (!this.getItemDisabled(cell)) return this.getItemValue(cell);
|
|
436
|
+
}
|
|
437
|
+
return this.lastValue;
|
|
438
|
+
});
|
|
439
|
+
this.columnCount = columnCount;
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
function isGridCollection(v) {
|
|
443
|
+
return require_utils.hasProp(v, "columnCount") && require_utils.hasProp(v, "getRows");
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
//#endregion
|
|
447
|
+
//#region src/shared/collection/selection.ts
|
|
448
|
+
var Selection = class Selection extends Set {
|
|
449
|
+
constructor(values = []) {
|
|
450
|
+
super(values);
|
|
451
|
+
require_defineProperty._defineProperty(this, "selectionMode", "single");
|
|
452
|
+
require_defineProperty._defineProperty(this, "deselectable", true);
|
|
453
|
+
require_defineProperty._defineProperty(this, "copy", () => {
|
|
454
|
+
const clone = new Selection([...this]);
|
|
455
|
+
return this.sync(clone);
|
|
456
|
+
});
|
|
457
|
+
require_defineProperty._defineProperty(this, "sync", (other) => {
|
|
458
|
+
other.selectionMode = this.selectionMode;
|
|
459
|
+
other.deselectable = this.deselectable;
|
|
460
|
+
return other;
|
|
461
|
+
});
|
|
462
|
+
require_defineProperty._defineProperty(this, "isEmpty", () => {
|
|
463
|
+
return this.size === 0;
|
|
464
|
+
});
|
|
465
|
+
require_defineProperty._defineProperty(this, "isSelected", (value) => {
|
|
466
|
+
if (this.selectionMode === "none" || value == null) return false;
|
|
467
|
+
return this.has(value);
|
|
468
|
+
});
|
|
469
|
+
require_defineProperty._defineProperty(this, "canSelect", (collection, value) => {
|
|
470
|
+
return this.selectionMode !== "none" || !collection.getItemDisabled(collection.find(value));
|
|
471
|
+
});
|
|
472
|
+
require_defineProperty._defineProperty(this, "firstSelectedValue", (collection) => {
|
|
473
|
+
let firstValue = null;
|
|
474
|
+
for (let value of this) if (!firstValue || collection.compareValue(value, firstValue) < 0) firstValue = value;
|
|
475
|
+
return firstValue;
|
|
476
|
+
});
|
|
477
|
+
require_defineProperty._defineProperty(this, "lastSelectedValue", (collection) => {
|
|
478
|
+
let lastValue = null;
|
|
479
|
+
for (let value of this) if (!lastValue || collection.compareValue(value, lastValue) > 0) lastValue = value;
|
|
480
|
+
return lastValue;
|
|
481
|
+
});
|
|
482
|
+
require_defineProperty._defineProperty(this, "extendSelection", (collection, anchorValue, targetValue) => {
|
|
483
|
+
if (this.selectionMode === "none") return this;
|
|
484
|
+
if (this.selectionMode === "single") return this.replaceSelection(collection, targetValue);
|
|
485
|
+
const selection = this.copy();
|
|
486
|
+
const lastSelected = Array.from(this).pop();
|
|
487
|
+
for (let key of collection.getValueRange(anchorValue, lastSelected ?? targetValue)) selection.delete(key);
|
|
488
|
+
for (let key of collection.getValueRange(targetValue, anchorValue)) if (this.canSelect(collection, key)) selection.add(key);
|
|
489
|
+
return selection;
|
|
490
|
+
});
|
|
491
|
+
require_defineProperty._defineProperty(this, "toggleSelection", (collection, value) => {
|
|
492
|
+
if (this.selectionMode === "none") return this;
|
|
493
|
+
if (this.selectionMode === "single" && !this.isSelected(value)) return this.replaceSelection(collection, value);
|
|
494
|
+
const selection = this.copy();
|
|
495
|
+
if (selection.has(value)) selection.delete(value);
|
|
496
|
+
else if (selection.canSelect(collection, value)) selection.add(value);
|
|
497
|
+
return selection;
|
|
498
|
+
});
|
|
499
|
+
require_defineProperty._defineProperty(this, "replaceSelection", (collection, value) => {
|
|
500
|
+
if (this.selectionMode === "none") return this;
|
|
501
|
+
if (value == null) return this;
|
|
502
|
+
if (!this.canSelect(collection, value)) return this;
|
|
503
|
+
const selection = new Selection([value]);
|
|
504
|
+
return this.sync(selection);
|
|
505
|
+
});
|
|
506
|
+
require_defineProperty._defineProperty(this, "setSelection", (values$1) => {
|
|
507
|
+
if (this.selectionMode === "none") return this;
|
|
508
|
+
let selection = new Selection();
|
|
509
|
+
for (let value of values$1) if (value != null) {
|
|
510
|
+
selection.add(value);
|
|
511
|
+
if (this.selectionMode === "single") break;
|
|
512
|
+
}
|
|
513
|
+
return this.sync(selection);
|
|
514
|
+
});
|
|
515
|
+
require_defineProperty._defineProperty(this, "clearSelection", () => {
|
|
516
|
+
const selection = this.copy();
|
|
517
|
+
if (selection.deselectable && selection.size > 0) selection.clear();
|
|
518
|
+
return selection;
|
|
519
|
+
});
|
|
520
|
+
require_defineProperty._defineProperty(this, "select", (collection, value, forceToggle) => {
|
|
521
|
+
if (this.selectionMode === "none") return this;
|
|
522
|
+
if (this.selectionMode === "single") if (this.isSelected(value) && this.deselectable) return this.toggleSelection(collection, value);
|
|
523
|
+
else return this.replaceSelection(collection, value);
|
|
524
|
+
else if (this.selectionMode === "multiple" || forceToggle) return this.toggleSelection(collection, value);
|
|
525
|
+
else return this.replaceSelection(collection, value);
|
|
526
|
+
});
|
|
527
|
+
require_defineProperty._defineProperty(this, "deselect", (value) => {
|
|
528
|
+
const selection = this.copy();
|
|
529
|
+
selection.delete(value);
|
|
530
|
+
return selection;
|
|
531
|
+
});
|
|
532
|
+
require_defineProperty._defineProperty(this, "isEqual", (other) => {
|
|
533
|
+
return require_utils.isEqual(Array.from(this), Array.from(other));
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
};
|
|
537
|
+
|
|
538
|
+
//#endregion
|
|
539
|
+
//#region src/shared/collection/tree-visit.ts
|
|
540
|
+
function access(node, indexPath, options) {
|
|
541
|
+
for (let i = 0; i < indexPath.length; i++) node = options.getChildren(node, indexPath.slice(i + 1))[indexPath[i]];
|
|
542
|
+
return node;
|
|
543
|
+
}
|
|
544
|
+
function ancestorIndexPaths(indexPaths) {
|
|
545
|
+
const sortedPaths = sortIndexPaths(indexPaths);
|
|
546
|
+
const result = [];
|
|
547
|
+
const seen = /* @__PURE__ */ new Set();
|
|
548
|
+
for (const indexPath of sortedPaths) {
|
|
549
|
+
const key = indexPath.join();
|
|
550
|
+
if (!seen.has(key)) {
|
|
551
|
+
seen.add(key);
|
|
552
|
+
result.push(indexPath);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
return result;
|
|
556
|
+
}
|
|
557
|
+
function compareIndexPaths(a, b) {
|
|
558
|
+
for (let i = 0; i < Math.min(a.length, b.length); i++) {
|
|
559
|
+
if (a[i] < b[i]) return -1;
|
|
560
|
+
if (a[i] > b[i]) return 1;
|
|
561
|
+
}
|
|
562
|
+
return a.length - b.length;
|
|
563
|
+
}
|
|
564
|
+
function sortIndexPaths(indexPaths) {
|
|
565
|
+
return indexPaths.sort(compareIndexPaths);
|
|
566
|
+
}
|
|
567
|
+
function find(node, options) {
|
|
568
|
+
let found;
|
|
569
|
+
visit(node, {
|
|
570
|
+
...options,
|
|
571
|
+
onEnter: (child, indexPath) => {
|
|
572
|
+
if (options.predicate(child, indexPath)) {
|
|
573
|
+
found = child;
|
|
574
|
+
return "stop";
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
});
|
|
578
|
+
return found;
|
|
579
|
+
}
|
|
580
|
+
function findAll(node, options) {
|
|
581
|
+
const found = [];
|
|
582
|
+
visit(node, {
|
|
583
|
+
onEnter: (child, indexPath) => {
|
|
584
|
+
if (options.predicate(child, indexPath)) found.push(child);
|
|
585
|
+
},
|
|
586
|
+
getChildren: options.getChildren
|
|
587
|
+
});
|
|
588
|
+
return found;
|
|
589
|
+
}
|
|
590
|
+
function findIndexPath(node, options) {
|
|
591
|
+
let found;
|
|
592
|
+
visit(node, {
|
|
593
|
+
onEnter: (child, indexPath) => {
|
|
594
|
+
if (options.predicate(child, indexPath)) {
|
|
595
|
+
found = [...indexPath];
|
|
596
|
+
return "stop";
|
|
597
|
+
}
|
|
598
|
+
},
|
|
599
|
+
getChildren: options.getChildren
|
|
600
|
+
});
|
|
601
|
+
return found;
|
|
602
|
+
}
|
|
603
|
+
function reduce(node, options) {
|
|
604
|
+
let result = options.initialResult;
|
|
605
|
+
visit(node, {
|
|
606
|
+
...options,
|
|
607
|
+
onEnter: (child, indexPath) => {
|
|
608
|
+
result = options.nextResult(result, child, indexPath);
|
|
609
|
+
}
|
|
610
|
+
});
|
|
611
|
+
return result;
|
|
612
|
+
}
|
|
613
|
+
function flatMap(node, options) {
|
|
614
|
+
return reduce(node, {
|
|
615
|
+
...options,
|
|
616
|
+
initialResult: [],
|
|
617
|
+
nextResult: (result, child, indexPath) => {
|
|
618
|
+
result.push(...options.transform(child, indexPath));
|
|
619
|
+
return result;
|
|
620
|
+
}
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
function filter(node, options) {
|
|
624
|
+
const { predicate, create, getChildren } = options;
|
|
625
|
+
const filterRecursive = (node$1, indexPath) => {
|
|
626
|
+
const children = getChildren(node$1, indexPath);
|
|
627
|
+
const filteredChildren = [];
|
|
628
|
+
children.forEach((child, index) => {
|
|
629
|
+
const filteredChild = filterRecursive(child, [...indexPath, index]);
|
|
630
|
+
if (filteredChild) filteredChildren.push(filteredChild);
|
|
631
|
+
});
|
|
632
|
+
const isRoot = indexPath.length === 0;
|
|
633
|
+
const nodeMatches = predicate(node$1, indexPath);
|
|
634
|
+
const hasFilteredChildren = filteredChildren.length > 0;
|
|
635
|
+
if (isRoot || nodeMatches || hasFilteredChildren) return create(node$1, filteredChildren, indexPath);
|
|
636
|
+
return null;
|
|
637
|
+
};
|
|
638
|
+
return filterRecursive(node, []) || create(node, [], []);
|
|
639
|
+
}
|
|
640
|
+
function flatten(rootNode, options) {
|
|
641
|
+
const nodes = [];
|
|
642
|
+
let idx = 0;
|
|
643
|
+
const idxMap = /* @__PURE__ */ new Map();
|
|
644
|
+
const parentMap = /* @__PURE__ */ new Map();
|
|
645
|
+
visit(rootNode, {
|
|
646
|
+
getChildren: options.getChildren,
|
|
647
|
+
onEnter: (node, indexPath) => {
|
|
648
|
+
if (!idxMap.has(node)) idxMap.set(node, idx++);
|
|
649
|
+
const children = options.getChildren(node, indexPath);
|
|
650
|
+
children.forEach((child) => {
|
|
651
|
+
if (!parentMap.has(child)) parentMap.set(child, node);
|
|
652
|
+
if (!idxMap.has(child)) idxMap.set(child, idx++);
|
|
653
|
+
});
|
|
654
|
+
const _children = children.length > 0 ? children.map((child) => idxMap.get(child)) : void 0;
|
|
655
|
+
const parent = parentMap.get(node);
|
|
656
|
+
const _parent = parent ? idxMap.get(parent) : void 0;
|
|
657
|
+
const _index = idxMap.get(node);
|
|
658
|
+
nodes.push({
|
|
659
|
+
...node,
|
|
660
|
+
_children,
|
|
661
|
+
_parent,
|
|
662
|
+
_index
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
});
|
|
666
|
+
return nodes;
|
|
667
|
+
}
|
|
668
|
+
function insertOperation(index, nodes) {
|
|
669
|
+
return {
|
|
670
|
+
type: "insert",
|
|
671
|
+
index,
|
|
672
|
+
nodes
|
|
673
|
+
};
|
|
674
|
+
}
|
|
675
|
+
function removeOperation(indexes) {
|
|
676
|
+
return {
|
|
677
|
+
type: "remove",
|
|
678
|
+
indexes
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
function replaceOperation() {
|
|
682
|
+
return { type: "replace" };
|
|
683
|
+
}
|
|
684
|
+
function splitIndexPath(indexPath) {
|
|
685
|
+
return [indexPath.slice(0, -1), indexPath[indexPath.length - 1]];
|
|
686
|
+
}
|
|
687
|
+
function getInsertionOperations(indexPath, nodes, operations = /* @__PURE__ */ new Map()) {
|
|
688
|
+
const [parentIndexPath, index] = splitIndexPath(indexPath);
|
|
689
|
+
for (let i = parentIndexPath.length - 1; i >= 0; i--) {
|
|
690
|
+
const parentKey = parentIndexPath.slice(0, i).join();
|
|
691
|
+
switch (operations.get(parentKey)?.type) {
|
|
692
|
+
case "remove": continue;
|
|
693
|
+
}
|
|
694
|
+
operations.set(parentKey, replaceOperation());
|
|
695
|
+
}
|
|
696
|
+
const operation = operations.get(parentIndexPath.join());
|
|
697
|
+
switch (operation?.type) {
|
|
698
|
+
case "remove":
|
|
699
|
+
operations.set(parentIndexPath.join(), {
|
|
700
|
+
type: "removeThenInsert",
|
|
701
|
+
removeIndexes: operation.indexes,
|
|
702
|
+
insertIndex: index,
|
|
703
|
+
insertNodes: nodes
|
|
704
|
+
});
|
|
705
|
+
break;
|
|
706
|
+
default: operations.set(parentIndexPath.join(), insertOperation(index, nodes));
|
|
707
|
+
}
|
|
708
|
+
return operations;
|
|
709
|
+
}
|
|
710
|
+
function getRemovalOperations(indexPaths) {
|
|
711
|
+
const operations = /* @__PURE__ */ new Map();
|
|
712
|
+
const indexesToRemove = /* @__PURE__ */ new Map();
|
|
713
|
+
for (const indexPath of indexPaths) {
|
|
714
|
+
const parentKey = indexPath.slice(0, -1).join();
|
|
715
|
+
const value = indexesToRemove.get(parentKey) ?? [];
|
|
716
|
+
value.push(indexPath[indexPath.length - 1]);
|
|
717
|
+
indexesToRemove.set(parentKey, value.sort((a, b) => a - b));
|
|
718
|
+
}
|
|
719
|
+
for (const indexPath of indexPaths) for (let i = indexPath.length - 2; i >= 0; i--) {
|
|
720
|
+
const parentKey = indexPath.slice(0, i).join();
|
|
721
|
+
if (!operations.has(parentKey)) operations.set(parentKey, replaceOperation());
|
|
722
|
+
}
|
|
723
|
+
for (const [parentKey, indexes] of indexesToRemove) operations.set(parentKey, removeOperation(indexes));
|
|
724
|
+
return operations;
|
|
725
|
+
}
|
|
726
|
+
function getReplaceOperations(indexPath, node) {
|
|
727
|
+
const operations = /* @__PURE__ */ new Map();
|
|
728
|
+
const [parentIndexPath, index] = splitIndexPath(indexPath);
|
|
729
|
+
for (let i = parentIndexPath.length - 1; i >= 0; i--) {
|
|
730
|
+
const parentKey = parentIndexPath.slice(0, i).join();
|
|
731
|
+
operations.set(parentKey, replaceOperation());
|
|
732
|
+
}
|
|
733
|
+
operations.set(parentIndexPath.join(), {
|
|
734
|
+
type: "removeThenInsert",
|
|
735
|
+
removeIndexes: [index],
|
|
736
|
+
insertIndex: index,
|
|
737
|
+
insertNodes: [node]
|
|
738
|
+
});
|
|
739
|
+
return operations;
|
|
740
|
+
}
|
|
741
|
+
function mutate(node, operations, options) {
|
|
742
|
+
return map(node, {
|
|
743
|
+
...options,
|
|
744
|
+
getChildren: (node$1, indexPath) => {
|
|
745
|
+
const key = indexPath.join();
|
|
746
|
+
switch (operations.get(key)?.type) {
|
|
747
|
+
case "replace":
|
|
748
|
+
case "remove":
|
|
749
|
+
case "removeThenInsert":
|
|
750
|
+
case "insert": return options.getChildren(node$1, indexPath);
|
|
751
|
+
default: return [];
|
|
752
|
+
}
|
|
753
|
+
},
|
|
754
|
+
transform: (node$1, children, indexPath) => {
|
|
755
|
+
const key = indexPath.join();
|
|
756
|
+
const operation = operations.get(key);
|
|
757
|
+
switch (operation?.type) {
|
|
758
|
+
case "remove": return options.create(node$1, children.filter((_, index) => !operation.indexes.includes(index)), indexPath);
|
|
759
|
+
case "removeThenInsert":
|
|
760
|
+
const updatedChildren = children.filter((_, index) => !operation.removeIndexes.includes(index));
|
|
761
|
+
const adjustedIndex = operation.removeIndexes.reduce((index, removedIndex) => removedIndex < index ? index - 1 : index, operation.insertIndex);
|
|
762
|
+
return options.create(node$1, splice(updatedChildren, adjustedIndex, 0, ...operation.insertNodes), indexPath);
|
|
763
|
+
case "insert": return options.create(node$1, splice(children, operation.index, 0, ...operation.nodes), indexPath);
|
|
764
|
+
case "replace": return options.create(node$1, children, indexPath);
|
|
765
|
+
default: return node$1;
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
function splice(array, start, deleteCount, ...items) {
|
|
771
|
+
return [
|
|
772
|
+
...array.slice(0, start),
|
|
773
|
+
...items,
|
|
774
|
+
...array.slice(start + deleteCount)
|
|
775
|
+
];
|
|
776
|
+
}
|
|
777
|
+
function map(node, options) {
|
|
778
|
+
const childrenMap = {};
|
|
779
|
+
visit(node, {
|
|
780
|
+
...options,
|
|
781
|
+
onLeave: (child, indexPath) => {
|
|
782
|
+
const keyIndexPath = [0, ...indexPath];
|
|
783
|
+
const key = keyIndexPath.join();
|
|
784
|
+
const transformed = options.transform(child, childrenMap[key] ?? [], indexPath);
|
|
785
|
+
const parentKey = keyIndexPath.slice(0, -1).join();
|
|
786
|
+
const parentChildren = childrenMap[parentKey] ?? [];
|
|
787
|
+
parentChildren.push(transformed);
|
|
788
|
+
childrenMap[parentKey] = parentChildren;
|
|
789
|
+
}
|
|
790
|
+
});
|
|
791
|
+
return childrenMap[""][0];
|
|
792
|
+
}
|
|
793
|
+
function insert(node, options) {
|
|
794
|
+
const { nodes, at } = options;
|
|
795
|
+
if (at.length === 0) throw new Error(`Can't insert nodes at the root`);
|
|
796
|
+
return mutate(node, getInsertionOperations(at, nodes), options);
|
|
797
|
+
}
|
|
798
|
+
function replace(node, options) {
|
|
799
|
+
if (options.at.length === 0) return options.node;
|
|
800
|
+
return mutate(node, getReplaceOperations(options.at, options.node), options);
|
|
801
|
+
}
|
|
802
|
+
function remove(node, options) {
|
|
803
|
+
if (options.indexPaths.length === 0) return node;
|
|
804
|
+
for (const indexPath of options.indexPaths) if (indexPath.length === 0) throw new Error(`Can't remove the root node`);
|
|
805
|
+
return mutate(node, getRemovalOperations(options.indexPaths), options);
|
|
806
|
+
}
|
|
807
|
+
function move(node, options) {
|
|
808
|
+
if (options.indexPaths.length === 0) return node;
|
|
809
|
+
for (const indexPath of options.indexPaths) if (indexPath.length === 0) throw new Error(`Can't move the root node`);
|
|
810
|
+
if (options.to.length === 0) throw new Error(`Can't move nodes to the root`);
|
|
811
|
+
const _ancestorIndexPaths = ancestorIndexPaths(options.indexPaths);
|
|
812
|
+
const nodesToInsert = _ancestorIndexPaths.map((indexPath) => access(node, indexPath, options));
|
|
813
|
+
return mutate(node, getInsertionOperations(options.to, nodesToInsert, getRemovalOperations(_ancestorIndexPaths)), options);
|
|
814
|
+
}
|
|
815
|
+
function visit(node, options) {
|
|
816
|
+
const { onEnter, onLeave, getChildren } = options;
|
|
817
|
+
let indexPath = [];
|
|
818
|
+
let stack = [{ node }];
|
|
819
|
+
const getIndexPath = options.reuseIndexPath ? () => indexPath : () => indexPath.slice();
|
|
820
|
+
while (stack.length > 0) {
|
|
821
|
+
let wrapper = stack[stack.length - 1];
|
|
822
|
+
if (wrapper.state === void 0) {
|
|
823
|
+
const enterResult = onEnter?.(wrapper.node, getIndexPath());
|
|
824
|
+
if (enterResult === "stop") return;
|
|
825
|
+
wrapper.state = enterResult === "skip" ? -1 : 0;
|
|
826
|
+
}
|
|
827
|
+
const children = wrapper.children || getChildren(wrapper.node, getIndexPath());
|
|
828
|
+
wrapper.children || (wrapper.children = children);
|
|
829
|
+
if (wrapper.state !== -1) {
|
|
830
|
+
if (wrapper.state < children.length) {
|
|
831
|
+
let currentIndex = wrapper.state;
|
|
832
|
+
indexPath.push(currentIndex);
|
|
833
|
+
stack.push({ node: children[currentIndex] });
|
|
834
|
+
wrapper.state = currentIndex + 1;
|
|
835
|
+
continue;
|
|
836
|
+
}
|
|
837
|
+
if (onLeave?.(wrapper.node, getIndexPath()) === "stop") return;
|
|
838
|
+
}
|
|
839
|
+
indexPath.pop();
|
|
840
|
+
stack.pop();
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
//#endregion
|
|
845
|
+
//#region src/shared/collection/tree-collection.ts
|
|
846
|
+
var TreeCollection = class TreeCollection {
|
|
847
|
+
constructor(options) {
|
|
848
|
+
this.options = options;
|
|
849
|
+
require_defineProperty._defineProperty(this, "rootNode", void 0);
|
|
850
|
+
require_defineProperty._defineProperty(this, "isEqual", (other) => {
|
|
851
|
+
return require_utils.isEqual(this.rootNode, other.rootNode);
|
|
852
|
+
});
|
|
853
|
+
require_defineProperty._defineProperty(this, "getNodeChildren", (node) => {
|
|
854
|
+
return this.options.nodeToChildren?.(node) ?? fallbackMethods.nodeToChildren(node) ?? [];
|
|
855
|
+
});
|
|
856
|
+
require_defineProperty._defineProperty(this, "resolveIndexPath", (valueOrIndexPath) => {
|
|
857
|
+
return typeof valueOrIndexPath === "string" ? this.getIndexPath(valueOrIndexPath) : valueOrIndexPath;
|
|
858
|
+
});
|
|
859
|
+
require_defineProperty._defineProperty(this, "resolveNode", (valueOrIndexPath) => {
|
|
860
|
+
const indexPath = this.resolveIndexPath(valueOrIndexPath);
|
|
861
|
+
return indexPath ? this.at(indexPath) : void 0;
|
|
862
|
+
});
|
|
863
|
+
require_defineProperty._defineProperty(this, "getNodeChildrenCount", (node) => {
|
|
864
|
+
return this.options.nodeToChildrenCount?.(node) ?? fallbackMethods.nodeToChildrenCount(node);
|
|
865
|
+
});
|
|
866
|
+
require_defineProperty._defineProperty(this, "getNodeValue", (node) => {
|
|
867
|
+
return this.options.nodeToValue?.(node) ?? fallbackMethods.nodeToValue(node);
|
|
868
|
+
});
|
|
869
|
+
require_defineProperty._defineProperty(this, "getNodeDisabled", (node) => {
|
|
870
|
+
return this.options.isNodeDisabled?.(node) ?? fallbackMethods.isNodeDisabled(node);
|
|
871
|
+
});
|
|
872
|
+
require_defineProperty._defineProperty(this, "stringify", (value) => {
|
|
873
|
+
const node = this.findNode(value);
|
|
874
|
+
if (!node) return null;
|
|
875
|
+
return this.stringifyNode(node);
|
|
876
|
+
});
|
|
877
|
+
require_defineProperty._defineProperty(this, "stringifyNode", (node) => {
|
|
878
|
+
return this.options.nodeToString?.(node) ?? fallbackMethods.nodeToString(node);
|
|
879
|
+
});
|
|
880
|
+
require_defineProperty._defineProperty(this, "getFirstNode", (rootNode = this.rootNode) => {
|
|
881
|
+
let firstChild;
|
|
882
|
+
visit(rootNode, {
|
|
883
|
+
getChildren: this.getNodeChildren,
|
|
884
|
+
onEnter: (node, indexPath) => {
|
|
885
|
+
if (!firstChild && indexPath.length > 0 && !this.getNodeDisabled(node)) {
|
|
886
|
+
firstChild = node;
|
|
887
|
+
return "stop";
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
});
|
|
891
|
+
return firstChild;
|
|
892
|
+
});
|
|
893
|
+
require_defineProperty._defineProperty(this, "getLastNode", (rootNode = this.rootNode, opts = {}) => {
|
|
894
|
+
let lastChild;
|
|
895
|
+
visit(rootNode, {
|
|
896
|
+
getChildren: this.getNodeChildren,
|
|
897
|
+
onEnter: (node, indexPath) => {
|
|
898
|
+
if (this.isSameNode(node, rootNode)) return;
|
|
899
|
+
if (opts.skip?.({
|
|
900
|
+
value: this.getNodeValue(node),
|
|
901
|
+
node,
|
|
902
|
+
indexPath
|
|
903
|
+
})) return "skip";
|
|
904
|
+
if (indexPath.length > 0 && !this.getNodeDisabled(node)) lastChild = node;
|
|
905
|
+
}
|
|
906
|
+
});
|
|
907
|
+
return lastChild;
|
|
908
|
+
});
|
|
909
|
+
require_defineProperty._defineProperty(this, "at", (indexPath) => {
|
|
910
|
+
return access(this.rootNode, indexPath, { getChildren: this.getNodeChildren });
|
|
911
|
+
});
|
|
912
|
+
require_defineProperty._defineProperty(this, "findNode", (value, rootNode = this.rootNode) => {
|
|
913
|
+
return find(rootNode, {
|
|
914
|
+
getChildren: this.getNodeChildren,
|
|
915
|
+
predicate: (node) => this.getNodeValue(node) === value
|
|
916
|
+
});
|
|
917
|
+
});
|
|
918
|
+
require_defineProperty._defineProperty(this, "findNodes", (values, rootNode = this.rootNode) => {
|
|
919
|
+
const v = new Set(values.filter((v$1) => v$1 != null));
|
|
920
|
+
return findAll(rootNode, {
|
|
921
|
+
getChildren: this.getNodeChildren,
|
|
922
|
+
predicate: (node) => v.has(this.getNodeValue(node))
|
|
923
|
+
});
|
|
924
|
+
});
|
|
925
|
+
require_defineProperty._defineProperty(this, "sort", (values) => {
|
|
926
|
+
return values.reduce((acc, value) => {
|
|
927
|
+
const indexPath = this.getIndexPath(value);
|
|
928
|
+
if (indexPath) acc.push({
|
|
929
|
+
value,
|
|
930
|
+
indexPath
|
|
931
|
+
});
|
|
932
|
+
return acc;
|
|
933
|
+
}, []).sort((a, b) => compareIndexPaths(a.indexPath, b.indexPath)).map(({ value }) => value);
|
|
934
|
+
});
|
|
935
|
+
require_defineProperty._defineProperty(this, "getIndexPath", (value) => {
|
|
936
|
+
return findIndexPath(this.rootNode, {
|
|
937
|
+
getChildren: this.getNodeChildren,
|
|
938
|
+
predicate: (node) => this.getNodeValue(node) === value
|
|
939
|
+
});
|
|
940
|
+
});
|
|
941
|
+
require_defineProperty._defineProperty(this, "getValue", (indexPath) => {
|
|
942
|
+
const node = this.at(indexPath);
|
|
943
|
+
return node ? this.getNodeValue(node) : void 0;
|
|
944
|
+
});
|
|
945
|
+
require_defineProperty._defineProperty(this, "getValuePath", (indexPath) => {
|
|
946
|
+
if (!indexPath) return [];
|
|
947
|
+
const valuePath = [];
|
|
948
|
+
let currentPath = [...indexPath];
|
|
949
|
+
while (currentPath.length > 0) {
|
|
950
|
+
const node = this.at(currentPath);
|
|
951
|
+
if (node) valuePath.unshift(this.getNodeValue(node));
|
|
952
|
+
currentPath.pop();
|
|
953
|
+
}
|
|
954
|
+
return valuePath;
|
|
955
|
+
});
|
|
956
|
+
require_defineProperty._defineProperty(this, "getDepth", (value) => {
|
|
957
|
+
return findIndexPath(this.rootNode, {
|
|
958
|
+
getChildren: this.getNodeChildren,
|
|
959
|
+
predicate: (node) => this.getNodeValue(node) === value
|
|
960
|
+
})?.length ?? 0;
|
|
961
|
+
});
|
|
962
|
+
require_defineProperty._defineProperty(this, "isSameNode", (node, other) => {
|
|
963
|
+
return this.getNodeValue(node) === this.getNodeValue(other);
|
|
964
|
+
});
|
|
965
|
+
require_defineProperty._defineProperty(this, "isRootNode", (node) => {
|
|
966
|
+
return this.isSameNode(node, this.rootNode);
|
|
967
|
+
});
|
|
968
|
+
require_defineProperty._defineProperty(this, "contains", (parentIndexPath, valueIndexPath) => {
|
|
969
|
+
if (!parentIndexPath || !valueIndexPath) return false;
|
|
970
|
+
return valueIndexPath.slice(0, parentIndexPath.length).every((_, i) => parentIndexPath[i] === valueIndexPath[i]);
|
|
971
|
+
});
|
|
972
|
+
require_defineProperty._defineProperty(this, "getNextNode", (value, opts = {}) => {
|
|
973
|
+
let found = false;
|
|
974
|
+
let nextNode;
|
|
975
|
+
visit(this.rootNode, {
|
|
976
|
+
getChildren: this.getNodeChildren,
|
|
977
|
+
onEnter: (node, indexPath) => {
|
|
978
|
+
if (this.isRootNode(node)) return;
|
|
979
|
+
const nodeValue = this.getNodeValue(node);
|
|
980
|
+
if (opts.skip?.({
|
|
981
|
+
value: nodeValue,
|
|
982
|
+
node,
|
|
983
|
+
indexPath
|
|
984
|
+
})) {
|
|
985
|
+
if (nodeValue === value) found = true;
|
|
986
|
+
return "skip";
|
|
987
|
+
}
|
|
988
|
+
if (found && !this.getNodeDisabled(node)) {
|
|
989
|
+
nextNode = node;
|
|
990
|
+
return "stop";
|
|
991
|
+
}
|
|
992
|
+
if (nodeValue === value) found = true;
|
|
993
|
+
}
|
|
994
|
+
});
|
|
995
|
+
return nextNode;
|
|
996
|
+
});
|
|
997
|
+
require_defineProperty._defineProperty(this, "getPreviousNode", (value, opts = {}) => {
|
|
998
|
+
let previousNode;
|
|
999
|
+
let found = false;
|
|
1000
|
+
visit(this.rootNode, {
|
|
1001
|
+
getChildren: this.getNodeChildren,
|
|
1002
|
+
onEnter: (node, indexPath) => {
|
|
1003
|
+
if (this.isRootNode(node)) return;
|
|
1004
|
+
const nodeValue = this.getNodeValue(node);
|
|
1005
|
+
if (opts.skip?.({
|
|
1006
|
+
value: nodeValue,
|
|
1007
|
+
node,
|
|
1008
|
+
indexPath
|
|
1009
|
+
})) return "skip";
|
|
1010
|
+
if (nodeValue === value) {
|
|
1011
|
+
found = true;
|
|
1012
|
+
return "stop";
|
|
1013
|
+
}
|
|
1014
|
+
if (!this.getNodeDisabled(node)) previousNode = node;
|
|
1015
|
+
}
|
|
1016
|
+
});
|
|
1017
|
+
return found ? previousNode : void 0;
|
|
1018
|
+
});
|
|
1019
|
+
require_defineProperty._defineProperty(this, "getParentNodes", (valueOrIndexPath) => {
|
|
1020
|
+
const indexPath = this.resolveIndexPath(valueOrIndexPath)?.slice();
|
|
1021
|
+
if (!indexPath) return [];
|
|
1022
|
+
const result = [];
|
|
1023
|
+
while (indexPath.length > 0) {
|
|
1024
|
+
indexPath.pop();
|
|
1025
|
+
const parentNode = this.at(indexPath);
|
|
1026
|
+
if (parentNode && !this.isRootNode(parentNode)) result.unshift(parentNode);
|
|
1027
|
+
}
|
|
1028
|
+
return result;
|
|
1029
|
+
});
|
|
1030
|
+
require_defineProperty._defineProperty(this, "getDescendantNodes", (valueOrIndexPath, options$1) => {
|
|
1031
|
+
const parentNode = this.resolveNode(valueOrIndexPath);
|
|
1032
|
+
if (!parentNode) return [];
|
|
1033
|
+
const result = [];
|
|
1034
|
+
visit(parentNode, {
|
|
1035
|
+
getChildren: this.getNodeChildren,
|
|
1036
|
+
onEnter: (node, nodeIndexPath) => {
|
|
1037
|
+
if (nodeIndexPath.length === 0) return;
|
|
1038
|
+
if (!options$1?.withBranch && this.isBranchNode(node)) return;
|
|
1039
|
+
result.push(node);
|
|
1040
|
+
}
|
|
1041
|
+
});
|
|
1042
|
+
return result;
|
|
1043
|
+
});
|
|
1044
|
+
require_defineProperty._defineProperty(this, "getDescendantValues", (valueOrIndexPath, options$1) => {
|
|
1045
|
+
return this.getDescendantNodes(valueOrIndexPath, options$1).map((child) => this.getNodeValue(child));
|
|
1046
|
+
});
|
|
1047
|
+
require_defineProperty._defineProperty(this, "getParentIndexPath", (indexPath) => {
|
|
1048
|
+
return indexPath.slice(0, -1);
|
|
1049
|
+
});
|
|
1050
|
+
require_defineProperty._defineProperty(this, "getParentNode", (valueOrIndexPath) => {
|
|
1051
|
+
const indexPath = this.resolveIndexPath(valueOrIndexPath);
|
|
1052
|
+
return indexPath ? this.at(this.getParentIndexPath(indexPath)) : void 0;
|
|
1053
|
+
});
|
|
1054
|
+
require_defineProperty._defineProperty(this, "visit", (opts) => {
|
|
1055
|
+
const { skip, ...rest } = opts;
|
|
1056
|
+
visit(this.rootNode, {
|
|
1057
|
+
...rest,
|
|
1058
|
+
getChildren: this.getNodeChildren,
|
|
1059
|
+
onEnter: (node, indexPath) => {
|
|
1060
|
+
if (this.isRootNode(node)) return;
|
|
1061
|
+
if (skip?.({
|
|
1062
|
+
value: this.getNodeValue(node),
|
|
1063
|
+
node,
|
|
1064
|
+
indexPath
|
|
1065
|
+
})) return "skip";
|
|
1066
|
+
return rest.onEnter?.(node, indexPath);
|
|
1067
|
+
}
|
|
1068
|
+
});
|
|
1069
|
+
});
|
|
1070
|
+
require_defineProperty._defineProperty(this, "getPreviousSibling", (indexPath) => {
|
|
1071
|
+
const parentNode = this.getParentNode(indexPath);
|
|
1072
|
+
if (!parentNode) return;
|
|
1073
|
+
const siblings = this.getNodeChildren(parentNode);
|
|
1074
|
+
let idx = indexPath[indexPath.length - 1];
|
|
1075
|
+
while (--idx >= 0) {
|
|
1076
|
+
const sibling = siblings[idx];
|
|
1077
|
+
if (!this.getNodeDisabled(sibling)) return sibling;
|
|
1078
|
+
}
|
|
1079
|
+
});
|
|
1080
|
+
require_defineProperty._defineProperty(this, "getNextSibling", (indexPath) => {
|
|
1081
|
+
const parentNode = this.getParentNode(indexPath);
|
|
1082
|
+
if (!parentNode) return;
|
|
1083
|
+
const siblings = this.getNodeChildren(parentNode);
|
|
1084
|
+
let idx = indexPath[indexPath.length - 1];
|
|
1085
|
+
while (++idx < siblings.length) {
|
|
1086
|
+
const sibling = siblings[idx];
|
|
1087
|
+
if (!this.getNodeDisabled(sibling)) return sibling;
|
|
1088
|
+
}
|
|
1089
|
+
});
|
|
1090
|
+
require_defineProperty._defineProperty(this, "getSiblingNodes", (indexPath) => {
|
|
1091
|
+
const parentNode = this.getParentNode(indexPath);
|
|
1092
|
+
return parentNode ? this.getNodeChildren(parentNode) : [];
|
|
1093
|
+
});
|
|
1094
|
+
require_defineProperty._defineProperty(this, "getValues", (rootNode = this.rootNode) => {
|
|
1095
|
+
return flatMap(rootNode, {
|
|
1096
|
+
getChildren: this.getNodeChildren,
|
|
1097
|
+
transform: (node) => [this.getNodeValue(node)]
|
|
1098
|
+
}).slice(1);
|
|
1099
|
+
});
|
|
1100
|
+
require_defineProperty._defineProperty(this, "isValidDepth", (indexPath, depth) => {
|
|
1101
|
+
if (depth == null) return true;
|
|
1102
|
+
if (typeof depth === "function") return depth(indexPath.length);
|
|
1103
|
+
return indexPath.length === depth;
|
|
1104
|
+
});
|
|
1105
|
+
require_defineProperty._defineProperty(this, "isBranchNode", (node) => {
|
|
1106
|
+
return this.getNodeChildren(node).length > 0 || this.getNodeChildrenCount(node) != null;
|
|
1107
|
+
});
|
|
1108
|
+
require_defineProperty._defineProperty(this, "getBranchValues", (rootNode = this.rootNode, opts = {}) => {
|
|
1109
|
+
let values = [];
|
|
1110
|
+
visit(rootNode, {
|
|
1111
|
+
getChildren: this.getNodeChildren,
|
|
1112
|
+
onEnter: (node, indexPath) => {
|
|
1113
|
+
if (indexPath.length === 0) return;
|
|
1114
|
+
const nodeValue = this.getNodeValue(node);
|
|
1115
|
+
if (opts.skip?.({
|
|
1116
|
+
value: nodeValue,
|
|
1117
|
+
node,
|
|
1118
|
+
indexPath
|
|
1119
|
+
})) return "skip";
|
|
1120
|
+
if (this.isBranchNode(node) && this.isValidDepth(indexPath, opts.depth)) values.push(this.getNodeValue(node));
|
|
1121
|
+
}
|
|
1122
|
+
});
|
|
1123
|
+
return values;
|
|
1124
|
+
});
|
|
1125
|
+
require_defineProperty._defineProperty(this, "flatten", (rootNode = this.rootNode) => {
|
|
1126
|
+
return flatten(rootNode, { getChildren: this.getNodeChildren });
|
|
1127
|
+
});
|
|
1128
|
+
require_defineProperty._defineProperty(this, "_create", (node, children) => {
|
|
1129
|
+
if (this.getNodeChildren(node).length > 0 || children.length > 0) return {
|
|
1130
|
+
...node,
|
|
1131
|
+
children
|
|
1132
|
+
};
|
|
1133
|
+
return { ...node };
|
|
1134
|
+
});
|
|
1135
|
+
require_defineProperty._defineProperty(this, "_insert", (rootNode, indexPath, nodes) => {
|
|
1136
|
+
return this.copy(insert(rootNode, {
|
|
1137
|
+
at: indexPath,
|
|
1138
|
+
nodes,
|
|
1139
|
+
getChildren: this.getNodeChildren,
|
|
1140
|
+
create: this._create
|
|
1141
|
+
}));
|
|
1142
|
+
});
|
|
1143
|
+
require_defineProperty._defineProperty(this, "copy", (rootNode) => {
|
|
1144
|
+
return new TreeCollection({
|
|
1145
|
+
...this.options,
|
|
1146
|
+
rootNode
|
|
1147
|
+
});
|
|
1148
|
+
});
|
|
1149
|
+
require_defineProperty._defineProperty(this, "_replace", (rootNode, indexPath, node) => {
|
|
1150
|
+
return this.copy(replace(rootNode, {
|
|
1151
|
+
at: indexPath,
|
|
1152
|
+
node,
|
|
1153
|
+
getChildren: this.getNodeChildren,
|
|
1154
|
+
create: this._create
|
|
1155
|
+
}));
|
|
1156
|
+
});
|
|
1157
|
+
require_defineProperty._defineProperty(this, "_move", (rootNode, indexPaths, to) => {
|
|
1158
|
+
return this.copy(move(rootNode, {
|
|
1159
|
+
indexPaths,
|
|
1160
|
+
to,
|
|
1161
|
+
getChildren: this.getNodeChildren,
|
|
1162
|
+
create: this._create
|
|
1163
|
+
}));
|
|
1164
|
+
});
|
|
1165
|
+
require_defineProperty._defineProperty(this, "_remove", (rootNode, indexPaths) => {
|
|
1166
|
+
return this.copy(remove(rootNode, {
|
|
1167
|
+
indexPaths,
|
|
1168
|
+
getChildren: this.getNodeChildren,
|
|
1169
|
+
create: this._create
|
|
1170
|
+
}));
|
|
1171
|
+
});
|
|
1172
|
+
require_defineProperty._defineProperty(this, "replace", (indexPath, node) => {
|
|
1173
|
+
return this._replace(this.rootNode, indexPath, node);
|
|
1174
|
+
});
|
|
1175
|
+
require_defineProperty._defineProperty(this, "remove", (indexPaths) => {
|
|
1176
|
+
return this._remove(this.rootNode, indexPaths);
|
|
1177
|
+
});
|
|
1178
|
+
require_defineProperty._defineProperty(this, "insertBefore", (indexPath, nodes) => {
|
|
1179
|
+
return this.getParentNode(indexPath) ? this._insert(this.rootNode, indexPath, nodes) : void 0;
|
|
1180
|
+
});
|
|
1181
|
+
require_defineProperty._defineProperty(this, "insertAfter", (indexPath, nodes) => {
|
|
1182
|
+
if (!this.getParentNode(indexPath)) return;
|
|
1183
|
+
const nextIndex$1 = [...indexPath.slice(0, -1), indexPath[indexPath.length - 1] + 1];
|
|
1184
|
+
return this._insert(this.rootNode, nextIndex$1, nodes);
|
|
1185
|
+
});
|
|
1186
|
+
require_defineProperty._defineProperty(this, "move", (fromIndexPaths, toIndexPath) => {
|
|
1187
|
+
return this._move(this.rootNode, fromIndexPaths, toIndexPath);
|
|
1188
|
+
});
|
|
1189
|
+
require_defineProperty._defineProperty(this, "filter", (predicate) => {
|
|
1190
|
+
const filteredRoot = filter(this.rootNode, {
|
|
1191
|
+
predicate,
|
|
1192
|
+
getChildren: this.getNodeChildren,
|
|
1193
|
+
create: this._create
|
|
1194
|
+
});
|
|
1195
|
+
return this.copy(filteredRoot);
|
|
1196
|
+
});
|
|
1197
|
+
require_defineProperty._defineProperty(this, "toJSON", () => {
|
|
1198
|
+
return this.getValues(this.rootNode);
|
|
1199
|
+
});
|
|
1200
|
+
this.rootNode = options.rootNode;
|
|
1201
|
+
}
|
|
1202
|
+
};
|
|
1203
|
+
function flattenedToTree(nodes, options = fallbackMethods) {
|
|
1204
|
+
if (nodes.length === 0) throw new Error("[sprawlify-js/tree] Cannot create tree from empty flattened array");
|
|
1205
|
+
const rootFlatNode = nodes.find((node) => node._parent === void 0);
|
|
1206
|
+
if (!rootFlatNode) throw new Error("[sprawlify-js/tree] No root node found in flattened data");
|
|
1207
|
+
const nodeMap = /* @__PURE__ */ new Map();
|
|
1208
|
+
nodes.forEach((node) => {
|
|
1209
|
+
nodeMap.set(node._index, node);
|
|
1210
|
+
});
|
|
1211
|
+
const buildNode = (idx) => {
|
|
1212
|
+
const flatNode = nodeMap.get(idx);
|
|
1213
|
+
if (!flatNode) return {};
|
|
1214
|
+
const { _children, ...cleanNode } = flatNode;
|
|
1215
|
+
const children = [];
|
|
1216
|
+
_children?.forEach((childIndex) => {
|
|
1217
|
+
children.push(buildNode(childIndex));
|
|
1218
|
+
});
|
|
1219
|
+
return {
|
|
1220
|
+
...cleanNode,
|
|
1221
|
+
...children.length > 0 && { children }
|
|
1222
|
+
};
|
|
1223
|
+
};
|
|
1224
|
+
const rootNode = buildNode(rootFlatNode._index);
|
|
1225
|
+
return new TreeCollection({
|
|
1226
|
+
...options,
|
|
1227
|
+
rootNode
|
|
1228
|
+
});
|
|
1229
|
+
}
|
|
1230
|
+
function filePathToTree(paths) {
|
|
1231
|
+
const rootNode = {
|
|
1232
|
+
label: "",
|
|
1233
|
+
value: "ROOT",
|
|
1234
|
+
children: []
|
|
1235
|
+
};
|
|
1236
|
+
paths.forEach((path) => {
|
|
1237
|
+
const parts = path.split("/");
|
|
1238
|
+
let currentNode = rootNode;
|
|
1239
|
+
parts.forEach((part, index) => {
|
|
1240
|
+
let childNode = currentNode.children?.find((child) => child.label === part);
|
|
1241
|
+
if (!childNode) {
|
|
1242
|
+
var _currentNode;
|
|
1243
|
+
childNode = {
|
|
1244
|
+
value: parts.slice(0, index + 1).join("/"),
|
|
1245
|
+
label: part
|
|
1246
|
+
};
|
|
1247
|
+
(_currentNode = currentNode).children || (_currentNode.children = []);
|
|
1248
|
+
currentNode.children.push(childNode);
|
|
1249
|
+
}
|
|
1250
|
+
currentNode = childNode;
|
|
1251
|
+
});
|
|
1252
|
+
});
|
|
1253
|
+
return new TreeCollection({ rootNode });
|
|
1254
|
+
}
|
|
1255
|
+
const fallbackMethods = {
|
|
1256
|
+
nodeToValue(node) {
|
|
1257
|
+
if (typeof node === "string") return node;
|
|
1258
|
+
if (require_utils.isObject(node) && require_utils.hasProp(node, "value")) return node.value;
|
|
1259
|
+
return "";
|
|
1260
|
+
},
|
|
1261
|
+
nodeToString(node) {
|
|
1262
|
+
if (typeof node === "string") return node;
|
|
1263
|
+
if (require_utils.isObject(node) && require_utils.hasProp(node, "label")) return node.label;
|
|
1264
|
+
return fallbackMethods.nodeToValue(node);
|
|
1265
|
+
},
|
|
1266
|
+
isNodeDisabled(node) {
|
|
1267
|
+
if (require_utils.isObject(node) && require_utils.hasProp(node, "disabled")) return !!node.disabled;
|
|
1268
|
+
return false;
|
|
1269
|
+
},
|
|
1270
|
+
nodeToChildren(node) {
|
|
1271
|
+
return node.children;
|
|
1272
|
+
},
|
|
1273
|
+
nodeToChildrenCount(node) {
|
|
1274
|
+
if (require_utils.isObject(node) && require_utils.hasProp(node, "childrenCount")) return node.childrenCount;
|
|
1275
|
+
}
|
|
1276
|
+
};
|
|
1277
|
+
|
|
1278
|
+
//#endregion
|
|
1279
|
+
Object.defineProperty(exports, 'GridCollection', {
|
|
1280
|
+
enumerable: true,
|
|
1281
|
+
get: function () {
|
|
1282
|
+
return GridCollection;
|
|
1283
|
+
}
|
|
1284
|
+
});
|
|
1285
|
+
Object.defineProperty(exports, 'ListCollection', {
|
|
1286
|
+
enumerable: true,
|
|
1287
|
+
get: function () {
|
|
1288
|
+
return ListCollection;
|
|
1289
|
+
}
|
|
1290
|
+
});
|
|
1291
|
+
Object.defineProperty(exports, 'Selection', {
|
|
1292
|
+
enumerable: true,
|
|
1293
|
+
get: function () {
|
|
1294
|
+
return Selection;
|
|
1295
|
+
}
|
|
1296
|
+
});
|
|
1297
|
+
Object.defineProperty(exports, 'TreeCollection', {
|
|
1298
|
+
enumerable: true,
|
|
1299
|
+
get: function () {
|
|
1300
|
+
return TreeCollection;
|
|
1301
|
+
}
|
|
1302
|
+
});
|
|
1303
|
+
Object.defineProperty(exports, 'filePathToTree', {
|
|
1304
|
+
enumerable: true,
|
|
1305
|
+
get: function () {
|
|
1306
|
+
return filePathToTree;
|
|
1307
|
+
}
|
|
1308
|
+
});
|
|
1309
|
+
Object.defineProperty(exports, 'flattenedToTree', {
|
|
1310
|
+
enumerable: true,
|
|
1311
|
+
get: function () {
|
|
1312
|
+
return flattenedToTree;
|
|
1313
|
+
}
|
|
1314
|
+
});
|
|
1315
|
+
Object.defineProperty(exports, 'isGridCollection', {
|
|
1316
|
+
enumerable: true,
|
|
1317
|
+
get: function () {
|
|
1318
|
+
return isGridCollection;
|
|
1319
|
+
}
|
|
1320
|
+
});
|
|
1321
|
+
Object.defineProperty(exports, 'isListCollection', {
|
|
1322
|
+
enumerable: true,
|
|
1323
|
+
get: function () {
|
|
1324
|
+
return isListCollection;
|
|
1325
|
+
}
|
|
1326
|
+
});
|