@naptics/vue-collection 0.0.1

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.
Files changed (105) hide show
  1. package/README.md +27 -0
  2. package/lib/components/NAlert.d.ts +72 -0
  3. package/lib/components/NAlert.jsx +69 -0
  4. package/lib/components/NBadge.d.ts +174 -0
  5. package/lib/components/NBadge.jsx +58 -0
  6. package/lib/components/NBreadcrub.d.ts +161 -0
  7. package/lib/components/NBreadcrub.jsx +64 -0
  8. package/lib/components/NButton.d.ts +149 -0
  9. package/lib/components/NButton.jsx +58 -0
  10. package/lib/components/NCheckbox.d.ts +51 -0
  11. package/lib/components/NCheckbox.jsx +38 -0
  12. package/lib/components/NCheckboxLabel.d.ts +70 -0
  13. package/lib/components/NCheckboxLabel.jsx +42 -0
  14. package/lib/components/NCrudModal.d.ts +301 -0
  15. package/lib/components/NCrudModal.jsx +89 -0
  16. package/lib/components/NDialog.d.ts +190 -0
  17. package/lib/components/NDialog.jsx +144 -0
  18. package/lib/components/NDropdown.d.ts +116 -0
  19. package/lib/components/NDropdown.jsx +92 -0
  20. package/lib/components/NDropzone.d.ts +162 -0
  21. package/lib/components/NDropzone.jsx +211 -0
  22. package/lib/components/NForm.d.ts +43 -0
  23. package/lib/components/NForm.jsx +26 -0
  24. package/lib/components/NFormModal.d.ts +190 -0
  25. package/lib/components/NFormModal.jsx +48 -0
  26. package/lib/components/NIconButton.d.ts +202 -0
  27. package/lib/components/NIconButton.jsx +71 -0
  28. package/lib/components/NIconCircle.d.ts +135 -0
  29. package/lib/components/NIconCircle.jsx +67 -0
  30. package/lib/components/NInput.css +11 -0
  31. package/lib/components/NInput.d.ts +232 -0
  32. package/lib/components/NInput.jsx +97 -0
  33. package/lib/components/NInputPhone.d.ts +150 -0
  34. package/lib/components/NInputPhone.jsx +31 -0
  35. package/lib/components/NInputSelect.d.ts +271 -0
  36. package/lib/components/NInputSelect.jsx +89 -0
  37. package/lib/components/NInputSuggestion.d.ts +212 -0
  38. package/lib/components/NInputSuggestion.jsx +48 -0
  39. package/lib/components/NLink.d.ts +111 -0
  40. package/lib/components/NLink.jsx +58 -0
  41. package/lib/components/NList.d.ts +43 -0
  42. package/lib/components/NList.jsx +24 -0
  43. package/lib/components/NLoadingIndicator.css +46 -0
  44. package/lib/components/NLoadingIndicator.d.ts +77 -0
  45. package/lib/components/NLoadingIndicator.jsx +42 -0
  46. package/lib/components/NModal.d.ts +333 -0
  47. package/lib/components/NModal.jsx +170 -0
  48. package/lib/components/NPagination.css +15 -0
  49. package/lib/components/NPagination.d.ts +99 -0
  50. package/lib/components/NPagination.jsx +104 -0
  51. package/lib/components/NSearchbar.d.ts +94 -0
  52. package/lib/components/NSearchbar.jsx +58 -0
  53. package/lib/components/NSearchbarList.d.ts +90 -0
  54. package/lib/components/NSearchbarList.jsx +20 -0
  55. package/lib/components/NSelect.d.ts +159 -0
  56. package/lib/components/NSelect.jsx +81 -0
  57. package/lib/components/NSuggestionList.d.ts +275 -0
  58. package/lib/components/NSuggestionList.jsx +157 -0
  59. package/lib/components/NTable.css +3 -0
  60. package/lib/components/NTable.d.ts +187 -0
  61. package/lib/components/NTable.jsx +146 -0
  62. package/lib/components/NTableAction.d.ts +74 -0
  63. package/lib/components/NTableAction.jsx +35 -0
  64. package/lib/components/NTextArea.d.ts +252 -0
  65. package/lib/components/NTextArea.jsx +108 -0
  66. package/lib/components/NTooltip.css +37 -0
  67. package/lib/components/NTooltip.d.ts +186 -0
  68. package/lib/components/NTooltip.jsx +161 -0
  69. package/lib/components/NValInput.d.ts +297 -0
  70. package/lib/components/NValInput.jsx +101 -0
  71. package/lib/components/ValidatedForm.d.ts +34 -0
  72. package/lib/components/ValidatedForm.js +25 -0
  73. package/lib/i18n/de/template.json +10 -0
  74. package/lib/i18n/de/vue-collection.json +58 -0
  75. package/lib/i18n/de.d.ts +61 -0
  76. package/lib/i18n/de.js +5 -0
  77. package/lib/i18n/en/template.json +10 -0
  78. package/lib/i18n/en/vue-collection.json +58 -0
  79. package/lib/i18n/en.d.ts +61 -0
  80. package/lib/i18n/en.js +5 -0
  81. package/lib/i18n/index.d.ts +17 -0
  82. package/lib/i18n/index.js +34 -0
  83. package/lib/index.d.ts +64 -0
  84. package/lib/index.js +65 -0
  85. package/lib/utils/breakpoints.d.ts +15 -0
  86. package/lib/utils/breakpoints.js +37 -0
  87. package/lib/utils/component.d.ts +50 -0
  88. package/lib/utils/component.js +51 -0
  89. package/lib/utils/deferred.d.ts +13 -0
  90. package/lib/utils/deferred.js +17 -0
  91. package/lib/utils/identifiable.d.ts +57 -0
  92. package/lib/utils/identifiable.js +78 -0
  93. package/lib/utils/stringMaxLength.d.ts +14 -0
  94. package/lib/utils/stringMaxLength.js +28 -0
  95. package/lib/utils/tailwind.d.ts +2 -0
  96. package/lib/utils/tailwind.js +1 -0
  97. package/lib/utils/utils.d.ts +27 -0
  98. package/lib/utils/utils.js +26 -0
  99. package/lib/utils/vModel.d.ts +182 -0
  100. package/lib/utils/vModel.js +215 -0
  101. package/lib/utils/validation.d.ts +84 -0
  102. package/lib/utils/validation.js +163 -0
  103. package/lib/utils/vue.d.ts +13 -0
  104. package/lib/utils/vue.js +19 -0
  105. package/package.json +56 -0
