@orchidui/core 1.8.1-11 → 1.8.1-111

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 (117) hide show
  1. package/dist/DataDisplay/CustomerCard/OcCustomerCard.js +2 -2
  2. package/dist/DataDisplay/FloatContent/OcFloatContent.js +1 -1
  3. package/dist/DataDisplay/HorizontalProgressbar/OcHorizontalProgressbar.js +1 -1
  4. package/dist/DataDisplay/InfoCard/OcInfoCard.js +1 -1
  5. package/dist/DataDisplay/ListDetail/OcListDetail.js +1 -1
  6. package/dist/DataDisplay/ListItem/OcListItem.js +1 -1
  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/ProgressBar/OcProgressBar.js +1 -1
  11. package/dist/DataDisplay/Table/OcTable.js +1 -1
  12. package/dist/DataDisplay/TransferSummary/OcTransferSummary.js +1 -1
  13. package/dist/DataTable/useDataTable.js +82 -0
  14. package/dist/DataTable/utils/filterUtils.js +57 -0
  15. package/dist/DataTable/utils/paginationUtils.js +26 -0
  16. package/dist/DataTable/utils/storageUtils.js +11 -0
  17. package/dist/Disclosure/Accordion/OcAccordion.js +1 -1
  18. package/dist/Disclosure/OnboardingAccordion/OnboardingAccordion.js +1 -1
  19. package/dist/Disclosure/Steps/OcSteps.js +1 -1
  20. package/dist/Disclosure/SwitchTabs/OcSwitchTabs.js +1 -1
  21. package/dist/Disclosure/Tabs/Tabs.js +1 -1
  22. package/dist/Disclosure/Variants/OcVariants.js +1 -1
  23. package/dist/Elements/AdditionalContent/OcAdditionalContent.js +1 -1
  24. package/dist/Elements/AuthenticationOption/AuthenticationOption.js +1 -1
  25. package/dist/Elements/Box/OcBox.js +1 -1
  26. package/dist/Elements/EmptyPage/OcEmptyPage.js +1 -1
  27. package/dist/Elements/FeatureOverviewCard/OcFeatureOverviewCard.js +1 -1
  28. package/dist/Elements/Header/OcHeader.js +1 -1
  29. package/dist/Elements/PageTitle/OcPageTitle.js +1 -1
  30. package/dist/Elements/SandboxBanner/OcSandboxBanner.js +1 -1
  31. package/dist/Elements/Section/OcSection.js +1 -1
  32. package/dist/Elements/Sidebar/OcSidebar.js +2 -2
  33. package/dist/Elements/Skeleton/OcSkeleton.js +1 -1
  34. package/dist/Elements/SubSidebar/OcSubSidebar.js +1 -1
  35. package/dist/Elements/TopBanner/OcTopBanner.js +4 -0
  36. package/dist/Elements/VerificationOption/OcVerificationOption.js +2 -2
  37. package/dist/Feedback/Banner/OcBanner.js +1 -1
  38. package/dist/Feedback/Chip/OcChip.js +1 -1
  39. package/dist/Feedback/ShareIcon/OcShareIcon.js +1 -1
  40. package/dist/Feedback/Snackbar/OcSnackbar.js +1 -1
  41. package/dist/Feedback/Tag/OcTag.js +1 -1
  42. package/dist/Form/BaseInput/OcBaseInput.js +1 -1
  43. package/dist/Form/Button/OcButton.js +1 -1
  44. package/dist/Form/Calendar/OcCalendar.js +2 -2
  45. package/dist/Form/CardInput/OcCardInput.js +1 -1
  46. package/dist/Form/Checkbox/OcCheckbox.js +2 -2
  47. package/dist/Form/CheckboxesGroup/OcCheckboxesGroup.js +1 -1
  48. package/dist/Form/Criteria/OcCriteria.js +1 -1
  49. package/dist/Form/Cropper/OcCropper.js +1 -1
  50. package/dist/Form/DatePicker/OcDatePicker.js +1 -1
  51. package/dist/Form/EmojiPicker/OcEmojiPicker.js +1 -1
  52. package/dist/Form/Input/OcInput.js +1 -1
  53. package/dist/Form/LinkInput/OcLinkInput.js +2 -2
  54. package/dist/Form/MultipleUploadFile/OcMultipleUploadFile.js +1 -1
  55. package/dist/Form/NumberInput/OcNumberInput.js +1 -1
  56. package/dist/Form/PhoneInput/OcPhoneInput.js +2 -2
  57. package/dist/Form/Radio/OcRadio.js +1 -1
  58. package/dist/Form/RadioGroup/OcRadioGroup.js +1 -1
  59. package/dist/Form/RangeInput/OcRangeInput.js +1 -1
  60. package/dist/Form/SectionItem/OcSectionItem.js +2 -2
  61. package/dist/Form/Select/OcSelect.js +1 -1
  62. package/dist/Form/SelectOptions/OcSelectOptions.js +2 -2
  63. package/dist/Form/SingleFileUpload/OcSingleFileUpload.js +1 -1
  64. package/dist/Form/Slider/OcSlider.js +1 -1
  65. package/dist/Form/TextArea/OcTextArea.js +2 -2
  66. package/dist/Form/Toggle/OcToggle.js +1 -1
  67. package/dist/Form/index.js +8 -8
  68. package/dist/FormBuilder/OcFormBuilder.js +1 -1
  69. package/dist/MediaAndIcons/Avatar/OcAvatar.js +1 -1
  70. package/dist/MediaAndIcons/Icon/OcIcon.js +1 -1
  71. package/dist/{OcAccountSetupProgress-Clm-5_ey.js → OcAccountSetupProgress-BHZKRi83.js} +4 -4
  72. package/dist/{OcAvatar-DeVm4Ck5.js → OcAvatar-WGEX8Wio.js} +4 -4
  73. package/dist/{OcComplexCalendar-Cfd-y0gG.js → OcComplexCalendar-DpEmr9kN.js} +6 -6
  74. package/dist/{OcComplexDatePicker-61c4JZKY.js → OcComplexDatePicker-BaA7wDaR.js} +5 -5
  75. package/dist/OcCropper-DI9cu89P.js +253 -0
  76. package/dist/OcDataTable-DB7Q2Frw.js +535 -0
  77. package/dist/{OcDraggable-CA_BCbpl.js → OcDraggable-DRsp4j4e.js} +5 -4
  78. package/dist/{OcDraggableList-BCxM39f4.js → OcDraggableList-D6Q9aZI0.js} +50 -47
  79. package/dist/{OcEmojiPicker-CAzyTs_x.js → OcEmojiPicker-B9K3pg5W.js} +17 -15
  80. package/dist/{OcFilterForm-KX_wH5yD.js → OcFilterForm-B4ASDeTk.js} +22 -24
  81. package/dist/OcFilterSearch-SHFmbTuq.js +112 -0
  82. package/dist/{OcFilterSearchFor-B3hHtpZ3.js → OcFilterSearchFor-B1so0yiO.js} +27 -21
  83. package/dist/{OcHorizontalProgressbar.vue_vue_type_script_setup_true_lang-4eVgPDi5.js → OcHorizontalProgressbar.vue_vue_type_script_setup_true_lang-C-8H1oP2.js} +2 -2
  84. package/dist/{OcIcon-CJgBICxh.js → OcIcon-CBf___w1.js} +10 -9
  85. package/dist/OcModalCropper-C5wArpL9.js +52 -0
  86. package/dist/{OcPopper-BgjdqRiw.js → OcPopper-BSfMaOoF.js} +26 -25
  87. package/dist/{OcProgressBar-hiyC5XSc.js → OcProgressBar-lyqE5LZd.js} +5 -5
  88. package/dist/{OcSection-D_vO-DAP.js → OcSection-BjyapRr3.js} +3 -3
  89. package/dist/{OcSkeleton-CvdpGSQR.js → OcSkeleton-Czw65X0i.js} +2 -2
  90. package/dist/{OcSwitchTabs-CYp676bj.js → OcSwitchTabs-B7LfmG3z.js} +3 -3
  91. package/dist/{OcTag.vue_vue_type_script_setup_true_lang-D19lw-8Y.js → OcTag.vue_vue_type_script_setup_true_lang-CzJFcg8l.js} +2 -2
  92. package/dist/{OcTheme-CWgrJh5Q.js → OcTheme-B6NTNYtz.js} +2 -2
  93. package/dist/{OcTimePicker-CMa74qpy.js → OcTimePicker-BFCYWz49.js} +6 -6
  94. package/dist/{OcTimePopup-CXGhaOev.js → OcTimePopup-CrwbZ_Nx.js} +5 -5
  95. package/dist/OcToggle-DOfA-DZ8.js +58 -0
  96. package/dist/Overlay/ConfirmationModal/OcConfirmationModal.js +1 -1
  97. package/dist/Overlay/CopyTooltip/OcCopyTooltip.js +1 -1
  98. package/dist/Overlay/Dropdown/OcDropdown.js +1 -1
  99. package/dist/Overlay/Modal/OcModal.js +1 -1
  100. package/dist/Overlay/Popper/OcPopper.js +1 -1
  101. package/dist/Overlay/SupportMenu/OcSupportMenu.js +1 -1
  102. package/dist/Overlay/Tooltip/OcTooltip.js +1 -1
  103. package/dist/Overlay/Whitelist/OcWhiteList.js +1 -1
  104. package/dist/{SubPlanCard-DEHbknTJ.js → SubPlanCard-CP56AtvN.js} +10 -10
  105. package/dist/Theme/OcTheme.js +1 -1
  106. package/dist/{ThumbnailSection-DcVC8Asb.js → ThumbnailSection-Ba03sZNp.js} +3 -3
  107. package/dist/{ThumbnailTheme-CYLkbsvP.js → ThumbnailTheme-ChifSN57.js} +9 -6
  108. package/dist/core.css +1 -0
  109. package/dist/{index-CAruXF0_.js → index-SvoT4d-2.js} +2975 -2836
  110. package/dist/index.js +58 -55
  111. package/package.json +1 -1
  112. package/dist/OcCropper-Ux59wRju.js +0 -229
  113. package/dist/OcDataTable-Bbr3FLYJ.js +0 -578
  114. package/dist/OcFilterSearch-BBcRiObo.js +0 -69
  115. package/dist/OcModalCropper-Cci0YIOD.js +0 -46
  116. package/dist/OcToggle-bIJaLDMZ.js +0 -53
  117. package/dist/style.css +0 -1
