@onereach/ui-components 26.4.0 → 26.4.1-beta.5877.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,1776 @@
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 f, renderSlot as i, createCommentVNode as g, resolveComponent as m, 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__ */ f(["grow"])
58
+ };
59
+ function Te(e, t, n, h, v, u) {
60
+ return o(), p("div", {
61
+ ref: "root",
62
+ class: f(e.rootStyles)
63
+ }, [
64
+ e.$slots.status ? (o(), p("div", {
65
+ key: 0,
66
+ class: f(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__ */ f(["grow"])
106
+ };
107
+ function Ie(e, t, n, h, v, u) {
108
+ return o(), p("div", {
109
+ ref: "root",
110
+ class: f(e.rootStyles)
111
+ }, [
112
+ e.$slots.title ? (o(), p("div", {
113
+ key: 0,
114
+ class: f(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
+ }), u = 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: u,
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, u) {
271
+ const T = m("OrInput"), M = m("OrRating"), D = m("OrSelect"), O = m("OrCheckbox"), V = m("OrSwitch"), R = m("OrDatePicker"), I = m("OrTimePicker"), r = m("OrDateTimePicker"), c = m("OrTagInput");
272
+ return o(), p("div", {
273
+ ref: "root",
274
+ class: f(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(c, {
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: f(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, u) {
423
+ return o(), p("div", {
424
+ ref: "root",
425
+ class: f(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, u) {
451
+ return o(), p("div", {
452
+ ref: "root",
453
+ class: f(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, u) {
485
+ return o(), p("div", {
486
+ ref: "root",
487
+ class: f(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, u) {
546
+ return o(), p("div", {
547
+ ref: "root",
548
+ class: f(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, u) {
573
+ return o(), p("div", {
574
+ ref: "root",
575
+ class: f(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, c, d;
646
+ return !!((r = e.features) != null && r.sorting) && !!((c = e.column) != null && c.name) && ((d = e.column) == null ? void 0 : d.sorting) !== !1;
647
+ }), v = l(() => {
648
+ var r, c;
649
+ return !!((r = e.features) != null && r.resizing) && !!((c = e.column) != null && c.name);
650
+ }), u = 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, c;
664
+ return {
665
+ minWidth: ((r = e.column) == null ? void 0 : r.minWidth) || B,
666
+ maxWidth: (c = e.column) == null ? void 0 : c.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, c;
697
+ if (h.value)
698
+ return ((r = e.modelValue) == null ? void 0 : r.column) === ((c = e.column) == null ? void 0 : c.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 c = r.pageX, d = ((j = n.value) == null ? void 0 : j.offsetWidth) || 0, W = (X) => {
724
+ var U, L;
725
+ const J = X.pageX - c;
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
+ c
753
+ ], [
754
+ d
755
+ ]) => {
756
+ d && d !== r && t.emit("remove:scrollOffset", d), t.emit("update:scrollOffset", r, c, e.column);
757
+ }), {
758
+ root: n,
759
+ rootStyles: u,
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, u) {
773
+ const T = m("OrIcon");
774
+ return o(), p("div", {
775
+ ref: "root",
776
+ class: f(e.rootStyles),
777
+ style: K(e.rootInlineStyles),
778
+ onClick: t[2] || (t[2] = (M) => e.toggleSorting())
779
+ }, [
780
+ le("div", {
781
+ class: f(["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: f(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, u) {
852
+ return o(), p("div", {
853
+ ref: "root",
854
+ class: f(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, u) {
879
+ return o(), p("div", {
880
+ ref: "root",
881
+ class: f(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, u) {
941
+ return o(), p("div", {
942
+ ref: "root",
943
+ class: f(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
+ "w-full min-w-0",
952
+ // Overflow
953
+ "overflow-auto",
954
+ // Interactivity
955
+ "interactivity-default"
956
+ ], Ct = G({
957
+ name: "OrDataGridTable",
958
+ props: {
959
+ columns: {
960
+ type: Array,
961
+ required: !0
962
+ },
963
+ features: {
964
+ type: Object,
965
+ required: !0
966
+ }
967
+ },
968
+ expose: [
969
+ "root"
970
+ ],
971
+ setup(e) {
972
+ const t = S(), n = l(() => [
973
+ "or-data-grid-table-v3",
974
+ ...Gt
975
+ ]), h = l(() => {
976
+ const v = e.columns.map((u) => {
977
+ if (u.width && (u.width.includes("minmax") || u.width.includes("calc")))
978
+ return u.width;
979
+ const T = u.width ?? "1fr", M = u.minWidth || (u.width ? B : "120px");
980
+ let D = u.maxWidth || T;
981
+ return T.endsWith("px") && (D = T), `minmax(${M}, ${D})`;
982
+ });
983
+ return e.features.selecting ? { gridTemplateColumns: `min-content ${v.join(" ")}` } : { gridTemplateColumns: v.join(" ") };
984
+ });
985
+ return {
986
+ root: t,
987
+ rootStyles: n,
988
+ rootInlineStyles: h
989
+ };
990
+ }
991
+ });
992
+ function Vt(e, t, n, h, v, u) {
993
+ return o(), p("div", {
994
+ ref: "root",
995
+ class: f(e.rootStyles),
996
+ style: K(e.rootInlineStyles)
997
+ }, [
998
+ i(e.$slots, "default")
999
+ ], 6);
1000
+ }
1001
+ const Mt = /* @__PURE__ */ C(Ct, [["render", Vt]]), Rt = [
1002
+ // Layout
1003
+ "layout-row",
1004
+ // Box
1005
+ "h-2xl",
1006
+ // Spacing
1007
+ "gap-xl"
1008
+ ], It = G({
1009
+ name: "OrDataGridToolbar",
1010
+ expose: [
1011
+ "root"
1012
+ ],
1013
+ setup() {
1014
+ const e = S(), t = l(() => [
1015
+ "or-data-grid-toolbar-v3",
1016
+ ...Rt
1017
+ ]);
1018
+ return {
1019
+ root: e,
1020
+ rootStyles: t
1021
+ };
1022
+ }
1023
+ });
1024
+ function Ht(e, t, n, h, v, u) {
1025
+ return o(), p("div", {
1026
+ ref: "root",
1027
+ class: f(e.rootStyles)
1028
+ }, [
1029
+ i(e.$slots, "default")
1030
+ ], 2);
1031
+ }
1032
+ const Ft = /* @__PURE__ */ C(It, [["render", Ht]]), Wt = [
1033
+ // Position
1034
+ "grid sticky z-10",
1035
+ // Layout
1036
+ "col-span-full"
1037
+ ], Et = {
1038
+ [k.Standard]: [
1039
+ // Position
1040
+ "top-[calc(theme(spacing.2xl)+theme(spacing.xs))]"
1041
+ ],
1042
+ [k.Comfortable]: [
1043
+ // Position
1044
+ "top-[calc(theme(spacing.3xl)+theme(spacing.xs))]"
1045
+ ],
1046
+ [k.Compact]: [
1047
+ // Position
1048
+ "top-[calc(theme(spacing.xl)+theme(spacing.xs))]"
1049
+ ],
1050
+ [k.Dynamic]: [
1051
+ // Position
1052
+ "top-[calc(theme(spacing.2xl)+theme(spacing.xs))]"
1053
+ ]
1054
+ }, Pt = G({
1055
+ components: {
1056
+ OrNotification: Oe
1057
+ },
1058
+ props: {
1059
+ notification: {
1060
+ type: Object,
1061
+ required: !0
1062
+ },
1063
+ variant: {
1064
+ type: String,
1065
+ required: !0
1066
+ }
1067
+ },
1068
+ emits: [
1069
+ "close-notification"
1070
+ ],
1071
+ setup(e) {
1072
+ return {
1073
+ rootStyles: l(() => [
1074
+ "or-data-grid-notification-v3",
1075
+ ...Wt,
1076
+ ...Et[e.variant]
1077
+ ])
1078
+ };
1079
+ }
1080
+ });
1081
+ function zt(e, t, n, h, v, u) {
1082
+ const T = m("OrNotification");
1083
+ return o(), p("div", {
1084
+ class: f(e.rootStyles)
1085
+ }, [
1086
+ H(T, se(e.notification, {
1087
+ class: "rounded-0 shadow-none",
1088
+ onClose: t[0] || (t[0] = (M) => e.$emit("close-notification"))
1089
+ }), {
1090
+ default: b(() => [
1091
+ e.$slots.notification ? i(e.$slots, "notification", { key: 0 }) : g("", !0)
1092
+ ]),
1093
+ _: 3
1094
+ }, 16)
1095
+ ], 2);
1096
+ }
1097
+ const jt = /* @__PURE__ */ C(Pt, [["render", zt]]), Nt = [
1098
+ // Layout
1099
+ "grid col-span-full grid-cols-[subgrid]",
1100
+ // Typography
1101
+ "typography-body-2-regular",
1102
+ // Theme
1103
+ "theme-border-disabled",
1104
+ "dark:theme-border-disabled-dark",
1105
+ // Theme (children)
1106
+ "children:theme-foreground-default",
1107
+ "dark:children:theme-foreground-default-dark",
1108
+ "children:theme-background-default",
1109
+ "dark:children:theme-background-default-dark"
1110
+ ], Ut = {
1111
+ [k.Standard]: [
1112
+ // Box
1113
+ "min-h-[calc(theme(spacing.2xl)+theme(spacing.xs))]"
1114
+ ],
1115
+ [k.Comfortable]: [
1116
+ // Box
1117
+ "min-h-[calc(theme(spacing.3xl)+theme(spacing.xs))]"
1118
+ ],
1119
+ [k.Compact]: [
1120
+ // Box
1121
+ "min-h-[calc(theme(spacing.xl)+theme(spacing.xs))]"
1122
+ ],
1123
+ [k.Dynamic]: [
1124
+ // Box
1125
+ "min-h-[calc(theme(spacing.2xl)+theme(spacing.xs))]"
1126
+ ]
1127
+ }, Lt = G({
1128
+ name: "OrDataGridTableExtraRow",
1129
+ props: {
1130
+ variant: {
1131
+ type: String,
1132
+ required: !0
1133
+ }
1134
+ },
1135
+ expose: [
1136
+ "root"
1137
+ ],
1138
+ setup(e) {
1139
+ const t = S(), n = l(() => [
1140
+ "or-data-grid-table-extra-row-v3",
1141
+ ...Nt,
1142
+ ...Ut[e.variant]
1143
+ ]);
1144
+ return {
1145
+ root: t,
1146
+ rootStyles: n
1147
+ };
1148
+ }
1149
+ });
1150
+ function At(e, t, n, h, v, u) {
1151
+ return o(), p("div", {
1152
+ ref: "root",
1153
+ class: f(e.rootStyles)
1154
+ }, [
1155
+ i(e.$slots, "default")
1156
+ ], 2);
1157
+ }
1158
+ const qt = /* @__PURE__ */ C(Lt, [["render", At]]), Bt = [
1159
+ // Layout
1160
+ "layout-column"
1161
+ ], Kt = G({
1162
+ name: "OrDataGrid",
1163
+ components: {
1164
+ OrCheckbox: ee,
1165
+ OrDataGridFooter: Ge,
1166
+ OrDataGridHeader: He,
1167
+ OrDataGridTable: Mt,
1168
+ OrDataGridTableContent: Je,
1169
+ OrDataGridTableContentCell: ze,
1170
+ OrDataGridTableContentRow: qe,
1171
+ OrDataGridTableFooter: st,
1172
+ OrDataGridTableFooterCell: _e,
1173
+ OrDataGridTableFooterRow: ot,
1174
+ OrDataGridTableExtraRow: qt,
1175
+ OrDataGridTableHeader: Ot,
1176
+ OrDataGridTableHeaderCell: mt,
1177
+ OrDataGridTableHeaderRow: vt,
1178
+ OrDataGridTablePlaceholder: Tt,
1179
+ OrDataGridToolbar: Ft,
1180
+ OrDataGridNotification: jt,
1181
+ OrPagination: oe,
1182
+ OrSearch: re,
1183
+ OrSkeletonText: ne
1184
+ },
1185
+ model: {
1186
+ prop: "modelValue",
1187
+ event: "update:modelValue"
1188
+ },
1189
+ props: {
1190
+ modelValue: {
1191
+ type: void 0,
1192
+ default: void 0
1193
+ },
1194
+ items: {
1195
+ type: Array,
1196
+ default: () => []
1197
+ },
1198
+ columns: {
1199
+ type: Array,
1200
+ required: !0
1201
+ },
1202
+ variant: {
1203
+ type: String,
1204
+ default: () => k.Standard
1205
+ },
1206
+ features: {
1207
+ type: Object,
1208
+ default: () => ({})
1209
+ },
1210
+ loading: {
1211
+ type: Boolean,
1212
+ default: !1
1213
+ },
1214
+ notification: {
1215
+ type: Object,
1216
+ default: void 0
1217
+ },
1218
+ interactiveRows: {
1219
+ type: Boolean,
1220
+ default: !1
1221
+ }
1222
+ },
1223
+ emits: [
1224
+ "update:modelValue",
1225
+ "update:item",
1226
+ "close-notification",
1227
+ "hover:row",
1228
+ "blur:row",
1229
+ "hover:cell",
1230
+ "blur:cell",
1231
+ "click:row"
1232
+ ],
1233
+ expose: [
1234
+ "root"
1235
+ ],
1236
+ setup(e, t) {
1237
+ const n = S(), h = S(), v = S(), u = l(() => [
1238
+ "or-data-grid-v3",
1239
+ ...Bt
1240
+ ]), T = l(() => ({
1241
+ scrollPaddingInlineStart: `${[...r.value.values()].reduce((a, $) => a + $, 0)}px`,
1242
+ scrollPaddingInlineEnd: `${[...c.value.values()].reduce((a, $) => a + $, 0)}px`
1243
+ })), M = l({
1244
+ get: () => !!e.items.length && e.items.every((a) => D.value.includes(a.id)),
1245
+ set: (a) => {
1246
+ a ? D.value = [
1247
+ .../* @__PURE__ */ new Set([
1248
+ ...D.value,
1249
+ ...e.items.map(($) => $.id)
1250
+ ])
1251
+ ] : D.value = [];
1252
+ }
1253
+ }), D = l({
1254
+ get: () => {
1255
+ var a;
1256
+ return ((a = e.modelValue) == null ? void 0 : a.selecting) ?? [];
1257
+ },
1258
+ set: (a) => {
1259
+ t.emit("update:modelValue", {
1260
+ selecting: a,
1261
+ filtering: O.value,
1262
+ searching: V.value,
1263
+ sorting: R.value,
1264
+ paging: I.value
1265
+ });
1266
+ }
1267
+ }), O = l({
1268
+ get: () => {
1269
+ var a;
1270
+ return (a = e.modelValue) == null ? void 0 : a.filtering;
1271
+ },
1272
+ set: (a) => {
1273
+ t.emit("update:modelValue", {
1274
+ selecting: D.value,
1275
+ filtering: a,
1276
+ searching: V.value,
1277
+ sorting: R.value,
1278
+ paging: {
1279
+ ...I.value,
1280
+ offset: 0
1281
+ }
1282
+ });
1283
+ }
1284
+ }), V = l({
1285
+ get: () => {
1286
+ var a;
1287
+ return (a = e.modelValue) == null ? void 0 : a.searching;
1288
+ },
1289
+ set: (a) => {
1290
+ t.emit("update:modelValue", {
1291
+ selecting: D.value,
1292
+ filtering: O.value,
1293
+ searching: a,
1294
+ sorting: R.value,
1295
+ paging: {
1296
+ ...I.value,
1297
+ offset: 0
1298
+ }
1299
+ });
1300
+ }
1301
+ }), R = l({
1302
+ get: () => {
1303
+ var a;
1304
+ return (a = e.modelValue) == null ? void 0 : a.sorting;
1305
+ },
1306
+ set: (a) => {
1307
+ t.emit("update:modelValue", {
1308
+ selecting: D.value,
1309
+ filtering: O.value,
1310
+ searching: V.value,
1311
+ sorting: a,
1312
+ paging: {
1313
+ ...I.value,
1314
+ offset: 0
1315
+ }
1316
+ });
1317
+ }
1318
+ }), I = l({
1319
+ get: () => {
1320
+ var a;
1321
+ return (a = e.modelValue) == null ? void 0 : a.paging;
1322
+ },
1323
+ set: (a) => {
1324
+ t.emit("update:modelValue", {
1325
+ selecting: D.value,
1326
+ filtering: O.value,
1327
+ searching: V.value,
1328
+ sorting: R.value,
1329
+ paging: a
1330
+ });
1331
+ }
1332
+ });
1333
+ te(() => {
1334
+ var a;
1335
+ return (a = I.value) == null ? void 0 : a.offset;
1336
+ }, () => {
1337
+ var a;
1338
+ (a = v.value) != null && a.root && v.value.root.scrollTo({
1339
+ top: 0,
1340
+ behavior: "smooth"
1341
+ });
1342
+ });
1343
+ const r = S(/* @__PURE__ */ new Map()), c = 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(() => {
1344
+ var a;
1345
+ return ((a = h.value) == null ? void 0 : a.currentLimit) || 10;
1346
+ });
1347
+ function j(a) {
1348
+ V.value = a;
1349
+ }
1350
+ function X(a, $, F) {
1351
+ switch (F.stickiness) {
1352
+ case "start":
1353
+ r.value.set(a, $), r.value = new Map(r.value), c.value.delete(a), c.value = new Map(c.value);
1354
+ break;
1355
+ case "end":
1356
+ r.value.delete(a), r.value = new Map(r.value), c.value.set(a, $), c.value = new Map(c.value);
1357
+ break;
1358
+ default:
1359
+ A(a);
1360
+ break;
1361
+ }
1362
+ }
1363
+ function J(a) {
1364
+ e.interactiveRows && t.emit("hover:row", a);
1365
+ }
1366
+ function E(a) {
1367
+ e.interactiveRows && t.emit("blur:row", a);
1368
+ }
1369
+ function P(a, $, F) {
1370
+ e.interactiveRows && t.emit("hover:cell", {
1371
+ item: a,
1372
+ columnName: $,
1373
+ value: F
1374
+ });
1375
+ }
1376
+ function U(a, $, F) {
1377
+ e.interactiveRows && t.emit("blur:cell", {
1378
+ item: a,
1379
+ columnName: $,
1380
+ value: F
1381
+ });
1382
+ }
1383
+ function L(a) {
1384
+ e.interactiveRows && t.emit("click:row", a);
1385
+ }
1386
+ function N(a, $) {
1387
+ a.width = `${$}px`, e.features.storageKey && s();
1388
+ }
1389
+ function s() {
1390
+ if (typeof window > "u" || !e.features.storageKey) return;
1391
+ const a = {};
1392
+ e.columns.forEach(($) => {
1393
+ $.name && $.width && (a[$.name] = $.width);
1394
+ }), localStorage.setItem(`or-data-grid-v3-widths-${e.features.storageKey}`, JSON.stringify(a));
1395
+ }
1396
+ function w() {
1397
+ if (!(typeof window > "u" || !e.features.storageKey))
1398
+ try {
1399
+ const a = localStorage.getItem(`or-data-grid-v3-widths-${e.features.storageKey}`);
1400
+ if (a) {
1401
+ const $ = JSON.parse(a);
1402
+ e.columns.forEach((F) => {
1403
+ F.name && $[F.name] && (F.width = $[F.name]);
1404
+ });
1405
+ }
1406
+ } catch (a) {
1407
+ console.error("[OrDataGrid]: Failed to load column widths from localStorage", a);
1408
+ }
1409
+ }
1410
+ ie(() => {
1411
+ w();
1412
+ });
1413
+ function A(a) {
1414
+ r.value.delete(a), r.value = new Map(r.value), c.value.delete(a), c.value = new Map(c.value);
1415
+ }
1416
+ function ae(a) {
1417
+ a.currentTarget.scrollIntoView({ block: "nearest" });
1418
+ }
1419
+ return {
1420
+ root: n,
1421
+ rootStyles: u,
1422
+ pagination: h,
1423
+ tableInlineStyles: T,
1424
+ selectingIndicator: M,
1425
+ showSelectingCouter: d,
1426
+ selectingDisabled: W,
1427
+ skeletonsLength: z,
1428
+ handleMouseEnterRow: J,
1429
+ handleMouseLeaveRow: E,
1430
+ handleMouseEnterCell: P,
1431
+ handleMouseLeaveCell: U,
1432
+ handleRowClick: L,
1433
+ updateColumnWidth: N,
1434
+ selectingModel: D,
1435
+ filteringModel: O,
1436
+ searchingModel: V,
1437
+ sortingModel: R,
1438
+ pagingModel: I,
1439
+ updateScrollOffset: X,
1440
+ removeScrollOffset: A,
1441
+ updateSearchingModel: j,
1442
+ scrollToTop: () => {
1443
+ var a;
1444
+ (a = v.value) != null && a.root && v.value.root.scrollTo({
1445
+ top: 0,
1446
+ behavior: "smooth"
1447
+ });
1448
+ },
1449
+ scrollTo: ae,
1450
+ onInput: (a, $, F) => {
1451
+ a[$] = F, t.emit("update:item", a);
1452
+ }
1453
+ };
1454
+ }
1455
+ });
1456
+ function Xt(e, t, n, h, v, u) {
1457
+ const T = m("OrSearch"), M = m("OrDataGridHeader"), D = m("OrDataGridToolbar"), O = m("OrCheckbox"), V = m("OrDataGridTableHeaderCell"), R = m("OrDataGridTableHeaderRow"), I = m("OrDataGridTableHeader"), r = m("OrDataGridNotification"), c = m("OrDataGridTableExtraRow"), d = m("OrSkeletonText"), W = m("OrDataGridTableContentCell"), z = m("OrDataGridTableContentRow"), j = m("OrDataGridTablePlaceholder"), X = m("OrDataGridTableContent"), J = m("OrDataGridTable"), E = m("OrDataGridTableFooterCell"), P = m("OrDataGridTableFooterRow"), U = m("OrDataGridTableFooter"), L = m("OrPagination"), N = m("OrDataGridFooter");
1458
+ return o(), p("div", {
1459
+ ref: "root",
1460
+ class: f(e.rootStyles)
1461
+ }, [
1462
+ e.$slots.title || e.features.searching || e.$slots.search || e.$slots.extraActions ? (o(), y(M, {
1463
+ key: 0,
1464
+ class: f(["shrink-0"])
1465
+ }, Y({ _: 2 }, [
1466
+ e.$slots.title ? {
1467
+ name: "title",
1468
+ fn: b(() => [
1469
+ i(e.$slots, "title")
1470
+ ]),
1471
+ key: "0"
1472
+ } : void 0,
1473
+ e.features.searching ? {
1474
+ name: "searching",
1475
+ fn: b(() => [
1476
+ i(e.$slots, "search", de(ue({ updateSearchingModel: e.updateSearchingModel, searchingModel: e.searchingModel })), () => [
1477
+ H(T, {
1478
+ modelValue: e.searchingModel,
1479
+ "onUpdate:modelValue": t[0] || (t[0] = (s) => e.searchingModel = s)
1480
+ }, null, 8, ["modelValue"])
1481
+ ])
1482
+ ]),
1483
+ key: "1"
1484
+ } : void 0,
1485
+ e.$slots.extraActions ? {
1486
+ name: "extraActions",
1487
+ fn: b(() => [
1488
+ i(e.$slots, "extraActions")
1489
+ ]),
1490
+ key: "2"
1491
+ } : void 0
1492
+ ]), 1024)) : g("", !0),
1493
+ e.$slots.toolbar ? (o(), y(D, {
1494
+ key: 1,
1495
+ class: f(["shrink-0"])
1496
+ }, {
1497
+ default: b(() => [
1498
+ i(e.$slots, "toolbar")
1499
+ ]),
1500
+ _: 3
1501
+ })) : g("", !0),
1502
+ H(J, {
1503
+ ref: "table",
1504
+ class: f(["grow", { "grid-rows-[auto_1fr]": e.items.length === 0 }]),
1505
+ style: K(e.tableInlineStyles),
1506
+ columns: e.columns,
1507
+ features: e.features
1508
+ }, {
1509
+ default: b(() => [
1510
+ H(I, null, {
1511
+ default: b(() => [
1512
+ H(R, { variant: e.variant }, {
1513
+ default: b(() => [
1514
+ e.features.selecting ? (o(), y(V, {
1515
+ key: 0,
1516
+ column: { stickiness: "start" },
1517
+ class: "md:!py-none",
1518
+ "onUpdate:scrollOffset": e.updateScrollOffset,
1519
+ "onRemove:scrollOffset": e.removeScrollOffset
1520
+ }, {
1521
+ default: b(() => [
1522
+ H(O, {
1523
+ modelValue: e.selectingIndicator,
1524
+ "onUpdate:modelValue": t[1] || (t[1] = (s) => e.selectingIndicator = s),
1525
+ indeterminate: !e.selectingIndicator && e.selectingModel.length > 0,
1526
+ disabled: e.selectingDisabled
1527
+ }, null, 8, ["modelValue", "indeterminate", "disabled"])
1528
+ ]),
1529
+ _: 1
1530
+ }, 8, ["onUpdate:scrollOffset", "onRemove:scrollOffset"])) : g("", !0),
1531
+ (o(!0), p(q, null, Q(e.columns, (s) => (o(), y(V, {
1532
+ key: s.name,
1533
+ modelValue: e.sortingModel,
1534
+ "onUpdate:modelValue": t[2] || (t[2] = (w) => e.sortingModel = w),
1535
+ column: s,
1536
+ features: e.features,
1537
+ "onUpdate:scrollOffset": e.updateScrollOffset,
1538
+ "onRemove:scrollOffset": e.removeScrollOffset,
1539
+ "onUpdate:columnWidth": (w) => e.updateColumnWidth(s, w)
1540
+ }, {
1541
+ default: b(() => [
1542
+ Z(_(s.label), 1)
1543
+ ]),
1544
+ _: 2
1545
+ }, 1032, ["modelValue", "column", "features", "onUpdate:scrollOffset", "onRemove:scrollOffset", "onUpdate:columnWidth"]))), 128))
1546
+ ]),
1547
+ _: 1
1548
+ }, 8, ["variant"])
1549
+ ]),
1550
+ _: 1
1551
+ }),
1552
+ e.notification ? (o(), y(r, {
1553
+ key: 0,
1554
+ notification: e.notification,
1555
+ variant: e.variant,
1556
+ onCloseNotification: t[3] || (t[3] = (s) => e.$emit("close-notification"))
1557
+ }, Y({ _: 2 }, [
1558
+ e.$slots.notification ? {
1559
+ name: "notification",
1560
+ fn: b(() => [
1561
+ i(e.$slots, "notification")
1562
+ ]),
1563
+ key: "0"
1564
+ } : void 0
1565
+ ]), 1032, ["notification", "variant"])) : g("", !0),
1566
+ H(X, null, {
1567
+ default: b(() => [
1568
+ e.$slots["before-rows"] ? (o(), y(c, {
1569
+ key: 0,
1570
+ variant: e.variant,
1571
+ class: "border-b-1"
1572
+ }, {
1573
+ default: b(() => [
1574
+ i(e.$slots, "before-rows")
1575
+ ]),
1576
+ _: 3
1577
+ }, 8, ["variant"])) : g("", !0),
1578
+ e.loading ? (o(!0), p(q, { key: 1 }, Q(e.skeletonsLength, (s) => (o(), y(z, {
1579
+ key: s,
1580
+ variant: e.variant,
1581
+ interactive: e.interactiveRows
1582
+ }, {
1583
+ default: b(() => [
1584
+ e.features.selecting ? (o(), y(W, {
1585
+ key: 0,
1586
+ column: { stickiness: "start" },
1587
+ variant: e.variant,
1588
+ override: !0
1589
+ }, {
1590
+ default: b(() => [
1591
+ H(d)
1592
+ ]),
1593
+ _: 1
1594
+ }, 8, ["variant"])) : g("", !0),
1595
+ (o(!0), p(q, null, Q(e.columns, (w) => (o(), y(W, {
1596
+ key: w.name,
1597
+ column: w,
1598
+ features: e.features,
1599
+ variant: e.variant,
1600
+ override: !0
1601
+ }, {
1602
+ default: b(() => [
1603
+ i(e.$slots, "column-loading", { column: w }, () => [
1604
+ H(d)
1605
+ ])
1606
+ ]),
1607
+ _: 2
1608
+ }, 1032, ["column", "features", "variant"]))), 128))
1609
+ ]),
1610
+ _: 2
1611
+ }, 1032, ["variant", "interactive"]))), 128)) : e.items.length > 0 ? (o(!0), p(q, { key: 2 }, Q(e.items, (s) => (o(), y(z, {
1612
+ key: s.id,
1613
+ variant: e.variant,
1614
+ selected: e.selectingModel.includes(s.id),
1615
+ interactive: e.interactiveRows,
1616
+ onMouseenter: () => e.handleMouseEnterRow(s),
1617
+ onMouseleave: () => e.handleMouseLeaveRow(s),
1618
+ onClick: () => e.handleRowClick(s)
1619
+ }, {
1620
+ default: b(() => [
1621
+ e.features.selecting ? (o(), y(W, {
1622
+ key: 0,
1623
+ column: { stickiness: "start" },
1624
+ variant: e.variant,
1625
+ override: !0,
1626
+ "force-state": "none",
1627
+ class: "md:!py-none",
1628
+ onMouseenter: () => e.handleMouseEnterCell(s, "selecting", e.selectingModel.includes(s.id)),
1629
+ onMouseleave: () => e.handleMouseLeaveCell(s, "selecting", e.selectingModel.includes(s.id))
1630
+ }, {
1631
+ default: b(() => [
1632
+ H(O, {
1633
+ modelValue: e.selectingModel,
1634
+ "onUpdate:modelValue": t[4] || (t[4] = (w) => e.selectingModel = w),
1635
+ value: s.id,
1636
+ disabled: e.selectingDisabled
1637
+ }, null, 8, ["modelValue", "value", "disabled"])
1638
+ ]),
1639
+ _: 2
1640
+ }, 1032, ["variant", "onMouseenter", "onMouseleave"])) : g("", !0),
1641
+ (o(!0), p(q, null, Q(e.columns, (w) => (o(), y(W, {
1642
+ key: w.name,
1643
+ "model-value": s[w.name],
1644
+ column: w,
1645
+ features: e.features,
1646
+ variant: e.variant,
1647
+ onInput: (A) => e.onInput(s, w.name, A),
1648
+ onFocusin: t[5] || (t[5] = (A) => e.scrollTo(A)),
1649
+ onMouseenter: () => e.handleMouseEnterCell(s, w.name, s[w.name]),
1650
+ onMouseleave: () => e.handleMouseLeaveCell(s, w.name, s[w.name])
1651
+ }, {
1652
+ default: b(() => [
1653
+ i(e.$slots, w.name, {
1654
+ column: w,
1655
+ item: s
1656
+ }, () => [
1657
+ Z(_(s[w.name]), 1)
1658
+ ])
1659
+ ]),
1660
+ _: 2
1661
+ }, 1032, ["model-value", "column", "features", "variant", "onInput", "onMouseenter", "onMouseleave"]))), 128))
1662
+ ]),
1663
+ _: 2
1664
+ }, 1032, ["variant", "selected", "interactive", "onMouseenter", "onMouseleave", "onClick"]))), 128)) : e.$slots.noSearchResults && (e.features.filtering && e.filteringModel || e.features.searching && e.searchingModel) ? (o(), y(j, {
1665
+ key: 3,
1666
+ class: f(["col-span-full"]),
1667
+ variant: e.variant
1668
+ }, {
1669
+ default: b(() => [
1670
+ i(e.$slots, "noSearchResults", {
1671
+ filter: e.filteringModel,
1672
+ search: e.searchingModel
1673
+ })
1674
+ ]),
1675
+ _: 3
1676
+ }, 8, ["variant"])) : e.$slots.empty ? (o(), y(j, {
1677
+ key: 4,
1678
+ class: f(["col-span-full"]),
1679
+ variant: e.variant
1680
+ }, {
1681
+ default: b(() => [
1682
+ i(e.$slots, "empty")
1683
+ ]),
1684
+ _: 3
1685
+ }, 8, ["variant"])) : g("", !0),
1686
+ e.$slots["after-rows"] ? (o(), y(c, {
1687
+ key: 5,
1688
+ variant: e.variant
1689
+ }, {
1690
+ default: b(() => [
1691
+ i(e.$slots, "after-rows")
1692
+ ]),
1693
+ _: 3
1694
+ }, 8, ["variant"])) : g("", !0)
1695
+ ]),
1696
+ _: 3
1697
+ })
1698
+ ]),
1699
+ _: 3
1700
+ }, 8, ["class", "style", "columns", "features"]),
1701
+ e.$slots["extra-row"] ? (o(), y(U, { key: 2 }, {
1702
+ default: b(() => [
1703
+ H(P, {
1704
+ class: f(["shrink-0"]),
1705
+ variant: e.variant
1706
+ }, {
1707
+ default: b(() => [
1708
+ H(E, null, {
1709
+ default: b(() => [
1710
+ i(e.$slots, "extra-row")
1711
+ ]),
1712
+ _: 3
1713
+ })
1714
+ ]),
1715
+ _: 3
1716
+ }, 8, ["variant"])
1717
+ ]),
1718
+ _: 3
1719
+ })) : g("", !0),
1720
+ e.$slots.actions || e.showSelectingCouter || e.features.paging ? (o(), y(N, {
1721
+ key: 3,
1722
+ class: f(["shrink-0"])
1723
+ }, Y({ _: 2 }, [
1724
+ e.features.selecting && e.selectingModel.length > 0 ? {
1725
+ name: "status",
1726
+ fn: b(() => [
1727
+ Z(_(e.selectingModel.length) + " row(s) selected ", 1)
1728
+ ]),
1729
+ key: "0"
1730
+ } : void 0,
1731
+ e.$slots.actions ? {
1732
+ name: "actions",
1733
+ fn: b(() => [
1734
+ i(e.$slots, "actions")
1735
+ ]),
1736
+ key: "1"
1737
+ } : void 0,
1738
+ e.features.paging ? {
1739
+ name: "paging",
1740
+ fn: b(() => [
1741
+ H(L, {
1742
+ ref: "pagination",
1743
+ modelValue: e.pagingModel,
1744
+ "onUpdate:modelValue": t[6] || (t[6] = (s) => e.pagingModel = s),
1745
+ length: e.features.paging.length,
1746
+ options: e.features.paging.options
1747
+ }, null, 8, ["modelValue", "length", "options"])
1748
+ ]),
1749
+ key: "2"
1750
+ } : void 0
1751
+ ]), 1024)) : g("", !0)
1752
+ ], 2);
1753
+ }
1754
+ const fa = /* @__PURE__ */ C(Kt, [["render", Xt]]);
1755
+ export {
1756
+ k as D,
1757
+ fa as O,
1758
+ B as a,
1759
+ Ge as b,
1760
+ He as c,
1761
+ ze as d,
1762
+ qe as e,
1763
+ Je as f,
1764
+ _e as g,
1765
+ ot as h,
1766
+ st as i,
1767
+ mt as j,
1768
+ vt as k,
1769
+ Ot as l,
1770
+ Tt as m,
1771
+ Mt as n,
1772
+ Ft as o,
1773
+ jt as p,
1774
+ qt as q
1775
+ };
1776
+ //# sourceMappingURL=OrDataGrid-Dpyj-svt.mjs.map