@winchsa/ui 0.1.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/README.md +166 -0
- package/dist/components/Breadcrumbs.vue +46 -0
- package/dist/components/Breadcrumbs.vue.d.ts +6 -0
- package/dist/components/Drawer.vue +60 -0
- package/dist/components/Drawer.vue.d.ts +44 -0
- package/dist/components/IconBtn.vue +18 -0
- package/dist/components/IconBtn.vue.d.ts +30 -0
- package/dist/components/Modal.vue +155 -0
- package/dist/components/Modal.vue.d.ts +0 -0
- package/dist/components/SiteTitle.vue +14 -0
- package/dist/components/SiteTitle.vue.d.ts +2 -0
- package/dist/components/Toaster.vue +19 -0
- package/dist/components/Toaster.vue.d.ts +5 -0
- package/dist/components/cards/CheckboxesCard.vue +76 -0
- package/dist/components/cards/CheckboxesCard.vue.d.ts +20 -0
- package/dist/components/cards/HeaderCard.vue +31 -0
- package/dist/components/cards/HeaderCard.vue.d.ts +8 -0
- package/dist/components/cards/ImageCard.vue +73 -0
- package/dist/components/cards/ImageCard.vue.d.ts +63 -0
- package/dist/components/cards/InputCard.vue +60 -0
- package/dist/components/cards/InputCard.vue.d.ts +41 -0
- package/dist/components/cards/StaticCard.vue +37 -0
- package/dist/components/cards/StaticCard.vue.d.ts +33 -0
- package/dist/components/core/AppBarSearch.vue +345 -0
- package/dist/components/core/AppBarSearch.vue.d.ts +1587 -0
- package/dist/components/core/AppDrawerHeaderSection.vue +21 -0
- package/dist/components/core/AppDrawerHeaderSection.vue.d.ts +30 -0
- package/dist/components/core/AppSearchHeader.vue +72 -0
- package/dist/components/core/AppSearchHeader.vue.d.ts +7 -0
- package/dist/components/core/AppStepper.vue +232 -0
- package/dist/components/core/AppStepper.vue.d.ts +25 -0
- package/dist/components/core/CustomizerSection.vue +19 -0
- package/dist/components/core/CustomizerSection.vue.d.ts +25 -0
- package/dist/components/core/DialogCloseBtn.vue +20 -0
- package/dist/components/core/DialogCloseBtn.vue.d.ts +9 -0
- package/dist/components/core/MoreBtn.vue +27 -0
- package/dist/components/core/MoreBtn.vue.d.ts +25 -0
- package/dist/components/core/ScrollToTop.vue +39 -0
- package/dist/components/core/ScrollToTop.vue.d.ts +2 -0
- package/dist/components/core/app-form-elements/AppCombobox.vue +67 -0
- package/dist/components/core/app-form-elements/AppCombobox.vue.d.ts +0 -0
- package/dist/components/core/app-form-elements/AppSelect.vue +98 -0
- package/dist/components/core/app-form-elements/AppSelect.vue.d.ts +0 -0
- package/dist/components/core/app-form-elements/AppSwitch.vue +59 -0
- package/dist/components/core/app-form-elements/AppSwitch.vue.d.ts +27 -0
- package/dist/components/core/app-form-elements/AppTextField.vue +66 -0
- package/dist/components/core/app-form-elements/AppTextField.vue.d.ts +26 -0
- package/dist/components/core/app-form-elements/AppTextarea.vue +69 -0
- package/dist/components/core/app-form-elements/AppTextarea.vue.d.ts +26 -0
- package/dist/components/core/app-form-elements/CustomCheckboxes.vue +69 -0
- package/dist/components/core/app-form-elements/CustomCheckboxes.vue.d.ts +39 -0
- package/dist/components/core/app-form-elements/CustomCheckboxesWithIcon.vue +80 -0
- package/dist/components/core/app-form-elements/CustomCheckboxesWithIcon.vue.d.ts +39 -0
- package/dist/components/core/app-form-elements/CustomCheckboxesWithImage.vue +67 -0
- package/dist/components/core/app-form-elements/CustomCheckboxesWithImage.vue.d.ts +15 -0
- package/dist/components/core/app-form-elements/CustomRadios.vue +69 -0
- package/dist/components/core/app-form-elements/CustomRadios.vue.d.ts +40 -0
- package/dist/components/core/app-form-elements/CustomRadiosWithIcon.vue +98 -0
- package/dist/components/core/app-form-elements/CustomRadiosWithIcon.vue.d.ts +45 -0
- package/dist/components/core/app-form-elements/CustomRadiosWithImage.vue +69 -0
- package/dist/components/core/app-form-elements/CustomRadiosWithImage.vue.d.ts +53 -0
- package/dist/components/core/cards/AppCard.vue +45 -0
- package/dist/components/core/cards/AppCard.vue.d.ts +26 -0
- package/dist/components/core/cards/AppCardActions.vue +126 -0
- package/dist/components/core/cards/AppCardActions.vue.d.ts +79 -0
- package/dist/components/core/cards/CardStatisticsHorizontal.vue +29 -0
- package/dist/components/core/cards/CardStatisticsHorizontal.vue.d.ts +10 -0
- package/dist/components/forms/Accordion.vue +43 -0
- package/dist/components/forms/Accordion.vue.d.ts +35 -0
- package/dist/components/forms/AppLabel.vue +47 -0
- package/dist/components/forms/AppLabel.vue.d.ts +36 -0
- package/dist/components/forms/AppLink.vue +50 -0
- package/dist/components/forms/AppLink.vue.d.ts +27 -0
- package/dist/components/forms/AppNumberField.vue +85 -0
- package/dist/components/forms/AppNumberField.vue.d.ts +45 -0
- package/dist/components/forms/AppOtpInput.vue +84 -0
- package/dist/components/forms/AppOtpInput.vue.d.ts +16 -0
- package/dist/components/forms/AttachmentCropperInput.vue +228 -0
- package/dist/components/forms/AttachmentCropperInput.vue.d.ts +25 -0
- package/dist/components/forms/AttachmentInput.vue +116 -0
- package/dist/components/forms/AttachmentInput.vue.d.ts +20 -0
- package/dist/components/forms/AutocompleteInput.vue +759 -0
- package/dist/components/forms/AutocompleteInput.vue.d.ts +0 -0
- package/dist/components/forms/BankSelect.vue +43 -0
- package/dist/components/forms/BankSelect.vue.d.ts +19 -0
- package/dist/components/forms/BaseButton.vue +42 -0
- package/dist/components/forms/BaseButton.vue.d.ts +31 -0
- package/dist/components/forms/CounterInput.vue +71 -0
- package/dist/components/forms/CounterInput.vue.d.ts +15 -0
- package/dist/components/forms/DatePicker.vue +400 -0
- package/dist/components/forms/DatePicker.vue.d.ts +34 -0
- package/dist/components/forms/DatePickerRange.vue +129 -0
- package/dist/components/forms/DatePickerRange.vue.d.ts +23 -0
- package/dist/components/forms/DraggedUploadFile.vue +120 -0
- package/dist/components/forms/DraggedUploadFile.vue.d.ts +10 -0
- package/dist/components/forms/ImageCardInput.vue +234 -0
- package/dist/components/forms/ImageCardInput.vue.d.ts +0 -0
- package/dist/components/forms/InputValidationWrapper.vue +24 -0
- package/dist/components/forms/InputValidationWrapper.vue.d.ts +33 -0
- package/dist/components/forms/LicensePlateInput.vue +159 -0
- package/dist/components/forms/LicensePlateInput.vue.d.ts +16 -0
- package/dist/components/forms/ManualDate.vue +262 -0
- package/dist/components/forms/ManualDate.vue.d.ts +17 -0
- package/dist/components/forms/MobileInput.vue +118 -0
- package/dist/components/forms/MobileInput.vue.d.ts +49 -0
- package/dist/components/forms/PasswordInput.vue +29 -0
- package/dist/components/forms/PasswordInput.vue.d.ts +13 -0
- package/dist/components/forms/RangeInput.vue +48 -0
- package/dist/components/forms/RangeInput.vue.d.ts +5 -0
- package/dist/components/forms/Tabs.vue +35 -0
- package/dist/components/forms/Tabs.vue.d.ts +42 -0
- package/dist/components/forms/TimePicker.vue +370 -0
- package/dist/components/forms/TimePicker.vue.d.ts +23 -0
- package/dist/components/icons/EndMarker.vue +25 -0
- package/dist/components/icons/EndMarker.vue.d.ts +17 -0
- package/dist/components/icons/RedXIcon.vue +36 -0
- package/dist/components/icons/RedXIcon.vue.d.ts +2 -0
- package/dist/components/icons/StarFillIcon.vue +28 -0
- package/dist/components/icons/StarFillIcon.vue.d.ts +2 -0
- package/dist/components/icons/StartMarker.vue +25 -0
- package/dist/components/icons/StartMarker.vue.d.ts +17 -0
- package/dist/components/icons/WorkerIcon.vue +39 -0
- package/dist/components/icons/WorkerIcon.vue.d.ts +2 -0
- package/dist/components/loading/LoadingBar.vue +31 -0
- package/dist/components/loading/LoadingBar.vue.d.ts +5 -0
- package/dist/components/loading/LoadingDialog.vue +41 -0
- package/dist/components/loading/LoadingDialog.vue.d.ts +11 -0
- package/dist/components/loading/LoadingItem.vue +66 -0
- package/dist/components/loading/LoadingItem.vue.d.ts +47 -0
- package/dist/components/table/DataTable.vue +319 -0
- package/dist/components/table/DataTable.vue.d.ts +0 -0
- package/dist/components/table/EditableDataTable.vue +329 -0
- package/dist/components/table/EditableDataTable.vue.d.ts +73 -0
- package/dist/components/table/EditableDataTableRow.vue +243 -0
- package/dist/components/table/EditableDataTableRow.vue.d.ts +18 -0
- package/dist/components/table/FilterGenerator.vue +232 -0
- package/dist/components/table/FilterGenerator.vue.d.ts +14 -0
- package/dist/components/table/StaticTable.vue +152 -0
- package/dist/components/table/StaticTable.vue.d.ts +25 -0
- package/dist/components/table/TablePagination.vue +73 -0
- package/dist/components/table/TablePagination.vue.d.ts +13 -0
- package/dist/composables/use-is-mobile.d.ts +1 -0
- package/dist/composables/use-is-mobile.js +10 -0
- package/dist/composables/use-is-mobile.mjs +4 -0
- package/dist/composables/use-table-filters.d.ts +23 -0
- package/dist/composables/use-table-filters.js +196 -0
- package/dist/composables/use-table-filters.mjs +183 -0
- package/dist/fonts/NotoSans-Medium.ttf +0 -0
- package/dist/fonts/NotoSansArabic-Medium.ttf +0 -0
- package/dist/fonts/saudi_riyal_symbol/saudi_riyal_symbol.eot +0 -0
- package/dist/fonts/saudi_riyal_symbol/saudi_riyal_symbol.svg +9 -0
- package/dist/fonts/saudi_riyal_symbol/saudi_riyal_symbol.ttf +0 -0
- package/dist/fonts/saudi_riyal_symbol/saudi_riyal_symbol.woff +0 -0
- package/dist/fonts/saudi_riyal_symbol/saudi_riyal_symbol.woff2 +0 -0
- package/dist/images/avatar.png +0 -0
- package/dist/images/sa.svg +1 -0
- package/dist/images/successful-registration.svg +15 -0
- package/dist/index.d.ts +66 -0
- package/dist/index.js +447 -0
- package/dist/index.mjs +128 -0
- package/dist/styles/@core/scss/base/_components.scss +164 -0
- package/dist/styles/@core/scss/base/_dark.scss +16 -0
- package/dist/styles/@core/scss/base/_default-layout-w-vertical-nav.scss +106 -0
- package/dist/styles/@core/scss/base/_default-layout.scss +16 -0
- package/dist/styles/@core/scss/base/_index.scss +47 -0
- package/dist/styles/@core/scss/base/_layouts.scss +63 -0
- package/dist/styles/@core/scss/base/_misc.scss +20 -0
- package/dist/styles/@core/scss/base/_mixins.scss +84 -0
- package/dist/styles/@core/scss/base/_route-transitions.scss +70 -0
- package/dist/styles/@core/scss/base/_utilities.scss +418 -0
- package/dist/styles/@core/scss/base/_utils.scss +100 -0
- package/dist/styles/@core/scss/base/_variables.scss +190 -0
- package/dist/styles/@core/scss/base/_vertical-nav.scss +264 -0
- package/dist/styles/@core/scss/base/libs/_perfect-scrollbar.scss +35 -0
- package/dist/styles/@core/scss/base/libs/vuetify/_index.scss +1 -0
- package/dist/styles/@core/scss/base/libs/vuetify/_overrides.scss +385 -0
- package/dist/styles/@core/scss/base/libs/vuetify/_variables.scss +48 -0
- package/dist/styles/@core/scss/base/placeholders/_default-layout-vertical-nav.scss +48 -0
- package/dist/styles/@core/scss/base/placeholders/_default-layout.scss +3 -0
- package/dist/styles/@core/scss/base/placeholders/_index.scss +5 -0
- package/dist/styles/@core/scss/base/placeholders/_misc.scss +7 -0
- package/dist/styles/@core/scss/base/placeholders/_nav.scss +26 -0
- package/dist/styles/@core/scss/base/placeholders/_vertical-nav.scss +84 -0
- package/dist/styles/@core/scss/base/skins/_bordered.scss +60 -0
- package/dist/styles/@core/scss/base/skins/_index.scss +1 -0
- package/dist/styles/@core/scss/template/_components.scss +1035 -0
- package/dist/styles/@core/scss/template/_default-layout-w-vertical-nav.scss +20 -0
- package/dist/styles/@core/scss/template/_utilities.scss +20 -0
- package/dist/styles/@core/scss/template/_variables.scss +67 -0
- package/dist/styles/@core/scss/template/_vertical-nav.scss +41 -0
- package/dist/styles/@core/scss/template/index.css +18764 -0
- package/dist/styles/@core/scss/template/index.scss +15 -0
- package/dist/styles/@core/scss/template/libs/apex-chart.css +90 -0
- package/dist/styles/@core/scss/template/libs/apex-chart.scss +99 -0
- package/dist/styles/@core/scss/template/libs/shepherd.css +82 -0
- package/dist/styles/@core/scss/template/libs/shepherd.scss +88 -0
- package/dist/styles/@core/scss/template/libs/vuetify/_variables.scss +461 -0
- package/dist/styles/@core/scss/template/libs/vuetify/index.css +741 -0
- package/dist/styles/@core/scss/template/libs/vuetify/index.scss +1 -0
- package/dist/styles/@core/scss/template/pages/misc.css +16 -0
- package/dist/styles/@core/scss/template/pages/misc.scss +20 -0
- package/dist/styles/@core/scss/template/placeholders/_default-layout-vertical-nav.scss +9 -0
- package/dist/styles/@core/scss/template/placeholders/_index.scss +3 -0
- package/dist/styles/@core/scss/template/placeholders/_nav.scss +15 -0
- package/dist/styles/@core/scss/template/placeholders/_vertical-nav.scss +18 -0
- package/dist/styles/@core/scss/template/skins/_bordered.scss +36 -0
- package/dist/styles/@core/scss/template/skins/_index.scss +1 -0
- package/dist/styles/@layouts/styles/_classes.scss +3 -0
- package/dist/styles/@layouts/styles/_dashboard-layout.scss +43 -0
- package/dist/styles/@layouts/styles/_global.scss +10 -0
- package/dist/styles/@layouts/styles/_mixins.scss +28 -0
- package/dist/styles/@layouts/styles/_placeholders.scss +53 -0
- package/dist/styles/@layouts/styles/_rtl.scss +7 -0
- package/dist/styles/@layouts/styles/_variables.scss +22 -0
- package/dist/styles/@layouts/styles/index.css +14 -0
- package/dist/styles/@layouts/styles/index.scss +2 -0
- package/dist/styles/assets/scss/styles.css +16099 -0
- package/dist/styles/assets/scss/styles.scss +246 -0
- package/dist/styles/assets/scss/variables/_template.scss +1 -0
- package/dist/styles/assets/scss/variables/_vuetify.scss +1 -0
- package/dist/types.d.ts +226 -0
- package/dist/utils/apiUrl.d.ts +1 -0
- package/dist/utils/apiUrl.js +15 -0
- package/dist/utils/apiUrl.mjs +8 -0
- package/dist/utils/client.d.ts +9 -0
- package/dist/utils/client.js +39 -0
- package/dist/utils/client.mjs +25 -0
- package/dist/utils/files.d.ts +2 -0
- package/dist/utils/files.js +35 -0
- package/dist/utils/files.mjs +22 -0
- package/dist/utils/formValidation.d.ts +7 -0
- package/dist/utils/formValidation.js +20 -0
- package/dist/utils/formValidation.mjs +13 -0
- package/dist/utils/formatters.d.ts +12 -0
- package/dist/utils/formatters.js +84 -0
- package/dist/utils/formatters.mjs +56 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.js +104 -0
- package/dist/utils/index.mjs +9 -0
- package/dist/utils/queryParams.d.ts +4 -0
- package/dist/utils/queryParams.js +26 -0
- package/dist/utils/queryParams.mjs +18 -0
- package/dist/utils/ruleValidator.d.ts +28 -0
- package/dist/utils/ruleValidator.js +158 -0
- package/dist/utils/ruleValidator.mjs +144 -0
- package/dist/utils/toaster.d.ts +12 -0
- package/dist/utils/toaster.js +71 -0
- package/dist/utils/toaster.mjs +59 -0
- package/dist/utils/utils.d.ts +8 -0
- package/dist/utils/utils.js +70 -0
- package/dist/utils/utils.mjs +56 -0
- package/package.json +79 -0
- package/src/styles/@core/scss/base/_components.scss +164 -0
- package/src/styles/@core/scss/base/_dark.scss +16 -0
- package/src/styles/@core/scss/base/_default-layout-w-vertical-nav.scss +106 -0
- package/src/styles/@core/scss/base/_default-layout.scss +16 -0
- package/src/styles/@core/scss/base/_index.scss +47 -0
- package/src/styles/@core/scss/base/_layouts.scss +63 -0
- package/src/styles/@core/scss/base/_misc.scss +20 -0
- package/src/styles/@core/scss/base/_mixins.scss +84 -0
- package/src/styles/@core/scss/base/_route-transitions.scss +70 -0
- package/src/styles/@core/scss/base/_utilities.scss +418 -0
- package/src/styles/@core/scss/base/_utils.scss +100 -0
- package/src/styles/@core/scss/base/_variables.scss +190 -0
- package/src/styles/@core/scss/base/_vertical-nav.scss +264 -0
- package/src/styles/@core/scss/base/libs/_perfect-scrollbar.scss +35 -0
- package/src/styles/@core/scss/base/libs/vuetify/_index.scss +1 -0
- package/src/styles/@core/scss/base/libs/vuetify/_overrides.scss +385 -0
- package/src/styles/@core/scss/base/libs/vuetify/_variables.scss +48 -0
- package/src/styles/@core/scss/base/placeholders/_default-layout-vertical-nav.scss +48 -0
- package/src/styles/@core/scss/base/placeholders/_default-layout.scss +3 -0
- package/src/styles/@core/scss/base/placeholders/_index.scss +5 -0
- package/src/styles/@core/scss/base/placeholders/_misc.scss +7 -0
- package/src/styles/@core/scss/base/placeholders/_nav.scss +26 -0
- package/src/styles/@core/scss/base/placeholders/_vertical-nav.scss +84 -0
- package/src/styles/@core/scss/base/skins/_bordered.scss +60 -0
- package/src/styles/@core/scss/base/skins/_index.scss +1 -0
- package/src/styles/@core/scss/template/_components.scss +1035 -0
- package/src/styles/@core/scss/template/_default-layout-w-vertical-nav.scss +20 -0
- package/src/styles/@core/scss/template/_utilities.scss +20 -0
- package/src/styles/@core/scss/template/_variables.scss +67 -0
- package/src/styles/@core/scss/template/_vertical-nav.scss +41 -0
- package/src/styles/@core/scss/template/index.scss +15 -0
- package/src/styles/@core/scss/template/libs/apex-chart.scss +99 -0
- package/src/styles/@core/scss/template/libs/shepherd.scss +88 -0
- package/src/styles/@core/scss/template/libs/vuetify/_variables.scss +461 -0
- package/src/styles/@core/scss/template/libs/vuetify/index.scss +1 -0
- package/src/styles/@core/scss/template/pages/misc.scss +20 -0
- package/src/styles/@core/scss/template/placeholders/_default-layout-vertical-nav.scss +9 -0
- package/src/styles/@core/scss/template/placeholders/_index.scss +3 -0
- package/src/styles/@core/scss/template/placeholders/_nav.scss +15 -0
- package/src/styles/@core/scss/template/placeholders/_vertical-nav.scss +18 -0
- package/src/styles/@core/scss/template/skins/_bordered.scss +36 -0
- package/src/styles/@core/scss/template/skins/_index.scss +1 -0
- package/src/styles/@layouts/styles/_classes.scss +3 -0
- package/src/styles/@layouts/styles/_dashboard-layout.scss +43 -0
- package/src/styles/@layouts/styles/_global.scss +10 -0
- package/src/styles/@layouts/styles/_mixins.scss +28 -0
- package/src/styles/@layouts/styles/_placeholders.scss +53 -0
- package/src/styles/@layouts/styles/_rtl.scss +7 -0
- package/src/styles/@layouts/styles/_variables.scss +22 -0
- package/src/styles/@layouts/styles/index.scss +2 -0
- package/src/styles/assets/scss/styles.scss +246 -0
- package/src/styles/assets/scss/variables/_template.scss +1 -0
- package/src/styles/assets/scss/variables/_vuetify.scss +1 -0
|
@@ -0,0 +1,129 @@
|
|
|
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/use-is-mobile";
|
|
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
|
+
format="DD-MM-YYYY"
|
|
96
|
+
display-format="DD/MM/YYYY"
|
|
97
|
+
:label="props.label"
|
|
98
|
+
:forced-label="label('from')"
|
|
99
|
+
:placeholder="props.fromPlaceholder || t('inputs.from')"
|
|
100
|
+
:hide-error-message="useIsMobile().value"
|
|
101
|
+
@update:model-value="onInput"
|
|
102
|
+
@reset-selected-date="resetSelectedDate('from')"
|
|
103
|
+
/>
|
|
104
|
+
</VCol>
|
|
105
|
+
<VCol cols="12" sm="3" class="py-0">
|
|
106
|
+
<DatePicker
|
|
107
|
+
id="to"
|
|
108
|
+
v-model="to"
|
|
109
|
+
v-bind="{
|
|
110
|
+
...$attrs,
|
|
111
|
+
}"
|
|
112
|
+
show-today
|
|
113
|
+
:rules="rules"
|
|
114
|
+
:clearable="clearable"
|
|
115
|
+
:error-messages="toErrorMessages"
|
|
116
|
+
:min-date="from || toMinDate"
|
|
117
|
+
:max-date="maxToDate"
|
|
118
|
+
:disabled="disableFrom"
|
|
119
|
+
format="DD-MM-YYYY"
|
|
120
|
+
display-format="DD/MM/YYYY"
|
|
121
|
+
:label="props.label"
|
|
122
|
+
:forced-label="label('to')"
|
|
123
|
+
:placeholder="t('inputs.to')"
|
|
124
|
+
:hide-error-message="useIsMobile().value"
|
|
125
|
+
@update:model-value="onInput"
|
|
126
|
+
@reset-selected-date="resetSelectedDate('to')"
|
|
127
|
+
/>
|
|
128
|
+
</VCol>
|
|
129
|
+
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
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 _default: 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
|
+
export default _default;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { VProgressLinear, VIcon } from "vuetify/components";
|
|
3
|
+
import { ref, computed } from "vue";
|
|
4
|
+
import { useI18n } from "vue-i18n";
|
|
5
|
+
import { toaster } from "../../utils/toaster";
|
|
6
|
+
const { t } = useI18n();
|
|
7
|
+
const isDragging = ref(false);
|
|
8
|
+
const isHovered = ref(false);
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
modelValue: { type: Array, required: true },
|
|
11
|
+
loading: { type: Boolean, required: false }
|
|
12
|
+
});
|
|
13
|
+
const emit = defineEmits(["update:model-value"]);
|
|
14
|
+
const files = computed({
|
|
15
|
+
get() {
|
|
16
|
+
return props.modelValue;
|
|
17
|
+
},
|
|
18
|
+
set(val) {
|
|
19
|
+
emit("update:model-value", val);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const dragover = (event) => {
|
|
23
|
+
event.preventDefault();
|
|
24
|
+
isDragging.value = true;
|
|
25
|
+
};
|
|
26
|
+
const dragleave = (event) => {
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
isDragging.value = false;
|
|
29
|
+
};
|
|
30
|
+
const mouseEnter = (event) => {
|
|
31
|
+
event.preventDefault();
|
|
32
|
+
isHovered.value = true;
|
|
33
|
+
};
|
|
34
|
+
const mouseLeave = (event) => {
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
isHovered.value = false;
|
|
37
|
+
};
|
|
38
|
+
const handleFileUpload = async (event) => {
|
|
39
|
+
event.preventDefault();
|
|
40
|
+
const allowedExtensions = /(\.xls|\.xlsx)$/i;
|
|
41
|
+
let inputFiles = document.getElementById("upload-input").files;
|
|
42
|
+
if (event.target.files && allowedExtensions.test(event.target.files[0]?.name) || event.dataTransfer.files && allowedExtensions.test(event.dataTransfer.files[0]?.name)) {
|
|
43
|
+
inputFiles = event.type === "change" ? event.target.files : event.dataTransfer.files;
|
|
44
|
+
files.value = [...inputFiles ? [inputFiles] : []];
|
|
45
|
+
isDragging.value = false;
|
|
46
|
+
} else {
|
|
47
|
+
toaster().error(t("files_must_be_xls_xlsx"));
|
|
48
|
+
isDragging.value = false;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<div
|
|
55
|
+
class="drop-area d-flex flex-column justify-center app-min-h-250px py-10 px-7 gap-4 position-relative overflow-hidden"
|
|
56
|
+
:class="isHovered || isDragging ? 'bg-yellow-light app-border-primary' : 'bg-surface app-border-silver'"
|
|
57
|
+
@dragover="dragover"
|
|
58
|
+
@dragleave="dragleave"
|
|
59
|
+
@mouseenter="mouseEnter"
|
|
60
|
+
@mouseleave="mouseLeave"
|
|
61
|
+
@drop="handleFileUpload"
|
|
62
|
+
>
|
|
63
|
+
<input
|
|
64
|
+
id="upload-input"
|
|
65
|
+
type="file"
|
|
66
|
+
class="d-none"
|
|
67
|
+
name="file"
|
|
68
|
+
accept=".xls,.xlsx"
|
|
69
|
+
@change="handleFileUpload"
|
|
70
|
+
>
|
|
71
|
+
<div class="app-w-48px app-h-48px rounded-lg bg-grayish-blue d-flex align-center justify-center me-2">
|
|
72
|
+
<VIcon icon="tabler-upload" size="28" color="dark-gray" />
|
|
73
|
+
</div>
|
|
74
|
+
<div v-if="!isDragging" class="d-flex flex-column align-center gap-4">
|
|
75
|
+
<p class="mb-0">
|
|
76
|
+
{{ t('drag_here_or') }}
|
|
77
|
+
</p>
|
|
78
|
+
<label
|
|
79
|
+
for="upload-input"
|
|
80
|
+
class="text-base font-weight-medium hover-underline text-blue"
|
|
81
|
+
>
|
|
82
|
+
{{ t("actions.choose_from_files") }}
|
|
83
|
+
</label>
|
|
84
|
+
<span class="text-sm text-gray-500">{{ t("upload_restriction") }}</span>
|
|
85
|
+
<div v-if="files && files[0]" class="d-flex align-center app-font-size-15 font-weight-medium mt-2 text-success">
|
|
86
|
+
{{ t("inputs.file_name") }}: {{ files[0]?.item(0)?.name }}
|
|
87
|
+
</div>
|
|
88
|
+
<VProgressLinear
|
|
89
|
+
v-if="loading"
|
|
90
|
+
indeterminate
|
|
91
|
+
color="primary"
|
|
92
|
+
:size="20"
|
|
93
|
+
:width="2"
|
|
94
|
+
/>
|
|
95
|
+
</div>
|
|
96
|
+
<div v-else>
|
|
97
|
+
<span> {{ t("release_to_upload") }} </span>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
</template>
|
|
101
|
+
|
|
102
|
+
<style scoped>
|
|
103
|
+
.file-upload {
|
|
104
|
+
display: flex;
|
|
105
|
+
flex-direction: column;
|
|
106
|
+
align-items: center;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.drop-area {
|
|
110
|
+
width: 100%;
|
|
111
|
+
min-height: 100px;
|
|
112
|
+
border-radius: 10px;
|
|
113
|
+
border-width: 2px;
|
|
114
|
+
border-style: dashed;
|
|
115
|
+
display: flex;
|
|
116
|
+
justify-content: center;
|
|
117
|
+
align-items: center;
|
|
118
|
+
margin-top: 10px;
|
|
119
|
+
}
|
|
120
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
modelValue: FileList[];
|
|
3
|
+
loading?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: 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
|
+
export default _default;
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import Cropper from "cropperjs";
|
|
3
|
+
import "cropperjs/dist/cropper.css";
|
|
4
|
+
import { computed, ref, watch, nextTick } from "vue";
|
|
5
|
+
import { useI18n } from "vue-i18n";
|
|
6
|
+
import { VSlider, VList, VListItem, VBadge, VMenu, VAvatar, VImg, VIcon } from "vuetify/components";
|
|
7
|
+
import avatar from "../../images/avatar.png";
|
|
8
|
+
import { ruleValidator } from "../../utils/ruleValidator";
|
|
9
|
+
import Modal from "../Modal.vue";
|
|
10
|
+
import BaseButton from "./BaseButton.vue";
|
|
11
|
+
const { fileValidator } = ruleValidator();
|
|
12
|
+
const emit = defineEmits(["delete", "update"]);
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
src: { type: [String, null, Object], required: false },
|
|
15
|
+
canEdit: { type: Boolean, required: false, default: true },
|
|
16
|
+
canDelete: { type: Boolean, required: false, default: true },
|
|
17
|
+
imagePlaceholder: { type: String, required: false },
|
|
18
|
+
isLoading: { type: Boolean, required: true }
|
|
19
|
+
});
|
|
20
|
+
const { t } = useI18n();
|
|
21
|
+
const model = defineModel({ type: null });
|
|
22
|
+
const avatarRef = ref();
|
|
23
|
+
const imageSrc = ref(props.src || avatar);
|
|
24
|
+
const fileInputRef = ref(null);
|
|
25
|
+
const zoomLevel = ref(1);
|
|
26
|
+
const initialZoom = ref(1);
|
|
27
|
+
const cropperDialog = ref(false);
|
|
28
|
+
const cropImageSrc = ref(null);
|
|
29
|
+
const selectedFile = ref(null);
|
|
30
|
+
const cropperInstance = ref(null);
|
|
31
|
+
const cropperImage = ref(null);
|
|
32
|
+
watch(() => props.src, (newSrc) => {
|
|
33
|
+
imageSrc.value = newSrc || props.imagePlaceholder || avatar;
|
|
34
|
+
}, { immediate: true });
|
|
35
|
+
const generateImageUrl = (file) => {
|
|
36
|
+
const imageElement = document.getElementById("image-preview");
|
|
37
|
+
const imageUrl = URL.createObjectURL(file);
|
|
38
|
+
imageSrc.value = imageUrl;
|
|
39
|
+
if (imageElement) {
|
|
40
|
+
imageElement.onload = () => URL.revokeObjectURL(imageUrl);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const onImageChange = (event) => {
|
|
44
|
+
const inputElement = event.target;
|
|
45
|
+
const file = inputElement.files?.[0];
|
|
46
|
+
const isValidFile = fileValidator(file, 3, ["image/png", "image/jpeg", "image/jpg"]);
|
|
47
|
+
if (isValidFile && file) {
|
|
48
|
+
selectedFile.value = file;
|
|
49
|
+
cropImageSrc.value = URL.createObjectURL(file);
|
|
50
|
+
cropperDialog.value = true;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const initCropper = () => {
|
|
54
|
+
if (cropperInstance.value) {
|
|
55
|
+
cropperInstance.value.destroy();
|
|
56
|
+
}
|
|
57
|
+
if (cropperImage.value) {
|
|
58
|
+
cropperInstance.value = new Cropper(cropperImage.value, {
|
|
59
|
+
aspectRatio: 1,
|
|
60
|
+
viewMode: 1,
|
|
61
|
+
responsive: true,
|
|
62
|
+
zoomable: true,
|
|
63
|
+
scalable: false,
|
|
64
|
+
movable: true,
|
|
65
|
+
wheelZoomRatio: 0,
|
|
66
|
+
zoomOnWheel: false,
|
|
67
|
+
ready() {
|
|
68
|
+
const data = cropperInstance.value?.getImageData();
|
|
69
|
+
initialZoom.value = data ? Math.min(data.width / data.naturalWidth, data.height / data.naturalHeight) : 1;
|
|
70
|
+
zoomLevel.value = initialZoom.value;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
const cropImage = () => {
|
|
76
|
+
if (!cropperInstance.value) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const canvas = cropperInstance.value.getCroppedCanvas({
|
|
80
|
+
width: 200,
|
|
81
|
+
height: 200
|
|
82
|
+
});
|
|
83
|
+
canvas.toBlob((blob) => {
|
|
84
|
+
if (blob && selectedFile.value) {
|
|
85
|
+
const croppedFile = new File([blob], selectedFile.value.name, { type: selectedFile.value.type });
|
|
86
|
+
generateImageUrl(croppedFile);
|
|
87
|
+
model.value = croppedFile;
|
|
88
|
+
emit("update");
|
|
89
|
+
cropperDialog.value = false;
|
|
90
|
+
}
|
|
91
|
+
}, selectedFile.value?.type);
|
|
92
|
+
};
|
|
93
|
+
const deleteUserImage = () => {
|
|
94
|
+
imageSrc.value = avatar;
|
|
95
|
+
model.value = null;
|
|
96
|
+
emit("delete");
|
|
97
|
+
emit("update");
|
|
98
|
+
};
|
|
99
|
+
watch(zoomLevel, async (newZoom) => {
|
|
100
|
+
await nextTick(() => {
|
|
101
|
+
if (cropperInstance.value) {
|
|
102
|
+
cropperInstance.value.zoomTo(newZoom);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
const loading = computed(() => props.isLoading);
|
|
107
|
+
const hasImage = computed(() => {
|
|
108
|
+
return !/^https?:\/\/[^\/]+\/assets\/images\/.*/.test(props.src);
|
|
109
|
+
});
|
|
110
|
+
</script>
|
|
111
|
+
|
|
112
|
+
<template>
|
|
113
|
+
<VBadge location="end top" class="badge-camera mb-4">
|
|
114
|
+
<template #badge>
|
|
115
|
+
<VMenu v-if="src && canEdit" location="end">
|
|
116
|
+
<template #activator="{ props: propsBadge }">
|
|
117
|
+
<BaseButton
|
|
118
|
+
elevation="0"
|
|
119
|
+
size="32"
|
|
120
|
+
:loading="loading"
|
|
121
|
+
v-bind="propsBadge"
|
|
122
|
+
>
|
|
123
|
+
<VIcon icon="tabler-camera-plus" size="20" />
|
|
124
|
+
</BaseButton>
|
|
125
|
+
</template>
|
|
126
|
+
<VList>
|
|
127
|
+
<VListItem @click="fileInputRef?.click()">
|
|
128
|
+
{{ t('actions.change_img') }}
|
|
129
|
+
</VListItem>
|
|
130
|
+
|
|
131
|
+
<VListItem v-if="hasImage && canDelete" class="text-red" @click="deleteUserImage">
|
|
132
|
+
{{ t("actions.delete_img") }}
|
|
133
|
+
</VListItem>
|
|
134
|
+
</VList>
|
|
135
|
+
</VMenu>
|
|
136
|
+
|
|
137
|
+
<BaseButton
|
|
138
|
+
v-else-if="canEdit"
|
|
139
|
+
elevation="0"
|
|
140
|
+
size="32"
|
|
141
|
+
:loading="loading"
|
|
142
|
+
@click="fileInputRef?.click()"
|
|
143
|
+
>
|
|
144
|
+
<VIcon icon="tabler-camera-plus" size="20" />
|
|
145
|
+
</BaseButton>
|
|
146
|
+
</template>
|
|
147
|
+
|
|
148
|
+
<VAvatar
|
|
149
|
+
ref="avatarRef"
|
|
150
|
+
style="overflow: visible;"
|
|
151
|
+
rounded="circle"
|
|
152
|
+
size="120"
|
|
153
|
+
>
|
|
154
|
+
<VImg
|
|
155
|
+
id="image-preview"
|
|
156
|
+
cover
|
|
157
|
+
:src="imageSrc || imagePlaceholder || avatar"
|
|
158
|
+
class="rounded-circle bg-grey-lighten-1"
|
|
159
|
+
/>
|
|
160
|
+
<slot v-bind="{
|
|
161
|
+
avatarRef
|
|
162
|
+
}" />
|
|
163
|
+
</VAvatar>
|
|
164
|
+
|
|
165
|
+
<input
|
|
166
|
+
ref="fileInputRef"
|
|
167
|
+
class="d-none"
|
|
168
|
+
type="file"
|
|
169
|
+
accept=".jpeg, .jpg, .png"
|
|
170
|
+
@change="onImageChange"
|
|
171
|
+
>
|
|
172
|
+
</VBadge>
|
|
173
|
+
|
|
174
|
+
<!-- Cropper Dialog -->
|
|
175
|
+
<Modal
|
|
176
|
+
v-model="cropperDialog"
|
|
177
|
+
persistent
|
|
178
|
+
width="500"
|
|
179
|
+
:has-icon="false"
|
|
180
|
+
@save="cropImage"
|
|
181
|
+
@cancel="cropperDialog = false"
|
|
182
|
+
>
|
|
183
|
+
<img
|
|
184
|
+
v-if="cropImageSrc"
|
|
185
|
+
ref="cropperImage"
|
|
186
|
+
:src="cropImageSrc"
|
|
187
|
+
style="max-width: 100%;"
|
|
188
|
+
@load="initCropper"
|
|
189
|
+
>
|
|
190
|
+
|
|
191
|
+
<template #additional-actions>
|
|
192
|
+
<VSlider
|
|
193
|
+
v-model="zoomLevel"
|
|
194
|
+
class="pa-3 mt-2 flex-grow-1"
|
|
195
|
+
:min="initialZoom"
|
|
196
|
+
:max="initialZoom * 3"
|
|
197
|
+
step="0.1"
|
|
198
|
+
density="comfortable"
|
|
199
|
+
track-size="6"
|
|
200
|
+
thumb-size="18"
|
|
201
|
+
prepend-icon="tabler-minus"
|
|
202
|
+
append-icon="tabler-plus"
|
|
203
|
+
/>
|
|
204
|
+
</template>
|
|
205
|
+
</Modal>
|
|
206
|
+
</template>
|
|
207
|
+
|
|
208
|
+
<style>
|
|
209
|
+
.badge-camera .v-badge__badge {
|
|
210
|
+
z-index: 10000;
|
|
211
|
+
inset-inline-start: calc(100% - 24px) !important;
|
|
212
|
+
background: transparent !important;
|
|
213
|
+
inset-block-end: calc(100% - 24px) !important;
|
|
214
|
+
inset-inline-end: auto !important;
|
|
215
|
+
bottom: auto !important;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
:deep(.cropper-container) {
|
|
219
|
+
width: auto !important;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
:global(.cropper-line),
|
|
223
|
+
:global(.cropper-point) {
|
|
224
|
+
background-color: rgb(var(--v-theme-primary));
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
:global(.cropper-view-box) {
|
|
228
|
+
outline-color: rgba(var(--v-theme-primary), 0.75);
|
|
229
|
+
}
|
|
230
|
+
</style>
|
|
231
|
+
|
|
232
|
+
<style scoped>
|
|
233
|
+
:deep(.v-img__img){border-radius:999999px}
|
|
234
|
+
</style>
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { watch, ref } from "vue";
|
|
3
|
+
const value = defineModel({ type: null });
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
errorMessages: { type: [String, Array], required: false }
|
|
6
|
+
});
|
|
7
|
+
const internalErrorMessages = ref();
|
|
8
|
+
watch(() => props.errorMessages, (val) => {
|
|
9
|
+
internalErrorMessages.value = val;
|
|
10
|
+
}, {
|
|
11
|
+
deep: true,
|
|
12
|
+
immediate: true
|
|
13
|
+
});
|
|
14
|
+
watch(() => value, () => {
|
|
15
|
+
internalErrorMessages.value = "";
|
|
16
|
+
}, {
|
|
17
|
+
deep: true,
|
|
18
|
+
immediate: true
|
|
19
|
+
});
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<slot v-bind="{ internalErrorMessages }" />
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
errorMessages?: string | string[];
|
|
3
|
+
};
|
|
4
|
+
declare const internalErrorMessages: import("vue").Ref<string | string[] | undefined, string | string[] | undefined>;
|
|
5
|
+
type __VLS_PublicProps = {
|
|
6
|
+
modelValue?: unknown;
|
|
7
|
+
} & __VLS_Props;
|
|
8
|
+
declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
|
|
9
|
+
declare var __VLS_1: {
|
|
10
|
+
internalErrorMessages: any;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
13
|
+
default?: (props: typeof __VLS_1) => any;
|
|
14
|
+
}>;
|
|
15
|
+
declare const __VLS_self: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
16
|
+
internalErrorMessages: typeof internalErrorMessages;
|
|
17
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
"update:modelValue": (value: unknown) => any;
|
|
19
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
20
|
+
"onUpdate:modelValue"?: ((value: unknown) => any) | undefined;
|
|
21
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
|
+
"update:modelValue": (value: unknown) => any;
|
|
24
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
25
|
+
"onUpdate:modelValue"?: ((value: unknown) => any) | undefined;
|
|
26
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|