@orchidui/core 1.8.1-13 → 1.8.1-131

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 (116) 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 +95 -0
  14. package/dist/DataTable/utils/filterUtils.js +57 -0
  15. package/dist/DataTable/utils/paginationUtils.js +26 -0
  16. package/dist/Disclosure/Accordion/OcAccordion.js +1 -1
  17. package/dist/Disclosure/OnboardingAccordion/OnboardingAccordion.js +1 -1
  18. package/dist/Disclosure/Steps/OcSteps.js +1 -1
  19. package/dist/Disclosure/SwitchTabs/OcSwitchTabs.js +1 -1
  20. package/dist/Disclosure/Tabs/Tabs.js +1 -1
  21. package/dist/Disclosure/Variants/OcVariants.js +1 -1
  22. package/dist/Elements/AdditionalContent/OcAdditionalContent.js +1 -1
  23. package/dist/Elements/AuthenticationOption/AuthenticationOption.js +1 -1
  24. package/dist/Elements/Box/OcBox.js +1 -1
  25. package/dist/Elements/EmptyPage/OcEmptyPage.js +1 -1
  26. package/dist/Elements/FeatureOverviewCard/OcFeatureOverviewCard.js +1 -1
  27. package/dist/Elements/Header/OcHeader.js +1 -1
  28. package/dist/Elements/PageTitle/OcPageTitle.js +1 -1
  29. package/dist/Elements/SandboxBanner/OcSandboxBanner.js +1 -1
  30. package/dist/Elements/Section/OcSection.js +1 -1
  31. package/dist/Elements/Sidebar/OcSidebar.js +2 -2
  32. package/dist/Elements/Skeleton/OcSkeleton.js +1 -1
  33. package/dist/Elements/SubSidebar/OcSubSidebar.js +1 -1
  34. package/dist/Elements/TopBanner/OcTopBanner.js +4 -0
  35. package/dist/Elements/VerificationOption/OcVerificationOption.js +2 -2
  36. package/dist/Feedback/Banner/OcBanner.js +1 -1
  37. package/dist/Feedback/Chip/OcChip.js +1 -1
  38. package/dist/Feedback/ShareIcon/OcShareIcon.js +1 -1
  39. package/dist/Feedback/Snackbar/OcSnackbar.js +1 -1
  40. package/dist/Feedback/Tag/OcTag.js +1 -1
  41. package/dist/Form/BaseInput/OcBaseInput.js +1 -1
  42. package/dist/Form/Button/OcButton.js +1 -1
  43. package/dist/Form/Calendar/OcCalendar.js +2 -2
  44. package/dist/Form/CardInput/OcCardInput.js +1 -1
  45. package/dist/Form/Checkbox/OcCheckbox.js +2 -2
  46. package/dist/Form/CheckboxesGroup/OcCheckboxesGroup.js +1 -1
  47. package/dist/Form/Criteria/OcCriteria.js +1 -1
  48. package/dist/Form/Cropper/OcCropper.js +1 -1
  49. package/dist/Form/DatePicker/OcDatePicker.js +1 -1
  50. package/dist/Form/EmojiPicker/OcEmojiPicker.js +1 -1
  51. package/dist/Form/Input/OcInput.js +1 -1
  52. package/dist/Form/LinkInput/OcLinkInput.js +2 -2
  53. package/dist/Form/MultipleUploadFile/OcMultipleUploadFile.js +1 -1
  54. package/dist/Form/NumberInput/OcNumberInput.js +1 -1
  55. package/dist/Form/PhoneInput/OcPhoneInput.js +2 -2
  56. package/dist/Form/Radio/OcRadio.js +1 -1
  57. package/dist/Form/RadioGroup/OcRadioGroup.js +1 -1
  58. package/dist/Form/RangeInput/OcRangeInput.js +1 -1
  59. package/dist/Form/SectionItem/OcSectionItem.js +2 -2
  60. package/dist/Form/Select/OcSelect.js +1 -1
  61. package/dist/Form/SelectOptions/OcSelectOptions.js +2 -2
  62. package/dist/Form/SingleFileUpload/OcSingleFileUpload.js +1 -1
  63. package/dist/Form/Slider/OcSlider.js +1 -1
  64. package/dist/Form/TextArea/OcTextArea.js +2 -2
  65. package/dist/Form/Toggle/OcToggle.js +1 -1
  66. package/dist/Form/index.js +8 -8
  67. package/dist/FormBuilder/OcFormBuilder.js +1 -1
  68. package/dist/MediaAndIcons/Avatar/OcAvatar.js +1 -1
  69. package/dist/MediaAndIcons/Icon/OcIcon.js +1 -1
  70. package/dist/{OcAccountSetupProgress-DVe93N5F.js → OcAccountSetupProgress-B3vkJNy_.js} +4 -4
  71. package/dist/{OcAvatar-DeVm4Ck5.js → OcAvatar-WGEX8Wio.js} +4 -4
  72. package/dist/{OcComplexCalendar-_DMBOtyP.js → OcComplexCalendar-C2FLk2io.js} +6 -6
  73. package/dist/{OcComplexDatePicker-A4TDbWQM.js → OcComplexDatePicker-CCSctaqS.js} +5 -5
  74. package/dist/OcCropper-DYby58vw.js +253 -0
  75. package/dist/OcDataTable-R3pGI0eE.js +554 -0
  76. package/dist/{OcDraggable-CA_BCbpl.js → OcDraggable-DRsp4j4e.js} +5 -4
  77. package/dist/{OcDraggableList-4U0eI0yh.js → OcDraggableList-DB7bo6dC.js} +50 -47
  78. package/dist/{OcEmojiPicker-CKSZw3bt.js → OcEmojiPicker-DxX5e7bz.js} +17 -15
  79. package/dist/{OcFilterForm-DUH1_sM8.js → OcFilterForm-S5GbgnFQ.js} +22 -24
  80. package/dist/OcFilterSearch-BS9Bt7I5.js +112 -0
  81. package/dist/{OcFilterSearchFor-BbobE0iw.js → OcFilterSearchFor-BI8GWrrw.js} +27 -21
  82. 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
  83. package/dist/{OcIcon-CJgBICxh.js → OcIcon-CBf___w1.js} +10 -9
  84. package/dist/OcModalCropper-Col5A7r7.js +52 -0
  85. package/dist/{OcPopper-BgjdqRiw.js → OcPopper-BSfMaOoF.js} +26 -25
  86. package/dist/{OcProgressBar-hiyC5XSc.js → OcProgressBar-lyqE5LZd.js} +5 -5
  87. package/dist/{OcSection-D_vO-DAP.js → OcSection-BjyapRr3.js} +3 -3
  88. package/dist/{OcSkeleton-CvdpGSQR.js → OcSkeleton-Czw65X0i.js} +2 -2
  89. package/dist/{OcSwitchTabs-CYp676bj.js → OcSwitchTabs-B7LfmG3z.js} +3 -3
  90. 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
  91. package/dist/{OcTheme-CWgrJh5Q.js → OcTheme-B6NTNYtz.js} +2 -2
  92. package/dist/{OcTimePicker-CuimDUhN.js → OcTimePicker-LCviWSGQ.js} +6 -6
  93. package/dist/{OcTimePopup-CXGhaOev.js → OcTimePopup-CrwbZ_Nx.js} +5 -5
  94. package/dist/OcToggle-DOfA-DZ8.js +58 -0
  95. package/dist/Overlay/ConfirmationModal/OcConfirmationModal.js +1 -1
  96. package/dist/Overlay/CopyTooltip/OcCopyTooltip.js +1 -1
  97. package/dist/Overlay/Dropdown/OcDropdown.js +1 -1
  98. package/dist/Overlay/Modal/OcModal.js +1 -1
  99. package/dist/Overlay/Popper/OcPopper.js +1 -1
  100. package/dist/Overlay/SupportMenu/OcSupportMenu.js +1 -1
  101. package/dist/Overlay/Tooltip/OcTooltip.js +1 -1
  102. package/dist/Overlay/Whitelist/OcWhiteList.js +1 -1
  103. package/dist/{SubPlanCard-C0pdZDFH.js → SubPlanCard-D2KV2oyp.js} +10 -10
  104. package/dist/Theme/OcTheme.js +1 -1
  105. package/dist/{ThumbnailSection-DCtZ3L0d.js → ThumbnailSection-CrhX8foY.js} +3 -3
  106. package/dist/{ThumbnailTheme-D6DHAV4e.js → ThumbnailTheme-BruIU94I.js} +9 -6
  107. package/dist/core.css +1 -0
  108. package/dist/{index-D56G3Bj-.js → index-DXe75YkV.js} +3133 -2954
  109. package/dist/index.js +45 -44
  110. package/package.json +1 -1
  111. package/dist/OcCropper-Cbzvk6Ph.js +0 -229
  112. package/dist/OcDataTable-nlEGD3qN.js +0 -578
  113. package/dist/OcFilterSearch-dI25vfNj.js +0 -69
  114. package/dist/OcModalCropper-C2YCtiyL.js +0 -46
  115. package/dist/OcToggle-bIJaLDMZ.js +0 -53
  116. package/dist/style.css +0 -1
