@onereach/ui-components 26.4.0 → 26.4.1-beta.5876.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.
@@ -0,0 +1,1775 @@
1
+ import { O as ee } from "./OrCheckbox-WPBzlvaV.mjs";
2
+ import { O as oe } from "./OrPagination-BXzDa-Su.mjs";
3
+ import { O as re } from "./OrSearch-CRFuNmg2.mjs";
4
+ import { O as ne } from "./OrSkeletonArea.vue_vue_type_script_lang-jgRhbZ0X.mjs";
5
+ import { defineComponent as G, ref as S, computed as l, openBlock as o, createElementBlock as p, normalizeClass as m, renderSlot as i, createCommentVNode as g, resolveComponent as c, normalizeStyle as K, Fragment as q, createBlock as y, watch as te, createElementVNode as le, withModifiers as x, createVNode as H, mergeProps as se, withCtx as b, onMounted as ie, createSlots as Y, normalizeProps as de, guardReactiveProps as ue, renderList as Q, createTextVNode as Z, toDisplayString as _ } from "vue";
6
+ import { _ as C } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
7
+ import { O as ce } from "./OrDatePicker-D-Do0tSf.mjs";
8
+ import { O as me } from "./OrDateTimePicker-myqJkQxy.mjs";
9
+ import "./OrDateTimePicker.vue_vue_type_script_lang-xnGNoSUB.mjs";
10
+ import "@onereach/ui-components-common/types";
11
+ import { O as fe } from "./OrInput-nExtCSw8.mjs";
12
+ import { O as ge } from "./OrRating-CAwz23JA.mjs";
13
+ import { O as pe } from "./OrSelect-BeL73iXu.mjs";
14
+ import { O as he } from "./OrSwitch-BtoXDsZx.mjs";
15
+ import { O as ve } from "./OrTagInput-B2U22gXE.mjs";
16
+ import { O as be } from "./OrTimePicker-QPUb8olp.mjs";
17
+ import { O as ye } from "./OrIcon-k8cyvh-D.mjs";
18
+ import { useElementSize as ke } from "@vueuse/core";
19
+ import { O as Oe } from "./OrNotification-BkjmRseb.mjs";
20
+ const $e = [
21
+ // Layout
22
+ "layout-row",
23
+ // Interactivity
24
+ "interactivity-default",
25
+ // Box
26
+ "h-[calc(theme(spacing.2xl)+theme(spacing.xs))]",
27
+ // Spacing
28
+ "px-sm+",
29
+ "py-0",
30
+ "gap-xl",
31
+ // Theme
32
+ "theme-border-disabled border-t-1",
33
+ "dark:theme-border-disabled-dark"
34
+ ], we = [
35
+ // Typography
36
+ "typography-body-2-semibold"
37
+ ], De = G({
38
+ name: "OrDataGridFooter",
39
+ expose: [
40
+ "root"
41
+ ],
42
+ setup() {
43
+ const e = S(), t = l(() => [
44
+ "or-data-grid-footer-v3",
45
+ ...$e
46
+ ]), n = l(() => [
47
+ ...we
48
+ ]);
49
+ return {
50
+ root: e,
51
+ rootStyles: t,
52
+ statusStyles: n
53
+ };
54
+ }
55
+ }), Se = {
56
+ key: 1,
57
+ class: /* @__PURE__ */ m(["grow"])
58
+ };
59
+ function Te(e, t, n, h, v, f) {
60
+ return o(), p("div", {
61
+ ref: "root",
62
+ class: m(e.rootStyles)
63
+ }, [
64
+ e.$slots.status ? (o(), p("div", {
65
+ key: 0,
66
+ class: m(e.statusStyles)
67
+ }, [
68
+ i(e.$slots, "status")
69
+ ], 2)) : g("", !0),
70
+ i(e.$slots, "actions"),
71
+ e.$slots.paging ? (o(), p("div", Se)) : g("", !0),
72
+ i(e.$slots, "paging")
73
+ ], 2);
74
+ }
75
+ const Ge = /* @__PURE__ */ C(De, [["render", Te]]), Ce = [
76
+ // Layout
77
+ "layout-row items-start gap-md",
78
+ // Interactivity
79
+ "interactivity-default",
80
+ // Box
81
+ "h-3xl"
82
+ ], Ve = [
83
+ // Typography
84
+ "typography-headline-2"
85
+ ], Me = G({
86
+ name: "OrDataGridHeader",
87
+ expose: [
88
+ "root"
89
+ ],
90
+ setup() {
91
+ const e = S(), t = l(() => [
92
+ "or-data-grid-header-v3",
93
+ ...Ce
94
+ ]), n = l(() => [
95
+ ...Ve
96
+ ]);
97
+ return {
98
+ root: e,
99
+ rootStyles: t,
100
+ titleStyles: n
101
+ };
102
+ }
103
+ }), Re = {
104
+ key: 1,
105
+ class: /* @__PURE__ */ m(["grow"])
106
+ };
107
+ function Ie(e, t, n, h, v, f) {
108
+ return o(), p("div", {
109
+ ref: "root",
110
+ class: m(e.rootStyles)
111
+ }, [
112
+ e.$slots.title ? (o(), p("div", {
113
+ key: 0,
114
+ class: m(e.titleStyles)
115
+ }, [
116
+ i(e.$slots, "title")
117
+ ], 2)) : g("", !0),
118
+ e.$slots.searching || e.$slots.extraActions ? (o(), p("div", Re)) : g("", !0),
119
+ i(e.$slots, "searching"),
120
+ e.$slots.extraActions ? i(e.$slots, "extraActions", { key: 2 }) : g("", !0)
121
+ ], 2);
122
+ }
123
+ const He = /* @__PURE__ */ C(Me, [["render", Ie]]);
124
+ var k = /* @__PURE__ */ ((e) => (e.Standard = "standard", e.Comfortable = "comfortable", e.Compact = "compact", e.Dynamic = "dynamic", e))(k || {});
125
+ const B = "52px", Fe = [
126
+ // Layout
127
+ "layout-row items-center",
128
+ // Spacing
129
+ "px-sm+",
130
+ "py-xs",
131
+ "gap-xs",
132
+ // Theme
133
+ "theme-border-transparent border-1",
134
+ "dark:theme-border-transparent-dark",
135
+ "theme-outline-transparent outline-2 -outline-offset-1",
136
+ "dark:theme-outline-transparent-dark",
137
+ // Theme (focus)
138
+ "focus-within:theme-border-primary",
139
+ "dark:focus-within:theme-border-primary-dark",
140
+ "focus-within:theme-outline-primary",
141
+ "dark:focus-within:theme-outline-primary-dark",
142
+ // Theme (.sticky-start)
143
+ "[&.sticky-start]:theme-background-default [&.sticky-start]:border-e-disabled [&.sticky-start]:border-solid",
144
+ "dark:[&.sticky-start]:theme-background-default-dark dark:[&.sticky-start]:border-e-disabled-dark",
145
+ "hover:[&.sticky-start]:theme-background-surface-1 dark:hover:[&.sticky-start]:theme-background-surface-1-dark",
146
+ "selected:[&.sticky-start]:theme-background-surface-2 dark:selected:[&.sticky-start]:theme-background-surface-2-dark",
147
+ "hover:selected:[&.sticky-start]:theme-background-surface-3 dark:hover:selected:[&.sticky-start]:theme-background-surface-3-dark",
148
+ // Theme (.sticky-end)
149
+ "[&.sticky-end]:theme-background-default [&.sticky-end]:border-s-disabled [&.sticky-end]:border-solid",
150
+ "dark:[&.sticky-end]:theme-background-default-dark dark:[&.sticky-end]:border-s-disabled-dark",
151
+ "hover:[&.sticky-end]:theme-background-surface-1 dark:hover:[&.sticky-end]:theme-background-surface-1-dark",
152
+ "selected:[&.sticky-end]:theme-background-surface-2 dark:selected:[&.sticky-end]:theme-background-surface-2-dark",
153
+ "hover:selected:[&.sticky-end]:theme-background-surface-3 dark:hover:selected:[&.sticky-end]:theme-background-surface-3-dark"
154
+ ], We = [
155
+ // interactivity
156
+ "interactivity-select",
157
+ // Typography
158
+ "truncate"
159
+ ], Ee = G({
160
+ name: "OrDataGridTableContentCell",
161
+ components: {
162
+ OrCheckbox: ee,
163
+ OrDatePicker: ce,
164
+ OrDateTimePicker: me,
165
+ OrInput: fe,
166
+ OrRating: ge,
167
+ OrSelect: pe,
168
+ OrSwitch: he,
169
+ OrTagInput: ve,
170
+ OrTimePicker: be
171
+ },
172
+ model: {
173
+ prop: "modelValue",
174
+ event: "update:modelValue"
175
+ },
176
+ props: {
177
+ modelValue: {
178
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
179
+ type: void 0,
180
+ default: void 0
181
+ },
182
+ column: {
183
+ type: Object,
184
+ default: void 0
185
+ },
186
+ features: {
187
+ type: Object,
188
+ default: void 0
189
+ },
190
+ variant: {
191
+ type: String,
192
+ default: k.Standard
193
+ },
194
+ override: {
195
+ type: Boolean,
196
+ default: !1
197
+ }
198
+ },
199
+ emits: [
200
+ "input"
201
+ ],
202
+ expose: [
203
+ "root"
204
+ ],
205
+ setup(e, t) {
206
+ const n = S(), h = l(() => {
207
+ var O;
208
+ return [
209
+ "or-data-grid-table-content-cell-v3",
210
+ ...Fe,
211
+ ...(O = e.column) != null && O.stickiness ? [`sticky-${e.column.stickiness}`] : []
212
+ ];
213
+ }), v = l(() => {
214
+ if (e.column)
215
+ switch (e.column.stickiness) {
216
+ case "start":
217
+ return {
218
+ position: "sticky",
219
+ insetInlineStart: "0",
220
+ flexDirection: e.column.alignment === "end" ? "row-reverse" : void 0,
221
+ justifyContent: e.column.alignment
222
+ };
223
+ case "end":
224
+ return {
225
+ position: "sticky",
226
+ insetInlineEnd: "0",
227
+ flexDirection: e.column.alignment === "end" ? "row-reverse" : void 0,
228
+ justifyContent: e.column.alignment
229
+ };
230
+ default:
231
+ return {
232
+ flexDirection: e.column.alignment === "end" ? "row-reverse" : void 0,
233
+ justifyContent: e.column.alignment
234
+ };
235
+ }
236
+ return {
237
+ justifyContent: "center"
238
+ };
239
+ }), f = l(() => {
240
+ var V, R;
241
+ const O = ((V = e.column) == null ? void 0 : V.wrapping) ?? (e.variant === k.Dynamic && !((R = e.column) != null && R.control));
242
+ return [
243
+ ...We.filter((I) => I !== "truncate"),
244
+ ...O ? ["whitespace-pre-wrap break-words"] : ["truncate"]
245
+ ];
246
+ }), T = l(() => ({
247
+ minWidth: e.column && e.column.minWidth || B,
248
+ maxWidth: e.column && e.column.maxWidth
249
+ })), M = l({
250
+ get: () => e.modelValue,
251
+ set: (O) => {
252
+ t.emit("input", O);
253
+ }
254
+ }), D = l(() => {
255
+ var O;
256
+ return (O = e.column) == null ? void 0 : O.control;
257
+ });
258
+ return {
259
+ root: n,
260
+ rootStyles: h,
261
+ rootInlineStyles: v,
262
+ contentStyles: f,
263
+ contentInlineStyles: T,
264
+ model: M,
265
+ control: D,
266
+ DATA_GRID_DEFAULT_MIN_WIDTH: B
267
+ };
268
+ }
269
+ });
270
+ function Pe(e, t, n, h, v, f) {
271
+ const T = c("OrInput"), M = c("OrRating"), D = c("OrSelect"), O = c("OrCheckbox"), V = c("OrSwitch"), R = c("OrDatePicker"), I = c("OrTimePicker"), r = c("OrDateTimePicker"), u = c("OrTagInput");
272
+ return o(), p("div", {
273
+ ref: "root",
274
+ class: m(e.rootStyles),
275
+ style: K(e.rootInlineStyles)
276
+ }, [
277
+ e.override ? i(e.$slots, "default", { key: 0 }) : e.control ? (o(), p(q, { key: 1 }, [
278
+ e.control.type === "text" ? (o(), y(T, {
279
+ key: 0,
280
+ modelValue: e.model,
281
+ "onUpdate:modelValue": t[0] || (t[0] = (d) => e.model = d),
282
+ type: "text",
283
+ variant: "embedded"
284
+ }, null, 8, ["modelValue"])) : g("", !0),
285
+ e.control.type === "number" ? (o(), y(T, {
286
+ key: 1,
287
+ modelValue: e.model,
288
+ "onUpdate:modelValue": t[1] || (t[1] = (d) => e.model = d),
289
+ type: "number",
290
+ variant: "embedded"
291
+ }, null, 8, ["modelValue"])) : g("", !0),
292
+ e.control.type === "rating" ? (o(), y(M, {
293
+ key: 2,
294
+ modelValue: e.model,
295
+ "onUpdate:modelValue": t[2] || (t[2] = (d) => e.model = d)
296
+ }, null, 8, ["modelValue"])) : g("", !0),
297
+ e.control.type === "select" ? (o(), y(D, {
298
+ key: 3,
299
+ modelValue: e.model,
300
+ "onUpdate:modelValue": t[3] || (t[3] = (d) => e.model = d),
301
+ options: e.control.options,
302
+ variant: "embedded",
303
+ anchor: e.root
304
+ }, null, 8, ["modelValue", "options", "anchor"])) : g("", !0),
305
+ e.control.type === "checkbox" ? (o(), y(O, {
306
+ key: 4,
307
+ modelValue: e.model,
308
+ "onUpdate:modelValue": t[4] || (t[4] = (d) => e.model = d)
309
+ }, null, 8, ["modelValue"])) : g("", !0),
310
+ e.control.type === "switch" ? (o(), y(V, {
311
+ key: 5,
312
+ modelValue: e.model,
313
+ "onUpdate:modelValue": t[5] || (t[5] = (d) => e.model = d)
314
+ }, null, 8, ["modelValue"])) : g("", !0),
315
+ e.control.type === "date" ? (o(), y(R, {
316
+ key: 6,
317
+ modelValue: e.model,
318
+ "onUpdate:modelValue": t[6] || (t[6] = (d) => e.model = d),
319
+ variant: "embedded",
320
+ anchor: e.root
321
+ }, null, 8, ["modelValue", "anchor"])) : g("", !0),
322
+ e.control.type === "time" ? (o(), y(I, {
323
+ key: 7,
324
+ modelValue: e.model,
325
+ "onUpdate:modelValue": t[7] || (t[7] = (d) => e.model = d),
326
+ variant: "embedded",
327
+ anchor: e.root
328
+ }, null, 8, ["modelValue", "anchor"])) : g("", !0),
329
+ e.control.type === "datetime" ? (o(), y(r, {
330
+ key: 8,
331
+ modelValue: e.model,
332
+ "onUpdate:modelValue": t[8] || (t[8] = (d) => e.model = d),
333
+ variant: "embedded",
334
+ anchor: e.root
335
+ }, null, 8, ["modelValue", "anchor"])) : g("", !0),
336
+ e.control.type === "tags" ? (o(), y(u, {
337
+ key: 9,
338
+ modelValue: e.model,
339
+ "onUpdate:modelValue": t[9] || (t[9] = (d) => e.model = d),
340
+ variant: "embedded"
341
+ }, null, 8, ["modelValue"])) : g("", !0)
342
+ ], 64)) : (o(), p("div", {
343
+ key: 2,
344
+ class: m(e.contentStyles),
345
+ style: K(e.contentInlineStyles)
346
+ }, [
347
+ i(e.$slots, "default")
348
+ ], 6))
349
+ ], 6);
350
+ }
351
+ const ze = /* @__PURE__ */ C(Ee, [["render", Pe]]), je = [
352
+ // Layout
353
+ "grid grid-cols-[subgrid] col-span-full",
354
+ // Typography
355
+ "typography-body-2-regular",
356
+ // Theme
357
+ "theme-border-disabled [&:not(:last-child)]:border-b-1",
358
+ "dark:theme-border-disabled-dark",
359
+ // Theme (children)
360
+ "children:theme-foreground-default",
361
+ "dark:children:theme-foreground-default-dark",
362
+ "children:theme-background-default",
363
+ "dark:children:theme-background-default-dark",
364
+ // Theme (hover / children)
365
+ "children:hover:theme-background-surface-1",
366
+ "dark:children:hover:theme-background-surface-1-dark",
367
+ // Theme (selected / children)
368
+ "children:selected:theme-background-surface-2",
369
+ "dark:children:selected:theme-background-surface-2-dark",
370
+ // Theme (selected + hover / children)
371
+ "children:hover:selected:theme-background-surface-3",
372
+ "dark:children:hover:selected:theme-background-surface-3-dark"
373
+ ], Ne = {
374
+ [k.Standard]: [
375
+ // Box
376
+ "min-h-[calc(theme(spacing.2xl)+theme(spacing.xs))]"
377
+ ],
378
+ [k.Comfortable]: [
379
+ // Box
380
+ "min-h-[calc(theme(spacing.3xl)+theme(spacing.xs))]"
381
+ ],
382
+ [k.Compact]: [
383
+ // Box
384
+ "min-h-[calc(theme(spacing.xl)+theme(spacing.xs))]"
385
+ ],
386
+ [k.Dynamic]: [
387
+ // Box
388
+ "min-h-[calc(theme(spacing.2xl)+theme(spacing.xs))]"
389
+ ]
390
+ }, Ue = G({
391
+ name: "OrDataGridTableContentRow",
392
+ props: {
393
+ variant: {
394
+ type: String,
395
+ required: !0
396
+ },
397
+ selected: {
398
+ type: Boolean,
399
+ default: !1
400
+ },
401
+ interactive: {
402
+ type: Boolean,
403
+ default: !1
404
+ }
405
+ },
406
+ expose: [
407
+ "root"
408
+ ],
409
+ setup(e) {
410
+ const t = S(), n = l(() => [
411
+ "or-data-grid-table-content-row-v3",
412
+ ...je,
413
+ ...Ne[e.variant],
414
+ ...e.interactive ? ["cursor-pointer"] : []
415
+ ]);
416
+ return {
417
+ root: t,
418
+ rootStyles: n
419
+ };
420
+ }
421
+ }), Le = ["selected"];
422
+ function Ae(e, t, n, h, v, f) {
423
+ return o(), p("div", {
424
+ ref: "root",
425
+ class: m(e.rootStyles),
426
+ selected: e.selected
427
+ }, [
428
+ i(e.$slots, "default")
429
+ ], 10, Le);
430
+ }
431
+ const qe = /* @__PURE__ */ C(Ue, [["render", Ae]]), Be = [
432
+ // Layout
433
+ "contents"
434
+ ], Ke = G({
435
+ name: "OrDataGridTableContent",
436
+ expose: [
437
+ "root"
438
+ ],
439
+ setup() {
440
+ const e = S(), t = l(() => [
441
+ "or-data-grid-table-content-v3",
442
+ ...Be
443
+ ]);
444
+ return {
445
+ root: e,
446
+ rootStyles: t
447
+ };
448
+ }
449
+ });
450
+ function Xe(e, t, n, h, v, f) {
451
+ return o(), p("div", {
452
+ ref: "root",
453
+ class: m(e.rootStyles)
454
+ }, [
455
+ i(e.$slots, "default")
456
+ ], 2);
457
+ }
458
+ const Je = /* @__PURE__ */ C(Ke, [["render", Xe]]), Qe = [
459
+ // Layout
460
+ "layout-row",
461
+ // Spacing
462
+ "px-sm+",
463
+ "py-0",
464
+ "gap-xs",
465
+ // Theme
466
+ "theme-border-transparent border-1",
467
+ "dark:theme-border-transparent-dark"
468
+ ], Ye = G({
469
+ name: "OrDataGridTableFooterCell",
470
+ expose: [
471
+ "root"
472
+ ],
473
+ setup() {
474
+ const e = S(), t = l(() => [
475
+ "or-data-grid-table-footer-cell-v3",
476
+ ...Qe
477
+ ]);
478
+ return {
479
+ root: e,
480
+ rootStyles: t
481
+ };
482
+ }
483
+ });
484
+ function Ze(e, t, n, h, v, f) {
485
+ return o(), p("div", {
486
+ ref: "root",
487
+ class: m(e.rootStyles)
488
+ }, [
489
+ i(e.$slots, "default")
490
+ ], 2);
491
+ }
492
+ const _e = /* @__PURE__ */ C(Ye, [["render", Ze]]), xe = [
493
+ // Layout
494
+ "grid grid-cols-1",
495
+ // Typography
496
+ "typography-body-2-regular",
497
+ // Theme
498
+ "theme-border-disabled border-t-1",
499
+ "dark:theme-border-disabled-dark",
500
+ // Theme (children)
501
+ "children:theme-foreground-default",
502
+ "dark:children:theme-foreground-default-dark",
503
+ "children:theme-background-default",
504
+ "dark:children:theme-background-default-dark"
505
+ ], et = {
506
+ [k.Standard]: [
507
+ // Box
508
+ "min-h-[calc(theme(spacing.2xl)+theme(spacing.xs))]"
509
+ ],
510
+ [k.Comfortable]: [
511
+ // Box
512
+ "min-h-[calc(theme(spacing.3xl)+theme(spacing.xs))]"
513
+ ],
514
+ [k.Compact]: [
515
+ // Box
516
+ "min-h-[calc(theme(spacing.xl)+theme(spacing.xs))]"
517
+ ],
518
+ [k.Dynamic]: [
519
+ // Box
520
+ "min-h-[calc(theme(spacing.2xl)+theme(spacing.xs))]"
521
+ ]
522
+ }, tt = G({
523
+ name: "OrDataGridTableFooterRow",
524
+ props: {
525
+ variant: {
526
+ type: String,
527
+ required: !0
528
+ }
529
+ },
530
+ expose: [
531
+ "root"
532
+ ],
533
+ setup(e) {
534
+ const t = S(), n = l(() => [
535
+ "or-data-grid-table-footer-row-v3",
536
+ ...xe,
537
+ ...et[e.variant]
538
+ ]);
539
+ return {
540
+ root: t,
541
+ rootStyles: n
542
+ };
543
+ }
544
+ });
545
+ function at(e, t, n, h, v, f) {
546
+ return o(), p("div", {
547
+ ref: "root",
548
+ class: m(e.rootStyles)
549
+ }, [
550
+ i(e.$slots, "default")
551
+ ], 2);
552
+ }
553
+ const ot = /* @__PURE__ */ C(tt, [["render", at]]), rt = [
554
+ // Layout
555
+ "contents"
556
+ ], nt = G({
557
+ name: "OrDataGridTableFooter",
558
+ expose: [
559
+ "root"
560
+ ],
561
+ setup() {
562
+ const e = S(), t = l(() => [
563
+ "or-data-grid-table-footer-v3",
564
+ ...rt
565
+ ]);
566
+ return {
567
+ root: e,
568
+ rootStyles: t
569
+ };
570
+ }
571
+ });
572
+ function lt(e, t, n, h, v, f) {
573
+ return o(), p("div", {
574
+ ref: "root",
575
+ class: m(e.rootStyles)
576
+ }, [
577
+ i(e.$slots, "default")
578
+ ], 2);
579
+ }
580
+ const st = /* @__PURE__ */ C(nt, [["render", lt]]), it = [
581
+ // Layout
582
+ "layout-row items-center",
583
+ // Spacing
584
+ "px-sm+",
585
+ "py-xs",
586
+ "gap-xs",
587
+ // Theme
588
+ "theme-border-transparent border-1",
589
+ "dark:theme-border-transparent-dark",
590
+ "theme-outline-transparent outline-2 -outline-offset-1",
591
+ "dark:theme-outline-transparent-dark",
592
+ // Theme (Stacking)
593
+ "relative z-1 hover:z-2",
594
+ // Theme (.sticky-start)
595
+ "[&.sticky-start]:theme-background-surface-variant-1 [&.sticky-start]:border-e-disabled [&.sticky-start]:border-solid z-20 hover:z-30",
596
+ "dark:[&.sticky-start]:theme-background-surface-variant-1-dark dark:[&.sticky-start]:border-e-disabled-dark",
597
+ // Theme (.sticky-end)
598
+ "[&.sticky-end]:theme-background-surface-variant-1 [&.sticky-end]:border-s-disabled [&.sticky-end]:border-solid z-20 hover:z-30",
599
+ "dark:[&.sticky-end]:theme-background-surface-variant-1-dark dark:[&.sticky-end]:border-s-disabled-dark"
600
+ ], dt = [
601
+ // Position
602
+ "absolute top-0 bottom-0 end-0 z-50",
603
+ // Box
604
+ "w-xs cursor-col-resize",
605
+ // Theme
606
+ "theme-background-transparent",
607
+ "hover:theme-background-primary",
608
+ "dark:hover:theme-background-primary-dark",
609
+ "active:theme-background-primary",
610
+ "dark:active:theme-background-primary-dark"
611
+ ], ut = G({
612
+ name: "OrDataGridTableHeaderCell",
613
+ components: {
614
+ OrIcon: ye
615
+ },
616
+ model: {
617
+ prop: "modelValue",
618
+ event: "update:modelValue"
619
+ },
620
+ props: {
621
+ modelValue: {
622
+ type: Object,
623
+ default: void 0
624
+ },
625
+ column: {
626
+ type: Object,
627
+ default: void 0
628
+ },
629
+ features: {
630
+ type: Object,
631
+ default: void 0
632
+ }
633
+ },
634
+ emits: [
635
+ "update:modelValue",
636
+ "update:scrollOffset",
637
+ "remove:scrollOffset",
638
+ "update:column-width"
639
+ ],
640
+ expose: [
641
+ "root"
642
+ ],
643
+ setup(e, t) {
644
+ const n = S(), h = l(() => {
645
+ var r, u, d;
646
+ return !!((r = e.features) != null && r.sorting) && !!((u = e.column) != null && u.name) && ((d = e.column) == null ? void 0 : d.sorting) !== !1;
647
+ }), v = l(() => {
648
+ var r, u;
649
+ return !!((r = e.features) != null && r.resizing) && !!((u = e.column) != null && u.name);
650
+ }), f = l(() => {
651
+ var r;
652
+ return [
653
+ "or-data-grid-table-header-cell-v3",
654
+ "relative",
655
+ ...it,
656
+ ...(r = e.column) != null && r.stickiness ? [`sticky-${e.column.stickiness}`] : [],
657
+ ...h.value ? ["interactivity-click"] : []
658
+ ];
659
+ }), T = l(() => [
660
+ "or-data-grid-table-header-cell-resize-handle-v3",
661
+ ...dt
662
+ ]), M = l(() => {
663
+ var r, u;
664
+ return {
665
+ minWidth: ((r = e.column) == null ? void 0 : r.minWidth) || B,
666
+ maxWidth: (u = e.column) == null ? void 0 : u.maxWidth
667
+ };
668
+ }), D = l(() => {
669
+ if (e.column)
670
+ switch (e.column.stickiness) {
671
+ case "start":
672
+ return {
673
+ position: "sticky",
674
+ insetInlineStart: "0",
675
+ flexDirection: e.column.alignment === "end" ? "row-reverse" : void 0,
676
+ justifyContent: e.column.alignment
677
+ };
678
+ case "end":
679
+ return {
680
+ position: "sticky",
681
+ insetInlineEnd: "0",
682
+ flexDirection: e.column.alignment === "end" ? "row-reverse" : void 0,
683
+ justifyContent: e.column.alignment
684
+ };
685
+ default:
686
+ return {
687
+ flexDirection: e.column.alignment === "end" ? "row-reverse" : void 0,
688
+ justifyContent: e.column.alignment
689
+ };
690
+ }
691
+ return {
692
+ justifyContent: "center"
693
+ };
694
+ }), O = l({
695
+ get: () => {
696
+ var r, u;
697
+ if (h.value)
698
+ return ((r = e.modelValue) == null ? void 0 : r.column) === ((u = e.column) == null ? void 0 : u.name) ? e.modelValue : void 0;
699
+ },
700
+ set: (r) => {
701
+ t.emit("update:modelValue", r);
702
+ }
703
+ });
704
+ function V() {
705
+ var r;
706
+ if (h.value)
707
+ if (O.value)
708
+ O.value = {
709
+ ...O.value,
710
+ direction: O.value.direction === "asc" ? "desc" : "asc"
711
+ };
712
+ else {
713
+ if (!e.column)
714
+ throw new Error("[OrDataGridTableHeaderCell]: `column` must be specified.");
715
+ O.value = {
716
+ column: ((r = e.column) == null ? void 0 : r.name) || "_check",
717
+ direction: "asc"
718
+ };
719
+ }
720
+ }
721
+ function R(r) {
722
+ var j;
723
+ const u = r.pageX, d = ((j = n.value) == null ? void 0 : j.offsetWidth) || 0, W = (X) => {
724
+ var U, L;
725
+ const J = X.pageX - u;
726
+ let E = Math.max(0, d + J);
727
+ const P = ((U = e.column) == null ? void 0 : U.minWidth) || B;
728
+ if (P && (P.endsWith("px") || !isNaN(Number(P)))) {
729
+ const N = parseInt(P, 10);
730
+ E = Math.max(E, N);
731
+ }
732
+ if ((L = e.column) != null && L.maxWidth && (e.column.maxWidth.endsWith("px") || !isNaN(Number(e.column.maxWidth)))) {
733
+ const N = parseInt(e.column.maxWidth, 10);
734
+ E = Math.min(E, N);
735
+ }
736
+ t.emit("update:column-width", E);
737
+ }, z = () => {
738
+ document.removeEventListener("mousemove", W), document.removeEventListener("mouseup", z);
739
+ };
740
+ document.addEventListener("mousemove", W), document.addEventListener("mouseup", z);
741
+ }
742
+ const { width: I } = ke(n, void 0, { box: "border-box" });
743
+ return te([
744
+ n,
745
+ I,
746
+ () => {
747
+ var r;
748
+ return (r = e.column) == null ? void 0 : r.stickiness;
749
+ }
750
+ ], ([
751
+ r,
752
+ u
753
+ ], [
754
+ d
755
+ ]) => {
756
+ d && d !== r && t.emit("remove:scrollOffset", d), t.emit("update:scrollOffset", r, u, e.column);
757
+ }), {
758
+ root: n,
759
+ rootStyles: f,
760
+ rootInlineStyles: D,
761
+ wrapInlineStyle: M,
762
+ resizeHandleStyles: T,
763
+ isSortable: h,
764
+ isResizable: v,
765
+ model: O,
766
+ toggleSorting: V,
767
+ onResizeStart: R,
768
+ DATA_GRID_DEFAULT_MIN_WIDTH: B
769
+ };
770
+ }
771
+ });
772
+ function ct(e, t, n, h, v, f) {
773
+ const T = c("OrIcon");
774
+ return o(), p("div", {
775
+ ref: "root",
776
+ class: m(e.rootStyles),
777
+ style: K(e.rootInlineStyles),
778
+ onClick: t[2] || (t[2] = (M) => e.toggleSorting())
779
+ }, [
780
+ le("div", {
781
+ class: m(["truncate"]),
782
+ style: K(e.wrapInlineStyle)
783
+ }, [
784
+ i(e.$slots, "default")
785
+ ], 4),
786
+ e.model ? (o(), y(T, {
787
+ key: 0,
788
+ icon: e.model.direction === "asc" ? "arrow_upward" : "arrow_downward"
789
+ }, null, 8, ["icon"])) : g("", !0),
790
+ e.isResizable ? (o(), p("div", {
791
+ key: 1,
792
+ class: m(e.resizeHandleStyles),
793
+ onMousedown: t[0] || (t[0] = x((...M) => e.onResizeStart && e.onResizeStart(...M), ["stop", "prevent"])),
794
+ onClick: t[1] || (t[1] = x(() => {
795
+ }, ["stop"]))
796
+ }, null, 34)) : g("", !0)
797
+ ], 6);
798
+ }
799
+ const mt = /* @__PURE__ */ C(ut, [["render", ct]]), ft = [
800
+ // Position
801
+ "sticky top-0 z-10",
802
+ // Layout
803
+ "grid grid-cols-[subgrid] col-span-full",
804
+ // Typography
805
+ "typography-body-2-semibold",
806
+ // Theme (children)
807
+ "children:theme-foreground-default",
808
+ "dark:children:theme-foreground-default-dark",
809
+ "children:theme-background-surface-variant-1",
810
+ "dark:children:theme-background-surface-variant-1-dark"
811
+ ], gt = {
812
+ [k.Standard]: [
813
+ // Box
814
+ "min-h-[calc(theme(spacing.2xl)+theme(spacing.xs))]"
815
+ ],
816
+ [k.Comfortable]: [
817
+ // Box
818
+ "min-h-[calc(theme(spacing.3xl)+theme(spacing.xs))]"
819
+ ],
820
+ [k.Compact]: [
821
+ // Box
822
+ "min-h-[calc(theme(spacing.xl)+theme(spacing.xs))]"
823
+ ],
824
+ [k.Dynamic]: [
825
+ // Box
826
+ "min-h-[calc(theme(spacing.2xl)+theme(spacing.xs))]"
827
+ ]
828
+ }, pt = G({
829
+ name: "OrDataGridTableHeaderRow",
830
+ props: {
831
+ variant: {
832
+ type: String,
833
+ required: !0
834
+ }
835
+ },
836
+ expose: [
837
+ "root"
838
+ ],
839
+ setup(e) {
840
+ const t = S(), n = l(() => [
841
+ "or-data-grid-table-header-row-v3",
842
+ ...ft,
843
+ ...gt[e.variant]
844
+ ]);
845
+ return {
846
+ root: t,
847
+ rootStyles: n
848
+ };
849
+ }
850
+ });
851
+ function ht(e, t, n, h, v, f) {
852
+ return o(), p("div", {
853
+ ref: "root",
854
+ class: m(e.rootStyles)
855
+ }, [
856
+ i(e.$slots, "default")
857
+ ], 2);
858
+ }
859
+ const vt = /* @__PURE__ */ C(pt, [["render", ht]]), bt = [
860
+ // Layout
861
+ "contents"
862
+ ], yt = G({
863
+ name: "OrDataGridTableHeader",
864
+ expose: [
865
+ "root"
866
+ ],
867
+ setup() {
868
+ const e = S(), t = l(() => [
869
+ "or-data-grid-table-header-v3",
870
+ ...bt
871
+ ]);
872
+ return {
873
+ root: e,
874
+ rootStyles: t
875
+ };
876
+ }
877
+ });
878
+ function kt(e, t, n, h, v, f) {
879
+ return o(), p("div", {
880
+ ref: "root",
881
+ class: m(e.rootStyles)
882
+ }, [
883
+ i(e.$slots, "default")
884
+ ], 2);
885
+ }
886
+ const Ot = /* @__PURE__ */ C(yt, [["render", kt]]), $t = [
887
+ // Layout
888
+ "layout-row justify-center items-center",
889
+ // Spacing
890
+ "px-sm+",
891
+ "py-xs",
892
+ "gap-xs",
893
+ // Typography
894
+ "typography-body-2-regular",
895
+ // Theme
896
+ "theme-foreground-default",
897
+ "dark:theme-foreground-default-dark",
898
+ "theme-background-default",
899
+ "dark:theme-background-default-dark"
900
+ ], wt = {
901
+ [k.Standard]: [
902
+ // Box
903
+ "min-h-[calc(theme(spacing.2xl)+theme(spacing.xs))]"
904
+ ],
905
+ [k.Comfortable]: [
906
+ // Box
907
+ "min-h-[calc(theme(spacing.3xl)+theme(spacing.xs))]"
908
+ ],
909
+ [k.Compact]: [
910
+ // Box
911
+ "min-h-[calc(theme(spacing.xl)+theme(spacing.xs))]"
912
+ ],
913
+ [k.Dynamic]: [
914
+ // Box
915
+ "min-h-[calc(theme(spacing.2xl)+theme(spacing.xs))]"
916
+ ]
917
+ }, Dt = G({
918
+ name: "OrDataGridTablePlaceholder",
919
+ props: {
920
+ variant: {
921
+ type: String,
922
+ required: !0
923
+ }
924
+ },
925
+ expose: [
926
+ "root"
927
+ ],
928
+ setup(e) {
929
+ const t = S(), n = l(() => [
930
+ "or-data-grid-table-placeholder-v3",
931
+ ...$t,
932
+ ...wt[e.variant]
933
+ ]);
934
+ return {
935
+ root: t,
936
+ rootStyles: n
937
+ };
938
+ }
939
+ });
940
+ function St(e, t, n, h, v, f) {
941
+ return o(), p("div", {
942
+ ref: "root",
943
+ class: m(e.rootStyles)
944
+ }, [
945
+ i(e.$slots, "default")
946
+ ], 2);
947
+ }
948
+ const Tt = /* @__PURE__ */ C(Dt, [["render", St]]), Gt = [
949
+ // Layout
950
+ "grid content-start",
951
+ // Overflow
952
+ "overflow-auto",
953
+ // Interactivity
954
+ "interactivity-default"
955
+ ], Ct = G({
956
+ name: "OrDataGridTable",
957
+ props: {
958
+ columns: {
959
+ type: Array,
960
+ required: !0
961
+ },
962
+ features: {
963
+ type: Object,
964
+ required: !0
965
+ }
966
+ },
967
+ expose: [
968
+ "root"
969
+ ],
970
+ setup(e) {
971
+ const t = S(), n = l(() => [
972
+ "or-data-grid-table-v3",
973
+ ...Gt
974
+ ]), h = l(() => {
975
+ const v = e.columns.map((f) => {
976
+ if (f.width && (f.width.includes("minmax") || f.width.includes("calc")))
977
+ return f.width;
978
+ const T = f.width ?? "1fr", M = f.minWidth || B;
979
+ let D = f.maxWidth || T;
980
+ return T.endsWith("px") && (D = T), `minmax(${M}, ${D})`;
981
+ });
982
+ return e.features.selecting ? { gridTemplateColumns: `auto ${v.join(" ")}` } : { gridTemplateColumns: v.join(" ") };
983
+ });
984
+ return {
985
+ root: t,
986
+ rootStyles: n,
987
+ rootInlineStyles: h
988
+ };
989
+ }
990
+ });
991
+ function Vt(e, t, n, h, v, f) {
992
+ return o(), p("div", {
993
+ ref: "root",
994
+ class: m(e.rootStyles),
995
+ style: K(e.rootInlineStyles)
996
+ }, [
997
+ i(e.$slots, "default")
998
+ ], 6);
999
+ }
1000
+ const Mt = /* @__PURE__ */ C(Ct, [["render", Vt]]), Rt = [
1001
+ // Layout
1002
+ "layout-row",
1003
+ // Box
1004
+ "h-2xl",
1005
+ // Spacing
1006
+ "gap-xl"
1007
+ ], It = G({
1008
+ name: "OrDataGridToolbar",
1009
+ expose: [
1010
+ "root"
1011
+ ],
1012
+ setup() {
1013
+ const e = S(), t = l(() => [
1014
+ "or-data-grid-toolbar-v3",
1015
+ ...Rt
1016
+ ]);
1017
+ return {
1018
+ root: e,
1019
+ rootStyles: t
1020
+ };
1021
+ }
1022
+ });
1023
+ function Ht(e, t, n, h, v, f) {
1024
+ return o(), p("div", {
1025
+ ref: "root",
1026
+ class: m(e.rootStyles)
1027
+ }, [
1028
+ i(e.$slots, "default")
1029
+ ], 2);
1030
+ }
1031
+ const Ft = /* @__PURE__ */ C(It, [["render", Ht]]), Wt = [
1032
+ // Position
1033
+ "grid sticky z-10",
1034
+ // Layout
1035
+ "col-span-full"
1036
+ ], Et = {
1037
+ [k.Standard]: [
1038
+ // Position
1039
+ "top-[calc(theme(spacing.2xl)+theme(spacing.xs))]"
1040
+ ],
1041
+ [k.Comfortable]: [
1042
+ // Position
1043
+ "top-[calc(theme(spacing.3xl)+theme(spacing.xs))]"
1044
+ ],
1045
+ [k.Compact]: [
1046
+ // Position
1047
+ "top-[calc(theme(spacing.xl)+theme(spacing.xs))]"
1048
+ ],
1049
+ [k.Dynamic]: [
1050
+ // Position
1051
+ "top-[calc(theme(spacing.2xl)+theme(spacing.xs))]"
1052
+ ]
1053
+ }, Pt = G({
1054
+ components: {
1055
+ OrNotification: Oe
1056
+ },
1057
+ props: {
1058
+ notification: {
1059
+ type: Object,
1060
+ required: !0
1061
+ },
1062
+ variant: {
1063
+ type: String,
1064
+ required: !0
1065
+ }
1066
+ },
1067
+ emits: [
1068
+ "close-notification"
1069
+ ],
1070
+ setup(e) {
1071
+ return {
1072
+ rootStyles: l(() => [
1073
+ "or-data-grid-notification-v3",
1074
+ ...Wt,
1075
+ ...Et[e.variant]
1076
+ ])
1077
+ };
1078
+ }
1079
+ });
1080
+ function zt(e, t, n, h, v, f) {
1081
+ const T = c("OrNotification");
1082
+ return o(), p("div", {
1083
+ class: m(e.rootStyles)
1084
+ }, [
1085
+ H(T, se(e.notification, {
1086
+ class: "rounded-0 shadow-none",
1087
+ onClose: t[0] || (t[0] = (M) => e.$emit("close-notification"))
1088
+ }), {
1089
+ default: b(() => [
1090
+ e.$slots.notification ? i(e.$slots, "notification", { key: 0 }) : g("", !0)
1091
+ ]),
1092
+ _: 3
1093
+ }, 16)
1094
+ ], 2);
1095
+ }
1096
+ const jt = /* @__PURE__ */ C(Pt, [["render", zt]]), Nt = [
1097
+ // Layout
1098
+ "grid col-span-full grid-cols-[subgrid]",
1099
+ // Typography
1100
+ "typography-body-2-regular",
1101
+ // Theme
1102
+ "theme-border-disabled",
1103
+ "dark:theme-border-disabled-dark",
1104
+ // Theme (children)
1105
+ "children:theme-foreground-default",
1106
+ "dark:children:theme-foreground-default-dark",
1107
+ "children:theme-background-default",
1108
+ "dark:children:theme-background-default-dark"
1109
+ ], Ut = {
1110
+ [k.Standard]: [
1111
+ // Box
1112
+ "min-h-[calc(theme(spacing.2xl)+theme(spacing.xs))]"
1113
+ ],
1114
+ [k.Comfortable]: [
1115
+ // Box
1116
+ "min-h-[calc(theme(spacing.3xl)+theme(spacing.xs))]"
1117
+ ],
1118
+ [k.Compact]: [
1119
+ // Box
1120
+ "min-h-[calc(theme(spacing.xl)+theme(spacing.xs))]"
1121
+ ],
1122
+ [k.Dynamic]: [
1123
+ // Box
1124
+ "min-h-[calc(theme(spacing.2xl)+theme(spacing.xs))]"
1125
+ ]
1126
+ }, Lt = G({
1127
+ name: "OrDataGridTableExtraRow",
1128
+ props: {
1129
+ variant: {
1130
+ type: String,
1131
+ required: !0
1132
+ }
1133
+ },
1134
+ expose: [
1135
+ "root"
1136
+ ],
1137
+ setup(e) {
1138
+ const t = S(), n = l(() => [
1139
+ "or-data-grid-table-extra-row-v3",
1140
+ ...Nt,
1141
+ ...Ut[e.variant]
1142
+ ]);
1143
+ return {
1144
+ root: t,
1145
+ rootStyles: n
1146
+ };
1147
+ }
1148
+ });
1149
+ function At(e, t, n, h, v, f) {
1150
+ return o(), p("div", {
1151
+ ref: "root",
1152
+ class: m(e.rootStyles)
1153
+ }, [
1154
+ i(e.$slots, "default")
1155
+ ], 2);
1156
+ }
1157
+ const qt = /* @__PURE__ */ C(Lt, [["render", At]]), Bt = [
1158
+ // Layout
1159
+ "layout-column"
1160
+ ], Kt = G({
1161
+ name: "OrDataGrid",
1162
+ components: {
1163
+ OrCheckbox: ee,
1164
+ OrDataGridFooter: Ge,
1165
+ OrDataGridHeader: He,
1166
+ OrDataGridTable: Mt,
1167
+ OrDataGridTableContent: Je,
1168
+ OrDataGridTableContentCell: ze,
1169
+ OrDataGridTableContentRow: qe,
1170
+ OrDataGridTableFooter: st,
1171
+ OrDataGridTableFooterCell: _e,
1172
+ OrDataGridTableFooterRow: ot,
1173
+ OrDataGridTableExtraRow: qt,
1174
+ OrDataGridTableHeader: Ot,
1175
+ OrDataGridTableHeaderCell: mt,
1176
+ OrDataGridTableHeaderRow: vt,
1177
+ OrDataGridTablePlaceholder: Tt,
1178
+ OrDataGridToolbar: Ft,
1179
+ OrDataGridNotification: jt,
1180
+ OrPagination: oe,
1181
+ OrSearch: re,
1182
+ OrSkeletonText: ne
1183
+ },
1184
+ model: {
1185
+ prop: "modelValue",
1186
+ event: "update:modelValue"
1187
+ },
1188
+ props: {
1189
+ modelValue: {
1190
+ type: void 0,
1191
+ default: void 0
1192
+ },
1193
+ items: {
1194
+ type: Array,
1195
+ default: () => []
1196
+ },
1197
+ columns: {
1198
+ type: Array,
1199
+ required: !0
1200
+ },
1201
+ variant: {
1202
+ type: String,
1203
+ default: () => k.Standard
1204
+ },
1205
+ features: {
1206
+ type: Object,
1207
+ default: () => ({})
1208
+ },
1209
+ loading: {
1210
+ type: Boolean,
1211
+ default: !1
1212
+ },
1213
+ notification: {
1214
+ type: Object,
1215
+ default: void 0
1216
+ },
1217
+ interactiveRows: {
1218
+ type: Boolean,
1219
+ default: !1
1220
+ }
1221
+ },
1222
+ emits: [
1223
+ "update:modelValue",
1224
+ "update:item",
1225
+ "close-notification",
1226
+ "hover:row",
1227
+ "blur:row",
1228
+ "hover:cell",
1229
+ "blur:cell",
1230
+ "click:row"
1231
+ ],
1232
+ expose: [
1233
+ "root"
1234
+ ],
1235
+ setup(e, t) {
1236
+ const n = S(), h = S(), v = S(), f = l(() => [
1237
+ "or-data-grid-v3",
1238
+ ...Bt
1239
+ ]), T = l(() => ({
1240
+ scrollPaddingInlineStart: `${[...r.value.values()].reduce((a, $) => a + $, 0)}px`,
1241
+ scrollPaddingInlineEnd: `${[...u.value.values()].reduce((a, $) => a + $, 0)}px`
1242
+ })), M = l({
1243
+ get: () => !!e.items.length && e.items.every((a) => D.value.includes(a.id)),
1244
+ set: (a) => {
1245
+ a ? D.value = [
1246
+ .../* @__PURE__ */ new Set([
1247
+ ...D.value,
1248
+ ...e.items.map(($) => $.id)
1249
+ ])
1250
+ ] : D.value = [];
1251
+ }
1252
+ }), D = l({
1253
+ get: () => {
1254
+ var a;
1255
+ return ((a = e.modelValue) == null ? void 0 : a.selecting) ?? [];
1256
+ },
1257
+ set: (a) => {
1258
+ t.emit("update:modelValue", {
1259
+ selecting: a,
1260
+ filtering: O.value,
1261
+ searching: V.value,
1262
+ sorting: R.value,
1263
+ paging: I.value
1264
+ });
1265
+ }
1266
+ }), O = l({
1267
+ get: () => {
1268
+ var a;
1269
+ return (a = e.modelValue) == null ? void 0 : a.filtering;
1270
+ },
1271
+ set: (a) => {
1272
+ t.emit("update:modelValue", {
1273
+ selecting: D.value,
1274
+ filtering: a,
1275
+ searching: V.value,
1276
+ sorting: R.value,
1277
+ paging: {
1278
+ ...I.value,
1279
+ offset: 0
1280
+ }
1281
+ });
1282
+ }
1283
+ }), V = l({
1284
+ get: () => {
1285
+ var a;
1286
+ return (a = e.modelValue) == null ? void 0 : a.searching;
1287
+ },
1288
+ set: (a) => {
1289
+ t.emit("update:modelValue", {
1290
+ selecting: D.value,
1291
+ filtering: O.value,
1292
+ searching: a,
1293
+ sorting: R.value,
1294
+ paging: {
1295
+ ...I.value,
1296
+ offset: 0
1297
+ }
1298
+ });
1299
+ }
1300
+ }), R = l({
1301
+ get: () => {
1302
+ var a;
1303
+ return (a = e.modelValue) == null ? void 0 : a.sorting;
1304
+ },
1305
+ set: (a) => {
1306
+ t.emit("update:modelValue", {
1307
+ selecting: D.value,
1308
+ filtering: O.value,
1309
+ searching: V.value,
1310
+ sorting: a,
1311
+ paging: {
1312
+ ...I.value,
1313
+ offset: 0
1314
+ }
1315
+ });
1316
+ }
1317
+ }), I = l({
1318
+ get: () => {
1319
+ var a;
1320
+ return (a = e.modelValue) == null ? void 0 : a.paging;
1321
+ },
1322
+ set: (a) => {
1323
+ t.emit("update:modelValue", {
1324
+ selecting: D.value,
1325
+ filtering: O.value,
1326
+ searching: V.value,
1327
+ sorting: R.value,
1328
+ paging: a
1329
+ });
1330
+ }
1331
+ });
1332
+ te(() => {
1333
+ var a;
1334
+ return (a = I.value) == null ? void 0 : a.offset;
1335
+ }, () => {
1336
+ var a;
1337
+ (a = v.value) != null && a.root && v.value.root.scrollTo({
1338
+ top: 0,
1339
+ behavior: "smooth"
1340
+ });
1341
+ });
1342
+ const r = S(/* @__PURE__ */ new Map()), u = S(/* @__PURE__ */ new Map()), d = l(() => e.features.selecting && (typeof e.features.selecting == "object" ? e.features.selecting.showCounter !== !1 : !0)), W = l(() => e.items.length === 0 || e.loading || typeof e.features.selecting == "object" && e.features.selecting.disabled), z = l(() => {
1343
+ var a;
1344
+ return ((a = h.value) == null ? void 0 : a.currentLimit) || 10;
1345
+ });
1346
+ function j(a) {
1347
+ V.value = a;
1348
+ }
1349
+ function X(a, $, F) {
1350
+ switch (F.stickiness) {
1351
+ case "start":
1352
+ r.value.set(a, $), r.value = new Map(r.value), u.value.delete(a), u.value = new Map(u.value);
1353
+ break;
1354
+ case "end":
1355
+ r.value.delete(a), r.value = new Map(r.value), u.value.set(a, $), u.value = new Map(u.value);
1356
+ break;
1357
+ default:
1358
+ A(a);
1359
+ break;
1360
+ }
1361
+ }
1362
+ function J(a) {
1363
+ e.interactiveRows && t.emit("hover:row", a);
1364
+ }
1365
+ function E(a) {
1366
+ e.interactiveRows && t.emit("blur:row", a);
1367
+ }
1368
+ function P(a, $, F) {
1369
+ e.interactiveRows && t.emit("hover:cell", {
1370
+ item: a,
1371
+ columnName: $,
1372
+ value: F
1373
+ });
1374
+ }
1375
+ function U(a, $, F) {
1376
+ e.interactiveRows && t.emit("blur:cell", {
1377
+ item: a,
1378
+ columnName: $,
1379
+ value: F
1380
+ });
1381
+ }
1382
+ function L(a) {
1383
+ e.interactiveRows && t.emit("click:row", a);
1384
+ }
1385
+ function N(a, $) {
1386
+ a.width = `${$}px`, e.features.storageKey && s();
1387
+ }
1388
+ function s() {
1389
+ if (typeof window > "u" || !e.features.storageKey) return;
1390
+ const a = {};
1391
+ e.columns.forEach(($) => {
1392
+ $.name && $.width && (a[$.name] = $.width);
1393
+ }), localStorage.setItem(`or-data-grid-v3-widths-${e.features.storageKey}`, JSON.stringify(a));
1394
+ }
1395
+ function w() {
1396
+ if (!(typeof window > "u" || !e.features.storageKey))
1397
+ try {
1398
+ const a = localStorage.getItem(`or-data-grid-v3-widths-${e.features.storageKey}`);
1399
+ if (a) {
1400
+ const $ = JSON.parse(a);
1401
+ e.columns.forEach((F) => {
1402
+ F.name && $[F.name] && (F.width = $[F.name]);
1403
+ });
1404
+ }
1405
+ } catch (a) {
1406
+ console.error("[OrDataGrid]: Failed to load column widths from localStorage", a);
1407
+ }
1408
+ }
1409
+ ie(() => {
1410
+ w();
1411
+ });
1412
+ function A(a) {
1413
+ r.value.delete(a), r.value = new Map(r.value), u.value.delete(a), u.value = new Map(u.value);
1414
+ }
1415
+ function ae(a) {
1416
+ a.currentTarget.scrollIntoView({ block: "nearest" });
1417
+ }
1418
+ return {
1419
+ root: n,
1420
+ rootStyles: f,
1421
+ pagination: h,
1422
+ tableInlineStyles: T,
1423
+ selectingIndicator: M,
1424
+ showSelectingCouter: d,
1425
+ selectingDisabled: W,
1426
+ skeletonsLength: z,
1427
+ handleMouseEnterRow: J,
1428
+ handleMouseLeaveRow: E,
1429
+ handleMouseEnterCell: P,
1430
+ handleMouseLeaveCell: U,
1431
+ handleRowClick: L,
1432
+ updateColumnWidth: N,
1433
+ selectingModel: D,
1434
+ filteringModel: O,
1435
+ searchingModel: V,
1436
+ sortingModel: R,
1437
+ pagingModel: I,
1438
+ updateScrollOffset: X,
1439
+ removeScrollOffset: A,
1440
+ updateSearchingModel: j,
1441
+ scrollToTop: () => {
1442
+ var a;
1443
+ (a = v.value) != null && a.root && v.value.root.scrollTo({
1444
+ top: 0,
1445
+ behavior: "smooth"
1446
+ });
1447
+ },
1448
+ scrollTo: ae,
1449
+ onInput: (a, $, F) => {
1450
+ a[$] = F, t.emit("update:item", a);
1451
+ }
1452
+ };
1453
+ }
1454
+ });
1455
+ function Xt(e, t, n, h, v, f) {
1456
+ const T = c("OrSearch"), M = c("OrDataGridHeader"), D = c("OrDataGridToolbar"), O = c("OrCheckbox"), V = c("OrDataGridTableHeaderCell"), R = c("OrDataGridTableHeaderRow"), I = c("OrDataGridTableHeader"), r = c("OrDataGridNotification"), u = c("OrDataGridTableExtraRow"), d = c("OrSkeletonText"), W = c("OrDataGridTableContentCell"), z = c("OrDataGridTableContentRow"), j = c("OrDataGridTablePlaceholder"), X = c("OrDataGridTableContent"), J = c("OrDataGridTable"), E = c("OrDataGridTableFooterCell"), P = c("OrDataGridTableFooterRow"), U = c("OrDataGridTableFooter"), L = c("OrPagination"), N = c("OrDataGridFooter");
1457
+ return o(), p("div", {
1458
+ ref: "root",
1459
+ class: m(e.rootStyles)
1460
+ }, [
1461
+ e.$slots.title || e.features.searching || e.$slots.search || e.$slots.extraActions ? (o(), y(M, {
1462
+ key: 0,
1463
+ class: m(["shrink-0"])
1464
+ }, Y({ _: 2 }, [
1465
+ e.$slots.title ? {
1466
+ name: "title",
1467
+ fn: b(() => [
1468
+ i(e.$slots, "title")
1469
+ ]),
1470
+ key: "0"
1471
+ } : void 0,
1472
+ e.features.searching ? {
1473
+ name: "searching",
1474
+ fn: b(() => [
1475
+ i(e.$slots, "search", de(ue({ updateSearchingModel: e.updateSearchingModel, searchingModel: e.searchingModel })), () => [
1476
+ H(T, {
1477
+ modelValue: e.searchingModel,
1478
+ "onUpdate:modelValue": t[0] || (t[0] = (s) => e.searchingModel = s)
1479
+ }, null, 8, ["modelValue"])
1480
+ ])
1481
+ ]),
1482
+ key: "1"
1483
+ } : void 0,
1484
+ e.$slots.extraActions ? {
1485
+ name: "extraActions",
1486
+ fn: b(() => [
1487
+ i(e.$slots, "extraActions")
1488
+ ]),
1489
+ key: "2"
1490
+ } : void 0
1491
+ ]), 1024)) : g("", !0),
1492
+ e.$slots.toolbar ? (o(), y(D, {
1493
+ key: 1,
1494
+ class: m(["shrink-0"])
1495
+ }, {
1496
+ default: b(() => [
1497
+ i(e.$slots, "toolbar")
1498
+ ]),
1499
+ _: 3
1500
+ })) : g("", !0),
1501
+ H(J, {
1502
+ ref: "table",
1503
+ class: m(["grow", { "grid-rows-[auto_1fr]": e.items.length === 0 }]),
1504
+ style: K(e.tableInlineStyles),
1505
+ columns: e.columns,
1506
+ features: e.features
1507
+ }, {
1508
+ default: b(() => [
1509
+ H(I, null, {
1510
+ default: b(() => [
1511
+ H(R, { variant: e.variant }, {
1512
+ default: b(() => [
1513
+ e.features.selecting ? (o(), y(V, {
1514
+ key: 0,
1515
+ column: { stickiness: "start" },
1516
+ class: "md:!py-none",
1517
+ "onUpdate:scrollOffset": e.updateScrollOffset,
1518
+ "onRemove:scrollOffset": e.removeScrollOffset
1519
+ }, {
1520
+ default: b(() => [
1521
+ H(O, {
1522
+ modelValue: e.selectingIndicator,
1523
+ "onUpdate:modelValue": t[1] || (t[1] = (s) => e.selectingIndicator = s),
1524
+ indeterminate: !e.selectingIndicator && e.selectingModel.length > 0,
1525
+ disabled: e.selectingDisabled
1526
+ }, null, 8, ["modelValue", "indeterminate", "disabled"])
1527
+ ]),
1528
+ _: 1
1529
+ }, 8, ["onUpdate:scrollOffset", "onRemove:scrollOffset"])) : g("", !0),
1530
+ (o(!0), p(q, null, Q(e.columns, (s) => (o(), y(V, {
1531
+ key: s.name,
1532
+ modelValue: e.sortingModel,
1533
+ "onUpdate:modelValue": t[2] || (t[2] = (w) => e.sortingModel = w),
1534
+ column: s,
1535
+ features: e.features,
1536
+ "onUpdate:scrollOffset": e.updateScrollOffset,
1537
+ "onRemove:scrollOffset": e.removeScrollOffset,
1538
+ "onUpdate:columnWidth": (w) => e.updateColumnWidth(s, w)
1539
+ }, {
1540
+ default: b(() => [
1541
+ Z(_(s.label), 1)
1542
+ ]),
1543
+ _: 2
1544
+ }, 1032, ["modelValue", "column", "features", "onUpdate:scrollOffset", "onRemove:scrollOffset", "onUpdate:columnWidth"]))), 128))
1545
+ ]),
1546
+ _: 1
1547
+ }, 8, ["variant"])
1548
+ ]),
1549
+ _: 1
1550
+ }),
1551
+ e.notification ? (o(), y(r, {
1552
+ key: 0,
1553
+ notification: e.notification,
1554
+ variant: e.variant,
1555
+ onCloseNotification: t[3] || (t[3] = (s) => e.$emit("close-notification"))
1556
+ }, Y({ _: 2 }, [
1557
+ e.$slots.notification ? {
1558
+ name: "notification",
1559
+ fn: b(() => [
1560
+ i(e.$slots, "notification")
1561
+ ]),
1562
+ key: "0"
1563
+ } : void 0
1564
+ ]), 1032, ["notification", "variant"])) : g("", !0),
1565
+ H(X, null, {
1566
+ default: b(() => [
1567
+ e.$slots["before-rows"] ? (o(), y(u, {
1568
+ key: 0,
1569
+ variant: e.variant,
1570
+ class: "border-b-1"
1571
+ }, {
1572
+ default: b(() => [
1573
+ i(e.$slots, "before-rows")
1574
+ ]),
1575
+ _: 3
1576
+ }, 8, ["variant"])) : g("", !0),
1577
+ e.loading ? (o(!0), p(q, { key: 1 }, Q(e.skeletonsLength, (s) => (o(), y(z, {
1578
+ key: s,
1579
+ variant: e.variant,
1580
+ interactive: e.interactiveRows
1581
+ }, {
1582
+ default: b(() => [
1583
+ e.features.selecting ? (o(), y(W, {
1584
+ key: 0,
1585
+ column: { stickiness: "start" },
1586
+ variant: e.variant,
1587
+ override: !0
1588
+ }, {
1589
+ default: b(() => [
1590
+ H(d)
1591
+ ]),
1592
+ _: 1
1593
+ }, 8, ["variant"])) : g("", !0),
1594
+ (o(!0), p(q, null, Q(e.columns, (w) => (o(), y(W, {
1595
+ key: w.name,
1596
+ column: w,
1597
+ features: e.features,
1598
+ variant: e.variant,
1599
+ override: !0
1600
+ }, {
1601
+ default: b(() => [
1602
+ i(e.$slots, "column-loading", { column: w }, () => [
1603
+ H(d)
1604
+ ])
1605
+ ]),
1606
+ _: 2
1607
+ }, 1032, ["column", "features", "variant"]))), 128))
1608
+ ]),
1609
+ _: 2
1610
+ }, 1032, ["variant", "interactive"]))), 128)) : e.items.length > 0 ? (o(!0), p(q, { key: 2 }, Q(e.items, (s) => (o(), y(z, {
1611
+ key: s.id,
1612
+ variant: e.variant,
1613
+ selected: e.selectingModel.includes(s.id),
1614
+ interactive: e.interactiveRows,
1615
+ onMouseenter: () => e.handleMouseEnterRow(s),
1616
+ onMouseleave: () => e.handleMouseLeaveRow(s),
1617
+ onClick: () => e.handleRowClick(s)
1618
+ }, {
1619
+ default: b(() => [
1620
+ e.features.selecting ? (o(), y(W, {
1621
+ key: 0,
1622
+ column: { stickiness: "start" },
1623
+ variant: e.variant,
1624
+ override: !0,
1625
+ "force-state": "none",
1626
+ class: "md:!py-none",
1627
+ onMouseenter: () => e.handleMouseEnterCell(s, "selecting", e.selectingModel.includes(s.id)),
1628
+ onMouseleave: () => e.handleMouseLeaveCell(s, "selecting", e.selectingModel.includes(s.id))
1629
+ }, {
1630
+ default: b(() => [
1631
+ H(O, {
1632
+ modelValue: e.selectingModel,
1633
+ "onUpdate:modelValue": t[4] || (t[4] = (w) => e.selectingModel = w),
1634
+ value: s.id,
1635
+ disabled: e.selectingDisabled
1636
+ }, null, 8, ["modelValue", "value", "disabled"])
1637
+ ]),
1638
+ _: 2
1639
+ }, 1032, ["variant", "onMouseenter", "onMouseleave"])) : g("", !0),
1640
+ (o(!0), p(q, null, Q(e.columns, (w) => (o(), y(W, {
1641
+ key: w.name,
1642
+ "model-value": s[w.name],
1643
+ column: w,
1644
+ features: e.features,
1645
+ variant: e.variant,
1646
+ onInput: (A) => e.onInput(s, w.name, A),
1647
+ onFocusin: t[5] || (t[5] = (A) => e.scrollTo(A)),
1648
+ onMouseenter: () => e.handleMouseEnterCell(s, w.name, s[w.name]),
1649
+ onMouseleave: () => e.handleMouseLeaveCell(s, w.name, s[w.name])
1650
+ }, {
1651
+ default: b(() => [
1652
+ i(e.$slots, w.name, {
1653
+ column: w,
1654
+ item: s
1655
+ }, () => [
1656
+ Z(_(s[w.name]), 1)
1657
+ ])
1658
+ ]),
1659
+ _: 2
1660
+ }, 1032, ["model-value", "column", "features", "variant", "onInput", "onMouseenter", "onMouseleave"]))), 128))
1661
+ ]),
1662
+ _: 2
1663
+ }, 1032, ["variant", "selected", "interactive", "onMouseenter", "onMouseleave", "onClick"]))), 128)) : e.$slots.noSearchResults && (e.features.filtering && e.filteringModel || e.features.searching && e.searchingModel) ? (o(), y(j, {
1664
+ key: 3,
1665
+ class: m(["col-span-full"]),
1666
+ variant: e.variant
1667
+ }, {
1668
+ default: b(() => [
1669
+ i(e.$slots, "noSearchResults", {
1670
+ filter: e.filteringModel,
1671
+ search: e.searchingModel
1672
+ })
1673
+ ]),
1674
+ _: 3
1675
+ }, 8, ["variant"])) : e.$slots.empty ? (o(), y(j, {
1676
+ key: 4,
1677
+ class: m(["col-span-full"]),
1678
+ variant: e.variant
1679
+ }, {
1680
+ default: b(() => [
1681
+ i(e.$slots, "empty")
1682
+ ]),
1683
+ _: 3
1684
+ }, 8, ["variant"])) : g("", !0),
1685
+ e.$slots["after-rows"] ? (o(), y(u, {
1686
+ key: 5,
1687
+ variant: e.variant
1688
+ }, {
1689
+ default: b(() => [
1690
+ i(e.$slots, "after-rows")
1691
+ ]),
1692
+ _: 3
1693
+ }, 8, ["variant"])) : g("", !0)
1694
+ ]),
1695
+ _: 3
1696
+ })
1697
+ ]),
1698
+ _: 3
1699
+ }, 8, ["class", "style", "columns", "features"]),
1700
+ e.$slots["extra-row"] ? (o(), y(U, { key: 2 }, {
1701
+ default: b(() => [
1702
+ H(P, {
1703
+ class: m(["shrink-0"]),
1704
+ variant: e.variant
1705
+ }, {
1706
+ default: b(() => [
1707
+ H(E, null, {
1708
+ default: b(() => [
1709
+ i(e.$slots, "extra-row")
1710
+ ]),
1711
+ _: 3
1712
+ })
1713
+ ]),
1714
+ _: 3
1715
+ }, 8, ["variant"])
1716
+ ]),
1717
+ _: 3
1718
+ })) : g("", !0),
1719
+ e.$slots.actions || e.showSelectingCouter || e.features.paging ? (o(), y(N, {
1720
+ key: 3,
1721
+ class: m(["shrink-0"])
1722
+ }, Y({ _: 2 }, [
1723
+ e.features.selecting && e.selectingModel.length > 0 ? {
1724
+ name: "status",
1725
+ fn: b(() => [
1726
+ Z(_(e.selectingModel.length) + " row(s) selected ", 1)
1727
+ ]),
1728
+ key: "0"
1729
+ } : void 0,
1730
+ e.$slots.actions ? {
1731
+ name: "actions",
1732
+ fn: b(() => [
1733
+ i(e.$slots, "actions")
1734
+ ]),
1735
+ key: "1"
1736
+ } : void 0,
1737
+ e.features.paging ? {
1738
+ name: "paging",
1739
+ fn: b(() => [
1740
+ H(L, {
1741
+ ref: "pagination",
1742
+ modelValue: e.pagingModel,
1743
+ "onUpdate:modelValue": t[6] || (t[6] = (s) => e.pagingModel = s),
1744
+ length: e.features.paging.length,
1745
+ options: e.features.paging.options
1746
+ }, null, 8, ["modelValue", "length", "options"])
1747
+ ]),
1748
+ key: "2"
1749
+ } : void 0
1750
+ ]), 1024)) : g("", !0)
1751
+ ], 2);
1752
+ }
1753
+ const fa = /* @__PURE__ */ C(Kt, [["render", Xt]]);
1754
+ export {
1755
+ k as D,
1756
+ fa as O,
1757
+ B as a,
1758
+ Ge as b,
1759
+ He as c,
1760
+ ze as d,
1761
+ qe as e,
1762
+ Je as f,
1763
+ _e as g,
1764
+ ot as h,
1765
+ st as i,
1766
+ mt as j,
1767
+ vt as k,
1768
+ Ot as l,
1769
+ Tt as m,
1770
+ Mt as n,
1771
+ Ft as o,
1772
+ jt as p,
1773
+ qt as q
1774
+ };
1775
+ //# sourceMappingURL=OrDataGrid-B7h2wGXD.mjs.map