@zengrid/core 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/dist/index.cjs.js +17116 -16303
  2. package/dist/index.esm.js +17090 -16303
  3. package/dist/package.json +1 -1
  4. package/dist/src/editing/datetime/date-editor/date-editor.d.ts +1 -0
  5. package/dist/src/editing/datetime/date-editor/date-editor.d.ts.map +1 -1
  6. package/dist/src/editing/datetime/date-range-editor/date-range-calendar.d.ts.map +1 -1
  7. package/dist/src/editing/datetime/date-range-editor/date-range-dom.d.ts.map +1 -1
  8. package/dist/src/editing/datetime/date-range-editor/date-range-validation.d.ts.map +1 -1
  9. package/dist/src/editing/datetime/date-range-editor/types.d.ts +0 -3
  10. package/dist/src/editing/datetime/date-range-editor/types.d.ts.map +1 -1
  11. package/dist/src/events/grid-events.d.ts +1 -0
  12. package/dist/src/events/grid-events.d.ts.map +1 -1
  13. package/dist/src/features/column-drag/column-drag.styles.css +8 -18
  14. package/dist/src/features/column-drag/drop-zone-detector.d.ts.map +1 -1
  15. package/dist/src/features/column-resize/column-resize.styles.css +5 -4
  16. package/dist/src/features/column-resize/programmatic-operations.d.ts +1 -1
  17. package/dist/src/features/column-resize/programmatic-operations.d.ts.map +1 -1
  18. package/dist/src/features/loading/loading.styles.css +19 -90
  19. package/dist/src/features/pagination/pagination.styles.css +34 -74
  20. package/dist/src/grid/api/column-api.d.ts +23 -0
  21. package/dist/src/grid/api/column-api.d.ts.map +1 -0
  22. package/dist/src/grid/api/export-api.d.ts +9 -0
  23. package/dist/src/grid/api/export-api.d.ts.map +1 -0
  24. package/dist/src/grid/api/filter-api.d.ts +24 -0
  25. package/dist/src/grid/api/filter-api.d.ts.map +1 -0
  26. package/dist/src/grid/api/index.d.ts +15 -0
  27. package/dist/src/grid/api/index.d.ts.map +1 -0
  28. package/dist/src/grid/api/pagination-api.d.ts +14 -0
  29. package/dist/src/grid/api/pagination-api.d.ts.map +1 -0
  30. package/dist/src/grid/api/scroll-api.d.ts +26 -0
  31. package/dist/src/grid/api/scroll-api.d.ts.map +1 -0
  32. package/dist/src/grid/api/sort-api.d.ts +17 -0
  33. package/dist/src/grid/api/sort-api.d.ts.map +1 -0
  34. package/dist/src/grid/api/state-api.d.ts +10 -0
  35. package/dist/src/grid/api/state-api.d.ts.map +1 -0
  36. package/dist/src/grid/grid-api.d.ts +0 -3
  37. package/dist/src/grid/grid-api.d.ts.map +1 -1
  38. package/dist/src/grid/grid-context.d.ts +5 -29
  39. package/dist/src/grid/grid-context.d.ts.map +1 -1
  40. package/dist/src/grid/grid-core.d.ts +83 -95
  41. package/dist/src/grid/grid-core.d.ts.map +1 -1
  42. package/dist/src/grid/grid-setup.d.ts +3 -3
  43. package/dist/src/grid/grid-setup.d.ts.map +1 -1
  44. package/dist/src/grid/grid-theme-methods.d.ts +17 -0
  45. package/dist/src/grid/grid-theme-methods.d.ts.map +1 -0
  46. package/dist/src/grid/index.d.ts +5 -10
  47. package/dist/src/grid/index.d.ts.map +1 -1
  48. package/dist/src/index.d.ts +21 -3
  49. package/dist/src/index.d.ts.map +1 -1
  50. package/dist/src/plugins/async-filter-plugin.d.ts.map +1 -1
  51. package/dist/src/plugins/async-sort-plugin.d.ts.map +1 -1
  52. package/dist/src/plugins/column/column-plugin.d.ts +18 -0
  53. package/dist/src/plugins/column/column-plugin.d.ts.map +1 -0
  54. package/dist/src/{grid → plugins/column}/grid-state.d.ts +2 -2
  55. package/dist/src/plugins/column/grid-state.d.ts.map +1 -0
  56. package/dist/src/plugins/column/index.d.ts +3 -0
  57. package/dist/src/plugins/column/index.d.ts.map +1 -0
  58. package/dist/src/plugins/dom/dom-plugin.d.ts +14 -0
  59. package/dist/src/plugins/dom/dom-plugin.d.ts.map +1 -0
  60. package/dist/src/plugins/dom/index.d.ts +3 -0
  61. package/dist/src/plugins/dom/index.d.ts.map +1 -0
  62. package/dist/src/plugins/editing/editing-plugin.d.ts +11 -12
  63. package/dist/src/plugins/editing/editing-plugin.d.ts.map +1 -1
  64. package/dist/src/plugins/filter-plugin.d.ts.map +1 -1
  65. package/dist/src/{grid → plugins/header}/header-dom-operations.d.ts +3 -3
  66. package/dist/src/plugins/header/header-dom-operations.d.ts.map +1 -0
  67. package/dist/src/{grid → plugins/header}/header-event-handlers.d.ts +3 -3
  68. package/dist/src/plugins/header/header-event-handlers.d.ts.map +1 -0
  69. package/dist/src/plugins/header/header-plugin.d.ts +18 -0
  70. package/dist/src/plugins/header/header-plugin.d.ts.map +1 -0
  71. package/dist/src/{grid → plugins/header}/header-reactive-subscription.d.ts +1 -1
  72. package/dist/src/plugins/header/header-reactive-subscription.d.ts.map +1 -0
  73. package/dist/src/{grid → plugins/header}/header-registry-setup.d.ts +1 -1
  74. package/dist/src/plugins/header/header-registry-setup.d.ts.map +1 -0
  75. package/dist/src/{grid → plugins/header}/header-render-params.d.ts +4 -4
  76. package/dist/src/plugins/header/header-render-params.d.ts.map +1 -0
  77. package/dist/src/{grid → plugins/header}/header-rendering.d.ts +2 -2
  78. package/dist/src/plugins/header/header-rendering.d.ts.map +1 -0
  79. package/dist/src/{grid → plugins/header}/header-types.d.ts +5 -5
  80. package/dist/src/plugins/header/header-types.d.ts.map +1 -0
  81. package/dist/src/plugins/header/index.d.ts +3 -0
  82. package/dist/src/plugins/header/index.d.ts.map +1 -0
  83. package/dist/src/plugins/index.d.ts +12 -1
  84. package/dist/src/plugins/index.d.ts.map +1 -1
  85. package/dist/src/plugins/infinite-scroll/infinite-scroll-plugin.d.ts +4 -2
  86. package/dist/src/plugins/infinite-scroll/infinite-scroll-plugin.d.ts.map +1 -1
  87. package/dist/src/plugins/legacy-bridge/devtools-connector.d.ts.map +1 -1
  88. package/dist/src/plugins/legacy-bridge/index.d.ts +0 -1
  89. package/dist/src/plugins/legacy-bridge/index.d.ts.map +1 -1
  90. package/dist/src/plugins/lifecycle/index.d.ts +3 -0
  91. package/dist/src/plugins/lifecycle/index.d.ts.map +1 -0
  92. package/dist/src/plugins/lifecycle/lifecycle-plugin.d.ts +16 -0
  93. package/dist/src/plugins/lifecycle/lifecycle-plugin.d.ts.map +1 -0
  94. package/dist/src/plugins/pagination/index.d.ts +3 -0
  95. package/dist/src/plugins/pagination/index.d.ts.map +1 -0
  96. package/dist/src/plugins/pagination/pagination-plugin.d.ts +13 -0
  97. package/dist/src/plugins/pagination/pagination-plugin.d.ts.map +1 -0
  98. package/dist/src/plugins/rendering/index.d.ts +3 -0
  99. package/dist/src/plugins/rendering/index.d.ts.map +1 -0
  100. package/dist/src/plugins/rendering/rendering-plugin.d.ts +22 -0
  101. package/dist/src/plugins/rendering/rendering-plugin.d.ts.map +1 -0
  102. package/dist/src/plugins/resize/resize-plugin.d.ts.map +1 -1
  103. package/dist/src/plugins/scroll/scroll-plugin.d.ts.map +1 -1
  104. package/dist/src/plugins/selection/selection-plugin.d.ts.map +1 -1
  105. package/dist/src/plugins/sort-plugin.d.ts.map +1 -1
  106. package/dist/src/reactive/debug.d.ts +3 -0
  107. package/dist/src/reactive/debug.d.ts.map +1 -1
  108. package/dist/src/reactive/store.d.ts +3 -1
  109. package/dist/src/reactive/store.d.ts.map +1 -1
  110. package/dist/src/reactive/types.d.ts +5 -2
  111. package/dist/src/reactive/types.d.ts.map +1 -1
  112. package/dist/src/rendering/cache/renderer-cache.d.ts +4 -0
  113. package/dist/src/rendering/cache/renderer-cache.d.ts.map +1 -1
  114. package/dist/src/rendering/cell-positioner/cell-positioner.d.ts +5 -0
  115. package/dist/src/rendering/cell-positioner/cell-positioner.d.ts.map +1 -1
  116. package/dist/src/rendering/cell-positioner/cell-positioner.interface.d.ts +9 -0
  117. package/dist/src/rendering/cell-positioner/cell-positioner.interface.d.ts.map +1 -1
  118. package/dist/src/rendering/headers/renderers/filterable-header-renderer.d.ts.map +1 -1
  119. package/dist/src/rendering/headers/renderers/sortable-header-renderer.d.ts.map +1 -1
  120. package/dist/src/rendering/renderers/button/button-renderer.d.ts.map +1 -1
  121. package/dist/src/rendering/renderers/chip/chip-renderer.d.ts.map +1 -1
  122. package/dist/src/rendering/renderers/date-range/date-range-renderer.d.ts.map +1 -1
  123. package/dist/src/rendering/renderers/datetime/date-renderer.d.ts.map +1 -1
  124. package/dist/src/rendering/renderers/dropdown/dropdown-renderer.d.ts.map +1 -1
  125. package/dist/src/rendering/virtual-scroller/virtual-scroller.d.ts +4 -0
  126. package/dist/src/rendering/virtual-scroller/virtual-scroller.d.ts.map +1 -1
  127. package/dist/src/rendering/width-provider/column-model-width-provider.d.ts +6 -7
  128. package/dist/src/rendering/width-provider/column-model-width-provider.d.ts.map +1 -1
  129. package/dist/src/styles/grid.css +362 -362
  130. package/dist/src/styles.css +94 -45
  131. package/dist/src/theming/color-utils.d.ts +10 -0
  132. package/dist/src/theming/color-utils.d.ts.map +1 -0
  133. package/dist/src/theming/index.d.ts +10 -0
  134. package/dist/src/theming/index.d.ts.map +1 -0
  135. package/dist/src/theming/theme-builder.d.ts +46 -0
  136. package/dist/src/theming/theme-builder.d.ts.map +1 -0
  137. package/dist/src/theming/theme-manager.d.ts +11 -0
  138. package/dist/src/theming/theme-manager.d.ts.map +1 -0
  139. package/dist/src/theming/theme-registry.d.ts +17 -0
  140. package/dist/src/theming/theme-registry.d.ts.map +1 -0
  141. package/dist/src/theming/theme.interface.d.ts +88 -0
  142. package/dist/src/theming/theme.interface.d.ts.map +1 -0
  143. package/dist/src/theming/themes/dark.d.ts +3 -0
  144. package/dist/src/theming/themes/dark.d.ts.map +1 -0
  145. package/dist/src/theming/themes/dracula.d.ts +3 -0
  146. package/dist/src/theming/themes/dracula.d.ts.map +1 -0
  147. package/dist/src/theming/themes/github.d.ts +3 -0
  148. package/dist/src/theming/themes/github.d.ts.map +1 -0
  149. package/dist/src/theming/themes/index.d.ts +14 -0
  150. package/dist/src/theming/themes/index.d.ts.map +1 -0
  151. package/dist/src/theming/themes/light.d.ts +3 -0
  152. package/dist/src/theming/themes/light.d.ts.map +1 -0
  153. package/dist/src/theming/themes/material.d.ts +3 -0
  154. package/dist/src/theming/themes/material.d.ts.map +1 -0
  155. package/dist/src/theming/themes/nord.d.ts +3 -0
  156. package/dist/src/theming/themes/nord.d.ts.map +1 -0
  157. package/dist/src/theming/themes/one-dark.d.ts +3 -0
  158. package/dist/src/theming/themes/one-dark.d.ts.map +1 -0
  159. package/dist/src/theming/themes/solarized.d.ts +3 -0
  160. package/dist/src/theming/themes/solarized.d.ts.map +1 -0
  161. package/dist/src/types/grid.d.ts +10 -0
  162. package/dist/src/types/grid.d.ts.map +1 -1
  163. package/package.json +2 -2
  164. package/dist/src/editing/date-range/calendar-manager.d.ts +0 -17
  165. package/dist/src/editing/date-range/calendar-manager.d.ts.map +0 -1
  166. package/dist/src/editing/date-range/event-handlers.d.ts +0 -30
  167. package/dist/src/editing/date-range/event-handlers.d.ts.map +0 -1
  168. package/dist/src/editing/date-range/formatters.d.ts +0 -26
  169. package/dist/src/editing/date-range/formatters.d.ts.map +0 -1
  170. package/dist/src/editing/date-range/positioning.d.ts +0 -14
  171. package/dist/src/editing/date-range/positioning.d.ts.map +0 -1
  172. package/dist/src/editing/date-range/types.d.ts +0 -41
  173. package/dist/src/editing/date-range/types.d.ts.map +0 -1
  174. package/dist/src/editing/date-range/ui-builder.d.ts +0 -33
  175. package/dist/src/editing/date-range/ui-builder.d.ts.map +0 -1
  176. package/dist/src/editing/date-range/validator.d.ts +0 -7
  177. package/dist/src/editing/date-range/validator.d.ts.map +0 -1
  178. package/dist/src/grid/data.d.ts +0 -74
  179. package/dist/src/grid/data.d.ts.map +0 -1
  180. package/dist/src/grid/dom.d.ts +0 -37
  181. package/dist/src/grid/dom.d.ts.map +0 -1
  182. package/dist/src/grid/drag.d.ts +0 -50
  183. package/dist/src/grid/drag.d.ts.map +0 -1
  184. package/dist/src/grid/grid-column-methods.d.ts +0 -37
  185. package/dist/src/grid/grid-column-methods.d.ts.map +0 -1
  186. package/dist/src/grid/grid-editing.d.ts +0 -43
  187. package/dist/src/grid/grid-editing.d.ts.map +0 -1
  188. package/dist/src/grid/grid-filter-methods.d.ts +0 -24
  189. package/dist/src/grid/grid-filter-methods.d.ts.map +0 -1
  190. package/dist/src/grid/grid-header-methods.d.ts +0 -10
  191. package/dist/src/grid/grid-header-methods.d.ts.map +0 -1
  192. package/dist/src/grid/grid-lifecycle.d.ts +0 -10
  193. package/dist/src/grid/grid-lifecycle.d.ts.map +0 -1
  194. package/dist/src/grid/grid-sort-methods.d.ts +0 -17
  195. package/dist/src/grid/grid-sort-methods.d.ts.map +0 -1
  196. package/dist/src/grid/grid-state.d.ts.map +0 -1
  197. package/dist/src/grid/grid-wiring.d.ts +0 -11
  198. package/dist/src/grid/grid-wiring.d.ts.map +0 -1
  199. package/dist/src/grid/header-dom-operations.d.ts.map +0 -1
  200. package/dist/src/grid/header-event-handlers.d.ts.map +0 -1
  201. package/dist/src/grid/header-manager.d.ts +0 -119
  202. package/dist/src/grid/header-manager.d.ts.map +0 -1
  203. package/dist/src/grid/header-reactive-subscription.d.ts.map +0 -1
  204. package/dist/src/grid/header-registry-setup.d.ts.map +0 -1
  205. package/dist/src/grid/header-render-params.d.ts.map +0 -1
  206. package/dist/src/grid/header-rendering.d.ts.map +0 -1
  207. package/dist/src/grid/header-types.d.ts.map +0 -1
  208. package/dist/src/grid/init.d.ts +0 -56
  209. package/dist/src/grid/init.d.ts.map +0 -1
  210. package/dist/src/grid/pagination.d.ts +0 -63
  211. package/dist/src/grid/pagination.d.ts.map +0 -1
  212. package/dist/src/grid/resize.d.ts +0 -87
  213. package/dist/src/grid/resize.d.ts.map +0 -1
  214. package/dist/src/grid/scroll.d.ts +0 -86
  215. package/dist/src/grid/scroll.d.ts.map +0 -1
  216. package/dist/src/plugins/legacy-bridge/legacy-api-plugin.d.ts +0 -3
  217. package/dist/src/plugins/legacy-bridge/legacy-api-plugin.d.ts.map +0 -1
  218. package/dist/src/rendering/renderers/date/date-renderer.d.ts +0 -156
  219. package/dist/src/rendering/renderers/date/date-renderer.d.ts.map +0 -1
  220. package/dist/src/rendering/renderers/date/index.d.ts +0 -3
  221. package/dist/src/rendering/renderers/date/index.d.ts.map +0 -1
