@gridui/data-explorer 1.0.4 → 1.2.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/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/data-explorer/model.ts", "../src/data-explorer/style.ts", "../src/data-explorer/data-explorer.tsx"],
4
- "sourcesContent": ["/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorer\n * @description Model\n */\n\nexport type DataExplorerValue = string | number | null;\n\nexport type DataExplorerRow = {\n readonly id: string;\n readonly values: Readonly<Record<string, DataExplorerValue>>;\n};\n\nexport type DataExplorerColumn = {\n readonly key: string;\n readonly label: string;\n readonly numeric?: boolean;\n};\n\nexport type DataExplorerState = {\n readonly query: string;\n readonly filterValue: string;\n readonly sort: {\n readonly key: string;\n readonly direction: \"ascending\" | \"descending\";\n } | null;\n readonly page: number;\n};\n\nexport type DataExplorerFilter = {\n readonly key: string;\n readonly label: string;\n readonly options: readonly {\n readonly value: string;\n readonly label: string;\n }[];\n};\n\nconst compareValues = (\n left: DataExplorerValue | undefined,\n right: DataExplorerValue | undefined,\n direction: \"ascending\" | \"descending\",\n): number => {\n // Missing values stay last in either direction; equal values preserve input order.\n if (left === null || left === undefined) {\n return right === null || right === undefined ? 0 : 1;\n }\n if (right === null || right === undefined) {\n return -1;\n }\n let comparison = 0;\n if (typeof left === \"number\" && typeof right === \"number\") {\n comparison = left - right;\n } else if (String(left) < String(right)) {\n comparison = -1;\n } else if (String(left) > String(right)) {\n comparison = 1;\n }\n return direction === \"ascending\" ? comparison : -comparison;\n};\n\nexport const selectExplorerRows = (\n rows: readonly DataExplorerRow[],\n columns: readonly DataExplorerColumn[],\n state: DataExplorerState,\n pageSize: number,\n filter?: DataExplorerFilter,\n) => {\n const validPageSize = Number.isInteger(pageSize) && pageSize > 0;\n const validPage = Number.isInteger(state.page) && state.page >= 0;\n if (!validPageSize || !validPage) {\n throw new RangeError(\"DataExplorer needs a positive integer pageSize and a non-negative integer page.\");\n }\n const rowIds = rows.map(row => {\n return row.id;\n });\n const columnKeys = columns.map(column => {\n return column.key;\n });\n const hasDuplicateRows = new Set(rowIds).size !== rows.length;\n const hasDuplicateColumns = new Set(columnKeys).size !== columns.length;\n if (hasDuplicateRows || hasDuplicateColumns) {\n throw new Error(\"DataExplorer row ids and column keys must be unique.\");\n }\n const query = state.query.trim().toLowerCase();\n const filtered = rows.filter(row => {\n const matchesQuery = !query || columns.some(column => {\n const cellText = String(row.values[column.key] ?? \"\").toLowerCase();\n return cellText.includes(query);\n });\n const matchesFilter = !filter || !state.filterValue\n || String(row.values[filter.key] ?? \"\") === state.filterValue;\n return matchesQuery && matchesFilter;\n });\n const sort = state.sort;\n if (sort && columnKeys.includes(sort.key)) {\n filtered.sort((left, right) => {\n return compareValues(left.values[sort.key], right.values[sort.key], sort.direction);\n });\n }\n const pageCount = Math.max(1, Math.ceil(filtered.length / pageSize));\n const page = Math.min(state.page, pageCount - 1);\n return {\n rows: filtered.slice(page * pageSize, (page + 1) * pageSize),\n total: filtered.length,\n page,\n pageCount,\n };\n};\n\nexport const selectExplorerPage = (\n selectedIds: readonly string[],\n pageIds: readonly string[],\n checked: boolean,\n): string[] => {\n const selected = new Set(selectedIds);\n for (const id of pageIds) {\n if (checked) {\n selected.add(id);\n } else {\n selected.delete(id);\n }\n }\n return [...selected];\n};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorer\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const explorerStyles = cva(\"gridui-u-min-w-0 gridui-u-border gridui-u-border-border gridui-u-bg-background gridui-u-text-foreground\");\n\nexport const explorerToolbarStyles = cva(\"gridui-u-flex gridui-u-min-w-0 gridui-u-flex-wrap gridui-u-items-end gridui-u-gap-gridui-16 gridui-u-p-gridui-16 gridui-u-[&_label]:min-h-11\");\n\nexport const explorerLabelStyles = cva(\"gridui-u-flex gridui-u-min-w-0 gridui-u-flex-[1_1_10rem] gridui-u-flex-col gridui-u-gap-gridui-4 gridui-u-text-muted gridui-u-type-caption\");\n\nexport const explorerFooterStyles = cva(\"gridui-u-flex gridui-u-flex-wrap gridui-u-items-center gridui-u-justify-between gridui-u-gap-gridui-8 gridui-u-p-gridui-16\");\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorer\n * @description Data Explorer\n */\n\nimport { type DataExplorerColumn, type DataExplorerFilter, type DataExplorerRow, type DataExplorerState, type DataExplorerValue, selectExplorerPage, selectExplorerRows } from \"./model\";\nimport { explorerFooterStyles, explorerLabelStyles, explorerStyles, explorerToolbarStyles } from \"./style\";\nimport { Button } from \"@gridui/button\";\nimport { Checkbox } from \"@gridui/choice\";\nimport { Split } from \"@gridui/grid\";\nimport { Input } from \"@gridui/input\";\nimport { Select } from \"@gridui/select\";\nimport { cn } from \"@gridui/style-utils\";\nimport { DataTable } from \"@gridui/table\";\nimport { Children, type ComponentPropsWithRef, type FC, type ReactNode } from \"react\";\n\nexport type DataExplorerProps = Omit<ComponentPropsWithRef<\"section\">, \"children\"> & {\n readonly rows: readonly DataExplorerRow[];\n readonly columns: readonly DataExplorerColumn[];\n readonly state: DataExplorerState;\n readonly onStateChange: (state: DataExplorerState) => void;\n readonly filter?: DataExplorerFilter;\n readonly pageSize?: number;\n readonly selectedIds?: readonly string[];\n readonly onSelectionChange?: (ids: readonly string[]) => void;\n readonly actions?: readonly {\n readonly label: string;\n readonly onAction: (ids: readonly string[]) => void;\n readonly disabled?: boolean;\n }[];\n readonly renderCell?: (\n value: DataExplorerValue | undefined,\n row: DataExplorerRow,\n column: DataExplorerColumn,\n ) => ReactNode;\n readonly busy?: boolean;\n readonly notice?: ReactNode;\n readonly labels: {\n readonly table: string;\n readonly search: string;\n readonly sort: string;\n readonly unsorted: string;\n readonly ascending: string;\n readonly descending: string;\n readonly all: string;\n readonly selection: string;\n readonly selectPage: string;\n readonly selectRow: (row: DataExplorerRow) => string;\n readonly selected: (count: number) => string;\n readonly previous: string;\n readonly next: string;\n readonly page: (page: number, pages: number, total: number) => string;\n readonly empty: string;\n };\n};\n\nexport const DataExplorer: FC<DataExplorerProps> = (props: DataExplorerProps) => {\n const {\n rows,\n columns,\n state,\n onStateChange,\n filter,\n pageSize = 10,\n selectedIds = [],\n onSelectionChange,\n actions = [],\n renderCell,\n busy = false,\n notice,\n labels,\n className,\n ...restProps\n } = props;\n const hasNotice = Children.toArray(notice).some(child => {\n return child !== \"\";\n });\n const view = selectExplorerRows(rows, columns, state, pageSize, filter);\n const existingRowIds = new Set(rows.map(row => {\n return row.id;\n }));\n const selectedRowIds = [...new Set(selectedIds)].filter(id => {\n return existingRowIds.has(id);\n });\n const pageIds = view.rows.map(row => {\n return row.id;\n });\n const selectedPageCount = pageIds.filter(id => {\n return selectedRowIds.includes(id);\n }).length;\n const updateState = (changes: Partial<DataExplorerState>) => {\n if (!busy) {\n onStateChange({\n ...state,\n ...changes,\n });\n }\n };\n const tableColumns = columns.map(column => {\n return {\n label: column.label,\n ...(column.numeric !== undefined ? { numeric: column.numeric } : {}),\n };\n });\n if (onSelectionChange) {\n tableColumns.unshift({ label: labels.selection });\n }\n const tableRows = view.rows.map(row => {\n const cells = columns.map(column => {\n const value = row.values[column.key];\n if (renderCell) {\n return renderCell(value, row, column);\n }\n return value ?? \"\";\n });\n if (onSelectionChange) {\n cells.unshift((<Checkbox\n key=\"select\"\n aria-label={labels.selectRow(row)}\n checked={selectedRowIds.includes(row.id)}\n disabled={busy}\n onCheckedChange={checked => {\n const nextSelection = selectExplorerPage(selectedRowIds, [row.id], checked);\n onSelectionChange(nextSelection);\n }}\n />));\n }\n return cells;\n });\n return (<section\n {...restProps}\n aria-label={labels.table}\n className={cn(explorerStyles(), className)}\n >\n <Split\n direction=\"column\"\n >\n <div\n className={explorerToolbarStyles()}\n >\n <label\n className={explorerLabelStyles()}\n >\n {labels.search}\n <Input\n type=\"search\"\n value={state.query}\n disabled={busy}\n onValueChange={query => {\n updateState({\n query,\n page: 0,\n });\n }}\n />\n </label>\n {filter && (<label\n className={explorerLabelStyles()}\n >\n {filter.label}\n <Select\n aria-label={filter.label}\n value={state.filterValue}\n disabled={busy}\n options={[\n {\n value: \"\",\n label: labels.all,\n },\n ...filter.options,\n ]}\n onValueChange={filterValue => {\n updateState({\n filterValue,\n page: 0,\n });\n }}\n />\n </label>)}\n <label\n className={explorerLabelStyles()}\n >\n {labels.sort}\n <Select\n aria-label={labels.sort}\n value={state.sort?.key ?? \"\"}\n disabled={busy}\n options={[\n {\n value: \"\",\n label: labels.unsorted,\n },\n ...columns.map(column => {\n return {\n value: column.key,\n label: column.label,\n };\n }),\n ]}\n onValueChange={key => {\n updateState({\n sort: key ? {\n key,\n direction: \"ascending\",\n } : null,\n page: 0,\n });\n }}\n />\n </label>\n <Button\n variant=\"secondary\"\n disabled={busy || !state.sort}\n onClick={() => {\n if (state.sort) {\n updateState({\n sort: {\n ...state.sort,\n direction: state.sort.direction === \"ascending\" ? \"descending\" : \"ascending\",\n },\n page: 0,\n });\n }\n }}\n >\n {state.sort?.direction === \"descending\" ? labels.descending : labels.ascending}\n </Button>\n </div>\n {onSelectionChange && (<div\n className={explorerToolbarStyles()}\n >\n <label>\n <Checkbox\n checked={pageIds.length > 0 && selectedPageCount === pageIds.length}\n indeterminate={selectedPageCount > 0 && selectedPageCount < pageIds.length}\n disabled={busy || pageIds.length === 0}\n onCheckedChange={checked => {\n onSelectionChange(selectExplorerPage(selectedRowIds, pageIds, checked));\n }}\n />\n {\" \"}\n {labels.selectPage}\n </label>\n <span\n role=\"status\"\n >\n {labels.selected(selectedRowIds.length)}\n </span>\n {actions.map(action => {\n return (<Button\n key={action.label}\n variant=\"secondary\"\n disabled={busy || selectedRowIds.length === 0 || action.disabled}\n onClick={() => {\n action.onAction(selectedRowIds);\n }}\n >\n {action.label}\n </Button>);\n })}\n </div>)}\n {hasNotice && (<div>\n {notice}\n </div>)}\n <Split\n direction=\"column\"\n aria-busy={busy}\n >\n <div>\n <DataTable\n label={labels.table}\n variant=\"structured\"\n blockEdges=\"none\"\n inlineEdges=\"none\"\n columns={tableColumns}\n rows={tableRows}\n rowKeys={pageIds}\n />\n </div>\n {view.rows.length === 0 && !busy && (<div>\n <p\n className=\"gridui-u-m-0 gridui-u-p-gridui-16\"\n >\n {labels.empty}\n </p>\n </div>)}\n </Split>\n <div\n className={explorerFooterStyles()}\n >\n <Button\n variant=\"secondary\"\n disabled={busy || view.page === 0}\n onClick={() => {\n updateState({ page: view.page - 1 });\n }}\n >\n {labels.previous}\n </Button>\n <span\n role=\"status\"\n >\n {labels.page(view.page + 1, view.pageCount, view.total)}\n </span>\n <Button\n variant=\"secondary\"\n disabled={busy || view.page + 1 >= view.pageCount}\n onClick={() => {\n updateState({ page: view.page + 1 });\n }}\n >\n {labels.next}\n </Button>\n </div>\n </Split>\n </section>);\n};\n"],
5
- "mappings": ";AAuCA,IAAM,gBAAgB,CAClB,MACA,OACA,cACS;AAET,MAAI,SAAS,QAAQ,SAAS,QAAW;AACrC,WAAO,UAAU,QAAQ,UAAU,SAAY,IAAI;AAAA,EACvD;AACA,MAAI,UAAU,QAAQ,UAAU,QAAW;AACvC,WAAO;AAAA,EACX;AACA,MAAI,aAAa;AACjB,MAAI,OAAO,SAAS,YAAY,OAAO,UAAU,UAAU;AACvD,iBAAa,OAAO;AAAA,EACxB,WAAW,OAAO,IAAI,IAAI,OAAO,KAAK,GAAG;AACrC,iBAAa;AAAA,EACjB,WAAW,OAAO,IAAI,IAAI,OAAO,KAAK,GAAG;AACrC,iBAAa;AAAA,EACjB;AACA,SAAO,cAAc,cAAc,aAAa,CAAC;AACrD;AAEO,IAAM,qBAAqB,CAC9B,MACA,SACA,OACA,UACA,WACC;AACD,QAAM,gBAAgB,OAAO,UAAU,QAAQ,KAAK,WAAW;AAC/D,QAAM,YAAY,OAAO,UAAU,MAAM,IAAI,KAAK,MAAM,QAAQ;AAChE,MAAI,CAAC,iBAAiB,CAAC,WAAW;AAC9B,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,kBAC1D;AAAA,kBACA;AAAA,oBAAC;AAAA;AAAA,sBACG,SAAQ;AAAA,sBACR,UAAU,QAAQ,KAAK,OAAO,KAAK,KAAK;AAAA,sBACxC,SAAS,MAAM;AACX,oCAAY,EAAE,MAAM,KAAK,OAAO,EAAE,CAAC;AAAA,sBACvC;AAAA,sBAEC,iBAAO;AAAA;AAAA,kBACZ;AAAA;AAAA;AAAA,YACJ;AAAA;AAAA;AAAA,MACJ;AAAA;AAAA,EACJ;AACJ;",
6
- "names": []
3
+ "sources": ["../src/shared/control-row-style.ts", "../src/shared/model.ts", "../src/shared/explorer-context.ts", "../src/data-explorer-bulk-actions/data-explorer-bulk-actions.tsx", "../src/data-explorer-pagination/data-explorer-pagination.tsx", "../src/data-explorer-table/column-resize-handle.tsx", "../src/data-explorer-table/data-explorer-table.tsx", "../src/data-explorer-toolbar/style.ts", "../src/data-explorer-toolbar/filter-editor.tsx", "../src/data-explorer-toolbar/data-explorer-toolbar.tsx", "../src/data-explorer/style.ts", "../src/data-explorer/data-explorer.tsx"],
4
+ "sourcesContent": ["/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace Shared\n * @description Control Row Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const explorerControlRowStyles = cva(\"gridui-u-flex gridui-u-min-w-0 gridui-u-flex-wrap gridui-u-items-end gridui-u-gap-gridui-16 gridui-u-p-gridui-16 gridui-u-[&_label]:min-h-11\");\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace Shared\n * @description Model\n */\n\nexport type DataExplorerValue = string | number | null;\n\nexport type DataExplorerRow = {\n readonly id: string;\n readonly values: Readonly<Record<string, DataExplorerValue>>;\n};\n\nexport type DataExplorerColumn = {\n readonly key: string;\n readonly label: string;\n readonly numeric?: boolean;\n readonly width?: number;\n readonly minWidth?: number;\n readonly maxWidth?: number;\n readonly sticky?: \"start\" | \"end\";\n};\n\nexport type DataExplorerState = {\n readonly query: string;\n readonly filterValue: string;\n readonly sort: {\n readonly key: string;\n readonly direction: \"ascending\" | \"descending\";\n } | null;\n readonly page: number;\n readonly filters?: readonly DataExplorerCondition[];\n};\n\nexport type DataExplorerFilter = {\n readonly key: string;\n readonly label: string;\n readonly options: readonly {\n readonly value: string;\n readonly label: string;\n }[];\n};\n\nconst compareValues = (\n left: DataExplorerValue | undefined,\n right: DataExplorerValue | undefined,\n direction: \"ascending\" | \"descending\",\n): number => {\n // Missing values stay last in either direction; equal values preserve input order.\n if (left === null || left === undefined) {\n return right === null || right === undefined ? 0 : 1;\n }\n if (right === null || right === undefined) {\n return -1;\n }\n let comparison = 0;\n if (typeof left === \"number\" && typeof right === \"number\") {\n comparison = left - right;\n } else if (String(left) < String(right)) {\n comparison = -1;\n } else if (String(left) > String(right)) {\n comparison = 1;\n }\n return direction === \"ascending\" ? comparison : -comparison;\n};\n\nexport const selectExplorerRows = (\n rows: readonly DataExplorerRow[],\n columns: readonly DataExplorerColumn[],\n state: DataExplorerState,\n pageSize: number,\n filter?: DataExplorerFilter,\n) => {\n const validPageSize = Number.isInteger(pageSize) && pageSize > 0;\n const validPage = Number.isInteger(state.page) && state.page >= 0;\n if (!validPageSize || !validPage) {\n throw new RangeError(\"DataExplorer needs a positive integer pageSize and a non-negative integer page.\");\n }\n const rowIds = rows.map(row => {\n return row.id;\n });\n const columnKeys = columns.map(column => {\n return column.key;\n });\n const hasDuplicateRows = new Set(rowIds).size !== rows.length;\n const hasDuplicateColumns = new Set(columnKeys).size !== columns.length;\n if (hasDuplicateRows || hasDuplicateColumns) {\n throw new Error(\"DataExplorer row ids and column keys must be unique.\");\n }\n const query = state.query.trim().toLowerCase();\n const filtered = rows.filter(row => {\n const matchesQuery = !query || columns.some(column => {\n const cellText = String(row.values[column.key] ?? \"\").toLowerCase();\n return cellText.includes(query);\n });\n const matchesFilter = !filter || !state.filterValue\n || String(row.values[filter.key] ?? \"\") === state.filterValue;\n return matchesQuery && matchesFilter && (state.filters ?? []).every(condition => {\n return matchesExplorerCondition(row, condition);\n });\n });\n const sort = state.sort;\n if (sort && columnKeys.includes(sort.key)) {\n filtered.sort((left, right) => {\n return compareValues(left.values[sort.key], right.values[sort.key], sort.direction);\n });\n }\n const pageCount = Math.max(1, Math.ceil(filtered.length / pageSize));\n const page = Math.min(state.page, pageCount - 1);\n return {\n rows: filtered.slice(page * pageSize, (page + 1) * pageSize),\n total: filtered.length,\n page,\n pageCount,\n };\n};\n\nexport const selectExplorerPage = (\n selectedIds: readonly string[],\n pageIds: readonly string[],\n checked: boolean,\n): string[] => {\n const selected = new Set(selectedIds);\n for (const id of pageIds) {\n if (checked) {\n selected.add(id);\n } else {\n selected.delete(id);\n }\n }\n return [...selected];\n};\n\nexport type DataExplorerFilterOperator = \"contains\" | \"equals\" | \"not-equals\" | \"greater-than\" | \"less-than\" | \"empty\";\n\nexport type DataExplorerCondition = {\n readonly id: string;\n readonly key: string;\n readonly operator: DataExplorerFilterOperator;\n readonly value?: string | number;\n};\n\nexport type DataExplorerFilterDefinition = {\n readonly key: string;\n readonly label: string;\n readonly type: \"text\" | \"number\" | \"enum\";\n readonly options?: readonly {\n readonly value: string;\n readonly label: string;\n }[];\n};\n\nexport const matchesExplorerCondition = (row: DataExplorerRow, condition: DataExplorerCondition): boolean => {\n const value = row.values[condition.key];\n if (condition.operator === \"empty\") {\n return value === null || value === undefined || value === \"\";\n }\n if (condition.value === undefined || condition.value === \"\") {\n return true;\n }\n if (condition.operator === \"contains\") {\n return String(value ?? \"\").normalize(\"NFKC\")\n .toLowerCase()\n .includes(String(condition.value).normalize(\"NFKC\")\n .toLowerCase());\n }\n if (condition.operator === \"equals\") {\n return value === condition.value;\n }\n if (condition.operator === \"not-equals\") {\n return value !== condition.value;\n }\n if (typeof condition.value !== \"number\" || !Number.isFinite(condition.value)) {\n throw new RangeError(\"Numeric filter comparisons require a finite numeric value.\");\n }\n if (typeof value !== \"number\" || !Number.isFinite(value)) {\n return false;\n }\n return condition.operator === \"greater-than\" ? value > condition.value : value < condition.value;\n};\n\nexport const resolveExplorerWidth = (column: DataExplorerColumn, width = column.width ?? 200): number => {\n const min = column.minWidth ?? 80;\n const max = column.maxWidth ?? 1200;\n if (![\n width,\n min,\n max,\n ].every(value => {\n return Number.isFinite(value) && value > 0;\n }) || max < min) {\n throw new RangeError(\"Explorer column widths must be positive and finite with ordered bounds.\");\n }\n return Math.max(min, Math.min(max, width));\n};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace Shared\n * @description Explorer Context\n */\n\nimport type { ExplorerOptions } from \"./explorer-options\";\nimport { type DataExplorerState, selectExplorerRows } from \"./model\";\nimport { createContext, useContext, useId } from \"react\";\n\nexport const useExplorerController = (options: ExplorerOptions) => {\n const { rows, columns, state, onStateChange, filter, pageSize = 10, selectedIds = [], busy = false, columnSettings } = options;\n const tableId = useId();\n const view = selectExplorerRows(rows, columns, state, pageSize, filter);\n const existingRowIds = new Set(rows.map(row => {\n return row.id;\n }));\n const selectedRowIds = [...new Set(selectedIds)].filter(id => {\n return existingRowIds.has(id);\n });\n const pageIds = view.rows.map(row => {\n return row.id;\n });\n const selectedPageCount = pageIds.filter(id => {\n return selectedRowIds.includes(id);\n }).length;\n const updateState = (changes: Partial<DataExplorerState>) => {\n if (!busy) {\n onStateChange({\n ...state,\n ...changes,\n });\n }\n };\n const visibleColumns = columns.filter(column => {\n return !columnSettings?.hiddenKeys.includes(column.key);\n });\n if (columns.length > 0 && visibleColumns.length === 0) {\n throw new RangeError(\"DataExplorer needs at least one visible column.\");\n }\n\n return {\n ...options,\n busy,\n tableId,\n view,\n selectedRowIds,\n pageIds,\n selectedPageCount,\n updateState,\n visibleColumns,\n };\n};\n\nexport const explorerContext = createContext<ReturnType<typeof useExplorerController> | null>(null);\n\nexport const useExplorer = () => {\n const explorer = useContext(explorerContext);\n if (!explorer) {\n throw new Error(\"DataExplorer parts require a DataExplorer.\");\n }\n return explorer;\n};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorerBulkActions\n * @description Data Explorer Bulk Actions\n */\n\nimport { explorerControlRowStyles } from \"../shared/control-row-style\";\nimport { useExplorer } from \"../shared/explorer-context\";\nimport type { ExplorerPartOptions } from \"../shared/explorer-options\";\nimport { selectExplorerPage } from \"../shared/model\";\nimport { Button } from \"@gridui/button\";\nimport { Checkbox } from \"@gridui/choice\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { FC } from \"react\";\n\nexport type DataExplorerBulkActionsProps = ExplorerPartOptions;\n\nexport const DataExplorerBulkActions: FC<DataExplorerBulkActionsProps> = (props: DataExplorerBulkActionsProps) => {\n const { actions = [], busy, labels, onSelectionChange, pageIds, selectedPageCount, selectedRowIds } = useExplorer();\n if (!onSelectionChange) {\n return null;\n }\n return (<div\n className={cn(explorerControlRowStyles(), props.className)}\n >\n <label>\n <Checkbox\n checked={pageIds.length > 0 && selectedPageCount === pageIds.length}\n indeterminate={selectedPageCount > 0 && selectedPageCount < pageIds.length}\n disabled={busy || pageIds.length === 0}\n onCheckedChange={checked => {\n onSelectionChange(selectExplorerPage(selectedRowIds, pageIds, checked));\n }}\n />\n {\" \"}\n {labels.selectPage}\n </label>\n <span\n role=\"status\"\n >\n {labels.selected(selectedRowIds.length)}\n </span>\n {actions.map(action => {\n return (<Button\n key={action.label}\n variant=\"secondary\"\n disabled={busy || selectedRowIds.length === 0 || action.disabled}\n onClick={() => {\n action.onAction(selectedRowIds);\n }}\n >\n {action.label}\n </Button>);\n })}\n </div>);\n};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorerPagination\n * @description Data Explorer Pagination\n */\n\nimport { useExplorer } from \"../shared/explorer-context\";\nimport type { ExplorerPartOptions } from \"../shared/explorer-options\";\nimport { Button } from \"@gridui/button\";\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\nimport type { FC } from \"react\";\n\nexport type DataExplorerPaginationProps = ExplorerPartOptions;\n\nconst explorerFooterStyles = cva(\"gridui-u-flex gridui-u-flex-wrap gridui-u-items-center gridui-u-justify-between gridui-u-gap-gridui-8 gridui-u-p-gridui-16\");\n\nexport const DataExplorerPagination: FC<DataExplorerPaginationProps> = (props: DataExplorerPaginationProps) => {\n const { busy, labels, updateState, view } = useExplorer();\n return (<div\n className={cn(explorerFooterStyles(), props.className)}\n >\n <Button\n variant=\"secondary\"\n disabled={busy || view.page === 0}\n onClick={() => {\n updateState({ page: view.page - 1 });\n }}\n >\n {labels.previous}\n </Button>\n <span\n role=\"status\"\n >\n {labels.page(view.page + 1, view.pageCount, view.total)}\n </span>\n <Button\n variant=\"secondary\"\n disabled={busy || view.page + 1 >= view.pageCount}\n onClick={() => {\n updateState({ page: view.page + 1 });\n }}\n >\n {labels.next}\n </Button>\n </div>);\n};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorerTable\n * @description Column Resize Handle\n */\n\nimport { type DataExplorerColumn, resolveExplorerWidth } from \"../shared/model\";\nimport { isComposingKeyEvent, listenForDragCancellation } from \"@gridui/interaction\";\nimport { type FC, useEffect, useLayoutEffect, useRef } from \"react\";\n\nexport type ColumnResizeHandleProps = {\n readonly column: DataExplorerColumn;\n readonly width: number;\n readonly label: string;\n readonly disabled: boolean;\n readonly onChange: (width: number) => void;\n};\n\nexport const ColumnResizeHandle: FC<ColumnResizeHandleProps> = (props: ColumnResizeHandleProps) => {\n const { column, width, label, disabled, onChange } = props;\n const handle = useRef<HTMLDivElement>(null);\n const drag = useRef<{\n readonly pointer: number;\n readonly x: number;\n readonly width: number;\n readonly direction: number;\n readonly cleanup: () => void;\n } | null>(null);\n const min = column.minWidth ?? 80;\n const max = column.maxWidth ?? 1200;\n const change = (next: number) => {\n onChange(resolveExplorerWidth(column, Math.max(min, Math.min(max, next))));\n };\n const cancelDrag = () => {\n const current = drag.current;\n drag.current = null;\n if (current) {\n current.cleanup();\n change(current.width);\n if (handle.current?.hasPointerCapture(current.pointer)) {\n handle.current.releasePointerCapture(current.pointer);\n }\n }\n };\n const cancelLatest = useRef(cancelDrag);\n useLayoutEffect(() => {\n cancelLatest.current = cancelDrag;\n });\n useEffect(() => {\n if (disabled) {\n cancelLatest.current();\n }\n }, [disabled]);\n useEffect(() => {\n const element = handle.current;\n return () => {\n const current = drag.current;\n drag.current = null;\n current?.cleanup();\n if (current && element?.hasPointerCapture(current.pointer)) {\n element.releasePointerCapture(current.pointer);\n }\n };\n }, []);\n return (<div\n ref={handle}\n role=\"separator\"\n tabIndex={disabled ? -1 : 0}\n aria-orientation=\"vertical\"\n aria-label={label}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={width}\n aria-disabled={disabled || undefined}\n className=\"gridui-explorer-resize gridui-u-min-h-11 gridui-u-w-gridui-16 gridui-u-shrink-0 gridui-u-cursor-col-resize gridui-u-touch-none gridui-u-border-s gridui-u-border-solid gridui-u-border-border\"\n onPointerDown={(event) => {\n if (disabled || event.button !== 0 || !event.isPrimary || drag.current) {\n return;\n }\n event.preventDefault();\n event.currentTarget.focus();\n drag.current = {\n pointer: event.pointerId,\n x: event.clientX,\n width,\n direction: getComputedStyle(event.currentTarget).direction === \"rtl\" ? -1 : 1,\n cleanup: listenForDragCancellation(event.currentTarget, () => {\n cancelLatest.current();\n }),\n };\n event.currentTarget.setPointerCapture(event.pointerId);\n }}\n onPointerMove={(event) => {\n const current = drag.current;\n if (!disabled && current?.pointer === event.pointerId) {\n change(current.width + (event.clientX - current.x) * current.direction);\n }\n }}\n onPointerUp={(event) => {\n if (drag.current?.pointer === event.pointerId) {\n const current = drag.current;\n drag.current = null;\n current.cleanup();\n if (event.currentTarget.hasPointerCapture(event.pointerId)) {\n event.currentTarget.releasePointerCapture(event.pointerId);\n }\n }\n }}\n onPointerCancel={(event) => {\n if (drag.current?.pointer === event.pointerId) {\n cancelDrag();\n }\n }}\n onLostPointerCapture={(event) => {\n if (drag.current?.pointer === event.pointerId) {\n cancelDrag();\n }\n }}\n onKeyDown={(event) => {\n if (disabled || isComposingKeyEvent(event.nativeEvent) || ![\n \"ArrowLeft\",\n \"ArrowRight\",\n \"Home\",\n \"End\",\n ].includes(event.key)) {\n return;\n }\n event.preventDefault();\n const direction = getComputedStyle(event.currentTarget).direction === \"rtl\" ? -1 : 1;\n const step = (event.shiftKey ? 50 : 10) * direction;\n let next = width + (event.key === \"ArrowRight\" ? step : -step);\n if (event.key === \"Home\") {\n next = min;\n }\n if (event.key === \"End\") {\n next = max;\n }\n change(next);\n }}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorerTable\n * @description Data Explorer Table\n */\n\nimport { useExplorer } from \"../shared/explorer-context\";\nimport type { ExplorerPartOptions } from \"../shared/explorer-options\";\nimport { type DataExplorerRow, resolveExplorerWidth, selectExplorerPage } from \"../shared/model\";\nimport { ColumnResizeHandle } from \"./column-resize-handle\";\nimport { Button } from \"@gridui/button\";\nimport { Checkbox } from \"@gridui/choice\";\nimport { Split } from \"@gridui/grid\";\nimport { cn } from \"@gridui/style-utils\";\nimport { DataTable, type DataTableColumn } from \"@gridui/table\";\nimport { Children, type FC } from \"react\";\n\nexport type DataExplorerTableProps = ExplorerPartOptions;\n\nexport const DataExplorerTable: FC<DataExplorerTableProps> = (props: DataExplorerTableProps) => {\n const { busy, columnSizing, details, labels, notice, onSelectionChange, renderCell, selectedRowIds, tableId, view, visibleColumns } = useExplorer();\n const hasNotice = Children.toArray(notice).some(child => {\n return child !== \"\";\n });\n const fixedWidths = columnSizing !== undefined || visibleColumns.some(column => {\n return column.width !== undefined || column.sticky !== undefined;\n });\n const widths = visibleColumns.map(column => {\n return resolveExplorerWidth(column, columnSizing?.widths[column.key] ?? column.width);\n });\n const tableColumns: DataTableColumn[] = visibleColumns.map((column, index) => {\n const width = widths[index]!;\n const stickyOffset = visibleColumns.reduce((offset, current, currentIndex) => {\n return current.sticky === column.sticky && (column.sticky === \"start\" ? currentIndex < index : currentIndex > index) ? offset + widths[currentIndex]! : offset;\n }, 0);\n return {\n key: `column:${column.key}`,\n label: column.label,\n ...(column.numeric !== undefined ? { numeric: column.numeric } : {}),\n ...(fixedWidths ? {\n sizing: {\n width,\n minWidth: width,\n maxWidth: width,\n },\n } : {}),\n ...(column.sticky ? {\n sticky: column.sticky,\n stickyOffset,\n } : {}),\n ...(columnSizing ? {\n header: (<div\n className=\"gridui-u-flex gridui-u-min-w-0 gridui-u-items-center gridui-u-justify-between gridui-u-gap-gridui-8\"\n >\n <span>\n {column.label}\n </span>\n <ColumnResizeHandle\n column={column}\n width={width}\n label={columnSizing.resizeLabel(column)}\n disabled={busy}\n onChange={(nextWidth) => {\n columnSizing.onWidthsChange({\n ...columnSizing.widths,\n [column.key]: nextWidth,\n });\n }}\n />\n </div>),\n } : {}),\n };\n });\n if (onSelectionChange) {\n tableColumns.unshift({\n key: \"control:selection\",\n label: labels.selection,\n ...(fixedWidths ? { sizing: { width: 56 } } : {}),\n });\n }\n if (details) {\n tableColumns.unshift({\n key: \"control:details\",\n label: details.columnLabel,\n ...(fixedWidths ? { sizing: { width: 96 } } : {}),\n });\n }\n const tableWidth = widths.reduce((total, width) => {\n return total + width;\n }, 0) + (onSelectionChange ? 56 : 0) + (details ? 96 : 0);\n const detailId = (row: DataExplorerRow) => {\n return `${tableId}-details-${encodeURIComponent(row.id)}`;\n };\n const tableRows = view.rows.map(row => {\n const cells = visibleColumns.map(column => {\n const value = row.values[column.key];\n if (renderCell) {\n return renderCell(value, row, column);\n }\n return value ?? \"\";\n });\n if (onSelectionChange) {\n cells.unshift((<Checkbox\n key=\"select\"\n aria-label={labels.selectRow(row)}\n checked={selectedRowIds.includes(row.id)}\n disabled={busy}\n onCheckedChange={checked => {\n const nextSelection = selectExplorerPage(selectedRowIds, [row.id], checked);\n onSelectionChange(nextSelection);\n }}\n />));\n }\n if (details) {\n const expanded = details.expandedIds.includes(row.id);\n cells.unshift((<Button\n key=\"details\"\n variant=\"quiet\"\n disabled={busy}\n aria-expanded={expanded}\n aria-controls={expanded ? detailId(row) : undefined}\n onClick={() => {\n details.onExpandedIdsChange(expanded ? details.expandedIds.filter(key => {\n return key !== row.id;\n }) : [\n ...new Set([\n ...details.expandedIds,\n row.id,\n ]),\n ]);\n }}\n >\n {expanded ? details.collapseLabel(row) : details.expandLabel(row)}\n </Button>));\n }\n const detail = details?.expandedIds.includes(row.id) ? {\n id: detailId(row),\n content: details.render(row),\n } : undefined;\n return {\n key: row.id,\n cells,\n ...(detail ? { detail } : {}),\n };\n });\n return (<>\n {hasNotice && (<div>\n {notice}\n </div>)}\n <Split\n direction=\"column\"\n aria-busy={busy}\n className={cn(props.className)}\n >\n <div>\n <DataTable\n label={labels.table}\n variant=\"structured\"\n blockEdges=\"none\"\n inlineEdges=\"none\"\n columns={tableColumns}\n rows={tableRows}\n {...(fixedWidths ? {\n style: {\n width: tableWidth,\n tableLayout: \"fixed\" as const,\n },\n minWidth: tableWidth,\n } : {})}\n />\n </div>\n {view.rows.length === 0 && !busy && (<div>\n <p\n className=\"gridui-u-m-0 gridui-u-p-gridui-16\"\n >\n {labels.empty}\n </p>\n </div>)}\n </Split>\n </>);\n};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorerToolbar\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const explorerLabelStyles = cva(\"gridui-u-flex gridui-u-min-w-0 gridui-u-flex-[1_1_10rem] gridui-u-flex-col gridui-u-gap-gridui-4 gridui-u-text-muted gridui-u-type-caption\");\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorerToolbar\n * @description Filter Editor\n */\n\nimport { explorerControlRowStyles } from \"../shared/control-row-style\";\nimport type { DataExplorerFiltering } from \"../shared/features\";\nimport type { DataExplorerCondition, DataExplorerFilterOperator } from \"../shared/model\";\nimport { explorerLabelStyles } from \"./style\";\nimport { Button } from \"@gridui/button\";\nimport { Input } from \"@gridui/input\";\nimport { Select } from \"@gridui/select\";\nimport { type FC, useId, useRef } from \"react\";\n\nexport type FilterEditorProps = {\n readonly filtering: DataExplorerFiltering;\n readonly conditions: readonly DataExplorerCondition[];\n readonly disabled: boolean;\n readonly onChange: (conditions: readonly DataExplorerCondition[]) => void;\n};\n\nexport const FilterEditor: FC<FilterEditorProps> = (props: FilterEditorProps) => {\n const { filtering, conditions, disabled, onChange } = props;\n const id = useId();\n const sequence = useRef(0);\n const addButton = useRef<HTMLButtonElement>(null);\n const { definitions, labels } = filtering;\n const first = definitions[0];\n const change = (index: number, condition: DataExplorerCondition) => {\n onChange(conditions.map((current, currentIndex) => {\n return currentIndex === index ? condition : current;\n }));\n };\n return (<div>\n {conditions.map((condition, index) => {\n const definition = definitions.find(entry => {\n return entry.key === condition.key;\n });\n let operators: readonly DataExplorerFilterOperator[] = [\n \"contains\",\n \"equals\",\n \"not-equals\",\n \"empty\",\n ];\n if (definition?.type === \"number\") {\n operators = [\n \"equals\",\n \"not-equals\",\n \"greater-than\",\n \"less-than\",\n \"empty\",\n ];\n }\n if (definition?.type === \"enum\") {\n operators = [\n \"equals\",\n \"not-equals\",\n \"empty\",\n ];\n }\n return (<div\n key={condition.id}\n className={explorerControlRowStyles()}\n >\n <label\n className={explorerLabelStyles()}\n >\n {labels.field}\n <Select\n aria-label={labels.field}\n disabled={disabled}\n value={condition.key}\n options={definitions.map(field => {\n return {\n value: field.key,\n label: field.label,\n };\n })}\n onValueChange={(key) => {\n const field = definitions.find(entry => {\n return entry.key === key;\n });\n change(index, {\n id: condition.id,\n key,\n operator: field?.type === \"text\" ? \"contains\" : \"equals\",\n value: \"\",\n });\n }}\n />\n </label>\n <label\n className={explorerLabelStyles()}\n >\n {labels.operator}\n <Select\n aria-label={labels.operator}\n disabled={disabled}\n value={condition.operator}\n options={operators.map(operator => {\n return {\n value: operator,\n label: labels.operators[operator],\n };\n })}\n onValueChange={(operator) => {\n const next = operators.find(value => {\n return value === operator;\n });\n if (next) {\n change(index, {\n ...condition,\n operator: next,\n });\n }\n }}\n />\n </label>\n {condition.operator !== \"empty\" && (<label\n className={explorerLabelStyles()}\n >\n {labels.value}\n {definition?.type === \"enum\" ? (<Select\n aria-label={labels.value}\n disabled={disabled}\n value={String(condition.value ?? \"\")}\n placeholder={labels.value}\n options={definition.options ?? []}\n onValueChange={(value) => {\n change(index, {\n ...condition,\n value,\n });\n }}\n />) : (<Input\n aria-label={labels.value}\n disabled={disabled}\n type={definition?.type === \"number\" ? \"number\" : \"text\"}\n value={condition.value ?? \"\"}\n onValueChange={(text) => {\n const value = definition?.type === \"number\" && text !== \"\" ? Number(text) : text;\n change(index, {\n ...condition,\n value,\n });\n }}\n />)}\n </label>)}\n <Button\n variant=\"quiet\"\n disabled={disabled}\n onClick={() => {\n onChange(conditions.filter(entry => {\n return entry.id !== condition.id;\n }));\n addButton.current?.focus();\n }}\n >\n {labels.remove(index)}\n </Button>\n </div>);\n })}\n <div\n className={explorerControlRowStyles()}\n >\n <Button\n ref={addButton}\n variant=\"secondary\"\n disabled={disabled || !first}\n onClick={() => {\n if (!first) {\n return;\n }\n sequence.current += 1;\n onChange([\n ...conditions,\n {\n id: `${id}-${sequence.current}`,\n key: first.key,\n operator: first.type === \"text\" ? \"contains\" : \"equals\",\n value: \"\",\n },\n ]);\n }}\n >\n {labels.add}\n </Button>\n </div>\n </div>);\n};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorerToolbar\n * @description Data Explorer Toolbar\n */\n\nimport { explorerControlRowStyles } from \"../shared/control-row-style\";\nimport { useExplorer } from \"../shared/explorer-context\";\nimport type { ExplorerPartOptions } from \"../shared/explorer-options\";\nimport { FilterEditor } from \"./filter-editor\";\nimport { explorerLabelStyles } from \"./style\";\nimport { Button } from \"@gridui/button\";\nimport { Checkbox } from \"@gridui/choice\";\nimport { Input } from \"@gridui/input\";\nimport { Select } from \"@gridui/select\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { FC } from \"react\";\n\nexport type DataExplorerToolbarProps = ExplorerPartOptions;\n\nexport const DataExplorerToolbar: FC<DataExplorerToolbarProps> = (props: DataExplorerToolbarProps) => {\n const { busy, columnSettings, columns, filter, filtering, labels, state, updateState, visibleColumns } = useExplorer();\n return (<>\n <div\n className={cn(explorerControlRowStyles(), props.className)}\n >\n <label\n className={explorerLabelStyles()}\n >\n {labels.search}\n <Input\n type=\"search\"\n value={state.query}\n disabled={busy}\n onValueChange={query => {\n updateState({\n query,\n page: 0,\n });\n }}\n />\n </label>\n {filter && (<label\n className={explorerLabelStyles()}\n >\n {filter.label}\n <Select\n aria-label={filter.label}\n value={state.filterValue}\n disabled={busy}\n options={[\n {\n value: \"\",\n label: labels.all,\n },\n ...filter.options,\n ]}\n onValueChange={filterValue => {\n updateState({\n filterValue,\n page: 0,\n });\n }}\n />\n </label>)}\n <label\n className={explorerLabelStyles()}\n >\n {labels.sort}\n <Select\n aria-label={labels.sort}\n value={state.sort?.key ?? \"\"}\n disabled={busy}\n options={[\n {\n value: \"\",\n label: labels.unsorted,\n },\n ...columns.map(column => {\n return {\n value: column.key,\n label: column.label,\n };\n }),\n ]}\n onValueChange={key => {\n updateState({\n sort: key ? {\n key,\n direction: \"ascending\",\n } : null,\n page: 0,\n });\n }}\n />\n </label>\n <Button\n variant=\"secondary\"\n disabled={busy || !state.sort}\n onClick={() => {\n if (state.sort) {\n updateState({\n sort: {\n ...state.sort,\n direction: state.sort.direction === \"ascending\" ? \"descending\" : \"ascending\",\n },\n page: 0,\n });\n }\n }}\n >\n {state.sort?.direction === \"descending\" ? labels.descending : labels.ascending}\n </Button>\n </div>\n {columnSettings && (<details\n className=\"gridui-u-p-gridui-16\"\n >\n <summary\n className=\"gridui-u-cursor-pointer gridui-u-type-caption\"\n >\n {columnSettings.label}\n </summary>\n <div\n className=\"gridui-u-flex gridui-u-flex-wrap gridui-u-gap-gridui-16 gridui-u-pt-gridui-16\"\n >\n {columns.map(column => {\n const visible = !columnSettings.hiddenKeys.includes(column.key);\n return (<label\n key={column.key}\n className=\"gridui-u-flex gridui-u-min-h-11 gridui-u-items-center gridui-u-gap-gridui-8\"\n >\n <Checkbox\n checked={visible}\n disabled={busy || (visible && visibleColumns.length === 1)}\n onCheckedChange={(checked) => {\n columnSettings.onHiddenKeysChange(checked ? columnSettings.hiddenKeys.filter(key => {\n return key !== column.key;\n }) : [\n ...new Set([\n ...columnSettings.hiddenKeys,\n column.key,\n ]),\n ]);\n }}\n />\n {column.label}\n </label>);\n })}\n </div>\n </details>)}\n {filtering && (<FilterEditor\n filtering={filtering}\n conditions={state.filters ?? []}\n disabled={busy}\n onChange={(filters) => {\n updateState({\n filters,\n page: 0,\n });\n }}\n />)}\n </>);\n};\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorer\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const explorerStyles = cva(\"gridui-u-min-w-0 gridui-u-border gridui-u-border-border gridui-u-bg-background gridui-u-text-foreground\");\n", "/**\n * @author WMXPY\n * @package Data Explorer\n * @namespace DataExplorer\n * @description Data Explorer\n */\n\nimport { DataExplorerBulkActions } from \"../data-explorer-bulk-actions/data-explorer-bulk-actions\";\nimport { DataExplorerPagination } from \"../data-explorer-pagination/data-explorer-pagination\";\nimport { DataExplorerTable } from \"../data-explorer-table/data-explorer-table\";\nimport { DataExplorerToolbar } from \"../data-explorer-toolbar/data-explorer-toolbar\";\nimport { explorerContext, useExplorerController } from \"../shared/explorer-context\";\nimport type { ExplorerOptions } from \"../shared/explorer-options\";\nimport { explorerStyles } from \"./style\";\nimport { Split } from \"@gridui/grid\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type DataExplorerProps = ComponentPropsWithRef<\"section\"> & ExplorerOptions;\n\nexport const DataExplorer: FC<DataExplorerProps> = (props: DataExplorerProps) => {\n const { rows, columns, state, onStateChange, filter, columnSettings, columnSizing, details, filtering,\n pageSize, selectedIds, onSelectionChange, actions, renderCell, busy, notice, labels, className, children, ...restProps } = props;\n const explorer = useExplorerController({\n rows,\n columns,\n state,\n onStateChange,\n filter,\n columnSettings,\n columnSizing,\n details,\n filtering,\n pageSize,\n selectedIds,\n onSelectionChange,\n actions,\n renderCell,\n busy,\n notice,\n labels,\n });\n return (<explorerContext.Provider\n value={explorer}\n >\n <section\n {...restProps}\n aria-label={labels.table}\n className={cn(explorerStyles(), className)}\n >\n <Split\n direction=\"column\"\n >\n {children ?? (<>\n <DataExplorerToolbar />\n <DataExplorerBulkActions />\n <DataExplorerTable />\n <DataExplorerPagination />\n </>)}\n </Split>\n </section>\n </explorerContext.Provider>);\n};\n"],
5
+ "mappings": ";AAOA,SAAS,WAAW;AAEb,IAAM,2BAA2B,IAAI,8IAA8I;;;ACmC1L,IAAM,gBAAgB,CAClB,MACA,OACA,cACS;AAET,MAAI,SAAS,QAAQ,SAAS,QAAW;AACrC,WAAO,UAAU,QAAQ,UAAU,SAAY,IAAI;AAAA,EACvD;AACA,MAAI,UAAU,QAAQ,UAAU,QAAW;AACvC,WAAO;AAAA,EACX;AACA,MAAI,aAAa;AACjB,MAAI,OAAO,SAAS,YAAY,OAAO,UAAU,UAAU;AACvD,iBAAa,OAAO;AAAA,EACxB,WAAW,OAAO,IAAI,IAAI,OAAO,KAAK,GAAG;AACrC,iBAAa;AAAA,EACjB,WAAW,OAAO,IAAI,IAAI,OAAO,KAAK,GAAG;AACrC,iBAAa;AAAA,EACjB;AACA,SAAO,cAAc,cAAc,aAAa,CAAC;AACrD;AAEO,IAAM,qBAAqB,CAC9B,MACA,SACA,OACA,UACA,WACC;AACD,QAAM,gBAAgB,OAAO,UAAU,QAAQ,KAAK,WAAW;AAC/D,QAAM,YAAY,OAAO,UAAU,MAAM,IAAI,KAAK,MAAM,QAAQ;AAChE,MAAI,CAAC,iBAAiB,CAAC,WAAW;AAC9B,UAAM,IAAI,WAAW,iFAAiF;AAAA,EAC1G;AACA,QAAM,SAAS,KAAK,IAAI,SAAO;AAC3B,WAAO,IAAI;AAAA,EACf,CAAC;AACD,QAAM,aAAa,QAAQ,IAAI,YAAU;AACrC,WAAO,OAAO;AAAA,EAClB,CAAC;AACD,QAAM,mBAAmB,IAAI,IAAI,MAAM,EAA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", "Button", "Checkbox", "cn", "jsx", "jsxs", "cva", "Button", "useId", "useRef", "jsx", "jsxs", "Button", "Checkbox", "Input", "Select", "cn", "Fragment", "jsx", "jsxs", "cva", "Split", "cn", "Fragment", "jsx", "jsxs"]
7
7
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Data Explorer
4
+ * @namespace Shared
5
+ * @description Control Row Style
6
+ */
7
+ export declare const explorerControlRowStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
@@ -0,0 +1,161 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Data Explorer
4
+ * @namespace Shared
5
+ * @description Explorer Context
6
+ */
7
+ import type { ExplorerOptions } from "./explorer-options";
8
+ import { type DataExplorerState } from "./model";
9
+ export declare const useExplorerController: (options: ExplorerOptions) => {
10
+ busy: boolean;
11
+ tableId: string;
12
+ view: {
13
+ rows: import("./model").DataExplorerRow[];
14
+ total: number;
15
+ page: number;
16
+ pageCount: number;
17
+ };
18
+ selectedRowIds: string[];
19
+ pageIds: string[];
20
+ selectedPageCount: number;
21
+ updateState: (changes: Partial<DataExplorerState>) => void;
22
+ visibleColumns: import("./model").DataExplorerColumn[];
23
+ rows: readonly import("./model").DataExplorerRow[];
24
+ columns: readonly import("./model").DataExplorerColumn[];
25
+ state: DataExplorerState;
26
+ onStateChange: (state: DataExplorerState) => void;
27
+ filter?: import("./model").DataExplorerFilter | undefined;
28
+ columnSettings?: import("./features").DataExplorerColumnSettings | undefined;
29
+ columnSizing?: import("./features").DataExplorerColumnSizing | undefined;
30
+ details?: import("./features").DataExplorerDetails | undefined;
31
+ filtering?: import("./features").DataExplorerFiltering | undefined;
32
+ pageSize?: number | undefined;
33
+ selectedIds?: readonly string[] | undefined;
34
+ onSelectionChange?: ((ids: readonly string[]) => void) | undefined;
35
+ actions?: readonly {
36
+ readonly label: string;
37
+ readonly onAction: (ids: readonly string[]) => void;
38
+ readonly disabled?: boolean;
39
+ }[] | undefined;
40
+ renderCell?: ((value: import("./model").DataExplorerValue | undefined, row: import("./model").DataExplorerRow, column: import("./model").DataExplorerColumn) => import("react").ReactNode) | undefined;
41
+ notice?: import("react").ReactNode;
42
+ labels: {
43
+ readonly table: string;
44
+ readonly search: string;
45
+ readonly sort: string;
46
+ readonly unsorted: string;
47
+ readonly ascending: string;
48
+ readonly descending: string;
49
+ readonly all: string;
50
+ readonly selection: string;
51
+ readonly selectPage: string;
52
+ readonly selectRow: (row: import("./model").DataExplorerRow) => string;
53
+ readonly selected: (count: number) => string;
54
+ readonly previous: string;
55
+ readonly next: string;
56
+ readonly page: (page: number, pages: number, total: number) => string;
57
+ readonly empty: string;
58
+ };
59
+ };
60
+ export declare const explorerContext: import("react").Context<{
61
+ busy: boolean;
62
+ tableId: string;
63
+ view: {
64
+ rows: import("./model").DataExplorerRow[];
65
+ total: number;
66
+ page: number;
67
+ pageCount: number;
68
+ };
69
+ selectedRowIds: string[];
70
+ pageIds: string[];
71
+ selectedPageCount: number;
72
+ updateState: (changes: Partial<DataExplorerState>) => void;
73
+ visibleColumns: import("./model").DataExplorerColumn[];
74
+ rows: readonly import("./model").DataExplorerRow[];
75
+ columns: readonly import("./model").DataExplorerColumn[];
76
+ state: DataExplorerState;
77
+ onStateChange: (state: DataExplorerState) => void;
78
+ filter?: import("./model").DataExplorerFilter | undefined;
79
+ columnSettings?: import("./features").DataExplorerColumnSettings | undefined;
80
+ columnSizing?: import("./features").DataExplorerColumnSizing | undefined;
81
+ details?: import("./features").DataExplorerDetails | undefined;
82
+ filtering?: import("./features").DataExplorerFiltering | undefined;
83
+ pageSize?: number | undefined;
84
+ selectedIds?: readonly string[] | undefined;
85
+ onSelectionChange?: ((ids: readonly string[]) => void) | undefined;
86
+ actions?: readonly {
87
+ readonly label: string;
88
+ readonly onAction: (ids: readonly string[]) => void;
89
+ readonly disabled?: boolean;
90
+ }[] | undefined;
91
+ renderCell?: ((value: import("./model").DataExplorerValue | undefined, row: import("./model").DataExplorerRow, column: import("./model").DataExplorerColumn) => import("react").ReactNode) | undefined;
92
+ notice?: import("react").ReactNode;
93
+ labels: {
94
+ readonly table: string;
95
+ readonly search: string;
96
+ readonly sort: string;
97
+ readonly unsorted: string;
98
+ readonly ascending: string;
99
+ readonly descending: string;
100
+ readonly all: string;
101
+ readonly selection: string;
102
+ readonly selectPage: string;
103
+ readonly selectRow: (row: import("./model").DataExplorerRow) => string;
104
+ readonly selected: (count: number) => string;
105
+ readonly previous: string;
106
+ readonly next: string;
107
+ readonly page: (page: number, pages: number, total: number) => string;
108
+ readonly empty: string;
109
+ };
110
+ } | null>;
111
+ export declare const useExplorer: () => {
112
+ busy: boolean;
113
+ tableId: string;
114
+ view: {
115
+ rows: import("./model").DataExplorerRow[];
116
+ total: number;
117
+ page: number;
118
+ pageCount: number;
119
+ };
120
+ selectedRowIds: string[];
121
+ pageIds: string[];
122
+ selectedPageCount: number;
123
+ updateState: (changes: Partial<DataExplorerState>) => void;
124
+ visibleColumns: import("./model").DataExplorerColumn[];
125
+ rows: readonly import("./model").DataExplorerRow[];
126
+ columns: readonly import("./model").DataExplorerColumn[];
127
+ state: DataExplorerState;
128
+ onStateChange: (state: DataExplorerState) => void;
129
+ filter?: import("./model").DataExplorerFilter | undefined;
130
+ columnSettings?: import("./features").DataExplorerColumnSettings | undefined;
131
+ columnSizing?: import("./features").DataExplorerColumnSizing | undefined;
132
+ details?: import("./features").DataExplorerDetails | undefined;
133
+ filtering?: import("./features").DataExplorerFiltering | undefined;
134
+ pageSize?: number | undefined;
135
+ selectedIds?: readonly string[] | undefined;
136
+ onSelectionChange?: ((ids: readonly string[]) => void) | undefined;
137
+ actions?: readonly {
138
+ readonly label: string;
139
+ readonly onAction: (ids: readonly string[]) => void;
140
+ readonly disabled?: boolean;
141
+ }[] | undefined;
142
+ renderCell?: ((value: import("./model").DataExplorerValue | undefined, row: import("./model").DataExplorerRow, column: import("./model").DataExplorerColumn) => import("react").ReactNode) | undefined;
143
+ notice?: import("react").ReactNode;
144
+ labels: {
145
+ readonly table: string;
146
+ readonly search: string;
147
+ readonly sort: string;
148
+ readonly unsorted: string;
149
+ readonly ascending: string;
150
+ readonly descending: string;
151
+ readonly all: string;
152
+ readonly selection: string;
153
+ readonly selectPage: string;
154
+ readonly selectRow: (row: import("./model").DataExplorerRow) => string;
155
+ readonly selected: (count: number) => string;
156
+ readonly previous: string;
157
+ readonly next: string;
158
+ readonly page: (page: number, pages: number, total: number) => string;
159
+ readonly empty: string;
160
+ };
161
+ };
@@ -0,0 +1,51 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Data Explorer
4
+ * @namespace Shared
5
+ * @description Explorer Options
6
+ */
7
+ import type { DataExplorerColumnSettings, DataExplorerColumnSizing, DataExplorerDetails, DataExplorerFiltering } from "./features";
8
+ import type { DataExplorerColumn, DataExplorerFilter, DataExplorerRow, DataExplorerState, DataExplorerValue } from "./model";
9
+ import type { ReactNode } from "react";
10
+ export type ExplorerOptions = {
11
+ readonly rows: readonly DataExplorerRow[];
12
+ readonly columns: readonly DataExplorerColumn[];
13
+ readonly state: DataExplorerState;
14
+ readonly onStateChange: (state: DataExplorerState) => void;
15
+ readonly filter?: DataExplorerFilter | undefined;
16
+ readonly columnSettings?: DataExplorerColumnSettings | undefined;
17
+ readonly columnSizing?: DataExplorerColumnSizing | undefined;
18
+ readonly details?: DataExplorerDetails | undefined;
19
+ readonly filtering?: DataExplorerFiltering | undefined;
20
+ readonly pageSize?: number | undefined;
21
+ readonly selectedIds?: readonly string[] | undefined;
22
+ readonly onSelectionChange?: ((ids: readonly string[]) => void) | undefined;
23
+ readonly actions?: readonly {
24
+ readonly label: string;
25
+ readonly onAction: (ids: readonly string[]) => void;
26
+ readonly disabled?: boolean;
27
+ }[] | undefined;
28
+ readonly renderCell?: ((value: DataExplorerValue | undefined, row: DataExplorerRow, column: DataExplorerColumn) => ReactNode) | undefined;
29
+ readonly busy?: boolean | undefined;
30
+ readonly notice?: ReactNode;
31
+ readonly labels: {
32
+ readonly table: string;
33
+ readonly search: string;
34
+ readonly sort: string;
35
+ readonly unsorted: string;
36
+ readonly ascending: string;
37
+ readonly descending: string;
38
+ readonly all: string;
39
+ readonly selection: string;
40
+ readonly selectPage: string;
41
+ readonly selectRow: (row: DataExplorerRow) => string;
42
+ readonly selected: (count: number) => string;
43
+ readonly previous: string;
44
+ readonly next: string;
45
+ readonly page: (page: number, pages: number, total: number) => string;
46
+ readonly empty: string;
47
+ };
48
+ };
49
+ export type ExplorerPartOptions = {
50
+ readonly className?: string;
51
+ };
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Data Explorer
4
+ * @namespace Shared
5
+ * @description Features
6
+ */
7
+ import type { DataExplorerColumn, DataExplorerFilterDefinition, DataExplorerFilterOperator, DataExplorerRow } from "./model";
8
+ import type { ReactNode } from "react";
9
+ export type DataExplorerColumnSettings = {
10
+ readonly hiddenKeys: readonly string[];
11
+ readonly onHiddenKeysChange: (keys: readonly string[]) => void;
12
+ readonly label: string;
13
+ };
14
+ export type DataExplorerColumnSizing = {
15
+ readonly widths: Readonly<Record<string, number>>;
16
+ readonly onWidthsChange: (widths: Readonly<Record<string, number>>) => void;
17
+ readonly resizeLabel: (column: DataExplorerColumn) => string;
18
+ };
19
+ export type DataExplorerDetails = {
20
+ readonly expandedIds: readonly string[];
21
+ readonly onExpandedIdsChange: (ids: readonly string[]) => void;
22
+ readonly render: (row: DataExplorerRow) => ReactNode;
23
+ readonly columnLabel: string;
24
+ readonly expandLabel: (row: DataExplorerRow) => string;
25
+ readonly collapseLabel: (row: DataExplorerRow) => string;
26
+ };
27
+ export type DataExplorerFiltering = {
28
+ readonly definitions: readonly DataExplorerFilterDefinition[];
29
+ readonly labels: {
30
+ readonly add: string;
31
+ readonly remove: (index: number) => string;
32
+ readonly field: string;
33
+ readonly operator: string;
34
+ readonly value: string;
35
+ readonly operators: Readonly<Record<DataExplorerFilterOperator, string>>;
36
+ };
37
+ };
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @author WMXPY
3
3
  * @package Data Explorer
