@naptics/vue-collection 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/components/NAlert.d.ts +20 -20
- package/components/NAlert.js +3 -3
- package/components/NBadge.d.ts +87 -87
- package/components/NBadge.js +3 -3
- package/components/NBreadcrub.d.ts +57 -57
- package/components/NBreadcrub.js +3 -3
- package/components/NButton.d.ts +69 -69
- package/components/NButton.js +3 -3
- package/components/NCheckbox.d.ts +20 -20
- package/components/NCheckbox.js +3 -3
- package/components/NCheckboxLabel.d.ts +30 -30
- package/components/NCheckboxLabel.js +3 -3
- package/components/NCrudModal.d.ts +238 -203
- package/components/NCrudModal.js +17 -4
- package/components/NDialog.d.ts +1 -1
- package/components/NDialog.js +3 -3
- package/components/NDropdown.d.ts +25 -25
- package/components/NDropdown.js +3 -3
- package/components/NDropzone.d.ts +52 -52
- package/components/NDropzone.js +3 -3
- package/components/NForm.d.ts +6 -6
- package/components/NForm.js +3 -3
- package/components/NFormModal.d.ts +136 -136
- package/components/NFormModal.js +3 -3
- package/components/NIconButton.d.ts +94 -94
- package/components/NIconButton.js +3 -3
- package/components/NIconCircle.d.ts +46 -46
- package/components/NIconCircle.js +3 -3
- package/components/NInput.d.ts +94 -94
- package/components/NInput.js +3 -3
- package/components/NInputPhone.d.ts +125 -125
- package/components/NInputPhone.js +2 -2
- package/components/NInputSelect.d.ts +131 -131
- package/components/NInputSelect.js +3 -3
- package/components/NInputSuggestion.d.ts +179 -167
- package/components/NInputSuggestion.js +3 -3
- package/components/NLink.d.ts +32 -32
- package/components/NLink.js +3 -3
- package/components/NList.d.ts +10 -10
- package/components/NList.js +3 -3
- package/components/NLoadingIndicator.d.ts +30 -30
- package/components/NLoadingIndicator.js +3 -3
- package/components/NModal.d.ts +118 -118
- package/components/NModal.js +3 -3
- package/components/NPagination.d.ts +30 -30
- package/components/NPagination.js +3 -3
- package/components/NSearchbar.d.ts +29 -29
- package/components/NSearchbar.js +3 -3
- package/components/NSearchbarList.d.ts +53 -62
- package/components/NSearchbarList.js +3 -3
- package/components/NSelect.d.ts +64 -64
- package/components/NSelect.js +3 -3
- package/components/NSuggestionList.d.ts +84 -84
- package/components/NSuggestionList.js +7 -7
- package/components/NTable.d.ts +29 -29
- package/components/NTable.js +3 -3
- package/components/NTableAction.d.ts +19 -19
- package/components/NTableAction.js +3 -3
- package/components/NTextArea.d.ts +118 -118
- package/components/NTextArea.js +5 -5
- package/components/NTooltip.d.ts +42 -42
- package/components/NTooltip.js +3 -3
- package/components/NValInput.d.ts +134 -134
- package/components/NValInput.js +5 -5
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +3 -1
- package/utils/breakpoints.d.ts +3 -0
- package/utils/breakpoints.js +3 -0
- package/utils/component.d.ts +0 -8
- package/utils/component.js +0 -10
- package/utils/identifiable.d.ts +8 -8
- package/utils/identifiable.js +4 -2
- package/utils/tailwind.d.ts +2 -0
- package/utils/utils.d.ts +25 -12
- package/utils/utils.js +30 -9
package/components/NTooltip.d.ts
CHANGED
|
@@ -6,37 +6,37 @@ export declare const nTooltipProps: {
|
|
|
6
6
|
/**
|
|
7
7
|
* The text content of the tooltip.
|
|
8
8
|
*/
|
|
9
|
-
text: StringConstructor;
|
|
9
|
+
readonly text: StringConstructor;
|
|
10
10
|
/**
|
|
11
11
|
* A slot to replace the content of the tooltip. This will override the `text` prop.
|
|
12
12
|
*/
|
|
13
|
-
content: PropType<() => void>;
|
|
13
|
+
readonly content: PropType<() => void>;
|
|
14
14
|
/**
|
|
15
15
|
* If set to `true` the tooltip is shown constantly.
|
|
16
16
|
*/
|
|
17
|
-
show: BooleanConstructor;
|
|
17
|
+
readonly show: BooleanConstructor;
|
|
18
18
|
/**
|
|
19
19
|
* If set to `true` the tooltip is hidden constantly.
|
|
20
20
|
*/
|
|
21
|
-
hide: BooleanConstructor;
|
|
21
|
+
readonly hide: BooleanConstructor;
|
|
22
22
|
/**
|
|
23
23
|
* If set to `true` the `block` class is applied to the tooltip.
|
|
24
24
|
* This should be set if the content in the default slot is also block.
|
|
25
25
|
*/
|
|
26
|
-
block: BooleanConstructor;
|
|
26
|
+
readonly block: BooleanConstructor;
|
|
27
27
|
/**
|
|
28
28
|
* The placement of the tooltip.
|
|
29
29
|
*/
|
|
30
|
-
placement: {
|
|
31
|
-
type: PropType<TooltipPlacement>;
|
|
32
|
-
default:
|
|
30
|
+
readonly placement: {
|
|
31
|
+
readonly type: PropType<TooltipPlacement>;
|
|
32
|
+
readonly default: "auto";
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
35
|
* The maximum width of the tooltip.
|
|
36
36
|
*/
|
|
37
|
-
maxWidth: {
|
|
38
|
-
type: PropType<TWMaxWidth>;
|
|
39
|
-
default:
|
|
37
|
+
readonly maxWidth: {
|
|
38
|
+
readonly type: PropType<TWMaxWidth>;
|
|
39
|
+
readonly default: "max-w-xs";
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
42
|
/**
|
|
@@ -69,15 +69,15 @@ export declare const nToolTipPropsForImplementor: {
|
|
|
69
69
|
* @see {@link nTooltipProps.placement}
|
|
70
70
|
*/
|
|
71
71
|
tooltipPlacement: {
|
|
72
|
-
type: PropType<TooltipPlacement>;
|
|
73
|
-
default:
|
|
72
|
+
readonly type: PropType<TooltipPlacement>;
|
|
73
|
+
readonly default: "auto";
|
|
74
74
|
};
|
|
75
75
|
/**
|
|
76
76
|
* @see {@link nTooltipProps.maxWidth}
|
|
77
77
|
*/
|
|
78
78
|
tooltipMaxWidth: {
|
|
79
|
-
type: PropType<TWMaxWidth>;
|
|
80
|
-
default:
|
|
79
|
+
readonly type: PropType<TWMaxWidth>;
|
|
80
|
+
readonly default: "max-w-xs";
|
|
81
81
|
};
|
|
82
82
|
};
|
|
83
83
|
/**
|
|
@@ -107,80 +107,80 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
107
107
|
/**
|
|
108
108
|
* The text content of the tooltip.
|
|
109
109
|
*/
|
|
110
|
-
text: StringConstructor;
|
|
110
|
+
readonly text: StringConstructor;
|
|
111
111
|
/**
|
|
112
112
|
* A slot to replace the content of the tooltip. This will override the `text` prop.
|
|
113
113
|
*/
|
|
114
|
-
content: PropType<() => void>;
|
|
114
|
+
readonly content: PropType<() => void>;
|
|
115
115
|
/**
|
|
116
116
|
* If set to `true` the tooltip is shown constantly.
|
|
117
117
|
*/
|
|
118
|
-
show: BooleanConstructor;
|
|
118
|
+
readonly show: BooleanConstructor;
|
|
119
119
|
/**
|
|
120
120
|
* If set to `true` the tooltip is hidden constantly.
|
|
121
121
|
*/
|
|
122
|
-
hide: BooleanConstructor;
|
|
122
|
+
readonly hide: BooleanConstructor;
|
|
123
123
|
/**
|
|
124
124
|
* If set to `true` the `block` class is applied to the tooltip.
|
|
125
125
|
* This should be set if the content in the default slot is also block.
|
|
126
126
|
*/
|
|
127
|
-
block: BooleanConstructor;
|
|
127
|
+
readonly block: BooleanConstructor;
|
|
128
128
|
/**
|
|
129
129
|
* The placement of the tooltip.
|
|
130
130
|
*/
|
|
131
|
-
placement: {
|
|
132
|
-
type: PropType<TooltipPlacement>;
|
|
133
|
-
default:
|
|
131
|
+
readonly placement: {
|
|
132
|
+
readonly type: PropType<TooltipPlacement>;
|
|
133
|
+
readonly default: "auto";
|
|
134
134
|
};
|
|
135
135
|
/**
|
|
136
136
|
* The maximum width of the tooltip.
|
|
137
137
|
*/
|
|
138
|
-
maxWidth: {
|
|
139
|
-
type: PropType<TWMaxWidth>;
|
|
140
|
-
default:
|
|
138
|
+
readonly maxWidth: {
|
|
139
|
+
readonly type: PropType<TWMaxWidth>;
|
|
140
|
+
readonly default: "max-w-xs";
|
|
141
141
|
};
|
|
142
142
|
}, import("vue").RenderFunction, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
143
143
|
/**
|
|
144
144
|
* The text content of the tooltip.
|
|
145
145
|
*/
|
|
146
|
-
text: StringConstructor;
|
|
146
|
+
readonly text: StringConstructor;
|
|
147
147
|
/**
|
|
148
148
|
* A slot to replace the content of the tooltip. This will override the `text` prop.
|
|
149
149
|
*/
|
|
150
|
-
content: PropType<() => void>;
|
|
150
|
+
readonly content: PropType<() => void>;
|
|
151
151
|
/**
|
|
152
152
|
* If set to `true` the tooltip is shown constantly.
|
|
153
153
|
*/
|
|
154
|
-
show: BooleanConstructor;
|
|
154
|
+
readonly show: BooleanConstructor;
|
|
155
155
|
/**
|
|
156
156
|
* If set to `true` the tooltip is hidden constantly.
|
|
157
157
|
*/
|
|
158
|
-
hide: BooleanConstructor;
|
|
158
|
+
readonly hide: BooleanConstructor;
|
|
159
159
|
/**
|
|
160
160
|
* If set to `true` the `block` class is applied to the tooltip.
|
|
161
161
|
* This should be set if the content in the default slot is also block.
|
|
162
162
|
*/
|
|
163
|
-
block: BooleanConstructor;
|
|
163
|
+
readonly block: BooleanConstructor;
|
|
164
164
|
/**
|
|
165
165
|
* The placement of the tooltip.
|
|
166
166
|
*/
|
|
167
|
-
placement: {
|
|
168
|
-
type: PropType<TooltipPlacement>;
|
|
169
|
-
default:
|
|
167
|
+
readonly placement: {
|
|
168
|
+
readonly type: PropType<TooltipPlacement>;
|
|
169
|
+
readonly default: "auto";
|
|
170
170
|
};
|
|
171
171
|
/**
|
|
172
172
|
* The maximum width of the tooltip.
|
|
173
173
|
*/
|
|
174
|
-
maxWidth: {
|
|
175
|
-
type: PropType<TWMaxWidth>;
|
|
176
|
-
default:
|
|
174
|
+
readonly maxWidth: {
|
|
175
|
+
readonly type: PropType<TWMaxWidth>;
|
|
176
|
+
readonly default: "max-w-xs";
|
|
177
177
|
};
|
|
178
178
|
}>> & {}, {
|
|
179
|
-
show: boolean;
|
|
180
|
-
hide: boolean;
|
|
181
|
-
block: boolean;
|
|
182
|
-
placement: TooltipPlacement;
|
|
183
|
-
maxWidth: TWMaxWidth;
|
|
179
|
+
readonly show: boolean;
|
|
180
|
+
readonly hide: boolean;
|
|
181
|
+
readonly block: boolean;
|
|
182
|
+
readonly placement: TooltipPlacement;
|
|
183
|
+
readonly maxWidth: TWMaxWidth;
|
|
184
184
|
}>;
|
|
185
185
|
export default _default;
|
|
186
186
|
export type TooltipPlacement = 'auto' | 'auto-start' | 'auto-end' | 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'right' | 'right-start' | 'right-end' | 'left' | 'left-start' | 'left-end';
|
package/components/NTooltip.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { withDirectives as _withDirectives, vShow as _vShow, Fragment as _Fragment, createVNode as _createVNode } from "vue";
|
|
2
|
-
import { createComponent
|
|
2
|
+
import { createComponent } from '../utils/component';
|
|
3
3
|
import { uniqueId } from '../utils/utils';
|
|
4
4
|
import { computed, onMounted, ref, watch, onUnmounted, Transition } from 'vue';
|
|
5
5
|
import { createPopper } from '@popperjs/core';
|
|
6
6
|
import { watchRef } from '../utils/vue';
|
|
7
7
|
import './NTooltip.css';
|
|
8
|
-
export const nTooltipProps =
|
|
8
|
+
export const nTooltipProps = {
|
|
9
9
|
/**
|
|
10
10
|
* The text content of the tooltip.
|
|
11
11
|
*/
|
|
@@ -41,7 +41,7 @@ export const nTooltipProps = createProps({
|
|
|
41
41
|
type: String,
|
|
42
42
|
default: 'max-w-xs'
|
|
43
43
|
}
|
|
44
|
-
}
|
|
44
|
+
};
|
|
45
45
|
/**
|
|
46
46
|
* These props are made to use on a component which implements the tooltip
|
|
47
47
|
* and wants it to be controllable via the own props.
|
|
@@ -7,111 +7,111 @@ export declare const validationProps: {
|
|
|
7
7
|
* If set to `true` this input is always valid when its value is empty.
|
|
8
8
|
* If set to `false` the input receives the {@link required} rule. Default is `false`.
|
|
9
9
|
*/
|
|
10
|
-
optional: BooleanConstructor;
|
|
10
|
+
readonly optional: BooleanConstructor;
|
|
11
11
|
/**
|
|
12
12
|
* The rules which this input is checked with.
|
|
13
13
|
* The rules are checked sequentially and the error of the first failed rule is displayed.
|
|
14
14
|
* If `optional` is set to false, the rule {@link required} will be checked first.
|
|
15
15
|
*/
|
|
16
|
-
rules: {
|
|
17
|
-
type: PropType<ValidationRule | ValidationRule[]>;
|
|
18
|
-
default: () => never[];
|
|
16
|
+
readonly rules: {
|
|
17
|
+
readonly type: PropType<ValidationRule | ValidationRule[]>;
|
|
18
|
+
readonly default: () => never[];
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
21
|
* The form, which this input will be added to.
|
|
22
22
|
* On initialization, this input will call {@link ValidatedForm.addInput} passing itself to the form.
|
|
23
23
|
*/
|
|
24
|
-
form: PropType<ValidatedForm>;
|
|
24
|
+
readonly form: PropType<ValidatedForm>;
|
|
25
25
|
/**
|
|
26
26
|
* Overrides the internal error state. If set to true, it will always display an error.
|
|
27
27
|
*/
|
|
28
|
-
error: BooleanConstructor;
|
|
28
|
+
readonly error: BooleanConstructor;
|
|
29
29
|
/**
|
|
30
30
|
* Overrides the internal error message. If set, this message is always displayed.
|
|
31
31
|
*/
|
|
32
|
-
errorMessage: StringConstructor;
|
|
32
|
+
readonly errorMessage: StringConstructor;
|
|
33
33
|
/**
|
|
34
34
|
* If set to `true` the error message is not shown.
|
|
35
35
|
* However, the input is still marked red if it is in an error state.
|
|
36
36
|
*/
|
|
37
|
-
hideErrorMessage: BooleanConstructor;
|
|
37
|
+
readonly hideErrorMessage: BooleanConstructor;
|
|
38
38
|
/**
|
|
39
39
|
* Disables the validation on blur. Should only be used in special occasions.
|
|
40
40
|
*/
|
|
41
|
-
disableBlurValidation: BooleanConstructor;
|
|
41
|
+
readonly disableBlurValidation: BooleanConstructor;
|
|
42
42
|
};
|
|
43
43
|
export declare const nValInputProps: {
|
|
44
44
|
/**
|
|
45
45
|
* A slot to replace the input.
|
|
46
46
|
*/
|
|
47
|
-
input: PropType<(props: InputSlotProps) => JSX.Element>;
|
|
47
|
+
readonly input: PropType<(props: InputSlotProps) => JSX.Element>;
|
|
48
48
|
/**
|
|
49
49
|
* If set to `true` this input is always valid when its value is empty.
|
|
50
50
|
* If set to `false` the input receives the {@link required} rule. Default is `false`.
|
|
51
51
|
*/
|
|
52
|
-
optional: BooleanConstructor;
|
|
52
|
+
readonly optional: BooleanConstructor;
|
|
53
53
|
/**
|
|
54
54
|
* The rules which this input is checked with.
|
|
55
55
|
* The rules are checked sequentially and the error of the first failed rule is displayed.
|
|
56
56
|
* If `optional` is set to false, the rule {@link required} will be checked first.
|
|
57
57
|
*/
|
|
58
|
-
rules: {
|
|
59
|
-
type: PropType<ValidationRule | ValidationRule[]>;
|
|
60
|
-
default: () => never[];
|
|
58
|
+
readonly rules: {
|
|
59
|
+
readonly type: PropType<ValidationRule | ValidationRule[]>;
|
|
60
|
+
readonly default: () => never[];
|
|
61
61
|
};
|
|
62
62
|
/**
|
|
63
63
|
* The form, which this input will be added to.
|
|
64
64
|
* On initialization, this input will call {@link ValidatedForm.addInput} passing itself to the form.
|
|
65
65
|
*/
|
|
66
|
-
form: PropType<ValidatedForm>;
|
|
66
|
+
readonly form: PropType<ValidatedForm>;
|
|
67
67
|
/**
|
|
68
68
|
* Overrides the internal error state. If set to true, it will always display an error.
|
|
69
69
|
*/
|
|
70
|
-
error: BooleanConstructor;
|
|
70
|
+
readonly error: BooleanConstructor;
|
|
71
71
|
/**
|
|
72
72
|
* Overrides the internal error message. If set, this message is always displayed.
|
|
73
73
|
*/
|
|
74
|
-
errorMessage: StringConstructor;
|
|
74
|
+
readonly errorMessage: StringConstructor;
|
|
75
75
|
/**
|
|
76
76
|
* If set to `true` the error message is not shown.
|
|
77
77
|
* However, the input is still marked red if it is in an error state.
|
|
78
78
|
*/
|
|
79
|
-
hideErrorMessage: BooleanConstructor;
|
|
79
|
+
readonly hideErrorMessage: BooleanConstructor;
|
|
80
80
|
/**
|
|
81
81
|
* Disables the validation on blur. Should only be used in special occasions.
|
|
82
82
|
*/
|
|
83
|
-
disableBlurValidation: BooleanConstructor;
|
|
84
|
-
tooltipText: StringConstructor;
|
|
85
|
-
tooltipContent: PropType<() => void>;
|
|
86
|
-
tooltipHide: BooleanConstructor;
|
|
87
|
-
tooltipShow: BooleanConstructor;
|
|
88
|
-
tooltipPlacement: {
|
|
89
|
-
type: PropType<import("./NTooltip").TooltipPlacement>;
|
|
90
|
-
default:
|
|
83
|
+
readonly disableBlurValidation: BooleanConstructor;
|
|
84
|
+
readonly tooltipText: StringConstructor;
|
|
85
|
+
readonly tooltipContent: PropType<() => void>;
|
|
86
|
+
readonly tooltipHide: BooleanConstructor;
|
|
87
|
+
readonly tooltipShow: BooleanConstructor;
|
|
88
|
+
readonly tooltipPlacement: {
|
|
89
|
+
readonly type: PropType<import("./NTooltip").TooltipPlacement>;
|
|
90
|
+
readonly default: "auto";
|
|
91
91
|
};
|
|
92
|
-
tooltipMaxWidth: {
|
|
93
|
-
type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
94
|
-
default:
|
|
92
|
+
readonly tooltipMaxWidth: {
|
|
93
|
+
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
94
|
+
readonly default: "max-w-xs";
|
|
95
95
|
};
|
|
96
|
-
name: StringConstructor;
|
|
97
|
-
placeholder: StringConstructor;
|
|
98
|
-
autocomplete: {
|
|
99
|
-
type: StringConstructor;
|
|
100
|
-
default:
|
|
96
|
+
readonly name: StringConstructor;
|
|
97
|
+
readonly placeholder: StringConstructor;
|
|
98
|
+
readonly autocomplete: {
|
|
99
|
+
readonly type: StringConstructor;
|
|
100
|
+
readonly default: "off";
|
|
101
101
|
};
|
|
102
|
-
type: {
|
|
103
|
-
type: StringConstructor;
|
|
104
|
-
default:
|
|
102
|
+
readonly type: {
|
|
103
|
+
readonly type: StringConstructor;
|
|
104
|
+
readonly default: "text";
|
|
105
105
|
};
|
|
106
|
-
max: StringConstructor;
|
|
107
|
-
min: StringConstructor;
|
|
108
|
-
disabled: BooleanConstructor;
|
|
109
|
-
small: BooleanConstructor;
|
|
110
|
-
hideLabel: BooleanConstructor;
|
|
111
|
-
onFocus: PropType<() => void>;
|
|
112
|
-
onBlur: PropType<() => void>;
|
|
113
|
-
value: PropType<string>;
|
|
114
|
-
onUpdateValue: PropType<(newValue: string) => void>;
|
|
106
|
+
readonly max: StringConstructor;
|
|
107
|
+
readonly min: StringConstructor;
|
|
108
|
+
readonly disabled: BooleanConstructor;
|
|
109
|
+
readonly small: BooleanConstructor;
|
|
110
|
+
readonly hideLabel: BooleanConstructor;
|
|
111
|
+
readonly onFocus: PropType<() => void>;
|
|
112
|
+
readonly onBlur: PropType<() => void>;
|
|
113
|
+
readonly value: PropType<string>;
|
|
114
|
+
readonly onUpdateValue: PropType<(newValue: string) => void>;
|
|
115
115
|
};
|
|
116
116
|
export type InputSlotProps = {
|
|
117
117
|
onBlur(): void;
|
|
@@ -138,160 +138,160 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
138
138
|
/**
|
|
139
139
|
* A slot to replace the input.
|
|
140
140
|
*/
|
|
141
|
-
input: PropType<(props: InputSlotProps) => JSX.Element>;
|
|
141
|
+
readonly input: PropType<(props: InputSlotProps) => JSX.Element>;
|
|
142
142
|
/**
|
|
143
143
|
* If set to `true` this input is always valid when its value is empty.
|
|
144
144
|
* If set to `false` the input receives the {@link required} rule. Default is `false`.
|
|
145
145
|
*/
|
|
146
|
-
optional: BooleanConstructor;
|
|
146
|
+
readonly optional: BooleanConstructor;
|
|
147
147
|
/**
|
|
148
148
|
* The rules which this input is checked with.
|
|
149
149
|
* The rules are checked sequentially and the error of the first failed rule is displayed.
|
|
150
150
|
* If `optional` is set to false, the rule {@link required} will be checked first.
|
|
151
151
|
*/
|
|
152
|
-
rules: {
|
|
153
|
-
type: PropType<ValidationRule | ValidationRule[]>;
|
|
154
|
-
default: () => never[];
|
|
152
|
+
readonly rules: {
|
|
153
|
+
readonly type: PropType<ValidationRule | ValidationRule[]>;
|
|
154
|
+
readonly default: () => never[];
|
|
155
155
|
};
|
|
156
156
|
/**
|
|
157
157
|
* The form, which this input will be added to.
|
|
158
158
|
* On initialization, this input will call {@link ValidatedForm.addInput} passing itself to the form.
|
|
159
159
|
*/
|
|
160
|
-
form: PropType<ValidatedForm>;
|
|
160
|
+
readonly form: PropType<ValidatedForm>;
|
|
161
161
|
/**
|
|
162
162
|
* Overrides the internal error state. If set to true, it will always display an error.
|
|
163
163
|
*/
|
|
164
|
-
error: BooleanConstructor;
|
|
164
|
+
readonly error: BooleanConstructor;
|
|
165
165
|
/**
|
|
166
166
|
* Overrides the internal error message. If set, this message is always displayed.
|
|
167
167
|
*/
|
|
168
|
-
errorMessage: StringConstructor;
|
|
168
|
+
readonly errorMessage: StringConstructor;
|
|
169
169
|
/**
|
|
170
170
|
* If set to `true` the error message is not shown.
|
|
171
171
|
* However, the input is still marked red if it is in an error state.
|
|
172
172
|
*/
|
|
173
|
-
hideErrorMessage: BooleanConstructor;
|
|
173
|
+
readonly hideErrorMessage: BooleanConstructor;
|
|
174
174
|
/**
|
|
175
175
|
* Disables the validation on blur. Should only be used in special occasions.
|
|
176
176
|
*/
|
|
177
|
-
disableBlurValidation: BooleanConstructor;
|
|
178
|
-
tooltipText: StringConstructor;
|
|
179
|
-
tooltipContent: PropType<() => void>;
|
|
180
|
-
tooltipHide: BooleanConstructor;
|
|
181
|
-
tooltipShow: BooleanConstructor;
|
|
182
|
-
tooltipPlacement: {
|
|
183
|
-
type: PropType<import("./NTooltip").TooltipPlacement>;
|
|
184
|
-
default:
|
|
177
|
+
readonly disableBlurValidation: BooleanConstructor;
|
|
178
|
+
readonly tooltipText: StringConstructor;
|
|
179
|
+
readonly tooltipContent: PropType<() => void>;
|
|
180
|
+
readonly tooltipHide: BooleanConstructor;
|
|
181
|
+
readonly tooltipShow: BooleanConstructor;
|
|
182
|
+
readonly tooltipPlacement: {
|
|
183
|
+
readonly type: PropType<import("./NTooltip").TooltipPlacement>;
|
|
184
|
+
readonly default: "auto";
|
|
185
185
|
};
|
|
186
|
-
tooltipMaxWidth: {
|
|
187
|
-
type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
188
|
-
default:
|
|
186
|
+
readonly tooltipMaxWidth: {
|
|
187
|
+
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
188
|
+
readonly default: "max-w-xs";
|
|
189
189
|
};
|
|
190
|
-
name: StringConstructor;
|
|
191
|
-
placeholder: StringConstructor;
|
|
192
|
-
autocomplete: {
|
|
193
|
-
type: StringConstructor;
|
|
194
|
-
default:
|
|
190
|
+
readonly name: StringConstructor;
|
|
191
|
+
readonly placeholder: StringConstructor;
|
|
192
|
+
readonly autocomplete: {
|
|
193
|
+
readonly type: StringConstructor;
|
|
194
|
+
readonly default: "off";
|
|
195
195
|
};
|
|
196
|
-
type: {
|
|
197
|
-
type: StringConstructor;
|
|
198
|
-
default:
|
|
196
|
+
readonly type: {
|
|
197
|
+
readonly type: StringConstructor;
|
|
198
|
+
readonly default: "text";
|
|
199
199
|
};
|
|
200
|
-
max: StringConstructor;
|
|
201
|
-
min: StringConstructor;
|
|
202
|
-
disabled: BooleanConstructor;
|
|
203
|
-
small: BooleanConstructor;
|
|
204
|
-
hideLabel: BooleanConstructor;
|
|
205
|
-
onFocus: PropType<() => void>;
|
|
206
|
-
onBlur: PropType<() => void>;
|
|
207
|
-
value: PropType<string>;
|
|
208
|
-
onUpdateValue: PropType<(newValue: string) => void>;
|
|
200
|
+
readonly max: StringConstructor;
|
|
201
|
+
readonly min: StringConstructor;
|
|
202
|
+
readonly disabled: BooleanConstructor;
|
|
203
|
+
readonly small: BooleanConstructor;
|
|
204
|
+
readonly hideLabel: BooleanConstructor;
|
|
205
|
+
readonly onFocus: PropType<() => void>;
|
|
206
|
+
readonly onBlur: PropType<() => void>;
|
|
207
|
+
readonly value: PropType<string>;
|
|
208
|
+
readonly onUpdateValue: PropType<(newValue: string) => void>;
|
|
209
209
|
}, import("vue").RenderFunction, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
210
210
|
/**
|
|
211
211
|
* A slot to replace the input.
|
|
212
212
|
*/
|
|
213
|
-
input: PropType<(props: InputSlotProps) => JSX.Element>;
|
|
213
|
+
readonly input: PropType<(props: InputSlotProps) => JSX.Element>;
|
|
214
214
|
/**
|
|
215
215
|
* If set to `true` this input is always valid when its value is empty.
|
|
216
216
|
* If set to `false` the input receives the {@link required} rule. Default is `false`.
|
|
217
217
|
*/
|
|
218
|
-
optional: BooleanConstructor;
|
|
218
|
+
readonly optional: BooleanConstructor;
|
|
219
219
|
/**
|
|
220
220
|
* The rules which this input is checked with.
|
|
221
221
|
* The rules are checked sequentially and the error of the first failed rule is displayed.
|
|
222
222
|
* If `optional` is set to false, the rule {@link required} will be checked first.
|
|
223
223
|
*/
|
|
224
|
-
rules: {
|
|
225
|
-
type: PropType<ValidationRule | ValidationRule[]>;
|
|
226
|
-
default: () => never[];
|
|
224
|
+
readonly rules: {
|
|
225
|
+
readonly type: PropType<ValidationRule | ValidationRule[]>;
|
|
226
|
+
readonly default: () => never[];
|
|
227
227
|
};
|
|
228
228
|
/**
|
|
229
229
|
* The form, which this input will be added to.
|
|
230
230
|
* On initialization, this input will call {@link ValidatedForm.addInput} passing itself to the form.
|
|
231
231
|
*/
|
|
232
|
-
form: PropType<ValidatedForm>;
|
|
232
|
+
readonly form: PropType<ValidatedForm>;
|
|
233
233
|
/**
|
|
234
234
|
* Overrides the internal error state. If set to true, it will always display an error.
|
|
235
235
|
*/
|
|
236
|
-
error: BooleanConstructor;
|
|
236
|
+
readonly error: BooleanConstructor;
|
|
237
237
|
/**
|
|
238
238
|
* Overrides the internal error message. If set, this message is always displayed.
|
|
239
239
|
*/
|
|
240
|
-
errorMessage: StringConstructor;
|
|
240
|
+
readonly errorMessage: StringConstructor;
|
|
241
241
|
/**
|
|
242
242
|
* If set to `true` the error message is not shown.
|
|
243
243
|
* However, the input is still marked red if it is in an error state.
|
|
244
244
|
*/
|
|
245
|
-
hideErrorMessage: BooleanConstructor;
|
|
245
|
+
readonly hideErrorMessage: BooleanConstructor;
|
|
246
246
|
/**
|
|
247
247
|
* Disables the validation on blur. Should only be used in special occasions.
|
|
248
248
|
*/
|
|
249
|
-
disableBlurValidation: BooleanConstructor;
|
|
250
|
-
tooltipText: StringConstructor;
|
|
251
|
-
tooltipContent: PropType<() => void>;
|
|
252
|
-
tooltipHide: BooleanConstructor;
|
|
253
|
-
tooltipShow: BooleanConstructor;
|
|
254
|
-
tooltipPlacement: {
|
|
255
|
-
type: PropType<import("./NTooltip").TooltipPlacement>;
|
|
256
|
-
default:
|
|
249
|
+
readonly disableBlurValidation: BooleanConstructor;
|
|
250
|
+
readonly tooltipText: StringConstructor;
|
|
251
|
+
readonly tooltipContent: PropType<() => void>;
|
|
252
|
+
readonly tooltipHide: BooleanConstructor;
|
|
253
|
+
readonly tooltipShow: BooleanConstructor;
|
|
254
|
+
readonly tooltipPlacement: {
|
|
255
|
+
readonly type: PropType<import("./NTooltip").TooltipPlacement>;
|
|
256
|
+
readonly default: "auto";
|
|
257
257
|
};
|
|
258
|
-
tooltipMaxWidth: {
|
|
259
|
-
type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
260
|
-
default:
|
|
258
|
+
readonly tooltipMaxWidth: {
|
|
259
|
+
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
260
|
+
readonly default: "max-w-xs";
|
|
261
261
|
};
|
|
262
|
-
name: StringConstructor;
|
|
263
|
-
placeholder: StringConstructor;
|
|
264
|
-
autocomplete: {
|
|
265
|
-
type: StringConstructor;
|
|
266
|
-
default:
|
|
262
|
+
readonly name: StringConstructor;
|
|
263
|
+
readonly placeholder: StringConstructor;
|
|
264
|
+
readonly autocomplete: {
|
|
265
|
+
readonly type: StringConstructor;
|
|
266
|
+
readonly default: "off";
|
|
267
267
|
};
|
|
268
|
-
type: {
|
|
269
|
-
type: StringConstructor;
|
|
270
|
-
default:
|
|
268
|
+
readonly type: {
|
|
269
|
+
readonly type: StringConstructor;
|
|
270
|
+
readonly default: "text";
|
|
271
271
|
};
|
|
272
|
-
max: StringConstructor;
|
|
273
|
-
min: StringConstructor;
|
|
274
|
-
disabled: BooleanConstructor;
|
|
275
|
-
small: BooleanConstructor;
|
|
276
|
-
hideLabel: BooleanConstructor;
|
|
277
|
-
onFocus: PropType<() => void>;
|
|
278
|
-
onBlur: PropType<() => void>;
|
|
279
|
-
value: PropType<string>;
|
|
280
|
-
onUpdateValue: PropType<(newValue: string) => void>;
|
|
272
|
+
readonly max: StringConstructor;
|
|
273
|
+
readonly min: StringConstructor;
|
|
274
|
+
readonly disabled: BooleanConstructor;
|
|
275
|
+
readonly small: BooleanConstructor;
|
|
276
|
+
readonly hideLabel: BooleanConstructor;
|
|
277
|
+
readonly onFocus: PropType<() => void>;
|
|
278
|
+
readonly onBlur: PropType<() => void>;
|
|
279
|
+
readonly value: PropType<string>;
|
|
280
|
+
readonly onUpdateValue: PropType<(newValue: string) => void>;
|
|
281
281
|
}>> & {}, {
|
|
282
|
-
small: boolean;
|
|
283
|
-
type: string;
|
|
284
|
-
tooltipHide: boolean;
|
|
285
|
-
tooltipShow: boolean;
|
|
286
|
-
tooltipPlacement: import("./NTooltip").TooltipPlacement;
|
|
287
|
-
tooltipMaxWidth: import("../utils/tailwind").TWMaxWidth;
|
|
288
|
-
disabled: boolean;
|
|
289
|
-
error: boolean;
|
|
290
|
-
autocomplete: string;
|
|
291
|
-
hideLabel: boolean;
|
|
292
|
-
optional: boolean;
|
|
293
|
-
rules: ValidationRule | ValidationRule[];
|
|
294
|
-
hideErrorMessage: boolean;
|
|
295
|
-
disableBlurValidation: boolean;
|
|
282
|
+
readonly small: boolean;
|
|
283
|
+
readonly type: string;
|
|
284
|
+
readonly tooltipHide: boolean;
|
|
285
|
+
readonly tooltipShow: boolean;
|
|
286
|
+
readonly tooltipPlacement: import("./NTooltip").TooltipPlacement;
|
|
287
|
+
readonly tooltipMaxWidth: import("../utils/tailwind").TWMaxWidth;
|
|
288
|
+
readonly disabled: boolean;
|
|
289
|
+
readonly error: boolean;
|
|
290
|
+
readonly autocomplete: string;
|
|
291
|
+
readonly hideLabel: boolean;
|
|
292
|
+
readonly optional: boolean;
|
|
293
|
+
readonly rules: ValidationRule | ValidationRule[];
|
|
294
|
+
readonly hideErrorMessage: boolean;
|
|
295
|
+
readonly disableBlurValidation: boolean;
|
|
296
296
|
}>;
|
|
297
297
|
export default _default;
|
package/components/NValInput.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
|
|
2
|
-
import { createComponent
|
|
2
|
+
import { createComponent } from '../utils/component';
|
|
3
3
|
import { computed } from 'vue';
|
|
4
4
|
import { ref, reactive, watch } from 'vue';
|
|
5
5
|
import NInput, { nInputProps } from './NInput';
|
|
6
6
|
import { validate, required } from '../utils/validation';
|
|
7
|
-
export const validationProps =
|
|
7
|
+
export const validationProps = {
|
|
8
8
|
/**
|
|
9
9
|
* If set to `true` this input is always valid when its value is empty.
|
|
10
10
|
* If set to `false` the input receives the {@link required} rule. Default is `false`.
|
|
@@ -41,15 +41,15 @@ export const validationProps = createProps({
|
|
|
41
41
|
* Disables the validation on blur. Should only be used in special occasions.
|
|
42
42
|
*/
|
|
43
43
|
disableBlurValidation: Boolean
|
|
44
|
-
}
|
|
45
|
-
export const nValInputProps =
|
|
44
|
+
};
|
|
45
|
+
export const nValInputProps = {
|
|
46
46
|
...nInputProps,
|
|
47
47
|
...validationProps,
|
|
48
48
|
/**
|
|
49
49
|
* A slot to replace the input.
|
|
50
50
|
*/
|
|
51
51
|
input: Function
|
|
52
|
-
}
|
|
52
|
+
};
|
|
53
53
|
/**
|
|
54
54
|
* The `NValInput` is a `NInput` with custom validation.
|
|
55
55
|
*/
|
package/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { createComponent, createView
|
|
2
|
-
export { createComponent, createView
|
|
1
|
+
import { createComponent, createView } from './utils/component';
|
|
2
|
+
export { createComponent, createView };
|
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { createComponent, createView
|
|
2
|
-
export { createComponent, createView
|
|
1
|
+
import { createComponent, createView } from './utils/component';
|
|
2
|
+
export { createComponent, createView };
|
package/package.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naptics/vue-collection",
|
|
3
|
-
"
|
|
3
|
+
"author": "Timo Siegenthaler",
|
|
4
|
+
"description": "Vue Collection is a collection of styled and fully functional Vue components which can easily be integrated into our projects.",
|
|
5
|
+
"version": "0.0.7",
|
|
4
6
|
"main": "./index.js",
|
|
5
7
|
"repository": {
|
|
6
8
|
"type": "git",
|