@parksw/sw-ui-components 0.0.2 → 0.0.3

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,592 @@
1
+ import { t as __decorate } from "./decorate-BnP3GfGh.js";
2
+ import { LitElement, css, html } from "lit";
3
+ import { customElement, property, state } from "lit/decorators.js";
4
+ import { when } from "lit/directives/when.js";
5
+ import { classMap } from "lit/directives/class-map.js";
6
+ import { styleMap } from "lit/directives/style-map.js";
7
+ import { repeat } from "lit/directives/repeat.js";
8
+ var MyGrid = class extends LitElement {
9
+ constructor() {
10
+ super(), this.columns = [], this.data = [], this.itemsPerPage = 10, this.columnReordering = !0, this.height = "auto", this.enableColumnVisibility = !0, this.enableFilter = !0, this._sortKey = null, this._sortDirection = "asc", this._draggedColumnIndex = null, this._dragOverColumnIndex = null, this._selectedRowId = null, this._selectedColumnKey = null, this._filterValues = {}, this._activeFilterColumn = null, this._filterSearchTerm = "", this._currentPage = 1, this._hiddenColumns = /* @__PURE__ */ new Set(), this._showColumnMenu = !1, this._filterMenuSortDirection = "asc", this._resizingColumnIndex = null, this._startX = 0, this._startWidth = 0, this._handleDocumentClick = this._handleDocumentClick.bind(this), this._handleResizeMove = this._handleResizeMove.bind(this), this._handleResizeEnd = this._handleResizeEnd.bind(this);
11
+ }
12
+ connectedCallback() {
13
+ super.connectedCallback(), document.addEventListener("click", this._handleDocumentClick), document.addEventListener("mousemove", this._handleResizeMove), document.addEventListener("mouseup", this._handleResizeEnd);
14
+ }
15
+ disconnectedCallback() {
16
+ super.disconnectedCallback(), document.removeEventListener("click", this._handleDocumentClick), document.removeEventListener("mousemove", this._handleResizeMove), document.removeEventListener("mouseup", this._handleResizeEnd);
17
+ }
18
+ updated(e) {
19
+ super.updated(e), e.has("enableFilter") && (this._filterValues = {}, this._activeFilterColumn = null, this._filterSearchTerm = "", this._resetPage());
20
+ }
21
+ _handleDocumentClick(e) {
22
+ this._showColumnMenu &&= !1, this._activeFilterColumn && (this._activeFilterColumn = null, this._filterSearchTerm = "");
23
+ }
24
+ get _visibleColumns() {
25
+ return this.columns.filter((e) => !this._hiddenColumns.has(e.key));
26
+ }
27
+ get _gridColumnTemplate() {
28
+ let e = "";
29
+ return this.enableColumnVisibility && (e += "40px "), e += this._visibleColumns.map((e) => e.width || "minmax(150px, 1fr)").join(" "), e;
30
+ }
31
+ _resetPage() {
32
+ this._currentPage = 1;
33
+ }
34
+ _toggleColumnMenu(e) {
35
+ e.stopPropagation(), this._showColumnMenu = !this._showColumnMenu, this._activeFilterColumn = null;
36
+ }
37
+ _toggleColumnVisibility(e) {
38
+ let o = new Set(this._hiddenColumns);
39
+ o.has(e) ? o.delete(e) : o.add(e), this._hiddenColumns = o;
40
+ }
41
+ _handleItemsPerPageChange(e) {
42
+ let o = e.target;
43
+ this.itemsPerPage = Number(o.value), this._resetPage();
44
+ }
45
+ _handleHeaderClick(e) {
46
+ this._sortKey === e ? this._sortDirection = this._sortDirection === "asc" ? "desc" : "asc" : (this._sortKey = e, this._sortDirection = "asc"), this._resetPage();
47
+ }
48
+ _toggleFilterMenu(e, o) {
49
+ e.stopPropagation(), this._activeFilterColumn === o ? this._activeFilterColumn = null : (this._activeFilterColumn = o, this._showColumnMenu = !1, this._filterMenuSortDirection = "asc"), this._filterSearchTerm = "";
50
+ }
51
+ _toggleFilterMenuSort(e) {
52
+ e.stopPropagation(), this._filterMenuSortDirection = this._filterMenuSortDirection === "asc" ? "desc" : "asc";
53
+ }
54
+ _getUniqueValues(e) {
55
+ let o = new Set(this.data.map((o) => o[e]));
56
+ return Array.from(o).sort((e, o) => {
57
+ if (e === o) return 0;
58
+ if (e == null) return 1;
59
+ if (o == null) return -1;
60
+ let s = 0;
61
+ if (typeof e == "number" && typeof o == "number") s = e - o;
62
+ else {
63
+ let c = Date.parse(String(e)), l = Date.parse(String(o));
64
+ s = !isNaN(c) && !isNaN(l) && String(e).includes("-") && String(o).includes("-") ? c - l : String(e).localeCompare(String(o));
65
+ }
66
+ return this._filterMenuSortDirection === "asc" ? s : -s;
67
+ });
68
+ }
69
+ _isFilterActive(e) {
70
+ return !!this._filterValues[e];
71
+ }
72
+ _handleFilterValueChange(e, o, s) {
73
+ let c = this._filterValues[e];
74
+ if (c) {
75
+ let l = new Set(c);
76
+ s ? l.add(o) : l.delete(o);
77
+ let u = this._getUniqueValues(e);
78
+ if (l.size === u.length) {
79
+ let o = { ...this._filterValues };
80
+ delete o[e], this._filterValues = o;
81
+ } else this._filterValues = {
82
+ ...this._filterValues,
83
+ [e]: l
84
+ };
85
+ } else if (!s) {
86
+ let s = this._getUniqueValues(e);
87
+ c = new Set(s), c.delete(o), this._filterValues = {
88
+ ...this._filterValues,
89
+ [e]: c
90
+ };
91
+ }
92
+ this._resetPage();
93
+ }
94
+ _handleSelectAll(e, o) {
95
+ if (o) {
96
+ let o = { ...this._filterValues };
97
+ delete o[e], this._filterValues = o;
98
+ } else this._filterValues = {
99
+ ...this._filterValues,
100
+ [e]: /* @__PURE__ */ new Set()
101
+ };
102
+ this._resetPage();
103
+ }
104
+ _handleFilterSearch(e) {
105
+ this._filterSearchTerm = e.target.value;
106
+ }
107
+ _handleResizeStart(e, o) {
108
+ e.preventDefault(), e.stopPropagation(), this._resizingColumnIndex = o, this._startX = e.pageX;
109
+ let s = this.shadowRoot?.querySelectorAll(".header-cell"), c = o + (this.enableColumnVisibility ? 1 : 0);
110
+ s && s[c] ? this._startWidth = s[c].getBoundingClientRect().width : this._startWidth = 150;
111
+ }
112
+ _handleResizeMove(e) {
113
+ if (this._resizingColumnIndex !== null) {
114
+ let o = e.pageX - this._startX, s = Math.max(50, this._startWidth + o), c = this._visibleColumns[this._resizingColumnIndex], l = this.columns.findIndex((e) => e.key === c.key);
115
+ if (l !== -1) {
116
+ let e = [...this.columns];
117
+ e[l] = {
118
+ ...e[l],
119
+ width: `${s}px`
120
+ }, this.columns = e;
121
+ }
122
+ }
123
+ }
124
+ _handleResizeEnd() {
125
+ this._resizingColumnIndex = null;
126
+ }
127
+ get _filteredData() {
128
+ if (!this.enableFilter) return this.data;
129
+ let e = this.data, o = Object.keys(this._filterValues);
130
+ return o.length > 0 && (e = e.filter((e) => o.every((o) => {
131
+ let s = this._filterValues[o];
132
+ return !s || s.size === 0 ? !1 : s ? s.has(e[o]) : !0;
133
+ }))), e;
134
+ }
135
+ get _sortedData() {
136
+ let e = this._filteredData;
137
+ return this._sortKey ? [...e].sort((e, o) => {
138
+ let s = e[this._sortKey], c = o[this._sortKey];
139
+ if (s === c) return 0;
140
+ if (s == null) return 1;
141
+ if (c == null) return -1;
142
+ let l = 0;
143
+ return l = typeof s == "string" && typeof c == "string" ? s.localeCompare(c) : typeof s == "number" && typeof c == "number" ? s - c : String(s).localeCompare(String(c)), this._sortDirection === "asc" ? l : -l;
144
+ }) : e;
145
+ }
146
+ get _paginatedData() {
147
+ let e = (this._currentPage - 1) * this.itemsPerPage, o = e + this.itemsPerPage;
148
+ return this._sortedData.slice(e, o);
149
+ }
150
+ _handleCellClick(e, o) {
151
+ let s = e.id;
152
+ this._selectedRowId === s && this._selectedColumnKey === o ? (this._selectedRowId = null, this._selectedColumnKey = null) : (this._selectedRowId = s, this._selectedColumnKey = o);
153
+ }
154
+ _handleDragStart(e, o) {
155
+ if (this._resizingColumnIndex !== null) {
156
+ e.preventDefault();
157
+ return;
158
+ }
159
+ if (!this.columnReordering) {
160
+ e.preventDefault();
161
+ return;
162
+ }
163
+ if (this._draggedColumnIndex = o, e.dataTransfer) {
164
+ e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", o.toString());
165
+ let s = e.target;
166
+ e.dataTransfer.setDragImage(s, e.offsetX, e.offsetY);
167
+ }
168
+ }
169
+ _handleDragOver(e, o) {
170
+ this.columnReordering && (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "move"), this._draggedColumnIndex !== null && this._draggedColumnIndex !== o && (this._dragOverColumnIndex = o));
171
+ }
172
+ _handleDragLeave() {
173
+ this.columnReordering && (this._dragOverColumnIndex = null);
174
+ }
175
+ _handleDrop(e, o) {
176
+ if (this.columnReordering) {
177
+ if (e.preventDefault(), e.dataTransfer) {
178
+ let s = parseInt(e.dataTransfer.getData("text/plain"), 10);
179
+ if (this._draggedColumnIndex !== null && s !== o) {
180
+ let e = [...this._visibleColumns], [c] = e.splice(s, 1);
181
+ e.splice(o, 0, c);
182
+ let l = [], u = 0;
183
+ for (let o of this.columns) this._hiddenColumns.has(o.key) ? l.push(o) : l.push(e[u++]);
184
+ this.columns = l;
185
+ }
186
+ }
187
+ this._draggedColumnIndex = null, this._dragOverColumnIndex = null;
188
+ }
189
+ }
190
+ _handleDragEnd() {
191
+ this.columnReordering && (this._draggedColumnIndex = null, this._dragOverColumnIndex = null);
192
+ }
193
+ _formatLink(e, o) {
194
+ return e.replace(/{(\w+)}/g, (e, s) => o[s] === void 0 ? e : String(o[s]));
195
+ }
196
+ _renderCell(e, o) {
197
+ let s = e[o.key];
198
+ return o.linkTemplate ? html`<a href="${this._formatLink(o.linkTemplate, e)}">${s}</a>` : s;
199
+ }
200
+ _renderColumnMenu() {
201
+ return this._showColumnMenu ? html`
202
+ <div class="column-menu" @click=${(e) => e.stopPropagation()}>
203
+ ${this.columns.map((e) => html`
204
+ <label>
205
+ <input
206
+ type="checkbox"
207
+ .checked=${!this._hiddenColumns.has(e.key)}
208
+ @change=${() => this._toggleColumnVisibility(e.key)}
209
+ />
210
+ ${e.header}
211
+ </label>
212
+ `)}
213
+ </div>
214
+ ` : null;
215
+ }
216
+ _renderFilterMenu(e, o) {
217
+ if (this._activeFilterColumn !== e) return null;
218
+ let s = this._getUniqueValues(e).filter((e) => String(e).toLowerCase().includes(this._filterSearchTerm.toLowerCase())), l = this._filterValues[e], u = !l, d = u || !!l && s.every((e) => l.has(e));
219
+ return html`
220
+ <div class="${o > this._visibleColumns.length - 3 ? "filter-menu right-aligned" : "filter-menu"}" @click=${(e) => e.stopPropagation()}>
221
+ <div class="filter-search-container">
222
+ <input
223
+ type="text"
224
+ class="filter-search"
225
+ placeholder="Search..."
226
+ .value=${this._filterSearchTerm}
227
+ @input=${this._handleFilterSearch}
228
+ />
229
+ <button class="filter-sort-btn" @click=${this._toggleFilterMenuSort} title="Sort Values">
230
+ ${this._filterMenuSortDirection === "asc" ? "▲" : "▼"}
231
+ </button>
232
+ </div>
233
+ <div class="filter-list">
234
+ <label>
235
+ <input
236
+ type="checkbox"
237
+ .checked=${d}
238
+ @change=${(o) => this._handleSelectAll(e, o.target.checked)}
239
+ />
240
+ (Select All)
241
+ </label>
242
+ ${s.map((o) => html`
243
+ <label>
244
+ <input
245
+ type="checkbox"
246
+ .checked=${u || !!l && l.has(o)}
247
+ @change=${(s) => this._handleFilterValueChange(e, o, s.target.checked)}
248
+ />
249
+ ${String(o)}
250
+ </label>
251
+ `)}
252
+ </div>
253
+ </div>
254
+ `;
255
+ }
256
+ _renderHeader(e) {
257
+ return html`
258
+ <div class="grid-header">
259
+ <div class="grid-row" style=${styleMap(e)}>
260
+ ${when(this.enableColumnVisibility, () => html`
261
+ <div class="grid-cell header-cell settings-cell" @click=${this._toggleColumnMenu}>
262
+ ⚙️
263
+ ${this._renderColumnMenu()}
264
+ </div>
265
+ `)}
266
+ ${this._visibleColumns.map((e, o) => {
267
+ let s = {
268
+ "grid-cell": !0,
269
+ "header-cell": !0,
270
+ "drag-over": this._dragOverColumnIndex === o,
271
+ reorderable: this.columnReordering,
272
+ "align-center": e.align === "center",
273
+ "align-right": e.align === "right"
274
+ };
275
+ return html`
276
+ <div
277
+ .draggable=${this.columnReordering}
278
+ class=${classMap(s)}
279
+ @click=${() => this._handleHeaderClick(e.key)}
280
+ @dragstart=${(e) => this._handleDragStart(e, o)}
281
+ @dragover=${(e) => this._handleDragOver(e, o)}
282
+ @dragleave=${this._handleDragLeave}
283
+ @drop=${(e) => this._handleDrop(e, o)}
284
+ @dragend=${this._handleDragEnd}
285
+ >
286
+ <span class="header-text">${e.header}</span>
287
+ <div class="header-icons">
288
+ ${when(this.enableFilter, () => html`
289
+ <span class="filter-icon ${this._isFilterActive(e.key) ? "active" : ""}" @click=${(o) => this._toggleFilterMenu(o, e.key)}>
290
+ <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
291
+ <polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"></polygon>
292
+ </svg>
293
+ </span>
294
+ `)}
295
+ ${this._sortKey === e.key ? html`<span class="sort-indicator">${this._sortDirection === "asc" ? "▲" : "▼"}</span>` : ""}
296
+ </div>
297
+ ${this._renderFilterMenu(e.key, o)}
298
+ <div class="resize-handle" @mousedown=${(e) => this._handleResizeStart(e, o)} @click=${(e) => e.stopPropagation()}></div>
299
+ </div>
300
+ `;
301
+ })}
302
+ </div>
303
+ </div>
304
+ `;
305
+ }
306
+ _renderBody(e) {
307
+ return html`
308
+ <div class="grid-body">
309
+ ${repeat(this._paginatedData, (e) => e.id, (o) => html`
310
+ <div class="grid-row ${this.rowClass ? this.rowClass(o) : ""}" style=${styleMap(e)}>
311
+ ${when(this.enableColumnVisibility, () => html`<div class="grid-cell data-cell"></div>`)}
312
+ ${this._visibleColumns.map((e) => {
313
+ let s = {
314
+ "grid-cell": !0,
315
+ "data-cell": !0,
316
+ selected: this._selectedRowId === o.id && this._selectedColumnKey === e.key,
317
+ "align-center": e.align === "center",
318
+ "align-right": e.align === "right",
319
+ [`col-${e.key}`]: !0
320
+ };
321
+ return html`
322
+ <div
323
+ title="${String(o[e.key] ?? "")}"
324
+ class=${classMap(s)}
325
+ @click=${() => this._handleCellClick(o, e.key)}
326
+ >
327
+ ${this._renderCell(o, e)}
328
+ </div>
329
+ `;
330
+ })}
331
+ </div>
332
+ `)}
333
+ </div>
334
+ `;
335
+ }
336
+ _renderPaginationControls() {
337
+ let e = this._sortedData.length, o = Math.ceil(e / this.itemsPerPage);
338
+ return o <= 1 ? "" : html`
339
+ <div class="pagination">
340
+ <div class="pagination-group">
341
+ <button @click=${() => this._currentPage = 1} ?disabled=${this._currentPage === 1}>&lt;&lt; First</button>
342
+ <button @click=${() => this._currentPage--} ?disabled=${this._currentPage === 1}>&lt; Previous</button>
343
+ </div>
344
+ <div class="pagination-info">
345
+ <span>Page ${this._currentPage} of ${o}</span>
346
+ </div>
347
+ <div class="pagination-group">
348
+ <button @click=${() => this._currentPage++} ?disabled=${this._currentPage === o}>Next &gt;</button>
349
+ <button @click=${() => this._currentPage = o} ?disabled=${this._currentPage === o}>Last &gt;&gt;</button>
350
+ </div>
351
+ </div>
352
+ `;
353
+ }
354
+ render() {
355
+ let e = { height: this.height }, o = { "grid-template-columns": this._gridColumnTemplate };
356
+ return html`
357
+ <div class="toolbar">
358
+ <div class="items-per-page">
359
+ <span>Rows per page:</span>
360
+ <select @change=${this._handleItemsPerPageChange} .value=${this.itemsPerPage.toString()}>
361
+ <option value="10">10</option>
362
+ <option value="20">20</option>
363
+ <option value="50">50</option>
364
+ </select>
365
+ </div>
366
+ </div>
367
+ <div class="grid-wrapper" style=${styleMap(e)}>
368
+ <div class="grid-container">
369
+ ${this._renderHeader(o)}
370
+ ${this._renderBody(o)}
371
+ </div>
372
+ </div>
373
+ ${this._renderPaginationControls()}
374
+ `;
375
+ }
376
+ static #e = this.styles = css`
377
+ :host {
378
+ display: block;
379
+ font-family: sans-serif;
380
+ }
381
+ /* Default styles for all elements inside the component */
382
+ * {
383
+ box-sizing: border-box;
384
+ color: #000; /* Default text color black */
385
+ }
386
+ input, select, button {
387
+ background-color: #fff; /* Default background white */
388
+ color: #000; /* Default text color black */
389
+ border: 1px solid #ccc;
390
+ }
391
+
392
+ .toolbar {
393
+ margin-bottom: 8px;
394
+ display: flex;
395
+ justify-content: flex-end;
396
+ align-items: center;
397
+ }
398
+ .toolbar button { padding: 6px 12px; border-radius: 4px; background-color: #f8f8f8; cursor: pointer; }
399
+ .toolbar button:hover { background-color: #eee; }
400
+
401
+ .items-per-page {
402
+ display: flex;
403
+ align-items: center;
404
+ gap: 8px;
405
+ font-size: 0.9em;
406
+ }
407
+ .items-per-page select {
408
+ padding: 4px 8px;
409
+ border-radius: 4px;
410
+ cursor: pointer;
411
+ font-size: 1em;
412
+ color: #000;
413
+ }
414
+ .items-per-page select:hover {
415
+ border-color: #888;
416
+ }
417
+
418
+ .grid-wrapper {
419
+ overflow: auto;
420
+ border: 1px solid #ccc;
421
+ border-radius: 4px;
422
+ }
423
+ .grid-container {
424
+ display: inline-block;
425
+ min-width: 100%;
426
+ vertical-align: top;
427
+ }
428
+ .grid-header {
429
+ position: sticky;
430
+ top: 0;
431
+ z-index: 2;
432
+ background-color: #e8e8e8;
433
+ }
434
+ .grid-row {
435
+ display: grid;
436
+ border-bottom: 1px solid #ddd;
437
+ }
438
+ .grid-body .grid-row:last-of-type {
439
+ border-bottom: none;
440
+ }
441
+ .grid-cell {
442
+ padding: 12px 15px;
443
+ text-align: left;
444
+ color: #000;
445
+ overflow: hidden;
446
+ text-overflow: ellipsis;
447
+ white-space: nowrap;
448
+ border-right: 1px solid #ddd; /* Add right border */
449
+ }
450
+ .grid-cell:last-child {
451
+ border-right: none; /* Remove right border for last cell */
452
+ }
453
+ .grid-cell.align-center { justify-content: center; text-align: center; }
454
+ .grid-cell.align-right { justify-content: flex-end; text-align: right; }
455
+
456
+ .header-cell {
457
+ display: flex;
458
+ align-items: center;
459
+ justify-content: space-between;
460
+ font-weight: bold;
461
+ cursor: pointer;
462
+ user-select: none;
463
+ position: relative;
464
+ overflow: visible;
465
+ border-bottom: 1px solid #ccc; /* Add bottom border to header */
466
+ }
467
+ .header-text {
468
+ overflow: hidden;
469
+ text-overflow: ellipsis;
470
+ white-space: nowrap;
471
+ flex-grow: 1;
472
+ }
473
+ .header-icons {
474
+ display: flex;
475
+ align-items: center;
476
+ gap: 4px;
477
+ }
478
+ .sort-indicator {
479
+ flex-shrink: 0;
480
+ }
481
+ .filter-icon {
482
+ display: flex;
483
+ align-items: center;
484
+ justify-content: center;
485
+ width: 16px;
486
+ height: 16px;
487
+ color: #888; /* Default grey icon */
488
+ padding: 2px;
489
+ border-radius: 2px;
490
+ cursor: pointer;
491
+ }
492
+ .filter-icon:hover {
493
+ color: #000; /* Black icon on hover */
494
+ }
495
+ .filter-icon.active {
496
+ color: #007bff; /* Blue icon when active */
497
+ }
498
+
499
+ .settings-cell {
500
+ justify-content: center;
501
+ position: relative;
502
+ overflow: visible;
503
+ }
504
+
505
+ .column-menu, .filter-menu {
506
+ position: absolute;
507
+ top: 100%;
508
+ left: 0;
509
+ background-color: white;
510
+ border: 1px solid #ccc;
511
+ border-radius: 4px;
512
+ padding: 8px;
513
+ z-index: 100;
514
+ box-shadow: 0 2px 5px rgba(0,0,0,0.2);
515
+ min-width: 150px;
516
+ display: flex;
517
+ flex-direction: column;
518
+ gap: 4px;
519
+ max-height: 250px;
520
+ overflow-y: auto;
521
+ text-align: left;
522
+ font-weight: normal;
523
+ }
524
+ .filter-menu.right-aligned {
525
+ left: auto;
526
+ right: 0;
527
+ }
528
+ .column-menu label, .filter-menu label {
529
+ display: flex;
530
+ align-items: center;
531
+ gap: 8px;
532
+ cursor: pointer;
533
+ font-weight: normal;
534
+ white-space: nowrap;
535
+ padding: 2px 0;
536
+ }
537
+ .filter-search-container {
538
+ display: flex;
539
+ gap: 4px;
540
+ margin-bottom: 4px;
541
+ }
542
+ .filter-search {
543
+ width: 100%;
544
+ padding: 4px;
545
+ border-radius: 4px;
546
+ flex-grow: 1;
547
+ }
548
+ .filter-sort-btn {
549
+ padding: 4px 8px;
550
+ cursor: pointer;
551
+ font-size: 0.8em;
552
+ }
553
+
554
+ .data-cell { cursor: pointer; }
555
+ .data-cell.selected { background-color: #aedcff; }
556
+ .data-cell a { color: #007bff; text-decoration: none; }
557
+ .data-cell a:hover { text-decoration: underline; }
558
+
559
+ .header-cell.reorderable { cursor: grab; }
560
+ .header-cell.drag-over { background-color: #cceeff; }
561
+
562
+ .grid-body .grid-row:nth-of-type(even) { background-color: #f2f2f2; }
563
+ .grid-body .grid-row:hover { background-color: #e0e0e0; }
564
+
565
+ .pagination {
566
+ display: flex;
567
+ justify-content: space-between;
568
+ align-items: center;
569
+ padding: 12px 0;
570
+ font-size: 0.9em;
571
+ color: #000;
572
+ }
573
+ .pagination-group { display: flex; gap: 8px; }
574
+ .pagination button { padding: 6px 12px; border-radius: 4px; background-color: #f8f8f8; cursor: pointer; }
575
+ .pagination button:disabled { cursor: not-allowed; opacity: 0.5; }
576
+
577
+ .resize-handle {
578
+ position: absolute;
579
+ top: 0;
580
+ right: 0;
581
+ width: 5px;
582
+ height: 100%;
583
+ cursor: col-resize;
584
+ z-index: 1;
585
+ }
586
+ .resize-handle:hover {
587
+ background-color: #007bff;
588
+ }
589
+ `;
590
+ };
591
+ __decorate([property({ type: Array })], MyGrid.prototype, "columns", void 0), __decorate([property({ type: Array })], MyGrid.prototype, "data", void 0), __decorate([property({ type: Number })], MyGrid.prototype, "itemsPerPage", void 0), __decorate([property({ type: Boolean })], MyGrid.prototype, "columnReordering", void 0), __decorate([property({ type: String })], MyGrid.prototype, "height", void 0), __decorate([property({ type: Boolean })], MyGrid.prototype, "enableColumnVisibility", void 0), __decorate([property({ type: Boolean })], MyGrid.prototype, "enableFilter", void 0), __decorate([property()], MyGrid.prototype, "rowClass", void 0), __decorate([state()], MyGrid.prototype, "_sortKey", void 0), __decorate([state()], MyGrid.prototype, "_sortDirection", void 0), __decorate([state()], MyGrid.prototype, "_draggedColumnIndex", void 0), __decorate([state()], MyGrid.prototype, "_dragOverColumnIndex", void 0), __decorate([state()], MyGrid.prototype, "_selectedRowId", void 0), __decorate([state()], MyGrid.prototype, "_selectedColumnKey", void 0), __decorate([state()], MyGrid.prototype, "_filterValues", void 0), __decorate([state()], MyGrid.prototype, "_activeFilterColumn", void 0), __decorate([state()], MyGrid.prototype, "_filterSearchTerm", void 0), __decorate([state()], MyGrid.prototype, "_currentPage", void 0), __decorate([state()], MyGrid.prototype, "_hiddenColumns", void 0), __decorate([state()], MyGrid.prototype, "_showColumnMenu", void 0), __decorate([state()], MyGrid.prototype, "_filterMenuSortDirection", void 0), __decorate([state()], MyGrid.prototype, "_resizingColumnIndex", void 0), MyGrid = __decorate([customElement("my-grid")], MyGrid);
592
+ export { MyGrid as t };