4
- * @namespace DataExplorer
4
+ * @namespace Shared
5
5
  * @description Model
6
6
  */
7
7
  export type DataExplorerValue = string | number | null;
@@ -13,6 +13,10 @@ export type DataExplorerColumn = {
13
13
  readonly key: string;
14
14
  readonly label: string;
15
15
  readonly numeric?: boolean;
16
+ readonly width?: number;
17
+ readonly minWidth?: number;
18
+ readonly maxWidth?: number;
19
+ readonly sticky?: "start" | "end";
16
20
  };
17
21
  export type DataExplorerState = {
18
22
  readonly query: string;
@@ -22,6 +26,7 @@ export type DataExplorerState = {
22
26
  readonly direction: "ascending" | "descending";
23
27
  } | null;
24
28
  readonly page: number;
29
+ readonly filters?: readonly DataExplorerCondition[];
25
30
  };
26
31
  export type DataExplorerFilter = {
27
32
  readonly key: string;
@@ -38,3 +43,21 @@ export declare const selectExplorerRows: (rows: readonly DataExplorerRow[], colu
38
43
  pageCount: number;
39
44
  };
40
45
  export declare const selectExplorerPage: (selectedIds: readonly string[], pageIds: readonly string[], checked: boolean) => string[];
46
+ export type DataExplorerFilterOperator = "contains" | "equals" | "not-equals" | "greater-than" | "less-than" | "empty";
47
+ export type DataExplorerCondition = {
48
+ readonly id: string;
49
+ readonly key: string;
50
+ readonly operator: DataExplorerFilterOperator;
51
+ readonly value?: string | number;
52
+ };
53
+ export type DataExplorerFilterDefinition = {
54
+ readonly key: string;
55
+ readonly label: string;
56
+ readonly type: "text" | "number" | "enum";
57
+ readonly options?: readonly {
58
+ readonly value: string;
59
+ readonly label: string;
60
+ }[];
61
+ };
62
+ export declare const matchesExplorerCondition: (row: DataExplorerRow, condition: DataExplorerCondition) => boolean;
63
+ export declare const resolveExplorerWidth: (column: DataExplorerColumn, width?: number) => number;
package/dist/styles.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
1
+ /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
2
2
  @layer properties;
3
3
  @layer theme, base, components, utilities;
4
4
  @layer theme {
@@ -13,12 +13,30 @@
13
13
  .gridui-u-flex {
14
14
  display: flex;
15
15
  }
16
+ .gridui-u-min-h-11 {
17
+ min-height: calc(var(--spacing) * 11);
18
+ }
19
+ .gridui-u-w-gridui-16 {
20
+ width: var(--gridui-space-16);
21
+ }
16
22
  .gridui-u-min-w-0 {
17
23
  min-width: 0px;
18
24
  }
19
25
  .gridui-u-flex-\[1_1_10rem\] {
20
26
  flex: 1 1 10rem;
21
27
  }
28
+ .gridui-u-shrink-0 {
29
+ flex-shrink: 0;
30
+ }
31
+ .gridui-u-cursor-col-resize {
32
+ cursor: col-resize;
33
+ }
34
+ .gridui-u-cursor-pointer {
35
+ cursor: pointer;
36
+ }
37
+ .gridui-u-touch-none {
38
+ touch-action: none;
39
+ }
22
40
  .gridui-u-flex-col {
23
41
  flex-direction: column;
24
42
  }
@@ -47,6 +65,14 @@
47
65
  border-style: var(--tw-border-style);
48
66
  border-width: 1px;
49
67
  }
68
+ .gridui-u-border-s {
69
+ border-inline-start-style: var(--tw-border-style);
70
+ border-inline-start-width: 1px;
71
+ }
72
+ .gridui-u-border-solid {
73
+ --tw-border-style: solid;
74
+ border-style: solid;
75
+ }
50
76
  .gridui-u-border-border {
51
77
  border-color: var(--gridui-border);
52
78
  }
@@ -56,6 +82,9 @@
56
82
  .gridui-u-p-gridui-16 {
57
83
  padding: var(--gridui-space-16);
58
84
  }
85
+ .gridui-u-pt-gridui-16 {
86
+ padding-top: var(--gridui-space-16);
87
+ }
59
88
  .gridui-u-type-caption {
60
89
  font: var(--gridui-type-caption);
61
90
  letter-spacing: normal;
@@ -76,7 +105,7 @@
76
105
  initial-value: solid;
77
106
  }
78
107
  @layer properties {
79
- @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
108
+ @supports ((-webkit-hyphens: none) and (not (margin-trim: block))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
80
109
  *, ::before, ::after, ::backdrop {
81
110
  --tw-border-style: solid;
82
111
  }