@cayuse-test/react 1.0.8 → 1.0.9

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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  MAX_FILE_SIZE_75_MB,
3
3
  useClickOutside
4
- } from "./chunk-BVB7EXJY.js";
4
+ } from "./chunk-XVA4YFXM.js";
5
5
  import {
6
6
  capitalizeAndJoin,
7
7
  flushStorage,
@@ -2326,15 +2326,16 @@ function SelectableCell({
2326
2326
  row,
2327
2327
  isMultiSelect,
2328
2328
  onRowSelectionChange,
2329
- rowAriaLabel
2329
+ rowAriaLabel,
2330
+ tableId
2330
2331
  }) {
2331
2332
  if (!row._isSelectable) {
2332
2333
  return /* @__PURE__ */ jsx34("td", {});
2333
2334
  }
2334
2335
  const rowLabel = isFunction(rowAriaLabel) ? rowAriaLabel({ row }) : "";
2335
2336
  function onSelect(event) {
2336
- event.preventDefault();
2337
- event.stopPropagation();
2337
+ event?.preventDefault();
2338
+ event?.stopPropagation();
2338
2339
  if (!row._isDisabledForSelection) {
2339
2340
  onRowSelectionChange({
2340
2341
  rows: [row],
@@ -2357,7 +2358,7 @@ function SelectableCell({
2357
2358
  return /* @__PURE__ */ jsx34("td", { className: "dynamic-table__selectable-cell", onClick: onSelect, children: /* @__PURE__ */ jsx34(
2358
2359
  Radio,
2359
2360
  {
2360
- name: "table-single-select",
2361
+ name: `table-single-select-${tableId}`,
2361
2362
  className: "dynamic-table__single-select",
2362
2363
  checked: row._isSelected,
2363
2364
  onChange: onSelect,
@@ -2377,6 +2378,7 @@ function SelectableCell({
2377
2378
  import { jsx as jsx35, jsxs as jsxs21 } from "react/jsx-runtime";
2378
2379
  function RowContent(props) {
2379
2380
  const {
2381
+ tableId,
2380
2382
  row,
2381
2383
  rowIndex,
2382
2384
  subRowIndex,
@@ -2426,6 +2428,7 @@ function RowContent(props) {
2426
2428
  SelectableCell,
2427
2429
  {
2428
2430
  row,
2431
+ tableId,
2429
2432
  isMultiSelect,
2430
2433
  onRowSelectionChange,
2431
2434
  rowAriaLabel
@@ -2456,6 +2459,7 @@ function RowContent(props) {
2456
2459
  import { Fragment as Fragment4, jsx as jsx36, jsxs as jsxs22 } from "react/jsx-runtime";
2457
2460
  function TableBodyContent(props) {
2458
2461
  const {
2462
+ tableId,
2459
2463
  isLoading,
2460
2464
  isRefresh,
2461
2465
  headers,
@@ -2488,6 +2492,7 @@ function TableBodyContent(props) {
2488
2492
  /* @__PURE__ */ jsx36(
2489
2493
  RowContent,
2490
2494
  {
2495
+ tableId,
2491
2496
  headers,
2492
2497
  row,
2493
2498
  rowIndex,
@@ -2510,6 +2515,7 @@ function TableBodyContent(props) {
2510
2515
  /* @__PURE__ */ jsx36(
2511
2516
  RowContent,
2512
2517
  {
2518
+ tableId,
2513
2519
  headers,
2514
2520
  row: subRow,
2515
2521
  rowIndex,
@@ -2619,8 +2625,10 @@ var DynamicTable = forwardRef4(
2619
2625
  children
2620
2626
  } = props;
2621
2627
  const tableHeaders = headers.filter((h) => isNonEmptyObject(h));
2622
- const rootRef = useRef4(null);
2623
2628
  const captionId = useId3();
2629
+ const tId = useId3();
2630
+ const tableId = id || tId;
2631
+ const rootRef = useRef4(null);
2624
2632
  const [expandedRows, setExpandedRows] = useState4([]);
2625
2633
  function toggleExpandableRow(event) {
2626
2634
  const rowIndex = Number(event.currentTarget.dataset.rowIndex);
@@ -2715,7 +2723,7 @@ var DynamicTable = forwardRef4(
2715
2723
  /* @__PURE__ */ jsx38("div", { className: "dynamic-table__wrapper", children: /* @__PURE__ */ jsxs24(
2716
2724
  "table",
2717
2725
  {
2718
- id,
2726
+ id: tableId,
2719
2727
  className: "dynamic-table",
2720
2728
  "data-exapandable": isExpandable,
2721
2729
  "data-selectable": isSelectable,
@@ -2773,6 +2781,7 @@ var DynamicTable = forwardRef4(
2773
2781
  children: /* @__PURE__ */ jsx38(
2774
2782
  TableBodyContent,
2775
2783
  {
2784
+ tableId,
2776
2785
  rows: tableRows,
2777
2786
  headers: tableHeaders,
2778
2787
  isLoading,
@@ -10407,4 +10416,4 @@ export {
10407
10416
  MilestoneProgress2 as MilestoneProgress,
10408
10417
  TaskFormHeader
10409
10418
  };
10410
- //# sourceMappingURL=chunk-SYDHZCBD.js.map
10419
+ //# sourceMappingURL=chunk-XU6XYQR5.js.map