@v1nt1248/3nclient-lib 0.3.9 → 0.3.11
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 +3 -2
- package/dist/components/ui3n-autocomplete/types.d.ts +100 -0
- package/dist/components/ui3n-badge/types.d.ts +14 -0
- package/dist/components/ui3n-badge/ui3n-badge.vue.d.ts +2 -4
- package/dist/components/ui3n-breadcrumbs/types.d.ts +50 -0
- package/dist/components/ui3n-breadcrumbs/ui3n-breadcrumbs.vue.d.ts +2 -4
- package/dist/components/ui3n-button/types.d.ts +21 -0
- package/dist/components/ui3n-button/ui3n-button.vue.d.ts +2 -4
- package/dist/components/ui3n-checkbox/types.d.ts +44 -0
- package/dist/components/ui3n-chip/types.d.ts +49 -0
- package/dist/components/ui3n-dialog/types.d.ts +103 -0
- package/dist/components/ui3n-drop-files/types.d.ts +31 -0
- package/dist/components/ui3n-editable/types.d.ts +102 -0
- package/dist/components/ui3n-emoji/types.d.ts +13 -0
- package/dist/components/ui3n-icon/types.d.ts +10 -0
- package/dist/components/ui3n-input/types.d.ts +85 -0
- package/dist/components/ui3n-input-file/types.d.ts +29 -0
- package/dist/components/ui3n-list/types.d.ts +35 -0
- package/dist/components/ui3n-menu/types.d.ts +89 -0
- package/dist/components/ui3n-notification/types.d.ts +28 -0
- package/dist/components/ui3n-progress/types.d.ts +49 -0
- package/dist/components/ui3n-radio-group/types.d.ts +78 -0
- package/dist/components/ui3n-selector/types.d.ts +95 -0
- package/dist/components/ui3n-slider/types.d.ts +51 -0
- package/dist/components/ui3n-step-line-bar/types.d.ts +12 -0
- package/dist/components/ui3n-switch/types.d.ts +31 -0
- package/dist/components/ui3n-table/types.d.ts +198 -0
- package/dist/components/ui3n-tabs/types.d.ts +38 -0
- package/dist/components/ui3n-text/types.d.ts +56 -0
- package/dist/components/ui3n-tooltip/types.d.ts +69 -0
- package/dist/components/ui3n-virtual-scroll/types.d.ts +18 -0
- package/dist/constants/general.d.ts +0 -1
- package/dist/constants/plugins-keys.d.ts +0 -2
- package/dist/index.d.ts +0 -8
- package/dist/plugins/index.d.ts +1 -4
- package/dist/style.css +1 -1
- package/dist/ui3n-components.js +5521 -5527
- package/dist/ui3n-plugins.d.ts +3 -11
- package/dist/ui3n-plugins.js +338 -366
- package/dist/ui3n-utils.js +422 -439
- package/dist/utils/copy-to-clipboard.d.ts +1 -0
- package/dist/utils/execute-function.d.ts +29 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/remove-whitespace-in-string.d.ts +1 -0
- package/dist/utils/ui/get-element-color.d.ts +1 -1
- package/package.json +25 -22
- package/src/components/ui3n-autocomplete/types.ts +100 -0
- package/src/components/ui3n-badge/types.ts +16 -0
- package/src/components/ui3n-badge/ui3n-badge-simple.vue +10 -9
- package/src/components/ui3n-badge/ui3n-badge.vue +37 -36
- package/src/components/ui3n-breadcrumbs/types.ts +51 -0
- package/src/components/ui3n-breadcrumbs/ui3n-breadcrumb.vue +69 -69
- package/src/components/ui3n-breadcrumbs/ui3n-breadcrumbs.vue +7 -8
- package/src/components/ui3n-button/types.ts +23 -0
- package/src/components/ui3n-button/ui3n-button.vue +27 -29
- package/src/components/ui3n-checkbox/types.ts +44 -0
- package/src/components/ui3n-checkbox/ui3n-checkbox.vue +16 -23
- package/src/components/ui3n-chip/types.ts +51 -0
- package/src/components/ui3n-dialog/types.ts +103 -0
- package/src/components/ui3n-drop-files/types.ts +31 -0
- package/src/components/ui3n-editable/types.ts +102 -0
- package/src/components/ui3n-editable/useContentEditable.ts +4 -2
- package/src/components/ui3n-emoji/types.ts +13 -0
- package/src/components/ui3n-icon/types.ts +10 -0
- package/src/components/ui3n-input/types.ts +85 -0
- package/src/components/ui3n-input-file/types.ts +29 -0
- package/src/components/ui3n-list/types.ts +35 -0
- package/src/components/ui3n-menu/types.ts +89 -0
- package/src/components/ui3n-notification/types.ts +28 -0
- package/src/components/ui3n-progress/types.ts +49 -0
- package/src/components/ui3n-radio-group/types.ts +78 -0
- package/src/components/ui3n-selector/types.ts +96 -1
- package/src/components/ui3n-slider/types.ts +51 -0
- package/src/components/ui3n-step-line-bar/types.ts +12 -0
- package/src/components/ui3n-switch/types.ts +31 -0
- package/src/components/ui3n-table/types.ts +204 -0
- package/src/components/ui3n-tabs/types.ts +38 -0
- package/src/components/ui3n-text/types.ts +56 -0
- package/src/components/ui3n-tooltip/types.ts +69 -0
- package/src/components/ui3n-virtual-scroll/types.ts +18 -0
- package/dist/plugins/i18n/i18n.d.ts +0 -9
- package/dist/plugins/i18n/store-i18n.d.ts +0 -7
- package/dist/plugins/i18n/types.d.ts +0 -9
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import type { Ui3nBreadcrumbsProps } from './types';
|
|
2
|
+
import type { Ui3nBreadcrumbsProps, Ui3nBreadcrumbsSlots } from './types';
|
|
3
3
|
|
|
4
|
-
withDefaults(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
);
|
|
4
|
+
withDefaults(defineProps<Ui3nBreadcrumbsProps>(), {
|
|
5
|
+
separator: '/',
|
|
6
|
+
disabled: false,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
defineSlots<Ui3nBreadcrumbsSlots>();
|
|
11
10
|
</script>
|
|
12
11
|
|
|
13
12
|
<template>
|
|
@@ -1,23 +1,46 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
|
|
1
3
|
export interface Ui3nButtonProps {
|
|
4
|
+
/** Button type */
|
|
2
5
|
type?: 'primary' | 'secondary' | 'tertiary' | 'icon' | 'custom';
|
|
6
|
+
/** Button size */
|
|
3
7
|
size?: 'regular' | 'small';
|
|
8
|
+
/** Whether to stretch the button to the full width of the parent block */
|
|
4
9
|
block?: boolean;
|
|
10
|
+
/** Button text color */
|
|
5
11
|
textColor?: string;
|
|
12
|
+
/** Button background color */
|
|
6
13
|
color?: string;
|
|
14
|
+
/** Add a raised effect to the button */
|
|
7
15
|
elevation?: boolean;
|
|
16
|
+
/** The icon displayed on the button */
|
|
8
17
|
icon?: string;
|
|
18
|
+
/** Button icon size */
|
|
9
19
|
iconSize?: string | number;
|
|
20
|
+
/** Button icon color */
|
|
10
21
|
iconColor?: string;
|
|
22
|
+
/** Button icon position */
|
|
11
23
|
iconPosition?: 'left' | 'right';
|
|
24
|
+
/** Put component in disabled mode */
|
|
12
25
|
disabled?: boolean;
|
|
13
26
|
}
|
|
14
27
|
|
|
15
28
|
export interface Ui3nButtonEmits {
|
|
29
|
+
/** Called when the component is initialized */
|
|
16
30
|
(ev: 'init', value: HTMLButtonElement): void;
|
|
31
|
+
/** Called when the button is clicked */
|
|
17
32
|
(ev: 'click', value: Event): void;
|
|
33
|
+
/** Called when the Enter key is pressed */
|
|
18
34
|
(ev: 'enter', value: HTMLButtonElement): void;
|
|
35
|
+
/** Called when the button has focus */
|
|
19
36
|
(ev: 'focus', value: Event): void;
|
|
37
|
+
/** Called when the button loses focus. */
|
|
20
38
|
(ev: 'blur', value: Event): void;
|
|
21
39
|
}
|
|
22
40
|
|
|
23
41
|
export type Ui3nButtonEventName = 'init' | 'click' | 'enter' | 'focus' | 'blur';
|
|
42
|
+
|
|
43
|
+
export interface Ui3nButtonSlots {
|
|
44
|
+
/** Default slot */
|
|
45
|
+
default: () => VNode;
|
|
46
|
+
}
|
|
@@ -2,20 +2,18 @@
|
|
|
2
2
|
import { computed, onMounted, ref, watch, useCssModule } from 'vue';
|
|
3
3
|
import Ui3nIcon from '../ui3n-icon/ui3n-icon.vue';
|
|
4
4
|
import Ui3nRipple from '../../directives/ui3n-ripple';
|
|
5
|
-
import
|
|
5
|
+
import { Ui3nButtonEmits, Ui3nButtonProps, Ui3nButtonSlots, Ui3nButtonEventName } from './types';
|
|
6
6
|
|
|
7
7
|
const vUi3nRipple = Ui3nRipple;
|
|
8
8
|
|
|
9
|
-
const props = withDefaults(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
disabled: false,
|
|
16
|
-
},
|
|
17
|
-
);
|
|
9
|
+
const props = withDefaults(defineProps<Ui3nButtonProps>(), {
|
|
10
|
+
type: 'primary',
|
|
11
|
+
size: 'regular',
|
|
12
|
+
iconPosition: 'right',
|
|
13
|
+
disabled: false,
|
|
14
|
+
});
|
|
18
15
|
const emits = defineEmits<Ui3nButtonEmits>();
|
|
16
|
+
defineSlots<Ui3nButtonSlots>();
|
|
19
17
|
|
|
20
18
|
const $css = useCssModule();
|
|
21
19
|
|
|
@@ -49,32 +47,32 @@
|
|
|
49
47
|
const [prevColor, prevTextColor] = prevValue;
|
|
50
48
|
const [color, textColor] = newValue;
|
|
51
49
|
|
|
52
|
-
(props.type === 'custom' || props.type === 'icon')
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
props.type === 'custom'
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
50
|
+
(props.type === 'custom' || props.type === 'icon') &&
|
|
51
|
+
color !== prevColor &&
|
|
52
|
+
buttonEl.value.style.setProperty(
|
|
53
|
+
'--ui3n-button-bg-color-custom',
|
|
54
|
+
color ?? 'var(--color-bg-button-primary-default)',
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
props.type === 'custom' &&
|
|
58
|
+
textColor !== prevTextColor &&
|
|
59
|
+
buttonEl.value.style.setProperty(
|
|
60
|
+
'--ui3n-button-text-color-custom',
|
|
61
|
+
textColor ?? 'var(--color-text-button-primary-default',
|
|
62
|
+
);
|
|
65
63
|
},
|
|
66
64
|
);
|
|
67
65
|
|
|
68
66
|
onMounted(() => {
|
|
69
67
|
if (!buttonEl.value) return;
|
|
70
68
|
|
|
71
|
-
(props.type === 'custom' || props.type === 'icon')
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
(props.type === 'custom' || props.type === 'icon') &&
|
|
70
|
+
props.color &&
|
|
71
|
+
buttonEl.value.style.setProperty('--ui3n-button-bg-color-custom', props.color);
|
|
74
72
|
|
|
75
|
-
props.type === 'custom'
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
props.type === 'custom' &&
|
|
74
|
+
props.textColor &&
|
|
75
|
+
buttonEl.value.style.setProperty('--ui3n-button-text-color-custom', props.textColor);
|
|
78
76
|
|
|
79
77
|
handleButtonEvent('init');
|
|
80
78
|
});
|
|
@@ -1,22 +1,66 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Checkbox value type
|
|
5
|
+
*/
|
|
3
6
|
export type Ui3nCheckboxValue = boolean | string | number;
|
|
4
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Checkbox component properties
|
|
10
|
+
*/
|
|
5
11
|
export interface Ui3nCheckboxProps {
|
|
12
|
+
/**
|
|
13
|
+
* Current checkbox value
|
|
14
|
+
*/
|
|
6
15
|
modelValue: Ui3nCheckboxValue;
|
|
16
|
+
/**
|
|
17
|
+
* Value when checkbox is checked
|
|
18
|
+
*/
|
|
7
19
|
checkedValue?: Ui3nCheckboxValue;
|
|
20
|
+
/**
|
|
21
|
+
* Value when checkbox is unchecked
|
|
22
|
+
*/
|
|
8
23
|
uncheckedValue?: Ui3nCheckboxValue;
|
|
24
|
+
/**
|
|
25
|
+
* Checkbox size
|
|
26
|
+
*/
|
|
9
27
|
size?: number | string;
|
|
28
|
+
/**
|
|
29
|
+
* Checkbox color
|
|
30
|
+
*/
|
|
10
31
|
color?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Whether checkbox is in indeterminate state
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
11
36
|
indeterminate?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Whether checkbox is disabled
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
12
41
|
disabled?: boolean;
|
|
13
42
|
}
|
|
14
43
|
|
|
44
|
+
/**
|
|
45
|
+
* Checkbox component events
|
|
46
|
+
*/
|
|
15
47
|
export interface Ui3nCheckboxEmits {
|
|
48
|
+
/**
|
|
49
|
+
* Emitted when checkbox value changes
|
|
50
|
+
*/
|
|
16
51
|
(ev: 'change', value: Ui3nCheckboxValue): void;
|
|
52
|
+
/**
|
|
53
|
+
* Emitted when model value updates
|
|
54
|
+
*/
|
|
17
55
|
(ev: 'update:modelValue', value: Ui3nCheckboxValue): void;
|
|
18
56
|
}
|
|
19
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Checkbox component slots
|
|
60
|
+
*/
|
|
20
61
|
export interface Ui3nCheckboxSlots {
|
|
62
|
+
/**
|
|
63
|
+
* Default slot
|
|
64
|
+
*/
|
|
21
65
|
default: () => VNode;
|
|
22
66
|
}
|
|
@@ -2,18 +2,15 @@
|
|
|
2
2
|
import { computed, onMounted, watch, onBeforeMount, ref, useCssModule, useSlots } from 'vue';
|
|
3
3
|
import type { Ui3nCheckboxEmits, Ui3nCheckboxProps, Ui3nCheckboxSlots, Ui3nCheckboxValue } from './types';
|
|
4
4
|
|
|
5
|
-
const props = withDefaults(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
disabled: false,
|
|
15
|
-
},
|
|
16
|
-
);
|
|
5
|
+
const props = withDefaults(defineProps<Ui3nCheckboxProps>(), {
|
|
6
|
+
modelValue: false,
|
|
7
|
+
checkedValue: true,
|
|
8
|
+
uncheckedValue: false,
|
|
9
|
+
size: '16',
|
|
10
|
+
color: 'var(--color-icon-control-accent-default)',
|
|
11
|
+
indeterminate: false,
|
|
12
|
+
disabled: false,
|
|
13
|
+
});
|
|
17
14
|
const emits = defineEmits<Ui3nCheckboxEmits>();
|
|
18
15
|
defineSlots<Ui3nCheckboxSlots>();
|
|
19
16
|
|
|
@@ -29,9 +26,7 @@
|
|
|
29
26
|
return 'indeterminate';
|
|
30
27
|
}
|
|
31
28
|
|
|
32
|
-
return val.value === props.checkedValue
|
|
33
|
-
? 'checked'
|
|
34
|
-
: 'unchecked';
|
|
29
|
+
return val.value === props.checkedValue ? 'checked' : 'unchecked';
|
|
35
30
|
});
|
|
36
31
|
|
|
37
32
|
const mainCssClasses = computed(() => {
|
|
@@ -56,9 +51,9 @@
|
|
|
56
51
|
const uncheckedValueType = typeof props.uncheckedValue;
|
|
57
52
|
const valueType = typeof props.modelValue;
|
|
58
53
|
if (
|
|
59
|
-
checkedValueType !== uncheckedValueType
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
checkedValueType !== uncheckedValueType ||
|
|
55
|
+
checkedValueType !== valueType ||
|
|
56
|
+
uncheckedValueType !== valueType
|
|
62
57
|
) {
|
|
63
58
|
throw Error('[Ui3nCheckbox] types of "value", "checkedValue" and "uncheckedValue" are different');
|
|
64
59
|
}
|
|
@@ -73,13 +68,13 @@
|
|
|
73
68
|
|
|
74
69
|
watch(
|
|
75
70
|
() => props.modelValue,
|
|
76
|
-
newValue => val.value = newValue,
|
|
71
|
+
newValue => (val.value = newValue),
|
|
77
72
|
{ immediate: true },
|
|
78
73
|
);
|
|
79
74
|
|
|
80
75
|
watch(
|
|
81
76
|
() => props.indeterminate,
|
|
82
|
-
newValue => uncertain.value = newValue,
|
|
77
|
+
newValue => (uncertain.value = newValue),
|
|
83
78
|
{ immediate: true },
|
|
84
79
|
);
|
|
85
80
|
|
|
@@ -104,9 +99,7 @@
|
|
|
104
99
|
function change(ev: Event) {
|
|
105
100
|
ev.preventDefault();
|
|
106
101
|
|
|
107
|
-
val.value = checkBoxValue.value !== 'unchecked'
|
|
108
|
-
? props.uncheckedValue
|
|
109
|
-
: props.checkedValue;
|
|
102
|
+
val.value = checkBoxValue.value !== 'unchecked' ? props.uncheckedValue : props.checkedValue;
|
|
110
103
|
|
|
111
104
|
if (uncertain.value) {
|
|
112
105
|
uncertain.value = false;
|
|
@@ -1,20 +1,71 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Chip component properties
|
|
5
|
+
*/
|
|
3
6
|
export interface Ui3nChipProps {
|
|
7
|
+
/**
|
|
8
|
+
* Chip height
|
|
9
|
+
*/
|
|
4
10
|
height?: number | string;
|
|
11
|
+
/**
|
|
12
|
+
* Chip maximum width
|
|
13
|
+
*/
|
|
5
14
|
maxWidth?: number | string;
|
|
15
|
+
/**
|
|
16
|
+
* Chip plain style
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
6
19
|
plain?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Chip round shape
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
7
24
|
round?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Chip closeable
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
8
29
|
closeable?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Chip color
|
|
32
|
+
*/
|
|
9
33
|
color?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Text size
|
|
36
|
+
*/
|
|
10
37
|
textSize?: number | string;
|
|
38
|
+
/**
|
|
39
|
+
* Text color
|
|
40
|
+
*/
|
|
11
41
|
textColor?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Chip disabled state
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
12
46
|
disabled?: boolean;
|
|
13
47
|
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Chip component emits
|
|
51
|
+
*/
|
|
14
52
|
export interface Ui3nChipEmits {
|
|
53
|
+
/**
|
|
54
|
+
* Called when chip is closed
|
|
55
|
+
*/
|
|
15
56
|
(ev: 'close'): void;
|
|
16
57
|
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Chip component slots
|
|
61
|
+
*/
|
|
17
62
|
export interface Ui3nChipSlots {
|
|
63
|
+
/**
|
|
64
|
+
* Left slot
|
|
65
|
+
*/
|
|
18
66
|
left: (props: { size: number; color: string }) => VNode;
|
|
67
|
+
/**
|
|
68
|
+
* Default slot
|
|
69
|
+
*/
|
|
19
70
|
default: () => VNode;
|
|
20
71
|
}
|
|
@@ -1,42 +1,145 @@
|
|
|
1
1
|
import type { VNode } from 'vue';
|
|
2
2
|
import type { Ui3nIconField } from '@/types';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Dialog event base types
|
|
6
|
+
*/
|
|
4
7
|
export type Ui3nDialogEventBase = 'close' | 'confirm' | 'cancel' | 'click-overlay';
|
|
5
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Dialog event types
|
|
11
|
+
*/
|
|
6
12
|
export type Ui3nDialogEvent<E extends string = never> = Ui3nDialogEventBase | E;
|
|
7
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Dialog component properties
|
|
16
|
+
*/
|
|
8
17
|
export interface Ui3nDialogComponentProps<V> {
|
|
18
|
+
/**
|
|
19
|
+
* Dialog id
|
|
20
|
+
*/
|
|
9
21
|
id?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Dialog title
|
|
24
|
+
*/
|
|
10
25
|
title?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Dialog icon
|
|
28
|
+
*/
|
|
11
29
|
icon?: string | Ui3nIconField;
|
|
30
|
+
/**
|
|
31
|
+
* Dialog width
|
|
32
|
+
*/
|
|
12
33
|
width?: string | number;
|
|
34
|
+
/**
|
|
35
|
+
* Whether dialog is draggable
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
13
38
|
draggable?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Whether to hide close button
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
14
43
|
hideCloseButton?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* CSS classes for dialog
|
|
46
|
+
*/
|
|
15
47
|
cssClass?: string[];
|
|
48
|
+
/**
|
|
49
|
+
* CSS styles for dialog
|
|
50
|
+
*/
|
|
16
51
|
cssStyle?: Record<string, string>;
|
|
52
|
+
/**
|
|
53
|
+
* CSS classes for content
|
|
54
|
+
*/
|
|
17
55
|
contentCssClass?: string[];
|
|
56
|
+
/**
|
|
57
|
+
* CSS styles for content
|
|
58
|
+
*/
|
|
18
59
|
contentCssStyle?: Record<string, string>;
|
|
60
|
+
/**
|
|
61
|
+
* Whether to show confirm button
|
|
62
|
+
* @default true
|
|
63
|
+
*/
|
|
19
64
|
confirmButton?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Whether to show cancel button
|
|
67
|
+
* @default true
|
|
68
|
+
*/
|
|
20
69
|
cancelButton?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Confirm button text
|
|
72
|
+
*/
|
|
21
73
|
confirmButtonText?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Cancel button text
|
|
76
|
+
*/
|
|
22
77
|
cancelButtonText?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Confirm button color
|
|
80
|
+
*/
|
|
23
81
|
confirmButtonColor?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Cancel button color
|
|
84
|
+
*/
|
|
24
85
|
cancelButtonColor?: string;
|
|
86
|
+
/**
|
|
87
|
+
* Confirm button background
|
|
88
|
+
*/
|
|
25
89
|
confirmButtonBackground?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Cancel button background
|
|
92
|
+
*/
|
|
26
93
|
cancelButtonBackground?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Whether to close on click overlay
|
|
96
|
+
* @default true
|
|
97
|
+
*/
|
|
27
98
|
closeOnClickOverlay?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Whether to close on ESC key
|
|
101
|
+
* @default true
|
|
102
|
+
*/
|
|
28
103
|
closeOnEsc?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Dialog data
|
|
106
|
+
*/
|
|
29
107
|
data?: V;
|
|
108
|
+
/**
|
|
109
|
+
* Whether dialog is valid
|
|
110
|
+
* @default true
|
|
111
|
+
*/
|
|
30
112
|
isValid?: boolean;
|
|
31
113
|
}
|
|
32
114
|
|
|
115
|
+
/**
|
|
116
|
+
* Dialog component emits
|
|
117
|
+
*/
|
|
33
118
|
export interface Ui3nDialogComponentEmits<V, E extends string = never> {
|
|
119
|
+
/**
|
|
120
|
+
* Called when dialog action is performed
|
|
121
|
+
*/
|
|
34
122
|
(event: 'action', value: { event: Ui3nDialogEvent<E>; data?: V }): void;
|
|
35
123
|
}
|
|
36
124
|
|
|
125
|
+
/**
|
|
126
|
+
* Dialog component slots
|
|
127
|
+
*/
|
|
37
128
|
export interface Ui3nDialogComponentSlots {
|
|
129
|
+
/**
|
|
130
|
+
* Header slot
|
|
131
|
+
*/
|
|
38
132
|
header?: () => VNode;
|
|
133
|
+
/**
|
|
134
|
+
* Body slot
|
|
135
|
+
*/
|
|
39
136
|
body: () => VNode;
|
|
137
|
+
/**
|
|
138
|
+
* Actions slot
|
|
139
|
+
*/
|
|
40
140
|
actions?: () => VNode;
|
|
141
|
+
/**
|
|
142
|
+
* Loading slot
|
|
143
|
+
*/
|
|
41
144
|
loading?: () => VNode;
|
|
42
145
|
}
|
|
@@ -1,17 +1,48 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Drop files component properties
|
|
5
|
+
*/
|
|
3
6
|
export interface Ui3nDropFilesProps {
|
|
7
|
+
/**
|
|
8
|
+
* Drop files title
|
|
9
|
+
*/
|
|
4
10
|
title?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Drop files text
|
|
13
|
+
*/
|
|
5
14
|
text?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Additional text
|
|
17
|
+
*/
|
|
6
18
|
additionalText?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Whether to permanently display the component
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
7
23
|
permanentDisplay?: boolean;
|
|
8
24
|
}
|
|
9
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Drop files component emits
|
|
28
|
+
*/
|
|
10
29
|
export interface Ui3nDropFilesEmits {
|
|
30
|
+
/**
|
|
31
|
+
* Called when files are selected
|
|
32
|
+
*/
|
|
11
33
|
(e: 'select', fileList: FileList): void;
|
|
12
34
|
}
|
|
13
35
|
|
|
36
|
+
/**
|
|
37
|
+
* Drop files component slots
|
|
38
|
+
*/
|
|
14
39
|
export interface Ui3nDropFilesSlots {
|
|
40
|
+
/**
|
|
41
|
+
* Default slot
|
|
42
|
+
*/
|
|
15
43
|
default: () => VNode;
|
|
44
|
+
/**
|
|
45
|
+
* Additional text slot
|
|
46
|
+
*/
|
|
16
47
|
'additional-text': () => VNode;
|
|
17
48
|
}
|
|
@@ -1,43 +1,145 @@
|
|
|
1
1
|
import type { Nullable } from '@/types';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Properties of the Ui3nContentEditable component
|
|
5
|
+
*/
|
|
3
6
|
export interface Ui3nContentEditableProps {
|
|
7
|
+
/**
|
|
8
|
+
* Current value of the editable content
|
|
9
|
+
*/
|
|
4
10
|
modelValue: string;
|
|
11
|
+
/**
|
|
12
|
+
* Placeholder text
|
|
13
|
+
*/
|
|
5
14
|
placeholder?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Maximum length of the text
|
|
17
|
+
*/
|
|
6
18
|
maxLength?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Component disabled flag
|
|
21
|
+
*/
|
|
7
22
|
disabled?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Flag for automatic selection of all text on focus
|
|
25
|
+
*/
|
|
8
26
|
selectAllOnFocus?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Multiline mode flag
|
|
29
|
+
*/
|
|
9
30
|
isMultiline?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Flag to prevent empty values
|
|
33
|
+
*/
|
|
10
34
|
disallowEmptyValue?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Debounce delay in milliseconds
|
|
37
|
+
*/
|
|
11
38
|
debounceDelay?: number;
|
|
12
39
|
}
|
|
13
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Events of the Ui3nContentEditable component
|
|
43
|
+
*/
|
|
14
44
|
export interface Ui3nContentEditableEmits {
|
|
45
|
+
/**
|
|
46
|
+
* Component initialization event
|
|
47
|
+
*/
|
|
15
48
|
(event: 'init', value: HTMLElement): void;
|
|
49
|
+
/**
|
|
50
|
+
* Model value update event
|
|
51
|
+
*/
|
|
16
52
|
(event: 'update:modelValue', value: Nullable<string>): void;
|
|
53
|
+
/**
|
|
54
|
+
* Input event
|
|
55
|
+
*/
|
|
17
56
|
(event: 'input', value: Nullable<string>): void;
|
|
57
|
+
/**
|
|
58
|
+
* Value change event
|
|
59
|
+
*/
|
|
18
60
|
(event: 'change', value: Nullable<string>): void;
|
|
61
|
+
/**
|
|
62
|
+
* Click event
|
|
63
|
+
*/
|
|
19
64
|
(event: 'click', value: MouseEvent): void;
|
|
65
|
+
/**
|
|
66
|
+
* Keydown event
|
|
67
|
+
*/
|
|
20
68
|
(event: 'keydown', value: KeyboardEvent): void;
|
|
69
|
+
/**
|
|
70
|
+
* Focusin event
|
|
71
|
+
*/
|
|
21
72
|
(event: 'focusin', value: FocusEvent): void;
|
|
73
|
+
/**
|
|
74
|
+
* Focusout event
|
|
75
|
+
*/
|
|
22
76
|
(event: 'focusout', value: FocusEvent): void;
|
|
23
77
|
}
|
|
24
78
|
|
|
79
|
+
/**
|
|
80
|
+
* Properties of the Ui3nEditable component
|
|
81
|
+
*/
|
|
25
82
|
export interface Ui3nEditableProps {
|
|
83
|
+
/**
|
|
84
|
+
* Current value of the editable content
|
|
85
|
+
*/
|
|
26
86
|
modelValue: string;
|
|
87
|
+
/**
|
|
88
|
+
* Placeholder text
|
|
89
|
+
*/
|
|
27
90
|
placeholder?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Maximum length of the text
|
|
93
|
+
*/
|
|
28
94
|
maxLength?: number;
|
|
95
|
+
/**
|
|
96
|
+
* Maximum width of the component
|
|
97
|
+
*/
|
|
29
98
|
maxWidth?: string | number;
|
|
99
|
+
/**
|
|
100
|
+
* Tooltip width
|
|
101
|
+
*/
|
|
30
102
|
tooltipWidth?: number;
|
|
103
|
+
/**
|
|
104
|
+
* Component disabled flag
|
|
105
|
+
*/
|
|
31
106
|
disabled?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Flag for automatic selection of all text on focus
|
|
109
|
+
*/
|
|
32
110
|
selectAllOnFocus?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Flag to prevent empty values
|
|
113
|
+
*/
|
|
33
114
|
disallowEmptyValue?: boolean;
|
|
34
115
|
}
|
|
35
116
|
|
|
117
|
+
/**
|
|
118
|
+
* Events of the Ui3nEditable component
|
|
119
|
+
*/
|
|
36
120
|
export interface Ui3nEditableEmits {
|
|
121
|
+
/**
|
|
122
|
+
* Model value update event
|
|
123
|
+
*/
|
|
37
124
|
(event: 'update:modelValue', value: Nullable<string>): void;
|
|
125
|
+
/**
|
|
126
|
+
* Edit mode toggle event
|
|
127
|
+
*/
|
|
38
128
|
(event: 'toggle:editMode', value: boolean): void;
|
|
129
|
+
/**
|
|
130
|
+
* Edit completion event
|
|
131
|
+
*/
|
|
39
132
|
(event: 'done'): void;
|
|
133
|
+
/**
|
|
134
|
+
* Edit cancellation event
|
|
135
|
+
*/
|
|
40
136
|
(event: 'cancel'): void;
|
|
137
|
+
/**
|
|
138
|
+
* Focusin event
|
|
139
|
+
*/
|
|
41
140
|
(event: 'focusin', value: FocusEvent): void;
|
|
141
|
+
/**
|
|
142
|
+
* Focusout event
|
|
143
|
+
*/
|
|
42
144
|
(event: 'focusout'): void;
|
|
43
145
|
}
|