@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,179 @@
1
+ import { openBlock as s, createElementBlock as r, normalizeClass as d, createVNode as g, unref as v, createCommentVNode as y, createElementVNode as u, renderSlot as b, computed as m, createBlock as S, withCtx as f, createSlots as B } from "vue";
2
+ import "dayjs";
3
+ import "./OcComplexCalendar.vue_vue_type_style_index_0_lang-CIQPD-6N.js";
4
+ /* empty css */
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 { _ as L } from "./OcModal-DdD5VFEN.js";
12
+ import { _ as $ } from "./OcIcon-CJgBICxh.js";
13
+ import "@popperjs/core";
14
+ const h = { class: "text-center" }, w = ["innerHTML"], x = {
15
+ __name: "OcConfirmation",
16
+ props: {
17
+ description: String,
18
+ iconClass: String,
19
+ variant: {
20
+ type: String,
21
+ default: "delete"
22
+ },
23
+ hideIcon: {
24
+ type: Boolean,
25
+ default: !1
26
+ },
27
+ icon: String,
28
+ contentClass: String
29
+ },
30
+ setup(e) {
31
+ const o = {
32
+ delete: "bin",
33
+ warning: "alert",
34
+ success: "check-2",
35
+ question: "question-mark"
36
+ }, t = {
37
+ delete: "text-oc-error bg-oc-error-50-tr",
38
+ warning: "text-oc-warning-600 bg-oc-warning-50-tr",
39
+ success: "text-oc-success bg-oc-success-50-tr",
40
+ question: "text-oc-accent-1 bg-oc-accent-1-50-tr"
41
+ };
42
+ return (i, l) => (s(), r("div", {
43
+ class: d(["flex flex-col gap-y-4 items-center", e.contentClass])
44
+ }, [
45
+ e.hideIcon ? y("", !0) : (s(), r("div", {
46
+ key: 0,
47
+ class: d(["w-[48px] aspect-square rounded-full flex items-center justify-center", [t[e.variant], e.iconClass]])
48
+ }, [
49
+ g(v($), {
50
+ name: e.icon ?? o[e.variant]
51
+ }, null, 8, ["name"])
52
+ ], 2)),
53
+ u("div", h, [
54
+ b(i.$slots, "description", {}, () => [
55
+ u("span", { innerHTML: e.description }, null, 8, w)
56
+ ])
57
+ ])
58
+ ], 2));
59
+ }
60
+ }, T = {
61
+ __name: "OcConfirmationModal",
62
+ props: {
63
+ modelValue: {
64
+ type: Boolean,
65
+ default: !1
66
+ },
67
+ title: {
68
+ type: String,
69
+ default: "Are you sure?"
70
+ },
71
+ iconClass: {
72
+ type: String,
73
+ default: ""
74
+ },
75
+ description: {
76
+ type: String,
77
+ default: ""
78
+ },
79
+ variant: {
80
+ type: String,
81
+ default: "delete"
82
+ },
83
+ icon: String,
84
+ labelConfirm: String,
85
+ labelCancel: String,
86
+ isLoading: {
87
+ type: Boolean,
88
+ default: !1
89
+ },
90
+ hideIcon: {
91
+ type: Boolean,
92
+ default: !1
93
+ },
94
+ persistent: {
95
+ type: Boolean,
96
+ default: !1
97
+ },
98
+ contentClass: String,
99
+ confirmButtonProps: Object
100
+ },
101
+ emits: ["confirm", "cancel", "update:model-value"],
102
+ setup(e, { emit: o }) {
103
+ const t = e, i = o, l = m(() => ({
104
+ delete: {},
105
+ warning: {},
106
+ success: {
107
+ class: "hidden"
108
+ },
109
+ question: {
110
+ label: "No"
111
+ }
112
+ })), c = m(() => ({
113
+ delete: {
114
+ label: "Delete",
115
+ variant: "destructive",
116
+ isLoading: t.isLoading ?? !1
117
+ },
118
+ warning: {
119
+ label: "Delete",
120
+ variant: "destructive",
121
+ isLoading: t.isLoading ?? !1
122
+ },
123
+ success: {
124
+ isLoading: t.isLoading ?? !1
125
+ },
126
+ question: {
127
+ label: "Yes",
128
+ isLoading: t.isLoading ?? !1
129
+ }
130
+ })), C = (n) => {
131
+ i("update:model-value", n), i("cancel");
132
+ };
133
+ return (n, a) => (s(), S(v(L), {
134
+ size: "small",
135
+ "model-value": e.modelValue,
136
+ title: e.title,
137
+ "is-borderless": "",
138
+ persistent: e.persistent,
139
+ "cancel-button-props": e.labelCancel ? {
140
+ ...l.value[e.variant],
141
+ label: e.labelCancel
142
+ } : l.value[e.variant],
143
+ "confirm-button-props": {
144
+ ...e.labelConfirm ? {
145
+ ...c.value[e.variant],
146
+ label: e.labelConfirm
147
+ } : c.value[e.variant],
148
+ ...e.confirmButtonProps
149
+ },
150
+ "footer-class": "justify-center",
151
+ "onUpdate:modelValue": C,
152
+ onConfirm: a[0] || (a[0] = (p) => n.$emit("confirm")),
153
+ onCancel: a[1] || (a[1] = (p) => n.$emit("cancel"))
154
+ }, {
155
+ default: f(() => [
156
+ g(x, {
157
+ "icon-class": e.iconClass,
158
+ variant: e.variant,
159
+ description: e.description,
160
+ "content-class": e.contentClass,
161
+ icon: e.icon,
162
+ "hide-icon": e.hideIcon
163
+ }, B({ _: 2 }, [
164
+ n.$slots.description ? {
165
+ name: "description",
166
+ fn: f(() => [
167
+ b(n.$slots, "description")
168
+ ]),
169
+ key: "0"
170
+ } : void 0
171
+ ]), 1032, ["icon-class", "variant", "description", "content-class", "icon", "hide-icon"])
172
+ ]),
173
+ _: 3
174
+ }, 8, ["model-value", "title", "persistent", "cancel-button-props", "confirm-button-props"]));
175
+ }
176
+ };
177
+ export {
178
+ T as _
179
+ };
@@ -0,0 +1,65 @@
1
+ import { defineComponent as l, openBlock as c, createBlock as s, unref as i, mergeProps as m, withCtx as r, createElementVNode as p, toDisplayString as d, renderSlot as f, createVNode as u } from "vue";
2
+ import "dayjs";
3
+ import { T as x } from "./OcComplexCalendar.vue_vue_type_style_index_0_lang-CIQPD-6N.js";
4
+ import { _ as y } from "./OcIcon-CJgBICxh.js";
5
+ /* empty css */
6
+ import "libphonenumber-js";
7
+ /* empty css */
8
+ import "v-calendar";
9
+ /* empty css */
10
+ import "./Cropper.js";
11
+ import "vue-draggable-next";
12
+ import "@popperjs/core";
13
+ const b = { class: "px-3 py-2 text-oc-text-400 text-sm font-medium" }, N = /* @__PURE__ */ l({
14
+ __name: "OcCopyTooltip",
15
+ props: {
16
+ value: [String, Blob],
17
+ tooltipText: {
18
+ type: String,
19
+ default: "Copied!"
20
+ },
21
+ tooltipOptions: Object
22
+ },
23
+ setup(e) {
24
+ const n = async (t) => {
25
+ try {
26
+ t instanceof Blob ? await navigator.clipboard.write([
27
+ new ClipboardItem({
28
+ [t.type]: t
29
+ })
30
+ ]) : await navigator.clipboard.writeText(t);
31
+ } catch (o) {
32
+ console.error("Unable to copy text to clipboard. Error: ", o);
33
+ }
34
+ };
35
+ return (t, o) => (c(), s(i(x), m({
36
+ position: "top",
37
+ "hide-after": 1500,
38
+ "arrow-hidden": "",
39
+ trigger: "click",
40
+ distance: 20
41
+ }, e.tooltipOptions), {
42
+ popper: r(() => [
43
+ p("div", b, d(e.tooltipText), 1)
44
+ ]),
45
+ default: r(({ isShow: a }) => [
46
+ p("div", {
47
+ onClick: o[0] || (o[0] = (g) => n(e.value))
48
+ }, [
49
+ f(t.$slots, "default", { isShow: a }, () => [
50
+ u(i(y), {
51
+ width: "14",
52
+ height: "14",
53
+ class: "cursor-pointer transition-all duration-500",
54
+ name: "copy"
55
+ })
56
+ ])
57
+ ])
58
+ ]),
59
+ _: 3
60
+ }, 16));
61
+ }
62
+ });
63
+ export {
64
+ N as _
65
+ };
@@ -0,0 +1,42 @@
1
+ import { openBlock as t, createElementBlock as r, createElementVNode as c, normalizeClass as o, createBlock as i, unref as l, createCommentVNode as a, toDisplayString as m } from "vue";
2
+ import "dayjs";
3
+ import "./OcComplexCalendar.vue_vue_type_style_index_0_lang-CIQPD-6N.js";
4
+ import { _ as s } from "./OcIcon-CJgBICxh.js";
5
+ /* empty css */
6
+ import "libphonenumber-js";
7
+ /* empty css */
8
+ import "v-calendar";
9
+ /* empty css */
10
+ import "./Cropper.js";
11
+ import "vue-draggable-next";
12
+ import "@popperjs/core";
13
+ const n = { class: "flex gap-x-2 relative items-center text-oc-text-500 cursor-pointer transition-all duration-300" }, C = {
14
+ __name: "OcCriteria",
15
+ props: {
16
+ modelValue: Boolean,
17
+ label: String
18
+ },
19
+ setup(e) {
20
+ return (u, p) => (t(), r("div", n, [
21
+ c("div", {
22
+ class: o([
23
+ "w-5 h-5 flex items-center justify-center rounded-full border transition-all duration-300",
24
+ e.modelValue ? "bg-oc-success border-oc-success" : "border-oc-primary-100 bg-oc-primary-50"
25
+ ])
26
+ }, [
27
+ e.modelValue ? (t(), i(l(s), {
28
+ key: 0,
29
+ name: "check-2",
30
+ class: "w-[10px] h-[10px] text-oc-text-100"
31
+ })) : a("", !0)
32
+ ], 2),
33
+ e.label ? (t(), r("span", {
34
+ key: 0,
35
+ class: o(e.modelValue ? "text-oc-success" : "text-oc-primary-300")
36
+ }, m(e.label), 3)) : a("", !0)
37
+ ]));
38
+ }
39
+ };
40
+ export {
41
+ C as _
42
+ };
@@ -0,0 +1,240 @@
1
+ import { ref as p, watch as S, nextTick as F, openBlock as i, createElementBlock as y, createElementVNode as d, createBlock as u, unref as o, Fragment as A, createVNode as c, createCommentVNode as r, withCtx as V } from "vue";
2
+ import "dayjs";
3
+ import { B as g, a as D, T as G } from "./OcComplexCalendar.vue_vue_type_style_index_0_lang-CIQPD-6N.js";
4
+ import { _ as H } from "./OcIcon-CJgBICxh.js";
5
+ /* empty css */
6
+ import { _ as x } from "./OcInput-tcRxG3Y2.js";
7
+ import "libphonenumber-js";
8
+ import { _ as J } from "./OcRadioGroup-DgfdWJos.js";
9
+ /* empty css */
10
+ import "v-calendar";
11
+ /* empty css */
12
+ import "./Cropper.js";
13
+ import "vue-draggable-next";
14
+ import "@popperjs/core";
15
+ import { Cropper as K } from "vue-advanced-cropper";
16
+ const M = { class: "flex flex-col gap-y-5" }, P = ["src"], Q = { class: "flex gap-x-1 justify-center relative" }, W = { class: "grid grid-cols-2 gap-4" }, me = {
17
+ __name: "OcCropper",
18
+ props: {
19
+ inputOptions: Array,
20
+ inputOptionValues: Object,
21
+ img: String,
22
+ maxSize: [String, Number],
23
+ isReplaceImage: {
24
+ type: Boolean,
25
+ default: !0
26
+ }
27
+ },
28
+ emits: ["changeImage", "update:input-options"],
29
+ setup(n, { emit: E }) {
30
+ const v = n, h = E, k = p(), w = p(), s = p(""), C = p(!1), a = p(v.inputOptionValues ?? {});
31
+ S(
32
+ () => v.inputOptionValues,
33
+ () => {
34
+ a.value = v.inputOptionValues;
35
+ },
36
+ {
37
+ deep: !0
38
+ }
39
+ ), S(
40
+ () => v.img,
41
+ (l) => {
42
+ l && F(() => {
43
+ try {
44
+ const e = new URL(l);
45
+ e.protocol === "http:" || e.protocol === "https:" ? s.value = `${l}?${Date.now()}` : s.value = l;
46
+ } catch {
47
+ s.value = l;
48
+ }
49
+ });
50
+ },
51
+ { immediate: !0 }
52
+ );
53
+ const N = () => {
54
+ if (s.value && C.value) {
55
+ const { canvas: l } = k.value.getResult();
56
+ h("changeImage", l.toDataURL());
57
+ }
58
+ C.value = !0;
59
+ }, O = (l) => {
60
+ var e;
61
+ return (e = k.value) == null ? void 0 : e.rotate(l);
62
+ }, z = (l) => {
63
+ var e;
64
+ return (e = k.value) == null ? void 0 : e.zoom(l);
65
+ }, j = () => {
66
+ w.value.click();
67
+ }, T = (l) => {
68
+ if (l.target.files[0] / (1024 * 1024) > +v.maxSize)
69
+ return l.preventDefault(), !1;
70
+ s.value = URL.createObjectURL(l.target.files[0]);
71
+ }, q = ({ imageSize: l, visibleArea: e }) => ({
72
+ width: (e || l).width,
73
+ height: (e || l).height
74
+ }), f = (l, e) => {
75
+ let m = a.value;
76
+ m[l] = e, h("update:input-options", m);
77
+ }, b = p(!!a.value.caption), U = p(!!a.value.lightbox);
78
+ return (l, e) => {
79
+ var m, $, L, I, R, B;
80
+ return i(), y("div", M, [
81
+ d("input", {
82
+ id: "cropper-file-input",
83
+ ref_key: "fileUploadEl",
84
+ ref: w,
85
+ accept: "image/*",
86
+ type: "file",
87
+ class: "hidden",
88
+ onChange: T
89
+ }, null, 544),
90
+ s.value ? (i(), u(o(K), {
91
+ key: 0,
92
+ ref_key: "cropper",
93
+ ref: k,
94
+ class: "w-full h-[300px]",
95
+ src: s.value,
96
+ "resize-image": { wheel: !1 },
97
+ "background-class": "cropper-background",
98
+ "default-size": q,
99
+ onChange: N
100
+ }, null, 8, ["src"])) : (i(), y("img", {
101
+ key: 1,
102
+ class: "w-full",
103
+ src: n.img
104
+ }, null, 8, P)),
105
+ d("div", Q, [
106
+ s.value ? (i(), y(A, { key: 0 }, [
107
+ c(o(g), {
108
+ variant: "secondary",
109
+ size: "small",
110
+ "left-icon": "backward",
111
+ onClick: e[0] || (e[0] = (t) => O(-90))
112
+ }),
113
+ c(o(g), {
114
+ variant: "secondary",
115
+ size: "small",
116
+ "left-icon": "zoom-out",
117
+ onClick: e[1] || (e[1] = (t) => z(0.8))
118
+ }),
119
+ c(o(g), {
120
+ variant: "secondary",
121
+ size: "small",
122
+ "left-icon": "zoom-in",
123
+ onClick: e[2] || (e[2] = (t) => z(1.2))
124
+ }),
125
+ c(o(g), {
126
+ variant: "secondary",
127
+ size: "small",
128
+ "left-icon": "forward",
129
+ onClick: e[3] || (e[3] = (t) => O(90))
130
+ })
131
+ ], 64)) : r("", !0),
132
+ n.isReplaceImage ? (i(), u(o(g), {
133
+ key: 1,
134
+ class: "absolute right-0",
135
+ variant: "secondary",
136
+ size: "small",
137
+ label: "Replace image",
138
+ "left-icon": "refresh",
139
+ onClick: j
140
+ })) : r("", !0)
141
+ ]),
142
+ d("div", W, [
143
+ (m = n.inputOptions) != null && m.includes("description") ? (i(), u(o(x), {
144
+ key: 0,
145
+ modelValue: a.value.description,
146
+ "onUpdate:modelValue": [
147
+ e[4] || (e[4] = (t) => a.value.description = t),
148
+ e[5] || (e[5] = (t) => f("description", t))
149
+ ],
150
+ label: "Describe Image",
151
+ placeholder: ""
152
+ }, null, 8, ["modelValue"])) : r("", !0),
153
+ ($ = n.inputOptions) != null && $.includes("link") ? (i(), u(o(x), {
154
+ key: 1,
155
+ modelValue: a.value.link,
156
+ "onUpdate:modelValue": [
157
+ e[6] || (e[6] = (t) => a.value.link = t),
158
+ e[7] || (e[7] = (t) => f("link", t))
159
+ ],
160
+ placeholder: "https://hitpayapp.com",
161
+ label: "Link to"
162
+ }, null, 8, ["modelValue"])) : r("", !0),
163
+ d("div", null, [
164
+ (L = n.inputOptions) != null && L.includes("caption") ? (i(), u(o(D), {
165
+ key: 0,
166
+ modelValue: b.value,
167
+ "onUpdate:modelValue": e[8] || (e[8] = (t) => b.value = t),
168
+ label: "Caption",
169
+ class: "mb-4"
170
+ }, null, 8, ["modelValue"])) : r("", !0),
171
+ (I = n.inputOptions) != null && I.includes("caption") && b.value ? (i(), u(o(x), {
172
+ key: 1,
173
+ modelValue: a.value.caption,
174
+ "onUpdate:modelValue": [
175
+ e[9] || (e[9] = (t) => a.value.caption = t),
176
+ e[10] || (e[10] = (t) => f("caption", t))
177
+ ],
178
+ class: "mb-4",
179
+ placeholder: ""
180
+ }, null, 8, ["modelValue"])) : r("", !0),
181
+ (R = n.inputOptions) != null && R.includes("caption") && b.value ? (i(), u(o(J), {
182
+ key: 2,
183
+ "model-value": a.value.caption_variant,
184
+ "group-name": "caption_variant",
185
+ alignment: "horizontal",
186
+ radio: [
187
+ {
188
+ value: "hover",
189
+ label: "Show on hover"
190
+ },
191
+ {
192
+ value: "bottom",
193
+ label: "Show on bottom"
194
+ }
195
+ ],
196
+ label: "Caption position",
197
+ "onUpdate:modelValue": e[11] || (e[11] = (t) => f("caption_variant", t))
198
+ }, null, 8, ["model-value"])) : r("", !0)
199
+ ]),
200
+ d("div", null, [
201
+ (B = n.inputOptions) != null && B.includes("lightbox") ? (i(), u(o(D), {
202
+ key: 0,
203
+ modelValue: U.value,
204
+ "onUpdate:modelValue": [
205
+ e[12] || (e[12] = (t) => U.value = t),
206
+ e[13] || (e[13] = (t) => f("lightbox", t))
207
+ ],
208
+ label: "Lightbox"
209
+ }, {
210
+ after: V(() => [
211
+ c(o(G), {
212
+ position: "bottom",
213
+ distance: 10,
214
+ "popper-class": "bg-oc-bg-light min-w-[125px]"
215
+ }, {
216
+ popper: V(() => e[14] || (e[14] = [
217
+ d("div", { class: "text-oc-text-400 text-sm px-3 py-2 font-medium text-center" }, " Show lightbox when click the image ", -1)
218
+ ])),
219
+ default: V(() => [
220
+ c(o(H), {
221
+ name: "question-mark",
222
+ width: "16",
223
+ height: "16",
224
+ class: "text-oc-accent-1-500"
225
+ })
226
+ ]),
227
+ _: 1
228
+ })
229
+ ]),
230
+ _: 1
231
+ }, 8, ["modelValue"])) : r("", !0)
232
+ ])
233
+ ])
234
+ ]);
235
+ };
236
+ }
237
+ };
238
+ export {
239
+ me as default
240
+ };
@@ -0,0 +1,160 @@
1
+ import { openBlock as t, createElementBlock as o, normalizeClass as d, createElementVNode as s, createVNode as m, unref as n, createCommentVNode as i, createBlock as u, Fragment as D, withCtx as F, createTextVNode as G, toDisplayString as c, renderSlot as I } from "vue";
2
+ import "dayjs";
3
+ import { B as J } from "./OcComplexCalendar.vue_vue_type_style_index_0_lang-CIQPD-6N.js";
4
+ import { _ as K } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
+ import { _ as f } from "./OcListDetail-6XeME6ko.js";
6
+ import { _ as P } from "./OcIcon-CJgBICxh.js";
7
+ /* empty css */
8
+ import "libphonenumber-js";
9
+ /* empty css */
10
+ import "v-calendar";
11
+ /* empty css */
12
+ import "./Cropper.js";
13
+ import "vue-draggable-next";
14
+ import { _ as T } from "./OcAvatar-NDXQiZvz.js";
15
+ import "@popperjs/core";
16
+ const L = { class: "flex flex-col items-center justify-center gap-y-3 overflow-hidden" }, M = { class: "w-full flex gap-x-3 items-center" }, Q = { class: "flex flex-col font-medium overflow-hidden" }, R = { class: "flex items-center gap-2" }, W = { class: "truncate" }, X = {
17
+ key: 0,
18
+ class: "rounded-md py-1 px-3 text-sm text-oc-accent-1-500 bg-oc-accent-1-50"
19
+ }, Y = {
20
+ key: 0,
21
+ class: "text-sm text-oc-text-400"
22
+ }, Z = {
23
+ key: 1,
24
+ class: "text-sm text-oc-text-400 truncate"
25
+ }, p = {
26
+ key: 0,
27
+ class: "flex flex-col gap-y-4 pt-4 w-full"
28
+ }, _ = { class: "flex flex-col gap-y-2 w-full items-center" }, ee = { key: 0 }, te = {
29
+ __name: "OcCustomerCard",
30
+ props: {
31
+ variant: {
32
+ type: String,
33
+ default: "small",
34
+ validator: (e) => ["small", "big", "float"].includes(e)
35
+ },
36
+ customer: Object,
37
+ isHover: {
38
+ type: Boolean,
39
+ default: !1
40
+ },
41
+ isEdit: {
42
+ type: Boolean,
43
+ default: !1
44
+ },
45
+ isClosable: Boolean,
46
+ isBeneficiary: Boolean
47
+ },
48
+ emits: ["addCustomer", "editCustomer", "closeCustomer"],
49
+ setup(e, { emit: U }) {
50
+ const q = U;
51
+ return (a, r) => {
52
+ var y, h, b, v, x, g, k, C, $, B, w, z, E, N, j, H, V, A, S;
53
+ return t(), o("div", {
54
+ class: d(["rounded shrink-0 border border-oc-gray-200 bg-oc-bg-light flex items-center justify-between gap-4 px-4 py-5 customer-card relative group", { [e.variant]: !0, "hover:shadow-normal transition": e.isHover }])
55
+ }, [
56
+ s("div", L, [
57
+ e.isEdit ? (t(), o("div", {
58
+ key: 0,
59
+ class: d(["absolute right-3 top-3 transition", { "opacity-0 group-hover:opacity-100": e.isHover }])
60
+ }, [
61
+ m(n(J), {
62
+ "right-icon": "pencil",
63
+ variant: "secondary",
64
+ size: "small",
65
+ class: "*:!px-[6px]",
66
+ onClick: r[0] || (r[0] = (l) => a.$emit("editCustomer", e.customer))
67
+ })
68
+ ], 2)) : i("", !0),
69
+ e.isClosable ? (t(), u(n(P), {
70
+ key: 1,
71
+ class: "absolute -right-1.5 -top-1.5 border-1 border-white rounded-full text-gray-500 cursor-pointer transition-all duration-300 hover:text-oc-error",
72
+ name: "filled-x-circle",
73
+ onClick: r[1] || (r[1] = (l) => q("closeCustomer"))
74
+ })) : i("", !0),
75
+ e.customer ? (t(), o(D, { key: 2 }, [
76
+ s("div", M, [
77
+ m(n(T), {
78
+ class: "shrink-0 uppercase",
79
+ size: 32
80
+ }, {
81
+ default: F(() => {
82
+ var l, O;
83
+ return [
84
+ G(c(((O = (l = e.customer) == null ? void 0 : l.name) == null ? void 0 : O[0]) || "J"), 1)
85
+ ];
86
+ }),
87
+ _: 1
88
+ }),
89
+ s("div", Q, [
90
+ s("div", R, [
91
+ s("span", W, c(((y = e.customer) == null ? void 0 : y.name) || "-"), 1),
92
+ e.isBeneficiary ? (t(), o("span", X, c((h = e.customer.currency) == null ? void 0 : h.toUpperCase()), 1)) : i("", !0)
93
+ ]),
94
+ e.isBeneficiary ? (t(), o("span", Y, c(e.customer.bank_name) + " / " + c(e.customer.bank_account_number), 1)) : (t(), o("span", Z, c(((b = e.customer) == null ? void 0 : b.email) || ((v = e.customer) != null && v.phone_number_country_code && ((x = e.customer) != null && x.phone_number) ? `+${e.customer.phone_number_country_code} ${e.customer.phone_number}` : (g = e.customer) != null && g.phone_number ? e.customer.phone_number : "-")), 1))
95
+ ])
96
+ ]),
97
+ e.variant !== "small" ? (t(), o("div", p, [
98
+ e.isBeneficiary ? i("", !0) : (t(), u(n(f), {
99
+ key: 0,
100
+ label: "Phone",
101
+ content: (k = e.customer) != null && k.phone_number_country_code && ((C = e.customer) != null && C.phone_number) ? `+${e.customer.phone_number_country_code} ${e.customer.phone_number}` : ($ = e.customer) != null && $.phone_number ? e.customer.phone_number : "-"
102
+ }, null, 8, ["content"])),
103
+ e.isBeneficiary ? (t(), u(n(f), {
104
+ key: 1,
105
+ label: "Email",
106
+ content: e.customer.email ?? "-"
107
+ }, null, 8, ["content"])) : (t(), u(n(f), {
108
+ key: 2,
109
+ label: "Address",
110
+ content: [
111
+ ((w = (B = e.customer) == null ? void 0 : B.address) == null ? void 0 : w.street) || "",
112
+ ((E = (z = e.customer) == null ? void 0 : z.address) == null ? void 0 : E.city) || "",
113
+ ((j = (N = e.customer) == null ? void 0 : N.address) == null ? void 0 : j.state) || "",
114
+ ((V = (H = e.customer) == null ? void 0 : H.address) == null ? void 0 : V.postal_code) || "",
115
+ ((S = (A = e.customer) == null ? void 0 : A.address) == null ? void 0 : S.country) || ""
116
+ ].join(" ").trim() || "-"
117
+ }, null, 8, ["content"]))
118
+ ])) : i("", !0)
119
+ ], 64)) : e.isBeneficiary ? i("", !0) : (t(), o(D, { key: 3 }, [
120
+ s("div", _, [
121
+ m(n(T), { size: 32 }, {
122
+ default: F(() => [
123
+ m(n(P), {
124
+ name: "user-add",
125
+ width: "16",
126
+ height: "16"
127
+ })
128
+ ]),
129
+ _: 1
130
+ }),
131
+ r[3] || (r[3] = s("div", { class: "flex flex-col font-medium text-center" }, [
132
+ s("span", null, "No customer attached"),
133
+ s("span", { class: "text-sm text-oc-text-400" }, " Add customer detail to this transaction ")
134
+ ], -1))
135
+ ]),
136
+ m(n(J), {
137
+ variant: "secondary",
138
+ size: "small",
139
+ class: "w-full",
140
+ label: "Add customer",
141
+ onClick: r[2] || (r[2] = (l) => a.$emit("addCustomer"))
142
+ })
143
+ ], 64)),
144
+ a.$slots.bottom ? (t(), o("div", {
145
+ key: 4,
146
+ class: d({ "opacity-0 group-hover:opacity-100": e.isHover })
147
+ }, [
148
+ I(a.$slots, "bottom", {}, void 0, !0)
149
+ ], 2)) : i("", !0)
150
+ ]),
151
+ a.$slots.leading ? (t(), o("div", ee, [
152
+ I(a.$slots, "leading", {}, void 0, !0)
153
+ ])) : i("", !0)
154
+ ], 2);
155
+ };
156
+ }
157
+ }, ve = /* @__PURE__ */ K(te, [["__scopeId", "data-v-e499a3c4"]]);
158
+ export {
159
+ ve as C
160
+ };