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,122 @@
|
|
|
1
|
+
import { getDisplayColumns } from './utils.js';
|
|
2
|
+
export function resolveExportColumns(grid, opts) {
|
|
3
|
+
const all = getDisplayColumns(grid.columns).filter((column) => !column.hidden && column.exportable !== false);
|
|
4
|
+
if (!opts.columns?.length)
|
|
5
|
+
return all;
|
|
6
|
+
const keys = new Set(opts.columns);
|
|
7
|
+
return all.filter((column) => keys.has(column.key));
|
|
8
|
+
}
|
|
9
|
+
export function resolveExportRows(grid, source = 'view') {
|
|
10
|
+
switch (source) {
|
|
11
|
+
case 'all':
|
|
12
|
+
return grid.data;
|
|
13
|
+
case 'page':
|
|
14
|
+
return grid.pageItems;
|
|
15
|
+
case 'selected':
|
|
16
|
+
return grid.selectedRows;
|
|
17
|
+
default:
|
|
18
|
+
return grid.dataView;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export function getColumnLabel(column) {
|
|
22
|
+
return column.headerText ?? String(column.key);
|
|
23
|
+
}
|
|
24
|
+
const DATE_STYLE_MAP = {
|
|
25
|
+
short: 'short',
|
|
26
|
+
medium: 'medium',
|
|
27
|
+
long: 'long',
|
|
28
|
+
full: 'full',
|
|
29
|
+
};
|
|
30
|
+
export function defaultExportFormat(column, value) {
|
|
31
|
+
if (value === null || value === undefined)
|
|
32
|
+
return '';
|
|
33
|
+
switch (column.type) {
|
|
34
|
+
case 'select': {
|
|
35
|
+
const found = column.options?.find((option) => {
|
|
36
|
+
if (option && typeof option === 'object' && 'value' in option) {
|
|
37
|
+
return option.value === value;
|
|
38
|
+
}
|
|
39
|
+
return option === value;
|
|
40
|
+
});
|
|
41
|
+
if (found && typeof found === 'object' && 'label' in found) {
|
|
42
|
+
const label = found.label;
|
|
43
|
+
if (typeof label === 'string' && label.length > 0)
|
|
44
|
+
return label;
|
|
45
|
+
}
|
|
46
|
+
return typeof value === 'number' || typeof value === 'boolean' ? value : String(value);
|
|
47
|
+
}
|
|
48
|
+
case 'date': {
|
|
49
|
+
if (value instanceof Date)
|
|
50
|
+
return value;
|
|
51
|
+
const parsed = new Date(value);
|
|
52
|
+
return Number.isNaN(parsed.getTime()) ? String(value) : parsed;
|
|
53
|
+
}
|
|
54
|
+
case 'boolean':
|
|
55
|
+
return Boolean(value);
|
|
56
|
+
case 'number':
|
|
57
|
+
case 'rating': {
|
|
58
|
+
const n = Number(value);
|
|
59
|
+
return Number.isFinite(n) ? n : '';
|
|
60
|
+
}
|
|
61
|
+
default:
|
|
62
|
+
return typeof value === 'number' || typeof value === 'boolean' ? value : String(value);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export function resolveExportValue(column, row, opts) {
|
|
66
|
+
const raw = row[column.key];
|
|
67
|
+
return opts.formatter ? opts.formatter(column, raw, row) : defaultExportFormat(column, raw);
|
|
68
|
+
}
|
|
69
|
+
export function formatDateForCSV(column, value) {
|
|
70
|
+
const style = DATE_STYLE_MAP[column.format ?? 'medium'];
|
|
71
|
+
try {
|
|
72
|
+
return new Intl.DateTimeFormat(undefined, { dateStyle: style }).format(value);
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
return value.toISOString();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function escapeCSVCell(value, delimiter) {
|
|
79
|
+
if (value === null || value === undefined || value === '')
|
|
80
|
+
return '';
|
|
81
|
+
const text = value instanceof Date ? value.toISOString() : String(value);
|
|
82
|
+
const needsQuoting = text.includes(delimiter) || text.includes('"') || text.includes('\n') || text.includes('\r');
|
|
83
|
+
return needsQuoting ? `"${text.replace(/"/g, '""')}"` : text;
|
|
84
|
+
}
|
|
85
|
+
export function buildCSV(grid, opts = {}) {
|
|
86
|
+
const delimiter = opts.delimiter ?? ',';
|
|
87
|
+
const newline = opts.newline ?? '\r\n';
|
|
88
|
+
const includeHeader = opts.includeHeader ?? true;
|
|
89
|
+
const columns = resolveExportColumns(grid, opts);
|
|
90
|
+
const rows = resolveExportRows(grid, opts.source);
|
|
91
|
+
const lines = [];
|
|
92
|
+
if (includeHeader) {
|
|
93
|
+
lines.push(columns.map((column) => escapeCSVCell(getColumnLabel(column), delimiter)).join(delimiter));
|
|
94
|
+
}
|
|
95
|
+
for (const row of rows) {
|
|
96
|
+
const cells = columns.map((column) => {
|
|
97
|
+
let value = resolveExportValue(column, row, opts);
|
|
98
|
+
if (value instanceof Date) {
|
|
99
|
+
value = formatDateForCSV(column, value);
|
|
100
|
+
}
|
|
101
|
+
return escapeCSVCell(value, delimiter);
|
|
102
|
+
});
|
|
103
|
+
lines.push(cells.join(delimiter));
|
|
104
|
+
}
|
|
105
|
+
const body = lines.join(newline);
|
|
106
|
+
return opts.bom === false ? body : `\uFEFF${body}`;
|
|
107
|
+
}
|
|
108
|
+
export function downloadBlob(filename, content, mimeType) {
|
|
109
|
+
if (typeof document === 'undefined' || typeof URL?.createObjectURL !== 'function')
|
|
110
|
+
return;
|
|
111
|
+
const blob = new Blob([content], { type: mimeType });
|
|
112
|
+
const url = URL.createObjectURL(blob);
|
|
113
|
+
const anchor = document.createElement('a');
|
|
114
|
+
anchor.href = url;
|
|
115
|
+
anchor.download = filename;
|
|
116
|
+
anchor.style.display = 'none';
|
|
117
|
+
document.body.appendChild(anchor);
|
|
118
|
+
anchor.click();
|
|
119
|
+
document.body.removeChild(anchor);
|
|
120
|
+
setTimeout(() => URL.revokeObjectURL(url), 0);
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.js","s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AI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,UAAU,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;AAChD,CAAC","sourcesContent":["import type { ApexGrid } from '../components/grid.js';\nimport type { ColumnConfiguration, ColumnDateFormat, Keys } from './types.js';\nimport { getDisplayColumns } from './utils.js';\n\n/**\n * Primitive cell values supported by the export pipeline.\n *\n * @remarks\n * Returned by the default formatter and accepted from user-supplied formatters.\n * `Date` is preserved (not stringified) so that XLSX export can write it as a\n * native date cell instead of inline text.\n */\nexport type ExportCellValue = string | number | boolean | Date | null | undefined;\n\n/**\n * Which row set should drive the export.\n *\n * - `'view'` (default) — post-filter, post-sort rows across all pages.\n * - `'all'` — the raw `data` array as supplied by the consumer.\n * - `'page'` — only the rows in the current page slice.\n * - `'selected'` — the current row selection (insertion order).\n */\nexport type ExportSource = 'view' | 'all' | 'page' | 'selected';\n\n/**\n * Options shared by all export targets.\n */\nexport interface ExportOptions<T extends object> {\n /** Output filename, without extension. Defaults to `'data'`. */\n filename?: string;\n /** Row set to export. Defaults to `'view'`. */\n source?: ExportSource;\n /**\n * Column keys to include. When omitted, every visible non-hidden column with\n * `exportable !== false` is exported, in display order.\n */\n columns?: ReadonlyArray<Keys<T>>;\n /** Whether to emit a header row. Defaults to `true`. */\n includeHeader?: boolean;\n /**\n * Per-cell value formatter. Receives the column configuration, the raw value\n * from the record, and the record itself. Return one of {@link ExportCellValue}\n * (return a `Date` to keep date typing in XLSX).\n */\n formatter?: (column: ColumnConfiguration<T>, value: unknown, row: T) => ExportCellValue;\n}\n\n/**\n * Options for {@link ApexGrid.exportToCSV}.\n */\nexport interface CSVExportOptions<T extends object> extends ExportOptions<T> {\n /** Field delimiter. Defaults to `','`. */\n delimiter?: string;\n /**\n * Prepend a UTF-8 byte-order mark so Excel auto-detects the encoding when\n * opening the file. Defaults to `true`.\n */\n bom?: boolean;\n /** Line separator. Defaults to `'\\r\\n'` (RFC 4180). */\n newline?: string;\n}\n\n/**\n * Options for {@link ApexGrid.exportToXLSX}.\n */\nexport interface XLSXExportOptions<T extends object> extends ExportOptions<T> {\n /** Worksheet tab name. Defaults to `'Sheet1'`. Trimmed to 31 chars. */\n sheetName?: string;\n}\n\n/**\n * Resolves the columns that should appear in the export, in display order.\n */\nexport function resolveExportColumns<T extends object>(\n grid: ApexGrid<T>,\n opts: ExportOptions<T>\n): Array<ColumnConfiguration<T>> {\n const all = getDisplayColumns(grid.columns).filter(\n (column) => !column.hidden && column.exportable !== false\n );\n if (!opts.columns?.length) return all;\n const keys = new Set(opts.columns as Keys<T>[]);\n return all.filter((column) => keys.has(column.key));\n}\n\n/**\n * Resolves the rows that should appear in the export.\n */\nexport function resolveExportRows<T extends object>(\n grid: ApexGrid<T>,\n source: ExportSource = 'view'\n): ReadonlyArray<T> {\n switch (source) {\n case 'all':\n return grid.data;\n case 'page':\n return grid.pageItems;\n case 'selected':\n return grid.selectedRows;\n default:\n return grid.dataView;\n }\n}\n\n/**\n * Returns the column's display label, used as the header cell value.\n */\nexport function getColumnLabel<T extends object>(column: ColumnConfiguration<T>): string {\n return column.headerText ?? String(column.key);\n}\n\nconst DATE_STYLE_MAP: Record<ColumnDateFormat, Intl.DateTimeFormatOptions['dateStyle']> = {\n short: 'short',\n medium: 'medium',\n long: 'long',\n full: 'full',\n};\n\n/**\n * Default cell-value formatter. Mirrors the on-screen rendering for each\n * column type while keeping primitive types primitive (so number/boolean/date\n * survive into XLSX as native cells instead of strings).\n */\nexport function defaultExportFormat<T extends object>(\n column: ColumnConfiguration<T>,\n value: unknown\n): ExportCellValue {\n if (value === null || value === undefined) return '';\n switch (column.type) {\n case 'select': {\n const found = column.options?.find((option) => {\n if (option && typeof option === 'object' && 'value' in option) {\n return (option as { value: unknown }).value === value;\n }\n return option === value;\n });\n if (found && typeof found === 'object' && 'label' in found) {\n const label = (found as { label?: unknown }).label;\n if (typeof label === 'string' && label.length > 0) return label;\n }\n return typeof value === 'number' || typeof value === 'boolean' ? value : String(value);\n }\n case 'date': {\n if (value instanceof Date) return value;\n const parsed = new Date(value as string | number);\n return Number.isNaN(parsed.getTime()) ? String(value) : parsed;\n }\n case 'boolean':\n return Boolean(value);\n case 'number':\n case 'rating': {\n const n = Number(value);\n return Number.isFinite(n) ? n : '';\n }\n default:\n return typeof value === 'number' || typeof value === 'boolean' ? value : String(value);\n }\n}\n\n/**\n * Resolves the export value for a single cell, applying the user-supplied\n * formatter when present and falling back to {@link defaultExportFormat}.\n */\nexport function resolveExportValue<T extends object>(\n column: ColumnConfiguration<T>,\n row: T,\n opts: ExportOptions<T>\n): ExportCellValue {\n const raw = (row as Record<string, unknown>)[column.key as string];\n return opts.formatter ? opts.formatter(column, raw, row) : defaultExportFormat(column, raw);\n}\n\n/** Formats a `Date` into the configured date style for CSV output. */\nexport function formatDateForCSV<T extends object>(\n column: ColumnConfiguration<T>,\n value: Date\n): string {\n const style = DATE_STYLE_MAP[column.format ?? 'medium'];\n try {\n return new Intl.DateTimeFormat(undefined, { dateStyle: style }).format(value);\n } catch {\n return value.toISOString();\n }\n}\n\nfunction escapeCSVCell(value: ExportCellValue, delimiter: string): string {\n if (value === null || value === undefined || value === '') return '';\n const text = value instanceof Date ? value.toISOString() : String(value);\n const needsQuoting =\n text.includes(delimiter) || text.includes('\"') || text.includes('\\n') || text.includes('\\r');\n return needsQuoting ? `\"${text.replace(/\"/g, '\"\"')}\"` : text;\n}\n\n/**\n * Builds the CSV string for the grid without triggering a download.\n *\n * @remarks\n * Useful when consumers want to ship the bytes through their own transport\n * (clipboard, HTTP upload). The {@link ApexGrid.exportToCSV} method calls\n * this and then triggers a browser download.\n */\nexport function buildCSV<T extends object>(\n grid: ApexGrid<T>,\n opts: CSVExportOptions<T> = {}\n): string {\n const delimiter = opts.delimiter ?? ',';\n const newline = opts.newline ?? '\\r\\n';\n const includeHeader = opts.includeHeader ?? true;\n const columns = resolveExportColumns(grid, opts);\n const rows = resolveExportRows(grid, opts.source);\n\n const lines: string[] = [];\n if (includeHeader) {\n lines.push(\n columns.map((column) => escapeCSVCell(getColumnLabel(column), delimiter)).join(delimiter)\n );\n }\n for (const row of rows) {\n const cells = columns.map((column) => {\n let value = resolveExportValue(column, row, opts);\n if (value instanceof Date) {\n value = formatDateForCSV(column, value);\n }\n return escapeCSVCell(value, delimiter);\n });\n lines.push(cells.join(delimiter));\n }\n\n const body = lines.join(newline);\n return opts.bom === false ? body : `\\uFEFF${body}`;\n}\n\n/**\n * Triggers a browser download for the given payload.\n *\n * @remarks\n * Falls back to a no-op when called outside the browser (during SSR or unit\n * tests on JSDOM without a body), so consumers can still call the public\n * export API safely.\n */\nexport function downloadBlob(\n filename: string,\n content: string | Uint8Array,\n mimeType: string\n): void {\n if (typeof document === 'undefined' || typeof URL?.createObjectURL !== 'function') return;\n // BlobPart accepts both string and Uint8Array; the cast quiets TS' strict\n // overload resolution which prefers ArrayBufferView only.\n const blob = new Blob([content as BlobPart], { type: mimeType });\n const url = URL.createObjectURL(blob);\n const anchor = document.createElement('a');\n anchor.href = url;\n anchor.download = filename;\n anchor.style.display = 'none';\n document.body.appendChild(anchor);\n anchor.click();\n document.body.removeChild(anchor);\n setTimeout(() => URL.revokeObjectURL(url), 0);\n}\n"]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight FLIP (First / Last / Invert / Play) helpers for animating
|
|
3
|
+
* element re-positioning during column reorder + row sort.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Uses the Web Animations API with `composite: 'add'` so the FLIP delta
|
|
7
|
+
* stacks ON TOP of whatever inline `transform` the virtualizer already set
|
|
8
|
+
* on row elements — without `'add'` our keyframe would clobber the
|
|
9
|
+
* virtualizer's `translate(...)` and rows would jump to the origin before
|
|
10
|
+
* settling.
|
|
11
|
+
*
|
|
12
|
+
* Respects `prefers-reduced-motion: reduce` and bails out entirely when the
|
|
13
|
+
* user has opted out of motion.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* One element to FLIP, captured at its "first" (pre-mutation) position.
|
|
17
|
+
*/
|
|
18
|
+
export interface FlipEntry {
|
|
19
|
+
element: HTMLElement;
|
|
20
|
+
rect: DOMRect;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Plays the FLIP animation for every captured element by computing the
|
|
24
|
+
* delta against its current (post-mutation) bounding rect and animating it
|
|
25
|
+
* back to identity.
|
|
26
|
+
*
|
|
27
|
+
* @param entries - Elements captured by {@link captureRect}.
|
|
28
|
+
* @param axis - `'x'` for horizontal motion (column reorder), `'y'` for
|
|
29
|
+
* vertical motion (row sort), `'both'` for diagonal motion if either axis
|
|
30
|
+
* could move.
|
|
31
|
+
*/
|
|
32
|
+
export declare function playFlip(entries: ReadonlyArray<FlipEntry>, axis?: 'x' | 'y' | 'both'): void;
|
|
33
|
+
/**
|
|
34
|
+
* Convenience: capture a rect for an element, returning a {@link FlipEntry}.
|
|
35
|
+
*/
|
|
36
|
+
export declare function captureRect(element: HTMLElement): FlipEntry;
|
|
37
|
+
/**
|
|
38
|
+
* A subset of `LitElement` needed for {@link awaitChildUpdates}.
|
|
39
|
+
*/
|
|
40
|
+
interface UpdatableElement {
|
|
41
|
+
updateComplete: Promise<unknown>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Awaits a set of child elements' `updateComplete` promises.
|
|
45
|
+
*
|
|
46
|
+
* @remarks
|
|
47
|
+
* The grid's `updateComplete` only resolves the grid's own update — child
|
|
48
|
+
* components (header row, body rows, cells) schedule their updates one
|
|
49
|
+
* microtask later. FLIP needs every relevant child to have its new DOM
|
|
50
|
+
* committed before computing the "Last" rect; without this wait the
|
|
51
|
+
* captured-before and measured-after rects match and the animation
|
|
52
|
+
* silently no-ops.
|
|
53
|
+
*/
|
|
54
|
+
export declare function awaitChildUpdates(elements: ReadonlyArray<UpdatableElement | null | undefined>): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Keyed FLIP entry — pairs an arbitrary identity key with a captured rect.
|
|
57
|
+
*
|
|
58
|
+
* @remarks
|
|
59
|
+
* Used for row sort animation: the virtualizer recycles `<apex-grid-row>`
|
|
60
|
+
* DOM elements so the same element holds different row data before and
|
|
61
|
+
* after a sort. We capture rects keyed by row data identity, then resolve
|
|
62
|
+
* the new DOM element after the sort via the `resolveElement` callback.
|
|
63
|
+
*/
|
|
64
|
+
export interface KeyedFlipEntry<K> {
|
|
65
|
+
key: K;
|
|
66
|
+
rect: DOMRect;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Plays a FLIP animation against elements located by key after a DOM
|
|
70
|
+
* mutation has settled. Used for row sort, where DOM elements get recycled
|
|
71
|
+
* across the mutation and can only be found by data identity.
|
|
72
|
+
*
|
|
73
|
+
* @param before - Rects captured before the mutation, keyed by data
|
|
74
|
+
* identity (or any other stable key).
|
|
75
|
+
* @param resolveElement - Function that returns the current DOM element
|
|
76
|
+
* representing `key`, or `null` if the keyed row is no longer in view.
|
|
77
|
+
* @param axis - Same semantics as {@link playFlip}.
|
|
78
|
+
*/
|
|
79
|
+
export declare function playKeyedFlip<K>(before: ReadonlyArray<KeyedFlipEntry<K>>, resolveElement: (key: K) => HTMLElement | null, axis?: 'x' | 'y' | 'both'): void;
|
|
80
|
+
export {};
|
package/internal/flip.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const FLIP_DURATION_MS = 220;
|
|
2
|
+
const FLIP_EASING = 'cubic-bezier(0.2, 0, 0.2, 1)';
|
|
3
|
+
const MIN_DELTA_PX = 0.5;
|
|
4
|
+
function prefersReducedMotion() {
|
|
5
|
+
if (typeof window === 'undefined' || !window.matchMedia)
|
|
6
|
+
return false;
|
|
7
|
+
return window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
8
|
+
}
|
|
9
|
+
export function playFlip(entries, axis = 'both') {
|
|
10
|
+
if (prefersReducedMotion() || entries.length === 0)
|
|
11
|
+
return;
|
|
12
|
+
for (const { element, rect: oldRect } of entries) {
|
|
13
|
+
if (!element.isConnected)
|
|
14
|
+
continue;
|
|
15
|
+
const newRect = element.getBoundingClientRect();
|
|
16
|
+
const dx = axis === 'y' ? 0 : oldRect.left - newRect.left;
|
|
17
|
+
const dy = axis === 'x' ? 0 : oldRect.top - newRect.top;
|
|
18
|
+
if (Math.abs(dx) < MIN_DELTA_PX && Math.abs(dy) < MIN_DELTA_PX)
|
|
19
|
+
continue;
|
|
20
|
+
element.animate([{ transform: `translate(${dx}px, ${dy}px)` }, { transform: 'translate(0, 0)' }], {
|
|
21
|
+
duration: FLIP_DURATION_MS,
|
|
22
|
+
easing: FLIP_EASING,
|
|
23
|
+
composite: 'add',
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export function captureRect(element) {
|
|
28
|
+
return { element, rect: element.getBoundingClientRect() };
|
|
29
|
+
}
|
|
30
|
+
export async function awaitChildUpdates(elements) {
|
|
31
|
+
await Promise.all(elements.filter((el) => el != null).map((el) => el.updateComplete));
|
|
32
|
+
}
|
|
33
|
+
export function playKeyedFlip(before, resolveElement, axis = 'both') {
|
|
34
|
+
if (prefersReducedMotion() || before.length === 0)
|
|
35
|
+
return;
|
|
36
|
+
for (const { key, rect: oldRect } of before) {
|
|
37
|
+
const element = resolveElement(key);
|
|
38
|
+
if (!element || !element.isConnected)
|
|
39
|
+
continue;
|
|
40
|
+
const newRect = element.getBoundingClientRect();
|
|
41
|
+
const dx = axis === 'y' ? 0 : oldRect.left - newRect.left;
|
|
42
|
+
const dy = axis === 'x' ? 0 : oldRect.top - newRect.top;
|
|
43
|
+
if (Math.abs(dx) < MIN_DELTA_PX && Math.abs(dy) < MIN_DELTA_PX)
|
|
44
|
+
continue;
|
|
45
|
+
element.animate([{ transform: `translate(${dx}px, ${dy}px)` }, { transform: 'translate(0, 0)' }], {
|
|
46
|
+
duration: FLIP_DURATION_MS,
|
|
47
|
+
easing: FLIP_EASING,
|
|
48
|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C,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;QACxD,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY;YAAE,SAAS;QAEzE,OAAO,CAAC,OAAO,CACb,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC,EAChF;YACE,QAAQ,EAAE,gBAAgB;YAC1B,MAAM,EAAE,WAAW;YACnB,SAAS,EAAE,KAAK;SACjB,CACF,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["/**\n * Lightweight FLIP (First / Last / Invert / Play) helpers for animating\n * element re-positioning during column reorder + row sort.\n *\n * @remarks\n * Uses the Web Animations API with `composite: 'add'` so the FLIP delta\n * stacks ON TOP of whatever inline `transform` the virtualizer already set\n * on row elements — without `'add'` our keyframe would clobber the\n * virtualizer's `translate(...)` and rows would jump to the origin before\n * settling.\n *\n * Respects `prefers-reduced-motion: reduce` and bails out entirely when the\n * user has opted out of motion.\n */\n\nconst FLIP_DURATION_MS = 220;\nconst FLIP_EASING = 'cubic-bezier(0.2, 0, 0.2, 1)';\nconst MIN_DELTA_PX = 0.5;\n\nfunction prefersReducedMotion(): boolean {\n if (typeof window === 'undefined' || !window.matchMedia) return false;\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\n/**\n * One element to FLIP, captured at its \"first\" (pre-mutation) position.\n */\nexport interface FlipEntry {\n element: HTMLElement;\n rect: DOMRect;\n}\n\n/**\n * Plays the FLIP animation for every captured element by computing the\n * delta against its current (post-mutation) bounding rect and animating it\n * back to identity.\n *\n * @param entries - Elements captured by {@link captureRect}.\n * @param axis - `'x'` for horizontal motion (column reorder), `'y'` for\n * vertical motion (row sort), `'both'` for diagonal motion if either axis\n * could move.\n */\nexport function playFlip(entries: ReadonlyArray<FlipEntry>, axis: 'x' | 'y' | 'both' = 'both') {\n if (prefersReducedMotion() || entries.length === 0) return;\n\n for (const { element, rect: oldRect } of entries) {\n if (!element.isConnected) continue;\n const newRect = element.getBoundingClientRect();\n const dx = axis === 'y' ? 0 : oldRect.left - newRect.left;\n const dy = axis === 'x' ? 0 : oldRect.top - newRect.top;\n if (Math.abs(dx) < MIN_DELTA_PX && Math.abs(dy) < MIN_DELTA_PX) continue;\n\n // `composite: 'add'` stacks our delta on top of any inline transform\n // (e.g. the virtualizer's `translate(0, Ypx)` on row elements).\n element.animate(\n [{ transform: `translate(${dx}px, ${dy}px)` }, { transform: 'translate(0, 0)' }],\n {\n duration: FLIP_DURATION_MS,\n easing: FLIP_EASING,\n composite: 'add',\n }\n );\n }\n}\n\n/**\n * Convenience: capture a rect for an element, returning a {@link FlipEntry}.\n */\nexport function captureRect(element: HTMLElement): FlipEntry {\n return { element, rect: element.getBoundingClientRect() };\n}\n\n/**\n * A subset of `LitElement` needed for {@link awaitChildUpdates}.\n */\ninterface UpdatableElement {\n updateComplete: Promise<unknown>;\n}\n\n/**\n * Awaits a set of child elements' `updateComplete` promises.\n *\n * @remarks\n * The grid's `updateComplete` only resolves the grid's own update — child\n * components (header row, body rows, cells) schedule their updates one\n * microtask later. FLIP needs every relevant child to have its new DOM\n * committed before computing the \"Last\" rect; without this wait the\n * captured-before and measured-after rects match and the animation\n * silently no-ops.\n */\nexport async function awaitChildUpdates(\n elements: ReadonlyArray<UpdatableElement | null | undefined>\n) {\n await Promise.all(\n elements.filter((el): el is UpdatableElement => el != null).map((el) => el.updateComplete)\n );\n}\n\n/**\n * Keyed FLIP entry — pairs an arbitrary identity key with a captured rect.\n *\n * @remarks\n * Used for row sort animation: the virtualizer recycles `<apex-grid-row>`\n * DOM elements so the same element holds different row data before and\n * after a sort. We capture rects keyed by row data identity, then resolve\n * the new DOM element after the sort via the `resolveElement` callback.\n */\nexport interface KeyedFlipEntry<K> {\n key: K;\n rect: DOMRect;\n}\n\n/**\n * Plays a FLIP animation against elements located by key after a DOM\n * mutation has settled. Used for row sort, where DOM elements get recycled\n * across the mutation and can only be found by data identity.\n *\n * @param before - Rects captured before the mutation, keyed by data\n * identity (or any other stable key).\n * @param resolveElement - Function that returns the current DOM element\n * representing `key`, or `null` if the keyed row is no longer in view.\n * @param axis - Same semantics as {@link playFlip}.\n */\nexport function playKeyedFlip<K>(\n before: ReadonlyArray<KeyedFlipEntry<K>>,\n resolveElement: (key: K) => HTMLElement | null,\n axis: 'x' | 'y' | 'both' = 'both'\n) {\n if (prefersReducedMotion() || before.length === 0) return;\n\n for (const { key, rect: oldRect } of before) {\n const element = resolveElement(key);\n if (!element || !element.isConnected) continue;\n const newRect = element.getBoundingClientRect();\n const dx = axis === 'y' ? 0 : oldRect.left - newRect.left;\n const dy = axis === 'x' ? 0 : oldRect.top - newRect.top;\n if (Math.abs(dx) < MIN_DELTA_PX && Math.abs(dy) < MIN_DELTA_PX) continue;\n\n element.animate(\n [{ transform: `translate(${dx}px, ${dy}px)` }, { transform: 'translate(0, 0)' }],\n {\n duration: FLIP_DURATION_MS,\n easing: FLIP_EASING,\n composite: 'add',\n }\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type SVGTemplateResult, type TemplateResult } from 'lit';
|
|
2
|
+
interface IconDef {
|
|
3
|
+
viewBox: string;
|
|
4
|
+
paths: SVGTemplateResult;
|
|
5
|
+
}
|
|
6
|
+
declare const ICONS: Record<string, IconDef>;
|
|
7
|
+
export type GridIconName = keyof typeof ICONS;
|
|
8
|
+
export interface IconRenderOptions {
|
|
9
|
+
/** Lit `slot` attribute. Useful when icons sit inside slotted positions of other components. */
|
|
10
|
+
slot?: string;
|
|
11
|
+
/** Lit `part` attribute. */
|
|
12
|
+
part?: string;
|
|
13
|
+
/** Inline `class` attribute. */
|
|
14
|
+
class?: string;
|
|
15
|
+
/** When provided, sets `data-sort-index` (used by the header sort indicator). */
|
|
16
|
+
sortIndex?: number | string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Renders one of the grid's built-in icons as an inline `<svg>`. All icons are
|
|
20
|
+
* decorative (`aria-hidden="true"`) by default — surrounding controls supply
|
|
21
|
+
* the accessible label via `aria-label`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function renderIcon(name: string, opts?: IconRenderOptions): TemplateResult;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { html, svg } from 'lit';
|
|
2
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
3
|
+
const ICONS = {
|
|
4
|
+
'arrow-upward': {
|
|
5
|
+
viewBox: '0 0 45 45',
|
|
6
|
+
paths: svg `<path d="M22.5 40V13.7L10.1 26.1 8 24 24 8l16 16-2.1 2.1-12.4-12.4V40Z"/>`,
|
|
7
|
+
},
|
|
8
|
+
'arrow-downward': {
|
|
9
|
+
viewBox: '0 0 45 45',
|
|
10
|
+
paths: svg `<path fill="currentColor" d="M24 40 8 24l2.1-2.1 12.4 12.4V8h3v26.3l12.4-12.4L40 24Z"/>`,
|
|
11
|
+
},
|
|
12
|
+
all: {
|
|
13
|
+
viewBox: '0 0 24 24',
|
|
14
|
+
paths: svg `<path d="M2 14h8v2H2zm0-8h12v2H2zm14 11l-3-3-1.5 1.5L16 20l7-7-1.5-1.5L16 17zM2 10h12v2H2z"/>`,
|
|
15
|
+
},
|
|
16
|
+
contains: {
|
|
17
|
+
viewBox: '0 0 24 24',
|
|
18
|
+
paths: svg `<path d="M3 3v18h18V3zm16 16H5V5h14z"/><path d="M12 11.3a4.39 4.39 0 00-2.54.63 2.07 2.07 0 00-.9 1.78 2.29 2.29 0 00.66 1.74 2.63 2.63 0 001.89.63 2.39 2.39 0 001.32-.37 3.05 3.05 0 001-.93 3.72 3.72 0 00.08.57c0 .19.1.38.16.58h1.79a4.51 4.51 0 01-.21-.88 5.57 5.57 0 01-.07-.93v-3.5a2.44 2.44 0 00-.84-2 3.34 3.34 0 00-2.22-.7 3.54 3.54 0 00-2.3.72A1.93 1.93 0 009 10.29h1.71a.93.93 0 01.29-.71 1.5 1.5 0 011-.29 1.45 1.45 0 011 .35 1.3 1.3 0 01.37 1v.69zm1.4 1.08v1.17a1.61 1.61 0 01-.71.77 2.27 2.27 0 01-1.21.34 1.18 1.18 0 01-.84-.27.92.92 0 01-.3-.72 1.16 1.16 0 01.44-.9 1.76 1.76 0 011.22-.39z"/>`,
|
|
19
|
+
},
|
|
20
|
+
doesNotContain: {
|
|
21
|
+
viewBox: '0 0 24 24',
|
|
22
|
+
paths: svg `<path d="M21 19.74V3H4.26L2.89 1.63 1.63 2.92 3 4.29V21h16.73l1.37 1.37 1.27-1.26zM5 19V6.28l5.28 5.27a3.19 3.19 0 00-.81.38 2.07 2.07 0 00-.9 1.78 2.29 2.29 0 00.66 1.74 2.63 2.63 0 001.89.63 2.39 2.39 0 001.32-.37 3.05 3.05 0 001-.93 3.72 3.72 0 00.08.57c0 .19.1.38.16.58h1L17.73 19zm5.79-6.23a1.31 1.31 0 01.45-.25l1.37 1.36.28.29a1.57 1.57 0 01-.19.15 2.27 2.27 0 01-1.21.34 1.18 1.18 0 01-.84-.27.92.92 0 01-.3-.72 1.16 1.16 0 01.44-.9zm2.6-1.47h-.83l-1.62-1.62.08-.1a1.5 1.5 0 011-.29 1.45 1.45 0 011 .35 1.3 1.3 0 01.37 1zM19 17.74l-3.85-3.85v-3.27a2.44 2.44 0 00-.84-2 3.34 3.34 0 00-2.22-.7 3.64 3.64 0 00-2.24.67L6.26 5H19z"/>`,
|
|
23
|
+
},
|
|
24
|
+
greaterThan: {
|
|
25
|
+
viewBox: '0 0 24 24',
|
|
26
|
+
paths: svg `<path d="M6 7.11L15.09 12 6 16.89V19l12-6.46v-1.08L6 5v2.11z"/>`,
|
|
27
|
+
},
|
|
28
|
+
greaterThanOrEqual: {
|
|
29
|
+
viewBox: '0 0 24 24',
|
|
30
|
+
paths: svg `<path d="M5.99 19h12.02v2H5.99zM18 9.47L6 3v2.11L15.09 10 6 14.9v2.11l12-6.47V9.47z"/>`,
|
|
31
|
+
},
|
|
32
|
+
empty: {
|
|
33
|
+
viewBox: '0 0 24 24',
|
|
34
|
+
paths: svg `<path d="M5 17h2v2H5zm8 0h2v2h-2zm-8-4h2v2H5zm12 4h2v2h-2zM13 5h2v2h-2zM9 17h2v2H9zm8-8h2v2h-2zm0 4h2v2h-2zm0-8h2v2h-2zM5 9h2v2H5zm0-4h2v2H5zm4 0h2v2H9z"/>`,
|
|
35
|
+
},
|
|
36
|
+
endsWith: {
|
|
37
|
+
viewBox: '0 0 24 24',
|
|
38
|
+
paths: svg `<path d="M3 14.5h2v2H3zm8 0h2v2h-2zm-4 0h2v2H7zm13.8.3v-3A2.1 2.1 0 0020 10a3 3 0 00-2-.6 3 3 0 00-2 .6 1.7 1.7 0 00-.7 1.5h1.5a.8.8 0 01.3-.7 1.3 1.3 0 01.9-.3 1.3 1.3 0 01.9.4 1.1 1.1 0 01.3.8v.6H18a3.8 3.8 0 00-2.2.6 1.8 1.8 0 00-.8 1.5 2 2 0 00.6 1.6 2.3 2.3 0 001.6.6 2.1 2.1 0 001.2-.4 2.8 2.8 0 00.8-.8 4.3 4.3 0 00.1.5l.1.5H21a4.1 4.1 0 01-.2-.7 5.4 5.4 0 010-1zm-1.6-.5a1.5 1.5 0 01-.6.7 2 2 0 01-1 .2 1.1 1.1 0 01-.8-.2.8.8 0 01-.2-.6 1 1 0 01.3-.8 1.5 1.5 0 011.1-.3h1.2z"/>`,
|
|
39
|
+
},
|
|
40
|
+
equals: {
|
|
41
|
+
viewBox: '0 0 24 24',
|
|
42
|
+
paths: svg `<path d="M5 13.5h14v2H5zm0-5h14v2H5z"/>`,
|
|
43
|
+
},
|
|
44
|
+
false: {
|
|
45
|
+
viewBox: '0 0 24 24',
|
|
46
|
+
paths: svg `<path d="M8 5a7 7 0 107 7 7 7 0 00-7-7zm4.31 9.79l-1.52 1.52L8 13.52l-2.79 2.79-1.52-1.52L6.48 12 3.69 9.21l1.52-1.52L8 10.48l2.79-2.79 1.52 1.52L9.52 12zM18 7a5 5 0 00-3 1.06 7.48 7.48 0 01.49 1 3.89 3.89 0 110 5.82 8.08 8.08 0 01-.49 1A5 5 0 1018 7z"/><path d="M17.52 13.85l2.91-2.92-.78-.78-2.13 2.12-1.17-1.15-.38.37-.41.41.42.42L17 13.34l.52.51z"/>`,
|
|
47
|
+
},
|
|
48
|
+
lessThan: {
|
|
49
|
+
viewBox: '0 0 24 24',
|
|
50
|
+
paths: svg `<path d="M6 12.54L18 19v-2.11L8.91 12 18 7.11V5L6 11.46v1.08z"/>`,
|
|
51
|
+
},
|
|
52
|
+
lessThanOrEqual: {
|
|
53
|
+
viewBox: '0 0 24 24',
|
|
54
|
+
paths: svg `<path d="M5.99 19h12.02v2H5.99zM18 14.9L8.91 10 18 5.11V3L6 9.47v1.07l12 6.47V14.9z"/>`,
|
|
55
|
+
},
|
|
56
|
+
notEmpty: {
|
|
57
|
+
viewBox: '0 0 24 24',
|
|
58
|
+
paths: svg `<path d="M5 9h2v2H5zm4 8h2v2H9zm4 0h2v2h-2zm4-8h2v2h-2zm0-4h2v2h-2zM5 17h2v2H5zm8-12h2v2h-2zm-8 8h2v2H5zm14 2v-2h-2v.47L18.53 15H19zm-8-8V5H9v.46L10.54 7H11zM2.76 1.76L1.5 3.06 20.97 22.5l1.26-1.26-8.89-8.89L2.76 1.76z"/>`,
|
|
59
|
+
},
|
|
60
|
+
doesNotEqual: {
|
|
61
|
+
viewBox: '0 0 24 24',
|
|
62
|
+
paths: svg `<path d="M17.37 4.71l-1.74-1-2.76 4.79H5v2h6.71l-1.73 3H5v2h3.82l-2.19 3.79 1.74 1 2.76-4.79H19v-2h-6.71l1.73-3H19v-2h-3.82l2.19-3.79z"/>`,
|
|
63
|
+
},
|
|
64
|
+
startsWith: {
|
|
65
|
+
viewBox: '0 0 24 24',
|
|
66
|
+
paths: svg `<path d="M5.9 7.5l-3.9 9h1.7l.7-1.8h4.1l.7 1.8H11l-3.9-9H5.9zM5 13.2l1.5-4.1L8 13.2H5zm7 1.3h2v2h-2v-2zm8 0h2v2h-2v-2zm-4 0h2v2h-2v-2z"/>`,
|
|
67
|
+
},
|
|
68
|
+
true: {
|
|
69
|
+
viewBox: '0 0 24 24',
|
|
70
|
+
paths: svg `<path d="M19.44 14.22zm-2.88 0zm0 0L18 12.79l1.44 1.43.78-.78L18.79 12l1.43-1.44-.78-.78L18 11.21l-1.44-1.43-.78.78L17.21 12l-1.43 1.44.78.78z"/><path d="M18 7a5 5 0 00-3 1.06 7.48 7.48 0 01.49 1 3.89 3.89 0 110 5.82 8.08 8.08 0 01-.49 1A5 5 0 1018 7zM8 5a7 7 0 107 7 7 7 0 00-7-7zm-.93 10.18l-3.38-3.37 1.13-1.12 2.25 2.25 4.11-4.12 1.13 1.12z"/>`,
|
|
71
|
+
},
|
|
72
|
+
filter: {
|
|
73
|
+
viewBox: '0 0 45 45',
|
|
74
|
+
paths: svg `<path d="M20 36v-3h8v3Zm-8-10.5v-3h24v3ZM6 15v-3h36v3Z"/>`,
|
|
75
|
+
},
|
|
76
|
+
close: {
|
|
77
|
+
viewBox: '0 0 48 48',
|
|
78
|
+
paths: svg `<path d="m12.45 37.65-2.1-2.1L21.9 24 10.35 12.45l2.1-2.1L24 21.9l11.55-11.55 2.1 2.1L26.1 24l11.55 11.55-2.1 2.1L24 26.1Z"/>`,
|
|
79
|
+
},
|
|
80
|
+
refresh: {
|
|
81
|
+
viewBox: '0 0 48 48',
|
|
82
|
+
paths: svg `<path d="M24 40q-6.65 0-11.325-4.675Q8 30.65 8 24q0-6.65 4.675-11.325Q17.35 8 24 8q4.25 0 7.45 1.725T37 14.45V8h3v12.7H27.3v-3h8.4q-1.9-3-4.85-4.85Q27.9 11 24 11q-5.45 0-9.225 3.775Q11 18.55 11 24q0 5.45 3.775 9.225Q18.55 37 24 37q4.15 0 7.6-2.375 3.45-2.375 4.8-6.275h3.1q-1.45 5.25-5.75 8.45Q29.45 40 24 40Z"/>`,
|
|
83
|
+
},
|
|
84
|
+
'page-first': {
|
|
85
|
+
viewBox: '0 0 24 24',
|
|
86
|
+
paths: svg `<path d="M6 6h2v12H6zm3.5 6l8.5 6V6z"/>`,
|
|
87
|
+
},
|
|
88
|
+
'page-previous': {
|
|
89
|
+
viewBox: '0 0 24 24',
|
|
90
|
+
paths: svg `<path d="M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"/>`,
|
|
91
|
+
},
|
|
92
|
+
'page-next': {
|
|
93
|
+
viewBox: '0 0 24 24',
|
|
94
|
+
paths: svg `<path d="M8.59 16.59 10 18l6-6-6-6-1.41 1.41L13.17 12z"/>`,
|
|
95
|
+
},
|
|
96
|
+
'page-last': {
|
|
97
|
+
viewBox: '0 0 24 24',
|
|
98
|
+
paths: svg `<path d="M6 18l8.5-6L6 6v12zM16 6h2v12h-2z"/>`,
|
|
99
|
+
},
|
|
100
|
+
search: {
|
|
101
|
+
viewBox: '0 0 24 24',
|
|
102
|
+
paths: svg `<path d="M15.5 14h-.79l-.28-.27a6.471 6.471 0 0 0 1.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 0 0-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.471 6.471 0 0 0 5.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>`,
|
|
103
|
+
},
|
|
104
|
+
star: {
|
|
105
|
+
viewBox: '0 0 24 24',
|
|
106
|
+
paths: svg `<path d="M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/>`,
|
|
107
|
+
},
|
|
108
|
+
'chevron-down': {
|
|
109
|
+
viewBox: '0 0 24 24',
|
|
110
|
+
paths: svg `<path d="M7.41 8.58 12 13.17l4.59-4.59L18 10l-6 6-6-6z"/>`,
|
|
111
|
+
},
|
|
112
|
+
download: {
|
|
113
|
+
viewBox: '0 0 24 24',
|
|
114
|
+
paths: svg `<path d="M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"/>`,
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
export function renderIcon(name, opts = {}) {
|
|
118
|
+
const icon = ICONS[name];
|
|
119
|
+
if (!icon)
|
|
120
|
+
return html ``;
|
|
121
|
+
return html `<svg
|
|
122
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
123
|
+
viewBox=${icon.viewBox}
|
|
124
|
+
fill="currentColor"
|
|
125
|
+
aria-hidden="true"
|
|
126
|
+
focusable="false"
|
|
127
|
+
data-icon=${name}
|
|
128
|
+
slot=${ifDefined(opts.slot)}
|
|
129
|
+
part=${ifDefined(opts.part)}
|
|
130
|
+
class=${ifDefined(opts.class)}
|
|
131
|
+
data-sort-index=${ifDefined(opts.sortIndex)}
|
|
132
|
+
>${icon.paths}</svg>`;
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../../src/internal/icons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA0B,GAAG,EAAuB,MAAM,KAAK,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAOzD,MAAM,KAAK,GAA4B;IACrC,cAAc,EAAE;QACd,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,GAAG,CAAA,2EAA2E;KACtF;IACD,gBAAgB,EAAE;QAChB,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,GAAG,CAAA,yFAAyF;KACpG;IACD,GAAG,EAAE;QACH,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,GAAG,CAAA,+FAA+F;KAC1G;IACD,QAAQ,EAAE;QACR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,IAAI,CAAC,KAAK,CAAC;sBACX,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC;KAC1C,IAAI,CAAC,KAAK,QAAQ,CAAC;AACxB,CAAC","sourcesContent":["import { html, type SVGTemplateResult, svg, type TemplateResult } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\ninterface IconDef {\n viewBox: string;\n paths: SVGTemplateResult;\n}\n\nconst ICONS: Record<string, IconDef> = {\n 'arrow-upward': {\n viewBox: '0 0 45 45',\n paths: svg`<path d=\"M22.5 40V13.7L10.1 26.1 8 24 24 8l16 16-2.1 2.1-12.4-12.4V40Z\"/>`,\n },\n 'arrow-downward': {\n viewBox: '0 0 45 45',\n paths: svg`<path fill=\"currentColor\" d=\"M24 40 8 24l2.1-2.1 12.4 12.4V8h3v26.3l12.4-12.4L40 24Z\"/>`,\n },\n all: {\n viewBox: '0 0 24 24',\n paths: svg`<path d=\"M2 14h8v2H2zm0-8h12v2H2zm14 11l-3-3-1.5 1.5L16 20l7-7-1.5-1.5L16 17zM2 10h12v2H2z\"/>`,\n },\n contains: {\n viewBox: '0 0 24 24',\n paths: svg`<path d=\"M3 3v18h18V3zm16 16H5V5h14z\"/><path d=\"M12 11.3a4.39 4.39 0 00-2.54.63 2.07 2.07 0 00-.9 1.78 2.29 2.29 0 00.66 1.74 2.63 2.63 0 001.89.63 2.39 2.39 0 001.32-.37 3.05 3.05 0 001-.93 3.72 3.72 0 00.08.57c0 .19.1.38.16.58h1.79a4.51 4.51 0 01-.21-.88 5.57 5.57 0 01-.07-.93v-3.5a2.44 2.44 0 00-.84-2 3.34 3.34 0 00-2.22-.7 3.54 3.54 0 00-2.3.72A1.93 1.93 0 009 10.29h1.71a.93.93 0 01.29-.71 1.5 1.5 0 011-.29 1.45 1.45 0 011 .35 1.3 1.3 0 01.37 1v.69zm1.4 1.08v1.17a1.61 1.61 0 01-.71.77 2.27 2.27 0 01-1.21.34 1.18 1.18 0 01-.84-.27.92.92 0 01-.3-.72 1.16 1.16 0 01.44-.9 1.76 1.76 0 011.22-.39z\"/>`,\n },\n doesNotContain: {\n viewBox: '0 0 24 24',\n paths: svg`<path d=\"M21 19.74V3H4.26L2.89 1.63 1.63 2.92 3 4.29V21h16.73l1.37 1.37 1.27-1.26zM5 19V6.28l5.28 5.27a3.19 3.19 0 00-.81.38 2.07 2.07 0 00-.9 1.78 2.29 2.29 0 00.66 1.74 2.63 2.63 0 001.89.63 2.39 2.39 0 001.32-.37 3.05 3.05 0 001-.93 3.72 3.72 0 00.08.57c0 .19.1.38.16.58h1L17.73 19zm5.79-6.23a1.31 1.31 0 01.45-.25l1.37 1.36.28.29a1.57 1.57 0 01-.19.15 2.27 2.27 0 01-1.21.34 1.18 1.18 0 01-.84-.27.92.92 0 01-.3-.72 1.16 1.16 0 01.44-.9zm2.6-1.47h-.83l-1.62-1.62.08-.1a1.5 1.5 0 011-.29 1.45 1.45 0 011 .35 1.3 1.3 0 01.37 1zM19 17.74l-3.85-3.85v-3.27a2.44 2.44 0 00-.84-2 3.34 3.34 0 00-2.22-.7 3.64 3.64 0 00-2.24.67L6.26 5H19z\"/>`,\n },\n greaterThan: {\n viewBox: '0 0 24 24',\n paths: svg`<path d=\"M6 7.11L15.09 12 6 16.89V19l12-6.46v-1.08L6 5v2.11z\"/>`,\n },\n greaterThanOrEqual: {\n viewBox: '0 0 24 24',\n paths: svg`<path d=\"M5.99 19h12.02v2H5.99zM18 9.47L6 3v2.11L15.09 10 6 14.9v2.11l12-6.47V9.47z\"/>`,\n },\n empty: {\n viewBox: '0 0 24 24',\n paths: svg`<path d=\"M5 17h2v2H5zm8 0h2v2h-2zm-8-4h2v2H5zm12 4h2v2h-2zM13 5h2v2h-2zM9 17h2v2H9zm8-8h2v2h-2zm0 4h2v2h-2zm0-8h2v2h-2zM5 9h2v2H5zm0-4h2v2H5zm4 0h2v2H9z\"/>`,\n },\n endsWith: {\n viewBox: '0 0 24 24',\n paths: svg`<path d=\"M3 14.5h2v2H3zm8 0h2v2h-2zm-4 0h2v2H7zm13.8.3v-3A2.1 2.1 0 0020 10a3 3 0 00-2-.6 3 3 0 00-2 .6 1.7 1.7 0 00-.7 1.5h1.5a.8.8 0 01.3-.7 1.3 1.3 0 01.9-.3 1.3 1.3 0 01.9.4 1.1 1.1 0 01.3.8v.6H18a3.8 3.8 0 00-2.2.6 1.8 1.8 0 00-.8 1.5 2 2 0 00.6 1.6 2.3 2.3 0 001.6.6 2.1 2.1 0 001.2-.4 2.8 2.8 0 00.8-.8 4.3 4.3 0 00.1.5l.1.5H21a4.1 4.1 0 01-.2-.7 5.4 5.4 0 010-1zm-1.6-.5a1.5 1.5 0 01-.6.7 2 2 0 01-1 .2 1.1 1.1 0 01-.8-.2.8.8 0 01-.2-.6 1 1 0 01.3-.8 1.5 1.5 0 011.1-.3h1.2z\"/>`,\n },\n equals: {\n viewBox: '0 0 24 24',\n paths: svg`<path d=\"M5 13.5h14v2H5zm0-5h14v2H5z\"/>`,\n },\n false: {\n viewBox: '0 0 24 24',\n paths: svg`<path d=\"M8 5a7 7 0 107 7 7 7 0 00-7-7zm4.31 9.79l-1.52 1.52L8 13.52l-2.79 2.79-1.52-1.52L6.48 12 3.69 9.21l1.52-1.52L8 10.48l2.79-2.79 1.52 1.52L9.52 12zM18 7a5 5 0 00-3 1.06 7.48 7.48 0 01.49 1 3.89 3.89 0 110 5.82 8.08 8.08 0 01-.49 1A5 5 0 1018 7z\"/><path d=\"M17.52 13.85l2.91-2.92-.78-.78-2.13 2.12-1.17-1.15-.38.37-.41.41.42.42L17 13.34l.52.51z\"/>`,\n },\n lessThan: {\n viewBox: '0 0 24 24',\n paths: svg`<path d=\"M6 12.54L18 19v-2.11L8.91 12 18 7.11V5L6 11.46v1.08z\"/>`,\n },\n lessThanOrEqual: {\n viewBox: '0 0 24 24',\n paths: svg`<path d=\"M5.99 19h12.02v2H5.99zM18 14.9L8.91 10 18 5.11V3L6 9.47v1.07l12 6.47V14.9z\"/>`,\n },\n notEmpty: {\n viewBox: '0 0 24 24',\n paths: svg`<path d=\"M5 9h2v2H5zm4 8h2v2H9zm4 0h2v2h-2zm4-8h2v2h-2zm0-4h2v2h-2zM5 17h2v2H5zm8-12h2v2h-2zm-8 8h2v2H5zm14 2v-2h-2v.47L18.53 15H19zm-8-8V5H9v.46L10.54 7H11zM2.76 1.76L1.5 3.06 20.97 22.5l1.26-1.26-8.89-8.89L2.76 1.76z\"/>`,\n },\n doesNotEqual: {\n viewBox: '0 0 24 24',\n paths: svg`<path d=\"M17.37 4.71l-1.74-1-2.76 4.79H5v2h6.71l-1.73 3H5v2h3.82l-2.19 3.79 1.74 1 2.76-4.79H19v-2h-6.71l1.73-3H19v-2h-3.82l2.19-3.79z\"/>`,\n },\n startsWith: {\n viewBox: '0 0 24 24',\n paths: svg`<path d=\"M5.9 7.5l-3.9 9h1.7l.7-1.8h4.1l.7 1.8H11l-3.9-9H5.9zM5 13.2l1.5-4.1L8 13.2H5zm7 1.3h2v2h-2v-2zm8 0h2v2h-2v-2zm-4 0h2v2h-2v-2z\"/>`,\n },\n true: {\n viewBox: '0 0 24 24',\n paths: svg`<path d=\"M19.44 14.22zm-2.88 0zm0 0L18 12.79l1.44 1.43.78-.78L18.79 12l1.43-1.44-.78-.78L18 11.21l-1.44-1.43-.78.78L17.21 12l-1.43 1.44.78.78z\"/><path d=\"M18 7a5 5 0 00-3 1.06 7.48 7.48 0 01.49 1 3.89 3.89 0 110 5.82 8.08 8.08 0 01-.49 1A5 5 0 1018 7zM8 5a7 7 0 107 7 7 7 0 00-7-7zm-.93 10.18l-3.38-3.37 1.13-1.12 2.25 2.25 4.11-4.12 1.13 1.12z\"/>`,\n },\n filter: {\n viewBox: '0 0 45 45',\n paths: svg`<path d=\"M20 36v-3h8v3Zm-8-10.5v-3h24v3ZM6 15v-3h36v3Z\"/>`,\n },\n close: {\n viewBox: '0 0 48 48',\n paths: svg`<path d=\"m12.45 37.65-2.1-2.1L21.9 24 10.35 12.45l2.1-2.1L24 21.9l11.55-11.55 2.1 2.1L26.1 24l11.55 11.55-2.1 2.1L24 26.1Z\"/>`,\n },\n refresh: {\n viewBox: '0 0 48 48',\n paths: svg`<path d=\"M24 40q-6.65 0-11.325-4.675Q8 30.65 8 24q0-6.65 4.675-11.325Q17.35 8 24 8q4.25 0 7.45 1.725T37 14.45V8h3v12.7H27.3v-3h8.4q-1.9-3-4.85-4.85Q27.9 11 24 11q-5.45 0-9.225 3.775Q11 18.55 11 24q0 5.45 3.775 9.225Q18.55 37 24 37q4.15 0 7.6-2.375 3.45-2.375 4.8-6.275h3.1q-1.45 5.25-5.75 8.45Q29.45 40 24 40Z\"/>`,\n },\n 'page-first': {\n viewBox: '0 0 24 24',\n paths: svg`<path d=\"M6 6h2v12H6zm3.5 6l8.5 6V6z\"/>`,\n },\n 'page-previous': {\n viewBox: '0 0 24 24',\n paths: svg`<path d=\"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z\"/>`,\n },\n 'page-next': {\n viewBox: '0 0 24 24',\n paths: svg`<path d=\"M8.59 16.59 10 18l6-6-6-6-1.41 1.41L13.17 12z\"/>`,\n },\n 'page-last': {\n viewBox: '0 0 24 24',\n paths: svg`<path d=\"M6 18l8.5-6L6 6v12zM16 6h2v12h-2z\"/>`,\n },\n search: {\n viewBox: '0 0 24 24',\n paths: svg`<path d=\"M15.5 14h-.79l-.28-.27a6.471 6.471 0 0 0 1.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 0 0-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.471 6.471 0 0 0 5.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\"/>`,\n },\n star: {\n viewBox: '0 0 24 24',\n paths: svg`<path d=\"M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z\"/>`,\n },\n 'chevron-down': {\n viewBox: '0 0 24 24',\n paths: svg`<path d=\"M7.41 8.58 12 13.17l4.59-4.59L18 10l-6 6-6-6z\"/>`,\n },\n download: {\n viewBox: '0 0 24 24',\n paths: svg`<path d=\"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z\"/>`,\n },\n};\n\nexport type GridIconName = keyof typeof ICONS;\n\nexport interface IconRenderOptions {\n /** Lit `slot` attribute. Useful when icons sit inside slotted positions of other components. */\n slot?: string;\n /** Lit `part` attribute. */\n part?: string;\n /** Inline `class` attribute. */\n class?: string;\n /** When provided, sets `data-sort-index` (used by the header sort indicator). */\n sortIndex?: number | string;\n}\n\n/**\n * Renders one of the grid's built-in icons as an inline `<svg>`. All icons are\n * decorative (`aria-hidden=\"true\"`) by default — surrounding controls supply\n * the accessible label via `aria-label`.\n */\nexport function renderIcon(name: string, opts: IconRenderOptions = {}): TemplateResult {\n const icon = ICONS[name];\n if (!icon) return html``;\n return html`<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=${icon.viewBox}\n fill=\"currentColor\"\n aria-hidden=\"true\"\n focusable=\"false\"\n data-icon=${name}\n slot=${ifDefined(opts.slot)}\n part=${ifDefined(opts.part)}\n class=${ifDefined(opts.class)}\n data-sort-index=${ifDefined(opts.sortIndex)}\n >${icon.paths}</svg>`;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-defined.js","sourceRoot":"","sources":["../../src/internal/is-defined.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAI,KAA2B;IACtD,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC;AAC/C,CAAC","sourcesContent":["export function isDefined<T>(value: T | null | undefined): value is NonNullable<T> {\n return value !== undefined && value !== null;\n}\n"]}
|
|
@@ -5,4 +5,3 @@ export declare class EventEmitterBase<E> extends LitElement {
|
|
|
5
5
|
removeEventListener<K extends keyof M, M extends E & HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: M[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
6
6
|
emitEvent<K extends keyof E, D extends UnpackCustomEvent<E[K]>>(type: K, eventInitDict?: CustomEventInit<D>): boolean;
|
|
7
7
|
}
|
|
8
|
-
//# sourceMappingURL=event-emitter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-emitter.js","sourceRoot":"","sources":["../../../src/internal/mixins/event-emitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAIjC,MAAM,OAAO,gBAAoB,SAAQ,UAAU;IAMjC,gBAAgB,CAC9B,IAAY,EACZ,QAA4C,EAC5C,OAA2C;QAE3C,KAAK,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IAOe,mBAAmB,CACjC,IAAY,EACZ,QAA4C,EAC5C,OAAwC;QAExC,KAAK,CAAC,mBAAmB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IACM,SAAS,CACd,IAAO,EACP,aAAkC;QAElC,OAAO,IAAI,CAAC,aAAa,CACvB,IAAI,WAAW,CACb,IAAc,EACd,MAAM,CAAC,MAAM,CACX;YACE,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,KAAK;YACjB,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,EAAE;SACX,EACD,aAAa,CACd,CACF,CACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { LitElement } from 'lit';\n\nexport type UnpackCustomEvent<T> = T extends CustomEvent<infer U> ? U : never;\n\nexport class EventEmitterBase<E> extends LitElement {\n public override addEventListener<K extends keyof M, M extends E & HTMLElementEventMap>(\n type: K,\n listener: (this: HTMLElement, ev: M[K]) => any,\n options?: boolean | AddEventListenerOptions\n ): void;\n public override addEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions\n ): void {\n super.addEventListener(type, listener, options);\n }\n\n public override removeEventListener<K extends keyof M, M extends E & HTMLElementEventMap>(\n type: K,\n listener: (this: HTMLElement, ev: M[K]) => any,\n options?: boolean | EventListenerOptions\n ): void;\n public override removeEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions\n ): void {\n super.removeEventListener(type, listener, options);\n }\n public emitEvent<K extends keyof E, D extends UnpackCustomEvent<E[K]>>(\n type: K,\n eventInitDict?: CustomEventInit<D>\n ): boolean {\n return this.dispatchEvent(\n new CustomEvent<D>(\n type as string,\n Object.assign(\n {\n bubbles: true,\n cancelable: false,\n composed: true,\n detail: {},\n },\n eventInitDict\n )\n )\n );\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-case.js","sourceRoot":"","sources":["../../src/internal/normalize-case.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,aAAa,CAAC,MAAc,EAAE,aAAuB;IACnE,OAAO,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;AACvD,CAAC","sourcesContent":["export function normalizeCase(string: string, caseSensitive?: boolean) {\n return caseSensitive ? string : string.toLowerCase();\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"part-map.js","sourceRoot":"","sources":["../../src/internal/part-map.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,WAAW,CAAC,KAAmB;IAC7C,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;SACtB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SAC3B,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC","sourcesContent":["export interface PartNameInfo {\n readonly [name: string]: string | boolean | number;\n}\n\nexport function partNameMap(parts: PartNameInfo) {\n return Object.keys(parts)\n .filter((key) => parts[key])\n .join(' ');\n}\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
type ApexComponent = CustomElementConstructor & {
|
|
2
|
-
|
|
3
|
-
register:
|
|
2
|
+
tagName: string;
|
|
3
|
+
register: () => void;
|
|
4
4
|
};
|
|
5
|
-
export declare function registerComponent(component: ApexComponent, dependencies
|
|
5
|
+
export declare function registerComponent(component: ApexComponent, ...dependencies: ApexComponent[]): void;
|
|
6
6
|
export {};
|
|
7
|
-
//# sourceMappingURL=register.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function registerComponent(component, ...dependencies) {
|
|
2
|
+
for (const dependency of dependencies) {
|
|
3
|
+
dependency.register();
|
|
4
|
+
}
|
|
5
|
+
if (!customElements.get(component.tagName)) {
|
|
6
|
+
customElements.define(component.tagName, component);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/internal/register.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,iBAAiB,CAC/B,SAAwB,EACxB,GAAG,YAA6B;IAEhC,KAAK,MAAM,UAAU,IAAI,YAAY,EAAE,CAAC;QACtC,UAAU,CAAC,QAAQ,EAAE,CAAC;IACxB,CAAC;IAED,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3C,cAAc,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACtD,CAAC;AACH,CAAC","sourcesContent":["type ApexComponent = CustomElementConstructor & {\n tagName: string;\n register: () => void;\n};\n\nexport function registerComponent(\n component: ApexComponent,\n ...dependencies: ApexComponent[]\n): void {\n for (const dependency of dependencies) {\n dependency.register();\n }\n\n if (!customElements.get(component.tagName)) {\n customElements.define(component.tagName, component);\n }\n}\n"]}
|
|
@@ -5,4 +5,5 @@ export declare const GRID_HEADER_TAG: "apex-grid-header";
|
|
|
5
5
|
export declare const GRID_ROW_TAG: "apex-grid-row";
|
|
6
6
|
export declare const GRID_CELL_TAG: "apex-grid-cell";
|
|
7
7
|
export declare const GRID_FILTER_ROW_TAG: "apex-filter-row";
|
|
8
|
-
|
|
8
|
+
export declare const GRID_PAGINATOR_TAG: "apex-grid-paginator";
|
|
9
|
+
export declare const GRID_TOOLBAR_TAG: "apex-grid-toolbar";
|
|
@@ -5,4 +5,6 @@ export const GRID_HEADER_TAG = 'apex-grid-header';
|
|
|
5
5
|
export const GRID_ROW_TAG = 'apex-grid-row';
|
|
6
6
|
export const GRID_CELL_TAG = 'apex-grid-cell';
|
|
7
7
|
export const GRID_FILTER_ROW_TAG = 'apex-filter-row';
|
|
8
|
+
export const GRID_PAGINATOR_TAG = 'apex-grid-paginator';
|
|
9
|
+
export const GRID_TOOLBAR_TAG = 'apex-grid-toolbar';
|
|
8
10
|
//# sourceMappingURL=tags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tags.js","sourceRoot":"","sources":["../../src/internal/tags.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,WAAoB,CAAC;AAC7C,MAAM,CAAC,MAAM,SAAS,GAAG,kBAA2B,CAAC;AACrD,MAAM,CAAC,MAAM,mBAAmB,GAAG,sBAA+B,CAAC;AACnE,MAAM,CAAC,MAAM,eAAe,GAAG,kBAA2B,CAAC;AAC3D,MAAM,CAAC,MAAM,YAAY,GAAG,eAAwB,CAAC;AACrD,MAAM,CAAC,MAAM,aAAa,GAAG,gBAAyB,CAAC;AACvD,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAA0B,CAAC;AAC9D,MAAM,CAAC,MAAM,kBAAkB,GAAG,qBAA8B,CAAC;AACjE,MAAM,CAAC,MAAM,gBAAgB,GAAG,mBAA4B,CAAC","sourcesContent":["export const GRID_TAG = 'apex-grid' as const;\nexport const GRID_BODY = 'apex-virtualizer' as const;\nexport const GRID_HEADER_ROW_TAG = 'apex-grid-header-row' as const;\nexport const GRID_HEADER_TAG = 'apex-grid-header' as const;\nexport const GRID_ROW_TAG = 'apex-grid-row' as const;\nexport const GRID_CELL_TAG = 'apex-grid-cell' as const;\nexport const GRID_FILTER_ROW_TAG = 'apex-filter-row' as const;\nexport const GRID_PAGINATOR_TAG = 'apex-grid-paginator' as const;\nexport const GRID_TOOLBAR_TAG = 'apex-grid-toolbar' as const;\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { CSSResult, ReactiveController, ReactiveControllerHost, ReactiveElement } from 'lit';
|
|
2
|
+
type Theme = 'material' | 'bootstrap' | 'indigo' | 'fluent';
|
|
3
|
+
type Themes = {
|
|
4
|
+
light: {
|
|
5
|
+
[K in Theme | 'shared']?: CSSResult;
|
|
6
|
+
};
|
|
7
|
+
dark: {
|
|
8
|
+
[K in Theme | 'shared']?: CSSResult;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
type ThemeChangedCallback = (theme: Theme) => unknown;
|
|
12
|
+
type ThemingControllerConfig = {
|
|
13
|
+
themeChange?: ThemeChangedCallback;
|
|
14
|
+
};
|
|
15
|
+
declare class ThemingController implements ReactiveController {
|
|
16
|
+
private readonly _host;
|
|
17
|
+
private readonly _themes;
|
|
18
|
+
private readonly _options?;
|
|
19
|
+
private _theme;
|
|
20
|
+
private _variant;
|
|
21
|
+
get theme(): Theme;
|
|
22
|
+
constructor(host: ReactiveControllerHost & ReactiveElement, themes: Themes, config?: ThemingControllerConfig);
|
|
23
|
+
/** @internal */
|
|
24
|
+
hostConnected(): void;
|
|
25
|
+
/** @internal */
|
|
26
|
+
hostDisconnected(): void;
|
|
27
|
+
/** @internal */
|
|
28
|
+
handleEvent(): void;
|
|
29
|
+
private _getStyles;
|
|
30
|
+
protected _adoptStyles(): void;
|
|
31
|
+
private _handleThemeChanged;
|
|
32
|
+
}
|
|
33
|
+
export declare function addThemingController(host: ReactiveControllerHost & ReactiveElement, themes: Themes, config?: ThemingControllerConfig): ThemingController;
|
|
34
|
+
export type { ThemingController };
|