@coreui/data-grid 0.1.0-rc.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/LICENSE +3 -0
- package/README.md +37 -0
- package/dist/css/data-grid.css +444 -0
- package/dist/css/data-grid.css.map +1 -0
- package/dist/css/data-grid.min.css +5 -0
- package/dist/css/data-grid.min.css.map +1 -0
- package/dist/js/csv.cjs +68 -0
- package/dist/js/csv.cjs.map +1 -0
- package/dist/js/csv.mjs +63 -0
- package/dist/js/csv.mjs.map +1 -0
- package/dist/js/data-grid.esm.js +9618 -0
- package/dist/js/data-grid.esm.js.map +1 -0
- package/dist/js/data-grid.esm.min.js +8 -0
- package/dist/js/data-grid.esm.min.js.map +1 -0
- package/dist/js/data-grid.js +9635 -0
- package/dist/js/data-grid.js.map +1 -0
- package/dist/js/data-grid.min.js +8 -0
- package/dist/js/data-grid.min.js.map +1 -0
- package/dist/js/data-grid.mjs +9618 -0
- package/dist/js/data-grid.mjs.map +1 -0
- package/dist/js/filters.cjs +143 -0
- package/dist/js/filters.cjs.map +1 -0
- package/dist/js/filters.mjs +137 -0
- package/dist/js/filters.mjs.map +1 -0
- package/dist/js/labels.cjs +76 -0
- package/dist/js/labels.cjs.map +1 -0
- package/dist/js/labels.mjs +71 -0
- package/dist/js/labels.mjs.map +1 -0
- package/dist/types/base-component.d.ts +19 -0
- package/dist/types/data-grid.d.ts +128 -0
- package/dist/types/dom/event-handler.d.ts +11 -0
- package/dist/types/dom/manipulator.d.ts +9 -0
- package/dist/types/engine/active-cell.d.ts +32 -0
- package/dist/types/engine/data-source.d.ts +19 -0
- package/dist/types/engine/scheduler.d.ts +11 -0
- package/dist/types/engine/table.d.ts +9 -0
- package/dist/types/engine/virtualizer.d.ts +21 -0
- package/dist/types/filters.d.mts +1 -0
- package/dist/types/filters.d.ts +13 -0
- package/dist/types/icons.d.ts +21 -0
- package/dist/types/index.d.mts +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/labels.d.mts +1 -0
- package/dist/types/labels.d.ts +9 -0
- package/dist/types/types.d.ts +262 -0
- package/dist/types/ui/body.d.ts +34 -0
- package/dist/types/ui/column-chooser.d.ts +27 -0
- package/dist/types/ui/editor.d.ts +8 -0
- package/dist/types/ui/filter-menu.d.ts +21 -0
- package/dist/types/ui/header.d.ts +50 -0
- package/dist/types/ui/loading.d.ts +12 -0
- package/dist/types/ui/menu.d.ts +17 -0
- package/dist/types/ui/pagination.d.ts +17 -0
- package/dist/types/ui/pinning.d.ts +17 -0
- package/dist/types/ui/toolbar.d.ts +34 -0
- package/dist/types/ui/tooltip.d.ts +10 -0
- package/dist/types/util/config.d.ts +11 -0
- package/dist/types/util/csv.d.mts +1 -0
- package/dist/types/util/csv.d.ts +19 -0
- package/dist/types/util/debounce.d.ts +7 -0
- package/dist/types/util/index.d.ts +10 -0
- package/dist/types/util/sanitizer.d.ts +11 -0
- package/package.json +147 -0
- package/scss/data-grid.scss +559 -0
- package/src/base-component.d.ts +19 -0
- package/src/base-component.js +90 -0
- package/src/data-grid.ts +2208 -0
- package/src/dom/data.js +59 -0
- package/src/dom/event-handler.d.ts +11 -0
- package/src/dom/event-handler.js +331 -0
- package/src/dom/manipulator.d.ts +9 -0
- package/src/dom/manipulator.js +75 -0
- package/src/engine/active-cell.ts +195 -0
- package/src/engine/data-source.ts +63 -0
- package/src/engine/scheduler.ts +42 -0
- package/src/engine/table.ts +122 -0
- package/src/engine/virtualizer.ts +57 -0
- package/src/filters.ts +176 -0
- package/src/icons.ts +60 -0
- package/src/index.ts +56 -0
- package/src/labels.ts +70 -0
- package/src/types.ts +334 -0
- package/src/ui/body.ts +348 -0
- package/src/ui/column-chooser.ts +183 -0
- package/src/ui/editor.ts +98 -0
- package/src/ui/filter-menu.ts +398 -0
- package/src/ui/header.ts +441 -0
- package/src/ui/loading.ts +39 -0
- package/src/ui/menu.ts +218 -0
- package/src/ui/pagination.ts +150 -0
- package/src/ui/pinning.ts +53 -0
- package/src/ui/toolbar.ts +144 -0
- package/src/ui/tooltip.ts +113 -0
- package/src/util/config.d.ts +11 -0
- package/src/util/config.js +69 -0
- package/src/util/csv.ts +85 -0
- package/src/util/debounce.ts +18 -0
- package/src/util/index.d.ts +10 -0
- package/src/util/index.js +310 -0
- package/src/util/sanitizer.d.ts +11 -0
- package/src/util/sanitizer.js +162 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid engine/data-source.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { DataGridDataRequest, DataGridDataResponse } from '../types';
|
|
8
|
+
export interface GridDataSourceContext {
|
|
9
|
+
getRequest: () => DataGridDataRequest;
|
|
10
|
+
onError: (error: unknown) => void;
|
|
11
|
+
onLoad: (response: DataGridDataResponse) => void;
|
|
12
|
+
onLoadingChange: (loading: boolean) => void;
|
|
13
|
+
provider: (request: DataGridDataRequest) => Promise<DataGridDataResponse>;
|
|
14
|
+
}
|
|
15
|
+
export interface GridDataSource {
|
|
16
|
+
load: () => void;
|
|
17
|
+
dispose: () => void;
|
|
18
|
+
}
|
|
19
|
+
export declare const createDataSource: (context: GridDataSourceContext) => GridDataSource;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid engine/scheduler.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
export interface Scheduler {
|
|
8
|
+
schedule: () => void;
|
|
9
|
+
dispose: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const createScheduler: (flush: () => void) => Scheduler;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid engine/table.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import { type Table, type TableState } from '@tanstack/table-core';
|
|
8
|
+
import type { DataGridItem, DataGridOptions } from '../types';
|
|
9
|
+
export declare const createGridTable: (options: DataGridOptions, onStateChange: (previous: TableState, next: TableState) => void) => Table<DataGridItem>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid engine/virtualizer.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import { Virtualizer } from '@tanstack/virtual-core';
|
|
8
|
+
export type GridVirtualizerInstance = Virtualizer<HTMLDivElement, Element>;
|
|
9
|
+
export interface GridVirtualizer {
|
|
10
|
+
instance: GridVirtualizerInstance;
|
|
11
|
+
setCount: (count: number) => void;
|
|
12
|
+
destroy: () => void;
|
|
13
|
+
}
|
|
14
|
+
export interface GridVirtualizerOptions {
|
|
15
|
+
count: number;
|
|
16
|
+
getScrollElement: () => HTMLDivElement;
|
|
17
|
+
onChange: () => void;
|
|
18
|
+
overscan: number;
|
|
19
|
+
rowHeight: number;
|
|
20
|
+
}
|
|
21
|
+
export declare const createGridVirtualizer: (options: GridVirtualizerOptions) => GridVirtualizer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './filters.js'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid filters.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
* Pure filter-operator logic, built as the dependency-free
|
|
7
|
+
* `@coreui/data-grid/filters` subpath so the framework bindings share one
|
|
8
|
+
* implementation without pulling in the vanilla component runtime.
|
|
9
|
+
*/
|
|
10
|
+
import type { DataGridColumnFilterValue, DataGridFilterOperator, DataGridFilterType } from './types';
|
|
11
|
+
export declare const FILTER_OPERATORS: Record<Exclude<DataGridFilterType, 'select'>, DataGridFilterOperator[]>;
|
|
12
|
+
export declare const VALUELESS_OPERATORS: ReadonlySet<DataGridFilterOperator>;
|
|
13
|
+
export declare const evaluateColumnFilter: (cellValue: unknown, filterValue: DataGridColumnFilterValue, filterType?: DataGridFilterType) => boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid icons.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
export declare const DEFAULT_COLUMN_MENU_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M204 148a52 52 0 1 0 104 0 52 52 0 1 0-104 0m78 0a26 26 0 1 1-26-26 26.03 26.03 0 0 1 26 26M204 264a52 52 0 1 0 104 0 52 52 0 1 0-104 0m78 0a26 26 0 1 1-26-26 26.03 26.03 0 0 1 26 26M204 380a52 52 0 1 0 104 0 52 52 0 1 0-104 0m78 0a26 26 0 1 1-26-26 26.03 26.03 0 0 1 26 26\"/></svg>";
|
|
8
|
+
export declare const DEFAULT_FILTER_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M96 197.333h320v32H96zm72 101.334h176v32H168zM216 400h80v32h-80zM48 96h416v32H48z\"/></svg>";
|
|
9
|
+
export declare const DEFAULT_TOOLBAR_COLUMNS_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M16 64v384h480V64Zm304 32v320H192V96ZM48 96h112v320H48Zm416 320H352V96h112Z\"/></svg>";
|
|
10
|
+
export declare const DEFAULT_TOOLBAR_EXPORT_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M16 464h480v32H16zm379.313-164.687-22.626-22.626L280 369.373V16h-32v353.373l-92.687-92.686-22.626 22.626L264 430.627z\"/></svg>";
|
|
11
|
+
export declare const DEFAULT_TOOLBAR_UNDO_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M495.473 197.262c0-73.061-43.651-136.118-106.242-164.462q-2-.9-4.021-1.762-4.046-1.715-8.19-3.235-2.071-.761-4.167-1.47-4.19-1.422-8.468-2.64a180.95 180.95 0 0 0-98.675 0q-4.278 1.218-8.469 2.64-2.094.71-4.166 1.47-4.143 1.519-8.19 3.235-2.023.857-4.021 1.762c-62.592 28.344-106.242 91.4-106.242 164.462v237.483L38.627 338.75 16 361.377 150.623 496l134.623-134.623-22.627-22.627-96 96V197.263c0-72.891 52.814-133.678 122.186-146.1a149.4 149.4 0 0 1 52.479 0c69.371 12.426 122.186 73.213 122.186 146.1h32Z\"/></svg>";
|
|
12
|
+
export declare const DEFAULT_TOOLBAR_REDO_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M361.376 495.163 226.753 360.54l22.627-22.627 111.996 111.996 111.997-111.996L496 360.54z\"/><path fill=\"currentColor\" d=\"M377.377 472.52h-32V196.426C345.377 114.584 278.794 48 196.952 48c-83.229 0-148.426 63.106-148.426 143.667h-32c0-48.024 18.85-92.569 53.079-125.429C103.35 33.842 148.576 16 196.952 16c99.487 0 180.425 80.938 180.425 180.426Z\"/></svg>";
|
|
13
|
+
export declare const DEFAULT_SORT_ASCENDING_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M390.624 150.625 256 16 121.376 150.625l22.628 22.627 95.997-95.998v417.982h32V77.257l95.995 95.995z\"/></svg>";
|
|
14
|
+
export declare const DEFAULT_SORT_DESCENDING_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"m367.997 338.75-95.998 95.997V17.503h-32v417.242l-95.996-95.995-22.627 22.627L256 496l134.624-134.623z\"/></svg>";
|
|
15
|
+
export declare const DEFAULT_SORT_NEUTRAL_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M384 433.373V160h-32v274.51l-69.823-69.823-22.627 22.626 107.882 107.883 107.881-107.883-22.626-22.626zM159.432 17.372 51.55 125.255l22.627 22.627L144 78.059V352h32V79.195l68.687 68.687 22.626-22.627z\"/></svg>";
|
|
16
|
+
export declare const DEFAULT_PIN_LEFT_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"m477.8 140.2-106-106a62.132 62.132 0 0 0-93.617 81.24l-4.913 5.533-97.654 42.9-42.611-23.026a24.04 24.04 0 0 0-28.86 4.638L62.6 189.487a23.88 23.88 0 0 0 .479 33.449l101.68 101.679L16 473.373V496h22.627l148.758-148.758L288.6 448.457a23.93 23.93 0 0 0 33.275.642l44.425-41.128a23.98 23.98 0 0 0 4.773-29.092l-23.344-42.858 42.131-90.515 8.6-10.318A62.134 62.134 0 0 0 477.8 140.2m-22.628 65.231a30.125 30.125 0 0 1-42.6 0l-16.885-16.886-33.08 39.678-50.7 108.933 28.087 51.566-34.209 31.669L91.2 205.806l32-33.89 50.969 27.543 118.386-52.008 29.177-32.863-15.158-15.161a30.126 30.126 0 0 1 42.6-42.6l106 106a30.126 30.126 0 0 1 0 42.6Z\"/></svg>";
|
|
17
|
+
export declare const DEFAULT_PIN_RIGHT_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><g transform=\"translate(512 0) scale(-1 1)\"><path fill=\"currentColor\" d=\"m477.8 140.2-106-106a62.132 62.132 0 0 0-93.617 81.24l-4.913 5.533-97.654 42.9-42.611-23.026a24.04 24.04 0 0 0-28.86 4.638L62.6 189.487a23.88 23.88 0 0 0 .479 33.449l101.68 101.679L16 473.373V496h22.627l148.758-148.758L288.6 448.457a23.93 23.93 0 0 0 33.275.642l44.425-41.128a23.98 23.98 0 0 0 4.773-29.092l-23.344-42.858 42.131-90.515 8.6-10.318A62.134 62.134 0 0 0 477.8 140.2m-22.628 65.231a30.125 30.125 0 0 1-42.6 0l-16.885-16.886-33.08 39.678-50.7 108.933 28.087 51.566-34.209 31.669L91.2 205.806l32-33.89 50.969 27.543 118.386-52.008 29.177-32.863-15.158-15.161a30.126 30.126 0 0 1 42.6-42.6l106 106a30.126 30.126 0 0 1 0 42.6Z\"/></g></svg>";
|
|
18
|
+
export declare const DEFAULT_UNPIN_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"m427.314 107.313-22.628-22.626L256 233.373 107.314 84.687l-22.628 22.626L233.373 256 84.686 404.687l22.628 22.626L256 278.627l148.686 148.686 22.628-22.626L278.627 256z\"/></svg>";
|
|
19
|
+
export declare const DEFAULT_MOVE_LEFT_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M254.625 56h-38.632L16 256.2 216 456h38.623V336h144V176h-144Zm112 152v96h-144v113.384l-161.37-161.21 161.37-161.535V208Zm96-152h32v400h-32z\"/></svg>";
|
|
20
|
+
export declare const DEFAULT_MOVE_RIGHT_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"M296.007 56h-38.632v120h-144v160h144v120H296l200-199.8Zm-6.632 361.384V304h-144v-96h144V94.639l161.37 161.535ZM17.375 56h32v400h-32z\"/></svg>";
|
|
21
|
+
export declare const DEFAULT_HIDE_COLUMN_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 512 512\" aria-hidden=\"true\" focusable=\"false\"><path fill=\"currentColor\" d=\"m397.222 131.1-.218-.223c-63.173-63.17-158.534-75.015-233.776-35.531l23.938 23.939c61.571-27.691 136.573-16.327 187.105 34.115L464 246.683v3.107l-71.744 74.585 22.63 22.63L496 262.683V233.79Z\"/><path fill=\"currentColor\" d=\"M352.8 284.33a103.307 103.307 0 0 0-132.893-132.892L246.1 177.63a71.228 71.228 0 0 1 80.507 80.508Zm17.1 62.938-33.831-33.831c.088-.108.179-.212.266-.32l-22.805-22.806q-.126.168-.253.334l-99.681-99.681.334-.253-22.81-22.805c-.108.087-.213.179-.321.266L38.627 16H16v22.627l95.689 95.689L16 233.79v28.893l98.778 102.689.218.222A199.73 199.73 0 0 0 367.372 390l106 106H496v-22.627L392.537 369.911Zm-177.157-131.9 96.128 96.132a71.28 71.28 0 0 1-96.133-96.133Zm-55.014 127.705L48 249.79v-3.107l86.319-89.737 35.065 35.064a103.248 103.248 0 0 0 142.842 142.843l32.007 32.007c-64.51 40.015-150.522 32.095-206.504-23.787\"/></svg>";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './index.js'
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid index.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
export { default as DataGrid } from './data-grid';
|
|
8
|
+
export { DEFAULT_LABELS, interpolate } from './labels';
|
|
9
|
+
export { evaluateColumnFilter, FILTER_OPERATORS, VALUELESS_OPERATORS } from './filters';
|
|
10
|
+
export { downloadCsv, exportCsv } from './util/csv';
|
|
11
|
+
export type { CsvDownloadOptions, CsvOptions } from './util/csv';
|
|
12
|
+
export type { Column, ColumnFiltersState, ColumnOrderState, ColumnPinningState, ColumnSizingState, DataGridColumn, DataGridColumnFilterContext, DataGridColumnFilterFactory, DataGridColumnFilterValue, DataGridColumnMenuBuilder, DataGridColumnMenuContext, DataGridColumnSizingOptions, DataGridDataRequest, DataGridDataResponse, DataGridEditableOptions, DataGridEditCommitEvent, DataGridEditor, DataGridEditorContext, DataGridEditorFactory, DataGridEditorType, DataGridFilterCondition, DataGridFilterOperator, DataGridFilterType, DataGridItem, DataGridLabels, DataGridMenuAction, DataGridOptions, DataGridPaginationInfoState, DataGridPaginationOptions, DataGridRowSelectionOptions, DataGridSlot, DataGridSlotContext, DataGridSlotFactory, DataGridSlots, DataGridSortingOptions, DataGridState, DataGridToolbarOptions, PaginationState, RowSelectionState, SortingState, Table, VisibilityState } from './types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './labels.js'
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid labels.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { DataGridLabels } from './types';
|
|
8
|
+
export declare const DEFAULT_LABELS: DataGridLabels;
|
|
9
|
+
export declare const interpolate: (template: string, tokens: Record<string, string | number>) => string;
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid types.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { Column, ColumnFiltersState, ColumnOrderState, ColumnPinningState, ColumnSizingState, PaginationState, RowSelectionState, SortingState, Table, VisibilityState } from '@tanstack/table-core';
|
|
8
|
+
import type { CsvDownloadOptions } from './util/csv';
|
|
9
|
+
export type { Column, ColumnFiltersState, ColumnOrderState, ColumnPinningState, ColumnSizingState, PaginationState, RowSelectionState, SortingState, Table, VisibilityState } from '@tanstack/table-core';
|
|
10
|
+
export type DataGridItem = Record<string, unknown>;
|
|
11
|
+
export interface DataGridColumnFilterContext {
|
|
12
|
+
column: Column<DataGridItem, unknown>;
|
|
13
|
+
table: Table<DataGridItem>;
|
|
14
|
+
labels: DataGridLabels;
|
|
15
|
+
}
|
|
16
|
+
export type DataGridColumnFilterFactory = (context: DataGridColumnFilterContext) => DataGridSlot;
|
|
17
|
+
export type DataGridFilterType = 'text' | 'number' | 'date' | 'select';
|
|
18
|
+
export type DataGridFilterOperator = 'contains' | 'notContains' | 'equals' | 'notEquals' | 'startsWith' | 'endsWith' | 'blank' | 'notBlank' | 'greaterThan' | 'greaterThanOrEqual' | 'lessThan' | 'lessThanOrEqual' | 'between';
|
|
19
|
+
export interface DataGridFilterCondition {
|
|
20
|
+
operator: DataGridFilterOperator;
|
|
21
|
+
value?: unknown;
|
|
22
|
+
value2?: unknown;
|
|
23
|
+
}
|
|
24
|
+
export type DataGridColumnFilterValue = string | {
|
|
25
|
+
conditions: DataGridFilterCondition[];
|
|
26
|
+
join: 'and' | 'or';
|
|
27
|
+
} | {
|
|
28
|
+
operator: 'in';
|
|
29
|
+
value: unknown[];
|
|
30
|
+
};
|
|
31
|
+
export type DataGridEditorType = 'text' | 'number' | 'select';
|
|
32
|
+
export interface DataGridEditableOptions {
|
|
33
|
+
type?: DataGridEditorType;
|
|
34
|
+
min?: number;
|
|
35
|
+
max?: number;
|
|
36
|
+
step?: number;
|
|
37
|
+
options?: Array<string | number | {
|
|
38
|
+
label: string;
|
|
39
|
+
value: unknown;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
42
|
+
export interface DataGridEditorContext {
|
|
43
|
+
item: DataGridItem;
|
|
44
|
+
column: DataGridColumn;
|
|
45
|
+
value: unknown;
|
|
46
|
+
commit: (value: unknown) => void;
|
|
47
|
+
cancel: () => void;
|
|
48
|
+
labels: DataGridLabels;
|
|
49
|
+
}
|
|
50
|
+
export interface DataGridEditor {
|
|
51
|
+
element: HTMLElement;
|
|
52
|
+
contains?: (target: Node) => boolean;
|
|
53
|
+
dispose?: () => void;
|
|
54
|
+
focus?: () => void;
|
|
55
|
+
getValue?: () => unknown;
|
|
56
|
+
popup?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export type DataGridEditorFactory = (context: DataGridEditorContext) => DataGridEditor;
|
|
59
|
+
export interface DataGridEditCommitEvent {
|
|
60
|
+
item: DataGridItem;
|
|
61
|
+
columnId: string;
|
|
62
|
+
value: unknown;
|
|
63
|
+
previousValue: unknown;
|
|
64
|
+
}
|
|
65
|
+
export interface DataGridColumn {
|
|
66
|
+
key: string;
|
|
67
|
+
editable?: boolean | DataGridEditableOptions;
|
|
68
|
+
editor?: DataGridEditorFactory;
|
|
69
|
+
editValidate?: (value: unknown, item: DataGridItem) => true | string;
|
|
70
|
+
filter?: DataGridColumnFilterFactory;
|
|
71
|
+
filterable?: boolean;
|
|
72
|
+
filterFn?: (value: unknown, filterValue: unknown, item: DataGridItem) => boolean;
|
|
73
|
+
filterType?: DataGridFilterType;
|
|
74
|
+
formatter?: (value: unknown, item: DataGridItem) => string;
|
|
75
|
+
hideable?: boolean;
|
|
76
|
+
label?: string;
|
|
77
|
+
movable?: boolean;
|
|
78
|
+
render?: (item: DataGridItem, index: number) => Node | string;
|
|
79
|
+
resizable?: boolean;
|
|
80
|
+
sortable?: boolean;
|
|
81
|
+
style?: Partial<CSSStyleDeclaration>;
|
|
82
|
+
width?: number;
|
|
83
|
+
}
|
|
84
|
+
export interface DataGridMenuAction {
|
|
85
|
+
key: string;
|
|
86
|
+
label: string;
|
|
87
|
+
disabled?: boolean;
|
|
88
|
+
group?: string;
|
|
89
|
+
icon?: string;
|
|
90
|
+
run: () => void;
|
|
91
|
+
}
|
|
92
|
+
export interface DataGridColumnMenuContext {
|
|
93
|
+
column: DataGridColumn;
|
|
94
|
+
defaultActions: DataGridMenuAction[];
|
|
95
|
+
}
|
|
96
|
+
export type DataGridColumnMenuBuilder = (context: DataGridColumnMenuContext) => DataGridMenuAction[];
|
|
97
|
+
export interface DataGridLabels {
|
|
98
|
+
addCondition: string;
|
|
99
|
+
applyFilter: string;
|
|
100
|
+
clearFilter: string;
|
|
101
|
+
clearSort: string;
|
|
102
|
+
columnMenu: string;
|
|
103
|
+
filterAction: string;
|
|
104
|
+
filterColumn: string;
|
|
105
|
+
firstPage: string;
|
|
106
|
+
globalFilterLabel: string;
|
|
107
|
+
globalFilterPlaceholder: string;
|
|
108
|
+
hideColumn: string;
|
|
109
|
+
itemsInfo: string;
|
|
110
|
+
joinAnd: string;
|
|
111
|
+
joinOr: string;
|
|
112
|
+
lastPage: string;
|
|
113
|
+
loadError: string;
|
|
114
|
+
loading: string;
|
|
115
|
+
moveLeft: string;
|
|
116
|
+
moveRight: string;
|
|
117
|
+
nextPage: string;
|
|
118
|
+
operatorBetween: string;
|
|
119
|
+
operatorBlank: string;
|
|
120
|
+
operatorContains: string;
|
|
121
|
+
operatorEndsWith: string;
|
|
122
|
+
operatorEquals: string;
|
|
123
|
+
operatorGreaterThan: string;
|
|
124
|
+
operatorGreaterThanOrEqual: string;
|
|
125
|
+
operatorLessThan: string;
|
|
126
|
+
operatorLessThanOrEqual: string;
|
|
127
|
+
operatorNotBlank: string;
|
|
128
|
+
operatorNotContains: string;
|
|
129
|
+
operatorNotEquals: string;
|
|
130
|
+
operatorStartsWith: string;
|
|
131
|
+
pageSizeLabel: string;
|
|
132
|
+
paginationLabel: string;
|
|
133
|
+
pinLeft: string;
|
|
134
|
+
pinRight: string;
|
|
135
|
+
previousPage: string;
|
|
136
|
+
redoneAnnouncement: string;
|
|
137
|
+
resetColumns: string;
|
|
138
|
+
resultsAnnouncement: string;
|
|
139
|
+
searchValues: string;
|
|
140
|
+
selectAllRows: string;
|
|
141
|
+
selectAllValues: string;
|
|
142
|
+
selectRow: string;
|
|
143
|
+
showAllColumns: string;
|
|
144
|
+
sortAscending: string;
|
|
145
|
+
sortDescending: string;
|
|
146
|
+
toolbarColumns: string;
|
|
147
|
+
toolbarExport: string;
|
|
148
|
+
toolbarRedo: string;
|
|
149
|
+
toolbarUndo: string;
|
|
150
|
+
undoneAnnouncement: string;
|
|
151
|
+
unpin: string;
|
|
152
|
+
}
|
|
153
|
+
export interface DataGridColumnSizingOptions {
|
|
154
|
+
mode?: 'onChange' | 'onEnd';
|
|
155
|
+
}
|
|
156
|
+
export interface DataGridSlotContext {
|
|
157
|
+
table: Table<DataGridItem>;
|
|
158
|
+
labels: DataGridLabels;
|
|
159
|
+
}
|
|
160
|
+
export interface DataGridSlot {
|
|
161
|
+
element: HTMLElement;
|
|
162
|
+
update?: () => void;
|
|
163
|
+
dispose?: () => void;
|
|
164
|
+
}
|
|
165
|
+
export type DataGridSlotFactory = (context: DataGridSlotContext) => DataGridSlot;
|
|
166
|
+
export interface DataGridSlots {
|
|
167
|
+
toolbar: DataGridSlotFactory;
|
|
168
|
+
pagination: DataGridSlotFactory;
|
|
169
|
+
empty: DataGridSlotFactory;
|
|
170
|
+
}
|
|
171
|
+
export interface DataGridToolbarOptions {
|
|
172
|
+
columns?: boolean;
|
|
173
|
+
export?: boolean | CsvDownloadOptions;
|
|
174
|
+
history?: boolean;
|
|
175
|
+
search?: boolean;
|
|
176
|
+
}
|
|
177
|
+
export interface DataGridSortingOptions {
|
|
178
|
+
multiple?: boolean;
|
|
179
|
+
resetable?: boolean;
|
|
180
|
+
}
|
|
181
|
+
export type DataGridSorterVisibility = 'always' | 'hover' | false;
|
|
182
|
+
export interface DataGridRowSelectionOptions {
|
|
183
|
+
selectAll?: boolean;
|
|
184
|
+
}
|
|
185
|
+
export interface DataGridPaginationInfoState {
|
|
186
|
+
pageCount: number;
|
|
187
|
+
pageIndex: number;
|
|
188
|
+
pageSize: number;
|
|
189
|
+
totalRows: number;
|
|
190
|
+
}
|
|
191
|
+
export interface DataGridPaginationOptions {
|
|
192
|
+
info?: boolean | ((state: DataGridPaginationInfoState) => string);
|
|
193
|
+
pageSize?: number;
|
|
194
|
+
pageSizeOptions?: number[];
|
|
195
|
+
position?: 'top' | 'bottom' | 'both';
|
|
196
|
+
}
|
|
197
|
+
export interface DataGridState {
|
|
198
|
+
columnFilters: ColumnFiltersState;
|
|
199
|
+
columnOrder: ColumnOrderState;
|
|
200
|
+
columnPinning: ColumnPinningState;
|
|
201
|
+
columnSizing: ColumnSizingState;
|
|
202
|
+
columnVisibility: VisibilityState;
|
|
203
|
+
globalFilter: string;
|
|
204
|
+
pagination: PaginationState;
|
|
205
|
+
rowSelection: RowSelectionState;
|
|
206
|
+
sorting: SortingState;
|
|
207
|
+
}
|
|
208
|
+
export interface DataGridDataRequest {
|
|
209
|
+
columnFilters: ColumnFiltersState;
|
|
210
|
+
globalFilter: string;
|
|
211
|
+
pagination: PaginationState;
|
|
212
|
+
sorting: SortingState;
|
|
213
|
+
}
|
|
214
|
+
export interface DataGridDataResponse {
|
|
215
|
+
items: DataGridItem[];
|
|
216
|
+
totalRows: number;
|
|
217
|
+
}
|
|
218
|
+
export interface DataGridOptions {
|
|
219
|
+
cellNavigation: boolean;
|
|
220
|
+
columnFilters: boolean;
|
|
221
|
+
columnMenu: boolean | DataGridColumnMenuBuilder;
|
|
222
|
+
columnMenuIcon: string;
|
|
223
|
+
columnOrder: boolean | ColumnOrderState;
|
|
224
|
+
columnPinning: boolean | ColumnPinningState;
|
|
225
|
+
columnSizing: boolean | DataGridColumnSizingOptions;
|
|
226
|
+
columnVisibility: boolean | VisibilityState;
|
|
227
|
+
columns: DataGridColumn[];
|
|
228
|
+
dataProvider: ((request: DataGridDataRequest) => Promise<DataGridDataResponse>) | null;
|
|
229
|
+
editing: boolean;
|
|
230
|
+
empty: string | (() => Node | string);
|
|
231
|
+
filterIcon: string;
|
|
232
|
+
globalFilter: boolean;
|
|
233
|
+
hideColumnIcon: string;
|
|
234
|
+
history: boolean;
|
|
235
|
+
itemKey: ((item: DataGridItem, index: number) => string) | null;
|
|
236
|
+
items: DataGridItem[];
|
|
237
|
+
labels: Partial<DataGridLabels>;
|
|
238
|
+
moveLeftIcon: string;
|
|
239
|
+
moveRightIcon: string;
|
|
240
|
+
overscan: number;
|
|
241
|
+
pagination: boolean | DataGridPaginationOptions;
|
|
242
|
+
pinLeftIcon: string;
|
|
243
|
+
pinRightIcon: string;
|
|
244
|
+
rowHeight: number;
|
|
245
|
+
rowSelection: boolean | DataGridRowSelectionOptions;
|
|
246
|
+
sanitize: boolean;
|
|
247
|
+
sanitizeFn: ((html: string) => string) | null;
|
|
248
|
+
slots: Partial<DataGridSlots>;
|
|
249
|
+
sortAscendingIcon: string;
|
|
250
|
+
sortDescendingIcon: string;
|
|
251
|
+
sortNeutralIcon: string;
|
|
252
|
+
sorterVisibility: DataGridSorterVisibility;
|
|
253
|
+
sorting: boolean | DataGridSortingOptions;
|
|
254
|
+
stateKey: string | null;
|
|
255
|
+
toolbar: boolean | DataGridToolbarOptions;
|
|
256
|
+
toolbarColumnsIcon: string;
|
|
257
|
+
toolbarExportIcon: string;
|
|
258
|
+
toolbarRedoIcon: string;
|
|
259
|
+
toolbarUndoIcon: string;
|
|
260
|
+
unpinIcon: string;
|
|
261
|
+
virtualization: boolean;
|
|
262
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid ui/body.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { Row } from '@tanstack/table-core';
|
|
8
|
+
import type { GridVirtualizerInstance } from '../engine/virtualizer';
|
|
9
|
+
import type { DataGridColumn, DataGridItem, DataGridLabels } from '../types';
|
|
10
|
+
import { type GridPinning } from './pinning';
|
|
11
|
+
export interface GridBodyContext {
|
|
12
|
+
cellNavigation: boolean;
|
|
13
|
+
headerRowCount: number;
|
|
14
|
+
labels: DataGridLabels;
|
|
15
|
+
getDataVersion: () => number;
|
|
16
|
+
getEditingCell: () => {
|
|
17
|
+
rowId: string;
|
|
18
|
+
columnId: string;
|
|
19
|
+
} | null;
|
|
20
|
+
getEditorElement: () => HTMLElement | null;
|
|
21
|
+
getPinning: () => GridPinning | null;
|
|
22
|
+
getRowIndexOffset: () => number;
|
|
23
|
+
getRows: () => Array<Row<DataGridItem>>;
|
|
24
|
+
getVisibleColumns: () => DataGridColumn[];
|
|
25
|
+
getVirtualizer: () => GridVirtualizerInstance | null;
|
|
26
|
+
renderEmpty: () => Node | string;
|
|
27
|
+
sanitizeContent: (html: string) => string;
|
|
28
|
+
selection: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface GridBody {
|
|
31
|
+
element: HTMLTableSectionElement;
|
|
32
|
+
update: () => void;
|
|
33
|
+
}
|
|
34
|
+
export declare const createBody: (context: GridBodyContext) => GridBody;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid ui/column-chooser.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { DataGridLabels } from '../types';
|
|
8
|
+
export interface ColumnChooserColumn {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
canHide: boolean;
|
|
12
|
+
visible: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface GridColumnChooserContext {
|
|
15
|
+
root: HTMLElement;
|
|
16
|
+
labels: DataGridLabels;
|
|
17
|
+
getColumns: () => ColumnChooserColumn[];
|
|
18
|
+
toggleVisibility: (columnId: string, visible: boolean) => void;
|
|
19
|
+
showAll: () => void;
|
|
20
|
+
reset: () => void;
|
|
21
|
+
}
|
|
22
|
+
export interface GridColumnChooser {
|
|
23
|
+
toggle: (button: HTMLElement) => void;
|
|
24
|
+
close: () => void;
|
|
25
|
+
dispose: () => void;
|
|
26
|
+
}
|
|
27
|
+
export declare const createColumnChooser: (context: GridColumnChooserContext) => GridColumnChooser;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid ui/editor.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { DataGridEditableOptions, DataGridEditor, DataGridEditorContext } from '../types';
|
|
8
|
+
export declare const createBuiltInEditor: (options: DataGridEditableOptions, context: DataGridEditorContext) => DataGridEditor;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid ui/filter-menu.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { DataGridColumn, DataGridColumnFilterValue, DataGridLabels } from '../types';
|
|
8
|
+
export interface GridFilterMenuContext {
|
|
9
|
+
root: HTMLElement;
|
|
10
|
+
labels: DataGridLabels;
|
|
11
|
+
getColumn: (columnKey: string) => DataGridColumn | null;
|
|
12
|
+
getFacetedValues: (columnKey: string) => unknown[];
|
|
13
|
+
getFilterValue: (columnKey: string) => DataGridColumnFilterValue | undefined;
|
|
14
|
+
applyFilter: (columnKey: string, value?: DataGridColumnFilterValue) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface GridFilterMenu {
|
|
17
|
+
toggle: (button: HTMLElement, columnKey: string) => void;
|
|
18
|
+
close: () => void;
|
|
19
|
+
dispose: () => void;
|
|
20
|
+
}
|
|
21
|
+
export declare const createFilterMenu: (context: GridFilterMenuContext) => GridFilterMenu;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid ui/header.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { DataGridColumn, DataGridItem, DataGridLabels, SortingState, Table } from '../types';
|
|
8
|
+
import { type GridPinning } from './pinning';
|
|
9
|
+
export interface GridHeaderContext {
|
|
10
|
+
cellNavigation: boolean;
|
|
11
|
+
columns: DataGridColumn[];
|
|
12
|
+
draggable: boolean;
|
|
13
|
+
filterRow: boolean;
|
|
14
|
+
hasMenu: (column: DataGridColumn) => boolean;
|
|
15
|
+
icons: {
|
|
16
|
+
columnMenu: string;
|
|
17
|
+
filter: string;
|
|
18
|
+
sortAscending: string;
|
|
19
|
+
sortDescending: string;
|
|
20
|
+
sortNeutral: string;
|
|
21
|
+
};
|
|
22
|
+
hasFilterMenu: (column: DataGridColumn) => boolean;
|
|
23
|
+
isFilterable: (column: DataGridColumn) => boolean;
|
|
24
|
+
isResizable: (column: DataGridColumn) => boolean;
|
|
25
|
+
isSortable: (column: DataGridColumn) => boolean;
|
|
26
|
+
labels: DataGridLabels;
|
|
27
|
+
resizable: boolean;
|
|
28
|
+
selection: boolean;
|
|
29
|
+
selectAll: boolean;
|
|
30
|
+
table: Table<DataGridItem>;
|
|
31
|
+
}
|
|
32
|
+
export interface GridHeaderState {
|
|
33
|
+
filteredColumns: string[] | null;
|
|
34
|
+
order: string[];
|
|
35
|
+
pinning: GridPinning | null;
|
|
36
|
+
resizingColumn: string | false;
|
|
37
|
+
sizes: Record<string, number> | null;
|
|
38
|
+
sorting: SortingState;
|
|
39
|
+
selectAll: {
|
|
40
|
+
checked: boolean;
|
|
41
|
+
indeterminate: boolean;
|
|
42
|
+
} | null;
|
|
43
|
+
}
|
|
44
|
+
export interface GridHeader {
|
|
45
|
+
element: HTMLTableSectionElement;
|
|
46
|
+
rowCount: number;
|
|
47
|
+
update: (state: GridHeaderState) => void;
|
|
48
|
+
dispose: () => void;
|
|
49
|
+
}
|
|
50
|
+
export declare const createHeader: (context: GridHeaderContext) => GridHeader;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid ui/loading.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { DataGridLabels } from '../types';
|
|
8
|
+
export interface GridLoading {
|
|
9
|
+
element: HTMLDivElement;
|
|
10
|
+
setVisible: (visible: boolean) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const createLoading: (labels: DataGridLabels) => GridLoading;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid ui/menu.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { DataGridMenuAction } from '../types';
|
|
8
|
+
export interface GridMenuContext {
|
|
9
|
+
root: HTMLElement;
|
|
10
|
+
getActions: (columnKey: string) => DataGridMenuAction[];
|
|
11
|
+
}
|
|
12
|
+
export interface GridMenu {
|
|
13
|
+
toggle: (button: HTMLElement, columnKey: string) => void;
|
|
14
|
+
close: () => void;
|
|
15
|
+
dispose: () => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const createMenu: (context: GridMenuContext) => GridMenu;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid ui/pagination.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { DataGridLabels, DataGridPaginationInfoState } from '../types';
|
|
8
|
+
export interface GridPaginationContext {
|
|
9
|
+
info: boolean | ((state: DataGridPaginationInfoState) => string);
|
|
10
|
+
labels: DataGridLabels;
|
|
11
|
+
pageSizeOptions: number[];
|
|
12
|
+
}
|
|
13
|
+
export interface GridPagination {
|
|
14
|
+
element: HTMLDivElement;
|
|
15
|
+
update: (state: DataGridPaginationInfoState) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const createPagination: (context: GridPaginationContext) => GridPagination;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid ui/pinning.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
export interface PinnedCellInfo {
|
|
8
|
+
side: 'left' | 'right';
|
|
9
|
+
offset: number;
|
|
10
|
+
edge: boolean;
|
|
11
|
+
afterSelect: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface GridPinning {
|
|
14
|
+
columns: Record<string, PinnedCellInfo>;
|
|
15
|
+
select: PinnedCellInfo | null;
|
|
16
|
+
}
|
|
17
|
+
export declare const applyPinnedCell: (cell: HTMLTableCellElement, info: PinnedCellInfo | null) => void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid ui/toolbar.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { CsvDownloadOptions } from '../util/csv';
|
|
8
|
+
import type { DataGridLabels, DataGridOptions } from '../types';
|
|
9
|
+
export interface GridToolbarContext {
|
|
10
|
+
labels: DataGridLabels;
|
|
11
|
+
columns: boolean;
|
|
12
|
+
export: boolean;
|
|
13
|
+
history: boolean;
|
|
14
|
+
search: boolean;
|
|
15
|
+
icons: {
|
|
16
|
+
columns: string;
|
|
17
|
+
export: string;
|
|
18
|
+
redo: string;
|
|
19
|
+
undo: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface GridToolbar {
|
|
23
|
+
element: HTMLDivElement;
|
|
24
|
+
}
|
|
25
|
+
export interface ResolvedToolbar {
|
|
26
|
+
columns: boolean;
|
|
27
|
+
export: boolean;
|
|
28
|
+
exportOptions: CsvDownloadOptions;
|
|
29
|
+
history: boolean;
|
|
30
|
+
search: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare const resolveToolbar: (options: DataGridOptions) => ResolvedToolbar;
|
|
33
|
+
export declare const isGlobalFilterEnabled: (options: DataGridOptions) => boolean;
|
|
34
|
+
export declare const createToolbar: (context: GridToolbarContext) => GridToolbar;
|