@orchidui/core 1.8.1-126 → 1.8.1-127

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.
Files changed (84) hide show
  1. package/dist/DataDisplay/CustomerCard/OcCustomerCard.js +1 -1
  2. package/dist/DataDisplay/FloatContent/OcFloatContent.js +1 -1
  3. package/dist/DataDisplay/InfoCard/OcInfoCard.js +1 -1
  4. package/dist/DataDisplay/ListDetail/OcListDetail.js +1 -1
  5. package/dist/DataDisplay/ListItem/OcListItem.js +1 -1
  6. package/dist/DataDisplay/OnboardingListItem/OcOnboardingListItem.js +1 -1
  7. package/dist/DataDisplay/Overview/OcOverview.js +1 -1
  8. package/dist/DataDisplay/Pagination/OcPagination.js +1 -1
  9. package/dist/DataDisplay/Table/OcTable.js +1 -1
  10. package/dist/DataDisplay/TransferSummary/OcTransferSummary.js +1 -1
  11. package/dist/DataTable/useDataTable.js +55 -48
  12. package/dist/Disclosure/Accordion/OcAccordion.js +1 -1
  13. package/dist/Disclosure/OnboardingAccordion/OnboardingAccordion.js +1 -1
  14. package/dist/Disclosure/Steps/OcSteps.js +1 -1
  15. package/dist/Disclosure/Tabs/Tabs.js +1 -1
  16. package/dist/Disclosure/Variants/OcVariants.js +1 -1
  17. package/dist/Elements/AdditionalContent/OcAdditionalContent.js +1 -1
  18. package/dist/Elements/AuthenticationOption/AuthenticationOption.js +1 -1
  19. package/dist/Elements/Box/OcBox.js +1 -1
  20. package/dist/Elements/EmptyPage/OcEmptyPage.js +1 -1
  21. package/dist/Elements/FeatureOverviewCard/OcFeatureOverviewCard.js +1 -1
  22. package/dist/Elements/Header/OcHeader.js +1 -1
  23. package/dist/Elements/PageTitle/OcPageTitle.js +1 -1
  24. package/dist/Elements/SandboxBanner/OcSandboxBanner.js +1 -1
  25. package/dist/Elements/Sidebar/OcSidebar.js +2 -2
  26. package/dist/Elements/SubSidebar/OcSubSidebar.js +1 -1
  27. package/dist/Elements/TopBanner/OcTopBanner.js +1 -1
  28. package/dist/Elements/VerificationOption/OcVerificationOption.js +1 -1
  29. package/dist/Feedback/Banner/OcBanner.js +1 -1
  30. package/dist/Feedback/Chip/OcChip.js +1 -1
  31. package/dist/Feedback/ShareIcon/OcShareIcon.js +1 -1
  32. package/dist/Feedback/Snackbar/OcSnackbar.js +1 -1
  33. package/dist/Form/BaseInput/OcBaseInput.js +1 -1
  34. package/dist/Form/Button/OcButton.js +1 -1
  35. package/dist/Form/Calendar/OcCalendar.js +1 -1
  36. package/dist/Form/CardInput/OcCardInput.js +1 -1
  37. package/dist/Form/Checkbox/OcCheckbox.js +1 -1
  38. package/dist/Form/CheckboxesGroup/OcCheckboxesGroup.js +1 -1
  39. package/dist/Form/Criteria/OcCriteria.js +1 -1
  40. package/dist/Form/Cropper/OcCropper.js +1 -1
  41. package/dist/Form/DatePicker/OcDatePicker.js +1 -1
  42. package/dist/Form/EmojiPicker/OcEmojiPicker.js +1 -1
  43. package/dist/Form/Input/OcInput.js +1 -1
  44. package/dist/Form/LinkInput/OcLinkInput.js +1 -1
  45. package/dist/Form/MultipleUploadFile/OcMultipleUploadFile.js +1 -1
  46. package/dist/Form/NumberInput/OcNumberInput.js +1 -1
  47. package/dist/Form/PhoneInput/OcPhoneInput.js +1 -1
  48. package/dist/Form/Radio/OcRadio.js +1 -1
  49. package/dist/Form/RadioGroup/OcRadioGroup.js +1 -1
  50. package/dist/Form/RangeInput/OcRangeInput.js +1 -1
  51. package/dist/Form/SectionItem/OcSectionItem.js +1 -1
  52. package/dist/Form/Select/OcSelect.js +1 -1
  53. package/dist/Form/SelectOptions/OcSelectOptions.js +1 -1
  54. package/dist/Form/SingleFileUpload/OcSingleFileUpload.js +1 -1
  55. package/dist/Form/Slider/OcSlider.js +1 -1
  56. package/dist/Form/TextArea/OcTextArea.js +1 -1
  57. package/dist/Form/index.js +1 -1
  58. package/dist/FormBuilder/OcFormBuilder.js +1 -1
  59. package/dist/{OcAccountSetupProgress-B8tR1mDq.js → OcAccountSetupProgress-jDd1UsyX.js} +1 -1
  60. package/dist/{OcComplexCalendar-DBx25a5-.js → OcComplexCalendar-BaoIYMnJ.js} +1 -1
  61. package/dist/{OcComplexDatePicker-CRf6MxOX.js → OcComplexDatePicker-DJ0Ct4F8.js} +1 -1
  62. package/dist/{OcCropper-D1hXuCbl.js → OcCropper-D0-Ud4Dn.js} +1 -1
  63. package/dist/OcDataTable-CVtLdwmM.js +555 -0
  64. package/dist/{OcDraggableList-Bri7Yu2u.js → OcDraggableList-DRSZjKR2.js} +1 -1
  65. package/dist/{OcEmojiPicker-BgTqBYCH.js → OcEmojiPicker-BRNkuGDF.js} +1 -1
  66. package/dist/{OcFilterForm-DlHESBlu.js → OcFilterForm-BuUihX79.js} +1 -1
  67. package/dist/{OcFilterSearch-B02WMHub.js → OcFilterSearch-DjVS7Hfo.js} +1 -1
  68. package/dist/{OcFilterSearchFor-B1Pil-K3.js → OcFilterSearchFor-oo9Xji4I.js} +1 -1
  69. package/dist/{OcModalCropper-B8cE2SqY.js → OcModalCropper-CV2FJ5te.js} +2 -2
  70. package/dist/{OcTimePicker-CvHr6hRx.js → OcTimePicker-CJ9mBAxz.js} +1 -1
  71. package/dist/Overlay/ConfirmationModal/OcConfirmationModal.js +1 -1
  72. package/dist/Overlay/CopyTooltip/OcCopyTooltip.js +1 -1
  73. package/dist/Overlay/Dropdown/OcDropdown.js +1 -1
  74. package/dist/Overlay/Modal/OcModal.js +1 -1
  75. package/dist/Overlay/SupportMenu/OcSupportMenu.js +1 -1
  76. package/dist/Overlay/Tooltip/OcTooltip.js +1 -1
  77. package/dist/Overlay/Whitelist/OcWhiteList.js +1 -1
  78. package/dist/{SubPlanCard-vq-CzZj9.js → SubPlanCard-widCLtfc.js} +1 -1
  79. package/dist/{ThumbnailSection-O8OoYcHD.js → ThumbnailSection-GklOkizl.js} +1 -1
  80. package/dist/{ThumbnailTheme-DlrWURkb.js → ThumbnailTheme-CRjhKPMK.js} +1 -1
  81. package/dist/{index-BuPthmbI.js → index-CbMhrjCQ.js} +857 -824
  82. package/dist/index.js +1 -1
  83. package/package.json +1 -1
  84. package/dist/OcDataTable-Ba2vClWe.js +0 -545
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "vue";
2
- import { V as r, ak as o, aX as t, a2 as n, a4 as i, at as p, _ as l, a5 as d, B as m, o as u, a as b, C as S, b as c, au as T, aH as g, aO as C, ax as x, ay as P, c as I, aQ as f, v as h, aN as O, p as F, aI as B, aR as k, az as v, aA as w, aS as A, a6 as H, T as L, L as D, R as M, a7 as _, aL as R, aK as y, aM as E, w as N, u as U, l as V, a8 as G, ab as j, aa as z, ac as W, x as q, a3 as J, d as K, e as Q, m as X, y as Y, z as Z, A as $, aB as aa, aP as ea, t as sa, N as ra, aC as oa, D as ta, W as na, k as ia, E as pa, F as la, G as da, ae as ma, af as ua, H as ba, J as Sa, $ as ca, f as Ta, I as ga, ag as Ca, g as xa, h as Pa, i as Ia, ah as fa, q as ha, j as Oa, r as Fa, av as Ba, am as ka, ai as va, ap as wa, ao as Aa, al as Ha, an as La, aj as Da, s as Ma, S as _a, aw as Ra, Y as ya, X as Ea, a9 as Na, aV as Ua, aq as Va, aD as Ga, ad as ja, K as za, O as Wa, P as qa, M as Ja, Q as Ka, Z as Qa, n as Xa, aU as Ya, aT as Za, aW as $a, aJ as ae, aE as ee, ar as se, U as re, a1 as oe, a0 as te, as as ne, aF as ie } from "./index-BuPthmbI.js";
2
+ import { V as r, ak as o, aX as t, a2 as n, a4 as i, at as p, _ as l, a5 as d, B as m, o as u, a as b, C as S, b as c, au as T, aH as g, aO as C, ax as x, ay as P, c as I, aQ as f, v as h, aN as O, p as F, aI as B, aR as k, az as v, aA as w, aS as A, a6 as H, T as L, L as D, R as M, a7 as _, aL as R, aK as y, aM as E, w as N, u as U, l as V, a8 as G, ab as j, aa as z, ac as W, x as q, a3 as J, d as K, e as Q, m as X, y as Y, z as Z, A as $, aB as aa, aP as ea, t as sa, N as ra, aC as oa, D as ta, W as na, k as ia, E as pa, F as la, G as da, ae as ma, af as ua, H as ba, J as Sa, $ as ca, f as Ta, I as ga, ag as Ca, g as xa, h as Pa, i as Ia, ah as fa, q as ha, j as Oa, r as Fa, av as Ba, am as ka, ai as va, ap as wa, ao as Aa, al as Ha, an as La, aj as Da, s as Ma, S as _a, aw as Ra, Y as ya, X as Ea, a9 as Na, aV as Ua, aq as Va, aD as Ga, ad as ja, K as za, O as Wa, P as qa, M as Ja, Q as Ka, Z as Qa, n as Xa, aU as Ya, aT as Za, aW as $a, aJ as ae, aE as ee, ar as se, U as re, a1 as oe, a0 as te, as as ne, aF as ie } from "./index-CbMhrjCQ.js";
3
3
  import { _ as le } from "./OcProgressBar-lyqE5LZd.js";
