@uzum-tech/ui 1.11.2 → 1.12.0
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 +10829 -6652
- package/dist/index.prod.js +4 -4
- package/es/_internal/icons/BurgerMenuIcon.d.ts +2 -0
- package/es/_internal/icons/BurgerMenuIcon.js +4 -0
- package/es/_internal/icons/Logout.d.ts +2 -0
- package/es/_internal/icons/Logout.js +4 -0
- package/es/_internal/icons/OzbekFlag.d.ts +2 -0
- package/es/_internal/icons/OzbekFlag.js +15 -0
- package/es/_internal/icons/RussiaFlag.d.ts +2 -0
- package/es/_internal/icons/RussiaFlag.js +11 -0
- package/es/_internal/icons/SendFilled.d.ts +2 -0
- package/es/_internal/icons/SendFilled.js +9 -0
- package/es/_internal/icons/index.d.ts +5 -0
- package/es/_internal/icons/index.js +5 -0
- package/es/_styles/common/dark.js +1 -1
- package/es/_styles/common/light.d.ts +1 -0
- package/es/_styles/common/light.js +1 -1
- package/es/chat/src/Chat.d.ts +464 -83
- package/es/chat/src/Chat.js +17 -2
- package/es/chat/src/ChatListItems.d.ts +497 -94
- package/es/chat/src/ChatListItems.js +1 -1
- package/es/chat/src/ChatMessages.d.ts +501 -94
- package/es/chat/src/ChatMessages.js +115 -22
- package/es/chat/src/ChatParts/MainArea.d.ts +7 -3
- package/es/chat/src/ChatParts/MainArea.js +110 -14
- package/es/chat/src/ChatParts/Sidebar.d.ts +64 -11
- package/es/chat/src/interface.d.ts +18 -0
- package/es/chat/src/interface.js +6 -0
- package/es/chat/src/styles/index.cssr.js +22 -1
- package/es/chat/styles/dark.d.ts +41 -8
- package/es/chat/styles/dark.js +6 -2
- package/es/chat/styles/light.d.ts +42 -8
- package/es/chat/styles/light.js +7 -2
- package/es/components.d.ts +3 -0
- package/es/components.js +3 -0
- package/es/config-provider/src/internal-interface.d.ts +17 -0
- package/es/dialog/src/DialogProvider.d.ts +2 -0
- package/es/form/src/FormItemCol.d.ts +2 -2
- package/es/form/src/FormItemGridItem.d.ts +2 -2
- package/es/form/src/FormItemRow.d.ts +1 -1
- package/es/grid/src/Grid.d.ts +1 -1
- package/es/grid/src/GridItem.d.ts +2 -2
- package/es/header/demos/mock.d.ts +2 -0
- package/es/header/demos/mock.js +235 -0
- package/es/header/index.d.ts +12 -0
- package/es/header/index.js +10 -0
- package/es/header/src/Header.d.ts +604 -0
- package/es/header/src/Header.js +320 -0
- package/es/header/src/HeaderActions.d.ts +120 -0
- package/es/header/src/HeaderActions.js +166 -0
- package/es/header/src/HeaderDesktopLayout.d.ts +25 -0
- package/es/header/src/HeaderDesktopLayout.js +24 -0
- package/es/header/src/HeaderMobileLayout.d.ts +25 -0
- package/es/header/src/HeaderMobileLayout.js +21 -0
- package/es/header/src/HeaderNavigation.d.ts +128 -0
- package/es/header/src/HeaderNavigation.js +172 -0
- package/es/header/src/HeaderSearchDesktop.d.ts +79 -0
- package/es/header/src/HeaderSearchDesktop.js +77 -0
- package/es/header/src/HeaderSearchMobile.d.ts +73 -0
- package/es/header/src/HeaderSearchMobile.js +126 -0
- package/es/header/src/HeaderSearchResults.d.ts +81 -0
- package/es/header/src/HeaderSearchResults.js +74 -0
- package/es/header/src/constants.d.ts +1 -0
- package/es/header/src/constants.js +1 -0
- package/es/header/src/interface.d.ts +58 -0
- package/es/header/src/interface.js +1 -0
- package/es/header/src/mobile/HeaderMobile.d.ts +218 -0
- package/es/header/src/mobile/HeaderMobile.js +241 -0
- package/es/header/src/styles/index.cssr.d.ts +6 -0
- package/es/header/src/styles/index.cssr.js +519 -0
- package/es/header/src/utils.d.ts +12 -0
- package/es/header/src/utils.js +47 -0
- package/es/header/styles/dark.d.ts +36 -0
- package/es/header/styles/dark.js +9 -0
- package/es/header/styles/index.d.ts +3 -0
- package/es/header/styles/index.js +2 -0
- package/es/header/styles/light.d.ts +72 -0
- package/es/header/styles/light.js +45 -0
- package/es/icon/src/Icon.d.ts +3 -0
- package/es/icon/src/Icon.js +3 -2
- package/es/icon-bar/index.d.ts +4 -0
- package/es/icon-bar/index.js +2 -0
- package/es/icon-bar/src/IconBar.d.ts +175 -0
- package/es/icon-bar/src/IconBar.js +57 -0
- package/es/icon-bar/src/IconBarItem.d.ts +163 -0
- package/es/icon-bar/src/IconBarItem.js +50 -0
- package/es/icon-bar/src/styles/index.cssr.d.ts +2 -0
- package/es/icon-bar/src/styles/index.cssr.js +62 -0
- package/es/icon-bar/styles/dark.d.ts +3 -0
- package/es/icon-bar/styles/dark.js +8 -0
- package/es/icon-bar/styles/index.d.ts +3 -0
- package/es/icon-bar/styles/index.js +2 -0
- package/es/icon-bar/styles/light.d.ts +19 -0
- package/es/icon-bar/styles/light.js +23 -0
- package/es/locales/common/arDZ.js +11 -1
- package/es/locales/common/deDE.js +11 -1
- package/es/locales/common/enGB.js +11 -1
- package/es/locales/common/enUS.d.ts +10 -0
- package/es/locales/common/enUS.js +11 -1
- package/es/locales/common/eo.js +11 -1
- package/es/locales/common/esAR.js +11 -1
- package/es/locales/common/faIR.js +11 -1
- package/es/locales/common/frFR.js +11 -1
- package/es/locales/common/idID.js +11 -1
- package/es/locales/common/itIT.js +11 -1
- package/es/locales/common/jaJP.js +11 -1
- package/es/locales/common/koKR.js +11 -1
- package/es/locales/common/nbNO.js +11 -1
- package/es/locales/common/nlNL.js +11 -1
- package/es/locales/common/plPL.js +11 -1
- package/es/locales/common/ptBR.js +11 -1
- package/es/locales/common/ruRU.js +11 -1
- package/es/locales/common/skSK.js +11 -1
- package/es/locales/common/svSE.js +11 -1
- package/es/locales/common/thTH.js +11 -1
- package/es/locales/common/trTR.js +11 -1
- package/es/locales/common/ukUA.js +11 -1
- package/es/locales/common/viVN.js +11 -1
- package/es/locales/common/zhCN.js +11 -1
- package/es/locales/common/zhTW.js +11 -1
- package/es/qr-code/index.d.ts +2 -0
- package/es/qr-code/index.js +1 -0
- package/es/qr-code/src/QrCode.d.ts +171 -0
- package/es/qr-code/src/QrCode.js +229 -0
- package/es/qr-code/src/qrcodegen.d.ts +95 -0
- package/es/qr-code/src/qrcodegen.js +949 -0
- package/es/qr-code/src/styles/index.cssr.d.ts +2 -0
- package/es/qr-code/src/styles/index.cssr.js +8 -0
- package/es/qr-code/styles/dark.d.ts +3 -0
- package/es/qr-code/styles/dark.js +11 -0
- package/es/qr-code/styles/index.d.ts +3 -0
- package/es/qr-code/styles/index.js +2 -0
- package/es/qr-code/styles/light.d.ts +9 -0
- package/es/qr-code/styles/light.js +12 -0
- package/es/theme-editor/src/ThemeEditor.d.ts +1 -0
- package/es/themes/dark.js +7 -1
- package/es/themes/light.js +7 -1
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/icons/BurgerMenuIcon.d.ts +2 -0
- package/lib/_internal/icons/BurgerMenuIcon.js +6 -0
- package/lib/_internal/icons/Logout.d.ts +2 -0
- package/lib/_internal/icons/Logout.js +6 -0
- package/lib/_internal/icons/OzbekFlag.d.ts +2 -0
- package/lib/_internal/icons/OzbekFlag.js +17 -0
- package/lib/_internal/icons/RussiaFlag.d.ts +2 -0
- package/lib/_internal/icons/RussiaFlag.js +13 -0
- package/lib/_internal/icons/SendFilled.d.ts +2 -0
- package/lib/_internal/icons/SendFilled.js +11 -0
- package/lib/_internal/icons/index.d.ts +5 -0
- package/lib/_internal/icons/index.js +11 -1
- package/lib/_styles/common/dark.js +1 -1
- package/lib/_styles/common/light.d.ts +1 -0
- package/lib/_styles/common/light.js +1 -1
- package/lib/chat/src/Chat.d.ts +464 -83
- package/lib/chat/src/Chat.js +17 -2
- package/lib/chat/src/ChatListItems.d.ts +497 -94
- package/lib/chat/src/ChatListItems.js +1 -1
- package/lib/chat/src/ChatMessages.d.ts +501 -94
- package/lib/chat/src/ChatMessages.js +113 -20
- package/lib/chat/src/ChatParts/MainArea.d.ts +7 -3
- package/lib/chat/src/ChatParts/MainArea.js +108 -12
- package/lib/chat/src/ChatParts/Sidebar.d.ts +64 -11
- package/lib/chat/src/interface.d.ts +18 -0
- package/lib/chat/src/interface.js +7 -1
- package/lib/chat/src/styles/index.cssr.js +22 -1
- package/lib/chat/styles/dark.d.ts +41 -8
- package/lib/chat/styles/dark.js +6 -2
- package/lib/chat/styles/light.d.ts +42 -8
- package/lib/chat/styles/light.js +7 -2
- package/lib/components.d.ts +3 -0
- package/lib/components.js +3 -0
- package/lib/config-provider/src/internal-interface.d.ts +17 -0
- package/lib/dialog/src/DialogProvider.d.ts +2 -0
- package/lib/form/src/FormItemCol.d.ts +2 -2
- package/lib/form/src/FormItemGridItem.d.ts +2 -2
- package/lib/form/src/FormItemRow.d.ts +1 -1
- package/lib/grid/src/Grid.d.ts +1 -1
- package/lib/grid/src/GridItem.d.ts +2 -2
- package/lib/header/demos/mock.d.ts +2 -0
- package/lib/header/demos/mock.js +238 -0
- package/lib/header/index.d.ts +12 -0
- package/lib/header/index.js +48 -0
- package/lib/header/src/Header.d.ts +604 -0
- package/lib/header/src/Header.js +349 -0
- package/lib/header/src/HeaderActions.d.ts +120 -0
- package/lib/header/src/HeaderActions.js +172 -0
- package/lib/header/src/HeaderDesktopLayout.d.ts +25 -0
- package/lib/header/src/HeaderDesktopLayout.js +27 -0
- package/lib/header/src/HeaderMobileLayout.d.ts +25 -0
- package/lib/header/src/HeaderMobileLayout.js +24 -0
- package/lib/header/src/HeaderNavigation.d.ts +128 -0
- package/lib/header/src/HeaderNavigation.js +175 -0
- package/lib/header/src/HeaderSearchDesktop.d.ts +79 -0
- package/lib/header/src/HeaderSearchDesktop.js +83 -0
- package/lib/header/src/HeaderSearchMobile.d.ts +73 -0
- package/lib/header/src/HeaderSearchMobile.js +132 -0
- package/lib/header/src/HeaderSearchResults.d.ts +81 -0
- package/lib/header/src/HeaderSearchResults.js +77 -0
- package/lib/header/src/constants.d.ts +1 -0
- package/lib/header/src/constants.js +4 -0
- package/lib/header/src/interface.d.ts +58 -0
- package/lib/header/src/interface.js +2 -0
- package/lib/header/src/mobile/HeaderMobile.d.ts +218 -0
- package/lib/header/src/mobile/HeaderMobile.js +244 -0
- package/lib/header/src/styles/index.cssr.d.ts +6 -0
- package/lib/header/src/styles/index.cssr.js +525 -0
- package/lib/header/src/utils.d.ts +12 -0
- package/lib/header/src/utils.js +58 -0
- package/lib/header/styles/dark.d.ts +36 -0
- package/lib/header/styles/dark.js +11 -0
- package/lib/header/styles/index.d.ts +3 -0
- package/lib/header/styles/index.js +10 -0
- package/lib/header/styles/light.d.ts +72 -0
- package/lib/header/styles/light.js +49 -0
- package/lib/icon/src/Icon.d.ts +3 -0
- package/lib/icon/src/Icon.js +3 -2
- package/lib/icon-bar/index.d.ts +4 -0
- package/lib/icon-bar/index.js +12 -0
- package/lib/icon-bar/src/IconBar.d.ts +175 -0
- package/lib/icon-bar/src/IconBar.js +63 -0
- package/lib/icon-bar/src/IconBarItem.d.ts +163 -0
- package/lib/icon-bar/src/IconBarItem.js +56 -0
- package/lib/icon-bar/src/styles/index.cssr.d.ts +2 -0
- package/lib/icon-bar/src/styles/index.cssr.js +67 -0
- package/lib/icon-bar/styles/dark.d.ts +3 -0
- package/lib/icon-bar/styles/dark.js +10 -0
- package/lib/icon-bar/styles/index.d.ts +3 -0
- package/lib/icon-bar/styles/index.js +10 -0
- package/lib/icon-bar/styles/light.d.ts +19 -0
- package/lib/icon-bar/styles/light.js +27 -0
- package/lib/locales/common/arDZ.js +11 -1
- package/lib/locales/common/deDE.js +11 -1
- package/lib/locales/common/enGB.js +11 -1
- package/lib/locales/common/enUS.d.ts +10 -0
- package/lib/locales/common/enUS.js +11 -1
- package/lib/locales/common/eo.js +11 -1
- package/lib/locales/common/esAR.js +11 -1
- package/lib/locales/common/faIR.js +11 -1
- package/lib/locales/common/frFR.js +11 -1
- package/lib/locales/common/idID.js +11 -1
- package/lib/locales/common/itIT.js +11 -1
- package/lib/locales/common/jaJP.js +11 -1
- package/lib/locales/common/koKR.js +11 -1
- package/lib/locales/common/nbNO.js +11 -1
- package/lib/locales/common/nlNL.js +11 -1
- package/lib/locales/common/plPL.js +11 -1
- package/lib/locales/common/ptBR.js +11 -1
- package/lib/locales/common/ruRU.js +11 -1
- package/lib/locales/common/skSK.js +11 -1
- package/lib/locales/common/svSE.js +11 -1
- package/lib/locales/common/thTH.js +11 -1
- package/lib/locales/common/trTR.js +11 -1
- package/lib/locales/common/ukUA.js +11 -1
- package/lib/locales/common/viVN.js +11 -1
- package/lib/locales/common/zhCN.js +11 -1
- package/lib/locales/common/zhTW.js +11 -1
- package/lib/qr-code/index.d.ts +2 -0
- package/lib/qr-code/index.js +9 -0
- package/lib/qr-code/src/QrCode.d.ts +171 -0
- package/lib/qr-code/src/QrCode.js +235 -0
- package/lib/qr-code/src/qrcodegen.d.ts +95 -0
- package/lib/qr-code/src/qrcodegen.js +950 -0
- package/lib/qr-code/src/styles/index.cssr.d.ts +2 -0
- package/lib/qr-code/src/styles/index.cssr.js +13 -0
- package/lib/qr-code/styles/dark.d.ts +3 -0
- package/lib/qr-code/styles/dark.js +13 -0
- package/lib/qr-code/styles/index.d.ts +3 -0
- package/lib/qr-code/styles/index.js +10 -0
- package/lib/qr-code/styles/light.d.ts +9 -0
- package/lib/qr-code/styles/light.js +14 -0
- package/lib/theme-editor/src/ThemeEditor.d.ts +1 -0
- package/lib/themes/dark.js +7 -1
- package/lib/themes/light.js +7 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/volar.d.ts +166 -153
- package/web-types.json +854 -2
|
@@ -133,7 +133,17 @@ const zhTW = {
|
|
|
133
133
|
closeButtonText: 'Close chat',
|
|
134
134
|
shareButtonTooltip: 'Share chat',
|
|
135
135
|
profileButtonTooltip: 'View profile',
|
|
136
|
-
unreadNotificationText: 'new messages'
|
|
136
|
+
unreadNotificationText: 'new messages',
|
|
137
|
+
editText: 'Edit',
|
|
138
|
+
copyText: 'Copy',
|
|
139
|
+
deleteText: 'Delete',
|
|
140
|
+
editingTitle: 'Editing'
|
|
141
|
+
},
|
|
142
|
+
Header: {
|
|
143
|
+
desktopSearchTitle: 'Search',
|
|
144
|
+
searchPlaceholder: 'Search the site',
|
|
145
|
+
primaryActionText: 'Become a client',
|
|
146
|
+
secondaryActionText: 'Go to the application'
|
|
137
147
|
}
|
|
138
148
|
};
|
|
139
149
|
exports.default = zhTW;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.qrCodeProps = exports.UQrCode = void 0;
|
|
7
|
+
var QrCode_1 = require("./src/QrCode");
|
|
8
|
+
Object.defineProperty(exports, "UQrCode", { enumerable: true, get: function () { return __importDefault(QrCode_1).default; } });
|
|
9
|
+
Object.defineProperty(exports, "qrCodeProps", { enumerable: true, get: function () { return QrCode_1.qrCodeProps; } });
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
import type { ExtractPublicPropTypes } from '../../_utils';
|
|
3
|
+
export declare const qrCodeProps: {
|
|
4
|
+
readonly value: StringConstructor;
|
|
5
|
+
readonly color: {
|
|
6
|
+
readonly type: StringConstructor;
|
|
7
|
+
readonly default: "#000";
|
|
8
|
+
};
|
|
9
|
+
readonly backgroundColor: {
|
|
10
|
+
readonly type: StringConstructor;
|
|
11
|
+
readonly default: "#FFF";
|
|
12
|
+
};
|
|
13
|
+
readonly iconSrc: StringConstructor;
|
|
14
|
+
readonly iconSize: {
|
|
15
|
+
readonly type: NumberConstructor;
|
|
16
|
+
readonly default: 40;
|
|
17
|
+
};
|
|
18
|
+
readonly iconBackgroundColor: {
|
|
19
|
+
readonly type: StringConstructor;
|
|
20
|
+
readonly default: "#FFF";
|
|
21
|
+
};
|
|
22
|
+
readonly iconBorderRadius: {
|
|
23
|
+
readonly type: NumberConstructor;
|
|
24
|
+
readonly default: 4;
|
|
25
|
+
};
|
|
26
|
+
readonly size: {
|
|
27
|
+
readonly type: NumberConstructor;
|
|
28
|
+
readonly default: 100;
|
|
29
|
+
};
|
|
30
|
+
readonly padding: {
|
|
31
|
+
readonly type: PropType<string | number>;
|
|
32
|
+
readonly default: 12;
|
|
33
|
+
};
|
|
34
|
+
readonly errorCorrectionLevel: {
|
|
35
|
+
readonly type: PropType<"L" | "M" | "Q" | "H">;
|
|
36
|
+
readonly default: "M";
|
|
37
|
+
};
|
|
38
|
+
readonly type: {
|
|
39
|
+
readonly type: PropType<"svg" | "canvas">;
|
|
40
|
+
readonly default: "canvas";
|
|
41
|
+
};
|
|
42
|
+
readonly theme: PropType<import("../../_mixins").Theme<"QrCode", {
|
|
43
|
+
borderRadius: string;
|
|
44
|
+
}, any>>;
|
|
45
|
+
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"QrCode", {
|
|
46
|
+
borderRadius: string;
|
|
47
|
+
}, any>>>;
|
|
48
|
+
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"QrCode", {
|
|
49
|
+
borderRadius: string;
|
|
50
|
+
}, any>>>;
|
|
51
|
+
};
|
|
52
|
+
export type QrCodeProps = ExtractPublicPropTypes<typeof qrCodeProps>;
|
|
53
|
+
declare const _default: import("vue").DefineComponent<{
|
|
54
|
+
readonly value: StringConstructor;
|
|
55
|
+
readonly color: {
|
|
56
|
+
readonly type: StringConstructor;
|
|
57
|
+
readonly default: "#000";
|
|
58
|
+
};
|
|
59
|
+
readonly backgroundColor: {
|
|
60
|
+
readonly type: StringConstructor;
|
|
61
|
+
readonly default: "#FFF";
|
|
62
|
+
};
|
|
63
|
+
readonly iconSrc: StringConstructor;
|
|
64
|
+
readonly iconSize: {
|
|
65
|
+
readonly type: NumberConstructor;
|
|
66
|
+
readonly default: 40;
|
|
67
|
+
};
|
|
68
|
+
readonly iconBackgroundColor: {
|
|
69
|
+
readonly type: StringConstructor;
|
|
70
|
+
readonly default: "#FFF";
|
|
71
|
+
};
|
|
72
|
+
readonly iconBorderRadius: {
|
|
73
|
+
readonly type: NumberConstructor;
|
|
74
|
+
readonly default: 4;
|
|
75
|
+
};
|
|
76
|
+
readonly size: {
|
|
77
|
+
readonly type: NumberConstructor;
|
|
78
|
+
readonly default: 100;
|
|
79
|
+
};
|
|
80
|
+
readonly padding: {
|
|
81
|
+
readonly type: PropType<string | number>;
|
|
82
|
+
readonly default: 12;
|
|
83
|
+
};
|
|
84
|
+
readonly errorCorrectionLevel: {
|
|
85
|
+
readonly type: PropType<"L" | "M" | "Q" | "H">;
|
|
86
|
+
readonly default: "M";
|
|
87
|
+
};
|
|
88
|
+
readonly type: {
|
|
89
|
+
readonly type: PropType<"svg" | "canvas">;
|
|
90
|
+
readonly default: "canvas";
|
|
91
|
+
};
|
|
92
|
+
readonly theme: PropType<import("../../_mixins").Theme<"QrCode", {
|
|
93
|
+
borderRadius: string;
|
|
94
|
+
}, any>>;
|
|
95
|
+
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"QrCode", {
|
|
96
|
+
borderRadius: string;
|
|
97
|
+
}, any>>>;
|
|
98
|
+
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"QrCode", {
|
|
99
|
+
borderRadius: string;
|
|
100
|
+
}, any>>>;
|
|
101
|
+
}, {
|
|
102
|
+
canvasRef: import("vue").Ref<HTMLCanvasElement | undefined>;
|
|
103
|
+
mergedClsPrefix: import("vue").Ref<string>;
|
|
104
|
+
cssVars: import("vue").ComputedRef<{
|
|
105
|
+
'--u-border-radius': string;
|
|
106
|
+
}> | undefined;
|
|
107
|
+
themeClass: import("vue").Ref<string> | undefined;
|
|
108
|
+
svgInfo: import("vue").ComputedRef<{
|
|
109
|
+
innerHtml: string;
|
|
110
|
+
numCells: number;
|
|
111
|
+
}>;
|
|
112
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
113
|
+
readonly value: StringConstructor;
|
|
114
|
+
readonly color: {
|
|
115
|
+
readonly type: StringConstructor;
|
|
116
|
+
readonly default: "#000";
|
|
117
|
+
};
|
|
118
|
+
readonly backgroundColor: {
|
|
119
|
+
readonly type: StringConstructor;
|
|
120
|
+
readonly default: "#FFF";
|
|
121
|
+
};
|
|
122
|
+
readonly iconSrc: StringConstructor;
|
|
123
|
+
readonly iconSize: {
|
|
124
|
+
readonly type: NumberConstructor;
|
|
125
|
+
readonly default: 40;
|
|
126
|
+
};
|
|
127
|
+
readonly iconBackgroundColor: {
|
|
128
|
+
readonly type: StringConstructor;
|
|
129
|
+
readonly default: "#FFF";
|
|
130
|
+
};
|
|
131
|
+
readonly iconBorderRadius: {
|
|
132
|
+
readonly type: NumberConstructor;
|
|
133
|
+
readonly default: 4;
|
|
134
|
+
};
|
|
135
|
+
readonly size: {
|
|
136
|
+
readonly type: NumberConstructor;
|
|
137
|
+
readonly default: 100;
|
|
138
|
+
};
|
|
139
|
+
readonly padding: {
|
|
140
|
+
readonly type: PropType<string | number>;
|
|
141
|
+
readonly default: 12;
|
|
142
|
+
};
|
|
143
|
+
readonly errorCorrectionLevel: {
|
|
144
|
+
readonly type: PropType<"L" | "M" | "Q" | "H">;
|
|
145
|
+
readonly default: "M";
|
|
146
|
+
};
|
|
147
|
+
readonly type: {
|
|
148
|
+
readonly type: PropType<"svg" | "canvas">;
|
|
149
|
+
readonly default: "canvas";
|
|
150
|
+
};
|
|
151
|
+
readonly theme: PropType<import("../../_mixins").Theme<"QrCode", {
|
|
152
|
+
borderRadius: string;
|
|
153
|
+
}, any>>;
|
|
154
|
+
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"QrCode", {
|
|
155
|
+
borderRadius: string;
|
|
156
|
+
}, any>>>;
|
|
157
|
+
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"QrCode", {
|
|
158
|
+
borderRadius: string;
|
|
159
|
+
}, any>>>;
|
|
160
|
+
}>>, {
|
|
161
|
+
readonly type: "svg" | "canvas";
|
|
162
|
+
readonly size: number;
|
|
163
|
+
readonly iconSize: number;
|
|
164
|
+
readonly color: string;
|
|
165
|
+
readonly padding: string | number;
|
|
166
|
+
readonly backgroundColor: string;
|
|
167
|
+
readonly iconBackgroundColor: string;
|
|
168
|
+
readonly iconBorderRadius: number;
|
|
169
|
+
readonly errorCorrectionLevel: "Q" | "H" | "L" | "M";
|
|
170
|
+
}, {}>;
|
|
171
|
+
export default _default;
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.qrCodeProps = void 0;
|
|
7
|
+
const vue_1 = require("vue");
|
|
8
|
+
const _mixins_1 = require("../../_mixins");
|
|
9
|
+
const styles_1 = require("../styles");
|
|
10
|
+
const qrcodegen_1 = __importDefault(require("./qrcodegen"));
|
|
11
|
+
const index_cssr_1 = __importDefault(require("./styles/index.cssr"));
|
|
12
|
+
const ERROR_CORRECTION_LEVEL = {
|
|
13
|
+
L: qrcodegen_1.default.QrCode.Ecc.LOW,
|
|
14
|
+
M: qrcodegen_1.default.QrCode.Ecc.MEDIUM,
|
|
15
|
+
Q: qrcodegen_1.default.QrCode.Ecc.QUARTILE,
|
|
16
|
+
H: qrcodegen_1.default.QrCode.Ecc.HIGH
|
|
17
|
+
};
|
|
18
|
+
exports.qrCodeProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { value: String, color: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: '#000'
|
|
21
|
+
}, backgroundColor: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: '#FFF'
|
|
24
|
+
}, iconSrc: String, iconSize: {
|
|
25
|
+
type: Number,
|
|
26
|
+
default: 40
|
|
27
|
+
}, iconBackgroundColor: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: '#FFF'
|
|
30
|
+
}, iconBorderRadius: {
|
|
31
|
+
type: Number,
|
|
32
|
+
default: 4
|
|
33
|
+
}, size: {
|
|
34
|
+
type: Number,
|
|
35
|
+
default: 100
|
|
36
|
+
}, padding: {
|
|
37
|
+
type: [Number, String],
|
|
38
|
+
default: 12
|
|
39
|
+
}, errorCorrectionLevel: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: 'M'
|
|
42
|
+
}, type: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: 'canvas'
|
|
45
|
+
} });
|
|
46
|
+
// For retina display
|
|
47
|
+
const UPSCALE_RATIO = 2;
|
|
48
|
+
exports.default = (0, vue_1.defineComponent)({
|
|
49
|
+
name: 'QrCode',
|
|
50
|
+
props: exports.qrCodeProps,
|
|
51
|
+
setup(props) {
|
|
52
|
+
const { mergedClsPrefixRef, inlineThemeDisabled } = (0, _mixins_1.useConfig)(props);
|
|
53
|
+
const themeRef = (0, _mixins_1.useTheme)('QrCode', '-qr-code', index_cssr_1.default, styles_1.qrcodeLight, props, mergedClsPrefixRef);
|
|
54
|
+
const cssVarsRef = (0, vue_1.computed)(() => {
|
|
55
|
+
return {
|
|
56
|
+
'--u-border-radius': themeRef.value.self.borderRadius
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
const themeClassHandle = inlineThemeDisabled
|
|
60
|
+
? (0, _mixins_1.useThemeClass)('qr-code', undefined, cssVarsRef, props)
|
|
61
|
+
: undefined;
|
|
62
|
+
const canvasRef = (0, vue_1.ref)();
|
|
63
|
+
const qr = (0, vue_1.computed)(() => {
|
|
64
|
+
var _a;
|
|
65
|
+
const errorCorrectionLevel = ERROR_CORRECTION_LEVEL[props.errorCorrectionLevel];
|
|
66
|
+
return qrcodegen_1.default.QrCode.encodeText((_a = props.value) !== null && _a !== void 0 ? _a : '-', errorCorrectionLevel);
|
|
67
|
+
});
|
|
68
|
+
(0, vue_1.onMounted)(() => {
|
|
69
|
+
const imageLoadedTrigger = (0, vue_1.ref)(0);
|
|
70
|
+
let loadedIcon = null;
|
|
71
|
+
(0, vue_1.watchEffect)(() => {
|
|
72
|
+
if (props.type === 'svg') {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
void imageLoadedTrigger.value;
|
|
76
|
+
drawCanvas(qr.value, props.size, props.color, props.backgroundColor, loadedIcon
|
|
77
|
+
? {
|
|
78
|
+
icon: loadedIcon,
|
|
79
|
+
iconBorderRadius: props.iconBorderRadius,
|
|
80
|
+
iconSize: props.iconSize,
|
|
81
|
+
iconBackgroundColor: props.iconBackgroundColor
|
|
82
|
+
}
|
|
83
|
+
: null);
|
|
84
|
+
});
|
|
85
|
+
(0, vue_1.watchEffect)(() => {
|
|
86
|
+
if (props.type === 'svg') {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const { iconSrc } = props;
|
|
90
|
+
if (iconSrc) {
|
|
91
|
+
let aborted = false;
|
|
92
|
+
const img = new Image();
|
|
93
|
+
img.src = iconSrc;
|
|
94
|
+
img.onload = () => {
|
|
95
|
+
if (aborted) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
loadedIcon = img;
|
|
99
|
+
imageLoadedTrigger.value++;
|
|
100
|
+
};
|
|
101
|
+
return () => {
|
|
102
|
+
aborted = true;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
function drawCanvas(qr, size, foregroundColor, backgroundColor, iconConfig) {
|
|
108
|
+
const canvas = canvasRef.value;
|
|
109
|
+
if (!canvas) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const canvasWidth = size * UPSCALE_RATIO;
|
|
113
|
+
const width = qr.size;
|
|
114
|
+
const scale = canvasWidth / width;
|
|
115
|
+
canvas.width = canvasWidth;
|
|
116
|
+
canvas.height = canvasWidth;
|
|
117
|
+
const ctx = canvas.getContext('2d');
|
|
118
|
+
if (!ctx) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
122
|
+
for (let y = 0; y < qr.size; y++) {
|
|
123
|
+
for (let x = 0; x < qr.size; x++) {
|
|
124
|
+
ctx.fillStyle = qr.getModule(x, y) ? foregroundColor : backgroundColor;
|
|
125
|
+
const startX = Math.floor(x * scale);
|
|
126
|
+
const endX = Math.ceil((x + 1) * scale);
|
|
127
|
+
const startY = Math.floor(y * scale);
|
|
128
|
+
const endY = Math.ceil((y + 1) * scale);
|
|
129
|
+
ctx.fillRect(startX, startY, endX - startX, endY - startY);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
if (iconConfig) {
|
|
133
|
+
const { icon, iconBackgroundColor, iconBorderRadius, iconSize } = iconConfig;
|
|
134
|
+
const finalIconSize = iconSize * UPSCALE_RATIO;
|
|
135
|
+
const centerX = (canvas.width - finalIconSize) / 2;
|
|
136
|
+
const centerY = (canvas.height - finalIconSize) / 2;
|
|
137
|
+
ctx.fillStyle = iconBackgroundColor;
|
|
138
|
+
ctx.beginPath();
|
|
139
|
+
ctx.roundRect(centerX, centerY, finalIconSize, finalIconSize, iconBorderRadius * UPSCALE_RATIO);
|
|
140
|
+
ctx.fill();
|
|
141
|
+
const aspectRatio = icon.width / icon.height;
|
|
142
|
+
const scaledWidth = aspectRatio >= 1 ? finalIconSize : finalIconSize * aspectRatio;
|
|
143
|
+
const scaledHeight = aspectRatio <= 1 ? finalIconSize : finalIconSize / aspectRatio;
|
|
144
|
+
const left = centerX + (finalIconSize - scaledWidth) / 2;
|
|
145
|
+
const top = centerY + (finalIconSize - scaledHeight) / 2;
|
|
146
|
+
ctx.drawImage(icon, left, top, scaledWidth, scaledHeight);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function generatePath(modules, margin = 0) {
|
|
150
|
+
const ops = [];
|
|
151
|
+
modules.forEach((row, y) => {
|
|
152
|
+
let start = null;
|
|
153
|
+
row.forEach((cell, x) => {
|
|
154
|
+
if (!cell && start !== null) {
|
|
155
|
+
// M0 0h7v1H0z injects the space with the move and drops the comma,
|
|
156
|
+
// saving a char per operation
|
|
157
|
+
ops.push(`M${start + margin} ${y + margin}h${x - start}v1H${start + margin}z`);
|
|
158
|
+
start = null;
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
// end of row, clean up or skip
|
|
162
|
+
if (x === row.length - 1) {
|
|
163
|
+
if (!cell) {
|
|
164
|
+
// We would have closed the op above already so this can only mean
|
|
165
|
+
// 2+ light modules in a row.
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
if (start === null) {
|
|
169
|
+
// Just a single dark module.
|
|
170
|
+
ops.push(`M${x + margin},${y + margin} h1v1H${x + margin}z`);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
// Otherwise finish the current line.
|
|
174
|
+
ops.push(`M${start + margin},${y + margin} h${x + 1 - start}v1H${start + margin}z`);
|
|
175
|
+
}
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (cell && start === null) {
|
|
179
|
+
start = x;
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
return ops.join('');
|
|
184
|
+
}
|
|
185
|
+
function svgInfo(qr, size, iconConfig) {
|
|
186
|
+
const cells = qr.getModules();
|
|
187
|
+
const numCells = cells.length;
|
|
188
|
+
const cellsToDraw = cells;
|
|
189
|
+
let svgInnerHtml = '';
|
|
190
|
+
const path1Html = `<path fill="transparent" d="M0,0 h${numCells}v${numCells}H0z" shape-rendering="crispEdges"></path>`;
|
|
191
|
+
const path2Html = `<path fill="${props.color}" d="${generatePath(cellsToDraw, 0)}" shape-rendering="crispEdges"></path>`;
|
|
192
|
+
let iconHtml = '';
|
|
193
|
+
if (iconConfig) {
|
|
194
|
+
const { iconSrc, iconSize } = iconConfig;
|
|
195
|
+
const DEFAULT_IMG_SCALE = 0.1;
|
|
196
|
+
const defaultSize = Math.floor(size * DEFAULT_IMG_SCALE);
|
|
197
|
+
const scale = numCells / size;
|
|
198
|
+
const h = (iconSize || defaultSize) * scale;
|
|
199
|
+
const w = (iconSize || defaultSize) * scale;
|
|
200
|
+
const x = cells.length / 2 - w / 2;
|
|
201
|
+
const y = cells.length / 2 - h / 2;
|
|
202
|
+
iconHtml += `<image href="${iconSrc}" width="${w}" height="${h}" x="${x}" y="${y}" preserveAspectRatio="none"></image>`;
|
|
203
|
+
}
|
|
204
|
+
svgInnerHtml += path1Html;
|
|
205
|
+
svgInnerHtml += path2Html;
|
|
206
|
+
svgInnerHtml += iconHtml;
|
|
207
|
+
return {
|
|
208
|
+
innerHtml: svgInnerHtml,
|
|
209
|
+
numCells
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
const svgInfoRef = (0, vue_1.computed)(() => svgInfo(qr.value, props.size, props.iconSrc
|
|
213
|
+
? {
|
|
214
|
+
iconSrc: props.iconSrc,
|
|
215
|
+
iconBorderRadius: props.iconBorderRadius,
|
|
216
|
+
iconSize: props.iconSize,
|
|
217
|
+
iconBackgroundColor: props.iconBackgroundColor
|
|
218
|
+
}
|
|
219
|
+
: null));
|
|
220
|
+
return {
|
|
221
|
+
canvasRef,
|
|
222
|
+
mergedClsPrefix: mergedClsPrefixRef,
|
|
223
|
+
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
224
|
+
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
225
|
+
svgInfo: svgInfoRef
|
|
226
|
+
};
|
|
227
|
+
},
|
|
228
|
+
render() {
|
|
229
|
+
const { mergedClsPrefix, backgroundColor, padding, cssVars, themeClass, size, type } = this;
|
|
230
|
+
return ((0, vue_1.h)("div", { class: [`${mergedClsPrefix}-qr-code`, themeClass], style: Object.assign({ padding: typeof padding === 'number' ? `${padding}px` : padding, backgroundColor, width: `${size}px`, height: `${size}px` }, cssVars) }, type === 'canvas' ? ((0, vue_1.h)("canvas", { ref: "canvasRef", style: {
|
|
231
|
+
width: `${size}px`,
|
|
232
|
+
height: `${size}px`
|
|
233
|
+
} })) : ((0, vue_1.h)("svg", { height: size, width: size, viewBox: `0 0 ${this.svgInfo.numCells} ${this.svgInfo.numCells}`, role: "img", innerHTML: this.svgInfo.innerHtml }))));
|
|
234
|
+
}
|
|
235
|
+
});
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
declare namespace qrcodegen {
|
|
2
|
+
type bit = number;
|
|
3
|
+
type byte = number;
|
|
4
|
+
type int = number;
|
|
5
|
+
export class QrCode {
|
|
6
|
+
readonly version: int;
|
|
7
|
+
readonly errorCorrectionLevel: QrCode.Ecc;
|
|
8
|
+
static encodeText(text: string, ecl: QrCode.Ecc): QrCode;
|
|
9
|
+
static encodeBinary(data: Readonly<byte[]>, ecl: QrCode.Ecc): QrCode;
|
|
10
|
+
static encodeSegments(segs: Readonly<QrSegment[]>, ecl: QrCode.Ecc, minVersion?: int, maxVersion?: int, mask?: int, boostEcl?: boolean): QrCode;
|
|
11
|
+
readonly size: int;
|
|
12
|
+
readonly mask: int;
|
|
13
|
+
private readonly modules;
|
|
14
|
+
private readonly isFunction;
|
|
15
|
+
constructor(version: int, errorCorrectionLevel: QrCode.Ecc, dataCodewords: Readonly<byte[]>, msk: int);
|
|
16
|
+
getModule(x: int, y: int): boolean;
|
|
17
|
+
getModules(): boolean[][];
|
|
18
|
+
private drawFunctionPatterns;
|
|
19
|
+
private drawFormatBits;
|
|
20
|
+
private drawVersion;
|
|
21
|
+
private drawFinderPattern;
|
|
22
|
+
private drawAlignmentPattern;
|
|
23
|
+
private setFunctionModule;
|
|
24
|
+
private addEccAndInterleave;
|
|
25
|
+
private drawCodewords;
|
|
26
|
+
private applyMask;
|
|
27
|
+
private getPenaltyScore;
|
|
28
|
+
private getAlignmentPatternPositions;
|
|
29
|
+
private static getNumRawDataModules;
|
|
30
|
+
private static getNumDataCodewords;
|
|
31
|
+
private static reedSolomonComputeDivisor;
|
|
32
|
+
private static reedSolomonComputeRemainder;
|
|
33
|
+
private static reedSolomonMultiply;
|
|
34
|
+
private finderPenaltyCountPatterns;
|
|
35
|
+
private finderPenaltyTerminateAndCount;
|
|
36
|
+
private finderPenaltyAddHistory;
|
|
37
|
+
static readonly MIN_VERSION: int;
|
|
38
|
+
static readonly MAX_VERSION: int;
|
|
39
|
+
private static readonly PENALTY_N1;
|
|
40
|
+
private static readonly PENALTY_N2;
|
|
41
|
+
private static readonly PENALTY_N3;
|
|
42
|
+
private static readonly PENALTY_N4;
|
|
43
|
+
private static readonly ECC_CODEWORDS_PER_BLOCK;
|
|
44
|
+
private static readonly NUM_ERROR_CORRECTION_BLOCKS;
|
|
45
|
+
}
|
|
46
|
+
export class QrSegment {
|
|
47
|
+
readonly mode: QrSegment.Mode;
|
|
48
|
+
readonly numChars: int;
|
|
49
|
+
private readonly bitData;
|
|
50
|
+
static makeBytes(data: Readonly<byte[]>): QrSegment;
|
|
51
|
+
static makeNumeric(digits: string): QrSegment;
|
|
52
|
+
static makeAlphanumeric(text: string): QrSegment;
|
|
53
|
+
static makeSegments(text: string): QrSegment[];
|
|
54
|
+
static makeEci(assignVal: int): QrSegment;
|
|
55
|
+
static isNumeric(text: string): boolean;
|
|
56
|
+
static isAlphanumeric(text: string): boolean;
|
|
57
|
+
constructor(mode: QrSegment.Mode, numChars: int, bitData: bit[]);
|
|
58
|
+
getData(): bit[];
|
|
59
|
+
static getTotalBits(segs: Readonly<QrSegment[]>, version: int): number;
|
|
60
|
+
private static toUtf8ByteArray;
|
|
61
|
+
private static readonly NUMERIC_REGEX;
|
|
62
|
+
private static readonly ALPHANUMERIC_REGEX;
|
|
63
|
+
private static readonly ALPHANUMERIC_CHARSET;
|
|
64
|
+
}
|
|
65
|
+
export {};
|
|
66
|
+
}
|
|
67
|
+
declare namespace qrcodegen.QrCode {
|
|
68
|
+
type int = number;
|
|
69
|
+
export class Ecc {
|
|
70
|
+
readonly ordinal: int;
|
|
71
|
+
readonly formatBits: int;
|
|
72
|
+
static readonly LOW: Ecc;
|
|
73
|
+
static readonly MEDIUM: Ecc;
|
|
74
|
+
static readonly QUARTILE: Ecc;
|
|
75
|
+
static readonly HIGH: Ecc;
|
|
76
|
+
private constructor();
|
|
77
|
+
}
|
|
78
|
+
export {};
|
|
79
|
+
}
|
|
80
|
+
declare namespace qrcodegen.QrSegment {
|
|
81
|
+
type int = number;
|
|
82
|
+
export class Mode {
|
|
83
|
+
readonly modeBits: int;
|
|
84
|
+
private readonly numBitsCharCount;
|
|
85
|
+
static readonly NUMERIC: Mode;
|
|
86
|
+
static readonly ALPHANUMERIC: Mode;
|
|
87
|
+
static readonly BYTE: Mode;
|
|
88
|
+
static readonly KANJI: Mode;
|
|
89
|
+
static readonly ECI: Mode;
|
|
90
|
+
private constructor();
|
|
91
|
+
numCharCountBits(ver: int): int;
|
|
92
|
+
}
|
|
93
|
+
export {};
|
|
94
|
+
}
|
|
95
|
+
export default qrcodegen;
|