@v1nt1248/3nclient-lib 0.2.82 → 0.2.83
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 +13 -13
- package/dist/components/ui3n-dialog/ui3n-dialog.vue.d.ts +9 -9
- package/dist/index.d.ts +2 -2
- package/dist/plugins/dialogs/dialogs.d.ts +1 -1
- package/dist/plugins/dialogs/store-dialogs.d.ts +1 -1
- package/dist/plugins/dialogs/types.d.ts +1 -1
- package/dist/ui3n-plugins.d.ts +2 -2
- package/dist/ui3n-plugins.js +1 -0
- package/package.json +1 -1
- package/src/components/ui3n-dialog/types.ts +13 -15
- package/src/components/ui3n-dialog/ui3n-dialog.vue +5 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Component } from '../../../vue/dist/vue.esm-bundler.js';
|
|
2
2
|
import { ExtractComponentProps, Ui3nIconField } from '../../types';
|
|
3
3
|
export type Ui3nDialogEvent = 'open' | 'before-close' | 'close' | 'confirm' | 'cancel' | 'click-overlay';
|
|
4
|
-
export interface Ui3nDialogProps<
|
|
4
|
+
export interface Ui3nDialogProps<V> {
|
|
5
5
|
id?: string;
|
|
6
6
|
title?: string;
|
|
7
7
|
icon?: string | Ui3nIconField;
|
|
@@ -13,9 +13,9 @@ export interface Ui3nDialogProps<ConfirmData = unknown, CancelData = unknown, Cl
|
|
|
13
13
|
contentCssStyle?: Record<string, string>;
|
|
14
14
|
confirmButton?: boolean;
|
|
15
15
|
cancelButton?: boolean;
|
|
16
|
-
onClose?: (data?:
|
|
17
|
-
onConfirm?: (data:
|
|
18
|
-
onCancel?: (data:
|
|
16
|
+
onClose?: (data?: V) => void;
|
|
17
|
+
onConfirm?: (data: V) => void;
|
|
18
|
+
onCancel?: (data: V) => void;
|
|
19
19
|
confirmButtonText?: string;
|
|
20
20
|
cancelButtonText?: string;
|
|
21
21
|
confirmButtonColor?: string;
|
|
@@ -25,16 +25,16 @@ export interface Ui3nDialogProps<ConfirmData = unknown, CancelData = unknown, Cl
|
|
|
25
25
|
closeOnClickOverlay?: boolean;
|
|
26
26
|
closeOnEsc?: boolean;
|
|
27
27
|
}
|
|
28
|
-
export interface Ui3nDialogComponentProps<T extends Component,
|
|
28
|
+
export interface Ui3nDialogComponentProps<T extends Component, V> {
|
|
29
29
|
component: T;
|
|
30
30
|
componentProps?: ExtractComponentProps<T>;
|
|
31
|
-
dialogProps?: Ui3nDialogProps<
|
|
31
|
+
dialogProps?: Ui3nDialogProps<V>;
|
|
32
32
|
}
|
|
33
|
-
export interface Ui3nDialogComponentEmits {
|
|
34
|
-
(ev: 'open', value?:
|
|
35
|
-
(ev: 'before-close', value?:
|
|
36
|
-
(ev: 'close', value?:
|
|
37
|
-
(ev: 'confirm', value?:
|
|
38
|
-
(ev: 'cancel', value?:
|
|
39
|
-
(ev: 'click-overlay', value?:
|
|
33
|
+
export interface Ui3nDialogComponentEmits<V> {
|
|
34
|
+
(ev: 'open', value?: V): void;
|
|
35
|
+
(ev: 'before-close', value?: V): void;
|
|
36
|
+
(ev: 'close', value?: V): void;
|
|
37
|
+
(ev: 'confirm', value?: V): void;
|
|
38
|
+
(ev: 'cancel', value?: V): void;
|
|
39
|
+
(ev: 'click-overlay', value?: V): void;
|
|
40
40
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Component } from '../../../vue/dist/vue.esm-bundler.js';
|
|
2
2
|
import { Ui3nDialogComponentProps, Ui3nDialogComponentEmits } from './types';
|
|
3
|
-
declare const _default: <T extends Component>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
declare const _default: <T extends Component, V>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
4
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
5
|
-
readonly onCancel?: ((value?:
|
|
6
|
-
readonly onClose?: ((value?:
|
|
7
|
-
readonly onOpen?: ((value?:
|
|
8
|
-
readonly "onBefore-close"?: ((value?:
|
|
9
|
-
readonly onConfirm?: ((value?:
|
|
10
|
-
readonly "onClick-overlay"?: ((value?:
|
|
11
|
-
} & import('../../../vue/dist/vue.esm-bundler.js').VNodeProps & import('../../../vue/dist/vue.esm-bundler.js').AllowedComponentProps & import('../../../vue/dist/vue.esm-bundler.js').ComponentCustomProps, never>, "onClose" | "onCancel" | "onOpen" | "onBefore-close" | "onConfirm" | "onClick-overlay"> & Ui3nDialogComponentProps<T,
|
|
5
|
+
readonly onCancel?: ((value?: V | undefined) => any) | undefined;
|
|
6
|
+
readonly onClose?: ((value?: V | undefined) => any) | undefined;
|
|
7
|
+
readonly onOpen?: ((value?: V | undefined) => any) | undefined;
|
|
8
|
+
readonly "onBefore-close"?: ((value?: V | undefined) => any) | undefined;
|
|
9
|
+
readonly onConfirm?: ((value?: V | undefined) => any) | undefined;
|
|
10
|
+
readonly "onClick-overlay"?: ((value?: V | undefined) => any) | undefined;
|
|
11
|
+
} & import('../../../vue/dist/vue.esm-bundler.js').VNodeProps & import('../../../vue/dist/vue.esm-bundler.js').AllowedComponentProps & import('../../../vue/dist/vue.esm-bundler.js').ComponentCustomProps, never>, "onClose" | "onCancel" | "onOpen" | "onBefore-close" | "onConfirm" | "onClick-overlay"> & Ui3nDialogComponentProps<T, V> & Partial<{}>> & import('../../../vue/dist/vue.esm-bundler.js').PublicProps;
|
|
12
12
|
expose(exposed: import('../../../vue/dist/vue.esm-bundler.js').ShallowUnwrapRef<{}>): void;
|
|
13
13
|
attrs: any;
|
|
14
14
|
slots: {};
|
|
15
|
-
emit: Ui3nDialogComponentEmits
|
|
15
|
+
emit: Ui3nDialogComponentEmits<V>;
|
|
16
16
|
}>) => import('../../../vue/dist/vue.esm-bundler.js').VNode & {
|
|
17
17
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
18
18
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export * from './components';
|
|
|
46
46
|
export * from './types';
|
|
47
47
|
declare module '../vue/dist/vue.esm-bundler.js' {
|
|
48
48
|
interface ComponentCustomProperties {
|
|
49
|
-
$openDialog: <T extends Component>(params: Ui3nDialogComponentProps<T>) => DialogInstance | undefined;
|
|
49
|
+
$openDialog: <T extends Component, V>(params: Ui3nDialogComponentProps<T, V>) => DialogInstance | undefined;
|
|
50
50
|
$closeDialog: (id: string) => void;
|
|
51
51
|
$closeDialogs: () => void;
|
|
52
52
|
$createNotice: (params: Ui3nNotificationProps) => void;
|
|
@@ -97,7 +97,7 @@ declare module '../vue/dist/vue.esm-bundler.js' {
|
|
|
97
97
|
}
|
|
98
98
|
declare module 'pinia' {
|
|
99
99
|
interface PiniaCustomProperties {
|
|
100
|
-
$openDialog: <T extends Component>(params: Ui3nDialogComponentProps<T>) => DialogInstance | undefined;
|
|
100
|
+
$openDialog: <T extends Component, V>(params: Ui3nDialogComponentProps<T, V>) => DialogInstance | undefined;
|
|
101
101
|
$closeDialog: (id: string) => void;
|
|
102
102
|
$closeDialogs: () => void;
|
|
103
103
|
$createNotice: (params: Ui3nNotificationProps) => void;
|
|
@@ -4,7 +4,7 @@ import { DialogInstance } from './types';
|
|
|
4
4
|
export declare const dialogs: Plugin;
|
|
5
5
|
declare module '@vue/runtime-core' {
|
|
6
6
|
interface ComponentCustomProperties {
|
|
7
|
-
$openDialog: <T extends Component>(params: Ui3nDialogComponentProps<T>) => DialogInstance | undefined;
|
|
7
|
+
$openDialog: <T extends Component, V>(params: Ui3nDialogComponentProps<T, V>) => DialogInstance | undefined;
|
|
8
8
|
$closeDialog: (id: string) => void;
|
|
9
9
|
$closeDialogs: () => void;
|
|
10
10
|
}
|
|
@@ -3,7 +3,7 @@ import { Ui3nDialogComponentProps } from '../../components/ui3n-dialog/types';
|
|
|
3
3
|
import { DialogInstance } from './types';
|
|
4
4
|
export declare function storeDialogs(context: any): {
|
|
5
5
|
$dialogs: {
|
|
6
|
-
open: <T extends Component>(params: Ui3nDialogComponentProps<T>) => DialogInstance | undefined;
|
|
6
|
+
open: <T extends Component, V>(params: Ui3nDialogComponentProps<T, V>) => DialogInstance | undefined;
|
|
7
7
|
close: (id: string) => void;
|
|
8
8
|
closeAll: () => void;
|
|
9
9
|
};
|
|
@@ -7,7 +7,7 @@ export type DialogInstance = {
|
|
|
7
7
|
destroy: () => void;
|
|
8
8
|
};
|
|
9
9
|
export interface DialogsPlugin {
|
|
10
|
-
$openDialog: <T extends Component>(params: Ui3nDialogComponentProps<T>) => DialogInstance | undefined;
|
|
10
|
+
$openDialog: <T extends Component, V>(params: Ui3nDialogComponentProps<T, V>) => DialogInstance | undefined;
|
|
11
11
|
$closeDialog: (id: string) => void;
|
|
12
12
|
$closeDialogs: () => void;
|
|
13
13
|
}
|
package/dist/ui3n-plugins.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { Ui3nDialogComponentProps } from './components';
|
|
|
6
6
|
import { VUEBUS_KEY, CbFunction, VueEventBus, VueBusPlugin } from './plugins/vue-bus/types';
|
|
7
7
|
declare module '../vue/dist/vue.esm-bundler.js' {
|
|
8
8
|
interface ComponentCustomProperties {
|
|
9
|
-
$openDialog: <T extends Component>(params: Ui3nDialogComponentProps<T>) => DialogInstance | undefined;
|
|
9
|
+
$openDialog: <T extends Component, V>(params: Ui3nDialogComponentProps<T, V>) => DialogInstance | undefined;
|
|
10
10
|
$closeDialog: (id: string) => void;
|
|
11
11
|
$closeDialogs: () => void;
|
|
12
12
|
$createNotice: (params: Ui3nNotificationProps) => void;
|
|
@@ -26,7 +26,7 @@ declare module 'pinia' {
|
|
|
26
26
|
tr: (key: string, placeholders?: Record<string, string>) => string;
|
|
27
27
|
};
|
|
28
28
|
$dialogs: {
|
|
29
|
-
open: <T extends Component>(params: Ui3nDialogComponentProps<T>) => DialogInstance | undefined;
|
|
29
|
+
open: <T extends Component, V>(params: Ui3nDialogComponentProps<T, V>) => DialogInstance | undefined;
|
|
30
30
|
close: (id: string) => void;
|
|
31
31
|
closeAll: () => void;
|
|
32
32
|
};
|
package/dist/ui3n-plugins.js
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import type { ExtractComponentProps, Ui3nIconField } from '@/types';
|
|
|
3
3
|
|
|
4
4
|
export type Ui3nDialogEvent = 'open' | 'before-close' | 'close' | 'confirm' | 'cancel' | 'click-overlay';
|
|
5
5
|
|
|
6
|
-
export interface Ui3nDialogProps<
|
|
6
|
+
export interface Ui3nDialogProps<V> {
|
|
7
7
|
id?: string;
|
|
8
8
|
title?: string;
|
|
9
9
|
icon?: string | Ui3nIconField;
|
|
@@ -15,9 +15,9 @@ export interface Ui3nDialogProps<ConfirmData = unknown, CancelData = unknown, Cl
|
|
|
15
15
|
contentCssStyle?: Record<string, string>;
|
|
16
16
|
confirmButton?: boolean;
|
|
17
17
|
cancelButton?: boolean;
|
|
18
|
-
onClose?: (data?:
|
|
19
|
-
onConfirm?: (data:
|
|
20
|
-
onCancel?: (data:
|
|
18
|
+
onClose?: (data?: V) => void;
|
|
19
|
+
onConfirm?: (data: V) => void;
|
|
20
|
+
onCancel?: (data: V) => void;
|
|
21
21
|
confirmButtonText?: string;
|
|
22
22
|
cancelButtonText?: string;
|
|
23
23
|
confirmButtonColor?: string;
|
|
@@ -28,19 +28,17 @@ export interface Ui3nDialogProps<ConfirmData = unknown, CancelData = unknown, Cl
|
|
|
28
28
|
closeOnEsc?: boolean;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export interface Ui3nDialogComponentProps<
|
|
32
|
-
T extends Component, ConfirmData = unknown, CancelData = unknown, CloseData = unknown
|
|
33
|
-
> {
|
|
31
|
+
export interface Ui3nDialogComponentProps<T extends Component, V> {
|
|
34
32
|
component: T;
|
|
35
33
|
componentProps?: ExtractComponentProps<T>;
|
|
36
|
-
dialogProps?: Ui3nDialogProps<
|
|
34
|
+
dialogProps?: Ui3nDialogProps<V>;
|
|
37
35
|
}
|
|
38
36
|
|
|
39
|
-
export interface Ui3nDialogComponentEmits {
|
|
40
|
-
(ev: 'open', value?:
|
|
41
|
-
(ev: 'before-close', value?:
|
|
42
|
-
(ev: 'close', value?:
|
|
43
|
-
(ev: 'confirm', value?:
|
|
44
|
-
(ev: 'cancel', value?:
|
|
45
|
-
(ev: 'click-overlay', value?:
|
|
37
|
+
export interface Ui3nDialogComponentEmits<V> {
|
|
38
|
+
(ev: 'open', value?: V): void;
|
|
39
|
+
(ev: 'before-close', value?: V): void;
|
|
40
|
+
(ev: 'close', value?: V): void;
|
|
41
|
+
(ev: 'confirm', value?: V): void;
|
|
42
|
+
(ev: 'cancel', value?: V): void;
|
|
43
|
+
(ev: 'click-overlay', value?: V): void;
|
|
46
44
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script lang="ts" setup generic="T extends Component">
|
|
1
|
+
<script lang="ts" setup generic="T extends Component, V">
|
|
2
2
|
import { type Component, computed, nextTick, onMounted, ref } from 'vue';
|
|
3
3
|
import omit from 'lodash/omit';
|
|
4
4
|
import Ui3nButton from '../ui3n-button/ui3n-button.vue';
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
import { ExtractComponentProps } from '@/types';
|
|
8
8
|
import { determineWindowWidth } from './util';
|
|
9
9
|
|
|
10
|
-
const props = defineProps<Ui3nDialogComponentProps<T>>();
|
|
11
|
-
const emits = defineEmits<Ui3nDialogComponentEmits
|
|
10
|
+
const props = defineProps<Ui3nDialogComponentProps<T, V>>();
|
|
11
|
+
const emits = defineEmits<Ui3nDialogComponentEmits<V>>();
|
|
12
12
|
|
|
13
13
|
const currentDialogProps = computed(() => ({
|
|
14
14
|
title: props.dialogProps?.title || '',
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
}));
|
|
34
34
|
|
|
35
35
|
const show = ref(true);
|
|
36
|
-
const data = ref<
|
|
36
|
+
const data = ref<V | null>(null);
|
|
37
37
|
const isValid = ref(true);
|
|
38
38
|
const dialogOverlayElement = ref<HTMLElement | null>(null);
|
|
39
39
|
const dialogElement = ref<HTMLDivElement | null>(null);
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
};
|
|
77
77
|
});
|
|
78
78
|
|
|
79
|
-
function selectData(value:
|
|
79
|
+
function selectData(value: V) {
|
|
80
80
|
data.value = value;
|
|
81
81
|
if (
|
|
82
82
|
!currentDialogProps.value.confirmButton &&
|