@drivenets/design-system 0.12.1 → 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 +15 -0
- package/dist/index.cjs +1097 -308
- package/dist/index.d.cts +1118 -982
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +1118 -982
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1089 -309
- package/dist/index.js.map +1 -1
- package/dist/index.min.css +1 -1
- package/package.json +31 -31
- 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-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 +1 -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
|
|
@@ -5519,7 +5519,7 @@ const Header$4 = (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;
|
|
@@ -5607,7 +5607,7 @@ const Footer$3 = (t0) => {
|
|
|
5607
5607
|
const DsCard = {
|
|
5608
5608
|
Root: Root$3,
|
|
5609
5609
|
Header: Header$4,
|
|
5610
|
-
Body: Body$
|
|
5610
|
+
Body: Body$4,
|
|
5611
5611
|
Footer: Footer$3
|
|
5612
5612
|
};
|
|
5613
5613
|
//#endregion
|
|
@@ -5645,7 +5645,7 @@ const useDsCatalogLayoutContext = () => {
|
|
|
5645
5645
|
};
|
|
5646
5646
|
//#endregion
|
|
5647
5647
|
//#region src/components/ds-catalog-layout/ds-catalog-layout.tsx
|
|
5648
|
-
const DEFAULT_LOCALE = Object.freeze({
|
|
5648
|
+
const DEFAULT_LOCALE$1 = Object.freeze({
|
|
5649
5649
|
pinButtonLabel: "Pin side menu",
|
|
5650
5650
|
unpinButtonLabel: "Unpin side menu"
|
|
5651
5651
|
});
|
|
@@ -5750,7 +5750,7 @@ const Header$3 = (t0) => {
|
|
|
5750
5750
|
} else t2 = $[7];
|
|
5751
5751
|
return t2;
|
|
5752
5752
|
};
|
|
5753
|
-
const Body$
|
|
5753
|
+
const Body$3 = (t0) => {
|
|
5754
5754
|
const $ = c(8);
|
|
5755
5755
|
let className;
|
|
5756
5756
|
let rest;
|
|
@@ -5781,7 +5781,7 @@ const Body$2 = (t0) => {
|
|
|
5781
5781
|
} else t2 = $[7];
|
|
5782
5782
|
return t2;
|
|
5783
5783
|
};
|
|
5784
|
-
const SideMenu = (t0) => {
|
|
5784
|
+
const SideMenu$1 = (t0) => {
|
|
5785
5785
|
const $ = c(32);
|
|
5786
5786
|
let children;
|
|
5787
5787
|
let className;
|
|
@@ -5827,7 +5827,7 @@ const SideMenu = (t0) => {
|
|
|
5827
5827
|
}
|
|
5828
5828
|
useEffect(t2, t3);
|
|
5829
5829
|
const isExpanded = pinned || isHovering;
|
|
5830
|
-
const ariaLabel = pinned ? locale?.unpinButtonLabel ?? DEFAULT_LOCALE.unpinButtonLabel : locale?.pinButtonLabel ?? DEFAULT_LOCALE.pinButtonLabel;
|
|
5830
|
+
const ariaLabel = pinned ? locale?.unpinButtonLabel ?? DEFAULT_LOCALE$1.unpinButtonLabel : locale?.pinButtonLabel ?? DEFAULT_LOCALE$1.pinButtonLabel;
|
|
5831
5831
|
let t4;
|
|
5832
5832
|
if ($[11] !== className) {
|
|
5833
5833
|
t4 = classNames(ds_catalog_layout_module_default.sideMenu, className);
|
|
@@ -6020,8 +6020,8 @@ const ContentHeader = (t0) => {
|
|
|
6020
6020
|
return t6;
|
|
6021
6021
|
};
|
|
6022
6022
|
DsCatalogLayout.Header = Header$3;
|
|
6023
|
-
DsCatalogLayout.Body = Body$
|
|
6024
|
-
DsCatalogLayout.SideMenu = SideMenu;
|
|
6023
|
+
DsCatalogLayout.Body = Body$3;
|
|
6024
|
+
DsCatalogLayout.SideMenu = SideMenu$1;
|
|
6025
6025
|
DsCatalogLayout.Content = Content$1;
|
|
6026
6026
|
DsCatalogLayout.ContentHeader = ContentHeader;
|
|
6027
6027
|
//#endregion
|
|
@@ -8248,6 +8248,78 @@ var ds_drawer_module_default = {
|
|
|
8248
8248
|
"toolbar": "MWmQHa_toolbar"
|
|
8249
8249
|
};
|
|
8250
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
|
|
8251
8323
|
//#region src/components/ds-drawer/ds-drawer.tsx
|
|
8252
8324
|
const DsDrawer = (t0) => {
|
|
8253
8325
|
const $ = c(25);
|
|
@@ -8259,6 +8331,7 @@ const DsDrawer = (t0) => {
|
|
|
8259
8331
|
const closeOnInteractOutside = t5 === void 0 ? false : t5;
|
|
8260
8332
|
const portal = t6 === void 0 ? false : t6;
|
|
8261
8333
|
const resolvedColumns = useResponsiveValue(columns);
|
|
8334
|
+
useArkDialogBodyLockCleanup(open, backdrop);
|
|
8262
8335
|
let t7;
|
|
8263
8336
|
if ($[0] !== onOpenChange) {
|
|
8264
8337
|
t7 = (details) => {
|
|
@@ -8447,7 +8520,7 @@ const Toolbar = (t0) => {
|
|
|
8447
8520
|
} else t2 = $[5];
|
|
8448
8521
|
return t2;
|
|
8449
8522
|
};
|
|
8450
|
-
const Body$
|
|
8523
|
+
const Body$2 = (t0) => {
|
|
8451
8524
|
const $ = c(6);
|
|
8452
8525
|
const { style, className, children } = t0;
|
|
8453
8526
|
let t1;
|
|
@@ -8520,7 +8593,7 @@ DsDrawer.Header = Header$2;
|
|
|
8520
8593
|
DsDrawer.Title = Title$1;
|
|
8521
8594
|
DsDrawer.CloseTrigger = CloseTrigger$1;
|
|
8522
8595
|
DsDrawer.Toolbar = Toolbar;
|
|
8523
|
-
DsDrawer.Body = Body$
|
|
8596
|
+
DsDrawer.Body = Body$2;
|
|
8524
8597
|
DsDrawer.Footer = Footer$2;
|
|
8525
8598
|
DsDrawer.Actions = Actions$1;
|
|
8526
8599
|
//#endregion
|
|
@@ -9068,6 +9141,7 @@ const DsModal = (t0) => {
|
|
|
9068
9141
|
const dividers = t2 === void 0 ? false : t2;
|
|
9069
9142
|
const modal = t3 === void 0 ? true : t3;
|
|
9070
9143
|
const closeOnInteractOutside = t4 === void 0 ? false : t4;
|
|
9144
|
+
useArkDialogBodyLockCleanup(open, modal);
|
|
9071
9145
|
let t5;
|
|
9072
9146
|
if ($[0] !== onOpenChange) {
|
|
9073
9147
|
t5 = (details) => {
|
|
@@ -9214,7 +9288,7 @@ const CloseTrigger = (t0) => {
|
|
|
9214
9288
|
} else t2 = $[3];
|
|
9215
9289
|
return t2;
|
|
9216
9290
|
};
|
|
9217
|
-
const Body = (t0) => {
|
|
9291
|
+
const Body$1 = (t0) => {
|
|
9218
9292
|
const $ = c(6);
|
|
9219
9293
|
const { style, className, children } = t0;
|
|
9220
9294
|
let t1;
|
|
@@ -9286,7 +9360,7 @@ const Actions = (t0) => {
|
|
|
9286
9360
|
DsModal.Header = Header$1;
|
|
9287
9361
|
DsModal.Title = Title;
|
|
9288
9362
|
DsModal.CloseTrigger = CloseTrigger;
|
|
9289
|
-
DsModal.Body = Body;
|
|
9363
|
+
DsModal.Body = Body$1;
|
|
9290
9364
|
DsModal.Footer = Footer$1;
|
|
9291
9365
|
DsModal.Actions = Actions;
|
|
9292
9366
|
//#endregion
|
|
@@ -13130,66 +13204,50 @@ const DsFormControlDescription = (t0) => {
|
|
|
13130
13204
|
return t2;
|
|
13131
13205
|
};
|
|
13132
13206
|
const DsFormControl = (t0) => {
|
|
13133
|
-
const $ = c(
|
|
13134
|
-
const { id, status, label,
|
|
13135
|
-
const
|
|
13136
|
-
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;
|
|
13137
13212
|
const generatedId = useId();
|
|
13138
13213
|
const controlId = id || generatedId;
|
|
13139
|
-
let
|
|
13214
|
+
let t4;
|
|
13140
13215
|
if ($[0] !== controlId) {
|
|
13141
|
-
|
|
13216
|
+
t4 = { controlId };
|
|
13142
13217
|
$[0] = controlId;
|
|
13143
|
-
$[1] =
|
|
13144
|
-
} else
|
|
13145
|
-
const
|
|
13146
|
-
let t5;
|
|
13147
|
-
if ($[2] !== className || $[3] !== t4) {
|
|
13148
|
-
t5 = classNames(ds_form_control_module_default.container, className, t4);
|
|
13149
|
-
$[2] = className;
|
|
13150
|
-
$[3] = t4;
|
|
13151
|
-
$[4] = t5;
|
|
13152
|
-
} else t5 = $[4];
|
|
13218
|
+
$[1] = t4;
|
|
13219
|
+
} else t4 = $[1];
|
|
13220
|
+
const t5 = status && message && ds_form_control_module_default[status];
|
|
13153
13221
|
let t6;
|
|
13154
|
-
if ($[
|
|
13155
|
-
t6 = classNames(ds_form_control_module_default.
|
|
13156
|
-
$[
|
|
13157
|
-
$[
|
|
13158
|
-
|
|
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];
|
|
13159
13228
|
let t7;
|
|
13160
|
-
if ($[
|
|
13161
|
-
t7 = /* @__PURE__ */
|
|
13162
|
-
|
|
13163
|
-
|
|
13164
|
-
|
|
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
|
+
})]
|
|
13165
13240
|
});
|
|
13166
|
-
$[
|
|
13167
|
-
$[
|
|
13168
|
-
$[
|
|
13241
|
+
$[5] = controlId;
|
|
13242
|
+
$[6] = hideLabel;
|
|
13243
|
+
$[7] = label;
|
|
13244
|
+
$[8] = required;
|
|
13245
|
+
$[9] = slots;
|
|
13169
13246
|
$[10] = t7;
|
|
13170
13247
|
} else t7 = $[10];
|
|
13171
13248
|
let t8;
|
|
13172
|
-
if ($[11] !==
|
|
13173
|
-
t8 =
|
|
13174
|
-
className: ds_form_control_module_default.endAdornment,
|
|
13175
|
-
children: slots.endAdornment
|
|
13176
|
-
});
|
|
13177
|
-
$[11] = slots;
|
|
13178
|
-
$[12] = t8;
|
|
13179
|
-
} else t8 = $[12];
|
|
13180
|
-
let t9;
|
|
13181
|
-
if ($[13] !== t7 || $[14] !== t8) {
|
|
13182
|
-
t9 = /* @__PURE__ */ jsxs("div", {
|
|
13183
|
-
className: ds_form_control_module_default.labelContainer,
|
|
13184
|
-
children: [t7, t8]
|
|
13185
|
-
});
|
|
13186
|
-
$[13] = t7;
|
|
13187
|
-
$[14] = t8;
|
|
13188
|
-
$[15] = t9;
|
|
13189
|
-
} else t9 = $[15];
|
|
13190
|
-
let t10;
|
|
13191
|
-
if ($[16] !== message || $[17] !== messageIcon) {
|
|
13192
|
-
t10 = message && /* @__PURE__ */ jsxs("div", {
|
|
13249
|
+
if ($[11] !== message || $[12] !== messageIcon) {
|
|
13250
|
+
t8 = message && /* @__PURE__ */ jsxs("div", {
|
|
13193
13251
|
className: ds_form_control_module_default.message,
|
|
13194
13252
|
children: [/* @__PURE__ */ jsx(DsIcon, {
|
|
13195
13253
|
icon: messageIcon,
|
|
@@ -13197,39 +13255,39 @@ const DsFormControl = (t0) => {
|
|
|
13197
13255
|
filled: true
|
|
13198
13256
|
}), /* @__PURE__ */ jsx("span", { children: message })]
|
|
13199
13257
|
});
|
|
13200
|
-
$[
|
|
13201
|
-
$[
|
|
13202
|
-
$[
|
|
13203
|
-
} else
|
|
13204
|
-
let
|
|
13205
|
-
if ($[
|
|
13206
|
-
|
|
13207
|
-
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,
|
|
13208
13266
|
style,
|
|
13209
13267
|
children: [
|
|
13210
|
-
|
|
13268
|
+
t7,
|
|
13211
13269
|
children,
|
|
13212
|
-
|
|
13270
|
+
t8
|
|
13213
13271
|
]
|
|
13214
13272
|
});
|
|
13215
|
-
$[
|
|
13216
|
-
$[
|
|
13217
|
-
$[
|
|
13218
|
-
$[
|
|
13219
|
-
$[
|
|
13220
|
-
$[
|
|
13221
|
-
} else
|
|
13222
|
-
let
|
|
13223
|
-
if ($[
|
|
13224
|
-
|
|
13225
|
-
value:
|
|
13226
|
-
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
|
|
13227
13285
|
});
|
|
13228
|
-
$[
|
|
13229
|
-
$[
|
|
13230
|
-
$[
|
|
13231
|
-
} else
|
|
13232
|
-
return
|
|
13286
|
+
$[20] = t4;
|
|
13287
|
+
$[21] = t9;
|
|
13288
|
+
$[22] = t10;
|
|
13289
|
+
} else t10 = $[22];
|
|
13290
|
+
return t10;
|
|
13233
13291
|
};
|
|
13234
13292
|
DsFormControl.TextInput = controlify(DsTextInput);
|
|
13235
13293
|
DsFormControl.NumberInput = controlify(DsNumberInput);
|
|
@@ -18107,68 +18165,9 @@ const systemStatuses = [
|
|
|
18107
18165
|
//#endregion
|
|
18108
18166
|
//#region src/components/ds-table/filters/adapters/create-filter-adapter.ts
|
|
18109
18167
|
/**
|
|
18110
|
-
* Base factory
|
|
18111
|
-
*
|
|
18112
|
-
*
|
|
18113
|
-
* Use this when checkbox or dual-range adapters don't fit your requirements.
|
|
18114
|
-
*
|
|
18115
|
-
* ## When to use directly:
|
|
18116
|
-
* - Complex filtering logic (e.g., editor + date range)
|
|
18117
|
-
* - Unique UI that doesn't fit generic patterns
|
|
18118
|
-
* - Combining multiple sub-filters
|
|
18119
|
-
* - Special chip generation requirements
|
|
18120
|
-
*
|
|
18121
|
-
* ## When to use specialized helpers instead:
|
|
18122
|
-
* - **Checkbox filters**: Use `createCheckboxFilterAdapter` for multi-select
|
|
18123
|
-
* - **Range filters**: Use `createDualRangeFilterAdapter` for numeric ranges
|
|
18124
|
-
*
|
|
18125
|
-
* ## Example:
|
|
18126
|
-
* ```typescript
|
|
18127
|
-
* interface MyFilterValue {
|
|
18128
|
-
* users: string[];
|
|
18129
|
-
* dateRange: { from?: Date; to?: Date };
|
|
18130
|
-
* }
|
|
18131
|
-
*
|
|
18132
|
-
* const myFilter = createFilterAdapter<DataType, MyFilterValue>({
|
|
18133
|
-
* id: 'myColumn',
|
|
18134
|
-
* label: 'My Filter',
|
|
18135
|
-
* initialValue: { users: [], dateRange: {} },
|
|
18136
|
-
*
|
|
18137
|
-
* filterFn: (row, columnId, filterValue) => {
|
|
18138
|
-
* // Your custom logic
|
|
18139
|
-
* return matchesUsers && matchesDateRange;
|
|
18140
|
-
* },
|
|
18141
|
-
*
|
|
18142
|
-
* toChips: (value) => {
|
|
18143
|
-
* // Generate chips from your filter value
|
|
18144
|
-
* return chips;
|
|
18145
|
-
* },
|
|
18146
|
-
*
|
|
18147
|
-
* fromChip: (chip, currentValue) => {
|
|
18148
|
-
* // Remove chip's effect from value
|
|
18149
|
-
* return updatedValue;
|
|
18150
|
-
* },
|
|
18151
|
-
*
|
|
18152
|
-
* getActiveFiltersCount: (value) => {
|
|
18153
|
-
* // Count active filters (0 means none active)
|
|
18154
|
-
* return count;
|
|
18155
|
-
* },
|
|
18156
|
-
*
|
|
18157
|
-
* renderFilter: (value, onChange) => (
|
|
18158
|
-
* <YourCustomFilterComponent
|
|
18159
|
-
* value={value}
|
|
18160
|
-
* onChange={onChange}
|
|
18161
|
-
* />
|
|
18162
|
-
* ),
|
|
18163
|
-
* });
|
|
18164
|
-
* ```
|
|
18165
|
-
*
|
|
18166
|
-
* ## Reference Implementation:
|
|
18167
|
-
* See `workflow-filters.config.tsx` for a complete example (lastEditedFilterAdapter).
|
|
18168
|
-
*
|
|
18169
|
-
* ## Note:
|
|
18170
|
-
* Most use cases are covered by `createCheckboxFilterAdapter` or `createDualRangeFilterAdapter`.
|
|
18171
|
-
* 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).
|
|
18172
18171
|
*/
|
|
18173
18172
|
function createFilterAdapter(config) {
|
|
18174
18173
|
return {
|
|
@@ -18185,31 +18184,78 @@ function createFilterAdapter(config) {
|
|
|
18185
18184
|
};
|
|
18186
18185
|
}
|
|
18187
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
|
|
18188
18195
|
//#region src/components/ds-table/filters/components/checkbox-filter/checkbox-filter.tsx
|
|
18189
|
-
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;
|
|
18190
18200
|
const handleCheckedChange = (selected, checked) => {
|
|
18191
18201
|
if (checked) onSelectionChange([...selectedItems, selected]);
|
|
18192
18202
|
else onSelectionChange(selectedItems.filter((item) => item.value !== selected.value));
|
|
18193
18203
|
};
|
|
18194
|
-
|
|
18195
|
-
|
|
18196
|
-
|
|
18197
|
-
|
|
18198
|
-
|
|
18199
|
-
|
|
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
|
+
})]
|
|
18200
18249
|
});
|
|
18201
18250
|
};
|
|
18202
18251
|
//#endregion
|
|
18203
18252
|
//#region src/components/ds-table/filters/adapters/create-checkbox-filter-adapter.tsx
|
|
18204
18253
|
/**
|
|
18205
|
-
*
|
|
18206
|
-
*
|
|
18207
|
-
* Handles multi-select checkbox filtering with inclusion model:
|
|
18208
|
-
* - Empty selection = show all data (no filter active)
|
|
18209
|
-
* - Selected items = show only those items
|
|
18254
|
+
* Multi-select inclusion filter: empty selection shows every row, selected
|
|
18255
|
+
* items show only those rows.
|
|
18210
18256
|
*/
|
|
18211
18257
|
function createCheckboxFilterAdapter(config) {
|
|
18212
|
-
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;
|
|
18213
18259
|
return createFilterAdapter({
|
|
18214
18260
|
id,
|
|
18215
18261
|
label,
|
|
@@ -18241,7 +18287,10 @@ function createCheckboxFilterAdapter(config) {
|
|
|
18241
18287
|
items,
|
|
18242
18288
|
renderer,
|
|
18243
18289
|
selectedItems: value,
|
|
18244
|
-
onSelectionChange: onChange
|
|
18290
|
+
onSelectionChange: onChange,
|
|
18291
|
+
searchable,
|
|
18292
|
+
selectAll,
|
|
18293
|
+
locale
|
|
18245
18294
|
});
|
|
18246
18295
|
}
|
|
18247
18296
|
});
|
|
@@ -18326,10 +18375,7 @@ const RangeFilter = ({ label, value, onChange, onClear }) => {
|
|
|
18326
18375
|
};
|
|
18327
18376
|
//#endregion
|
|
18328
18377
|
//#region src/components/ds-table/filters/adapters/create-dual-range-filter-adapter.tsx
|
|
18329
|
-
/**
|
|
18330
|
-
* Factory function to create a dual-range filter adapter
|
|
18331
|
-
* Handles filtering on multiple numeric ranges within a single column
|
|
18332
|
-
*/
|
|
18378
|
+
/** Filter over multiple numeric ranges within one column (AND across fields). */
|
|
18333
18379
|
function createDualRangeFilterAdapter(config) {
|
|
18334
18380
|
const { id, label, fields, formatNumber = (num) => num.toLocaleString("en-US"), getRowValue = (row) => row.getValue(id) } = config;
|
|
18335
18381
|
const initialValue = {};
|
|
@@ -18408,28 +18454,16 @@ function createDualRangeFilterAdapter(config) {
|
|
|
18408
18454
|
}
|
|
18409
18455
|
//#endregion
|
|
18410
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
|
+
};
|
|
18411
18463
|
/**
|
|
18412
|
-
*
|
|
18413
|
-
*
|
|
18414
|
-
*
|
|
18415
|
-
* **Uncontrolled mode** (default): Filters are managed internally.
|
|
18416
|
-
* **Controlled mode**: Filters are managed externally via appliedFilters/onFiltersChange.
|
|
18417
|
-
*
|
|
18418
|
-
* @example
|
|
18419
|
-
* // Uncontrolled mode
|
|
18420
|
-
* const { filterChips, handlers } = useTableFilters({
|
|
18421
|
-
* filterAdapters: adapters,
|
|
18422
|
-
* baseColumns: columns,
|
|
18423
|
-
* });
|
|
18424
|
-
*
|
|
18425
|
-
* @example
|
|
18426
|
-
* // Controlled mode (e.g., URL-driven filtering)
|
|
18427
|
-
* const { filterChips, handlers } = useTableFilters({
|
|
18428
|
-
* filterAdapters: adapters,
|
|
18429
|
-
* baseColumns: columns,
|
|
18430
|
-
* appliedFilters: filtersFromUrl,
|
|
18431
|
-
* onFiltersChange: (filters) => updateUrlAndRefetch(filters),
|
|
18432
|
-
* });
|
|
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.
|
|
18433
18467
|
*/
|
|
18434
18468
|
function useTableFilters({ filterAdapters, baseColumns, appliedFilters: externalAppliedFilters, onFiltersChange: setExternalAppliedFilters }) {
|
|
18435
18469
|
const _filterAdapters = filterAdapters;
|
|
@@ -18464,13 +18498,28 @@ function useTableFilters({ filterAdapters, baseColumns, appliedFilters: external
|
|
|
18464
18498
|
count: adapter.getActiveFiltersCount(draftFilters[adapter.id])
|
|
18465
18499
|
}));
|
|
18466
18500
|
const enhancedColumns = !baseColumns ? [] : baseColumns.map((col) => {
|
|
18467
|
-
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);
|
|
18468
18504
|
if (!adapter) return col;
|
|
18469
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;
|
|
18470
18515
|
return {
|
|
18471
18516
|
...col,
|
|
18472
18517
|
filterFn: adapter.columnFilterFn,
|
|
18473
|
-
...cellRenderer && { cell: (info) => cellRenderer(info.getValue()) }
|
|
18518
|
+
...cellRenderer && { cell: (info) => cellRenderer(info.getValue()) },
|
|
18519
|
+
...resolvedFilter && { meta: {
|
|
18520
|
+
...col.meta,
|
|
18521
|
+
filter: resolvedFilter
|
|
18522
|
+
} }
|
|
18474
18523
|
};
|
|
18475
18524
|
});
|
|
18476
18525
|
const updateFilter = (filterId, value) => {
|
|
@@ -18491,6 +18540,29 @@ function useTableFilters({ filterAdapters, baseColumns, appliedFilters: external
|
|
|
18491
18540
|
setPendingFilters({});
|
|
18492
18541
|
setAppliedFilters({});
|
|
18493
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
|
+
};
|
|
18494
18566
|
const deleteChip = (chip) => {
|
|
18495
18567
|
const filterKey = typeof chip.metadata?.key === "string" ? chip.metadata.key : void 0;
|
|
18496
18568
|
if (!filterKey) return;
|
|
@@ -18504,13 +18576,15 @@ function useTableFilters({ filterAdapters, baseColumns, appliedFilters: external
|
|
|
18504
18576
|
[filterKey]: newValue
|
|
18505
18577
|
});
|
|
18506
18578
|
};
|
|
18507
|
-
const
|
|
18508
|
-
const adapter = _filterAdapters.find((a) => a.id ===
|
|
18579
|
+
const renderForId = (filterId) => {
|
|
18580
|
+
const adapter = _filterAdapters.find((a) => a.id === filterId);
|
|
18509
18581
|
if (!adapter) return null;
|
|
18510
18582
|
const value = draftFilters[adapter.id];
|
|
18511
18583
|
const onChange = (newValue) => updateFilter(adapter.id, newValue);
|
|
18512
18584
|
return adapter.renderFilter(value, onChange);
|
|
18513
18585
|
};
|
|
18586
|
+
const renderFilterContent = (selectedFilter) => renderForId(selectedFilter.id);
|
|
18587
|
+
const renderColumnFilter = (filterId) => renderForId(filterId);
|
|
18514
18588
|
return {
|
|
18515
18589
|
filterState: draftFilters,
|
|
18516
18590
|
columnFilters,
|
|
@@ -18521,12 +18595,94 @@ function useTableFilters({ filterAdapters, baseColumns, appliedFilters: external
|
|
|
18521
18595
|
updateFilter,
|
|
18522
18596
|
applyFilters,
|
|
18523
18597
|
clearAll,
|
|
18524
|
-
deleteChip
|
|
18598
|
+
deleteChip,
|
|
18599
|
+
applyColumnFilter,
|
|
18600
|
+
cancelColumnFilter,
|
|
18601
|
+
clearColumnFilter
|
|
18525
18602
|
},
|
|
18526
|
-
renderFilterContent
|
|
18603
|
+
renderFilterContent,
|
|
18604
|
+
renderColumnFilter
|
|
18527
18605
|
};
|
|
18528
18606
|
}
|
|
18529
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
|
|
18530
18686
|
//#region src/components/ds-table/components/core-table/core-table.module.scss
|
|
18531
18687
|
var core_table_module_default = {
|
|
18532
18688
|
"table": "JP3Vta_table",
|
|
@@ -18663,6 +18819,9 @@ const DsTableBulkActions = ({ numSelectedRows, actions, onClearSelection }) => {
|
|
|
18663
18819
|
//#endregion
|
|
18664
18820
|
//#region src/components/ds-table/components/ds-table-header/ds-table-header.module.scss
|
|
18665
18821
|
var ds_table_header_module_default = {
|
|
18822
|
+
"filterableHeader": "-2rCNG_filterableHeader",
|
|
18823
|
+
"filterActive": "-2rCNG_filterActive",
|
|
18824
|
+
"filterTriggerContainer": "-2rCNG_filterTriggerContainer",
|
|
18666
18825
|
"headerCell": "-2rCNG_headerCell",
|
|
18667
18826
|
"headerRow": "-2rCNG_headerRow",
|
|
18668
18827
|
"headerRowNoBorder": "-2rCNG_headerRowNoBorder",
|
|
@@ -18697,18 +18856,83 @@ const useDsTableContext = () => {
|
|
|
18697
18856
|
if (!context) throw new Error("useDsTableContext must be used within DsTable");
|
|
18698
18857
|
return context;
|
|
18699
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
|
+
};
|
|
18700
18914
|
//#endregion
|
|
18701
18915
|
//#region src/components/ds-table/utils/column-size.ts
|
|
18702
18916
|
/**
|
|
18703
|
-
* 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`.
|
|
18704
18922
|
*
|
|
18705
18923
|
* @param columnSize - The size of the column
|
|
18706
|
-
* @
|
|
18707
|
-
* @returns Style object or undefined if no custom styling is needed
|
|
18924
|
+
* @returns Style object for the column/cell
|
|
18708
18925
|
*/
|
|
18709
|
-
const getColumnSizeStyle = (columnSize
|
|
18710
|
-
if (columnSize !== defaultColumnSizing.size) return {
|
|
18711
|
-
|
|
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
|
+
};
|
|
18712
18936
|
};
|
|
18713
18937
|
/**
|
|
18714
18938
|
* Column id used for the synthetic expander column injected when `expandable` is set.
|
|
@@ -18732,33 +18956,49 @@ const DsTableHeader = ({ table }) => {
|
|
|
18732
18956
|
children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(TableRow, {
|
|
18733
18957
|
className: classNames(ds_table_header_module_default.headerRow, !bordered && ds_table_header_module_default.headerRowNoBorder, virtualized && ds_table_header_module_default.headerRowVirtualized),
|
|
18734
18958
|
children: headerGroup.headers.map((header) => {
|
|
18735
|
-
const headerStyle = getColumnSizeStyle(header.column.getSize()
|
|
18959
|
+
const headerStyle = getColumnSizeStyle(header.column.getSize());
|
|
18736
18960
|
const canSort = header.column.getCanSort();
|
|
18737
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;
|
|
18738
18965
|
return /* @__PURE__ */ jsx(TableHead, {
|
|
18739
|
-
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),
|
|
18740
18967
|
onClick: header.column.getToggleSortingHandler(),
|
|
18741
18968
|
style: headerStyle,
|
|
18742
18969
|
children: header.isPlaceholder ? null : /* @__PURE__ */ jsxs("div", {
|
|
18743
18970
|
className: ds_table_header_module_default.headerSortContainer,
|
|
18744
|
-
children: [
|
|
18745
|
-
|
|
18746
|
-
|
|
18747
|
-
|
|
18748
|
-
|
|
18749
|
-
|
|
18750
|
-
|
|
18751
|
-
|
|
18752
|
-
|
|
18753
|
-
|
|
18754
|
-
|
|
18755
|
-
|
|
18756
|
-
|
|
18757
|
-
|
|
18758
|
-
|
|
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()
|
|
18759
18999
|
})
|
|
18760
|
-
}
|
|
18761
|
-
|
|
19000
|
+
})
|
|
19001
|
+
]
|
|
18762
19002
|
})
|
|
18763
19003
|
}, header.id);
|
|
18764
19004
|
})
|
|
@@ -18773,20 +19013,124 @@ var ds_table_module_default = {
|
|
|
18773
19013
|
"dataTableContainer": "iL9mtW_dataTableContainer",
|
|
18774
19014
|
"emptyState": "iL9mtW_emptyState",
|
|
18775
19015
|
"fullWidth": "iL9mtW_fullWidth",
|
|
18776
|
-
"
|
|
18777
|
-
"rotate-135": "iL9mtW_rotate-135",
|
|
18778
|
-
"rotate-180": "iL9mtW_rotate-180",
|
|
18779
|
-
"rotate-225": "iL9mtW_rotate-225",
|
|
18780
|
-
"rotate-270": "iL9mtW_rotate-270",
|
|
18781
|
-
"rotate-315": "iL9mtW_rotate-315",
|
|
18782
|
-
"rotate-45": "iL9mtW_rotate-45",
|
|
18783
|
-
"rotate-90": "iL9mtW_rotate-90",
|
|
19016
|
+
"scrollbar-thin": "iL9mtW_scrollbar-thin",
|
|
18784
19017
|
"table": "iL9mtW_table",
|
|
18785
19018
|
"tableNoBorder": "iL9mtW_tableNoBorder",
|
|
18786
|
-
"virtualized": "iL9mtW_virtualized",
|
|
18787
19019
|
"virtualizedContainer": "iL9mtW_virtualizedContainer"
|
|
18788
19020
|
};
|
|
18789
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
|
|
18790
19134
|
//#region src/components/ds-table/components/ds-table-cell/ds-table-cell.module.scss
|
|
18791
19135
|
var ds_table_cell_module_default = {
|
|
18792
19136
|
"cellActions": "UprPSq_cellActions",
|
|
@@ -18798,20 +19142,19 @@ var ds_table_cell_module_default = {
|
|
|
18798
19142
|
};
|
|
18799
19143
|
//#endregion
|
|
18800
19144
|
//#region src/components/ds-table/components/ds-table-cell/ds-table-cell.tsx
|
|
18801
|
-
const DsDefaultTableCell = ({ cell }) => {
|
|
18802
|
-
return /* @__PURE__ */ jsx("div", {
|
|
18803
|
-
className: ds_table_cell_module_default.tableCellEllipsis,
|
|
18804
|
-
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
18805
|
-
});
|
|
18806
|
-
};
|
|
18807
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;
|
|
18808
19148
|
const visiblePrimary = primaryRowActions.filter((action) => !action.hidden?.(row.original));
|
|
18809
19149
|
const visibleSecondary = secondaryRowActions.filter((action) => !action.hidden?.(row.original));
|
|
18810
|
-
if (visiblePrimary.length || visibleSecondary.length) {
|
|
19150
|
+
if (!isCellBeingEdited && (visiblePrimary.length || visibleSecondary.length)) {
|
|
18811
19151
|
const hasSecondaryRowActions = visibleSecondary.length > 0;
|
|
18812
19152
|
return /* @__PURE__ */ jsxs("div", {
|
|
18813
19153
|
className: ds_table_cell_module_default.lastCell,
|
|
18814
|
-
children: [/* @__PURE__ */ jsx(
|
|
19154
|
+
children: [/* @__PURE__ */ jsx(CellContent, {
|
|
19155
|
+
cell,
|
|
19156
|
+
isCellBeingEdited
|
|
19157
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
18815
19158
|
className: ds_table_cell_module_default.cellActions,
|
|
18816
19159
|
children: [visiblePrimary.map((action, i) => {
|
|
18817
19160
|
const isDisabled = action.disabled?.(row.original);
|
|
@@ -18862,13 +19205,32 @@ const DsTableCell = ({ row, cell, primaryRowActions = [], secondaryRowActions =
|
|
|
18862
19205
|
})]
|
|
18863
19206
|
});
|
|
18864
19207
|
}
|
|
18865
|
-
return /* @__PURE__ */ jsx(
|
|
19208
|
+
return /* @__PURE__ */ jsx(CellContent, {
|
|
19209
|
+
cell,
|
|
19210
|
+
isCellBeingEdited
|
|
19211
|
+
});
|
|
18866
19212
|
};
|
|
18867
|
-
|
|
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
|
+
});
|
|
19227
|
+
};
|
|
19228
|
+
//#endregion
|
|
18868
19229
|
//#region src/components/ds-table/components/ds-table-row/ds-table-row.module.scss
|
|
18869
19230
|
var ds_table_row_module_default = {
|
|
18870
19231
|
"cellReorder": "t8OZCq_cellReorder",
|
|
18871
19232
|
"clickableRow": "t8OZCq_clickableRow",
|
|
19233
|
+
"editableCell": "t8OZCq_editableCell",
|
|
18872
19234
|
"expandableCell": "t8OZCq_expandableCell",
|
|
18873
19235
|
"expanded": "t8OZCq_expanded",
|
|
18874
19236
|
"expandedRow": "t8OZCq_expandedRow",
|
|
@@ -18937,7 +19299,7 @@ const DsTableRow = ({ ref, row, isSelected }) => {
|
|
|
18937
19299
|
}, cell.id);
|
|
18938
19300
|
const isLastColumn = idx === row.getVisibleCells().length - 1;
|
|
18939
19301
|
return /* @__PURE__ */ jsx(TableCell, {
|
|
18940
|
-
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),
|
|
18941
19303
|
style: cellStyle,
|
|
18942
19304
|
children: isLastColumn ? /* @__PURE__ */ jsx(DsTableCell, {
|
|
18943
19305
|
row,
|
|
@@ -19057,13 +19419,16 @@ function useDragAndDrop({ isDragEnabled, onOrderChange, items }) {
|
|
|
19057
19419
|
//#region src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.module.scss
|
|
19058
19420
|
var ds_table_body_virtualized_module_default = {
|
|
19059
19421
|
"body": "vRRk8q_body",
|
|
19060
|
-
"emptyState": "vRRk8q_emptyState"
|
|
19422
|
+
"emptyState": "vRRk8q_emptyState",
|
|
19423
|
+
"scrollbar-thin": "vRRk8q_scrollbar-thin",
|
|
19424
|
+
"sentinel": "vRRk8q_sentinel"
|
|
19061
19425
|
};
|
|
19062
19426
|
//#endregion
|
|
19063
19427
|
//#region src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.module.scss
|
|
19064
19428
|
var ds_table_row_virtualized_module_default = {
|
|
19065
19429
|
"cell": "NcME7q_cell",
|
|
19066
19430
|
"clickableRow": "NcME7q_clickableRow",
|
|
19431
|
+
"editableCell": "NcME7q_editableCell",
|
|
19067
19432
|
"expandableCell": "NcME7q_expandableCell",
|
|
19068
19433
|
"expanded": "NcME7q_expanded",
|
|
19069
19434
|
"expandedRow": "NcME7q_expandedRow",
|
|
@@ -19103,8 +19468,8 @@ const DsTableRowVirtualized = ({ row, isSelected, rowsMapRef, rowHeightsMapRef,
|
|
|
19103
19468
|
children: isExpandedRowContent ? /* @__PURE__ */ jsx(TableCell, { children: renderExpandedRow?.(row.original) }) : /* @__PURE__ */ jsx(Fragment, { children: row.getVisibleCells().map((cell, idx) => {
|
|
19104
19469
|
const isLastColumn = idx === row.getVisibleCells().length - 1;
|
|
19105
19470
|
return /* @__PURE__ */ jsx(TableCell, {
|
|
19106
|
-
style: getColumnSizeStyle(cell.column.getSize()
|
|
19107
|
-
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),
|
|
19108
19473
|
children: isLastColumn ? /* @__PURE__ */ jsx(DsTableCell, {
|
|
19109
19474
|
row,
|
|
19110
19475
|
cell,
|
|
@@ -19149,9 +19514,10 @@ const useInfiniteScroll = (scrollElementRef, rowCount, config) => {
|
|
|
19149
19514
|
};
|
|
19150
19515
|
//#endregion
|
|
19151
19516
|
//#region src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.tsx
|
|
19152
|
-
const DsTableBodyVirtualized = ({ table,
|
|
19517
|
+
const DsTableBodyVirtualized = ({ table, emptyState, estimateSize, overscan, onScroll, rowSelection, infiniteScroll }) => {
|
|
19153
19518
|
const rowsMapRef = useRef(/* @__PURE__ */ new Map());
|
|
19154
19519
|
const rowHeightsMapRef = useRef(/* @__PURE__ */ new Map());
|
|
19520
|
+
const tbodyRef = useRef(null);
|
|
19155
19521
|
const { rows } = table.getRowModel();
|
|
19156
19522
|
const rowsAndExpandedRowContent = rows.flatMap((row) => row.getIsExpanded() ? [{ row }, {
|
|
19157
19523
|
row,
|
|
@@ -19161,14 +19527,14 @@ const DsTableBodyVirtualized = ({ table, tableContainerRef, emptyState, estimate
|
|
|
19161
19527
|
const item = rowsAndExpandedRowContent[index];
|
|
19162
19528
|
return item ? `${item.row.id}${item.isExpandedRowContent ? "-expanded-content" : ""}` : String(index);
|
|
19163
19529
|
};
|
|
19164
|
-
const { loadDataIfNeeded } = useInfiniteScroll(
|
|
19530
|
+
const { loadDataIfNeeded } = useInfiniteScroll(tbodyRef, rows.length, infiniteScroll);
|
|
19165
19531
|
const rowVirtualizer = useVirtualizer({
|
|
19166
19532
|
count: rowsAndExpandedRowContent.length,
|
|
19167
19533
|
estimateSize: (index) => {
|
|
19168
19534
|
return rowHeightsMapRef.current.get(getItemKey(index)) || estimateSize;
|
|
19169
19535
|
},
|
|
19170
19536
|
getItemKey,
|
|
19171
|
-
getScrollElement: () =>
|
|
19537
|
+
getScrollElement: () => tbodyRef.current,
|
|
19172
19538
|
measureElement: typeof window !== "undefined" && navigator.userAgent.indexOf("Firefox") === -1 ? (element) => element.getBoundingClientRect().height : void 0,
|
|
19173
19539
|
overscan: overscan ?? 5,
|
|
19174
19540
|
onChange: (instance, sync) => {
|
|
@@ -19201,6 +19567,7 @@ const DsTableBodyVirtualized = ({ table, tableContainerRef, emptyState, estimate
|
|
|
19201
19567
|
rowVirtualizer.measure();
|
|
19202
19568
|
}, [table.getState()]);
|
|
19203
19569
|
return /* @__PURE__ */ jsx(DsTableBody, {
|
|
19570
|
+
ref: tbodyRef,
|
|
19204
19571
|
rowsMapRef,
|
|
19205
19572
|
rowHeightsMapRef,
|
|
19206
19573
|
rowVirtualizer,
|
|
@@ -19209,12 +19576,13 @@ const DsTableBodyVirtualized = ({ table, tableContainerRef, emptyState, estimate
|
|
|
19209
19576
|
rowSelection
|
|
19210
19577
|
});
|
|
19211
19578
|
};
|
|
19212
|
-
function DsTableBody({ rowVirtualizer, rowsMapRef, rowHeightsMapRef, rowsAndExpandedRowContent, emptyState, rowSelection }) {
|
|
19579
|
+
function DsTableBody({ ref, rowVirtualizer, rowsMapRef, rowHeightsMapRef, rowsAndExpandedRowContent, emptyState, rowSelection }) {
|
|
19213
19580
|
const virtualRows = rowVirtualizer.getVirtualItems();
|
|
19214
|
-
|
|
19581
|
+
const totalSize = rowVirtualizer.getTotalSize();
|
|
19582
|
+
return /* @__PURE__ */ jsxs(TableBody, {
|
|
19583
|
+
ref,
|
|
19215
19584
|
className: ds_table_body_virtualized_module_default.body,
|
|
19216
|
-
|
|
19217
|
-
children: virtualRows.length > 0 ? virtualRows.map((virtualRow) => {
|
|
19585
|
+
children: [virtualRows.length > 0 ? virtualRows.map((virtualRow) => {
|
|
19218
19586
|
const row = rowsAndExpandedRowContent[virtualRow.index];
|
|
19219
19587
|
if (!row) return null;
|
|
19220
19588
|
return /* @__PURE__ */ jsx(DsTableRowVirtualized, {
|
|
@@ -19229,7 +19597,12 @@ function DsTableBody({ rowVirtualizer, rowsMapRef, rowHeightsMapRef, rowsAndExpa
|
|
|
19229
19597
|
}) : /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, {
|
|
19230
19598
|
className: ds_table_body_virtualized_module_default.emptyState,
|
|
19231
19599
|
children: emptyState || "No results."
|
|
19232
|
-
}) })
|
|
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
|
+
})]
|
|
19233
19606
|
});
|
|
19234
19607
|
}
|
|
19235
19608
|
//#endregion
|
|
@@ -19242,7 +19615,7 @@ const ROW_SIZE_HEIGHT_MAP = {
|
|
|
19242
19615
|
/**
|
|
19243
19616
|
* Design system Table component
|
|
19244
19617
|
*/
|
|
19245
|
-
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 }) => {
|
|
19246
19619
|
const [data, setData] = React$1.useState(tableData);
|
|
19247
19620
|
const [sorting, setSorting] = React$1.useState([]);
|
|
19248
19621
|
const [internalColumnFilters, setInternalColumnFilters] = React$1.useState([]);
|
|
@@ -19408,18 +19781,19 @@ const DsTable = ({ ref, columns: columnsProp, data: tableData, virtualized = fal
|
|
|
19408
19781
|
secondaryRowActions,
|
|
19409
19782
|
renderExpandedRow,
|
|
19410
19783
|
virtualized,
|
|
19411
|
-
activeRowId
|
|
19784
|
+
activeRowId,
|
|
19785
|
+
onCellEdit,
|
|
19786
|
+
...useEditingState(onCellEdit, onCellValidate)
|
|
19412
19787
|
};
|
|
19413
|
-
return /* @__PURE__ */
|
|
19788
|
+
return /* @__PURE__ */ jsx(DsTableContext.Provider, {
|
|
19414
19789
|
value: contextValue,
|
|
19415
|
-
children:
|
|
19790
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
19416
19791
|
ref: tableContainerRef,
|
|
19417
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),
|
|
19418
|
-
children: /* @__PURE__ */ jsx(DragWrapper, { children: /* @__PURE__ */ jsxs(Table$1, {
|
|
19419
|
-
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),
|
|
19420
19795
|
children: [/* @__PURE__ */ jsx(DsTableHeader, { table }), virtualized ? /* @__PURE__ */ jsx(DsTableBodyVirtualized, {
|
|
19421
19796
|
table,
|
|
19422
|
-
tableContainerRef,
|
|
19423
19797
|
emptyState,
|
|
19424
19798
|
estimateSize: virtualizedOptions?.estimateSize || ROW_SIZE_HEIGHT_MAP[rowSize],
|
|
19425
19799
|
overscan: virtualizedOptions?.overscan,
|
|
@@ -19430,15 +19804,175 @@ const DsTable = ({ ref, columns: columnsProp, data: tableData, virtualized = fal
|
|
|
19430
19804
|
row,
|
|
19431
19805
|
isSelected: !!rowSelection[row.id]
|
|
19432
19806
|
}, row.id)) : renderEmptyState() }) })]
|
|
19433
|
-
}) })
|
|
19434
|
-
|
|
19435
|
-
|
|
19436
|
-
|
|
19437
|
-
|
|
19438
|
-
|
|
19439
|
-
|
|
19440
|
-
|
|
19441
|
-
})
|
|
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)
|
|
19442
19976
|
});
|
|
19443
19977
|
};
|
|
19444
19978
|
//#endregion
|
|
@@ -20401,19 +20935,37 @@ DsVerticalTabs.List = DsVerticalTabsList;
|
|
|
20401
20935
|
DsVerticalTabs.Tab = DsVerticalTabsTab;
|
|
20402
20936
|
DsVerticalTabs.Content = DsVerticalTabsContent;
|
|
20403
20937
|
//#endregion
|
|
20404
|
-
//#region src/components/ds-workspace/ds-workspace.module.scss
|
|
20405
|
-
var
|
|
20406
|
-
"
|
|
20407
|
-
"
|
|
20408
|
-
"
|
|
20409
|
-
"
|
|
20410
|
-
"
|
|
20411
|
-
"
|
|
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;
|
|
20412
20960
|
};
|
|
20413
20961
|
//#endregion
|
|
20414
|
-
//#region src/components/ds-workspace/ds-workspace.tsx
|
|
20415
|
-
const
|
|
20416
|
-
|
|
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);
|
|
20417
20969
|
let className;
|
|
20418
20970
|
let rest;
|
|
20419
20971
|
let t1;
|
|
@@ -20429,24 +20981,58 @@ const DsWorkspace = (t0) => {
|
|
|
20429
20981
|
t1 = $[3];
|
|
20430
20982
|
}
|
|
20431
20983
|
const fillParent = t1 === void 0 ? false : t1;
|
|
20984
|
+
const [hasLeftSidePanel, setHasLeftSidePanel] = useState(false);
|
|
20432
20985
|
let t2;
|
|
20433
|
-
if ($[4]
|
|
20434
|
-
t2 =
|
|
20435
|
-
$[4] =
|
|
20436
|
-
|
|
20437
|
-
|
|
20438
|
-
} 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;
|
|
20439
20991
|
let t3;
|
|
20440
|
-
if ($[
|
|
20441
|
-
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", {
|
|
20442
21018
|
...rest,
|
|
20443
|
-
className:
|
|
21019
|
+
className: t5
|
|
20444
21020
|
});
|
|
20445
|
-
$[
|
|
20446
|
-
$[
|
|
20447
|
-
$[
|
|
20448
|
-
} else
|
|
20449
|
-
|
|
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;
|
|
20450
21036
|
};
|
|
20451
21037
|
const Header = (t0) => {
|
|
20452
21038
|
const $ = c(8);
|
|
@@ -20463,7 +21049,7 @@ const Header = (t0) => {
|
|
|
20463
21049
|
}
|
|
20464
21050
|
let t1;
|
|
20465
21051
|
if ($[3] !== className) {
|
|
20466
|
-
t1 = classNames(
|
|
21052
|
+
t1 = classNames(ds_workspace_layout_module_default.header, className);
|
|
20467
21053
|
$[3] = className;
|
|
20468
21054
|
$[4] = t1;
|
|
20469
21055
|
} else t1 = $[4];
|
|
@@ -20494,7 +21080,7 @@ const SubHeader = (t0) => {
|
|
|
20494
21080
|
}
|
|
20495
21081
|
let t1;
|
|
20496
21082
|
if ($[3] !== className) {
|
|
20497
|
-
t1 = classNames(
|
|
21083
|
+
t1 = classNames(ds_workspace_layout_module_default.subHeader, className);
|
|
20498
21084
|
$[3] = className;
|
|
20499
21085
|
$[4] = t1;
|
|
20500
21086
|
} else t1 = $[4];
|
|
@@ -20510,8 +21096,41 @@ const SubHeader = (t0) => {
|
|
|
20510
21096
|
} else t2 = $[7];
|
|
20511
21097
|
return t2;
|
|
20512
21098
|
};
|
|
20513
|
-
/**
|
|
21099
|
+
/** Content area: column layout, 24px vertical margins, 16px gap, 40px horizontal margins (24px when LeftPanel is mounted). */
|
|
20514
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) => {
|
|
20515
21134
|
const $ = c(8);
|
|
20516
21135
|
let className;
|
|
20517
21136
|
let rest;
|
|
@@ -20526,13 +21145,13 @@ const Content = (t0) => {
|
|
|
20526
21145
|
}
|
|
20527
21146
|
let t1;
|
|
20528
21147
|
if ($[3] !== className) {
|
|
20529
|
-
t1 = classNames(
|
|
21148
|
+
t1 = classNames(ds_workspace_layout_module_default.footer, className);
|
|
20530
21149
|
$[3] = className;
|
|
20531
21150
|
$[4] = t1;
|
|
20532
21151
|
} else t1 = $[4];
|
|
20533
21152
|
let t2;
|
|
20534
21153
|
if ($[5] !== rest || $[6] !== t1) {
|
|
20535
|
-
t2 = /* @__PURE__ */ jsx("
|
|
21154
|
+
t2 = /* @__PURE__ */ jsx("footer", {
|
|
20536
21155
|
...rest,
|
|
20537
21156
|
className: t1
|
|
20538
21157
|
});
|
|
@@ -20542,7 +21161,7 @@ const Content = (t0) => {
|
|
|
20542
21161
|
} else t2 = $[7];
|
|
20543
21162
|
return t2;
|
|
20544
21163
|
};
|
|
20545
|
-
const
|
|
21164
|
+
const Body = (t0) => {
|
|
20546
21165
|
const $ = c(8);
|
|
20547
21166
|
let className;
|
|
20548
21167
|
let rest;
|
|
@@ -20555,15 +21174,16 @@ const Footer = (t0) => {
|
|
|
20555
21174
|
className = $[1];
|
|
20556
21175
|
rest = $[2];
|
|
20557
21176
|
}
|
|
21177
|
+
useDsWorkspaceLayoutContext();
|
|
20558
21178
|
let t1;
|
|
20559
21179
|
if ($[3] !== className) {
|
|
20560
|
-
t1 = classNames(
|
|
21180
|
+
t1 = classNames(ds_workspace_layout_module_default.body, className);
|
|
20561
21181
|
$[3] = className;
|
|
20562
21182
|
$[4] = t1;
|
|
20563
21183
|
} else t1 = $[4];
|
|
20564
21184
|
let t2;
|
|
20565
21185
|
if ($[5] !== rest || $[6] !== t1) {
|
|
20566
|
-
t2 = /* @__PURE__ */ jsx("
|
|
21186
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
20567
21187
|
...rest,
|
|
20568
21188
|
className: t1
|
|
20569
21189
|
});
|
|
@@ -20573,11 +21193,171 @@ const Footer = (t0) => {
|
|
|
20573
21193
|
} else t2 = $[7];
|
|
20574
21194
|
return t2;
|
|
20575
21195
|
};
|
|
20576
|
-
|
|
20577
|
-
|
|
20578
|
-
|
|
20579
|
-
|
|
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;
|
|
20580
21360
|
//#endregion
|
|
20581
|
-
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, 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 };
|
|
20582
21362
|
|
|
20583
21363
|
//# sourceMappingURL=index.js.map
|