@@ -0,0 +1,554 @@
1
+ import { ref as $, onMounted as Ue, createBlock as j, 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, renderSlot as P, createSlots as il, normalizeProps as Pe, guardReactiveProps as je } from "vue";
2
+ import { az as Ke, B as Ie, C as rl, K as nl, Z as dl, aK as vl, aL as cl, aM as ml, H as fl, I as Le, j as pl } from "./index-DXe75YkV.js";
3
+ import { useDataTable as yl } from "./DataTable/useDataTable.js";
4
+ import { VueDraggableNext as Ae } from "vue-draggable-next";
5
+ import { getFromLocalStorage as Te, formatHeadersFromLocalStorage as qe, formatHeadersToLocalStorage as gl, setInLocalStorage as bl } from "./DataTable/utils/editColumnsUtils.js";
6
+ import { _ as Be } from "./OcIcon-CBf___w1.js";
7
+ import { formatFilterDisplay as kl, clearAllFilters as hl } from "./DataTable/utils/filterUtils.js";
8
+ import { formatCustomItemsPerPageOptions as xl, getItemsPerPageOptions as wl } from "./DataTable/utils/paginationUtils.js";
9
+ import "dayjs";
10
+ const Sl = { class: "p-5 gap-y-4 text-sm flex w-[250px] flex-col" }, $l = {
11
+ key: 0,
12
+ class: "gap-y-2 flex flex-col border-b pb-3 border-oc-gray-200"
13
+ }, Ol = { class: "gap-y-2 flex flex-col" }, Vl = {
14
+ key: 0,
15
+ class: "flex items-center bg-white justify-between h-[26px]"
16
+ }, Fl = { class: "flex items-center w-full gap-x-3" }, Dl = { class: "truncate w-full max-w-[160px]" }, El = {
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: (L) => L.to.dataset.activeHeaders ? !0 : !!L.draggedContext.futureIndex,
45
+ "onUpdate:modelValue": () => I()
46
+ }, I = (L = !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: L
54
+ });
55
+ };
56
+ return Ue(() => {
57
+ const L = Te(s.localKey), { fixed: u, active: v } = qe(L, s.headers, s.localKey);
58
+ d.value = u || s.headers.slice(0, 1), g.value = v || s.headers.slice(1).map((E) => {
59
+ var ee, le, ae;
60
+ return {
61
+ ...E,
62
+ isActive: ((ae = (le = (ee = s.options) == null ? void 0 : ee.active) == null ? void 0 : le.find((ue) => ue.key === E.key)) == null ? void 0 : ae.isActive) ?? !0
63
+ };
64
+ }), I(!0);
65
+ }), (L, u) => (r(), j(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", Sl, [
73
+ d.value.length ? (r(), h("div", $l, [
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, E) => (r(), h("div", {
82
+ key: v.key,
83
+ class: ve(["flex items-center justify-between h-[26px]", E ? "" : "is-disabled"])
84
+ }, [
85
+ Q("span", null, Ce(v.label), 1),
86
+ E ? (r(), j(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", Ol, [
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", Vl, [
110
+ Q("div", Fl, [
111
+ A(i(rl), {
112
+ modelValue: v.isActive,
113
+ "onUpdate:modelValue": [
114
+ (E) => v.isActive = E,
115
+ u[1] || (u[1] = (E) => I())
116
+ ],
117
+ class: "!w-fit"
118
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
119
+ Q("div", Dl, Ce(v.label), 1)
120
+ ]),
121
+ g.value.length > 1 ? (r(), j(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(Ie), {
138
+ label: "Edit Column",
139
+ "left-icon": "setting",
140
+ variant: "secondary"
141
+ })
142
+ ]),
143
+ _: 1
144
+ }, 8, ["modelValue"]));
145
+ }
146
+ }, Cl = { class: "relative flex flex-col gap-9" }, Pl = {
147
+ key: 0,
148
+ class: "flex items-center px-4 min-h-[52px]"
149
+ }, jl = {
150
+ key: 0,
151
+ class: "absolute flex items-center gap-5 left-5"
152
+ }, Ll = {
153
+ key: 1,
154
+ class: "absolute flex gap-3 left-5"
155
+ }, Al = {
156
+ key: 1,
157
+ class: "flex justify-center w-full gap-5 md:justify-start"
158
+ }, Bl = {
159
+ key: 2,
160
+ class: "items-center hidden md:flex"
161
+ }, Ml = {
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
+ }), I = S(() => s.localDb !== void 0), {
218
+ localData: L,
219
+ paginationData: u,
220
+ isLoading: v,
221
+ // Methods
222
+ bulkPutLocalData: E,
223
+ bulkDeleteLocalData: ee,
224
+ getLocalDataUpdatedAt: le,
225
+ getLocalDataIds: ae,
226
+ syncLocalData: ue,
227
+ sortByData: N,
228
+ // Setters
229
+ setFilter: Qe,
230
+ setSortBy: Re
231
+ } = yl({
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
+ I.value || (u.value = e);
242
+ }, { deep: !0, immediate: !0 }), I.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 I.value && (e.fields = L.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 xl((e = s.options) == null ? void 0 : e.perPageOptions);
272
+ }
273
+ ), Ze = S(() => wl(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(() => kl(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, C, 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 = (C = a.value) == null ? void 0 : C.columnEdit) == null ? void 0 : F.key].active = l, K.value = [...e, ...l], !n) {
288
+ const T = gl(e, l);
289
+ bl(a.value.columnEdit.localStorageKey, T);
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 = Te(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 = hl(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, C, F, T, 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 = (C = a.value.search) == null ? void 0 : C.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[((T = o.value) == null ? void 0 : T.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(), g("on-table-ready");
338
+ });
339
+ const ie = S(() => s.isLoading || v.value);
340
+ se({
341
+ paginationData: u,
342
+ tableIsLoading: ie,
343
+ bulkPutLocalData: E,
344
+ bulkDeleteLocalData: ee,
345
+ getLocalDataUpdatedAt: le,
346
+ getLocalDataIds: ae,
347
+ syncLocalData: ue,
348
+ sortByData: N
349
+ });
350
+ const sl = ({ key: e, value: l }) => {
351
+ Object.keys(N.value).forEach((n) => {
352
+ n !== e && (N.value[n] = null);
353
+ }), N.value[e] = l, g("update:sort-by", N.value);
354
+ };
355
+ return (e, l) => {
356
+ var n, f, p, c;
357
+ return r(), h("div", Cl, [
358
+ ce.value ? (r(), j(i(nl), {
359
+ key: 0,
360
+ selected: D.selected,
361
+ "row-key": D.rowKey,
362
+ options: ce.value,
363
+ "is-loading": ie.value,
364
+ "loading-rows": z.value,
365
+ "row-class": D.rowClass,
366
+ "row-link": D.rowLink,
367
+ "is-sticky": O.value.isSticky,
368
+ "is-borderless": O.value.isBorderless,
369
+ "sort-by": D.sortBy,
370
+ "onUpdate:selected": l[8] || (l[8] = (t) => e.$emit("update:selected", t)),
371
+ "onUpdate:sortBy": sl,
372
+ "onClick:row": l[9] || (l[9] = (t) => e.$emit("click:row", t)),
373
+ "onHover:cell": l[10] || (l[10] = (t) => e.$emit("hover:cell", t))
374
+ }, il({
375
+ after: w(() => [
376
+ P(e.$slots, "after")
377
+ ]),
378
+ empty: w(() => [
379
+ P(e.$slots, "empty")
380
+ ]),
381
+ "table-header": w((t) => [
382
+ P(e.$slots, "table-header", Pe(je(t)))
383
+ ]),
384
+ "table-body": w((t) => [
385
+ P(e.$slots, "table-body", Pe(je(t)))
386
+ ]),
387
+ _: 2
388
+ }, [
389
+ e.$slots.before || (n = a.value) != null && n.search || (f = a.value) != null && f.form || (p = a.value) != null && p.tabs ? {
390
+ name: "before",
391
+ fn: w(() => {
392
+ var t, b, x, C;
393
+ return [
394
+ P(e.$slots, "before"),
395
+ (t = a.value) != null && t.search || (b = a.value) != null && b.form || (x = a.value) != null && x.tabs ? (r(), h("div", Pl, [
396
+ Ge.value ? (r(), h("div", jl, [
397
+ P(e.$slots, "bulk-actions", { selectedRows: D.selected })
398
+ ])) : (r(), h("div", Ll, [
399
+ (C = a.value) != null && C.tabs ? (r(), j(i(dl), {
400
+ key: 0,
401
+ modelValue: B.value,
402
+ "onUpdate:modelValue": [
403
+ l[0] || (l[0] = (F) => B.value = F),
404
+ l[1] || (l[1] = (F) => V(null, !1, "", !1, !0))
405
+ ],
406
+ "is-disabled": ie.value,
407
+ tabs: a.value.tabs.options,
408
+ variant: "pills"
409
+ }, null, 8, ["modelValue", "is-disabled", "tabs"])) : y("", !0)
410
+ ])),
411
+ P(e.$slots, "filter-options", {}, () => {
412
+ var F, T, G, H, J, W, X, Y, _, k, q;
413
+ return [
414
+ (F = a.value) != null && F.search || (T = a.value) != null && T.form || (G = a.value) != null && G.columnEdit ? (r(), h("div", {
415
+ key: 0,
416
+ class: ve([
417
+ "flex gap-3 absolute ml-auto bg-oc-bg-light right-4 max-w-[calc(100%-24px)]",
418
+ a.value ? fe.value ? "md:w-fit w-full" : "" : "w-full justify-end"
419
+ ])
420
+ }, [
421
+ (H = a.value) != null && H.search ? (r(), j(i(vl), {
422
+ key: 0,
423
+ "is-search-only": !a.value.tabs || a.value.isSearchOnly,
424
+ "search-options": ((J = a.value.search) == null ? void 0 : J.options) ?? [],
425
+ "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",
426
+ onAddQuery: He,
427
+ onToggle: l[2] || (l[2] = (m) => fe.value = m),
428
+ onChangeSearchKey: el
429
+ }, null, 8, ["is-search-only", "search-options", "selected-option"])) : y("", !0),
430
+ (k = a.value) != null && k.form ? (r(), j(i(Ke), {
431
+ key: 1,
432
+ modelValue: R.value,
433
+ "onUpdate:modelValue": [
434
+ l[6] || (l[6] = (m) => R.value = m),
435
+ l[7] || (l[7] = (m) => e.$emit("filter-open", m))
436
+ ],
437
+ distance: 9,
438
+ placement: "bottom-end",
439
+ "is-attach-to-body": ""
440
+ }, {
441
+ menu: w(() => [
442
+ R.value ? (r(), j(i(cl), {
443
+ key: 0,
444
+ id: D.id,
445
+ "json-form": a.value.form ?? [],
446
+ grid: a.value.grid ?? null,
447
+ values: s.filter,
448
+ actions: a.value.actions,
449
+ onApplyFilter: l[3] || (l[3] = (m) => V(m)),
450
+ onFilterFieldsChanged: l[4] || (l[4] = (m) => g("filter-fields-changed", m)),
451
+ onCancel: l[5] || (l[5] = (m) => R.value = !1)
452
+ }, {
453
+ default: w(({ errors: m, values: te, jsonForm: ol, updateForm: ul }) => [
454
+ P(e.$slots, "custom-filter-form", {
455
+ errors: m,
456
+ values: te,
457
+ jsonForm: ol,
458
+ updateFilter: ul
459
+ })
460
+ ]),
461
+ _: 3
462
+ }, 8, ["id", "json-form", "grid", "values", "actions"])) : y("", !0)
463
+ ]),
464
+ default: w(() => [
465
+ A(i(Ie), {
466
+ "is-active": R.value,
467
+ variant: "secondary",
468
+ "left-icon": "filter"
469
+ }, null, 8, ["is-active"])
470
+ ]),
471
+ _: 3
472
+ }, 8, ["modelValue"])) : y("", !0),
473
+ a.value.columnEdit ? (r(), j(El, {
474
+ key: 2,
475
+ options: o.value.columnEdit,
476
+ headers: ((q = O.value) == null ? void 0 : q.headers) || [],
477
+ "local-key": a.value.columnEdit.localStorageKey,
478
+ onUpdateOrder: Ye
479
+ }, null, 8, ["options", "headers", "local-key"])) : y("", !0)
480
+ ], 2)) : y("", !0)
481
+ ];
482
+ })
483
+ ])) : y("", !0),
484
+ A(i(ml), {
485
+ filters: We.value,
486
+ queries: U.value,
487
+ class: "border-t border-oc-gray-200",
488
+ onRemoveQuery: Je,
489
+ onRemoveAll: ll,
490
+ onRemoveFilter: tl
491
+ }, null, 8, ["filters", "queries"])
492
+ ];
493
+ }),
494
+ key: "0"
495
+ } : void 0,
496
+ de((c = O.value) == null ? void 0 : c.headers, (t, b) => ({
497
+ name: t.key,
498
+ fn: w(({ data: x, item: C }) => [
499
+ P(e.$slots, t.key, {
500
+ data: x,
501
+ item: C
502
+ })
503
+ ])
504
+ }))
505
+ ]), 1032, ["selected", "row-key", "options", "is-loading", "loading-rows", "row-class", "row-link", "is-sticky", "is-borderless", "sort-by"])) : y("", !0),
506
+ P(e.$slots, "before-pagination"),
507
+ i(u) || d.value ? (r(), h("div", {
508
+ key: 1,
509
+ class: ve(["flex items-center gap-3", i(u) && i(u).last_page === 1 ? "justify-end" : ""])
510
+ }, [
511
+ i(u) && !Ne.value ? (r(), j(i(fl), {
512
+ key: 0,
513
+ modelValue: M.value,
514
+ "onUpdate:modelValue": [
515
+ l[11] || (l[11] = (t) => M.value = t),
516
+ al
517
+ ],
518
+ class: "justify-center",
519
+ "max-page": i(u).last_page,
520
+ strategy: i(u).strategy,
521
+ "total-visible": "5"
522
+ }, null, 8, ["modelValue", "max-page", "strategy"])) : y("", !0),
523
+ d.value ? (r(), h("div", Al, [
524
+ A(i(Le), {
525
+ disabled: !d.value.prev,
526
+ onClick: l[12] || (l[12] = (t) => d.value.prev ? V(null, !1, d.value.prev) : null)
527
+ }, null, 8, ["disabled"]),
528
+ A(i(Le), {
529
+ disabled: !d.value.next,
530
+ "is-next": "",
531
+ onClick: l[13] || (l[13] = (t) => d.value.next ? V(null, !1, d.value.next) : null)
532
+ }, null, 8, ["disabled"])
533
+ ])) : y("", !0),
534
+ ze.value ? y("", !0) : (r(), h("div", Bl, [
535
+ A(i(pl), {
536
+ modelValue: z.value,
537
+ "onUpdate:modelValue": [
538
+ l[14] || (l[14] = (t) => z.value = t),
539
+ l[15] || (l[15] = (t) => V(null))
540
+ ],
541
+ label: "Item per page",
542
+ "is-inline-label": "",
543
+ "popper-options": { placement: "auto" },
544
+ options: Ze.value
545
+ }, null, 8, ["modelValue", "options"])
546
+ ]))
547
+ ], 2)) : y("", !0)
548
+ ]);
549
+ };
550
+ }
551
+ };
552
+ export {
553
+ Ml as default
554
+ };
@@ -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 })