@uzum-tech/ui 2.0.1 → 2.0.3
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/index.js +319 -92
- package/dist/index.mjs +319 -92
- package/dist/index.prod.js +2 -2
- package/dist/index.prod.mjs +2 -2
- package/es/chat/src/ChatParts/MainArea.mjs +3 -1
- package/es/components.d.ts +51 -0
- package/es/input-number/src/InputNumber.d.ts +14 -0
- package/es/input-number/src/InputNumber.mjs +121 -48
- package/es/input-number/src/constants.d.ts +14 -0
- package/es/input-number/src/constants.mjs +15 -0
- package/es/input-number/src/interface.d.ts +4 -0
- package/es/input-number/src/utils.d.ts +12 -0
- package/es/input-number/src/utils.mjs +89 -1
- package/es/mapping-card/src/MappingCardList.d.ts +2 -0
- package/es/mapping-card/src/MappingCardList.mjs +11 -2
- package/es/mapping-card/src/interface.d.ts +3 -0
- package/es/mapping-card/src/interface.mjs +2 -1
- package/es/mapping-card/src/styles/index.cssr.mjs +8 -1
- package/es/modal/src/BodyWrapper.d.ts +39 -0
- package/es/modal/src/Modal.d.ts +56 -0
- package/es/modal/src/ModalEnvironment.d.ts +39 -0
- package/es/modal/src/presetProps.d.ts +18 -1
- package/es/modal/src/presetProps.mjs +2 -1
- package/es/notification/src/NotificationEnvironment.d.ts +4 -0
- package/es/notification/src/NotificationEnvironment.mjs +45 -9
- package/es/notification/src/NotificationProvider.d.ts +2 -0
- package/es/notification/src/styles/index.cssr.d.ts +1 -2
- package/es/notification/src/styles/index.cssr.mjs +13 -23
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/lib/chat/src/ChatParts/MainArea.js +45 -43
- package/lib/components.d.ts +51 -0
- package/lib/input-number/src/InputNumber.d.ts +14 -0
- package/lib/input-number/src/InputNumber.js +128 -51
- package/lib/input-number/src/constants.d.ts +14 -0
- package/lib/input-number/src/constants.js +18 -0
- package/lib/input-number/src/interface.d.ts +4 -0
- package/lib/input-number/src/utils.d.ts +12 -0
- package/lib/input-number/src/utils.js +112 -1
- package/lib/mapping-card/src/MappingCardList.d.ts +2 -0
- package/lib/mapping-card/src/MappingCardList.js +9 -4
- package/lib/mapping-card/src/interface.d.ts +3 -0
- package/lib/mapping-card/src/interface.js +2 -1
- package/lib/mapping-card/src/styles/index.cssr.js +8 -1
- package/lib/modal/src/BodyWrapper.d.ts +39 -0
- package/lib/modal/src/Modal.d.ts +56 -0
- package/lib/modal/src/ModalEnvironment.d.ts +39 -0
- package/lib/modal/src/presetProps.d.ts +18 -1
- package/lib/modal/src/presetProps.js +2 -1
- package/lib/notification/src/NotificationEnvironment.d.ts +4 -0
- package/lib/notification/src/NotificationEnvironment.js +46 -9
- package/lib/notification/src/NotificationProvider.d.ts +2 -0
- package/lib/notification/src/styles/index.cssr.d.ts +1 -2
- package/lib/notification/src/styles/index.cssr.js +13 -23
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +4 -1
- package/web-types.json +8 -1
|
@@ -87,6 +87,13 @@ export default c([cB('mapping-card', `
|
|
|
87
87
|
color: var(--u-arrow-color);
|
|
88
88
|
font-size: 16px;
|
|
89
89
|
flex-shrink: 0;
|
|
90
|
-
`)]), cB('mapping-card-list',
|
|
90
|
+
`)]), cB('mapping-card-list', `
|
|
91
|
+
display: flex;
|
|
92
|
+
justify-content: space-between;
|
|
93
|
+
flex-direction: column;
|
|
94
|
+
height: 100%;
|
|
95
|
+
`, [cE('pagination', `
|
|
91
96
|
margin-top: 16px;
|
|
97
|
+
`), cE('empty', `
|
|
98
|
+
margin: auto;
|
|
92
99
|
`)])]);
|
|
@@ -55,6 +55,23 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
55
55
|
loading: BooleanConstructor;
|
|
56
56
|
bordered: BooleanConstructor;
|
|
57
57
|
iconPlacement: PropType<import("../../dialog/src/interface").IconPlacement>;
|
|
58
|
+
contentClass: StringConstructor;
|
|
59
|
+
contentScrollable: BooleanConstructor;
|
|
60
|
+
contentStyle: PropType<import("vue").CSSProperties | string>;
|
|
61
|
+
headerStyle: PropType<import("vue").CSSProperties | string>;
|
|
62
|
+
headerExtraStyle: PropType<import("vue").CSSProperties | string>;
|
|
63
|
+
footerStyle: PropType<import("vue").CSSProperties | string>;
|
|
64
|
+
embedded: BooleanConstructor;
|
|
65
|
+
segmented: {
|
|
66
|
+
readonly type: PropType<boolean | import("../..").CardSegmented>;
|
|
67
|
+
readonly default: false;
|
|
68
|
+
};
|
|
69
|
+
hoverable: BooleanConstructor;
|
|
70
|
+
role: StringConstructor;
|
|
71
|
+
tag: {
|
|
72
|
+
readonly type: PropType<keyof HTMLElementTagNameMap>;
|
|
73
|
+
readonly default: "div";
|
|
74
|
+
};
|
|
58
75
|
show: {
|
|
59
76
|
type: BooleanConstructor;
|
|
60
77
|
required: true;
|
|
@@ -1283,6 +1300,23 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1283
1300
|
loading: BooleanConstructor;
|
|
1284
1301
|
bordered: BooleanConstructor;
|
|
1285
1302
|
iconPlacement: PropType<import("../../dialog/src/interface").IconPlacement>;
|
|
1303
|
+
contentClass: StringConstructor;
|
|
1304
|
+
contentScrollable: BooleanConstructor;
|
|
1305
|
+
contentStyle: PropType<import("vue").CSSProperties | string>;
|
|
1306
|
+
headerStyle: PropType<import("vue").CSSProperties | string>;
|
|
1307
|
+
headerExtraStyle: PropType<import("vue").CSSProperties | string>;
|
|
1308
|
+
footerStyle: PropType<import("vue").CSSProperties | string>;
|
|
1309
|
+
embedded: BooleanConstructor;
|
|
1310
|
+
segmented: {
|
|
1311
|
+
readonly type: PropType<boolean | import("../..").CardSegmented>;
|
|
1312
|
+
readonly default: false;
|
|
1313
|
+
};
|
|
1314
|
+
hoverable: BooleanConstructor;
|
|
1315
|
+
role: StringConstructor;
|
|
1316
|
+
tag: {
|
|
1317
|
+
readonly type: PropType<keyof HTMLElementTagNameMap>;
|
|
1318
|
+
readonly default: "div";
|
|
1319
|
+
};
|
|
1286
1320
|
show: {
|
|
1287
1321
|
type: BooleanConstructor;
|
|
1288
1322
|
required: true;
|
|
@@ -1310,8 +1344,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1310
1344
|
type: "default" | "error" | "warning" | "success" | "info";
|
|
1311
1345
|
size: "small" | "medium" | "large";
|
|
1312
1346
|
loading: boolean;
|
|
1347
|
+
tag: keyof HTMLElementTagNameMap;
|
|
1313
1348
|
showIcon: boolean;
|
|
1314
1349
|
closable: boolean;
|
|
1350
|
+
contentScrollable: boolean;
|
|
1351
|
+
embedded: boolean;
|
|
1352
|
+
segmented: boolean | import("../..").CardSegmented;
|
|
1353
|
+
hoverable: boolean;
|
|
1315
1354
|
draggable: boolean | ModalDraggableOptions;
|
|
1316
1355
|
trapFocus: boolean;
|
|
1317
1356
|
autoFocus: boolean;
|
package/es/modal/src/Modal.d.ts
CHANGED
|
@@ -51,6 +51,23 @@ export declare const modalProps: {
|
|
|
51
51
|
loading: BooleanConstructor;
|
|
52
52
|
bordered: BooleanConstructor;
|
|
53
53
|
iconPlacement: PropType<import("../../dialog/src/interface").IconPlacement>;
|
|
54
|
+
contentClass: StringConstructor;
|
|
55
|
+
contentScrollable: BooleanConstructor;
|
|
56
|
+
contentStyle: PropType<CSSProperties | string>;
|
|
57
|
+
headerStyle: PropType<CSSProperties | string>;
|
|
58
|
+
headerExtraStyle: PropType<CSSProperties | string>;
|
|
59
|
+
footerStyle: PropType<CSSProperties | string>;
|
|
60
|
+
embedded: BooleanConstructor;
|
|
61
|
+
segmented: {
|
|
62
|
+
readonly type: PropType<boolean | import("../..").CardSegmented>;
|
|
63
|
+
readonly default: false;
|
|
64
|
+
};
|
|
65
|
+
hoverable: BooleanConstructor;
|
|
66
|
+
role: StringConstructor;
|
|
67
|
+
tag: {
|
|
68
|
+
readonly type: PropType<keyof HTMLElementTagNameMap>;
|
|
69
|
+
readonly default: "div";
|
|
70
|
+
};
|
|
54
71
|
show: BooleanConstructor;
|
|
55
72
|
unstableShowMask: {
|
|
56
73
|
type: BooleanConstructor;
|
|
@@ -1097,6 +1114,23 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1097
1114
|
loading: BooleanConstructor;
|
|
1098
1115
|
bordered: BooleanConstructor;
|
|
1099
1116
|
iconPlacement: PropType<import("../../dialog/src/interface").IconPlacement>;
|
|
1117
|
+
contentClass: StringConstructor;
|
|
1118
|
+
contentScrollable: BooleanConstructor;
|
|
1119
|
+
contentStyle: PropType<CSSProperties | string>;
|
|
1120
|
+
headerStyle: PropType<CSSProperties | string>;
|
|
1121
|
+
headerExtraStyle: PropType<CSSProperties | string>;
|
|
1122
|
+
footerStyle: PropType<CSSProperties | string>;
|
|
1123
|
+
embedded: BooleanConstructor;
|
|
1124
|
+
segmented: {
|
|
1125
|
+
readonly type: PropType<boolean | import("../..").CardSegmented>;
|
|
1126
|
+
readonly default: false;
|
|
1127
|
+
};
|
|
1128
|
+
hoverable: BooleanConstructor;
|
|
1129
|
+
role: StringConstructor;
|
|
1130
|
+
tag: {
|
|
1131
|
+
readonly type: PropType<keyof HTMLElementTagNameMap>;
|
|
1132
|
+
readonly default: "div";
|
|
1133
|
+
};
|
|
1100
1134
|
show: BooleanConstructor;
|
|
1101
1135
|
unstableShowMask: {
|
|
1102
1136
|
type: BooleanConstructor;
|
|
@@ -2159,6 +2193,23 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
2159
2193
|
loading: BooleanConstructor;
|
|
2160
2194
|
bordered: BooleanConstructor;
|
|
2161
2195
|
iconPlacement: PropType<import("../../dialog/src/interface").IconPlacement>;
|
|
2196
|
+
contentClass: StringConstructor;
|
|
2197
|
+
contentScrollable: BooleanConstructor;
|
|
2198
|
+
contentStyle: PropType<CSSProperties | string>;
|
|
2199
|
+
headerStyle: PropType<CSSProperties | string>;
|
|
2200
|
+
headerExtraStyle: PropType<CSSProperties | string>;
|
|
2201
|
+
footerStyle: PropType<CSSProperties | string>;
|
|
2202
|
+
embedded: BooleanConstructor;
|
|
2203
|
+
segmented: {
|
|
2204
|
+
readonly type: PropType<boolean | import("../..").CardSegmented>;
|
|
2205
|
+
readonly default: false;
|
|
2206
|
+
};
|
|
2207
|
+
hoverable: BooleanConstructor;
|
|
2208
|
+
role: StringConstructor;
|
|
2209
|
+
tag: {
|
|
2210
|
+
readonly type: PropType<keyof HTMLElementTagNameMap>;
|
|
2211
|
+
readonly default: "div";
|
|
2212
|
+
};
|
|
2162
2213
|
show: BooleanConstructor;
|
|
2163
2214
|
unstableShowMask: {
|
|
2164
2215
|
type: BooleanConstructor;
|
|
@@ -3155,9 +3206,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
3155
3206
|
type: "default" | "error" | "warning" | "success" | "info";
|
|
3156
3207
|
size: "small" | "medium" | "large";
|
|
3157
3208
|
loading: boolean;
|
|
3209
|
+
tag: keyof HTMLElementTagNameMap;
|
|
3158
3210
|
showIcon: boolean;
|
|
3159
3211
|
closable: boolean;
|
|
3160
3212
|
show: boolean;
|
|
3213
|
+
contentScrollable: boolean;
|
|
3214
|
+
embedded: boolean;
|
|
3215
|
+
segmented: boolean | import("../..").CardSegmented;
|
|
3216
|
+
hoverable: boolean;
|
|
3161
3217
|
displayDirective: "show" | "if";
|
|
3162
3218
|
maskClosable: boolean;
|
|
3163
3219
|
trapFocus: boolean;
|
|
@@ -55,6 +55,23 @@ export declare const UModalEnvironment: import("vue").DefineComponent<import("vu
|
|
|
55
55
|
loading: BooleanConstructor;
|
|
56
56
|
bordered: BooleanConstructor;
|
|
57
57
|
iconPlacement: PropType<import("../../dialog/src/interface").IconPlacement>;
|
|
58
|
+
contentClass: StringConstructor;
|
|
59
|
+
contentScrollable: BooleanConstructor;
|
|
60
|
+
contentStyle: PropType<import("vue").CSSProperties | string>;
|
|
61
|
+
headerStyle: PropType<import("vue").CSSProperties | string>;
|
|
62
|
+
headerExtraStyle: PropType<import("vue").CSSProperties | string>;
|
|
63
|
+
footerStyle: PropType<import("vue").CSSProperties | string>;
|
|
64
|
+
embedded: BooleanConstructor;
|
|
65
|
+
segmented: {
|
|
66
|
+
readonly type: PropType<boolean | import("../..").CardSegmented>;
|
|
67
|
+
readonly default: false;
|
|
68
|
+
};
|
|
69
|
+
hoverable: BooleanConstructor;
|
|
70
|
+
role: StringConstructor;
|
|
71
|
+
tag: {
|
|
72
|
+
readonly type: PropType<keyof HTMLElementTagNameMap>;
|
|
73
|
+
readonly default: "div";
|
|
74
|
+
};
|
|
58
75
|
show: BooleanConstructor;
|
|
59
76
|
unstableShowMask: {
|
|
60
77
|
type: BooleanConstructor;
|
|
@@ -1112,6 +1129,23 @@ export declare const UModalEnvironment: import("vue").DefineComponent<import("vu
|
|
|
1112
1129
|
loading: BooleanConstructor;
|
|
1113
1130
|
bordered: BooleanConstructor;
|
|
1114
1131
|
iconPlacement: PropType<import("../../dialog/src/interface").IconPlacement>;
|
|
1132
|
+
contentClass: StringConstructor;
|
|
1133
|
+
contentScrollable: BooleanConstructor;
|
|
1134
|
+
contentStyle: PropType<import("vue").CSSProperties | string>;
|
|
1135
|
+
headerStyle: PropType<import("vue").CSSProperties | string>;
|
|
1136
|
+
headerExtraStyle: PropType<import("vue").CSSProperties | string>;
|
|
1137
|
+
footerStyle: PropType<import("vue").CSSProperties | string>;
|
|
1138
|
+
embedded: BooleanConstructor;
|
|
1139
|
+
segmented: {
|
|
1140
|
+
readonly type: PropType<boolean | import("../..").CardSegmented>;
|
|
1141
|
+
readonly default: false;
|
|
1142
|
+
};
|
|
1143
|
+
hoverable: BooleanConstructor;
|
|
1144
|
+
role: StringConstructor;
|
|
1145
|
+
tag: {
|
|
1146
|
+
readonly type: PropType<keyof HTMLElementTagNameMap>;
|
|
1147
|
+
readonly default: "div";
|
|
1148
|
+
};
|
|
1115
1149
|
show: BooleanConstructor;
|
|
1116
1150
|
unstableShowMask: {
|
|
1117
1151
|
type: BooleanConstructor;
|
|
@@ -2108,9 +2142,14 @@ export declare const UModalEnvironment: import("vue").DefineComponent<import("vu
|
|
|
2108
2142
|
type: "default" | "error" | "warning" | "success" | "info";
|
|
2109
2143
|
size: "small" | "medium" | "large";
|
|
2110
2144
|
loading: boolean;
|
|
2145
|
+
tag: keyof HTMLElementTagNameMap;
|
|
2111
2146
|
showIcon: boolean;
|
|
2112
2147
|
closable: boolean;
|
|
2113
2148
|
show: boolean;
|
|
2149
|
+
contentScrollable: boolean;
|
|
2150
|
+
embedded: boolean;
|
|
2151
|
+
segmented: boolean | import("../..").CardSegmented;
|
|
2152
|
+
hoverable: boolean;
|
|
2114
2153
|
displayDirective: "show" | "if";
|
|
2115
2154
|
maskClosable: boolean;
|
|
2116
2155
|
trapFocus: boolean;
|
|
@@ -31,6 +31,23 @@ declare const presetProps: {
|
|
|
31
31
|
onPositiveClick: PropType<(e: MouseEvent) => void>;
|
|
32
32
|
onNegativeClick: PropType<(e: MouseEvent) => void>;
|
|
33
33
|
onClose: PropType<() => void>;
|
|
34
|
+
contentClass: StringConstructor;
|
|
35
|
+
contentScrollable: BooleanConstructor;
|
|
36
|
+
contentStyle: PropType<import("vue").CSSProperties | string>;
|
|
37
|
+
headerStyle: PropType<import("vue").CSSProperties | string>;
|
|
38
|
+
headerExtraStyle: PropType<import("vue").CSSProperties | string>;
|
|
39
|
+
footerStyle: PropType<import("vue").CSSProperties | string>;
|
|
40
|
+
embedded: BooleanConstructor;
|
|
41
|
+
segmented: {
|
|
42
|
+
readonly type: PropType<boolean | import("../..").CardSegmented>;
|
|
43
|
+
readonly default: false;
|
|
44
|
+
};
|
|
45
|
+
hoverable: BooleanConstructor;
|
|
46
|
+
role: StringConstructor;
|
|
47
|
+
tag: {
|
|
48
|
+
readonly type: PropType<keyof HTMLElementTagNameMap>;
|
|
49
|
+
readonly default: "div";
|
|
50
|
+
};
|
|
34
51
|
};
|
|
35
|
-
declare const presetPropsKeys: ("bordered" | "icon" | "type" | "content" | "body" | "title" | "size" | "positiveText" | "negativeText" | "loading" | "showIcon" | "closable" | "onClose" | "iconPlacement" | "positiveButtonProps" | "negativeButtonProps" | "action" | "onPositiveClick" | "onNegativeClick")[];
|
|
52
|
+
declare const presetPropsKeys: ("bordered" | "icon" | "type" | "content" | "body" | "title" | "size" | "positiveText" | "negativeText" | "loading" | "tag" | "showIcon" | "closable" | "onClose" | "contentClass" | "contentStyle" | "iconPlacement" | "contentScrollable" | "headerStyle" | "headerExtraStyle" | "footerStyle" | "embedded" | "segmented" | "hoverable" | "role" | "positiveButtonProps" | "negativeButtonProps" | "action" | "onPositiveClick" | "onNegativeClick")[];
|
|
36
53
|
export { presetProps, presetPropsKeys };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { keysOf } from "../../_utils/index.mjs";
|
|
2
|
+
import { cardBaseProps } from "../../card/src/Card.mjs";
|
|
2
3
|
import { dialogProps } from "../../dialog/src/dialogProps.mjs";
|
|
3
|
-
const presetProps = Object.assign(Object.assign({}, dialogProps), {
|
|
4
|
+
const presetProps = Object.assign(Object.assign(Object.assign({}, cardBaseProps), dialogProps), {
|
|
4
5
|
size: {
|
|
5
6
|
type: String,
|
|
6
7
|
default: 'medium'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
export declare const notificationEnvOptions: {
|
|
3
3
|
readonly duration: NumberConstructor;
|
|
4
|
+
readonly pauseOnVisibilityChange: BooleanConstructor;
|
|
4
5
|
readonly onClose: PropType<() => Promise<boolean> | boolean | any>;
|
|
5
6
|
readonly onLeave: PropType<() => void>;
|
|
6
7
|
readonly onAfterEnter: PropType<() => void>;
|
|
@@ -41,6 +42,7 @@ export declare const NotificationEnvironment: import("vue").DefineComponent<Extr
|
|
|
41
42
|
required: true;
|
|
42
43
|
};
|
|
43
44
|
duration: NumberConstructor;
|
|
45
|
+
pauseOnVisibilityChange: BooleanConstructor;
|
|
44
46
|
onClose: PropType<() => Promise<boolean> | boolean | any>;
|
|
45
47
|
onLeave: PropType<() => void>;
|
|
46
48
|
onAfterEnter: PropType<() => void>;
|
|
@@ -87,6 +89,7 @@ export declare const NotificationEnvironment: import("vue").DefineComponent<Extr
|
|
|
87
89
|
required: true;
|
|
88
90
|
};
|
|
89
91
|
duration: NumberConstructor;
|
|
92
|
+
pauseOnVisibilityChange: BooleanConstructor;
|
|
90
93
|
onClose: PropType<() => Promise<boolean> | boolean | any>;
|
|
91
94
|
onLeave: PropType<() => void>;
|
|
92
95
|
onAfterEnter: PropType<() => void>;
|
|
@@ -116,5 +119,6 @@ export declare const NotificationEnvironment: import("vue").DefineComponent<Extr
|
|
|
116
119
|
type: "default" | "error" | "warning" | "success" | "info" | "primary";
|
|
117
120
|
closable: boolean;
|
|
118
121
|
keepAliveOnHover: boolean;
|
|
122
|
+
pauseOnVisibilityChange: boolean;
|
|
119
123
|
hideIcon: boolean;
|
|
120
124
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { defineComponent, h, inject, nextTick, onMounted, ref, Transition } from 'vue';
|
|
1
|
+
import { defineComponent, h, inject, nextTick, onBeforeUnmount, onMounted, ref, Transition } from 'vue';
|
|
2
2
|
import { keep } from "../../_utils/index.mjs";
|
|
3
3
|
import { notificationProviderInjectionKey } from "./context.mjs";
|
|
4
4
|
import { Notification, notificationPropKeys, notificationProps } from "./Notification.mjs";
|
|
5
5
|
export const notificationEnvOptions = Object.assign(Object.assign({}, notificationProps), {
|
|
6
6
|
duration: Number,
|
|
7
|
+
pauseOnVisibilityChange: Boolean,
|
|
7
8
|
onClose: Function,
|
|
8
9
|
onLeave: Function,
|
|
9
10
|
onAfterEnter: Function,
|
|
@@ -34,10 +35,42 @@ export const NotificationEnvironment = defineComponent({
|
|
|
34
35
|
} = inject(notificationProviderInjectionKey);
|
|
35
36
|
const showRef = ref(true);
|
|
36
37
|
let timerId = null;
|
|
38
|
+
let remainingDuration = null;
|
|
39
|
+
let timerStartedAt = null;
|
|
40
|
+
let timerPausedForVisibility = false;
|
|
41
|
+
function clearTimer() {
|
|
42
|
+
if (timerId !== null) {
|
|
43
|
+
window.clearTimeout(timerId);
|
|
44
|
+
timerId = null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
37
47
|
function hide() {
|
|
38
48
|
showRef.value = false;
|
|
39
|
-
|
|
40
|
-
|
|
49
|
+
clearTimer();
|
|
50
|
+
}
|
|
51
|
+
function startTimer(duration) {
|
|
52
|
+
clearTimer();
|
|
53
|
+
remainingDuration = duration;
|
|
54
|
+
timerStartedAt = Date.now();
|
|
55
|
+
timerId = window.setTimeout(hide, duration);
|
|
56
|
+
}
|
|
57
|
+
function handleVisibilityChange() {
|
|
58
|
+
if (document.visibilityState === 'hidden') {
|
|
59
|
+
if (timerId !== null) {
|
|
60
|
+
clearTimer();
|
|
61
|
+
if (timerStartedAt !== null && remainingDuration !== null) {
|
|
62
|
+
remainingDuration = Math.max(0, remainingDuration - (Date.now() - timerStartedAt));
|
|
63
|
+
}
|
|
64
|
+
timerStartedAt = null;
|
|
65
|
+
timerPausedForVisibility = true;
|
|
66
|
+
}
|
|
67
|
+
} else if (timerPausedForVisibility) {
|
|
68
|
+
timerPausedForVisibility = false;
|
|
69
|
+
if (remainingDuration !== null && remainingDuration > 0) {
|
|
70
|
+
startTimer(remainingDuration);
|
|
71
|
+
} else {
|
|
72
|
+
hide();
|
|
73
|
+
}
|
|
41
74
|
}
|
|
42
75
|
}
|
|
43
76
|
function handleBeforeEnter(el) {
|
|
@@ -95,15 +128,12 @@ export const NotificationEnvironment = defineComponent({
|
|
|
95
128
|
duration
|
|
96
129
|
} = props;
|
|
97
130
|
if (duration) {
|
|
98
|
-
|
|
131
|
+
startTimer(duration);
|
|
99
132
|
}
|
|
100
133
|
}
|
|
101
134
|
function handleMouseenter(e) {
|
|
102
135
|
if (e.currentTarget !== e.target) return;
|
|
103
|
-
|
|
104
|
-
window.clearTimeout(timerId);
|
|
105
|
-
timerId = null;
|
|
106
|
-
}
|
|
136
|
+
clearTimer();
|
|
107
137
|
}
|
|
108
138
|
function handleMouseleave(e) {
|
|
109
139
|
if (e.currentTarget !== e.target) return;
|
|
@@ -124,9 +154,15 @@ export const NotificationEnvironment = defineComponent({
|
|
|
124
154
|
}
|
|
125
155
|
onMounted(() => {
|
|
126
156
|
if (props.duration) {
|
|
127
|
-
|
|
157
|
+
startTimer(props.duration);
|
|
158
|
+
}
|
|
159
|
+
if (props.pauseOnVisibilityChange) {
|
|
160
|
+
document.addEventListener('visibilitychange', handleVisibilityChange);
|
|
128
161
|
}
|
|
129
162
|
});
|
|
163
|
+
onBeforeUnmount(() => {
|
|
164
|
+
document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
165
|
+
});
|
|
130
166
|
return {
|
|
131
167
|
show: showRef,
|
|
132
168
|
hide,
|
|
@@ -741,6 +741,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
741
741
|
type?: "default" | "error" | "warning" | "success" | "info" | "primary" | undefined;
|
|
742
742
|
closable?: boolean | undefined;
|
|
743
743
|
keepAliveOnHover?: boolean | undefined;
|
|
744
|
+
pauseOnVisibilityChange?: boolean | undefined;
|
|
744
745
|
hideIcon?: boolean | undefined;
|
|
745
746
|
avatar?: (() => import("vue").VNodeChild) | undefined;
|
|
746
747
|
content?: string | (() => import("vue").VNodeChild) | undefined;
|
|
@@ -766,6 +767,7 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
766
767
|
type?: "default" | "error" | "warning" | "success" | "info" | "primary" | undefined;
|
|
767
768
|
closable?: boolean | undefined;
|
|
768
769
|
keepAliveOnHover?: boolean | undefined;
|
|
770
|
+
pauseOnVisibilityChange?: boolean | undefined;
|
|
769
771
|
hideIcon?: boolean | undefined;
|
|
770
772
|
avatar?: (() => import("vue").VNodeChild) | undefined;
|
|
771
773
|
content?: string | (() => import("vue").VNodeChild) | undefined;
|
|
@@ -31,12 +31,16 @@ import { c, cB, cE, cM } from "../../../_utils/cssr/index.mjs";
|
|
|
31
31
|
export default c([cB('notification-container', `
|
|
32
32
|
z-index: 4000;
|
|
33
33
|
position: fixed;
|
|
34
|
+
left: 0;
|
|
35
|
+
right: 0;
|
|
34
36
|
overflow: visible;
|
|
35
37
|
display: flex;
|
|
36
38
|
flex-direction: column;
|
|
37
39
|
align-items: flex-end;
|
|
40
|
+
pointer-events: none;
|
|
38
41
|
`, [c('>', [cB('scrollbar', `
|
|
39
|
-
width:
|
|
42
|
+
width: -moz-fit-content;
|
|
43
|
+
width: fit-content;
|
|
40
44
|
overflow: visible;
|
|
41
45
|
height: -moz-fit-content !important;
|
|
42
46
|
height: fit-content !important;
|
|
@@ -62,8 +66,7 @@ export default c([cB('notification-container', `
|
|
|
62
66
|
margin-bottom: 0;
|
|
63
67
|
margin-top: 12px;
|
|
64
68
|
`)]), cM('top, bottom', `
|
|
65
|
-
|
|
66
|
-
transform: translateX(-50%);
|
|
69
|
+
align-items: center;
|
|
67
70
|
`, [cB('notification-wrapper', [c('&.notification-transition-enter-from, &.notification-transition-leave-to', `
|
|
68
71
|
transform: scale(0.85);
|
|
69
72
|
`), c('&.notification-transition-leave-from, &.notification-transition-enter-to', `
|
|
@@ -72,15 +75,11 @@ export default c([cB('notification-container', `
|
|
|
72
75
|
transform-origin: top center;
|
|
73
76
|
`)]), cM('bottom', [cB('notification-wrapper', `
|
|
74
77
|
transform-origin: bottom center;
|
|
75
|
-
`)]), cM('top-right', `
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
right: 0;
|
|
81
|
-
`, [placementTransformStyle('bottom-right')]), cM('bottom-left', `
|
|
82
|
-
left: 0;
|
|
83
|
-
`, [placementTransformStyle('bottom-left')]), cM('scrollable', [cM('top-right', `
|
|
78
|
+
`)]), cM('top-right, bottom-right', `
|
|
79
|
+
align-items: flex-end;
|
|
80
|
+
`), cM('top-left, bottom-left', `
|
|
81
|
+
align-items: flex-start;
|
|
82
|
+
`), cM('scrollable', [cM('top-right', `
|
|
84
83
|
top: 0;
|
|
85
84
|
`), cM('top-left', `
|
|
86
85
|
top: 0;
|
|
@@ -117,6 +116,7 @@ export default c([cB('notification-container', `
|
|
|
117
116
|
`)]), cB('notification', `
|
|
118
117
|
background-color: var(--u-color);
|
|
119
118
|
color: var(--u-text-color);
|
|
119
|
+
pointer-events: auto;
|
|
120
120
|
transition:
|
|
121
121
|
background-color .3s var(--u-bezier),
|
|
122
122
|
color .3s var(--u-bezier),
|
|
@@ -214,14 +214,4 @@ export default c([cB('notification-container', `
|
|
|
214
214
|
color: var(--u-text-color);
|
|
215
215
|
`, [c('&:first-child', {
|
|
216
216
|
margin: 0
|
|
217
|
-
})])])])])]);
|
|
218
|
-
function placementTransformStyle(placement) {
|
|
219
|
-
const direction = placement.split('-')[1];
|
|
220
|
-
const transformXEnter = direction === 'left' ? 'calc(-100%)' : 'calc(100%)';
|
|
221
|
-
const transformXLeave = '0';
|
|
222
|
-
return cB('notification-wrapper', [c('&.notification-transition-enter-from, &.notification-transition-leave-to', `
|
|
223
|
-
transform: translate(${transformXEnter}, 0);
|
|
224
|
-
`), c('&.notification-transition-leave-from, &.notification-transition-enter-to', `
|
|
225
|
-
transform: translate(${transformXLeave}, 0);
|
|
226
|
-
`)]);
|
|
227
|
-
}
|
|
217
|
+
})])])])])]);
|
package/es/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "2.0.
|
|
1
|
+
declare const _default: "2.0.3";
|
|
2
2
|
export default _default;
|
package/es/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '2.0.
|
|
1
|
+
export default '2.0.3';
|
|
@@ -187,49 +187,51 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
187
187
|
const chat = selectedChatRef.value;
|
|
188
188
|
const keyId = toKeyString(chat === null || chat === void 0 ? void 0 : chat.id);
|
|
189
189
|
const keyTitle = toKeyString(chat === null || chat === void 0 ? void 0 : chat.title);
|
|
190
|
-
return ((0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-chat-main__header
|
|
191
|
-
(0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-chat-main__header-
|
|
192
|
-
(0, vue_1.h)(
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
190
|
+
return ((0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-chat-main__header` },
|
|
191
|
+
(0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-chat-main__header-inner` },
|
|
192
|
+
(0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-chat-main__header-title-wrap` },
|
|
193
|
+
(0, vue_1.h)(typography_1.UText, { key: `${keyId}-${keyTitle}`, variant: "heading-s-bold", class: `${mergedClsPrefixRef.value}-chat-main__header-title`, theme: mergedThemeRef.value.peers.Typography, themeOverrides: mergedThemeRef.value.peerOverrides.Typography }, {
|
|
194
|
+
default: () => { var _a, _b; return (_b = (_a = selectedChatRef.value) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : ''; }
|
|
195
|
+
}),
|
|
196
|
+
isTyping.value && ((0, vue_1.h)(typography_1.UText, { class: [
|
|
197
|
+
`${mergedClsPrefixRef.value}-chat-main__header-subtitle`,
|
|
198
|
+
'typing'
|
|
199
|
+
], variant: "body-m-medium" }, {
|
|
200
|
+
default: () => { var _a; return (_a = typingTextRef.value) !== null && _a !== void 0 ? _a : ''; }
|
|
201
|
+
}))),
|
|
202
|
+
(0, vue_1.h)(flex_1.UFlex, { align: "center", size: "small", class: `${mergedClsPrefixRef.value}-chat-main__header-actions` }, {
|
|
203
|
+
default: () => (0, _utils_1.resolveSlot)(slots.headerActions, () => {
|
|
204
|
+
const shareButtonProps = Object.assign(Object.assign({}, headerButtonPropsRef.value), headerShareButtonPropsRef.value);
|
|
205
|
+
const profileButtonProps = Object.assign(Object.assign({}, headerButtonPropsRef.value), headerProfileButtonPropsRef.value);
|
|
206
|
+
const closeButtonProps = Object.assign(Object.assign({}, headerButtonPropsRef.value), headerCloseButtonPropsRef.value);
|
|
207
|
+
const shareIconProps = Object.assign(Object.assign({}, headerIconPropsRef.value), headerShareIconPropsRef.value);
|
|
208
|
+
const profileIconProps = Object.assign(Object.assign({}, headerIconPropsRef.value), headerProfileIconPropsRef.value);
|
|
209
|
+
const buttons = [];
|
|
210
|
+
buttons.push((0, vue_1.h)(tooltip_1.UTooltip, null, {
|
|
211
|
+
trigger: () => ((0, vue_1.h)(button_1.UButton, Object.assign({ secondary: true, circle: true, size: "large" }, shareButtonProps, { theme: mergedThemeRef.value.peers.Button, themeOverrides: mergedThemeRef.value.peerOverrides.Button, onClick: () => { var _a; return (_a = onChatShare === null || onChatShare === void 0 ? void 0 : onChatShare.value) === null || _a === void 0 ? void 0 : _a.call(onChatShare); } }), {
|
|
212
|
+
default: () => ((0, vue_1.h)(icon_1.UIcon, Object.assign({ size: 20 }, shareIconProps, { theme: mergedThemeRef.value.peers.HeaderShareIcon, themeOverrides: mergedThemeRef.value.peerOverrides
|
|
213
|
+
.HeaderShareIcon }), {
|
|
214
|
+
default: () => (0, vue_1.h)(icons_1.ArrowHookUpRight, null)
|
|
215
|
+
}))
|
|
216
|
+
})),
|
|
217
|
+
default: () => shareButtonTooltipRef.value
|
|
218
|
+
}));
|
|
219
|
+
buttons.push((0, vue_1.h)(tooltip_1.UTooltip, null, {
|
|
220
|
+
trigger: () => ((0, vue_1.h)(button_1.UButton, Object.assign({ secondary: true, circle: true, size: "large" }, profileButtonProps, { theme: mergedThemeRef.value.peers.Button, themeOverrides: mergedThemeRef.value.peerOverrides.Button, onClick: () => { var _a; return (_a = onUserProfile === null || onUserProfile === void 0 ? void 0 : onUserProfile.value) === null || _a === void 0 ? void 0 : _a.call(onUserProfile); } }), {
|
|
221
|
+
default: () => ((0, vue_1.h)(icon_1.UIcon, Object.assign({ size: 20 }, profileIconProps, { theme: mergedThemeRef.value.peers
|
|
222
|
+
.HeaderProfileIcon, themeOverrides: mergedThemeRef.value.peerOverrides
|
|
223
|
+
.HeaderProfileIcon }), {
|
|
224
|
+
default: () => (0, vue_1.h)(icons_1.PersonNote, null)
|
|
225
|
+
}))
|
|
226
|
+
})),
|
|
227
|
+
default: () => profileButtonTooltipRef.value
|
|
228
|
+
}));
|
|
229
|
+
buttons.push((0, vue_1.h)(button_1.UButton, Object.assign({ type: "primary", size: "large", round: true }, closeButtonProps, { theme: mergedThemeRef.value.peers.Button, themeOverrides: mergedThemeRef.value.peerOverrides.Button, onClick: () => { var _a; return (_a = onChatClose === null || onChatClose === void 0 ? void 0 : onChatClose.value) === null || _a === void 0 ? void 0 : _a.call(onChatClose); } }), {
|
|
230
|
+
default: () => closeButtonTextRef.value
|
|
231
|
+
}));
|
|
232
|
+
return buttons;
|
|
233
|
+
})
|
|
234
|
+
}))));
|
|
233
235
|
};
|
|
234
236
|
const renderMessages = () => {
|
|
235
237
|
var _a;
|