@@ -1,362 +1,362 @@
1
- /**
2
- * ZenGrid Core Styles
3
- * Minimal, themeable CSS for the grid component
4
- */
5
-
6
- /* CSS Variables for theming */
7
- :root {
8
- /* Colors - Light Theme */
9
- --zg-bg-primary: #ffffff;
10
- --zg-bg-secondary: #f5f5f5;
11
- --zg-bg-hover: #f0f4f8;
12
- --zg-bg-selected: #e3f2fd;
13
- --zg-bg-active: #ffffff;
14
- --zg-bg-editing: #ffffff;
15
-
16
- --zg-border-color: #e0e0e0;
17
- --zg-border-active: #2196f3;
18
- --zg-border-editing: #4caf50;
19
- --zg-border-selected: #2196f3;
20
-
21
- --zg-text-primary: #333333;
22
- --zg-text-secondary: #666666;
23
- --zg-text-disabled: #999999;
24
-
25
- /* Focus ring */
26
- --zg-focus-ring: 2px solid #2196f3;
27
- --zg-focus-offset: 2px;
28
-
29
- /* Spacing */
30
- --zg-cell-padding-x: 8px;
31
- --zg-cell-padding-y: 0;
32
-
33
- /* Typography */
34
- --zg-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
35
- --zg-font-size: 14px;
36
- --zg-line-height: 1.5;
37
-
38
- /* Shadows */
39
- --zg-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
40
- --zg-shadow-md: 0 2px 4px rgba(0, 0, 0, 0.1);
41
- --zg-shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.15);
42
-
43
- /* Transitions */
44
- --zg-transition-fast: 0.1s ease;
45
- --zg-transition-normal: 0.2s ease;
46
- }
47
-
48
- /* Dark theme */
49
- [data-theme="dark"] {
50
- --zg-bg-primary: #1e1e1e;
51
- --zg-bg-secondary: #2d2d2d;
52
- --zg-bg-hover: #3a3a3a;
53
- --zg-bg-selected: #1a3a52;
54
- --zg-bg-active: #1e1e1e;
55
- --zg-bg-editing: #1e1e1e;
56
-
57
- --zg-border-color: #404040;
58
- --zg-border-active: #42a5f5;
59
- --zg-border-editing: #66bb6a;
60
- --zg-border-selected: #42a5f5;
61
-
62
- --zg-text-primary: #e0e0e0;
63
- --zg-text-secondary: #b0b0b0;
64
- --zg-text-disabled: #707070;
65
- }
66
-
67
- /* Grid container */
68
- .zg-grid {
69
- position: relative;
70
- width: 100%;
71
- height: 100%;
72
- background: var(--zg-bg-primary);
73
- font-family: var(--zg-font-family);
74
- font-size: var(--zg-font-size);
75
- line-height: var(--zg-line-height);
76
- color: var(--zg-text-primary);
77
- overflow: hidden;
78
- user-select: none;
79
- -webkit-user-select: none;
80
- }
81
-
82
- /* Viewport */
83
- .zg-viewport {
84
- position: relative;
85
- width: 100%;
86
- height: 100%;
87
- overflow: hidden;
88
- }
89
-
90
- /* Scroll container */
91
- .zg-scroll-container {
92
- position: absolute;
93
- top: 0;
94
- left: 0;
95
- right: 0;
96
- bottom: 0;
97
- overflow: auto;
98
- scrollbar-width: thin;
99
- scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
100
- }
101
-
102
- .zg-scroll-container::-webkit-scrollbar {
103
- width: 12px;
104
- height: 12px;
105
- }
106
-
107
- .zg-scroll-container::-webkit-scrollbar-track {
108
- background: transparent;
109
- }
110
-
111
- .zg-scroll-container::-webkit-scrollbar-thumb {
112
- background: rgba(0, 0, 0, 0.3);
113
- border-radius: 6px;
114
- border: 2px solid transparent;
115
- background-clip: content-box;
116
- }
117
-
118
- .zg-scroll-container::-webkit-scrollbar-thumb:hover {
119
- background: rgba(0, 0, 0, 0.5);
120
- background-clip: content-box;
121
- }
122
-
123
- /* Canvas (scroll area) */
124
- .zg-canvas {
125
- position: relative;
126
- pointer-events: none;
127
- }
128
-
129
- /* Cells container */
130
- .zg-cells {
131
- position: absolute;
132
- top: 0;
133
- left: 0;
134
- pointer-events: auto;
135
- }
136
-
137
- /* Cell base styles */
138
- .zg-cell {
139
- position: absolute;
140
- box-sizing: border-box;
141
- /* Use box-shadow instead of border for consistent rendering at fractional devicePixelRatio */
142
- /* Borders render inconsistently at 125%/150% Windows scaling due to sub-pixel rounding */
143
- box-shadow:
144
- inset -1px 0 0 0 var(--zg-border-color),
145
- inset 0 -1px 0 0 var(--zg-border-color);
146
- padding: var(--zg-cell-padding-y) var(--zg-cell-padding-x);
147
- display: flex;
148
- align-items: center;
149
- background: var(--zg-bg-primary);
150
- color: var(--zg-text-primary);
151
- overflow: hidden;
152
- white-space: nowrap;
153
- text-overflow: ellipsis;
154
- transition: background-color var(--zg-transition-fast);
155
- cursor: default;
156
- }
157
-
158
- /* Cell states */
159
- .zg-cell:hover {
160
- background: var(--zg-bg-hover);
161
- }
162
-
163
- .zg-cell-selected {
164
- background: var(--zg-bg-selected) !important;
165
- box-shadow:
166
- inset -1px 0 0 0 var(--zg-border-selected),
167
- inset 0 -1px 0 0 var(--zg-border-selected) !important;
168
- }
169
-
170
- .zg-cell-active {
171
- box-shadow: inset 0 0 0 2px var(--zg-border-active) !important;
172
- background: var(--zg-bg-active) !important;
173
- z-index: 2;
174
- }
175
-
176
- .zg-cell-editing {
177
- background: var(--zg-bg-editing) !important;
178
- box-shadow: inset 0 0 0 2px var(--zg-border-editing) !important;
179
- z-index: 3;
180
- }
181
-
182
- .zg-cell-readonly {
183
- background: var(--zg-bg-secondary);
184
- color: var(--zg-text-secondary);
185
- cursor: not-allowed;
186
- }
187
-
188
- .zg-cell-disabled {
189
- color: var(--zg-text-disabled);
190
- cursor: not-allowed;
191
- opacity: 0.6;
192
- }
193
-
194
- /* Cell alignment */
195
- .zg-cell-align-left {
196
- justify-content: flex-start;
197
- text-align: left;
198
- }
199
-
200
- .zg-cell-align-center {
201
- justify-content: center;
202
- text-align: center;
203
- }
204
-
205
- .zg-cell-align-right {
206
- justify-content: flex-end;
207
- text-align: right;
208
- }
209
-
210
- /* Cell types */
211
- .zg-cell-number {
212
- justify-content: flex-end;
213
- text-align: right;
214
- font-variant-numeric: tabular-nums;
215
- }
216
-
217
- .zg-cell-boolean {
218
- justify-content: center;
219
- }
220
-
221
- .zg-cell-date {
222
- font-variant-numeric: tabular-nums;
223
- }
224
-
225
- /* Header cells */
226
- .zg-header-cell {
227
- background: var(--zg-bg-secondary);
228
- font-weight: 600;
229
- border-bottom: 2px solid var(--zg-border-color);
230
- position: sticky;
231
- top: 0;
232
- z-index: 10;
233
- }
234
-
235
- .zg-header-cell:hover {
236
- background: var(--zg-bg-hover);
237
- }
238
-
239
- /* Row header */
240
- .zg-row-header {
241
- background: var(--zg-bg-secondary);
242
- font-weight: 500;
243
- text-align: center;
244
- border-right: 2px solid var(--zg-border-color);
245
- position: sticky;
246
- left: 0;
247
- z-index: 9;
248
- }
249
-
250
- /* Focus ring (keyboard navigation) */
251
- .zg-cell:focus,
252
- .zg-cell:focus-visible {
253
- outline: var(--zg-focus-ring);
254
- outline-offset: calc(-1 * var(--zg-focus-offset));
255
- z-index: 4;
256
- }
257
-
258
- /* Selection highlight overlay */
259
- .zg-selection-overlay {
260
- position: absolute;
261
- pointer-events: none;
262
- border: 2px solid var(--zg-border-selected);
263
- background: var(--zg-bg-selected);
264
- opacity: 0.3;
265
- z-index: 1;
266
- }
267
-
268
- /* Loading state */
269
- .zg-grid.is-loading {
270
- cursor: wait;
271
- opacity: 0.7;
272
- }
273
-
274
- .zg-grid.is-loading::after {
275
- content: '';
276
- position: absolute;
277
- top: 50%;
278
- left: 50%;
279
- width: 40px;
280
- height: 40px;
281
- margin: -20px 0 0 -20px;
282
- border: 4px solid var(--zg-border-color);
283
- border-top-color: var(--zg-border-active);
284
- border-radius: 50%;
285
- animation: zg-spin 0.8s linear infinite;
286
- }
287
-
288
- @keyframes zg-spin {
289
- to { transform: rotate(360deg); }
290
- }
291
-
292
- /* RTL support */
293
- [dir="rtl"] .zg-grid {
294
- direction: rtl;
295
- }
296
-
297
- [dir="rtl"] .zg-cell {
298
- box-shadow:
299
- inset 1px 0 0 0 var(--zg-border-color),
300
- inset 0 -1px 0 0 var(--zg-border-color);
301
- }
302
-
303
- [dir="rtl"] .zg-cell-number {
304
- justify-content: flex-start;
305
- text-align: left;
306
- }
307
-
308
- [dir="rtl"] .zg-row-header {
309
- left: auto;
310
- right: 0;
311
- border-right: none;
312
- border-left: 2px solid var(--zg-border-color);
313
- }
314
-
315
- /* Print styles */
316
- @media print {
317
- .zg-scroll-container {
318
- overflow: visible !important;
319
- }
320
-
321
- .zg-cell {
322
- page-break-inside: avoid;
323
- }
324
-
325
- .zg-grid {
326
- background: white !important;
327
- }
328
- }
329
-
330
- /* High contrast mode */
331
- @media (prefers-contrast: high) {
332
- .zg-cell {
333
- border-width: 2px;
334
- }
335
-
336
- .zg-cell-active,
337
- .zg-cell-editing {
338
- border-width: 3px;
339
- }
340
- }
341
-
342
- /* Reduced motion */
343
- @media (prefers-reduced-motion: reduce) {
344
- .zg-cell,
345
- .zg-grid::after {
346
- transition: none !important;
347
- animation: none !important;
348
- }
349
- }
350
-
351
- /* Accessibility - Screen reader only */
352
- .zg-sr-only {
353
- position: absolute;
354
- width: 1px;
355
- height: 1px;
356
- padding: 0;
357
- margin: -1px;
358
- overflow: hidden;
359
- clip: rect(0, 0, 0, 0);
360
- white-space: nowrap;
361
- border-width: 0;
362
- }
1
+ /**
2
+ * ZenGrid Core Styles
3
+ * Minimal, themeable CSS for the grid component
4
+ */
5
+
6
+ /* CSS Variables for theming */
7
+ :root {
8
+ /* Colors - Light Theme */
9
+ --zg-bg-primary: #ffffff;
10
+ --zg-bg-secondary: #f5f5f5;
11
+ --zg-bg-hover: #f0f4f8;
12
+ --zg-bg-selected: #e3f2fd;
13
+ --zg-bg-active: #ffffff;
14
+ --zg-bg-editing: #ffffff;
15
+
16
+ --zg-border-color: #e0e0e0;
17
+ --zg-border-active: #2196f3;
18
+ --zg-border-editing: #4caf50;
19
+ --zg-border-selected: #2196f3;
20
+
21
+ --zg-text-primary: #333333;
22
+ --zg-text-secondary: #666666;
23
+ --zg-text-disabled: #999999;
24
+
25
+ /* Focus ring */
26
+ --zg-focus-ring: 2px solid #2196f3;
27
+ --zg-focus-offset: 2px;
28
+
29
+ /* Spacing */
30
+ --zg-cell-padding-x: 8px;
31
+ --zg-cell-padding-y: 0;
32
+
33
+ /* Typography */
34
+ --zg-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
35
+ --zg-font-size: 14px;
36
+ --zg-line-height: 1.5;
37
+
38
+ /* Shadows */
39
+ --zg-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
40
+ --zg-shadow-md: 0 2px 4px rgba(0, 0, 0, 0.1);
41
+ --zg-shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.15);
42
+
43
+ /* Transitions */
44
+ --zg-transition-fast: 0.1s ease;
45
+ --zg-transition-normal: 0.2s ease;
46
+ }
47
+
48
+ /* Dark theme — Slate/Emerald palette (matches zengrid.dev) */
49
+ [data-theme="dark"] {
50
+ --zg-bg-primary: #0f172a; /* Slate 900 */
51
+ --zg-bg-secondary: #1e293b; /* Slate 800 */
52
+ --zg-bg-hover: #334155; /* Slate 700 */
53
+ --zg-bg-selected: #064e3b; /* Emerald 900 */
54
+ --zg-bg-active: #0f172a; /* Slate 900 */
55
+ --zg-bg-editing: #0f172a; /* Slate 900 */
56
+
57
+ --zg-border-color: #1e293b; /* Slate 800 */
58
+ --zg-border-active: #10b981; /* Emerald 500 */
59
+ --zg-border-editing: #34d399; /* Emerald 400 */
60
+ --zg-border-selected: #10b981; /* Emerald 500 */
61
+
62
+ --zg-text-primary: #f8fafc; /* Slate 50 */
63
+ --zg-text-secondary: #94a3b8; /* Slate 400 */
64
+ --zg-text-disabled: #475569; /* Slate 600 */
65
+ }
66
+
67
+ /* Grid container */
68
+ .zg-grid {
69
+ position: relative;
70
+ width: 100%;
71
+ height: 100%;
72
+ background: var(--zg-bg-primary);
73
+ font-family: var(--zg-font-family);
74
+ font-size: var(--zg-font-size);
75
+ line-height: var(--zg-line-height);
76
+ color: var(--zg-text-primary);
77
+ overflow: hidden;
78
+ user-select: none;
79
+ -webkit-user-select: none;
80
+ }
81
+
82
+ /* Viewport */
83
+ .zg-viewport {
84
+ position: relative;
85
+ width: 100%;
86
+ height: 100%;
87
+ overflow: hidden;
88
+ }
89
+
90
+ /* Scroll container */
91
+ .zg-scroll-container {
92
+ position: absolute;
93
+ top: 0;
94
+ left: 0;
95
+ right: 0;
96
+ bottom: 0;
97
+ overflow: auto;
98
+ scrollbar-width: thin;
99
+ scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
100
+ }
101
+
102
+ .zg-scroll-container::-webkit-scrollbar {
103
+ width: 12px;
104
+ height: 12px;
105
+ }
106
+
107
+ .zg-scroll-container::-webkit-scrollbar-track {
108
+ background: transparent;
109
+ }
110
+
111
+ .zg-scroll-container::-webkit-scrollbar-thumb {
112
+ background: rgba(0, 0, 0, 0.3);
113
+ border-radius: 6px;
114
+ border: 2px solid transparent;
115
+ background-clip: content-box;
116
+ }
117
+
118
+ .zg-scroll-container::-webkit-scrollbar-thumb:hover {
119
+ background: rgba(0, 0, 0, 0.5);
120
+ background-clip: content-box;
121
+ }
122
+
123
+ /* Canvas (scroll area) */
124
+ .zg-canvas {
125
+ position: relative;
126
+ pointer-events: none;
127
+ }
128
+
129
+ /* Cells container */
130
+ .zg-cells {
131
+ position: absolute;
132
+ top: 0;
133
+ left: 0;
134
+ pointer-events: auto;
135
+ }
136
+
137
+ /* Cell base styles */
138
+ .zg-cell {
139
+ position: absolute;
140
+ box-sizing: border-box;
141
+ /* Use box-shadow instead of border for consistent rendering at fractional devicePixelRatio */
142
+ /* Borders render inconsistently at 125%/150% Windows scaling due to sub-pixel rounding */
143
+ box-shadow:
144
+ inset -1px 0 0 0 var(--zg-border-color),
145
+ inset 0 -1px 0 0 var(--zg-border-color);
146
+ padding: var(--zg-cell-padding-y) var(--zg-cell-padding-x);
147
+ display: flex;
148
+ align-items: center;
149
+ background: var(--zg-bg-primary);
150
+ color: var(--zg-text-primary);
151
+ overflow: hidden;
152
+ white-space: nowrap;
153
+ text-overflow: ellipsis;
154
+ transition: background-color var(--zg-transition-fast);
155
+ cursor: default;
156
+ }
157
+
158
+ /* Cell states */
159
+ .zg-cell:hover {
160
+ background: var(--zg-bg-hover);
161
+ }
162
+
163
+ .zg-grid .zg-cell.zg-cell-selected {
164
+ background: var(--zg-bg-selected);
165
+ box-shadow:
166
+ inset -1px 0 0 0 var(--zg-border-selected),
167
+ inset 0 -1px 0 0 var(--zg-border-selected);
168
+ }
169
+
170
+ .zg-grid .zg-cell.zg-cell-active {
171
+ box-shadow: inset 0 0 0 2px var(--zg-border-active);
172
+ background: var(--zg-bg-active);
173
+ z-index: 2;
174
+ }
175
+
176
+ .zg-grid .zg-cell.zg-cell-editing {
177
+ background: var(--zg-bg-editing);
178
+ box-shadow: inset 0 0 0 2px var(--zg-border-editing);
179
+ z-index: 3;
180
+ }
181
+
182
+ .zg-cell-readonly {
183
+ background: var(--zg-bg-secondary);
184
+ color: var(--zg-text-secondary);
185
+ cursor: not-allowed;
186
+ }
187
+
188
+ .zg-cell-disabled {
189
+ color: var(--zg-text-disabled);
190
+ cursor: not-allowed;
191
+ opacity: 0.6;
192
+ }
193
+
194
+ /* Cell alignment */
195
+ .zg-cell-align-left {
196
+ justify-content: flex-start;
197
+ text-align: left;
198
+ }
199
+
200
+ .zg-cell-align-center {
201
+ justify-content: center;
202
+ text-align: center;
203
+ }
204
+
205
+ .zg-cell-align-right {
206
+ justify-content: flex-end;
207
+ text-align: right;
208
+ }
209
+
210
+ /* Cell types */
211
+ .zg-cell-number {
212
+ justify-content: flex-end;
213
+ text-align: right;
214
+ font-variant-numeric: tabular-nums;
215
+ }
216
+
217
+ .zg-cell-boolean {
218
+ justify-content: center;
219
+ }
220
+
221
+ .zg-cell-date {
222
+ font-variant-numeric: tabular-nums;
223
+ }
224
+
225
+ /* Header cells */
226
+ .zg-header-cell {
227
+ background: var(--zg-bg-secondary);
228
+ font-weight: 600;
229
+ border-bottom: 2px solid var(--zg-border-color);
230
+ position: sticky;
231
+ top: 0;
232
+ z-index: 10;
233
+ }
234
+
235
+ .zg-header-cell:hover {
236
+ background: var(--zg-bg-hover);
237
+ }
238
+
239
+ /* Row header */
240
+ .zg-row-header {
241
+ background: var(--zg-bg-secondary);
242
+ font-weight: 500;
243
+ text-align: center;
244
+ border-right: 2px solid var(--zg-border-color);
245
+ position: sticky;
246
+ left: 0;
247
+ z-index: 9;
248
+ }
249
+
250
+ /* Focus ring (keyboard navigation) */
251
+ .zg-cell:focus,
252
+ .zg-cell:focus-visible {
253
+ outline: var(--zg-focus-ring);
254
+ outline-offset: calc(-1 * var(--zg-focus-offset));
255
+ z-index: 4;
256
+ }
257
+
258
+ /* Selection highlight overlay */
259
+ .zg-selection-overlay {
260
+ position: absolute;
261
+ pointer-events: none;
262
+ border: 2px solid var(--zg-border-selected);
263
+ background: var(--zg-bg-selected);
264
+ opacity: 0.3;
265
+ z-index: 1;
266
+ }
267
+
268
+ /* Loading state */
269
+ .zg-grid.is-loading {
270
+ cursor: wait;
271
+ opacity: 0.7;
272
+ }
273
+
274
+ .zg-grid.is-loading::after {
275
+ content: '';
276
+ position: absolute;
277
+ top: 50%;
278
+ left: 50%;
279
+ width: 40px;
280
+ height: 40px;
281
+ margin: -20px 0 0 -20px;
282
+ border: 4px solid var(--zg-border-color);
283
+ border-top-color: var(--zg-border-active);
284
+ border-radius: 50%;
285
+ animation: zg-spin 0.8s linear infinite;
286
+ }
287
+
288
+ @keyframes zg-spin {
289
+ to { transform: rotate(360deg); }
290
+ }
291
+
292
+ /* RTL support */
293
+ [dir="rtl"] .zg-grid {
294
+ direction: rtl;
295
+ }
296
+
297
+ [dir="rtl"] .zg-cell {
298
+ box-shadow:
299
+ inset 1px 0 0 0 var(--zg-border-color),
300
+ inset 0 -1px 0 0 var(--zg-border-color);
301
+ }
302
+
303
+ [dir="rtl"] .zg-cell-number {
304
+ justify-content: flex-start;
305
+ text-align: left;
306
+ }
307
+
308
+ [dir="rtl"] .zg-row-header {
309
+ left: auto;
310
+ right: 0;
311
+ border-right: none;
312
+ border-left: 2px solid var(--zg-border-color);
313
+ }
314
+
315
+ /* Print styles */
316
+ @media print {
317
+ .zg-scroll-container {
318
+ overflow: visible !important;
319
+ }
320
+
321
+ .zg-cell {
322
+ page-break-inside: avoid;
323
+ }
324
+
325
+ .zg-grid {
326
+ background: white !important;
327
+ }
328
+ }
329
+
330
+ /* High contrast mode */
331
+ @media (prefers-contrast: high) {
332
+ .zg-cell {
333
+ border-width: 2px;
334
+ }
335
+
336
+ .zg-cell-active,
337
+ .zg-cell-editing {
338
+ border-width: 3px;
339
+ }
340
+ }
341
+
342
+ /* Reduced motion */
343
+ @media (prefers-reduced-motion: reduce) {
344
+ .zg-cell,
345
+ .zg-grid::after {
346
+ transition: none !important;
347
+ animation: none !important;
348
+ }
349
+ }
350
+
351
+ /* Accessibility - Screen reader only */
352
+ .zg-sr-only {
353
+ position: absolute;
354
+ width: 1px;
355
+ height: 1px;
356
+ padding: 0;
357
+ margin: -1px;
358
+ overflow: hidden;
359
+ clip: rect(0, 0, 0, 0);
360
+ white-space: nowrap;
361
+ border-width: 0;
362
+ }