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