@orchidui/core 1.18.0 → 1.19.0

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.
Files changed (112) hide show
  1. package/dist/DataDisplay/CustomerCard/OcCustomerCard.js +1 -1
  2. package/dist/DataDisplay/FloatContent/OcFloatContent.js +1 -1
  3. package/dist/DataDisplay/HorizontalProgressbar/OcHorizontalProgressbar.js +1 -1
  4. package/dist/DataDisplay/InfoCard/OcInfoCard.js +1 -1
  5. package/dist/DataDisplay/ListDetail/OcListDetail.js +1 -1
  6. package/dist/DataDisplay/ListItem/OcListItem.js +1 -1
  7. package/dist/DataDisplay/OnboardingListItem/OcOnboardingListItem.js +1 -1
  8. package/dist/DataDisplay/Overview/OcOverview.js +1 -1
  9. package/dist/DataDisplay/Pagination/OcPagination.js +1 -1
  10. package/dist/DataDisplay/ProgressBar/OcProgressBar.js +1 -1
  11. package/dist/DataDisplay/Table/OcTable.js +1 -1
  12. package/dist/DataDisplay/TransferSummary/OcTransferSummary.js +1 -1
  13. package/dist/DataTable/useDataTable.js +95 -0
  14. package/dist/DataTable/utils/filterUtils.js +57 -0
  15. package/dist/DataTable/utils/paginationUtils.js +26 -0
  16. package/dist/Disclosure/Accordion/OcAccordion.js +1 -1
  17. package/dist/Disclosure/OnboardingAccordion/OnboardingAccordion.js +1 -1
  18. package/dist/Disclosure/Steps/OcSteps.js +1 -1
  19. package/dist/Disclosure/SwitchTabs/OcSwitchTabs.js +1 -1
  20. package/dist/Disclosure/Tabs/Tabs.js +1 -1
  21. package/dist/Disclosure/Variants/OcVariants.js +1 -1
  22. package/dist/Elements/AdditionalContent/OcAdditionalContent.js +1 -1
  23. package/dist/Elements/AuthenticationOption/AuthenticationOption.js +1 -1
  24. package/dist/Elements/Box/OcBox.js +1 -1
  25. package/dist/Elements/EmptyPage/OcEmptyPage.js +1 -1
  26. package/dist/Elements/FeatureOverviewCard/OcFeatureOverviewCard.js +1 -1
  27. package/dist/Elements/Header/OcHeader.js +1 -1
  28. package/dist/Elements/PageTitle/OcPageTitle.js +1 -1
  29. package/dist/Elements/SandboxBanner/OcSandboxBanner.js +1 -1
  30. package/dist/Elements/Section/OcSection.js +1 -1
  31. package/dist/Elements/Sidebar/OcSidebar.js +2 -2
  32. package/dist/Elements/Skeleton/OcSkeleton.js +1 -1
  33. package/dist/Elements/SubSidebar/OcSubSidebar.js +1 -1
  34. package/dist/Elements/TopBanner/OcTopBanner.js +1 -1
  35. package/dist/Elements/VerificationOption/OcVerificationOption.js +1 -1
  36. package/dist/Feedback/Banner/OcBanner.js +1 -1
  37. package/dist/Feedback/Chip/OcChip.js +1 -1
  38. package/dist/Feedback/ShareIcon/OcShareIcon.js +1 -1
  39. package/dist/Feedback/Snackbar/OcSnackbar.js +1 -1
  40. package/dist/Feedback/Tag/OcTag.js +1 -1
  41. package/dist/Form/BaseInput/OcBaseInput.js +1 -1
  42. package/dist/Form/Button/OcButton.js +1 -1
  43. package/dist/Form/Calendar/OcCalendar.js +1 -1
  44. package/dist/Form/CardInput/OcCardInput.js +1 -1
  45. package/dist/Form/Checkbox/OcCheckbox.js +1 -1
  46. package/dist/Form/CheckboxesGroup/OcCheckboxesGroup.js +1 -1
  47. package/dist/Form/Criteria/OcCriteria.js +1 -1
  48. package/dist/Form/Cropper/OcCropper.js +1 -1
  49. package/dist/Form/DatePicker/OcDatePicker.js +1 -1
  50. package/dist/Form/EmojiPicker/OcEmojiPicker.js +1 -1
  51. package/dist/Form/Input/OcInput.js +1 -1
  52. package/dist/Form/LinkInput/OcLinkInput.js +1 -1
  53. package/dist/Form/MultipleUploadFile/OcMultipleUploadFile.js +1 -1
  54. package/dist/Form/NumberInput/OcNumberInput.js +1 -1
  55. package/dist/Form/PhoneInput/OcPhoneInput.js +1 -1
  56. package/dist/Form/Radio/OcRadio.js +1 -1
  57. package/dist/Form/RadioGroup/OcRadioGroup.js +1 -1
  58. package/dist/Form/RangeInput/OcRangeInput.js +1 -1
  59. package/dist/Form/SectionItem/OcSectionItem.js +1 -1
  60. package/dist/Form/Select/OcSelect.js +1 -1
  61. package/dist/Form/SelectOptions/OcSelectOptions.js +1 -1
  62. package/dist/Form/SingleFileUpload/OcSingleFileUpload.js +1 -1
  63. package/dist/Form/Slider/OcSlider.js +1 -1
  64. package/dist/Form/TextArea/OcTextArea.js +1 -1
  65. package/dist/Form/Toggle/OcToggle.js +1 -1
  66. package/dist/Form/index.js +2 -2
  67. package/dist/FormBuilder/OcFormBuilder.js +1 -1
  68. package/dist/MediaAndIcons/Avatar/OcAvatar.js +1 -1
  69. package/dist/MediaAndIcons/Icon/OcIcon.js +1 -1
  70. package/dist/{OcAccountSetupProgress-g7V1kvOf.js → OcAccountSetupProgress-BrFh0gV6.js} +4 -4
  71. package/dist/{OcAvatar-DeVm4Ck5.js → OcAvatar-WGEX8Wio.js} +4 -4
  72. package/dist/{OcComplexCalendar-CWPFV545.js → OcComplexCalendar-H9AVEnPx.js} +6 -6
  73. package/dist/{OcComplexDatePicker-DXg8PEZz.js → OcComplexDatePicker-DP29N26v.js} +5 -5
  74. package/dist/{OcCropper-BfXmon8i.js → OcCropper-DiHMNZNd.js} +3 -3
  75. package/dist/OcDataTable-DqKIOr6d.js +557 -0
  76. package/dist/{OcDraggable-CZT2mJvO.js → OcDraggable-DRsp4j4e.js} +2 -2
  77. package/dist/{OcDraggableList-BMlc5DDP.js → OcDraggableList-DE5TsIZD.js} +3 -3
  78. package/dist/{OcEmojiPicker-vNLeufFJ.js → OcEmojiPicker-DKWtyTsI.js} +17 -15
  79. package/dist/{OcFilterForm-DxNgWEC9.js → OcFilterForm-DcVtNrT1.js} +18 -20
  80. package/dist/{OcFilterSearch-D1gAk_Ea.js → OcFilterSearch-B7mIHuKn.js} +18 -23
  81. package/dist/{OcFilterSearchFor-CKrNeOon.js → OcFilterSearchFor-CqsuXADi.js} +25 -19
  82. 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
  83. package/dist/{OcIcon-CSpRxnwd.js → OcIcon-CBf___w1.js} +5 -4
  84. package/dist/{OcModalCropper-DOSQE3NJ.js → OcModalCropper-DxkU7yZh.js} +4 -4
  85. package/dist/{OcPopper-CYcXF-OR.js → OcPopper-BSfMaOoF.js} +3 -3
  86. package/dist/{OcProgressBar-hiyC5XSc.js → OcProgressBar-lyqE5LZd.js} +5 -5
  87. package/dist/{OcSection-D_vO-DAP.js → OcSection-BjyapRr3.js} +3 -3
  88. package/dist/{OcSkeleton-CvdpGSQR.js → OcSkeleton-Czw65X0i.js} +2 -2
  89. package/dist/{OcSwitchTabs-CYp676bj.js → OcSwitchTabs-B7LfmG3z.js} +3 -3
  90. 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
  91. package/dist/{OcTheme-CWgrJh5Q.js → OcTheme-B6NTNYtz.js} +2 -2
  92. package/dist/{OcTimePicker-Cjo8eKGB.js → OcTimePicker-BX6AF_Su.js} +6 -6
  93. package/dist/{OcTimePopup-CXGhaOev.js → OcTimePopup-CrwbZ_Nx.js} +5 -5
  94. package/dist/{OcToggle-Cp5dJ5LN.js → OcToggle-DOfA-DZ8.js} +4 -4
  95. package/dist/Overlay/ConfirmationModal/OcConfirmationModal.js +1 -1
  96. package/dist/Overlay/CopyTooltip/OcCopyTooltip.js +1 -1
  97. package/dist/Overlay/Dropdown/OcDropdown.js +1 -1
  98. package/dist/Overlay/Modal/OcModal.js +1 -1
  99. package/dist/Overlay/Popper/OcPopper.js +1 -1
  100. package/dist/Overlay/SupportMenu/OcSupportMenu.js +1 -1
  101. package/dist/Overlay/Tooltip/OcTooltip.js +1 -1
  102. package/dist/Overlay/Whitelist/OcWhiteList.js +1 -1
  103. package/dist/{SubPlanCard-BTqSr2AX.js → SubPlanCard-BhKyfET3.js} +10 -10
  104. package/dist/Theme/OcTheme.js +1 -1
  105. package/dist/{ThumbnailSection-DvanWXUV.js → ThumbnailSection-CZPxt9Vt.js} +3 -3
  106. package/dist/ThumbnailTheme-B8th9EGc.js +124 -0
  107. package/dist/{index-DkumyhAj.js → index-d52sus6s.js} +1974 -1943
  108. package/dist/index.js +12 -12
  109. package/package.json +1 -1
  110. package/dist/OcDataTable-CsQHegQT.js +0 -590
  111. package/dist/ThumbnailTheme-Cb9Ya2ZK.js +0 -119
  112. /package/dist/{style.css → core.css} +0 -0
