@orchidui/core 1.20.1-0 → 1.20.1-10

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 (86) 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/NewTable/OcNewTable.js +4 -0
  7. package/dist/DataDisplay/OnboardingListItem/OcOnboardingListItem.js +1 -1
  8. package/dist/DataDisplay/Overview/OcOverview.js +1 -1
  9. package/dist/DataDisplay/Pagination/OcPagination.js +1 -1
  10. package/dist/DataDisplay/Table/OcTable.js +1 -1
  11. package/dist/DataDisplay/TransferSummary/OcTransferSummary.js +1 -1
  12. package/dist/DataTable/useDataTable.js +92 -59
  13. package/dist/Disclosure/Accordion/OcAccordion.js +1 -1
  14. package/dist/Disclosure/OnboardingAccordion/OnboardingAccordion.js +1 -1
  15. package/dist/Disclosure/Steps/OcSteps.js +1 -1
  16. package/dist/Disclosure/Tabs/Tabs.js +1 -1
  17. package/dist/Disclosure/Variants/OcVariants.js +1 -1
  18. package/dist/Elements/AdditionalContent/OcAdditionalContent.js +1 -1
  19. package/dist/Elements/AuthenticationOption/AuthenticationOption.js +1 -1
  20. package/dist/Elements/Box/OcBox.js +1 -1
  21. package/dist/Elements/EmptyPage/OcEmptyPage.js +1 -1
  22. package/dist/Elements/FeatureOverviewCard/OcFeatureOverviewCard.js +1 -1
  23. package/dist/Elements/Header/OcHeader.js +1 -1
  24. package/dist/Elements/PageTitle/OcPageTitle.js +1 -1
  25. package/dist/Elements/SandboxBanner/OcSandboxBanner.js +1 -1
  26. package/dist/Elements/Sidebar/OcSidebar.js +3 -3
  27. package/dist/Elements/SubSidebar/OcSubSidebar.js +1 -1
  28. package/dist/Elements/TopBanner/OcTopBanner.js +2 -2
  29. package/dist/Elements/VerificationOption/OcVerificationOption.js +2 -2
  30. package/dist/Feedback/Banner/OcBanner.js +1 -1
  31. package/dist/Feedback/Chip/OcChip.js +1 -1
  32. package/dist/Feedback/ShareIcon/OcShareIcon.js +1 -1
  33. package/dist/Feedback/Snackbar/OcSnackbar.js +1 -1
  34. package/dist/Form/BaseInput/OcBaseInput.js +1 -1
  35. package/dist/Form/Button/OcButton.js +1 -1
  36. package/dist/Form/Calendar/OcCalendar.js +1 -1
  37. package/dist/Form/CardInput/OcCardInput.js +1 -1
  38. package/dist/Form/Checkbox/OcCheckbox.js +1 -1
  39. package/dist/Form/CheckboxesGroup/OcCheckboxesGroup.js +1 -1
  40. package/dist/Form/Criteria/OcCriteria.js +1 -1
  41. package/dist/Form/Cropper/OcCropper.js +1 -1
  42. package/dist/Form/DatePicker/OcDatePicker.js +1 -1
  43. package/dist/Form/EmojiPicker/OcEmojiPicker.js +1 -1
  44. package/dist/Form/Input/OcInput.js +1 -1
  45. package/dist/Form/LinkInput/OcLinkInput.js +1 -1
  46. package/dist/Form/MultipleUploadFile/OcMultipleUploadFile.js +1 -1
  47. package/dist/Form/NumberInput/OcNumberInput.js +1 -1
  48. package/dist/Form/PhoneInput/OcPhoneInput.js +1 -1
  49. package/dist/Form/Radio/OcRadio.js +1 -1
  50. package/dist/Form/RadioGroup/OcRadioGroup.js +1 -1
  51. package/dist/Form/RangeInput/OcRangeInput.js +1 -1
  52. package/dist/Form/SectionItem/OcSectionItem.js +1 -1
  53. package/dist/Form/Select/OcSelect.js +1 -1
  54. package/dist/Form/SelectOptions/OcSelectOptions.js +1 -1
  55. package/dist/Form/SingleFileUpload/OcSingleFileUpload.js +1 -1
  56. package/dist/Form/Slider/OcSlider.js +1 -1
  57. package/dist/Form/TextArea/OcTextArea.js +1 -1
  58. package/dist/Form/index.js +1 -1
  59. package/dist/FormBuilder/OcFormBuilder.js +1 -1
  60. package/dist/{OcAccountSetupProgress-BrFh0gV6.js → OcAccountSetupProgress-volIZxPE.js} +1 -1
  61. package/dist/{OcComplexCalendar-H9AVEnPx.js → OcComplexCalendar-rnP2VSsp.js} +1 -1
  62. package/dist/{OcComplexDatePicker-DP29N26v.js → OcComplexDatePicker-zEY4nVMT.js} +1 -1
  63. package/dist/{OcCropper-DiHMNZNd.js → OcCropper-Cyss09X7.js} +5 -5
  64. package/dist/OcDataTable-Br5xxpmF.js +584 -0
  65. package/dist/{OcDraggableList-DE5TsIZD.js → OcDraggableList-DiY8GBjy.js} +10 -10
  66. package/dist/{OcEmojiPicker-DKWtyTsI.js → OcEmojiPicker-ChNCiWFy.js} +6 -6
  67. package/dist/{OcFilterForm-DcVtNrT1.js → OcFilterForm-3babUDzc.js} +1 -1
  68. package/dist/{OcFilterSearch-B7mIHuKn.js → OcFilterSearch-s6SZ45pz.js} +35 -30
  69. package/dist/{OcFilterSearchFor-CqsuXADi.js → OcFilterSearchFor-BMaewwyQ.js} +3 -3
  70. package/dist/{OcModalCropper-DxkU7yZh.js → OcModalCropper-BdONfm42.js} +7 -7
  71. package/dist/{OcTimePicker-BX6AF_Su.js → OcTimePicker-C818d_Uq.js} +1 -1
  72. package/dist/Overlay/ConfirmationModal/OcConfirmationModal.js +1 -1
  73. package/dist/Overlay/CopyTooltip/OcCopyTooltip.js +1 -1
  74. package/dist/Overlay/Dropdown/OcDropdown.js +1 -1
  75. package/dist/Overlay/Modal/OcModal.js +1 -1
  76. package/dist/Overlay/SupportMenu/OcSupportMenu.js +1 -1
  77. package/dist/Overlay/Tooltip/OcTooltip.js +1 -1
  78. package/dist/Overlay/Whitelist/OcWhiteList.js +1 -1
  79. package/dist/{SubPlanCard-BhKyfET3.js → SubPlanCard-Wf4QI_B5.js} +1 -1
  80. package/dist/{ThumbnailSection-CZPxt9Vt.js → ThumbnailSection-CXuuRnOY.js} +1 -1
  81. package/dist/{ThumbnailTheme-B8th9EGc.js → ThumbnailTheme-LyFY95ps.js} +1 -1
  82. package/dist/core.css +1 -1
  83. package/dist/{index-d52sus6s.js → index-B6YvZe00.js} +2614 -2366
  84. package/dist/index.js +87 -86
  85. package/package.json +1 -1
  86. package/dist/OcDataTable-DqKIOr6d.js +0 -557
