@toolbox-web/grid 3.9.2 → 3.10.1
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/all.js +1 -1
- package/all.js.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/lib/core/types.d.ts +6 -3
- package/lib/features/clipboard.js.map +1 -1
- package/lib/features/column-virtualization.js.map +1 -1
- package/lib/features/context-menu.js.map +1 -1
- package/lib/features/editing.js.map +1 -1
- package/lib/features/export.js.map +1 -1
- package/lib/features/filtering.js.map +1 -1
- package/lib/features/grouping-columns.js.map +1 -1
- package/lib/features/grouping-rows.js.map +1 -1
- package/lib/features/master-detail.js.map +1 -1
- package/lib/features/multi-sort.js.map +1 -1
- package/lib/features/pinned-columns.js.map +1 -1
- package/lib/features/pinned-rows.js.map +1 -1
- package/lib/features/pivot.js.map +1 -1
- package/lib/features/print.js.map +1 -1
- package/lib/features/registry.js +1 -1
- package/lib/features/registry.js.map +1 -1
- package/lib/features/reorder-columns.js.map +1 -1
- package/lib/features/responsive.js.map +1 -1
- package/lib/features/row-drag-drop.js.map +1 -1
- package/lib/features/selection.js.map +1 -1
- package/lib/features/server-side.js.map +1 -1
- package/lib/features/shell.js.map +1 -1
- package/lib/features/sticky-rows.js.map +1 -1
- package/lib/features/tooltip.js.map +1 -1
- package/lib/features/tree.js.map +1 -1
- package/lib/features/undo-redo.js.map +1 -1
- package/lib/features/visibility.js.map +1 -1
- package/lib/plugins/clipboard/index.js.map +1 -1
- package/lib/plugins/column-virtualization/index.js.map +1 -1
- package/lib/plugins/context-menu/index.js.map +1 -1
- package/lib/plugins/editing/editors.d.ts +15 -0
- package/lib/plugins/editing/index.js +1 -1
- package/lib/plugins/editing/index.js.map +1 -1
- package/lib/plugins/editing/internal/helpers.d.ts +23 -0
- package/lib/plugins/editing/types.d.ts +16 -1
- package/lib/plugins/export/index.js +1 -1
- package/lib/plugins/export/index.js.map +1 -1
- package/lib/plugins/filtering/filter-model.d.ts +20 -1
- package/lib/plugins/filtering/filter-panel-default.d.ts +15 -1
- package/lib/plugins/filtering/index.d.ts +1 -1
- package/lib/plugins/filtering/index.js +1 -1
- package/lib/plugins/filtering/index.js.map +1 -1
- package/lib/plugins/filtering/types.d.ts +58 -3
- package/lib/plugins/grouping-columns/index.js.map +1 -1
- package/lib/plugins/grouping-rows/index.js +1 -1
- package/lib/plugins/grouping-rows/index.js.map +1 -1
- package/lib/plugins/hierarchy/index.js.map +1 -1
- package/lib/plugins/master-detail/index.js +1 -1
- package/lib/plugins/master-detail/index.js.map +1 -1
- package/lib/plugins/master-detail/master-detail-plugin.d.ts +6 -1
- package/lib/plugins/multi-sort/index.js.map +1 -1
- package/lib/plugins/pinned-columns/index.js.map +1 -1
- package/lib/plugins/pinned-rows/index.js.map +1 -1
- package/lib/plugins/pivot/index.js +1 -1
- package/lib/plugins/pivot/index.js.map +1 -1
- package/lib/plugins/pivot/pivot-plugin.d.ts +2 -0
- package/lib/plugins/pivot/types.d.ts +2 -0
- package/lib/plugins/print/index.js.map +1 -1
- package/lib/plugins/reorder-columns/index.js.map +1 -1
- package/lib/plugins/responsive/index.js.map +1 -1
- package/lib/plugins/row-drag-drop/index.js.map +1 -1
- package/lib/plugins/selection/index.js +1 -1
- package/lib/plugins/selection/index.js.map +1 -1
- package/lib/plugins/server-side/index.js.map +1 -1
- package/lib/plugins/shared/form-field-target.d.ts +10 -0
- package/lib/plugins/shared/format-value.d.ts +12 -0
- package/lib/plugins/shared/structural-toggle.d.ts +14 -0
- package/lib/plugins/shell/index.js.map +1 -1
- package/lib/plugins/sticky-rows/index.js.map +1 -1
- package/lib/plugins/tooltip/index.js.map +1 -1
- package/lib/plugins/tree/index.js +1 -1
- package/lib/plugins/tree/index.js.map +1 -1
- package/lib/plugins/undo-redo/index.d.ts +1 -1
- package/lib/plugins/undo-redo/index.js +1 -1
- package/lib/plugins/undo-redo/index.js.map +1 -1
- package/lib/plugins/undo-redo/types.d.ts +20 -2
- package/lib/plugins/undo-redo/undo-redo-plugin.d.ts +8 -0
- package/lib/plugins/visibility/index.js.map +1 -1
- package/package.json +1 -1
- package/umd/grid.all.umd.js +1 -1
- package/umd/grid.all.umd.js.map +1 -1
- package/umd/grid.umd.js +1 -1
- package/umd/grid.umd.js.map +1 -1
- package/umd/plugins/clipboard.umd.js.map +1 -1
- package/umd/plugins/column-virtualization.umd.js.map +1 -1
- package/umd/plugins/context-menu.umd.js.map +1 -1
- package/umd/plugins/editing.umd.js +1 -1
- package/umd/plugins/editing.umd.js.map +1 -1
- package/umd/plugins/export.umd.js +1 -1
- package/umd/plugins/export.umd.js.map +1 -1
- package/umd/plugins/filtering.umd.js +1 -1
- package/umd/plugins/filtering.umd.js.map +1 -1
- package/umd/plugins/grouping-columns.umd.js.map +1 -1
- package/umd/plugins/grouping-rows.umd.js +1 -1
- package/umd/plugins/grouping-rows.umd.js.map +1 -1
- package/umd/plugins/hierarchy.umd.js.map +1 -1
- package/umd/plugins/master-detail.umd.js +1 -1
- package/umd/plugins/master-detail.umd.js.map +1 -1
- package/umd/plugins/multi-sort.umd.js.map +1 -1
- package/umd/plugins/pinned-columns.umd.js.map +1 -1
- package/umd/plugins/pinned-rows.umd.js.map +1 -1
- package/umd/plugins/pivot.umd.js +1 -1
- package/umd/plugins/pivot.umd.js.map +1 -1
- package/umd/plugins/print.umd.js.map +1 -1
- package/umd/plugins/reorder-columns.umd.js.map +1 -1
- package/umd/plugins/responsive.umd.js.map +1 -1
- package/umd/plugins/row-drag-drop.umd.js.map +1 -1
- package/umd/plugins/selection.umd.js +1 -1
- package/umd/plugins/selection.umd.js.map +1 -1
- package/umd/plugins/server-side.umd.js.map +1 -1
- package/umd/plugins/shell.umd.js.map +1 -1
- package/umd/plugins/sticky-rows.umd.js.map +1 -1
- package/umd/plugins/tooltip.umd.js.map +1 -1
- package/umd/plugins/tree.umd.js +1 -1
- package/umd/plugins/tree.umd.js.map +1 -1
- package/umd/plugins/undo-redo.umd.js +1 -1
- package/umd/plugins/undo-redo.umd.js.map +1 -1
- package/umd/plugins/visibility.umd.js.map +1 -1
package/lib/core/types.d.ts
CHANGED
|
@@ -1003,9 +1003,12 @@ export interface BaseColumnConfig<TRow = any, TValue = any, TField extends strin
|
|
|
1003
1003
|
* - In the filter panel (set filter), checkbox labels show the formatted value
|
|
1004
1004
|
* instead of the raw value, and search matches against the formatted text.
|
|
1005
1005
|
*
|
|
1006
|
-
*
|
|
1007
|
-
*
|
|
1008
|
-
*
|
|
1006
|
+
* `row` is the row the value belongs to. The filter panel lists each distinct
|
|
1007
|
+
* value once and passes the first row containing it. Where a value has no
|
|
1008
|
+
* source row — values returned by the filtering `valuesHandler`, and Pivot
|
|
1009
|
+
* aggregates — `row` is `undefined`; if `format` then throws, the raw value is
|
|
1010
|
+
* shown and a TBW062 warning is logged. For server-fetched filter values, return
|
|
1011
|
+
* `{ value, label }` options from `valuesHandler` to supply the label instead.
|
|
1009
1012
|
*
|
|
1010
1013
|
* @example
|
|
1011
1014
|
* ```typescript
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clipboard.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/clipboard.ts"],"sourcesContent":["/**\n * Clipboard feature for @toolbox-web/grid\n *\n * Requires the selection feature to be enabled.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/selection';\n * import '@toolbox-web/grid/features/clipboard';\n *\n * grid.gridConfig = { features: { selection: 'range', clipboard: true } };\n * ```\n */\n\nimport { ClipboardPlugin, type ClipboardConfig } from '../plugins/clipboard';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable clipboard copy/paste. Requires selection. */\n clipboard?: boolean | ClipboardConfig;\n }\n}\n\nregisterFeature('clipboard', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as ClipboardConfig) ?? {});\n return new ClipboardPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"clipboard.js","names":["ClipboardPlugin","registerFeature","config"],"sources":["../../../../../libs/grid/src/lib/features/clipboard.ts"],"sourcesContent":["/**\n * Clipboard feature for @toolbox-web/grid\n *\n * Requires the selection feature to be enabled.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/selection';\n * import '@toolbox-web/grid/features/clipboard';\n *\n * grid.gridConfig = { features: { selection: 'range', clipboard: true } };\n * ```\n */\n\nimport { ClipboardPlugin, type ClipboardConfig } from '../plugins/clipboard';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable clipboard copy/paste. Requires selection. */\n clipboard?: boolean | ClipboardConfig;\n }\n}\n\nregisterFeature('clipboard', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as ClipboardConfig) ?? {});\n return new ClipboardPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"0B,kHAwBAC,EAAgB,YAAcC,GAErB,IAAIF,EADuB,kBAAXE,EAAuB,CAAC,EAAMA,GAA8B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-virtualization.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/column-virtualization.ts"],"sourcesContent":["/**\n * Column Virtualization feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/column-virtualization';\n *\n * grid.gridConfig = { features: { columnVirtualization: true } };\n * ```\n */\n\nimport {\n ColumnVirtualizationPlugin,\n type ColumnVirtualizationConfig,\n} from '../plugins/column-virtualization';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable horizontal column virtualization. */\n columnVirtualization?: boolean | ColumnVirtualizationConfig;\n }\n}\n\nregisterFeature('columnVirtualization', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as ColumnVirtualizationConfig) ?? {});\n return new ColumnVirtualizationPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"column-virtualization.js","names":["ColumnVirtualizationPlugin","registerFeature","config"],"sources":["../../../../../libs/grid/src/lib/features/column-virtualization.ts"],"sourcesContent":["/**\n * Column Virtualization feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/column-virtualization';\n *\n * grid.gridConfig = { features: { columnVirtualization: true } };\n * ```\n */\n\nimport {\n ColumnVirtualizationPlugin,\n type ColumnVirtualizationConfig,\n} from '../plugins/column-virtualization';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable horizontal column virtualization. */\n columnVirtualization?: boolean | ColumnVirtualizationConfig;\n }\n}\n\nregisterFeature('columnVirtualization', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as ColumnVirtualizationConfig) ?? {});\n return new ColumnVirtualizationPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"qC,8HAwBAC,EAAgB,uBAAyBC,GAEhC,IAAIF,EADuB,kBAAXE,EAAuB,CAAC,EAAMA,GAAyC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/context-menu.ts"],"sourcesContent":["/**\n * Context Menu feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/context-menu';\n *\n * grid.gridConfig = { features: { contextMenu: true } };\n * ```\n */\n\nimport { ContextMenuPlugin, type ContextMenuConfig } from '../plugins/context-menu';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable right-click context menu. */\n contextMenu?: boolean | ContextMenuConfig;\n }\n}\n\nregisterFeature('contextMenu', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as ContextMenuConfig) ?? {});\n return new ContextMenuPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context-menu.js","names":["ContextMenuPlugin","registerFeature","config"],"sources":["../../../../../libs/grid/src/lib/features/context-menu.ts"],"sourcesContent":["/**\n * Context Menu feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/context-menu';\n *\n * grid.gridConfig = { features: { contextMenu: true } };\n * ```\n */\n\nimport { ContextMenuPlugin, type ContextMenuConfig } from '../plugins/context-menu';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable right-click context menu. */\n contextMenu?: boolean | ContextMenuConfig;\n }\n}\n\nregisterFeature('contextMenu', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as ContextMenuConfig) ?? {});\n return new ContextMenuPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"4B,qHAqBAC,EAAgB,cAAgBC,GAEvB,IAAIF,EADuB,kBAAXE,EAAuB,CAAC,EAAMA,GAAgC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editing.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/editing.ts"],"sourcesContent":["/**\n * Editing feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/editing';\n *\n * grid.gridConfig = { features: { editing: 'dblclick' } };\n * ```\n */\n\nimport { EditingPlugin, type EditingConfig } from '../plugins/editing';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable inline cell editing. */\n editing?: boolean | 'click' | 'dblclick' | 'manual' | EditingConfig;\n }\n}\n\nregisterFeature('editing', (config) => {\n if (config === true) {\n return new EditingPlugin({ editOn: 'dblclick' });\n }\n if (config === 'click' || config === 'dblclick' || config === 'manual') {\n return new EditingPlugin({ editOn: config });\n }\n return new EditingPlugin((config as EditingConfig) ?? undefined);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"editing.js","names":["EditingPlugin","registerFeature","config","editOn"],"sources":["../../../../../libs/grid/src/lib/features/editing.ts"],"sourcesContent":["/**\n * Editing feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/editing';\n *\n * grid.gridConfig = { features: { editing: 'dblclick' } };\n * ```\n */\n\nimport { EditingPlugin, type EditingConfig } from '../plugins/editing';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable inline cell editing. */\n editing?: boolean | 'click' | 'dblclick' | 'manual' | EditingConfig;\n }\n}\n\nregisterFeature('editing', (config) => {\n if (config === true) {\n return new EditingPlugin({ editOn: 'dblclick' });\n }\n if (config === 'click' || config === 'dblclick' || config === 'manual') {\n return new EditingPlugin({ editOn: config });\n }\n return new EditingPlugin((config as EditingConfig) ?? undefined);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"wB,gHAqBAC,EAAgB,UAAYC,GAEjB,IAAIF,GADE,IAAXE,EACuB,CAAEC,OAAQ,YAEtB,UAAXD,GAAiC,aAAXA,GAAoC,WAAXA,EACxB,CAAEC,OAAQD,GAEXA,QAA4B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/export.ts"],"sourcesContent":["/**\n * Export feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/export';\n *\n * grid.gridConfig = { features: { export: true } };\n * ```\n */\n\nimport { ExportPlugin, type ExportConfig } from '../plugins/export';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable data export (CSV, Excel, etc.). */\n export?: boolean | ExportConfig;\n }\n}\n\nregisterFeature('export', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as ExportConfig) ?? {});\n return new ExportPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"export.js","names":["ExportPlugin","registerFeature","config"],"sources":["../../../../../libs/grid/src/lib/features/export.ts"],"sourcesContent":["/**\n * Export feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/export';\n *\n * grid.gridConfig = { features: { export: true } };\n * ```\n */\n\nimport { ExportPlugin, type ExportConfig } from '../plugins/export';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable data export (CSV, Excel, etc.). */\n export?: boolean | ExportConfig;\n }\n}\n\nregisterFeature('export', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as ExportConfig) ?? {});\n return new ExportPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"uB,+GAqBAC,EAAgB,SAAWC,GAElB,IAAIF,EADuB,kBAAXE,EAAuB,CAAC,EAAMA,GAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filtering.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/filtering.ts"],"sourcesContent":["/**\n * Filtering feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/filtering';\n *\n * grid.gridConfig = { features: { filtering: { debounceMs: 200 } } };\n * ```\n */\n\nimport { FilteringPlugin, type FilterConfig } from '../plugins/filtering';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig<TRow> {\n /** Enable column filtering. */\n filtering?: boolean | FilterConfig<TRow>;\n }\n}\n\nregisterFeature('filtering', (config) => {\n if (typeof config === 'boolean') return new FilteringPlugin();\n return new FilteringPlugin((config as FilterConfig) ?? undefined);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"filtering.js","names":["FilteringPlugin","registerFeature","config"],"sources":["../../../../../libs/grid/src/lib/features/filtering.ts"],"sourcesContent":["/**\n * Filtering feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/filtering';\n *\n * grid.gridConfig = { features: { filtering: { debounceMs: 200 } } };\n * ```\n */\n\nimport { FilteringPlugin, type FilterConfig } from '../plugins/filtering';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig<TRow> {\n /** Enable column filtering. */\n filtering?: boolean | FilterConfig<TRow>;\n }\n}\n\nregisterFeature('filtering', (config) => {\n if (typeof config === 'boolean') return new FilteringPlugin();\n return new FilteringPlugin((config as FilterConfig) ?? undefined);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"0B,kHAqBAC,EAAgB,YAAcC,GACN,kBAAXA,EAA6B,IAAIF,EACrC,IAAIA,EAAiBE,QAA2B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grouping-columns.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/grouping-columns.ts"],"sourcesContent":["/**\n * Column Grouping feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/grouping-columns';\n *\n * grid.gridConfig = { features: { groupingColumns: true } };\n * ```\n */\n\nimport { GroupingColumnsPlugin, type GroupingColumnsConfig } from '../plugins/grouping-columns';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable column grouping headers. */\n groupingColumns?: boolean | GroupingColumnsConfig;\n }\n}\n\nregisterFeature('groupingColumns', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as GroupingColumnsConfig) ?? {});\n return new GroupingColumnsPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"grouping-columns.js","names":["GroupingColumnsPlugin","registerFeature","config"],"sources":["../../../../../libs/grid/src/lib/features/grouping-columns.ts"],"sourcesContent":["/**\n * Column Grouping feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/grouping-columns';\n *\n * grid.gridConfig = { features: { groupingColumns: true } };\n * ```\n */\n\nimport { GroupingColumnsPlugin, type GroupingColumnsConfig } from '../plugins/grouping-columns';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable column grouping headers. */\n groupingColumns?: boolean | GroupingColumnsConfig;\n }\n}\n\nregisterFeature('groupingColumns', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as GroupingColumnsConfig) ?? {});\n return new GroupingColumnsPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"gC,yHAqBAC,EAAgB,kBAAoBC,GAE3B,IAAIF,EADuB,kBAAXE,EAAuB,CAAC,EAAMA,GAAoC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grouping-rows.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/grouping-rows.ts"],"sourcesContent":["/**\n * Row Grouping feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/grouping-rows';\n *\n * grid.gridConfig = { features: { groupingRows: { groupBy: ['department'] } } };\n * ```\n */\n\nimport { GroupingRowsPlugin, type GroupingRowsConfig } from '../plugins/grouping-rows';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable row grouping with expand/collapse. */\n groupingRows?: GroupingRowsConfig;\n }\n}\n\nregisterFeature('groupingRows', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as GroupingRowsConfig) ?? {});\n return new GroupingRowsPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"grouping-rows.js","names":["GroupingRowsPlugin","registerFeature","config"],"sources":["../../../../../libs/grid/src/lib/features/grouping-rows.ts"],"sourcesContent":["/**\n * Row Grouping feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/grouping-rows';\n *\n * grid.gridConfig = { features: { groupingRows: { groupBy: ['department'] } } };\n * ```\n */\n\nimport { GroupingRowsPlugin, type GroupingRowsConfig } from '../plugins/grouping-rows';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable row grouping with expand/collapse. */\n groupingRows?: GroupingRowsConfig;\n }\n}\n\nregisterFeature('groupingRows', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as GroupingRowsConfig) ?? {});\n return new GroupingRowsPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"6B,sHAqBAC,EAAgB,eAAiBC,GAExB,IAAIF,EADuB,kBAAXE,EAAuB,CAAC,EAAMA,GAAiC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"master-detail.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/master-detail.ts"],"sourcesContent":["/**\n * Master-Detail feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/master-detail';\n *\n * grid.gridConfig = { features: { masterDetail: { detailRenderer: (row) => `<div>...</div>` } } };\n * ```\n */\n\nimport { MasterDetailPlugin, type MasterDetailConfig } from '../plugins/master-detail';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable master-detail rows with expandable detail panels. */\n masterDetail?: MasterDetailConfig;\n }\n}\n\nregisterFeature('masterDetail', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as MasterDetailConfig) ?? {});\n return new MasterDetailPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"master-detail.js","names":["MasterDetailPlugin","registerFeature","config"],"sources":["../../../../../libs/grid/src/lib/features/master-detail.ts"],"sourcesContent":["/**\n * Master-Detail feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/master-detail';\n *\n * grid.gridConfig = { features: { masterDetail: { detailRenderer: (row) => `<div>...</div>` } } };\n * ```\n */\n\nimport { MasterDetailPlugin, type MasterDetailConfig } from '../plugins/master-detail';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable master-detail rows with expandable detail panels. */\n masterDetail?: MasterDetailConfig;\n }\n}\n\nregisterFeature('masterDetail', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as MasterDetailConfig) ?? {});\n return new MasterDetailPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"6B,sHAqBAC,EAAgB,eAAiBC,GAExB,IAAIF,EADuB,kBAAXE,EAAuB,CAAC,EAAMA,GAAiC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-sort.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/multi-sort.ts"],"sourcesContent":["/**\n * Multi-sort feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/multi-sort';\n *\n * grid.gridConfig = { features: { multiSort: true } };\n * ```\n */\n\nimport { MultiSortPlugin, type MultiSortConfig } from '../plugins/multi-sort';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable multi-column sorting. */\n multiSort?: boolean | 'single' | 'multi' | MultiSortConfig;\n }\n}\n\nregisterFeature('multiSort', (config) => {\n if (config === true || config === 'multi') {\n return new MultiSortPlugin();\n }\n if (config === 'single') {\n return new MultiSortPlugin({ maxSortColumns: 1 });\n }\n return new MultiSortPlugin(config as MultiSortConfig);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"multi-sort.js","names":["MultiSortPlugin","registerFeature","config","maxSortColumns"],"sources":["../../../../../libs/grid/src/lib/features/multi-sort.ts"],"sourcesContent":["/**\n * Multi-sort feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/multi-sort';\n *\n * grid.gridConfig = { features: { multiSort: true } };\n * ```\n */\n\nimport { MultiSortPlugin, type MultiSortConfig } from '../plugins/multi-sort';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable multi-column sorting. */\n multiSort?: boolean | 'single' | 'multi' | MultiSortConfig;\n }\n}\n\nregisterFeature('multiSort', (config) => {\n if (config === true || config === 'multi') {\n return new MultiSortPlugin();\n }\n if (config === 'single') {\n return new MultiSortPlugin({ maxSortColumns: 1 });\n }\n return new MultiSortPlugin(config as MultiSortConfig);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"0B,mHAqBAC,EAAgB,YAAcC,IACb,IAAXA,GAA8B,UAAXA,EACd,IAAIF,EAGJ,IAAIA,EADE,WAAXE,EACyB,CAAEC,eAAgB,GAEpBD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pinned-columns.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/pinned-columns.ts"],"sourcesContent":["/**\n * Pinned Columns feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/pinned-columns';\n *\n * grid.gridConfig = { features: { pinnedColumns: true } };\n * ```\n */\n\nimport { PinnedColumnsPlugin } from '../plugins/pinned-columns';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable column pinning (left/right). */\n pinnedColumns?: boolean;\n }\n}\n\nregisterFeature('pinnedColumns', (_config) => {\n return new PinnedColumnsPlugin();\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"pinned-columns.js","names":["PinnedColumnsPlugin","registerFeature","_config"],"sources":["../../../../../libs/grid/src/lib/features/pinned-columns.ts"],"sourcesContent":["/**\n * Pinned Columns feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/pinned-columns';\n *\n * grid.gridConfig = { features: { pinnedColumns: true } };\n * ```\n */\n\nimport { PinnedColumnsPlugin } from '../plugins/pinned-columns';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable column pinning (left/right). */\n pinnedColumns?: boolean;\n }\n}\n\nregisterFeature('pinnedColumns', (_config) => {\n return new PinnedColumnsPlugin();\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"8B,uHAqBAC,EAAgB,gBAAkBC,GACzB,IAAIF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pinned-rows.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/pinned-rows.ts"],"sourcesContent":["/**\n * Pinned Rows feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/pinned-rows';\n *\n * grid.gridConfig = { features: { pinnedRows: true } };\n * ```\n */\n\nimport { PinnedRowsPlugin, type PinnedRowsConfig } from '../plugins/pinned-rows';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable pinned (frozen) rows at top/bottom of the grid. */\n pinnedRows?: boolean | PinnedRowsConfig;\n }\n}\n\nregisterFeature('pinnedRows', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as PinnedRowsConfig) ?? {});\n return new PinnedRowsPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"pinned-rows.js","names":["PinnedRowsPlugin","registerFeature","config"],"sources":["../../../../../libs/grid/src/lib/features/pinned-rows.ts"],"sourcesContent":["/**\n * Pinned Rows feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/pinned-rows';\n *\n * grid.gridConfig = { features: { pinnedRows: true } };\n * ```\n */\n\nimport { PinnedRowsPlugin, type PinnedRowsConfig } from '../plugins/pinned-rows';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable pinned (frozen) rows at top/bottom of the grid. */\n pinnedRows?: boolean | PinnedRowsConfig;\n }\n}\n\nregisterFeature('pinnedRows', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as PinnedRowsConfig) ?? {});\n return new PinnedRowsPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"2B,oHAqBAC,EAAgB,aAAeC,GAEtB,IAAIF,EADuB,kBAAXE,EAAuB,CAAC,EAAMA,GAA+B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pivot.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/pivot.ts"],"sourcesContent":["/**\n * Pivot feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/pivot';\n *\n * grid.gridConfig = { features: { pivot: { rowFields: ['region'], colFields: ['year'] } } };\n * ```\n */\n\nimport { PivotPlugin, type PivotConfig } from '../plugins/pivot';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable pivot table mode. */\n pivot?: PivotConfig;\n }\n}\n\nregisterFeature('pivot', (config) => {\n return new PivotPlugin((config as PivotConfig) ?? undefined);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"pivot.js","names":["PivotPlugin","registerFeature","config"],"sources":["../../../../../libs/grid/src/lib/features/pivot.ts"],"sourcesContent":["/**\n * Pivot feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/pivot';\n *\n * grid.gridConfig = { features: { pivot: { rowFields: ['region'], colFields: ['year'] } } };\n * ```\n */\n\nimport { PivotPlugin, type PivotConfig } from '../plugins/pivot';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable pivot table mode. */\n pivot?: PivotConfig;\n }\n}\n\nregisterFeature('pivot', (config) => {\n return new PivotPlugin((config as PivotConfig) ?? undefined);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"sB,8GAqBAC,EAAgB,QAAUC,GACjB,IAAIF,EAAaE,QAA0B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"print.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/print.ts"],"sourcesContent":["/**\n * Print feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/print';\n *\n * grid.gridConfig = { features: { print: true } };\n * ```\n */\n\nimport { PrintPlugin, type PrintConfig } from '../plugins/print';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable print support with configurable layout. */\n print?: boolean | PrintConfig;\n }\n}\n\nregisterFeature('print', (config) => {\n if (config === true) return new PrintPlugin();\n return new PrintPlugin((config as PrintConfig) ?? undefined);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"print.js","names":["PrintPlugin","registerFeature","config"],"sources":["../../../../../libs/grid/src/lib/features/print.ts"],"sourcesContent":["/**\n * Print feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/print';\n *\n * grid.gridConfig = { features: { print: true } };\n * ```\n */\n\nimport { PrintPlugin, type PrintConfig } from '../plugins/print';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable print support with configurable layout. */\n print?: boolean | PrintConfig;\n }\n}\n\nregisterFeature('print', (config) => {\n if (config === true) return new PrintPlugin();\n return new PrintPlugin((config as PrintConfig) ?? undefined);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"sB,8GAqBAC,EAAgB,QAAUC,IACT,IAAXA,EAAwB,IAAIF,EACzB,IAAIA,EAAaE,QAA0B"}
|
package/lib/features/registry.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{setFeatureResolver as o}from"@toolbox-web/grid";function e(o,e,t,n){console.warn(function(o,e,t,n){return`${function(o,e){return`[tbw-grid${o?`#${o}`:""}${e?`:${e}`:""}]`}(t,n)} ${o}: ${e}\n\n → More info: ${function(o){return`https://toolboxjs.com/grid/errors#${o.toLowerCase()}`}(o)}`}(o,e,t,n))}var t="3.
|
|
1
|
+
import{setFeatureResolver as o}from"@toolbox-web/grid";function e(o,e,t,n){console.warn(function(o,e,t,n){return`${function(o,e){return`[tbw-grid${o?`#${o}`:""}${e?`:${e}`:""}]`}(t,n)} ${o}: ${e}\n\n → More info: ${function(o){return`https://toolboxjs.com/grid/errors#${o.toLowerCase()}`}(o)}`}(o,e,t,n))}var t="3.10.1",n=Symbol.for(`@toolbox-web/grid:feature-registry@${t}/v1`),r=Symbol.for(`@toolbox-web/grid:feature-registry-warned@${t}/v1`);function i(o,e){let t=Reflect.get(globalThis,o);return void 0===t&&(t=e(),Reflect.set(globalThis,o,t)),t}var s=i(n,()=>/* @__PURE__ */new Map),c=i(r,()=>/* @__PURE__ */new Set),f=()=>"undefined"!=typeof window&&("localhost"===window.location?.hostname||"127.0.0.1"===window.location?.hostname);function a(o,t,n){f()&&s.has(o)&&!n?.override&&e("TBW030",`Feature "${o}" was re-registered. Previous registration overwritten.`),s.set(o,{factory:t,name:o})}function u(o){return s.has(o)}function d(o){return s.get(o)?.factory}function l(){return Array.from(s.keys())}var w={undoRedo:["editing"],clipboard:["selection"]};function g(o,t){const n=s.get(o);if(n)return n.factory(t);if(f()&&!c.has(o)){c.add(o);const t=o.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();e("TBW031",`Feature "${o}" is configured but not registered.\nAdd this import to enable it:\n\n import '@toolbox-web/grid/features/${t}';\n`)}}function b(o){const t=[];for(const[e,r]of Object.entries(o))void 0!==r&&!1!==r&&t.push(e);!function(o){const t=new Set(o);for(const n of o){const o=w[n];if(o)for(const r of o)t.has(r)||f()&&e("TBW032",`Feature "${n}" requires "${r}" to be enabled. Add "${r}" to your features configuration.`)}}(t);const n=[];for(const e of t){const t=g(e,o[e]);t&&n.push(t)}return function(o){if(o.length<2)return o;const e=/* @__PURE__ */new Map;for(const s of o)e.set(s.name,s);const t=[],n=/* @__PURE__ */new Set,r=/* @__PURE__ */new Set,i=o=>{if(n.has(o)||r.has(o))return;r.add(o);const s=o.constructor.dependencies??[];for(const t of s){const o=e.get(t.name);o&&i(o)}r.delete(o),n.add(o),t.push(o)};for(const s of o)i(s);return t}(n)}function $(){s.clear(),c.clear()}o(b);export{$ as clearFeatureRegistry,g as createPluginFromFeature,b as createPluginsFromFeatures,d as getFeatureFactory,l as getRegisteredFeatures,u as isFeatureRegistered,a as registerFeature};
|
|
2
2
|
//# sourceMappingURL=registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","names":[],"sources":["../../../../../libs/grid/src/lib/core/internal/diagnostics.ts","../../../../../libs/grid/src/lib/features/registry.ts"],"sourcesContent":["/**\n * Centralized diagnostic messages for @toolbox-web/grid.\n *\n * Every user-facing warning, error, or info message in the grid has a unique\n * diagnostic code (e.g. `TBW001`). Each code maps to a section on the online\n * troubleshooting page, giving developers a direct link to resolution steps.\n *\n * ## Usage\n *\n * ```ts\n * import { MISSING_BREAKPOINT, warnDiagnostic, throwDiagnostic } from './diagnostics';\n *\n * // Warn with a code\n * warnDiagnostic(MISSING_BREAKPOINT, 'Set a breakpoint...', gridId);\n *\n * // Throw with a code\n * throwDiagnostic(MISSING_ROW_ID, 'Configure getRowId...', gridId);\n * ```\n *\n * Plugins should prefer `this.warn(MISSING_BREAKPOINT, message)` via BaseGridPlugin\n * instead of importing this module directly.\n *\n * @internal\n */\n\n// #region Grid Prefix\n\n/**\n * Build the `[tbw-grid]` or `[tbw-grid#my-id]` log prefix.\n * Pass `pluginName` for a scoped prefix like `[tbw-grid:SelectionPlugin]`.\n */\nexport function gridPrefix(gridId?: string, pluginName?: string): string {\n const id = gridId ? `#${gridId}` : '';\n const plugin = pluginName ? `:${pluginName}` : '';\n return `[tbw-grid${id}${plugin}]`;\n}\n\n// #endregion\n\n// #region Diagnostic Codes\n\n/**\n * Diagnostic codes used across the grid library.\n *\n * Each code is an individual export so that unused codes are tree-shaken\n * from bundles that don't reference them (esbuild can't tree-shake\n * properties from a single object).\n *\n * Naming: TBW + 3-digit number.\n * Ranges:\n * 001–019 Configuration validation (missing plugins, bad config)\n * 020–029 Plugin lifecycle (dependencies, incompatibilities, alias collapse)\n * 030–039 Feature registry\n * 040–049 Row operations (row ID, row mutations)\n * 050–059 Column operations (width, template)\n * 060–069 Rendering (callbacks, formatters, external views)\n * 070–079 Shell (tool panels, header/toolbar content)\n * 080–089 Editing & editors\n * 090–099 Print\n * 100–109 Clipboard\n * 110–119 Plugin-specific (responsive, undo-redo, grouping-columns)\n * 120–129 Style injection\n * 130–139 Attribute parsing\n * 140–149 DataSource / ServerSide\n */\n\n// --- Config validation (001–019) ---\n/** Column uses a plugin-owned property but the plugin is not loaded. */\nexport const MISSING_PLUGIN = 'TBW001' as const;\n/** Grid config uses a plugin-owned property but the plugin is not loaded. */\nexport const MISSING_PLUGIN_CONFIG = 'TBW002' as const;\n/** Plugin config rule violation (error severity). */\nexport const CONFIG_RULE_ERROR = 'TBW003' as const;\n/** Plugin config rule violation (warning severity). */\nexport const CONFIG_RULE_WARN = 'TBW004' as const;\n\n// --- Plugin lifecycle (020–029) ---\n/** Required plugin dependency is missing. */\nexport const MISSING_DEPENDENCY = 'TBW020' as const;\n/** Optional plugin dependency is missing. */\nexport const OPTIONAL_DEPENDENCY = 'TBW021' as const;\n/** Two loaded plugins are incompatible. */\nexport const INCOMPATIBLE_PLUGINS = 'TBW022' as const;\n/** Two plugin instances resolve to the same canonical name (alias collapse). */\nexport const PLUGIN_ALIAS_COLLAPSE = 'TBW023' as const;\n/** Error thrown inside a plugin event handler. */\nexport const PLUGIN_EVENT_ERROR = 'TBW024' as const;\n/** Conflicting config values found while merging alias-collapsed plugin instances. */\nexport const PLUGIN_ALIAS_CONFIG_CONFLICT = 'TBW025' as const;\n\n// --- Feature registry (030–039) ---\n/** Feature was re-registered (overwritten). */\nexport const FEATURE_REREGISTERED = 'TBW030' as const;\n/** Feature configured but not imported. */\nexport const FEATURE_NOT_IMPORTED = 'TBW031' as const;\n/** Feature depends on another feature that is not enabled. */\nexport const FEATURE_MISSING_DEP = 'TBW032' as const;\n\n// --- Row operations (040–049) ---\n/** Cannot determine row ID (no getRowId and no id property). */\nexport const MISSING_ROW_ID = 'TBW040' as const;\n/** Row with given ID not found. */\nexport const ROW_NOT_FOUND = 'TBW041' as const;\n\n// --- Column operations (050–059) ---\n/** Column has an invalid CSS width value. */\nexport const INVALID_COLUMN_WIDTH = 'TBW050' as const;\n\n// --- Rendering callbacks (060–069) ---\n/** rowClass callback threw an error. */\nexport const ROW_CLASS_ERROR = 'TBW060' as const;\n/** cellClass callback threw an error. */\nexport const CELL_CLASS_ERROR = 'TBW061' as const;\n/** Column format function threw an error. */\nexport const FORMAT_ERROR = 'TBW062' as const;\n/** External view mount() threw an error. */\nexport const VIEW_MOUNT_ERROR = 'TBW063' as const;\n/** External view event dispatch error. */\nexport const VIEW_DISPATCH_ERROR = 'TBW064' as const;\n\n// --- Shell (070–079) ---\n/** Tool panel missing required id. */\nexport const TOOL_PANEL_MISSING_ATTR = 'TBW070' as const;\n/** No tool panels registered. */\nexport const NO_TOOL_PANELS = 'TBW071' as const;\n/** Tool panel section not found. */\nexport const TOOL_PANEL_NOT_FOUND = 'TBW072' as const;\n/** Tool panel already registered. */\nexport const TOOL_PANEL_DUPLICATE = 'TBW073' as const;\n/** Header content already registered. */\nexport const HEADER_CONTENT_DUPLICATE = 'TBW074' as const;\n/** Toolbar content already registered. */\nexport const TOOLBAR_CONTENT_DUPLICATE = 'TBW075' as const;\n\n// --- Editing & editors (080–089) ---\n/** External editor mount() threw an error. */\nexport const EDITOR_MOUNT_ERROR = 'TBW080' as const;\n\n// --- Print (090–099) ---\n/** Print already in progress. */\nexport const PRINT_IN_PROGRESS = 'TBW090' as const;\n/** Grid not available for printing. */\nexport const PRINT_NO_GRID = 'TBW091' as const;\n/** Print operation failed. */\nexport const PRINT_FAILED = 'TBW092' as const;\n/** Multiple elements share the same grid ID (print isolation issue). */\nexport const PRINT_DUPLICATE_ID = 'TBW093' as const;\n\n// --- Clipboard (100–109) ---\n/** Clipboard API write failed. */\nexport const CLIPBOARD_FAILED = 'TBW100' as const;\n\n// --- Plugin-specific (110–119) ---\n/** ResponsivePlugin: no breakpoint configured. */\nexport const MISSING_BREAKPOINT = 'TBW110' as const;\n/** UndoRedoPlugin: transaction already in progress. */\nexport const TRANSACTION_IN_PROGRESS = 'TBW111' as const;\n/** UndoRedoPlugin: no transaction in progress. */\nexport const NO_TRANSACTION = 'TBW112' as const;\n/** GroupingColumnsPlugin: missing id or header on column group definition. */\nexport const COLUMN_GROUP_NO_ID = 'TBW113' as const;\n/** GroupingColumnsPlugin: conflicting columnGroups sources. */\nexport const COLUMN_GROUPS_CONFLICT = 'TBW114' as const;\n\n// --- Style injection (120–129) ---\n/** Failed to extract grid.css from document stylesheets. */\nexport const STYLE_EXTRACT_FAILED = 'TBW120' as const;\n/** Could not find grid.css in document.styleSheets. */\nexport const STYLE_NOT_FOUND = 'TBW121' as const;\n\n// --- Attribute parsing (130–139) ---\n/** Invalid JSON in an HTML attribute. */\nexport const INVALID_ATTRIBUTE_JSON = 'TBW130' as const;\n\n// --- DataSource / ServerSide (140–149) ---\n/** ServerSidePlugin: getRows() rejected. */\nexport const DATASOURCE_FETCH_ERROR = 'TBW140' as const;\n/** ServerSidePlugin: getChildRows() rejected. */\nexport const DATASOURCE_CHILD_FETCH_ERROR = 'TBW141' as const;\n/** ServerSidePlugin: getChildRows() not implemented but a plugin queried for children. */\nexport const DATASOURCE_NO_CHILD_HANDLER = 'TBW142' as const;\n/** ServerSidePlugin: concurrent request limit reached, request deferred. */\nexport const DATASOURCE_THROTTLED = 'TBW143' as const;\n\nexport type DiagnosticCode =\n | typeof MISSING_PLUGIN\n | typeof MISSING_PLUGIN_CONFIG\n | typeof CONFIG_RULE_ERROR\n | typeof CONFIG_RULE_WARN\n | typeof MISSING_DEPENDENCY\n | typeof OPTIONAL_DEPENDENCY\n | typeof INCOMPATIBLE_PLUGINS\n | typeof PLUGIN_ALIAS_COLLAPSE\n | typeof PLUGIN_EVENT_ERROR\n | typeof PLUGIN_ALIAS_CONFIG_CONFLICT\n | typeof FEATURE_REREGISTERED\n | typeof FEATURE_NOT_IMPORTED\n | typeof FEATURE_MISSING_DEP\n | typeof MISSING_ROW_ID\n | typeof ROW_NOT_FOUND\n | typeof INVALID_COLUMN_WIDTH\n | typeof ROW_CLASS_ERROR\n | typeof CELL_CLASS_ERROR\n | typeof FORMAT_ERROR\n | typeof VIEW_MOUNT_ERROR\n | typeof VIEW_DISPATCH_ERROR\n | typeof TOOL_PANEL_MISSING_ATTR\n | typeof NO_TOOL_PANELS\n | typeof TOOL_PANEL_NOT_FOUND\n | typeof TOOL_PANEL_DUPLICATE\n | typeof HEADER_CONTENT_DUPLICATE\n | typeof TOOLBAR_CONTENT_DUPLICATE\n | typeof EDITOR_MOUNT_ERROR\n | typeof PRINT_IN_PROGRESS\n | typeof PRINT_NO_GRID\n | typeof PRINT_FAILED\n | typeof PRINT_DUPLICATE_ID\n | typeof CLIPBOARD_FAILED\n | typeof MISSING_BREAKPOINT\n | typeof TRANSACTION_IN_PROGRESS\n | typeof NO_TRANSACTION\n | typeof COLUMN_GROUP_NO_ID\n | typeof COLUMN_GROUPS_CONFLICT\n | typeof STYLE_EXTRACT_FAILED\n | typeof STYLE_NOT_FOUND\n | typeof INVALID_ATTRIBUTE_JSON\n | typeof DATASOURCE_FETCH_ERROR\n | typeof DATASOURCE_CHILD_FETCH_ERROR\n | typeof DATASOURCE_NO_CHILD_HANDLER\n | typeof DATASOURCE_THROTTLED;\n\n// #endregion\n\n// #region Docs URL\n\nconst DOCS_BASE = 'https://toolboxjs.com/grid/errors';\n\n/** Build a direct link to the troubleshooting section for a code. */\nfunction docsUrl(code: DiagnosticCode): string {\n return `${DOCS_BASE}#${code.toLowerCase()}`;\n}\n\n// #endregion\n\n// #region Formatting\n\n/**\n * Format a diagnostic message with prefix, code, and docs link.\n *\n * Output format:\n * ```\n * [tbw-grid#my-id] TBW001: Your message here.\n *\n * → More info: https://toolboxjs.com/grid/errors#tbw001\n * ```\n */\nexport function formatDiagnostic(code: DiagnosticCode, message: string, gridId?: string, pluginName?: string): string {\n const prefix = gridPrefix(gridId, pluginName);\n return `${prefix} ${code}: ${message}\\n\\n → More info: ${docsUrl(code)}`;\n}\n\n// #endregion\n\n// #region Public API\n\n/**\n * Throw an error with a diagnostic code and docs link.\n * Use for configuration errors and API misuse that should halt execution.\n */\nexport function throwDiagnostic(code: DiagnosticCode, message: string, gridId?: string, pluginName?: string): never {\n throw new Error(formatDiagnostic(code, message, gridId, pluginName));\n}\n\n/**\n * Log a warning with a diagnostic code and docs link.\n * Use for recoverable issues the developer should fix.\n */\nexport function warnDiagnostic(code: DiagnosticCode, message: string, gridId?: string, pluginName?: string): void {\n console.warn(formatDiagnostic(code, message, gridId, pluginName));\n}\n\n/**\n * Log a debug message with a diagnostic code and docs link.\n * Use for optional/soft dependency notifications — visible only when\n * the browser DevTools \"Verbose\" log level is enabled.\n */\nexport function debugDiagnostic(code: DiagnosticCode, message: string, gridId?: string, pluginName?: string): void {\n console.debug(formatDiagnostic(code, message, gridId, pluginName));\n}\n\n/**\n * Log an error with a diagnostic code and docs link.\n * Use for non-throwing errors (e.g., failed async operations).\n */\nexport function errorDiagnostic(code: DiagnosticCode, message: string, gridId?: string, pluginName?: string): void {\n console.error(formatDiagnostic(code, message, gridId, pluginName));\n}\n\n// #endregion\n","/**\n * Core Feature Registry for @toolbox-web/grid\n *\n * This module provides a framework-agnostic registry for plugin factories.\n * Features are registered via side-effect imports, enabling tree-shaking\n * while maintaining a clean declarative API.\n *\n * @example\n * ```typescript\n * // Import features you need (side-effect imports)\n * import '@toolbox-web/grid/features/selection';\n * import '@toolbox-web/grid/features/filtering';\n *\n * // Configure grid declaratively\n * grid.gridConfig = {\n * features: {\n * selection: 'range',\n * filtering: { debounceMs: 200 },\n * },\n * };\n * ```\n *\n * @packageDocumentation\n * @module Features\n */\n\nimport {\n FEATURE_MISSING_DEP,\n FEATURE_NOT_IMPORTED,\n FEATURE_REREGISTERED,\n warnDiagnostic,\n} from '../core/internal/diagnostics';\nimport { setFeatureResolver } from '../core/internal/feature-hook';\nimport type { PluginDependency } from '../core/plugin/base-plugin';\nimport type { FeatureConfig, GridPlugin } from '../core/types';\n\n// #region Types\n\n/** Feature name — keys of the augmented FeatureConfig interface. */\nexport type FeatureName = keyof FeatureConfig;\n\n/** Factory function that creates a plugin from a feature config value. */\nexport type PluginFactory<TConfig = unknown> = (config: TConfig) => GridPlugin;\n\ninterface RegistryEntry {\n factory: PluginFactory;\n name: string;\n}\n\n// #endregion\n\n// #region Registry State\n\n/*\n * Cross-bundle singleton (version-scoped).\n *\n * The custom-elements registry is realm-global, but `import` graphs are not:\n * when two micro-frontend widgets on the same page bundle their own copy of\n * `@toolbox-web/grid`, each copy gets its own `featureRegistry` Map. The\n * `<tbw-grid>` class is realm-global (see `registerDataGrid()` in\n * `core/grid.ts`), so the *running* class resolves features via the resolver\n * its own bundle wired up — which closes over the *local* Map. Side-effect\n * imports from any other bundle (`import '@toolbox-web/grid/features/tree'`)\n * land in a different Map that the running class never reads, producing\n * spurious TBW031 \"feature not registered\" warnings.\n *\n * Fix: persist the Map on `globalThis` under a `Symbol.for(...)` key so every\n * loaded copy of this module reads and writes the same instance.\n *\n * The key embeds `__GRID_VERSION__` so **only same-version** bundles share a\n * registry. `registerDataGrid()` already isolates differently-versioned grid\n * classes by registering them under suffixed tag names — the version is\n * sanitized to ASCII letters/digits/dashes, so `2.14.0` becomes the tag\n * `tbw-grid-v2-14-0` (issue #339). The feature registry must mirror that\n * isolation, otherwise the last-loaded bundle's plugin factories would\n * overwrite earlier versions' entries and the running grid would attach\n * plugin instances built against a different internal contract. The trailing\n * `/v1` is a schema version for the slot shape — bump if the stored value's\n * shape changes incompatibly.\n *\n * Issue: planning #9 (two Roma widgets each bundling their own grid copy).\n */\ndeclare const __GRID_VERSION__: string;\nconst GRID_VERSION = typeof __GRID_VERSION__ !== 'undefined' ? __GRID_VERSION__ : 'dev';\nconst REGISTRY_KEY = Symbol.for(`@toolbox-web/grid:feature-registry@${GRID_VERSION}/v1`);\nconst WARNED_KEY = Symbol.for(`@toolbox-web/grid:feature-registry-warned@${GRID_VERSION}/v1`);\n\nfunction getOrCreateGlobal<T>(key: symbol, make: () => T): T {\n let value = Reflect.get(globalThis, key) as T | undefined;\n if (value === undefined) {\n value = make();\n Reflect.set(globalThis, key, value);\n }\n return value;\n}\n\nconst featureRegistry = getOrCreateGlobal(REGISTRY_KEY, () => new Map<string, RegistryEntry>());\nconst warnedFeatures = getOrCreateGlobal(WARNED_KEY, () => new Set<string>());\n\n// #endregion\n\n// #region Registration API\n\n/** Runtime dev-mode check (localhost or 127.0.0.1). */\nconst isDev = (): boolean =>\n typeof window !== 'undefined' &&\n (window.location?.hostname === 'localhost' || window.location?.hostname === '127.0.0.1');\n\n/** Optional flags passed to {@link registerFeature}. */\nexport interface RegisterFeatureOptions {\n /**\n * Set to `true` when the registration is intentionally overwriting an\n * existing entry (e.g. a framework adapter wrapping the vanilla factory\n * with reactive bridging). Suppresses the TBW030 dev-mode warning.\n */\n override?: boolean;\n}\n\n/**\n * Register a feature's plugin factory.\n * Called by side-effect feature imports (e.g., `import '@toolbox-web/grid/features/selection'`).\n *\n * @param name - The feature name (matches a key on FeatureConfig)\n * @param factory - Function that creates a plugin instance from config\n * @param options - Pass `{ override: true }` for intentional re-registration\n * (framework adapters bridging the vanilla factory) to suppress TBW030.\n */\nexport function registerFeature<K extends FeatureName>(\n name: K,\n factory: PluginFactory<FeatureConfig[K]>,\n options?: RegisterFeatureOptions,\n): void;\nexport function registerFeature(name: string, factory: PluginFactory, options?: RegisterFeatureOptions): void;\nexport function registerFeature(name: string, factory: PluginFactory, options?: RegisterFeatureOptions): void {\n if (isDev() && featureRegistry.has(name) && !options?.override) {\n warnDiagnostic(FEATURE_REREGISTERED, `Feature \"${name}\" was re-registered. Previous registration overwritten.`);\n }\n featureRegistry.set(name, { factory, name });\n}\n\n/**\n * Check if a feature has been registered.\n */\nexport function isFeatureRegistered(name: string): boolean {\n return featureRegistry.has(name);\n}\n\n/**\n * Get a registered feature's factory. Returns undefined if not registered.\n */\nexport function getFeatureFactory(name: string): PluginFactory | undefined {\n return featureRegistry.get(name)?.factory;\n}\n\n/**\n * Get all registered feature names.\n */\nexport function getRegisteredFeatures(): string[] {\n return Array.from(featureRegistry.keys());\n}\n\n// #endregion\n\n// #region Plugin Creation\n\n/**\n * Plugin dependency declarations.\n * Some plugins require others to be loaded first.\n */\nconst PLUGIN_DEPENDENCIES: Record<string, string[]> = {\n undoRedo: ['editing'],\n clipboard: ['selection'],\n};\n\n/**\n * Create a plugin instance for a single feature.\n * Shows a warning if the feature is not registered.\n */\nexport function createPluginFromFeature(name: string, config: unknown): GridPlugin | undefined {\n const entry = featureRegistry.get(name);\n\n if (!entry) {\n if (isDev() && !warnedFeatures.has(name)) {\n warnedFeatures.add(name);\n const kebab = name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n warnDiagnostic(\n FEATURE_NOT_IMPORTED,\n `Feature \"${name}\" is configured but not registered.\\n` +\n `Add this import to enable it:\\n\\n` +\n ` import '@toolbox-web/grid/features/${kebab}';\\n`,\n );\n }\n return undefined;\n }\n\n return entry.factory(config);\n}\n\n/**\n * Validate feature dependencies and log warnings for missing ones.\n */\nfunction validateDependencies(featureNames: string[]): void {\n const featureSet = new Set(featureNames);\n\n for (const feature of featureNames) {\n const deps = PLUGIN_DEPENDENCIES[feature];\n if (!deps) continue;\n\n for (const dep of deps) {\n if (!featureSet.has(dep)) {\n if (isDev()) {\n warnDiagnostic(\n FEATURE_MISSING_DEP,\n `Feature \"${feature}\" requires \"${dep}\" to be enabled. ` + `Add \"${dep}\" to your features configuration.`,\n );\n }\n }\n }\n }\n}\n\n/**\n * Create plugin instances from a features configuration object.\n *\n * Handles:\n * - Dependency validation (clipboard needs selection)\n * - Dependency ordering, derived programmatically from each plugin's declared\n * `static dependencies` (selection before clipboard, shell before visibility)\n * - Skipping false/undefined values\n *\n * @param features - Partial FeatureConfig object\n * @returns Array of plugin instances ready for gridConfig.plugins\n */\nexport function createPluginsFromFeatures(features: Record<string, unknown>): GridPlugin[] {\n const enabledFeatures: string[] = [];\n\n // Collect enabled feature names\n for (const [key, value] of Object.entries(features)) {\n if (value === undefined || value === false) continue;\n enabledFeatures.push(key);\n }\n\n // Validate dependencies (dev-only warnings for missing feature deps)\n validateDependencies(enabledFeatures);\n\n // Instantiate each enabled feature's plugin in declared (config) order...\n const plugins: GridPlugin[] = [];\n for (const featureName of enabledFeatures) {\n const plugin = createPluginFromFeature(featureName, features[featureName]);\n if (plugin) plugins.push(plugin);\n }\n\n // ...then reorder so every plugin's declared `static dependencies` attach\n // before it (see orderPluginsByDependencies).\n return orderPluginsByDependencies(plugins);\n}\n\n/**\n * Topologically order plugin instances so each plugin's declared\n * `static dependencies` precede it. The dependency list is read straight off\n * the plugin constructor — the SAME metadata `validatePluginDependencies`\n * consumes at attach time — so the resolved order satisfies the dependency\n * validator regardless of `features` key order, and third-party plugins that\n * declare their own `static dependencies` are sequenced correctly with no\n * hardcoded table.\n *\n * Independent plugins keep their original (config) order. Edges pointing at\n * plugins that aren't enabled are ignored (a missing required dependency is\n * reported separately by the validator at attach time). Cycles are broken\n * gracefully — the partial order is preserved rather than looping forever.\n */\nfunction orderPluginsByDependencies(plugins: GridPlugin[]): GridPlugin[] {\n if (plugins.length < 2) return plugins;\n\n const byName = new Map<string, GridPlugin>();\n for (const plugin of plugins) byName.set(plugin.name, plugin);\n\n const ordered: GridPlugin[] = [];\n const done = new Set<GridPlugin>();\n const onStack = new Set<GridPlugin>();\n\n const visit = (plugin: GridPlugin): void => {\n if (done.has(plugin) || onStack.has(plugin)) return;\n onStack.add(plugin);\n const deps = (plugin.constructor as { dependencies?: PluginDependency[] }).dependencies ?? [];\n for (const dep of deps) {\n const depPlugin = byName.get(dep.name);\n if (depPlugin) visit(depPlugin);\n }\n onStack.delete(plugin);\n done.add(plugin);\n ordered.push(plugin);\n };\n\n for (const plugin of plugins) visit(plugin);\n return ordered;\n}\n\n// #endregion\n\n// #region Auto-Registration\n\n// Wire feature resolver into grid core so `gridConfig.features` is handled automatically.\n// This runs when any feature module is imported (they all import this registry).\nsetFeatureResolver(createPluginsFromFeatures as (features: Record<string, unknown>) => GridPlugin[]);\n\n// #endregion\n\n// #region Testing Utilities\n\n/**\n * Clear the registry. For testing only.\n * @internal\n */\nexport function clearFeatureRegistry(): void {\n featureRegistry.clear();\n warnedFeatures.clear();\n}\n\n// #endregion\n"],"mappings":"uDAqRA,SAAgB,EAAe,EAAsB,EAAiB,EAAiB,GACrF,QAAQ,KAtBV,SAAiC,EAAsB,EAAiB,EAAiB,GAEvF,MAAO,GAnOT,SAA2B,EAAiB,GAG1C,MAAO,YAFI,EAAS,IAAI,IAAW,KACpB,EAAa,IAAI,IAAe,KAEjD,CA8NiB,CAAW,EAAQ,MACd,MAAS,uBApB/B,SAAiB,GACf,MAAO,qCAAgB,EAAK,eAC9B,CAkB4D,CAAQ,IACpE,CAmBe,CAAiB,EAAM,EAAS,EAAQ,GACvD,CCpMA,IAAM,EAAA,QACA,EAAe,OAAO,IAAI,sCAAsC,QAChE,EAAa,OAAO,IAAI,6CAA6C,QAE3E,SAAS,EAAqB,EAAa,GACzC,IAAI,EAAQ,QAAQ,IAAI,WAAY,GAKpC,YAJc,IAAV,IACF,EAAQ,IACR,QAAQ,IAAI,WAAY,EAAK,IAExB,CACT,CAEA,IAAM,EAAkB,EAAkB,EAAA,mBAAoB,IAAI,KAC5D,EAAiB,EAAkB,EAAA,mBAAkB,IAAI,KAOzD,EAAA,IACc,oBAAX,SACwB,cAA9B,OAAO,UAAU,UAA0D,cAA9B,OAAO,UAAU,UA2BjE,SAAgB,EAAgB,EAAc,EAAwB,GAChE,KAAW,EAAgB,IAAI,KAAU,GAAS,UACpD,ED3CgC,SC2CK,YAAY,4DAEnD,EAAgB,IAAI,EAAM,CAAE,UAAS,QACvC,CAKA,SAAgB,EAAoB,GAClC,OAAO,EAAgB,IAAI,EAC7B,CAKA,SAAgB,EAAkB,GAChC,OAAO,EAAgB,IAAI,IAAO,OACpC,CAKA,SAAgB,IACd,OAAO,MAAM,KAAK,EAAgB,OACpC,CAUA,IAAM,EAAgD,CACpD,SAAU,CAAC,WACX,UAAW,CAAC,cAOd,SAAgB,EAAwB,EAAc,GACpD,MAAM,EAAQ,EAAgB,IAAI,GAElC,GAAK,EAcL,OAAO,EAAM,QAAQ,GAbnB,GAAI,MAAY,EAAe,IAAI,GAAO,CACxC,EAAe,IAAI,GACnB,MAAM,EAAQ,EAAK,QAAQ,kBAAmB,SAAS,cACvD,ED3F8B,SC6F5B,YAAY,+GAE8B,QAE9C,CAKJ,CAqCA,SAAgB,EAA0B,GACxC,MAAM,EAA4B,GAGlC,IAAK,MAAO,EAAK,KAAU,OAAO,QAAQ,QAC1B,IAAV,IAAiC,IAAV,GAC3B,EAAgB,KAAK,IAtCzB,SAA8B,GAC5B,MAAM,EAAa,IAAI,IAAI,GAE3B,IAAK,MAAM,KAAW,EAAc,CAClC,MAAM,EAAO,EAAoB,GACjC,GAAK,EAEL,IAAK,MAAM,KAAO,EACX,EAAW,IAAI,IACd,KACF,EDnHyB,SCqHvB,YAAY,gBAAsB,0BAAiC,qCAK7E,CACF,CAwBE,CAAqB,GAGrB,MAAM,EAAwB,GAC9B,IAAK,MAAM,KAAe,EAAiB,CACzC,MAAM,EAAS,EAAwB,EAAa,EAAS,IACzD,GAAQ,EAAQ,KAAK,EAC3B,CAIA,OAiBF,SAAoC,GAClC,GAAI,EAAQ,OAAS,EAAG,OAAO,EAE/B,MAAM,iBAAS,IAAI,IACnB,IAAK,MAAM,KAAU,EAAS,EAAO,IAAI,EAAO,KAAM,GAEtD,MAAM,EAAwB,GACxB,iBAAO,IAAI,IACX,iBAAU,IAAI,IAEd,EAAS,IACb,GAAI,EAAK,IAAI,IAAW,EAAQ,IAAI,GAAS,OAC7C,EAAQ,IAAI,GACZ,MAAM,EAAQ,EAAO,YAAsD,cAAgB,GAC3F,IAAK,MAAM,KAAO,EAAM,CACtB,MAAM,EAAY,EAAO,IAAI,EAAI,MAC7B,GAAW,EAAM,EACvB,CACA,EAAQ,OAAO,GACf,EAAK,IAAI,GACT,EAAQ,KAAK,IAGf,IAAK,MAAM,KAAU,EAAS,EAAM,GACpC,OAAO,CACT,CA1CS,CAA2B,EACpC,CA2DA,SAAgB,IACd,EAAgB,QAChB,EAAe,OACjB,CAbA,EAAmB"}
|
|
1
|
+
{"version":3,"file":"registry.js","names":["setFeatureResolver","warnDiagnostic","code","message","gridId","pluginName","console","warn","gridPrefix","toLowerCase","docsUrl","formatDiagnostic","GRID_VERSION","REGISTRY_KEY","Symbol","for","WARNED_KEY","getOrCreateGlobal","key","make","value","Reflect","get","globalThis","set","featureRegistry","Map","warnedFeatures","Set","isDev","window","location","hostname","registerFeature","name","factory","options","has","override","isFeatureRegistered","getFeatureFactory","getRegisteredFeatures","Array","from","keys","PLUGIN_DEPENDENCIES","undoRedo","clipboard","createPluginFromFeature","config","entry","add","kebab","replace","createPluginsFromFeatures","features","enabledFeatures","Object","entries","push","featureNames","featureSet","feature","deps","dep","validateDependencies","plugins","featureName","plugin","length","byName","ordered","done","onStack","visit","constructor","dependencies","depPlugin","delete","orderPluginsByDependencies","clearFeatureRegistry","clear"],"sources":["../../../../../libs/grid/src/lib/core/internal/diagnostics.ts","../../../../../libs/grid/src/lib/features/registry.ts"],"sourcesContent":["/**\n * Centralized diagnostic messages for @toolbox-web/grid.\n *\n * Every user-facing warning, error, or info message in the grid has a unique\n * diagnostic code (e.g. `TBW001`). Each code maps to a section on the online\n * troubleshooting page, giving developers a direct link to resolution steps.\n *\n * ## Usage\n *\n * ```ts\n * import { MISSING_BREAKPOINT, warnDiagnostic, throwDiagnostic } from './diagnostics';\n *\n * // Warn with a code\n * warnDiagnostic(MISSING_BREAKPOINT, 'Set a breakpoint...', gridId);\n *\n * // Throw with a code\n * throwDiagnostic(MISSING_ROW_ID, 'Configure getRowId...', gridId);\n * ```\n *\n * Plugins should prefer `this.warn(MISSING_BREAKPOINT, message)` via BaseGridPlugin\n * instead of importing this module directly.\n *\n * @internal\n */\n\n// #region Grid Prefix\n\n/**\n * Build the `[tbw-grid]` or `[tbw-grid#my-id]` log prefix.\n * Pass `pluginName` for a scoped prefix like `[tbw-grid:SelectionPlugin]`.\n */\nexport function gridPrefix(gridId?: string, pluginName?: string): string {\n const id = gridId ? `#${gridId}` : '';\n const plugin = pluginName ? `:${pluginName}` : '';\n return `[tbw-grid${id}${plugin}]`;\n}\n\n// #endregion\n\n// #region Diagnostic Codes\n\n/**\n * Diagnostic codes used across the grid library.\n *\n * Each code is an individual export so that unused codes are tree-shaken\n * from bundles that don't reference them (esbuild can't tree-shake\n * properties from a single object).\n *\n * Naming: TBW + 3-digit number.\n * Ranges:\n * 001–019 Configuration validation (missing plugins, bad config)\n * 020–029 Plugin lifecycle (dependencies, incompatibilities, alias collapse)\n * 030–039 Feature registry\n * 040–049 Row operations (row ID, row mutations)\n * 050–059 Column operations (width, template)\n * 060–069 Rendering (callbacks, formatters, external views)\n * 070–079 Shell (tool panels, header/toolbar content)\n * 080–089 Editing & editors\n * 090–099 Print\n * 100–109 Clipboard\n * 110–119 Plugin-specific (responsive, undo-redo, grouping-columns)\n * 120–129 Style injection\n * 130–139 Attribute parsing\n * 140–149 DataSource / ServerSide\n */\n\n// --- Config validation (001–019) ---\n/** Column uses a plugin-owned property but the plugin is not loaded. */\nexport const MISSING_PLUGIN = 'TBW001' as const;\n/** Grid config uses a plugin-owned property but the plugin is not loaded. */\nexport const MISSING_PLUGIN_CONFIG = 'TBW002' as const;\n/** Plugin config rule violation (error severity). */\nexport const CONFIG_RULE_ERROR = 'TBW003' as const;\n/** Plugin config rule violation (warning severity). */\nexport const CONFIG_RULE_WARN = 'TBW004' as const;\n\n// --- Plugin lifecycle (020–029) ---\n/** Required plugin dependency is missing. */\nexport const MISSING_DEPENDENCY = 'TBW020' as const;\n/** Optional plugin dependency is missing. */\nexport const OPTIONAL_DEPENDENCY = 'TBW021' as const;\n/** Two loaded plugins are incompatible. */\nexport const INCOMPATIBLE_PLUGINS = 'TBW022' as const;\n/** Two plugin instances resolve to the same canonical name (alias collapse). */\nexport const PLUGIN_ALIAS_COLLAPSE = 'TBW023' as const;\n/** Error thrown inside a plugin event handler. */\nexport const PLUGIN_EVENT_ERROR = 'TBW024' as const;\n/** Conflicting config values found while merging alias-collapsed plugin instances. */\nexport const PLUGIN_ALIAS_CONFIG_CONFLICT = 'TBW025' as const;\n\n// --- Feature registry (030–039) ---\n/** Feature was re-registered (overwritten). */\nexport const FEATURE_REREGISTERED = 'TBW030' as const;\n/** Feature configured but not imported. */\nexport const FEATURE_NOT_IMPORTED = 'TBW031' as const;\n/** Feature depends on another feature that is not enabled. */\nexport const FEATURE_MISSING_DEP = 'TBW032' as const;\n\n// --- Row operations (040–049) ---\n/** Cannot determine row ID (no getRowId and no id property). */\nexport const MISSING_ROW_ID = 'TBW040' as const;\n/** Row with given ID not found. */\nexport const ROW_NOT_FOUND = 'TBW041' as const;\n\n// --- Column operations (050–059) ---\n/** Column has an invalid CSS width value. */\nexport const INVALID_COLUMN_WIDTH = 'TBW050' as const;\n\n// --- Rendering callbacks (060–069) ---\n/** rowClass callback threw an error. */\nexport const ROW_CLASS_ERROR = 'TBW060' as const;\n/** cellClass callback threw an error. */\nexport const CELL_CLASS_ERROR = 'TBW061' as const;\n/** Column format function threw an error. */\nexport const FORMAT_ERROR = 'TBW062' as const;\n/** External view mount() threw an error. */\nexport const VIEW_MOUNT_ERROR = 'TBW063' as const;\n/** External view event dispatch error. */\nexport const VIEW_DISPATCH_ERROR = 'TBW064' as const;\n\n// --- Shell (070–079) ---\n/** Tool panel missing required id. */\nexport const TOOL_PANEL_MISSING_ATTR = 'TBW070' as const;\n/** No tool panels registered. */\nexport const NO_TOOL_PANELS = 'TBW071' as const;\n/** Tool panel section not found. */\nexport const TOOL_PANEL_NOT_FOUND = 'TBW072' as const;\n/** Tool panel already registered. */\nexport const TOOL_PANEL_DUPLICATE = 'TBW073' as const;\n/** Header content already registered. */\nexport const HEADER_CONTENT_DUPLICATE = 'TBW074' as const;\n/** Toolbar content already registered. */\nexport const TOOLBAR_CONTENT_DUPLICATE = 'TBW075' as const;\n\n// --- Editing & editors (080–089) ---\n/** External editor mount() threw an error. */\nexport const EDITOR_MOUNT_ERROR = 'TBW080' as const;\n\n// --- Print (090–099) ---\n/** Print already in progress. */\nexport const PRINT_IN_PROGRESS = 'TBW090' as const;\n/** Grid not available for printing. */\nexport const PRINT_NO_GRID = 'TBW091' as const;\n/** Print operation failed. */\nexport const PRINT_FAILED = 'TBW092' as const;\n/** Multiple elements share the same grid ID (print isolation issue). */\nexport const PRINT_DUPLICATE_ID = 'TBW093' as const;\n\n// --- Clipboard (100–109) ---\n/** Clipboard API write failed. */\nexport const CLIPBOARD_FAILED = 'TBW100' as const;\n\n// --- Plugin-specific (110–119) ---\n/** ResponsivePlugin: no breakpoint configured. */\nexport const MISSING_BREAKPOINT = 'TBW110' as const;\n/** UndoRedoPlugin: transaction already in progress. */\nexport const TRANSACTION_IN_PROGRESS = 'TBW111' as const;\n/** UndoRedoPlugin: no transaction in progress. */\nexport const NO_TRANSACTION = 'TBW112' as const;\n/** GroupingColumnsPlugin: missing id or header on column group definition. */\nexport const COLUMN_GROUP_NO_ID = 'TBW113' as const;\n/** GroupingColumnsPlugin: conflicting columnGroups sources. */\nexport const COLUMN_GROUPS_CONFLICT = 'TBW114' as const;\n\n// --- Style injection (120–129) ---\n/** Failed to extract grid.css from document stylesheets. */\nexport const STYLE_EXTRACT_FAILED = 'TBW120' as const;\n/** Could not find grid.css in document.styleSheets. */\nexport const STYLE_NOT_FOUND = 'TBW121' as const;\n\n// --- Attribute parsing (130–139) ---\n/** Invalid JSON in an HTML attribute. */\nexport const INVALID_ATTRIBUTE_JSON = 'TBW130' as const;\n\n// --- DataSource / ServerSide (140–149) ---\n/** ServerSidePlugin: getRows() rejected. */\nexport const DATASOURCE_FETCH_ERROR = 'TBW140' as const;\n/** ServerSidePlugin: getChildRows() rejected. */\nexport const DATASOURCE_CHILD_FETCH_ERROR = 'TBW141' as const;\n/** ServerSidePlugin: getChildRows() not implemented but a plugin queried for children. */\nexport const DATASOURCE_NO_CHILD_HANDLER = 'TBW142' as const;\n/** ServerSidePlugin: concurrent request limit reached, request deferred. */\nexport const DATASOURCE_THROTTLED = 'TBW143' as const;\n\nexport type DiagnosticCode =\n | typeof MISSING_PLUGIN\n | typeof MISSING_PLUGIN_CONFIG\n | typeof CONFIG_RULE_ERROR\n | typeof CONFIG_RULE_WARN\n | typeof MISSING_DEPENDENCY\n | typeof OPTIONAL_DEPENDENCY\n | typeof INCOMPATIBLE_PLUGINS\n | typeof PLUGIN_ALIAS_COLLAPSE\n | typeof PLUGIN_EVENT_ERROR\n | typeof PLUGIN_ALIAS_CONFIG_CONFLICT\n | typeof FEATURE_REREGISTERED\n | typeof FEATURE_NOT_IMPORTED\n | typeof FEATURE_MISSING_DEP\n | typeof MISSING_ROW_ID\n | typeof ROW_NOT_FOUND\n | typeof INVALID_COLUMN_WIDTH\n | typeof ROW_CLASS_ERROR\n | typeof CELL_CLASS_ERROR\n | typeof FORMAT_ERROR\n | typeof VIEW_MOUNT_ERROR\n | typeof VIEW_DISPATCH_ERROR\n | typeof TOOL_PANEL_MISSING_ATTR\n | typeof NO_TOOL_PANELS\n | typeof TOOL_PANEL_NOT_FOUND\n | typeof TOOL_PANEL_DUPLICATE\n | typeof HEADER_CONTENT_DUPLICATE\n | typeof TOOLBAR_CONTENT_DUPLICATE\n | typeof EDITOR_MOUNT_ERROR\n | typeof PRINT_IN_PROGRESS\n | typeof PRINT_NO_GRID\n | typeof PRINT_FAILED\n | typeof PRINT_DUPLICATE_ID\n | typeof CLIPBOARD_FAILED\n | typeof MISSING_BREAKPOINT\n | typeof TRANSACTION_IN_PROGRESS\n | typeof NO_TRANSACTION\n | typeof COLUMN_GROUP_NO_ID\n | typeof COLUMN_GROUPS_CONFLICT\n | typeof STYLE_EXTRACT_FAILED\n | typeof STYLE_NOT_FOUND\n | typeof INVALID_ATTRIBUTE_JSON\n | typeof DATASOURCE_FETCH_ERROR\n | typeof DATASOURCE_CHILD_FETCH_ERROR\n | typeof DATASOURCE_NO_CHILD_HANDLER\n | typeof DATASOURCE_THROTTLED;\n\n// #endregion\n\n// #region Docs URL\n\nconst DOCS_BASE = 'https://toolboxjs.com/grid/errors';\n\n/** Build a direct link to the troubleshooting section for a code. */\nfunction docsUrl(code: DiagnosticCode): string {\n return `${DOCS_BASE}#${code.toLowerCase()}`;\n}\n\n// #endregion\n\n// #region Formatting\n\n/**\n * Format a diagnostic message with prefix, code, and docs link.\n *\n * Output format:\n * ```\n * [tbw-grid#my-id] TBW001: Your message here.\n *\n * → More info: https://toolboxjs.com/grid/errors#tbw001\n * ```\n */\nexport function formatDiagnostic(code: DiagnosticCode, message: string, gridId?: string, pluginName?: string): string {\n const prefix = gridPrefix(gridId, pluginName);\n return `${prefix} ${code}: ${message}\\n\\n → More info: ${docsUrl(code)}`;\n}\n\n// #endregion\n\n// #region Public API\n\n/**\n * Throw an error with a diagnostic code and docs link.\n * Use for configuration errors and API misuse that should halt execution.\n */\nexport function throwDiagnostic(code: DiagnosticCode, message: string, gridId?: string, pluginName?: string): never {\n throw new Error(formatDiagnostic(code, message, gridId, pluginName));\n}\n\n/**\n * Log a warning with a diagnostic code and docs link.\n * Use for recoverable issues the developer should fix.\n */\nexport function warnDiagnostic(code: DiagnosticCode, message: string, gridId?: string, pluginName?: string): void {\n console.warn(formatDiagnostic(code, message, gridId, pluginName));\n}\n\n/**\n * Log a debug message with a diagnostic code and docs link.\n * Use for optional/soft dependency notifications — visible only when\n * the browser DevTools \"Verbose\" log level is enabled.\n */\nexport function debugDiagnostic(code: DiagnosticCode, message: string, gridId?: string, pluginName?: string): void {\n console.debug(formatDiagnostic(code, message, gridId, pluginName));\n}\n\n/**\n * Log an error with a diagnostic code and docs link.\n * Use for non-throwing errors (e.g., failed async operations).\n */\nexport function errorDiagnostic(code: DiagnosticCode, message: string, gridId?: string, pluginName?: string): void {\n console.error(formatDiagnostic(code, message, gridId, pluginName));\n}\n\n// #endregion\n","/**\n * Core Feature Registry for @toolbox-web/grid\n *\n * This module provides a framework-agnostic registry for plugin factories.\n * Features are registered via side-effect imports, enabling tree-shaking\n * while maintaining a clean declarative API.\n *\n * @example\n * ```typescript\n * // Import features you need (side-effect imports)\n * import '@toolbox-web/grid/features/selection';\n * import '@toolbox-web/grid/features/filtering';\n *\n * // Configure grid declaratively\n * grid.gridConfig = {\n * features: {\n * selection: 'range',\n * filtering: { debounceMs: 200 },\n * },\n * };\n * ```\n *\n * @packageDocumentation\n * @module Features\n */\n\nimport {\n FEATURE_MISSING_DEP,\n FEATURE_NOT_IMPORTED,\n FEATURE_REREGISTERED,\n warnDiagnostic,\n} from '../core/internal/diagnostics';\nimport { setFeatureResolver } from '../core/internal/feature-hook';\nimport type { PluginDependency } from '../core/plugin/base-plugin';\nimport type { FeatureConfig, GridPlugin } from '../core/types';\n\n// #region Types\n\n/** Feature name — keys of the augmented FeatureConfig interface. */\nexport type FeatureName = keyof FeatureConfig;\n\n/** Factory function that creates a plugin from a feature config value. */\nexport type PluginFactory<TConfig = unknown> = (config: TConfig) => GridPlugin;\n\ninterface RegistryEntry {\n factory: PluginFactory;\n name: string;\n}\n\n// #endregion\n\n// #region Registry State\n\n/*\n * Cross-bundle singleton (version-scoped).\n *\n * The custom-elements registry is realm-global, but `import` graphs are not:\n * when two micro-frontend widgets on the same page bundle their own copy of\n * `@toolbox-web/grid`, each copy gets its own `featureRegistry` Map. The\n * `<tbw-grid>` class is realm-global (see `registerDataGrid()` in\n * `core/grid.ts`), so the *running* class resolves features via the resolver\n * its own bundle wired up — which closes over the *local* Map. Side-effect\n * imports from any other bundle (`import '@toolbox-web/grid/features/tree'`)\n * land in a different Map that the running class never reads, producing\n * spurious TBW031 \"feature not registered\" warnings.\n *\n * Fix: persist the Map on `globalThis` under a `Symbol.for(...)` key so every\n * loaded copy of this module reads and writes the same instance.\n *\n * The key embeds `__GRID_VERSION__` so **only same-version** bundles share a\n * registry. `registerDataGrid()` already isolates differently-versioned grid\n * classes by registering them under suffixed tag names — the version is\n * sanitized to ASCII letters/digits/dashes, so `2.14.0` becomes the tag\n * `tbw-grid-v2-14-0` (issue #339). The feature registry must mirror that\n * isolation, otherwise the last-loaded bundle's plugin factories would\n * overwrite earlier versions' entries and the running grid would attach\n * plugin instances built against a different internal contract. The trailing\n * `/v1` is a schema version for the slot shape — bump if the stored value's\n * shape changes incompatibly.\n *\n * Issue: planning #9 (two Roma widgets each bundling their own grid copy).\n */\ndeclare const __GRID_VERSION__: string;\nconst GRID_VERSION = typeof __GRID_VERSION__ !== 'undefined' ? __GRID_VERSION__ : 'dev';\nconst REGISTRY_KEY = Symbol.for(`@toolbox-web/grid:feature-registry@${GRID_VERSION}/v1`);\nconst WARNED_KEY = Symbol.for(`@toolbox-web/grid:feature-registry-warned@${GRID_VERSION}/v1`);\n\nfunction getOrCreateGlobal<T>(key: symbol, make: () => T): T {\n let value = Reflect.get(globalThis, key) as T | undefined;\n if (value === undefined) {\n value = make();\n Reflect.set(globalThis, key, value);\n }\n return value;\n}\n\nconst featureRegistry = getOrCreateGlobal(REGISTRY_KEY, () => new Map<string, RegistryEntry>());\nconst warnedFeatures = getOrCreateGlobal(WARNED_KEY, () => new Set<string>());\n\n// #endregion\n\n// #region Registration API\n\n/** Runtime dev-mode check (localhost or 127.0.0.1). */\nconst isDev = (): boolean =>\n typeof window !== 'undefined' &&\n (window.location?.hostname === 'localhost' || window.location?.hostname === '127.0.0.1');\n\n/** Optional flags passed to {@link registerFeature}. */\nexport interface RegisterFeatureOptions {\n /**\n * Set to `true` when the registration is intentionally overwriting an\n * existing entry (e.g. a framework adapter wrapping the vanilla factory\n * with reactive bridging). Suppresses the TBW030 dev-mode warning.\n */\n override?: boolean;\n}\n\n/**\n * Register a feature's plugin factory.\n * Called by side-effect feature imports (e.g., `import '@toolbox-web/grid/features/selection'`).\n *\n * @param name - The feature name (matches a key on FeatureConfig)\n * @param factory - Function that creates a plugin instance from config\n * @param options - Pass `{ override: true }` for intentional re-registration\n * (framework adapters bridging the vanilla factory) to suppress TBW030.\n */\nexport function registerFeature<K extends FeatureName>(\n name: K,\n factory: PluginFactory<FeatureConfig[K]>,\n options?: RegisterFeatureOptions,\n): void;\nexport function registerFeature(name: string, factory: PluginFactory, options?: RegisterFeatureOptions): void;\nexport function registerFeature(name: string, factory: PluginFactory, options?: RegisterFeatureOptions): void {\n if (isDev() && featureRegistry.has(name) && !options?.override) {\n warnDiagnostic(FEATURE_REREGISTERED, `Feature \"${name}\" was re-registered. Previous registration overwritten.`);\n }\n featureRegistry.set(name, { factory, name });\n}\n\n/**\n * Check if a feature has been registered.\n */\nexport function isFeatureRegistered(name: string): boolean {\n return featureRegistry.has(name);\n}\n\n/**\n * Get a registered feature's factory. Returns undefined if not registered.\n */\nexport function getFeatureFactory(name: string): PluginFactory | undefined {\n return featureRegistry.get(name)?.factory;\n}\n\n/**\n * Get all registered feature names.\n */\nexport function getRegisteredFeatures(): string[] {\n return Array.from(featureRegistry.keys());\n}\n\n// #endregion\n\n// #region Plugin Creation\n\n/**\n * Plugin dependency declarations.\n * Some plugins require others to be loaded first.\n */\nconst PLUGIN_DEPENDENCIES: Record<string, string[]> = {\n undoRedo: ['editing'],\n clipboard: ['selection'],\n};\n\n/**\n * Create a plugin instance for a single feature.\n * Shows a warning if the feature is not registered.\n */\nexport function createPluginFromFeature(name: string, config: unknown): GridPlugin | undefined {\n const entry = featureRegistry.get(name);\n\n if (!entry) {\n if (isDev() && !warnedFeatures.has(name)) {\n warnedFeatures.add(name);\n const kebab = name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n warnDiagnostic(\n FEATURE_NOT_IMPORTED,\n `Feature \"${name}\" is configured but not registered.\\n` +\n `Add this import to enable it:\\n\\n` +\n ` import '@toolbox-web/grid/features/${kebab}';\\n`,\n );\n }\n return undefined;\n }\n\n return entry.factory(config);\n}\n\n/**\n * Validate feature dependencies and log warnings for missing ones.\n */\nfunction validateDependencies(featureNames: string[]): void {\n const featureSet = new Set(featureNames);\n\n for (const feature of featureNames) {\n const deps = PLUGIN_DEPENDENCIES[feature];\n if (!deps) continue;\n\n for (const dep of deps) {\n if (!featureSet.has(dep)) {\n if (isDev()) {\n warnDiagnostic(\n FEATURE_MISSING_DEP,\n `Feature \"${feature}\" requires \"${dep}\" to be enabled. ` + `Add \"${dep}\" to your features configuration.`,\n );\n }\n }\n }\n }\n}\n\n/**\n * Create plugin instances from a features configuration object.\n *\n * Handles:\n * - Dependency validation (clipboard needs selection)\n * - Dependency ordering, derived programmatically from each plugin's declared\n * `static dependencies` (selection before clipboard, shell before visibility)\n * - Skipping false/undefined values\n *\n * @param features - Partial FeatureConfig object\n * @returns Array of plugin instances ready for gridConfig.plugins\n */\nexport function createPluginsFromFeatures(features: Record<string, unknown>): GridPlugin[] {\n const enabledFeatures: string[] = [];\n\n // Collect enabled feature names\n for (const [key, value] of Object.entries(features)) {\n if (value === undefined || value === false) continue;\n enabledFeatures.push(key);\n }\n\n // Validate dependencies (dev-only warnings for missing feature deps)\n validateDependencies(enabledFeatures);\n\n // Instantiate each enabled feature's plugin in declared (config) order...\n const plugins: GridPlugin[] = [];\n for (const featureName of enabledFeatures) {\n const plugin = createPluginFromFeature(featureName, features[featureName]);\n if (plugin) plugins.push(plugin);\n }\n\n // ...then reorder so every plugin's declared `static dependencies` attach\n // before it (see orderPluginsByDependencies).\n return orderPluginsByDependencies(plugins);\n}\n\n/**\n * Topologically order plugin instances so each plugin's declared\n * `static dependencies` precede it. The dependency list is read straight off\n * the plugin constructor — the SAME metadata `validatePluginDependencies`\n * consumes at attach time — so the resolved order satisfies the dependency\n * validator regardless of `features` key order, and third-party plugins that\n * declare their own `static dependencies` are sequenced correctly with no\n * hardcoded table.\n *\n * Independent plugins keep their original (config) order. Edges pointing at\n * plugins that aren't enabled are ignored (a missing required dependency is\n * reported separately by the validator at attach time). Cycles are broken\n * gracefully — the partial order is preserved rather than looping forever.\n */\nfunction orderPluginsByDependencies(plugins: GridPlugin[]): GridPlugin[] {\n if (plugins.length < 2) return plugins;\n\n const byName = new Map<string, GridPlugin>();\n for (const plugin of plugins) byName.set(plugin.name, plugin);\n\n const ordered: GridPlugin[] = [];\n const done = new Set<GridPlugin>();\n const onStack = new Set<GridPlugin>();\n\n const visit = (plugin: GridPlugin): void => {\n if (done.has(plugin) || onStack.has(plugin)) return;\n onStack.add(plugin);\n const deps = (plugin.constructor as { dependencies?: PluginDependency[] }).dependencies ?? [];\n for (const dep of deps) {\n const depPlugin = byName.get(dep.name);\n if (depPlugin) visit(depPlugin);\n }\n onStack.delete(plugin);\n done.add(plugin);\n ordered.push(plugin);\n };\n\n for (const plugin of plugins) visit(plugin);\n return ordered;\n}\n\n// #endregion\n\n// #region Auto-Registration\n\n// Wire feature resolver into grid core so `gridConfig.features` is handled automatically.\n// This runs when any feature module is imported (they all import this registry).\nsetFeatureResolver(createPluginsFromFeatures as (features: Record<string, unknown>) => GridPlugin[]);\n\n// #endregion\n\n// #region Testing Utilities\n\n/**\n * Clear the registry. For testing only.\n * @internal\n */\nexport function clearFeatureRegistry(): void {\n featureRegistry.clear();\n warnedFeatures.clear();\n}\n\n// #endregion\n"],"mappings":"6B,0BAqRA,SAAgBC,EAAeC,EAAsBC,EAAiBC,EAAiBC,GACrFC,QAAQC,KAtBV,SAAiCL,EAAsBC,EAAiBC,EAAiBC,GAEvF,MAAO,GAnOT,SAA2BD,EAAiBC,GAG1C,MAAO,YAFID,EAAS,IAAIA,IAAW,KACpBC,EAAa,IAAIA,IAAe,KAEjD,CA8NiBG,CAAWJ,EAAQC,MACdH,MAASC,uBApB/B,SAAiBD,GACf,MAAO,qCAAgBA,EAAKO,eAC9B,CAkB4DC,CAAQR,IACpE,CAmBeS,CAAiBT,EAAMC,EAASC,EAAQC,GACvD,CCpMA,IAAMO,EAAA,SACAC,EAAeC,OAAOC,IAAI,sCAAsCH,QAChEI,EAAaF,OAAOC,IAAI,6CAA6CH,QAE3E,SAASK,EAAqBC,EAAaC,GACzC,IAAIC,EAAQC,QAAQC,IAAIC,WAAYL,GAKpC,YAJc,IAAVE,IACFA,EAAQD,IACRE,QAAQG,IAAID,WAAYL,EAAKE,IAExBA,CACT,CAEA,IAAMK,EAAkBR,EAAkBJ,EAAA,mBAAoB,IAAIa,KAC5DC,EAAiBV,EAAkBD,EAAA,mBAAkB,IAAIY,KAOzDC,EAAA,IACc,oBAAXC,SACwB,cAA9BA,OAAOC,UAAUC,UAA0D,cAA9BF,OAAOC,UAAUC,UA2BjE,SAAgBC,EAAgBC,EAAcC,EAAwBC,GAChEP,KAAWJ,EAAgBY,IAAIH,KAAUE,GAASE,UACpDrC,ED3CgC,SC2CK,YAAYiC,4DAEnDT,EAAgBD,IAAIU,EAAM,CAAEC,UAASD,QACvC,CAKA,SAAgBK,EAAoBL,GAClC,OAAOT,EAAgBY,IAAIH,EAC7B,CAKA,SAAgBM,EAAkBN,GAChC,OAAOT,EAAgBH,IAAIY,IAAOC,OACpC,CAKA,SAAgBM,IACd,OAAOC,MAAMC,KAAKlB,EAAgBmB,OACpC,CAUA,IAAMC,EAAgD,CACpDC,SAAU,CAAC,WACXC,UAAW,CAAC,cAOd,SAAgBC,EAAwBd,EAAce,GACpD,MAAMC,EAAQzB,EAAgBH,IAAIY,GAElC,GAAKgB,EAcL,OAAOA,EAAMf,QAAQc,GAbnB,GAAIpB,MAAYF,EAAeU,IAAIH,GAAO,CACxCP,EAAewB,IAAIjB,GACnB,MAAMkB,EAAQlB,EAAKmB,QAAQ,kBAAmB,SAAS5C,cACvDR,ED3F8B,SC6F5B,YAAYiC,+GAE8BkB,QAE9C,CAKJ,CAqCA,SAAgBE,EAA0BC,GACxC,MAAMC,EAA4B,GAGlC,IAAK,MAAOtC,EAAKE,KAAUqC,OAAOC,QAAQH,QAC1B,IAAVnC,IAAiC,IAAVA,GAC3BoC,EAAgBG,KAAKzC,IAtCzB,SAA8B0C,GAC5B,MAAMC,EAAa,IAAIjC,IAAIgC,GAE3B,IAAK,MAAME,KAAWF,EAAc,CAClC,MAAMG,EAAOlB,EAAoBiB,GACjC,GAAKC,EAEL,IAAK,MAAMC,KAAOD,EACXF,EAAWxB,IAAI2B,IACdnC,KACF5B,EDnHyB,SCqHvB,YAAY6D,gBAAsBE,0BAAiCA,qCAK7E,CACF,CAwBEC,CAAqBT,GAGrB,MAAMU,EAAwB,GAC9B,IAAK,MAAMC,KAAeX,EAAiB,CACzC,MAAMY,EAASpB,EAAwBmB,EAAaZ,EAASY,IACzDC,GAAQF,EAAQP,KAAKS,EAC3B,CAIA,OAiBF,SAAoCF,GAClC,GAAIA,EAAQG,OAAS,EAAG,OAAOH,EAE/B,MAAMI,iBAAS,IAAI5C,IACnB,IAAK,MAAM0C,KAAUF,EAASI,EAAO9C,IAAI4C,EAAOlC,KAAMkC,GAEtD,MAAMG,EAAwB,GACxBC,iBAAO,IAAI5C,IACX6C,iBAAU,IAAI7C,IAEd8C,EAASN,IACb,GAAII,EAAKnC,IAAI+B,IAAWK,EAAQpC,IAAI+B,GAAS,OAC7CK,EAAQtB,IAAIiB,GACZ,MAAML,EAAQK,EAAOO,YAAsDC,cAAgB,GAC3F,IAAK,MAAMZ,KAAOD,EAAM,CACtB,MAAMc,EAAYP,EAAOhD,IAAI0C,EAAI9B,MAC7B2C,GAAWH,EAAMG,EACvB,CACAJ,EAAQK,OAAOV,GACfI,EAAKrB,IAAIiB,GACTG,EAAQZ,KAAKS,IAGf,IAAK,MAAMA,KAAUF,EAASQ,EAAMN,GACpC,OAAOG,CACT,CA1CSQ,CAA2Bb,EACpC,CA2DA,SAAgBc,IACdvD,EAAgBwD,QAChBtD,EAAesD,OACjB,CAbAjF,EAAmBsD,U"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reorder-columns.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/reorder-columns.ts"],"sourcesContent":["/**\n * Column Reorder feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/reorder-columns';\n *\n * grid.gridConfig = { features: { reorderColumns: true } };\n * ```\n */\n\nimport { ReorderPlugin, type ReorderConfig } from '../plugins/reorder-columns';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable column drag-to-reorder. */\n reorderColumns?: boolean | ReorderConfig;\n }\n}\n\nconst factory = (config: unknown) => {\n const options = typeof config === 'boolean' ? {} : ((config as ReorderConfig) ?? {});\n return new ReorderPlugin(options);\n};\n\nregisterFeature('reorderColumns', factory);\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"reorder-columns.js","names":["ReorderPlugin","registerFeature","config"],"sources":["../../../../../libs/grid/src/lib/features/reorder-columns.ts"],"sourcesContent":["/**\n * Column Reorder feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/reorder-columns';\n *\n * grid.gridConfig = { features: { reorderColumns: true } };\n * ```\n */\n\nimport { ReorderPlugin, type ReorderConfig } from '../plugins/reorder-columns';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable column drag-to-reorder. */\n reorderColumns?: boolean | ReorderConfig;\n }\n}\n\nconst factory = (config: unknown) => {\n const options = typeof config === 'boolean' ? {} : ((config as ReorderConfig) ?? {});\n return new ReorderPlugin(options);\n};\n\nregisterFeature('reorderColumns', factory);\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"wB,wHA0BAC,EAAgB,iBALCC,GAER,IAAIF,EADuB,kBAAXE,EAAuB,CAAC,EAAMA,GAA4B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responsive.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/responsive.ts"],"sourcesContent":["/**\n * Responsive feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/responsive';\n *\n * grid.gridConfig = { features: { responsive: true } };\n * ```\n */\n\nimport { ResponsivePlugin, type ResponsivePluginConfig } from '../plugins/responsive';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable responsive column hiding based on breakpoints. */\n responsive?: boolean | ResponsivePluginConfig;\n }\n}\n\nregisterFeature('responsive', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as ResponsivePluginConfig) ?? {});\n return new ResponsivePlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"responsive.js","names":["ResponsivePlugin","registerFeature","config"],"sources":["../../../../../libs/grid/src/lib/features/responsive.ts"],"sourcesContent":["/**\n * Responsive feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/responsive';\n *\n * grid.gridConfig = { features: { responsive: true } };\n * ```\n */\n\nimport { ResponsivePlugin, type ResponsivePluginConfig } from '../plugins/responsive';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable responsive column hiding based on breakpoints. */\n responsive?: boolean | ResponsivePluginConfig;\n }\n}\n\nregisterFeature('responsive', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as ResponsivePluginConfig) ?? {});\n return new ResponsivePlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"2B,mHAqBAC,EAAgB,aAAeC,GAEtB,IAAIF,EADuB,kBAAXE,EAAuB,CAAC,EAAMA,GAAqC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"row-drag-drop.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/row-drag-drop.ts"],"sourcesContent":["/**\n * Row Drag-Drop feature for @toolbox-web/grid\n *\n * Drag rows within a single grid and (with `dropZone`) between grids.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/row-drag-drop';\n *\n * grid.gridConfig = { features: { rowDragDrop: { dropZone: 'tasks' } } };\n * ```\n */\n\nimport { RowDragDropPlugin, type RowDragDropConfig } from '../plugins/row-drag-drop';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable row drag-drop (intra-grid + optional cross-grid via `dropZone`). */\n rowDragDrop?: boolean | RowDragDropConfig;\n }\n}\n\nconst factory = (config: unknown) => {\n if (config === true) {\n return new RowDragDropPlugin();\n }\n return new RowDragDropPlugin((config as RowDragDropConfig) ?? undefined);\n};\n\nregisterFeature('rowDragDrop', factory);\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"row-drag-drop.js","names":["RowDragDropPlugin","registerFeature","config"],"sources":["../../../../../libs/grid/src/lib/features/row-drag-drop.ts"],"sourcesContent":["/**\n * Row Drag-Drop feature for @toolbox-web/grid\n *\n * Drag rows within a single grid and (with `dropZone`) between grids.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/row-drag-drop';\n *\n * grid.gridConfig = { features: { rowDragDrop: { dropZone: 'tasks' } } };\n * ```\n */\n\nimport { RowDragDropPlugin, type RowDragDropConfig } from '../plugins/row-drag-drop';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable row drag-drop (intra-grid + optional cross-grid via `dropZone`). */\n rowDragDrop?: boolean | RowDragDropConfig;\n }\n}\n\nconst factory = (config: unknown) => {\n if (config === true) {\n return new RowDragDropPlugin();\n }\n return new RowDragDropPlugin((config as RowDragDropConfig) ?? undefined);\n};\n\nregisterFeature('rowDragDrop', factory);\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"4B,sHA8BAC,EAAgB,cAPCC,IACA,IAAXA,EACK,IAAIF,EAEN,IAAIA,EAAmBE,QAAgC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/selection.ts"],"sourcesContent":["/**\n * Selection feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/selection';\n *\n * grid.gridConfig = { features: { selection: 'range' } };\n * ```\n */\n\nimport { SelectionPlugin, type SelectionConfig } from '../plugins/selection';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig<TRow> {\n /** Enable cell/row/range selection. */\n selection?: 'cell' | 'row' | 'range' | SelectionConfig<TRow>;\n }\n}\n\nregisterFeature('selection', (config) => {\n if (config === 'cell' || config === 'row' || config === 'range') {\n return new SelectionPlugin({ mode: config });\n }\n return new SelectionPlugin(config ?? undefined);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"selection.js","names":["SelectionPlugin","registerFeature","config","mode"],"sources":["../../../../../libs/grid/src/lib/features/selection.ts"],"sourcesContent":["/**\n * Selection feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/selection';\n *\n * grid.gridConfig = { features: { selection: 'range' } };\n * ```\n */\n\nimport { SelectionPlugin, type SelectionConfig } from '../plugins/selection';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig<TRow> {\n /** Enable cell/row/range selection. */\n selection?: 'cell' | 'row' | 'range' | SelectionConfig<TRow>;\n }\n}\n\nregisterFeature('selection', (config) => {\n if (config === 'cell' || config === 'row' || config === 'range') {\n return new SelectionPlugin({ mode: config });\n }\n return new SelectionPlugin(config ?? undefined);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"0B,kHAqBAC,EAAgB,YAAcC,GAEnB,IAAIF,EADE,SAAXE,GAAgC,QAAXA,GAA+B,UAAXA,EAChB,CAAEC,KAAMD,GAEVA,QAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-side.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/server-side.ts"],"sourcesContent":["/**\n * Server-Side feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/server-side';\n *\n * grid.gridConfig = { features: { serverSide: { dataSource: { getRows: async (params) => ... } } } };\n * ```\n */\n\nimport { ServerSidePlugin, type ServerSideConfig } from '../plugins/server-side';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /**\n * Enable server-side data fetching, sorting, filtering, etc.\n *\n * Pass `true` to enable with defaults (e.g. for the zero-JS\n * `<tbw-grid data-src=\"...\">` shorthand) or a {@link ServerSideConfig}\n * object to supply a `dataSource` and other options.\n */\n serverSide?: boolean | ServerSideConfig;\n }\n}\n\nregisterFeature('serverSide', (config) => {\n if (config === true) return new ServerSidePlugin();\n return new ServerSidePlugin((config as ServerSideConfig) ?? undefined);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"server-side.js","names":["ServerSidePlugin","registerFeature","config"],"sources":["../../../../../libs/grid/src/lib/features/server-side.ts"],"sourcesContent":["/**\n * Server-Side feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/server-side';\n *\n * grid.gridConfig = { features: { serverSide: { dataSource: { getRows: async (params) => ... } } } };\n * ```\n */\n\nimport { ServerSidePlugin, type ServerSideConfig } from '../plugins/server-side';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /**\n * Enable server-side data fetching, sorting, filtering, etc.\n *\n * Pass `true` to enable with defaults (e.g. for the zero-JS\n * `<tbw-grid data-src=\"...\">` shorthand) or a {@link ServerSideConfig}\n * object to supply a `dataSource` and other options.\n */\n serverSide?: boolean | ServerSideConfig;\n }\n}\n\nregisterFeature('serverSide', (config) => {\n if (config === true) return new ServerSidePlugin();\n return new ServerSidePlugin((config as ServerSideConfig) ?? undefined);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"2B,oHA2BAC,EAAgB,aAAeC,IACd,IAAXA,EAAwB,IAAIF,EACzB,IAAIA,EAAkBE,QAA+B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/shell.ts"],"sourcesContent":["/**\n * Shell feature for @toolbox-web/grid\n *\n * Enables the grid shell — an optional wrapper that adds a header bar (title,\n * toolbar contents, tool-panel toggle) and a collapsible side panel for\n * filters, column visibility, settings, etc.\n *\n * This is the canonical, best-practice opt-in for the shell. The shell also\n * auto-registers in v2.x (so it is on by default and non-breaking); importing\n * this module makes the opt-in explicit and tree-shakeable for v3, where the\n * auto-register is removed and the feature (or an explicit\n * `plugins: [new ShellPlugin()]`) is required.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/shell';\n *\n * grid.gridConfig = {\n * features: {\n * shell: { header: { title: 'Employees' }, toolPanel: { position: 'right' } },\n * },\n * };\n * ```\n */\n\nimport { ShellPlugin, type ShellConfig } from '../plugins/shell';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable the grid shell (header bar + tool panels). */\n shell?: boolean | ShellConfig;\n }\n}\n\nregisterFeature('shell', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as ShellConfig) ?? {});\n return new ShellPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"shell.js","names":["ShellPlugin","registerFeature","config"],"sources":["../../../../../libs/grid/src/lib/features/shell.ts"],"sourcesContent":["/**\n * Shell feature for @toolbox-web/grid\n *\n * Enables the grid shell — an optional wrapper that adds a header bar (title,\n * toolbar contents, tool-panel toggle) and a collapsible side panel for\n * filters, column visibility, settings, etc.\n *\n * This is the canonical, best-practice opt-in for the shell. The shell also\n * auto-registers in v2.x (so it is on by default and non-breaking); importing\n * this module makes the opt-in explicit and tree-shakeable for v3, where the\n * auto-register is removed and the feature (or an explicit\n * `plugins: [new ShellPlugin()]`) is required.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/shell';\n *\n * grid.gridConfig = {\n * features: {\n * shell: { header: { title: 'Employees' }, toolPanel: { position: 'right' } },\n * },\n * };\n * ```\n */\n\nimport { ShellPlugin, type ShellConfig } from '../plugins/shell';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable the grid shell (header bar + tool panels). */\n shell?: boolean | ShellConfig;\n }\n}\n\nregisterFeature('shell', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as ShellConfig) ?? {});\n return new ShellPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"sB,8GAmCAC,EAAgB,QAAUC,GAEjB,IAAIF,EADuB,kBAAXE,EAAuB,CAAC,EAAMA,GAA0B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sticky-rows.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/sticky-rows.ts"],"sourcesContent":["/**\n * Sticky Rows feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/sticky-rows';\n *\n * grid.gridConfig = { features: { stickyRows: { isSticky: 'isSection' } } };\n * ```\n */\n\nimport { StickyRowsPlugin, type StickyRowsConfig } from '../plugins/sticky-rows';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Pin selected data rows below the header as the user scrolls past them. */\n stickyRows?: StickyRowsConfig;\n }\n}\n\nregisterFeature('stickyRows', (config) => {\n // `stickyRows` requires an `isSticky` value — `boolean` shorthand is not\n // meaningful. The TS type prevents `true`/`false` callers from compiling;\n // at runtime we coerce to a no-op predicate for safety.\n const options = (config as StickyRowsConfig | undefined) ?? { isSticky: () => false };\n return new StickyRowsPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"sticky-rows.js","names":["StickyRowsPlugin","registerFeature","config","isSticky"],"sources":["../../../../../libs/grid/src/lib/features/sticky-rows.ts"],"sourcesContent":["/**\n * Sticky Rows feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/sticky-rows';\n *\n * grid.gridConfig = { features: { stickyRows: { isSticky: 'isSection' } } };\n * ```\n */\n\nimport { StickyRowsPlugin, type StickyRowsConfig } from '../plugins/sticky-rows';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Pin selected data rows below the header as the user scrolls past them. */\n stickyRows?: StickyRowsConfig;\n }\n}\n\nregisterFeature('stickyRows', (config) => {\n // `stickyRows` requires an `isSticky` value — `boolean` shorthand is not\n // meaningful. The TS type prevents `true`/`false` callers from compiling;\n // at runtime we coerce to a no-op predicate for safety.\n const options = (config as StickyRowsConfig | undefined) ?? { isSticky: () => false };\n return new StickyRowsPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"2B,oHAqBAC,EAAgB,aAAeC,GAKtB,IAAIF,EADME,GAA2C,CAAEC,SAAA,KAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/tooltip.ts"],"sourcesContent":["/**\n * Tooltip feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/tooltip';\n *\n * grid.gridConfig = { features: { tooltip: true } };\n * ```\n */\n\nimport { TooltipPlugin, type TooltipConfig } from '../plugins/tooltip';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable automatic overflow tooltips on headers and cells. */\n tooltip?: boolean | TooltipConfig;\n }\n}\n\nregisterFeature('tooltip', (config) => {\n if (config === true) return new TooltipPlugin();\n return new TooltipPlugin((config as TooltipConfig) ?? undefined);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"tooltip.js","names":["TooltipPlugin","registerFeature","config"],"sources":["../../../../../libs/grid/src/lib/features/tooltip.ts"],"sourcesContent":["/**\n * Tooltip feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/tooltip';\n *\n * grid.gridConfig = { features: { tooltip: true } };\n * ```\n */\n\nimport { TooltipPlugin, type TooltipConfig } from '../plugins/tooltip';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable automatic overflow tooltips on headers and cells. */\n tooltip?: boolean | TooltipConfig;\n }\n}\n\nregisterFeature('tooltip', (config) => {\n if (config === true) return new TooltipPlugin();\n return new TooltipPlugin((config as TooltipConfig) ?? undefined);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"wB,gHAqBAC,EAAgB,UAAYC,IACX,IAAXA,EAAwB,IAAIF,EACzB,IAAIA,EAAeE,QAA4B"}
|
package/lib/features/tree.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/tree.ts"],"sourcesContent":["/**\n * Tree feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/tree';\n *\n * grid.gridConfig = { features: { tree: true } };\n * ```\n */\n\nimport { TreePlugin, type TreeConfig } from '../plugins/tree';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable tree (hierarchical) data display with expand/collapse. */\n tree?: boolean | TreeConfig;\n }\n}\n\nregisterFeature('tree', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as TreeConfig) ?? {});\n return new TreePlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"tree.js","names":["TreePlugin","registerFeature","config"],"sources":["../../../../../libs/grid/src/lib/features/tree.ts"],"sourcesContent":["/**\n * Tree feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/tree';\n *\n * grid.gridConfig = { features: { tree: true } };\n * ```\n */\n\nimport { TreePlugin, type TreeConfig } from '../plugins/tree';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable tree (hierarchical) data display with expand/collapse. */\n tree?: boolean | TreeConfig;\n }\n}\n\nregisterFeature('tree', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as TreeConfig) ?? {});\n return new TreePlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"qB,6GAqBAC,EAAgB,OAASC,GAEhB,IAAIF,EADuB,kBAAXE,EAAuB,CAAC,EAAMA,GAAyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"undo-redo.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/undo-redo.ts"],"sourcesContent":["/**\n * Undo/Redo feature for @toolbox-web/grid\n *\n * Requires the `editing` feature to be enabled.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/undo-redo';\n *\n * grid.gridConfig = { features: { editing: true, undoRedo: true } };\n * ```\n */\n\nimport { UndoRedoPlugin, type UndoRedoConfig } from '../plugins/undo-redo';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable undo/redo for cell edits. Requires `editing`. */\n undoRedo?: boolean | UndoRedoConfig;\n }\n}\n\nregisterFeature('undoRedo', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as UndoRedoConfig) ?? {});\n return new UndoRedoPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"undo-redo.js","names":["UndoRedoPlugin","registerFeature","config"],"sources":["../../../../../libs/grid/src/lib/features/undo-redo.ts"],"sourcesContent":["/**\n * Undo/Redo feature for @toolbox-web/grid\n *\n * Requires the `editing` feature to be enabled.\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/undo-redo';\n *\n * grid.gridConfig = { features: { editing: true, undoRedo: true } };\n * ```\n */\n\nimport { UndoRedoPlugin, type UndoRedoConfig } from '../plugins/undo-redo';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable undo/redo for cell edits. Requires `editing`. */\n undoRedo?: boolean | UndoRedoConfig;\n }\n}\n\nregisterFeature('undoRedo', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as UndoRedoConfig) ?? {});\n return new UndoRedoPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"yB,kHAuBAC,EAAgB,WAAaC,GAEpB,IAAIF,EADuB,kBAAXE,EAAuB,CAAC,EAAMA,GAA6B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visibility.js","names":[],"sources":["../../../../../libs/grid/src/lib/features/visibility.ts"],"sourcesContent":["/**\n * Column Visibility feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/visibility';\n *\n * grid.gridConfig = { features: { visibility: true } };\n * ```\n */\n\nimport { VisibilityPlugin, type VisibilityConfig } from '../plugins/visibility';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable column visibility toggling. */\n visibility?: boolean | VisibilityConfig;\n }\n}\n\nregisterFeature('visibility', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as VisibilityConfig) ?? {});\n return new VisibilityPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"visibility.js","names":["VisibilityPlugin","registerFeature","config"],"sources":["../../../../../libs/grid/src/lib/features/visibility.ts"],"sourcesContent":["/**\n * Column Visibility feature for @toolbox-web/grid\n *\n * @example\n * ```typescript\n * import '@toolbox-web/grid/features/visibility';\n *\n * grid.gridConfig = { features: { visibility: true } };\n * ```\n */\n\nimport { VisibilityPlugin, type VisibilityConfig } from '../plugins/visibility';\nimport { registerFeature } from './registry';\n\ndeclare module '../core/types' {\n interface FeatureConfig {\n /** Enable column visibility toggling. */\n visibility?: boolean | VisibilityConfig;\n }\n}\n\nregisterFeature('visibility', (config) => {\n const options = typeof config === 'boolean' ? {} : ((config as VisibilityConfig) ?? {});\n return new VisibilityPlugin(options);\n});\n\n/** @internal Type anchor — forces bundlers to preserve this module's FeatureConfig augmentation when re-exported. */\nexport type _Augmentation = true;\n"],"mappings":"2B,mHAqBAC,EAAgB,aAAeC,GAEtB,IAAIF,EADuB,kBAAXE,EAAuB,CAAC,EAAMA,GAA+B,CAAC"}
|