@ahrowe/ui 0.1.13 → 0.1.15
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/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +287 -278
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/package/common/actionButtons/actionButtons.d.ts +1 -1
- package/dist/types/package/common/actionButtons/actionButtons.types.d.ts +4 -0
- package/dist/types/package/common/confirmModal/confirmModal.d.ts +1 -1
- package/dist/types/package/common/confirmModal/confirmModal.types.d.ts +2 -0
- package/dist/types/package/common/virtualList/virtualList.types.d.ts +6 -0
- package/dist/types/package/common/virtualList/virtualRow.d.ts +2 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import e, { Component as t, PureComponent as n, forwardRef as r, useCallback as i, useEffect as a, useImperativeHandle as o, useLayoutEffect as s, useMemo as c, useReducer as l, useRef as u, useState as d } from "react";
|
|
2
2
|
import f from "classnames";
|
|
3
3
|
import { FontAwesomeIcon as p } from "@fortawesome/react-fontawesome";
|
|
4
|
-
import { faBell as m, faCheck as h, faChevronDown as g, faChevronLeft as _, faChevronRight as v, faChevronUp as y, faCircleCheck as b, faCircleInfo as x, faCircleXmark as S, faDoorOpen as C, faDownload as w, faDrawPolygon as T, faEnvelope as E, faEye as D, faEyeSlash as O, faGear as k, faHandPointer as A, faLayerGroup as j, faMagnifyingGlassMinus as M, faMagnifyingGlassPlus as N, faPen as P, faPhone as F, faPlus as I, faSearch as
|
|
4
|
+
import { faBell as m, faCheck as h, faChevronDown as g, faChevronLeft as _, faChevronRight as v, faChevronUp as y, faCircleCheck as b, faCircleInfo as x, faCircleXmark as S, faDoorOpen as C, faDownload as w, faDrawPolygon as T, faEnvelope as E, faEye as D, faEyeSlash as O, faGear as k, faHandPointer as A, faLayerGroup as j, faMagnifyingGlassMinus as M, faMagnifyingGlassPlus as N, faPen as P, faPhone as F, faPlus as I, faSearch as ee, faSquare as L, faTrash as R, faTriangleExclamation as te, faUpload as ne, faXmark as z, faXmarkCircle as re } from "@fortawesome/free-solid-svg-icons";
|
|
5
5
|
import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
6
6
|
import { createPortal as ie } from "react-dom";
|
|
7
7
|
import ae from "downshift";
|
|
8
8
|
import oe from "@mona-health/react-input-mask";
|
|
9
|
-
import { DndContext as
|
|
10
|
-
import { SortableContext as
|
|
9
|
+
import { DndContext as U, DragOverlay as se, PointerSensor as W, closestCorners as ce, useDroppable as le, useSensor as G, useSensors as K } from "@dnd-kit/core";
|
|
10
|
+
import { SortableContext as q, arrayMove as ue, useSortable as de, verticalListSortingStrategy as fe } from "@dnd-kit/sortable";
|
|
11
11
|
import { CSS as pe } from "@dnd-kit/utilities";
|
|
12
12
|
import { NumericFormat as me } from "react-number-format";
|
|
13
13
|
//#region package/common/accordion/accordion.types.ts
|
|
@@ -306,30 +306,32 @@ function Me({ className: e, style: t, type: n = De.Button, styleType: r = Te.Def
|
|
|
306
306
|
Me.StyleType = Te, Me.Size = Ee, Me.Type = De;
|
|
307
307
|
//#endregion
|
|
308
308
|
//#region package/common/actionButtons/actionButtons.tsx
|
|
309
|
-
function Ne({ onSubmit: e = () => null, onClose: t = () => null, submitLabel: n = "Save", cancelLabel: r = "Cancel", submitButtonStyle: i = Te.Primary, isSubmitButtonLoading: a = !1, isSubmitButtonDisabled: o = !1,
|
|
309
|
+
function Ne({ onSubmit: e = () => null, onClose: t = () => null, submitLabel: n = "Save", cancelLabel: r = "Cancel", submitButtonStyle: i = Te.Primary, isSubmitButtonLoading: a = !1, isSubmitButtonDisabled: o = !1, submitButtonIcon: s = void 0, cancelButtonStyle: c = Te.Default, isCancelButtonLoading: l = !1, isCancelButtonDisabled: u = !1, cancelButtonIcon: d = void 0, hidePrimaryButton: p = !1, hideSecondaryButton: m = !1, noMargin: h = !1, className: g, style: _, classNames: v, styles: y, ...b }) {
|
|
310
310
|
return /* @__PURE__ */ H("div", {
|
|
311
|
-
...
|
|
312
|
-
className: f(xe.actionButtons, !
|
|
311
|
+
...b,
|
|
312
|
+
className: f(xe.actionButtons, !h && xe.actionButtonsMargin, g, v?.root),
|
|
313
313
|
style: {
|
|
314
|
-
...
|
|
315
|
-
...
|
|
314
|
+
..._,
|
|
315
|
+
...y?.root
|
|
316
316
|
},
|
|
317
|
-
children: [!
|
|
317
|
+
children: [!p && /* @__PURE__ */ V(Me, {
|
|
318
318
|
isLoading: a,
|
|
319
319
|
disabled: o,
|
|
320
320
|
styleType: i,
|
|
321
321
|
type: De.Submit,
|
|
322
322
|
onClick: e,
|
|
323
|
-
className:
|
|
324
|
-
style:
|
|
323
|
+
className: v?.submitButton,
|
|
324
|
+
style: y?.submitButton,
|
|
325
|
+
icon: s,
|
|
325
326
|
children: n
|
|
326
|
-
}), !
|
|
327
|
-
isLoading:
|
|
328
|
-
disabled:
|
|
327
|
+
}), !m && /* @__PURE__ */ V(Me, {
|
|
328
|
+
isLoading: l,
|
|
329
|
+
disabled: u,
|
|
329
330
|
onClick: t,
|
|
330
|
-
styleType:
|
|
331
|
-
className:
|
|
332
|
-
style:
|
|
331
|
+
styleType: c,
|
|
332
|
+
className: v?.cancelButton,
|
|
333
|
+
style: y?.cancelButton,
|
|
334
|
+
icon: d,
|
|
333
335
|
children: r
|
|
334
336
|
})]
|
|
335
337
|
});
|
|
@@ -840,11 +842,11 @@ var Y = {
|
|
|
840
842
|
}({});
|
|
841
843
|
//#endregion
|
|
842
844
|
//#region package/common/input/input.tsx
|
|
843
|
-
function rt({ name: t = "", label: n = "", errorMessage: r = "", isValid: o = !0, className: s = "", style: c, value: l = "", icon: m = null, onChange: h = () => {}, onFocus: g = null, onBlur: _ = null, onMouseEnter: v = null, onMouseLeave: y = null, isUppercase: b = !1, isRequired: x = !1, tabIndex: S = 0, type: C = void 0, isRow: w = !1, onIconClick: T = null, parse: k = null, formValidator: A = null, autoFocus: j = !1, suffix: M = null, upperRightLabel: N = null, labelInBorder: I = !1, showCancel:
|
|
844
|
-
let [
|
|
845
|
+
function rt({ name: t = "", label: n = "", errorMessage: r = "", isValid: o = !0, className: s = "", style: c, value: l = "", icon: m = null, onChange: h = () => {}, onFocus: g = null, onBlur: _ = null, onMouseEnter: v = null, onMouseLeave: y = null, isUppercase: b = !1, isRequired: x = !1, tabIndex: S = 0, type: C = void 0, isRow: w = !1, onIconClick: T = null, parse: k = null, formValidator: A = null, autoFocus: j = !1, suffix: M = null, upperRightLabel: N = null, labelInBorder: I = !1, showCancel: L = !1, onClearClicked: R, min: te = null, max: ne = null, placeholder: re = "", useMatLabelStyle: B = !0, autoComplete: ie = null, onClick: ae = () => null, readOnly: oe = !1, customInput: U, alwaysShowCancel: se = !1, multiline: W = !1, rows: ce, autoResize: le = !1, classNames: G, styles: K, disabled: q = !1, ...ue }) {
|
|
846
|
+
let [de, fe] = d(!1), [pe, me] = d(!1), [he, ge] = d(!1), [, _e] = d(0), ve = u(null), ye = u(A), be = i(() => {
|
|
845
847
|
let e = ve.current;
|
|
846
|
-
!e || !
|
|
847
|
-
}, [
|
|
848
|
+
!e || !le || (e.style.height = "auto", e.style.height = `${e.scrollHeight}px`);
|
|
849
|
+
}, [le]);
|
|
848
850
|
a(() => {
|
|
849
851
|
setTimeout(() => {
|
|
850
852
|
fe(!1), me(!1);
|
|
@@ -887,18 +889,18 @@ function rt({ name: t = "", label: n = "", errorMessage: r = "", isValid: o = !0
|
|
|
887
889
|
onClick: () => ge(!he)
|
|
888
890
|
}, Me = xe(), Ne = n;
|
|
889
891
|
Ne && J() && (Ne = `${Ne} *`);
|
|
890
|
-
let Pe = A ? A.value : l, Fe = B && (
|
|
892
|
+
let Pe = A ? A.value : l, Fe = B && (de || Pe || C === X.Date);
|
|
891
893
|
return /* @__PURE__ */ H("div", {
|
|
892
894
|
className: f(Y.input, s),
|
|
893
895
|
style: c,
|
|
894
896
|
children: [
|
|
895
897
|
/* @__PURE__ */ H("label", {
|
|
896
898
|
htmlFor: t,
|
|
897
|
-
className: f(Y.inputLabel,
|
|
899
|
+
className: f(Y.inputLabel, G?.label, {
|
|
898
900
|
[Y.inputLabelColumn]: !w,
|
|
899
901
|
[Y.inputLabelInBorder]: I
|
|
900
902
|
}),
|
|
901
|
-
style:
|
|
903
|
+
style: K?.label,
|
|
902
904
|
children: [
|
|
903
905
|
Ne && !B ? /* @__PURE__ */ H("span", {
|
|
904
906
|
className: Y.inputLabelText,
|
|
@@ -908,33 +910,33 @@ function rt({ name: t = "", label: n = "", errorMessage: r = "", isValid: o = !0
|
|
|
908
910
|
}) : null]
|
|
909
911
|
}) : null,
|
|
910
912
|
N && /* @__PURE__ */ V("div", {
|
|
911
|
-
className: f(Y.inputUpperRightLabel,
|
|
912
|
-
style:
|
|
913
|
+
className: f(Y.inputUpperRightLabel, G?.upperRightLabel),
|
|
914
|
+
style: K?.upperRightLabel,
|
|
913
915
|
children: N
|
|
914
916
|
}),
|
|
915
917
|
/* @__PURE__ */ H("div", {
|
|
916
|
-
className: f(Y.inputContainer, { [Y.inputContainerMultiline]:
|
|
917
|
-
style:
|
|
918
|
+
className: f(Y.inputContainer, { [Y.inputContainerMultiline]: W }, G?.container),
|
|
919
|
+
style: K?.container,
|
|
918
920
|
onMouseEnter: Se,
|
|
919
921
|
onMouseLeave: Ce,
|
|
920
922
|
children: [
|
|
921
923
|
m,
|
|
922
|
-
e.cloneElement(
|
|
923
|
-
...
|
|
924
|
+
e.cloneElement(U || V(W ? "textarea" : "input", {}), {
|
|
925
|
+
...ue,
|
|
924
926
|
className: f(Y.inputField, {
|
|
925
927
|
[Y.inputFieldUppercase]: b,
|
|
926
928
|
[Y.inputFieldDate]: C === X.Date,
|
|
927
929
|
[Y.inputFieldDefault]: C !== X.Date,
|
|
928
930
|
[Y.inputFieldWithIcon]: Oe,
|
|
929
931
|
[Y.inputFieldWithIconLeft]: ke,
|
|
930
|
-
[Y.inputFieldMultiline]:
|
|
931
|
-
[Y.inputFieldMultilineAutoResize]:
|
|
932
|
-
},
|
|
932
|
+
[Y.inputFieldMultiline]: W,
|
|
933
|
+
[Y.inputFieldMultilineAutoResize]: W && le
|
|
934
|
+
}, G?.input),
|
|
933
935
|
name: t,
|
|
934
936
|
id: t,
|
|
935
937
|
value: A ? A.value : l,
|
|
936
938
|
tabIndex: S,
|
|
937
|
-
ref:
|
|
939
|
+
ref: U ? void 0 : ve,
|
|
938
940
|
onChange: Ee,
|
|
939
941
|
onFocus: we,
|
|
940
942
|
onBlur: Te,
|
|
@@ -942,29 +944,29 @@ function rt({ name: t = "", label: n = "", errorMessage: r = "", isValid: o = !0
|
|
|
942
944
|
autoComplete: ie,
|
|
943
945
|
onClick: ae,
|
|
944
946
|
readOnly: oe,
|
|
945
|
-
disabled:
|
|
946
|
-
...!
|
|
947
|
+
disabled: q,
|
|
948
|
+
...!W && {
|
|
947
949
|
type: De(),
|
|
948
950
|
min: te,
|
|
949
951
|
max: ne
|
|
950
952
|
},
|
|
951
|
-
...
|
|
953
|
+
...W && ce !== void 0 && { rows: ce }
|
|
952
954
|
}),
|
|
953
955
|
M && /* @__PURE__ */ V("div", {
|
|
954
|
-
className: f(Y.inputFieldSuffix,
|
|
955
|
-
style:
|
|
956
|
+
className: f(Y.inputFieldSuffix, G?.suffix),
|
|
957
|
+
style: K?.suffix,
|
|
956
958
|
children: M
|
|
957
959
|
})
|
|
958
960
|
]
|
|
959
961
|
}),
|
|
960
962
|
/* @__PURE__ */ V("fieldset", {
|
|
961
|
-
className: f(Y.inputFieldset,
|
|
962
|
-
[Y.inputContainerBorderFocused]:
|
|
963
|
-
[Y.inputContainerBorderSearchFocused]: C === X.Search && (
|
|
963
|
+
className: f(Y.inputFieldset, G?.fieldset, {
|
|
964
|
+
[Y.inputContainerBorderFocused]: de,
|
|
965
|
+
[Y.inputContainerBorderSearchFocused]: C === X.Search && (de || l),
|
|
964
966
|
[Y.inputContainerBorderInvalid]: Me,
|
|
965
967
|
[Y.inputContainerBorderError]: Me
|
|
966
968
|
}),
|
|
967
|
-
style:
|
|
969
|
+
style: K?.fieldset,
|
|
968
970
|
children: /* @__PURE__ */ V("legend", {
|
|
969
971
|
className: f(Y.inputFieldsetLegend, { [Y.inputFieldsetLegendActive]: Fe }),
|
|
970
972
|
children: /* @__PURE__ */ V("span", { children: Ne })
|
|
@@ -973,18 +975,18 @@ function rt({ name: t = "", label: n = "", errorMessage: r = "", isValid: o = !0
|
|
|
973
975
|
B && n && /* @__PURE__ */ V("div", {
|
|
974
976
|
className: f(Y.inputMatLabel, {
|
|
975
977
|
[Y.inputMatLabelFloating]: Fe,
|
|
976
|
-
[Y.inputMatLabelMultiline]:
|
|
978
|
+
[Y.inputMatLabelMultiline]: W && !Fe
|
|
977
979
|
}),
|
|
978
980
|
children: Ne
|
|
979
981
|
}),
|
|
980
982
|
B && re && /* @__PURE__ */ V("div", {
|
|
981
|
-
className: f(Y.inputPlaceholder,
|
|
983
|
+
className: f(Y.inputPlaceholder, de && !Pe && Y.inputPlaceholderShown, W && Y.inputPlaceholderMultiline),
|
|
982
984
|
children: re
|
|
983
985
|
}),
|
|
984
986
|
/* @__PURE__ */ V(nt, {
|
|
985
987
|
variant: "error",
|
|
986
988
|
message: A ? A.getCurrentErrorMessage() : r || "",
|
|
987
|
-
isVisible: Me && (
|
|
989
|
+
isVisible: Me && (de || pe)
|
|
988
990
|
})
|
|
989
991
|
]
|
|
990
992
|
}),
|
|
@@ -1001,17 +1003,17 @@ function rt({ name: t = "", label: n = "", errorMessage: r = "", isValid: o = !0
|
|
|
1001
1003
|
...Ae
|
|
1002
1004
|
}),
|
|
1003
1005
|
C === X.Search && /* @__PURE__ */ V(p, {
|
|
1004
|
-
icon:
|
|
1006
|
+
icon: ee,
|
|
1005
1007
|
...Ae
|
|
1006
1008
|
}),
|
|
1007
1009
|
C === X.Password && /* @__PURE__ */ V(p, {
|
|
1008
1010
|
icon: he ? O : D,
|
|
1009
1011
|
...je
|
|
1010
1012
|
}),
|
|
1011
|
-
(
|
|
1013
|
+
(L && l && (de || pe) || se) && /* @__PURE__ */ V(p, {
|
|
1012
1014
|
icon: z,
|
|
1013
1015
|
className: Y.inputFieldIcon,
|
|
1014
|
-
onClick:
|
|
1016
|
+
onClick: R ?? void 0,
|
|
1015
1017
|
onMouseEnter: () => me(!0),
|
|
1016
1018
|
onMouseLeave: () => me(!1)
|
|
1017
1019
|
})
|
|
@@ -1297,38 +1299,39 @@ function gt({ children: e = null, title: t = "", isOpen: n = !1, onClose: r = ()
|
|
|
1297
1299
|
}
|
|
1298
1300
|
//#endregion
|
|
1299
1301
|
//#region package/common/confirmModal/confirmModal.tsx
|
|
1300
|
-
function _t({ children: e = null, className: t = "", onClose: n = () => {}, onConfirm: r = () => {}, title: i = "", content: a = null, isOpen: o = void 0 }) {
|
|
1301
|
-
let [
|
|
1302
|
-
function
|
|
1303
|
-
|
|
1302
|
+
function _t({ children: e = null, className: t = "", onClose: n = () => {}, onConfirm: r = () => {}, title: i = "", content: a = null, isOpen: o = void 0, actionButtonsProps: s = {} }) {
|
|
1303
|
+
let [c, l] = d(!1), [u, f] = d(!1);
|
|
1304
|
+
function p(e = !1) {
|
|
1305
|
+
l(!1), n(e);
|
|
1304
1306
|
}
|
|
1305
|
-
async function
|
|
1306
|
-
|
|
1307
|
+
async function m() {
|
|
1308
|
+
f(!0);
|
|
1307
1309
|
try {
|
|
1308
|
-
await r(),
|
|
1310
|
+
await r(), p(!0);
|
|
1309
1311
|
} finally {
|
|
1310
|
-
|
|
1312
|
+
f(!1);
|
|
1311
1313
|
}
|
|
1312
1314
|
}
|
|
1313
|
-
let
|
|
1315
|
+
let h = /* @__PURE__ */ H(gt, {
|
|
1314
1316
|
title: i,
|
|
1315
|
-
isOpen: o === void 0 ?
|
|
1316
|
-
onClose: () =>
|
|
1317
|
+
isOpen: o === void 0 ? c : o,
|
|
1318
|
+
onClose: () => p(),
|
|
1317
1319
|
className: e ? void 0 : t,
|
|
1318
1320
|
children: [a, /* @__PURE__ */ V(Ne, {
|
|
1319
|
-
onClose: () =>
|
|
1320
|
-
onSubmit:
|
|
1321
|
+
onClose: () => p(),
|
|
1322
|
+
onSubmit: m,
|
|
1321
1323
|
submitLabel: "Confirm",
|
|
1322
|
-
isSubmitButtonLoading:
|
|
1324
|
+
isSubmitButtonLoading: u,
|
|
1325
|
+
...s
|
|
1323
1326
|
})]
|
|
1324
1327
|
});
|
|
1325
1328
|
return e ? /* @__PURE__ */ H("div", {
|
|
1326
1329
|
className: t,
|
|
1327
1330
|
children: [/* @__PURE__ */ V("span", {
|
|
1328
|
-
onClick: () =>
|
|
1331
|
+
onClick: () => l(!0),
|
|
1329
1332
|
children: e
|
|
1330
|
-
}),
|
|
1331
|
-
}) :
|
|
1333
|
+
}), h]
|
|
1334
|
+
}) : h;
|
|
1332
1335
|
}
|
|
1333
1336
|
var vt = {
|
|
1334
1337
|
"datePickerMonth-item": "datePickerMonth-item_30WWy",
|
|
@@ -1604,6 +1607,8 @@ var Z = {
|
|
|
1604
1607
|
dropdownInputListItemActive: "dropdown-input-list-item-active_0dhia",
|
|
1605
1608
|
"dropdown-input-list-item-selected": "dropdown-input-list-item-selected_hShJf",
|
|
1606
1609
|
dropdownInputListItemSelected: "dropdown-input-list-item-selected_hShJf",
|
|
1610
|
+
"dropdown-input-list-item-disabled": "dropdown-input-list-item-disabled_3r-Yn",
|
|
1611
|
+
dropdownInputListItemDisabled: "dropdown-input-list-item-disabled_3r-Yn",
|
|
1607
1612
|
"dropdown-input-list-hidden": "dropdown-input-list-hidden_huNc5",
|
|
1608
1613
|
dropdownInputListHidden: "dropdown-input-list-hidden_huNc5",
|
|
1609
1614
|
"dropdown-fieldset": "dropdown-fieldset_wQwTf",
|
|
@@ -1636,8 +1641,8 @@ var Z = {
|
|
|
1636
1641
|
};
|
|
1637
1642
|
//#endregion
|
|
1638
1643
|
//#region package/common/dropdown/dropdown.tsx
|
|
1639
|
-
function Ut({ errorMessage: e = "", className: t = "", label: n = "", value: r = "", isValid: i = !0, tabIndex: o = 0, isRequired: s = !1, customProps: c = {}, isRow: l = !1, disabled: m = !1, onScroll: h = () => Promise.resolve(), isListOnTop: _ = !1, onClick: v, onChange: y, onFocus: b = null, onBlur: x = null, onMouseEnter: S = null, onMouseLeave: C = null, dropdownLabel: w, isDropdownListWider: T = !1, inputClassName: E = "", dropDownIconClassName: D = "", dropDownClassName: O = "", formValidator: k = null, labelClassName: A = "", dropDownInputClassName: j = "", items: M = [], useMatLabelStyle: N = !0, placeholder: P = "", plainStyle: F = !1, scrollToSelected: I = !1, reactRef:
|
|
1640
|
-
let [
|
|
1644
|
+
function Ut({ errorMessage: e = "", className: t = "", label: n = "", value: r = "", isValid: i = !0, tabIndex: o = 0, isRequired: s = !1, customProps: c = {}, isRow: l = !1, disabled: m = !1, onScroll: h = () => Promise.resolve(), isListOnTop: _ = !1, onClick: v, onChange: y, onFocus: b = null, onBlur: x = null, onMouseEnter: S = null, onMouseLeave: C = null, dropdownLabel: w, isDropdownListWider: T = !1, inputClassName: E = "", dropDownIconClassName: D = "", dropDownClassName: O = "", formValidator: k = null, labelClassName: A = "", dropDownInputClassName: j = "", items: M = [], useMatLabelStyle: N = !0, placeholder: P = "", plainStyle: F = !1, scrollToSelected: I = !1, reactRef: ee, ...L }) {
|
|
1645
|
+
let [R, te] = d(!1), [ne, z] = d(!1), [, re] = d(0), B = u(k);
|
|
1641
1646
|
a(() => {
|
|
1642
1647
|
if (B.current = k, !B.current) return;
|
|
1643
1648
|
B.current.label = n ?? "", B.current.validate();
|
|
@@ -1648,34 +1653,34 @@ function Ut({ errorMessage: e = "", className: t = "", label: n = "", value: r =
|
|
|
1648
1653
|
z(!0), S?.(e);
|
|
1649
1654
|
}, oe = (e) => {
|
|
1650
1655
|
z(!1), C?.(e);
|
|
1651
|
-
},
|
|
1656
|
+
}, U = (e) => {
|
|
1652
1657
|
te(!0), b?.(e);
|
|
1653
|
-
},
|
|
1658
|
+
}, se = (e) => {
|
|
1654
1659
|
B.current && (B.current.touched = !0), te(!1), x?.(e);
|
|
1655
|
-
},
|
|
1660
|
+
}, W = () => k ? k.touched && k.hasError() : !i || !!e, ce = () => !!(s || k?.validators.find((e) => e.validatorId === "required")), le = (e) => {
|
|
1656
1661
|
k ? (k.set(e), y?.(k.value, c)) : y?.(e, c);
|
|
1657
|
-
},
|
|
1662
|
+
}, G = w, K = k ? k.value : r, q = W();
|
|
1658
1663
|
M.forEach((e) => {
|
|
1659
|
-
e.key ===
|
|
1664
|
+
e.key === K && (G = e.label);
|
|
1660
1665
|
});
|
|
1661
|
-
let
|
|
1666
|
+
let ue = G || K, de = ue == null || typeof ue == "string" && ue.trim() === "";
|
|
1662
1667
|
return /* @__PURE__ */ H("div", {
|
|
1663
|
-
...
|
|
1668
|
+
...L,
|
|
1664
1669
|
className: f(t, Z.dropdownLabel, Z.dropdown, { [Z.dropdownLabelColumn]: !l }),
|
|
1665
1670
|
onMouseEnter: ie,
|
|
1666
1671
|
onMouseLeave: oe,
|
|
1667
1672
|
children: [
|
|
1668
1673
|
/* @__PURE__ */ V(ae, {
|
|
1669
|
-
onChange: (e) =>
|
|
1674
|
+
onChange: (e) => le((e || { key: "" }).key),
|
|
1670
1675
|
itemToString: (e) => e ? String(e.key) : "",
|
|
1671
|
-
selectedItem: M.find((e) => e.key ===
|
|
1676
|
+
selectedItem: M.find((e) => e.key === K) ?? null,
|
|
1672
1677
|
stateReducer: (e, t) => I && Object.prototype.hasOwnProperty.call(t, "isOpen") ? {
|
|
1673
1678
|
...t,
|
|
1674
1679
|
highlightedIndex: t.isOpen ? M.indexOf(e.selectedItem) : null
|
|
1675
1680
|
} : t,
|
|
1676
1681
|
children: ({ getItemProps: e, getToggleButtonProps: t, isOpen: r, selectedItem: i, highlightedIndex: a, setHighlightedIndex: s }) => /* @__PURE__ */ V("div", { children: /* @__PURE__ */ H("div", {
|
|
1677
|
-
onFocus:
|
|
1678
|
-
onBlur:
|
|
1682
|
+
onFocus: U,
|
|
1683
|
+
onBlur: se,
|
|
1679
1684
|
className: f(Z.dropdownInput, { [Z.dropdownInputPlain]: F }, j),
|
|
1680
1685
|
children: [
|
|
1681
1686
|
/* @__PURE__ */ V("button", {
|
|
@@ -1691,8 +1696,8 @@ function Ut({ errorMessage: e = "", className: t = "", label: n = "", value: r =
|
|
|
1691
1696
|
onClick: (e) => {
|
|
1692
1697
|
t().onClick?.(e), v?.(e);
|
|
1693
1698
|
},
|
|
1694
|
-
ref:
|
|
1695
|
-
children:
|
|
1699
|
+
ref: ee,
|
|
1700
|
+
children: de ? "\xA0" : ue
|
|
1696
1701
|
}),
|
|
1697
1702
|
/* @__PURE__ */ V("button", {
|
|
1698
1703
|
type: "button",
|
|
@@ -1723,7 +1728,8 @@ function Ut({ errorMessage: e = "", className: t = "", label: n = "", value: r =
|
|
|
1723
1728
|
}),
|
|
1724
1729
|
className: f(Z.dropdownInputListItem, O, {
|
|
1725
1730
|
[Z.dropdownInputListItemActive]: a === n,
|
|
1726
|
-
[Z.dropdownInputListItemSelected]: i === t
|
|
1731
|
+
[Z.dropdownInputListItemSelected]: i === t,
|
|
1732
|
+
[Z.dropdownInputListItemDisabled]: !!t.disabled
|
|
1727
1733
|
}),
|
|
1728
1734
|
children: t.label
|
|
1729
1735
|
}, t.key))
|
|
@@ -1731,21 +1737,21 @@ function Ut({ errorMessage: e = "", className: t = "", label: n = "", value: r =
|
|
|
1731
1737
|
/* @__PURE__ */ V("fieldset", {
|
|
1732
1738
|
className: f(Z.dropdownFieldset, {
|
|
1733
1739
|
[Z.dropdownBorderPlain]: F,
|
|
1734
|
-
[Z.dropdownBorderFocused]:
|
|
1735
|
-
[Z.dropdownBorderInvalid]:
|
|
1736
|
-
[Z.dropdownBorderError]:
|
|
1740
|
+
[Z.dropdownBorderFocused]: R,
|
|
1741
|
+
[Z.dropdownBorderInvalid]: q,
|
|
1742
|
+
[Z.dropdownBorderError]: q
|
|
1737
1743
|
}),
|
|
1738
1744
|
children: /* @__PURE__ */ V("legend", {
|
|
1739
|
-
className: f(Z.dropdownFieldsetLegend, { [Z.dropdownFieldsetLegendActive]: N && (
|
|
1745
|
+
className: f(Z.dropdownFieldsetLegend, { [Z.dropdownFieldsetLegendActive]: N && (R || !de) }),
|
|
1740
1746
|
children: /* @__PURE__ */ V("span", { children: n })
|
|
1741
1747
|
})
|
|
1742
1748
|
}),
|
|
1743
1749
|
N && n && /* @__PURE__ */ V("div", {
|
|
1744
|
-
className: f(Z.dropdownMatLabel, { [Z.dropdownMatLabelFloating]:
|
|
1750
|
+
className: f(Z.dropdownMatLabel, { [Z.dropdownMatLabelFloating]: R || !de }),
|
|
1745
1751
|
children: n
|
|
1746
1752
|
}),
|
|
1747
1753
|
N && P && /* @__PURE__ */ V("div", {
|
|
1748
|
-
className: f(Z.dropdownPlaceholder,
|
|
1754
|
+
className: f(Z.dropdownPlaceholder, R && !G && Z.dropdownPlaceholderShown),
|
|
1749
1755
|
children: P
|
|
1750
1756
|
})
|
|
1751
1757
|
]
|
|
@@ -1753,7 +1759,7 @@ function Ut({ errorMessage: e = "", className: t = "", label: n = "", value: r =
|
|
|
1753
1759
|
}),
|
|
1754
1760
|
n && !N && /* @__PURE__ */ H("div", {
|
|
1755
1761
|
className: f(Z.dropdownLabelText, A),
|
|
1756
|
-
children: [n,
|
|
1762
|
+
children: [n, ce() ? /* @__PURE__ */ V("div", {
|
|
1757
1763
|
className: Z.requiredMark,
|
|
1758
1764
|
children: "*"
|
|
1759
1765
|
}) : null]
|
|
@@ -1761,7 +1767,7 @@ function Ut({ errorMessage: e = "", className: t = "", label: n = "", value: r =
|
|
|
1761
1767
|
/* @__PURE__ */ V(nt, {
|
|
1762
1768
|
variant: "error",
|
|
1763
1769
|
message: k ? k.getCurrentErrorMessage() : e || "",
|
|
1764
|
-
isVisible:
|
|
1770
|
+
isVisible: q && (R || ne)
|
|
1765
1771
|
})
|
|
1766
1772
|
]
|
|
1767
1773
|
});
|
|
@@ -1784,7 +1790,7 @@ var Wt = {
|
|
|
1784
1790
|
//#endregion
|
|
1785
1791
|
//#region package/common/datePicker/datePicker.tsx
|
|
1786
1792
|
function Gt({ className: e = "", selected: t, onSelect: n = () => null, formValidator: r = null, noInput: i = !1, noHeader: o = !1, isModal: s = !1, isInline: c = !1, onChange: l = () => null, minDate: p = null, maxDate: m = null, children: h = null, showClearButton: g = !1, label: y = "", isValid: b = !0, errorMessage: x = "", isRequired: S = !1, startDate: C, endDate: w }) {
|
|
1787
|
-
let T = () => r ? r.value : t, E = T() ?? /* @__PURE__ */ new Date(), [D, O] = d(E.getMonth() + 1), [k, A] = d(E.getFullYear()), [j, M] = d(!1), [N, P] = d(() => T() ? Nt(E) : ""), [F, I] = d(!1), [
|
|
1793
|
+
let T = () => r ? r.value : t, E = T() ?? /* @__PURE__ */ new Date(), [D, O] = d(E.getMonth() + 1), [k, A] = d(E.getFullYear()), [j, M] = d(!1), [N, P] = d(() => T() ? Nt(E) : ""), [F, I] = d(!1), [ee, L] = d(!1), [, R] = d(0), [te, ne] = d(t), z = u(r);
|
|
1788
1794
|
if (te !== t) {
|
|
1789
1795
|
ne(t);
|
|
1790
1796
|
let e = t ?? /* @__PURE__ */ new Date();
|
|
@@ -1794,42 +1800,42 @@ function Gt({ className: e = "", selected: t, onSelect: n = () => null, formVali
|
|
|
1794
1800
|
if (z.current = r, !r) return;
|
|
1795
1801
|
let e = () => {
|
|
1796
1802
|
let e = r.value;
|
|
1797
|
-
e ? (O(e.getMonth() + 1), A(e.getFullYear()), P(Nt(e))) : P(""),
|
|
1803
|
+
e ? (O(e.getMonth() + 1), A(e.getFullYear()), P(Nt(e))) : P(""), R((e) => e + 1);
|
|
1798
1804
|
};
|
|
1799
1805
|
return r.registerOnUpdateListener(e), () => r.removeOnUpdateListener(e);
|
|
1800
1806
|
}, [r]);
|
|
1801
1807
|
let re = () => r ? r.touched && r.hasError() : !b || !!x, ie = () => !!(S || r?.validators.find((e) => e.validatorId === "required")), ae = (e) => {
|
|
1802
1808
|
P(e ? Nt(e) : ""), r && r.set(e), l(e);
|
|
1803
|
-
},
|
|
1809
|
+
}, U = (e) => {
|
|
1804
1810
|
ae(e), n(e), M(!1);
|
|
1805
|
-
},
|
|
1811
|
+
}, se = (e) => {
|
|
1806
1812
|
O((t) => {
|
|
1807
1813
|
let n = t + e;
|
|
1808
1814
|
return n < 1 ? (n = 12, A((e) => e - 1)) : n > 12 && (n = 1, A((e) => e + 1)), n;
|
|
1809
1815
|
});
|
|
1810
|
-
},
|
|
1816
|
+
}, W = (e) => {
|
|
1811
1817
|
if (e.match(/\d{2}\.\d{2}\.\d{4}/gi)) {
|
|
1812
1818
|
let [t, n, r] = e.split("."), i = Dt(Number(t), Number(n), Number(r));
|
|
1813
1819
|
if (i && i.toString() !== "Invalid Date" && (!m || i <= m) && (!p || i >= p)) return i;
|
|
1814
1820
|
}
|
|
1815
1821
|
return null;
|
|
1816
|
-
},
|
|
1822
|
+
}, ce = ({ previousState: e, nextState: t }) => {
|
|
1817
1823
|
if (!e || t.value === e.value) return t;
|
|
1818
|
-
let n = Pt(t.value, e.value, t.selection ?? null), r =
|
|
1824
|
+
let n = Pt(t.value, e.value, t.selection ?? null), r = W(n.value);
|
|
1819
1825
|
return r && ae(r), n;
|
|
1820
|
-
},
|
|
1826
|
+
}, le = () => {
|
|
1821
1827
|
let e = 400, t = (/* @__PURE__ */ new Date()).getFullYear() - 200;
|
|
1822
1828
|
return p && (t = p.getFullYear()), m && (e = m.getFullYear() - t + 1), Array.from(Array(e).keys()).map((e) => ({
|
|
1823
1829
|
key: e + t,
|
|
1824
1830
|
label: e + t
|
|
1825
1831
|
}));
|
|
1826
|
-
},
|
|
1832
|
+
}, G = T(), K = re(), q = /* @__PURE__ */ H(B, { children: [
|
|
1827
1833
|
o ? null : /* @__PURE__ */ H("div", {
|
|
1828
1834
|
className: Wt.datePickerHeader,
|
|
1829
1835
|
children: [
|
|
1830
1836
|
/* @__PURE__ */ V(Re, {
|
|
1831
1837
|
icon: _,
|
|
1832
|
-
onClick: () =>
|
|
1838
|
+
onClick: () => se(-1)
|
|
1833
1839
|
}),
|
|
1834
1840
|
/* @__PURE__ */ V("div", {
|
|
1835
1841
|
className: Wt.datePickerHeaderMonthAndYearContainer,
|
|
@@ -1852,13 +1858,13 @@ function Gt({ className: e = "", selected: t, onSelect: n = () => null, formVali
|
|
|
1852
1858
|
className: Wt.datePickerHeaderYear,
|
|
1853
1859
|
onChange: (e) => A(e),
|
|
1854
1860
|
value: k,
|
|
1855
|
-
items:
|
|
1861
|
+
items: le()
|
|
1856
1862
|
})]
|
|
1857
1863
|
})
|
|
1858
1864
|
}),
|
|
1859
1865
|
/* @__PURE__ */ V(Re, {
|
|
1860
1866
|
icon: v,
|
|
1861
|
-
onClick: () =>
|
|
1867
|
+
onClick: () => se(1)
|
|
1862
1868
|
})
|
|
1863
1869
|
]
|
|
1864
1870
|
}),
|
|
@@ -1866,18 +1872,18 @@ function Gt({ className: e = "", selected: t, onSelect: n = () => null, formVali
|
|
|
1866
1872
|
className: Wt.datePickerMonth,
|
|
1867
1873
|
month: D,
|
|
1868
1874
|
year: k,
|
|
1869
|
-
onSelect:
|
|
1870
|
-
selectionStart: C ??
|
|
1871
|
-
selectionEnd: w ??
|
|
1875
|
+
onSelect: U,
|
|
1876
|
+
selectionStart: C ?? G,
|
|
1877
|
+
selectionEnd: w ?? G,
|
|
1872
1878
|
minDate: p,
|
|
1873
1879
|
maxDate: m
|
|
1874
1880
|
}),
|
|
1875
1881
|
g && /* @__PURE__ */ V(Me, {
|
|
1876
|
-
onClick: () =>
|
|
1882
|
+
onClick: () => U(null),
|
|
1877
1883
|
children: "Clear"
|
|
1878
1884
|
}),
|
|
1879
1885
|
h
|
|
1880
|
-
] }),
|
|
1886
|
+
] }), ue = i ? null : /* @__PURE__ */ V(rt, {
|
|
1881
1887
|
readOnly: s,
|
|
1882
1888
|
label: `${y}${ie() ? " *" : ""}`,
|
|
1883
1889
|
value: N,
|
|
@@ -1886,37 +1892,37 @@ function Gt({ className: e = "", selected: t, onSelect: n = () => null, formVali
|
|
|
1886
1892
|
customInput: /* @__PURE__ */ V(oe, {
|
|
1887
1893
|
mask: "99.99.9999",
|
|
1888
1894
|
maskPlaceholder: "_",
|
|
1889
|
-
beforeMaskedStateChange:
|
|
1895
|
+
beforeMaskedStateChange: ce
|
|
1890
1896
|
}),
|
|
1891
1897
|
onBlur: () => {
|
|
1892
|
-
z.current && (z.current.touched = !0), I(!1), ae(
|
|
1898
|
+
z.current && (z.current.touched = !0), I(!1), ae(W(N));
|
|
1893
1899
|
},
|
|
1894
1900
|
onFocus: () => I(!0),
|
|
1895
|
-
onMouseEnter: () =>
|
|
1896
|
-
onMouseLeave: () =>
|
|
1897
|
-
isValid: !
|
|
1898
|
-
}),
|
|
1901
|
+
onMouseEnter: () => L(!0),
|
|
1902
|
+
onMouseLeave: () => L(!1),
|
|
1903
|
+
isValid: !K
|
|
1904
|
+
}), de = c ? q : s ? /* @__PURE__ */ V(gt, {
|
|
1899
1905
|
hideHeader: !0,
|
|
1900
1906
|
isOpen: j,
|
|
1901
1907
|
onClose: () => M(!1),
|
|
1902
|
-
children:
|
|
1908
|
+
children: q
|
|
1903
1909
|
}) : /* @__PURE__ */ V(et, {
|
|
1904
1910
|
isOpen: j,
|
|
1905
1911
|
onOpenChange: (e) => M(e),
|
|
1906
|
-
content:
|
|
1912
|
+
content: q,
|
|
1907
1913
|
align: Qe.Left,
|
|
1908
1914
|
dontCloseOnChildClick: !0,
|
|
1909
|
-
children:
|
|
1915
|
+
children: ue
|
|
1910
1916
|
});
|
|
1911
1917
|
return /* @__PURE__ */ H("div", {
|
|
1912
1918
|
className: f(Wt.datePicker, e),
|
|
1913
1919
|
children: [
|
|
1914
|
-
(s || c) &&
|
|
1915
|
-
|
|
1920
|
+
(s || c) && ue,
|
|
1921
|
+
de,
|
|
1916
1922
|
/* @__PURE__ */ V(nt, {
|
|
1917
1923
|
variant: "error",
|
|
1918
1924
|
message: r ? r.getCurrentErrorMessage() : x || "",
|
|
1919
|
-
isVisible:
|
|
1925
|
+
isVisible: K && (F || ee)
|
|
1920
1926
|
})
|
|
1921
1927
|
]
|
|
1922
1928
|
});
|
|
@@ -2230,7 +2236,7 @@ var un = {
|
|
|
2230
2236
|
//#endregion
|
|
2231
2237
|
//#region package/common/kanbanBoard/KanbanItem.tsx
|
|
2232
2238
|
function dn({ id: e, children: t }) {
|
|
2233
|
-
let { attributes: n, listeners: r, setNodeRef: i, transform: a, transition: o, isDragging: s } =
|
|
2239
|
+
let { attributes: n, listeners: r, setNodeRef: i, transform: a, transition: o, isDragging: s } = de({ id: e });
|
|
2234
2240
|
return /* @__PURE__ */ V("div", {
|
|
2235
2241
|
ref: i,
|
|
2236
2242
|
style: {
|
|
@@ -2246,14 +2252,14 @@ function dn({ id: e, children: t }) {
|
|
|
2246
2252
|
//#endregion
|
|
2247
2253
|
//#region package/common/kanbanBoard/KanbanColumn.tsx
|
|
2248
2254
|
function fn({ id: e, title: t, itemIds: n, items: r, renderItem: i, className: a, classNames: o, styles: s }) {
|
|
2249
|
-
let { setNodeRef: c, isOver: l } =
|
|
2255
|
+
let { setNodeRef: c, isOver: l } = le({ id: `column-${e}` });
|
|
2250
2256
|
return /* @__PURE__ */ H("div", {
|
|
2251
2257
|
className: f(un.column, l && un.columnOver, n.length === 0 && un.columnEmpty, a),
|
|
2252
2258
|
children: [/* @__PURE__ */ V("div", {
|
|
2253
2259
|
className: f(un.columnHeader, o?.header),
|
|
2254
2260
|
style: s?.header,
|
|
2255
2261
|
children: t
|
|
2256
|
-
}), /* @__PURE__ */ V(
|
|
2262
|
+
}), /* @__PURE__ */ V(q, {
|
|
2257
2263
|
items: n,
|
|
2258
2264
|
strategy: fe,
|
|
2259
2265
|
children: /* @__PURE__ */ V("div", {
|
|
@@ -2271,7 +2277,7 @@ function fn({ id: e, title: t, itemIds: n, items: r, renderItem: i, className: a
|
|
|
2271
2277
|
//#endregion
|
|
2272
2278
|
//#region package/common/kanbanBoard/KanbanBoard.tsx
|
|
2273
2279
|
function pn({ columns: e, items: t, renderItem: n, onChange: r, className: i, style: a, classNames: o, styles: s }) {
|
|
2274
|
-
let [c, l] = d(null), [u, p] = d(null), m = G(W
|
|
2280
|
+
let [c, l] = d(null), [u, p] = d(null), m = K(G(W, { activationConstraint: { distance: 8 } })), h = u ?? e;
|
|
2275
2281
|
function g(e, t) {
|
|
2276
2282
|
return e.findIndex((e) => e.itemIds.includes(t));
|
|
2277
2283
|
}
|
|
@@ -2303,7 +2309,7 @@ function pn({ columns: e, items: t, renderItem: n, onChange: r, className: i, st
|
|
|
2303
2309
|
let e = n[a], t = e.itemIds.indexOf(r), o = e.itemIds.indexOf(i);
|
|
2304
2310
|
t !== -1 && o !== -1 && t !== o && (n[a] = {
|
|
2305
2311
|
...e,
|
|
2306
|
-
itemIds:
|
|
2312
|
+
itemIds: ue(e.itemIds, t, o)
|
|
2307
2313
|
});
|
|
2308
2314
|
} else {
|
|
2309
2315
|
n[a].itemIds = n[a].itemIds.filter((e) => e !== r);
|
|
@@ -2320,9 +2326,9 @@ function pn({ columns: e, items: t, renderItem: n, onChange: r, className: i, st
|
|
|
2320
2326
|
}
|
|
2321
2327
|
r(u), p(null);
|
|
2322
2328
|
}
|
|
2323
|
-
return /* @__PURE__ */ H(
|
|
2329
|
+
return /* @__PURE__ */ H(U, {
|
|
2324
2330
|
sensors: m,
|
|
2325
|
-
collisionDetection:
|
|
2331
|
+
collisionDetection: ce,
|
|
2326
2332
|
onDragStart: _,
|
|
2327
2333
|
onDragOver: v,
|
|
2328
2334
|
onDragEnd: y,
|
|
@@ -2336,7 +2342,7 @@ function pn({ columns: e, items: t, renderItem: n, onChange: r, className: i, st
|
|
|
2336
2342
|
items: t,
|
|
2337
2343
|
renderItem: n
|
|
2338
2344
|
}, e.id))
|
|
2339
|
-
}), /* @__PURE__ */ V(
|
|
2345
|
+
}), /* @__PURE__ */ V(se, { children: c && t[c] !== void 0 ? /* @__PURE__ */ V("div", {
|
|
2340
2346
|
className: f(un.dragOverlay, o?.dragOverlay),
|
|
2341
2347
|
style: s?.dragOverlay,
|
|
2342
2348
|
children: n(t[c], c)
|
|
@@ -2947,7 +2953,7 @@ function tr({ className: e }) {
|
|
|
2947
2953
|
let [t, n] = d([]), [r, i] = d([]), [o, c] = d("rect"), [l, m] = d(null), [g, _] = d(null), [v, y] = d(null), [b, x] = d(null), [S, E] = d([]), [D, O] = d(null), [k, j] = d(1), [P, F] = d({
|
|
2948
2954
|
x: 0,
|
|
2949
2955
|
y: 0
|
|
2950
|
-
}), I = u(null),
|
|
2956
|
+
}), I = u(null), ee = u(null), te = u(null), z = u(null), re = u(null), ie = u({
|
|
2951
2957
|
rooms: t,
|
|
2952
2958
|
doors: r,
|
|
2953
2959
|
tool: o,
|
|
@@ -3039,10 +3045,10 @@ function tr({ className: e }) {
|
|
|
3039
3045
|
y: a - 300 / r / 2
|
|
3040
3046
|
}), j(r);
|
|
3041
3047
|
}
|
|
3042
|
-
function
|
|
3048
|
+
function U(e) {
|
|
3043
3049
|
return z.current ? jn(e.clientX, e.clientY, z.current) : null;
|
|
3044
3050
|
}
|
|
3045
|
-
function
|
|
3051
|
+
function se(e, t) {
|
|
3046
3052
|
let n = null;
|
|
3047
3053
|
for (let r = 0; r < t.points.length; r++) {
|
|
3048
3054
|
let i = Mn(e, t.points[r]);
|
|
@@ -3053,7 +3059,7 @@ function tr({ className: e }) {
|
|
|
3053
3059
|
}
|
|
3054
3060
|
return n;
|
|
3055
3061
|
}
|
|
3056
|
-
function
|
|
3062
|
+
function W(e, t) {
|
|
3057
3063
|
let n = null;
|
|
3058
3064
|
for (let r = 0; r < t.points.length; r++) {
|
|
3059
3065
|
let i = t.points[r], a = t.points[(r + 1) % t.points.length], { dist: o, t: s } = Nn(e, i, a);
|
|
@@ -3065,7 +3071,7 @@ function tr({ className: e }) {
|
|
|
3065
3071
|
}
|
|
3066
3072
|
return n;
|
|
3067
3073
|
}
|
|
3068
|
-
function
|
|
3074
|
+
function ce(e, t, r, a) {
|
|
3069
3075
|
return n((n) => n.map((n) => {
|
|
3070
3076
|
if (n.id !== e) return n;
|
|
3071
3077
|
let r = [...n.points];
|
|
@@ -3085,7 +3091,7 @@ function tr({ className: e }) {
|
|
|
3085
3091
|
wallIndex: n.wallIndex + 1
|
|
3086
3092
|
} : n : n)), t + 1;
|
|
3087
3093
|
}
|
|
3088
|
-
function
|
|
3094
|
+
function le(e, r) {
|
|
3089
3095
|
let a = t.find((t) => t.id === e);
|
|
3090
3096
|
if (!a || a.points.length <= 3) return;
|
|
3091
3097
|
let o = a.points.length;
|
|
@@ -3104,7 +3110,7 @@ function tr({ className: e }) {
|
|
|
3104
3110
|
} : t;
|
|
3105
3111
|
}).filter((e) => e.wallIndex !== -1));
|
|
3106
3112
|
}
|
|
3107
|
-
function
|
|
3113
|
+
function G(e) {
|
|
3108
3114
|
if (e.button === 1) {
|
|
3109
3115
|
e.preventDefault();
|
|
3110
3116
|
let t = z.current;
|
|
@@ -3124,7 +3130,7 @@ function tr({ className: e }) {
|
|
|
3124
3130
|
}
|
|
3125
3131
|
if (e.button !== 0) return;
|
|
3126
3132
|
e.preventDefault();
|
|
3127
|
-
let n =
|
|
3133
|
+
let n = U(e);
|
|
3128
3134
|
if (n) {
|
|
3129
3135
|
if (g) {
|
|
3130
3136
|
let e = t.find((e) => e.id === g);
|
|
@@ -3151,7 +3157,7 @@ function tr({ className: e }) {
|
|
|
3151
3157
|
if (o === "select") {
|
|
3152
3158
|
let e = t.find((e) => e.id === l) ?? null;
|
|
3153
3159
|
if (e) {
|
|
3154
|
-
let t =
|
|
3160
|
+
let t = se(n, e);
|
|
3155
3161
|
if (t) {
|
|
3156
3162
|
I.current = {
|
|
3157
3163
|
type: "vertex",
|
|
@@ -3164,12 +3170,12 @@ function tr({ className: e }) {
|
|
|
3164
3170
|
}
|
|
3165
3171
|
}
|
|
3166
3172
|
if (e) {
|
|
3167
|
-
let t =
|
|
3173
|
+
let t = W(n, e);
|
|
3168
3174
|
if (t) {
|
|
3169
3175
|
let r = e.points[t.index], i = e.points[(t.index + 1) % e.points.length], a = An({
|
|
3170
3176
|
x: r.x + (i.x - r.x) * t.t,
|
|
3171
3177
|
y: r.y + (i.y - r.y) * t.t
|
|
3172
|
-
}), o =
|
|
3178
|
+
}), o = ce(e.id, t.index, t.t, a);
|
|
3173
3179
|
I.current = {
|
|
3174
3180
|
type: "vertex",
|
|
3175
3181
|
roomId: e.id,
|
|
@@ -3194,16 +3200,16 @@ function tr({ className: e }) {
|
|
|
3194
3200
|
}
|
|
3195
3201
|
}
|
|
3196
3202
|
}
|
|
3197
|
-
function
|
|
3203
|
+
function K(e) {
|
|
3198
3204
|
if (o !== "select" || g) return;
|
|
3199
|
-
let n =
|
|
3205
|
+
let n = U(e);
|
|
3200
3206
|
if (!n) return;
|
|
3201
3207
|
let r = t.find((e) => e.id === l);
|
|
3202
3208
|
if (!r) return;
|
|
3203
|
-
let i =
|
|
3204
|
-
i && (e.preventDefault(),
|
|
3209
|
+
let i = se(n, r);
|
|
3210
|
+
i && (e.preventDefault(), le(r.id, i.index));
|
|
3205
3211
|
}
|
|
3206
|
-
function
|
|
3212
|
+
function q(e) {
|
|
3207
3213
|
if (te.current) {
|
|
3208
3214
|
let { startClient: t, origPan: n, scaleX: r, scaleY: i } = te.current;
|
|
3209
3215
|
F({
|
|
@@ -3212,13 +3218,13 @@ function tr({ className: e }) {
|
|
|
3212
3218
|
});
|
|
3213
3219
|
return;
|
|
3214
3220
|
}
|
|
3215
|
-
let r =
|
|
3221
|
+
let r = U(e);
|
|
3216
3222
|
if (r) {
|
|
3217
|
-
if (
|
|
3223
|
+
if (ee.current && g) {
|
|
3218
3224
|
let e = t.find((e) => e.id === g);
|
|
3219
3225
|
if (e) {
|
|
3220
3226
|
let t = Pn(r, [e]);
|
|
3221
|
-
t && i((e) => e.map((e) => e.id ===
|
|
3227
|
+
t && i((e) => e.map((e) => e.id === ee.current ? {
|
|
3222
3228
|
...e,
|
|
3223
3229
|
wallIndex: t.wallIndex,
|
|
3224
3230
|
t: t.t
|
|
@@ -3262,12 +3268,12 @@ function tr({ className: e }) {
|
|
|
3262
3268
|
}
|
|
3263
3269
|
}
|
|
3264
3270
|
}
|
|
3265
|
-
function
|
|
3271
|
+
function ue(e) {
|
|
3266
3272
|
if (te.current) {
|
|
3267
3273
|
te.current = null;
|
|
3268
3274
|
return;
|
|
3269
3275
|
}
|
|
3270
|
-
let t =
|
|
3276
|
+
let t = U(e);
|
|
3271
3277
|
if (t) {
|
|
3272
3278
|
if (o === "rect" && v) {
|
|
3273
3279
|
let e = Math.min(v.x, t.x), r = Math.min(v.y, t.y), i = Math.abs(t.x - v.x), a = Math.abs(t.y - v.y);
|
|
@@ -3277,10 +3283,10 @@ function tr({ className: e }) {
|
|
|
3277
3283
|
points: Ln(e, r, i, a)
|
|
3278
3284
|
}]), y(null), x(null);
|
|
3279
3285
|
}
|
|
3280
|
-
|
|
3286
|
+
ee.current = null, I.current = null;
|
|
3281
3287
|
}
|
|
3282
3288
|
}
|
|
3283
|
-
function
|
|
3289
|
+
function de(e) {
|
|
3284
3290
|
l && n((t) => t.map((t) => t.id === l ? {
|
|
3285
3291
|
...t,
|
|
3286
3292
|
name: e
|
|
@@ -3333,7 +3339,7 @@ function tr({ className: e }) {
|
|
|
3333
3339
|
},
|
|
3334
3340
|
{
|
|
3335
3341
|
t: "rect",
|
|
3336
|
-
icon:
|
|
3342
|
+
icon: L,
|
|
3337
3343
|
label: "Rectangle room"
|
|
3338
3344
|
},
|
|
3339
3345
|
{
|
|
@@ -3407,10 +3413,10 @@ function tr({ className: e }) {
|
|
|
3407
3413
|
ref: z,
|
|
3408
3414
|
className: f(Q.roomDrawerCanvas, Ce),
|
|
3409
3415
|
viewBox: `${P.x} ${P.y} ${J} ${Se}`,
|
|
3410
|
-
onMouseDown:
|
|
3411
|
-
onMouseMove:
|
|
3412
|
-
onMouseUp:
|
|
3413
|
-
onDoubleClick:
|
|
3416
|
+
onMouseDown: G,
|
|
3417
|
+
onMouseMove: q,
|
|
3418
|
+
onMouseUp: ue,
|
|
3419
|
+
onDoubleClick: K,
|
|
3414
3420
|
children: [
|
|
3415
3421
|
/* @__PURE__ */ V("defs", { children: /* @__PURE__ */ V("pattern", {
|
|
3416
3422
|
id: "rd-grid",
|
|
@@ -3478,7 +3484,7 @@ function tr({ className: e }) {
|
|
|
3478
3484
|
r: 2.5,
|
|
3479
3485
|
className: Q.doorMarker,
|
|
3480
3486
|
onMouseDown: (t) => {
|
|
3481
|
-
t.button === 0 && (t.preventDefault(), t.stopPropagation(),
|
|
3487
|
+
t.button === 0 && (t.preventDefault(), t.stopPropagation(), ee.current = e.id);
|
|
3482
3488
|
}
|
|
3483
3489
|
}, e.id);
|
|
3484
3490
|
}),
|
|
@@ -3525,7 +3531,7 @@ function tr({ className: e }) {
|
|
|
3525
3531
|
/* @__PURE__ */ V("input", {
|
|
3526
3532
|
className: Q.roomDrawerInfoInput,
|
|
3527
3533
|
value: ve.name,
|
|
3528
|
-
onChange: (e) =>
|
|
3534
|
+
onChange: (e) => de(e.target.value),
|
|
3529
3535
|
placeholder: "Room name"
|
|
3530
3536
|
}),
|
|
3531
3537
|
/* @__PURE__ */ H("button", {
|
|
@@ -3538,7 +3544,7 @@ function tr({ className: e }) {
|
|
|
3538
3544
|
className: Q.roomDrawerInfoDelete,
|
|
3539
3545
|
onClick: pe,
|
|
3540
3546
|
title: "Delete room",
|
|
3541
|
-
children: /* @__PURE__ */ V(p, { icon:
|
|
3547
|
+
children: /* @__PURE__ */ V(p, { icon: R })
|
|
3542
3548
|
})
|
|
3543
3549
|
]
|
|
3544
3550
|
}),
|
|
@@ -3589,7 +3595,7 @@ function tr({ className: e }) {
|
|
|
3589
3595
|
className: Q.roomDrawerInfoDelete,
|
|
3590
3596
|
onClick: () => me(e.id),
|
|
3591
3597
|
title: "Delete door",
|
|
3592
|
-
children: /* @__PURE__ */ V(p, { icon:
|
|
3598
|
+
children: /* @__PURE__ */ V(p, { icon: R })
|
|
3593
3599
|
})
|
|
3594
3600
|
]
|
|
3595
3601
|
}, e.id))]
|
|
@@ -4337,6 +4343,8 @@ var $ = {
|
|
|
4337
4343
|
virtualListRow: "virtualList-row_TTY50",
|
|
4338
4344
|
"virtualList-row-no-divider": "virtualList-row-no-divider_Ct0gV",
|
|
4339
4345
|
virtualListRowNoDivider: "virtualList-row-no-divider_Ct0gV",
|
|
4346
|
+
"virtualList-row-no-hover": "virtualList-row-no-hover_2d3mH",
|
|
4347
|
+
virtualListRowNoHover: "virtualList-row-no-hover_2d3mH",
|
|
4340
4348
|
"virtualList-row-selected": "virtualList-row-selected_hwEN-",
|
|
4341
4349
|
virtualListRowSelected: "virtualList-row-selected_hwEN-",
|
|
4342
4350
|
"virtualList-row-draggable": "virtualList-row-draggable_I86ha",
|
|
@@ -4364,15 +4372,15 @@ var $ = {
|
|
|
4364
4372
|
};
|
|
4365
4373
|
//#endregion
|
|
4366
4374
|
//#region package/common/virtualList/virtualRow.tsx
|
|
4367
|
-
function Ir({ index: e, top: t, columnTemplate: n, isSelected: r, showDivider: i,
|
|
4368
|
-
let
|
|
4375
|
+
function Ir({ index: e, top: t, columnTemplate: n, isSelected: r, showDivider: i, hover: a, onClick: o, observer: c, ariaRowIndex: l, ariaPosInSet: d, ariaSetSize: p, rowRole: m, reorderable: h, draggable: g, isDragging: _, reserveToggleGutter: v, onMouseDown: y, onDragStart: b, onDragOver: x, onDragEnd: S, onDrop: C, onTouchStart: w, dropPosition: T, dropIndentPx: E, dropIndicatorClassName: D, dropIndicatorStyle: O, rowClassName: k, rowStyle: A, children: j }) {
|
|
4376
|
+
let M = u(null);
|
|
4369
4377
|
return s(() => {
|
|
4370
|
-
let e =
|
|
4371
|
-
if (!(!e || !
|
|
4372
|
-
}, [
|
|
4373
|
-
ref:
|
|
4378
|
+
let e = M.current;
|
|
4379
|
+
if (!(!e || !c)) return c.observe(e), () => c.unobserve(e);
|
|
4380
|
+
}, [c]), /* @__PURE__ */ H("div", {
|
|
4381
|
+
ref: M,
|
|
4374
4382
|
"data-index": e,
|
|
4375
|
-
className: f($.virtualListRow, r && $.virtualListRowSelected, !i && $.virtualListRowNoDivider,
|
|
4383
|
+
className: f($.virtualListRow, r && $.virtualListRowSelected, !i && $.virtualListRowNoDivider, !a && $.virtualListRowNoHover, h && $.virtualListRowDraggable, _ && $.virtualListRowDragging, T === "inside" && $.virtualListRowDropInside, k),
|
|
4376
4384
|
style: {
|
|
4377
4385
|
position: "absolute",
|
|
4378
4386
|
top: 0,
|
|
@@ -4383,32 +4391,32 @@ function Ir({ index: e, top: t, columnTemplate: n, isSelected: r, showDivider: i
|
|
|
4383
4391
|
display: "grid",
|
|
4384
4392
|
gridTemplateColumns: n
|
|
4385
4393
|
} : {},
|
|
4386
|
-
...
|
|
4387
|
-
...
|
|
4394
|
+
...v ? { paddingRight: 32 } : {},
|
|
4395
|
+
...A
|
|
4388
4396
|
},
|
|
4389
|
-
onClick:
|
|
4390
|
-
draggable:
|
|
4391
|
-
onMouseDown:
|
|
4392
|
-
onDragStart:
|
|
4393
|
-
onDragOver:
|
|
4394
|
-
onDragEnd:
|
|
4395
|
-
onDrop:
|
|
4396
|
-
onTouchStart:
|
|
4397
|
-
onContextMenu:
|
|
4397
|
+
onClick: o,
|
|
4398
|
+
draggable: g,
|
|
4399
|
+
onMouseDown: y,
|
|
4400
|
+
onDragStart: b,
|
|
4401
|
+
onDragOver: x,
|
|
4402
|
+
onDragEnd: S,
|
|
4403
|
+
onDrop: C ?? (g ? (e) => e.preventDefault() : void 0),
|
|
4404
|
+
onTouchStart: w,
|
|
4405
|
+
onContextMenu: g ? (e) => e.preventDefault() : void 0,
|
|
4398
4406
|
"aria-selected": r,
|
|
4399
|
-
"aria-rowindex":
|
|
4400
|
-
"aria-posinset":
|
|
4401
|
-
"aria-setsize":
|
|
4402
|
-
role:
|
|
4403
|
-
children: [(
|
|
4404
|
-
"data-drop-line":
|
|
4407
|
+
"aria-rowindex": l,
|
|
4408
|
+
"aria-posinset": d,
|
|
4409
|
+
"aria-setsize": p,
|
|
4410
|
+
role: m,
|
|
4411
|
+
children: [(T === "before" || T === "after") && /* @__PURE__ */ V("div", {
|
|
4412
|
+
"data-drop-line": T,
|
|
4405
4413
|
"aria-hidden": !0,
|
|
4406
|
-
className: f($.virtualListDropLine,
|
|
4414
|
+
className: f($.virtualListDropLine, T === "before" ? $.virtualListDropLineBefore : $.virtualListDropLineAfter, D),
|
|
4407
4415
|
style: {
|
|
4408
|
-
left:
|
|
4409
|
-
...
|
|
4416
|
+
left: E ?? 0,
|
|
4417
|
+
...O
|
|
4410
4418
|
}
|
|
4411
|
-
}),
|
|
4419
|
+
}), j]
|
|
4412
4420
|
});
|
|
4413
4421
|
}
|
|
4414
4422
|
//#endregion
|
|
@@ -4726,7 +4734,7 @@ function Yr({ columns: e, items: t, multiSelect: n, visibleColumnKeys: r, onVisi
|
|
|
4726
4734
|
//#endregion
|
|
4727
4735
|
//#region package/common/virtualList/useRowDrag.ts
|
|
4728
4736
|
function Xr({ reorderable: e, treeReorder: t, onReorder: n, onTreeDrop: r, longPressDelay: o, dragHandle: c, treeIndentPx: l, keys: f, depths: p, isGroupAt: m, rootRef: h, keysRef: g }) {
|
|
4729
|
-
let _ = u(null), [v, y] = d(null), [b, x] = d(null), S = u(null), C = u(n), w = u(r), T = u(t), E = u(p), D = u(m), O = u(!0), k = u(null), A = u(!1), j = u(null), M = u(0), N = u(0), P = u(null), F = u(!1), I = u(null),
|
|
4737
|
+
let _ = u(null), [v, y] = d(null), [b, x] = d(null), S = u(null), C = u(n), w = u(r), T = u(t), E = u(p), D = u(m), O = u(!0), k = u(null), A = u(!1), j = u(null), M = u(0), N = u(0), P = u(null), F = u(!1), I = u(null), ee = u(0), L = u(0), R = u(0), [te] = d(() => typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(pointer: coarse)").matches : !1);
|
|
4730
4738
|
s(() => {
|
|
4731
4739
|
C.current = n, w.current = r, T.current = t, E.current = p, S.current = b, D.current = m;
|
|
4732
4740
|
});
|
|
@@ -4776,10 +4784,10 @@ function Xr({ reorderable: e, treeReorder: t, onReorder: n, onTreeDrop: r, longP
|
|
|
4776
4784
|
function oe() {
|
|
4777
4785
|
_.current = null, y(null);
|
|
4778
4786
|
}
|
|
4779
|
-
let
|
|
4787
|
+
let U = i((e) => {
|
|
4780
4788
|
let t = _.current, n = h.current;
|
|
4781
4789
|
if (t == null || !n) return;
|
|
4782
|
-
let r = I.current ? N.current -
|
|
4790
|
+
let r = I.current ? N.current - ee.current + R.current / 2 : N.current, i = document.elementFromPoint(e, r), a = i && n.contains(i) ? i.closest("[data-index]") : null;
|
|
4783
4791
|
if (!a) return;
|
|
4784
4792
|
let o = Number(a.dataset.index);
|
|
4785
4793
|
if (Number.isNaN(o)) return;
|
|
@@ -4799,26 +4807,26 @@ function Xr({ reorderable: e, treeReorder: t, onReorder: n, onTreeDrop: r, longP
|
|
|
4799
4807
|
}
|
|
4800
4808
|
let l = Br(s, o, r, c.top, c.height);
|
|
4801
4809
|
l != null && C.current?.(s, l);
|
|
4802
|
-
}, [h, g]),
|
|
4810
|
+
}, [h, g]), se = i(() => {
|
|
4803
4811
|
let e = I.current;
|
|
4804
|
-
e && (e.style.transform = `translate(${
|
|
4805
|
-
}, []),
|
|
4812
|
+
e && (e.style.transform = `translate(${L.current}px, ${N.current - ee.current}px)`);
|
|
4813
|
+
}, []), W = i(() => {
|
|
4806
4814
|
let e = h.current;
|
|
4807
4815
|
if (!e || !A.current) {
|
|
4808
4816
|
P.current = null;
|
|
4809
4817
|
return;
|
|
4810
4818
|
}
|
|
4811
4819
|
let t = e.getBoundingClientRect(), n = M.current, r = N.current, i = 0;
|
|
4812
|
-
n >= t.left && n <= t.right && r >= t.top && r <= t.bottom && (r < t.top + 48 ? i = -Math.min(18, Math.ceil((t.top + 48 - r) / 3)) : r > t.bottom - 48 && (i = Math.min(18, Math.ceil((r - (t.bottom - 48)) / 3)))), i !== 0 && (e.scrollTop += i,
|
|
4813
|
-
}, [
|
|
4814
|
-
if (k.current != null && (clearTimeout(k.current), k.current = null), window.removeEventListener("touchmove",
|
|
4820
|
+
n >= t.left && n <= t.right && r >= t.top && r <= t.bottom && (r < t.top + 48 ? i = -Math.min(18, Math.ceil((t.top + 48 - r) / 3)) : r > t.bottom - 48 && (i = Math.min(18, Math.ceil((r - (t.bottom - 48)) / 3)))), i !== 0 && (e.scrollTop += i, U(n)), P.current = requestAnimationFrame(W);
|
|
4821
|
+
}, [U, h]), ce = i(() => {
|
|
4822
|
+
if (k.current != null && (clearTimeout(k.current), k.current = null), window.removeEventListener("touchmove", le), window.removeEventListener("touchend", ce), window.removeEventListener("touchcancel", ce), P.current != null && (cancelAnimationFrame(P.current), P.current = null), I.current &&= (I.current.remove(), null), document.body.style.touchAction = "", document.body.style.overscrollBehavior = "", A.current && (F.current = !0, setTimeout(() => {
|
|
4815
4823
|
F.current = !1;
|
|
4816
4824
|
}, 350), T.current)) {
|
|
4817
4825
|
let e = _.current, t = S.current;
|
|
4818
4826
|
e != null && t && t.key !== e && w.current?.(e, t);
|
|
4819
4827
|
}
|
|
4820
4828
|
x(null), A.current = !1, j.current = null, _.current = null, y(null);
|
|
4821
|
-
}, []),
|
|
4829
|
+
}, []), le = i((e) => {
|
|
4822
4830
|
let t = e.touches[0];
|
|
4823
4831
|
if (t) {
|
|
4824
4832
|
if (M.current = t.clientX, N.current = t.clientY, !A.current) {
|
|
@@ -4826,23 +4834,23 @@ function Xr({ reorderable: e, treeReorder: t, onReorder: n, onTreeDrop: r, longP
|
|
|
4826
4834
|
e != null && Math.abs(t.clientY - e) > 10 && k.current != null && (clearTimeout(k.current), k.current = null);
|
|
4827
4835
|
return;
|
|
4828
4836
|
}
|
|
4829
|
-
e.cancelable && e.preventDefault(),
|
|
4837
|
+
e.cancelable && e.preventDefault(), se(), U(t.clientX);
|
|
4830
4838
|
}
|
|
4831
|
-
}, [
|
|
4832
|
-
function
|
|
4839
|
+
}, [U, se]);
|
|
4840
|
+
function G(n, r) {
|
|
4833
4841
|
if (!e && !t || c && !r.target.closest("[data-drag-handle]") || k.current != null || A.current) return;
|
|
4834
4842
|
let i = r.touches[0];
|
|
4835
|
-
i && (j.current = i.clientY, M.current = i.clientX, N.current = i.clientY, window.addEventListener("touchmove",
|
|
4836
|
-
k.current = null, A.current = !0, _.current = n, y(n), navigator.vibrate?.(10), document.body.style.touchAction = "none", document.body.style.overscrollBehavior = "none",
|
|
4843
|
+
i && (j.current = i.clientY, M.current = i.clientX, N.current = i.clientY, window.addEventListener("touchmove", le, { passive: !1 }), window.addEventListener("touchend", ce), window.addEventListener("touchcancel", ce), k.current = window.setTimeout(() => {
|
|
4844
|
+
k.current = null, A.current = !0, _.current = n, y(n), navigator.vibrate?.(10), document.body.style.touchAction = "none", document.body.style.overscrollBehavior = "none", K(n), P.current ??= requestAnimationFrame(W);
|
|
4837
4845
|
}, o));
|
|
4838
4846
|
}
|
|
4839
|
-
function
|
|
4847
|
+
function K(e) {
|
|
4840
4848
|
let t = h.current;
|
|
4841
4849
|
if (!t) return;
|
|
4842
4850
|
let n = g.current.indexOf(e), r = t.querySelector(`[data-index="${n}"]`);
|
|
4843
4851
|
if (!r) return;
|
|
4844
4852
|
let i = r.getBoundingClientRect();
|
|
4845
|
-
|
|
4853
|
+
ee.current = N.current - i.top, L.current = i.left, R.current = i.height;
|
|
4846
4854
|
let a = r.cloneNode(!0);
|
|
4847
4855
|
a.removeAttribute("data-index"), a.setAttribute("data-drag-clone", "true"), a.setAttribute("aria-hidden", "true"), a.classList.add($.virtualListDragClone), Object.assign(a.style, {
|
|
4848
4856
|
position: "fixed",
|
|
@@ -4857,56 +4865,56 @@ function Xr({ reorderable: e, treeReorder: t, onReorder: n, onTreeDrop: r, longP
|
|
|
4857
4865
|
background: "var(--background)",
|
|
4858
4866
|
boxShadow: "var(--card-shadow)",
|
|
4859
4867
|
borderRadius: "var(--default-border-radius)"
|
|
4860
|
-
}), t.appendChild(a), I.current = a,
|
|
4868
|
+
}), t.appendChild(a), I.current = a, se();
|
|
4861
4869
|
}
|
|
4862
|
-
a(() =>
|
|
4863
|
-
let
|
|
4864
|
-
function
|
|
4870
|
+
a(() => ce, [ce]);
|
|
4871
|
+
let q = e || t;
|
|
4872
|
+
function ue(n, r) {
|
|
4865
4873
|
let i = t && b?.key === r ? b.position : void 0;
|
|
4866
4874
|
return {
|
|
4867
|
-
reorderable:
|
|
4868
|
-
draggable:
|
|
4869
|
-
isDragging:
|
|
4870
|
-
onMouseDown:
|
|
4871
|
-
onDragStart:
|
|
4875
|
+
reorderable: q,
|
|
4876
|
+
draggable: q && !te || void 0,
|
|
4877
|
+
isDragging: q && r === v,
|
|
4878
|
+
onMouseDown: q && c ? ne : void 0,
|
|
4879
|
+
onDragStart: q ? (e) => z(r, e) : void 0,
|
|
4872
4880
|
onDragOver: t ? (e) => B(n, e) : e ? (e) => ae(n, e) : void 0,
|
|
4873
4881
|
onDragEnd: t ? ie : e ? oe : void 0,
|
|
4874
4882
|
onDrop: t ? H : void 0,
|
|
4875
|
-
onTouchStart:
|
|
4883
|
+
onTouchStart: q ? (e) => G(r, e) : void 0,
|
|
4876
4884
|
dropPosition: i,
|
|
4877
4885
|
dropIndentPx: i ? (p[n] ?? 0) * l : void 0
|
|
4878
4886
|
};
|
|
4879
4887
|
}
|
|
4880
|
-
function
|
|
4888
|
+
function de() {
|
|
4881
4889
|
return F.current ? (F.current = !1, !0) : !1;
|
|
4882
4890
|
}
|
|
4883
4891
|
return {
|
|
4884
4892
|
draggingKey: v,
|
|
4885
|
-
dragEnabled:
|
|
4886
|
-
getRowDragProps:
|
|
4887
|
-
consumeSuppressedClick:
|
|
4893
|
+
dragEnabled: q,
|
|
4894
|
+
getRowDragProps: ue,
|
|
4895
|
+
consumeSuppressedClick: de
|
|
4888
4896
|
};
|
|
4889
4897
|
}
|
|
4890
4898
|
//#endregion
|
|
4891
4899
|
//#region package/common/virtualList/virtualList.tsx
|
|
4892
|
-
function Zr({ items: e, renderRow: t, columns: n, height: r = "100%", estimatedRowHeight: a = 40, overscan: o = 3, rowGap: s = 0, selectedKey: l, getItemKey: u, onRowClick: d, visibleColumnKeys: m, onVisibleColumnsChange: h, persistColumnsKey: g, showColumnToggle: _, onLoadMore: v, loadMoreThreshold: y = 100, isLoading: b = !1, multiSelect: x = !1, selectedKeys: S, onSelectionChange: C, reorderable: w = !1, onReorder: T, longPressDelay: E = 400, treeReorder: D = !1, getItemDepth: O, isGroup: A, onTreeDrop: j, treeIndentPx: M = 24, dragHandle: N = !1, showDivider: P = !0,
|
|
4893
|
-
let
|
|
4900
|
+
function Zr({ items: e, renderRow: t, columns: n, height: r = "100%", estimatedRowHeight: a = 40, overscan: o = 3, rowGap: s = 0, selectedKey: l, getItemKey: u, onRowClick: d, visibleColumnKeys: m, onVisibleColumnsChange: h, persistColumnsKey: g, showColumnToggle: _, onLoadMore: v, loadMoreThreshold: y = 100, isLoading: b = !1, multiSelect: x = !1, selectedKeys: S, onSelectionChange: C, reorderable: w = !1, onReorder: T, longPressDelay: E = 400, treeReorder: D = !1, getItemDepth: O, isGroup: A, onTreeDrop: j, treeIndentPx: M = 24, dragHandle: N = !1, showDivider: P = !0, rowHover: F = !0, className: I, style: ee, classNames: L, styles: R, ...te }, ne) {
|
|
4901
|
+
let z = i((e, t) => u ? u(e, t) : t, [u]), re = c(() => e.map((e, t) => z(e, t)), [e, z]), ie = c(() => O ? e.map((e, t) => O(e, t)) : [], [e, O]), ae = i((t) => A ? A(e[t], t) : !1, [A, e]), oe = qr({
|
|
4894
4902
|
items: e,
|
|
4895
|
-
keys:
|
|
4903
|
+
keys: re,
|
|
4896
4904
|
getItemKey: u,
|
|
4897
4905
|
estimatedRowHeight: a,
|
|
4898
4906
|
rowGap: s,
|
|
4899
4907
|
overscan: o,
|
|
4900
4908
|
onLoadMore: v,
|
|
4901
4909
|
loadMoreThreshold: y,
|
|
4902
|
-
forwardedRef:
|
|
4903
|
-
}), { rootRef:
|
|
4910
|
+
forwardedRef: ne
|
|
4911
|
+
}), { rootRef: U, headerRef: se, rowObserver: W, keysRef: ce, offsets: le, totalHeight: G, startIndex: K, endIndex: q } = oe, ue = Jr({
|
|
4904
4912
|
items: e,
|
|
4905
|
-
getKey:
|
|
4913
|
+
getKey: z,
|
|
4906
4914
|
multiSelect: x,
|
|
4907
4915
|
selectedKeys: S,
|
|
4908
4916
|
onSelectionChange: C
|
|
4909
|
-
}), { effectiveSelectedKeys: de } =
|
|
4917
|
+
}), { effectiveSelectedKeys: de } = ue, { hasColumns: fe, visibleColumns: pe, columnTemplate: me, shouldShowToggle: he, effectiveVisible: ge, manuallyHiddenCount: _e, toggleOpen: ve, setToggleOpen: ye, toggleRef: be, handleToggleColumn: xe } = Yr({
|
|
4910
4918
|
columns: n,
|
|
4911
4919
|
items: e,
|
|
4912
4920
|
multiSelect: x,
|
|
@@ -4914,11 +4922,11 @@ function Zr({ items: e, renderRow: t, columns: n, height: r = "100%", estimatedR
|
|
|
4914
4922
|
onVisibleColumnsChange: h,
|
|
4915
4923
|
persistColumnsKey: g,
|
|
4916
4924
|
showColumnToggle: _,
|
|
4917
|
-
rootRef:
|
|
4918
|
-
startIndex:
|
|
4919
|
-
endIndex:
|
|
4920
|
-
containerHeight:
|
|
4921
|
-
}),
|
|
4925
|
+
rootRef: U,
|
|
4926
|
+
startIndex: K,
|
|
4927
|
+
endIndex: q,
|
|
4928
|
+
containerHeight: oe.containerHeight
|
|
4929
|
+
}), J = Xr({
|
|
4922
4930
|
reorderable: w,
|
|
4923
4931
|
treeReorder: D,
|
|
4924
4932
|
onReorder: T,
|
|
@@ -4926,44 +4934,45 @@ function Zr({ items: e, renderRow: t, columns: n, height: r = "100%", estimatedR
|
|
|
4926
4934
|
longPressDelay: E,
|
|
4927
4935
|
dragHandle: N,
|
|
4928
4936
|
treeIndentPx: M,
|
|
4929
|
-
keys:
|
|
4930
|
-
depths:
|
|
4931
|
-
isGroupAt:
|
|
4932
|
-
rootRef:
|
|
4933
|
-
keysRef:
|
|
4934
|
-
}),
|
|
4935
|
-
let r = e[n], i =
|
|
4937
|
+
keys: re,
|
|
4938
|
+
depths: ie,
|
|
4939
|
+
isGroupAt: ae,
|
|
4940
|
+
rootRef: U,
|
|
4941
|
+
keysRef: ce
|
|
4942
|
+
}), Se = (n) => {
|
|
4943
|
+
let r = e[n], i = z(r, n), a = l != null && i === l || de.has(i), o = J.getRowDragProps(n, i);
|
|
4936
4944
|
return /* @__PURE__ */ V(Ir, {
|
|
4937
4945
|
index: n,
|
|
4938
4946
|
top: le[n],
|
|
4939
|
-
columnTemplate:
|
|
4947
|
+
columnTemplate: me,
|
|
4940
4948
|
isSelected: a,
|
|
4941
4949
|
showDivider: P,
|
|
4950
|
+
hover: F,
|
|
4942
4951
|
onClick: () => {
|
|
4943
|
-
|
|
4952
|
+
J.consumeSuppressedClick() || d?.(r, n);
|
|
4944
4953
|
},
|
|
4945
|
-
observer:
|
|
4946
|
-
ariaRowIndex:
|
|
4947
|
-
ariaPosInSet:
|
|
4948
|
-
ariaSetSize:
|
|
4949
|
-
rowRole:
|
|
4950
|
-
reserveToggleGutter:
|
|
4954
|
+
observer: W,
|
|
4955
|
+
ariaRowIndex: fe ? n + 2 : void 0,
|
|
4956
|
+
ariaPosInSet: fe ? void 0 : n + 1,
|
|
4957
|
+
ariaSetSize: fe ? void 0 : e.length,
|
|
4958
|
+
rowRole: fe ? "row" : "listitem",
|
|
4959
|
+
reserveToggleGutter: he,
|
|
4951
4960
|
...o,
|
|
4952
4961
|
dropIndicatorClassName: L?.dropIndicator,
|
|
4953
4962
|
dropIndicatorStyle: R?.dropIndicator,
|
|
4954
4963
|
rowClassName: L?.row,
|
|
4955
4964
|
rowStyle: R?.row,
|
|
4956
|
-
children:
|
|
4965
|
+
children: fe ? /* @__PURE__ */ H(B, { children: [x && /* @__PURE__ */ V("div", {
|
|
4957
4966
|
className: f($.virtualListSelectCell, L?.selectCell),
|
|
4958
4967
|
style: R?.selectCell,
|
|
4959
4968
|
role: "gridcell",
|
|
4960
4969
|
onClick: (e) => e.stopPropagation(),
|
|
4961
4970
|
children: /* @__PURE__ */ V(qe, {
|
|
4962
4971
|
selected: de.has(i),
|
|
4963
|
-
onToggle: () =>
|
|
4972
|
+
onToggle: () => ue.handleRowSelect(i),
|
|
4964
4973
|
"aria-label": "Select row"
|
|
4965
4974
|
})
|
|
4966
|
-
}),
|
|
4975
|
+
}), pe.map((e) => /* @__PURE__ */ V("div", {
|
|
4967
4976
|
className: f($.virtualListCell, L?.cell),
|
|
4968
4977
|
style: R?.cell,
|
|
4969
4978
|
role: "gridcell",
|
|
@@ -4971,28 +4980,28 @@ function Zr({ items: e, renderRow: t, columns: n, height: r = "100%", estimatedR
|
|
|
4971
4980
|
children: e.renderCell(r, n)
|
|
4972
4981
|
}, e.key))] }) : t?.(r, n)
|
|
4973
4982
|
}, i);
|
|
4974
|
-
},
|
|
4975
|
-
for (let e =
|
|
4976
|
-
let
|
|
4977
|
-
return
|
|
4978
|
-
...
|
|
4979
|
-
ref:
|
|
4980
|
-
className: f($.virtualList,
|
|
4983
|
+
}, Ce = [];
|
|
4984
|
+
for (let e = K; e <= q; e++) Ce.push(Se(e));
|
|
4985
|
+
let Te = J.draggingKey == null ? -1 : re.indexOf(J.draggingKey);
|
|
4986
|
+
return Te >= 0 && (Te < K || Te > q) && Ce.push(Se(Te)), /* @__PURE__ */ H("div", {
|
|
4987
|
+
...te,
|
|
4988
|
+
ref: U,
|
|
4989
|
+
className: f($.virtualList, J.draggingKey != null && $.virtualListReordering, I, L?.root),
|
|
4981
4990
|
style: {
|
|
4982
4991
|
height: r,
|
|
4983
|
-
...
|
|
4992
|
+
...ee,
|
|
4984
4993
|
...R?.root
|
|
4985
4994
|
},
|
|
4986
|
-
onScroll:
|
|
4987
|
-
role:
|
|
4988
|
-
"aria-rowcount":
|
|
4995
|
+
onScroll: oe.handleScroll,
|
|
4996
|
+
role: fe ? "grid" : "list",
|
|
4997
|
+
"aria-rowcount": fe ? e.length + 1 : void 0,
|
|
4989
4998
|
children: [
|
|
4990
|
-
|
|
4999
|
+
fe && /* @__PURE__ */ H("div", {
|
|
4991
5000
|
ref: se,
|
|
4992
5001
|
className: f($.virtualListHeader, L?.header),
|
|
4993
5002
|
style: {
|
|
4994
|
-
gridTemplateColumns:
|
|
4995
|
-
...
|
|
5003
|
+
gridTemplateColumns: me,
|
|
5004
|
+
...he ? { paddingRight: 32 } : {},
|
|
4996
5005
|
...R?.header
|
|
4997
5006
|
},
|
|
4998
5007
|
role: "row",
|
|
@@ -5003,48 +5012,48 @@ function Zr({ items: e, renderRow: t, columns: n, height: r = "100%", estimatedR
|
|
|
5003
5012
|
style: R?.selectCell,
|
|
5004
5013
|
role: "columnheader",
|
|
5005
5014
|
children: /* @__PURE__ */ V(qe, {
|
|
5006
|
-
selected:
|
|
5007
|
-
onToggle:
|
|
5015
|
+
selected: ue.allSelected || ue.someSelected,
|
|
5016
|
+
onToggle: ue.handleSelectAll,
|
|
5008
5017
|
"aria-label": "Select all rows"
|
|
5009
5018
|
})
|
|
5010
5019
|
}),
|
|
5011
|
-
|
|
5020
|
+
pe.map((e) => /* @__PURE__ */ V("div", {
|
|
5012
5021
|
className: f($.virtualListHeaderCell, L?.headerCell),
|
|
5013
5022
|
style: R?.headerCell,
|
|
5014
5023
|
role: "columnheader",
|
|
5015
5024
|
"data-fit-key": e.width.type === "fit" ? e.key : void 0,
|
|
5016
5025
|
children: e.label
|
|
5017
5026
|
}, e.key)),
|
|
5018
|
-
|
|
5019
|
-
ref:
|
|
5027
|
+
he && /* @__PURE__ */ H("div", {
|
|
5028
|
+
ref: be,
|
|
5020
5029
|
className: $.virtualListToggleWrapper,
|
|
5021
5030
|
children: [
|
|
5022
5031
|
/* @__PURE__ */ V("button", {
|
|
5023
5032
|
type: "button",
|
|
5024
5033
|
className: f($.virtualListHeaderToggle, L?.headerToggle),
|
|
5025
5034
|
style: R?.headerToggle,
|
|
5026
|
-
onClick: () =>
|
|
5035
|
+
onClick: () => ye((e) => !e),
|
|
5027
5036
|
"aria-label": "Toggle column visibility",
|
|
5028
5037
|
children: /* @__PURE__ */ V(p, {
|
|
5029
5038
|
icon: k,
|
|
5030
5039
|
style: R?.headerToggle
|
|
5031
5040
|
})
|
|
5032
5041
|
}),
|
|
5033
|
-
|
|
5042
|
+
_e > 0 && /* @__PURE__ */ V("span", {
|
|
5034
5043
|
className: f($.virtualListColumnChip, L?.columnChip),
|
|
5035
5044
|
style: R?.columnChip,
|
|
5036
|
-
"data-column-hidden-count":
|
|
5037
|
-
"aria-label": `${
|
|
5038
|
-
children:
|
|
5045
|
+
"data-column-hidden-count": _e,
|
|
5046
|
+
"aria-label": `${_e} columns hidden`,
|
|
5047
|
+
children: _e
|
|
5039
5048
|
}),
|
|
5040
|
-
|
|
5049
|
+
ve && /* @__PURE__ */ V("div", {
|
|
5041
5050
|
className: f($.virtualListTogglePopover, L?.togglePopover),
|
|
5042
5051
|
style: R?.togglePopover,
|
|
5043
5052
|
children: n.map((e) => /* @__PURE__ */ V(qe, {
|
|
5044
5053
|
className: f($.virtualListToggleItem, L?.toggleItem),
|
|
5045
5054
|
style: R?.toggleItem,
|
|
5046
|
-
selected:
|
|
5047
|
-
onToggle: () =>
|
|
5055
|
+
selected: ge.has(e.key),
|
|
5056
|
+
onToggle: () => xe(e.key),
|
|
5048
5057
|
cursorDefault: !1,
|
|
5049
5058
|
children: e.label
|
|
5050
5059
|
}, e.key))
|
|
@@ -5059,12 +5068,12 @@ function Zr({ items: e, renderRow: t, columns: n, height: r = "100%", estimatedR
|
|
|
5059
5068
|
}) : /* @__PURE__ */ V("div", {
|
|
5060
5069
|
className: f($.virtualListBody, L?.body),
|
|
5061
5070
|
style: {
|
|
5062
|
-
height:
|
|
5071
|
+
height: G,
|
|
5063
5072
|
...R?.body
|
|
5064
5073
|
},
|
|
5065
|
-
children:
|
|
5074
|
+
children: Ce
|
|
5066
5075
|
}),
|
|
5067
|
-
|
|
5076
|
+
oe.showLoadMoreSpinner && /* @__PURE__ */ V("div", {
|
|
5068
5077
|
className: f($.virtualListLoadingIndicator, L?.loadingIndicator),
|
|
5069
5078
|
style: R?.loadingIndicator,
|
|
5070
5079
|
children: /* @__PURE__ */ V(we, { className: $.virtualListSpinner })
|