@naptics/vue-collection 0.0.6 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -6
- 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 +100 -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 -124
- package/components/NTextArea.js +5 -5
- package/components/NTooltip.d.ts +44 -44
- package/components/NTooltip.js +4 -4
- 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/NTable.d.ts
CHANGED
|
@@ -45,9 +45,9 @@ export declare const nTableProps: {
|
|
|
45
45
|
/**
|
|
46
46
|
* The headings of the table. These define which columns are shown in the table and in which order.
|
|
47
47
|
*/
|
|
48
|
-
headings: {
|
|
49
|
-
type: PropType<TableHeading[]>;
|
|
50
|
-
required: true;
|
|
48
|
+
readonly headings: {
|
|
49
|
+
readonly type: PropType<TableHeading[]>;
|
|
50
|
+
readonly required: true;
|
|
51
51
|
};
|
|
52
52
|
/**
|
|
53
53
|
* Details can be added additionally to headings.
|
|
@@ -57,9 +57,9 @@ export declare const nTableProps: {
|
|
|
57
57
|
* in the same way as if the details were normal headings.
|
|
58
58
|
* Note that details can be added dynamically by adding the `breakpoint` property to the headings.
|
|
59
59
|
*/
|
|
60
|
-
details: {
|
|
61
|
-
type: PropType<TableDetail[]>;
|
|
62
|
-
default: () => never[];
|
|
60
|
+
readonly details: {
|
|
61
|
+
readonly type: PropType<TableDetail[]>;
|
|
62
|
+
readonly default: () => never[];
|
|
63
63
|
};
|
|
64
64
|
/**
|
|
65
65
|
* The items of the table. They consist of an array of table rows.
|
|
@@ -82,9 +82,9 @@ export declare const nTableProps: {
|
|
|
82
82
|
* { id: 2, name: 'Franzi', status: () => <NBadge ... />, action: ... } // Row 2
|
|
83
83
|
* ]
|
|
84
84
|
*/
|
|
85
|
-
items: {
|
|
86
|
-
type: PropType<TableRow[]>;
|
|
87
|
-
default: () => never[];
|
|
85
|
+
readonly items: {
|
|
86
|
+
readonly type: PropType<TableRow[]>;
|
|
87
|
+
readonly default: () => never[];
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
90
|
/**
|
|
@@ -94,9 +94,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
94
94
|
/**
|
|
95
95
|
* The headings of the table. These define which columns are shown in the table and in which order.
|
|
96
96
|
*/
|
|
97
|
-
headings: {
|
|
98
|
-
type: PropType<TableHeading[]>;
|
|
99
|
-
required: true;
|
|
97
|
+
readonly headings: {
|
|
98
|
+
readonly type: PropType<TableHeading[]>;
|
|
99
|
+
readonly required: true;
|
|
100
100
|
};
|
|
101
101
|
/**
|
|
102
102
|
* Details can be added additionally to headings.
|
|
@@ -106,9 +106,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
106
106
|
* in the same way as if the details were normal headings.
|
|
107
107
|
* Note that details can be added dynamically by adding the `breakpoint` property to the headings.
|
|
108
108
|
*/
|
|
109
|
-
details: {
|
|
110
|
-
type: PropType<TableDetail[]>;
|
|
111
|
-
default: () => never[];
|
|
109
|
+
readonly details: {
|
|
110
|
+
readonly type: PropType<TableDetail[]>;
|
|
111
|
+
readonly default: () => never[];
|
|
112
112
|
};
|
|
113
113
|
/**
|
|
114
114
|
* The items of the table. They consist of an array of table rows.
|
|
@@ -131,17 +131,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
131
131
|
* { id: 2, name: 'Franzi', status: () => <NBadge ... />, action: ... } // Row 2
|
|
132
132
|
* ]
|
|
133
133
|
*/
|
|
134
|
-
items: {
|
|
135
|
-
type: PropType<TableRow[]>;
|
|
136
|
-
default: () => never[];
|
|
134
|
+
readonly items: {
|
|
135
|
+
readonly type: PropType<TableRow[]>;
|
|
136
|
+
readonly default: () => never[];
|
|
137
137
|
};
|
|
138
138
|
}, 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<{
|
|
139
139
|
/**
|
|
140
140
|
* The headings of the table. These define which columns are shown in the table and in which order.
|
|
141
141
|
*/
|
|
142
|
-
headings: {
|
|
143
|
-
type: PropType<TableHeading[]>;
|
|
144
|
-
required: true;
|
|
142
|
+
readonly headings: {
|
|
143
|
+
readonly type: PropType<TableHeading[]>;
|
|
144
|
+
readonly required: true;
|
|
145
145
|
};
|
|
146
146
|
/**
|
|
147
147
|
* Details can be added additionally to headings.
|
|
@@ -151,9 +151,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
151
151
|
* in the same way as if the details were normal headings.
|
|
152
152
|
* Note that details can be added dynamically by adding the `breakpoint` property to the headings.
|
|
153
153
|
*/
|
|
154
|
-
details: {
|
|
155
|
-
type: PropType<TableDetail[]>;
|
|
156
|
-
default: () => never[];
|
|
154
|
+
readonly details: {
|
|
155
|
+
readonly type: PropType<TableDetail[]>;
|
|
156
|
+
readonly default: () => never[];
|
|
157
157
|
};
|
|
158
158
|
/**
|
|
159
159
|
* The items of the table. They consist of an array of table rows.
|
|
@@ -176,12 +176,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
176
176
|
* { id: 2, name: 'Franzi', status: () => <NBadge ... />, action: ... } // Row 2
|
|
177
177
|
* ]
|
|
178
178
|
*/
|
|
179
|
-
items: {
|
|
180
|
-
type: PropType<TableRow[]>;
|
|
181
|
-
default: () => never[];
|
|
179
|
+
readonly items: {
|
|
180
|
+
readonly type: PropType<TableRow[]>;
|
|
181
|
+
readonly default: () => never[];
|
|
182
182
|
};
|
|
183
183
|
}>> & {}, {
|
|
184
|
-
details: TableDetail[];
|
|
185
|
-
items: TableRow[];
|
|
184
|
+
readonly details: TableDetail[];
|
|
185
|
+
readonly items: TableRow[];
|
|
186
186
|
}>;
|
|
187
187
|
export default _default;
|
package/components/NTable.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Fragment as _Fragment, createVNode as _createVNode } from "vue";
|
|
2
2
|
import { isWidthBreakpoint } from '../utils/breakpoints';
|
|
3
|
-
import { createComponent
|
|
3
|
+
import { createComponent } from '../utils/component';
|
|
4
4
|
import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/vue/24/solid';
|
|
5
5
|
import { computed, Fragment, ref, watch } from 'vue';
|
|
6
6
|
import NIconButton from './NIconButton';
|
|
7
7
|
import './NTable.css';
|
|
8
8
|
const N_TABLE_ACTION_KEY = 'action';
|
|
9
|
-
export const nTableProps =
|
|
9
|
+
export const nTableProps = {
|
|
10
10
|
/**
|
|
11
11
|
* The headings of the table. These define which columns are shown in the table and in which order.
|
|
12
12
|
*/
|
|
@@ -51,7 +51,7 @@ export const nTableProps = createProps({
|
|
|
51
51
|
type: Array,
|
|
52
52
|
default: () => []
|
|
53
53
|
}
|
|
54
|
-
}
|
|
54
|
+
};
|
|
55
55
|
/**
|
|
56
56
|
* The `NTable` is a styled html table which accepts data and displays it appropriately.
|
|
57
57
|
*/
|
|
@@ -4,23 +4,23 @@ export declare const nTableActionProps: {
|
|
|
4
4
|
/**
|
|
5
5
|
* The route of the action. If set the component will be a {@link RouterLink}.
|
|
6
6
|
*/
|
|
7
|
-
route: PropType<RouteLocationRaw>;
|
|
7
|
+
readonly route: PropType<RouteLocationRaw>;
|
|
8
8
|
/**
|
|
9
9
|
* The text of the action.
|
|
10
10
|
*/
|
|
11
|
-
text: StringConstructor;
|
|
11
|
+
readonly text: StringConstructor;
|
|
12
12
|
/**
|
|
13
13
|
* The html attribute, which indicates the type of the button.
|
|
14
14
|
*/
|
|
15
|
-
type: {
|
|
16
|
-
type: PropType<"button" | "submit" | "reset">;
|
|
17
|
-
default:
|
|
15
|
+
readonly type: {
|
|
16
|
+
readonly type: PropType<"button" | "submit" | "reset">;
|
|
17
|
+
readonly default: "button";
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
20
|
* This is called when the action is clicked.
|
|
21
21
|
* It is only called when the `route` prop is not set on the action.
|
|
22
22
|
*/
|
|
23
|
-
onClick: PropType<() => void>;
|
|
23
|
+
readonly onClick: PropType<() => void>;
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
26
26
|
* The `NTableAction` is a button or {@link RouterLink} which is styled to fit into a table.
|
|
@@ -30,45 +30,45 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
30
30
|
/**
|
|
31
31
|
* The route of the action. If set the component will be a {@link RouterLink}.
|
|
32
32
|
*/
|
|
33
|
-
route: PropType<RouteLocationRaw>;
|
|
33
|
+
readonly route: PropType<RouteLocationRaw>;
|
|
34
34
|
/**
|
|
35
35
|
* The text of the action.
|
|
36
36
|
*/
|
|
37
|
-
text: StringConstructor;
|
|
37
|
+
readonly text: StringConstructor;
|
|
38
38
|
/**
|
|
39
39
|
* The html attribute, which indicates the type of the button.
|
|
40
40
|
*/
|
|
41
|
-
type: {
|
|
42
|
-
type: PropType<"button" | "submit" | "reset">;
|
|
43
|
-
default:
|
|
41
|
+
readonly type: {
|
|
42
|
+
readonly type: PropType<"button" | "submit" | "reset">;
|
|
43
|
+
readonly default: "button";
|
|
44
44
|
};
|
|
45
45
|
/**
|
|
46
46
|
* This is called when the action is clicked.
|
|
47
47
|
* It is only called when the `route` prop is not set on the action.
|
|
48
48
|
*/
|
|
49
|
-
onClick: PropType<() => void>;
|
|
49
|
+
readonly onClick: PropType<() => void>;
|
|
50
50
|
}, 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<{
|
|
51
51
|
/**
|
|
52
52
|
* The route of the action. If set the component will be a {@link RouterLink}.
|
|
53
53
|
*/
|
|
54
|
-
route: PropType<RouteLocationRaw>;
|
|
54
|
+
readonly route: PropType<RouteLocationRaw>;
|
|
55
55
|
/**
|
|
56
56
|
* The text of the action.
|
|
57
57
|
*/
|
|
58
|
-
text: StringConstructor;
|
|
58
|
+
readonly text: StringConstructor;
|
|
59
59
|
/**
|
|
60
60
|
* The html attribute, which indicates the type of the button.
|
|
61
61
|
*/
|
|
62
|
-
type: {
|
|
63
|
-
type: PropType<"button" | "submit" | "reset">;
|
|
64
|
-
default:
|
|
62
|
+
readonly type: {
|
|
63
|
+
readonly type: PropType<"button" | "submit" | "reset">;
|
|
64
|
+
readonly default: "button";
|
|
65
65
|
};
|
|
66
66
|
/**
|
|
67
67
|
* This is called when the action is clicked.
|
|
68
68
|
* It is only called when the `route` prop is not set on the action.
|
|
69
69
|
*/
|
|
70
|
-
onClick: PropType<() => void>;
|
|
70
|
+
readonly onClick: PropType<() => void>;
|
|
71
71
|
}>> & {}, {
|
|
72
|
-
type: "button" | "submit" | "reset";
|
|
72
|
+
readonly type: "button" | "submit" | "reset";
|
|
73
73
|
}>;
|
|
74
74
|
export default _default;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { isVNode as _isVNode, createVNode as _createVNode, Fragment as _Fragment } from "vue";
|
|
2
|
-
import { createComponent
|
|
2
|
+
import { createComponent } from '../utils/component';
|
|
3
3
|
import { RouterLink } from 'vue-router';
|
|
4
4
|
import { nButtonProps } from './NButton';
|
|
5
5
|
function _isSlot(s) {
|
|
6
6
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !_isVNode(s);
|
|
7
7
|
}
|
|
8
|
-
export const nTableActionProps =
|
|
8
|
+
export const nTableActionProps = {
|
|
9
9
|
/**
|
|
10
10
|
* The route of the action. If set the component will be a {@link RouterLink}.
|
|
11
11
|
*/
|
|
@@ -23,7 +23,7 @@ export const nTableActionProps = createProps({
|
|
|
23
23
|
* It is only called when the `route` prop is not set on the action.
|
|
24
24
|
*/
|
|
25
25
|
onClick: Function
|
|
26
|
-
}
|
|
26
|
+
};
|
|
27
27
|
/**
|
|
28
28
|
* The `NTableAction` is a button or {@link RouterLink} which is styled to fit into a table.
|
|
29
29
|
* It is basically styled as an emphasized text in the table.
|
|
@@ -1,80 +1,78 @@
|
|
|
1
1
|
import { type PropType } from 'vue';
|
|
2
2
|
export declare const nTextAreaProps: {
|
|
3
|
-
optional: BooleanConstructor;
|
|
4
|
-
rules: {
|
|
5
|
-
type: PropType<import("../utils/validation").ValidationRule | import("../utils/validation").ValidationRule[]>;
|
|
6
|
-
default: () => never[];
|
|
3
|
+
readonly optional: BooleanConstructor;
|
|
4
|
+
readonly rules: {
|
|
5
|
+
readonly type: PropType<import("../utils/validation").ValidationRule | import("../utils/validation").ValidationRule[]>;
|
|
6
|
+
readonly default: () => never[];
|
|
7
7
|
};
|
|
8
|
-
form: PropType<import("./ValidatedForm").ValidatedForm>;
|
|
9
|
-
error: BooleanConstructor;
|
|
10
|
-
errorMessage: StringConstructor;
|
|
11
|
-
hideErrorMessage: BooleanConstructor;
|
|
12
|
-
disableBlurValidation: BooleanConstructor;
|
|
13
|
-
tooltipText: StringConstructor;
|
|
14
|
-
tooltipContent: PropType<() =>
|
|
15
|
-
tooltipHide: BooleanConstructor;
|
|
16
|
-
tooltipShow: BooleanConstructor;
|
|
17
|
-
tooltipPlacement: {
|
|
18
|
-
type: PropType<import("./NTooltip").TooltipPlacement>;
|
|
19
|
-
default:
|
|
8
|
+
readonly form: PropType<import("./ValidatedForm").ValidatedForm>;
|
|
9
|
+
readonly error: BooleanConstructor;
|
|
10
|
+
readonly errorMessage: StringConstructor;
|
|
11
|
+
readonly hideErrorMessage: BooleanConstructor;
|
|
12
|
+
readonly disableBlurValidation: BooleanConstructor;
|
|
13
|
+
readonly tooltipText: StringConstructor;
|
|
14
|
+
readonly tooltipContent: PropType<() => JSX.Element>;
|
|
15
|
+
readonly tooltipHide: BooleanConstructor;
|
|
16
|
+
readonly tooltipShow: BooleanConstructor;
|
|
17
|
+
readonly tooltipPlacement: {
|
|
18
|
+
readonly type: PropType<import("./NTooltip").TooltipPlacement>;
|
|
19
|
+
readonly default: "auto";
|
|
20
20
|
};
|
|
21
|
-
tooltipMaxWidth: {
|
|
22
|
-
type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
23
|
-
|
|
24
|
-
*/
|
|
25
|
-
default: string;
|
|
21
|
+
readonly tooltipMaxWidth: {
|
|
22
|
+
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
23
|
+
readonly default: "max-w-xs";
|
|
26
24
|
};
|
|
27
25
|
/**
|
|
28
26
|
* The name of the text area. Is displayed as a label above the text area.
|
|
29
27
|
*/
|
|
30
|
-
name: StringConstructor;
|
|
28
|
+
readonly name: StringConstructor;
|
|
31
29
|
/**
|
|
32
30
|
* The placeholder of the text area.
|
|
33
31
|
*/
|
|
34
|
-
placeholder: StringConstructor;
|
|
32
|
+
readonly placeholder: StringConstructor;
|
|
35
33
|
/**
|
|
36
34
|
* The html autocomplete attribute of the text area.
|
|
37
35
|
*/
|
|
38
|
-
autocomplete: {
|
|
39
|
-
type: StringConstructor;
|
|
40
|
-
default:
|
|
36
|
+
readonly autocomplete: {
|
|
37
|
+
readonly type: StringConstructor;
|
|
38
|
+
readonly default: "off";
|
|
41
39
|
};
|
|
42
40
|
/**
|
|
43
41
|
* If set to `true`, the text area is resizable in y-direction.
|
|
44
42
|
*/
|
|
45
|
-
resizable: {
|
|
46
|
-
type: BooleanConstructor;
|
|
47
|
-
default:
|
|
43
|
+
readonly resizable: {
|
|
44
|
+
readonly type: BooleanConstructor;
|
|
45
|
+
readonly default: true;
|
|
48
46
|
};
|
|
49
47
|
/**
|
|
50
48
|
* The initial height of the text area in terms of
|
|
51
49
|
* how many text rows fit inside the text area.
|
|
52
50
|
* The height can be change if {@link nTextAreaProps.resizable} is `true`
|
|
53
51
|
*/
|
|
54
|
-
rows: NumberConstructor;
|
|
52
|
+
readonly rows: NumberConstructor;
|
|
55
53
|
/**
|
|
56
54
|
* The maximum length of the input string. Entering longer strings are simply
|
|
57
55
|
* prevented, but no error message is shown to the user.
|
|
58
56
|
*/
|
|
59
|
-
maxLength: NumberConstructor;
|
|
57
|
+
readonly maxLength: NumberConstructor;
|
|
60
58
|
/**
|
|
61
59
|
* If set to `true` the text area is disabled and no interaction is possible.
|
|
62
60
|
*/
|
|
63
|
-
disabled: BooleanConstructor;
|
|
61
|
+
readonly disabled: BooleanConstructor;
|
|
64
62
|
/**
|
|
65
63
|
* If set to `true` the text area's label is hidden.
|
|
66
64
|
*/
|
|
67
|
-
hideLabel: BooleanConstructor;
|
|
65
|
+
readonly hideLabel: BooleanConstructor;
|
|
68
66
|
/**
|
|
69
67
|
* This is called when the text area reveices focus.
|
|
70
68
|
*/
|
|
71
|
-
onFocus: PropType<() => void>;
|
|
69
|
+
readonly onFocus: PropType<() => void>;
|
|
72
70
|
/**
|
|
73
71
|
* This is called when the text area looses focus.
|
|
74
72
|
*/
|
|
75
|
-
onBlur: PropType<() => void>;
|
|
76
|
-
value: PropType<string>;
|
|
77
|
-
onUpdateValue: PropType<(newValue: string) => void>;
|
|
73
|
+
readonly onBlur: PropType<() => void>;
|
|
74
|
+
readonly value: PropType<string>;
|
|
75
|
+
readonly onUpdateValue: PropType<(newValue: string) => void>;
|
|
78
76
|
};
|
|
79
77
|
export type NTextAreaExposed = {
|
|
80
78
|
/**
|
|
@@ -83,170 +81,166 @@ export type NTextAreaExposed = {
|
|
|
83
81
|
focus(): void;
|
|
84
82
|
};
|
|
85
83
|
declare const _default: import("vue").DefineComponent<{
|
|
86
|
-
optional: BooleanConstructor;
|
|
87
|
-
rules: {
|
|
88
|
-
type: PropType<import("../utils/validation").ValidationRule | import("../utils/validation").ValidationRule[]>;
|
|
89
|
-
default: () => never[];
|
|
84
|
+
readonly optional: BooleanConstructor;
|
|
85
|
+
readonly rules: {
|
|
86
|
+
readonly type: PropType<import("../utils/validation").ValidationRule | import("../utils/validation").ValidationRule[]>;
|
|
87
|
+
readonly default: () => never[];
|
|
90
88
|
};
|
|
91
|
-
form: PropType<import("./ValidatedForm").ValidatedForm>;
|
|
92
|
-
error: BooleanConstructor;
|
|
93
|
-
errorMessage: StringConstructor;
|
|
94
|
-
hideErrorMessage: BooleanConstructor;
|
|
95
|
-
disableBlurValidation: BooleanConstructor;
|
|
96
|
-
tooltipText: StringConstructor;
|
|
97
|
-
tooltipContent: PropType<() =>
|
|
98
|
-
tooltipHide: BooleanConstructor;
|
|
99
|
-
tooltipShow: BooleanConstructor;
|
|
100
|
-
tooltipPlacement: {
|
|
101
|
-
type: PropType<import("./NTooltip").TooltipPlacement>;
|
|
102
|
-
default:
|
|
89
|
+
readonly form: PropType<import("./ValidatedForm").ValidatedForm>;
|
|
90
|
+
readonly error: BooleanConstructor;
|
|
91
|
+
readonly errorMessage: StringConstructor;
|
|
92
|
+
readonly hideErrorMessage: BooleanConstructor;
|
|
93
|
+
readonly disableBlurValidation: BooleanConstructor;
|
|
94
|
+
readonly tooltipText: StringConstructor;
|
|
95
|
+
readonly tooltipContent: PropType<() => JSX.Element>;
|
|
96
|
+
readonly tooltipHide: BooleanConstructor;
|
|
97
|
+
readonly tooltipShow: BooleanConstructor;
|
|
98
|
+
readonly tooltipPlacement: {
|
|
99
|
+
readonly type: PropType<import("./NTooltip").TooltipPlacement>;
|
|
100
|
+
readonly default: "auto";
|
|
103
101
|
};
|
|
104
|
-
tooltipMaxWidth: {
|
|
105
|
-
type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
106
|
-
|
|
107
|
-
*/
|
|
108
|
-
default: string;
|
|
102
|
+
readonly tooltipMaxWidth: {
|
|
103
|
+
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
104
|
+
readonly default: "max-w-xs";
|
|
109
105
|
};
|
|
110
106
|
/**
|
|
111
107
|
* The name of the text area. Is displayed as a label above the text area.
|
|
112
108
|
*/
|
|
113
|
-
name: StringConstructor;
|
|
109
|
+
readonly name: StringConstructor;
|
|
114
110
|
/**
|
|
115
111
|
* The placeholder of the text area.
|
|
116
112
|
*/
|
|
117
|
-
placeholder: StringConstructor;
|
|
113
|
+
readonly placeholder: StringConstructor;
|
|
118
114
|
/**
|
|
119
115
|
* The html autocomplete attribute of the text area.
|
|
120
116
|
*/
|
|
121
|
-
autocomplete: {
|
|
122
|
-
type: StringConstructor;
|
|
123
|
-
default:
|
|
117
|
+
readonly autocomplete: {
|
|
118
|
+
readonly type: StringConstructor;
|
|
119
|
+
readonly default: "off";
|
|
124
120
|
};
|
|
125
121
|
/**
|
|
126
122
|
* If set to `true`, the text area is resizable in y-direction.
|
|
127
123
|
*/
|
|
128
|
-
resizable: {
|
|
129
|
-
type: BooleanConstructor;
|
|
130
|
-
default:
|
|
124
|
+
readonly resizable: {
|
|
125
|
+
readonly type: BooleanConstructor;
|
|
126
|
+
readonly default: true;
|
|
131
127
|
};
|
|
132
128
|
/**
|
|
133
129
|
* The initial height of the text area in terms of
|
|
134
130
|
* how many text rows fit inside the text area.
|
|
135
131
|
* The height can be change if {@link nTextAreaProps.resizable} is `true`
|
|
136
132
|
*/
|
|
137
|
-
rows: NumberConstructor;
|
|
133
|
+
readonly rows: NumberConstructor;
|
|
138
134
|
/**
|
|
139
135
|
* The maximum length of the input string. Entering longer strings are simply
|
|
140
136
|
* prevented, but no error message is shown to the user.
|
|
141
137
|
*/
|
|
142
|
-
maxLength: NumberConstructor;
|
|
138
|
+
readonly maxLength: NumberConstructor;
|
|
143
139
|
/**
|
|
144
140
|
* If set to `true` the text area is disabled and no interaction is possible.
|
|
145
141
|
*/
|
|
146
|
-
disabled: BooleanConstructor;
|
|
142
|
+
readonly disabled: BooleanConstructor;
|
|
147
143
|
/**
|
|
148
144
|
* If set to `true` the text area's label is hidden.
|
|
149
145
|
*/
|
|
150
|
-
hideLabel: BooleanConstructor;
|
|
146
|
+
readonly hideLabel: BooleanConstructor;
|
|
151
147
|
/**
|
|
152
148
|
* This is called when the text area reveices focus.
|
|
153
149
|
*/
|
|
154
|
-
onFocus: PropType<() => void>;
|
|
150
|
+
readonly onFocus: PropType<() => void>;
|
|
155
151
|
/**
|
|
156
152
|
* This is called when the text area looses focus.
|
|
157
153
|
*/
|
|
158
|
-
onBlur: PropType<() => void>;
|
|
159
|
-
value: PropType<string>;
|
|
160
|
-
onUpdateValue: PropType<(newValue: string) => void>;
|
|
154
|
+
readonly onBlur: PropType<() => void>;
|
|
155
|
+
readonly value: PropType<string>;
|
|
156
|
+
readonly onUpdateValue: PropType<(newValue: string) => void>;
|
|
161
157
|
}, 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<{
|
|
162
|
-
optional: BooleanConstructor;
|
|
163
|
-
rules: {
|
|
164
|
-
type: PropType<import("../utils/validation").ValidationRule | import("../utils/validation").ValidationRule[]>;
|
|
165
|
-
default: () => never[];
|
|
158
|
+
readonly optional: BooleanConstructor;
|
|
159
|
+
readonly rules: {
|
|
160
|
+
readonly type: PropType<import("../utils/validation").ValidationRule | import("../utils/validation").ValidationRule[]>;
|
|
161
|
+
readonly default: () => never[];
|
|
166
162
|
};
|
|
167
|
-
form: PropType<import("./ValidatedForm").ValidatedForm>;
|
|
168
|
-
error: BooleanConstructor;
|
|
169
|
-
errorMessage: StringConstructor;
|
|
170
|
-
hideErrorMessage: BooleanConstructor;
|
|
171
|
-
disableBlurValidation: BooleanConstructor;
|
|
172
|
-
tooltipText: StringConstructor;
|
|
173
|
-
tooltipContent: PropType<() =>
|
|
174
|
-
tooltipHide: BooleanConstructor;
|
|
175
|
-
tooltipShow: BooleanConstructor;
|
|
176
|
-
tooltipPlacement: {
|
|
177
|
-
type: PropType<import("./NTooltip").TooltipPlacement>;
|
|
178
|
-
default:
|
|
163
|
+
readonly form: PropType<import("./ValidatedForm").ValidatedForm>;
|
|
164
|
+
readonly error: BooleanConstructor;
|
|
165
|
+
readonly errorMessage: StringConstructor;
|
|
166
|
+
readonly hideErrorMessage: BooleanConstructor;
|
|
167
|
+
readonly disableBlurValidation: BooleanConstructor;
|
|
168
|
+
readonly tooltipText: StringConstructor;
|
|
169
|
+
readonly tooltipContent: PropType<() => JSX.Element>;
|
|
170
|
+
readonly tooltipHide: BooleanConstructor;
|
|
171
|
+
readonly tooltipShow: BooleanConstructor;
|
|
172
|
+
readonly tooltipPlacement: {
|
|
173
|
+
readonly type: PropType<import("./NTooltip").TooltipPlacement>;
|
|
174
|
+
readonly default: "auto";
|
|
179
175
|
};
|
|
180
|
-
tooltipMaxWidth: {
|
|
181
|
-
type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
182
|
-
|
|
183
|
-
*/
|
|
184
|
-
default: string;
|
|
176
|
+
readonly tooltipMaxWidth: {
|
|
177
|
+
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
178
|
+
readonly default: "max-w-xs";
|
|
185
179
|
};
|
|
186
180
|
/**
|
|
187
181
|
* The name of the text area. Is displayed as a label above the text area.
|
|
188
182
|
*/
|
|
189
|
-
name: StringConstructor;
|
|
183
|
+
readonly name: StringConstructor;
|
|
190
184
|
/**
|
|
191
185
|
* The placeholder of the text area.
|
|
192
186
|
*/
|
|
193
|
-
placeholder: StringConstructor;
|
|
187
|
+
readonly placeholder: StringConstructor;
|
|
194
188
|
/**
|
|
195
189
|
* The html autocomplete attribute of the text area.
|
|
196
190
|
*/
|
|
197
|
-
autocomplete: {
|
|
198
|
-
type: StringConstructor;
|
|
199
|
-
default:
|
|
191
|
+
readonly autocomplete: {
|
|
192
|
+
readonly type: StringConstructor;
|
|
193
|
+
readonly default: "off";
|
|
200
194
|
};
|
|
201
195
|
/**
|
|
202
196
|
* If set to `true`, the text area is resizable in y-direction.
|
|
203
197
|
*/
|
|
204
|
-
resizable: {
|
|
205
|
-
type: BooleanConstructor;
|
|
206
|
-
default:
|
|
198
|
+
readonly resizable: {
|
|
199
|
+
readonly type: BooleanConstructor;
|
|
200
|
+
readonly default: true;
|
|
207
201
|
};
|
|
208
202
|
/**
|
|
209
203
|
* The initial height of the text area in terms of
|
|
210
204
|
* how many text rows fit inside the text area.
|
|
211
205
|
* The height can be change if {@link nTextAreaProps.resizable} is `true`
|
|
212
206
|
*/
|
|
213
|
-
rows: NumberConstructor;
|
|
207
|
+
readonly rows: NumberConstructor;
|
|
214
208
|
/**
|
|
215
209
|
* The maximum length of the input string. Entering longer strings are simply
|
|
216
210
|
* prevented, but no error message is shown to the user.
|
|
217
211
|
*/
|
|
218
|
-
maxLength: NumberConstructor;
|
|
212
|
+
readonly maxLength: NumberConstructor;
|
|
219
213
|
/**
|
|
220
214
|
* If set to `true` the text area is disabled and no interaction is possible.
|
|
221
215
|
*/
|
|
222
|
-
disabled: BooleanConstructor;
|
|
216
|
+
readonly disabled: BooleanConstructor;
|
|
223
217
|
/**
|
|
224
218
|
* If set to `true` the text area's label is hidden.
|
|
225
219
|
*/
|
|
226
|
-
hideLabel: BooleanConstructor;
|
|
220
|
+
readonly hideLabel: BooleanConstructor;
|
|
227
221
|
/**
|
|
228
222
|
* This is called when the text area reveices focus.
|
|
229
223
|
*/
|
|
230
|
-
onFocus: PropType<() => void>;
|
|
224
|
+
readonly onFocus: PropType<() => void>;
|
|
231
225
|
/**
|
|
232
226
|
* This is called when the text area looses focus.
|
|
233
227
|
*/
|
|
234
|
-
onBlur: PropType<() => void>;
|
|
235
|
-
value: PropType<string>;
|
|
236
|
-
onUpdateValue: PropType<(newValue: string) => void>;
|
|
228
|
+
readonly onBlur: PropType<() => void>;
|
|
229
|
+
readonly value: PropType<string>;
|
|
230
|
+
readonly onUpdateValue: PropType<(newValue: string) => void>;
|
|
237
231
|
}>> & {}, {
|
|
238
|
-
tooltipHide: boolean;
|
|
239
|
-
tooltipShow: boolean;
|
|
240
|
-
tooltipPlacement: import("./NTooltip").TooltipPlacement;
|
|
241
|
-
tooltipMaxWidth: import("../utils/tailwind").TWMaxWidth;
|
|
242
|
-
disabled: boolean;
|
|
243
|
-
error: boolean;
|
|
244
|
-
autocomplete: string;
|
|
245
|
-
hideLabel: boolean;
|
|
246
|
-
optional: boolean;
|
|
247
|
-
rules: import("../utils/validation").ValidationRule | import("../utils/validation").ValidationRule[];
|
|
248
|
-
hideErrorMessage: boolean;
|
|
249
|
-
disableBlurValidation: boolean;
|
|
250
|
-
resizable: boolean;
|
|
232
|
+
readonly tooltipHide: boolean;
|
|
233
|
+
readonly tooltipShow: boolean;
|
|
234
|
+
readonly tooltipPlacement: import("./NTooltip").TooltipPlacement;
|
|
235
|
+
readonly tooltipMaxWidth: import("../utils/tailwind").TWMaxWidth;
|
|
236
|
+
readonly disabled: boolean;
|
|
237
|
+
readonly error: boolean;
|
|
238
|
+
readonly autocomplete: string;
|
|
239
|
+
readonly hideLabel: boolean;
|
|
240
|
+
readonly optional: boolean;
|
|
241
|
+
readonly rules: import("../utils/validation").ValidationRule | import("../utils/validation").ValidationRule[];
|
|
242
|
+
readonly hideErrorMessage: boolean;
|
|
243
|
+
readonly disableBlurValidation: boolean;
|
|
244
|
+
readonly resizable: boolean;
|
|
251
245
|
}>;
|
|
252
246
|
export default _default;
|
package/components/NTextArea.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { withDirectives as _withDirectives, vShow as _vShow, createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
|
|
2
|
-
import { createComponent
|
|
2
|
+
import { createComponent } from '../utils/component';
|
|
3
3
|
import { ref } from 'vue';
|
|
4
4
|
import { ExclamationCircleIcon } from '@heroicons/vue/24/solid';
|
|
5
5
|
import NTooltip, { mapTooltipProps, nToolTipPropsForImplementor } from './NTooltip';
|
|
6
6
|
import { vModelProps } from '../utils/vModel';
|
|
7
7
|
import NValInput, { validationProps } from './NValInput';
|
|
8
|
-
const nTextAreaBaseProps =
|
|
8
|
+
const nTextAreaBaseProps = {
|
|
9
9
|
...vModelProps(String),
|
|
10
10
|
/**
|
|
11
11
|
* The name of the text area. Is displayed as a label above the text area.
|
|
@@ -61,11 +61,11 @@ const nTextAreaBaseProps = createProps({
|
|
|
61
61
|
*/
|
|
62
62
|
onBlur: Function,
|
|
63
63
|
...nToolTipPropsForImplementor
|
|
64
|
-
}
|
|
65
|
-
export const nTextAreaProps =
|
|
64
|
+
};
|
|
65
|
+
export const nTextAreaProps = {
|
|
66
66
|
...nTextAreaBaseProps,
|
|
67
67
|
...validationProps
|
|
68
|
-
}
|
|
68
|
+
};
|
|
69
69
|
export default createComponent('NTextArea', nTextAreaProps, (props, context) => {
|
|
70
70
|
const textAreaRef = ref();
|
|
71
71
|
const exposed = {
|