@orchidui/core 0.0.1 → 0.2.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 (169) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/dist/Calendar.js +103 -0
  4. package/dist/Cropper.js +6 -0
  5. package/dist/DataDisplay/CustomerCard/OcCustomerCard.js +4 -0
  6. package/dist/DataDisplay/FloatContent/OcFloatContent.js +4 -0
  7. package/dist/DataDisplay/HorizontalProgressbar/OcHorizontalProgressbar.js +4 -0
  8. package/dist/DataDisplay/InfoCard/OcInfoCard.js +4 -0
  9. package/dist/DataDisplay/ListDetail/OcListDetail.js +4 -0
  10. package/dist/DataDisplay/ListItem/OcListItem.js +5 -0
  11. package/dist/DataDisplay/OnboardingListItem/OcOnboardingListItem.js +4 -0
  12. package/dist/DataDisplay/Overview/OcOverview.js +7 -0
  13. package/dist/DataDisplay/Pagination/OcPagination.js +6 -0
  14. package/dist/DataDisplay/ProgressBar/OcProgressBar.js +4 -0
  15. package/dist/DataDisplay/Table/OcTable.js +11 -0
  16. package/dist/DataDisplay/TransferSummary/OcTransferSummary.js +4 -0
  17. package/dist/DatePicker-D3w435Ml.js +263 -0
  18. package/dist/Disclosure/Accordion/OcAccordion.js +4 -0
  19. package/dist/Disclosure/OnboardingAccordion/OnboardingAccordion.js +4 -0
  20. package/dist/Disclosure/Steps/OcSteps.js +5 -0
  21. package/dist/Disclosure/SwitchTabs/OcSwitchTabs.js +4 -0
  22. package/dist/Disclosure/Tabs/Tabs.js +5 -0
  23. package/dist/Disclosure/Variants/OcVariants.js +5 -0
  24. package/dist/Draggable.js +168 -0
  25. package/dist/Elements/AdditionalContent/OcAdditionalContent.js +5 -0
  26. package/dist/Elements/AuthenticationOption/AuthenticationOption.js +4 -0
  27. package/dist/Elements/Box/OcBox.js +4 -0
  28. package/dist/Elements/EmptyPage/OcEmptyPage.js +4 -0
  29. package/dist/Elements/FeatureOverviewCard/OcFeatureOverviewCard.js +4 -0
  30. package/dist/Elements/Header/OcHeader.js +9 -0
  31. package/dist/Elements/PageTitle/OcPageTitle.js +7 -0
  32. package/dist/Elements/SandboxBanner/OcSandboxBanner.js +4 -0
  33. package/dist/Elements/Sidebar/OcSidebar.js +6 -0
  34. package/dist/Elements/Skeleton/OcSkeleton.js +4 -0
  35. package/dist/Elements/SubSidebar/OcSubSidebar.js +4 -0
  36. package/dist/Elements/VerificationOption/OcVerificationOption.js +4 -0
  37. package/dist/EmojiPicker.js +4 -0
  38. package/dist/Feedback/Banner/OcBanner.js +4 -0
  39. package/dist/Feedback/Chip/OcChip.js +4 -0
  40. package/dist/Feedback/ShareIcon/OcShareIcon.js +4 -0
  41. package/dist/Feedback/Snackbar/OcSnackbar.js +4 -0
  42. package/dist/Feedback/Tag/OcTag.js +4 -0
  43. package/dist/Form/BaseInput/OcBaseInput.js +4 -0
  44. package/dist/Form/Button/OcButton.js +4 -0
  45. package/dist/Form/Calendar/OcCalendar.js +5 -0
  46. package/dist/Form/CardInput/OcCardInput.js +4 -0
  47. package/dist/Form/Checkbox/OcCheckbox.js +4 -0
  48. package/dist/Form/CheckboxesGroup/OcCheckboxesGroup.js +4 -0
  49. package/dist/Form/Criteria/OcCriteria.js +4 -0
  50. package/dist/Form/Cropper/OcCropper.js +4 -0
  51. package/dist/Form/DatePicker/OcDatePicker.js +4 -0
  52. package/dist/Form/EmojiPicker/OcEmojiPicker.js +4 -0
  53. package/dist/Form/EmojiPicker/conts/emoji.js +1030 -0
  54. package/dist/Form/Input/OcInput.js +6 -0
  55. package/dist/Form/LinkInput/OcLinkInput.js +4 -0
  56. package/dist/Form/MultipleUploadFile/OcMultipleUploadFile.js +4 -0
  57. package/dist/Form/NumberInput/OcNumberInput.js +4 -0
  58. package/dist/Form/PhoneInput/OcPhoneInput.js +4 -0
  59. package/dist/Form/Radio/OcRadio.js +4 -0
  60. package/dist/Form/RadioGroup/OcRadioGroup.js +4 -0
  61. package/dist/Form/RangeInput/OcRangeInput.js +4 -0
  62. package/dist/Form/SectionItem/OcSectionItem.js +4 -0
  63. package/dist/Form/Select/OcSelect.js +7 -0
  64. package/dist/Form/SelectOptions/OcSelectOptions.js +4 -0
  65. package/dist/Form/SingleFileUpload/OcSingleFileUpload.js +4 -0
  66. package/dist/Form/Slider/OcSlider.js +4 -0
  67. package/dist/Form/TextArea/OcTextArea.js +4 -0
  68. package/dist/Form/TimePicker/OcTimePicker.js +6 -0
  69. package/dist/Form/Toggle/OcToggle.js +4 -0
  70. package/dist/Form/index.js +54 -0
  71. package/dist/FormBuilder/OcFormBuilder.js +4 -0
  72. package/dist/MediaAndIcons/Avatar/OcAvatar.js +4 -0
  73. package/dist/MediaAndIcons/Icon/OcIcon.js +4 -0
  74. package/dist/OcAccordion-DdkNsXvN.js +101 -0
  75. package/dist/OcAccountSetup-BXDjf48o.js +324 -0
  76. package/dist/OcAdditionalContent-BMSysCXu.js +612 -0
  77. package/dist/OcAuthenticationOption.vue_vue_type_script_setup_true_lang-w5Y0ymGN.js +43 -0
  78. package/dist/OcAvatar-NDXQiZvz.js +41 -0
  79. package/dist/OcBanner-Cg2WJV6e.js +108 -0
  80. package/dist/OcBox.vue_vue_type_script_setup_true_lang-aB397QRg.js +43 -0
  81. package/dist/OcCardInput-BFE4Xu-S.js +75 -0
  82. package/dist/OcCheckboxesGroup-CLbquUO2.js +94 -0
  83. package/dist/OcChip-B1hm2Qni.js +144 -0
  84. package/dist/OcComplexCalendar-x-_kg9Yk.js +108 -0
  85. package/dist/OcComplexCalendar.vue_vue_type_style_index_0_lang-CIQPD-6N.js +1006 -0
  86. package/dist/OcConfirmationModal-BfCrRV9r.js +179 -0
  87. package/dist/OcCopyTooltip.vue_vue_type_script_setup_true_lang-S2RAfV_g.js +65 -0
  88. package/dist/OcCriteria-CpIohheZ.js +42 -0
  89. package/dist/OcCropper-31Y_S1Ne.js +240 -0
  90. package/dist/OcCustomerCard-DbDOBO03.js +160 -0
  91. package/dist/OcDraggable-BjhGJmpM.js +35 -0
  92. package/dist/OcDropdownItem-DAElmzEu.js +57 -0
  93. package/dist/OcEmojiPicker-BXm-_OGK.js +157 -0
  94. package/dist/OcEmptyPage-CTwgMzRp.js +155 -0
  95. package/dist/OcExpadingTable.vue_vue_type_script_setup_true_lang-B4HOMDBK.js +815 -0
  96. package/dist/OcFeatureOverviewCard-RVyrWLVW.js +71 -0
  97. package/dist/OcFloatContent-BIKQOxSw.js +142 -0
  98. package/dist/OcFormBuilder-CRXWtt8I.js +177 -0
  99. package/dist/OcGroupOptions-ChGJvTXl.js +16 -0
  100. package/dist/OcHorizontalProgressbar.vue_vue_type_script_setup_true_lang-4eVgPDi5.js +32 -0
  101. package/dist/OcIcon-CJgBICxh.js +63 -0
  102. package/dist/OcInfoCard-DpYUZOMZ.js +81 -0
  103. package/dist/OcInput-tcRxG3Y2.js +227 -0
  104. package/dist/OcInputOption-CncASfNt.js +160 -0
  105. package/dist/OcLinkInput-C2ixk-gk.js +143 -0
  106. package/dist/OcListDetail-6XeME6ko.js +76 -0
  107. package/dist/OcListUrl.vue_vue_type_script_setup_true_lang-BEJafLuT.js +749 -0
  108. package/dist/OcModal-DdD5VFEN.js +187 -0
  109. package/dist/OcModalCropper-D2OI2iun.js +56 -0
  110. package/dist/OcModalPage-BLVa-kcB.js +86 -0
  111. package/dist/OcMultipleUploadFile-B8Wl9Fuq.js +446 -0
  112. package/dist/OcNumberInput.vue_vue_type_script_setup_true_lang-C4EXUIUe.js +90 -0
  113. package/dist/OcOnboardingListItem.vue_vue_type_script_setup_true_lang-Cr80xmnz.js +81 -0
  114. package/dist/OcOption-DK2FBGq7.js +485 -0
  115. package/dist/OcOverviewIcon-D702Ujka.js +55 -0
  116. package/dist/OcOverviewItem-DNr5tWnt.js +186 -0
  117. package/dist/OcPageTitleRight-DMtJ1qmZ.js +243 -0
  118. package/dist/OcPaginationNumber-IKPorX26.js +172 -0
  119. package/dist/OcPaymentTab-Cna1IAhO.js +170 -0
  120. package/dist/OcPhoneInput-AC6BgQhN.js +432 -0
  121. package/dist/OcPopper-C11OgQAj.js +97 -0
  122. package/dist/OcPrimaryActions-D5IprKsQ.js +222 -0
  123. package/dist/OcProgressBar-hiyC5XSc.js +33 -0
  124. package/dist/OcRadio-CRYfNwV9.js +107 -0
  125. package/dist/OcRadioGroup-DgfdWJos.js +76 -0
  126. package/dist/OcRangeInput-C-hoHFhr.js +103 -0
  127. package/dist/OcSandboxBanner.vue_vue_type_script_setup_true_lang-BD0k_8xa.js +37 -0
  128. package/dist/OcSectionItem-BFgxO3se.js +84 -0
  129. package/dist/OcSelectOptions-BQlG_EUA.js +148 -0
  130. package/dist/OcShareIcon-BB-NPq0r.js +53 -0
  131. package/dist/OcSingleFileUpload-B8-e1H5t.js +464 -0
  132. package/dist/OcSkeleton-BdPTmGh0.js +13 -0
  133. package/dist/OcSlider-Bsi-ckbP.js +124 -0
  134. package/dist/OcSnackbar-CKxY1-ej.js +196 -0
  135. package/dist/OcSteps.vue_vue_type_script_setup_true_lang-CXGy8ma_.js +87 -0
  136. package/dist/OcSubSidebar.vue_vue_type_script_setup_true_lang-CNxgU07N.js +60 -0
  137. package/dist/OcSupportMenu.vue_vue_type_script_setup_true_lang-DrjZsWti.js +114 -0
  138. package/dist/OcSwitchTabs-CYp676bj.js +31 -0
  139. package/dist/OcTabToSelect-BHAz1Niv.js +183 -0
  140. package/dist/OcTag.vue_vue_type_script_setup_true_lang-D19lw-8Y.js +26 -0
  141. package/dist/OcTextArea-BpV1Bnj_.js +78 -0
  142. package/dist/OcTheme-CWgrJh5Q.js +25 -0
  143. package/dist/OcTimePicker-B61MCi0D.js +110 -0
  144. package/dist/OcTimePopup-zQFKCZLk.js +131 -0
  145. package/dist/OcToggle-C0wTjM_Y.js +54 -0
  146. package/dist/OcTransferSummary-Bk2GXhrT.js +67 -0
  147. package/dist/OcVariant.vue_vue_type_script_setup_true_lang-CY_82DLc.js +99 -0
  148. package/dist/OcVerificationOption.vue_vue_type_script_setup_true_lang-ChqvNoDe.js +59 -0
  149. package/dist/OcWhiteList.vue_vue_type_script_setup_true_lang-DI9pYU3w.js +64 -0
  150. package/dist/OnboardingAccordion.vue_vue_type_script_setup_true_lang-B0Z7ETmj.js +113 -0
  151. package/dist/Overlay/ConfirmationModal/OcConfirmationModal.js +4 -0
  152. package/dist/Overlay/CopyTooltip/OcCopyTooltip.js +4 -0
  153. package/dist/Overlay/Dropdown/OcDropdown.js +6 -0
  154. package/dist/Overlay/Modal/OcModal.js +6 -0
  155. package/dist/Overlay/Popper/OcPopper.js +4 -0
  156. package/dist/Overlay/SupportMenu/OcSupportMenu.js +4 -0
  157. package/dist/Overlay/Tooltip/OcTooltip.js +4 -0
  158. package/dist/Overlay/Whitelist/OcWhiteList.js +4 -0
  159. package/dist/StoreDesign.js +240 -0
  160. package/dist/Theme/OcTheme.js +4 -0
  161. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  162. package/dist/composables/helpers.js +48 -0
  163. package/dist/composables/uploadFileProgress.js +62 -0
  164. package/dist/composables/useWindowWidth.js +10 -0
  165. package/dist/data/Validator.js +5 -0
  166. package/dist/directives/clickOutside.js +13 -0
  167. package/dist/index.js +177 -1
  168. package/dist/style.css +1 -0
  169. package/package.json +23 -5
