@toolbox-web/grid 2.13.1 → 2.14.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.
Files changed (48) hide show
  1. package/all.js +2 -2
  2. package/all.js.map +1 -1
  3. package/custom-elements.json +18 -0
  4. package/index.js +1 -1
  5. package/index.js.map +1 -1
  6. package/lib/core/grid.d.ts +23 -0
  7. package/lib/core/internal/style-injector.d.ts +0 -8
  8. package/lib/features/registry.js +1 -1
  9. package/lib/features/registry.js.map +1 -1
  10. package/lib/plugins/filtering/index.js +1 -1
  11. package/lib/plugins/filtering/index.js.map +1 -1
  12. package/lib/plugins/filtering/types.d.ts +0 -28
  13. package/lib/plugins/master-detail/MasterDetailPlugin.d.ts +0 -1
  14. package/lib/plugins/master-detail/index.js +1 -1
  15. package/lib/plugins/master-detail/index.js.map +1 -1
  16. package/lib/plugins/master-detail/types.d.ts +0 -2
  17. package/lib/plugins/responsive/index.js +1 -1
  18. package/lib/plugins/responsive/index.js.map +1 -1
  19. package/lib/plugins/responsive/types.d.ts +11 -2
  20. package/lib/plugins/server-side/datasource-types.d.ts +8 -0
  21. package/lib/plugins/server-side/index.js +1 -1
  22. package/lib/plugins/server-side/index.js.map +1 -1
  23. package/lib/plugins/server-side/types.d.ts +9 -10
  24. package/lib/plugins/visibility/index.js +1 -1
  25. package/lib/plugins/visibility/index.js.map +1 -1
  26. package/lib/plugins/visibility/types.d.ts +5 -10
  27. package/lib/plugins/visibility/visibility.d.ts +5 -3
  28. package/package.json +1 -1
  29. package/themes/dg-theme-bootstrap.css +2 -2
  30. package/themes/dg-theme-contrast.css +1 -1
  31. package/themes/dg-theme-large.css +1 -1
  32. package/themes/dg-theme-material.css +2 -2
  33. package/themes/dg-theme-standard.css +1 -1
  34. package/themes/dg-theme-vibrant.css +1 -1
  35. package/umd/grid.all.umd.js +1 -1
  36. package/umd/grid.all.umd.js.map +1 -1
  37. package/umd/grid.umd.js +1 -1
  38. package/umd/grid.umd.js.map +1 -1
  39. package/umd/plugins/filtering.umd.js +1 -1
  40. package/umd/plugins/filtering.umd.js.map +1 -1
  41. package/umd/plugins/master-detail.umd.js +1 -1
  42. package/umd/plugins/master-detail.umd.js.map +1 -1
  43. package/umd/plugins/responsive.umd.js +1 -1
  44. package/umd/plugins/responsive.umd.js.map +1 -1
  45. package/umd/plugins/server-side.umd.js +1 -1
  46. package/umd/plugins/server-side.umd.js.map +1 -1
  47. package/umd/plugins/visibility.umd.js +1 -1
  48. package/umd/plugins/visibility.umd.js.map +1 -1
@@ -9,19 +9,14 @@
9
9
  * Controls the visibility sidebar panel that lets users show/hide individual columns.
10
10
  * The sidebar is toggled via a button in the grid toolbar or programmatically.
11
11
  *
12
- * @example
13
- * ```typescript
14
- * new VisibilityPlugin({ allowHideAll: false })
15
- * ```
12
+ * Currently has no configurable options — reserved as an extension point for
13
+ * future flags (e.g. default open state, panel title). The grid always keeps
14
+ * at least one column visible; columns flagged with `lockVisible: true` are
15
+ * un-hideable individually.
16
+ *
16
17
  * @since 0.1.1
17
18
  */
18
19
  export interface VisibilityConfig {
19
- /**
20
- * Whether users are allowed to hide every column.
21
- * When `false`, the last visible column's toggle is disabled to prevent an empty grid.
22
- * @default false
23
- */
24
- allowHideAll?: boolean;
25
20
  }
26
21
  /** Internal state managed by the visibility plugin */
