@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.
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/Calendar.js +103 -0
- package/dist/Cropper.js +6 -0
- package/dist/DataDisplay/CustomerCard/OcCustomerCard.js +4 -0
- package/dist/DataDisplay/FloatContent/OcFloatContent.js +4 -0
- package/dist/DataDisplay/HorizontalProgressbar/OcHorizontalProgressbar.js +4 -0
- package/dist/DataDisplay/InfoCard/OcInfoCard.js +4 -0
- package/dist/DataDisplay/ListDetail/OcListDetail.js +4 -0
- package/dist/DataDisplay/ListItem/OcListItem.js +5 -0
- package/dist/DataDisplay/OnboardingListItem/OcOnboardingListItem.js +4 -0
- package/dist/DataDisplay/Overview/OcOverview.js +7 -0
- package/dist/DataDisplay/Pagination/OcPagination.js +6 -0
- package/dist/DataDisplay/ProgressBar/OcProgressBar.js +4 -0
- package/dist/DataDisplay/Table/OcTable.js +11 -0
- package/dist/DataDisplay/TransferSummary/OcTransferSummary.js +4 -0
- package/dist/DatePicker-D3w435Ml.js +263 -0
- package/dist/Disclosure/Accordion/OcAccordion.js +4 -0
- package/dist/Disclosure/OnboardingAccordion/OnboardingAccordion.js +4 -0
- package/dist/Disclosure/Steps/OcSteps.js +5 -0
- package/dist/Disclosure/SwitchTabs/OcSwitchTabs.js +4 -0
- package/dist/Disclosure/Tabs/Tabs.js +5 -0
- package/dist/Disclosure/Variants/OcVariants.js +5 -0
- package/dist/Draggable.js +168 -0
- package/dist/Elements/AdditionalContent/OcAdditionalContent.js +5 -0
- package/dist/Elements/AuthenticationOption/AuthenticationOption.js +4 -0
- package/dist/Elements/Box/OcBox.js +4 -0
- package/dist/Elements/EmptyPage/OcEmptyPage.js +4 -0
- package/dist/Elements/FeatureOverviewCard/OcFeatureOverviewCard.js +4 -0
- package/dist/Elements/Header/OcHeader.js +9 -0
- package/dist/Elements/PageTitle/OcPageTitle.js +7 -0
- package/dist/Elements/SandboxBanner/OcSandboxBanner.js +4 -0
- package/dist/Elements/Sidebar/OcSidebar.js +6 -0
- package/dist/Elements/Skeleton/OcSkeleton.js +4 -0
- package/dist/Elements/SubSidebar/OcSubSidebar.js +4 -0
- package/dist/Elements/VerificationOption/OcVerificationOption.js +4 -0
- package/dist/EmojiPicker.js +4 -0
- package/dist/Feedback/Banner/OcBanner.js +4 -0
- package/dist/Feedback/Chip/OcChip.js +4 -0
- package/dist/Feedback/ShareIcon/OcShareIcon.js +4 -0
- package/dist/Feedback/Snackbar/OcSnackbar.js +4 -0
- package/dist/Feedback/Tag/OcTag.js +4 -0
- package/dist/Form/BaseInput/OcBaseInput.js +4 -0
- package/dist/Form/Button/OcButton.js +4 -0
- package/dist/Form/Calendar/OcCalendar.js +5 -0
- package/dist/Form/CardInput/OcCardInput.js +4 -0
- package/dist/Form/Checkbox/OcCheckbox.js +4 -0
- package/dist/Form/CheckboxesGroup/OcCheckboxesGroup.js +4 -0
- package/dist/Form/Criteria/OcCriteria.js +4 -0
- package/dist/Form/Cropper/OcCropper.js +4 -0
- package/dist/Form/DatePicker/OcDatePicker.js +4 -0
- package/dist/Form/EmojiPicker/OcEmojiPicker.js +4 -0
- package/dist/Form/EmojiPicker/conts/emoji.js +1030 -0
- package/dist/Form/Input/OcInput.js +6 -0
- package/dist/Form/LinkInput/OcLinkInput.js +4 -0
- package/dist/Form/MultipleUploadFile/OcMultipleUploadFile.js +4 -0
- package/dist/Form/NumberInput/OcNumberInput.js +4 -0
- package/dist/Form/PhoneInput/OcPhoneInput.js +4 -0
- package/dist/Form/Radio/OcRadio.js +4 -0
- package/dist/Form/RadioGroup/OcRadioGroup.js +4 -0
- package/dist/Form/RangeInput/OcRangeInput.js +4 -0
- package/dist/Form/SectionItem/OcSectionItem.js +4 -0
- package/dist/Form/Select/OcSelect.js +7 -0
- package/dist/Form/SelectOptions/OcSelectOptions.js +4 -0
- package/dist/Form/SingleFileUpload/OcSingleFileUpload.js +4 -0
- package/dist/Form/Slider/OcSlider.js +4 -0
- package/dist/Form/TextArea/OcTextArea.js +4 -0
- package/dist/Form/TimePicker/OcTimePicker.js +6 -0
- package/dist/Form/Toggle/OcToggle.js +4 -0
- package/dist/Form/index.js +54 -0
- package/dist/FormBuilder/OcFormBuilder.js +4 -0
- package/dist/MediaAndIcons/Avatar/OcAvatar.js +4 -0
- package/dist/MediaAndIcons/Icon/OcIcon.js +4 -0
- package/dist/OcAccordion-DdkNsXvN.js +101 -0
- package/dist/OcAccountSetup-BXDjf48o.js +324 -0
- package/dist/OcAdditionalContent-BMSysCXu.js +612 -0
- package/dist/OcAuthenticationOption.vue_vue_type_script_setup_true_lang-w5Y0ymGN.js +43 -0
- package/dist/OcAvatar-NDXQiZvz.js +41 -0
- package/dist/OcBanner-Cg2WJV6e.js +108 -0
- package/dist/OcBox.vue_vue_type_script_setup_true_lang-aB397QRg.js +43 -0
- package/dist/OcCardInput-BFE4Xu-S.js +75 -0
- package/dist/OcCheckboxesGroup-CLbquUO2.js +94 -0
- package/dist/OcChip-B1hm2Qni.js +144 -0
- package/dist/OcComplexCalendar-x-_kg9Yk.js +108 -0
- package/dist/OcComplexCalendar.vue_vue_type_style_index_0_lang-CIQPD-6N.js +1006 -0
- package/dist/OcConfirmationModal-BfCrRV9r.js +179 -0
- package/dist/OcCopyTooltip.vue_vue_type_script_setup_true_lang-S2RAfV_g.js +65 -0
- package/dist/OcCriteria-CpIohheZ.js +42 -0
- package/dist/OcCropper-31Y_S1Ne.js +240 -0
- package/dist/OcCustomerCard-DbDOBO03.js +160 -0
- package/dist/OcDraggable-BjhGJmpM.js +35 -0
- package/dist/OcDropdownItem-DAElmzEu.js +57 -0
- package/dist/OcEmojiPicker-BXm-_OGK.js +157 -0
- package/dist/OcEmptyPage-CTwgMzRp.js +155 -0
- package/dist/OcExpadingTable.vue_vue_type_script_setup_true_lang-B4HOMDBK.js +815 -0
- package/dist/OcFeatureOverviewCard-RVyrWLVW.js +71 -0
- package/dist/OcFloatContent-BIKQOxSw.js +142 -0
- package/dist/OcFormBuilder-CRXWtt8I.js +177 -0
- package/dist/OcGroupOptions-ChGJvTXl.js +16 -0
- package/dist/OcHorizontalProgressbar.vue_vue_type_script_setup_true_lang-4eVgPDi5.js +32 -0
- package/dist/OcIcon-CJgBICxh.js +63 -0
- package/dist/OcInfoCard-DpYUZOMZ.js +81 -0
- package/dist/OcInput-tcRxG3Y2.js +227 -0
- package/dist/OcInputOption-CncASfNt.js +160 -0
- package/dist/OcLinkInput-C2ixk-gk.js +143 -0
- package/dist/OcListDetail-6XeME6ko.js +76 -0
- package/dist/OcListUrl.vue_vue_type_script_setup_true_lang-BEJafLuT.js +749 -0
- package/dist/OcModal-DdD5VFEN.js +187 -0
- package/dist/OcModalCropper-D2OI2iun.js +56 -0
- package/dist/OcModalPage-BLVa-kcB.js +86 -0
- package/dist/OcMultipleUploadFile-B8Wl9Fuq.js +446 -0
- package/dist/OcNumberInput.vue_vue_type_script_setup_true_lang-C4EXUIUe.js +90 -0
- package/dist/OcOnboardingListItem.vue_vue_type_script_setup_true_lang-Cr80xmnz.js +81 -0
- package/dist/OcOption-DK2FBGq7.js +485 -0
- package/dist/OcOverviewIcon-D702Ujka.js +55 -0
- package/dist/OcOverviewItem-DNr5tWnt.js +186 -0
- package/dist/OcPageTitleRight-DMtJ1qmZ.js +243 -0
- package/dist/OcPaginationNumber-IKPorX26.js +172 -0
- package/dist/OcPaymentTab-Cna1IAhO.js +170 -0
- package/dist/OcPhoneInput-AC6BgQhN.js +432 -0
- package/dist/OcPopper-C11OgQAj.js +97 -0
- package/dist/OcPrimaryActions-D5IprKsQ.js +222 -0
- package/dist/OcProgressBar-hiyC5XSc.js +33 -0
- package/dist/OcRadio-CRYfNwV9.js +107 -0
- package/dist/OcRadioGroup-DgfdWJos.js +76 -0
- package/dist/OcRangeInput-C-hoHFhr.js +103 -0
- package/dist/OcSandboxBanner.vue_vue_type_script_setup_true_lang-BD0k_8xa.js +37 -0
- package/dist/OcSectionItem-BFgxO3se.js +84 -0
- package/dist/OcSelectOptions-BQlG_EUA.js +148 -0
- package/dist/OcShareIcon-BB-NPq0r.js +53 -0
- package/dist/OcSingleFileUpload-B8-e1H5t.js +464 -0
- package/dist/OcSkeleton-BdPTmGh0.js +13 -0
- package/dist/OcSlider-Bsi-ckbP.js +124 -0
- package/dist/OcSnackbar-CKxY1-ej.js +196 -0
- package/dist/OcSteps.vue_vue_type_script_setup_true_lang-CXGy8ma_.js +87 -0
- package/dist/OcSubSidebar.vue_vue_type_script_setup_true_lang-CNxgU07N.js +60 -0
- package/dist/OcSupportMenu.vue_vue_type_script_setup_true_lang-DrjZsWti.js +114 -0
- package/dist/OcSwitchTabs-CYp676bj.js +31 -0
- package/dist/OcTabToSelect-BHAz1Niv.js +183 -0
- package/dist/OcTag.vue_vue_type_script_setup_true_lang-D19lw-8Y.js +26 -0
- package/dist/OcTextArea-BpV1Bnj_.js +78 -0
- package/dist/OcTheme-CWgrJh5Q.js +25 -0
- package/dist/OcTimePicker-B61MCi0D.js +110 -0
- package/dist/OcTimePopup-zQFKCZLk.js +131 -0
- package/dist/OcToggle-C0wTjM_Y.js +54 -0
- package/dist/OcTransferSummary-Bk2GXhrT.js +67 -0
- package/dist/OcVariant.vue_vue_type_script_setup_true_lang-CY_82DLc.js +99 -0
- package/dist/OcVerificationOption.vue_vue_type_script_setup_true_lang-ChqvNoDe.js +59 -0
- package/dist/OcWhiteList.vue_vue_type_script_setup_true_lang-DI9pYU3w.js +64 -0
- package/dist/OnboardingAccordion.vue_vue_type_script_setup_true_lang-B0Z7ETmj.js +113 -0
- package/dist/Overlay/ConfirmationModal/OcConfirmationModal.js +4 -0
- package/dist/Overlay/CopyTooltip/OcCopyTooltip.js +4 -0
- package/dist/Overlay/Dropdown/OcDropdown.js +6 -0
- package/dist/Overlay/Modal/OcModal.js +6 -0
- package/dist/Overlay/Popper/OcPopper.js +4 -0
- package/dist/Overlay/SupportMenu/OcSupportMenu.js +4 -0
- package/dist/Overlay/Tooltip/OcTooltip.js +4 -0
- package/dist/Overlay/Whitelist/OcWhiteList.js +4 -0
- package/dist/StoreDesign.js +240 -0
- package/dist/Theme/OcTheme.js +4 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/composables/helpers.js +48 -0
- package/dist/composables/uploadFileProgress.js +62 -0
- package/dist/composables/useWindowWidth.js +10 -0
- package/dist/data/Validator.js +5 -0
- package/dist/directives/clickOutside.js +13 -0
- package/dist/index.js +177 -1
- package/dist/style.css +1 -0
- package/package.json +23 -5
package/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2023-present
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# Orchid UI
|
package/dist/Calendar.js
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
import { _ as m } from "./OcComplexCalendar-x-_kg9Yk.js";
|
2
|
+
import { ref as s, openBlock as d, createBlock as c, unref as e, withCtx as l, createVNode as r } from "vue";
|
3
|
+
import n from "dayjs";
|
4
|
+
import { c as p, _ as f, D as b } from "./OcComplexCalendar.vue_vue_type_style_index_0_lang-CIQPD-6N.js";
|
5
|
+
/* empty css */
|
6
|
+
import { _ as D } from "./OcInput-tcRxG3Y2.js";
|
7
|
+
import "libphonenumber-js";
|
8
|
+
/* empty css */
|
9
|
+
/* empty css */
|
10
|
+
import "./Cropper.js";
|
11
|
+
import "vue-draggable-next";
|
12
|
+
import "@popperjs/core";
|
13
|
+
const S = {
|
14
|
+
__name: "OcComplexDatePicker",
|
15
|
+
props: {
|
16
|
+
shortcuts: Array,
|
17
|
+
cancelButtonProps: Object,
|
18
|
+
submitButtonProps: Object,
|
19
|
+
/**
|
20
|
+
* Props to pass to the calendar component from https://vcalendar.io/
|
21
|
+
*/
|
22
|
+
calendarProps: Object,
|
23
|
+
modelValue: {
|
24
|
+
type: Object,
|
25
|
+
default: () => ({
|
26
|
+
start: /* @__PURE__ */ new Date(),
|
27
|
+
end: /* @__PURE__ */ new Date()
|
28
|
+
})
|
29
|
+
},
|
30
|
+
formatDate: {
|
31
|
+
type: String,
|
32
|
+
default: "DD/MM/YYYY"
|
33
|
+
},
|
34
|
+
countCalendars: {
|
35
|
+
type: Number,
|
36
|
+
default: 2
|
37
|
+
},
|
38
|
+
withFooter: {
|
39
|
+
type: Boolean,
|
40
|
+
default: !0
|
41
|
+
},
|
42
|
+
label: String,
|
43
|
+
hint: String,
|
44
|
+
isRequired: Boolean,
|
45
|
+
errorMessage: String,
|
46
|
+
labelIcon: String,
|
47
|
+
tooltipText: String,
|
48
|
+
tooltipOptions: Object
|
49
|
+
},
|
50
|
+
emits: {
|
51
|
+
"update:modelValue": []
|
52
|
+
},
|
53
|
+
setup(t) {
|
54
|
+
n.extend(p);
|
55
|
+
const i = s(!1);
|
56
|
+
return (u, o) => (d(), c(e(f), {
|
57
|
+
label: t.label,
|
58
|
+
hint: t.hint,
|
59
|
+
"error-message": t.errorMessage,
|
60
|
+
"is-required": t.isRequired,
|
61
|
+
"tooltip-options": t.tooltipOptions,
|
62
|
+
"label-icon": t.labelIcon,
|
63
|
+
"tooltip-text": t.tooltipText
|
64
|
+
}, {
|
65
|
+
default: l(() => [
|
66
|
+
r(e(b), {
|
67
|
+
modelValue: i.value,
|
68
|
+
"onUpdate:modelValue": o[1] || (o[1] = (a) => i.value = a),
|
69
|
+
position: "bottom",
|
70
|
+
class: "w-full"
|
71
|
+
}, {
|
72
|
+
menu: l(() => [
|
73
|
+
r(e(m), {
|
74
|
+
"model-value": t.modelValue,
|
75
|
+
shortcuts: t.shortcuts,
|
76
|
+
"cancel-button-props": t.cancelButtonProps,
|
77
|
+
"submit-button-props": t.submitButtonProps,
|
78
|
+
"calendar-props": t.calendarProps,
|
79
|
+
"count-calendars": t.countCalendars,
|
80
|
+
"with-footer": t.withFooter,
|
81
|
+
"onUpdate:modelValue": o[0] || (o[0] = (a) => u.$emit("update:modelValue", a))
|
82
|
+
}, null, 8, ["model-value", "shortcuts", "cancel-button-props", "submit-button-props", "calendar-props", "count-calendars", "with-footer"])
|
83
|
+
]),
|
84
|
+
default: l(() => [
|
85
|
+
r(e(D), {
|
86
|
+
"model-value": `${e(n)(t.modelValue.start).format(t.formatDate)} - ${e(n)(
|
87
|
+
t.modelValue.end
|
88
|
+
).format(t.formatDate)}`,
|
89
|
+
icon: "calendar",
|
90
|
+
readonly: ""
|
91
|
+
}, null, 8, ["model-value"])
|
92
|
+
]),
|
93
|
+
_: 1
|
94
|
+
}, 8, ["modelValue"])
|
95
|
+
]),
|
96
|
+
_: 1
|
97
|
+
}, 8, ["label", "hint", "error-message", "is-required", "tooltip-options", "label-icon", "tooltip-text"]));
|
98
|
+
}
|
99
|
+
};
|
100
|
+
export {
|
101
|
+
m as ComplexCalendar,
|
102
|
+
S as ComplexDatePicker
|
103
|
+
};
|
package/dist/Cropper.js
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
import { g as l, a as n, f as b, _ as s, c as T, d, b as o, e as g } from "../../OcExpadingTable.vue_vue_type_script_setup_true_lang-B4HOMDBK.js";
|
2
|
+
export {
|
3
|
+
l as ExpandingHeaderRow,
|
4
|
+
n as ExpandingTable,
|
5
|
+
b as ExpandingTableRow,
|
6
|
+
s as Table,
|
7
|
+
T as TableCell,
|
8
|
+
d as TableCellContent,
|
9
|
+
o as TableHeader,
|
10
|
+
g as TableLink
|
11
|
+
};
|
@@ -0,0 +1,263 @@
|
|
1
|
+
import { ref as b, computed as S, openBlock as f, createBlock as V, unref as c, withCtx as p, renderSlot as R, createCommentVNode as k, createElementVNode as i, createElementBlock as F, Fragment as A, createVNode as x, toDisplayString as E, normalizeClass as M, withKeys as B, withModifiers as U } from "vue";
|
2
|
+
import d from "dayjs";
|
3
|
+
import { c as j, D as K, b as O, _ as P } from "./OcComplexCalendar.vue_vue_type_style_index_0_lang-CIQPD-6N.js";
|
4
|
+
import { _ as $ } from "./OcIcon-CJgBICxh.js";
|
5
|
+
/* empty css */
|
6
|
+
import { _ as T } from "./OcInput-tcRxG3Y2.js";
|
7
|
+
import "libphonenumber-js";
|
8
|
+
/* empty css */
|
9
|
+
import { _ as L } from "./OcComplexCalendar-x-_kg9Yk.js";
|
10
|
+
/* empty css */
|
11
|
+
import "./Cropper.js";
|
12
|
+
import "vue-draggable-next";
|
13
|
+
import "@popperjs/core";
|
14
|
+
const z = { class: "flex flex-col gap-y-2 w-full" }, G = { class: "flex w-full" }, H = {
|
15
|
+
key: 0,
|
16
|
+
class: "text-sm text-oc-error flex items-center"
|
17
|
+
}, J = {
|
18
|
+
key: 1,
|
19
|
+
class: "flex flex-wrap cursor-pointer"
|
20
|
+
}, Q = { class: "flex items-center gap-x-3" }, W = ["value"], X = { class: "flex items-center gap-x-3" }, Z = ["value"], fe = {
|
21
|
+
__name: "DatePicker",
|
22
|
+
props: {
|
23
|
+
modelValue: {
|
24
|
+
type: [String, Date, Number, Array]
|
25
|
+
},
|
26
|
+
type: {
|
27
|
+
type: String,
|
28
|
+
default: "default",
|
29
|
+
validator: (e) => ["default", "range"].includes(e)
|
30
|
+
},
|
31
|
+
disabledDate: {
|
32
|
+
type: Function,
|
33
|
+
default: () => !1
|
34
|
+
},
|
35
|
+
minDate: {
|
36
|
+
type: [String, Date, Number],
|
37
|
+
default: null
|
38
|
+
},
|
39
|
+
maxDate: {
|
40
|
+
type: [String, Date, Number],
|
41
|
+
default: null
|
42
|
+
},
|
43
|
+
dateFormat: {
|
44
|
+
type: String,
|
45
|
+
default: "YYYY-MM-DD"
|
46
|
+
},
|
47
|
+
disabled: {
|
48
|
+
type: Boolean,
|
49
|
+
default: !1
|
50
|
+
},
|
51
|
+
errorMessage: {
|
52
|
+
type: String,
|
53
|
+
default: ""
|
54
|
+
},
|
55
|
+
label: {
|
56
|
+
type: String,
|
57
|
+
default: ""
|
58
|
+
},
|
59
|
+
hint: {
|
60
|
+
type: String,
|
61
|
+
default: ""
|
62
|
+
},
|
63
|
+
placeholder: {
|
64
|
+
type: String,
|
65
|
+
default: "YYYY-MM-DD"
|
66
|
+
},
|
67
|
+
isSplitInput: {
|
68
|
+
type: Boolean,
|
69
|
+
default: !0
|
70
|
+
},
|
71
|
+
minLabel: {
|
72
|
+
type: String,
|
73
|
+
default: "From"
|
74
|
+
},
|
75
|
+
maxLabel: {
|
76
|
+
type: String,
|
77
|
+
default: "To"
|
78
|
+
},
|
79
|
+
isRequired: {
|
80
|
+
type: Boolean,
|
81
|
+
default: !1
|
82
|
+
},
|
83
|
+
isIndefinite: {
|
84
|
+
type: Boolean,
|
85
|
+
default: !1
|
86
|
+
},
|
87
|
+
disabledRange: {
|
88
|
+
type: Object,
|
89
|
+
default: () => ({
|
90
|
+
start: null,
|
91
|
+
end: null
|
92
|
+
})
|
93
|
+
},
|
94
|
+
countCalendars: {
|
95
|
+
type: Number,
|
96
|
+
default: 2
|
97
|
+
},
|
98
|
+
shortcuts: {
|
99
|
+
type: Array,
|
100
|
+
default: () => []
|
101
|
+
}
|
102
|
+
},
|
103
|
+
emits: ["update:modelValue", "resetCalendar", "error"],
|
104
|
+
setup(e, { emit: Y }) {
|
105
|
+
d.extend(j);
|
106
|
+
const s = Y, t = e, m = b(!1), w = b(!1), y = b(!1), r = b([]), v = S(() => t.type === "range"), o = S(() => v.value ? t.modelValue && t.modelValue[0] ? [
|
107
|
+
d(t.modelValue[0], t.dateFormat),
|
108
|
+
d(t.modelValue[1], t.dateFormat)
|
109
|
+
] : ["", ""] : t.modelValue ? d(t.modelValue, t.dateFormat) : ""), h = (a) => {
|
110
|
+
t.type === "range" ? s(
|
111
|
+
"update:modelValue",
|
112
|
+
a ? [
|
113
|
+
d(a.start).format(t.dateFormat),
|
114
|
+
d(a.end).format(t.dateFormat)
|
115
|
+
] : []
|
116
|
+
) : s("update:modelValue", d(a).format(t.dateFormat)), m.value = !1;
|
117
|
+
}, D = () => {
|
118
|
+
s("resetCalendar"), s("update:modelValue", v.value ? [] : null), m.value = !1;
|
119
|
+
}, q = (a) => {
|
120
|
+
const l = d(a);
|
121
|
+
return ((u) => u.get("month") === d().get("month"))(l);
|
122
|
+
}, N = (a) => {
|
123
|
+
w.value = a, s("update:modelValue", a ? "Indefinite" : null);
|
124
|
+
}, I = (a, l) => {
|
125
|
+
var u;
|
126
|
+
const n = d(a, t.dateFormat, !0);
|
127
|
+
r.value[l] = n.format(t.dateFormat), r.value[l ? 0 : 1] = ((u = t.modelValue) == null ? void 0 : u[l ? 0 : 1]) || d().format(t.dateFormat);
|
128
|
+
}, g = () => {
|
129
|
+
if (r.value.length) {
|
130
|
+
if (y.value = !1, r.value.some((a) => !d(a, t.dateFormat).isValid())) {
|
131
|
+
y.value = !0, r.value = [];
|
132
|
+
return;
|
133
|
+
}
|
134
|
+
t.maxDate && (r.value = r.value.map(
|
135
|
+
(a) => d(a, t.dateFormat).isSameOrBefore(d(t.maxDate)) ? a : d(t.maxDate).format(t.dateFormat)
|
136
|
+
)), s("update:modelValue", r.value), r.value = [];
|
137
|
+
}
|
138
|
+
};
|
139
|
+
return (a, l) => (f(), V(c(K), {
|
140
|
+
modelValue: m.value,
|
141
|
+
"onUpdate:modelValue": l[3] || (l[3] = (n) => m.value = n),
|
142
|
+
"is-disabled": e.disabled,
|
143
|
+
placement: "bottom-start",
|
144
|
+
distance: 10,
|
145
|
+
class: "w-full"
|
146
|
+
}, {
|
147
|
+
menu: p(({ isPopoverOpen: n }) => [
|
148
|
+
R(a.$slots, "menu", {
|
149
|
+
isPopoverOpen: n,
|
150
|
+
updateCalendar: h,
|
151
|
+
resetCalendar: D
|
152
|
+
}, () => {
|
153
|
+
var u, C;
|
154
|
+
return [
|
155
|
+
v.value ? (f(), V(L, {
|
156
|
+
key: 0,
|
157
|
+
"model-value": {
|
158
|
+
start: (u = e.modelValue) == null ? void 0 : u[0],
|
159
|
+
end: (C = e.modelValue) == null ? void 0 : C[1]
|
160
|
+
},
|
161
|
+
shortcuts: e.shortcuts,
|
162
|
+
"count-calendars": e.countCalendars,
|
163
|
+
"is-range": "",
|
164
|
+
"with-footer": !1,
|
165
|
+
"min-date": e.minDate,
|
166
|
+
"max-date": e.maxDate,
|
167
|
+
masks: { modelValue: e.dateFormat },
|
168
|
+
"onUpdate:modelValue": h
|
169
|
+
}, null, 8, ["model-value", "shortcuts", "count-calendars", "min-date", "max-date", "masks"])) : !e.disabled && n ? (f(), V(c(O), {
|
170
|
+
key: 1,
|
171
|
+
"model-value": o.value ? o.value.toDate() : /* @__PURE__ */ new Date(),
|
172
|
+
"disabled-date": w.value ? q : e.disabledDate,
|
173
|
+
"max-date": e.maxDate,
|
174
|
+
"min-date": e.minDate,
|
175
|
+
"is-indefinite": e.isIndefinite,
|
176
|
+
position: "inline",
|
177
|
+
type: e.type,
|
178
|
+
"onUpdate:modelValue": h,
|
179
|
+
"onUpdate:isIndefinite": N,
|
180
|
+
onResetCalendar: D
|
181
|
+
}, null, 8, ["model-value", "disabled-date", "max-date", "min-date", "is-indefinite", "type"])) : k("", !0)
|
182
|
+
];
|
183
|
+
})
|
184
|
+
]),
|
185
|
+
default: p(() => [
|
186
|
+
i("div", z, [
|
187
|
+
!e.isSplitInput || !v.value ? (f(), F(A, { key: 0 }, [
|
188
|
+
i("div", G, [
|
189
|
+
x(c(T), {
|
190
|
+
"model-value": v.value ? e.modelValue && e.modelValue[0] ? `${o.value[0].format(e.dateFormat)} - ${o.value[1].format(e.dateFormat)}` : "" : e.modelValue === "Indefinite" ? "Indefinite" : e.modelValue ? o.value.format(e.dateFormat) : "",
|
191
|
+
icon: "calendar",
|
192
|
+
label: e.label,
|
193
|
+
hint: e.hint,
|
194
|
+
"is-required": e.isRequired,
|
195
|
+
disabled: e.disabled,
|
196
|
+
placeholder: e.placeholder
|
197
|
+
}, null, 8, ["model-value", "label", "hint", "is-required", "disabled", "placeholder"])
|
198
|
+
]),
|
199
|
+
e.errorMessage ? (f(), F("div", H, E(e.errorMessage), 1)) : k("", !0)
|
200
|
+
], 64)) : (f(), F("div", J, [
|
201
|
+
x(c(P), {
|
202
|
+
"error-message": y.value ? `Invalid Date. Try this format (${e.dateFormat})` : e.errorMessage,
|
203
|
+
hint: e.hint,
|
204
|
+
"is-required": e.isRequired,
|
205
|
+
label: e.label
|
206
|
+
}, {
|
207
|
+
default: p(() => [
|
208
|
+
i("div", {
|
209
|
+
class: M(["rounded justify-between border flex items-center gap-3 h-[36px] px-3", [
|
210
|
+
e.errorMessage || y.value ? "border-oc-error shadow-oc-error" : "border-oc-gray-200 shadow-oc-gray-200",
|
211
|
+
e.disabled ? "pointer-events-none bg-oc-bg-dark" : "bg-white",
|
212
|
+
{
|
213
|
+
"shadow-[0_0_0_2px]": m.value && !e.disabled
|
214
|
+
}
|
215
|
+
]]),
|
216
|
+
onClick: l[2] || (l[2] = (n) => m.value ? n.stopPropagation : null)
|
217
|
+
}, [
|
218
|
+
i("div", Q, [
|
219
|
+
x(c($), {
|
220
|
+
name: "calendar",
|
221
|
+
class: "text-oc-text-400"
|
222
|
+
}),
|
223
|
+
i("input", {
|
224
|
+
placeholder: "Start date",
|
225
|
+
value: o.value[0] ? o.value[0].format(e.dateFormat) : "",
|
226
|
+
class: "text-center bg-transparent outline-0 w-full placeholder:text-oc-text-300",
|
227
|
+
onInput: l[0] || (l[0] = (n) => I(n.target.value, 0)),
|
228
|
+
onKeydown: B(g, ["enter"]),
|
229
|
+
onBlur: g
|
230
|
+
}, null, 40, W)
|
231
|
+
]),
|
232
|
+
l[4] || (l[4] = i("span", { class: "text-oc-text-400" }, "To", -1)),
|
233
|
+
i("div", X, [
|
234
|
+
i("input", {
|
235
|
+
placeholder: "End date",
|
236
|
+
value: o.value[1] ? o.value[1].format(e.dateFormat) : "",
|
237
|
+
class: "text-center bg-transparent outline-0 w-full placeholder:text-oc-text-300",
|
238
|
+
onInput: l[1] || (l[1] = (n) => I(n.target.value, 1)),
|
239
|
+
onKeydown: B(g, ["enter"]),
|
240
|
+
onBlur: g
|
241
|
+
}, null, 40, Z),
|
242
|
+
x(c($), {
|
243
|
+
class: M([o.value.every(Boolean) ? "opacity-100" : "opacity-0", "text-oc-text-400"]),
|
244
|
+
width: "16",
|
245
|
+
height: "16",
|
246
|
+
name: "filled-x-circle",
|
247
|
+
onClick: U(D, ["stop"])
|
248
|
+
}, null, 8, ["class"])
|
249
|
+
])
|
250
|
+
], 2)
|
251
|
+
]),
|
252
|
+
_: 1
|
253
|
+
}, 8, ["error-message", "hint", "is-required", "label"])
|
254
|
+
]))
|
255
|
+
])
|
256
|
+
]),
|
257
|
+
_: 3
|
258
|
+
}, 8, ["modelValue", "is-disabled"]));
|
259
|
+
}
|
260
|
+
};
|
261
|
+
export {
|
262
|
+
fe as _
|
263
|
+
};
|