@pisell/common 0.0.19 → 1.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/.fatherrc.ts +7 -0
- package/CHANGELOG.md +7 -0
- package/README.md +1 -38
- package/{lib/components → es}/button/index.d.ts +5 -4
- package/es/button/index.d.ts.map +1 -0
- package/es/button/index.js +33 -0
- package/{es/components → lib}/button/index.d.ts +5 -4
- package/lib/button/index.d.ts.map +1 -0
- package/lib/{components/avatar → button}/index.js +14 -11
- package/package.json +20 -77
- package/src/button/index.md +17 -0
- package/src/button/index.tsx +38 -0
- package/tsconfig.json +14 -0
- package/LICENSE +0 -21
- package/es/bin/pisell.js +0 -2
- package/es/business-components/colorInput/index.d.ts +0 -21
- package/es/business-components/colorInput/index.js +0 -43
- package/es/business-components/colorInput/index.less +0 -10
- package/es/business-components/index.d.ts +0 -11
- package/es/business-components/index.js +0 -7
- package/es/business-components/rechargeOption/index.d.ts +0 -36
- package/es/business-components/rechargeOption/index.js +0 -132
- package/es/business-components/rechargeOption/index.less +0 -0
- package/es/business-components/selectTag/index.d.ts +0 -25
- package/es/business-components/selectTag/index.js +0 -179
- package/es/business-components/selectTag/index.less +0 -22
- package/es/business-components/sortModal/index.d.ts +0 -30
- package/es/business-components/sortModal/index.js +0 -85
- package/es/business-components/sortModal/index.less +0 -29
- package/es/business-components/statistics/index.d.ts +0 -12
- package/es/business-components/statistics/index.js +0 -38
- package/es/business-components/statistics/index.less +0 -64
- package/es/business-components/tagModal/index.d.ts +0 -17
- package/es/business-components/tagModal/index.js +0 -58
- package/es/business-hooks/index.d.ts +0 -2
- package/es/business-hooks/index.js +0 -2
- package/es/business-hooks/useModal/index.d.ts +0 -31
- package/es/business-hooks/useModal/index.js +0 -91
- package/es/business-hooks/useModal/index.less +0 -0
- package/es/business-hooks/useTagModal/index.d.ts +0 -17
- package/es/business-hooks/useTagModal/index.js +0 -47
- package/es/components/ColorPicker/index.d.ts +0 -22
- package/es/components/ColorPicker/index.js +0 -51
- package/es/components/ColorPicker/index.less +0 -17
- package/es/components/DragSort/index.d.ts +0 -2
- package/es/components/DragSort/index.js +0 -68
- package/es/components/EditorPreview/index.d.ts +0 -5
- package/es/components/EditorPreview/index.js +0 -14
- package/es/components/EditorPreview/index.less +0 -81
- package/es/components/Iconfont/index.d.ts +0 -6
- package/es/components/Iconfont/index.js +0 -29
- package/es/components/Iconfont/index.less +0 -0
- package/es/components/agreement/Detail/index.d.ts +0 -3
- package/es/components/agreement/Detail/index.js +0 -77
- package/es/components/agreement/Detail/serve.d.ts +0 -1
- package/es/components/agreement/Detail/serve.js +0 -6
- package/es/components/agreement/index.d.ts +0 -11
- package/es/components/agreement/index.js +0 -45
- package/es/components/agreement/index.less +0 -20
- package/es/components/avatar/index.d.ts +0 -13
- package/es/components/avatar/index.js +0 -25
- package/es/components/button/index.js +0 -36
- package/es/components/card/index.d.ts +0 -5
- package/es/components/card/index.js +0 -16
- package/es/components/card/index.less +0 -9
- package/es/components/checkbox/index.d.ts +0 -20
- package/es/components/checkbox/index.js +0 -43
- package/es/components/configProvider/index.d.ts +0 -113
- package/es/components/configProvider/index.js +0 -114
- package/es/components/datePicker/index.d.ts +0 -9
- package/es/components/datePicker/index.js +0 -17
- package/es/components/index.d.ts +0 -30
- package/es/components/index.js +0 -16
- package/es/components/input/index.d.ts +0 -35
- package/es/components/input/index.js +0 -97
- package/es/components/inputNumber/index.d.ts +0 -9
- package/es/components/inputNumber/index.js +0 -17
- package/es/components/pagination/index.d.ts +0 -10
- package/es/components/pagination/index.js +0 -18
- package/es/components/radio/index.d.ts +0 -13
- package/es/components/radio/index.js +0 -28
- package/es/components/select/index.d.ts +0 -9
- package/es/components/select/index.js +0 -17
- package/es/components/switch/index.d.ts +0 -10
- package/es/components/switch/index.js +0 -18
- package/es/config/index.d.ts +0 -30
- package/es/config/index.js +0 -18
- package/es/config/request.d.ts +0 -7
- package/es/config/request.js +0 -67
- package/es/config/utils.d.ts +0 -0
- package/es/config/utils.js +0 -0
- package/es/hooks/index.d.ts +0 -8
- package/es/hooks/index.js +0 -8
- package/es/hooks/useCountDown/index.d.ts +0 -10
- package/es/hooks/useCountDown/index.js +0 -48
- package/es/hooks/useDocumentScroll/index.d.ts +0 -8
- package/es/hooks/useDocumentScroll/index.js +0 -41
- package/es/hooks/useDocumentScroll/index.less +0 -0
- package/es/hooks/useMousemove/index.d.ts +0 -8
- package/es/hooks/useMousemove/index.js +0 -61
- package/es/hooks/useResponsive/index.d.ts +0 -2
- package/es/hooks/useResponsive/index.js +0 -29
- package/es/hooks/useResponsive/index.less +0 -0
- package/es/hooks/useSize/index.d.ts +0 -2
- package/es/hooks/useSize/index.js +0 -27
- package/es/hooks/useSize/index.less +0 -0
- package/es/hooks/useStateMulti/index.d.ts +0 -2
- package/es/hooks/useStateMulti/index.js +0 -29
- package/es/hooks/useStateWithCb/index.d.ts +0 -2
- package/es/hooks/useStateWithCb/index.js +0 -42
- package/es/hooks/useTable/index.d.ts +0 -12
- package/es/hooks/useTable/index.js +0 -74
- package/es/hooks/useTable/index.less +0 -0
- package/es/hooks/useTableModal/index.d.ts +0 -12
- package/es/hooks/useTableModal/index.js +0 -25
- package/es/hooks/useTableModal/index.less +0 -0
- package/es/hooks/useUrlState/index.d.ts +0 -2
- package/es/hooks/useUrlState/index.js +0 -56
- package/es/hooks/useWebSocket/index.d.ts +0 -13
- package/es/hooks/useWebSocket/index.js +0 -121
- package/es/index.d.ts +0 -4
- package/es/index.js +0 -4
- package/es/locales/en-US.d.ts +0 -11
- package/es/locales/en-US.js +0 -10
- package/es/locales/index.d.ts +0 -1
- package/es/locales/index.js +0 -23
- package/es/locales/zh-CN.d.ts +0 -11
- package/es/locales/zh-CN.js +0 -10
- package/es/locales/zh-TW.d.ts +0 -11
- package/es/locales/zh-TW.js +0 -10
- package/es/script/constants/index.js +0 -8
- package/es/script/deploy.js +0 -47
- package/es/script/index.js +0 -40
- package/es/script/package.json +0 -4
- package/es/script/release/index.js +0 -161
- package/es/script/release/release.js +0 -163
- package/es/script/uploadCode/index.js +0 -278
- package/es/script/uploadCode/uploadCode.js +0 -401
- package/es/script/utils/index.js +0 -321
- package/es/utils/index.d.ts +0 -3
- package/es/utils/index.js +0 -3
- package/es/utils/otherUtils.d.ts +0 -8
- package/es/utils/otherUtils.js +0 -12
- package/es/utils/storage.d.ts +0 -30
- package/es/utils/storage.js +0 -70
- package/es/utils/typeUtils.d.ts +0 -42
- package/es/utils/typeUtils.js +0 -86
- package/lib/bin/pisell.js +0 -26
- package/lib/business-components/colorInput/index.d.ts +0 -21
- package/lib/business-components/colorInput/index.js +0 -70
- package/lib/business-components/colorInput/index.less +0 -10
- package/lib/business-components/index.d.ts +0 -11
- package/lib/business-components/index.js +0 -54
- package/lib/business-components/rechargeOption/index.d.ts +0 -36
- package/lib/business-components/rechargeOption/index.js +0 -112
- package/lib/business-components/rechargeOption/index.less +0 -0
- package/lib/business-components/selectTag/index.d.ts +0 -25
- package/lib/business-components/selectTag/index.js +0 -181
- package/lib/business-components/selectTag/index.less +0 -22
- package/lib/business-components/sortModal/index.d.ts +0 -30
- package/lib/business-components/sortModal/index.js +0 -100
- package/lib/business-components/sortModal/index.less +0 -29
- package/lib/business-components/statistics/index.d.ts +0 -12
- package/lib/business-components/statistics/index.js +0 -63
- package/lib/business-components/statistics/index.less +0 -64
- package/lib/business-components/tagModal/index.d.ts +0 -17
- package/lib/business-components/tagModal/index.js +0 -66
- package/lib/business-hooks/index.d.ts +0 -2
- package/lib/business-hooks/index.js +0 -42
- package/lib/business-hooks/useModal/index.d.ts +0 -31
- package/lib/business-hooks/useModal/index.js +0 -68
- package/lib/business-hooks/useModal/index.less +0 -0
- package/lib/business-hooks/useTagModal/index.d.ts +0 -17
- package/lib/business-hooks/useTagModal/index.js +0 -61
- package/lib/components/ColorPicker/index.d.ts +0 -22
- package/lib/components/ColorPicker/index.js +0 -80
- package/lib/components/ColorPicker/index.less +0 -17
- package/lib/components/DragSort/index.d.ts +0 -2
- package/lib/components/DragSort/index.js +0 -101
- package/lib/components/EditorPreview/index.d.ts +0 -5
- package/lib/components/EditorPreview/index.js +0 -37
- package/lib/components/EditorPreview/index.less +0 -81
- package/lib/components/Iconfont/index.d.ts +0 -6
- package/lib/components/Iconfont/index.js +0 -48
- package/lib/components/Iconfont/index.less +0 -0
- package/lib/components/agreement/Detail/index.d.ts +0 -3
- package/lib/components/agreement/Detail/index.js +0 -86
- package/lib/components/agreement/Detail/serve.d.ts +0 -1
- package/lib/components/agreement/Detail/serve.js +0 -30
- package/lib/components/agreement/index.d.ts +0 -11
- package/lib/components/agreement/index.js +0 -82
- package/lib/components/agreement/index.less +0 -20
- package/lib/components/avatar/index.d.ts +0 -13
- package/lib/components/button/index.js +0 -36
- package/lib/components/card/index.d.ts +0 -5
- package/lib/components/card/index.js +0 -42
- package/lib/components/card/index.less +0 -9
- package/lib/components/checkbox/index.d.ts +0 -20
- package/lib/components/checkbox/index.js +0 -36
- package/lib/components/configProvider/index.d.ts +0 -113
- package/lib/components/configProvider/index.js +0 -159
- package/lib/components/datePicker/index.d.ts +0 -9
- package/lib/components/datePicker/index.js +0 -31
- package/lib/components/index.d.ts +0 -30
- package/lib/components/index.js +0 -83
- package/lib/components/input/index.d.ts +0 -35
- package/lib/components/input/index.js +0 -53
- package/lib/components/inputNumber/index.d.ts +0 -9
- package/lib/components/inputNumber/index.js +0 -31
- package/lib/components/pagination/index.d.ts +0 -10
- package/lib/components/pagination/index.js +0 -42
- package/lib/components/radio/index.d.ts +0 -13
- package/lib/components/radio/index.js +0 -36
- package/lib/components/select/index.d.ts +0 -9
- package/lib/components/select/index.js +0 -36
- package/lib/components/switch/index.d.ts +0 -10
- package/lib/components/switch/index.js +0 -42
- package/lib/config/index.d.ts +0 -30
- package/lib/config/index.js +0 -39
- package/lib/config/request.d.ts +0 -7
- package/lib/config/request.js +0 -76
- package/lib/config/utils.d.ts +0 -0
- package/lib/config/utils.js +0 -0
- package/lib/hooks/index.d.ts +0 -8
- package/lib/hooks/index.js +0 -57
- package/lib/hooks/useCountDown/index.d.ts +0 -10
- package/lib/hooks/useCountDown/index.js +0 -57
- package/lib/hooks/useDocumentScroll/index.d.ts +0 -8
- package/lib/hooks/useDocumentScroll/index.js +0 -54
- package/lib/hooks/useDocumentScroll/index.less +0 -0
- package/lib/hooks/useMousemove/index.d.ts +0 -8
- package/lib/hooks/useMousemove/index.js +0 -70
- package/lib/hooks/useResponsive/index.d.ts +0 -2
- package/lib/hooks/useResponsive/index.js +0 -47
- package/lib/hooks/useResponsive/index.less +0 -0
- package/lib/hooks/useSize/index.d.ts +0 -2
- package/lib/hooks/useSize/index.js +0 -45
- package/lib/hooks/useSize/index.less +0 -0
- package/lib/hooks/useStateMulti/index.d.ts +0 -2
- package/lib/hooks/useStateMulti/index.js +0 -43
- package/lib/hooks/useStateWithCb/index.d.ts +0 -2
- package/lib/hooks/useStateWithCb/index.js +0 -53
- package/lib/hooks/useTable/index.d.ts +0 -12
- package/lib/hooks/useTable/index.js +0 -75
- package/lib/hooks/useTable/index.less +0 -0
- package/lib/hooks/useTableModal/index.d.ts +0 -12
- package/lib/hooks/useTableModal/index.js +0 -43
- package/lib/hooks/useTableModal/index.less +0 -0
- package/lib/hooks/useUrlState/index.d.ts +0 -2
- package/lib/hooks/useUrlState/index.js +0 -59
- package/lib/hooks/useWebSocket/index.d.ts +0 -13
- package/lib/hooks/useWebSocket/index.js +0 -91
- package/lib/index.d.ts +0 -4
- package/lib/index.js +0 -22
- package/lib/locales/en-US.d.ts +0 -11
- package/lib/locales/en-US.js +0 -36
- package/lib/locales/index.d.ts +0 -1
- package/lib/locales/index.js +0 -59
- package/lib/locales/zh-CN.d.ts +0 -11
- package/lib/locales/zh-CN.js +0 -36
- package/lib/locales/zh-TW.d.ts +0 -11
- package/lib/locales/zh-TW.js +0 -36
- package/lib/script/constants/index.js +0 -35
- package/lib/script/deploy.js +0 -61
- package/lib/script/index.js +0 -61
- package/lib/script/package.json +0 -4
- package/lib/script/release/index.js +0 -116
- package/lib/script/release/release.js +0 -89
- package/lib/script/uploadCode/index.js +0 -202
- package/lib/script/uploadCode/uploadCode.js +0 -208
- package/lib/script/utils/index.js +0 -248
- package/lib/utils/index.d.ts +0 -3
- package/lib/utils/index.js +0 -21
- package/lib/utils/otherUtils.d.ts +0 -8
- package/lib/utils/otherUtils.js +0 -31
- package/lib/utils/storage.d.ts +0 -30
- package/lib/utils/storage.js +0 -63
- package/lib/utils/typeUtils.d.ts +0 -42
- package/lib/utils/typeUtils.js +0 -75
|
@@ -1,70 +0,0 @@
|
|
|
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/business-components/colorInput/index.tsx
|
|
30
|
-
var colorInput_exports = {};
|
|
31
|
-
__export(colorInput_exports, {
|
|
32
|
-
default: () => colorInput_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(colorInput_exports);
|
|
35
|
-
var import_antd5 = require("antd5");
|
|
36
|
-
var import_react = __toESM(require("react"));
|
|
37
|
-
var import_components = require("../../components");
|
|
38
|
-
var import_index = require("./index.less");
|
|
39
|
-
var prefix = "pisell-";
|
|
40
|
-
var ColorInput = (props) => {
|
|
41
|
-
const { value = "", onChange, colorBlockSize = 30 } = props;
|
|
42
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}color-input-wrap` }, /* @__PURE__ */ import_react.default.createElement(import_components.ColorPicker, { onChange, value }, /* @__PURE__ */ import_react.default.createElement(
|
|
43
|
-
"div",
|
|
44
|
-
{
|
|
45
|
-
style: {
|
|
46
|
-
backgroundColor: value,
|
|
47
|
-
width: colorBlockSize,
|
|
48
|
-
height: colorBlockSize
|
|
49
|
-
},
|
|
50
|
-
className: `${prefix}color-block`
|
|
51
|
-
}
|
|
52
|
-
)), /* @__PURE__ */ import_react.default.createElement(
|
|
53
|
-
import_antd5.Input,
|
|
54
|
-
{
|
|
55
|
-
value: value.replace("#", ""),
|
|
56
|
-
prefix: "#",
|
|
57
|
-
style: { width: 120 },
|
|
58
|
-
onChange: (e) => {
|
|
59
|
-
const reg = /^([0-9a-fA-F]{0,6})$/;
|
|
60
|
-
if (!reg.test(e.target.value)) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
onChange(`#${e.target.value}`);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
));
|
|
67
|
-
};
|
|
68
|
-
var colorInput_default = ColorInput;
|
|
69
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
70
|
-
0 && (module.exports = {});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { default as ColorInput } from './colorInput';
|
|
2
|
-
export type { ColorInputProps } from './colorInput';
|
|
3
|
-
export { default as RechargeOption } from './rechargeOption';
|
|
4
|
-
export type { RechargeOptionProps } from './rechargeOption';
|
|
5
|
-
export { default as SelectTag } from './selectTag';
|
|
6
|
-
export type { SelectTagProps } from './selectTag';
|
|
7
|
-
export { default as SortModal } from './sortModal';
|
|
8
|
-
export type { SortModalProps } from './sortModal';
|
|
9
|
-
export { default as Statistics } from './statistics';
|
|
10
|
-
export { default as TagModal } from './tagModal';
|
|
11
|
-
export type { TagModalProps } from './tagModal';
|
|
@@ -1,54 +0,0 @@
|
|
|
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/business-components/index.ts
|
|
30
|
-
var business_components_exports = {};
|
|
31
|
-
__export(business_components_exports, {
|
|
32
|
-
ColorInput: () => import_colorInput.default,
|
|
33
|
-
RechargeOption: () => import_rechargeOption.default,
|
|
34
|
-
SelectTag: () => import_selectTag.default,
|
|
35
|
-
SortModal: () => import_sortModal.default,
|
|
36
|
-
Statistics: () => import_statistics.default,
|
|
37
|
-
TagModal: () => import_tagModal.default
|
|
38
|
-
});
|
|
39
|
-
module.exports = __toCommonJS(business_components_exports);
|
|
40
|
-
var import_colorInput = __toESM(require("./colorInput"));
|
|
41
|
-
var import_rechargeOption = __toESM(require("./rechargeOption"));
|
|
42
|
-
var import_selectTag = __toESM(require("./selectTag"));
|
|
43
|
-
var import_sortModal = __toESM(require("./sortModal"));
|
|
44
|
-
var import_statistics = __toESM(require("./statistics"));
|
|
45
|
-
var import_tagModal = __toESM(require("./tagModal"));
|
|
46
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
-
0 && (module.exports = {
|
|
48
|
-
ColorInput,
|
|
49
|
-
RechargeOption,
|
|
50
|
-
SelectTag,
|
|
51
|
-
SortModal,
|
|
52
|
-
Statistics,
|
|
53
|
-
TagModal
|
|
54
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { ColProps } from 'antd5/lib/col';
|
|
2
|
-
import type { FormItemProps } from 'antd5/lib/form/FormItem';
|
|
3
|
-
import type { FormListFieldData, FormListProps } from 'antd5/lib/form/FormList';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import type { SortModalProps } from '../sortModal';
|
|
6
|
-
import type { FormInstance } from 'antd5/es/form/hooks/useForm';
|
|
7
|
-
export interface RechargeOptionProps {
|
|
8
|
-
name: FormListProps['name'];
|
|
9
|
-
/** 是否展示编辑按钮 */
|
|
10
|
-
isShowEditButton?: boolean;
|
|
11
|
-
/** 添加按钮文案 */
|
|
12
|
-
addBtnText?: string;
|
|
13
|
-
/** 编辑按钮文案 */
|
|
14
|
-
editBtnText?: string;
|
|
15
|
-
/** 列配置 */
|
|
16
|
-
columnOption: {
|
|
17
|
-
label: string;
|
|
18
|
-
span: ColProps['span'];
|
|
19
|
-
field: string;
|
|
20
|
-
rules: FormItemProps['rules'];
|
|
21
|
-
}[];
|
|
22
|
-
/** 编辑按钮事件 */
|
|
23
|
-
onEditClick?: (bundle: FormListFieldData) => void;
|
|
24
|
-
rechargeOptionRef?: React.MutableRefObject<{
|
|
25
|
-
openSortModal: () => void;
|
|
26
|
-
} | undefined>;
|
|
27
|
-
sortModalProps?: Partial<Omit<SortModalProps<Record<string, any>>, 'ref'>>;
|
|
28
|
-
form: FormInstance;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* 类充值选项组件
|
|
32
|
-
* @param props
|
|
33
|
-
* @constructor
|
|
34
|
-
*/
|
|
35
|
-
declare const RechargeOption: React.FC<RechargeOptionProps>;
|
|
36
|
-
export default RechargeOption;
|
|
@@ -1,112 +0,0 @@
|
|
|
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/business-components/rechargeOption/index.tsx
|
|
30
|
-
var rechargeOption_exports = {};
|
|
31
|
-
__export(rechargeOption_exports, {
|
|
32
|
-
default: () => rechargeOption_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(rechargeOption_exports);
|
|
35
|
-
var import_icons = require("@ant-design/icons");
|
|
36
|
-
var import_antd5 = require("antd5");
|
|
37
|
-
var import_react = __toESM(require("react"));
|
|
38
|
-
var import_utils = require("../../utils");
|
|
39
|
-
var import_locales = require("../../locales");
|
|
40
|
-
var RechargeOption = (props) => {
|
|
41
|
-
const {
|
|
42
|
-
name,
|
|
43
|
-
isShowEditButton = false,
|
|
44
|
-
columnOption,
|
|
45
|
-
addBtnText,
|
|
46
|
-
editBtnText,
|
|
47
|
-
onEditClick,
|
|
48
|
-
rechargeOptionRef
|
|
49
|
-
// sortModalProps,
|
|
50
|
-
// form,
|
|
51
|
-
} = props;
|
|
52
|
-
const sortModalRef = (0, import_react.useRef)(null);
|
|
53
|
-
const genDefaultData = (0, import_react.useCallback)(
|
|
54
|
-
(others) => {
|
|
55
|
-
return columnOption.reduce((acc, cur) => ({ ...acc, [cur.field]: "" }), {
|
|
56
|
-
key: (0, import_utils.getUniqueId)(),
|
|
57
|
-
...others
|
|
58
|
-
});
|
|
59
|
-
},
|
|
60
|
-
[columnOption]
|
|
61
|
-
);
|
|
62
|
-
const initValue = (0, import_react.useMemo)(() => genDefaultData({ id: 0 }), [columnOption]);
|
|
63
|
-
(0, import_react.useImperativeHandle)(rechargeOptionRef, () => ({
|
|
64
|
-
openSortModal: () => {
|
|
65
|
-
var _a;
|
|
66
|
-
(_a = sortModalRef.current) == null ? void 0 : _a.showModal();
|
|
67
|
-
}
|
|
68
|
-
}));
|
|
69
|
-
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_antd5.Row, { gutter: 10, style: { marginBottom: "10px" } }, columnOption.map((item) => {
|
|
70
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd5.Col, { span: item.span, key: item.label }, item.label);
|
|
71
|
-
})), /* @__PURE__ */ import_react.default.createElement(import_antd5.Form.List, { name, initialValue: [initValue] }, (fields, { add, remove }) => /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, fields.map((bundle, i) => {
|
|
72
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd5.Form.Item, { key: bundle.key, noStyle: true }, /* @__PURE__ */ import_react.default.createElement(import_antd5.Row, { gutter: 10 }, columnOption.map((item) => {
|
|
73
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd5.Col, { span: item.span, key: item.label }, /* @__PURE__ */ import_react.default.createElement(
|
|
74
|
-
import_antd5.Form.Item,
|
|
75
|
-
{
|
|
76
|
-
name: [bundle.name, item.field],
|
|
77
|
-
rules: item.rules
|
|
78
|
-
},
|
|
79
|
-
/* @__PURE__ */ import_react.default.createElement(import_antd5.Input, { style: { width: "100%" } })
|
|
80
|
-
));
|
|
81
|
-
}), isShowEditButton && /* @__PURE__ */ import_react.default.createElement(import_antd5.Col, { span: 3 }, /* @__PURE__ */ import_react.default.createElement(
|
|
82
|
-
import_antd5.Button,
|
|
83
|
-
{
|
|
84
|
-
onClick: () => {
|
|
85
|
-
(0, import_utils.isFunction)(onEditClick) && onEditClick(bundle);
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
editBtnText || (0, import_locales.getText)(
|
|
89
|
-
"pisell-design.recharge.option.button.edit"
|
|
90
|
-
)
|
|
91
|
-
)), /* @__PURE__ */ import_react.default.createElement(import_antd5.Col, { span: 2 }, i !== 0 && /* @__PURE__ */ import_react.default.createElement(
|
|
92
|
-
import_antd5.Button,
|
|
93
|
-
{
|
|
94
|
-
icon: /* @__PURE__ */ import_react.default.createElement(import_icons.DeleteOutlined, null),
|
|
95
|
-
onClick: () => {
|
|
96
|
-
remove(bundle.name);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
))));
|
|
100
|
-
}), /* @__PURE__ */ import_react.default.createElement(
|
|
101
|
-
import_antd5.Button,
|
|
102
|
-
{
|
|
103
|
-
onClick: () => {
|
|
104
|
-
add(genDefaultData({ id: fields.length + 1 }));
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
addBtnText || (0, import_locales.getText)("pisell-design.recharge.option.button.add")
|
|
108
|
-
)))));
|
|
109
|
-
};
|
|
110
|
-
var rechargeOption_default = RechargeOption;
|
|
111
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
112
|
-
0 && (module.exports = {});
|
|
File without changes
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { SelectProps } from 'antd5';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import './index.less';
|
|
4
|
-
declare type BaseValue = string | number;
|
|
5
|
-
declare type ColorValue = {
|
|
6
|
-
color: string;
|
|
7
|
-
value: BaseValue;
|
|
8
|
-
label: string;
|
|
9
|
-
};
|
|
10
|
-
declare type Value = BaseValue | ColorValue;
|
|
11
|
-
export interface SelectTagProps<T> extends Omit<SelectProps, 'options'> {
|
|
12
|
-
selectTagRef?: React.MutableRefObject<{
|
|
13
|
-
showModal: () => void;
|
|
14
|
-
hideModal: () => void;
|
|
15
|
-
}>;
|
|
16
|
-
value?: T[];
|
|
17
|
-
onChange?: (value: T[]) => void;
|
|
18
|
-
isColorSelect?: boolean;
|
|
19
|
-
options: {
|
|
20
|
-
value: BaseValue;
|
|
21
|
-
label: string;
|
|
22
|
-
}[];
|
|
23
|
-
}
|
|
24
|
-
declare const SelectTag: <T extends Value>(props: SelectTagProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
export default SelectTag;
|
|
@@ -1,181 +0,0 @@
|
|
|
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/business-components/selectTag/index.tsx
|
|
30
|
-
var selectTag_exports = {};
|
|
31
|
-
__export(selectTag_exports, {
|
|
32
|
-
default: () => selectTag_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(selectTag_exports);
|
|
35
|
-
var import_antd5 = require("antd5");
|
|
36
|
-
var import_react = __toESM(require("react"));
|
|
37
|
-
var import_business_hooks = require("../../business-hooks");
|
|
38
|
-
var import_DragSort = __toESM(require("../../components/DragSort"));
|
|
39
|
-
var import_Iconfont = __toESM(require("../../components/Iconfont"));
|
|
40
|
-
var import_locales = require("../../locales");
|
|
41
|
-
var import_utils = require("../../utils");
|
|
42
|
-
var import_colorInput = __toESM(require("../colorInput"));
|
|
43
|
-
var import_index = require("./index.less");
|
|
44
|
-
var defaultColor = "#000";
|
|
45
|
-
var prefix = "pisell-";
|
|
46
|
-
var SelectTag = (props) => {
|
|
47
|
-
const { selectTagRef, value, onChange, options, isColorSelect } = props;
|
|
48
|
-
const tagValue = (0, import_react.useMemo)(() => {
|
|
49
|
-
if (!(0, import_utils.isArr)(value)) {
|
|
50
|
-
return [];
|
|
51
|
-
}
|
|
52
|
-
if (value.every((item) => (0, import_utils.isString)(item) || (0, import_utils.isNumber)(item))) {
|
|
53
|
-
return value;
|
|
54
|
-
}
|
|
55
|
-
return value.map((item) => item.value);
|
|
56
|
-
}, [value]);
|
|
57
|
-
const valueColorMap = (0, import_react.useMemo)(() => {
|
|
58
|
-
if (!isColorSelect || !(0, import_utils.isArr)(value)) {
|
|
59
|
-
return {};
|
|
60
|
-
}
|
|
61
|
-
return value.reduce(
|
|
62
|
-
(pre, cur) => ({ ...pre, [cur.value]: cur.color }),
|
|
63
|
-
{}
|
|
64
|
-
);
|
|
65
|
-
}, [value, options]);
|
|
66
|
-
const valueLabelMap = (0, import_react.useMemo)(
|
|
67
|
-
() => options.reduce((pre, cur) => ({ ...pre, [cur.value]: cur.label }), {}),
|
|
68
|
-
[options]
|
|
69
|
-
);
|
|
70
|
-
const handleTagChange = (0, import_react.useCallback)(
|
|
71
|
-
(val) => {
|
|
72
|
-
if (isColorSelect) {
|
|
73
|
-
const _value = val.map((item) => {
|
|
74
|
-
return {
|
|
75
|
-
color: valueColorMap[item] || defaultColor,
|
|
76
|
-
value: item
|
|
77
|
-
};
|
|
78
|
-
});
|
|
79
|
-
(0, import_utils.isFunction)(onChange) && onChange(_value);
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
(0, import_utils.isFunction)(onChange) && onChange(val);
|
|
83
|
-
},
|
|
84
|
-
[isColorSelect, onChange, valueColorMap]
|
|
85
|
-
);
|
|
86
|
-
const { content, hideModal, showModal } = (0, import_business_hooks.useTagModal)({
|
|
87
|
-
value: tagValue,
|
|
88
|
-
onChange: handleTagChange,
|
|
89
|
-
data: options,
|
|
90
|
-
onOk: () => {
|
|
91
|
-
hideModal();
|
|
92
|
-
},
|
|
93
|
-
title: (0, import_locales.getText)("pisell-design.select.tag.modal.title"),
|
|
94
|
-
onCancel: () => {
|
|
95
|
-
hideModal();
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
(0, import_react.useImperativeHandle)(selectTagRef, () => ({
|
|
99
|
-
showModal,
|
|
100
|
-
hideModal
|
|
101
|
-
}));
|
|
102
|
-
const tagRender = (props2) => {
|
|
103
|
-
const { label, value: value2, closable, onClose } = props2;
|
|
104
|
-
const onPreventMouseDown = (event) => {
|
|
105
|
-
event.preventDefault();
|
|
106
|
-
event.stopPropagation();
|
|
107
|
-
};
|
|
108
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
109
|
-
import_antd5.Tag,
|
|
110
|
-
{
|
|
111
|
-
onMouseDown: onPreventMouseDown,
|
|
112
|
-
closable,
|
|
113
|
-
onClose,
|
|
114
|
-
className: `${prefix}select-tag`,
|
|
115
|
-
style: { color: valueColorMap[value2] || defaultColor }
|
|
116
|
-
},
|
|
117
|
-
label
|
|
118
|
-
);
|
|
119
|
-
};
|
|
120
|
-
const handleSelectChange = (0, import_react.useCallback)(
|
|
121
|
-
(val) => {
|
|
122
|
-
let newVal = val;
|
|
123
|
-
if (isColorSelect) {
|
|
124
|
-
newVal = val.map((item) => ({
|
|
125
|
-
value: item,
|
|
126
|
-
color: valueColorMap[item] || defaultColor
|
|
127
|
-
}));
|
|
128
|
-
}
|
|
129
|
-
(0, import_utils.isFunction)(onChange) && onChange(newVal);
|
|
130
|
-
},
|
|
131
|
-
[isColorSelect, valueColorMap]
|
|
132
|
-
);
|
|
133
|
-
const selectValue = (0, import_react.useMemo)(() => {
|
|
134
|
-
if (!(0, import_utils.isArr)(value)) {
|
|
135
|
-
return [];
|
|
136
|
-
}
|
|
137
|
-
if (value.every((item) => (0, import_utils.isString)(item) || (0, import_utils.isNumber)(item))) {
|
|
138
|
-
return value;
|
|
139
|
-
}
|
|
140
|
-
if (isColorSelect) {
|
|
141
|
-
return value.map((item) => item.value);
|
|
142
|
-
}
|
|
143
|
-
}, [value, isColorSelect]);
|
|
144
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
145
|
-
import_antd5.Select,
|
|
146
|
-
{
|
|
147
|
-
...props,
|
|
148
|
-
value: selectValue,
|
|
149
|
-
mode: "tags",
|
|
150
|
-
options,
|
|
151
|
-
onChange: handleSelectChange,
|
|
152
|
-
tagRender
|
|
153
|
-
}
|
|
154
|
-
), isColorSelect && /* @__PURE__ */ import_react.default.createElement(
|
|
155
|
-
import_DragSort.default,
|
|
156
|
-
{
|
|
157
|
-
list: value || [],
|
|
158
|
-
droppableId: "addressSort",
|
|
159
|
-
draggableIdKey: "value",
|
|
160
|
-
onChange: (_list) => {
|
|
161
|
-
(0, import_utils.isFunction)(onChange) && onChange(_list);
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
(item, index) => {
|
|
165
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { key: item.value, className: `${prefix}sort-item` }, /* @__PURE__ */ import_react.default.createElement(import_Iconfont.default, { type: "icon-drag", className: `${prefix}icon` }), /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefix}sort-content` }, /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefix}tag-content` }, valueLabelMap[item.value])), /* @__PURE__ */ import_react.default.createElement(
|
|
166
|
-
import_colorInput.default,
|
|
167
|
-
{
|
|
168
|
-
value: item.color,
|
|
169
|
-
onChange: (val) => {
|
|
170
|
-
const _value = value ? [...value] : [];
|
|
171
|
-
_value[index].color = val;
|
|
172
|
-
(0, import_utils.isFunction)(onChange) && onChange(_value);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
));
|
|
176
|
-
}
|
|
177
|
-
), content);
|
|
178
|
-
};
|
|
179
|
-
var selectTag_default = SelectTag;
|
|
180
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
181
|
-
0 && (module.exports = {});
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
.pisell-sort-item {
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
height: 50px;
|
|
5
|
-
margin-top: 12px;
|
|
6
|
-
line-height: 40px;
|
|
7
|
-
background-color: #f0f0f0;
|
|
8
|
-
.pisell-sort-content {
|
|
9
|
-
margin-right: 10px;
|
|
10
|
-
}
|
|
11
|
-
.pisell-icon {
|
|
12
|
-
color: #999;
|
|
13
|
-
font-size: 20px;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.pisell-select-tag {
|
|
18
|
-
margin: 0 3px 3px 0;
|
|
19
|
-
padding: 2px 8px;
|
|
20
|
-
font-size: 14px;
|
|
21
|
-
border-radius: 6px;
|
|
22
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { useModalProps } from '../../business-hooks/useModal';
|
|
3
|
-
import './index.less';
|
|
4
|
-
export interface SortModalProps<T> {
|
|
5
|
-
/** 排序数据 */
|
|
6
|
-
items: T[];
|
|
7
|
-
/** 弹窗标题 */
|
|
8
|
-
title: useModalProps['title'];
|
|
9
|
-
/** 自定义渲染内容 */
|
|
10
|
-
renderContent?: (items: T[], content: React.ReactNode) => React.ReactNode;
|
|
11
|
-
/** 自定义渲染排序项 */
|
|
12
|
-
renderSortItem?: (item: T, index: number) => React.ReactNode;
|
|
13
|
-
/** 是否展示序号 */
|
|
14
|
-
isShowIndex?: boolean;
|
|
15
|
-
/** 字段展示配置 */
|
|
16
|
-
field: {
|
|
17
|
-
id: keyof T;
|
|
18
|
-
name: keyof T;
|
|
19
|
-
key: keyof T;
|
|
20
|
-
};
|
|
21
|
-
/** 确认事件 返回调整后的顺序 */
|
|
22
|
-
onOk?: (list: T[]) => void;
|
|
23
|
-
/** 弹窗ref 可外部唤起弹窗 */
|
|
24
|
-
sortModalRef?: React.Ref<{
|
|
25
|
-
showModal: () => void;
|
|
26
|
-
hideModal: () => void;
|
|
27
|
-
}>;
|
|
28
|
-
}
|
|
29
|
-
declare const SortModal: <T extends Record<string, any>>(props: SortModalProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
-
export default SortModal;
|
|
@@ -1,100 +0,0 @@
|
|
|
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/business-components/sortModal/index.tsx
|
|
30
|
-
var sortModal_exports = {};
|
|
31
|
-
__export(sortModal_exports, {
|
|
32
|
-
default: () => sortModal_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(sortModal_exports);
|
|
35
|
-
var import_react = __toESM(require("react"));
|
|
36
|
-
var import_utils = require("../../utils");
|
|
37
|
-
var import_useModal = __toESM(require("../../business-hooks/useModal"));
|
|
38
|
-
var import_components = require("../../components");
|
|
39
|
-
var import_index = require("./index.less");
|
|
40
|
-
var prefix = "pisell-";
|
|
41
|
-
var SortModal = (props) => {
|
|
42
|
-
const {
|
|
43
|
-
title,
|
|
44
|
-
items,
|
|
45
|
-
renderSortItem,
|
|
46
|
-
field,
|
|
47
|
-
isShowIndex,
|
|
48
|
-
onOk,
|
|
49
|
-
sortModalRef,
|
|
50
|
-
renderContent
|
|
51
|
-
} = props;
|
|
52
|
-
const [sortItems, setSortItems] = (0, import_react.useState)(items);
|
|
53
|
-
(0, import_react.useEffect)(() => {
|
|
54
|
-
setSortItems(items);
|
|
55
|
-
}, [items]);
|
|
56
|
-
const RenderSortItem = (0, import_react.useCallback)(
|
|
57
|
-
(item, index) => {
|
|
58
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { key: item[field.key], className: `${prefix}sort-item` }, /* @__PURE__ */ import_react.default.createElement(import_components.IconFont, { type: "icon-drag", className: `${prefix}item` }), /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefix}sort-content` }, isShowIndex && index + 1, /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefix}tag-content` }, item[field.name])));
|
|
59
|
-
},
|
|
60
|
-
[props]
|
|
61
|
-
);
|
|
62
|
-
const ModalContent = (0, import_react.useMemo)(() => {
|
|
63
|
-
const content2 = /* @__PURE__ */ import_react.default.createElement(
|
|
64
|
-
import_components.DragSort,
|
|
65
|
-
{
|
|
66
|
-
list: sortItems,
|
|
67
|
-
droppableId: "addressSort",
|
|
68
|
-
draggableIdKey: field.id,
|
|
69
|
-
className: `${prefix}sort-list`,
|
|
70
|
-
onChange: (_list) => {
|
|
71
|
-
setSortItems(_list);
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
(0, import_utils.isFunction)(renderSortItem) ? renderSortItem : RenderSortItem
|
|
75
|
-
);
|
|
76
|
-
if ((0, import_utils.isFunction)(renderContent)) {
|
|
77
|
-
return renderContent(sortItems, content2);
|
|
78
|
-
}
|
|
79
|
-
if (renderContent) {
|
|
80
|
-
return renderContent;
|
|
81
|
-
}
|
|
82
|
-
return content2;
|
|
83
|
-
}, [sortItems, renderSortItem, RenderSortItem, renderContent]);
|
|
84
|
-
const handleOk = (0, import_react.useCallback)(() => {
|
|
85
|
-
(0, import_utils.isFunction)(onOk) && onOk(sortItems);
|
|
86
|
-
}, [onOk, sortItems]);
|
|
87
|
-
const { content, hideModal, visible, showModal } = (0, import_useModal.default)({
|
|
88
|
-
children: ModalContent,
|
|
89
|
-
title,
|
|
90
|
-
onOk: handleOk
|
|
91
|
-
});
|
|
92
|
-
(0, import_react.useImperativeHandle)(sortModalRef, () => ({
|
|
93
|
-
showModal,
|
|
94
|
-
hideModal
|
|
95
|
-
}));
|
|
96
|
-
return content;
|
|
97
|
-
};
|
|
98
|
-
var sortModal_default = SortModal;
|
|
99
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
100
|
-
0 && (module.exports = {});
|