@orchidui/core 0.0.1 → 0.3.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,464 @@
1
+ import { defineComponent as ie, ref as f, openBlock as i, createElementBlock as m, normalizeClass as y, createElementVNode as o, createVNode as d, unref as a, createCommentVNode as V, withCtx as C, createBlock as $, Teleport as se, computed as W, onMounted as re, renderSlot as ue, Fragment as B, mergeProps as de, withModifiers as me, toDisplayString as O, normalizeStyle as ce } from "vue";
2
+ import "dayjs";
3
+ import { D as Y, _ as pe, B as j } from "./OcComplexCalendar.vue_vue_type_style_index_0_lang-CIQPD-6N.js";
4
+ import { _ as g } from "./OcIcon-CJgBICxh.js";
5
+ /* empty css */
6
+ import { _ as X } from "./OcInput-tcRxG3Y2.js";
7
+ import "libphonenumber-js";
8
+ /* empty css */
9
+ import "v-calendar";
10
+ /* empty css */
11
+ import { useUploadFileProgress as fe } from "./composables/uploadFileProgress.js";
12
+ import { ModalCropper as Z } from "./Cropper.js";
13
+ import "vue-draggable-next";
14
+ import "@popperjs/core";
15
+ const ge = { class: "flex gap-x-3" }, ve = {
16
+ key: 0,
17
+ class: "border rounded p-3 min-h-[140px] h-full"
18
+ }, xe = ["accept"], be = { class: "py-2 flex flex-col" }, ye = ["src"], he = /* @__PURE__ */ ie({
19
+ __name: "OcSingleOnlyImageUpload",
20
+ props: {
21
+ accept: {
22
+ type: String,
23
+ default: ""
24
+ },
25
+ uploadedImage: {
26
+ type: Object,
27
+ default: () => ({})
28
+ },
29
+ imageClasses: {
30
+ type: String,
31
+ default: ""
32
+ },
33
+ showUploadImageArea: Boolean
34
+ },
35
+ emits: ["change", "update:uploadedImage", "delete"],
36
+ setup(l, { emit: F }) {
37
+ const r = l, U = F, v = f(!1), c = f(!1), x = f(""), h = f(!1), D = (b) => {
38
+ const t = r.uploadedImage;
39
+ t.fileUrl = b, t.fileName = Date.now(), c.value = !1, x.value = "", U("update:uploadedImage", t);
40
+ };
41
+ return (b, t) => {
42
+ var w, k;
43
+ return i(), m("div", ge, [
44
+ (w = l.uploadedImage) != null && w.fileUrl ? V("", !0) : (i(), m("label", {
45
+ key: 0,
46
+ class: y([{ "flex-1": l.showUploadImageArea }, "relative group overflow-hidden"])
47
+ }, [
48
+ l.showUploadImageArea ? (i(), m("div", ve, [
49
+ o("div", {
50
+ class: y(["w-full text-oc-text-300 text-sm h-full flex flex-col justify-center items-center transition-all border border-transparent border-dashed group-hover:border-oc-primary rounded-sm cursor-pointer", { "!border-oc-primary": h.value }])
51
+ }, [
52
+ d(a(g), {
53
+ name: "upload",
54
+ class: "text-oc-accent-1"
55
+ }),
56
+ t[9] || (t[9] = o("div", null, "Upload Image", -1))
57
+ ], 2)
58
+ ])) : (i(), m("div", {
59
+ key: 1,
60
+ class: y(["w-[100px] group-hover:bg-oc-primary-50 cursor-pointer bg-oc-accent-1-50 text-oc-accent-1 rounded aspect-square flex items-center justify-center", l.imageClasses])
61
+ }, [
62
+ d(a(g), { name: "plus" })
63
+ ], 2)),
64
+ o("input", {
65
+ class: "w-full h-full absolute opacity-0 cursor-pointer top-0",
66
+ type: "file",
67
+ accept: l.accept || "image/png, image/jpeg",
68
+ onChange: t[0] || (t[0] = (p) => b.$emit("change", p)),
69
+ onDragover: t[1] || (t[1] = (p) => h.value = !0),
70
+ onDragleave: t[2] || (t[2] = (p) => h.value = !1),
71
+ onDrop: t[3] || (t[3] = (p) => h.value = !1)
72
+ }, null, 40, xe)
73
+ ], 2)),
74
+ (k = l.uploadedImage) != null && k.fileUrl ? (i(), m("div", {
75
+ key: 1,
76
+ class: y(["w-[100px] group relative cursor-pointer aspect-square border rounded border-oc-accent-1-100", l.imageClasses])
77
+ }, [
78
+ d(a(Y), {
79
+ modelValue: v.value,
80
+ "onUpdate:modelValue": t[6] || (t[6] = (p) => v.value = p),
81
+ placement: "bottom-end",
82
+ class: "absolute top-2 right-2 z-[1010]"
83
+ }, {
84
+ menu: C(() => [
85
+ o("div", be, [
86
+ o("div", {
87
+ class: "flex p-3 cursor-pointer items-center gap-x-3",
88
+ onClick: t[4] || (t[4] = () => {
89
+ x.value = l.uploadedImage.fileUrl, v.value = !1, c.value = !0;
90
+ })
91
+ }, [
92
+ d(a(g), {
93
+ width: "16",
94
+ height: "16",
95
+ name: "pencil"
96
+ }),
97
+ t[10] || (t[10] = o("span", null, "Edit Image", -1))
98
+ ]),
99
+ o("div", {
100
+ class: "flex p-3 cursor-pointer items-center text-oc-error gap-x-3",
101
+ onClick: t[5] || (t[5] = () => {
102
+ b.$emit("delete"), v.value = !1;
103
+ })
104
+ }, [
105
+ d(a(g), {
106
+ width: "16",
107
+ height: "16",
108
+ name: "bin"
109
+ }),
110
+ t[11] || (t[11] = o("span", null, "Delete", -1))
111
+ ])
112
+ ])
113
+ ]),
114
+ default: C(() => [
115
+ d(a(g), {
116
+ name: "dots-vertical",
117
+ class: "hidden group-hover:flex absolute right-0 cursor-pointer bg-black/[.45] rounded-full w-[32px] h-[32px] items-center justify-center text-oc-bg-light"
118
+ })
119
+ ]),
120
+ _: 1
121
+ }, 8, ["modelValue"]),
122
+ o("img", {
123
+ src: l.uploadedImage.fileUrl,
124
+ alt: "uploaded-image",
125
+ class: "object-contain h-full w-full"
126
+ }, null, 8, ye)
127
+ ], 2)) : V("", !0),
128
+ (i(), $(se, { to: "body" }, [
129
+ c.value ? (i(), $(a(Z), {
130
+ key: 0,
131
+ modelValue: c.value,
132
+ "onUpdate:modelValue": t[7] || (t[7] = (p) => c.value = p),
133
+ img: x.value,
134
+ onClose: t[8] || (t[8] = () => {
135
+ c.value = !1, x.value = "";
136
+ }),
137
+ onChangeImage: D
138
+ }, null, 8, ["modelValue", "img"])) : V("", !0)
139
+ ]))
140
+ ]);
141
+ };
142
+ }
143
+ }), we = ["accept"], ke = {
144
+ key: 0,
145
+ class: "py-2 flex flex-col items-center gap-y-4"
146
+ }, Ve = { class: "flex items-baseline gap-x-3 w-full" }, Ue = { class: "text-sm flex-1 text-oc-text-400 pointer-events-none" }, Ce = ["accept"], De = {
147
+ key: 0,
148
+ class: "relative group w-fit rounded overflow-hidden"
149
+ }, Ie = ["src"], $e = ["src"], Be = { class: "py-2 flex flex-col" }, Oe = { class: "flex flex-1 items-center gap-x-3 text-sm text-oc-text-400" }, Fe = { class: "flex flex-col w-7 h-7 items-center justify-center text-oc-text-300" }, Se = { class: "uppercase text-[8px] font-bold leading-none block" }, je = { class: "flex" }, Ee = { class: "text-sm text-oc-primary" }, Ne = { class: "rounded-full bg-oc-gray-100 w-[48px] h-2 overflow-hidden" }, Xe = {
150
+ __name: "OcSingleFileUpload",
151
+ props: {
152
+ format: {
153
+ type: String,
154
+ default: "array"
155
+ },
156
+ modelValue: Object,
157
+ isPreview: Boolean,
158
+ isImageOnly: Boolean,
159
+ showUploadImageArea: Boolean,
160
+ /**
161
+ * Maximum file size in MB
162
+ */
163
+ maxSize: Number,
164
+ accept: String,
165
+ validateAcceptFileType: Boolean,
166
+ errorMessage: String,
167
+ imageClasses: String,
168
+ allowToEdit: {
169
+ type: Boolean,
170
+ default: !0
171
+ },
172
+ label: String,
173
+ labelClass: String,
174
+ hint: String,
175
+ uploadButtonOptions: Object,
176
+ /**
177
+ * Variant of input (upload or url)
178
+ */
179
+ variant: {
180
+ type: String,
181
+ default: "upload",
182
+ validator: (l) => ["upload", "url"].includes(l)
183
+ },
184
+ shouldTruncateFileName: Boolean,
185
+ isButtonOnly: Boolean,
186
+ isDisabled: Boolean,
187
+ buttonUploadProps: {
188
+ type: Object,
189
+ default: () => ({
190
+ label: "Upload"
191
+ })
192
+ }
193
+ },
194
+ emits: [
195
+ "update:modelValue",
196
+ "onRemoveFile",
197
+ "onExceedMaxFileSize",
198
+ "fileExist",
199
+ "invalidFileType"
200
+ ],
201
+ setup(l, { emit: F }) {
202
+ const r = l, U = F, v = f(), c = f(""), x = f(""), h = f(!0), D = f(!1), b = f(!1), t = f(!1), w = f(""), { currentFiles: k, onChangeFile: p, onDeleteFile: S } = fe(
203
+ r.maxSize,
204
+ U,
205
+ r.accept,
206
+ r.validateAcceptFileType
207
+ ), _ = W(() => {
208
+ var s;
209
+ return URL.createObjectURL((s = k.value) == null ? void 0 : s[0].file);
210
+ }), u = W(() => {
211
+ var s;
212
+ return (s = k.value) == null ? void 0 : s[0];
213
+ });
214
+ re(() => {
215
+ if (r.modelValue && r.modelValue.current) {
216
+ const s = [
217
+ {
218
+ current: r.modelValue.current,
219
+ file: null,
220
+ fileName: r.modelValue.current.caption ?? "",
221
+ progress: 100,
222
+ fileUrl: r.modelValue.current.path,
223
+ totalSize: r.modelValue.current.file_size ?? 0,
224
+ isLoaded: !0,
225
+ extension: r.modelValue.current.extension ?? "png"
226
+ }
227
+ ];
228
+ k.value = s;
229
+ }
230
+ });
231
+ const ee = (s) => {
232
+ s.preventDefault();
233
+ const e = s.dataTransfer.files;
234
+ p({ target: { files: e } }, r.format === "object");
235
+ }, le = () => {
236
+ !c.value || !x.value || U("update:modelValue", { fileName: x, fileLink: c });
237
+ }, te = (s) => {
238
+ u.value.fileUrl = s, u.value.fileName = Date.now(), t.value = !1, w.value = "", U("update:modelValue", r.format === "object" ? u.value : [u.value]);
239
+ }, ae = async (s) => {
240
+ if (s)
241
+ try {
242
+ const e = await fetch(s, { method: "HEAD" });
243
+ h.value = e.ok;
244
+ } catch (e) {
245
+ console.log("Error checking file link:", e);
246
+ }
247
+ }, oe = () => {
248
+ w.value = u.value.fileUrl, b.value = !1, t.value = !0;
249
+ }, ne = (s) => {
250
+ U("update:modelValue", s);
251
+ };
252
+ return (s, e) => (i(), $(a(pe), {
253
+ label: l.label,
254
+ "label-class": l.labelClass,
255
+ hint: l.hint,
256
+ "error-message": l.errorMessage
257
+ }, {
258
+ hint: C(() => [
259
+ ue(s.$slots, "hint")
260
+ ]),
261
+ default: C(() => {
262
+ var E, N, z, T, A, L, M, P, R, q, H, K, G, J, Q;
263
+ return [
264
+ l.isImageOnly ? (i(), $(he, {
265
+ key: 0,
266
+ accept: l.accept,
267
+ "uploaded-image": u.value,
268
+ "image-classes": l.imageClasses,
269
+ "show-upload-image-area": l.showUploadImageArea,
270
+ "onUpdate:uploadedImage": ne,
271
+ onChange: e[0] || (e[0] = (n) => a(p)(n, r.format === "object")),
272
+ onDelete: e[1] || (e[1] = (n) => a(S)(0))
273
+ }, null, 8, ["accept", "uploaded-image", "image-classes", "show-upload-image-area"])) : l.isButtonOnly ? (i(), m(B, { key: 1 }, [
274
+ d(a(j), de(l.buttonUploadProps, {
275
+ onClick: e[2] || (e[2] = (n) => {
276
+ var I;
277
+ return (I = v.value) == null ? void 0 : I.click();
278
+ })
279
+ }), null, 16),
280
+ o("input", {
281
+ ref_key: "inputRef",
282
+ ref: v,
283
+ class: "hidden",
284
+ type: "file",
285
+ accept: l.accept,
286
+ onChange: e[3] || (e[3] = (n) => a(p)(n, r.format === "object"))
287
+ }, null, 40, we)
288
+ ], 64)) : (i(), m(B, { key: 2 }, [
289
+ a(k).length ? (i(), m("div", {
290
+ key: 1,
291
+ class: y(["p-3 rounded border flex gap-x-5 border-oc-gray-200 bg-white items-center", {
292
+ "w-fit": l.isPreview,
293
+ "!bg-oc-bg-dark": l.isDisabled
294
+ }])
295
+ }, [
296
+ l.isPreview && ((T = u.value) == null ? void 0 : T.progress) === 100 ? (i(), m("div", De, [
297
+ (L = (A = u.value) == null ? void 0 : A.file) != null && L.type.includes("video") ? (i(), m("video", {
298
+ key: 0,
299
+ autoplay: "",
300
+ loop: "",
301
+ src: _.value
302
+ }, null, 8, Ie)) : (i(), m("img", {
303
+ key: 1,
304
+ src: (M = u.value) == null ? void 0 : M.fileUrl
305
+ }, null, 8, $e)),
306
+ d(a(Y), {
307
+ modelValue: b.value,
308
+ "onUpdate:modelValue": e[13] || (e[13] = (n) => b.value = n),
309
+ class: "absolute top-3 right-3"
310
+ }, {
311
+ menu: C(() => {
312
+ var n, I;
313
+ return [
314
+ o("div", Be, [
315
+ !((I = (n = u.value) == null ? void 0 : n.file) != null && I.type.includes("video")) && l.allowToEdit ? (i(), m("div", {
316
+ key: 0,
317
+ class: "flex p-3 cursor-pointer items-center gap-x-3",
318
+ onClick: oe
319
+ }, [
320
+ d(a(g), {
321
+ width: "16",
322
+ height: "16",
323
+ name: "pencil"
324
+ }),
325
+ e[17] || (e[17] = o("span", null, "Edit", -1))
326
+ ])) : V("", !0),
327
+ o("div", {
328
+ class: "flex p-3 cursor-pointer items-center text-oc-error gap-x-3",
329
+ onClick: e[12] || (e[12] = () => {
330
+ a(S)(0), b.value = !1;
331
+ })
332
+ }, [
333
+ d(a(g), {
334
+ width: "16",
335
+ height: "16",
336
+ name: "bin"
337
+ }),
338
+ e[18] || (e[18] = o("span", null, "Delete", -1))
339
+ ])
340
+ ])
341
+ ];
342
+ }),
343
+ default: C(() => [
344
+ d(a(g), {
345
+ name: "dots-vertical",
346
+ class: "cursor-pointer w-[28px] aspect-square hidden items-center justify-center text-oc-text-400 group-hover:flex"
347
+ })
348
+ ]),
349
+ _: 1
350
+ }, 8, ["modelValue"]),
351
+ !((R = (P = u.value) == null ? void 0 : P.file) != null && R.type.includes("video")) && t.value ? (i(), $(a(Z), {
352
+ key: 2,
353
+ modelValue: t.value,
354
+ "onUpdate:modelValue": e[14] || (e[14] = (n) => t.value = n),
355
+ img: w.value,
356
+ onClose: e[15] || (e[15] = () => {
357
+ t.value = !1, w.value = "";
358
+ }),
359
+ onChangeImage: te
360
+ }, null, 8, ["modelValue", "img"])) : V("", !0)
361
+ ])) : (i(), m(B, { key: 1 }, [
362
+ o("div", Oe, [
363
+ o("div", Fe, [
364
+ d(a(g), {
365
+ name: "file-extension",
366
+ width: "14",
367
+ height: "10"
368
+ }),
369
+ o("span", Se, O((q = u.value) == null ? void 0 : q.extension), 1)
370
+ ]),
371
+ o("div", {
372
+ class: y([l.shouldTruncateFileName ? "truncate max-w-[250px]" : ""])
373
+ }, O((H = u.value) == null ? void 0 : H.fileName), 3)
374
+ ]),
375
+ o("div", je, [
376
+ o("div", {
377
+ class: y([((K = u.value) == null ? void 0 : K.progress) === 100 ? "opacity-0" : "", "transition-all duration-500 flex flex-col gap-y-1 items-center"])
378
+ }, [
379
+ o("span", Ee, O(((G = u.value) == null ? void 0 : G.progress) || 0) + "% ", 1),
380
+ o("div", Ne, [
381
+ o("div", {
382
+ class: "h-2 bg-oc-primary transition-all duration-100",
383
+ style: ce({ width: `${((J = u.value) == null ? void 0 : J.progress) || 0}%` })
384
+ }, null, 4)
385
+ ])
386
+ ], 2),
387
+ l.isDisabled ? V("", !0) : (i(), m("div", {
388
+ key: 0,
389
+ class: "w-[36px] cursor-pointer flex text-oc-error items-center justify-center",
390
+ onClick: e[16] || (e[16] = (n) => a(S)(0))
391
+ }, [
392
+ d(a(g), {
393
+ width: "16",
394
+ height: "16",
395
+ name: ((Q = u.value) == null ? void 0 : Q.progress) === 100 ? "bin" : "x-circle"
396
+ }, null, 8, ["name"])
397
+ ]))
398
+ ])
399
+ ], 64))
400
+ ], 2)) : (i(), m("div", ke, [
401
+ o("div", Ve, [
402
+ l.variant === "url" ? (i(), m(B, { key: 0 }, [
403
+ d(a(X), {
404
+ modelValue: c.value,
405
+ "onUpdate:modelValue": e[4] || (e[4] = (n) => c.value = n),
406
+ "error-message": c.value && !h.value ? "Invalid link" : "",
407
+ placeholder: "https://website.com",
408
+ onBlur: e[5] || (e[5] = (n) => ae(c.value))
409
+ }, null, 8, ["modelValue", "error-message"]),
410
+ d(a(X), {
411
+ modelValue: x.value,
412
+ "onUpdate:modelValue": e[6] || (e[6] = (n) => x.value = n),
413
+ placeholder: "Enter file name"
414
+ }, null, 8, ["modelValue"]),
415
+ d(a(j), {
416
+ class: "flex-shrink-0",
417
+ label: "OK",
418
+ disabled: "",
419
+ onClick: le
420
+ })
421
+ ], 64)) : V("", !0),
422
+ o("div", {
423
+ class: y(["p-3 flex bg-white items-center gap-x-5 rounded border w-full", [
424
+ D.value ? "border-oc-primary border-dashed" : "border-oc-gray-200",
425
+ {
426
+ "!bg-oc-bg-dark": l.isDisabled
427
+ }
428
+ ]]),
429
+ onDragenter: e[8] || (e[8] = (n) => D.value = !0),
430
+ onDragleave: e[9] || (e[9] = (n) => D.value = !1),
431
+ onDrop: ee,
432
+ onDragover: e[10] || (e[10] = me(() => {
433
+ }, ["prevent"]))
434
+ }, [
435
+ o("span", Ue, O(l.isDisabled ? "Upload disabled" : "Choose file from your computer or drag here"), 1),
436
+ d(a(j), {
437
+ size: "small",
438
+ "is-disabled": l.isDisabled,
439
+ variant: ((E = l.uploadButtonOptions) == null ? void 0 : E.variant) ?? "secondary",
440
+ "left-icon": ((N = l.uploadButtonOptions) == null ? void 0 : N.leftIcon) ?? "upload",
441
+ label: ((z = l.uploadButtonOptions) == null ? void 0 : z.label) ?? "Upload",
442
+ onClick: e[7] || (e[7] = (n) => v.value.click())
443
+ }, null, 8, ["is-disabled", "variant", "left-icon", "label"])
444
+ ], 34),
445
+ o("input", {
446
+ ref_key: "inputRef",
447
+ ref: v,
448
+ class: "hidden",
449
+ type: "file",
450
+ accept: l.accept,
451
+ onChange: e[11] || (e[11] = (n) => a(p)(n, r.format === "object"))
452
+ }, null, 40, Ce)
453
+ ])
454
+ ]))
455
+ ], 64))
456
+ ];
457
+ }),
458
+ _: 3
459
+ }, 8, ["label", "label-class", "hint", "error-message"]));
460
+ }
461
+ };
462
+ export {
463
+ Xe as _
464
+ };
@@ -0,0 +1,13 @@
1
+ import { openBlock as r, createElementBlock as o, createElementVNode as t } from "vue";
2
+ /* empty css */
3
+ import { _ as n } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ const _ = {}, i = { class: "bg-gray-100 overflow-hidden" };
5
+ function a(d, e) {
6
+ return r(), o("div", i, e[0] || (e[0] = [
7
+ t("div", { class: "slide relative rounded-[inherit] h-[inherit] w-[40px] bg-[linear-gradient(-90deg,_var(--oc-gray-200)_0%,_rgba(229,_230,_234,_0)_100%)]" }, null, -1)
8
+ ]));
9
+ }
10
+ const f = /* @__PURE__ */ n(_, [["render", a], ["__scopeId", "data-v-2b70f697"]]);
11
+ export {
12
+ f as S
13
+ };
@@ -0,0 +1,124 @@
1
+ import { ref as f, onMounted as G, openBlock as m, createElementBlock as o, createElementVNode as s, toDisplayString as d, createCommentVNode as x, normalizeClass as z, normalizeStyle as V, renderSlot as S, createTextVNode as $ } from "vue";
2
+ /* empty css */
3
+ import { _ as O } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ const C = { class: "w-full flex flex-wrap" }, B = {
5
+ key: 0,
6
+ class: "w-full text-sm flex items-center gap-x-3 font-medium text-oc-text-400 mb-2"
7
+ }, E = { class: "flex gap-x-1 items-center" }, j = ["min", "max", "value"], A = ["min", "max", "value"], D = { class: "absolute bottom-0 left-0" }, M = { class: "absolute bottom-0 right-0" }, q = {
8
+ key: 1,
9
+ class: "border border-oc-gray-200 rounded-lg ml-auto w-[11%] flex items-center -mt-4 justify-center"
10
+ }, F = {
11
+ __name: "OcSlider",
12
+ props: {
13
+ maxLimit: {
14
+ type: Number,
15
+ default: 100
16
+ },
17
+ minLimit: {
18
+ type: Number,
19
+ default: 0
20
+ },
21
+ minGap: {
22
+ type: Number,
23
+ default: 0
24
+ },
25
+ type: {
26
+ type: String,
27
+ default: "default"
28
+ },
29
+ modelValue: {
30
+ type: [Array, Number, String],
31
+ default: 0
32
+ },
33
+ label: String,
34
+ variant: {
35
+ type: String,
36
+ default: "default"
37
+ }
38
+ },
39
+ emits: {
40
+ "update:modelValue": []
41
+ },
42
+ setup(e, { expose: I, emit: N }) {
43
+ const t = e, T = N, l = f(), n = f(), p = f(), u = f(0), y = f(0), b = () => {
44
+ var a, i;
45
+ t.type === "range" && parseInt((a = n.value) == null ? void 0 : a.value) - parseInt((i = l.value) == null ? void 0 : i.value) <= t.minGap && (l.value.value = parseInt(n.value.value) - t.minGap), g();
46
+ }, h = () => {
47
+ var a, i, r;
48
+ parseInt((a = n.value) == null ? void 0 : a.value) - parseInt((i = l.value) == null ? void 0 : i.value) <= t.minGap && (n.value.value = parseInt((r = l.value) == null ? void 0 : r.value) + t.minGap), g();
49
+ }, g = (a = !1) => {
50
+ var i, r, c, v;
51
+ u.value = (((i = l.value) == null ? void 0 : i.value) - t.minLimit) / (t.maxLimit - t.minLimit) * 100, y.value = t.type === "range" ? (((r = n.value) == null ? void 0 : r.value) - t.minLimit) / (t.maxLimit - t.minLimit) * 100 : 0, p.value.style.background = t.type === "range" ? `linear-gradient(to right, var(--oc-gray-100) ${u.value}% , var(--oc-primary-500) ${u.value}% , var(--oc-primary-500) ${y.value}%, var(--oc-gray-100) ${y.value}%)` : `linear-gradient(to right, var(--oc-primary-500) ${u.value}%, var(--oc-gray-100) ${u.value}%)`, a || T(
52
+ "update:modelValue",
53
+ t.type === "range" ? [(c = l.value) == null ? void 0 : c.value, (v = n.value) == null ? void 0 : v.value] : l.value.value
54
+ );
55
+ }, k = (a) => {
56
+ a && a[0] && a[1] && t.type === "range" ? (l.value.value = Number(a[0]), n.value.value = Number(a[1]), b(), t.type === "range" && h()) : g(!0);
57
+ };
58
+ return I({
59
+ updateSlider: k
60
+ }), G(() => k()), (a, i) => {
61
+ var r, c, v, w, L;
62
+ return m(), o("div", C, [
63
+ e.label ? (m(), o("label", B, [
64
+ s("span", E, d(e.label), 1)
65
+ ])) : x("", !0),
66
+ s("div", {
67
+ class: z(["relative h-[33px]", {
68
+ "w-full": e.variant === "default",
69
+ "w-[85%]": e.variant === "right"
70
+ }])
71
+ }, [
72
+ s("div", {
73
+ ref_key: "sliderTrack",
74
+ ref: p,
75
+ class: "rounded-full h-3 absolute m-auto top-0 w-full group"
76
+ }, null, 512),
77
+ s("input", {
78
+ ref_key: "sliderOne",
79
+ ref: l,
80
+ type: "range",
81
+ min: e.minLimit,
82
+ max: e.maxLimit,
83
+ value: e.type === "range" ? (r = e.modelValue) == null ? void 0 : r[0] : e.modelValue,
84
+ onInput: b
85
+ }, null, 40, j),
86
+ e.type === "range" ? (m(), o("input", {
87
+ key: 0,
88
+ ref_key: "sliderTwo",
89
+ ref: n,
90
+ type: "range",
91
+ min: e.minLimit,
92
+ max: e.maxLimit,
93
+ value: (c = e.modelValue) == null ? void 0 : c[1],
94
+ onInput: h
95
+ }, null, 40, A)) : x("", !0),
96
+ e.variant === "default" ? (m(), o("div", {
97
+ key: 1,
98
+ class: "group-hover:block absolute top-[1rem] z-[1] -translate-x-1/2 rounded-sm py-[3px] px-[6px] min-w-[28px] bg-oc-text-500 text-center text-white text-sm font-medium leading-[20px]",
99
+ style: V(`left: ${u.value}%`)
100
+ }, d(e.type === "range" ? (v = e.modelValue) == null ? void 0 : v[0] : e.modelValue), 5)) : x("", !0),
101
+ e.type === "range" ? (m(), o("div", {
102
+ key: 2,
103
+ class: "group-hover:block absolute top-[1rem] z-[1] translate-x-1/2 rounded-sm py-[3px] px-[6px] min-w-[28px] bg-oc-text-500 text-center text-white text-sm font-medium leading-[20px]",
104
+ style: V(`right: ${100 - y.value}%`)
105
+ }, d((w = e.modelValue) == null ? void 0 : w[1]), 5)) : x("", !0),
106
+ s("span", D, [
107
+ S(a.$slots, "min-limit-label", {}, () => [
108
+ $(d(e.minLimit), 1)
109
+ ], !0)
110
+ ]),
111
+ s("span", M, [
112
+ S(a.$slots, "max-limit-label", {}, () => [
113
+ $(d(e.maxLimit), 1)
114
+ ], !0)
115
+ ])
116
+ ], 2),
117
+ e.variant === "right" ? (m(), o("div", q, d(e.type === "range" ? (L = e.modelValue) == null ? void 0 : L[0] : e.modelValue), 1)) : x("", !0)
118
+ ]);
119
+ };
120
+ }
121
+ }, P = /* @__PURE__ */ O(F, [["__scopeId", "data-v-43a77a49"]]);
122
+ export {
123
+ P as S
124
+ };