@@ -0,0 +1,535 @@
1
+ import { ref as x, onMounted as je, createBlock as A, openBlock as i, unref as u, withCtx as w, createVNode as T, createElementVNode as N, createElementBlock as h, createCommentVNode as b, mergeProps as Oe, Fragment as ue, renderList as ie, normalizeClass as re, toDisplayString as Ve, computed as E, watch as te, renderSlot as j, createSlots as ll, normalizeProps as Ee, guardReactiveProps as Ce } from "vue";
2
+ import { az as Ae, B as Ke, C as al, K as tl, Z as ol, aK as sl, aL as ul, aM as il, H as rl, I as Le, j as nl } from "./index-SvoT4d-2.js";
3
+ import { VueDraggableNext as Pe } from "vue-draggable-next";
4
+ import { getFromLocalStorage as Te, formatHeadersFromLocalStorage as Ue, formatHeadersToLocalStorage as dl, setInLocalStorage as vl } from "./DataTable/utils/editColumnsUtils.js";
5
+ import { _ as De } from "./OcIcon-CBf___w1.js";
6
+ import { formatFilterDisplay as cl, clearAllFilters as ml } from "./DataTable/utils/filterUtils.js";
7
+ import { formatCustomItemsPerPageOptions as pl, getItemsPerPageOptions as fl } from "./DataTable/utils/paginationUtils.js";
8
+ import { getFilterFromLocalStorage as gl, saveFilterToLocalStorage as yl } from "./DataTable/utils/storageUtils.js";
9
+ import { useDataTable as bl } from "./DataTable/useDataTable.js";
10
+ import "dayjs";
11
+ const kl = { class: "p-5 gap-y-4 text-sm flex w-[250px] flex-col" }, hl = {
12
+ key: 0,
13
+ class: "gap-y-2 flex flex-col border-b pb-3 border-oc-gray-200"
14
+ }, Sl = { class: "gap-y-2 flex flex-col" }, xl = {
15
+ key: 0,
16
+ class: "flex items-center bg-white justify-between h-[26px]"
17
+ }, wl = { class: "flex items-center w-full gap-x-3" }, $l = { class: "truncate w-full max-w-[160px]" }, Fl = {
18
+ __name: "ColumnEdit",
19
+ props: {
20
+ options: {
21
+ type: Object,
22
+ default: () => ({})
23
+ },
24
+ headers: {
25
+ type: Array,
26
+ default: () => []
27
+ },
28
+ localKey: {
29
+ type: String,
30
+ default: ""
31
+ }
32
+ },
33
+ emits: [
34
+ "change-active",
35
+ "onMoved",
36
+ "update-order"
37
+ ],
38
+ setup(K, { emit: oe }) {
39
+ const s = oe, $ = K, n = x([]), m = x([]), B = x(!1), F = {
40
+ handle: ".drag-el",
41
+ filter: ".is-disabled",
42
+ group: "headers",
43
+ animation: 500,
44
+ forceFallback: !1,
45
+ move: (L) => L.to.dataset.activeHeaders ? !0 : !!L.draggedContext.futureIndex,
46
+ "onUpdate:modelValue": () => I()
47
+ }, I = (L = !1) => {
48
+ m.value = m.value.map((p) => ({
49
+ ...p,
50
+ isActive: !0
51
+ })), s("update-order", {
52
+ fixedHeaders: m.value,
53
+ activeHeaders: n.value,
54
+ isOnMount: L
55
+ });
56
+ };
57
+ return je(() => {
58
+ const L = Te($.localKey), { fixed: p, active: f } = Ue(L, $.headers, $.localKey);
59
+ m.value = p || $.headers.slice(0, 1), n.value = f || $.headers.slice(1).map((O) => {
60
+ var ee, le, l;
61
+ return {
62
+ ...O,
63
+ isActive: ((l = (le = (ee = $.options) == null ? void 0 : ee.active) == null ? void 0 : le.find((se) => se.key === O.key)) == null ? void 0 : l.isActive) ?? !0
64
+ };
65
+ }), I(!0);
66
+ }), (L, p) => (i(), A(u(Ae), {
67
+ modelValue: B.value,
68
+ "onUpdate:modelValue": p[3] || (p[3] = (f) => B.value = f),
69
+ class: "h-[36px]",
70
+ "is-attach-to-body": ""
71
+ }, {
72
+ menu: w(() => [
73
+ N("div", kl, [
74
+ m.value.length ? (i(), h("div", hl, [
75
+ p[4] || (p[4] = N("span", { class: "text-oc-text-400 font-medium" }, "Fixed columns", -1)),
76
+ T(u(Pe), Oe({
77
+ key: "key",
78
+ modelValue: m.value,
79
+ "onUpdate:modelValue": p[0] || (p[0] = (f) => m.value = f)
80
+ }, F), {
81
+ default: w(() => [
82
+ (i(!0), h(ue, null, ie(m.value, (f, O) => (i(), h("div", {
83
+ key: f.key,
84
+ class: re(["flex items-center justify-between h-[26px]", O ? "" : "is-disabled"])
85
+ }, [
86
+ N("span", null, Ve(f.label), 1),
87
+ O ? (i(), A(u(De), {
88
+ key: 0,
89
+ width: "18",
90
+ height: "18",
91
+ class: "text-oc-text-400 drag-el cursor-move",
92
+ name: "draggable"
93
+ })) : b("", !0)
94
+ ], 2))), 128))
95
+ ]),
96
+ _: 1
97
+ }, 16, ["modelValue"])
98
+ ])) : b("", !0),
99
+ N("div", Sl, [
100
+ p[5] || (p[5] = N("span", { class: "text-oc-text-400 font-medium" }, "Active columns", -1)),
101
+ T(u(Pe), Oe({
102
+ key: "key",
103
+ modelValue: n.value,
104
+ "onUpdate:modelValue": p[2] || (p[2] = (f) => n.value = f)
105
+ }, F, { "data-active-headers": "true" }), {
106
+ default: w(() => [
107
+ (i(!0), h(ue, null, ie(n.value, (f) => (i(), h(ue, {
108
+ key: f.key
109
+ }, [
110
+ f.key !== "actions" ? (i(), h("div", xl, [
111
+ N("div", wl, [
112
+ T(u(al), {
113
+ modelValue: f.isActive,
114
+ "onUpdate:modelValue": [
115
+ (O) => f.isActive = O,
116
+ p[1] || (p[1] = (O) => I())
117
+ ],
118
+ class: "!w-fit"
119
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
120
+ N("div", $l, Ve(f.label), 1)
121
+ ]),
122
+ n.value.length > 1 ? (i(), A(u(De), {
123
+ key: 0,
124
+ width: "18",
125
+ height: "18",
126
+ class: "text-oc-text-400 drag-el cursor-move",
127
+ name: "draggable"
128
+ })) : b("", !0)
129
+ ])) : b("", !0)
130
+ ], 64))), 128))
131
+ ]),
132
+ _: 1
133
+ }, 16, ["modelValue"])
134
+ ])
135
+ ])
136
+ ]),
137
+ default: w(() => [
138
+ T(u(Ke), {
139
+ label: "Edit Column",
140
+ "left-icon": "setting",
141
+ variant: "secondary"
142
+ })
143
+ ]),
144
+ _: 1
145
+ }, 8, ["modelValue"]));
146
+ }
147
+ }, Ol = { class: "relative flex flex-col gap-9" }, Vl = {
148
+ key: 0,
149
+ class: "flex items-center px-4 min-h-[52px]"
150
+ }, El = {
151
+ key: 0,
152
+ class: "absolute flex items-center gap-5 left-5"
153
+ }, Cl = {
154
+ key: 1,
155
+ class: "absolute flex gap-3 left-5"
156
+ }, Ll = {
157
+ key: 1,
158
+ class: "flex justify-center w-full gap-5 md:justify-start"
159
+ }, Pl = {
160
+ key: 2,
161
+ class: "items-center hidden md:flex"
162
+ }, Nl = {
163
+ __name: "OcDataTable",
164
+ props: {
165
+ isLoading: Boolean,
166
+ id: {
167
+ type: String,
168
+ required: !0
169
+ },
170
+ options: {
171
+ type: Object,
172
+ required: !0
173
+ },
174
+ filter: {
175
+ type: Object,
176
+ required: !0
177
+ },
178
+ selected: {
179
+ type: Array,
180
+ required: !1
181
+ },
182
+ rowClass: String,
183
+ rowKey: {
184
+ type: [String, Function],
185
+ default: "id"
186
+ },
187
+ rowLink: String,
188
+ localDb: {
189
+ type: Object,
190
+ required: !1
191
+ }
192
+ },
193
+ emits: {
194
+ "update:selected": [],
195
+ "update:filter": [],
196
+ "click:row": [],
197
+ "filter-fields-changed": [],
198
+ "filter-removed": [],
199
+ "filter-open": [],
200
+ "search-query-changed": [],
201
+ "hover:cell": [],
202
+ "columns-changed": []
203
+ },
204
+ setup(K, { emit: oe }) {
205
+ var pe, fe, ge, ye, be, ke, he, Se, xe, we, $e, Fe;
206
+ const s = K, $ = oe;
207
+ let n = x((pe = s.options) == null ? void 0 : pe.pagination);
208
+ const m = E(() => {
209
+ var e;
210
+ return (e = s.options) == null ? void 0 : e.cursor;
211
+ }), B = x(), F = E(() => {
212
+ var e;
213
+ return (e = s.options) == null ? void 0 : e.tableOptions;
214
+ }), I = E(() => s.localDb !== void 0), {
215
+ localData: L,
216
+ setFilter: p,
217
+ setSortBy: f,
218
+ paginationData: O,
219
+ isLoading: ee
220
+ // sortBy,
221
+ // toggleSort,
222
+ // updateOrAddLocalData,
223
+ } = bl({
224
+ id: s.id,
225
+ name: (fe = s.localDb) == null ? void 0 : fe.table_name,
226
+ localDb: (ge = s.localDb) == null ? void 0 : ge.db
227
+ });
228
+ I.value && (n.value = O.value, te(() => s.filter, () => {
229
+ p(s.filter);
230
+ }, { deep: !0, immediate: !0 }), te(() => s.sortBy, () => {
231
+ f(s.sortBy);
232
+ }, { deep: !0, immediate: !0 }), te(() => O.value, () => {
233
+ n.value = O.value;
234
+ }, { deep: !0, immediate: !0 })), te(() => {
235
+ var e;
236
+ return (e = s.options) == null ? void 0 : e.pagination;
237
+ }, (e) => {
238
+ I.value || (n.value = e);
239
+ }, { deep: !0 });
240
+ const le = E(() => {
241
+ var a;
242
+ const e = {
243
+ ...F.value,
244
+ headers: B.value ? B.value.map((r) => {
245
+ var v, c;
246
+ return r.class = ((c = (v = F.value) == null ? void 0 : v.headers.find((d) => d.key === r.key)) == null ? void 0 : c.class) ?? "", r;
247
+ }).filter((r) => r.isActive) : (a = F.value) == null ? void 0 : a.headers.filter((r) => ze(r.key))
248
+ };
249
+ return (I.value || L.value.length > 0) && (e.fields = L.value), e;
250
+ }), l = E(() => {
251
+ var e;
252
+ return (e = s.options) == null ? void 0 : e.filterOptions;
253
+ }), se = E(() => {
254
+ var e;
255
+ return (e = s.options) == null ? void 0 : e.hidePerPageDropdown;
256
+ }), Be = E(() => {
257
+ var e;
258
+ return ((e = n.value) == null ? void 0 : e.last_page) === 1;
259
+ }), R = x(!1), P = x(s.filter[(be = (ye = l.value) == null ? void 0 : ye.tabs) == null ? void 0 : be.key]), z = x(s.filter.page), M = x(
260
+ (he = (ke = l.value) == null ? void 0 : ke.per_page) != null && he.key ? s.filter[(xe = (Se = l.value) == null ? void 0 : Se.per_page) == null ? void 0 : xe.key] : s.filter.per_page
261
+ ), ne = ((Fe = s.filter[($e = (we = l.value) == null ? void 0 : we.search) == null ? void 0 : $e.key]) == null ? void 0 : Fe.trim()) ?? "", U = x(ne ? ne.split(",") : []), de = x(!1), Ie = E(
262
+ () => {
263
+ var e;
264
+ return pl((e = s.options) == null ? void 0 : e.perPageOptions);
265
+ }
266
+ ), qe = E(() => fl(Ie.value, n.value)), Qe = E(() => {
267
+ var e;
268
+ return ((e = s.selected) == null ? void 0 : e.length) > 0;
269
+ }), ve = (e) => {
270
+ !e.trim() || !t.value.selectedSearchOption && U.value.includes(e) || (U.value = [e], V(), $("search-query-changed", e));
271
+ }, Ne = (e) => {
272
+ U.value = U.value.filter((a) => a !== e), V();
273
+ }, J = s.filter;
274
+ !J && n.value ? J.page = 1 : !J && m && (J.cursor = "");
275
+ const t = x(J), Re = E(() => cl(t.value, l.value)), ze = (e) => {
276
+ var a, r, v, c, d, o;
277
+ return ((o = (d = (c = (v = t.value) == null ? void 0 : v[(r = (a = l.value) == null ? void 0 : a.columnEdit) == null ? void 0 : r.key]) == null ? void 0 : c.active) == null ? void 0 : d.find((g) => g.key === e)) == null ? void 0 : o.isActive) ?? !0;
278
+ }, Me = ({ fixedHeaders: e, activeHeaders: a, isOnMount: r }) => {
279
+ var v, c, d, o, g, S, D, C;
280
+ if (t.value[(c = (v = l.value) == null ? void 0 : v.columnEdit) == null ? void 0 : c.key] || (t.value[(o = (d = l.value) == null ? void 0 : d.columnEdit) == null ? void 0 : o.key] = {}), t.value[(S = (g = l.value) == null ? void 0 : g.columnEdit) == null ? void 0 : S.key].fixed = e, t.value[(C = (D = l.value) == null ? void 0 : D.columnEdit) == null ? void 0 : C.key].active = a, B.value = [...e, ...a], !r) {
281
+ const q = dl(e, a);
282
+ vl(l.value.columnEdit.localStorageKey, q);
283
+ }
284
+ $("columns-changed", a);
285
+ }, Je = () => {
286
+ var e, a, r, v, c, d;
287
+ if ((a = (e = l.value) == null ? void 0 : e.columnEdit) != null && a.localStorageKey) {
288
+ const o = Te(l.value.columnEdit.localStorageKey);
289
+ if (o) {
290
+ const { fixed: g, active: S } = Ue(
291
+ o,
292
+ F.value.headers,
293
+ l.value.columnEdit.localStorageKey
294
+ );
295
+ t.value[(v = (r = l.value) == null ? void 0 : r.columnEdit) == null ? void 0 : v.key].fixed = g, t.value[(d = (c = l.value) == null ? void 0 : c.columnEdit) == null ? void 0 : d.key].active = S, B.value = [...g, ...S];
296
+ }
297
+ }
298
+ }, Ze = (e) => {
299
+ t.value.selectedSearchOption = e;
300
+ }, Ge = () => {
301
+ U.value = [], P.value = "", t.value = ml(t.value, l.value, M.value, P.value), V();
302
+ }, He = () => {
303
+ V(null, z.value);
304
+ }, We = () => {
305
+ yl(s.id, t.value);
306
+ }, Xe = () => gl(s.id), ce = x(null), V = (e = null, a = !1, r = "", v = !1, c = !1) => {
307
+ var o, g, S, D, C, q, Z, G, H, W, X, Y, _;
308
+ n.value && !a && (z.value = 1), n.value ? t.value.page = z.value : t.value.cursor = r, (o = l.value) != null && o.per_page ? t.value[l.value.per_page.key] = M.value : t.value.per_page = M.value, (g = l.value) != null && g.tabs && c && (t.value[l.value.tabs.key] = P.value), (S = l.value) != null && S.search && ((C = (D = l.value.search) == null ? void 0 : D.options) != null && C.length ? (Object.keys(t.value).forEach((k) => {
309
+ var Q;
310
+ (Q = l.value.search.options) != null && Q.map((y) => y.value).includes(k) && delete t.value[k];
311
+ }), t.value[((q = t.value) == null ? void 0 : q.selectedSearchOption) || ((H = (G = (Z = l.value.search) == null ? void 0 : Z.options) == null ? void 0 : G[0]) == null ? void 0 : H.value) || l.value.search.key] = U.value.join()) : t.value[l.value.search.key] = U.value.join()), e && (R.value = !1, t.value = { ...t.value, ...e }, Object.keys(t.value).forEach((k) => {
312
+ Array.isArray(t.value[k]) && t.value[k].length === 0 && delete t.value[k];
313
+ }));
314
+ let d = (X = (W = l.value) == null ? void 0 : W.tabs) == null ? void 0 : X.key;
315
+ if (d && P.value !== t.value[d]) {
316
+ const k = (_ = (Y = l.value.tabs) == null ? void 0 : Y.options) == null ? void 0 : _.find(
317
+ (Q) => {
318
+ var y, ae;
319
+ return ((y = Q.value) == null ? void 0 : y.toString()) === ((ae = t.value[d]) == null ? void 0 : ae.toString());
320
+ }
321
+ );
322
+ if (k != null && k.value)
323
+ return P.value = k.value, V(), !1;
324
+ }
325
+ We(), clearTimeout(ce.value), ce.value = setTimeout(() => {
326
+ $("update:filter", t.value, v);
327
+ }, 100);
328
+ }, Ye = (e, a) => {
329
+ (a === l.value.tabs.key || a === "tabs") && (P.value = ""), V(e), $("filter-removed", a);
330
+ };
331
+ je(() => {
332
+ var a, r, v, c, d, o, g;
333
+ Je();
334
+ const e = Xe();
335
+ e && (t.value = JSON.parse(e), P.value = P.value || ((a = t.value) == null ? void 0 : a.tabs) || ((c = t.value) == null ? void 0 : c[(v = (r = l.value) == null ? void 0 : r.tabs) == null ? void 0 : v.key]), (d = t.value) != null && d.selectedSearchOption && ve(t.value[(o = t.value) == null ? void 0 : o.selectedSearchOption]), z.value = ((g = t.value) == null ? void 0 : g.page) || 1, V(null, !0, t.value.cursor, !0));
336
+ });
337
+ const me = E(() => s.isLoading || ee.value);
338
+ return (e, a) => {
339
+ var r, v, c, d;
340
+ return i(), h("div", Ol, [
341
+ F.value ? (i(), A(u(tl), {
342
+ key: 0,
343
+ selected: K.selected,
344
+ "row-key": K.rowKey,
345
+ options: le.value,
346
+ "is-loading": me.value,
347
+ "loading-rows": M.value,
348
+ "row-class": K.rowClass,
349
+ "row-link": K.rowLink,
350
+ "is-sticky": F.value.isSticky,
351
+ "is-borderless": F.value.isBorderless,
352
+ "onUpdate:selected": a[8] || (a[8] = (o) => e.$emit("update:selected", o)),
353
+ "onClick:row": a[9] || (a[9] = (o) => e.$emit("click:row", o)),
354
+ "onHover:cell": a[10] || (a[10] = (o) => e.$emit("hover:cell", o))
355
+ }, ll({
356
+ after: w(() => [
357
+ j(e.$slots, "after")
358
+ ]),
359
+ empty: w(() => [
360
+ j(e.$slots, "empty")
361
+ ]),
362
+ "table-header": w((o) => [
363
+ j(e.$slots, "table-header", Ee(Ce(o)))
364
+ ]),
365
+ "table-body": w((o) => [
366
+ j(e.$slots, "table-body", Ee(Ce(o)))
367
+ ]),
368
+ _: 2
369
+ }, [
370
+ e.$slots.before || (r = l.value) != null && r.search || (v = l.value) != null && v.form || (c = l.value) != null && c.tabs ? {
371
+ name: "before",
372
+ fn: w(() => {
373
+ var o, g, S, D;
374
+ return [
375
+ j(e.$slots, "before"),
376
+ (o = l.value) != null && o.search || (g = l.value) != null && g.form || (S = l.value) != null && S.tabs ? (i(), h("div", Vl, [
377
+ Qe.value ? (i(), h("div", El, [
378
+ j(e.$slots, "bulk-actions", { selectedRows: K.selected })
379
+ ])) : (i(), h("div", Cl, [
380
+ (D = l.value) != null && D.tabs ? (i(), A(u(ol), {
381
+ key: 0,
382
+ modelValue: P.value,
383
+ "onUpdate:modelValue": [
384
+ a[0] || (a[0] = (C) => P.value = C),
385
+ a[1] || (a[1] = (C) => V(null, !1, "", !1, !0))
386
+ ],
387
+ "is-disabled": me.value,
388
+ tabs: l.value.tabs.options,
389
+ variant: "pills"
390
+ }, null, 8, ["modelValue", "is-disabled", "tabs"])) : b("", !0)
391
+ ])),
392
+ j(e.$slots, "filter-options", {}, () => {
393
+ var C, q, Z, G, H, W, X, Y, _, k, Q;
394
+ return [
395
+ (C = l.value) != null && C.search || (q = l.value) != null && q.form || (Z = l.value) != null && Z.columnEdit ? (i(), h("div", {
396
+ key: 0,
397
+ class: re([
398
+ "flex gap-3 absolute ml-auto bg-oc-bg-light right-4 max-w-[calc(100%-24px)]",
399
+ l.value ? de.value ? "md:w-fit w-full" : "" : "w-full justify-end"
400
+ ])
401
+ }, [
402
+ (G = l.value) != null && G.search ? (i(), A(u(sl), {
403
+ key: 0,
404
+ "is-search-only": !l.value.tabs || l.value.isSearchOnly,
405
+ "search-options": ((H = l.value.search) == null ? void 0 : H.options) ?? [],
406
+ "selected-option": (((W = t.value) == null ? void 0 : W.selectedSearchOption) || ((_ = (Y = (X = l.value.search) == null ? void 0 : X.options) == null ? void 0 : Y[0]) == null ? void 0 : _.value)) ?? "keywords",
407
+ onAddQuery: ve,
408
+ onToggle: a[2] || (a[2] = (y) => de.value = y),
409
+ onChangeSearchKey: Ze
410
+ }, null, 8, ["is-search-only", "search-options", "selected-option"])) : b("", !0),
411
+ (k = l.value) != null && k.form ? (i(), A(u(Ae), {
412
+ key: 1,
413
+ modelValue: R.value,
414
+ "onUpdate:modelValue": [
415
+ a[6] || (a[6] = (y) => R.value = y),
416
+ a[7] || (a[7] = (y) => e.$emit("filter-open", y))
417
+ ],
418
+ distance: 9,
419
+ placement: "bottom-end",
420
+ "is-attach-to-body": ""
421
+ }, {
422
+ menu: w(() => [
423
+ R.value ? (i(), A(u(ul), {
424
+ key: 0,
425
+ id: K.id,
426
+ "json-form": l.value.form ?? [],
427
+ grid: l.value.grid ?? null,
428
+ values: s.filter,
429
+ actions: l.value.actions,
430
+ onApplyFilter: a[3] || (a[3] = (y) => V(y)),
431
+ onFilterFieldsChanged: a[4] || (a[4] = (y) => $("filter-fields-changed", y)),
432
+ onCancel: a[5] || (a[5] = (y) => R.value = !1)
433
+ }, {
434
+ default: w(({ errors: y, values: ae, jsonForm: _e, updateForm: el }) => [
435
+ j(e.$slots, "custom-filter-form", {
436
+ errors: y,
437
+ values: ae,
438
+ jsonForm: _e,
439
+ updateFilter: el
440
+ })
441
+ ]),
442
+ _: 3
443
+ }, 8, ["id", "json-form", "grid", "values", "actions"])) : b("", !0)
444
+ ]),
445
+ default: w(() => [
446
+ T(u(Ke), {
447
+ "is-active": R.value,
448
+ variant: "secondary",
449
+ "left-icon": "filter"
450
+ }, null, 8, ["is-active"])
451
+ ]),
452
+ _: 3
453
+ }, 8, ["modelValue"])) : b("", !0),
454
+ l.value.columnEdit ? (i(), A(Fl, {
455
+ key: 2,
456
+ options: t.value.columnEdit,
457
+ headers: ((Q = F.value) == null ? void 0 : Q.headers) || [],
458
+ "local-key": l.value.columnEdit.localStorageKey,
459
+ onUpdateOrder: Me
460
+ }, null, 8, ["options", "headers", "local-key"])) : b("", !0)
461
+ ], 2)) : b("", !0)
462
+ ];
463
+ })
464
+ ])) : b("", !0),
465
+ T(u(il), {
466
+ filters: Re.value,
467
+ queries: U.value,
468
+ class: "border-t border-oc-gray-200",
469
+ onRemoveQuery: Ne,
470
+ onRemoveAll: Ge,
471
+ onRemoveFilter: Ye
472
+ }, null, 8, ["filters", "queries"])
473
+ ];
474
+ }),
475
+ key: "0"
476
+ } : void 0,
477
+ ie((d = F.value) == null ? void 0 : d.headers, (o, g) => ({
478
+ name: o.key,
479
+ fn: w(({ data: S, item: D }) => [
480
+ j(e.$slots, o.key, {
481
+ data: S,
482
+ item: D
483
+ })
484
+ ])
485
+ }))
486
+ ]), 1032, ["selected", "row-key", "options", "is-loading", "loading-rows", "row-class", "row-link", "is-sticky", "is-borderless"])) : b("", !0),
487
+ j(e.$slots, "before-pagination"),
488
+ u(n) || m.value ? (i(), h("div", {
489
+ key: 1,
490
+ class: re(["flex items-center gap-3", u(n) && u(n).last_page === 1 ? "justify-end" : ""])
491
+ }, [
492
+ u(n) && !Be.value ? (i(), A(u(rl), {
493
+ key: 0,
494
+ modelValue: z.value,
495
+ "onUpdate:modelValue": [
496
+ a[11] || (a[11] = (o) => z.value = o),
497
+ He
498
+ ],
499
+ class: "justify-center",
500
+ "max-page": u(n).last_page,
501
+ strategy: u(n).strategy,
502
+ "total-visible": "5"
503
+ }, null, 8, ["modelValue", "max-page", "strategy"])) : b("", !0),
504
+ m.value ? (i(), h("div", Ll, [
505
+ T(u(Le), {
506
+ disabled: !m.value.prev,
507
+ onClick: a[12] || (a[12] = (o) => m.value.prev ? V(null, !1, m.value.prev) : null)
508
+ }, null, 8, ["disabled"]),
509
+ T(u(Le), {
510
+ disabled: !m.value.next,
511
+ "is-next": "",
512
+ onClick: a[13] || (a[13] = (o) => m.value.next ? V(null, !1, m.value.next) : null)
513
+ }, null, 8, ["disabled"])
514
+ ])) : b("", !0),
515
+ se.value ? b("", !0) : (i(), h("div", Pl, [
516
+ T(u(nl), {
517
+ modelValue: M.value,
518
+ "onUpdate:modelValue": [
519
+ a[14] || (a[14] = (o) => M.value = o),
520
+ a[15] || (a[15] = (o) => V(null))
521
+ ],
522
+ label: "Item per page",
523
+ "is-inline-label": "",
524
+ "popper-options": { placement: "auto" },
525
+ options: qe.value
526
+ }, null, 8, ["modelValue", "options"])
527
+ ]))
528
+ ], 2)) : b("", !0)
529
+ ]);
530
+ };
531
+ }
532
+ };
533
+ export {
534
+ Nl as default
535
+ };
@@ -1,4 +1,4 @@
1
- import { computed as s, openBlock as c, createBlock as d, unref as m, withCtx as i, renderSlot as p } from "vue";
1
+ import { computed as c, createBlock as s, openBlock as d, unref as m, withCtx as i, renderSlot as p } from "vue";
2
2
  import { VueDraggableNext as f } from "vue-draggable-next";
3
3
  const h = {
4
4
  __name: "OcDraggable",
@@ -10,17 +10,18 @@ const h = {
10
10
  detectMove: null
11
11
  },
12
12
  setup(a, { emit: l }) {
13
- const n = a, o = l, t = s(() => n.modelValue), r = (e) => {
13
+ const r = a, o = l, t = c(() => r.modelValue), n = (e) => {
14
14
  o("update:modelValue", t.value, e);
15
15
  }, u = (e) => {
16
16
  o("detectMove", e);
17
17
  };
18
- return (e, g) => (c(), d(m(f), {
18
+ return (e, g) => (d(), s(m(f), {
19
19
  handle: ".drag-el",
20
20
  list: t.value,
21
21
  animation: 500,
22
+ "force-fallback": !0,
22
23
  move: u,
23
- onChange: r
24
+ onChange: n
24
25
  }, {
25
26
  default: i(() => [
26
27
  p(e.$slots, "default", { list: t.value })