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