4
4
  import { _ as me } from "./OcHorizontalProgressbar.vue_vue_type_script_setup_true_lang-C-8H1oP2.js";
5
5
  import { _ as be } from "./OcSwitchTabs-B7LfmG3z.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orchidui/core",
3
3
  "description": "Orchid UI, Library Vue 3 tailwind css",
4
- "version": "1.8.1-126",
4
+ "version": "1.8.1-127",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "vite build"
@@ -1,545 +0,0 @@
1
- import { ref as $, onMounted as Ae, createBlock as P, openBlock as r, unref as i, withCtx as w, createVNode as A, createElementVNode as Q, createElementBlock as k, createCommentVNode as y, mergeProps as De, Fragment as ie, renderList as ne, normalizeClass as de, toDisplayString as Fe, computed as S, watch as re, renderSlot as C, createSlots as sl, normalizeProps as Ee, guardReactiveProps as Ce } from "vue";
2
- import { az as Ke, B as Be, C as ul, K as il, Z as rl, aK as nl, aL as dl, aM as vl, H as cl, I as Pe, j as ml } from "./index-BuPthmbI.js";
3
- import { useDataTable as pl } from "./DataTable/useDataTable.js";
4
- import { VueDraggableNext as Le } from "vue-draggable-next";
5
- import { getFromLocalStorage as Ue, formatHeadersFromLocalStorage as Ie, formatHeadersToLocalStorage as fl, setInLocalStorage as yl } from "./DataTable/utils/editColumnsUtils.js";
6
- import { _ as je } from "./OcIcon-CBf___w1.js";
7
- import { formatFilterDisplay as gl, clearAllFilters as bl } from "./DataTable/utils/filterUtils.js";
8
- import { formatCustomItemsPerPageOptions as kl, getItemsPerPageOptions as hl } from "./DataTable/utils/paginationUtils.js";
9
- import "dayjs";
10
- const xl = { class: "p-5 gap-y-4 text-sm flex w-[250px] flex-col" }, wl = {
11
- key: 0,
12
- class: "gap-y-2 flex flex-col border-b pb-3 border-oc-gray-200"
13
- }, Sl = { class: "gap-y-2 flex flex-col" }, $l = {
14
- key: 0,
15
- class: "flex items-center bg-white justify-between h-[26px]"
16
- }, Ol = { class: "flex items-center w-full gap-x-3" }, Vl = { class: "truncate w-full max-w-[160px]" }, Dl = {
17
- __name: "ColumnEdit",
18
- props: {
19
- options: {
20
- type: Object,
21
- default: () => ({})
22
- },
23
- headers: {
24
- type: Array,
25
- default: () => []
26
- },
27
- localKey: {
28
- type: String,
29
- default: ""
30
- }
31
- },
32
- emits: [
33
- "change-active",
34
- "onMoved",
35
- "update-order"
36
- ],
37
- setup(L, { emit: te }) {
38
- const oe = te, s = L, h = $([]), d = $([]), U = $(!1), O = {
39
- handle: ".drag-el",
40
- filter: ".is-disabled",
41
- group: "headers",
42
- animation: 500,
43
- forceFallback: !1,
44
- move: (j) => j.to.dataset.activeHeaders ? !0 : !!j.draggedContext.futureIndex,
45
- "onUpdate:modelValue": () => I()
46
- }, I = (j = !1) => {
47
- d.value = d.value.map((u) => ({
48
- ...u,
49
- isActive: !0
50
- })), oe("update-order", {
51
- fixedHeaders: d.value,
52
- activeHeaders: h.value,
53
- isOnMount: j
54
- });
55
- };
56
- return Ae(() => {
57
- const j = Ue(s.localKey), { fixed: u, active: v } = Ie(j, s.headers, s.localKey);
58
- d.value = u || s.headers.slice(0, 1), h.value = v || s.headers.slice(1).map((F) => {
59
- var _, ee, le;
60
- return {
61
- ...F,
62
- isActive: ((le = (ee = (_ = s.options) == null ? void 0 : _.active) == null ? void 0 : ee.find((se) => se.key === F.key)) == null ? void 0 : le.isActive) ?? !0
63
- };
64
- }), I(!0);
65
- }), (j, u) => (r(), P(i(Ke), {
66
- modelValue: U.value,
67
- "onUpdate:modelValue": u[3] || (u[3] = (v) => U.value = v),
68
- class: "h-[36px]",
69
- "is-attach-to-body": ""
70
- }, {
71
- menu: w(() => [
72
- Q("div", xl, [
73
- d.value.length ? (r(), k("div", wl, [
74
- u[4] || (u[4] = Q("span", { class: "text-oc-text-400 font-medium" }, "Fixed columns", -1)),
75
- A(i(Le), De({
76
- key: "key",
77
- modelValue: d.value,
78
- "onUpdate:modelValue": u[0] || (u[0] = (v) => d.value = v)
79
- }, O), {
80
- default: w(() => [
81
- (r(!0), k(ie, null, ne(d.value, (v, F) => (r(), k("div", {
82
- key: v.key,
83
- class: de(["flex items-center justify-between h-[26px]", F ? "" : "is-disabled"])
84
- }, [
85
- Q("span", null, Fe(v.label), 1),
86
- F ? (r(), P(i(je), {
87
- key: 0,
88
- width: "18",
89
- height: "18",
90
- class: "text-oc-text-400 drag-el cursor-move",
91
- name: "draggable"
92
- })) : y("", !0)
93
- ], 2))), 128))
94
- ]),
95
- _: 1
96
- }, 16, ["modelValue"])
97
- ])) : y("", !0),
98
- Q("div", Sl, [
99
- u[5] || (u[5] = Q("span", { class: "text-oc-text-400 font-medium" }, "Active columns", -1)),
100
- A(i(Le), De({
101
- key: "key",
102
- modelValue: h.value,
103
- "onUpdate:modelValue": u[2] || (u[2] = (v) => h.value = v)
104
- }, O, { "data-active-headers": "true" }), {
105
- default: w(() => [
106
- (r(!0), k(ie, null, ne(h.value, (v) => (r(), k(ie, {
107
- key: v.key
108
- }, [
109
- v.key !== "actions" ? (r(), k("div", $l, [
110
- Q("div", Ol, [
111
- A(i(ul), {
112
- modelValue: v.isActive,
113
- "onUpdate:modelValue": [
114
- (F) => v.isActive = F,
115
- u[1] || (u[1] = (F) => I())
116
- ],
117
- class: "!w-fit"
118
- }, null, 8, ["modelValue", "onUpdate:modelValue"]),
119
- Q("div", Vl, Fe(v.label), 1)
120
- ]),
121
- h.value.length > 1 ? (r(), P(i(je), {
122
- key: 0,
123
- width: "18",
124
- height: "18",
125
- class: "text-oc-text-400 drag-el cursor-move",
126
- name: "draggable"
127
- })) : y("", !0)
128
- ])) : y("", !0)
129
- ], 64))), 128))
130
- ]),
131
- _: 1
132
- }, 16, ["modelValue"])
133
- ])
134
- ])
135
- ]),
136
- default: w(() => [
137
- A(i(Be), {
138
- label: "Edit Column",
139
- "left-icon": "setting",
140
- variant: "secondary"
141
- })
142
- ]),
143
- _: 1
144
- }, 8, ["modelValue"]));
145
- }
146
- }, Fl = { class: "relative flex flex-col gap-9" }, El = {
147
- key: 0,
148
- class: "flex items-center px-4 min-h-[52px]"
149
- }, Cl = {
150
- key: 0,
151
- class: "absolute flex items-center gap-5 left-5"
152
- }, Pl = {
153
- key: 1,
154
- class: "absolute flex gap-3 left-5"
155
- }, Ll = {
156
- key: 1,
157
- class: "flex justify-center w-full gap-5 md:justify-start"
158
- }, jl = {
159
- key: 2,
160
- class: "items-center hidden md:flex"
161
- }, zl = {
162
- __name: "OcDataTable",
163
- props: {
164
- isLoading: Boolean,
165
- id: {
166
- type: String,
167
- required: !0
168
- },
169
- options: {
170
- type: Object,
171
- required: !0
172
- },
173
- filter: {
174
- type: Object,
175
- required: !0
176
- },
177
- selected: {
178
- type: Array,
179
- required: !1
180
- },
181
- rowClass: String,
182
- rowKey: {
183
- type: [String, Function],
184
- default: "id"
185
- },
186
- rowLink: String,
187
- localDb: {
188
- type: Object,
189
- required: !1
190
- },
191
- sortBy: {
192
- type: Object,
193
- required: !1
194
- }
195
- },
196
- emits: {
197
- "update:selected": [],
198
- "update:filter": [],
199
- "click:row": [],
200
- "filter-fields-changed": [],
201
- "filter-removed": [],
202
- "filter-open": [],
203
- "search-query-changed": [],
204
- "hover:cell": [],
205
- "columns-changed": [],
206
- "on-table-ready": []
207
- },
208
- setup(L, { expose: te, emit: oe }) {
209
- var fe, ye, ge, be, ke, he, xe, we, Se, $e, Oe, Ve;
210
- const s = L, h = oe, d = S(() => {
211
- var e;
212
- return (e = s.options) == null ? void 0 : e.cursor;
213
- }), U = $(), O = S(() => {
214
- var e;
215
- return (e = s.options) == null ? void 0 : e.tableOptions;
216
- }), I = S(() => s.localDb !== void 0), {
217
- localData: j,
218
- paginationData: u,
219
- isLoading: v,
220
- // Methods
221
- bulkPutLocalData: F,
222
- bulkDeleteLocalData: _,
223
- getLocalDataUpdatedAt: ee,
224
- getLocalDataIds: le,
225
- syncLocalData: se,
226
- sortByData: Te,
227
- // toggleSort,
228
- // Setters
229
- setFilter: qe,
230
- setSortBy: Qe
231
- } = pl({
232
- name: (fe = s.localDb) == null ? void 0 : fe.table_name,
233
- localDb: (ye = s.localDb) == null ? void 0 : ye.db,
234
- options: (ge = s.localDb) == null ? void 0 : ge.options
235
- });
236
- re(() => {
237
- var e;
238
- return (e = s.options) == null ? void 0 : e.pagination;
239
- }, (e) => {
240
- I.value || (u.value = e);
241
- }, { deep: !0, immediate: !0 }), I.value && (re(() => s.filter, () => {
242
- s.filter && qe(s.filter);
243
- }, { deep: !0, immediate: !0 }), re(() => s.sortBy, () => {
244
- s.sortBy && Qe(s.sortBy);
245
- }, { deep: !0, immediate: !0 }));
246
- const ve = S(() => {
247
- var l;
248
- const e = {
249
- ...O.value,
250
- headers: U.value ? U.value.map((n) => {
251
- var p, f;
252
- return n.class = ((f = (p = O.value) == null ? void 0 : p.headers.find((c) => c.key === n.key)) == null ? void 0 : f.class) ?? "", n;
253
- }).filter((n) => n.isActive) : (l = O.value) == null ? void 0 : l.headers.filter((n) => We(n.key))
254
- };
255
- return I.value && (e.fields = j.value), e;
256
- }), a = S(() => {
257
- var e;
258
- return (e = s.options) == null ? void 0 : e.filterOptions;
259
- }), Re = S(() => {
260
- var e;
261
- return (e = s.options) == null ? void 0 : e.hidePerPageDropdown;
262
- }), ze = S(() => {
263
- var e;
264
- return ((e = u.value) == null ? void 0 : e.last_page) === 1;
265
- }), R = $(!1), K = $(s.filter[(ke = (be = a.value) == null ? void 0 : be.tabs) == null ? void 0 : ke.key]), N = $(s.filter.page), z = $(
266
- (xe = (he = a.value) == null ? void 0 : he.per_page) != null && xe.key ? s.filter[(Se = (we = a.value) == null ? void 0 : we.per_page) == null ? void 0 : Se.key] : s.filter.per_page
267
- ), ce = ((Ve = s.filter[(Oe = ($e = a.value) == null ? void 0 : $e.search) == null ? void 0 : Oe.key]) == null ? void 0 : Ve.trim()) ?? "", B = $(ce ? ce.split(",") : []), me = $(!1), Ne = S(
268
- () => {
269
- var e;
270
- return kl((e = s.options) == null ? void 0 : e.perPageOptions);
271
- }
272
- ), Me = S(() => hl(Ne.value, u.value)), Ze = S(() => {
273
- var e;
274
- return ((e = s.selected) == null ? void 0 : e.length) > 0;
275
- }), Ge = (e) => {
276
- !e.trim() || !o.value.selectedSearchOption && B.value.includes(e) || (B.value = [e], V(), h("search-query-changed", e));
277
- }, He = (e) => {
278
- B.value = B.value.filter((l) => l !== e), V();
279
- }, M = s.filter;
280
- !M && u.value ? M.page = 1 : !M && d && (M.cursor = "");
281
- const o = $(M), Je = S(() => gl(o.value, a.value)), We = (e) => {
282
- var l, n, p, f, c, t;
283
- return ((t = (c = (f = (p = o.value) == null ? void 0 : p[(n = (l = a.value) == null ? void 0 : l.columnEdit) == null ? void 0 : n.key]) == null ? void 0 : f.active) == null ? void 0 : c.find((g) => g.key === e)) == null ? void 0 : t.isActive) ?? !0;
284
- }, Xe = ({ fixedHeaders: e, activeHeaders: l, isOnMount: n }) => {
285
- var p, f, c, t, g, x, E, D;
286
- if (o.value[(f = (p = a.value) == null ? void 0 : p.columnEdit) == null ? void 0 : f.key] || (o.value[(t = (c = a.value) == null ? void 0 : c.columnEdit) == null ? void 0 : t.key] = {}), o.value[(x = (g = a.value) == null ? void 0 : g.columnEdit) == null ? void 0 : x.key].fixed = e, o.value[(D = (E = a.value) == null ? void 0 : E.columnEdit) == null ? void 0 : D.key].active = l, U.value = [...e, ...l], !n) {
287
- const T = fl(e, l);
288
- yl(a.value.columnEdit.localStorageKey, T);
289
- }
290
- h("columns-changed", l);
291
- }, Ye = () => {
292
- var e, l, n, p, f, c;
293
- if ((l = (e = a.value) == null ? void 0 : e.columnEdit) != null && l.localStorageKey) {
294
- const t = Ue(a.value.columnEdit.localStorageKey);
295
- if (t) {
296
- const { fixed: g, active: x } = Ie(
297
- t,
298
- O.value.headers,
299
- a.value.columnEdit.localStorageKey
300
- );
301
- o.value[(p = (n = a.value) == null ? void 0 : n.columnEdit) == null ? void 0 : p.key].fixed = g, o.value[(c = (f = a.value) == null ? void 0 : f.columnEdit) == null ? void 0 : c.key].active = x, U.value = [...g, ...x];
302
- }
303
- }
304
- }, _e = (e) => {
305
- o.value.selectedSearchOption = e;
306
- }, el = () => {
307
- B.value = [], K.value = "", o.value = bl(o.value, a.value, z.value, K.value), V();
308
- }, ll = () => {
309
- V(null, N.value);
310
- }, pe = $(null), V = (e = null, l = !1, n = "", p = !1, f = !1) => {
311
- var t, g, x, E, D, T, Z, G, H, J, W, X, Y;
312
- u.value && !l && (N.value = 1), u.value ? o.value.page = N.value : o.value.cursor = n, (t = a.value) != null && t.per_page ? o.value[a.value.per_page.key] = z.value : o.value.per_page = z.value, (g = a.value) != null && g.tabs && f && (o.value[a.value.tabs.key] = K.value), (x = a.value) != null && x.search && ((D = (E = a.value.search) == null ? void 0 : E.options) != null && D.length ? (Object.keys(o.value).forEach((b) => {
313
- var q;
314
- (q = a.value.search.options) != null && q.map((m) => m.value).includes(b) && delete o.value[b];
315
- }), o.value[((T = o.value) == null ? void 0 : T.selectedSearchOption) || ((H = (G = (Z = a.value.search) == null ? void 0 : Z.options) == null ? void 0 : G[0]) == null ? void 0 : H.value) || a.value.search.key] = B.value.join()) : o.value[a.value.search.key] = B.value.join()), e && (R.value = !1, o.value = { ...o.value, ...e }, Object.keys(o.value).forEach((b) => {
316
- Array.isArray(o.value[b]) && o.value[b].length === 0 && delete o.value[b];
317
- }));
318
- let c = (W = (J = a.value) == null ? void 0 : J.tabs) == null ? void 0 : W.key;
319
- if (c && K.value !== o.value[c]) {
320
- const b = (Y = (X = a.value.tabs) == null ? void 0 : X.options) == null ? void 0 : Y.find(
321
- (q) => {
322
- var m, ae;
323
- return ((m = q.value) == null ? void 0 : m.toString()) === ((ae = o.value[c]) == null ? void 0 : ae.toString());
324
- }
325
- );
326
- if (b != null && b.value)
327
- return K.value = b.value, V(), !1;
328
- }
329
- clearTimeout(pe.value), pe.value = setTimeout(() => {
330
- h("update:filter", o.value, p);
331
- }, 100);
332
- }, al = (e, l) => {
333
- (l === a.value.tabs.key || l === "tabs") && (K.value = ""), V(e), h("filter-removed", l);
334
- };
335
- Ae(() => {
336
- Ye(), h("on-table-ready");
337
- });
338
- const ue = S(() => s.isLoading || v.value);
339
- return te({
340
- paginationData: u,
341
- tableIsLoading: ue,
342
- bulkPutLocalData: F,
343
- bulkDeleteLocalData: _,
344
- getLocalDataUpdatedAt: ee,
345
- getLocalDataIds: le,
346
- syncLocalData: se,
347
- sortByData: Te
348
- }), (e, l) => {
349
- var n, p, f, c;
350
- return r(), k("div", Fl, [
351
- ve.value ? (r(), P(i(il), {
352
- key: 0,
353
- selected: L.selected,
354
- "row-key": L.rowKey,
355
- options: ve.value,
356
- "is-loading": ue.value,
357
- "loading-rows": z.value,
358
- "row-class": L.rowClass,
359
- "row-link": L.rowLink,
360
- "is-sticky": O.value.isSticky,
361
- "is-borderless": O.value.isBorderless,
362
- "onUpdate:selected": l[8] || (l[8] = (t) => e.$emit("update:selected", t)),
363
- "onClick:row": l[9] || (l[9] = (t) => e.$emit("click:row", t)),
364
- "onHover:cell": l[10] || (l[10] = (t) => e.$emit("hover:cell", t))
365
- }, sl({
366
- after: w(() => [
367
- C(e.$slots, "after")
368
- ]),
369
- empty: w(() => [
370
- C(e.$slots, "empty")
371
- ]),
372
- "table-header": w((t) => [
373
- C(e.$slots, "table-header", Ee(Ce(t)))
374
- ]),
375
- "table-body": w((t) => [
376
- C(e.$slots, "table-body", Ee(Ce(t)))
377
- ]),
378
- _: 2
379
- }, [
380
- e.$slots.before || (n = a.value) != null && n.search || (p = a.value) != null && p.form || (f = a.value) != null && f.tabs ? {
381
- name: "before",
382
- fn: w(() => {
383
- var t, g, x, E;
384
- return [
385
- C(e.$slots, "before"),
386
- (t = a.value) != null && t.search || (g = a.value) != null && g.form || (x = a.value) != null && x.tabs ? (r(), k("div", El, [
387
- Ze.value ? (r(), k("div", Cl, [
388
- C(e.$slots, "bulk-actions", { selectedRows: L.selected })
389
- ])) : (r(), k("div", Pl, [
390
- (E = a.value) != null && E.tabs ? (r(), P(i(rl), {
391
- key: 0,
392
- modelValue: K.value,
393
- "onUpdate:modelValue": [
394
- l[0] || (l[0] = (D) => K.value = D),
395
- l[1] || (l[1] = (D) => V(null, !1, "", !1, !0))
396
- ],
397
- "is-disabled": ue.value,
398
- tabs: a.value.tabs.options,
399
- variant: "pills"
400
- }, null, 8, ["modelValue", "is-disabled", "tabs"])) : y("", !0)
401
- ])),
402
- C(e.$slots, "filter-options", {}, () => {
403
- var D, T, Z, G, H, J, W, X, Y, b, q;
404
- return [
405
- (D = a.value) != null && D.search || (T = a.value) != null && T.form || (Z = a.value) != null && Z.columnEdit ? (r(), k("div", {
406
- key: 0,
407
- class: de([
408
- "flex gap-3 absolute ml-auto bg-oc-bg-light right-4 max-w-[calc(100%-24px)]",
409
- a.value ? me.value ? "md:w-fit w-full" : "" : "w-full justify-end"
410
- ])
411
- }, [
412
- (G = a.value) != null && G.search ? (r(), P(i(nl), {
413
- key: 0,
414
- "is-search-only": !a.value.tabs || a.value.isSearchOnly,
415
- "search-options": ((H = a.value.search) == null ? void 0 : H.options) ?? [],
416
- "selected-option": (((J = o.value) == null ? void 0 : J.selectedSearchOption) || ((Y = (X = (W = a.value.search) == null ? void 0 : W.options) == null ? void 0 : X[0]) == null ? void 0 : Y.value)) ?? "keywords",
417
- onAddQuery: Ge,
418
- onToggle: l[2] || (l[2] = (m) => me.value = m),
419
- onChangeSearchKey: _e
420
- }, null, 8, ["is-search-only", "search-options", "selected-option"])) : y("", !0),
421
- (b = a.value) != null && b.form ? (r(), P(i(Ke), {
422
- key: 1,
423
- modelValue: R.value,
424
- "onUpdate:modelValue": [
425
- l[6] || (l[6] = (m) => R.value = m),
426
- l[7] || (l[7] = (m) => e.$emit("filter-open", m))
427
- ],
428
- distance: 9,
429
- placement: "bottom-end",
430
- "is-attach-to-body": ""
431
- }, {
432
- menu: w(() => [
433
- R.value ? (r(), P(i(dl), {
434
- key: 0,
435
- id: L.id,
436
- "json-form": a.value.form ?? [],
437
- grid: a.value.grid ?? null,
438
- values: s.filter,
439
- actions: a.value.actions,
440
- onApplyFilter: l[3] || (l[3] = (m) => V(m)),
441
- onFilterFieldsChanged: l[4] || (l[4] = (m) => h("filter-fields-changed", m)),
442
- onCancel: l[5] || (l[5] = (m) => R.value = !1)
443
- }, {
444
- default: w(({ errors: m, values: ae, jsonForm: tl, updateForm: ol }) => [
445
- C(e.$slots, "custom-filter-form", {
446
- errors: m,
447
- values: ae,
448
- jsonForm: tl,
449
- updateFilter: ol
450
- })
451
- ]),
452
- _: 3
453
- }, 8, ["id", "json-form", "grid", "values", "actions"])) : y("", !0)
454
- ]),
455
- default: w(() => [
456
- A(i(Be), {
457
- "is-active": R.value,
458
- variant: "secondary",
459
- "left-icon": "filter"
460
- }, null, 8, ["is-active"])
461
- ]),
462
- _: 3
463
- }, 8, ["modelValue"])) : y("", !0),
464
- a.value.columnEdit ? (r(), P(Dl, {
465
- key: 2,
466
- options: o.value.columnEdit,
467
- headers: ((q = O.value) == null ? void 0 : q.headers) || [],
468
- "local-key": a.value.columnEdit.localStorageKey,
469
- onUpdateOrder: Xe
470
- }, null, 8, ["options", "headers", "local-key"])) : y("", !0)
471
- ], 2)) : y("", !0)
472
- ];
473
- })
474
- ])) : y("", !0),
475
- A(i(vl), {
476
- filters: Je.value,
477
- queries: B.value,
478
- class: "border-t border-oc-gray-200",
479
- onRemoveQuery: He,
480
- onRemoveAll: el,
481
- onRemoveFilter: al
482
- }, null, 8, ["filters", "queries"])
483
- ];
484
- }),
485
- key: "0"
486
- } : void 0,
487
- ne((c = O.value) == null ? void 0 : c.headers, (t, g) => ({
488
- name: t.key,
489
- fn: w(({ data: x, item: E }) => [
490
- C(e.$slots, t.key, {
491
- data: x,
492
- item: E
493
- })
494
- ])
495
- }))
496
- ]), 1032, ["selected", "row-key", "options", "is-loading", "loading-rows", "row-class", "row-link", "is-sticky", "is-borderless"])) : y("", !0),
497
- C(e.$slots, "before-pagination"),
498
- i(u) || d.value ? (r(), k("div", {
499
- key: 1,
500
- class: de(["flex items-center gap-3", i(u) && i(u).last_page === 1 ? "justify-end" : ""])
501
- }, [
502
- i(u) && !ze.value ? (r(), P(i(cl), {
503
- key: 0,
504
- modelValue: N.value,
505
- "onUpdate:modelValue": [
506
- l[11] || (l[11] = (t) => N.value = t),
507
- ll
508
- ],
509
- class: "justify-center",
510
- "max-page": i(u).last_page,
511
- strategy: i(u).strategy,
512
- "total-visible": "5"
513
- }, null, 8, ["modelValue", "max-page", "strategy"])) : y("", !0),
514
- d.value ? (r(), k("div", Ll, [
515
- A(i(Pe), {
516
- disabled: !d.value.prev,
517
- onClick: l[12] || (l[12] = (t) => d.value.prev ? V(null, !1, d.value.prev) : null)
518
- }, null, 8, ["disabled"]),
519
- A(i(Pe), {
520
- disabled: !d.value.next,
521
- "is-next": "",
522
- onClick: l[13] || (l[13] = (t) => d.value.next ? V(null, !1, d.value.next) : null)
523
- }, null, 8, ["disabled"])
524
- ])) : y("", !0),
525
- Re.value ? y("", !0) : (r(), k("div", jl, [
526
- A(i(ml), {
527
- modelValue: z.value,
528
- "onUpdate:modelValue": [
529
- l[14] || (l[14] = (t) => z.value = t),
530
- l[15] || (l[15] = (t) => V(null))
531
- ],
532
- label: "Item per page",
533
- "is-inline-label": "",
534
- "popper-options": { placement: "auto" },
535
- options: Me.value
536
- }, null, 8, ["modelValue", "options"])
537
- ]))
538
- ], 2)) : y("", !0)
539
- ]);
540
- };
541
- }
542
- };
543
- export {
544
- zl as default
545
- };