@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,186 @@
1
+ import { type ExtractedProps } from '../utils/component';
2
+ import type { TWMaxWidth } from '../utils/tailwind';
3
+ import { type PropType } from 'vue';
4
+ import './NTooltip.css';
5
+ export declare const nTooltipProps: {
6
+ /**
7
+ * The text content of the tooltip.
8
+ */
9
+ text: StringConstructor;
10
+ /**
11
+ * A slot to replace the content of the tooltip. This will override the `text` prop.
12
+ */
13
+ content: PropType<() => void>;
14
+ /**
15
+ * If set to `true` the tooltip is shown constantly.
16
+ */
17
+ show: BooleanConstructor;
18
+ /**
19
+ * If set to `true` the tooltip is hidden constantly.
20
+ */
21
+ hide: BooleanConstructor;
22
+ /**
23
+ * If set to `true` the `block` class is applied to the tooltip.
24
+ * This should be set if the content in the default slot is also block.
25
+ */
26
+ block: BooleanConstructor;
27
+ /**
28
+ * The placement of the tooltip.
29
+ */
30
+ placement: {
31
+ type: PropType<TooltipPlacement>;
32
+ default: string;
33
+ };
34
+ /**
35
+ * The maximum width of the tooltip.
36
+ */
37
+ maxWidth: {
38
+ type: PropType<TWMaxWidth>;
39
+ default: string;
40
+ };
41
+ };
42
+ /**
43
+ * These props are made to use on a component which implements the tooltip
44
+ * and wants it to be controllable via the own props.
45
+ * e.g. `text` is now called `tooltipText`.
46
+ * They can be mapped to the normal tooltip props with {@link mapTooltipProps}
47
+ */
48
+ export declare const nToolTipPropsForImplementor: {
49
+ /**
50
+ * Adds a tooltip to the component with the specified text.
51
+ * @see {@link nTooltipProps.text}
52
+ */
53
+ tooltipText: StringConstructor;
54
+ /**
55
+ * A slot for the tooltip of this component.
56
+ * If the slot is set, the tooltip with the specified content is added to the component.
57
+ * @see {@link nTooltipProps.content}
58
+ */
59
+ tooltipContent: PropType<() => void>;
60
+ /**
61
+ * @see {@link nTooltipProps.hide}
62
+ */
63
+ tooltipHide: BooleanConstructor;
64
+ /**
65
+ * @see {@link nTooltipProps.show}
66
+ */
67
+ tooltipShow: BooleanConstructor;
68
+ /**
69
+ * @see {@link nTooltipProps.placement}
70
+ */
71
+ tooltipPlacement: {
72
+ type: PropType<TooltipPlacement>;
73
+ default: string;
74
+ };
75
+ /**
76
+ * @see {@link nTooltipProps.maxWidth}
77
+ */
78
+ tooltipMaxWidth: {
79
+ type: PropType<TWMaxWidth>;
80
+ default: string;
81
+ };
82
+ };
83
+ /**
84
+ * Maps the {@link nToolTipPropsForImplementor} props to normal tooltip props
85
+ * @returns an object containing the normal tooltip props.
86
+ */
87
+ export declare function mapTooltipProps(props: ExtractedProps<typeof nToolTipPropsForImplementor>): {
88
+ text: string | undefined;
89
+ content: (() => void) | undefined;
90
+ hide: boolean;
91
+ show: boolean;
92
+ placement: TooltipPlacement;
93
+ maxWidth: TWMaxWidth;
94
+ };
95
+ /**
96
+ * The `NTooltip` is a wrapper for any component which adds a tooltip to it.
97
+ * Any component can just be passed in the default slot and a tooltip will be added to it.
98
+ * Note that this component disappears when neither the `text` nor the `content`
99
+ * prop is passed as the tooltip would then be empty.
100
+ * If this is the case, the default slot will just be rendered inside a div.
101
+ * @example
102
+ * <NTooltip text="Hello">
103
+ * <NButton />
104
+ * </NTooltip>
105
+ */
106
+ declare const _default: import("vue").DefineComponent<{
107
+ /**
108
+ * The text content of the tooltip.
109
+ */
110
+ text: StringConstructor;
111
+ /**
112
+ * A slot to replace the content of the tooltip. This will override the `text` prop.
113
+ */
114
+ content: PropType<() => void>;
115
+ /**
116
+ * If set to `true` the tooltip is shown constantly.
117
+ */
118
+ show: BooleanConstructor;
119
+ /**
120
+ * If set to `true` the tooltip is hidden constantly.
121
+ */
122
+ hide: BooleanConstructor;
123
+ /**
124
+ * If set to `true` the `block` class is applied to the tooltip.
125
+ * This should be set if the content in the default slot is also block.
126
+ */
127
+ block: BooleanConstructor;
128
+ /**
129
+ * The placement of the tooltip.
130
+ */
131
+ placement: {
132
+ type: PropType<TooltipPlacement>;
133
+ default: string;
134
+ };
135
+ /**
136
+ * The maximum width of the tooltip.
137
+ */
138
+ maxWidth: {
139
+ type: PropType<TWMaxWidth>;
140
+ default: string;
141
+ };
142
+ }, import("vue").RenderFunction, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
143
+ /**
144
+ * The text content of the tooltip.
145
+ */
146
+ text: StringConstructor;
147
+ /**
148
+ * A slot to replace the content of the tooltip. This will override the `text` prop.
149
+ */
150
+ content: PropType<() => void>;
151
+ /**
152
+ * If set to `true` the tooltip is shown constantly.
153
+ */
154
+ show: BooleanConstructor;
155
+ /**
156
+ * If set to `true` the tooltip is hidden constantly.
157
+ */
158
+ hide: BooleanConstructor;
159
+ /**
160
+ * If set to `true` the `block` class is applied to the tooltip.
161
+ * This should be set if the content in the default slot is also block.
162
+ */
163
+ block: BooleanConstructor;
164
+ /**
165
+ * The placement of the tooltip.
166
+ */
167
+ placement: {
168
+ type: PropType<TooltipPlacement>;
169
+ default: string;
170
+ };
171
+ /**
172
+ * The maximum width of the tooltip.
173
+ */
174
+ maxWidth: {
175
+ type: PropType<TWMaxWidth>;
176
+ default: string;
177
+ };
178
+ }>> & {}, {
179
+ show: boolean;
180
+ hide: boolean;
181
+ block: boolean;
182
+ placement: TooltipPlacement;
183
+ maxWidth: TWMaxWidth;
184
+ }>;
185
+ export default _default;
186
+ export type TooltipPlacement = 'auto' | 'auto-start' | 'auto-end' | 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'right' | 'right-start' | 'right-end' | 'left' | 'left-start' | 'left-end';
@@ -0,0 +1,161 @@
1
+ import { createComponent, createProps } from '../utils/component';
2
+ import { uniqueId } from '../utils/utils';
3
+ import { computed, onMounted, ref, watch, onUnmounted, Transition } from 'vue';
4
+ import { createPopper } from '@popperjs/core';
5
+ import { watchRef } from '../utils/vue';
6
+ import './NTooltip.css';
7
+ export const nTooltipProps = createProps({
8
+ /**
9
+ * The text content of the tooltip.
10
+ */
11
+ text: String,
12
+ /**
13
+ * A slot to replace the content of the tooltip. This will override the `text` prop.
14
+ */
15
+ content: Function,
16
+ /**
17
+ * If set to `true` the tooltip is shown constantly.
18
+ */
19
+ show: Boolean,
20
+ /**
21
+ * If set to `true` the tooltip is hidden constantly.
22
+ */
23
+ hide: Boolean,
24
+ /**
25
+ * If set to `true` the `block` class is applied to the tooltip.
26
+ * This should be set if the content in the default slot is also block.
27
+ */
28
+ block: Boolean,
29
+ /**
30
+ * The placement of the tooltip.
31
+ */
32
+ placement: {
33
+ type: String,
34
+ default: 'auto',
35
+ },
36
+ /**
37
+ * The maximum width of the tooltip.
38
+ */
39
+ maxWidth: {
40
+ type: String,
41
+ default: 'max-w-xs',
42
+ },
43
+ });
44
+ /**
45
+ * These props are made to use on a component which implements the tooltip
46
+ * and wants it to be controllable via the own props.
47
+ * e.g. `text` is now called `tooltipText`.
48
+ * They can be mapped to the normal tooltip props with {@link mapTooltipProps}
49
+ */
50
+ export const nToolTipPropsForImplementor = {
51
+ /**
52
+ * Adds a tooltip to the component with the specified text.
53
+ * @see {@link nTooltipProps.text}
54
+ */
55
+ tooltipText: nTooltipProps.text,
56
+ /**
57
+ * A slot for the tooltip of this component.
58
+ * If the slot is set, the tooltip with the specified content is added to the component.
59
+ * @see {@link nTooltipProps.content}
60
+ */
61
+ tooltipContent: nTooltipProps.content,
62
+ /**
63
+ * @see {@link nTooltipProps.hide}
64
+ */
65
+ tooltipHide: nTooltipProps.hide,
66
+ /**
67
+ * @see {@link nTooltipProps.show}
68
+ */
69
+ tooltipShow: nTooltipProps.show,
70
+ /**
71
+ * @see {@link nTooltipProps.placement}
72
+ */
73
+ tooltipPlacement: nTooltipProps.placement,
74
+ /**
75
+ * @see {@link nTooltipProps.maxWidth}
76
+ */
77
+ tooltipMaxWidth: nTooltipProps.maxWidth,
78
+ };
79
+ /**
80
+ * Maps the {@link nToolTipPropsForImplementor} props to normal tooltip props
81
+ * @returns an object containing the normal tooltip props.
82
+ */
83
+ export function mapTooltipProps(props) {
84
+ return {
85
+ text: props.tooltipText,
86
+ content: props.tooltipContent,
87
+ hide: props.tooltipHide,
88
+ show: props.tooltipShow,
89
+ placement: props.tooltipPlacement,
90
+ maxWidth: props.tooltipMaxWidth,
91
+ };
92
+ }
93
+ /**
94
+ * The `NTooltip` is a wrapper for any component which adds a tooltip to it.
95
+ * Any component can just be passed in the default slot and a tooltip will be added to it.
96
+ * Note that this component disappears when neither the `text` nor the `content`
97
+ * prop is passed as the tooltip would then be empty.
98
+ * If this is the case, the default slot will just be rendered inside a div.
99
+ * @example
100
+ * <NTooltip text="Hello">
101
+ * <NButton />
102
+ * </NTooltip>
103
+ */
104
+ export default createComponent('NTooltip', nTooltipProps, (props, { slots }) => {
105
+ return () => (<div class={props.block ? 'block' : 'inline-block'}>
106
+ {props.content || props.text ? (<NTooltipBase {...props}>{slots.default?.()}</NTooltipBase>) : (slots.default?.())}
107
+ </div>);
108
+ });
109
+ const NTooltipBase = createComponent('NTooltipBase', nTooltipProps, (props, { slots }) => {
110
+ let popperInstance = null;
111
+ const contentId = `content-${uniqueId()}`;
112
+ const tooltipId = `tooltip-${uniqueId()}`;
113
+ function createTooltip() {
114
+ const content = document.getElementById(contentId);
115
+ const tooltip = document.getElementById(tooltipId);
116
+ if (content && tooltip) {
117
+ popperInstance = createPopper(content, tooltip, {
118
+ placement: props.placement,
119
+ modifiers: [
120
+ {
121
+ name: 'offset',
122
+ options: {
123
+ offset: [0, 8],
124
+ },
125
+ },
126
+ ],
127
+ });
128
+ }
129
+ else {
130
+ console.error('Could not create tooltip. HTML elements for content or tooltip were not found.');
131
+ }
132
+ }
133
+ function destroyTooltip() {
134
+ popperInstance?.destroy();
135
+ popperInstance = null;
136
+ }
137
+ onMounted(createTooltip);
138
+ onUnmounted(destroyTooltip);
139
+ watch(() => props.placement, newPlacement => popperInstance?.setOptions({ placement: newPlacement }));
140
+ const isHoveringContent = ref(false);
141
+ const isHoveringTooltip = ref(false);
142
+ const isHovering = computed(() => isHoveringContent.value || isHoveringTooltip.value);
143
+ const showTooltip = computed(() => props.show || (!props.hide && isHovering.value));
144
+ watchRef(showTooltip, () => popperInstance?.update());
145
+ return () => (<>
146
+ <div class="p-[10px] -m-[10px]" onMouseleave={() => setTimeout(() => (isHoveringContent.value = false), 10)}>
147
+ <div id={contentId} onMouseenter={() => (isHoveringContent.value = true)}>
148
+ {slots.default?.()}
149
+ </div>
150
+ </div>
151
+
152
+ <Transition enterActiveClass="transition-opacity ease-out duration-100" enterFromClass="opacity-0" enterToClass="opacity-100" leaveActiveClass="transition-opacity ease-in duration-75" leaveFromClass="opacity-100" leaveToClass="opacity-0">
153
+ <div id={tooltipId} role="tooltip" onMouseenter={() => (isHoveringTooltip.value = true)} onMouseleave={() => (isHoveringTooltip.value = false)} v-show={showTooltip.value} class={[isHovering.value ? 'z-20' : 'z-10', props.maxWidth, 'tooltip']}>
154
+ <div class="bg-white rounded-md py-2 px-4 shadow-lg border-default-200 border text-sm font-normal text-default-700">
155
+ {props.content?.() || props.text}
156
+ </div>
157
+ <div data-popper-arrow class="arrow"/>
158
+ </div>
159
+ </Transition>
160
+ </>);
161
+ });
@@ -0,0 +1,297 @@
1
+ import { type PropType } from 'vue';
2
+ import { type NInputExposed } from './NInput';
3
+ import { type ValidationRule, type ValidationResult } from '../utils/validation';
4
+ import type { ValidatedForm } from './ValidatedForm';
5
+ export declare const validationProps: {
6
+ /**
7
+ * If set to `true` this input is always valid when its value is empty.
8
+ * If set to `false` the input receives the {@link required} rule. Default is `false`.
9
+ */
10
+ optional: BooleanConstructor;
11
+ /**
12
+ * The rules which this input is checked with.
13
+ * The rules are checked sequentially and the error of the first failed rule is displayed.
14
+ * If `optional` is set to false, the rule {@link required} will be checked first.
15
+ */
16
+ rules: {
17
+ type: PropType<ValidationRule | ValidationRule[]>;
18
+ default: () => never[];
19
+ };
20
+ /**
21
+ * The form, which this input will be added to.
22
+ * On initialization, this input will call {@link ValidatedForm.addInput} passing itself to the form.
23
+ */
24
+ form: PropType<ValidatedForm>;
25
+ /**
26
+ * Overrides the internal error state. If set to true, it will always display an error.
27
+ */
28
+ error: BooleanConstructor;
29
+ /**
30
+ * Overrides the internal error message. If set, this message is always displayed.
31
+ */
32
+ errorMessage: StringConstructor;
33
+ /**
34
+ * If set to `true` the error message is not shown.
35
+ * However, the input is still marked red if it is in an error state.
36
+ */
37
+ hideErrorMessage: BooleanConstructor;
38
+ /**
39
+ * Disables the validation on blur. Should only be used in special occasions.
40
+ */
41
+ disableBlurValidation: BooleanConstructor;
42
+ };
43
+ export declare const nValInputProps: {
44
+ /**
45
+ * A slot to replace the input.
46
+ */
47
+ input: PropType<(props: InputSlotProps) => JSX.Element>;
48
+ /**
49
+ * If set to `true` this input is always valid when its value is empty.
50
+ * If set to `false` the input receives the {@link required} rule. Default is `false`.
51
+ */
52
+ optional: BooleanConstructor;
53
+ /**
54
+ * The rules which this input is checked with.
55
+ * The rules are checked sequentially and the error of the first failed rule is displayed.
56
+ * If `optional` is set to false, the rule {@link required} will be checked first.
57
+ */
58
+ rules: {
59
+ type: PropType<ValidationRule | ValidationRule[]>;
60
+ default: () => never[];
61
+ };
62
+ /**
63
+ * The form, which this input will be added to.
64
+ * On initialization, this input will call {@link ValidatedForm.addInput} passing itself to the form.
65
+ */
66
+ form: PropType<ValidatedForm>;
67
+ /**
68
+ * Overrides the internal error state. If set to true, it will always display an error.
69
+ */
70
+ error: BooleanConstructor;
71
+ /**
72
+ * Overrides the internal error message. If set, this message is always displayed.
73
+ */
74
+ errorMessage: StringConstructor;
75
+ /**
76
+ * If set to `true` the error message is not shown.
77
+ * However, the input is still marked red if it is in an error state.
78
+ */
79
+ hideErrorMessage: BooleanConstructor;
80
+ /**
81
+ * Disables the validation on blur. Should only be used in special occasions.
82
+ */
83
+ disableBlurValidation: BooleanConstructor;
84
+ tooltipText: StringConstructor;
85
+ tooltipContent: PropType<() => void>;
86
+ tooltipHide: BooleanConstructor;
87
+ tooltipShow: BooleanConstructor;
88
+ tooltipPlacement: {
89
+ type: PropType<import("./NTooltip").TooltipPlacement>;
90
+ default: string;
91
+ };
92
+ tooltipMaxWidth: {
93
+ type: PropType<import("../utils/tailwind").TWMaxWidth>;
94
+ default: string;
95
+ };
96
+ name: StringConstructor;
97
+ placeholder: StringConstructor;
98
+ autocomplete: {
99
+ type: StringConstructor;
100
+ default: string;
101
+ };
102
+ type: {
103
+ type: StringConstructor;
104
+ default: string;
105
+ };
106
+ max: StringConstructor;
107
+ min: StringConstructor;
108
+ disabled: BooleanConstructor;
109
+ small: BooleanConstructor;
110
+ hideLabel: BooleanConstructor;
111
+ onFocus: PropType<() => void>;
112
+ onBlur: PropType<() => void>;
113
+ value: PropType<string>;
114
+ onUpdateValue: PropType<(newValue: string) => void>;
115
+ };
116
+ export type InputSlotProps = {
117
+ onBlur(): void;
118
+ onUpdateValue(newValue: string): void;
119
+ error: boolean;
120
+ };
121
+ /**
122
+ * The exposed functions of NValInput
123
+ */
124
+ export type NValInputExposed = {
125
+ /**
126
+ * Validates the input and returns the validation result
127
+ */
128
+ validate: () => ValidationResult;
129
+ /**
130
+ * Resets the validation state of the input.
131
+ */
132
+ reset: () => void;
133
+ } & NInputExposed;
134
+ /**
135
+ * The `NValInput` is a `NInput` with custom validation.
136
+ */
137
+ declare const _default: import("vue").DefineComponent<{
138
+ /**
139
+ * A slot to replace the input.
140
+ */
141
+ input: PropType<(props: InputSlotProps) => JSX.Element>;
142
+ /**
143
+ * If set to `true` this input is always valid when its value is empty.
144
+ * If set to `false` the input receives the {@link required} rule. Default is `false`.
145
+ */
146
+ optional: BooleanConstructor;
147
+ /**
148
+ * The rules which this input is checked with.
149
+ * The rules are checked sequentially and the error of the first failed rule is displayed.
150
+ * If `optional` is set to false, the rule {@link required} will be checked first.
151
+ */
152
+ rules: {
153
+ type: PropType<ValidationRule | ValidationRule[]>;
154
+ default: () => never[];
155
+ };
156
+ /**
157
+ * The form, which this input will be added to.
158
+ * On initialization, this input will call {@link ValidatedForm.addInput} passing itself to the form.
159
+ */
160
+ form: PropType<ValidatedForm>;
161
+ /**
162
+ * Overrides the internal error state. If set to true, it will always display an error.
163
+ */
164
+ error: BooleanConstructor;
165
+ /**
166
+ * Overrides the internal error message. If set, this message is always displayed.
167
+ */
168
+ errorMessage: StringConstructor;
169
+ /**
170
+ * If set to `true` the error message is not shown.
171
+ * However, the input is still marked red if it is in an error state.
172
+ */
173
+ hideErrorMessage: BooleanConstructor;
174
+ /**
175
+ * Disables the validation on blur. Should only be used in special occasions.
176
+ */
177
+ disableBlurValidation: BooleanConstructor;
178
+ tooltipText: StringConstructor;
179
+ tooltipContent: PropType<() => void>;
180
+ tooltipHide: BooleanConstructor;
181
+ tooltipShow: BooleanConstructor;
182
+ tooltipPlacement: {
183
+ type: PropType<import("./NTooltip").TooltipPlacement>;
184
+ default: string;
185
+ };
186
+ tooltipMaxWidth: {
187
+ type: PropType<import("../utils/tailwind").TWMaxWidth>;
188
+ default: string;
189
+ };
190
+ name: StringConstructor;
191
+ placeholder: StringConstructor;
192
+ autocomplete: {
193
+ type: StringConstructor;
194
+ default: string;
195
+ };
196
+ type: {
197
+ type: StringConstructor;
198
+ default: string;
199
+ };
200
+ max: StringConstructor;
201
+ min: StringConstructor;
202
+ disabled: BooleanConstructor;
203
+ small: BooleanConstructor;
204
+ hideLabel: BooleanConstructor;
205
+ onFocus: PropType<() => void>;
206
+ onBlur: PropType<() => void>;
207
+ value: PropType<string>;
208
+ onUpdateValue: PropType<(newValue: string) => void>;
209
+ }, import("vue").RenderFunction, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
210
+ /**
211
+ * A slot to replace the input.
212
+ */
213
+ input: PropType<(props: InputSlotProps) => JSX.Element>;
214
+ /**
215
+ * If set to `true` this input is always valid when its value is empty.
216
+ * If set to `false` the input receives the {@link required} rule. Default is `false`.
217
+ */
218
+ optional: BooleanConstructor;
219
+ /**
220
+ * The rules which this input is checked with.
221
+ * The rules are checked sequentially and the error of the first failed rule is displayed.
222
+ * If `optional` is set to false, the rule {@link required} will be checked first.
223
+ */
224
+ rules: {
225
+ type: PropType<ValidationRule | ValidationRule[]>;
226
+ default: () => never[];
227
+ };
228
+ /**
229
+ * The form, which this input will be added to.
230
+ * On initialization, this input will call {@link ValidatedForm.addInput} passing itself to the form.
231
+ */
232
+ form: PropType<ValidatedForm>;
233
+ /**
234
+ * Overrides the internal error state. If set to true, it will always display an error.
235
+ */
236
+ error: BooleanConstructor;
237
+ /**
238
+ * Overrides the internal error message. If set, this message is always displayed.
239
+ */
240
+ errorMessage: StringConstructor;
241
+ /**
242
+ * If set to `true` the error message is not shown.
243
+ * However, the input is still marked red if it is in an error state.
244
+ */
245
+ hideErrorMessage: BooleanConstructor;
246
+ /**
247
+ * Disables the validation on blur. Should only be used in special occasions.
248
+ */
249
+ disableBlurValidation: BooleanConstructor;
250
+ tooltipText: StringConstructor;
251
+ tooltipContent: PropType<() => void>;
252
+ tooltipHide: BooleanConstructor;
253
+ tooltipShow: BooleanConstructor;
254
+ tooltipPlacement: {
255
+ type: PropType<import("./NTooltip").TooltipPlacement>;
256
+ default: string;
257
+ };
258
+ tooltipMaxWidth: {
259
+ type: PropType<import("../utils/tailwind").TWMaxWidth>;
260
+ default: string;
261
+ };
262
+ name: StringConstructor;
263
+ placeholder: StringConstructor;
264
+ autocomplete: {
265
+ type: StringConstructor;
266
+ default: string;
267
+ };
268
+ type: {
269
+ type: StringConstructor;
270
+ default: string;
271
+ };
272
+ max: StringConstructor;
273
+ min: StringConstructor;
274
+ disabled: BooleanConstructor;
275
+ small: BooleanConstructor;
276
+ hideLabel: BooleanConstructor;
277
+ onFocus: PropType<() => void>;
278
+ onBlur: PropType<() => void>;
279
+ value: PropType<string>;
280
+ onUpdateValue: PropType<(newValue: string) => void>;
281
+ }>> & {}, {
282
+ small: boolean;
283
+ type: string;
284
+ tooltipHide: boolean;
285
+ tooltipShow: boolean;
286
+ tooltipPlacement: import("./NTooltip").TooltipPlacement;
287
+ tooltipMaxWidth: import("../utils/tailwind").TWMaxWidth;
288
+ disabled: boolean;
289
+ error: boolean;
290
+ rules: ValidationRule | ValidationRule[];
291
+ autocomplete: string;
292
+ hideLabel: boolean;
293
+ optional: boolean;
294
+ hideErrorMessage: boolean;
295
+ disableBlurValidation: boolean;
296
+ }>;
297
+ export default _default;