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