@orchidui/core 1.6.1-6 → 1.6.1-61
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/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 +3 -3
- 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 +3 -3
- package/dist/Elements/PageTitle/OcPageTitle.js +2 -2
- 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/VerificationOption/OcVerificationOption.js +2 -2
- 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 +15 -16
- package/dist/FormBuilder/OcFormBuilder.js +1 -1
- package/dist/MediaAndIcons/Avatar/OcAvatar.js +1 -1
- package/dist/{OcAccountSetupProgress-BRlNWsJO.js → OcAccountSetupProgress-BAbzm12H.js} +1 -1
- package/dist/{OcAvatar-NDXQiZvz.js → OcAvatar-DeVm4Ck5.js} +1 -1
- package/dist/{OcComplexCalendar-B480ptES.js → OcComplexCalendar-D8UFugnW.js} +1 -1
- package/dist/{OcComplexDatePicker-xNk_UqtQ.js → OcComplexDatePicker-D5PHC41n.js} +3 -3
- package/dist/{OcCropper-CXnxFeRW.js → OcCropper-Rmi8dsYC.js} +1 -1
- package/dist/OcDataTable-F5zPma-L.js +548 -0
- package/dist/OcDraggableList-DBrcJOCN.js +165 -0
- package/dist/{OcEmojiPicker-DES3wDzc.js → OcEmojiPicker-D-tKRR6h.js} +1 -1
- package/dist/{OcFilterForm-Dv7Vd6bW.js → OcFilterForm-C2exd07e.js} +1 -1
- package/dist/{OcFilterSearch-BirJ67oE.js → OcFilterSearch-D3QdDWBq.js} +1 -1
- package/dist/{OcFilterSearchFor-DPcYD3OH.js → OcFilterSearchFor-CURoj0qY.js} +1 -1
- package/dist/{OcModalCropper-CZPAlA6C.js → OcModalCropper-Bw5b9lDF.js} +4 -4
- package/dist/{OcPopper-C11OgQAj.js → OcPopper-D0VfWOBI.js} +1 -1
- package/dist/{OcTimePicker-B_mrqHyy.js → OcTimePicker-C6f8oM2H.js} +2 -2
- 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/Popper/OcPopper.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-CoP1PU8q.js → SubPlanCard-B69HTrgx.js} +1 -1
- package/dist/{ThumbnailSection-Ddxet2Op.js → ThumbnailSection-D0DvTOVy.js} +1 -1
- package/dist/{ThumbnailTheme-BStJB-bg.js → ThumbnailTheme-Bc992Vhm.js} +14 -14
- package/dist/{index-DQOVy14W.js → index-B9D_1E8q.js} +2244 -2068
- package/dist/index.js +54 -55
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/OcDataTable-D6h-IZiv.js +0 -571
- package/dist/OcDraggableList-Dzu_JKTz.js +0 -158
- package/dist/OcSlider-DW9x8eas.js +0 -123
@@ -0,0 +1,548 @@
|
|
1
|
+
import { ref as S, onMounted as Je, openBlock as r, createBlock as U, unref as m, withCtx as O, createElementVNode as z, createElementBlock as E, createVNode as B, mergeProps as Ee, Fragment as H, renderList as le, normalizeClass as ae, toDisplayString as Oe, createCommentVNode as w, computed as D, createSlots as _e, renderSlot as C, normalizeProps as je, guardReactiveProps as Fe } from "vue";
|
2
|
+
import { ay as Pe, b as Ze, B as Ce, L as Ge, Z as We, aJ as Xe, aK as He, aL as el, I as ll, J as Ae, k as al } from "./index-B9D_1E8q.js";
|
3
|
+
import ee from "dayjs";
|
4
|
+
import { VueDraggableNext as De } from "vue-draggable-next";
|
5
|
+
import { _ as Se } from "./OcIcon-CJgBICxh.js";
|
6
|
+
const tl = { class: "p-5 gap-y-4 text-sm flex w-[250px] flex-col" }, sl = {
|
7
|
+
key: 0,
|
8
|
+
class: "gap-y-2 flex flex-col border-b pb-3 border-oc-gray-200"
|
9
|
+
}, ul = { class: "gap-y-2 flex flex-col" }, ol = {
|
10
|
+
key: 0,
|
11
|
+
class: "flex items-center bg-white justify-between h-[26px]"
|
12
|
+
}, il = { class: "flex items-center w-full gap-x-3" }, rl = { class: "truncate w-full max-w-[160px]" }, nl = {
|
13
|
+
__name: "ColumnEdit",
|
14
|
+
props: {
|
15
|
+
options: {
|
16
|
+
type: Object,
|
17
|
+
default: () => ({})
|
18
|
+
},
|
19
|
+
headers: {
|
20
|
+
type: Array,
|
21
|
+
default: () => []
|
22
|
+
},
|
23
|
+
localKey: {
|
24
|
+
type: String,
|
25
|
+
default: ""
|
26
|
+
}
|
27
|
+
},
|
28
|
+
emits: ["change-active", "onMoved", "update-order"],
|
29
|
+
setup(F, { emit: X }) {
|
30
|
+
const f = X, Y = F, v = S([]), p = S([]), a = S(!1), _ = () => {
|
31
|
+
p.value = p.value.map(($) => ({
|
32
|
+
...$,
|
33
|
+
isActive: !0
|
34
|
+
})), f("update-order", {
|
35
|
+
fixedHeaders: p.value,
|
36
|
+
activeHeaders: v.value
|
37
|
+
// isOnMount
|
38
|
+
});
|
39
|
+
}, G = {
|
40
|
+
handle: ".drag-el",
|
41
|
+
filter: ".is-disabled",
|
42
|
+
group: "headers",
|
43
|
+
animation: 500,
|
44
|
+
forceFallback: !1,
|
45
|
+
move: ($) => $.to.dataset.activeHeaders ? !0 : !!$.draggedContext.futureIndex,
|
46
|
+
"onUpdate:modelValue": () => _()
|
47
|
+
};
|
48
|
+
return Je(() => {
|
49
|
+
p.value = Y.headers.slice(0, 1), v.value = Y.headers.slice(1).map(($) => {
|
50
|
+
var o, n, k;
|
51
|
+
return {
|
52
|
+
...$,
|
53
|
+
isActive: ((k = (n = (o = Y.options) == null ? void 0 : o.active) == null ? void 0 : n.find((W) => W.key === $.key)) == null ? void 0 : k.isActive) ?? !0
|
54
|
+
};
|
55
|
+
}), _();
|
56
|
+
}), ($, o) => (r(), U(m(Pe), {
|
57
|
+
modelValue: a.value,
|
58
|
+
"onUpdate:modelValue": o[3] || (o[3] = (n) => a.value = n),
|
59
|
+
class: "h-[36px]",
|
60
|
+
"is-attach-to-body": ""
|
61
|
+
}, {
|
62
|
+
menu: O(() => [
|
63
|
+
z("div", tl, [
|
64
|
+
p.value.length ? (r(), E("div", sl, [
|
65
|
+
o[4] || (o[4] = z("span", { class: "text-oc-text-400 font-medium" }, "Fixed columns", -1)),
|
66
|
+
B(m(De), Ee({
|
67
|
+
key: "key",
|
68
|
+
modelValue: p.value,
|
69
|
+
"onUpdate:modelValue": o[0] || (o[0] = (n) => p.value = n)
|
70
|
+
}, G), {
|
71
|
+
default: O(() => [
|
72
|
+
(r(!0), E(H, null, le(p.value, (n, k) => (r(), E("div", {
|
73
|
+
key: n.key,
|
74
|
+
class: ae(["flex items-center justify-between h-[26px]", k ? "" : "is-disabled"])
|
75
|
+
}, [
|
76
|
+
z("span", null, Oe(n.label), 1),
|
77
|
+
k ? (r(), U(m(Se), {
|
78
|
+
key: 0,
|
79
|
+
width: "18",
|
80
|
+
height: "18",
|
81
|
+
class: "text-oc-text-400 drag-el cursor-move",
|
82
|
+
name: "draggable"
|
83
|
+
})) : w("", !0)
|
84
|
+
], 2))), 128))
|
85
|
+
]),
|
86
|
+
_: 1
|
87
|
+
}, 16, ["modelValue"])
|
88
|
+
])) : w("", !0),
|
89
|
+
z("div", ul, [
|
90
|
+
o[5] || (o[5] = z("span", { class: "text-oc-text-400 font-medium" }, "Active columns", -1)),
|
91
|
+
B(m(De), Ee({
|
92
|
+
key: "key",
|
93
|
+
modelValue: v.value,
|
94
|
+
"onUpdate:modelValue": o[2] || (o[2] = (n) => v.value = n)
|
95
|
+
}, G, { "data-active-headers": "true" }), {
|
96
|
+
default: O(() => [
|
97
|
+
(r(!0), E(H, null, le(v.value, (n) => (r(), E(H, {
|
98
|
+
key: n.key
|
99
|
+
}, [
|
100
|
+
n.key !== "actions" ? (r(), E("div", ol, [
|
101
|
+
z("div", il, [
|
102
|
+
B(m(Ze), {
|
103
|
+
modelValue: n.isActive,
|
104
|
+
"onUpdate:modelValue": [
|
105
|
+
(k) => n.isActive = k,
|
106
|
+
o[1] || (o[1] = (k) => _())
|
107
|
+
],
|
108
|
+
class: "!w-fit"
|
109
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
110
|
+
z("div", rl, Oe(n.label), 1)
|
111
|
+
]),
|
112
|
+
v.value.length > 1 ? (r(), U(m(Se), {
|
113
|
+
key: 0,
|
114
|
+
width: "18",
|
115
|
+
height: "18",
|
116
|
+
class: "text-oc-text-400 drag-el cursor-move",
|
117
|
+
name: "draggable"
|
118
|
+
})) : w("", !0)
|
119
|
+
])) : w("", !0)
|
120
|
+
], 64))), 128))
|
121
|
+
]),
|
122
|
+
_: 1
|
123
|
+
}, 16, ["modelValue"])
|
124
|
+
])
|
125
|
+
])
|
126
|
+
]),
|
127
|
+
default: O(() => [
|
128
|
+
B(m(Ce), {
|
129
|
+
label: "Edit Column",
|
130
|
+
"left-icon": "setting",
|
131
|
+
variant: "secondary"
|
132
|
+
})
|
133
|
+
]),
|
134
|
+
_: 1
|
135
|
+
}, 8, ["modelValue"]));
|
136
|
+
}
|
137
|
+
}, dl = { class: "relative flex flex-col gap-9" }, vl = {
|
138
|
+
key: 0,
|
139
|
+
class: "flex items-center px-4 min-h-[52px]"
|
140
|
+
}, fl = {
|
141
|
+
key: 0,
|
142
|
+
class: "absolute flex items-center gap-5 left-5"
|
143
|
+
}, pl = {
|
144
|
+
key: 1,
|
145
|
+
class: "absolute flex gap-3 left-5"
|
146
|
+
}, cl = {
|
147
|
+
key: 1,
|
148
|
+
class: "flex justify-center w-full gap-5 md:justify-start"
|
149
|
+
}, ml = {
|
150
|
+
key: 2,
|
151
|
+
class: "items-center hidden md:flex"
|
152
|
+
}, xl = {
|
153
|
+
__name: "OcDataTable",
|
154
|
+
props: {
|
155
|
+
isLoading: Boolean,
|
156
|
+
id: {
|
157
|
+
type: String,
|
158
|
+
required: !0
|
159
|
+
},
|
160
|
+
options: {
|
161
|
+
type: Object,
|
162
|
+
required: !0
|
163
|
+
},
|
164
|
+
filter: {
|
165
|
+
type: Object,
|
166
|
+
required: !0
|
167
|
+
},
|
168
|
+
columns: {
|
169
|
+
type: Object
|
170
|
+
},
|
171
|
+
selected: {
|
172
|
+
type: Array,
|
173
|
+
required: !1
|
174
|
+
},
|
175
|
+
rowClass: String,
|
176
|
+
rowKey: {
|
177
|
+
type: String,
|
178
|
+
Function,
|
179
|
+
default: "id"
|
180
|
+
},
|
181
|
+
rowLink: String
|
182
|
+
},
|
183
|
+
emits: {
|
184
|
+
"update:selected": [],
|
185
|
+
"update:filter": [],
|
186
|
+
"click:row": [],
|
187
|
+
"filter-fields-changed": [],
|
188
|
+
"filter-removed": [],
|
189
|
+
"search-query-changed": [],
|
190
|
+
"hover:cell": [],
|
191
|
+
"columns-changed": []
|
192
|
+
},
|
193
|
+
setup(F, { emit: X }) {
|
194
|
+
var ue, oe, ie, re, ne, de, ve, fe, pe, ce, me, ye, ge, be, ke, he, xe, we, $e;
|
195
|
+
const f = F, Y = X, v = D(() => {
|
196
|
+
var l;
|
197
|
+
return (l = f.options) == null ? void 0 : l.pagination;
|
198
|
+
}), p = D(() => {
|
199
|
+
var l;
|
200
|
+
return (l = f.options) == null ? void 0 : l.cursor;
|
201
|
+
}), a = D(() => {
|
202
|
+
var l;
|
203
|
+
return (l = f.options) == null ? void 0 : l.filterOptions;
|
204
|
+
}), _ = D(() => {
|
205
|
+
var l;
|
206
|
+
return (l = f.options) == null ? void 0 : l.hidePerPageDropdown;
|
207
|
+
}), G = D(() => {
|
208
|
+
var l;
|
209
|
+
return ((l = v.value) == null ? void 0 : l.last_page) === 1;
|
210
|
+
}), $ = S(!1), o = S(f.filter[(oe = (ue = a.value) == null ? void 0 : ue.tabs) == null ? void 0 : oe.key]), n = S(f.filter.page), k = S(
|
211
|
+
(re = (ie = a.value) == null ? void 0 : ie.per_page) != null && re.key ? f.filter[(de = (ne = a.value) == null ? void 0 : ne.per_page) == null ? void 0 : de.key] : f.filter.per_page
|
212
|
+
), W = ((pe = f.filter[(fe = (ve = a.value) == null ? void 0 : ve.search) == null ? void 0 : fe.key]) == null ? void 0 : pe.trim()) ?? "", Q = S(W ? W.split(",") : []), te = S(!1), R = f.filter;
|
213
|
+
!R && v ? R.page = f.filter.page ?? 1 : !R && p && (R.cursor = f.filter.cursor ?? "");
|
214
|
+
const t = S(R), J = S([]);
|
215
|
+
(ye = t.value[(me = (ce = a.value) == null ? void 0 : ce.columnEdit) == null ? void 0 : me.key]) != null && ye.fixed && (J.value = [...t.value[(be = (ge = a.value) == null ? void 0 : ge.columnEdit) == null ? void 0 : be.key].fixed]), (xe = t.value[(he = (ke = a.value) == null ? void 0 : ke.columnEdit) == null ? void 0 : he.key]) != null && xe.active && (J.value = [...J.value, ...t.value[($e = (we = a.value) == null ? void 0 : we.columnEdit) == null ? void 0 : $e.key].active]);
|
216
|
+
const M = D(() => {
|
217
|
+
var l;
|
218
|
+
return (l = f.options) == null ? void 0 : l.tableOptions;
|
219
|
+
}), Ue = D(() => {
|
220
|
+
var l;
|
221
|
+
return {
|
222
|
+
...M.value,
|
223
|
+
headers: J.value ? J.value.map((e) => {
|
224
|
+
var u, d;
|
225
|
+
return e.class = ((d = (u = M.value) == null ? void 0 : u.headers.find((c) => c.key === e.key)) == null ? void 0 : d.class) ?? "", e;
|
226
|
+
}).filter((e) => se(e.key)) : (l = M.value) == null ? void 0 : l.headers.filter((e) => se(e.key))
|
227
|
+
};
|
228
|
+
}), Ye = D(
|
229
|
+
() => {
|
230
|
+
var l, e;
|
231
|
+
return (e = (l = f.options) == null ? void 0 : l.perPageOptions) == null ? void 0 : e.map(
|
232
|
+
(u) => ({
|
233
|
+
label: `${u}`,
|
234
|
+
value: u
|
235
|
+
})
|
236
|
+
);
|
237
|
+
}
|
238
|
+
), Le = D(() => {
|
239
|
+
let l = [
|
240
|
+
{
|
241
|
+
label: "10",
|
242
|
+
value: 10
|
243
|
+
},
|
244
|
+
{
|
245
|
+
label: "15",
|
246
|
+
value: 15
|
247
|
+
},
|
248
|
+
{
|
249
|
+
label: "20",
|
250
|
+
value: 20
|
251
|
+
},
|
252
|
+
{
|
253
|
+
label: "25",
|
254
|
+
value: 25
|
255
|
+
},
|
256
|
+
{
|
257
|
+
label: "40",
|
258
|
+
value: 40
|
259
|
+
},
|
260
|
+
{
|
261
|
+
label: "50",
|
262
|
+
value: 50
|
263
|
+
},
|
264
|
+
{
|
265
|
+
label: "75",
|
266
|
+
value: 75
|
267
|
+
},
|
268
|
+
{
|
269
|
+
label: "99",
|
270
|
+
value: 99
|
271
|
+
}
|
272
|
+
], e = Ye.value ?? l;
|
273
|
+
if (v.value) {
|
274
|
+
const u = v.value.total < 100 ? v.value.total : 100;
|
275
|
+
u > 10 && (e = e.filter((d) => d.value <= u));
|
276
|
+
}
|
277
|
+
return [...new Set(e)];
|
278
|
+
}), Be = D(() => {
|
279
|
+
var l;
|
280
|
+
return ((l = f.selected) == null ? void 0 : l.length) > 0;
|
281
|
+
}), Me = (l) => {
|
282
|
+
!l.trim() || Q.value.includes(l) || (Q.value = [l], j(), Y("search-query-changed", l));
|
283
|
+
}, Ke = (l) => {
|
284
|
+
Q.value = Q.value.filter((e) => e !== l), j();
|
285
|
+
}, Ne = () => {
|
286
|
+
var e, u, d, c, y, s, g, h, b, V, K, N, T, q;
|
287
|
+
Q.value = [], o.value = "";
|
288
|
+
const l = {};
|
289
|
+
a.value ? R.page = 1 : R.cursor = "", (u = (e = a.value) == null ? void 0 : e.per_page) != null && u.key ? l[(c = (d = a.value) == null ? void 0 : d.per_page) == null ? void 0 : c.key] = k.value : l.per_page = k.value, (s = (y = a.value) == null ? void 0 : y.tabs) != null && s.key ? l[(h = (g = a.value) == null ? void 0 : g.tabs) == null ? void 0 : h.key] = o.value : l.tabs = o.value, (V = (b = a.value) == null ? void 0 : b.columnEdit) != null && V.key && (l[(N = (K = a.value) == null ? void 0 : K.columnEdit) == null ? void 0 : N.key] = t.value[(q = (T = a.value) == null ? void 0 : T.columnEdit) == null ? void 0 : q.key]), t.value = l, j();
|
290
|
+
}, Te = () => {
|
291
|
+
j(null, n.value);
|
292
|
+
}, j = (l = null, e = !1, u = "") => {
|
293
|
+
var c, y, s, g, h;
|
294
|
+
v.value && !e && (n.value = 1), v.value ? t.value.page = n.value : t.value.cursor = u, (c = a.value) != null && c.per_page ? t.value[a.value.per_page.key] = k.value : t.value.per_page = k.value, (y = a.value) != null && y.tabs && (t.value[a.value.tabs.key] = o.value), (s = a.value) != null && s.search && (t.value[a.value.search.key] = Q.value.join()), l && ($.value = !1, t.value = { ...t.value, ...l }, Object.keys(t.value).forEach((b) => {
|
295
|
+
Array.isArray(t.value[b]) && t.value[b].length === 0 && delete t.value[b];
|
296
|
+
}));
|
297
|
+
let d = (h = (g = a.value) == null ? void 0 : g.tabs) == null ? void 0 : h.key;
|
298
|
+
if (d && o.value !== t.value[d])
|
299
|
+
return o.value = t.value[d], j(t.value), !1;
|
300
|
+
Y("update:filter", t.value);
|
301
|
+
}, qe = (l, e) => {
|
302
|
+
(e === a.value.tabs.key || e === "tabs") && (o.value = ""), j(l), Y("filter-removed", e);
|
303
|
+
}, Ie = (l) => {
|
304
|
+
let e = [];
|
305
|
+
return l.forEach((u) => {
|
306
|
+
e.push(u.key);
|
307
|
+
}), e;
|
308
|
+
}, Qe = D(() => {
|
309
|
+
if (t.value) {
|
310
|
+
let l = [];
|
311
|
+
return Object.keys(t.value).forEach((e) => {
|
312
|
+
var y, s, g, h, b, V, K, N, T, q, Z;
|
313
|
+
let u = (s = (y = a.value) == null ? void 0 : y.tabs) == null ? void 0 : s.key;
|
314
|
+
const d = (h = (g = a.value) == null ? void 0 : g.search) == null ? void 0 : h.key, c = ((V = (b = a.value) == null ? void 0 : b.per_page) == null ? void 0 : V.key) ?? "per_page";
|
315
|
+
if ((K = a.value.form) == null || K.find((x) => {
|
316
|
+
x.name === u && (u = "");
|
317
|
+
}), e !== "page" && e !== "cursor" && e !== c && e !== u && e !== d) {
|
318
|
+
let x = null, i = (N = a.value.form) == null ? void 0 : N.find((L) => {
|
319
|
+
if (typeof L.name == "object") {
|
320
|
+
let P = !1;
|
321
|
+
return L.name.forEach((I) => {
|
322
|
+
I.key === e && (P = !0, x = Ie(L.name));
|
323
|
+
}), P;
|
324
|
+
} else
|
325
|
+
return L.name === e;
|
326
|
+
}), A = "";
|
327
|
+
if (i && t.value[e]) {
|
328
|
+
if (typeof i.name == "object" ? (T = i.name) == null || T.forEach((P) => {
|
329
|
+
A && (A += " - "), A += t.value[P.key];
|
330
|
+
}) : A = t.value[e], i.props.options && (A = (i.props.multiple ? t.value[e] : [t.value[e]]).map(
|
331
|
+
(I) => {
|
332
|
+
var Ve;
|
333
|
+
return (Ve = i.props.options.find(({ value: ze }) => ze === I)) == null ? void 0 : Ve.label;
|
334
|
+
}
|
335
|
+
).join(", ")), i.type === "RangeInput" && Array.isArray(t.value[e]) && (A = t.value[e][0].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + " - " + t.value[e][1].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")), i.type === "DatePicker")
|
336
|
+
if (((q = i == null ? void 0 : i.props) == null ? void 0 : q.type) === "range" && i.name && i.name[1]) {
|
337
|
+
const P = ee(t.value[i.name[0].key]).format("MM/DD/YYYY"), I = ee(t.value[i.name[1].key]).format("MM/DD/YYYY");
|
338
|
+
A = P === I ? P : P + " - " + I;
|
339
|
+
} else A = ee(t.value[i.name]).format("MM/DD/YYYY");
|
340
|
+
let L = `${(Z = i == null ? void 0 : i.props) == null ? void 0 : Z.label} : ${A}`;
|
341
|
+
i && i.name && typeof i.name == "object" && l.find((I) => I.name === x[0]) && (L = ""), l.push({
|
342
|
+
label: L,
|
343
|
+
name: e,
|
344
|
+
multiNames: x
|
345
|
+
});
|
346
|
+
}
|
347
|
+
}
|
348
|
+
}), l;
|
349
|
+
}
|
350
|
+
return [];
|
351
|
+
}), se = (l) => {
|
352
|
+
var e, u, d, c, y, s;
|
353
|
+
return ((s = (y = (c = (d = t.value) == null ? void 0 : d[(u = (e = a.value) == null ? void 0 : e.columnEdit) == null ? void 0 : u.key]) == null ? void 0 : c.active) == null ? void 0 : y.find((g) => g.key === l)) == null ? void 0 : s.isActive) ?? !0;
|
354
|
+
}, Re = ({ fixedHeaders: l, activeHeaders: e, isOnMount: u }) => {
|
355
|
+
var d, c, y, s, g, h, b, V;
|
356
|
+
t.value[(c = (d = a.value) == null ? void 0 : d.columnEdit) == null ? void 0 : c.key] || (t.value[(s = (y = a.value) == null ? void 0 : y.columnEdit) == null ? void 0 : s.key] = {}), t.value[(h = (g = a.value) == null ? void 0 : g.columnEdit) == null ? void 0 : h.key].fixed = l, t.value[(V = (b = a.value) == null ? void 0 : b.columnEdit) == null ? void 0 : V.key].active = e, J.value = [...l, ...e], j(), Y("columns-changed", e);
|
357
|
+
};
|
358
|
+
return (l, e) => {
|
359
|
+
var u, d, c, y;
|
360
|
+
return r(), E("div", dl, [
|
361
|
+
M.value ? (r(), U(m(Ge), {
|
362
|
+
key: 0,
|
363
|
+
selected: F.selected,
|
364
|
+
"row-key": F.rowKey,
|
365
|
+
options: Ue.value,
|
366
|
+
"is-loading": F.isLoading,
|
367
|
+
"loading-rows": k.value,
|
368
|
+
"row-class": F.rowClass,
|
369
|
+
"row-link": F.rowLink,
|
370
|
+
"is-sticky": M.value.isSticky,
|
371
|
+
"is-borderless": M.value.isBorderless,
|
372
|
+
"onUpdate:selected": e[7] || (e[7] = (s) => l.$emit("update:selected", s)),
|
373
|
+
"onClick:row": e[8] || (e[8] = (s) => l.$emit("click:row", s)),
|
374
|
+
"onHover:cell": e[9] || (e[9] = (s) => l.$emit("hover:cell", s))
|
375
|
+
}, _e({
|
376
|
+
after: O(() => [
|
377
|
+
C(l.$slots, "after")
|
378
|
+
]),
|
379
|
+
empty: O(() => [
|
380
|
+
C(l.$slots, "empty")
|
381
|
+
]),
|
382
|
+
"table-header": O((s) => [
|
383
|
+
C(l.$slots, "table-header", je(Fe(s)))
|
384
|
+
]),
|
385
|
+
"table-body": O((s) => [
|
386
|
+
C(l.$slots, "table-body", je(Fe(s)))
|
387
|
+
]),
|
388
|
+
_: 2
|
389
|
+
}, [
|
390
|
+
l.$slots.before || (u = a.value) != null && u.search || (d = a.value) != null && d.form || (c = a.value) != null && c.tabs ? {
|
391
|
+
name: "before",
|
392
|
+
fn: O(() => {
|
393
|
+
var s, g, h, b;
|
394
|
+
return [
|
395
|
+
C(l.$slots, "before"),
|
396
|
+
(s = a.value) != null && s.search || (g = a.value) != null && g.form || (h = a.value) != null && h.tabs ? (r(), E("div", vl, [
|
397
|
+
Be.value ? (r(), E("div", fl, [
|
398
|
+
C(l.$slots, "bulk-actions", { selectedRows: F.selected })
|
399
|
+
])) : (r(), E("div", pl, [
|
400
|
+
(b = a.value) != null && b.tabs ? (r(), U(m(We), {
|
401
|
+
key: 0,
|
402
|
+
modelValue: o.value,
|
403
|
+
"onUpdate:modelValue": [
|
404
|
+
e[0] || (e[0] = (V) => o.value = V),
|
405
|
+
e[1] || (e[1] = (V) => j(null))
|
406
|
+
],
|
407
|
+
"is-disabled": F.isLoading,
|
408
|
+
tabs: a.value.tabs.options,
|
409
|
+
variant: "pills"
|
410
|
+
}, null, 8, ["modelValue", "is-disabled", "tabs"])) : w("", !0)
|
411
|
+
])),
|
412
|
+
C(l.$slots, "filter-options", {}, () => {
|
413
|
+
var V, K, N, T, q, Z;
|
414
|
+
return [
|
415
|
+
(V = a.value) != null && V.search || (K = a.value) != null && K.form || (N = a.value) != null && N.columnEdit ? (r(), E("div", {
|
416
|
+
key: 0,
|
417
|
+
class: ae([
|
418
|
+
"flex gap-3 absolute ml-auto bg-oc-bg-light right-4 max-w-[calc(100%-24px)]",
|
419
|
+
a.value ? te.value ? "md:w-fit w-full" : "" : "w-full justify-end"
|
420
|
+
])
|
421
|
+
}, [
|
422
|
+
(T = a.value) != null && T.search ? (r(), U(m(Xe), {
|
423
|
+
key: 0,
|
424
|
+
"is-search-only": !a.value.tabs || a.value.isSearchOnly,
|
425
|
+
onAddQuery: Me,
|
426
|
+
onToggle: e[2] || (e[2] = (x) => te.value = x)
|
427
|
+
}, null, 8, ["is-search-only"])) : w("", !0),
|
428
|
+
(q = a.value) != null && q.form ? (r(), U(m(Pe), {
|
429
|
+
key: 1,
|
430
|
+
modelValue: $.value,
|
431
|
+
"onUpdate:modelValue": e[6] || (e[6] = (x) => $.value = x),
|
432
|
+
distance: 9,
|
433
|
+
placement: "bottom-end",
|
434
|
+
"is-attach-to-body": ""
|
435
|
+
}, {
|
436
|
+
menu: O(() => [
|
437
|
+
$.value ? (r(), U(m(He), {
|
438
|
+
key: 0,
|
439
|
+
id: F.id,
|
440
|
+
"json-form": a.value.form ?? [],
|
441
|
+
grid: a.value.grid ?? null,
|
442
|
+
values: f.filter,
|
443
|
+
actions: a.value.actions,
|
444
|
+
onApplyFilter: e[3] || (e[3] = (x) => j(x)),
|
445
|
+
onFilterFieldsChanged: e[4] || (e[4] = (x) => Y("filter-fields-changed", x)),
|
446
|
+
onCancel: e[5] || (e[5] = (x) => $.value = !1)
|
447
|
+
}, {
|
448
|
+
default: O(({ errors: x, values: i, jsonForm: A, updateForm: L }) => [
|
449
|
+
C(l.$slots, "custom-filter-form", {
|
450
|
+
errors: x,
|
451
|
+
values: i,
|
452
|
+
jsonForm: A,
|
453
|
+
updateFilter: L
|
454
|
+
})
|
455
|
+
]),
|
456
|
+
_: 3
|
457
|
+
}, 8, ["id", "json-form", "grid", "values", "actions"])) : w("", !0)
|
458
|
+
]),
|
459
|
+
default: O(() => [
|
460
|
+
B(m(Ce), {
|
461
|
+
"is-active": $.value,
|
462
|
+
variant: "secondary",
|
463
|
+
"left-icon": "filter"
|
464
|
+
}, null, 8, ["is-active"])
|
465
|
+
]),
|
466
|
+
_: 3
|
467
|
+
}, 8, ["modelValue"])) : w("", !0),
|
468
|
+
a.value.columnEdit ? (r(), U(nl, {
|
469
|
+
key: 2,
|
470
|
+
options: t.value.columnEdit,
|
471
|
+
headers: ((Z = M.value) == null ? void 0 : Z.headers) || [],
|
472
|
+
onUpdateOrder: Re
|
473
|
+
}, null, 8, ["options", "headers"])) : w("", !0)
|
474
|
+
], 2)) : w("", !0)
|
475
|
+
];
|
476
|
+
})
|
477
|
+
])) : w("", !0),
|
478
|
+
B(m(el), {
|
479
|
+
filters: Qe.value,
|
480
|
+
queries: Q.value,
|
481
|
+
class: "border-t border-oc-gray-200",
|
482
|
+
onRemoveQuery: Ke,
|
483
|
+
onRemoveAll: Ne,
|
484
|
+
onRemoveFilter: qe
|
485
|
+
}, null, 8, ["filters", "queries"])
|
486
|
+
];
|
487
|
+
}),
|
488
|
+
key: "0"
|
489
|
+
} : void 0,
|
490
|
+
le((y = M.value) == null ? void 0 : y.headers, (s, g) => ({
|
491
|
+
name: s.key,
|
492
|
+
fn: O(({ data: h, item: b }) => [
|
493
|
+
C(l.$slots, s.key, {
|
494
|
+
data: h,
|
495
|
+
item: b
|
496
|
+
})
|
497
|
+
])
|
498
|
+
}))
|
499
|
+
]), 1032, ["selected", "row-key", "options", "is-loading", "loading-rows", "row-class", "row-link", "is-sticky", "is-borderless"])) : w("", !0),
|
500
|
+
C(l.$slots, "before-pagination"),
|
501
|
+
v.value || p.value ? (r(), E("div", {
|
502
|
+
key: 1,
|
503
|
+
class: ae(["flex items-center gap-3", v.value && v.value.last_page === 1 ? "justify-end" : ""])
|
504
|
+
}, [
|
505
|
+
v.value && !G.value ? (r(), U(m(ll), {
|
506
|
+
key: 0,
|
507
|
+
modelValue: n.value,
|
508
|
+
"onUpdate:modelValue": [
|
509
|
+
e[10] || (e[10] = (s) => n.value = s),
|
510
|
+
Te
|
511
|
+
],
|
512
|
+
class: "justify-center",
|
513
|
+
"max-page": v.value.last_page,
|
514
|
+
strategy: v.value.strategy,
|
515
|
+
"total-visible": "5"
|
516
|
+
}, null, 8, ["modelValue", "max-page", "strategy"])) : w("", !0),
|
517
|
+
p.value ? (r(), E("div", cl, [
|
518
|
+
B(m(Ae), {
|
519
|
+
disabled: !p.value.prev,
|
520
|
+
onClick: e[11] || (e[11] = (s) => p.value.prev ? j(null, !1, p.value.prev) : null)
|
521
|
+
}, null, 8, ["disabled"]),
|
522
|
+
B(m(Ae), {
|
523
|
+
disabled: !p.value.next,
|
524
|
+
"is-next": "",
|
525
|
+
onClick: e[12] || (e[12] = (s) => p.value.next ? j(null, !1, p.value.next) : null)
|
526
|
+
}, null, 8, ["disabled"])
|
527
|
+
])) : w("", !0),
|
528
|
+
_.value ? w("", !0) : (r(), E("div", ml, [
|
529
|
+
B(m(al), {
|
530
|
+
modelValue: k.value,
|
531
|
+
"onUpdate:modelValue": [
|
532
|
+
e[13] || (e[13] = (s) => k.value = s),
|
533
|
+
e[14] || (e[14] = (s) => j(null))
|
534
|
+
],
|
535
|
+
label: "Item per page",
|
536
|
+
"is-inline-label": "",
|
537
|
+
"popper-options": { placement: "auto" },
|
538
|
+
options: Le.value
|
539
|
+
}, null, 8, ["modelValue", "options"])
|
540
|
+
]))
|
541
|
+
], 2)) : w("", !0)
|
542
|
+
]);
|
543
|
+
};
|
544
|
+
}
|
545
|
+
};
|
546
|
+
export {
|
547
|
+
xl as default
|
548
|
+
};
|