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