package/dist/index.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import "vue";
2
- import { V as r, ak as o, aX as t, a2 as n, a4 as i, at as p, _ as l, a5 as d, B as m, o as u, a as b, C as S, b as c, au as T, aH as g, aO as C, ax as x, ay as P, c as I, aQ as f, v as h, aN as O, p as F, aI as B, aR as k, az as v, aA as w, aS as A, a6 as H, T as L, L as D, R as M, a7 as _, aL as R, aK as y, aM as E, w as N, u as U, l as V, a8 as G, ab as j, aa as z, ac as W, x as q, a3 as J, d as K, e as Q, m as X, y as Y, z as Z, A as $, aB as aa, aP as ea, t as sa, N as ra, aC as oa, D as ta, W as na, k as ia, E as pa, F as la, G as da, ae as ma, af as ua, H as ba, J as Sa, $ as ca, f as Ta, I as ga, ag as Ca, g as xa, h as Pa, i as Ia, ah as fa, q as ha, j as Oa, r as Fa, av as Ba, am as ka, ai as va, ap as wa, ao as Aa, al as Ha, an as La, aj as Da, s as Ma, S as _a, aw as Ra, Y as ya, X as Ea, a9 as Na, aV as Ua, aq as Va, aD as Ga, ad as ja, K as za, O as Wa, P as qa, M as Ja, Q as Ka, Z as Qa, n as Xa, aU as Ya, aT as Za, aW as $a, aJ as ae, aE as ee, ar as se, U as re, a1 as oe, a0 as te, as as ne, aF as ie } from "./index-DkumyhAj.js";
3
- import { _ as le } from "./OcProgressBar-hiyC5XSc.js";
4
- import { _ as me } from "./OcHorizontalProgressbar.vue_vue_type_script_setup_true_lang-4eVgPDi5.js";
5
- import { _ as be } from "./OcSwitchTabs-CYp676bj.js";
6
- import { S as ce } from "./OcSkeleton-CvdpGSQR.js";
7
- import { _ as ge } from "./OcSection-D_vO-DAP.js";
8
- import { _ as xe } from "./OcTag.vue_vue_type_script_setup_true_lang-D19lw-8Y.js";
9
- import { T as Ie } from "./OcToggle-Cp5dJ5LN.js";
10
- import { _ as he } from "./OcAvatar-DeVm4Ck5.js";
11
- import { _ as Fe } from "./OcIcon-CSpRxnwd.js";
12
- import { _ as ke } from "./OcPopper-CYcXF-OR.js";
13
- import { _ as we } from "./OcTheme-CWgrJh5Q.js";
2
+ import { V as r, ak as o, aX as t, a2 as n, a4 as i, at as p, _ as l, a5 as d, B as m, o as u, a as b, C as S, b as c, au as T, aH as g, aO as C, ax as x, ay as P, c as I, aQ as f, v as h, aN as O, p as F, aI as B, aR as k, az as v, aA as w, aS as A, a6 as H, T as L, L as D, R as M, a7 as _, aL as R, aK as y, aM as E, w as N, u as U, l as V, a8 as G, ab as j, aa as z, ac as W, x as q, a3 as J, d as K, e as Q, m as X, y as Y, z as Z, A as $, aB as aa, aP as ea, t as sa, N as ra, aC as oa, D as ta, W as na, k as ia, E as pa, F as la, G as da, ae as ma, af as ua, H as ba, J as Sa, $ as ca, f as Ta, I as ga, ag as Ca, g as xa, h as Pa, i as Ia, ah as fa, q as ha, j as Oa, r as Fa, av as Ba, am as ka, ai as va, ap as wa, ao as Aa, al as Ha, an as La, aj as Da, s as Ma, S as _a, aw as Ra, Y as ya, X as Ea, a9 as Na, aV as Ua, aq as Va, aD as Ga, ad as ja, K as za, O as Wa, P as qa, M as Ja, Q as Ka, Z as Qa, n as Xa, aU as Ya, aT as Za, aW as $a, aJ as ae, aE as ee, ar as se, U as re, a1 as oe, a0 as te, as as ne, aF as ie } from "./index-d52sus6s.js";
3
+ import { _ as le } from "./OcProgressBar-lyqE5LZd.js";
4
+ import { _ as me } from "./OcHorizontalProgressbar.vue_vue_type_script_setup_true_lang-C-8H1oP2.js";
5
+ import { _ as be } from "./OcSwitchTabs-B7LfmG3z.js";
6
+ import { S as ce } from "./OcSkeleton-Czw65X0i.js";
7
+ import { _ as ge } from "./OcSection-BjyapRr3.js";
8
+ import { _ as xe } from "./OcTag.vue_vue_type_script_setup_true_lang-CzJFcg8l.js";
9
+ import { T as Ie } from "./OcToggle-DOfA-DZ8.js";
10
+ import { _ as he } from "./OcAvatar-WGEX8Wio.js";
11
+ import { _ as Fe } from "./OcIcon-CBf___w1.js";
12
+ import { _ as ke } from "./OcPopper-BSfMaOoF.js";
13
+ import { _ as we } from "./OcTheme-B6NTNYtz.js";
14
14
  export {
15
15
  r as Accordion,
16
16
  o as AccountSetup,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orchidui/core",
3
3
  "description": "Orchid UI, Library Vue 3 tailwind css",
4
- "version": "1.18.0",
4
+ "version": "1.19.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "vite build"
@@ -1,590 +0,0 @@
1
- import { ref as N, onMounted as Ee, openBlock as v, createBlock as q, unref as x, withCtx as C, createElementVNode as W, createElementBlock as F, createVNode as R, mergeProps as be, Fragment as ae, renderList as se, normalizeClass as oe, toDisplayString as ke, createCommentVNode as $, computed as M, createSlots as ze, renderSlot as T, normalizeProps as he, guardReactiveProps as xe } from "vue";
2
- import { az as Ve, C as Je, B as Fe, K as He, Z as Ze, aK as Ge, aL as We, aM as Xe, H as _e, I as Se, j as el } from "./index-DkumyhAj.js";
3
- import te from "dayjs";
4
- import { VueDraggableNext as we } from "vue-draggable-next";
5
- import { getFromLocalStorage as ue, formatHeadersFromLocalStorage as je, formatHeadersToLocalStorage as ll, setInLocalStorage as $e } from "./DataTable/utils/editColumnsUtils.js";
6
- import { _ as Oe } from "./OcIcon-CSpRxnwd.js";
7
- const al = { class: "p-5 gap-y-4 text-sm flex w-[250px] flex-col" }, tl = {
8
- key: 0,
9
- class: "gap-y-2 flex flex-col border-b pb-3 border-oc-gray-200"
10
- }, sl = { class: "gap-y-2 flex flex-col" }, ol = {
11
- key: 0,
12
- class: "flex items-center bg-white justify-between h-[26px]"
13
- }, ul = { class: "flex items-center w-full gap-x-3" }, rl = { class: "truncate w-full max-w-[160px]" }, il = {
14
- __name: "ColumnEdit",
15
- props: {
16
- options: {
17
- type: Object,
18
- default: () => ({})
19
- },
20
- headers: {
21
- type: Array,
22
- default: () => []
23
- },
24
- localKey: {
25
- type: String,
26
- default: ""
27
- }
28
- },
29
- emits: ["change-active", "onMoved", "update-order"],
30
- setup(L, { emit: ee }) {
31
- const p = ee, D = L, m = N([]), g = N([]), H = N(!1), j = (a = !1) => {
32
- g.value = g.value.map((b) => ({
33
- ...b,
34
- isActive: !0
35
- })), p("update-order", {
36
- fixedHeaders: g.value,
37
- activeHeaders: m.value,
38
- isOnMount: a
39
- });
40
- }, X = {
41
- handle: ".drag-el",
42
- filter: ".is-disabled",
43
- group: "headers",
44
- animation: 500,
45
- forceFallback: !1,
46
- move: (a) => a.to.dataset.activeHeaders ? !0 : !!a.draggedContext.futureIndex,
47
- "onUpdate:modelValue": () => j()
48
- };
49
- return Ee(() => {
50
- const a = ue(D.localKey), { fixed: b, active: k } = je(a, D.headers, D.localKey);
51
- g.value = b || D.headers.slice(0, 1), m.value = k || D.headers.slice(1).map((O) => {
52
- var V, Q, I;
53
- return {
54
- ...O,
55
- isActive: ((I = (Q = (V = D.options) == null ? void 0 : V.active) == null ? void 0 : Q.find((_) => _.key === O.key)) == null ? void 0 : I.isActive) ?? !0
56
- };
57
- }), j(!0);
58
- }), (a, b) => (v(), q(x(Ve), {
59
- modelValue: H.value,
60
- "onUpdate:modelValue": b[3] || (b[3] = (k) => H.value = k),
61
- class: "h-[36px]",
62
- "is-attach-to-body": ""
63
- }, {
64
- menu: C(() => [
65
- W("div", al, [
66
- g.value.length ? (v(), F("div", tl, [
67
- b[4] || (b[4] = W("span", { class: "text-oc-text-400 font-medium" }, "Fixed columns", -1)),
68
- R(x(we), be({
69
- key: "key",
70
- modelValue: g.value,
71
- "onUpdate:modelValue": b[0] || (b[0] = (k) => g.value = k)
72
- }, X), {
73
- default: C(() => [
74
- (v(!0), F(ae, null, se(g.value, (k, O) => (v(), F("div", {
75
- key: k.key,
76
- class: oe(["flex items-center justify-between h-[26px]", O ? "" : "is-disabled"])
77
- }, [
78
- W("span", null, ke(k.label), 1),
79
- O ? (v(), q(x(Oe), {
80
- key: 0,
81
- width: "18",
82
- height: "18",
83
- class: "text-oc-text-400 drag-el cursor-move",
84
- name: "draggable"
85
- })) : $("", !0)
86
- ], 2))), 128))
87
- ]),
88
- _: 1
89
- }, 16, ["modelValue"])
90
- ])) : $("", !0),
91
- W("div", sl, [
92
- b[5] || (b[5] = W("span", { class: "text-oc-text-400 font-medium" }, "Active columns", -1)),
93
- R(x(we), be({
94
- key: "key",
95
- modelValue: m.value,
96
- "onUpdate:modelValue": b[2] || (b[2] = (k) => m.value = k)
97
- }, X, { "data-active-headers": "true" }), {
98
- default: C(() => [
99
- (v(!0), F(ae, null, se(m.value, (k) => (v(), F(ae, {
100
- key: k.key
101
- }, [
102
- k.key !== "actions" ? (v(), F("div", ol, [
103
- W("div", ul, [
104
- R(x(Je), {
105
- modelValue: k.isActive,
106
- "onUpdate:modelValue": [
107
- (O) => k.isActive = O,
108
- b[1] || (b[1] = (O) => j())
109
- ],
110
- class: "!w-fit"
111
- }, null, 8, ["modelValue", "onUpdate:modelValue"]),
112
- W("div", rl, ke(k.label), 1)
113
- ]),
114
- m.value.length > 1 ? (v(), q(x(Oe), {
115
- key: 0,
116
- width: "18",
117
- height: "18",
118
- class: "text-oc-text-400 drag-el cursor-move",
119
- name: "draggable"
120
- })) : $("", !0)
121
- ])) : $("", !0)
122
- ], 64))), 128))
123
- ]),
124
- _: 1
125
- }, 16, ["modelValue"])
126
- ])
127
- ])
128
- ]),
129
- default: C(() => [
130
- R(x(Fe), {
131
- label: "Edit Column",
132
- "left-icon": "setting",
133
- variant: "secondary"
134
- })
135
- ]),
136
- _: 1
137
- }, 8, ["modelValue"]));
138
- }
139
- }, nl = { class: "relative flex flex-col gap-9" }, vl = {
140
- key: 0,
141
- class: "flex items-center px-4 min-h-[52px]"
142
- }, dl = {
143
- key: 0,
144
- class: "absolute flex items-center gap-5 left-5"
145
- }, cl = {
146
- key: 1,
147
- class: "absolute flex gap-3 left-5"
148
- }, fl = {
149
- key: 1,
150
- class: "flex justify-center w-full gap-5 md:justify-start"
151
- }, pl = {
152
- key: 2,
153
- class: "items-center hidden md:flex"
154
- }, xl = {
155
- __name: "OcDataTable",
156
- props: {
157
- isLoading: Boolean,
158
- id: {
159
- type: String,
160
- required: !0
161
- },
162
- options: {
163
- type: Object,
164
- required: !0
165
- },
166
- filter: {
167
- type: Object,
168
- required: !0
169
- },
170
- selected: {
171
- type: Array,
172
- required: !1
173
- },
174
- rowClass: String,
175
- rowKey: {
176
- type: String,
177
- Function,
178
- default: "id"
179
- },
180
- rowLink: String
181
- },
182
- emits: {
183
- "update:selected": [],
184
- "update:filter": [],
185
- "click:row": [],
186
- "filter-fields-changed": [],
187
- "filter-removed": [],
188
- "filter-open": [],
189
- "search-query-changed": [],
190
- "hover:cell": [],
191
- "columns-changed": []
192
- },
193
- setup(L, { emit: ee }) {
194
- var ne, ve, de, ce, fe, pe, me, ye, ge;
195
- const p = L, D = ee, m = M(() => {
196
- var l;
197
- return (l = p.options) == null ? void 0 : l.pagination;
198
- }), g = M(() => {
199
- var l;
200
- return (l = p.options) == null ? void 0 : l.cursor;
201
- }), H = N(), j = M(() => {
202
- var l;
203
- return (l = p.options) == null ? void 0 : l.tableOptions;
204
- }), X = M(() => {
205
- var l;
206
- return {
207
- ...j.value,
208
- headers: H.value ? H.value.map((e) => {
209
- var o, r;
210
- return e.class = ((r = (o = j.value) == null ? void 0 : o.headers.find((d) => d.key === e.key)) == null ? void 0 : r.class) ?? "", e;
211
- }).filter((e) => e.isActive) : (l = j.value) == null ? void 0 : l.headers.filter((e) => Ie(e.key))
212
- };
213
- }), a = M(() => {
214
- var l;
215
- return (l = p.options) == null ? void 0 : l.filterOptions;
216
- }), b = M(() => {
217
- var l;
218
- return (l = p.options) == null ? void 0 : l.hidePerPageDropdown;
219
- }), k = M(() => {
220
- var l;
221
- return ((l = m.value) == null ? void 0 : l.last_page) === 1;
222
- }), O = N(!1), V = N(p.filter[(ve = (ne = a.value) == null ? void 0 : ne.tabs) == null ? void 0 : ve.key]), Q = N(p.filter.page), I = N(
223
- (ce = (de = a.value) == null ? void 0 : de.per_page) != null && ce.key ? p.filter[(pe = (fe = a.value) == null ? void 0 : fe.per_page) == null ? void 0 : pe.key] : p.filter.per_page
224
- ), _ = ((ge = p.filter[(ye = (me = a.value) == null ? void 0 : me.search) == null ? void 0 : ye.key]) == null ? void 0 : ge.trim()) ?? "", z = N(_ ? _.split(",") : []), re = N(!1), Ae = M(
225
- () => {
226
- var l, e;
227
- return (e = (l = p.options) == null ? void 0 : l.perPageOptions) == null ? void 0 : e.map(
228
- (o) => ({
229
- label: `${o}`,
230
- value: o
231
- })
232
- );
233
- }
234
- ), Ce = M(() => {
235
- let l = [
236
- {
237
- label: "10",
238
- value: 10
239
- },
240
- {
241
- label: "15",
242
- value: 15
243
- },
244
- {
245
- label: "20",
246
- value: 20
247
- },
248
- {
249
- label: "25",
250
- value: 25
251
- },
252
- {
253
- label: "40",
254
- value: 40
255
- },
256
- {
257
- label: "50",
258
- value: 50
259
- },
260
- {
261
- label: "75",
262
- value: 75
263
- },
264
- {
265
- label: "99",
266
- value: 99
267
- }
268
- ], e = Ae.value ?? l;
269
- if (m.value) {
270
- const o = m.value.total < 100 ? m.value.total : 100;
271
- o > 10 && (e = e.filter((r) => r.value <= o));
272
- }
273
- return [...new Set(e)];
274
- }), De = M(() => {
275
- var l;
276
- return ((l = p.selected) == null ? void 0 : l.length) > 0;
277
- }), ie = (l) => {
278
- !l.trim() || !t.value.selectedSearchOption && z.value.includes(l) || (z.value = [l], K(), D("search-query-changed", l));
279
- }, Ke = (l) => {
280
- z.value = z.value.filter((e) => e !== l), K();
281
- }, Z = p.filter;
282
- !Z && m ? Z.page = 1 : !Z && g && (Z.cursor = "");
283
- const t = N(Z), Le = () => {
284
- var e, o, r, d, n, s, c, y, w, S, A, P, U, Y;
285
- z.value = [], V.value = "";
286
- const l = {};
287
- a.value ? Z.page = 1 : Z.cursor = "", (o = (e = a.value) == null ? void 0 : e.per_page) != null && o.key ? l[(d = (r = a.value) == null ? void 0 : r.per_page) == null ? void 0 : d.key] = I.value : l.per_page = I.value, (s = (n = a.value) == null ? void 0 : n.tabs) != null && s.key ? l[(y = (c = a.value) == null ? void 0 : c.tabs) == null ? void 0 : y.key] = V.value : l.tabs = V.value, (S = (w = a.value) == null ? void 0 : w.columnEdit) != null && S.key && (l[(P = (A = a.value) == null ? void 0 : A.columnEdit) == null ? void 0 : P.key] = t.value[(Y = (U = a.value) == null ? void 0 : U.columnEdit) == null ? void 0 : Y.key]), t.value = l, K();
288
- }, Pe = () => {
289
- K(null, Q.value);
290
- }, Ue = () => {
291
- p.id && $e(p.id, JSON.stringify(t.value));
292
- }, Ye = () => p.id ? ue(p.id) : null, K = (l = null, e = !1, o = "", r = !1, d = !1) => {
293
- var s, c, y, w, S, A, P, U, Y, J, B, u, E;
294
- m.value && !e && (Q.value = 1), m.value ? t.value.page = Q.value : t.value.cursor = o, (s = a.value) != null && s.per_page ? t.value[a.value.per_page.key] = I.value : t.value.per_page = I.value, (c = a.value) != null && c.tabs && d && (t.value[a.value.tabs.key] = V.value), (y = a.value) != null && y.search && ((S = (w = a.value.search) == null ? void 0 : w.options) != null && S.length ? (Object.keys(t.value).forEach((f) => {
295
- var h;
296
- (h = a.value.search.options) != null && h.map((i) => i.value).includes(f) && delete t.value[f];
297
- }), t.value[((A = t.value) == null ? void 0 : A.selectedSearchOption) || ((Y = (U = (P = a.value.search) == null ? void 0 : P.options) == null ? void 0 : U[0]) == null ? void 0 : Y.value) || a.value.search.key] = z.value.join()) : t.value[a.value.search.key] = z.value.join()), l && (O.value = !1, t.value = { ...t.value, ...l }, Object.keys(t.value).forEach((f) => {
298
- Array.isArray(t.value[f]) && t.value[f].length === 0 && delete t.value[f];
299
- }));
300
- let n = (B = (J = a.value) == null ? void 0 : J.tabs) == null ? void 0 : B.key;
301
- if (n && V.value !== t.value[n]) {
302
- const f = (E = (u = a.value.tabs) == null ? void 0 : u.options) == null ? void 0 : E.find(
303
- (h) => {
304
- var i, G;
305
- return ((i = h.value) == null ? void 0 : i.toString()) === ((G = t.value[n]) == null ? void 0 : G.toString());
306
- }
307
- );
308
- if (f != null && f.value)
309
- return V.value = f.value, K(), !1;
310
- }
311
- Ue(), D("update:filter", t.value, r);
312
- }, Be = (l, e) => {
313
- (e === a.value.tabs.key || e === "tabs") && (V.value = ""), K(l), D("filter-removed", e);
314
- }, Me = (l) => {
315
- let e = [];
316
- return l.forEach((o) => {
317
- e.push(o.key);
318
- }), e;
319
- }, Ne = M(() => {
320
- if (t.value) {
321
- let l = [];
322
- return Object.keys(t.value).forEach((e) => {
323
- var n, s, c, y, w, S, A, P, U, Y, J;
324
- let o = (s = (n = a.value) == null ? void 0 : n.tabs) == null ? void 0 : s.key;
325
- const r = (y = (c = a.value) == null ? void 0 : c.search) == null ? void 0 : y.key, d = ((S = (w = a.value) == null ? void 0 : w.per_page) == null ? void 0 : S.key) ?? "per_page";
326
- if ((A = a.value.form) == null || A.find((B) => {
327
- B.name === o && (o = "");
328
- }), e !== "page" && e !== "cursor" && e !== d && e !== o && e !== r) {
329
- let B = null, u = (P = a.value.form) == null ? void 0 : P.find((f) => {
330
- if (typeof f.name == "object") {
331
- let h = !1;
332
- return f.name.forEach((i) => {
333
- i.key === e && (h = !0, B = Me(f.name));
334
- }), h;
335
- } else
336
- return f.name === e;
337
- }), E = "";
338
- if (u && t.value[e]) {
339
- if (typeof u.name == "object" ? (U = u.name) == null || U.forEach((h) => {
340
- E && (E += " - "), E += t.value[h.key];
341
- }) : E = t.value[e], u.props.options && (E = (u.props.multiple ? t.value[e] : [t.value[e]]).map(
342
- (i) => {
343
- var G;
344
- return (G = u.props.options.find(({ value: le }) => le === i)) == null ? void 0 : G.label;
345
- }
346
- ).join(", ")), u.type === "RangeInput" && Array.isArray(t.value[e]) && (E = t.value[e][0].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + " - " + t.value[e][1].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")), u.type === "DatePicker")
347
- if (((Y = u == null ? void 0 : u.props) == null ? void 0 : Y.type) === "range" && u.name && u.name[1]) {
348
- const h = te(t.value[u.name[0].key]).format("MM/DD/YYYY"), i = te(t.value[u.name[1].key]).format("MM/DD/YYYY");
349
- E = h === i ? h : h + " - " + i;
350
- } else E = te(t.value[u.name]).format("MM/DD/YYYY");
351
- let f = `${(J = u == null ? void 0 : u.props) == null ? void 0 : J.label} : ${E}`;
352
- u && u.name && typeof u.name == "object" && l.find((i) => i.name === B[0]) && (f = ""), l.push({
353
- label: f,
354
- name: e,
355
- multiNames: B
356
- });
357
- }
358
- }
359
- }), l;
360
- }
361
- return [];
362
- }), Ie = (l) => {
363
- var e, o, r, d, n, s;
364
- return ((s = (n = (d = (r = t.value) == null ? void 0 : r[(o = (e = a.value) == null ? void 0 : e.columnEdit) == null ? void 0 : o.key]) == null ? void 0 : d.active) == null ? void 0 : n.find((c) => c.key === l)) == null ? void 0 : s.isActive) ?? !0;
365
- }, Te = ({ fixedHeaders: l, activeHeaders: e, isOnMount: o }) => {
366
- var r, d, n, s, c, y, w, S;
367
- if (t.value[(d = (r = a.value) == null ? void 0 : r.columnEdit) == null ? void 0 : d.key] || (t.value[(s = (n = a.value) == null ? void 0 : n.columnEdit) == null ? void 0 : s.key] = {}), t.value[(y = (c = a.value) == null ? void 0 : c.columnEdit) == null ? void 0 : y.key].fixed = l, t.value[(S = (w = a.value) == null ? void 0 : w.columnEdit) == null ? void 0 : S.key].active = e, H.value = [...l, ...e], !o) {
368
- const A = ll(l, e);
369
- $e(a.value.columnEdit.localStorageKey, A);
370
- }
371
- D("columns-changed", e);
372
- }, qe = () => {
373
- var l, e, o, r, d, n;
374
- if ((e = (l = a.value) == null ? void 0 : l.columnEdit) != null && e.localStorageKey) {
375
- const s = ue(a.value.columnEdit.localStorageKey);
376
- if (s) {
377
- const { fixed: c, active: y } = je(
378
- s,
379
- j.value.headers,
380
- a.value.columnEdit.localStorageKey
381
- );
382
- t.value[(r = (o = a.value) == null ? void 0 : o.columnEdit) == null ? void 0 : r.key].fixed = c, t.value[(n = (d = a.value) == null ? void 0 : d.columnEdit) == null ? void 0 : n.key].active = y, H.value = [...c, ...y];
383
- }
384
- }
385
- }, Qe = (l) => {
386
- t.value.selectedSearchOption = l;
387
- };
388
- return Ee(() => {
389
- var e, o, r, d, n, s, c;
390
- qe();
391
- const l = Ye();
392
- l && (t.value = JSON.parse(l), V.value = V.value || ((e = t.value) == null ? void 0 : e.tabs) || ((d = t.value) == null ? void 0 : d[(r = (o = a.value) == null ? void 0 : o.tabs) == null ? void 0 : r.key]), (n = t.value) != null && n.selectedSearchOption && ie(t.value[(s = t.value) == null ? void 0 : s.selectedSearchOption]), Q.value = ((c = t.value) == null ? void 0 : c.page) || 1, K(null, !0, t.value.cursor, !0));
393
- }), (l, e) => {
394
- var o, r, d, n;
395
- return v(), F("div", nl, [
396
- j.value ? (v(), q(x(He), {
397
- key: 0,
398
- selected: L.selected,
399
- "row-key": L.rowKey,
400
- options: X.value,
401
- "is-loading": L.isLoading,
402
- "loading-rows": I.value,
403
- "row-class": L.rowClass,
404
- "row-link": L.rowLink,
405
- "is-sticky": j.value.isSticky,
406
- "is-borderless": j.value.isBorderless,
407
- "onUpdate:selected": e[8] || (e[8] = (s) => l.$emit("update:selected", s)),
408
- "onClick:row": e[9] || (e[9] = (s) => l.$emit("click:row", s)),
409
- "onHover:cell": e[10] || (e[10] = (s) => l.$emit("hover:cell", s))
410
- }, ze({
411
- after: C(() => [
412
- T(l.$slots, "after")
413
- ]),
414
- empty: C(() => [
415
- T(l.$slots, "empty")
416
- ]),
417
- "table-header": C((s) => [
418
- T(l.$slots, "table-header", he(xe(s)))
419
- ]),
420
- "table-body": C((s) => [
421
- T(l.$slots, "table-body", he(xe(s)))
422
- ]),
423
- _: 2
424
- }, [
425
- l.$slots.before || (o = a.value) != null && o.search || (r = a.value) != null && r.form || (d = a.value) != null && d.tabs ? {
426
- name: "before",
427
- fn: C(() => {
428
- var s, c, y, w;
429
- return [
430
- T(l.$slots, "before"),
431
- (s = a.value) != null && s.search || (c = a.value) != null && c.form || (y = a.value) != null && y.tabs ? (v(), F("div", vl, [
432
- De.value ? (v(), F("div", dl, [
433
- T(l.$slots, "bulk-actions", { selectedRows: L.selected })
434
- ])) : (v(), F("div", cl, [
435
- (w = a.value) != null && w.tabs ? (v(), q(x(Ze), {
436
- key: 0,
437
- modelValue: V.value,
438
- "onUpdate:modelValue": [
439
- e[0] || (e[0] = (S) => V.value = S),
440
- e[1] || (e[1] = (S) => K(null, !1, "", !1, !0))
441
- ],
442
- "is-disabled": L.isLoading,
443
- tabs: a.value.tabs.options,
444
- variant: "pills"
445
- }, null, 8, ["modelValue", "is-disabled", "tabs"])) : $("", !0)
446
- ])),
447
- T(l.$slots, "filter-options", {}, () => {
448
- var S, A, P, U, Y, J, B, u, E, f, h;
449
- return [
450
- (S = a.value) != null && S.search || (A = a.value) != null && A.form || (P = a.value) != null && P.columnEdit ? (v(), F("div", {
451
- key: 0,
452
- class: oe([
453
- "flex gap-3 absolute ml-auto bg-oc-bg-light right-4 max-w-[calc(100%-24px)]",
454
- a.value ? re.value ? "md:w-fit w-full" : "" : "w-full justify-end"
455
- ])
456
- }, [
457
- (U = a.value) != null && U.search ? (v(), q(x(Ge), {
458
- key: 0,
459
- "is-search-only": !a.value.tabs || a.value.isSearchOnly,
460
- "search-options": ((Y = a.value.search) == null ? void 0 : Y.options) ?? [],
461
- "selected-option": (((J = t.value) == null ? void 0 : J.selectedSearchOption) || ((E = (u = (B = a.value.search) == null ? void 0 : B.options) == null ? void 0 : u[0]) == null ? void 0 : E.value)) ?? "keywords",
462
- onAddQuery: ie,
463
- onToggle: e[2] || (e[2] = (i) => re.value = i),
464
- onChangeSearchKey: Qe
465
- }, null, 8, ["is-search-only", "search-options", "selected-option"])) : $("", !0),
466
- (f = a.value) != null && f.form ? (v(), q(x(Ve), {
467
- key: 1,
468
- modelValue: O.value,
469
- "onUpdate:modelValue": [
470
- e[6] || (e[6] = (i) => O.value = i),
471
- e[7] || (e[7] = (i) => l.$emit("filter-open", i))
472
- ],
473
- distance: 9,
474
- placement: "bottom-end",
475
- "is-attach-to-body": ""
476
- }, {
477
- menu: C(() => [
478
- O.value ? (v(), q(x(We), {
479
- key: 0,
480
- id: L.id,
481
- "json-form": a.value.form ?? [],
482
- grid: a.value.grid ?? null,
483
- values: p.filter,
484
- actions: a.value.actions,
485
- onApplyFilter: e[3] || (e[3] = (i) => K(i)),
486
- onFilterFieldsChanged: e[4] || (e[4] = (i) => D("filter-fields-changed", i)),
487
- onCancel: e[5] || (e[5] = (i) => O.value = !1)
488
- }, {
489
- default: C(({ errors: i, values: G, jsonForm: le, updateForm: Re }) => [
490
- T(l.$slots, "custom-filter-form", {
491
- errors: i,
492
- values: G,
493
- jsonForm: le,
494
- updateFilter: Re
495
- })
496
- ]),
497
- _: 3
498
- }, 8, ["id", "json-form", "grid", "values", "actions"])) : $("", !0)
499
- ]),
500
- default: C(() => [
501
- R(x(Fe), {
502
- "is-active": O.value,
503
- variant: "secondary",
504
- "left-icon": "filter"
505
- }, null, 8, ["is-active"])
506
- ]),
507
- _: 3
508
- }, 8, ["modelValue"])) : $("", !0),
509
- a.value.columnEdit ? (v(), q(il, {
510
- key: 2,
511
- options: t.value.columnEdit,
512
- headers: ((h = j.value) == null ? void 0 : h.headers) || [],
513
- "local-key": a.value.columnEdit.localStorageKey,
514
- onUpdateOrder: Te
515
- }, null, 8, ["options", "headers", "local-key"])) : $("", !0)
516
- ], 2)) : $("", !0)
517
- ];
518
- })
519
- ])) : $("", !0),
520
- R(x(Xe), {
521
- filters: Ne.value,
522
- queries: z.value,
523
- class: "border-t border-oc-gray-200",
524
- onRemoveQuery: Ke,
525
- onRemoveAll: Le,
526
- onRemoveFilter: Be
527
- }, null, 8, ["filters", "queries"])
528
- ];
529
- }),
530
- key: "0"
531
- } : void 0,
532
- se((n = j.value) == null ? void 0 : n.headers, (s, c) => ({
533
- name: s.key,
534
- fn: C(({ data: y, item: w }) => [
535
- T(l.$slots, s.key, {
536
- data: y,
537
- item: w
538
- })
539
- ])
540
- }))
541
- ]), 1032, ["selected", "row-key", "options", "is-loading", "loading-rows", "row-class", "row-link", "is-sticky", "is-borderless"])) : $("", !0),
542
- T(l.$slots, "before-pagination"),
543
- m.value || g.value ? (v(), F("div", {
544
- key: 1,
545
- class: oe(["flex items-center gap-3", m.value && m.value.last_page === 1 ? "justify-end" : ""])
546
- }, [
547
- m.value && !k.value ? (v(), q(x(_e), {
548
- key: 0,
549
- modelValue: Q.value,
550
- "onUpdate:modelValue": [
551
- e[11] || (e[11] = (s) => Q.value = s),
552
- Pe
553
- ],
554
- class: "justify-center",
555
- "max-page": m.value.last_page,
556
- strategy: m.value.strategy,
557
- "total-visible": "5"
558
- }, null, 8, ["modelValue", "max-page", "strategy"])) : $("", !0),
559
- g.value ? (v(), F("div", fl, [
560
- R(x(Se), {
561
- disabled: !g.value.prev,
562
- onClick: e[12] || (e[12] = (s) => g.value.prev ? K(null, !1, g.value.prev) : null)
563
- }, null, 8, ["disabled"]),
564
- R(x(Se), {
565
- disabled: !g.value.next,
566
- "is-next": "",
567
- onClick: e[13] || (e[13] = (s) => g.value.next ? K(null, !1, g.value.next) : null)
568
- }, null, 8, ["disabled"])
569
- ])) : $("", !0),
570
- b.value ? $("", !0) : (v(), F("div", pl, [
571
- R(x(el), {
572
- modelValue: I.value,
573
- "onUpdate:modelValue": [
574
- e[14] || (e[14] = (s) => I.value = s),
575
- e[15] || (e[15] = (s) => K(null))
576
- ],
577
- label: "Item per page",
578
- "is-inline-label": "",
579
- "popper-options": { placement: "auto" },
580
- options: Ce.value
581
- }, null, 8, ["modelValue", "options"])
582
- ]))
583
- ], 2)) : $("", !0)
584
- ]);
585
- };
586
- }
587
- };
588
- export {
589
- xl as default
590
- };