@ostack.tech/ui 0.12.1 → 0.12.3

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.
@@ -1723,7 +1723,7 @@ a > .o-ui-code {
1723
1723
  margin-right: var(--o-ui-space);
1724
1724
  }
1725
1725
  .o-ui-data-table__selection-column-cell .o-ui-checkbox__container {
1726
- background-color: transparent;
1726
+ background: none;
1727
1727
  }
1728
1728
  .o-ui-data-table > *:not(.o-ui-data-table__content-container) {
1729
1729
  margin-bottom: var(--o-ui-space);
package/dist/ostack-ui.js CHANGED
@@ -1159,6 +1159,10 @@ function useCreateTableContext({
1159
1159
  scrollPosition: void 0,
1160
1160
  leafColumns: void 0,
1161
1161
  defaultColumnWidth,
1162
+ numberOfColumns: computed(
1163
+ () => [get().leafColumns],
1164
+ (leaves) => leaves && numberOfColumns(leaves)
1165
+ ),
1162
1166
  stickyColumnOffsets: computed(
1163
1167
  () => [get().leafColumns, get().defaultColumnWidth],
1164
1168
  (leaves, defaultColumnWidth2) => leaves && stickyColumnOffsets(leaves, defaultColumnWidth2)
@@ -1187,7 +1191,7 @@ function useTableContext() {
1187
1191
  }
1188
1192
  function useTableNumberOfColumns() {
1189
1193
  const { store } = useTableContext();
1190
- return useStore$1(store, (state) => state.leafColumns?.length);
1194
+ return useStore$1(store, ({ numberOfColumns: numberOfColumns2 }) => numberOfColumns2());
1191
1195
  }
1192
1196
  const TableHeadContext = createContext(false);
1193
1197
  function useIsInTableHead() {
@@ -5466,19 +5470,26 @@ function useDataTableSelectionColumn() {
5466
5470
  }
5467
5471
  const [selectedRows2] = state.selectedRows;
5468
5472
  const window2 = selectionWindow(displayMode, state);
5469
- let enabledCount = 0;
5470
5473
  let selectedCount = 0;
5474
+ let disabledCount = 0;
5475
+ let allEnabledChecked = true;
5471
5476
  for (const row of window2) {
5472
5477
  if (row === void 0) {
5473
5478
  return "loading";
5474
5479
  }
5475
5480
  const key = getRowKey(row, rowKey);
5476
- enabledCount += +!disabledSelections?.has(key);
5477
- selectedCount += +selectedRows2.has(key);
5481
+ const isSelected = selectedRows2.has(key);
5482
+ const isDisabled = disabledSelections?.has(key) ?? false;
5483
+ selectedCount += +isSelected;
5484
+ disabledCount += +isDisabled;
5485
+ if (!isDisabled) {
5486
+ allEnabledChecked = allEnabledChecked && isSelected;
5487
+ }
5478
5488
  }
5479
5489
  return {
5480
- allChecked: selectedCount === window2.length ? true : selectedCount === 0 ? false : "indeterminate",
5481
- allEnabledChecked: selectedCount >= enabledCount
5490
+ allDisabled: disabledCount === window2.length,
5491
+ allChecked: window2.length > 0 && selectedCount === window2.length ? true : selectedCount === 0 ? false : "indeterminate",
5492
+ allEnabledChecked
5482
5493
  };
5483
5494
  })
5484
5495
  );
@@ -5498,6 +5509,7 @@ function useDataTableSelectionColumn() {
5498
5509
  selectRows(keys);
5499
5510
  }
5500
5511
  },
5512
+ disabled: allCheckedStatus.allDisabled,
5501
5513
  labelProps: {
5502
5514
  containerProps: { className: prefix("visually-hidden") }
5503
5515
  },
@@ -5659,10 +5671,10 @@ function DataTableEmptyOrLoadingRows({
5659
5671
  emptyMessageProps
5660
5672
  }) {
5661
5673
  const prefix = usePrefix();
5662
- const { showSelectionColumn, renderRow, store, apiRef } = useDataTableContext();
5674
+ const { renderRow, store, apiRef } = useDataTableContext();
5663
5675
  const loading = useStore$1(store, (state) => state.loading);
5664
5676
  const loadingCount = useStore$1(store, (state) => state.loadingCount);
5665
- const numberOfColumns2 = (useTableNumberOfColumns() ?? 1) + (showSelectionColumn ? 1 : 0);
5677
+ const numberOfColumns2 = useTableNumberOfColumns() ?? 1;
5666
5678
  const headCount = useStore$1(store, (state) => state.headCount);
5667
5679
  useImperativeHandle(
5668
5680
  apiRef,
@@ -5683,11 +5695,12 @@ function DataTableEmptyOrLoadingRows({
5683
5695
  }) : /* @__PURE__ */ jsx(TableRow, { "aria-rowindex": headCount + 1, children: /* @__PURE__ */ jsx(
5684
5696
  TableCell,
5685
5697
  {
5698
+ columnIndex: null,
5686
5699
  header: true,
5687
5700
  variant: "data",
5688
5701
  paddingless: false,
5689
5702
  colSpan: numberOfColumns2 === 1 ? void 0 : numberOfColumns2,
5690
- children: !loading && /* @__PURE__ */ jsx(
5703
+ children: /* @__PURE__ */ jsx(
5691
5704
  "div",
5692
5705
  {
5693
5706
  className: cx(
@@ -8552,7 +8565,7 @@ function SelectNative({
8552
8565
  [hasEmptyOption, optionStates]
8553
8566
  );
8554
8567
  const options = useMemo(
8555
- () => optionStates.map(({ value, content, disabled }) => /* @__PURE__ */ jsx("option", { value, disabled, children: content }, value)),
8568
+ () => optionStates.map(({ value, disabled }) => /* @__PURE__ */ jsx("option", { value, disabled }, value)),
8556
8569
  [optionStates]
8557
8570
  );
8558
8571
  return /* @__PURE__ */ jsxs(