hy-dispatch-ui-v3 0.1.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/LICENSE +21 -0
- package/README.md +3 -0
- package/dist/tailwind.css +1083 -0
- package/es/bussiness/index.mjs +2 -0
- package/es/bussiness/index.mjs.map +1 -0
- package/es/components/appConfirmDialog/appConfirmDialog.vue.mjs +204 -0
- package/es/components/appConfirmDialog/appConfirmDialog.vue.mjs.map +1 -0
- package/es/components/appConfirmDialog/appConfirmMethod.mjs +73 -0
- package/es/components/appConfirmDialog/appConfirmMethod.mjs.map +1 -0
- package/es/components/appConfirmDialog/index.mjs +8 -0
- package/es/components/appConfirmDialog/index.mjs.map +1 -0
- package/es/components/appConfirmDialog/style/appConfirmDialog.scss +5 -0
- package/es/components/appDatePicker/appDatePicker.vue.mjs +99 -0
- package/es/components/appDatePicker/appDatePicker.vue.mjs.map +1 -0
- package/es/components/appDatePicker/index.mjs +7 -0
- package/es/components/appDatePicker/index.mjs.map +1 -0
- package/es/components/appDatePicker/style/appDatePicker.scss +0 -0
- package/es/components/appForm/appForm.vue.mjs +331 -0
- package/es/components/appForm/appForm.vue.mjs.map +1 -0
- package/es/components/appForm/index.mjs +8 -0
- package/es/components/appForm/index.mjs.map +1 -0
- package/es/components/appForm/js/index.mjs +87 -0
- package/es/components/appForm/js/index.mjs.map +1 -0
- package/es/components/appForm/js/useAppForm.mjs +149 -0
- package/es/components/appForm/js/useAppForm.mjs.map +1 -0
- package/es/components/appForm/style/appForm.scss +16 -0
- package/es/components/appOrgCascader/appOrgCascader.vue.mjs +229 -0
- package/es/components/appOrgCascader/appOrgCascader.vue.mjs.map +1 -0
- package/es/components/appOrgCascader/index.mjs +7 -0
- package/es/components/appOrgCascader/index.mjs.map +1 -0
- package/es/components/appOrgCascader/style/appOrgCascader.scss +0 -0
- package/es/components/appSearch/appSearch.vue.mjs +408 -0
- package/es/components/appSearch/appSearch.vue.mjs.map +1 -0
- package/es/components/appSearch/index.mjs +8 -0
- package/es/components/appSearch/index.mjs.map +1 -0
- package/es/components/appSearch/js/index.mjs +114 -0
- package/es/components/appSearch/js/index.mjs.map +1 -0
- package/es/components/appSearch/js/useAppSearch.mjs +178 -0
- package/es/components/appSearch/js/useAppSearch.mjs.map +1 -0
- package/es/components/appSearch/style/appSearch.scss +53 -0
- package/es/components/appTable/appTable.vue.mjs +578 -0
- package/es/components/appTable/appTable.vue.mjs.map +1 -0
- package/es/components/appTable/cpns/columnSelect.vue.mjs +414 -0
- package/es/components/appTable/cpns/columnSelect.vue.mjs.map +1 -0
- package/es/components/appTable/index.mjs +8 -0
- package/es/components/appTable/index.mjs.map +1 -0
- package/es/components/appTable/js/index.mjs +304 -0
- package/es/components/appTable/js/index.mjs.map +1 -0
- package/es/components/appTable/js/search.mjs +129 -0
- package/es/components/appTable/js/search.mjs.map +1 -0
- package/es/components/appTable/js/useAppTable.mjs +63 -0
- package/es/components/appTable/js/useAppTable.mjs.map +1 -0
- package/es/components/appTable/style/appTable.scss +15 -0
- package/es/components/appTooltip/appTooltip.vue.mjs +94 -0
- package/es/components/appTooltip/appTooltip.vue.mjs.map +1 -0
- package/es/components/appTooltip/index.mjs +7 -0
- package/es/components/appTooltip/index.mjs.map +1 -0
- package/es/components/appTooltip/style/appTooltip.scss +0 -0
- package/es/components/index.mjs +12 -0
- package/es/components/index.mjs.map +1 -0
- package/es/components/svgIcon/iconBox.vue.mjs +99 -0
- package/es/components/svgIcon/iconBox.vue.mjs.map +1 -0
- package/es/components/svgIcon/index.mjs +9 -0
- package/es/components/svgIcon/index.mjs.map +1 -0
- package/es/components/svgIcon/style/iconBox.scss +13 -0
- package/es/components/svgIcon/style/svgIcon.scss +12 -0
- package/es/components/svgIcon/svgIcon.vue.mjs +47 -0
- package/es/components/svgIcon/svgIcon.vue.mjs.map +1 -0
- package/es/config/index.mjs +2 -0
- package/es/config/index.mjs.map +1 -0
- package/es/constants/index.mjs +4 -0
- package/es/constants/index.mjs.map +1 -0
- package/es/constants/keys.mjs +2 -0
- package/es/constants/keys.mjs.map +1 -0
- package/es/hooks/index.mjs +5 -0
- package/es/hooks/index.mjs.map +1 -0
- package/es/hooks/useApi.mjs +10 -0
- package/es/hooks/useApi.mjs.map +1 -0
- package/es/hooks/useGlobalConfig.mjs +56 -0
- package/es/hooks/useGlobalConfig.mjs.map +1 -0
- package/es/hooks/useLocale.mjs +34 -0
- package/es/hooks/useLocale.mjs.map +1 -0
- package/es/hooks/useMixins.mjs +19 -0
- package/es/hooks/useMixins.mjs.map +1 -0
- package/es/index.mjs +30 -0
- package/es/index.mjs.map +1 -0
- package/es/locale/en_US.mjs +67 -0
- package/es/locale/en_US.mjs.map +1 -0
- package/es/locale/index.mjs +3 -0
- package/es/locale/index.mjs.map +1 -0
- package/es/locale/zh_CN.mjs +67 -0
- package/es/locale/zh_CN.mjs.map +1 -0
- package/es/make-installer.mjs +29 -0
- package/es/make-installer.mjs.map +1 -0
- package/es/store/index.mjs +7 -0
- package/es/store/index.mjs.map +1 -0
- package/es/store/maintain.mjs +90 -0
- package/es/store/maintain.mjs.map +1 -0
- package/es/style/index.scss +46 -0
- package/es/style/tailwind.scss +3 -0
- package/es/style/theme.scss +123 -0
- package/es/utils/adaptive.mjs +30 -0
- package/es/utils/adaptive.mjs.map +1 -0
- package/es/utils/bus.mjs +6 -0
- package/es/utils/bus.mjs.map +1 -0
- package/es/utils/crypto.mjs +21 -0
- package/es/utils/crypto.mjs.map +1 -0
- package/es/utils/date.mjs +25 -0
- package/es/utils/date.mjs.map +1 -0
- package/es/utils/handler.mjs +83 -0
- package/es/utils/handler.mjs.map +1 -0
- package/es/utils/index.mjs +7 -0
- package/es/utils/index.mjs.map +1 -0
- package/es/utils/is.mjs +19 -0
- package/es/utils/is.mjs.map +1 -0
- package/es/version.mjs +4 -0
- package/es/version.mjs.map +1 -0
- package/lib/bussiness/index.js +3 -0
- package/lib/bussiness/index.js.map +1 -0
- package/lib/components/appConfirmDialog/appConfirmDialog.vue.js +208 -0
- package/lib/components/appConfirmDialog/appConfirmDialog.vue.js.map +1 -0
- package/lib/components/appConfirmDialog/appConfirmMethod.js +77 -0
- package/lib/components/appConfirmDialog/appConfirmMethod.js.map +1 -0
- package/lib/components/appConfirmDialog/index.js +13 -0
- package/lib/components/appConfirmDialog/index.js.map +1 -0
- package/lib/components/appConfirmDialog/style/appConfirmDialog.scss +5 -0
- package/lib/components/appDatePicker/appDatePicker.vue.js +103 -0
- package/lib/components/appDatePicker/appDatePicker.vue.js.map +1 -0
- package/lib/components/appDatePicker/index.js +12 -0
- package/lib/components/appDatePicker/index.js.map +1 -0
- package/lib/components/appDatePicker/style/appDatePicker.scss +0 -0
- package/lib/components/appForm/appForm.vue.js +335 -0
- package/lib/components/appForm/appForm.vue.js.map +1 -0
- package/lib/components/appForm/index.js +14 -0
- package/lib/components/appForm/index.js.map +1 -0
- package/lib/components/appForm/js/index.js +93 -0
- package/lib/components/appForm/js/index.js.map +1 -0
- package/lib/components/appForm/js/useAppForm.js +152 -0
- package/lib/components/appForm/js/useAppForm.js.map +1 -0
- package/lib/components/appForm/style/appForm.scss +16 -0
- package/lib/components/appOrgCascader/appOrgCascader.vue.js +233 -0
- package/lib/components/appOrgCascader/appOrgCascader.vue.js.map +1 -0
- package/lib/components/appOrgCascader/index.js +12 -0
- package/lib/components/appOrgCascader/index.js.map +1 -0
- package/lib/components/appOrgCascader/style/appOrgCascader.scss +0 -0
- package/lib/components/appSearch/appSearch.vue.js +412 -0
- package/lib/components/appSearch/appSearch.vue.js.map +1 -0
- package/lib/components/appSearch/index.js +14 -0
- package/lib/components/appSearch/index.js.map +1 -0
- package/lib/components/appSearch/js/index.js +122 -0
- package/lib/components/appSearch/js/index.js.map +1 -0
- package/lib/components/appSearch/js/useAppSearch.js +181 -0
- package/lib/components/appSearch/js/useAppSearch.js.map +1 -0
- package/lib/components/appSearch/style/appSearch.scss +53 -0
- package/lib/components/appTable/appTable.vue.js +582 -0
- package/lib/components/appTable/appTable.vue.js.map +1 -0
- package/lib/components/appTable/cpns/columnSelect.vue.js +418 -0
- package/lib/components/appTable/cpns/columnSelect.vue.js.map +1 -0
- package/lib/components/appTable/index.js +14 -0
- package/lib/components/appTable/index.js.map +1 -0
- package/lib/components/appTable/js/index.js +311 -0
- package/lib/components/appTable/js/index.js.map +1 -0
- package/lib/components/appTable/js/search.js +131 -0
- package/lib/components/appTable/js/search.js.map +1 -0
- package/lib/components/appTable/js/useAppTable.js +65 -0
- package/lib/components/appTable/js/useAppTable.js.map +1 -0
- package/lib/components/appTable/style/appTable.scss +15 -0
- package/lib/components/appTooltip/appTooltip.vue.js +98 -0
- package/lib/components/appTooltip/appTooltip.vue.js.map +1 -0
- package/lib/components/appTooltip/index.js +12 -0
- package/lib/components/appTooltip/index.js.map +1 -0
- package/lib/components/appTooltip/style/appTooltip.scss +0 -0
- package/lib/components/index.js +29 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/svgIcon/iconBox.vue.js +103 -0
- package/lib/components/svgIcon/iconBox.vue.js.map +1 -0
- package/lib/components/svgIcon/index.js +15 -0
- package/lib/components/svgIcon/index.js.map +1 -0
- package/lib/components/svgIcon/style/iconBox.scss +13 -0
- package/lib/components/svgIcon/style/svgIcon.scss +12 -0
- package/lib/components/svgIcon/svgIcon.vue.js +51 -0
- package/lib/components/svgIcon/svgIcon.vue.js.map +1 -0
- package/lib/config/index.js +3 -0
- package/lib/config/index.js.map +1 -0
- package/lib/constants/index.js +6 -0
- package/lib/constants/index.js.map +1 -0
- package/lib/constants/keys.js +3 -0
- package/lib/constants/keys.js.map +1 -0
- package/lib/hooks/index.js +21 -0
- package/lib/hooks/index.js.map +1 -0
- package/lib/hooks/useApi.js +13 -0
- package/lib/hooks/useApi.js.map +1 -0
- package/lib/hooks/useGlobalConfig.js +59 -0
- package/lib/hooks/useGlobalConfig.js.map +1 -0
- package/lib/hooks/useLocale.js +41 -0
- package/lib/hooks/useLocale.js.map +1 -0
- package/lib/hooks/useMixins.js +21 -0
- package/lib/hooks/useMixins.js.map +1 -0
- package/lib/index.js +85 -0
- package/lib/index.js.map +1 -0
- package/lib/locale/en_US.js +71 -0
- package/lib/locale/en_US.js.map +1 -0
- package/lib/locale/index.js +10 -0
- package/lib/locale/index.js.map +1 -0
- package/lib/locale/zh_CN.js +71 -0
- package/lib/locale/zh_CN.js.map +1 -0
- package/lib/make-installer.js +33 -0
- package/lib/make-installer.js.map +1 -0
- package/lib/store/index.js +10 -0
- package/lib/store/index.js.map +1 -0
- package/lib/store/maintain.js +92 -0
- package/lib/store/maintain.js.map +1 -0
- package/lib/style/index.scss +46 -0
- package/lib/style/tailwind.scss +3 -0
- package/lib/style/theme.scss +123 -0
- package/lib/utils/adaptive.js +35 -0
- package/lib/utils/adaptive.js.map +1 -0
- package/lib/utils/bus.js +8 -0
- package/lib/utils/bus.js.map +1 -0
- package/lib/utils/crypto.js +25 -0
- package/lib/utils/crypto.js.map +1 -0
- package/lib/utils/date.js +27 -0
- package/lib/utils/date.js.map +1 -0
- package/lib/utils/handler.js +89 -0
- package/lib/utils/handler.js.map +1 -0
- package/lib/utils/index.js +38 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/is.js +32 -0
- package/lib/utils/is.js.map +1 -0
- package/lib/version.js +6 -0
- package/lib/version.js.map +1 -0
- package/package.json +102 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { INSTALLED_KEY } from './constants/index.mjs';
|
|
2
|
+
import * as index from './components/index.mjs';
|
|
3
|
+
import { version } from './version.mjs';
|
|
4
|
+
import { store } from './store/index.mjs';
|
|
5
|
+
import { useGlobalConfig } from './hooks/useGlobalConfig.mjs';
|
|
6
|
+
|
|
7
|
+
const makeInstaller = () => {
|
|
8
|
+
const install = (app, options) => {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
if (app[INSTALLED_KEY]) return;
|
|
11
|
+
app[INSTALLED_KEY] = true;
|
|
12
|
+
Object.values(index).forEach((component) => {
|
|
13
|
+
if (!component.install) return;
|
|
14
|
+
app.use(component);
|
|
15
|
+
});
|
|
16
|
+
if (options) useGlobalConfig(options, app);
|
|
17
|
+
if (!((_b = (_a = app.config) == null ? void 0 : _a.globalProperties) == null ? void 0 : _b.$pinia)) {
|
|
18
|
+
app.use(store);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
version,
|
|
23
|
+
install
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
var installer = makeInstaller();
|
|
27
|
+
|
|
28
|
+
export { installer as default };
|
|
29
|
+
//# sourceMappingURL=make-installer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"make-installer.mjs","sources":["../packages/make-installer.js"],"sourcesContent":["import { useGlobalConfig } from './hooks'\nimport { INSTALLED_KEY } from './constants'\nimport * as components from './components'\nimport { version } from './version'\nimport { store } from './store'\n\nconst makeInstaller = () => {\n const install = (app, options) => {\n if (app[INSTALLED_KEY]) return\n\n app[INSTALLED_KEY] = true\n Object.values(components).forEach((component) => {\n if (!component.install) return\n app.use(component)\n })\n\n if (options) useGlobalConfig(options, app)\n if (!app.config?.globalProperties?.$pinia) {\n app.use(store)\n }\n }\n\n return {\n version,\n install,\n }\n}\n\nexport default makeInstaller()\n"],"names":["components"],"mappings":";;;;;;AAKA,MAAM,aAAa,GAAG,MAAM;AAC5B,EAAE,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK;AACpC,IAAI,IAAI,EAAE,EAAE,EAAE;AACd,IAAI,IAAI,GAAG,CAAC,aAAa,CAAC,EAAE;AAC5B,IAAI,GAAG,CAAC,aAAa,CAAC,GAAG,IAAI;AAC7B,IAAI,MAAM,CAAC,MAAM,CAACA,KAAU,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,KAAK;AACrD,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE;AAC9B,MAAM,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC;AACxB,IAAI,CAAC,CAAC;AACN,IAAI,IAAI,OAAO,EAAE,eAAe,CAAC,OAAO,EAAE,GAAG,CAAC;AAC9C,IAAI,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,MAAM,KAAK,IAAI,GAAG,MAAM,GAAG,EAAE,CAAC,gBAAgB,KAAK,IAAI,GAAG,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE;AACzG,MAAM,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC;AACpB,IAAI;AACJ,EAAE,CAAC;AACH,EAAE,OAAO;AACT,IAAI,OAAO;AACX,IAAI;AACJ,GAAG;AACH,CAAC;AACD,gBAAe,aAAa,EAAE;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../packages/store/index.js"],"sourcesContent":["import { createPinia } from 'pinia'\n\nexport * from './maintain'\n\nconst store = createPinia()\n\nexport { store }\n"],"names":[],"mappings":";;;AAEK,MAAC,KAAK,GAAG,WAAW;;;;"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { nextTick } from 'vue';
|
|
2
|
+
import { defineStore } from 'pinia';
|
|
3
|
+
import { isFunction } from '../utils/is.mjs';
|
|
4
|
+
|
|
5
|
+
const MAINTAIN_STORE = "MAINTAIN_STORE";
|
|
6
|
+
const useMaintainStore = defineStore(MAINTAIN_STORE, {
|
|
7
|
+
state: () => ({
|
|
8
|
+
// resize集合
|
|
9
|
+
resizeMap: {}
|
|
10
|
+
}),
|
|
11
|
+
getters: {},
|
|
12
|
+
actions: {
|
|
13
|
+
/**
|
|
14
|
+
* @function setResize 添加统一重置
|
|
15
|
+
* @param {Function} callback 回调函数
|
|
16
|
+
* @param {Symbol | string} key
|
|
17
|
+
*/
|
|
18
|
+
addResize(callback, key) {
|
|
19
|
+
if (!callback) return;
|
|
20
|
+
if (!key) {
|
|
21
|
+
key = Symbol(key);
|
|
22
|
+
}
|
|
23
|
+
this.resizeMap[key] = callback;
|
|
24
|
+
addResizeListener();
|
|
25
|
+
return key;
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* @function removeResize 删除重置属性
|
|
29
|
+
* @param {Symbol} key
|
|
30
|
+
*/
|
|
31
|
+
removeResize(key) {
|
|
32
|
+
if (key) {
|
|
33
|
+
delete this.resizeMap[key];
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
// 清除所有resize事件
|
|
37
|
+
clearResize() {
|
|
38
|
+
this.resizeMap = {};
|
|
39
|
+
removeResizeListener();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const resizeConfig = {
|
|
44
|
+
init: false,
|
|
45
|
+
animationId: void 0,
|
|
46
|
+
resizeIndex: 0,
|
|
47
|
+
timerList: []
|
|
48
|
+
// timeout实例
|
|
49
|
+
};
|
|
50
|
+
function onResizeHandler() {
|
|
51
|
+
const maintainStore = useMaintainStore();
|
|
52
|
+
if (resizeConfig.animationId) {
|
|
53
|
+
resizeConfig.timerList.forEach((timeout) => {
|
|
54
|
+
timeout && clearTimeout(timeout);
|
|
55
|
+
});
|
|
56
|
+
window.cancelAnimationFrame(resizeConfig.animationId);
|
|
57
|
+
}
|
|
58
|
+
resizeConfig.animationId = window.requestAnimationFrame(() => {
|
|
59
|
+
try {
|
|
60
|
+
let symbolKeys = Object.getOwnPropertySymbols(maintainStore.resizeMap);
|
|
61
|
+
symbolKeys = [
|
|
62
|
+
...symbolKeys.slice(resizeConfig.resizeIndex),
|
|
63
|
+
...symbolKeys
|
|
64
|
+
];
|
|
65
|
+
symbolKeys.forEach((key, index, list) => {
|
|
66
|
+
const timeout = setTimeout(() => {
|
|
67
|
+
resizeConfig.resizeIndex = list.length - 1 == index ? 0 : index;
|
|
68
|
+
const fun = maintainStore.resizeMap[key];
|
|
69
|
+
isFunction(fun) && fun();
|
|
70
|
+
}, 1);
|
|
71
|
+
resizeConfig.timerList.push(timeout);
|
|
72
|
+
});
|
|
73
|
+
} catch (e) {
|
|
74
|
+
throw Error(e);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
async function addResizeListener() {
|
|
79
|
+
if (resizeConfig.init) return;
|
|
80
|
+
resizeConfig.init = true;
|
|
81
|
+
await nextTick();
|
|
82
|
+
window.addEventListener("resize", onResizeHandler);
|
|
83
|
+
}
|
|
84
|
+
function removeResizeListener() {
|
|
85
|
+
window.removeEventListener("resize", onResizeHandler);
|
|
86
|
+
resizeConfig.init = false;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export { useMaintainStore };
|
|
90
|
+
//# sourceMappingURL=maintain.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maintain.mjs","sources":["../../packages/store/maintain.js"],"sourcesContent":["import { nextTick } from 'vue'\nimport { defineStore } from 'pinia'\nimport { isFunction } from '@hy-dispatch-ui-v3/utils'\n\nconst MAINTAIN_STORE = 'MAINTAIN_STORE'\n\n// 维护公共状态\nconst useMaintainStore = defineStore(MAINTAIN_STORE, {\n state: () => ({\n // resize集合\n resizeMap: {},\n }),\n getters: {},\n actions: {\n /**\n * @function setResize 添加统一重置\n * @param {Function} callback 回调函数\n * @param {Symbol | string} key\n */\n addResize(callback, key) {\n if (!callback) return\n if (!key) {\n key = Symbol(key)\n }\n this.resizeMap[key] = callback\n addResizeListener()\n return key\n },\n /**\n * @function removeResize 删除重置属性\n * @param {Symbol} key\n */\n removeResize(key) {\n if (key) {\n delete this.resizeMap[key]\n }\n },\n // 清除所有resize事件\n clearResize() {\n this.resizeMap = {}\n removeResizeListener()\n },\n },\n})\n\n// 窗口监听参数\nconst resizeConfig = {\n init: false,\n animationId: undefined,\n resizeIndex: 0,\n timerList: [], // timeout实例\n}\n// 窗口大小变化处理\nfunction onResizeHandler() {\n const maintainStore = useMaintainStore()\n if (resizeConfig.animationId) {\n resizeConfig.timerList.forEach((timeout) => {\n timeout && clearTimeout(timeout)\n })\n window.cancelAnimationFrame(resizeConfig.animationId)\n }\n resizeConfig.animationId = window.requestAnimationFrame(() => {\n // 更新图表大小\n try {\n let symbolKeys = Object.getOwnPropertySymbols(maintainStore.resizeMap)\n symbolKeys = [\n ...symbolKeys.slice(resizeConfig.resizeIndex),\n ...symbolKeys,\n ]\n symbolKeys.forEach((key, index, list) => {\n const timeout = setTimeout(() => {\n resizeConfig.resizeIndex = list.length - 1 == index ? 0 : index\n const fun = maintainStore.resizeMap[key]\n isFunction(fun) && fun()\n }, 1)\n resizeConfig.timerList.push(timeout)\n })\n } catch (e) {\n throw Error(e)\n }\n })\n}\n// 添加监听窗口变化\nasync function addResizeListener() {\n if (resizeConfig.init) return\n resizeConfig.init = true\n await nextTick()\n window.addEventListener('resize', onResizeHandler)\n}\n// 清除监听窗口变化\nfunction removeResizeListener() {\n window.removeEventListener('resize', onResizeHandler)\n resizeConfig.init = false\n}\n\nexport { useMaintainStore }\n"],"names":[],"mappings":";;;;AAGA,MAAM,cAAc,GAAG,gBAAgB;AAClC,MAAC,gBAAgB,GAAG,WAAW,CAAC,cAAc,EAAE;AACrD,EAAE,KAAK,EAAE,OAAO;AAChB;AACA,IAAI,SAAS,EAAE;AACf,GAAG,CAAC;AACJ,EAAE,OAAO,EAAE,EAAE;AACb,EAAE,OAAO,EAAE;AACX;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,QAAQ,EAAE,GAAG,EAAE;AAC7B,MAAM,IAAI,CAAC,QAAQ,EAAE;AACrB,MAAM,IAAI,CAAC,GAAG,EAAE;AAChB,QAAQ,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;AACzB,MAAM;AACN,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,QAAQ;AACpC,MAAM,iBAAiB,EAAE;AACzB,MAAM,OAAO,GAAG;AAChB,IAAI,CAAC;AACL;AACA;AACA;AACA;AACA,IAAI,YAAY,CAAC,GAAG,EAAE;AACtB,MAAM,IAAI,GAAG,EAAE;AACf,QAAQ,OAAO,IAAI,CAAC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,CAAC;AAClD,UAAU,UAAU,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE;AAClC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACb,QAAQ,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;AAC5C,MAAM,CAAC,CAAC;AACR,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE;AAChB,MAAM,MAAM,KAAK,CAAC,CAAC,CAAC;AACpB,IAAI;AACJ,EAAE,CAAC,CAAC;AACJ;AACA,eAAe,iBAAiB,GAAG;AACnC,EAAE,IAAI,YAAY,CAAC,IAAI,EAAE;AACzB,EAAE,YAAY,CAAC,IAAI,GAAG,IAAI;AAC1B,EAAE,MAAM,QAAQ,EAAE;AAClB,EAAE,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,eAAe,CAAC;AACpD;AACA,SAAS,oBAAoB,GAAG;AAChC,EAAE,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,eAAe,CAAC;AACvD,EAAE,YAAY,CAAC,IAAI,GAAG,KAAK;AAC3B;;;;"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@use './theme.scss';
|
|
2
|
+
// @use './style/tailwind.scss';
|
|
3
|
+
|
|
4
|
+
.clickBox {
|
|
5
|
+
position: relative;
|
|
6
|
+
z-index: 2;
|
|
7
|
+
cursor: pointer;
|
|
8
|
+
transition: 0.5s;
|
|
9
|
+
|
|
10
|
+
&:active {
|
|
11
|
+
transition: 0s;
|
|
12
|
+
opacity: 0.6;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.over_one_line {
|
|
17
|
+
display: block;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
white-space: nowrap;
|
|
20
|
+
text-overflow: ellipsis;
|
|
21
|
+
word-break: break-all;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.over_two_line,
|
|
25
|
+
.over_two_lines {
|
|
26
|
+
text-overflow: -o-ellipsis-lastline;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
text-overflow: ellipsis;
|
|
29
|
+
display: -webkit-box;
|
|
30
|
+
-webkit-line-clamp: 2;
|
|
31
|
+
line-clamp: 2;
|
|
32
|
+
-webkit-box-orient: vertical;
|
|
33
|
+
word-break: break-all;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.over_any_lines {
|
|
37
|
+
--line-clamp: 2;
|
|
38
|
+
text-overflow: -o-ellipsis-lastline;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
text-overflow: ellipsis;
|
|
41
|
+
display: -webkit-box;
|
|
42
|
+
-webkit-line-clamp: 2;
|
|
43
|
+
line-clamp: 2;
|
|
44
|
+
-webkit-box-orient: vertical;
|
|
45
|
+
word-break: break-all;
|
|
46
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--basics-size: 12px;
|
|
3
|
+
--theme: #2df2ff; // 主视觉配色
|
|
4
|
+
--themev02: #1f596e;
|
|
5
|
+
--theme-05: rgba(45, 242, 255, 0.5); // #2DF2FF
|
|
6
|
+
--theme-02: rgba(45, 242, 255, 0.2); // #2DF2FF
|
|
7
|
+
--theme-00: rgba(45, 242, 255, 0); // #2DF2FF
|
|
8
|
+
|
|
9
|
+
--add: #2ce898; // 新增
|
|
10
|
+
--success: #2ce898; // 成功
|
|
11
|
+
--success-05: rgba(44, 232, 152, 0.5); // #2DF2FF
|
|
12
|
+
--success-02: rgba(44, 232, 152, 0.2); // #2DF2FF
|
|
13
|
+
--info: #909399; // 灰色
|
|
14
|
+
--info-05: rgba(144, 147, 153, 0.2); // #2DF2FF
|
|
15
|
+
--warning: #f8a62d; // 警告
|
|
16
|
+
--warning-05: rgba(248, 166, 45, 0.5); // 警告
|
|
17
|
+
--warning-02: rgba(248, 166, 45, 0.2); // 警告
|
|
18
|
+
|
|
19
|
+
--danger: #c92525; // 删除
|
|
20
|
+
--dangerv2: #f56c6c; // 删除
|
|
21
|
+
--dangerv2-05: rgba(245, 108, 108, 0.5); // 删除
|
|
22
|
+
--dangerv2-02: rgba(245, 108, 108, 0.2); // 删除
|
|
23
|
+
|
|
24
|
+
--function: #2df2ff; // 功能色
|
|
25
|
+
--main: #fff; // 字体主色
|
|
26
|
+
--auxiliary: #5e9db4; // 字体辅助色
|
|
27
|
+
--auxiliary-05: #5e9db480; // 字体辅助色
|
|
28
|
+
--auxiliaryv2: #fff; // 字体辅助色
|
|
29
|
+
|
|
30
|
+
--prohibit: rgba(255, 255, 255, 0.2); // 禁止选择
|
|
31
|
+
|
|
32
|
+
--background-gradient: linear-gradient(
|
|
33
|
+
180deg,
|
|
34
|
+
#132339 0%,
|
|
35
|
+
#147c9e 100%
|
|
36
|
+
); // 背景渐变色
|
|
37
|
+
--background-gradientV2: linear-gradient(
|
|
38
|
+
180deg,
|
|
39
|
+
#0ea0bb 0%,
|
|
40
|
+
var(--backgroundv2) 100%
|
|
41
|
+
); // 背景渐变色
|
|
42
|
+
--background-gradientV3: linear-gradient(
|
|
43
|
+
270deg,
|
|
44
|
+
#3d6286 0%,
|
|
45
|
+
#1c334a 100%,
|
|
46
|
+
#2a4968 100%
|
|
47
|
+
); // 背景渐变色
|
|
48
|
+
--background_mask: linear-gradient(
|
|
49
|
+
180deg,
|
|
50
|
+
rgba(14, 24, 49, 0.4) 0%,
|
|
51
|
+
rgba(0, 3, 9, 0.5) 100%
|
|
52
|
+
); // 蒙版
|
|
53
|
+
/* 辅助线条 */
|
|
54
|
+
--border-auxiliary: #31546b;
|
|
55
|
+
|
|
56
|
+
/* 页面颜色 */
|
|
57
|
+
--background: #0e1525; // 页面黑色
|
|
58
|
+
--background-05: rgba(14, 21, 37, 0.5); // 页面黑色
|
|
59
|
+
|
|
60
|
+
--backgroundv2: #1c334a; // 页面第二层
|
|
61
|
+
--backgroundv2-05: rgba(28, 51, 74, 0.5); // 页面第二层
|
|
62
|
+
|
|
63
|
+
--backgroundv3: #305272; // 页面第三层
|
|
64
|
+
--backgroundv3-05: rgba(48, 82, 114, 0.5); // 页面第三层
|
|
65
|
+
|
|
66
|
+
--backgroundv4: #10263b; // 斑马纹备用色
|
|
67
|
+
--backgroundv4-05: rgba(16, 38, 59, 0.5); // 斑马纹备用色
|
|
68
|
+
|
|
69
|
+
--border: #365d84;
|
|
70
|
+
--border-radius: 12px; // 圆角角度
|
|
71
|
+
--box-shadow: 0 0 4px 2px transparent; // 投影
|
|
72
|
+
|
|
73
|
+
/* 弹窗页面*/
|
|
74
|
+
--dialog-background: #0d1a2a; // 弹窗背景色页面第一层
|
|
75
|
+
--dialog-backgroundv2: #1c334a; // 弹窗背景色页面第二层
|
|
76
|
+
--dialog-backgroundv3: #305272; // 弹窗背景色页面第三层
|
|
77
|
+
--dialog-border: #365d84; // 边框样式
|
|
78
|
+
--dialog-border-radius: 8px; // 圆角角度
|
|
79
|
+
--dialog-box-shadow: 0 0 10px 4px transparent; // 投影
|
|
80
|
+
|
|
81
|
+
/*input */
|
|
82
|
+
--input-background: #1c334a;
|
|
83
|
+
--input-border: #365d84;
|
|
84
|
+
--input-button: #307492;
|
|
85
|
+
--input-placeholder: rgba(139, 229, 252, 0.4);
|
|
86
|
+
/*input 深色 */
|
|
87
|
+
--input-background-darkColor: #1c334a;
|
|
88
|
+
--input-border-darkColor: #365d84;
|
|
89
|
+
--input-button-darkColor: #307492;
|
|
90
|
+
--input-placeholder-darkColor: rgba(139, 229, 252, 0.4);
|
|
91
|
+
|
|
92
|
+
/* ============= ============= ============= ============= ============= ============= =============*/
|
|
93
|
+
--select-color: var(--theme);
|
|
94
|
+
--main-select-color: var(--theme);
|
|
95
|
+
--main-select-color-05: var(--theme-05);
|
|
96
|
+
--tableBackgroundColor: var(--background);
|
|
97
|
+
--main-color: var(--main);
|
|
98
|
+
--auxiliary-color: var(--auxiliary);
|
|
99
|
+
--dialog-background-darkColor: var(--dialog-background);
|
|
100
|
+
/* 背景 */
|
|
101
|
+
--background-main-color: var(--backgroundv2);
|
|
102
|
+
--background-auxiliary-color: var(--backgroundv3);
|
|
103
|
+
--item-background-main-color: var(--backgroundv2);
|
|
104
|
+
--item-background-auxiliary-color: var(--backgroundv3);
|
|
105
|
+
--item-background-auxiliary-color-05: var(--theme-05);
|
|
106
|
+
/* 字体 */
|
|
107
|
+
--fontSize-main-color: var(--main);
|
|
108
|
+
--fontSize-auxiliary-color: var(--auxiliary);
|
|
109
|
+
/* 边框 */
|
|
110
|
+
--border-main-color: var(--theme);
|
|
111
|
+
--border-auxiliary-color: transparent;
|
|
112
|
+
/* 下面因为根据页面微调样式,命名方式 文件名或者功能名字-class名-用的位置-用状态 */
|
|
113
|
+
--department-centerBox-background: #24354e;
|
|
114
|
+
/* app */
|
|
115
|
+
--app-background-color: var(--background);
|
|
116
|
+
/* 表格按钮 */
|
|
117
|
+
--iconBox-iconBox-background: var(--backgroundv3);
|
|
118
|
+
/* 自定义表格 */
|
|
119
|
+
--customTable-background-select: #3e536f;
|
|
120
|
+
--customTable-border-select: #3e536f;
|
|
121
|
+
/* 任务 */
|
|
122
|
+
--button-background: #24354e;
|
|
123
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const rootValue = 16;
|
|
2
|
+
const unitPrecision = 5;
|
|
3
|
+
function vwToPx(vw) {
|
|
4
|
+
return vw * window.innerWidth / 100;
|
|
5
|
+
}
|
|
6
|
+
function remToPx(rem) {
|
|
7
|
+
const rootFontSize = parseFloat(
|
|
8
|
+
window.getComputedStyle(document.documentElement).fontSize
|
|
9
|
+
);
|
|
10
|
+
return rem * rootFontSize;
|
|
11
|
+
}
|
|
12
|
+
function pxTorem(px) {
|
|
13
|
+
const number = px / rootValue;
|
|
14
|
+
const multiplier = Math.pow(10, unitPrecision + 1), wholeNumber = Math.floor(number * multiplier);
|
|
15
|
+
return Math.round(wholeNumber / 10) * 10 / multiplier;
|
|
16
|
+
}
|
|
17
|
+
function parseRem(res) {
|
|
18
|
+
let px = res;
|
|
19
|
+
if (px) {
|
|
20
|
+
px = parseInt(px, 10);
|
|
21
|
+
if (isNaN(px)) {
|
|
22
|
+
return "";
|
|
23
|
+
}
|
|
24
|
+
return pxTorem(px);
|
|
25
|
+
}
|
|
26
|
+
return "";
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { parseRem, pxTorem, remToPx, vwToPx };
|
|
30
|
+
//# sourceMappingURL=adaptive.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adaptive.mjs","sources":["../../packages/utils/adaptive.js"],"sourcesContent":["// vw 转 px\nconst rootValue = 16\nconst unitPrecision = 5\nexport function vwToPx(vw) {\n return (vw * window.innerWidth) / 100\n}\n\n// rem 转 px\nexport function remToPx(rem) {\n // 获取根字体大小(通常为16px)\n const rootFontSize = parseFloat(\n window.getComputedStyle(document.documentElement).fontSize\n )\n\n // 将rem单位转换为px单位\n return rem * rootFontSize\n}\n\nexport function pxTorem(px) {\n const number = px / rootValue\n const multiplier = Math.pow(10, unitPrecision + 1),\n wholeNumber = Math.floor(number * multiplier)\n return (Math.round(wholeNumber / 10) * 10) / multiplier\n}\n\nexport function parseRem(res) {\n let px = res\n if (px) {\n px = parseInt(px, 10)\n if (isNaN(px)) {\n return ''\n }\n return pxTorem(px)\n }\n return ''\n}\n"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG,EAAE;AACpB,MAAM,aAAa,GAAG,CAAC;AAChB,SAAS,MAAM,CAAC,EAAE,EAAE;AAC3B,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,UAAU,GAAG,GAAG;AACrC;AACO,SAAS,OAAO,CAAC,GAAG,EAAE;AAC7B,EAAE,MAAM,YAAY,GAAG,UAAU;AACjC,IAAI,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;AACtD,GAAG;AACH,EAAE,OAAO,GAAG,GAAG,YAAY;AAC3B;AACO,SAAS,OAAO,CAAC,EAAE,EAAE;AAC5B,EAAE,MAAM,MAAM,GAAG,EAAE,GAAG,SAAS;AAC/B,EAAE,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,aAAa,GAAG,CAAC,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC;AACnG,EAAE,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,UAAU;AACvD;AACO,SAAS,QAAQ,CAAC,GAAG,EAAE;AAC9B,EAAE,IAAI,EAAE,GAAG,GAAG;AACd,EAAE,IAAI,EAAE,EAAE;AACV,IAAI,EAAE,GAAG,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;AACzB,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC,EAAE;AACnB,MAAM,OAAO,EAAE;AACf,IAAI;AACJ,IAAI,OAAO,OAAO,CAAC,EAAE,CAAC;AACtB,EAAE;AACF,EAAE,OAAO,EAAE;AACX;;;;"}
|
package/es/utils/bus.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bus.mjs","sources":["../../packages/utils/bus.js"],"sourcesContent":["import mitt from 'mitt'\n\nconst bus = mitt()\n\nexport { bus }\n"],"names":[],"mappings":";;AACK,MAAC,GAAG,GAAG,IAAI;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import CryptoJS from 'crypto-js';
|
|
2
|
+
|
|
3
|
+
const encryptToBase64 = (str) => {
|
|
4
|
+
return CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(str));
|
|
5
|
+
};
|
|
6
|
+
function base64Decrypt(str) {
|
|
7
|
+
return CryptoJS.enc.Base64.parse(str).toString(CryptoJS.enc.Utf8);
|
|
8
|
+
}
|
|
9
|
+
function generateRandomCode(number = 13) {
|
|
10
|
+
const chars = "abcdefghijklmnopqrstuvwxyz0123456789";
|
|
11
|
+
const charCount = chars.length;
|
|
12
|
+
let randomString1 = "";
|
|
13
|
+
for (let i = 0; i < number; i++) {
|
|
14
|
+
const randomIndex = Math.floor(Math.random() * charCount);
|
|
15
|
+
randomString1 += chars[randomIndex];
|
|
16
|
+
}
|
|
17
|
+
return randomString1;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { base64Decrypt, encryptToBase64, generateRandomCode };
|
|
21
|
+
//# sourceMappingURL=crypto.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crypto.mjs","sources":["../../packages/utils/crypto.js"],"sourcesContent":["import CryptoJS from 'crypto-js'\n\n/**\n * @function base64加密方法\n * @param {string} str 明文字符串\n * @return {string}\n */\nexport const encryptToBase64 = (str) => {\n return CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(str))\n}\n\n/**\n * @function base64解密方法\n * @param {string} str 加密字符串\n * @returns {string}\n */\nexport function base64Decrypt(str) {\n return CryptoJS.enc.Base64.parse(str).toString(CryptoJS.enc.Utf8)\n}\n\n/**\n * @function generateRandomCode 生成随机码\n * @description 随机生成包含小写字母和数字的随机码\n * @param {Number} number 生成随机码的个数,默认为 13\n * @returns {String}\n */\nexport function generateRandomCode(number = 13) {\n const chars = 'abcdefghijklmnopqrstuvwxyz0123456789'\n const charCount = chars.length\n let randomString1 = ''\n for (let i = 0; i < number; i++) {\n const randomIndex = Math.floor(Math.random() * charCount)\n randomString1 += chars[randomIndex]\n }\n return randomString1\n}\n"],"names":[],"mappings":";;AACY,MAAC,eAAe,GAAG,CAAC,GAAG,KAAK;AACxC,EAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACpE;AACO,SAAS,aAAa,CAAC,GAAG,EAAE;AACnC,EAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;AACnE;AACO,SAAS,kBAAkB,CAAC,MAAM,GAAG,EAAE,EAAE;AAChD,EAAE,MAAM,KAAK,GAAG,sCAAsC;AACtD,EAAE,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM;AAChC,EAAE,IAAI,aAAa,GAAG,EAAE;AACxB,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AACnC,IAAI,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC;AAC7D,IAAI,aAAa,IAAI,KAAK,CAAC,WAAW,CAAC;AACvC,EAAE;AACF,EAAE,OAAO,aAAa;AACtB;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function getDefaultValueFormatByType(type = "date") {
|
|
2
|
+
switch (type) {
|
|
3
|
+
case "year":
|
|
4
|
+
case "years":
|
|
5
|
+
case "yearrange":
|
|
6
|
+
return "YYYY";
|
|
7
|
+
case "month":
|
|
8
|
+
case "months":
|
|
9
|
+
case "monthrange":
|
|
10
|
+
return "YYYY-MM";
|
|
11
|
+
case "week":
|
|
12
|
+
return "ww";
|
|
13
|
+
case "datetime":
|
|
14
|
+
case "datetimerange":
|
|
15
|
+
return "YYYY-MM-DD HH:mm:ss";
|
|
16
|
+
case "date":
|
|
17
|
+
case "dates":
|
|
18
|
+
case "daterange":
|
|
19
|
+
default:
|
|
20
|
+
return "YYYY-MM-DD";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { getDefaultValueFormatByType };
|
|
25
|
+
//# sourceMappingURL=date.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.mjs","sources":["../../packages/utils/date.js"],"sourcesContent":["// type:'year' | 'years' |'month' | 'months' | 'date' | 'dates' | 'datetime' | 'week' | 'datetimerange' | 'daterange' | 'monthrange' | 'yearrange'\nexport function getDefaultValueFormatByType(type = 'date') {\n switch (type) {\n case 'year':\n case 'years':\n case 'yearrange':\n return 'YYYY'\n case 'month':\n case 'months':\n case 'monthrange':\n return 'YYYY-MM'\n case 'week':\n return 'ww'\n case 'datetime':\n case 'datetimerange':\n return 'YYYY-MM-DD HH:mm:ss'\n case 'date':\n case 'dates':\n case 'daterange':\n default:\n return 'YYYY-MM-DD'\n }\n}\n"],"names":[],"mappings":"AAAO,SAAS,2BAA2B,CAAC,IAAI,GAAG,MAAM,EAAE;AAC3D,EAAE,QAAQ,IAAI;AACd,IAAI,KAAK,MAAM;AACf,IAAI,KAAK,OAAO;AAChB,IAAI,KAAK,WAAW;AACpB,MAAM,OAAO,MAAM;AACnB,IAAI,KAAK,OAAO;AAChB,IAAI,KAAK,QAAQ;AACjB,IAAI,KAAK,YAAY;AACrB,MAAM,OAAO,SAAS;AACtB,IAAI,KAAK,MAAM;AACf,MAAM,OAAO,IAAI;AACjB,IAAI,KAAK,UAAU;AACnB,IAAI,KAAK,eAAe;AACxB,MAAM,OAAO,qBAAqB;AAClC,IAAI,KAAK,MAAM;AACf,IAAI,KAAK,OAAO;AAChB,IAAI,KAAK,WAAW;AACpB,IAAI;AACJ,MAAM,OAAO,YAAY;AACzB;AACA;;;;"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { isFunction, isVueProxy, isArray, isObject, isEmpty } from './is.mjs';
|
|
2
|
+
|
|
3
|
+
function funRunHandler(target, ...args) {
|
|
4
|
+
if (isFunction(target)) {
|
|
5
|
+
return target(...args);
|
|
6
|
+
}
|
|
7
|
+
return target;
|
|
8
|
+
}
|
|
9
|
+
const cloneDeep = (target) => {
|
|
10
|
+
if (isVueProxy(target)) {
|
|
11
|
+
return target;
|
|
12
|
+
}
|
|
13
|
+
if (isArray(target)) {
|
|
14
|
+
return target.reduce((list, item) => {
|
|
15
|
+
list.push(cloneDeep(item));
|
|
16
|
+
return list;
|
|
17
|
+
}, []);
|
|
18
|
+
}
|
|
19
|
+
if (isObject(target)) {
|
|
20
|
+
const obj = {};
|
|
21
|
+
Object.keys(target).forEach((key) => {
|
|
22
|
+
obj[key] = cloneDeep(target[key]);
|
|
23
|
+
});
|
|
24
|
+
return obj;
|
|
25
|
+
}
|
|
26
|
+
return target;
|
|
27
|
+
};
|
|
28
|
+
const mergeDeep = (target, value) => {
|
|
29
|
+
if (isVueProxy(target)) {
|
|
30
|
+
return target;
|
|
31
|
+
}
|
|
32
|
+
if (isArray(value)) {
|
|
33
|
+
return [...value];
|
|
34
|
+
}
|
|
35
|
+
if (isObject(target)) {
|
|
36
|
+
const obj = {};
|
|
37
|
+
Object.keys(target).forEach((key) => {
|
|
38
|
+
obj[key] = mergeDeep(
|
|
39
|
+
target[key],
|
|
40
|
+
isEmpty(value[key]) ? target[key] : value[key]
|
|
41
|
+
);
|
|
42
|
+
});
|
|
43
|
+
Object.keys(value).forEach((key) => {
|
|
44
|
+
if (isEmpty(value[key])) return;
|
|
45
|
+
obj[key] = mergeDeep(value[key], value[key]);
|
|
46
|
+
});
|
|
47
|
+
return obj;
|
|
48
|
+
}
|
|
49
|
+
return isEmpty(value) ? target : value;
|
|
50
|
+
};
|
|
51
|
+
function createUniqueId(n) {
|
|
52
|
+
var random = function() {
|
|
53
|
+
return Number(Math.random().toString().substr(2)).toString(36);
|
|
54
|
+
};
|
|
55
|
+
var arr = [];
|
|
56
|
+
function createId() {
|
|
57
|
+
var num = random();
|
|
58
|
+
var _bool = false;
|
|
59
|
+
arr.forEach((v) => {
|
|
60
|
+
if (v === num) _bool = true;
|
|
61
|
+
});
|
|
62
|
+
if (_bool) {
|
|
63
|
+
createId();
|
|
64
|
+
} else {
|
|
65
|
+
arr.push(num);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
var i = 0;
|
|
69
|
+
while (i < n) {
|
|
70
|
+
createId();
|
|
71
|
+
i++;
|
|
72
|
+
}
|
|
73
|
+
return arr[0];
|
|
74
|
+
}
|
|
75
|
+
const withInstall = (comp) => {
|
|
76
|
+
comp.install = function(app) {
|
|
77
|
+
app.component(comp.name, comp);
|
|
78
|
+
};
|
|
79
|
+
return comp;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export { cloneDeep, createUniqueId, funRunHandler, mergeDeep, withInstall };
|
|
83
|
+
//# sourceMappingURL=handler.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler.mjs","sources":["../../packages/utils/handler.js"],"sourcesContent":["import { unref } from 'vue'\nimport { isArray, isEmpty, isObject, isFunction, isVueProxy } from './is'\n\n// 函数执行或其他参数处理器\nexport function funRunHandler(target, ...args) {\n if (isFunction(target)) {\n return target(...args)\n }\n return target\n}\n\n// 深度克隆\nexport const cloneDeep = (target) => {\n if (isVueProxy(target)) {\n return target\n }\n if (isArray(target)) {\n return target.reduce((list, item) => {\n list.push(cloneDeep(item))\n return list\n }, [])\n }\n if (isObject(target)) {\n const obj = {}\n Object.keys(target).forEach((key) => {\n obj[key] = cloneDeep(target[key])\n })\n return obj\n }\n return target\n}\n\n// 深度合并\nexport const mergeDeep = (target, value) => {\n if (isVueProxy(target)) {\n return target\n }\n if (isArray(value)) {\n return [...value]\n }\n if (isObject(target)) {\n const obj = {}\n Object.keys(target).forEach((key) => {\n obj[key] = mergeDeep(\n target[key],\n isEmpty(value[key]) ? target[key] : value[key]\n )\n })\n Object.keys(value).forEach((key) => {\n if (isEmpty(value[key])) return\n obj[key] = mergeDeep(value[key], value[key])\n })\n return obj\n }\n return isEmpty(value) ? target : value\n}\n\n// 生成随机唯一值\nexport function createUniqueId(n) {\n var random = function () {\n // 生成10-12位不等的字符串\n return Number(Math.random().toString().substr(2)).toString(36) // 转换成十六进制\n }\n var arr = []\n function createId() {\n var num = random()\n var _bool = false\n arr.forEach((v) => {\n if (v === num) _bool = true\n })\n if (_bool) {\n createId()\n } else {\n arr.push(num)\n }\n }\n var i = 0\n while (i < n) {\n createId()\n i++\n }\n return arr[0]\n}\n\nexport const withInstall = (comp) => {\n comp.install = function (app) {\n app.component(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K,GAAG,IAAI;AACjC,IAAI,CAAC,CAAC;AACN,IAAI,IAAI,KAAK,EAAE;AACf,MAAM,QAAQ,EAAE;AAChB,IAAI,CAAC,MAAM;AACX,MAAM,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC;AACnB,IAAI;AACJ,EAAE;AACF,EAAE,IAAI,CAAC,GAAG,CAAC;AACX,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE;AAChB,IAAI,QAAQ,EAAE;AACd,IAAI,CAAC,EAAE;AACP,EAAE;AACF,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC;AACf;AACY,MAAC,WAAW,GAAG,CAAC,IAAI,KAAK;AACrC,EAAE,IAAI,CAAC,OAAO,GAAG,SAAS,GAAG,EAAE;AAC/B,IAAI,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC;AAClC,EAAE,CAAC;AACH,EAAE,OAAO,IAAI;AACb;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { parseRem, pxTorem, remToPx, vwToPx } from './adaptive.mjs';
|
|
2
|
+
export { bus } from './bus.mjs';
|
|
3
|
+
export { base64Decrypt, encryptToBase64, generateRandomCode } from './crypto.mjs';
|
|
4
|
+
export { isArray, isBoolean, isEmpty, isFunction, isNull, isNumber, isObject, isOverflowing, isString, isSymbol, isUndefined, isVueProxy } from './is.mjs';
|
|
5
|
+
export { cloneDeep, createUniqueId, funRunHandler, mergeDeep, withInstall } from './handler.mjs';
|
|
6
|
+
export { getDefaultValueFormatByType } from './date.mjs';
|
|
7
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
package/es/utils/is.mjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { isRef, isReactive, isReadonly, isProxy } from 'vue';
|
|
2
|
+
|
|
3
|
+
const isString = (e) => typeof e === "string";
|
|
4
|
+
const isNumber = (e) => typeof e === "number";
|
|
5
|
+
const isObject = (e) => Object.prototype.toString.call(e) === "[object Object]";
|
|
6
|
+
const isFunction = (e) => typeof e === "function";
|
|
7
|
+
const isArray = (e) => Array.isArray(e);
|
|
8
|
+
const isBoolean = (e) => typeof e === "boolean";
|
|
9
|
+
const isUndefined = (e) => e === void 0;
|
|
10
|
+
const isNull = (e) => e === null;
|
|
11
|
+
const isSymbol = (e) => typeof e === "symbol";
|
|
12
|
+
const isEmpty = (e) => isUndefined(e) || isNull(e) || !isNumber(e) && !e;
|
|
13
|
+
const isOverflowing = (e) => e.clientWidth < e.scrollWidth || e.clientHeight < e.scrollHeight;
|
|
14
|
+
const isVueProxy = (e) => {
|
|
15
|
+
return isRef(e) || isReactive(e) || isReadonly(e) || isProxy(e);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { isArray, isBoolean, isEmpty, isFunction, isNull, isNumber, isObject, isOverflowing, isString, isSymbol, isUndefined, isVueProxy };
|
|
19
|
+
//# sourceMappingURL=is.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is.mjs","sources":["../../packages/utils/is.js"],"sourcesContent":["import { isRef, isReactive, isReadonly, isProxy } from 'vue'\n\n// 是否为字段串\nexport const isString = (e) => typeof e === 'string'\n\n// 是否为数字\nexport const isNumber = (e) => typeof e === 'number'\n\n// 是否为对象\nexport const isObject = (e) =>\n Object.prototype.toString.call(e) === '[object Object]'\n\n// 是否为函数\nexport const isFunction = (e) => typeof e === 'function'\n\n// 是否为数据\nexport const isArray = (e) => Array.isArray(e)\n\n// 是否为布尔值\nexport const isBoolean = (e) => typeof e === 'boolean'\n\n// 是否为 undefined\nexport const isUndefined = (e) => e === undefined\n\n// 是否为 null\nexport const isNull = (e) => e === null\n\nexport const isSymbol = (e) => typeof e === 'symbol'\n\n// 是否为非基本类型的空值\nexport const isEmpty = (e) =>\n isUndefined(e) || isNull(e) || (!isNumber(e) && !e)\n\n// 页面元素是否已超出显示省略号\nexport const isOverflowing = (e) => e.clientWidth < e.scrollWidth || e.clientHeight < e.scrollHeight\n\n// 是否vue代理值\nexport const isVueProxy = (e) => {\n return isRef(e) || isReactive(e) || isReadonly(e) || isProxy(e)\n}\n"],"names":[],"mappings":";;AACY,MAAC,QAAQ,GAAG,CAAC,CAAC,KAAK,OAAO,CAAC,KAAK;AAChC,MAAC,QAAQ,GAAG,CAAC,CAAC,KAAK,OAAO,CAAC,KAAK;AAChC,MAAC,QAAQ,GAAG,CAAC,CAAC,KAAK,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;AACzD,MAAC,UAAU,GAAG,CAAC,CAAC,KAAK,OAAO,CAAC,KAAK;AAClC,MAAC,OAAO,GAAG,CAAC,CAAC,KAAK,KAAK,CAAC,OAAO,CAAC,CAAC;AACjC,MAAC,SAAS,GAAG,CAAC,CAAC,KAAK,OAAO,CAAC,KAAK;AACjC,MAAC,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK;AAC5B,MAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK;AACvB,MAAC,QAAQ,GAAG,CAAC,CAAC,KAAK,OAAO,CAAC,KAAK;AAChC,MAAC,OAAO,GAAG,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;AAClE,MAAC,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC;AAC5E,MAAC,UAAU,GAAG,CAAC,CAAC,KAAK;AACjC,EAAE,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC;AACjE;;;;"}
|
package/es/version.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../packages/version.js"],"sourcesContent":["const version = '0.1.0'\n\nexport { version }\n"],"names":[],"mappings":"AAAK,MAAC,OAAO,GAAG;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|