angular-smart-table-pro 0.0.0-stage → 0.1.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.
package/dist/index.cjs ADDED
@@ -0,0 +1,1682 @@
1
+ 'use strict';
2
+
3
+ var common = require('@angular/common');
4
+ var core = require('@angular/core');
5
+
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __decorateClass = (decorators, target, key, kind) => {
8
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
9
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
10
+ if (decorator = decorators[i])
11
+ result = (decorator(result)) || result;
12
+ return result;
13
+ };
14
+ var DEFAULT_DATAGRID_CONFIG = {
15
+ theme: "light",
16
+ size: "md",
17
+ responsive: "auto",
18
+ dir: "auto",
19
+ locale: "en-US",
20
+ pageSize: 10,
21
+ pageSizeOptions: [5, 10, 25, 50, 100],
22
+ showToolbar: true,
23
+ showSearch: true,
24
+ showColumnFilters: false,
25
+ showColumnChooser: true,
26
+ showExport: true,
27
+ exportFormats: ["csv", "excel"],
28
+ sortable: true,
29
+ draggableColumns: true,
30
+ stickyHeader: true,
31
+ striped: false,
32
+ accentColor: null
33
+ };
34
+ var NGX_DATAGRID_CONFIG = new core.InjectionToken(
35
+ "NGX_DATAGRID_CONFIG"
36
+ );
37
+ function provideEasyDataGrid(config) {
38
+ return core.makeEnvironmentProviders([
39
+ {
40
+ provide: NGX_DATAGRID_CONFIG,
41
+ useValue: config
42
+ }
43
+ ]);
44
+ }
45
+
46
+ // src/core/grid-engine.ts
47
+ function resolveCellValue(row, key) {
48
+ if (row === null || row === void 0) return void 0;
49
+ const record = row;
50
+ if (key in record) {
51
+ return record[key];
52
+ }
53
+ const parts = key.split(".");
54
+ let current = row;
55
+ for (const part of parts) {
56
+ if (current === null || current === void 0 || typeof current !== "object") {
57
+ return void 0;
58
+ }
59
+ current = current[part];
60
+ }
61
+ return current;
62
+ }
63
+ function formatCellDisplay(row, col) {
64
+ const raw = resolveCellValue(row, col.key);
65
+ if (col.format) {
66
+ return col.format(raw, row);
67
+ }
68
+ if (raw === null || raw === void 0) return "";
69
+ if (raw instanceof Date) {
70
+ return raw.toISOString().slice(0, 10);
71
+ }
72
+ if (typeof raw === "boolean") {
73
+ return raw ? "Yes" : "No";
74
+ }
75
+ return String(raw);
76
+ }
77
+ function filterRows(rows, columns, search, columnFilters) {
78
+ const globalTerm = search.trim().toLowerCase();
79
+ const activeColFilters = Object.entries(columnFilters).map(([k, v]) => [k, v.trim().toLowerCase()]).filter(([, v]) => v.length > 0);
80
+ if (!globalTerm && activeColFilters.length === 0) {
81
+ return [...rows];
82
+ }
83
+ const colMap = new Map(columns.map((c) => [c.key, c]));
84
+ return rows.filter((row) => {
85
+ for (const [key, term] of activeColFilters) {
86
+ const col = colMap.get(key);
87
+ const text = (col ? formatCellDisplay(row, col) : String(resolveCellValue(row, key) ?? "")).toLowerCase();
88
+ if (!text.includes(term)) {
89
+ return false;
90
+ }
91
+ }
92
+ if (!globalTerm) return true;
93
+ return columns.some((col) => {
94
+ if (col.filterable === false) return false;
95
+ return formatCellDisplay(row, col).toLowerCase().includes(globalTerm);
96
+ });
97
+ });
98
+ }
99
+ function compareValues(a, b) {
100
+ if (a === b) return 0;
101
+ if (a === null || a === void 0) return 1;
102
+ if (b === null || b === void 0) return -1;
103
+ if (typeof a === "number" && typeof b === "number") {
104
+ return a - b;
105
+ }
106
+ if (a instanceof Date && b instanceof Date) {
107
+ return a.getTime() - b.getTime();
108
+ }
109
+ if (typeof a === "boolean" && typeof b === "boolean") {
110
+ return a === b ? 0 : a ? -1 : 1;
111
+ }
112
+ return String(a).localeCompare(String(b), void 0, { numeric: true, sensitivity: "base" });
113
+ }
114
+ function sortRows(rows, columns, sort) {
115
+ if (!sort) return [...rows];
116
+ const col = columns.find((c) => c.key === sort.key);
117
+ const multiplier = sort.direction === "asc" ? 1 : -1;
118
+ return [...rows].sort((rowA, rowB) => {
119
+ const base = col?.sortBy ? col.sortBy(rowA, rowB) : compareValues(resolveCellValue(rowA, sort.key), resolveCellValue(rowB, sort.key));
120
+ return base * multiplier;
121
+ });
122
+ }
123
+ function paginateRows(rows, page, pageSize) {
124
+ const safeSize = Math.max(1, pageSize);
125
+ const totalItems = rows.length;
126
+ const totalPages = Math.max(1, Math.ceil(totalItems / safeSize));
127
+ const safePage = Math.min(totalPages, Math.max(1, page));
128
+ const startIdx = (safePage - 1) * safeSize;
129
+ const items = rows.slice(startIdx, startIdx + safeSize);
130
+ return {
131
+ items,
132
+ totalItems,
133
+ totalPages,
134
+ safePage,
135
+ startItem: totalItems === 0 ? 0 : startIdx + 1,
136
+ endItem: Math.min(totalItems, startIdx + items.length)
137
+ };
138
+ }
139
+ function reorderColumns(columns, fromKey, toKey) {
140
+ if (fromKey === toKey) return [...columns];
141
+ const fromIdx = columns.findIndex((c) => c.key === fromKey);
142
+ const toIdx = columns.findIndex((c) => c.key === toKey);
143
+ if (fromIdx === -1 || toIdx === -1) return [...columns];
144
+ const next = [...columns];
145
+ const [moved] = next.splice(fromIdx, 1);
146
+ if (!moved) return [...columns];
147
+ next.splice(toIdx, 0, moved);
148
+ return next;
149
+ }
150
+ function computeVirtualWindow(rows, options) {
151
+ const rowH = Math.max(24, options.rowHeight);
152
+ const overscan = options.overscan ?? 4;
153
+ const total = rows.length;
154
+ const totalHeightPx = total * rowH;
155
+ if (total === 0) {
156
+ return {
157
+ items: [],
158
+ startIndex: 0,
159
+ endIndex: 0,
160
+ topSpacerPx: 0,
161
+ bottomSpacerPx: 0,
162
+ totalHeightPx: 0
163
+ };
164
+ }
165
+ const rawStart = Math.floor(Math.max(0, options.scrollTop) / rowH);
166
+ const visibleCount = Math.ceil(Math.max(rowH, options.viewportHeight) / rowH);
167
+ const startIndex = Math.max(0, rawStart - overscan);
168
+ const endIndex = Math.min(total, rawStart + visibleCount + overscan);
169
+ return {
170
+ items: rows.slice(startIndex, endIndex),
171
+ startIndex,
172
+ endIndex,
173
+ topSpacerPx: startIndex * rowH,
174
+ bottomSpacerPx: Math.max(0, (total - endIndex) * rowH),
175
+ totalHeightPx
176
+ };
177
+ }
178
+
179
+ // src/core/export-utils.ts
180
+ function escapeCsvField(value) {
181
+ if (/[",\n\r]/.test(value)) {
182
+ return `"${value.replace(/"/g, '""')}"`;
183
+ }
184
+ return value;
185
+ }
186
+ function escapeXml(value) {
187
+ return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
188
+ }
189
+ function getExportableColumns(columns, includeHidden) {
190
+ return columns.filter((col) => {
191
+ if (col.exportable === false) return false;
192
+ if (!includeHidden && col.visible === false) return false;
193
+ return true;
194
+ });
195
+ }
196
+ function buildCsvContent(rows, columns, options = {}) {
197
+ const cols = getExportableColumns(columns, Boolean(options.includeHiddenColumns));
198
+ const headerLine = cols.map((c) => escapeCsvField(c.header)).join(",");
199
+ const dataLines = rows.map(
200
+ (row) => cols.map((col) => escapeCsvField(formatCellDisplay(row, col))).join(",")
201
+ );
202
+ return `\uFEFF${[headerLine, ...dataLines].join("\r\n")}`;
203
+ }
204
+ function buildExcelXmlContent(rows, columns, options = {}) {
205
+ const cols = getExportableColumns(columns, Boolean(options.includeHiddenColumns));
206
+ const sheetName = escapeXml((options.sheetName ?? "DataGrid").slice(0, 31));
207
+ const headerCells = cols.map(
208
+ (c) => `<Cell ss:StyleID="Header"><Data ss:Type="String">${escapeXml(c.header)}</Data></Cell>`
209
+ ).join("");
210
+ const bodyRows = rows.map((row) => {
211
+ const cells = cols.map((col) => {
212
+ const raw = resolveCellValue(row, col.key);
213
+ if (typeof raw === "number" && Number.isFinite(raw) && !col.format) {
214
+ return `<Cell><Data ss:Type="Number">${raw}</Data></Cell>`;
215
+ }
216
+ return `<Cell><Data ss:Type="String">${escapeXml(formatCellDisplay(row, col))}</Data></Cell>`;
217
+ }).join("");
218
+ return `<Row>${cells}</Row>`;
219
+ }).join("");
220
+ return `<?xml version="1.0" encoding="UTF-8"?>
221
+ <?mso-application progid="Excel.Sheet"?>
222
+ <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
223
+ xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
224
+ <Styles>
225
+ <Style ss:ID="Header">
226
+ <Font ss:Bold="1" ss:Color="#FFFFFF"/>
227
+ <Interior ss:Color="#4F46E5" ss:Pattern="Solid"/>
228
+ </Style>
229
+ </Styles>
230
+ <Worksheet ss:Name="${sheetName}">
231
+ <Table>
232
+ <Row>${headerCells}</Row>
233
+ ${bodyRows}
234
+ </Table>
235
+ </Worksheet>
236
+ </Workbook>`;
237
+ }
238
+ function triggerBrowserDownload(content, fileName, mimeType, doc) {
239
+ const targetDoc = doc ?? (typeof document !== "undefined" ? document : null);
240
+ if (!targetDoc || typeof URL === "undefined" || typeof Blob === "undefined") return;
241
+ const blob = new Blob([content], { type: mimeType });
242
+ const url = URL.createObjectURL(blob);
243
+ const link = targetDoc.createElement("a");
244
+ link.href = url;
245
+ link.download = fileName;
246
+ link.style.display = "none";
247
+ targetDoc.body.appendChild(link);
248
+ link.click();
249
+ targetDoc.body.removeChild(link);
250
+ URL.revokeObjectURL(url);
251
+ }
252
+ exports.NgxTableCellDirective = class NgxTableCellDirective {
253
+ constructor() {
254
+ this.ngxTableCell = core.input.required();
255
+ this.template = core.inject(core.TemplateRef);
256
+ }
257
+ };
258
+ const __ngCore = require('@angular/core');
259
+ const __ngCommon = require('@angular/common');
260
+ exports.NgxTableCellDirective.ɵfac = __ngCore.ɵɵngDeclareFactory({
261
+ minVersion: "12.0.0",
262
+ version: "19.2.25",
263
+ ngImport: __ngCore,
264
+ type: exports.NgxTableCellDirective,
265
+ deps: [],
266
+ target: __ngCore.ɵɵFactoryTarget.Directive
267
+ });
268
+ exports.NgxTableCellDirective.ɵdir = __ngCore.ɵɵngDeclareDirective({
269
+ minVersion: "17.2.0",
270
+ version: "19.2.25",
271
+ type: exports.NgxTableCellDirective,
272
+ isStandalone: true,
273
+ selector: "ng-template[ngxTableCell]",
274
+ inputs: {
275
+ ngxTableCell: { classPropertyName: "ngxTableCell", publicName: "ngxTableCell", isSignal: true, isRequired: true, transformFunction: null }
276
+ },
277
+ ngImport: __ngCore
278
+ });
279
+
280
+ // src/components/ngx-smart-table.styles.ts
281
+ var NGX_SMART_TABLE_STYLES = `
282
+ .nst-host {
283
+ --nst-accent: #4f46e5;
284
+ --nst-accent-soft: color-mix(in srgb, var(--nst-accent) 12%, transparent);
285
+ --nst-bg: #ffffff;
286
+ --nst-surface: #f8fafc;
287
+ --nst-surface-hover: #f1f5f9;
288
+ --nst-border: #e2e8f0;
289
+ --nst-text: #0f172a;
290
+ --nst-text-muted: #64748b;
291
+ --nst-radius: 12px;
292
+ --nst-radius-sm: 8px;
293
+ --nst-shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.1);
294
+ --nst-font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
295
+
296
+ display: block;
297
+ font-family: var(--nst-font);
298
+ color: var(--nst-text);
299
+ box-sizing: border-box;
300
+ }
301
+
302
+ .nst-host *,
303
+ .nst-host *::before,
304
+ .nst-host *::after {
305
+ box-sizing: border-box;
306
+ }
307
+
308
+ .nst-host[data-theme='dark'] {
309
+ --nst-accent: #6366f1;
310
+ --nst-bg: #0f172a;
311
+ --nst-surface: #1e293b;
312
+ --nst-surface-hover: #334155;
313
+ --nst-border: #334155;
314
+ --nst-text: #f8fafc;
315
+ --nst-text-muted: #94a3b8;
316
+ --nst-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.5);
317
+ }
318
+
319
+ @media (prefers-color-scheme: dark) {
320
+ .nst-host[data-theme='auto'] {
321
+ --nst-accent: #6366f1;
322
+ --nst-bg: #0f172a;
323
+ --nst-surface: #1e293b;
324
+ --nst-surface-hover: #334155;
325
+ --nst-border: #334155;
326
+ --nst-text: #f8fafc;
327
+ --nst-text-muted: #94a3b8;
328
+ --nst-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.5);
329
+ }
330
+ }
331
+
332
+ .nst-shell {
333
+ background: var(--nst-bg);
334
+ border: 1px solid var(--nst-border);
335
+ border-radius: var(--nst-radius);
336
+ box-shadow: var(--nst-shadow);
337
+ overflow: hidden;
338
+ }
339
+
340
+ .nst-toolbar {
341
+ display: flex;
342
+ align-items: center;
343
+ justify-content: space-between;
344
+ gap: 12px;
345
+ flex-wrap: wrap;
346
+ padding: 12px 16px;
347
+ background: var(--nst-surface);
348
+ border-bottom: 1px solid var(--nst-border);
349
+ }
350
+
351
+ .nst-toolbar-start,
352
+ .nst-toolbar-actions {
353
+ display: flex;
354
+ align-items: center;
355
+ gap: 8px;
356
+ flex-wrap: wrap;
357
+ }
358
+
359
+ .nst-search-box {
360
+ display: flex;
361
+ align-items: center;
362
+ gap: 8px;
363
+ background: var(--nst-bg);
364
+ border: 1px solid var(--nst-border);
365
+ border-radius: var(--nst-radius-sm);
366
+ padding: 0 10px;
367
+ height: 36px;
368
+ min-width: 220px;
369
+ }
370
+
371
+ .nst-search-box:focus-within {
372
+ border-color: var(--nst-accent);
373
+ box-shadow: 0 0 0 3px var(--nst-accent-soft);
374
+ }
375
+
376
+ .nst-search-icon {
377
+ color: var(--nst-text-muted);
378
+ flex-shrink: 0;
379
+ }
380
+
381
+ .nst-search-input {
382
+ border: none;
383
+ outline: none;
384
+ background: transparent;
385
+ color: var(--nst-text);
386
+ font-family: inherit;
387
+ font-size: 13px;
388
+ width: 100%;
389
+ }
390
+
391
+ .nst-selected-pill {
392
+ font-size: 12px;
393
+ font-weight: 600;
394
+ color: var(--nst-accent);
395
+ background: var(--nst-accent-soft);
396
+ padding: 4px 10px;
397
+ border-radius: 999px;
398
+ }
399
+
400
+ .nst-btn {
401
+ display: inline-flex;
402
+ align-items: center;
403
+ gap: 6px;
404
+ height: 34px;
405
+ padding: 0 12px;
406
+ border: 1px solid var(--nst-border);
407
+ border-radius: var(--nst-radius-sm);
408
+ background: var(--nst-bg);
409
+ color: var(--nst-text);
410
+ font-family: inherit;
411
+ font-size: 12.5px;
412
+ font-weight: 600;
413
+ cursor: pointer;
414
+ transition: background-color 0.14s ease, border-color 0.14s ease;
415
+ }
416
+
417
+ .nst-btn:hover {
418
+ background: var(--nst-surface-hover);
419
+ }
420
+
421
+ .nst-btn--active {
422
+ border-color: var(--nst-accent);
423
+ color: var(--nst-accent);
424
+ }
425
+
426
+ .nst-btn--accent {
427
+ background: var(--nst-accent);
428
+ border-color: var(--nst-accent);
429
+ color: #ffffff;
430
+ }
431
+
432
+ .nst-btn--accent:hover {
433
+ opacity: 0.92;
434
+ background: var(--nst-accent);
435
+ }
436
+
437
+ .nst-dropdown-wrap {
438
+ position: relative;
439
+ }
440
+
441
+ .nst-chooser-menu {
442
+ position: absolute;
443
+ top: calc(100% + 6px);
444
+ inset-inline-end: 0;
445
+ min-width: 210px;
446
+ background: var(--nst-bg);
447
+ border: 1px solid var(--nst-border);
448
+ border-radius: var(--nst-radius-sm);
449
+ box-shadow: var(--nst-shadow);
450
+ padding: 8px;
451
+ z-index: 40;
452
+ display: flex;
453
+ flex-direction: column;
454
+ gap: 4px;
455
+ }
456
+
457
+ .nst-chooser-head {
458
+ display: flex;
459
+ justify-content: space-between;
460
+ align-items: center;
461
+ font-size: 11.5px;
462
+ font-weight: 700;
463
+ color: var(--nst-text-muted);
464
+ padding: 4px 6px 6px;
465
+ border-bottom: 1px solid var(--nst-border);
466
+ }
467
+
468
+ .nst-chooser-reset {
469
+ border: none;
470
+ background: transparent;
471
+ color: var(--nst-accent);
472
+ font-size: 11.5px;
473
+ font-weight: 600;
474
+ cursor: pointer;
475
+ }
476
+
477
+ .nst-chooser-item {
478
+ display: flex;
479
+ align-items: center;
480
+ gap: 8px;
481
+ padding: 5px 6px;
482
+ border-radius: 6px;
483
+ font-size: 13px;
484
+ cursor: pointer;
485
+ }
486
+
487
+ .nst-chooser-item:hover {
488
+ background: var(--nst-surface-hover);
489
+ }
490
+
491
+ .nst-scroll-region {
492
+ position: relative;
493
+ overflow-x: auto;
494
+ width: 100%;
495
+ }
496
+
497
+ .nst-scroll-region--virtual {
498
+ overflow-y: auto;
499
+ }
500
+
501
+ .nst-loading-bar {
502
+ position: sticky;
503
+ top: 0;
504
+ left: 0;
505
+ right: 0;
506
+ height: 3px;
507
+ background: linear-gradient(90deg, transparent, var(--nst-accent), transparent);
508
+ animation: nst-load 1.1s infinite linear;
509
+ z-index: 20;
510
+ }
511
+
512
+ @keyframes nst-load {
513
+ from { transform: translateX(-100%); }
514
+ to { transform: translateX(100%); }
515
+ }
516
+
517
+ .nst-table {
518
+ width: 100%;
519
+ border-collapse: collapse;
520
+ text-align: start;
521
+ font-size: 13.5px;
522
+ }
523
+
524
+ .nst-thead--sticky {
525
+ position: sticky;
526
+ top: 0;
527
+ z-index: 10;
528
+ }
529
+
530
+ .nst-th {
531
+ background: var(--nst-surface);
532
+ color: var(--nst-text-muted);
533
+ font-size: 12px;
534
+ font-weight: 700;
535
+ text-transform: uppercase;
536
+ letter-spacing: 0.03em;
537
+ padding: 11px 14px;
538
+ border-bottom: 1px solid var(--nst-border);
539
+ white-space: nowrap;
540
+ user-select: none;
541
+ }
542
+
543
+ .nst-host[data-size='compact'] .nst-th,
544
+ .nst-host[data-size='compact'] .nst-td {
545
+ padding: 7px 10px;
546
+ }
547
+
548
+ .nst-host[data-size='comfortable'] .nst-th,
549
+ .nst-host[data-size='comfortable'] .nst-td {
550
+ padding: 15px 18px;
551
+ }
552
+
553
+ .nst-th--sortable {
554
+ cursor: pointer;
555
+ }
556
+
557
+ .nst-th--sortable:hover {
558
+ background: var(--nst-surface-hover);
559
+ color: var(--nst-text);
560
+ }
561
+
562
+ .nst-th--dragging {
563
+ opacity: 0.45;
564
+ }
565
+
566
+ .nst-th--drag-over {
567
+ box-shadow: inset 3px 0 0 var(--nst-accent);
568
+ background: var(--nst-accent-soft);
569
+ }
570
+
571
+ .nst-th--select,
572
+ .nst-td--select {
573
+ width: 44px;
574
+ text-align: center;
575
+ }
576
+
577
+ .nst-th-inner {
578
+ display: flex;
579
+ align-items: center;
580
+ gap: 6px;
581
+ }
582
+
583
+ .nst-th-inner[data-align='center'] {
584
+ justify-content: center;
585
+ }
586
+
587
+ .nst-th-inner[data-align='end'] {
588
+ justify-content: flex-end;
589
+ }
590
+
591
+ .nst-drag-grip {
592
+ color: var(--nst-text-muted);
593
+ opacity: 0.55;
594
+ cursor: grab;
595
+ font-size: 12px;
596
+ letter-spacing: -1px;
597
+ }
598
+
599
+ .nst-sort-icon {
600
+ font-size: 11px;
601
+ opacity: 0.4;
602
+ }
603
+
604
+ .nst-sort-icon--active {
605
+ opacity: 1;
606
+ color: var(--nst-accent);
607
+ }
608
+
609
+ .nst-th-filter {
610
+ background: var(--nst-bg);
611
+ padding: 6px 10px;
612
+ border-bottom: 1px solid var(--nst-border);
613
+ }
614
+
615
+ .nst-col-filter-input {
616
+ width: 100%;
617
+ height: 28px;
618
+ padding: 0 8px;
619
+ border: 1px solid var(--nst-border);
620
+ border-radius: 6px;
621
+ background: var(--nst-surface);
622
+ color: var(--nst-text);
623
+ font-family: inherit;
624
+ font-size: 12px;
625
+ outline: none;
626
+ }
627
+
628
+ .nst-col-filter-input:focus {
629
+ border-color: var(--nst-accent);
630
+ }
631
+
632
+ .nst-tr {
633
+ border-bottom: 1px solid var(--nst-border);
634
+ transition: background-color 0.1s ease;
635
+ }
636
+
637
+ .nst-table--striped .nst-tr:nth-child(even) {
638
+ background: color-mix(in srgb, var(--nst-surface) 55%, transparent);
639
+ }
640
+
641
+ .nst-tr:hover {
642
+ background: var(--nst-surface-hover);
643
+ }
644
+
645
+ .nst-tr--selected {
646
+ background: var(--nst-accent-soft) !important;
647
+ }
648
+
649
+ .nst-td {
650
+ padding: 11px 14px;
651
+ color: var(--nst-text);
652
+ vertical-align: middle;
653
+ }
654
+
655
+ .nst-td[data-align='center'] {
656
+ text-align: center;
657
+ }
658
+
659
+ .nst-td[data-align='end'] {
660
+ text-align: end;
661
+ }
662
+
663
+ .nst-cell-num {
664
+ font-variant-numeric: tabular-nums;
665
+ font-weight: 600;
666
+ }
667
+
668
+ .nst-badge {
669
+ display: inline-flex;
670
+ align-items: center;
671
+ padding: 3px 9px;
672
+ border-radius: 999px;
673
+ font-size: 11.5px;
674
+ font-weight: 600;
675
+ background: var(--nst-surface);
676
+ color: var(--nst-text);
677
+ }
678
+
679
+ .nst-badge[data-tone='success'] {
680
+ background: rgba(16, 185, 129, 0.14);
681
+ color: #10b981;
682
+ }
683
+
684
+ .nst-badge[data-tone='warning'] {
685
+ background: rgba(245, 158, 11, 0.16);
686
+ color: #d97706;
687
+ }
688
+
689
+ .nst-badge[data-tone='danger'] {
690
+ background: rgba(239, 68, 68, 0.15);
691
+ color: #ef4444;
692
+ }
693
+
694
+ .nst-badge[data-tone='info'] {
695
+ background: rgba(59, 130, 246, 0.15);
696
+ color: #3b82f6;
697
+ }
698
+
699
+ .nst-bool {
700
+ color: var(--nst-text-muted);
701
+ font-weight: 700;
702
+ }
703
+
704
+ .nst-bool--true {
705
+ color: #10b981;
706
+ }
707
+
708
+ .nst-checkbox {
709
+ width: 15px;
710
+ height: 15px;
711
+ accent-color: var(--nst-accent);
712
+ cursor: pointer;
713
+ }
714
+
715
+ .nst-empty {
716
+ text-align: center;
717
+ padding: 36px 16px;
718
+ color: var(--nst-text-muted);
719
+ font-size: 13.5px;
720
+ }
721
+
722
+ .nst-spacer-row td {
723
+ padding: 0 !important;
724
+ border: none !important;
725
+ }
726
+
727
+ .nst-pagination {
728
+ display: flex;
729
+ align-items: center;
730
+ justify-content: space-between;
731
+ gap: 12px;
732
+ flex-wrap: wrap;
733
+ padding: 10px 16px;
734
+ background: var(--nst-surface);
735
+ border-top: 1px solid var(--nst-border);
736
+ font-size: 12.5px;
737
+ color: var(--nst-text-muted);
738
+ }
739
+
740
+ .nst-page-controls {
741
+ display: flex;
742
+ align-items: center;
743
+ gap: 12px;
744
+ }
745
+
746
+ .nst-pagesize-label {
747
+ display: inline-flex;
748
+ align-items: center;
749
+ gap: 6px;
750
+ }
751
+
752
+ .nst-pagesize-select {
753
+ height: 30px;
754
+ padding: 0 8px;
755
+ border: 1px solid var(--nst-border);
756
+ border-radius: 6px;
757
+ background: var(--nst-bg);
758
+ color: var(--nst-text);
759
+ font-family: inherit;
760
+ font-size: 12.5px;
761
+ }
762
+
763
+ .nst-page-btns {
764
+ display: inline-flex;
765
+ align-items: center;
766
+ gap: 4px;
767
+ }
768
+
769
+ .nst-page-btn {
770
+ min-width: 30px;
771
+ height: 30px;
772
+ padding: 0 8px;
773
+ border: 1px solid var(--nst-border);
774
+ border-radius: 6px;
775
+ background: var(--nst-bg);
776
+ color: var(--nst-text);
777
+ font-family: inherit;
778
+ font-size: 12.5px;
779
+ font-weight: 600;
780
+ cursor: pointer;
781
+ }
782
+
783
+ .nst-page-btn:hover:not(:disabled):not(.nst-page-btn--active) {
784
+ background: var(--nst-surface-hover);
785
+ }
786
+
787
+ .nst-page-btn--active {
788
+ background: var(--nst-accent);
789
+ border-color: var(--nst-accent);
790
+ color: #ffffff;
791
+ }
792
+
793
+ .nst-page-btn:disabled {
794
+ opacity: 0.4;
795
+ cursor: not-allowed;
796
+ }
797
+
798
+ /* Responsive Card Layout on Mobile */
799
+ @media (max-width: 680px) {
800
+ .nst-host[data-responsive='auto'] .nst-table thead,
801
+ .nst-host[data-responsive='cards'] .nst-table thead {
802
+ display: none;
803
+ }
804
+
805
+ .nst-host[data-responsive='auto'] .nst-tr,
806
+ .nst-host[data-responsive='cards'] .nst-tr {
807
+ display: block;
808
+ margin: 10px 12px;
809
+ border: 1px solid var(--nst-border);
810
+ border-radius: var(--nst-radius-sm);
811
+ padding: 8px 12px;
812
+ background: var(--nst-bg);
813
+ }
814
+
815
+ .nst-host[data-responsive='auto'] .nst-td,
816
+ .nst-host[data-responsive='cards'] .nst-td {
817
+ display: flex;
818
+ justify-content: space-between;
819
+ align-items: center;
820
+ padding: 6px 0;
821
+ border-bottom: 1px dashed var(--nst-border);
822
+ }
823
+
824
+ .nst-host[data-responsive='auto'] .nst-td:last-child,
825
+ .nst-host[data-responsive='cards'] .nst-td:last-child {
826
+ border-bottom: none;
827
+ }
828
+
829
+ .nst-host[data-responsive='auto'] .nst-td::before,
830
+ .nst-host[data-responsive='cards'] .nst-td::before {
831
+ content: attr(data-label);
832
+ font-size: 11.5px;
833
+ font-weight: 700;
834
+ color: var(--nst-text-muted);
835
+ text-transform: uppercase;
836
+ }
837
+ }
838
+
839
+ .nst-host[data-responsive='cards'] .nst-table thead {
840
+ display: none;
841
+ }
842
+
843
+ .nst-host[data-responsive='cards'] .nst-tr {
844
+ display: block;
845
+ margin: 10px 12px;
846
+ border: 1px solid var(--nst-border);
847
+ border-radius: var(--nst-radius-sm);
848
+ padding: 8px 12px;
849
+ }
850
+
851
+ .nst-host[data-responsive='cards'] .nst-td {
852
+ display: flex;
853
+ justify-content: space-between;
854
+ align-items: center;
855
+ padding: 6px 0;
856
+ border-bottom: 1px dashed var(--nst-border);
857
+ }
858
+
859
+ .nst-host[data-responsive='cards'] .nst-td::before {
860
+ content: attr(data-label);
861
+ font-size: 11.5px;
862
+ font-weight: 700;
863
+ color: var(--nst-text-muted);
864
+ }
865
+ `;
866
+
867
+ // src/components/ngx-smart-table.template.ts
868
+ var NGX_SMART_TABLE_TEMPLATE = `
869
+ <div class="nst-shell">
870
+ @if (resolvedShowToolbar()) {
871
+ <div class="nst-toolbar">
872
+ <div class="nst-toolbar-start">
873
+ @if (resolvedShowSearch()) {
874
+ <div class="nst-search-box">
875
+ <svg class="nst-search-icon" viewBox="0 0 20 20" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.8" aria-hidden="true">
876
+ <circle cx="8.5" cy="8.5" r="5.5" />
877
+ <path d="M13 13l4 4" stroke-linecap="round" />
878
+ </svg>
879
+ <input
880
+ type="search"
881
+ class="nst-search-input"
882
+ [value]="search()"
883
+ [placeholder]="searchPlaceholder()"
884
+ (input)="onSearchInput($event)"
885
+ />
886
+ </div>
887
+ }
888
+
889
+ @if (selectedRows().length > 0) {
890
+ <span class="nst-selected-pill">
891
+ {{ selectedRows().length }} {{ isPersianUi() ? '\u0645\u0648\u0631\u062F \u0627\u0646\u062A\u062E\u0627\u0628\u200C\u0634\u062F\u0647' : 'selected' }}
892
+ </span>
893
+ }
894
+ </div>
895
+
896
+ <div class="nst-toolbar-actions">
897
+ @if (resolvedShowColumnChooser()) {
898
+ <div class="nst-dropdown-wrap">
899
+ <button
900
+ type="button"
901
+ class="nst-btn"
902
+ [class.nst-btn--active]="columnChooserOpen()"
903
+ (click)="toggleColumnChooser($event)"
904
+ >
905
+ <svg viewBox="0 0 20 20" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8">
906
+ <rect x="2" y="3" width="16" height="14" rx="2" />
907
+ <path d="M7.5 3v14M12.5 3v14" />
908
+ </svg>
909
+ <span>{{ isPersianUi() ? '\u0633\u062A\u0648\u0646\u200C\u0647\u0627' : 'Columns' }}</span>
910
+ </button>
911
+
912
+ @if (columnChooserOpen()) {
913
+ <div class="nst-chooser-menu" (click)="$event.stopPropagation()">
914
+ <div class="nst-chooser-head">
915
+ <span>{{ isPersianUi() ? '\u0646\u0645\u0627\u06CC\u0634 \u0633\u062A\u0648\u0646\u200C\u0647\u0627' : 'Visible Columns' }}</span>
916
+ <button type="button" class="nst-chooser-reset" (click)="resetColumns()">
917
+ {{ isPersianUi() ? '\u0628\u0627\u0632\u0646\u0634\u0627\u0646\u06CC' : 'Reset' }}
918
+ </button>
919
+ </div>
920
+ @for (col of orderedColumns(); track col.key) {
921
+ <label class="nst-chooser-item">
922
+ <input
923
+ type="checkbox"
924
+ [checked]="isColumnVisible(col.key)"
925
+ (change)="toggleColumnVisibility(col.key)"
926
+ />
927
+ <span>{{ col.header }}</span>
928
+ </label>
929
+ }
930
+ </div>
931
+ }
932
+ </div>
933
+ }
934
+
935
+ @if (canExportFormat('csv')) {
936
+ <button type="button" class="nst-btn" (click)="exportCsv()">
937
+ <svg viewBox="0 0 20 20" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8">
938
+ <path d="M10 3v9m0 0l-3.5-3.5M10 12l3.5-3.5M4 15.5h12" stroke-linecap="round" stroke-linejoin="round" />
939
+ </svg>
940
+ <span>CSV</span>
941
+ </button>
942
+ }
943
+ @if (canExportFormat('excel')) {
944
+ <button type="button" class="nst-btn nst-btn--accent" (click)="exportExcel()">
945
+ <svg viewBox="0 0 20 20" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8">
946
+ <path d="M10 3v9m0 0l-3.5-3.5M10 12l3.5-3.5M4 15.5h12" stroke-linecap="round" stroke-linejoin="round" />
947
+ </svg>
948
+ <span>Excel</span>
949
+ </button>
950
+ }
951
+ </div>
952
+ </div>
953
+ }
954
+
955
+ <div
956
+ class="nst-scroll-region"
957
+ [class.nst-scroll-region--virtual]="virtualScroll()"
958
+ [style.maxHeight.px]="virtualScroll() ? viewportHeight() : null"
959
+ (scroll)="onVirtualScroll($event)"
960
+ >
961
+ @if (loading()) {
962
+ <div class="nst-loading-bar" aria-label="Loading"></div>
963
+ }
964
+
965
+ <table class="nst-table" [class.nst-table--striped]="resolvedStriped()">
966
+ <thead [class.nst-thead--sticky]="resolvedStickyHeader()">
967
+ <tr>
968
+ @if (selectionMode() !== 'none') {
969
+ <th class="nst-th nst-th--select">
970
+ @if (selectionMode() === 'multiple') {
971
+ <input
972
+ type="checkbox"
973
+ class="nst-checkbox"
974
+ [checked]="allVisibleSelected()"
975
+ [indeterminate]="someVisibleSelected() && !allVisibleSelected()"
976
+ aria-label="Select all rows"
977
+ (change)="toggleSelectAll()"
978
+ />
979
+ }
980
+ </th>
981
+ }
982
+
983
+ @for (col of visibleColumns(); track col.key) {
984
+ <th
985
+ class="nst-th"
986
+ [style.width]="col.width ?? null"
987
+ [style.minWidth]="col.minWidth ?? null"
988
+ [class.nst-th--sortable]="isColumnSortable(col)"
989
+ [class.nst-th--dragging]="draggedColumnKey() === col.key"
990
+ [class.nst-th--drag-over]="dragOverColumnKey() === col.key"
991
+ [attr.draggable]="resolvedDraggableColumns() && col.draggable !== false"
992
+ (dragstart)="onColumnDragStart($event, col.key)"
993
+ (dragover)="onColumnDragOver($event, col.key)"
994
+ (drop)="onColumnDrop($event, col.key)"
995
+ (dragend)="onColumnDragEnd()"
996
+ (click)="onSortClick(col)"
997
+ >
998
+ <div class="nst-th-inner" [attr.data-align]="col.align ?? 'start'">
999
+ @if (resolvedDraggableColumns() && col.draggable !== false) {
1000
+ <span class="nst-drag-grip" aria-hidden="true">\u22EE\u22EE</span>
1001
+ }
1002
+ <span class="nst-th-title">{{ col.header }}</span>
1003
+ @if (isColumnSortable(col)) {
1004
+ <span class="nst-sort-icon" [class.nst-sort-icon--active]="sort()?.key === col.key">
1005
+ @if (sort()?.key === col.key && sort()?.direction === 'asc') {
1006
+ \u25B2
1007
+ } @else if (sort()?.key === col.key && sort()?.direction === 'desc') {
1008
+ \u25BC
1009
+ } @else {
1010
+ \u21C5
1011
+ }
1012
+ </span>
1013
+ }
1014
+ </div>
1015
+ </th>
1016
+ }
1017
+ </tr>
1018
+
1019
+ @if (resolvedShowColumnFilters()) {
1020
+ <tr class="nst-filter-row">
1021
+ @if (selectionMode() !== 'none') {
1022
+ <th class="nst-th-filter"></th>
1023
+ }
1024
+ @for (col of visibleColumns(); track col.key) {
1025
+ <th class="nst-th-filter">
1026
+ @if (col.filterable !== false) {
1027
+ <input
1028
+ type="text"
1029
+ class="nst-col-filter-input"
1030
+ [value]="columnFilters()[col.key] ?? ''"
1031
+ [placeholder]="(isPersianUi() ? '\u0641\u06CC\u0644\u062A\u0631 ' : 'Filter ') + col.header"
1032
+ (input)="onColumnFilterInput(col.key, $event)"
1033
+ />
1034
+ }
1035
+ </th>
1036
+ }
1037
+ </tr>
1038
+ }
1039
+ </thead>
1040
+
1041
+ <tbody>
1042
+ @if (virtualScroll() && virtualWindow().topSpacerPx > 0) {
1043
+ <tr class="nst-spacer-row" aria-hidden="true">
1044
+ <td [attr.colspan]="totalColumnSpan()" [style.height.px]="virtualWindow().topSpacerPx"></td>
1045
+ </tr>
1046
+ }
1047
+
1048
+ @for (row of renderedRows(); track trackRow($index, row); let rowIdx = $index) {
1049
+ <tr
1050
+ class="nst-tr"
1051
+ [class.nst-tr--selected]="isRowSelected(row)"
1052
+ [style.height.px]="virtualScroll() ? rowHeight() : null"
1053
+ (click)="onRowClicked(row)"
1054
+ >
1055
+ @if (selectionMode() !== 'none') {
1056
+ <td class="nst-td nst-td--select" (click)="$event.stopPropagation()">
1057
+ <input
1058
+ [type]="selectionMode() === 'single' ? 'radio' : 'checkbox'"
1059
+ class="nst-checkbox"
1060
+ [checked]="isRowSelected(row)"
1061
+ (change)="toggleRowSelection(row)"
1062
+ />
1063
+ </td>
1064
+ }
1065
+
1066
+ @for (col of visibleColumns(); track col.key) {
1067
+ <td
1068
+ class="nst-td"
1069
+ [attr.data-label]="col.header"
1070
+ [attr.data-align]="col.align ?? 'start'"
1071
+ >
1072
+ @if (getCellTemplate(col.key); as tpl) {
1073
+ <ng-container
1074
+ [ngTemplateOutlet]="tpl"
1075
+ [ngTemplateOutletContext]="{
1076
+ $implicit: row,
1077
+ row: row,
1078
+ value: getRawCellValue(row, col.key),
1079
+ index: rowIdx
1080
+ }"
1081
+ />
1082
+ } @else if (col.type === 'badge') {
1083
+ <span class="nst-badge" [attr.data-tone]="getBadgeTone(row, col)">
1084
+ {{ formatCell(row, col) }}
1085
+ </span>
1086
+ } @else if (col.type === 'boolean') {
1087
+ <span class="nst-bool" [class.nst-bool--true]="!!getRawCellValue(row, col.key)">
1088
+ {{ getRawCellValue(row, col.key) ? '\u2713' : '\u2014' }}
1089
+ </span>
1090
+ } @else {
1091
+ <span class="nst-cell-text" [class.nst-cell-num]="col.type === 'number'">
1092
+ {{ formatCell(row, col) }}
1093
+ </span>
1094
+ }
1095
+ </td>
1096
+ }
1097
+ </tr>
1098
+ } @empty {
1099
+ <tr>
1100
+ <td class="nst-empty" [attr.colspan]="totalColumnSpan()">
1101
+ {{ emptyText() || (isPersianUi() ? '\u062F\u0627\u062F\u0647\u200C\u0627\u06CC \u0628\u0631\u0627\u06CC \u0646\u0645\u0627\u06CC\u0634 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F' : 'No matching records found') }}
1102
+ </td>
1103
+ </tr>
1104
+ }
1105
+
1106
+ @if (virtualScroll() && virtualWindow().bottomSpacerPx > 0) {
1107
+ <tr class="nst-spacer-row" aria-hidden="true">
1108
+ <td [attr.colspan]="totalColumnSpan()" [style.height.px]="virtualWindow().bottomSpacerPx"></td>
1109
+ </tr>
1110
+ }
1111
+ </tbody>
1112
+ </table>
1113
+ </div>
1114
+
1115
+ @if (!virtualScroll() && pageable()) {
1116
+ <div class="nst-pagination">
1117
+ <div class="nst-page-info">
1118
+ @if (isPersianUi()) {
1119
+ \u0646\u0645\u0627\u06CC\u0634 {{ paginationInfo().startItem }} \u062A\u0627 {{ paginationInfo().endItem }} \u0627\u0632 {{ paginationInfo().totalItems }}
1120
+ } @else {
1121
+ Showing <strong>{{ paginationInfo().startItem }}\u2013{{ paginationInfo().endItem }}</strong> of
1122
+ <strong>{{ paginationInfo().totalItems }}</strong>
1123
+ }
1124
+ </div>
1125
+
1126
+ <div class="nst-page-controls">
1127
+ <label class="nst-pagesize-label">
1128
+ <span>{{ isPersianUi() ? '\u062A\u0639\u062F\u0627\u062F:' : 'Rows:' }}</span>
1129
+ <select class="nst-pagesize-select" [value]="pageSize()" (change)="onPageSizeChange($event)">
1130
+ @for (opt of resolvedPageSizeOptions(); track opt) {
1131
+ <option [value]="opt" [selected]="opt === pageSize()">{{ opt }}</option>
1132
+ }
1133
+ </select>
1134
+ </label>
1135
+
1136
+ <div class="nst-page-btns">
1137
+ <button
1138
+ type="button"
1139
+ class="nst-page-btn"
1140
+ [disabled]="paginationInfo().safePage <= 1"
1141
+ aria-label="Previous page"
1142
+ (click)="goToPage(paginationInfo().safePage - 1)"
1143
+ >
1144
+ {{ resolvedDir() === 'rtl' ? '\u203A' : '\u2039' }}
1145
+ </button>
1146
+
1147
+ @for (p of visiblePageNumbers(); track p) {
1148
+ <button
1149
+ type="button"
1150
+ class="nst-page-btn"
1151
+ [class.nst-page-btn--active]="p === paginationInfo().safePage"
1152
+ (click)="goToPage(p)"
1153
+ >
1154
+ {{ p }}
1155
+ </button>
1156
+ }
1157
+
1158
+ <button
1159
+ type="button"
1160
+ class="nst-page-btn"
1161
+ [disabled]="paginationInfo().safePage >= paginationInfo().totalPages"
1162
+ aria-label="Next page"
1163
+ (click)="goToPage(paginationInfo().safePage + 1)"
1164
+ >
1165
+ {{ resolvedDir() === 'rtl' ? '\u2039' : '\u203A' }}
1166
+ </button>
1167
+ </div>
1168
+ </div>
1169
+ </div>
1170
+ }
1171
+ </div>
1172
+ `;
1173
+
1174
+ // src/components/ngx-smart-table.component.ts
1175
+ exports.NgxSmartTableComponent = class NgxSmartTableComponent {
1176
+ constructor() {
1177
+ this.destroyRef = core.inject(core.DestroyRef);
1178
+ this.platformId = core.inject(core.PLATFORM_ID);
1179
+ this.doc = core.inject(common.DOCUMENT);
1180
+ this.injectedConfig = core.inject(NGX_DATAGRID_CONFIG, { optional: true });
1181
+ this.isBrowser = common.isPlatformBrowser(this.platformId);
1182
+ this.cellTemplates = core.contentChildren(exports.NgxTableCellDirective);
1183
+ this.data = core.input.required();
1184
+ this.columns = core.input.required();
1185
+ this.rowKey = core.input("id");
1186
+ this.serverSide = core.input(false);
1187
+ this.totalItems = core.input(null);
1188
+ this.loading = core.input(false);
1189
+ this.pageable = core.input(true);
1190
+ this.page = core.model(1);
1191
+ this.pageSize = core.model(
1192
+ this.injectedConfig?.pageSize ?? DEFAULT_DATAGRID_CONFIG.pageSize
1193
+ );
1194
+ this.pageSizeOptions = core.input(void 0);
1195
+ this.selectionMode = core.input("none");
1196
+ this.selectedRows = core.model([]);
1197
+ this.virtualScroll = core.input(false);
1198
+ this.rowHeight = core.input(46);
1199
+ this.viewportHeight = core.input(420);
1200
+ this.overscan = core.input(4);
1201
+ this.showToolbar = core.input(void 0);
1202
+ this.showSearch = core.input(void 0);
1203
+ this.showColumnFilters = core.input(void 0);
1204
+ this.showColumnChooser = core.input(void 0);
1205
+ this.showExport = core.input(void 0);
1206
+ this.exportFormats = core.input(void 0);
1207
+ this.sortable = core.input(void 0);
1208
+ this.draggableColumns = core.input(void 0);
1209
+ this.stickyHeader = core.input(void 0);
1210
+ this.striped = core.input(void 0);
1211
+ this.exportFileName = core.input("table-export");
1212
+ this.emptyText = core.input("");
1213
+ this.theme = core.input(void 0);
1214
+ this.size = core.input(void 0);
1215
+ this.responsive = core.input(void 0);
1216
+ this.dir = core.input(void 0);
1217
+ this.locale = core.input(void 0);
1218
+ this.accentColor = core.input(void 0);
1219
+ this.queryChange = core.output();
1220
+ this.rowClick = core.output();
1221
+ this.columnsChange = core.output();
1222
+ this.search = core.model("");
1223
+ this.columnFilters = core.model({});
1224
+ this.sort = core.model(null);
1225
+ this.columnOrder = core.signal([]);
1226
+ this.hiddenColumnKeys = core.signal(/* @__PURE__ */ new Set());
1227
+ this.columnChooserOpen = core.signal(false);
1228
+ this.draggedColumnKey = core.signal(null);
1229
+ this.dragOverColumnKey = core.signal(null);
1230
+ this.scrollTop = core.signal(0);
1231
+ this.resolvedTheme = core.computed(
1232
+ () => this.theme() ?? this.injectedConfig?.theme ?? DEFAULT_DATAGRID_CONFIG.theme
1233
+ );
1234
+ this.resolvedSize = core.computed(
1235
+ () => this.size() ?? this.injectedConfig?.size ?? DEFAULT_DATAGRID_CONFIG.size
1236
+ );
1237
+ this.resolvedResponsive = core.computed(
1238
+ () => this.responsive() ?? this.injectedConfig?.responsive ?? DEFAULT_DATAGRID_CONFIG.responsive
1239
+ );
1240
+ this.resolvedLocale = core.computed(
1241
+ () => this.locale() ?? this.injectedConfig?.locale ?? DEFAULT_DATAGRID_CONFIG.locale
1242
+ );
1243
+ this.isPersianUi = core.computed(
1244
+ () => this.resolvedLocale().toLowerCase().startsWith("fa")
1245
+ );
1246
+ this.resolvedDir = core.computed(() => {
1247
+ const cfg = this.dir() ?? this.injectedConfig?.dir ?? DEFAULT_DATAGRID_CONFIG.dir;
1248
+ if (cfg === "ltr" || cfg === "rtl") return cfg;
1249
+ const loc = this.resolvedLocale().toLowerCase();
1250
+ return loc.startsWith("fa") || loc.startsWith("ar") || loc.startsWith("he") ? "rtl" : "ltr";
1251
+ });
1252
+ this.resolvedAccentColor = core.computed(
1253
+ () => this.accentColor() ?? this.injectedConfig?.accentColor ?? DEFAULT_DATAGRID_CONFIG.accentColor
1254
+ );
1255
+ this.resolvedShowToolbar = core.computed(
1256
+ () => this.showToolbar() ?? this.injectedConfig?.showToolbar ?? DEFAULT_DATAGRID_CONFIG.showToolbar
1257
+ );
1258
+ this.resolvedShowSearch = core.computed(
1259
+ () => this.showSearch() ?? this.injectedConfig?.showSearch ?? DEFAULT_DATAGRID_CONFIG.showSearch
1260
+ );
1261
+ this.resolvedShowColumnFilters = core.computed(
1262
+ () => this.showColumnFilters() ?? this.injectedConfig?.showColumnFilters ?? DEFAULT_DATAGRID_CONFIG.showColumnFilters
1263
+ );
1264
+ this.resolvedShowColumnChooser = core.computed(
1265
+ () => this.showColumnChooser() ?? this.injectedConfig?.showColumnChooser ?? DEFAULT_DATAGRID_CONFIG.showColumnChooser
1266
+ );
1267
+ this.resolvedShowExport = core.computed(
1268
+ () => this.showExport() ?? this.injectedConfig?.showExport ?? DEFAULT_DATAGRID_CONFIG.showExport
1269
+ );
1270
+ this.resolvedExportFormats = core.computed(
1271
+ () => this.exportFormats() ?? this.injectedConfig?.exportFormats ?? DEFAULT_DATAGRID_CONFIG.exportFormats
1272
+ );
1273
+ this.resolvedSortable = core.computed(
1274
+ () => this.sortable() ?? this.injectedConfig?.sortable ?? DEFAULT_DATAGRID_CONFIG.sortable
1275
+ );
1276
+ this.resolvedDraggableColumns = core.computed(
1277
+ () => this.draggableColumns() ?? this.injectedConfig?.draggableColumns ?? DEFAULT_DATAGRID_CONFIG.draggableColumns
1278
+ );
1279
+ this.resolvedStickyHeader = core.computed(
1280
+ () => this.stickyHeader() ?? this.injectedConfig?.stickyHeader ?? DEFAULT_DATAGRID_CONFIG.stickyHeader
1281
+ );
1282
+ this.resolvedStriped = core.computed(
1283
+ () => this.striped() ?? this.injectedConfig?.striped ?? DEFAULT_DATAGRID_CONFIG.striped
1284
+ );
1285
+ this.resolvedPageSizeOptions = core.computed(
1286
+ () => this.pageSizeOptions() ?? this.injectedConfig?.pageSizeOptions ?? DEFAULT_DATAGRID_CONFIG.pageSizeOptions
1287
+ );
1288
+ this.searchPlaceholder = core.computed(
1289
+ () => this.isPersianUi() ? "\u062C\u0633\u062A\u062C\u0648 \u062F\u0631 \u062C\u062F\u0648\u0644..." : "Search table..."
1290
+ );
1291
+ this.orderedColumns = core.computed(() => {
1292
+ const custom = this.columnOrder();
1293
+ return custom.length > 0 ? custom : this.columns();
1294
+ });
1295
+ this.visibleColumns = core.computed(() => {
1296
+ const hidden = this.hiddenColumnKeys();
1297
+ return this.orderedColumns().filter((col) => !hidden.has(col.key));
1298
+ });
1299
+ this.totalColumnSpan = core.computed(
1300
+ () => this.visibleColumns().length + (this.selectionMode() !== "none" ? 1 : 0)
1301
+ );
1302
+ this.processedRows = core.computed(() => {
1303
+ const raw = this.data();
1304
+ if (this.serverSide()) {
1305
+ return raw;
1306
+ }
1307
+ const filtered = filterRows(raw, this.orderedColumns(), this.search(), this.columnFilters());
1308
+ return sortRows(filtered, this.orderedColumns(), this.resolvedSortable() ? this.sort() : null);
1309
+ });
1310
+ this.paginationInfo = core.computed(() => {
1311
+ const rows = this.processedRows();
1312
+ if (this.serverSide()) {
1313
+ const total = this.totalItems() ?? rows.length;
1314
+ const safeSize = Math.max(1, this.pageSize());
1315
+ const totalPages = Math.max(1, Math.ceil(total / safeSize));
1316
+ const safePage = Math.min(totalPages, Math.max(1, this.page()));
1317
+ const startItem = total === 0 ? 0 : (safePage - 1) * safeSize + 1;
1318
+ const endItem = Math.min(total, startItem + rows.length - 1);
1319
+ return {
1320
+ items: rows,
1321
+ totalItems: total,
1322
+ totalPages,
1323
+ safePage,
1324
+ startItem,
1325
+ endItem: total === 0 ? 0 : endItem
1326
+ };
1327
+ }
1328
+ if (!this.pageable()) {
1329
+ return {
1330
+ items: rows,
1331
+ totalItems: rows.length,
1332
+ totalPages: 1,
1333
+ safePage: 1,
1334
+ startItem: rows.length === 0 ? 0 : 1,
1335
+ endItem: rows.length
1336
+ };
1337
+ }
1338
+ return paginateRows(rows, this.page(), this.pageSize());
1339
+ });
1340
+ this.virtualWindow = core.computed(
1341
+ () => computeVirtualWindow(this.processedRows(), {
1342
+ scrollTop: this.scrollTop(),
1343
+ viewportHeight: this.viewportHeight(),
1344
+ rowHeight: this.rowHeight(),
1345
+ overscan: Math.max(0, this.overscan())
1346
+ })
1347
+ );
1348
+ this.renderedRows = core.computed(
1349
+ () => this.virtualScroll() ? this.virtualWindow().items : this.paginationInfo().items
1350
+ );
1351
+ this.visiblePageNumbers = core.computed(() => {
1352
+ const total = this.paginationInfo().totalPages;
1353
+ const current = this.paginationInfo().safePage;
1354
+ const maxButtons = 5;
1355
+ let start = Math.max(1, current - Math.floor(maxButtons / 2));
1356
+ const end = Math.min(total, start + maxButtons - 1);
1357
+ start = Math.max(1, end - maxButtons + 1);
1358
+ return Array.from({ length: end - start + 1 }, (_, i) => start + i);
1359
+ });
1360
+ this.allVisibleSelected = core.computed(() => {
1361
+ const visible = this.renderedRows();
1362
+ return visible.length > 0 && visible.every((row) => this.isRowSelected(row));
1363
+ });
1364
+ this.someVisibleSelected = core.computed(() => {
1365
+ const visible = this.renderedRows();
1366
+ return visible.some((row) => this.isRowSelected(row));
1367
+ });
1368
+ core.effect(() => {
1369
+ const cols = this.columns();
1370
+ this.columnOrder.set([...cols]);
1371
+ const initialHidden = new Set(cols.filter((c) => c.visible === false).map((c) => c.key));
1372
+ this.hiddenColumnKeys.set(initialHidden);
1373
+ });
1374
+ if (this.isBrowser) {
1375
+ const closeChooser = () => {
1376
+ if (this.columnChooserOpen()) {
1377
+ this.columnChooserOpen.set(false);
1378
+ }
1379
+ };
1380
+ this.doc.addEventListener("click", closeChooser);
1381
+ this.destroyRef.onDestroy(() => this.doc.removeEventListener("click", closeChooser));
1382
+ }
1383
+ }
1384
+ getCellTemplate(key) {
1385
+ const found = this.cellTemplates().find((item) => item.ngxTableCell() === key);
1386
+ return found?.template ?? null;
1387
+ }
1388
+ getRawCellValue(row, key) {
1389
+ return resolveCellValue(row, key);
1390
+ }
1391
+ formatCell(row, col) {
1392
+ return formatCellDisplay(row, col);
1393
+ }
1394
+ getBadgeTone(row, col) {
1395
+ const val = resolveCellValue(row, col.key);
1396
+ return col.badgeTone ? col.badgeTone(val, row) : "neutral";
1397
+ }
1398
+ trackRow(index, row) {
1399
+ const id = resolveCellValue(row, this.rowKey());
1400
+ return id !== void 0 ? id : index;
1401
+ }
1402
+ isColumnVisible(key) {
1403
+ return !this.hiddenColumnKeys().has(key);
1404
+ }
1405
+ isColumnSortable(col) {
1406
+ return this.resolvedSortable() && col.sortable !== false;
1407
+ }
1408
+ canExportFormat(format) {
1409
+ return this.resolvedShowExport() && this.resolvedExportFormats().includes(format);
1410
+ }
1411
+ toggleColumnChooser(event) {
1412
+ event.stopPropagation();
1413
+ this.columnChooserOpen.update((v) => !v);
1414
+ }
1415
+ toggleColumnVisibility(key) {
1416
+ this.hiddenColumnKeys.update((prev) => {
1417
+ const next = new Set(prev);
1418
+ if (next.has(key)) {
1419
+ next.delete(key);
1420
+ } else if (this.visibleColumns().length > 1) {
1421
+ next.add(key);
1422
+ }
1423
+ return next;
1424
+ });
1425
+ }
1426
+ resetColumns() {
1427
+ const cols = this.columns();
1428
+ this.columnOrder.set([...cols]);
1429
+ this.hiddenColumnKeys.set(new Set(cols.filter((c) => c.visible === false).map((c) => c.key)));
1430
+ this.columnsChange.emit(this.orderedColumns());
1431
+ }
1432
+ onSearchInput(event) {
1433
+ const value = event.target.value;
1434
+ this.search.set(value);
1435
+ this.page.set(1);
1436
+ this.emitQuery();
1437
+ }
1438
+ onColumnFilterInput(key, event) {
1439
+ const value = event.target.value;
1440
+ this.columnFilters.update((prev) => ({ ...prev, [key]: value }));
1441
+ this.page.set(1);
1442
+ this.emitQuery();
1443
+ }
1444
+ onSortClick(col) {
1445
+ if (!this.isColumnSortable(col)) return;
1446
+ const current = this.sort();
1447
+ let next;
1448
+ if (!current || current.key !== col.key) {
1449
+ next = { key: col.key, direction: "asc" };
1450
+ } else if (current.direction === "asc") {
1451
+ next = { key: col.key, direction: "desc" };
1452
+ } else {
1453
+ next = null;
1454
+ }
1455
+ this.sort.set(next);
1456
+ this.emitQuery();
1457
+ }
1458
+ onColumnDragStart(event, key) {
1459
+ if (!this.resolvedDraggableColumns()) return;
1460
+ this.draggedColumnKey.set(key);
1461
+ if (event.dataTransfer) {
1462
+ event.dataTransfer.effectAllowed = "move";
1463
+ event.dataTransfer.setData("text/plain", key);
1464
+ }
1465
+ }
1466
+ onColumnDragOver(event, key) {
1467
+ if (!this.resolvedDraggableColumns() || !this.draggedColumnKey()) return;
1468
+ event.preventDefault();
1469
+ this.dragOverColumnKey.set(key);
1470
+ }
1471
+ onColumnDrop(event, targetKey) {
1472
+ event.preventDefault();
1473
+ const sourceKey = this.draggedColumnKey();
1474
+ this.draggedColumnKey.set(null);
1475
+ this.dragOverColumnKey.set(null);
1476
+ if (!sourceKey || sourceKey === targetKey) return;
1477
+ const reordered = reorderColumns(this.orderedColumns(), sourceKey, targetKey);
1478
+ this.columnOrder.set(reordered);
1479
+ this.columnsChange.emit(reordered);
1480
+ }
1481
+ onColumnDragEnd() {
1482
+ this.draggedColumnKey.set(null);
1483
+ this.dragOverColumnKey.set(null);
1484
+ }
1485
+ isRowSelected(row) {
1486
+ const key = resolveCellValue(row, this.rowKey());
1487
+ return this.selectedRows().some((item) => {
1488
+ if (key !== void 0) {
1489
+ return resolveCellValue(item, this.rowKey()) === key;
1490
+ }
1491
+ return item === row;
1492
+ });
1493
+ }
1494
+ toggleRowSelection(row) {
1495
+ const mode = this.selectionMode();
1496
+ if (mode === "none") return;
1497
+ if (mode === "single") {
1498
+ this.selectedRows.set(this.isRowSelected(row) ? [] : [row]);
1499
+ return;
1500
+ }
1501
+ const key = resolveCellValue(row, this.rowKey());
1502
+ if (this.isRowSelected(row)) {
1503
+ this.selectedRows.update(
1504
+ (list) => list.filter(
1505
+ (item) => key !== void 0 ? resolveCellValue(item, this.rowKey()) !== key : item !== row
1506
+ )
1507
+ );
1508
+ } else {
1509
+ this.selectedRows.update((list) => [...list, row]);
1510
+ }
1511
+ }
1512
+ toggleSelectAll() {
1513
+ if (this.selectionMode() !== "multiple") return;
1514
+ const visible = this.renderedRows();
1515
+ if (this.allVisibleSelected()) {
1516
+ const visibleKeys = new Set(visible.map((r) => resolveCellValue(r, this.rowKey())));
1517
+ this.selectedRows.update(
1518
+ (list) => list.filter((item) => {
1519
+ const k = resolveCellValue(item, this.rowKey());
1520
+ return k !== void 0 ? !visibleKeys.has(k) : !visible.includes(item);
1521
+ })
1522
+ );
1523
+ return;
1524
+ }
1525
+ const merged = [...this.selectedRows()];
1526
+ for (const row of visible) {
1527
+ if (!this.isRowSelected(row)) {
1528
+ merged.push(row);
1529
+ }
1530
+ }
1531
+ this.selectedRows.set(merged);
1532
+ }
1533
+ onRowClicked(row) {
1534
+ this.rowClick.emit(row);
1535
+ }
1536
+ goToPage(targetPage) {
1537
+ const safe = Math.min(this.paginationInfo().totalPages, Math.max(1, targetPage));
1538
+ if (safe === this.page()) return;
1539
+ this.page.set(safe);
1540
+ this.emitQuery();
1541
+ }
1542
+ onPageSizeChange(event) {
1543
+ const nextSize = Number(event.target.value);
1544
+ if (!Number.isFinite(nextSize) || nextSize <= 0) return;
1545
+ this.pageSize.set(nextSize);
1546
+ this.page.set(1);
1547
+ this.emitQuery();
1548
+ }
1549
+ onVirtualScroll(event) {
1550
+ if (!this.virtualScroll()) return;
1551
+ this.scrollTop.set(event.target.scrollTop);
1552
+ }
1553
+ exportCsv(options = {}) {
1554
+ const rows = options.onlySelected && this.selectedRows().length > 0 ? this.selectedRows() : this.selectedRows().length > 0 ? this.selectedRows() : this.processedRows();
1555
+ const cols = this.orderedColumns().map((c) => ({
1556
+ ...c,
1557
+ visible: this.isColumnVisible(c.key)
1558
+ }));
1559
+ const csv = buildCsvContent(rows, cols, options);
1560
+ const file = `${options.fileName ?? this.exportFileName()}.csv`;
1561
+ if (this.isBrowser) {
1562
+ triggerBrowserDownload(csv, file, "text/csv;charset=utf-8;", this.doc);
1563
+ }
1564
+ return csv;
1565
+ }
1566
+ exportExcel(options = {}) {
1567
+ const rows = options.onlySelected && this.selectedRows().length > 0 ? this.selectedRows() : this.selectedRows().length > 0 ? this.selectedRows() : this.processedRows();
1568
+ const cols = this.orderedColumns().map((c) => ({
1569
+ ...c,
1570
+ visible: this.isColumnVisible(c.key)
1571
+ }));
1572
+ const xml = buildExcelXmlContent(rows, cols, options);
1573
+ const file = `${options.fileName ?? this.exportFileName()}.xls`;
1574
+ if (this.isBrowser) {
1575
+ triggerBrowserDownload(xml, file, "application/vnd.ms-excel;charset=utf-8;", this.doc);
1576
+ }
1577
+ return xml;
1578
+ }
1579
+ emitQuery() {
1580
+ this.queryChange.emit({
1581
+ page: this.page(),
1582
+ pageSize: this.pageSize(),
1583
+ search: this.search(),
1584
+ filters: this.columnFilters(),
1585
+ sort: this.sort()
1586
+ });
1587
+ }
1588
+ };
1589
+
1590
+ exports.NgxSmartTableComponent.ɵfac = __ngCore.ɵɵngDeclareFactory({
1591
+ minVersion: "12.0.0",
1592
+ version: "19.2.25",
1593
+ ngImport: __ngCore,
1594
+ type: exports.NgxSmartTableComponent,
1595
+ deps: [],
1596
+ target: __ngCore.ɵɵFactoryTarget.Component
1597
+ });
1598
+ exports.NgxSmartTableComponent.ɵcmp = __ngCore.ɵɵngDeclareComponent({
1599
+ minVersion: "17.2.0",
1600
+ version: "19.2.25",
1601
+ type: exports.NgxSmartTableComponent,
1602
+ isStandalone: true,
1603
+ selector: "ngx-smart-table",
1604
+ inputs: {
1605
+ data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null },
1606
+ columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null },
1607
+ rowKey: { classPropertyName: "rowKey", publicName: "rowKey", isSignal: true, isRequired: false, transformFunction: null },
1608
+ serverSide: { classPropertyName: "serverSide", publicName: "serverSide", isSignal: true, isRequired: false, transformFunction: null },
1609
+ totalItems: { classPropertyName: "totalItems", publicName: "totalItems", isSignal: true, isRequired: false, transformFunction: null },
1610
+ loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null },
1611
+ pageable: { classPropertyName: "pageable", publicName: "pageable", isSignal: true, isRequired: false, transformFunction: null },
1612
+ page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null },
1613
+ pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null },
1614
+ pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null },
1615
+ selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null },
1616
+ selectedRows: { classPropertyName: "selectedRows", publicName: "selectedRows", isSignal: true, isRequired: false, transformFunction: null },
1617
+ virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null },
1618
+ rowHeight: { classPropertyName: "rowHeight", publicName: "rowHeight", isSignal: true, isRequired: false, transformFunction: null },
1619
+ viewportHeight: { classPropertyName: "viewportHeight", publicName: "viewportHeight", isSignal: true, isRequired: false, transformFunction: null },
1620
+ overscan: { classPropertyName: "overscan", publicName: "overscan", isSignal: true, isRequired: false, transformFunction: null },
1621
+ showToolbar: { classPropertyName: "showToolbar", publicName: "showToolbar", isSignal: true, isRequired: false, transformFunction: null },
1622
+ showSearch: { classPropertyName: "showSearch", publicName: "showSearch", isSignal: true, isRequired: false, transformFunction: null },
1623
+ showColumnFilters: { classPropertyName: "showColumnFilters", publicName: "showColumnFilters", isSignal: true, isRequired: false, transformFunction: null },
1624
+ showColumnChooser: { classPropertyName: "showColumnChooser", publicName: "showColumnChooser", isSignal: true, isRequired: false, transformFunction: null },
1625
+ showExport: { classPropertyName: "showExport", publicName: "showExport", isSignal: true, isRequired: false, transformFunction: null },
1626
+ exportFormats: { classPropertyName: "exportFormats", publicName: "exportFormats", isSignal: true, isRequired: false, transformFunction: null },
1627
+ sortable: { classPropertyName: "sortable", publicName: "sortable", isSignal: true, isRequired: false, transformFunction: null },
1628
+ draggableColumns: { classPropertyName: "draggableColumns", publicName: "draggableColumns", isSignal: true, isRequired: false, transformFunction: null },
1629
+ stickyHeader: { classPropertyName: "stickyHeader", publicName: "stickyHeader", isSignal: true, isRequired: false, transformFunction: null },
1630
+ striped: { classPropertyName: "striped", publicName: "striped", isSignal: true, isRequired: false, transformFunction: null },
1631
+ exportFileName: { classPropertyName: "exportFileName", publicName: "exportFileName", isSignal: true, isRequired: false, transformFunction: null },
1632
+ emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null },
1633
+ theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null },
1634
+ size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null },
1635
+ responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null },
1636
+ dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null },
1637
+ locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null },
1638
+ accentColor: { classPropertyName: "accentColor", publicName: "accentColor", isSignal: true, isRequired: false, transformFunction: null },
1639
+ search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null },
1640
+ columnFilters: { classPropertyName: "columnFilters", publicName: "columnFilters", isSignal: true, isRequired: false, transformFunction: null },
1641
+ sort: { classPropertyName: "sort", publicName: "sort", isSignal: true, isRequired: false, transformFunction: null }
1642
+ },
1643
+ outputs: {"pageChange":"pageChange","pageSizeChange":"pageSizeChange","selectedRowsChange":"selectedRowsChange","searchChange":"searchChange","columnFiltersChange":"columnFiltersChange","sortChange":"sortChange","queryChange":"queryChange","rowClick":"rowClick","columnsChange":"columnsChange"},
1644
+ host: {
1645
+ properties: {
1646
+ "attr.data-theme": "resolvedTheme()",
1647
+ "attr.data-size": "resolvedSize()",
1648
+ "attr.data-responsive": "resolvedResponsive()",
1649
+ "attr.dir": "resolvedDir()",
1650
+ "style.--nst-accent": "resolvedAccentColor()"
1651
+ },
1652
+ classAttribute: "nst-host"
1653
+ },
1654
+ queries: [
1655
+ { propertyName: "cellTemplates", predicate: exports.NgxTableCellDirective, descendants: true, isSignal: true }
1656
+ ],
1657
+ exportAs: ["ngxSmartTable"],
1658
+ ngImport: __ngCore,
1659
+ template: NGX_SMART_TABLE_TEMPLATE,
1660
+ styles: [NGX_SMART_TABLE_STYLES],
1661
+ dependencies: [
1662
+ { kind: "directive", type: __ngCommon.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }
1663
+ ],
1664
+ changeDetection: __ngCore.ChangeDetectionStrategy.OnPush,
1665
+ encapsulation: __ngCore.ViewEncapsulation.None
1666
+ });
1667
+
1668
+ exports.DEFAULT_DATAGRID_CONFIG = DEFAULT_DATAGRID_CONFIG;
1669
+ exports.NGX_DATAGRID_CONFIG = NGX_DATAGRID_CONFIG;
1670
+ exports.buildCsvContent = buildCsvContent;
1671
+ exports.buildExcelXmlContent = buildExcelXmlContent;
1672
+ exports.computeVirtualWindow = computeVirtualWindow;
1673
+ exports.filterRows = filterRows;
1674
+ exports.formatCellDisplay = formatCellDisplay;
1675
+ exports.paginateRows = paginateRows;
1676
+ exports.provideEasyDataGrid = provideEasyDataGrid;
1677
+ exports.reorderColumns = reorderColumns;
1678
+ exports.resolveCellValue = resolveCellValue;
1679
+ exports.sortRows = sortRows;
1680
+ exports.triggerBrowserDownload = triggerBrowserDownload;
1681
+ //# sourceMappingURL=index.cjs.map
1682
+ //# sourceMappingURL=index.cjs.map