@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.
- package/README.md +27 -0
- package/lib/components/NAlert.d.ts +72 -0
- package/lib/components/NAlert.jsx +69 -0
- package/lib/components/NBadge.d.ts +174 -0
- package/lib/components/NBadge.jsx +58 -0
- package/lib/components/NBreadcrub.d.ts +161 -0
- package/lib/components/NBreadcrub.jsx +64 -0
- package/lib/components/NButton.d.ts +149 -0
- package/lib/components/NButton.jsx +58 -0
- package/lib/components/NCheckbox.d.ts +51 -0
- package/lib/components/NCheckbox.jsx +38 -0
- package/lib/components/NCheckboxLabel.d.ts +70 -0
- package/lib/components/NCheckboxLabel.jsx +42 -0
- package/lib/components/NCrudModal.d.ts +301 -0
- package/lib/components/NCrudModal.jsx +89 -0
- package/lib/components/NDialog.d.ts +190 -0
- package/lib/components/NDialog.jsx +144 -0
- package/lib/components/NDropdown.d.ts +116 -0
- package/lib/components/NDropdown.jsx +92 -0
- package/lib/components/NDropzone.d.ts +162 -0
- package/lib/components/NDropzone.jsx +211 -0
- package/lib/components/NForm.d.ts +43 -0
- package/lib/components/NForm.jsx +26 -0
- package/lib/components/NFormModal.d.ts +190 -0
- package/lib/components/NFormModal.jsx +48 -0
- package/lib/components/NIconButton.d.ts +202 -0
- package/lib/components/NIconButton.jsx +71 -0
- package/lib/components/NIconCircle.d.ts +135 -0
- package/lib/components/NIconCircle.jsx +67 -0
- package/lib/components/NInput.css +11 -0
- package/lib/components/NInput.d.ts +232 -0
- package/lib/components/NInput.jsx +97 -0
- package/lib/components/NInputPhone.d.ts +150 -0
- package/lib/components/NInputPhone.jsx +31 -0
- package/lib/components/NInputSelect.d.ts +271 -0
- package/lib/components/NInputSelect.jsx +89 -0
- package/lib/components/NInputSuggestion.d.ts +212 -0
- package/lib/components/NInputSuggestion.jsx +48 -0
- package/lib/components/NLink.d.ts +111 -0
- package/lib/components/NLink.jsx +58 -0
- package/lib/components/NList.d.ts +43 -0
- package/lib/components/NList.jsx +24 -0
- package/lib/components/NLoadingIndicator.css +46 -0
- package/lib/components/NLoadingIndicator.d.ts +77 -0
- package/lib/components/NLoadingIndicator.jsx +42 -0
- package/lib/components/NModal.d.ts +333 -0
- package/lib/components/NModal.jsx +170 -0
- package/lib/components/NPagination.css +15 -0
- package/lib/components/NPagination.d.ts +99 -0
- package/lib/components/NPagination.jsx +104 -0
- package/lib/components/NSearchbar.d.ts +94 -0
- package/lib/components/NSearchbar.jsx +58 -0
- package/lib/components/NSearchbarList.d.ts +90 -0
- package/lib/components/NSearchbarList.jsx +20 -0
- package/lib/components/NSelect.d.ts +159 -0
- package/lib/components/NSelect.jsx +81 -0
- package/lib/components/NSuggestionList.d.ts +275 -0
- package/lib/components/NSuggestionList.jsx +157 -0
- package/lib/components/NTable.css +3 -0
- package/lib/components/NTable.d.ts +187 -0
- package/lib/components/NTable.jsx +146 -0
- package/lib/components/NTableAction.d.ts +74 -0
- package/lib/components/NTableAction.jsx +35 -0
- package/lib/components/NTextArea.d.ts +252 -0
- package/lib/components/NTextArea.jsx +108 -0
- package/lib/components/NTooltip.css +37 -0
- package/lib/components/NTooltip.d.ts +186 -0
- package/lib/components/NTooltip.jsx +161 -0
- package/lib/components/NValInput.d.ts +297 -0
- package/lib/components/NValInput.jsx +101 -0
- package/lib/components/ValidatedForm.d.ts +34 -0
- package/lib/components/ValidatedForm.js +25 -0
- package/lib/i18n/de/template.json +10 -0
- package/lib/i18n/de/vue-collection.json +58 -0
- package/lib/i18n/de.d.ts +61 -0
- package/lib/i18n/de.js +5 -0
- package/lib/i18n/en/template.json +10 -0
- package/lib/i18n/en/vue-collection.json +58 -0
- package/lib/i18n/en.d.ts +61 -0
- package/lib/i18n/en.js +5 -0
- package/lib/i18n/index.d.ts +17 -0
- package/lib/i18n/index.js +34 -0
- package/lib/index.d.ts +64 -0
- package/lib/index.js +65 -0
- package/lib/utils/breakpoints.d.ts +15 -0
- package/lib/utils/breakpoints.js +37 -0
- package/lib/utils/component.d.ts +50 -0
- package/lib/utils/component.js +51 -0
- package/lib/utils/deferred.d.ts +13 -0
- package/lib/utils/deferred.js +17 -0
- package/lib/utils/identifiable.d.ts +57 -0
- package/lib/utils/identifiable.js +78 -0
- package/lib/utils/stringMaxLength.d.ts +14 -0
- package/lib/utils/stringMaxLength.js +28 -0
- package/lib/utils/tailwind.d.ts +2 -0
- package/lib/utils/tailwind.js +1 -0
- package/lib/utils/utils.d.ts +27 -0
- package/lib/utils/utils.js +26 -0
- package/lib/utils/vModel.d.ts +182 -0
- package/lib/utils/vModel.js +215 -0
- package/lib/utils/validation.d.ts +84 -0
- package/lib/utils/validation.js +163 -0
- package/lib/utils/vue.d.ts +13 -0
- package/lib/utils/vue.js +19 -0
- package/package.json +56 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { deferred } from '../utils/deferred';
|
|
2
|
+
import { createComponent, createProps, extractProps } from '../utils/component';
|
|
3
|
+
import { CheckIcon, ExclamationTriangleIcon, LightBulbIcon, TrashIcon } from '@heroicons/vue/24/outline';
|
|
4
|
+
import { computed, ref } from 'vue';
|
|
5
|
+
import NIconCircle from './NIconCircle';
|
|
6
|
+
import NModal from './NModal';
|
|
7
|
+
import { DialogTitle } from '@headlessui/vue';
|
|
8
|
+
import { trsl } from '../i18n';
|
|
9
|
+
import { vModelForRef } from '../utils/vModel';
|
|
10
|
+
export const nDialogProps = createProps({
|
|
11
|
+
/**
|
|
12
|
+
* The title of the dialog.
|
|
13
|
+
*/
|
|
14
|
+
title: String,
|
|
15
|
+
/**
|
|
16
|
+
* The text of the dialog.
|
|
17
|
+
*/
|
|
18
|
+
text: String,
|
|
19
|
+
/**
|
|
20
|
+
* The variant of the dialog.
|
|
21
|
+
* This determines the default icon and its color
|
|
22
|
+
* as well as the default text and color of the ok-button.
|
|
23
|
+
*/
|
|
24
|
+
variant: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: 'warning',
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* The icon of the alert. This overrides the `icon` of the `variant`.
|
|
30
|
+
*/
|
|
31
|
+
icon: Function,
|
|
32
|
+
/**
|
|
33
|
+
* The color of the alert's icon. This overrides the `iconColor` of the `variant`.
|
|
34
|
+
*/
|
|
35
|
+
iconColor: String,
|
|
36
|
+
/**
|
|
37
|
+
* The text of the ok-button. This overrides the `okText` of the `variant`.
|
|
38
|
+
*/
|
|
39
|
+
okText: String,
|
|
40
|
+
/**
|
|
41
|
+
* The color of the ok-button. This overrides the `okColor` of the `variant`.
|
|
42
|
+
*/
|
|
43
|
+
okColor: String,
|
|
44
|
+
/**
|
|
45
|
+
* The text of the cancel-button.
|
|
46
|
+
*/
|
|
47
|
+
cancelText: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: trsl('vue-collection.action.cancel'),
|
|
50
|
+
},
|
|
51
|
+
/**
|
|
52
|
+
* The color of the cancel-button.
|
|
53
|
+
*/
|
|
54
|
+
cancelColor: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: 'default',
|
|
57
|
+
},
|
|
58
|
+
/**
|
|
59
|
+
* If set to `true` the cancel-button is hidden.
|
|
60
|
+
*/
|
|
61
|
+
hideCancel: Boolean,
|
|
62
|
+
});
|
|
63
|
+
/**
|
|
64
|
+
* A `NDialog` is an element to interact directly with the user.
|
|
65
|
+
* It can be controlled via a ref to prompt the user and to receive their answer.
|
|
66
|
+
* @example
|
|
67
|
+
* const dialogRef = ref<NDialogExposed>()
|
|
68
|
+
* ...
|
|
69
|
+
* const onShowDialog = () => {
|
|
70
|
+
* dialofRef.value?.show().then(result => {
|
|
71
|
+
* if (result) // dialog accepted
|
|
72
|
+
* else // dialog cancelled
|
|
73
|
+
* })
|
|
74
|
+
* }
|
|
75
|
+
* ...
|
|
76
|
+
* <NDialog ref={dialogRef} />
|
|
77
|
+
*/
|
|
78
|
+
export default createComponent('NDialog', nDialogProps, (props, context) => {
|
|
79
|
+
const showDialog = ref(false);
|
|
80
|
+
let deferredPromise = null;
|
|
81
|
+
const show = () => {
|
|
82
|
+
if (deferredPromise != null) {
|
|
83
|
+
deferredPromise.reject('show() was called on the open dialog.');
|
|
84
|
+
deferredPromise = null;
|
|
85
|
+
}
|
|
86
|
+
showDialog.value = true;
|
|
87
|
+
deferredPromise = deferred();
|
|
88
|
+
return deferredPromise.promise;
|
|
89
|
+
};
|
|
90
|
+
context.expose({ show });
|
|
91
|
+
const resolveWith = (result) => {
|
|
92
|
+
deferredPromise?.resolve(result);
|
|
93
|
+
deferredPromise = null;
|
|
94
|
+
};
|
|
95
|
+
const ok = () => resolveWith(true);
|
|
96
|
+
const cancel = () => resolveWith(false);
|
|
97
|
+
const defaults = computed(() => VARIANT_DEFAULTS[props.variant]);
|
|
98
|
+
return () => (<NModal {...vModelForRef(showDialog)} {...extractProps(props, 'cancelColor', 'cancelText', 'hideCancel')} onOk={ok} onCancel={cancel} okColor={props.okColor || defaults.value.okColor} okText={props.okText || defaults.value.okText} hideX hideHeader>
|
|
99
|
+
<div class="flex space-x-4 py-2">
|
|
100
|
+
<div class="flex-grow-0">
|
|
101
|
+
<NIconCircle icon={props.icon || defaults.value.icon} iconSize={6} color={props.iconColor || defaults.value.iconColor}/>
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<div class="flex-grow">
|
|
105
|
+
<DialogTitle as="h4" class="font-medium text-lg text-default-700 mb-1">
|
|
106
|
+
{props.title}
|
|
107
|
+
</DialogTitle>
|
|
108
|
+
{context.slots.default?.() || <p class="text-sm text-default-500">{props.text}</p>}
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</NModal>);
|
|
112
|
+
});
|
|
113
|
+
const VARIANT_DEFAULTS = {
|
|
114
|
+
success: {
|
|
115
|
+
icon: CheckIcon,
|
|
116
|
+
iconColor: 'green',
|
|
117
|
+
okText: trsl('vue-collection.action.all-right'),
|
|
118
|
+
okColor: 'green',
|
|
119
|
+
},
|
|
120
|
+
info: {
|
|
121
|
+
icon: LightBulbIcon,
|
|
122
|
+
iconColor: 'blue',
|
|
123
|
+
okText: trsl('vue-collection.action.all-right'),
|
|
124
|
+
okColor: 'blue',
|
|
125
|
+
},
|
|
126
|
+
warning: {
|
|
127
|
+
icon: ExclamationTriangleIcon,
|
|
128
|
+
iconColor: 'yellow',
|
|
129
|
+
okText: trsl('vue-collection.action.proceed'),
|
|
130
|
+
okColor: 'yellow',
|
|
131
|
+
},
|
|
132
|
+
danger: {
|
|
133
|
+
icon: ExclamationTriangleIcon,
|
|
134
|
+
iconColor: 'red',
|
|
135
|
+
okText: trsl('vue-collection.action.proceed'),
|
|
136
|
+
okColor: 'red',
|
|
137
|
+
},
|
|
138
|
+
remove: {
|
|
139
|
+
icon: TrashIcon,
|
|
140
|
+
iconColor: 'red',
|
|
141
|
+
okText: trsl('vue-collection.action.remove'),
|
|
142
|
+
okColor: 'red',
|
|
143
|
+
},
|
|
144
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import { type RouteLocationRaw } from 'vue-router';
|
|
3
|
+
import type { HeroIcon } from '../utils/utils';
|
|
4
|
+
export declare const nDropdownProps: {
|
|
5
|
+
/**
|
|
6
|
+
* The title of the dropdown-button.
|
|
7
|
+
*/
|
|
8
|
+
title: StringConstructor;
|
|
9
|
+
/**
|
|
10
|
+
* The items of the dropdown.
|
|
11
|
+
* The second dimension of the array is used
|
|
12
|
+
* to create groups of items, which are visually seperated.
|
|
13
|
+
*/
|
|
14
|
+
items: {
|
|
15
|
+
type: PropType<DropdownItem[] | DropdownItem[][]>;
|
|
16
|
+
default: () => never[];
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* If set to `true` the panel is right-aligned to the button.
|
|
20
|
+
*/
|
|
21
|
+
right: BooleanConstructor;
|
|
22
|
+
/**
|
|
23
|
+
* If set to `true` the dropdown-button is disabled and no interaction is possible.
|
|
24
|
+
*/
|
|
25
|
+
disabled: BooleanConstructor;
|
|
26
|
+
/**
|
|
27
|
+
* A slot to replace the button of the dropdown.
|
|
28
|
+
*/
|
|
29
|
+
button: PropType<() => JSX.Element>;
|
|
30
|
+
};
|
|
31
|
+
export type DropdownItem = {
|
|
32
|
+
/**
|
|
33
|
+
* The label of the dropdown-item.
|
|
34
|
+
*/
|
|
35
|
+
label: string;
|
|
36
|
+
/**
|
|
37
|
+
* The icon of the dropdown-item. Is displayed to the left of the text.
|
|
38
|
+
*/
|
|
39
|
+
icon?: HeroIcon;
|
|
40
|
+
/**
|
|
41
|
+
* The route of the dropdown-item. If this is set, the dropdown-item is a {@link RouterLink}.
|
|
42
|
+
*/
|
|
43
|
+
route?: RouteLocationRaw;
|
|
44
|
+
/**
|
|
45
|
+
* If set to `true` the dropdown-item is disabled and no interaction is possible.
|
|
46
|
+
* The other dropdown-items can still be clicked.
|
|
47
|
+
*/
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* This is called when the dropdown-item is clicked.
|
|
51
|
+
* It is only called when the `route` option is not set on the item.
|
|
52
|
+
*/
|
|
53
|
+
onClick?: () => void;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* The `NDropdown` consists of a button and a panel with multiple actions.
|
|
57
|
+
* It is useful to group multiple actions together in one place.
|
|
58
|
+
*/
|
|
59
|
+
declare const _default: import("vue").DefineComponent<{
|
|
60
|
+
/**
|
|
61
|
+
* The title of the dropdown-button.
|
|
62
|
+
*/
|
|
63
|
+
title: StringConstructor;
|
|
64
|
+
/**
|
|
65
|
+
* The items of the dropdown.
|
|
66
|
+
* The second dimension of the array is used
|
|
67
|
+
* to create groups of items, which are visually seperated.
|
|
68
|
+
*/
|
|
69
|
+
items: {
|
|
70
|
+
type: PropType<DropdownItem[] | DropdownItem[][]>;
|
|
71
|
+
default: () => never[];
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* If set to `true` the panel is right-aligned to the button.
|
|
75
|
+
*/
|
|
76
|
+
right: BooleanConstructor;
|
|
77
|
+
/**
|
|
78
|
+
* If set to `true` the dropdown-button is disabled and no interaction is possible.
|
|
79
|
+
*/
|
|
80
|
+
disabled: BooleanConstructor;
|
|
81
|
+
/**
|
|
82
|
+
* A slot to replace the button of the dropdown.
|
|
83
|
+
*/
|
|
84
|
+
button: PropType<() => JSX.Element>;
|
|
85
|
+
}, 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<{
|
|
86
|
+
/**
|
|
87
|
+
* The title of the dropdown-button.
|
|
88
|
+
*/
|
|
89
|
+
title: StringConstructor;
|
|
90
|
+
/**
|
|
91
|
+
* The items of the dropdown.
|
|
92
|
+
* The second dimension of the array is used
|
|
93
|
+
* to create groups of items, which are visually seperated.
|
|
94
|
+
*/
|
|
95
|
+
items: {
|
|
96
|
+
type: PropType<DropdownItem[] | DropdownItem[][]>;
|
|
97
|
+
default: () => never[];
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* If set to `true` the panel is right-aligned to the button.
|
|
101
|
+
*/
|
|
102
|
+
right: BooleanConstructor;
|
|
103
|
+
/**
|
|
104
|
+
* If set to `true` the dropdown-button is disabled and no interaction is possible.
|
|
105
|
+
*/
|
|
106
|
+
disabled: BooleanConstructor;
|
|
107
|
+
/**
|
|
108
|
+
* A slot to replace the button of the dropdown.
|
|
109
|
+
*/
|
|
110
|
+
button: PropType<() => JSX.Element>;
|
|
111
|
+
}>> & {}, {
|
|
112
|
+
right: boolean;
|
|
113
|
+
disabled: boolean;
|
|
114
|
+
items: DropdownItem[] | DropdownItem[][];
|
|
115
|
+
}>;
|
|
116
|
+
export default _default;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { createComponent, createProps } from '../utils/component';
|
|
2
|
+
import { computed, Transition } from 'vue';
|
|
3
|
+
import { RouterLink } from 'vue-router';
|
|
4
|
+
import { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/vue';
|
|
5
|
+
import { ChevronDownIcon } from '@heroicons/vue/24/solid';
|
|
6
|
+
export const nDropdownProps = createProps({
|
|
7
|
+
/**
|
|
8
|
+
* The title of the dropdown-button.
|
|
9
|
+
*/
|
|
10
|
+
title: String,
|
|
11
|
+
/**
|
|
12
|
+
* The items of the dropdown.
|
|
13
|
+
* The second dimension of the array is used
|
|
14
|
+
* to create groups of items, which are visually seperated.
|
|
15
|
+
*/
|
|
16
|
+
items: {
|
|
17
|
+
type: Array,
|
|
18
|
+
default: () => [],
|
|
19
|
+
},
|
|
20
|
+
/**
|
|
21
|
+
* If set to `true` the panel is right-aligned to the button.
|
|
22
|
+
*/
|
|
23
|
+
right: Boolean,
|
|
24
|
+
/**
|
|
25
|
+
* If set to `true` the dropdown-button is disabled and no interaction is possible.
|
|
26
|
+
*/
|
|
27
|
+
disabled: Boolean,
|
|
28
|
+
/**
|
|
29
|
+
* A slot to replace the button of the dropdown.
|
|
30
|
+
*/
|
|
31
|
+
button: Function,
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* The `NDropdown` consists of a button and a panel with multiple actions.
|
|
35
|
+
* It is useful to group multiple actions together in one place.
|
|
36
|
+
*/
|
|
37
|
+
export default createComponent('NDropdown', nDropdownProps, (props, { slots }) => {
|
|
38
|
+
const items = computed(() => {
|
|
39
|
+
if (props.items.length == 0)
|
|
40
|
+
return [];
|
|
41
|
+
if (Array.isArray(props.items[0]))
|
|
42
|
+
return props.items;
|
|
43
|
+
else
|
|
44
|
+
return [props.items];
|
|
45
|
+
});
|
|
46
|
+
const itemWithIcon = (item) => (<div class="flex space-x-3 items-center">
|
|
47
|
+
{item.icon && <item.icon class={['h-5 w-5', item.disabled ? 'text-default-300' : 'text-default-400']}/>}
|
|
48
|
+
<span>{item.label}</span>
|
|
49
|
+
</div>);
|
|
50
|
+
return () => (<Menu as="div" class="relative inline-block text-left">
|
|
51
|
+
<div class="flex">
|
|
52
|
+
{props.button?.() || (<MenuButton disabled={props.disabled} class={[
|
|
53
|
+
'shadow w-full flex justify-between items-center text-default-700 rounded-md border bg-white border-default-300 px-4 py-2 text-sm font-medium focus:outline-none focus:ring-offset-2 focus-visible:ring-2 focus-visible:ring-primary-500',
|
|
54
|
+
props.disabled ? 'text-opacity-20 cursor-default' : 'hover:bg-default-100',
|
|
55
|
+
]}>
|
|
56
|
+
<span>{props.title}</span>
|
|
57
|
+
<ChevronDownIcon class="-mr-1 ml-2 h-5 w-5 flex-shrink-0" aria-hidden="true"/>
|
|
58
|
+
</MenuButton>)}
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<Transition enterActiveClass="transition ease-out duration-100" enterFromClass="transform opacity-0 scale-95" enterToClass="transform opacity-100 scale-100" leaveActiveClass="transition ease-in duration-75" leaveFromClass="transform opacity-100 scale-100" leaveToClass="transform opacity-0 scale-95">
|
|
62
|
+
<MenuItems class={[
|
|
63
|
+
'z-10 absolute w-56 mt-2 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none',
|
|
64
|
+
props.right ? 'origin-top-right right-0' : 'origin-top-left left-0',
|
|
65
|
+
]}>
|
|
66
|
+
{slots.default?.() || (<div class="divide-y divide-default-200">
|
|
67
|
+
{items.value.map((group, index) => (<div key={`group-${index}`} class="py-1">
|
|
68
|
+
{group.map((item, index) => (<MenuItem key={`item-${index}`} disabled={item.disabled}>
|
|
69
|
+
{({ active }) => item.disabled ? (<div class="block px-4 py-2 text-sm text-default-300">
|
|
70
|
+
{itemWithIcon(item)}
|
|
71
|
+
</div>) : item.route ? (<RouterLink to={item.route} class={[
|
|
72
|
+
'block px-4 py-2 text-sm',
|
|
73
|
+
active
|
|
74
|
+
? 'bg-default-100 text-default-900'
|
|
75
|
+
: 'text-default-700',
|
|
76
|
+
]}>
|
|
77
|
+
{itemWithIcon(item)}
|
|
78
|
+
</RouterLink>) : (<button type="button" onClick={item.onClick} class={[
|
|
79
|
+
'w-full text-left px-4 py-2 text-sm',
|
|
80
|
+
active
|
|
81
|
+
? 'bg-default-100 text-default-900'
|
|
82
|
+
: 'text-default-700',
|
|
83
|
+
]}>
|
|
84
|
+
{itemWithIcon(item)}
|
|
85
|
+
</button>)}
|
|
86
|
+
</MenuItem>))}
|
|
87
|
+
</div>))}
|
|
88
|
+
</div>)}
|
|
89
|
+
</MenuItems>
|
|
90
|
+
</Transition>
|
|
91
|
+
</Menu>);
|
|
92
|
+
});
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
export declare const nDropzoneProps: {
|
|
2
|
+
/**
|
|
3
|
+
* A description which files are allowed for this dropzone.
|
|
4
|
+
* This should include everything the user needs to know about
|
|
5
|
+
* the file type / the extensions and the maximum size of the file.
|
|
6
|
+
* @see {@link nDropzoneProps.accept}
|
|
7
|
+
* @see {@link nDropzoneProps.maxFileSize}
|
|
8
|
+
*/
|
|
9
|
+
description: StringConstructor;
|
|
10
|
+
/**
|
|
11
|
+
* The maximum amount of files which can be added to the dropzone.
|
|
12
|
+
*/
|
|
13
|
+
maxFiles: {
|
|
14
|
+
type: NumberConstructor;
|
|
15
|
+
default: number;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Specifies which file types are accepted. The same syntax as with inputs of type file is used.
|
|
19
|
+
* Make sure to explain the requirements to the user in the {@link nDropzoneProps.description}.
|
|
20
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers
|
|
21
|
+
*/
|
|
22
|
+
accept: StringConstructor;
|
|
23
|
+
/**
|
|
24
|
+
* Specifies the maximum size of an individual file in bytes.
|
|
25
|
+
* Make sure to explain the max size to the user in the {@link nDropzoneProps.description}.
|
|
26
|
+
*/
|
|
27
|
+
maxFileSize: {
|
|
28
|
+
type: NumberConstructor;
|
|
29
|
+
default: number;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The maximum length of the file names.
|
|
33
|
+
* Files names longer than the specified amount of characters will be shortened.
|
|
34
|
+
* @see {@link maxLengthSplitCenter}
|
|
35
|
+
*/
|
|
36
|
+
maxLengthFileNames: {
|
|
37
|
+
type: NumberConstructor;
|
|
38
|
+
default: number;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* A tailwind height class, which is applied to the dropzone area.
|
|
42
|
+
* It is recommended to use `min-h-*` classes,
|
|
43
|
+
* so the box is always large enough to display it's text.
|
|
44
|
+
*/
|
|
45
|
+
height: {
|
|
46
|
+
type: StringConstructor;
|
|
47
|
+
default: string;
|
|
48
|
+
};
|
|
49
|
+
value: import("vue").PropType<File[]>;
|
|
50
|
+
onUpdateValue: import("vue").PropType<(newValue: File[]) => void>;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* The `NDropzone` is an area where files can be added by the user by drag & drop.
|
|
54
|
+
* Files can also be selected with a file chooser by clicking on the dropzone.
|
|
55
|
+
*/
|
|
56
|
+
declare const _default: import("vue").DefineComponent<{
|
|
57
|
+
/**
|
|
58
|
+
* A description which files are allowed for this dropzone.
|
|
59
|
+
* This should include everything the user needs to know about
|
|
60
|
+
* the file type / the extensions and the maximum size of the file.
|
|
61
|
+
* @see {@link nDropzoneProps.accept}
|
|
62
|
+
* @see {@link nDropzoneProps.maxFileSize}
|
|
63
|
+
*/
|
|
64
|
+
description: StringConstructor;
|
|
65
|
+
/**
|
|
66
|
+
* The maximum amount of files which can be added to the dropzone.
|
|
67
|
+
*/
|
|
68
|
+
maxFiles: {
|
|
69
|
+
type: NumberConstructor;
|
|
70
|
+
default: number;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Specifies which file types are accepted. The same syntax as with inputs of type file is used.
|
|
74
|
+
* Make sure to explain the requirements to the user in the {@link nDropzoneProps.description}.
|
|
75
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers
|
|
76
|
+
*/
|
|
77
|
+
accept: StringConstructor;
|
|
78
|
+
/**
|
|
79
|
+
* Specifies the maximum size of an individual file in bytes.
|
|
80
|
+
* Make sure to explain the max size to the user in the {@link nDropzoneProps.description}.
|
|
81
|
+
*/
|
|
82
|
+
maxFileSize: {
|
|
83
|
+
type: NumberConstructor;
|
|
84
|
+
default: number;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* The maximum length of the file names.
|
|
88
|
+
* Files names longer than the specified amount of characters will be shortened.
|
|
89
|
+
* @see {@link maxLengthSplitCenter}
|
|
90
|
+
*/
|
|
91
|
+
maxLengthFileNames: {
|
|
92
|
+
type: NumberConstructor;
|
|
93
|
+
default: number;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* A tailwind height class, which is applied to the dropzone area.
|
|
97
|
+
* It is recommended to use `min-h-*` classes,
|
|
98
|
+
* so the box is always large enough to display it's text.
|
|
99
|
+
*/
|
|
100
|
+
height: {
|
|
101
|
+
type: StringConstructor;
|
|
102
|
+
default: string;
|
|
103
|
+
};
|
|
104
|
+
value: import("vue").PropType<File[]>;
|
|
105
|
+
onUpdateValue: import("vue").PropType<(newValue: File[]) => void>;
|
|
106
|
+
}, 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<{
|
|
107
|
+
/**
|
|
108
|
+
* A description which files are allowed for this dropzone.
|
|
109
|
+
* This should include everything the user needs to know about
|
|
110
|
+
* the file type / the extensions and the maximum size of the file.
|
|
111
|
+
* @see {@link nDropzoneProps.accept}
|
|
112
|
+
* @see {@link nDropzoneProps.maxFileSize}
|
|
113
|
+
*/
|
|
114
|
+
description: StringConstructor;
|
|
115
|
+
/**
|
|
116
|
+
* The maximum amount of files which can be added to the dropzone.
|
|
117
|
+
*/
|
|
118
|
+
maxFiles: {
|
|
119
|
+
type: NumberConstructor;
|
|
120
|
+
default: number;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Specifies which file types are accepted. The same syntax as with inputs of type file is used.
|
|
124
|
+
* Make sure to explain the requirements to the user in the {@link nDropzoneProps.description}.
|
|
125
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers
|
|
126
|
+
*/
|
|
127
|
+
accept: StringConstructor;
|
|
128
|
+
/**
|
|
129
|
+
* Specifies the maximum size of an individual file in bytes.
|
|
130
|
+
* Make sure to explain the max size to the user in the {@link nDropzoneProps.description}.
|
|
131
|
+
*/
|
|
132
|
+
maxFileSize: {
|
|
133
|
+
type: NumberConstructor;
|
|
134
|
+
default: number;
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* The maximum length of the file names.
|
|
138
|
+
* Files names longer than the specified amount of characters will be shortened.
|
|
139
|
+
* @see {@link maxLengthSplitCenter}
|
|
140
|
+
*/
|
|
141
|
+
maxLengthFileNames: {
|
|
142
|
+
type: NumberConstructor;
|
|
143
|
+
default: number;
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* A tailwind height class, which is applied to the dropzone area.
|
|
147
|
+
* It is recommended to use `min-h-*` classes,
|
|
148
|
+
* so the box is always large enough to display it's text.
|
|
149
|
+
*/
|
|
150
|
+
height: {
|
|
151
|
+
type: StringConstructor;
|
|
152
|
+
default: string;
|
|
153
|
+
};
|
|
154
|
+
value: import("vue").PropType<File[]>;
|
|
155
|
+
onUpdateValue: import("vue").PropType<(newValue: File[]) => void>;
|
|
156
|
+
}>> & {}, {
|
|
157
|
+
maxFiles: number;
|
|
158
|
+
maxFileSize: number;
|
|
159
|
+
maxLengthFileNames: number;
|
|
160
|
+
height: string;
|
|
161
|
+
}>;
|
|
162
|
+
export default _default;
|