apex-grid 1.0.1 → 2.0.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 +76 -5
- package/README.md +520 -10
- package/components/cell.d.ts +74 -0
- package/components/cell.js +376 -0
- package/components/cell.js.map +1 -0
- package/{dist/src/components → components}/filter-row.d.ts +13 -12
- package/components/filter-row.js +396 -0
- package/components/filter-row.js.map +1 -0
- package/components/grid.d.ts +1173 -0
- package/components/grid.js +620 -0
- package/components/grid.js.map +1 -0
- package/components/header-row.d.ts +43 -0
- package/components/header-row.js +205 -0
- package/components/header-row.js.map +1 -0
- package/{dist/src/components → components}/header.d.ts +11 -5
- package/components/header.js +263 -0
- package/components/header.js.map +1 -0
- package/components/paginator.d.ts +56 -0
- package/components/paginator.js +148 -0
- package/components/paginator.js.map +1 -0
- package/components/row.d.ts +43 -0
- package/components/row.js +239 -0
- package/components/row.js.map +1 -0
- package/components/toolbar.d.ts +60 -0
- package/components/toolbar.js +275 -0
- package/components/toolbar.js.map +1 -0
- package/{dist/src/components → components}/virtualizer.d.ts +2 -3
- package/{dist/src/components → components}/virtualizer.js +3 -3
- package/components/virtualizer.js.map +1 -0
- package/controllers/data-operation.d.ts +31 -0
- package/controllers/data-operation.js +53 -0
- package/controllers/data-operation.js.map +1 -0
- package/controllers/dom.d.ts +55 -0
- package/controllers/dom.js +221 -0
- package/controllers/dom.js.map +1 -0
- package/controllers/editing.d.ts +130 -0
- package/controllers/editing.js +197 -0
- package/controllers/editing.js.map +1 -0
- package/controllers/expansion.d.ts +68 -0
- package/controllers/expansion.js +126 -0
- package/controllers/expansion.js.map +1 -0
- package/{dist/src/controllers → controllers}/filter.d.ts +2 -3
- package/controllers/filter.js +105 -0
- package/controllers/filter.js.map +1 -0
- package/{dist/src/controllers → controllers}/navigation.d.ts +18 -8
- package/{dist/src/controllers → controllers}/navigation.js +31 -20
- package/controllers/navigation.js.map +1 -0
- package/controllers/pagination.d.ts +102 -0
- package/controllers/pagination.js +106 -0
- package/controllers/pagination.js.map +1 -0
- package/controllers/reorder.d.ts +78 -0
- package/controllers/reorder.js +124 -0
- package/controllers/reorder.js.map +1 -0
- package/{dist/src/controllers → controllers}/resize.d.ts +2 -3
- package/controllers/resize.js +52 -0
- package/controllers/resize.js.map +1 -0
- package/controllers/selection.d.ts +109 -0
- package/controllers/selection.js +168 -0
- package/controllers/selection.js.map +1 -0
- package/{dist/src/controllers → controllers}/sort.d.ts +1 -2
- package/controllers/sort.js +122 -0
- package/controllers/sort.js.map +1 -0
- package/controllers/state.d.ts +56 -0
- package/controllers/state.js +74 -0
- package/controllers/state.js.map +1 -0
- package/controllers/tree.d.ts +87 -0
- package/controllers/tree.js +0 -0
- package/controllers/tree.js.map +1 -0
- package/custom-elements.json +6901 -1554
- package/{dist/src/define.d.ts → define.d.ts} +0 -1
- package/define.js.map +1 -0
- package/docs/assets/hierarchy.js +1 -0
- package/docs/assets/highlight.css +127 -0
- package/docs/assets/icons.js +18 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +60 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1633 -0
- package/docs/classes/ApexGrid.html +371 -0
- package/docs/functions/setup.html +22 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +504 -0
- package/docs/interfaces/ApexCellValueChangedEvent.html +11 -0
- package/docs/interfaces/ApexCellValueChangingEvent.html +13 -0
- package/docs/interfaces/ApexColumnMovedEvent.html +8 -0
- package/docs/interfaces/ApexColumnMovingEvent.html +11 -0
- package/docs/interfaces/ApexColumnPinnedEvent.html +6 -0
- package/docs/interfaces/ApexColumnPinningEvent.html +8 -0
- package/docs/interfaces/ApexDetailContext.html +8 -0
- package/docs/interfaces/ApexFilteredEvent.html +6 -0
- package/docs/interfaces/ApexFilteringEvent.html +12 -0
- package/docs/interfaces/ApexGridEventMap.html +68 -0
- package/docs/interfaces/ApexHeaderContext.html +6 -0
- package/docs/interfaces/ApexPageChangedEvent.html +10 -0
- package/docs/interfaces/ApexPageChangingEvent.html +10 -0
- package/docs/interfaces/ApexQuickFilterChangedEvent.html +4 -0
- package/docs/interfaces/ApexQuickFilterChangingEvent.html +6 -0
- package/docs/interfaces/ApexRowEditEndedEvent.html +6 -0
- package/docs/interfaces/ApexRowEditStartedEvent.html +4 -0
- package/docs/interfaces/ApexRowExpandedEvent.html +8 -0
- package/docs/interfaces/ApexRowExpandingEvent.html +11 -0
- package/docs/interfaces/ApexRowSelectedEvent.html +8 -0
- package/docs/interfaces/ApexRowSelectingEvent.html +11 -0
- package/docs/interfaces/ApexTreeRowExpandedEvent.html +8 -0
- package/docs/interfaces/ApexTreeRowExpandingEvent.html +10 -0
- package/docs/interfaces/BaseApexCellContext.html +16 -0
- package/docs/interfaces/BaseApexEditorContext.html +19 -0
- package/docs/interfaces/BaseColumnConfiguration.html +83 -0
- package/docs/interfaces/BaseColumnSortConfiguration.html +6 -0
- package/docs/interfaces/BaseFilterExpression.html +15 -0
- package/docs/interfaces/BaseSortExpression.html +12 -0
- package/docs/interfaces/CSVExportOptions.html +22 -0
- package/docs/interfaces/ColumnFilterConfiguration.html +4 -0
- package/docs/interfaces/DataPipelineConfiguration.html +15 -0
- package/docs/interfaces/ExportOptions.html +15 -0
- package/docs/interfaces/GridEditingConfiguration.html +10 -0
- package/docs/interfaces/GridExpansionConfiguration.html +15 -0
- package/docs/interfaces/GridSelectionConfiguration.html +11 -0
- package/docs/interfaces/GridSortConfiguration.html +6 -0
- package/docs/interfaces/GridTreeConfiguration.html +33 -0
- package/docs/interfaces/PaginationConfiguration.html +18 -0
- package/docs/interfaces/PaginationState.html +10 -0
- package/docs/interfaces/XLSXExportOptions.html +17 -0
- package/docs/media/package.json +83 -0
- package/docs/media/publish.yml +111 -0
- package/docs/modules.html +1 -0
- package/docs/types/ApexCellContext.html +2 -0
- package/docs/types/ApexEditorContext.html +2 -0
- package/docs/types/BasePropertyType.html +2 -0
- package/docs/types/BaseSortComparer.html +2 -0
- package/docs/types/ColumnConfiguration.html +2 -0
- package/docs/types/ColumnDropPosition.html +2 -0
- package/docs/types/ColumnSortConfiguration.html +2 -0
- package/docs/types/DataPipelineHook.html +2 -0
- package/docs/types/DataPipelineParams.html +8 -0
- package/docs/types/DataType.html +30 -0
- package/docs/types/EditMode.html +6 -0
- package/docs/types/EditTrigger.html +4 -0
- package/docs/types/ExportCellValue.html +5 -0
- package/docs/types/ExportSource.html +8 -0
- package/docs/types/FilterCriteria.html +6 -0
- package/docs/types/FilterExpression.html +2 -0
- package/docs/types/Keys.html +2 -0
- package/docs/types/PaginationMode.html +6 -0
- package/docs/types/PinPosition.html +5 -0
- package/docs/types/PropertyType.html +2 -0
- package/docs/types/SelectionMode.html +7 -0
- package/docs/types/SortComparer.html +2 -0
- package/docs/types/SortExpression.html +2 -0
- package/docs/types/SortState.html +2 -0
- package/docs/types/SortingDirection.html +3 -0
- package/index.d.ts +11 -0
- package/{dist/src/index.js → index.js} +1 -0
- package/index.js.map +1 -0
- package/internal/column-types.d.ts +94 -0
- package/internal/column-types.js +268 -0
- package/internal/column-types.js.map +1 -0
- package/{dist/src/internal → internal}/constants.d.ts +0 -1
- package/internal/constants.js.map +1 -0
- package/internal/export.d.ts +106 -0
- package/internal/export.js +122 -0
- package/internal/export.js.map +1 -0
- package/internal/flip.d.ts +80 -0
- package/internal/flip.js +52 -0
- package/internal/flip.js.map +1 -0
- package/internal/icons.d.ts +24 -0
- package/internal/icons.js +134 -0
- package/internal/icons.js.map +1 -0
- package/{dist/src/internal → internal}/is-defined.d.ts +0 -1
- package/internal/is-defined.js.map +1 -0
- package/{dist/src/internal → internal}/mixins/event-emitter.d.ts +0 -1
- package/internal/mixins/event-emitter.js.map +1 -0
- package/{dist/src/internal → internal}/normalize-case.d.ts +0 -1
- package/internal/normalize-case.js.map +1 -0
- package/{dist/src/internal → internal}/part-map.d.ts +0 -1
- package/{dist/src/internal → internal}/part-map.js +1 -1
- package/internal/part-map.js.map +1 -0
- package/{dist/src/internal → internal}/register.d.ts +3 -4
- package/internal/register.js +9 -0
- package/internal/register.js.map +1 -0
- package/{dist/src/internal → internal}/tags.d.ts +2 -1
- package/{dist/src/internal → internal}/tags.js +2 -0
- package/internal/tags.js.map +1 -0
- package/internal/theming.d.ts +34 -0
- package/internal/theming.js +123 -0
- package/internal/theming.js.map +1 -0
- package/internal/types.d.ts +619 -0
- package/internal/types.js.map +1 -0
- package/internal/utils.d.ts +29 -0
- package/internal/utils.js +75 -0
- package/internal/utils.js.map +1 -0
- package/{dist/src/internal → internal}/watch.d.ts +0 -1
- package/{dist/src/internal → internal}/watch.js +2 -2
- package/internal/watch.js.map +1 -0
- package/internal/xlsx.d.ts +22 -0
- package/internal/xlsx.js +228 -0
- package/internal/xlsx.js.map +1 -0
- package/{dist/src/operations → operations}/base.d.ts +0 -1
- package/operations/base.js.map +1 -0
- package/{dist/src/operations → operations}/filter/operands/boolean.d.ts +0 -1
- package/{dist/src/operations → operations}/filter/operands/boolean.js +5 -5
- package/operations/filter/operands/boolean.js.map +1 -0
- package/{dist/src/operations → operations}/filter/operands/number.d.ts +0 -1
- package/{dist/src/operations → operations}/filter/operands/number.js +2 -2
- package/operations/filter/operands/number.js.map +1 -0
- package/{dist/src/operations → operations}/filter/operands/string.d.ts +0 -1
- package/{dist/src/operations → operations}/filter/operands/string.js +2 -2
- package/operations/filter/operands/string.js.map +1 -0
- package/{dist/src/operations → operations}/filter/state.d.ts +1 -2
- package/{dist/src/operations → operations}/filter/state.js +3 -4
- package/operations/filter/state.js.map +1 -0
- package/{dist/src/operations → operations}/filter/tree.d.ts +1 -2
- package/{dist/src/operations → operations}/filter/tree.js +5 -6
- package/operations/filter/tree.js.map +1 -0
- package/{dist/src/operations → operations}/filter/types.d.ts +0 -1
- package/operations/filter/types.js.map +1 -0
- package/{dist/src/operations → operations}/filter.d.ts +0 -1
- package/{dist/src/operations → operations}/filter.js +4 -7
- package/operations/filter.js.map +1 -0
- package/operations/pagination.d.ts +19 -0
- package/operations/pagination.js +12 -0
- package/operations/pagination.js.map +1 -0
- package/operations/quick-filter.d.ts +21 -0
- package/operations/quick-filter.js +26 -0
- package/operations/quick-filter.js.map +1 -0
- package/{dist/src/operations → operations}/sort/types.d.ts +0 -1
- package/operations/sort/types.js.map +1 -0
- package/{dist/src/operations → operations}/sort.d.ts +0 -1
- package/{dist/src/operations → operations}/sort.js +5 -5
- package/operations/sort.js.map +1 -0
- package/package.json +25 -83
- package/setup.d.ts +58 -0
- package/setup.js +29 -0
- package/setup.js.map +1 -0
- package/{dist/src/styles/body-row/body-row-styles.css.d.ts → styles/_common.css.d.ts} +0 -1
- package/styles/_common.css.js +3 -0
- package/styles/_common.css.js.map +1 -0
- package/{dist/src/styles/body-cell/body-cell-styles.css.d.ts → styles/body-cell/body-cell.css.d.ts} +0 -1
- package/styles/body-cell/body-cell.css.js +3 -0
- package/styles/body-cell/body-cell.css.js.map +1 -0
- package/{dist/src/styles/filter-row/filter-row-styles.css.d.ts → styles/body-row/body-row.css.d.ts} +0 -1
- package/styles/body-row/body-row.css.js +3 -0
- package/styles/body-row/body-row.css.js.map +1 -0
- package/{dist/src/styles/grid/themes/light/grid.fluent-styles.css.d.ts → styles/filter-row/filter-row.css.d.ts} +0 -1
- package/styles/filter-row/filter-row.css.js +3 -0
- package/styles/filter-row/filter-row.css.js.map +1 -0
- package/styles/grid/_grid.base.css.d.ts +1 -0
- package/styles/grid/_grid.base.css.js +3 -0
- package/styles/grid/_grid.base.css.js.map +1 -0
- package/styles/grid/themes/light/grid.bootstrap.css.d.ts +1 -0
- package/styles/grid/themes/light/grid.bootstrap.css.js +3 -0
- package/styles/grid/themes/light/grid.bootstrap.css.js.map +1 -0
- package/styles/grid/themes/light/grid.fluent.css.d.ts +1 -0
- package/styles/grid/themes/light/grid.fluent.css.js +3 -0
- package/styles/grid/themes/light/grid.fluent.css.js.map +1 -0
- package/styles/grid/themes/light/grid.indigo.css.d.ts +1 -0
- package/styles/grid/themes/light/grid.indigo.css.js +3 -0
- package/styles/grid/themes/light/grid.indigo.css.js.map +1 -0
- package/styles/grid/themes/light/grid.material.css.d.ts +1 -0
- package/styles/grid/themes/light/grid.material.css.js +3 -0
- package/styles/grid/themes/light/grid.material.css.js.map +1 -0
- package/styles/header-cell/header-cell.css.d.ts +1 -0
- package/styles/header-cell/header-cell.css.js +3 -0
- package/styles/header-cell/header-cell.css.js.map +1 -0
- package/styles/header-row/header-row.base.css.d.ts +1 -0
- package/styles/header-row/header-row.base.css.js +3 -0
- package/styles/header-row/header-row.base.css.js.map +1 -0
- package/styles/paginator/paginator.css.d.ts +1 -0
- package/styles/paginator/paginator.css.js +3 -0
- package/styles/paginator/paginator.css.js.map +1 -0
- package/styles/toolbar/toolbar.css.d.ts +1 -0
- package/styles/toolbar/toolbar.css.js +3 -0
- package/styles/toolbar/toolbar.css.js.map +1 -0
- package/styles.css +17 -0
- package/dist/bundle.js +0 -2194
- package/dist/docs/assets/highlight.css +0 -43
- package/dist/docs/assets/main.js +0 -58
- package/dist/docs/assets/search.js +0 -1
- package/dist/docs/assets/style.css +0 -1365
- package/dist/docs/classes/ApexGrid.html +0 -327
- package/dist/docs/index.html +0 -82
- package/dist/docs/interfaces/ApexFilteredEvent.html +0 -104
- package/dist/docs/interfaces/ApexFilteringEvent.html +0 -116
- package/dist/docs/interfaces/ApexGridEventMap.html +0 -127
- package/dist/docs/interfaces/ApexHeaderContext.html +0 -104
- package/dist/docs/interfaces/BaseApexCellContext.html +0 -120
- package/dist/docs/interfaces/BaseColumnConfiguration.html +0 -196
- package/dist/docs/interfaces/BaseColumnSortConfiguration.html +0 -106
- package/dist/docs/interfaces/BaseFilterExpression.html +0 -132
- package/dist/docs/interfaces/BaseSortExpression.html +0 -124
- package/dist/docs/interfaces/ColumnFilterConfiguration.html +0 -92
- package/dist/docs/interfaces/DataPipelineConfiguration.html +0 -104
- package/dist/docs/interfaces/GridSortConfiguration.html +0 -99
- package/dist/docs/modules.html +0 -102
- package/dist/docs/types/ApexCellContext.html +0 -74
- package/dist/docs/types/BasePropertyType.html +0 -74
- package/dist/docs/types/BaseSortComparer.html +0 -89
- package/dist/docs/types/ColumnConfiguration.html +0 -74
- package/dist/docs/types/ColumnSortConfiguration.html +0 -74
- package/dist/docs/types/DataPipelineHook.html +0 -85
- package/dist/docs/types/DataPipelineParams.html +0 -87
- package/dist/docs/types/DataType.html +0 -67
- package/dist/docs/types/FilterCriteria.html +0 -71
- package/dist/docs/types/FilterExpression.html +0 -74
- package/dist/docs/types/Keys.html +0 -72
- package/dist/docs/types/PropertyType.html +0 -74
- package/dist/docs/types/SortComparer.html +0 -74
- package/dist/docs/types/SortExpression.html +0 -74
- package/dist/docs/types/SortState.html +0 -72
- package/dist/docs/types/SortingDirection.html +0 -69
- package/dist/src/components/cell.d.ts +0 -36
- package/dist/src/components/cell.d.ts.map +0 -1
- package/dist/src/components/cell.js +0 -55
- package/dist/src/components/cell.js.map +0 -1
- package/dist/src/components/filter-row.d.ts.map +0 -1
- package/dist/src/components/filter-row.js +0 -316
- package/dist/src/components/filter-row.js.map +0 -1
- package/dist/src/components/grid.d.ts +0 -226
- package/dist/src/components/grid.d.ts.map +0 -1
- package/dist/src/components/grid.js +0 -309
- package/dist/src/components/grid.js.map +0 -1
- package/dist/src/components/header-row.d.ts +0 -24
- package/dist/src/components/header-row.d.ts.map +0 -1
- package/dist/src/components/header-row.js +0 -78
- package/dist/src/components/header-row.js.map +0 -1
- package/dist/src/components/header.d.ts.map +0 -1
- package/dist/src/components/header.js +0 -144
- package/dist/src/components/header.js.map +0 -1
- package/dist/src/components/row.d.ts +0 -25
- package/dist/src/components/row.d.ts.map +0 -1
- package/dist/src/components/row.js +0 -68
- package/dist/src/components/row.js.map +0 -1
- package/dist/src/components/virtualizer.d.ts.map +0 -1
- package/dist/src/components/virtualizer.js.map +0 -1
- package/dist/src/controllers/data-operation.d.ts +0 -18
- package/dist/src/controllers/data-operation.d.ts.map +0 -1
- package/dist/src/controllers/data-operation.js +0 -37
- package/dist/src/controllers/data-operation.js.map +0 -1
- package/dist/src/controllers/dom.d.ts +0 -20
- package/dist/src/controllers/dom.d.ts.map +0 -1
- package/dist/src/controllers/dom.js +0 -60
- package/dist/src/controllers/dom.js.map +0 -1
- package/dist/src/controllers/filter.d.ts.map +0 -1
- package/dist/src/controllers/filter.js +0 -119
- package/dist/src/controllers/filter.js.map +0 -1
- package/dist/src/controllers/navigation.d.ts.map +0 -1
- package/dist/src/controllers/navigation.js.map +0 -1
- package/dist/src/controllers/resize.d.ts.map +0 -1
- package/dist/src/controllers/resize.js +0 -70
- package/dist/src/controllers/resize.js.map +0 -1
- package/dist/src/controllers/sort.d.ts.map +0 -1
- package/dist/src/controllers/sort.js +0 -94
- package/dist/src/controllers/sort.js.map +0 -1
- package/dist/src/controllers/state.d.ts +0 -25
- package/dist/src/controllers/state.d.ts.map +0 -1
- package/dist/src/controllers/state.js +0 -40
- package/dist/src/controllers/state.js.map +0 -1
- package/dist/src/define.d.ts.map +0 -1
- package/dist/src/define.js.map +0 -1
- package/dist/src/index.d.ts +0 -9
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js.map +0 -1
- package/dist/src/internal/constants.d.ts.map +0 -1
- package/dist/src/internal/constants.js.map +0 -1
- package/dist/src/internal/icon-registry.d.ts +0 -2
- package/dist/src/internal/icon-registry.d.ts.map +0 -1
- package/dist/src/internal/icon-registry.js +0 -29
- package/dist/src/internal/icon-registry.js.map +0 -1
- package/dist/src/internal/is-defined.d.ts.map +0 -1
- package/dist/src/internal/is-defined.js.map +0 -1
- package/dist/src/internal/mixins/event-emitter.d.ts.map +0 -1
- package/dist/src/internal/mixins/event-emitter.js.map +0 -1
- package/dist/src/internal/normalize-case.d.ts.map +0 -1
- package/dist/src/internal/normalize-case.js.map +0 -1
- package/dist/src/internal/part-map.d.ts.map +0 -1
- package/dist/src/internal/part-map.js.map +0 -1
- package/dist/src/internal/register.d.ts.map +0 -1
- package/dist/src/internal/register.js +0 -9
- package/dist/src/internal/register.js.map +0 -1
- package/dist/src/internal/tags.d.ts.map +0 -1
- package/dist/src/internal/tags.js.map +0 -1
- package/dist/src/internal/types.d.ts +0 -199
- package/dist/src/internal/types.d.ts.map +0 -1
- package/dist/src/internal/types.js.map +0 -1
- package/dist/src/internal/utils.d.ts +0 -7
- package/dist/src/internal/utils.d.ts.map +0 -1
- package/dist/src/internal/utils.js +0 -37
- package/dist/src/internal/utils.js.map +0 -1
- package/dist/src/internal/watch.d.ts.map +0 -1
- package/dist/src/internal/watch.js.map +0 -1
- package/dist/src/operations/base.d.ts.map +0 -1
- package/dist/src/operations/base.js.map +0 -1
- package/dist/src/operations/filter/operands/boolean.d.ts.map +0 -1
- package/dist/src/operations/filter/operands/boolean.js.map +0 -1
- package/dist/src/operations/filter/operands/number.d.ts.map +0 -1
- package/dist/src/operations/filter/operands/number.js.map +0 -1
- package/dist/src/operations/filter/operands/string.d.ts.map +0 -1
- package/dist/src/operations/filter/operands/string.js.map +0 -1
- package/dist/src/operations/filter/state.d.ts.map +0 -1
- package/dist/src/operations/filter/state.js.map +0 -1
- package/dist/src/operations/filter/tree.d.ts.map +0 -1
- package/dist/src/operations/filter/tree.js.map +0 -1
- package/dist/src/operations/filter/types.d.ts.map +0 -1
- package/dist/src/operations/filter/types.js.map +0 -1
- package/dist/src/operations/filter.d.ts.map +0 -1
- package/dist/src/operations/filter.js.map +0 -1
- package/dist/src/operations/sort/types.d.ts.map +0 -1
- package/dist/src/operations/sort/types.js.map +0 -1
- package/dist/src/operations/sort.d.ts.map +0 -1
- package/dist/src/operations/sort.js.map +0 -1
- package/dist/src/styles/body-cell/body-cell-styles.css.d.ts.map +0 -1
- package/dist/src/styles/body-cell/body-cell-styles.css.js +0 -71
- package/dist/src/styles/body-cell/body-cell-styles.css.js.map +0 -1
- package/dist/src/styles/body-row/body-row-styles.css.d.ts.map +0 -1
- package/dist/src/styles/body-row/body-row-styles.css.js +0 -38
- package/dist/src/styles/body-row/body-row-styles.css.js.map +0 -1
- package/dist/src/styles/filter-row/filter-row-styles.css.d.ts.map +0 -1
- package/dist/src/styles/filter-row/filter-row-styles.css.js +0 -96
- package/dist/src/styles/filter-row/filter-row-styles.css.js.map +0 -1
- package/dist/src/styles/grid/themes/light/grid.bootstrap-styles.css.d.ts +0 -2
- package/dist/src/styles/grid/themes/light/grid.bootstrap-styles.css.d.ts.map +0 -1
- package/dist/src/styles/grid/themes/light/grid.bootstrap-styles.css.js +0 -83
- package/dist/src/styles/grid/themes/light/grid.bootstrap-styles.css.js.map +0 -1
- package/dist/src/styles/grid/themes/light/grid.fluent-styles.css.d.ts.map +0 -1
- package/dist/src/styles/grid/themes/light/grid.fluent-styles.css.js +0 -83
- package/dist/src/styles/grid/themes/light/grid.fluent-styles.css.js.map +0 -1
- package/dist/src/styles/grid/themes/light/grid.indigo-styles.css.d.ts +0 -2
- package/dist/src/styles/grid/themes/light/grid.indigo-styles.css.d.ts.map +0 -1
- package/dist/src/styles/grid/themes/light/grid.indigo-styles.css.js +0 -83
- package/dist/src/styles/grid/themes/light/grid.indigo-styles.css.js.map +0 -1
- package/dist/src/styles/grid/themes/light/grid.material-styles.css.d.ts +0 -2
- package/dist/src/styles/grid/themes/light/grid.material-styles.css.d.ts.map +0 -1
- package/dist/src/styles/grid/themes/light/grid.material-styles.css.js +0 -83
- package/dist/src/styles/grid/themes/light/grid.material-styles.css.js.map +0 -1
- package/dist/src/styles/header-cell/header-cell-styles.css.d.ts +0 -2
- package/dist/src/styles/header-cell/header-cell-styles.css.d.ts.map +0 -1
- package/dist/src/styles/header-cell/header-cell-styles.css.js +0 -141
- package/dist/src/styles/header-cell/header-cell-styles.css.js.map +0 -1
- package/dist/src/styles/header-row/header-row.base-styles.css.d.ts +0 -2
- package/dist/src/styles/header-row/header-row.base-styles.css.d.ts.map +0 -1
- package/dist/src/styles/header-row/header-row.base-styles.css.js +0 -35
- package/dist/src/styles/header-row/header-row.base-styles.css.js.map +0 -1
- /package/{dist/src/define.js → define.js} +0 -0
- /package/{dist/docs → docs}/.nojekyll +0 -0
- /package/{dist/src/internal → internal}/constants.js +0 -0
- /package/{dist/src/internal → internal}/is-defined.js +0 -0
- /package/{dist/src/internal → internal}/mixins/event-emitter.js +0 -0
- /package/{dist/src/internal → internal}/normalize-case.js +0 -0
- /package/{dist/src/internal → internal}/types.js +0 -0
- /package/{dist/src/operations → operations}/base.js +0 -0
- /package/{dist/src/operations → operations}/filter/types.js +0 -0
- /package/{dist/src/operations → operations}/sort/types.js +0 -0
|
@@ -0,0 +1,619 @@
|
|
|
1
|
+
import type { ReactiveControllerHost, TemplateResult } from 'lit';
|
|
2
|
+
import type ApexGridCell from '../components/cell.js';
|
|
3
|
+
import type { ApexGrid } from '../components/grid.js';
|
|
4
|
+
import type ApexGridHeader from '../components/header.js';
|
|
5
|
+
import type ApexGridRow from '../components/row.js';
|
|
6
|
+
import type { SortComparer } from '../operations/sort/types.js';
|
|
7
|
+
export type NavigationState = 'previous' | 'current';
|
|
8
|
+
export type GridHost<T extends object> = ReactiveControllerHost & ApexGrid<T>;
|
|
9
|
+
/**
|
|
10
|
+
* Helper type for resolving keys of type T.
|
|
11
|
+
*/
|
|
12
|
+
export type Keys<T> = keyof T;
|
|
13
|
+
/**
|
|
14
|
+
* Helper type for resolving types of type T.
|
|
15
|
+
*/
|
|
16
|
+
export type BasePropertyType<T, K extends Keys<T> = Keys<T>> = T[K];
|
|
17
|
+
/**
|
|
18
|
+
* Helper type for resolving types of type T.
|
|
19
|
+
*/
|
|
20
|
+
export type PropertyType<T, K extends Keys<T> = Keys<T>> = K extends Keys<T> ? BasePropertyType<T, K> : never;
|
|
21
|
+
/**
|
|
22
|
+
* The data type — or, for the declarative built-ins (`'select'`, `'rating'`,
|
|
23
|
+
* `'date'`, `'image'`), the presentation type — for the current column.
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* - `'string'` / `'number'` are the primitive data types. They drive the
|
|
27
|
+
* default filter operands, the default editor, and the default sort
|
|
28
|
+
* comparison.
|
|
29
|
+
* - `'boolean'` stores `true` / `false`. In display mode the grid renders
|
|
30
|
+
* a check-mark icon for `true` and a dimmed mark for `false`. In edit
|
|
31
|
+
* mode the default editor is a native checkbox.
|
|
32
|
+
* - `'select'` is a presentation type for columns that store one of a fixed
|
|
33
|
+
* set of values. Supply the available options via
|
|
34
|
+
* {@link BaseColumnConfiguration.options}. The cell renders the matching
|
|
35
|
+
* option's label in display mode and a native `<select>` in edit mode.
|
|
36
|
+
* For sorting / filtering, select columns behave as their underlying
|
|
37
|
+
* value type (typically string).
|
|
38
|
+
* - `'rating'` renders a numeric value (0..`max`) as filled stars in display
|
|
39
|
+
* mode and as an interactive star picker in edit mode. Configure the star
|
|
40
|
+
* count via {@link BaseColumnConfiguration.max} (defaults to `5`).
|
|
41
|
+
* For sorting / filtering, rating columns behave as numbers.
|
|
42
|
+
* - `'date'` renders values as locale-aware formatted dates in display mode
|
|
43
|
+
* and a native `<input type="date">` in edit mode. Accepts `Date`
|
|
44
|
+
* instances, ISO strings, or millisecond timestamps as input and commits
|
|
45
|
+
* back in the same shape. Configure the display format via
|
|
46
|
+
* {@link BaseColumnConfiguration.format} (`'short' | 'medium' | 'long' |
|
|
47
|
+
* 'full'`, default `'medium'`).
|
|
48
|
+
* - `'image'` renders the value as an `<img>` source. Use
|
|
49
|
+
* {@link BaseColumnConfiguration.shape} to pick between `'square'`
|
|
50
|
+
* (default) and `'circle'`. The cell's default text editor is used for
|
|
51
|
+
* editing the URL string when `editable: true` is set.
|
|
52
|
+
*/
|
|
53
|
+
export type DataType = 'number' | 'string' | 'boolean' | 'select' | 'rating' | 'date' | 'image';
|
|
54
|
+
/**
|
|
55
|
+
* Display format presets for `'date'` columns. Map to
|
|
56
|
+
* `Intl.DateTimeFormatOptions.dateStyle`.
|
|
57
|
+
*/
|
|
58
|
+
export type ColumnDateFormat = 'short' | 'medium' | 'long' | 'full';
|
|
59
|
+
/**
|
|
60
|
+
* An entry in a `'select'` column's `options` list. Bare values use
|
|
61
|
+
* `String(value)` as their display label; the explicit form lets you give
|
|
62
|
+
* a value a separate display label.
|
|
63
|
+
*/
|
|
64
|
+
export type ColumnSelectOption<V = unknown> = V | {
|
|
65
|
+
value: V;
|
|
66
|
+
label?: string;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Configures the sort behavior for the grid.
|
|
70
|
+
*/
|
|
71
|
+
export interface GridSortConfiguration {
|
|
72
|
+
/**
|
|
73
|
+
* Whether multiple sorting is enabled.
|
|
74
|
+
*/
|
|
75
|
+
multiple: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Whether tri-state sorting is enabled.
|
|
78
|
+
*/
|
|
79
|
+
triState: boolean;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Extended sort configuration for a column.
|
|
83
|
+
*/
|
|
84
|
+
export interface BaseColumnSortConfiguration<T, K extends Keys<T> = Keys<T>> {
|
|
85
|
+
/**
|
|
86
|
+
* Whether the sort operations will be case sensitive.
|
|
87
|
+
*/
|
|
88
|
+
caseSensitive?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Custom comparer function for sort operations for this column.
|
|
91
|
+
*/
|
|
92
|
+
comparer?: SortComparer<T, K>;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* See {@link BaseColumnSortConfiguration} for the full documentation.
|
|
96
|
+
*/
|
|
97
|
+
export type ColumnSortConfiguration<T, K extends Keys<T> = Keys<T>> = K extends Keys<T> ? BaseColumnSortConfiguration<T, K> : never;
|
|
98
|
+
/**
|
|
99
|
+
* Extended filter configuration for a column.
|
|
100
|
+
*/
|
|
101
|
+
export interface ColumnFilterConfiguration {
|
|
102
|
+
/**
|
|
103
|
+
* Whether the filter operations will be case sensitive.
|
|
104
|
+
*/
|
|
105
|
+
caseSensitive?: boolean;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Pin position for a column.
|
|
109
|
+
*
|
|
110
|
+
* @remarks
|
|
111
|
+
* `'start'` pins the column to the leading edge of the grid (inline-start);
|
|
112
|
+
* `'end'` pins it to the trailing edge. `null` or `undefined` means the column
|
|
113
|
+
* is part of the scrollable region.
|
|
114
|
+
*/
|
|
115
|
+
export type PinPosition = 'start' | 'end' | null;
|
|
116
|
+
/** Configuration object for grid columns. */
|
|
117
|
+
export interface BaseColumnConfiguration<T extends object, K extends Keys<T> = Keys<T>> {
|
|
118
|
+
/**
|
|
119
|
+
* The field for from the data the this column will reference.
|
|
120
|
+
*/
|
|
121
|
+
key: K;
|
|
122
|
+
/**
|
|
123
|
+
* The type of data this column will reference.
|
|
124
|
+
*
|
|
125
|
+
* Affects the default filter operands if the column is with filtering enabled.
|
|
126
|
+
*
|
|
127
|
+
* @remarks
|
|
128
|
+
* If not passed, `string` is assumed to be the default type.
|
|
129
|
+
*
|
|
130
|
+
*/
|
|
131
|
+
type?: DataType;
|
|
132
|
+
/**
|
|
133
|
+
* Optional text to display in the column header. By default, the column key is used
|
|
134
|
+
* to render the header text.
|
|
135
|
+
*/
|
|
136
|
+
headerText?: string;
|
|
137
|
+
/**
|
|
138
|
+
* Width for the current column.
|
|
139
|
+
*
|
|
140
|
+
* Accepts most CSS units for controlling width.
|
|
141
|
+
*
|
|
142
|
+
* @remarks
|
|
143
|
+
* If not passed, the column will try to size itself based on the number of other
|
|
144
|
+
* columns and the total width of the grid.
|
|
145
|
+
*
|
|
146
|
+
*/
|
|
147
|
+
width?: string;
|
|
148
|
+
/**
|
|
149
|
+
* Whether the column is hidden or not.
|
|
150
|
+
*/
|
|
151
|
+
hidden?: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Whether this column is included when exporting via
|
|
154
|
+
* {@link ApexGrid.exportToCSV} or {@link ApexGrid.exportToXLSX}.
|
|
155
|
+
*
|
|
156
|
+
* @remarks
|
|
157
|
+
* Defaults to `true`. Set to `false` to omit a column from generated files
|
|
158
|
+
* (useful for action columns, derived UI, or sensitive fields). The
|
|
159
|
+
* grid-rendered selection checkbox column is never exported regardless of
|
|
160
|
+
* this flag.
|
|
161
|
+
*/
|
|
162
|
+
exportable?: boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Pin the column to a side of the grid.
|
|
165
|
+
*
|
|
166
|
+
* @remarks
|
|
167
|
+
* Pinned columns stay fixed during horizontal scroll. Use `'start'` (left in LTR,
|
|
168
|
+
* right in RTL) for the leading edge or `'end'` for the trailing edge. The grid
|
|
169
|
+
* renders columns in the order: `'start'`-pinned, unpinned, `'end'`-pinned, while
|
|
170
|
+
* preserving the original array order inside each group. The `columns` array
|
|
171
|
+
* itself is not mutated.
|
|
172
|
+
*/
|
|
173
|
+
pinned?: PinPosition;
|
|
174
|
+
/**
|
|
175
|
+
* Whether this column can be reordered via drag-and-drop or the
|
|
176
|
+
* {@link ApexGrid.moveColumn} API.
|
|
177
|
+
*
|
|
178
|
+
* @remarks
|
|
179
|
+
* Has no effect unless the grid's `columnReordering` flag is `true`. When
|
|
180
|
+
* unset, columns inherit the grid-wide flag. Reordering is constrained to the
|
|
181
|
+
* column's own pinning group — start-pinned columns can only swap with other
|
|
182
|
+
* start-pinned columns, and likewise for end-pinned and unpinned.
|
|
183
|
+
*/
|
|
184
|
+
reorderable?: boolean;
|
|
185
|
+
/**
|
|
186
|
+
* Whether the the column can be resized or not.
|
|
187
|
+
*/
|
|
188
|
+
resizable?: boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Whether the column can be sorted or not.
|
|
191
|
+
*/
|
|
192
|
+
sort?: ColumnSortConfiguration<T, K> | boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Whether filter operation can be applied on the column or not.
|
|
195
|
+
*/
|
|
196
|
+
filter?: ColumnFilterConfiguration | boolean;
|
|
197
|
+
/**
|
|
198
|
+
* Header template callback.
|
|
199
|
+
*/
|
|
200
|
+
headerTemplate?: (params: ApexHeaderContext<T>) => TemplateResult | unknown;
|
|
201
|
+
/**
|
|
202
|
+
* Cell template callback.
|
|
203
|
+
*/
|
|
204
|
+
cellTemplate?: (params: ApexCellContext<T, K>) => TemplateResult | unknown;
|
|
205
|
+
/**
|
|
206
|
+
* Whether values in this column can be edited inline.
|
|
207
|
+
*
|
|
208
|
+
* @remarks
|
|
209
|
+
* Has no effect unless the grid's `editing.enabled` is `true`. The default
|
|
210
|
+
* editor is chosen from the column's `type` (`'string'` → text input,
|
|
211
|
+
* `'number'` → number input, `'boolean'` → checkbox). Supply
|
|
212
|
+
* {@link BaseColumnConfiguration.editorTemplate} for full control.
|
|
213
|
+
*/
|
|
214
|
+
editable?: boolean;
|
|
215
|
+
/**
|
|
216
|
+
* Custom editor template invoked while this column's cell is in edit mode.
|
|
217
|
+
*
|
|
218
|
+
* @remarks
|
|
219
|
+
* The callback receives an {@link ApexEditorContext} that includes the cell
|
|
220
|
+
* value plus `commit` / `cancel` helpers. Returning a focusable element is
|
|
221
|
+
* recommended so keyboard handoff works.
|
|
222
|
+
*/
|
|
223
|
+
editorTemplate?: (params: ApexEditorContext<T, K>) => TemplateResult | unknown;
|
|
224
|
+
/**
|
|
225
|
+
* Option list for columns with `type: 'select'`.
|
|
226
|
+
*
|
|
227
|
+
* @remarks
|
|
228
|
+
* Each entry is either a bare value or an explicit `{ value, label }` pair.
|
|
229
|
+
* The cell renders the matching option's `label` in display mode and a
|
|
230
|
+
* native `<select>` of all options in edit mode. Has no effect on columns
|
|
231
|
+
* with another `type`.
|
|
232
|
+
*/
|
|
233
|
+
options?: ColumnSelectOption<BasePropertyType<T, K>>[];
|
|
234
|
+
/**
|
|
235
|
+
* Star count for columns with `type: 'rating'`.
|
|
236
|
+
*
|
|
237
|
+
* @remarks
|
|
238
|
+
* The displayed value is clamped to the range `[0, max]`. Defaults to `5`.
|
|
239
|
+
* Has no effect on columns with another `type`.
|
|
240
|
+
*/
|
|
241
|
+
max?: number;
|
|
242
|
+
/**
|
|
243
|
+
* Display format for columns with `type: 'date'`.
|
|
244
|
+
*
|
|
245
|
+
* @remarks
|
|
246
|
+
* Selects an `Intl.DateTimeFormatOptions.dateStyle` preset. Defaults to
|
|
247
|
+
* `'medium'`. Has no effect on columns with another `type`.
|
|
248
|
+
*/
|
|
249
|
+
format?: ColumnDateFormat;
|
|
250
|
+
/**
|
|
251
|
+
* Cropping shape for columns with `type: 'image'`.
|
|
252
|
+
*
|
|
253
|
+
* @remarks
|
|
254
|
+
* `'square'` (default) renders the image at its native aspect. `'circle'`
|
|
255
|
+
* crops to a circle (useful for avatars). Has no effect on columns with
|
|
256
|
+
* another `type`.
|
|
257
|
+
*/
|
|
258
|
+
shape?: 'square' | 'circle';
|
|
259
|
+
/**
|
|
260
|
+
* Alt text for `<img>` elements rendered by `type: 'image'` columns.
|
|
261
|
+
*
|
|
262
|
+
* @remarks
|
|
263
|
+
* Defaults to the column key. Has no effect on columns with another
|
|
264
|
+
* `type`.
|
|
265
|
+
*/
|
|
266
|
+
alt?: string;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* See {@link BaseColumnConfiguration} for the full documentation.
|
|
270
|
+
*/
|
|
271
|
+
export type ColumnConfiguration<T extends object, K extends Keys<T> = Keys<T>> = K extends Keys<T> ? BaseColumnConfiguration<T, K> : never;
|
|
272
|
+
export interface ActiveNode<T> {
|
|
273
|
+
column: Keys<T>;
|
|
274
|
+
row: number;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Context object for the column header template callback.
|
|
278
|
+
*/
|
|
279
|
+
export interface ApexHeaderContext<T extends object> {
|
|
280
|
+
/**
|
|
281
|
+
* The header element parent of the template.
|
|
282
|
+
*/
|
|
283
|
+
parent: ApexGridHeader<T>;
|
|
284
|
+
/**
|
|
285
|
+
* The current configuration for the column.
|
|
286
|
+
*/
|
|
287
|
+
column: ColumnConfiguration<T>;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Context object for the row cell template callback.
|
|
291
|
+
*/
|
|
292
|
+
export interface BaseApexCellContext<T extends object, K extends Keys<T> = Keys<T>> {
|
|
293
|
+
/**
|
|
294
|
+
* The cell element parent of the template.
|
|
295
|
+
*/
|
|
296
|
+
parent: ApexGridCell<T>;
|
|
297
|
+
/**
|
|
298
|
+
* The row element containing the cell.
|
|
299
|
+
*/
|
|
300
|
+
row: ApexGridRow<T>;
|
|
301
|
+
/**
|
|
302
|
+
* The current configuration for the column.
|
|
303
|
+
*/
|
|
304
|
+
column: ColumnConfiguration<T, K>;
|
|
305
|
+
/**
|
|
306
|
+
* The value from the data source for this cell.
|
|
307
|
+
*/
|
|
308
|
+
value: PropertyType<T, K>;
|
|
309
|
+
/**
|
|
310
|
+
* Commits a new value for this cell without entering edit mode. Available
|
|
311
|
+
* when the column is editable. Used by interactive display widgets
|
|
312
|
+
* (e.g. the built-in boolean checkbox) so they can toggle inline.
|
|
313
|
+
*
|
|
314
|
+
* Goes through the cancellable `cellValueChanging` event and follow-up
|
|
315
|
+
* `cellValueChanged` event — same write path as an edit-mode commit.
|
|
316
|
+
*/
|
|
317
|
+
commit?: (value: PropertyType<T, K>) => Promise<boolean>;
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* See {@link BaseApexCellContext} for the full documentation.
|
|
321
|
+
*/
|
|
322
|
+
export type ApexCellContext<T extends object, K extends Keys<T> = Keys<T>> = K extends Keys<T> ? BaseApexCellContext<T, K> : never;
|
|
323
|
+
/**
|
|
324
|
+
* Context object handed to a custom editor template.
|
|
325
|
+
*
|
|
326
|
+
* @remarks
|
|
327
|
+
* Includes the cell's current `value` plus `commit` / `cancel` callbacks so
|
|
328
|
+
* the editor can hand its result back to the grid. The custom editor is also
|
|
329
|
+
* responsible for forwarding `Enter` / `Escape` to those callbacks.
|
|
330
|
+
*/
|
|
331
|
+
export interface BaseApexEditorContext<T extends object, K extends Keys<T> = Keys<T>> extends BaseApexCellContext<T, K> {
|
|
332
|
+
/**
|
|
333
|
+
* Commits `value` as the new cell value, going through the cancellable
|
|
334
|
+
* `cellValueChanging` event and then `cellValueChanged`.
|
|
335
|
+
*
|
|
336
|
+
* @returns `true` if the value was applied, `false` if cancelled.
|
|
337
|
+
*/
|
|
338
|
+
commit: (value: PropertyType<T, K>) => Promise<boolean>;
|
|
339
|
+
/**
|
|
340
|
+
* Discards the in-progress edit and exits edit mode.
|
|
341
|
+
*/
|
|
342
|
+
cancel: () => void;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* See {@link BaseApexEditorContext} for the full documentation.
|
|
346
|
+
*/
|
|
347
|
+
export type ApexEditorContext<T extends object, K extends Keys<T> = Keys<T>> = K extends Keys<T> ? BaseApexEditorContext<T, K> : never;
|
|
348
|
+
/**
|
|
349
|
+
* The edit trigger used to enter cell edit mode.
|
|
350
|
+
*
|
|
351
|
+
* @remarks
|
|
352
|
+
* `'click'` enters edit on a single click on the cell; `'doubleClick'`
|
|
353
|
+
* requires a double click. Defaults to `'doubleClick'`.
|
|
354
|
+
*/
|
|
355
|
+
export type EditTrigger = 'click' | 'doubleClick';
|
|
356
|
+
/**
|
|
357
|
+
* Edit mode for the grid.
|
|
358
|
+
*
|
|
359
|
+
* @remarks
|
|
360
|
+
* `'cell'` — each cell is committed independently on blur or `Enter`.
|
|
361
|
+
* `'row'` — all editable cells in the row enter edit mode together; changes
|
|
362
|
+
* are batched and applied via {@link ApexGrid.commitEdit} or rolled back via
|
|
363
|
+
* {@link ApexGrid.cancelEdit}.
|
|
364
|
+
*/
|
|
365
|
+
export type EditMode = 'cell' | 'row';
|
|
366
|
+
/**
|
|
367
|
+
* Selection mode for the grid.
|
|
368
|
+
*
|
|
369
|
+
* @remarks
|
|
370
|
+
* `'single'` — at most one row may be selected at any time. New clicks
|
|
371
|
+
* replace the existing selection.
|
|
372
|
+
* `'multiple'` — multiple rows can be selected. Plain clicks replace the
|
|
373
|
+
* selection, Ctrl/Cmd+click toggles a row additively, and Shift+click
|
|
374
|
+
* selects a range from the previous anchor.
|
|
375
|
+
*/
|
|
376
|
+
export type SelectionMode = 'single' | 'multiple';
|
|
377
|
+
/**
|
|
378
|
+
* Grid-level row-selection configuration.
|
|
379
|
+
*/
|
|
380
|
+
export interface GridSelectionConfiguration {
|
|
381
|
+
/**
|
|
382
|
+
* Whether row selection is enabled. Disabled by default.
|
|
383
|
+
*/
|
|
384
|
+
enabled?: boolean;
|
|
385
|
+
/**
|
|
386
|
+
* Single-row vs multi-row selection. Defaults to `'multiple'`.
|
|
387
|
+
*/
|
|
388
|
+
mode?: SelectionMode;
|
|
389
|
+
/**
|
|
390
|
+
* Whether to render the built-in checkbox column at the start of every
|
|
391
|
+
* row. When `false`, selection is still available via the public API
|
|
392
|
+
* (`selectRow`, `selectedRows = ...`) and via Space on the active row.
|
|
393
|
+
* Defaults to `false`.
|
|
394
|
+
*/
|
|
395
|
+
showCheckboxColumn?: boolean;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Context passed to {@link GridExpansionConfiguration.detailTemplate}.
|
|
399
|
+
*/
|
|
400
|
+
export interface ApexDetailContext<T extends object> {
|
|
401
|
+
/** The row data for the expanded row. */
|
|
402
|
+
data: T;
|
|
403
|
+
/** The view-relative row index of the master row. */
|
|
404
|
+
rowIndex: number;
|
|
405
|
+
/** The grid element. Useful for emitting events back from the detail. */
|
|
406
|
+
parent: ApexGrid<T>;
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Grid-level tree-data (nested rows) configuration.
|
|
410
|
+
*
|
|
411
|
+
* @remarks
|
|
412
|
+
* Tree mode renders hierarchical data as nested rows that share the same
|
|
413
|
+
* column layout — collapsible parents with indented children, AG Grid's
|
|
414
|
+
* "tree data" pattern. The data array stays flat; the grid derives the
|
|
415
|
+
* hierarchy from {@link getDataPath} at runtime.
|
|
416
|
+
*
|
|
417
|
+
* This is distinct from {@link GridExpansionConfiguration} (master-detail),
|
|
418
|
+
* which expands a row to show an arbitrary detail panel. Tree mode and
|
|
419
|
+
* expansion mode can be enabled together, but the chevron column is
|
|
420
|
+
* reserved by whichever is currently rendering the chevron — typically the
|
|
421
|
+
* tree feature when both are enabled.
|
|
422
|
+
*
|
|
423
|
+
* @example
|
|
424
|
+
* ```ts
|
|
425
|
+
* grid.tree = {
|
|
426
|
+
* enabled: true,
|
|
427
|
+
* getDataPath: (row) => row.path,
|
|
428
|
+
* };
|
|
429
|
+
* ```
|
|
430
|
+
*/
|
|
431
|
+
export interface GridTreeConfiguration<T extends object> {
|
|
432
|
+
/** Whether tree mode is enabled. Disabled by default. */
|
|
433
|
+
enabled?: boolean;
|
|
434
|
+
/**
|
|
435
|
+
* Callback that returns the hierarchical path for a row. The path is a
|
|
436
|
+
* sequence of segments from root to the row's own position — for example
|
|
437
|
+
* `['Adrian']` for a CEO, `['Adrian', 'Bryan']` for a VP under Adrian,
|
|
438
|
+
* and so on. Required when `enabled` is `true`.
|
|
439
|
+
*/
|
|
440
|
+
getDataPath: (row: T) => readonly string[];
|
|
441
|
+
/**
|
|
442
|
+
* Which column displays the chevron + indentation. Defaults to the first
|
|
443
|
+
* visible non-hidden data column.
|
|
444
|
+
*/
|
|
445
|
+
groupColumnKey?: Keys<T>;
|
|
446
|
+
/**
|
|
447
|
+
* Initial expansion state:
|
|
448
|
+
* - `false` (default): all rows collapsed.
|
|
449
|
+
* - `true`: every row expanded.
|
|
450
|
+
* - `number`: expand all rows up to and including the given depth (0 = roots only).
|
|
451
|
+
*/
|
|
452
|
+
defaultExpanded?: boolean | number;
|
|
453
|
+
/**
|
|
454
|
+
* Pixels of indentation per depth level. Defaults to `20`.
|
|
455
|
+
*/
|
|
456
|
+
childIndent?: number;
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Grid-level row-expansion (master-detail) configuration.
|
|
460
|
+
*/
|
|
461
|
+
export interface GridExpansionConfiguration<T extends object> {
|
|
462
|
+
/**
|
|
463
|
+
* Whether row expansion is enabled. Disabled by default.
|
|
464
|
+
*/
|
|
465
|
+
enabled?: boolean;
|
|
466
|
+
/**
|
|
467
|
+
* Callback that produces the detail panel content for an expanded row.
|
|
468
|
+
* Required when `enabled` is `true`.
|
|
469
|
+
*/
|
|
470
|
+
detailTemplate?: (context: ApexDetailContext<T>) => TemplateResult | unknown;
|
|
471
|
+
/**
|
|
472
|
+
* Optional per-row predicate that gates which rows may be expanded. When
|
|
473
|
+
* omitted, every row is expandable.
|
|
474
|
+
*/
|
|
475
|
+
isExpandable?: (row: T) => boolean;
|
|
476
|
+
/**
|
|
477
|
+
* Whether to render the built-in chevron toggle column at the start of
|
|
478
|
+
* every row (after the selection column, when present). Defaults to `true`.
|
|
479
|
+
* Set to `false` to drive expansion entirely through the public API or a
|
|
480
|
+
* custom cell template.
|
|
481
|
+
*/
|
|
482
|
+
showToggleColumn?: boolean;
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Grid-level editing configuration.
|
|
486
|
+
*/
|
|
487
|
+
export interface GridEditingConfiguration {
|
|
488
|
+
/**
|
|
489
|
+
* Whether editing is enabled. Per-column opt-in still applies via
|
|
490
|
+
* {@link BaseColumnConfiguration.editable}.
|
|
491
|
+
*/
|
|
492
|
+
enabled?: boolean;
|
|
493
|
+
/**
|
|
494
|
+
* Whether each cell commits independently or whether the whole row is edited
|
|
495
|
+
* as a batch. Defaults to `'cell'`.
|
|
496
|
+
*/
|
|
497
|
+
mode?: EditMode;
|
|
498
|
+
/**
|
|
499
|
+
* The interaction that opens an editor. Defaults to `'doubleClick'`.
|
|
500
|
+
*/
|
|
501
|
+
trigger?: EditTrigger;
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* The parameters passed to a {@link DataPipelineHook} callback.
|
|
505
|
+
*/
|
|
506
|
+
export type DataPipelineParams<T extends object> = {
|
|
507
|
+
/**
|
|
508
|
+
* The current data state of the grid.
|
|
509
|
+
*/
|
|
510
|
+
data: T[];
|
|
511
|
+
/**
|
|
512
|
+
* The grid component itself.
|
|
513
|
+
*/
|
|
514
|
+
grid: ApexGrid<T>;
|
|
515
|
+
/**
|
|
516
|
+
* The type of data operation being performed.
|
|
517
|
+
*/
|
|
518
|
+
type: 'sort' | 'filter' | 'quickFilter' | 'pagination';
|
|
519
|
+
};
|
|
520
|
+
/**
|
|
521
|
+
* Callback function for customizing data operations in the grid.
|
|
522
|
+
*/
|
|
523
|
+
export type DataPipelineHook<T extends object> = (state: DataPipelineParams<T>) => T[] | Promise<T[]>;
|
|
524
|
+
/**
|
|
525
|
+
* Configuration for customizing the various data operations of the grid.
|
|
526
|
+
*/
|
|
527
|
+
export interface DataPipelineConfiguration<T extends object> {
|
|
528
|
+
/**
|
|
529
|
+
* Hook for customizing sort operations.
|
|
530
|
+
*/
|
|
531
|
+
sort?: DataPipelineHook<T>;
|
|
532
|
+
/**
|
|
533
|
+
* Hook for customizing filter operations.
|
|
534
|
+
*/
|
|
535
|
+
filter?: DataPipelineHook<T>;
|
|
536
|
+
/**
|
|
537
|
+
* Hook for customizing pagination operations.
|
|
538
|
+
*
|
|
539
|
+
* @remarks
|
|
540
|
+
* The hook receives the filtered + sorted data slice for the grid to render and the current
|
|
541
|
+
* pagination state. Return the page slice. For server-driven pagination, return the externally
|
|
542
|
+
* fetched page and report the row total via {@link ApexGrid.totalItems}.
|
|
543
|
+
*/
|
|
544
|
+
pagination?: DataPipelineHook<T>;
|
|
545
|
+
/**
|
|
546
|
+
* Hook for customizing quick (global) filter operations.
|
|
547
|
+
*
|
|
548
|
+
* @remarks
|
|
549
|
+
* Called before column filtering. Return the records that match the {@link ApexGrid.quickFilter}
|
|
550
|
+
* value. If omitted, the default substring matcher is used.
|
|
551
|
+
*/
|
|
552
|
+
quickFilter?: DataPipelineHook<T>;
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* The pagination mode for the grid.
|
|
556
|
+
*
|
|
557
|
+
* @remarks
|
|
558
|
+
* `'local'` — the grid slices the in-memory {@link ApexGrid.dataView} by `page` and `pageSize`.
|
|
559
|
+
* `'remote'` — the consumer drives data fetching; the grid emits paging events but does not
|
|
560
|
+
* slice the data. Use together with {@link DataPipelineConfiguration.pagination} or by setting
|
|
561
|
+
* `data` to the current page on `pageChanged`.
|
|
562
|
+
*/
|
|
563
|
+
export type PaginationMode = 'local' | 'remote';
|
|
564
|
+
/**
|
|
565
|
+
* Pagination configuration for the grid.
|
|
566
|
+
*/
|
|
567
|
+
export interface PaginationConfiguration {
|
|
568
|
+
/**
|
|
569
|
+
* Whether pagination is enabled.
|
|
570
|
+
*
|
|
571
|
+
* @remarks
|
|
572
|
+
* When `false`, the grid renders no paginator and applies no slicing — the full
|
|
573
|
+
* {@link ApexGrid.dataView} is virtualized as usual.
|
|
574
|
+
*/
|
|
575
|
+
enabled?: boolean;
|
|
576
|
+
/**
|
|
577
|
+
* The pagination mode. Defaults to `'local'`.
|
|
578
|
+
*/
|
|
579
|
+
mode?: PaginationMode;
|
|
580
|
+
/**
|
|
581
|
+
* The current page (zero-based). Defaults to `0`.
|
|
582
|
+
*/
|
|
583
|
+
page?: number;
|
|
584
|
+
/**
|
|
585
|
+
* The number of records per page. Defaults to `25`.
|
|
586
|
+
*/
|
|
587
|
+
pageSize?: number;
|
|
588
|
+
/**
|
|
589
|
+
* The list of page sizes offered in the paginator's page-size dropdown.
|
|
590
|
+
* Defaults to `[10, 25, 50, 100]`.
|
|
591
|
+
*/
|
|
592
|
+
pageSizeOptions?: number[];
|
|
593
|
+
/**
|
|
594
|
+
* In `'remote'` mode the consumer must supply the unfiltered row total so the paginator
|
|
595
|
+
* can compute the page count. Ignored in `'local'` mode.
|
|
596
|
+
*/
|
|
597
|
+
totalItems?: number;
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* Resolved pagination state passed to controllers and event payloads.
|
|
601
|
+
*/
|
|
602
|
+
export interface PaginationState {
|
|
603
|
+
/**
|
|
604
|
+
* The current page (zero-based).
|
|
605
|
+
*/
|
|
606
|
+
page: number;
|
|
607
|
+
/**
|
|
608
|
+
* The number of records per page.
|
|
609
|
+
*/
|
|
610
|
+
pageSize: number;
|
|
611
|
+
/**
|
|
612
|
+
* The total number of pages.
|
|
613
|
+
*/
|
|
614
|
+
pageCount: number;
|
|
615
|
+
/**
|
|
616
|
+
* The total number of records before pagination (after filter/sort).
|
|
617
|
+
*/
|
|
618
|
+
totalItems: number;
|
|
619
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/internal/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactiveControllerHost, TemplateResult } from 'lit';\nimport type ApexGridCell from '../components/cell.js';\nimport type { ApexGrid } from '../components/grid.js';\nimport type ApexGridHeader from '../components/header.js';\nimport type ApexGridRow from '../components/row.js';\nimport type { SortComparer } from '../operations/sort/types.js';\n\nexport type NavigationState = 'previous' | 'current';\nexport type GridHost<T extends object> = ReactiveControllerHost & ApexGrid<T>;\n\n/**\n * Helper type for resolving keys of type T.\n */\nexport type Keys<T> = keyof T;\n\n/**\n * Helper type for resolving types of type T.\n */\nexport type BasePropertyType<T, K extends Keys<T> = Keys<T>> = T[K];\n\n/**\n * Helper type for resolving types of type T.\n */\nexport type PropertyType<T, K extends Keys<T> = Keys<T>> = K extends Keys<T>\n ? BasePropertyType<T, K>\n : never;\n\n/**\n * The data type — or, for the declarative built-ins (`'select'`, `'rating'`,\n * `'date'`, `'image'`), the presentation type — for the current column.\n *\n * @remarks\n * - `'string'` / `'number'` are the primitive data types. They drive the\n * default filter operands, the default editor, and the default sort\n * comparison.\n * - `'boolean'` stores `true` / `false`. In display mode the grid renders\n * a check-mark icon for `true` and a dimmed mark for `false`. In edit\n * mode the default editor is a native checkbox.\n * - `'select'` is a presentation type for columns that store one of a fixed\n * set of values. Supply the available options via\n * {@link BaseColumnConfiguration.options}. The cell renders the matching\n * option's label in display mode and a native `<select>` in edit mode.\n * For sorting / filtering, select columns behave as their underlying\n * value type (typically string).\n * - `'rating'` renders a numeric value (0..`max`) as filled stars in display\n * mode and as an interactive star picker in edit mode. Configure the star\n * count via {@link BaseColumnConfiguration.max} (defaults to `5`).\n * For sorting / filtering, rating columns behave as numbers.\n * - `'date'` renders values as locale-aware formatted dates in display mode\n * and a native `<input type=\"date\">` in edit mode. Accepts `Date`\n * instances, ISO strings, or millisecond timestamps as input and commits\n * back in the same shape. Configure the display format via\n * {@link BaseColumnConfiguration.format} (`'short' | 'medium' | 'long' |\n * 'full'`, default `'medium'`).\n * - `'image'` renders the value as an `<img>` source. Use\n * {@link BaseColumnConfiguration.shape} to pick between `'square'`\n * (default) and `'circle'`. The cell's default text editor is used for\n * editing the URL string when `editable: true` is set.\n */\nexport type DataType = 'number' | 'string' | 'boolean' | 'select' | 'rating' | 'date' | 'image';\n\n/**\n * Display format presets for `'date'` columns. Map to\n * `Intl.DateTimeFormatOptions.dateStyle`.\n */\nexport type ColumnDateFormat = 'short' | 'medium' | 'long' | 'full';\n\n/**\n * An entry in a `'select'` column's `options` list. Bare values use\n * `String(value)` as their display label; the explicit form lets you give\n * a value a separate display label.\n */\nexport type ColumnSelectOption<V = unknown> = V | { value: V; label?: string };\n\n/**\n * Configures the sort behavior for the grid.\n */\nexport interface GridSortConfiguration {\n /**\n * Whether multiple sorting is enabled.\n */\n multiple: boolean;\n /**\n * Whether tri-state sorting is enabled.\n */\n triState: boolean;\n}\n\n/**\n * Extended sort configuration for a column.\n */\nexport interface BaseColumnSortConfiguration<T, K extends Keys<T> = Keys<T>> {\n /**\n * Whether the sort operations will be case sensitive.\n */\n caseSensitive?: boolean;\n /**\n * Custom comparer function for sort operations for this column.\n */\n comparer?: SortComparer<T, K>;\n}\n\n/**\n * See {@link BaseColumnSortConfiguration} for the full documentation.\n */\nexport type ColumnSortConfiguration<T, K extends Keys<T> = Keys<T>> = K extends Keys<T>\n ? BaseColumnSortConfiguration<T, K>\n : never;\n\n/**\n * Extended filter configuration for a column.\n */\nexport interface ColumnFilterConfiguration {\n /**\n * Whether the filter operations will be case sensitive.\n */\n caseSensitive?: boolean;\n}\n\n/**\n * Pin position for a column.\n *\n * @remarks\n * `'start'` pins the column to the leading edge of the grid (inline-start);\n * `'end'` pins it to the trailing edge. `null` or `undefined` means the column\n * is part of the scrollable region.\n */\nexport type PinPosition = 'start' | 'end' | null;\n\n/** Configuration object for grid columns. */\nexport interface BaseColumnConfiguration<T extends object, K extends Keys<T> = Keys<T>> {\n /**\n * The field for from the data the this column will reference.\n */\n key: K;\n /**\n * The type of data this column will reference.\n *\n * Affects the default filter operands if the column is with filtering enabled.\n *\n * @remarks\n * If not passed, `string` is assumed to be the default type.\n *\n */\n type?: DataType;\n /**\n * Optional text to display in the column header. By default, the column key is used\n * to render the header text.\n */\n headerText?: string;\n /**\n * Width for the current column.\n *\n * Accepts most CSS units for controlling width.\n *\n * @remarks\n * If not passed, the column will try to size itself based on the number of other\n * columns and the total width of the grid.\n *\n */\n width?: string;\n /**\n * Whether the column is hidden or not.\n */\n hidden?: boolean;\n /**\n * Whether this column is included when exporting via\n * {@link ApexGrid.exportToCSV} or {@link ApexGrid.exportToXLSX}.\n *\n * @remarks\n * Defaults to `true`. Set to `false` to omit a column from generated files\n * (useful for action columns, derived UI, or sensitive fields). The\n * grid-rendered selection checkbox column is never exported regardless of\n * this flag.\n */\n exportable?: boolean;\n /**\n * Pin the column to a side of the grid.\n *\n * @remarks\n * Pinned columns stay fixed during horizontal scroll. Use `'start'` (left in LTR,\n * right in RTL) for the leading edge or `'end'` for the trailing edge. The grid\n * renders columns in the order: `'start'`-pinned, unpinned, `'end'`-pinned, while\n * preserving the original array order inside each group. The `columns` array\n * itself is not mutated.\n */\n pinned?: PinPosition;\n /**\n * Whether this column can be reordered via drag-and-drop or the\n * {@link ApexGrid.moveColumn} API.\n *\n * @remarks\n * Has no effect unless the grid's `columnReordering` flag is `true`. When\n * unset, columns inherit the grid-wide flag. Reordering is constrained to the\n * column's own pinning group — start-pinned columns can only swap with other\n * start-pinned columns, and likewise for end-pinned and unpinned.\n */\n reorderable?: boolean;\n /**\n * Whether the the column can be resized or not.\n */\n resizable?: boolean;\n /**\n * Whether the column can be sorted or not.\n */\n sort?: ColumnSortConfiguration<T, K> | boolean;\n /**\n * Whether filter operation can be applied on the column or not.\n */\n filter?: ColumnFilterConfiguration | boolean;\n /**\n * Header template callback.\n */\n headerTemplate?: (params: ApexHeaderContext<T>) => TemplateResult | unknown;\n /**\n * Cell template callback.\n */\n cellTemplate?: (params: ApexCellContext<T, K>) => TemplateResult | unknown;\n /**\n * Whether values in this column can be edited inline.\n *\n * @remarks\n * Has no effect unless the grid's `editing.enabled` is `true`. The default\n * editor is chosen from the column's `type` (`'string'` → text input,\n * `'number'` → number input, `'boolean'` → checkbox). Supply\n * {@link BaseColumnConfiguration.editorTemplate} for full control.\n */\n editable?: boolean;\n /**\n * Custom editor template invoked while this column's cell is in edit mode.\n *\n * @remarks\n * The callback receives an {@link ApexEditorContext} that includes the cell\n * value plus `commit` / `cancel` helpers. Returning a focusable element is\n * recommended so keyboard handoff works.\n */\n editorTemplate?: (params: ApexEditorContext<T, K>) => TemplateResult | unknown;\n /**\n * Option list for columns with `type: 'select'`.\n *\n * @remarks\n * Each entry is either a bare value or an explicit `{ value, label }` pair.\n * The cell renders the matching option's `label` in display mode and a\n * native `<select>` of all options in edit mode. Has no effect on columns\n * with another `type`.\n */\n options?: ColumnSelectOption<BasePropertyType<T, K>>[];\n /**\n * Star count for columns with `type: 'rating'`.\n *\n * @remarks\n * The displayed value is clamped to the range `[0, max]`. Defaults to `5`.\n * Has no effect on columns with another `type`.\n */\n max?: number;\n /**\n * Display format for columns with `type: 'date'`.\n *\n * @remarks\n * Selects an `Intl.DateTimeFormatOptions.dateStyle` preset. Defaults to\n * `'medium'`. Has no effect on columns with another `type`.\n */\n format?: ColumnDateFormat;\n /**\n * Cropping shape for columns with `type: 'image'`.\n *\n * @remarks\n * `'square'` (default) renders the image at its native aspect. `'circle'`\n * crops to a circle (useful for avatars). Has no effect on columns with\n * another `type`.\n */\n shape?: 'square' | 'circle';\n /**\n * Alt text for `<img>` elements rendered by `type: 'image'` columns.\n *\n * @remarks\n * Defaults to the column key. Has no effect on columns with another\n * `type`.\n */\n alt?: string;\n}\n\n/**\n * See {@link BaseColumnConfiguration} for the full documentation.\n */\nexport type ColumnConfiguration<T extends object, K extends Keys<T> = Keys<T>> = K extends Keys<T>\n ? BaseColumnConfiguration<T, K>\n : never;\n\nexport interface ActiveNode<T> {\n column: Keys<T>;\n row: number;\n}\n\n/**\n * Context object for the column header template callback.\n */\nexport interface ApexHeaderContext<T extends object> {\n /**\n * The header element parent of the template.\n */\n parent: ApexGridHeader<T>;\n /**\n * The current configuration for the column.\n */\n column: ColumnConfiguration<T>;\n}\n\n/**\n * Context object for the row cell template callback.\n */\nexport interface BaseApexCellContext<T extends object, K extends Keys<T> = Keys<T>> {\n /**\n * The cell element parent of the template.\n */\n parent: ApexGridCell<T>;\n /**\n * The row element containing the cell.\n */\n row: ApexGridRow<T>;\n /**\n * The current configuration for the column.\n */\n column: ColumnConfiguration<T, K>;\n /**\n * The value from the data source for this cell.\n */\n value: PropertyType<T, K>;\n /**\n * Commits a new value for this cell without entering edit mode. Available\n * when the column is editable. Used by interactive display widgets\n * (e.g. the built-in boolean checkbox) so they can toggle inline.\n *\n * Goes through the cancellable `cellValueChanging` event and follow-up\n * `cellValueChanged` event — same write path as an edit-mode commit.\n */\n commit?: (value: PropertyType<T, K>) => Promise<boolean>;\n}\n\n/**\n * See {@link BaseApexCellContext} for the full documentation.\n */\nexport type ApexCellContext<T extends object, K extends Keys<T> = Keys<T>> = K extends Keys<T>\n ? BaseApexCellContext<T, K>\n : never;\n\n/**\n * Context object handed to a custom editor template.\n *\n * @remarks\n * Includes the cell's current `value` plus `commit` / `cancel` callbacks so\n * the editor can hand its result back to the grid. The custom editor is also\n * responsible for forwarding `Enter` / `Escape` to those callbacks.\n */\nexport interface BaseApexEditorContext<T extends object, K extends Keys<T> = Keys<T>>\n extends BaseApexCellContext<T, K> {\n /**\n * Commits `value` as the new cell value, going through the cancellable\n * `cellValueChanging` event and then `cellValueChanged`.\n *\n * @returns `true` if the value was applied, `false` if cancelled.\n */\n commit: (value: PropertyType<T, K>) => Promise<boolean>;\n /**\n * Discards the in-progress edit and exits edit mode.\n */\n cancel: () => void;\n}\n\n/**\n * See {@link BaseApexEditorContext} for the full documentation.\n */\nexport type ApexEditorContext<T extends object, K extends Keys<T> = Keys<T>> = K extends Keys<T>\n ? BaseApexEditorContext<T, K>\n : never;\n\n/**\n * The edit trigger used to enter cell edit mode.\n *\n * @remarks\n * `'click'` enters edit on a single click on the cell; `'doubleClick'`\n * requires a double click. Defaults to `'doubleClick'`.\n */\nexport type EditTrigger = 'click' | 'doubleClick';\n\n/**\n * Edit mode for the grid.\n *\n * @remarks\n * `'cell'` — each cell is committed independently on blur or `Enter`.\n * `'row'` — all editable cells in the row enter edit mode together; changes\n * are batched and applied via {@link ApexGrid.commitEdit} or rolled back via\n * {@link ApexGrid.cancelEdit}.\n */\nexport type EditMode = 'cell' | 'row';\n\n/**\n * Selection mode for the grid.\n *\n * @remarks\n * `'single'` — at most one row may be selected at any time. New clicks\n * replace the existing selection.\n * `'multiple'` — multiple rows can be selected. Plain clicks replace the\n * selection, Ctrl/Cmd+click toggles a row additively, and Shift+click\n * selects a range from the previous anchor.\n */\nexport type SelectionMode = 'single' | 'multiple';\n\n/**\n * Grid-level row-selection configuration.\n */\nexport interface GridSelectionConfiguration {\n /**\n * Whether row selection is enabled. Disabled by default.\n */\n enabled?: boolean;\n /**\n * Single-row vs multi-row selection. Defaults to `'multiple'`.\n */\n mode?: SelectionMode;\n /**\n * Whether to render the built-in checkbox column at the start of every\n * row. When `false`, selection is still available via the public API\n * (`selectRow`, `selectedRows = ...`) and via Space on the active row.\n * Defaults to `false`.\n */\n showCheckboxColumn?: boolean;\n}\n\n/**\n * Context passed to {@link GridExpansionConfiguration.detailTemplate}.\n */\nexport interface ApexDetailContext<T extends object> {\n /** The row data for the expanded row. */\n data: T;\n /** The view-relative row index of the master row. */\n rowIndex: number;\n /** The grid element. Useful for emitting events back from the detail. */\n parent: ApexGrid<T>;\n}\n\n/**\n * Grid-level tree-data (nested rows) configuration.\n *\n * @remarks\n * Tree mode renders hierarchical data as nested rows that share the same\n * column layout — collapsible parents with indented children, AG Grid's\n * \"tree data\" pattern. The data array stays flat; the grid derives the\n * hierarchy from {@link getDataPath} at runtime.\n *\n * This is distinct from {@link GridExpansionConfiguration} (master-detail),\n * which expands a row to show an arbitrary detail panel. Tree mode and\n * expansion mode can be enabled together, but the chevron column is\n * reserved by whichever is currently rendering the chevron — typically the\n * tree feature when both are enabled.\n *\n * @example\n * ```ts\n * grid.tree = {\n * enabled: true,\n * getDataPath: (row) => row.path,\n * };\n * ```\n */\nexport interface GridTreeConfiguration<T extends object> {\n /** Whether tree mode is enabled. Disabled by default. */\n enabled?: boolean;\n /**\n * Callback that returns the hierarchical path for a row. The path is a\n * sequence of segments from root to the row's own position — for example\n * `['Adrian']` for a CEO, `['Adrian', 'Bryan']` for a VP under Adrian,\n * and so on. Required when `enabled` is `true`.\n */\n getDataPath: (row: T) => readonly string[];\n /**\n * Which column displays the chevron + indentation. Defaults to the first\n * visible non-hidden data column.\n */\n groupColumnKey?: Keys<T>;\n /**\n * Initial expansion state:\n * - `false` (default): all rows collapsed.\n * - `true`: every row expanded.\n * - `number`: expand all rows up to and including the given depth (0 = roots only).\n */\n defaultExpanded?: boolean | number;\n /**\n * Pixels of indentation per depth level. Defaults to `20`.\n */\n childIndent?: number;\n}\n\n/**\n * Grid-level row-expansion (master-detail) configuration.\n */\nexport interface GridExpansionConfiguration<T extends object> {\n /**\n * Whether row expansion is enabled. Disabled by default.\n */\n enabled?: boolean;\n /**\n * Callback that produces the detail panel content for an expanded row.\n * Required when `enabled` is `true`.\n */\n detailTemplate?: (context: ApexDetailContext<T>) => TemplateResult | unknown;\n /**\n * Optional per-row predicate that gates which rows may be expanded. When\n * omitted, every row is expandable.\n */\n isExpandable?: (row: T) => boolean;\n /**\n * Whether to render the built-in chevron toggle column at the start of\n * every row (after the selection column, when present). Defaults to `true`.\n * Set to `false` to drive expansion entirely through the public API or a\n * custom cell template.\n */\n showToggleColumn?: boolean;\n}\n\n/**\n * Grid-level editing configuration.\n */\nexport interface GridEditingConfiguration {\n /**\n * Whether editing is enabled. Per-column opt-in still applies via\n * {@link BaseColumnConfiguration.editable}.\n */\n enabled?: boolean;\n /**\n * Whether each cell commits independently or whether the whole row is edited\n * as a batch. Defaults to `'cell'`.\n */\n mode?: EditMode;\n /**\n * The interaction that opens an editor. Defaults to `'doubleClick'`.\n */\n trigger?: EditTrigger;\n}\n\n/**\n * The parameters passed to a {@link DataPipelineHook} callback.\n */\nexport type DataPipelineParams<T extends object> = {\n /**\n * The current data state of the grid.\n */\n data: T[];\n /**\n * The grid component itself.\n */\n grid: ApexGrid<T>;\n /**\n * The type of data operation being performed.\n */\n type: 'sort' | 'filter' | 'quickFilter' | 'pagination';\n};\n\n/**\n * Callback function for customizing data operations in the grid.\n */\nexport type DataPipelineHook<T extends object> = (\n state: DataPipelineParams<T>\n) => T[] | Promise<T[]>;\n\n/**\n * Configuration for customizing the various data operations of the grid.\n */\nexport interface DataPipelineConfiguration<T extends object> {\n /**\n * Hook for customizing sort operations.\n */\n sort?: DataPipelineHook<T>;\n /**\n * Hook for customizing filter operations.\n */\n filter?: DataPipelineHook<T>;\n /**\n * Hook for customizing pagination operations.\n *\n * @remarks\n * The hook receives the filtered + sorted data slice for the grid to render and the current\n * pagination state. Return the page slice. For server-driven pagination, return the externally\n * fetched page and report the row total via {@link ApexGrid.totalItems}.\n */\n pagination?: DataPipelineHook<T>;\n /**\n * Hook for customizing quick (global) filter operations.\n *\n * @remarks\n * Called before column filtering. Return the records that match the {@link ApexGrid.quickFilter}\n * value. If omitted, the default substring matcher is used.\n */\n quickFilter?: DataPipelineHook<T>;\n}\n\n/**\n * The pagination mode for the grid.\n *\n * @remarks\n * `'local'` — the grid slices the in-memory {@link ApexGrid.dataView} by `page` and `pageSize`.\n * `'remote'` — the consumer drives data fetching; the grid emits paging events but does not\n * slice the data. Use together with {@link DataPipelineConfiguration.pagination} or by setting\n * `data` to the current page on `pageChanged`.\n */\nexport type PaginationMode = 'local' | 'remote';\n\n/**\n * Pagination configuration for the grid.\n */\nexport interface PaginationConfiguration {\n /**\n * Whether pagination is enabled.\n *\n * @remarks\n * When `false`, the grid renders no paginator and applies no slicing — the full\n * {@link ApexGrid.dataView} is virtualized as usual.\n */\n enabled?: boolean;\n /**\n * The pagination mode. Defaults to `'local'`.\n */\n mode?: PaginationMode;\n /**\n * The current page (zero-based). Defaults to `0`.\n */\n page?: number;\n /**\n * The number of records per page. Defaults to `25`.\n */\n pageSize?: number;\n /**\n * The list of page sizes offered in the paginator's page-size dropdown.\n * Defaults to `[10, 25, 50, 100]`.\n */\n pageSizeOptions?: number[];\n /**\n * In `'remote'` mode the consumer must supply the unfiltered row total so the paginator\n * can compute the page count. Ignored in `'local'` mode.\n */\n totalItems?: number;\n}\n\n/**\n * Resolved pagination state passed to controllers and event payloads.\n */\nexport interface PaginationState {\n /**\n * The current page (zero-based).\n */\n page: number;\n /**\n * The number of records per page.\n */\n pageSize: number;\n /**\n * The total number of pages.\n */\n pageCount: number;\n /**\n * The total number of records before pagination (after filter/sort).\n */\n totalItems: number;\n}\n"]}
|