@@ -0,0 +1,815 @@
1
+ import { computed as S, ref as j, onMounted as te, openBlock as t, createElementBlock as a, normalizeClass as y, renderSlot as g, createCommentVNode as p, createElementVNode as b, createBlock as r, unref as s, Fragment as w, renderList as C, withCtx as $, createTextVNode as A, toDisplayString as T, createVNode as H, mergeProps as z, normalizeProps as le, guardReactiveProps as ie, withModifiers as ae, defineComponent as Y, normalizeStyle as U, createSlots as X } from "vue";
2
+ import G from "dayjs";
3
+ import { a as _, T as J } from "./OcComplexCalendar.vue_vue_type_style_index_0_lang-CIQPD-6N.js";
4
+ import { S as F } from "./OcSkeleton-BdPTmGh0.js";
5
+ import "libphonenumber-js";
6
+ /* empty css */
7
+ import "v-calendar";
8
+ /* empty css */
9
+ import "./Cropper.js";
10
+ import "vue-draggable-next";
11
+ import "@popperjs/core";
12
+ import { _ as I } from "./OcIcon-CJgBICxh.js";
13
+ import { _ as ne } from "./OcChip-B1hm2Qni.js";
14
+ import { _ as se } from "./OcCopyTooltip.vue_vue_type_script_setup_true_lang-S2RAfV_g.js";
15
+ /* empty css */
16
+ const oe = {
17
+ key: 0,
18
+ class: "flex relative group/row md:p-0 py-3 w-full"
19
+ }, Pe = {
20
+ __name: "OcTable",
21
+ props: {
22
+ options: {
23
+ type: Object,
24
+ required: !0
25
+ },
26
+ isLoading: Boolean,
27
+ isBorderless: Boolean,
28
+ loadingRows: {
29
+ type: Number,
30
+ default: 10
31
+ },
32
+ selected: {
33
+ type: Array,
34
+ required: !1
35
+ },
36
+ rowKey: {
37
+ type: [String, Function],
38
+ default: "id"
39
+ },
40
+ rowClass: [String, Function],
41
+ isSticky: {
42
+ type: Boolean,
43
+ default: !1
44
+ },
45
+ isResponsive: {
46
+ type: Boolean,
47
+ default: !1
48
+ },
49
+ rowLink: String
50
+ },
51
+ emits: {
52
+ "click:row": [],
53
+ "update:selected": [],
54
+ "hover:cell": []
55
+ },
56
+ setup(e, { emit: n }) {
57
+ const l = e, f = n, x = S(() => l.options.isSelectable), h = S(() => l.options.isCursorPointer ?? !0), u = S(() => l.options.fields), d = S(() => l.options.headers), v = S(
58
+ () => typeof l.rowKey == "function" ? l.rowKey : (c) => c[l.rowKey]
59
+ ), k = S({
60
+ get() {
61
+ return l.selected || [];
62
+ },
63
+ set(c) {
64
+ f("update:selected", c);
65
+ }
66
+ }), K = (c) => {
67
+ k.value.find((i) => v.value(i) === v.value(c)) ? k.value = k.value.filter(
68
+ (i) => v.value(i) !== v.value(c)
69
+ ) : k.value = [...k.value, c];
70
+ }, m = () => {
71
+ const c = k.value.length === u.value.length;
72
+ k.value = c ? [] : [...u.value];
73
+ }, M = S(() => typeof l.rowClass == "function" ? (c, L) => l.rowClass(c, L) : () => l.rowClass), P = (c, L) => {
74
+ !L.disableClickRow && L.key !== "actions" && f("click:row", {
75
+ field: c,
76
+ header: L
77
+ });
78
+ }, B = j(!0), O = j(!0), R = j(), W = () => {
79
+ l.isSticky && (B.value = R.value.scrollLeft === 0, O.value = R.value.scrollLeft + R.value.clientWidth === R.value.scrollWidth);
80
+ };
81
+ return te(() => W()), (c, L) => (t(), a("div", {
82
+ ref_key: "scrollTable",
83
+ ref: R,
84
+ class: y(["flex text-oc-text flex-col border-oc-gray-200 isolate z-10", [
85
+ e.isSticky ? "overflow-x-auto" : "overflow-hidden",
86
+ e.isResponsive ? "rounded" : "md:rounded",
87
+ e.isBorderless ? "" : "border"
88
+ ]]),
89
+ onScroll: W
90
+ }, [
91
+ c.$slots.before ? (t(), a("div", {
92
+ key: 0,
93
+ class: y(["border-b border-oc-gray-200", {
94
+ "sticky left-0": e.isSticky
95
+ }])
96
+ }, [
97
+ g(c.$slots, "before")
98
+ ], 2)) : p("", !0),
99
+ g(c.$slots, "table-header", {
100
+ fields: u.value,
101
+ headers: d.value,
102
+ isSelectable: x.value,
103
+ isResponsive: e.isResponsive,
104
+ selectAllRows: m
105
+ }, () => [
106
+ b("div", {
107
+ class: y(["flex md:border-b-0 border-b border-oc-gray-200", e.isResponsive ? "w-full" : e.isSticky ? "w-max" : "flex-wrap md:flex-nowrap"])
108
+ }, [
109
+ x.value ? (t(), r(s(Q), {
110
+ key: 0,
111
+ "is-sticky": e.isSticky,
112
+ class: y(["md:ml-0 md:border-b border-oc-gray-200 min-w-[32px]", [e.isSticky ? "shrink-0 sticky left-0 z-10" : "w-[40px] md:w-[5%]"]]),
113
+ variant: "checkbox",
114
+ "is-partial": k.value.length !== u.value.length && k.value.length > 0,
115
+ "is-checked": k.value.length === u.value.length && k.value.length > 0,
116
+ onSelectAll: m
117
+ }, null, 8, ["is-sticky", "class", "is-partial", "is-checked"])) : p("", !0),
118
+ (t(!0), a(w, null, C(d.value, (i) => (t(), r(s(Q), {
119
+ key: i.key,
120
+ text: i.label,
121
+ "is-loading": e.isLoading,
122
+ variant: i.headerVariant,
123
+ "is-sticky": e.isSticky,
124
+ class: y([[
125
+ e.isSticky || e.isResponsive ? "flex md:min-h-auto" : "hidden md:flex",
126
+ i.stickyLeft && x.value ? "left-[40px] md:left-[32px]" : "left-0",
127
+ i.stickyRight ? "right-0" : "",
128
+ typeof i.class == "function" ? i.class() : i.class,
129
+ i.stickyLeft || i.stickyRight ? "sticky shrink-0 z-10" : "",
130
+ i.stickyLeft && !B.value ? "shadow-right-sticky" : "",
131
+ i.stickyRight && !O.value ? "shadow-left-sticky" : ""
132
+ ], "md:border-b border-oc-gray-200"])
133
+ }, {
134
+ default: $(() => [
135
+ g(c.$slots, `header-${i.key}`)
136
+ ]),
137
+ _: 2
138
+ }, 1032, ["text", "is-loading", "variant", "is-sticky", "class"]))), 128))
139
+ ], 2)
140
+ ]),
141
+ e.isLoading ? (t(!0), a(w, { key: 1 }, C(e.loadingRows, (i) => (t(), a("div", {
142
+ key: i,
143
+ class: y(["flex flex-wrap md:flex-nowrap group/row border-oc-gray-200 md:p-0 py-3", {
144
+ "pl-[40px]": x.value,
145
+ "border-b": e.isBorderless
146
+ }])
147
+ }, [
148
+ x.value ? (t(), r(s(V), {
149
+ key: 0,
150
+ class: "opacity-0 flex justify-center absolute left-0 md:relative w-[5%]"
151
+ })) : p("", !0),
152
+ (t(!0), a(w, null, C(d.value, (E, o) => (t(), r(s(V), {
153
+ key: `${o}-${i}`,
154
+ class: y(E.class),
155
+ "is-loading": "",
156
+ "is-last": i === e.loadingRows
157
+ }, null, 8, ["class", "is-last"]))), 128))
158
+ ], 2))), 128)) : (t(), a(w, { key: 2 }, [
159
+ g(c.$slots, "table-body", {
160
+ fields: u.value,
161
+ headers: d.value,
162
+ isScrollOnEnd: O.value,
163
+ onClickRow: P,
164
+ isSelectable: x.value,
165
+ isCursorPointer: h.value,
166
+ isResponsive: e.isResponsive,
167
+ isSticky: e.isSticky,
168
+ rowLink: e.rowLink,
169
+ calculateRowClass: M.value
170
+ }, () => [
171
+ (t(!0), a(w, null, C(u.value, (i, E) => (t(), a("div", {
172
+ key: `${v.value(i)}-${E}`,
173
+ class: y({
174
+ "border-b": u.value.length !== E + 1,
175
+ "w-max": e.isSticky
176
+ })
177
+ }, [
178
+ b("div", {
179
+ class: y(["flex relative group/row md:p-0 py-3 min-h-[58px]", [
180
+ {
181
+ "pl-[40px]": x.value,
182
+ "cursor-pointer": h.value
183
+ },
184
+ e.isResponsive ? "w-full" : e.isSticky ? "w-max !p-0" : "flex-wrap md:flex-nowrap",
185
+ M.value(i, E)
186
+ ]])
187
+ }, [
188
+ x.value ? (t(), r(s(V), {
189
+ key: 0,
190
+ class: y(["flex border-oc-gray-200 justify-center left-0 min-w-[32px]", [
191
+ e.isSticky ? "shrink-0 z-10 left-0 sticky" : "md:relative absolute w-[40px] md:w-[5%]"
192
+ ]]),
193
+ "is-last": u.value.length === E + 1,
194
+ "is-selected": k.value.some((o) => v.value(o) === v.value(i)),
195
+ variant: "checkbox",
196
+ onSelected: (o) => K(i),
197
+ "onHover:field": L[0] || (L[0] = (o) => c.$emit("hover:cell", o))
198
+ }, null, 8, ["is-last", "is-selected", "class", "onSelected"])) : p("", !0),
199
+ (t(!0), a(w, null, C(d.value, (o, ee) => (t(), r(s(V), {
200
+ key: `${ee}-${E}`,
201
+ class: y(["flex border-oc-gray-200", [
202
+ typeof o.class == "function" ? o.class(i) : o.class,
203
+ o.stickyLeft && x.value ? "left-[40px] md:left-[32px]" : "left-0",
204
+ o.stickyRight ? "right-0" : "",
205
+ o.stickyLeft || o.stickyRight ? "shrink-0 sticky z-10" : "",
206
+ o.stickyLeft && !B.value ? "shadow-right-sticky" : "",
207
+ o.stickyRight && !O.value ? "shadow-left-sticky" : ""
208
+ ]]),
209
+ "is-last": u.value.length === E + 1,
210
+ variant: o.variant,
211
+ "is-copy": o.isCopy,
212
+ "add-description-to-copy-clipboard": o.addDescriptionToCopyClipboard ?? !0,
213
+ data: i[`${o.key}`] ?? "",
214
+ content: {
215
+ important: o.important ?? !1,
216
+ title: i[`${o.title}`],
217
+ description: i[`${o.description}`],
218
+ href: i[`${o.href}`]
219
+ },
220
+ "chip-options": o.chipOptions,
221
+ "image-class": o.imageClass,
222
+ link: e.rowLink && i[e.rowLink] ? i[e.rowLink] : "",
223
+ onClick: (q) => P(i, o),
224
+ "onHover:field": L[1] || (L[1] = (q) => c.$emit("hover:cell", q))
225
+ }, {
226
+ default: $(() => [
227
+ c.$slots[o.key] ? g(c.$slots, o.key, {
228
+ key: 0,
229
+ item: i,
230
+ data: i[o.key],
231
+ index: E
232
+ }) : p("", !0)
233
+ ]),
234
+ _: 2
235
+ }, 1032, ["is-last", "variant", "is-copy", "add-description-to-copy-clipboard", "data", "content", "chip-options", "class", "image-class", "link", "onClick"]))), 128))
236
+ ], 2),
237
+ c.$slots.extra ? (t(), a("div", oe, [
238
+ g(c.$slots, "extra", {
239
+ item: i,
240
+ index: E
241
+ })
242
+ ])) : p("", !0)
243
+ ], 2))), 128))
244
+ ]),
245
+ u.value.length ? p("", !0) : g(c.$slots, "empty", { key: 0 })
246
+ ], 64)),
247
+ g(c.$slots, "after")
248
+ ], 34));
249
+ }
250
+ }, re = { class: "mx-auto" }, Q = {
251
+ __name: "OcTableHeader",
252
+ props: {
253
+ variant: {
254
+ type: String,
255
+ default: "text",
256
+ validator: (e) => ["text", "checkbox"].includes(e)
257
+ },
258
+ text: String,
259
+ isPartial: Boolean,
260
+ isChecked: Boolean,
261
+ isSticky: Boolean,
262
+ isLoading: Boolean
263
+ },
264
+ emits: {
265
+ selectAll: []
266
+ },
267
+ setup(e) {
268
+ const n = {
269
+ TEXT: "text",
270
+ CHECKBOX: "checkbox"
271
+ }, l = S(() => ({
272
+ text: "px-4 py-3",
273
+ checkbox: "p-4 md:p-3"
274
+ }));
275
+ return (f, x) => (t(), a("div", {
276
+ class: y(["whitespace-nowrap text-start uppercase text-oc-text-400 leading-[18px] text-xs font-medium bg-oc-gray-50 flex items-center gap-3", l.value[e.variant]])
277
+ }, [
278
+ e.isLoading ? (t(), r(s(F), {
279
+ key: 0,
280
+ class: "rounded-full w-full overflow-hidden h-6"
281
+ })) : (t(), a(w, { key: 1 }, [
282
+ e.variant === n.TEXT ? g(f.$slots, "default", { key: 0 }, () => [
283
+ A(T(e.text), 1)
284
+ ]) : g(f.$slots, "default", { key: 1 }, () => [
285
+ b("div", re, [
286
+ H(s(_), {
287
+ "model-value": e.isChecked,
288
+ "is-partial": e.isPartial,
289
+ "onUpdate:modelValue": x[0] || (x[0] = (h) => f.$emit("selectAll", h))
290
+ }, null, 8, ["model-value", "is-partial"])
291
+ ]),
292
+ b("span", {
293
+ class: y(["text-oc-text-500", e.isSticky ? "hidden" : "md:hidden"])
294
+ }, "Select all", 2)
295
+ ])
296
+ ], 64))
297
+ ], 2));
298
+ }
299
+ }, ce = ["src"], V = {
300
+ __name: "OcTableCell",
301
+ props: {
302
+ isSimple: Boolean,
303
+ variant: {
304
+ type: String,
305
+ default: "default"
306
+ },
307
+ isLast: Boolean,
308
+ isCopy: Boolean,
309
+ addDescriptionToCopyClipboard: Boolean,
310
+ isSelected: Boolean,
311
+ data: [String, Number, Object, Array, Boolean],
312
+ isLoading: Boolean,
313
+ chipOptions: Object,
314
+ content: {
315
+ type: Object,
316
+ default() {
317
+ return {
318
+ title: null,
319
+ description: null
320
+ };
321
+ }
322
+ },
323
+ datetime: String,
324
+ imageClass: {
325
+ type: String,
326
+ default: "h-full"
327
+ },
328
+ link: String
329
+ },
330
+ emits: {
331
+ selected: [],
332
+ copied: [],
333
+ "click:field": [],
334
+ "hover:field": []
335
+ },
336
+ setup(e) {
337
+ const n = {
338
+ CHECKBOX: "checkbox",
339
+ CONTENT: "content",
340
+ CHIP: "chip",
341
+ DATETIME: "datetime",
342
+ ICON: "icon",
343
+ IMAGE: "image",
344
+ EMPTY: "empty",
345
+ DEFAULT: "default"
346
+ }, l = e, f = S(() => l.data || l.content.title || l.content.description), x = S(() => {
347
+ const u = l.chipOptions[l.data];
348
+ return typeof u == "object" ? {
349
+ label: u.label || l.data,
350
+ ...u
351
+ } : {
352
+ label: l.data,
353
+ variant: u
354
+ };
355
+ }), h = S(() => ({
356
+ [n.CHECKBOX]: "md:px-2 px-4 min-w-[32px]",
357
+ [n.ICON]: "md:px-2 px-4 min-w-[32px] ",
358
+ [n.IMAGE]: "md:px-2 px-4 min-w-[32px]",
359
+ [n.CONTENT]: "px-4",
360
+ [n.CHIP]: "px-4",
361
+ [n.DATETIME]: "px-4",
362
+ [n.EMPTY]: "px-4 min-w-[48px]",
363
+ [n.DEFAULT]: "px-4"
364
+ }));
365
+ return (u, d) => {
366
+ var v;
367
+ return t(), a("div", {
368
+ class: y([[
369
+ h.value[e.variant],
370
+ {
371
+ "flex items-center": e.isLoading,
372
+ "md:px-4 px-3 py-1": e.variant !== n.CHECKBOX
373
+ }
374
+ ], "md:py-3 bg-oc-bg-light md:min-h-[58px] md:group-hover/row:bg-oc-gray-50 items-center"])
375
+ }, [
376
+ e.isLoading ? (t(), r(s(F), {
377
+ key: 0,
378
+ class: "rounded-full w-full overflow-hidden h-6"
379
+ })) : (t(), a("div", {
380
+ key: 1,
381
+ class: y(["w-full flex", e.isCopy ? "justify-between" : "justify-start"]),
382
+ onMouseover: d[1] || (d[1] = (k) => u.$emit("hover:field", l))
383
+ }, [
384
+ g(u.$slots, "default", {}, () => [
385
+ e.variant === n.CHECKBOX ? (t(), r(s(_), {
386
+ key: 0,
387
+ "model-value": e.isSelected,
388
+ class: y(["m-auto justify-center items-center", e.isSelected ? "flex" : e.isSimple ? "" : "md:hidden group-hover/row:flex"]),
389
+ "onUpdate:modelValue": d[0] || (d[0] = (k) => u.$emit("selected"))
390
+ }, null, 8, ["model-value", "class"])) : e.variant === n.ICON ? (t(), r(s(I), {
391
+ key: 1,
392
+ class: "w-6 h-6 mx-auto",
393
+ name: e.data
394
+ }, null, 8, ["name"])) : e.variant === n.IMAGE ? (t(), a(w, { key: 2 }, [
395
+ e.data ? (t(), r(s(N), {
396
+ key: 0,
397
+ link: e.link,
398
+ class: "h-[42px] min-w-[42px] rounded mx-auto"
399
+ }, {
400
+ default: $(() => [
401
+ b("img", {
402
+ class: y([e.imageClass, "h-full"]),
403
+ alt: "table-img",
404
+ src: e.data
405
+ }, null, 10, ce)
406
+ ]),
407
+ _: 1
408
+ }, 8, ["link"])) : (t(), r(s(N), {
409
+ key: 1,
410
+ link: e.link,
411
+ class: "h-[42px] mx-auto w-[42px] bg-oc-bg-dark flex items-center justify-center rounded"
412
+ }, {
413
+ default: $(() => [
414
+ H(s(I), {
415
+ width: "20",
416
+ height: "20",
417
+ name: "image"
418
+ })
419
+ ]),
420
+ _: 1
421
+ }, 8, ["link"]))
422
+ ], 64)) : e.variant === n.EMPTY ? (t(), r(s(N), {
423
+ key: 3,
424
+ link: e.link,
425
+ class: "w-full h-full"
426
+ }, {
427
+ default: $(() => d[2] || (d[2] = [
428
+ A("- ")
429
+ ])),
430
+ _: 1
431
+ }, 8, ["link"])) : e.variant === n.DATETIME ? (t(), r(s(Z), {
432
+ key: 4,
433
+ title: s(G)(e.data).format("D MMM, YYYY"),
434
+ description: s(G)(e.data).format("h:mm A"),
435
+ link: e.link
436
+ }, null, 8, ["title", "description", "link"])) : e.variant === n.CONTENT ? (t(), r(s(Z), z({ key: 5 }, e.content, { link: e.link }), null, 16, ["link"])) : e.variant === n.CHIP ? (t(), r(s(N), {
437
+ key: 6,
438
+ link: e.link
439
+ }, {
440
+ default: $(() => [
441
+ H(s(ne), le(ie(x.value)), null, 16)
442
+ ]),
443
+ _: 1
444
+ }, 8, ["link"])) : e.variant === n.DEFAULT ? (t(), r(s(N), {
445
+ key: 7,
446
+ link: e.link,
447
+ class: "flex items-center w-full"
448
+ }, {
449
+ default: $(() => [
450
+ A(T(e.data), 1)
451
+ ]),
452
+ _: 1
453
+ }, 8, ["link"])) : (t(), r(s(N), {
454
+ key: 8,
455
+ link: e.link,
456
+ class: "w-full h-full"
457
+ }, {
458
+ default: $(() => d[3] || (d[3] = [
459
+ A("-")
460
+ ])),
461
+ _: 1
462
+ }, 8, ["link"]))
463
+ ]),
464
+ e.isCopy && f.value ? (t(), r(s(se), {
465
+ key: 0,
466
+ value: (v = e.content) != null && v.title ? `${e.content.title}${e.content.description && l.addDescriptionToCopyClipboard ? `,${e.content.description}` : ""}` : e.data,
467
+ "tooltip-options": {
468
+ transitionName: "copy"
469
+ }
470
+ }, {
471
+ default: $(() => [
472
+ H(s(I), {
473
+ class: "cursor-pointer w-5 h-5 group-hover/row:opacity-100 md:opacity-0 ml-2",
474
+ name: "copy"
475
+ })
476
+ ]),
477
+ _: 1
478
+ }, 8, ["value"])) : p("", !0)
479
+ ], 34))
480
+ ], 2);
481
+ };
482
+ }
483
+ }, ue = ["href"], de = { key: 2 }, fe = { class: "overflow-hidden text-ellipsis text-oc-text-400 text-sm truncate" }, ye = { key: 0 }, Z = {
484
+ __name: "OcTableCellContent",
485
+ props: {
486
+ important: Boolean,
487
+ title: String,
488
+ description: String,
489
+ href: String,
490
+ link: String
491
+ },
492
+ setup(e) {
493
+ return (n, l) => (t(), r(s(N), {
494
+ link: e.href ? "" : e.link,
495
+ class: "flex flex-col gap-y-1 whitespace-nowrap overflow-hidden w-full"
496
+ }, {
497
+ default: $(() => [
498
+ b("span", {
499
+ class: y(["overflow-hidden text-ellipsis text-oc-text truncate", e.important ? "font-medium" : "font-regular"])
500
+ }, [
501
+ e.href ? (t(), a("a", {
502
+ key: 0,
503
+ href: e.href,
504
+ target: "_blank",
505
+ rel: "noopener noreferrer"
506
+ }, T(e.title), 9, ue)) : (t(), a(w, { key: 1 }, [
507
+ A(T(e.title), 1)
508
+ ], 64)),
509
+ e.title ? p("", !0) : (t(), a("span", de, "-"))
510
+ ], 2),
511
+ b("span", fe, [
512
+ g(n.$slots, "description", { description: e.description }, () => [
513
+ A(T(e.description), 1)
514
+ ]),
515
+ e.description ? p("", !0) : (t(), a("span", ye, "-"))
516
+ ])
517
+ ]),
518
+ _: 3
519
+ }, 8, ["link"]));
520
+ }
521
+ }, ve = { key: 0 }, me = ["href"], N = {
522
+ __name: "OcTableLink",
523
+ props: {
524
+ link: String
525
+ },
526
+ setup(e) {
527
+ return (n, l) => e.link ? (t(), a("a", {
528
+ key: 1,
529
+ href: e.link,
530
+ style: { "'pointer-events": "none'" },
531
+ onClick: l[0] || (l[0] = ae(() => {
532
+ }, ["prevent"]))
533
+ }, [
534
+ g(n.$slots, "default")
535
+ ], 8, me)) : (t(), a("div", ve, [
536
+ g(n.$slots, "default")
537
+ ]));
538
+ }
539
+ }, ke = { class: "rounded-xs text-sm font-medium text-oc-text-400 p-2" }, ge = { class: "truncate" }, we = { class: "py-1 px-2" }, D = /* @__PURE__ */ Y({
540
+ __name: "OcExpadingTableRow",
541
+ props: {
542
+ row: Object,
543
+ depth: {
544
+ type: Number,
545
+ default: 0
546
+ },
547
+ value: {
548
+ type: [String, Number, Date, Object],
549
+ default: 0
550
+ },
551
+ headers: {
552
+ type: Array,
553
+ default: () => []
554
+ },
555
+ important: {
556
+ type: Boolean,
557
+ default: !1
558
+ },
559
+ isTotal: {
560
+ type: Boolean,
561
+ default: !1
562
+ },
563
+ isAlternative: {
564
+ type: Boolean,
565
+ default: !1
566
+ },
567
+ isLoading: {
568
+ type: Boolean,
569
+ default: !1
570
+ }
571
+ },
572
+ setup(e) {
573
+ const n = j(!1), l = j("0"), f = j(), x = j(), h = S(
574
+ () => {
575
+ var d;
576
+ return (d = x.value) == null ? void 0 : d.map((v) => v.scrollWidth > v.clientWidth);
577
+ }
578
+ ), u = () => {
579
+ n.value = !n.value, n.value ? l.value = `${f.value.scrollHeight}px` : l.value = "0";
580
+ };
581
+ return (d, v) => {
582
+ var k, K;
583
+ return t(), a(w, null, [
584
+ b("div", {
585
+ class: y(["h-[58px] w-full flex items-center", {
586
+ "font-medium": e.important || e.isTotal,
587
+ "bg-oc-gray-900 text-white": e.isTotal,
588
+ "bg-oc-bg-dark": e.depth,
589
+ "border-b border-oc-gray-200": !e.isTotal
590
+ }])
591
+ }, [
592
+ b("div", {
593
+ class: "w-9",
594
+ onClick: u
595
+ }, [
596
+ (k = e.row.children) != null && k.length ? (t(), r(s(I), {
597
+ key: 0,
598
+ name: "chevron-down",
599
+ width: "16",
600
+ height: "16",
601
+ class: y(["mx-auto transition-all duration-500", n.value ? "rotate-180" : ""])
602
+ }, null, 8, ["class"])) : p("", !0)
603
+ ]),
604
+ e.isAlternative ? (t(!0), a(w, { key: 1 }, C(e.headers, (m, M) => {
605
+ var P;
606
+ return t(), a("div", {
607
+ key: m.key,
608
+ ref_for: !0,
609
+ ref_key: "itemsCellRef",
610
+ ref: x,
611
+ class: y(["flex-1 truncate px-4", m.itemClasses])
612
+ }, [
613
+ e.isLoading ? (t(), r(s(F), {
614
+ key: 0,
615
+ class: "w-full h-5 rounded"
616
+ })) : g(d.$slots, m.key, {
617
+ key: 1,
618
+ data: (P = e.row) == null ? void 0 : P[m == null ? void 0 : m.key],
619
+ item: e.row
620
+ }, () => {
621
+ var B, O;
622
+ return [
623
+ (B = h.value) != null && B[M] ? (t(), r(s(J), {
624
+ key: 0,
625
+ class: "overflow-hidden w-[-webkit-fill-available]",
626
+ "arrow-hidden": "",
627
+ position: "top"
628
+ }, {
629
+ popper: $(() => {
630
+ var R;
631
+ return [
632
+ b("div", we, T((R = e.row) == null ? void 0 : R[m == null ? void 0 : m.key]), 1)
633
+ ];
634
+ }),
635
+ default: $(() => {
636
+ var R;
637
+ return [
638
+ b("div", ge, T((R = e.row) == null ? void 0 : R[m == null ? void 0 : m.key]), 1)
639
+ ];
640
+ }),
641
+ _: 2
642
+ }, 1024)) : (t(), a(w, { key: 1 }, [
643
+ A(T((O = e.row) == null ? void 0 : O[m == null ? void 0 : m.key]), 1)
644
+ ], 64))
645
+ ];
646
+ })
647
+ ], 2);
648
+ }), 128)) : (t(), a(w, { key: 0 }, [
649
+ b("div", {
650
+ class: "flex-1 gap-x-2 items-center flex px-4 py-3",
651
+ style: U(e.depth ? { paddingLeft: 12 + e.depth * 20 + "px" } : {})
652
+ }, [
653
+ A(T(e.row.label) + " ", 1),
654
+ H(s(J), null, {
655
+ popper: $(() => [
656
+ b("div", ke, T(e.row.infoText), 1)
657
+ ]),
658
+ default: $(() => [
659
+ e.row.infoText ? (t(), r(s(I), {
660
+ key: 0,
661
+ name: "information",
662
+ width: "16",
663
+ height: "16"
664
+ })) : p("", !0)
665
+ ]),
666
+ _: 1
667
+ })
668
+ ], 4),
669
+ b("div", {
670
+ class: y(["flex-1 truncate", e.row.itemClasses])
671
+ }, [
672
+ g(d.$slots, e.row.key, { value: e.value }, () => [
673
+ A(T(e.value), 1)
674
+ ])
675
+ ], 2)
676
+ ], 64)),
677
+ v[0] || (v[0] = b("div", { class: "w-9" }, null, -1))
678
+ ], 2),
679
+ (K = e.row.children) != null && K.length ? (t(), a("div", {
680
+ key: 0,
681
+ ref_key: "childrenWrapper",
682
+ ref: f,
683
+ class: "transition-all overflow-hidden duration-500",
684
+ style: U({ maxHeight: l.value })
685
+ }, [
686
+ (t(!0), a(w, null, C(e.row.children, (m, M) => (t(), r(s(D), {
687
+ key: M,
688
+ row: m,
689
+ important: m.important,
690
+ "is-alternative": e.isAlternative,
691
+ "is-loading": e.isLoading,
692
+ headers: e.headers,
693
+ value: e.value[m.key],
694
+ depth: e.depth + 1
695
+ }, X({ _: 2 }, [
696
+ C(d.$slots, (P, B) => ({
697
+ name: B,
698
+ fn: $((O) => [
699
+ g(d.$slots, B, z({ ref_for: !0 }, O))
700
+ ])
701
+ }))
702
+ ]), 1032, ["row", "important", "is-alternative", "is-loading", "headers", "value", "depth"]))), 128))
703
+ ], 4)) : p("", !0)
704
+ ], 64);
705
+ };
706
+ }
707
+ }), xe = { class: "flex bg-oc-gray-50 border-b border-oc-text-200 h-[34px]" }, he = /* @__PURE__ */ Y({
708
+ __name: "OcExpandingHeaderRow",
709
+ props: {
710
+ headers: {
711
+ type: Array,
712
+ required: !0
713
+ }
714
+ },
715
+ setup(e) {
716
+ return (n, l) => (t(), a("div", xe, [
717
+ l[0] || (l[0] = b("div", { class: "w-9" }, null, -1)),
718
+ (t(!0), a(w, null, C(e.headers, (f) => (t(), a("div", {
719
+ key: f.key,
720
+ class: y(["py-3 px-4 flex-1 uppercase text-xs text-oc-text-400 font-medium", f.class])
721
+ }, T(f.label), 3))), 128)),
722
+ l[1] || (l[1] = b("div", { class: "w-9" }, null, -1))
723
+ ]));
724
+ }
725
+ }), be = { class: "flex flex-col border rounded w-full border-oc-gray-200 overflow-hidden" }, De = /* @__PURE__ */ Y({
726
+ __name: "OcExpadingTable",
727
+ props: {
728
+ total: {
729
+ type: Number,
730
+ default: 0
731
+ },
732
+ headers: {
733
+ type: Array,
734
+ required: !0
735
+ },
736
+ fields: {
737
+ type: Object,
738
+ required: !0
739
+ },
740
+ isAlternative: {
741
+ type: Boolean,
742
+ default: !1
743
+ },
744
+ isLoading: {
745
+ type: Boolean,
746
+ default: !1
747
+ },
748
+ loadingRows: {
749
+ type: Number,
750
+ default: 5
751
+ }
752
+ },
753
+ setup(e) {
754
+ const n = e, l = S(() => Object.fromEntries(n.headers.map((f) => [f.key, ""])));
755
+ return (f, x) => (t(), a("div", be, [
756
+ e.isAlternative ? (t(), a(w, { key: 0 }, [
757
+ H(he, { headers: e.headers }, null, 8, ["headers"]),
758
+ e.isLoading && !e.fields.length ? (t(!0), a(w, { key: 0 }, C(e.loadingRows, (h) => (t(), r(D, {
759
+ key: h,
760
+ "is-loading": "",
761
+ "is-alternative": e.isAlternative,
762
+ row: l.value,
763
+ headers: e.headers
764
+ }, null, 8, ["is-alternative", "row", "headers"]))), 128)) : (t(!0), a(w, { key: 1 }, C(e.fields, (h, u) => (t(), r(D, {
765
+ key: u,
766
+ row: h,
767
+ headers: e.headers,
768
+ "is-loading": e.isLoading,
769
+ "is-alternative": e.isAlternative,
770
+ important: h.important
771
+ }, X({ _: 2 }, [
772
+ C(f.$slots, (d, v) => ({
773
+ name: v,
774
+ fn: $((k) => [
775
+ g(f.$slots, v, z({ ref_for: !0 }, k))
776
+ ])
777
+ }))
778
+ ]), 1032, ["row", "headers", "is-loading", "is-alternative", "important"]))), 128))
779
+ ], 64)) : (t(!0), a(w, { key: 1 }, C(e.headers, (h, u) => (t(), r(D, {
780
+ key: u,
781
+ row: h,
782
+ headers: e.headers,
783
+ "is-loading": e.isLoading,
784
+ "is-alternative": e.isAlternative,
785
+ value: e.fields[h.key],
786
+ important: h.important
787
+ }, X({ _: 2 }, [
788
+ C(f.$slots, (d, v) => ({
789
+ name: v,
790
+ fn: $((k) => [
791
+ g(f.$slots, v, z({ ref_for: !0 }, k))
792
+ ])
793
+ }))
794
+ ]), 1032, ["row", "headers", "is-loading", "is-alternative", "value", "important"]))), 128)),
795
+ g(f.$slots, "total", {}, () => [
796
+ H(D, {
797
+ "is-total": "",
798
+ headers: e.headers,
799
+ row: { label: "Total" },
800
+ value: e.total
801
+ }, null, 8, ["headers", "value"])
802
+ ])
803
+ ]));
804
+ }
805
+ });
806
+ export {
807
+ Pe as _,
808
+ De as a,
809
+ Q as b,
810
+ V as c,
811
+ Z as d,
812
+ N as e,
813
+ D as f,
814
+ he as g
815
+ };