@v1nt1248/3nclient-lib 0.2.83 → 0.2.84
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/dist/components/index.d.ts +2 -2
- package/dist/components/ui3n-dialog/types.d.ts +15 -18
- package/dist/components/ui3n-dialog/ui3n-dialog.vue.d.ts +8 -11
- package/dist/index.d.ts +25 -8
- package/dist/plugins/dialogs/dialogs.d.ts +29 -6
- package/dist/plugins/dialogs/store-dialog.d.ts +18 -0
- package/dist/plugins/dialogs/types.d.ts +20 -9
- package/dist/plugins/dialogs/ui3n-dialog-provider.vue.d.ts +13 -0
- package/dist/plugins/index.d.ts +4 -4
- package/dist/style.css +1 -1
- package/dist/ui3n-components.d.ts +2 -0
- package/dist/ui3n-components.js +4231 -4262
- package/dist/ui3n-plugins.d.ts +24 -10
- package/dist/ui3n-plugins.js +2039 -3562
- package/package.json +8 -8
- package/src/components/index.ts +14 -4
- package/src/components/ui3n-dialog/types.ts +12 -18
- package/src/components/ui3n-dialog/ui3n-dialog.vue +161 -243
- package/dist/plugins/dialogs/store-dialogs.d.ts +0 -10
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@v1nt1248/3nclient-lib",
|
|
3
3
|
"license": "AGPL-3.0-or-later",
|
|
4
4
|
"author": "v1nt1248",
|
|
5
|
-
"version": "0.2.
|
|
5
|
+
"version": "0.2.84",
|
|
6
6
|
"description": "Library for 3NWeb clients",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"files": [
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"build:components": "LIB_NAME=lib vite build",
|
|
38
38
|
"build:plugins": "LIB_NAME=plugins vite build",
|
|
39
39
|
"build:utils": "LIB_NAME=utils vite build",
|
|
40
|
-
"build": "pnpm clean:dist && pnpm build:plugins && pnpm build:utils && pnpm build:components && pnpm copy:css",
|
|
40
|
+
"build": "pnpm clean:dist && vue-tsc --noEmit && pnpm build:plugins && pnpm build:utils && pnpm build:components && pnpm copy:css",
|
|
41
41
|
"pack": "pnpm build && npm pack && cp *.tgz ./dist && rm *.tgz",
|
|
42
42
|
"preview": "vite preview",
|
|
43
43
|
"stylelint": "stylelint --config .stylelint.config.cjs 'src/**/*.{vue,scss,css}'",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"pinia": "3.0.4",
|
|
64
|
-
"vue": "3.5.
|
|
64
|
+
"vue": "3.5.28"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@eslint/eslintrc": "^3.3.1",
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
"@typescript-eslint/eslint-plugin": "8.50.0",
|
|
73
73
|
"@typescript-eslint/parser": "8.50.0",
|
|
74
74
|
"@vitejs/plugin-vue": "6.0.3",
|
|
75
|
-
"@vue/compiler-core": "3.5.
|
|
75
|
+
"@vue/compiler-core": "3.5.28",
|
|
76
76
|
"@vue/eslint-config-typescript": "14.6.0",
|
|
77
|
-
"@vue/runtime-core": "3.5.
|
|
77
|
+
"@vue/runtime-core": "3.5.28",
|
|
78
78
|
"@vuedx/typescript-plugin-vue": "0.7.6",
|
|
79
79
|
"eslint": "9.39.2",
|
|
80
80
|
"eslint-config-prettier": "10.1.8",
|
|
@@ -101,11 +101,11 @@
|
|
|
101
101
|
"vite": "7.3.1",
|
|
102
102
|
"vite-plugin-css-injected-by-js": "3.5.2",
|
|
103
103
|
"vite-plugin-dts": "4.5.4",
|
|
104
|
-
"vite-plugin-vue-devtools": "8.0.
|
|
104
|
+
"vite-plugin-vue-devtools": "8.0.6",
|
|
105
105
|
"vitepress": "1.6.4",
|
|
106
|
-
"vue": "3.5.
|
|
106
|
+
"vue": "3.5.28",
|
|
107
107
|
"vue-eslint-parser": "10.2.0",
|
|
108
|
-
"vue-tsc": "3.2.
|
|
108
|
+
"vue-tsc": "3.2.4"
|
|
109
109
|
},
|
|
110
110
|
"packageManager": "pnpm@10.26.0",
|
|
111
111
|
"pnpm": {
|
package/src/components/index.ts
CHANGED
|
@@ -16,7 +16,12 @@ import type { Ui3nInputFileProps, Ui3nInputFileEmits } from './ui3n-input-file/t
|
|
|
16
16
|
import Ui3nText from './ui3n-text/ui3n-text.vue';
|
|
17
17
|
import type { Ui3nTextProps, Ui3nTextEmits } from './ui3n-text/types';
|
|
18
18
|
import Ui3nCheckbox from './ui3n-checkbox/ui3n-checkbox.vue';
|
|
19
|
-
import type {
|
|
19
|
+
import type {
|
|
20
|
+
Ui3nCheckboxProps,
|
|
21
|
+
Ui3nCheckboxEmits,
|
|
22
|
+
Ui3nCheckboxSlots,
|
|
23
|
+
Ui3nCheckboxValue,
|
|
24
|
+
} from './ui3n-checkbox/types';
|
|
20
25
|
import Ui3nNotification from './ui3n-notification/ui3n-notification.vue';
|
|
21
26
|
import Ui3nTableSortIcon from './ui3n-table/ui3n-table-sort-icon.vue';
|
|
22
27
|
import Ui3nTable from './ui3n-table/ui3n-table.vue';
|
|
@@ -41,7 +46,7 @@ import Ui3nDialog from './ui3n-dialog/ui3n-dialog.vue';
|
|
|
41
46
|
import type {
|
|
42
47
|
Ui3nDialogComponentProps,
|
|
43
48
|
Ui3nDialogComponentEmits,
|
|
44
|
-
|
|
49
|
+
Ui3nDialogComponentSlots,
|
|
45
50
|
Ui3nDialogEvent,
|
|
46
51
|
} from './ui3n-dialog/types';
|
|
47
52
|
import Ui3nMenu from './ui3n-menu/ui3n-menu.vue';
|
|
@@ -70,7 +75,12 @@ import Ui3nProgressLinear from './ui3n-progress/ui3n-progress-linear.vue';
|
|
|
70
75
|
import Ui3nProgressCircular from './ui3n-progress/ui3n-progress-circular.vue';
|
|
71
76
|
import type { Ui3nProgressCircularProps, Ui3nProgressLinearProps } from './ui3n-progress/types';
|
|
72
77
|
import Ui3nTooltip from './ui3n-tooltip/ui3n-tooltip.vue';
|
|
73
|
-
import type {
|
|
78
|
+
import type {
|
|
79
|
+
Ui3nTooltipEmits,
|
|
80
|
+
Ui3nTooltipProps,
|
|
81
|
+
Ui3nTooltipSlots,
|
|
82
|
+
Ui3nTooltipPlacement,
|
|
83
|
+
} from './ui3n-tooltip/types';
|
|
74
84
|
import Ui3nRadio from './ui3n-radio-group/ui3n-radio.vue';
|
|
75
85
|
import Ui3nRadioGroup from './ui3n-radio-group/ui3n-radio-group.vue';
|
|
76
86
|
import type {
|
|
@@ -147,7 +157,7 @@ export {
|
|
|
147
157
|
Ui3nDialog,
|
|
148
158
|
Ui3nDialogComponentProps,
|
|
149
159
|
Ui3nDialogComponentEmits,
|
|
150
|
-
|
|
160
|
+
Ui3nDialogComponentSlots,
|
|
151
161
|
Ui3nDialogEvent,
|
|
152
162
|
Ui3nMenu,
|
|
153
163
|
Ui3nMenuProps,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
import type { Ui3nIconField } from '@/types';
|
|
3
3
|
|
|
4
|
-
export type Ui3nDialogEvent = '
|
|
4
|
+
export type Ui3nDialogEvent = 'close' | 'confirm' | 'cancel' | 'click-overlay';
|
|
5
5
|
|
|
6
|
-
export interface
|
|
6
|
+
export interface Ui3nDialogComponentProps<V> {
|
|
7
7
|
id?: string;
|
|
8
8
|
title?: string;
|
|
9
9
|
icon?: string | Ui3nIconField;
|
|
@@ -15,9 +15,6 @@ export interface Ui3nDialogProps<V> {
|
|
|
15
15
|
contentCssStyle?: Record<string, string>;
|
|
16
16
|
confirmButton?: boolean;
|
|
17
17
|
cancelButton?: boolean;
|
|
18
|
-
onClose?: (data?: V) => void;
|
|
19
|
-
onConfirm?: (data: V) => void;
|
|
20
|
-
onCancel?: (data: V) => void;
|
|
21
18
|
confirmButtonText?: string;
|
|
22
19
|
cancelButtonText?: string;
|
|
23
20
|
confirmButtonColor?: string;
|
|
@@ -26,19 +23,16 @@ export interface Ui3nDialogProps<V> {
|
|
|
26
23
|
cancelButtonBackground?: string;
|
|
27
24
|
closeOnClickOverlay?: boolean;
|
|
28
25
|
closeOnEsc?: boolean;
|
|
26
|
+
data?: V | null | Event | undefined;
|
|
27
|
+
isValid?: boolean;
|
|
29
28
|
}
|
|
30
29
|
|
|
31
|
-
export interface
|
|
32
|
-
|
|
33
|
-
componentProps?: ExtractComponentProps<T>;
|
|
34
|
-
dialogProps?: Ui3nDialogProps<V>;
|
|
30
|
+
export interface Ui3nDialogComponentEmits<V> {
|
|
31
|
+
(event: 'action', value: { event: Ui3nDialogEvent; data?: V | null | Event | undefined }): void;
|
|
35
32
|
}
|
|
36
33
|
|
|
37
|
-
export interface
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
(ev: 'confirm', value?: V): void;
|
|
42
|
-
(ev: 'cancel', value?: V): void;
|
|
43
|
-
(ev: 'click-overlay', value?: V): void;
|
|
34
|
+
export interface Ui3nDialogComponentSlots {
|
|
35
|
+
header?: () => VNode;
|
|
36
|
+
body: () => VNode;
|
|
37
|
+
actions?: () => VNode;
|
|
44
38
|
}
|
|
@@ -1,42 +1,31 @@
|
|
|
1
|
-
<script lang="ts" setup generic="
|
|
2
|
-
import {
|
|
1
|
+
<script lang="ts" setup generic="V extends any">
|
|
2
|
+
import { computed, defineProps, defineEmits, defineSlots, nextTick, onMounted, ref, withDefaults, useTemplateRef } from 'vue';
|
|
3
3
|
import omit from 'lodash/omit';
|
|
4
|
+
import { determineWindowWidth } from './util';
|
|
5
|
+
import type { Ui3nDialogComponentProps, Ui3nDialogComponentEmits, Ui3nDialogComponentSlots } from './types';
|
|
4
6
|
import Ui3nButton from '../ui3n-button/ui3n-button.vue';
|
|
5
7
|
import Ui3nIcon from '../ui3n-icon/ui3n-icon.vue';
|
|
6
|
-
import type { Ui3nDialogEvent, Ui3nDialogComponentProps, Ui3nDialogComponentEmits } from './types';
|
|
7
|
-
import { ExtractComponentProps } from '@/types';
|
|
8
|
-
import { determineWindowWidth } from './util';
|
|
9
8
|
|
|
10
|
-
const props =
|
|
9
|
+
const props = withDefaults(
|
|
10
|
+
defineProps<Ui3nDialogComponentProps<V>>(), {
|
|
11
|
+
cssClass: () => [],
|
|
12
|
+
cssStyle: () => ({}),
|
|
13
|
+
contentCssClass: () => [],
|
|
14
|
+
contentCssStyle: () => ({}),
|
|
15
|
+
confirmButtonText: 'Done',
|
|
16
|
+
cancelButtonText: 'Cancel',
|
|
17
|
+
confirmButtonColor: 'var(--color-text-button-primary-default)',
|
|
18
|
+
cancelButtonColor: 'var(--color-text-button-secondary-default)',
|
|
19
|
+
confirmButtonBackground: 'var(--color-bg-button-primary-default)',
|
|
20
|
+
cancelButtonBackground: 'var(--color-bg-button-secondary-default)',
|
|
21
|
+
data: null,
|
|
22
|
+
isValid: true,
|
|
23
|
+
},
|
|
24
|
+
);
|
|
11
25
|
const emits = defineEmits<Ui3nDialogComponentEmits<V>>();
|
|
26
|
+
defineSlots<Ui3nDialogComponentSlots>();
|
|
12
27
|
|
|
13
|
-
const
|
|
14
|
-
title: props.dialogProps?.title || '',
|
|
15
|
-
cssClass: props.dialogProps?.cssClass || [],
|
|
16
|
-
cssStyle: props.dialogProps?.cssStyle || {},
|
|
17
|
-
contentCssClass: props.dialogProps?.contentCssClass || [],
|
|
18
|
-
contentCssStyle: props.dialogProps?.contentCssStyle || {},
|
|
19
|
-
width: props.dialogProps?.width
|
|
20
|
-
? props.dialogProps?.width
|
|
21
|
-
: props.dialogProps?.cssStyle?.width
|
|
22
|
-
? props.dialogProps?.cssStyle?.width
|
|
23
|
-
: 380,
|
|
24
|
-
confirmButton: props.dialogProps?.confirmButton !== false,
|
|
25
|
-
cancelButton: props.dialogProps?.cancelButton !== false,
|
|
26
|
-
confirmButtonText: props.dialogProps?.confirmButtonText || 'Done',
|
|
27
|
-
cancelButtonText: props.dialogProps?.cancelButtonText || 'Cancel',
|
|
28
|
-
confirmButtonColor: props.dialogProps?.confirmButtonColor || 'var(--color-text-button-primary-default)',
|
|
29
|
-
cancelButtonColor: props.dialogProps?.cancelButtonColor || 'var(--color-text-button-secondary-default)',
|
|
30
|
-
confirmButtonBackground: props.dialogProps?.confirmButtonBackground || 'var(--color-bg-button-primary-default)',
|
|
31
|
-
cancelButtonBackground: props.dialogProps?.cancelButtonBackground || 'var(--color-bg-button-secondary-default)',
|
|
32
|
-
closeOnClickOverlay: props.dialogProps?.closeOnClickOverlay !== false,
|
|
33
|
-
}));
|
|
34
|
-
|
|
35
|
-
const show = ref(true);
|
|
36
|
-
const data = ref<V | null>(null);
|
|
37
|
-
const isValid = ref(true);
|
|
38
|
-
const dialogOverlayElement = ref<HTMLElement | null>(null);
|
|
39
|
-
const dialogElement = ref<HTMLDivElement | null>(null);
|
|
28
|
+
const dialogElement = useTemplateRef('dialog-el');
|
|
40
29
|
const isMousedown = ref(false);
|
|
41
30
|
const dragData = ref({
|
|
42
31
|
initialLeft: 0,
|
|
@@ -48,105 +37,44 @@
|
|
|
48
37
|
});
|
|
49
38
|
|
|
50
39
|
const cssStyle = computed(() => ({
|
|
51
|
-
width: determineWindowWidth({ width:
|
|
52
|
-
...omit(
|
|
53
|
-
...(props.
|
|
40
|
+
width: determineWindowWidth({ width: props.width, style: props.cssStyle }),
|
|
41
|
+
...omit(props.cssStyle, 'width'),
|
|
42
|
+
...(props.draggable && {
|
|
54
43
|
left: `${dragData.value.left}px`,
|
|
55
44
|
top: `${dragData.value.top}px`,
|
|
56
45
|
}),
|
|
57
46
|
}));
|
|
58
47
|
|
|
59
48
|
const iconData = computed(() => {
|
|
60
|
-
if (!props.
|
|
49
|
+
if (!props.icon) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
61
52
|
|
|
62
|
-
if (typeof props.
|
|
53
|
+
if (typeof props.icon === 'string') {
|
|
63
54
|
return {
|
|
64
|
-
icon: props.
|
|
65
|
-
|
|
66
|
-
height: 14,
|
|
55
|
+
icon: props.icon,
|
|
56
|
+
size: 14,
|
|
67
57
|
color: 'var(--color-icon-control-secondary-default)',
|
|
68
58
|
};
|
|
69
59
|
}
|
|
70
60
|
|
|
71
61
|
return {
|
|
72
|
-
icon: props.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
color: props.dialogProps.icon.color || 'var(--color-icon-control-secondary-default)',
|
|
62
|
+
icon: props.icon.icon,
|
|
63
|
+
size: props.icon.size || 14,
|
|
64
|
+
color: props.icon.color || 'var(--color-icon-control-secondary-default)',
|
|
76
65
|
};
|
|
77
66
|
});
|
|
78
67
|
|
|
79
|
-
function selectData(value: V) {
|
|
80
|
-
data.value = value;
|
|
81
|
-
if (
|
|
82
|
-
!currentDialogProps.value.confirmButton &&
|
|
83
|
-
!currentDialogProps.value.cancelButton &&
|
|
84
|
-
props.dialogProps?.onConfirm
|
|
85
|
-
) {
|
|
86
|
-
props.dialogProps?.onConfirm(data.value);
|
|
87
|
-
closeDialog();
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function validate(value: boolean) {
|
|
92
|
-
isValid.value = value;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function closeDialog(arg?: { ev?: Event; withAction?: boolean }) {
|
|
96
|
-
const { ev, withAction = true } = arg || {};
|
|
97
|
-
if (ev) {
|
|
98
|
-
ev.stopImmediatePropagation();
|
|
99
|
-
ev.preventDefault();
|
|
100
|
-
}
|
|
101
|
-
show.value = false;
|
|
102
|
-
props.dialogProps?.onClose && props.dialogProps.onClose(data.value);
|
|
103
|
-
if (withAction) {
|
|
104
|
-
emits('close', data.value);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
68
|
function onKeydown(event: KeyboardEvent) {
|
|
109
69
|
const { code } = event;
|
|
110
70
|
|
|
111
|
-
if (code === 'Escape' && props.
|
|
71
|
+
if (code === 'Escape' && props.closeOnEsc) {
|
|
112
72
|
event.preventDefault();
|
|
113
73
|
event.stopPropagation();
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function startEmit(event: Ui3nDialogEvent, ev?: Event) {
|
|
119
|
-
if (event === 'click-overlay') {
|
|
120
|
-
emits(event);
|
|
121
|
-
currentDialogProps.value.closeOnClickOverlay && closeDialog({ ev });
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (event === 'confirm') {
|
|
126
|
-
props.dialogProps?.onConfirm && props.dialogProps.onConfirm(data.value);
|
|
127
|
-
closeDialog();
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (event === 'cancel') {
|
|
131
|
-
props.dialogProps?.onCancel && props.dialogProps.onCancel(data.value);
|
|
132
|
-
closeDialog();
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (data.value) {
|
|
136
|
-
// @ts-ignore
|
|
137
|
-
emits(event, data.value);
|
|
138
|
-
} else {
|
|
139
|
-
// @ts-ignore
|
|
140
|
-
emits(event);
|
|
74
|
+
emits('action', { event: 'cancel', data: props.data });
|
|
141
75
|
}
|
|
142
76
|
}
|
|
143
77
|
|
|
144
|
-
function handleEvent(event: Event, eventName: Ui3nDialogEvent) {
|
|
145
|
-
event.stopImmediatePropagation();
|
|
146
|
-
event.preventDefault();
|
|
147
|
-
startEmit(eventName);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
78
|
/* drag */
|
|
151
79
|
function onDragstart() {
|
|
152
80
|
return false;
|
|
@@ -177,20 +105,20 @@
|
|
|
177
105
|
onMounted(() => {
|
|
178
106
|
if (dialogElement.value) {
|
|
179
107
|
dialogElement.value.style.setProperty(
|
|
180
|
-
'--dialog-confirm-button-color',
|
|
181
|
-
|
|
108
|
+
'--ui3n-dialog-confirm-button-color',
|
|
109
|
+
props.confirmButtonColor,
|
|
182
110
|
);
|
|
183
111
|
dialogElement.value.style.setProperty(
|
|
184
|
-
'--dialog-cancel-button-color',
|
|
185
|
-
|
|
112
|
+
'--ui3n-dialog-cancel-button-color',
|
|
113
|
+
props.cancelButtonColor,
|
|
186
114
|
);
|
|
187
115
|
dialogElement.value.style.setProperty(
|
|
188
|
-
'--dialog-confirm-background-color',
|
|
189
|
-
|
|
116
|
+
'--ui3n-dialog-confirm-background-color',
|
|
117
|
+
props.confirmButtonBackground,
|
|
190
118
|
);
|
|
191
119
|
dialogElement.value.style.setProperty(
|
|
192
|
-
'--dialog-cancel-background-color',
|
|
193
|
-
|
|
120
|
+
'--ui3n-dialog-cancel-background-color',
|
|
121
|
+
props.cancelButtonBackground,
|
|
194
122
|
);
|
|
195
123
|
|
|
196
124
|
nextTick(() => {
|
|
@@ -208,163 +136,166 @@
|
|
|
208
136
|
|
|
209
137
|
<template>
|
|
210
138
|
<div
|
|
211
|
-
|
|
212
|
-
ref="
|
|
213
|
-
|
|
214
|
-
|
|
139
|
+
:id="id"
|
|
140
|
+
ref="dialog-el"
|
|
141
|
+
tabindex="1"
|
|
142
|
+
:class="[$style.dialog, draggable && isMousedown && $style.draggable, ...cssClass]"
|
|
143
|
+
:style="cssStyle"
|
|
144
|
+
v-on="
|
|
145
|
+
draggable
|
|
146
|
+
? {
|
|
147
|
+
dragstart: onDragstart,
|
|
148
|
+
mousedown: onMousedown,
|
|
149
|
+
mouseup: onMouseup,
|
|
150
|
+
mousemove: onMousemove,
|
|
151
|
+
keydown: onKeydown,
|
|
152
|
+
}
|
|
153
|
+
: { keydown: onKeydown }
|
|
154
|
+
"
|
|
215
155
|
>
|
|
156
|
+
<!-- HEADER -->
|
|
216
157
|
<div
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
tabindex="1"
|
|
220
|
-
:class="[
|
|
221
|
-
$style.dialog,
|
|
222
|
-
dialogProps?.draggable && isMousedown && $style.draggable,
|
|
223
|
-
...currentDialogProps.cssClass!,
|
|
224
|
-
]"
|
|
225
|
-
:style="cssStyle"
|
|
226
|
-
v-on="
|
|
227
|
-
dialogProps?.draggable
|
|
228
|
-
? {
|
|
229
|
-
dragstart: onDragstart,
|
|
230
|
-
mousedown: onMousedown,
|
|
231
|
-
mouseup: onMouseup,
|
|
232
|
-
mousemove: onMousemove,
|
|
233
|
-
keydown: onKeydown,
|
|
234
|
-
}
|
|
235
|
-
: { keydown: onKeydown }
|
|
236
|
-
"
|
|
158
|
+
v-if="title"
|
|
159
|
+
:class="[$style.title, $style.titleDefault]"
|
|
237
160
|
>
|
|
238
|
-
<
|
|
239
|
-
v-if="
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
v-if="iconData"
|
|
244
|
-
v-bind="iconData"
|
|
245
|
-
:class="$style.icon"
|
|
246
|
-
/>
|
|
161
|
+
<ui3n-icon
|
|
162
|
+
v-if="iconData"
|
|
163
|
+
v-bind="iconData"
|
|
164
|
+
:class="$style.icon"
|
|
165
|
+
/>
|
|
247
166
|
|
|
248
|
-
|
|
249
|
-
|
|
167
|
+
<span>{{ title }}</span>
|
|
168
|
+
</div>
|
|
250
169
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
170
|
+
<div
|
|
171
|
+
v-if="$slots['header']"
|
|
172
|
+
:class="$style.title"
|
|
173
|
+
>
|
|
174
|
+
<slot name="header" />
|
|
175
|
+
</div>
|
|
176
|
+
|
|
177
|
+
<div
|
|
178
|
+
v-if="$slots['body']"
|
|
179
|
+
:class="$style.content"
|
|
180
|
+
>
|
|
181
|
+
<slot name="body" />
|
|
182
|
+
</div>
|
|
261
183
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
184
|
+
<div
|
|
185
|
+
v-if="confirmButton || cancelButton"
|
|
186
|
+
:class="[$style.actions, $style.actionsDefault]"
|
|
187
|
+
>
|
|
188
|
+
<ui3n-button
|
|
189
|
+
v-if="cancelButton"
|
|
190
|
+
type="custom"
|
|
191
|
+
:color="cancelButtonBackground"
|
|
192
|
+
:text-color="cancelButtonColor"
|
|
193
|
+
@click.stop.prevent="() => emits('action', { event: 'cancel', data: props.data })"
|
|
266
194
|
>
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
</div>
|
|
278
|
-
|
|
279
|
-
<div
|
|
280
|
-
v-if="currentDialogProps.confirmButton || currentDialogProps.cancelButton"
|
|
281
|
-
:class="[
|
|
282
|
-
$style.actions,
|
|
283
|
-
currentDialogProps.confirmButton && currentDialogProps.cancelButton && $style.bothBtns,
|
|
284
|
-
]"
|
|
195
|
+
{{ cancelButtonText }}
|
|
196
|
+
</ui3n-button>
|
|
197
|
+
|
|
198
|
+
<ui3n-button
|
|
199
|
+
v-if="confirmButton"
|
|
200
|
+
type="custom"
|
|
201
|
+
:color="confirmButtonBackground"
|
|
202
|
+
:text-color="confirmButtonColor"
|
|
203
|
+
:disabled="!isValid"
|
|
204
|
+
@click.stop.prevent="() => emits('action', { event: 'confirm', data: props.data })"
|
|
285
205
|
>
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
type="custom"
|
|
289
|
-
:color="currentDialogProps.cancelButtonBackground"
|
|
290
|
-
:text-color="currentDialogProps.cancelButtonColor"
|
|
291
|
-
@click="handleEvent($event, 'cancel')"
|
|
292
|
-
>
|
|
293
|
-
{{ currentDialogProps.cancelButtonText }}
|
|
294
|
-
</ui3n-button>
|
|
295
|
-
|
|
296
|
-
<ui3n-button
|
|
297
|
-
v-if="currentDialogProps.confirmButton"
|
|
298
|
-
type="custom"
|
|
299
|
-
:color="currentDialogProps.confirmButtonBackground"
|
|
300
|
-
:text-color="currentDialogProps.confirmButtonColor"
|
|
301
|
-
:disabled="!isValid"
|
|
302
|
-
@click="handleEvent($event, 'confirm')"
|
|
303
|
-
>
|
|
304
|
-
{{ currentDialogProps.confirmButtonText }}
|
|
305
|
-
</ui3n-button>
|
|
306
|
-
</div>
|
|
206
|
+
{{ confirmButtonText }}
|
|
207
|
+
</ui3n-button>
|
|
307
208
|
</div>
|
|
209
|
+
|
|
210
|
+
<div
|
|
211
|
+
v-if="$slots['actions']"
|
|
212
|
+
:class="$style.actions"
|
|
213
|
+
>
|
|
214
|
+
<slot name="actions" />
|
|
215
|
+
</div>
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
<ui3n-button
|
|
219
|
+
:class="$style.closeBtn"
|
|
220
|
+
type="icon"
|
|
221
|
+
size="small"
|
|
222
|
+
color="var(--color-bg-block-primary-default)"
|
|
223
|
+
icon="round-close"
|
|
224
|
+
icon-size="16"
|
|
225
|
+
icon-color="var(--color-icon-control-primary-default)"
|
|
226
|
+
@click.stop.prevent="emits('action', { event: 'close' })"
|
|
227
|
+
/>
|
|
308
228
|
</div>
|
|
309
229
|
</template>
|
|
310
230
|
|
|
311
231
|
<style lang="scss" module>
|
|
312
232
|
@use '../../assets/styles/mixins' as mixins;
|
|
313
233
|
|
|
314
|
-
.overlay {
|
|
234
|
+
.modal-overlay {
|
|
315
235
|
position: fixed;
|
|
316
236
|
z-index: 1000;
|
|
317
237
|
inset: 0;
|
|
318
238
|
display: flex;
|
|
319
239
|
justify-content: center;
|
|
320
240
|
align-items: center;
|
|
321
|
-
background-color:
|
|
241
|
+
background-color: var(--shadow-close);
|
|
322
242
|
}
|
|
323
243
|
|
|
324
244
|
.dialog {
|
|
325
|
-
--dialog-border-radius: 8px;
|
|
326
|
-
--dialog-title-height: 48px;
|
|
327
|
-
--dialog-title-padding: 0 32px 0 16px;
|
|
328
|
-
--dialog-title-font-size: 14px;
|
|
329
|
-
--dialog-actions-height: 64px;
|
|
330
|
-
--dialog-actions-padding: 16px;
|
|
331
|
-
--dialog-confirm-button-color: var(--color-text-button-primary-default);
|
|
332
|
-
--dialog-cancel-button-color: var(--color-text-button-secondary-default);
|
|
333
|
-
--dialog-confirm-background-color: var(--color-bg-button-primary-default);
|
|
334
|
-
--dialog-cancel-background-color: var(--color-bg-button-secondary-default);
|
|
245
|
+
--ui3n-dialog-border-radius: 8px;
|
|
246
|
+
--ui3n-dialog-title-height: 48px;
|
|
247
|
+
--ui3n-dialog-title-padding: 0 32px 0 16px;
|
|
248
|
+
--ui3n-dialog-title-font-size: 14px;
|
|
249
|
+
--ui3n-dialog-actions-height: 64px;
|
|
250
|
+
--ui3n-dialog-actions-padding: 16px;
|
|
251
|
+
--ui3n-dialog-confirm-button-color: var(--color-text-button-primary-default);
|
|
252
|
+
--ui3n-dialog-cancel-button-color: var(--color-text-button-secondary-default);
|
|
253
|
+
--ui3n-dialog-confirm-background-color: var(--color-bg-button-primary-default);
|
|
254
|
+
--ui3n-dialog-cancel-background-color: var(--color-bg-button-secondary-default);
|
|
335
255
|
|
|
336
256
|
position: relative;
|
|
337
257
|
display: flex;
|
|
338
258
|
flex-direction: column;
|
|
339
259
|
height: auto;
|
|
260
|
+
min-height: var(--spacing-xxl);
|
|
340
261
|
max-height: 95%;
|
|
341
262
|
background-color: var(--color-bg-block-primary-default);
|
|
342
|
-
border-radius: var(--dialog-border-radius);
|
|
263
|
+
border-radius: var(--ui3n-dialog-border-radius);
|
|
343
264
|
outline: none;
|
|
344
|
-
@include mixins.elevation();
|
|
265
|
+
@include mixins.elevation(2);
|
|
345
266
|
|
|
346
267
|
&.draggable {
|
|
347
268
|
cursor: move;
|
|
348
269
|
}
|
|
349
270
|
}
|
|
350
271
|
|
|
272
|
+
.closeBtn {
|
|
273
|
+
position: absolute;
|
|
274
|
+
right: 4px;
|
|
275
|
+
top: 12px;
|
|
276
|
+
z-index: 5;
|
|
277
|
+
}
|
|
278
|
+
|
|
351
279
|
.title {
|
|
352
280
|
position: relative;
|
|
353
281
|
width: 100%;
|
|
354
|
-
min-height: var(--dialog-title-height);
|
|
355
|
-
height: var(--dialog-title-height);
|
|
282
|
+
min-height: var(--ui3n-dialog-title-height);
|
|
283
|
+
height: var(--ui3n-dialog-title-height);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.titleDefault {
|
|
356
287
|
display: flex;
|
|
357
288
|
justify-content: flex-start;
|
|
358
289
|
align-items: center;
|
|
359
290
|
column-gap: var(--spacing-s);
|
|
360
|
-
padding: var(--dialog-title-padding);
|
|
291
|
+
padding: var(--ui3n-dialog-title-padding);
|
|
361
292
|
border-bottom: 1px solid var(--color-border-block-primary-default);
|
|
362
293
|
|
|
363
294
|
span {
|
|
364
295
|
display: block;
|
|
365
296
|
position: relative;
|
|
366
297
|
flex-grow: 1;
|
|
367
|
-
font-size: var(--dialog-title-font-size);
|
|
298
|
+
font-size: var(--ui3n-dialog-title-font-size);
|
|
368
299
|
font-weight: 600;
|
|
369
300
|
color: var(--color-text-control-primary-default);
|
|
370
301
|
@include mixins.text-overflow-ellipsis();
|
|
@@ -375,36 +306,23 @@
|
|
|
375
306
|
}
|
|
376
307
|
}
|
|
377
308
|
|
|
378
|
-
.dragHandleIcon {
|
|
379
|
-
position: absolute;
|
|
380
|
-
left: 0;
|
|
381
|
-
top: 16px;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
.closeBtn {
|
|
385
|
-
position: absolute;
|
|
386
|
-
right: 4px;
|
|
387
|
-
top: 12px;
|
|
388
|
-
z-index: 5;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
309
|
.content {
|
|
392
310
|
flex-grow: 2;
|
|
393
311
|
overflow-y: auto;
|
|
394
312
|
}
|
|
395
313
|
|
|
396
314
|
.actions {
|
|
397
|
-
|
|
398
|
-
display: flex;
|
|
315
|
+
position: relative;
|
|
399
316
|
width: 100%;
|
|
400
|
-
min-height: var(--dialog-actions-height);
|
|
401
|
-
height: var(--dialog-actions-height);
|
|
317
|
+
min-height: var(--ui3n-dialog-actions-height);
|
|
318
|
+
height: var(--ui3n-dialog-actions-height);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.actionsDefault {
|
|
322
|
+
padding: var(--ui3n-dialog-actions-padding);
|
|
323
|
+
display: flex;
|
|
402
324
|
justify-content: flex-end;
|
|
403
325
|
align-items: center;
|
|
404
326
|
gap: var(--spacing-s);
|
|
405
327
|
}
|
|
406
|
-
|
|
407
|
-
.bothBtns {
|
|
408
|
-
margin-left: var(--spacing-s);
|
|
409
|
-
}
|
|
410
328
|
</style>
|