@@ -0,0 +1,202 @@
1
+ import type { HeroIcon } from '../utils/utils';
2
+ import type { PropType } from 'vue';
3
+ import { type RouteLocationRaw } from 'vue-router';
4
+ export declare const nIconButtonProps: {
5
+ tooltipText: StringConstructor;
6
+ tooltipContent: PropType<() => void>;
7
+ tooltipHide: BooleanConstructor;
8
+ tooltipShow: BooleanConstructor;
9
+ tooltipPlacement: {
10
+ type: PropType<import("./NTooltip").TooltipPlacement>;
11
+ default: string;
12
+ };
13
+ tooltipMaxWidth: {
14
+ type: PropType<import("../utils/tailwind").TWMaxWidth>;
15
+ default: string;
16
+ };
17
+ /**
18
+ * The icon of the icon-button.
19
+ */
20
+ icon: {
21
+ type: PropType<HeroIcon>;
22
+ required: true;
23
+ };
24
+ /**
25
+ * The route of the icon-button. If this is set, the icon-button becomes a {@link RouterLink}.
26
+ */
27
+ route: PropType<RouteLocationRaw>;
28
+ /**
29
+ * The color of the icon-button.
30
+ */
31
+ color: {
32
+ type: StringConstructor;
33
+ default: string;
34
+ };
35
+ /**
36
+ * The shade of the icon-button.
37
+ */
38
+ shade: {
39
+ type: NumberConstructor;
40
+ default: number;
41
+ };
42
+ /**
43
+ * The size of the icon in tailwind-units.
44
+ */
45
+ size: {
46
+ type: NumberConstructor;
47
+ default: number;
48
+ };
49
+ /**
50
+ * The html attribute, which indicates the type of the button.
51
+ */
52
+ type: {
53
+ type: PropType<"button" | "submit" | "reset">;
54
+ default: string;
55
+ };
56
+ /**
57
+ * If set to `true` the icon-button is disabled and no interaction is possible.
58
+ */
59
+ disabled: BooleanConstructor;
60
+ /**
61
+ * This is called when the icon-button is clicked.
62
+ * It is only called when the `route` prop is not set on the icon-button.
63
+ */
64
+ onClick: PropType<() => void>;
65
+ };
66
+ /**
67
+ * The `NIconButton` is a regular button which does not have any text but an icon instead.
68
+ */
69
+ declare const _default: import("vue").DefineComponent<{
70
+ tooltipText: StringConstructor;
71
+ tooltipContent: PropType<() => void>;
72
+ tooltipHide: BooleanConstructor;
73
+ tooltipShow: BooleanConstructor;
74
+ tooltipPlacement: {
75
+ type: PropType<import("./NTooltip").TooltipPlacement>;
76
+ default: string;
77
+ };
78
+ tooltipMaxWidth: {
79
+ type: PropType<import("../utils/tailwind").TWMaxWidth>;
80
+ default: string;
81
+ };
82
+ /**
83
+ * The icon of the icon-button.
84
+ */
85
+ icon: {
86
+ type: PropType<HeroIcon>;
87
+ required: true;
88
+ };
89
+ /**
90
+ * The route of the icon-button. If this is set, the icon-button becomes a {@link RouterLink}.
91
+ */
92
+ route: PropType<RouteLocationRaw>;
93
+ /**
94
+ * The color of the icon-button.
95
+ */
96
+ color: {
97
+ type: StringConstructor;
98
+ default: string;
99
+ };
100
+ /**
101
+ * The shade of the icon-button.
102
+ */
103
+ shade: {
104
+ type: NumberConstructor;
105
+ default: number;
106
+ };
107
+ /**
108
+ * The size of the icon in tailwind-units.
109
+ */
110
+ size: {
111
+ type: NumberConstructor;
112
+ default: number;
113
+ };
114
+ /**
115
+ * The html attribute, which indicates the type of the button.
116
+ */
117
+ type: {
118
+ type: PropType<"button" | "submit" | "reset">;
119
+ default: string;
120
+ };
121
+ /**
122
+ * If set to `true` the icon-button is disabled and no interaction is possible.
123
+ */
124
+ disabled: BooleanConstructor;
125
+ /**
126
+ * This is called when the icon-button is clicked.
127
+ * It is only called when the `route` prop is not set on the icon-button.
128
+ */
129
+ onClick: PropType<() => void>;
130
+ }, 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<{
131
+ tooltipText: StringConstructor;
132
+ tooltipContent: PropType<() => void>;
133
+ tooltipHide: BooleanConstructor;
134
+ tooltipShow: BooleanConstructor;
135
+ tooltipPlacement: {
136
+ type: PropType<import("./NTooltip").TooltipPlacement>;
137
+ default: string;
138
+ };
139
+ tooltipMaxWidth: {
140
+ type: PropType<import("../utils/tailwind").TWMaxWidth>;
141
+ default: string;
142
+ };
143
+ /**
144
+ * The icon of the icon-button.
145
+ */
146
+ icon: {
147
+ type: PropType<HeroIcon>;
148
+ required: true;
149
+ };
150
+ /**
151
+ * The route of the icon-button. If this is set, the icon-button becomes a {@link RouterLink}.
152
+ */
153
+ route: PropType<RouteLocationRaw>;
154
+ /**
155
+ * The color of the icon-button.
156
+ */
157
+ color: {
158
+ type: StringConstructor;
159
+ default: string;
160
+ };
161
+ /**
162
+ * The shade of the icon-button.
163
+ */
164
+ shade: {
165
+ type: NumberConstructor;
166
+ default: number;
167
+ };
168
+ /**
169
+ * The size of the icon in tailwind-units.
170
+ */
171
+ size: {
172
+ type: NumberConstructor;
173
+ default: number;
174
+ };
175
+ /**
176
+ * The html attribute, which indicates the type of the button.
177
+ */
178
+ type: {
179
+ type: PropType<"button" | "submit" | "reset">;
180
+ default: string;
181
+ };
182
+ /**
183
+ * If set to `true` the icon-button is disabled and no interaction is possible.
184
+ */
185
+ disabled: BooleanConstructor;
186
+ /**
187
+ * This is called when the icon-button is clicked.
188
+ * It is only called when the `route` prop is not set on the icon-button.
189
+ */
190
+ onClick: PropType<() => void>;
191
+ }>> & {}, {
192
+ color: string;
193
+ type: "button" | "submit" | "reset";
194
+ shade: number;
195
+ size: number;
196
+ tooltipHide: boolean;
197
+ tooltipShow: boolean;
198
+ tooltipPlacement: import("./NTooltip").TooltipPlacement;
199
+ tooltipMaxWidth: import("../utils/tailwind").TWMaxWidth;
200
+ disabled: boolean;
201
+ }>;
202
+ export default _default;
@@ -0,0 +1,71 @@
1
+ import { createComponent, createProps } from '../utils/component';
2
+ import { RouterLink } from 'vue-router';
3
+ import { nButtonProps } from './NButton';
4
+ import NTooltip, { mapTooltipProps, nToolTipPropsForImplementor } from './NTooltip';
5
+ export const nIconButtonProps = createProps({
6
+ /**
7
+ * The icon of the icon-button.
8
+ */
9
+ icon: {
10
+ type: Function,
11
+ required: true,
12
+ },
13
+ /**
14
+ * The route of the icon-button. If this is set, the icon-button becomes a {@link RouterLink}.
15
+ */
16
+ route: [String, Object],
17
+ /**
18
+ * The color of the icon-button.
19
+ */
20
+ color: {
21
+ type: String,
22
+ default: 'default',
23
+ },
24
+ /**
25
+ * The shade of the icon-button.
26
+ */
27
+ shade: {
28
+ type: Number,
29
+ default: 500,
30
+ },
31
+ /**
32
+ * The size of the icon in tailwind-units.
33
+ */
34
+ size: {
35
+ type: Number,
36
+ default: 5,
37
+ },
38
+ /**
39
+ * The html attribute, which indicates the type of the button.
40
+ */
41
+ type: nButtonProps.type,
42
+ /**
43
+ * If set to `true` the icon-button is disabled and no interaction is possible.
44
+ */
45
+ disabled: Boolean,
46
+ /**
47
+ * This is called when the icon-button is clicked.
48
+ * It is only called when the `route` prop is not set on the icon-button.
49
+ */
50
+ onClick: Function,
51
+ ...nToolTipPropsForImplementor,
52
+ });
53
+ /**
54
+ * The `NIconButton` is a regular button which does not have any text but an icon instead.
55
+ */
56
+ export default createComponent('NIconButton', nIconButtonProps, props => {
57
+ const classes = () => [
58
+ 'block p-0.5 rounded-md focus:outline-none focus-visible:ring-2 -m-1',
59
+ props.disabled
60
+ ? `text-${props.color}-200 cursor-default`
61
+ : `hover:bg-${props.color}-${props.shade} hover:bg-opacity-10 text-${props.color}-${props.shade} focus-visible:ring-${props.color}-${props.shade} cursor-pointer`,
62
+ ];
63
+ const content = () => <props.icon class={`w-${props.size} h-${props.size}`}/>;
64
+ return () => (<NTooltip {...mapTooltipProps(props)}>
65
+ {props.route ? (<RouterLink to={props.route} class={classes()}>
66
+ {content()}
67
+ </RouterLink>) : (<button type={props.type} disabled={props.disabled} class={classes()} onClick={props.onClick}>
68
+ {content()}
69
+ </button>)}
70
+ </NTooltip>);
71
+ });
@@ -0,0 +1,135 @@
1
+ import type { HeroIcon } from '../utils/utils';
2
+ import type { PropType } from 'vue';
3
+ export declare const nIconCircleProps: {
4
+ /**
5
+ * The icon of the icon-circle.
6
+ */
7
+ icon: {
8
+ type: PropType<HeroIcon>;
9
+ required: true;
10
+ };
11
+ /**
12
+ * The color of the icon-circle.
13
+ */
14
+ color: {
15
+ type: StringConstructor;
16
+ default: string;
17
+ };
18
+ /**
19
+ * The size of the circle in "tailwind units" (4 px).
20
+ * Tailwind classes are used for the size, so any number can be passed.
21
+ * If the `iconSize` is not set, it will be adjusted automatically.
22
+ */
23
+ circleSize: NumberConstructor;
24
+ /**
25
+ * The size of the icon in "tailwind units" (4 px).
26
+ * No tailwind classes are used for the size, so any number can be passed.
27
+ * If the `circleSize` is not set, it will be adjusted automatically.
28
+ */
29
+ iconSize: NumberConstructor;
30
+ /**
31
+ * The shade of the icon.
32
+ */
33
+ iconShade: {
34
+ type: NumberConstructor;
35
+ default: number;
36
+ };
37
+ /**
38
+ * The shade of the background.
39
+ */
40
+ bgShade: {
41
+ type: NumberConstructor;
42
+ default: number;
43
+ };
44
+ };
45
+ /**
46
+ * The `NIconCircle` is an icon with a colored circle around it.
47
+ */
48
+ declare const _default: import("vue").DefineComponent<{
49
+ /**
50
+ * The icon of the icon-circle.
51
+ */
52
+ icon: {
53
+ type: PropType<HeroIcon>;
54
+ required: true;
55
+ };
56
+ /**
57
+ * The color of the icon-circle.
58
+ */
59
+ color: {
60
+ type: StringConstructor;
61
+ default: string;
62
+ };
63
+ /**
64
+ * The size of the circle in "tailwind units" (4 px).
65
+ * Tailwind classes are used for the size, so any number can be passed.
66
+ * If the `iconSize` is not set, it will be adjusted automatically.
67
+ */
68
+ circleSize: NumberConstructor;
69
+ /**
70
+ * The size of the icon in "tailwind units" (4 px).
71
+ * No tailwind classes are used for the size, so any number can be passed.
72
+ * If the `circleSize` is not set, it will be adjusted automatically.
73
+ */
74
+ iconSize: NumberConstructor;
75
+ /**
76
+ * The shade of the icon.
77
+ */
78
+ iconShade: {
79
+ type: NumberConstructor;
80
+ default: number;
81
+ };
82
+ /**
83
+ * The shade of the background.
84
+ */
85
+ bgShade: {
86
+ type: NumberConstructor;
87
+ default: number;
88
+ };
89
+ }, 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<{
90
+ /**
91
+ * The icon of the icon-circle.
92
+ */
93
+ icon: {
94
+ type: PropType<HeroIcon>;
95
+ required: true;
96
+ };
97
+ /**
98
+ * The color of the icon-circle.
99
+ */
100
+ color: {
101
+ type: StringConstructor;
102
+ default: string;
103
+ };
104
+ /**
105
+ * The size of the circle in "tailwind units" (4 px).
106
+ * Tailwind classes are used for the size, so any number can be passed.
107
+ * If the `iconSize` is not set, it will be adjusted automatically.
108
+ */
109
+ circleSize: NumberConstructor;
110
+ /**
111
+ * The size of the icon in "tailwind units" (4 px).
112
+ * No tailwind classes are used for the size, so any number can be passed.
113
+ * If the `circleSize` is not set, it will be adjusted automatically.
114
+ */
115
+ iconSize: NumberConstructor;
116
+ /**
117
+ * The shade of the icon.
118
+ */
119
+ iconShade: {
120
+ type: NumberConstructor;
121
+ default: number;
122
+ };
123
+ /**
124
+ * The shade of the background.
125
+ */
126
+ bgShade: {
127
+ type: NumberConstructor;
128
+ default: number;
129
+ };
130
+ }>> & {}, {
131
+ color: string;
132
+ iconShade: number;
133
+ bgShade: number;
134
+ }>;
135
+ export default _default;
@@ -0,0 +1,67 @@
1
+ import { createComponent, createProps } from '../utils/component';
2
+ export const nIconCircleProps = createProps({
3
+ /**
4
+ * The icon of the icon-circle.
5
+ */
6
+ icon: {
7
+ type: Function,
8
+ required: true,
9
+ },
10
+ /**
11
+ * The color of the icon-circle.
12
+ */
13
+ color: {
14
+ type: String,
15
+ default: 'primary',
16
+ },
17
+ /**
18
+ * The size of the circle in "tailwind units" (4 px).
19
+ * Tailwind classes are used for the size, so any number can be passed.
20
+ * If the `iconSize` is not set, it will be adjusted automatically.
21
+ */
22
+ circleSize: Number,
23
+ /**
24
+ * The size of the icon in "tailwind units" (4 px).
25
+ * No tailwind classes are used for the size, so any number can be passed.
26
+ * If the `circleSize` is not set, it will be adjusted automatically.
27
+ */
28
+ iconSize: Number,
29
+ /**
30
+ * The shade of the icon.
31
+ */
32
+ iconShade: {
33
+ type: Number,
34
+ default: 600,
35
+ },
36
+ /**
37
+ * The shade of the background.
38
+ */
39
+ bgShade: {
40
+ type: Number,
41
+ default: 100,
42
+ },
43
+ });
44
+ const DEFAULT_CIRCLE_SIZE = 16;
45
+ const SCALING_FACTOR = 0.55;
46
+ /**
47
+ * The `NIconCircle` is an icon with a colored circle around it.
48
+ */
49
+ export default createComponent('NIconCircle', nIconCircleProps, props => {
50
+ let circleSize = props.circleSize;
51
+ let iconSize = props.iconSize;
52
+ if (circleSize == null) {
53
+ if (iconSize == null)
54
+ circleSize = DEFAULT_CIRCLE_SIZE;
55
+ else
56
+ circleSize = iconSize / SCALING_FACTOR;
57
+ }
58
+ if (iconSize == null)
59
+ iconSize = circleSize * SCALING_FACTOR;
60
+ circleSize *= 4;
61
+ iconSize *= 4;
62
+ return () => (<div class={['flex items-center justify-center rounded-full', `bg-${props.color}-${props.bgShade}`]} style={`width: ${circleSize}px; height: ${circleSize}px`}>
63
+ <div class={`text-${props.color}-${props.iconShade}`} style={`width: ${iconSize}px; height: ${iconSize}px`}>
64
+ <props.icon />
65
+ </div>
66
+ </div>);
67
+ });
@@ -0,0 +1,11 @@
1
+ /* Chrome, Safari, Edge, Opera */
2
+ input::-webkit-outer-spin-button,
3
+ input::-webkit-inner-spin-button {
4
+ -webkit-appearance: none;
5
+ margin: 0;
6
+ }
7
+
8
+ /* Firefox */
9
+ input[type='number'] {
10
+ -moz-appearance: textfield;
11
+ }