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