hy-dispatch-ui-v3 0.1.5 → 0.1.6
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/tailwind.css +59 -0
- package/es/components/appConfigProvider/appConfigProvider.vue.mjs +3 -3
- package/es/components/appConfirmDialog/appConfirmDialog.vue.mjs +3 -3
- package/es/components/appConfirmDialog/appConfirmMethod.mjs +13 -13
- package/es/components/appCutter/appCutter.vue.mjs +285 -0
- package/es/components/appCutter/index.mjs +6 -0
- package/es/components/appCutter/style/appCutter.scss +51 -0
- package/es/components/appDialog/appDialog.vue.mjs +205 -0
- package/es/components/appDialog/index.mjs +6 -0
- package/es/components/appDialog/style/appDialog.scss +0 -0
- package/es/components/appTable/appTable.vue.mjs +1 -1
- package/es/components/index.mjs +2 -0
- package/es/hooks/useApi.mjs +6 -2
- package/es/hooks/useGlobalConfig.mjs +2 -2
- package/es/hooks/useLocale.mjs +14 -4
- package/es/hooks/useUserAvatarMap.mjs +6 -2
- package/es/index.mjs +4 -1
- package/es/locale/en.mjs +6 -1
- package/es/locale/zh_CN.mjs +8 -3
- package/es/utils/file.mjs +68 -0
- package/es/utils/index.mjs +2 -1
- package/es/utils/is.mjs +4 -1
- package/es/version.mjs +1 -1
- package/lib/components/appConfigProvider/appConfigProvider.vue.js +1 -1
- package/lib/components/appConfirmDialog/appConfirmDialog.vue.js +3 -3
- package/lib/components/appConfirmDialog/appConfirmMethod.js +13 -13
- package/lib/components/appCutter/appCutter.vue.js +289 -0
- package/lib/components/appCutter/index.js +11 -0
- package/lib/components/appCutter/style/appCutter.scss +51 -0
- package/lib/components/appDialog/appDialog.vue.js +209 -0
- package/lib/components/appDialog/index.js +11 -0
- package/lib/components/appDialog/style/appDialog.scss +0 -0
- package/lib/components/appTable/appTable.vue.js +1 -1
- package/lib/components/index.js +26 -22
- package/lib/hooks/useApi.js +6 -2
- package/lib/hooks/useLocale.js +13 -3
- package/lib/hooks/useUserAvatarMap.js +6 -2
- package/lib/index.js +35 -22
- package/lib/locale/en.js +6 -1
- package/lib/locale/zh_CN.js +8 -3
- package/lib/utils/file.js +76 -0
- package/lib/utils/index.js +9 -0
- package/lib/utils/is.js +4 -0
- package/lib/version.js +1 -1
- package/package.json +2 -3
package/lib/hooks/useLocale.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var vue = require('vue');
|
|
4
4
|
var lodashUnified = require('lodash-unified');
|
|
5
|
+
var useGlobalConfig = require('./useGlobalConfig.js');
|
|
6
|
+
var index = require('../locale/index.js');
|
|
5
7
|
var zh_CN = require('../locale/zh_CN.js');
|
|
6
8
|
|
|
7
9
|
const buildTranslator = (locale) => (path, option) => translate(path, option, vue.unref(locale));
|
|
@@ -23,13 +25,21 @@ const buildLocaleContext = (locale, conifg) => {
|
|
|
23
25
|
};
|
|
24
26
|
const localeContextKey = /* @__PURE__ */ Symbol("localeContextKey");
|
|
25
27
|
const getLanguage = (localeOverrides) => {
|
|
26
|
-
var _a
|
|
28
|
+
var _a;
|
|
27
29
|
const locale = localeOverrides || vue.inject(localeContextKey, vue.ref());
|
|
28
|
-
return ((_a = vue.unref(locale)) == null ? void 0 : _a.name) || (
|
|
30
|
+
return ((_a = vue.unref(locale)) == null ? void 0 : _a.name) || (Chinese == null ? void 0 : Chinese.name);
|
|
29
31
|
};
|
|
30
32
|
const useLocale = (localeOverrides) => {
|
|
31
33
|
const locale = localeOverrides || vue.inject(localeContextKey, vue.ref());
|
|
32
|
-
|
|
34
|
+
const globalConfig = useGlobalConfig.useGlobalConfig();
|
|
35
|
+
return buildLocaleContext(
|
|
36
|
+
vue.computed(
|
|
37
|
+
() => {
|
|
38
|
+
var _a;
|
|
39
|
+
return vue.unref(locale) || index[(_a = vue.unref(globalConfig)) == null ? void 0 : _a.locale] || zh_CN.default;
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
);
|
|
33
43
|
};
|
|
34
44
|
|
|
35
45
|
exports.buildLocaleContext = buildLocaleContext;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var vue = require('vue');
|
|
4
|
+
var useGlobalConfig = require('./useGlobalConfig.js');
|
|
4
5
|
|
|
5
6
|
const localUserAvatarMapKey = /* @__PURE__ */ Symbol("userAvatarMap");
|
|
6
7
|
const useUserAvatarMap = () => {
|
|
7
|
-
const userAvatarMap = vue.inject(localUserAvatarMapKey, vue.ref(
|
|
8
|
-
|
|
8
|
+
const userAvatarMap = vue.inject(localUserAvatarMapKey, vue.ref());
|
|
9
|
+
const globalConfig = useGlobalConfig.useGlobalConfig();
|
|
10
|
+
return {
|
|
11
|
+
userAvatarMap: unref(userAvatarMap) ? userAvatarMap : unref(globalConfig).userAvatarMap || vue.ref(/* @__PURE__ */ new Map())
|
|
12
|
+
};
|
|
9
13
|
};
|
|
10
14
|
|
|
11
15
|
exports.localUserAvatarMapKey = localUserAvatarMapKey;
|
package/lib/index.js
CHANGED
|
@@ -6,18 +6,21 @@ var makeInstaller = require('./make-installer.js');
|
|
|
6
6
|
var index = require('./components/appButton/index.js');
|
|
7
7
|
var index$1 = require('./components/appConfigProvider/index.js');
|
|
8
8
|
var index$2 = require('./components/appConfirmDialog/index.js');
|
|
9
|
-
var index$3 = require('./components/
|
|
10
|
-
var index$4 = require('./components/
|
|
11
|
-
var index$5 = require('./components/
|
|
12
|
-
var index$6 = require('./components/
|
|
13
|
-
var index$7 = require('./components/
|
|
14
|
-
var index$8 = require('./components/
|
|
15
|
-
var index$9 = require('./components/
|
|
16
|
-
var index$a = require('./components/
|
|
17
|
-
var index$b = require('./components/
|
|
18
|
-
var index$c = require('./components/
|
|
19
|
-
var index$d = require('./components/
|
|
9
|
+
var index$3 = require('./components/appCutter/index.js');
|
|
10
|
+
var index$4 = require('./components/appDatePicker/index.js');
|
|
11
|
+
var index$5 = require('./components/appDialog/index.js');
|
|
12
|
+
var index$6 = require('./components/appForm/index.js');
|
|
13
|
+
var index$7 = require('./components/appIcon/index.js');
|
|
14
|
+
var index$8 = require('./components/appIconBox/index.js');
|
|
15
|
+
var index$9 = require('./components/appNoPermissions/index.js');
|
|
16
|
+
var index$a = require('./components/appNoPermissionsMap/index.js');
|
|
17
|
+
var index$b = require('./components/appOrgCascader/index.js');
|
|
18
|
+
var index$c = require('./components/appSearch/index.js');
|
|
19
|
+
var index$d = require('./components/appTable/index.js');
|
|
20
|
+
var index$e = require('./components/appTooltip/index.js');
|
|
21
|
+
var index$f = require('./components/appUserAvatar/index.js');
|
|
20
22
|
var crypto = require('./utils/crypto.js');
|
|
23
|
+
var file = require('./utils/file.js');
|
|
21
24
|
var useLocale = require('./hooks/useLocale.js');
|
|
22
25
|
var bus = require('./utils/bus.js');
|
|
23
26
|
var handler = require('./utils/handler.js');
|
|
@@ -40,20 +43,29 @@ exports.default = makeInstaller.default;
|
|
|
40
43
|
exports.AppButton = index.AppButton;
|
|
41
44
|
exports.AppConfigProvider = index$1.AppConfigProvider;
|
|
42
45
|
exports.AppConfirmDialog = index$2.AppConfirmDialog;
|
|
43
|
-
exports.
|
|
44
|
-
exports.
|
|
45
|
-
exports.
|
|
46
|
-
exports.
|
|
47
|
-
exports.
|
|
48
|
-
exports.
|
|
49
|
-
exports.
|
|
50
|
-
exports.
|
|
51
|
-
exports.
|
|
52
|
-
exports.
|
|
53
|
-
exports.
|
|
46
|
+
exports.AppCutter = index$3.AppCutter;
|
|
47
|
+
exports.AppDatePicker = index$4.AppDatePicker;
|
|
48
|
+
exports.AppDialog = index$5.AppDialog;
|
|
49
|
+
exports.AppForm = index$6.AppForm;
|
|
50
|
+
exports.AppIcon = index$7.AppIcon;
|
|
51
|
+
exports.AppIconBox = index$8.AppIconBox;
|
|
52
|
+
exports.AppNoPermissions = index$9.AppNoPermissions;
|
|
53
|
+
exports.AppNoPermissionsMap = index$a.AppNoPermissionsMap;
|
|
54
|
+
exports.AppOrgCascader = index$b.AppOrgCascader;
|
|
55
|
+
exports.AppSearch = index$c.AppSearch;
|
|
56
|
+
exports.AppTable = index$d.AppTable;
|
|
57
|
+
exports.AppTooltip = index$e.AppTooltip;
|
|
58
|
+
exports.AppUserAvatar = index$f.AppUserAvatar;
|
|
54
59
|
exports.base64Decrypt = crypto.base64Decrypt;
|
|
55
60
|
exports.encryptToBase64 = crypto.encryptToBase64;
|
|
56
61
|
exports.generateRandomCode = crypto.generateRandomCode;
|
|
62
|
+
exports.blobToDataURL = file.blobToDataURL;
|
|
63
|
+
exports.directTransmission = file.directTransmission;
|
|
64
|
+
exports.fileFormUpload = file.fileFormUpload;
|
|
65
|
+
exports.fileJsonUplaod = file.fileJsonUplaod;
|
|
66
|
+
exports.fileUpload = file.fileUpload;
|
|
67
|
+
exports.presignedUrl = file.presignedUrl;
|
|
68
|
+
exports.sizeToTextHandler = file.sizeToTextHandler;
|
|
57
69
|
exports.buildLocaleContext = useLocale.buildLocaleContext;
|
|
58
70
|
exports.buildTranslator = useLocale.buildTranslator;
|
|
59
71
|
exports.getLanguage = useLocale.getLanguage;
|
|
@@ -76,6 +88,7 @@ exports.getDefaultValueFormatByType = date.getDefaultValueFormatByType;
|
|
|
76
88
|
exports.isArray = is.isArray;
|
|
77
89
|
exports.isBoolean = is.isBoolean;
|
|
78
90
|
exports.isEmpty = is.isEmpty;
|
|
91
|
+
exports.isFile = is.isFile;
|
|
79
92
|
exports.isFunction = is.isFunction;
|
|
80
93
|
exports.isNull = is.isNull;
|
|
81
94
|
exports.isNumber = is.isNumber;
|
package/lib/locale/en.js
CHANGED
|
@@ -55,7 +55,7 @@ var en = {
|
|
|
55
55
|
searchFor: "Search For {0}",
|
|
56
56
|
example: "Example"
|
|
57
57
|
},
|
|
58
|
-
|
|
58
|
+
dialog: {
|
|
59
59
|
content: "Secondary Confirmation Operation",
|
|
60
60
|
close: "Close",
|
|
61
61
|
cancel: "Cancel",
|
|
@@ -77,6 +77,11 @@ var en = {
|
|
|
77
77
|
pleaseContactTheAdministrator: "Please Contact The Administrator",
|
|
78
78
|
youDoNotHaveAMapConfigurationForThisModule: "You Do Not Have A Map Configuration For This Module",
|
|
79
79
|
pleaseContactTheAdministratorToGoToTheSettingsCenterForConfiguration: "Please Contact The Administrator To Go To The Settings Center For Configuration"
|
|
80
|
+
},
|
|
81
|
+
cutter: {
|
|
82
|
+
uploadPictures: "Upload Picture",
|
|
83
|
+
uploadPictureLimit: "The Image Upload Failed. The File Size Cannot Exceed {0}",
|
|
84
|
+
imageSegmentation: "Image Segmentation"
|
|
80
85
|
}
|
|
81
86
|
};
|
|
82
87
|
|
package/lib/locale/zh_CN.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var zh_CN = {
|
|
6
6
|
name: "zh_CN",
|
|
7
7
|
hy: {
|
|
8
8
|
language: "\u8BED\u8A00",
|
|
@@ -56,7 +56,7 @@ var Chinese = {
|
|
|
56
56
|
maxColumnLimitTip: "\u5DF2\u8FBE\u5230\u5B57\u6BB5\u6570\u91CF\u4E0A\u9650(\u6700\u591A15\u4E2A)\uFF0C\u8BF7\u53D6\u6D88\u90E8\u5206\u5B57\u6BB5\u540E\u518D\u786E\u8BA4",
|
|
57
57
|
example: "\u793A\u4F8B"
|
|
58
58
|
},
|
|
59
|
-
|
|
59
|
+
dialog: {
|
|
60
60
|
content: "\u4E8C\u6B21\u786E\u8BA4\u64CD\u4F5C",
|
|
61
61
|
close: "\u5173\u95ED",
|
|
62
62
|
cancel: "\u53D6\u6D88",
|
|
@@ -77,7 +77,12 @@ var Chinese = {
|
|
|
77
77
|
pleaseContactTheAdministrator: "\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458",
|
|
78
78
|
youDoNotHaveAMapConfigurationForThisModule: "\u60A8\u6CA1\u6709\u8BE5\u6A21\u5757\u7684\u5730\u56FE\u914D\u7F6E",
|
|
79
79
|
pleaseContactTheAdministratorToGoToTheSettingsCenterForConfiguration: "\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u524D\u5F80\u8BBE\u7F6E\u4E2D\u5FC3\u8FDB\u884C\u914D\u7F6E"
|
|
80
|
+
},
|
|
81
|
+
cutter: {
|
|
82
|
+
uploadPicture: "\u4E0A\u4F20\u56FE\u7247",
|
|
83
|
+
uploadPictureLimit: "\u56FE\u7247\u4E0A\u4F20\u5931\u8D25\uFF0C\u6587\u4EF6\u4E0D\u80FD\u5927\u4E8E{0}",
|
|
84
|
+
imageSegmentation: "\u56FE\u50CF\u5207\u5272"
|
|
80
85
|
}
|
|
81
86
|
};
|
|
82
87
|
|
|
83
|
-
exports.default =
|
|
88
|
+
exports.default = zh_CN;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
var handler = require('./handler.js');
|
|
5
|
+
var useApi = require('../hooks/useApi.js');
|
|
6
|
+
|
|
7
|
+
function blobToDataURL(bolb) {
|
|
8
|
+
return new Promise((resolve) => {
|
|
9
|
+
const a = new FileReader();
|
|
10
|
+
a.onload = function(e) {
|
|
11
|
+
resolve(e.target.result);
|
|
12
|
+
};
|
|
13
|
+
a.readAsDataURL(bolb);
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
async function presignedUrl(file) {
|
|
17
|
+
const { api } = useApi.useApi();
|
|
18
|
+
const fileList = file.name.split(".");
|
|
19
|
+
const res = await vue.unref(api).post("file/presignedUrl", {
|
|
20
|
+
fileName: `${handler.createUniqueId(1)}.${fileList[fileList.length - 1]}`
|
|
21
|
+
});
|
|
22
|
+
if (res.code === 200) {
|
|
23
|
+
return res;
|
|
24
|
+
} else {
|
|
25
|
+
return Promise.reject(res);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
async function fileJsonUplaod(file) {
|
|
29
|
+
const { api } = useApi.useApi();
|
|
30
|
+
const result = await presignedUrl(file);
|
|
31
|
+
await vue.unref(api).put(result.data.url, file, {
|
|
32
|
+
otherUrl: true,
|
|
33
|
+
xAmzAcl: true
|
|
34
|
+
});
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
async function fileFormUpload(file) {
|
|
38
|
+
const { api } = useApi.useApi();
|
|
39
|
+
try {
|
|
40
|
+
const formData = new FormData();
|
|
41
|
+
formData.append("file", file);
|
|
42
|
+
const res = await vue.unref(api).post("/file/upload", formData, {
|
|
43
|
+
otherUrl: true,
|
|
44
|
+
xAmzAcl: false
|
|
45
|
+
});
|
|
46
|
+
return res;
|
|
47
|
+
} catch (err) {
|
|
48
|
+
return Promise.reject(err);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
let directTransmission = true;
|
|
52
|
+
async function fileUpload(file) {
|
|
53
|
+
{
|
|
54
|
+
return await fileJsonUplaod(file);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async function sizeToTextHandler(size) {
|
|
58
|
+
if (size < Math.pow(1024, 1)) {
|
|
59
|
+
return `${Math.floor(size / Math.pow(1024, 1) / 100) * 100}KB`;
|
|
60
|
+
}
|
|
61
|
+
if (size < Math.pow(1024, 2)) {
|
|
62
|
+
return `${Math.floor(size / Math.pow(1024, 2) / 100) * 100}MB`;
|
|
63
|
+
}
|
|
64
|
+
if (size < Math.pow(1024, 3)) {
|
|
65
|
+
return `${Math.floor(size / Math.pow(1024, 3) / 100) * 100}GB`;
|
|
66
|
+
}
|
|
67
|
+
return `${Math.floor(size / Math.pow(1024, 4) / 100) * 100}TB`;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
exports.blobToDataURL = blobToDataURL;
|
|
71
|
+
exports.directTransmission = directTransmission;
|
|
72
|
+
exports.fileFormUpload = fileFormUpload;
|
|
73
|
+
exports.fileJsonUplaod = fileJsonUplaod;
|
|
74
|
+
exports.fileUpload = fileUpload;
|
|
75
|
+
exports.presignedUrl = presignedUrl;
|
|
76
|
+
exports.sizeToTextHandler = sizeToTextHandler;
|
package/lib/utils/index.js
CHANGED
|
@@ -6,6 +6,7 @@ var crypto = require('./crypto.js');
|
|
|
6
6
|
var is = require('./is.js');
|
|
7
7
|
var handler = require('./handler.js');
|
|
8
8
|
var date = require('./date.js');
|
|
9
|
+
var file = require('./file.js');
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
|
|
@@ -20,6 +21,7 @@ exports.generateRandomCode = crypto.generateRandomCode;
|
|
|
20
21
|
exports.isArray = is.isArray;
|
|
21
22
|
exports.isBoolean = is.isBoolean;
|
|
22
23
|
exports.isEmpty = is.isEmpty;
|
|
24
|
+
exports.isFile = is.isFile;
|
|
23
25
|
exports.isFunction = is.isFunction;
|
|
24
26
|
exports.isNull = is.isNull;
|
|
25
27
|
exports.isNumber = is.isNumber;
|
|
@@ -35,3 +37,10 @@ exports.funRunHandler = handler.funRunHandler;
|
|
|
35
37
|
exports.mergeDeep = handler.mergeDeep;
|
|
36
38
|
exports.withInstall = handler.withInstall;
|
|
37
39
|
exports.getDefaultValueFormatByType = date.getDefaultValueFormatByType;
|
|
40
|
+
exports.blobToDataURL = file.blobToDataURL;
|
|
41
|
+
exports.directTransmission = file.directTransmission;
|
|
42
|
+
exports.fileFormUpload = file.fileFormUpload;
|
|
43
|
+
exports.fileJsonUplaod = file.fileJsonUplaod;
|
|
44
|
+
exports.fileUpload = file.fileUpload;
|
|
45
|
+
exports.presignedUrl = file.presignedUrl;
|
|
46
|
+
exports.sizeToTextHandler = file.sizeToTextHandler;
|
package/lib/utils/is.js
CHANGED
|
@@ -16,10 +16,14 @@ const isOverflowing = (e) => e.clientWidth < e.scrollWidth || e.clientHeight < e
|
|
|
16
16
|
const isVueProxy = (e) => {
|
|
17
17
|
return vue.isRef(e) || vue.isReactive(e) || vue.isReadonly(e) || vue.isProxy(e);
|
|
18
18
|
};
|
|
19
|
+
const isFile = (e) => {
|
|
20
|
+
return e instanceof File;
|
|
21
|
+
};
|
|
19
22
|
|
|
20
23
|
exports.isArray = isArray;
|
|
21
24
|
exports.isBoolean = isBoolean;
|
|
22
25
|
exports.isEmpty = isEmpty;
|
|
26
|
+
exports.isFile = isFile;
|
|
23
27
|
exports.isFunction = isFunction;
|
|
24
28
|
exports.isNull = isNull;
|
|
25
29
|
exports.isNumber = isNumber;
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hy-dispatch-ui-v3",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"module": "es/index.mjs",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "pnpm run gen:version && vite",
|
|
8
8
|
"build": "vite build",
|
|
9
|
-
|
|
10
9
|
"compile": "node scripts/cli/compile.js compile",
|
|
11
|
-
|
|
12
10
|
"compile:tailwind": "node scripts/cli/compile.js compile:tailwind",
|
|
13
11
|
"create:comp": "node scripts/cli/compile.js create:component",
|
|
14
12
|
"gen:version": "node scripts/cli/compile.js gen:version",
|
|
@@ -24,6 +22,7 @@
|
|
|
24
22
|
"mitt": "^3.0.1",
|
|
25
23
|
"sortablejs": "^1.15.7",
|
|
26
24
|
"vue": "^3.5.25",
|
|
25
|
+
"vue-cropper": "^1.1.4",
|
|
27
26
|
"vue-router": "^5.0.3"
|
|
28
27
|
},
|
|
29
28
|
"devDependencies": {
|