@mci-ui/mci-ui 0.0.76 → 0.0.77

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.
@@ -4,12 +4,16 @@ type Options<T extends Record<string, unknown>> = {
4
4
  columns: MciTableColumn<T>[];
5
5
  defaultVisibleKeys?: ColumnKey<T>[];
6
6
  defaultOrder?: ColumnKey<T>[];
7
+ minVisible?: number;
7
8
  };
8
9
  export default function useTableColumnSettings<T extends Record<string, unknown>>(opts: Options<T>): {
10
+ orderedAllColumns: MciTableColumn<T>[];
9
11
  orderedColumns: MciTableColumn<T>[];
10
12
  hiddenKeys: ColumnKey<T>[];
13
+ visibleCount: number;
11
14
  toggleColumn: (key: ColumnKey<T>) => void;
12
15
  moveColumn: (from: number, to: number) => void;
16
+ moveColumnByKey: (fromKey: ColumnKey<T>, toKey: ColumnKey<T>, position?: "before" | "after") => void;
13
17
  reset: () => void;
14
18
  };
15
19
  export {};
@@ -29,6 +29,7 @@ export type MciTableColumnSettingsOptions<T> = {
29
29
  storageKey?: string;
30
30
  defaultVisibleKeys?: ColumnKey<T>[];
31
31
  defaultOrder?: ColumnKey<T>[];
32
+ minVisible?: number;
32
33
  onChange?: (state: MciTableColumnSettingsState<T>) => void;
33
34
  };
34
35
  export interface MciTableProps<T extends Record<string, unknown>> {
@@ -1,4 +1,5 @@
1
1
  import { ColumnKey, MciTableColumn } from '../../types/mci-table.types.ts';
2
+ type DropPosition = 'before' | 'after';
2
3
  type Props<T extends Record<string, unknown>> = {
3
4
  open: boolean;
4
5
  onClose: () => void;
@@ -6,7 +7,8 @@ type Props<T extends Record<string, unknown>> = {
6
7
  hidden: ColumnKey<T>[];
7
8
  onToggle: (key: ColumnKey<T>) => void;
8
9
  onMove: (from: number, to: number) => void;
10
+ onMoveByKey?: (from: ColumnKey<T>, to: ColumnKey<T>, position: DropPosition) => void;
9
11
  minVisible?: number;
10
12
  };
11
- export default function MciTableColumnsPanel<T extends Record<string, unknown>>({ open, onClose, columns, hidden, onToggle, onMove, minVisible, }: Props<T>): import("react/jsx-runtime").JSX.Element | null;
13
+ export default function MciTableColumnsPanel<T extends Record<string, unknown>>({ open, onClose, columns, hidden, onToggle, onMove, onMoveByKey, minVisible, }: Props<T>): import("react/jsx-runtime").JSX.Element | null;
12
14
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mci-ui/mci-ui",
3
3
  "private": false,
4
- "version": "0.0.76",
4
+ "version": "0.0.77",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.js",
7
7
  "module": "./dist/index.es.js",