@naptics/vue-collection 0.2.14 → 0.3.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/.github/workflows/build.yml +26 -0
- package/.github/workflows/deploy-demo.yml +46 -0
- package/.github/workflows/deploy-lib.yml +65 -0
- package/.gitlab-ci.yml +57 -0
- package/.nvmrc +1 -0
- package/.prettierrc +8 -0
- package/.vscode/extensions.json +10 -0
- package/.vscode/launch.json +23 -0
- package/.vscode/settings.json +13 -0
- package/babel.config.json +3 -0
- package/components/NAlert.d.ts +1 -44
- package/components/NBadge.d.ts +1 -133
- package/components/NBreadcrub.d.ts +2 -106
- package/components/NBreadcrub.js +1 -1
- package/components/NButton.d.ts +2 -118
- package/components/NCheckbox.d.ts +1 -32
- package/components/NCheckboxLabel.d.ts +1 -45
- package/components/NCheckboxLabel.js +1 -1
- package/components/NCrudModal.d.ts +9 -221
- package/components/NCrudModal.js +1 -1
- package/components/NDialog.d.ts +1 -110
- package/components/NDialog.js +1 -1
- package/components/NDropdown.d.ts +1 -69
- package/components/NDropdown.js +1 -1
- package/components/NDropzone.d.ts +1 -115
- package/components/NDropzone.js +1 -1
- package/components/NForm.d.ts +1 -23
- package/components/NFormModal.d.ts +9 -127
- package/components/NIconButton.d.ts +3 -159
- package/components/NIconButton.js +1 -1
- package/components/NIconCircle.d.ts +1 -87
- package/components/NInput.d.ts +1 -164
- package/components/NInput.js +1 -1
- package/components/NInputPhone.d.ts +2 -114
- package/components/NInputPhone.js +1 -1
- package/components/NInputSelect.d.ts +2 -187
- package/components/NInputSelect.js +1 -1
- package/components/NInputSuggestion.d.ts +2 -155
- package/components/NInputSuggestion.js +1 -1
- package/components/NLink.d.ts +1 -70
- package/components/NList.d.ts +1 -43
- package/components/NList.js +1 -1
- package/components/NLoadingIndicator.d.ts +1 -49
- package/components/NModal.d.ts +15 -227
- package/components/NModal.js +16 -2
- package/components/NPagination.d.ts +1 -63
- package/components/NSearchbar.d.ts +1 -56
- package/components/NSearchbarList.d.ts +3 -63
- package/components/NSearchbarList.js +1 -1
- package/components/NSelect.d.ts +2 -148
- package/components/NSelect.js +1 -1
- package/components/NSuggestionList.d.ts +3 -126
- package/components/NSuggestionList.js +5 -2
- package/components/NTable.d.ts +1 -85
- package/components/NTable.js +12 -6
- package/components/NTableAction.d.ts +2 -46
- package/components/NTableAction.js +1 -1
- package/components/NTextArea.d.ts +2 -181
- package/components/NTextArea.js +1 -1
- package/components/NTooltip.d.ts +1 -105
- package/components/NTooltip.js +1 -1
- package/components/NValInput.d.ts +7 -182
- package/components/NValInput.js +1 -1
- package/env.d.ts +15 -0
- package/eslint.config.cjs +29 -0
- package/index.html +13 -0
- package/package.json +21 -19
- package/postcss.config.js +6 -0
- package/public/favicon.ico +0 -0
- package/scripts/build-lib.sh +52 -0
- package/scripts/sync-node-types.js +70 -0
- package/src/demo/App.css +9 -0
- package/src/demo/App.tsx +5 -0
- package/src/demo/components/ColorGrid.tsx +26 -0
- package/src/demo/components/ComponentGrid.tsx +26 -0
- package/src/demo/components/ComponentSection.tsx +30 -0
- package/src/demo/components/VariantSection.tsx +18 -0
- package/src/demo/i18n/de.ts +7 -0
- package/src/demo/i18n/en.ts +7 -0
- package/src/demo/i18n/index.ts +24 -0
- package/src/demo/main.ts +13 -0
- package/src/demo/router/index.ts +21 -0
- package/src/demo/views/HomeView.tsx +94 -0
- package/src/demo/views/NavigationView.tsx +43 -0
- package/src/demo/views/presentation/AlertView.tsx +40 -0
- package/src/demo/views/presentation/BadgeView.tsx +61 -0
- package/src/demo/views/presentation/BreadcrumbView.tsx +52 -0
- package/src/demo/views/presentation/ButtonView.tsx +49 -0
- package/src/demo/views/presentation/CheckboxView.tsx +59 -0
- package/src/demo/views/presentation/DropdownView.tsx +59 -0
- package/src/demo/views/presentation/DropzoneView.tsx +39 -0
- package/src/demo/views/presentation/IconButtonView.tsx +47 -0
- package/src/demo/views/presentation/IconCircleView.tsx +38 -0
- package/src/demo/views/presentation/InputView.tsx +179 -0
- package/src/demo/views/presentation/LinkView.tsx +50 -0
- package/src/demo/views/presentation/ListView.tsx +29 -0
- package/src/demo/views/presentation/LoadingIndicatorView.tsx +38 -0
- package/src/demo/views/presentation/ModalView.tsx +210 -0
- package/src/demo/views/presentation/PaginationView.tsx +25 -0
- package/src/demo/views/presentation/SearchbarView.tsx +80 -0
- package/src/demo/views/presentation/TableView.tsx +146 -0
- package/src/demo/views/presentation/TooltipView.tsx +86 -0
- package/src/lib/components/NAlert.tsx +85 -0
- package/src/lib/components/NBadge.tsx +75 -0
- package/src/lib/components/NBreadcrub.tsx +97 -0
- package/src/lib/components/NButton.tsx +80 -0
- package/src/lib/components/NCheckbox.tsx +55 -0
- package/src/lib/components/NCheckboxLabel.tsx +51 -0
- package/src/lib/components/NCrudModal.tsx +133 -0
- package/src/lib/components/NDialog.tsx +182 -0
- package/src/lib/components/NDropdown.tsx +167 -0
- package/src/lib/components/NDropzone.tsx +265 -0
- package/src/lib/components/NForm.tsx +32 -0
- package/src/lib/components/NFormModal.tsx +66 -0
- package/src/lib/components/NIconButton.tsx +92 -0
- package/src/lib/components/NIconCircle.tsx +78 -0
- package/src/lib/components/NInput.css +11 -0
- package/src/lib/components/NInput.tsx +139 -0
- package/src/lib/components/NInputPhone.tsx +53 -0
- package/src/lib/components/NInputSelect.tsx +126 -0
- package/src/lib/components/NInputSuggestion.tsx +80 -0
- package/src/lib/components/NLink.tsx +68 -0
- package/src/lib/components/NList.tsx +67 -0
- package/src/lib/components/NLoadingIndicator.css +46 -0
- package/src/lib/components/NLoadingIndicator.tsx +63 -0
- package/src/lib/components/NModal.tsx +243 -0
- package/src/lib/components/NPagination.css +15 -0
- package/src/lib/components/NPagination.tsx +131 -0
- package/src/lib/components/NSearchbar.tsx +78 -0
- package/src/lib/components/NSearchbarList.tsx +47 -0
- package/src/lib/components/NSelect.tsx +128 -0
- package/src/lib/components/NSuggestionList.tsx +216 -0
- package/src/lib/components/NTable.css +3 -0
- package/src/lib/components/NTable.tsx +247 -0
- package/src/lib/components/NTableAction.tsx +49 -0
- package/src/lib/components/NTextArea.tsx +159 -0
- package/src/lib/components/NTooltip.css +37 -0
- package/src/lib/components/NTooltip.tsx +250 -0
- package/src/lib/components/NValInput.tsx +163 -0
- package/src/lib/components/ValidatedForm.ts +71 -0
- package/src/lib/components/__tests__/NButton.spec.tsx +26 -0
- package/src/lib/components/__tests__/NCheckbox.spec.tsx +39 -0
- package/src/lib/i18n/de/vue-collection.json +58 -0
- package/src/lib/i18n/en/vue-collection.json +58 -0
- package/src/lib/i18n/index.ts +54 -0
- package/src/lib/index.ts +2 -0
- package/src/lib/jsx.d.ts +13 -0
- package/src/lib/utils/__tests__/identifiable.spec.ts +72 -0
- package/src/lib/utils/__tests__/validation.spec.ts +92 -0
- package/src/lib/utils/breakpoints.ts +47 -0
- package/src/lib/utils/component.tsx +131 -0
- package/src/lib/utils/deferred.ts +28 -0
- package/src/lib/utils/identifiable.ts +87 -0
- package/src/lib/utils/stringMaxLength.ts +25 -0
- package/src/lib/utils/tailwind.ts +41 -0
- package/src/lib/utils/utils.ts +90 -0
- package/src/lib/utils/vModel.ts +260 -0
- package/src/lib/utils/validation.ts +189 -0
- package/src/lib/utils/vue.ts +25 -0
- package/tailwind.config.js +38 -0
- package/tsconfig.config.json +9 -0
- package/tsconfig.demo.json +19 -0
- package/tsconfig.json +16 -0
- package/tsconfig.lib.json +18 -0
- package/tsconfig.vitest.json +8 -0
- package/utils/breakpoints.d.ts +1 -1
- package/utils/component.d.ts +3 -7
- package/utils/component.js +5 -2
- package/utils/identifiable.js +5 -1
- package/vite.config.ts +28 -0
|
@@ -33,67 +33,5 @@ export declare const nPaginationProps: {
|
|
|
33
33
|
/**
|
|
34
34
|
* The `NPagination` is a styled pagination component.
|
|
35
35
|
*/
|
|
36
|
-
declare const Component: import("vue").
|
|
37
|
-
/**
|
|
38
|
-
* The page number which is currently selected.
|
|
39
|
-
*/
|
|
40
|
-
readonly value: {
|
|
41
|
-
readonly type: NumberConstructor;
|
|
42
|
-
readonly default: () => number;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* This is called, when a new page number has been selected.
|
|
46
|
-
*/
|
|
47
|
-
readonly onUpdateValue: PropType<(newValue: number) => void>;
|
|
48
|
-
/**
|
|
49
|
-
* The total pages which exists. This is needed to correctly display the selectable pages.
|
|
50
|
-
*/
|
|
51
|
-
readonly total: {
|
|
52
|
-
readonly type: NumberConstructor;
|
|
53
|
-
readonly default: () => number;
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* If set to `true`, the pagination is displayed smaller.
|
|
57
|
-
*/
|
|
58
|
-
readonly small: BooleanConstructor;
|
|
59
|
-
/**
|
|
60
|
-
* This is called, when the visible pages, which are selectable in the pagination, have changed.
|
|
61
|
-
* This is useful as only these pages can be navigated to on the next click.
|
|
62
|
-
* This information can be useful for prefetching.
|
|
63
|
-
*/
|
|
64
|
-
readonly onVisiblePagesChanged: PropType<(visiblePages: number[]) => void>;
|
|
65
|
-
}, 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<{
|
|
66
|
-
/**
|
|
67
|
-
* The page number which is currently selected.
|
|
68
|
-
*/
|
|
69
|
-
readonly value: {
|
|
70
|
-
readonly type: NumberConstructor;
|
|
71
|
-
readonly default: () => number;
|
|
72
|
-
};
|
|
73
|
-
/**
|
|
74
|
-
* This is called, when a new page number has been selected.
|
|
75
|
-
*/
|
|
76
|
-
readonly onUpdateValue: PropType<(newValue: number) => void>;
|
|
77
|
-
/**
|
|
78
|
-
* The total pages which exists. This is needed to correctly display the selectable pages.
|
|
79
|
-
*/
|
|
80
|
-
readonly total: {
|
|
81
|
-
readonly type: NumberConstructor;
|
|
82
|
-
readonly default: () => number;
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* If set to `true`, the pagination is displayed smaller.
|
|
86
|
-
*/
|
|
87
|
-
readonly small: BooleanConstructor;
|
|
88
|
-
/**
|
|
89
|
-
* This is called, when the visible pages, which are selectable in the pagination, have changed.
|
|
90
|
-
* This is useful as only these pages can be navigated to on the next click.
|
|
91
|
-
* This information can be useful for prefetching.
|
|
92
|
-
*/
|
|
93
|
-
readonly onVisiblePagesChanged: PropType<(visiblePages: number[]) => void>;
|
|
94
|
-
}>> & {}, {
|
|
95
|
-
readonly small: boolean;
|
|
96
|
-
readonly value: number;
|
|
97
|
-
readonly total: number;
|
|
98
|
-
}>;
|
|
36
|
+
declare const Component: import("vue").DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import("vue").PublicProps>;
|
|
99
37
|
export { Component as NPagination, Component as default };
|
|
@@ -35,60 +35,5 @@ export type NSearchbarExposed = {
|
|
|
35
35
|
/**
|
|
36
36
|
* The `NSearchbar` is a styled input with a search icon.
|
|
37
37
|
*/
|
|
38
|
-
declare const Component: import("vue").
|
|
39
|
-
/**
|
|
40
|
-
* The placeholder of the search-bar.
|
|
41
|
-
*/
|
|
42
|
-
readonly placeholder: {
|
|
43
|
-
readonly type: StringConstructor;
|
|
44
|
-
readonly default: string;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* If set to `true` the search-bar is displayed smaller.
|
|
48
|
-
*/
|
|
49
|
-
readonly small: BooleanConstructor;
|
|
50
|
-
/**
|
|
51
|
-
* Adds the classes directly to the input (e.g. for shadow).
|
|
52
|
-
*/
|
|
53
|
-
readonly inputClass: StringConstructor;
|
|
54
|
-
/**
|
|
55
|
-
* This is called when the search-bar receives focus.
|
|
56
|
-
*/
|
|
57
|
-
readonly onFocus: PropType<() => void>;
|
|
58
|
-
/**
|
|
59
|
-
* This is called when the search-bar looses focus.
|
|
60
|
-
*/
|
|
61
|
-
readonly onBlur: PropType<() => void>;
|
|
62
|
-
readonly value: PropType<string>;
|
|
63
|
-
readonly onUpdateValue: PropType<(newValue: string) => void>;
|
|
64
|
-
}, 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<{
|
|
65
|
-
/**
|
|
66
|
-
* The placeholder of the search-bar.
|
|
67
|
-
*/
|
|
68
|
-
readonly placeholder: {
|
|
69
|
-
readonly type: StringConstructor;
|
|
70
|
-
readonly default: string;
|
|
71
|
-
};
|
|
72
|
-
/**
|
|
73
|
-
* If set to `true` the search-bar is displayed smaller.
|
|
74
|
-
*/
|
|
75
|
-
readonly small: BooleanConstructor;
|
|
76
|
-
/**
|
|
77
|
-
* Adds the classes directly to the input (e.g. for shadow).
|
|
78
|
-
*/
|
|
79
|
-
readonly inputClass: StringConstructor;
|
|
80
|
-
/**
|
|
81
|
-
* This is called when the search-bar receives focus.
|
|
82
|
-
*/
|
|
83
|
-
readonly onFocus: PropType<() => void>;
|
|
84
|
-
/**
|
|
85
|
-
* This is called when the search-bar looses focus.
|
|
86
|
-
*/
|
|
87
|
-
readonly onBlur: PropType<() => void>;
|
|
88
|
-
readonly value: PropType<string>;
|
|
89
|
-
readonly onUpdateValue: PropType<(newValue: string) => void>;
|
|
90
|
-
}>> & {}, {
|
|
91
|
-
readonly small: boolean;
|
|
92
|
-
readonly placeholder: string;
|
|
93
|
-
}>;
|
|
38
|
+
declare const Component: import("vue").DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import("vue").PublicProps>;
|
|
94
39
|
export { Component as NSearchbar, Component as default };
|
|
@@ -13,7 +13,7 @@ export declare const nSearchbarListProps: {
|
|
|
13
13
|
readonly value: import("vue").PropType<string>;
|
|
14
14
|
readonly onUpdateValue: import("vue").PropType<(newValue: string) => void>;
|
|
15
15
|
readonly items: {
|
|
16
|
-
readonly type: import("vue").PropType<import("./NSuggestionList").SuggestionItem
|
|
16
|
+
readonly type: import("vue").PropType<Array<import("./NSuggestionList").SuggestionItem>>;
|
|
17
17
|
readonly default: () => never[];
|
|
18
18
|
};
|
|
19
19
|
readonly maxItems: {
|
|
@@ -23,71 +23,11 @@ export declare const nSearchbarListProps: {
|
|
|
23
23
|
readonly hideList: BooleanConstructor;
|
|
24
24
|
readonly loading: BooleanConstructor;
|
|
25
25
|
readonly onSelect: import("vue").PropType<(id: string) => void>;
|
|
26
|
-
readonly listItem: import("vue").PropType<(props: import("./NSuggestionList").ItemSlotProps
|
|
26
|
+
readonly listItem: import("vue").PropType<(props: import("./NSuggestionList").ItemSlotProps) => JSX.Element>;
|
|
27
27
|
readonly onRealBlur: import("vue").PropType<() => void>;
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
30
30
|
* The `NSearchbarList` is a {@link NSearchbar} with a {@link NSuggestionList}.
|
|
31
31
|
*/
|
|
32
|
-
declare const Component: import("vue").
|
|
33
|
-
/**
|
|
34
|
-
* @see {@link nSearchbarProps.placeholder}
|
|
35
|
-
*/
|
|
36
|
-
readonly placeholder: {
|
|
37
|
-
readonly type: StringConstructor;
|
|
38
|
-
readonly default: string;
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* Adds the classes directly to the input (e.g. for shadow).
|
|
42
|
-
*/
|
|
43
|
-
readonly inputClass: StringConstructor;
|
|
44
|
-
readonly value: import("vue").PropType<string>;
|
|
45
|
-
readonly onUpdateValue: import("vue").PropType<(newValue: string) => void>;
|
|
46
|
-
readonly items: {
|
|
47
|
-
readonly type: import("vue").PropType<import("./NSuggestionList").SuggestionItem[]>;
|
|
48
|
-
readonly default: () => never[];
|
|
49
|
-
};
|
|
50
|
-
readonly maxItems: {
|
|
51
|
-
readonly type: NumberConstructor;
|
|
52
|
-
readonly default: () => number;
|
|
53
|
-
};
|
|
54
|
-
readonly hideList: BooleanConstructor;
|
|
55
|
-
readonly loading: BooleanConstructor;
|
|
56
|
-
readonly onSelect: import("vue").PropType<(id: string) => void>;
|
|
57
|
-
readonly listItem: import("vue").PropType<(props: import("./NSuggestionList").ItemSlotProps<import("./NSuggestionList").SuggestionItem>) => JSX.Element>;
|
|
58
|
-
readonly onRealBlur: import("vue").PropType<() => void>;
|
|
59
|
-
}, 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<{
|
|
60
|
-
/**
|
|
61
|
-
* @see {@link nSearchbarProps.placeholder}
|
|
62
|
-
*/
|
|
63
|
-
readonly placeholder: {
|
|
64
|
-
readonly type: StringConstructor;
|
|
65
|
-
readonly default: string;
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* Adds the classes directly to the input (e.g. for shadow).
|
|
69
|
-
*/
|
|
70
|
-
readonly inputClass: StringConstructor;
|
|
71
|
-
readonly value: import("vue").PropType<string>;
|
|
72
|
-
readonly onUpdateValue: import("vue").PropType<(newValue: string) => void>;
|
|
73
|
-
readonly items: {
|
|
74
|
-
readonly type: import("vue").PropType<import("./NSuggestionList").SuggestionItem[]>;
|
|
75
|
-
readonly default: () => never[];
|
|
76
|
-
};
|
|
77
|
-
readonly maxItems: {
|
|
78
|
-
readonly type: NumberConstructor;
|
|
79
|
-
readonly default: () => number;
|
|
80
|
-
};
|
|
81
|
-
readonly hideList: BooleanConstructor;
|
|
82
|
-
readonly loading: BooleanConstructor;
|
|
83
|
-
readonly onSelect: import("vue").PropType<(id: string) => void>;
|
|
84
|
-
readonly listItem: import("vue").PropType<(props: import("./NSuggestionList").ItemSlotProps<import("./NSuggestionList").SuggestionItem>) => JSX.Element>;
|
|
85
|
-
readonly onRealBlur: import("vue").PropType<() => void>;
|
|
86
|
-
}>> & {}, {
|
|
87
|
-
readonly loading: boolean;
|
|
88
|
-
readonly items: import("./NSuggestionList").SuggestionItem[];
|
|
89
|
-
readonly placeholder: string;
|
|
90
|
-
readonly maxItems: number;
|
|
91
|
-
readonly hideList: boolean;
|
|
92
|
-
}>;
|
|
32
|
+
declare const Component: import("vue").DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import("vue").PublicProps>;
|
|
93
33
|
export { Component as NSearchbarList, Component as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
|
|
2
2
|
import { createComponentWithSlots } from '../utils/component';
|
|
3
3
|
import { ref } from 'vue';
|
|
4
4
|
import { vModelProps } from '../utils/vModel';
|
package/components/NSelect.d.ts
CHANGED
|
@@ -8,9 +8,7 @@ export declare const nSelectProps: {
|
|
|
8
8
|
readonly tooltipShow: BooleanConstructor;
|
|
9
9
|
readonly tooltipPlacement: {
|
|
10
10
|
readonly type: PropType<import("./NTooltip").TooltipPlacement>;
|
|
11
|
-
readonly default: "auto";
|
|
12
|
-
* @see {@link nValInputProps.name}
|
|
13
|
-
*/
|
|
11
|
+
readonly default: "auto";
|
|
14
12
|
};
|
|
15
13
|
readonly tooltipMaxWidth: {
|
|
16
14
|
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
@@ -76,149 +74,5 @@ export type NSelectExposed = NValInputExposed;
|
|
|
76
74
|
/**
|
|
77
75
|
* The `NSelect` is a styled html select-input.
|
|
78
76
|
*/
|
|
79
|
-
declare const Component: import("vue").
|
|
80
|
-
readonly tooltipText: StringConstructor;
|
|
81
|
-
readonly tooltipContent: PropType<() => JSX.Element>;
|
|
82
|
-
readonly tooltipHide: BooleanConstructor;
|
|
83
|
-
readonly tooltipShow: BooleanConstructor;
|
|
84
|
-
readonly tooltipPlacement: {
|
|
85
|
-
readonly type: PropType<import("./NTooltip").TooltipPlacement>;
|
|
86
|
-
readonly default: "auto"; /**
|
|
87
|
-
* @see {@link nValInputProps.name}
|
|
88
|
-
*/
|
|
89
|
-
};
|
|
90
|
-
readonly tooltipMaxWidth: {
|
|
91
|
-
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
92
|
-
readonly default: "max-w-xs";
|
|
93
|
-
};
|
|
94
|
-
readonly tooltipWrapperClass: StringConstructor;
|
|
95
|
-
readonly tooltipContentClass: StringConstructor;
|
|
96
|
-
readonly tooltipArrowClass: StringConstructor;
|
|
97
|
-
/**
|
|
98
|
-
* The id of the currently selected option of this input.
|
|
99
|
-
*/
|
|
100
|
-
readonly value: StringConstructor;
|
|
101
|
-
/**
|
|
102
|
-
* This is called with the newly selected id when the selection has changed.
|
|
103
|
-
* If no id is selected, the empty string is passed, in order to
|
|
104
|
-
* match the API of all other inputs who never pass `undefined`.
|
|
105
|
-
*/
|
|
106
|
-
readonly onUpdateValue: PropType<(newValue: string) => void>;
|
|
107
|
-
/**
|
|
108
|
-
* The different options which can be selected.
|
|
109
|
-
*/
|
|
110
|
-
readonly options: {
|
|
111
|
-
readonly type: PropType<SelectionOption[]>;
|
|
112
|
-
readonly default: () => never[];
|
|
113
|
-
};
|
|
114
|
-
/**
|
|
115
|
-
* The value which is shown in the empty state.
|
|
116
|
-
* The "nothing-option" will be called like this.
|
|
117
|
-
*/
|
|
118
|
-
readonly placeholder: {
|
|
119
|
-
readonly type: StringConstructor;
|
|
120
|
-
readonly default: () => string;
|
|
121
|
-
};
|
|
122
|
-
/**
|
|
123
|
-
* @see {@link nValInputProps.name}
|
|
124
|
-
*/
|
|
125
|
-
readonly name: StringConstructor;
|
|
126
|
-
/**
|
|
127
|
-
* @see {@link nValInputProps.optional}
|
|
128
|
-
*/
|
|
129
|
-
readonly optional: BooleanConstructor;
|
|
130
|
-
/**
|
|
131
|
-
* @see {@link nValInputProps.disabled}
|
|
132
|
-
*/
|
|
133
|
-
readonly disabled: BooleanConstructor;
|
|
134
|
-
/**
|
|
135
|
-
* @see {@link nValInputProps.form}
|
|
136
|
-
*/
|
|
137
|
-
readonly form: PropType<import("./ValidatedForm").ValidatedForm>;
|
|
138
|
-
/**
|
|
139
|
-
* @see {@link nValInputProps.hideLabel}
|
|
140
|
-
*/
|
|
141
|
-
readonly hideLabel: BooleanConstructor;
|
|
142
|
-
/**
|
|
143
|
-
* @see {@link nValInputProps.inputClass}
|
|
144
|
-
*/
|
|
145
|
-
readonly inputClass: StringConstructor;
|
|
146
|
-
}, 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<{
|
|
147
|
-
readonly tooltipText: StringConstructor;
|
|
148
|
-
readonly tooltipContent: PropType<() => JSX.Element>;
|
|
149
|
-
readonly tooltipHide: BooleanConstructor;
|
|
150
|
-
readonly tooltipShow: BooleanConstructor;
|
|
151
|
-
readonly tooltipPlacement: {
|
|
152
|
-
readonly type: PropType<import("./NTooltip").TooltipPlacement>;
|
|
153
|
-
readonly default: "auto"; /**
|
|
154
|
-
* @see {@link nValInputProps.name}
|
|
155
|
-
*/
|
|
156
|
-
};
|
|
157
|
-
readonly tooltipMaxWidth: {
|
|
158
|
-
readonly type: PropType<import("../utils/tailwind").TWMaxWidth>;
|
|
159
|
-
readonly default: "max-w-xs";
|
|
160
|
-
};
|
|
161
|
-
readonly tooltipWrapperClass: StringConstructor;
|
|
162
|
-
readonly tooltipContentClass: StringConstructor;
|
|
163
|
-
readonly tooltipArrowClass: StringConstructor;
|
|
164
|
-
/**
|
|
165
|
-
* The id of the currently selected option of this input.
|
|
166
|
-
*/
|
|
167
|
-
readonly value: StringConstructor;
|
|
168
|
-
/**
|
|
169
|
-
* This is called with the newly selected id when the selection has changed.
|
|
170
|
-
* If no id is selected, the empty string is passed, in order to
|
|
171
|
-
* match the API of all other inputs who never pass `undefined`.
|
|
172
|
-
*/
|
|
173
|
-
readonly onUpdateValue: PropType<(newValue: string) => void>;
|
|
174
|
-
/**
|
|
175
|
-
* The different options which can be selected.
|
|
176
|
-
*/
|
|
177
|
-
readonly options: {
|
|
178
|
-
readonly type: PropType<SelectionOption[]>;
|
|
179
|
-
readonly default: () => never[];
|
|
180
|
-
};
|
|
181
|
-
/**
|
|
182
|
-
* The value which is shown in the empty state.
|
|
183
|
-
* The "nothing-option" will be called like this.
|
|
184
|
-
*/
|
|
185
|
-
readonly placeholder: {
|
|
186
|
-
readonly type: StringConstructor;
|
|
187
|
-
readonly default: () => string;
|
|
188
|
-
};
|
|
189
|
-
/**
|
|
190
|
-
* @see {@link nValInputProps.name}
|
|
191
|
-
*/
|
|
192
|
-
readonly name: StringConstructor;
|
|
193
|
-
/**
|
|
194
|
-
* @see {@link nValInputProps.optional}
|
|
195
|
-
*/
|
|
196
|
-
readonly optional: BooleanConstructor;
|
|
197
|
-
/**
|
|
198
|
-
* @see {@link nValInputProps.disabled}
|
|
199
|
-
*/
|
|
200
|
-
readonly disabled: BooleanConstructor;
|
|
201
|
-
/**
|
|
202
|
-
* @see {@link nValInputProps.form}
|
|
203
|
-
*/
|
|
204
|
-
readonly form: PropType<import("./ValidatedForm").ValidatedForm>;
|
|
205
|
-
/**
|
|
206
|
-
* @see {@link nValInputProps.hideLabel}
|
|
207
|
-
*/
|
|
208
|
-
readonly hideLabel: BooleanConstructor;
|
|
209
|
-
/**
|
|
210
|
-
* @see {@link nValInputProps.inputClass}
|
|
211
|
-
*/
|
|
212
|
-
readonly inputClass: StringConstructor;
|
|
213
|
-
}>> & {}, {
|
|
214
|
-
readonly tooltipHide: boolean;
|
|
215
|
-
readonly tooltipShow: boolean;
|
|
216
|
-
readonly tooltipPlacement: import("./NTooltip").TooltipPlacement;
|
|
217
|
-
readonly tooltipMaxWidth: import("../utils/tailwind").TWMaxWidth;
|
|
218
|
-
readonly options: SelectionOption[];
|
|
219
|
-
readonly disabled: boolean;
|
|
220
|
-
readonly placeholder: string;
|
|
221
|
-
readonly hideLabel: boolean;
|
|
222
|
-
readonly optional: boolean;
|
|
223
|
-
}>;
|
|
77
|
+
declare const Component: import("vue").DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import("vue").PublicProps>;
|
|
224
78
|
export { Component as NSelect, Component as default };
|
package/components/NSelect.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, createVNode as _createVNode, mergeProps as _mergeProps } from "vue";
|
|
2
2
|
import { trsl } from '../i18n';
|
|
3
3
|
import { createComponent } from '../utils/component';
|
|
4
4
|
import { ref } from 'vue';
|
|
@@ -6,7 +6,7 @@ export declare const nSuggestionListPropsForConfig: {
|
|
|
6
6
|
* The items which are available to show in the list. The first `maxItems` will be displayed.
|
|
7
7
|
*/
|
|
8
8
|
readonly items: {
|
|
9
|
-
readonly type: PropType<SuggestionItem
|
|
9
|
+
readonly type: PropType<Array<SuggestionItem>>;
|
|
10
10
|
readonly default: () => never[];
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
@@ -90,7 +90,7 @@ export declare const nSuggestionListProps: {
|
|
|
90
90
|
* The items which are available to show in the list. The first `maxItems` will be displayed.
|
|
91
91
|
*/
|
|
92
92
|
readonly items: {
|
|
93
|
-
readonly type: PropType<SuggestionItem
|
|
93
|
+
readonly type: PropType<Array<SuggestionItem>>;
|
|
94
94
|
readonly default: () => never[];
|
|
95
95
|
};
|
|
96
96
|
/**
|
|
@@ -149,128 +149,5 @@ export type SuggestionItem = Identifiable & {
|
|
|
149
149
|
/**
|
|
150
150
|
* The `NSuggestionList` can be added to an input and adds a list below it which is shown when the input is focused.
|
|
151
151
|
*/
|
|
152
|
-
declare const Component: import("vue").
|
|
153
|
-
/**
|
|
154
|
-
* The slot for the input, which will be enhanced with the suggestion list.
|
|
155
|
-
*/
|
|
156
|
-
readonly input: {
|
|
157
|
-
readonly type: PropType<(props: InputSlotProps) => JSX.Element>;
|
|
158
|
-
readonly required: true;
|
|
159
|
-
};
|
|
160
|
-
/**
|
|
161
|
-
* When this function is called, the parent is required to call focus() on the input element.
|
|
162
|
-
* It won't work properly if the parent does not request focus on the input.
|
|
163
|
-
*/
|
|
164
|
-
readonly onRequestInputFocus: {
|
|
165
|
-
readonly type: PropType<() => void>;
|
|
166
|
-
readonly required: true;
|
|
167
|
-
};
|
|
168
|
-
/**
|
|
169
|
-
* The current value of the input. This is just needed to display the «No results found for {value}» message.
|
|
170
|
-
*/
|
|
171
|
-
readonly inputValue: {
|
|
172
|
-
readonly type: StringConstructor;
|
|
173
|
-
readonly required: true;
|
|
174
|
-
};
|
|
175
|
-
/**
|
|
176
|
-
* The items which are available to show in the list. The first `maxItems` will be displayed.
|
|
177
|
-
*/
|
|
178
|
-
readonly items: {
|
|
179
|
-
readonly type: PropType<SuggestionItem[]>;
|
|
180
|
-
readonly default: () => never[];
|
|
181
|
-
};
|
|
182
|
-
/**
|
|
183
|
-
* The maximum items which are displayed in the list.
|
|
184
|
-
*/
|
|
185
|
-
readonly maxItems: {
|
|
186
|
-
readonly type: NumberConstructor;
|
|
187
|
-
readonly default: () => number;
|
|
188
|
-
};
|
|
189
|
-
/**
|
|
190
|
-
* If set to `true` the list is hidden.
|
|
191
|
-
*/
|
|
192
|
-
readonly hideList: BooleanConstructor;
|
|
193
|
-
/**
|
|
194
|
-
* If set to `true` the list shows a loading indicator when the `items` array is empty.
|
|
195
|
-
*/
|
|
196
|
-
readonly loading: BooleanConstructor;
|
|
197
|
-
/**
|
|
198
|
-
* This is called with the id of the selected item.
|
|
199
|
-
*/
|
|
200
|
-
readonly onSelect: PropType<(id: string) => void>;
|
|
201
|
-
/**
|
|
202
|
-
* The slot for every item of the list.
|
|
203
|
-
*/
|
|
204
|
-
readonly listItem: PropType<(props: ItemSlotProps) => JSX.Element>;
|
|
205
|
-
/**
|
|
206
|
-
* This function is called, when the input and the suggestion list are really blurred.
|
|
207
|
-
* This means, it's not just the input temporarly beeing blurred because the user clicks on the item list,
|
|
208
|
-
* but the focus has completely disappeared from the input and the list.
|
|
209
|
-
*/
|
|
210
|
-
readonly onRealBlur: PropType<() => void>;
|
|
211
|
-
}, 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<{
|
|
212
|
-
/**
|
|
213
|
-
* The slot for the input, which will be enhanced with the suggestion list.
|
|
214
|
-
*/
|
|
215
|
-
readonly input: {
|
|
216
|
-
readonly type: PropType<(props: InputSlotProps) => JSX.Element>;
|
|
217
|
-
readonly required: true;
|
|
218
|
-
};
|
|
219
|
-
/**
|
|
220
|
-
* When this function is called, the parent is required to call focus() on the input element.
|
|
221
|
-
* It won't work properly if the parent does not request focus on the input.
|
|
222
|
-
*/
|
|
223
|
-
readonly onRequestInputFocus: {
|
|
224
|
-
readonly type: PropType<() => void>;
|
|
225
|
-
readonly required: true;
|
|
226
|
-
};
|
|
227
|
-
/**
|
|
228
|
-
* The current value of the input. This is just needed to display the «No results found for {value}» message.
|
|
229
|
-
*/
|
|
230
|
-
readonly inputValue: {
|
|
231
|
-
readonly type: StringConstructor;
|
|
232
|
-
readonly required: true;
|
|
233
|
-
};
|
|
234
|
-
/**
|
|
235
|
-
* The items which are available to show in the list. The first `maxItems` will be displayed.
|
|
236
|
-
*/
|
|
237
|
-
readonly items: {
|
|
238
|
-
readonly type: PropType<SuggestionItem[]>;
|
|
239
|
-
readonly default: () => never[];
|
|
240
|
-
};
|
|
241
|
-
/**
|
|
242
|
-
* The maximum items which are displayed in the list.
|
|
243
|
-
*/
|
|
244
|
-
readonly maxItems: {
|
|
245
|
-
readonly type: NumberConstructor;
|
|
246
|
-
readonly default: () => number;
|
|
247
|
-
};
|
|
248
|
-
/**
|
|
249
|
-
* If set to `true` the list is hidden.
|
|
250
|
-
*/
|
|
251
|
-
readonly hideList: BooleanConstructor;
|
|
252
|
-
/**
|
|
253
|
-
* If set to `true` the list shows a loading indicator when the `items` array is empty.
|
|
254
|
-
*/
|
|
255
|
-
readonly loading: BooleanConstructor;
|
|
256
|
-
/**
|
|
257
|
-
* This is called with the id of the selected item.
|
|
258
|
-
*/
|
|
259
|
-
readonly onSelect: PropType<(id: string) => void>;
|
|
260
|
-
/**
|
|
261
|
-
* The slot for every item of the list.
|
|
262
|
-
*/
|
|
263
|
-
readonly listItem: PropType<(props: ItemSlotProps) => JSX.Element>;
|
|
264
|
-
/**
|
|
265
|
-
* This function is called, when the input and the suggestion list are really blurred.
|
|
266
|
-
* This means, it's not just the input temporarly beeing blurred because the user clicks on the item list,
|
|
267
|
-
* but the focus has completely disappeared from the input and the list.
|
|
268
|
-
*/
|
|
269
|
-
readonly onRealBlur: PropType<() => void>;
|
|
270
|
-
}>> & {}, {
|
|
271
|
-
readonly loading: boolean;
|
|
272
|
-
readonly items: SuggestionItem[];
|
|
273
|
-
readonly maxItems: number;
|
|
274
|
-
readonly hideList: boolean;
|
|
275
|
-
}>;
|
|
152
|
+
declare const Component: import("vue").DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import("vue").PublicProps>;
|
|
276
153
|
export { Component as NSuggestionList, Component as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createVNode as _createVNode, createTextVNode as _createTextVNode } from "vue";
|
|
2
2
|
import { trsl } from '../i18n';
|
|
3
3
|
import { createComponentWithSlots } from '../utils/component';
|
|
4
4
|
import { computed, ref } from 'vue';
|
|
@@ -103,7 +103,10 @@ const Component = createComponentWithSlots('NSuggestionList', nSuggestionListPro
|
|
|
103
103
|
event.preventDefault();
|
|
104
104
|
const index = selectedIndex.value;
|
|
105
105
|
if (index != null && index < displayItems.value.length) {
|
|
106
|
-
|
|
106
|
+
const item = displayItems.value[index];
|
|
107
|
+
if (item) {
|
|
108
|
+
onSelect(item.id);
|
|
109
|
+
}
|
|
107
110
|
}
|
|
108
111
|
}
|
|
109
112
|
};
|
package/components/NTable.d.ts
CHANGED
|
@@ -93,89 +93,5 @@ export declare const nTableProps: {
|
|
|
93
93
|
/**
|
|
94
94
|
* The `NTable` is a styled html table which accepts data and displays it appropriately.
|
|
95
95
|
*/
|
|
96
|
-
declare const Component: import("vue").
|
|
97
|
-
/**
|
|
98
|
-
* The headings of the table. These define which columns are shown in the table and in which order.
|
|
99
|
-
*/
|
|
100
|
-
readonly headings: {
|
|
101
|
-
readonly type: PropType<TableHeading[]>;
|
|
102
|
-
readonly required: true;
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* Adds the classes to all headings at the top of the table.
|
|
106
|
-
*/
|
|
107
|
-
readonly headingsClass: StringConstructor;
|
|
108
|
-
/**
|
|
109
|
-
* Adds the classes to all headings in the details of the table.
|
|
110
|
-
*/
|
|
111
|
-
readonly headingDetailsClass: StringConstructor;
|
|
112
|
-
/**
|
|
113
|
-
* The items of the table. They consist of an array of table rows.
|
|
114
|
-
* Every tablerow is an object containing elements for the heading keys.
|
|
115
|
-
* The elements can either be a primitive value or a function which returns a {@link JSX.Element}.
|
|
116
|
-
* If the item should be treated as an action (e.g. icon-button to display at the end of the row)
|
|
117
|
-
* the dedicated key 'action' can be used.
|
|
118
|
-
* @see TableRow
|
|
119
|
-
* @example
|
|
120
|
-
* // These headings are defined
|
|
121
|
-
* const headings: TableHeading[] = [
|
|
122
|
-
* { key: 'id', label: 'ID' },
|
|
123
|
-
* { key: 'name', label: 'Name' },
|
|
124
|
-
* { key: 'status', label: 'Status' }
|
|
125
|
-
* ]
|
|
126
|
-
*
|
|
127
|
-
* // Appropriate rows for these headings
|
|
128
|
-
* const items: TableRow[] = [
|
|
129
|
-
* { id: 1, name: 'Hubert', status: () => <NBadge ... />, action: ... }, // Row 1
|
|
130
|
-
* { id: 2, name: 'Franzi', status: () => <NBadge ... />, action: ... } // Row 2
|
|
131
|
-
* ]
|
|
132
|
-
*/
|
|
133
|
-
readonly items: {
|
|
134
|
-
readonly type: PropType<TableRow[]>;
|
|
135
|
-
readonly default: () => never[];
|
|
136
|
-
};
|
|
137
|
-
}, 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<{
|
|
138
|
-
/**
|
|
139
|
-
* The headings of the table. These define which columns are shown in the table and in which order.
|
|
140
|
-
*/
|
|
141
|
-
readonly headings: {
|
|
142
|
-
readonly type: PropType<TableHeading[]>;
|
|
143
|
-
readonly required: true;
|
|
144
|
-
};
|
|
145
|
-
/**
|
|
146
|
-
* Adds the classes to all headings at the top of the table.
|
|
147
|
-
*/
|
|
148
|
-
readonly headingsClass: StringConstructor;
|
|
149
|
-
/**
|
|
150
|
-
* Adds the classes to all headings in the details of the table.
|
|
151
|
-
*/
|
|
152
|
-
readonly headingDetailsClass: StringConstructor;
|
|
153
|
-
/**
|
|
154
|
-
* The items of the table. They consist of an array of table rows.
|
|
155
|
-
* Every tablerow is an object containing elements for the heading keys.
|
|
156
|
-
* The elements can either be a primitive value or a function which returns a {@link JSX.Element}.
|
|
157
|
-
* If the item should be treated as an action (e.g. icon-button to display at the end of the row)
|
|
158
|
-
* the dedicated key 'action' can be used.
|
|
159
|
-
* @see TableRow
|
|
160
|
-
* @example
|
|
161
|
-
* // These headings are defined
|
|
162
|
-
* const headings: TableHeading[] = [
|
|
163
|
-
* { key: 'id', label: 'ID' },
|
|
164
|
-
* { key: 'name', label: 'Name' },
|
|
165
|
-
* { key: 'status', label: 'Status' }
|
|
166
|
-
* ]
|
|
167
|
-
*
|
|
168
|
-
* // Appropriate rows for these headings
|
|
169
|
-
* const items: TableRow[] = [
|
|
170
|
-
* { id: 1, name: 'Hubert', status: () => <NBadge ... />, action: ... }, // Row 1
|
|
171
|
-
* { id: 2, name: 'Franzi', status: () => <NBadge ... />, action: ... } // Row 2
|
|
172
|
-
* ]
|
|
173
|
-
*/
|
|
174
|
-
readonly items: {
|
|
175
|
-
readonly type: PropType<TableRow[]>;
|
|
176
|
-
readonly default: () => never[];
|
|
177
|
-
};
|
|
178
|
-
}>> & {}, {
|
|
179
|
-
readonly items: TableRow[];
|
|
180
|
-
}>;
|
|
96
|
+
declare const Component: import("vue").DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import("vue").PublicProps>;
|
|
181
97
|
export { Component as NTable, Component as default };
|