@easyvision/easyvision-ui 1.7.5 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +86 -0
- package/dist/easyvision.css +56 -13
- package/dist/index.cjs +281 -151
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +59 -1
- package/dist/index.d.ts +59 -1
- package/dist/index.js +181 -53
- package/dist/index.js.map +1 -1
- package/package.json +6 -3
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./easyvision.css');
|
|
4
4
|
require('./EasyVisionTable.css');
|
|
5
|
-
var
|
|
5
|
+
var React9 = require('react');
|
|
6
6
|
var lucideReact = require('lucide-react');
|
|
7
7
|
var clsx = require('clsx');
|
|
8
8
|
var tailwindMerge = require('tailwind-merge');
|
|
@@ -39,7 +39,7 @@ function _interopNamespace(e) {
|
|
|
39
39
|
return Object.freeze(n);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
var
|
|
42
|
+
var React9__namespace = /*#__PURE__*/_interopNamespace(React9);
|
|
43
43
|
var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
|
|
44
44
|
var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
|
|
45
45
|
var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
|
|
@@ -49,7 +49,7 @@ var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(DropdownMe
|
|
|
49
49
|
function cn(...inputs) {
|
|
50
50
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
51
51
|
}
|
|
52
|
-
var Input =
|
|
52
|
+
var Input = React9__namespace.forwardRef(
|
|
53
53
|
({ className, type, ...props }, ref) => {
|
|
54
54
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
55
55
|
"input",
|
|
@@ -113,26 +113,26 @@ var KIND_SUFFIX = {
|
|
|
113
113
|
var fullIdOf = (id, kind) => `${id}${KIND_SUFFIX[kind]}`;
|
|
114
114
|
var childIdOf = (parentFullId, childLocalId) => `${parentFullId}.${childLocalId}`;
|
|
115
115
|
var childFullIdOf = (parentFullId, childLocalId, childKind) => parentFullId ? `${childIdOf(parentFullId, childLocalId)}${KIND_SUFFIX[childKind]}` : fullIdOf(childLocalId, childKind);
|
|
116
|
-
var NamespaceContext =
|
|
116
|
+
var NamespaceContext = React9.createContext(null);
|
|
117
117
|
function NamespaceProvider({
|
|
118
118
|
fullId,
|
|
119
119
|
children
|
|
120
120
|
}) {
|
|
121
121
|
return /* @__PURE__ */ jsxRuntime.jsx(NamespaceContext.Provider, { value: fullId, children });
|
|
122
122
|
}
|
|
123
|
-
var useParentFullId = () =>
|
|
123
|
+
var useParentFullId = () => React9.useContext(NamespaceContext);
|
|
124
124
|
|
|
125
125
|
// store/useEasyVisionSlice.ts
|
|
126
126
|
function useEasyVisionSlice(kind, localId, opts) {
|
|
127
127
|
const parentFullId = useParentFullId();
|
|
128
|
-
const fullId =
|
|
128
|
+
const fullId = React9.useMemo(
|
|
129
129
|
() => childFullIdOf(parentFullId, localId, kind),
|
|
130
130
|
[parentFullId, localId, kind]
|
|
131
131
|
);
|
|
132
132
|
if (!easyVisionRegistry.getState().slices[fullId]) {
|
|
133
133
|
easyVisionRegistry.getState().ensure(kind, fullId, opts.init);
|
|
134
134
|
}
|
|
135
|
-
const slice =
|
|
135
|
+
const slice = React9.useSyncExternalStore(
|
|
136
136
|
easyVisionRegistry.subscribe,
|
|
137
137
|
() => {
|
|
138
138
|
const s = easyVisionRegistry.getState().slices[fullId];
|
|
@@ -141,27 +141,27 @@ function useEasyVisionSlice(kind, localId, opts) {
|
|
|
141
141
|
},
|
|
142
142
|
() => easyVisionRegistry.getState().ensure(kind, fullId, opts.init)
|
|
143
143
|
);
|
|
144
|
-
|
|
144
|
+
React9.useEffect(() => {
|
|
145
145
|
if (opts.clearWhen && opts.clearWhen(slice)) {
|
|
146
146
|
easyVisionRegistry.getState().drop(fullId);
|
|
147
147
|
easyVisionRegistry.getState().ensure(kind, fullId, opts.init);
|
|
148
148
|
}
|
|
149
149
|
}, [slice, fullId, kind, opts]);
|
|
150
|
-
|
|
150
|
+
React9.useEffect(() => {
|
|
151
151
|
opts.onStateChange?.(slice);
|
|
152
152
|
}, [slice]);
|
|
153
|
-
|
|
153
|
+
React9.useEffect(() => {
|
|
154
154
|
return () => {
|
|
155
155
|
if (!opts.persist) {
|
|
156
156
|
easyVisionRegistry.getState().drop(fullId);
|
|
157
157
|
}
|
|
158
158
|
};
|
|
159
159
|
}, [fullId]);
|
|
160
|
-
const patch =
|
|
160
|
+
const patch = React9.useMemo(
|
|
161
161
|
() => (partial) => easyVisionRegistry.getState().patch(fullId, partial),
|
|
162
162
|
[fullId]
|
|
163
163
|
);
|
|
164
|
-
const reset =
|
|
164
|
+
const reset = React9.useMemo(
|
|
165
165
|
() => () => {
|
|
166
166
|
easyVisionRegistry.getState().drop(fullId);
|
|
167
167
|
easyVisionRegistry.getState().ensure(kind, fullId, opts.init);
|
|
@@ -171,8 +171,8 @@ function useEasyVisionSlice(kind, localId, opts) {
|
|
|
171
171
|
return { fullId, slice, patch, reset };
|
|
172
172
|
}
|
|
173
173
|
function useDebouncedValue(value, delayMs) {
|
|
174
|
-
const [debounced, setDebounced] =
|
|
175
|
-
|
|
174
|
+
const [debounced, setDebounced] = React9.useState(value);
|
|
175
|
+
React9.useEffect(() => {
|
|
176
176
|
if (delayMs <= 0) {
|
|
177
177
|
setDebounced(value);
|
|
178
178
|
return;
|
|
@@ -205,8 +205,8 @@ function EasyVisionInput({
|
|
|
205
205
|
onStateChange: onStateChange ? (s) => onStateChange(s.value) : void 0
|
|
206
206
|
});
|
|
207
207
|
const debounced = useDebouncedValue(slice.value, debounceMs);
|
|
208
|
-
const lastEmittedRef =
|
|
209
|
-
|
|
208
|
+
const lastEmittedRef = React9.useRef(slice.value);
|
|
209
|
+
React9.useEffect(() => {
|
|
210
210
|
if (debounced !== lastEmittedRef.current) {
|
|
211
211
|
lastEmittedRef.current = debounced;
|
|
212
212
|
onChange?.(debounced);
|
|
@@ -257,7 +257,7 @@ function EasyVisionInput({
|
|
|
257
257
|
}
|
|
258
258
|
var Select = SelectPrimitive__namespace.Root;
|
|
259
259
|
var SelectValue = SelectPrimitive__namespace.Value;
|
|
260
|
-
var SelectTrigger =
|
|
260
|
+
var SelectTrigger = React9__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
261
261
|
SelectPrimitive__namespace.Trigger,
|
|
262
262
|
{
|
|
263
263
|
ref,
|
|
@@ -270,7 +270,7 @@ var SelectTrigger = React8__namespace.forwardRef(({ className, children, ...prop
|
|
|
270
270
|
}
|
|
271
271
|
));
|
|
272
272
|
SelectTrigger.displayName = SelectPrimitive__namespace.Trigger.displayName;
|
|
273
|
-
var SelectScrollUpButton =
|
|
273
|
+
var SelectScrollUpButton = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
274
274
|
SelectPrimitive__namespace.ScrollUpButton,
|
|
275
275
|
{
|
|
276
276
|
ref,
|
|
@@ -280,7 +280,7 @@ var SelectScrollUpButton = React8__namespace.forwardRef(({ className, ...props }
|
|
|
280
280
|
}
|
|
281
281
|
));
|
|
282
282
|
SelectScrollUpButton.displayName = SelectPrimitive__namespace.ScrollUpButton.displayName;
|
|
283
|
-
var SelectScrollDownButton =
|
|
283
|
+
var SelectScrollDownButton = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
284
284
|
SelectPrimitive__namespace.ScrollDownButton,
|
|
285
285
|
{
|
|
286
286
|
ref,
|
|
@@ -290,7 +290,7 @@ var SelectScrollDownButton = React8__namespace.forwardRef(({ className, ...props
|
|
|
290
290
|
}
|
|
291
291
|
));
|
|
292
292
|
SelectScrollDownButton.displayName = SelectPrimitive__namespace.ScrollDownButton.displayName;
|
|
293
|
-
var SelectContent =
|
|
293
|
+
var SelectContent = React9__namespace.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
294
294
|
SelectPrimitive__namespace.Content,
|
|
295
295
|
{
|
|
296
296
|
ref,
|
|
@@ -314,7 +314,7 @@ var SelectContent = React8__namespace.forwardRef(({ className, children, positio
|
|
|
314
314
|
}
|
|
315
315
|
) }));
|
|
316
316
|
SelectContent.displayName = SelectPrimitive__namespace.Content.displayName;
|
|
317
|
-
var SelectLabel =
|
|
317
|
+
var SelectLabel = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
318
318
|
SelectPrimitive__namespace.Label,
|
|
319
319
|
{
|
|
320
320
|
ref,
|
|
@@ -323,7 +323,7 @@ var SelectLabel = React8__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
323
323
|
}
|
|
324
324
|
));
|
|
325
325
|
SelectLabel.displayName = SelectPrimitive__namespace.Label.displayName;
|
|
326
|
-
var SelectItem =
|
|
326
|
+
var SelectItem = React9__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
327
327
|
SelectPrimitive__namespace.Item,
|
|
328
328
|
{
|
|
329
329
|
ref,
|
|
@@ -336,7 +336,7 @@ var SelectItem = React8__namespace.forwardRef(({ className, children, ...props }
|
|
|
336
336
|
}
|
|
337
337
|
));
|
|
338
338
|
SelectItem.displayName = SelectPrimitive__namespace.Item.displayName;
|
|
339
|
-
var SelectSeparator =
|
|
339
|
+
var SelectSeparator = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
340
340
|
SelectPrimitive__namespace.Separator,
|
|
341
341
|
{
|
|
342
342
|
ref,
|
|
@@ -367,7 +367,7 @@ var buttonVariants = classVarianceAuthority.cva("ev-btn", {
|
|
|
367
367
|
size: "default"
|
|
368
368
|
}
|
|
369
369
|
});
|
|
370
|
-
var Button =
|
|
370
|
+
var Button = React9__namespace.forwardRef(
|
|
371
371
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
372
372
|
const Comp = asChild ? reactSlot.Slot : "button";
|
|
373
373
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -383,7 +383,7 @@ var Button = React8__namespace.forwardRef(
|
|
|
383
383
|
Button.displayName = "Button";
|
|
384
384
|
var Popover = PopoverPrimitive__namespace.Root;
|
|
385
385
|
var PopoverTrigger = PopoverPrimitive__namespace.Trigger;
|
|
386
|
-
var PopoverContent =
|
|
386
|
+
var PopoverContent = React9__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
387
387
|
PopoverPrimitive__namespace.Content,
|
|
388
388
|
{
|
|
389
389
|
ref,
|
|
@@ -394,7 +394,7 @@ var PopoverContent = React8__namespace.forwardRef(({ className, align = "center"
|
|
|
394
394
|
}
|
|
395
395
|
) }));
|
|
396
396
|
PopoverContent.displayName = PopoverPrimitive__namespace.Content.displayName;
|
|
397
|
-
var Command =
|
|
397
|
+
var Command = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
398
398
|
cmdk.Command,
|
|
399
399
|
{
|
|
400
400
|
ref,
|
|
@@ -403,7 +403,7 @@ var Command = React8__namespace.forwardRef(({ className, ...props }, ref) => /*
|
|
|
403
403
|
}
|
|
404
404
|
));
|
|
405
405
|
Command.displayName = cmdk.Command.displayName;
|
|
406
|
-
var CommandInput =
|
|
406
|
+
var CommandInput = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ev-cmd-input-wrapper", "cmdk-input-wrapper": "", children: [
|
|
407
407
|
/* @__PURE__ */ jsxRuntime.jsx(reactIcons.MagnifyingGlassIcon, { className: "ev-cmd-input-icon" }),
|
|
408
408
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
409
409
|
cmdk.Command.Input,
|
|
@@ -415,7 +415,7 @@ var CommandInput = React8__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
415
415
|
)
|
|
416
416
|
] }));
|
|
417
417
|
CommandInput.displayName = cmdk.Command.Input.displayName;
|
|
418
|
-
var CommandList =
|
|
418
|
+
var CommandList = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
419
419
|
cmdk.Command.List,
|
|
420
420
|
{
|
|
421
421
|
ref,
|
|
@@ -424,7 +424,7 @@ var CommandList = React8__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
424
424
|
}
|
|
425
425
|
));
|
|
426
426
|
CommandList.displayName = cmdk.Command.List.displayName;
|
|
427
|
-
var CommandEmpty =
|
|
427
|
+
var CommandEmpty = React9__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
428
428
|
cmdk.Command.Empty,
|
|
429
429
|
{
|
|
430
430
|
ref,
|
|
@@ -433,7 +433,7 @@ var CommandEmpty = React8__namespace.forwardRef((props, ref) => /* @__PURE__ */
|
|
|
433
433
|
}
|
|
434
434
|
));
|
|
435
435
|
CommandEmpty.displayName = cmdk.Command.Empty.displayName;
|
|
436
|
-
var CommandGroup =
|
|
436
|
+
var CommandGroup = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
437
437
|
cmdk.Command.Group,
|
|
438
438
|
{
|
|
439
439
|
ref,
|
|
@@ -442,7 +442,7 @@ var CommandGroup = React8__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
442
442
|
}
|
|
443
443
|
));
|
|
444
444
|
CommandGroup.displayName = cmdk.Command.Group.displayName;
|
|
445
|
-
var CommandSeparator =
|
|
445
|
+
var CommandSeparator = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
446
446
|
cmdk.Command.Separator,
|
|
447
447
|
{
|
|
448
448
|
ref,
|
|
@@ -451,7 +451,7 @@ var CommandSeparator = React8__namespace.forwardRef(({ className, ...props }, re
|
|
|
451
451
|
}
|
|
452
452
|
));
|
|
453
453
|
CommandSeparator.displayName = cmdk.Command.Separator.displayName;
|
|
454
|
-
var CommandItem =
|
|
454
|
+
var CommandItem = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
455
455
|
cmdk.Command.Item,
|
|
456
456
|
{
|
|
457
457
|
ref,
|
|
@@ -485,10 +485,10 @@ function EasyVisionSelector({
|
|
|
485
485
|
onStateChange: onStateChange ? (s) => onStateChange(s.value) : void 0
|
|
486
486
|
});
|
|
487
487
|
const value = slice.value;
|
|
488
|
-
const [resolved, setResolved] =
|
|
488
|
+
const [resolved, setResolved] = React9.useState(
|
|
489
489
|
Array.isArray(options) ? options : null
|
|
490
490
|
);
|
|
491
|
-
|
|
491
|
+
React9.useEffect(() => {
|
|
492
492
|
if (typeof options === "function" && resolved === null) {
|
|
493
493
|
void options().then(setResolved).catch(() => setResolved([]));
|
|
494
494
|
} else if (Array.isArray(options)) {
|
|
@@ -496,10 +496,10 @@ function EasyVisionSelector({
|
|
|
496
496
|
}
|
|
497
497
|
}, [options, resolved]);
|
|
498
498
|
const opts = resolved ?? [];
|
|
499
|
-
const [pending, setPending] =
|
|
500
|
-
|
|
501
|
-
const lastEmittedRef =
|
|
502
|
-
|
|
499
|
+
const [pending, setPending] = React9.useState(value);
|
|
500
|
+
React9.useEffect(() => setPending(value), [value]);
|
|
501
|
+
const lastEmittedRef = React9.useRef(value);
|
|
502
|
+
React9.useEffect(() => {
|
|
503
503
|
if (value !== lastEmittedRef.current) {
|
|
504
504
|
lastEmittedRef.current = value;
|
|
505
505
|
onChange?.(value);
|
|
@@ -618,10 +618,11 @@ function TextWidget({ definition, value, onChange, onRemove }) {
|
|
|
618
618
|
}
|
|
619
619
|
var SENTINEL = "__easyvision_undef__";
|
|
620
620
|
function SelectorWidget({ definition, value, onChange, onRemove }) {
|
|
621
|
-
const [
|
|
621
|
+
const [open, setOpen] = React9.useState(false);
|
|
622
|
+
const [resolved, setResolved] = React9.useState(
|
|
622
623
|
Array.isArray(definition.options) ? definition.options : null
|
|
623
624
|
);
|
|
624
|
-
|
|
625
|
+
React9.useEffect(() => {
|
|
625
626
|
if (typeof definition.options === "function" && resolved === null) {
|
|
626
627
|
void definition.options().then((o) => setResolved(o)).catch(() => setResolved([]));
|
|
627
628
|
} else if (Array.isArray(definition.options)) {
|
|
@@ -631,14 +632,23 @@ function SelectorWidget({ definition, value, onChange, onRemove }) {
|
|
|
631
632
|
const opts = resolved ?? [];
|
|
632
633
|
const selectValue = value === void 0 || value === "" ? SENTINEL : String(value);
|
|
633
634
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ev-mf-chip is-wrap", children: [
|
|
634
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
635
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
636
|
+
"span",
|
|
637
|
+
{
|
|
638
|
+
className: "ev-mf-chip-label is-clickable",
|
|
639
|
+
onClick: () => setOpen(true),
|
|
640
|
+
children: [
|
|
641
|
+
definition.label,
|
|
642
|
+
definition.mandatory && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ev-mf-chip-required", children: "*" }),
|
|
643
|
+
":"
|
|
644
|
+
]
|
|
645
|
+
}
|
|
646
|
+
),
|
|
639
647
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
640
648
|
Select,
|
|
641
649
|
{
|
|
650
|
+
open,
|
|
651
|
+
onOpenChange: setOpen,
|
|
642
652
|
value: selectValue,
|
|
643
653
|
onValueChange: (raw) => {
|
|
644
654
|
if (raw === SENTINEL) onChange(void 0);
|
|
@@ -664,7 +674,7 @@ function SelectorWidget({ definition, value, onChange, onRemove }) {
|
|
|
664
674
|
)
|
|
665
675
|
] });
|
|
666
676
|
}
|
|
667
|
-
var Checkbox =
|
|
677
|
+
var Checkbox = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
668
678
|
CheckboxPrimitive__namespace.Root,
|
|
669
679
|
{
|
|
670
680
|
ref,
|
|
@@ -680,21 +690,22 @@ function MultiSelectWidget({
|
|
|
680
690
|
onChange,
|
|
681
691
|
onRemove
|
|
682
692
|
}) {
|
|
683
|
-
const [search, setSearch] =
|
|
693
|
+
const [search, setSearch] = React9.useState("");
|
|
694
|
+
const [open, setOpen] = React9.useState(false);
|
|
684
695
|
const searchFn = definition.searchOptions;
|
|
685
696
|
const hasSearchOptions = typeof searchFn === "function";
|
|
686
|
-
const [resolved, setResolved] =
|
|
697
|
+
const [resolved, setResolved] = React9.useState(
|
|
687
698
|
Array.isArray(definition.options) ? definition.options : null
|
|
688
699
|
);
|
|
689
|
-
|
|
700
|
+
React9.useEffect(() => {
|
|
690
701
|
if (typeof definition.options === "function" && resolved === null) {
|
|
691
702
|
void definition.options().then(setResolved).catch(() => setResolved([]));
|
|
692
703
|
} else if (Array.isArray(definition.options)) {
|
|
693
704
|
setResolved(definition.options);
|
|
694
705
|
}
|
|
695
706
|
}, [definition.options, resolved]);
|
|
696
|
-
const [searchResults, setSearchResults] =
|
|
697
|
-
|
|
707
|
+
const [searchResults, setSearchResults] = React9.useState([]);
|
|
708
|
+
React9.useEffect(() => {
|
|
698
709
|
if (!searchFn) return;
|
|
699
710
|
if (search.trim() === "") {
|
|
700
711
|
setSearchResults([]);
|
|
@@ -715,11 +726,11 @@ function MultiSelectWidget({
|
|
|
715
726
|
}, [search, searchFn]);
|
|
716
727
|
const selected = Array.isArray(value) ? value : [];
|
|
717
728
|
const baseOpts = resolved ?? [];
|
|
718
|
-
const labelCache =
|
|
719
|
-
|
|
729
|
+
const labelCache = React9.useRef(/* @__PURE__ */ new Map());
|
|
730
|
+
React9.useEffect(() => {
|
|
720
731
|
baseOpts.forEach((o) => labelCache.current.set(o.value, o.label));
|
|
721
732
|
}, [baseOpts]);
|
|
722
|
-
const listOpts =
|
|
733
|
+
const listOpts = React9.useMemo(() => {
|
|
723
734
|
if (hasSearchOptions) return searchResults;
|
|
724
735
|
return baseOpts.filter(
|
|
725
736
|
(o) => o.label.toLowerCase().includes(search.toLowerCase())
|
|
@@ -734,11 +745,18 @@ function MultiSelectWidget({
|
|
|
734
745
|
const removeOne = (v) => onChange(selected.filter((x) => x !== v));
|
|
735
746
|
const labelOf = (v) => labelCache.current.get(v) ?? baseOpts.find((o) => o.value === v)?.label ?? String(v);
|
|
736
747
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ev-mf-chip is-wrap", children: [
|
|
737
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
748
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
749
|
+
"span",
|
|
750
|
+
{
|
|
751
|
+
className: "ev-mf-chip-label is-clickable",
|
|
752
|
+
onClick: () => setOpen(true),
|
|
753
|
+
children: [
|
|
754
|
+
definition.label,
|
|
755
|
+
definition.mandatory && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ev-mf-chip-required", children: "*" }),
|
|
756
|
+
":"
|
|
757
|
+
]
|
|
758
|
+
}
|
|
759
|
+
),
|
|
742
760
|
selected.map((v) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ev-mf-chip-badge", children: [
|
|
743
761
|
labelOf(v),
|
|
744
762
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -751,7 +769,7 @@ function MultiSelectWidget({
|
|
|
751
769
|
}
|
|
752
770
|
)
|
|
753
771
|
] }, String(v))),
|
|
754
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
|
|
772
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
755
773
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "ev-mf-chip-caret", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, {}) }) }),
|
|
756
774
|
/* @__PURE__ */ jsxRuntime.jsxs(PopoverContent, { className: "ev-mf-ms-popover", align: "start", children: [
|
|
757
775
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1045,7 +1063,7 @@ function buildCondition(def, value) {
|
|
|
1045
1063
|
}
|
|
1046
1064
|
}
|
|
1047
1065
|
function useBuildQuery(config, values, childQueries) {
|
|
1048
|
-
return
|
|
1066
|
+
return React9.useCallback(() => {
|
|
1049
1067
|
const where = {};
|
|
1050
1068
|
if (config.searchField) {
|
|
1051
1069
|
const c = buildCondition(config.searchField, values[config.searchField.id]);
|
|
@@ -1142,7 +1160,7 @@ function isMandatorySatisfied(def, value) {
|
|
|
1142
1160
|
if (!def.mandatory) return true;
|
|
1143
1161
|
return isNonEmpty(value);
|
|
1144
1162
|
}
|
|
1145
|
-
var EasyVisionMultifilter =
|
|
1163
|
+
var EasyVisionMultifilter = React9.forwardRef(function EasyVisionMultifilter2(props, ref) {
|
|
1146
1164
|
const {
|
|
1147
1165
|
id,
|
|
1148
1166
|
config,
|
|
@@ -1167,7 +1185,7 @@ var EasyVisionMultifilter = React8.forwardRef(function EasyVisionMultifilter2(pr
|
|
|
1167
1185
|
const resolvedPerformMode = performMode === "live" ? "live" : "manual";
|
|
1168
1186
|
const labels = { ...DEFAULT_LABELS, ...labelOverrides };
|
|
1169
1187
|
const showClear = showClearAll ?? editable;
|
|
1170
|
-
const initialActive =
|
|
1188
|
+
const initialActive = React9.useMemo(() => {
|
|
1171
1189
|
const ids = [];
|
|
1172
1190
|
if (config.searchField) ids.push(config.searchField.id);
|
|
1173
1191
|
for (const f of config.fields) {
|
|
@@ -1175,7 +1193,7 @@ var EasyVisionMultifilter = React8.forwardRef(function EasyVisionMultifilter2(pr
|
|
|
1175
1193
|
}
|
|
1176
1194
|
return ids;
|
|
1177
1195
|
}, [config]);
|
|
1178
|
-
const initialValues =
|
|
1196
|
+
const initialValues = React9.useMemo(() => {
|
|
1179
1197
|
const v = {};
|
|
1180
1198
|
if (config.searchField?.defaultValue !== void 0) {
|
|
1181
1199
|
v[config.searchField.id] = config.searchField.defaultValue;
|
|
@@ -1202,12 +1220,12 @@ var EasyVisionMultifilter = React8.forwardRef(function EasyVisionMultifilter2(pr
|
|
|
1202
1220
|
}) : void 0
|
|
1203
1221
|
});
|
|
1204
1222
|
const { activeFields, values, lastConfirmedSnapshotJSON } = slice;
|
|
1205
|
-
const registryState =
|
|
1223
|
+
const registryState = React9.useSyncExternalStore(
|
|
1206
1224
|
easyVisionRegistry.subscribe,
|
|
1207
1225
|
easyVisionRegistry.getState,
|
|
1208
1226
|
easyVisionRegistry.getState
|
|
1209
1227
|
);
|
|
1210
|
-
const childSnapshots =
|
|
1228
|
+
const childSnapshots = React9.useMemo(() => {
|
|
1211
1229
|
const out = {};
|
|
1212
1230
|
for (const f of config.fields) {
|
|
1213
1231
|
if (f.type !== "multifilter") continue;
|
|
@@ -1222,7 +1240,7 @@ var EasyVisionMultifilter = React8.forwardRef(function EasyVisionMultifilter2(pr
|
|
|
1222
1240
|
}
|
|
1223
1241
|
return out;
|
|
1224
1242
|
}, [fullId, config.fields, registryState]);
|
|
1225
|
-
const childQueries =
|
|
1243
|
+
const childQueries = React9.useMemo(() => {
|
|
1226
1244
|
const out = {};
|
|
1227
1245
|
for (const f of config.fields) {
|
|
1228
1246
|
if (f.type !== "multifilter") continue;
|
|
@@ -1233,7 +1251,7 @@ var EasyVisionMultifilter = React8.forwardRef(function EasyVisionMultifilter2(pr
|
|
|
1233
1251
|
return out;
|
|
1234
1252
|
}, [config.fields, childSnapshots]);
|
|
1235
1253
|
const buildQuery = useBuildQuery(config, values, childQueries);
|
|
1236
|
-
const composedValues =
|
|
1254
|
+
const composedValues = React9.useMemo(() => {
|
|
1237
1255
|
const out = { ...values };
|
|
1238
1256
|
for (const f of config.fields) {
|
|
1239
1257
|
if (f.type === "multifilter") {
|
|
@@ -1242,7 +1260,7 @@ var EasyVisionMultifilter = React8.forwardRef(function EasyVisionMultifilter2(pr
|
|
|
1242
1260
|
}
|
|
1243
1261
|
return out;
|
|
1244
1262
|
}, [values, config.fields, childSnapshots]);
|
|
1245
|
-
const isValid =
|
|
1263
|
+
const isValid = React9.useMemo(() => {
|
|
1246
1264
|
if (config.searchField && !isMandatorySatisfied(config.searchField, values[config.searchField.id])) {
|
|
1247
1265
|
return false;
|
|
1248
1266
|
}
|
|
@@ -1264,15 +1282,15 @@ var EasyVisionMultifilter = React8.forwardRef(function EasyVisionMultifilter2(pr
|
|
|
1264
1282
|
}
|
|
1265
1283
|
return true;
|
|
1266
1284
|
}, [config, values, childSnapshots]);
|
|
1267
|
-
const snapshotKey =
|
|
1285
|
+
const snapshotKey = React9.useMemo(
|
|
1268
1286
|
() => buildSnapshotKey({ activeFields, values: composedValues }),
|
|
1269
1287
|
[activeFields, composedValues]
|
|
1270
1288
|
);
|
|
1271
|
-
const dirty =
|
|
1289
|
+
const dirty = React9.useMemo(
|
|
1272
1290
|
() => isDirty({ activeFields, values: composedValues }, lastConfirmedSnapshotJSON),
|
|
1273
1291
|
[activeFields, composedValues, lastConfirmedSnapshotJSON]
|
|
1274
1292
|
);
|
|
1275
|
-
const snapshot =
|
|
1293
|
+
const snapshot = React9.useMemo(
|
|
1276
1294
|
() => ({
|
|
1277
1295
|
values: composedValues,
|
|
1278
1296
|
activeFields,
|
|
@@ -1282,15 +1300,15 @@ var EasyVisionMultifilter = React8.forwardRef(function EasyVisionMultifilter2(pr
|
|
|
1282
1300
|
}),
|
|
1283
1301
|
[composedValues, activeFields, isValid, dirty, buildQuery]
|
|
1284
1302
|
);
|
|
1285
|
-
const lastEmittedKeyRef =
|
|
1286
|
-
|
|
1303
|
+
const lastEmittedKeyRef = React9.useRef("");
|
|
1304
|
+
React9.useEffect(() => {
|
|
1287
1305
|
const key = `${snapshotKey}|${dirty}|${isValid}`;
|
|
1288
1306
|
if (key === lastEmittedKeyRef.current) return;
|
|
1289
1307
|
lastEmittedKeyRef.current = key;
|
|
1290
1308
|
onChange?.(snapshot);
|
|
1291
1309
|
onStateChange?.(snapshot);
|
|
1292
1310
|
}, [snapshotKey, dirty, isValid, snapshot, onChange, onStateChange]);
|
|
1293
|
-
const performAction =
|
|
1311
|
+
const performAction = React9.useCallback(() => {
|
|
1294
1312
|
const key = buildSnapshotKey({ activeFields, values: composedValues });
|
|
1295
1313
|
patch({ lastConfirmedSnapshotJSON: key });
|
|
1296
1314
|
if (onPerform) {
|
|
@@ -1298,16 +1316,16 @@ var EasyVisionMultifilter = React8.forwardRef(function EasyVisionMultifilter2(pr
|
|
|
1298
1316
|
queueMicrotask(() => onPerform(emitted));
|
|
1299
1317
|
}
|
|
1300
1318
|
}, [activeFields, composedValues, patch, onPerform, snapshot]);
|
|
1301
|
-
const didPerformOnMountRef =
|
|
1302
|
-
|
|
1319
|
+
const didPerformOnMountRef = React9.useRef(false);
|
|
1320
|
+
React9.useEffect(() => {
|
|
1303
1321
|
if (performOnMount && !didPerformOnMountRef.current && Object.values(composedValues).some(isNonEmpty)) {
|
|
1304
1322
|
didPerformOnMountRef.current = true;
|
|
1305
1323
|
performAction();
|
|
1306
1324
|
}
|
|
1307
1325
|
}, [performOnMount]);
|
|
1308
|
-
const liveTimerRef =
|
|
1309
|
-
const livePrevKeyRef =
|
|
1310
|
-
|
|
1326
|
+
const liveTimerRef = React9.useRef(null);
|
|
1327
|
+
const livePrevKeyRef = React9.useRef(null);
|
|
1328
|
+
React9.useEffect(() => {
|
|
1311
1329
|
if (resolvedPerformMode !== "live") return;
|
|
1312
1330
|
if (livePrevKeyRef.current === null) {
|
|
1313
1331
|
livePrevKeyRef.current = snapshotKey;
|
|
@@ -1327,24 +1345,24 @@ var EasyVisionMultifilter = React8.forwardRef(function EasyVisionMultifilter2(pr
|
|
|
1327
1345
|
}
|
|
1328
1346
|
};
|
|
1329
1347
|
}, [snapshotKey, resolvedPerformMode, performDebounceMs, performAction]);
|
|
1330
|
-
|
|
1348
|
+
React9.useImperativeHandle(ref, () => ({
|
|
1331
1349
|
perform: performAction,
|
|
1332
1350
|
getSnapshot: () => snapshot
|
|
1333
1351
|
}));
|
|
1334
|
-
const updateValue =
|
|
1352
|
+
const updateValue = React9.useCallback(
|
|
1335
1353
|
(fieldId, value) => {
|
|
1336
1354
|
patch({ values: { ...values, [fieldId]: value } });
|
|
1337
1355
|
},
|
|
1338
1356
|
[patch, values]
|
|
1339
1357
|
);
|
|
1340
|
-
const addField =
|
|
1358
|
+
const addField = React9.useCallback(
|
|
1341
1359
|
(fieldId) => {
|
|
1342
1360
|
if (activeFields.includes(fieldId)) return;
|
|
1343
1361
|
patch({ activeFields: [...activeFields, fieldId] });
|
|
1344
1362
|
},
|
|
1345
1363
|
[activeFields, patch]
|
|
1346
1364
|
);
|
|
1347
|
-
const removeField =
|
|
1365
|
+
const removeField = React9.useCallback(
|
|
1348
1366
|
(fieldId) => {
|
|
1349
1367
|
const nextValues = { ...values };
|
|
1350
1368
|
delete nextValues[fieldId];
|
|
@@ -1355,7 +1373,7 @@ var EasyVisionMultifilter = React8.forwardRef(function EasyVisionMultifilter2(pr
|
|
|
1355
1373
|
},
|
|
1356
1374
|
[activeFields, values, patch]
|
|
1357
1375
|
);
|
|
1358
|
-
const clearAll =
|
|
1376
|
+
const clearAll = React9.useCallback(() => {
|
|
1359
1377
|
const seed = {};
|
|
1360
1378
|
if (config.searchField?.defaultValue !== void 0) {
|
|
1361
1379
|
seed[config.searchField.id] = config.searchField.defaultValue;
|
|
@@ -1369,22 +1387,22 @@ var EasyVisionMultifilter = React8.forwardRef(function EasyVisionMultifilter2(pr
|
|
|
1369
1387
|
lastConfirmedSnapshotJSON: null
|
|
1370
1388
|
});
|
|
1371
1389
|
}, [config, patch, initialActive]);
|
|
1372
|
-
const visibleConfigFields =
|
|
1390
|
+
const visibleConfigFields = React9.useMemo(
|
|
1373
1391
|
() => config.fields.filter((f) => isFieldVisible(f, composedValues)),
|
|
1374
1392
|
[config.fields, composedValues]
|
|
1375
1393
|
);
|
|
1376
1394
|
const isProminentTextField = (f) => f.type === "text" && f.prominent === true;
|
|
1377
|
-
const pinnedFields =
|
|
1395
|
+
const pinnedFields = React9.useMemo(
|
|
1378
1396
|
() => visibleConfigFields.filter((f) => f.pinned && !isProminentTextField(f)),
|
|
1379
1397
|
[visibleConfigFields]
|
|
1380
1398
|
);
|
|
1381
|
-
const chipFields =
|
|
1399
|
+
const chipFields = React9.useMemo(
|
|
1382
1400
|
() => visibleConfigFields.filter(
|
|
1383
1401
|
(f) => !f.pinned && !isProminentTextField(f) && activeFields.includes(f.id)
|
|
1384
1402
|
),
|
|
1385
1403
|
[visibleConfigFields, activeFields]
|
|
1386
1404
|
);
|
|
1387
|
-
const prominentSlots =
|
|
1405
|
+
const prominentSlots = React9.useMemo(() => {
|
|
1388
1406
|
const slots = [];
|
|
1389
1407
|
if (config.searchField) {
|
|
1390
1408
|
slots.push({
|
|
@@ -1405,7 +1423,7 @@ var EasyVisionMultifilter = React8.forwardRef(function EasyVisionMultifilter2(pr
|
|
|
1405
1423
|
}
|
|
1406
1424
|
return slots;
|
|
1407
1425
|
}, [config.searchField, visibleConfigFields, activeFields, editable]);
|
|
1408
|
-
const availableToAdd =
|
|
1426
|
+
const availableToAdd = React9.useMemo(
|
|
1409
1427
|
() => visibleConfigFields.filter(
|
|
1410
1428
|
(f) => !f.pinned && !activeFields.includes(f.id)
|
|
1411
1429
|
),
|
|
@@ -1610,33 +1628,143 @@ function buildChildQueryDirect(field, values) {
|
|
|
1610
1628
|
return Object.keys(where).length > 0 ? { where } : {};
|
|
1611
1629
|
}
|
|
1612
1630
|
var join = (...parts) => parts.filter(Boolean).join(" ");
|
|
1613
|
-
var EasyVisionCard =
|
|
1631
|
+
var EasyVisionCard = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: join("ev-card", className), ...props }));
|
|
1614
1632
|
EasyVisionCard.displayName = "EasyVisionCard";
|
|
1615
|
-
var EasyVisionCardHeader =
|
|
1633
|
+
var EasyVisionCardHeader = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: join("ev-card-header", className), ...props }));
|
|
1616
1634
|
EasyVisionCardHeader.displayName = "EasyVisionCardHeader";
|
|
1617
|
-
var EasyVisionCardTitle =
|
|
1635
|
+
var EasyVisionCardTitle = React9__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("h3", { ref, className: join("ev-card-title", className), ...props, children }));
|
|
1618
1636
|
EasyVisionCardTitle.displayName = "EasyVisionCardTitle";
|
|
1619
|
-
var EasyVisionCardDescription =
|
|
1637
|
+
var EasyVisionCardDescription = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("p", { ref, className: join("ev-card-description", className), ...props }));
|
|
1620
1638
|
EasyVisionCardDescription.displayName = "EasyVisionCardDescription";
|
|
1621
|
-
var EasyVisionCardContent =
|
|
1639
|
+
var EasyVisionCardContent = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: join("ev-card-content", className), ...props }));
|
|
1622
1640
|
EasyVisionCardContent.displayName = "EasyVisionCardContent";
|
|
1623
|
-
var EasyVisionCardFooter =
|
|
1641
|
+
var EasyVisionCardFooter = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: join("ev-card-footer", className), ...props }));
|
|
1624
1642
|
EasyVisionCardFooter.displayName = "EasyVisionCardFooter";
|
|
1625
|
-
var
|
|
1643
|
+
var join2 = (...parts) => parts.filter(Boolean).join(" ");
|
|
1644
|
+
function EasyVisionAccordionItem(_props) {
|
|
1645
|
+
return null;
|
|
1646
|
+
}
|
|
1647
|
+
EasyVisionAccordionItem.displayName = "EasyVisionAccordionItem";
|
|
1648
|
+
function normalizeFromChildren(children) {
|
|
1649
|
+
const out = [];
|
|
1650
|
+
React9__namespace.Children.forEach(children, (child) => {
|
|
1651
|
+
if (!React9__namespace.isValidElement(child)) return;
|
|
1652
|
+
if (child.type !== EasyVisionAccordionItem) return;
|
|
1653
|
+
const p = child.props;
|
|
1654
|
+
out.push({
|
|
1655
|
+
id: p.id,
|
|
1656
|
+
question: p.question,
|
|
1657
|
+
content: p.children,
|
|
1658
|
+
defaultOpen: p.defaultOpen,
|
|
1659
|
+
disabled: p.disabled,
|
|
1660
|
+
className: p.className
|
|
1661
|
+
});
|
|
1662
|
+
});
|
|
1663
|
+
return out;
|
|
1664
|
+
}
|
|
1665
|
+
function normalizeFromItems(items) {
|
|
1666
|
+
return items.map((it) => ({
|
|
1667
|
+
id: it.id,
|
|
1668
|
+
question: it.question,
|
|
1669
|
+
content: it.content,
|
|
1670
|
+
defaultOpen: it.defaultOpen,
|
|
1671
|
+
disabled: it.disabled
|
|
1672
|
+
}));
|
|
1673
|
+
}
|
|
1674
|
+
function AccordionRow({ item, open, onToggle }) {
|
|
1675
|
+
const panelId = `ev-accordion-panel-${item.id}`;
|
|
1676
|
+
const triggerId = `ev-accordion-trigger-${item.id}`;
|
|
1677
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: join2("ev-accordion-item", item.className), children: [
|
|
1678
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1679
|
+
"button",
|
|
1680
|
+
{
|
|
1681
|
+
type: "button",
|
|
1682
|
+
id: triggerId,
|
|
1683
|
+
className: join2("ev-accordion-trigger", open && "ev-accordion-trigger-open"),
|
|
1684
|
+
"aria-expanded": open,
|
|
1685
|
+
"aria-controls": panelId,
|
|
1686
|
+
disabled: item.disabled,
|
|
1687
|
+
onClick: () => onToggle(item.id),
|
|
1688
|
+
children: [
|
|
1689
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "ev-accordion-question", children: item.question }),
|
|
1690
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "ev-accordion-icon", "aria-hidden": "true" })
|
|
1691
|
+
]
|
|
1692
|
+
}
|
|
1693
|
+
),
|
|
1694
|
+
open && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1695
|
+
"div",
|
|
1696
|
+
{
|
|
1697
|
+
id: panelId,
|
|
1698
|
+
role: "region",
|
|
1699
|
+
"aria-labelledby": triggerId,
|
|
1700
|
+
className: "ev-accordion-panel",
|
|
1701
|
+
children: item.content
|
|
1702
|
+
}
|
|
1703
|
+
)
|
|
1704
|
+
] });
|
|
1705
|
+
}
|
|
1706
|
+
function EasyVisionAccordion({
|
|
1707
|
+
items,
|
|
1708
|
+
children,
|
|
1709
|
+
mode = "single",
|
|
1710
|
+
openIds,
|
|
1711
|
+
defaultOpenIds,
|
|
1712
|
+
onOpenChange,
|
|
1713
|
+
className
|
|
1714
|
+
}) {
|
|
1715
|
+
const normalized = React9__namespace.useMemo(
|
|
1716
|
+
() => items ? normalizeFromItems(items) : normalizeFromChildren(children),
|
|
1717
|
+
[items, children]
|
|
1718
|
+
);
|
|
1719
|
+
const isControlled = openIds !== void 0;
|
|
1720
|
+
const [internalOpen, setInternalOpen] = React9__namespace.useState(() => {
|
|
1721
|
+
if (defaultOpenIds) return new Set(defaultOpenIds);
|
|
1722
|
+
return new Set(normalized.filter((it) => it.defaultOpen).map((it) => it.id));
|
|
1723
|
+
});
|
|
1724
|
+
const openSet = React9__namespace.useMemo(
|
|
1725
|
+
() => isControlled ? new Set(openIds) : internalOpen,
|
|
1726
|
+
[isControlled, openIds, internalOpen]
|
|
1727
|
+
);
|
|
1728
|
+
const handleToggle = React9__namespace.useCallback(
|
|
1729
|
+
(id) => {
|
|
1730
|
+
const next = new Set(openSet);
|
|
1731
|
+
if (next.has(id)) {
|
|
1732
|
+
next.delete(id);
|
|
1733
|
+
} else {
|
|
1734
|
+
if (mode === "single") next.clear();
|
|
1735
|
+
next.add(id);
|
|
1736
|
+
}
|
|
1737
|
+
if (!isControlled) setInternalOpen(next);
|
|
1738
|
+
onOpenChange?.(Array.from(next));
|
|
1739
|
+
},
|
|
1740
|
+
[openSet, mode, isControlled, onOpenChange]
|
|
1741
|
+
);
|
|
1742
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: join2("ev-accordion", className), children: normalized.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1743
|
+
AccordionRow,
|
|
1744
|
+
{
|
|
1745
|
+
item,
|
|
1746
|
+
open: openSet.has(item.id),
|
|
1747
|
+
onToggle: handleToggle
|
|
1748
|
+
},
|
|
1749
|
+
item.id
|
|
1750
|
+
)) });
|
|
1751
|
+
}
|
|
1752
|
+
EasyVisionAccordion.displayName = "EasyVisionAccordion";
|
|
1753
|
+
var Table = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("table", { ref, className: cn("ev-table", className), ...props }));
|
|
1626
1754
|
Table.displayName = "Table";
|
|
1627
|
-
var TableHeader =
|
|
1755
|
+
var TableHeader = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("thead", { ref, className, ...props }));
|
|
1628
1756
|
TableHeader.displayName = "TableHeader";
|
|
1629
|
-
var TableBody =
|
|
1757
|
+
var TableBody = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("tbody", { ref, className, ...props }));
|
|
1630
1758
|
TableBody.displayName = "TableBody";
|
|
1631
|
-
var TableFooter =
|
|
1759
|
+
var TableFooter = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("tfoot", { ref, className, ...props }));
|
|
1632
1760
|
TableFooter.displayName = "TableFooter";
|
|
1633
|
-
var TableRow =
|
|
1761
|
+
var TableRow = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("tr", { ref, className, ...props }));
|
|
1634
1762
|
TableRow.displayName = "TableRow";
|
|
1635
|
-
var TableHead =
|
|
1763
|
+
var TableHead = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("th", { ref, className, ...props }));
|
|
1636
1764
|
TableHead.displayName = "TableHead";
|
|
1637
|
-
var TableCell =
|
|
1765
|
+
var TableCell = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("td", { ref, className, ...props }));
|
|
1638
1766
|
TableCell.displayName = "TableCell";
|
|
1639
|
-
var TableCaption =
|
|
1767
|
+
var TableCaption = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("caption", { ref, className, ...props }));
|
|
1640
1768
|
TableCaption.displayName = "TableCaption";
|
|
1641
1769
|
var isNestedField = (field) => field.includes(".");
|
|
1642
1770
|
var resolvePath = (obj, path) => path.split(".").reduce(
|
|
@@ -1665,7 +1793,7 @@ function adaptColumns(columns, orderingMode, defaultSorting = "nonNested") {
|
|
|
1665
1793
|
};
|
|
1666
1794
|
const isUi = c.type === "ui";
|
|
1667
1795
|
const userCell = c.cell;
|
|
1668
|
-
const wrappedCell = userCell ? ({ row }) => userCell(row.original) : ({ getValue }) =>
|
|
1796
|
+
const wrappedCell = userCell ? ({ row }) => userCell(row.original) : ({ getValue }) => React9.createElement(
|
|
1669
1797
|
"span",
|
|
1670
1798
|
{ className: "text-sm text-foreground" },
|
|
1671
1799
|
String(getValue() ?? "-")
|
|
@@ -1745,7 +1873,7 @@ function useTableData({
|
|
|
1745
1873
|
paginationMode,
|
|
1746
1874
|
orderingMode
|
|
1747
1875
|
}) {
|
|
1748
|
-
return
|
|
1876
|
+
return React9.useMemo(() => {
|
|
1749
1877
|
let rows = data ?? [];
|
|
1750
1878
|
if (orderingMode === "local" && sort) {
|
|
1751
1879
|
const col = columns.find((c) => c.field === sort.column);
|
|
@@ -1766,7 +1894,7 @@ function useTableData({
|
|
|
1766
1894
|
var DropdownMenu = DropdownMenuPrimitive__namespace.Root;
|
|
1767
1895
|
var DropdownMenuTrigger = DropdownMenuPrimitive__namespace.Trigger;
|
|
1768
1896
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive__namespace.RadioGroup;
|
|
1769
|
-
var DropdownMenuSubTrigger =
|
|
1897
|
+
var DropdownMenuSubTrigger = React9__namespace.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1770
1898
|
DropdownMenuPrimitive__namespace.SubTrigger,
|
|
1771
1899
|
{
|
|
1772
1900
|
ref,
|
|
@@ -1783,7 +1911,7 @@ var DropdownMenuSubTrigger = React8__namespace.forwardRef(({ className, inset, c
|
|
|
1783
1911
|
}
|
|
1784
1912
|
));
|
|
1785
1913
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive__namespace.SubTrigger.displayName;
|
|
1786
|
-
var DropdownMenuSubContent =
|
|
1914
|
+
var DropdownMenuSubContent = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1787
1915
|
DropdownMenuPrimitive__namespace.SubContent,
|
|
1788
1916
|
{
|
|
1789
1917
|
ref,
|
|
@@ -1792,7 +1920,7 @@ var DropdownMenuSubContent = React8__namespace.forwardRef(({ className, ...props
|
|
|
1792
1920
|
}
|
|
1793
1921
|
));
|
|
1794
1922
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive__namespace.SubContent.displayName;
|
|
1795
|
-
var DropdownMenuContent =
|
|
1923
|
+
var DropdownMenuContent = React9__namespace.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1796
1924
|
DropdownMenuPrimitive__namespace.Content,
|
|
1797
1925
|
{
|
|
1798
1926
|
ref,
|
|
@@ -1802,7 +1930,7 @@ var DropdownMenuContent = React8__namespace.forwardRef(({ className, sideOffset
|
|
|
1802
1930
|
}
|
|
1803
1931
|
) }));
|
|
1804
1932
|
DropdownMenuContent.displayName = DropdownMenuPrimitive__namespace.Content.displayName;
|
|
1805
|
-
var DropdownMenuItem =
|
|
1933
|
+
var DropdownMenuItem = React9__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1806
1934
|
DropdownMenuPrimitive__namespace.Item,
|
|
1807
1935
|
{
|
|
1808
1936
|
ref,
|
|
@@ -1815,7 +1943,7 @@ var DropdownMenuItem = React8__namespace.forwardRef(({ className, inset, ...prop
|
|
|
1815
1943
|
}
|
|
1816
1944
|
));
|
|
1817
1945
|
DropdownMenuItem.displayName = DropdownMenuPrimitive__namespace.Item.displayName;
|
|
1818
|
-
var DropdownMenuCheckboxItem =
|
|
1946
|
+
var DropdownMenuCheckboxItem = React9__namespace.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1819
1947
|
DropdownMenuPrimitive__namespace.CheckboxItem,
|
|
1820
1948
|
{
|
|
1821
1949
|
ref,
|
|
@@ -1829,7 +1957,7 @@ var DropdownMenuCheckboxItem = React8__namespace.forwardRef(({ className, childr
|
|
|
1829
1957
|
}
|
|
1830
1958
|
));
|
|
1831
1959
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive__namespace.CheckboxItem.displayName;
|
|
1832
|
-
var DropdownMenuRadioItem =
|
|
1960
|
+
var DropdownMenuRadioItem = React9__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1833
1961
|
DropdownMenuPrimitive__namespace.RadioItem,
|
|
1834
1962
|
{
|
|
1835
1963
|
ref,
|
|
@@ -1842,7 +1970,7 @@ var DropdownMenuRadioItem = React8__namespace.forwardRef(({ className, children,
|
|
|
1842
1970
|
}
|
|
1843
1971
|
));
|
|
1844
1972
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive__namespace.RadioItem.displayName;
|
|
1845
|
-
var DropdownMenuLabel =
|
|
1973
|
+
var DropdownMenuLabel = React9__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1846
1974
|
DropdownMenuPrimitive__namespace.Label,
|
|
1847
1975
|
{
|
|
1848
1976
|
ref,
|
|
@@ -1855,7 +1983,7 @@ var DropdownMenuLabel = React8__namespace.forwardRef(({ className, inset, ...pro
|
|
|
1855
1983
|
}
|
|
1856
1984
|
));
|
|
1857
1985
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive__namespace.Label.displayName;
|
|
1858
|
-
var DropdownMenuSeparator =
|
|
1986
|
+
var DropdownMenuSeparator = React9__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1859
1987
|
DropdownMenuPrimitive__namespace.Separator,
|
|
1860
1988
|
{
|
|
1861
1989
|
ref,
|
|
@@ -2211,7 +2339,7 @@ function EasyVisionTable(props) {
|
|
|
2211
2339
|
const lbIncludeKey = JSON.stringify(loopback?.include ?? null);
|
|
2212
2340
|
const lbFieldsKey = JSON.stringify(loopback?.fields ?? null);
|
|
2213
2341
|
const lbOrderKey = JSON.stringify(loopback?.defaultOrder ?? null);
|
|
2214
|
-
const loopbackFetcher =
|
|
2342
|
+
const loopbackFetcher = React9.useMemo(
|
|
2215
2343
|
() => loopback ? createLoopbackTableFetcher(loopback) : void 0,
|
|
2216
2344
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2217
2345
|
[lbFetchPage, lbFetchCount, lbIncludeKey, lbFieldsKey, lbOrderKey]
|
|
@@ -2219,7 +2347,7 @@ function EasyVisionTable(props) {
|
|
|
2219
2347
|
const fetchData = fetchDataProp ?? loopbackFetcher;
|
|
2220
2348
|
const paginationMode = loopback ? "api" : paginationModeProp;
|
|
2221
2349
|
const orderingMode = loopback ? "api" : orderingModeProp;
|
|
2222
|
-
const getRowId =
|
|
2350
|
+
const getRowId = React9.useMemo(
|
|
2223
2351
|
() => getRowIdProp ?? ((row) => String(row?.id ?? "")),
|
|
2224
2352
|
[getRowIdProp]
|
|
2225
2353
|
);
|
|
@@ -2242,10 +2370,10 @@ function EasyVisionTable(props) {
|
|
|
2242
2370
|
persist
|
|
2243
2371
|
});
|
|
2244
2372
|
const { page, itemsPerPage, sort, selection } = slice;
|
|
2245
|
-
const lastSnapshotRef =
|
|
2246
|
-
const [localFilterTick, setLocalFilterTick] =
|
|
2247
|
-
const innerMultifilterRef =
|
|
2248
|
-
const setMultifilterRef =
|
|
2373
|
+
const lastSnapshotRef = React9.useRef(null);
|
|
2374
|
+
const [localFilterTick, setLocalFilterTick] = React9.useState(0);
|
|
2375
|
+
const innerMultifilterRef = React9.useRef(null);
|
|
2376
|
+
const setMultifilterRef = React9.useCallback(
|
|
2249
2377
|
(handle) => {
|
|
2250
2378
|
innerMultifilterRef.current = handle;
|
|
2251
2379
|
if (typeof multifilterRef === "function") {
|
|
@@ -2256,16 +2384,16 @@ function EasyVisionTable(props) {
|
|
|
2256
2384
|
},
|
|
2257
2385
|
[multifilterRef]
|
|
2258
2386
|
);
|
|
2259
|
-
const [apiRows, setApiRows] =
|
|
2260
|
-
const [apiTotalCount, setApiTotalCount] =
|
|
2261
|
-
const [apiLoading, setApiLoading] =
|
|
2262
|
-
const fetchSeqRef =
|
|
2387
|
+
const [apiRows, setApiRows] = React9.useState([]);
|
|
2388
|
+
const [apiTotalCount, setApiTotalCount] = React9.useState(0);
|
|
2389
|
+
const [apiLoading, setApiLoading] = React9.useState(false);
|
|
2390
|
+
const fetchSeqRef = React9.useRef(0);
|
|
2263
2391
|
const isApi = paginationMode === "api" || orderingMode === "api";
|
|
2264
|
-
const [eagerAllIds, setEagerAllIds] =
|
|
2265
|
-
const [eagerAllRows, setEagerAllRows] =
|
|
2266
|
-
const [isResolvingEager, setIsResolvingEager] =
|
|
2267
|
-
const eagerSeqRef =
|
|
2268
|
-
const runFetch =
|
|
2392
|
+
const [eagerAllIds, setEagerAllIds] = React9.useState(null);
|
|
2393
|
+
const [eagerAllRows, setEagerAllRows] = React9.useState([]);
|
|
2394
|
+
const [isResolvingEager, setIsResolvingEager] = React9.useState(false);
|
|
2395
|
+
const eagerSeqRef = React9.useRef(0);
|
|
2396
|
+
const runFetch = React9.useCallback(async () => {
|
|
2269
2397
|
if (!fetchData) return;
|
|
2270
2398
|
const seq = ++fetchSeqRef.current;
|
|
2271
2399
|
setApiLoading(true);
|
|
@@ -2292,10 +2420,10 @@ function EasyVisionTable(props) {
|
|
|
2292
2420
|
if (seq === fetchSeqRef.current) setApiLoading(false);
|
|
2293
2421
|
}
|
|
2294
2422
|
}, [fetchData, page, itemsPerPage, sort, externalFilter, onDataLoaded]);
|
|
2295
|
-
|
|
2423
|
+
React9.useEffect(() => {
|
|
2296
2424
|
if (isApi && fetchData) void runFetch();
|
|
2297
2425
|
}, [isApi, page, itemsPerPage, sort, refetchSignal]);
|
|
2298
|
-
const resolveEagerAll =
|
|
2426
|
+
const resolveEagerAll = React9.useCallback(async () => {
|
|
2299
2427
|
if (!fetchData) return;
|
|
2300
2428
|
const collectRows = selectAllResolution === "eager";
|
|
2301
2429
|
const seq = ++eagerSeqRef.current;
|
|
@@ -2339,8 +2467,8 @@ function EasyVisionTable(props) {
|
|
|
2339
2467
|
if (seq === eagerSeqRef.current) setIsResolvingEager(false);
|
|
2340
2468
|
}
|
|
2341
2469
|
}, [fetchData, externalFilter, sort, getRowId, selectAllResolution]);
|
|
2342
|
-
const prevRefetchRef =
|
|
2343
|
-
|
|
2470
|
+
const prevRefetchRef = React9.useRef(refetchSignal);
|
|
2471
|
+
React9.useEffect(() => {
|
|
2344
2472
|
if (prevRefetchRef.current !== refetchSignal && page !== 1) {
|
|
2345
2473
|
prevRefetchRef.current = refetchSignal;
|
|
2346
2474
|
patch({ page: 1 });
|
|
@@ -2352,7 +2480,7 @@ function EasyVisionTable(props) {
|
|
|
2352
2480
|
eagerSeqRef.current++;
|
|
2353
2481
|
setIsResolvingEager(false);
|
|
2354
2482
|
}, [refetchSignal]);
|
|
2355
|
-
const filteredData =
|
|
2483
|
+
const filteredData = React9.useMemo(() => {
|
|
2356
2484
|
if (paginationMode !== "local") return data;
|
|
2357
2485
|
if (!data || data.length === 0) return data;
|
|
2358
2486
|
const mfWhere = lastSnapshotRef.current?.query?.where;
|
|
@@ -2373,11 +2501,11 @@ function EasyVisionTable(props) {
|
|
|
2373
2501
|
const rows = isApi ? apiRows : local.rows;
|
|
2374
2502
|
const totalCount = isApi ? apiTotalCount : local.totalCount;
|
|
2375
2503
|
const isLoading = isLoadingProp || apiLoading;
|
|
2376
|
-
const tanstackColumns =
|
|
2504
|
+
const tanstackColumns = React9.useMemo(
|
|
2377
2505
|
() => adaptColumns(columns, orderingMode, defaultSorting),
|
|
2378
2506
|
[columns, orderingMode, defaultSorting]
|
|
2379
2507
|
);
|
|
2380
|
-
const allColumns =
|
|
2508
|
+
const allColumns = React9.useMemo(() => {
|
|
2381
2509
|
if (!enableRowSelection) return tanstackColumns;
|
|
2382
2510
|
const checkboxCol = {
|
|
2383
2511
|
id: "_select",
|
|
@@ -2397,24 +2525,24 @@ function EasyVisionTable(props) {
|
|
|
2397
2525
|
};
|
|
2398
2526
|
return [checkboxCol, ...tanstackColumns];
|
|
2399
2527
|
}, [enableRowSelection, tanstackColumns]);
|
|
2400
|
-
const visibilityDefaults =
|
|
2528
|
+
const visibilityDefaults = React9.useMemo(() => {
|
|
2401
2529
|
const v = {};
|
|
2402
2530
|
for (const c of columns) {
|
|
2403
2531
|
if (c.initiallyHidden) v[c.field] = false;
|
|
2404
2532
|
}
|
|
2405
2533
|
return v;
|
|
2406
2534
|
}, [columns]);
|
|
2407
|
-
const columnVisibility =
|
|
2535
|
+
const columnVisibility = React9.useMemo(
|
|
2408
2536
|
() => ({ ...visibilityDefaults, ...slice.columnVisibility }),
|
|
2409
2537
|
[visibilityDefaults, slice.columnVisibility]
|
|
2410
2538
|
);
|
|
2411
|
-
const resizableFields =
|
|
2539
|
+
const resizableFields = React9.useMemo(() => {
|
|
2412
2540
|
const s = /* @__PURE__ */ new Set();
|
|
2413
2541
|
for (const c of columns) if (c.resizable) s.add(c.field);
|
|
2414
2542
|
return s;
|
|
2415
2543
|
}, [columns]);
|
|
2416
2544
|
const columnSizing = slice.columnSizing;
|
|
2417
|
-
const rowSelection =
|
|
2545
|
+
const rowSelection = React9.useMemo(() => {
|
|
2418
2546
|
if (selection.scope === "all") return {};
|
|
2419
2547
|
const r = {};
|
|
2420
2548
|
for (const id2 of Object.keys(selection.ids)) r[id2] = true;
|
|
@@ -2467,8 +2595,8 @@ function EasyVisionTable(props) {
|
|
|
2467
2595
|
pageCount: Math.ceil(totalCount / itemsPerPage),
|
|
2468
2596
|
getRowId
|
|
2469
2597
|
});
|
|
2470
|
-
const lastSelectionEmittedRef =
|
|
2471
|
-
|
|
2598
|
+
const lastSelectionEmittedRef = React9.useRef("");
|
|
2599
|
+
React9.useEffect(() => {
|
|
2472
2600
|
if (!enableRowSelection) return;
|
|
2473
2601
|
if (isEagerWildcard && (isResolvingEager || eagerAllIds === null)) return;
|
|
2474
2602
|
let event;
|
|
@@ -2550,11 +2678,11 @@ function EasyVisionTable(props) {
|
|
|
2550
2678
|
isResolvingEager,
|
|
2551
2679
|
isEagerWildcard
|
|
2552
2680
|
]);
|
|
2553
|
-
const rowIdOf =
|
|
2681
|
+
const rowIdOf = React9.useCallback(
|
|
2554
2682
|
(row) => getRowId(row),
|
|
2555
2683
|
[getRowId]
|
|
2556
2684
|
);
|
|
2557
|
-
const headerState =
|
|
2685
|
+
const headerState = React9.useMemo(() => {
|
|
2558
2686
|
if (selection.scope === "all") {
|
|
2559
2687
|
const except = Object.keys(selection.exceptIds ?? {}).length;
|
|
2560
2688
|
if (except === 0) return "checked";
|
|
@@ -2570,7 +2698,7 @@ function EasyVisionTable(props) {
|
|
|
2570
2698
|
if (selectedOnPage === visibleIds.length) return "checked";
|
|
2571
2699
|
return "indeterminate";
|
|
2572
2700
|
}, [selection, rows, rowIdOf]);
|
|
2573
|
-
const onHeaderToggle =
|
|
2701
|
+
const onHeaderToggle = React9.useCallback(
|
|
2574
2702
|
(checked) => {
|
|
2575
2703
|
if (selection.scope === "all") {
|
|
2576
2704
|
if (checked) {
|
|
@@ -2596,7 +2724,7 @@ function EasyVisionTable(props) {
|
|
|
2596
2724
|
},
|
|
2597
2725
|
[patch, selection, rows, rowIdOf]
|
|
2598
2726
|
);
|
|
2599
|
-
const onScopeChange =
|
|
2727
|
+
const onScopeChange = React9.useCallback(
|
|
2600
2728
|
(scope) => {
|
|
2601
2729
|
if (scope === "all") {
|
|
2602
2730
|
patch({ selection: { ids: {}, scope: "all", exceptIds: {} } });
|
|
@@ -2615,8 +2743,8 @@ function EasyVisionTable(props) {
|
|
|
2615
2743
|
},
|
|
2616
2744
|
[patch, selectAllResolution, isApi, resolveEagerAll]
|
|
2617
2745
|
);
|
|
2618
|
-
const firstPerformAfterMountRef =
|
|
2619
|
-
const handlePerform =
|
|
2746
|
+
const firstPerformAfterMountRef = React9.useRef(true);
|
|
2747
|
+
const handlePerform = React9.useCallback(
|
|
2620
2748
|
(snap) => {
|
|
2621
2749
|
const isFirstAfterMount = firstPerformAfterMountRef.current;
|
|
2622
2750
|
firstPerformAfterMountRef.current = false;
|
|
@@ -2636,8 +2764,8 @@ function EasyVisionTable(props) {
|
|
|
2636
2764
|
[isApi, multifilter, patch, runFetch, selection.scope]
|
|
2637
2765
|
);
|
|
2638
2766
|
const totalPages = Math.max(1, Math.ceil(totalCount / itemsPerPage));
|
|
2639
|
-
const hasResolvedDataRef =
|
|
2640
|
-
|
|
2767
|
+
const hasResolvedDataRef = React9.useRef(false);
|
|
2768
|
+
React9.useEffect(() => {
|
|
2641
2769
|
if (isApi) {
|
|
2642
2770
|
if (apiLoading) return;
|
|
2643
2771
|
if (!hasResolvedDataRef.current) {
|
|
@@ -2650,7 +2778,7 @@ function EasyVisionTable(props) {
|
|
|
2650
2778
|
}
|
|
2651
2779
|
if (page > totalPages) patch({ page: totalPages });
|
|
2652
2780
|
}, [page, totalPages, patch, isApi, apiLoading, apiTotalCount, apiRows.length]);
|
|
2653
|
-
|
|
2781
|
+
React9.useEffect(() => {
|
|
2654
2782
|
if (isApi) return;
|
|
2655
2783
|
if (paginationMode === "page") return;
|
|
2656
2784
|
if (page > 1 && page > Math.max(1, Math.ceil(totalCount / itemsPerPage))) {
|
|
@@ -2869,6 +2997,8 @@ function EasyVisionTable(props) {
|
|
|
2869
2997
|
}
|
|
2870
2998
|
var defaultCell = (content, title) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-foreground", title, children: content });
|
|
2871
2999
|
|
|
3000
|
+
exports.EasyVisionAccordion = EasyVisionAccordion;
|
|
3001
|
+
exports.EasyVisionAccordionItem = EasyVisionAccordionItem;
|
|
2872
3002
|
exports.EasyVisionCard = EasyVisionCard;
|
|
2873
3003
|
exports.EasyVisionCardContent = EasyVisionCardContent;
|
|
2874
3004
|
exports.EasyVisionCardDescription = EasyVisionCardDescription;
|