@pisell/materials 1.0.454 → 1.0.455
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +15 -15
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +20 -20
- package/es/components/button/index.js +0 -2
- package/es/components/buttonGroupEdit/index.js +0 -2
- package/es/components/buttonGroupPreview/index.js +1 -4
- package/es/components/dataSourceComponents/dataSourceForm/formItem.js +11 -1
- package/es/components/dataSourceComponents/dataSourceForm/provider/hooks/useJsonPrefixPath.d.ts +2 -0
- package/es/components/dataSourceComponents/dataSourceForm/provider/hooks/useJsonPrefixPath.js +7 -0
- package/es/components/dataSourceComponents/dataSourceForm/provider/jsonWrapper/JsonWrapperContext.d.ts +3 -0
- package/es/components/dataSourceComponents/dataSourceForm/provider/jsonWrapper/JsonWrapperContext.js +3 -0
- package/es/components/dataSourceComponents/dataSourceForm/provider/jsonWrapper/JsonWrapperProvider.d.ts +7 -0
- package/es/components/dataSourceComponents/dataSourceForm/provider/jsonWrapper/JsonWrapperProvider.js +25 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +20 -4
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDesignMode.js +14 -1
- package/es/components/dataSourceComponents/dataSourceTable/index.js +8 -7
- package/es/components/pisellQrcode/index.js +1 -3
- package/es/components/pisellStatistic/index.d.ts +2 -2
- package/es/components/pisellStatistic/index.js +3 -3
- package/es/components/productCard/index.js +3 -0
- package/es/components/productCard/utils.js +1 -0
- package/es/components/record-view/index.d.ts +1 -0
- package/es/components/record-view/index.js +37 -4
- package/es/components/record-view/index.less +19 -2
- package/es/components/tabs/index.js +0 -2
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/locales/en-US.d.ts +4 -0
- package/es/locales/en-US.js +6 -1
- package/es/locales/zh-CN.d.ts +4 -0
- package/es/locales/zh-CN.js +5 -1
- package/es/locales/zh-TW.d.ts +4 -0
- package/es/locales/zh-TW.js +6 -1
- package/lib/components/button/index.js +0 -2
- package/lib/components/buttonGroupEdit/index.js +246 -156
- package/lib/components/buttonGroupPreview/index.js +31 -15
- package/lib/components/dataSourceComponents/dataSourceForm/formItem.js +5 -1
- package/lib/components/dataSourceComponents/dataSourceForm/provider/hooks/useJsonPrefixPath.d.ts +2 -0
- package/lib/components/dataSourceComponents/dataSourceForm/provider/hooks/useJsonPrefixPath.js +41 -0
- package/lib/components/dataSourceComponents/dataSourceForm/provider/jsonWrapper/JsonWrapperContext.d.ts +3 -0
- package/lib/components/dataSourceComponents/dataSourceForm/provider/jsonWrapper/JsonWrapperContext.js +27 -0
- package/lib/components/dataSourceComponents/dataSourceForm/provider/jsonWrapper/JsonWrapperProvider.d.ts +7 -0
- package/lib/components/dataSourceComponents/dataSourceForm/provider/jsonWrapper/JsonWrapperProvider.js +48 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +16 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDesignMode.js +13 -1
- package/lib/components/dataSourceComponents/dataSourceTable/index.js +8 -7
- package/lib/components/pisellQrcode/index.js +0 -5
- package/lib/components/pisellStatistic/index.d.ts +2 -2
- package/lib/components/pisellStatistic/index.js +3 -3
- package/lib/components/productCard/index.js +3 -0
- package/lib/components/productCard/utils.js +1 -0
- package/lib/components/record-view/index.d.ts +1 -0
- package/lib/components/record-view/index.js +23 -1
- package/lib/components/record-view/index.less +19 -2
- package/lib/components/tabs/index.js +0 -2
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/locales/en-US.d.ts +4 -0
- package/lib/locales/en-US.js +6 -1
- package/lib/locales/zh-CN.d.ts +4 -0
- package/lib/locales/zh-CN.js +5 -1
- package/lib/locales/zh-TW.d.ts +4 -0
- package/lib/locales/zh-TW.js +6 -1
- package/lowcode/data-source-form/constants.ts +4 -1
- package/lowcode/data-source-form/utils.ts +27 -15
- package/lowcode/form-item-input.text-area/meta.ts +2 -2
- package/lowcode/json-wrapper/meta.ts +65 -0
- package/lowcode/json-wrapper/snippets.ts +16 -0
- package/lowcode/record-view/meta.ts +8 -0
- package/package.json +3 -3
|
@@ -34,3 +34,4 @@ export declare const formItemNameReverse: (name: string) => string;
|
|
|
34
34
|
export declare const withFormItem: <P extends object>(WrappedComponent: React.ComponentType<P>) => React.FC<P & WithFormItemProps>;
|
|
35
35
|
export declare const getNestedValue: (obj: Record<string, any>, path: string) => Record<string, any>;
|
|
36
36
|
export declare const renderValueWithMap: (value: any, valueMap?: Record<string, string>) => React.JSX.Element | null;
|
|
37
|
+
export declare function toArr(str: string | number | (string | number)[]): (string | number)[];
|
|
@@ -33,6 +33,7 @@ __export(utils_exports, {
|
|
|
33
33
|
formItemNameReverse: () => formItemNameReverse,
|
|
34
34
|
getNestedValue: () => getNestedValue,
|
|
35
35
|
renderValueWithMap: () => renderValueWithMap,
|
|
36
|
+
toArr: () => toArr,
|
|
36
37
|
withFormItem: () => withFormItem,
|
|
37
38
|
withMode: () => withMode
|
|
38
39
|
});
|
|
@@ -43,6 +44,7 @@ var import_antd = require("antd");
|
|
|
43
44
|
var import_form = __toESM(require("../../form"));
|
|
44
45
|
var import_useDataSource = __toESM(require("../hooks/useDataSource"));
|
|
45
46
|
var import_useFormSetting = __toESM(require("./provider/hooks/useFormSetting"));
|
|
47
|
+
var import_useJsonPrefixPath = __toESM(require("./provider/hooks/useJsonPrefixPath"));
|
|
46
48
|
var withMode = (FieldComponent, ReadPrettyComponent, transformProps) => {
|
|
47
49
|
return ({ renderMode = "edit", value, onChange, ...props }) => {
|
|
48
50
|
const transformedProps = (transformProps == null ? void 0 : transformProps(
|
|
@@ -91,11 +93,15 @@ var withFormItem = (WrappedComponent) => {
|
|
|
91
93
|
typeobj,
|
|
92
94
|
maxobj,
|
|
93
95
|
minobj,
|
|
96
|
+
normalize,
|
|
97
|
+
getValueProps,
|
|
98
|
+
validator,
|
|
94
99
|
style,
|
|
95
100
|
__designMode,
|
|
96
101
|
...otherProps
|
|
97
102
|
}) => {
|
|
98
103
|
var _a;
|
|
104
|
+
const prefixPath = (0, import_useJsonPrefixPath.default)();
|
|
99
105
|
const { dataSource } = (0, import_useDataSource.default)();
|
|
100
106
|
const { fields } = dataSource || {};
|
|
101
107
|
const { mode: globalMode } = (0, import_useFormSetting.default)();
|
|
@@ -108,6 +114,7 @@ var withFormItem = (WrappedComponent) => {
|
|
|
108
114
|
const isDesignMode = __designMode === "design";
|
|
109
115
|
const isHidden = effectiveMode === "hidden";
|
|
110
116
|
const name = (0, import_utils.isString)(propsName) && propsName.includes(".") ? [propsName] : propsName;
|
|
117
|
+
const concatName = name !== void 0 ? [...prefixPath, ...toArr(name)] : void 0;
|
|
111
118
|
const rules = [];
|
|
112
119
|
if (requiredobj && requiredobj.required) {
|
|
113
120
|
rules.push(requiredobj);
|
|
@@ -136,13 +143,16 @@ var withFormItem = (WrappedComponent) => {
|
|
|
136
143
|
...style,
|
|
137
144
|
opacity: isDesignMode && isHidden ? "0.3" : 1
|
|
138
145
|
},
|
|
139
|
-
name,
|
|
146
|
+
name: concatName,
|
|
140
147
|
label,
|
|
141
148
|
tooltip,
|
|
142
149
|
noStyle,
|
|
143
150
|
extra,
|
|
144
151
|
hidden: isHidden && !isDesignMode,
|
|
145
|
-
rules
|
|
152
|
+
rules,
|
|
153
|
+
normalize,
|
|
154
|
+
getValueProps,
|
|
155
|
+
validator
|
|
146
156
|
},
|
|
147
157
|
renderComponent
|
|
148
158
|
);
|
|
@@ -166,12 +176,16 @@ var renderValueWithMap = (value, valueMap) => {
|
|
|
166
176
|
}
|
|
167
177
|
return null;
|
|
168
178
|
};
|
|
179
|
+
function toArr(str) {
|
|
180
|
+
return Array.isArray(str) ? str : [str];
|
|
181
|
+
}
|
|
169
182
|
// Annotate the CommonJS export names for ESM import in node:
|
|
170
183
|
0 && (module.exports = {
|
|
171
184
|
formItemNameReplace,
|
|
172
185
|
formItemNameReverse,
|
|
173
186
|
getNestedValue,
|
|
174
187
|
renderValueWithMap,
|
|
188
|
+
toArr,
|
|
175
189
|
withFormItem,
|
|
176
190
|
withMode
|
|
177
191
|
});
|
|
@@ -24,7 +24,7 @@ __export(useDesignMode_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(useDesignMode_exports);
|
|
25
25
|
var import_react = require("react");
|
|
26
26
|
var useDesignMode = (props, { registerVariable, openDrawer, closeDrawer, data }) => {
|
|
27
|
-
const { __designMode, showDetailButton, showEditButton } = props;
|
|
27
|
+
const { __designMode, showDetailButton, showEditButton, showAddButton } = props;
|
|
28
28
|
(0, import_react.useEffect)(() => {
|
|
29
29
|
var _a;
|
|
30
30
|
if (__designMode === "design") {
|
|
@@ -51,5 +51,17 @@ var useDesignMode = (props, { registerVariable, openDrawer, closeDrawer, data })
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}, [showEditButton, __designMode]);
|
|
54
|
+
(0, import_react.useEffect)(() => {
|
|
55
|
+
if (__designMode === "design") {
|
|
56
|
+
if (showAddButton) {
|
|
57
|
+
openDrawer("add");
|
|
58
|
+
registerVariable == null ? void 0 : registerVariable({
|
|
59
|
+
currentRecord: null
|
|
60
|
+
});
|
|
61
|
+
} else {
|
|
62
|
+
closeDrawer();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}, [showAddButton, __designMode]);
|
|
54
66
|
};
|
|
55
67
|
var useDesignMode_default = useDesignMode;
|
|
@@ -47,10 +47,11 @@ var import_useDrawerState = __toESM(require("./hooks/useDrawerState"));
|
|
|
47
47
|
var import_useDesignMode = __toESM(require("./hooks/useDesignMode"));
|
|
48
48
|
var import_useTableQuery = __toESM(require("./hooks/useTableQuery"));
|
|
49
49
|
var import_useSetRequest = __toESM(require("../../../hooks/useSetRequest"));
|
|
50
|
+
var import_locales = require("../../../locales");
|
|
50
51
|
var DRAWER_TITLES = {
|
|
51
|
-
detail: "
|
|
52
|
-
edit: "
|
|
53
|
-
add: "
|
|
52
|
+
detail: (0, import_locales.getText)("pisell-data-source-table-detail"),
|
|
53
|
+
edit: (0, import_locales.getText)("pisell-data-source-table-edit"),
|
|
54
|
+
add: (0, import_locales.getText)("pisell-data-source-table-add")
|
|
54
55
|
};
|
|
55
56
|
var DataSourceTable = (props) => {
|
|
56
57
|
const {
|
|
@@ -126,15 +127,15 @@ var DataSourceTable = (props) => {
|
|
|
126
127
|
onClick: () => handleOpenDrawer(record, "detail"),
|
|
127
128
|
type: "link"
|
|
128
129
|
},
|
|
129
|
-
"
|
|
130
|
+
(0, import_locales.getText)("pisell-data-source-table-detail")
|
|
130
131
|
), showEditButton && /* @__PURE__ */ import_react.default.createElement(
|
|
131
132
|
import_antd.Button,
|
|
132
133
|
{
|
|
133
134
|
onClick: () => handleOpenDrawer(record, "edit"),
|
|
134
135
|
type: "link"
|
|
135
136
|
},
|
|
136
|
-
"
|
|
137
|
-
), showDeleteButton && /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: () => handleDelete(record), type: "link", danger: true }, "
|
|
137
|
+
(0, import_locales.getText)("pisell-data-source-table-edit")
|
|
138
|
+
), showDeleteButton && /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: () => handleDelete(record), type: "link", danger: true }, (0, import_locales.getText)("pisell-data-source-table-delete")));
|
|
138
139
|
}
|
|
139
140
|
}
|
|
140
141
|
];
|
|
@@ -160,7 +161,7 @@ var DataSourceTable = (props) => {
|
|
|
160
161
|
type: "primary",
|
|
161
162
|
onClick: () => handleOpenDrawer(null, "add")
|
|
162
163
|
},
|
|
163
|
-
"
|
|
164
|
+
(0, import_locales.getText)("pisell-data-source-table-add")
|
|
164
165
|
)), /* @__PURE__ */ import_react.default.createElement(
|
|
165
166
|
import_table.default,
|
|
166
167
|
{
|
|
@@ -48,11 +48,6 @@ var PisellQrcode = (props) => {
|
|
|
48
48
|
const modalRef = (0, import_react.useRef)(null);
|
|
49
49
|
(0, import_react.useEffect)(() => {
|
|
50
50
|
if (open) {
|
|
51
|
-
console.log(
|
|
52
|
-
"%c [ modalRef ]-22",
|
|
53
|
-
"font-size:13px; background:pink; color:#bf2c9f;",
|
|
54
|
-
modalRef
|
|
55
|
-
);
|
|
56
51
|
}
|
|
57
52
|
}, [open]);
|
|
58
53
|
const modalProps = {
|
|
@@ -6,5 +6,5 @@ interface PisellStatisticProps {
|
|
|
6
6
|
hint?: React.ReactNode;
|
|
7
7
|
tags?: React.ReactNode;
|
|
8
8
|
}
|
|
9
|
-
declare const
|
|
10
|
-
export default
|
|
9
|
+
declare const PisellStatistic: (props: PisellStatisticProps) => import("react").JSX.Element;
|
|
10
|
+
export default PisellStatistic;
|
|
@@ -36,11 +36,11 @@ var import_react = require("react");
|
|
|
36
36
|
var import_antd = require("antd");
|
|
37
37
|
var import_classnames = __toESM(require("classnames"));
|
|
38
38
|
var import_index = require("./index.less");
|
|
39
|
-
var
|
|
39
|
+
var PisellStatistic = (props) => {
|
|
40
40
|
(0, import_react.useEffect)(() => {
|
|
41
41
|
document.body.id = "body";
|
|
42
42
|
}, []);
|
|
43
|
-
const { title = "
|
|
43
|
+
const { title = "", number, hint, tags } = props;
|
|
44
44
|
return /* @__PURE__ */ React.createElement("div", { className: (0, import_classnames.default)("pisell-statistic-wrap") }, /* @__PURE__ */ React.createElement("div", { className: (0, import_classnames.default)("pisell-statistic-hint") }, hint), /* @__PURE__ */ React.createElement("div", { className: (0, import_classnames.default)("pisell-statistic-tags") }, tags), /* @__PURE__ */ React.createElement(import_antd.Statistic, { title, value: number }));
|
|
45
45
|
};
|
|
46
|
-
var pisellStatistic_default =
|
|
46
|
+
var pisellStatistic_default = PisellStatistic;
|
|
@@ -35,6 +35,7 @@ module.exports = __toCommonJS(productCard_exports);
|
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_classnames = __toESM(require("classnames"));
|
|
37
37
|
var import_antd = require("antd");
|
|
38
|
+
var import_utils = require("@pisell/utils");
|
|
38
39
|
var import_cardPro = __toESM(require("../cardPro"));
|
|
39
40
|
var import_Header = __toESM(require("./components/Header"));
|
|
40
41
|
var import_Time = __toESM(require("./components/Time"));
|
|
@@ -44,7 +45,9 @@ var import_AmountFooter = __toESM(require("./components/AmountFooter"));
|
|
|
44
45
|
var import_Note = __toESM(require("./components/Note"));
|
|
45
46
|
var import_Action = __toESM(require("./components/Action"));
|
|
46
47
|
var import_useOpenNote = __toESM(require("./hooks/useOpenNote"));
|
|
48
|
+
var import_locales = __toESM(require("./locales"));
|
|
47
49
|
var import_index = require("./index.less");
|
|
50
|
+
import_utils.locales.init(import_locales.default, localStorage.getItem("umi_locale") || "en");
|
|
48
51
|
var ProductCard = (props) => {
|
|
49
52
|
var _a, _b;
|
|
50
53
|
const {
|
|
@@ -142,6 +142,7 @@ var getServiceTime = (item, currentDate) => {
|
|
|
142
142
|
return "";
|
|
143
143
|
const locale = (item == null ? void 0 : item.locale) || "en-US";
|
|
144
144
|
const isEn = locale === "en-US" || locale === "en";
|
|
145
|
+
import_dayjs.default.locale(locale);
|
|
145
146
|
const startDate = (0, import_dayjs.default)(
|
|
146
147
|
(currentDate == null ? void 0 : currentDate.format("YYYY-MM-DD")) + " " + getServeStartTime((_b = item == null ? void 0 : item._extend) == null ? void 0 : _b.start_time)
|
|
147
148
|
);
|
|
@@ -63,8 +63,12 @@ var RecordView = (props) => {
|
|
|
63
63
|
children,
|
|
64
64
|
locale,
|
|
65
65
|
emptyButtons = [],
|
|
66
|
+
doubleList = false,
|
|
66
67
|
...others
|
|
67
68
|
} = props;
|
|
69
|
+
(0, import_react.useEffect)(() => {
|
|
70
|
+
document.body.id = "body";
|
|
71
|
+
}, []);
|
|
68
72
|
const responsive = (0, import_hooks.useResponsive)();
|
|
69
73
|
const [detailModalShow, setDetailModalShow] = (0, import_react.useState)(false);
|
|
70
74
|
const detailModalDisplay = (0, import_react.useMemo)(() => {
|
|
@@ -157,7 +161,25 @@ var RecordView = (props) => {
|
|
|
157
161
|
)
|
|
158
162
|
), _footer && /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}scroll-footer-wrap` }, _footer));
|
|
159
163
|
}
|
|
160
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
164
|
+
return doubleList ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: 12, align: "center", style: { marginBottom: 16 } }, /* @__PURE__ */ import_react.default.createElement("p", { className: `${prefix}list-title` }, "可用"), /* @__PURE__ */ import_react.default.createElement(import_antd.Tag, { className: `${prefix}list-tag` }, 1)), /* @__PURE__ */ import_react.default.createElement(
|
|
165
|
+
import_antd.List,
|
|
166
|
+
{
|
|
167
|
+
...others,
|
|
168
|
+
renderItem: _renderItem,
|
|
169
|
+
header,
|
|
170
|
+
footer: _footer
|
|
171
|
+
},
|
|
172
|
+
emptyDom
|
|
173
|
+
), /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: 12, align: "center", style: { marginBottom: 16 } }, /* @__PURE__ */ import_react.default.createElement("p", { className: `${prefix}detail-list-title` }, "不可用"), /* @__PURE__ */ import_react.default.createElement(import_antd.Tag, { className: `${prefix}detail-list-tag` }, 2)), /* @__PURE__ */ import_react.default.createElement(
|
|
174
|
+
import_antd.List,
|
|
175
|
+
{
|
|
176
|
+
...others,
|
|
177
|
+
renderItem: _renderItem,
|
|
178
|
+
header,
|
|
179
|
+
footer: _footer
|
|
180
|
+
},
|
|
181
|
+
emptyDom
|
|
182
|
+
)) : /* @__PURE__ */ import_react.default.createElement(
|
|
161
183
|
import_antd.List,
|
|
162
184
|
{
|
|
163
185
|
...others,
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
@pisell-prefix: pisell-lowcode;
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
3
|
.@{pisell-prefix} {
|
|
6
4
|
&-record-view {
|
|
7
5
|
.pisell-lowcode-pagination {
|
|
@@ -12,6 +10,25 @@
|
|
|
12
10
|
border: none;
|
|
13
11
|
}
|
|
14
12
|
}
|
|
13
|
+
|
|
14
|
+
&-list-title {
|
|
15
|
+
color: #000;
|
|
16
|
+
|
|
17
|
+
/* Text md/Semibold */
|
|
18
|
+
font-family: Inter;
|
|
19
|
+
font-size: 16px;
|
|
20
|
+
font-style: normal;
|
|
21
|
+
font-weight: 600;
|
|
22
|
+
line-height: 24px; /* 150% */
|
|
23
|
+
margin: 0;
|
|
24
|
+
}
|
|
25
|
+
&-list-tag {
|
|
26
|
+
border-radius: 16px;
|
|
27
|
+
border: 1px solid var(--Gray-200, #eaecf0);
|
|
28
|
+
background: var(--Gray-50, #f9fafb);
|
|
29
|
+
mix-blend-mode: multiply;
|
|
30
|
+
}
|
|
31
|
+
|
|
15
32
|
&-empty-button {
|
|
16
33
|
display: flex;
|
|
17
34
|
justify-content: center;
|
|
@@ -60,8 +60,6 @@ var Tabs = class extends import_react.Component {
|
|
|
60
60
|
};
|
|
61
61
|
this.renderIconLabelTabBar = (props, DefaultTabBar) => {
|
|
62
62
|
var _a;
|
|
63
|
-
console.log("%c [ props ]-31", "font-size:13px; background:#4d3662; color:#917aa6;", props);
|
|
64
|
-
debugger;
|
|
65
63
|
const { items, sidebarWidth } = this.props;
|
|
66
64
|
let wrapStyle = {
|
|
67
65
|
gap: props.tabBarGutter
|
package/lib/index.d.ts
CHANGED
|
@@ -126,6 +126,7 @@ export { ColorPicker } from 'antd';
|
|
|
126
126
|
export { default as DataSourceForm } from './components/dataSourceComponents/dataSourceForm';
|
|
127
127
|
export { default as FormGroup } from './components/dataSourceComponents/dataSourceForm/group';
|
|
128
128
|
export { default as SubmitButton } from './components/dataSourceComponents/dataSourceForm/submitButton';
|
|
129
|
+
export { default as JsonWrapper } from './components/dataSourceComponents/dataSourceForm/provider/jsonWrapper/JsonWrapperProvider';
|
|
129
130
|
export { default as FormItemCheckbox } from './components/dataSourceComponents/fields/Checkbox';
|
|
130
131
|
export { default as FormItemColorPicker } from './components/dataSourceComponents/fields/ColorPicker';
|
|
131
132
|
export { default as FormItemDatePicker } from './components/dataSourceComponents/fields/DatePicker';
|
package/lib/index.js
CHANGED
|
@@ -81,6 +81,7 @@ __export(src_exports, {
|
|
|
81
81
|
Input: () => import_input.default,
|
|
82
82
|
InputNumber: () => import_antd15.InputNumber,
|
|
83
83
|
InputNumberRange: () => import_input_number_range.default,
|
|
84
|
+
JsonWrapper: () => import_JsonWrapperProvider.default,
|
|
84
85
|
List: () => import_list.default,
|
|
85
86
|
LowCodePage: () => import_lowCodePage.default,
|
|
86
87
|
Mentions: () => import_antd18.Mentions,
|
|
@@ -297,6 +298,7 @@ var import_antd38 = require("antd");
|
|
|
297
298
|
var import_dataSourceForm = __toESM(require("./components/dataSourceComponents/dataSourceForm"));
|
|
298
299
|
var import_group = __toESM(require("./components/dataSourceComponents/dataSourceForm/group"));
|
|
299
300
|
var import_submitButton = __toESM(require("./components/dataSourceComponents/dataSourceForm/submitButton"));
|
|
301
|
+
var import_JsonWrapperProvider = __toESM(require("./components/dataSourceComponents/dataSourceForm/provider/jsonWrapper/JsonWrapperProvider"));
|
|
300
302
|
var import_Checkbox = __toESM(require("./components/dataSourceComponents/fields/Checkbox"));
|
|
301
303
|
var import_ColorPicker = __toESM(require("./components/dataSourceComponents/fields/ColorPicker"));
|
|
302
304
|
var import_DatePicker = __toESM(require("./components/dataSourceComponents/fields/DatePicker"));
|
|
@@ -360,6 +362,7 @@ var import_dataSourceTable = __toESM(require("./components/dataSourceComponents/
|
|
|
360
362
|
Input,
|
|
361
363
|
InputNumber,
|
|
362
364
|
InputNumberRange,
|
|
365
|
+
JsonWrapper,
|
|
363
366
|
List,
|
|
364
367
|
LowCodePage,
|
|
365
368
|
Mentions,
|
package/lib/locales/en-US.d.ts
CHANGED
|
@@ -126,5 +126,9 @@ declare const _default: {
|
|
|
126
126
|
'pisell-adjust-price-discount-can-be-maximum': string;
|
|
127
127
|
'pisell-discount-card-title': string;
|
|
128
128
|
'pisell-discount-card-unit': string;
|
|
129
|
+
'pisell-data-source-table-add': string;
|
|
130
|
+
'pisell-data-source-table-edit': string;
|
|
131
|
+
'pisell-data-source-table-detail': string;
|
|
132
|
+
'pisell-data-source-table-delete': string;
|
|
129
133
|
};
|
|
130
134
|
export default _default;
|
package/lib/locales/en-US.js
CHANGED
|
@@ -158,5 +158,10 @@ var en_US_default = {
|
|
|
158
158
|
"pisell-adjust-price-total-after-discount": "Total after discount: ",
|
|
159
159
|
"pisell-adjust-price-discount-can-be-maximum": "Discount can be maximum",
|
|
160
160
|
"pisell-discount-card-title": "Discount",
|
|
161
|
-
"pisell-discount-card-unit": "off"
|
|
161
|
+
"pisell-discount-card-unit": "off",
|
|
162
|
+
// 数据源表格
|
|
163
|
+
"pisell-data-source-table-add": "Add",
|
|
164
|
+
"pisell-data-source-table-edit": "Edit",
|
|
165
|
+
"pisell-data-source-table-detail": "Detail",
|
|
166
|
+
"pisell-data-source-table-delete": "Delete"
|
|
162
167
|
};
|
package/lib/locales/zh-CN.d.ts
CHANGED
|
@@ -126,5 +126,9 @@ declare const _default: {
|
|
|
126
126
|
'pisell-adjust-price-discount-can-be-maximum': string;
|
|
127
127
|
'pisell-discount-card-title': string;
|
|
128
128
|
'pisell-discount-card-unit': string;
|
|
129
|
+
'pisell-data-source-table-add': string;
|
|
130
|
+
'pisell-data-source-table-edit': string;
|
|
131
|
+
'pisell-data-source-table-detail': string;
|
|
132
|
+
'pisell-data-source-table-delete': string;
|
|
129
133
|
};
|
|
130
134
|
export default _default;
|
package/lib/locales/zh-CN.js
CHANGED
|
@@ -158,5 +158,9 @@ var zh_CN_default = {
|
|
|
158
158
|
"pisell-adjust-price-total-after-discount": "打折后总价",
|
|
159
159
|
"pisell-adjust-price-discount-can-be-maximum": "折扣最高可达",
|
|
160
160
|
"pisell-discount-card-title": "折扣",
|
|
161
|
-
"pisell-discount-card-unit": "折扣"
|
|
161
|
+
"pisell-discount-card-unit": "折扣",
|
|
162
|
+
"pisell-data-source-table-add": "添加",
|
|
163
|
+
"pisell-data-source-table-edit": "编辑",
|
|
164
|
+
"pisell-data-source-table-detail": "详情",
|
|
165
|
+
"pisell-data-source-table-delete": "删除"
|
|
162
166
|
};
|
package/lib/locales/zh-TW.d.ts
CHANGED
|
@@ -126,5 +126,9 @@ declare const _default: {
|
|
|
126
126
|
'pisell-adjust-price-discount-can-be-maximum': string;
|
|
127
127
|
'pisell-discount-card-title': string;
|
|
128
128
|
'pisell-discount-card-unit': string;
|
|
129
|
+
'pisell-data-source-table-add': string;
|
|
130
|
+
'pisell-data-source-table-edit': string;
|
|
131
|
+
'pisell-data-source-table-detail': string;
|
|
132
|
+
'pisell-data-source-table-delete': string;
|
|
129
133
|
};
|
|
130
134
|
export default _default;
|
package/lib/locales/zh-TW.js
CHANGED
|
@@ -158,5 +158,10 @@ var zh_TW_default = {
|
|
|
158
158
|
"pisell-adjust-price-total-after-discount": "打折后總價",
|
|
159
159
|
"pisell-adjust-price-discount-can-be-maximum": "折扣最高可達",
|
|
160
160
|
"pisell-discount-card-title": "折扣",
|
|
161
|
-
"pisell-discount-card-unit": "折扣"
|
|
161
|
+
"pisell-discount-card-unit": "折扣",
|
|
162
|
+
// 数据源表格
|
|
163
|
+
"pisell-data-source-table-add": "添加",
|
|
164
|
+
"pisell-data-source-table-edit": "編輯",
|
|
165
|
+
"pisell-data-source-table-detail": "詳情",
|
|
166
|
+
"pisell-data-source-table-delete": "刪除"
|
|
162
167
|
};
|
|
@@ -4,8 +4,9 @@ export const nocobaseCpt2PisellCptMap: Record<string, any> = {
|
|
|
4
4
|
Percent: 'FormItemInputNumber',
|
|
5
5
|
DatePicker: 'FormItemDatePicker',
|
|
6
6
|
Input: 'FormItemInput',
|
|
7
|
-
'Input.JSON': '
|
|
7
|
+
'Input.JSON': 'JsonWrapper',
|
|
8
8
|
'Input.URL': 'FormItemInput.URL',
|
|
9
|
+
'Input.TextArea': 'FormItemInput.TextArea',
|
|
9
10
|
Password: 'FormItemInput.Password',
|
|
10
11
|
Select: 'FormItemSelect',
|
|
11
12
|
Radio: 'FormItemRadio',
|
|
@@ -36,4 +37,6 @@ export const systemFields = [
|
|
|
36
37
|
'deletedAt',
|
|
37
38
|
'createdBy',
|
|
38
39
|
'updatedBy',
|
|
40
|
+
'shop_id',
|
|
41
|
+
'tenant_id'
|
|
39
42
|
];
|
|
@@ -93,6 +93,7 @@ export const createFormItemSchema = (
|
|
|
93
93
|
item: {
|
|
94
94
|
name: string;
|
|
95
95
|
uiSchema: UiSchema;
|
|
96
|
+
children?: any[];
|
|
96
97
|
},
|
|
97
98
|
mode: string
|
|
98
99
|
) => {
|
|
@@ -102,6 +103,7 @@ export const createFormItemSchema = (
|
|
|
102
103
|
mode,
|
|
103
104
|
};
|
|
104
105
|
let componentName = item.uiSchema['x-component'];
|
|
106
|
+
let childrenSchema: any[] = [];
|
|
105
107
|
|
|
106
108
|
if (
|
|
107
109
|
item.uiSchema['x-validator'] &&
|
|
@@ -113,21 +115,30 @@ export const createFormItemSchema = (
|
|
|
113
115
|
};
|
|
114
116
|
}
|
|
115
117
|
if (item.uiSchema['x-component'] === 'Input.JSON') {
|
|
116
|
-
props.normalize = {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
};
|
|
121
|
-
props.getValueProps = {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
};
|
|
126
|
-
props.validator = {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
};
|
|
118
|
+
// props.normalize = {
|
|
119
|
+
// type: 'JSExpression',
|
|
120
|
+
// value:
|
|
121
|
+
// '(value) => {\n try {\n return JSON.parse(value);\n } catch(error) {\n console.log(error)\n }\n return value\n}',
|
|
122
|
+
// };
|
|
123
|
+
// props.getValueProps = {
|
|
124
|
+
// type: 'JSExpression',
|
|
125
|
+
// value:
|
|
126
|
+
// '(value) => {\n try {\n return { value: value != "" && typeof value === \'object\' ? JSON.stringify(value) : value};\n } catch(error) {\n console.log(error)\n }\n return {value: value}\n}',
|
|
127
|
+
// };
|
|
128
|
+
// props.validator = {
|
|
129
|
+
// type: 'JSExpression',
|
|
130
|
+
// value:
|
|
131
|
+
// "async (value) => {\n try {\n if (typeof value === 'string' && value.trim() !== '') {\n JSON.parse(value);\n }\n } catch (err) {\n return Promise.reject(new Error(err.message));\n }\n}",
|
|
132
|
+
// };
|
|
133
|
+
|
|
134
|
+
props.prefix = item.name;
|
|
135
|
+
|
|
136
|
+
// 如果有children属性,递归创建子表单项
|
|
137
|
+
if (item.children && item.children.length > 0) {
|
|
138
|
+
childrenSchema = item.children.map((child: any) =>
|
|
139
|
+
createFormItemSchema(child, mode)
|
|
140
|
+
);
|
|
141
|
+
}
|
|
131
142
|
}
|
|
132
143
|
|
|
133
144
|
if (
|
|
@@ -156,6 +167,7 @@ export const createFormItemSchema = (
|
|
|
156
167
|
return {
|
|
157
168
|
componentName: nocobaseCpt2PisellCptMap[componentName],
|
|
158
169
|
props,
|
|
170
|
+
children: childrenSchema,
|
|
159
171
|
};
|
|
160
172
|
};
|
|
161
173
|
|
|
@@ -3,7 +3,7 @@ import { formItemGeneralProps } from "../_utils/defaultSchema";
|
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
snippets,
|
|
6
|
-
componentName: '
|
|
6
|
+
componentName: 'FormItemInput.TextArea',
|
|
7
7
|
title: '长文本',
|
|
8
8
|
category: '表单',
|
|
9
9
|
group: '无代码组件',
|
|
@@ -13,7 +13,7 @@ export default {
|
|
|
13
13
|
npm: {
|
|
14
14
|
package: "@pisell/materials",
|
|
15
15
|
version: "1.0.1",
|
|
16
|
-
exportName: "
|
|
16
|
+
exportName: "FormItemInput",
|
|
17
17
|
main: "src/index.tsx",
|
|
18
18
|
destructuring: true,
|
|
19
19
|
subName: "TextArea",
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
|
|
2
|
+
import { ComponentMetadata } from '@alilc/lowcode-types';
|
|
3
|
+
import snippets from './snippets';
|
|
4
|
+
|
|
5
|
+
const JsonWrapperMeta: ComponentMetadata = {
|
|
6
|
+
componentName: 'JsonWrapper',
|
|
7
|
+
title: 'JSON包装器',
|
|
8
|
+
category: '表单',
|
|
9
|
+
group: '无代码组件',
|
|
10
|
+
docUrl: '',
|
|
11
|
+
screenshot: '',
|
|
12
|
+
devMode: 'proCode',
|
|
13
|
+
npm: {
|
|
14
|
+
package: '@pisell/materials',
|
|
15
|
+
version: '1.0.1',
|
|
16
|
+
exportName: 'JsonWrapper',
|
|
17
|
+
main: 'src/index.tsx',
|
|
18
|
+
destructuring: true,
|
|
19
|
+
subName: '',
|
|
20
|
+
},
|
|
21
|
+
configure: {
|
|
22
|
+
props: [
|
|
23
|
+
{
|
|
24
|
+
name: 'prefix',
|
|
25
|
+
title: {
|
|
26
|
+
label: {
|
|
27
|
+
type: 'i18n',
|
|
28
|
+
'en-US': 'Prefix Path',
|
|
29
|
+
'zh-CN': '前缀路径',
|
|
30
|
+
},
|
|
31
|
+
tip: '用于指定JSON数据的路径前缀',
|
|
32
|
+
},
|
|
33
|
+
propType: {
|
|
34
|
+
type: 'oneOfType',
|
|
35
|
+
value: ['string', 'number', { type: 'arrayOf', value: ['string', 'number'] }]
|
|
36
|
+
},
|
|
37
|
+
setter: ['StringSetter', 'NumberSetter', 'ArraySetter', 'VariableSetter'],
|
|
38
|
+
defaultValue: '',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'label',
|
|
42
|
+
title: {
|
|
43
|
+
label: {
|
|
44
|
+
type: 'i18n',
|
|
45
|
+
'en-US': 'Label',
|
|
46
|
+
'zh-CN': '标签',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
propType: 'string',
|
|
50
|
+
setter: ['StringSetter', 'PisellI18nSetter'],
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
supports: {
|
|
54
|
+
style: true,
|
|
55
|
+
className: true,
|
|
56
|
+
isContainer: true,
|
|
57
|
+
},
|
|
58
|
+
component: {
|
|
59
|
+
isContainer: true,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
snippets,
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export default JsonWrapperMeta;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.455",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
"react-virtualized-auto-sizer": "^1.0.20",
|
|
66
66
|
"react-window": "^1.8.10",
|
|
67
67
|
"styled-components": "^6.0.0-rc.3",
|
|
68
|
-
"@pisell/
|
|
68
|
+
"@pisell/date-picker": "1.0.112",
|
|
69
69
|
"@pisell/icon": "0.0.10",
|
|
70
|
-
"@pisell/
|
|
70
|
+
"@pisell/utils": "1.0.43"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"react": "^18.0.0",
|