27
22
  export interface VisibilityState {
@@ -9,15 +9,17 @@ import { ColumnConfig } from '../../core/types';
9
9
  export declare function filterVisibleColumns<TRow = unknown>(columns: ColumnConfig<TRow>[], hidden: Set<string>): ColumnConfig<TRow>[];
10
10
  /**
11
11
  * Check if a column can be hidden.
12
- * Respects lockVisible property and allowHideAll setting.
12
+ *
13
+ * Mirrors the invariant enforced by the grid core (`config-manager.setColumnVisible`):
14
+ * a column cannot be hidden if it is flagged `lockVisible`, or if hiding it would
15
+ * leave zero visible columns.
13
16
  *
14
17
  * @param columns - All column configurations
15
18
  * @param field - Field to check
16
19
  * @param hidden - Currently hidden field names
17
- * @param allowHideAll - Whether hiding all columns is allowed
18
20
  * @returns True if the column can be hidden
19
21
  */
20
- export declare function canHideColumn<TRow = unknown>(columns: ColumnConfig<TRow>[], field: string, hidden: Set<string>, allowHideAll: boolean): boolean;
22
+ export declare function canHideColumn<TRow = unknown>(columns: ColumnConfig<TRow>[], field: string, hidden: Set<string>): boolean;
21
23
  /**
22
24
  * Toggle column visibility state.
23
25
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolbox-web/grid",
3
- "version": "2.13.1",
3
+ "version": "2.14.1",
4
4
  "description": "Zero-dependency, framework-agnostic data grid web component with virtualization, sorting, filtering, editing, and 20+ plugins. Works in vanilla JS, React, Vue, Angular, and any framework.",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -4,7 +4,7 @@
4
4
  * https://getbootstrap.com/docs/5.3/content/tables/
5
5
  */
6
6
  @layer tbw-theme {
7
- tbw-grid {
7
+ [data-tbw-grid] {
8
8
  /* ========== Core Palette ========== */
9
9
  --tbw-color-bg: light-dark(#ffffff, #212529);
10
10
  --tbw-color-panel-bg: light-dark(#f8f9fa, #2b3035);
@@ -154,7 +154,7 @@
154
154
  }
155
155
  }
156
156
 
157
- tbw-grid,
157
+ [data-tbw-grid],
158
158
  .tbw-filter-panel {
159
159
  /* ========== Bootstrap 5 Checkboxes ========== */
160
160
  /* Matches Bootstrap's .form-check-input styling */
@@ -1,6 +1,6 @@
1
1
  /* High contrast accessibility-focused theme */
2
2
  @layer tbw-theme {
3
- tbw-grid {
3
+ [data-tbw-grid] {
4
4
  --tbw-color-bg: light-dark(#ffffff, #000000);
5
5
  --tbw-color-fg: light-dark(#000000, #ffffff);
6
6
  --tbw-color-fg-muted: light-dark(#222222, #dddddd);
@@ -10,7 +10,7 @@
10
10
  - Slightly higher contrast for muted fg & borders (within WCAG AA)
11
11
  */
12
12
  @layer tbw-theme {
13
- tbw-grid {
13
+ [data-tbw-grid] {
14
14
  /* Reuse core color tokens from standard theme with a few tweaks */
15
15
  --tbw-color-bg: light-dark(#ffffff, #1f2125);
16
16
  --tbw-color-fg: light-dark(#1b1e23, #e7e9ed); /* a bit darker/lighter */
@@ -5,7 +5,7 @@
5
5
  * https://m3.material.io/
6
6
  */
7
7
  @layer tbw-theme {
8
- tbw-grid {
8
+ [data-tbw-grid] {
9
9
  /* ========== Core Palette ========== */
10
10
  /* M3 surface colors with subtle tonal variation */
11
11
  --tbw-color-bg: light-dark(#fffbff, #1c1b1f);
@@ -180,7 +180,7 @@
180
180
  --tbw-editing-row-outline-width: 2px;
181
181
  }
182
182
 
183
- tbw-grid,
183
+ [data-tbw-grid],
184
184
  .tbw-filter-panel {
185
185
  /* ========== M3 Checkboxes ========== */
186
186
  /* Material Design 3 styled checkboxes for all grid & filter panel checkboxes */
@@ -4,7 +4,7 @@
4
4
  * Clean lines, subtle depth, and professional aesthetics.
5
5
  */
6
6
  @layer tbw-theme {
7
- tbw-grid {
7
+ [data-tbw-grid] {
8
8
  /* ========== Core Palette ========== */
9
9
  --tbw-color-bg: light-dark(#ffffff, #1a1c20);
10
10
  --tbw-color-panel-bg: light-dark(#f8f9fa, #232528);
@@ -4,7 +4,7 @@
4
4
  * Features subtle gradients, glowing accents, and polished transitions.
5
5
  */
6
6
  @layer tbw-theme {
7
- tbw-grid {
7
+ [data-tbw-grid] {
8
8
  /* ========== Core Palette ========== */
9
9
  --tbw-color-bg: light-dark(#fafaff, #12141c);
10
10
  --tbw-color-panel-bg: light-dark(#f0f0ff, #1a1d28);