@alaarab/ogrid-js 2.0.0 → 2.0.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.
@@ -0,0 +1,910 @@
1
+ /* ──────────────────────────────────────────────────────────────
2
+ OGrid Default Theme — @alaarab/ogrid-js
3
+ Import: import '@alaarab/ogrid-js/styles';
4
+ Override any --ogrid-* variable to customize.
5
+ ────────────────────────────────────────────────────────────── */
6
+
7
+ /* ── Light Theme (default) ── */
8
+ :root {
9
+ --ogrid-bg: #ffffff;
10
+ --ogrid-fg: #242424;
11
+ --ogrid-border: #e0e0e0;
12
+ --ogrid-border-strong: #888;
13
+ --ogrid-border-hover: #999;
14
+ --ogrid-bg-subtle: #f3f2f1;
15
+ --ogrid-bg-hover: #f5f5f5;
16
+ --ogrid-bg-selected: #e6f0fb;
17
+ --ogrid-bg-selected-hover: #dae8f8;
18
+ --ogrid-bg-range: rgba(33, 115, 70, 0.12);
19
+ --ogrid-header-bg: #f5f5f5;
20
+ --ogrid-muted: #616161;
21
+ --ogrid-fg-muted: rgba(0, 0, 0, 0.4);
22
+ --ogrid-selection: #217346;
23
+ --ogrid-primary: #217346;
24
+ --ogrid-primary-fg: #fff;
25
+ --ogrid-primary-hover: #1b5f39;
26
+ --ogrid-accent: #217346;
27
+ --ogrid-accent-dark: #1b5f39;
28
+ }
29
+
30
+ /* ── Dark Theme ── */
31
+ [data-theme='dark'] {
32
+ --ogrid-bg: #1a1a24;
33
+ --ogrid-fg: #e0e0e0;
34
+ --ogrid-border: #333340;
35
+ --ogrid-border-strong: #555;
36
+ --ogrid-border-hover: #666;
37
+ --ogrid-bg-subtle: #22222e;
38
+ --ogrid-bg-hover: #2a2a38;
39
+ --ogrid-bg-selected: #1a2f45;
40
+ --ogrid-bg-selected-hover: #1f3650;
41
+ --ogrid-bg-range: rgba(58, 184, 118, 0.12);
42
+ --ogrid-header-bg: #22222e;
43
+ --ogrid-muted: #999;
44
+ --ogrid-fg-muted: rgba(255, 255, 255, 0.3);
45
+ --ogrid-selection: #3ab876;
46
+ --ogrid-primary: #3ab876;
47
+ --ogrid-primary-fg: #0a0a0f;
48
+ --ogrid-primary-hover: #4ec484;
49
+ --ogrid-accent: #3ab876;
50
+ --ogrid-accent-dark: #2fa768;
51
+ }
52
+
53
+ @media (prefers-color-scheme: dark) {
54
+ :root:not([data-theme='light']) {
55
+ --ogrid-bg: #1a1a24;
56
+ --ogrid-fg: #e0e0e0;
57
+ --ogrid-border: #333340;
58
+ --ogrid-border-strong: #555;
59
+ --ogrid-border-hover: #666;
60
+ --ogrid-bg-subtle: #22222e;
61
+ --ogrid-bg-hover: #2a2a38;
62
+ --ogrid-bg-selected: #1a2f45;
63
+ --ogrid-bg-selected-hover: #1f3650;
64
+ --ogrid-bg-range: rgba(58, 184, 118, 0.12);
65
+ --ogrid-header-bg: #22222e;
66
+ --ogrid-muted: #999;
67
+ --ogrid-fg-muted: rgba(255, 255, 255, 0.3);
68
+ --ogrid-selection: #3ab876;
69
+ --ogrid-primary: #3ab876;
70
+ --ogrid-primary-fg: #0a0a0f;
71
+ --ogrid-primary-hover: #4ec484;
72
+ --ogrid-accent: #3ab876;
73
+ --ogrid-accent-dark: #2fa768;
74
+ }
75
+ }
76
+
77
+ /* ── Layout ── */
78
+
79
+ .ogrid-container {
80
+ display: flex;
81
+ flex-direction: column;
82
+ width: 100%;
83
+ height: 100%;
84
+ background: var(--ogrid-bg, #fff);
85
+ color: var(--ogrid-fg, #242424);
86
+ font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
87
+ font-size: 14px;
88
+ line-height: 1.5;
89
+ box-sizing: border-box;
90
+ border: 1px solid var(--ogrid-border, #e0e0e0);
91
+ border-radius: 8px;
92
+ overflow: hidden;
93
+ }
94
+
95
+ .ogrid-toolbar {
96
+ display: flex;
97
+ align-items: center;
98
+ justify-content: space-between;
99
+ gap: 8px;
100
+ padding: 6px 12px;
101
+ border-bottom: 1px solid var(--ogrid-border, #e0e0e0);
102
+ background: var(--ogrid-bg-subtle, #f3f2f1);
103
+ min-height: 36px;
104
+ }
105
+
106
+ .ogrid-toolbar:empty {
107
+ display: none;
108
+ }
109
+
110
+ .ogrid-body-area {
111
+ display: flex;
112
+ flex: 1;
113
+ overflow: hidden;
114
+ min-height: 0;
115
+ }
116
+
117
+ .ogrid-table-container {
118
+ flex: 1;
119
+ overflow: auto;
120
+ position: relative;
121
+ min-height: 0;
122
+ }
123
+
124
+ .ogrid-sidebar-container {
125
+ flex-shrink: 0;
126
+ }
127
+
128
+ /* ── Table ── */
129
+
130
+ .ogrid-wrapper {
131
+ position: relative;
132
+ min-width: fit-content;
133
+ background: var(--ogrid-bg, #fff);
134
+ }
135
+
136
+ .ogrid-table {
137
+ width: 100%;
138
+ border-collapse: separate;
139
+ border-spacing: 0;
140
+ box-sizing: border-box;
141
+ table-layout: auto;
142
+ }
143
+
144
+ .ogrid-table th,
145
+ .ogrid-table td {
146
+ min-width: 80px;
147
+ box-sizing: border-box;
148
+ border-right: 1px solid var(--ogrid-border, #e0e0e0);
149
+ font-size: 13px;
150
+ vertical-align: middle;
151
+ }
152
+
153
+ .ogrid-table th:last-of-type,
154
+ .ogrid-table td:last-of-type {
155
+ border-right: none;
156
+ }
157
+
158
+ /* ── Header ── */
159
+
160
+ .ogrid-table thead {
161
+ background: var(--ogrid-bg-subtle, #f3f2f1);
162
+ position: sticky;
163
+ top: 0;
164
+ z-index: 8;
165
+ }
166
+
167
+ .ogrid-table thead th {
168
+ padding: 6px 10px;
169
+ font-weight: 600;
170
+ font-size: 14px;
171
+ color: var(--ogrid-fg, #242424);
172
+ white-space: nowrap;
173
+ position: relative;
174
+ border-bottom: 1px solid var(--ogrid-border, #e0e0e0);
175
+ background: var(--ogrid-bg-subtle, #f3f2f1);
176
+ }
177
+
178
+ .ogrid-header-cell {
179
+ cursor: default;
180
+ }
181
+
182
+ .ogrid-sortable {
183
+ cursor: pointer;
184
+ user-select: none;
185
+ }
186
+
187
+ .ogrid-sort-indicator {
188
+ margin-left: 4px;
189
+ font-size: 12px;
190
+ color: var(--ogrid-muted, #616161);
191
+ }
192
+
193
+ .ogrid-group-header {
194
+ text-align: center;
195
+ font-weight: 600;
196
+ border-bottom: 2px solid var(--ogrid-border, #e0e0e0);
197
+ padding: 6px 10px;
198
+ background: var(--ogrid-header-bg, #f5f5f5);
199
+ }
200
+
201
+ /* ── Resize Handle ── */
202
+
203
+ .ogrid-resize-handle {
204
+ position: absolute;
205
+ top: 0;
206
+ right: -3px;
207
+ bottom: 0;
208
+ width: 8px;
209
+ cursor: col-resize;
210
+ user-select: none;
211
+ z-index: 1;
212
+ }
213
+
214
+ .ogrid-resize-handle::after {
215
+ content: '';
216
+ position: absolute;
217
+ top: 0;
218
+ right: 3px;
219
+ bottom: 0;
220
+ width: 2px;
221
+ }
222
+
223
+ .ogrid-resize-handle:hover::after {
224
+ background-color: var(--ogrid-accent, #217346);
225
+ }
226
+
227
+ .ogrid-resize-handle:active::after {
228
+ background-color: var(--ogrid-accent-dark, #1b5f39);
229
+ }
230
+
231
+ /* ── Filter Icon (in header) ── */
232
+
233
+ .ogrid-filter-icon {
234
+ display: inline-flex;
235
+ align-items: center;
236
+ justify-content: center;
237
+ width: 24px;
238
+ height: 24px;
239
+ padding: 4px;
240
+ border: none;
241
+ border-radius: 4px;
242
+ background: transparent;
243
+ color: var(--ogrid-muted, #616161);
244
+ cursor: pointer;
245
+ font-size: 14px;
246
+ vertical-align: middle;
247
+ }
248
+
249
+ .ogrid-filter-icon:hover {
250
+ background: var(--ogrid-bg-hover, #f5f5f5);
251
+ color: var(--ogrid-fg, #424242);
252
+ }
253
+
254
+ /* ── Body Rows ── */
255
+
256
+ .ogrid-table tbody td {
257
+ padding: 6px 10px;
258
+ border-bottom: 1px solid var(--ogrid-border, #e8e8e8);
259
+ position: relative;
260
+ color: var(--ogrid-fg, #242424);
261
+ }
262
+
263
+ .ogrid-table tbody tr:last-child td {
264
+ border-bottom: none;
265
+ }
266
+
267
+ .ogrid-table tbody tr:hover td {
268
+ background: var(--ogrid-bg-hover, #f5f5f5);
269
+ }
270
+
271
+ .ogrid-row {
272
+ transition: background 0.1s;
273
+ }
274
+
275
+ /* ── Row Selection ── */
276
+
277
+ .ogrid-table tbody tr[data-row-selected='true'] td {
278
+ background: var(--ogrid-bg-selected, #e6f0fb);
279
+ }
280
+
281
+ .ogrid-table tbody tr[data-row-selected='true']:hover td {
282
+ background: var(--ogrid-bg-selected-hover, #dae8f8);
283
+ }
284
+
285
+ .ogrid-checkbox-header,
286
+ .ogrid-checkbox-cell {
287
+ width: 48px;
288
+ min-width: 48px;
289
+ max-width: 48px;
290
+ padding: 4px !important;
291
+ text-align: center;
292
+ }
293
+
294
+ .ogrid-select-all-checkbox,
295
+ .ogrid-row-checkbox {
296
+ width: 16px;
297
+ height: 16px;
298
+ cursor: pointer;
299
+ accent-color: var(--ogrid-primary, #217346);
300
+ }
301
+
302
+ /* ── Cell Interaction (active cell, selection range) ── */
303
+
304
+ .ogrid-cell[data-active-cell='true'] {
305
+ outline: 2px solid var(--ogrid-selection, #217346);
306
+ outline-offset: -1px;
307
+ z-index: 2;
308
+ position: relative;
309
+ }
310
+
311
+ .ogrid-cell[data-in-range='true'] {
312
+ background: var(--ogrid-bg-range, rgba(33, 115, 70, 0.12)) !important;
313
+ }
314
+
315
+ [data-drag-range] {
316
+ background: var(--ogrid-bg-range, rgba(33, 115, 70, 0.12)) !important;
317
+ }
318
+
319
+ /* ── Fill Handle ── */
320
+
321
+ .ogrid-fill-handle {
322
+ position: absolute;
323
+ right: -3px;
324
+ bottom: -3px;
325
+ width: 7px;
326
+ height: 7px;
327
+ background: var(--ogrid-selection, #217346);
328
+ border: 1px solid var(--ogrid-bg, #fff);
329
+ border-radius: 1px;
330
+ cursor: crosshair;
331
+ pointer-events: auto;
332
+ z-index: 3;
333
+ }
334
+
335
+ /* ── Pinned Columns ── */
336
+
337
+ .ogrid-table th[data-pinned='left'],
338
+ .ogrid-table td[data-pinned='left'] {
339
+ position: sticky;
340
+ z-index: 6;
341
+ background: var(--ogrid-bg, #fff);
342
+ will-change: transform;
343
+ }
344
+
345
+ .ogrid-table thead th[data-pinned='left'] {
346
+ background: var(--ogrid-bg-subtle, #f3f2f1);
347
+ z-index: 9;
348
+ }
349
+
350
+ .ogrid-table th[data-pinned='right'],
351
+ .ogrid-table td[data-pinned='right'] {
352
+ position: sticky;
353
+ z-index: 6;
354
+ background: var(--ogrid-bg, #fff);
355
+ will-change: transform;
356
+ }
357
+
358
+ .ogrid-table thead th[data-pinned='right'] {
359
+ background: var(--ogrid-bg-subtle, #f3f2f1);
360
+ z-index: 9;
361
+ }
362
+
363
+ /* ── Empty State ── */
364
+
365
+ .ogrid-empty-state {
366
+ text-align: center;
367
+ padding: 32px 16px;
368
+ color: var(--ogrid-muted, #616161);
369
+ font-size: 14px;
370
+ }
371
+
372
+ /* ── Loading Overlay ── */
373
+
374
+ .ogrid-loading-overlay {
375
+ position: absolute;
376
+ inset: 0;
377
+ z-index: 100;
378
+ display: flex;
379
+ align-items: center;
380
+ justify-content: center;
381
+ background: rgba(255, 255, 255, 0.7);
382
+ backdrop-filter: blur(1px);
383
+ pointer-events: all;
384
+ }
385
+
386
+ .ogrid-loading-spinner {
387
+ width: 24px;
388
+ height: 24px;
389
+ border: 2px solid var(--ogrid-border, #e0e0e0);
390
+ border-top-color: var(--ogrid-primary, #217346);
391
+ border-radius: 50%;
392
+ animation: ogrid-spin 0.8s linear infinite;
393
+ }
394
+
395
+ @keyframes ogrid-spin {
396
+ to { transform: rotate(360deg); }
397
+ }
398
+
399
+ /* ── Status Bar ── */
400
+
401
+ .ogrid-status-bar-container:empty {
402
+ display: none;
403
+ }
404
+
405
+ .ogrid-status-bar {
406
+ display: flex;
407
+ align-items: center;
408
+ gap: 16px;
409
+ width: 100%;
410
+ padding: 6px 12px;
411
+ box-sizing: border-box;
412
+ font-size: 12px;
413
+ color: var(--ogrid-muted, #616161);
414
+ background: var(--ogrid-bg-subtle, #f3f2f1);
415
+ border-top: 1px solid var(--ogrid-border, #e0e0e0);
416
+ min-height: 28px;
417
+ }
418
+
419
+ .ogrid-status-part {
420
+ display: inline-flex;
421
+ align-items: center;
422
+ gap: 4px;
423
+ }
424
+
425
+ .ogrid-status-part:not(:last-child)::after {
426
+ content: '';
427
+ width: 1px;
428
+ height: 14px;
429
+ background: var(--ogrid-border, #c4c4c4);
430
+ margin-left: 12px;
431
+ }
432
+
433
+ .ogrid-status-aggregation {
434
+ font-weight: 600;
435
+ color: var(--ogrid-fg, #242424);
436
+ }
437
+
438
+ /* ── Pagination ── */
439
+
440
+ .ogrid-pagination-container {
441
+ border-top: 1px solid var(--ogrid-border, #e0e0e0);
442
+ }
443
+
444
+ .ogrid-pagination-container:empty {
445
+ display: none;
446
+ }
447
+
448
+ .ogrid-pagination {
449
+ display: flex;
450
+ flex-wrap: wrap;
451
+ align-items: center;
452
+ justify-content: space-between;
453
+ gap: 14px 24px;
454
+ width: 100%;
455
+ min-width: 0;
456
+ box-sizing: border-box;
457
+ padding: 8px 12px;
458
+ }
459
+
460
+ .ogrid-pagination-size {
461
+ display: inline-flex;
462
+ align-items: center;
463
+ gap: 8px;
464
+ flex-shrink: 0;
465
+ font-size: 13px;
466
+ color: var(--ogrid-muted, #606060);
467
+ }
468
+
469
+ .ogrid-page-size-select {
470
+ min-width: 72px;
471
+ padding: 4px 8px;
472
+ border: 1px solid var(--ogrid-border, #ccc);
473
+ border-radius: 4px;
474
+ background: var(--ogrid-bg, #fff);
475
+ font-size: 13px;
476
+ color: var(--ogrid-fg, #242424);
477
+ }
478
+
479
+ .ogrid-pagination-info {
480
+ font-size: 13px;
481
+ color: var(--ogrid-muted, #606060);
482
+ font-variant-numeric: tabular-nums;
483
+ }
484
+
485
+ .ogrid-pagination-nav {
486
+ display: flex;
487
+ align-items: center;
488
+ gap: 4px;
489
+ flex-wrap: wrap;
490
+ flex: 1 1 auto;
491
+ justify-content: center;
492
+ min-width: 0;
493
+ }
494
+
495
+ .ogrid-pagination-btn {
496
+ min-width: 28px;
497
+ min-height: 28px;
498
+ padding: 4px 8px;
499
+ border: 1px solid var(--ogrid-border, #ccc);
500
+ border-radius: 4px;
501
+ background: var(--ogrid-bg, #fff);
502
+ color: var(--ogrid-fg, #333);
503
+ cursor: pointer;
504
+ font-size: 13px;
505
+ font-variant-numeric: tabular-nums;
506
+ display: inline-flex;
507
+ align-items: center;
508
+ justify-content: center;
509
+ }
510
+
511
+ .ogrid-pagination-btn:hover:not(:disabled) {
512
+ background: var(--ogrid-bg-hover, #f5f5f5);
513
+ border-color: var(--ogrid-border-hover, #999);
514
+ }
515
+
516
+ .ogrid-pagination-btn:disabled {
517
+ opacity: 0.5;
518
+ cursor: not-allowed;
519
+ }
520
+
521
+ .ogrid-pagination-active {
522
+ background: var(--ogrid-primary, #217346) !important;
523
+ border-color: var(--ogrid-primary, #217346) !important;
524
+ color: var(--ogrid-primary-fg, #fff) !important;
525
+ }
526
+
527
+ .ogrid-pagination-ellipsis {
528
+ display: inline-flex;
529
+ align-items: center;
530
+ justify-content: center;
531
+ min-width: 24px;
532
+ font-size: 12px;
533
+ color: var(--ogrid-muted, #888);
534
+ user-select: none;
535
+ }
536
+
537
+ /* ── Column Chooser ── */
538
+
539
+ .ogrid-column-chooser {
540
+ position: relative;
541
+ display: inline-flex;
542
+ }
543
+
544
+ .ogrid-column-chooser-btn {
545
+ display: inline-flex;
546
+ align-items: center;
547
+ gap: 6px;
548
+ padding: 6px 12px;
549
+ border: 1px solid var(--ogrid-border, #ccc);
550
+ border-radius: 6px;
551
+ background: var(--ogrid-bg, #fff);
552
+ cursor: pointer;
553
+ font-size: 13px;
554
+ font-weight: 600;
555
+ color: var(--ogrid-fg, #333);
556
+ transition: background 0.15s, border-color 0.15s;
557
+ }
558
+
559
+ .ogrid-column-chooser-btn:hover {
560
+ background: var(--ogrid-bg-hover, #f5f5f5);
561
+ border-color: var(--ogrid-border-hover, #999);
562
+ }
563
+
564
+ .ogrid-column-chooser-dropdown {
565
+ position: absolute;
566
+ top: 100%;
567
+ right: 0;
568
+ min-width: 220px;
569
+ max-height: 360px;
570
+ overflow-y: auto;
571
+ background: var(--ogrid-bg, #fff);
572
+ border-radius: 6px;
573
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
574
+ border: 1px solid var(--ogrid-border, #e0e0e0);
575
+ display: flex;
576
+ flex-direction: column;
577
+ padding: 4px 0;
578
+ z-index: 50;
579
+ margin-top: 4px;
580
+ }
581
+
582
+ .ogrid-column-chooser-item {
583
+ padding: 4px 12px;
584
+ display: flex;
585
+ align-items: center;
586
+ gap: 8px;
587
+ min-height: 32px;
588
+ cursor: pointer;
589
+ font-size: 13px;
590
+ color: var(--ogrid-fg, #242424);
591
+ }
592
+
593
+ .ogrid-column-chooser-item:hover {
594
+ background: var(--ogrid-bg-hover, #f0f0f0);
595
+ }
596
+
597
+ .ogrid-column-chooser-item input[type='checkbox'] {
598
+ accent-color: var(--ogrid-primary, #217346);
599
+ }
600
+
601
+ /* ── Sidebar ── */
602
+
603
+ .ogrid-sidebar {
604
+ display: flex;
605
+ flex-direction: row;
606
+ flex-shrink: 0;
607
+ background: var(--ogrid-bg, #fff);
608
+ border-left: 1px solid var(--ogrid-border, #e0e0e0);
609
+ }
610
+
611
+ .ogrid-sidebar-tab {
612
+ display: flex;
613
+ align-items: center;
614
+ justify-content: center;
615
+ width: 36px;
616
+ height: 36px;
617
+ border: none;
618
+ background: var(--ogrid-bg-subtle, #f3f2f1);
619
+ color: var(--ogrid-muted, #616161);
620
+ cursor: pointer;
621
+ font-size: 16px;
622
+ border-bottom: 1px solid var(--ogrid-border, #e0e0e0);
623
+ }
624
+
625
+ .ogrid-sidebar-tab:hover {
626
+ background: var(--ogrid-bg-hover, #f5f5f5);
627
+ color: var(--ogrid-fg, #242424);
628
+ }
629
+
630
+ .ogrid-sidebar-panel {
631
+ width: 240px;
632
+ background: var(--ogrid-bg, #fff);
633
+ border-left: 1px solid var(--ogrid-border, #e0e0e0);
634
+ overflow-y: auto;
635
+ }
636
+
637
+ .ogrid-sidebar-header {
638
+ display: flex;
639
+ align-items: center;
640
+ justify-content: space-between;
641
+ padding: 8px 12px;
642
+ border-bottom: 1px solid var(--ogrid-border, #e0e0e0);
643
+ font-weight: 600;
644
+ font-size: 13px;
645
+ color: var(--ogrid-fg, #242424);
646
+ background: var(--ogrid-bg-subtle, #f3f2f1);
647
+ }
648
+
649
+ .ogrid-sidebar-close-btn {
650
+ border: none;
651
+ background: none;
652
+ cursor: pointer;
653
+ color: var(--ogrid-muted, #616161);
654
+ font-size: 16px;
655
+ padding: 2px;
656
+ }
657
+
658
+ .ogrid-sidebar-close-btn:hover {
659
+ color: var(--ogrid-fg, #242424);
660
+ }
661
+
662
+ .ogrid-sidebar-content {
663
+ padding: 8px 0;
664
+ }
665
+
666
+ .ogrid-sidebar-action-btn {
667
+ display: inline-flex;
668
+ align-items: center;
669
+ gap: 4px;
670
+ padding: 4px 10px;
671
+ border: 1px solid var(--ogrid-border, #ccc);
672
+ border-radius: 4px;
673
+ background: var(--ogrid-bg, #fff);
674
+ color: var(--ogrid-fg, #333);
675
+ font-size: 12px;
676
+ cursor: pointer;
677
+ }
678
+
679
+ .ogrid-sidebar-action-btn:hover {
680
+ background: var(--ogrid-bg-hover, #f5f5f5);
681
+ }
682
+
683
+ .ogrid-column-list {
684
+ padding: 4px 0;
685
+ }
686
+
687
+ .ogrid-column-item {
688
+ display: flex;
689
+ align-items: center;
690
+ gap: 8px;
691
+ padding: 4px 12px;
692
+ min-height: 28px;
693
+ font-size: 13px;
694
+ color: var(--ogrid-fg, #242424);
695
+ cursor: pointer;
696
+ }
697
+
698
+ .ogrid-column-item:hover {
699
+ background: var(--ogrid-bg-hover, #f5f5f5);
700
+ }
701
+
702
+ .ogrid-column-item input[type='checkbox'] {
703
+ accent-color: var(--ogrid-primary, #217346);
704
+ }
705
+
706
+ /* ── Sidebar Filter Section ── */
707
+
708
+ .ogrid-filter-section {
709
+ padding: 8px 12px;
710
+ border-bottom: 1px solid var(--ogrid-border, #e0e0e0);
711
+ }
712
+
713
+ .ogrid-filter-field {
714
+ margin-bottom: 8px;
715
+ }
716
+
717
+ .ogrid-filter-label {
718
+ display: block;
719
+ font-size: 12px;
720
+ font-weight: 600;
721
+ color: var(--ogrid-muted, #616161);
722
+ margin-bottom: 4px;
723
+ }
724
+
725
+ /* ── Header Filter Popover ── */
726
+
727
+ .ogrid-header-filter-popover {
728
+ position: fixed;
729
+ z-index: 1000;
730
+ min-width: 280px;
731
+ max-width: 320px;
732
+ background: var(--ogrid-bg, #fff);
733
+ border: 1px solid var(--ogrid-border, #d1d1d1);
734
+ border-radius: 8px;
735
+ box-shadow: 0 8px 16px rgba(0, 0, 0, 0.14);
736
+ overflow: hidden;
737
+ }
738
+
739
+ .ogrid-filter-text-input,
740
+ .ogrid-filter-search-input,
741
+ .ogrid-filter-date-input {
742
+ width: 100%;
743
+ padding: 6px 10px;
744
+ border: 1px solid var(--ogrid-border, #d1d1d1);
745
+ border-radius: 4px;
746
+ font-size: 14px;
747
+ box-sizing: border-box;
748
+ background: var(--ogrid-bg, #fff);
749
+ color: var(--ogrid-fg, #242424);
750
+ }
751
+
752
+ .ogrid-filter-text-input:focus,
753
+ .ogrid-filter-search-input:focus,
754
+ .ogrid-filter-date-input:focus {
755
+ outline: none;
756
+ border-color: var(--ogrid-primary, #217346);
757
+ }
758
+
759
+ .ogrid-filter-apply-btn {
760
+ padding: 6px 16px;
761
+ border: none;
762
+ border-radius: 4px;
763
+ background: var(--ogrid-primary, #217346);
764
+ color: var(--ogrid-primary-fg, #fff);
765
+ font-size: 12px;
766
+ font-weight: 600;
767
+ cursor: pointer;
768
+ }
769
+
770
+ .ogrid-filter-apply-btn:hover {
771
+ background: var(--ogrid-primary-hover, #1b5f39);
772
+ }
773
+
774
+ .ogrid-filter-clear-btn {
775
+ padding: 6px 12px;
776
+ border: 1px solid var(--ogrid-border, #ccc);
777
+ border-radius: 4px;
778
+ background: var(--ogrid-bg, #fff);
779
+ color: var(--ogrid-muted, #666);
780
+ font-size: 12px;
781
+ cursor: pointer;
782
+ }
783
+
784
+ .ogrid-filter-clear-btn:hover {
785
+ background: var(--ogrid-bg-hover, #f5f5f5);
786
+ color: var(--ogrid-fg, #333);
787
+ }
788
+
789
+ .ogrid-filter-select-all-btn,
790
+ .ogrid-filter-clear-sel-btn {
791
+ background: none;
792
+ border: none;
793
+ color: var(--ogrid-primary, #217346);
794
+ font-size: 12px;
795
+ font-weight: 500;
796
+ cursor: pointer;
797
+ padding: 4px 8px;
798
+ border-radius: 4px;
799
+ }
800
+
801
+ .ogrid-filter-select-all-btn:hover,
802
+ .ogrid-filter-clear-sel-btn:hover {
803
+ background: var(--ogrid-bg-hover, #f5f5f5);
804
+ }
805
+
806
+ .ogrid-filter-checkbox-list {
807
+ overflow-y: auto;
808
+ max-height: 250px;
809
+ padding: 6px 0;
810
+ }
811
+
812
+ .ogrid-filter-checkbox-item {
813
+ padding: 4px 12px;
814
+ display: flex;
815
+ align-items: center;
816
+ gap: 8px;
817
+ font-size: 13px;
818
+ color: var(--ogrid-fg, #242424);
819
+ cursor: pointer;
820
+ }
821
+
822
+ .ogrid-filter-checkbox-item:hover {
823
+ background: var(--ogrid-bg-hover, #f5f5f5);
824
+ }
825
+
826
+ .ogrid-filter-checkbox-item input[type='checkbox'] {
827
+ accent-color: var(--ogrid-primary, #217346);
828
+ }
829
+
830
+ .ogrid-filter-empty {
831
+ padding: 20px;
832
+ text-align: center;
833
+ font-size: 13px;
834
+ color: var(--ogrid-muted, #666);
835
+ }
836
+
837
+ /* ── Context Menu ── */
838
+
839
+ .ogrid-context-menu {
840
+ position: fixed;
841
+ z-index: 10000;
842
+ min-width: 160px;
843
+ padding: 4px 0;
844
+ background: var(--ogrid-bg, #fff);
845
+ border: 1px solid var(--ogrid-border, #e0e0e0);
846
+ border-radius: 6px;
847
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
848
+ }
849
+
850
+ .ogrid-context-menu-item {
851
+ display: flex;
852
+ align-items: center;
853
+ justify-content: space-between;
854
+ gap: 24px;
855
+ width: 100%;
856
+ padding: 6px 12px;
857
+ border: none;
858
+ background: none;
859
+ font-size: 13px;
860
+ text-align: left;
861
+ cursor: pointer;
862
+ color: var(--ogrid-fg, #242424);
863
+ }
864
+
865
+ .ogrid-context-menu-item:hover:not(:disabled) {
866
+ background: var(--ogrid-bg-hover, #f5f5f5);
867
+ }
868
+
869
+ .ogrid-context-menu-item:disabled {
870
+ opacity: 0.5;
871
+ cursor: not-allowed;
872
+ }
873
+
874
+ .ogrid-context-menu-divider {
875
+ height: 1px;
876
+ margin: 4px 0;
877
+ background: var(--ogrid-border, #e0e0e0);
878
+ }
879
+
880
+ /* ── Inline Cell Editor ── */
881
+
882
+ .ogrid-cell-editor {
883
+ position: absolute;
884
+ z-index: 10;
885
+ background: var(--ogrid-bg, #fff);
886
+ border: 2px solid var(--ogrid-selection, #217346);
887
+ border-radius: 0;
888
+ box-sizing: border-box;
889
+ }
890
+
891
+ .ogrid-cell-editor input,
892
+ .ogrid-cell-editor select {
893
+ width: 100%;
894
+ height: 100%;
895
+ border: none;
896
+ outline: none;
897
+ padding: 4px 8px;
898
+ font-size: 13px;
899
+ font-family: inherit;
900
+ background: var(--ogrid-bg, #fff);
901
+ color: var(--ogrid-fg, #242424);
902
+ box-sizing: border-box;
903
+ }
904
+
905
+ /* ── Numeric right-alignment ── */
906
+
907
+ .ogrid-table th[data-type='numeric'],
908
+ .ogrid-table td[data-type='numeric'] {
909
+ text-align: right;
910
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alaarab/ogrid-js",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "OGrid vanilla JS – framework-free data grid with sorting, filtering, pagination, and spreadsheet-style editing.",
5
5
  "main": "dist/esm/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -14,7 +14,7 @@
14
14
  "./styles": "./dist/styles/ogrid.css"
15
15
  },
16
16
  "scripts": {
17
- "build": "rimraf dist && tsc -p tsconfig.build.json",
17
+ "build": "rimraf dist && tsc -p tsconfig.build.json && mkdir -p dist/styles && cp styles/ogrid.css dist/styles/ogrid.css",
18
18
  "test": "jest"
19
19
  },
20
20
  "keywords": ["ogrid", "datagrid", "vanilla", "javascript", "typescript", "grid"],
@@ -23,7 +23,7 @@
23
23
  "files": ["dist", "README.md", "LICENSE"],
24
24
  "engines": { "node": ">=18" },
25
25
  "dependencies": {
26
- "@alaarab/ogrid-core": "2.0.0"
26
+ "@alaarab/ogrid-core": "2.0.1"
27
27
  },
28
28
  "publishConfig": { "access": "public" }
29
29
  }