@dreamtree-org/twreact-ui 2.1.0 → 2.1.2
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 +1 -0
- package/dist/components/core/Accordion.d.ts.map +1 -1
- package/dist/components/core/Table/Table.d.ts.map +1 -1
- package/dist/components/core/menu/MenuPopover.d.ts.map +1 -1
- package/dist/components/navigation/Navbar.d.ts.map +1 -1
- package/dist/esm/components/core/Accordion.js +3 -1
- package/dist/esm/components/core/Table/MobileCard.js +2 -2
- package/dist/esm/components/core/Table/MobileFilters.js +1 -1
- package/dist/esm/components/core/Table/Table.js +28 -26
- package/dist/esm/components/core/menu/MenuPopover.js +4 -2
- package/dist/esm/components/navigation/Navbar.js +6 -3
- package/dist/index.css +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +49 -40
- package/dist/index.js +49 -40
- package/mcp/catalog.snapshot.json +8 -8
- package/package.json +3 -2
package/dist/index.esm.js
CHANGED
|
@@ -3836,7 +3836,7 @@ function setRefs$1(node) {
|
|
|
3836
3836
|
}
|
|
3837
3837
|
|
|
3838
3838
|
// useLayoutEffect warns during SSR; fall back to useEffect on the server.
|
|
3839
|
-
var useIsomorphicLayoutEffect$
|
|
3839
|
+
var useIsomorphicLayoutEffect$c = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
3840
3840
|
/**
|
|
3841
3841
|
* Internal (not exported from the package): a ref that always holds the latest
|
|
3842
3842
|
* `value`. Lets an effect call the newest consumer callback (e.g. `onChange`)
|
|
@@ -3845,7 +3845,7 @@ var useIsomorphicLayoutEffect$a = typeof window !== "undefined" ? useLayoutEffec
|
|
|
3845
3845
|
*/
|
|
3846
3846
|
function useLatestRef$1(value) {
|
|
3847
3847
|
var ref = useRef(value);
|
|
3848
|
-
useIsomorphicLayoutEffect$
|
|
3848
|
+
useIsomorphicLayoutEffect$c(function () {
|
|
3849
3849
|
ref.current = value;
|
|
3850
3850
|
});
|
|
3851
3851
|
return ref;
|
|
@@ -8963,7 +8963,7 @@ function MobileFilters(_ref5) {
|
|
|
8963
8963
|
});
|
|
8964
8964
|
},
|
|
8965
8965
|
"aria-expanded": !!showMobileFilters,
|
|
8966
|
-
className: "text-xs font-medium text-primary-700",
|
|
8966
|
+
className: "text-xs font-medium text-primary-700 dark:text-primary-300",
|
|
8967
8967
|
children: showMobileFilters ? "Hide" : "Show"
|
|
8968
8968
|
})]
|
|
8969
8969
|
}), showMobileFilters && jsxs("div", {
|
|
@@ -9116,6 +9116,8 @@ function normalizeAction(action, idx) {
|
|
|
9116
9116
|
|
|
9117
9117
|
function ownKeys$1a(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9118
9118
|
function _objectSpread$1a(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1a(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1a(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9119
|
+
// useLayoutEffect warns during SSR; fall back to useEffect on the server.
|
|
9120
|
+
var useIsomorphicLayoutEffect$b = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
9119
9121
|
// Internal (not exported). Desktop presentation of the action menu: a
|
|
9120
9122
|
// portaled, floating `role="menu"` anchored to its trigger (flip + shift via
|
|
9121
9123
|
// useFloatingPosition), with roving focus and Escape/outside-press dismissal.
|
|
@@ -9168,7 +9170,7 @@ function MenuPopover(_ref) {
|
|
|
9168
9170
|
menuEl = _useState2[0],
|
|
9169
9171
|
setMenuEl = _useState2[1];
|
|
9170
9172
|
var closeRef = useLatestRef$1(onRequestClose);
|
|
9171
|
-
|
|
9173
|
+
useIsomorphicLayoutEffect$b(function () {
|
|
9172
9174
|
refs.setReference(anchorEl !== null && anchorEl !== void 0 ? anchorEl : null);
|
|
9173
9175
|
}, [refs, anchorEl]);
|
|
9174
9176
|
var setMenuNode = useCallback(function (node) {
|
|
@@ -10529,10 +10531,10 @@ function MobileCard(_ref) {
|
|
|
10529
10531
|
return jsxs("div", {
|
|
10530
10532
|
className: cn("flex justify-between items-center flex-row py-2 border-b last:border-b-0", safeExtraCellClass),
|
|
10531
10533
|
children: [jsx("div", {
|
|
10532
|
-
className: "text-xs font-medium text-primary-700 uppercase tracking-wide mb-1 sm:mb-0 sm:w-1/3 sm:pr-2",
|
|
10534
|
+
className: "text-xs font-medium text-primary-700 dark:text-primary-300 uppercase tracking-wide mb-1 sm:mb-0 sm:w-1/3 sm:pr-2",
|
|
10533
10535
|
children: column.label
|
|
10534
10536
|
}), jsx("div", {
|
|
10535
|
-
className: "text-sm text-primary-900 sm:w-2/3 sm:pl-2 break-words",
|
|
10537
|
+
className: "text-sm text-primary-900 dark:text-foreground sm:w-2/3 sm:pl-2 break-words",
|
|
10536
10538
|
children: renderCell(column, row, globalIndex)
|
|
10537
10539
|
})]
|
|
10538
10540
|
}, column.key);
|
|
@@ -10876,6 +10878,12 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
10876
10878
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
10877
10879
|
filters = _useState14[0],
|
|
10878
10880
|
setFilters = _useState14[1];
|
|
10881
|
+
// The handlers below read and advance these refs synchronously, so they can
|
|
10882
|
+
// call onSort / onFilter after setting state instead of inside a setState
|
|
10883
|
+
// updater (updaters must be pure; React runs them during render and twice
|
|
10884
|
+
// in StrictMode, #194). They are the only writers of sortConfig / filters.
|
|
10885
|
+
var sortConfigRef = useRef(sortConfig);
|
|
10886
|
+
var filtersRef = useRef(filters);
|
|
10879
10887
|
var _useState15 = useState(""),
|
|
10880
10888
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
10881
10889
|
searchInput = _useState16[0],
|
|
@@ -11631,34 +11639,30 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
11631
11639
|
}, []);
|
|
11632
11640
|
var handleSort = useCallback(function (key) {
|
|
11633
11641
|
if (!sortable) return;
|
|
11634
|
-
|
|
11635
|
-
|
|
11636
|
-
|
|
11637
|
-
|
|
11638
|
-
|
|
11639
|
-
|
|
11640
|
-
|
|
11641
|
-
|
|
11642
|
+
var prev = sortConfigRef.current;
|
|
11643
|
+
var direction = prev.key === key && prev.direction === "asc" ? "desc" : "asc";
|
|
11644
|
+
var next = {
|
|
11645
|
+
key: key,
|
|
11646
|
+
direction: direction
|
|
11647
|
+
};
|
|
11648
|
+
sortConfigRef.current = next;
|
|
11649
|
+
setSortConfig(next);
|
|
11650
|
+
onSort === null || onSort === void 0 || onSort(key, direction);
|
|
11642
11651
|
}, [sortable, onSort]);
|
|
11643
|
-
var
|
|
11644
|
-
|
|
11645
|
-
|
|
11646
|
-
onFilter === null || onFilter === void 0 || onFilter(newFilters);
|
|
11647
|
-
onFilterChange === null || onFilterChange === void 0 || onFilterChange(newFilters);
|
|
11648
|
-
return newFilters;
|
|
11649
|
-
});
|
|
11652
|
+
var commitFilters = useCallback(function (newFilters) {
|
|
11653
|
+
filtersRef.current = newFilters;
|
|
11654
|
+
setFilters(newFilters);
|
|
11650
11655
|
setCurrentPage(1);
|
|
11656
|
+
onFilter === null || onFilter === void 0 || onFilter(newFilters);
|
|
11657
|
+
onFilterChange === null || onFilterChange === void 0 || onFilterChange(newFilters);
|
|
11651
11658
|
}, [onFilter, onFilterChange]);
|
|
11659
|
+
var handleFilter = useCallback(function (key, value) {
|
|
11660
|
+
return commitFilters(_objectSpread$16(_objectSpread$16({}, filtersRef.current), {}, _defineProperty$4({}, key, value)));
|
|
11661
|
+
}, [commitFilters]);
|
|
11652
11662
|
// Commits several filters at once (the phone filter sheet's Apply).
|
|
11653
11663
|
var applyFilters = useCallback(function (patch) {
|
|
11654
|
-
|
|
11655
|
-
|
|
11656
|
-
onFilter === null || onFilter === void 0 || onFilter(newFilters);
|
|
11657
|
-
onFilterChange === null || onFilterChange === void 0 || onFilterChange(newFilters);
|
|
11658
|
-
return newFilters;
|
|
11659
|
-
});
|
|
11660
|
-
setCurrentPage(1);
|
|
11661
|
-
}, [onFilter, onFilterChange]);
|
|
11664
|
+
return commitFilters(_objectSpread$16(_objectSpread$16({}, filtersRef.current), patch));
|
|
11665
|
+
}, [commitFilters]);
|
|
11662
11666
|
// One open swipe row at a time: `{ key, side }`.
|
|
11663
11667
|
var _useState37 = useState(null),
|
|
11664
11668
|
_useState38 = _slicedToArray(_useState37, 2),
|
|
@@ -11895,7 +11899,7 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
11895
11899
|
className: "bg-primary-50/40 hover:bg-primary-100/70 active:bg-primary-100 transition-colors border-t-2 border-b-2 border-dashed border-primary-300 cursor-pointer group",
|
|
11896
11900
|
children: jsx("td", {
|
|
11897
11901
|
colSpan: visibleCount,
|
|
11898
|
-
className: "px-6 py-3.5 text-left text-sm font-semibold text-primary-700 group-hover:text-primary-800",
|
|
11902
|
+
className: "px-6 py-3.5 text-left text-sm font-semibold text-primary-700 group-hover:text-primary-800 dark:text-primary-300 dark:group-hover:text-primary-200",
|
|
11899
11903
|
children: jsxs("div", {
|
|
11900
11904
|
className: "flex items-center justify-start gap-2",
|
|
11901
11905
|
children: [jsx(Plus, {
|
|
@@ -12075,7 +12079,7 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
12075
12079
|
children: [hasDetailsColumn && jsx("th", {
|
|
12076
12080
|
className: "w-8 px-4 py-3"
|
|
12077
12081
|
}), showSerial && jsx("th", {
|
|
12078
|
-
className: "w-8 px-4 py-3 text-left text-xs font-medium text-primary-700 uppercase tracking-wider",
|
|
12082
|
+
className: "w-8 px-4 py-3 text-left text-xs font-medium text-primary-700 dark:text-primary-300 uppercase tracking-wider",
|
|
12079
12083
|
children: "#"
|
|
12080
12084
|
}), selectable && jsx("th", {
|
|
12081
12085
|
className: "w-12 px-6 py-3",
|
|
@@ -12102,7 +12106,7 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
12102
12106
|
return jsx("th", {
|
|
12103
12107
|
scope: "col",
|
|
12104
12108
|
"aria-sort": ariaSort,
|
|
12105
|
-
className: cn("px-6 py-3 text-left text-xs font-medium text-primary-700 uppercase tracking-wider", isSortable && "p-0"),
|
|
12109
|
+
className: cn("px-6 py-3 text-left text-xs font-medium text-primary-700 dark:text-primary-300 uppercase tracking-wider", isSortable && "p-0"),
|
|
12106
12110
|
children: isSortable ? jsxs("button", {
|
|
12107
12111
|
type: "button",
|
|
12108
12112
|
onClick: function onClick() {
|
|
@@ -12446,7 +12450,7 @@ var getProxyFormState = (formState, control, localProxyFormState, isRoot = true)
|
|
|
12446
12450
|
return result;
|
|
12447
12451
|
};
|
|
12448
12452
|
|
|
12449
|
-
const useIsomorphicLayoutEffect$
|
|
12453
|
+
const useIsomorphicLayoutEffect$a = typeof window !== 'undefined' ? React__default.useLayoutEffect : React__default.useEffect;
|
|
12450
12454
|
|
|
12451
12455
|
/**
|
|
12452
12456
|
* This custom hook allows you to subscribe to each form state, and isolate the re-render at the custom hook level. It has its scope in terms of form state subscription, so it would not affect other useFormState and useForm. Using this hook can reduce the re-render impact on large and complex form application.
|
|
@@ -12492,7 +12496,7 @@ function useFormState(props) {
|
|
|
12492
12496
|
isValid: false,
|
|
12493
12497
|
errors: false,
|
|
12494
12498
|
});
|
|
12495
|
-
useIsomorphicLayoutEffect$
|
|
12499
|
+
useIsomorphicLayoutEffect$a(() => control._subscribe({
|
|
12496
12500
|
name,
|
|
12497
12501
|
formState: _localProxyFormState.current,
|
|
12498
12502
|
exact,
|
|
@@ -12611,7 +12615,7 @@ function useWatch(props) {
|
|
|
12611
12615
|
}
|
|
12612
12616
|
}
|
|
12613
12617
|
}, [control._formValues, control._names, disabled, name]);
|
|
12614
|
-
useIsomorphicLayoutEffect$
|
|
12618
|
+
useIsomorphicLayoutEffect$a(() => {
|
|
12615
12619
|
if (_prevControl.current !== control ||
|
|
12616
12620
|
!deepEqual(_prevName.current, name)) {
|
|
12617
12621
|
_prevControl.current = control;
|
|
@@ -14692,7 +14696,7 @@ function useForm(props = {}) {
|
|
|
14692
14696
|
}
|
|
14693
14697
|
const control = _formControl.current.control;
|
|
14694
14698
|
control._options = props;
|
|
14695
|
-
useIsomorphicLayoutEffect$
|
|
14699
|
+
useIsomorphicLayoutEffect$a(() => {
|
|
14696
14700
|
const sub = control._subscribe({
|
|
14697
14701
|
formState: control._proxyFormState,
|
|
14698
14702
|
callback: () => updateFormState({ ...control._formState }),
|
|
@@ -19790,6 +19794,8 @@ Form.displayName = "Form";
|
|
|
19790
19794
|
var _excluded$T = ["items", "allowMultiple", "defaultOpenIndexes", "onChange", "className", "headerClassName", "contentClassName", "chevronPosition", "chevronIcon", "bordered", "rounded", "size", "transitionDuration"];
|
|
19791
19795
|
function ownKeys$$(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19792
19796
|
function _objectSpread$$(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$$(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$$(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19797
|
+
// useLayoutEffect warns during SSR; fall back to useEffect on the server.
|
|
19798
|
+
var useIsomorphicLayoutEffect$9 = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
19793
19799
|
/**
|
|
19794
19800
|
* item.leftIcon may be:
|
|
19795
19801
|
* - ReactNode (e.g. <svg/>)
|
|
@@ -19859,7 +19865,7 @@ var Accordion = /*#__PURE__*/forwardRef(function Accordion(_ref, ref) {
|
|
|
19859
19865
|
// refs / the DOM. An open panel settles on `max-height: none` so content
|
|
19860
19866
|
// that grows after opening is never clipped; closed panels are `inert` so
|
|
19861
19867
|
// Tab cannot land inside collapsed content.
|
|
19862
|
-
|
|
19868
|
+
useIsomorphicLayoutEffect$9(function () {
|
|
19863
19869
|
var prevOpen = prevOpenRef.current;
|
|
19864
19870
|
var timers = [];
|
|
19865
19871
|
panelRefs.current.forEach(function (panelEl, idx) {
|
|
@@ -27210,8 +27216,11 @@ var Navbar = /*#__PURE__*/React__default.forwardRef(function (_ref3, ref) {
|
|
|
27210
27216
|
})
|
|
27211
27217
|
});
|
|
27212
27218
|
};
|
|
27213
|
-
// RightMenuContent:
|
|
27214
|
-
|
|
27219
|
+
// RightMenuContent: a render function or an element (#193), else the
|
|
27220
|
+
// built-in notifications menu.
|
|
27221
|
+
var RightMenuComponent = typeof RightMenuContentProp === "function" ? RightMenuContentProp : RightMenuContentProp != null ? function () {
|
|
27222
|
+
return RightMenuContentProp;
|
|
27223
|
+
} : function (rest) {
|
|
27215
27224
|
return jsx(RightMenuContent, _objectSpread$C({
|
|
27216
27225
|
emitter: emitter
|
|
27217
27226
|
}, rest));
|
|
@@ -27440,7 +27449,7 @@ Navbar.propTypes = {
|
|
|
27440
27449
|
emitter: PropTypes.object.isRequired,
|
|
27441
27450
|
logo: PropTypes.node,
|
|
27442
27451
|
center: PropTypes.node,
|
|
27443
|
-
items: PropTypes.array
|
|
27452
|
+
items: PropTypes.array,
|
|
27444
27453
|
user: PropTypes.object,
|
|
27445
27454
|
notifications: PropTypes.array,
|
|
27446
27455
|
searchable: PropTypes.bool,
|
package/dist/index.js
CHANGED
|
@@ -3856,7 +3856,7 @@ function setRefs$1(node) {
|
|
|
3856
3856
|
}
|
|
3857
3857
|
|
|
3858
3858
|
// useLayoutEffect warns during SSR; fall back to useEffect on the server.
|
|
3859
|
-
var useIsomorphicLayoutEffect$
|
|
3859
|
+
var useIsomorphicLayoutEffect$c = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
|
|
3860
3860
|
/**
|
|
3861
3861
|
* Internal (not exported from the package): a ref that always holds the latest
|
|
3862
3862
|
* `value`. Lets an effect call the newest consumer callback (e.g. `onChange`)
|
|
@@ -3865,7 +3865,7 @@ var useIsomorphicLayoutEffect$a = typeof window !== "undefined" ? React.useLayou
|
|
|
3865
3865
|
*/
|
|
3866
3866
|
function useLatestRef$1(value) {
|
|
3867
3867
|
var ref = React.useRef(value);
|
|
3868
|
-
useIsomorphicLayoutEffect$
|
|
3868
|
+
useIsomorphicLayoutEffect$c(function () {
|
|
3869
3869
|
ref.current = value;
|
|
3870
3870
|
});
|
|
3871
3871
|
return ref;
|
|
@@ -8983,7 +8983,7 @@ function MobileFilters(_ref5) {
|
|
|
8983
8983
|
});
|
|
8984
8984
|
},
|
|
8985
8985
|
"aria-expanded": !!showMobileFilters,
|
|
8986
|
-
className: "text-xs font-medium text-primary-700",
|
|
8986
|
+
className: "text-xs font-medium text-primary-700 dark:text-primary-300",
|
|
8987
8987
|
children: showMobileFilters ? "Hide" : "Show"
|
|
8988
8988
|
})]
|
|
8989
8989
|
}), showMobileFilters && jsxRuntime.jsxs("div", {
|
|
@@ -9136,6 +9136,8 @@ function normalizeAction(action, idx) {
|
|
|
9136
9136
|
|
|
9137
9137
|
function ownKeys$1a(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9138
9138
|
function _objectSpread$1a(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1a(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1a(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9139
|
+
// useLayoutEffect warns during SSR; fall back to useEffect on the server.
|
|
9140
|
+
var useIsomorphicLayoutEffect$b = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
|
|
9139
9141
|
// Internal (not exported). Desktop presentation of the action menu: a
|
|
9140
9142
|
// portaled, floating `role="menu"` anchored to its trigger (flip + shift via
|
|
9141
9143
|
// useFloatingPosition), with roving focus and Escape/outside-press dismissal.
|
|
@@ -9188,7 +9190,7 @@ function MenuPopover(_ref) {
|
|
|
9188
9190
|
menuEl = _useState2[0],
|
|
9189
9191
|
setMenuEl = _useState2[1];
|
|
9190
9192
|
var closeRef = useLatestRef$1(onRequestClose);
|
|
9191
|
-
|
|
9193
|
+
useIsomorphicLayoutEffect$b(function () {
|
|
9192
9194
|
refs.setReference(anchorEl !== null && anchorEl !== void 0 ? anchorEl : null);
|
|
9193
9195
|
}, [refs, anchorEl]);
|
|
9194
9196
|
var setMenuNode = React.useCallback(function (node) {
|
|
@@ -10549,10 +10551,10 @@ function MobileCard(_ref) {
|
|
|
10549
10551
|
return jsxRuntime.jsxs("div", {
|
|
10550
10552
|
className: cn("flex justify-between items-center flex-row py-2 border-b last:border-b-0", safeExtraCellClass),
|
|
10551
10553
|
children: [jsxRuntime.jsx("div", {
|
|
10552
|
-
className: "text-xs font-medium text-primary-700 uppercase tracking-wide mb-1 sm:mb-0 sm:w-1/3 sm:pr-2",
|
|
10554
|
+
className: "text-xs font-medium text-primary-700 dark:text-primary-300 uppercase tracking-wide mb-1 sm:mb-0 sm:w-1/3 sm:pr-2",
|
|
10553
10555
|
children: column.label
|
|
10554
10556
|
}), jsxRuntime.jsx("div", {
|
|
10555
|
-
className: "text-sm text-primary-900 sm:w-2/3 sm:pl-2 break-words",
|
|
10557
|
+
className: "text-sm text-primary-900 dark:text-foreground sm:w-2/3 sm:pl-2 break-words",
|
|
10556
10558
|
children: renderCell(column, row, globalIndex)
|
|
10557
10559
|
})]
|
|
10558
10560
|
}, column.key);
|
|
@@ -10896,6 +10898,12 @@ var Table = /*#__PURE__*/React.forwardRef(function Table(_ref, ref) {
|
|
|
10896
10898
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
10897
10899
|
filters = _useState14[0],
|
|
10898
10900
|
setFilters = _useState14[1];
|
|
10901
|
+
// The handlers below read and advance these refs synchronously, so they can
|
|
10902
|
+
// call onSort / onFilter after setting state instead of inside a setState
|
|
10903
|
+
// updater (updaters must be pure; React runs them during render and twice
|
|
10904
|
+
// in StrictMode, #194). They are the only writers of sortConfig / filters.
|
|
10905
|
+
var sortConfigRef = React.useRef(sortConfig);
|
|
10906
|
+
var filtersRef = React.useRef(filters);
|
|
10899
10907
|
var _useState15 = React.useState(""),
|
|
10900
10908
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
10901
10909
|
searchInput = _useState16[0],
|
|
@@ -11651,34 +11659,30 @@ var Table = /*#__PURE__*/React.forwardRef(function Table(_ref, ref) {
|
|
|
11651
11659
|
}, []);
|
|
11652
11660
|
var handleSort = React.useCallback(function (key) {
|
|
11653
11661
|
if (!sortable) return;
|
|
11654
|
-
|
|
11655
|
-
|
|
11656
|
-
|
|
11657
|
-
|
|
11658
|
-
|
|
11659
|
-
|
|
11660
|
-
|
|
11661
|
-
|
|
11662
|
+
var prev = sortConfigRef.current;
|
|
11663
|
+
var direction = prev.key === key && prev.direction === "asc" ? "desc" : "asc";
|
|
11664
|
+
var next = {
|
|
11665
|
+
key: key,
|
|
11666
|
+
direction: direction
|
|
11667
|
+
};
|
|
11668
|
+
sortConfigRef.current = next;
|
|
11669
|
+
setSortConfig(next);
|
|
11670
|
+
onSort === null || onSort === void 0 || onSort(key, direction);
|
|
11662
11671
|
}, [sortable, onSort]);
|
|
11663
|
-
var
|
|
11664
|
-
|
|
11665
|
-
|
|
11666
|
-
onFilter === null || onFilter === void 0 || onFilter(newFilters);
|
|
11667
|
-
onFilterChange === null || onFilterChange === void 0 || onFilterChange(newFilters);
|
|
11668
|
-
return newFilters;
|
|
11669
|
-
});
|
|
11672
|
+
var commitFilters = React.useCallback(function (newFilters) {
|
|
11673
|
+
filtersRef.current = newFilters;
|
|
11674
|
+
setFilters(newFilters);
|
|
11670
11675
|
setCurrentPage(1);
|
|
11676
|
+
onFilter === null || onFilter === void 0 || onFilter(newFilters);
|
|
11677
|
+
onFilterChange === null || onFilterChange === void 0 || onFilterChange(newFilters);
|
|
11671
11678
|
}, [onFilter, onFilterChange]);
|
|
11679
|
+
var handleFilter = React.useCallback(function (key, value) {
|
|
11680
|
+
return commitFilters(_objectSpread$16(_objectSpread$16({}, filtersRef.current), {}, _defineProperty$4({}, key, value)));
|
|
11681
|
+
}, [commitFilters]);
|
|
11672
11682
|
// Commits several filters at once (the phone filter sheet's Apply).
|
|
11673
11683
|
var applyFilters = React.useCallback(function (patch) {
|
|
11674
|
-
|
|
11675
|
-
|
|
11676
|
-
onFilter === null || onFilter === void 0 || onFilter(newFilters);
|
|
11677
|
-
onFilterChange === null || onFilterChange === void 0 || onFilterChange(newFilters);
|
|
11678
|
-
return newFilters;
|
|
11679
|
-
});
|
|
11680
|
-
setCurrentPage(1);
|
|
11681
|
-
}, [onFilter, onFilterChange]);
|
|
11684
|
+
return commitFilters(_objectSpread$16(_objectSpread$16({}, filtersRef.current), patch));
|
|
11685
|
+
}, [commitFilters]);
|
|
11682
11686
|
// One open swipe row at a time: `{ key, side }`.
|
|
11683
11687
|
var _useState37 = React.useState(null),
|
|
11684
11688
|
_useState38 = _slicedToArray(_useState37, 2),
|
|
@@ -11915,7 +11919,7 @@ var Table = /*#__PURE__*/React.forwardRef(function Table(_ref, ref) {
|
|
|
11915
11919
|
className: "bg-primary-50/40 hover:bg-primary-100/70 active:bg-primary-100 transition-colors border-t-2 border-b-2 border-dashed border-primary-300 cursor-pointer group",
|
|
11916
11920
|
children: jsxRuntime.jsx("td", {
|
|
11917
11921
|
colSpan: visibleCount,
|
|
11918
|
-
className: "px-6 py-3.5 text-left text-sm font-semibold text-primary-700 group-hover:text-primary-800",
|
|
11922
|
+
className: "px-6 py-3.5 text-left text-sm font-semibold text-primary-700 group-hover:text-primary-800 dark:text-primary-300 dark:group-hover:text-primary-200",
|
|
11919
11923
|
children: jsxRuntime.jsxs("div", {
|
|
11920
11924
|
className: "flex items-center justify-start gap-2",
|
|
11921
11925
|
children: [jsxRuntime.jsx(Plus, {
|
|
@@ -12095,7 +12099,7 @@ var Table = /*#__PURE__*/React.forwardRef(function Table(_ref, ref) {
|
|
|
12095
12099
|
children: [hasDetailsColumn && jsxRuntime.jsx("th", {
|
|
12096
12100
|
className: "w-8 px-4 py-3"
|
|
12097
12101
|
}), showSerial && jsxRuntime.jsx("th", {
|
|
12098
|
-
className: "w-8 px-4 py-3 text-left text-xs font-medium text-primary-700 uppercase tracking-wider",
|
|
12102
|
+
className: "w-8 px-4 py-3 text-left text-xs font-medium text-primary-700 dark:text-primary-300 uppercase tracking-wider",
|
|
12099
12103
|
children: "#"
|
|
12100
12104
|
}), selectable && jsxRuntime.jsx("th", {
|
|
12101
12105
|
className: "w-12 px-6 py-3",
|
|
@@ -12122,7 +12126,7 @@ var Table = /*#__PURE__*/React.forwardRef(function Table(_ref, ref) {
|
|
|
12122
12126
|
return jsxRuntime.jsx("th", {
|
|
12123
12127
|
scope: "col",
|
|
12124
12128
|
"aria-sort": ariaSort,
|
|
12125
|
-
className: cn("px-6 py-3 text-left text-xs font-medium text-primary-700 uppercase tracking-wider", isSortable && "p-0"),
|
|
12129
|
+
className: cn("px-6 py-3 text-left text-xs font-medium text-primary-700 dark:text-primary-300 uppercase tracking-wider", isSortable && "p-0"),
|
|
12126
12130
|
children: isSortable ? jsxRuntime.jsxs("button", {
|
|
12127
12131
|
type: "button",
|
|
12128
12132
|
onClick: function onClick() {
|
|
@@ -12466,7 +12470,7 @@ var getProxyFormState = (formState, control, localProxyFormState, isRoot = true)
|
|
|
12466
12470
|
return result;
|
|
12467
12471
|
};
|
|
12468
12472
|
|
|
12469
|
-
const useIsomorphicLayoutEffect$
|
|
12473
|
+
const useIsomorphicLayoutEffect$a = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
12470
12474
|
|
|
12471
12475
|
/**
|
|
12472
12476
|
* This custom hook allows you to subscribe to each form state, and isolate the re-render at the custom hook level. It has its scope in terms of form state subscription, so it would not affect other useFormState and useForm. Using this hook can reduce the re-render impact on large and complex form application.
|
|
@@ -12512,7 +12516,7 @@ function useFormState(props) {
|
|
|
12512
12516
|
isValid: false,
|
|
12513
12517
|
errors: false,
|
|
12514
12518
|
});
|
|
12515
|
-
useIsomorphicLayoutEffect$
|
|
12519
|
+
useIsomorphicLayoutEffect$a(() => control._subscribe({
|
|
12516
12520
|
name,
|
|
12517
12521
|
formState: _localProxyFormState.current,
|
|
12518
12522
|
exact,
|
|
@@ -12631,7 +12635,7 @@ function useWatch(props) {
|
|
|
12631
12635
|
}
|
|
12632
12636
|
}
|
|
12633
12637
|
}, [control._formValues, control._names, disabled, name]);
|
|
12634
|
-
useIsomorphicLayoutEffect$
|
|
12638
|
+
useIsomorphicLayoutEffect$a(() => {
|
|
12635
12639
|
if (_prevControl.current !== control ||
|
|
12636
12640
|
!deepEqual(_prevName.current, name)) {
|
|
12637
12641
|
_prevControl.current = control;
|
|
@@ -14712,7 +14716,7 @@ function useForm(props = {}) {
|
|
|
14712
14716
|
}
|
|
14713
14717
|
const control = _formControl.current.control;
|
|
14714
14718
|
control._options = props;
|
|
14715
|
-
useIsomorphicLayoutEffect$
|
|
14719
|
+
useIsomorphicLayoutEffect$a(() => {
|
|
14716
14720
|
const sub = control._subscribe({
|
|
14717
14721
|
formState: control._proxyFormState,
|
|
14718
14722
|
callback: () => updateFormState({ ...control._formState }),
|
|
@@ -19810,6 +19814,8 @@ Form.displayName = "Form";
|
|
|
19810
19814
|
var _excluded$T = ["items", "allowMultiple", "defaultOpenIndexes", "onChange", "className", "headerClassName", "contentClassName", "chevronPosition", "chevronIcon", "bordered", "rounded", "size", "transitionDuration"];
|
|
19811
19815
|
function ownKeys$$(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19812
19816
|
function _objectSpread$$(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$$(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$$(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19817
|
+
// useLayoutEffect warns during SSR; fall back to useEffect on the server.
|
|
19818
|
+
var useIsomorphicLayoutEffect$9 = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
|
|
19813
19819
|
/**
|
|
19814
19820
|
* item.leftIcon may be:
|
|
19815
19821
|
* - ReactNode (e.g. <svg/>)
|
|
@@ -19879,7 +19885,7 @@ var Accordion = /*#__PURE__*/React.forwardRef(function Accordion(_ref, ref) {
|
|
|
19879
19885
|
// refs / the DOM. An open panel settles on `max-height: none` so content
|
|
19880
19886
|
// that grows after opening is never clipped; closed panels are `inert` so
|
|
19881
19887
|
// Tab cannot land inside collapsed content.
|
|
19882
|
-
|
|
19888
|
+
useIsomorphicLayoutEffect$9(function () {
|
|
19883
19889
|
var prevOpen = prevOpenRef.current;
|
|
19884
19890
|
var timers = [];
|
|
19885
19891
|
panelRefs.current.forEach(function (panelEl, idx) {
|
|
@@ -27230,8 +27236,11 @@ var Navbar = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
|
|
|
27230
27236
|
})
|
|
27231
27237
|
});
|
|
27232
27238
|
};
|
|
27233
|
-
// RightMenuContent:
|
|
27234
|
-
|
|
27239
|
+
// RightMenuContent: a render function or an element (#193), else the
|
|
27240
|
+
// built-in notifications menu.
|
|
27241
|
+
var RightMenuComponent = typeof RightMenuContentProp === "function" ? RightMenuContentProp : RightMenuContentProp != null ? function () {
|
|
27242
|
+
return RightMenuContentProp;
|
|
27243
|
+
} : function (rest) {
|
|
27235
27244
|
return jsxRuntime.jsx(RightMenuContent, _objectSpread$C({
|
|
27236
27245
|
emitter: emitter
|
|
27237
27246
|
}, rest));
|
|
@@ -27460,7 +27469,7 @@ Navbar.propTypes = {
|
|
|
27460
27469
|
emitter: PropTypes.object.isRequired,
|
|
27461
27470
|
logo: PropTypes.node,
|
|
27462
27471
|
center: PropTypes.node,
|
|
27463
|
-
items: PropTypes.array
|
|
27472
|
+
items: PropTypes.array,
|
|
27464
27473
|
user: PropTypes.object,
|
|
27465
27474
|
notifications: PropTypes.array,
|
|
27466
27475
|
searchable: PropTypes.bool,
|