@blofin/blofin-ui 0.7.58 → 0.7.59
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/Badge.es.js +8 -10
- package/dist/Button.es.js +125 -127
- package/dist/Dialog.es.js +10 -180
- package/dist/Divider.es.js +10 -12
- package/dist/Drawer.es.js +51 -44
- package/dist/Form.d.ts +1 -0
- package/dist/Form.es.js +752 -0
- package/dist/ProTable-63e2c020.js +3444 -0
- package/dist/ProTable.es.js +6 -9
- package/dist/Slider.es.js +140 -141
- package/dist/Sort.es.js +10 -144
- package/dist/blofin.css +1 -1
- package/dist/{close-0df24351.js → close-c67ec245.js} +0 -1
- package/dist/clsx.m-b14a941b.js +32 -0
- package/dist/components/Alert/Alert.d.ts +3 -3
- package/dist/components/Alert/styles.d.ts +2 -2
- package/dist/components/Badge/Badge.d.ts +2 -2
- package/dist/components/Button/Button.d.ts +2 -2
- package/dist/components/Button/Loading/index.d.ts +2 -2
- package/dist/components/Button/index.d.ts +0 -2
- package/dist/components/Button/styles.d.ts +1 -1
- package/dist/components/Checkbox/styles.d.ts +1 -1
- package/dist/components/CssDropdown/CssDropdown.d.ts +3 -3
- package/dist/components/DatePickerRange/styles.d.ts +1 -0
- package/dist/components/DateTimePicker/ScrollableList.d.ts +1 -1
- package/dist/components/Dialog/Dialog.d.ts +2 -5
- package/dist/components/Dialog/index.d.ts +2 -4
- package/dist/components/Dialog/styles.d.ts +2 -2
- package/dist/components/Drawer/Drawer.d.ts +1 -1
- package/dist/components/Dropdown/Dropdown.d.ts +2 -2
- package/dist/components/Empty/index.d.ts +5 -2
- package/dist/components/Form/Control.d.ts +13 -0
- package/dist/components/Form/Form.d.ts +4 -0
- package/dist/components/Form/FormItem.d.ts +4 -0
- package/dist/components/Form/FormLabel.d.ts +4 -0
- package/dist/components/Form/context.d.ts +6 -0
- package/dist/components/Form/index.d.ts +8 -0
- package/dist/components/Form/interface.d.ts +48 -0
- package/dist/components/Form/store.d.ts +16 -0
- package/dist/components/Form/styles/item.d.ts +5 -0
- package/dist/components/Form/useForm.d.ts +3 -0
- package/dist/components/LabelTextField/LabelTextField.d.ts +6 -6
- package/dist/components/MonthPicker/index.d.ts +17 -2
- package/dist/components/MultiSelect/MultiSelect.d.ts +4 -4
- package/dist/components/Notification/Notification.d.ts +1 -1
- package/dist/components/Pagination/PageOptions.d.ts +1 -1
- package/dist/components/Pagination/Pagination.d.ts +2 -2
- package/dist/components/Picker/hooks/usePickerMethod.d.ts +1 -1
- package/dist/components/Picker/index.d.ts +10 -2
- package/dist/components/Popover/Popover.d.ts +1 -1
- package/dist/components/Popup/index.d.ts +15 -4
- package/dist/components/RadioButton/RadioButton.d.ts +4 -4
- package/dist/components/RadioButton/styles.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +9 -6
- package/dist/components/Slider/Slider.d.ts +2 -2
- package/dist/components/Sort/SortButton.d.ts +5 -5
- package/dist/components/Sort/SortGroup.d.ts +4 -4
- package/dist/components/Sort/index.d.ts +6 -5
- package/dist/components/Sortable/SortItem.d.ts +4 -4
- package/dist/components/Sortable/index.d.ts +11 -3
- package/dist/components/Switch/Switch.d.ts +2 -2
- package/dist/components/Switch/styles.d.ts +3 -3
- package/dist/components/Tab/Tab.d.ts +2 -2
- package/dist/components/Tab/styles.d.ts +1 -1
- package/dist/components/Table/Pagination/index.d.ts +2 -2
- package/dist/components/Table/Table.d.ts +2 -2
- package/dist/components/Table/Tbody/index.d.ts +3 -3
- package/dist/components/Table/Thead/index.d.ts +3 -3
- package/dist/components/Table/context.d.ts +3 -3
- package/dist/components/Table/hooks/useStickyOffset.d.ts +3 -3
- package/dist/components/Table/index.d.ts +3 -3
- package/dist/components/Table/interface.d.ts +4 -4
- package/dist/components/TextField/TextField.d.ts +4 -4
- package/dist/components/TextField/index.d.ts +0 -2
- package/dist/components/TextSelect/TextSelect.d.ts +8 -8
- package/dist/components/Textarea/index.d.ts +15 -2
- package/dist/components/Toast/Toast.d.ts +13 -2
- package/dist/components/Toast/styles.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +5 -4
- package/dist/components/Typography/Typography.d.ts +2 -2
- package/dist/components/Typography/styles.d.ts +1 -1
- package/dist/hooks/useLatest.d.ts +1 -1
- package/dist/hooks/useNotification.d.ts +7 -5
- package/dist/hooks/useToast.d.ts +1 -1
- package/dist/{index-4f94d7fa.js → index-001dd0f7.js} +39 -24
- package/dist/{index-29d37c73.js → index-003572ca.js} +67 -52
- package/dist/{index-57a163fd.js → index-0330bc93.js} +28 -13
- package/dist/{index-d81e15f3.js → index-05bf2879.js} +34 -19
- package/dist/{index-b54ef52a.js → index-0773f9b5.js} +31 -16
- package/dist/{index-6856be22.js → index-0c50dcda.js} +38 -23
- package/dist/{index-7cf9b111.js → index-0e6d56f6.js} +33 -18
- package/dist/{index-a89abb42.js → index-0eb53476.js} +19 -4
- package/dist/{index-0230b5a9.js → index-0f855a91.js} +4 -5
- package/dist/{index-cbc0d36b.js → index-10144af4.js} +30 -15
- package/dist/{index-06d0f2f7.js → index-11dc8e91.js} +28 -13
- package/dist/{index-c6371af1.js → index-14eba896.js} +25 -10
- package/dist/{index-c1381bca.js → index-18869ac6.js} +35 -20
- package/dist/{index-1b2a64df.js → index-189196e6.js} +46 -31
- package/dist/{index-898678dc.js → index-198ccc85.js} +45 -30
- package/dist/{index-e2b960e4.js → index-1b087231.js} +38 -23
- package/dist/{index-f40f45fb.js → index-204cbb23.js} +30 -15
- package/dist/{index-4df0c3e4.js → index-220ed10a.js} +31 -16
- package/dist/{index-67678963.js → index-28a6835c.js} +48 -33
- package/dist/{index-e98ef24f.js → index-2d400fe1.js} +32 -17
- package/dist/{index-e8fb69e0.js → index-2e0c8d16.js} +37 -22
- package/dist/{index-cc1cd309.js → index-2e784550.js} +28 -13
- package/dist/index-304d7874.js +64 -0
- package/dist/{index-12d32536.js → index-3375e2e3.js} +28 -13
- package/dist/{index-954d3973.js → index-36521981.js} +28 -13
- package/dist/{index-cfee583b.js → index-377dc190.js} +36 -21
- package/dist/{index-4f94900a.js → index-390505ce.js} +34 -19
- package/dist/index-40626e62.js +174 -0
- package/dist/{index-b0da3dfd.js → index-41bebee7.js} +39 -24
- package/dist/{index-5fb7b3bc.js → index-45cfa2f3.js} +27 -12
- package/dist/{index-80cc70e4.js → index-47408940.js} +41 -26
- package/dist/{index-141cec17.js → index-4b9249fc.js} +29 -14
- package/dist/index-543e2f77.js +65 -0
- package/dist/index-563cafee.js +64 -0
- package/dist/index-5956ed9f.js +11569 -0
- package/dist/{index-b103ed31.js → index-59c7d611.js} +27 -12
- package/dist/{index-d2f2742e.js → index-5bc791c5.js} +30 -15
- package/dist/{index-03513979.js → index-5f3da225.js} +26 -11
- package/dist/{index-8aa9b1be.js → index-603f0f2a.js} +39 -24
- package/dist/{index-4bc493f0.js → index-636a6216.js} +19 -4
- package/dist/{index-2334248a.js → index-640dc4ab.js} +24 -9
- package/dist/{index-73bfc020.js → index-64ba8d88.js} +47 -32
- package/dist/{index-2ae0474b.js → index-65986673.js} +39 -24
- package/dist/{index-6f728206.js → index-65df0a7b.js} +24 -9
- package/dist/{index-02f669c4.js → index-6e4d9a19.js} +1 -2
- package/dist/{index-360aaaac.js → index-7241c703.js} +46 -31
- package/dist/index-7272669e.js +36 -0
- package/dist/{index-9c73c442.js → index-73673cf3.js} +60 -45
- package/dist/{index-08a64465.js → index-74676234.js} +31 -16
- package/dist/{index-7edb6aec.js → index-770fe605.js} +34 -19
- package/dist/{index-5beeed26.js → index-772d6529.js} +38 -23
- package/dist/{index-6e969585.js → index-797b8f6c.js} +52 -37
- package/dist/{index-a6fa33ce.js → index-7c12aa98.js} +28 -13
- package/dist/{index-5e6ffc2f.js → index-7e7cdd81.js} +1 -2
- package/dist/{index-03169373.js → index-81072b24.js} +37 -22
- package/dist/{index-75190b99.js → index-8684e896.js} +22 -7
- package/dist/{index-7bb9ffdf.js → index-89f184f3.js} +2 -3
- package/dist/{index-40710f09.js → index-8a7c46ae.js} +41 -26
- package/dist/{index-117d018c.js → index-8cec0e82.js} +37 -22
- package/dist/{index-094d2a65.js → index-91062be2.js} +34 -19
- package/dist/{index-d3419554.js → index-9253a5ce.js} +30 -15
- package/dist/index-95c68eda.js +152 -0
- package/dist/{index-956b36a6.js → index-9eaebb69.js} +45 -30
- package/dist/{index-63a66f13.js → index-a4077786.js} +45 -30
- package/dist/{index-e9a1ff7f.js → index-ad2acfd2.js} +19 -4
- package/dist/{index-fdffd6e6.js → index-af60bed6.js} +29 -14
- package/dist/{index-fda88eb4.js → index-b5ff5e93.js} +45 -30
- package/dist/{index-11268759.js → index-bba889fc.js} +33 -18
- package/dist/{index-b7941b97.js → index-c002eb57.js} +23 -8
- package/dist/{index-4c6ad36c.js → index-c73b6cc3.js} +47 -32
- package/dist/{index-60fe7f16.js → index-c81a4a2a.js} +32 -17
- package/dist/{index-f7c4ae83.js → index-c8690f0a.js} +48 -33
- package/dist/{index-79e7317f.js → index-cdaffd70.js} +27 -12
- package/dist/{index-4d780cf4.js → index-cf872561.js} +37 -22
- package/dist/{index-cb1218d8.js → index-dafac81d.js} +25 -10
- package/dist/{index-19d177fe.js → index-db7c7495.js} +31 -16
- package/dist/{index-f1726c63.js → index-dbd4bd27.js} +29 -14
- package/dist/{index-ceae4147.js → index-dc23eb8b.js} +27 -12
- package/dist/{index-9e5efc0a.js → index-dc69cdd8.js} +45 -30
- package/dist/{index-c69f6dfc.js → index-e6091315.js} +36 -21
- package/dist/{index-06ef2e10.js → index-e869e999.js} +28 -13
- package/dist/{index-03d6aef0.js → index-f0c42ec9.js} +33 -18
- package/dist/{index-f64eddcc.js → index-f16b36a5.js} +31 -16
- package/dist/{index-e1a6a03d.js → index-f4d65525.js} +24 -9
- package/dist/index-f53123c7.js +64 -0
- package/dist/{index-770e5f53.js → index-f753119c.js} +27 -12
- package/dist/{index-8585c2f3.js → index-f83dab77.js} +38 -23
- package/dist/{index-6f963c6a.js → index-f852d9b6.js} +35 -20
- package/dist/{index-3ee2bafa.js → index-fa51b278.js} +30 -15
- package/dist/{index-e169373b.js → index-fc135912.js} +25 -10
- package/dist/{index-ef31f5f8.js → index-fcb1ec65.js} +1 -2
- package/dist/{index-d86842c8.js → index-ff943066.js} +34 -19
- package/dist/index.d.ts +48 -36
- package/dist/index.es.js +56 -223
- package/dist/isObjectLike-1b8bbac2.js +44 -0
- package/dist/jsx-runtime-82a9ddf6.js +646 -0
- package/dist/provider/NoticeProvider.d.ts +1 -1
- package/dist/provider/ThemeProvider.d.ts +3 -7
- package/dist/provider/useTheme.d.ts +1 -1
- package/dist/types/component.d.ts +1 -1
- package/dist/utils/helper.d.ts +1 -1
- package/dist/{utils-071abd68.js → utils-cacf528c.js} +1 -2
- package/package.json +3 -2
- package/dist/Calendar.d.ts +0 -1
- package/dist/Calendar.es.js +0 -210
- package/dist/Checkbox.d.ts +0 -1
- package/dist/Checkbox.es.js +0 -138
- package/dist/CssDropdown.d.ts +0 -1
- package/dist/CssDropdown.es.js +0 -38
- package/dist/DatePickerRange.d.ts +0 -1
- package/dist/DatePickerRange.es.js +0 -410
- package/dist/DateTimePicker.d.ts +0 -1
- package/dist/DateTimePicker.es.js +0 -519
- package/dist/Dropdown.d.ts +0 -1
- package/dist/Dropdown.es.js +0 -134
- package/dist/Empty.d.ts +0 -1
- package/dist/Empty.es.js +0 -11
- package/dist/LabelTextField.d.ts +0 -1
- package/dist/LabelTextField.es.js +0 -100
- package/dist/MonthPicker.d.ts +0 -1
- package/dist/MonthPicker.es.js +0 -16
- package/dist/MultiSelect.d.ts +0 -1
- package/dist/MultiSelect.es.js +0 -425
- package/dist/Notification.d.ts +0 -1
- package/dist/Notification.es.js +0 -12
- package/dist/Pagination.d.ts +0 -1
- package/dist/Pagination.es.js +0 -219
- package/dist/Picker.d.ts +0 -1
- package/dist/Picker.es.js +0 -224
- package/dist/Popover.d.ts +0 -1
- package/dist/Popover.es.js +0 -107
- package/dist/Popup.d.ts +0 -1
- package/dist/Popup.es.js +0 -62
- package/dist/ProTable-7a07d8b6.js +0 -565
- package/dist/RadioButton.d.ts +0 -1
- package/dist/RadioButton.es.js +0 -152
- package/dist/Select.d.ts +0 -1
- package/dist/Select.es.js +0 -316
- package/dist/Sortable.d.ts +0 -1
- package/dist/Sortable.es.js +0 -39
- package/dist/Switch.d.ts +0 -1
- package/dist/Switch.es.js +0 -64
- package/dist/Tab.d.ts +0 -1
- package/dist/Tab.es.js +0 -101
- package/dist/Table.d.ts +0 -1
- package/dist/Table.es.js +0 -359
- package/dist/TextField.d.ts +0 -1
- package/dist/TextField.es.js +0 -64
- package/dist/TextSelect.d.ts +0 -1
- package/dist/TextSelect.es.js +0 -17
- package/dist/Textarea.d.ts +0 -1
- package/dist/Textarea.es.js +0 -106
- package/dist/Toast.d.ts +0 -1
- package/dist/Toast.es.js +0 -12
- package/dist/Tooltip.d.ts +0 -1
- package/dist/Tooltip.es.js +0 -144
- package/dist/Typography.d.ts +0 -1
- package/dist/Typography.es.js +0 -74
- package/dist/_commonjsHelpers-1d52fb73.js +0 -9
- package/dist/arrow-down-011b02c7.js +0 -6
- package/dist/arrow-down-l-line-97e4fe24.js +0 -6
- package/dist/arrow-fill-70becd96.js +0 -6
- package/dist/arrow-right-l-line-87881b4d.js +0 -7
- package/dist/close-bg-6d2211ef.js +0 -6
- package/dist/clsx.m-e965ef18.js +0 -22
- package/dist/components/CssDropdown/index.d.ts +0 -2
- package/dist/components/DatePickerRange/index.d.ts +0 -4
- package/dist/components/DateTimePicker/index.d.ts +0 -4
- package/dist/components/Dropdown/index.d.ts +0 -2
- package/dist/components/Empty/Empty.d.ts +0 -5
- package/dist/components/MonthPicker/MonthPicker.d.ts +0 -17
- package/dist/components/MultiSelect/index.d.ts +0 -2
- package/dist/components/Notification/index.d.ts +0 -2
- package/dist/components/Pagination/index.d.ts +0 -3
- package/dist/components/Picker/Picker.d.ts +0 -10
- package/dist/components/Popover/index.d.ts +0 -5
- package/dist/components/Popup/Popup.d.ts +0 -15
- package/dist/components/Sortable/Sortable.d.ts +0 -11
- package/dist/components/Switch/index.d.ts +0 -2
- package/dist/components/Tab/index.d.ts +0 -4
- package/dist/components/TextSelect/index.d.ts +0 -2
- package/dist/components/Textarea/Textarea.d.ts +0 -15
- package/dist/components/Toast/index.d.ts +0 -2
- package/dist/components/Tooltip/index.d.ts +0 -2
- package/dist/components/Typography/index.d.ts +0 -4
- package/dist/enum-0398044b.js +0 -17
- package/dist/helper-221987f8.js +0 -7
- package/dist/index-293f8244.js +0 -49
- package/dist/index-40023d52.js +0 -5322
- package/dist/index-4528ba11.js +0 -49
- package/dist/index-596c785d.js +0 -50
- package/dist/index-67554651.js +0 -49
- package/dist/index-9349bf2d.js +0 -345
- package/dist/index-b7027a1d.js +0 -1295
- package/dist/index-c57db938.js +0 -37
- package/dist/index-eea69add.js +0 -71
- package/dist/index.esm-71578db5.js +0 -1198
- package/dist/index.module-1d7bbdf8.js +0 -7
- package/dist/index.module-86edc823.js +0 -15
- package/dist/index.module-b4239ff5.js +0 -9
- package/dist/index.module-fb41ba3b.js +0 -39
- package/dist/locales-776f0072.js +0 -440
- package/dist/search-b79a3be5.js +0 -6
- package/dist/sortable.esm-1c13d908.js +0 -2896
- package/dist/sortable.esm-8d31c120.js +0 -1275
- package/dist/styles-85a9fe64.js +0 -136
- package/dist/useAlign-916ed3be.js +0 -44
- package/dist/useDelayEvent-f577f6a3.js +0 -1082
- package/dist/useTheme-0688f238.js +0 -16
|
@@ -0,0 +1,3444 @@
|
|
|
1
|
+
import { j as z } from "./jsx-runtime-82a9ddf6.js";
|
|
2
|
+
import * as Ce from "react";
|
|
3
|
+
import V, { useLayoutEffect as $n, useEffect as M, useRef as L, useMemo as O, useCallback as K, useState as Q, createContext as Je, memo as Fn, useReducer as Hn, useContext as Ie } from "react";
|
|
4
|
+
import { c as W } from "./index-7272669e.js";
|
|
5
|
+
import { c as Me, u as Wn } from "./clsx.m-b14a941b.js";
|
|
6
|
+
import { unstable_batchedUpdates as rt, createPortal as Xn } from "react-dom";
|
|
7
|
+
var ne = /* @__PURE__ */ ((e) => (e.default = "default", e.desc = "desc", e.asc = "asc", e))(ne || {});
|
|
8
|
+
const Yn = W("bu-w-full bu-rounded-lg", {
|
|
9
|
+
variants: {
|
|
10
|
+
theme: {
|
|
11
|
+
light: "bu-bg-light-background",
|
|
12
|
+
dark: "bu-bg-dark-background"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}), Kn = W("bu-w-full bu-border-collapse"), Un = W("bu-sticky bu-top-0 bu-z-[100]", {
|
|
16
|
+
variants: {
|
|
17
|
+
theme: {
|
|
18
|
+
light: "bu-bg-light-background",
|
|
19
|
+
dark: "bu-bg-dark-background"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}), rn = W(
|
|
23
|
+
"bu-relative bu-z-[999] bu-h-[25px] bu-select-none bu-border-b bu-px-[4px] bu-text-left bu-text-[12px] bu-font-medium bu-transition-all bu-duration-300",
|
|
24
|
+
{
|
|
25
|
+
variants: {
|
|
26
|
+
theme: {
|
|
27
|
+
light: "bu-border-light-line-primary bu-text-light-label-40",
|
|
28
|
+
dark: "bu-border-dark-line-primary bu-text-dark-label-40"
|
|
29
|
+
},
|
|
30
|
+
draggable: {
|
|
31
|
+
true: "bu-cursor-grab hover:bu-cursor-grab",
|
|
32
|
+
false: ""
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
), on = W("bu-sticky bu-left-0 bu-top-0 bu-z-[1000]", {
|
|
37
|
+
variants: {
|
|
38
|
+
theme: {
|
|
39
|
+
light: "bu-bg-light-background",
|
|
40
|
+
dark: "bu-bg-dark-background"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}), sn = W("bu-sticky bu-right-0 bu-top-0 bu-z-[1000]", {
|
|
44
|
+
variants: {
|
|
45
|
+
theme: {
|
|
46
|
+
light: "bu-bg-light-background",
|
|
47
|
+
dark: "bu-bg-dark-background"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}), Vn = W("bu-cursor-pointer", {
|
|
51
|
+
variants: {
|
|
52
|
+
theme: {
|
|
53
|
+
light: "hover:bu-bg-light-hover-fill-primary",
|
|
54
|
+
dark: "hover:bu-bg-dark-hover-fill-primary"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}), qn = W(
|
|
58
|
+
"bu-pointer-events-auto bu-opacity-0 bu-transition-opacity bu-duration-200 group-hover:bu-opacity-100",
|
|
59
|
+
{
|
|
60
|
+
variants: {
|
|
61
|
+
theme: {
|
|
62
|
+
light: "bu-text-light-label-60 hover:bu-text-light-primary",
|
|
63
|
+
dark: "bu-text-dark-label-60 hover:bu-text-dark-primary"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
), an = W("bu-z-[1002] !bu-cursor-grabbing bu-opacity-60 bu-shadow-lg", {
|
|
68
|
+
variants: {
|
|
69
|
+
theme: {
|
|
70
|
+
light: "bu-bg-light-background",
|
|
71
|
+
dark: "bu-bg-dark-background"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}), Gn = W("bu-ml-2 bu-inline-flex bu-flex-col bu-align-middle"), Jn = W(
|
|
75
|
+
"bu-h-0 bu-w-0 bu-border-l-4 bu-border-r-4 bu-border-transparent",
|
|
76
|
+
{
|
|
77
|
+
variants: {
|
|
78
|
+
direction: {
|
|
79
|
+
asc: "bu-mb-0.5 bu-border-b-[5px]",
|
|
80
|
+
desc: "bu-border-t-[5px]"
|
|
81
|
+
},
|
|
82
|
+
theme: {
|
|
83
|
+
light: "bu-border-b-light-line-secondary bu-border-t-light-line-secondary",
|
|
84
|
+
dark: "bu-border-b-dark-line-secondary bu-border-t-dark-line-secondary"
|
|
85
|
+
},
|
|
86
|
+
active: {
|
|
87
|
+
true: "!bu-border-b-light-primary !bu-border-t-light-primary",
|
|
88
|
+
false: ""
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
), _n = W("", {
|
|
93
|
+
variants: {
|
|
94
|
+
theme: {
|
|
95
|
+
light: "bu-bg-light-background",
|
|
96
|
+
dark: "bu-bg-dark-background"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}), Zn = W("bu-group bu-border-b bu-transition-colors bu-duration-200", {
|
|
100
|
+
variants: {
|
|
101
|
+
theme: {
|
|
102
|
+
light: "bu-hover:bu-bg-light-fill-primary bu-border-light-line-primary",
|
|
103
|
+
dark: "bu-hover:bu-bg-dark-fill-primary bu-border-dark-line-primary"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}), ln = W("bu-h-[60px] bu-border-b bu-px-[4px] bu-text-[12px]", {
|
|
107
|
+
variants: {
|
|
108
|
+
theme: {
|
|
109
|
+
light: "bu-border-light-line-primary bu-text-light-label group-hover:bu-bg-light-fill-primary",
|
|
110
|
+
dark: "bu-border-dark-line-primary bu-text-dark-label group-hover:bu-bg-dark-fill-primary"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}), cn = W("bu-sticky bu-left-0", {
|
|
114
|
+
variants: {
|
|
115
|
+
theme: {
|
|
116
|
+
light: "bu-bg-light-background group-hover:bu-bg-light-fill-primary",
|
|
117
|
+
dark: "bu-bg-dark-background group-hover:bu-bg-dark-fill-primary"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}), un = W("bu-sticky bu-right-0", {
|
|
121
|
+
variants: {
|
|
122
|
+
theme: {
|
|
123
|
+
light: "bu-bg-light-background group-hover:bu-bg-light-fill-primary",
|
|
124
|
+
dark: "bu-bg-dark-background group-hover:bu-bg-dark-fill-primary"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}), Qn = W("bu-px-5 bu-py-10 bu-text-center", {
|
|
128
|
+
variants: {
|
|
129
|
+
theme: {
|
|
130
|
+
light: "bu-text-light-label-60",
|
|
131
|
+
dark: "bu-text-dark-label-60"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}), er = (e) => ({
|
|
135
|
+
"flex-start": "left",
|
|
136
|
+
center: "center",
|
|
137
|
+
"flex-end": "right"
|
|
138
|
+
})[e || "center"], tr = (e) => {
|
|
139
|
+
const { theme: t, fixed: n, sortable: r, isDragging: o, draggable: i, customClass: s } = e, l = [rn({ theme: t, draggable: i && !n })];
|
|
140
|
+
return n === "left" ? l.push(on({ theme: t })) : n === "right" && l.push(sn({ theme: t })), o && l.push(an({ theme: t })), s && l.push(s), l.join(" ");
|
|
141
|
+
}, nr = (e) => {
|
|
142
|
+
const { theme: t, fixed: n, customClass: r } = e, o = [ln({ theme: t })];
|
|
143
|
+
return n === "left" ? o.push(cn({ theme: t })) : n === "right" && o.push(un({ theme: t })), r && o.push(r), o.join(" ");
|
|
144
|
+
}, oe = {
|
|
145
|
+
container: Yn,
|
|
146
|
+
table: Kn,
|
|
147
|
+
thead: Un,
|
|
148
|
+
th: rn,
|
|
149
|
+
thFixedLeft: on,
|
|
150
|
+
thFixedRight: sn,
|
|
151
|
+
thSortable: Vn,
|
|
152
|
+
dragHandle: qn,
|
|
153
|
+
dragging: an,
|
|
154
|
+
sortIcon: Gn,
|
|
155
|
+
sortArrow: Jn,
|
|
156
|
+
tbody: _n,
|
|
157
|
+
tr: Zn,
|
|
158
|
+
td: ln,
|
|
159
|
+
tdFixedLeft: cn,
|
|
160
|
+
tdFixedRight: un,
|
|
161
|
+
empty: Qn,
|
|
162
|
+
getThClasses: tr,
|
|
163
|
+
getTdClasses: nr,
|
|
164
|
+
getTextAlign: er
|
|
165
|
+
};
|
|
166
|
+
function rr() {
|
|
167
|
+
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
168
|
+
t[n] = arguments[n];
|
|
169
|
+
return O(
|
|
170
|
+
() => (r) => {
|
|
171
|
+
t.forEach((o) => o(r));
|
|
172
|
+
},
|
|
173
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
174
|
+
t
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
const dt = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
|
|
178
|
+
function ze(e) {
|
|
179
|
+
const t = Object.prototype.toString.call(e);
|
|
180
|
+
return t === "[object Window]" || // In Electron context the Window object serializes to [object global]
|
|
181
|
+
t === "[object global]";
|
|
182
|
+
}
|
|
183
|
+
function It(e) {
|
|
184
|
+
return "nodeType" in e;
|
|
185
|
+
}
|
|
186
|
+
function q(e) {
|
|
187
|
+
var t, n;
|
|
188
|
+
return e ? ze(e) ? e : It(e) && (t = (n = e.ownerDocument) == null ? void 0 : n.defaultView) != null ? t : window : window;
|
|
189
|
+
}
|
|
190
|
+
function Et(e) {
|
|
191
|
+
const {
|
|
192
|
+
Document: t
|
|
193
|
+
} = q(e);
|
|
194
|
+
return e instanceof t;
|
|
195
|
+
}
|
|
196
|
+
function _e(e) {
|
|
197
|
+
return ze(e) ? !1 : e instanceof q(e).HTMLElement;
|
|
198
|
+
}
|
|
199
|
+
function dn(e) {
|
|
200
|
+
return e instanceof q(e).SVGElement;
|
|
201
|
+
}
|
|
202
|
+
function je(e) {
|
|
203
|
+
return e ? ze(e) ? e.document : It(e) ? Et(e) ? e : _e(e) || dn(e) ? e.ownerDocument : document : document : document;
|
|
204
|
+
}
|
|
205
|
+
const fe = dt ? $n : M;
|
|
206
|
+
function kt(e) {
|
|
207
|
+
const t = L(e);
|
|
208
|
+
return fe(() => {
|
|
209
|
+
t.current = e;
|
|
210
|
+
}), K(function() {
|
|
211
|
+
for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++)
|
|
212
|
+
r[o] = arguments[o];
|
|
213
|
+
return t.current == null ? void 0 : t.current(...r);
|
|
214
|
+
}, []);
|
|
215
|
+
}
|
|
216
|
+
function or() {
|
|
217
|
+
const e = L(null), t = K((r, o) => {
|
|
218
|
+
e.current = setInterval(r, o);
|
|
219
|
+
}, []), n = K(() => {
|
|
220
|
+
e.current !== null && (clearInterval(e.current), e.current = null);
|
|
221
|
+
}, []);
|
|
222
|
+
return [t, n];
|
|
223
|
+
}
|
|
224
|
+
function Ve(e, t) {
|
|
225
|
+
t === void 0 && (t = [e]);
|
|
226
|
+
const n = L(e);
|
|
227
|
+
return fe(() => {
|
|
228
|
+
n.current !== e && (n.current = e);
|
|
229
|
+
}, t), n;
|
|
230
|
+
}
|
|
231
|
+
function Ze(e, t) {
|
|
232
|
+
const n = L();
|
|
233
|
+
return O(
|
|
234
|
+
() => {
|
|
235
|
+
const r = e(n.current);
|
|
236
|
+
return n.current = r, r;
|
|
237
|
+
},
|
|
238
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
239
|
+
[...t]
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
function at(e) {
|
|
243
|
+
const t = kt(e), n = L(null), r = K(
|
|
244
|
+
(o) => {
|
|
245
|
+
o !== n.current && (t == null || t(o, n.current)), n.current = o;
|
|
246
|
+
},
|
|
247
|
+
//eslint-disable-next-line
|
|
248
|
+
[]
|
|
249
|
+
);
|
|
250
|
+
return [n, r];
|
|
251
|
+
}
|
|
252
|
+
function mt(e) {
|
|
253
|
+
const t = L();
|
|
254
|
+
return M(() => {
|
|
255
|
+
t.current = e;
|
|
256
|
+
}, [e]), t.current;
|
|
257
|
+
}
|
|
258
|
+
let pt = {};
|
|
259
|
+
function Qe(e, t) {
|
|
260
|
+
return O(() => {
|
|
261
|
+
if (t)
|
|
262
|
+
return t;
|
|
263
|
+
const n = pt[e] == null ? 0 : pt[e] + 1;
|
|
264
|
+
return pt[e] = n, e + "-" + n;
|
|
265
|
+
}, [e, t]);
|
|
266
|
+
}
|
|
267
|
+
function fn(e) {
|
|
268
|
+
return function(t) {
|
|
269
|
+
for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), o = 1; o < n; o++)
|
|
270
|
+
r[o - 1] = arguments[o];
|
|
271
|
+
return r.reduce((i, s) => {
|
|
272
|
+
const a = Object.entries(s);
|
|
273
|
+
for (const [l, u] of a) {
|
|
274
|
+
const c = i[l];
|
|
275
|
+
c != null && (i[l] = c + e * u);
|
|
276
|
+
}
|
|
277
|
+
return i;
|
|
278
|
+
}, {
|
|
279
|
+
...t
|
|
280
|
+
});
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
const Le = /* @__PURE__ */ fn(1), lt = /* @__PURE__ */ fn(-1);
|
|
284
|
+
function ir(e) {
|
|
285
|
+
return "clientX" in e && "clientY" in e;
|
|
286
|
+
}
|
|
287
|
+
function Tt(e) {
|
|
288
|
+
if (!e)
|
|
289
|
+
return !1;
|
|
290
|
+
const {
|
|
291
|
+
KeyboardEvent: t
|
|
292
|
+
} = q(e.target);
|
|
293
|
+
return t && e instanceof t;
|
|
294
|
+
}
|
|
295
|
+
function sr(e) {
|
|
296
|
+
if (!e)
|
|
297
|
+
return !1;
|
|
298
|
+
const {
|
|
299
|
+
TouchEvent: t
|
|
300
|
+
} = q(e.target);
|
|
301
|
+
return t && e instanceof t;
|
|
302
|
+
}
|
|
303
|
+
function St(e) {
|
|
304
|
+
if (sr(e)) {
|
|
305
|
+
if (e.touches && e.touches.length) {
|
|
306
|
+
const {
|
|
307
|
+
clientX: t,
|
|
308
|
+
clientY: n
|
|
309
|
+
} = e.touches[0];
|
|
310
|
+
return {
|
|
311
|
+
x: t,
|
|
312
|
+
y: n
|
|
313
|
+
};
|
|
314
|
+
} else if (e.changedTouches && e.changedTouches.length) {
|
|
315
|
+
const {
|
|
316
|
+
clientX: t,
|
|
317
|
+
clientY: n
|
|
318
|
+
} = e.changedTouches[0];
|
|
319
|
+
return {
|
|
320
|
+
x: t,
|
|
321
|
+
y: n
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return ir(e) ? {
|
|
326
|
+
x: e.clientX,
|
|
327
|
+
y: e.clientY
|
|
328
|
+
} : null;
|
|
329
|
+
}
|
|
330
|
+
const qe = /* @__PURE__ */ Object.freeze({
|
|
331
|
+
Translate: {
|
|
332
|
+
toString(e) {
|
|
333
|
+
if (!e)
|
|
334
|
+
return;
|
|
335
|
+
const {
|
|
336
|
+
x: t,
|
|
337
|
+
y: n
|
|
338
|
+
} = e;
|
|
339
|
+
return "translate3d(" + (t ? Math.round(t) : 0) + "px, " + (n ? Math.round(n) : 0) + "px, 0)";
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
Scale: {
|
|
343
|
+
toString(e) {
|
|
344
|
+
if (!e)
|
|
345
|
+
return;
|
|
346
|
+
const {
|
|
347
|
+
scaleX: t,
|
|
348
|
+
scaleY: n
|
|
349
|
+
} = e;
|
|
350
|
+
return "scaleX(" + t + ") scaleY(" + n + ")";
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
Transform: {
|
|
354
|
+
toString(e) {
|
|
355
|
+
if (e)
|
|
356
|
+
return [qe.Translate.toString(e), qe.Scale.toString(e)].join(" ");
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
Transition: {
|
|
360
|
+
toString(e) {
|
|
361
|
+
let {
|
|
362
|
+
property: t,
|
|
363
|
+
duration: n,
|
|
364
|
+
easing: r
|
|
365
|
+
} = e;
|
|
366
|
+
return t + " " + n + "ms " + r;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}), Yt = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";
|
|
370
|
+
function ar(e) {
|
|
371
|
+
return e.matches(Yt) ? e : e.querySelector(Yt);
|
|
372
|
+
}
|
|
373
|
+
const lr = {
|
|
374
|
+
display: "none"
|
|
375
|
+
};
|
|
376
|
+
function cr(e) {
|
|
377
|
+
let {
|
|
378
|
+
id: t,
|
|
379
|
+
value: n
|
|
380
|
+
} = e;
|
|
381
|
+
return V.createElement("div", {
|
|
382
|
+
id: t,
|
|
383
|
+
style: lr
|
|
384
|
+
}, n);
|
|
385
|
+
}
|
|
386
|
+
function ur(e) {
|
|
387
|
+
let {
|
|
388
|
+
id: t,
|
|
389
|
+
announcement: n,
|
|
390
|
+
ariaLiveType: r = "assertive"
|
|
391
|
+
} = e;
|
|
392
|
+
const o = {
|
|
393
|
+
position: "fixed",
|
|
394
|
+
top: 0,
|
|
395
|
+
left: 0,
|
|
396
|
+
width: 1,
|
|
397
|
+
height: 1,
|
|
398
|
+
margin: -1,
|
|
399
|
+
border: 0,
|
|
400
|
+
padding: 0,
|
|
401
|
+
overflow: "hidden",
|
|
402
|
+
clip: "rect(0 0 0 0)",
|
|
403
|
+
clipPath: "inset(100%)",
|
|
404
|
+
whiteSpace: "nowrap"
|
|
405
|
+
};
|
|
406
|
+
return V.createElement("div", {
|
|
407
|
+
id: t,
|
|
408
|
+
style: o,
|
|
409
|
+
role: "status",
|
|
410
|
+
"aria-live": r,
|
|
411
|
+
"aria-atomic": !0
|
|
412
|
+
}, n);
|
|
413
|
+
}
|
|
414
|
+
function dr() {
|
|
415
|
+
const [e, t] = Q("");
|
|
416
|
+
return {
|
|
417
|
+
announce: K((r) => {
|
|
418
|
+
r != null && t(r);
|
|
419
|
+
}, []),
|
|
420
|
+
announcement: e
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
const hn = /* @__PURE__ */ Je(null);
|
|
424
|
+
function fr(e) {
|
|
425
|
+
const t = Ie(hn);
|
|
426
|
+
M(() => {
|
|
427
|
+
if (!t)
|
|
428
|
+
throw new Error("useDndMonitor must be used within a children of <DndContext>");
|
|
429
|
+
return t(e);
|
|
430
|
+
}, [e, t]);
|
|
431
|
+
}
|
|
432
|
+
function hr() {
|
|
433
|
+
const [e] = Q(() => /* @__PURE__ */ new Set()), t = K((r) => (e.add(r), () => e.delete(r)), [e]);
|
|
434
|
+
return [K((r) => {
|
|
435
|
+
let {
|
|
436
|
+
type: o,
|
|
437
|
+
event: i
|
|
438
|
+
} = r;
|
|
439
|
+
e.forEach((s) => {
|
|
440
|
+
var a;
|
|
441
|
+
return (a = s[o]) == null ? void 0 : a.call(s, i);
|
|
442
|
+
});
|
|
443
|
+
}, [e]), t];
|
|
444
|
+
}
|
|
445
|
+
const gr = {
|
|
446
|
+
draggable: `
|
|
447
|
+
To pick up a draggable item, press the space bar.
|
|
448
|
+
While dragging, use the arrow keys to move the item.
|
|
449
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
450
|
+
`
|
|
451
|
+
}, br = {
|
|
452
|
+
onDragStart(e) {
|
|
453
|
+
let {
|
|
454
|
+
active: t
|
|
455
|
+
} = e;
|
|
456
|
+
return "Picked up draggable item " + t.id + ".";
|
|
457
|
+
},
|
|
458
|
+
onDragOver(e) {
|
|
459
|
+
let {
|
|
460
|
+
active: t,
|
|
461
|
+
over: n
|
|
462
|
+
} = e;
|
|
463
|
+
return n ? "Draggable item " + t.id + " was moved over droppable area " + n.id + "." : "Draggable item " + t.id + " is no longer over a droppable area.";
|
|
464
|
+
},
|
|
465
|
+
onDragEnd(e) {
|
|
466
|
+
let {
|
|
467
|
+
active: t,
|
|
468
|
+
over: n
|
|
469
|
+
} = e;
|
|
470
|
+
return n ? "Draggable item " + t.id + " was dropped over droppable area " + n.id : "Draggable item " + t.id + " was dropped.";
|
|
471
|
+
},
|
|
472
|
+
onDragCancel(e) {
|
|
473
|
+
let {
|
|
474
|
+
active: t
|
|
475
|
+
} = e;
|
|
476
|
+
return "Dragging was cancelled. Draggable item " + t.id + " was dropped.";
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
function vr(e) {
|
|
480
|
+
let {
|
|
481
|
+
announcements: t = br,
|
|
482
|
+
container: n,
|
|
483
|
+
hiddenTextDescribedById: r,
|
|
484
|
+
screenReaderInstructions: o = gr
|
|
485
|
+
} = e;
|
|
486
|
+
const {
|
|
487
|
+
announce: i,
|
|
488
|
+
announcement: s
|
|
489
|
+
} = dr(), a = Qe("DndLiveRegion"), [l, u] = Q(!1);
|
|
490
|
+
if (M(() => {
|
|
491
|
+
u(!0);
|
|
492
|
+
}, []), fr(O(() => ({
|
|
493
|
+
onDragStart(d) {
|
|
494
|
+
let {
|
|
495
|
+
active: f
|
|
496
|
+
} = d;
|
|
497
|
+
i(t.onDragStart({
|
|
498
|
+
active: f
|
|
499
|
+
}));
|
|
500
|
+
},
|
|
501
|
+
onDragMove(d) {
|
|
502
|
+
let {
|
|
503
|
+
active: f,
|
|
504
|
+
over: h
|
|
505
|
+
} = d;
|
|
506
|
+
t.onDragMove && i(t.onDragMove({
|
|
507
|
+
active: f,
|
|
508
|
+
over: h
|
|
509
|
+
}));
|
|
510
|
+
},
|
|
511
|
+
onDragOver(d) {
|
|
512
|
+
let {
|
|
513
|
+
active: f,
|
|
514
|
+
over: h
|
|
515
|
+
} = d;
|
|
516
|
+
i(t.onDragOver({
|
|
517
|
+
active: f,
|
|
518
|
+
over: h
|
|
519
|
+
}));
|
|
520
|
+
},
|
|
521
|
+
onDragEnd(d) {
|
|
522
|
+
let {
|
|
523
|
+
active: f,
|
|
524
|
+
over: h
|
|
525
|
+
} = d;
|
|
526
|
+
i(t.onDragEnd({
|
|
527
|
+
active: f,
|
|
528
|
+
over: h
|
|
529
|
+
}));
|
|
530
|
+
},
|
|
531
|
+
onDragCancel(d) {
|
|
532
|
+
let {
|
|
533
|
+
active: f,
|
|
534
|
+
over: h
|
|
535
|
+
} = d;
|
|
536
|
+
i(t.onDragCancel({
|
|
537
|
+
active: f,
|
|
538
|
+
over: h
|
|
539
|
+
}));
|
|
540
|
+
}
|
|
541
|
+
}), [i, t])), !l)
|
|
542
|
+
return null;
|
|
543
|
+
const c = V.createElement(V.Fragment, null, V.createElement(cr, {
|
|
544
|
+
id: r,
|
|
545
|
+
value: o.draggable
|
|
546
|
+
}), V.createElement(ur, {
|
|
547
|
+
id: a,
|
|
548
|
+
announcement: s
|
|
549
|
+
}));
|
|
550
|
+
return n ? Xn(c, n) : c;
|
|
551
|
+
}
|
|
552
|
+
var $;
|
|
553
|
+
(function(e) {
|
|
554
|
+
e.DragStart = "dragStart", e.DragMove = "dragMove", e.DragEnd = "dragEnd", e.DragCancel = "dragCancel", e.DragOver = "dragOver", e.RegisterDroppable = "registerDroppable", e.SetDroppableDisabled = "setDroppableDisabled", e.UnregisterDroppable = "unregisterDroppable";
|
|
555
|
+
})($ || ($ = {}));
|
|
556
|
+
function ct() {
|
|
557
|
+
}
|
|
558
|
+
function Kt(e, t) {
|
|
559
|
+
return O(
|
|
560
|
+
() => ({
|
|
561
|
+
sensor: e,
|
|
562
|
+
options: t ?? {}
|
|
563
|
+
}),
|
|
564
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
565
|
+
[e, t]
|
|
566
|
+
);
|
|
567
|
+
}
|
|
568
|
+
function pr() {
|
|
569
|
+
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
570
|
+
t[n] = arguments[n];
|
|
571
|
+
return O(
|
|
572
|
+
() => [...t].filter((r) => r != null),
|
|
573
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
574
|
+
[...t]
|
|
575
|
+
);
|
|
576
|
+
}
|
|
577
|
+
const ie = /* @__PURE__ */ Object.freeze({
|
|
578
|
+
x: 0,
|
|
579
|
+
y: 0
|
|
580
|
+
});
|
|
581
|
+
function yr(e, t) {
|
|
582
|
+
return Math.sqrt(Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2));
|
|
583
|
+
}
|
|
584
|
+
function xr(e, t) {
|
|
585
|
+
let {
|
|
586
|
+
data: {
|
|
587
|
+
value: n
|
|
588
|
+
}
|
|
589
|
+
} = e, {
|
|
590
|
+
data: {
|
|
591
|
+
value: r
|
|
592
|
+
}
|
|
593
|
+
} = t;
|
|
594
|
+
return n - r;
|
|
595
|
+
}
|
|
596
|
+
function wr(e, t) {
|
|
597
|
+
let {
|
|
598
|
+
data: {
|
|
599
|
+
value: n
|
|
600
|
+
}
|
|
601
|
+
} = e, {
|
|
602
|
+
data: {
|
|
603
|
+
value: r
|
|
604
|
+
}
|
|
605
|
+
} = t;
|
|
606
|
+
return r - n;
|
|
607
|
+
}
|
|
608
|
+
function mr(e, t) {
|
|
609
|
+
if (!e || e.length === 0)
|
|
610
|
+
return null;
|
|
611
|
+
const [n] = e;
|
|
612
|
+
return t ? n[t] : n;
|
|
613
|
+
}
|
|
614
|
+
function Ut(e, t, n) {
|
|
615
|
+
return t === void 0 && (t = e.left), n === void 0 && (n = e.top), {
|
|
616
|
+
x: t + e.width * 0.5,
|
|
617
|
+
y: n + e.height * 0.5
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
const Sr = (e) => {
|
|
621
|
+
let {
|
|
622
|
+
collisionRect: t,
|
|
623
|
+
droppableRects: n,
|
|
624
|
+
droppableContainers: r
|
|
625
|
+
} = e;
|
|
626
|
+
const o = Ut(t, t.left, t.top), i = [];
|
|
627
|
+
for (const s of r) {
|
|
628
|
+
const {
|
|
629
|
+
id: a
|
|
630
|
+
} = s, l = n.get(a);
|
|
631
|
+
if (l) {
|
|
632
|
+
const u = yr(Ut(l), o);
|
|
633
|
+
i.push({
|
|
634
|
+
id: a,
|
|
635
|
+
data: {
|
|
636
|
+
droppableContainer: s,
|
|
637
|
+
value: u
|
|
638
|
+
}
|
|
639
|
+
});
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
return i.sort(xr);
|
|
643
|
+
};
|
|
644
|
+
function Dr(e, t) {
|
|
645
|
+
const n = Math.max(t.top, e.top), r = Math.max(t.left, e.left), o = Math.min(t.left + t.width, e.left + e.width), i = Math.min(t.top + t.height, e.top + e.height), s = o - r, a = i - n;
|
|
646
|
+
if (r < o && n < i) {
|
|
647
|
+
const l = t.width * t.height, u = e.width * e.height, c = s * a, d = c / (l + u - c);
|
|
648
|
+
return Number(d.toFixed(4));
|
|
649
|
+
}
|
|
650
|
+
return 0;
|
|
651
|
+
}
|
|
652
|
+
const Cr = (e) => {
|
|
653
|
+
let {
|
|
654
|
+
collisionRect: t,
|
|
655
|
+
droppableRects: n,
|
|
656
|
+
droppableContainers: r
|
|
657
|
+
} = e;
|
|
658
|
+
const o = [];
|
|
659
|
+
for (const i of r) {
|
|
660
|
+
const {
|
|
661
|
+
id: s
|
|
662
|
+
} = i, a = n.get(s);
|
|
663
|
+
if (a) {
|
|
664
|
+
const l = Dr(a, t);
|
|
665
|
+
l > 0 && o.push({
|
|
666
|
+
id: s,
|
|
667
|
+
data: {
|
|
668
|
+
droppableContainer: i,
|
|
669
|
+
value: l
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
return o.sort(wr);
|
|
675
|
+
};
|
|
676
|
+
function Rr(e, t, n) {
|
|
677
|
+
return {
|
|
678
|
+
...e,
|
|
679
|
+
scaleX: t && n ? t.width / n.width : 1,
|
|
680
|
+
scaleY: t && n ? t.height / n.height : 1
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
function gn(e, t) {
|
|
684
|
+
return e && t ? {
|
|
685
|
+
x: e.left - t.left,
|
|
686
|
+
y: e.top - t.top
|
|
687
|
+
} : ie;
|
|
688
|
+
}
|
|
689
|
+
function Ir(e) {
|
|
690
|
+
return function(n) {
|
|
691
|
+
for (var r = arguments.length, o = new Array(r > 1 ? r - 1 : 0), i = 1; i < r; i++)
|
|
692
|
+
o[i - 1] = arguments[i];
|
|
693
|
+
return o.reduce((s, a) => ({
|
|
694
|
+
...s,
|
|
695
|
+
top: s.top + e * a.y,
|
|
696
|
+
bottom: s.bottom + e * a.y,
|
|
697
|
+
left: s.left + e * a.x,
|
|
698
|
+
right: s.right + e * a.x
|
|
699
|
+
}), {
|
|
700
|
+
...n
|
|
701
|
+
});
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
const Er = /* @__PURE__ */ Ir(1);
|
|
705
|
+
function kr(e) {
|
|
706
|
+
if (e.startsWith("matrix3d(")) {
|
|
707
|
+
const t = e.slice(9, -1).split(/, /);
|
|
708
|
+
return {
|
|
709
|
+
x: +t[12],
|
|
710
|
+
y: +t[13],
|
|
711
|
+
scaleX: +t[0],
|
|
712
|
+
scaleY: +t[5]
|
|
713
|
+
};
|
|
714
|
+
} else if (e.startsWith("matrix(")) {
|
|
715
|
+
const t = e.slice(7, -1).split(/, /);
|
|
716
|
+
return {
|
|
717
|
+
x: +t[4],
|
|
718
|
+
y: +t[5],
|
|
719
|
+
scaleX: +t[0],
|
|
720
|
+
scaleY: +t[3]
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
return null;
|
|
724
|
+
}
|
|
725
|
+
function Tr(e, t, n) {
|
|
726
|
+
const r = kr(t);
|
|
727
|
+
if (!r)
|
|
728
|
+
return e;
|
|
729
|
+
const {
|
|
730
|
+
scaleX: o,
|
|
731
|
+
scaleY: i,
|
|
732
|
+
x: s,
|
|
733
|
+
y: a
|
|
734
|
+
} = r, l = e.left - s - (1 - o) * parseFloat(n), u = e.top - a - (1 - i) * parseFloat(n.slice(n.indexOf(" ") + 1)), c = o ? e.width / o : e.width, d = i ? e.height / i : e.height;
|
|
735
|
+
return {
|
|
736
|
+
width: c,
|
|
737
|
+
height: d,
|
|
738
|
+
top: u,
|
|
739
|
+
right: l + c,
|
|
740
|
+
bottom: u + d,
|
|
741
|
+
left: l
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
const Ar = {
|
|
745
|
+
ignoreTransform: !1
|
|
746
|
+
};
|
|
747
|
+
function Pe(e, t) {
|
|
748
|
+
t === void 0 && (t = Ar);
|
|
749
|
+
let n = e.getBoundingClientRect();
|
|
750
|
+
if (t.ignoreTransform) {
|
|
751
|
+
const {
|
|
752
|
+
transform: u,
|
|
753
|
+
transformOrigin: c
|
|
754
|
+
} = q(e).getComputedStyle(e);
|
|
755
|
+
u && (n = Tr(n, u, c));
|
|
756
|
+
}
|
|
757
|
+
const {
|
|
758
|
+
top: r,
|
|
759
|
+
left: o,
|
|
760
|
+
width: i,
|
|
761
|
+
height: s,
|
|
762
|
+
bottom: a,
|
|
763
|
+
right: l
|
|
764
|
+
} = n;
|
|
765
|
+
return {
|
|
766
|
+
top: r,
|
|
767
|
+
left: o,
|
|
768
|
+
width: i,
|
|
769
|
+
height: s,
|
|
770
|
+
bottom: a,
|
|
771
|
+
right: l
|
|
772
|
+
};
|
|
773
|
+
}
|
|
774
|
+
function Vt(e) {
|
|
775
|
+
return Pe(e, {
|
|
776
|
+
ignoreTransform: !0
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
function Nr(e) {
|
|
780
|
+
const t = e.innerWidth, n = e.innerHeight;
|
|
781
|
+
return {
|
|
782
|
+
top: 0,
|
|
783
|
+
left: 0,
|
|
784
|
+
right: t,
|
|
785
|
+
bottom: n,
|
|
786
|
+
width: t,
|
|
787
|
+
height: n
|
|
788
|
+
};
|
|
789
|
+
}
|
|
790
|
+
function Or(e, t) {
|
|
791
|
+
return t === void 0 && (t = q(e).getComputedStyle(e)), t.position === "fixed";
|
|
792
|
+
}
|
|
793
|
+
function Mr(e, t) {
|
|
794
|
+
t === void 0 && (t = q(e).getComputedStyle(e));
|
|
795
|
+
const n = /(auto|scroll|overlay)/;
|
|
796
|
+
return ["overflow", "overflowX", "overflowY"].some((o) => {
|
|
797
|
+
const i = t[o];
|
|
798
|
+
return typeof i == "string" ? n.test(i) : !1;
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
function At(e, t) {
|
|
802
|
+
const n = [];
|
|
803
|
+
function r(o) {
|
|
804
|
+
if (t != null && n.length >= t || !o)
|
|
805
|
+
return n;
|
|
806
|
+
if (Et(o) && o.scrollingElement != null && !n.includes(o.scrollingElement))
|
|
807
|
+
return n.push(o.scrollingElement), n;
|
|
808
|
+
if (!_e(o) || dn(o) || n.includes(o))
|
|
809
|
+
return n;
|
|
810
|
+
const i = q(e).getComputedStyle(o);
|
|
811
|
+
return o !== e && Mr(o, i) && n.push(o), Or(o, i) ? n : r(o.parentNode);
|
|
812
|
+
}
|
|
813
|
+
return e ? r(e) : n;
|
|
814
|
+
}
|
|
815
|
+
function bn(e) {
|
|
816
|
+
const [t] = At(e, 1);
|
|
817
|
+
return t ?? null;
|
|
818
|
+
}
|
|
819
|
+
function yt(e) {
|
|
820
|
+
return !dt || !e ? null : ze(e) ? e : It(e) ? Et(e) || e === je(e).scrollingElement ? window : _e(e) ? e : null : null;
|
|
821
|
+
}
|
|
822
|
+
function vn(e) {
|
|
823
|
+
return ze(e) ? e.scrollX : e.scrollLeft;
|
|
824
|
+
}
|
|
825
|
+
function pn(e) {
|
|
826
|
+
return ze(e) ? e.scrollY : e.scrollTop;
|
|
827
|
+
}
|
|
828
|
+
function Dt(e) {
|
|
829
|
+
return {
|
|
830
|
+
x: vn(e),
|
|
831
|
+
y: pn(e)
|
|
832
|
+
};
|
|
833
|
+
}
|
|
834
|
+
var F;
|
|
835
|
+
(function(e) {
|
|
836
|
+
e[e.Forward = 1] = "Forward", e[e.Backward = -1] = "Backward";
|
|
837
|
+
})(F || (F = {}));
|
|
838
|
+
function yn(e) {
|
|
839
|
+
return !dt || !e ? !1 : e === document.scrollingElement;
|
|
840
|
+
}
|
|
841
|
+
function xn(e) {
|
|
842
|
+
const t = {
|
|
843
|
+
x: 0,
|
|
844
|
+
y: 0
|
|
845
|
+
}, n = yn(e) ? {
|
|
846
|
+
height: window.innerHeight,
|
|
847
|
+
width: window.innerWidth
|
|
848
|
+
} : {
|
|
849
|
+
height: e.clientHeight,
|
|
850
|
+
width: e.clientWidth
|
|
851
|
+
}, r = {
|
|
852
|
+
x: e.scrollWidth - n.width,
|
|
853
|
+
y: e.scrollHeight - n.height
|
|
854
|
+
}, o = e.scrollTop <= t.y, i = e.scrollLeft <= t.x, s = e.scrollTop >= r.y, a = e.scrollLeft >= r.x;
|
|
855
|
+
return {
|
|
856
|
+
isTop: o,
|
|
857
|
+
isLeft: i,
|
|
858
|
+
isBottom: s,
|
|
859
|
+
isRight: a,
|
|
860
|
+
maxScroll: r,
|
|
861
|
+
minScroll: t
|
|
862
|
+
};
|
|
863
|
+
}
|
|
864
|
+
const Lr = {
|
|
865
|
+
x: 0.2,
|
|
866
|
+
y: 0.2
|
|
867
|
+
};
|
|
868
|
+
function zr(e, t, n, r, o) {
|
|
869
|
+
let {
|
|
870
|
+
top: i,
|
|
871
|
+
left: s,
|
|
872
|
+
right: a,
|
|
873
|
+
bottom: l
|
|
874
|
+
} = n;
|
|
875
|
+
r === void 0 && (r = 10), o === void 0 && (o = Lr);
|
|
876
|
+
const {
|
|
877
|
+
isTop: u,
|
|
878
|
+
isBottom: c,
|
|
879
|
+
isLeft: d,
|
|
880
|
+
isRight: f
|
|
881
|
+
} = xn(e), h = {
|
|
882
|
+
x: 0,
|
|
883
|
+
y: 0
|
|
884
|
+
}, v = {
|
|
885
|
+
x: 0,
|
|
886
|
+
y: 0
|
|
887
|
+
}, g = {
|
|
888
|
+
height: t.height * o.y,
|
|
889
|
+
width: t.width * o.x
|
|
890
|
+
};
|
|
891
|
+
return !u && i <= t.top + g.height ? (h.y = F.Backward, v.y = r * Math.abs((t.top + g.height - i) / g.height)) : !c && l >= t.bottom - g.height && (h.y = F.Forward, v.y = r * Math.abs((t.bottom - g.height - l) / g.height)), !f && a >= t.right - g.width ? (h.x = F.Forward, v.x = r * Math.abs((t.right - g.width - a) / g.width)) : !d && s <= t.left + g.width && (h.x = F.Backward, v.x = r * Math.abs((t.left + g.width - s) / g.width)), {
|
|
892
|
+
direction: h,
|
|
893
|
+
speed: v
|
|
894
|
+
};
|
|
895
|
+
}
|
|
896
|
+
function jr(e) {
|
|
897
|
+
if (e === document.scrollingElement) {
|
|
898
|
+
const {
|
|
899
|
+
innerWidth: i,
|
|
900
|
+
innerHeight: s
|
|
901
|
+
} = window;
|
|
902
|
+
return {
|
|
903
|
+
top: 0,
|
|
904
|
+
left: 0,
|
|
905
|
+
right: i,
|
|
906
|
+
bottom: s,
|
|
907
|
+
width: i,
|
|
908
|
+
height: s
|
|
909
|
+
};
|
|
910
|
+
}
|
|
911
|
+
const {
|
|
912
|
+
top: t,
|
|
913
|
+
left: n,
|
|
914
|
+
right: r,
|
|
915
|
+
bottom: o
|
|
916
|
+
} = e.getBoundingClientRect();
|
|
917
|
+
return {
|
|
918
|
+
top: t,
|
|
919
|
+
left: n,
|
|
920
|
+
right: r,
|
|
921
|
+
bottom: o,
|
|
922
|
+
width: e.clientWidth,
|
|
923
|
+
height: e.clientHeight
|
|
924
|
+
};
|
|
925
|
+
}
|
|
926
|
+
function wn(e) {
|
|
927
|
+
return e.reduce((t, n) => Le(t, Dt(n)), ie);
|
|
928
|
+
}
|
|
929
|
+
function Pr(e) {
|
|
930
|
+
return e.reduce((t, n) => t + vn(n), 0);
|
|
931
|
+
}
|
|
932
|
+
function Br(e) {
|
|
933
|
+
return e.reduce((t, n) => t + pn(n), 0);
|
|
934
|
+
}
|
|
935
|
+
function $r(e, t) {
|
|
936
|
+
if (t === void 0 && (t = Pe), !e)
|
|
937
|
+
return;
|
|
938
|
+
const {
|
|
939
|
+
top: n,
|
|
940
|
+
left: r,
|
|
941
|
+
bottom: o,
|
|
942
|
+
right: i
|
|
943
|
+
} = t(e);
|
|
944
|
+
bn(e) && (o <= 0 || i <= 0 || n >= window.innerHeight || r >= window.innerWidth) && e.scrollIntoView({
|
|
945
|
+
block: "center",
|
|
946
|
+
inline: "center"
|
|
947
|
+
});
|
|
948
|
+
}
|
|
949
|
+
const Fr = [["x", ["left", "right"], Pr], ["y", ["top", "bottom"], Br]];
|
|
950
|
+
class Nt {
|
|
951
|
+
constructor(t, n) {
|
|
952
|
+
this.rect = void 0, this.width = void 0, this.height = void 0, this.top = void 0, this.bottom = void 0, this.right = void 0, this.left = void 0;
|
|
953
|
+
const r = At(n), o = wn(r);
|
|
954
|
+
this.rect = {
|
|
955
|
+
...t
|
|
956
|
+
}, this.width = t.width, this.height = t.height;
|
|
957
|
+
for (const [i, s, a] of Fr)
|
|
958
|
+
for (const l of s)
|
|
959
|
+
Object.defineProperty(this, l, {
|
|
960
|
+
get: () => {
|
|
961
|
+
const u = a(r), c = o[i] - u;
|
|
962
|
+
return this.rect[l] + c;
|
|
963
|
+
},
|
|
964
|
+
enumerable: !0
|
|
965
|
+
});
|
|
966
|
+
Object.defineProperty(this, "rect", {
|
|
967
|
+
enumerable: !1
|
|
968
|
+
});
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
class Ye {
|
|
972
|
+
constructor(t) {
|
|
973
|
+
this.target = void 0, this.listeners = [], this.removeAll = () => {
|
|
974
|
+
this.listeners.forEach((n) => {
|
|
975
|
+
var r;
|
|
976
|
+
return (r = this.target) == null ? void 0 : r.removeEventListener(...n);
|
|
977
|
+
});
|
|
978
|
+
}, this.target = t;
|
|
979
|
+
}
|
|
980
|
+
add(t, n, r) {
|
|
981
|
+
var o;
|
|
982
|
+
(o = this.target) == null || o.addEventListener(t, n, r), this.listeners.push([t, n, r]);
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
function Hr(e) {
|
|
986
|
+
const {
|
|
987
|
+
EventTarget: t
|
|
988
|
+
} = q(e);
|
|
989
|
+
return e instanceof t ? e : je(e);
|
|
990
|
+
}
|
|
991
|
+
function xt(e, t) {
|
|
992
|
+
const n = Math.abs(e.x), r = Math.abs(e.y);
|
|
993
|
+
return typeof t == "number" ? Math.sqrt(n ** 2 + r ** 2) > t : "x" in t && "y" in t ? n > t.x && r > t.y : "x" in t ? n > t.x : "y" in t ? r > t.y : !1;
|
|
994
|
+
}
|
|
995
|
+
var re;
|
|
996
|
+
(function(e) {
|
|
997
|
+
e.Click = "click", e.DragStart = "dragstart", e.Keydown = "keydown", e.ContextMenu = "contextmenu", e.Resize = "resize", e.SelectionChange = "selectionchange", e.VisibilityChange = "visibilitychange";
|
|
998
|
+
})(re || (re = {}));
|
|
999
|
+
function qt(e) {
|
|
1000
|
+
e.preventDefault();
|
|
1001
|
+
}
|
|
1002
|
+
function Wr(e) {
|
|
1003
|
+
e.stopPropagation();
|
|
1004
|
+
}
|
|
1005
|
+
var E;
|
|
1006
|
+
(function(e) {
|
|
1007
|
+
e.Space = "Space", e.Down = "ArrowDown", e.Right = "ArrowRight", e.Left = "ArrowLeft", e.Up = "ArrowUp", e.Esc = "Escape", e.Enter = "Enter", e.Tab = "Tab";
|
|
1008
|
+
})(E || (E = {}));
|
|
1009
|
+
const mn = {
|
|
1010
|
+
start: [E.Space, E.Enter],
|
|
1011
|
+
cancel: [E.Esc],
|
|
1012
|
+
end: [E.Space, E.Enter, E.Tab]
|
|
1013
|
+
}, Xr = (e, t) => {
|
|
1014
|
+
let {
|
|
1015
|
+
currentCoordinates: n
|
|
1016
|
+
} = t;
|
|
1017
|
+
switch (e.code) {
|
|
1018
|
+
case E.Right:
|
|
1019
|
+
return {
|
|
1020
|
+
...n,
|
|
1021
|
+
x: n.x + 25
|
|
1022
|
+
};
|
|
1023
|
+
case E.Left:
|
|
1024
|
+
return {
|
|
1025
|
+
...n,
|
|
1026
|
+
x: n.x - 25
|
|
1027
|
+
};
|
|
1028
|
+
case E.Down:
|
|
1029
|
+
return {
|
|
1030
|
+
...n,
|
|
1031
|
+
y: n.y + 25
|
|
1032
|
+
};
|
|
1033
|
+
case E.Up:
|
|
1034
|
+
return {
|
|
1035
|
+
...n,
|
|
1036
|
+
y: n.y - 25
|
|
1037
|
+
};
|
|
1038
|
+
}
|
|
1039
|
+
};
|
|
1040
|
+
class Ot {
|
|
1041
|
+
constructor(t) {
|
|
1042
|
+
this.props = void 0, this.autoScrollEnabled = !1, this.referenceCoordinates = void 0, this.listeners = void 0, this.windowListeners = void 0, this.props = t;
|
|
1043
|
+
const {
|
|
1044
|
+
event: {
|
|
1045
|
+
target: n
|
|
1046
|
+
}
|
|
1047
|
+
} = t;
|
|
1048
|
+
this.props = t, this.listeners = new Ye(je(n)), this.windowListeners = new Ye(q(n)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
|
|
1049
|
+
}
|
|
1050
|
+
attach() {
|
|
1051
|
+
this.handleStart(), this.windowListeners.add(re.Resize, this.handleCancel), this.windowListeners.add(re.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(re.Keydown, this.handleKeyDown));
|
|
1052
|
+
}
|
|
1053
|
+
handleStart() {
|
|
1054
|
+
const {
|
|
1055
|
+
activeNode: t,
|
|
1056
|
+
onStart: n
|
|
1057
|
+
} = this.props, r = t.node.current;
|
|
1058
|
+
r && $r(r), n(ie);
|
|
1059
|
+
}
|
|
1060
|
+
handleKeyDown(t) {
|
|
1061
|
+
if (Tt(t)) {
|
|
1062
|
+
const {
|
|
1063
|
+
active: n,
|
|
1064
|
+
context: r,
|
|
1065
|
+
options: o
|
|
1066
|
+
} = this.props, {
|
|
1067
|
+
keyboardCodes: i = mn,
|
|
1068
|
+
coordinateGetter: s = Xr,
|
|
1069
|
+
scrollBehavior: a = "smooth"
|
|
1070
|
+
} = o, {
|
|
1071
|
+
code: l
|
|
1072
|
+
} = t;
|
|
1073
|
+
if (i.end.includes(l)) {
|
|
1074
|
+
this.handleEnd(t);
|
|
1075
|
+
return;
|
|
1076
|
+
}
|
|
1077
|
+
if (i.cancel.includes(l)) {
|
|
1078
|
+
this.handleCancel(t);
|
|
1079
|
+
return;
|
|
1080
|
+
}
|
|
1081
|
+
const {
|
|
1082
|
+
collisionRect: u
|
|
1083
|
+
} = r.current, c = u ? {
|
|
1084
|
+
x: u.left,
|
|
1085
|
+
y: u.top
|
|
1086
|
+
} : ie;
|
|
1087
|
+
this.referenceCoordinates || (this.referenceCoordinates = c);
|
|
1088
|
+
const d = s(t, {
|
|
1089
|
+
active: n,
|
|
1090
|
+
context: r.current,
|
|
1091
|
+
currentCoordinates: c
|
|
1092
|
+
});
|
|
1093
|
+
if (d) {
|
|
1094
|
+
const f = lt(d, c), h = {
|
|
1095
|
+
x: 0,
|
|
1096
|
+
y: 0
|
|
1097
|
+
}, {
|
|
1098
|
+
scrollableAncestors: v
|
|
1099
|
+
} = r.current;
|
|
1100
|
+
for (const g of v) {
|
|
1101
|
+
const b = t.code, {
|
|
1102
|
+
isTop: x,
|
|
1103
|
+
isRight: p,
|
|
1104
|
+
isLeft: y,
|
|
1105
|
+
isBottom: R,
|
|
1106
|
+
maxScroll: S,
|
|
1107
|
+
minScroll: I
|
|
1108
|
+
} = xn(g), m = jr(g), w = {
|
|
1109
|
+
x: Math.min(b === E.Right ? m.right - m.width / 2 : m.right, Math.max(b === E.Right ? m.left : m.left + m.width / 2, d.x)),
|
|
1110
|
+
y: Math.min(b === E.Down ? m.bottom - m.height / 2 : m.bottom, Math.max(b === E.Down ? m.top : m.top + m.height / 2, d.y))
|
|
1111
|
+
}, D = b === E.Right && !p || b === E.Left && !y, N = b === E.Down && !R || b === E.Up && !x;
|
|
1112
|
+
if (D && w.x !== d.x) {
|
|
1113
|
+
const C = g.scrollLeft + f.x, P = b === E.Right && C <= S.x || b === E.Left && C >= I.x;
|
|
1114
|
+
if (P && !f.y) {
|
|
1115
|
+
g.scrollTo({
|
|
1116
|
+
left: C,
|
|
1117
|
+
behavior: a
|
|
1118
|
+
});
|
|
1119
|
+
return;
|
|
1120
|
+
}
|
|
1121
|
+
P ? h.x = g.scrollLeft - C : h.x = b === E.Right ? g.scrollLeft - S.x : g.scrollLeft - I.x, h.x && g.scrollBy({
|
|
1122
|
+
left: -h.x,
|
|
1123
|
+
behavior: a
|
|
1124
|
+
});
|
|
1125
|
+
break;
|
|
1126
|
+
} else if (N && w.y !== d.y) {
|
|
1127
|
+
const C = g.scrollTop + f.y, P = b === E.Down && C <= S.y || b === E.Up && C >= I.y;
|
|
1128
|
+
if (P && !f.x) {
|
|
1129
|
+
g.scrollTo({
|
|
1130
|
+
top: C,
|
|
1131
|
+
behavior: a
|
|
1132
|
+
});
|
|
1133
|
+
return;
|
|
1134
|
+
}
|
|
1135
|
+
P ? h.y = g.scrollTop - C : h.y = b === E.Down ? g.scrollTop - S.y : g.scrollTop - I.y, h.y && g.scrollBy({
|
|
1136
|
+
top: -h.y,
|
|
1137
|
+
behavior: a
|
|
1138
|
+
});
|
|
1139
|
+
break;
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
this.handleMove(t, Le(lt(d, this.referenceCoordinates), h));
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
handleMove(t, n) {
|
|
1147
|
+
const {
|
|
1148
|
+
onMove: r
|
|
1149
|
+
} = this.props;
|
|
1150
|
+
t.preventDefault(), r(n);
|
|
1151
|
+
}
|
|
1152
|
+
handleEnd(t) {
|
|
1153
|
+
const {
|
|
1154
|
+
onEnd: n
|
|
1155
|
+
} = this.props;
|
|
1156
|
+
t.preventDefault(), this.detach(), n();
|
|
1157
|
+
}
|
|
1158
|
+
handleCancel(t) {
|
|
1159
|
+
const {
|
|
1160
|
+
onCancel: n
|
|
1161
|
+
} = this.props;
|
|
1162
|
+
t.preventDefault(), this.detach(), n();
|
|
1163
|
+
}
|
|
1164
|
+
detach() {
|
|
1165
|
+
this.listeners.removeAll(), this.windowListeners.removeAll();
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
Ot.activators = [{
|
|
1169
|
+
eventName: "onKeyDown",
|
|
1170
|
+
handler: (e, t, n) => {
|
|
1171
|
+
let {
|
|
1172
|
+
keyboardCodes: r = mn,
|
|
1173
|
+
onActivation: o
|
|
1174
|
+
} = t, {
|
|
1175
|
+
active: i
|
|
1176
|
+
} = n;
|
|
1177
|
+
const {
|
|
1178
|
+
code: s
|
|
1179
|
+
} = e.nativeEvent;
|
|
1180
|
+
if (r.start.includes(s)) {
|
|
1181
|
+
const a = i.activatorNode.current;
|
|
1182
|
+
return a && e.target !== a ? !1 : (e.preventDefault(), o == null || o({
|
|
1183
|
+
event: e.nativeEvent
|
|
1184
|
+
}), !0);
|
|
1185
|
+
}
|
|
1186
|
+
return !1;
|
|
1187
|
+
}
|
|
1188
|
+
}];
|
|
1189
|
+
function Gt(e) {
|
|
1190
|
+
return !!(e && "distance" in e);
|
|
1191
|
+
}
|
|
1192
|
+
function Jt(e) {
|
|
1193
|
+
return !!(e && "delay" in e);
|
|
1194
|
+
}
|
|
1195
|
+
class Mt {
|
|
1196
|
+
constructor(t, n, r) {
|
|
1197
|
+
var o;
|
|
1198
|
+
r === void 0 && (r = Hr(t.event.target)), this.props = void 0, this.events = void 0, this.autoScrollEnabled = !0, this.document = void 0, this.activated = !1, this.initialCoordinates = void 0, this.timeoutId = null, this.listeners = void 0, this.documentListeners = void 0, this.windowListeners = void 0, this.props = t, this.events = n;
|
|
1199
|
+
const {
|
|
1200
|
+
event: i
|
|
1201
|
+
} = t, {
|
|
1202
|
+
target: s
|
|
1203
|
+
} = i;
|
|
1204
|
+
this.props = t, this.events = n, this.document = je(s), this.documentListeners = new Ye(this.document), this.listeners = new Ye(r), this.windowListeners = new Ye(q(s)), this.initialCoordinates = (o = St(i)) != null ? o : ie, this.handleStart = this.handleStart.bind(this), this.handleMove = this.handleMove.bind(this), this.handleEnd = this.handleEnd.bind(this), this.handleCancel = this.handleCancel.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.removeTextSelection = this.removeTextSelection.bind(this), this.attach();
|
|
1205
|
+
}
|
|
1206
|
+
attach() {
|
|
1207
|
+
const {
|
|
1208
|
+
events: t,
|
|
1209
|
+
props: {
|
|
1210
|
+
options: {
|
|
1211
|
+
activationConstraint: n,
|
|
1212
|
+
bypassActivationConstraint: r
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
} = this;
|
|
1216
|
+
if (this.listeners.add(t.move.name, this.handleMove, {
|
|
1217
|
+
passive: !1
|
|
1218
|
+
}), this.listeners.add(t.end.name, this.handleEnd), t.cancel && this.listeners.add(t.cancel.name, this.handleCancel), this.windowListeners.add(re.Resize, this.handleCancel), this.windowListeners.add(re.DragStart, qt), this.windowListeners.add(re.VisibilityChange, this.handleCancel), this.windowListeners.add(re.ContextMenu, qt), this.documentListeners.add(re.Keydown, this.handleKeydown), n) {
|
|
1219
|
+
if (r != null && r({
|
|
1220
|
+
event: this.props.event,
|
|
1221
|
+
activeNode: this.props.activeNode,
|
|
1222
|
+
options: this.props.options
|
|
1223
|
+
}))
|
|
1224
|
+
return this.handleStart();
|
|
1225
|
+
if (Jt(n)) {
|
|
1226
|
+
this.timeoutId = setTimeout(this.handleStart, n.delay), this.handlePending(n);
|
|
1227
|
+
return;
|
|
1228
|
+
}
|
|
1229
|
+
if (Gt(n)) {
|
|
1230
|
+
this.handlePending(n);
|
|
1231
|
+
return;
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
this.handleStart();
|
|
1235
|
+
}
|
|
1236
|
+
detach() {
|
|
1237
|
+
this.listeners.removeAll(), this.windowListeners.removeAll(), setTimeout(this.documentListeners.removeAll, 50), this.timeoutId !== null && (clearTimeout(this.timeoutId), this.timeoutId = null);
|
|
1238
|
+
}
|
|
1239
|
+
handlePending(t, n) {
|
|
1240
|
+
const {
|
|
1241
|
+
active: r,
|
|
1242
|
+
onPending: o
|
|
1243
|
+
} = this.props;
|
|
1244
|
+
o(r, t, this.initialCoordinates, n);
|
|
1245
|
+
}
|
|
1246
|
+
handleStart() {
|
|
1247
|
+
const {
|
|
1248
|
+
initialCoordinates: t
|
|
1249
|
+
} = this, {
|
|
1250
|
+
onStart: n
|
|
1251
|
+
} = this.props;
|
|
1252
|
+
t && (this.activated = !0, this.documentListeners.add(re.Click, Wr, {
|
|
1253
|
+
capture: !0
|
|
1254
|
+
}), this.removeTextSelection(), this.documentListeners.add(re.SelectionChange, this.removeTextSelection), n(t));
|
|
1255
|
+
}
|
|
1256
|
+
handleMove(t) {
|
|
1257
|
+
var n;
|
|
1258
|
+
const {
|
|
1259
|
+
activated: r,
|
|
1260
|
+
initialCoordinates: o,
|
|
1261
|
+
props: i
|
|
1262
|
+
} = this, {
|
|
1263
|
+
onMove: s,
|
|
1264
|
+
options: {
|
|
1265
|
+
activationConstraint: a
|
|
1266
|
+
}
|
|
1267
|
+
} = i;
|
|
1268
|
+
if (!o)
|
|
1269
|
+
return;
|
|
1270
|
+
const l = (n = St(t)) != null ? n : ie, u = lt(o, l);
|
|
1271
|
+
if (!r && a) {
|
|
1272
|
+
if (Gt(a)) {
|
|
1273
|
+
if (a.tolerance != null && xt(u, a.tolerance))
|
|
1274
|
+
return this.handleCancel();
|
|
1275
|
+
if (xt(u, a.distance))
|
|
1276
|
+
return this.handleStart();
|
|
1277
|
+
}
|
|
1278
|
+
if (Jt(a) && xt(u, a.tolerance))
|
|
1279
|
+
return this.handleCancel();
|
|
1280
|
+
this.handlePending(a, u);
|
|
1281
|
+
return;
|
|
1282
|
+
}
|
|
1283
|
+
t.cancelable && t.preventDefault(), s(l);
|
|
1284
|
+
}
|
|
1285
|
+
handleEnd() {
|
|
1286
|
+
const {
|
|
1287
|
+
onAbort: t,
|
|
1288
|
+
onEnd: n
|
|
1289
|
+
} = this.props;
|
|
1290
|
+
this.detach(), this.activated || t(this.props.active), n();
|
|
1291
|
+
}
|
|
1292
|
+
handleCancel() {
|
|
1293
|
+
const {
|
|
1294
|
+
onAbort: t,
|
|
1295
|
+
onCancel: n
|
|
1296
|
+
} = this.props;
|
|
1297
|
+
this.detach(), this.activated || t(this.props.active), n();
|
|
1298
|
+
}
|
|
1299
|
+
handleKeydown(t) {
|
|
1300
|
+
t.code === E.Esc && this.handleCancel();
|
|
1301
|
+
}
|
|
1302
|
+
removeTextSelection() {
|
|
1303
|
+
var t;
|
|
1304
|
+
(t = this.document.getSelection()) == null || t.removeAllRanges();
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
const Yr = {
|
|
1308
|
+
cancel: {
|
|
1309
|
+
name: "pointercancel"
|
|
1310
|
+
},
|
|
1311
|
+
move: {
|
|
1312
|
+
name: "pointermove"
|
|
1313
|
+
},
|
|
1314
|
+
end: {
|
|
1315
|
+
name: "pointerup"
|
|
1316
|
+
}
|
|
1317
|
+
};
|
|
1318
|
+
class Lt extends Mt {
|
|
1319
|
+
constructor(t) {
|
|
1320
|
+
const {
|
|
1321
|
+
event: n
|
|
1322
|
+
} = t, r = je(n.target);
|
|
1323
|
+
super(t, Yr, r);
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
Lt.activators = [{
|
|
1327
|
+
eventName: "onPointerDown",
|
|
1328
|
+
handler: (e, t) => {
|
|
1329
|
+
let {
|
|
1330
|
+
nativeEvent: n
|
|
1331
|
+
} = e, {
|
|
1332
|
+
onActivation: r
|
|
1333
|
+
} = t;
|
|
1334
|
+
return !n.isPrimary || n.button !== 0 ? !1 : (r == null || r({
|
|
1335
|
+
event: n
|
|
1336
|
+
}), !0);
|
|
1337
|
+
}
|
|
1338
|
+
}];
|
|
1339
|
+
const Kr = {
|
|
1340
|
+
move: {
|
|
1341
|
+
name: "mousemove"
|
|
1342
|
+
},
|
|
1343
|
+
end: {
|
|
1344
|
+
name: "mouseup"
|
|
1345
|
+
}
|
|
1346
|
+
};
|
|
1347
|
+
var Ct;
|
|
1348
|
+
(function(e) {
|
|
1349
|
+
e[e.RightClick = 2] = "RightClick";
|
|
1350
|
+
})(Ct || (Ct = {}));
|
|
1351
|
+
class Ur extends Mt {
|
|
1352
|
+
constructor(t) {
|
|
1353
|
+
super(t, Kr, je(t.event.target));
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
Ur.activators = [{
|
|
1357
|
+
eventName: "onMouseDown",
|
|
1358
|
+
handler: (e, t) => {
|
|
1359
|
+
let {
|
|
1360
|
+
nativeEvent: n
|
|
1361
|
+
} = e, {
|
|
1362
|
+
onActivation: r
|
|
1363
|
+
} = t;
|
|
1364
|
+
return n.button === Ct.RightClick ? !1 : (r == null || r({
|
|
1365
|
+
event: n
|
|
1366
|
+
}), !0);
|
|
1367
|
+
}
|
|
1368
|
+
}];
|
|
1369
|
+
const wt = {
|
|
1370
|
+
cancel: {
|
|
1371
|
+
name: "touchcancel"
|
|
1372
|
+
},
|
|
1373
|
+
move: {
|
|
1374
|
+
name: "touchmove"
|
|
1375
|
+
},
|
|
1376
|
+
end: {
|
|
1377
|
+
name: "touchend"
|
|
1378
|
+
}
|
|
1379
|
+
};
|
|
1380
|
+
class Vr extends Mt {
|
|
1381
|
+
constructor(t) {
|
|
1382
|
+
super(t, wt);
|
|
1383
|
+
}
|
|
1384
|
+
static setup() {
|
|
1385
|
+
return window.addEventListener(wt.move.name, t, {
|
|
1386
|
+
capture: !1,
|
|
1387
|
+
passive: !1
|
|
1388
|
+
}), function() {
|
|
1389
|
+
window.removeEventListener(wt.move.name, t);
|
|
1390
|
+
};
|
|
1391
|
+
function t() {
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
Vr.activators = [{
|
|
1396
|
+
eventName: "onTouchStart",
|
|
1397
|
+
handler: (e, t) => {
|
|
1398
|
+
let {
|
|
1399
|
+
nativeEvent: n
|
|
1400
|
+
} = e, {
|
|
1401
|
+
onActivation: r
|
|
1402
|
+
} = t;
|
|
1403
|
+
const {
|
|
1404
|
+
touches: o
|
|
1405
|
+
} = n;
|
|
1406
|
+
return o.length > 1 ? !1 : (r == null || r({
|
|
1407
|
+
event: n
|
|
1408
|
+
}), !0);
|
|
1409
|
+
}
|
|
1410
|
+
}];
|
|
1411
|
+
var Ke;
|
|
1412
|
+
(function(e) {
|
|
1413
|
+
e[e.Pointer = 0] = "Pointer", e[e.DraggableRect = 1] = "DraggableRect";
|
|
1414
|
+
})(Ke || (Ke = {}));
|
|
1415
|
+
var ut;
|
|
1416
|
+
(function(e) {
|
|
1417
|
+
e[e.TreeOrder = 0] = "TreeOrder", e[e.ReversedTreeOrder = 1] = "ReversedTreeOrder";
|
|
1418
|
+
})(ut || (ut = {}));
|
|
1419
|
+
function qr(e) {
|
|
1420
|
+
let {
|
|
1421
|
+
acceleration: t,
|
|
1422
|
+
activator: n = Ke.Pointer,
|
|
1423
|
+
canScroll: r,
|
|
1424
|
+
draggingRect: o,
|
|
1425
|
+
enabled: i,
|
|
1426
|
+
interval: s = 5,
|
|
1427
|
+
order: a = ut.TreeOrder,
|
|
1428
|
+
pointerCoordinates: l,
|
|
1429
|
+
scrollableAncestors: u,
|
|
1430
|
+
scrollableAncestorRects: c,
|
|
1431
|
+
delta: d,
|
|
1432
|
+
threshold: f
|
|
1433
|
+
} = e;
|
|
1434
|
+
const h = Jr({
|
|
1435
|
+
delta: d,
|
|
1436
|
+
disabled: !i
|
|
1437
|
+
}), [v, g] = or(), b = L({
|
|
1438
|
+
x: 0,
|
|
1439
|
+
y: 0
|
|
1440
|
+
}), x = L({
|
|
1441
|
+
x: 0,
|
|
1442
|
+
y: 0
|
|
1443
|
+
}), p = O(() => {
|
|
1444
|
+
switch (n) {
|
|
1445
|
+
case Ke.Pointer:
|
|
1446
|
+
return l ? {
|
|
1447
|
+
top: l.y,
|
|
1448
|
+
bottom: l.y,
|
|
1449
|
+
left: l.x,
|
|
1450
|
+
right: l.x
|
|
1451
|
+
} : null;
|
|
1452
|
+
case Ke.DraggableRect:
|
|
1453
|
+
return o;
|
|
1454
|
+
}
|
|
1455
|
+
}, [n, o, l]), y = L(null), R = K(() => {
|
|
1456
|
+
const I = y.current;
|
|
1457
|
+
if (!I)
|
|
1458
|
+
return;
|
|
1459
|
+
const m = b.current.x * x.current.x, w = b.current.y * x.current.y;
|
|
1460
|
+
I.scrollBy(m, w);
|
|
1461
|
+
}, []), S = O(() => a === ut.TreeOrder ? [...u].reverse() : u, [a, u]);
|
|
1462
|
+
M(
|
|
1463
|
+
() => {
|
|
1464
|
+
if (!i || !u.length || !p) {
|
|
1465
|
+
g();
|
|
1466
|
+
return;
|
|
1467
|
+
}
|
|
1468
|
+
for (const I of S) {
|
|
1469
|
+
if ((r == null ? void 0 : r(I)) === !1)
|
|
1470
|
+
continue;
|
|
1471
|
+
const m = u.indexOf(I), w = c[m];
|
|
1472
|
+
if (!w)
|
|
1473
|
+
continue;
|
|
1474
|
+
const {
|
|
1475
|
+
direction: D,
|
|
1476
|
+
speed: N
|
|
1477
|
+
} = zr(I, w, p, t, f);
|
|
1478
|
+
for (const C of ["x", "y"])
|
|
1479
|
+
h[C][D[C]] || (N[C] = 0, D[C] = 0);
|
|
1480
|
+
if (N.x > 0 || N.y > 0) {
|
|
1481
|
+
g(), y.current = I, v(R, s), b.current = N, x.current = D;
|
|
1482
|
+
return;
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
b.current = {
|
|
1486
|
+
x: 0,
|
|
1487
|
+
y: 0
|
|
1488
|
+
}, x.current = {
|
|
1489
|
+
x: 0,
|
|
1490
|
+
y: 0
|
|
1491
|
+
}, g();
|
|
1492
|
+
},
|
|
1493
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1494
|
+
[
|
|
1495
|
+
t,
|
|
1496
|
+
R,
|
|
1497
|
+
r,
|
|
1498
|
+
g,
|
|
1499
|
+
i,
|
|
1500
|
+
s,
|
|
1501
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1502
|
+
JSON.stringify(p),
|
|
1503
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1504
|
+
JSON.stringify(h),
|
|
1505
|
+
v,
|
|
1506
|
+
u,
|
|
1507
|
+
S,
|
|
1508
|
+
c,
|
|
1509
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1510
|
+
JSON.stringify(f)
|
|
1511
|
+
]
|
|
1512
|
+
);
|
|
1513
|
+
}
|
|
1514
|
+
const Gr = {
|
|
1515
|
+
x: {
|
|
1516
|
+
[F.Backward]: !1,
|
|
1517
|
+
[F.Forward]: !1
|
|
1518
|
+
},
|
|
1519
|
+
y: {
|
|
1520
|
+
[F.Backward]: !1,
|
|
1521
|
+
[F.Forward]: !1
|
|
1522
|
+
}
|
|
1523
|
+
};
|
|
1524
|
+
function Jr(e) {
|
|
1525
|
+
let {
|
|
1526
|
+
delta: t,
|
|
1527
|
+
disabled: n
|
|
1528
|
+
} = e;
|
|
1529
|
+
const r = mt(t);
|
|
1530
|
+
return Ze((o) => {
|
|
1531
|
+
if (n || !r || !o)
|
|
1532
|
+
return Gr;
|
|
1533
|
+
const i = {
|
|
1534
|
+
x: Math.sign(t.x - r.x),
|
|
1535
|
+
y: Math.sign(t.y - r.y)
|
|
1536
|
+
};
|
|
1537
|
+
return {
|
|
1538
|
+
x: {
|
|
1539
|
+
[F.Backward]: o.x[F.Backward] || i.x === -1,
|
|
1540
|
+
[F.Forward]: o.x[F.Forward] || i.x === 1
|
|
1541
|
+
},
|
|
1542
|
+
y: {
|
|
1543
|
+
[F.Backward]: o.y[F.Backward] || i.y === -1,
|
|
1544
|
+
[F.Forward]: o.y[F.Forward] || i.y === 1
|
|
1545
|
+
}
|
|
1546
|
+
};
|
|
1547
|
+
}, [n, t, r]);
|
|
1548
|
+
}
|
|
1549
|
+
function _r(e, t) {
|
|
1550
|
+
const n = t != null ? e.get(t) : void 0, r = n ? n.node.current : null;
|
|
1551
|
+
return Ze((o) => {
|
|
1552
|
+
var i;
|
|
1553
|
+
return t == null ? null : (i = r ?? o) != null ? i : null;
|
|
1554
|
+
}, [r, t]);
|
|
1555
|
+
}
|
|
1556
|
+
function Zr(e, t) {
|
|
1557
|
+
return O(() => e.reduce((n, r) => {
|
|
1558
|
+
const {
|
|
1559
|
+
sensor: o
|
|
1560
|
+
} = r, i = o.activators.map((s) => ({
|
|
1561
|
+
eventName: s.eventName,
|
|
1562
|
+
handler: t(s.handler, r)
|
|
1563
|
+
}));
|
|
1564
|
+
return [...n, ...i];
|
|
1565
|
+
}, []), [e, t]);
|
|
1566
|
+
}
|
|
1567
|
+
var Ge;
|
|
1568
|
+
(function(e) {
|
|
1569
|
+
e[e.Always = 0] = "Always", e[e.BeforeDragging = 1] = "BeforeDragging", e[e.WhileDragging = 2] = "WhileDragging";
|
|
1570
|
+
})(Ge || (Ge = {}));
|
|
1571
|
+
var Rt;
|
|
1572
|
+
(function(e) {
|
|
1573
|
+
e.Optimized = "optimized";
|
|
1574
|
+
})(Rt || (Rt = {}));
|
|
1575
|
+
const _t = /* @__PURE__ */ new Map();
|
|
1576
|
+
function Qr(e, t) {
|
|
1577
|
+
let {
|
|
1578
|
+
dragging: n,
|
|
1579
|
+
dependencies: r,
|
|
1580
|
+
config: o
|
|
1581
|
+
} = t;
|
|
1582
|
+
const [i, s] = Q(null), {
|
|
1583
|
+
frequency: a,
|
|
1584
|
+
measure: l,
|
|
1585
|
+
strategy: u
|
|
1586
|
+
} = o, c = L(e), d = b(), f = Ve(d), h = K(function(x) {
|
|
1587
|
+
x === void 0 && (x = []), !f.current && s((p) => p === null ? x : p.concat(x.filter((y) => !p.includes(y))));
|
|
1588
|
+
}, [f]), v = L(null), g = Ze((x) => {
|
|
1589
|
+
if (d && !n)
|
|
1590
|
+
return _t;
|
|
1591
|
+
if (!x || x === _t || c.current !== e || i != null) {
|
|
1592
|
+
const p = /* @__PURE__ */ new Map();
|
|
1593
|
+
for (let y of e) {
|
|
1594
|
+
if (!y)
|
|
1595
|
+
continue;
|
|
1596
|
+
if (i && i.length > 0 && !i.includes(y.id) && y.rect.current) {
|
|
1597
|
+
p.set(y.id, y.rect.current);
|
|
1598
|
+
continue;
|
|
1599
|
+
}
|
|
1600
|
+
const R = y.node.current, S = R ? new Nt(l(R), R) : null;
|
|
1601
|
+
y.rect.current = S, S && p.set(y.id, S);
|
|
1602
|
+
}
|
|
1603
|
+
return p;
|
|
1604
|
+
}
|
|
1605
|
+
return x;
|
|
1606
|
+
}, [e, i, n, d, l]);
|
|
1607
|
+
return M(() => {
|
|
1608
|
+
c.current = e;
|
|
1609
|
+
}, [e]), M(
|
|
1610
|
+
() => {
|
|
1611
|
+
d || h();
|
|
1612
|
+
},
|
|
1613
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1614
|
+
[n, d]
|
|
1615
|
+
), M(
|
|
1616
|
+
() => {
|
|
1617
|
+
i && i.length > 0 && s(null);
|
|
1618
|
+
},
|
|
1619
|
+
//eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1620
|
+
[JSON.stringify(i)]
|
|
1621
|
+
), M(
|
|
1622
|
+
() => {
|
|
1623
|
+
d || typeof a != "number" || v.current !== null || (v.current = setTimeout(() => {
|
|
1624
|
+
h(), v.current = null;
|
|
1625
|
+
}, a));
|
|
1626
|
+
},
|
|
1627
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1628
|
+
[a, d, h, ...r]
|
|
1629
|
+
), {
|
|
1630
|
+
droppableRects: g,
|
|
1631
|
+
measureDroppableContainers: h,
|
|
1632
|
+
measuringScheduled: i != null
|
|
1633
|
+
};
|
|
1634
|
+
function b() {
|
|
1635
|
+
switch (u) {
|
|
1636
|
+
case Ge.Always:
|
|
1637
|
+
return !1;
|
|
1638
|
+
case Ge.BeforeDragging:
|
|
1639
|
+
return n;
|
|
1640
|
+
default:
|
|
1641
|
+
return !n;
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
function Sn(e, t) {
|
|
1646
|
+
return Ze((n) => e ? n || (typeof t == "function" ? t(e) : e) : null, [t, e]);
|
|
1647
|
+
}
|
|
1648
|
+
function eo(e, t) {
|
|
1649
|
+
return Sn(e, t);
|
|
1650
|
+
}
|
|
1651
|
+
function to(e) {
|
|
1652
|
+
let {
|
|
1653
|
+
callback: t,
|
|
1654
|
+
disabled: n
|
|
1655
|
+
} = e;
|
|
1656
|
+
const r = kt(t), o = O(() => {
|
|
1657
|
+
if (n || typeof window > "u" || typeof window.MutationObserver > "u")
|
|
1658
|
+
return;
|
|
1659
|
+
const {
|
|
1660
|
+
MutationObserver: i
|
|
1661
|
+
} = window;
|
|
1662
|
+
return new i(r);
|
|
1663
|
+
}, [r, n]);
|
|
1664
|
+
return M(() => () => o == null ? void 0 : o.disconnect(), [o]), o;
|
|
1665
|
+
}
|
|
1666
|
+
function ft(e) {
|
|
1667
|
+
let {
|
|
1668
|
+
callback: t,
|
|
1669
|
+
disabled: n
|
|
1670
|
+
} = e;
|
|
1671
|
+
const r = kt(t), o = O(
|
|
1672
|
+
() => {
|
|
1673
|
+
if (n || typeof window > "u" || typeof window.ResizeObserver > "u")
|
|
1674
|
+
return;
|
|
1675
|
+
const {
|
|
1676
|
+
ResizeObserver: i
|
|
1677
|
+
} = window;
|
|
1678
|
+
return new i(r);
|
|
1679
|
+
},
|
|
1680
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1681
|
+
[n]
|
|
1682
|
+
);
|
|
1683
|
+
return M(() => () => o == null ? void 0 : o.disconnect(), [o]), o;
|
|
1684
|
+
}
|
|
1685
|
+
function no(e) {
|
|
1686
|
+
return new Nt(Pe(e), e);
|
|
1687
|
+
}
|
|
1688
|
+
function Zt(e, t, n) {
|
|
1689
|
+
t === void 0 && (t = no);
|
|
1690
|
+
const [r, o] = Q(null);
|
|
1691
|
+
function i() {
|
|
1692
|
+
o((l) => {
|
|
1693
|
+
if (!e)
|
|
1694
|
+
return null;
|
|
1695
|
+
if (e.isConnected === !1) {
|
|
1696
|
+
var u;
|
|
1697
|
+
return (u = l ?? n) != null ? u : null;
|
|
1698
|
+
}
|
|
1699
|
+
const c = t(e);
|
|
1700
|
+
return JSON.stringify(l) === JSON.stringify(c) ? l : c;
|
|
1701
|
+
});
|
|
1702
|
+
}
|
|
1703
|
+
const s = to({
|
|
1704
|
+
callback(l) {
|
|
1705
|
+
if (e)
|
|
1706
|
+
for (const u of l) {
|
|
1707
|
+
const {
|
|
1708
|
+
type: c,
|
|
1709
|
+
target: d
|
|
1710
|
+
} = u;
|
|
1711
|
+
if (c === "childList" && d instanceof HTMLElement && d.contains(e)) {
|
|
1712
|
+
i();
|
|
1713
|
+
break;
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
}
|
|
1717
|
+
}), a = ft({
|
|
1718
|
+
callback: i
|
|
1719
|
+
});
|
|
1720
|
+
return fe(() => {
|
|
1721
|
+
i(), e ? (a == null || a.observe(e), s == null || s.observe(document.body, {
|
|
1722
|
+
childList: !0,
|
|
1723
|
+
subtree: !0
|
|
1724
|
+
})) : (a == null || a.disconnect(), s == null || s.disconnect());
|
|
1725
|
+
}, [e]), r;
|
|
1726
|
+
}
|
|
1727
|
+
function ro(e) {
|
|
1728
|
+
const t = Sn(e);
|
|
1729
|
+
return gn(e, t);
|
|
1730
|
+
}
|
|
1731
|
+
const Qt = [];
|
|
1732
|
+
function oo(e) {
|
|
1733
|
+
const t = L(e), n = Ze((r) => e ? r && r !== Qt && e && t.current && e.parentNode === t.current.parentNode ? r : At(e) : Qt, [e]);
|
|
1734
|
+
return M(() => {
|
|
1735
|
+
t.current = e;
|
|
1736
|
+
}, [e]), n;
|
|
1737
|
+
}
|
|
1738
|
+
function io(e) {
|
|
1739
|
+
const [t, n] = Q(null), r = L(e), o = K((i) => {
|
|
1740
|
+
const s = yt(i.target);
|
|
1741
|
+
s && n((a) => a ? (a.set(s, Dt(s)), new Map(a)) : null);
|
|
1742
|
+
}, []);
|
|
1743
|
+
return M(() => {
|
|
1744
|
+
const i = r.current;
|
|
1745
|
+
if (e !== i) {
|
|
1746
|
+
s(i);
|
|
1747
|
+
const a = e.map((l) => {
|
|
1748
|
+
const u = yt(l);
|
|
1749
|
+
return u ? (u.addEventListener("scroll", o, {
|
|
1750
|
+
passive: !0
|
|
1751
|
+
}), [u, Dt(u)]) : null;
|
|
1752
|
+
}).filter((l) => l != null);
|
|
1753
|
+
n(a.length ? new Map(a) : null), r.current = e;
|
|
1754
|
+
}
|
|
1755
|
+
return () => {
|
|
1756
|
+
s(e), s(i);
|
|
1757
|
+
};
|
|
1758
|
+
function s(a) {
|
|
1759
|
+
a.forEach((l) => {
|
|
1760
|
+
const u = yt(l);
|
|
1761
|
+
u == null || u.removeEventListener("scroll", o);
|
|
1762
|
+
});
|
|
1763
|
+
}
|
|
1764
|
+
}, [o, e]), O(() => e.length ? t ? Array.from(t.values()).reduce((i, s) => Le(i, s), ie) : wn(e) : ie, [e, t]);
|
|
1765
|
+
}
|
|
1766
|
+
function en(e, t) {
|
|
1767
|
+
t === void 0 && (t = []);
|
|
1768
|
+
const n = L(null);
|
|
1769
|
+
return M(
|
|
1770
|
+
() => {
|
|
1771
|
+
n.current = null;
|
|
1772
|
+
},
|
|
1773
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1774
|
+
t
|
|
1775
|
+
), M(() => {
|
|
1776
|
+
const r = e !== ie;
|
|
1777
|
+
r && !n.current && (n.current = e), !r && n.current && (n.current = null);
|
|
1778
|
+
}, [e]), n.current ? lt(e, n.current) : ie;
|
|
1779
|
+
}
|
|
1780
|
+
function so(e) {
|
|
1781
|
+
M(
|
|
1782
|
+
() => {
|
|
1783
|
+
if (!dt)
|
|
1784
|
+
return;
|
|
1785
|
+
const t = e.map((n) => {
|
|
1786
|
+
let {
|
|
1787
|
+
sensor: r
|
|
1788
|
+
} = n;
|
|
1789
|
+
return r.setup == null ? void 0 : r.setup();
|
|
1790
|
+
});
|
|
1791
|
+
return () => {
|
|
1792
|
+
for (const n of t)
|
|
1793
|
+
n == null || n();
|
|
1794
|
+
};
|
|
1795
|
+
},
|
|
1796
|
+
// TO-DO: Sensors length could theoretically change which would not be a valid dependency
|
|
1797
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1798
|
+
e.map((t) => {
|
|
1799
|
+
let {
|
|
1800
|
+
sensor: n
|
|
1801
|
+
} = t;
|
|
1802
|
+
return n;
|
|
1803
|
+
})
|
|
1804
|
+
);
|
|
1805
|
+
}
|
|
1806
|
+
function ao(e, t) {
|
|
1807
|
+
return O(() => e.reduce((n, r) => {
|
|
1808
|
+
let {
|
|
1809
|
+
eventName: o,
|
|
1810
|
+
handler: i
|
|
1811
|
+
} = r;
|
|
1812
|
+
return n[o] = (s) => {
|
|
1813
|
+
i(s, t);
|
|
1814
|
+
}, n;
|
|
1815
|
+
}, {}), [e, t]);
|
|
1816
|
+
}
|
|
1817
|
+
function Dn(e) {
|
|
1818
|
+
return O(() => e ? Nr(e) : null, [e]);
|
|
1819
|
+
}
|
|
1820
|
+
const tn = [];
|
|
1821
|
+
function lo(e, t) {
|
|
1822
|
+
t === void 0 && (t = Pe);
|
|
1823
|
+
const [n] = e, r = Dn(n ? q(n) : null), [o, i] = Q(tn);
|
|
1824
|
+
function s() {
|
|
1825
|
+
i(() => e.length ? e.map((l) => yn(l) ? r : new Nt(t(l), l)) : tn);
|
|
1826
|
+
}
|
|
1827
|
+
const a = ft({
|
|
1828
|
+
callback: s
|
|
1829
|
+
});
|
|
1830
|
+
return fe(() => {
|
|
1831
|
+
a == null || a.disconnect(), s(), e.forEach((l) => a == null ? void 0 : a.observe(l));
|
|
1832
|
+
}, [e]), o;
|
|
1833
|
+
}
|
|
1834
|
+
function co(e) {
|
|
1835
|
+
if (!e)
|
|
1836
|
+
return null;
|
|
1837
|
+
if (e.children.length > 1)
|
|
1838
|
+
return e;
|
|
1839
|
+
const t = e.children[0];
|
|
1840
|
+
return _e(t) ? t : e;
|
|
1841
|
+
}
|
|
1842
|
+
function uo(e) {
|
|
1843
|
+
let {
|
|
1844
|
+
measure: t
|
|
1845
|
+
} = e;
|
|
1846
|
+
const [n, r] = Q(null), o = K((u) => {
|
|
1847
|
+
for (const {
|
|
1848
|
+
target: c
|
|
1849
|
+
} of u)
|
|
1850
|
+
if (_e(c)) {
|
|
1851
|
+
r((d) => {
|
|
1852
|
+
const f = t(c);
|
|
1853
|
+
return d ? {
|
|
1854
|
+
...d,
|
|
1855
|
+
width: f.width,
|
|
1856
|
+
height: f.height
|
|
1857
|
+
} : f;
|
|
1858
|
+
});
|
|
1859
|
+
break;
|
|
1860
|
+
}
|
|
1861
|
+
}, [t]), i = ft({
|
|
1862
|
+
callback: o
|
|
1863
|
+
}), s = K((u) => {
|
|
1864
|
+
const c = co(u);
|
|
1865
|
+
i == null || i.disconnect(), c && (i == null || i.observe(c)), r(c ? t(c) : null);
|
|
1866
|
+
}, [t, i]), [a, l] = at(s);
|
|
1867
|
+
return O(() => ({
|
|
1868
|
+
nodeRef: a,
|
|
1869
|
+
rect: n,
|
|
1870
|
+
setRef: l
|
|
1871
|
+
}), [n, a, l]);
|
|
1872
|
+
}
|
|
1873
|
+
const fo = [{
|
|
1874
|
+
sensor: Lt,
|
|
1875
|
+
options: {}
|
|
1876
|
+
}, {
|
|
1877
|
+
sensor: Ot,
|
|
1878
|
+
options: {}
|
|
1879
|
+
}], ho = {
|
|
1880
|
+
current: {}
|
|
1881
|
+
}, st = {
|
|
1882
|
+
draggable: {
|
|
1883
|
+
measure: Vt
|
|
1884
|
+
},
|
|
1885
|
+
droppable: {
|
|
1886
|
+
measure: Vt,
|
|
1887
|
+
strategy: Ge.WhileDragging,
|
|
1888
|
+
frequency: Rt.Optimized
|
|
1889
|
+
},
|
|
1890
|
+
dragOverlay: {
|
|
1891
|
+
measure: Pe
|
|
1892
|
+
}
|
|
1893
|
+
};
|
|
1894
|
+
class Ue extends Map {
|
|
1895
|
+
get(t) {
|
|
1896
|
+
var n;
|
|
1897
|
+
return t != null && (n = super.get(t)) != null ? n : void 0;
|
|
1898
|
+
}
|
|
1899
|
+
toArray() {
|
|
1900
|
+
return Array.from(this.values());
|
|
1901
|
+
}
|
|
1902
|
+
getEnabled() {
|
|
1903
|
+
return this.toArray().filter((t) => {
|
|
1904
|
+
let {
|
|
1905
|
+
disabled: n
|
|
1906
|
+
} = t;
|
|
1907
|
+
return !n;
|
|
1908
|
+
});
|
|
1909
|
+
}
|
|
1910
|
+
getNodeFor(t) {
|
|
1911
|
+
var n, r;
|
|
1912
|
+
return (n = (r = this.get(t)) == null ? void 0 : r.node.current) != null ? n : void 0;
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
const go = {
|
|
1916
|
+
activatorEvent: null,
|
|
1917
|
+
active: null,
|
|
1918
|
+
activeNode: null,
|
|
1919
|
+
activeNodeRect: null,
|
|
1920
|
+
collisions: null,
|
|
1921
|
+
containerNodeRect: null,
|
|
1922
|
+
draggableNodes: /* @__PURE__ */ new Map(),
|
|
1923
|
+
droppableRects: /* @__PURE__ */ new Map(),
|
|
1924
|
+
droppableContainers: /* @__PURE__ */ new Ue(),
|
|
1925
|
+
over: null,
|
|
1926
|
+
dragOverlay: {
|
|
1927
|
+
nodeRef: {
|
|
1928
|
+
current: null
|
|
1929
|
+
},
|
|
1930
|
+
rect: null,
|
|
1931
|
+
setRef: ct
|
|
1932
|
+
},
|
|
1933
|
+
scrollableAncestors: [],
|
|
1934
|
+
scrollableAncestorRects: [],
|
|
1935
|
+
measuringConfiguration: st,
|
|
1936
|
+
measureDroppableContainers: ct,
|
|
1937
|
+
windowRect: null,
|
|
1938
|
+
measuringScheduled: !1
|
|
1939
|
+
}, bo = {
|
|
1940
|
+
activatorEvent: null,
|
|
1941
|
+
activators: [],
|
|
1942
|
+
active: null,
|
|
1943
|
+
activeNodeRect: null,
|
|
1944
|
+
ariaDescribedById: {
|
|
1945
|
+
draggable: ""
|
|
1946
|
+
},
|
|
1947
|
+
dispatch: ct,
|
|
1948
|
+
draggableNodes: /* @__PURE__ */ new Map(),
|
|
1949
|
+
over: null,
|
|
1950
|
+
measureDroppableContainers: ct
|
|
1951
|
+
}, ht = /* @__PURE__ */ Je(bo), Cn = /* @__PURE__ */ Je(go);
|
|
1952
|
+
function vo() {
|
|
1953
|
+
return {
|
|
1954
|
+
draggable: {
|
|
1955
|
+
active: null,
|
|
1956
|
+
initialCoordinates: {
|
|
1957
|
+
x: 0,
|
|
1958
|
+
y: 0
|
|
1959
|
+
},
|
|
1960
|
+
nodes: /* @__PURE__ */ new Map(),
|
|
1961
|
+
translate: {
|
|
1962
|
+
x: 0,
|
|
1963
|
+
y: 0
|
|
1964
|
+
}
|
|
1965
|
+
},
|
|
1966
|
+
droppable: {
|
|
1967
|
+
containers: new Ue()
|
|
1968
|
+
}
|
|
1969
|
+
};
|
|
1970
|
+
}
|
|
1971
|
+
function po(e, t) {
|
|
1972
|
+
switch (t.type) {
|
|
1973
|
+
case $.DragStart:
|
|
1974
|
+
return {
|
|
1975
|
+
...e,
|
|
1976
|
+
draggable: {
|
|
1977
|
+
...e.draggable,
|
|
1978
|
+
initialCoordinates: t.initialCoordinates,
|
|
1979
|
+
active: t.active
|
|
1980
|
+
}
|
|
1981
|
+
};
|
|
1982
|
+
case $.DragMove:
|
|
1983
|
+
return e.draggable.active == null ? e : {
|
|
1984
|
+
...e,
|
|
1985
|
+
draggable: {
|
|
1986
|
+
...e.draggable,
|
|
1987
|
+
translate: {
|
|
1988
|
+
x: t.coordinates.x - e.draggable.initialCoordinates.x,
|
|
1989
|
+
y: t.coordinates.y - e.draggable.initialCoordinates.y
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
};
|
|
1993
|
+
case $.DragEnd:
|
|
1994
|
+
case $.DragCancel:
|
|
1995
|
+
return {
|
|
1996
|
+
...e,
|
|
1997
|
+
draggable: {
|
|
1998
|
+
...e.draggable,
|
|
1999
|
+
active: null,
|
|
2000
|
+
initialCoordinates: {
|
|
2001
|
+
x: 0,
|
|
2002
|
+
y: 0
|
|
2003
|
+
},
|
|
2004
|
+
translate: {
|
|
2005
|
+
x: 0,
|
|
2006
|
+
y: 0
|
|
2007
|
+
}
|
|
2008
|
+
}
|
|
2009
|
+
};
|
|
2010
|
+
case $.RegisterDroppable: {
|
|
2011
|
+
const {
|
|
2012
|
+
element: n
|
|
2013
|
+
} = t, {
|
|
2014
|
+
id: r
|
|
2015
|
+
} = n, o = new Ue(e.droppable.containers);
|
|
2016
|
+
return o.set(r, n), {
|
|
2017
|
+
...e,
|
|
2018
|
+
droppable: {
|
|
2019
|
+
...e.droppable,
|
|
2020
|
+
containers: o
|
|
2021
|
+
}
|
|
2022
|
+
};
|
|
2023
|
+
}
|
|
2024
|
+
case $.SetDroppableDisabled: {
|
|
2025
|
+
const {
|
|
2026
|
+
id: n,
|
|
2027
|
+
key: r,
|
|
2028
|
+
disabled: o
|
|
2029
|
+
} = t, i = e.droppable.containers.get(n);
|
|
2030
|
+
if (!i || r !== i.key)
|
|
2031
|
+
return e;
|
|
2032
|
+
const s = new Ue(e.droppable.containers);
|
|
2033
|
+
return s.set(n, {
|
|
2034
|
+
...i,
|
|
2035
|
+
disabled: o
|
|
2036
|
+
}), {
|
|
2037
|
+
...e,
|
|
2038
|
+
droppable: {
|
|
2039
|
+
...e.droppable,
|
|
2040
|
+
containers: s
|
|
2041
|
+
}
|
|
2042
|
+
};
|
|
2043
|
+
}
|
|
2044
|
+
case $.UnregisterDroppable: {
|
|
2045
|
+
const {
|
|
2046
|
+
id: n,
|
|
2047
|
+
key: r
|
|
2048
|
+
} = t, o = e.droppable.containers.get(n);
|
|
2049
|
+
if (!o || r !== o.key)
|
|
2050
|
+
return e;
|
|
2051
|
+
const i = new Ue(e.droppable.containers);
|
|
2052
|
+
return i.delete(n), {
|
|
2053
|
+
...e,
|
|
2054
|
+
droppable: {
|
|
2055
|
+
...e.droppable,
|
|
2056
|
+
containers: i
|
|
2057
|
+
}
|
|
2058
|
+
};
|
|
2059
|
+
}
|
|
2060
|
+
default:
|
|
2061
|
+
return e;
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
function yo(e) {
|
|
2065
|
+
let {
|
|
2066
|
+
disabled: t
|
|
2067
|
+
} = e;
|
|
2068
|
+
const {
|
|
2069
|
+
active: n,
|
|
2070
|
+
activatorEvent: r,
|
|
2071
|
+
draggableNodes: o
|
|
2072
|
+
} = Ie(ht), i = mt(r), s = mt(n == null ? void 0 : n.id);
|
|
2073
|
+
return M(() => {
|
|
2074
|
+
if (!t && !r && i && s != null) {
|
|
2075
|
+
if (!Tt(i) || document.activeElement === i.target)
|
|
2076
|
+
return;
|
|
2077
|
+
const a = o.get(s);
|
|
2078
|
+
if (!a)
|
|
2079
|
+
return;
|
|
2080
|
+
const {
|
|
2081
|
+
activatorNode: l,
|
|
2082
|
+
node: u
|
|
2083
|
+
} = a;
|
|
2084
|
+
if (!l.current && !u.current)
|
|
2085
|
+
return;
|
|
2086
|
+
requestAnimationFrame(() => {
|
|
2087
|
+
for (const c of [l.current, u.current]) {
|
|
2088
|
+
if (!c)
|
|
2089
|
+
continue;
|
|
2090
|
+
const d = ar(c);
|
|
2091
|
+
if (d) {
|
|
2092
|
+
d.focus();
|
|
2093
|
+
break;
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
});
|
|
2097
|
+
}
|
|
2098
|
+
}, [r, t, o, s, i]), null;
|
|
2099
|
+
}
|
|
2100
|
+
function xo(e, t) {
|
|
2101
|
+
let {
|
|
2102
|
+
transform: n,
|
|
2103
|
+
...r
|
|
2104
|
+
} = t;
|
|
2105
|
+
return e != null && e.length ? e.reduce((o, i) => i({
|
|
2106
|
+
transform: o,
|
|
2107
|
+
...r
|
|
2108
|
+
}), n) : n;
|
|
2109
|
+
}
|
|
2110
|
+
function wo(e) {
|
|
2111
|
+
return O(
|
|
2112
|
+
() => ({
|
|
2113
|
+
draggable: {
|
|
2114
|
+
...st.draggable,
|
|
2115
|
+
...e == null ? void 0 : e.draggable
|
|
2116
|
+
},
|
|
2117
|
+
droppable: {
|
|
2118
|
+
...st.droppable,
|
|
2119
|
+
...e == null ? void 0 : e.droppable
|
|
2120
|
+
},
|
|
2121
|
+
dragOverlay: {
|
|
2122
|
+
...st.dragOverlay,
|
|
2123
|
+
...e == null ? void 0 : e.dragOverlay
|
|
2124
|
+
}
|
|
2125
|
+
}),
|
|
2126
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2127
|
+
[e == null ? void 0 : e.draggable, e == null ? void 0 : e.droppable, e == null ? void 0 : e.dragOverlay]
|
|
2128
|
+
);
|
|
2129
|
+
}
|
|
2130
|
+
function mo(e) {
|
|
2131
|
+
let {
|
|
2132
|
+
activeNode: t,
|
|
2133
|
+
measure: n,
|
|
2134
|
+
initialRect: r,
|
|
2135
|
+
config: o = !0
|
|
2136
|
+
} = e;
|
|
2137
|
+
const i = L(!1), {
|
|
2138
|
+
x: s,
|
|
2139
|
+
y: a
|
|
2140
|
+
} = typeof o == "boolean" ? {
|
|
2141
|
+
x: o,
|
|
2142
|
+
y: o
|
|
2143
|
+
} : o;
|
|
2144
|
+
fe(() => {
|
|
2145
|
+
if (!s && !a || !t) {
|
|
2146
|
+
i.current = !1;
|
|
2147
|
+
return;
|
|
2148
|
+
}
|
|
2149
|
+
if (i.current || !r)
|
|
2150
|
+
return;
|
|
2151
|
+
const u = t == null ? void 0 : t.node.current;
|
|
2152
|
+
if (!u || u.isConnected === !1)
|
|
2153
|
+
return;
|
|
2154
|
+
const c = n(u), d = gn(c, r);
|
|
2155
|
+
if (s || (d.x = 0), a || (d.y = 0), i.current = !0, Math.abs(d.x) > 0 || Math.abs(d.y) > 0) {
|
|
2156
|
+
const f = bn(u);
|
|
2157
|
+
f && f.scrollBy({
|
|
2158
|
+
top: d.y,
|
|
2159
|
+
left: d.x
|
|
2160
|
+
});
|
|
2161
|
+
}
|
|
2162
|
+
}, [t, s, a, r, n]);
|
|
2163
|
+
}
|
|
2164
|
+
const Rn = /* @__PURE__ */ Je({
|
|
2165
|
+
...ie,
|
|
2166
|
+
scaleX: 1,
|
|
2167
|
+
scaleY: 1
|
|
2168
|
+
});
|
|
2169
|
+
var De;
|
|
2170
|
+
(function(e) {
|
|
2171
|
+
e[e.Uninitialized = 0] = "Uninitialized", e[e.Initializing = 1] = "Initializing", e[e.Initialized = 2] = "Initialized";
|
|
2172
|
+
})(De || (De = {}));
|
|
2173
|
+
const So = /* @__PURE__ */ Fn(function(t) {
|
|
2174
|
+
var n, r, o, i;
|
|
2175
|
+
let {
|
|
2176
|
+
id: s,
|
|
2177
|
+
accessibility: a,
|
|
2178
|
+
autoScroll: l = !0,
|
|
2179
|
+
children: u,
|
|
2180
|
+
sensors: c = fo,
|
|
2181
|
+
collisionDetection: d = Cr,
|
|
2182
|
+
measuring: f,
|
|
2183
|
+
modifiers: h,
|
|
2184
|
+
...v
|
|
2185
|
+
} = t;
|
|
2186
|
+
const g = Hn(po, void 0, vo), [b, x] = g, [p, y] = hr(), [R, S] = Q(De.Uninitialized), I = R === De.Initialized, {
|
|
2187
|
+
draggable: {
|
|
2188
|
+
active: m,
|
|
2189
|
+
nodes: w,
|
|
2190
|
+
translate: D
|
|
2191
|
+
},
|
|
2192
|
+
droppable: {
|
|
2193
|
+
containers: N
|
|
2194
|
+
}
|
|
2195
|
+
} = b, C = m != null ? w.get(m) : null, P = L({
|
|
2196
|
+
initial: null,
|
|
2197
|
+
translated: null
|
|
2198
|
+
}), j = O(() => {
|
|
2199
|
+
var Y;
|
|
2200
|
+
return m != null ? {
|
|
2201
|
+
id: m,
|
|
2202
|
+
// It's possible for the active node to unmount while dragging
|
|
2203
|
+
data: (Y = C == null ? void 0 : C.data) != null ? Y : ho,
|
|
2204
|
+
rect: P
|
|
2205
|
+
} : null;
|
|
2206
|
+
}, [m, C]), T = L(null), [G, U] = Q(null), [k, se] = Q(null), B = Ve(v, Object.values(v)), ae = Qe("DndDescribedBy", s), le = O(() => N.getEnabled(), [N]), X = wo(f), {
|
|
2207
|
+
droppableRects: he,
|
|
2208
|
+
measureDroppableContainers: Re,
|
|
2209
|
+
measuringScheduled: Be
|
|
2210
|
+
} = Qr(le, {
|
|
2211
|
+
dragging: I,
|
|
2212
|
+
dependencies: [D.x, D.y],
|
|
2213
|
+
config: X.droppable
|
|
2214
|
+
}), ee = _r(w, m), et = O(() => k ? St(k) : null, [k]), pe = Bn(), ge = eo(ee, X.draggable.measure);
|
|
2215
|
+
mo({
|
|
2216
|
+
activeNode: m != null ? w.get(m) : null,
|
|
2217
|
+
config: pe.layoutShiftCompensation,
|
|
2218
|
+
initialRect: ge,
|
|
2219
|
+
measure: X.draggable.measure
|
|
2220
|
+
});
|
|
2221
|
+
const A = Zt(ee, X.draggable.measure, ge), $e = Zt(ee ? ee.parentElement : null), ce = L({
|
|
2222
|
+
activatorEvent: null,
|
|
2223
|
+
active: null,
|
|
2224
|
+
activeNode: ee,
|
|
2225
|
+
collisionRect: null,
|
|
2226
|
+
collisions: null,
|
|
2227
|
+
droppableRects: he,
|
|
2228
|
+
draggableNodes: w,
|
|
2229
|
+
draggingNode: null,
|
|
2230
|
+
draggingNodeRect: null,
|
|
2231
|
+
droppableContainers: N,
|
|
2232
|
+
over: null,
|
|
2233
|
+
scrollableAncestors: [],
|
|
2234
|
+
scrollAdjustedTranslate: null
|
|
2235
|
+
}), Ee = N.getNodeFor((n = ce.current.over) == null ? void 0 : n.id), be = uo({
|
|
2236
|
+
measure: X.dragOverlay.measure
|
|
2237
|
+
}), ke = (r = be.nodeRef.current) != null ? r : ee, Te = I ? (o = be.rect) != null ? o : A : null, jt = !!(be.nodeRef.current && be.rect), Pt = ro(jt ? null : A), gt = Dn(ke ? q(ke) : null), ye = oo(I ? Ee ?? ee : null), tt = lo(ye), nt = xo(h, {
|
|
2238
|
+
transform: {
|
|
2239
|
+
x: D.x - Pt.x,
|
|
2240
|
+
y: D.y - Pt.y,
|
|
2241
|
+
scaleX: 1,
|
|
2242
|
+
scaleY: 1
|
|
2243
|
+
},
|
|
2244
|
+
activatorEvent: k,
|
|
2245
|
+
active: j,
|
|
2246
|
+
activeNodeRect: A,
|
|
2247
|
+
containerNodeRect: $e,
|
|
2248
|
+
draggingNodeRect: Te,
|
|
2249
|
+
over: ce.current.over,
|
|
2250
|
+
overlayNodeRect: be.rect,
|
|
2251
|
+
scrollableAncestors: ye,
|
|
2252
|
+
scrollableAncestorRects: tt,
|
|
2253
|
+
windowRect: gt
|
|
2254
|
+
}), Bt = et ? Le(et, D) : null, $t = io(ye), Nn = en($t), On = en($t, [A]), Ae = Le(nt, Nn), Ne = Te ? Er(Te, nt) : null, Fe = j && Ne ? d({
|
|
2255
|
+
active: j,
|
|
2256
|
+
collisionRect: Ne,
|
|
2257
|
+
droppableRects: he,
|
|
2258
|
+
droppableContainers: le,
|
|
2259
|
+
pointerCoordinates: Bt
|
|
2260
|
+
}) : null, Ft = mr(Fe, "id"), [xe, Ht] = Q(null), Mn = jt ? nt : Le(nt, On), Ln = Rr(Mn, (i = xe == null ? void 0 : xe.rect) != null ? i : null, A), bt = L(null), Wt = K(
|
|
2261
|
+
(Y, J) => {
|
|
2262
|
+
let {
|
|
2263
|
+
sensor: _,
|
|
2264
|
+
options: we
|
|
2265
|
+
} = J;
|
|
2266
|
+
if (T.current == null)
|
|
2267
|
+
return;
|
|
2268
|
+
const te = w.get(T.current);
|
|
2269
|
+
if (!te)
|
|
2270
|
+
return;
|
|
2271
|
+
const Z = Y.nativeEvent, ue = new _({
|
|
2272
|
+
active: T.current,
|
|
2273
|
+
activeNode: te,
|
|
2274
|
+
event: Z,
|
|
2275
|
+
options: we,
|
|
2276
|
+
// Sensors need to be instantiated with refs for arguments that change over time
|
|
2277
|
+
// otherwise they are frozen in time with the stale arguments
|
|
2278
|
+
context: ce,
|
|
2279
|
+
onAbort(H) {
|
|
2280
|
+
if (!w.get(H))
|
|
2281
|
+
return;
|
|
2282
|
+
const {
|
|
2283
|
+
onDragAbort: de
|
|
2284
|
+
} = B.current, ve = {
|
|
2285
|
+
id: H
|
|
2286
|
+
};
|
|
2287
|
+
de == null || de(ve), p({
|
|
2288
|
+
type: "onDragAbort",
|
|
2289
|
+
event: ve
|
|
2290
|
+
});
|
|
2291
|
+
},
|
|
2292
|
+
onPending(H, me, de, ve) {
|
|
2293
|
+
if (!w.get(H))
|
|
2294
|
+
return;
|
|
2295
|
+
const {
|
|
2296
|
+
onDragPending: We
|
|
2297
|
+
} = B.current, Se = {
|
|
2298
|
+
id: H,
|
|
2299
|
+
constraint: me,
|
|
2300
|
+
initialCoordinates: de,
|
|
2301
|
+
offset: ve
|
|
2302
|
+
};
|
|
2303
|
+
We == null || We(Se), p({
|
|
2304
|
+
type: "onDragPending",
|
|
2305
|
+
event: Se
|
|
2306
|
+
});
|
|
2307
|
+
},
|
|
2308
|
+
onStart(H) {
|
|
2309
|
+
const me = T.current;
|
|
2310
|
+
if (me == null)
|
|
2311
|
+
return;
|
|
2312
|
+
const de = w.get(me);
|
|
2313
|
+
if (!de)
|
|
2314
|
+
return;
|
|
2315
|
+
const {
|
|
2316
|
+
onDragStart: ve
|
|
2317
|
+
} = B.current, He = {
|
|
2318
|
+
activatorEvent: Z,
|
|
2319
|
+
active: {
|
|
2320
|
+
id: me,
|
|
2321
|
+
data: de.data,
|
|
2322
|
+
rect: P
|
|
2323
|
+
}
|
|
2324
|
+
};
|
|
2325
|
+
rt(() => {
|
|
2326
|
+
ve == null || ve(He), S(De.Initializing), x({
|
|
2327
|
+
type: $.DragStart,
|
|
2328
|
+
initialCoordinates: H,
|
|
2329
|
+
active: me
|
|
2330
|
+
}), p({
|
|
2331
|
+
type: "onDragStart",
|
|
2332
|
+
event: He
|
|
2333
|
+
}), U(bt.current), se(Z);
|
|
2334
|
+
});
|
|
2335
|
+
},
|
|
2336
|
+
onMove(H) {
|
|
2337
|
+
x({
|
|
2338
|
+
type: $.DragMove,
|
|
2339
|
+
coordinates: H
|
|
2340
|
+
});
|
|
2341
|
+
},
|
|
2342
|
+
onEnd: Oe($.DragEnd),
|
|
2343
|
+
onCancel: Oe($.DragCancel)
|
|
2344
|
+
});
|
|
2345
|
+
bt.current = ue;
|
|
2346
|
+
function Oe(H) {
|
|
2347
|
+
return async function() {
|
|
2348
|
+
const {
|
|
2349
|
+
active: de,
|
|
2350
|
+
collisions: ve,
|
|
2351
|
+
over: He,
|
|
2352
|
+
scrollAdjustedTranslate: We
|
|
2353
|
+
} = ce.current;
|
|
2354
|
+
let Se = null;
|
|
2355
|
+
if (de && We) {
|
|
2356
|
+
const {
|
|
2357
|
+
cancelDrop: Xe
|
|
2358
|
+
} = B.current;
|
|
2359
|
+
Se = {
|
|
2360
|
+
activatorEvent: Z,
|
|
2361
|
+
active: de,
|
|
2362
|
+
collisions: ve,
|
|
2363
|
+
delta: We,
|
|
2364
|
+
over: He
|
|
2365
|
+
}, H === $.DragEnd && typeof Xe == "function" && await Promise.resolve(Xe(Se)) && (H = $.DragCancel);
|
|
2366
|
+
}
|
|
2367
|
+
T.current = null, rt(() => {
|
|
2368
|
+
x({
|
|
2369
|
+
type: H
|
|
2370
|
+
}), S(De.Uninitialized), Ht(null), U(null), se(null), bt.current = null;
|
|
2371
|
+
const Xe = H === $.DragEnd ? "onDragEnd" : "onDragCancel";
|
|
2372
|
+
if (Se) {
|
|
2373
|
+
const vt = B.current[Xe];
|
|
2374
|
+
vt == null || vt(Se), p({
|
|
2375
|
+
type: Xe,
|
|
2376
|
+
event: Se
|
|
2377
|
+
});
|
|
2378
|
+
}
|
|
2379
|
+
});
|
|
2380
|
+
};
|
|
2381
|
+
}
|
|
2382
|
+
},
|
|
2383
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2384
|
+
[w]
|
|
2385
|
+
), zn = K((Y, J) => (_, we) => {
|
|
2386
|
+
const te = _.nativeEvent, Z = w.get(we);
|
|
2387
|
+
if (
|
|
2388
|
+
// Another sensor is already instantiating
|
|
2389
|
+
T.current !== null || // No active draggable
|
|
2390
|
+
!Z || // Event has already been captured
|
|
2391
|
+
te.dndKit || te.defaultPrevented
|
|
2392
|
+
)
|
|
2393
|
+
return;
|
|
2394
|
+
const ue = {
|
|
2395
|
+
active: Z
|
|
2396
|
+
};
|
|
2397
|
+
Y(_, J.options, ue) === !0 && (te.dndKit = {
|
|
2398
|
+
capturedBy: J.sensor
|
|
2399
|
+
}, T.current = we, Wt(_, J));
|
|
2400
|
+
}, [w, Wt]), Xt = Zr(c, zn);
|
|
2401
|
+
so(c), fe(() => {
|
|
2402
|
+
A && R === De.Initializing && S(De.Initialized);
|
|
2403
|
+
}, [A, R]), M(
|
|
2404
|
+
() => {
|
|
2405
|
+
const {
|
|
2406
|
+
onDragMove: Y
|
|
2407
|
+
} = B.current, {
|
|
2408
|
+
active: J,
|
|
2409
|
+
activatorEvent: _,
|
|
2410
|
+
collisions: we,
|
|
2411
|
+
over: te
|
|
2412
|
+
} = ce.current;
|
|
2413
|
+
if (!J || !_)
|
|
2414
|
+
return;
|
|
2415
|
+
const Z = {
|
|
2416
|
+
active: J,
|
|
2417
|
+
activatorEvent: _,
|
|
2418
|
+
collisions: we,
|
|
2419
|
+
delta: {
|
|
2420
|
+
x: Ae.x,
|
|
2421
|
+
y: Ae.y
|
|
2422
|
+
},
|
|
2423
|
+
over: te
|
|
2424
|
+
};
|
|
2425
|
+
rt(() => {
|
|
2426
|
+
Y == null || Y(Z), p({
|
|
2427
|
+
type: "onDragMove",
|
|
2428
|
+
event: Z
|
|
2429
|
+
});
|
|
2430
|
+
});
|
|
2431
|
+
},
|
|
2432
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2433
|
+
[Ae.x, Ae.y]
|
|
2434
|
+
), M(
|
|
2435
|
+
() => {
|
|
2436
|
+
const {
|
|
2437
|
+
active: Y,
|
|
2438
|
+
activatorEvent: J,
|
|
2439
|
+
collisions: _,
|
|
2440
|
+
droppableContainers: we,
|
|
2441
|
+
scrollAdjustedTranslate: te
|
|
2442
|
+
} = ce.current;
|
|
2443
|
+
if (!Y || T.current == null || !J || !te)
|
|
2444
|
+
return;
|
|
2445
|
+
const {
|
|
2446
|
+
onDragOver: Z
|
|
2447
|
+
} = B.current, ue = we.get(Ft), Oe = ue && ue.rect.current ? {
|
|
2448
|
+
id: ue.id,
|
|
2449
|
+
rect: ue.rect.current,
|
|
2450
|
+
data: ue.data,
|
|
2451
|
+
disabled: ue.disabled
|
|
2452
|
+
} : null, H = {
|
|
2453
|
+
active: Y,
|
|
2454
|
+
activatorEvent: J,
|
|
2455
|
+
collisions: _,
|
|
2456
|
+
delta: {
|
|
2457
|
+
x: te.x,
|
|
2458
|
+
y: te.y
|
|
2459
|
+
},
|
|
2460
|
+
over: Oe
|
|
2461
|
+
};
|
|
2462
|
+
rt(() => {
|
|
2463
|
+
Ht(Oe), Z == null || Z(H), p({
|
|
2464
|
+
type: "onDragOver",
|
|
2465
|
+
event: H
|
|
2466
|
+
});
|
|
2467
|
+
});
|
|
2468
|
+
},
|
|
2469
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2470
|
+
[Ft]
|
|
2471
|
+
), fe(() => {
|
|
2472
|
+
ce.current = {
|
|
2473
|
+
activatorEvent: k,
|
|
2474
|
+
active: j,
|
|
2475
|
+
activeNode: ee,
|
|
2476
|
+
collisionRect: Ne,
|
|
2477
|
+
collisions: Fe,
|
|
2478
|
+
droppableRects: he,
|
|
2479
|
+
draggableNodes: w,
|
|
2480
|
+
draggingNode: ke,
|
|
2481
|
+
draggingNodeRect: Te,
|
|
2482
|
+
droppableContainers: N,
|
|
2483
|
+
over: xe,
|
|
2484
|
+
scrollableAncestors: ye,
|
|
2485
|
+
scrollAdjustedTranslate: Ae
|
|
2486
|
+
}, P.current = {
|
|
2487
|
+
initial: Te,
|
|
2488
|
+
translated: Ne
|
|
2489
|
+
};
|
|
2490
|
+
}, [j, ee, Fe, Ne, w, ke, Te, he, N, xe, ye, Ae]), qr({
|
|
2491
|
+
...pe,
|
|
2492
|
+
delta: D,
|
|
2493
|
+
draggingRect: Ne,
|
|
2494
|
+
pointerCoordinates: Bt,
|
|
2495
|
+
scrollableAncestors: ye,
|
|
2496
|
+
scrollableAncestorRects: tt
|
|
2497
|
+
});
|
|
2498
|
+
const jn = O(() => ({
|
|
2499
|
+
active: j,
|
|
2500
|
+
activeNode: ee,
|
|
2501
|
+
activeNodeRect: A,
|
|
2502
|
+
activatorEvent: k,
|
|
2503
|
+
collisions: Fe,
|
|
2504
|
+
containerNodeRect: $e,
|
|
2505
|
+
dragOverlay: be,
|
|
2506
|
+
draggableNodes: w,
|
|
2507
|
+
droppableContainers: N,
|
|
2508
|
+
droppableRects: he,
|
|
2509
|
+
over: xe,
|
|
2510
|
+
measureDroppableContainers: Re,
|
|
2511
|
+
scrollableAncestors: ye,
|
|
2512
|
+
scrollableAncestorRects: tt,
|
|
2513
|
+
measuringConfiguration: X,
|
|
2514
|
+
measuringScheduled: Be,
|
|
2515
|
+
windowRect: gt
|
|
2516
|
+
}), [j, ee, A, k, Fe, $e, be, w, N, he, xe, Re, ye, tt, X, Be, gt]), Pn = O(() => ({
|
|
2517
|
+
activatorEvent: k,
|
|
2518
|
+
activators: Xt,
|
|
2519
|
+
active: j,
|
|
2520
|
+
activeNodeRect: A,
|
|
2521
|
+
ariaDescribedById: {
|
|
2522
|
+
draggable: ae
|
|
2523
|
+
},
|
|
2524
|
+
dispatch: x,
|
|
2525
|
+
draggableNodes: w,
|
|
2526
|
+
over: xe,
|
|
2527
|
+
measureDroppableContainers: Re
|
|
2528
|
+
}), [k, Xt, j, A, x, ae, w, xe, Re]);
|
|
2529
|
+
return V.createElement(hn.Provider, {
|
|
2530
|
+
value: y
|
|
2531
|
+
}, V.createElement(ht.Provider, {
|
|
2532
|
+
value: Pn
|
|
2533
|
+
}, V.createElement(Cn.Provider, {
|
|
2534
|
+
value: jn
|
|
2535
|
+
}, V.createElement(Rn.Provider, {
|
|
2536
|
+
value: Ln
|
|
2537
|
+
}, u)), V.createElement(yo, {
|
|
2538
|
+
disabled: (a == null ? void 0 : a.restoreFocus) === !1
|
|
2539
|
+
})), V.createElement(vr, {
|
|
2540
|
+
...a,
|
|
2541
|
+
hiddenTextDescribedById: ae
|
|
2542
|
+
}));
|
|
2543
|
+
function Bn() {
|
|
2544
|
+
const Y = (G == null ? void 0 : G.autoScrollEnabled) === !1, J = typeof l == "object" ? l.enabled === !1 : l === !1, _ = I && !Y && !J;
|
|
2545
|
+
return typeof l == "object" ? {
|
|
2546
|
+
...l,
|
|
2547
|
+
enabled: _
|
|
2548
|
+
} : {
|
|
2549
|
+
enabled: _
|
|
2550
|
+
};
|
|
2551
|
+
}
|
|
2552
|
+
}), Do = /* @__PURE__ */ Je(null), nn = "button", Co = "Draggable";
|
|
2553
|
+
function Ro(e) {
|
|
2554
|
+
let {
|
|
2555
|
+
id: t,
|
|
2556
|
+
data: n,
|
|
2557
|
+
disabled: r = !1,
|
|
2558
|
+
attributes: o
|
|
2559
|
+
} = e;
|
|
2560
|
+
const i = Qe(Co), {
|
|
2561
|
+
activators: s,
|
|
2562
|
+
activatorEvent: a,
|
|
2563
|
+
active: l,
|
|
2564
|
+
activeNodeRect: u,
|
|
2565
|
+
ariaDescribedById: c,
|
|
2566
|
+
draggableNodes: d,
|
|
2567
|
+
over: f
|
|
2568
|
+
} = Ie(ht), {
|
|
2569
|
+
role: h = nn,
|
|
2570
|
+
roleDescription: v = "draggable",
|
|
2571
|
+
tabIndex: g = 0
|
|
2572
|
+
} = o ?? {}, b = (l == null ? void 0 : l.id) === t, x = Ie(b ? Rn : Do), [p, y] = at(), [R, S] = at(), I = ao(s, t), m = Ve(n);
|
|
2573
|
+
fe(
|
|
2574
|
+
() => (d.set(t, {
|
|
2575
|
+
id: t,
|
|
2576
|
+
key: i,
|
|
2577
|
+
node: p,
|
|
2578
|
+
activatorNode: R,
|
|
2579
|
+
data: m
|
|
2580
|
+
}), () => {
|
|
2581
|
+
const D = d.get(t);
|
|
2582
|
+
D && D.key === i && d.delete(t);
|
|
2583
|
+
}),
|
|
2584
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2585
|
+
[d, t]
|
|
2586
|
+
);
|
|
2587
|
+
const w = O(() => ({
|
|
2588
|
+
role: h,
|
|
2589
|
+
tabIndex: g,
|
|
2590
|
+
"aria-disabled": r,
|
|
2591
|
+
"aria-pressed": b && h === nn ? !0 : void 0,
|
|
2592
|
+
"aria-roledescription": v,
|
|
2593
|
+
"aria-describedby": c.draggable
|
|
2594
|
+
}), [r, h, g, b, v, c.draggable]);
|
|
2595
|
+
return {
|
|
2596
|
+
active: l,
|
|
2597
|
+
activatorEvent: a,
|
|
2598
|
+
activeNodeRect: u,
|
|
2599
|
+
attributes: w,
|
|
2600
|
+
isDragging: b,
|
|
2601
|
+
listeners: r ? void 0 : I,
|
|
2602
|
+
node: p,
|
|
2603
|
+
over: f,
|
|
2604
|
+
setNodeRef: y,
|
|
2605
|
+
setActivatorNodeRef: S,
|
|
2606
|
+
transform: x
|
|
2607
|
+
};
|
|
2608
|
+
}
|
|
2609
|
+
function Io() {
|
|
2610
|
+
return Ie(Cn);
|
|
2611
|
+
}
|
|
2612
|
+
const Eo = "Droppable", ko = {
|
|
2613
|
+
timeout: 25
|
|
2614
|
+
};
|
|
2615
|
+
function To(e) {
|
|
2616
|
+
let {
|
|
2617
|
+
data: t,
|
|
2618
|
+
disabled: n = !1,
|
|
2619
|
+
id: r,
|
|
2620
|
+
resizeObserverConfig: o
|
|
2621
|
+
} = e;
|
|
2622
|
+
const i = Qe(Eo), {
|
|
2623
|
+
active: s,
|
|
2624
|
+
dispatch: a,
|
|
2625
|
+
over: l,
|
|
2626
|
+
measureDroppableContainers: u
|
|
2627
|
+
} = Ie(ht), c = L({
|
|
2628
|
+
disabled: n
|
|
2629
|
+
}), d = L(!1), f = L(null), h = L(null), {
|
|
2630
|
+
disabled: v,
|
|
2631
|
+
updateMeasurementsFor: g,
|
|
2632
|
+
timeout: b
|
|
2633
|
+
} = {
|
|
2634
|
+
...ko,
|
|
2635
|
+
...o
|
|
2636
|
+
}, x = Ve(g ?? r), p = K(
|
|
2637
|
+
() => {
|
|
2638
|
+
if (!d.current) {
|
|
2639
|
+
d.current = !0;
|
|
2640
|
+
return;
|
|
2641
|
+
}
|
|
2642
|
+
h.current != null && clearTimeout(h.current), h.current = setTimeout(() => {
|
|
2643
|
+
u(Array.isArray(x.current) ? x.current : [x.current]), h.current = null;
|
|
2644
|
+
}, b);
|
|
2645
|
+
},
|
|
2646
|
+
//eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2647
|
+
[b]
|
|
2648
|
+
), y = ft({
|
|
2649
|
+
callback: p,
|
|
2650
|
+
disabled: v || !s
|
|
2651
|
+
}), R = K((w, D) => {
|
|
2652
|
+
y && (D && (y.unobserve(D), d.current = !1), w && y.observe(w));
|
|
2653
|
+
}, [y]), [S, I] = at(R), m = Ve(t);
|
|
2654
|
+
return M(() => {
|
|
2655
|
+
!y || !S.current || (y.disconnect(), d.current = !1, y.observe(S.current));
|
|
2656
|
+
}, [S, y]), M(
|
|
2657
|
+
() => (a({
|
|
2658
|
+
type: $.RegisterDroppable,
|
|
2659
|
+
element: {
|
|
2660
|
+
id: r,
|
|
2661
|
+
key: i,
|
|
2662
|
+
disabled: n,
|
|
2663
|
+
node: S,
|
|
2664
|
+
rect: f,
|
|
2665
|
+
data: m
|
|
2666
|
+
}
|
|
2667
|
+
}), () => a({
|
|
2668
|
+
type: $.UnregisterDroppable,
|
|
2669
|
+
key: i,
|
|
2670
|
+
id: r
|
|
2671
|
+
})),
|
|
2672
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2673
|
+
[r]
|
|
2674
|
+
), M(() => {
|
|
2675
|
+
n !== c.current.disabled && (a({
|
|
2676
|
+
type: $.SetDroppableDisabled,
|
|
2677
|
+
id: r,
|
|
2678
|
+
key: i,
|
|
2679
|
+
disabled: n
|
|
2680
|
+
}), c.current.disabled = n);
|
|
2681
|
+
}, [r, i, n, a]), {
|
|
2682
|
+
active: s,
|
|
2683
|
+
rect: f,
|
|
2684
|
+
isOver: (l == null ? void 0 : l.id) === r,
|
|
2685
|
+
node: S,
|
|
2686
|
+
over: l,
|
|
2687
|
+
setNodeRef: I
|
|
2688
|
+
};
|
|
2689
|
+
}
|
|
2690
|
+
function zt(e, t, n) {
|
|
2691
|
+
const r = e.slice();
|
|
2692
|
+
return r.splice(n < 0 ? r.length + n : n, 0, r.splice(t, 1)[0]), r;
|
|
2693
|
+
}
|
|
2694
|
+
function Ao(e, t) {
|
|
2695
|
+
return e.reduce((n, r, o) => {
|
|
2696
|
+
const i = t.get(r);
|
|
2697
|
+
return i && (n[o] = i), n;
|
|
2698
|
+
}, Array(e.length));
|
|
2699
|
+
}
|
|
2700
|
+
function ot(e) {
|
|
2701
|
+
return e !== null && e >= 0;
|
|
2702
|
+
}
|
|
2703
|
+
function No(e, t) {
|
|
2704
|
+
if (e === t)
|
|
2705
|
+
return !0;
|
|
2706
|
+
if (e.length !== t.length)
|
|
2707
|
+
return !1;
|
|
2708
|
+
for (let n = 0; n < e.length; n++)
|
|
2709
|
+
if (e[n] !== t[n])
|
|
2710
|
+
return !1;
|
|
2711
|
+
return !0;
|
|
2712
|
+
}
|
|
2713
|
+
function Oo(e) {
|
|
2714
|
+
return typeof e == "boolean" ? {
|
|
2715
|
+
draggable: e,
|
|
2716
|
+
droppable: e
|
|
2717
|
+
} : e;
|
|
2718
|
+
}
|
|
2719
|
+
const it = {
|
|
2720
|
+
scaleX: 1,
|
|
2721
|
+
scaleY: 1
|
|
2722
|
+
}, Mo = (e) => {
|
|
2723
|
+
var t;
|
|
2724
|
+
let {
|
|
2725
|
+
rects: n,
|
|
2726
|
+
activeNodeRect: r,
|
|
2727
|
+
activeIndex: o,
|
|
2728
|
+
overIndex: i,
|
|
2729
|
+
index: s
|
|
2730
|
+
} = e;
|
|
2731
|
+
const a = (t = n[o]) != null ? t : r;
|
|
2732
|
+
if (!a)
|
|
2733
|
+
return null;
|
|
2734
|
+
const l = Lo(n, s, o);
|
|
2735
|
+
if (s === o) {
|
|
2736
|
+
const u = n[i];
|
|
2737
|
+
return u ? {
|
|
2738
|
+
x: o < i ? u.left + u.width - (a.left + a.width) : u.left - a.left,
|
|
2739
|
+
y: 0,
|
|
2740
|
+
...it
|
|
2741
|
+
} : null;
|
|
2742
|
+
}
|
|
2743
|
+
return s > o && s <= i ? {
|
|
2744
|
+
x: -a.width - l,
|
|
2745
|
+
y: 0,
|
|
2746
|
+
...it
|
|
2747
|
+
} : s < o && s >= i ? {
|
|
2748
|
+
x: a.width + l,
|
|
2749
|
+
y: 0,
|
|
2750
|
+
...it
|
|
2751
|
+
} : {
|
|
2752
|
+
x: 0,
|
|
2753
|
+
y: 0,
|
|
2754
|
+
...it
|
|
2755
|
+
};
|
|
2756
|
+
};
|
|
2757
|
+
function Lo(e, t, n) {
|
|
2758
|
+
const r = e[t], o = e[t - 1], i = e[t + 1];
|
|
2759
|
+
return !r || !o && !i ? 0 : n < t ? o ? r.left - (o.left + o.width) : i.left - (r.left + r.width) : i ? i.left - (r.left + r.width) : r.left - (o.left + o.width);
|
|
2760
|
+
}
|
|
2761
|
+
const In = (e) => {
|
|
2762
|
+
let {
|
|
2763
|
+
rects: t,
|
|
2764
|
+
activeIndex: n,
|
|
2765
|
+
overIndex: r,
|
|
2766
|
+
index: o
|
|
2767
|
+
} = e;
|
|
2768
|
+
const i = zt(t, r, n), s = t[o], a = i[o];
|
|
2769
|
+
return !a || !s ? null : {
|
|
2770
|
+
x: a.left - s.left,
|
|
2771
|
+
y: a.top - s.top,
|
|
2772
|
+
scaleX: a.width / s.width,
|
|
2773
|
+
scaleY: a.height / s.height
|
|
2774
|
+
};
|
|
2775
|
+
}, En = "Sortable", kn = /* @__PURE__ */ V.createContext({
|
|
2776
|
+
activeIndex: -1,
|
|
2777
|
+
containerId: En,
|
|
2778
|
+
disableTransforms: !1,
|
|
2779
|
+
items: [],
|
|
2780
|
+
overIndex: -1,
|
|
2781
|
+
useDragOverlay: !1,
|
|
2782
|
+
sortedRects: [],
|
|
2783
|
+
strategy: In,
|
|
2784
|
+
disabled: {
|
|
2785
|
+
draggable: !1,
|
|
2786
|
+
droppable: !1
|
|
2787
|
+
}
|
|
2788
|
+
});
|
|
2789
|
+
function zo(e) {
|
|
2790
|
+
let {
|
|
2791
|
+
children: t,
|
|
2792
|
+
id: n,
|
|
2793
|
+
items: r,
|
|
2794
|
+
strategy: o = In,
|
|
2795
|
+
disabled: i = !1
|
|
2796
|
+
} = e;
|
|
2797
|
+
const {
|
|
2798
|
+
active: s,
|
|
2799
|
+
dragOverlay: a,
|
|
2800
|
+
droppableRects: l,
|
|
2801
|
+
over: u,
|
|
2802
|
+
measureDroppableContainers: c
|
|
2803
|
+
} = Io(), d = Qe(En, n), f = a.rect !== null, h = O(() => r.map((I) => typeof I == "object" && "id" in I ? I.id : I), [r]), v = s != null, g = s ? h.indexOf(s.id) : -1, b = u ? h.indexOf(u.id) : -1, x = L(h), p = !No(h, x.current), y = b !== -1 && g === -1 || p, R = Oo(i);
|
|
2804
|
+
fe(() => {
|
|
2805
|
+
p && v && c(h);
|
|
2806
|
+
}, [p, h, v, c]), M(() => {
|
|
2807
|
+
x.current = h;
|
|
2808
|
+
}, [h]);
|
|
2809
|
+
const S = O(
|
|
2810
|
+
() => ({
|
|
2811
|
+
activeIndex: g,
|
|
2812
|
+
containerId: d,
|
|
2813
|
+
disabled: R,
|
|
2814
|
+
disableTransforms: y,
|
|
2815
|
+
items: h,
|
|
2816
|
+
overIndex: b,
|
|
2817
|
+
useDragOverlay: f,
|
|
2818
|
+
sortedRects: Ao(h, l),
|
|
2819
|
+
strategy: o
|
|
2820
|
+
}),
|
|
2821
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2822
|
+
[g, d, R.draggable, R.droppable, y, h, b, l, f, o]
|
|
2823
|
+
);
|
|
2824
|
+
return V.createElement(kn.Provider, {
|
|
2825
|
+
value: S
|
|
2826
|
+
}, t);
|
|
2827
|
+
}
|
|
2828
|
+
const jo = (e) => {
|
|
2829
|
+
let {
|
|
2830
|
+
id: t,
|
|
2831
|
+
items: n,
|
|
2832
|
+
activeIndex: r,
|
|
2833
|
+
overIndex: o
|
|
2834
|
+
} = e;
|
|
2835
|
+
return zt(n, r, o).indexOf(t);
|
|
2836
|
+
}, Tn = (e) => {
|
|
2837
|
+
let {
|
|
2838
|
+
containerId: t,
|
|
2839
|
+
isSorting: n,
|
|
2840
|
+
wasDragging: r,
|
|
2841
|
+
index: o,
|
|
2842
|
+
items: i,
|
|
2843
|
+
newIndex: s,
|
|
2844
|
+
previousItems: a,
|
|
2845
|
+
previousContainerId: l,
|
|
2846
|
+
transition: u
|
|
2847
|
+
} = e;
|
|
2848
|
+
return !u || !r || a !== i && o === s ? !1 : n ? !0 : s !== o && t === l;
|
|
2849
|
+
}, Po = {
|
|
2850
|
+
duration: 200,
|
|
2851
|
+
easing: "ease"
|
|
2852
|
+
}, An = "transform", Bo = /* @__PURE__ */ qe.Transition.toString({
|
|
2853
|
+
property: An,
|
|
2854
|
+
duration: 0,
|
|
2855
|
+
easing: "linear"
|
|
2856
|
+
}), $o = {
|
|
2857
|
+
roleDescription: "sortable"
|
|
2858
|
+
};
|
|
2859
|
+
function Fo(e) {
|
|
2860
|
+
let {
|
|
2861
|
+
disabled: t,
|
|
2862
|
+
index: n,
|
|
2863
|
+
node: r,
|
|
2864
|
+
rect: o
|
|
2865
|
+
} = e;
|
|
2866
|
+
const [i, s] = Q(null), a = L(n);
|
|
2867
|
+
return fe(() => {
|
|
2868
|
+
if (!t && n !== a.current && r.current) {
|
|
2869
|
+
const l = o.current;
|
|
2870
|
+
if (l) {
|
|
2871
|
+
const u = Pe(r.current, {
|
|
2872
|
+
ignoreTransform: !0
|
|
2873
|
+
}), c = {
|
|
2874
|
+
x: l.left - u.left,
|
|
2875
|
+
y: l.top - u.top,
|
|
2876
|
+
scaleX: l.width / u.width,
|
|
2877
|
+
scaleY: l.height / u.height
|
|
2878
|
+
};
|
|
2879
|
+
(c.x || c.y) && s(c);
|
|
2880
|
+
}
|
|
2881
|
+
}
|
|
2882
|
+
n !== a.current && (a.current = n);
|
|
2883
|
+
}, [t, n, r, o]), M(() => {
|
|
2884
|
+
i && s(null);
|
|
2885
|
+
}, [i]), i;
|
|
2886
|
+
}
|
|
2887
|
+
function Ho(e) {
|
|
2888
|
+
let {
|
|
2889
|
+
animateLayoutChanges: t = Tn,
|
|
2890
|
+
attributes: n,
|
|
2891
|
+
disabled: r,
|
|
2892
|
+
data: o,
|
|
2893
|
+
getNewIndex: i = jo,
|
|
2894
|
+
id: s,
|
|
2895
|
+
strategy: a,
|
|
2896
|
+
resizeObserverConfig: l,
|
|
2897
|
+
transition: u = Po
|
|
2898
|
+
} = e;
|
|
2899
|
+
const {
|
|
2900
|
+
items: c,
|
|
2901
|
+
containerId: d,
|
|
2902
|
+
activeIndex: f,
|
|
2903
|
+
disabled: h,
|
|
2904
|
+
disableTransforms: v,
|
|
2905
|
+
sortedRects: g,
|
|
2906
|
+
overIndex: b,
|
|
2907
|
+
useDragOverlay: x,
|
|
2908
|
+
strategy: p
|
|
2909
|
+
} = Ie(kn), y = Wo(r, h), R = c.indexOf(s), S = O(() => ({
|
|
2910
|
+
sortable: {
|
|
2911
|
+
containerId: d,
|
|
2912
|
+
index: R,
|
|
2913
|
+
items: c
|
|
2914
|
+
},
|
|
2915
|
+
...o
|
|
2916
|
+
}), [d, o, R, c]), I = O(() => c.slice(c.indexOf(s)), [c, s]), {
|
|
2917
|
+
rect: m,
|
|
2918
|
+
node: w,
|
|
2919
|
+
isOver: D,
|
|
2920
|
+
setNodeRef: N
|
|
2921
|
+
} = To({
|
|
2922
|
+
id: s,
|
|
2923
|
+
data: S,
|
|
2924
|
+
disabled: y.droppable,
|
|
2925
|
+
resizeObserverConfig: {
|
|
2926
|
+
updateMeasurementsFor: I,
|
|
2927
|
+
...l
|
|
2928
|
+
}
|
|
2929
|
+
}), {
|
|
2930
|
+
active: C,
|
|
2931
|
+
activatorEvent: P,
|
|
2932
|
+
activeNodeRect: j,
|
|
2933
|
+
attributes: T,
|
|
2934
|
+
setNodeRef: G,
|
|
2935
|
+
listeners: U,
|
|
2936
|
+
isDragging: k,
|
|
2937
|
+
over: se,
|
|
2938
|
+
setActivatorNodeRef: B,
|
|
2939
|
+
transform: ae
|
|
2940
|
+
} = Ro({
|
|
2941
|
+
id: s,
|
|
2942
|
+
data: S,
|
|
2943
|
+
attributes: {
|
|
2944
|
+
...$o,
|
|
2945
|
+
...n
|
|
2946
|
+
},
|
|
2947
|
+
disabled: y.draggable
|
|
2948
|
+
}), le = rr(N, G), X = !!C, he = X && !v && ot(f) && ot(b), Re = !x && k, Be = Re && he ? ae : null, et = he ? Be ?? (a ?? p)({
|
|
2949
|
+
rects: g,
|
|
2950
|
+
activeNodeRect: j,
|
|
2951
|
+
activeIndex: f,
|
|
2952
|
+
overIndex: b,
|
|
2953
|
+
index: R
|
|
2954
|
+
}) : null, pe = ot(f) && ot(b) ? i({
|
|
2955
|
+
id: s,
|
|
2956
|
+
items: c,
|
|
2957
|
+
activeIndex: f,
|
|
2958
|
+
overIndex: b
|
|
2959
|
+
}) : R, ge = C == null ? void 0 : C.id, A = L({
|
|
2960
|
+
activeId: ge,
|
|
2961
|
+
items: c,
|
|
2962
|
+
newIndex: pe,
|
|
2963
|
+
containerId: d
|
|
2964
|
+
}), $e = c !== A.current.items, ce = t({
|
|
2965
|
+
active: C,
|
|
2966
|
+
containerId: d,
|
|
2967
|
+
isDragging: k,
|
|
2968
|
+
isSorting: X,
|
|
2969
|
+
id: s,
|
|
2970
|
+
index: R,
|
|
2971
|
+
items: c,
|
|
2972
|
+
newIndex: A.current.newIndex,
|
|
2973
|
+
previousItems: A.current.items,
|
|
2974
|
+
previousContainerId: A.current.containerId,
|
|
2975
|
+
transition: u,
|
|
2976
|
+
wasDragging: A.current.activeId != null
|
|
2977
|
+
}), Ee = Fo({
|
|
2978
|
+
disabled: !ce,
|
|
2979
|
+
index: R,
|
|
2980
|
+
node: w,
|
|
2981
|
+
rect: m
|
|
2982
|
+
});
|
|
2983
|
+
return M(() => {
|
|
2984
|
+
X && A.current.newIndex !== pe && (A.current.newIndex = pe), d !== A.current.containerId && (A.current.containerId = d), c !== A.current.items && (A.current.items = c);
|
|
2985
|
+
}, [X, pe, d, c]), M(() => {
|
|
2986
|
+
if (ge === A.current.activeId)
|
|
2987
|
+
return;
|
|
2988
|
+
if (ge != null && A.current.activeId == null) {
|
|
2989
|
+
A.current.activeId = ge;
|
|
2990
|
+
return;
|
|
2991
|
+
}
|
|
2992
|
+
const ke = setTimeout(() => {
|
|
2993
|
+
A.current.activeId = ge;
|
|
2994
|
+
}, 50);
|
|
2995
|
+
return () => clearTimeout(ke);
|
|
2996
|
+
}, [ge]), {
|
|
2997
|
+
active: C,
|
|
2998
|
+
activeIndex: f,
|
|
2999
|
+
attributes: T,
|
|
3000
|
+
data: S,
|
|
3001
|
+
rect: m,
|
|
3002
|
+
index: R,
|
|
3003
|
+
newIndex: pe,
|
|
3004
|
+
items: c,
|
|
3005
|
+
isOver: D,
|
|
3006
|
+
isSorting: X,
|
|
3007
|
+
isDragging: k,
|
|
3008
|
+
listeners: U,
|
|
3009
|
+
node: w,
|
|
3010
|
+
overIndex: b,
|
|
3011
|
+
over: se,
|
|
3012
|
+
setNodeRef: le,
|
|
3013
|
+
setActivatorNodeRef: B,
|
|
3014
|
+
setDroppableNodeRef: N,
|
|
3015
|
+
setDraggableNodeRef: G,
|
|
3016
|
+
transform: Ee ?? et,
|
|
3017
|
+
transition: be()
|
|
3018
|
+
};
|
|
3019
|
+
function be() {
|
|
3020
|
+
if (
|
|
3021
|
+
// Temporarily disable transitions for a single frame to set up derived transforms
|
|
3022
|
+
Ee || // Or to prevent items jumping to back to their "new" position when items change
|
|
3023
|
+
$e && A.current.newIndex === R
|
|
3024
|
+
)
|
|
3025
|
+
return Bo;
|
|
3026
|
+
if (!(Re && !Tt(P) || !u) && (X || ce))
|
|
3027
|
+
return qe.Transition.toString({
|
|
3028
|
+
...u,
|
|
3029
|
+
property: An
|
|
3030
|
+
});
|
|
3031
|
+
}
|
|
3032
|
+
}
|
|
3033
|
+
function Wo(e, t) {
|
|
3034
|
+
var n, r;
|
|
3035
|
+
return typeof e == "boolean" ? {
|
|
3036
|
+
draggable: e,
|
|
3037
|
+
// Backwards compatibility
|
|
3038
|
+
droppable: !1
|
|
3039
|
+
} : {
|
|
3040
|
+
draggable: (n = e == null ? void 0 : e.draggable) != null ? n : t.draggable,
|
|
3041
|
+
droppable: (r = e == null ? void 0 : e.droppable) != null ? r : t.droppable
|
|
3042
|
+
};
|
|
3043
|
+
}
|
|
3044
|
+
E.Down, E.Right, E.Up, E.Left;
|
|
3045
|
+
const Xo = ({ className: e }) => /* @__PURE__ */ z.jsxs(
|
|
3046
|
+
"svg",
|
|
3047
|
+
{
|
|
3048
|
+
width: "16",
|
|
3049
|
+
height: "16",
|
|
3050
|
+
viewBox: "0 0 16 16",
|
|
3051
|
+
fill: "currentColor",
|
|
3052
|
+
className: e,
|
|
3053
|
+
style: { flexShrink: 0 },
|
|
3054
|
+
children: [
|
|
3055
|
+
/* @__PURE__ */ z.jsx("rect", { x: "4", y: "5", width: "8", height: "2", rx: "1" }),
|
|
3056
|
+
/* @__PURE__ */ z.jsx("rect", { x: "4", y: "9", width: "8", height: "2", rx: "1" })
|
|
3057
|
+
]
|
|
3058
|
+
}
|
|
3059
|
+
), Yo = ({
|
|
3060
|
+
column: e,
|
|
3061
|
+
index: t,
|
|
3062
|
+
columns: n,
|
|
3063
|
+
sortState: r,
|
|
3064
|
+
onSort: o,
|
|
3065
|
+
renderSortIcon: i,
|
|
3066
|
+
draggable: s = !1,
|
|
3067
|
+
dragHandleIcon: a,
|
|
3068
|
+
theme: l = "light"
|
|
3069
|
+
}) => {
|
|
3070
|
+
const u = Ce.useRef(null), [c, d] = Ce.useState(null), f = (D) => {
|
|
3071
|
+
const { isSorting: N, wasDragging: C } = D;
|
|
3072
|
+
return N || C ? Tn(D) : !0;
|
|
3073
|
+
}, {
|
|
3074
|
+
attributes: h,
|
|
3075
|
+
listeners: v,
|
|
3076
|
+
setNodeRef: g,
|
|
3077
|
+
transform: b,
|
|
3078
|
+
transition: x,
|
|
3079
|
+
isDragging: p
|
|
3080
|
+
} = Ho({
|
|
3081
|
+
id: e.key || `col-${t}`,
|
|
3082
|
+
disabled: !s || !!e.fixed,
|
|
3083
|
+
animateLayoutChanges: f,
|
|
3084
|
+
transition: {
|
|
3085
|
+
duration: 250,
|
|
3086
|
+
easing: "cubic-bezier(0.25, 1, 0.5, 1)"
|
|
3087
|
+
}
|
|
3088
|
+
}), y = Ce.useCallback(
|
|
3089
|
+
(D) => {
|
|
3090
|
+
u.current = D, g(D);
|
|
3091
|
+
},
|
|
3092
|
+
[g]
|
|
3093
|
+
);
|
|
3094
|
+
Ce.useEffect(() => {
|
|
3095
|
+
if (p && u.current) {
|
|
3096
|
+
const D = u.current.getBoundingClientRect().width;
|
|
3097
|
+
d(D);
|
|
3098
|
+
} else
|
|
3099
|
+
p || d(null);
|
|
3100
|
+
}, [p]);
|
|
3101
|
+
const R = () => {
|
|
3102
|
+
const D = p && c ? `${c}px` : e.width || "auto";
|
|
3103
|
+
let N = "auto";
|
|
3104
|
+
e.fixed ? N = p ? 1001 : 1e3 : p && (N = 100);
|
|
3105
|
+
const C = {
|
|
3106
|
+
transform: b ? qe.Translate.toString(b) : void 0,
|
|
3107
|
+
transition: x || "transform 250ms cubic-bezier(0.25, 1, 0.5, 1)",
|
|
3108
|
+
willChange: "transform",
|
|
3109
|
+
width: D,
|
|
3110
|
+
textAlign: oe.getTextAlign(e.align),
|
|
3111
|
+
opacity: p ? 0.5 : 1,
|
|
3112
|
+
// cursor 由 className 控制,不在 inline style 中设置
|
|
3113
|
+
zIndex: N,
|
|
3114
|
+
whiteSpace: "nowrap",
|
|
3115
|
+
overflow: "hidden",
|
|
3116
|
+
textOverflow: "ellipsis"
|
|
3117
|
+
};
|
|
3118
|
+
if (p && c && (C.minWidth = `${c}px`, C.maxWidth = `${c}px`), e.fixed === "left") {
|
|
3119
|
+
let P = 0;
|
|
3120
|
+
for (let j = 0; j < t; j++)
|
|
3121
|
+
n[j].fixed === "left" && (P += parseInt(n[j].width || "150"));
|
|
3122
|
+
C.left = `${P}px`;
|
|
3123
|
+
} else if (e.fixed === "right") {
|
|
3124
|
+
let P = 0;
|
|
3125
|
+
for (let j = t + 1; j < n.length; j++)
|
|
3126
|
+
n[j].fixed === "right" && (P += parseInt(n[j].width || "150"));
|
|
3127
|
+
C.right = `${P}px`;
|
|
3128
|
+
}
|
|
3129
|
+
return C;
|
|
3130
|
+
}, S = Me(
|
|
3131
|
+
"bu-group",
|
|
3132
|
+
oe.getThClasses({
|
|
3133
|
+
theme: l,
|
|
3134
|
+
fixed: e.fixed,
|
|
3135
|
+
sortable: e.filter,
|
|
3136
|
+
isDragging: p,
|
|
3137
|
+
draggable: s
|
|
3138
|
+
})
|
|
3139
|
+
), I = s && !e.fixed, m = e.filter && e.key, w = (D) => {
|
|
3140
|
+
m && (D.target.closest(".drag-handle-icon") || o(e));
|
|
3141
|
+
};
|
|
3142
|
+
return /* @__PURE__ */ z.jsx(
|
|
3143
|
+
"th",
|
|
3144
|
+
{
|
|
3145
|
+
ref: y,
|
|
3146
|
+
className: S,
|
|
3147
|
+
style: R(),
|
|
3148
|
+
...h,
|
|
3149
|
+
...v,
|
|
3150
|
+
onClick: w,
|
|
3151
|
+
children: /* @__PURE__ */ z.jsxs(
|
|
3152
|
+
"div",
|
|
3153
|
+
{
|
|
3154
|
+
className: "bu-relative bu-flex bu-items-center bu-gap-2",
|
|
3155
|
+
style: { justifyContent: e.align || "center" },
|
|
3156
|
+
children: [
|
|
3157
|
+
/* @__PURE__ */ z.jsxs("div", { className: "bu-flex bu-items-center", children: [
|
|
3158
|
+
e.renderHeader ? e.renderHeader([]) : e.title,
|
|
3159
|
+
i(e),
|
|
3160
|
+
e.renderEndIcon ? e.renderEndIcon() : null
|
|
3161
|
+
] }),
|
|
3162
|
+
I && /* @__PURE__ */ z.jsx(
|
|
3163
|
+
"span",
|
|
3164
|
+
{
|
|
3165
|
+
"data-drag-handle": !0,
|
|
3166
|
+
className: `${Me(
|
|
3167
|
+
oe.dragHandle({
|
|
3168
|
+
theme: l
|
|
3169
|
+
}),
|
|
3170
|
+
"group-hover:bu-opacity-100"
|
|
3171
|
+
)} drag-handle-icon`,
|
|
3172
|
+
style: {
|
|
3173
|
+
display: "flex",
|
|
3174
|
+
alignItems: "center",
|
|
3175
|
+
marginLeft: "4px"
|
|
3176
|
+
},
|
|
3177
|
+
children: a !== null && (a || /* @__PURE__ */ z.jsx(Xo, {}))
|
|
3178
|
+
}
|
|
3179
|
+
)
|
|
3180
|
+
]
|
|
3181
|
+
}
|
|
3182
|
+
)
|
|
3183
|
+
}
|
|
3184
|
+
);
|
|
3185
|
+
}, Ko = (e) => {
|
|
3186
|
+
const {
|
|
3187
|
+
columns: t,
|
|
3188
|
+
sortStates: n,
|
|
3189
|
+
onSort: r,
|
|
3190
|
+
activeId: o,
|
|
3191
|
+
theadClass: i,
|
|
3192
|
+
draggable: s = !1,
|
|
3193
|
+
dragHandleIcon: a,
|
|
3194
|
+
theme: l = "light",
|
|
3195
|
+
rowIdPrefix: u
|
|
3196
|
+
} = e, c = (f) => {
|
|
3197
|
+
f.filter && f.key && r(f.key, f.type);
|
|
3198
|
+
}, d = (f) => {
|
|
3199
|
+
if (!f.filter || !f.key)
|
|
3200
|
+
return null;
|
|
3201
|
+
const h = n[f.key] || ne.default, v = l === "dark" ? "rgba(235, 236, 245, 0.20)" : "rgba(10, 10, 10, 0.20)", g = l === "dark" ? "rgba(235, 236, 245, 0.60)" : "rgba(10, 10, 10, 0.60)", b = h !== ne.default;
|
|
3202
|
+
return /* @__PURE__ */ z.jsx(
|
|
3203
|
+
"span",
|
|
3204
|
+
{
|
|
3205
|
+
className: Me(
|
|
3206
|
+
"bu-inline-flex bu-align-middle bu-transition-opacity bu-duration-200",
|
|
3207
|
+
"bu-ml-[4px]"
|
|
3208
|
+
),
|
|
3209
|
+
children: /* @__PURE__ */ z.jsxs(
|
|
3210
|
+
"svg",
|
|
3211
|
+
{
|
|
3212
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3213
|
+
width: "6",
|
|
3214
|
+
height: "10",
|
|
3215
|
+
viewBox: "0 0 6 10",
|
|
3216
|
+
fill: "none",
|
|
3217
|
+
className: Me(
|
|
3218
|
+
"bu-transition-opacity bu-duration-200",
|
|
3219
|
+
b ? "bu-opacity-100" : "bu-opacity-0 group-hover:bu-opacity-100"
|
|
3220
|
+
),
|
|
3221
|
+
children: [
|
|
3222
|
+
/* @__PURE__ */ z.jsx(
|
|
3223
|
+
"path",
|
|
3224
|
+
{
|
|
3225
|
+
d: "M5.4847 3.04301V4.10942H0.151367V3.04301L2.81803 0.376343L5.4847 3.04301Z",
|
|
3226
|
+
fill: h === ne.asc ? g : v
|
|
3227
|
+
}
|
|
3228
|
+
),
|
|
3229
|
+
/* @__PURE__ */ z.jsx(
|
|
3230
|
+
"path",
|
|
3231
|
+
{
|
|
3232
|
+
d: "M5.4847 5.89067V6.95707L2.81803 9.62374L0.151367 6.95707V5.89067H5.4847Z",
|
|
3233
|
+
fill: h === ne.desc ? g : v
|
|
3234
|
+
}
|
|
3235
|
+
)
|
|
3236
|
+
]
|
|
3237
|
+
}
|
|
3238
|
+
)
|
|
3239
|
+
}
|
|
3240
|
+
);
|
|
3241
|
+
};
|
|
3242
|
+
return /* @__PURE__ */ z.jsx("thead", { className: Me(oe.thead({ theme: l }), i), children: /* @__PURE__ */ z.jsx("tr", { id: u ? `${u}-thead` : "", children: t.map((f, h) => /* @__PURE__ */ z.jsx(
|
|
3243
|
+
Yo,
|
|
3244
|
+
{
|
|
3245
|
+
column: f,
|
|
3246
|
+
index: h,
|
|
3247
|
+
columns: t,
|
|
3248
|
+
sortState: f.key ? n[f.key] : void 0,
|
|
3249
|
+
onSort: c,
|
|
3250
|
+
renderSortIcon: d,
|
|
3251
|
+
isDragging: f.key === o,
|
|
3252
|
+
draggable: s,
|
|
3253
|
+
dragHandleIcon: a,
|
|
3254
|
+
theme: l
|
|
3255
|
+
},
|
|
3256
|
+
f.key || h
|
|
3257
|
+
)) }) });
|
|
3258
|
+
}, Uo = (e) => {
|
|
3259
|
+
const { columns: t, data: n, rowKey: r, tdClass: o, tbodyClass: i, theme: s = "light" } = e, a = (c, d) => {
|
|
3260
|
+
const f = {
|
|
3261
|
+
textAlign: oe.getTextAlign(c.align)
|
|
3262
|
+
};
|
|
3263
|
+
if (c.fixed === "left") {
|
|
3264
|
+
let h = 0;
|
|
3265
|
+
for (let v = 0; v < d; v++)
|
|
3266
|
+
t[v].fixed === "left" && (h += parseInt(t[v].width || "150"));
|
|
3267
|
+
f.left = `${h}px`;
|
|
3268
|
+
} else if (c.fixed === "right") {
|
|
3269
|
+
let h = 0;
|
|
3270
|
+
for (let v = d + 1; v < t.length; v++)
|
|
3271
|
+
t[v].fixed === "right" && (h += parseInt(t[v].width || "150"));
|
|
3272
|
+
f.right = `${h}px`;
|
|
3273
|
+
}
|
|
3274
|
+
return f;
|
|
3275
|
+
}, l = (c, d, f) => c.render ? c.render(d, f) : c.key ? d[c.key] : null, u = (c, d, f) => {
|
|
3276
|
+
if (c.onCell)
|
|
3277
|
+
return c.onCell(d, f);
|
|
3278
|
+
};
|
|
3279
|
+
return /* @__PURE__ */ z.jsx("tbody", { className: Me(oe.tbody({ theme: s }), i), children: n.map((c, d) => /* @__PURE__ */ z.jsx(
|
|
3280
|
+
"tr",
|
|
3281
|
+
{
|
|
3282
|
+
id: e.rowIdPrefix ? `${e.rowIdPrefix}-${d}` : "",
|
|
3283
|
+
className: oe.tr({ theme: s }),
|
|
3284
|
+
children: t.map((f, h) => {
|
|
3285
|
+
const v = u(f, c, d);
|
|
3286
|
+
return v === 0 ? null : /* @__PURE__ */ z.jsx(
|
|
3287
|
+
"td",
|
|
3288
|
+
{
|
|
3289
|
+
className: oe.getTdClasses({
|
|
3290
|
+
theme: s,
|
|
3291
|
+
fixed: f.fixed,
|
|
3292
|
+
customClass: o
|
|
3293
|
+
}),
|
|
3294
|
+
style: a(f, h),
|
|
3295
|
+
colSpan: v,
|
|
3296
|
+
children: l(f, c, d)
|
|
3297
|
+
},
|
|
3298
|
+
f.key || h
|
|
3299
|
+
);
|
|
3300
|
+
})
|
|
3301
|
+
},
|
|
3302
|
+
c[r] || d
|
|
3303
|
+
)) });
|
|
3304
|
+
}, Vo = (e) => {
|
|
3305
|
+
let {
|
|
3306
|
+
transform: t
|
|
3307
|
+
} = e;
|
|
3308
|
+
return {
|
|
3309
|
+
...t,
|
|
3310
|
+
y: 0
|
|
3311
|
+
};
|
|
3312
|
+
}, Qo = (e) => {
|
|
3313
|
+
const {
|
|
3314
|
+
columns: t,
|
|
3315
|
+
data: n,
|
|
3316
|
+
rowKey: r = "id",
|
|
3317
|
+
theadClass: o,
|
|
3318
|
+
tdClass: i,
|
|
3319
|
+
tbodyClass: s,
|
|
3320
|
+
renderEmpty: a,
|
|
3321
|
+
onSortChange: l,
|
|
3322
|
+
tableLayout: u = "auto",
|
|
3323
|
+
draggable: c = !1,
|
|
3324
|
+
// 默认不启用拖拽
|
|
3325
|
+
onColumnsChange: d,
|
|
3326
|
+
dragHandleIcon: f,
|
|
3327
|
+
maxHeight: h,
|
|
3328
|
+
rowIdPrefix: v
|
|
3329
|
+
} = e, { theme: g } = Wn(), [b, x] = Ce.useState(t), [p, y] = Ce.useState({}), [R, S] = Ce.useState(null), I = pr(
|
|
3330
|
+
Kt(Lt, {
|
|
3331
|
+
activationConstraint: {
|
|
3332
|
+
distance: 8
|
|
3333
|
+
// 8px 移动后才激活拖拽
|
|
3334
|
+
}
|
|
3335
|
+
}),
|
|
3336
|
+
Kt(Ot)
|
|
3337
|
+
);
|
|
3338
|
+
Ce.useEffect(() => {
|
|
3339
|
+
x(t);
|
|
3340
|
+
}, [t]);
|
|
3341
|
+
const m = (T, G) => {
|
|
3342
|
+
const U = p[T] || ne.default;
|
|
3343
|
+
let k;
|
|
3344
|
+
U === ne.default ? k = ne.desc : U === ne.desc ? k = ne.asc : k = ne.default;
|
|
3345
|
+
const se = G || "single";
|
|
3346
|
+
let B;
|
|
3347
|
+
if (se === "single" ? B = { [T]: k } : (B = { ...p, [T]: k }, k === ne.default && delete B[T]), y(B), l)
|
|
3348
|
+
if (se === "single")
|
|
3349
|
+
l({ sortKey: T, sort: k });
|
|
3350
|
+
else {
|
|
3351
|
+
const ae = Object.entries(B).map(([le, X]) => ({
|
|
3352
|
+
sortKey: le,
|
|
3353
|
+
sort: X
|
|
3354
|
+
}));
|
|
3355
|
+
l(ae);
|
|
3356
|
+
}
|
|
3357
|
+
}, w = (T) => {
|
|
3358
|
+
S(T.active.id);
|
|
3359
|
+
}, D = (T) => {
|
|
3360
|
+
const { active: G, over: U } = T;
|
|
3361
|
+
S(null), !(!U || G.id === U.id) && x((k) => {
|
|
3362
|
+
const se = k.findIndex((le) => le.key === G.id), B = k.findIndex((le) => le.key === U.id);
|
|
3363
|
+
if (se === -1 || B === -1 || k[B].fixed)
|
|
3364
|
+
return k;
|
|
3365
|
+
const ae = zt(k, se, B);
|
|
3366
|
+
return d && d(ae), ae;
|
|
3367
|
+
});
|
|
3368
|
+
}, N = b.filter((T) => !T.fixed && T.key).map((T) => T.key), P = (() => {
|
|
3369
|
+
const T = b.reduce((G, U) => {
|
|
3370
|
+
if (U.width) {
|
|
3371
|
+
const k = parseInt(U.width);
|
|
3372
|
+
return G + (isNaN(k) ? 150 : k);
|
|
3373
|
+
}
|
|
3374
|
+
return G + 150;
|
|
3375
|
+
}, 0);
|
|
3376
|
+
return T > 0 ? `${T}px` : void 0;
|
|
3377
|
+
})(), j = () => /* @__PURE__ */ z.jsx(
|
|
3378
|
+
"div",
|
|
3379
|
+
{
|
|
3380
|
+
className: oe.container({ theme: g }),
|
|
3381
|
+
style: h ? { maxHeight: h, overflowX: "auto", overflowY: "auto" } : { overflowX: "auto" },
|
|
3382
|
+
children: n.length > 0 ? /* @__PURE__ */ z.jsxs(
|
|
3383
|
+
"table",
|
|
3384
|
+
{
|
|
3385
|
+
className: oe.table(),
|
|
3386
|
+
style: {
|
|
3387
|
+
tableLayout: u,
|
|
3388
|
+
minWidth: u === "fixed" ? P : void 0
|
|
3389
|
+
},
|
|
3390
|
+
children: [
|
|
3391
|
+
/* @__PURE__ */ z.jsx(
|
|
3392
|
+
Ko,
|
|
3393
|
+
{
|
|
3394
|
+
columns: b,
|
|
3395
|
+
sortStates: p,
|
|
3396
|
+
onSort: m,
|
|
3397
|
+
activeId: c ? R : null,
|
|
3398
|
+
theadClass: o,
|
|
3399
|
+
draggable: c,
|
|
3400
|
+
dragHandleIcon: f,
|
|
3401
|
+
theme: g,
|
|
3402
|
+
rowIdPrefix: v
|
|
3403
|
+
}
|
|
3404
|
+
),
|
|
3405
|
+
/* @__PURE__ */ z.jsx(
|
|
3406
|
+
Uo,
|
|
3407
|
+
{
|
|
3408
|
+
columns: b,
|
|
3409
|
+
data: n,
|
|
3410
|
+
rowKey: r,
|
|
3411
|
+
tdClass: i,
|
|
3412
|
+
tbodyClass: s,
|
|
3413
|
+
theme: g,
|
|
3414
|
+
rowIdPrefix: v
|
|
3415
|
+
}
|
|
3416
|
+
)
|
|
3417
|
+
]
|
|
3418
|
+
}
|
|
3419
|
+
) : /* @__PURE__ */ z.jsx("div", { className: oe.empty({ theme: g }), children: a || "No Data" })
|
|
3420
|
+
}
|
|
3421
|
+
);
|
|
3422
|
+
return c ? /* @__PURE__ */ z.jsx(
|
|
3423
|
+
So,
|
|
3424
|
+
{
|
|
3425
|
+
sensors: I,
|
|
3426
|
+
collisionDetection: Sr,
|
|
3427
|
+
onDragStart: w,
|
|
3428
|
+
onDragEnd: D,
|
|
3429
|
+
modifiers: [Vo],
|
|
3430
|
+
children: /* @__PURE__ */ z.jsx(
|
|
3431
|
+
zo,
|
|
3432
|
+
{
|
|
3433
|
+
items: N,
|
|
3434
|
+
strategy: Mo,
|
|
3435
|
+
children: j()
|
|
3436
|
+
}
|
|
3437
|
+
)
|
|
3438
|
+
}
|
|
3439
|
+
) : j();
|
|
3440
|
+
};
|
|
3441
|
+
export {
|
|
3442
|
+
Qo as P,
|
|
3443
|
+
ne as S
|
|
3444
|
+
};
|