@rebasepro/ui 0.8.0 → 0.9.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.
@@ -228,7 +228,7 @@ export type OnVirtualTableColumnResizeParams = {
228
228
  * @see Table
229
229
  * @group Components
230
230
  */
231
- export type WhereFilterOp = "<" | "<=" | "==" | "!=" | ">=" | ">" | "array-contains" | "in" | "not-in" | "array-contains-any";
231
+ export type WhereFilterOp = "<" | "<=" | "==" | "!=" | ">=" | ">" | "array-contains" | "in" | "not-in" | "array-contains-any" | "like" | "ilike" | "not-like" | "not-ilike" | "is-null" | "is-not-null";
232
232
  export type FilterValues<Key extends string> = Partial<Record<Key, [WhereFilterOp, unknown] | [WhereFilterOp, unknown][]>>;
233
233
  /**
234
234
  * @see Table
@@ -1,14 +1,14 @@
1
1
  export interface SelectedCell {
2
2
  columnKey: string;
3
- rowId: string | number;
3
+ id: string | number;
4
4
  cellRect?: DOMRect;
5
5
  width?: number;
6
6
  height?: number;
7
7
  }
8
8
  export declare function createVirtualTableSelectionStore<T extends SelectedCell = SelectedCell>(): {
9
- getSnapshot: () => T | undefined;
9
+ getEntity: () => T | undefined;
10
10
  subscribe: (listener: () => void) => () => void;
11
11
  select: (cell: T | undefined) => void;
12
12
  };
13
13
  export type VirtualTableSelectionStore<T extends SelectedCell = SelectedCell> = ReturnType<typeof createVirtualTableSelectionStore<T>>;
14
- export declare function useVirtualTableCellSelected<T extends SelectedCell = SelectedCell>(store: VirtualTableSelectionStore<T>, columnKey: string, rowId: string | number): boolean;
14
+ export declare function useVirtualTableCellSelected<T extends SelectedCell = SelectedCell>(store: VirtualTableSelectionStore<T>, columnKey: string, id: string | number): boolean;
package/dist/index.es.js CHANGED
@@ -4040,7 +4040,7 @@ var SafeLinkRenderer = ({ text }) => {
4040
4040
  function createVirtualTableSelectionStore() {
4041
4041
  let selectedCell = void 0;
4042
4042
  const listeners = /* @__PURE__ */ new Set();
4043
- function getSnapshot() {
4043
+ function getEntity() {
4044
4044
  return selectedCell;
4045
4045
  }
4046
4046
  function subscribe(listener) {
@@ -4052,27 +4052,27 @@ function createVirtualTableSelectionStore() {
4052
4052
  listeners.forEach((l) => l());
4053
4053
  }
4054
4054
  return {
4055
- getSnapshot,
4055
+ getEntity,
4056
4056
  subscribe,
4057
4057
  select
4058
4058
  };
4059
4059
  }
4060
- function useVirtualTableCellSelected(store, columnKey, rowId) {
4060
+ function useVirtualTableCellSelected(store, columnKey, id) {
4061
4061
  const selectorRef = useRef({
4062
4062
  columnKey,
4063
- rowId
4063
+ id
4064
4064
  });
4065
4065
  selectorRef.current = {
4066
4066
  columnKey,
4067
- rowId
4067
+ id
4068
4068
  };
4069
- const getSnapshot = useCallback(() => {
4070
- const cell = store.getSnapshot();
4069
+ const getEntity = useCallback(() => {
4070
+ const cell = store.getEntity();
4071
4071
  if (!cell) return false;
4072
4072
  const s = selectorRef.current;
4073
- return cell.columnKey === s.columnKey && cell.rowId === s.rowId;
4073
+ return cell.columnKey === s.columnKey && cell.id === s.id;
4074
4074
  }, [store]);
4075
- return useSyncExternalStore(store.subscribe, getSnapshot, getSnapshot);
4075
+ return useSyncExternalStore(store.subscribe, getEntity, getEntity);
4076
4076
  }
4077
4077
  //#endregion
4078
4078
  //#region src/components/VirtualTable/selection/SelectionContext.tsx