@orchidui/core 1.8.1-12 → 1.8.1-121

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-DBUjKmbS.js → OcAccountSetupProgress-DYhvsDxL.js} +4 -4
  72. package/dist/{OcAvatar-DeVm4Ck5.js → OcAvatar-WGEX8Wio.js} +4 -4
  73. package/dist/{OcComplexCalendar-BQOvxiNy.js → OcComplexCalendar-d6naQZTs.js} +6 -6
  74. package/dist/{OcComplexDatePicker-X__G-u7c.js → OcComplexDatePicker-LI5hiyvV.js} +5 -5
  75. package/dist/OcCropper-YFTz01Vk.js +253 -0
  76. package/dist/OcDataTable-CggFfla8.js +547 -0
  77. package/dist/{OcDraggable-CA_BCbpl.js → OcDraggable-DRsp4j4e.js} +5 -4
  78. package/dist/{OcDraggableList-CiCHdh93.js → OcDraggableList-Cek-0KDt.js} +50 -47
  79. package/dist/{OcEmojiPicker-CSBFI2s4.js → OcEmojiPicker-D8D7uW5N.js} +17 -15
  80. package/dist/{OcFilterForm-CAXk0zFE.js → OcFilterForm-Bo_O-7yh.js} +22 -24
  81. package/dist/OcFilterSearch-4Ra6PJji.js +112 -0
  82. package/dist/{OcFilterSearchFor-C955CkTR.js → OcFilterSearchFor-B6d6z79P.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-yzTi3OwR.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--ZdSOXOu.js → OcTimePicker-R3zI86PW.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-BYPXvNTe.js → SubPlanCard-DVyHMof3.js} +10 -10
  105. package/dist/Theme/OcTheme.js +1 -1
  106. package/dist/{ThumbnailSection-BU31G7lZ.js → ThumbnailSection-WikG4mUl.js} +3 -3
  107. package/dist/{ThumbnailTheme-B18-8jNQ.js → ThumbnailTheme-BzIpkHxZ.js} +9 -6
  108. package/dist/core.css +1 -0
  109. package/dist/{index-cNRxdNfs.js → index-BgkXygOb.js} +2918 -2780
  110. package/dist/index.js +45 -44
  111. package/package.json +1 -1
  112. package/dist/OcCropper-eE6xVBW2.js +0 -229
  113. package/dist/OcDataTable-DIQ18i8q.js +0 -578
  114. package/dist/OcFilterSearch-D4qr22qu.js +0 -69
  115. package/dist/OcModalCropper-D2VeDV1X.js +0 -46
  116. package/dist/OcToggle-bIJaLDMZ.js +0 -53
  117. package/dist/style.css +0 -1
