adata-ui 3.0.2 → 3.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/dist/module.d.mts +2 -0
- package/dist/module.json +5 -1
- package/dist/module.mjs +39 -6
- package/dist/runtime/components/Alert.vue +62 -0
- package/dist/runtime/components/Alert.vue.d.ts +29 -0
- package/dist/runtime/components/Chip.vue +24 -0
- package/dist/runtime/components/Chip.vue.d.ts +19 -0
- package/dist/runtime/components/ColorMode.vue +46 -0
- package/dist/runtime/components/ColorMode.vue.d.ts +2 -0
- package/dist/runtime/components/DigitBadge.vue +58 -0
- package/dist/runtime/components/DigitBadge.vue.d.ts +21 -0
- package/dist/runtime/components/Footer.vue +283 -0
- package/dist/runtime/components/Footer.vue.d.ts +2 -0
- package/dist/runtime/components/FooterAccordion.vue +78 -0
- package/dist/runtime/components/FooterAccordion.vue.d.ts +11 -0
- package/dist/runtime/components/Header.vue +139 -0
- package/dist/runtime/components/Header.vue.d.ts +41 -0
- package/dist/runtime/components/NewFooter.vue +267 -0
- package/dist/runtime/components/NewFooter.vue.d.ts +2 -0
- package/dist/runtime/components/NewFooterAccordion.vue +85 -0
- package/dist/runtime/components/NewFooterAccordion.vue.d.ts +11 -0
- package/dist/runtime/components/OtherServiceFeatures.vue +104 -0
- package/dist/runtime/components/OtherServiceFeatures.vue.d.ts +2 -0
- package/dist/runtime/components/Tag.vue +46 -0
- package/dist/runtime/components/Tag.vue.d.ts +25 -0
- package/dist/runtime/components/Toggle.vue +139 -0
- package/dist/runtime/components/Toggle.vue.d.ts +39 -0
- package/dist/runtime/components/accordion/Accordion.vue +149 -0
- package/dist/runtime/components/accordion/Accordion.vue.d.ts +41 -0
- package/dist/runtime/components/accordion/types.d.ts +15 -0
- package/dist/runtime/components/accordion/types.js +0 -0
- package/dist/runtime/components/accordion/ui.config.d.ts +22 -0
- package/dist/runtime/components/accordion/ui.config.js +21 -0
- package/dist/runtime/components/button/Button.vue +133 -0
- package/dist/runtime/components/button/Button.vue.d.ts +37 -0
- package/dist/runtime/components/button/types.d.ts +21 -0
- package/dist/runtime/components/button/types.js +0 -0
- package/dist/runtime/components/checkbox/Checkbox.vue +124 -0
- package/dist/runtime/components/checkbox/Checkbox.vue.d.ts +45 -0
- package/dist/runtime/components/date-picker/DatePicker.vue +102 -0
- package/dist/runtime/components/date-picker/DatePicker.vue.d.ts +16 -0
- package/dist/runtime/components/floating-label/FloatingLabel.vue +22 -0
- package/dist/runtime/components/floating-label/FloatingLabel.vue.d.ts +16 -0
- package/dist/runtime/components/forms/input/standard/InputStandard.vue +301 -0
- package/dist/runtime/components/forms/input/standard/InputStandard.vue.d.ts +0 -0
- package/dist/runtime/components/forms/input/textarea/ATextarea.vue +158 -0
- package/dist/runtime/components/forms/input/textarea/ATextarea.vue.d.ts +43 -0
- package/dist/runtime/components/forms/need-more-data/NeedMoreData.vue +114 -0
- package/dist/runtime/components/forms/need-more-data/NeedMoreData.vue.d.ts +5 -0
- package/dist/runtime/components/forms/request-demo/RequestDemo.vue +67 -0
- package/dist/runtime/components/forms/request-demo/RequestDemo.vue.d.ts +23 -0
- package/dist/runtime/components/header/AlmatyContacts.vue +120 -0
- package/dist/runtime/components/header/AlmatyContacts.vue.d.ts +2 -0
- package/dist/runtime/components/header/AstanaContacts.vue +65 -0
- package/dist/runtime/components/header/AstanaContacts.vue.d.ts +2 -0
- package/dist/runtime/components/header/CardGallery.vue +156 -0
- package/dist/runtime/components/header/CardGallery.vue.d.ts +2 -0
- package/dist/runtime/components/header/ContactMenu.vue +105 -0
- package/dist/runtime/components/header/ContactMenu.vue.d.ts +11 -0
- package/dist/runtime/components/header/HeaderLink.vue +169 -0
- package/dist/runtime/components/header/HeaderLink.vue.d.ts +2 -0
- package/dist/runtime/components/header/LangSwitcher.vue +48 -0
- package/dist/runtime/components/header/LangSwitcher.vue.d.ts +2 -0
- package/dist/runtime/components/header/ListItem.vue +26 -0
- package/dist/runtime/components/header/ListItem.vue.d.ts +7 -0
- package/dist/runtime/components/header/NavCard.vue +40 -0
- package/dist/runtime/components/header/NavCard.vue.d.ts +8 -0
- package/dist/runtime/components/header/NavList.vue +101 -0
- package/dist/runtime/components/header/NavList.vue.d.ts +17 -0
- package/dist/runtime/components/header/ProductMenu.vue +369 -0
- package/dist/runtime/components/header/ProductMenu.vue.d.ts +11 -0
- package/dist/runtime/components/header/ProfileMenu.vue +56 -0
- package/dist/runtime/components/header/ProfileMenu.vue.d.ts +16 -0
- package/dist/runtime/components/header/ProfileMenuContent.vue +228 -0
- package/dist/runtime/components/header/ProfileMenuContent.vue.d.ts +16 -0
- package/dist/runtime/components/header/TopHeader.vue +152 -0
- package/dist/runtime/components/header/TopHeader.vue.d.ts +10 -0
- package/dist/runtime/components/header/types.d.ts +19 -0
- package/dist/runtime/components/header/types.js +0 -0
- package/dist/runtime/components/header-mobile/HeaderMobile.vue +53 -0
- package/dist/runtime/components/header-mobile/HeaderMobile.vue.d.ts +17 -0
- package/dist/runtime/components/mobile-navigation/BottomNavigation.vue +68 -0
- package/dist/runtime/components/mobile-navigation/BottomNavigation.vue.d.ts +29 -0
- package/dist/runtime/components/mobile-navigation/MainButton.vue +16 -0
- package/dist/runtime/components/mobile-navigation/MainButton.vue.d.ts +2 -0
- package/dist/runtime/components/mobile-navigation/MobileProductMenu.vue +261 -0
- package/dist/runtime/components/mobile-navigation/MobileProductMenu.vue.d.ts +2 -0
- package/dist/runtime/components/modals/NoAccessContent.vue +58 -0
- package/dist/runtime/components/modals/NoAccessContent.vue.d.ts +5 -0
- package/dist/runtime/components/pill-tabs/PillTabs.vue +137 -0
- package/dist/runtime/components/pill-tabs/PillTabs.vue.d.ts +38 -0
- package/dist/runtime/components/pill-tabs/types.d.ts +18 -0
- package/dist/runtime/components/pill-tabs/types.js +0 -0
- package/dist/runtime/components/radio-button/RadioButton.vue +69 -0
- package/dist/runtime/components/radio-button/RadioButton.vue.d.ts +40 -0
- package/dist/runtime/components/row-card/RowCard.vue +44 -0
- package/dist/runtime/components/row-card/RowCard.vue.d.ts +26 -0
- package/dist/runtime/components/select-row/index.vue +117 -0
- package/dist/runtime/components/select-row/index.vue.d.ts +31 -0
- package/dist/runtime/components/tree-select/TreeSelect.vue +132 -0
- package/dist/runtime/components/tree-select/TreeSelect.vue.d.ts +22 -0
- package/dist/runtime/components/tree-select/TreeService.d.ts +54 -0
- package/dist/runtime/components/tree-select/TreeService.js +209 -0
- package/dist/runtime/components/tree-select/components/tree-select-nodes.vue +100 -0
- package/dist/runtime/components/tree-select/components/tree-select-nodes.vue.d.ts +9 -0
- package/dist/runtime/components/tree-select/types.d.ts +29 -0
- package/dist/runtime/components/tree-select/types.js +0 -0
- package/dist/runtime/composables/highlight.d.ts +1 -0
- package/dist/runtime/composables/highlight.js +15 -0
- package/dist/runtime/composables/projectState.d.ts +2 -0
- package/dist/runtime/composables/projectState.js +3 -0
- package/dist/runtime/i18n/i18n.config.d.ts +1731 -0
- package/dist/runtime/i18n/i18n.config.js +20 -0
- package/dist/runtime/i18n.d.ts +2 -0
- package/dist/runtime/i18n.js +15 -0
- package/dist/runtime/icons/arrow/arrow-circle-down.vue +30 -0
- package/dist/runtime/icons/arrow/arrow-circle-down.vue.d.ts +2 -0
- package/dist/runtime/icons/arrow/arrow-graph-up.vue +24 -0
- package/dist/runtime/icons/arrow/arrow-graph-up.vue.d.ts +2 -0
- package/dist/runtime/icons/arrow/arrow-right.vue +24 -0
- package/dist/runtime/icons/arrow/arrow-right.vue.d.ts +2 -0
- package/dist/runtime/icons/arrow/arrow-side-up.vue +19 -0
- package/dist/runtime/icons/arrow/arrow-side-up.vue.d.ts +2 -0
- package/dist/runtime/icons/arrow/arrow-top-right-on-square.vue +19 -0
- package/dist/runtime/icons/arrow/arrow-top-right-on-square.vue.d.ts +2 -0
- package/dist/runtime/icons/arrow/chevron-down.vue +19 -0
- package/dist/runtime/icons/arrow/chevron-down.vue.d.ts +2 -0
- package/dist/runtime/icons/avatar.vue +41 -0
- package/dist/runtime/icons/avatar.vue.d.ts +2 -0
- package/dist/runtime/icons/avto/car.vue +17 -0
- package/dist/runtime/icons/avto/car.vue.d.ts +2 -0
- package/dist/runtime/icons/avto/truck.vue +17 -0
- package/dist/runtime/icons/avto/truck.vue.d.ts +2 -0
- package/dist/runtime/icons/block.vue +19 -0
- package/dist/runtime/icons/block.vue.d.ts +2 -0
- package/dist/runtime/icons/bookmark.vue +19 -0
- package/dist/runtime/icons/bookmark.vue.d.ts +2 -0
- package/dist/runtime/icons/calculator.vue +19 -0
- package/dist/runtime/icons/calculator.vue.d.ts +2 -0
- package/dist/runtime/icons/calendar.vue +24 -0
- package/dist/runtime/icons/calendar.vue.d.ts +2 -0
- package/dist/runtime/icons/check-circle.vue +25 -0
- package/dist/runtime/icons/check-circle.vue.d.ts +2 -0
- package/dist/runtime/icons/checkbox/checkbox-active.vue +19 -0
- package/dist/runtime/icons/checkbox/checkbox-active.vue.d.ts +2 -0
- package/dist/runtime/icons/checkbox/checkbox-empty.vue +20 -0
- package/dist/runtime/icons/checkbox/checkbox-empty.vue.d.ts +2 -0
- package/dist/runtime/icons/checkbox/checkbox-intermediate.vue +19 -0
- package/dist/runtime/icons/checkbox/checkbox-intermediate.vue.d.ts +2 -0
- package/dist/runtime/icons/clipboard-text.vue +17 -0
- package/dist/runtime/icons/clipboard-text.vue.d.ts +2 -0
- package/dist/runtime/icons/clock.vue +25 -0
- package/dist/runtime/icons/clock.vue.d.ts +2 -0
- package/dist/runtime/icons/color-mode/moon.vue +20 -0
- package/dist/runtime/icons/color-mode/moon.vue.d.ts +2 -0
- package/dist/runtime/icons/color-mode/sun.vue +27 -0
- package/dist/runtime/icons/color-mode/sun.vue.d.ts +2 -0
- package/dist/runtime/icons/communication/mail.vue +19 -0
- package/dist/runtime/icons/communication/mail.vue.d.ts +2 -0
- package/dist/runtime/icons/communication/phone.vue +19 -0
- package/dist/runtime/icons/communication/phone.vue.d.ts +2 -0
- package/dist/runtime/icons/company.vue +19 -0
- package/dist/runtime/icons/company.vue.d.ts +2 -0
- package/dist/runtime/icons/currency/dollar.vue +19 -0
- package/dist/runtime/icons/currency/dollar.vue.d.ts +2 -0
- package/dist/runtime/icons/currency/down.vue +22 -0
- package/dist/runtime/icons/currency/down.vue.d.ts +2 -0
- package/dist/runtime/icons/currency/eur.vue +69 -0
- package/dist/runtime/icons/currency/eur.vue.d.ts +2 -0
- package/dist/runtime/icons/currency/rub.vue +25 -0
- package/dist/runtime/icons/currency/rub.vue.d.ts +2 -0
- package/dist/runtime/icons/currency/usd.vue +269 -0
- package/dist/runtime/icons/currency/usd.vue.d.ts +2 -0
- package/dist/runtime/icons/currency/yuan.vue +37 -0
- package/dist/runtime/icons/currency/yuan.vue.d.ts +2 -0
- package/dist/runtime/icons/document/hdocument.vue +17 -0
- package/dist/runtime/icons/document/hdocument.vue.d.ts +2 -0
- package/dist/runtime/icons/document/id.vue +19 -0
- package/dist/runtime/icons/document/id.vue.d.ts +2 -0
- package/dist/runtime/icons/document/profile.vue +19 -0
- package/dist/runtime/icons/document/profile.vue.d.ts +2 -0
- package/dist/runtime/icons/download.vue +26 -0
- package/dist/runtime/icons/download.vue.d.ts +2 -0
- package/dist/runtime/icons/edit.vue +24 -0
- package/dist/runtime/icons/edit.vue.d.ts +2 -0
- package/dist/runtime/icons/file/excel.vue +88 -0
- package/dist/runtime/icons/file/excel.vue.d.ts +2 -0
- package/dist/runtime/icons/file/file.vue +19 -0
- package/dist/runtime/icons/file/file.vue.d.ts +2 -0
- package/dist/runtime/icons/file/files.vue +17 -0
- package/dist/runtime/icons/file/files.vue.d.ts +2 -0
- package/dist/runtime/icons/globe.vue +19 -0
- package/dist/runtime/icons/globe.vue.d.ts +2 -0
- package/dist/runtime/icons/handshake.vue +19 -0
- package/dist/runtime/icons/handshake.vue.d.ts +2 -0
- package/dist/runtime/icons/history.vue +19 -0
- package/dist/runtime/icons/history.vue.d.ts +2 -0
- package/dist/runtime/icons/info/info-circle.vue +29 -0
- package/dist/runtime/icons/info/info-circle.vue.d.ts +2 -0
- package/dist/runtime/icons/invoice.vue +35 -0
- package/dist/runtime/icons/invoice.vue.d.ts +2 -0
- package/dist/runtime/icons/link-chain.vue +31 -0
- package/dist/runtime/icons/link-chain.vue.d.ts +2 -0
- package/dist/runtime/icons/loader-circle.vue +41 -0
- package/dist/runtime/icons/loader-circle.vue.d.ts +2 -0
- package/dist/runtime/icons/lock.vue +19 -0
- package/dist/runtime/icons/lock.vue.d.ts +2 -0
- package/dist/runtime/icons/logo/adata.vue +48 -0
- package/dist/runtime/icons/logo/adata.vue.d.ts +2 -0
- package/dist/runtime/icons/logo/logo.vue +27 -0
- package/dist/runtime/icons/logo/logo.vue.d.ts +2 -0
- package/dist/runtime/icons/medal.vue +17 -0
- package/dist/runtime/icons/medal.vue.d.ts +2 -0
- package/dist/runtime/icons/menu/menu-filled.vue +61 -0
- package/dist/runtime/icons/menu/menu-filled.vue.d.ts +2 -0
- package/dist/runtime/icons/menu/menu.vue +41 -0
- package/dist/runtime/icons/menu/menu.vue.d.ts +2 -0
- package/dist/runtime/icons/message.vue +24 -0
- package/dist/runtime/icons/message.vue.d.ts +2 -0
- package/dist/runtime/icons/modals/door.vue +170 -0
- package/dist/runtime/icons/modals/door.vue.d.ts +2 -0
- package/dist/runtime/icons/moon.vue +10 -0
- package/dist/runtime/icons/moon.vue.d.ts +2 -0
- package/dist/runtime/icons/more.vue +36 -0
- package/dist/runtime/icons/more.vue.d.ts +2 -0
- package/dist/runtime/icons/navigation/expand-window.vue +19 -0
- package/dist/runtime/icons/navigation/expand-window.vue.d.ts +2 -0
- package/dist/runtime/icons/navigation/location.vue +25 -0
- package/dist/runtime/icons/navigation/location.vue.d.ts +2 -0
- package/dist/runtime/icons/navigation/logout.vue +19 -0
- package/dist/runtime/icons/navigation/logout.vue.d.ts +2 -0
- package/dist/runtime/icons/notifications.vue +25 -0
- package/dist/runtime/icons/notifications.vue.d.ts +2 -0
- package/dist/runtime/icons/other-service/arrow-square-down.vue +15 -0
- package/dist/runtime/icons/other-service/arrow-square-down.vue.d.ts +2 -0
- package/dist/runtime/icons/other-service/arrow-top-right-on-square.vue +6 -0
- package/dist/runtime/icons/other-service/arrow-top-right-on-square.vue.d.ts +2 -0
- package/dist/runtime/icons/other-service/block.vue +16 -0
- package/dist/runtime/icons/other-service/block.vue.d.ts +2 -0
- package/dist/runtime/icons/other-service/currency-dollar.vue +16 -0
- package/dist/runtime/icons/other-service/currency-dollar.vue.d.ts +2 -0
- package/dist/runtime/icons/other-service/globe.vue +16 -0
- package/dist/runtime/icons/other-service/globe.vue.d.ts +2 -0
- package/dist/runtime/icons/other-service/link.vue +7 -0
- package/dist/runtime/icons/other-service/link.vue.d.ts +2 -0
- package/dist/runtime/icons/other-service/magnifying-glass.vue +9 -0
- package/dist/runtime/icons/other-service/magnifying-glass.vue.d.ts +2 -0
- package/dist/runtime/icons/other-service/standing-scales.vue +15 -0
- package/dist/runtime/icons/other-service/standing-scales.vue.d.ts +2 -0
- package/dist/runtime/icons/other-service/users-three.vue +7 -0
- package/dist/runtime/icons/other-service/users-three.vue.d.ts +2 -0
- package/dist/runtime/icons/plus-circle.vue +24 -0
- package/dist/runtime/icons/plus-circle.vue.d.ts +2 -0
- package/dist/runtime/icons/plus.vue +24 -0
- package/dist/runtime/icons/plus.vue.d.ts +2 -0
- package/dist/runtime/icons/radio/radio-check.vue +24 -0
- package/dist/runtime/icons/radio/radio-check.vue.d.ts +2 -0
- package/dist/runtime/icons/radio/radio-empty.vue +20 -0
- package/dist/runtime/icons/radio/radio-empty.vue.d.ts +2 -0
- package/dist/runtime/icons/receipt/hcheck.vue +27 -0
- package/dist/runtime/icons/receipt/hcheck.vue.d.ts +2 -0
- package/dist/runtime/icons/receipt/receipt.vue +27 -0
- package/dist/runtime/icons/receipt/receipt.vue.d.ts +2 -0
- package/dist/runtime/icons/scale.vue +19 -0
- package/dist/runtime/icons/scale.vue.d.ts +2 -0
- package/dist/runtime/icons/search.vue +27 -0
- package/dist/runtime/icons/search.vue.d.ts +2 -0
- package/dist/runtime/icons/socials/facebook.vue +15 -0
- package/dist/runtime/icons/socials/facebook.vue.d.ts +2 -0
- package/dist/runtime/icons/socials/instagram.vue +19 -0
- package/dist/runtime/icons/socials/instagram.vue.d.ts +2 -0
- package/dist/runtime/icons/socials/linkedin.vue +24 -0
- package/dist/runtime/icons/socials/linkedin.vue.d.ts +2 -0
- package/dist/runtime/icons/socials/telegram.vue +15 -0
- package/dist/runtime/icons/socials/telegram.vue.d.ts +2 -0
- package/dist/runtime/icons/socials/tik-tok.vue +15 -0
- package/dist/runtime/icons/socials/tik-tok.vue.d.ts +2 -0
- package/dist/runtime/icons/socials/whatsapp.vue +21 -0
- package/dist/runtime/icons/socials/whatsapp.vue.d.ts +2 -0
- package/dist/runtime/icons/socials/youtube.vue +16 -0
- package/dist/runtime/icons/socials/youtube.vue.d.ts +2 -0
- package/dist/runtime/icons/sun.vue +14 -0
- package/dist/runtime/icons/sun.vue.d.ts +2 -0
- package/dist/runtime/icons/sviazi.vue +19 -0
- package/dist/runtime/icons/sviazi.vue.d.ts +2 -0
- package/dist/runtime/icons/tenge.vue +22 -0
- package/dist/runtime/icons/tenge.vue.d.ts +2 -0
- package/dist/runtime/icons/trash.vue +24 -0
- package/dist/runtime/icons/trash.vue.d.ts +2 -0
- package/dist/runtime/icons/upload.vue +26 -0
- package/dist/runtime/icons/upload.vue.d.ts +2 -0
- package/dist/runtime/icons/user.vue +30 -0
- package/dist/runtime/icons/user.vue.d.ts +2 -0
- package/dist/runtime/icons/users/users-three.vue +17 -0
- package/dist/runtime/icons/users/users-three.vue.d.ts +2 -0
- package/dist/runtime/icons/users/users.vue +31 -0
- package/dist/runtime/icons/users/users.vue.d.ts +2 -0
- package/dist/runtime/icons/warning-triangle.vue +29 -0
- package/dist/runtime/icons/warning-triangle.vue.d.ts +2 -0
- package/dist/runtime/icons/work-bag.vue +20 -0
- package/dist/runtime/icons/work-bag.vue.d.ts +2 -0
- package/dist/runtime/icons/x-mark.vue +18 -0
- package/dist/runtime/icons/x-mark.vue.d.ts +2 -0
- package/dist/runtime/lang/en.d.ts +4 -0
- package/dist/runtime/lang/en.js +545 -0
- package/dist/runtime/lang/kk.d.ts +4 -0
- package/dist/runtime/lang/kk.js +545 -0
- package/dist/runtime/lang/ru.d.ts +575 -0
- package/dist/runtime/lang/ru.js +607 -0
- package/dist/runtime/shared/constants/pages.d.ts +71 -0
- package/dist/runtime/shared/constants/pages.js +71 -0
- package/package.json +66 -58
- package/dist/runtime/components/header/TheHeader.vue +0 -15
- package/dist/runtime/components/header/TheHeader.vue.d.ts +0 -2
- package/dist/runtime/plugin.d.ts +0 -2
- package/dist/runtime/plugin.js +0 -4
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { twMerge, twJoin } from "tailwind-merge";
|
|
3
|
+
import AAlert from "../../../Alert.vue";
|
|
4
|
+
import { ref, computed, useI18n, watch } from "#imports";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
7
|
+
label: { type: String, required: false, default: "" },
|
|
8
|
+
size: { type: String, required: false, default: "md" },
|
|
9
|
+
error: { type: [String, Boolean], required: false, default: false },
|
|
10
|
+
required: { type: Boolean, required: false, default: false },
|
|
11
|
+
readonly: { type: Boolean, required: false, default: false },
|
|
12
|
+
clearable: { type: Boolean, required: false, default: false },
|
|
13
|
+
startIcon: { type: [String, Object], required: false, default: "" },
|
|
14
|
+
endIcon: { type: [String, Object], required: false, default: "" },
|
|
15
|
+
autocompleteList: { type: Array, required: false, default: () => [] },
|
|
16
|
+
type: { type: String, required: false, default: "text" },
|
|
17
|
+
autocompleteOption: { type: null, required: false, default: void 0 },
|
|
18
|
+
autocompleteKey: { type: null, required: false, default: void 0 },
|
|
19
|
+
autocompleteFn: { type: Function, required: false, default: void 0 },
|
|
20
|
+
colorClasses: { type: String, required: false }
|
|
21
|
+
});
|
|
22
|
+
const { t } = useI18n();
|
|
23
|
+
const uiConfig = {
|
|
24
|
+
"wrapper": "transition duration-500 w-full",
|
|
25
|
+
"input-wrapper": {
|
|
26
|
+
base: "relative inline-block w-full text-sm sm:min-w-full",
|
|
27
|
+
readonly: "pointer-events-none user-select-none",
|
|
28
|
+
disabled: "pointer-events-none user-select-none opacity-40"
|
|
29
|
+
},
|
|
30
|
+
"base": "w-full border-0 rounded-md text-deepblue-900 dark:text-gray-200 hover:outline outline-offset-[-1px] hover:outline-1 hover:outline-blue-700 hover:dark:outline-blue-500 focus:outline focus:outline-blue-700 focus:dark:outline-blue-500 mt-0",
|
|
31
|
+
"size": {
|
|
32
|
+
sm: "h-8 px-4 py-1.5 sm",
|
|
33
|
+
md: "h-10 px-4 pb-1.5 pt-[18px] md",
|
|
34
|
+
smEx: "h-8 pl-4 pr-10 py-1.5 sm",
|
|
35
|
+
mdEx: "h-10 pl-4 pr-10 pb-1.5 pt-[18px] md"
|
|
36
|
+
},
|
|
37
|
+
"color": "bg-deepblue-50 dark:bg-gray-200 dark:bg-opacity-5",
|
|
38
|
+
"error": "outline outline-1 outline-red-500 focus:outline-0 focus:border-red-500 hover:border-red-500",
|
|
39
|
+
"readonly": "bg-white opacity-30",
|
|
40
|
+
"label": {
|
|
41
|
+
"base": "absolute left-4 top-[50%] d-flex text-gray-500 pointer-events-none transition-all ease duration-300 transform translate-y-[-50%] whitespace-nowrap text-ellipsis md:max-w-[90%] overflow-hidden",
|
|
42
|
+
"move-label": "!left-10 md:max-w-[calc(90%-40px)]"
|
|
43
|
+
},
|
|
44
|
+
"default": {
|
|
45
|
+
size: "md",
|
|
46
|
+
color: "gray"
|
|
47
|
+
},
|
|
48
|
+
"move-input": "!ps-10",
|
|
49
|
+
"move-input-left": "!pe-10"
|
|
50
|
+
};
|
|
51
|
+
const emit = defineEmits(["updateValue", "onEnter", "clear", "selectOption"]);
|
|
52
|
+
function customTrim(input2) {
|
|
53
|
+
if (input2 === void 0 || input2 === null) {
|
|
54
|
+
return "";
|
|
55
|
+
}
|
|
56
|
+
if (input2 === " " || /\d/.test(input2)) {
|
|
57
|
+
return input2.trim();
|
|
58
|
+
}
|
|
59
|
+
return input2;
|
|
60
|
+
}
|
|
61
|
+
const input = ref();
|
|
62
|
+
const [modelValue, modelModifiers] = defineModel({ type: null, ...{ default: "", set(value) {
|
|
63
|
+
if (modelModifiers["custom-trim"]) {
|
|
64
|
+
return customTrim(value);
|
|
65
|
+
}
|
|
66
|
+
return value;
|
|
67
|
+
} } });
|
|
68
|
+
const isFocused = ref();
|
|
69
|
+
const isClearable = computed(
|
|
70
|
+
() => props.clearable && !props.disabled && !!modelValue.value
|
|
71
|
+
);
|
|
72
|
+
const mobileAutocomMoved = ref(false);
|
|
73
|
+
const wrapperClass = uiConfig.wrapper;
|
|
74
|
+
const inputWrapperClass = computed(
|
|
75
|
+
() => twMerge(
|
|
76
|
+
twJoin(
|
|
77
|
+
uiConfig["input-wrapper"].base,
|
|
78
|
+
props.readonly ? uiConfig["input-wrapper"].readonly : "",
|
|
79
|
+
props.disabled ? uiConfig["input-wrapper"].disabled : ""
|
|
80
|
+
)
|
|
81
|
+
)
|
|
82
|
+
);
|
|
83
|
+
const inputClass = computed(
|
|
84
|
+
() => twMerge(
|
|
85
|
+
twJoin(
|
|
86
|
+
uiConfig.base,
|
|
87
|
+
uiConfig.size[props.clearable ? `${props.size}Ex` : props.size],
|
|
88
|
+
props.error ? uiConfig.error : "",
|
|
89
|
+
props.startIcon ? uiConfig["move-input"] : "",
|
|
90
|
+
props.endIcon ? uiConfig["move-input-left"] : "",
|
|
91
|
+
props.readonly ? uiConfig.readonly : "",
|
|
92
|
+
props.colorClasses ? props.colorClasses : uiConfig.color
|
|
93
|
+
)
|
|
94
|
+
)
|
|
95
|
+
);
|
|
96
|
+
const labelClass = computed(
|
|
97
|
+
() => twMerge(twJoin(uiConfig.label.base, isClearable.value ? "max-w-[calc(80%-40px)]" : "max-w-[80%]", props.startIcon ? uiConfig.label["move-label"] : ""))
|
|
98
|
+
);
|
|
99
|
+
const currentItemIndex = ref(-1);
|
|
100
|
+
const assignValue = () => {
|
|
101
|
+
if (props.autocompleteFn) {
|
|
102
|
+
modelValue.value = props.autocompleteFn(props.autocompleteList[currentItemIndex.value]);
|
|
103
|
+
} else {
|
|
104
|
+
modelValue.value = props.autocompleteKey ? props.autocompleteList[currentItemIndex.value][props.autocompleteKey] : props.autocompleteList[currentItemIndex.value];
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
const handleKeydown = (e) => {
|
|
108
|
+
if (!props.autocompleteList.length) return;
|
|
109
|
+
if (e.key === "ArrowDown" && currentItemIndex.value < props.autocompleteList.length - 1) {
|
|
110
|
+
e.preventDefault();
|
|
111
|
+
currentItemIndex.value++;
|
|
112
|
+
assignValue();
|
|
113
|
+
} else if (e.key === "ArrowUp" && currentItemIndex.value > 0) {
|
|
114
|
+
e.preventDefault();
|
|
115
|
+
currentItemIndex.value--;
|
|
116
|
+
assignValue();
|
|
117
|
+
} else if (e.key === "Enter") {
|
|
118
|
+
if (currentItemIndex.value !== -1) assignValue();
|
|
119
|
+
emit("onEnter", props.autocompleteList[currentItemIndex.value]);
|
|
120
|
+
input.value?.blur();
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
const onSelectOption = (item) => {
|
|
124
|
+
if (props.autocompleteKey) {
|
|
125
|
+
modelValue.value = item[props.autocompleteKey];
|
|
126
|
+
emit("selectOption", item[props.autocompleteKey]);
|
|
127
|
+
} else {
|
|
128
|
+
modelValue.value = item;
|
|
129
|
+
emit("selectOption", item);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
const onSelectOptionMobile = (item) => {
|
|
133
|
+
if (!mobileAutocomMoved.value) {
|
|
134
|
+
onSelectOption(item);
|
|
135
|
+
} else {
|
|
136
|
+
mobileAutocomMoved.value = false;
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
const onClear = () => {
|
|
140
|
+
modelValue.value = "";
|
|
141
|
+
emit("clear");
|
|
142
|
+
};
|
|
143
|
+
const autocompleteContainer = ref();
|
|
144
|
+
const scrollToElement = (container) => {
|
|
145
|
+
if (container) {
|
|
146
|
+
const selectedItem = container.children[currentItemIndex.value];
|
|
147
|
+
const containerHeight = container.clientHeight;
|
|
148
|
+
const itemTop = selectedItem.offsetTop;
|
|
149
|
+
const itemHeight = selectedItem.clientHeight;
|
|
150
|
+
if (itemTop < container.scrollTop) {
|
|
151
|
+
container.scrollTop = itemTop;
|
|
152
|
+
} else if (itemTop + itemHeight > container.scrollTop + containerHeight) {
|
|
153
|
+
container.scrollTop = itemTop + itemHeight - containerHeight;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
const focus = () => {
|
|
158
|
+
input.value?.focus();
|
|
159
|
+
};
|
|
160
|
+
watch(currentItemIndex, () => {
|
|
161
|
+
scrollToElement(autocompleteContainer.value);
|
|
162
|
+
});
|
|
163
|
+
const isDropdownUp = ref(false);
|
|
164
|
+
const checkDropdownPosition = () => {
|
|
165
|
+
const rect = input.value?.getBoundingClientRect();
|
|
166
|
+
const dropdownHeight = 250;
|
|
167
|
+
const windowHeight = window.visualViewport ? window.visualViewport.height : window.innerHeight;
|
|
168
|
+
if (rect) {
|
|
169
|
+
isDropdownUp.value = windowHeight - rect.bottom < dropdownHeight;
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
watch(isFocused, (newVal) => {
|
|
173
|
+
if (newVal) {
|
|
174
|
+
checkDropdownPosition();
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
watch(modelValue, () => {
|
|
178
|
+
checkDropdownPosition();
|
|
179
|
+
});
|
|
180
|
+
defineExpose({
|
|
181
|
+
focus
|
|
182
|
+
});
|
|
183
|
+
</script>
|
|
184
|
+
|
|
185
|
+
<template>
|
|
186
|
+
<div :class="wrapperClass">
|
|
187
|
+
<div :class="inputWrapperClass">
|
|
188
|
+
<Transition name="autocomplete-fade">
|
|
189
|
+
<div
|
|
190
|
+
v-if="autocompleteList.length && isFocused"
|
|
191
|
+
:class="[
|
|
192
|
+
'absolute z-[31] w-full flex flex-col gap-4 rounded bg-gray-200 p-2 dark:bg-gray-800',
|
|
193
|
+
isDropdownUp ? 'bottom-[44px]' : 'top-[44px]'
|
|
194
|
+
]"
|
|
195
|
+
>
|
|
196
|
+
<ul
|
|
197
|
+
ref="autocompleteContainer"
|
|
198
|
+
class="max-h-[250px] w-full overflow-y-auto"
|
|
199
|
+
>
|
|
200
|
+
<li
|
|
201
|
+
v-for="(item, idx) in autocompleteList"
|
|
202
|
+
:key="idx"
|
|
203
|
+
class="cursor-pointer rounded px-4 py-[10px] transition-colors hover:bg-gray-50 hover:dark:bg-gray-900"
|
|
204
|
+
:class="{ 'bg-gray-100 dark:bg-gray-700': currentItemIndex === idx }"
|
|
205
|
+
@mousedown="onSelectOption(item)"
|
|
206
|
+
@touchend="onSelectOptionMobile(item)"
|
|
207
|
+
@touchmove="mobileAutocomMoved = true"
|
|
208
|
+
>
|
|
209
|
+
<slot
|
|
210
|
+
name="autocomplete-option"
|
|
211
|
+
:item="item"
|
|
212
|
+
>
|
|
213
|
+
{{ autocompleteOption ? item[autocompleteOption] : item }}
|
|
214
|
+
</slot>
|
|
215
|
+
</li>
|
|
216
|
+
</ul>
|
|
217
|
+
<slot
|
|
218
|
+
name="autocomplete-buttons"
|
|
219
|
+
:value="modelValue"
|
|
220
|
+
/>
|
|
221
|
+
</div>
|
|
222
|
+
</Transition>
|
|
223
|
+
<input
|
|
224
|
+
:id="label"
|
|
225
|
+
ref="input"
|
|
226
|
+
v-model="modelValue"
|
|
227
|
+
:type="type"
|
|
228
|
+
:class="inputClass"
|
|
229
|
+
class="input"
|
|
230
|
+
required
|
|
231
|
+
:tabindex="disabled ? -1 : 0"
|
|
232
|
+
v-bind="$attrs"
|
|
233
|
+
@input="emit('updateValue', modelValue)"
|
|
234
|
+
@keydown="handleKeydown"
|
|
235
|
+
@focus="isFocused = true"
|
|
236
|
+
@blur="isFocused = false"
|
|
237
|
+
>
|
|
238
|
+
<label
|
|
239
|
+
:for="label"
|
|
240
|
+
:class="[labelClass]"
|
|
241
|
+
class="label"
|
|
242
|
+
>
|
|
243
|
+
<span class="text">{{ label }}</span>
|
|
244
|
+
<span
|
|
245
|
+
v-if="required"
|
|
246
|
+
class="text-red-600"
|
|
247
|
+
> *</span>
|
|
248
|
+
</label>
|
|
249
|
+
|
|
250
|
+
<component
|
|
251
|
+
:is="startIcon"
|
|
252
|
+
v-if="startIcon"
|
|
253
|
+
class="pointer-events-none absolute left-4 top-1/2 translate-y-[-50%] transform fill-gray-500 text-base text-gray-500"
|
|
254
|
+
filled
|
|
255
|
+
/>
|
|
256
|
+
<component
|
|
257
|
+
:is="endIcon"
|
|
258
|
+
v-if="endIcon"
|
|
259
|
+
class="pointer-events-none absolute right-4 top-1/2 translate-y-[-50%] transform fill-gray-500 text-base text-gray-500"
|
|
260
|
+
filled
|
|
261
|
+
/>
|
|
262
|
+
<button
|
|
263
|
+
v-if="isClearable"
|
|
264
|
+
class="pointer-events-click absolute right-4 top-1/2 translate-y-[-50%] transform rounded-full bg-deepblue-900 bg-opacity-10 p-1 text-2xl hover:opacity-80 dark:bg-gray-200 dark:bg-opacity-10"
|
|
265
|
+
type="button"
|
|
266
|
+
@click="onClear"
|
|
267
|
+
>
|
|
268
|
+
<i-x-mark
|
|
269
|
+
filled
|
|
270
|
+
class="!mb-0 fill-gray-600 dark:fill-gray-300"
|
|
271
|
+
/>
|
|
272
|
+
</button>
|
|
273
|
+
<slot name="endButton" />
|
|
274
|
+
</div>
|
|
275
|
+
<Transition name="slide-in">
|
|
276
|
+
<div
|
|
277
|
+
v-if="error && typeof error === 'string'"
|
|
278
|
+
class="mt-1"
|
|
279
|
+
>
|
|
280
|
+
<a-alert
|
|
281
|
+
:size="size === 'sm' ? 'xs' : 'sm'"
|
|
282
|
+
:color="'red'"
|
|
283
|
+
icon-type="triangle"
|
|
284
|
+
>
|
|
285
|
+
<template #default>
|
|
286
|
+
<div class="flex flex-col">
|
|
287
|
+
<span
|
|
288
|
+
v-for="(err, index) in error.split(', ')"
|
|
289
|
+
:key="index"
|
|
290
|
+
>{{ err }}<br></span>
|
|
291
|
+
</div>
|
|
292
|
+
</template>
|
|
293
|
+
</a-alert>
|
|
294
|
+
</div>
|
|
295
|
+
</Transition>
|
|
296
|
+
</div>
|
|
297
|
+
</template>
|
|
298
|
+
|
|
299
|
+
<style scoped>
|
|
300
|
+
.input:-webkit-autofill~.label,.input:focus~.label,.input:not(:focus):valid~.label{font-size:10px;transform:translateY(-10px)}.input.sm:-webkit-autofill~.label,.input.sm:focus~.label,.input.sm:not(:focus):valid~.label{display:none}.input::-ms-clear,.input::-ms-reveal{display:none}.slide-in-enter-active{opacity:0;transform:translateY(-50%);transition:transform .5s;z-index:0}.slide-in-enter-to{z-index:auto}.slide-in-enter-to,.slide-in-leave-active{opacity:1;transform:translateY(0)}.slide-in-leave-to{opacity:0;transform:translateY(-100%)}.autocomplete-fade-enter-active,.autocomplete-fade-leave-active{transition:opacity .15s ease}.autocomplete-fade-enter-from,.autocomplete-fade-leave-to{opacity:0}.move-input{padding-left:40px!important}
|
|
301
|
+
</style>
|
|
File without changes
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { twMerge, twJoin } from "tailwind-merge";
|
|
3
|
+
import AAlert from "../../../Alert.vue";
|
|
4
|
+
import { computed } from "#imports";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
7
|
+
label: { type: String, required: false, default: "" },
|
|
8
|
+
size: { type: String, required: false, default: "md" },
|
|
9
|
+
error: { type: [String, Boolean], required: false, default: false },
|
|
10
|
+
required: { type: Boolean, required: false, default: false },
|
|
11
|
+
readonly: { type: Boolean, required: false, default: false },
|
|
12
|
+
clearable: { type: Boolean, required: false, default: false },
|
|
13
|
+
resizeable: { type: [Boolean, String], required: false, default: true },
|
|
14
|
+
startIcon: { type: [String, Object], required: false, default: "" },
|
|
15
|
+
colorClasses: { type: String, required: false, default: "" }
|
|
16
|
+
});
|
|
17
|
+
const uiConfig = {
|
|
18
|
+
"wrapper": "transition duration-500 w-full",
|
|
19
|
+
"input-wrapper": {
|
|
20
|
+
base: "relative inline-block h-full w-full text-sm sm:min-w-full pt-5 hover:outline hover:outline-1 outline-offset-[-1px] hover:outline-blue-700 hover:dark:outline-blue-500 focus:outline focus:outline-blue-700 focus:dark:outline-blue-500",
|
|
21
|
+
readonly: "pointer-events-none user-select-none",
|
|
22
|
+
disabled: "pointer-events-none user-select-none opacity-40",
|
|
23
|
+
color: "bg-deepblue-900/5 dark:bg-gray-200/5"
|
|
24
|
+
},
|
|
25
|
+
"base": "w-full border-0 rounded-md text-deepblue-900 dark:text-gray-200 outline-none mt-0",
|
|
26
|
+
"size": {
|
|
27
|
+
sm: "h-8 px-4 py-1.5 sm",
|
|
28
|
+
md: "h-10 px-4 pb-1.5 pt-[8px] md"
|
|
29
|
+
},
|
|
30
|
+
"color": "bg-deepblue-900/0 dark:bg-gray-200/0",
|
|
31
|
+
"error": "outline outline-1 outline-red-500 focus:outline-0 focus:border-red-500 hover:border-red-500",
|
|
32
|
+
"readonly": "bg-white opacity-30",
|
|
33
|
+
"label": {
|
|
34
|
+
"base": "absolute left-4 top-5 d-flex text-gray-500 pointer-events-none transition-all ease duration-300 transform translate-y-[-50%] whitespace-nowrap",
|
|
35
|
+
"move-label": "!left-10"
|
|
36
|
+
},
|
|
37
|
+
"default": {
|
|
38
|
+
size: "md",
|
|
39
|
+
color: "gray"
|
|
40
|
+
},
|
|
41
|
+
"resize": {
|
|
42
|
+
none: "resize-none",
|
|
43
|
+
both: "resize",
|
|
44
|
+
x: "resize-x",
|
|
45
|
+
y: "resize-y"
|
|
46
|
+
},
|
|
47
|
+
"move-input": "!ps-10"
|
|
48
|
+
};
|
|
49
|
+
const modelValue = defineModel({ type: [String, Number], ...{ default: "" } });
|
|
50
|
+
const isClearable = computed(
|
|
51
|
+
() => props.clearable && !props.disabled && !!modelValue.value
|
|
52
|
+
);
|
|
53
|
+
const isResizeable = computed(
|
|
54
|
+
() => props.resizeable && props.resizeable !== "none" && !props.disabled && !!modelValue.value
|
|
55
|
+
);
|
|
56
|
+
const resizeable = computed(() => {
|
|
57
|
+
if (typeof props.resizeable === "boolean") return props.resizeable ? "both" : "none";
|
|
58
|
+
return props.resizeable;
|
|
59
|
+
});
|
|
60
|
+
const wrapperClass = uiConfig.wrapper;
|
|
61
|
+
const inputWrapperClass = computed(
|
|
62
|
+
() => twMerge(
|
|
63
|
+
twJoin(
|
|
64
|
+
uiConfig["input-wrapper"].base,
|
|
65
|
+
uiConfig.base,
|
|
66
|
+
props.colorClasses ? props.colorClasses : uiConfig["input-wrapper"].color,
|
|
67
|
+
props.error ? uiConfig.error : "",
|
|
68
|
+
props.readonly ? uiConfig["input-wrapper"].readonly : "",
|
|
69
|
+
props.disabled ? uiConfig["input-wrapper"].disabled : ""
|
|
70
|
+
)
|
|
71
|
+
)
|
|
72
|
+
);
|
|
73
|
+
const inputClass = computed(
|
|
74
|
+
() => twMerge(
|
|
75
|
+
twJoin(
|
|
76
|
+
uiConfig.base,
|
|
77
|
+
uiConfig.color,
|
|
78
|
+
uiConfig.size[props.size],
|
|
79
|
+
props.startIcon ? uiConfig["move-input"] : "",
|
|
80
|
+
props.readonly ? uiConfig.readonly : "",
|
|
81
|
+
isResizeable.value ? uiConfig.resize[resizeable] : uiConfig.resize.none
|
|
82
|
+
)
|
|
83
|
+
)
|
|
84
|
+
);
|
|
85
|
+
const labelClass = computed(
|
|
86
|
+
() => twMerge(twJoin(uiConfig.label.base, props.startIcon ? uiConfig.label["move-label"] : ""))
|
|
87
|
+
);
|
|
88
|
+
</script>
|
|
89
|
+
|
|
90
|
+
<template>
|
|
91
|
+
<div :class="wrapperClass">
|
|
92
|
+
<div :class="inputWrapperClass">
|
|
93
|
+
<textarea
|
|
94
|
+
:id="label"
|
|
95
|
+
ref="input"
|
|
96
|
+
v-model="modelValue"
|
|
97
|
+
:class="inputClass"
|
|
98
|
+
:tabindex="disabled ? -1 : 0"
|
|
99
|
+
class="input"
|
|
100
|
+
required
|
|
101
|
+
v-bind="$attrs"
|
|
102
|
+
/>
|
|
103
|
+
<label
|
|
104
|
+
:class="labelClass"
|
|
105
|
+
:for="label"
|
|
106
|
+
class="label cursor-pointer"
|
|
107
|
+
>
|
|
108
|
+
<span class="text">{{ label }}</span>
|
|
109
|
+
<span
|
|
110
|
+
v-if="required"
|
|
111
|
+
class="text-red-600"
|
|
112
|
+
> *</span>
|
|
113
|
+
</label>
|
|
114
|
+
|
|
115
|
+
<component
|
|
116
|
+
:is="startIcon"
|
|
117
|
+
v-if="startIcon"
|
|
118
|
+
class="pointer-events-none absolute left-4 top-5 translate-y-[-50%] transform fill-gray-500 text-base text-gray-500"
|
|
119
|
+
filled
|
|
120
|
+
/>
|
|
121
|
+
<button
|
|
122
|
+
v-if="isClearable"
|
|
123
|
+
class="pointer-events-click absolute right-4 top-5 translate-y-[-50%] transform rounded-full bg-deepblue-900 bg-opacity-10 p-1 text-2xl hover:opacity-80 dark:bg-gray-200 dark:bg-opacity-10"
|
|
124
|
+
type="button"
|
|
125
|
+
@click="modelValue = ''"
|
|
126
|
+
>
|
|
127
|
+
<i-x-mark
|
|
128
|
+
class="!mb-0 fill-gray-600 dark:fill-gray-300"
|
|
129
|
+
filled
|
|
130
|
+
/>
|
|
131
|
+
</button>
|
|
132
|
+
<slot name="endButton" />
|
|
133
|
+
</div>
|
|
134
|
+
<Transition name="slide-in">
|
|
135
|
+
<div
|
|
136
|
+
v-if="error && typeof error === 'string'"
|
|
137
|
+
class="mt-1"
|
|
138
|
+
>
|
|
139
|
+
<a-alert
|
|
140
|
+
:color="'red'"
|
|
141
|
+
:size="size === 'sm' ? 'sm' : 'lg'"
|
|
142
|
+
icon-type="triangle"
|
|
143
|
+
>
|
|
144
|
+
<template #default>
|
|
145
|
+
<span
|
|
146
|
+
v-for="(err, index) in error.split(', ')"
|
|
147
|
+
:key="index"
|
|
148
|
+
>{{ err }}<br></span>
|
|
149
|
+
</template>
|
|
150
|
+
</a-alert>
|
|
151
|
+
</div>
|
|
152
|
+
</Transition>
|
|
153
|
+
</div>
|
|
154
|
+
</template>
|
|
155
|
+
|
|
156
|
+
<style scoped>
|
|
157
|
+
.input::-webkit-scrollbar{display:none}.input:-webkit-autofill~.label,.input:focus~.label,.input:not(:focus):valid~.label{font-size:10px;transform:translateY(-10px)}.slide-in-enter-active{opacity:0;transform:translateY(-50%);transition:transform .5s;z-index:0}.slide-in-enter-to{z-index:auto}.slide-in-enter-to,.slide-in-leave-active{opacity:1;transform:translateY(0)}.slide-in-leave-to{opacity:0;transform:translateY(-100%)}.move-input{padding-left:40px!important}
|
|
158
|
+
</style>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
disabled?: boolean;
|
|
3
|
+
label?: string;
|
|
4
|
+
size?: 'sm' | 'md';
|
|
5
|
+
error?: string | boolean;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
readonly?: boolean;
|
|
8
|
+
clearable?: boolean;
|
|
9
|
+
resizeable?: boolean | 'none' | 'both' | 'x' | 'y';
|
|
10
|
+
startIcon?: string | object;
|
|
11
|
+
colorClasses?: string;
|
|
12
|
+
}
|
|
13
|
+
type __VLS_Props = Props;
|
|
14
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
15
|
+
modelValue?: string | number;
|
|
16
|
+
};
|
|
17
|
+
declare var __VLS_9: {};
|
|
18
|
+
type __VLS_Slots = {} & {
|
|
19
|
+
endButton?: (props: typeof __VLS_9) => any;
|
|
20
|
+
};
|
|
21
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
|
+
"update:modelValue": (value: string | number) => any;
|
|
23
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
24
|
+
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
25
|
+
}>, {
|
|
26
|
+
size: "sm" | "md";
|
|
27
|
+
error: string | boolean;
|
|
28
|
+
disabled: boolean;
|
|
29
|
+
required: boolean;
|
|
30
|
+
label: string;
|
|
31
|
+
readonly: boolean;
|
|
32
|
+
clearable: boolean;
|
|
33
|
+
startIcon: string | object;
|
|
34
|
+
colorClasses: string;
|
|
35
|
+
resizeable: boolean | "none" | "both" | "x" | "y";
|
|
36
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
37
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
38
|
+
export default _default;
|
|
39
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
40
|
+
new (): {
|
|
41
|
+
$slots: S;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, useI18n, watch } from "#imports";
|
|
3
|
+
const { t } = useI18n();
|
|
4
|
+
const mail = ref("");
|
|
5
|
+
const phone = ref("");
|
|
6
|
+
const comment = ref("");
|
|
7
|
+
const isLoading = defineModel("isLoading", { type: Boolean, ...{ default: false } });
|
|
8
|
+
const emit = defineEmits(["submit"]);
|
|
9
|
+
const isSend = ref(false);
|
|
10
|
+
function validatePhone(value) {
|
|
11
|
+
if (!value) return t("forms.feedback.fieldRequired");
|
|
12
|
+
if (value.length < 11) return t("forms.feedback.phoneMinLength");
|
|
13
|
+
}
|
|
14
|
+
function validateEmail(value) {
|
|
15
|
+
if (!value) return t("forms.feedback.fieldRequired");
|
|
16
|
+
if (!value.includes("@")) return t("forms.feedback.emailValid");
|
|
17
|
+
}
|
|
18
|
+
function validateComment(value) {
|
|
19
|
+
if (!value) return t("forms.feedback.fieldRequired");
|
|
20
|
+
if (value.length < 10) return t("forms.feedback.commentMinLength");
|
|
21
|
+
if (value.length > 250) return t("forms.feedback.commentMaxLength");
|
|
22
|
+
}
|
|
23
|
+
const phoneValidation = ref("");
|
|
24
|
+
const emailValidation = ref("");
|
|
25
|
+
const commentValidation = ref("");
|
|
26
|
+
const send = () => {
|
|
27
|
+
phoneValidation.value = validatePhone(phone.value);
|
|
28
|
+
emailValidation.value = validateEmail(mail.value);
|
|
29
|
+
commentValidation.value = validateComment(comment.value);
|
|
30
|
+
isSend.value = false;
|
|
31
|
+
if (phoneValidation.value || emailValidation.value || commentValidation.value) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
emit("submit", { phone: phone.value, mail: mail.value, comment: comment.value });
|
|
35
|
+
isSend.value = true;
|
|
36
|
+
phone.value = "";
|
|
37
|
+
mail.value = "";
|
|
38
|
+
comment.value = "";
|
|
39
|
+
phoneValidation.value = "";
|
|
40
|
+
emailValidation.value = "";
|
|
41
|
+
commentValidation.value = "";
|
|
42
|
+
};
|
|
43
|
+
watch(mail, (newMail) => {
|
|
44
|
+
if (isSend.value) return;
|
|
45
|
+
emailValidation.value = validateEmail(newMail);
|
|
46
|
+
});
|
|
47
|
+
watch(phone, (newPhone) => {
|
|
48
|
+
if (isSend.value) return;
|
|
49
|
+
phoneValidation.value = validatePhone(newPhone);
|
|
50
|
+
});
|
|
51
|
+
watch(comment, (newComment) => {
|
|
52
|
+
if (isSend.value) return;
|
|
53
|
+
commentValidation.value = validateComment(newComment);
|
|
54
|
+
});
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<template>
|
|
58
|
+
<div class="flex flex-col gap-4 sm:gap-8 bg-white p-8 dark:bg-gray-900 sm:rounded-[20px]">
|
|
59
|
+
<div class="flex flex-col gap-2">
|
|
60
|
+
<h2 class="font-bold text-[2rem] leading-10">
|
|
61
|
+
{{ t("forms.feedback.title") }}
|
|
62
|
+
</h2>
|
|
63
|
+
<p class="body-400 text-gray-600 dark:text-gray-200">
|
|
64
|
+
{{ t("forms.feedback.subtitle") }}
|
|
65
|
+
</p>
|
|
66
|
+
</div>
|
|
67
|
+
<form
|
|
68
|
+
action=""
|
|
69
|
+
class="flex flex-col justify-between gap-2 sm:flex-row sm:gap-4"
|
|
70
|
+
>
|
|
71
|
+
<div class="flex flex-col gap-2 sm:w-1/2 sm:gap-4">
|
|
72
|
+
<adt-forms-input-standard
|
|
73
|
+
v-model="mail"
|
|
74
|
+
type="email"
|
|
75
|
+
color-classes="bg-gray-50 dark:bg-gray-800"
|
|
76
|
+
:error="emailValidation"
|
|
77
|
+
:label="t('forms.feedback.email')"
|
|
78
|
+
required
|
|
79
|
+
size="md"
|
|
80
|
+
/>
|
|
81
|
+
<adt-forms-input-standard
|
|
82
|
+
v-model="phone"
|
|
83
|
+
v-maska
|
|
84
|
+
type="tel"
|
|
85
|
+
color-classes="bg-gray-50 dark:bg-gray-800"
|
|
86
|
+
:error="phoneValidation"
|
|
87
|
+
:label="t('forms.feedback.phone')"
|
|
88
|
+
data-maska="8 (###) ###-##-##"
|
|
89
|
+
required
|
|
90
|
+
size="md"
|
|
91
|
+
/>
|
|
92
|
+
</div>
|
|
93
|
+
<div class="sm:w-1/2">
|
|
94
|
+
<lazy-adt-forms-input-textarea-a-textarea
|
|
95
|
+
v-model="comment"
|
|
96
|
+
:error="commentValidation"
|
|
97
|
+
:label="t('forms.feedback.comment')"
|
|
98
|
+
:resizeable="false"
|
|
99
|
+
class="min-h-[72px]"
|
|
100
|
+
color-classes="dark:bg-gray-800 bg-gray-50"
|
|
101
|
+
required
|
|
102
|
+
size="sm"
|
|
103
|
+
/>
|
|
104
|
+
</div>
|
|
105
|
+
</form>
|
|
106
|
+
<adt-button
|
|
107
|
+
class="w-full self-end sm:w-[215px] font-semibold"
|
|
108
|
+
:loading="isLoading"
|
|
109
|
+
@click="send"
|
|
110
|
+
>
|
|
111
|
+
{{ t("forms.feedback.send") }}
|
|
112
|
+
</adt-button>
|
|
113
|
+
</div>
|
|
114
|
+
</template>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
type __VLS_PublicProps = {
|
|
2
|
+
'isLoading'?: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import AButton from "../../button/Button.vue";
|
|
3
|
+
import InputStandard from "../input/standard/InputStandard.vue";
|
|
4
|
+
import ATextarea from "../input/textarea/ATextarea.vue";
|
|
5
|
+
import { ref, useI18n } from "#imports";
|
|
6
|
+
const emit = defineEmits(["onSend"]);
|
|
7
|
+
const { t } = useI18n();
|
|
8
|
+
const isLoading = defineModel("loading", { type: Boolean, ...{ default: false } });
|
|
9
|
+
const isModalOpen = defineModel("modal", { type: Boolean, ...{ default: false } });
|
|
10
|
+
const fullName = ref("");
|
|
11
|
+
const phone = ref("");
|
|
12
|
+
const comment = ref("");
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<div class="flex flex-col gap-8 rounded-[20px] bg-white p-8 dark:bg-gray-900">
|
|
17
|
+
<div class="flex flex-col gap-2">
|
|
18
|
+
<h3 class="font-bold text-[2rem] leading-10">
|
|
19
|
+
{{ t("forms.demo.t") }}
|
|
20
|
+
</h3>
|
|
21
|
+
<p class="text-base">
|
|
22
|
+
{{ t("forms.demo.st") }}
|
|
23
|
+
</p>
|
|
24
|
+
</div>
|
|
25
|
+
<form
|
|
26
|
+
action=""
|
|
27
|
+
class="flex flex-col justify-between gap-2 sm:flex-row sm:gap-4"
|
|
28
|
+
>
|
|
29
|
+
<div class="flex flex-col gap-2 sm:w-1/2 sm:gap-4">
|
|
30
|
+
<input-standard
|
|
31
|
+
v-model="fullName"
|
|
32
|
+
color-classes="bg-gray-50 dark:bg-gray-800"
|
|
33
|
+
:label="t('forms.demo.n')"
|
|
34
|
+
required
|
|
35
|
+
size="md"
|
|
36
|
+
:disabled="isLoading"
|
|
37
|
+
/>
|
|
38
|
+
<input-standard
|
|
39
|
+
v-model="phone"
|
|
40
|
+
v-maska
|
|
41
|
+
color-classes="bg-gray-50 dark:bg-gray-800"
|
|
42
|
+
type="tel"
|
|
43
|
+
:label="t('forms.demo.p')"
|
|
44
|
+
data-maska="8 (###) ###-##-##"
|
|
45
|
+
required
|
|
46
|
+
size="md"
|
|
47
|
+
:disabled="isLoading"
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="sm:w-1/2">
|
|
51
|
+
<a-textarea
|
|
52
|
+
v-model="comment"
|
|
53
|
+
:label="t('forms.demo.c')"
|
|
54
|
+
:resizeable="false"
|
|
55
|
+
class="min-h-[72px]"
|
|
56
|
+
color-classes="dark:bg-gray-800 bg-gray-50"
|
|
57
|
+
required
|
|
58
|
+
size="sm"
|
|
59
|
+
:disabled="isLoading"
|
|
60
|
+
/>
|
|
61
|
+
</div>
|
|
62
|
+
</form>
|
|
63
|
+
<a-button class="w-full self-end sm:w-[215px] font-semibold" :disabled="isLoading">
|
|
64
|
+
{{ t("forms.demo.b") }}
|
|
65
|
+
</a-button>
|
|
66
|
+
</div>
|
|
67
|
+
</template>
|