@nmorph/nmorph-ui-kit 2.2.38 → 2.2.40
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/components/basic/nmorph-button/NmorphButton.css +1 -1
- package/dist/components/basic/nmorph-button/NmorphButton.vue.js +13 -10
- package/dist/components/basic/nmorph-button/NmorphButton.vue2.js +4 -4
- package/dist/components/basic/nmorph-layout/NmorphLayout.vue2.js +12 -10
- package/dist/components/basic/nmorph-link/NmorphLink.vue2.js +19 -16
- package/dist/components/data/nmorph-badge/NmorphBadge.css +1 -1
- package/dist/components/data/nmorph-badge/NmorphBadge.vue2.js +30 -26
- package/dist/components/data/nmorph-calendar/NmorphCalendar.vue2.js +42 -40
- package/dist/components/data/nmorph-card/NmorphCard.vue2.js +6 -6
- package/dist/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue2.js +24 -21
- package/dist/components/data/nmorph-empty/NmorphEmpty.vue2.js +23 -21
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.css +1 -1
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue.js +121 -73
- package/dist/components/data/nmorph-image-preview/NmorphImagePreview.vue2.js +105 -78
- package/dist/components/data/nmorph-progress/NmorphProgress.vue2.js +18 -14
- package/dist/components/data/nmorph-qr-code/NmorphQRCode.vue2.js +15 -11
- package/dist/components/data/nmorph-skeleton/NmorphSkeleton.vue2.js +15 -12
- package/dist/components/data/nmorph-table/NmorphTable.vue2.js +44 -40
- package/dist/components/data/nmorph-tag-list/NmorphTagList.vue.js +7 -7
- package/dist/components/data/nmorph-tag-list/NmorphTagList.vue2.js +22 -16
- package/dist/components/data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.css +1 -1
- package/dist/components/data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue2.js +9 -9
- package/dist/components/data/nmorph-virtual-list/NmorphVirtualList.vue2.js +21 -19
- package/dist/components/feedback/nmorph-alert/NmorphAlert.vue2.js +27 -24
- package/dist/components/feedback/nmorph-callout/NmorphCallout.vue2.js +19 -15
- package/dist/components/feedback/nmorph-drawer/NmorphDrawer.vue2.js +10 -8
- package/dist/components/feedback/nmorph-tooltip/NmorphTooltip.vue2.js +25 -23
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +8 -8
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.vue2.js +4 -4
- package/dist/components/form/nmorph-color-picker/NmorphColorPicker.vue.js +18 -22
- package/dist/components/form/nmorph-color-picker/NmorphColorPicker.vue2.js +42 -33
- package/dist/components/form/nmorph-date-picker/NmorphDatePicker.vue2.js +32 -32
- package/dist/components/form/nmorph-file-upload/NmorphFileUpload.css +1 -1
- package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue2.js +77 -106
- package/dist/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.css +1 -1
- package/dist/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/NmorphErrorBox.vue2.js +4 -4
- package/dist/components/form/nmorph-number-input/NmorphNumberInput.vue2.js +7 -7
- package/dist/components/form/nmorph-otp-input/NmorphOTPInput.vue2.js +6 -6
- package/dist/components/form/nmorph-radio/NmorphRadio.vue2.js +1 -1
- package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +51 -49
- package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue2.js +21 -18
- package/dist/components/form/nmorph-select-button/NmorphSelectButton.vue2.js +28 -24
- package/dist/components/form/nmorph-slider/NmorphSlider.vue2.js +30 -30
- package/dist/components/form/nmorph-switch/NmorphSwitch.vue2.js +34 -32
- package/dist/components/form/nmorph-text-input/NmorphTextInput.vue.js +16 -16
- package/dist/components/form/nmorph-text-input/NmorphTextInput.vue2.js +37 -35
- package/dist/components/form/nmorph-textarea/NmorphTextarea.vue.js +12 -12
- package/dist/components/form/nmorph-textarea/NmorphTextarea.vue2.js +34 -32
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue.js +16 -16
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue2.js +64 -57
- package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.js +27 -22
- package/dist/components/navigation/nmorph-context-menu/NmorphContextMenu.vue2.js +75 -46
- package/dist/components/navigation/nmorph-dropdown/NmorphDropdown.vue2.js +25 -23
- package/dist/hooks/use-field-validation.js +50 -66
- package/dist/hooks/use-focusable-input.js +27 -0
- package/dist/hooks/use-nmorph-translation.js +4 -4
- package/dist/hooks/use-placement.js +65 -61
- package/dist/index.es.js +842 -837
- package/dist/index.umd.js +36 -36
- package/dist/package.json.js +1 -1
- package/dist/plugin.js +47 -42
- package/dist/src/components/basic/nmorph-button/NmorphButton.vue.d.ts +4 -17
- package/dist/src/components/basic/nmorph-button/types.d.ts +13 -0
- package/dist/src/components/basic/nmorph-icon/NmorphIcon.vue.d.ts +3 -9
- package/dist/src/components/basic/nmorph-icon/types.d.ts +6 -0
- package/dist/src/components/basic/nmorph-layout/NmorphLayout.vue.d.ts +2 -9
- package/dist/src/components/basic/nmorph-layout/types.d.ts +8 -0
- package/dist/src/components/basic/nmorph-link/NmorphLink.vue.d.ts +3 -14
- package/dist/src/components/basic/nmorph-link/types.d.ts +11 -0
- package/dist/src/components/basic/nmorph-scroll/NmorphScroll.vue.d.ts +2 -2
- package/dist/src/components/basic/nmorph-scroll/types.d.ts +5 -0
- package/dist/src/components/basic/nmorph-space/NmorphSpace.vue.d.ts +2 -15
- package/dist/src/components/basic/nmorph-space/types.d.ts +14 -0
- package/dist/src/components/data/nmorph-avatar/NmorphAvatar.vue.d.ts +5 -20
- package/dist/src/components/data/nmorph-avatar/types.d.ts +21 -0
- package/dist/src/components/data/nmorph-badge/NmorphBadge.vue.d.ts +5 -40
- package/dist/src/components/data/nmorph-badge/types.d.ts +34 -0
- package/dist/src/components/data/nmorph-calendar/NmorphCalendar.vue.d.ts +4 -12
- package/dist/src/components/data/nmorph-calendar/inner-components/nmorph-calendar-header/NmorphCalendarHeader.vue.d.ts +3 -9
- package/dist/src/components/data/nmorph-calendar/inner-components/nmorph-calendar-header/types.d.ts +12 -0
- package/dist/src/components/data/nmorph-calendar/types.d.ts +13 -0
- package/dist/src/components/data/nmorph-card/NmorphCard.vue.d.ts +2 -10
- package/dist/src/components/data/nmorph-card/types.d.ts +9 -0
- package/dist/src/components/data/nmorph-carousel/NmorphCarousel.vue.d.ts +3 -5
- package/dist/src/components/data/nmorph-carousel/components/nmorph-carousel-item/NmorphCarouselItem.vue.d.ts +2 -4
- package/dist/src/components/data/nmorph-carousel/components/nmorph-carousel-item/types.d.ts +3 -0
- package/dist/src/components/data/nmorph-carousel/types.d.ts +6 -0
- package/dist/src/components/data/nmorph-collapse/NmorphCollapse.vue.d.ts +3 -7
- package/dist/src/components/data/nmorph-collapse/components/nmorph-collapse-item/NmorphCollapseItem.vue.d.ts +4 -10
- package/dist/src/components/data/nmorph-collapse/components/nmorph-collapse-item/types.d.ts +13 -0
- package/dist/src/components/data/nmorph-collapse/types.d.ts +7 -0
- package/dist/src/components/data/nmorph-empty/NmorphEmpty.vue.d.ts +3 -12
- package/dist/src/components/data/nmorph-empty/types.d.ts +11 -0
- package/dist/src/components/data/nmorph-image/NmorphImage.vue.d.ts +3 -8
- package/dist/src/components/data/nmorph-image/types.d.ts +10 -0
- package/dist/src/components/data/nmorph-image-preview/NmorphImagePreview.vue.d.ts +9 -18
- package/dist/src/components/data/nmorph-image-preview/types.d.ts +23 -0
- package/dist/src/components/data/nmorph-pagination/NmorphPagination.vue.d.ts +3 -13
- package/dist/src/components/data/nmorph-pagination/types.d.ts +14 -0
- package/dist/src/components/data/nmorph-progress/NmorphProgress.vue.d.ts +3 -15
- package/dist/src/components/data/nmorph-progress/types.d.ts +12 -0
- package/dist/src/components/data/nmorph-qr-code/NmorphQRCode.vue.d.ts +5 -15
- package/dist/src/components/data/nmorph-qr-code/types.d.ts +12 -0
- package/dist/src/components/data/nmorph-skeleton/NmorphSkeleton.vue.d.ts +2 -7
- package/dist/src/components/data/nmorph-skeleton/components/NmorphSkeletonItem.vue.d.ts +3 -9
- package/dist/src/components/data/nmorph-skeleton/components/types.d.ts +8 -0
- package/dist/src/components/data/nmorph-skeleton/types.d.ts +6 -0
- package/dist/src/components/data/nmorph-table/NmorphTable.vue.d.ts +4 -18
- package/dist/src/components/data/nmorph-table/components/nmorph-table-cell/NmorphTableCell.vue.d.ts +2 -4
- package/dist/src/components/data/nmorph-table/components/nmorph-table-cell/types.d.ts +3 -0
- package/dist/src/components/data/nmorph-table/components/nmorph-table-column/NmorphTableColumn.vue.d.ts +4 -5
- package/dist/src/components/data/nmorph-table/components/nmorph-table-column/types.d.ts +3 -0
- package/dist/src/components/data/nmorph-table/inner-components/nmorph-sort-button/NmorphSortButton.vue.d.ts +4 -6
- package/dist/src/components/data/nmorph-table/inner-components/nmorph-sort-button/types.d.ts +7 -0
- package/dist/src/components/data/nmorph-table/types.d.ts +15 -0
- package/dist/src/components/data/nmorph-tag-list/NmorphTagList.vue.d.ts +9 -9
- package/dist/src/components/data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.d.ts +3 -5
- package/dist/src/components/data/nmorph-tag-list/components/nmorph-tag-item/types.d.ts +6 -0
- package/dist/src/components/data/nmorph-tag-list/types.d.ts +8 -0
- package/dist/src/components/data/nmorph-virtual-list/NmorphVirtualList.vue.d.ts +3 -14
- package/dist/src/components/data/nmorph-virtual-list/types.d.ts +15 -0
- package/dist/src/components/feedback/nmorph-alert/NmorphAlert.vue.d.ts +5 -7
- package/dist/src/components/feedback/nmorph-alert/types.d.ts +5 -0
- package/dist/src/components/feedback/nmorph-callout/NmorphCallout.vue.d.ts +4 -16
- package/dist/src/components/feedback/nmorph-callout/types.d.ts +12 -0
- package/dist/src/components/feedback/nmorph-dialog/NmorphDialog.vue.d.ts +4 -19
- package/dist/src/components/feedback/nmorph-dialog/types.d.ts +20 -0
- package/dist/src/components/feedback/nmorph-drawer/NmorphDrawer.vue.d.ts +4 -17
- package/dist/src/components/feedback/nmorph-drawer/types.d.ts +18 -0
- package/dist/src/components/feedback/nmorph-tooltip/NmorphTooltip.vue.d.ts +5 -14
- package/dist/src/components/feedback/nmorph-tooltip/types.d.ts +11 -0
- package/dist/src/components/form/nmorph-autocomplete/NmorphAutocomplete.vue.d.ts +6 -19
- package/dist/src/components/form/nmorph-autocomplete/types.d.ts +18 -0
- package/dist/src/components/form/nmorph-checkbox/NmorphCheckbox.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-checkbox/types.d.ts +3 -0
- package/dist/src/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue.d.ts +4 -10
- package/dist/src/components/form/nmorph-checkbox-group/types.d.ts +11 -0
- package/dist/src/components/form/nmorph-color-picker/NmorphColorPicker.vue.d.ts +6 -11
- package/dist/src/components/form/nmorph-color-picker/types.d.ts +11 -0
- package/dist/src/components/form/nmorph-date-picker/NmorphDatePicker.vue.d.ts +4 -20
- package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-clear-button/types.d.ts +3 -0
- package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/NmorphDatePickerContent.vue.d.ts +3 -8
- package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-content/types.d.ts +10 -0
- package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-header/NmorphDatePickerHeader.vue.d.ts +3 -6
- package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-date-picker-header/types.d.ts +12 -0
- package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-year-month-picker/NmorphYearMonthPicker.vue.d.ts +3 -6
- package/dist/src/components/form/nmorph-date-picker/inner-components/nmorph-year-month-picker/types.d.ts +9 -0
- package/dist/src/components/form/nmorph-date-picker/types.d.ts +21 -0
- package/dist/src/components/form/nmorph-file-upload/NmorphFileUpload.vue.d.ts +5 -13
- package/dist/src/components/form/nmorph-file-upload/types.d.ts +17 -0
- package/dist/src/components/form/nmorph-form/NmorphForm.vue.d.ts +4 -8
- package/dist/src/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.vue.d.ts +3 -12
- package/dist/src/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/NmorphErrorBox.vue.d.ts +3 -8
- package/dist/src/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-error-box/types.d.ts +7 -0
- package/dist/src/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-validation-icon/NmorphValidationIcon.vue.d.ts +3 -6
- package/dist/src/components/form/nmorph-form/components/nmorph-form-item/inner-components/nmorph-validation-icon/types.d.ts +5 -0
- package/dist/src/components/form/nmorph-form/components/nmorph-form-item/types.d.ts +10 -0
- package/dist/src/components/form/nmorph-form/types.d.ts +6 -1
- package/dist/src/components/form/nmorph-number-input/NmorphNumberInput.vue.d.ts +3 -10
- package/dist/src/components/form/nmorph-number-input/types.d.ts +11 -0
- package/dist/src/components/form/nmorph-otp-input/NmorphOTPInput.vue.d.ts +5 -13
- package/dist/src/components/form/nmorph-otp-input/types.d.ts +21 -0
- package/dist/src/components/form/nmorph-radio/NmorphRadio.vue.d.ts +4 -9
- package/dist/src/components/form/nmorph-radio/types.d.ts +6 -0
- package/dist/src/components/form/nmorph-radio-group/NmorphRadioGroup.vue.d.ts +3 -11
- package/dist/src/components/form/nmorph-radio-group/types.d.ts +12 -0
- package/dist/src/components/form/nmorph-select/NmorphSelect.vue.d.ts +3 -21
- package/dist/src/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-select/components/nmorph-select-option/types.d.ts +3 -0
- package/dist/src/components/form/nmorph-select/types.d.ts +21 -0
- package/dist/src/components/form/nmorph-select-button/NmorphSelectButton.vue.d.ts +4 -12
- package/dist/src/components/form/nmorph-select-button/components/nmorph-select-button-item/NmorphSelectButtonItem.vue.d.ts +3 -6
- package/dist/src/components/form/nmorph-select-button/components/nmorph-select-button-item/types.d.ts +4 -0
- package/dist/src/components/form/nmorph-select-button/types.d.ts +12 -0
- package/dist/src/components/form/nmorph-slider/NmorphSlider.vue.d.ts +111 -0
- package/dist/src/components/form/nmorph-slider/types.d.ts +3 -0
- package/dist/src/components/form/nmorph-switch/NmorphSwitch.vue.d.ts +3 -14
- package/dist/src/components/form/nmorph-switch/types.d.ts +15 -0
- package/dist/src/components/form/nmorph-text-input/NmorphTextInput.vue.d.ts +6 -14
- package/dist/src/components/form/nmorph-text-input/types.d.ts +16 -0
- package/dist/src/components/form/nmorph-textarea/NmorphTextarea.vue.d.ts +6 -18
- package/dist/src/components/form/nmorph-textarea/types.d.ts +20 -0
- package/dist/src/components/form/nmorph-time-picker/NmorphTimePicker.vue.d.ts +6 -20
- package/dist/src/components/form/nmorph-time-picker/types.d.ts +24 -0
- package/dist/src/components/navigation/index.d.ts +1 -1
- package/dist/src/components/navigation/nmorph-backtop/NmorphBacktop.vue.d.ts +4 -12
- package/dist/src/components/navigation/nmorph-backtop/types.d.ts +14 -0
- package/dist/src/components/navigation/nmorph-breadcrumb/NmorphBreadcrumb.vue.d.ts +2 -4
- package/dist/src/components/navigation/nmorph-breadcrumb/components/nmorph-breadcrumb-item/NmorphBreadcrumbItem.vue.d.ts +2 -4
- package/dist/src/components/navigation/nmorph-breadcrumb/components/nmorph-breadcrumb-item/types.d.ts +3 -0
- package/dist/src/components/navigation/nmorph-breadcrumb/types.d.ts +3 -0
- package/dist/src/components/navigation/nmorph-context-menu/NmorphContextMenu.vue.d.ts +14 -33
- package/dist/src/components/navigation/nmorph-context-menu/types.d.ts +48 -0
- package/dist/src/components/navigation/nmorph-dropdown/NmorphDropdown.vue.d.ts +6 -24
- package/dist/src/components/navigation/nmorph-dropdown/types.d.ts +24 -0
- package/dist/src/components/navigation/nmorph-tabs/NmorphTabs.vue.d.ts +4 -8
- package/dist/src/components/navigation/nmorph-tabs/components/nmorph-tab-pane/NmorphTabPane.vue.d.ts +4 -5
- package/dist/src/components/navigation/nmorph-tabs/components/nmorph-tab-pane/types.d.ts +3 -0
- package/dist/src/components/navigation/nmorph-tabs/{type.d.ts → types.d.ts} +9 -0
- package/dist/src/components/navigation/nmorph-tabs/utils.d.ts +1 -1
- package/dist/src/components/others/nmorph-divider/NmorphDivider.vue.d.ts +2 -5
- package/dist/src/components/others/nmorph-divider/types.d.ts +3 -0
- package/dist/src/components/others/nmorph-overlay/NmorphOverlay.vue.d.ts +3 -12
- package/dist/src/components/others/nmorph-overlay/types.d.ts +14 -0
- package/dist/src/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.d.ts +2 -8
- package/dist/src/components/providers/nmorph-notification-provider/types.d.ts +9 -0
- package/dist/src/hooks/use-focusable-input.d.ts +16 -0
- package/dist/src/hooks/use-form-validation.d.ts +1 -2
- package/dist/src/plugin.d.ts +4 -1
- package/dist/src/types/app.types.d.ts +21 -0
- package/dist/src/types/common.types.d.ts +62 -0
- package/dist/src/types/date.types.d.ts +7 -0
- package/dist/src/types/image.types.d.ts +17 -0
- package/dist/src/types/index.d.ts +8 -206
- package/dist/src/types/selection.types.d.ts +26 -0
- package/dist/src/types/table.types.d.ts +5 -0
- package/dist/src/types/theme.types.d.ts +55 -0
- package/dist/src/types/translation.types.d.ts +20 -0
- package/dist/src/utils/common.d.ts +3 -0
- package/dist/src/utils/file-types.d.ts +8 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/types/common.types.js +14 -0
- package/dist/types/date.types.js +4 -0
- package/dist/types/image.types.js +5 -0
- package/dist/types/selection.types.js +4 -0
- package/dist/types/table.types.js +4 -0
- package/dist/types/translation.types.js +4 -0
- package/dist/utils/common.js +16 -6
- package/dist/utils/file-types.js +41 -0
- package/package.json +1 -1
- package/dist/src/components/data/nmorph-calendar/hooks/index.d.ts +0 -2
- package/dist/src/hooks/index.d.ts +0 -9
- package/dist/src/outside-hooks/index.d.ts +0 -5
- package/dist/types/index.js +0 -20
|
@@ -1,153 +1,124 @@
|
|
|
1
1
|
import './NmorphFileUpload.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useModifiers as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
2
|
+
import { defineComponent as K, computed as N, inject as z, ref as T, watch as G, onBeforeUnmount as H } from "vue";
|
|
3
|
+
import { useModifiers as J } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { getFileAcceptValue as Q, getFileTypeCandidates as U, isKnownFileType as p, isFileAllowedByTypes as X, getFileExtension as Y } from "../../../utils/file-types.js";
|
|
5
|
+
import { useI18n as Z } from "vue-i18n";
|
|
6
|
+
import { useFormItemInput as $, useFormItemModel as ee } from "../nmorph-form/use-form-item-input.js";
|
|
7
|
+
import te from "../../../assets/icons/doc.svg.js";
|
|
8
|
+
import oe from "../../data/nmorph-image-preview/NmorphImagePreview.vue.js";
|
|
9
|
+
import re from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
10
|
+
import ae from "../../basic/nmorph-button/NmorphButton.vue.js";
|
|
11
|
+
import ie from "../../../assets/icons/audio.svg.js";
|
|
12
|
+
import ne from "../../../assets/icons/video.svg.js";
|
|
13
|
+
import se from "../../../assets/icons/archive.svg.js";
|
|
14
|
+
import { NmorphImageResolution as V, NmorphAudioResolution as le, NmorphVideoResolution as ue, NmorphArchiveResolution as de } from "./types.js";
|
|
15
|
+
import me from "../../../assets/icons/cross.svg.js";
|
|
16
|
+
import pe from "../../../assets/icons/image.svg.js";
|
|
17
|
+
const Ue = /* @__PURE__ */ K({
|
|
17
18
|
__name: "NmorphFileUpload",
|
|
18
19
|
props: {
|
|
20
|
+
id: { type: String, required: !1 },
|
|
21
|
+
name: { type: String, required: !1 },
|
|
22
|
+
autocomplete: { type: String, required: !1 },
|
|
23
|
+
tabindex: { type: Number, required: !1 },
|
|
19
24
|
modelValue: { type: Array, required: !1, default: () => [] },
|
|
20
25
|
disabled: { type: Boolean, required: !1, default: !1 },
|
|
21
26
|
multiple: { type: Boolean, required: !1, default: !1 },
|
|
22
27
|
allowedTypes: { type: Array, required: !1, default: () => [] },
|
|
23
28
|
photoWithPreview: { type: Boolean, required: !1, default: !0 },
|
|
24
|
-
buttonText: { type: String, required: !1, default: "" }
|
|
25
|
-
id: { type: String, required: !1 },
|
|
26
|
-
name: { type: String, required: !1 },
|
|
27
|
-
autocomplete: { type: String, required: !1 },
|
|
28
|
-
tabindex: { type: Number, required: !1 }
|
|
29
|
+
buttonText: { type: String, required: !1, default: "" }
|
|
29
30
|
},
|
|
30
31
|
emits: ["update:model-value", "on-unsupported-file-type-error", "on-file-validation-error"],
|
|
31
|
-
setup(
|
|
32
|
-
const { t:
|
|
32
|
+
setup(_, { expose: q, emit: C }) {
|
|
33
|
+
const { t: b } = Z(), r = _, c = C, P = N(() => r.buttonText ? r.buttonText : b("selectFile")), { id: f, name: S, autocomplete: B, tabindex: L } = $(r), { modelValue: g, updateModelValue: x } = ee(
|
|
33
34
|
r,
|
|
34
35
|
(e) => c("update:model-value", e),
|
|
35
36
|
[]
|
|
36
|
-
), v =
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return t &&
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
[
|
|
46
|
-
e.type.toLowerCase(),
|
|
47
|
-
S(e.type),
|
|
48
|
-
I(e.name),
|
|
49
|
-
A(e.type)
|
|
50
|
-
].filter(Boolean).map((t) => t.toLowerCase())
|
|
51
|
-
)
|
|
52
|
-
), i = (e, t) => Object.prototype.hasOwnProperty.call(t, e), K = (e) => {
|
|
53
|
-
const t = y(e);
|
|
54
|
-
return e.type.toLowerCase().startsWith("image/") || t.some((o) => i(o, V));
|
|
55
|
-
}, P = (e) => {
|
|
56
|
-
if (r.allowedTypes.length === 0) return !0;
|
|
57
|
-
const t = y(e);
|
|
58
|
-
return r.allowedTypes.some((o) => t.includes(String(o).toLowerCase()));
|
|
59
|
-
}, $ = C(() => {
|
|
60
|
-
if (r.allowedTypes.length !== 0)
|
|
61
|
-
return Array.from(
|
|
62
|
-
new Set(
|
|
63
|
-
r.allowedTypes.flatMap((e) => {
|
|
64
|
-
const t = String(e).toLowerCase(), o = B[t], n = T[t] || t;
|
|
65
|
-
return t.includes("/") ? t : o ? [`.${n}`, o] : `.${n}`;
|
|
66
|
-
})
|
|
67
|
-
)
|
|
68
|
-
).join(",");
|
|
69
|
-
}), z = (e) => {
|
|
70
|
-
const t = y(e);
|
|
71
|
-
let o = le;
|
|
72
|
-
return (e.type.toLowerCase().startsWith("image/") || t.some((n) => i(n, V))) && (o = ye), (e.type.toLowerCase().startsWith("audio/") || t.some((n) => i(n, se))) && (o = me), (e.type.toLowerCase().startsWith("video/") || t.some((n) => i(n, ae))) && (o = ce), t.some((n) => i(n, ie)) && (o = fe), o;
|
|
73
|
-
}, u = q(null), a = q([...F.value]), l = /* @__PURE__ */ new Set(), h = () => {
|
|
74
|
-
const e = u.value;
|
|
37
|
+
), v = z("form-data", void 0), M = (e) => {
|
|
38
|
+
const t = U(e);
|
|
39
|
+
return e.type.toLowerCase().startsWith("image/") || t.some((o) => p(o, V));
|
|
40
|
+
}, W = N(() => Q(r.allowedTypes)), j = (e) => {
|
|
41
|
+
const t = U(e);
|
|
42
|
+
let o = te;
|
|
43
|
+
return (e.type.toLowerCase().startsWith("image/") || t.some((i) => p(i, V))) && (o = pe), (e.type.toLowerCase().startsWith("audio/") || t.some((i) => p(i, le))) && (o = ie), (e.type.toLowerCase().startsWith("video/") || t.some((i) => p(i, ue))) && (o = ne), t.some((i) => p(i, de)) && (o = se), o;
|
|
44
|
+
}, l = T(null), n = T([...g.value]), s = /* @__PURE__ */ new Set(), h = () => {
|
|
45
|
+
const e = l.value;
|
|
75
46
|
e && (e.value = "");
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
},
|
|
47
|
+
}, y = (e) => {
|
|
48
|
+
s.has(e) && (URL.revokeObjectURL(e), s.delete(e));
|
|
49
|
+
}, I = (e) => {
|
|
79
50
|
const t = new Set(e.map((o) => o.previewUrl));
|
|
80
|
-
Array.from(
|
|
81
|
-
t.has(o) ||
|
|
51
|
+
Array.from(s).forEach((o) => {
|
|
52
|
+
t.has(o) || y(o);
|
|
82
53
|
});
|
|
83
|
-
},
|
|
54
|
+
}, w = (e) => {
|
|
84
55
|
const t = [...e];
|
|
85
|
-
|
|
86
|
-
},
|
|
56
|
+
n.value = t, x(t);
|
|
57
|
+
}, R = (e) => {
|
|
87
58
|
const t = v?.validateField(f.value, e);
|
|
88
59
|
return {
|
|
89
60
|
valid: t?.valid.value ?? !0,
|
|
90
61
|
errors: t?.errors.value ?? []
|
|
91
62
|
};
|
|
92
|
-
},
|
|
93
|
-
r.disabled || !
|
|
94
|
-
},
|
|
63
|
+
}, k = () => {
|
|
64
|
+
r.disabled || !l.value || l.value.click();
|
|
65
|
+
}, E = (e) => {
|
|
95
66
|
if (r.disabled) return;
|
|
96
|
-
const t = e.target, o = Array.from(t.files || []),
|
|
97
|
-
if (
|
|
98
|
-
if (!
|
|
99
|
-
c("on-unsupported-file-type-error",
|
|
67
|
+
const t = e.target, o = Array.from(t.files || []), i = r.multiple ? o : o.slice(0, 1), u = [];
|
|
68
|
+
if (i.forEach((a) => {
|
|
69
|
+
if (!X(a, r.allowedTypes)) {
|
|
70
|
+
c("on-unsupported-file-type-error", a.type || Y(a.name) || a.name);
|
|
100
71
|
return;
|
|
101
72
|
}
|
|
102
|
-
const
|
|
73
|
+
const d = r.multiple ? [...n.value.map((F) => F.data), ...u, a] : [a], m = R(d);
|
|
103
74
|
if (!m.valid) {
|
|
104
|
-
c("on-file-validation-error", { file:
|
|
75
|
+
c("on-file-validation-error", { file: a, errors: m.errors });
|
|
105
76
|
return;
|
|
106
77
|
}
|
|
107
|
-
|
|
108
|
-
}), h(),
|
|
109
|
-
const
|
|
110
|
-
const
|
|
111
|
-
return
|
|
112
|
-
}),
|
|
113
|
-
|
|
78
|
+
u.push(a);
|
|
79
|
+
}), h(), u.length > 0) {
|
|
80
|
+
const a = u.map((m) => {
|
|
81
|
+
const F = URL.createObjectURL(m);
|
|
82
|
+
return s.add(F), { data: m, previewUrl: F };
|
|
83
|
+
}), d = r.multiple ? [...n.value, ...a] : a;
|
|
84
|
+
I(d), w(d), v?.validateField(f.value, d);
|
|
114
85
|
}
|
|
115
|
-
},
|
|
86
|
+
}, O = (e) => {
|
|
116
87
|
if (r.disabled) return;
|
|
117
|
-
const t =
|
|
88
|
+
const t = n.value.findIndex((o) => o.data.name === e);
|
|
118
89
|
if (t !== -1) {
|
|
119
|
-
const o =
|
|
120
|
-
|
|
121
|
-
const
|
|
122
|
-
|
|
90
|
+
const o = n.value[t];
|
|
91
|
+
y(o.previewUrl), h();
|
|
92
|
+
const i = n.value.filter((u, a) => a !== t);
|
|
93
|
+
w(i), v?.validateField(f.value, i);
|
|
123
94
|
}
|
|
124
95
|
};
|
|
125
|
-
|
|
126
|
-
|
|
96
|
+
G(
|
|
97
|
+
g,
|
|
127
98
|
(e) => {
|
|
128
99
|
const t = [...e];
|
|
129
|
-
|
|
100
|
+
I(t), n.value = t, t.length === 0 && h();
|
|
130
101
|
},
|
|
131
102
|
{ deep: !0 }
|
|
132
|
-
),
|
|
133
|
-
Array.from(
|
|
134
|
-
}),
|
|
135
|
-
const
|
|
136
|
-
() =>
|
|
103
|
+
), H(() => {
|
|
104
|
+
Array.from(s).forEach((e) => y(e));
|
|
105
|
+
}), q({ inputDOMRef: l });
|
|
106
|
+
const D = N(
|
|
107
|
+
() => J({
|
|
137
108
|
"nmorph-file-upload": [r.disabled && "disabled"]
|
|
138
109
|
})
|
|
139
|
-
),
|
|
140
|
-
return
|
|
110
|
+
), A = { t: b, props: r, emit: c, computedButtonText: P, id: f, name: S, autocomplete: B, tabindex: L, modelValue: g, updateModelValue: x, formData: v, isImageFile: M, inputAccept: W, typeFileIconMap: j, inputDOMRef: l, files: n, createdPreviewUrls: s, resetInputValue: h, revokePreviewUrl: y, revokeRemovedPreviewUrls: I, filesChanged: w, getFormValidationResult: R, openFileSelector: k, handleFileUpload: E, removeFile: O, modifiers: D, get NmorphButton() {
|
|
111
|
+
return ae;
|
|
141
112
|
}, get NmorphIcon() {
|
|
142
|
-
return
|
|
113
|
+
return re;
|
|
143
114
|
}, get NmorphImagePreview() {
|
|
144
|
-
return
|
|
115
|
+
return oe;
|
|
145
116
|
}, get NmorphIconCross() {
|
|
146
|
-
return
|
|
117
|
+
return me;
|
|
147
118
|
} };
|
|
148
|
-
return Object.defineProperty(
|
|
119
|
+
return Object.defineProperty(A, "__isScriptSetup", { enumerable: !1, value: !0 }), A;
|
|
149
120
|
}
|
|
150
121
|
});
|
|
151
122
|
export {
|
|
152
|
-
|
|
123
|
+
Ue as default
|
|
153
124
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.nmorph-form-item{margin:var(--indentation-04) var(--indentation-00)}.nmorph-form-item label{font-weight:600;font-size:var(--font-size-small);line-height:var(--line-height-loose)}.nmorph-form-item .nmorph-form-item__content{position:relative;display:flex;align-items:center;width:100%}.nmorph-form-item.nmorph-form-item--labeled .nmorph-form-item__content{margin-top:var(--indentation-02)}.nmorph-form-item.nmorph-form-item--valid .nmorph-native-input:focus{background:var(--nmorph-success-color)}.nmorph-form-item.nmorph-form-item--invalid .nmorph-native-input:focus{background:var(--nmorph-error-text-color)}
|
|
1
|
+
.nmorph-form-item{min-width:0;max-width:100%;margin:var(--indentation-04) var(--indentation-00)}.nmorph-form-item label{font-weight:600;font-size:var(--font-size-small);line-height:var(--line-height-loose)}.nmorph-form-item .nmorph-form-item__content{position:relative;display:flex;align-items:center;width:100%;min-width:0;max-width:100%}.nmorph-form-item.nmorph-form-item--labeled .nmorph-form-item__content{margin-top:var(--indentation-02)}.nmorph-form-item.nmorph-form-item--valid .nmorph-native-input:focus{background:var(--nmorph-success-color)}.nmorph-form-item.nmorph-form-item--invalid .nmorph-native-input:focus{background:var(--nmorph-error-text-color)}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './NmorphErrorBox.css';
|
|
2
2
|
import { defineComponent as p, computed as s } from "vue";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useModifiers as u } from "../../../../../../../utils/create-modifiers.js";
|
|
4
|
+
import { NmorphComponentHeight as l } from "../../../../../../../types/common.types.js";
|
|
5
5
|
const h = /* @__PURE__ */ p({
|
|
6
6
|
__name: "NmorphErrorBox",
|
|
7
7
|
props: {
|
|
@@ -15,8 +15,8 @@ const h = /* @__PURE__ */ p({
|
|
|
15
15
|
const r = Array.isArray(e.errors) ? e.errors : e.errors.value;
|
|
16
16
|
return r.length ? [r[r.length - 1]] : [];
|
|
17
17
|
}), a = s(
|
|
18
|
-
() =>
|
|
19
|
-
nmorph: [
|
|
18
|
+
() => u({
|
|
19
|
+
nmorph: [l[e.height]],
|
|
20
20
|
"nmorph-error-box": [e.staticHeight && "static-height", t.value.length === 0 && "empty"]
|
|
21
21
|
})
|
|
22
22
|
), o = { props: e, currentError: t, modifiers: a };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import './NmorphNumberInput.css';
|
|
2
2
|
import { defineComponent as H, computed as n, ref as s, watch as p } from "vue";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { useModifiers as R } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { useFormItemInput as T, useFormItemModel as D } from "../nmorph-form/use-form-item-input.js";
|
|
5
|
+
import { NmorphComponentHeight as V } from "../../../types/common.types.js";
|
|
6
6
|
import k from "../../../assets/icons/plus-thin.svg.js";
|
|
7
7
|
import z from "../../../assets/icons/minus-thin.svg.js";
|
|
8
8
|
import C from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
@@ -24,9 +24,9 @@ const L = /* @__PURE__ */ H({
|
|
|
24
24
|
},
|
|
25
25
|
emits: ["update:model-value"],
|
|
26
26
|
setup(d, { expose: c, emit: f }) {
|
|
27
|
-
const e = d, { id: h, name: g, autocomplete: b, tabindex: x } =
|
|
28
|
-
() =>
|
|
29
|
-
nmorph: [
|
|
27
|
+
const e = d, { id: h, name: g, autocomplete: b, tabindex: x } = T(e), N = n(
|
|
28
|
+
() => R({
|
|
29
|
+
nmorph: [V[e.height]],
|
|
30
30
|
"nmorph-number-input": [e.disabled && "disabled", e.actionBtnPositionRight && "action-btn-position-right"]
|
|
31
31
|
})
|
|
32
32
|
), a = {
|
|
@@ -45,7 +45,7 @@ const L = /* @__PURE__ */ H({
|
|
|
45
45
|
}, v = n(() => {
|
|
46
46
|
const i = e.actionBtnPositionRight ? "right" : "default";
|
|
47
47
|
return a[e.height][i];
|
|
48
|
-
}), u = f, { modelValue: o, updateModelValue: l } =
|
|
48
|
+
}), u = f, { modelValue: o, updateModelValue: l } = D(
|
|
49
49
|
e,
|
|
50
50
|
(i) => u("update:model-value", i),
|
|
51
51
|
0
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import './NmorphOTPInput.css';
|
|
2
2
|
import { defineComponent as le, ref as M, computed as c, watch as O, nextTick as R } from "vue";
|
|
3
3
|
import { useModifiers as ue } from "../../../utils/create-modifiers.js";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import se from "
|
|
4
|
+
import { useFormItemInput as oe, useFormItemModel as re } from "../nmorph-form/use-form-item-input.js";
|
|
5
|
+
import ne from "../nmorph-text-input/NmorphTextInput.vue.js";
|
|
6
|
+
import { NmorphComponentHeight as se } from "../../../types/common.types.js";
|
|
7
7
|
const pe = /* @__PURE__ */ le({
|
|
8
8
|
__name: "NmorphOTPInput",
|
|
9
9
|
props: {
|
|
@@ -21,7 +21,7 @@ const pe = /* @__PURE__ */ le({
|
|
|
21
21
|
},
|
|
22
22
|
emits: ["update:model-value", "focus", "blur", "complete"],
|
|
23
23
|
setup(j, { expose: w, emit: N }) {
|
|
24
|
-
const l = j, f = N, { id: V, name: T, autocomplete: A, tabindex: p } =
|
|
24
|
+
const l = j, f = N, { id: V, name: T, autocomplete: A, tabindex: p } = oe(l), { modelValue: v, updateModelValue: F } = re(
|
|
25
25
|
l,
|
|
26
26
|
(e) => f("update:model-value", e),
|
|
27
27
|
""
|
|
@@ -46,7 +46,7 @@ const pe = /* @__PURE__ */ le({
|
|
|
46
46
|
);
|
|
47
47
|
const E = c(
|
|
48
48
|
() => ue({
|
|
49
|
-
nmorph: [
|
|
49
|
+
nmorph: [se[l.height], d.value && "focused"],
|
|
50
50
|
"nmorph-otp-input": [l.disabled && "disabled"]
|
|
51
51
|
})
|
|
52
52
|
), B = c(
|
|
@@ -142,7 +142,7 @@ const pe = /* @__PURE__ */ le({
|
|
|
142
142
|
},
|
|
143
143
|
{ immediate: !0 }
|
|
144
144
|
);
|
|
145
|
-
const I = { props: l, emit: f, id: V, name: T, autocomplete: A, tabindex: p, modelValue: v, updateModelValue: F, inputRefs: i, inputDOMRefs: n, focused: d, otpValue: o, normalizedLength: u, sanitizeValue: g, normalizeOtpValue: S, syncOtpValue: h, modifiers: E, fieldIds: B, inputMode: C, resolvedAutocomplete: P, inputPattern: $, syncInputDOMRef: y, setInputRef: x, selectField: _, focusField: r, blurFields: k, updateCharAt: m, insertValue: H, inputHandler: z, fieldModels: q, getFieldModel: L, backspaceHandler: D, deleteKeyHandler: Z, arrowLeftHandler: K, arrowRightHandler: G, homeHandler: J, endHandler: Q, keydownHandler: U, pasteHandler: W, focusHandler: X, blurHandler: Y, getFieldTabindex: ee, NmorphTextInput:
|
|
145
|
+
const I = { props: l, emit: f, id: V, name: T, autocomplete: A, tabindex: p, modelValue: v, updateModelValue: F, inputRefs: i, inputDOMRefs: n, focused: d, otpValue: o, normalizedLength: u, sanitizeValue: g, normalizeOtpValue: S, syncOtpValue: h, modifiers: E, fieldIds: B, inputMode: C, resolvedAutocomplete: P, inputPattern: $, syncInputDOMRef: y, setInputRef: x, selectField: _, focusField: r, blurFields: k, updateCharAt: m, insertValue: H, inputHandler: z, fieldModels: q, getFieldModel: L, backspaceHandler: D, deleteKeyHandler: Z, arrowLeftHandler: K, arrowRightHandler: G, homeHandler: J, endHandler: Q, keydownHandler: U, pasteHandler: W, focusHandler: X, blurHandler: Y, getFieldTabindex: ee, NmorphTextInput: ne };
|
|
146
146
|
return Object.defineProperty(I, "__isScriptSetup", { enumerable: !1, value: !0 }), I;
|
|
147
147
|
}
|
|
148
148
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './NmorphRadio.css';
|
|
2
2
|
import { defineComponent as h, inject as r, computed as l, ref as m } from "vue";
|
|
3
3
|
import { useModifiers as g } from "../../../utils/create-modifiers.js";
|
|
4
|
-
import { NmorphSelectionControlHeight as v } from "../../../types/
|
|
4
|
+
import { NmorphSelectionControlHeight as v } from "../../../types/common.types.js";
|
|
5
5
|
const q = /* @__PURE__ */ h({
|
|
6
6
|
__name: "NmorphRadio",
|
|
7
7
|
props: {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import './NmorphSelect.css';
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { useI18n as
|
|
7
|
-
import { useFormItemModel as
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
const
|
|
2
|
+
import { defineComponent as ue, computed as a, ref as d, watch as c, nextTick as R, onMounted as oe, onUnmounted as ie, provide as w, toRef as se } from "vue";
|
|
3
|
+
import { useModifiers as de } from "../../../utils/create-modifiers.js";
|
|
4
|
+
import { createCssSizeVariables as ve, getNmorphOptionHeight as ce, toCssSize as fe, resolveDomElement as pe } from "../../../utils/common.js";
|
|
5
|
+
import { useVirtualList as me } from "../../../hooks/use-virtual-list.js";
|
|
6
|
+
import { useI18n as he } from "vue-i18n";
|
|
7
|
+
import { useFormItemModel as ge, useFormItemInput as ye } from "../nmorph-form/use-form-item-input.js";
|
|
8
|
+
import { NmorphComponentHeight as He } from "../../../types/common.types.js";
|
|
9
|
+
import be from "../../navigation/nmorph-dropdown/NmorphDropdown.vue.js";
|
|
10
|
+
import qe from "./components/nmorph-select-option/NmorphSelectOption.vue.js";
|
|
11
|
+
import Ie from "../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
12
|
+
import xe from "../../data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.js";
|
|
13
|
+
import Ne from "../../../assets/icons/chevron-down.svg.js";
|
|
14
|
+
import Se from "../../../assets/icons/loader.svg.js";
|
|
15
|
+
const Ge = /* @__PURE__ */ ue({
|
|
16
16
|
__name: "NmorphSelect",
|
|
17
17
|
props: {
|
|
18
18
|
noElementPlaceholder: { type: String, required: !1, default: "" },
|
|
@@ -39,30 +39,30 @@ const je = /* @__PURE__ */ oe({
|
|
|
39
39
|
tabindex: { type: Number, required: !1 }
|
|
40
40
|
},
|
|
41
41
|
emits: ["update:model-value"],
|
|
42
|
-
setup(
|
|
43
|
-
|
|
44
|
-
const { t: M } =
|
|
42
|
+
setup(C, { expose: P, emit: T }) {
|
|
43
|
+
P();
|
|
44
|
+
const { t: M } = he(), l = C, D = a(
|
|
45
45
|
() => l.noElementPlaceholder ? l.noElementPlaceholder : M("noElementPlaceholder")
|
|
46
|
-
), A =
|
|
46
|
+
), A = T, { modelValue: p, updateModelValue: h } = ge(
|
|
47
47
|
l,
|
|
48
48
|
(e) => A("update:model-value", e),
|
|
49
49
|
""
|
|
50
|
-
), t = d(p.value), r = d(l.open), v = a(() => l.disabled || l.loading), g = a(() => l.optionsWidth === "auto"), y = d(!0), { id: H, name:
|
|
50
|
+
), t = d(p.value), r = d(l.open), v = a(() => l.disabled || l.loading), g = a(() => l.optionsWidth === "auto"), y = d(!0), { id: H, name: W, autocomplete: k, tabindex: $ } = ye(l), b = (e) => {
|
|
51
51
|
if (!v.value) {
|
|
52
52
|
if (r.value = !1, typeof t.value == "string" && (!l.valueRequired && t.value === e ? t.value = "" : t.value = e, h(t.value)), Array.isArray(t.value)) {
|
|
53
|
-
const n = t.value.includes(e),
|
|
54
|
-
if (l.valueRequired &&
|
|
55
|
-
n ? t.value = t.value.filter((
|
|
53
|
+
const n = t.value.includes(e), re = t.value.length === 1 && n;
|
|
54
|
+
if (l.valueRequired && re) return;
|
|
55
|
+
n ? t.value = t.value.filter((ne) => ne !== e) : t.value = [...t.value, e];
|
|
56
56
|
}
|
|
57
57
|
h(t.value);
|
|
58
58
|
}
|
|
59
|
-
}, m = d(!1),
|
|
59
|
+
}, m = d(!1), z = () => {
|
|
60
60
|
m.value = !0;
|
|
61
|
-
},
|
|
61
|
+
}, F = () => {
|
|
62
62
|
m.value = !1;
|
|
63
|
-
},
|
|
64
|
-
() =>
|
|
65
|
-
nmorph: [
|
|
63
|
+
}, U = a(
|
|
64
|
+
() => de({
|
|
65
|
+
nmorph: [He[l.height]],
|
|
66
66
|
"nmorph-select": [
|
|
67
67
|
l.disabled && "disabled",
|
|
68
68
|
p.value ? "on" : "off",
|
|
@@ -74,9 +74,11 @@ const je = /* @__PURE__ */ oe({
|
|
|
74
74
|
m.value && "focus"
|
|
75
75
|
]
|
|
76
76
|
})
|
|
77
|
-
),
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
), j = a(
|
|
78
|
+
() => ve({
|
|
79
|
+
"--base-width": l.width
|
|
80
|
+
})
|
|
81
|
+
), G = () => {
|
|
80
82
|
v.value || (r.value = !r.value);
|
|
81
83
|
};
|
|
82
84
|
c(
|
|
@@ -101,16 +103,16 @@ const je = /* @__PURE__ */ oe({
|
|
|
101
103
|
},
|
|
102
104
|
{ deep: !0 }
|
|
103
105
|
);
|
|
104
|
-
const i = a(() => l.options.length > 0 ? l.options : l.optionsMap), I = d(null), x = d([]), N = a(() => l.options), f = a(() => l.virtual && N.value.length > 0), E = a(() => l.virtualItemHeight ||
|
|
106
|
+
const i = a(() => l.options.length > 0 ? l.options : l.optionsMap), I = d(null), x = d([]), N = a(() => l.options), f = a(() => l.virtual && N.value.length > 0), E = a(() => l.virtualItemHeight || ce(l.height)), V = a(() => l.virtualOverscan), _ = a(() => l.virtualDynamicHeight), s = me(N, {
|
|
105
107
|
enabled: f,
|
|
106
108
|
itemHeight: E,
|
|
107
109
|
overscan: V,
|
|
108
110
|
dynamic: _
|
|
109
|
-
}),
|
|
111
|
+
}), J = a(() => s.virtualItems.value), K = s.spacerStyle, Q = s.contentStyle, X = a(() => fe(l.virtualMaxHeight)), S = () => {
|
|
110
112
|
i.value.length > 0 || !I.value || (x.value = Array.from(I.value.querySelectorAll(".nmorph-select-option")).map((e) => e.getAttribute("value")).filter((e) => !!e));
|
|
111
113
|
}, o = a(
|
|
112
114
|
() => i.value.length > 0 ? i.value.map((e) => e.value) : x.value
|
|
113
|
-
),
|
|
115
|
+
), Y = a(() => f.value ? Array.isArray(t.value) ? t.value : t.value ? [t.value] : [] : o.value), u = d(0), O = a(() => o.value[u.value] || ""), Z = a(() => `${H.value}-listbox`), ee = (e) => `${H.value}-option-${e.replace(/\s+/g, "-")}`;
|
|
114
116
|
c(u, (e) => {
|
|
115
117
|
r.value && f.value && s.scrollToIndex(e);
|
|
116
118
|
}), c(
|
|
@@ -121,29 +123,29 @@ const je = /* @__PURE__ */ oe({
|
|
|
121
123
|
{ immediate: !0 }
|
|
122
124
|
), c(r, async (e) => {
|
|
123
125
|
if (e) {
|
|
124
|
-
if (await R(),
|
|
126
|
+
if (await R(), S(), typeof t.value == "string") {
|
|
125
127
|
const n = o.value.indexOf(t.value);
|
|
126
128
|
n !== -1 && (u.value = n);
|
|
127
129
|
}
|
|
128
130
|
s.refresh(), f.value && s.scrollToIndex(u.value);
|
|
129
131
|
}
|
|
130
|
-
}),
|
|
131
|
-
await R(),
|
|
132
|
-
}),
|
|
132
|
+
}), oe(async () => {
|
|
133
|
+
await R(), S(), document.addEventListener("click", q);
|
|
134
|
+
}), ie(() => {
|
|
133
135
|
document.removeEventListener("click", q);
|
|
134
136
|
});
|
|
135
|
-
const
|
|
136
|
-
w("select-selected-value", t), w("select-change-selected-value", b), w("select-height",
|
|
137
|
-
const B = d(null),
|
|
137
|
+
const te = a(() => typeof t.value == "string" ? t.value === "" ? D.value : i.value.find((e) => e.value === t.value)?.label : i.value.find((e) => e.value === t.value)?.label), le = a(() => i.value.length > 0 ? i.value.filter((n) => t.value.includes(n.value)).map((n) => ({ text: n.label, value: n.value })) : Array.isArray(t.value) ? t.value.map((n) => ({ text: n, value: n })) : [{ text: t.value, value: t.value }]);
|
|
138
|
+
w("select-selected-value", t), w("select-change-selected-value", b), w("select-height", se(l, "height"));
|
|
139
|
+
const B = d(null), ae = a(
|
|
138
140
|
() => g.value ? `${B.value?.clientWidth || 0}px` : void 0
|
|
139
|
-
), L = { t: M, props: l, computedNoElementPlaceholder: D, emit: A, modelValue: p, updateModelValue: h, initialValue: t, open: r, disabledInput: v, autoOptionsWidth: g, selectedLineOutset: y, id: H, name:
|
|
141
|
+
), L = { t: M, props: l, computedNoElementPlaceholder: D, emit: A, modelValue: p, updateModelValue: h, initialValue: t, open: r, disabledInput: v, autoOptionsWidth: g, selectedLineOutset: y, id: H, name: W, autocomplete: k, tabindex: $, changeHandler: b, focus: m, focusHandler: z, blurHandler: F, modifiers: U, styles: j, clickHandler: G, closeHandler: q, optionsMap: i, optionsDOMRef: I, slotDomOptions: x, renderedOptions: N, virtualEnabled: f, virtualItemHeight: E, virtualOverscan: V, virtualDynamicHeight: _, virtualList: s, virtualOptions: J, virtualSpacerStyle: K, virtualContentStyle: Q, virtualMaxHeight: X, refreshDomOptions: S, domOptions: o, nativeOptions: Y, currentIndex: u, currentFocusedEl: O, listboxId: Z, getOptionId: ee, selectedValueTitle: te, tags: le, nmorphSelectDOMRef: B, optionsMinWidth: ae, spaceHandler: () => {
|
|
140
142
|
v.value || (r.value = !r.value);
|
|
141
143
|
}, arrowDownHandler: () => {
|
|
142
144
|
v.value || o.value.length !== 0 && (r.value || (r.value = !0), u.value = (u.value + 1) % o.value.length);
|
|
143
145
|
}, arrowUpHandler: () => {
|
|
144
146
|
v.value || o.value.length !== 0 && (r.value || (r.value = !0), u.value = (u.value - 1 + o.value.length) % o.value.length);
|
|
145
147
|
}, enterHandler: () => {
|
|
146
|
-
r.value &&
|
|
148
|
+
r.value && O.value && b(O.value);
|
|
147
149
|
}, setVirtualOptionRef: (e, n) => {
|
|
148
150
|
s.measureElement(n, pe(e));
|
|
149
151
|
}, escapeHandler: () => {
|
|
@@ -153,21 +155,21 @@ const je = /* @__PURE__ */ oe({
|
|
|
153
155
|
}, endHandler: () => {
|
|
154
156
|
u.value = Math.max(o.value.length - 1, 0);
|
|
155
157
|
}, get NmorphTagItem() {
|
|
156
|
-
return
|
|
158
|
+
return xe;
|
|
157
159
|
}, get NmorphIcon() {
|
|
158
|
-
return
|
|
160
|
+
return Ie;
|
|
159
161
|
}, get NmorphSelectOption() {
|
|
160
|
-
return
|
|
162
|
+
return qe;
|
|
161
163
|
}, get NmorphDropdown() {
|
|
162
|
-
return
|
|
164
|
+
return be;
|
|
163
165
|
}, get NmorphIconLoaderDots() {
|
|
164
|
-
return
|
|
166
|
+
return Se;
|
|
165
167
|
}, get NmorphIconChevronDown() {
|
|
166
|
-
return
|
|
168
|
+
return Ne;
|
|
167
169
|
} };
|
|
168
170
|
return Object.defineProperty(L, "__isScriptSetup", { enumerable: !1, value: !0 }), L;
|
|
169
171
|
}
|
|
170
172
|
});
|
|
171
173
|
export {
|
|
172
|
-
|
|
174
|
+
Ge as default
|
|
173
175
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import './NmorphSelectOption.css';
|
|
2
2
|
import { defineComponent as g, inject as l, computed as t } from "vue";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import q from "
|
|
7
|
-
|
|
3
|
+
import { useModifiers as y } from "../../../../../utils/create-modifiers.js";
|
|
4
|
+
import { createCssVariables as b } from "../../../../../utils/common.js";
|
|
5
|
+
import { NmorphComponentHeight as S } from "../../../../../types/common.types.js";
|
|
6
|
+
import q from "../../../../basic/nmorph-icon/NmorphIcon.vue.js";
|
|
7
|
+
import _ from "../../../../../assets/icons/success.svg.js";
|
|
8
|
+
const H = /* @__PURE__ */ g({
|
|
8
9
|
__name: "NmorphSelectOption",
|
|
9
10
|
props: {
|
|
10
11
|
value: { type: String, required: !0 },
|
|
@@ -25,29 +26,31 @@ const I = /* @__PURE__ */ g({
|
|
|
25
26
|
const r = l("select-selected-value"), o = l("select-change-selected-value"), a = l(
|
|
26
27
|
"select-height",
|
|
27
28
|
void 0
|
|
28
|
-
), e = c,
|
|
29
|
-
e.disabled || (
|
|
30
|
-
},
|
|
31
|
-
() =>
|
|
32
|
-
nmorph: [
|
|
29
|
+
), e = c, s = p, f = () => {
|
|
30
|
+
e.disabled || (s("change-value", e.value), o && o(e.value));
|
|
31
|
+
}, i = t(() => typeof r?.value == "string" ? r.value === e.value : Array.isArray(r?.value) ? r.value.some((v) => v === e.value) : !1), u = t(() => e.height || a?.value || "basic"), m = t(
|
|
32
|
+
() => y({
|
|
33
|
+
nmorph: [S[u.value]],
|
|
33
34
|
"nmorph-select-option": [
|
|
34
35
|
e.disabled && "disabled",
|
|
35
36
|
e.label && "with-label",
|
|
36
|
-
|
|
37
|
+
i.value && "checked",
|
|
37
38
|
e.focused && "focused"
|
|
38
39
|
]
|
|
39
40
|
})
|
|
40
|
-
),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
), h = t(
|
|
42
|
+
() => b({
|
|
43
|
+
"--hover-bg": e.hoverBackground,
|
|
44
|
+
"--hover-color": e.hoverColor
|
|
45
|
+
})
|
|
46
|
+
), n = { selectSelectedValue: r, selectChangeSelectedValue: o, selectHeight: a, props: e, emit: s, clickHandler: f, checked: i, height: u, modifiers: m, styles: h, get NmorphIcon() {
|
|
46
47
|
return q;
|
|
48
|
+
}, get NmorphIconSuccess() {
|
|
49
|
+
return _;
|
|
47
50
|
} };
|
|
48
51
|
return Object.defineProperty(n, "__isScriptSetup", { enumerable: !1, value: !0 }), n;
|
|
49
52
|
}
|
|
50
53
|
});
|
|
51
54
|
export {
|
|
52
|
-
|
|
55
|
+
H as default
|
|
53
56
|
};
|