@orchidui/core 1.8.1-10 → 1.8.1-100
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-D8_7Hyun.js → OcAccountSetupProgress-BZrI2z-C.js} +4 -4
- package/dist/{OcAvatar-DeVm4Ck5.js → OcAvatar-WGEX8Wio.js} +4 -4
- package/dist/{OcComplexCalendar-DTL664yt.js → OcComplexCalendar-CrhHAVnT.js} +6 -6
- package/dist/{OcComplexDatePicker-B8qyAErU.js → OcComplexDatePicker-Cr_6CjYB.js} +5 -5
- package/dist/OcCropper-BMMZRsnp.js +253 -0
- package/dist/OcDataTable-B5QRaoES.js +540 -0
- package/dist/{OcDraggable-CA_BCbpl.js → OcDraggable-DRsp4j4e.js} +5 -4
- package/dist/{OcDraggableList-D6lz10NQ.js → OcDraggableList-Bka23Zj_.js} +50 -47
- package/dist/{OcEmojiPicker-9v4nAKTW.js → OcEmojiPicker-CjL4Ap4z.js} +17 -15
- package/dist/{OcFilterForm-DwavM_3U.js → OcFilterForm-IZtn5Vdc.js} +22 -24
- package/dist/OcFilterSearch-Bn7BjQMO.js +112 -0
- package/dist/{OcFilterSearchFor-ydRuKVJZ.js → OcFilterSearchFor-B0Cyh-PP.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-KoaOw5ug.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-BlGghWyM.js → OcTimePicker-i88_uGmT.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-Bq9Yf2D4.js → SubPlanCard-CmQpq6Jd.js} +10 -10
- package/dist/Theme/OcTheme.js +1 -1
- package/dist/{ThumbnailSection-CjfK4y-_.js → ThumbnailSection-VGh-BSav.js} +3 -3
- package/dist/{ThumbnailTheme-CP_aCMoz.js → ThumbnailTheme-OomrH2df.js} +9 -6
- package/dist/core.css +1 -0
- package/dist/{index-C40DvCrq.js → index-DeDsEdk8.js} +2981 -2838
- package/dist/index.js +58 -55
- package/package.json +1 -1
- package/dist/OcCropper-CvIZNHi0.js +0 -229
- package/dist/OcDataTable-CSBHzzr0.js +0 -578
- package/dist/OcFilterSearch-QFGKFGIl.js +0 -69
- package/dist/OcModalCropper-DPL2eH1Y.js +0 -46
- package/dist/OcToggle-bIJaLDMZ.js +0 -53
- package/dist/style.css +0 -1
@@ -0,0 +1,540 @@
|
|
1
|
+
import { ref as x, onMounted as Ae, createBlock as j, openBlock as i, unref as u, withCtx as w, createVNode as T, createElementVNode as N, createElementBlock as h, createCommentVNode as b, mergeProps as Ve, Fragment as ue, renderList as ie, normalizeClass as re, toDisplayString as Ee, computed as V, watch as te, renderSlot as P, createSlots as al, normalizeProps as De, guardReactiveProps as Le } from "vue";
|
2
|
+
import { az as Ke, B as Te, C as tl, K as ol, Z as sl, aK as ul, aL as il, aM as rl, H as nl, I as Ce, j as dl } from "./index-DeDsEdk8.js";
|
3
|
+
import { VueDraggableNext as Pe } from "vue-draggable-next";
|
4
|
+
import { getFromLocalStorage as Ue, formatHeadersFromLocalStorage as Be, formatHeadersToLocalStorage as vl, setInLocalStorage as cl } from "./DataTable/utils/editColumnsUtils.js";
|
5
|
+
import { _ as je } from "./OcIcon-CBf___w1.js";
|
6
|
+
import { formatFilterDisplay as pl, clearAllFilters as ml } from "./DataTable/utils/filterUtils.js";
|
7
|
+
import { formatCustomItemsPerPageOptions as fl, getItemsPerPageOptions as gl } from "./DataTable/utils/paginationUtils.js";
|
8
|
+
import { getFilterFromLocalStorage as yl, saveFilterToLocalStorage as bl } from "./DataTable/utils/storageUtils.js";
|
9
|
+
import { useDataTable as kl } from "./DataTable/useDataTable.js";
|
10
|
+
import "dayjs";
|
11
|
+
const hl = { class: "p-5 gap-y-4 text-sm flex w-[250px] flex-col" }, Sl = {
|
12
|
+
key: 0,
|
13
|
+
class: "gap-y-2 flex flex-col border-b pb-3 border-oc-gray-200"
|
14
|
+
}, xl = { class: "gap-y-2 flex flex-col" }, wl = {
|
15
|
+
key: 0,
|
16
|
+
class: "flex items-center bg-white justify-between h-[26px]"
|
17
|
+
}, Ol = { class: "flex items-center w-full gap-x-3" }, $l = { class: "truncate w-full max-w-[160px]" }, Fl = {
|
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: oe }) {
|
39
|
+
const s = oe, O = A, n = x([]), f = x([]), B = x(!1), $ = {
|
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": () => I()
|
47
|
+
}, I = (K = !1) => {
|
48
|
+
f.value = f.value.map((v) => ({
|
49
|
+
...v,
|
50
|
+
isActive: !0
|
51
|
+
})), s("update-order", {
|
52
|
+
fixedHeaders: f.value,
|
53
|
+
activeHeaders: n.value,
|
54
|
+
isOnMount: K
|
55
|
+
});
|
56
|
+
};
|
57
|
+
return Ae(() => {
|
58
|
+
const K = Ue(O.localKey), { fixed: v, active: c } = Be(K, O.headers, O.localKey);
|
59
|
+
f.value = v || O.headers.slice(0, 1), n.value = c || O.headers.slice(1).map((E) => {
|
60
|
+
var ee, le, l;
|
61
|
+
return {
|
62
|
+
...E,
|
63
|
+
isActive: ((l = (le = (ee = O.options) == null ? void 0 : ee.active) == null ? void 0 : le.find((se) => se.key === E.key)) == null ? void 0 : l.isActive) ?? !0
|
64
|
+
};
|
65
|
+
}), I(!0);
|
66
|
+
}), (K, v) => (i(), j(u(Ke), {
|
67
|
+
modelValue: B.value,
|
68
|
+
"onUpdate:modelValue": v[3] || (v[3] = (c) => B.value = c),
|
69
|
+
class: "h-[36px]",
|
70
|
+
"is-attach-to-body": ""
|
71
|
+
}, {
|
72
|
+
menu: w(() => [
|
73
|
+
N("div", hl, [
|
74
|
+
f.value.length ? (i(), h("div", Sl, [
|
75
|
+
v[4] || (v[4] = N("span", { class: "text-oc-text-400 font-medium" }, "Fixed columns", -1)),
|
76
|
+
T(u(Pe), Ve({
|
77
|
+
key: "key",
|
78
|
+
modelValue: f.value,
|
79
|
+
"onUpdate:modelValue": v[0] || (v[0] = (c) => f.value = c)
|
80
|
+
}, $), {
|
81
|
+
default: w(() => [
|
82
|
+
(i(!0), h(ue, null, ie(f.value, (c, E) => (i(), h("div", {
|
83
|
+
key: c.key,
|
84
|
+
class: re(["flex items-center justify-between h-[26px]", E ? "" : "is-disabled"])
|
85
|
+
}, [
|
86
|
+
N("span", null, Ee(c.label), 1),
|
87
|
+
E ? (i(), j(u(je), {
|
88
|
+
key: 0,
|
89
|
+
width: "18",
|
90
|
+
height: "18",
|
91
|
+
class: "text-oc-text-400 drag-el cursor-move",
|
92
|
+
name: "draggable"
|
93
|
+
})) : b("", !0)
|
94
|
+
], 2))), 128))
|
95
|
+
]),
|
96
|
+
_: 1
|
97
|
+
}, 16, ["modelValue"])
|
98
|
+
])) : b("", !0),
|
99
|
+
N("div", xl, [
|
100
|
+
v[5] || (v[5] = N("span", { class: "text-oc-text-400 font-medium" }, "Active columns", -1)),
|
101
|
+
T(u(Pe), Ve({
|
102
|
+
key: "key",
|
103
|
+
modelValue: n.value,
|
104
|
+
"onUpdate:modelValue": v[2] || (v[2] = (c) => n.value = c)
|
105
|
+
}, $, { "data-active-headers": "true" }), {
|
106
|
+
default: w(() => [
|
107
|
+
(i(!0), h(ue, null, ie(n.value, (c) => (i(), h(ue, {
|
108
|
+
key: c.key
|
109
|
+
}, [
|
110
|
+
c.key !== "actions" ? (i(), h("div", wl, [
|
111
|
+
N("div", Ol, [
|
112
|
+
T(u(tl), {
|
113
|
+
modelValue: c.isActive,
|
114
|
+
"onUpdate:modelValue": [
|
115
|
+
(E) => c.isActive = E,
|
116
|
+
v[1] || (v[1] = (E) => I())
|
117
|
+
],
|
118
|
+
class: "!w-fit"
|
119
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
120
|
+
N("div", $l, Ee(c.label), 1)
|
121
|
+
]),
|
122
|
+
n.value.length > 1 ? (i(), j(u(je), {
|
123
|
+
key: 0,
|
124
|
+
width: "18",
|
125
|
+
height: "18",
|
126
|
+
class: "text-oc-text-400 drag-el cursor-move",
|
127
|
+
name: "draggable"
|
128
|
+
})) : b("", !0)
|
129
|
+
])) : b("", !0)
|
130
|
+
], 64))), 128))
|
131
|
+
]),
|
132
|
+
_: 1
|
133
|
+
}, 16, ["modelValue"])
|
134
|
+
])
|
135
|
+
])
|
136
|
+
]),
|
137
|
+
default: w(() => [
|
138
|
+
T(u(Te), {
|
139
|
+
label: "Edit Column",
|
140
|
+
"left-icon": "setting",
|
141
|
+
variant: "secondary"
|
142
|
+
})
|
143
|
+
]),
|
144
|
+
_: 1
|
145
|
+
}, 8, ["modelValue"]));
|
146
|
+
}
|
147
|
+
}, Vl = { class: "relative flex flex-col gap-9" }, El = {
|
148
|
+
key: 0,
|
149
|
+
class: "flex items-center px-4 min-h-[52px]"
|
150
|
+
}, Dl = {
|
151
|
+
key: 0,
|
152
|
+
class: "absolute flex items-center gap-5 left-5"
|
153
|
+
}, Ll = {
|
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
|
+
}, Pl = {
|
160
|
+
key: 2,
|
161
|
+
class: "items-center hidden md:flex"
|
162
|
+
}, Rl = {
|
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
|
+
isLocalData: {
|
189
|
+
type: Boolean,
|
190
|
+
default: !1
|
191
|
+
},
|
192
|
+
localDataOptions: {
|
193
|
+
type: Object,
|
194
|
+
required: !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
|
+
},
|
208
|
+
setup(A, { emit: oe }) {
|
209
|
+
var me, fe, ge, ye, be, ke, he, Se, xe, we, Oe, $e, Fe;
|
210
|
+
const s = A, O = oe;
|
211
|
+
let n = x((me = s.options) == null ? void 0 : me.pagination);
|
212
|
+
const f = V(() => {
|
213
|
+
var e;
|
214
|
+
return (e = s.options) == null ? void 0 : e.cursor;
|
215
|
+
}), B = x(), $ = V(() => {
|
216
|
+
var e;
|
217
|
+
return (e = s.options) == null ? void 0 : e.tableOptions;
|
218
|
+
}), I = V(() => s.isLocalData && s.localDataOptions), {
|
219
|
+
localData: K,
|
220
|
+
setFilter: v,
|
221
|
+
setSortBy: c,
|
222
|
+
paginationData: E,
|
223
|
+
isLoading: ee
|
224
|
+
// sortBy,
|
225
|
+
// toggleSort,
|
226
|
+
// updateOrAddLocalData,
|
227
|
+
} = kl({
|
228
|
+
id: s.id,
|
229
|
+
name: (fe = s.localDataOptions) == null ? void 0 : fe.table_name,
|
230
|
+
localDb: (ge = s.localDataOptions) == null ? void 0 : ge.db,
|
231
|
+
options: (ye = s.localDataOptions) == null ? void 0 : ye.options
|
232
|
+
});
|
233
|
+
I.value && (n.value = E.value, te(() => s.filter, (e) => {
|
234
|
+
v(e);
|
235
|
+
}, { deep: !0 }), te(() => s.sortBy, (e) => {
|
236
|
+
c(e);
|
237
|
+
}, { deep: !0 }), te(() => E.value, (e) => {
|
238
|
+
n.value = e;
|
239
|
+
}, { deep: !0 }), v(s.filter), c(s.sortBy)), te(() => {
|
240
|
+
var e;
|
241
|
+
return (e = s.options) == null ? void 0 : e.pagination;
|
242
|
+
}, (e) => {
|
243
|
+
I.value || (n.value = e);
|
244
|
+
}, { deep: !0 });
|
245
|
+
const le = V(() => {
|
246
|
+
var a;
|
247
|
+
const e = {
|
248
|
+
...$.value,
|
249
|
+
headers: B.value ? B.value.map((r) => {
|
250
|
+
var p, m;
|
251
|
+
return r.class = ((m = (p = $.value) == null ? void 0 : p.headers.find((d) => d.key === r.key)) == null ? void 0 : m.class) ?? "", r;
|
252
|
+
}).filter((r) => r.isActive) : (a = $.value) == null ? void 0 : a.headers.filter((r) => Me(r.key))
|
253
|
+
};
|
254
|
+
return I.value && (e.fields = K.value), e;
|
255
|
+
}), l = V(() => {
|
256
|
+
var e;
|
257
|
+
return (e = s.options) == null ? void 0 : e.filterOptions;
|
258
|
+
}), se = V(() => {
|
259
|
+
var e;
|
260
|
+
return (e = s.options) == null ? void 0 : e.hidePerPageDropdown;
|
261
|
+
}), Ie = V(() => {
|
262
|
+
var e;
|
263
|
+
return ((e = n.value) == null ? void 0 : e.last_page) === 1;
|
264
|
+
}), R = x(!1), L = x(s.filter[(ke = (be = l.value) == null ? void 0 : be.tabs) == null ? void 0 : ke.key]), z = x(s.filter.page), M = x(
|
265
|
+
(Se = (he = l.value) == null ? void 0 : he.per_page) != null && Se.key ? s.filter[(we = (xe = l.value) == null ? void 0 : xe.per_page) == null ? void 0 : we.key] : s.filter.per_page
|
266
|
+
), ne = ((Fe = s.filter[($e = (Oe = l.value) == null ? void 0 : Oe.search) == null ? void 0 : $e.key]) == null ? void 0 : Fe.trim()) ?? "", U = x(ne ? ne.split(",") : []), de = x(!1), qe = V(
|
267
|
+
() => {
|
268
|
+
var e;
|
269
|
+
return fl((e = s.options) == null ? void 0 : e.perPageOptions);
|
270
|
+
}
|
271
|
+
), Qe = V(() => gl(qe.value, n.value)), Ne = V(() => {
|
272
|
+
var e;
|
273
|
+
return ((e = s.selected) == null ? void 0 : e.length) > 0;
|
274
|
+
}), ve = (e) => {
|
275
|
+
!e.trim() || !t.value.selectedSearchOption && U.value.includes(e) || (U.value = [e], F(), O("search-query-changed", e));
|
276
|
+
}, Re = (e) => {
|
277
|
+
U.value = U.value.filter((a) => a !== e), F();
|
278
|
+
}, J = s.filter;
|
279
|
+
!J && n.value ? J.page = 1 : !J && f && (J.cursor = "");
|
280
|
+
const t = x(J), ze = V(() => pl(t.value, l.value)), Me = (e) => {
|
281
|
+
var a, r, p, m, d, o;
|
282
|
+
return ((o = (d = (m = (p = t.value) == null ? void 0 : p[(r = (a = l.value) == null ? void 0 : a.columnEdit) == null ? void 0 : r.key]) == null ? void 0 : m.active) == null ? void 0 : d.find((g) => g.key === e)) == null ? void 0 : o.isActive) ?? !0;
|
283
|
+
}, Je = ({ fixedHeaders: e, activeHeaders: a, isOnMount: r }) => {
|
284
|
+
var p, m, d, o, g, S, C, D;
|
285
|
+
if (t.value[(m = (p = l.value) == null ? void 0 : p.columnEdit) == null ? void 0 : m.key] || (t.value[(o = (d = l.value) == null ? void 0 : d.columnEdit) == null ? void 0 : o.key] = {}), t.value[(S = (g = l.value) == null ? void 0 : g.columnEdit) == null ? void 0 : S.key].fixed = e, t.value[(D = (C = l.value) == null ? void 0 : C.columnEdit) == null ? void 0 : D.key].active = a, B.value = [...e, ...a], !r) {
|
286
|
+
const q = vl(e, a);
|
287
|
+
cl(l.value.columnEdit.localStorageKey, q);
|
288
|
+
}
|
289
|
+
O("columns-changed", a);
|
290
|
+
}, Ze = () => {
|
291
|
+
var e, a, r, p, m, d;
|
292
|
+
if ((a = (e = l.value) == null ? void 0 : e.columnEdit) != null && a.localStorageKey) {
|
293
|
+
const o = Ue(l.value.columnEdit.localStorageKey);
|
294
|
+
if (o) {
|
295
|
+
const { fixed: g, active: S } = Be(
|
296
|
+
o,
|
297
|
+
$.value.headers,
|
298
|
+
l.value.columnEdit.localStorageKey
|
299
|
+
);
|
300
|
+
t.value[(p = (r = l.value) == null ? void 0 : r.columnEdit) == null ? void 0 : p.key].fixed = g, t.value[(d = (m = l.value) == null ? void 0 : m.columnEdit) == null ? void 0 : d.key].active = S, B.value = [...g, ...S];
|
301
|
+
}
|
302
|
+
}
|
303
|
+
}, Ge = (e) => {
|
304
|
+
t.value.selectedSearchOption = e;
|
305
|
+
}, He = () => {
|
306
|
+
U.value = [], L.value = "", t.value = ml(t.value, l.value, M.value, L.value), F();
|
307
|
+
}, We = () => {
|
308
|
+
F(null, z.value);
|
309
|
+
}, Xe = () => {
|
310
|
+
bl(s.id, t.value);
|
311
|
+
}, Ye = () => yl(s.id), ce = x(null), F = (e = null, a = !1, r = "", p = !1, m = !1) => {
|
312
|
+
var o, g, S, C, D, q, Z, G, H, W, X, Y, _;
|
313
|
+
n.value && !a && (z.value = 1), n.value ? t.value.page = z.value : t.value.cursor = r, (o = l.value) != null && o.per_page ? t.value[l.value.per_page.key] = M.value : t.value.per_page = M.value, (g = l.value) != null && g.tabs && m && (t.value[l.value.tabs.key] = L.value), (S = l.value) != null && S.search && ((D = (C = l.value.search) == null ? void 0 : C.options) != null && D.length ? (Object.keys(t.value).forEach((k) => {
|
314
|
+
var Q;
|
315
|
+
(Q = l.value.search.options) != null && Q.map((y) => y.value).includes(k) && delete t.value[k];
|
316
|
+
}), t.value[((q = t.value) == null ? void 0 : q.selectedSearchOption) || ((H = (G = (Z = l.value.search) == null ? void 0 : Z.options) == null ? void 0 : G[0]) == null ? void 0 : H.value) || l.value.search.key] = U.value.join()) : t.value[l.value.search.key] = U.value.join()), e && (R.value = !1, t.value = { ...t.value, ...e }, Object.keys(t.value).forEach((k) => {
|
317
|
+
Array.isArray(t.value[k]) && t.value[k].length === 0 && delete t.value[k];
|
318
|
+
}));
|
319
|
+
let d = (X = (W = l.value) == null ? void 0 : W.tabs) == null ? void 0 : X.key;
|
320
|
+
if (d && L.value !== t.value[d]) {
|
321
|
+
const k = (_ = (Y = l.value.tabs) == null ? void 0 : Y.options) == null ? void 0 : _.find(
|
322
|
+
(Q) => {
|
323
|
+
var y, ae;
|
324
|
+
return ((y = Q.value) == null ? void 0 : y.toString()) === ((ae = t.value[d]) == null ? void 0 : ae.toString());
|
325
|
+
}
|
326
|
+
);
|
327
|
+
if (k != null && k.value)
|
328
|
+
return L.value = k.value, F(), !1;
|
329
|
+
}
|
330
|
+
Xe(), clearTimeout(ce.value), ce.value = setTimeout(() => {
|
331
|
+
O("update:filter", t.value, p);
|
332
|
+
}, 100);
|
333
|
+
}, _e = (e, a) => {
|
334
|
+
(a === l.value.tabs.key || a === "tabs") && (L.value = ""), F(e), O("filter-removed", a);
|
335
|
+
};
|
336
|
+
Ae(() => {
|
337
|
+
var a, r, p, m, d, o, g;
|
338
|
+
Ze();
|
339
|
+
const e = Ye();
|
340
|
+
e && (t.value = JSON.parse(e), L.value = L.value || ((a = t.value) == null ? void 0 : a.tabs) || ((m = t.value) == null ? void 0 : m[(p = (r = l.value) == null ? void 0 : r.tabs) == null ? void 0 : p.key]), (d = t.value) != null && d.selectedSearchOption && ve(t.value[(o = t.value) == null ? void 0 : o.selectedSearchOption]), z.value = ((g = t.value) == null ? void 0 : g.page) || 1, F(null, !0, t.value.cursor, !0));
|
341
|
+
});
|
342
|
+
const pe = V(() => s.isLoading || ee.value);
|
343
|
+
return (e, a) => {
|
344
|
+
var r, p, m, d;
|
345
|
+
return i(), h("div", Vl, [
|
346
|
+
$.value ? (i(), j(u(ol), {
|
347
|
+
key: 0,
|
348
|
+
selected: A.selected,
|
349
|
+
"row-key": A.rowKey,
|
350
|
+
options: le.value,
|
351
|
+
"is-loading": pe.value,
|
352
|
+
"loading-rows": M.value,
|
353
|
+
"row-class": A.rowClass,
|
354
|
+
"row-link": A.rowLink,
|
355
|
+
"is-sticky": $.value.isSticky,
|
356
|
+
"is-borderless": $.value.isBorderless,
|
357
|
+
"onUpdate:selected": a[8] || (a[8] = (o) => e.$emit("update:selected", o)),
|
358
|
+
"onClick:row": a[9] || (a[9] = (o) => e.$emit("click:row", o)),
|
359
|
+
"onHover:cell": a[10] || (a[10] = (o) => e.$emit("hover:cell", o))
|
360
|
+
}, al({
|
361
|
+
after: w(() => [
|
362
|
+
P(e.$slots, "after")
|
363
|
+
]),
|
364
|
+
empty: w(() => [
|
365
|
+
P(e.$slots, "empty")
|
366
|
+
]),
|
367
|
+
"table-header": w((o) => [
|
368
|
+
P(e.$slots, "table-header", De(Le(o)))
|
369
|
+
]),
|
370
|
+
"table-body": w((o) => [
|
371
|
+
P(e.$slots, "table-body", De(Le(o)))
|
372
|
+
]),
|
373
|
+
_: 2
|
374
|
+
}, [
|
375
|
+
e.$slots.before || (r = l.value) != null && r.search || (p = l.value) != null && p.form || (m = l.value) != null && m.tabs ? {
|
376
|
+
name: "before",
|
377
|
+
fn: w(() => {
|
378
|
+
var o, g, S, C;
|
379
|
+
return [
|
380
|
+
P(e.$slots, "before"),
|
381
|
+
(o = l.value) != null && o.search || (g = l.value) != null && g.form || (S = l.value) != null && S.tabs ? (i(), h("div", El, [
|
382
|
+
Ne.value ? (i(), h("div", Dl, [
|
383
|
+
P(e.$slots, "bulk-actions", { selectedRows: A.selected })
|
384
|
+
])) : (i(), h("div", Ll, [
|
385
|
+
(C = l.value) != null && C.tabs ? (i(), j(u(sl), {
|
386
|
+
key: 0,
|
387
|
+
modelValue: L.value,
|
388
|
+
"onUpdate:modelValue": [
|
389
|
+
a[0] || (a[0] = (D) => L.value = D),
|
390
|
+
a[1] || (a[1] = (D) => F(null, !1, "", !1, !0))
|
391
|
+
],
|
392
|
+
"is-disabled": pe.value,
|
393
|
+
tabs: l.value.tabs.options,
|
394
|
+
variant: "pills"
|
395
|
+
}, null, 8, ["modelValue", "is-disabled", "tabs"])) : b("", !0)
|
396
|
+
])),
|
397
|
+
P(e.$slots, "filter-options", {}, () => {
|
398
|
+
var D, q, Z, G, H, W, X, Y, _, k, Q;
|
399
|
+
return [
|
400
|
+
(D = l.value) != null && D.search || (q = l.value) != null && q.form || (Z = l.value) != null && Z.columnEdit ? (i(), h("div", {
|
401
|
+
key: 0,
|
402
|
+
class: re([
|
403
|
+
"flex gap-3 absolute ml-auto bg-oc-bg-light right-4 max-w-[calc(100%-24px)]",
|
404
|
+
l.value ? de.value ? "md:w-fit w-full" : "" : "w-full justify-end"
|
405
|
+
])
|
406
|
+
}, [
|
407
|
+
(G = l.value) != null && G.search ? (i(), j(u(ul), {
|
408
|
+
key: 0,
|
409
|
+
"is-search-only": !l.value.tabs || l.value.isSearchOnly,
|
410
|
+
"search-options": ((H = l.value.search) == null ? void 0 : H.options) ?? [],
|
411
|
+
"selected-option": (((W = t.value) == null ? void 0 : W.selectedSearchOption) || ((_ = (Y = (X = l.value.search) == null ? void 0 : X.options) == null ? void 0 : Y[0]) == null ? void 0 : _.value)) ?? "keywords",
|
412
|
+
onAddQuery: ve,
|
413
|
+
onToggle: a[2] || (a[2] = (y) => de.value = y),
|
414
|
+
onChangeSearchKey: Ge
|
415
|
+
}, null, 8, ["is-search-only", "search-options", "selected-option"])) : b("", !0),
|
416
|
+
(k = l.value) != null && k.form ? (i(), j(u(Ke), {
|
417
|
+
key: 1,
|
418
|
+
modelValue: R.value,
|
419
|
+
"onUpdate:modelValue": [
|
420
|
+
a[6] || (a[6] = (y) => R.value = y),
|
421
|
+
a[7] || (a[7] = (y) => e.$emit("filter-open", y))
|
422
|
+
],
|
423
|
+
distance: 9,
|
424
|
+
placement: "bottom-end",
|
425
|
+
"is-attach-to-body": ""
|
426
|
+
}, {
|
427
|
+
menu: w(() => [
|
428
|
+
R.value ? (i(), j(u(il), {
|
429
|
+
key: 0,
|
430
|
+
id: A.id,
|
431
|
+
"json-form": l.value.form ?? [],
|
432
|
+
grid: l.value.grid ?? null,
|
433
|
+
values: s.filter,
|
434
|
+
actions: l.value.actions,
|
435
|
+
onApplyFilter: a[3] || (a[3] = (y) => F(y)),
|
436
|
+
onFilterFieldsChanged: a[4] || (a[4] = (y) => O("filter-fields-changed", y)),
|
437
|
+
onCancel: a[5] || (a[5] = (y) => R.value = !1)
|
438
|
+
}, {
|
439
|
+
default: w(({ errors: y, values: ae, jsonForm: el, updateForm: ll }) => [
|
440
|
+
P(e.$slots, "custom-filter-form", {
|
441
|
+
errors: y,
|
442
|
+
values: ae,
|
443
|
+
jsonForm: el,
|
444
|
+
updateFilter: ll
|
445
|
+
})
|
446
|
+
]),
|
447
|
+
_: 3
|
448
|
+
}, 8, ["id", "json-form", "grid", "values", "actions"])) : b("", !0)
|
449
|
+
]),
|
450
|
+
default: w(() => [
|
451
|
+
T(u(Te), {
|
452
|
+
"is-active": R.value,
|
453
|
+
variant: "secondary",
|
454
|
+
"left-icon": "filter"
|
455
|
+
}, null, 8, ["is-active"])
|
456
|
+
]),
|
457
|
+
_: 3
|
458
|
+
}, 8, ["modelValue"])) : b("", !0),
|
459
|
+
l.value.columnEdit ? (i(), j(Fl, {
|
460
|
+
key: 2,
|
461
|
+
options: t.value.columnEdit,
|
462
|
+
headers: ((Q = $.value) == null ? void 0 : Q.headers) || [],
|
463
|
+
"local-key": l.value.columnEdit.localStorageKey,
|
464
|
+
onUpdateOrder: Je
|
465
|
+
}, null, 8, ["options", "headers", "local-key"])) : b("", !0)
|
466
|
+
], 2)) : b("", !0)
|
467
|
+
];
|
468
|
+
})
|
469
|
+
])) : b("", !0),
|
470
|
+
T(u(rl), {
|
471
|
+
filters: ze.value,
|
472
|
+
queries: U.value,
|
473
|
+
class: "border-t border-oc-gray-200",
|
474
|
+
onRemoveQuery: Re,
|
475
|
+
onRemoveAll: He,
|
476
|
+
onRemoveFilter: _e
|
477
|
+
}, null, 8, ["filters", "queries"])
|
478
|
+
];
|
479
|
+
}),
|
480
|
+
key: "0"
|
481
|
+
} : void 0,
|
482
|
+
ie((d = $.value) == null ? void 0 : d.headers, (o, g) => ({
|
483
|
+
name: o.key,
|
484
|
+
fn: w(({ data: S, item: C }) => [
|
485
|
+
P(e.$slots, o.key, {
|
486
|
+
data: S,
|
487
|
+
item: C
|
488
|
+
})
|
489
|
+
])
|
490
|
+
}))
|
491
|
+
]), 1032, ["selected", "row-key", "options", "is-loading", "loading-rows", "row-class", "row-link", "is-sticky", "is-borderless"])) : b("", !0),
|
492
|
+
P(e.$slots, "before-pagination"),
|
493
|
+
u(n) || f.value ? (i(), h("div", {
|
494
|
+
key: 1,
|
495
|
+
class: re(["flex items-center gap-3", u(n) && u(n).last_page === 1 ? "justify-end" : ""])
|
496
|
+
}, [
|
497
|
+
u(n) && !Ie.value ? (i(), j(u(nl), {
|
498
|
+
key: 0,
|
499
|
+
modelValue: z.value,
|
500
|
+
"onUpdate:modelValue": [
|
501
|
+
a[11] || (a[11] = (o) => z.value = o),
|
502
|
+
We
|
503
|
+
],
|
504
|
+
class: "justify-center",
|
505
|
+
"max-page": u(n).last_page,
|
506
|
+
strategy: u(n).strategy,
|
507
|
+
"total-visible": "5"
|
508
|
+
}, null, 8, ["modelValue", "max-page", "strategy"])) : b("", !0),
|
509
|
+
f.value ? (i(), h("div", Cl, [
|
510
|
+
T(u(Ce), {
|
511
|
+
disabled: !f.value.prev,
|
512
|
+
onClick: a[12] || (a[12] = (o) => f.value.prev ? F(null, !1, f.value.prev) : null)
|
513
|
+
}, null, 8, ["disabled"]),
|
514
|
+
T(u(Ce), {
|
515
|
+
disabled: !f.value.next,
|
516
|
+
"is-next": "",
|
517
|
+
onClick: a[13] || (a[13] = (o) => f.value.next ? F(null, !1, f.value.next) : null)
|
518
|
+
}, null, 8, ["disabled"])
|
519
|
+
])) : b("", !0),
|
520
|
+
se.value ? b("", !0) : (i(), h("div", Pl, [
|
521
|
+
T(u(dl), {
|
522
|
+
modelValue: M.value,
|
523
|
+
"onUpdate:modelValue": [
|
524
|
+
a[14] || (a[14] = (o) => M.value = o),
|
525
|
+
a[15] || (a[15] = (o) => F(null))
|
526
|
+
],
|
527
|
+
label: "Item per page",
|
528
|
+
"is-inline-label": "",
|
529
|
+
"popper-options": { placement: "auto" },
|
530
|
+
options: Qe.value
|
531
|
+
}, null, 8, ["modelValue", "options"])
|
532
|
+
]))
|
533
|
+
], 2)) : b("", !0)
|
534
|
+
]);
|
535
|
+
};
|
536
|
+
}
|
537
|
+
};
|
538
|
+
export {
|
539
|
+
Rl as default
|
540
|
+
};
|
@@ -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 })
|