@@ -0,0 +1,547 @@
1
+ import { ref as F, onMounted as Ke, createBlock as P, openBlock as i, unref as r, withCtx as S, createVNode as K, createElementVNode as Q, createElementBlock as k, createCommentVNode as g, mergeProps as De, Fragment as re, renderList as ne, normalizeClass as de, toDisplayString as Le, computed as $, watch as ie, renderSlot as C, createSlots as rl, normalizeProps as Ee, guardReactiveProps as Ce } from "vue";
2
+ import { az as Ue, B as Te, C as il, K as nl, Z as dl, aK as vl, aL as cl, aM as ml, H as pl, I as Pe, j as fl } from "./index-BgkXygOb.js";
3
+ import { useDataTable as yl } from "./DataTable/useDataTable.js";
4
+ import { VueDraggableNext as je } from "vue-draggable-next";
5
+ import { getFromLocalStorage as Be, formatHeadersFromLocalStorage as Ie, formatHeadersToLocalStorage as gl, setInLocalStorage as bl } from "./DataTable/utils/editColumnsUtils.js";
6
+ import { _ as Ae } 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 Sl } from "./DataTable/utils/paginationUtils.js";
9
+ import { getFilterFromLocalStorage as wl, saveFilterToLocalStorage as $l } from "./DataTable/utils/storageUtils.js";
10
+ import "dayjs";
11
+ const Fl = { class: "p-5 gap-y-4 text-sm flex w-[250px] flex-col" }, Ol = {
12
+ key: 0,
13
+ class: "gap-y-2 flex flex-col border-b pb-3 border-oc-gray-200"
14
+ }, Vl = { class: "gap-y-2 flex flex-col" }, Dl = {
15
+ key: 0,
16
+ class: "flex items-center bg-white justify-between h-[26px]"
17
+ }, Ll = { class: "flex items-center w-full gap-x-3" }, El = { class: "truncate w-full max-w-[160px]" }, Cl = {
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(j, { emit: te }) {
39
+ const oe = te, s = j, h = F([]), m = F([]), T = F(!1), O = {
40
+ handle: ".drag-el",
41
+ filter: ".is-disabled",
42
+ group: "headers",
43
+ animation: 500,
44
+ forceFallback: !1,
45
+ move: (A) => A.to.dataset.activeHeaders ? !0 : !!A.draggedContext.futureIndex,
46
+ "onUpdate:modelValue": () => B()
47
+ }, B = (A = !1) => {
48
+ m.value = m.value.map((u) => ({
49
+ ...u,
50
+ isActive: !0
51
+ })), oe("update-order", {
52
+ fixedHeaders: m.value,
53
+ activeHeaders: h.value,
54
+ isOnMount: A
55
+ });
56
+ };
57
+ return Ke(() => {
58
+ const A = Be(s.localKey), { fixed: u, active: p } = Ie(A, s.headers, s.localKey);
59
+ m.value = u || s.headers.slice(0, 1), h.value = p || s.headers.slice(1).map((D) => {
60
+ var _, ee, le;
61
+ return {
62
+ ...D,
63
+ isActive: ((le = (ee = (_ = s.options) == null ? void 0 : _.active) == null ? void 0 : ee.find((se) => se.key === D.key)) == null ? void 0 : le.isActive) ?? !0
64
+ };
65
+ }), B(!0);
66
+ }), (A, u) => (i(), P(r(Ue), {
67
+ modelValue: T.value,
68
+ "onUpdate:modelValue": u[3] || (u[3] = (p) => T.value = p),
69
+ class: "h-[36px]",
70
+ "is-attach-to-body": ""
71
+ }, {
72
+ menu: S(() => [
73
+ Q("div", Fl, [
74
+ m.value.length ? (i(), k("div", Ol, [
75
+ u[4] || (u[4] = Q("span", { class: "text-oc-text-400 font-medium" }, "Fixed columns", -1)),
76
+ K(r(je), De({
77
+ key: "key",
78
+ modelValue: m.value,
79
+ "onUpdate:modelValue": u[0] || (u[0] = (p) => m.value = p)
80
+ }, O), {
81
+ default: S(() => [
82
+ (i(!0), k(re, null, ne(m.value, (p, D) => (i(), k("div", {
83
+ key: p.key,
84
+ class: de(["flex items-center justify-between h-[26px]", D ? "" : "is-disabled"])
85
+ }, [
86
+ Q("span", null, Le(p.label), 1),
87
+ D ? (i(), P(r(Ae), {
88
+ key: 0,
89
+ width: "18",
90
+ height: "18",
91
+ class: "text-oc-text-400 drag-el cursor-move",
92
+ name: "draggable"
93
+ })) : g("", !0)
94
+ ], 2))), 128))
95
+ ]),
96
+ _: 1
97
+ }, 16, ["modelValue"])
98
+ ])) : g("", !0),
99
+ Q("div", Vl, [
100
+ u[5] || (u[5] = Q("span", { class: "text-oc-text-400 font-medium" }, "Active columns", -1)),
101
+ K(r(je), De({
102
+ key: "key",
103
+ modelValue: h.value,
104
+ "onUpdate:modelValue": u[2] || (u[2] = (p) => h.value = p)
105
+ }, O, { "data-active-headers": "true" }), {
106
+ default: S(() => [
107
+ (i(!0), k(re, null, ne(h.value, (p) => (i(), k(re, {
108
+ key: p.key
109
+ }, [
110
+ p.key !== "actions" ? (i(), k("div", Dl, [
111
+ Q("div", Ll, [
112
+ K(r(il), {
113
+ modelValue: p.isActive,
114
+ "onUpdate:modelValue": [
115
+ (D) => p.isActive = D,
116
+ u[1] || (u[1] = (D) => B())
117
+ ],
118
+ class: "!w-fit"
119
+ }, null, 8, ["modelValue", "onUpdate:modelValue"]),
120
+ Q("div", El, Le(p.label), 1)
121
+ ]),
122
+ h.value.length > 1 ? (i(), P(r(Ae), {
123
+ key: 0,
124
+ width: "18",
125
+ height: "18",
126
+ class: "text-oc-text-400 drag-el cursor-move",
127
+ name: "draggable"
128
+ })) : g("", !0)
129
+ ])) : g("", !0)
130
+ ], 64))), 128))
131
+ ]),
132
+ _: 1
133
+ }, 16, ["modelValue"])
134
+ ])
135
+ ])
136
+ ]),
137
+ default: S(() => [
138
+ K(r(Te), {
139
+ label: "Edit Column",
140
+ "left-icon": "setting",
141
+ variant: "secondary"
142
+ })
143
+ ]),
144
+ _: 1
145
+ }, 8, ["modelValue"]));
146
+ }
147
+ }, Pl = { class: "relative flex flex-col gap-9" }, jl = {
148
+ key: 0,
149
+ class: "flex items-center px-4 min-h-[52px]"
150
+ }, Al = {
151
+ key: 0,
152
+ class: "absolute flex items-center gap-5 left-5"
153
+ }, Kl = {
154
+ key: 1,
155
+ class: "absolute flex gap-3 left-5"
156
+ }, Ul = {
157
+ key: 1,
158
+ class: "flex justify-center w-full gap-5 md:justify-start"
159
+ }, Tl = {
160
+ key: 2,
161
+ class: "items-center hidden md:flex"
162
+ }, Gl = {
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
+ "on-table-ready": []
204
+ },
205
+ setup(j, { expose: te, emit: oe }) {
206
+ var ye, ge, be, ke, he, xe, Se, we, $e, Fe, Oe, Ve;
207
+ const s = j, h = oe, m = $(() => {
208
+ var e;
209
+ return (e = s.options) == null ? void 0 : e.cursor;
210
+ }), T = F(), O = $(() => {
211
+ var e;
212
+ return (e = s.options) == null ? void 0 : e.tableOptions;
213
+ }), B = $(() => s.localDb !== void 0), {
214
+ localData: A,
215
+ paginationData: u,
216
+ isLoading: p,
217
+ // Methods
218
+ bulkPutLocalData: D,
219
+ bulkDeleteLocalData: _,
220
+ getLocalDataUpdatedAt: ee,
221
+ getLocalDataIds: le,
222
+ syncLocalData: se,
223
+ sortByData: qe,
224
+ // toggleSort,
225
+ // Setters
226
+ setFilter: Qe,
227
+ setSortBy: Ne
228
+ } = yl({
229
+ name: (ye = s.localDb) == null ? void 0 : ye.table_name,
230
+ localDb: (ge = s.localDb) == null ? void 0 : ge.db,
231
+ options: (be = s.localDb) == null ? void 0 : be.options
232
+ });
233
+ ie(() => {
234
+ var e;
235
+ return (e = s.options) == null ? void 0 : e.pagination;
236
+ }, (e) => {
237
+ B.value || (u.value = e);
238
+ }, { deep: !0, immediate: !0 }), B.value && (ie(() => s.filter, () => {
239
+ Qe(s.filter);
240
+ }, { deep: !0, immediate: !0 }), ie(() => s.sortBy, () => {
241
+ Ne(s.sortBy);
242
+ }, { deep: !0, immediate: !0 }));
243
+ const ve = $(() => {
244
+ var l;
245
+ const e = {
246
+ ...O.value,
247
+ headers: T.value ? T.value.map((n) => {
248
+ var v, c;
249
+ return n.class = ((c = (v = O.value) == null ? void 0 : v.headers.find((d) => d.key === n.key)) == null ? void 0 : c.class) ?? "", n;
250
+ }).filter((n) => n.isActive) : (l = O.value) == null ? void 0 : l.headers.filter((n) => We(n.key))
251
+ };
252
+ return B.value && (e.fields = A.value), e;
253
+ }), a = $(() => {
254
+ var e;
255
+ return (e = s.options) == null ? void 0 : e.filterOptions;
256
+ }), Re = $(() => {
257
+ var e;
258
+ return (e = s.options) == null ? void 0 : e.hidePerPageDropdown;
259
+ }), ze = $(() => {
260
+ var e;
261
+ return ((e = u.value) == null ? void 0 : e.last_page) === 1;
262
+ }), N = F(!1), L = F(s.filter[(he = (ke = a.value) == null ? void 0 : ke.tabs) == null ? void 0 : he.key]), R = F(s.filter.page), z = F(
263
+ (Se = (xe = a.value) == null ? void 0 : xe.per_page) != null && Se.key ? s.filter[($e = (we = a.value) == null ? void 0 : we.per_page) == null ? void 0 : $e.key] : s.filter.per_page
264
+ ), ce = ((Ve = s.filter[(Oe = (Fe = a.value) == null ? void 0 : Fe.search) == null ? void 0 : Oe.key]) == null ? void 0 : Ve.trim()) ?? "", U = F(ce ? ce.split(",") : []), me = F(!1), Me = $(
265
+ () => {
266
+ var e;
267
+ return xl((e = s.options) == null ? void 0 : e.perPageOptions);
268
+ }
269
+ ), Je = $(() => Sl(Me.value, u.value)), Ze = $(() => {
270
+ var e;
271
+ return ((e = s.selected) == null ? void 0 : e.length) > 0;
272
+ }), pe = (e) => {
273
+ !e.trim() || !t.value.selectedSearchOption && U.value.includes(e) || (U.value = [e], w(), h("search-query-changed", e));
274
+ }, Ge = (e) => {
275
+ U.value = U.value.filter((l) => l !== e), w();
276
+ }, M = s.filter;
277
+ !M && u.value ? M.page = 1 : !M && m && (M.cursor = "");
278
+ const t = F(M), He = $(() => kl(t.value, a.value)), We = (e) => {
279
+ var l, n, v, c, d, o;
280
+ return ((o = (d = (c = (v = t.value) == null ? void 0 : v[(n = (l = a.value) == null ? void 0 : l.columnEdit) == null ? void 0 : n.key]) == null ? void 0 : c.active) == null ? void 0 : d.find((f) => f.key === e)) == null ? void 0 : o.isActive) ?? !0;
281
+ }, Xe = ({ fixedHeaders: e, activeHeaders: l, isOnMount: n }) => {
282
+ var v, c, d, o, f, x, E, V;
283
+ if (t.value[(c = (v = a.value) == null ? void 0 : v.columnEdit) == null ? void 0 : c.key] || (t.value[(o = (d = a.value) == null ? void 0 : d.columnEdit) == null ? void 0 : o.key] = {}), t.value[(x = (f = a.value) == null ? void 0 : f.columnEdit) == null ? void 0 : x.key].fixed = e, t.value[(V = (E = a.value) == null ? void 0 : E.columnEdit) == null ? void 0 : V.key].active = l, T.value = [...e, ...l], !n) {
284
+ const I = gl(e, l);
285
+ bl(a.value.columnEdit.localStorageKey, I);
286
+ }
287
+ h("columns-changed", l);
288
+ }, Ye = () => {
289
+ var e, l, n, v, c, d;
290
+ if ((l = (e = a.value) == null ? void 0 : e.columnEdit) != null && l.localStorageKey) {
291
+ const o = Be(a.value.columnEdit.localStorageKey);
292
+ if (o) {
293
+ const { fixed: f, active: x } = Ie(
294
+ o,
295
+ O.value.headers,
296
+ a.value.columnEdit.localStorageKey
297
+ );
298
+ t.value[(v = (n = a.value) == null ? void 0 : n.columnEdit) == null ? void 0 : v.key].fixed = f, t.value[(d = (c = a.value) == null ? void 0 : c.columnEdit) == null ? void 0 : d.key].active = x, T.value = [...f, ...x];
299
+ }
300
+ }
301
+ }, _e = (e) => {
302
+ t.value.selectedSearchOption = e;
303
+ }, el = () => {
304
+ U.value = [], L.value = "", t.value = hl(t.value, a.value, z.value, L.value), w();
305
+ }, ll = () => {
306
+ w(null, R.value);
307
+ }, al = () => {
308
+ $l(s.id, t.value);
309
+ }, tl = () => wl(s.id), fe = F(null), w = (e = null, l = !1, n = "", v = !1, c = !1) => {
310
+ var o, f, x, E, V, I, J, Z, G, H, W, X, Y;
311
+ u.value && !l && (R.value = 1), u.value ? t.value.page = R.value : t.value.cursor = n, (o = a.value) != null && o.per_page ? t.value[a.value.per_page.key] = z.value : t.value.per_page = z.value, (f = a.value) != null && f.tabs && c && (t.value[a.value.tabs.key] = L.value), (x = a.value) != null && x.search && ((V = (E = a.value.search) == null ? void 0 : E.options) != null && V.length ? (Object.keys(t.value).forEach((b) => {
312
+ var q;
313
+ (q = a.value.search.options) != null && q.map((y) => y.value).includes(b) && delete t.value[b];
314
+ }), t.value[((I = t.value) == null ? void 0 : I.selectedSearchOption) || ((G = (Z = (J = a.value.search) == null ? void 0 : J.options) == null ? void 0 : Z[0]) == null ? void 0 : G.value) || a.value.search.key] = U.value.join()) : t.value[a.value.search.key] = U.value.join()), e && (N.value = !1, t.value = { ...t.value, ...e }, Object.keys(t.value).forEach((b) => {
315
+ Array.isArray(t.value[b]) && t.value[b].length === 0 && delete t.value[b];
316
+ }));
317
+ let d = (W = (H = a.value) == null ? void 0 : H.tabs) == null ? void 0 : W.key;
318
+ if (d && L.value !== t.value[d]) {
319
+ const b = (Y = (X = a.value.tabs) == null ? void 0 : X.options) == null ? void 0 : Y.find(
320
+ (q) => {
321
+ var y, ae;
322
+ return ((y = q.value) == null ? void 0 : y.toString()) === ((ae = t.value[d]) == null ? void 0 : ae.toString());
323
+ }
324
+ );
325
+ if (b != null && b.value)
326
+ return L.value = b.value, w(), !1;
327
+ }
328
+ al(), clearTimeout(fe.value), fe.value = setTimeout(() => {
329
+ h("update:filter", t.value, v);
330
+ }, 100);
331
+ }, ol = (e, l) => {
332
+ (l === a.value.tabs.key || l === "tabs") && (L.value = ""), w(e), h("filter-removed", l);
333
+ };
334
+ Ke(() => {
335
+ var l, n, v, c, d, o, f;
336
+ Ye();
337
+ const e = tl();
338
+ e && (t.value = JSON.parse(e), L.value = L.value || ((l = t.value) == null ? void 0 : l.tabs) || ((c = t.value) == null ? void 0 : c[(v = (n = a.value) == null ? void 0 : n.tabs) == null ? void 0 : v.key]), (d = t.value) != null && d.selectedSearchOption && pe(t.value[(o = t.value) == null ? void 0 : o.selectedSearchOption]), R.value = ((f = t.value) == null ? void 0 : f.page) || 1, w(null, !0, t.value.cursor, !0)), h("on-table-ready");
339
+ });
340
+ const ue = $(() => s.isLoading || p.value);
341
+ return te({
342
+ paginationData: u,
343
+ tableIsLoading: ue,
344
+ bulkPutLocalData: D,
345
+ bulkDeleteLocalData: _,
346
+ getLocalDataUpdatedAt: ee,
347
+ getLocalDataIds: le,
348
+ syncLocalData: se,
349
+ sortByData: qe
350
+ }), (e, l) => {
351
+ var n, v, c, d;
352
+ return i(), k("div", Pl, [
353
+ ve.value ? (i(), P(r(nl), {
354
+ key: 0,
355
+ selected: j.selected,
356
+ "row-key": j.rowKey,
357
+ options: ve.value,
358
+ "is-loading": ue.value,
359
+ "loading-rows": z.value,
360
+ "row-class": j.rowClass,
361
+ "row-link": j.rowLink,
362
+ "is-sticky": O.value.isSticky,
363
+ "is-borderless": O.value.isBorderless,
364
+ "onUpdate:selected": l[8] || (l[8] = (o) => e.$emit("update:selected", o)),
365
+ "onClick:row": l[9] || (l[9] = (o) => e.$emit("click:row", o)),
366
+ "onHover:cell": l[10] || (l[10] = (o) => e.$emit("hover:cell", o))
367
+ }, rl({
368
+ after: S(() => [
369
+ C(e.$slots, "after")
370
+ ]),
371
+ empty: S(() => [
372
+ C(e.$slots, "empty")
373
+ ]),
374
+ "table-header": S((o) => [
375
+ C(e.$slots, "table-header", Ee(Ce(o)))
376
+ ]),
377
+ "table-body": S((o) => [
378
+ C(e.$slots, "table-body", Ee(Ce(o)))
379
+ ]),
380
+ _: 2
381
+ }, [
382
+ e.$slots.before || (n = a.value) != null && n.search || (v = a.value) != null && v.form || (c = a.value) != null && c.tabs ? {
383
+ name: "before",
384
+ fn: S(() => {
385
+ var o, f, x, E;
386
+ return [
387
+ C(e.$slots, "before"),
388
+ (o = a.value) != null && o.search || (f = a.value) != null && f.form || (x = a.value) != null && x.tabs ? (i(), k("div", jl, [
389
+ Ze.value ? (i(), k("div", Al, [
390
+ C(e.$slots, "bulk-actions", { selectedRows: j.selected })
391
+ ])) : (i(), k("div", Kl, [
392
+ (E = a.value) != null && E.tabs ? (i(), P(r(dl), {
393
+ key: 0,
394
+ modelValue: L.value,
395
+ "onUpdate:modelValue": [
396
+ l[0] || (l[0] = (V) => L.value = V),
397
+ l[1] || (l[1] = (V) => w(null, !1, "", !1, !0))
398
+ ],
399
+ "is-disabled": ue.value,
400
+ tabs: a.value.tabs.options,
401
+ variant: "pills"
402
+ }, null, 8, ["modelValue", "is-disabled", "tabs"])) : g("", !0)
403
+ ])),
404
+ C(e.$slots, "filter-options", {}, () => {
405
+ var V, I, J, Z, G, H, W, X, Y, b, q;
406
+ return [
407
+ (V = a.value) != null && V.search || (I = a.value) != null && I.form || (J = a.value) != null && J.columnEdit ? (i(), k("div", {
408
+ key: 0,
409
+ class: de([
410
+ "flex gap-3 absolute ml-auto bg-oc-bg-light right-4 max-w-[calc(100%-24px)]",
411
+ a.value ? me.value ? "md:w-fit w-full" : "" : "w-full justify-end"
412
+ ])
413
+ }, [
414
+ (Z = a.value) != null && Z.search ? (i(), P(r(vl), {
415
+ key: 0,
416
+ "is-search-only": !a.value.tabs || a.value.isSearchOnly,
417
+ "search-options": ((G = a.value.search) == null ? void 0 : G.options) ?? [],
418
+ "selected-option": (((H = t.value) == null ? void 0 : H.selectedSearchOption) || ((Y = (X = (W = a.value.search) == null ? void 0 : W.options) == null ? void 0 : X[0]) == null ? void 0 : Y.value)) ?? "keywords",
419
+ onAddQuery: pe,
420
+ onToggle: l[2] || (l[2] = (y) => me.value = y),
421
+ onChangeSearchKey: _e
422
+ }, null, 8, ["is-search-only", "search-options", "selected-option"])) : g("", !0),
423
+ (b = a.value) != null && b.form ? (i(), P(r(Ue), {
424
+ key: 1,
425
+ modelValue: N.value,
426
+ "onUpdate:modelValue": [
427
+ l[6] || (l[6] = (y) => N.value = y),
428
+ l[7] || (l[7] = (y) => e.$emit("filter-open", y))
429
+ ],
430
+ distance: 9,
431
+ placement: "bottom-end",
432
+ "is-attach-to-body": ""
433
+ }, {
434
+ menu: S(() => [
435
+ N.value ? (i(), P(r(cl), {
436
+ key: 0,
437
+ id: j.id,
438
+ "json-form": a.value.form ?? [],
439
+ grid: a.value.grid ?? null,
440
+ values: s.filter,
441
+ actions: a.value.actions,
442
+ onApplyFilter: l[3] || (l[3] = (y) => w(y)),
443
+ onFilterFieldsChanged: l[4] || (l[4] = (y) => h("filter-fields-changed", y)),
444
+ onCancel: l[5] || (l[5] = (y) => N.value = !1)
445
+ }, {
446
+ default: S(({ errors: y, values: ae, jsonForm: sl, updateForm: ul }) => [
447
+ C(e.$slots, "custom-filter-form", {
448
+ errors: y,
449
+ values: ae,
450
+ jsonForm: sl,
451
+ updateFilter: ul
452
+ })
453
+ ]),
454
+ _: 3
455
+ }, 8, ["id", "json-form", "grid", "values", "actions"])) : g("", !0)
456
+ ]),
457
+ default: S(() => [
458
+ K(r(Te), {
459
+ "is-active": N.value,
460
+ variant: "secondary",
461
+ "left-icon": "filter"
462
+ }, null, 8, ["is-active"])
463
+ ]),
464
+ _: 3
465
+ }, 8, ["modelValue"])) : g("", !0),
466
+ a.value.columnEdit ? (i(), P(Cl, {
467
+ key: 2,
468
+ options: t.value.columnEdit,
469
+ headers: ((q = O.value) == null ? void 0 : q.headers) || [],
470
+ "local-key": a.value.columnEdit.localStorageKey,
471
+ onUpdateOrder: Xe
472
+ }, null, 8, ["options", "headers", "local-key"])) : g("", !0)
473
+ ], 2)) : g("", !0)
474
+ ];
475
+ })
476
+ ])) : g("", !0),
477
+ K(r(ml), {
478
+ filters: He.value,
479
+ queries: U.value,
480
+ class: "border-t border-oc-gray-200",
481
+ onRemoveQuery: Ge,
482
+ onRemoveAll: el,
483
+ onRemoveFilter: ol
484
+ }, null, 8, ["filters", "queries"])
485
+ ];
486
+ }),
487
+ key: "0"
488
+ } : void 0,
489
+ ne((d = O.value) == null ? void 0 : d.headers, (o, f) => ({
490
+ name: o.key,
491
+ fn: S(({ data: x, item: E }) => [
492
+ C(e.$slots, o.key, {
493
+ data: x,
494
+ item: E
495
+ })
496
+ ])
497
+ }))
498
+ ]), 1032, ["selected", "row-key", "options", "is-loading", "loading-rows", "row-class", "row-link", "is-sticky", "is-borderless"])) : g("", !0),
499
+ C(e.$slots, "before-pagination"),
500
+ r(u) || m.value ? (i(), k("div", {
501
+ key: 1,
502
+ class: de(["flex items-center gap-3", r(u) && r(u).last_page === 1 ? "justify-end" : ""])
503
+ }, [
504
+ r(u) && !ze.value ? (i(), P(r(pl), {
505
+ key: 0,
506
+ modelValue: R.value,
507
+ "onUpdate:modelValue": [
508
+ l[11] || (l[11] = (o) => R.value = o),
509
+ ll
510
+ ],
511
+ class: "justify-center",
512
+ "max-page": r(u).last_page,
513
+ strategy: r(u).strategy,
514
+ "total-visible": "5"
515
+ }, null, 8, ["modelValue", "max-page", "strategy"])) : g("", !0),
516
+ m.value ? (i(), k("div", Ul, [
517
+ K(r(Pe), {
518
+ disabled: !m.value.prev,
519
+ onClick: l[12] || (l[12] = (o) => m.value.prev ? w(null, !1, m.value.prev) : null)
520
+ }, null, 8, ["disabled"]),
521
+ K(r(Pe), {
522
+ disabled: !m.value.next,
523
+ "is-next": "",
524
+ onClick: l[13] || (l[13] = (o) => m.value.next ? w(null, !1, m.value.next) : null)
525
+ }, null, 8, ["disabled"])
526
+ ])) : g("", !0),
527
+ Re.value ? g("", !0) : (i(), k("div", Tl, [
528
+ K(r(fl), {
529
+ modelValue: z.value,
530
+ "onUpdate:modelValue": [
531
+ l[14] || (l[14] = (o) => z.value = o),
532
+ l[15] || (l[15] = (o) => w(null))
533
+ ],
534
+ label: "Item per page",
535
+ "is-inline-label": "",
536
+ "popper-options": { placement: "auto" },
537
+ options: Je.value
538
+ }, null, 8, ["modelValue", "options"])
539
+ ]))
540
+ ], 2)) : g("", !0)
541
+ ]);
542
+ };
543
+ }
544
+ };
545
+ export {
546
+ Gl as default
547
+ };
@@ -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 })