react-antd-xform 1.0.4 → 1.0.5
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/_virtual/_commonjsHelpers.js +2 -0
- package/dist/_virtual/dayjs.min.js +4 -0
- package/dist/_virtual/isoWeek.js +4 -0
- package/dist/_virtual/weekOfYear.js +4 -0
- package/dist/_virtual/weekYear.js +4 -0
- package/dist/form/form-item.js +3 -3
- package/dist/form-ui/common-utils.d.ts +21 -0
- package/dist/form-ui/common-utils.js +243 -1
- package/dist/form-ui/default-component.js +44 -2
- package/dist/node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/dayjs.min.js +282 -0
- package/dist/node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/plugin/isoWeek.js +33 -0
- package/dist/node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/plugin/weekOfYear.js +29 -0
- package/dist/node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/plugin/weekYear.js +19 -0
- package/dist/node_modules/.pnpm/mobx-react-lite@4.1.0_mobx@6.13.7_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/mobx-react-lite/es/useObserver.js +3 -3
- package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.js +3 -3
- package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js +2 -2
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +4 -4
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +4 -4
- package/package.json +9 -7
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
1
2
|
function getDefaultExportFromCjs(x) {
|
|
2
3
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
3
4
|
}
|
|
4
5
|
export {
|
|
6
|
+
commonjsGlobal,
|
|
5
7
|
getDefaultExportFromCjs
|
|
6
8
|
};
|
package/dist/form/form-item.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from "../node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js";
|
|
2
|
-
import
|
|
2
|
+
import React, { useLayoutEffect, useEffect } from "react";
|
|
3
3
|
import cx from "../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js";
|
|
4
4
|
import "../node_modules/.pnpm/mobx-react-lite@4.1.0_mobx@6.13.7_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/mobx-react-lite/es/index.js";
|
|
5
5
|
import stringifyObject from "../node_modules/.pnpm/stringify-object@5.0.0/node_modules/stringify-object/index.js";
|
|
@@ -12,7 +12,7 @@ import { useFormEnv } from "./context/formEnvContext.js";
|
|
|
12
12
|
import { ALL_COMPONENTS } from "../form-ui/default-component.js";
|
|
13
13
|
import { observer } from "../node_modules/.pnpm/mobx-react-lite@4.1.0_mobx@6.13.7_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/mobx-react-lite/es/observer.js";
|
|
14
14
|
function processCreationOptions(options) {
|
|
15
|
-
const render = options.render ?? ((props) =>
|
|
15
|
+
const render = options.render ?? ((props) => React.createElement(options.component, props));
|
|
16
16
|
return {
|
|
17
17
|
name: options.name,
|
|
18
18
|
hidden: options.hidden,
|
|
@@ -266,7 +266,7 @@ function FormItem({ use, component, ...props }) {
|
|
|
266
266
|
if (Comp == null) {
|
|
267
267
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(NotFound, { ...props, componentProps: { $Component: component } });
|
|
268
268
|
}
|
|
269
|
-
return
|
|
269
|
+
return React.createElement(Comp, props);
|
|
270
270
|
} else {
|
|
271
271
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
272
272
|
AnonymousFormItem,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
export declare function isEmptyValue(value: any): boolean;
|
|
2
3
|
/**
|
|
3
4
|
* antd中某些组件的onChange并不是直接返回value,而是e.target.value
|
|
@@ -7,3 +8,23 @@ export declare const withValueChangeHandler: <T extends {
|
|
|
7
8
|
}>(Component: React.ComponentType<T>) => (props: Omit<T, "onChange"> & {
|
|
8
9
|
onChange?: (value: any) => void;
|
|
9
10
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* date日期选择器兼容
|
|
13
|
+
*/
|
|
14
|
+
export declare const withDayjsTransformAntdDate: (Component: React.ComponentType<any>) => (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
/**
|
|
16
|
+
* dateRangePicker兼容
|
|
17
|
+
*/
|
|
18
|
+
export declare const withDayjsTransformAntdDateRangePicker: (Component: React.ComponentType<any>) => (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
/**
|
|
20
|
+
* timer选择器兼容
|
|
21
|
+
*/
|
|
22
|
+
export declare const withDayjsTransformAntdTime: (Component: React.ComponentType<any>) => (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
/**
|
|
24
|
+
* timerPicker选择器兼容
|
|
25
|
+
*/
|
|
26
|
+
export declare const withDayjsTransformAntdTimeRange: (Component: React.ComponentType<any>) => (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
/**
|
|
28
|
+
* 向组件中注入props
|
|
29
|
+
*/
|
|
30
|
+
export declare const withInjectedProps: (injectedProps: Record<string, any>) => (Component: React.ComponentType<any>) => React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<any>>;
|
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from "../node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js";
|
|
2
|
+
import React, { useMemo, useCallback } from "react";
|
|
3
|
+
import dayjs from "../node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/dayjs.min.js";
|
|
4
|
+
import weekOfYear from "../node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/plugin/weekOfYear.js";
|
|
5
|
+
import weekYear from "../node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/plugin/weekYear.js";
|
|
6
|
+
import isoweek from "../node_modules/.pnpm/dayjs@1.11.18/node_modules/dayjs/plugin/isoWeek.js";
|
|
7
|
+
dayjs.extend(weekOfYear);
|
|
8
|
+
dayjs.extend(weekYear);
|
|
9
|
+
dayjs.extend(isoweek);
|
|
2
10
|
function isEmptyValue(value) {
|
|
3
|
-
return value
|
|
11
|
+
return !value && value !== 0 || Array.isArray(value) && value.length === 0;
|
|
4
12
|
}
|
|
13
|
+
const DEFAULT_FORMAT_TIME = "HH:mm:ss";
|
|
14
|
+
const DEFAULT_FORMATS = {
|
|
15
|
+
date: "YYYY-MM-DD",
|
|
16
|
+
week: "gggg-[W]W",
|
|
17
|
+
// 输出: 2025-W37
|
|
18
|
+
month: "YYYY-MM",
|
|
19
|
+
quarter: "YYYY-[Q]Q",
|
|
20
|
+
// 输出: 2025-Q3
|
|
21
|
+
year: "YYYY"
|
|
22
|
+
};
|
|
23
|
+
const isEmptyDateValue = (val) => val == null || val === "" || Array.isArray(val) && val.length === 2 && !val[0] && !val[1];
|
|
5
24
|
const withValueChangeHandler = (Component) => {
|
|
6
25
|
return (props) => {
|
|
7
26
|
const handleChange = (e) => {
|
|
@@ -11,7 +30,230 @@ const withValueChangeHandler = (Component) => {
|
|
|
11
30
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Component, { ...props, onChange: handleChange });
|
|
12
31
|
};
|
|
13
32
|
};
|
|
33
|
+
const withDayjsTransformAntdDate = (Component) => {
|
|
34
|
+
return (props) => {
|
|
35
|
+
const { value, onChange, picker, ...restProps } = props;
|
|
36
|
+
const parsedValue = useMemo(() => {
|
|
37
|
+
if (!value) return void 0;
|
|
38
|
+
if (picker === "week") {
|
|
39
|
+
const [year, weekStr] = value.split("-");
|
|
40
|
+
const weekNumber = parseInt(weekStr, 10);
|
|
41
|
+
if (year && !isNaN(weekNumber)) {
|
|
42
|
+
return dayjs().year(parseInt(year, 10)).week(weekNumber).startOf("week");
|
|
43
|
+
}
|
|
44
|
+
} else if (picker === "month") {
|
|
45
|
+
return dayjs(value, "YYYY-MM");
|
|
46
|
+
} else if (picker === "quarter") {
|
|
47
|
+
return dayjs(value, "YYYY-[Q]Q");
|
|
48
|
+
} else if (picker === "year") {
|
|
49
|
+
return dayjs(value, "YYYY");
|
|
50
|
+
} else {
|
|
51
|
+
return dayjs(value);
|
|
52
|
+
}
|
|
53
|
+
return void 0;
|
|
54
|
+
}, [value, picker]);
|
|
55
|
+
const handleChange = useCallback(
|
|
56
|
+
(dayjsDate, dateString) => {
|
|
57
|
+
if (!dayjsDate || !dayjsDate.isValid()) {
|
|
58
|
+
onChange == null ? void 0 : onChange(null);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
let formattedValue;
|
|
62
|
+
if (picker === "week") {
|
|
63
|
+
const year = dayjsDate.year();
|
|
64
|
+
const week = dayjsDate.week();
|
|
65
|
+
formattedValue = `${year}-${week}`;
|
|
66
|
+
} else if (picker === "month") {
|
|
67
|
+
formattedValue = dayjsDate.format("YYYY-MM");
|
|
68
|
+
} else if (picker === "quarter") {
|
|
69
|
+
formattedValue = dayjsDate.format("YYYY-Q");
|
|
70
|
+
} else if (picker === "year") {
|
|
71
|
+
formattedValue = dayjsDate.format("YYYY");
|
|
72
|
+
} else {
|
|
73
|
+
formattedValue = dayjsDate.format("YYYY-MM-DD");
|
|
74
|
+
}
|
|
75
|
+
onChange == null ? void 0 : onChange(formattedValue);
|
|
76
|
+
},
|
|
77
|
+
[onChange, picker]
|
|
78
|
+
);
|
|
79
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Component, { ...restProps, picker, value: parsedValue, onChange: handleChange });
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
const withDayjsTransformAntdDateRangePicker = (Component) => {
|
|
83
|
+
return (props) => {
|
|
84
|
+
const { value, onChange, format, picker = "date", ...restProps } = props;
|
|
85
|
+
const resolvedFormat = format || DEFAULT_FORMATS[picker] || DEFAULT_FORMATS.date;
|
|
86
|
+
const parsedValue = useMemo(() => {
|
|
87
|
+
if (isEmptyDateValue(value)) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
if (!Array.isArray(value)) {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
const [startStr, endStr] = value;
|
|
94
|
+
if (isEmptyDateValue([startStr, endStr])) {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
const parseValue = (str, type) => {
|
|
98
|
+
if (!str) return null;
|
|
99
|
+
switch (type) {
|
|
100
|
+
case "week": {
|
|
101
|
+
const match = str.match(/^(\d{4})-?W?(\d+)$/i);
|
|
102
|
+
if (!match) return null;
|
|
103
|
+
const year = parseInt(match[1], 10);
|
|
104
|
+
const week = parseInt(match[2], 10);
|
|
105
|
+
return dayjs().year(year).week(week).startOf("week");
|
|
106
|
+
}
|
|
107
|
+
case "month":
|
|
108
|
+
return dayjs(str, "YYYY-MM", true);
|
|
109
|
+
case "quarter": {
|
|
110
|
+
const match = str.match(/^(\d{4})-?Q?([1-4])$/i);
|
|
111
|
+
if (!match) return null;
|
|
112
|
+
const year = parseInt(match[1], 10);
|
|
113
|
+
const quarter = parseInt(match[2], 10);
|
|
114
|
+
const month = (quarter - 1) * 3;
|
|
115
|
+
return dayjs(`${year}-${String(month + 1).padStart(2, "0")}-01`, "YYYY-MM-DD", true);
|
|
116
|
+
}
|
|
117
|
+
case "year":
|
|
118
|
+
return dayjs(str, "YYYY", true);
|
|
119
|
+
case "date":
|
|
120
|
+
default:
|
|
121
|
+
return dayjs(str, resolvedFormat, true);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
const start = parseValue(startStr, picker);
|
|
125
|
+
const end = parseValue(endStr, picker);
|
|
126
|
+
const isValidStart = start && start.isValid();
|
|
127
|
+
const isValidEnd = end && end.isValid();
|
|
128
|
+
if (!isValidStart && !isValidEnd) {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
return [isValidStart ? start : null, isValidEnd ? end : null];
|
|
132
|
+
}, [value, picker, resolvedFormat]);
|
|
133
|
+
const handleChange = useCallback(
|
|
134
|
+
(dates, dateStrings) => {
|
|
135
|
+
if (!dates || !dates[0] && !dates[1]) {
|
|
136
|
+
onChange == null ? void 0 : onChange(null);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const [start, end] = dates;
|
|
140
|
+
const formatValue = (dayjsObj, type) => {
|
|
141
|
+
if (!dayjsObj || !dayjsObj.isValid()) return "";
|
|
142
|
+
switch (type) {
|
|
143
|
+
case "week":
|
|
144
|
+
return `${dayjsObj.year()}-W${dayjsObj.week()}`;
|
|
145
|
+
case "month":
|
|
146
|
+
return dayjsObj.format("YYYY-MM");
|
|
147
|
+
case "quarter": {
|
|
148
|
+
const year = dayjsObj.year();
|
|
149
|
+
const quarter = Math.floor(dayjsObj.month() / 3) + 1;
|
|
150
|
+
return `${year}-Q${quarter}`;
|
|
151
|
+
}
|
|
152
|
+
case "year":
|
|
153
|
+
return dayjsObj.format("YYYY");
|
|
154
|
+
case "date":
|
|
155
|
+
default:
|
|
156
|
+
return dayjsObj.format(resolvedFormat);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
const formatted = [formatValue(start, picker), formatValue(end, picker)];
|
|
160
|
+
if (!formatted[0] && !formatted[1]) {
|
|
161
|
+
onChange == null ? void 0 : onChange(null);
|
|
162
|
+
} else {
|
|
163
|
+
onChange == null ? void 0 : onChange(formatted);
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
[onChange, picker, resolvedFormat]
|
|
167
|
+
);
|
|
168
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
169
|
+
Component,
|
|
170
|
+
{
|
|
171
|
+
...restProps,
|
|
172
|
+
picker,
|
|
173
|
+
format: resolvedFormat,
|
|
174
|
+
value: parsedValue,
|
|
175
|
+
onChange: handleChange,
|
|
176
|
+
allowClear: restProps.allowClear ?? true
|
|
177
|
+
}
|
|
178
|
+
);
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
const withDayjsTransformAntdTime = (Component) => {
|
|
182
|
+
return (props) => {
|
|
183
|
+
const { value, onChange, format = DEFAULT_FORMAT_TIME, ...restProps } = props;
|
|
184
|
+
const parsedValue = useMemo(() => {
|
|
185
|
+
if (!value) return void 0;
|
|
186
|
+
const stringValue = String(value).trim();
|
|
187
|
+
if (!stringValue) return void 0;
|
|
188
|
+
const parsed = dayjs(stringValue, format, true);
|
|
189
|
+
return parsed.isValid() ? parsed : void 0;
|
|
190
|
+
}, [value, format]);
|
|
191
|
+
const handleChange = useCallback(
|
|
192
|
+
(time, timeString) => {
|
|
193
|
+
if (!time || !time.isValid()) {
|
|
194
|
+
onChange == null ? void 0 : onChange(null);
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
const formatted = time.format(format);
|
|
198
|
+
onChange == null ? void 0 : onChange(formatted);
|
|
199
|
+
},
|
|
200
|
+
[onChange, format]
|
|
201
|
+
);
|
|
202
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Component, { ...restProps, format, value: parsedValue, onChange: handleChange });
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
const withDayjsTransformAntdTimeRange = (Component) => {
|
|
206
|
+
return (props) => {
|
|
207
|
+
const { value, onChange, format = DEFAULT_FORMAT_TIME, ...restProps } = props;
|
|
208
|
+
const parsedValue = useMemo(() => {
|
|
209
|
+
if (!value || !Array.isArray(value)) return void 0;
|
|
210
|
+
const [startStr, endStr] = value;
|
|
211
|
+
if (!startStr && !endStr) return void 0;
|
|
212
|
+
const start = startStr ? dayjs(startStr, format, true) : null;
|
|
213
|
+
const end = endStr ? dayjs(endStr, format, true) : null;
|
|
214
|
+
const isValidStart = start && start.isValid();
|
|
215
|
+
const isValidEnd = end && end.isValid();
|
|
216
|
+
if (!isValidStart && !isValidEnd) return void 0;
|
|
217
|
+
return [isValidStart ? start : null, isValidEnd ? end : null];
|
|
218
|
+
}, [value, format]);
|
|
219
|
+
const handleChange = useCallback(
|
|
220
|
+
(times, timeStrings) => {
|
|
221
|
+
if (!times) {
|
|
222
|
+
onChange == null ? void 0 : onChange(null);
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
const [start, end] = times;
|
|
226
|
+
const formatted = [
|
|
227
|
+
(start == null ? void 0 : start.isValid()) ? start.format(format) : "",
|
|
228
|
+
(end == null ? void 0 : end.isValid()) ? end.format(format) : ""
|
|
229
|
+
];
|
|
230
|
+
if (!formatted[0] && !formatted[1]) {
|
|
231
|
+
onChange == null ? void 0 : onChange(null);
|
|
232
|
+
} else {
|
|
233
|
+
onChange == null ? void 0 : onChange(formatted);
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
[onChange, format]
|
|
237
|
+
);
|
|
238
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Component, { ...restProps, format, value: parsedValue, onChange: handleChange });
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
const withInjectedProps = (injectedProps) => {
|
|
242
|
+
return (Component) => {
|
|
243
|
+
const WrappedComponent = React.forwardRef((props, ref) => {
|
|
244
|
+
const mergedProps = { ...injectedProps, ...props };
|
|
245
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Component, { ref, ...mergedProps });
|
|
246
|
+
});
|
|
247
|
+
WrappedComponent.displayName = `WithInjectedProps(${Component.displayName || Component.name})`;
|
|
248
|
+
return WrappedComponent;
|
|
249
|
+
};
|
|
250
|
+
};
|
|
14
251
|
export {
|
|
15
252
|
isEmptyValue,
|
|
253
|
+
withDayjsTransformAntdDate,
|
|
254
|
+
withDayjsTransformAntdDateRangePicker,
|
|
255
|
+
withDayjsTransformAntdTime,
|
|
256
|
+
withDayjsTransformAntdTimeRange,
|
|
257
|
+
withInjectedProps,
|
|
16
258
|
withValueChangeHandler
|
|
17
259
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Select, Checkbox, InputNumber, Slider, Switch, Input, Radio } from "antd";
|
|
2
|
-
import { isEmptyValue, withValueChangeHandler } from "./common-utils.js";
|
|
1
|
+
import { Select, Checkbox, InputNumber, Slider, Switch, Input, Radio, DatePicker, TimePicker } from "antd";
|
|
2
|
+
import { isEmptyValue, withValueChangeHandler, withInjectedProps, withDayjsTransformAntdDate, withDayjsTransformAntdDateRangePicker, withDayjsTransformAntdTime, withDayjsTransformAntdTimeRange } from "./common-utils.js";
|
|
3
3
|
const ALL_COMPONENTS = [
|
|
4
4
|
{
|
|
5
5
|
name: "input",
|
|
@@ -22,6 +22,20 @@ const ALL_COMPONENTS = [
|
|
|
22
22
|
isEmpty: isEmptyValue,
|
|
23
23
|
hasIntrinsicWidth: false
|
|
24
24
|
},
|
|
25
|
+
{
|
|
26
|
+
name: "singleSelect",
|
|
27
|
+
component: Select,
|
|
28
|
+
defaultValue: "",
|
|
29
|
+
isEmpty: isEmptyValue,
|
|
30
|
+
hasIntrinsicWidth: false
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "multiSelect",
|
|
34
|
+
component: withInjectedProps({ mode: "multiple" })(Select),
|
|
35
|
+
defaultValue: [],
|
|
36
|
+
isEmpty: isEmptyValue,
|
|
37
|
+
hasIntrinsicWidth: false
|
|
38
|
+
},
|
|
25
39
|
{
|
|
26
40
|
name: "radio",
|
|
27
41
|
component: withValueChangeHandler(Radio.Group),
|
|
@@ -56,6 +70,34 @@ const ALL_COMPONENTS = [
|
|
|
56
70
|
defaultValue: false,
|
|
57
71
|
isEmpty: isEmptyValue,
|
|
58
72
|
hasIntrinsicWidth: false
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "datePicker",
|
|
76
|
+
component: withDayjsTransformAntdDate(DatePicker),
|
|
77
|
+
defaultValue: false,
|
|
78
|
+
isEmpty: isEmptyValue,
|
|
79
|
+
hasIntrinsicWidth: false
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: "dateRangePicker",
|
|
83
|
+
component: withDayjsTransformAntdDateRangePicker(DatePicker.RangePicker),
|
|
84
|
+
defaultValue: false,
|
|
85
|
+
isEmpty: isEmptyValue,
|
|
86
|
+
hasIntrinsicWidth: false
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: "timePicker",
|
|
90
|
+
component: withDayjsTransformAntdTime(TimePicker),
|
|
91
|
+
defaultValue: false,
|
|
92
|
+
isEmpty: isEmptyValue,
|
|
93
|
+
hasIntrinsicWidth: false
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: "timeRangePickerPicker",
|
|
97
|
+
component: withDayjsTransformAntdTimeRange(TimePicker.RangePicker),
|
|
98
|
+
defaultValue: false,
|
|
99
|
+
isEmpty: isEmptyValue,
|
|
100
|
+
hasIntrinsicWidth: false
|
|
59
101
|
}
|
|
60
102
|
];
|
|
61
103
|
export {
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { getDefaultExportFromCjs, commonjsGlobal } from "../../../../../_virtual/_commonjsHelpers.js";
|
|
2
|
+
import { __module as dayjs_min } from "../../../../../_virtual/dayjs.min.js";
|
|
3
|
+
(function(module, exports) {
|
|
4
|
+
!function(t, e) {
|
|
5
|
+
module.exports = e();
|
|
6
|
+
}(commonjsGlobal, function() {
|
|
7
|
+
var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
|
|
8
|
+
var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
|
|
9
|
+
return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
|
|
10
|
+
} }, m = function(t2, e2, n2) {
|
|
11
|
+
var r2 = String(t2);
|
|
12
|
+
return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
|
|
13
|
+
}, v = { s: m, z: function(t2) {
|
|
14
|
+
var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
|
|
15
|
+
return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
|
|
16
|
+
}, m: function t2(e2, n2) {
|
|
17
|
+
if (e2.date() < n2.date()) return -t2(n2, e2);
|
|
18
|
+
var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
|
|
19
|
+
return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
|
|
20
|
+
}, a: function(t2) {
|
|
21
|
+
return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
|
|
22
|
+
}, p: function(t2) {
|
|
23
|
+
return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
|
|
24
|
+
}, u: function(t2) {
|
|
25
|
+
return void 0 === t2;
|
|
26
|
+
} }, g = "en", D = {};
|
|
27
|
+
D[g] = M;
|
|
28
|
+
var p = "$isDayjsObject", S = function(t2) {
|
|
29
|
+
return t2 instanceof _ || !(!t2 || !t2[p]);
|
|
30
|
+
}, w = function t2(e2, n2, r2) {
|
|
31
|
+
var i2;
|
|
32
|
+
if (!e2) return g;
|
|
33
|
+
if ("string" == typeof e2) {
|
|
34
|
+
var s2 = e2.toLowerCase();
|
|
35
|
+
D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
|
|
36
|
+
var u2 = e2.split("-");
|
|
37
|
+
if (!i2 && u2.length > 1) return t2(u2[0]);
|
|
38
|
+
} else {
|
|
39
|
+
var a2 = e2.name;
|
|
40
|
+
D[a2] = e2, i2 = a2;
|
|
41
|
+
}
|
|
42
|
+
return !r2 && i2 && (g = i2), i2 || !r2 && g;
|
|
43
|
+
}, O = function(t2, e2) {
|
|
44
|
+
if (S(t2)) return t2.clone();
|
|
45
|
+
var n2 = "object" == typeof e2 ? e2 : {};
|
|
46
|
+
return n2.date = t2, n2.args = arguments, new _(n2);
|
|
47
|
+
}, b = v;
|
|
48
|
+
b.l = w, b.i = S, b.w = function(t2, e2) {
|
|
49
|
+
return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
|
|
50
|
+
};
|
|
51
|
+
var _ = function() {
|
|
52
|
+
function M2(t2) {
|
|
53
|
+
this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
|
|
54
|
+
}
|
|
55
|
+
var m2 = M2.prototype;
|
|
56
|
+
return m2.parse = function(t2) {
|
|
57
|
+
this.$d = function(t3) {
|
|
58
|
+
var e2 = t3.date, n2 = t3.utc;
|
|
59
|
+
if (null === e2) return /* @__PURE__ */ new Date(NaN);
|
|
60
|
+
if (b.u(e2)) return /* @__PURE__ */ new Date();
|
|
61
|
+
if (e2 instanceof Date) return new Date(e2);
|
|
62
|
+
if ("string" == typeof e2 && !/Z$/i.test(e2)) {
|
|
63
|
+
var r2 = e2.match($);
|
|
64
|
+
if (r2) {
|
|
65
|
+
var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
|
|
66
|
+
return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return new Date(e2);
|
|
70
|
+
}(t2), this.init();
|
|
71
|
+
}, m2.init = function() {
|
|
72
|
+
var t2 = this.$d;
|
|
73
|
+
this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
|
|
74
|
+
}, m2.$utils = function() {
|
|
75
|
+
return b;
|
|
76
|
+
}, m2.isValid = function() {
|
|
77
|
+
return !(this.$d.toString() === l);
|
|
78
|
+
}, m2.isSame = function(t2, e2) {
|
|
79
|
+
var n2 = O(t2);
|
|
80
|
+
return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
|
|
81
|
+
}, m2.isAfter = function(t2, e2) {
|
|
82
|
+
return O(t2) < this.startOf(e2);
|
|
83
|
+
}, m2.isBefore = function(t2, e2) {
|
|
84
|
+
return this.endOf(e2) < O(t2);
|
|
85
|
+
}, m2.$g = function(t2, e2, n2) {
|
|
86
|
+
return b.u(t2) ? this[e2] : this.set(n2, t2);
|
|
87
|
+
}, m2.unix = function() {
|
|
88
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
89
|
+
}, m2.valueOf = function() {
|
|
90
|
+
return this.$d.getTime();
|
|
91
|
+
}, m2.startOf = function(t2, e2) {
|
|
92
|
+
var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
|
|
93
|
+
var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
|
|
94
|
+
return r2 ? i2 : i2.endOf(a);
|
|
95
|
+
}, $2 = function(t3, e3) {
|
|
96
|
+
return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
|
|
97
|
+
}, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
|
|
98
|
+
switch (f2) {
|
|
99
|
+
case h:
|
|
100
|
+
return r2 ? l2(1, 0) : l2(31, 11);
|
|
101
|
+
case c:
|
|
102
|
+
return r2 ? l2(1, M3) : l2(0, M3 + 1);
|
|
103
|
+
case o:
|
|
104
|
+
var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
|
|
105
|
+
return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
|
|
106
|
+
case a:
|
|
107
|
+
case d:
|
|
108
|
+
return $2(v2 + "Hours", 0);
|
|
109
|
+
case u:
|
|
110
|
+
return $2(v2 + "Minutes", 1);
|
|
111
|
+
case s:
|
|
112
|
+
return $2(v2 + "Seconds", 2);
|
|
113
|
+
case i:
|
|
114
|
+
return $2(v2 + "Milliseconds", 3);
|
|
115
|
+
default:
|
|
116
|
+
return this.clone();
|
|
117
|
+
}
|
|
118
|
+
}, m2.endOf = function(t2) {
|
|
119
|
+
return this.startOf(t2, false);
|
|
120
|
+
}, m2.$set = function(t2, e2) {
|
|
121
|
+
var n2, o2 = b.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
|
|
122
|
+
if (o2 === c || o2 === h) {
|
|
123
|
+
var y2 = this.clone().set(d, 1);
|
|
124
|
+
y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
|
|
125
|
+
} else l2 && this.$d[l2]($2);
|
|
126
|
+
return this.init(), this;
|
|
127
|
+
}, m2.set = function(t2, e2) {
|
|
128
|
+
return this.clone().$set(t2, e2);
|
|
129
|
+
}, m2.get = function(t2) {
|
|
130
|
+
return this[b.p(t2)]();
|
|
131
|
+
}, m2.add = function(r2, f2) {
|
|
132
|
+
var d2, l2 = this;
|
|
133
|
+
r2 = Number(r2);
|
|
134
|
+
var $2 = b.p(f2), y2 = function(t2) {
|
|
135
|
+
var e2 = O(l2);
|
|
136
|
+
return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
|
|
137
|
+
};
|
|
138
|
+
if ($2 === c) return this.set(c, this.$M + r2);
|
|
139
|
+
if ($2 === h) return this.set(h, this.$y + r2);
|
|
140
|
+
if ($2 === a) return y2(1);
|
|
141
|
+
if ($2 === o) return y2(7);
|
|
142
|
+
var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
|
|
143
|
+
return b.w(m3, this);
|
|
144
|
+
}, m2.subtract = function(t2, e2) {
|
|
145
|
+
return this.add(-1 * t2, e2);
|
|
146
|
+
}, m2.format = function(t2) {
|
|
147
|
+
var e2 = this, n2 = this.$locale();
|
|
148
|
+
if (!this.isValid()) return n2.invalidDate || l;
|
|
149
|
+
var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, i3, s3) {
|
|
150
|
+
return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
|
|
151
|
+
}, d2 = function(t3) {
|
|
152
|
+
return b.s(s2 % 12 || 12, t3, "0");
|
|
153
|
+
}, $2 = f2 || function(t3, e3, n3) {
|
|
154
|
+
var r3 = t3 < 12 ? "AM" : "PM";
|
|
155
|
+
return n3 ? r3.toLowerCase() : r3;
|
|
156
|
+
};
|
|
157
|
+
return r2.replace(y, function(t3, r3) {
|
|
158
|
+
return r3 || function(t4) {
|
|
159
|
+
switch (t4) {
|
|
160
|
+
case "YY":
|
|
161
|
+
return String(e2.$y).slice(-2);
|
|
162
|
+
case "YYYY":
|
|
163
|
+
return b.s(e2.$y, 4, "0");
|
|
164
|
+
case "M":
|
|
165
|
+
return a2 + 1;
|
|
166
|
+
case "MM":
|
|
167
|
+
return b.s(a2 + 1, 2, "0");
|
|
168
|
+
case "MMM":
|
|
169
|
+
return h2(n2.monthsShort, a2, c2, 3);
|
|
170
|
+
case "MMMM":
|
|
171
|
+
return h2(c2, a2);
|
|
172
|
+
case "D":
|
|
173
|
+
return e2.$D;
|
|
174
|
+
case "DD":
|
|
175
|
+
return b.s(e2.$D, 2, "0");
|
|
176
|
+
case "d":
|
|
177
|
+
return String(e2.$W);
|
|
178
|
+
case "dd":
|
|
179
|
+
return h2(n2.weekdaysMin, e2.$W, o2, 2);
|
|
180
|
+
case "ddd":
|
|
181
|
+
return h2(n2.weekdaysShort, e2.$W, o2, 3);
|
|
182
|
+
case "dddd":
|
|
183
|
+
return o2[e2.$W];
|
|
184
|
+
case "H":
|
|
185
|
+
return String(s2);
|
|
186
|
+
case "HH":
|
|
187
|
+
return b.s(s2, 2, "0");
|
|
188
|
+
case "h":
|
|
189
|
+
return d2(1);
|
|
190
|
+
case "hh":
|
|
191
|
+
return d2(2);
|
|
192
|
+
case "a":
|
|
193
|
+
return $2(s2, u2, true);
|
|
194
|
+
case "A":
|
|
195
|
+
return $2(s2, u2, false);
|
|
196
|
+
case "m":
|
|
197
|
+
return String(u2);
|
|
198
|
+
case "mm":
|
|
199
|
+
return b.s(u2, 2, "0");
|
|
200
|
+
case "s":
|
|
201
|
+
return String(e2.$s);
|
|
202
|
+
case "ss":
|
|
203
|
+
return b.s(e2.$s, 2, "0");
|
|
204
|
+
case "SSS":
|
|
205
|
+
return b.s(e2.$ms, 3, "0");
|
|
206
|
+
case "Z":
|
|
207
|
+
return i2;
|
|
208
|
+
}
|
|
209
|
+
return null;
|
|
210
|
+
}(t3) || i2.replace(":", "");
|
|
211
|
+
});
|
|
212
|
+
}, m2.utcOffset = function() {
|
|
213
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
214
|
+
}, m2.diff = function(r2, d2, l2) {
|
|
215
|
+
var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
|
|
216
|
+
return b.m(y2, m3);
|
|
217
|
+
};
|
|
218
|
+
switch (M3) {
|
|
219
|
+
case h:
|
|
220
|
+
$2 = D2() / 12;
|
|
221
|
+
break;
|
|
222
|
+
case c:
|
|
223
|
+
$2 = D2();
|
|
224
|
+
break;
|
|
225
|
+
case f:
|
|
226
|
+
$2 = D2() / 3;
|
|
227
|
+
break;
|
|
228
|
+
case o:
|
|
229
|
+
$2 = (g2 - v2) / 6048e5;
|
|
230
|
+
break;
|
|
231
|
+
case a:
|
|
232
|
+
$2 = (g2 - v2) / 864e5;
|
|
233
|
+
break;
|
|
234
|
+
case u:
|
|
235
|
+
$2 = g2 / n;
|
|
236
|
+
break;
|
|
237
|
+
case s:
|
|
238
|
+
$2 = g2 / e;
|
|
239
|
+
break;
|
|
240
|
+
case i:
|
|
241
|
+
$2 = g2 / t;
|
|
242
|
+
break;
|
|
243
|
+
default:
|
|
244
|
+
$2 = g2;
|
|
245
|
+
}
|
|
246
|
+
return l2 ? $2 : b.a($2);
|
|
247
|
+
}, m2.daysInMonth = function() {
|
|
248
|
+
return this.endOf(c).$D;
|
|
249
|
+
}, m2.$locale = function() {
|
|
250
|
+
return D[this.$L];
|
|
251
|
+
}, m2.locale = function(t2, e2) {
|
|
252
|
+
if (!t2) return this.$L;
|
|
253
|
+
var n2 = this.clone(), r2 = w(t2, e2, true);
|
|
254
|
+
return r2 && (n2.$L = r2), n2;
|
|
255
|
+
}, m2.clone = function() {
|
|
256
|
+
return b.w(this.$d, this);
|
|
257
|
+
}, m2.toDate = function() {
|
|
258
|
+
return new Date(this.valueOf());
|
|
259
|
+
}, m2.toJSON = function() {
|
|
260
|
+
return this.isValid() ? this.toISOString() : null;
|
|
261
|
+
}, m2.toISOString = function() {
|
|
262
|
+
return this.$d.toISOString();
|
|
263
|
+
}, m2.toString = function() {
|
|
264
|
+
return this.$d.toUTCString();
|
|
265
|
+
}, M2;
|
|
266
|
+
}(), k = _.prototype;
|
|
267
|
+
return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
|
|
268
|
+
k[t2[1]] = function(e2) {
|
|
269
|
+
return this.$g(e2, t2[0], t2[1]);
|
|
270
|
+
};
|
|
271
|
+
}), O.extend = function(t2, e2) {
|
|
272
|
+
return t2.$i || (t2(e2, _, O), t2.$i = true), O;
|
|
273
|
+
}, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
|
|
274
|
+
return O(1e3 * t2);
|
|
275
|
+
}, O.en = D[g], O.Ls = D, O.p = {}, O;
|
|
276
|
+
});
|
|
277
|
+
})(dayjs_min);
|
|
278
|
+
var dayjs_minExports = dayjs_min.exports;
|
|
279
|
+
const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
|
|
280
|
+
export {
|
|
281
|
+
dayjs as default
|
|
282
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { commonjsGlobal, getDefaultExportFromCjs } from "../../../../../../_virtual/_commonjsHelpers.js";
|
|
2
|
+
import { __module as isoWeek } from "../../../../../../_virtual/isoWeek.js";
|
|
3
|
+
(function(module, exports) {
|
|
4
|
+
!function(e, t) {
|
|
5
|
+
module.exports = t();
|
|
6
|
+
}(commonjsGlobal, function() {
|
|
7
|
+
var e = "day";
|
|
8
|
+
return function(t, i, s) {
|
|
9
|
+
var a = function(t2) {
|
|
10
|
+
return t2.add(4 - t2.isoWeekday(), e);
|
|
11
|
+
}, d = i.prototype;
|
|
12
|
+
d.isoWeekYear = function() {
|
|
13
|
+
return a(this).year();
|
|
14
|
+
}, d.isoWeek = function(t2) {
|
|
15
|
+
if (!this.$utils().u(t2)) return this.add(7 * (t2 - this.isoWeek()), e);
|
|
16
|
+
var i2, d2, n2, o, r = a(this), u = (i2 = this.isoWeekYear(), d2 = this.$u, n2 = (d2 ? s.utc : s)().year(i2).startOf("year"), o = 4 - n2.isoWeekday(), n2.isoWeekday() > 4 && (o += 7), n2.add(o, e));
|
|
17
|
+
return r.diff(u, "week") + 1;
|
|
18
|
+
}, d.isoWeekday = function(e2) {
|
|
19
|
+
return this.$utils().u(e2) ? this.day() || 7 : this.day(this.day() % 7 ? e2 : e2 - 7);
|
|
20
|
+
};
|
|
21
|
+
var n = d.startOf;
|
|
22
|
+
d.startOf = function(e2, t2) {
|
|
23
|
+
var i2 = this.$utils(), s2 = !!i2.u(t2) || t2;
|
|
24
|
+
return "isoweek" === i2.p(e2) ? s2 ? this.date(this.date() - (this.isoWeekday() - 1)).startOf("day") : this.date(this.date() - 1 - (this.isoWeekday() - 1) + 7).endOf("day") : n.bind(this)(e2, t2);
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
})(isoWeek);
|
|
29
|
+
var isoWeekExports = isoWeek.exports;
|
|
30
|
+
const isoweek = /* @__PURE__ */ getDefaultExportFromCjs(isoWeekExports);
|
|
31
|
+
export {
|
|
32
|
+
isoweek as default
|
|
33
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { commonjsGlobal, getDefaultExportFromCjs } from "../../../../../../_virtual/_commonjsHelpers.js";
|
|
2
|
+
import { __module as weekOfYear$1 } from "../../../../../../_virtual/weekOfYear.js";
|
|
3
|
+
(function(module, exports) {
|
|
4
|
+
!function(e, t) {
|
|
5
|
+
module.exports = t();
|
|
6
|
+
}(commonjsGlobal, function() {
|
|
7
|
+
var e = "week", t = "year";
|
|
8
|
+
return function(i, n, r) {
|
|
9
|
+
var f = n.prototype;
|
|
10
|
+
f.week = function(i2) {
|
|
11
|
+
if (void 0 === i2 && (i2 = null), null !== i2) return this.add(7 * (i2 - this.week()), "day");
|
|
12
|
+
var n2 = this.$locale().yearStart || 1;
|
|
13
|
+
if (11 === this.month() && this.date() > 25) {
|
|
14
|
+
var f2 = r(this).startOf(t).add(1, t).date(n2), s = r(this).endOf(e);
|
|
15
|
+
if (f2.isBefore(s)) return 1;
|
|
16
|
+
}
|
|
17
|
+
var a = r(this).startOf(t).date(n2).startOf(e).subtract(1, "millisecond"), o = this.diff(a, e, true);
|
|
18
|
+
return o < 0 ? r(this).startOf("week").week() : Math.ceil(o);
|
|
19
|
+
}, f.weeks = function(e2) {
|
|
20
|
+
return void 0 === e2 && (e2 = null), this.week(e2);
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
})(weekOfYear$1);
|
|
25
|
+
var weekOfYearExports = weekOfYear$1.exports;
|
|
26
|
+
const weekOfYear = /* @__PURE__ */ getDefaultExportFromCjs(weekOfYearExports);
|
|
27
|
+
export {
|
|
28
|
+
weekOfYear as default
|
|
29
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { commonjsGlobal, getDefaultExportFromCjs } from "../../../../../../_virtual/_commonjsHelpers.js";
|
|
2
|
+
import { __module as weekYear$1 } from "../../../../../../_virtual/weekYear.js";
|
|
3
|
+
(function(module, exports) {
|
|
4
|
+
!function(e, t) {
|
|
5
|
+
module.exports = t();
|
|
6
|
+
}(commonjsGlobal, function() {
|
|
7
|
+
return function(e, t) {
|
|
8
|
+
t.prototype.weekYear = function() {
|
|
9
|
+
var e2 = this.month(), t2 = this.week(), n = this.year();
|
|
10
|
+
return 1 === t2 && 11 === e2 ? n + 1 : 0 === e2 && t2 >= 52 ? n - 1 : n;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
})(weekYear$1);
|
|
15
|
+
var weekYearExports = weekYear$1.exports;
|
|
16
|
+
const weekYear = /* @__PURE__ */ getDefaultExportFromCjs(weekYearExports);
|
|
17
|
+
export {
|
|
18
|
+
weekYear as default
|
|
19
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Reaction } from "mobx";
|
|
2
|
-
import
|
|
2
|
+
import React from "react";
|
|
3
3
|
import { printDebugValue } from "./utils/printDebugValue.js";
|
|
4
4
|
import { observerFinalizationRegistry } from "./utils/observerFinalizationRegistry.js";
|
|
5
5
|
import { s as shimExports } from "../../../../use-sync-external-store@1.5.0_react@18.3.1/node_modules/use-sync-external-store/shim/index.js";
|
|
@@ -14,7 +14,7 @@ function useObserver(render, baseComponentName) {
|
|
|
14
14
|
if (baseComponentName === void 0) {
|
|
15
15
|
baseComponentName = "observed";
|
|
16
16
|
}
|
|
17
|
-
var admRef =
|
|
17
|
+
var admRef = React.useRef(null);
|
|
18
18
|
if (!admRef.current) {
|
|
19
19
|
var adm_1 = {
|
|
20
20
|
reaction: null,
|
|
@@ -46,7 +46,7 @@ function useObserver(render, baseComponentName) {
|
|
|
46
46
|
createReaction(adm);
|
|
47
47
|
observerFinalizationRegistry.register(admRef, adm, adm);
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
React.useDebugValue(adm.reaction, printDebugValue);
|
|
50
50
|
shimExports.useSyncExternalStore(
|
|
51
51
|
// Both of these must be stable, otherwise it would keep resubscribing every render.
|
|
52
52
|
adm.subscribe,
|
package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __exports as reactJsxRuntime_development } from "../../../../../../_virtual/react-jsx-runtime.development.js";
|
|
2
|
-
import
|
|
2
|
+
import React from "react";
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.development.js
|
|
@@ -15,7 +15,7 @@ function requireReactJsxRuntime_development() {
|
|
|
15
15
|
hasRequiredReactJsxRuntime_development = 1;
|
|
16
16
|
if (process.env.NODE_ENV !== "production") {
|
|
17
17
|
(function() {
|
|
18
|
-
var React =
|
|
18
|
+
var React$1 = React;
|
|
19
19
|
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
|
20
20
|
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
21
21
|
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
@@ -41,7 +41,7 @@ function requireReactJsxRuntime_development() {
|
|
|
41
41
|
}
|
|
42
42
|
return null;
|
|
43
43
|
}
|
|
44
|
-
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
44
|
+
var ReactSharedInternals = React$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
45
45
|
function error(format) {
|
|
46
46
|
{
|
|
47
47
|
{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __exports as reactJsxRuntime_production_min } from "../../../../../../_virtual/react-jsx-runtime.production.min.js";
|
|
2
|
-
import
|
|
2
|
+
import React from "react";
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.min.js
|
|
@@ -13,7 +13,7 @@ var hasRequiredReactJsxRuntime_production_min;
|
|
|
13
13
|
function requireReactJsxRuntime_production_min() {
|
|
14
14
|
if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
|
|
15
15
|
hasRequiredReactJsxRuntime_production_min = 1;
|
|
16
|
-
var f =
|
|
16
|
+
var f = React, k = Symbol.for("react.element"), l = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: true, ref: true, __self: true, __source: true };
|
|
17
17
|
function q(c, a, g) {
|
|
18
18
|
var b, d = {}, e = null, h = null;
|
|
19
19
|
void 0 !== g && (e = "" + g);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __exports as useSyncExternalStoreShim_development } from "../../../../../../_virtual/use-sync-external-store-shim.development.js";
|
|
2
|
-
import
|
|
2
|
+
import React from "react";
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* use-sync-external-store-shim.development.js
|
|
@@ -18,7 +18,7 @@ function requireUseSyncExternalStoreShim_development() {
|
|
|
18
18
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
19
19
|
}
|
|
20
20
|
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
21
|
-
didWarnOld18Alpha || void 0 === React.startTransition || (didWarnOld18Alpha = true, console.error(
|
|
21
|
+
didWarnOld18Alpha || void 0 === React$1.startTransition || (didWarnOld18Alpha = true, console.error(
|
|
22
22
|
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
23
23
|
));
|
|
24
24
|
var value = getSnapshot();
|
|
@@ -66,8 +66,8 @@ function requireUseSyncExternalStoreShim_development() {
|
|
|
66
66
|
return getSnapshot();
|
|
67
67
|
}
|
|
68
68
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
69
|
-
var React =
|
|
70
|
-
useSyncExternalStoreShim_development.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
|
|
69
|
+
var React$1 = React, objectIs = "function" === typeof Object.is ? Object.is : is, useState = React$1.useState, useEffect = React$1.useEffect, useLayoutEffect = React$1.useLayoutEffect, useDebugValue = React$1.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
70
|
+
useSyncExternalStoreShim_development.useSyncExternalStore = void 0 !== React$1.useSyncExternalStore ? React$1.useSyncExternalStore : shim;
|
|
71
71
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
72
72
|
}();
|
|
73
73
|
return useSyncExternalStoreShim_development;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __exports as useSyncExternalStoreShim_production } from "../../../../../../_virtual/use-sync-external-store-shim.production.js";
|
|
2
|
-
import
|
|
2
|
+
import React from "react";
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* use-sync-external-store-shim.production.js
|
|
@@ -13,11 +13,11 @@ var hasRequiredUseSyncExternalStoreShim_production;
|
|
|
13
13
|
function requireUseSyncExternalStoreShim_production() {
|
|
14
14
|
if (hasRequiredUseSyncExternalStoreShim_production) return useSyncExternalStoreShim_production;
|
|
15
15
|
hasRequiredUseSyncExternalStoreShim_production = 1;
|
|
16
|
-
var React =
|
|
16
|
+
var React$1 = React;
|
|
17
17
|
function is(x, y) {
|
|
18
18
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
19
19
|
}
|
|
20
|
-
var objectIs = "function" === typeof Object.is ? Object.is : is, useState = React.useState, useEffect = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue = React.useDebugValue;
|
|
20
|
+
var objectIs = "function" === typeof Object.is ? Object.is : is, useState = React$1.useState, useEffect = React$1.useEffect, useLayoutEffect = React$1.useLayoutEffect, useDebugValue = React$1.useDebugValue;
|
|
21
21
|
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
22
22
|
var value = getSnapshot(), _useState = useState({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
|
|
23
23
|
useLayoutEffect(
|
|
@@ -54,7 +54,7 @@ function requireUseSyncExternalStoreShim_production() {
|
|
|
54
54
|
return getSnapshot();
|
|
55
55
|
}
|
|
56
56
|
var shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
57
|
-
useSyncExternalStoreShim_production.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
|
|
57
|
+
useSyncExternalStoreShim_production.useSyncExternalStore = void 0 !== React$1.useSyncExternalStore ? React$1.useSyncExternalStore : shim;
|
|
58
58
|
return useSyncExternalStoreShim_production;
|
|
59
59
|
}
|
|
60
60
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-antd-xform",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "基于mobx的form解决方案",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -10,6 +10,11 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
"dist"
|
|
12
12
|
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "vite build",
|
|
15
|
+
"dev": "sb dev -p 6006",
|
|
16
|
+
"build-storybook": "sb build"
|
|
17
|
+
},
|
|
13
18
|
"keywords": [
|
|
14
19
|
"form",
|
|
15
20
|
"antd",
|
|
@@ -19,11 +24,13 @@
|
|
|
19
24
|
],
|
|
20
25
|
"author": "",
|
|
21
26
|
"license": "MIT",
|
|
27
|
+
"packageManager": "pnpm@10.12.1",
|
|
22
28
|
"dependencies": {
|
|
23
29
|
"@types/invariant": "^2.2.37",
|
|
24
30
|
"@types/stringify-object": "^4.0.5",
|
|
25
31
|
"antd": "^5.26.2",
|
|
26
32
|
"classnames": "^2.5.1",
|
|
33
|
+
"dayjs": "^1.11.18",
|
|
27
34
|
"invariant": "^2.2.4",
|
|
28
35
|
"mobx": "^6.13.7",
|
|
29
36
|
"mobx-react-lite": "^4.1.0",
|
|
@@ -53,10 +60,5 @@
|
|
|
53
60
|
"mobx-react-lite": "^4.1.0",
|
|
54
61
|
"react": "^18.2.0",
|
|
55
62
|
"react-dom": "^18.2.0"
|
|
56
|
-
},
|
|
57
|
-
"scripts": {
|
|
58
|
-
"build": "vite build",
|
|
59
|
-
"dev": "sb dev -p 6006",
|
|
60
|
-
"build-storybook": "sb build"
|
|
61
63
|
}
|
|
62
|
-
}
|
|
64
|
+
}
|