@pisell/common 0.0.1
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 +40 -0
- package/es/business-components/colorInput/index.d.ts +21 -0
- package/es/business-components/colorInput/index.js +43 -0
- package/es/business-components/colorInput/index.less +10 -0
- package/es/business-components/index.d.ts +11 -0
- package/es/business-components/index.js +7 -0
- package/es/business-components/rechargeOption/index.d.ts +36 -0
- package/es/business-components/rechargeOption/index.js +136 -0
- package/es/business-components/rechargeOption/index.less +0 -0
- package/es/business-components/selectTag/index.d.ts +25 -0
- package/es/business-components/selectTag/index.js +180 -0
- package/es/business-components/selectTag/index.less +22 -0
- package/es/business-components/sortModal/index.d.ts +30 -0
- package/es/business-components/sortModal/index.js +85 -0
- package/es/business-components/sortModal/index.less +29 -0
- package/es/business-components/statistics/index.d.ts +12 -0
- package/es/business-components/statistics/index.js +38 -0
- package/es/business-components/statistics/index.less +64 -0
- package/es/business-components/tagModal/index.d.ts +17 -0
- package/es/business-components/tagModal/index.js +59 -0
- package/es/business-hooks/index.d.ts +2 -0
- package/es/business-hooks/index.js +2 -0
- package/es/business-hooks/useModal/index.d.ts +31 -0
- package/es/business-hooks/useModal/index.js +91 -0
- package/es/business-hooks/useModal/index.less +0 -0
- package/es/business-hooks/useTagModal/index.d.ts +17 -0
- package/es/business-hooks/useTagModal/index.js +47 -0
- package/es/components/ColorPicker/index.d.ts +22 -0
- package/es/components/ColorPicker/index.js +51 -0
- package/es/components/ColorPicker/index.less +17 -0
- package/es/components/DragSort/index.d.ts +2 -0
- package/es/components/DragSort/index.js +68 -0
- package/es/components/Iconfont/index.d.ts +6 -0
- package/es/components/Iconfont/index.js +28 -0
- package/es/components/Iconfont/index.less +0 -0
- package/es/components/card/index.d.ts +5 -0
- package/es/components/card/index.js +16 -0
- package/es/components/card/index.less +9 -0
- package/es/components/index.d.ts +4 -0
- package/es/components/index.js +4 -0
- package/es/config/index.d.ts +16 -0
- package/es/config/index.js +18 -0
- package/es/config/utils.d.ts +0 -0
- package/es/config/utils.js +0 -0
- package/es/hooks/index.d.ts +8 -0
- package/es/hooks/index.js +8 -0
- package/es/hooks/useCountDown/index.d.ts +10 -0
- package/es/hooks/useCountDown/index.js +48 -0
- package/es/hooks/useDocumentScroll/index.d.ts +8 -0
- package/es/hooks/useDocumentScroll/index.js +41 -0
- package/es/hooks/useDocumentScroll/index.less +0 -0
- package/es/hooks/useMousemove/index.d.ts +8 -0
- package/es/hooks/useMousemove/index.js +61 -0
- package/es/hooks/useResponsive/index.d.ts +2 -0
- package/es/hooks/useResponsive/index.js +29 -0
- package/es/hooks/useResponsive/index.less +0 -0
- package/es/hooks/useSize/index.d.ts +2 -0
- package/es/hooks/useSize/index.js +27 -0
- package/es/hooks/useSize/index.less +0 -0
- package/es/hooks/useStateMulti/index.d.ts +2 -0
- package/es/hooks/useStateMulti/index.js +29 -0
- package/es/hooks/useStateWithCb/index.d.ts +2 -0
- package/es/hooks/useStateWithCb/index.js +42 -0
- package/es/hooks/useTable/index.d.ts +12 -0
- package/es/hooks/useTable/index.js +74 -0
- package/es/hooks/useTable/index.less +0 -0
- package/es/hooks/useTableModal/index.d.ts +12 -0
- package/es/hooks/useTableModal/index.js +25 -0
- package/es/hooks/useTableModal/index.less +0 -0
- package/es/hooks/useUrlState/index.d.ts +2 -0
- package/es/hooks/useUrlState/index.js +56 -0
- package/es/hooks/useWebSocket/index.d.ts +13 -0
- package/es/hooks/useWebSocket/index.js +121 -0
- package/es/index.d.ts +4 -0
- package/es/index.js +4 -0
- package/es/locales/en-US.d.ts +11 -0
- package/es/locales/en-US.js +10 -0
- package/es/locales/index.d.ts +1 -0
- package/es/locales/index.js +23 -0
- package/es/locales/zh-CN.d.ts +11 -0
- package/es/locales/zh-CN.js +10 -0
- package/es/locales/zh-TW.d.ts +11 -0
- package/es/locales/zh-TW.js +10 -0
- package/es/utils/index.d.ts +3 -0
- package/es/utils/index.js +3 -0
- package/es/utils/otherUtils.d.ts +8 -0
- package/es/utils/otherUtils.js +12 -0
- package/es/utils/storage.d.ts +30 -0
- package/es/utils/storage.js +70 -0
- package/es/utils/typeUtils.d.ts +42 -0
- package/es/utils/typeUtils.js +86 -0
- package/lib/business-components/colorInput/index.d.ts +21 -0
- package/lib/business-components/colorInput/index.js +70 -0
- package/lib/business-components/colorInput/index.less +10 -0
- package/lib/business-components/index.d.ts +11 -0
- package/lib/business-components/index.js +54 -0
- package/lib/business-components/rechargeOption/index.d.ts +36 -0
- package/lib/business-components/rechargeOption/index.js +133 -0
- package/lib/business-components/rechargeOption/index.less +0 -0
- package/lib/business-components/selectTag/index.d.ts +25 -0
- package/lib/business-components/selectTag/index.js +181 -0
- package/lib/business-components/selectTag/index.less +22 -0
- package/lib/business-components/sortModal/index.d.ts +30 -0
- package/lib/business-components/sortModal/index.js +100 -0
- package/lib/business-components/sortModal/index.less +29 -0
- package/lib/business-components/statistics/index.d.ts +12 -0
- package/lib/business-components/statistics/index.js +63 -0
- package/lib/business-components/statistics/index.less +64 -0
- package/lib/business-components/tagModal/index.d.ts +17 -0
- package/lib/business-components/tagModal/index.js +66 -0
- package/lib/business-hooks/index.d.ts +2 -0
- package/lib/business-hooks/index.js +42 -0
- package/lib/business-hooks/useModal/index.d.ts +31 -0
- package/lib/business-hooks/useModal/index.js +68 -0
- package/lib/business-hooks/useModal/index.less +0 -0
- package/lib/business-hooks/useTagModal/index.d.ts +17 -0
- package/lib/business-hooks/useTagModal/index.js +61 -0
- package/lib/components/ColorPicker/index.d.ts +22 -0
- package/lib/components/ColorPicker/index.js +80 -0
- package/lib/components/ColorPicker/index.less +17 -0
- package/lib/components/DragSort/index.d.ts +2 -0
- package/lib/components/DragSort/index.js +101 -0
- package/lib/components/Iconfont/index.d.ts +6 -0
- package/lib/components/Iconfont/index.js +47 -0
- package/lib/components/Iconfont/index.less +0 -0
- package/lib/components/card/index.d.ts +5 -0
- package/lib/components/card/index.js +42 -0
- package/lib/components/card/index.less +9 -0
- package/lib/components/index.d.ts +4 -0
- package/lib/components/index.js +48 -0
- package/lib/config/index.d.ts +16 -0
- package/lib/config/index.js +39 -0
- package/lib/config/utils.d.ts +0 -0
- package/lib/config/utils.js +0 -0
- package/lib/hooks/index.d.ts +8 -0
- package/lib/hooks/index.js +57 -0
- package/lib/hooks/useCountDown/index.d.ts +10 -0
- package/lib/hooks/useCountDown/index.js +57 -0
- package/lib/hooks/useDocumentScroll/index.d.ts +8 -0
- package/lib/hooks/useDocumentScroll/index.js +54 -0
- package/lib/hooks/useDocumentScroll/index.less +0 -0
- package/lib/hooks/useMousemove/index.d.ts +8 -0
- package/lib/hooks/useMousemove/index.js +70 -0
- package/lib/hooks/useResponsive/index.d.ts +2 -0
- package/lib/hooks/useResponsive/index.js +47 -0
- package/lib/hooks/useResponsive/index.less +0 -0
- package/lib/hooks/useSize/index.d.ts +2 -0
- package/lib/hooks/useSize/index.js +45 -0
- package/lib/hooks/useSize/index.less +0 -0
- package/lib/hooks/useStateMulti/index.d.ts +2 -0
- package/lib/hooks/useStateMulti/index.js +43 -0
- package/lib/hooks/useStateWithCb/index.d.ts +2 -0
- package/lib/hooks/useStateWithCb/index.js +53 -0
- package/lib/hooks/useTable/index.d.ts +12 -0
- package/lib/hooks/useTable/index.js +75 -0
- package/lib/hooks/useTable/index.less +0 -0
- package/lib/hooks/useTableModal/index.d.ts +12 -0
- package/lib/hooks/useTableModal/index.js +43 -0
- package/lib/hooks/useTableModal/index.less +0 -0
- package/lib/hooks/useUrlState/index.d.ts +2 -0
- package/lib/hooks/useUrlState/index.js +59 -0
- package/lib/hooks/useWebSocket/index.d.ts +13 -0
- package/lib/hooks/useWebSocket/index.js +91 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +22 -0
- package/lib/locales/en-US.d.ts +11 -0
- package/lib/locales/en-US.js +36 -0
- package/lib/locales/index.d.ts +1 -0
- package/lib/locales/index.js +59 -0
- package/lib/locales/zh-CN.d.ts +11 -0
- package/lib/locales/zh-CN.js +36 -0
- package/lib/locales/zh-TW.d.ts +11 -0
- package/lib/locales/zh-TW.js +36 -0
- package/lib/utils/index.d.ts +3 -0
- package/lib/utils/index.js +21 -0
- package/lib/utils/otherUtils.d.ts +8 -0
- package/lib/utils/otherUtils.js +31 -0
- package/lib/utils/storage.d.ts +30 -0
- package/lib/utils/storage.js +63 -0
- package/lib/utils/typeUtils.d.ts +42 -0
- package/lib/utils/typeUtils.js +75 -0
- package/package.json +101 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/locales/en-US.ts
|
|
20
|
+
var en_US_exports = {};
|
|
21
|
+
__export(en_US_exports, {
|
|
22
|
+
default: () => en_US_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(en_US_exports);
|
|
25
|
+
var en_US_default = {
|
|
26
|
+
"pisell-design.multi-select.apply": "Apply",
|
|
27
|
+
"pisell-design.multi-select.apply.no-data": "Sorry, no products matched your selection",
|
|
28
|
+
"pisell-design.paginator.previous": "Previous",
|
|
29
|
+
"pisell-design.paginator.next": "Next",
|
|
30
|
+
"pisell-design.search.search": "Search",
|
|
31
|
+
"pisell-design.recharge.option.button.edit": "Edit",
|
|
32
|
+
"pisell-design.recharge.option.button.add": "Add recharge item",
|
|
33
|
+
"pisell-design.select.tag.modal.title": "Select tag"
|
|
34
|
+
};
|
|
35
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
+
0 && (module.exports = {});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getText: (id: string) => any;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/locales/index.ts
|
|
30
|
+
var locales_exports = {};
|
|
31
|
+
__export(locales_exports, {
|
|
32
|
+
getText: () => getText
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(locales_exports);
|
|
35
|
+
var import_zh_CN = __toESM(require("../locales/zh-CN"));
|
|
36
|
+
var import_zh_TW = __toESM(require("../locales/zh-TW"));
|
|
37
|
+
var import_en_US = __toESM(require("../locales/en-US"));
|
|
38
|
+
var import_storage = require("../utils/storage");
|
|
39
|
+
var langMap = {
|
|
40
|
+
"zh-CN": import_zh_CN.default,
|
|
41
|
+
"en-US": import_en_US.default,
|
|
42
|
+
"zh-TW": import_zh_TW.default
|
|
43
|
+
};
|
|
44
|
+
var getText = (id) => {
|
|
45
|
+
if (!id) {
|
|
46
|
+
return "";
|
|
47
|
+
}
|
|
48
|
+
let locale = "en-US";
|
|
49
|
+
let oldLocale = (0, import_storage.getStorage)("umi_locale");
|
|
50
|
+
if (oldLocale) {
|
|
51
|
+
locale = oldLocale;
|
|
52
|
+
}
|
|
53
|
+
console.log("locale", (0, import_storage.getStorage)("umi_locale"));
|
|
54
|
+
return langMap[locale] ? langMap[locale][id] || id : id;
|
|
55
|
+
};
|
|
56
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
+
0 && (module.exports = {
|
|
58
|
+
getText
|
|
59
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'pisell-design.multi-select.apply': string;
|
|
3
|
+
'pisell-design.multi-select.apply.no-data': string;
|
|
4
|
+
'pisell-design.paginator.previous': string;
|
|
5
|
+
'pisell-design.paginator.next': string;
|
|
6
|
+
'pisell-design.search.search': string;
|
|
7
|
+
'pisell-design.recharge.option.button.edit': string;
|
|
8
|
+
'pisell-design.recharge.option.button.add': string;
|
|
9
|
+
'pisell-design.select.tag.modal.title': string;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/locales/zh-CN.ts
|
|
20
|
+
var zh_CN_exports = {};
|
|
21
|
+
__export(zh_CN_exports, {
|
|
22
|
+
default: () => zh_CN_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(zh_CN_exports);
|
|
25
|
+
var zh_CN_default = {
|
|
26
|
+
"pisell-design.multi-select.apply": "应用",
|
|
27
|
+
"pisell-design.multi-select.apply.no-data": "对不起,没有符合您选择的产品",
|
|
28
|
+
"pisell-design.paginator.previous": "上一页",
|
|
29
|
+
"pisell-design.paginator.next": "下一页",
|
|
30
|
+
"pisell-design.search.search": "搜索",
|
|
31
|
+
"pisell-design.recharge.option.button.edit": "编辑",
|
|
32
|
+
"pisell-design.recharge.option.button.add": "添加充值项",
|
|
33
|
+
"pisell-design.select.tag.modal.title": "选择标签"
|
|
34
|
+
};
|
|
35
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
+
0 && (module.exports = {});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'pisell-design.multi-select.apply': string;
|
|
3
|
+
'pisell-design.multi-select.apply.no-data': string;
|
|
4
|
+
'pisell-design.paginator.previous': string;
|
|
5
|
+
'pisell-design.paginator.next': string;
|
|
6
|
+
'pisell-design.search.search': string;
|
|
7
|
+
'pisell-design.recharge.option.button.edit': string;
|
|
8
|
+
'pisell-design.recharge.option.button.add': string;
|
|
9
|
+
'pisell-design.select.tag.modal.title': string;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/locales/zh-TW.ts
|
|
20
|
+
var zh_TW_exports = {};
|
|
21
|
+
__export(zh_TW_exports, {
|
|
22
|
+
default: () => zh_TW_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(zh_TW_exports);
|
|
25
|
+
var zh_TW_default = {
|
|
26
|
+
"pisell-design.multi-select.apply": "應用",
|
|
27
|
+
"pisell-design.multi-select.apply.no-data": "對不起,沒有符合您選擇的產品",
|
|
28
|
+
"pisell-design.paginator.previous": "上一頁",
|
|
29
|
+
"pisell-design.paginator.next": "下一頁",
|
|
30
|
+
"pisell-design.search.search": "搜索",
|
|
31
|
+
"pisell-design.recharge.option.button.edit": "編輯",
|
|
32
|
+
"pisell-design.recharge.option.button.add": "添加充值項",
|
|
33
|
+
"pisell-design.select.tag.modal.title": "選擇標籤"
|
|
34
|
+
};
|
|
35
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
+
0 && (module.exports = {});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/utils/index.ts
|
|
17
|
+
var utils_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(utils_exports);
|
|
19
|
+
__reExport(utils_exports, require("./otherUtils"), module.exports);
|
|
20
|
+
__reExport(utils_exports, require("./storage"), module.exports);
|
|
21
|
+
__reExport(utils_exports, require("./typeUtils"), module.exports);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/utils/otherUtils.ts
|
|
20
|
+
var otherUtils_exports = {};
|
|
21
|
+
__export(otherUtils_exports, {
|
|
22
|
+
getUniqueId: () => getUniqueId
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(otherUtils_exports);
|
|
25
|
+
var getUniqueId = (prefix = "", maxLength = 11) => {
|
|
26
|
+
return prefix + (Math.random() + "").replace(/\D/g, "").substring(0, maxLength);
|
|
27
|
+
};
|
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
+
0 && (module.exports = {
|
|
30
|
+
getUniqueId
|
|
31
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @title: 设置storage
|
|
3
|
+
* @description:
|
|
4
|
+
* @param {*} T
|
|
5
|
+
* @param {*} param2
|
|
6
|
+
* @return {*}
|
|
7
|
+
* @Author: Wzw
|
|
8
|
+
* @Date: 2022-02-21 10:30
|
|
9
|
+
*/
|
|
10
|
+
export declare const setStorage: (key: string, value: any, type?: 'local' | 'session', prefix?: string) => any;
|
|
11
|
+
/**
|
|
12
|
+
* @title: 获取storage
|
|
13
|
+
* @description:
|
|
14
|
+
* @param {string} key
|
|
15
|
+
* @param {string} prefix
|
|
16
|
+
* @return {*}
|
|
17
|
+
* @Author: Wzw
|
|
18
|
+
* @Date: 2022-02-21 10:30
|
|
19
|
+
*/
|
|
20
|
+
export declare const getStorage: (key: string, prefix?: string, type?: 'local' | 'session') => any;
|
|
21
|
+
/**
|
|
22
|
+
* @title: 删除storage
|
|
23
|
+
* @description:
|
|
24
|
+
* @param {string} key
|
|
25
|
+
* @param {string} prefix
|
|
26
|
+
* @return {*}
|
|
27
|
+
* @Author: Wzw
|
|
28
|
+
* @Date: 2022-02-21 10:30
|
|
29
|
+
*/
|
|
30
|
+
export declare const removeStorage: (key: string, prefix?: string, type?: 'local' | 'session') => void;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/utils/storage.ts
|
|
20
|
+
var storage_exports = {};
|
|
21
|
+
__export(storage_exports, {
|
|
22
|
+
getStorage: () => getStorage,
|
|
23
|
+
removeStorage: () => removeStorage,
|
|
24
|
+
setStorage: () => setStorage
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(storage_exports);
|
|
27
|
+
var default_prefix = "shop_";
|
|
28
|
+
var setStorage = (key, value, type, prefix) => {
|
|
29
|
+
const _value = value;
|
|
30
|
+
let _key = (prefix || default_prefix) + key;
|
|
31
|
+
if (type === void 0 || type === "local") {
|
|
32
|
+
localStorage.setItem(_key, _value);
|
|
33
|
+
} else {
|
|
34
|
+
sessionStorage.setItem(_key, _value);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var getStorage = (key, prefix, type) => {
|
|
38
|
+
let _key = (prefix || default_prefix) + key;
|
|
39
|
+
if (key === "umi_locale") {
|
|
40
|
+
_key = key;
|
|
41
|
+
}
|
|
42
|
+
if (type === void 0 || type === "local") {
|
|
43
|
+
let _localValue = localStorage.getItem(_key) || "";
|
|
44
|
+
return _localValue;
|
|
45
|
+
} else {
|
|
46
|
+
let _sessionValue = sessionStorage.getItem(_key) || "";
|
|
47
|
+
return _sessionValue;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
var removeStorage = (key, prefix, type) => {
|
|
51
|
+
let _key = (prefix || default_prefix) + key;
|
|
52
|
+
if (type === void 0 || type === "local") {
|
|
53
|
+
localStorage.removeItem(_key);
|
|
54
|
+
} else {
|
|
55
|
+
sessionStorage.removeItem(_key);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
59
|
+
0 && (module.exports = {
|
|
60
|
+
getStorage,
|
|
61
|
+
removeStorage,
|
|
62
|
+
setStorage
|
|
63
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 判断是否是函数
|
|
3
|
+
* @param obj
|
|
4
|
+
*/
|
|
5
|
+
export declare const isFunction: (obj: any) => obj is Function;
|
|
6
|
+
/**
|
|
7
|
+
* 判断是否是数组
|
|
8
|
+
* @param obj
|
|
9
|
+
*/
|
|
10
|
+
export declare const isArr: (obj: any) => obj is any[];
|
|
11
|
+
/**
|
|
12
|
+
* 判断是否是字符串
|
|
13
|
+
* @param obj
|
|
14
|
+
*/
|
|
15
|
+
export declare const isString: (obj: any) => obj is string;
|
|
16
|
+
/**
|
|
17
|
+
* 判断是否是数字
|
|
18
|
+
* @param obj
|
|
19
|
+
*/
|
|
20
|
+
export declare const isNumber: (obj: any) => obj is number;
|
|
21
|
+
/**
|
|
22
|
+
* 判断是否是undefined
|
|
23
|
+
* @param obj
|
|
24
|
+
*/
|
|
25
|
+
export declare const isUndefined: (obj: any) => obj is undefined;
|
|
26
|
+
/**
|
|
27
|
+
* 判断是否是boolean
|
|
28
|
+
* @param obj
|
|
29
|
+
*/
|
|
30
|
+
export declare const isBoolean: (obj: any) => obj is boolean;
|
|
31
|
+
/**
|
|
32
|
+
* 判断是否是json字符串
|
|
33
|
+
* @param v
|
|
34
|
+
*/
|
|
35
|
+
export declare const isJson: (v: any) => boolean;
|
|
36
|
+
/**
|
|
37
|
+
* @Title: 判断是否为对象
|
|
38
|
+
* @Describe:
|
|
39
|
+
* @Author: Wzw
|
|
40
|
+
* @param {any} obj
|
|
41
|
+
*/
|
|
42
|
+
export declare const isPlainObject: (obj: any) => boolean;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/utils/typeUtils.ts
|
|
20
|
+
var typeUtils_exports = {};
|
|
21
|
+
__export(typeUtils_exports, {
|
|
22
|
+
isArr: () => isArr,
|
|
23
|
+
isBoolean: () => isBoolean,
|
|
24
|
+
isFunction: () => isFunction,
|
|
25
|
+
isJson: () => isJson,
|
|
26
|
+
isNumber: () => isNumber,
|
|
27
|
+
isPlainObject: () => isPlainObject,
|
|
28
|
+
isString: () => isString,
|
|
29
|
+
isUndefined: () => isUndefined
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(typeUtils_exports);
|
|
32
|
+
var isFunction = (obj) => typeof obj === "function";
|
|
33
|
+
var isArr = (obj) => Array.isArray(obj);
|
|
34
|
+
var isString = (obj) => typeof obj === "string";
|
|
35
|
+
var isNumber = (obj) => typeof obj === "number";
|
|
36
|
+
var isUndefined = (obj) => typeof obj === "undefined";
|
|
37
|
+
var isBoolean = (obj) => typeof obj === "boolean";
|
|
38
|
+
var isJson = (v) => {
|
|
39
|
+
if (typeof v === "string") {
|
|
40
|
+
try {
|
|
41
|
+
return JSON.parse(v);
|
|
42
|
+
} catch (e) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
} else {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var getProto = Object.getPrototypeOf;
|
|
50
|
+
var hasOwn = {}.hasOwnProperty;
|
|
51
|
+
var fnToString = hasOwn.toString;
|
|
52
|
+
var ObjectFunctionString = fnToString.call(Object);
|
|
53
|
+
var isPlainObject = (obj) => {
|
|
54
|
+
var proto, Ctor;
|
|
55
|
+
if (!obj || toString.call(obj) !== "[object Object]") {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
proto = getProto(obj);
|
|
59
|
+
if (!proto) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
Ctor = hasOwn.call(proto, "constructor") && proto.constructor;
|
|
63
|
+
return typeof Ctor === "function" && fnToString.call(Ctor) === ObjectFunctionString;
|
|
64
|
+
};
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
67
|
+
isArr,
|
|
68
|
+
isBoolean,
|
|
69
|
+
isFunction,
|
|
70
|
+
isJson,
|
|
71
|
+
isNumber,
|
|
72
|
+
isPlainObject,
|
|
73
|
+
isString,
|
|
74
|
+
isUndefined
|
|
75
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pisell/common",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "A collection of reusable UI components for web development",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"*.less"
|
|
8
|
+
],
|
|
9
|
+
"main": "./lib/index.js",
|
|
10
|
+
"module": "./es/index.js",
|
|
11
|
+
"types": "./lib/index.d.ts",
|
|
12
|
+
"typings": "./lib/index.d.ts",
|
|
13
|
+
"files": [
|
|
14
|
+
"es",
|
|
15
|
+
"lib",
|
|
16
|
+
"package.json",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "father build",
|
|
21
|
+
"build:watch": "father dev",
|
|
22
|
+
"dev": "dumi dev",
|
|
23
|
+
"docs:build": "dumi build",
|
|
24
|
+
"doctor": "father doctor",
|
|
25
|
+
"lint": "npm run lint:es && npm run lint:css",
|
|
26
|
+
"lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
|
|
27
|
+
"lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
|
|
28
|
+
"prepare": "husky install && dumi setup",
|
|
29
|
+
"prepublishOnly": "father doctor && npm run build",
|
|
30
|
+
"release": "npm run build && np --no-cleanup --any-branch --yolo --tag",
|
|
31
|
+
"release:beta": "npm run build && np --no-cleanup --any-branch --yolo --tag=beta",
|
|
32
|
+
"release:next": "npm run build && np --no-cleanup --any-branch --yolo --tag=next",
|
|
33
|
+
"start": "npm run dev"
|
|
34
|
+
},
|
|
35
|
+
"commitlint": {
|
|
36
|
+
"extends": [
|
|
37
|
+
"@commitlint/config-conventional"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"lint-staged": {
|
|
41
|
+
"*.{md,json}": [
|
|
42
|
+
"prettier --write --no-error-on-unmatched-pattern"
|
|
43
|
+
],
|
|
44
|
+
"*.{css,less}": [
|
|
45
|
+
"stylelint --fix",
|
|
46
|
+
"prettier --write"
|
|
47
|
+
],
|
|
48
|
+
"*.{js,jsx}": [
|
|
49
|
+
"eslint --fix",
|
|
50
|
+
"prettier --write"
|
|
51
|
+
],
|
|
52
|
+
"*.{ts,tsx}": [
|
|
53
|
+
"eslint --fix",
|
|
54
|
+
"prettier --parser=typescript --write"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"array-move": "^3.0.1",
|
|
59
|
+
"react-beautiful-dnd": "^13.1.0",
|
|
60
|
+
"react-color": "^2.19.3"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@ant-design/icons": "^4.8.0",
|
|
64
|
+
"@commitlint/cli": "^17.1.2",
|
|
65
|
+
"@commitlint/config-conventional": "^17.1.0",
|
|
66
|
+
"@types/react": "^18.0.0",
|
|
67
|
+
"@types/react-dom": "^18.0.0",
|
|
68
|
+
"@umijs/fabric": "^2.0.0",
|
|
69
|
+
"@umijs/lint": "^4.0.0",
|
|
70
|
+
"ahooks": "^2.10.0",
|
|
71
|
+
"antd": "4.23.2",
|
|
72
|
+
"classnames": "^2.3.1",
|
|
73
|
+
"dumi": "^2.0.2",
|
|
74
|
+
"eslint": "^8.23.0",
|
|
75
|
+
"father": "^4.1.0",
|
|
76
|
+
"husky": "^8.0.1",
|
|
77
|
+
"lint-staged": "^13.0.3",
|
|
78
|
+
"np": "^7.7.0",
|
|
79
|
+
"prettier": "^2.7.1",
|
|
80
|
+
"prettier-plugin-organize-imports": "^3.0.0",
|
|
81
|
+
"prettier-plugin-packagejson": "^2.2.18",
|
|
82
|
+
"react": "^17.0.0",
|
|
83
|
+
"react-dom": "^17.0.0",
|
|
84
|
+
"stylelint": "^14.9.1",
|
|
85
|
+
"typescript": "^4.9.5",
|
|
86
|
+
"umi": "^3.3.9"
|
|
87
|
+
},
|
|
88
|
+
"peerDependencies": {
|
|
89
|
+
"@ant-design/icons": "^4.8.0",
|
|
90
|
+
"ahooks": "^2.10.0",
|
|
91
|
+
"antd": "4.23.2",
|
|
92
|
+
"classnames": "^2.3.1",
|
|
93
|
+
"react": ">=17.0",
|
|
94
|
+
"react-dom": ">=17.0",
|
|
95
|
+
"umi": "^3.3.9"
|
|
96
|
+
},
|
|
97
|
+
"publishConfig": {
|
|
98
|
+
"access": "public"
|
|
99
|
+
},
|
|
100
|
+
"authors": []
|
|
101
|
+
}
|