szld-libs 0.2.71 → 0.2.72

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.
@@ -126,6 +126,12 @@ function useDynamicForm(props) {
126
126
  value: (value == null ? void 0 : value.map((v) => dayjs(v))) || null
127
127
  });
128
128
  break;
129
+ case "multiple-date-picker":
130
+ baseProps.getValueFromEvent = (date) => date == null ? void 0 : date.map((d) => d == null ? void 0 : d.format(format || "YYYY-MM-DD"));
131
+ baseProps.getValueProps = (value) => ({
132
+ value: (value == null ? void 0 : value.map((v) => dayjs(v))) || null
133
+ });
134
+ break;
129
135
  }
130
136
  return baseProps;
131
137
  },
@@ -155,6 +161,14 @@ function useDynamicForm(props) {
155
161
  initialValue = void 0;
156
162
  }
157
163
  }
164
+ if (inputType === "multiple-date-picker" && initialValue) {
165
+ try {
166
+ initialValue = initialValue == null ? void 0 : initialValue.split(",");
167
+ initialValue = initialValue.map((v) => dayjs(v));
168
+ } catch (error) {
169
+ initialValue = void 0;
170
+ }
171
+ }
158
172
  if (inputType === "cascader" && initialValue && typeof initialValue === "string") {
159
173
  const delimiter = (_e = itemWithJson.json) == null ? void 0 : _e["cascader-delimiter"];
160
174
  if (delimiter) {
@@ -633,6 +647,15 @@ function useDynamicForm(props) {
633
647
  style: { width: defaultWidth, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
634
648
  }
635
649
  );
650
+ case "multiple-date-picker":
651
+ return /* @__PURE__ */ jsx(
652
+ DatePicker,
653
+ {
654
+ multiple: true,
655
+ disabled: readonly,
656
+ style: { width: defaultWidth, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
657
+ }
658
+ );
636
659
  case "radio":
637
660
  return /* @__PURE__ */ jsx(
638
661
  MyRadio,
@@ -106,6 +106,13 @@ const handleSubmitForm = (originalData, allValues) => {
106
106
  attrItem.attrvalue = "";
107
107
  }
108
108
  break;
109
+ case "multiple-date-picker":
110
+ if (Array.isArray(formValue) && formValue.length > 0) {
111
+ attrItem.attrvalue = formValue.join(",");
112
+ } else {
113
+ attrItem.attrvalue = formValue;
114
+ }
115
+ break;
109
116
  case "checkbox":
110
117
  case "mult-select":
111
118
  if (Array.isArray(formValue) && formValue.length > 0) {
@@ -127,6 +127,12 @@ function useDynamicForm(props) {
127
127
  value: (value == null ? void 0 : value.map((v) => dayjs(v))) || null
128
128
  });
129
129
  break;
130
+ case "multiple-date-picker":
131
+ baseProps.getValueFromEvent = (date) => date == null ? void 0 : date.map((d) => d == null ? void 0 : d.format(format || "YYYY-MM-DD"));
132
+ baseProps.getValueProps = (value) => ({
133
+ value: (value == null ? void 0 : value.map((v) => dayjs(v))) || null
134
+ });
135
+ break;
130
136
  }
131
137
  return baseProps;
132
138
  },
@@ -156,6 +162,14 @@ function useDynamicForm(props) {
156
162
  initialValue = void 0;
157
163
  }
158
164
  }
165
+ if (inputType === "multiple-date-picker" && initialValue) {
166
+ try {
167
+ initialValue = initialValue == null ? void 0 : initialValue.split(",");
168
+ initialValue = initialValue.map((v) => dayjs(v));
169
+ } catch (error) {
170
+ initialValue = void 0;
171
+ }
172
+ }
159
173
  if (inputType === "cascader" && initialValue && typeof initialValue === "string") {
160
174
  const delimiter = (_e = itemWithJson.json) == null ? void 0 : _e["cascader-delimiter"];
161
175
  if (delimiter) {
@@ -634,6 +648,15 @@ function useDynamicForm(props) {
634
648
  style: { width: defaultWidth, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
635
649
  }
636
650
  );
651
+ case "multiple-date-picker":
652
+ return /* @__PURE__ */ jsxRuntime.jsx(
653
+ antd.DatePicker,
654
+ {
655
+ multiple: true,
656
+ disabled: readonly,
657
+ style: { width: defaultWidth, ...itemStyle == null ? void 0 : itemStyle.style, ...customWidth }
658
+ }
659
+ );
637
660
  case "radio":
638
661
  return /* @__PURE__ */ jsxRuntime.jsx(
639
662
  MyRadio,
@@ -108,6 +108,13 @@ const handleSubmitForm = (originalData, allValues) => {
108
108
  attrItem.attrvalue = "";
109
109
  }
110
110
  break;
111
+ case "multiple-date-picker":
112
+ if (Array.isArray(formValue) && formValue.length > 0) {
113
+ attrItem.attrvalue = formValue.join(",");
114
+ } else {
115
+ attrItem.attrvalue = formValue;
116
+ }
117
+ break;
111
118
  case "checkbox":
112
119
  case "mult-select":
113
120
  if (Array.isArray(formValue) && formValue.length > 0) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "szld-libs",
3
3
  "private": false,
4
- "version": "0.2.71",
4
+ "version": "0.2.72",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",