@v1nt1248/3nclient-lib 0.3.6 → 0.3.8
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/ui3n-dialog/types.d.ts +4 -3
- package/dist/components/ui3n-dialog/ui3n-dialog-provider.vue.d.ts +1 -1
- package/dist/components/ui3n-dialog/ui3n-dialog.vue.d.ts +3 -3
- package/dist/plugins/dialogs/dialogs.d.ts +4 -4
- package/dist/plugins/dialogs/store-dialog.d.ts +4 -4
- package/dist/plugins/dialogs/types.d.ts +7 -7
- package/dist/style.css +1 -1
- package/dist/ui3n-components.js +11 -11
- package/dist/variables.css +3 -0
- package/package.json +1 -1
- package/src/components/ui3n-dialog/types.ts +5 -3
- package/src/components/ui3n-dialog/ui3n-dialog-provider.vue +4 -4
- package/src/components/ui3n-dialog/ui3n-dialog.vue +31 -39
package/dist/ui3n-components.js
CHANGED
|
@@ -18448,7 +18448,7 @@ var Js = /* @__PURE__ */ X(/* @__PURE__ */ d({
|
|
|
18448
18448
|
onClick: z((e) => i(t.id, t.props), ["self", "prevent"])
|
|
18449
18449
|
}, [(x(), a(E(t.component), m({ ref_for: !0 }, t.props, { onAction: (e) => o(t.id, e) }), null, 16, ["onAction"]))], 10, Ys))), 128))]));
|
|
18450
18450
|
}
|
|
18451
|
-
}), [["__cssModules", { $style: { "dialog-provider-overlay": "_dialog-provider-
|
|
18451
|
+
}), [["__cssModules", { $style: { "dialog-provider-overlay": "_dialog-provider-overlay_v01lr_1" } }]]);
|
|
18452
18452
|
//#endregion
|
|
18453
18453
|
//#region src/components/ui3n-dialog/util.ts
|
|
18454
18454
|
function Zs({ width: e, style: t, defaultValue: n = 380 }) {
|
|
@@ -18635,16 +18635,16 @@ var Qs = ["id"], $s = /* @__PURE__ */ X(/* @__PURE__ */ d({
|
|
|
18635
18635
|
], 16, Qs));
|
|
18636
18636
|
}
|
|
18637
18637
|
}), [["__cssModules", { $style: {
|
|
18638
|
-
dialog: "
|
|
18639
|
-
draggable: "
|
|
18640
|
-
closeBtn: "
|
|
18641
|
-
title: "
|
|
18642
|
-
titleDefault: "
|
|
18643
|
-
icon: "
|
|
18644
|
-
content: "
|
|
18645
|
-
actions: "
|
|
18646
|
-
actionsDefault: "
|
|
18647
|
-
loading: "
|
|
18638
|
+
dialog: "_dialog_19xef_1",
|
|
18639
|
+
draggable: "_draggable_19xef_24",
|
|
18640
|
+
closeBtn: "_closeBtn_19xef_28",
|
|
18641
|
+
title: "_title_19xef_35",
|
|
18642
|
+
titleDefault: "_titleDefault_19xef_42",
|
|
18643
|
+
icon: "_icon_19xef_63",
|
|
18644
|
+
content: "_content_19xef_67",
|
|
18645
|
+
actions: "_actions_19xef_72",
|
|
18646
|
+
actionsDefault: "_actionsDefault_19xef_79",
|
|
18647
|
+
loading: "_loading_19xef_87"
|
|
18648
18648
|
} }]]), ec = /* @__PURE__ */ se({
|
|
18649
18649
|
Vue: () => e,
|
|
18650
18650
|
Vue2: () => void 0,
|
package/dist/variables.css
CHANGED
|
@@ -127,6 +127,7 @@
|
|
|
127
127
|
--shadow-key-3: var(--black-4);
|
|
128
128
|
--shadow-close: var(--black-4);
|
|
129
129
|
--shadow-far: var(--black-8);
|
|
130
|
+
--shadow-back: var(--black-48);
|
|
130
131
|
--global-default: var(--grey-5);
|
|
131
132
|
--global-subdefault: var(--grey-10);
|
|
132
133
|
--default-fill-default: var(--white-100);
|
|
@@ -293,6 +294,7 @@
|
|
|
293
294
|
--shadow-key-3: var(--white-4);
|
|
294
295
|
--shadow-close: var(--black-12);
|
|
295
296
|
--shadow-far: var(--black-24);
|
|
297
|
+
--shadow-back: var(--white-48);
|
|
296
298
|
--global-default: var(--blue-95);
|
|
297
299
|
--global-subdefault: var(--blue-90);
|
|
298
300
|
--default-fill-default: var(--blue-100);
|
|
@@ -459,6 +461,7 @@
|
|
|
459
461
|
--shadow-key-3: var(--white-4);
|
|
460
462
|
--shadow-close: var(--black-12);
|
|
461
463
|
--shadow-far: var(--black-24);
|
|
464
|
+
--shadow-back: var(--white-48);
|
|
462
465
|
--global-default: var(--grey-95);
|
|
463
466
|
--global-subdefault: var(--grey-90);
|
|
464
467
|
--default-fill-default: var(--grey-100);
|
package/package.json
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { VNode } from 'vue';
|
|
2
2
|
import type { Ui3nIconField } from '@/types';
|
|
3
3
|
|
|
4
|
-
export type
|
|
4
|
+
export type Ui3nDialogEventBase = 'close' | 'confirm' | 'cancel' | 'click-overlay';
|
|
5
|
+
|
|
6
|
+
export type Ui3nDialogEvent<E extends string = never> = Ui3nDialogEventBase | E;
|
|
5
7
|
|
|
6
8
|
export interface Ui3nDialogComponentProps<V> {
|
|
7
9
|
id?: string;
|
|
@@ -28,8 +30,8 @@ export interface Ui3nDialogComponentProps<V> {
|
|
|
28
30
|
isValid?: boolean;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
export interface Ui3nDialogComponentEmits<V> {
|
|
32
|
-
(event: 'action', value: { event: Ui3nDialogEvent
|
|
33
|
+
export interface Ui3nDialogComponentEmits<V, E extends string = never> {
|
|
34
|
+
(event: 'action', value: { event: Ui3nDialogEvent<E>; data?: V }): void;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
export interface Ui3nDialogComponentSlots {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script lang="ts" setup generic="V extends any">
|
|
1
|
+
<script lang="ts" setup generic="V extends any, E extends string = never">
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
3
|
import { type Component, inject } from 'vue';
|
|
4
4
|
import type { DialogsPlugin } from '@/plugins';
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
if (
|
|
13
13
|
(modalProps as Ui3nDialogComponentProps<any>).closeOnClickOverlay ||
|
|
14
14
|
((modalProps as any).dialogProps as Ui3nDialogComponentProps<any>)?.closeOnClickOverlay
|
|
15
|
-
|
|
15
|
+
) {
|
|
16
16
|
dialogs.$closeDialog(id, { event: 'click-overlay' });
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
function onAction(id: string, value: { event: Ui3nDialogEvent
|
|
20
|
+
function onAction(id: string, value: { event: Ui3nDialogEvent<E>; data?: V }) {
|
|
21
21
|
dialogs.$closeDialog(id, value);
|
|
22
22
|
}
|
|
23
23
|
</script>
|
|
@@ -48,6 +48,6 @@
|
|
|
48
48
|
display: flex;
|
|
49
49
|
justify-content: center;
|
|
50
50
|
align-items: center;
|
|
51
|
-
background-color:
|
|
51
|
+
background-color: oklch(25% 0 0deg / 0.75);
|
|
52
52
|
}
|
|
53
53
|
</style>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script lang="ts" setup generic="V extends any">
|
|
1
|
+
<script lang="ts" setup generic="V extends any, E extends string = never">
|
|
2
2
|
import { computed, nextTick, onMounted, ref, useTemplateRef } from 'vue';
|
|
3
3
|
import omit from 'lodash/omit';
|
|
4
4
|
import { determineWindowWidth } from './util';
|
|
@@ -6,24 +6,22 @@
|
|
|
6
6
|
import Ui3nButton from '../ui3n-button/ui3n-button.vue';
|
|
7
7
|
import Ui3nIcon from '../ui3n-icon/ui3n-icon.vue';
|
|
8
8
|
|
|
9
|
-
const props = withDefaults(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
);
|
|
26
|
-
const emits = defineEmits<Ui3nDialogComponentEmits<V>>();
|
|
9
|
+
const props = withDefaults(defineProps<Ui3nDialogComponentProps<V>>(), {
|
|
10
|
+
cssClass: () => [],
|
|
11
|
+
cssStyle: () => ({}),
|
|
12
|
+
contentCssClass: () => [],
|
|
13
|
+
contentCssStyle: () => ({}),
|
|
14
|
+
confirmButton: true,
|
|
15
|
+
cancelButton: true,
|
|
16
|
+
confirmButtonText: 'Done',
|
|
17
|
+
cancelButtonText: 'Cancel',
|
|
18
|
+
confirmButtonColor: 'var(--color-text-button-primary-default)',
|
|
19
|
+
cancelButtonColor: 'var(--color-text-button-secondary-default)',
|
|
20
|
+
confirmButtonBackground: 'var(--color-bg-button-primary-default)',
|
|
21
|
+
cancelButtonBackground: 'var(--color-bg-button-secondary-default)',
|
|
22
|
+
isValid: true,
|
|
23
|
+
});
|
|
24
|
+
const emits = defineEmits<Ui3nDialogComponentEmits<V, E>>();
|
|
27
25
|
defineSlots<Ui3nDialogComponentSlots>();
|
|
28
26
|
|
|
29
27
|
const dialogElement = useTemplateRef('dialog-el');
|
|
@@ -105,22 +103,13 @@
|
|
|
105
103
|
|
|
106
104
|
onMounted(() => {
|
|
107
105
|
if (dialogElement.value) {
|
|
108
|
-
dialogElement.value.style.setProperty(
|
|
109
|
-
|
|
110
|
-
props.confirmButtonColor,
|
|
111
|
-
);
|
|
112
|
-
dialogElement.value.style.setProperty(
|
|
113
|
-
'--ui3n-dialog-cancel-button-color',
|
|
114
|
-
props.cancelButtonColor,
|
|
115
|
-
);
|
|
106
|
+
dialogElement.value.style.setProperty('--ui3n-dialog-confirm-button-color', props.confirmButtonColor);
|
|
107
|
+
dialogElement.value.style.setProperty('--ui3n-dialog-cancel-button-color', props.cancelButtonColor);
|
|
116
108
|
dialogElement.value.style.setProperty(
|
|
117
109
|
'--ui3n-dialog-confirm-background-color',
|
|
118
110
|
props.confirmButtonBackground,
|
|
119
111
|
);
|
|
120
|
-
dialogElement.value.style.setProperty(
|
|
121
|
-
'--ui3n-dialog-cancel-background-color',
|
|
122
|
-
props.cancelButtonBackground,
|
|
123
|
-
);
|
|
112
|
+
dialogElement.value.style.setProperty('--ui3n-dialog-cancel-background-color', props.cancelButtonBackground);
|
|
124
113
|
|
|
125
114
|
nextTick(() => {
|
|
126
115
|
dialogElement.value!.focus();
|
|
@@ -145,12 +134,12 @@
|
|
|
145
134
|
v-on="
|
|
146
135
|
draggable
|
|
147
136
|
? {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
137
|
+
dragstart: onDragstart,
|
|
138
|
+
mousedown: onMousedown,
|
|
139
|
+
mouseup: onMouseup,
|
|
140
|
+
mousemove: onMousemove,
|
|
141
|
+
keydown: onKeydown,
|
|
142
|
+
}
|
|
154
143
|
: { keydown: onKeydown }
|
|
155
144
|
"
|
|
156
145
|
>
|
|
@@ -242,7 +231,7 @@
|
|
|
242
231
|
@use '../../assets/styles/mixins' as mixins;
|
|
243
232
|
|
|
244
233
|
.dialog {
|
|
245
|
-
--ui3n-dialog-border-radius:
|
|
234
|
+
--ui3n-dialog-border-radius: 12px;
|
|
246
235
|
--ui3n-dialog-title-height: 48px;
|
|
247
236
|
--ui3n-dialog-title-padding: 0 32px 0 16px;
|
|
248
237
|
--ui3n-dialog-title-font-size: 14px;
|
|
@@ -260,9 +249,12 @@
|
|
|
260
249
|
min-height: var(--spacing-xxl);
|
|
261
250
|
max-height: 95%;
|
|
262
251
|
background-color: var(--color-bg-block-primary-default);
|
|
252
|
+
border: 1px solid var(--color-border-block-primary-default);
|
|
263
253
|
border-radius: var(--ui3n-dialog-border-radius);
|
|
264
254
|
outline: none;
|
|
265
|
-
|
|
255
|
+
box-shadow:
|
|
256
|
+
0 5px 15px -3px var(--shadow-key-2),
|
|
257
|
+
0 2px 10px -1px var(--shadow-key-3);
|
|
266
258
|
|
|
267
259
|
&.draggable {
|
|
268
260
|
cursor: move;
|