szld-libs 0.4.36 → 0.4.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/szld-components.es.js +865 -861
- package/dist/szld-components.umd.js +19 -19
- package/es/components/DynamicForm/mySelect/index.js +1 -0
- package/es/components/DynamicForm/useDynamicForm.js +10 -8
- package/es/components/DynamicFormMobile/useDynamicForm.js +5 -5
- package/es/mock/index.js +550 -40
- package/es/utils/method.d.ts +1 -0
- package/lib/components/DynamicForm/mySelect/index.js +1 -0
- package/lib/components/DynamicForm/useDynamicForm.js +10 -8
- package/lib/components/DynamicFormMobile/useDynamicForm.js +5 -5
- package/lib/mock/index.js +550 -40
- package/lib/utils/method.d.ts +1 -0
- package/package.json +1 -1
|
@@ -193,7 +193,9 @@ function useDynamicForm(props) {
|
|
|
193
193
|
parentFormListField,
|
|
194
194
|
isShowLabel = true
|
|
195
195
|
}) => {
|
|
196
|
+
var _a;
|
|
196
197
|
const formListInitValue = func.handleSetFormItemInitialValue(itemWithJson);
|
|
198
|
+
const hidden = (_a = itemWithJson.json) == null ? void 0 : _a.hidden;
|
|
197
199
|
let children = itemWithJson.children || [];
|
|
198
200
|
if (Array.isArray(children == null ? void 0 : children[0]) && children.length) {
|
|
199
201
|
children = children[0];
|
|
@@ -205,7 +207,7 @@ function useDynamicForm(props) {
|
|
|
205
207
|
}
|
|
206
208
|
return [itemWithJson.attrid, field.name];
|
|
207
209
|
};
|
|
208
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.Col, { span: 24 / colNum, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
210
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Col, { span: hidden ? 0 : 24 / colNum, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
209
211
|
antd.Collapse,
|
|
210
212
|
{
|
|
211
213
|
bordered: false,
|
|
@@ -300,10 +302,11 @@ function useDynamicForm(props) {
|
|
|
300
302
|
isShowLabel = true
|
|
301
303
|
}) => {
|
|
302
304
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
303
|
-
|
|
305
|
+
const hidden = (_a = itemWithJson.json) == null ? void 0 : _a.hidden;
|
|
306
|
+
if (((_b = itemWithJson.json) == null ? void 0 : _b.hide) === true) {
|
|
304
307
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
305
308
|
}
|
|
306
|
-
if (itemWithJson.attrtype === 1) {
|
|
309
|
+
if (itemWithJson.attrtype === 1 && !hidden) {
|
|
307
310
|
return renderNestedFormList({
|
|
308
311
|
itemWithJson,
|
|
309
312
|
colNum,
|
|
@@ -323,12 +326,11 @@ function useDynamicForm(props) {
|
|
|
323
326
|
}
|
|
324
327
|
if (itemWithJson.attrtype === 0) {
|
|
325
328
|
const initialValue = func.handleSetFormItemInitialValue(itemWithJson);
|
|
326
|
-
const message2 = (
|
|
327
|
-
const hidden = (_c = itemWithJson.json) == null ? void 0 : _c.hidden;
|
|
329
|
+
const message2 = (_c = itemWithJson.json) == null ? void 0 : _c["default-prompt"];
|
|
328
330
|
const placeholder = func.handleGetPlaceholder(itemWithJson, langId);
|
|
329
331
|
const { combinations = [] } = itemWithJson.json || {};
|
|
330
332
|
if (combinations == null ? void 0 : combinations.length) {
|
|
331
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.Col, { span: 24 / colNum, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
333
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Col, { span: hidden ? 0 : 24 / colNum, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
332
334
|
antd.Form.Item,
|
|
333
335
|
{
|
|
334
336
|
label: (_d = itemWithJson == null ? void 0 : itemWithJson.json) == null ? void 0 : _d["combination-name"],
|
|
@@ -391,7 +393,7 @@ function useDynamicForm(props) {
|
|
|
391
393
|
) });
|
|
392
394
|
}
|
|
393
395
|
const formItemName = isFormListItem && formListField ? Array.isArray(formListField.name) ? [...formListField.name, itemWithJson.attrid] : [formListField.name, itemWithJson.attrid] : itemWithJson.attrid;
|
|
394
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.Col, { span: 24 / colNum, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
396
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Col, { span: hidden ? 0 : 24 / colNum, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
395
397
|
antd.Form.Item,
|
|
396
398
|
{
|
|
397
399
|
name: formItemName,
|
|
@@ -653,7 +655,7 @@ function useDynamicForm(props) {
|
|
|
653
655
|
antd.DatePicker,
|
|
654
656
|
{
|
|
655
657
|
multiple: true,
|
|
656
|
-
maxTagCount: ((_p = item == null ? void 0 : item.json) == null ? void 0 : _p["max-tag-count"]) ||
|
|
658
|
+
maxTagCount: ((_p = item == null ? void 0 : item.json) == null ? void 0 : _p["max-tag-count"]) || 1,
|
|
657
659
|
disabled: readonly || ((_q = item.json) == null ? void 0 : _q.readonly) || false,
|
|
658
660
|
style: { width, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
|
|
659
661
|
}
|
|
@@ -255,11 +255,12 @@ function useDynamicForm(props) {
|
|
|
255
255
|
isShowLabel = true
|
|
256
256
|
}) => {
|
|
257
257
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
258
|
-
|
|
258
|
+
const hidden = (_a = itemWithJson.json) == null ? void 0 : _a.hidden;
|
|
259
|
+
if (((_b = itemWithJson.json) == null ? void 0 : _b.hide) === true || (hideAttrList == null ? void 0 : hideAttrList.includes(itemWithJson.attrid))) {
|
|
259
260
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
260
261
|
}
|
|
261
|
-
readonly = ((
|
|
262
|
-
if (itemWithJson.attrtype === 1) {
|
|
262
|
+
readonly = ((_c = itemWithJson.json) == null ? void 0 : _c.readonly) || readonly || false;
|
|
263
|
+
if (itemWithJson.attrtype === 1 && !hidden) {
|
|
263
264
|
return renderNestedFormList({
|
|
264
265
|
itemWithJson,
|
|
265
266
|
colNum,
|
|
@@ -279,10 +280,9 @@ function useDynamicForm(props) {
|
|
|
279
280
|
}
|
|
280
281
|
if (itemWithJson.attrtype === 0) {
|
|
281
282
|
const initialValue = func.handleSetFormItemInitialValue(itemWithJson);
|
|
282
|
-
const message2 = (
|
|
283
|
+
const message2 = (_d = itemWithJson.json) == null ? void 0 : _d["default-prompt"];
|
|
283
284
|
const placeholder = func.handleGetPlaceholder(itemWithJson, langId);
|
|
284
285
|
const { combinations = [] } = itemWithJson.json || {};
|
|
285
|
-
const hidden = (_d = itemWithJson.json) == null ? void 0 : _d.hidden;
|
|
286
286
|
if (combinations == null ? void 0 : combinations.length) {
|
|
287
287
|
return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { children: combinations.map((item, index) => {
|
|
288
288
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|