@drivenets/design-system 0.12.0 → 0.13.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/CHANGELOG.md +21 -0
- package/dist/index.cjs +1652 -455
- package/dist/index.d.cts +1226 -989
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +1226 -989
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1643 -456
- package/dist/index.js.map +1 -1
- package/dist/index.min.css +1 -1
- package/package.json +31 -31
- package/src/components/ds-catalog-layout/catalog-layout-empty-illustration.tsx +57 -0
- package/src/components/ds-catalog-layout/ds-catalog-layout.context.ts +19 -0
- package/src/components/ds-catalog-layout/ds-catalog-layout.module.scss +167 -0
- package/src/components/ds-catalog-layout/ds-catalog-layout.tsx +130 -0
- package/src/components/ds-catalog-layout/ds-catalog-layout.types.ts +62 -0
- package/src/components/ds-catalog-layout/index.ts +9 -0
- package/src/components/ds-date-input/ds-date-input.utils.ts +2 -2
- package/src/components/ds-drawer/ds-drawer.tsx +2 -0
- package/src/components/ds-form-control/ds-form-control.tsx +14 -11
- package/src/components/ds-form-control/ds-form-control.types.ts +4 -0
- package/src/components/ds-grid/ds-grid.tsx +1 -2
- package/src/components/ds-modal/ds-modal.tsx +3 -0
- package/src/components/ds-smart-tabs/ds-smart-tabs.module.scss +1 -0
- package/src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.module.scss +21 -2
- package/src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.tsx +14 -11
- package/src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.types.ts +1 -6
- package/src/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.module.scss +2 -2
- package/src/components/ds-table/components/ds-table-cell/ds-table-cell.module.scss +2 -0
- package/src/components/ds-table/components/ds-table-cell/ds-table-cell.tsx +42 -11
- package/src/components/ds-table/components/ds-table-header/ds-table-header.module.scss +24 -4
- package/src/components/ds-table/components/ds-table-header/ds-table-header.tsx +22 -1
- package/src/components/ds-table/components/ds-table-row/ds-table-row.module.scss +22 -0
- package/src/components/ds-table/components/ds-table-row/ds-table-row.tsx +1 -0
- package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.module.scss +19 -0
- package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.tsx +2 -1
- package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.types.ts +1 -1
- package/src/components/ds-table/components/edit/cell-editors/cell-editors.module.scss +3 -0
- package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-checkbox.tsx +27 -0
- package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-date.tsx +50 -0
- package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-number.tsx +51 -0
- package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-select.tsx +36 -0
- package/src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-text.tsx +50 -0
- package/src/components/ds-table/components/edit/cell-editors/index.ts +14 -0
- package/src/components/ds-table/components/edit/cell-editors/table-edit-form-control.tsx +31 -0
- package/src/components/ds-table/components/edit/ds-table-editable-cell/ds-table-editable-cell.module.scss +28 -0
- package/src/components/ds-table/components/edit/ds-table-editable-cell/ds-table-editable-cell.tsx +39 -0
- package/src/components/ds-table/components/edit/ds-table-editable-cell/ds-table-editable-cell.types.ts +7 -0
- package/src/components/ds-table/components/edit/ds-table-editable-cell/index.ts +2 -0
- package/src/components/ds-table/components/edit/ds-table-editing-cell/ds-table-editing-cell.module.scss +48 -0
- package/src/components/ds-table/components/edit/ds-table-editing-cell/ds-table-editing-cell.tsx +76 -0
- package/src/components/ds-table/components/edit/ds-table-editing-cell/ds-table-editing-cell.types.ts +5 -0
- package/src/components/ds-table/components/edit/ds-table-editing-cell/index.ts +2 -0
- package/src/components/ds-table/context/ds-table-context.ts +79 -1
- package/src/components/ds-table/ds-table-column.types.ts +12 -0
- package/src/components/ds-table/ds-table.module.scss +100 -10
- package/src/components/ds-table/ds-table.tsx +18 -19
- package/src/components/ds-table/ds-table.types.ts +52 -0
- package/src/components/ds-table/filters/adapters/create-checkbox-filter-adapter.tsx +24 -40
- package/src/components/ds-table/filters/adapters/create-dual-range-filter-adapter.tsx +10 -31
- package/src/components/ds-table/filters/adapters/create-filter-adapter.ts +6 -98
- package/src/components/ds-table/filters/components/checkbox-filter/checkbox-filter.module.scss +36 -0
- package/src/components/ds-table/filters/components/checkbox-filter/checkbox-filter.tsx +92 -13
- package/src/components/ds-table/filters/components/checkbox-filter/index.ts +1 -1
- package/src/components/ds-table/filters/components/column-filter-popover/column-filter-popover.module.scss +42 -0
- package/src/components/ds-table/filters/components/column-filter-popover/column-filter-popover.tsx +89 -0
- package/src/components/ds-table/filters/components/column-filter-popover/column-filter-popover.types.ts +25 -0
- package/src/components/ds-table/filters/components/column-filter-popover/index.ts +5 -0
- package/src/components/ds-table/filters/hooks/use-table-filters.ts +113 -78
- package/src/components/ds-table/filters/index.ts +2 -44
- package/src/components/ds-table/filters/types/column-meta.augmentation.ts +19 -0
- package/src/components/ds-table/filters/types/filter-adapter.types.ts +48 -81
- package/src/components/ds-table/hooks/use-cell-editor.ts +81 -0
- package/src/components/ds-table/index.ts +29 -0
- package/src/components/ds-table/utils/column-size.ts +9 -8
- package/src/components/ds-tag/ds-tag.tsx +2 -2
- package/src/components/ds-workspace-layout/ds-workspace-layout.context.ts +19 -0
- package/src/components/ds-workspace-layout/ds-workspace-layout.module.scss +166 -0
- package/src/components/ds-workspace-layout/ds-workspace-layout.tsx +135 -0
- package/src/components/ds-workspace-layout/ds-workspace-layout.types.ts +52 -0
- package/src/components/ds-workspace-layout/index.ts +11 -0
- package/src/index.ts +2 -1
- package/src/styles/_scrollbars.scss +37 -0
- package/src/utils/restore-document-body-modal-styles.ts +44 -0
- package/src/utils/use-ark-dialog-body-lock-cleanup.ts +36 -0
- package/src/components/ds-workspace/ds-workspace.module.scss +0 -55
- package/src/components/ds-workspace/ds-workspace.tsx +0 -37
- package/src/components/ds-workspace/ds-workspace.types.ts +0 -17
- package/src/components/ds-workspace/index.ts +0 -8
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { c } from "react/compiler-runtime";
|
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import * as React$1 from "react";
|
|
5
|
-
import React, { Children, Fragment as Fragment$1, createContext, createElement, isValidElement, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
5
|
+
import React, { Children, Fragment as Fragment$1, createContext, createElement, isValidElement, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
6
6
|
import { FileUpload as FileUpload$1, NumberInput, PasswordInput, Progress, Toast, Toaster, ark, createToaster } from "@ark-ui/react";
|
|
7
7
|
import { Combobox, createListCollection } from "@ark-ui/react/combobox";
|
|
8
8
|
import { useFilter } from "@ark-ui/react/locale";
|
|
@@ -3195,7 +3195,7 @@ const Title$2 = (t0) => {
|
|
|
3195
3195
|
} else t2 = $[5];
|
|
3196
3196
|
return t2;
|
|
3197
3197
|
};
|
|
3198
|
-
const Body$
|
|
3198
|
+
const Body$5 = (t0) => {
|
|
3199
3199
|
const $ = c(6);
|
|
3200
3200
|
const { style, className, children } = t0;
|
|
3201
3201
|
let t1;
|
|
@@ -3243,7 +3243,7 @@ const Actions$3 = (t0) => {
|
|
|
3243
3243
|
return t2;
|
|
3244
3244
|
};
|
|
3245
3245
|
DsAlertBanner.Title = Title$2;
|
|
3246
|
-
DsAlertBanner.Body = Body$
|
|
3246
|
+
DsAlertBanner.Body = Body$5;
|
|
3247
3247
|
DsAlertBanner.Actions = Actions$3;
|
|
3248
3248
|
//#endregion
|
|
3249
3249
|
//#region src/components/ds-alert-banner/ds-alert-banner.types.ts
|
|
@@ -4052,7 +4052,7 @@ const Trigger = Menu.Trigger;
|
|
|
4052
4052
|
/**
|
|
4053
4053
|
* Content component - wraps the dropdown content
|
|
4054
4054
|
*/
|
|
4055
|
-
const Content$
|
|
4055
|
+
const Content$2 = (t0) => {
|
|
4056
4056
|
const $ = c(9);
|
|
4057
4057
|
const { disablePortal: t1, children, className, style } = t0;
|
|
4058
4058
|
const Wrapper = (t1 === void 0 ? false : t1) ? Fragment$1 : Portal;
|
|
@@ -4157,7 +4157,7 @@ const ItemIndicator = (t0) => {
|
|
|
4157
4157
|
/**
|
|
4158
4158
|
* Header component - sticky header container for search, filters, or other controls
|
|
4159
4159
|
*/
|
|
4160
|
-
const Header$
|
|
4160
|
+
const Header$5 = (t0) => {
|
|
4161
4161
|
const $ = c(6);
|
|
4162
4162
|
const { children, className, style } = t0;
|
|
4163
4163
|
let t1;
|
|
@@ -4633,11 +4633,11 @@ const DsDropdownMenuLegacy = (t0) => {
|
|
|
4633
4633
|
const DsDropdownMenu = {
|
|
4634
4634
|
Root: Root$4,
|
|
4635
4635
|
Trigger,
|
|
4636
|
-
Content: Content$
|
|
4636
|
+
Content: Content$2,
|
|
4637
4637
|
Item: Item$2,
|
|
4638
4638
|
ItemIndicator,
|
|
4639
4639
|
TriggerItem,
|
|
4640
|
-
Header: Header$
|
|
4640
|
+
Header: Header$5,
|
|
4641
4641
|
Actions: Actions$2,
|
|
4642
4642
|
ItemGroup,
|
|
4643
4643
|
ItemGroupLabel,
|
|
@@ -5475,7 +5475,7 @@ const Root$3 = (t0) => {
|
|
|
5475
5475
|
* Use with DsCard.Title and DsCard.Extra for standard layout,
|
|
5476
5476
|
* or provide custom children for full flexibility.
|
|
5477
5477
|
*/
|
|
5478
|
-
const Header$
|
|
5478
|
+
const Header$4 = (t0) => {
|
|
5479
5479
|
const $ = c(12);
|
|
5480
5480
|
let children;
|
|
5481
5481
|
let className;
|
|
@@ -5519,7 +5519,7 @@ const Header$3 = (t0) => {
|
|
|
5519
5519
|
/**
|
|
5520
5520
|
* Card body - main content area.
|
|
5521
5521
|
*/
|
|
5522
|
-
const Body$
|
|
5522
|
+
const Body$4 = (t0) => {
|
|
5523
5523
|
const $ = c(12);
|
|
5524
5524
|
let children;
|
|
5525
5525
|
let className;
|
|
@@ -5606,8 +5606,8 @@ const Footer$3 = (t0) => {
|
|
|
5606
5606
|
};
|
|
5607
5607
|
const DsCard = {
|
|
5608
5608
|
Root: Root$3,
|
|
5609
|
-
Header: Header$
|
|
5610
|
-
Body: Body$
|
|
5609
|
+
Header: Header$4,
|
|
5610
|
+
Body: Body$4,
|
|
5611
5611
|
Footer: Footer$3
|
|
5612
5612
|
};
|
|
5613
5613
|
//#endregion
|
|
@@ -5618,190 +5618,597 @@ const cardSizes = [
|
|
|
5618
5618
|
"large"
|
|
5619
5619
|
];
|
|
5620
5620
|
//#endregion
|
|
5621
|
-
//#region src/components/ds-
|
|
5622
|
-
var
|
|
5623
|
-
"
|
|
5624
|
-
"
|
|
5625
|
-
"
|
|
5626
|
-
"
|
|
5627
|
-
"
|
|
5628
|
-
"
|
|
5629
|
-
"
|
|
5630
|
-
"
|
|
5621
|
+
//#region src/components/ds-catalog-layout/ds-catalog-layout.module.scss
|
|
5622
|
+
var ds_catalog_layout_module_default = {
|
|
5623
|
+
"body": "ub6JXq_body",
|
|
5624
|
+
"content": "ub6JXq_content",
|
|
5625
|
+
"contentHeader": "ub6JXq_contentHeader",
|
|
5626
|
+
"contentHeaderActions": "ub6JXq_contentHeaderActions",
|
|
5627
|
+
"contentHeaderItem": "ub6JXq_contentHeaderItem",
|
|
5628
|
+
"contentHeaderTitle": "ub6JXq_contentHeaderTitle",
|
|
5629
|
+
"contentHeaderTitleRow": "ub6JXq_contentHeaderTitleRow",
|
|
5630
|
+
"contentWithSideMenu": "ub6JXq_contentWithSideMenu",
|
|
5631
|
+
"fillParent": "ub6JXq_fillParent",
|
|
5632
|
+
"header": "ub6JXq_header",
|
|
5633
|
+
"root": "ub6JXq_root",
|
|
5634
|
+
"sideMenu": "ub6JXq_sideMenu",
|
|
5635
|
+
"sideMenuPanel": "ub6JXq_sideMenuPanel",
|
|
5636
|
+
"sideMenuPinButton": "ub6JXq_sideMenuPinButton"
|
|
5637
|
+
};
|
|
5638
|
+
//#endregion
|
|
5639
|
+
//#region src/components/ds-catalog-layout/ds-catalog-layout.context.ts
|
|
5640
|
+
const DsCatalogLayoutContext = createContext(null);
|
|
5641
|
+
const useDsCatalogLayoutContext = () => {
|
|
5642
|
+
const context = useContext(DsCatalogLayoutContext);
|
|
5643
|
+
if (!context) throw new Error("DsCatalogLayout compound components must be used within DsCatalogLayout");
|
|
5644
|
+
return context;
|
|
5631
5645
|
};
|
|
5632
5646
|
//#endregion
|
|
5633
|
-
//#region src/components/ds-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5647
|
+
//#region src/components/ds-catalog-layout/ds-catalog-layout.tsx
|
|
5648
|
+
const DEFAULT_LOCALE$1 = Object.freeze({
|
|
5649
|
+
pinButtonLabel: "Pin side menu",
|
|
5650
|
+
unpinButtonLabel: "Unpin side menu"
|
|
5651
|
+
});
|
|
5652
|
+
const DsCatalogLayout = (t0) => {
|
|
5653
|
+
const $ = c(17);
|
|
5639
5654
|
let className;
|
|
5640
|
-
let
|
|
5641
|
-
let labelInfo;
|
|
5642
|
-
let onCheckedChange;
|
|
5643
|
-
let props;
|
|
5655
|
+
let rest;
|
|
5644
5656
|
let t1;
|
|
5645
|
-
let value;
|
|
5646
5657
|
if ($[0] !== t0) {
|
|
5647
|
-
({
|
|
5658
|
+
({className, fillParent: t1, ...rest} = t0);
|
|
5648
5659
|
$[0] = t0;
|
|
5649
5660
|
$[1] = className;
|
|
5650
|
-
$[2] =
|
|
5651
|
-
$[3] =
|
|
5652
|
-
$[4] = onCheckedChange;
|
|
5653
|
-
$[5] = props;
|
|
5654
|
-
$[6] = t1;
|
|
5655
|
-
$[7] = value;
|
|
5661
|
+
$[2] = rest;
|
|
5662
|
+
$[3] = t1;
|
|
5656
5663
|
} else {
|
|
5657
5664
|
className = $[1];
|
|
5658
|
-
|
|
5659
|
-
|
|
5660
|
-
onCheckedChange = $[4];
|
|
5661
|
-
props = $[5];
|
|
5662
|
-
t1 = $[6];
|
|
5663
|
-
value = $[7];
|
|
5665
|
+
rest = $[2];
|
|
5666
|
+
t1 = $[3];
|
|
5664
5667
|
}
|
|
5665
|
-
const
|
|
5668
|
+
const fillParent = t1 === void 0 ? false : t1;
|
|
5669
|
+
const [hasSideMenu, setHasSideMenu] = useState(false);
|
|
5670
|
+
let t2;
|
|
5671
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
5672
|
+
t2 = () => setHasSideMenu(true);
|
|
5673
|
+
$[4] = t2;
|
|
5674
|
+
} else t2 = $[4];
|
|
5675
|
+
const registerSideMenu = t2;
|
|
5666
5676
|
let t3;
|
|
5667
|
-
if ($[
|
|
5668
|
-
t3 =
|
|
5669
|
-
$[
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
} else t3 = $[10];
|
|
5677
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
5678
|
+
t3 = () => setHasSideMenu(false);
|
|
5679
|
+
$[5] = t3;
|
|
5680
|
+
} else t3 = $[5];
|
|
5681
|
+
const unregisterSideMenu = t3;
|
|
5673
5682
|
let t4;
|
|
5674
|
-
if ($[
|
|
5675
|
-
t4 =
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5683
|
+
if ($[6] !== hasSideMenu) {
|
|
5684
|
+
t4 = {
|
|
5685
|
+
hasSideMenu,
|
|
5686
|
+
registerSideMenu,
|
|
5687
|
+
unregisterSideMenu
|
|
5688
|
+
};
|
|
5689
|
+
$[6] = hasSideMenu;
|
|
5690
|
+
$[7] = t4;
|
|
5691
|
+
} else t4 = $[7];
|
|
5692
|
+
const contextValue = t4;
|
|
5693
|
+
let t5;
|
|
5694
|
+
if ($[8] !== className || $[9] !== fillParent) {
|
|
5695
|
+
t5 = classNames(ds_catalog_layout_module_default.root, { [ds_catalog_layout_module_default.fillParent]: fillParent }, className);
|
|
5696
|
+
$[8] = className;
|
|
5697
|
+
$[9] = fillParent;
|
|
5698
|
+
$[10] = t5;
|
|
5699
|
+
} else t5 = $[10];
|
|
5680
5700
|
let t6;
|
|
5681
|
-
if ($[
|
|
5682
|
-
t6 = /* @__PURE__ */ jsx(
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
icon: "check_small",
|
|
5686
|
-
size: "tiny",
|
|
5687
|
-
variant: "rounded"
|
|
5688
|
-
})
|
|
5701
|
+
if ($[11] !== rest || $[12] !== t5) {
|
|
5702
|
+
t6 = /* @__PURE__ */ jsx("div", {
|
|
5703
|
+
...rest,
|
|
5704
|
+
className: t5
|
|
5689
5705
|
});
|
|
5706
|
+
$[11] = rest;
|
|
5707
|
+
$[12] = t5;
|
|
5690
5708
|
$[13] = t6;
|
|
5691
5709
|
} else t6 = $[13];
|
|
5692
5710
|
let t7;
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5697
|
-
children: [t6, /* @__PURE__ */ jsx(Checkbox.Indicator, {
|
|
5698
|
-
className: ds_checkbox_module_default.indicator,
|
|
5699
|
-
indeterminate: true,
|
|
5700
|
-
children: /* @__PURE__ */ jsx(DsIcon, {
|
|
5701
|
-
icon: "check_indeterminate_small",
|
|
5702
|
-
size: "tiny",
|
|
5703
|
-
variant: "rounded"
|
|
5704
|
-
})
|
|
5705
|
-
})]
|
|
5711
|
+
if ($[14] !== contextValue || $[15] !== t6) {
|
|
5712
|
+
t7 = /* @__PURE__ */ jsx(DsCatalogLayoutContext.Provider, {
|
|
5713
|
+
value: contextValue,
|
|
5714
|
+
children: t6
|
|
5706
5715
|
});
|
|
5707
|
-
|
|
5708
|
-
$[
|
|
5709
|
-
$[
|
|
5716
|
+
$[14] = contextValue;
|
|
5717
|
+
$[15] = t6;
|
|
5718
|
+
$[16] = t7;
|
|
5719
|
+
} else t7 = $[16];
|
|
5720
|
+
return t7;
|
|
5721
|
+
};
|
|
5722
|
+
const Header$3 = (t0) => {
|
|
5723
|
+
const $ = c(8);
|
|
5724
|
+
let className;
|
|
5725
|
+
let rest;
|
|
5726
|
+
if ($[0] !== t0) {
|
|
5727
|
+
({className, ...rest} = t0);
|
|
5728
|
+
$[0] = t0;
|
|
5729
|
+
$[1] = className;
|
|
5730
|
+
$[2] = rest;
|
|
5710
5731
|
} else {
|
|
5711
|
-
|
|
5712
|
-
|
|
5732
|
+
className = $[1];
|
|
5733
|
+
rest = $[2];
|
|
5713
5734
|
}
|
|
5714
|
-
let
|
|
5715
|
-
if ($[
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
});
|
|
5726
|
-
$[16] = label;
|
|
5727
|
-
$[17] = labelInfo;
|
|
5728
|
-
$[18] = t9;
|
|
5729
|
-
} else t9 = $[18];
|
|
5730
|
-
let t10;
|
|
5731
|
-
if ($[19] !== props || $[20] !== t3 || $[21] !== t4 || $[22] !== t5 || $[23] !== t9) {
|
|
5732
|
-
t10 = /* @__PURE__ */ jsxs(Checkbox.Root, {
|
|
5733
|
-
className: t3,
|
|
5734
|
-
onCheckedChange: t4,
|
|
5735
|
-
...props,
|
|
5736
|
-
value: t5,
|
|
5737
|
-
children: [
|
|
5738
|
-
t7,
|
|
5739
|
-
t8,
|
|
5740
|
-
t9
|
|
5741
|
-
]
|
|
5735
|
+
let t1;
|
|
5736
|
+
if ($[3] !== className) {
|
|
5737
|
+
t1 = classNames(ds_catalog_layout_module_default.header, className);
|
|
5738
|
+
$[3] = className;
|
|
5739
|
+
$[4] = t1;
|
|
5740
|
+
} else t1 = $[4];
|
|
5741
|
+
let t2;
|
|
5742
|
+
if ($[5] !== rest || $[6] !== t1) {
|
|
5743
|
+
t2 = /* @__PURE__ */ jsx("header", {
|
|
5744
|
+
...rest,
|
|
5745
|
+
className: t1
|
|
5742
5746
|
});
|
|
5743
|
-
$[
|
|
5744
|
-
$[
|
|
5745
|
-
$[
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
$[24] = t10;
|
|
5749
|
-
} else t10 = $[24];
|
|
5750
|
-
return t10;
|
|
5747
|
+
$[5] = rest;
|
|
5748
|
+
$[6] = t1;
|
|
5749
|
+
$[7] = t2;
|
|
5750
|
+
} else t2 = $[7];
|
|
5751
|
+
return t2;
|
|
5751
5752
|
};
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
|
|
5753
|
+
const Body$3 = (t0) => {
|
|
5754
|
+
const $ = c(8);
|
|
5755
|
+
let className;
|
|
5756
|
+
let rest;
|
|
5757
|
+
if ($[0] !== t0) {
|
|
5758
|
+
({className, ...rest} = t0);
|
|
5759
|
+
$[0] = t0;
|
|
5760
|
+
$[1] = className;
|
|
5761
|
+
$[2] = rest;
|
|
5762
|
+
} else {
|
|
5763
|
+
className = $[1];
|
|
5764
|
+
rest = $[2];
|
|
5765
|
+
}
|
|
5766
|
+
let t1;
|
|
5767
|
+
if ($[3] !== className) {
|
|
5768
|
+
t1 = classNames(ds_catalog_layout_module_default.body, className);
|
|
5769
|
+
$[3] = className;
|
|
5770
|
+
$[4] = t1;
|
|
5771
|
+
} else t1 = $[4];
|
|
5772
|
+
let t2;
|
|
5773
|
+
if ($[5] !== rest || $[6] !== t1) {
|
|
5774
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
5775
|
+
...rest,
|
|
5776
|
+
className: t1
|
|
5777
|
+
});
|
|
5778
|
+
$[5] = rest;
|
|
5779
|
+
$[6] = t1;
|
|
5780
|
+
$[7] = t2;
|
|
5781
|
+
} else t2 = $[7];
|
|
5782
|
+
return t2;
|
|
5761
5783
|
};
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
const DsCheckboxGroup = (t0) => {
|
|
5765
|
-
const $ = c(12);
|
|
5784
|
+
const SideMenu$1 = (t0) => {
|
|
5785
|
+
const $ = c(32);
|
|
5766
5786
|
let children;
|
|
5767
5787
|
let className;
|
|
5768
|
-
let
|
|
5788
|
+
let locale;
|
|
5789
|
+
let onPinnedChange;
|
|
5790
|
+
let rest;
|
|
5769
5791
|
let t1;
|
|
5770
5792
|
if ($[0] !== t0) {
|
|
5771
|
-
({
|
|
5793
|
+
({className, pinned: t1, onPinnedChange, locale, children, ...rest} = t0);
|
|
5772
5794
|
$[0] = t0;
|
|
5773
5795
|
$[1] = children;
|
|
5774
5796
|
$[2] = className;
|
|
5775
|
-
$[3] =
|
|
5776
|
-
$[4] =
|
|
5797
|
+
$[3] = locale;
|
|
5798
|
+
$[4] = onPinnedChange;
|
|
5799
|
+
$[5] = rest;
|
|
5800
|
+
$[6] = t1;
|
|
5777
5801
|
} else {
|
|
5778
5802
|
children = $[1];
|
|
5779
5803
|
className = $[2];
|
|
5780
|
-
|
|
5781
|
-
|
|
5804
|
+
locale = $[3];
|
|
5805
|
+
onPinnedChange = $[4];
|
|
5806
|
+
rest = $[5];
|
|
5807
|
+
t1 = $[6];
|
|
5782
5808
|
}
|
|
5783
|
-
const
|
|
5809
|
+
const pinned = t1 === void 0 ? false : t1;
|
|
5810
|
+
const { registerSideMenu, unregisterSideMenu } = useDsCatalogLayoutContext();
|
|
5811
|
+
const [isHovering, setIsHovering] = useState(false);
|
|
5812
|
+
let t2;
|
|
5784
5813
|
let t3;
|
|
5785
|
-
if ($[
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
className: t3,
|
|
5795
|
-
...props,
|
|
5796
|
-
children
|
|
5797
|
-
});
|
|
5798
|
-
$[8] = children;
|
|
5799
|
-
$[9] = props;
|
|
5814
|
+
if ($[7] !== registerSideMenu || $[8] !== unregisterSideMenu) {
|
|
5815
|
+
t2 = () => {
|
|
5816
|
+
registerSideMenu();
|
|
5817
|
+
return unregisterSideMenu;
|
|
5818
|
+
};
|
|
5819
|
+
t3 = [registerSideMenu, unregisterSideMenu];
|
|
5820
|
+
$[7] = registerSideMenu;
|
|
5821
|
+
$[8] = unregisterSideMenu;
|
|
5822
|
+
$[9] = t2;
|
|
5800
5823
|
$[10] = t3;
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
}
|
|
5824
|
+
} else {
|
|
5825
|
+
t2 = $[9];
|
|
5826
|
+
t3 = $[10];
|
|
5827
|
+
}
|
|
5828
|
+
useEffect(t2, t3);
|
|
5829
|
+
const isExpanded = pinned || isHovering;
|
|
5830
|
+
const ariaLabel = pinned ? locale?.unpinButtonLabel ?? DEFAULT_LOCALE$1.unpinButtonLabel : locale?.pinButtonLabel ?? DEFAULT_LOCALE$1.pinButtonLabel;
|
|
5831
|
+
let t4;
|
|
5832
|
+
if ($[11] !== className) {
|
|
5833
|
+
t4 = classNames(ds_catalog_layout_module_default.sideMenu, className);
|
|
5834
|
+
$[11] = className;
|
|
5835
|
+
$[12] = t4;
|
|
5836
|
+
} else t4 = $[12];
|
|
5837
|
+
let t5;
|
|
5838
|
+
if ($[13] !== pinned) {
|
|
5839
|
+
t5 = pinned ? { "data-pinned": "" } : {};
|
|
5840
|
+
$[13] = pinned;
|
|
5841
|
+
$[14] = t5;
|
|
5842
|
+
} else t5 = $[14];
|
|
5843
|
+
let t6;
|
|
5844
|
+
if ($[15] !== isExpanded) {
|
|
5845
|
+
t6 = isExpanded ? { "data-expanded": "" } : {};
|
|
5846
|
+
$[15] = isExpanded;
|
|
5847
|
+
$[16] = t6;
|
|
5848
|
+
} else t6 = $[16];
|
|
5849
|
+
let t7;
|
|
5850
|
+
let t8;
|
|
5851
|
+
if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
|
|
5852
|
+
t7 = () => setIsHovering(true);
|
|
5853
|
+
t8 = () => setIsHovering(false);
|
|
5854
|
+
$[17] = t7;
|
|
5855
|
+
$[18] = t8;
|
|
5856
|
+
} else {
|
|
5857
|
+
t7 = $[17];
|
|
5858
|
+
t8 = $[18];
|
|
5859
|
+
}
|
|
5860
|
+
let t9;
|
|
5861
|
+
if ($[19] !== ariaLabel || $[20] !== onPinnedChange || $[21] !== pinned) {
|
|
5862
|
+
t9 = onPinnedChange ? /* @__PURE__ */ jsx("button", {
|
|
5863
|
+
type: "button",
|
|
5864
|
+
className: ds_catalog_layout_module_default.sideMenuPinButton,
|
|
5865
|
+
onClick: () => onPinnedChange(!pinned),
|
|
5866
|
+
"aria-label": ariaLabel,
|
|
5867
|
+
"aria-pressed": pinned,
|
|
5868
|
+
children: /* @__PURE__ */ jsx(DsIcon, {
|
|
5869
|
+
icon: "keep",
|
|
5870
|
+
size: "small",
|
|
5871
|
+
filled: pinned
|
|
5872
|
+
})
|
|
5873
|
+
}) : null;
|
|
5874
|
+
$[19] = ariaLabel;
|
|
5875
|
+
$[20] = onPinnedChange;
|
|
5876
|
+
$[21] = pinned;
|
|
5877
|
+
$[22] = t9;
|
|
5878
|
+
} else t9 = $[22];
|
|
5879
|
+
let t10;
|
|
5880
|
+
if ($[23] !== children || $[24] !== t9) {
|
|
5881
|
+
t10 = /* @__PURE__ */ jsxs("div", {
|
|
5882
|
+
className: ds_catalog_layout_module_default.sideMenuPanel,
|
|
5883
|
+
onMouseEnter: t7,
|
|
5884
|
+
onMouseLeave: t8,
|
|
5885
|
+
children: [t9, children]
|
|
5886
|
+
});
|
|
5887
|
+
$[23] = children;
|
|
5888
|
+
$[24] = t9;
|
|
5889
|
+
$[25] = t10;
|
|
5890
|
+
} else t10 = $[25];
|
|
5891
|
+
let t11;
|
|
5892
|
+
if ($[26] !== rest || $[27] !== t10 || $[28] !== t4 || $[29] !== t5 || $[30] !== t6) {
|
|
5893
|
+
t11 = /* @__PURE__ */ jsx("aside", {
|
|
5894
|
+
...rest,
|
|
5895
|
+
className: t4,
|
|
5896
|
+
...t5,
|
|
5897
|
+
...t6,
|
|
5898
|
+
children: t10
|
|
5899
|
+
});
|
|
5900
|
+
$[26] = rest;
|
|
5901
|
+
$[27] = t10;
|
|
5902
|
+
$[28] = t4;
|
|
5903
|
+
$[29] = t5;
|
|
5904
|
+
$[30] = t6;
|
|
5905
|
+
$[31] = t11;
|
|
5906
|
+
} else t11 = $[31];
|
|
5907
|
+
return t11;
|
|
5908
|
+
};
|
|
5909
|
+
const Content$1 = (t0) => {
|
|
5910
|
+
const $ = c(9);
|
|
5911
|
+
let className;
|
|
5912
|
+
let rest;
|
|
5913
|
+
if ($[0] !== t0) {
|
|
5914
|
+
({className, ...rest} = t0);
|
|
5915
|
+
$[0] = t0;
|
|
5916
|
+
$[1] = className;
|
|
5917
|
+
$[2] = rest;
|
|
5918
|
+
} else {
|
|
5919
|
+
className = $[1];
|
|
5920
|
+
rest = $[2];
|
|
5921
|
+
}
|
|
5922
|
+
const { hasSideMenu } = useDsCatalogLayoutContext();
|
|
5923
|
+
let t1;
|
|
5924
|
+
if ($[3] !== className || $[4] !== hasSideMenu) {
|
|
5925
|
+
t1 = classNames(ds_catalog_layout_module_default.content, { [ds_catalog_layout_module_default.contentWithSideMenu]: hasSideMenu }, className);
|
|
5926
|
+
$[3] = className;
|
|
5927
|
+
$[4] = hasSideMenu;
|
|
5928
|
+
$[5] = t1;
|
|
5929
|
+
} else t1 = $[5];
|
|
5930
|
+
let t2;
|
|
5931
|
+
if ($[6] !== rest || $[7] !== t1) {
|
|
5932
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
5933
|
+
...rest,
|
|
5934
|
+
className: t1
|
|
5935
|
+
});
|
|
5936
|
+
$[6] = rest;
|
|
5937
|
+
$[7] = t1;
|
|
5938
|
+
$[8] = t2;
|
|
5939
|
+
} else t2 = $[8];
|
|
5940
|
+
return t2;
|
|
5941
|
+
};
|
|
5942
|
+
const ContentHeader = (t0) => {
|
|
5943
|
+
const $ = c(22);
|
|
5944
|
+
let children;
|
|
5945
|
+
let className;
|
|
5946
|
+
let headerActions;
|
|
5947
|
+
let rest;
|
|
5948
|
+
let title;
|
|
5949
|
+
if ($[0] !== t0) {
|
|
5950
|
+
({className, title, headerActions, children, ...rest} = t0);
|
|
5951
|
+
$[0] = t0;
|
|
5952
|
+
$[1] = children;
|
|
5953
|
+
$[2] = className;
|
|
5954
|
+
$[3] = headerActions;
|
|
5955
|
+
$[4] = rest;
|
|
5956
|
+
$[5] = title;
|
|
5957
|
+
} else {
|
|
5958
|
+
children = $[1];
|
|
5959
|
+
className = $[2];
|
|
5960
|
+
headerActions = $[3];
|
|
5961
|
+
rest = $[4];
|
|
5962
|
+
title = $[5];
|
|
5963
|
+
}
|
|
5964
|
+
let t1;
|
|
5965
|
+
if ($[6] !== className) {
|
|
5966
|
+
t1 = classNames(ds_catalog_layout_module_default.contentHeader, className);
|
|
5967
|
+
$[6] = className;
|
|
5968
|
+
$[7] = t1;
|
|
5969
|
+
} else t1 = $[7];
|
|
5970
|
+
let t2;
|
|
5971
|
+
if ($[8] !== title) {
|
|
5972
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
5973
|
+
className: ds_catalog_layout_module_default.contentHeaderTitle,
|
|
5974
|
+
children: title
|
|
5975
|
+
});
|
|
5976
|
+
$[8] = title;
|
|
5977
|
+
$[9] = t2;
|
|
5978
|
+
} else t2 = $[9];
|
|
5979
|
+
let t3;
|
|
5980
|
+
if ($[10] !== headerActions) {
|
|
5981
|
+
t3 = headerActions ? /* @__PURE__ */ jsx("div", {
|
|
5982
|
+
className: ds_catalog_layout_module_default.contentHeaderActions,
|
|
5983
|
+
children: headerActions
|
|
5984
|
+
}) : null;
|
|
5985
|
+
$[10] = headerActions;
|
|
5986
|
+
$[11] = t3;
|
|
5987
|
+
} else t3 = $[11];
|
|
5988
|
+
let t4;
|
|
5989
|
+
if ($[12] !== t2 || $[13] !== t3) {
|
|
5990
|
+
t4 = /* @__PURE__ */ jsxs("div", {
|
|
5991
|
+
className: ds_catalog_layout_module_default.contentHeaderTitleRow,
|
|
5992
|
+
children: [t2, t3]
|
|
5993
|
+
});
|
|
5994
|
+
$[12] = t2;
|
|
5995
|
+
$[13] = t3;
|
|
5996
|
+
$[14] = t4;
|
|
5997
|
+
} else t4 = $[14];
|
|
5998
|
+
let t5;
|
|
5999
|
+
if ($[15] !== children) {
|
|
6000
|
+
t5 = children ? /* @__PURE__ */ jsx("div", {
|
|
6001
|
+
className: ds_catalog_layout_module_default.contentHeaderItem,
|
|
6002
|
+
children
|
|
6003
|
+
}) : null;
|
|
6004
|
+
$[15] = children;
|
|
6005
|
+
$[16] = t5;
|
|
6006
|
+
} else t5 = $[16];
|
|
6007
|
+
let t6;
|
|
6008
|
+
if ($[17] !== rest || $[18] !== t1 || $[19] !== t4 || $[20] !== t5) {
|
|
6009
|
+
t6 = /* @__PURE__ */ jsxs("div", {
|
|
6010
|
+
...rest,
|
|
6011
|
+
className: t1,
|
|
6012
|
+
children: [t4, t5]
|
|
6013
|
+
});
|
|
6014
|
+
$[17] = rest;
|
|
6015
|
+
$[18] = t1;
|
|
6016
|
+
$[19] = t4;
|
|
6017
|
+
$[20] = t5;
|
|
6018
|
+
$[21] = t6;
|
|
6019
|
+
} else t6 = $[21];
|
|
6020
|
+
return t6;
|
|
6021
|
+
};
|
|
6022
|
+
DsCatalogLayout.Header = Header$3;
|
|
6023
|
+
DsCatalogLayout.Body = Body$3;
|
|
6024
|
+
DsCatalogLayout.SideMenu = SideMenu$1;
|
|
6025
|
+
DsCatalogLayout.Content = Content$1;
|
|
6026
|
+
DsCatalogLayout.ContentHeader = ContentHeader;
|
|
6027
|
+
//#endregion
|
|
6028
|
+
//#region src/components/ds-checkbox/ds-checkbox.module.scss
|
|
6029
|
+
var ds_checkbox_module_default = {
|
|
6030
|
+
"control": "-9VV7a_control",
|
|
6031
|
+
"hiddenInput": "-9VV7a_hiddenInput",
|
|
6032
|
+
"indicator": "-9VV7a_indicator",
|
|
6033
|
+
"label": "-9VV7a_label",
|
|
6034
|
+
"labelColumn": "-9VV7a_labelColumn",
|
|
6035
|
+
"labelInfo": "-9VV7a_labelInfo",
|
|
6036
|
+
"root": "-9VV7a_root",
|
|
6037
|
+
"warning": "-9VV7a_warning"
|
|
6038
|
+
};
|
|
6039
|
+
//#endregion
|
|
6040
|
+
//#region src/components/ds-checkbox/ds-checkbox.tsx
|
|
6041
|
+
/**
|
|
6042
|
+
* Design system Checkbox component
|
|
6043
|
+
*/
|
|
6044
|
+
const DsCheckbox = (t0) => {
|
|
6045
|
+
const $ = c(25);
|
|
6046
|
+
let className;
|
|
6047
|
+
let label;
|
|
6048
|
+
let labelInfo;
|
|
6049
|
+
let onCheckedChange;
|
|
6050
|
+
let props;
|
|
6051
|
+
let t1;
|
|
6052
|
+
let value;
|
|
6053
|
+
if ($[0] !== t0) {
|
|
6054
|
+
({variant: t1, label, labelInfo, className, onCheckedChange, value, ...props} = t0);
|
|
6055
|
+
$[0] = t0;
|
|
6056
|
+
$[1] = className;
|
|
6057
|
+
$[2] = label;
|
|
6058
|
+
$[3] = labelInfo;
|
|
6059
|
+
$[4] = onCheckedChange;
|
|
6060
|
+
$[5] = props;
|
|
6061
|
+
$[6] = t1;
|
|
6062
|
+
$[7] = value;
|
|
6063
|
+
} else {
|
|
6064
|
+
className = $[1];
|
|
6065
|
+
label = $[2];
|
|
6066
|
+
labelInfo = $[3];
|
|
6067
|
+
onCheckedChange = $[4];
|
|
6068
|
+
props = $[5];
|
|
6069
|
+
t1 = $[6];
|
|
6070
|
+
value = $[7];
|
|
6071
|
+
}
|
|
6072
|
+
const t2 = (t1 === void 0 ? "default" : t1) === "warning" && ds_checkbox_module_default.warning;
|
|
6073
|
+
let t3;
|
|
6074
|
+
if ($[8] !== className || $[9] !== t2) {
|
|
6075
|
+
t3 = classNames(ds_checkbox_module_default.root, t2, className);
|
|
6076
|
+
$[8] = className;
|
|
6077
|
+
$[9] = t2;
|
|
6078
|
+
$[10] = t3;
|
|
6079
|
+
} else t3 = $[10];
|
|
6080
|
+
let t4;
|
|
6081
|
+
if ($[11] !== onCheckedChange) {
|
|
6082
|
+
t4 = (details) => onCheckedChange?.(details.checked);
|
|
6083
|
+
$[11] = onCheckedChange;
|
|
6084
|
+
$[12] = t4;
|
|
6085
|
+
} else t4 = $[12];
|
|
6086
|
+
const t5 = value === void 0 ? void 0 : String(value);
|
|
6087
|
+
let t6;
|
|
6088
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
6089
|
+
t6 = /* @__PURE__ */ jsx(Checkbox.Indicator, {
|
|
6090
|
+
className: ds_checkbox_module_default.indicator,
|
|
6091
|
+
children: /* @__PURE__ */ jsx(DsIcon, {
|
|
6092
|
+
icon: "check_small",
|
|
6093
|
+
size: "tiny",
|
|
6094
|
+
variant: "rounded"
|
|
6095
|
+
})
|
|
6096
|
+
});
|
|
6097
|
+
$[13] = t6;
|
|
6098
|
+
} else t6 = $[13];
|
|
6099
|
+
let t7;
|
|
6100
|
+
let t8;
|
|
6101
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
6102
|
+
t7 = /* @__PURE__ */ jsxs(Checkbox.Control, {
|
|
6103
|
+
className: ds_checkbox_module_default.control,
|
|
6104
|
+
children: [t6, /* @__PURE__ */ jsx(Checkbox.Indicator, {
|
|
6105
|
+
className: ds_checkbox_module_default.indicator,
|
|
6106
|
+
indeterminate: true,
|
|
6107
|
+
children: /* @__PURE__ */ jsx(DsIcon, {
|
|
6108
|
+
icon: "check_indeterminate_small",
|
|
6109
|
+
size: "tiny",
|
|
6110
|
+
variant: "rounded"
|
|
6111
|
+
})
|
|
6112
|
+
})]
|
|
6113
|
+
});
|
|
6114
|
+
t8 = /* @__PURE__ */ jsx(Checkbox.HiddenInput, { className: ds_checkbox_module_default.hiddenInput });
|
|
6115
|
+
$[14] = t7;
|
|
6116
|
+
$[15] = t8;
|
|
6117
|
+
} else {
|
|
6118
|
+
t7 = $[14];
|
|
6119
|
+
t8 = $[15];
|
|
6120
|
+
}
|
|
6121
|
+
let t9;
|
|
6122
|
+
if ($[16] !== label || $[17] !== labelInfo) {
|
|
6123
|
+
t9 = (label || labelInfo) && /* @__PURE__ */ jsxs("div", {
|
|
6124
|
+
className: ds_checkbox_module_default.labelColumn,
|
|
6125
|
+
children: [label && /* @__PURE__ */ jsx(Checkbox.Label, {
|
|
6126
|
+
className: ds_checkbox_module_default.label,
|
|
6127
|
+
children: label
|
|
6128
|
+
}), labelInfo && /* @__PURE__ */ jsx("div", {
|
|
6129
|
+
className: ds_checkbox_module_default.labelInfo,
|
|
6130
|
+
children: labelInfo
|
|
6131
|
+
})]
|
|
6132
|
+
});
|
|
6133
|
+
$[16] = label;
|
|
6134
|
+
$[17] = labelInfo;
|
|
6135
|
+
$[18] = t9;
|
|
6136
|
+
} else t9 = $[18];
|
|
6137
|
+
let t10;
|
|
6138
|
+
if ($[19] !== props || $[20] !== t3 || $[21] !== t4 || $[22] !== t5 || $[23] !== t9) {
|
|
6139
|
+
t10 = /* @__PURE__ */ jsxs(Checkbox.Root, {
|
|
6140
|
+
className: t3,
|
|
6141
|
+
onCheckedChange: t4,
|
|
6142
|
+
...props,
|
|
6143
|
+
value: t5,
|
|
6144
|
+
children: [
|
|
6145
|
+
t7,
|
|
6146
|
+
t8,
|
|
6147
|
+
t9
|
|
6148
|
+
]
|
|
6149
|
+
});
|
|
6150
|
+
$[19] = props;
|
|
6151
|
+
$[20] = t3;
|
|
6152
|
+
$[21] = t4;
|
|
6153
|
+
$[22] = t5;
|
|
6154
|
+
$[23] = t9;
|
|
6155
|
+
$[24] = t10;
|
|
6156
|
+
} else t10 = $[24];
|
|
6157
|
+
return t10;
|
|
6158
|
+
};
|
|
6159
|
+
//#endregion
|
|
6160
|
+
//#region src/components/ds-checkbox/ds-checkbox.types.ts
|
|
6161
|
+
const checkboxVariants = ["default", "warning"];
|
|
6162
|
+
//#endregion
|
|
6163
|
+
//#region src/components/ds-checkbox-group/ds-checkbox-group.module.scss
|
|
6164
|
+
var ds_checkbox_group_module_default = {
|
|
6165
|
+
"horizontal": "f9-vsG_horizontal",
|
|
6166
|
+
"root": "f9-vsG_root",
|
|
6167
|
+
"vertical": "f9-vsG_vertical"
|
|
6168
|
+
};
|
|
6169
|
+
//#endregion
|
|
6170
|
+
//#region src/components/ds-checkbox-group/ds-checkbox-group.tsx
|
|
6171
|
+
const DsCheckboxGroup = (t0) => {
|
|
6172
|
+
const $ = c(12);
|
|
6173
|
+
let children;
|
|
6174
|
+
let className;
|
|
6175
|
+
let props;
|
|
6176
|
+
let t1;
|
|
6177
|
+
if ($[0] !== t0) {
|
|
6178
|
+
({orientation: t1, className, children, ...props} = t0);
|
|
6179
|
+
$[0] = t0;
|
|
6180
|
+
$[1] = children;
|
|
6181
|
+
$[2] = className;
|
|
6182
|
+
$[3] = props;
|
|
6183
|
+
$[4] = t1;
|
|
6184
|
+
} else {
|
|
6185
|
+
children = $[1];
|
|
6186
|
+
className = $[2];
|
|
6187
|
+
props = $[3];
|
|
6188
|
+
t1 = $[4];
|
|
6189
|
+
}
|
|
6190
|
+
const t2 = ds_checkbox_group_module_default[t1 === void 0 ? "vertical" : t1];
|
|
6191
|
+
let t3;
|
|
6192
|
+
if ($[5] !== className || $[6] !== t2) {
|
|
6193
|
+
t3 = classNames(ds_checkbox_group_module_default.root, t2, className);
|
|
6194
|
+
$[5] = className;
|
|
6195
|
+
$[6] = t2;
|
|
6196
|
+
$[7] = t3;
|
|
6197
|
+
} else t3 = $[7];
|
|
6198
|
+
let t4;
|
|
6199
|
+
if ($[8] !== children || $[9] !== props || $[10] !== t3) {
|
|
6200
|
+
t4 = /* @__PURE__ */ jsx(Checkbox.Group, {
|
|
6201
|
+
className: t3,
|
|
6202
|
+
...props,
|
|
6203
|
+
children
|
|
6204
|
+
});
|
|
6205
|
+
$[8] = children;
|
|
6206
|
+
$[9] = props;
|
|
6207
|
+
$[10] = t3;
|
|
6208
|
+
$[11] = t4;
|
|
6209
|
+
} else t4 = $[11];
|
|
6210
|
+
return t4;
|
|
6211
|
+
};
|
|
5805
6212
|
//#endregion
|
|
5806
6213
|
//#region src/components/ds-checkbox-group/hooks/use-checkbox-select-all.ts
|
|
5807
6214
|
/**
|
|
@@ -7841,6 +8248,78 @@ var ds_drawer_module_default = {
|
|
|
7841
8248
|
"toolbar": "MWmQHa_toolbar"
|
|
7842
8249
|
};
|
|
7843
8250
|
//#endregion
|
|
8251
|
+
//#region src/utils/restore-document-body-modal-styles.ts
|
|
8252
|
+
const SCROLL_LOCK_ATTRIBUTE = "data-scroll-lock";
|
|
8253
|
+
const INERT_ATTRIBUTE = "data-inert";
|
|
8254
|
+
const ARIA_HIDDEN_MARKER = "data-aria-hidden";
|
|
8255
|
+
/**
|
|
8256
|
+
* Clears document body styles and attributes left by Zag dialog modal effects when a
|
|
8257
|
+
* dialog instance tears down without a normal close transition.
|
|
8258
|
+
*
|
|
8259
|
+
* No-op unless a leak sentinel is present: in the common case Zag restores the body on
|
|
8260
|
+
* unmount itself, and we must not clobber styles the host app owns.
|
|
8261
|
+
*/
|
|
8262
|
+
const restoreDocumentBodyModalStyles = (doc = document) => {
|
|
8263
|
+
const { body, documentElement } = doc;
|
|
8264
|
+
if (!(body.hasAttribute(SCROLL_LOCK_ATTRIBUTE) || body.hasAttribute(INERT_ATTRIBUTE) || body.style.pointerEvents === "none")) return;
|
|
8265
|
+
body.removeAttribute(SCROLL_LOCK_ATTRIBUTE);
|
|
8266
|
+
body.removeAttribute(INERT_ATTRIBUTE);
|
|
8267
|
+
body.removeAttribute(ARIA_HIDDEN_MARKER);
|
|
8268
|
+
if (body.getAttribute("aria-hidden") === "true") body.removeAttribute("aria-hidden");
|
|
8269
|
+
body.style.removeProperty("overflow");
|
|
8270
|
+
body.style.removeProperty("pointer-events");
|
|
8271
|
+
body.style.removeProperty("position");
|
|
8272
|
+
body.style.removeProperty("top");
|
|
8273
|
+
body.style.removeProperty("left");
|
|
8274
|
+
body.style.removeProperty("right");
|
|
8275
|
+
if (body.style.length === 0) body.removeAttribute("style");
|
|
8276
|
+
documentElement.style.removeProperty("--scrollbar-width");
|
|
8277
|
+
};
|
|
8278
|
+
//#endregion
|
|
8279
|
+
//#region src/utils/use-ark-dialog-body-lock-cleanup.ts
|
|
8280
|
+
const activeBodyLockInstances = /* @__PURE__ */ new Set();
|
|
8281
|
+
const scheduleBodyLockRestoreIfIdle = () => {
|
|
8282
|
+
queueMicrotask(() => {
|
|
8283
|
+
if (activeBodyLockInstances.size > 0) return;
|
|
8284
|
+
restoreDocumentBodyModalStyles();
|
|
8285
|
+
});
|
|
8286
|
+
};
|
|
8287
|
+
/**
|
|
8288
|
+
* Ensures Zag dialog body scroll-lock and modal pointer blocking are released when
|
|
8289
|
+
* an Ark dialog unmounts while still open (e.g. close + conditional unmount + navigate).
|
|
8290
|
+
*/
|
|
8291
|
+
const useArkDialogBodyLockCleanup = (open, enabled) => {
|
|
8292
|
+
const $ = c(5);
|
|
8293
|
+
let t0;
|
|
8294
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
8295
|
+
t0 = Symbol("ark-dialog-body-lock");
|
|
8296
|
+
$[0] = t0;
|
|
8297
|
+
} else t0 = $[0];
|
|
8298
|
+
const instanceIdRef = useRef(t0);
|
|
8299
|
+
let t1;
|
|
8300
|
+
let t2;
|
|
8301
|
+
if ($[1] !== enabled || $[2] !== open) {
|
|
8302
|
+
t1 = () => {
|
|
8303
|
+
if (!open || !enabled) return;
|
|
8304
|
+
const instanceId = instanceIdRef.current;
|
|
8305
|
+
activeBodyLockInstances.add(instanceId);
|
|
8306
|
+
return () => {
|
|
8307
|
+
activeBodyLockInstances.delete(instanceId);
|
|
8308
|
+
scheduleBodyLockRestoreIfIdle();
|
|
8309
|
+
};
|
|
8310
|
+
};
|
|
8311
|
+
t2 = [open, enabled];
|
|
8312
|
+
$[1] = enabled;
|
|
8313
|
+
$[2] = open;
|
|
8314
|
+
$[3] = t1;
|
|
8315
|
+
$[4] = t2;
|
|
8316
|
+
} else {
|
|
8317
|
+
t1 = $[3];
|
|
8318
|
+
t2 = $[4];
|
|
8319
|
+
}
|
|
8320
|
+
useLayoutEffect(t1, t2);
|
|
8321
|
+
};
|
|
8322
|
+
//#endregion
|
|
7844
8323
|
//#region src/components/ds-drawer/ds-drawer.tsx
|
|
7845
8324
|
const DsDrawer = (t0) => {
|
|
7846
8325
|
const $ = c(25);
|
|
@@ -7852,6 +8331,7 @@ const DsDrawer = (t0) => {
|
|
|
7852
8331
|
const closeOnInteractOutside = t5 === void 0 ? false : t5;
|
|
7853
8332
|
const portal = t6 === void 0 ? false : t6;
|
|
7854
8333
|
const resolvedColumns = useResponsiveValue(columns);
|
|
8334
|
+
useArkDialogBodyLockCleanup(open, backdrop);
|
|
7855
8335
|
let t7;
|
|
7856
8336
|
if ($[0] !== onOpenChange) {
|
|
7857
8337
|
t7 = (details) => {
|
|
@@ -8040,7 +8520,7 @@ const Toolbar = (t0) => {
|
|
|
8040
8520
|
} else t2 = $[5];
|
|
8041
8521
|
return t2;
|
|
8042
8522
|
};
|
|
8043
|
-
const Body$
|
|
8523
|
+
const Body$2 = (t0) => {
|
|
8044
8524
|
const $ = c(6);
|
|
8045
8525
|
const { style, className, children } = t0;
|
|
8046
8526
|
let t1;
|
|
@@ -8113,7 +8593,7 @@ DsDrawer.Header = Header$2;
|
|
|
8113
8593
|
DsDrawer.Title = Title$1;
|
|
8114
8594
|
DsDrawer.CloseTrigger = CloseTrigger$1;
|
|
8115
8595
|
DsDrawer.Toolbar = Toolbar;
|
|
8116
|
-
DsDrawer.Body = Body$
|
|
8596
|
+
DsDrawer.Body = Body$2;
|
|
8117
8597
|
DsDrawer.Footer = Footer$2;
|
|
8118
8598
|
DsDrawer.Actions = Actions$1;
|
|
8119
8599
|
//#endregion
|
|
@@ -8661,6 +9141,7 @@ const DsModal = (t0) => {
|
|
|
8661
9141
|
const dividers = t2 === void 0 ? false : t2;
|
|
8662
9142
|
const modal = t3 === void 0 ? true : t3;
|
|
8663
9143
|
const closeOnInteractOutside = t4 === void 0 ? false : t4;
|
|
9144
|
+
useArkDialogBodyLockCleanup(open, modal);
|
|
8664
9145
|
let t5;
|
|
8665
9146
|
if ($[0] !== onOpenChange) {
|
|
8666
9147
|
t5 = (details) => {
|
|
@@ -8807,7 +9288,7 @@ const CloseTrigger = (t0) => {
|
|
|
8807
9288
|
} else t2 = $[3];
|
|
8808
9289
|
return t2;
|
|
8809
9290
|
};
|
|
8810
|
-
const Body = (t0) => {
|
|
9291
|
+
const Body$1 = (t0) => {
|
|
8811
9292
|
const $ = c(6);
|
|
8812
9293
|
const { style, className, children } = t0;
|
|
8813
9294
|
let t1;
|
|
@@ -8879,7 +9360,7 @@ const Actions = (t0) => {
|
|
|
8879
9360
|
DsModal.Header = Header$1;
|
|
8880
9361
|
DsModal.Title = Title;
|
|
8881
9362
|
DsModal.CloseTrigger = CloseTrigger;
|
|
8882
|
-
DsModal.Body = Body;
|
|
9363
|
+
DsModal.Body = Body$1;
|
|
8883
9364
|
DsModal.Footer = Footer$1;
|
|
8884
9365
|
DsModal.Actions = Actions;
|
|
8885
9366
|
//#endregion
|
|
@@ -12723,66 +13204,50 @@ const DsFormControlDescription = (t0) => {
|
|
|
12723
13204
|
return t2;
|
|
12724
13205
|
};
|
|
12725
13206
|
const DsFormControl = (t0) => {
|
|
12726
|
-
const $ = c(
|
|
12727
|
-
const { id, status, label,
|
|
12728
|
-
const
|
|
12729
|
-
const
|
|
13207
|
+
const $ = c(23);
|
|
13208
|
+
const { id, status, label, hideLabel: t1, required: t2, slots, message, messageIcon: t3, className, style, children } = t0;
|
|
13209
|
+
const hideLabel = t1 === void 0 ? false : t1;
|
|
13210
|
+
const required = t2 === void 0 ? false : t2;
|
|
13211
|
+
const messageIcon = t3 === void 0 ? "info" : t3;
|
|
12730
13212
|
const generatedId = useId();
|
|
12731
13213
|
const controlId = id || generatedId;
|
|
12732
|
-
let
|
|
13214
|
+
let t4;
|
|
12733
13215
|
if ($[0] !== controlId) {
|
|
12734
|
-
|
|
13216
|
+
t4 = { controlId };
|
|
12735
13217
|
$[0] = controlId;
|
|
12736
|
-
$[1] =
|
|
12737
|
-
} else
|
|
12738
|
-
const
|
|
12739
|
-
let t5;
|
|
12740
|
-
if ($[2] !== className || $[3] !== t4) {
|
|
12741
|
-
t5 = classNames(ds_form_control_module_default.container, className, t4);
|
|
12742
|
-
$[2] = className;
|
|
12743
|
-
$[3] = t4;
|
|
12744
|
-
$[4] = t5;
|
|
12745
|
-
} else t5 = $[4];
|
|
13218
|
+
$[1] = t4;
|
|
13219
|
+
} else t4 = $[1];
|
|
13220
|
+
const t5 = status && message && ds_form_control_module_default[status];
|
|
12746
13221
|
let t6;
|
|
12747
|
-
if ($[
|
|
12748
|
-
t6 = classNames(ds_form_control_module_default.
|
|
12749
|
-
$[
|
|
12750
|
-
$[
|
|
12751
|
-
|
|
13222
|
+
if ($[2] !== className || $[3] !== t5) {
|
|
13223
|
+
t6 = classNames(ds_form_control_module_default.container, className, t5);
|
|
13224
|
+
$[2] = className;
|
|
13225
|
+
$[3] = t5;
|
|
13226
|
+
$[4] = t6;
|
|
13227
|
+
} else t6 = $[4];
|
|
12752
13228
|
let t7;
|
|
12753
|
-
if ($[
|
|
12754
|
-
t7 = /* @__PURE__ */
|
|
12755
|
-
|
|
12756
|
-
|
|
12757
|
-
|
|
13229
|
+
if ($[5] !== controlId || $[6] !== hideLabel || $[7] !== label || $[8] !== required || $[9] !== slots) {
|
|
13230
|
+
t7 = !hideLabel && /* @__PURE__ */ jsxs("div", {
|
|
13231
|
+
className: ds_form_control_module_default.labelContainer,
|
|
13232
|
+
children: [/* @__PURE__ */ jsx("label", {
|
|
13233
|
+
htmlFor: controlId,
|
|
13234
|
+
className: classNames(ds_form_control_module_default.label, { [ds_form_control_module_default.required]: required }),
|
|
13235
|
+
children: label
|
|
13236
|
+
}), slots?.endAdornment && /* @__PURE__ */ jsx("div", {
|
|
13237
|
+
className: ds_form_control_module_default.endAdornment,
|
|
13238
|
+
children: slots.endAdornment
|
|
13239
|
+
})]
|
|
12758
13240
|
});
|
|
12759
|
-
$[
|
|
12760
|
-
$[
|
|
12761
|
-
$[
|
|
13241
|
+
$[5] = controlId;
|
|
13242
|
+
$[6] = hideLabel;
|
|
13243
|
+
$[7] = label;
|
|
13244
|
+
$[8] = required;
|
|
13245
|
+
$[9] = slots;
|
|
12762
13246
|
$[10] = t7;
|
|
12763
13247
|
} else t7 = $[10];
|
|
12764
13248
|
let t8;
|
|
12765
|
-
if ($[11] !==
|
|
12766
|
-
t8 =
|
|
12767
|
-
className: ds_form_control_module_default.endAdornment,
|
|
12768
|
-
children: slots.endAdornment
|
|
12769
|
-
});
|
|
12770
|
-
$[11] = slots;
|
|
12771
|
-
$[12] = t8;
|
|
12772
|
-
} else t8 = $[12];
|
|
12773
|
-
let t9;
|
|
12774
|
-
if ($[13] !== t7 || $[14] !== t8) {
|
|
12775
|
-
t9 = /* @__PURE__ */ jsxs("div", {
|
|
12776
|
-
className: ds_form_control_module_default.labelContainer,
|
|
12777
|
-
children: [t7, t8]
|
|
12778
|
-
});
|
|
12779
|
-
$[13] = t7;
|
|
12780
|
-
$[14] = t8;
|
|
12781
|
-
$[15] = t9;
|
|
12782
|
-
} else t9 = $[15];
|
|
12783
|
-
let t10;
|
|
12784
|
-
if ($[16] !== message || $[17] !== messageIcon) {
|
|
12785
|
-
t10 = message && /* @__PURE__ */ jsxs("div", {
|
|
13249
|
+
if ($[11] !== message || $[12] !== messageIcon) {
|
|
13250
|
+
t8 = message && /* @__PURE__ */ jsxs("div", {
|
|
12786
13251
|
className: ds_form_control_module_default.message,
|
|
12787
13252
|
children: [/* @__PURE__ */ jsx(DsIcon, {
|
|
12788
13253
|
icon: messageIcon,
|
|
@@ -12790,39 +13255,39 @@ const DsFormControl = (t0) => {
|
|
|
12790
13255
|
filled: true
|
|
12791
13256
|
}), /* @__PURE__ */ jsx("span", { children: message })]
|
|
12792
13257
|
});
|
|
12793
|
-
$[
|
|
12794
|
-
$[
|
|
12795
|
-
$[
|
|
12796
|
-
} else
|
|
12797
|
-
let
|
|
12798
|
-
if ($[
|
|
12799
|
-
|
|
12800
|
-
className:
|
|
13258
|
+
$[11] = message;
|
|
13259
|
+
$[12] = messageIcon;
|
|
13260
|
+
$[13] = t8;
|
|
13261
|
+
} else t8 = $[13];
|
|
13262
|
+
let t9;
|
|
13263
|
+
if ($[14] !== children || $[15] !== style || $[16] !== t6 || $[17] !== t7 || $[18] !== t8) {
|
|
13264
|
+
t9 = /* @__PURE__ */ jsxs("div", {
|
|
13265
|
+
className: t6,
|
|
12801
13266
|
style,
|
|
12802
13267
|
children: [
|
|
12803
|
-
|
|
13268
|
+
t7,
|
|
12804
13269
|
children,
|
|
12805
|
-
|
|
13270
|
+
t8
|
|
12806
13271
|
]
|
|
12807
13272
|
});
|
|
12808
|
-
$[
|
|
12809
|
-
$[
|
|
12810
|
-
$[
|
|
12811
|
-
$[
|
|
12812
|
-
$[
|
|
12813
|
-
$[
|
|
12814
|
-
} else
|
|
12815
|
-
let
|
|
12816
|
-
if ($[
|
|
12817
|
-
|
|
12818
|
-
value:
|
|
12819
|
-
children:
|
|
13273
|
+
$[14] = children;
|
|
13274
|
+
$[15] = style;
|
|
13275
|
+
$[16] = t6;
|
|
13276
|
+
$[17] = t7;
|
|
13277
|
+
$[18] = t8;
|
|
13278
|
+
$[19] = t9;
|
|
13279
|
+
} else t9 = $[19];
|
|
13280
|
+
let t10;
|
|
13281
|
+
if ($[20] !== t4 || $[21] !== t9) {
|
|
13282
|
+
t10 = /* @__PURE__ */ jsx(FormControlContext.Provider, {
|
|
13283
|
+
value: t4,
|
|
13284
|
+
children: t9
|
|
12820
13285
|
});
|
|
12821
|
-
$[
|
|
12822
|
-
$[
|
|
12823
|
-
$[
|
|
12824
|
-
} else
|
|
12825
|
-
return
|
|
13286
|
+
$[20] = t4;
|
|
13287
|
+
$[21] = t9;
|
|
13288
|
+
$[22] = t10;
|
|
13289
|
+
} else t10 = $[22];
|
|
13290
|
+
return t10;
|
|
12826
13291
|
};
|
|
12827
13292
|
DsFormControl.TextInput = controlify(DsTextInput);
|
|
12828
13293
|
DsFormControl.NumberInput = controlify(DsNumberInput);
|
|
@@ -17700,68 +18165,9 @@ const systemStatuses = [
|
|
|
17700
18165
|
//#endregion
|
|
17701
18166
|
//#region src/components/ds-table/filters/adapters/create-filter-adapter.ts
|
|
17702
18167
|
/**
|
|
17703
|
-
* Base factory
|
|
17704
|
-
*
|
|
17705
|
-
*
|
|
17706
|
-
* Use this when checkbox or dual-range adapters don't fit your requirements.
|
|
17707
|
-
*
|
|
17708
|
-
* ## When to use directly:
|
|
17709
|
-
* - Complex filtering logic (e.g., editor + date range)
|
|
17710
|
-
* - Unique UI that doesn't fit generic patterns
|
|
17711
|
-
* - Combining multiple sub-filters
|
|
17712
|
-
* - Special chip generation requirements
|
|
17713
|
-
*
|
|
17714
|
-
* ## When to use specialized helpers instead:
|
|
17715
|
-
* - **Checkbox filters**: Use `createCheckboxFilterAdapter` for multi-select
|
|
17716
|
-
* - **Range filters**: Use `createDualRangeFilterAdapter` for numeric ranges
|
|
17717
|
-
*
|
|
17718
|
-
* ## Example:
|
|
17719
|
-
* ```typescript
|
|
17720
|
-
* interface MyFilterValue {
|
|
17721
|
-
* users: string[];
|
|
17722
|
-
* dateRange: { from?: Date; to?: Date };
|
|
17723
|
-
* }
|
|
17724
|
-
*
|
|
17725
|
-
* const myFilter = createFilterAdapter<DataType, MyFilterValue>({
|
|
17726
|
-
* id: 'myColumn',
|
|
17727
|
-
* label: 'My Filter',
|
|
17728
|
-
* initialValue: { users: [], dateRange: {} },
|
|
17729
|
-
*
|
|
17730
|
-
* filterFn: (row, columnId, filterValue) => {
|
|
17731
|
-
* // Your custom logic
|
|
17732
|
-
* return matchesUsers && matchesDateRange;
|
|
17733
|
-
* },
|
|
17734
|
-
*
|
|
17735
|
-
* toChips: (value) => {
|
|
17736
|
-
* // Generate chips from your filter value
|
|
17737
|
-
* return chips;
|
|
17738
|
-
* },
|
|
17739
|
-
*
|
|
17740
|
-
* fromChip: (chip, currentValue) => {
|
|
17741
|
-
* // Remove chip's effect from value
|
|
17742
|
-
* return updatedValue;
|
|
17743
|
-
* },
|
|
17744
|
-
*
|
|
17745
|
-
* getActiveFiltersCount: (value) => {
|
|
17746
|
-
* // Count active filters (0 means none active)
|
|
17747
|
-
* return count;
|
|
17748
|
-
* },
|
|
17749
|
-
*
|
|
17750
|
-
* renderFilter: (value, onChange) => (
|
|
17751
|
-
* <YourCustomFilterComponent
|
|
17752
|
-
* value={value}
|
|
17753
|
-
* onChange={onChange}
|
|
17754
|
-
* />
|
|
17755
|
-
* ),
|
|
17756
|
-
* });
|
|
17757
|
-
* ```
|
|
17758
|
-
*
|
|
17759
|
-
* ## Reference Implementation:
|
|
17760
|
-
* See `workflow-filters.config.tsx` for a complete example (lastEditedFilterAdapter).
|
|
17761
|
-
*
|
|
17762
|
-
* ## Note:
|
|
17763
|
-
* Most use cases are covered by `createCheckboxFilterAdapter` or `createDualRangeFilterAdapter`.
|
|
17764
|
-
* Only use this base function directly when you need completely custom filter logic.
|
|
18168
|
+
* Base factory used by every specialized adapter. Reach for it only when
|
|
18169
|
+
* `createCheckboxFilterAdapter` / `createDualRangeFilterAdapter` don't fit
|
|
18170
|
+
* (custom UI, mixed sub-filters, bespoke chip logic).
|
|
17765
18171
|
*/
|
|
17766
18172
|
function createFilterAdapter(config) {
|
|
17767
18173
|
return {
|
|
@@ -17778,31 +18184,78 @@ function createFilterAdapter(config) {
|
|
|
17778
18184
|
};
|
|
17779
18185
|
}
|
|
17780
18186
|
//#endregion
|
|
18187
|
+
//#region src/components/ds-table/filters/components/checkbox-filter/checkbox-filter.module.scss
|
|
18188
|
+
var checkbox_filter_module_default = {
|
|
18189
|
+
"checkboxItem": "H6sVkG_checkboxItem",
|
|
18190
|
+
"empty": "H6sVkG_empty",
|
|
18191
|
+
"list": "H6sVkG_list",
|
|
18192
|
+
"root": "H6sVkG_root"
|
|
18193
|
+
};
|
|
18194
|
+
//#endregion
|
|
17781
18195
|
//#region src/components/ds-table/filters/components/checkbox-filter/checkbox-filter.tsx
|
|
17782
|
-
const CheckboxFilter = ({ items, renderer, selectedItems, onSelectionChange }) => {
|
|
18196
|
+
const CheckboxFilter = ({ items, renderer, selectedItems, onSelectionChange, searchable = false, selectAll = false, locale, className }) => {
|
|
18197
|
+
const { allLabel = "All", searchPlaceholder = "Search", noMatchesLabel = "No matches" } = locale ?? {};
|
|
18198
|
+
const [query, setQuery] = useState("");
|
|
18199
|
+
const visibleItems = searchable ? items.filter((item) => item.label.toLowerCase().includes(query.trim().toLowerCase())) : items;
|
|
17783
18200
|
const handleCheckedChange = (selected, checked) => {
|
|
17784
18201
|
if (checked) onSelectionChange([...selectedItems, selected]);
|
|
17785
18202
|
else onSelectionChange(selectedItems.filter((item) => item.value !== selected.value));
|
|
17786
18203
|
};
|
|
17787
|
-
|
|
17788
|
-
|
|
17789
|
-
|
|
17790
|
-
|
|
17791
|
-
|
|
17792
|
-
|
|
18204
|
+
const visibleSelectedCount = visibleItems.filter((item) => selectedItems.some((selected) => selected.value === item.value)).length;
|
|
18205
|
+
const allVisibleSelected = visibleItems.length > 0 && visibleSelectedCount === visibleItems.length;
|
|
18206
|
+
const someVisibleSelected = visibleSelectedCount > 0 && !allVisibleSelected;
|
|
18207
|
+
const handleSelectAllChange = (next) => {
|
|
18208
|
+
const shouldSelect = next === true;
|
|
18209
|
+
const visibleValues = new Set(visibleItems.map((item) => item.value));
|
|
18210
|
+
const withoutVisible = selectedItems.filter((item) => !visibleValues.has(item.value));
|
|
18211
|
+
onSelectionChange(shouldSelect ? [...withoutVisible, ...visibleItems] : withoutVisible);
|
|
18212
|
+
};
|
|
18213
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
18214
|
+
className: classNames(checkbox_filter_module_default.root, className),
|
|
18215
|
+
children: [searchable && /* @__PURE__ */ jsx(DsTextInput, {
|
|
18216
|
+
value: query,
|
|
18217
|
+
placeholder: searchPlaceholder,
|
|
18218
|
+
onValueChange: setQuery,
|
|
18219
|
+
slots: { startAdornment: /* @__PURE__ */ jsx(DsIcon, {
|
|
18220
|
+
icon: "search",
|
|
18221
|
+
size: "tiny"
|
|
18222
|
+
}) }
|
|
18223
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
18224
|
+
className: checkbox_filter_module_default.list,
|
|
18225
|
+
role: "group",
|
|
18226
|
+
children: [
|
|
18227
|
+
selectAll && visibleItems.length > 0 && /* @__PURE__ */ jsx(DsCheckbox, {
|
|
18228
|
+
className: checkbox_filter_module_default.checkboxItem,
|
|
18229
|
+
label: allLabel,
|
|
18230
|
+
checked: allVisibleSelected ? true : someVisibleSelected ? "indeterminate" : false,
|
|
18231
|
+
onCheckedChange: handleSelectAllChange
|
|
18232
|
+
}),
|
|
18233
|
+
visibleItems.length === 0 && /* @__PURE__ */ jsx("div", {
|
|
18234
|
+
className: checkbox_filter_module_default.empty,
|
|
18235
|
+
children: noMatchesLabel
|
|
18236
|
+
}),
|
|
18237
|
+
visibleItems.map((item) => {
|
|
18238
|
+
const label = renderer ? renderer(item) : item.label;
|
|
18239
|
+
const checked = selectedItems.some((selected) => selected.value === item.value);
|
|
18240
|
+
return /* @__PURE__ */ jsx(DsCheckbox, {
|
|
18241
|
+
className: checkbox_filter_module_default.checkboxItem,
|
|
18242
|
+
label,
|
|
18243
|
+
checked,
|
|
18244
|
+
onCheckedChange: (next) => handleCheckedChange(item, next === true)
|
|
18245
|
+
}, JSON.stringify(item.value));
|
|
18246
|
+
})
|
|
18247
|
+
]
|
|
18248
|
+
})]
|
|
17793
18249
|
});
|
|
17794
18250
|
};
|
|
17795
18251
|
//#endregion
|
|
17796
18252
|
//#region src/components/ds-table/filters/adapters/create-checkbox-filter-adapter.tsx
|
|
17797
18253
|
/**
|
|
17798
|
-
*
|
|
17799
|
-
*
|
|
17800
|
-
* Handles multi-select checkbox filtering with inclusion model:
|
|
17801
|
-
* - Empty selection = show all data (no filter active)
|
|
17802
|
-
* - Selected items = show only those items
|
|
18254
|
+
* Multi-select inclusion filter: empty selection shows every row, selected
|
|
18255
|
+
* items show only those rows.
|
|
17803
18256
|
*/
|
|
17804
18257
|
function createCheckboxFilterAdapter(config) {
|
|
17805
|
-
const { id, label, items, renderer, chipLabelTemplate = (item) => `${label}: ${item.label}`, cellRenderer, getRowValue = (row) => row.getValue(id) } = config;
|
|
18258
|
+
const { id, label, items, renderer, chipLabelTemplate = (item) => `${label}: ${item.label}`, cellRenderer, getRowValue = (row) => row.getValue(id), searchable = false, selectAll = false, locale } = config;
|
|
17806
18259
|
return createFilterAdapter({
|
|
17807
18260
|
id,
|
|
17808
18261
|
label,
|
|
@@ -17834,7 +18287,10 @@ function createCheckboxFilterAdapter(config) {
|
|
|
17834
18287
|
items,
|
|
17835
18288
|
renderer,
|
|
17836
18289
|
selectedItems: value,
|
|
17837
|
-
onSelectionChange: onChange
|
|
18290
|
+
onSelectionChange: onChange,
|
|
18291
|
+
searchable,
|
|
18292
|
+
selectAll,
|
|
18293
|
+
locale
|
|
17838
18294
|
});
|
|
17839
18295
|
}
|
|
17840
18296
|
});
|
|
@@ -17919,10 +18375,7 @@ const RangeFilter = ({ label, value, onChange, onClear }) => {
|
|
|
17919
18375
|
};
|
|
17920
18376
|
//#endregion
|
|
17921
18377
|
//#region src/components/ds-table/filters/adapters/create-dual-range-filter-adapter.tsx
|
|
17922
|
-
/**
|
|
17923
|
-
* Factory function to create a dual-range filter adapter
|
|
17924
|
-
* Handles filtering on multiple numeric ranges within a single column
|
|
17925
|
-
*/
|
|
18378
|
+
/** Filter over multiple numeric ranges within one column (AND across fields). */
|
|
17926
18379
|
function createDualRangeFilterAdapter(config) {
|
|
17927
18380
|
const { id, label, fields, formatNumber = (num) => num.toLocaleString("en-US"), getRowValue = (row) => row.getValue(id) } = config;
|
|
17928
18381
|
const initialValue = {};
|
|
@@ -18001,28 +18454,16 @@ function createDualRangeFilterAdapter(config) {
|
|
|
18001
18454
|
}
|
|
18002
18455
|
//#endregion
|
|
18003
18456
|
//#region src/components/ds-table/filters/hooks/use-table-filters.ts
|
|
18457
|
+
const resolveColumnAdapterId = (meta) => {
|
|
18458
|
+
if (!meta) return;
|
|
18459
|
+
if ("render" in meta) return meta.filterId;
|
|
18460
|
+
if (meta.adapter) return meta.adapter.id;
|
|
18461
|
+
return meta.adapterId;
|
|
18462
|
+
};
|
|
18004
18463
|
/**
|
|
18005
|
-
*
|
|
18006
|
-
*
|
|
18007
|
-
*
|
|
18008
|
-
* **Uncontrolled mode** (default): Filters are managed internally.
|
|
18009
|
-
* **Controlled mode**: Filters are managed externally via appliedFilters/onFiltersChange.
|
|
18010
|
-
*
|
|
18011
|
-
* @example
|
|
18012
|
-
* // Uncontrolled mode
|
|
18013
|
-
* const { filterChips, handlers } = useTableFilters({
|
|
18014
|
-
* filterAdapters: adapters,
|
|
18015
|
-
* baseColumns: columns,
|
|
18016
|
-
* });
|
|
18017
|
-
*
|
|
18018
|
-
* @example
|
|
18019
|
-
* // Controlled mode (e.g., URL-driven filtering)
|
|
18020
|
-
* const { filterChips, handlers } = useTableFilters({
|
|
18021
|
-
* filterAdapters: adapters,
|
|
18022
|
-
* baseColumns: columns,
|
|
18023
|
-
* appliedFilters: filtersFromUrl,
|
|
18024
|
-
* onFiltersChange: (filters) => updateUrlAndRefetch(filters),
|
|
18025
|
-
* });
|
|
18464
|
+
* Orchestrates table filtering: drafts → applied state, chips, nav counts, and
|
|
18465
|
+
* column wiring. Uncontrolled by default; pass `appliedFilters` +
|
|
18466
|
+
* `onFiltersChange` for URL-driven / external state.
|
|
18026
18467
|
*/
|
|
18027
18468
|
function useTableFilters({ filterAdapters, baseColumns, appliedFilters: externalAppliedFilters, onFiltersChange: setExternalAppliedFilters }) {
|
|
18028
18469
|
const _filterAdapters = filterAdapters;
|
|
@@ -18057,13 +18498,28 @@ function useTableFilters({ filterAdapters, baseColumns, appliedFilters: external
|
|
|
18057
18498
|
count: adapter.getActiveFiltersCount(draftFilters[adapter.id])
|
|
18058
18499
|
}));
|
|
18059
18500
|
const enhancedColumns = !baseColumns ? [] : baseColumns.map((col) => {
|
|
18060
|
-
const
|
|
18501
|
+
const metaFilter = col.meta?.filter;
|
|
18502
|
+
const adapterIdFromMeta = resolveColumnAdapterId(metaFilter);
|
|
18503
|
+
const adapter = adapterIdFromMeta && _filterAdapters.find((a) => a.id === adapterIdFromMeta) || _filterAdapters.find((a) => a.id === col.id);
|
|
18061
18504
|
if (!adapter) return col;
|
|
18062
18505
|
const cellRenderer = adapter.cellRenderer;
|
|
18506
|
+
const appliedValue = appliedFilters[adapter.id];
|
|
18507
|
+
const resolvedFilter = metaFilter ? {
|
|
18508
|
+
filterId: adapter.id,
|
|
18509
|
+
hasActiveFilter: appliedValue !== void 0 && adapter.getActiveFiltersCount(appliedValue) > 0,
|
|
18510
|
+
render: () => renderForId(adapter.id),
|
|
18511
|
+
onApply: () => applyColumnFilter(adapter.id),
|
|
18512
|
+
onClear: () => clearColumnFilter(adapter.id),
|
|
18513
|
+
onCancel: () => cancelColumnFilter(adapter.id)
|
|
18514
|
+
} : void 0;
|
|
18063
18515
|
return {
|
|
18064
18516
|
...col,
|
|
18065
18517
|
filterFn: adapter.columnFilterFn,
|
|
18066
|
-
...cellRenderer && { cell: (info) => cellRenderer(info.getValue()) }
|
|
18518
|
+
...cellRenderer && { cell: (info) => cellRenderer(info.getValue()) },
|
|
18519
|
+
...resolvedFilter && { meta: {
|
|
18520
|
+
...col.meta,
|
|
18521
|
+
filter: resolvedFilter
|
|
18522
|
+
} }
|
|
18067
18523
|
};
|
|
18068
18524
|
});
|
|
18069
18525
|
const updateFilter = (filterId, value) => {
|
|
@@ -18084,6 +18540,29 @@ function useTableFilters({ filterAdapters, baseColumns, appliedFilters: external
|
|
|
18084
18540
|
setPendingFilters({});
|
|
18085
18541
|
setAppliedFilters({});
|
|
18086
18542
|
};
|
|
18543
|
+
const omitKey = (source, filterId) => Object.fromEntries(Object.entries(source).filter(([key]) => key !== filterId));
|
|
18544
|
+
const applyColumnFilter = (filterId) => {
|
|
18545
|
+
const adapter = _filterAdapters.find((a) => a.id === filterId);
|
|
18546
|
+
if (!adapter) return;
|
|
18547
|
+
const draftValue = draftFilters[filterId];
|
|
18548
|
+
setAppliedFilters(adapter.getActiveFiltersCount(draftValue) > 0 ? {
|
|
18549
|
+
...appliedFilters,
|
|
18550
|
+
[filterId]: draftValue
|
|
18551
|
+
} : omitKey(appliedFilters, filterId));
|
|
18552
|
+
setPendingFilters((prev) => omitKey(prev, filterId));
|
|
18553
|
+
};
|
|
18554
|
+
const cancelColumnFilter = (filterId) => {
|
|
18555
|
+
setPendingFilters((prev) => omitKey(prev, filterId));
|
|
18556
|
+
};
|
|
18557
|
+
const clearColumnFilter = (filterId) => {
|
|
18558
|
+
const adapter = _filterAdapters.find((a) => a.id === filterId);
|
|
18559
|
+
if (!adapter) return;
|
|
18560
|
+
setPendingFilters((prev) => ({
|
|
18561
|
+
...omitKey(prev, filterId),
|
|
18562
|
+
[filterId]: adapter.initialValue
|
|
18563
|
+
}));
|
|
18564
|
+
if (appliedFilters[filterId] !== void 0) setAppliedFilters(omitKey(appliedFilters, filterId));
|
|
18565
|
+
};
|
|
18087
18566
|
const deleteChip = (chip) => {
|
|
18088
18567
|
const filterKey = typeof chip.metadata?.key === "string" ? chip.metadata.key : void 0;
|
|
18089
18568
|
if (!filterKey) return;
|
|
@@ -18097,13 +18576,15 @@ function useTableFilters({ filterAdapters, baseColumns, appliedFilters: external
|
|
|
18097
18576
|
[filterKey]: newValue
|
|
18098
18577
|
});
|
|
18099
18578
|
};
|
|
18100
|
-
const
|
|
18101
|
-
const adapter = _filterAdapters.find((a) => a.id ===
|
|
18579
|
+
const renderForId = (filterId) => {
|
|
18580
|
+
const adapter = _filterAdapters.find((a) => a.id === filterId);
|
|
18102
18581
|
if (!adapter) return null;
|
|
18103
18582
|
const value = draftFilters[adapter.id];
|
|
18104
18583
|
const onChange = (newValue) => updateFilter(adapter.id, newValue);
|
|
18105
18584
|
return adapter.renderFilter(value, onChange);
|
|
18106
18585
|
};
|
|
18586
|
+
const renderFilterContent = (selectedFilter) => renderForId(selectedFilter.id);
|
|
18587
|
+
const renderColumnFilter = (filterId) => renderForId(filterId);
|
|
18107
18588
|
return {
|
|
18108
18589
|
filterState: draftFilters,
|
|
18109
18590
|
columnFilters,
|
|
@@ -18114,12 +18595,94 @@ function useTableFilters({ filterAdapters, baseColumns, appliedFilters: external
|
|
|
18114
18595
|
updateFilter,
|
|
18115
18596
|
applyFilters,
|
|
18116
18597
|
clearAll,
|
|
18117
|
-
deleteChip
|
|
18598
|
+
deleteChip,
|
|
18599
|
+
applyColumnFilter,
|
|
18600
|
+
cancelColumnFilter,
|
|
18601
|
+
clearColumnFilter
|
|
18118
18602
|
},
|
|
18119
|
-
renderFilterContent
|
|
18603
|
+
renderFilterContent,
|
|
18604
|
+
renderColumnFilter
|
|
18120
18605
|
};
|
|
18121
18606
|
}
|
|
18122
18607
|
//#endregion
|
|
18608
|
+
//#region src/components/ds-table/filters/components/column-filter-popover/column-filter-popover.module.scss
|
|
18609
|
+
var column_filter_popover_module_default = {
|
|
18610
|
+
"body": "_0oV9a_body",
|
|
18611
|
+
"content": "_0oV9a_content",
|
|
18612
|
+
"footer": "_0oV9a_footer",
|
|
18613
|
+
"trigger": "_0oV9a_trigger",
|
|
18614
|
+
"triggerActive": "_0oV9a_triggerActive",
|
|
18615
|
+
"triggerOpen": "_0oV9a_triggerOpen"
|
|
18616
|
+
};
|
|
18617
|
+
//#endregion
|
|
18618
|
+
//#region src/components/ds-table/filters/components/column-filter-popover/column-filter-popover.tsx
|
|
18619
|
+
const stopPropagation = (event) => event.stopPropagation();
|
|
18620
|
+
/**
|
|
18621
|
+
* Per-column filter popover anchored to a header cell: funnel trigger,
|
|
18622
|
+
* adapter UI as the body, Clear / Save footer wired to `useTableFilters`.
|
|
18623
|
+
*/
|
|
18624
|
+
const DsTableColumnFilterPopover = ({ children, hasActiveFilter, onApply, onClear, onCancel, locale, className }) => {
|
|
18625
|
+
const { triggerAriaLabel = "Filter column", clearLabel = "Clear", saveLabel = "Save" } = locale ?? {};
|
|
18626
|
+
const [open, setOpen] = useState(false);
|
|
18627
|
+
const handleOpenChange = (details) => {
|
|
18628
|
+
if (open && !details.open) onCancel();
|
|
18629
|
+
setOpen(details.open);
|
|
18630
|
+
};
|
|
18631
|
+
const handleSave = () => {
|
|
18632
|
+
onApply();
|
|
18633
|
+
setOpen(false);
|
|
18634
|
+
};
|
|
18635
|
+
const handleClear = () => {
|
|
18636
|
+
onClear();
|
|
18637
|
+
setOpen(false);
|
|
18638
|
+
};
|
|
18639
|
+
return /* @__PURE__ */ jsxs(Popover.Root, {
|
|
18640
|
+
open,
|
|
18641
|
+
onOpenChange: handleOpenChange,
|
|
18642
|
+
positioning: {
|
|
18643
|
+
placement: "bottom-end",
|
|
18644
|
+
gutter: 4
|
|
18645
|
+
},
|
|
18646
|
+
children: [/* @__PURE__ */ jsx(Popover.Trigger, {
|
|
18647
|
+
asChild: true,
|
|
18648
|
+
children: /* @__PURE__ */ jsx(DsButtonV3, {
|
|
18649
|
+
variant: "tertiary",
|
|
18650
|
+
size: "tiny",
|
|
18651
|
+
className: classNames(column_filter_popover_module_default.trigger, hasActiveFilter && column_filter_popover_module_default.triggerActive, open && column_filter_popover_module_default.triggerOpen),
|
|
18652
|
+
"aria-label": triggerAriaLabel,
|
|
18653
|
+
"data-active": hasActiveFilter ? "true" : void 0,
|
|
18654
|
+
onClick: (event) => event.stopPropagation(),
|
|
18655
|
+
children: /* @__PURE__ */ jsx(DsIcon, {
|
|
18656
|
+
icon: "filter_alt",
|
|
18657
|
+
variant: "outlined",
|
|
18658
|
+
filled: hasActiveFilter,
|
|
18659
|
+
size: "tiny"
|
|
18660
|
+
})
|
|
18661
|
+
})
|
|
18662
|
+
}), /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Popover.Positioner, { children: /* @__PURE__ */ jsxs(Popover.Content, {
|
|
18663
|
+
className: classNames(column_filter_popover_module_default.content, className),
|
|
18664
|
+
onClick: stopPropagation,
|
|
18665
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
18666
|
+
className: column_filter_popover_module_default.body,
|
|
18667
|
+
children
|
|
18668
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
18669
|
+
className: column_filter_popover_module_default.footer,
|
|
18670
|
+
children: [/* @__PURE__ */ jsx(DsButtonV3, {
|
|
18671
|
+
variant: "secondary",
|
|
18672
|
+
size: "small",
|
|
18673
|
+
onClick: handleClear,
|
|
18674
|
+
children: clearLabel
|
|
18675
|
+
}), /* @__PURE__ */ jsx(DsButtonV3, {
|
|
18676
|
+
variant: "primary",
|
|
18677
|
+
size: "small",
|
|
18678
|
+
onClick: handleSave,
|
|
18679
|
+
children: saveLabel
|
|
18680
|
+
})]
|
|
18681
|
+
})]
|
|
18682
|
+
}) }) })]
|
|
18683
|
+
});
|
|
18684
|
+
};
|
|
18685
|
+
//#endregion
|
|
18123
18686
|
//#region src/components/ds-table/components/core-table/core-table.module.scss
|
|
18124
18687
|
var core_table_module_default = {
|
|
18125
18688
|
"table": "JP3Vta_table",
|
|
@@ -18256,6 +18819,9 @@ const DsTableBulkActions = ({ numSelectedRows, actions, onClearSelection }) => {
|
|
|
18256
18819
|
//#endregion
|
|
18257
18820
|
//#region src/components/ds-table/components/ds-table-header/ds-table-header.module.scss
|
|
18258
18821
|
var ds_table_header_module_default = {
|
|
18822
|
+
"filterableHeader": "-2rCNG_filterableHeader",
|
|
18823
|
+
"filterActive": "-2rCNG_filterActive",
|
|
18824
|
+
"filterTriggerContainer": "-2rCNG_filterTriggerContainer",
|
|
18259
18825
|
"headerCell": "-2rCNG_headerCell",
|
|
18260
18826
|
"headerRow": "-2rCNG_headerRow",
|
|
18261
18827
|
"headerRowNoBorder": "-2rCNG_headerRowNoBorder",
|
|
@@ -18290,18 +18856,83 @@ const useDsTableContext = () => {
|
|
|
18290
18856
|
if (!context) throw new Error("useDsTableContext must be used within DsTable");
|
|
18291
18857
|
return context;
|
|
18292
18858
|
};
|
|
18859
|
+
/**
|
|
18860
|
+
* Hoisted editing state for single-cell-at-a-time inline editing.
|
|
18861
|
+
* Lives on {@link DsTableContext} so cell renderers and editors share one provider.
|
|
18862
|
+
*/
|
|
18863
|
+
const useEditingState = (onCellEdit, onCellValidate) => {
|
|
18864
|
+
const [editing, setEditing] = useState(null);
|
|
18865
|
+
const onCellEditRef = useRef(onCellEdit);
|
|
18866
|
+
onCellEditRef.current = onCellEdit;
|
|
18867
|
+
const onCellValidateRef = useRef(onCellValidate);
|
|
18868
|
+
onCellValidateRef.current = onCellValidate;
|
|
18869
|
+
const editingRef = useRef(editing);
|
|
18870
|
+
editingRef.current = editing;
|
|
18871
|
+
return {
|
|
18872
|
+
editing,
|
|
18873
|
+
beginEdit: useCallback((cell) => {
|
|
18874
|
+
const current = editingRef.current;
|
|
18875
|
+
if (current) {
|
|
18876
|
+
if (current.cell.row.id === cell.row.id && current.cell.column.id === cell.column.id) return;
|
|
18877
|
+
}
|
|
18878
|
+
setEditing({
|
|
18879
|
+
cell,
|
|
18880
|
+
draftValue: cell.getValue(),
|
|
18881
|
+
error: null
|
|
18882
|
+
});
|
|
18883
|
+
}, []),
|
|
18884
|
+
setDraft: useCallback((value) => {
|
|
18885
|
+
const current = editingRef.current;
|
|
18886
|
+
if (!current) return;
|
|
18887
|
+
setEditing({
|
|
18888
|
+
...current,
|
|
18889
|
+
draftValue: value,
|
|
18890
|
+
error: null
|
|
18891
|
+
});
|
|
18892
|
+
}, []),
|
|
18893
|
+
commit: useCallback((overrideValue) => {
|
|
18894
|
+
const current = editingRef.current;
|
|
18895
|
+
if (!current) return;
|
|
18896
|
+
const valueToCommit = overrideValue !== void 0 ? overrideValue : current.draftValue;
|
|
18897
|
+
const error = onCellValidateRef.current?.(current.cell.row.original, current.cell.column.id, valueToCommit) ?? null;
|
|
18898
|
+
if (error !== null) {
|
|
18899
|
+
setEditing({
|
|
18900
|
+
...current,
|
|
18901
|
+
draftValue: valueToCommit,
|
|
18902
|
+
error
|
|
18903
|
+
});
|
|
18904
|
+
return;
|
|
18905
|
+
}
|
|
18906
|
+
onCellEditRef.current?.(current.cell.row.original, current.cell.column.id, valueToCommit);
|
|
18907
|
+
setEditing(null);
|
|
18908
|
+
}, []),
|
|
18909
|
+
cancel: useCallback(() => {
|
|
18910
|
+
setEditing(null);
|
|
18911
|
+
}, [])
|
|
18912
|
+
};
|
|
18913
|
+
};
|
|
18293
18914
|
//#endregion
|
|
18294
18915
|
//#region src/components/ds-table/utils/column-size.ts
|
|
18295
18916
|
/**
|
|
18296
|
-
* Generates the appropriate style object for a table column/cell based on its size
|
|
18917
|
+
* Generates the appropriate style object for a table column/cell based on its size
|
|
18918
|
+
*
|
|
18919
|
+
* Custom-sized columns get a fixed `width` plus `minWidth` and `flexShrink: 0` so
|
|
18920
|
+
* they enforce horizontal overflow on the table container. Default-sized columns
|
|
18921
|
+
* grow to fill the row evenly via `flex: 1`.
|
|
18297
18922
|
*
|
|
18298
18923
|
* @param columnSize - The size of the column
|
|
18299
|
-
* @
|
|
18300
|
-
* @returns Style object or undefined if no custom styling is needed
|
|
18924
|
+
* @returns Style object for the column/cell
|
|
18301
18925
|
*/
|
|
18302
|
-
const getColumnSizeStyle = (columnSize
|
|
18303
|
-
if (columnSize !== defaultColumnSizing.size) return {
|
|
18304
|
-
|
|
18926
|
+
const getColumnSizeStyle = (columnSize) => {
|
|
18927
|
+
if (columnSize !== defaultColumnSizing.size) return {
|
|
18928
|
+
width: columnSize,
|
|
18929
|
+
minWidth: columnSize,
|
|
18930
|
+
flexShrink: 0
|
|
18931
|
+
};
|
|
18932
|
+
return {
|
|
18933
|
+
flex: 1,
|
|
18934
|
+
minWidth: 0
|
|
18935
|
+
};
|
|
18305
18936
|
};
|
|
18306
18937
|
/**
|
|
18307
18938
|
* Column id used for the synthetic expander column injected when `expandable` is set.
|
|
@@ -18325,33 +18956,49 @@ const DsTableHeader = ({ table }) => {
|
|
|
18325
18956
|
children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(TableRow, {
|
|
18326
18957
|
className: classNames(ds_table_header_module_default.headerRow, !bordered && ds_table_header_module_default.headerRowNoBorder, virtualized && ds_table_header_module_default.headerRowVirtualized),
|
|
18327
18958
|
children: headerGroup.headers.map((header) => {
|
|
18328
|
-
const headerStyle = getColumnSizeStyle(header.column.getSize()
|
|
18959
|
+
const headerStyle = getColumnSizeStyle(header.column.getSize());
|
|
18329
18960
|
const canSort = header.column.getCanSort();
|
|
18330
18961
|
const isSelectColumn = header.column.id === SELECT_COLUMN_ID;
|
|
18962
|
+
const metaFilter = header.column.columnDef.meta?.filter;
|
|
18963
|
+
const resolvedFilter = metaFilter && "render" in metaFilter ? metaFilter : void 0;
|
|
18964
|
+
const hasActiveColumnFilter = resolvedFilter?.hasActiveFilter ?? false;
|
|
18331
18965
|
return /* @__PURE__ */ jsx(TableHead, {
|
|
18332
|
-
className: classNames(ds_table_header_module_default.headerCell, canSort && ds_table_header_module_default.sortableHeader, isSelectColumn && ds_table_header_module_default.selectHeaderCell),
|
|
18966
|
+
className: classNames(ds_table_header_module_default.headerCell, canSort && ds_table_header_module_default.sortableHeader, isSelectColumn && ds_table_header_module_default.selectHeaderCell, resolvedFilter && ds_table_header_module_default.filterableHeader, hasActiveColumnFilter && ds_table_header_module_default.filterActive),
|
|
18333
18967
|
onClick: header.column.getToggleSortingHandler(),
|
|
18334
18968
|
style: headerStyle,
|
|
18335
18969
|
children: header.isPlaceholder ? null : /* @__PURE__ */ jsxs("div", {
|
|
18336
18970
|
className: ds_table_header_module_default.headerSortContainer,
|
|
18337
|
-
children: [
|
|
18338
|
-
|
|
18339
|
-
|
|
18340
|
-
|
|
18341
|
-
|
|
18342
|
-
|
|
18343
|
-
|
|
18344
|
-
|
|
18345
|
-
|
|
18346
|
-
|
|
18347
|
-
|
|
18348
|
-
|
|
18349
|
-
|
|
18350
|
-
|
|
18351
|
-
|
|
18971
|
+
children: [
|
|
18972
|
+
/* @__PURE__ */ jsx(DsStack, {
|
|
18973
|
+
direction: "column",
|
|
18974
|
+
justifyContent: "center",
|
|
18975
|
+
width: "100%",
|
|
18976
|
+
children: flexRender(header.column.columnDef.header, header.getContext())
|
|
18977
|
+
}),
|
|
18978
|
+
canSort && /* @__PURE__ */ jsx("div", {
|
|
18979
|
+
className: ds_table_header_module_default.pageButtonIconContainer,
|
|
18980
|
+
children: {
|
|
18981
|
+
asc: /* @__PURE__ */ jsx(DsIcon, {
|
|
18982
|
+
icon: "arrow_drop_up",
|
|
18983
|
+
className: classNames(ds_table_header_module_default.pageButtonIcon, ds_table_shared_module_default.pageButtonIcon)
|
|
18984
|
+
}),
|
|
18985
|
+
desc: /* @__PURE__ */ jsx(DsIcon, {
|
|
18986
|
+
icon: "arrow_drop_down",
|
|
18987
|
+
className: classNames(ds_table_header_module_default.pageButtonIcon, ds_table_shared_module_default.pageButtonIcon)
|
|
18988
|
+
})
|
|
18989
|
+
}[header.column.getIsSorted()] ?? /* @__PURE__ */ jsx("div", { className: classNames(ds_table_header_module_default.pageButtonIcon, ds_table_shared_module_default.pageButtonIcon) })
|
|
18990
|
+
}),
|
|
18991
|
+
resolvedFilter && /* @__PURE__ */ jsx("div", {
|
|
18992
|
+
className: ds_table_header_module_default.filterTriggerContainer,
|
|
18993
|
+
children: /* @__PURE__ */ jsx(DsTableColumnFilterPopover, {
|
|
18994
|
+
hasActiveFilter: resolvedFilter.hasActiveFilter,
|
|
18995
|
+
onApply: resolvedFilter.onApply,
|
|
18996
|
+
onClear: resolvedFilter.onClear,
|
|
18997
|
+
onCancel: resolvedFilter.onCancel,
|
|
18998
|
+
children: resolvedFilter.render()
|
|
18352
18999
|
})
|
|
18353
|
-
}
|
|
18354
|
-
|
|
19000
|
+
})
|
|
19001
|
+
]
|
|
18355
19002
|
})
|
|
18356
19003
|
}, header.id);
|
|
18357
19004
|
})
|
|
@@ -18366,20 +19013,124 @@ var ds_table_module_default = {
|
|
|
18366
19013
|
"dataTableContainer": "iL9mtW_dataTableContainer",
|
|
18367
19014
|
"emptyState": "iL9mtW_emptyState",
|
|
18368
19015
|
"fullWidth": "iL9mtW_fullWidth",
|
|
18369
|
-
"
|
|
18370
|
-
"rotate-135": "iL9mtW_rotate-135",
|
|
18371
|
-
"rotate-180": "iL9mtW_rotate-180",
|
|
18372
|
-
"rotate-225": "iL9mtW_rotate-225",
|
|
18373
|
-
"rotate-270": "iL9mtW_rotate-270",
|
|
18374
|
-
"rotate-315": "iL9mtW_rotate-315",
|
|
18375
|
-
"rotate-45": "iL9mtW_rotate-45",
|
|
18376
|
-
"rotate-90": "iL9mtW_rotate-90",
|
|
19016
|
+
"scrollbar-thin": "iL9mtW_scrollbar-thin",
|
|
18377
19017
|
"table": "iL9mtW_table",
|
|
18378
19018
|
"tableNoBorder": "iL9mtW_tableNoBorder",
|
|
18379
|
-
"virtualized": "iL9mtW_virtualized",
|
|
18380
19019
|
"virtualizedContainer": "iL9mtW_virtualizedContainer"
|
|
18381
19020
|
};
|
|
18382
19021
|
//#endregion
|
|
19022
|
+
//#region src/components/ds-table/components/edit/ds-table-editable-cell/ds-table-editable-cell.module.scss
|
|
19023
|
+
var ds_table_editable_cell_module_default = {
|
|
19024
|
+
"editButton": "g5FEoW_editButton",
|
|
19025
|
+
"root": "g5FEoW_root"
|
|
19026
|
+
};
|
|
19027
|
+
//#endregion
|
|
19028
|
+
//#region src/components/ds-table/components/edit/ds-table-editable-cell/ds-table-editable-cell.tsx
|
|
19029
|
+
const DsTableEditableCell = ({ cell, children }) => {
|
|
19030
|
+
const { beginEdit, editing } = useDsTableContext();
|
|
19031
|
+
const isEditing = editing !== null && editing.cell.row.id === cell.row.id && editing.cell.column.id === cell.column.id;
|
|
19032
|
+
const handleEdit = (event) => {
|
|
19033
|
+
event.stopPropagation();
|
|
19034
|
+
beginEdit(cell);
|
|
19035
|
+
};
|
|
19036
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
19037
|
+
className: ds_table_editable_cell_module_default.root,
|
|
19038
|
+
"data-active": isEditing ? "" : void 0,
|
|
19039
|
+
onDoubleClick: handleEdit,
|
|
19040
|
+
tabIndex: 0,
|
|
19041
|
+
role: "button",
|
|
19042
|
+
"aria-label": "Double-click to edit",
|
|
19043
|
+
children: [children, /* @__PURE__ */ jsx(DsButtonV3, {
|
|
19044
|
+
className: ds_table_editable_cell_module_default.editButton,
|
|
19045
|
+
variant: "tertiary",
|
|
19046
|
+
size: "small",
|
|
19047
|
+
icon: "edit",
|
|
19048
|
+
"aria-label": "Edit cell",
|
|
19049
|
+
onClick: handleEdit
|
|
19050
|
+
})]
|
|
19051
|
+
});
|
|
19052
|
+
};
|
|
19053
|
+
//#endregion
|
|
19054
|
+
//#region src/components/ds-table/components/edit/ds-table-editing-cell/ds-table-editing-cell.module.scss
|
|
19055
|
+
var ds_table_editing_cell_module_default = {
|
|
19056
|
+
"actions": "-EpLaa_actions",
|
|
19057
|
+
"editAnchor": "-EpLaa_editAnchor",
|
|
19058
|
+
"overlay": "-EpLaa_overlay",
|
|
19059
|
+
"row": "-EpLaa_row",
|
|
19060
|
+
"slot": "-EpLaa_slot"
|
|
19061
|
+
};
|
|
19062
|
+
//#endregion
|
|
19063
|
+
//#region src/components/ds-table/components/edit/ds-table-editing-cell/ds-table-editing-cell.tsx
|
|
19064
|
+
const DsTableEditingCell = ({ cell }) => {
|
|
19065
|
+
const { commit, cancel } = useDsTableContext();
|
|
19066
|
+
const columnDef = cell.column.columnDef;
|
|
19067
|
+
const editAnchorRef = useRef(null);
|
|
19068
|
+
const handleSubmit = (event) => {
|
|
19069
|
+
event.preventDefault();
|
|
19070
|
+
event.stopPropagation();
|
|
19071
|
+
commit();
|
|
19072
|
+
};
|
|
19073
|
+
useEffect(() => {
|
|
19074
|
+
const handleKeyDown = (event) => {
|
|
19075
|
+
if (event.key !== "Escape") return;
|
|
19076
|
+
if (!editAnchorRef.current?.contains(document.activeElement)) return;
|
|
19077
|
+
event.preventDefault();
|
|
19078
|
+
event.stopPropagation();
|
|
19079
|
+
cancel();
|
|
19080
|
+
};
|
|
19081
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
19082
|
+
return () => {
|
|
19083
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
19084
|
+
};
|
|
19085
|
+
}, [cancel]);
|
|
19086
|
+
return /* @__PURE__ */ jsx("div", {
|
|
19087
|
+
ref: editAnchorRef,
|
|
19088
|
+
className: ds_table_editing_cell_module_default.editAnchor,
|
|
19089
|
+
children: /* @__PURE__ */ jsx("form", {
|
|
19090
|
+
className: ds_table_editing_cell_module_default.overlay,
|
|
19091
|
+
onSubmit: handleSubmit,
|
|
19092
|
+
children: /* @__PURE__ */ jsxs(DsStack, {
|
|
19093
|
+
direction: "row",
|
|
19094
|
+
gap: "var(--3xs)",
|
|
19095
|
+
alignItems: "flex-start",
|
|
19096
|
+
width: "100%",
|
|
19097
|
+
className: ds_table_editing_cell_module_default.row,
|
|
19098
|
+
children: [/* @__PURE__ */ jsx(DsStack, {
|
|
19099
|
+
flex: "1 1 auto",
|
|
19100
|
+
className: ds_table_editing_cell_module_default.slot,
|
|
19101
|
+
children: columnDef.editCell ? flexRender(columnDef.editCell, cell.getContext()) : null
|
|
19102
|
+
}), /* @__PURE__ */ jsxs(DsStack, {
|
|
19103
|
+
direction: "row",
|
|
19104
|
+
gap: "var(--3xs)",
|
|
19105
|
+
className: ds_table_editing_cell_module_default.actions,
|
|
19106
|
+
children: [/* @__PURE__ */ jsx(DsButtonV3, {
|
|
19107
|
+
type: "button",
|
|
19108
|
+
variant: "tertiary",
|
|
19109
|
+
size: "small",
|
|
19110
|
+
icon: "close",
|
|
19111
|
+
"aria-label": "Cancel edit",
|
|
19112
|
+
onClick: (event) => {
|
|
19113
|
+
event.stopPropagation();
|
|
19114
|
+
cancel();
|
|
19115
|
+
},
|
|
19116
|
+
style: { color: "var(--icon-error)" }
|
|
19117
|
+
}), /* @__PURE__ */ jsx(DsButtonV3, {
|
|
19118
|
+
type: "submit",
|
|
19119
|
+
variant: "tertiary",
|
|
19120
|
+
size: "small",
|
|
19121
|
+
icon: "check",
|
|
19122
|
+
"aria-label": "Confirm edit",
|
|
19123
|
+
onClick: (event) => {
|
|
19124
|
+
event.stopPropagation();
|
|
19125
|
+
},
|
|
19126
|
+
style: { color: "var(--icon-success)" }
|
|
19127
|
+
})]
|
|
19128
|
+
})]
|
|
19129
|
+
})
|
|
19130
|
+
})
|
|
19131
|
+
});
|
|
19132
|
+
};
|
|
19133
|
+
//#endregion
|
|
18383
19134
|
//#region src/components/ds-table/components/ds-table-cell/ds-table-cell.module.scss
|
|
18384
19135
|
var ds_table_cell_module_default = {
|
|
18385
19136
|
"cellActions": "UprPSq_cellActions",
|
|
@@ -18391,20 +19142,19 @@ var ds_table_cell_module_default = {
|
|
|
18391
19142
|
};
|
|
18392
19143
|
//#endregion
|
|
18393
19144
|
//#region src/components/ds-table/components/ds-table-cell/ds-table-cell.tsx
|
|
18394
|
-
const DsDefaultTableCell = ({ cell }) => {
|
|
18395
|
-
return /* @__PURE__ */ jsx("div", {
|
|
18396
|
-
className: ds_table_cell_module_default.tableCellEllipsis,
|
|
18397
|
-
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
18398
|
-
});
|
|
18399
|
-
};
|
|
18400
19145
|
const DsTableCell = ({ row, cell, primaryRowActions = [], secondaryRowActions = [] }) => {
|
|
19146
|
+
const { editing } = useDsTableContext();
|
|
19147
|
+
const isCellBeingEdited = editing !== null && editing.cell.row.id === row.id && editing.cell.column.id === cell.column.id;
|
|
18401
19148
|
const visiblePrimary = primaryRowActions.filter((action) => !action.hidden?.(row.original));
|
|
18402
19149
|
const visibleSecondary = secondaryRowActions.filter((action) => !action.hidden?.(row.original));
|
|
18403
|
-
if (visiblePrimary.length || visibleSecondary.length) {
|
|
19150
|
+
if (!isCellBeingEdited && (visiblePrimary.length || visibleSecondary.length)) {
|
|
18404
19151
|
const hasSecondaryRowActions = visibleSecondary.length > 0;
|
|
18405
19152
|
return /* @__PURE__ */ jsxs("div", {
|
|
18406
19153
|
className: ds_table_cell_module_default.lastCell,
|
|
18407
|
-
children: [/* @__PURE__ */ jsx(
|
|
19154
|
+
children: [/* @__PURE__ */ jsx(CellContent, {
|
|
19155
|
+
cell,
|
|
19156
|
+
isCellBeingEdited
|
|
19157
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
18408
19158
|
className: ds_table_cell_module_default.cellActions,
|
|
18409
19159
|
children: [visiblePrimary.map((action, i) => {
|
|
18410
19160
|
const isDisabled = action.disabled?.(row.original);
|
|
@@ -18455,13 +19205,32 @@ const DsTableCell = ({ row, cell, primaryRowActions = [], secondaryRowActions =
|
|
|
18455
19205
|
})]
|
|
18456
19206
|
});
|
|
18457
19207
|
}
|
|
18458
|
-
return /* @__PURE__ */ jsx(
|
|
19208
|
+
return /* @__PURE__ */ jsx(CellContent, {
|
|
19209
|
+
cell,
|
|
19210
|
+
isCellBeingEdited
|
|
19211
|
+
});
|
|
19212
|
+
};
|
|
19213
|
+
const CellContent = ({ cell, isCellBeingEdited }) => {
|
|
19214
|
+
const isEditable = typeof cell.column.columnDef.editCell === "function";
|
|
19215
|
+
if (isCellBeingEdited) return /* @__PURE__ */ jsx(DsTableEditingCell, { cell });
|
|
19216
|
+
if (isEditable) return /* @__PURE__ */ jsx(DsTableEditableCell, {
|
|
19217
|
+
cell,
|
|
19218
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
19219
|
+
className: ds_table_cell_module_default.tableCellEllipsis,
|
|
19220
|
+
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
19221
|
+
})
|
|
19222
|
+
});
|
|
19223
|
+
return /* @__PURE__ */ jsx("div", {
|
|
19224
|
+
className: ds_table_cell_module_default.tableCellEllipsis,
|
|
19225
|
+
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
19226
|
+
});
|
|
18459
19227
|
};
|
|
18460
19228
|
//#endregion
|
|
18461
19229
|
//#region src/components/ds-table/components/ds-table-row/ds-table-row.module.scss
|
|
18462
19230
|
var ds_table_row_module_default = {
|
|
18463
19231
|
"cellReorder": "t8OZCq_cellReorder",
|
|
18464
19232
|
"clickableRow": "t8OZCq_clickableRow",
|
|
19233
|
+
"editableCell": "t8OZCq_editableCell",
|
|
18465
19234
|
"expandableCell": "t8OZCq_expandableCell",
|
|
18466
19235
|
"expanded": "t8OZCq_expanded",
|
|
18467
19236
|
"expandedRow": "t8OZCq_expandedRow",
|
|
@@ -18530,7 +19299,7 @@ const DsTableRow = ({ ref, row, isSelected }) => {
|
|
|
18530
19299
|
}, cell.id);
|
|
18531
19300
|
const isLastColumn = idx === row.getVisibleCells().length - 1;
|
|
18532
19301
|
return /* @__PURE__ */ jsx(TableCell, {
|
|
18533
|
-
className: classNames(ds_table_row_module_default.tableCell, cell.column.id === "expander" && ds_table_row_module_default.expandableCell, cell.column.id === "select" && ds_table_row_module_default.selectableCell),
|
|
19302
|
+
className: classNames(ds_table_row_module_default.tableCell, cell.column.id === "expander" && ds_table_row_module_default.expandableCell, cell.column.id === "select" && ds_table_row_module_default.selectableCell, typeof cell.column.columnDef.editCell === "function" && ds_table_row_module_default.editableCell),
|
|
18534
19303
|
style: cellStyle,
|
|
18535
19304
|
children: isLastColumn ? /* @__PURE__ */ jsx(DsTableCell, {
|
|
18536
19305
|
row,
|
|
@@ -18650,13 +19419,16 @@ function useDragAndDrop({ isDragEnabled, onOrderChange, items }) {
|
|
|
18650
19419
|
//#region src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.module.scss
|
|
18651
19420
|
var ds_table_body_virtualized_module_default = {
|
|
18652
19421
|
"body": "vRRk8q_body",
|
|
18653
|
-
"emptyState": "vRRk8q_emptyState"
|
|
19422
|
+
"emptyState": "vRRk8q_emptyState",
|
|
19423
|
+
"scrollbar-thin": "vRRk8q_scrollbar-thin",
|
|
19424
|
+
"sentinel": "vRRk8q_sentinel"
|
|
18654
19425
|
};
|
|
18655
19426
|
//#endregion
|
|
18656
19427
|
//#region src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.module.scss
|
|
18657
19428
|
var ds_table_row_virtualized_module_default = {
|
|
18658
19429
|
"cell": "NcME7q_cell",
|
|
18659
19430
|
"clickableRow": "NcME7q_clickableRow",
|
|
19431
|
+
"editableCell": "NcME7q_editableCell",
|
|
18660
19432
|
"expandableCell": "NcME7q_expandableCell",
|
|
18661
19433
|
"expanded": "NcME7q_expanded",
|
|
18662
19434
|
"expandedRow": "NcME7q_expandedRow",
|
|
@@ -18696,8 +19468,8 @@ const DsTableRowVirtualized = ({ row, isSelected, rowsMapRef, rowHeightsMapRef,
|
|
|
18696
19468
|
children: isExpandedRowContent ? /* @__PURE__ */ jsx(TableCell, { children: renderExpandedRow?.(row.original) }) : /* @__PURE__ */ jsx(Fragment, { children: row.getVisibleCells().map((cell, idx) => {
|
|
18697
19469
|
const isLastColumn = idx === row.getVisibleCells().length - 1;
|
|
18698
19470
|
return /* @__PURE__ */ jsx(TableCell, {
|
|
18699
|
-
style: getColumnSizeStyle(cell.column.getSize()
|
|
18700
|
-
className: classNames(ds_table_row_virtualized_module_default.cell, cell.column.id === "expander" && ds_table_row_virtualized_module_default.expandableCell, cell.column.id === "select" && ds_table_row_virtualized_module_default.selectableCell),
|
|
19471
|
+
style: getColumnSizeStyle(cell.column.getSize()),
|
|
19472
|
+
className: classNames(ds_table_row_virtualized_module_default.cell, cell.column.id === "expander" && ds_table_row_virtualized_module_default.expandableCell, cell.column.id === "select" && ds_table_row_virtualized_module_default.selectableCell, typeof cell.column.columnDef.editCell === "function" && ds_table_row_virtualized_module_default.editableCell),
|
|
18701
19473
|
children: isLastColumn ? /* @__PURE__ */ jsx(DsTableCell, {
|
|
18702
19474
|
row,
|
|
18703
19475
|
cell,
|
|
@@ -18742,9 +19514,10 @@ const useInfiniteScroll = (scrollElementRef, rowCount, config) => {
|
|
|
18742
19514
|
};
|
|
18743
19515
|
//#endregion
|
|
18744
19516
|
//#region src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.tsx
|
|
18745
|
-
const DsTableBodyVirtualized = ({ table,
|
|
19517
|
+
const DsTableBodyVirtualized = ({ table, emptyState, estimateSize, overscan, onScroll, rowSelection, infiniteScroll }) => {
|
|
18746
19518
|
const rowsMapRef = useRef(/* @__PURE__ */ new Map());
|
|
18747
19519
|
const rowHeightsMapRef = useRef(/* @__PURE__ */ new Map());
|
|
19520
|
+
const tbodyRef = useRef(null);
|
|
18748
19521
|
const { rows } = table.getRowModel();
|
|
18749
19522
|
const rowsAndExpandedRowContent = rows.flatMap((row) => row.getIsExpanded() ? [{ row }, {
|
|
18750
19523
|
row,
|
|
@@ -18754,14 +19527,14 @@ const DsTableBodyVirtualized = ({ table, tableContainerRef, emptyState, estimate
|
|
|
18754
19527
|
const item = rowsAndExpandedRowContent[index];
|
|
18755
19528
|
return item ? `${item.row.id}${item.isExpandedRowContent ? "-expanded-content" : ""}` : String(index);
|
|
18756
19529
|
};
|
|
18757
|
-
const { loadDataIfNeeded } = useInfiniteScroll(
|
|
19530
|
+
const { loadDataIfNeeded } = useInfiniteScroll(tbodyRef, rows.length, infiniteScroll);
|
|
18758
19531
|
const rowVirtualizer = useVirtualizer({
|
|
18759
19532
|
count: rowsAndExpandedRowContent.length,
|
|
18760
19533
|
estimateSize: (index) => {
|
|
18761
19534
|
return rowHeightsMapRef.current.get(getItemKey(index)) || estimateSize;
|
|
18762
19535
|
},
|
|
18763
19536
|
getItemKey,
|
|
18764
|
-
getScrollElement: () =>
|
|
19537
|
+
getScrollElement: () => tbodyRef.current,
|
|
18765
19538
|
measureElement: typeof window !== "undefined" && navigator.userAgent.indexOf("Firefox") === -1 ? (element) => element.getBoundingClientRect().height : void 0,
|
|
18766
19539
|
overscan: overscan ?? 5,
|
|
18767
19540
|
onChange: (instance, sync) => {
|
|
@@ -18794,6 +19567,7 @@ const DsTableBodyVirtualized = ({ table, tableContainerRef, emptyState, estimate
|
|
|
18794
19567
|
rowVirtualizer.measure();
|
|
18795
19568
|
}, [table.getState()]);
|
|
18796
19569
|
return /* @__PURE__ */ jsx(DsTableBody, {
|
|
19570
|
+
ref: tbodyRef,
|
|
18797
19571
|
rowsMapRef,
|
|
18798
19572
|
rowHeightsMapRef,
|
|
18799
19573
|
rowVirtualizer,
|
|
@@ -18802,12 +19576,13 @@ const DsTableBodyVirtualized = ({ table, tableContainerRef, emptyState, estimate
|
|
|
18802
19576
|
rowSelection
|
|
18803
19577
|
});
|
|
18804
19578
|
};
|
|
18805
|
-
function DsTableBody({ rowVirtualizer, rowsMapRef, rowHeightsMapRef, rowsAndExpandedRowContent, emptyState, rowSelection }) {
|
|
19579
|
+
function DsTableBody({ ref, rowVirtualizer, rowsMapRef, rowHeightsMapRef, rowsAndExpandedRowContent, emptyState, rowSelection }) {
|
|
18806
19580
|
const virtualRows = rowVirtualizer.getVirtualItems();
|
|
18807
|
-
|
|
19581
|
+
const totalSize = rowVirtualizer.getTotalSize();
|
|
19582
|
+
return /* @__PURE__ */ jsxs(TableBody, {
|
|
19583
|
+
ref,
|
|
18808
19584
|
className: ds_table_body_virtualized_module_default.body,
|
|
18809
|
-
|
|
18810
|
-
children: virtualRows.length > 0 ? virtualRows.map((virtualRow) => {
|
|
19585
|
+
children: [virtualRows.length > 0 ? virtualRows.map((virtualRow) => {
|
|
18811
19586
|
const row = rowsAndExpandedRowContent[virtualRow.index];
|
|
18812
19587
|
if (!row) return null;
|
|
18813
19588
|
return /* @__PURE__ */ jsx(DsTableRowVirtualized, {
|
|
@@ -18822,7 +19597,12 @@ function DsTableBody({ rowVirtualizer, rowsMapRef, rowHeightsMapRef, rowsAndExpa
|
|
|
18822
19597
|
}) : /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, {
|
|
18823
19598
|
className: ds_table_body_virtualized_module_default.emptyState,
|
|
18824
19599
|
children: emptyState || "No results."
|
|
18825
|
-
}) })
|
|
19600
|
+
}) }), /* @__PURE__ */ jsx("tr", {
|
|
19601
|
+
"aria-hidden": true,
|
|
19602
|
+
className: ds_table_body_virtualized_module_default.sentinel,
|
|
19603
|
+
style: { top: `${totalSize.toString()}px` },
|
|
19604
|
+
children: /* @__PURE__ */ jsx("td", {})
|
|
19605
|
+
})]
|
|
18826
19606
|
});
|
|
18827
19607
|
}
|
|
18828
19608
|
//#endregion
|
|
@@ -18835,7 +19615,7 @@ const ROW_SIZE_HEIGHT_MAP = {
|
|
|
18835
19615
|
/**
|
|
18836
19616
|
* Design system Table component
|
|
18837
19617
|
*/
|
|
18838
|
-
const DsTable = ({ ref, columns: columnsProp, data: tableData, virtualized = false, virtualizedOptions, className, onRowClick, emptyState, stickyHeader = true, bordered = true, fullWidth = true, rowSize = "medium", expandable = false, renderExpandedRow, selectable = false, showSelectAllCheckbox = true, onSelectionChange, onSortingChange, onScroll, actions = [], onRowDoubleClick, primaryRowActions = [], secondaryRowActions, reorderable = false, onOrderChange, columnFilters: externalColumnFilters, onColumnFiltersChange, columnVisibility: externalColumnVisibility, onColumnVisibilityChange, activeRowId, infiniteScroll }) => {
|
|
19618
|
+
const DsTable = ({ ref, columns: columnsProp, data: tableData, virtualized = false, virtualizedOptions, className, onRowClick, emptyState, stickyHeader = true, bordered = true, fullWidth = true, rowSize = "medium", expandable = false, renderExpandedRow, selectable = false, showSelectAllCheckbox = true, onSelectionChange, onSortingChange, onScroll, actions = [], onRowDoubleClick, primaryRowActions = [], secondaryRowActions, reorderable = false, onOrderChange, columnFilters: externalColumnFilters, onColumnFiltersChange, columnVisibility: externalColumnVisibility, onColumnVisibilityChange, activeRowId, infiniteScroll, onCellEdit, onCellValidate }) => {
|
|
18839
19619
|
const [data, setData] = React$1.useState(tableData);
|
|
18840
19620
|
const [sorting, setSorting] = React$1.useState([]);
|
|
18841
19621
|
const [internalColumnFilters, setInternalColumnFilters] = React$1.useState([]);
|
|
@@ -19001,18 +19781,19 @@ const DsTable = ({ ref, columns: columnsProp, data: tableData, virtualized = fal
|
|
|
19001
19781
|
secondaryRowActions,
|
|
19002
19782
|
renderExpandedRow,
|
|
19003
19783
|
virtualized,
|
|
19004
|
-
activeRowId
|
|
19784
|
+
activeRowId,
|
|
19785
|
+
onCellEdit,
|
|
19786
|
+
...useEditingState(onCellEdit, onCellValidate)
|
|
19005
19787
|
};
|
|
19006
|
-
return /* @__PURE__ */
|
|
19788
|
+
return /* @__PURE__ */ jsx(DsTableContext.Provider, {
|
|
19007
19789
|
value: contextValue,
|
|
19008
|
-
children:
|
|
19790
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
19009
19791
|
ref: tableContainerRef,
|
|
19010
19792
|
className: classNames(ds_table_module_default.container, !virtualized && ds_table_module_default.dataTableContainer, virtualized && ds_table_module_default.virtualizedContainer, isBulkActionsVisible && ds_table_module_default.bulkActionsVisible, className),
|
|
19011
|
-
children: /* @__PURE__ */ jsx(DragWrapper, { children: /* @__PURE__ */ jsxs(Table$1, {
|
|
19012
|
-
className: classNames(fullWidth && ds_table_module_default.fullWidth, !bordered && ds_table_module_default.tableNoBorder
|
|
19793
|
+
children: [/* @__PURE__ */ jsx(DragWrapper, { children: /* @__PURE__ */ jsxs(Table$1, {
|
|
19794
|
+
className: classNames(fullWidth && ds_table_module_default.fullWidth, !bordered && ds_table_module_default.tableNoBorder),
|
|
19013
19795
|
children: [/* @__PURE__ */ jsx(DsTableHeader, { table }), virtualized ? /* @__PURE__ */ jsx(DsTableBodyVirtualized, {
|
|
19014
19796
|
table,
|
|
19015
|
-
tableContainerRef,
|
|
19016
19797
|
emptyState,
|
|
19017
19798
|
estimateSize: virtualizedOptions?.estimateSize || ROW_SIZE_HEIGHT_MAP[rowSize],
|
|
19018
19799
|
overscan: virtualizedOptions?.overscan,
|
|
@@ -19023,15 +19804,175 @@ const DsTable = ({ ref, columns: columnsProp, data: tableData, virtualized = fal
|
|
|
19023
19804
|
row,
|
|
19024
19805
|
isSelected: !!rowSelection[row.id]
|
|
19025
19806
|
}, row.id)) : renderEmptyState() }) })]
|
|
19026
|
-
}) })
|
|
19027
|
-
|
|
19028
|
-
|
|
19029
|
-
|
|
19030
|
-
|
|
19031
|
-
|
|
19032
|
-
|
|
19033
|
-
|
|
19034
|
-
})
|
|
19807
|
+
}) }), selectable && actions.length > 0 && /* @__PURE__ */ jsx(DsTableBulkActions, {
|
|
19808
|
+
numSelectedRows: selectedRows.length,
|
|
19809
|
+
actions: actions.map((action) => ({
|
|
19810
|
+
...action,
|
|
19811
|
+
onClick: () => action.onClick(selectedRows)
|
|
19812
|
+
})),
|
|
19813
|
+
onClearSelection: table.resetRowSelection
|
|
19814
|
+
})]
|
|
19815
|
+
})
|
|
19816
|
+
});
|
|
19817
|
+
};
|
|
19818
|
+
//#endregion
|
|
19819
|
+
//#region src/components/ds-table/hooks/use-cell-editor.ts
|
|
19820
|
+
/**
|
|
19821
|
+
* Wires a TanStack Table `editCell` renderer into DsTable's hoisted editing state.
|
|
19822
|
+
* Only mount this hook inside `ColumnDef.editCell` — the table cell layer handles
|
|
19823
|
+
* entering edit mode on double-click.
|
|
19824
|
+
*/
|
|
19825
|
+
const useCellEditor = ({ cellContext }) => {
|
|
19826
|
+
const ctx = useDsTableContext();
|
|
19827
|
+
const { row, column, getValue } = cellContext;
|
|
19828
|
+
const isActiveCell = ctx.editing !== null && ctx.editing.cell.row.id === row.id && ctx.editing.cell.column.id === column.id;
|
|
19829
|
+
const value = isActiveCell && ctx.editing ? ctx.editing.draftValue : getValue();
|
|
19830
|
+
const error = isActiveCell && ctx.editing ? ctx.editing.error : null;
|
|
19831
|
+
const setValue = (next) => {
|
|
19832
|
+
ctx.setDraft(next);
|
|
19833
|
+
};
|
|
19834
|
+
const commit = (overrideValue) => {
|
|
19835
|
+
ctx.commit(overrideValue);
|
|
19836
|
+
};
|
|
19837
|
+
const cancel = () => {
|
|
19838
|
+
ctx.cancel();
|
|
19839
|
+
};
|
|
19840
|
+
const stopPropagation = (event) => {
|
|
19841
|
+
event.stopPropagation();
|
|
19842
|
+
};
|
|
19843
|
+
return {
|
|
19844
|
+
value,
|
|
19845
|
+
error,
|
|
19846
|
+
setValue,
|
|
19847
|
+
commit,
|
|
19848
|
+
cancel,
|
|
19849
|
+
stopPropagation,
|
|
19850
|
+
editorContainerProps: {
|
|
19851
|
+
onKeyDown: () => {},
|
|
19852
|
+
onClick: stopPropagation,
|
|
19853
|
+
onDoubleClick: stopPropagation
|
|
19854
|
+
}
|
|
19855
|
+
};
|
|
19856
|
+
};
|
|
19857
|
+
//#endregion
|
|
19858
|
+
//#region src/components/ds-table/components/edit/cell-editors/cell-editors.module.scss
|
|
19859
|
+
var cell_editors_module_default = { "fullWidth": "m8hPaq_fullWidth" };
|
|
19860
|
+
//#endregion
|
|
19861
|
+
//#region src/components/ds-table/components/edit/cell-editors/table-edit-form-control.tsx
|
|
19862
|
+
const TableEditFormControl = ({ cellContext, error, children }) => {
|
|
19863
|
+
return /* @__PURE__ */ jsx(DsFormControl, {
|
|
19864
|
+
hideLabel: true,
|
|
19865
|
+
label: String(cellContext.column.columnDef.header ?? cellContext.column.id),
|
|
19866
|
+
className: cell_editors_module_default.fullWidth,
|
|
19867
|
+
status: error ? "error" : void 0,
|
|
19868
|
+
message: error ?? void 0,
|
|
19869
|
+
messageIcon: "cancel",
|
|
19870
|
+
children
|
|
19871
|
+
});
|
|
19872
|
+
};
|
|
19873
|
+
//#endregion
|
|
19874
|
+
//#region src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-text.tsx
|
|
19875
|
+
/** Text input editor for table cells. Render via `ColumnDef.editCell`. */
|
|
19876
|
+
const DsTableEditCellText = ({ cellContext, placeholder, maxLength }) => {
|
|
19877
|
+
const { value, setValue, error } = useCellEditor({ cellContext });
|
|
19878
|
+
const inputRef = useRef(null);
|
|
19879
|
+
useEffect(() => {
|
|
19880
|
+
const input = inputRef.current;
|
|
19881
|
+
if (!input) return;
|
|
19882
|
+
input.focus();
|
|
19883
|
+
input.select();
|
|
19884
|
+
}, []);
|
|
19885
|
+
return /* @__PURE__ */ jsx(TableEditFormControl, {
|
|
19886
|
+
cellContext,
|
|
19887
|
+
error,
|
|
19888
|
+
children: /* @__PURE__ */ jsx(DsFormControl.TextInput, {
|
|
19889
|
+
ref: inputRef,
|
|
19890
|
+
className: cell_editors_module_default.fullWidth,
|
|
19891
|
+
value,
|
|
19892
|
+
placeholder,
|
|
19893
|
+
maxLength,
|
|
19894
|
+
onValueChange: setValue,
|
|
19895
|
+
slots: error ? { endAdornment: /* @__PURE__ */ jsx(DsIcon, {
|
|
19896
|
+
icon: "error",
|
|
19897
|
+
size: "tiny"
|
|
19898
|
+
}) } : void 0
|
|
19899
|
+
})
|
|
19900
|
+
});
|
|
19901
|
+
};
|
|
19902
|
+
//#endregion
|
|
19903
|
+
//#region src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-number.tsx
|
|
19904
|
+
/** Number input editor for table cells. Render via `ColumnDef.editCell`. */
|
|
19905
|
+
const DsTableEditCellNumber = ({ cellContext, min, max, step }) => {
|
|
19906
|
+
const { value, setValue, error } = useCellEditor({ cellContext });
|
|
19907
|
+
const inputRef = useRef(null);
|
|
19908
|
+
useEffect(() => {
|
|
19909
|
+
const input = inputRef.current;
|
|
19910
|
+
if (!input) return;
|
|
19911
|
+
input.focus();
|
|
19912
|
+
input.select();
|
|
19913
|
+
}, []);
|
|
19914
|
+
return /* @__PURE__ */ jsx(TableEditFormControl, {
|
|
19915
|
+
cellContext,
|
|
19916
|
+
error,
|
|
19917
|
+
children: /* @__PURE__ */ jsx(DsFormControl.NumberInput, {
|
|
19918
|
+
ref: inputRef,
|
|
19919
|
+
className: cell_editors_module_default.fullWidth,
|
|
19920
|
+
value,
|
|
19921
|
+
min,
|
|
19922
|
+
max,
|
|
19923
|
+
step,
|
|
19924
|
+
onValueChange: setValue
|
|
19925
|
+
})
|
|
19926
|
+
});
|
|
19927
|
+
};
|
|
19928
|
+
//#endregion
|
|
19929
|
+
//#region src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-select.tsx
|
|
19930
|
+
/** Select editor for table cells. Render via `ColumnDef.editCell`. */
|
|
19931
|
+
const DsTableEditCellSelect = ({ cellContext, options, placeholder }) => {
|
|
19932
|
+
const { value, setValue, error } = useCellEditor({ cellContext });
|
|
19933
|
+
return /* @__PURE__ */ jsx(TableEditFormControl, {
|
|
19934
|
+
cellContext,
|
|
19935
|
+
error,
|
|
19936
|
+
children: /* @__PURE__ */ jsx(DsFormControl.Select, {
|
|
19937
|
+
className: cell_editors_module_default.fullWidth,
|
|
19938
|
+
value,
|
|
19939
|
+
options,
|
|
19940
|
+
placeholder,
|
|
19941
|
+
onValueChange: setValue
|
|
19942
|
+
})
|
|
19943
|
+
});
|
|
19944
|
+
};
|
|
19945
|
+
//#endregion
|
|
19946
|
+
//#region src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-date.tsx
|
|
19947
|
+
/** Date picker editor for table cells. Render via `ColumnDef.editCell`. */
|
|
19948
|
+
const DsTableEditCellDate = ({ cellContext, min, max, placeholder }) => {
|
|
19949
|
+
const { value, setValue, error } = useCellEditor({ cellContext });
|
|
19950
|
+
return /* @__PURE__ */ jsx(TableEditFormControl, {
|
|
19951
|
+
cellContext,
|
|
19952
|
+
error,
|
|
19953
|
+
children: /* @__PURE__ */ jsx(DsFormControl.DatePicker, {
|
|
19954
|
+
className: cell_editors_module_default.fullWidth,
|
|
19955
|
+
value,
|
|
19956
|
+
min,
|
|
19957
|
+
max,
|
|
19958
|
+
placeholder,
|
|
19959
|
+
onChange: setValue,
|
|
19960
|
+
slotProps: error ? { input: { slots: { endAdornment: /* @__PURE__ */ jsx(DsIcon, {
|
|
19961
|
+
icon: "error",
|
|
19962
|
+
size: "tiny"
|
|
19963
|
+
}) } } } : void 0
|
|
19964
|
+
})
|
|
19965
|
+
});
|
|
19966
|
+
};
|
|
19967
|
+
//#endregion
|
|
19968
|
+
//#region src/components/ds-table/components/edit/cell-editors/ds-table-edit-cell-checkbox.tsx
|
|
19969
|
+
/** Checkbox editor for table cells. Render via `ColumnDef.editCell`. */
|
|
19970
|
+
const DsTableEditCellCheckbox = ({ cellContext, disabled }) => {
|
|
19971
|
+
const { value, setValue } = useCellEditor({ cellContext });
|
|
19972
|
+
return /* @__PURE__ */ jsx(DsCheckbox, {
|
|
19973
|
+
checked: value,
|
|
19974
|
+
disabled,
|
|
19975
|
+
onCheckedChange: (checked) => setValue(checked === true)
|
|
19035
19976
|
});
|
|
19036
19977
|
};
|
|
19037
19978
|
//#endregion
|
|
@@ -19994,19 +20935,37 @@ DsVerticalTabs.List = DsVerticalTabsList;
|
|
|
19994
20935
|
DsVerticalTabs.Tab = DsVerticalTabsTab;
|
|
19995
20936
|
DsVerticalTabs.Content = DsVerticalTabsContent;
|
|
19996
20937
|
//#endregion
|
|
19997
|
-
//#region src/components/ds-workspace/ds-workspace.module.scss
|
|
19998
|
-
var
|
|
19999
|
-
"
|
|
20000
|
-
"
|
|
20001
|
-
"
|
|
20002
|
-
"
|
|
20003
|
-
"
|
|
20004
|
-
"
|
|
20938
|
+
//#region src/components/ds-workspace-layout/ds-workspace-layout.module.scss
|
|
20939
|
+
var ds_workspace_layout_module_default = {
|
|
20940
|
+
"body": "pc7Upa_body",
|
|
20941
|
+
"content": "pc7Upa_content",
|
|
20942
|
+
"contentWithLeftPanel": "pc7Upa_contentWithLeftPanel",
|
|
20943
|
+
"fillParent": "pc7Upa_fillParent",
|
|
20944
|
+
"footer": "pc7Upa_footer",
|
|
20945
|
+
"header": "pc7Upa_header",
|
|
20946
|
+
"leftPanel": "pc7Upa_leftPanel",
|
|
20947
|
+
"root": "pc7Upa_root",
|
|
20948
|
+
"sideMenu": "pc7Upa_sideMenu",
|
|
20949
|
+
"sideMenuPanel": "pc7Upa_sideMenuPanel",
|
|
20950
|
+
"sideMenuPinButton": "pc7Upa_sideMenuPinButton",
|
|
20951
|
+
"subHeader": "pc7Upa_subHeader"
|
|
20952
|
+
};
|
|
20953
|
+
//#endregion
|
|
20954
|
+
//#region src/components/ds-workspace-layout/ds-workspace-layout.context.ts
|
|
20955
|
+
const DsWorkspaceLayoutContext = createContext(null);
|
|
20956
|
+
const useDsWorkspaceLayoutContext = () => {
|
|
20957
|
+
const context = useContext(DsWorkspaceLayoutContext);
|
|
20958
|
+
if (!context) throw new Error("DsWorkspaceLayout compound components must be used within DsWorkspaceLayout");
|
|
20959
|
+
return context;
|
|
20005
20960
|
};
|
|
20006
20961
|
//#endregion
|
|
20007
|
-
//#region src/components/ds-workspace/ds-workspace.tsx
|
|
20008
|
-
const
|
|
20009
|
-
|
|
20962
|
+
//#region src/components/ds-workspace-layout/ds-workspace-layout.tsx
|
|
20963
|
+
const DEFAULT_LOCALE = Object.freeze({
|
|
20964
|
+
pinButtonLabel: "Pin side menu",
|
|
20965
|
+
unpinButtonLabel: "Unpin side menu"
|
|
20966
|
+
});
|
|
20967
|
+
const DsWorkspaceLayout = (t0) => {
|
|
20968
|
+
const $ = c(17);
|
|
20010
20969
|
let className;
|
|
20011
20970
|
let rest;
|
|
20012
20971
|
let t1;
|
|
@@ -20022,24 +20981,58 @@ const DsWorkspace = (t0) => {
|
|
|
20022
20981
|
t1 = $[3];
|
|
20023
20982
|
}
|
|
20024
20983
|
const fillParent = t1 === void 0 ? false : t1;
|
|
20984
|
+
const [hasLeftSidePanel, setHasLeftSidePanel] = useState(false);
|
|
20025
20985
|
let t2;
|
|
20026
|
-
if ($[4]
|
|
20027
|
-
t2 =
|
|
20028
|
-
$[4] =
|
|
20029
|
-
|
|
20030
|
-
|
|
20031
|
-
} else t2 = $[6];
|
|
20986
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
20987
|
+
t2 = () => setHasLeftSidePanel(true);
|
|
20988
|
+
$[4] = t2;
|
|
20989
|
+
} else t2 = $[4];
|
|
20990
|
+
const registerLeftSidePanel = t2;
|
|
20032
20991
|
let t3;
|
|
20033
|
-
if ($[
|
|
20034
|
-
t3 =
|
|
20992
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
20993
|
+
t3 = () => setHasLeftSidePanel(false);
|
|
20994
|
+
$[5] = t3;
|
|
20995
|
+
} else t3 = $[5];
|
|
20996
|
+
const unregisterLeftSidePanel = t3;
|
|
20997
|
+
let t4;
|
|
20998
|
+
if ($[6] !== hasLeftSidePanel) {
|
|
20999
|
+
t4 = {
|
|
21000
|
+
hasLeftSidePanel,
|
|
21001
|
+
registerLeftSidePanel,
|
|
21002
|
+
unregisterLeftSidePanel
|
|
21003
|
+
};
|
|
21004
|
+
$[6] = hasLeftSidePanel;
|
|
21005
|
+
$[7] = t4;
|
|
21006
|
+
} else t4 = $[7];
|
|
21007
|
+
const contextValue = t4;
|
|
21008
|
+
let t5;
|
|
21009
|
+
if ($[8] !== className || $[9] !== fillParent) {
|
|
21010
|
+
t5 = classNames(ds_workspace_layout_module_default.root, { [ds_workspace_layout_module_default.fillParent]: fillParent }, className);
|
|
21011
|
+
$[8] = className;
|
|
21012
|
+
$[9] = fillParent;
|
|
21013
|
+
$[10] = t5;
|
|
21014
|
+
} else t5 = $[10];
|
|
21015
|
+
let t6;
|
|
21016
|
+
if ($[11] !== rest || $[12] !== t5) {
|
|
21017
|
+
t6 = /* @__PURE__ */ jsx("div", {
|
|
20035
21018
|
...rest,
|
|
20036
|
-
className:
|
|
21019
|
+
className: t5
|
|
20037
21020
|
});
|
|
20038
|
-
$[
|
|
20039
|
-
$[
|
|
20040
|
-
$[
|
|
20041
|
-
} else
|
|
20042
|
-
|
|
21021
|
+
$[11] = rest;
|
|
21022
|
+
$[12] = t5;
|
|
21023
|
+
$[13] = t6;
|
|
21024
|
+
} else t6 = $[13];
|
|
21025
|
+
let t7;
|
|
21026
|
+
if ($[14] !== contextValue || $[15] !== t6) {
|
|
21027
|
+
t7 = /* @__PURE__ */ jsx(DsWorkspaceLayoutContext.Provider, {
|
|
21028
|
+
value: contextValue,
|
|
21029
|
+
children: t6
|
|
21030
|
+
});
|
|
21031
|
+
$[14] = contextValue;
|
|
21032
|
+
$[15] = t6;
|
|
21033
|
+
$[16] = t7;
|
|
21034
|
+
} else t7 = $[16];
|
|
21035
|
+
return t7;
|
|
20043
21036
|
};
|
|
20044
21037
|
const Header = (t0) => {
|
|
20045
21038
|
const $ = c(8);
|
|
@@ -20056,7 +21049,7 @@ const Header = (t0) => {
|
|
|
20056
21049
|
}
|
|
20057
21050
|
let t1;
|
|
20058
21051
|
if ($[3] !== className) {
|
|
20059
|
-
t1 = classNames(
|
|
21052
|
+
t1 = classNames(ds_workspace_layout_module_default.header, className);
|
|
20060
21053
|
$[3] = className;
|
|
20061
21054
|
$[4] = t1;
|
|
20062
21055
|
} else t1 = $[4];
|
|
@@ -20087,7 +21080,7 @@ const SubHeader = (t0) => {
|
|
|
20087
21080
|
}
|
|
20088
21081
|
let t1;
|
|
20089
21082
|
if ($[3] !== className) {
|
|
20090
|
-
t1 = classNames(
|
|
21083
|
+
t1 = classNames(ds_workspace_layout_module_default.subHeader, className);
|
|
20091
21084
|
$[3] = className;
|
|
20092
21085
|
$[4] = t1;
|
|
20093
21086
|
} else t1 = $[4];
|
|
@@ -20103,8 +21096,41 @@ const SubHeader = (t0) => {
|
|
|
20103
21096
|
} else t2 = $[7];
|
|
20104
21097
|
return t2;
|
|
20105
21098
|
};
|
|
20106
|
-
/**
|
|
21099
|
+
/** Content area: column layout, 24px vertical margins, 16px gap, 40px horizontal margins (24px when LeftPanel is mounted). */
|
|
20107
21100
|
const Content = (t0) => {
|
|
21101
|
+
const $ = c(9);
|
|
21102
|
+
let className;
|
|
21103
|
+
let rest;
|
|
21104
|
+
if ($[0] !== t0) {
|
|
21105
|
+
({className, ...rest} = t0);
|
|
21106
|
+
$[0] = t0;
|
|
21107
|
+
$[1] = className;
|
|
21108
|
+
$[2] = rest;
|
|
21109
|
+
} else {
|
|
21110
|
+
className = $[1];
|
|
21111
|
+
rest = $[2];
|
|
21112
|
+
}
|
|
21113
|
+
const { hasLeftSidePanel } = useDsWorkspaceLayoutContext();
|
|
21114
|
+
let t1;
|
|
21115
|
+
if ($[3] !== className || $[4] !== hasLeftSidePanel) {
|
|
21116
|
+
t1 = classNames(ds_workspace_layout_module_default.content, { [ds_workspace_layout_module_default.contentWithLeftPanel]: hasLeftSidePanel }, className);
|
|
21117
|
+
$[3] = className;
|
|
21118
|
+
$[4] = hasLeftSidePanel;
|
|
21119
|
+
$[5] = t1;
|
|
21120
|
+
} else t1 = $[5];
|
|
21121
|
+
let t2;
|
|
21122
|
+
if ($[6] !== rest || $[7] !== t1) {
|
|
21123
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
21124
|
+
...rest,
|
|
21125
|
+
className: t1
|
|
21126
|
+
});
|
|
21127
|
+
$[6] = rest;
|
|
21128
|
+
$[7] = t1;
|
|
21129
|
+
$[8] = t2;
|
|
21130
|
+
} else t2 = $[8];
|
|
21131
|
+
return t2;
|
|
21132
|
+
};
|
|
21133
|
+
const Footer = (t0) => {
|
|
20108
21134
|
const $ = c(8);
|
|
20109
21135
|
let className;
|
|
20110
21136
|
let rest;
|
|
@@ -20119,13 +21145,13 @@ const Content = (t0) => {
|
|
|
20119
21145
|
}
|
|
20120
21146
|
let t1;
|
|
20121
21147
|
if ($[3] !== className) {
|
|
20122
|
-
t1 = classNames(
|
|
21148
|
+
t1 = classNames(ds_workspace_layout_module_default.footer, className);
|
|
20123
21149
|
$[3] = className;
|
|
20124
21150
|
$[4] = t1;
|
|
20125
21151
|
} else t1 = $[4];
|
|
20126
21152
|
let t2;
|
|
20127
21153
|
if ($[5] !== rest || $[6] !== t1) {
|
|
20128
|
-
t2 = /* @__PURE__ */ jsx("
|
|
21154
|
+
t2 = /* @__PURE__ */ jsx("footer", {
|
|
20129
21155
|
...rest,
|
|
20130
21156
|
className: t1
|
|
20131
21157
|
});
|
|
@@ -20135,7 +21161,7 @@ const Content = (t0) => {
|
|
|
20135
21161
|
} else t2 = $[7];
|
|
20136
21162
|
return t2;
|
|
20137
21163
|
};
|
|
20138
|
-
const
|
|
21164
|
+
const Body = (t0) => {
|
|
20139
21165
|
const $ = c(8);
|
|
20140
21166
|
let className;
|
|
20141
21167
|
let rest;
|
|
@@ -20148,15 +21174,16 @@ const Footer = (t0) => {
|
|
|
20148
21174
|
className = $[1];
|
|
20149
21175
|
rest = $[2];
|
|
20150
21176
|
}
|
|
21177
|
+
useDsWorkspaceLayoutContext();
|
|
20151
21178
|
let t1;
|
|
20152
21179
|
if ($[3] !== className) {
|
|
20153
|
-
t1 = classNames(
|
|
21180
|
+
t1 = classNames(ds_workspace_layout_module_default.body, className);
|
|
20154
21181
|
$[3] = className;
|
|
20155
21182
|
$[4] = t1;
|
|
20156
21183
|
} else t1 = $[4];
|
|
20157
21184
|
let t2;
|
|
20158
21185
|
if ($[5] !== rest || $[6] !== t1) {
|
|
20159
|
-
t2 = /* @__PURE__ */ jsx("
|
|
21186
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
20160
21187
|
...rest,
|
|
20161
21188
|
className: t1
|
|
20162
21189
|
});
|
|
@@ -20166,11 +21193,171 @@ const Footer = (t0) => {
|
|
|
20166
21193
|
} else t2 = $[7];
|
|
20167
21194
|
return t2;
|
|
20168
21195
|
};
|
|
20169
|
-
|
|
20170
|
-
|
|
20171
|
-
|
|
20172
|
-
|
|
21196
|
+
const SideMenu = (t0) => {
|
|
21197
|
+
const $ = c(28);
|
|
21198
|
+
let children;
|
|
21199
|
+
let className;
|
|
21200
|
+
let locale;
|
|
21201
|
+
let onPinnedChange;
|
|
21202
|
+
let rest;
|
|
21203
|
+
let t1;
|
|
21204
|
+
if ($[0] !== t0) {
|
|
21205
|
+
({className, pinned: t1, onPinnedChange, locale, children, ...rest} = t0);
|
|
21206
|
+
$[0] = t0;
|
|
21207
|
+
$[1] = children;
|
|
21208
|
+
$[2] = className;
|
|
21209
|
+
$[3] = locale;
|
|
21210
|
+
$[4] = onPinnedChange;
|
|
21211
|
+
$[5] = rest;
|
|
21212
|
+
$[6] = t1;
|
|
21213
|
+
} else {
|
|
21214
|
+
children = $[1];
|
|
21215
|
+
className = $[2];
|
|
21216
|
+
locale = $[3];
|
|
21217
|
+
onPinnedChange = $[4];
|
|
21218
|
+
rest = $[5];
|
|
21219
|
+
t1 = $[6];
|
|
21220
|
+
}
|
|
21221
|
+
const pinned = t1 === void 0 ? false : t1;
|
|
21222
|
+
useDsWorkspaceLayoutContext();
|
|
21223
|
+
const [isHovering, setIsHovering] = useState(false);
|
|
21224
|
+
const isExpanded = pinned || isHovering;
|
|
21225
|
+
const ariaLabel = pinned ? locale?.unpinButtonLabel ?? DEFAULT_LOCALE.unpinButtonLabel : locale?.pinButtonLabel ?? DEFAULT_LOCALE.pinButtonLabel;
|
|
21226
|
+
let t2;
|
|
21227
|
+
if ($[7] !== className) {
|
|
21228
|
+
t2 = classNames(ds_workspace_layout_module_default.sideMenu, className);
|
|
21229
|
+
$[7] = className;
|
|
21230
|
+
$[8] = t2;
|
|
21231
|
+
} else t2 = $[8];
|
|
21232
|
+
let t3;
|
|
21233
|
+
if ($[9] !== pinned) {
|
|
21234
|
+
t3 = pinned ? { "data-pinned": "" } : {};
|
|
21235
|
+
$[9] = pinned;
|
|
21236
|
+
$[10] = t3;
|
|
21237
|
+
} else t3 = $[10];
|
|
21238
|
+
let t4;
|
|
21239
|
+
if ($[11] !== isExpanded) {
|
|
21240
|
+
t4 = isExpanded ? { "data-expanded": "" } : {};
|
|
21241
|
+
$[11] = isExpanded;
|
|
21242
|
+
$[12] = t4;
|
|
21243
|
+
} else t4 = $[12];
|
|
21244
|
+
let t5;
|
|
21245
|
+
let t6;
|
|
21246
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
21247
|
+
t5 = () => setIsHovering(true);
|
|
21248
|
+
t6 = () => setIsHovering(false);
|
|
21249
|
+
$[13] = t5;
|
|
21250
|
+
$[14] = t6;
|
|
21251
|
+
} else {
|
|
21252
|
+
t5 = $[13];
|
|
21253
|
+
t6 = $[14];
|
|
21254
|
+
}
|
|
21255
|
+
let t7;
|
|
21256
|
+
if ($[15] !== ariaLabel || $[16] !== onPinnedChange || $[17] !== pinned) {
|
|
21257
|
+
t7 = onPinnedChange ? /* @__PURE__ */ jsx("button", {
|
|
21258
|
+
type: "button",
|
|
21259
|
+
className: ds_workspace_layout_module_default.sideMenuPinButton,
|
|
21260
|
+
onClick: () => onPinnedChange(!pinned),
|
|
21261
|
+
"aria-label": ariaLabel,
|
|
21262
|
+
"aria-pressed": pinned,
|
|
21263
|
+
children: /* @__PURE__ */ jsx(DsIcon, {
|
|
21264
|
+
icon: "keep",
|
|
21265
|
+
size: "small",
|
|
21266
|
+
filled: pinned
|
|
21267
|
+
})
|
|
21268
|
+
}) : null;
|
|
21269
|
+
$[15] = ariaLabel;
|
|
21270
|
+
$[16] = onPinnedChange;
|
|
21271
|
+
$[17] = pinned;
|
|
21272
|
+
$[18] = t7;
|
|
21273
|
+
} else t7 = $[18];
|
|
21274
|
+
let t8;
|
|
21275
|
+
if ($[19] !== children || $[20] !== t7) {
|
|
21276
|
+
t8 = /* @__PURE__ */ jsxs("div", {
|
|
21277
|
+
className: ds_workspace_layout_module_default.sideMenuPanel,
|
|
21278
|
+
onMouseEnter: t5,
|
|
21279
|
+
onMouseLeave: t6,
|
|
21280
|
+
children: [t7, children]
|
|
21281
|
+
});
|
|
21282
|
+
$[19] = children;
|
|
21283
|
+
$[20] = t7;
|
|
21284
|
+
$[21] = t8;
|
|
21285
|
+
} else t8 = $[21];
|
|
21286
|
+
let t9;
|
|
21287
|
+
if ($[22] !== rest || $[23] !== t2 || $[24] !== t3 || $[25] !== t4 || $[26] !== t8) {
|
|
21288
|
+
t9 = /* @__PURE__ */ jsx("aside", {
|
|
21289
|
+
...rest,
|
|
21290
|
+
className: t2,
|
|
21291
|
+
...t3,
|
|
21292
|
+
...t4,
|
|
21293
|
+
children: t8
|
|
21294
|
+
});
|
|
21295
|
+
$[22] = rest;
|
|
21296
|
+
$[23] = t2;
|
|
21297
|
+
$[24] = t3;
|
|
21298
|
+
$[25] = t4;
|
|
21299
|
+
$[26] = t8;
|
|
21300
|
+
$[27] = t9;
|
|
21301
|
+
} else t9 = $[27];
|
|
21302
|
+
return t9;
|
|
21303
|
+
};
|
|
21304
|
+
const LeftPanel = (t0) => {
|
|
21305
|
+
const $ = c(12);
|
|
21306
|
+
let className;
|
|
21307
|
+
let rest;
|
|
21308
|
+
if ($[0] !== t0) {
|
|
21309
|
+
({className, ...rest} = t0);
|
|
21310
|
+
$[0] = t0;
|
|
21311
|
+
$[1] = className;
|
|
21312
|
+
$[2] = rest;
|
|
21313
|
+
} else {
|
|
21314
|
+
className = $[1];
|
|
21315
|
+
rest = $[2];
|
|
21316
|
+
}
|
|
21317
|
+
const { registerLeftSidePanel, unregisterLeftSidePanel } = useDsWorkspaceLayoutContext();
|
|
21318
|
+
let t1;
|
|
21319
|
+
let t2;
|
|
21320
|
+
if ($[3] !== registerLeftSidePanel || $[4] !== unregisterLeftSidePanel) {
|
|
21321
|
+
t1 = () => {
|
|
21322
|
+
registerLeftSidePanel();
|
|
21323
|
+
return unregisterLeftSidePanel;
|
|
21324
|
+
};
|
|
21325
|
+
t2 = [registerLeftSidePanel, unregisterLeftSidePanel];
|
|
21326
|
+
$[3] = registerLeftSidePanel;
|
|
21327
|
+
$[4] = unregisterLeftSidePanel;
|
|
21328
|
+
$[5] = t1;
|
|
21329
|
+
$[6] = t2;
|
|
21330
|
+
} else {
|
|
21331
|
+
t1 = $[5];
|
|
21332
|
+
t2 = $[6];
|
|
21333
|
+
}
|
|
21334
|
+
useEffect(t1, t2);
|
|
21335
|
+
let t3;
|
|
21336
|
+
if ($[7] !== className) {
|
|
21337
|
+
t3 = classNames(ds_workspace_layout_module_default.leftPanel, className);
|
|
21338
|
+
$[7] = className;
|
|
21339
|
+
$[8] = t3;
|
|
21340
|
+
} else t3 = $[8];
|
|
21341
|
+
let t4;
|
|
21342
|
+
if ($[9] !== rest || $[10] !== t3) {
|
|
21343
|
+
t4 = /* @__PURE__ */ jsx("aside", {
|
|
21344
|
+
...rest,
|
|
21345
|
+
className: t3
|
|
21346
|
+
});
|
|
21347
|
+
$[9] = rest;
|
|
21348
|
+
$[10] = t3;
|
|
21349
|
+
$[11] = t4;
|
|
21350
|
+
} else t4 = $[11];
|
|
21351
|
+
return t4;
|
|
21352
|
+
};
|
|
21353
|
+
DsWorkspaceLayout.Header = Header;
|
|
21354
|
+
DsWorkspaceLayout.SubHeader = SubHeader;
|
|
21355
|
+
DsWorkspaceLayout.Content = Content;
|
|
21356
|
+
DsWorkspaceLayout.Footer = Footer;
|
|
21357
|
+
DsWorkspaceLayout.Body = Body;
|
|
21358
|
+
DsWorkspaceLayout.SideMenu = SideMenu;
|
|
21359
|
+
DsWorkspaceLayout.LeftPanel = LeftPanel;
|
|
20173
21360
|
//#endregion
|
|
20174
|
-
export { BREAKPOINT_LG, DsAlertBanner, DsAutocomplete, DsAvatar, DsAvatarGroup, DsBreadcrumb, DsButton, DsButtonV3, DsCard, DsCheckbox, DsCheckboxGroup, DsChip, DsChipGroup, DsCommentBubble, DsCommentCard, DsCommentIndicator, DsCommentThread, DsCommentsDrawer, DsConfirmation, DsDateInput, DsDatePicker, DsDateRangePicker, DsDialog, DsDivider, DsDrawer, DsDropdownMenu, DsDropdownMenuLegacy, DsExpandableTextInput, DsFileUpload, DsFilterStatusIcon, DsFormControl, DsGrid, DsGridItem, DsIcon, DsKeyValuePair, DsLoader, DsModal, DsNextStepButton, DsNumberInput, DsPanel, DsPasswordInput, DsPopover, DsProgressArc, DsProgressDonut, DsProgressLinear, DsRadioGroup, DsRadioGroupLegacy, DsSegmentGroup, DsSelect, ds_skeleton_default as DsSkeleton, DsSkeletonCircle, DsSkeletonRect, DsSkeletonText, DsSmartTabs, DsSpinner, DsSplitButton, DsStack, DsStatusBadge, DsStatusBadgeV2, DsStep, DsStepContent, DsStepper, DsSystemStatus, DsTable, DsTabs, DsTag, DsTagFilter, DsTextInput, DsTextarea, DsThreadItem, DsTimePicker, DsToastProvider, DsToggle, DsTooltip, DsTree, DsTypography, DsVerticalTabs,
|
|
21361
|
+
export { BREAKPOINT_LG, DsAlertBanner, DsAutocomplete, DsAvatar, DsAvatarGroup, DsBreadcrumb, DsButton, DsButtonV3, DsCard, DsCatalogLayout, DsCheckbox, DsCheckboxGroup, DsChip, DsChipGroup, DsCommentBubble, DsCommentCard, DsCommentIndicator, DsCommentThread, DsCommentsDrawer, DsConfirmation, DsDateInput, DsDatePicker, DsDateRangePicker, DsDialog, DsDivider, DsDrawer, DsDropdownMenu, DsDropdownMenuLegacy, DsExpandableTextInput, DsFileUpload, DsFilterStatusIcon, DsFormControl, DsGrid, DsGridItem, DsIcon, DsKeyValuePair, DsLoader, DsModal, DsNextStepButton, DsNumberInput, DsPanel, DsPasswordInput, DsPopover, DsProgressArc, DsProgressDonut, DsProgressLinear, DsRadioGroup, DsRadioGroupLegacy, DsSegmentGroup, DsSelect, ds_skeleton_default as DsSkeleton, DsSkeletonCircle, DsSkeletonRect, DsSkeletonText, DsSmartTabs, DsSpinner, DsSplitButton, DsStack, DsStatusBadge, DsStatusBadgeV2, DsStep, DsStepContent, DsStepper, DsSystemStatus, DsTable, DsTableColumnFilterPopover, DsTableEditCellCheckbox, DsTableEditCellDate, DsTableEditCellNumber, DsTableEditCellSelect, DsTableEditCellText, DsTableEditableCell, DsTableEditingCell, DsTabs, DsTag, DsTagFilter, DsTextInput, DsTextarea, DsThreadItem, DsTimePicker, DsToastProvider, DsToggle, DsTooltip, DsTree, DsTypography, DsVerticalTabs, DsWorkspaceLayout, FatalFileUploadError, FileUpload, FileUploadError, RetryableFileUploadError, alertBannerVariants, breakpoints, buttonV3Colors, buttonV3Sizes, buttonV3Variants, cardSizes, checkboxVariants, colors, controlStatuses, createCheckboxFilterAdapter, createDsTreeCollection, createDualRangeFilterAdapter, createFilterAdapter, customIcons, dropdownMenuItemVariants, dsKeyValuePairOrientations, filterStatuses, formatTime, iconColors, iconSizes, iconVariants, isCustomIcon, isResponsiveValue, loaderVariants, progressArcSizes, progressArcVariants, progressDonutSizes, progressDonutVariants, progressLinearSizes, progressLinearVariants, resolveResponsiveValue, skeletonColorVariants, skeletonRadiusVariants, spinnerSizes, splitButtonSizes, statusBadgeV2Phases, statusBadgeV2Sizes, statusBadgeV2Variants, systemStatuses, tagSizes, tagVariants, textInputSizes, useBreakpoint, useCellEditor, useCheckboxSelectAll, useFileUpload, useResponsiveValue, useTableFilters, useToaster, withResponsiveProps };
|
|
20175
21362
|
|
|
20176
21363
|
//# sourceMappingURL=index.js.map
|