@@ -1,557 +0,0 @@
1
- import { ref as $, onMounted as Ue, createBlock as L, openBlock as r, unref as i, withCtx as w, createVNode as A, createElementVNode as Q, createElementBlock as h, createCommentVNode as y, mergeProps as Ee, Fragment as re, renderList as de, normalizeClass as ve, toDisplayString as Ce, computed as S, watch as ne, nextTick as il, renderSlot as j, createSlots as rl, normalizeProps as Pe, guardReactiveProps as je } from "vue";
2
- import { az as Ke, B as Te, C as nl, K as dl, Z as vl, aK as cl, aL as ml, aM as fl, H as pl, I as Le, j as yl } from "./index-d52sus6s.js";
3
- import { useDataTable as gl } from "./DataTable/useDataTable.js";
4
- import { VueDraggableNext as Ae } from "vue-draggable-next";
5
- import { getFromLocalStorage as Ie, formatHeadersFromLocalStorage as qe, formatHeadersToLocalStorage as bl, setInLocalStorage as kl } from "./DataTable/utils/editColumnsUtils.js";
6
- import { _ as Be } from "./OcIcon-CBf___w1.js";
7
- import { formatFilterDisplay as hl, clearAllFilters as xl } from "./DataTable/utils/filterUtils.js";
8
- import { formatCustomItemsPerPageOptions as wl, getItemsPerPageOptions as Sl } from "./DataTable/utils/paginationUtils.js";
9
- import "dayjs";
10
- const $l = { class: "p-5 gap-y-4 text-sm flex w-[250px] flex-col" }, Ol = {
11
- key: 0,
12
- class: "gap-y-2 flex flex-col border-b pb-3 border-oc-gray-200"
13
- }, Vl = { class: "gap-y-2 flex flex-col" }, Fl = {
14
- key: 0,
15
- class: "flex items-center bg-white justify-between h-[26px]"
16
- }, Dl = { class: "flex items-center w-full gap-x-3" }, El = { class: "truncate w-full max-w-[160px]" }, Cl = {
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(D, { emit: se }) {
38
- const oe = se, s = D, g = $([]), d = $([]), K = $(!1), O = {
39
- handle: ".drag-el",
40
- filter: ".is-disabled",
41
- group: "headers",
42
- animation: 500,
43
- forceFallback: !1,
44
- move: (E) => E.to.dataset.activeHeaders ? !0 : !!E.draggedContext.futureIndex,
45
- "onUpdate:modelValue": () => T()
46
- }, T = (E = !1) => {
47
- d.value = d.value.map((u) => ({
48
- ...u,
49
- isActive: !0
50
- })), oe("update-order", {
51
- fixedHeaders: d.value,
52
- activeHeaders: g.value,
53
- isOnMount: E
54
- });
55
- };
56
- return Ue(() => {
57
- const E = Ie(s.localKey), { fixed: u, active: v } = qe(E, s.headers, s.localKey);
58
- d.value = u || s.headers.slice(0, 1), g.value = v || s.headers.slice(1).map((C) => {
59
- var ee, le, ae;
60
- return {
61
- ...C,
62
- isActive: ((ae = (le = (ee = s.options) == null ? void 0 : ee.active) == null ? void 0 : le.find((ue) => ue.key === C.key)) == null ? void 0 : ae.isActive) ?? !0
63
- };
64
- }), T(!0);
65
- }), (E, u) => (r(), L(i(Ke), {
66
- modelValue: K.value,
67
- "onUpdate:modelValue": u[3] || (u[3] = (v) => K.value = v),
68
- class: "h-[36px]",
69
- "is-attach-to-body": ""
70
- }, {
71
- menu: w(() => [
72
- Q("div", $l, [
73
- d.value.length ? (r(), h("div", Ol, [
74
- u[4] || (u[4] = Q("span", { class: "text-oc-text-400 font-medium" }, "Fixed columns", -1)),
75
- A(i(Ae), Ee({
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), h(re, null, de(d.value, (v, C) => (r(), h("div", {
82
- key: v.key,
83
- class: ve(["flex items-center justify-between h-[26px]", C ? "" : "is-disabled"])
84
- }, [
85
- Q("span", null, Ce(v.label), 1),
86
- C ? (r(), L(i(Be), {
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", Vl, [
99
- u[5] || (u[5] = Q("span", { class: "text-oc-text-400 font-medium" }, "Active columns", -1)),
100
- A(i(Ae), Ee({
101
- key: "key",
102
- modelValue: g.value,
103
- "onUpdate:modelValue": u[2] || (u[2] = (v) => g.value = v)
104
- }, O, { "data-active-headers": "true" }), {
105
- default: w(() => [
106
- (r(!0), h(re, null, de(g.value, (v) => (r(), h(re, {
107
- key: v.key
108
- }, [
109
- v.key !== "actions" ? (r(), h("div", Fl, [
110
- Q("div", Dl, [
111
- A(i(nl), {
112
- modelValue: v.isActive,
113
- "onUpdate:modelValue": [
114
- (C) => v.isActive = C,
115
- u[1] || (u[1] = (C) => T())
116
- ],
117
- class: "!w-fit"
118
- }, null, 8, ["modelValue", "onUpdate:modelValue"]),
119
- Q("div", El, Ce(v.label), 1)
120
- ]),
121
- g.value.length > 1 ? (r(), L(i(Be), {
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(Te), {
138
- label: "Edit Column",
139
- "left-icon": "setting",
140
- variant: "secondary"
141
- })
142
- ]),
143
- _: 1
144
- }, 8, ["modelValue"]));
145
- }
146
- }, Pl = { class: "relative flex flex-col gap-9" }, jl = {
147
- key: 0,
148
- class: "flex items-center px-4 min-h-[52px]"
149
- }, Ll = {
150
- key: 0,
151
- class: "absolute flex items-center gap-5 left-5"
152
- }, Al = {
153
- key: 1,
154
- class: "absolute flex gap-3 left-5"
155
- }, Bl = {
156
- key: 1,
157
- class: "flex justify-center w-full gap-5 md:justify-start"
158
- }, Ul = {
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
- "update:sort-by": []
208
- },
209
- setup(D, { expose: se, emit: oe }) {
210
- var ye, ge, be, ke, he, xe, we, Se, $e, Oe, Ve, Fe, De;
211
- const s = D, g = oe, d = S(() => {
212
- var e;
213
- return (e = s.options) == null ? void 0 : e.cursor;
214
- }), K = $(), O = S(() => {
215
- var e;
216
- return (e = s.options) == null ? void 0 : e.tableOptions;
217
- }), T = S(() => s.localDb !== void 0), {
218
- localData: E,
219
- paginationData: u,
220
- isLoading: v,
221
- // Methods
222
- bulkPutLocalData: C,
223
- bulkDeleteLocalData: ee,
224
- getLocalDataUpdatedAt: le,
225
- getLocalDataIds: ae,
226
- syncLocalData: ue,
227
- sortByData: N,
228
- // Setters
229
- setFilter: Qe,
230
- setSortBy: Re
231
- } = gl({
232
- name: ((ye = s.localDb) == null ? void 0 : ye.table_name) ?? null,
233
- db: ((ge = s.localDb) == null ? void 0 : ge.db) ?? null,
234
- filterable_fields: (be = s.options) == null ? void 0 : be.filterable_fields,
235
- sortable_fields: (ke = s.options) == null ? void 0 : ke.sortable_fields
236
- });
237
- ne(() => {
238
- var e;
239
- return (e = s.options) == null ? void 0 : e.pagination;
240
- }, (e) => {
241
- T.value || (u.value = e);
242
- }, { deep: !0, immediate: !0 }), T.value && (ne(() => s.filter, () => {
243
- s.filter && Qe(s.filter);
244
- }, { deep: !0, immediate: !0 }), ne(() => s.sortBy, () => {
245
- s.sortBy && Re(s.sortBy);
246
- }, { deep: !0, immediate: !0 }));
247
- const ce = S(() => {
248
- var l;
249
- const e = {
250
- ...O.value,
251
- headers: K.value ? K.value.map((n) => {
252
- var f, p;
253
- return n.class = ((p = (f = O.value) == null ? void 0 : f.headers.find((c) => c.key === n.key)) == null ? void 0 : p.class) ?? "", n;
254
- }).filter((n) => n.isActive) : (l = O.value) == null ? void 0 : l.headers.filter((n) => Xe(n.key))
255
- };
256
- return T.value && (e.fields = E.value), e;
257
- }), a = S(() => {
258
- var e;
259
- return (e = s.options) == null ? void 0 : e.filterOptions;
260
- }), ze = S(() => {
261
- var e;
262
- return (e = s.options) == null ? void 0 : e.hidePerPageDropdown;
263
- }), Ne = S(() => {
264
- var e;
265
- return ((e = u.value) == null ? void 0 : e.last_page) === 1;
266
- }), R = $(!1), B = $(s.filter[(xe = (he = a.value) == null ? void 0 : he.tabs) == null ? void 0 : xe.key]), M = $(s.filter.page), z = $(
267
- (Se = (we = a.value) == null ? void 0 : we.per_page) != null && Se.key ? s.filter[(Oe = ($e = a.value) == null ? void 0 : $e.per_page) == null ? void 0 : Oe.key] : s.filter.per_page
268
- ), me = ((De = s.filter[(Fe = (Ve = a.value) == null ? void 0 : Ve.search) == null ? void 0 : Fe.key]) == null ? void 0 : De.trim()) ?? "", U = $(me ? me.split(",") : []), fe = $(!1), Me = S(
269
- () => {
270
- var e;
271
- return wl((e = s.options) == null ? void 0 : e.perPageOptions);
272
- }
273
- ), Ze = S(() => Sl(Me.value, u.value)), Ge = S(() => {
274
- var e;
275
- return ((e = s.selected) == null ? void 0 : e.length) > 0;
276
- }), He = (e) => {
277
- !e.trim() || !o.value.selectedSearchOption && U.value.includes(e) || (U.value = [e], V(), g("search-query-changed", e));
278
- }, Je = (e) => {
279
- U.value = U.value.filter((l) => l !== e), V();
280
- }, Z = s.filter;
281
- !Z && u.value ? Z.page = 1 : !Z && d && (Z.cursor = "");
282
- const o = $(Z), We = S(() => hl(o.value, a.value)), Xe = (e) => {
283
- var l, n, f, p, c, t;
284
- return ((t = (c = (p = (f = o.value) == null ? void 0 : f[(n = (l = a.value) == null ? void 0 : l.columnEdit) == null ? void 0 : n.key]) == null ? void 0 : p.active) == null ? void 0 : c.find((b) => b.key === e)) == null ? void 0 : t.isActive) ?? !0;
285
- }, Ye = ({ fixedHeaders: e, activeHeaders: l, isOnMount: n }) => {
286
- var f, p, c, t, b, x, P, F;
287
- if (o.value[(p = (f = a.value) == null ? void 0 : f.columnEdit) == null ? void 0 : p.key] || (o.value[(t = (c = a.value) == null ? void 0 : c.columnEdit) == null ? void 0 : t.key] = {}), o.value[(x = (b = a.value) == null ? void 0 : b.columnEdit) == null ? void 0 : x.key].fixed = e, o.value[(F = (P = a.value) == null ? void 0 : P.columnEdit) == null ? void 0 : F.key].active = l, K.value = [...e, ...l], !n) {
288
- const I = bl(e, l);
289
- kl(a.value.columnEdit.localStorageKey, I);
290
- }
291
- g("columns-changed", l);
292
- }, _e = () => {
293
- var e, l, n, f, p, c;
294
- if ((l = (e = a.value) == null ? void 0 : e.columnEdit) != null && l.localStorageKey) {
295
- const t = Ie(a.value.columnEdit.localStorageKey);
296
- if (t) {
297
- const { fixed: b, active: x } = qe(
298
- t,
299
- O.value.headers,
300
- a.value.columnEdit.localStorageKey
301
- );
302
- o.value[(f = (n = a.value) == null ? void 0 : n.columnEdit) == null ? void 0 : f.key].fixed = b, o.value[(c = (p = a.value) == null ? void 0 : p.columnEdit) == null ? void 0 : c.key].active = x, K.value = [...b, ...x];
303
- }
304
- }
305
- }, el = (e) => {
306
- o.value.selectedSearchOption = e;
307
- }, ll = () => {
308
- U.value = [], B.value = "", o.value = xl(o.value, a.value, z.value, B.value), V();
309
- }, al = () => {
310
- V(null, M.value);
311
- }, pe = $(null), V = (e = null, l = !1, n = "", f = !1, p = !1) => {
312
- var t, b, x, P, F, I, G, H, J, W, X, Y, _;
313
- u.value && !l && (M.value = 1), u.value ? o.value.page = M.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, (b = a.value) != null && b.tabs && p && (o.value[a.value.tabs.key] = B.value), (x = a.value) != null && x.search && ((F = (P = a.value.search) == null ? void 0 : P.options) != null && F.length ? (Object.keys(o.value).forEach((k) => {
314
- var q;
315
- (q = a.value.search.options) != null && q.map((m) => m.value).includes(k) && delete o.value[k];
316
- }), o.value[((I = o.value) == null ? void 0 : I.selectedSearchOption) || ((J = (H = (G = a.value.search) == null ? void 0 : G.options) == null ? void 0 : H[0]) == null ? void 0 : J.value) || a.value.search.key] = U.value.join()) : o.value[a.value.search.key] = U.value.join()), e && (R.value = !1, o.value = { ...o.value, ...e }, Object.keys(o.value).forEach((k) => {
317
- Array.isArray(o.value[k]) && o.value[k].length === 0 && delete o.value[k];
318
- }));
319
- let c = (X = (W = a.value) == null ? void 0 : W.tabs) == null ? void 0 : X.key;
320
- if (c && B.value !== o.value[c]) {
321
- const k = (_ = (Y = a.value.tabs) == null ? void 0 : Y.options) == null ? void 0 : _.find(
322
- (q) => {
323
- var m, te;
324
- return ((m = q.value) == null ? void 0 : m.toString()) === ((te = o.value[c]) == null ? void 0 : te.toString());
325
- }
326
- );
327
- if (k != null && k.value)
328
- return B.value = k.value, V(), !1;
329
- }
330
- clearTimeout(pe.value), pe.value = setTimeout(() => {
331
- g("update:filter", o.value, f);
332
- }, 100);
333
- }, tl = (e, l) => {
334
- (l === a.value.tabs.key || l === "tabs") && (B.value = ""), V(e), g("filter-removed", l);
335
- };
336
- Ue(() => {
337
- _e(), il(() => {
338
- g("on-table-ready");
339
- });
340
- });
341
- const ie = S(() => s.isLoading || v.value);
342
- se({
343
- localData: E,
344
- paginationData: u,
345
- tableIsLoading: ie,
346
- bulkPutLocalData: C,
347
- bulkDeleteLocalData: ee,
348
- getLocalDataUpdatedAt: le,
349
- getLocalDataIds: ae,
350
- syncLocalData: ue,
351
- sortByData: N
352
- });
353
- const sl = ({ key: e, value: l }) => {
354
- Object.keys(N.value).forEach((n) => {
355
- n !== e && (N.value[n] = null);
356
- }), N.value[e] = l, g("update:sort-by", N.value);
357
- };
358
- return (e, l) => {
359
- var n, f, p, c;
360
- return r(), h("div", Pl, [
361
- ce.value ? (r(), L(i(dl), {
362
- key: 0,
363
- selected: D.selected,
364
- "row-key": D.rowKey,
365
- options: ce.value,
366
- "is-loading": ie.value,
367
- "loading-rows": z.value,
368
- "row-class": D.rowClass,
369
- "row-link": D.rowLink,
370
- "is-sticky": O.value.isSticky,
371
- "is-borderless": O.value.isBorderless,
372
- "sort-by": D.sortBy,
373
- "onUpdate:selected": l[8] || (l[8] = (t) => e.$emit("update:selected", t)),
374
- "onUpdate:sortBy": sl,
375
- "onClick:row": l[9] || (l[9] = (t) => e.$emit("click:row", t)),
376
- "onHover:cell": l[10] || (l[10] = (t) => e.$emit("hover:cell", t))
377
- }, rl({
378
- after: w(() => [
379
- j(e.$slots, "after")
380
- ]),
381
- empty: w(() => [
382
- j(e.$slots, "empty")
383
- ]),
384
- "table-header": w((t) => [
385
- j(e.$slots, "table-header", Pe(je(t)))
386
- ]),
387
- "table-body": w((t) => [
388
- j(e.$slots, "table-body", Pe(je(t)))
389
- ]),
390
- _: 2
391
- }, [
392
- e.$slots.before || (n = a.value) != null && n.search || (f = a.value) != null && f.form || (p = a.value) != null && p.tabs ? {
393
- name: "before",
394
- fn: w(() => {
395
- var t, b, x, P;
396
- return [
397
- j(e.$slots, "before"),
398
- (t = a.value) != null && t.search || (b = a.value) != null && b.form || (x = a.value) != null && x.tabs ? (r(), h("div", jl, [
399
- Ge.value ? (r(), h("div", Ll, [
400
- j(e.$slots, "bulk-actions", { selectedRows: D.selected })
401
- ])) : (r(), h("div", Al, [
402
- (P = a.value) != null && P.tabs ? (r(), L(i(vl), {
403
- key: 0,
404
- modelValue: B.value,
405
- "onUpdate:modelValue": [
406
- l[0] || (l[0] = (F) => B.value = F),
407
- l[1] || (l[1] = (F) => V(null, !1, "", !1, !0))
408
- ],
409
- "is-disabled": ie.value,
410
- tabs: a.value.tabs.options,
411
- variant: "pills"
412
- }, null, 8, ["modelValue", "is-disabled", "tabs"])) : y("", !0)
413
- ])),
414
- j(e.$slots, "filter-options", {}, () => {
415
- var F, I, G, H, J, W, X, Y, _, k, q;
416
- return [
417
- (F = a.value) != null && F.search || (I = a.value) != null && I.form || (G = a.value) != null && G.columnEdit ? (r(), h("div", {
418
- key: 0,
419
- class: ve([
420
- "flex gap-3 absolute ml-auto bg-oc-bg-light right-4 max-w-[calc(100%-24px)]",
421
- a.value ? fe.value ? "md:w-fit w-full" : "" : "w-full justify-end"
422
- ])
423
- }, [
424
- (H = a.value) != null && H.search ? (r(), L(i(cl), {
425
- key: 0,
426
- "is-search-only": !a.value.tabs || a.value.isSearchOnly,
427
- "search-options": ((J = a.value.search) == null ? void 0 : J.options) ?? [],
428
- "selected-option": (((W = o.value) == null ? void 0 : W.selectedSearchOption) || ((_ = (Y = (X = a.value.search) == null ? void 0 : X.options) == null ? void 0 : Y[0]) == null ? void 0 : _.value)) ?? "keywords",
429
- onAddQuery: He,
430
- onToggle: l[2] || (l[2] = (m) => fe.value = m),
431
- onChangeSearchKey: el
432
- }, null, 8, ["is-search-only", "search-options", "selected-option"])) : y("", !0),
433
- (k = a.value) != null && k.form ? (r(), L(i(Ke), {
434
- key: 1,
435
- modelValue: R.value,
436
- "onUpdate:modelValue": [
437
- l[6] || (l[6] = (m) => R.value = m),
438
- l[7] || (l[7] = (m) => e.$emit("filter-open", m))
439
- ],
440
- distance: 9,
441
- placement: "bottom-end",
442
- "is-attach-to-body": ""
443
- }, {
444
- menu: w(() => [
445
- R.value ? (r(), L(i(ml), {
446
- key: 0,
447
- id: D.id,
448
- "json-form": a.value.form ?? [],
449
- grid: a.value.grid ?? null,
450
- values: s.filter,
451
- actions: a.value.actions,
452
- onApplyFilter: l[3] || (l[3] = (m) => V(m)),
453
- onFilterFieldsChanged: l[4] || (l[4] = (m) => g("filter-fields-changed", m)),
454
- onCancel: l[5] || (l[5] = (m) => R.value = !1)
455
- }, {
456
- default: w(({ errors: m, values: te, jsonForm: ol, updateForm: ul }) => [
457
- j(e.$slots, "custom-filter-form", {
458
- errors: m,
459
- values: te,
460
- jsonForm: ol,
461
- updateFilter: ul
462
- })
463
- ]),
464
- _: 3
465
- }, 8, ["id", "json-form", "grid", "values", "actions"])) : y("", !0)
466
- ]),
467
- default: w(() => [
468
- A(i(Te), {
469
- "is-active": R.value,
470
- variant: "secondary",
471
- "left-icon": "filter"
472
- }, null, 8, ["is-active"])
473
- ]),
474
- _: 3
475
- }, 8, ["modelValue"])) : y("", !0),
476
- a.value.columnEdit ? (r(), L(Cl, {
477
- key: 2,
478
- options: o.value.columnEdit,
479
- headers: ((q = O.value) == null ? void 0 : q.headers) || [],
480
- "local-key": a.value.columnEdit.localStorageKey,
481
- onUpdateOrder: Ye
482
- }, null, 8, ["options", "headers", "local-key"])) : y("", !0)
483
- ], 2)) : y("", !0)
484
- ];
485
- })
486
- ])) : y("", !0),
487
- A(i(fl), {
488
- filters: We.value,
489
- queries: U.value,
490
- class: "border-t border-oc-gray-200",
491
- onRemoveQuery: Je,
492
- onRemoveAll: ll,
493
- onRemoveFilter: tl
494
- }, null, 8, ["filters", "queries"])
495
- ];
496
- }),
497
- key: "0"
498
- } : void 0,
499
- de((c = O.value) == null ? void 0 : c.headers, (t, b) => ({
500
- name: t.key,
501
- fn: w(({ data: x, item: P }) => [
502
- j(e.$slots, t.key, {
503
- data: x,
504
- item: P
505
- })
506
- ])
507
- }))
508
- ]), 1032, ["selected", "row-key", "options", "is-loading", "loading-rows", "row-class", "row-link", "is-sticky", "is-borderless", "sort-by"])) : y("", !0),
509
- j(e.$slots, "before-pagination"),
510
- i(u) || d.value ? (r(), h("div", {
511
- key: 1,
512
- class: ve(["flex items-center gap-3", i(u) && i(u).last_page === 1 ? "justify-end" : ""])
513
- }, [
514
- i(u) && !Ne.value ? (r(), L(i(pl), {
515
- key: 0,
516
- modelValue: M.value,
517
- "onUpdate:modelValue": [
518
- l[11] || (l[11] = (t) => M.value = t),
519
- al
520
- ],
521
- class: "justify-center",
522
- "max-page": i(u).last_page,
523
- strategy: i(u).strategy,
524
- "total-visible": "5"
525
- }, null, 8, ["modelValue", "max-page", "strategy"])) : y("", !0),
526
- d.value ? (r(), h("div", Bl, [
527
- A(i(Le), {
528
- disabled: !d.value.prev,
529
- onClick: l[12] || (l[12] = (t) => d.value.prev ? V(null, !1, d.value.prev) : null)
530
- }, null, 8, ["disabled"]),
531
- A(i(Le), {
532
- disabled: !d.value.next,
533
- "is-next": "",
534
- onClick: l[13] || (l[13] = (t) => d.value.next ? V(null, !1, d.value.next) : null)
535
- }, null, 8, ["disabled"])
536
- ])) : y("", !0),
537
- ze.value ? y("", !0) : (r(), h("div", Ul, [
538
- A(i(yl), {
539
- modelValue: z.value,
540
- "onUpdate:modelValue": [
541
- l[14] || (l[14] = (t) => z.value = t),
542
- l[15] || (l[15] = (t) => V(null))
543
- ],
544
- label: "Item per page",
545
- "is-inline-label": "",
546
- "popper-options": { placement: "auto" },
547
- options: Ze.value
548
- }, null, 8, ["modelValue", "options"])
549
- ]))
550
- ], 2)) : y("", !0)
551
- ]);
552
- };
553
- }
554
- };
555
- export {
556
- Zl as default
557
- };