@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,149 @@
1
+ import { type PropType } from 'vue';
2
+ export declare const nButtonProps: {
3
+ tooltipText: StringConstructor;
4
+ tooltipContent: PropType<() => void>;
5
+ tooltipHide: BooleanConstructor;
6
+ tooltipShow: BooleanConstructor;
7
+ tooltipPlacement: {
8
+ type: PropType<import("./NTooltip").TooltipPlacement>;
9
+ default: string;
10
+ };
11
+ tooltipMaxWidth: {
12
+ type: PropType<import("../utils/tailwind").TWMaxWidth>;
13
+ default: string;
14
+ };
15
+ /**
16
+ * The color of the button.
17
+ */
18
+ color: {
19
+ type: StringConstructor;
20
+ default: string;
21
+ };
22
+ /**
23
+ * The html attribute, which indicates the type of the button.
24
+ */
25
+ type: {
26
+ type: PropType<"button" | "submit" | "reset">;
27
+ default: string;
28
+ };
29
+ /**
30
+ * If set to `true` the button is disabled and no interaction is possible.
31
+ */
32
+ disabled: BooleanConstructor;
33
+ /**
34
+ * If set to `true` the button will show a loading animation.
35
+ * Setting `loading` to `true` will also disable the button.
36
+ */
37
+ loading: BooleanConstructor;
38
+ /**
39
+ * If set to `true` the button will appear smaller.
40
+ */
41
+ small: BooleanConstructor;
42
+ /**
43
+ * This is called, when the button is clicked.
44
+ */
45
+ onClick: PropType<() => void>;
46
+ };
47
+ /**
48
+ * The `NButton` is a styled button.
49
+ */
50
+ declare const _default: import("vue").DefineComponent<{
51
+ tooltipText: StringConstructor;
52
+ tooltipContent: PropType<() => void>;
53
+ tooltipHide: BooleanConstructor;
54
+ tooltipShow: BooleanConstructor;
55
+ tooltipPlacement: {
56
+ type: PropType<import("./NTooltip").TooltipPlacement>;
57
+ default: string;
58
+ };
59
+ tooltipMaxWidth: {
60
+ type: PropType<import("../utils/tailwind").TWMaxWidth>;
61
+ default: string;
62
+ };
63
+ /**
64
+ * The color of the button.
65
+ */
66
+ color: {
67
+ type: StringConstructor;
68
+ default: string;
69
+ };
70
+ /**
71
+ * The html attribute, which indicates the type of the button.
72
+ */
73
+ type: {
74
+ type: PropType<"button" | "submit" | "reset">;
75
+ default: string;
76
+ };
77
+ /**
78
+ * If set to `true` the button is disabled and no interaction is possible.
79
+ */
80
+ disabled: BooleanConstructor;
81
+ /**
82
+ * If set to `true` the button will show a loading animation.
83
+ * Setting `loading` to `true` will also disable the button.
84
+ */
85
+ loading: BooleanConstructor;
86
+ /**
87
+ * If set to `true` the button will appear smaller.
88
+ */
89
+ small: BooleanConstructor;
90
+ /**
91
+ * This is called, when the button is clicked.
92
+ */
93
+ onClick: PropType<() => void>;
94
+ }, 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<{
95
+ tooltipText: StringConstructor;
96
+ tooltipContent: PropType<() => void>;
97
+ tooltipHide: BooleanConstructor;
98
+ tooltipShow: BooleanConstructor;
99
+ tooltipPlacement: {
100
+ type: PropType<import("./NTooltip").TooltipPlacement>;
101
+ default: string;
102
+ };
103
+ tooltipMaxWidth: {
104
+ type: PropType<import("../utils/tailwind").TWMaxWidth>;
105
+ default: string;
106
+ };
107
+ /**
108
+ * The color of the button.
109
+ */
110
+ color: {
111
+ type: StringConstructor;
112
+ default: string;
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 button is disabled and no interaction is possible.
123
+ */
124
+ disabled: BooleanConstructor;
125
+ /**
126
+ * If set to `true` the button will show a loading animation.
127
+ * Setting `loading` to `true` will also disable the button.
128
+ */
129
+ loading: BooleanConstructor;
130
+ /**
131
+ * If set to `true` the button will appear smaller.
132
+ */
133
+ small: BooleanConstructor;
134
+ /**
135
+ * This is called, when the button is clicked.
136
+ */
137
+ onClick: PropType<() => void>;
138
+ }>> & {}, {
139
+ small: boolean;
140
+ color: string;
141
+ type: "button" | "submit" | "reset";
142
+ tooltipHide: boolean;
143
+ tooltipShow: boolean;
144
+ tooltipPlacement: import("./NTooltip").TooltipPlacement;
145
+ tooltipMaxWidth: import("../utils/tailwind").TWMaxWidth;
146
+ disabled: boolean;
147
+ loading: boolean;
148
+ }>;
149
+ export default _default;
@@ -0,0 +1,58 @@
1
+ import { createComponent, createProps } from '../utils/component';
2
+ import { computed } from 'vue';
3
+ import NLoadingIndicator from './NLoadingIndicator';
4
+ import NTooltip, { mapTooltipProps, nToolTipPropsForImplementor } from './NTooltip';
5
+ export const nButtonProps = createProps({
6
+ /**
7
+ * The color of the button.
8
+ */
9
+ color: {
10
+ type: String,
11
+ default: 'primary',
12
+ },
13
+ /**
14
+ * The html attribute, which indicates the type of the button.
15
+ */
16
+ type: {
17
+ type: String,
18
+ default: 'button',
19
+ },
20
+ /**
21
+ * If set to `true` the button is disabled and no interaction is possible.
22
+ */
23
+ disabled: Boolean,
24
+ /**
25
+ * If set to `true` the button will show a loading animation.
26
+ * Setting `loading` to `true` will also disable the button.
27
+ */
28
+ loading: Boolean,
29
+ /**
30
+ * If set to `true` the button will appear smaller.
31
+ */
32
+ small: Boolean,
33
+ /**
34
+ * This is called, when the button is clicked.
35
+ */
36
+ onClick: Function,
37
+ ...nToolTipPropsForImplementor,
38
+ });
39
+ /**
40
+ * The `NButton` is a styled button.
41
+ */
42
+ export default createComponent('NButton', nButtonProps, (props, { slots }) => {
43
+ const isDisabled = computed(() => props.loading || props.disabled);
44
+ return () => (<NTooltip {...mapTooltipProps(props)}>
45
+ <button disabled={isDisabled.value} type={props.type} class={[
46
+ `block w-full font-medium rounded-md focus:outline-none focus-visible:ring-2 shadow text-${props.color}-900 relative`,
47
+ isDisabled.value
48
+ ? `bg-${props.color}-100 text-opacity-20 cursor-default`
49
+ : `bg-${props.color}-200 hover:bg-${props.color}-300 focus-visible:ring-${props.color}-500`,
50
+ props.small ? 'py-1 px-2 text-xs' : 'py-2 px-4 text-sm',
51
+ ]} onClick={props.onClick}>
52
+ <span class={{ 'opacity-10': props.loading }}>{slots.default?.()}</span>
53
+ {props.loading && (<div class="absolute inset-0 flex items-center justify-center opacity-50">
54
+ <NLoadingIndicator color={props.color} size={props.small ? 4 : 6} shade={600}/>
55
+ </div>)}
56
+ </button>
57
+ </NTooltip>);
58
+ });
@@ -0,0 +1,51 @@
1
+ export declare const nCheckboxProps: {
2
+ /**
3
+ * The color of the checkbox.
4
+ */
5
+ color: {
6
+ type: StringConstructor;
7
+ default: string;
8
+ };
9
+ /**
10
+ * If set to `true` the checkbox is disabled and no interaction is possible.
11
+ */
12
+ disabled: BooleanConstructor;
13
+ value: import("vue").PropType<boolean>;
14
+ onUpdateValue: import("vue").PropType<(newValue: boolean) => void>;
15
+ };
16
+ /**
17
+ * The `NCheckbox` is a styled checkbox.
18
+ */
19
+ declare const _default: import("vue").DefineComponent<{
20
+ /**
21
+ * The color of the checkbox.
22
+ */
23
+ color: {
24
+ type: StringConstructor;
25
+ default: string;
26
+ };
27
+ /**
28
+ * If set to `true` the checkbox is disabled and no interaction is possible.
29
+ */
30
+ disabled: BooleanConstructor;
31
+ value: import("vue").PropType<boolean>;
32
+ onUpdateValue: import("vue").PropType<(newValue: boolean) => void>;
33
+ }, 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<{
34
+ /**
35
+ * The color of the checkbox.
36
+ */
37
+ color: {
38
+ type: StringConstructor;
39
+ default: string;
40
+ };
41
+ /**
42
+ * If set to `true` the checkbox is disabled and no interaction is possible.
43
+ */
44
+ disabled: BooleanConstructor;
45
+ value: import("vue").PropType<boolean>;
46
+ onUpdateValue: import("vue").PropType<(newValue: boolean) => void>;
47
+ }>> & {}, {
48
+ color: string;
49
+ disabled: boolean;
50
+ }>;
51
+ export default _default;
@@ -0,0 +1,38 @@
1
+ import { createComponent, createProps } from '../utils/component';
2
+ import { vModelProps } from '../utils/vModel';
3
+ import { nextTick, ref } from 'vue';
4
+ export const nCheckboxProps = createProps({
5
+ ...vModelProps(Boolean),
6
+ /**
7
+ * The color of the checkbox.
8
+ */
9
+ color: {
10
+ type: String,
11
+ default: 'primary',
12
+ },
13
+ /**
14
+ * If set to `true` the checkbox is disabled and no interaction is possible.
15
+ */
16
+ disabled: Boolean,
17
+ });
18
+ /**
19
+ * The `NCheckbox` is a styled checkbox.
20
+ */
21
+ export default createComponent('NCheckbox', nCheckboxProps, props => {
22
+ const toggle = () => {
23
+ props.onUpdateValue?.(!props.value);
24
+ forceUpdate();
25
+ };
26
+ const checkBoxRef = ref();
27
+ const updateKey = ref(0);
28
+ const forceUpdate = () => {
29
+ updateKey.value += 1;
30
+ nextTick(() => checkBoxRef.value?.focus());
31
+ };
32
+ return () => (<input type="checkbox" ref={checkBoxRef} checked={props.value} disabled={props.disabled} onClick={toggle} key={updateKey.value} class={[
33
+ `h-5 w-5 border-default-300 rounded focus:outline-none focus:ring-0 focus-visible:ring-2 focus-visible:ring-${props.color}-500`,
34
+ props.disabled
35
+ ? `cursor-default bg-default-100 text-${props.color}-200`
36
+ : `cursor-pointer text-${props.color}-400`,
37
+ ]}/>);
38
+ });
@@ -0,0 +1,70 @@
1
+ export declare const nCheckboxLabelProps: {
2
+ /**
3
+ * The title of the checkbox.
4
+ */
5
+ title: StringConstructor;
6
+ /**
7
+ * The description of the checkbox.
8
+ */
9
+ description: StringConstructor;
10
+ /**
11
+ * If set to `true`, a smaller margin is applied between the label and the checkbox.
12
+ */
13
+ compact: BooleanConstructor;
14
+ color: {
15
+ type: StringConstructor;
16
+ default: string;
17
+ };
18
+ disabled: BooleanConstructor;
19
+ value: import("vue").PropType<boolean>;
20
+ onUpdateValue: import("vue").PropType<(newValue: boolean) => void>;
21
+ };
22
+ /**
23
+ * The `NCheckboxLabel` is a checkbox with a title and a description.
24
+ */
25
+ declare const _default: import("vue").DefineComponent<{
26
+ /**
27
+ * The title of the checkbox.
28
+ */
29
+ title: StringConstructor;
30
+ /**
31
+ * The description of the checkbox.
32
+ */
33
+ description: StringConstructor;
34
+ /**
35
+ * If set to `true`, a smaller margin is applied between the label and the checkbox.
36
+ */
37
+ compact: BooleanConstructor;
38
+ color: {
39
+ type: StringConstructor;
40
+ default: string;
41
+ };
42
+ disabled: BooleanConstructor;
43
+ value: import("vue").PropType<boolean>;
44
+ onUpdateValue: import("vue").PropType<(newValue: boolean) => void>;
45
+ }, 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<{
46
+ /**
47
+ * The title of the checkbox.
48
+ */
49
+ title: StringConstructor;
50
+ /**
51
+ * The description of the checkbox.
52
+ */
53
+ description: StringConstructor;
54
+ /**
55
+ * If set to `true`, a smaller margin is applied between the label and the checkbox.
56
+ */
57
+ compact: BooleanConstructor;
58
+ color: {
59
+ type: StringConstructor;
60
+ default: string;
61
+ };
62
+ disabled: BooleanConstructor;
63
+ value: import("vue").PropType<boolean>;
64
+ onUpdateValue: import("vue").PropType<(newValue: boolean) => void>;
65
+ }>> & {}, {
66
+ color: string;
67
+ disabled: boolean;
68
+ compact: boolean;
69
+ }>;
70
+ export default _default;
@@ -0,0 +1,42 @@
1
+ import { createComponent, createProps } from '../utils/component';
2
+ import NCheckbox, { nCheckboxProps } from './NCheckbox';
3
+ export const nCheckboxLabelProps = createProps({
4
+ ...nCheckboxProps,
5
+ /**
6
+ * The title of the checkbox.
7
+ */
8
+ title: String,
9
+ /**
10
+ * The description of the checkbox.
11
+ */
12
+ description: String,
13
+ /**
14
+ * If set to `true`, a smaller margin is applied between the label and the checkbox.
15
+ */
16
+ compact: Boolean,
17
+ });
18
+ /**
19
+ * The `NCheckboxLabel` is a checkbox with a title and a description.
20
+ */
21
+ export default createComponent('NCheckboxLabel', nCheckboxLabelProps, props => {
22
+ const toggleValue = () => {
23
+ if (!props.disabled)
24
+ props.onUpdateValue?.(!props.value);
25
+ };
26
+ return () => (<div class="flex items-center">
27
+ <NCheckbox {...props}/>
28
+ <div class={`${props.compact ? 'ml-2' : 'ml-3'} text-sm`}>
29
+ <label onClick={toggleValue} class={[
30
+ 'font-medium select-none',
31
+ props.disabled ? 'text-default-300' : 'text-default-700 cursor-pointer',
32
+ ]}>
33
+ {props.title}
34
+ </label>
35
+ <p class={props.disabled ? 'text-default-300' : 'text-default-500'}>
36
+ <span onClick={toggleValue} class={['select-none', props.disabled ? '' : 'cursor-pointer']}>
37
+ {props.description}
38
+ </span>
39
+ </p>
40
+ </div>
41
+ </div>);
42
+ });