@sustaina/shared-ui 1.10.1 → 1.12.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/dist/index.d.mts +58 -3
- package/dist/index.d.ts +58 -3
- package/dist/index.js +416 -209
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +308 -103
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var AccordionPrimitive = require('@radix-ui/react-accordion');
|
|
|
4
4
|
var clsx2 = require('clsx');
|
|
5
5
|
var tailwindMerge = require('tailwind-merge');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
-
var
|
|
7
|
+
var React4 = require('react');
|
|
8
8
|
var dateFns = require('date-fns');
|
|
9
9
|
var lucideReact = require('lucide-react');
|
|
10
10
|
var reactDom = require('react-dom');
|
|
@@ -49,6 +49,7 @@ var utils = require('@lexical/utils');
|
|
|
49
49
|
var selection = require('@lexical/selection');
|
|
50
50
|
var SeparatorPrimitive = require('@radix-ui/react-separator');
|
|
51
51
|
var SwitchPrimitive = require('@radix-ui/react-switch');
|
|
52
|
+
var Cropper = require('react-easy-crop');
|
|
52
53
|
|
|
53
54
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
54
55
|
|
|
@@ -72,7 +73,7 @@ function _interopNamespace(e) {
|
|
|
72
73
|
|
|
73
74
|
var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
|
|
74
75
|
var clsx2__default = /*#__PURE__*/_interopDefault(clsx2);
|
|
75
|
-
var
|
|
76
|
+
var React4__namespace = /*#__PURE__*/_interopNamespace(React4);
|
|
76
77
|
var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
|
|
77
78
|
var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
|
|
78
79
|
var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
|
|
@@ -83,6 +84,7 @@ var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitiv
|
|
|
83
84
|
var RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespace(RadioGroupPrimitive);
|
|
84
85
|
var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespace(SeparatorPrimitive);
|
|
85
86
|
var SwitchPrimitive__namespace = /*#__PURE__*/_interopNamespace(SwitchPrimitive);
|
|
87
|
+
var Cropper__default = /*#__PURE__*/_interopDefault(Cropper);
|
|
86
88
|
|
|
87
89
|
var __defProp = Object.defineProperty;
|
|
88
90
|
var __export = (target, all) => {
|
|
@@ -581,7 +583,7 @@ function AccordionContent({
|
|
|
581
583
|
);
|
|
582
584
|
}
|
|
583
585
|
var ExpandCollapse = ({ title, children, portalId }) => {
|
|
584
|
-
const [isOpen, setIsOpen] =
|
|
586
|
+
const [isOpen, setIsOpen] = React4.useState(false);
|
|
585
587
|
const Panel = /* @__PURE__ */ jsxRuntime.jsx(
|
|
586
588
|
"div",
|
|
587
589
|
{
|
|
@@ -675,31 +677,31 @@ function makeNewRow(field) {
|
|
|
675
677
|
};
|
|
676
678
|
}
|
|
677
679
|
function useAdvanceSearch({ fields, limitRows }) {
|
|
678
|
-
const [rows, setRows] =
|
|
679
|
-
const updateRows =
|
|
680
|
+
const [rows, setRows] = React4.useState([makeNewRow(fields[0])]);
|
|
681
|
+
const updateRows = React4.useCallback((next) => {
|
|
680
682
|
setRows(next);
|
|
681
683
|
}, []);
|
|
682
|
-
const operatorsForField =
|
|
684
|
+
const operatorsForField = React4.useCallback(
|
|
683
685
|
(fieldName) => {
|
|
684
686
|
const t = getFieldType(fields, fieldName);
|
|
685
687
|
return OPERATOR_MAP[t];
|
|
686
688
|
},
|
|
687
689
|
[fields]
|
|
688
690
|
);
|
|
689
|
-
const addRow =
|
|
691
|
+
const addRow = React4.useCallback(() => {
|
|
690
692
|
if (limitRows && rows.length >= limitRows) return;
|
|
691
693
|
const lastRow = rows[rows.length - 1];
|
|
692
694
|
const lastField = fields.find((f) => f.name === lastRow?.fieldName) ?? fields[0];
|
|
693
695
|
updateRows([...rows, makeNewRow(lastField)]);
|
|
694
696
|
}, [rows, fields, updateRows, limitRows]);
|
|
695
|
-
const removeRow =
|
|
697
|
+
const removeRow = React4.useCallback(
|
|
696
698
|
(id) => {
|
|
697
699
|
if (rows.length === 1) return;
|
|
698
700
|
updateRows(rows.filter((r) => r.id !== id));
|
|
699
701
|
},
|
|
700
702
|
[rows, updateRows]
|
|
701
703
|
);
|
|
702
|
-
const clearRow =
|
|
704
|
+
const clearRow = React4.useCallback(
|
|
703
705
|
(id) => {
|
|
704
706
|
updateRows(
|
|
705
707
|
rows.map((r) => {
|
|
@@ -728,10 +730,10 @@ function useAdvanceSearch({ fields, limitRows }) {
|
|
|
728
730
|
},
|
|
729
731
|
[rows, fields, updateRows]
|
|
730
732
|
);
|
|
731
|
-
const clearAllRow =
|
|
733
|
+
const clearAllRow = React4.useCallback(() => {
|
|
732
734
|
updateRows([makeNewRow(fields[0])]);
|
|
733
735
|
}, [fields, updateRows]);
|
|
734
|
-
const changeField =
|
|
736
|
+
const changeField = React4.useCallback(
|
|
735
737
|
(id, fieldName) => {
|
|
736
738
|
updateRows(
|
|
737
739
|
rows.map((r) => {
|
|
@@ -743,7 +745,7 @@ function useAdvanceSearch({ fields, limitRows }) {
|
|
|
743
745
|
},
|
|
744
746
|
[rows, fields, updateRows]
|
|
745
747
|
);
|
|
746
|
-
const changeOperator =
|
|
748
|
+
const changeOperator = React4.useCallback(
|
|
747
749
|
(id, operator) => {
|
|
748
750
|
updateRows(
|
|
749
751
|
rows.map((r) => {
|
|
@@ -774,7 +776,7 @@ function useAdvanceSearch({ fields, limitRows }) {
|
|
|
774
776
|
},
|
|
775
777
|
[rows, updateRows]
|
|
776
778
|
);
|
|
777
|
-
const changeValue =
|
|
779
|
+
const changeValue = React4.useCallback(
|
|
778
780
|
(id, which, val) => {
|
|
779
781
|
updateRows(
|
|
780
782
|
rows.map((r) => {
|
|
@@ -786,7 +788,7 @@ function useAdvanceSearch({ fields, limitRows }) {
|
|
|
786
788
|
},
|
|
787
789
|
[rows, updateRows]
|
|
788
790
|
);
|
|
789
|
-
const fieldOptions =
|
|
791
|
+
const fieldOptions = React4.useMemo(
|
|
790
792
|
() => fields.map((f) => ({
|
|
791
793
|
value: f.name,
|
|
792
794
|
label: f.label ?? f.name
|
|
@@ -974,7 +976,7 @@ var OPERATOR_LABEL = {
|
|
|
974
976
|
containsAll: "Contains all of"
|
|
975
977
|
};
|
|
976
978
|
var OperatorSelect = ({ row, operators, onChangeOperator, error }) => {
|
|
977
|
-
|
|
979
|
+
React4__namespace.default.useEffect(() => {
|
|
978
980
|
if (!operators.length) return;
|
|
979
981
|
if (!operators.includes(row.operator)) {
|
|
980
982
|
onChangeOperator(operators[0]);
|
|
@@ -1009,15 +1011,15 @@ function Label2({ className, ...props }) {
|
|
|
1009
1011
|
);
|
|
1010
1012
|
}
|
|
1011
1013
|
var Form = reactHookForm.FormProvider;
|
|
1012
|
-
var FormFieldContext =
|
|
1014
|
+
var FormFieldContext = React4__namespace.createContext({});
|
|
1013
1015
|
var FormField = ({
|
|
1014
1016
|
...props
|
|
1015
1017
|
}) => {
|
|
1016
1018
|
return /* @__PURE__ */ jsxRuntime.jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsxRuntime.jsx(reactHookForm.Controller, { ...props }) });
|
|
1017
1019
|
};
|
|
1018
1020
|
var useFormField = () => {
|
|
1019
|
-
const fieldContext =
|
|
1020
|
-
const itemContext =
|
|
1021
|
+
const fieldContext = React4__namespace.useContext(FormFieldContext);
|
|
1022
|
+
const itemContext = React4__namespace.useContext(FormItemContext);
|
|
1021
1023
|
const { getFieldState } = reactHookForm.useFormContext();
|
|
1022
1024
|
const formState = reactHookForm.useFormState({ name: fieldContext.name });
|
|
1023
1025
|
const fieldState = getFieldState(fieldContext.name, formState);
|
|
@@ -1034,18 +1036,17 @@ var useFormField = () => {
|
|
|
1034
1036
|
...fieldState
|
|
1035
1037
|
};
|
|
1036
1038
|
};
|
|
1037
|
-
var FormItemContext =
|
|
1039
|
+
var FormItemContext = React4__namespace.createContext({});
|
|
1038
1040
|
function FormItem({ className, ...props }) {
|
|
1039
|
-
const id =
|
|
1041
|
+
const id = React4__namespace.useId();
|
|
1040
1042
|
return /* @__PURE__ */ jsxRuntime.jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "form-item", className: cn("grid gap-2", className), ...props }) });
|
|
1041
1043
|
}
|
|
1042
1044
|
function FormLabel({ className, ...props }) {
|
|
1043
|
-
const {
|
|
1045
|
+
const { formItemId } = useFormField();
|
|
1044
1046
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1045
1047
|
Label2,
|
|
1046
1048
|
{
|
|
1047
1049
|
"data-slot": "form-label",
|
|
1048
|
-
"data-error": !!error,
|
|
1049
1050
|
className: cn("data-[error=true]:text-destructive", className),
|
|
1050
1051
|
htmlFor: formItemId,
|
|
1051
1052
|
...props
|
|
@@ -1095,23 +1096,6 @@ function FormMessage({ className, ...props }) {
|
|
|
1095
1096
|
}
|
|
1096
1097
|
);
|
|
1097
1098
|
}
|
|
1098
|
-
var InputPrimitive = React5__namespace.forwardRef(
|
|
1099
|
-
({ className, type = "text", ...props }, ref) => {
|
|
1100
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1101
|
-
"input",
|
|
1102
|
-
{
|
|
1103
|
-
ref,
|
|
1104
|
-
type,
|
|
1105
|
-
className: cn(
|
|
1106
|
-
"placeholder:text-neutral-400 text-neutral-900 flex h-10 w-full min-w-0 items-center rounded-lg border bg-white px-4 text-sm transition-colors outline-none file:inline-flex file:h-7 file:rounded-md file:border-0 file:bg-transparent file:px-2 file:text-sm file:font-medium hover:border-neutral-500 focus-visible:border-neutral-900 focus-visible:ring-0 disabled:cursor-not-allowed disabled:bg-neutral-100 disabled:text-neutral-400 disabled:border-neutral-200 aria-invalid:border-destructive",
|
|
1107
|
-
className
|
|
1108
|
-
),
|
|
1109
|
-
...props
|
|
1110
|
-
}
|
|
1111
|
-
);
|
|
1112
|
-
}
|
|
1113
|
-
);
|
|
1114
|
-
InputPrimitive.displayName = "InputPrimitive";
|
|
1115
1099
|
var spinnerVariants = classVarianceAuthority.cva("relative inline-block aspect-square transform-gpu", {
|
|
1116
1100
|
variants: {
|
|
1117
1101
|
variant: {
|
|
@@ -1158,6 +1142,23 @@ var Spinner = ({ className, variant, size = "default", ...props }) => /* @__PURE
|
|
|
1158
1142
|
]
|
|
1159
1143
|
}
|
|
1160
1144
|
);
|
|
1145
|
+
var InputPrimitive = React4__namespace.forwardRef(
|
|
1146
|
+
({ className, type = "text", ...props }, ref) => {
|
|
1147
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1148
|
+
"input",
|
|
1149
|
+
{
|
|
1150
|
+
ref,
|
|
1151
|
+
type,
|
|
1152
|
+
className: cn(
|
|
1153
|
+
"placeholder:text-neutral-400 text-neutral-900 flex h-10 w-full min-w-0 items-center rounded-lg border bg-white px-4 text-sm transition-colors outline-none file:inline-flex file:h-7 file:rounded-md file:border-0 file:bg-transparent file:px-2 file:text-sm file:font-medium hover:border-neutral-500 focus-visible:border-neutral-900 focus-visible:ring-0 disabled:cursor-not-allowed disabled:bg-neutral-100 disabled:text-neutral-400 disabled:border-neutral-200 aria-invalid:border-destructive",
|
|
1154
|
+
className
|
|
1155
|
+
),
|
|
1156
|
+
...props
|
|
1157
|
+
}
|
|
1158
|
+
);
|
|
1159
|
+
}
|
|
1160
|
+
);
|
|
1161
|
+
InputPrimitive.displayName = "InputPrimitive";
|
|
1161
1162
|
var inputVariants = classVarianceAuthority.cva("", {
|
|
1162
1163
|
variants: {
|
|
1163
1164
|
controlSize: {
|
|
@@ -1180,7 +1181,7 @@ var inputVariants = classVarianceAuthority.cva("", {
|
|
|
1180
1181
|
appearance: "filled"
|
|
1181
1182
|
}
|
|
1182
1183
|
});
|
|
1183
|
-
var Input =
|
|
1184
|
+
var Input = React4__namespace.forwardRef(
|
|
1184
1185
|
({
|
|
1185
1186
|
className,
|
|
1186
1187
|
wrapperClassName,
|
|
@@ -1189,14 +1190,17 @@ var Input = React5__namespace.forwardRef(
|
|
|
1189
1190
|
appearance,
|
|
1190
1191
|
prefix,
|
|
1191
1192
|
prefixProps,
|
|
1193
|
+
prefixInteractive,
|
|
1192
1194
|
suffix,
|
|
1193
1195
|
suffixProps,
|
|
1196
|
+
suffixInteractive,
|
|
1194
1197
|
invalid,
|
|
1195
1198
|
loading,
|
|
1196
1199
|
loadingIcon,
|
|
1197
1200
|
validationMessage,
|
|
1198
1201
|
validationIcon,
|
|
1199
1202
|
validationMessageProps,
|
|
1203
|
+
onValueChange,
|
|
1200
1204
|
type = "text",
|
|
1201
1205
|
...rest
|
|
1202
1206
|
}, ref) => {
|
|
@@ -1206,10 +1210,18 @@ var Input = React5__namespace.forwardRef(
|
|
|
1206
1210
|
const {
|
|
1207
1211
|
"aria-invalid": ariaInvalidProp,
|
|
1208
1212
|
"aria-describedby": ariaDescribedByProp,
|
|
1213
|
+
onChange: onChangeProp,
|
|
1209
1214
|
...inputProps
|
|
1210
1215
|
} = rest;
|
|
1211
1216
|
const ariaInvalid = invalid ?? ariaInvalidProp;
|
|
1212
|
-
const messageId =
|
|
1217
|
+
const messageId = React4__namespace.useId();
|
|
1218
|
+
const handleChange = React4__namespace.useCallback(
|
|
1219
|
+
(event) => {
|
|
1220
|
+
onChangeProp?.(event);
|
|
1221
|
+
onValueChange?.(event.target.value);
|
|
1222
|
+
},
|
|
1223
|
+
[onChangeProp, onValueChange]
|
|
1224
|
+
);
|
|
1213
1225
|
const resolvedAriaInvalid = typeof ariaInvalid === "string" ? ariaInvalid : ariaInvalid ? true : void 0;
|
|
1214
1226
|
const describedBy = validationMessage ? [ariaDescribedByProp, messageId].filter(Boolean).join(" ") : ariaDescribedByProp;
|
|
1215
1227
|
const controlWrapperClassName = cn(
|
|
@@ -1231,6 +1243,7 @@ var Input = React5__namespace.forwardRef(
|
|
|
1231
1243
|
),
|
|
1232
1244
|
"aria-invalid": resolvedAriaInvalid,
|
|
1233
1245
|
"aria-describedby": describedBy || void 0,
|
|
1246
|
+
onChange: handleChange,
|
|
1234
1247
|
...inputProps
|
|
1235
1248
|
}
|
|
1236
1249
|
);
|
|
@@ -1250,7 +1263,8 @@ var Input = React5__namespace.forwardRef(
|
|
|
1250
1263
|
{
|
|
1251
1264
|
...prefixRest,
|
|
1252
1265
|
className: cn(
|
|
1253
|
-
"
|
|
1266
|
+
"absolute left-3 top-1/2 -translate-y-1/2 inline-flex items-center text-muted-foreground",
|
|
1267
|
+
!prefixInteractive && "pointer-events-none",
|
|
1254
1268
|
prefixClassName
|
|
1255
1269
|
),
|
|
1256
1270
|
children: prefix
|
|
@@ -1262,7 +1276,8 @@ var Input = React5__namespace.forwardRef(
|
|
|
1262
1276
|
{
|
|
1263
1277
|
...suffixRest,
|
|
1264
1278
|
className: cn(
|
|
1265
|
-
"
|
|
1279
|
+
"absolute right-3 top-1/2 -translate-y-1/2 inline-flex items-center gap-2 text-muted-foreground",
|
|
1280
|
+
!suffixInteractive && "pointer-events-none",
|
|
1266
1281
|
suffixClassName
|
|
1267
1282
|
),
|
|
1268
1283
|
children: suffixContent
|
|
@@ -1525,20 +1540,20 @@ function DatePicker({
|
|
|
1525
1540
|
className,
|
|
1526
1541
|
...props
|
|
1527
1542
|
}) {
|
|
1528
|
-
const today =
|
|
1529
|
-
const [displayed, setDisplayed] =
|
|
1543
|
+
const today = React4__namespace.useMemo(() => startOfDay(/* @__PURE__ */ new Date()), []);
|
|
1544
|
+
const [displayed, setDisplayed] = React4__namespace.useState(
|
|
1530
1545
|
selectedDate ? new Date(selectedDate) : /* @__PURE__ */ new Date()
|
|
1531
1546
|
);
|
|
1532
1547
|
minDate = clampToDay(minDate);
|
|
1533
1548
|
maxDate = clampToDay(maxDate);
|
|
1534
|
-
const disabledSet =
|
|
1549
|
+
const disabledSet = React4__namespace.useMemo(() => {
|
|
1535
1550
|
const s = /* @__PURE__ */ new Set();
|
|
1536
1551
|
disabledDates?.forEach((d) => s.add(startOfDay(d).toISOString()));
|
|
1537
1552
|
return s;
|
|
1538
1553
|
}, [disabledDates]);
|
|
1539
1554
|
const displayYear = displayed.getFullYear();
|
|
1540
1555
|
const displayMonth = displayed.getMonth();
|
|
1541
|
-
const weekdays =
|
|
1556
|
+
const weekdays = React4__namespace.useMemo(() => {
|
|
1542
1557
|
const labels = [];
|
|
1543
1558
|
for (let i = 0; i < 7; i++) {
|
|
1544
1559
|
const idx = i;
|
|
@@ -1547,7 +1562,7 @@ function DatePicker({
|
|
|
1547
1562
|
}
|
|
1548
1563
|
return labels;
|
|
1549
1564
|
}, [callbacks]);
|
|
1550
|
-
const grid =
|
|
1565
|
+
const grid = React4__namespace.useMemo(() => buildCalendarGrid(displayed, true), [displayed]);
|
|
1551
1566
|
const isDateDisabled = (date) => {
|
|
1552
1567
|
const d = startOfDay(date);
|
|
1553
1568
|
if (minDate && d < minDate) return true;
|
|
@@ -1557,7 +1572,7 @@ function DatePicker({
|
|
|
1557
1572
|
};
|
|
1558
1573
|
const minYear = minDate?.getFullYear();
|
|
1559
1574
|
const maxYear = maxDate?.getFullYear();
|
|
1560
|
-
const getMonthLabel =
|
|
1575
|
+
const getMonthLabel = React4__namespace.useCallback(
|
|
1561
1576
|
(year, monthIndex) => {
|
|
1562
1577
|
const label = callbacks?.monthLabel?.(year, monthIndex);
|
|
1563
1578
|
if (label === null || label === void 0) {
|
|
@@ -1567,7 +1582,7 @@ function DatePicker({
|
|
|
1567
1582
|
},
|
|
1568
1583
|
[callbacks]
|
|
1569
1584
|
);
|
|
1570
|
-
const getYearLabel =
|
|
1585
|
+
const getYearLabel = React4__namespace.useCallback(
|
|
1571
1586
|
(year) => {
|
|
1572
1587
|
const label = callbacks?.yearLabel?.(year);
|
|
1573
1588
|
if (label === null || label === void 0) return String(year);
|
|
@@ -1575,7 +1590,7 @@ function DatePicker({
|
|
|
1575
1590
|
},
|
|
1576
1591
|
[callbacks]
|
|
1577
1592
|
);
|
|
1578
|
-
const clampMonthToBounds =
|
|
1593
|
+
const clampMonthToBounds = React4__namespace.useCallback(
|
|
1579
1594
|
(year, monthIndex) => {
|
|
1580
1595
|
let output = monthIndex;
|
|
1581
1596
|
if (typeof minYear === "number" && year === minYear && minDate) {
|
|
@@ -1590,7 +1605,7 @@ function DatePicker({
|
|
|
1590
1605
|
},
|
|
1591
1606
|
[maxDate, minDate, maxYear, minYear]
|
|
1592
1607
|
);
|
|
1593
|
-
const yearOptions =
|
|
1608
|
+
const yearOptions = React4__namespace.useMemo(() => {
|
|
1594
1609
|
const fallbackWindow = 50;
|
|
1595
1610
|
const start = typeof minYear === "number" ? minYear : displayYear - fallbackWindow;
|
|
1596
1611
|
const end = typeof maxYear === "number" ? maxYear : displayYear + fallbackWindow;
|
|
@@ -1611,7 +1626,7 @@ function DatePicker({
|
|
|
1611
1626
|
}
|
|
1612
1627
|
return years;
|
|
1613
1628
|
}, [displayYear, maxYear, minYear, selectedDate]);
|
|
1614
|
-
const monthOptions =
|
|
1629
|
+
const monthOptions = React4__namespace.useMemo(() => {
|
|
1615
1630
|
const months = Array.from({ length: 12 }, (_, monthIndex) => {
|
|
1616
1631
|
const disabled = typeof minYear === "number" && displayYear === minYear && minDate && monthIndex < minDate.getMonth() || typeof maxYear === "number" && displayYear === maxYear && maxDate && monthIndex > maxDate.getMonth();
|
|
1617
1632
|
return {
|
|
@@ -1630,7 +1645,7 @@ function DatePicker({
|
|
|
1630
1645
|
}
|
|
1631
1646
|
return months.sort((a, b) => a.value - b.value).filter((option, index, arr) => index === 0 || option.value !== arr[index - 1].value);
|
|
1632
1647
|
}, [displayMonth, displayYear, getMonthLabel, maxDate, maxYear, minDate, minYear]);
|
|
1633
|
-
const handleMonthSelect =
|
|
1648
|
+
const handleMonthSelect = React4__namespace.useCallback((nextValue) => {
|
|
1634
1649
|
const nextMonth = Number.parseInt(nextValue, 10);
|
|
1635
1650
|
if (Number.isNaN(nextMonth)) return;
|
|
1636
1651
|
setDisplayed((prev) => {
|
|
@@ -1640,7 +1655,7 @@ function DatePicker({
|
|
|
1640
1655
|
return next;
|
|
1641
1656
|
});
|
|
1642
1657
|
}, []);
|
|
1643
|
-
const handleYearSelect =
|
|
1658
|
+
const handleYearSelect = React4__namespace.useCallback(
|
|
1644
1659
|
(nextValue) => {
|
|
1645
1660
|
const nextYear = Number.parseInt(nextValue, 10);
|
|
1646
1661
|
if (Number.isNaN(nextYear)) return;
|
|
@@ -1788,14 +1803,14 @@ var DatePicker2 = ({
|
|
|
1788
1803
|
ariaLabel,
|
|
1789
1804
|
...calendarProps
|
|
1790
1805
|
}) => {
|
|
1791
|
-
const [open, setOpen] =
|
|
1792
|
-
const parser =
|
|
1793
|
-
const outputFormatter =
|
|
1794
|
-
const labelFormatter =
|
|
1806
|
+
const [open, setOpen] = React4__namespace.default.useState(false);
|
|
1807
|
+
const parser = React4__namespace.default.useMemo(() => valueParser ?? defaultValueParser, [valueParser]);
|
|
1808
|
+
const outputFormatter = React4__namespace.default.useMemo(() => valueFormatter ?? defaultValueFormatter, [valueFormatter]);
|
|
1809
|
+
const labelFormatter = React4__namespace.default.useMemo(
|
|
1795
1810
|
() => displayFormatter ?? defaultDisplayFormatter,
|
|
1796
1811
|
[displayFormatter]
|
|
1797
1812
|
);
|
|
1798
|
-
const parsedValue =
|
|
1813
|
+
const parsedValue = React4__namespace.default.useMemo(() => {
|
|
1799
1814
|
if (value === null || value === void 0) return void 0;
|
|
1800
1815
|
if (value instanceof Date) return value;
|
|
1801
1816
|
const parsed = parser(value);
|
|
@@ -1804,26 +1819,26 @@ var DatePicker2 = ({
|
|
|
1804
1819
|
const buttonLabel = parsedValue ? labelFormatter(parsedValue) : placeholder3;
|
|
1805
1820
|
const buttonAriaLabel = ariaLabel ?? (parsedValue ? `Change date, current selection ${labelFormatter(parsedValue)}` : "Open date picker");
|
|
1806
1821
|
const shouldShowClear = allowClear && !disabled && !!parsedValue;
|
|
1807
|
-
const handleClose =
|
|
1808
|
-
const emitChange =
|
|
1822
|
+
const handleClose = React4__namespace.default.useCallback(() => setOpen(false), []);
|
|
1823
|
+
const emitChange = React4__namespace.default.useCallback(
|
|
1809
1824
|
(next) => {
|
|
1810
1825
|
onChange?.(next);
|
|
1811
1826
|
onValueChange?.(next ? outputFormatter(next) : void 0);
|
|
1812
1827
|
},
|
|
1813
1828
|
[onChange, onValueChange, outputFormatter]
|
|
1814
1829
|
);
|
|
1815
|
-
const handleSelect =
|
|
1830
|
+
const handleSelect = React4__namespace.default.useCallback(
|
|
1816
1831
|
(next) => {
|
|
1817
1832
|
emitChange(next);
|
|
1818
1833
|
if (closeOnSelect && next) handleClose();
|
|
1819
1834
|
},
|
|
1820
1835
|
[closeOnSelect, emitChange, handleClose]
|
|
1821
1836
|
);
|
|
1822
|
-
const handleClear =
|
|
1837
|
+
const handleClear = React4__namespace.default.useCallback(() => {
|
|
1823
1838
|
emitChange(void 0);
|
|
1824
1839
|
handleClose();
|
|
1825
1840
|
}, [emitChange, handleClose]);
|
|
1826
|
-
const handleOpenChange =
|
|
1841
|
+
const handleOpenChange = React4__namespace.default.useCallback(
|
|
1827
1842
|
(nextOpen) => {
|
|
1828
1843
|
if (disabled && nextOpen) return;
|
|
1829
1844
|
setOpen(nextOpen);
|
|
@@ -1995,15 +2010,15 @@ function MonthCal({
|
|
|
1995
2010
|
onYearBackward,
|
|
1996
2011
|
onYearForward
|
|
1997
2012
|
}) {
|
|
1998
|
-
const today =
|
|
2013
|
+
const today = React4__namespace.useMemo(() => {
|
|
1999
2014
|
const now = /* @__PURE__ */ new Date();
|
|
2000
2015
|
now.setDate(1);
|
|
2001
2016
|
now.setHours(0, 0, 0, 0);
|
|
2002
2017
|
return now;
|
|
2003
2018
|
}, []);
|
|
2004
|
-
const selectedMonthDate =
|
|
2005
|
-
const min =
|
|
2006
|
-
const max =
|
|
2019
|
+
const selectedMonthDate = React4__namespace.useMemo(() => normalizeMonth(selectedDate), [selectedDate]);
|
|
2020
|
+
const min = React4__namespace.useMemo(() => normalizeMonth(minDate), [minDate]);
|
|
2021
|
+
const max = React4__namespace.useMemo(() => normalizeMonth(maxDate), [maxDate]);
|
|
2007
2022
|
let effectiveMin = min;
|
|
2008
2023
|
if (min && max && min > max) {
|
|
2009
2024
|
effectiveMin = max;
|
|
@@ -2012,10 +2027,10 @@ function MonthCal({
|
|
|
2012
2027
|
const minMonth = effectiveMin?.getMonth();
|
|
2013
2028
|
const maxYear = max?.getFullYear();
|
|
2014
2029
|
const maxMonth = max?.getMonth();
|
|
2015
|
-
const [menuYear, setMenuYear] =
|
|
2030
|
+
const [menuYear, setMenuYear] = React4__namespace.useState(
|
|
2016
2031
|
() => selectedMonthDate?.getFullYear() ?? today.getFullYear()
|
|
2017
2032
|
);
|
|
2018
|
-
|
|
2033
|
+
React4__namespace.useEffect(() => {
|
|
2019
2034
|
if (selectedMonthDate) {
|
|
2020
2035
|
const year = selectedMonthDate.getFullYear();
|
|
2021
2036
|
if (year !== menuYear) {
|
|
@@ -2023,7 +2038,7 @@ function MonthCal({
|
|
|
2023
2038
|
}
|
|
2024
2039
|
}
|
|
2025
2040
|
}, [selectedMonthDate, menuYear]);
|
|
2026
|
-
|
|
2041
|
+
React4__namespace.useEffect(() => {
|
|
2027
2042
|
if (typeof minYear === "number" && menuYear < minYear) {
|
|
2028
2043
|
setMenuYear(minYear);
|
|
2029
2044
|
return;
|
|
@@ -2034,7 +2049,7 @@ function MonthCal({
|
|
|
2034
2049
|
}, [minYear, maxYear, menuYear]);
|
|
2035
2050
|
const disablePrevYear = typeof minYear === "number" ? menuYear <= minYear : false;
|
|
2036
2051
|
const disableNextYear = typeof maxYear === "number" ? menuYear >= maxYear : false;
|
|
2037
|
-
const yearOptions =
|
|
2052
|
+
const yearOptions = React4__namespace.useMemo(() => {
|
|
2038
2053
|
const fallbackWindow = 50;
|
|
2039
2054
|
const start = typeof minYear === "number" ? minYear : menuYear - fallbackWindow;
|
|
2040
2055
|
const end = typeof maxYear === "number" ? maxYear : menuYear + fallbackWindow;
|
|
@@ -2048,7 +2063,7 @@ function MonthCal({
|
|
|
2048
2063
|
}
|
|
2049
2064
|
return years;
|
|
2050
2065
|
}, [maxYear, menuYear, minYear]);
|
|
2051
|
-
const formatYearLabel =
|
|
2066
|
+
const formatYearLabel = React4__namespace.useCallback(
|
|
2052
2067
|
(year) => {
|
|
2053
2068
|
const raw = callbacks?.yearLabel?.(year);
|
|
2054
2069
|
if (raw === null || raw === void 0) return String(year);
|
|
@@ -2056,7 +2071,7 @@ function MonthCal({
|
|
|
2056
2071
|
},
|
|
2057
2072
|
[callbacks]
|
|
2058
2073
|
);
|
|
2059
|
-
const handleYearSelect =
|
|
2074
|
+
const handleYearSelect = React4__namespace.useCallback(
|
|
2060
2075
|
(nextValue) => {
|
|
2061
2076
|
const nextYear = Number.parseInt(nextValue, 10);
|
|
2062
2077
|
if (Number.isNaN(nextYear)) return;
|
|
@@ -2066,7 +2081,7 @@ function MonthCal({
|
|
|
2066
2081
|
},
|
|
2067
2082
|
[maxYear, minYear]
|
|
2068
2083
|
);
|
|
2069
|
-
const disabledPairs =
|
|
2084
|
+
const disabledPairs = React4__namespace.useMemo(() => {
|
|
2070
2085
|
if (!disabledDates?.length) return [];
|
|
2071
2086
|
const pairs = [];
|
|
2072
2087
|
disabledDates.forEach((date) => {
|
|
@@ -2211,14 +2226,14 @@ var MonthPicker2 = ({
|
|
|
2211
2226
|
ariaLabel,
|
|
2212
2227
|
...calendarProps
|
|
2213
2228
|
}) => {
|
|
2214
|
-
const [open, setOpen] =
|
|
2215
|
-
const parser =
|
|
2216
|
-
const outputFormatter =
|
|
2217
|
-
const labelFormatter =
|
|
2229
|
+
const [open, setOpen] = React4__namespace.default.useState(false);
|
|
2230
|
+
const parser = React4__namespace.default.useMemo(() => valueParser ?? defaultValueParser2, [valueParser]);
|
|
2231
|
+
const outputFormatter = React4__namespace.default.useMemo(() => valueFormatter ?? defaultValueFormatter2, [valueFormatter]);
|
|
2232
|
+
const labelFormatter = React4__namespace.default.useMemo(
|
|
2218
2233
|
() => displayFormatter ?? defaultDisplayFormatter2,
|
|
2219
2234
|
[displayFormatter]
|
|
2220
2235
|
);
|
|
2221
|
-
const parsedValue =
|
|
2236
|
+
const parsedValue = React4__namespace.default.useMemo(() => {
|
|
2222
2237
|
if (value === null || value === void 0) return void 0;
|
|
2223
2238
|
if (value instanceof Date) return normalizeMonth2(value);
|
|
2224
2239
|
if (typeof value === "string") {
|
|
@@ -2230,8 +2245,8 @@ var MonthPicker2 = ({
|
|
|
2230
2245
|
const buttonLabel = parsedValue ? labelFormatter(parsedValue) : placeholder3;
|
|
2231
2246
|
const buttonAriaLabel = ariaLabel ?? (parsedValue ? `Change month, current selection ${labelFormatter(parsedValue)}` : "Open month picker");
|
|
2232
2247
|
const shouldShowClear = allowClear && !disabled && !!parsedValue;
|
|
2233
|
-
const handleClose =
|
|
2234
|
-
const emitChange =
|
|
2248
|
+
const handleClose = React4__namespace.default.useCallback(() => setOpen(false), []);
|
|
2249
|
+
const emitChange = React4__namespace.default.useCallback(
|
|
2235
2250
|
(next) => {
|
|
2236
2251
|
const normalized = next ? normalizeMonth2(next) : void 0;
|
|
2237
2252
|
onChange?.(normalized);
|
|
@@ -2239,18 +2254,18 @@ var MonthPicker2 = ({
|
|
|
2239
2254
|
},
|
|
2240
2255
|
[onChange, onValueChange, outputFormatter]
|
|
2241
2256
|
);
|
|
2242
|
-
const handleSelect =
|
|
2257
|
+
const handleSelect = React4__namespace.default.useCallback(
|
|
2243
2258
|
(next) => {
|
|
2244
2259
|
emitChange(next);
|
|
2245
2260
|
if (closeOnSelect && next) handleClose();
|
|
2246
2261
|
},
|
|
2247
2262
|
[closeOnSelect, emitChange, handleClose]
|
|
2248
2263
|
);
|
|
2249
|
-
const handleClear =
|
|
2264
|
+
const handleClear = React4__namespace.default.useCallback(() => {
|
|
2250
2265
|
emitChange(void 0);
|
|
2251
2266
|
handleClose();
|
|
2252
2267
|
}, [emitChange, handleClose]);
|
|
2253
|
-
const handleOpenChange =
|
|
2268
|
+
const handleOpenChange = React4__namespace.default.useCallback(
|
|
2254
2269
|
(nextOpen) => {
|
|
2255
2270
|
if (disabled && nextOpen) return;
|
|
2256
2271
|
setOpen(nextOpen);
|
|
@@ -2456,21 +2471,21 @@ var LookupSelect = ({
|
|
|
2456
2471
|
loadingMessage = "Loading...",
|
|
2457
2472
|
dropdownPortalId
|
|
2458
2473
|
}) => {
|
|
2459
|
-
const [inputValue, setInputValue] =
|
|
2460
|
-
const [suggestions, setSuggestions] =
|
|
2461
|
-
const [optionLabels, setOptionLabels] =
|
|
2462
|
-
const [loading, setLoading] =
|
|
2463
|
-
const [fetchError, setFetchError] =
|
|
2464
|
-
const [isDropdownOpen, setIsDropdownOpen] =
|
|
2465
|
-
const containerRef =
|
|
2466
|
-
const fetchDelayRef =
|
|
2467
|
-
const requestIdRef =
|
|
2468
|
-
const [dropdownStyles, setDropdownStyles] =
|
|
2469
|
-
const dropdownContentRef =
|
|
2470
|
-
const assignDropdownContentRef =
|
|
2474
|
+
const [inputValue, setInputValue] = React4.useState("");
|
|
2475
|
+
const [suggestions, setSuggestions] = React4.useState([]);
|
|
2476
|
+
const [optionLabels, setOptionLabels] = React4.useState({});
|
|
2477
|
+
const [loading, setLoading] = React4.useState(false);
|
|
2478
|
+
const [fetchError, setFetchError] = React4.useState(null);
|
|
2479
|
+
const [isDropdownOpen, setIsDropdownOpen] = React4.useState(false);
|
|
2480
|
+
const containerRef = React4.useRef(null);
|
|
2481
|
+
const fetchDelayRef = React4.useRef(null);
|
|
2482
|
+
const requestIdRef = React4.useRef(0);
|
|
2483
|
+
const [dropdownStyles, setDropdownStyles] = React4.useState();
|
|
2484
|
+
const dropdownContentRef = React4.useRef(null);
|
|
2485
|
+
const assignDropdownContentRef = React4.useCallback((node) => {
|
|
2471
2486
|
dropdownContentRef.current = node;
|
|
2472
2487
|
}, []);
|
|
2473
|
-
const dropdownPortalElement =
|
|
2488
|
+
const dropdownPortalElement = React4.useMemo(() => {
|
|
2474
2489
|
if (typeof document === "undefined") return null;
|
|
2475
2490
|
if (dropdownPortalId) {
|
|
2476
2491
|
const element = document.getElementById(dropdownPortalId);
|
|
@@ -2479,7 +2494,7 @@ var LookupSelect = ({
|
|
|
2479
2494
|
return document.body;
|
|
2480
2495
|
}, [dropdownPortalId]);
|
|
2481
2496
|
const limitReached = value.length >= maxTags;
|
|
2482
|
-
const upsertOptionLabels =
|
|
2497
|
+
const upsertOptionLabels = React4.useCallback((options) => {
|
|
2483
2498
|
setOptionLabels((prev) => {
|
|
2484
2499
|
let next = null;
|
|
2485
2500
|
options.forEach((opt) => {
|
|
@@ -2492,7 +2507,7 @@ var LookupSelect = ({
|
|
|
2492
2507
|
return next ?? prev;
|
|
2493
2508
|
});
|
|
2494
2509
|
}, []);
|
|
2495
|
-
const addTag =
|
|
2510
|
+
const addTag = React4.useCallback(
|
|
2496
2511
|
(val) => {
|
|
2497
2512
|
const trimmed = val.trim();
|
|
2498
2513
|
if (!trimmed) return;
|
|
@@ -2505,7 +2520,7 @@ var LookupSelect = ({
|
|
|
2505
2520
|
},
|
|
2506
2521
|
[value, onChange, maxTags]
|
|
2507
2522
|
);
|
|
2508
|
-
const removeTag =
|
|
2523
|
+
const removeTag = React4.useCallback(
|
|
2509
2524
|
(index) => {
|
|
2510
2525
|
if (index < 0) return;
|
|
2511
2526
|
const newTags = value.filter((_, i) => i !== index);
|
|
@@ -2513,7 +2528,7 @@ var LookupSelect = ({
|
|
|
2513
2528
|
},
|
|
2514
2529
|
[value, onChange]
|
|
2515
2530
|
);
|
|
2516
|
-
const handleKeyDown =
|
|
2531
|
+
const handleKeyDown = React4.useCallback(
|
|
2517
2532
|
(e) => {
|
|
2518
2533
|
if (e.key === "Enter" || e.key === ",") {
|
|
2519
2534
|
e.preventDefault();
|
|
@@ -2524,21 +2539,21 @@ var LookupSelect = ({
|
|
|
2524
2539
|
},
|
|
2525
2540
|
[inputValue, removeTag, value.length]
|
|
2526
2541
|
);
|
|
2527
|
-
const handleClear =
|
|
2542
|
+
const handleClear = React4.useCallback(() => {
|
|
2528
2543
|
setInputValue("");
|
|
2529
2544
|
setSuggestions([]);
|
|
2530
2545
|
setIsDropdownOpen(false);
|
|
2531
2546
|
setFetchError(null);
|
|
2532
2547
|
if (onClear) onClear();
|
|
2533
2548
|
}, [onClear]);
|
|
2534
|
-
const handleSuggestionSelect =
|
|
2549
|
+
const handleSuggestionSelect = React4.useCallback(
|
|
2535
2550
|
(option) => {
|
|
2536
2551
|
upsertOptionLabels([option]);
|
|
2537
2552
|
addTag(option.value);
|
|
2538
2553
|
},
|
|
2539
2554
|
[addTag, upsertOptionLabels]
|
|
2540
2555
|
);
|
|
2541
|
-
const updateDropdownPosition =
|
|
2556
|
+
const updateDropdownPosition = React4.useCallback(() => {
|
|
2542
2557
|
if (!dropdownPortalElement || !containerRef.current) return;
|
|
2543
2558
|
const rect = containerRef.current.getBoundingClientRect();
|
|
2544
2559
|
setDropdownStyles({
|
|
@@ -2549,7 +2564,7 @@ var LookupSelect = ({
|
|
|
2549
2564
|
zIndex: 50
|
|
2550
2565
|
});
|
|
2551
2566
|
}, [dropdownPortalElement]);
|
|
2552
|
-
|
|
2567
|
+
React4.useEffect(() => {
|
|
2553
2568
|
if (!fetchSuggestions) return;
|
|
2554
2569
|
if (fetchDelayRef.current) {
|
|
2555
2570
|
clearTimeout(fetchDelayRef.current);
|
|
@@ -2589,7 +2604,7 @@ var LookupSelect = ({
|
|
|
2589
2604
|
}
|
|
2590
2605
|
};
|
|
2591
2606
|
}, [inputValue, fetchSuggestions, suggestionDebounce, upsertOptionLabels]);
|
|
2592
|
-
|
|
2607
|
+
React4.useEffect(() => {
|
|
2593
2608
|
const handleDocumentClick = (event) => {
|
|
2594
2609
|
const target = event.target;
|
|
2595
2610
|
if (containerRef.current?.contains(target)) return;
|
|
@@ -2601,11 +2616,11 @@ var LookupSelect = ({
|
|
|
2601
2616
|
document.removeEventListener("mousedown", handleDocumentClick);
|
|
2602
2617
|
};
|
|
2603
2618
|
}, []);
|
|
2604
|
-
|
|
2619
|
+
React4.useEffect(() => {
|
|
2605
2620
|
if (!limitReached) return;
|
|
2606
2621
|
setIsDropdownOpen(false);
|
|
2607
2622
|
}, [limitReached]);
|
|
2608
|
-
|
|
2623
|
+
React4.useEffect(() => {
|
|
2609
2624
|
if (!dropdownPortalElement) return;
|
|
2610
2625
|
if (!isDropdownOpen) return;
|
|
2611
2626
|
updateDropdownPosition();
|
|
@@ -3290,7 +3305,7 @@ var AdvanceSearch = ({
|
|
|
3290
3305
|
onSearch,
|
|
3291
3306
|
onClear
|
|
3292
3307
|
}) => {
|
|
3293
|
-
const fieldsData =
|
|
3308
|
+
const fieldsData = React4.useMemo(() => {
|
|
3294
3309
|
if (fields.length === 0) throw new Error("fields cannot be an empty array");
|
|
3295
3310
|
return fields || [];
|
|
3296
3311
|
}, [fields]);
|
|
@@ -3310,8 +3325,8 @@ var AdvanceSearch = ({
|
|
|
3310
3325
|
defaultValues: {}
|
|
3311
3326
|
});
|
|
3312
3327
|
const { handleSubmit, unregister, resetField, getValues, clearErrors, setError } = form;
|
|
3313
|
-
const [operatorErrors, setOperatorErrors] =
|
|
3314
|
-
const clearOperatorError =
|
|
3328
|
+
const [operatorErrors, setOperatorErrors] = React4__namespace.default.useState({});
|
|
3329
|
+
const clearOperatorError = React4.useCallback(
|
|
3315
3330
|
(rowId) => {
|
|
3316
3331
|
setOperatorErrors((prev) => {
|
|
3317
3332
|
if (!(rowId in prev)) return prev;
|
|
@@ -3321,7 +3336,7 @@ var AdvanceSearch = ({
|
|
|
3321
3336
|
},
|
|
3322
3337
|
[setOperatorErrors]
|
|
3323
3338
|
);
|
|
3324
|
-
const clearValue =
|
|
3339
|
+
const clearValue = React4.useCallback(
|
|
3325
3340
|
(rowId, which) => {
|
|
3326
3341
|
const fieldName = `${which}_${rowId}`;
|
|
3327
3342
|
resetField(fieldName, { defaultValue: void 0 });
|
|
@@ -3331,13 +3346,13 @@ var AdvanceSearch = ({
|
|
|
3331
3346
|
},
|
|
3332
3347
|
[resetField, clearErrors]
|
|
3333
3348
|
);
|
|
3334
|
-
const parseRangeValue =
|
|
3349
|
+
const parseRangeValue = React4.useCallback((raw, fieldType) => {
|
|
3335
3350
|
if (!raw) return void 0;
|
|
3336
3351
|
const normalized = fieldType === "datemonth" ? `${raw}-01` : raw;
|
|
3337
3352
|
const parsed = dateFns.parseISO(normalized);
|
|
3338
3353
|
return dateFns.isValid(parsed) ? parsed : void 0;
|
|
3339
3354
|
}, []);
|
|
3340
|
-
const onSubmit =
|
|
3355
|
+
const onSubmit = React4.useCallback(() => {
|
|
3341
3356
|
const operatorValidation = {};
|
|
3342
3357
|
rows.forEach((r) => {
|
|
3343
3358
|
const availableOperators = operatorsForField(r.fieldName);
|
|
@@ -3555,11 +3570,11 @@ function selectValueToBoolean(value) {
|
|
|
3555
3570
|
return void 0;
|
|
3556
3571
|
}
|
|
3557
3572
|
var useHover = () => {
|
|
3558
|
-
const [hovering, setHovering] =
|
|
3559
|
-
const prevRef =
|
|
3560
|
-
const onMouseEnter =
|
|
3561
|
-
const onMouseLeave =
|
|
3562
|
-
const nodeRefCallback =
|
|
3573
|
+
const [hovering, setHovering] = React4.useState(false);
|
|
3574
|
+
const prevRef = React4.useRef(null);
|
|
3575
|
+
const onMouseEnter = React4.useCallback(() => setHovering(true), []);
|
|
3576
|
+
const onMouseLeave = React4.useCallback(() => setHovering(false), []);
|
|
3577
|
+
const nodeRefCallback = React4.useCallback(
|
|
3563
3578
|
(node) => {
|
|
3564
3579
|
if (prevRef.current) {
|
|
3565
3580
|
prevRef.current.removeEventListener("mouseenter", onMouseEnter);
|
|
@@ -3587,15 +3602,15 @@ var useIntersectionObserver = ({
|
|
|
3587
3602
|
initialIsIntersecting = false,
|
|
3588
3603
|
onChange
|
|
3589
3604
|
} = {}) => {
|
|
3590
|
-
const [ref, setRef] =
|
|
3591
|
-
const [state, setState] =
|
|
3605
|
+
const [ref, setRef] = React4.useState(null);
|
|
3606
|
+
const [state, setState] = React4.useState(() => ({
|
|
3592
3607
|
isIntersecting: initialIsIntersecting,
|
|
3593
3608
|
entry: void 0
|
|
3594
3609
|
}));
|
|
3595
|
-
const callbackRef =
|
|
3610
|
+
const callbackRef = React4.useRef(null);
|
|
3596
3611
|
callbackRef.current = onChange;
|
|
3597
3612
|
const frozen = state.entry?.isIntersecting && freezeOnceVisible;
|
|
3598
|
-
|
|
3613
|
+
React4.useEffect(() => {
|
|
3599
3614
|
if (!ref) return;
|
|
3600
3615
|
if (!("IntersectionObserver" in window)) return;
|
|
3601
3616
|
if (frozen) return;
|
|
@@ -3625,8 +3640,8 @@ var useIntersectionObserver = ({
|
|
|
3625
3640
|
frozen,
|
|
3626
3641
|
freezeOnceVisible
|
|
3627
3642
|
]);
|
|
3628
|
-
const prevRef =
|
|
3629
|
-
|
|
3643
|
+
const prevRef = React4.useRef(null);
|
|
3644
|
+
React4.useEffect(() => {
|
|
3630
3645
|
if (!ref && state.entry?.target && !freezeOnceVisible && !frozen && prevRef.current !== state.entry.target) {
|
|
3631
3646
|
prevRef.current = state.entry.target;
|
|
3632
3647
|
setState({ isIntersecting: initialIsIntersecting, entry: void 0 });
|
|
@@ -3643,8 +3658,8 @@ var isValidMediaQueryString = (query) => {
|
|
|
3643
3658
|
return query !== "not all";
|
|
3644
3659
|
};
|
|
3645
3660
|
var useMediaQuery = ({ query }) => {
|
|
3646
|
-
const [matches, setMatches] =
|
|
3647
|
-
|
|
3661
|
+
const [matches, setMatches] = React4.useState(false);
|
|
3662
|
+
React4.useEffect(() => {
|
|
3648
3663
|
if (typeof window === "undefined") {
|
|
3649
3664
|
return;
|
|
3650
3665
|
}
|
|
@@ -3680,8 +3695,8 @@ var useTruncated = ({
|
|
|
3680
3695
|
onChange,
|
|
3681
3696
|
resizeDetectDelay = 150
|
|
3682
3697
|
}) => {
|
|
3683
|
-
const [isTruncated, setIsTruncated] =
|
|
3684
|
-
|
|
3698
|
+
const [isTruncated, setIsTruncated] = React4.useState(false);
|
|
3699
|
+
React4.useEffect(() => {
|
|
3685
3700
|
const element = elementRef.current;
|
|
3686
3701
|
if (!element) return;
|
|
3687
3702
|
const checkTruncate = debounce(() => {
|
|
@@ -3901,7 +3916,7 @@ var ColumnSeparator = ({ show, className, ...props }) => {
|
|
|
3901
3916
|
}
|
|
3902
3917
|
);
|
|
3903
3918
|
};
|
|
3904
|
-
var ColumnSeparator_default =
|
|
3919
|
+
var ColumnSeparator_default = React4__namespace.default.memo(ColumnSeparator);
|
|
3905
3920
|
var StatusContentSlot = ({
|
|
3906
3921
|
content,
|
|
3907
3922
|
icon,
|
|
@@ -3920,7 +3935,7 @@ var StatusContentSlot = ({
|
|
|
3920
3935
|
content
|
|
3921
3936
|
] });
|
|
3922
3937
|
};
|
|
3923
|
-
var StatusContentSlot_default =
|
|
3938
|
+
var StatusContentSlot_default = React4__namespace.default.memo(StatusContentSlot);
|
|
3924
3939
|
var stateOptions = [
|
|
3925
3940
|
"columnFilters",
|
|
3926
3941
|
"globalFilter",
|
|
@@ -3973,9 +3988,9 @@ var modelOptions = [
|
|
|
3973
3988
|
"getCenterVisibleLeafColumns"
|
|
3974
3989
|
];
|
|
3975
3990
|
var DataTableDevTool = ({ table }) => {
|
|
3976
|
-
const [open, setOpen] =
|
|
3977
|
-
const [visibleStates, setVisibleStates] =
|
|
3978
|
-
const [visibleModels, setVisibleModels] =
|
|
3991
|
+
const [open, setOpen] = React4.useState(false);
|
|
3992
|
+
const [visibleStates, setVisibleStates] = React4.useState([]);
|
|
3993
|
+
const [visibleModels, setVisibleModels] = React4.useState([]);
|
|
3979
3994
|
const tableState = table.getState();
|
|
3980
3995
|
const toggleValue = (arr, value) => arr.includes(value) ? arr.filter((v) => v !== value) : [...arr, value];
|
|
3981
3996
|
const getCircularReplacer = () => {
|
|
@@ -4235,14 +4250,14 @@ var DataTable = ({
|
|
|
4235
4250
|
if (isDefined(tableRef) && !isDefined(tableRef?.current)) {
|
|
4236
4251
|
tableRef.current = table;
|
|
4237
4252
|
}
|
|
4238
|
-
const tableContainerRef =
|
|
4253
|
+
const tableContainerRef = React4.useRef(null);
|
|
4239
4254
|
const isTableEmpty = table.getCoreRowModel().rows.length === 0;
|
|
4240
4255
|
const isTableEmptyAfterFiltering = table.getRowModel().rows.length === 0;
|
|
4241
4256
|
const isFiltering = table.getState().columnFilters.length > 0 || !!table.getState().globalFilter;
|
|
4242
4257
|
const leftVisibleLeftColumns = table.getLeftVisibleLeafColumns();
|
|
4243
4258
|
const centerVisibleLeafColumns = table.getCenterVisibleLeafColumns();
|
|
4244
4259
|
const rightVisibleLeafColumns = table.getRightVisibleLeafColumns();
|
|
4245
|
-
const { isSomeColumnsFilterable, filterableColumns } =
|
|
4260
|
+
const { isSomeColumnsFilterable, filterableColumns } = React4.useMemo(() => {
|
|
4246
4261
|
const mergedColumns = [
|
|
4247
4262
|
...leftVisibleLeftColumns,
|
|
4248
4263
|
...centerVisibleLeafColumns,
|
|
@@ -4253,7 +4268,7 @@ var DataTable = ({
|
|
|
4253
4268
|
);
|
|
4254
4269
|
return { isSomeColumnsFilterable: isSomeColumnsFilterable2, filterableColumns: mergedColumns };
|
|
4255
4270
|
}, [centerVisibleLeafColumns, leftVisibleLeftColumns, rightVisibleLeafColumns]);
|
|
4256
|
-
const autoStatusKey =
|
|
4271
|
+
const autoStatusKey = React4.useMemo(() => {
|
|
4257
4272
|
if (isInitialLoading) return "initialLoading";
|
|
4258
4273
|
if (isTableEmpty) return "emptyData";
|
|
4259
4274
|
if (isTableEmptyAfterFiltering) return "emptyFilteredData";
|
|
@@ -4271,14 +4286,14 @@ var DataTable = ({
|
|
|
4271
4286
|
scrollFetch?.hasMore,
|
|
4272
4287
|
scrollFetch?.isFetchingMore
|
|
4273
4288
|
]);
|
|
4274
|
-
const activeStatusContentComputed =
|
|
4289
|
+
const activeStatusContentComputed = React4.useMemo(() => {
|
|
4275
4290
|
if (!activeStatusContent) return autoStatusKey;
|
|
4276
4291
|
if (typeof activeStatusContent === "function") {
|
|
4277
4292
|
return activeStatusContent({ defaultComputedValue: autoStatusKey });
|
|
4278
4293
|
}
|
|
4279
4294
|
return activeStatusContent;
|
|
4280
4295
|
}, [activeStatusContent, autoStatusKey]);
|
|
4281
|
-
const fetchMoreOnScrollReached =
|
|
4296
|
+
const fetchMoreOnScrollReached = React4.useCallback(
|
|
4282
4297
|
(containerRefElement) => {
|
|
4283
4298
|
if (!scrollFetch?.enabled || !containerRefElement || scrollFetch?.isFetchingMore || !scrollFetch?.hasMore || !scrollFetch?.fetchMore) {
|
|
4284
4299
|
return;
|
|
@@ -4312,7 +4327,7 @@ var DataTable = ({
|
|
|
4312
4327
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4313
4328
|
[scrollFetch?.enabled, scrollFetch?.isFetchingMore, scrollFetch?.hasMore, scrollFetch?.fetchMore]
|
|
4314
4329
|
);
|
|
4315
|
-
|
|
4330
|
+
React4.useEffect(() => {
|
|
4316
4331
|
fetchMoreOnScrollReached(tableContainerRef.current);
|
|
4317
4332
|
}, [fetchMoreOnScrollReached]);
|
|
4318
4333
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -4442,7 +4457,7 @@ var DataTable = ({
|
|
|
4442
4457
|
),
|
|
4443
4458
|
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { ...components?.tableBodyProps, children: table.getRowModel().rows.map((row) => {
|
|
4444
4459
|
const tableDataRowProps = typeof components?.tableDataRowProps === "function" ? components.tableDataRowProps({ row, table }) || {} : components?.tableDataRowProps || {};
|
|
4445
|
-
return /* @__PURE__ */
|
|
4460
|
+
return /* @__PURE__ */ React4.createElement(
|
|
4446
4461
|
TableRow,
|
|
4447
4462
|
{
|
|
4448
4463
|
"data-testid": `table-data-row-${row.id}`,
|
|
@@ -4805,11 +4820,11 @@ function DialogAlert({
|
|
|
4805
4820
|
persistent = false
|
|
4806
4821
|
}) {
|
|
4807
4822
|
const alignClass = align === "start" ? "justify-start" : align === "end" ? "justify-end" : "justify-center";
|
|
4808
|
-
const handleCancel =
|
|
4823
|
+
const handleCancel = React4.useCallback(() => {
|
|
4809
4824
|
onCancel?.();
|
|
4810
4825
|
onOpenChange(false);
|
|
4811
4826
|
}, [onCancel, onOpenChange]);
|
|
4812
|
-
const handleConfirm =
|
|
4827
|
+
const handleConfirm = React4.useCallback(() => {
|
|
4813
4828
|
onConfirm?.();
|
|
4814
4829
|
}, [onConfirm]);
|
|
4815
4830
|
return /* @__PURE__ */ jsxRuntime.jsx(Dialog2, { open, onOpenChange: persistent ? () => {
|
|
@@ -4895,7 +4910,7 @@ function SortableRow({
|
|
|
4895
4910
|
id: value,
|
|
4896
4911
|
disabled: name === "columns.0.id"
|
|
4897
4912
|
});
|
|
4898
|
-
const style =
|
|
4913
|
+
const style = React4__namespace.useMemo(
|
|
4899
4914
|
() => ({
|
|
4900
4915
|
transform: utilities.CSS.Transform.toString(transform),
|
|
4901
4916
|
transition
|
|
@@ -5007,8 +5022,8 @@ var GridSettingsModal = ({
|
|
|
5007
5022
|
onClose,
|
|
5008
5023
|
onSaveColumns
|
|
5009
5024
|
}) => {
|
|
5010
|
-
const [isDragging, setIsDragging] =
|
|
5011
|
-
const scrollRef =
|
|
5025
|
+
const [isDragging, setIsDragging] = React4.useState(false);
|
|
5026
|
+
const scrollRef = React4.useRef(null);
|
|
5012
5027
|
const form = reactHookForm.useForm({
|
|
5013
5028
|
resolver: zod$1.zodResolver(GridSettingsSchema),
|
|
5014
5029
|
defaultValues: { columns: currentColumns },
|
|
@@ -5020,7 +5035,7 @@ var GridSettingsModal = ({
|
|
|
5020
5035
|
name: "columns",
|
|
5021
5036
|
keyName: "fieldId"
|
|
5022
5037
|
});
|
|
5023
|
-
|
|
5038
|
+
React4.useEffect(() => {
|
|
5024
5039
|
if (isOpen) {
|
|
5025
5040
|
form.reset({ columns: currentColumns });
|
|
5026
5041
|
}
|
|
@@ -5237,7 +5252,7 @@ var useGridSettingsStore = zustand.create(
|
|
|
5237
5252
|
);
|
|
5238
5253
|
var useGridSettingsStore_default = useGridSettingsStore;
|
|
5239
5254
|
var ListTable = ({ onTableReady, children }) => {
|
|
5240
|
-
|
|
5255
|
+
React4__namespace.useEffect(() => {
|
|
5241
5256
|
if (onTableReady) {
|
|
5242
5257
|
onTableReady({ ready: true });
|
|
5243
5258
|
}
|
|
@@ -5341,26 +5356,48 @@ var InfoIcon = (props) => {
|
|
|
5341
5356
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5342
5357
|
"svg",
|
|
5343
5358
|
{
|
|
5344
|
-
width: "
|
|
5345
|
-
height: "
|
|
5346
|
-
viewBox: "0 0
|
|
5359
|
+
width: "20",
|
|
5360
|
+
height: "20",
|
|
5361
|
+
viewBox: "0 0 20 20",
|
|
5347
5362
|
fill: "none",
|
|
5348
5363
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5349
5364
|
...props,
|
|
5350
5365
|
children: [
|
|
5351
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "6.98438", cy: "6.63281", r: "6.25", fill: "white" }),
|
|
5352
5366
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5353
5367
|
"path",
|
|
5354
5368
|
{
|
|
5355
|
-
d: "
|
|
5356
|
-
|
|
5369
|
+
d: "M10.0013 18.3327C14.6037 18.3327 18.3346 14.6017 18.3346 9.99935C18.3346 5.39698 14.6037 1.66602 10.0013 1.66602C5.39893 1.66602 1.66797 5.39698 1.66797 9.99935C1.66797 14.6017 5.39893 18.3327 10.0013 18.3327Z",
|
|
5370
|
+
stroke: "white",
|
|
5371
|
+
"stroke-width": "1.5",
|
|
5372
|
+
"stroke-linecap": "round",
|
|
5373
|
+
"stroke-linejoin": "round"
|
|
5374
|
+
}
|
|
5375
|
+
),
|
|
5376
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5377
|
+
"path",
|
|
5378
|
+
{
|
|
5379
|
+
d: "M10 13.3333V10",
|
|
5380
|
+
stroke: "white",
|
|
5381
|
+
"stroke-width": "1.5",
|
|
5382
|
+
"stroke-linecap": "round",
|
|
5383
|
+
"stroke-linejoin": "round"
|
|
5384
|
+
}
|
|
5385
|
+
),
|
|
5386
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5387
|
+
"path",
|
|
5388
|
+
{
|
|
5389
|
+
d: "M10 6.66602H10.0083",
|
|
5390
|
+
stroke: "white",
|
|
5391
|
+
"stroke-width": "1.5",
|
|
5392
|
+
"stroke-linecap": "round",
|
|
5393
|
+
"stroke-linejoin": "round"
|
|
5357
5394
|
}
|
|
5358
5395
|
)
|
|
5359
5396
|
]
|
|
5360
5397
|
}
|
|
5361
5398
|
);
|
|
5362
5399
|
};
|
|
5363
|
-
var InfoIcon_default =
|
|
5400
|
+
var InfoIcon_default = React4__namespace.default.memo(InfoIcon);
|
|
5364
5401
|
var Navbar = ({
|
|
5365
5402
|
className,
|
|
5366
5403
|
title,
|
|
@@ -5385,7 +5422,7 @@ var Navbar = ({
|
|
|
5385
5422
|
}) => {
|
|
5386
5423
|
const { isMobile, isTablet, isDesktop } = useScreenSize_default();
|
|
5387
5424
|
const Icon2 = lucideReact.CircleHelp;
|
|
5388
|
-
const shouldShowSeparator = !separatorDisable &&
|
|
5425
|
+
const shouldShowSeparator = !separatorDisable && React4.isValidElement(searchButton);
|
|
5389
5426
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5390
5427
|
"nav",
|
|
5391
5428
|
{
|
|
@@ -5396,8 +5433,8 @@ var Navbar = ({
|
|
|
5396
5433
|
children: [
|
|
5397
5434
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2.5", children: [
|
|
5398
5435
|
headImageURL !== "" ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: headImageURL, alt: "", className: cn("w-full h-full", headImageURLClassName) }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
|
|
5399
|
-
|
|
5400
|
-
|
|
5436
|
+
React4.isValidElement(title) ? title : /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-white text-xl font-bold", children: title }),
|
|
5437
|
+
React4.isValidElement(subTitle) ? subTitle : /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-white text-sm font-semibold", children: subTitle })
|
|
5401
5438
|
] }),
|
|
5402
5439
|
tooltipTitle && /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
5403
5440
|
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("button", { className: "text-white hover:opacity-80 ", children: /* @__PURE__ */ jsxRuntime.jsx(InfoIcon_default, { className: "w-4" }) }) }),
|
|
@@ -5428,10 +5465,10 @@ var Navbar = ({
|
|
|
5428
5465
|
),
|
|
5429
5466
|
children: [
|
|
5430
5467
|
tooltipTitle && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
5431
|
-
|
|
5468
|
+
React4.isValidElement(tooltipIcon) ? tooltipIcon : /* @__PURE__ */ jsxRuntime.jsx(Icon2, { size: 32, "aria-hidden": "true" }),
|
|
5432
5469
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-xl font-bold", children: tooltipTitle })
|
|
5433
5470
|
] }),
|
|
5434
|
-
|
|
5471
|
+
React4.isValidElement(tooltipdescription) && tooltipdescription
|
|
5435
5472
|
]
|
|
5436
5473
|
}
|
|
5437
5474
|
),
|
|
@@ -5485,13 +5522,13 @@ var Navbar = ({
|
|
|
5485
5522
|
}
|
|
5486
5523
|
),
|
|
5487
5524
|
shouldShowSeparator && /* @__PURE__ */ jsxRuntime.jsx("div", { role: "separator", className: "ml-1 w-[1px] h-10 bg-white" }),
|
|
5488
|
-
|
|
5525
|
+
React4.isValidElement(searchButton) ? searchButton : ""
|
|
5489
5526
|
] })
|
|
5490
5527
|
]
|
|
5491
5528
|
}
|
|
5492
5529
|
);
|
|
5493
5530
|
};
|
|
5494
|
-
var navbar_default =
|
|
5531
|
+
var navbar_default = React4__namespace.default.memo(Navbar);
|
|
5495
5532
|
function Sheet({ ...props }) {
|
|
5496
5533
|
return /* @__PURE__ */ jsxRuntime.jsx(SheetPrimitive__namespace.Root, { "data-slot": "sheet", ...props });
|
|
5497
5534
|
}
|
|
@@ -5594,7 +5631,7 @@ var usePreventPageLeaveStore_default = usePreventPageLeaveStore;
|
|
|
5594
5631
|
// src/components/prevent-page-leave/PreventPageLeave.tsx
|
|
5595
5632
|
var PreventPageLeave = ({ children }) => {
|
|
5596
5633
|
const { isPreventing } = usePreventPageLeaveStore();
|
|
5597
|
-
|
|
5634
|
+
React4.useEffect(() => {
|
|
5598
5635
|
if (!isPreventing || typeof window === "undefined") {
|
|
5599
5636
|
return;
|
|
5600
5637
|
}
|
|
@@ -5612,7 +5649,7 @@ var PreventPageLeave = ({ children }) => {
|
|
|
5612
5649
|
var PreventPageLeave_default = PreventPageLeave;
|
|
5613
5650
|
var usePreventPageLeave = ({ isPrevening }) => {
|
|
5614
5651
|
const setPreventing = usePreventPageLeaveStore_default((state) => state.setPreventing);
|
|
5615
|
-
|
|
5652
|
+
React4.useEffect(() => {
|
|
5616
5653
|
setPreventing(isPrevening);
|
|
5617
5654
|
}, [isPrevening, setPreventing]);
|
|
5618
5655
|
};
|
|
@@ -5891,21 +5928,21 @@ function ToolbarPlugin({
|
|
|
5891
5928
|
acceptImageMimeTypes
|
|
5892
5929
|
}) {
|
|
5893
5930
|
const [editor] = LexicalComposerContext.useLexicalComposerContext();
|
|
5894
|
-
const [state, setState] =
|
|
5895
|
-
const fileInputRef =
|
|
5896
|
-
const [isLinkDialogOpen, setLinkDialogOpen] =
|
|
5897
|
-
const [editingExistingLink, setEditingExistingLink] =
|
|
5898
|
-
const [linkNodeKey, setLinkNodeKey] =
|
|
5899
|
-
const [isImageDialogOpen, setImageDialogOpen] =
|
|
5900
|
-
const [editingExistingImage, setEditingExistingImage] =
|
|
5901
|
-
const [imageNodeKey, setImageNodeKey] =
|
|
5931
|
+
const [state, setState] = React4.useState(initialToolbarState);
|
|
5932
|
+
const fileInputRef = React4.useRef(null);
|
|
5933
|
+
const [isLinkDialogOpen, setLinkDialogOpen] = React4.useState(false);
|
|
5934
|
+
const [editingExistingLink, setEditingExistingLink] = React4.useState(false);
|
|
5935
|
+
const [linkNodeKey, setLinkNodeKey] = React4.useState(null);
|
|
5936
|
+
const [isImageDialogOpen, setImageDialogOpen] = React4.useState(false);
|
|
5937
|
+
const [editingExistingImage, setEditingExistingImage] = React4.useState(false);
|
|
5938
|
+
const [imageNodeKey, setImageNodeKey] = React4.useState(null);
|
|
5902
5939
|
const linkForm = reactHookForm.useForm({
|
|
5903
5940
|
defaultValues: { url: "", label: "" }
|
|
5904
5941
|
});
|
|
5905
5942
|
const imageForm = reactHookForm.useForm({
|
|
5906
5943
|
defaultValues: { url: "", alt: "", width: "", height: "" }
|
|
5907
5944
|
});
|
|
5908
|
-
const openImageDialog =
|
|
5945
|
+
const openImageDialog = React4.useCallback(() => {
|
|
5909
5946
|
if (disabled || !allowImageUrlInsert) {
|
|
5910
5947
|
return;
|
|
5911
5948
|
}
|
|
@@ -5939,7 +5976,7 @@ function ToolbarPlugin({
|
|
|
5939
5976
|
setImageNodeKey(targetImage?.getKey() ?? null);
|
|
5940
5977
|
setImageDialogOpen(true);
|
|
5941
5978
|
}, [allowImageUrlInsert, disabled, editor, imageForm]);
|
|
5942
|
-
const closeImageDialog =
|
|
5979
|
+
const closeImageDialog = React4.useCallback(() => {
|
|
5943
5980
|
setImageDialogOpen(false);
|
|
5944
5981
|
setEditingExistingImage(false);
|
|
5945
5982
|
setImageNodeKey(null);
|
|
@@ -5948,7 +5985,7 @@ function ToolbarPlugin({
|
|
|
5948
5985
|
editor.focus();
|
|
5949
5986
|
}, 0);
|
|
5950
5987
|
}, [editor, imageForm]);
|
|
5951
|
-
const openLinkDialog =
|
|
5988
|
+
const openLinkDialog = React4.useCallback(() => {
|
|
5952
5989
|
if (disabled) {
|
|
5953
5990
|
return;
|
|
5954
5991
|
}
|
|
@@ -5988,7 +6025,7 @@ function ToolbarPlugin({
|
|
|
5988
6025
|
setLinkNodeKey(detectedLink?.getKey() ?? null);
|
|
5989
6026
|
setLinkDialogOpen(true);
|
|
5990
6027
|
}, [disabled, editor, linkForm]);
|
|
5991
|
-
const closeLinkDialog =
|
|
6028
|
+
const closeLinkDialog = React4.useCallback(() => {
|
|
5992
6029
|
setLinkDialogOpen(false);
|
|
5993
6030
|
setEditingExistingLink(false);
|
|
5994
6031
|
setLinkNodeKey(null);
|
|
@@ -6029,7 +6066,7 @@ function ToolbarPlugin({
|
|
|
6029
6066
|
});
|
|
6030
6067
|
closeLinkDialog();
|
|
6031
6068
|
});
|
|
6032
|
-
const handleRemoveLink =
|
|
6069
|
+
const handleRemoveLink = React4.useCallback(() => {
|
|
6033
6070
|
editor.focus();
|
|
6034
6071
|
editor.update(() => {
|
|
6035
6072
|
if (linkNodeKey) {
|
|
@@ -6046,7 +6083,7 @@ function ToolbarPlugin({
|
|
|
6046
6083
|
});
|
|
6047
6084
|
closeLinkDialog();
|
|
6048
6085
|
}, [closeLinkDialog, editor, linkNodeKey]);
|
|
6049
|
-
const handleLinkDialogOpenChange =
|
|
6086
|
+
const handleLinkDialogOpenChange = React4.useCallback(
|
|
6050
6087
|
(open) => {
|
|
6051
6088
|
if (open) {
|
|
6052
6089
|
setLinkDialogOpen(true);
|
|
@@ -6056,7 +6093,7 @@ function ToolbarPlugin({
|
|
|
6056
6093
|
},
|
|
6057
6094
|
[closeLinkDialog]
|
|
6058
6095
|
);
|
|
6059
|
-
const updateToolbar =
|
|
6096
|
+
const updateToolbar = React4.useCallback(() => {
|
|
6060
6097
|
const selection = lexical.$getSelection();
|
|
6061
6098
|
if (!lexical.$isRangeSelection(selection)) {
|
|
6062
6099
|
return;
|
|
@@ -6096,7 +6133,7 @@ function ToolbarPlugin({
|
|
|
6096
6133
|
isLink: hasLink
|
|
6097
6134
|
}));
|
|
6098
6135
|
}, []);
|
|
6099
|
-
|
|
6136
|
+
React4__namespace.useEffect(() => {
|
|
6100
6137
|
return utils.mergeRegister(
|
|
6101
6138
|
editor.registerCommand(
|
|
6102
6139
|
lexical.CAN_UNDO_COMMAND,
|
|
@@ -6127,7 +6164,7 @@ function ToolbarPlugin({
|
|
|
6127
6164
|
})
|
|
6128
6165
|
);
|
|
6129
6166
|
}, [editor, updateToolbar]);
|
|
6130
|
-
const applyBlock =
|
|
6167
|
+
const applyBlock = React4.useCallback(
|
|
6131
6168
|
(nextBlock) => {
|
|
6132
6169
|
if (disabled) {
|
|
6133
6170
|
return;
|
|
@@ -6189,7 +6226,7 @@ function ToolbarPlugin({
|
|
|
6189
6226
|
},
|
|
6190
6227
|
[disabled, editor, state.blockType]
|
|
6191
6228
|
);
|
|
6192
|
-
const toggleFormat =
|
|
6229
|
+
const toggleFormat = React4.useCallback(
|
|
6193
6230
|
(format5) => {
|
|
6194
6231
|
if (disabled) {
|
|
6195
6232
|
return;
|
|
@@ -6198,10 +6235,10 @@ function ToolbarPlugin({
|
|
|
6198
6235
|
},
|
|
6199
6236
|
[disabled, editor]
|
|
6200
6237
|
);
|
|
6201
|
-
const toggleLink =
|
|
6238
|
+
const toggleLink = React4.useCallback(() => {
|
|
6202
6239
|
openLinkDialog();
|
|
6203
6240
|
}, [openLinkDialog]);
|
|
6204
|
-
const applyElementFormat =
|
|
6241
|
+
const applyElementFormat = React4.useCallback(
|
|
6205
6242
|
(format5) => {
|
|
6206
6243
|
if (disabled) {
|
|
6207
6244
|
return;
|
|
@@ -6212,7 +6249,7 @@ function ToolbarPlugin({
|
|
|
6212
6249
|
);
|
|
6213
6250
|
const canInsertImage = allowImageUrlInsert || Boolean(onImageUpload);
|
|
6214
6251
|
const imageAccept = acceptImageMimeTypes ?? DEFAULT_IMAGE_ACCEPT;
|
|
6215
|
-
const handleInsertImage =
|
|
6252
|
+
const handleInsertImage = React4.useCallback(() => {
|
|
6216
6253
|
if (disabled || !canInsertImage) {
|
|
6217
6254
|
return;
|
|
6218
6255
|
}
|
|
@@ -6223,7 +6260,7 @@ function ToolbarPlugin({
|
|
|
6223
6260
|
}
|
|
6224
6261
|
openImageDialog();
|
|
6225
6262
|
}, [canInsertImage, disabled, editor, onImageUpload, openImageDialog]);
|
|
6226
|
-
const handleFileChange =
|
|
6263
|
+
const handleFileChange = React4.useCallback(
|
|
6227
6264
|
async (event) => {
|
|
6228
6265
|
if (!onImageUpload) {
|
|
6229
6266
|
return;
|
|
@@ -6313,7 +6350,7 @@ function ToolbarPlugin({
|
|
|
6313
6350
|
});
|
|
6314
6351
|
closeImageDialog();
|
|
6315
6352
|
});
|
|
6316
|
-
const handleImageDialogOpenChange =
|
|
6353
|
+
const handleImageDialogOpenChange = React4.useCallback(
|
|
6317
6354
|
(open) => {
|
|
6318
6355
|
if (open) {
|
|
6319
6356
|
setImageDialogOpen(true);
|
|
@@ -6323,7 +6360,7 @@ function ToolbarPlugin({
|
|
|
6323
6360
|
},
|
|
6324
6361
|
[closeImageDialog]
|
|
6325
6362
|
);
|
|
6326
|
-
const handleRemoveImage =
|
|
6363
|
+
const handleRemoveImage = React4.useCallback(() => {
|
|
6327
6364
|
if (!imageNodeKey) {
|
|
6328
6365
|
closeImageDialog();
|
|
6329
6366
|
return;
|
|
@@ -6682,7 +6719,7 @@ function ControlledValuePlugin({
|
|
|
6682
6719
|
trackAppliedValue
|
|
6683
6720
|
}) {
|
|
6684
6721
|
const [editor] = LexicalComposerContext.useLexicalComposerContext();
|
|
6685
|
-
|
|
6722
|
+
React4__namespace.useEffect(() => {
|
|
6686
6723
|
if (value == null || trackAppliedValue.current === value) {
|
|
6687
6724
|
return;
|
|
6688
6725
|
}
|
|
@@ -6706,14 +6743,14 @@ function ControlledValuePlugin({
|
|
|
6706
6743
|
}
|
|
6707
6744
|
function EditableStatePlugin({ editable }) {
|
|
6708
6745
|
const [editor] = LexicalComposerContext.useLexicalComposerContext();
|
|
6709
|
-
|
|
6746
|
+
React4__namespace.useEffect(() => {
|
|
6710
6747
|
editor.setEditable(editable);
|
|
6711
6748
|
}, [editor, editable]);
|
|
6712
6749
|
return null;
|
|
6713
6750
|
}
|
|
6714
6751
|
function ImagesPlugin() {
|
|
6715
6752
|
const [editor] = LexicalComposerContext.useLexicalComposerContext();
|
|
6716
|
-
|
|
6753
|
+
React4__namespace.useEffect(() => {
|
|
6717
6754
|
return editor.registerCommand(
|
|
6718
6755
|
INSERT_IMAGE_COMMAND,
|
|
6719
6756
|
(payload) => {
|
|
@@ -6732,7 +6769,7 @@ function ImagesPlugin() {
|
|
|
6732
6769
|
}, [editor]);
|
|
6733
6770
|
return null;
|
|
6734
6771
|
}
|
|
6735
|
-
var RichText =
|
|
6772
|
+
var RichText = React4.forwardRef(function RichText2({
|
|
6736
6773
|
value,
|
|
6737
6774
|
defaultValue,
|
|
6738
6775
|
onChange,
|
|
@@ -6751,11 +6788,11 @@ var RichText = React5.forwardRef(function RichText2({
|
|
|
6751
6788
|
id,
|
|
6752
6789
|
...rest
|
|
6753
6790
|
}, ref) {
|
|
6754
|
-
const initialSerializedStateRef =
|
|
6791
|
+
const initialSerializedStateRef = React4.useRef(void 0);
|
|
6755
6792
|
if (initialSerializedStateRef.current === void 0) {
|
|
6756
6793
|
initialSerializedStateRef.current = parseSerializedEditorState(value ?? defaultValue);
|
|
6757
6794
|
}
|
|
6758
|
-
const initialConfig =
|
|
6795
|
+
const initialConfig = React4.useMemo(
|
|
6759
6796
|
() => ({
|
|
6760
6797
|
namespace: "RichTextEditor",
|
|
6761
6798
|
editable: !(readOnly || disabled),
|
|
@@ -6768,8 +6805,8 @@ var RichText = React5.forwardRef(function RichText2({
|
|
|
6768
6805
|
}),
|
|
6769
6806
|
[disabled, readOnly]
|
|
6770
6807
|
);
|
|
6771
|
-
const appliedValueRef =
|
|
6772
|
-
const handleChange =
|
|
6808
|
+
const appliedValueRef = React4.useRef(value ?? defaultValue);
|
|
6809
|
+
const handleChange = React4.useCallback(
|
|
6773
6810
|
(editorState, editor) => {
|
|
6774
6811
|
const serialized = JSON.stringify(editorState.toJSON());
|
|
6775
6812
|
appliedValueRef.current = serialized;
|
|
@@ -6865,13 +6902,13 @@ function Separator2({
|
|
|
6865
6902
|
);
|
|
6866
6903
|
}
|
|
6867
6904
|
function useIsMobile(breakpoint = 768) {
|
|
6868
|
-
const [isMobile, setIsMobile] =
|
|
6905
|
+
const [isMobile, setIsMobile] = React4.useState(() => {
|
|
6869
6906
|
if (typeof window === "undefined") {
|
|
6870
6907
|
return false;
|
|
6871
6908
|
}
|
|
6872
6909
|
return window.innerWidth < breakpoint;
|
|
6873
6910
|
});
|
|
6874
|
-
|
|
6911
|
+
React4.useEffect(() => {
|
|
6875
6912
|
function onResize() {
|
|
6876
6913
|
setIsMobile(window.innerWidth < breakpoint);
|
|
6877
6914
|
}
|
|
@@ -6923,6 +6960,7 @@ __export(ui_exports, {
|
|
|
6923
6960
|
FormItem: () => FormItem,
|
|
6924
6961
|
FormLabel: () => FormLabel,
|
|
6925
6962
|
FormMessage: () => FormMessage,
|
|
6963
|
+
Input: () => Input,
|
|
6926
6964
|
InputPrimitive: () => InputPrimitive,
|
|
6927
6965
|
Label: () => Label2,
|
|
6928
6966
|
MonthPicker: () => MonthPicker,
|
|
@@ -6996,6 +7034,7 @@ __export(ui_exports, {
|
|
|
6996
7034
|
TooltipProvider: () => TooltipProvider2,
|
|
6997
7035
|
TooltipTrigger: () => TooltipTrigger2,
|
|
6998
7036
|
buttonVariants: () => buttonVariants,
|
|
7037
|
+
inputVariants: () => inputVariants,
|
|
6999
7038
|
spinnerVariants: () => spinnerVariants,
|
|
7000
7039
|
useFormField: () => useFormField,
|
|
7001
7040
|
useSidebar: () => useSidebar
|
|
@@ -7094,9 +7133,9 @@ var SIDEBAR_WIDTH = "16rem";
|
|
|
7094
7133
|
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
7095
7134
|
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
7096
7135
|
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
7097
|
-
var SidebarContext =
|
|
7136
|
+
var SidebarContext = React4__namespace.createContext(null);
|
|
7098
7137
|
function useSidebar() {
|
|
7099
|
-
const context =
|
|
7138
|
+
const context = React4__namespace.useContext(SidebarContext);
|
|
7100
7139
|
if (!context) {
|
|
7101
7140
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
7102
7141
|
}
|
|
@@ -7112,10 +7151,10 @@ function SidebarProvider({
|
|
|
7112
7151
|
...props
|
|
7113
7152
|
}) {
|
|
7114
7153
|
const isMobile = useIsMobile();
|
|
7115
|
-
const [openMobile, setOpenMobile] =
|
|
7116
|
-
const [_open, _setOpen] =
|
|
7154
|
+
const [openMobile, setOpenMobile] = React4__namespace.useState(false);
|
|
7155
|
+
const [_open, _setOpen] = React4__namespace.useState(defaultOpen);
|
|
7117
7156
|
const open = openProp ?? _open;
|
|
7118
|
-
const setOpen =
|
|
7157
|
+
const setOpen = React4__namespace.useCallback(
|
|
7119
7158
|
(value) => {
|
|
7120
7159
|
const openState = typeof value === "function" ? value(open) : value;
|
|
7121
7160
|
if (setOpenProp) {
|
|
@@ -7127,10 +7166,10 @@ function SidebarProvider({
|
|
|
7127
7166
|
},
|
|
7128
7167
|
[setOpenProp, open]
|
|
7129
7168
|
);
|
|
7130
|
-
const toggleSidebar =
|
|
7169
|
+
const toggleSidebar = React4__namespace.useCallback(() => {
|
|
7131
7170
|
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
7132
7171
|
}, [isMobile, setOpen, setOpenMobile]);
|
|
7133
|
-
|
|
7172
|
+
React4__namespace.useEffect(() => {
|
|
7134
7173
|
const handleKeyDown = (event) => {
|
|
7135
7174
|
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
7136
7175
|
event.preventDefault();
|
|
@@ -7141,7 +7180,7 @@ function SidebarProvider({
|
|
|
7141
7180
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
7142
7181
|
}, [toggleSidebar]);
|
|
7143
7182
|
const state = open ? "expanded" : "collapsed";
|
|
7144
|
-
const contextValue =
|
|
7183
|
+
const contextValue = React4__namespace.useMemo(
|
|
7145
7184
|
() => ({
|
|
7146
7185
|
state,
|
|
7147
7186
|
open,
|
|
@@ -7583,7 +7622,7 @@ function SidebarMenuSkeleton({
|
|
|
7583
7622
|
showIcon = false,
|
|
7584
7623
|
...props
|
|
7585
7624
|
}) {
|
|
7586
|
-
const width =
|
|
7625
|
+
const width = React4__namespace.useMemo(() => {
|
|
7587
7626
|
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
7588
7627
|
}, []);
|
|
7589
7628
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -7677,6 +7716,173 @@ function SidebarLayout({
|
|
|
7677
7716
|
] }) });
|
|
7678
7717
|
}
|
|
7679
7718
|
|
|
7719
|
+
// src/components/cropperModal/helper.ts
|
|
7720
|
+
var createImage = (url) => new Promise((resolve, reject) => {
|
|
7721
|
+
const image = new Image();
|
|
7722
|
+
image.addEventListener("load", () => resolve(image));
|
|
7723
|
+
image.addEventListener("error", (error) => reject(error));
|
|
7724
|
+
image.setAttribute("crossOrigin", "anonymous");
|
|
7725
|
+
image.src = url;
|
|
7726
|
+
});
|
|
7727
|
+
async function getCroppedImg(imageSrc, pixelCrop, desiredDimension) {
|
|
7728
|
+
const image = await createImage(imageSrc);
|
|
7729
|
+
const canvas = document.createElement("canvas");
|
|
7730
|
+
const ctx = canvas.getContext("2d");
|
|
7731
|
+
if (!ctx) {
|
|
7732
|
+
throw new Error("can not create canvas");
|
|
7733
|
+
}
|
|
7734
|
+
canvas.width = image.width;
|
|
7735
|
+
canvas.height = image.height;
|
|
7736
|
+
ctx.drawImage(image, 0, 0);
|
|
7737
|
+
const croppedCanvas = document.createElement("canvas");
|
|
7738
|
+
const croppedCtx = croppedCanvas.getContext("2d");
|
|
7739
|
+
if (!croppedCtx) {
|
|
7740
|
+
throw new Error("can not create canvas");
|
|
7741
|
+
}
|
|
7742
|
+
croppedCanvas.width = desiredDimension?.width ?? pixelCrop.width;
|
|
7743
|
+
croppedCanvas.height = desiredDimension?.height ?? pixelCrop.height;
|
|
7744
|
+
croppedCtx.drawImage(
|
|
7745
|
+
canvas,
|
|
7746
|
+
pixelCrop.x,
|
|
7747
|
+
pixelCrop.y,
|
|
7748
|
+
pixelCrop.width,
|
|
7749
|
+
pixelCrop.height,
|
|
7750
|
+
0,
|
|
7751
|
+
0,
|
|
7752
|
+
desiredDimension?.width ?? pixelCrop.width,
|
|
7753
|
+
desiredDimension?.height ?? pixelCrop.height
|
|
7754
|
+
);
|
|
7755
|
+
return new Promise((resolve, reject) => {
|
|
7756
|
+
croppedCanvas.toBlob((file) => {
|
|
7757
|
+
if (file) {
|
|
7758
|
+
resolve(URL.createObjectURL(file));
|
|
7759
|
+
} else {
|
|
7760
|
+
reject("croppedCanvas gave null object");
|
|
7761
|
+
}
|
|
7762
|
+
}, "image/png");
|
|
7763
|
+
});
|
|
7764
|
+
}
|
|
7765
|
+
var CropperModal = ({
|
|
7766
|
+
open,
|
|
7767
|
+
onOpenChange,
|
|
7768
|
+
imageSrc,
|
|
7769
|
+
onConfirm,
|
|
7770
|
+
onCancel,
|
|
7771
|
+
onError,
|
|
7772
|
+
cropSize,
|
|
7773
|
+
outputExactCropSize,
|
|
7774
|
+
generateBlobUrlOutput,
|
|
7775
|
+
title,
|
|
7776
|
+
props
|
|
7777
|
+
}) => {
|
|
7778
|
+
const [isLoading, setIsLoading] = React4.useState(false);
|
|
7779
|
+
const [crop, setCrop] = React4.useState({ x: 0, y: 0 });
|
|
7780
|
+
const [zoom, setZoom] = React4.useState();
|
|
7781
|
+
const [croppedAreaPixels, setCroppedAreaPixels] = React4.useState(null);
|
|
7782
|
+
const handleClose = React4.useCallback(() => {
|
|
7783
|
+
onOpenChange(false);
|
|
7784
|
+
}, [onOpenChange]);
|
|
7785
|
+
const handleCancel = React4.useCallback(() => {
|
|
7786
|
+
if (onCancel) {
|
|
7787
|
+
onCancel();
|
|
7788
|
+
}
|
|
7789
|
+
handleClose();
|
|
7790
|
+
}, [handleClose, onCancel]);
|
|
7791
|
+
const handleCropComplete = React4.useCallback((_, croppedAreaPixels2) => {
|
|
7792
|
+
setCroppedAreaPixels(croppedAreaPixels2);
|
|
7793
|
+
}, []);
|
|
7794
|
+
const handleConfirm = async () => {
|
|
7795
|
+
if (!imageSrc || !onConfirm) {
|
|
7796
|
+
handleClose();
|
|
7797
|
+
return;
|
|
7798
|
+
}
|
|
7799
|
+
if (!generateBlobUrlOutput) {
|
|
7800
|
+
onConfirm({ crop, croppedAreaPixels });
|
|
7801
|
+
return;
|
|
7802
|
+
}
|
|
7803
|
+
if (!croppedAreaPixels) {
|
|
7804
|
+
onConfirm({ crop, croppedAreaPixels, croppedImageBlobUrl: imageSrc });
|
|
7805
|
+
return;
|
|
7806
|
+
}
|
|
7807
|
+
setIsLoading(true);
|
|
7808
|
+
try {
|
|
7809
|
+
const desiredDimension = outputExactCropSize ? cropSize : void 0;
|
|
7810
|
+
const croppedImage = await getCroppedImg(imageSrc, croppedAreaPixels, desiredDimension);
|
|
7811
|
+
onConfirm({ crop, croppedAreaPixels, croppedImageBlobUrl: croppedImage });
|
|
7812
|
+
} catch (e) {
|
|
7813
|
+
if (onError) {
|
|
7814
|
+
onError(e);
|
|
7815
|
+
}
|
|
7816
|
+
} finally {
|
|
7817
|
+
setIsLoading(false);
|
|
7818
|
+
handleClose();
|
|
7819
|
+
}
|
|
7820
|
+
};
|
|
7821
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7822
|
+
Dialog,
|
|
7823
|
+
{
|
|
7824
|
+
open,
|
|
7825
|
+
onOpenChange: (nextOpen) => {
|
|
7826
|
+
if (!nextOpen) {
|
|
7827
|
+
handleClose();
|
|
7828
|
+
} else {
|
|
7829
|
+
onOpenChange(true);
|
|
7830
|
+
}
|
|
7831
|
+
},
|
|
7832
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7833
|
+
DialogContent,
|
|
7834
|
+
{
|
|
7835
|
+
className: "flex flex-col w-fit !max-w-6xl p-0 overflow-clip gap-0 border-0",
|
|
7836
|
+
...props?.dialogContent,
|
|
7837
|
+
children: [
|
|
7838
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7839
|
+
"div",
|
|
7840
|
+
{
|
|
7841
|
+
className: "flex w-full bg-[#82B495] text-white justify-between items-center p-4",
|
|
7842
|
+
...props?.dialogTitleContainer,
|
|
7843
|
+
children: [
|
|
7844
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { className: "text-2xl font-semibold", ...props?.dialogTitle, children: title ?? "Crop Image" }),
|
|
7845
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7846
|
+
"button",
|
|
7847
|
+
{
|
|
7848
|
+
type: "button",
|
|
7849
|
+
className: "text-white hover:text-gray-100 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",
|
|
7850
|
+
onClick: handleCancel,
|
|
7851
|
+
disabled: isLoading,
|
|
7852
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "w-4 h-4" })
|
|
7853
|
+
}
|
|
7854
|
+
)
|
|
7855
|
+
]
|
|
7856
|
+
}
|
|
7857
|
+
),
|
|
7858
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-120 md:w-[50vw] h-[70vh] mx-auto", ...props?.cropperContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7859
|
+
Cropper__default.default,
|
|
7860
|
+
{
|
|
7861
|
+
image: imageSrc ?? void 0,
|
|
7862
|
+
crop,
|
|
7863
|
+
onCropChange: setCrop,
|
|
7864
|
+
zoom,
|
|
7865
|
+
onZoomChange: setZoom,
|
|
7866
|
+
style: { containerStyle: { position: "relative", width: "100%", height: "100%" } },
|
|
7867
|
+
onCropComplete: handleCropComplete,
|
|
7868
|
+
aspect: cropSize ? cropSize.width / cropSize.height : void 0,
|
|
7869
|
+
zoomWithScroll: true,
|
|
7870
|
+
showGrid: true,
|
|
7871
|
+
restrictPosition: true,
|
|
7872
|
+
...props?.cropper
|
|
7873
|
+
}
|
|
7874
|
+
) }),
|
|
7875
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full py-4 px-8", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full justify-between", children: [
|
|
7876
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "cancel", onClick: handleCancel, disabled: isLoading, children: "Cancel" }),
|
|
7877
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-auto flex gap-x-2", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "default", onClick: handleConfirm, disabled: isLoading, children: "Confirm" }) })
|
|
7878
|
+
] }) })
|
|
7879
|
+
]
|
|
7880
|
+
}
|
|
7881
|
+
)
|
|
7882
|
+
}
|
|
7883
|
+
);
|
|
7884
|
+
};
|
|
7885
|
+
|
|
7680
7886
|
exports.Accordion = Accordion;
|
|
7681
7887
|
exports.AccordionContent = AccordionContent;
|
|
7682
7888
|
exports.AccordionItem = AccordionItem;
|
|
@@ -7688,6 +7894,7 @@ exports.Checkbox = Checkbox;
|
|
|
7688
7894
|
exports.Collapsible = Collapsible;
|
|
7689
7895
|
exports.CollapsibleContent = CollapsibleContent2;
|
|
7690
7896
|
exports.CollapsibleTrigger = CollapsibleTrigger2;
|
|
7897
|
+
exports.CropperModal = CropperModal;
|
|
7691
7898
|
exports.DataTable = DataTable_default;
|
|
7692
7899
|
exports.DatePicker = DatePicker2;
|
|
7693
7900
|
exports.Dialog = Dialog;
|