@drivenets/design-system 0.14.0 → 0.15.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 +13 -0
- package/README.md +1 -1
- package/dist/index.cjs +371 -62
- package/dist/index.d.cts +107 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +107 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +370 -63
- package/dist/index.js.map +1 -1
- package/dist/index.min.css +1 -1
- package/package.json +4 -3
- package/src/components/ds-drawer/ds-drawer.module.scss +14 -0
- package/src/components/ds-drawer/ds-drawer.tsx +20 -1
- package/src/components/ds-drawer/ds-drawer.types.ts +7 -0
- package/src/components/ds-file-upload/hooks/use-file-upload.ts +7 -0
- package/src/components/ds-progress-task-bar/ds-progress-task-bar.figma.ts +29 -0
- package/src/components/ds-progress-task-bar/ds-progress-task-bar.module.scss +39 -0
- package/src/components/ds-progress-task-bar/ds-progress-task-bar.tsx +122 -0
- package/src/components/ds-progress-task-bar/ds-progress-task-bar.types.ts +65 -0
- package/src/components/ds-progress-task-bar/index.ts +2 -0
- package/src/components/ds-progress-task-bar/utils.ts +51 -0
- package/src/components/ds-table/components/ds-table-row/ds-table-row.module.scss +1 -1
- package/src/components/ds-table/components/ds-table-row/ds-table-row.tsx +2 -0
- package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.module.scss +1 -1
- package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.tsx +2 -0
- package/src/components/ds-table/components/edit/ds-table-editable-cell/ds-table-editable-cell.module.scss +14 -2
- package/src/components/ds-table/components/edit/ds-table-editable-cell/ds-table-editable-cell.tsx +19 -0
- package/src/components/ds-table/ds-table-column.types.ts +24 -0
- package/src/components/ds-table/ds-table.tsx +28 -4
- package/src/components/ds-table/ds-table.types.ts +7 -0
- package/src/components/ds-table/index.ts +1 -0
- package/src/components/ds-table/utils/constants.ts +5 -0
- package/src/components/ds-tabs/figma/ds-tabs-tab-vertical.figma.ts +78 -0
- package/src/components/ds-tabs/figma/ds-tabs-tab.figma.ts +89 -0
- package/src/components/ds-tabs/figma/ds-tabs-vertical.figma.ts +31 -0
- package/src/components/ds-tabs/figma/ds-tabs.figma.ts +29 -0
- package/src/index.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -8408,8 +8408,8 @@ const useArkDialogBodyLockCleanup = (open, enabled) => {
|
|
|
8408
8408
|
//#endregion
|
|
8409
8409
|
//#region src/components/ds-drawer/ds-drawer.tsx
|
|
8410
8410
|
const DsDrawer = (t0) => {
|
|
8411
|
-
const $ = c(
|
|
8412
|
-
const { open, onOpenChange, columns: t1, position: t2, backdrop: t3, closeOnEscape: t4, closeOnInteractOutside: t5, portal: t6, style, className, children } = t0;
|
|
8411
|
+
const $ = c(28);
|
|
8412
|
+
const { open, onOpenChange, onOpenAutoFocus, columns: t1, position: t2, backdrop: t3, closeOnEscape: t4, closeOnInteractOutside: t5, portal: t6, style, className, children } = t0;
|
|
8413
8413
|
const columns = t1 === void 0 ? 4 : t1;
|
|
8414
8414
|
const position = t2 === void 0 ? "end" : t2;
|
|
8415
8415
|
const backdrop = t3 === void 0 ? false : t3;
|
|
@@ -8427,75 +8427,88 @@ const DsDrawer = (t0) => {
|
|
|
8427
8427
|
$[1] = t7;
|
|
8428
8428
|
} else t7 = $[1];
|
|
8429
8429
|
const handleOpenChange = t7;
|
|
8430
|
-
const Wrapper = portal ? Portal : Fragment$1;
|
|
8431
8430
|
let t8;
|
|
8432
|
-
if ($[2] !==
|
|
8433
|
-
t8 =
|
|
8434
|
-
|
|
8431
|
+
if ($[2] !== onOpenAutoFocus) {
|
|
8432
|
+
t8 = onOpenAutoFocus ? () => {
|
|
8433
|
+
const event = new Event("openAutoFocus", { cancelable: true });
|
|
8434
|
+
onOpenAutoFocus(event);
|
|
8435
|
+
return event.defaultPrevented ? document.activeElement : void 0;
|
|
8436
|
+
} : void 0;
|
|
8437
|
+
$[2] = onOpenAutoFocus;
|
|
8435
8438
|
$[3] = t8;
|
|
8436
8439
|
} else t8 = $[3];
|
|
8437
|
-
const
|
|
8438
|
-
const
|
|
8439
|
-
let
|
|
8440
|
-
if ($[4] !==
|
|
8441
|
-
|
|
8442
|
-
$[4] =
|
|
8443
|
-
$[5] =
|
|
8444
|
-
|
|
8445
|
-
|
|
8446
|
-
|
|
8440
|
+
const initialFocusEl = t8;
|
|
8441
|
+
const Wrapper = portal ? Portal : Fragment$1;
|
|
8442
|
+
let t9;
|
|
8443
|
+
if ($[4] !== backdrop) {
|
|
8444
|
+
t9 = backdrop && /* @__PURE__ */ jsx(Dialog.Backdrop, { className: ds_drawer_module_default.backdrop });
|
|
8445
|
+
$[4] = backdrop;
|
|
8446
|
+
$[5] = t9;
|
|
8447
|
+
} else t9 = $[5];
|
|
8448
|
+
const t10 = ds_drawer_module_default[`position-${position}`];
|
|
8449
|
+
const t11 = ds_drawer_module_default[`cols-${resolvedColumns}`];
|
|
8447
8450
|
let t12;
|
|
8448
|
-
if ($[8] !==
|
|
8449
|
-
t12 =
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
$[8] = children;
|
|
8451
|
+
if ($[6] !== className || $[7] !== t10 || $[8] !== t11) {
|
|
8452
|
+
t12 = classNames(ds_drawer_module_default.drawer, t10, className, t11);
|
|
8453
|
+
$[6] = className;
|
|
8454
|
+
$[7] = t10;
|
|
8455
|
+
$[8] = t11;
|
|
8454
8456
|
$[9] = t12;
|
|
8455
8457
|
} else t12 = $[9];
|
|
8456
8458
|
let t13;
|
|
8457
|
-
if ($[10] !==
|
|
8458
|
-
t13 = /* @__PURE__ */ jsx(
|
|
8459
|
+
if ($[10] !== children) {
|
|
8460
|
+
t13 = /* @__PURE__ */ jsx("div", {
|
|
8461
|
+
className: ds_drawer_module_default.content,
|
|
8462
|
+
children
|
|
8463
|
+
});
|
|
8464
|
+
$[10] = children;
|
|
8465
|
+
$[11] = t13;
|
|
8466
|
+
} else t13 = $[11];
|
|
8467
|
+
let t14;
|
|
8468
|
+
if ($[12] !== style || $[13] !== t12 || $[14] !== t13) {
|
|
8469
|
+
t14 = /* @__PURE__ */ jsx(Dialog.Positioner, {
|
|
8459
8470
|
className: ds_drawer_module_default.positioner,
|
|
8460
8471
|
children: /* @__PURE__ */ jsx(Dialog.Content, {
|
|
8461
8472
|
style,
|
|
8462
|
-
className:
|
|
8463
|
-
children:
|
|
8473
|
+
className: t12,
|
|
8474
|
+
children: t13
|
|
8464
8475
|
})
|
|
8465
8476
|
});
|
|
8466
|
-
$[
|
|
8467
|
-
$[
|
|
8468
|
-
$[
|
|
8469
|
-
$[
|
|
8470
|
-
} else
|
|
8471
|
-
let t14;
|
|
8472
|
-
if ($[14] !== Wrapper || $[15] !== t13 || $[16] !== t8) {
|
|
8473
|
-
t14 = /* @__PURE__ */ jsxs(Wrapper, { children: [t8, t13] });
|
|
8474
|
-
$[14] = Wrapper;
|
|
8475
|
-
$[15] = t13;
|
|
8476
|
-
$[16] = t8;
|
|
8477
|
-
$[17] = t14;
|
|
8478
|
-
} else t14 = $[17];
|
|
8477
|
+
$[12] = style;
|
|
8478
|
+
$[13] = t12;
|
|
8479
|
+
$[14] = t13;
|
|
8480
|
+
$[15] = t14;
|
|
8481
|
+
} else t14 = $[15];
|
|
8479
8482
|
let t15;
|
|
8480
|
-
if ($[
|
|
8481
|
-
t15 = /* @__PURE__ */
|
|
8483
|
+
if ($[16] !== Wrapper || $[17] !== t14 || $[18] !== t9) {
|
|
8484
|
+
t15 = /* @__PURE__ */ jsxs(Wrapper, { children: [t9, t14] });
|
|
8485
|
+
$[16] = Wrapper;
|
|
8486
|
+
$[17] = t14;
|
|
8487
|
+
$[18] = t9;
|
|
8488
|
+
$[19] = t15;
|
|
8489
|
+
} else t15 = $[19];
|
|
8490
|
+
let t16;
|
|
8491
|
+
if ($[20] !== backdrop || $[21] !== closeOnEscape || $[22] !== closeOnInteractOutside || $[23] !== handleOpenChange || $[24] !== initialFocusEl || $[25] !== open || $[26] !== t15) {
|
|
8492
|
+
t16 = /* @__PURE__ */ jsx(Dialog.Root, {
|
|
8482
8493
|
open,
|
|
8483
8494
|
onOpenChange: handleOpenChange,
|
|
8484
8495
|
modal: backdrop,
|
|
8485
8496
|
closeOnEscape,
|
|
8486
8497
|
closeOnInteractOutside,
|
|
8487
8498
|
preventScroll: backdrop,
|
|
8488
|
-
|
|
8489
|
-
|
|
8490
|
-
|
|
8491
|
-
$[
|
|
8492
|
-
$[
|
|
8493
|
-
$[
|
|
8494
|
-
$[
|
|
8495
|
-
$[
|
|
8496
|
-
$[
|
|
8497
|
-
|
|
8498
|
-
|
|
8499
|
+
initialFocusEl,
|
|
8500
|
+
children: t15
|
|
8501
|
+
});
|
|
8502
|
+
$[20] = backdrop;
|
|
8503
|
+
$[21] = closeOnEscape;
|
|
8504
|
+
$[22] = closeOnInteractOutside;
|
|
8505
|
+
$[23] = handleOpenChange;
|
|
8506
|
+
$[24] = initialFocusEl;
|
|
8507
|
+
$[25] = open;
|
|
8508
|
+
$[26] = t15;
|
|
8509
|
+
$[27] = t16;
|
|
8510
|
+
} else t16 = $[27];
|
|
8511
|
+
return t16;
|
|
8499
8512
|
};
|
|
8500
8513
|
const Header$2 = (t0) => {
|
|
8501
8514
|
const $ = c(6);
|
|
@@ -14759,6 +14772,7 @@ function useFileUpload({ adapter, autoUpload = true, maxConcurrent = 3, maxFiles
|
|
|
14759
14772
|
updateFileProgress(fileId_2, 100);
|
|
14760
14773
|
onFileUploadComplete?.(fileId_2, result);
|
|
14761
14774
|
} catch (error_0) {
|
|
14775
|
+
if (abortController.signal.aborted) return;
|
|
14762
14776
|
const errorMessage = error_0 instanceof Error ? error_0.message : "Upload failed";
|
|
14763
14777
|
let status_0 = "interrupted";
|
|
14764
14778
|
if (error_0 instanceof FileUploadError) status_0 = error_0.isRetryable ? "interrupted" : "error";
|
|
@@ -16510,6 +16524,263 @@ const progressLinearSizes = [
|
|
|
16510
16524
|
"large"
|
|
16511
16525
|
];
|
|
16512
16526
|
//#endregion
|
|
16527
|
+
//#region src/components/ds-progress-task-bar/ds-progress-task-bar.module.scss
|
|
16528
|
+
var ds_progress_task_bar_module_default = {
|
|
16529
|
+
"bar": "SN3VFW_bar",
|
|
16530
|
+
"segment": "SN3VFW_segment",
|
|
16531
|
+
"segmentCompleted": "SN3VFW_segmentCompleted",
|
|
16532
|
+
"segmentFailed": "SN3VFW_segmentFailed",
|
|
16533
|
+
"segmentRunning": "SN3VFW_segmentRunning",
|
|
16534
|
+
"statusIcon": "SN3VFW_statusIcon",
|
|
16535
|
+
"total": "SN3VFW_total"
|
|
16536
|
+
};
|
|
16537
|
+
//#endregion
|
|
16538
|
+
//#region src/components/ds-progress-task-bar/ds-progress-task-bar.types.ts
|
|
16539
|
+
const taskBarStatuses = [
|
|
16540
|
+
"completed",
|
|
16541
|
+
"running",
|
|
16542
|
+
"failed"
|
|
16543
|
+
];
|
|
16544
|
+
//#endregion
|
|
16545
|
+
//#region src/components/ds-progress-task-bar/utils.ts
|
|
16546
|
+
const COUNT_UNITS = [
|
|
16547
|
+
{
|
|
16548
|
+
value: 1e9,
|
|
16549
|
+
suffix: "B"
|
|
16550
|
+
},
|
|
16551
|
+
{
|
|
16552
|
+
value: 1e6,
|
|
16553
|
+
suffix: "M"
|
|
16554
|
+
},
|
|
16555
|
+
{
|
|
16556
|
+
value: 1e3,
|
|
16557
|
+
suffix: "K"
|
|
16558
|
+
}
|
|
16559
|
+
];
|
|
16560
|
+
const ABBREVIATION_FLOOR = 1e3;
|
|
16561
|
+
const DECIMAL_THRESHOLD = 10;
|
|
16562
|
+
const stripTrailingZero = (value) => value % 1 === 0 ? String(value) : value.toFixed(1);
|
|
16563
|
+
/**
|
|
16564
|
+
* Format a task count for the legend, following the design's abbreviation rules:
|
|
16565
|
+
* - `< 1000` → exact number (e.g. `999`)
|
|
16566
|
+
* - single-digit unit → one decimal (e.g. `1.1K`, `1.2M`)
|
|
16567
|
+
* - multi-digit unit → whole number, truncated so `999,999 → 999K`
|
|
16568
|
+
*/
|
|
16569
|
+
const formatCount = (count) => {
|
|
16570
|
+
if (!Number.isFinite(count)) return "0";
|
|
16571
|
+
const rounded = Math.max(0, Math.round(count));
|
|
16572
|
+
if (rounded < ABBREVIATION_FLOOR) return String(rounded);
|
|
16573
|
+
const unit = COUNT_UNITS.find(({ value }) => rounded >= value);
|
|
16574
|
+
if (unit === void 0) return String(rounded);
|
|
16575
|
+
const scaled = rounded / unit.value;
|
|
16576
|
+
if (scaled < DECIMAL_THRESHOLD) return `${stripTrailingZero(Math.round(scaled * 10) / 10)}${unit.suffix}`;
|
|
16577
|
+
return `${String(Math.floor(scaled))}${unit.suffix}`;
|
|
16578
|
+
};
|
|
16579
|
+
//#endregion
|
|
16580
|
+
//#region src/components/ds-progress-task-bar/ds-progress-task-bar.tsx
|
|
16581
|
+
const statusIcon = Object.freeze({
|
|
16582
|
+
completed: "check_circle",
|
|
16583
|
+
running: "play_circle",
|
|
16584
|
+
failed: "cancel"
|
|
16585
|
+
});
|
|
16586
|
+
const statusIconColor = Object.freeze({
|
|
16587
|
+
completed: "success",
|
|
16588
|
+
running: "action",
|
|
16589
|
+
failed: "error"
|
|
16590
|
+
});
|
|
16591
|
+
const statusTextColor = Object.freeze({
|
|
16592
|
+
completed: "success",
|
|
16593
|
+
running: "action",
|
|
16594
|
+
failed: "error"
|
|
16595
|
+
});
|
|
16596
|
+
const statusSegmentClass = Object.freeze({
|
|
16597
|
+
completed: ds_progress_task_bar_module_default.segmentCompleted,
|
|
16598
|
+
running: ds_progress_task_bar_module_default.segmentRunning,
|
|
16599
|
+
failed: ds_progress_task_bar_module_default.segmentFailed
|
|
16600
|
+
});
|
|
16601
|
+
const defaultLocale = Object.freeze({
|
|
16602
|
+
completed: "Completed",
|
|
16603
|
+
running: "Running",
|
|
16604
|
+
failed: "Failed",
|
|
16605
|
+
total: (total) => `of ${total}`
|
|
16606
|
+
});
|
|
16607
|
+
const DsProgressTaskBar = (t0) => {
|
|
16608
|
+
const $ = c(39);
|
|
16609
|
+
const { completed: t1, running: t2, failed: t3, total, locale, className, style, ref } = t0;
|
|
16610
|
+
const completed = t1 === void 0 ? 0 : t1;
|
|
16611
|
+
const running = t2 === void 0 ? 0 : t2;
|
|
16612
|
+
const failed = t3 === void 0 ? 0 : t3;
|
|
16613
|
+
const t4 = Math.max(0, completed);
|
|
16614
|
+
const t5 = Math.max(0, running);
|
|
16615
|
+
const t6 = Math.max(0, failed);
|
|
16616
|
+
let T0;
|
|
16617
|
+
let t10;
|
|
16618
|
+
let t11;
|
|
16619
|
+
let t12;
|
|
16620
|
+
let t13;
|
|
16621
|
+
let t14;
|
|
16622
|
+
let t15;
|
|
16623
|
+
let t16;
|
|
16624
|
+
let t17;
|
|
16625
|
+
let t18;
|
|
16626
|
+
let t19;
|
|
16627
|
+
let t7;
|
|
16628
|
+
let t8;
|
|
16629
|
+
let t9;
|
|
16630
|
+
if ($[0] !== className || $[1] !== locale || $[2] !== ref || $[3] !== style || $[4] !== t4 || $[5] !== t5 || $[6] !== t6 || $[7] !== total) {
|
|
16631
|
+
const counts = {
|
|
16632
|
+
completed: t4,
|
|
16633
|
+
running: t5,
|
|
16634
|
+
failed: t6
|
|
16635
|
+
};
|
|
16636
|
+
const sum = counts.completed + counts.running + counts.failed;
|
|
16637
|
+
const denominator = Math.max(total ?? sum, sum);
|
|
16638
|
+
const mergedLocale = {
|
|
16639
|
+
...defaultLocale,
|
|
16640
|
+
...locale
|
|
16641
|
+
};
|
|
16642
|
+
const activeStatuses = taskBarStatuses.filter((status) => counts[status] > 0);
|
|
16643
|
+
const segmentWidth = (status_0) => denominator > 0 ? `${String(counts[status_0] / denominator * 100)}%` : "0%";
|
|
16644
|
+
T0 = DsStack;
|
|
16645
|
+
t13 = ref;
|
|
16646
|
+
t14 = "column";
|
|
16647
|
+
t15 = "var(--xs)";
|
|
16648
|
+
t16 = "100%";
|
|
16649
|
+
t17 = className;
|
|
16650
|
+
t18 = style;
|
|
16651
|
+
t19 = /* @__PURE__ */ jsxs(DsStack, {
|
|
16652
|
+
direction: "row",
|
|
16653
|
+
alignItems: "center",
|
|
16654
|
+
justifyContent: "space-between",
|
|
16655
|
+
children: [/* @__PURE__ */ jsx(DsStack, {
|
|
16656
|
+
direction: "row",
|
|
16657
|
+
alignItems: "center",
|
|
16658
|
+
gap: "var(--3xs)",
|
|
16659
|
+
children: activeStatuses.length === 0 ? /* @__PURE__ */ jsx(DsTypography, {
|
|
16660
|
+
variant: "body-xs-reg",
|
|
16661
|
+
color: "secondary",
|
|
16662
|
+
children: "0"
|
|
16663
|
+
}) : activeStatuses.map((status_1) => /* @__PURE__ */ jsxs(DsStack, {
|
|
16664
|
+
direction: "row",
|
|
16665
|
+
alignItems: "center",
|
|
16666
|
+
gap: "var(--4xs)",
|
|
16667
|
+
children: [/* @__PURE__ */ jsx(DsTooltip, {
|
|
16668
|
+
content: mergedLocale[status_1],
|
|
16669
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
16670
|
+
className: ds_progress_task_bar_module_default.statusIcon,
|
|
16671
|
+
children: /* @__PURE__ */ jsx(DsIcon, {
|
|
16672
|
+
icon: statusIcon[status_1],
|
|
16673
|
+
size: "tiny",
|
|
16674
|
+
color: statusIconColor[status_1],
|
|
16675
|
+
filled: true
|
|
16676
|
+
})
|
|
16677
|
+
})
|
|
16678
|
+
}), /* @__PURE__ */ jsx(DsTypography, {
|
|
16679
|
+
variant: "body-xs-reg",
|
|
16680
|
+
color: statusTextColor[status_1],
|
|
16681
|
+
children: formatCount(counts[status_1])
|
|
16682
|
+
})]
|
|
16683
|
+
}, status_1))
|
|
16684
|
+
}), /* @__PURE__ */ jsx(DsTypography, {
|
|
16685
|
+
variant: "body-xs-reg",
|
|
16686
|
+
color: "secondary",
|
|
16687
|
+
className: ds_progress_task_bar_module_default.total,
|
|
16688
|
+
children: mergedLocale.total(formatCount(denominator))
|
|
16689
|
+
})]
|
|
16690
|
+
});
|
|
16691
|
+
t7 = ds_progress_task_bar_module_default.bar;
|
|
16692
|
+
t8 = "progressbar";
|
|
16693
|
+
t9 = 0;
|
|
16694
|
+
t10 = denominator;
|
|
16695
|
+
t11 = sum;
|
|
16696
|
+
t12 = activeStatuses.map((status_2) => /* @__PURE__ */ jsx(DsTooltip, {
|
|
16697
|
+
content: mergedLocale[status_2],
|
|
16698
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
16699
|
+
className: classNames(ds_progress_task_bar_module_default.segment, statusSegmentClass[status_2]),
|
|
16700
|
+
style: { width: segmentWidth(status_2) }
|
|
16701
|
+
})
|
|
16702
|
+
}, status_2));
|
|
16703
|
+
$[0] = className;
|
|
16704
|
+
$[1] = locale;
|
|
16705
|
+
$[2] = ref;
|
|
16706
|
+
$[3] = style;
|
|
16707
|
+
$[4] = t4;
|
|
16708
|
+
$[5] = t5;
|
|
16709
|
+
$[6] = t6;
|
|
16710
|
+
$[7] = total;
|
|
16711
|
+
$[8] = T0;
|
|
16712
|
+
$[9] = t10;
|
|
16713
|
+
$[10] = t11;
|
|
16714
|
+
$[11] = t12;
|
|
16715
|
+
$[12] = t13;
|
|
16716
|
+
$[13] = t14;
|
|
16717
|
+
$[14] = t15;
|
|
16718
|
+
$[15] = t16;
|
|
16719
|
+
$[16] = t17;
|
|
16720
|
+
$[17] = t18;
|
|
16721
|
+
$[18] = t19;
|
|
16722
|
+
$[19] = t7;
|
|
16723
|
+
$[20] = t8;
|
|
16724
|
+
$[21] = t9;
|
|
16725
|
+
} else {
|
|
16726
|
+
T0 = $[8];
|
|
16727
|
+
t10 = $[9];
|
|
16728
|
+
t11 = $[10];
|
|
16729
|
+
t12 = $[11];
|
|
16730
|
+
t13 = $[12];
|
|
16731
|
+
t14 = $[13];
|
|
16732
|
+
t15 = $[14];
|
|
16733
|
+
t16 = $[15];
|
|
16734
|
+
t17 = $[16];
|
|
16735
|
+
t18 = $[17];
|
|
16736
|
+
t19 = $[18];
|
|
16737
|
+
t7 = $[19];
|
|
16738
|
+
t8 = $[20];
|
|
16739
|
+
t9 = $[21];
|
|
16740
|
+
}
|
|
16741
|
+
let t20;
|
|
16742
|
+
if ($[22] !== t10 || $[23] !== t11 || $[24] !== t12 || $[25] !== t7 || $[26] !== t8 || $[27] !== t9) {
|
|
16743
|
+
t20 = /* @__PURE__ */ jsx("div", {
|
|
16744
|
+
className: t7,
|
|
16745
|
+
role: t8,
|
|
16746
|
+
"aria-valuemin": t9,
|
|
16747
|
+
"aria-valuemax": t10,
|
|
16748
|
+
"aria-valuenow": t11,
|
|
16749
|
+
children: t12
|
|
16750
|
+
});
|
|
16751
|
+
$[22] = t10;
|
|
16752
|
+
$[23] = t11;
|
|
16753
|
+
$[24] = t12;
|
|
16754
|
+
$[25] = t7;
|
|
16755
|
+
$[26] = t8;
|
|
16756
|
+
$[27] = t9;
|
|
16757
|
+
$[28] = t20;
|
|
16758
|
+
} else t20 = $[28];
|
|
16759
|
+
let t21;
|
|
16760
|
+
if ($[29] !== T0 || $[30] !== t13 || $[31] !== t14 || $[32] !== t15 || $[33] !== t16 || $[34] !== t17 || $[35] !== t18 || $[36] !== t19 || $[37] !== t20) {
|
|
16761
|
+
t21 = /* @__PURE__ */ jsxs(T0, {
|
|
16762
|
+
ref: t13,
|
|
16763
|
+
direction: t14,
|
|
16764
|
+
gap: t15,
|
|
16765
|
+
width: t16,
|
|
16766
|
+
className: t17,
|
|
16767
|
+
style: t18,
|
|
16768
|
+
children: [t19, t20]
|
|
16769
|
+
});
|
|
16770
|
+
$[29] = T0;
|
|
16771
|
+
$[30] = t13;
|
|
16772
|
+
$[31] = t14;
|
|
16773
|
+
$[32] = t15;
|
|
16774
|
+
$[33] = t16;
|
|
16775
|
+
$[34] = t17;
|
|
16776
|
+
$[35] = t18;
|
|
16777
|
+
$[36] = t19;
|
|
16778
|
+
$[37] = t20;
|
|
16779
|
+
$[38] = t21;
|
|
16780
|
+
} else t21 = $[38];
|
|
16781
|
+
return t21;
|
|
16782
|
+
};
|
|
16783
|
+
//#endregion
|
|
16513
16784
|
//#region src/components/ds-radio-group/ds-radio-group.module.scss
|
|
16514
16785
|
var ds_radio_group_module_default = {
|
|
16515
16786
|
"labelInfo": "gJbMxW_labelInfo",
|
|
@@ -19470,6 +19741,7 @@ var ds_table_module_default = {
|
|
|
19470
19741
|
//#region src/components/ds-table/components/edit/ds-table-editable-cell/ds-table-editable-cell.module.scss
|
|
19471
19742
|
var ds_table_editable_cell_module_default = {
|
|
19472
19743
|
"editButton": "g5FEoW_editButton",
|
|
19744
|
+
"lockIcon": "g5FEoW_lockIcon",
|
|
19473
19745
|
"root": "g5FEoW_root"
|
|
19474
19746
|
};
|
|
19475
19747
|
//#endregion
|
|
@@ -19481,6 +19753,26 @@ const DsTableEditableCell = ({ cell, children }) => {
|
|
|
19481
19753
|
event.stopPropagation();
|
|
19482
19754
|
beginEdit(cell);
|
|
19483
19755
|
};
|
|
19756
|
+
const editDisabled = cell.column.columnDef.editDisabled?.(cell.getContext());
|
|
19757
|
+
const locked = editDisabled === true || typeof editDisabled === "object";
|
|
19758
|
+
const reason = typeof editDisabled === "object" ? editDisabled.reason : void 0;
|
|
19759
|
+
if (locked) return /* @__PURE__ */ jsxs("div", {
|
|
19760
|
+
className: ds_table_editable_cell_module_default.root,
|
|
19761
|
+
"data-locked": "",
|
|
19762
|
+
children: [children, /* @__PURE__ */ jsx(DsTooltip, {
|
|
19763
|
+
content: reason,
|
|
19764
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
19765
|
+
className: ds_table_editable_cell_module_default.lockIcon,
|
|
19766
|
+
"aria-label": "Editing disabled",
|
|
19767
|
+
role: "img",
|
|
19768
|
+
children: /* @__PURE__ */ jsx(DsIcon, {
|
|
19769
|
+
icon: "lock",
|
|
19770
|
+
size: "small",
|
|
19771
|
+
color: "secondary"
|
|
19772
|
+
})
|
|
19773
|
+
})
|
|
19774
|
+
})]
|
|
19775
|
+
});
|
|
19484
19776
|
return /* @__PURE__ */ jsxs("div", {
|
|
19485
19777
|
className: ds_table_editable_cell_module_default.root,
|
|
19486
19778
|
"data-active": isEditing ? "" : void 0,
|
|
@@ -19684,6 +19976,7 @@ var ds_table_row_module_default = {
|
|
|
19684
19976
|
"expandedRow": "t8OZCq_expandedRow",
|
|
19685
19977
|
"groupStart": "t8OZCq_groupStart",
|
|
19686
19978
|
"isDragging": "t8OZCq_isDragging",
|
|
19979
|
+
"loadingRow": "t8OZCq_loadingRow",
|
|
19687
19980
|
"rowDragHandle": "t8OZCq_rowDragHandle",
|
|
19688
19981
|
"rowNoBorder": "t8OZCq_rowNoBorder",
|
|
19689
19982
|
"selectableCell": "t8OZCq_selectableCell",
|
|
@@ -19710,7 +20003,7 @@ const DsRowDragHandle = ({ isDragging, attributes, listeners, style }) => {
|
|
|
19710
20003
|
});
|
|
19711
20004
|
};
|
|
19712
20005
|
const DsTableRow = ({ ref, row, isSelected }) => {
|
|
19713
|
-
const { reorderable, onRowClick, onRowDoubleClick, renderExpandedRow, bordered, rowSize, primaryRowActions, secondaryRowActions, activeRowId } = useDsTableContext();
|
|
20006
|
+
const { reorderable, onRowClick, onRowDoubleClick, renderExpandedRow, bordered, rowSize, primaryRowActions, secondaryRowActions, activeRowId, loading } = useDsTableContext();
|
|
19714
20007
|
const isExpanded = row.getIsExpanded();
|
|
19715
20008
|
const isActive = activeRowId === row.id;
|
|
19716
20009
|
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({
|
|
@@ -19734,7 +20027,7 @@ const DsTableRow = ({ ref, row, isSelected }) => {
|
|
|
19734
20027
|
[ds_table_row_module_default.sizeSmall]: rowSize === "small",
|
|
19735
20028
|
[ds_table_row_module_default.sizeMedium]: rowSize === "medium",
|
|
19736
20029
|
[ds_table_row_module_default.sizeLarge]: rowSize === "large"
|
|
19737
|
-
}, onRowClick && ds_table_row_module_default.clickableRow, !bordered && ds_table_row_module_default.rowNoBorder, isExpanded && ds_table_row_module_default.expanded),
|
|
20030
|
+
}, onRowClick && ds_table_row_module_default.clickableRow, !bordered && ds_table_row_module_default.rowNoBorder, isExpanded && ds_table_row_module_default.expanded, loading && ds_table_row_module_default.loadingRow),
|
|
19738
20031
|
style: rowStyle,
|
|
19739
20032
|
onClick: () => onRowClick?.(row.original),
|
|
19740
20033
|
onDoubleClick: () => onRowDoubleClick?.(row.original),
|
|
@@ -19883,6 +20176,7 @@ var ds_table_row_virtualized_module_default = {
|
|
|
19883
20176
|
"expandedRow": "NcME7q_expandedRow",
|
|
19884
20177
|
"expandedRowContent": "NcME7q_expandedRowContent",
|
|
19885
20178
|
"groupStart": "NcME7q_groupStart",
|
|
20179
|
+
"loadingRow": "NcME7q_loadingRow",
|
|
19886
20180
|
"row": "NcME7q_row",
|
|
19887
20181
|
"rowNoBorder": "NcME7q_rowNoBorder",
|
|
19888
20182
|
"selectableCell": "NcME7q_selectableCell",
|
|
@@ -19893,7 +20187,7 @@ var ds_table_row_virtualized_module_default = {
|
|
|
19893
20187
|
//#endregion
|
|
19894
20188
|
//#region src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.tsx
|
|
19895
20189
|
const DsTableRowVirtualized = ({ row, isSelected, rowsMapRef, rowHeightsMapRef, rowVirtualizer, virtualRow, isExpandedRowContent }) => {
|
|
19896
|
-
const { bordered, rowSize, activeRowId, primaryRowActions, secondaryRowActions, renderExpandedRow, onRowClick, onRowDoubleClick } = useDsTableContext();
|
|
20190
|
+
const { bordered, rowSize, activeRowId, primaryRowActions, secondaryRowActions, renderExpandedRow, onRowClick, onRowDoubleClick, loading } = useDsTableContext();
|
|
19897
20191
|
const isExpanded = row.getIsExpanded();
|
|
19898
20192
|
const isActive = activeRowId === row.id;
|
|
19899
20193
|
return /* @__PURE__ */ jsx(TableRow, {
|
|
@@ -19912,7 +20206,7 @@ const DsTableRowVirtualized = ({ row, isSelected, rowsMapRef, rowHeightsMapRef,
|
|
|
19912
20206
|
[ds_table_row_virtualized_module_default.sizeSmall]: rowSize === "small",
|
|
19913
20207
|
[ds_table_row_virtualized_module_default.sizeMedium]: rowSize === "medium",
|
|
19914
20208
|
[ds_table_row_virtualized_module_default.sizeLarge]: rowSize === "large"
|
|
19915
|
-
}, isExpandedRowContent && ds_table_row_virtualized_module_default.expandedRowContent, onRowClick && ds_table_row_virtualized_module_default.clickableRow, !bordered && ds_table_row_virtualized_module_default.rowNoBorder, isExpanded && ds_table_row_virtualized_module_default.expanded),
|
|
20209
|
+
}, isExpandedRowContent && ds_table_row_virtualized_module_default.expandedRowContent, onRowClick && ds_table_row_virtualized_module_default.clickableRow, !bordered && ds_table_row_virtualized_module_default.rowNoBorder, isExpanded && ds_table_row_virtualized_module_default.expanded, loading && ds_table_row_virtualized_module_default.loadingRow),
|
|
19916
20210
|
onClick: isExpandedRowContent ? void 0 : () => onRowClick?.(row.original),
|
|
19917
20211
|
onDoubleClick: isExpandedRowContent ? void 0 : () => onRowDoubleClick?.(row.original),
|
|
19918
20212
|
children: isExpandedRowContent ? /* @__PURE__ */ jsx(TableCell, { children: renderExpandedRow?.(row.original) }) : /* @__PURE__ */ jsx(Fragment, { children: row.getVisibleCells().map((cell, idx) => {
|
|
@@ -20066,7 +20360,7 @@ const ROW_SIZE_HEIGHT_MAP = {
|
|
|
20066
20360
|
/**
|
|
20067
20361
|
* Design system Table component
|
|
20068
20362
|
*/
|
|
20069
|
-
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, collapsedColumnGroups: externalCollapsedColumnGroups, onCollapsedColumnGroupsChange, locale, activeRowId, infiniteScroll, onCellEdit, onCellValidate }) => {
|
|
20363
|
+
const DsTable = ({ ref, columns: columnsProp, data: tableData, virtualized = false, virtualizedOptions, className, onRowClick, emptyState, stickyHeader = true, bordered = true, fullWidth = true, rowSize = "medium", loading = false, expandable = false, renderExpandedRow, selectable = false, showSelectAllCheckbox = true, onSelectionChange, onSortingChange, onScroll, actions = [], onRowDoubleClick, primaryRowActions = [], secondaryRowActions, reorderable = false, onOrderChange, columnFilters: externalColumnFilters, onColumnFiltersChange, columnVisibility: externalColumnVisibility, onColumnVisibilityChange, collapsedColumnGroups: externalCollapsedColumnGroups, onCollapsedColumnGroupsChange, locale, activeRowId, infiniteScroll, onCellEdit, onCellValidate }) => {
|
|
20070
20364
|
const [data, setData] = React$1.useState(tableData);
|
|
20071
20365
|
const [sorting, setSorting] = React$1.useState([]);
|
|
20072
20366
|
const [internalColumnFilters, setInternalColumnFilters] = React$1.useState([]);
|
|
@@ -20158,9 +20452,20 @@ const DsTable = ({ ref, columns: columnsProp, data: tableData, virtualized = fal
|
|
|
20158
20452
|
hasSelectColumn,
|
|
20159
20453
|
showSelectAllCheckbox
|
|
20160
20454
|
]);
|
|
20455
|
+
const skeletonColumns = useMemo(() => {
|
|
20456
|
+
const toSkeleton = (cols) => cols.map((column) => "columns" in column && column.columns ? {
|
|
20457
|
+
...column,
|
|
20458
|
+
columns: toSkeleton(column.columns)
|
|
20459
|
+
} : {
|
|
20460
|
+
...column,
|
|
20461
|
+
cell: column.loadingCell ?? (() => /* @__PURE__ */ jsx(DsSkeletonText, { width: "60%" }))
|
|
20462
|
+
});
|
|
20463
|
+
return toSkeleton(columns);
|
|
20464
|
+
}, [columns]);
|
|
20465
|
+
const skeletonData = useMemo(() => Array.from({ length: 5 }, (_, i) => ({ id: `ds-table-skeleton-${String(i)}` })), []);
|
|
20161
20466
|
const table = useReactTable({
|
|
20162
|
-
data: reorderable ? data : tableData,
|
|
20163
|
-
columns,
|
|
20467
|
+
data: loading ? skeletonData : reorderable ? data : tableData,
|
|
20468
|
+
columns: loading ? skeletonColumns : columns,
|
|
20164
20469
|
getCoreRowModel: getCoreRowModel(),
|
|
20165
20470
|
onSortingChange: handleSortingChange,
|
|
20166
20471
|
getSortedRowModel: getSortedRowModel(),
|
|
@@ -20226,6 +20531,7 @@ const DsTable = ({ ref, columns: columnsProp, data: tableData, virtualized = fal
|
|
|
20226
20531
|
}) });
|
|
20227
20532
|
const selectedRows = Object.entries(rowSelection).filter(([, selected]) => selected).map(([key]) => rowsById[key]?.original).filter((v) => !!v);
|
|
20228
20533
|
const isBulkActionsVisible = selectable && actions.length > 0 && selectedRows.length > 0;
|
|
20534
|
+
const editingState = useEditingState(onCellEdit, onCellValidate);
|
|
20229
20535
|
const contextValue = {
|
|
20230
20536
|
stickyHeader,
|
|
20231
20537
|
bordered,
|
|
@@ -20235,8 +20541,9 @@ const DsTable = ({ ref, columns: columnsProp, data: tableData, virtualized = fal
|
|
|
20235
20541
|
selectable,
|
|
20236
20542
|
reorderable,
|
|
20237
20543
|
showSelectAllCheckbox,
|
|
20238
|
-
|
|
20239
|
-
|
|
20544
|
+
loading,
|
|
20545
|
+
onRowClick: loading ? void 0 : onRowClick,
|
|
20546
|
+
onRowDoubleClick: loading ? void 0 : onRowDoubleClick,
|
|
20240
20547
|
primaryRowActions,
|
|
20241
20548
|
secondaryRowActions,
|
|
20242
20549
|
renderExpandedRow,
|
|
@@ -20246,7 +20553,7 @@ const DsTable = ({ ref, columns: columnsProp, data: tableData, virtualized = fal
|
|
|
20246
20553
|
onToggleColumnGroup: toggleColumnGroup,
|
|
20247
20554
|
locale,
|
|
20248
20555
|
onCellEdit,
|
|
20249
|
-
...
|
|
20556
|
+
...editingState
|
|
20250
20557
|
};
|
|
20251
20558
|
return /* @__PURE__ */ jsx(DsTableContext.Provider, {
|
|
20252
20559
|
value: contextValue,
|
|
@@ -21821,6 +22128,6 @@ DsWorkspaceLayout.Body = Body;
|
|
|
21821
22128
|
DsWorkspaceLayout.SideMenu = SideMenu;
|
|
21822
22129
|
DsWorkspaceLayout.LeftPanel = LeftPanel;
|
|
21823
22130
|
//#endregion
|
|
21824
|
-
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, defaultDsTableLocale, dropdownMenuItemVariants, dsKeyValuePairOrientations, filterStatuses, formatTime, iconColors, iconSizes, iconVariants, isCustomIcon, isResponsiveValue, loaderVariants, popoverAligns, popoverSides, 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 };
|
|
22131
|
+
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, DsProgressTaskBar, 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, defaultDsTableLocale, dropdownMenuItemVariants, dsKeyValuePairOrientations, filterStatuses, formatTime, iconColors, iconSizes, iconVariants, isCustomIcon, isResponsiveValue, loaderVariants, popoverAligns, popoverSides, progressArcSizes, progressArcVariants, progressDonutSizes, progressDonutVariants, progressLinearSizes, progressLinearVariants, resolveResponsiveValue, skeletonColorVariants, skeletonRadiusVariants, spinnerSizes, splitButtonSizes, statusBadgeV2Phases, statusBadgeV2Sizes, statusBadgeV2Variants, systemStatuses, tagSizes, tagVariants, taskBarStatuses, textInputSizes, useBreakpoint, useCellEditor, useCheckboxSelectAll, useFileUpload, useResponsiveValue, useTableFilters, useToaster, withResponsiveProps };
|
|
21825
22132
|
|
|
21826
22133
|
//# sourceMappingURL=index.js.map
|