@spacego/fe-components 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -37
- package/lib/_virtual/Resizable.js +4 -0
- package/lib/_virtual/ResizableBox.js +4 -0
- package/lib/_virtual/index.js +5 -0
- package/lib/_virtual/index2.js +4 -0
- package/lib/_virtual/index3.js +4 -0
- package/lib/_virtual/index4.js +4 -0
- package/lib/_virtual/propTypes.js +4 -0
- package/lib/_virtual/react-is.development.js +4 -0
- package/lib/_virtual/react-is.production.min.js +4 -0
- package/lib/_virtual/utils.js +4 -0
- package/lib/fe-auto-complete/index.js +6 -0
- package/lib/fe-button/index.js +27 -0
- package/lib/fe-cascader/index.js +19 -0
- package/lib/fe-checkbox/index.js +6 -0
- package/lib/fe-checkbox-group/index.js +6 -0
- package/lib/fe-date-picker/index.js +19 -0
- package/lib/fe-description-render/index.js +43 -0
- package/lib/fe-descriptions/index.js +6 -0
- package/lib/fe-empty/index.js +6 -0
- package/lib/fe-error-block/index.js +6 -0
- package/lib/fe-form/fe-form/index.js +133 -0
- package/lib/fe-form/fe-form-auto-complete/index.js +57 -0
- package/lib/fe-form/fe-form-btn-group/index.js +29 -0
- package/lib/fe-form/fe-form-cascader/index.js +25 -0
- package/lib/fe-form/fe-form-checkbox-group/index.js +21 -0
- package/lib/fe-form/fe-form-date-picker/index.js +75 -0
- package/lib/fe-form/fe-form-date-range-picker/index.js +99 -0
- package/lib/fe-form/fe-form-input/index.js +53 -0
- package/lib/fe-form/fe-form-input-input/index.js +63 -0
- package/lib/fe-form/fe-form-input-number/index.js +43 -0
- package/lib/fe-form/fe-form-item/index.js +46 -0
- package/lib/fe-form/fe-form-label/index.js +20 -0
- package/lib/fe-form/fe-form-radio/index.js +21 -0
- package/lib/fe-form/fe-form-render/index.js +33 -0
- package/lib/fe-form/fe-form-rich-text/index.js +25 -0
- package/lib/fe-form/fe-form-select/index.js +93 -0
- package/lib/fe-form/fe-form-switch/index.js +21 -0
- package/lib/fe-form/fe-form-text/index.js +20 -0
- package/lib/fe-form/fe-form-text-area/index.js +24 -0
- package/lib/fe-form/fe-form-time-picker/index.js +21 -0
- package/lib/fe-form/fe-form-upload/index.js +63 -0
- package/lib/fe-form/utils/index.js +28 -0
- package/lib/fe-input/index.js +32 -0
- package/lib/fe-input-number/index.js +19 -0
- package/lib/fe-layouts/auth-layout/index.js +35 -17
- package/lib/fe-layouts/basics-layout/index.js +2 -2
- package/lib/fe-layouts/layout.js +34 -16
- package/lib/fe-link/index.js +23 -0
- package/lib/fe-map/index.js +263 -0
- package/lib/fe-modal/index.js +85 -0
- package/lib/fe-pagination/index.js +6 -0
- package/lib/fe-panel/fe-panel-toolbar.js +40 -0
- package/lib/fe-panel/index.js +49 -0
- package/lib/fe-panel/use-panel-context.js +9 -0
- package/lib/fe-permission/index.js +12 -0
- package/lib/fe-permission-provider/index.js +29 -0
- package/lib/fe-radio/index.js +11 -0
- package/lib/fe-radio-group/index.js +6 -0
- package/lib/fe-rich-text/index.js +293 -0
- package/lib/fe-select/index.js +24 -0
- package/lib/fe-switch/index.js +6 -0
- package/lib/fe-table/fe-edit-table/index.js +39 -0
- package/lib/fe-table/fe-edit-table-cell/index.js +63 -0
- package/lib/fe-table/fe-head-title/index.js +9 -0
- package/lib/fe-table/fe-normal-table/index.js +192 -0
- package/lib/fe-table/fe-sub-table/index.js +74 -0
- package/lib/fe-table/fe-table/index.js +7 -0
- package/lib/fe-table/fe-table-alert/index.js +42 -0
- package/lib/fe-table/fe-table-link/index.js +87 -0
- package/lib/fe-table/fe-table-render/index.js +56 -0
- package/lib/fe-table/fe-table-setting/index.js +165 -0
- package/lib/fe-table/fe-table-toolbar/index.js +63 -0
- package/lib/fe-table/fe-table-utils/index.js +157 -0
- package/lib/fe-table/type/table.d.js +4 -0
- package/lib/fe-table/use-edit-table/index.js +151 -0
- package/lib/fe-table/use-pagination/index.js +59 -0
- package/lib/fe-table/use-sub-table/index.js +23 -0
- package/lib/fe-table/use-table/index.js +177 -0
- package/lib/fe-table/use-table-columns/index.js +53 -0
- package/lib/fe-table/use-table-form-context/index.js +14 -0
- package/lib/fe-table/use-table-selection/index.js +53 -0
- package/lib/fe-text-area/index.js +21 -0
- package/lib/fe-time-picker/index.js +19 -0
- package/lib/fe-upload/index.js +182 -0
- package/lib/fe-upload/upload.constant.js +91 -0
- package/lib/fe-upload-atomic/index.js +6 -0
- package/lib/fe-upload-crop/index.js +207 -0
- package/lib/hooks/{use-auth.hook.js → use-auth.hook/index.js} +3 -3
- package/lib/hooks/use-form/index.js +38 -0
- package/lib/hooks/use-permission.hook/index.js +9 -0
- package/lib/index.css +7 -1
- package/lib/index.js +161 -42
- package/lib/node_modules/.pnpm/@dnd-kit_accessibility@3.1.1_react@18.3.1/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +56 -0
- package/lib/node_modules/.pnpm/@dnd-kit_core@6.3.1_nnrd3gsncyragczmpvfhocinkq/node_modules/@dnd-kit/core/dist/core.esm.js +2344 -0
- package/lib/node_modules/.pnpm/@dnd-kit_modifiers@9.0.0_55ztycxty3xzw7t4rzpvix55vq/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js +13 -0
- package/lib/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_55ztycxty3xzw7t4rzpvix55vq/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +439 -0
- package/lib/node_modules/.pnpm/@dnd-kit_utilities@3.2.2_react@18.3.1/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +235 -0
- package/lib/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js +54 -0
- package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/checkPropTypes.js +54 -0
- package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithThrowingShims.js +52 -0
- package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithTypeCheckers.js +329 -0
- package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js +17 -0
- package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/ReactPropTypesSecret.js +10 -0
- package/lib/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/has.js +7 -0
- package/lib/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.js +95 -0
- package/lib/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js +78 -0
- package/lib/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js +10 -0
- package/lib/node_modules/.pnpm/react-resizable@3.1.3_nnrd3gsncyragczmpvfhocinkq/node_modules/react-resizable/build/Resizable.js +233 -0
- package/lib/node_modules/.pnpm/react-resizable@3.1.3_nnrd3gsncyragczmpvfhocinkq/node_modules/react-resizable/build/ResizableBox.js +164 -0
- package/lib/node_modules/.pnpm/react-resizable@3.1.3_nnrd3gsncyragczmpvfhocinkq/node_modules/react-resizable/build/propTypes.js +113 -0
- package/lib/node_modules/.pnpm/react-resizable@3.1.3_nnrd3gsncyragczmpvfhocinkq/node_modules/react-resizable/build/utils.js +56 -0
- package/lib/node_modules/.pnpm/react-resizable@3.1.3_nnrd3gsncyragczmpvfhocinkq/node_modules/react-resizable/index.js +12 -0
- package/lib/store/modules/layout-config.store.js +83 -65
- package/lib/store/modules/theme.store.js +36 -18
- package/lib/types/fe-auto-complete/index.d.ts +2 -0
- package/lib/types/fe-button/index.d.ts +16 -0
- package/lib/types/fe-cascader/index.d.ts +7 -0
- package/lib/types/fe-checkbox/index.d.ts +6 -0
- package/lib/types/fe-checkbox-group/index.d.ts +7 -0
- package/lib/types/fe-date-picker/index.d.ts +3 -0
- package/lib/types/fe-description-render/index.d.ts +31 -0
- package/lib/types/fe-descriptions/index.d.ts +2 -0
- package/lib/types/fe-empty/index.d.ts +2 -0
- package/lib/types/fe-error-block/index.d.ts +6 -0
- package/lib/types/fe-form/fe-form/index.d.ts +356 -0
- package/lib/types/fe-form/fe-form-auto-complete/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-btn-group/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-cascader/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-checkbox-group/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-date-picker/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-date-range-picker/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-input/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-input-input/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-input-number/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-item/index.d.ts +70 -0
- package/lib/types/fe-form/fe-form-label/index.d.ts +45 -0
- package/lib/types/fe-form/fe-form-radio/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-render/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-rich-text/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-select/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-switch/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-text/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-text-area/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-time-picker/index.d.ts +3 -0
- package/lib/types/fe-form/fe-form-upload/index.d.ts +3 -0
- package/lib/types/fe-form/index.d.ts +26 -0
- package/lib/types/fe-form/utils/index.d.ts +24 -0
- package/lib/types/fe-input/index.d.ts +12 -0
- package/lib/types/fe-input-number/index.d.ts +2 -0
- package/lib/types/fe-layouts/context/global-context.d.ts +240 -238
- package/lib/types/fe-link/index.d.ts +6 -0
- package/lib/types/fe-map/index.d.ts +73 -0
- package/lib/types/fe-modal/index.d.ts +20 -0
- package/lib/types/fe-pagination/index.d.ts +2 -0
- package/lib/types/fe-panel/fe-panel-toolbar.d.ts +3 -0
- package/lib/types/fe-panel/index.d.ts +61 -0
- package/lib/types/fe-panel/panel-toolbar.d.ts +4 -0
- package/lib/types/fe-panel/use-panel-context.d.ts +6 -0
- package/lib/types/fe-permission/index.d.ts +10 -0
- package/lib/types/fe-permission-provider/index.d.ts +8 -0
- package/lib/types/fe-radio/index.d.ts +2 -0
- package/lib/types/fe-radio-group/index.d.ts +2 -0
- package/lib/types/fe-rich-text/index.d.ts +167 -0
- package/lib/types/fe-select/index.d.ts +8 -0
- package/lib/types/fe-switch/index.d.ts +2 -0
- package/lib/types/fe-table/fe-edit-table/index.d.ts +3 -0
- package/lib/types/fe-table/fe-edit-table-cell/index.d.ts +16 -0
- package/lib/types/fe-table/fe-head-title/index.d.ts +6 -0
- package/lib/types/fe-table/fe-normal-table/index.d.ts +3 -0
- package/lib/types/fe-table/fe-sub-table/index.d.ts +3 -0
- package/lib/types/fe-table/fe-table/index.d.ts +3 -0
- package/lib/types/fe-table/fe-table-alert/index.d.ts +13 -0
- package/lib/types/fe-table/fe-table-link/index.d.ts +12 -0
- package/lib/types/fe-table/fe-table-render/index.d.ts +13 -0
- package/lib/types/fe-table/fe-table-setting/index.d.ts +22 -0
- package/lib/types/fe-table/fe-table-toolbar/index.d.ts +18 -0
- package/lib/types/fe-table/fe-table-utils/index.d.ts +193 -0
- package/lib/types/fe-table/index.d.ts +6 -0
- package/lib/types/fe-table/type/table-context.d.ts +60 -0
- package/lib/types/fe-table/type/table.d.ts +797 -0
- package/lib/types/fe-table/use-edit-table/index.d.ts +6 -0
- package/lib/types/fe-table/use-pagination/index.d.ts +3 -0
- package/lib/types/fe-table/use-sub-table/index.d.ts +8 -0
- package/lib/types/fe-table/use-table/index.d.ts +3 -0
- package/lib/types/fe-table/use-table-columns/index.d.ts +47 -0
- package/lib/types/fe-table/use-table-form-context/index.d.ts +10 -0
- package/lib/types/fe-table/use-table-selection/index.d.ts +46 -0
- package/lib/types/fe-text-area/index.d.ts +4 -0
- package/lib/types/fe-time-picker/index.d.ts +3 -0
- package/lib/types/fe-upload/index.d.ts +85 -0
- package/lib/types/fe-upload/upload.constant.d.ts +39 -0
- package/lib/types/fe-upload-atomic/index.d.ts +2 -0
- package/lib/types/fe-upload-crop/index.d.ts +10 -0
- package/lib/types/hooks/index.d.ts +1 -0
- package/lib/types/hooks/use-descriptions/index.d.ts +3 -0
- package/lib/types/hooks/use-form/index.d.ts +16 -0
- package/lib/types/hooks/use-permission.hook/index.d.ts +10 -0
- package/lib/types/index.d.ts +32 -0
- package/lib/types/typings/index.d.ts +98 -59
- package/lib/types/typings/shims-axios.d.ts +38 -38
- package/package.json +79 -68
- /package/lib/hooks/{use-nprogress.hook.js → use-nprogress.hook/index.js} +0 -0
- /package/lib/types/hooks/{use-auth.hook.d.ts → use-auth.hook/index.d.ts} +0 -0
- /package/lib/types/hooks/{use-nprogress.hook.d.ts → use-nprogress.hook/index.d.ts} +0 -0
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
import j, { useMemo as L, useRef as P, useEffect as _, useContext as ge, useState as pe } from "react";
|
|
2
|
+
import { KeyboardCode as x, useDndContext as be, closestCorners as ve, getFirstCollision as he, getScrollableAncestors as me, useDroppable as Ie, useDraggable as xe, getClientRect as ye } from "../../../../../@dnd-kit_core@6.3.1_nnrd3gsncyragczmpvfhocinkq/node_modules/@dnd-kit/core/dist/core.esm.js";
|
|
3
|
+
import { useUniqueId as Re, useIsomorphicLayoutEffect as q, subtract as Ce, useCombinedRefs as we, isKeyboardEvent as De, CSS as B } from "../../../../../@dnd-kit_utilities@3.2.2_react@18.3.1/node_modules/@dnd-kit/utilities/dist/utilities.esm.js";
|
|
4
|
+
function H(e, t, n) {
|
|
5
|
+
const r = e.slice();
|
|
6
|
+
return r.splice(n < 0 ? r.length + n : n, 0, r.splice(t, 1)[0]), r;
|
|
7
|
+
}
|
|
8
|
+
function Se(e, t) {
|
|
9
|
+
return e.reduce((n, r, o) => {
|
|
10
|
+
const i = t.get(r);
|
|
11
|
+
return i && (n[o] = i), n;
|
|
12
|
+
}, Array(e.length));
|
|
13
|
+
}
|
|
14
|
+
function O(e) {
|
|
15
|
+
return e !== null && e >= 0;
|
|
16
|
+
}
|
|
17
|
+
function Ae(e, t) {
|
|
18
|
+
if (e === t)
|
|
19
|
+
return !0;
|
|
20
|
+
if (e.length !== t.length)
|
|
21
|
+
return !1;
|
|
22
|
+
for (let n = 0; n < e.length; n++)
|
|
23
|
+
if (e[n] !== t[n])
|
|
24
|
+
return !1;
|
|
25
|
+
return !0;
|
|
26
|
+
}
|
|
27
|
+
function Te(e) {
|
|
28
|
+
return typeof e == "boolean" ? {
|
|
29
|
+
draggable: e,
|
|
30
|
+
droppable: e
|
|
31
|
+
} : e;
|
|
32
|
+
}
|
|
33
|
+
const V = (e) => {
|
|
34
|
+
let {
|
|
35
|
+
rects: t,
|
|
36
|
+
activeIndex: n,
|
|
37
|
+
overIndex: r,
|
|
38
|
+
index: o
|
|
39
|
+
} = e;
|
|
40
|
+
const i = H(t, r, n), s = t[o], c = i[o];
|
|
41
|
+
return !c || !s ? null : {
|
|
42
|
+
x: c.left - s.left,
|
|
43
|
+
y: c.top - s.top,
|
|
44
|
+
scaleX: c.width / s.width,
|
|
45
|
+
scaleY: c.height / s.height
|
|
46
|
+
};
|
|
47
|
+
}, E = {
|
|
48
|
+
scaleX: 1,
|
|
49
|
+
scaleY: 1
|
|
50
|
+
}, Ue = (e) => {
|
|
51
|
+
var t;
|
|
52
|
+
let {
|
|
53
|
+
activeIndex: n,
|
|
54
|
+
activeNodeRect: r,
|
|
55
|
+
index: o,
|
|
56
|
+
rects: i,
|
|
57
|
+
overIndex: s
|
|
58
|
+
} = e;
|
|
59
|
+
const c = (t = i[n]) != null ? t : r;
|
|
60
|
+
if (!c)
|
|
61
|
+
return null;
|
|
62
|
+
if (o === n) {
|
|
63
|
+
const d = i[s];
|
|
64
|
+
return d ? {
|
|
65
|
+
x: 0,
|
|
66
|
+
y: n < s ? d.top + d.height - (c.top + c.height) : d.top - c.top,
|
|
67
|
+
...E
|
|
68
|
+
} : null;
|
|
69
|
+
}
|
|
70
|
+
const f = Ne(i, o, n);
|
|
71
|
+
return o > n && o <= s ? {
|
|
72
|
+
x: 0,
|
|
73
|
+
y: -c.height - f,
|
|
74
|
+
...E
|
|
75
|
+
} : o < n && o >= s ? {
|
|
76
|
+
x: 0,
|
|
77
|
+
y: c.height + f,
|
|
78
|
+
...E
|
|
79
|
+
} : {
|
|
80
|
+
x: 0,
|
|
81
|
+
y: 0,
|
|
82
|
+
...E
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
function Ne(e, t, n) {
|
|
86
|
+
const r = e[t], o = e[t - 1], i = e[t + 1];
|
|
87
|
+
return r ? n < t ? o ? r.top - (o.top + o.height) : i ? i.top - (r.top + r.height) : 0 : i ? i.top - (r.top + r.height) : o ? r.top - (o.top + o.height) : 0 : 0;
|
|
88
|
+
}
|
|
89
|
+
const J = "Sortable", Q = /* @__PURE__ */ j.createContext({
|
|
90
|
+
activeIndex: -1,
|
|
91
|
+
containerId: J,
|
|
92
|
+
disableTransforms: !1,
|
|
93
|
+
items: [],
|
|
94
|
+
overIndex: -1,
|
|
95
|
+
useDragOverlay: !1,
|
|
96
|
+
sortedRects: [],
|
|
97
|
+
strategy: V,
|
|
98
|
+
disabled: {
|
|
99
|
+
draggable: !1,
|
|
100
|
+
droppable: !1
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
function Ye(e) {
|
|
104
|
+
let {
|
|
105
|
+
children: t,
|
|
106
|
+
id: n,
|
|
107
|
+
items: r,
|
|
108
|
+
strategy: o = V,
|
|
109
|
+
disabled: i = !1
|
|
110
|
+
} = e;
|
|
111
|
+
const {
|
|
112
|
+
active: s,
|
|
113
|
+
dragOverlay: c,
|
|
114
|
+
droppableRects: f,
|
|
115
|
+
over: d,
|
|
116
|
+
measureDroppableContainers: a
|
|
117
|
+
} = be(), l = Re(J, n), u = c.rect !== null, g = L(() => r.map((I) => typeof I == "object" && "id" in I ? I.id : I), [r]), y = s != null, R = s ? g.indexOf(s.id) : -1, v = d ? g.indexOf(d.id) : -1, C = P(g), m = !Ae(g, C.current), h = v !== -1 && R === -1 || m, b = Te(i);
|
|
118
|
+
q(() => {
|
|
119
|
+
m && y && a(g);
|
|
120
|
+
}, [m, g, y, a]), _(() => {
|
|
121
|
+
C.current = g;
|
|
122
|
+
}, [g]);
|
|
123
|
+
const w = L(
|
|
124
|
+
() => ({
|
|
125
|
+
activeIndex: R,
|
|
126
|
+
containerId: l,
|
|
127
|
+
disabled: b,
|
|
128
|
+
disableTransforms: h,
|
|
129
|
+
items: g,
|
|
130
|
+
overIndex: v,
|
|
131
|
+
useDragOverlay: u,
|
|
132
|
+
sortedRects: Se(g, f),
|
|
133
|
+
strategy: o
|
|
134
|
+
}),
|
|
135
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
136
|
+
[R, l, b.draggable, b.droppable, h, g, v, f, u, o]
|
|
137
|
+
);
|
|
138
|
+
return j.createElement(Q.Provider, {
|
|
139
|
+
value: w
|
|
140
|
+
}, t);
|
|
141
|
+
}
|
|
142
|
+
const Oe = (e) => {
|
|
143
|
+
let {
|
|
144
|
+
id: t,
|
|
145
|
+
items: n,
|
|
146
|
+
activeIndex: r,
|
|
147
|
+
overIndex: o
|
|
148
|
+
} = e;
|
|
149
|
+
return H(n, r, o).indexOf(t);
|
|
150
|
+
}, Ee = (e) => {
|
|
151
|
+
let {
|
|
152
|
+
containerId: t,
|
|
153
|
+
isSorting: n,
|
|
154
|
+
wasDragging: r,
|
|
155
|
+
index: o,
|
|
156
|
+
items: i,
|
|
157
|
+
newIndex: s,
|
|
158
|
+
previousItems: c,
|
|
159
|
+
previousContainerId: f,
|
|
160
|
+
transition: d
|
|
161
|
+
} = e;
|
|
162
|
+
return !d || !r || c !== i && o === s ? !1 : n ? !0 : s !== o && t === f;
|
|
163
|
+
}, Le = {
|
|
164
|
+
duration: 200,
|
|
165
|
+
easing: "ease"
|
|
166
|
+
}, W = "transform", _e = /* @__PURE__ */ B.Transition.toString({
|
|
167
|
+
property: W,
|
|
168
|
+
duration: 0,
|
|
169
|
+
easing: "linear"
|
|
170
|
+
}), ke = {
|
|
171
|
+
roleDescription: "sortable"
|
|
172
|
+
};
|
|
173
|
+
function $e(e) {
|
|
174
|
+
let {
|
|
175
|
+
disabled: t,
|
|
176
|
+
index: n,
|
|
177
|
+
node: r,
|
|
178
|
+
rect: o
|
|
179
|
+
} = e;
|
|
180
|
+
const [i, s] = pe(null), c = P(n);
|
|
181
|
+
return q(() => {
|
|
182
|
+
if (!t && n !== c.current && r.current) {
|
|
183
|
+
const f = o.current;
|
|
184
|
+
if (f) {
|
|
185
|
+
const d = ye(r.current, {
|
|
186
|
+
ignoreTransform: !0
|
|
187
|
+
}), a = {
|
|
188
|
+
x: f.left - d.left,
|
|
189
|
+
y: f.top - d.top,
|
|
190
|
+
scaleX: f.width / d.width,
|
|
191
|
+
scaleY: f.height / d.height
|
|
192
|
+
};
|
|
193
|
+
(a.x || a.y) && s(a);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
n !== c.current && (c.current = n);
|
|
197
|
+
}, [t, n, r, o]), _(() => {
|
|
198
|
+
i && s(null);
|
|
199
|
+
}, [i]), i;
|
|
200
|
+
}
|
|
201
|
+
function je(e) {
|
|
202
|
+
let {
|
|
203
|
+
animateLayoutChanges: t = Ee,
|
|
204
|
+
attributes: n,
|
|
205
|
+
disabled: r,
|
|
206
|
+
data: o,
|
|
207
|
+
getNewIndex: i = Oe,
|
|
208
|
+
id: s,
|
|
209
|
+
strategy: c,
|
|
210
|
+
resizeObserverConfig: f,
|
|
211
|
+
transition: d = Le
|
|
212
|
+
} = e;
|
|
213
|
+
const {
|
|
214
|
+
items: a,
|
|
215
|
+
containerId: l,
|
|
216
|
+
activeIndex: u,
|
|
217
|
+
disabled: g,
|
|
218
|
+
disableTransforms: y,
|
|
219
|
+
sortedRects: R,
|
|
220
|
+
overIndex: v,
|
|
221
|
+
useDragOverlay: C,
|
|
222
|
+
strategy: m
|
|
223
|
+
} = ge(Q), h = ze(r, g), b = a.indexOf(s), w = L(() => ({
|
|
224
|
+
sortable: {
|
|
225
|
+
containerId: l,
|
|
226
|
+
index: b,
|
|
227
|
+
items: a
|
|
228
|
+
},
|
|
229
|
+
...o
|
|
230
|
+
}), [l, o, b, a]), I = L(() => a.slice(a.indexOf(s)), [a, s]), {
|
|
231
|
+
rect: N,
|
|
232
|
+
node: X,
|
|
233
|
+
isOver: ee,
|
|
234
|
+
setNodeRef: F
|
|
235
|
+
} = Ie({
|
|
236
|
+
id: s,
|
|
237
|
+
data: w,
|
|
238
|
+
disabled: h.droppable,
|
|
239
|
+
resizeObserverConfig: {
|
|
240
|
+
updateMeasurementsFor: I,
|
|
241
|
+
...f
|
|
242
|
+
}
|
|
243
|
+
}), {
|
|
244
|
+
active: A,
|
|
245
|
+
activatorEvent: te,
|
|
246
|
+
activeNodeRect: re,
|
|
247
|
+
attributes: ne,
|
|
248
|
+
setNodeRef: G,
|
|
249
|
+
listeners: oe,
|
|
250
|
+
isDragging: $,
|
|
251
|
+
over: se,
|
|
252
|
+
setActivatorNodeRef: ie,
|
|
253
|
+
transform: ae
|
|
254
|
+
} = xe({
|
|
255
|
+
id: s,
|
|
256
|
+
data: w,
|
|
257
|
+
attributes: {
|
|
258
|
+
...ke,
|
|
259
|
+
...n
|
|
260
|
+
},
|
|
261
|
+
disabled: h.draggable
|
|
262
|
+
}), ce = we(F, G), D = !!A, K = D && !y && O(u) && O(v), M = !C && $, U = M && K ? ae : null, le = K ? U ?? (c ?? m)({
|
|
263
|
+
rects: R,
|
|
264
|
+
activeNodeRect: re,
|
|
265
|
+
activeIndex: u,
|
|
266
|
+
overIndex: v,
|
|
267
|
+
index: b
|
|
268
|
+
}) : null, T = O(u) && O(v) ? i({
|
|
269
|
+
id: s,
|
|
270
|
+
items: a,
|
|
271
|
+
activeIndex: u,
|
|
272
|
+
overIndex: v
|
|
273
|
+
}) : b, S = A == null ? void 0 : A.id, p = P({
|
|
274
|
+
activeId: S,
|
|
275
|
+
items: a,
|
|
276
|
+
newIndex: T,
|
|
277
|
+
containerId: l
|
|
278
|
+
}), de = a !== p.current.items, Y = t({
|
|
279
|
+
active: A,
|
|
280
|
+
containerId: l,
|
|
281
|
+
isDragging: $,
|
|
282
|
+
isSorting: D,
|
|
283
|
+
id: s,
|
|
284
|
+
index: b,
|
|
285
|
+
items: a,
|
|
286
|
+
newIndex: p.current.newIndex,
|
|
287
|
+
previousItems: p.current.items,
|
|
288
|
+
previousContainerId: p.current.containerId,
|
|
289
|
+
transition: d,
|
|
290
|
+
wasDragging: p.current.activeId != null
|
|
291
|
+
}), z = $e({
|
|
292
|
+
disabled: !Y,
|
|
293
|
+
index: b,
|
|
294
|
+
node: X,
|
|
295
|
+
rect: N
|
|
296
|
+
});
|
|
297
|
+
return _(() => {
|
|
298
|
+
D && p.current.newIndex !== T && (p.current.newIndex = T), l !== p.current.containerId && (p.current.containerId = l), a !== p.current.items && (p.current.items = a);
|
|
299
|
+
}, [D, T, l, a]), _(() => {
|
|
300
|
+
if (S === p.current.activeId)
|
|
301
|
+
return;
|
|
302
|
+
if (S != null && p.current.activeId == null) {
|
|
303
|
+
p.current.activeId = S;
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
const fe = setTimeout(() => {
|
|
307
|
+
p.current.activeId = S;
|
|
308
|
+
}, 50);
|
|
309
|
+
return () => clearTimeout(fe);
|
|
310
|
+
}, [S]), {
|
|
311
|
+
active: A,
|
|
312
|
+
activeIndex: u,
|
|
313
|
+
attributes: ne,
|
|
314
|
+
data: w,
|
|
315
|
+
rect: N,
|
|
316
|
+
index: b,
|
|
317
|
+
newIndex: T,
|
|
318
|
+
items: a,
|
|
319
|
+
isOver: ee,
|
|
320
|
+
isSorting: D,
|
|
321
|
+
isDragging: $,
|
|
322
|
+
listeners: oe,
|
|
323
|
+
node: X,
|
|
324
|
+
overIndex: v,
|
|
325
|
+
over: se,
|
|
326
|
+
setNodeRef: ce,
|
|
327
|
+
setActivatorNodeRef: ie,
|
|
328
|
+
setDroppableNodeRef: F,
|
|
329
|
+
setDraggableNodeRef: G,
|
|
330
|
+
transform: z ?? le,
|
|
331
|
+
transition: ue()
|
|
332
|
+
};
|
|
333
|
+
function ue() {
|
|
334
|
+
if (
|
|
335
|
+
// Temporarily disable transitions for a single frame to set up derived transforms
|
|
336
|
+
z || // Or to prevent items jumping to back to their "new" position when items change
|
|
337
|
+
de && p.current.newIndex === b
|
|
338
|
+
)
|
|
339
|
+
return _e;
|
|
340
|
+
if (!(M && !De(te) || !d) && (D || Y))
|
|
341
|
+
return B.Transition.toString({
|
|
342
|
+
...d,
|
|
343
|
+
property: W
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
function ze(e, t) {
|
|
348
|
+
var n, r;
|
|
349
|
+
return typeof e == "boolean" ? {
|
|
350
|
+
draggable: e,
|
|
351
|
+
// Backwards compatibility
|
|
352
|
+
droppable: !1
|
|
353
|
+
} : {
|
|
354
|
+
draggable: (n = e == null ? void 0 : e.draggable) != null ? n : t.draggable,
|
|
355
|
+
droppable: (r = e == null ? void 0 : e.droppable) != null ? r : t.droppable
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
function k(e) {
|
|
359
|
+
if (!e)
|
|
360
|
+
return !1;
|
|
361
|
+
const t = e.data.current;
|
|
362
|
+
return !!(t && "sortable" in t && typeof t.sortable == "object" && "containerId" in t.sortable && "items" in t.sortable && "index" in t.sortable);
|
|
363
|
+
}
|
|
364
|
+
const Pe = [x.Down, x.Right, x.Up, x.Left], qe = (e, t) => {
|
|
365
|
+
let {
|
|
366
|
+
context: {
|
|
367
|
+
active: n,
|
|
368
|
+
collisionRect: r,
|
|
369
|
+
droppableRects: o,
|
|
370
|
+
droppableContainers: i,
|
|
371
|
+
over: s,
|
|
372
|
+
scrollableAncestors: c
|
|
373
|
+
}
|
|
374
|
+
} = t;
|
|
375
|
+
if (Pe.includes(e.code)) {
|
|
376
|
+
if (e.preventDefault(), !n || !r)
|
|
377
|
+
return;
|
|
378
|
+
const f = [];
|
|
379
|
+
i.getEnabled().forEach((l) => {
|
|
380
|
+
if (!l || l != null && l.disabled)
|
|
381
|
+
return;
|
|
382
|
+
const u = o.get(l.id);
|
|
383
|
+
if (u)
|
|
384
|
+
switch (e.code) {
|
|
385
|
+
case x.Down:
|
|
386
|
+
r.top < u.top && f.push(l);
|
|
387
|
+
break;
|
|
388
|
+
case x.Up:
|
|
389
|
+
r.top > u.top && f.push(l);
|
|
390
|
+
break;
|
|
391
|
+
case x.Left:
|
|
392
|
+
r.left > u.left && f.push(l);
|
|
393
|
+
break;
|
|
394
|
+
case x.Right:
|
|
395
|
+
r.left < u.left && f.push(l);
|
|
396
|
+
break;
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
const d = ve({
|
|
400
|
+
collisionRect: r,
|
|
401
|
+
droppableRects: o,
|
|
402
|
+
droppableContainers: f
|
|
403
|
+
});
|
|
404
|
+
let a = he(d, "id");
|
|
405
|
+
if (a === (s == null ? void 0 : s.id) && d.length > 1 && (a = d[1].id), a != null) {
|
|
406
|
+
const l = i.get(n.id), u = i.get(a), g = u ? o.get(u.id) : null, y = u == null ? void 0 : u.node.current;
|
|
407
|
+
if (y && g && l && u) {
|
|
408
|
+
const v = me(y).some((I, N) => c[N] !== I), C = Z(l, u), m = Xe(l, u), h = v || !C ? {
|
|
409
|
+
x: 0,
|
|
410
|
+
y: 0
|
|
411
|
+
} : {
|
|
412
|
+
x: m ? r.width - g.width : 0,
|
|
413
|
+
y: m ? r.height - g.height : 0
|
|
414
|
+
}, b = {
|
|
415
|
+
x: g.left,
|
|
416
|
+
y: g.top
|
|
417
|
+
};
|
|
418
|
+
return h.x && h.y ? b : Ce(b, h);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
function Z(e, t) {
|
|
424
|
+
return !k(e) || !k(t) ? !1 : e.data.current.sortable.containerId === t.data.current.sortable.containerId;
|
|
425
|
+
}
|
|
426
|
+
function Xe(e, t) {
|
|
427
|
+
return !k(e) || !k(t) || !Z(e, t) ? !1 : e.data.current.sortable.index < t.data.current.sortable.index;
|
|
428
|
+
}
|
|
429
|
+
export {
|
|
430
|
+
Ye as SortableContext,
|
|
431
|
+
H as arrayMove,
|
|
432
|
+
Ee as defaultAnimateLayoutChanges,
|
|
433
|
+
Oe as defaultNewIndexGetter,
|
|
434
|
+
k as hasSortableData,
|
|
435
|
+
V as rectSortingStrategy,
|
|
436
|
+
qe as sortableKeyboardCoordinates,
|
|
437
|
+
je as useSortable,
|
|
438
|
+
Ue as verticalListSortingStrategy
|
|
439
|
+
};
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { useRef as o, useMemo as l, useLayoutEffect as R, useEffect as g, useCallback as i } from "react";
|
|
2
|
+
function Y() {
|
|
3
|
+
for (var n = arguments.length, t = new Array(n), e = 0; e < n; e++)
|
|
4
|
+
t[e] = arguments[e];
|
|
5
|
+
return l(
|
|
6
|
+
() => (u) => {
|
|
7
|
+
t.forEach((r) => r(u));
|
|
8
|
+
},
|
|
9
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
10
|
+
t
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
const D = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
|
|
14
|
+
function a(n) {
|
|
15
|
+
const t = Object.prototype.toString.call(n);
|
|
16
|
+
return t === "[object Window]" || // In Electron context the Window object serializes to [object global]
|
|
17
|
+
t === "[object global]";
|
|
18
|
+
}
|
|
19
|
+
function b(n) {
|
|
20
|
+
return "nodeType" in n;
|
|
21
|
+
}
|
|
22
|
+
function c(n) {
|
|
23
|
+
var t, e;
|
|
24
|
+
return n ? a(n) ? n : b(n) && (t = (e = n.ownerDocument) == null ? void 0 : e.defaultView) != null ? t : window : window;
|
|
25
|
+
}
|
|
26
|
+
function j(n) {
|
|
27
|
+
const {
|
|
28
|
+
Document: t
|
|
29
|
+
} = c(n);
|
|
30
|
+
return n instanceof t;
|
|
31
|
+
}
|
|
32
|
+
function C(n) {
|
|
33
|
+
return a(n) ? !1 : n instanceof c(n).HTMLElement;
|
|
34
|
+
}
|
|
35
|
+
function L(n) {
|
|
36
|
+
return n instanceof c(n).SVGElement;
|
|
37
|
+
}
|
|
38
|
+
function x(n) {
|
|
39
|
+
return n ? a(n) ? n.document : b(n) ? j(n) ? n : C(n) || L(n) ? n.ownerDocument : document : document : document;
|
|
40
|
+
}
|
|
41
|
+
const E = D ? R : g;
|
|
42
|
+
function M(n) {
|
|
43
|
+
const t = o(n);
|
|
44
|
+
return E(() => {
|
|
45
|
+
t.current = n;
|
|
46
|
+
}), i(function() {
|
|
47
|
+
for (var e = arguments.length, u = new Array(e), r = 0; r < e; r++)
|
|
48
|
+
u[r] = arguments[r];
|
|
49
|
+
return t.current == null ? void 0 : t.current(...u);
|
|
50
|
+
}, []);
|
|
51
|
+
}
|
|
52
|
+
function A() {
|
|
53
|
+
const n = o(null), t = i((u, r) => {
|
|
54
|
+
n.current = setInterval(u, r);
|
|
55
|
+
}, []), e = i(() => {
|
|
56
|
+
n.current !== null && (clearInterval(n.current), n.current = null);
|
|
57
|
+
}, []);
|
|
58
|
+
return [t, e];
|
|
59
|
+
}
|
|
60
|
+
function I(n, t) {
|
|
61
|
+
t === void 0 && (t = [n]);
|
|
62
|
+
const e = o(n);
|
|
63
|
+
return E(() => {
|
|
64
|
+
e.current !== n && (e.current = n);
|
|
65
|
+
}, t), e;
|
|
66
|
+
}
|
|
67
|
+
function v(n, t) {
|
|
68
|
+
const e = o();
|
|
69
|
+
return l(
|
|
70
|
+
() => {
|
|
71
|
+
const u = n(e.current);
|
|
72
|
+
return e.current = u, u;
|
|
73
|
+
},
|
|
74
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
75
|
+
[...t]
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
function N(n) {
|
|
79
|
+
const t = M(n), e = o(null), u = i(
|
|
80
|
+
(r) => {
|
|
81
|
+
r !== e.current && (t == null || t(r, e.current)), e.current = r;
|
|
82
|
+
},
|
|
83
|
+
//eslint-disable-next-line
|
|
84
|
+
[]
|
|
85
|
+
);
|
|
86
|
+
return [e, u];
|
|
87
|
+
}
|
|
88
|
+
function F(n) {
|
|
89
|
+
const t = o();
|
|
90
|
+
return g(() => {
|
|
91
|
+
t.current = n;
|
|
92
|
+
}, [n]), t.current;
|
|
93
|
+
}
|
|
94
|
+
let f = {};
|
|
95
|
+
function H(n, t) {
|
|
96
|
+
return l(() => {
|
|
97
|
+
if (t)
|
|
98
|
+
return t;
|
|
99
|
+
const e = f[n] == null ? 0 : f[n] + 1;
|
|
100
|
+
return f[n] = e, n + "-" + e;
|
|
101
|
+
}, [n, t]);
|
|
102
|
+
}
|
|
103
|
+
function S(n) {
|
|
104
|
+
return function(t) {
|
|
105
|
+
for (var e = arguments.length, u = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
|
|
106
|
+
u[r - 1] = arguments[r];
|
|
107
|
+
return u.reduce((s, T) => {
|
|
108
|
+
const y = Object.entries(T);
|
|
109
|
+
for (const [d, p] of y) {
|
|
110
|
+
const m = s[d];
|
|
111
|
+
m != null && (s[d] = m + n * p);
|
|
112
|
+
}
|
|
113
|
+
return s;
|
|
114
|
+
}, {
|
|
115
|
+
...t
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
const W = /* @__PURE__ */ S(1), q = /* @__PURE__ */ S(-1);
|
|
120
|
+
function O(n) {
|
|
121
|
+
return "clientX" in n && "clientY" in n;
|
|
122
|
+
}
|
|
123
|
+
function z(n) {
|
|
124
|
+
if (!n)
|
|
125
|
+
return !1;
|
|
126
|
+
const {
|
|
127
|
+
KeyboardEvent: t
|
|
128
|
+
} = c(n.target);
|
|
129
|
+
return t && n instanceof t;
|
|
130
|
+
}
|
|
131
|
+
function V(n) {
|
|
132
|
+
if (!n)
|
|
133
|
+
return !1;
|
|
134
|
+
const {
|
|
135
|
+
TouchEvent: t
|
|
136
|
+
} = c(n.target);
|
|
137
|
+
return t && n instanceof t;
|
|
138
|
+
}
|
|
139
|
+
function G(n) {
|
|
140
|
+
if (V(n)) {
|
|
141
|
+
if (n.touches && n.touches.length) {
|
|
142
|
+
const {
|
|
143
|
+
clientX: t,
|
|
144
|
+
clientY: e
|
|
145
|
+
} = n.touches[0];
|
|
146
|
+
return {
|
|
147
|
+
x: t,
|
|
148
|
+
y: e
|
|
149
|
+
};
|
|
150
|
+
} else if (n.changedTouches && n.changedTouches.length) {
|
|
151
|
+
const {
|
|
152
|
+
clientX: t,
|
|
153
|
+
clientY: e
|
|
154
|
+
} = n.changedTouches[0];
|
|
155
|
+
return {
|
|
156
|
+
x: t,
|
|
157
|
+
y: e
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return O(n) ? {
|
|
162
|
+
x: n.clientX,
|
|
163
|
+
y: n.clientY
|
|
164
|
+
} : null;
|
|
165
|
+
}
|
|
166
|
+
const w = /* @__PURE__ */ Object.freeze({
|
|
167
|
+
Translate: {
|
|
168
|
+
toString(n) {
|
|
169
|
+
if (!n)
|
|
170
|
+
return;
|
|
171
|
+
const {
|
|
172
|
+
x: t,
|
|
173
|
+
y: e
|
|
174
|
+
} = n;
|
|
175
|
+
return "translate3d(" + (t ? Math.round(t) : 0) + "px, " + (e ? Math.round(e) : 0) + "px, 0)";
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
Scale: {
|
|
179
|
+
toString(n) {
|
|
180
|
+
if (!n)
|
|
181
|
+
return;
|
|
182
|
+
const {
|
|
183
|
+
scaleX: t,
|
|
184
|
+
scaleY: e
|
|
185
|
+
} = n;
|
|
186
|
+
return "scaleX(" + t + ") scaleY(" + e + ")";
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
Transform: {
|
|
190
|
+
toString(n) {
|
|
191
|
+
if (n)
|
|
192
|
+
return [w.Translate.toString(n), w.Scale.toString(n)].join(" ");
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
Transition: {
|
|
196
|
+
toString(n) {
|
|
197
|
+
let {
|
|
198
|
+
property: t,
|
|
199
|
+
duration: e,
|
|
200
|
+
easing: u
|
|
201
|
+
} = n;
|
|
202
|
+
return t + " " + e + "ms " + u;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}), h = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";
|
|
206
|
+
function K(n) {
|
|
207
|
+
return n.matches(h) ? n : n.querySelector(h);
|
|
208
|
+
}
|
|
209
|
+
export {
|
|
210
|
+
w as CSS,
|
|
211
|
+
W as add,
|
|
212
|
+
D as canUseDOM,
|
|
213
|
+
K as findFirstFocusableNode,
|
|
214
|
+
G as getEventCoordinates,
|
|
215
|
+
x as getOwnerDocument,
|
|
216
|
+
c as getWindow,
|
|
217
|
+
O as hasViewportRelativeCoordinates,
|
|
218
|
+
j as isDocument,
|
|
219
|
+
C as isHTMLElement,
|
|
220
|
+
z as isKeyboardEvent,
|
|
221
|
+
b as isNode,
|
|
222
|
+
L as isSVGElement,
|
|
223
|
+
V as isTouchEvent,
|
|
224
|
+
a as isWindow,
|
|
225
|
+
q as subtract,
|
|
226
|
+
Y as useCombinedRefs,
|
|
227
|
+
M as useEvent,
|
|
228
|
+
A as useInterval,
|
|
229
|
+
E as useIsomorphicLayoutEffect,
|
|
230
|
+
I as useLatestValue,
|
|
231
|
+
v as useLazyMemo,
|
|
232
|
+
N as useNodeRef,
|
|
233
|
+
F as usePrevious,
|
|
234
|
+
H as useUniqueId
|
|
235
|
+
};
|