@winchsa/ui 0.1.31 → 0.1.33
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/package.json +1 -1
- package/dist/components/Breadcrumbs.d.vue.ts +0 -7
- package/dist/components/Breadcrumbs.vue +0 -46
- package/dist/components/Breadcrumbs.vue.d.ts +0 -7
- package/dist/components/CustomizerSection.d.vue.ts +0 -17
- package/dist/components/CustomizerSection.vue +0 -19
- package/dist/components/CustomizerSection.vue.d.ts +0 -17
- package/dist/components/DialogCloseBtn.d.vue.ts +0 -7
- package/dist/components/DialogCloseBtn.vue +0 -20
- package/dist/components/DialogCloseBtn.vue.d.ts +0 -7
- package/dist/components/Drawer.d.vue.ts +0 -28
- package/dist/components/Drawer.vue +0 -60
- package/dist/components/Drawer.vue.d.ts +0 -28
- package/dist/components/IconBtn.d.vue.ts +0 -18
- package/dist/components/IconBtn.vue +0 -24
- package/dist/components/IconBtn.vue.d.ts +0 -18
- package/dist/components/LoadingBar.d.vue.ts +0 -6
- package/dist/components/LoadingBar.vue +0 -31
- package/dist/components/LoadingBar.vue.d.ts +0 -6
- package/dist/components/LoadingDialog.d.vue.ts +0 -12
- package/dist/components/LoadingDialog.vue +0 -41
- package/dist/components/LoadingDialog.vue.d.ts +0 -12
- package/dist/components/LoadingItem.d.vue.ts +0 -25
- package/dist/components/LoadingItem.vue +0 -66
- package/dist/components/LoadingItem.vue.d.ts +0 -25
- package/dist/components/Modal.d.vue.ts +0 -50
- package/dist/components/Modal.vue +0 -155
- package/dist/components/Modal.vue.d.ts +0 -50
- package/dist/components/MoreBtn.d.vue.ts +0 -17
- package/dist/components/MoreBtn.vue +0 -28
- package/dist/components/MoreBtn.vue.d.ts +0 -17
- package/dist/components/ScrollToTop.d.vue.ts +0 -3
- package/dist/components/ScrollToTop.vue +0 -39
- package/dist/components/ScrollToTop.vue.d.ts +0 -3
- package/dist/components/SiteTitle.d.vue.ts +0 -3
- package/dist/components/SiteTitle.vue +0 -14
- package/dist/components/SiteTitle.vue.d.ts +0 -3
- package/dist/components/Toaster.d.vue.ts +0 -6
- package/dist/components/Toaster.vue +0 -19
- package/dist/components/Toaster.vue.d.ts +0 -6
- package/dist/components/cards/AppCard.d.vue.ts +0 -18
- package/dist/components/cards/AppCard.vue +0 -45
- package/dist/components/cards/AppCard.vue.d.ts +0 -18
- package/dist/components/cards/AppCardActions.d.vue.ts +0 -33
- package/dist/components/cards/AppCardActions.vue +0 -126
- package/dist/components/cards/AppCardActions.vue.d.ts +0 -33
- package/dist/components/cards/CardStatisticsHorizontal.d.vue.ts +0 -9
- package/dist/components/cards/CardStatisticsHorizontal.vue +0 -29
- package/dist/components/cards/CardStatisticsHorizontal.vue.d.ts +0 -9
- package/dist/components/cards/CheckboxesCard.d.vue.ts +0 -18
- package/dist/components/cards/CheckboxesCard.vue +0 -108
- package/dist/components/cards/CheckboxesCard.vue.d.ts +0 -18
- package/dist/components/cards/HeaderCard.d.vue.ts +0 -9
- package/dist/components/cards/HeaderCard.vue +0 -31
- package/dist/components/cards/HeaderCard.vue.d.ts +0 -9
- package/dist/components/cards/ImageCard.d.vue.ts +0 -33
- package/dist/components/cards/ImageCard.vue +0 -73
- package/dist/components/cards/ImageCard.vue.d.ts +0 -33
- package/dist/components/cards/InputCard.d.vue.ts +0 -21
- package/dist/components/cards/InputCard.vue +0 -60
- package/dist/components/cards/InputCard.vue.d.ts +0 -21
- package/dist/components/cards/StaticCard.d.vue.ts +0 -21
- package/dist/components/cards/StaticCard.vue +0 -37
- package/dist/components/cards/StaticCard.vue.d.ts +0 -21
- package/dist/components/forms/Accordion.d.vue.ts +0 -19
- package/dist/components/forms/Accordion.vue +0 -43
- package/dist/components/forms/Accordion.vue.d.ts +0 -19
- package/dist/components/forms/AppBarSearch.d.vue.ts +0 -43
- package/dist/components/forms/AppBarSearch.vue +0 -345
- package/dist/components/forms/AppBarSearch.vue.d.ts +0 -43
- package/dist/components/forms/AppCombobox.d.vue.ts +0 -13
- package/dist/components/forms/AppCombobox.vue +0 -67
- package/dist/components/forms/AppCombobox.vue.d.ts +0 -13
- package/dist/components/forms/AppDrawerHeaderSection.d.vue.ts +0 -20
- package/dist/components/forms/AppDrawerHeaderSection.vue +0 -21
- package/dist/components/forms/AppDrawerHeaderSection.vue.d.ts +0 -20
- package/dist/components/forms/AppLabel.d.vue.ts +0 -24
- package/dist/components/forms/AppLabel.vue +0 -47
- package/dist/components/forms/AppLabel.vue.d.ts +0 -24
- package/dist/components/forms/AppLink.d.vue.ts +0 -19
- package/dist/components/forms/AppLink.vue +0 -50
- package/dist/components/forms/AppLink.vue.d.ts +0 -19
- package/dist/components/forms/AppNumberField.d.vue.ts +0 -20
- package/dist/components/forms/AppNumberField.vue +0 -85
- package/dist/components/forms/AppNumberField.vue.d.ts +0 -20
- package/dist/components/forms/AppOtpInput.d.vue.ts +0 -13
- package/dist/components/forms/AppOtpInput.vue +0 -84
- package/dist/components/forms/AppOtpInput.vue.d.ts +0 -13
- package/dist/components/forms/AppSearchHeader.d.vue.ts +0 -8
- package/dist/components/forms/AppSearchHeader.vue +0 -72
- package/dist/components/forms/AppSearchHeader.vue.d.ts +0 -8
- package/dist/components/forms/AppSelect.d.vue.ts +0 -17
- package/dist/components/forms/AppSelect.vue +0 -98
- package/dist/components/forms/AppSelect.vue.d.ts +0 -17
- package/dist/components/forms/AppStepper.d.vue.ts +0 -21
- package/dist/components/forms/AppStepper.vue +0 -232
- package/dist/components/forms/AppStepper.vue.d.ts +0 -21
- package/dist/components/forms/AppSwitch.d.vue.ts +0 -16
- package/dist/components/forms/AppSwitch.vue +0 -59
- package/dist/components/forms/AppSwitch.vue.d.ts +0 -16
- package/dist/components/forms/AppTextField.d.vue.ts +0 -13
- package/dist/components/forms/AppTextField.vue +0 -66
- package/dist/components/forms/AppTextField.vue.d.ts +0 -13
- package/dist/components/forms/AppTextarea.d.vue.ts +0 -13
- package/dist/components/forms/AppTextarea.vue +0 -69
- package/dist/components/forms/AppTextarea.vue.d.ts +0 -13
- package/dist/components/forms/AttachmentCropperInput.d.vue.ts +0 -18
- package/dist/components/forms/AttachmentCropperInput.vue +0 -227
- package/dist/components/forms/AttachmentCropperInput.vue.d.ts +0 -18
- package/dist/components/forms/AttachmentInput.d.vue.ts +0 -16
- package/dist/components/forms/AttachmentInput.vue +0 -116
- package/dist/components/forms/AttachmentInput.vue.d.ts +0 -16
- package/dist/components/forms/AutocompleteInput.d.vue.ts +0 -84
- package/dist/components/forms/AutocompleteInput.vue +0 -760
- package/dist/components/forms/AutocompleteInput.vue.d.ts +0 -84
- package/dist/components/forms/BankSelect.d.vue.ts +0 -21
- package/dist/components/forms/BankSelect.vue +0 -43
- package/dist/components/forms/BankSelect.vue.d.ts +0 -21
- package/dist/components/forms/BaseButton.d.vue.ts +0 -20
- package/dist/components/forms/BaseButton.vue +0 -42
- package/dist/components/forms/BaseButton.vue.d.ts +0 -20
- package/dist/components/forms/CounterInput.d.vue.ts +0 -13
- package/dist/components/forms/CounterInput.vue +0 -71
- package/dist/components/forms/CounterInput.vue.d.ts +0 -13
- package/dist/components/forms/CustomCheckboxes.d.vue.ts +0 -25
- package/dist/components/forms/CustomCheckboxes.vue +0 -69
- package/dist/components/forms/CustomCheckboxes.vue.d.ts +0 -25
- package/dist/components/forms/CustomCheckboxesWithIcon.d.vue.ts +0 -25
- package/dist/components/forms/CustomCheckboxesWithIcon.vue +0 -80
- package/dist/components/forms/CustomCheckboxesWithIcon.vue.d.ts +0 -25
- package/dist/components/forms/CustomCheckboxesWithImage.d.vue.ts +0 -16
- package/dist/components/forms/CustomCheckboxesWithImage.vue +0 -67
- package/dist/components/forms/CustomCheckboxesWithImage.vue.d.ts +0 -16
- package/dist/components/forms/CustomRadios.d.vue.ts +0 -25
- package/dist/components/forms/CustomRadios.vue +0 -69
- package/dist/components/forms/CustomRadios.vue.d.ts +0 -25
- package/dist/components/forms/CustomRadiosWithIcon.d.vue.ts +0 -28
- package/dist/components/forms/CustomRadiosWithIcon.vue +0 -98
- package/dist/components/forms/CustomRadiosWithIcon.vue.d.ts +0 -28
- package/dist/components/forms/CustomRadiosWithImage.d.vue.ts +0 -35
- package/dist/components/forms/CustomRadiosWithImage.vue +0 -69
- package/dist/components/forms/CustomRadiosWithImage.vue.d.ts +0 -35
- package/dist/components/forms/DatePicker.d.vue.ts +0 -29
- package/dist/components/forms/DatePicker.vue +0 -400
- package/dist/components/forms/DatePicker.vue.d.ts +0 -29
- package/dist/components/forms/DatePickerRange.d.vue.ts +0 -24
- package/dist/components/forms/DatePickerRange.vue +0 -127
- package/dist/components/forms/DatePickerRange.vue.d.ts +0 -24
- package/dist/components/forms/DraggedUploadFile.d.vue.ts +0 -11
- package/dist/components/forms/DraggedUploadFile.vue +0 -120
- package/dist/components/forms/DraggedUploadFile.vue.d.ts +0 -11
- package/dist/components/forms/ImageCardInput.d.vue.ts +0 -35
- package/dist/components/forms/ImageCardInput.vue +0 -234
- package/dist/components/forms/ImageCardInput.vue.d.ts +0 -35
- package/dist/components/forms/InputValidationWrapper.d.vue.ts +0 -26
- package/dist/components/forms/InputValidationWrapper.vue +0 -24
- package/dist/components/forms/InputValidationWrapper.vue.d.ts +0 -26
- package/dist/components/forms/LicensePlateInput.d.vue.ts +0 -21
- package/dist/components/forms/LicensePlateInput.vue +0 -175
- package/dist/components/forms/LicensePlateInput.vue.d.ts +0 -21
- package/dist/components/forms/ManualDate.d.vue.ts +0 -20
- package/dist/components/forms/ManualDate.vue +0 -264
- package/dist/components/forms/ManualDate.vue.d.ts +0 -20
- package/dist/components/forms/MobileInput.d.vue.ts +0 -25
- package/dist/components/forms/MobileInput.vue +0 -118
- package/dist/components/forms/MobileInput.vue.d.ts +0 -25
- package/dist/components/forms/PasswordInput.d.vue.ts +0 -11
- package/dist/components/forms/PasswordInput.vue +0 -29
- package/dist/components/forms/PasswordInput.vue.d.ts +0 -11
- package/dist/components/forms/RangeInput.d.vue.ts +0 -10
- package/dist/components/forms/RangeInput.vue +0 -48
- package/dist/components/forms/RangeInput.vue.d.ts +0 -10
- package/dist/components/forms/Tabs.d.vue.ts +0 -23
- package/dist/components/forms/Tabs.vue +0 -35
- package/dist/components/forms/Tabs.vue.d.ts +0 -23
- package/dist/components/forms/TimePicker.d.vue.ts +0 -18
- package/dist/components/forms/TimePicker.vue +0 -370
- package/dist/components/forms/TimePicker.vue.d.ts +0 -18
- package/dist/components/table/DataTable.d.vue.ts +0 -70
- package/dist/components/table/DataTable.vue +0 -361
- package/dist/components/table/DataTable.vue.d.ts +0 -70
- package/dist/components/table/EditableDataTable.d.vue.ts +0 -21
- package/dist/components/table/EditableDataTable.vue +0 -330
- package/dist/components/table/EditableDataTable.vue.d.ts +0 -21
- package/dist/components/table/EditableDataTableRow.d.vue.ts +0 -20
- package/dist/components/table/EditableDataTableRow.vue +0 -253
- package/dist/components/table/EditableDataTableRow.vue.d.ts +0 -20
- package/dist/components/table/FilterGenerator.d.vue.ts +0 -13
- package/dist/components/table/FilterGenerator.vue +0 -231
- package/dist/components/table/FilterGenerator.vue.d.ts +0 -13
- package/dist/components/table/StaticTable.d.vue.ts +0 -34
- package/dist/components/table/StaticTable.vue +0 -152
- package/dist/components/table/StaticTable.vue.d.ts +0 -34
- package/dist/components/table/TablePagination.d.vue.ts +0 -15
- package/dist/components/table/TablePagination.vue +0 -73
- package/dist/components/table/TablePagination.vue.d.ts +0 -15
- package/dist/composables/useIsMobile.d.ts +0 -1
- package/dist/composables/useIsMobile.js +0 -10
- package/dist/composables/useIsMobile.mjs +0 -4
- package/dist/composables/useTableFilters.d.ts +0 -23
- package/dist/composables/useTableFilters.js +0 -197
- package/dist/composables/useTableFilters.mjs +0 -184
- package/dist/images/avatar.png +0 -0
- package/dist/images/sa.svg +0 -1
- package/dist/index.d.ts +0 -65
- package/dist/index.js +0 -454
- package/dist/index.mjs +0 -130
- package/dist/lang/ar.json +0 -54
- package/dist/lang/en.json +0 -54
- package/dist/styles/assets/scss/variables/_template.scss +0 -1
- package/dist/styles/assets/scss/variables/_vuetify.scss +0 -1
- package/dist/styles/core/base/_components.scss +0 -164
- package/dist/styles/core/base/_dark.scss +0 -16
- package/dist/styles/core/base/_default-layout-w-vertical-nav.scss +0 -106
- package/dist/styles/core/base/_default-layout.scss +0 -16
- package/dist/styles/core/base/_index.scss +0 -47
- package/dist/styles/core/base/_layouts.scss +0 -63
- package/dist/styles/core/base/_misc.scss +0 -20
- package/dist/styles/core/base/_mixins.scss +0 -84
- package/dist/styles/core/base/_route-transitions.scss +0 -70
- package/dist/styles/core/base/_utilities.scss +0 -418
- package/dist/styles/core/base/_utils.scss +0 -100
- package/dist/styles/core/base/_variables.scss +0 -190
- package/dist/styles/core/base/_vertical-nav.scss +0 -264
- package/dist/styles/core/base/libs/_perfect-scrollbar.scss +0 -35
- package/dist/styles/core/base/libs/vuetify/_index.scss +0 -1
- package/dist/styles/core/base/libs/vuetify/_overrides.scss +0 -380
- package/dist/styles/core/base/libs/vuetify/_variables.scss +0 -48
- package/dist/styles/core/base/placeholders/_default-layout-vertical-nav.scss +0 -48
- package/dist/styles/core/base/placeholders/_default-layout.scss +0 -3
- package/dist/styles/core/base/placeholders/_index.scss +0 -5
- package/dist/styles/core/base/placeholders/_misc.scss +0 -7
- package/dist/styles/core/base/placeholders/_nav.scss +0 -26
- package/dist/styles/core/base/placeholders/_vertical-nav.scss +0 -84
- package/dist/styles/core/base/skins/_bordered.scss +0 -60
- package/dist/styles/core/base/skins/_index.scss +0 -1
- package/dist/styles/core/template/_components.scss +0 -1035
- package/dist/styles/core/template/_default-layout-w-vertical-nav.scss +0 -20
- package/dist/styles/core/template/_utilities.scss +0 -20
- package/dist/styles/core/template/_variables.scss +0 -67
- package/dist/styles/core/template/_vertical-nav.scss +0 -41
- package/dist/styles/core/template/index.css +0 -18779
- package/dist/styles/core/template/index.scss +0 -15
- package/dist/styles/core/template/libs/vuetify/_variables.scss +0 -464
- package/dist/styles/core/template/libs/vuetify/index.css +0 -739
- package/dist/styles/core/template/libs/vuetify/index.scss +0 -1
- package/dist/styles/core/template/pages/misc.css +0 -16
- package/dist/styles/core/template/pages/misc.scss +0 -20
- package/dist/styles/core/template/placeholders/_default-layout-vertical-nav.scss +0 -9
- package/dist/styles/core/template/placeholders/_index.scss +0 -3
- package/dist/styles/core/template/placeholders/_nav.scss +0 -15
- package/dist/styles/core/template/placeholders/_vertical-nav.scss +0 -18
- package/dist/styles/core/template/skins/_bordered.scss +0 -36
- package/dist/styles/core/template/skins/_index.scss +0 -1
- package/dist/styles/layouts/_classes.scss +0 -3
- package/dist/styles/layouts/_dashboard-layout.scss +0 -43
- package/dist/styles/layouts/_global.scss +0 -10
- package/dist/styles/layouts/_mixins.scss +0 -28
- package/dist/styles/layouts/_placeholders.scss +0 -53
- package/dist/styles/layouts/_rtl.scss +0 -7
- package/dist/styles/layouts/_variables.scss +0 -22
- package/dist/styles/layouts/index.css +0 -14
- package/dist/styles/layouts/index.scss +0 -2
- package/dist/types.d.ts +0 -218
- package/dist/utils/apiUrl.d.ts +0 -1
- package/dist/utils/apiUrl.js +0 -15
- package/dist/utils/apiUrl.mjs +0 -8
- package/dist/utils/client.d.ts +0 -9
- package/dist/utils/client.js +0 -53
- package/dist/utils/client.mjs +0 -39
- package/dist/utils/files.d.ts +0 -2
- package/dist/utils/files.js +0 -35
- package/dist/utils/files.mjs +0 -22
- package/dist/utils/formValidation.d.ts +0 -7
- package/dist/utils/formValidation.js +0 -20
- package/dist/utils/formValidation.mjs +0 -13
- package/dist/utils/formatters.d.ts +0 -12
- package/dist/utils/formatters.js +0 -84
- package/dist/utils/formatters.mjs +0 -56
- package/dist/utils/hijriDate.d.ts +0 -58
- package/dist/utils/hijriDate.js +0 -168
- package/dist/utils/hijriDate.mjs +0 -1951
- package/dist/utils/i18n.d.ts +0 -8
- package/dist/utils/i18n.js +0 -36
- package/dist/utils/i18n.mjs +0 -27
- package/dist/utils/index.d.ts +0 -10
- package/dist/utils/index.js +0 -115
- package/dist/utils/index.mjs +0 -10
- package/dist/utils/queryParams.d.ts +0 -4
- package/dist/utils/queryParams.js +0 -26
- package/dist/utils/queryParams.mjs +0 -18
- package/dist/utils/ruleValidator.d.ts +0 -41
- package/dist/utils/ruleValidator.js +0 -210
- package/dist/utils/ruleValidator.mjs +0 -195
- package/dist/utils/toaster.d.ts +0 -12
- package/dist/utils/toaster.js +0 -68
- package/dist/utils/toaster.mjs +0 -58
- package/dist/utils/utils.d.ts +0 -9
- package/dist/utils/utils.js +0 -84
- package/dist/utils/utils.mjs +0 -67
|
@@ -1,400 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { DatePicker as VCalendarDatePicker } from "v-calendar";
|
|
3
|
-
import "v-calendar/style.css";
|
|
4
|
-
import { useTheme } from "vuetify";
|
|
5
|
-
import { computed, onBeforeMount, onMounted, onBeforeUnmount, ref, watch, nextTick, useAttrs } from "vue";
|
|
6
|
-
import { useI18n } from "vue-i18n";
|
|
7
|
-
import { VTextField, VLabel } from "vuetify/components";
|
|
8
|
-
import { extractDate, formatDateWithoutTime } from "../../utils/formatters";
|
|
9
|
-
import { generateUniqueId } from "../../utils/utils";
|
|
10
|
-
const { t, locale } = useI18n();
|
|
11
|
-
const { current } = useTheme();
|
|
12
|
-
const props = defineProps({
|
|
13
|
-
modelValue: { type: [String, Date], required: false, default: "" },
|
|
14
|
-
format: { type: String, required: false, default: "DD-MM-YYYY" },
|
|
15
|
-
displayFormat: { type: String, required: false },
|
|
16
|
-
label: { type: String, required: false },
|
|
17
|
-
forcedLabel: { type: String, required: false },
|
|
18
|
-
minDate: { type: [String, Date, null], required: false },
|
|
19
|
-
maxDate: { type: [String, Date, null], required: false },
|
|
20
|
-
placeholder: { type: String, required: false },
|
|
21
|
-
disabled: { type: Boolean, required: false, skipCheck: true },
|
|
22
|
-
errorMessages: { type: [String, Array], required: false, default: "" },
|
|
23
|
-
clearable: { type: Boolean, required: false },
|
|
24
|
-
clearIcon: { type: String, required: false },
|
|
25
|
-
required: { type: Boolean, required: false },
|
|
26
|
-
rules: { type: Array, required: false },
|
|
27
|
-
showToday: { type: Boolean, required: false, default: true },
|
|
28
|
-
hideErrorMessage: { type: Boolean, required: false, default: false },
|
|
29
|
-
inTable: { type: Boolean, required: false }
|
|
30
|
-
});
|
|
31
|
-
const emit = defineEmits(["update:modelValue", "resetSelectedDate"]);
|
|
32
|
-
const popover = ref({
|
|
33
|
-
visibility: "focus",
|
|
34
|
-
placement: "top"
|
|
35
|
-
});
|
|
36
|
-
const inputValue = ref("");
|
|
37
|
-
const isFocus = ref(false);
|
|
38
|
-
const value = ref();
|
|
39
|
-
const guid = generateUniqueId();
|
|
40
|
-
const elementId = computed(() => {
|
|
41
|
-
const attrs = useAttrs();
|
|
42
|
-
const _elementIdToken = attrs.id || attrs.label;
|
|
43
|
-
return _elementIdToken ? `AppTextField-${_elementIdToken}-${guid}` : `datepicker-${_elementIdToken}-${guid}`;
|
|
44
|
-
});
|
|
45
|
-
const LangLabel = computed(() => props.label ? t(props.label) : "");
|
|
46
|
-
const placeholder = computed(() => {
|
|
47
|
-
if (props.placeholder) {
|
|
48
|
-
return props.placeholder;
|
|
49
|
-
}
|
|
50
|
-
if (LangLabel.value) {
|
|
51
|
-
return t("inputs.placeholder_select", {
|
|
52
|
-
name: LangLabel.value
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
return "";
|
|
56
|
-
});
|
|
57
|
-
const localeConfig = computed(() => ({
|
|
58
|
-
id: locale.value,
|
|
59
|
-
firstDayOfWeek: 2,
|
|
60
|
-
masks: { weekdays: "WWW" }
|
|
61
|
-
}));
|
|
62
|
-
const isValueToday = computed(() => formatDateWithoutTime(/* @__PURE__ */ new Date()) === formatDateWithoutTime(value.value));
|
|
63
|
-
const calendarAttributes = computed(() => props.showToday ? [{
|
|
64
|
-
key: "today",
|
|
65
|
-
highlight: {
|
|
66
|
-
fillMode: isValueToday.value ? "solid" : "outline",
|
|
67
|
-
contentStyle: { pointerEvents: isValueToday.value ? "none" : "auto", fontWeight: "600" }
|
|
68
|
-
},
|
|
69
|
-
dates: /* @__PURE__ */ new Date()
|
|
70
|
-
}] : []);
|
|
71
|
-
const selectAttribute = computed(() => {
|
|
72
|
-
return { highlight: { contentStyle: { pointerEvents: "none", fontWeight: "600" } } };
|
|
73
|
-
});
|
|
74
|
-
const resetSelectedDate = () => {
|
|
75
|
-
value.value = "";
|
|
76
|
-
inputValue.value = "";
|
|
77
|
-
emit("resetSelectedDate");
|
|
78
|
-
};
|
|
79
|
-
const formatDate = ($event) => {
|
|
80
|
-
const input = document.getElementById(elementId.value);
|
|
81
|
-
if (!$event) {
|
|
82
|
-
inputValue.value = "";
|
|
83
|
-
input?.focus();
|
|
84
|
-
resetSelectedDate();
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
let cleaned = $event.replace(/[^0-9\\/]/g, "");
|
|
88
|
-
if (cleaned.length >= 2 && cleaned[2] !== "/") {
|
|
89
|
-
cleaned = `${cleaned.slice(0, 2)}/${cleaned.slice(2)}`;
|
|
90
|
-
}
|
|
91
|
-
if (cleaned.length >= 5 && cleaned[5] !== "/") {
|
|
92
|
-
cleaned = `${cleaned.slice(0, 5)}/${cleaned.slice(5)}`;
|
|
93
|
-
}
|
|
94
|
-
const parts = cleaned.split("/");
|
|
95
|
-
if (parts[0] && parseInt(parts[0], 10) > 31) {
|
|
96
|
-
parts[0] = "31";
|
|
97
|
-
}
|
|
98
|
-
if (parts[1] && parseInt(parts[1], 10) > 12) {
|
|
99
|
-
parts[1] = "12";
|
|
100
|
-
}
|
|
101
|
-
if (parts[2] && Number((/* @__PURE__ */ new Date()).getFullYear()) < Number(parts[2])) {
|
|
102
|
-
parts[2] = `${(/* @__PURE__ */ new Date()).getFullYear()}`;
|
|
103
|
-
}
|
|
104
|
-
if (parts[2] && parts[2].length > 4) {
|
|
105
|
-
parts[2] = "";
|
|
106
|
-
}
|
|
107
|
-
inputValue.value = parts.join("/");
|
|
108
|
-
if (parts[2] && parts[2].length > 3 && parts[1] && parts[0]) {
|
|
109
|
-
value.value = new Date(Number(parts[2]), Number(parts[1]) - 1, Number(parts[0]));
|
|
110
|
-
nextTick(() => {
|
|
111
|
-
isFocus.value = true;
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
input.value = parts.join("/");
|
|
115
|
-
input?.focus();
|
|
116
|
-
};
|
|
117
|
-
const customPosition = () => {
|
|
118
|
-
const datepickerInputElement = document.querySelector(`#${elementId.value}`);
|
|
119
|
-
const rect = datepickerInputElement?.getBoundingClientRect();
|
|
120
|
-
return {
|
|
121
|
-
top: (rect?.top || 0) + window.pageYOffset + (rect?.height || 100) / 2 + 46 / 2,
|
|
122
|
-
left: (rect?.left || 0) - (props.inTable ? rect?.width : 0)
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
const closeMenu = (event) => {
|
|
126
|
-
const vCalendarMenu = document.getElementById(`vc-calendar-container-${elementId.value}`);
|
|
127
|
-
const vCalendarInput = document.getElementById(`${elementId.value}`);
|
|
128
|
-
if (!vCalendarMenu?.contains(event.target) && !vCalendarInput?.contains(event.target)) {
|
|
129
|
-
isFocus.value = false;
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
const getFullTextDate = (date, format, hasTime = true) => {
|
|
133
|
-
if (date) {
|
|
134
|
-
const extractedDateParts = extractDate(date, format, hasTime);
|
|
135
|
-
const generatedStandardDate = extractedDateParts ? new Date(+extractedDateParts.year, +extractedDateParts.month - 1, +extractedDateParts.day) : "";
|
|
136
|
-
return generatedStandardDate;
|
|
137
|
-
} else {
|
|
138
|
-
return "";
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
const setCalendarValue = (dateValue) => {
|
|
142
|
-
value.value = dateValue;
|
|
143
|
-
inputValue.value = dateValue ? formatDateWithoutTime(dateValue, props.displayFormat) : "";
|
|
144
|
-
isFocus.value = false;
|
|
145
|
-
emit("update:modelValue", value.value ? formatDateWithoutTime(value.value, props.format) : "");
|
|
146
|
-
};
|
|
147
|
-
watch(() => props.modelValue, (val) => {
|
|
148
|
-
if (val) {
|
|
149
|
-
const date = getFullTextDate(val, props.format);
|
|
150
|
-
inputValue.value = formatDateWithoutTime(date, props.displayFormat)?.includes("NaN") ? "" : date ? formatDateWithoutTime(date, props.displayFormat) : "";
|
|
151
|
-
value.value = date;
|
|
152
|
-
} else {
|
|
153
|
-
inputValue.value = "";
|
|
154
|
-
resetSelectedDate();
|
|
155
|
-
}
|
|
156
|
-
}, {
|
|
157
|
-
immediate: true
|
|
158
|
-
});
|
|
159
|
-
onBeforeMount(() => {
|
|
160
|
-
if (props.modelValue) {
|
|
161
|
-
const date = getFullTextDate(props.modelValue, props.format);
|
|
162
|
-
inputValue.value = formatDateWithoutTime(date, props.displayFormat)?.includes("NaN") ? "" : date ? formatDateWithoutTime(date, props.displayFormat) : "";
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
onMounted(() => {
|
|
166
|
-
window.addEventListener("mouseup", closeMenu);
|
|
167
|
-
const observer = new MutationObserver((mutations) => {
|
|
168
|
-
mutations.forEach((mutation) => {
|
|
169
|
-
if (mutation && mutation.addedNodes) {
|
|
170
|
-
mutation.addedNodes.forEach((elm) => {
|
|
171
|
-
if (elm && typeof elm?.className === "string" && elm?.className?.includes("vc-nav-popover-container")) {
|
|
172
|
-
elm.addEventListener("click", (e) => {
|
|
173
|
-
if (e?.target?.classList?.contains("is-active")) {
|
|
174
|
-
document.body.click();
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
});
|
|
182
|
-
observer.observe(document.body, {
|
|
183
|
-
childList: true,
|
|
184
|
-
subtree: true
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
onBeforeUnmount(() => {
|
|
188
|
-
window.removeEventListener("mouseup", closeMenu);
|
|
189
|
-
});
|
|
190
|
-
</script>
|
|
191
|
-
|
|
192
|
-
<template>
|
|
193
|
-
<div class="d-flex flex-column w-100">
|
|
194
|
-
<VLabel
|
|
195
|
-
v-if="forcedLabel || label"
|
|
196
|
-
class="text-body-2 text-high-emphasis mb-2"
|
|
197
|
-
:text="forcedLabel ? forcedLabel : LangLabel"
|
|
198
|
-
/>
|
|
199
|
-
<div dir="ltr" class="h-100">
|
|
200
|
-
<div :dir="locale === 'en' ? 'ltr' : 'rtl'" class="d-flex justify-center align-center gap-2 h-100">
|
|
201
|
-
<VTextField
|
|
202
|
-
v-bind="{
|
|
203
|
-
...$attrs
|
|
204
|
-
}"
|
|
205
|
-
:id="elementId"
|
|
206
|
-
:model-value="inputValue"
|
|
207
|
-
:placeholder="placeholder"
|
|
208
|
-
:append-inner-icon="$attrs['append-inner-icon'] || 'tabler-calendar-event'"
|
|
209
|
-
:disabled="disabled"
|
|
210
|
-
:clearable="clearable"
|
|
211
|
-
:clear-icon="clearIcon"
|
|
212
|
-
:rules="rules"
|
|
213
|
-
:hide-details="hideErrorMessage"
|
|
214
|
-
:error-messages="errorMessages"
|
|
215
|
-
style="padding-block: 0.125rem;"
|
|
216
|
-
autocomplete="off"
|
|
217
|
-
@update:model-value="formatDate"
|
|
218
|
-
@click:clear="resetSelectedDate"
|
|
219
|
-
@focus="isFocus = true"
|
|
220
|
-
@click="isFocus = true"
|
|
221
|
-
>
|
|
222
|
-
<template #details>
|
|
223
|
-
<span class="app-h-1" />
|
|
224
|
-
</template>
|
|
225
|
-
</VTextField>
|
|
226
|
-
</div>
|
|
227
|
-
<Teleport to="body">
|
|
228
|
-
<div
|
|
229
|
-
v-show="isFocus"
|
|
230
|
-
:id="`vc-calendar-container-${elementId}`"
|
|
231
|
-
class="position-absolute"
|
|
232
|
-
style="z-index: 1005;"
|
|
233
|
-
dir="ltr"
|
|
234
|
-
:style="{
|
|
235
|
-
left: `${customPosition().left - 20}px`,
|
|
236
|
-
top: `${customPosition().top + 10}px`
|
|
237
|
-
}"
|
|
238
|
-
>
|
|
239
|
-
<div class="position-relative">
|
|
240
|
-
<div class="vc-custom-arrow" />
|
|
241
|
-
<VCalendarDatePicker
|
|
242
|
-
:model-value="value"
|
|
243
|
-
dir="ltr"
|
|
244
|
-
class="vc-calender-custom"
|
|
245
|
-
:popover="popover"
|
|
246
|
-
:locale="localeConfig"
|
|
247
|
-
:attributes="calendarAttributes"
|
|
248
|
-
:select-attribute="selectAttribute"
|
|
249
|
-
:min-date="minDate instanceof Date ? minDate : typeof minDate === 'string' ? getFullTextDate(minDate, props.format, false) : null"
|
|
250
|
-
:max-date="maxDate instanceof Date ? maxDate : typeof maxDate === 'string' ? getFullTextDate(maxDate, props.format, false) : null"
|
|
251
|
-
:is-required="required"
|
|
252
|
-
:is-dark="current.dark"
|
|
253
|
-
inline
|
|
254
|
-
@update:model-value="setCalendarValue"
|
|
255
|
-
/>
|
|
256
|
-
</div>
|
|
257
|
-
</div>
|
|
258
|
-
</Teleport>
|
|
259
|
-
</div>
|
|
260
|
-
</div>
|
|
261
|
-
</template>
|
|
262
|
-
|
|
263
|
-
<style scoped>
|
|
264
|
-
:deep(.v-input__control) .v-field__input {
|
|
265
|
-
padding-inline-start: 14px !important;
|
|
266
|
-
}
|
|
267
|
-
:deep(.v-input__control) .v-field__input input {
|
|
268
|
-
padding-inline-start: 0px !important;
|
|
269
|
-
font-size: 13px !important;
|
|
270
|
-
}
|
|
271
|
-
:deep(.v-input__control) .v-field .v-field__clearable {
|
|
272
|
-
inset-inline-start: -4px !important;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
.app-border-primary {
|
|
276
|
-
border-color: rgb(var(--v-theme-primary)) !important;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
:deep(.vc-blue) {
|
|
280
|
-
--vc-accent-50: #fdf7e6;
|
|
281
|
-
--vc-accent-100: #fcefbf;
|
|
282
|
-
--vc-accent-200: #fbe791;
|
|
283
|
-
--vc-accent-300: #fadd62;
|
|
284
|
-
--vc-accent-400: #fdc930;
|
|
285
|
-
--vc-accent-500: #fdc930;
|
|
286
|
-
--vc-accent-600: #fdc930;
|
|
287
|
-
--vc-accent-700: #fdc930;
|
|
288
|
-
--vc-accent-800: #fdc930;
|
|
289
|
-
--vc-accent-900: #fdc930;
|
|
290
|
-
color: #000 !important;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
.vc-calender-custom {
|
|
294
|
-
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
:deep(.vc-nav-item.is-active) {
|
|
298
|
-
color: #000 !important;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
:deep(.vc-monthly) .is-not-in-month * {
|
|
302
|
-
color: rgb(var(--v-theme-gray-600));
|
|
303
|
-
opacity: 1;
|
|
304
|
-
pointer-events: all !important;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
:deep(.vc-light), :deep(.vc-dark) {
|
|
308
|
-
--vc-focus-ring: none !important;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
:deep(.vc-title) span {
|
|
312
|
-
font-weight: 500 !important;
|
|
313
|
-
font-size: 16px !important;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
:deep(.vc-nav-title) {
|
|
317
|
-
font-weight: 500 !important;
|
|
318
|
-
font-size: 14px !important;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
:deep(.vc-weekday), :deep(.vc-nav-item) {
|
|
322
|
-
font-weight: 500 !important;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
:deep(.vc-disabled) {
|
|
326
|
-
color: rgb(var(--v-theme-gray-600)) !important;
|
|
327
|
-
opacity: 0.5 !important;
|
|
328
|
-
cursor: not-allowed;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
:deep(.vc-popover-content) {
|
|
332
|
-
min-width: 200px !important;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
:deep(.vc-nav-item) {
|
|
336
|
-
width: auto !important;
|
|
337
|
-
padding-left: 2px !important;
|
|
338
|
-
padding-right: 2px !important;
|
|
339
|
-
display: flex;
|
|
340
|
-
align-items: center;
|
|
341
|
-
justify-content: center;
|
|
342
|
-
line-height: unset;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
:deep(.vc-nav-item.is-current) {
|
|
346
|
-
background-color: transparent !important;
|
|
347
|
-
color: rgb(var(--v-theme-on-surface));
|
|
348
|
-
font-weight: 400 !important;
|
|
349
|
-
border: 2px solid rgb(var(--v-theme-primary)) !important;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
:deep(.vc-arrow), :deep(.vc-weekday) {
|
|
353
|
-
color: rgb(var(--v-theme-on-surface));
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
:deep(.vc-bordered) {
|
|
357
|
-
border-color: rgba(var(--v-theme-gray-300));
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
:deep(.vc-custom-arrow) {
|
|
361
|
-
width: 15px;
|
|
362
|
-
height: 15px;
|
|
363
|
-
background: rgba(var(--v-theme-surface));
|
|
364
|
-
position: absolute;
|
|
365
|
-
z-index: 10;
|
|
366
|
-
border-top: 1px solid rgba(var(--v-theme-gray-300));
|
|
367
|
-
border-left: 1px solid rgba(var(--v-theme-gray-300));
|
|
368
|
-
left: 50%;
|
|
369
|
-
top: -7px;
|
|
370
|
-
transform: translateX(-50%) rotate(45deg);
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
:deep(.vc-popover-content-wrapper[data-popper-placement]) {
|
|
374
|
-
width: 100% !important;
|
|
375
|
-
height: 100% !important;
|
|
376
|
-
top: 0 !important;
|
|
377
|
-
transform: translate(0) !important;
|
|
378
|
-
}
|
|
379
|
-
:deep(.vc-popover-content-wrapper[data-popper-placement]) .vc-nav-container {
|
|
380
|
-
margin-top: 2px;
|
|
381
|
-
}
|
|
382
|
-
:deep(.vc-popover-content-wrapper[data-popper-placement]) .vc-popover-content {
|
|
383
|
-
background-color: rgba(var(--v-theme-surface));
|
|
384
|
-
margin-top: 0px !important;
|
|
385
|
-
width: 100% !important;
|
|
386
|
-
height: 100% !important;
|
|
387
|
-
}
|
|
388
|
-
:deep(.vc-popover-content-wrapper[data-popper-placement]) .vc-popover-content .vc-nav-items {
|
|
389
|
-
padding: 15px;
|
|
390
|
-
gap: 20px;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
:deep(.vc-custom-arrow) {
|
|
394
|
-
display: none !important;
|
|
395
|
-
}
|
|
396
|
-
</style>
|
|
397
|
-
|
|
398
|
-
<style>
|
|
399
|
-
.vc-calender-custom{box-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px 0 rgba(0,0,0,.06)!important}
|
|
400
|
-
</style>
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import 'v-calendar/style.css';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
modelValue?: string | Date;
|
|
4
|
-
format?: string;
|
|
5
|
-
displayFormat?: string;
|
|
6
|
-
label?: string;
|
|
7
|
-
forcedLabel?: string;
|
|
8
|
-
minDate?: string | Date | null;
|
|
9
|
-
maxDate?: string | Date | null;
|
|
10
|
-
placeholder?: string;
|
|
11
|
-
disabled?: boolean | undefined;
|
|
12
|
-
errorMessages?: string | string[];
|
|
13
|
-
clearable?: boolean;
|
|
14
|
-
clearIcon?: string;
|
|
15
|
-
required?: boolean;
|
|
16
|
-
rules?: ((value: unknown) => typeof value | string)[];
|
|
17
|
-
showToday?: boolean;
|
|
18
|
-
hideErrorMessage?: boolean;
|
|
19
|
-
inTable?: boolean;
|
|
20
|
-
};
|
|
21
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
22
|
-
"update:modelValue": (value: string | Date) => any;
|
|
23
|
-
resetSelectedDate: () => any;
|
|
24
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
25
|
-
"onUpdate:modelValue"?: ((value: string | Date) => any) | undefined;
|
|
26
|
-
onResetSelectedDate?: (() => any) | undefined;
|
|
27
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
|
-
declare const _default: typeof __VLS_export;
|
|
29
|
-
export default _default;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
modelValue: [Date | string, Date | string] | [] | undefined;
|
|
3
|
-
waitTo?: boolean;
|
|
4
|
-
label?: string;
|
|
5
|
-
rules?: ((value: unknown) => typeof value | string)[];
|
|
6
|
-
fromErrorMessages?: string;
|
|
7
|
-
toErrorMessages?: string;
|
|
8
|
-
fromLabel?: string;
|
|
9
|
-
toLabel?: string;
|
|
10
|
-
fromPlaceholder?: string;
|
|
11
|
-
toPlaceholder?: string;
|
|
12
|
-
clearable?: boolean;
|
|
13
|
-
fromMinDate?: Date | null;
|
|
14
|
-
toMinDate?: Date | null;
|
|
15
|
-
fromMaxDate?: Date | null;
|
|
16
|
-
toMaxDate?: Date | null;
|
|
17
|
-
};
|
|
18
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
19
|
-
"update:modelValue": (value: [string | Date | null, string | Date | null] | null) => any;
|
|
20
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
|
-
"onUpdate:modelValue"?: ((value: [string | Date | null, string | Date | null] | null) => any) | undefined;
|
|
22
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
-
declare const _default: typeof __VLS_export;
|
|
24
|
-
export default _default;
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { computed, ref, watch } from "vue";
|
|
3
|
-
import { useI18n } from "vue-i18n";
|
|
4
|
-
import { VCol } from "vuetify/components";
|
|
5
|
-
import { useIsMobile } from "../../composables/useIsMobile";
|
|
6
|
-
import DatePicker from "./DatePicker.vue";
|
|
7
|
-
const { t } = useI18n();
|
|
8
|
-
const props = defineProps({
|
|
9
|
-
modelValue: { type: null, required: true },
|
|
10
|
-
waitTo: { type: Boolean, required: false },
|
|
11
|
-
label: { type: String, required: false },
|
|
12
|
-
rules: { type: Array, required: false },
|
|
13
|
-
fromErrorMessages: { type: String, required: false },
|
|
14
|
-
toErrorMessages: { type: String, required: false },
|
|
15
|
-
fromLabel: { type: String, required: false },
|
|
16
|
-
toLabel: { type: String, required: false },
|
|
17
|
-
fromPlaceholder: { type: String, required: false },
|
|
18
|
-
toPlaceholder: { type: String, required: false },
|
|
19
|
-
clearable: { type: Boolean, required: false },
|
|
20
|
-
fromMinDate: { type: [Date, null], required: false },
|
|
21
|
-
toMinDate: { type: [Date, null], required: false },
|
|
22
|
-
fromMaxDate: { type: [Date, null], required: false },
|
|
23
|
-
toMaxDate: { type: [Date, null], required: false }
|
|
24
|
-
});
|
|
25
|
-
const emits = defineEmits(["update:modelValue"]);
|
|
26
|
-
const from = ref(void 0);
|
|
27
|
-
const to = ref(void 0);
|
|
28
|
-
watch(
|
|
29
|
-
() => props.modelValue,
|
|
30
|
-
(value) => {
|
|
31
|
-
if (!value || value.length === 0) {
|
|
32
|
-
from.value = void 0;
|
|
33
|
-
to.value = void 0;
|
|
34
|
-
}
|
|
35
|
-
if (!Array.isArray(value)) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
if (value?.[0] !== from.value && value?.[0] != "" && value?.[0] !== void 0 && value[0] !== null) {
|
|
39
|
-
from.value = value?.[0];
|
|
40
|
-
}
|
|
41
|
-
if (value?.[1] !== to.value && value?.[1] != "" && value?.[1] !== void 0 && value[1] !== null) {
|
|
42
|
-
to.value = value?.[1];
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
{ immediate: true }
|
|
46
|
-
);
|
|
47
|
-
const onInput = () => {
|
|
48
|
-
const newValue = [
|
|
49
|
-
from.value || null,
|
|
50
|
-
to.value || null
|
|
51
|
-
];
|
|
52
|
-
emits("update:modelValue", newValue);
|
|
53
|
-
};
|
|
54
|
-
const disableFrom = computed(() => props.waitTo ? !from.value : false);
|
|
55
|
-
const maxToDate = computed(() => props.toMaxDate || /* @__PURE__ */ new Date());
|
|
56
|
-
const maxFromDate = computed(() => props.fromMaxDate || to.value || /* @__PURE__ */ new Date());
|
|
57
|
-
const resetSelectedDate = (type) => {
|
|
58
|
-
if (type === "to") {
|
|
59
|
-
to.value = void 0;
|
|
60
|
-
}
|
|
61
|
-
if (type === "from") {
|
|
62
|
-
from.value = void 0;
|
|
63
|
-
}
|
|
64
|
-
if (!from.value && !to.value) {
|
|
65
|
-
emits("update:modelValue", null);
|
|
66
|
-
} else {
|
|
67
|
-
onInput();
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
const label = (type) => {
|
|
71
|
-
const baseLabel = t(props.label || "date");
|
|
72
|
-
if (type === "from") {
|
|
73
|
-
return props.fromLabel || t("inputs.from", { name: baseLabel });
|
|
74
|
-
}
|
|
75
|
-
if (type === "to") {
|
|
76
|
-
return props.toLabel || t("inputs.to", { name: baseLabel });
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
</script>
|
|
80
|
-
|
|
81
|
-
<template>
|
|
82
|
-
<VCol cols="12" sm="3" class="py-0">
|
|
83
|
-
<DatePicker
|
|
84
|
-
id="from"
|
|
85
|
-
v-model="from"
|
|
86
|
-
v-bind="{
|
|
87
|
-
...$attrs,
|
|
88
|
-
}"
|
|
89
|
-
show-today
|
|
90
|
-
:rules="rules"
|
|
91
|
-
:clearable="clearable"
|
|
92
|
-
:error-messages="fromErrorMessages"
|
|
93
|
-
:min-date="fromMinDate"
|
|
94
|
-
:max-date="maxFromDate"
|
|
95
|
-
display-format="DD/MM/YYYY"
|
|
96
|
-
:label="props.label"
|
|
97
|
-
:forced-label="label('from')"
|
|
98
|
-
:placeholder="props.fromPlaceholder || t('inputs.from')"
|
|
99
|
-
:hide-error-message="useIsMobile().value"
|
|
100
|
-
@update:model-value="onInput"
|
|
101
|
-
@reset-selected-date="resetSelectedDate('from')"
|
|
102
|
-
/>
|
|
103
|
-
</VCol>
|
|
104
|
-
<VCol cols="12" sm="3" class="py-0">
|
|
105
|
-
<DatePicker
|
|
106
|
-
id="to"
|
|
107
|
-
v-model="to"
|
|
108
|
-
v-bind="{
|
|
109
|
-
...$attrs,
|
|
110
|
-
}"
|
|
111
|
-
show-today
|
|
112
|
-
:rules="rules"
|
|
113
|
-
:clearable="clearable"
|
|
114
|
-
:error-messages="toErrorMessages"
|
|
115
|
-
:min-date="from || toMinDate"
|
|
116
|
-
:max-date="maxToDate"
|
|
117
|
-
:disabled="disableFrom"
|
|
118
|
-
display-format="DD/MM/YYYY"
|
|
119
|
-
:label="props.label"
|
|
120
|
-
:forced-label="label('to')"
|
|
121
|
-
:placeholder="t('inputs.to')"
|
|
122
|
-
:hide-error-message="useIsMobile().value"
|
|
123
|
-
@update:model-value="onInput"
|
|
124
|
-
@reset-selected-date="resetSelectedDate('to')"
|
|
125
|
-
/>
|
|
126
|
-
</VCol>
|
|
127
|
-
</template>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
modelValue: [Date | string, Date | string] | [] | undefined;
|
|
3
|
-
waitTo?: boolean;
|
|
4
|
-
label?: string;
|
|
5
|
-
rules?: ((value: unknown) => typeof value | string)[];
|
|
6
|
-
fromErrorMessages?: string;
|
|
7
|
-
toErrorMessages?: string;
|
|
8
|
-
fromLabel?: string;
|
|
9
|
-
toLabel?: string;
|
|
10
|
-
fromPlaceholder?: string;
|
|
11
|
-
toPlaceholder?: string;
|
|
12
|
-
clearable?: boolean;
|
|
13
|
-
fromMinDate?: Date | null;
|
|
14
|
-
toMinDate?: Date | null;
|
|
15
|
-
fromMaxDate?: Date | null;
|
|
16
|
-
toMaxDate?: Date | null;
|
|
17
|
-
};
|
|
18
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
19
|
-
"update:modelValue": (value: [string | Date | null, string | Date | null] | null) => any;
|
|
20
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
|
-
"onUpdate:modelValue"?: ((value: [string | Date | null, string | Date | null] | null) => any) | undefined;
|
|
22
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
-
declare const _default: typeof __VLS_export;
|
|
24
|
-
export default _default;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
modelValue: FileList[];
|
|
3
|
-
loading?: boolean;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
6
|
-
"update:model-value": (value: FileList[]) => any;
|
|
7
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
8
|
-
"onUpdate:model-value"?: ((value: FileList[]) => any) | undefined;
|
|
9
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
-
declare const _default: typeof __VLS_export;
|
|
11
|
-
export default _default;
|