@nmorph/nmorph-ui-kit 2.2.37 → 2.2.38
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/data/nmorph-card/NmorphCard.vue2.js +19 -16
- package/dist/components/form/nmorph-autocomplete/NmorphAutocomplete.vue2.js +67 -65
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.css +1 -1
- package/dist/components/form/nmorph-checkbox/NmorphCheckbox.vue2.js +28 -26
- package/dist/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue2.js +25 -20
- package/dist/components/form/nmorph-color-picker/NmorphColorPicker.vue2.js +43 -42
- package/dist/components/form/nmorph-date-picker/NmorphDatePicker.vue2.js +52 -40
- package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue.js +20 -16
- package/dist/components/form/nmorph-file-upload/NmorphFileUpload.vue2.js +113 -86
- package/dist/components/form/nmorph-form/NmorphForm.vue2.js +9 -9
- package/dist/components/form/nmorph-form/components/nmorph-form-item/NmorphFormItem.vue2.js +33 -24
- package/dist/components/form/nmorph-form/use-form-item-input.js +29 -8
- package/dist/components/form/nmorph-number-input/NmorphNumberInput.vue2.js +41 -35
- package/dist/components/form/nmorph-otp-input/NmorphOTPInput.vue2.js +65 -61
- package/dist/components/form/nmorph-radio/NmorphRadio.css +1 -1
- package/dist/components/form/nmorph-radio-group/NmorphRadioGroup.vue2.js +24 -22
- package/dist/components/form/nmorph-select/NmorphSelect.css +1 -1
- package/dist/components/form/nmorph-select/NmorphSelect.vue2.js +91 -81
- package/dist/components/form/nmorph-select-button/NmorphSelectButton.vue2.js +28 -26
- package/dist/components/form/nmorph-slider/NmorphSlider.vue2.js +49 -48
- package/dist/components/form/nmorph-switch/NmorphSwitch.vue2.js +37 -36
- package/dist/components/form/nmorph-text-input/NmorphTextInput.css +1 -1
- package/dist/components/form/nmorph-text-input/NmorphTextInput.vue.js +1 -1
- package/dist/components/form/nmorph-text-input/NmorphTextInput.vue2.js +34 -30
- package/dist/components/form/nmorph-textarea/NmorphTextarea.vue.js +1 -1
- package/dist/components/form/nmorph-textarea/NmorphTextarea.vue2.js +29 -25
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue.js +1 -1
- package/dist/components/form/nmorph-time-picker/NmorphTimePicker.vue2.js +69 -68
- package/dist/hooks/use-field-validation.js +71 -42
- package/dist/hooks/use-form-validation.js +62 -24
- package/dist/index.umd.js +26 -26
- package/dist/package.json.js +1 -1
- package/dist/src/components/basic/nmorph-button/NmorphButton.vue.d.ts +1 -1
- package/dist/src/components/basic/nmorph-link/NmorphLink.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-avatar/NmorphAvatar.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-badge/NmorphBadge.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-empty/NmorphEmpty.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-progress/NmorphProgress.vue.d.ts +1 -1
- package/dist/src/components/data/nmorph-table/NmorphTable.vue.d.ts +1 -1
- package/dist/src/components/feedback/nmorph-callout/NmorphCallout.vue.d.ts +1 -1
- package/dist/src/components/form/nmorph-checkbox-group/NmorphCheckboxGroup.vue.d.ts +2 -2
- package/dist/src/components/form/nmorph-date-picker/NmorphDatePicker.vue.d.ts +2 -2
- package/dist/src/components/form/nmorph-file-upload/NmorphFileUpload.vue.d.ts +6 -3
- package/dist/src/components/form/nmorph-file-upload/types.d.ts +4 -0
- package/dist/src/components/form/nmorph-form/types.d.ts +15 -5
- package/dist/src/components/form/nmorph-form/use-form-item-input.d.ts +10 -0
- package/dist/src/components/form/nmorph-radio-group/NmorphRadioGroup.vue.d.ts +2 -2
- package/dist/src/hooks/use-field-validation.d.ts +15 -0
- package/dist/src/hooks/use-form-validation.d.ts +5 -0
- package/dist/style.css +1 -1
- package/dist/utils/common.js +6 -7
- package/package.json +1 -1
package/dist/package.json.js
CHANGED
|
@@ -17,11 +17,11 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphProps, {
|
|
|
17
17
|
buttonDOMElement: Ref<HTMLElement, HTMLElement>;
|
|
18
18
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<INmorphProps> & Readonly<{}>, {
|
|
19
19
|
fill: boolean;
|
|
20
|
+
type: "submit" | "reset" | "button";
|
|
20
21
|
styleType: "default" | "transparent";
|
|
21
22
|
color: string;
|
|
22
23
|
loading: boolean;
|
|
23
24
|
ripple: boolean;
|
|
24
|
-
type: "submit" | "reset" | "button";
|
|
25
25
|
text: string | number;
|
|
26
26
|
accentBgOnHover: boolean;
|
|
27
27
|
shape: "default" | "square" | "round" | "circle";
|
|
@@ -12,8 +12,8 @@ interface INmorphProps {
|
|
|
12
12
|
iconName?: string;
|
|
13
13
|
}
|
|
14
14
|
declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<INmorphProps> & Readonly<{}>, {
|
|
15
|
-
color: string;
|
|
16
15
|
type: "error" | "accent" | "success" | "warning";
|
|
16
|
+
color: string;
|
|
17
17
|
text: string;
|
|
18
18
|
disabled: boolean;
|
|
19
19
|
target: "self" | "blank" | "parent" | "top";
|
|
@@ -22,9 +22,9 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphProps, {
|
|
|
22
22
|
onError?: (event: Event) => any;
|
|
23
23
|
onLoad?: (event: Event) => any;
|
|
24
24
|
}>, {
|
|
25
|
+
name: string;
|
|
25
26
|
size: number;
|
|
26
27
|
shape: "square" | "circle";
|
|
27
|
-
name: string;
|
|
28
28
|
src: string | string[];
|
|
29
29
|
frameBorder: number;
|
|
30
30
|
imagePadding: number;
|
|
@@ -31,9 +31,9 @@ type NmorphBadgeValueSlotProps = {
|
|
|
31
31
|
};
|
|
32
32
|
declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<INmorphProps> & Readonly<{}>, {
|
|
33
33
|
size: NmorphBadgeSize;
|
|
34
|
+
type: NmorphBadgeType;
|
|
34
35
|
value: string | number;
|
|
35
36
|
color: string;
|
|
36
|
-
type: NmorphBadgeType;
|
|
37
37
|
disabled: boolean;
|
|
38
38
|
hidden: boolean;
|
|
39
39
|
zIndex: number;
|
|
@@ -15,9 +15,9 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphProps, {
|
|
|
15
15
|
minHeight: string | number;
|
|
16
16
|
design: NmorphElementDesignType;
|
|
17
17
|
shadowType: "inset" | "outset" | "combined" | "not-defined";
|
|
18
|
+
padding: string | number;
|
|
18
19
|
description: string;
|
|
19
20
|
iconSize: string | number;
|
|
20
|
-
padding: string | number;
|
|
21
21
|
hideIcon: boolean;
|
|
22
22
|
role: string;
|
|
23
23
|
ariaLabel: string;
|
|
@@ -13,8 +13,8 @@ interface INmorphProps {
|
|
|
13
13
|
indeterminateAnimation?: string;
|
|
14
14
|
}
|
|
15
15
|
declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<INmorphProps> & Readonly<{}>, {
|
|
16
|
-
color: NmorphProgressColorType;
|
|
17
16
|
type: NmorphProgressType;
|
|
17
|
+
color: NmorphProgressColorType;
|
|
18
18
|
height: string | number;
|
|
19
19
|
valueInside: boolean;
|
|
20
20
|
valueRightSide: boolean;
|
|
@@ -16,8 +16,8 @@ interface INmorphProps {
|
|
|
16
16
|
rowHoverBackground?: string;
|
|
17
17
|
}
|
|
18
18
|
declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<INmorphProps> & Readonly<{}>, {
|
|
19
|
-
sort: NmorphTableSortType;
|
|
20
19
|
data: NmorphTableDataType;
|
|
20
|
+
sort: NmorphTableSortType;
|
|
21
21
|
cellHeight: string | number;
|
|
22
22
|
bordered: boolean;
|
|
23
23
|
design: "nmorph" | "common";
|
|
@@ -13,8 +13,8 @@ interface INmorphProps {
|
|
|
13
13
|
contentFontSize?: number | string;
|
|
14
14
|
}
|
|
15
15
|
declare const _default: DefineComponent<INmorphProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<INmorphProps> & Readonly<{}>, {
|
|
16
|
-
color: string;
|
|
17
16
|
type: NmorphCalloutType;
|
|
17
|
+
color: string;
|
|
18
18
|
title: string;
|
|
19
19
|
padding: string | number;
|
|
20
20
|
borderRadius: string | number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { INmorphCheckboxOption, INmorphCommonInputProps, NmorphCheckboxDesignType, NmorphComponentDirection, NmorphSelectionControlHeightType } from '../../../types';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
3
|
interface INmorphProps extends Omit<INmorphCommonInputProps, 'height'> {
|
|
4
|
-
modelValue
|
|
4
|
+
modelValue?: string[];
|
|
5
5
|
options?: INmorphCheckboxOption[];
|
|
6
6
|
design?: NmorphCheckboxDesignType;
|
|
7
7
|
direction?: keyof typeof NmorphComponentDirection;
|
|
@@ -18,7 +18,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphProps, {
|
|
|
18
18
|
direction: "row" | "column";
|
|
19
19
|
design: NmorphCheckboxDesignType;
|
|
20
20
|
options: INmorphCheckboxOption[];
|
|
21
|
-
}, {}, {}, {}, string, ComponentProvideOptions,
|
|
21
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>, {
|
|
22
22
|
default?(_: {}): any;
|
|
23
23
|
}>;
|
|
24
24
|
export default _default;
|
|
@@ -3,7 +3,7 @@ import { NmorphDateFormatterType, NmorphSelectedDateModelType } from '../..';
|
|
|
3
3
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
4
4
|
interface INmorphProps extends INmorphCommonInputProps {
|
|
5
5
|
placeholder?: string;
|
|
6
|
-
modelValue
|
|
6
|
+
modelValue?: NmorphSelectedDateModelType;
|
|
7
7
|
type?: keyof typeof NmorphSelectionDateType;
|
|
8
8
|
textSeparator?: string;
|
|
9
9
|
initialDate?: Date;
|
|
@@ -38,7 +38,7 @@ declare const _default: DefineComponent<INmorphProps, {}, {}, {}, {}, ComponentO
|
|
|
38
38
|
valueSeparator: string;
|
|
39
39
|
rangeSeparator: string;
|
|
40
40
|
calendarCellHeight: string | number;
|
|
41
|
-
}, {}, {}, {}, string, ComponentProvideOptions,
|
|
41
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {
|
|
42
42
|
nmorphInputDOMRef: HTMLDivElement;
|
|
43
43
|
}, HTMLDivElement>;
|
|
44
44
|
export default _default;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { INmorphCustomFileData, NmorphResolutionType } from '../..';
|
|
1
|
+
import { INmorphCustomFileData, INmorphFileUploadValidationError, NmorphResolutionType } from '../..';
|
|
2
|
+
import { INmorphCommonInputProps } from '../../../types';
|
|
2
3
|
import { DefineComponent, Ref, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
-
interface INmorphProps {
|
|
4
|
+
interface INmorphProps extends Pick<INmorphCommonInputProps, 'id' | 'name' | 'autocomplete' | 'tabindex'> {
|
|
4
5
|
modelValue?: INmorphCustomFileData[];
|
|
5
6
|
disabled?: boolean;
|
|
6
7
|
multiple?: boolean;
|
|
@@ -13,14 +14,16 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphProps, {
|
|
|
13
14
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
14
15
|
"update:model-value": (val: INmorphCustomFileData[]) => any;
|
|
15
16
|
"on-unsupported-file-type-error": (val: string) => any;
|
|
17
|
+
"on-file-validation-error": (val: INmorphFileUploadValidationError) => any;
|
|
16
18
|
}, string, PublicProps, Readonly<INmorphProps> & Readonly<{
|
|
17
19
|
"onUpdate:model-value"?: (val: INmorphCustomFileData[]) => any;
|
|
18
20
|
"onOn-unsupported-file-type-error"?: (val: string) => any;
|
|
21
|
+
"onOn-file-validation-error"?: (val: INmorphFileUploadValidationError) => any;
|
|
19
22
|
}>, {
|
|
23
|
+
allowedTypes: string[];
|
|
20
24
|
disabled: boolean;
|
|
21
25
|
modelValue: INmorphCustomFileData[];
|
|
22
26
|
multiple: boolean;
|
|
23
|
-
allowedTypes: string[];
|
|
24
27
|
photoWithPreview: boolean;
|
|
25
28
|
buttonText: string;
|
|
26
29
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import { INmorphUseFormValidation, NmorphRulesType } from '../../../hooks';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export type
|
|
5
|
-
|
|
2
|
+
import { INmorphCustomFileData } from '../nmorph-file-upload/types';
|
|
3
|
+
import { ComputedRef, Ref } from 'vue';
|
|
4
|
+
export type NmorphFileFormValueType = File | File[] | INmorphCustomFileData[];
|
|
5
|
+
export type NmorphAvailableFormValueType<TCustomValue = never> = string | string[] | number | number[] | boolean | boolean[] | Date | Date[] | null | NmorphFileFormValueType | TCustomValue;
|
|
6
|
+
export type NmorphFormFieldType<TValue = NmorphAvailableFormValueType> = {
|
|
7
|
+
value: TValue;
|
|
6
8
|
rules: NmorphRulesType;
|
|
7
|
-
}
|
|
9
|
+
};
|
|
10
|
+
export type NmorphFormValueType<TValue = NmorphAvailableFormValueType> = Record<string, NmorphFormFieldType<TValue>>;
|
|
8
11
|
export type NmorphFormValidationDataType = INmorphUseFormValidation;
|
|
9
12
|
export interface NmorphFormItemInputDataType {
|
|
10
13
|
id: Ref<string>;
|
|
11
14
|
name: Ref<string>;
|
|
12
15
|
autocomplete: Ref<string | undefined>;
|
|
16
|
+
value: ComputedRef<NmorphAvailableFormValueType | undefined>;
|
|
17
|
+
rules: ComputedRef<NmorphRulesType>;
|
|
18
|
+
errors: ComputedRef<string[]>;
|
|
19
|
+
valid: ComputedRef<boolean>;
|
|
20
|
+
touched: ComputedRef<boolean>;
|
|
21
|
+
updateValue: (value: NmorphAvailableFormValueType) => void;
|
|
22
|
+
validate: (value?: NmorphAvailableFormValueType) => void;
|
|
13
23
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { INmorphCommonInputProps } from '../../../types';
|
|
2
|
+
import { NmorphAvailableFormValueType, NmorphFormItemInputDataType } from './types';
|
|
2
3
|
import { ComputedRef } from 'vue';
|
|
3
4
|
export declare const nmorphFormItemInputDataKey = "nmorph-form-item-input-data";
|
|
4
5
|
export declare const useFormItemInput: (props: Pick<INmorphCommonInputProps, 'id' | 'name' | 'tabindex' | 'autocomplete'>) => {
|
|
@@ -7,3 +8,12 @@ export declare const useFormItemInput: (props: Pick<INmorphCommonInputProps, 'id
|
|
|
7
8
|
autocomplete: ComputedRef<string>;
|
|
8
9
|
tabindex: ComputedRef<number>;
|
|
9
10
|
};
|
|
11
|
+
export declare const useFormItemModel: <T extends NmorphAvailableFormValueType>(props: {
|
|
12
|
+
modelValue?: T;
|
|
13
|
+
}, emitUpdate: (value: T) => void, fallbackValue: T) => {
|
|
14
|
+
formItemInputData: NmorphFormItemInputDataType;
|
|
15
|
+
modelValue: ComputedRef<T>;
|
|
16
|
+
modelValueIsControlled: ComputedRef<any>;
|
|
17
|
+
updateModelValue: (value: T) => void;
|
|
18
|
+
validateModelValue: (value?: T) => void;
|
|
19
|
+
};
|
|
@@ -2,7 +2,7 @@ import { INmorphCommonInputProps, INmorphRadioOption, NmorphComponentDirection,
|
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
3
|
type NmorphListRadioOptionElementType = Omit<INmorphRadioOption, 'checked'>;
|
|
4
4
|
interface INmorphProps extends Omit<INmorphCommonInputProps, 'height'> {
|
|
5
|
-
modelValue
|
|
5
|
+
modelValue?: string;
|
|
6
6
|
options?: NmorphListRadioOptionElementType[];
|
|
7
7
|
styleType?: keyof typeof NmorphRadioStyleType;
|
|
8
8
|
direction?: keyof typeof NmorphComponentDirection;
|
|
@@ -19,7 +19,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphProps, {
|
|
|
19
19
|
modelValue: string;
|
|
20
20
|
direction: "row" | "column";
|
|
21
21
|
options: NmorphListRadioOptionElementType[];
|
|
22
|
-
}, {}, {}, {}, string, ComponentProvideOptions,
|
|
22
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>, {
|
|
23
23
|
default?(_: {}): any;
|
|
24
24
|
}>;
|
|
25
25
|
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { NmorphAvailableFormValueType } from '../components/form/nmorph-form/types';
|
|
2
|
+
import { NmorphResolutionType } from '../components/form/nmorph-file-upload/types';
|
|
2
3
|
import { Ref } from 'vue';
|
|
3
4
|
export declare const enum NmorphArrayValidationOperator {
|
|
4
5
|
'contains-one' = "contains-one",
|
|
@@ -22,6 +23,12 @@ export interface INmorphRule {
|
|
|
22
23
|
booleanCompareType?: keyof typeof NmorphBooleanCompareOperator;
|
|
23
24
|
arrayCompareType?: keyof typeof NmorphArrayValidationOperator;
|
|
24
25
|
compareValue?: boolean | number | string | string[];
|
|
26
|
+
maxFileSize?: number;
|
|
27
|
+
fileMaxSize?: number;
|
|
28
|
+
allowedTypes?: Array<NmorphResolutionType | string>;
|
|
29
|
+
fileAllowedTypes?: Array<NmorphResolutionType | string>;
|
|
30
|
+
maxFiles?: number;
|
|
31
|
+
fileMaxCount?: number;
|
|
25
32
|
error: string;
|
|
26
33
|
}
|
|
27
34
|
export type NmorphValidationInputValueType = NmorphAvailableFormValueType | null;
|
|
@@ -45,6 +52,14 @@ export interface INmorphCheckboxGroupValidationRule extends INmorphRule {
|
|
|
45
52
|
arrayCompareType: keyof typeof NmorphArrayValidationOperator;
|
|
46
53
|
compareValue: string[];
|
|
47
54
|
}
|
|
55
|
+
export interface INmorphFileValidationRule extends INmorphRule {
|
|
56
|
+
maxFileSize?: number;
|
|
57
|
+
fileMaxSize?: number;
|
|
58
|
+
allowedTypes?: Array<NmorphResolutionType | string>;
|
|
59
|
+
fileAllowedTypes?: Array<NmorphResolutionType | string>;
|
|
60
|
+
maxFiles?: number;
|
|
61
|
+
fileMaxCount?: number;
|
|
62
|
+
}
|
|
48
63
|
export declare const useFieldValidation: (data: INmorphUseValidationPayload) => {
|
|
49
64
|
touched: Ref<boolean, boolean>;
|
|
50
65
|
valid: Ref<boolean, boolean>;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
+
import { useFieldValidation } from '.';
|
|
2
3
|
import { NmorphFormValueType } from '../components/form/nmorph-form/types';
|
|
4
|
+
import { NmorphValidationInputValueType } from './use-field-validation';
|
|
3
5
|
export interface INmorphUseFormValidation {
|
|
6
|
+
formValue: NmorphFormValueType;
|
|
4
7
|
fields: Record<string, {
|
|
5
8
|
touched: Ref<boolean>;
|
|
6
9
|
valid: Ref<boolean>;
|
|
7
10
|
errors: Ref<string[]>;
|
|
8
11
|
validate: () => void;
|
|
9
12
|
}>;
|
|
13
|
+
updateFieldValue: (fieldName: string, value: NmorphValidationInputValueType) => void;
|
|
14
|
+
validateField: (fieldName: string, inputValue?: NmorphValidationInputValueType) => ReturnType<typeof useFieldValidation> | undefined;
|
|
10
15
|
isFormValid: Ref<boolean>;
|
|
11
16
|
isAnyTouched: Ref<boolean>;
|
|
12
17
|
}
|