@orchidui/core 1.8.1-12 → 1.8.1-120
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DataDisplay/CustomerCard/OcCustomerCard.js +2 -2
- package/dist/DataDisplay/FloatContent/OcFloatContent.js +1 -1
- package/dist/DataDisplay/HorizontalProgressbar/OcHorizontalProgressbar.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/ProgressBar/OcProgressBar.js +1 -1
- package/dist/DataDisplay/Table/OcTable.js +1 -1
- package/dist/DataDisplay/TransferSummary/OcTransferSummary.js +1 -1
- package/dist/DataTable/useDataTable.js +82 -0
- package/dist/DataTable/utils/filterUtils.js +57 -0
- package/dist/DataTable/utils/paginationUtils.js +26 -0
- package/dist/DataTable/utils/storageUtils.js +11 -0
- 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/SwitchTabs/OcSwitchTabs.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/Section/OcSection.js +1 -1
- package/dist/Elements/Sidebar/OcSidebar.js +2 -2
- package/dist/Elements/Skeleton/OcSkeleton.js +1 -1
- package/dist/Elements/SubSidebar/OcSubSidebar.js +1 -1
- package/dist/Elements/TopBanner/OcTopBanner.js +4 -0
- 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/Feedback/Tag/OcTag.js +1 -1
- package/dist/Form/BaseInput/OcBaseInput.js +1 -1
- package/dist/Form/Button/OcButton.js +1 -1
- package/dist/Form/Calendar/OcCalendar.js +2 -2
- package/dist/Form/CardInput/OcCardInput.js +1 -1
- package/dist/Form/Checkbox/OcCheckbox.js +2 -2
- package/dist/Form/CheckboxesGroup/OcCheckboxesGroup.js +1 -1
- package/dist/Form/Criteria/OcCriteria.js +1 -1
- package/dist/Form/Cropper/OcCropper.js +1 -1
- package/dist/Form/DatePicker/OcDatePicker.js +1 -1
- package/dist/Form/EmojiPicker/OcEmojiPicker.js +1 -1
- package/dist/Form/Input/OcInput.js +1 -1
- package/dist/Form/LinkInput/OcLinkInput.js +2 -2
- package/dist/Form/MultipleUploadFile/OcMultipleUploadFile.js +1 -1
- package/dist/Form/NumberInput/OcNumberInput.js +1 -1
- package/dist/Form/PhoneInput/OcPhoneInput.js +2 -2
- package/dist/Form/Radio/OcRadio.js +1 -1
- package/dist/Form/RadioGroup/OcRadioGroup.js +1 -1
- package/dist/Form/RangeInput/OcRangeInput.js +1 -1
- package/dist/Form/SectionItem/OcSectionItem.js +2 -2
- package/dist/Form/Select/OcSelect.js +1 -1
- package/dist/Form/SelectOptions/OcSelectOptions.js +2 -2
- package/dist/Form/SingleFileUpload/OcSingleFileUpload.js +1 -1
- package/dist/Form/Slider/OcSlider.js +1 -1
- package/dist/Form/TextArea/OcTextArea.js +2 -2
- package/dist/Form/Toggle/OcToggle.js +1 -1
- package/dist/Form/index.js +8 -8
- package/dist/FormBuilder/OcFormBuilder.js +1 -1
- package/dist/MediaAndIcons/Avatar/OcAvatar.js +1 -1
- package/dist/MediaAndIcons/Icon/OcIcon.js +1 -1
- package/dist/{OcAccountSetupProgress-DBUjKmbS.js → OcAccountSetupProgress-Cre9F0EE.js} +4 -4
- package/dist/{OcAvatar-DeVm4Ck5.js → OcAvatar-WGEX8Wio.js} +4 -4
- package/dist/{OcComplexCalendar-BQOvxiNy.js → OcComplexCalendar-HnnUIm-D.js} +6 -6
- package/dist/{OcComplexDatePicker-X__G-u7c.js → OcComplexDatePicker-7l6w9iyo.js} +5 -5
- package/dist/OcCropper-jWbHUBSK.js +253 -0
- package/dist/OcDataTable-ClOSXtou.js +531 -0
- package/dist/{OcDraggable-CA_BCbpl.js → OcDraggable-DRsp4j4e.js} +5 -4
- package/dist/{OcDraggableList-CiCHdh93.js → OcDraggableList-wFuNk9or.js} +50 -47
- package/dist/{OcEmojiPicker-CSBFI2s4.js → OcEmojiPicker-CPem0Knl.js} +17 -15
- package/dist/{OcFilterForm-CAXk0zFE.js → OcFilterForm-GuXT2ukv.js} +22 -24
- package/dist/OcFilterSearch-jXoHxnW4.js +112 -0
- package/dist/{OcFilterSearchFor-C955CkTR.js → OcFilterSearchFor-CS27Uq_C.js} +27 -21
- package/dist/{OcHorizontalProgressbar.vue_vue_type_script_setup_true_lang-4eVgPDi5.js → OcHorizontalProgressbar.vue_vue_type_script_setup_true_lang-C-8H1oP2.js} +2 -2
- package/dist/{OcIcon-CJgBICxh.js → OcIcon-CBf___w1.js} +10 -9
- package/dist/OcModalCropper-D6OLRepK.js +52 -0
- package/dist/{OcPopper-BgjdqRiw.js → OcPopper-BSfMaOoF.js} +26 -25
- package/dist/{OcProgressBar-hiyC5XSc.js → OcProgressBar-lyqE5LZd.js} +5 -5
- package/dist/{OcSection-D_vO-DAP.js → OcSection-BjyapRr3.js} +3 -3
- package/dist/{OcSkeleton-CvdpGSQR.js → OcSkeleton-Czw65X0i.js} +2 -2
- package/dist/{OcSwitchTabs-CYp676bj.js → OcSwitchTabs-B7LfmG3z.js} +3 -3
- package/dist/{OcTag.vue_vue_type_script_setup_true_lang-D19lw-8Y.js → OcTag.vue_vue_type_script_setup_true_lang-CzJFcg8l.js} +2 -2
- package/dist/{OcTheme-CWgrJh5Q.js → OcTheme-B6NTNYtz.js} +2 -2
- package/dist/{OcTimePicker--ZdSOXOu.js → OcTimePicker-ByxVRAkG.js} +6 -6
- package/dist/{OcTimePopup-CXGhaOev.js → OcTimePopup-CrwbZ_Nx.js} +5 -5
- package/dist/OcToggle-DOfA-DZ8.js +58 -0
- package/dist/Overlay/ConfirmationModal/OcConfirmationModal.js +1 -1
- package/dist/Overlay/CopyTooltip/OcCopyTooltip.js +1 -1
- package/dist/Overlay/Dropdown/OcDropdown.js +1 -1
- package/dist/Overlay/Modal/OcModal.js +1 -1
- package/dist/Overlay/Popper/OcPopper.js +1 -1
- package/dist/Overlay/SupportMenu/OcSupportMenu.js +1 -1
- package/dist/Overlay/Tooltip/OcTooltip.js +1 -1
- package/dist/Overlay/Whitelist/OcWhiteList.js +1 -1
- package/dist/{SubPlanCard-BYPXvNTe.js → SubPlanCard-TF2dM-mY.js} +10 -10
- package/dist/Theme/OcTheme.js +1 -1
- package/dist/{ThumbnailSection-BU31G7lZ.js → ThumbnailSection-B-750B-l.js} +3 -3
- package/dist/{ThumbnailTheme-B18-8jNQ.js → ThumbnailTheme-BXWNhQ3o.js} +9 -6
- package/dist/core.css +1 -0
- package/dist/{index-cNRxdNfs.js → index-d4b7zJ2y.js} +2919 -2780
- package/dist/index.js +58 -55
- package/package.json +1 -1
- package/dist/OcCropper-eE6xVBW2.js +0 -229
- package/dist/OcDataTable-DIQ18i8q.js +0 -578
- package/dist/OcFilterSearch-D4qr22qu.js +0 -69
- package/dist/OcModalCropper-D2VeDV1X.js +0 -46
- package/dist/OcToggle-bIJaLDMZ.js +0 -53
- package/dist/style.css +0 -1
@@ -0,0 +1,531 @@
|
|
1
|
+
import { ref as O, onMounted as je, createBlock as j, openBlock as i, unref as r, withCtx as x, createVNode as T, createElementVNode as q, createElementBlock as k, createCommentVNode as g, mergeProps as Oe, Fragment as se, renderList as re, normalizeClass as ie, toDisplayString as Ve, computed as F, watch as ue, renderSlot as P, createSlots as el, normalizeProps as Ee, guardReactiveProps as Ce } from "vue";
|
2
|
+
import { az as Ae, B as Ke, C as ll, K as al, Z as tl, aK as ol, aL as sl, aM as ul, H as rl, I as De, j as il } from "./index-d4b7zJ2y.js";
|
3
|
+
import { VueDraggableNext as Le } from "vue-draggable-next";
|
4
|
+
import { getFromLocalStorage as Te, formatHeadersFromLocalStorage as Ue, formatHeadersToLocalStorage as nl, setInLocalStorage as dl } from "./DataTable/utils/editColumnsUtils.js";
|
5
|
+
import { _ as Pe } from "./OcIcon-CBf___w1.js";
|
6
|
+
import { formatFilterDisplay as vl, clearAllFilters as cl } from "./DataTable/utils/filterUtils.js";
|
7
|
+
import { formatCustomItemsPerPageOptions as ml, getItemsPerPageOptions as pl } from "./DataTable/utils/paginationUtils.js";
|
8
|
+
import { getFilterFromLocalStorage as fl, saveFilterToLocalStorage as yl } from "./DataTable/utils/storageUtils.js";
|
9
|
+
import { useDataTable as gl } from "./DataTable/useDataTable.js";
|
10
|
+
import "dayjs";
|
11
|
+
const bl = { class: "p-5 gap-y-4 text-sm flex w-[250px] flex-col" }, kl = {
|
12
|
+
key: 0,
|
13
|
+
class: "gap-y-2 flex flex-col border-b pb-3 border-oc-gray-200"
|
14
|
+
}, hl = { class: "gap-y-2 flex flex-col" }, Sl = {
|
15
|
+
key: 0,
|
16
|
+
class: "flex items-center bg-white justify-between h-[26px]"
|
17
|
+
}, xl = { class: "flex items-center w-full gap-x-3" }, wl = { class: "truncate w-full max-w-[160px]" }, $l = {
|
18
|
+
__name: "ColumnEdit",
|
19
|
+
props: {
|
20
|
+
options: {
|
21
|
+
type: Object,
|
22
|
+
default: () => ({})
|
23
|
+
},
|
24
|
+
headers: {
|
25
|
+
type: Array,
|
26
|
+
default: () => []
|
27
|
+
},
|
28
|
+
localKey: {
|
29
|
+
type: String,
|
30
|
+
default: ""
|
31
|
+
}
|
32
|
+
},
|
33
|
+
emits: [
|
34
|
+
"change-active",
|
35
|
+
"onMoved",
|
36
|
+
"update-order"
|
37
|
+
],
|
38
|
+
setup(A, { emit: te }) {
|
39
|
+
const u = te, w = A, y = O([]), h = O([]), V = O(!1), Q = {
|
40
|
+
handle: ".drag-el",
|
41
|
+
filter: ".is-disabled",
|
42
|
+
group: "headers",
|
43
|
+
animation: 500,
|
44
|
+
forceFallback: !1,
|
45
|
+
move: (K) => K.to.dataset.activeHeaders ? !0 : !!K.draggedContext.futureIndex,
|
46
|
+
"onUpdate:modelValue": () => M()
|
47
|
+
}, M = (K = !1) => {
|
48
|
+
h.value = h.value.map((m) => ({
|
49
|
+
...m,
|
50
|
+
isActive: !0
|
51
|
+
})), u("update-order", {
|
52
|
+
fixedHeaders: h.value,
|
53
|
+
activeHeaders: y.value,
|
54
|
+
isOnMount: K
|
55
|
+
});
|
56
|
+
};
|
57
|
+
return je(() => {
|
58
|
+
const K = Te(w.localKey), { fixed: m, active: s } = Ue(K, w.headers, w.localKey);
|
59
|
+
h.value = m || w.headers.slice(0, 1), y.value = s || w.headers.slice(1).map((C) => {
|
60
|
+
var J, l, le;
|
61
|
+
return {
|
62
|
+
...C,
|
63
|
+
isActive: ((le = (l = (J = w.options) == null ? void 0 : J.active) == null ? void 0 : l.find((oe) => oe.key === C.key)) == null ? void 0 : le.isActive) ?? !0
|
64
|
+
};
|
65
|
+
}), M(!0);
|
66
|
+
}), (K, m) => (i(), j(r(Ae), {
|
67
|
+
modelValue: V.value,
|
68
|
+
"onUpdate:modelValue": m[3] || (m[3] = (s) => V.value = s),
|
69
|
+
class: "h-[36px]",
|
70
|
+
"is-attach-to-body": ""
|
71
|
+
}, {
|
72
|
+
menu: x(() => [
|
73
|
+
q("div", bl, [
|
74
|
+
h.value.length ? (i(), k("div", kl, [
|
75
|
+
m[4] || (m[4] = q("span", { class: "text-oc-text-400 font-medium" }, "Fixed columns", -1)),
|
76
|
+
T(r(Le), Oe({
|
77
|
+
key: "key",
|
78
|
+
modelValue: h.value,
|
79
|
+
"onUpdate:modelValue": m[0] || (m[0] = (s) => h.value = s)
|
80
|
+
}, Q), {
|
81
|
+
default: x(() => [
|
82
|
+
(i(!0), k(se, null, re(h.value, (s, C) => (i(), k("div", {
|
83
|
+
key: s.key,
|
84
|
+
class: ie(["flex items-center justify-between h-[26px]", C ? "" : "is-disabled"])
|
85
|
+
}, [
|
86
|
+
q("span", null, Ve(s.label), 1),
|
87
|
+
C ? (i(), j(r(Pe), {
|
88
|
+
key: 0,
|
89
|
+
width: "18",
|
90
|
+
height: "18",
|
91
|
+
class: "text-oc-text-400 drag-el cursor-move",
|
92
|
+
name: "draggable"
|
93
|
+
})) : g("", !0)
|
94
|
+
], 2))), 128))
|
95
|
+
]),
|
96
|
+
_: 1
|
97
|
+
}, 16, ["modelValue"])
|
98
|
+
])) : g("", !0),
|
99
|
+
q("div", hl, [
|
100
|
+
m[5] || (m[5] = q("span", { class: "text-oc-text-400 font-medium" }, "Active columns", -1)),
|
101
|
+
T(r(Le), Oe({
|
102
|
+
key: "key",
|
103
|
+
modelValue: y.value,
|
104
|
+
"onUpdate:modelValue": m[2] || (m[2] = (s) => y.value = s)
|
105
|
+
}, Q, { "data-active-headers": "true" }), {
|
106
|
+
default: x(() => [
|
107
|
+
(i(!0), k(se, null, re(y.value, (s) => (i(), k(se, {
|
108
|
+
key: s.key
|
109
|
+
}, [
|
110
|
+
s.key !== "actions" ? (i(), k("div", Sl, [
|
111
|
+
q("div", xl, [
|
112
|
+
T(r(ll), {
|
113
|
+
modelValue: s.isActive,
|
114
|
+
"onUpdate:modelValue": [
|
115
|
+
(C) => s.isActive = C,
|
116
|
+
m[1] || (m[1] = (C) => M())
|
117
|
+
],
|
118
|
+
class: "!w-fit"
|
119
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
120
|
+
q("div", wl, Ve(s.label), 1)
|
121
|
+
]),
|
122
|
+
y.value.length > 1 ? (i(), j(r(Pe), {
|
123
|
+
key: 0,
|
124
|
+
width: "18",
|
125
|
+
height: "18",
|
126
|
+
class: "text-oc-text-400 drag-el cursor-move",
|
127
|
+
name: "draggable"
|
128
|
+
})) : g("", !0)
|
129
|
+
])) : g("", !0)
|
130
|
+
], 64))), 128))
|
131
|
+
]),
|
132
|
+
_: 1
|
133
|
+
}, 16, ["modelValue"])
|
134
|
+
])
|
135
|
+
])
|
136
|
+
]),
|
137
|
+
default: x(() => [
|
138
|
+
T(r(Ke), {
|
139
|
+
label: "Edit Column",
|
140
|
+
"left-icon": "setting",
|
141
|
+
variant: "secondary"
|
142
|
+
})
|
143
|
+
]),
|
144
|
+
_: 1
|
145
|
+
}, 8, ["modelValue"]));
|
146
|
+
}
|
147
|
+
}, Fl = { class: "relative flex flex-col gap-9" }, Ol = {
|
148
|
+
key: 0,
|
149
|
+
class: "flex items-center px-4 min-h-[52px]"
|
150
|
+
}, Vl = {
|
151
|
+
key: 0,
|
152
|
+
class: "absolute flex items-center gap-5 left-5"
|
153
|
+
}, El = {
|
154
|
+
key: 1,
|
155
|
+
class: "absolute flex gap-3 left-5"
|
156
|
+
}, Cl = {
|
157
|
+
key: 1,
|
158
|
+
class: "flex justify-center w-full gap-5 md:justify-start"
|
159
|
+
}, Dl = {
|
160
|
+
key: 2,
|
161
|
+
class: "items-center hidden md:flex"
|
162
|
+
}, Ql = {
|
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
|
+
},
|
193
|
+
emits: {
|
194
|
+
"update:selected": [],
|
195
|
+
"update:filter": [],
|
196
|
+
"click:row": [],
|
197
|
+
"filter-fields-changed": [],
|
198
|
+
"filter-removed": [],
|
199
|
+
"filter-open": [],
|
200
|
+
"search-query-changed": [],
|
201
|
+
"hover:cell": [],
|
202
|
+
"columns-changed": []
|
203
|
+
},
|
204
|
+
setup(A, { emit: te }) {
|
205
|
+
var pe, fe, ye, ge, be, ke, he, Se, xe, we, $e, Fe;
|
206
|
+
const u = A, w = te, y = F(() => {
|
207
|
+
var e;
|
208
|
+
return (e = u.options) == null ? void 0 : e.cursor;
|
209
|
+
}), h = O(), V = F(() => {
|
210
|
+
var e;
|
211
|
+
return (e = u.options) == null ? void 0 : e.tableOptions;
|
212
|
+
}), Q = F(() => u.localDb !== void 0), {
|
213
|
+
localData: M,
|
214
|
+
setFilter: K,
|
215
|
+
setSortBy: m,
|
216
|
+
paginationData: s,
|
217
|
+
isLoading: C
|
218
|
+
// sortBy,
|
219
|
+
// toggleSort,
|
220
|
+
// updateOrAddLocalData,
|
221
|
+
} = gl({
|
222
|
+
name: (pe = u.localDb) == null ? void 0 : pe.table_name,
|
223
|
+
localDb: (fe = u.localDb) == null ? void 0 : fe.db,
|
224
|
+
options: (ye = u.localDb) == null ? void 0 : ye.options
|
225
|
+
});
|
226
|
+
ue(() => {
|
227
|
+
var e;
|
228
|
+
return (e = u.options) == null ? void 0 : e.pagination;
|
229
|
+
}, (e) => {
|
230
|
+
Q.value || (s.value = e);
|
231
|
+
}, { deep: !0, immediate: !0 }), Q.value && (ue(() => u.filter, () => {
|
232
|
+
K(u.filter);
|
233
|
+
}, { deep: !0, immediate: !0 }), ue(() => u.sortBy, () => {
|
234
|
+
m(u.sortBy);
|
235
|
+
}, { deep: !0, immediate: !0 }));
|
236
|
+
const J = F(() => {
|
237
|
+
var a;
|
238
|
+
const e = {
|
239
|
+
...V.value,
|
240
|
+
headers: h.value ? h.value.map((n) => {
|
241
|
+
var v, c;
|
242
|
+
return n.class = ((c = (v = V.value) == null ? void 0 : v.headers.find((d) => d.key === n.key)) == null ? void 0 : c.class) ?? "", n;
|
243
|
+
}).filter((n) => n.isActive) : (a = V.value) == null ? void 0 : a.headers.filter((n) => Re(n.key))
|
244
|
+
};
|
245
|
+
return Q.value && (e.fields = M.value), e;
|
246
|
+
}), l = F(() => {
|
247
|
+
var e;
|
248
|
+
return (e = u.options) == null ? void 0 : e.filterOptions;
|
249
|
+
}), le = F(() => {
|
250
|
+
var e;
|
251
|
+
return (e = u.options) == null ? void 0 : e.hidePerPageDropdown;
|
252
|
+
}), oe = F(() => {
|
253
|
+
var e;
|
254
|
+
return ((e = s.value) == null ? void 0 : e.last_page) === 1;
|
255
|
+
}), N = O(!1), D = O(u.filter[(be = (ge = l.value) == null ? void 0 : ge.tabs) == null ? void 0 : be.key]), R = O(u.filter.page), z = O(
|
256
|
+
(he = (ke = l.value) == null ? void 0 : ke.per_page) != null && he.key ? u.filter[(xe = (Se = l.value) == null ? void 0 : Se.per_page) == null ? void 0 : xe.key] : u.filter.per_page
|
257
|
+
), ne = ((Fe = u.filter[($e = (we = l.value) == null ? void 0 : we.search) == null ? void 0 : $e.key]) == null ? void 0 : Fe.trim()) ?? "", U = O(ne ? ne.split(",") : []), de = O(!1), Be = F(
|
258
|
+
() => {
|
259
|
+
var e;
|
260
|
+
return ml((e = u.options) == null ? void 0 : e.perPageOptions);
|
261
|
+
}
|
262
|
+
), Ie = F(() => pl(Be.value, s.value)), qe = F(() => {
|
263
|
+
var e;
|
264
|
+
return ((e = u.selected) == null ? void 0 : e.length) > 0;
|
265
|
+
}), ve = (e) => {
|
266
|
+
!e.trim() || !t.value.selectedSearchOption && U.value.includes(e) || (U.value = [e], $(), w("search-query-changed", e));
|
267
|
+
}, Qe = (e) => {
|
268
|
+
U.value = U.value.filter((a) => a !== e), $();
|
269
|
+
}, Z = u.filter;
|
270
|
+
!Z && s.value ? Z.page = 1 : !Z && y && (Z.cursor = "");
|
271
|
+
const t = O(Z), Ne = F(() => vl(t.value, l.value)), Re = (e) => {
|
272
|
+
var a, n, v, c, d, o;
|
273
|
+
return ((o = (d = (c = (v = t.value) == null ? void 0 : v[(n = (a = l.value) == null ? void 0 : a.columnEdit) == null ? void 0 : n.key]) == null ? void 0 : c.active) == null ? void 0 : d.find((p) => p.key === e)) == null ? void 0 : o.isActive) ?? !0;
|
274
|
+
}, ze = ({ fixedHeaders: e, activeHeaders: a, isOnMount: n }) => {
|
275
|
+
var v, c, d, o, p, S, L, E;
|
276
|
+
if (t.value[(c = (v = l.value) == null ? void 0 : v.columnEdit) == null ? void 0 : c.key] || (t.value[(o = (d = l.value) == null ? void 0 : d.columnEdit) == null ? void 0 : o.key] = {}), t.value[(S = (p = l.value) == null ? void 0 : p.columnEdit) == null ? void 0 : S.key].fixed = e, t.value[(E = (L = l.value) == null ? void 0 : L.columnEdit) == null ? void 0 : E.key].active = a, h.value = [...e, ...a], !n) {
|
277
|
+
const B = nl(e, a);
|
278
|
+
dl(l.value.columnEdit.localStorageKey, B);
|
279
|
+
}
|
280
|
+
w("columns-changed", a);
|
281
|
+
}, Me = () => {
|
282
|
+
var e, a, n, v, c, d;
|
283
|
+
if ((a = (e = l.value) == null ? void 0 : e.columnEdit) != null && a.localStorageKey) {
|
284
|
+
const o = Te(l.value.columnEdit.localStorageKey);
|
285
|
+
if (o) {
|
286
|
+
const { fixed: p, active: S } = Ue(
|
287
|
+
o,
|
288
|
+
V.value.headers,
|
289
|
+
l.value.columnEdit.localStorageKey
|
290
|
+
);
|
291
|
+
t.value[(v = (n = l.value) == null ? void 0 : n.columnEdit) == null ? void 0 : v.key].fixed = p, t.value[(d = (c = l.value) == null ? void 0 : c.columnEdit) == null ? void 0 : d.key].active = S, h.value = [...p, ...S];
|
292
|
+
}
|
293
|
+
}
|
294
|
+
}, Je = (e) => {
|
295
|
+
t.value.selectedSearchOption = e;
|
296
|
+
}, Ze = () => {
|
297
|
+
U.value = [], D.value = "", t.value = cl(t.value, l.value, z.value, D.value), $();
|
298
|
+
}, Ge = () => {
|
299
|
+
$(null, R.value);
|
300
|
+
}, He = () => {
|
301
|
+
yl(u.id, t.value);
|
302
|
+
}, We = () => fl(u.id), ce = O(null), $ = (e = null, a = !1, n = "", v = !1, c = !1) => {
|
303
|
+
var o, p, S, L, E, B, G, H, W, X, Y, _, ee;
|
304
|
+
s.value && !a && (R.value = 1), s.value ? t.value.page = R.value : t.value.cursor = n, (o = l.value) != null && o.per_page ? t.value[l.value.per_page.key] = z.value : t.value.per_page = z.value, (p = l.value) != null && p.tabs && c && (t.value[l.value.tabs.key] = D.value), (S = l.value) != null && S.search && ((E = (L = l.value.search) == null ? void 0 : L.options) != null && E.length ? (Object.keys(t.value).forEach((b) => {
|
305
|
+
var I;
|
306
|
+
(I = l.value.search.options) != null && I.map((f) => f.value).includes(b) && delete t.value[b];
|
307
|
+
}), t.value[((B = t.value) == null ? void 0 : B.selectedSearchOption) || ((W = (H = (G = l.value.search) == null ? void 0 : G.options) == null ? void 0 : H[0]) == null ? void 0 : W.value) || l.value.search.key] = U.value.join()) : t.value[l.value.search.key] = U.value.join()), e && (N.value = !1, t.value = { ...t.value, ...e }, Object.keys(t.value).forEach((b) => {
|
308
|
+
Array.isArray(t.value[b]) && t.value[b].length === 0 && delete t.value[b];
|
309
|
+
}));
|
310
|
+
let d = (Y = (X = l.value) == null ? void 0 : X.tabs) == null ? void 0 : Y.key;
|
311
|
+
if (d && D.value !== t.value[d]) {
|
312
|
+
const b = (ee = (_ = l.value.tabs) == null ? void 0 : _.options) == null ? void 0 : ee.find(
|
313
|
+
(I) => {
|
314
|
+
var f, ae;
|
315
|
+
return ((f = I.value) == null ? void 0 : f.toString()) === ((ae = t.value[d]) == null ? void 0 : ae.toString());
|
316
|
+
}
|
317
|
+
);
|
318
|
+
if (b != null && b.value)
|
319
|
+
return D.value = b.value, $(), !1;
|
320
|
+
}
|
321
|
+
He(), clearTimeout(ce.value), ce.value = setTimeout(() => {
|
322
|
+
w("update:filter", t.value, v);
|
323
|
+
}, 100);
|
324
|
+
}, Xe = (e, a) => {
|
325
|
+
(a === l.value.tabs.key || a === "tabs") && (D.value = ""), $(e), w("filter-removed", a);
|
326
|
+
};
|
327
|
+
je(() => {
|
328
|
+
var a, n, v, c, d, o, p;
|
329
|
+
Me();
|
330
|
+
const e = We();
|
331
|
+
e && (t.value = JSON.parse(e), D.value = D.value || ((a = t.value) == null ? void 0 : a.tabs) || ((c = t.value) == null ? void 0 : c[(v = (n = l.value) == null ? void 0 : n.tabs) == null ? void 0 : v.key]), (d = t.value) != null && d.selectedSearchOption && ve(t.value[(o = t.value) == null ? void 0 : o.selectedSearchOption]), R.value = ((p = t.value) == null ? void 0 : p.page) || 1, $(null, !0, t.value.cursor, !0));
|
332
|
+
});
|
333
|
+
const me = F(() => u.isLoading || C.value);
|
334
|
+
return (e, a) => {
|
335
|
+
var n, v, c, d;
|
336
|
+
return i(), k("div", Fl, [
|
337
|
+
J.value ? (i(), j(r(al), {
|
338
|
+
key: 0,
|
339
|
+
selected: A.selected,
|
340
|
+
"row-key": A.rowKey,
|
341
|
+
options: J.value,
|
342
|
+
"is-loading": me.value,
|
343
|
+
"loading-rows": z.value,
|
344
|
+
"row-class": A.rowClass,
|
345
|
+
"row-link": A.rowLink,
|
346
|
+
"is-sticky": V.value.isSticky,
|
347
|
+
"is-borderless": V.value.isBorderless,
|
348
|
+
"onUpdate:selected": a[8] || (a[8] = (o) => e.$emit("update:selected", o)),
|
349
|
+
"onClick:row": a[9] || (a[9] = (o) => e.$emit("click:row", o)),
|
350
|
+
"onHover:cell": a[10] || (a[10] = (o) => e.$emit("hover:cell", o))
|
351
|
+
}, el({
|
352
|
+
after: x(() => [
|
353
|
+
P(e.$slots, "after")
|
354
|
+
]),
|
355
|
+
empty: x(() => [
|
356
|
+
P(e.$slots, "empty")
|
357
|
+
]),
|
358
|
+
"table-header": x((o) => [
|
359
|
+
P(e.$slots, "table-header", Ee(Ce(o)))
|
360
|
+
]),
|
361
|
+
"table-body": x((o) => [
|
362
|
+
P(e.$slots, "table-body", Ee(Ce(o)))
|
363
|
+
]),
|
364
|
+
_: 2
|
365
|
+
}, [
|
366
|
+
e.$slots.before || (n = l.value) != null && n.search || (v = l.value) != null && v.form || (c = l.value) != null && c.tabs ? {
|
367
|
+
name: "before",
|
368
|
+
fn: x(() => {
|
369
|
+
var o, p, S, L;
|
370
|
+
return [
|
371
|
+
P(e.$slots, "before"),
|
372
|
+
(o = l.value) != null && o.search || (p = l.value) != null && p.form || (S = l.value) != null && S.tabs ? (i(), k("div", Ol, [
|
373
|
+
qe.value ? (i(), k("div", Vl, [
|
374
|
+
P(e.$slots, "bulk-actions", { selectedRows: A.selected })
|
375
|
+
])) : (i(), k("div", El, [
|
376
|
+
(L = l.value) != null && L.tabs ? (i(), j(r(tl), {
|
377
|
+
key: 0,
|
378
|
+
modelValue: D.value,
|
379
|
+
"onUpdate:modelValue": [
|
380
|
+
a[0] || (a[0] = (E) => D.value = E),
|
381
|
+
a[1] || (a[1] = (E) => $(null, !1, "", !1, !0))
|
382
|
+
],
|
383
|
+
"is-disabled": me.value,
|
384
|
+
tabs: l.value.tabs.options,
|
385
|
+
variant: "pills"
|
386
|
+
}, null, 8, ["modelValue", "is-disabled", "tabs"])) : g("", !0)
|
387
|
+
])),
|
388
|
+
P(e.$slots, "filter-options", {}, () => {
|
389
|
+
var E, B, G, H, W, X, Y, _, ee, b, I;
|
390
|
+
return [
|
391
|
+
(E = l.value) != null && E.search || (B = l.value) != null && B.form || (G = l.value) != null && G.columnEdit ? (i(), k("div", {
|
392
|
+
key: 0,
|
393
|
+
class: ie([
|
394
|
+
"flex gap-3 absolute ml-auto bg-oc-bg-light right-4 max-w-[calc(100%-24px)]",
|
395
|
+
l.value ? de.value ? "md:w-fit w-full" : "" : "w-full justify-end"
|
396
|
+
])
|
397
|
+
}, [
|
398
|
+
(H = l.value) != null && H.search ? (i(), j(r(ol), {
|
399
|
+
key: 0,
|
400
|
+
"is-search-only": !l.value.tabs || l.value.isSearchOnly,
|
401
|
+
"search-options": ((W = l.value.search) == null ? void 0 : W.options) ?? [],
|
402
|
+
"selected-option": (((X = t.value) == null ? void 0 : X.selectedSearchOption) || ((ee = (_ = (Y = l.value.search) == null ? void 0 : Y.options) == null ? void 0 : _[0]) == null ? void 0 : ee.value)) ?? "keywords",
|
403
|
+
onAddQuery: ve,
|
404
|
+
onToggle: a[2] || (a[2] = (f) => de.value = f),
|
405
|
+
onChangeSearchKey: Je
|
406
|
+
}, null, 8, ["is-search-only", "search-options", "selected-option"])) : g("", !0),
|
407
|
+
(b = l.value) != null && b.form ? (i(), j(r(Ae), {
|
408
|
+
key: 1,
|
409
|
+
modelValue: N.value,
|
410
|
+
"onUpdate:modelValue": [
|
411
|
+
a[6] || (a[6] = (f) => N.value = f),
|
412
|
+
a[7] || (a[7] = (f) => e.$emit("filter-open", f))
|
413
|
+
],
|
414
|
+
distance: 9,
|
415
|
+
placement: "bottom-end",
|
416
|
+
"is-attach-to-body": ""
|
417
|
+
}, {
|
418
|
+
menu: x(() => [
|
419
|
+
N.value ? (i(), j(r(sl), {
|
420
|
+
key: 0,
|
421
|
+
id: A.id,
|
422
|
+
"json-form": l.value.form ?? [],
|
423
|
+
grid: l.value.grid ?? null,
|
424
|
+
values: u.filter,
|
425
|
+
actions: l.value.actions,
|
426
|
+
onApplyFilter: a[3] || (a[3] = (f) => $(f)),
|
427
|
+
onFilterFieldsChanged: a[4] || (a[4] = (f) => w("filter-fields-changed", f)),
|
428
|
+
onCancel: a[5] || (a[5] = (f) => N.value = !1)
|
429
|
+
}, {
|
430
|
+
default: x(({ errors: f, values: ae, jsonForm: Ye, updateForm: _e }) => [
|
431
|
+
P(e.$slots, "custom-filter-form", {
|
432
|
+
errors: f,
|
433
|
+
values: ae,
|
434
|
+
jsonForm: Ye,
|
435
|
+
updateFilter: _e
|
436
|
+
})
|
437
|
+
]),
|
438
|
+
_: 3
|
439
|
+
}, 8, ["id", "json-form", "grid", "values", "actions"])) : g("", !0)
|
440
|
+
]),
|
441
|
+
default: x(() => [
|
442
|
+
T(r(Ke), {
|
443
|
+
"is-active": N.value,
|
444
|
+
variant: "secondary",
|
445
|
+
"left-icon": "filter"
|
446
|
+
}, null, 8, ["is-active"])
|
447
|
+
]),
|
448
|
+
_: 3
|
449
|
+
}, 8, ["modelValue"])) : g("", !0),
|
450
|
+
l.value.columnEdit ? (i(), j($l, {
|
451
|
+
key: 2,
|
452
|
+
options: t.value.columnEdit,
|
453
|
+
headers: ((I = V.value) == null ? void 0 : I.headers) || [],
|
454
|
+
"local-key": l.value.columnEdit.localStorageKey,
|
455
|
+
onUpdateOrder: ze
|
456
|
+
}, null, 8, ["options", "headers", "local-key"])) : g("", !0)
|
457
|
+
], 2)) : g("", !0)
|
458
|
+
];
|
459
|
+
})
|
460
|
+
])) : g("", !0),
|
461
|
+
T(r(ul), {
|
462
|
+
filters: Ne.value,
|
463
|
+
queries: U.value,
|
464
|
+
class: "border-t border-oc-gray-200",
|
465
|
+
onRemoveQuery: Qe,
|
466
|
+
onRemoveAll: Ze,
|
467
|
+
onRemoveFilter: Xe
|
468
|
+
}, null, 8, ["filters", "queries"])
|
469
|
+
];
|
470
|
+
}),
|
471
|
+
key: "0"
|
472
|
+
} : void 0,
|
473
|
+
re((d = V.value) == null ? void 0 : d.headers, (o, p) => ({
|
474
|
+
name: o.key,
|
475
|
+
fn: x(({ data: S, item: L }) => [
|
476
|
+
P(e.$slots, o.key, {
|
477
|
+
data: S,
|
478
|
+
item: L
|
479
|
+
})
|
480
|
+
])
|
481
|
+
}))
|
482
|
+
]), 1032, ["selected", "row-key", "options", "is-loading", "loading-rows", "row-class", "row-link", "is-sticky", "is-borderless"])) : g("", !0),
|
483
|
+
P(e.$slots, "before-pagination"),
|
484
|
+
r(s) || y.value ? (i(), k("div", {
|
485
|
+
key: 1,
|
486
|
+
class: ie(["flex items-center gap-3", r(s) && r(s).last_page === 1 ? "justify-end" : ""])
|
487
|
+
}, [
|
488
|
+
r(s) && !oe.value ? (i(), j(r(rl), {
|
489
|
+
key: 0,
|
490
|
+
modelValue: R.value,
|
491
|
+
"onUpdate:modelValue": [
|
492
|
+
a[11] || (a[11] = (o) => R.value = o),
|
493
|
+
Ge
|
494
|
+
],
|
495
|
+
class: "justify-center",
|
496
|
+
"max-page": r(s).last_page,
|
497
|
+
strategy: r(s).strategy,
|
498
|
+
"total-visible": "5"
|
499
|
+
}, null, 8, ["modelValue", "max-page", "strategy"])) : g("", !0),
|
500
|
+
y.value ? (i(), k("div", Cl, [
|
501
|
+
T(r(De), {
|
502
|
+
disabled: !y.value.prev,
|
503
|
+
onClick: a[12] || (a[12] = (o) => y.value.prev ? $(null, !1, y.value.prev) : null)
|
504
|
+
}, null, 8, ["disabled"]),
|
505
|
+
T(r(De), {
|
506
|
+
disabled: !y.value.next,
|
507
|
+
"is-next": "",
|
508
|
+
onClick: a[13] || (a[13] = (o) => y.value.next ? $(null, !1, y.value.next) : null)
|
509
|
+
}, null, 8, ["disabled"])
|
510
|
+
])) : g("", !0),
|
511
|
+
le.value ? g("", !0) : (i(), k("div", Dl, [
|
512
|
+
T(r(il), {
|
513
|
+
modelValue: z.value,
|
514
|
+
"onUpdate:modelValue": [
|
515
|
+
a[14] || (a[14] = (o) => z.value = o),
|
516
|
+
a[15] || (a[15] = (o) => $(null))
|
517
|
+
],
|
518
|
+
label: "Item per page",
|
519
|
+
"is-inline-label": "",
|
520
|
+
"popper-options": { placement: "auto" },
|
521
|
+
options: Ie.value
|
522
|
+
}, null, 8, ["modelValue", "options"])
|
523
|
+
]))
|
524
|
+
], 2)) : g("", !0)
|
525
|
+
]);
|
526
|
+
};
|
527
|
+
}
|
528
|
+
};
|
529
|
+
export {
|
530
|
+
Ql as default
|
531
|
+
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { computed as
|
1
|
+
import { computed as c, createBlock as s, openBlock as d, unref as m, withCtx as i, renderSlot as p } from "vue";
|
2
2
|
import { VueDraggableNext as f } from "vue-draggable-next";
|
3
3
|
const h = {
|
4
4
|
__name: "OcDraggable",
|
@@ -10,17 +10,18 @@ const h = {
|
|
10
10
|
detectMove: null
|
11
11
|
},
|
12
12
|
setup(a, { emit: l }) {
|
13
|
-
const
|
13
|
+
const r = a, o = l, t = c(() => r.modelValue), n = (e) => {
|
14
14
|
o("update:modelValue", t.value, e);
|
15
15
|
}, u = (e) => {
|
16
16
|
o("detectMove", e);
|
17
17
|
};
|
18
|
-
return (e, g) => (
|
18
|
+
return (e, g) => (d(), s(m(f), {
|
19
19
|
handle: ".drag-el",
|
20
20
|
list: t.value,
|
21
21
|
animation: 500,
|
22
|
+
"force-fallback": !0,
|
22
23
|
move: u,
|
23
|
-
onChange:
|
24
|
+
onChange: n
|
24
25
|
}, {
|
25
26
|
default: i(() => [
|
26
27
|
p(e.$slots, "default", { list: t.value })
|