cnhis-design-vue 3.1.15-beta.2 → 3.1.15-beta.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/es/packages/annotation-edit/src/AnnotationEdit.js +2 -1
- package/es/packages/big-table/index.d.ts +8 -11
- package/es/packages/big-table/src/BigTable.vue.d.ts +24 -19
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +8 -6
- package/es/packages/big-table/src/bigTableProps.d.ts +4 -3
- package/es/packages/big-table/src/bigTableProps.js +1 -1
- package/es/packages/big-table/src/components/edit-form/edit-date.js +2 -1
- package/es/packages/big-table/src/components/edit-form/edit-select.js +2 -1
- package/es/packages/big-table/src/components/edit-form/edit-separate.js +8 -1
- package/es/packages/big-table/src/components/edit-form/edit-separate.vue.d.ts +2 -1
- package/es/packages/big-table/src/hooks/useAnnotation.d.ts +4 -0
- package/es/packages/big-table/src/hooks/useAnnotation.js +22 -0
- package/es/packages/big-table/src/hooks/useEdit.d.ts +2 -1
- package/es/packages/big-table/style/index.css +27 -1
- package/es/packages/bpmn-workflow/src/BpmnWorkflow.js +2 -2
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/BpmnRenderer.js +8 -8
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomContextPadProvider.js +2 -2
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomPalette.js +1 -1
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomRenderer.js +4 -3
- package/es/packages/bpmn-workflow/src/custom/customModeler/customBpmn/CustomRules.js +2 -2
- package/es/packages/bpmn-workflow/src/custom/customModeler/index.js +1 -1
- package/es/packages/bpmn-workflow/src/custom/customOtherModule/CustomPopupMenu.js +2 -2
- package/es/packages/bpmn-workflow/src/custom/customOtherModule/zoomScroll.js +3 -3
- package/es/packages/button-print/src/utils/print.d.ts +1 -1
- package/es/packages/button-print/src/utils/print.js +1 -1
- package/es/packages/fabric-chart/index.d.ts +1 -0
- package/es/packages/fabric-chart/src/FabricChart.js +17 -17
- package/es/packages/fabric-chart/src/FabricChart.vue.d.ts +12 -10
- package/es/packages/fabric-chart/src/hooks/useCenter.js +7 -5
- package/es/packages/fabric-chart/src/hooks/useCumputedPoint.js +4 -2
- package/es/packages/fabric-chart/src/hooks/useLeft.js +4 -2
- package/es/packages/field-set/index.d.ts +4365 -0
- package/es/packages/field-set/src/FieldSet.js +53 -54
- package/es/packages/field-set/src/FieldSet.vue.d.ts +4365 -0
- package/es/packages/field-set/style/index.css +0 -9
- package/es/packages/form-render/index.d.ts +24 -3
- package/es/packages/form-render/src/FormRender.js +10 -6
- package/es/packages/form-render/src/FormRender.vue.d.ts +24 -3
- package/es/packages/form-render/src/components/renderer/cascader.js +7 -7
- package/es/packages/form-render/src/components/renderer/combination/hooks/useDeepValidate.d.ts +5 -0
- package/es/packages/form-render/src/components/renderer/combination/hooks/useDeepValidate.js +32 -0
- package/es/packages/form-render/src/components/renderer/{combination.d.ts → combination/index.d.ts} +7 -1
- package/es/packages/form-render/src/components/renderer/combination/index.js +157 -0
- package/es/packages/form-render/src/components/renderer/complex.d.ts +2 -0
- package/es/packages/form-render/src/components/renderer/complex.js +2 -5
- package/es/packages/form-render/src/components/renderer/date.d.ts +29 -0
- package/es/packages/form-render/src/components/renderer/date.js +63 -56
- package/es/packages/form-render/src/components/renderer/index.js +1 -1
- package/es/packages/form-render/src/components/renderer/radio.js +4 -1
- package/es/packages/form-render/src/components/renderer/select.d.ts +9 -0
- package/es/packages/form-render/src/components/renderer/select.js +12 -8
- package/es/packages/form-render/src/constants/index.d.ts +2 -1
- package/es/packages/form-render/src/hooks/useAnchor.d.ts +7 -6
- package/es/packages/form-render/src/hooks/useAnchor.js +1 -2
- package/es/packages/form-render/src/hooks/useAsyncQueue.d.ts +6 -1
- package/es/packages/form-render/src/hooks/useAsyncQueue.js +11 -2
- package/es/packages/form-render/src/hooks/useCommonInjection.d.ts +6 -0
- package/es/packages/form-render/src/hooks/useCommonInjection.js +19 -0
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +2 -4
- package/es/packages/form-render/src/hooks/useFormContext.d.ts +3 -3
- package/es/packages/form-render/src/hooks/useFormContext.js +15 -3
- package/es/packages/form-render/src/hooks/useFormRenderLifeCycle.d.ts +13 -0
- package/es/packages/form-render/src/hooks/useFormRenderLifeCycle.js +10 -0
- package/es/packages/form-render/src/types/fieldItem.d.ts +8 -0
- package/es/packages/form-render/src/types/index.d.ts +25 -1
- package/es/packages/form-render/src/utils/index.d.ts +3 -3
- package/es/packages/form-render/src/utils/index.js +1 -4
- package/es/packages/form-render/style/index.css +11 -10
- package/es/packages/index.css +38 -20
- package/es/packages/info-header/index.d.ts +1 -3
- package/es/packages/info-header/src/HiddenContent.js +1 -1
- package/es/packages/info-header/src/HiddenContent.vue.d.ts +1 -3
- package/es/packages/info-header/src/InfoHeader.vue.d.ts +1 -3
- package/es/packages/shortcut-setter/index.d.ts +25 -4
- package/es/packages/shortcut-setter/src/ShortcutSetter.vue.d.ts +25 -4
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.js +2 -2
- package/es/packages/shortcut-setter/src/ShortcutSetterItem.vue.d.ts +1 -1
- package/package.json +9 -1
- package/es/_virtual/_commonjsHelpers.js +0 -7
- package/es/_virtual/css.escape.js +0 -3
- package/es/_virtual/inherits.js +0 -3
- package/es/_virtual/inherits_browser.js +0 -3
- package/es/node_modules/@formily/path/esm/contexts.js +0 -22
- package/es/node_modules/@formily/path/esm/destructor.js +0 -124
- package/es/node_modules/@formily/path/esm/index.js +0 -579
- package/es/node_modules/@formily/path/esm/matcher.js +0 -199
- package/es/node_modules/@formily/path/esm/parser.js +0 -402
- package/es/node_modules/@formily/path/esm/shared.js +0 -73
- package/es/node_modules/@formily/path/esm/tokenizer.js +0 -287
- package/es/node_modules/@formily/path/esm/tokens.js +0 -240
- package/es/node_modules/@formily/path/esm/types.js +0 -17
- package/es/node_modules/css.escape/css.escape.js +0 -110
- package/es/node_modules/date-fns/esm/_lib/defaultOptions/index.js +0 -6
- package/es/node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js +0 -18
- package/es/node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js +0 -17
- package/es/node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js +0 -27
- package/es/node_modules/date-fns/esm/_lib/getUTCWeek/index.js +0 -17
- package/es/node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js +0 -38
- package/es/node_modules/date-fns/esm/_lib/requiredArgs/index.js +0 -7
- package/es/node_modules/date-fns/esm/_lib/setUTCDay/index.js +0 -27
- package/es/node_modules/date-fns/esm/_lib/setUTCISODay/index.js +0 -23
- package/es/node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js +0 -15
- package/es/node_modules/date-fns/esm/_lib/setUTCWeek/index.js +0 -15
- package/es/node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js +0 -15
- package/es/node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js +0 -15
- package/es/node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js +0 -25
- package/es/node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js +0 -21
- package/es/node_modules/date-fns/esm/_lib/toInteger/index.js +0 -15
- package/es/node_modules/date-fns/esm/compareAsc/index.js +0 -52
- package/es/node_modules/date-fns/esm/constants/index.js +0 -40
- package/es/node_modules/date-fns/esm/differenceInCalendarDays/index.js +0 -49
- package/es/node_modules/date-fns/esm/differenceInCalendarMonths/index.js +0 -35
- package/es/node_modules/date-fns/esm/differenceInCalendarYears/index.js +0 -33
- package/es/node_modules/date-fns/esm/differenceInDays/index.js +0 -86
- package/es/node_modules/date-fns/esm/differenceInMonths/index.js +0 -59
- package/es/node_modules/date-fns/esm/differenceInYears/index.js +0 -43
- package/es/node_modules/date-fns/esm/endOfDay/index.js +0 -30
- package/es/node_modules/date-fns/esm/endOfMonth/index.js +0 -32
- package/es/node_modules/date-fns/esm/isLastDayOfMonth/index.js +0 -30
- package/es/node_modules/date-fns/esm/parse/_lib/Parser.js +0 -32
- package/es/node_modules/date-fns/esm/parse/_lib/Setter.js +0 -37
- package/es/node_modules/date-fns/esm/parse/_lib/constants.js +0 -48
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/AMPMMidnightParser.js +0 -55
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/AMPMParser.js +0 -55
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/DateParser.js +0 -55
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/DayOfYearParser.js +0 -52
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/DayParser.js +0 -80
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/DayPeriodParser.js +0 -56
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/EraParser.js +0 -53
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ExtendedYearParser.js +0 -30
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/FractionOfSecondParser.js +0 -29
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour0To11Parser.js +0 -48
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour0to23Parser.js +0 -41
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour1To24Parser.js +0 -42
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/Hour1to12Parser.js +0 -50
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISODayParser.js +0 -99
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOTimezoneParser.js +0 -46
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOTimezoneWithZParser.js +0 -46
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOWeekParser.js +0 -43
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/ISOWeekYearParser.js +0 -33
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/LocalDayParser.js +0 -96
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/LocalWeekParser.js +0 -43
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/LocalWeekYearParser.js +0 -61
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/MinuteParser.js +0 -41
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/MonthParser.js +0 -80
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/QuarterParser.js +0 -73
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/SecondParser.js +0 -41
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneLocalDayParser.js +0 -96
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneMonthParser.js +0 -80
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/StandAloneQuarterParser.js +0 -73
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/TimestampMillisecondsParser.js +0 -26
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/TimestampSecondsParser.js +0 -26
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/YearParser.js +0 -66
- package/es/node_modules/date-fns/esm/parse/_lib/parsers/index.js +0 -109
- package/es/node_modules/date-fns/esm/parse/_lib/utils.js +0 -133
- package/es/node_modules/date-fns/esm/startOfDay/index.js +0 -30
- package/es/node_modules/date-fns/esm/toDate/index.js +0 -55
- package/es/node_modules/diagram-js/lib/command/CommandInterceptor.js +0 -139
- package/es/node_modules/diagram-js/lib/draw/BaseRenderer.js +0 -88
- package/es/node_modules/diagram-js/lib/features/popup-menu/PopupMenu.js +0 -591
- package/es/node_modules/diagram-js/lib/features/rules/RuleProvider.js +0 -88
- package/es/node_modules/diagram-js/lib/navigation/movecanvas/MoveCanvas.js +0 -120
- package/es/node_modules/diagram-js/lib/navigation/movecanvas/index.js +0 -8
- package/es/node_modules/diagram-js/lib/navigation/zoomscroll/ZoomScroll.js +0 -227
- package/es/node_modules/diagram-js/lib/navigation/zoomscroll/ZoomUtil.js +0 -24
- package/es/node_modules/diagram-js/lib/util/ClickTrap.js +0 -23
- package/es/node_modules/diagram-js/lib/util/Cursor.js +0 -20
- package/es/node_modules/diagram-js/lib/util/Event.js +0 -22
- package/es/node_modules/diagram-js/lib/util/Math.js +0 -9
- package/es/node_modules/diagram-js/lib/util/Mouse.js +0 -30
- package/es/node_modules/diagram-js/lib/util/Platform.js +0 -5
- package/es/node_modules/diagram-js/lib/util/PositionUtil.js +0 -8
- package/es/node_modules/diagram-js/lib/util/RenderUtil.js +0 -25
- package/es/node_modules/diagram-js/lib/util/SvgTransformUtil.js +0 -48
- package/es/node_modules/ids/dist/index.esm.js +0 -164
- package/es/node_modules/inherits/inherits.js +0 -19
- package/es/node_modules/inherits/inherits_browser.js +0 -38
- package/es/node_modules/inherits-browser/dist/index.es.js +0 -3
- package/es/node_modules/min-dash/dist/index.esm.js +0 -169
- package/es/node_modules/min-dom/dist/index.esm.js +0 -588
- package/es/node_modules/tiny-svg/dist/index.esm.js +0 -525
- package/es/packages/form-render/src/components/renderer/combination.js +0 -171
|
@@ -1,18 +1,75 @@
|
|
|
1
|
-
import { defineComponent, createVNode } from 'vue';
|
|
1
|
+
import { defineComponent, computed, createVNode } from 'vue';
|
|
2
2
|
import { isField } from '@formily/core';
|
|
3
3
|
import { connect, mapProps } from '@formily/vue';
|
|
4
4
|
import { isObject } from '@vueuse/core';
|
|
5
5
|
import { NDatePicker } from 'naive-ui';
|
|
6
|
+
import { useCommonInjection } from '../../../../../packages/form-render/src/hooks/useCommonInjection';
|
|
6
7
|
|
|
7
8
|
const script = defineComponent({
|
|
8
9
|
props: {
|
|
9
10
|
onChange: {},
|
|
10
|
-
value: {}
|
|
11
|
+
value: {},
|
|
12
|
+
validate: {
|
|
13
|
+
type: Object
|
|
14
|
+
}
|
|
11
15
|
},
|
|
12
|
-
setup(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
setup(props) {
|
|
17
|
+
useCommonInjection().injectValueValidate(() => props.value);
|
|
18
|
+
function minCurrentDate() {
|
|
19
|
+
var _a;
|
|
20
|
+
return ((_a = props.validate) == null ? void 0 : _a.min_date) === "currTime";
|
|
21
|
+
}
|
|
22
|
+
function maxCurrentDate() {
|
|
23
|
+
var _a;
|
|
24
|
+
return ((_a = props.validate) == null ? void 0 : _a.max_date) === "currTime";
|
|
25
|
+
}
|
|
26
|
+
function isDateDisabled(time) {
|
|
27
|
+
return minCurrentDate() && time < yesterday() || maxCurrentDate() && time > Date.now();
|
|
28
|
+
function yesterday() {
|
|
29
|
+
return Date.now() - 24 * 60 * 60 * 1e3;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function isTimeDisabled(time) {
|
|
33
|
+
const checkDate = new Date(time);
|
|
34
|
+
const currentDate = new Date();
|
|
35
|
+
return {
|
|
36
|
+
isHourDisabled,
|
|
37
|
+
isMinuteDisabled
|
|
38
|
+
};
|
|
39
|
+
function checkHour() {
|
|
40
|
+
return checkDate.getHours();
|
|
41
|
+
}
|
|
42
|
+
function currentHour() {
|
|
43
|
+
return currentDate.getHours();
|
|
44
|
+
}
|
|
45
|
+
function currentMinute() {
|
|
46
|
+
return currentDate.getMinutes();
|
|
47
|
+
}
|
|
48
|
+
function isHourDisabled(hour) {
|
|
49
|
+
return minCurrentDate() && hour < currentHour() || maxCurrentDate() && hour > currentHour();
|
|
50
|
+
}
|
|
51
|
+
function isMinuteDisabled(minute) {
|
|
52
|
+
if (checkHour() === currentHour()) {
|
|
53
|
+
return minCurrentDate() && minute < currentMinute() || maxCurrentDate() && minute > currentMinute();
|
|
54
|
+
}
|
|
55
|
+
return minCurrentDate() && checkHour() < currentHour() || maxCurrentDate() && checkHour() > currentHour();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const validateConfig = computed(() => {
|
|
59
|
+
const result = {};
|
|
60
|
+
if (isObject(props.validate)) {
|
|
61
|
+
const {
|
|
62
|
+
min_date,
|
|
63
|
+
max_date
|
|
64
|
+
} = props.validate;
|
|
65
|
+
if (min_date || max_date) {
|
|
66
|
+
result.isDateDisabled = isDateDisabled;
|
|
67
|
+
result.isTimeDisabled = isTimeDisabled;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return result;
|
|
71
|
+
});
|
|
72
|
+
return () => createVNode(NDatePicker, validateConfig.value, null);
|
|
16
73
|
}
|
|
17
74
|
});
|
|
18
75
|
const DATE = connect(script, mapProps((props, field) => {
|
|
@@ -26,58 +83,8 @@ const DATE = connect(script, mapProps((props, field) => {
|
|
|
26
83
|
field.setValue(v);
|
|
27
84
|
}
|
|
28
85
|
});
|
|
29
|
-
if (isObject(props.validate)) {
|
|
30
|
-
const {
|
|
31
|
-
min_date,
|
|
32
|
-
max_date
|
|
33
|
-
} = props.validate;
|
|
34
|
-
if (min_date || max_date) {
|
|
35
|
-
_props.isDateDisabled = isDateDisabled;
|
|
36
|
-
_props.isTimeDisabled = isTimeDisabled;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
86
|
}
|
|
40
87
|
return _props;
|
|
41
|
-
function minCurrentDate() {
|
|
42
|
-
var _a;
|
|
43
|
-
return ((_a = props.validate) == null ? void 0 : _a.min_date) === "currTime";
|
|
44
|
-
}
|
|
45
|
-
function maxCurrentDate() {
|
|
46
|
-
var _a;
|
|
47
|
-
return ((_a = props.validate) == null ? void 0 : _a.max_date) === "currTime";
|
|
48
|
-
}
|
|
49
|
-
function isDateDisabled(time) {
|
|
50
|
-
return minCurrentDate() && time < yesterday() || maxCurrentDate() && time > Date.now();
|
|
51
|
-
function yesterday() {
|
|
52
|
-
return Date.now() - 24 * 60 * 60 * 1e3;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function isTimeDisabled(time) {
|
|
56
|
-
const checkDate = new Date(time);
|
|
57
|
-
const currentDate = new Date();
|
|
58
|
-
return {
|
|
59
|
-
isHourDisabled,
|
|
60
|
-
isMinuteDisabled
|
|
61
|
-
};
|
|
62
|
-
function checkHour() {
|
|
63
|
-
return checkDate.getHours();
|
|
64
|
-
}
|
|
65
|
-
function currentHour() {
|
|
66
|
-
return currentDate.getHours();
|
|
67
|
-
}
|
|
68
|
-
function currentMinute() {
|
|
69
|
-
return currentDate.getMinutes();
|
|
70
|
-
}
|
|
71
|
-
function isHourDisabled(hour) {
|
|
72
|
-
return minCurrentDate() && hour < currentHour() || maxCurrentDate() && hour > currentHour();
|
|
73
|
-
}
|
|
74
|
-
function isMinuteDisabled(minute) {
|
|
75
|
-
if (checkHour() === currentHour()) {
|
|
76
|
-
return minCurrentDate() && minute < currentMinute() || maxCurrentDate() && minute > currentMinute();
|
|
77
|
-
}
|
|
78
|
-
return minCurrentDate() && checkHour() < currentHour() || maxCurrentDate() && checkHour() > currentHour();
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
88
|
}));
|
|
82
89
|
|
|
83
90
|
export { DATE };
|
|
@@ -7,7 +7,7 @@ export { LINEBAR } from './linebar.js';
|
|
|
7
7
|
export { INPUT_GROUP } from './inputGroup.js';
|
|
8
8
|
export { DATE } from './date.js';
|
|
9
9
|
export { SEARCH_CASCADE } from './cascader.js';
|
|
10
|
-
export { COMBINATION } from './combination.js';
|
|
10
|
+
export { COMBINATION } from './combination/index.js';
|
|
11
11
|
export { CHECKBOX } from './checkbox.js';
|
|
12
12
|
export { SWITCH } from './switch.js';
|
|
13
13
|
export { RADIO } from './radio.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { defineComponent, computed, createVNode } from 'vue';
|
|
2
2
|
import { connect, mapProps } from '@formily/vue';
|
|
3
|
+
import { isNumber } from 'lodash-es';
|
|
3
4
|
import { NRadioGroup, NSpace, NRadio } from 'naive-ui';
|
|
4
5
|
import { assignUpdateValue } from '../../utils/index.js';
|
|
5
6
|
|
|
@@ -23,7 +24,9 @@ const script = defineComponent({
|
|
|
23
24
|
emit
|
|
24
25
|
}) {
|
|
25
26
|
function dangerousTypeTransform(value) {
|
|
26
|
-
|
|
27
|
+
if (isNumber(value))
|
|
28
|
+
return value + "";
|
|
29
|
+
return value;
|
|
27
30
|
}
|
|
28
31
|
const valueRef = computed({
|
|
29
32
|
get() {
|
|
@@ -13,6 +13,10 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
13
13
|
value: {
|
|
14
14
|
type: StringConstructor;
|
|
15
15
|
};
|
|
16
|
+
lazyRequest: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
default: boolean;
|
|
19
|
+
};
|
|
16
20
|
options: {
|
|
17
21
|
type: PropType<AnyObject[]>;
|
|
18
22
|
default: () => never[];
|
|
@@ -28,6 +32,10 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
28
32
|
value: {
|
|
29
33
|
type: StringConstructor;
|
|
30
34
|
};
|
|
35
|
+
lazyRequest: {
|
|
36
|
+
type: BooleanConstructor;
|
|
37
|
+
default: boolean;
|
|
38
|
+
};
|
|
31
39
|
options: {
|
|
32
40
|
type: PropType<AnyObject[]>;
|
|
33
41
|
default: () => never[];
|
|
@@ -43,5 +51,6 @@ export declare const SELECT: import("vue").DefineComponent<{
|
|
|
43
51
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
44
52
|
}, {
|
|
45
53
|
options: AnyObject[];
|
|
54
|
+
lazyRequest: boolean;
|
|
46
55
|
}>;
|
|
47
56
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineComponent, ref, computed, inject, watch, createVNode } from 'vue';
|
|
2
2
|
import { isField } from '@formily/core';
|
|
3
3
|
import { isEqual, cloneDeep } from 'lodash-es';
|
|
4
|
+
import { useCommonInjection } from '../../../../../packages/form-render/src/hooks/useCommonInjection';
|
|
4
5
|
import { InjectionChangeContextCollector, InjectAsyncQueue, InjectionFormItemDepsCollector } from '../../constants/index.js';
|
|
5
6
|
import { assignUpdateValue, traverseDependKey } from '../../utils/index.js';
|
|
6
7
|
import { connect, mapProps } from '@formily/vue';
|
|
@@ -13,6 +14,10 @@ const script = defineComponent({
|
|
|
13
14
|
value: {
|
|
14
15
|
type: String
|
|
15
16
|
},
|
|
17
|
+
lazyRequest: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: true
|
|
20
|
+
},
|
|
16
21
|
options: {
|
|
17
22
|
type: Array,
|
|
18
23
|
default: () => []
|
|
@@ -102,17 +107,16 @@ const script = defineComponent({
|
|
|
102
107
|
remoteOptions.value = null;
|
|
103
108
|
emit("update:value", null);
|
|
104
109
|
});
|
|
105
|
-
props.value && fetchData();
|
|
106
|
-
}, {
|
|
107
|
-
immediate: true
|
|
108
|
-
});
|
|
109
|
-
watch(() => props.value, (n, o) => {
|
|
110
|
-
var _a, _b;
|
|
111
|
-
o == null && n != null && fetchData();
|
|
112
|
-
isField(field.value) && field.value.visited && ((_b = (_a = field.value).validate) == null ? void 0 : _b.call(_a));
|
|
110
|
+
(props.value || !props.lazyRequest) && fetchData();
|
|
113
111
|
}, {
|
|
114
112
|
immediate: true
|
|
115
113
|
});
|
|
114
|
+
const {
|
|
115
|
+
injectValueValidate,
|
|
116
|
+
injectValueWatchFromEmpty
|
|
117
|
+
} = useCommonInjection();
|
|
118
|
+
injectValueWatchFromEmpty(() => props.value, fetchData);
|
|
119
|
+
injectValueValidate(() => props.value);
|
|
116
120
|
function focusDecorator(onFocus) {
|
|
117
121
|
return (...args) => {
|
|
118
122
|
if (isField(field.value)) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WithNull } from '../../../../../es/src/types';
|
|
1
2
|
import { ContextCollector } from '../../../../../es/packages/form-render/src/hooks/useChangeContext';
|
|
2
3
|
import { BusinessCollector, FormItemDepsCollector } from '../hooks';
|
|
3
4
|
import { FormAsyncQueue } from '../types';
|
|
@@ -8,7 +9,7 @@ export declare const InjectionBusinessCollector: InjectionKey<BusinessCollector>
|
|
|
8
9
|
export declare const InjectionChangeContextCollector: InjectionKey<ContextCollector>;
|
|
9
10
|
export declare const InjectionFormItemDepsCollector: InjectionKey<FormItemDepsCollector>;
|
|
10
11
|
export declare const InjectionFormUUID: InjectionKey<string>;
|
|
11
|
-
export declare const InjectionAnnotation: InjectionKey<WritableComputedRef<Record<string, string
|
|
12
|
+
export declare const InjectionAnnotation: InjectionKey<WritableComputedRef<WithNull<Record<string, string>>>>;
|
|
12
13
|
export declare const FormItemLineBarDepKeyPrepend = "__dep_LINEBAR_";
|
|
13
14
|
export declare enum FIELD_BUSINESS_TYPE {
|
|
14
15
|
PASSWORD = "password",
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WithUndefined } from '../../../../../es/src/types';
|
|
2
2
|
import { ISchema } from '@formily/json-schema/esm/types';
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { Ref } from 'vue';
|
|
4
|
+
import { FormItemDepsCollector, FormRenderProps } from '../../../../../es/packages/form-render';
|
|
5
|
+
export declare function useAnchor(props: Readonly<FormRenderProps>, scrollbarRef: Ref<WithUndefined<HTMLElement>>, collector: FormItemDepsCollector): {
|
|
5
6
|
currentAnchor: import("vue").WritableComputedRef<string>;
|
|
6
7
|
onScroll: () => void;
|
|
7
|
-
formHeight: import("vue").ComputedRef<
|
|
8
|
-
anchorIdList:
|
|
8
|
+
formHeight: import("vue").ComputedRef<string | undefined>;
|
|
9
|
+
anchorIdList: Ref<{
|
|
9
10
|
name: string;
|
|
10
11
|
title: string;
|
|
11
12
|
}[]>;
|
|
12
13
|
generateAnchorList: (schema: ISchema) => void;
|
|
13
|
-
scrollbarRef:
|
|
14
|
+
scrollbarRef: Ref<WithUndefined<HTMLElement>>;
|
|
14
15
|
scrollTo: (id: string) => Promise<void>;
|
|
15
16
|
};
|
|
@@ -5,7 +5,7 @@ import { ref, computed, watch, nextTick } from 'vue';
|
|
|
5
5
|
import { FormItemLineBarDepKeyPrepend } from '../../../../packages/form-render/src/constants';
|
|
6
6
|
import { createLinebarId, traverseSchema } from '../../../../packages/form-render/src/utils';
|
|
7
7
|
|
|
8
|
-
function useAnchor(props, collector) {
|
|
8
|
+
function useAnchor(props, scrollbarRef, collector) {
|
|
9
9
|
const __currentAnchor = ref("");
|
|
10
10
|
const formHeight = computed(() => {
|
|
11
11
|
if (isNumber(props.maxHeight))
|
|
@@ -22,7 +22,6 @@ function useAnchor(props, collector) {
|
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
const scrollbarRef = ref();
|
|
26
25
|
let scrollLock = false;
|
|
27
26
|
async function scrollTo(id) {
|
|
28
27
|
scrollLock = true;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import { AnyObject, WithUndefined } from '../../../../../es/src/types';
|
|
1
2
|
import { FormAsyncQueueItem } from '../types';
|
|
3
|
+
declare type ProcessorOption = Partial<{
|
|
4
|
+
afterRequest(payload?: AnyObject[]): WithUndefined<AnyObject[]> | void;
|
|
5
|
+
beforeRequest(params?: AnyObject): WithUndefined<AnyObject> | void;
|
|
6
|
+
}>;
|
|
2
7
|
interface EntryCallback {
|
|
3
8
|
(err?: any, result?: any): void;
|
|
4
9
|
}
|
|
@@ -32,7 +37,7 @@ export declare class AsyncQueue<T = any, K = any, R = any> {
|
|
|
32
37
|
private _handlerResult;
|
|
33
38
|
}
|
|
34
39
|
export declare function useAsyncQueue(): {
|
|
35
|
-
create: (parallelism?: number) => AsyncQueue<FormAsyncQueueItem, any, {
|
|
40
|
+
create: (parallelism?: number, option?: ProcessorOption) => AsyncQueue<FormAsyncQueueItem, any, {
|
|
36
41
|
label: string;
|
|
37
42
|
value: unknown;
|
|
38
43
|
}[]>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isFunction } from 'lodash-es';
|
|
1
2
|
import { useFormRequest, useCommonLog } from '../../../../packages/form-render';
|
|
2
3
|
|
|
3
4
|
class AsyncQueueEntry {
|
|
@@ -103,11 +104,12 @@ class AsyncQueue {
|
|
|
103
104
|
}
|
|
104
105
|
function useAsyncQueue() {
|
|
105
106
|
const { getHttpInstance } = useFormRequest();
|
|
106
|
-
function create(parallelism = 3) {
|
|
107
|
+
function create(parallelism = 3, option) {
|
|
107
108
|
return new AsyncQueue({
|
|
108
109
|
name: "FormRenderAsyncQueue",
|
|
109
110
|
parallelism,
|
|
110
111
|
async processor({ method = "post", params, url }, cb, removeCache) {
|
|
112
|
+
var _a, _b;
|
|
111
113
|
const http = getHttpInstance();
|
|
112
114
|
if (!http) {
|
|
113
115
|
useCommonLog().invalidHttpInstanceLog();
|
|
@@ -116,11 +118,18 @@ function useAsyncQueue() {
|
|
|
116
118
|
return;
|
|
117
119
|
}
|
|
118
120
|
try {
|
|
121
|
+
if (option && isFunction(option.beforeRequest)) {
|
|
122
|
+
params = (_a = option.beforeRequest(params)) != null ? _a : {};
|
|
123
|
+
}
|
|
119
124
|
const res = await http[method](url, params);
|
|
120
125
|
const { data, success } = res;
|
|
121
126
|
if (!success)
|
|
122
127
|
throw res;
|
|
123
|
-
|
|
128
|
+
let payload = Array.isArray(data) ? data : [];
|
|
129
|
+
if (option && isFunction(option.afterRequest)) {
|
|
130
|
+
payload = (_b = option.afterRequest(payload)) != null ? _b : [];
|
|
131
|
+
}
|
|
132
|
+
cb(void 0, payload);
|
|
124
133
|
} catch (e) {
|
|
125
134
|
cb(new Error(`Request error => ${e}`));
|
|
126
135
|
removeCache();
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Func } from '../../../../../es/src/types';
|
|
2
|
+
import { WatchSource } from '@vue/runtime-core';
|
|
3
|
+
export declare function useCommonInjection(): {
|
|
4
|
+
injectValueValidate: (traverser: WatchSource) => void;
|
|
5
|
+
injectValueWatchFromEmpty: (traverser: WatchSource, trigger: Func) => void;
|
|
6
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { isField } from '@formily/core';
|
|
2
|
+
import { watch } from 'vue';
|
|
3
|
+
import { useFormField } from '../../../../packages/form-render';
|
|
4
|
+
|
|
5
|
+
function useCommonInjection() {
|
|
6
|
+
function injectValueValidate(traverser) {
|
|
7
|
+
const { field } = useFormField();
|
|
8
|
+
watch(traverser, () => {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
return isField(field.value) && field.value.visited && ((_b = (_a = field.value).validate) == null ? void 0 : _b.call(_a));
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function injectValueWatchFromEmpty(traverser, trigger) {
|
|
14
|
+
watch(traverser, (n, o) => n != null && o == null && trigger(), { immediate: true });
|
|
15
|
+
}
|
|
16
|
+
return { injectValueValidate, injectValueWatchFromEmpty };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { useCommonInjection };
|
|
@@ -44,16 +44,14 @@ function useFieldListAdaptor(collector, uuid) {
|
|
|
44
44
|
const createInputSchema = (item) => {
|
|
45
45
|
const schema = createStandardSchema(item);
|
|
46
46
|
Object.assign(schema["x-component-props"], {
|
|
47
|
-
|
|
48
|
-
suffix: item.suffix
|
|
47
|
+
...pick(item, ["prefix", "suffix"])
|
|
49
48
|
});
|
|
50
49
|
return schema;
|
|
51
50
|
};
|
|
52
51
|
const createSelectSchema = (item) => {
|
|
53
52
|
const schema = createStandardSchema(item);
|
|
54
53
|
Object.assign(schema["x-component-props"], {
|
|
55
|
-
|
|
56
|
-
options: item.option,
|
|
54
|
+
...pick(item, ["lazyRequest", "urlConfig", "option"]),
|
|
57
55
|
multiple: item.multi_select === "0",
|
|
58
56
|
maxTagCount: +item.multi_select_value
|
|
59
57
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ShallowReactive } from 'vue';
|
|
2
|
-
import {
|
|
3
|
-
export declare function useFormContext(props: ShallowReactive<
|
|
2
|
+
import { FormRenderProps } from '../../../../../es/packages/form-render';
|
|
3
|
+
export declare function useFormContext(props: ShallowReactive<FormRenderProps>): {
|
|
4
4
|
asyncQueue: import("../../../../../es/packages/form-render").FormAsyncQueue;
|
|
5
5
|
SchemaField: import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
|
|
6
6
|
businessCollector: import("../../../../../es/packages/form-render").BusinessCollector;
|
|
7
7
|
changeContextCollector: import("../../../../../es/packages/form-render").ContextCollector;
|
|
8
8
|
formItemDepsCollector: import("../../../../../es/packages/form-render").FormItemDepsCollector;
|
|
9
|
-
formUUID:
|
|
9
|
+
formUUID: string;
|
|
10
10
|
};
|
|
@@ -1,14 +1,26 @@
|
|
|
1
|
-
import { isObject } from '
|
|
1
|
+
import { isObject } from '@vue/shared';
|
|
2
|
+
import { cloneDeep } from 'lodash-es';
|
|
2
3
|
import { provide, computed, readonly } from 'vue';
|
|
3
4
|
import { createSchemaField } from '@formily/vue';
|
|
4
5
|
import { useAsyncQueue, useBusinessBinding, useChangeContext, useFormItemDeps } from '../../../../packages/form-render';
|
|
5
6
|
import * as components from '../../../../packages/form-render/src/components/renderer';
|
|
7
|
+
import { useFormRenderLifeCycle } from '../../../../packages/form-render/src/hooks/useFormRenderLifeCycle';
|
|
6
8
|
import { usePresetScope } from '../../../../packages/form-render/src/hooks/usePresetScope';
|
|
7
9
|
import { injectOrProvide, uuidGenerator } from '../../../../packages/form-render/src/utils';
|
|
8
10
|
import { InjectAsyncQueue, InjectionSchemaField, InjectionBusinessCollector, InjectionChangeContextCollector, InjectionFormItemDepsCollector, InjectionFormUUID, InjectionAnnotation } from '../../../../packages/form-render/src/constants';
|
|
9
11
|
|
|
10
12
|
function useFormContext(props) {
|
|
11
|
-
const
|
|
13
|
+
const { callLifeCycle } = useFormRenderLifeCycle(props);
|
|
14
|
+
const asyncQueue = injectOrProvide(InjectAsyncQueue, () => useAsyncQueue().create(props.parallelism, {
|
|
15
|
+
beforeRequest(params) {
|
|
16
|
+
var _a;
|
|
17
|
+
return (_a = callLifeCycle("beforeRequest", [cloneDeep(params)])) != null ? _a : params;
|
|
18
|
+
},
|
|
19
|
+
afterRequest(payload) {
|
|
20
|
+
var _a;
|
|
21
|
+
return (_a = callLifeCycle("afterRequest", [payload])) != null ? _a : payload;
|
|
22
|
+
}
|
|
23
|
+
}));
|
|
12
24
|
const SchemaField = injectOrProvide(InjectionSchemaField, () => createSchemaField({
|
|
13
25
|
components: {
|
|
14
26
|
...components,
|
|
@@ -29,7 +41,7 @@ function useFormContext(props) {
|
|
|
29
41
|
return props.annotation ? readonly(props.annotation) : null;
|
|
30
42
|
},
|
|
31
43
|
set(payload) {
|
|
32
|
-
if (!isObject(props.annotation))
|
|
44
|
+
if (!isObject(props.annotation) || !isObject(payload))
|
|
33
45
|
return;
|
|
34
46
|
props.annotation[payload.property] = payload.value;
|
|
35
47
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { WithUndefined } from '../../../../../es/src/types';
|
|
2
|
+
import { FormRenderLifeCycle, FormRenderProps } from '../../../../../es/packages/form-render';
|
|
3
|
+
export declare function useFormRenderLifeCycle(props: FormRenderProps): {
|
|
4
|
+
callLifeCycle: <T extends "onSetup" | "beforeRequest" | "afterRequest">(lifeCycleName: T, payload?: Parameters<Required<Partial<{
|
|
5
|
+
onSetup(): void;
|
|
6
|
+
beforeRequest(params?: import("../../../../../es/src/types").AnyObject | undefined): void | WithUndefined<import("../../../../../es/src/types").AnyObject>;
|
|
7
|
+
afterRequest(payload?: import("../../../../../es/src/types").AnyObject[] | undefined): void | WithUndefined<import("../../../../../es/src/types").AnyObject[]>;
|
|
8
|
+
}>>[T]> | undefined) => WithUndefined<ReturnType<Required<Partial<{
|
|
9
|
+
onSetup(): void;
|
|
10
|
+
beforeRequest(params?: import("../../../../../es/src/types").AnyObject | undefined): void | WithUndefined<import("../../../../../es/src/types").AnyObject>;
|
|
11
|
+
afterRequest(payload?: import("../../../../../es/src/types").AnyObject[] | undefined): void | WithUndefined<import("../../../../../es/src/types").AnyObject[]>;
|
|
12
|
+
}>>[T]>>;
|
|
13
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { isFunction } from 'lodash-es';
|
|
2
|
+
|
|
3
|
+
function useFormRenderLifeCycle(props) {
|
|
4
|
+
function callLifeCycle(lifeCycleName, payload) {
|
|
5
|
+
return props.lifeCycle && isFunction(props.lifeCycle[lifeCycleName]) && props.lifeCycle[lifeCycleName].apply(void 0, payload || []);
|
|
6
|
+
}
|
|
7
|
+
return { callLifeCycle };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { useFormRenderLifeCycle };
|
|
@@ -156,6 +156,10 @@ export declare type FieldItem = {
|
|
|
156
156
|
* BUTTON/TEXT控件内容
|
|
157
157
|
*/
|
|
158
158
|
content: string | FormRenderer | Record<string, FormRenderer>;
|
|
159
|
+
/**
|
|
160
|
+
* 假使控件需要发送请求, 用于控制是否只在需要的时候发送请求
|
|
161
|
+
*/
|
|
162
|
+
lazyRequest: boolean;
|
|
159
163
|
/**
|
|
160
164
|
* COMBINATION控件最大表单组数量
|
|
161
165
|
*/
|
|
@@ -176,6 +180,10 @@ export declare type FieldItem = {
|
|
|
176
180
|
* FormItem额外的props
|
|
177
181
|
*/
|
|
178
182
|
decoratorProps: AnyObject;
|
|
183
|
+
/**
|
|
184
|
+
* 是否不使用decorator组件(n-form-item)
|
|
185
|
+
*/
|
|
186
|
+
noDecorator: Boolean;
|
|
179
187
|
/**
|
|
180
188
|
* COMPLEX控件布局类型
|
|
181
189
|
*/
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { AnyObject, ArrayAble } from '../../../../../es/src/types';
|
|
1
|
+
import { AnyObject, ArrayAble, WithUndefined } from '../../../../../es/src/types';
|
|
2
2
|
import { DataField, Field } from '@formily/core';
|
|
3
|
+
import { ISchema } from '@formily/json-schema/esm/types';
|
|
4
|
+
import { Component, FunctionalComponent } from 'vue';
|
|
3
5
|
import { FIELD_BUSINESS_TYPE } from '../../../../../es/packages/form-render/src/constants';
|
|
4
6
|
import { FieldItem } from '../types';
|
|
5
7
|
import { AsyncQueue } from '../hooks';
|
|
@@ -50,3 +52,25 @@ export declare type FormBusinessFilter = (payload: {
|
|
|
50
52
|
context?: any;
|
|
51
53
|
}) => unknown;
|
|
52
54
|
export declare type DependKeyType = ArrayAble<string> | Record<string, string> | ArrayAble<Record<'paramName' | 'paramValue', string>>;
|
|
55
|
+
export declare type FormRenderLifeCycle = Partial<{
|
|
56
|
+
onSetup(): void;
|
|
57
|
+
beforeRequest(params?: AnyObject): WithUndefined<AnyObject> | void;
|
|
58
|
+
afterRequest(payload?: AnyObject[]): WithUndefined<AnyObject[]> | void;
|
|
59
|
+
}>;
|
|
60
|
+
export declare type FormRenderProps = Partial<{
|
|
61
|
+
fieldList: FieldItem[];
|
|
62
|
+
initialData: AnyObject;
|
|
63
|
+
fieldVisitor: FieldVisitor;
|
|
64
|
+
column: number;
|
|
65
|
+
maxHeight: number | string;
|
|
66
|
+
anchor: boolean;
|
|
67
|
+
parallelism: number;
|
|
68
|
+
schema: ISchema;
|
|
69
|
+
components: Record<string, Component | FunctionalComponent>;
|
|
70
|
+
businessFilter: FormBusinessFilter;
|
|
71
|
+
scope: AnyObject;
|
|
72
|
+
annotation: AnyObject;
|
|
73
|
+
consumer: boolean;
|
|
74
|
+
uuid: string;
|
|
75
|
+
lifeCycle: FormRenderLifeCycle;
|
|
76
|
+
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyObject, ArrayAble } from '../../../../../es/src/types';
|
|
1
|
+
import { AnyObject, ArrayAble, WithNull } from '../../../../../es/src/types';
|
|
2
2
|
import { ISchema } from '@formily/json-schema/esm/types';
|
|
3
3
|
import { GeneralField } from '@formily/core';
|
|
4
4
|
import { FunctionalComponent, InjectionKey, VNode } from 'vue';
|
|
@@ -24,11 +24,11 @@ export declare function createSlot(renderer: unknown, props: AnyObject): Record<
|
|
|
24
24
|
default(): any;
|
|
25
25
|
};
|
|
26
26
|
export declare function queryDecorator(key: string, wrapperElement: HTMLElement, formUUID: string): HTMLElement | null;
|
|
27
|
-
export declare function queryInput(decoratorElement?: HTMLElement
|
|
27
|
+
export declare function queryInput(decoratorElement?: WithNull<HTMLElement>): {
|
|
28
28
|
widgetElement: HTMLInputElement | null | undefined;
|
|
29
29
|
widgetElementList: HTMLInputElement[];
|
|
30
30
|
};
|
|
31
|
-
export declare function getParentLinebar(key: string, fieldList: FieldItem[]): string
|
|
31
|
+
export declare function getParentLinebar(key: string, fieldList: FieldItem[]): WithNull<string>;
|
|
32
32
|
export declare function elementIdEscape(id: string): string;
|
|
33
33
|
export declare function createLinebarId(id: string): string;
|
|
34
34
|
export declare function fieldKeyEscape(fieldList: FieldItem[]): string;
|
|
@@ -3,10 +3,7 @@ import { isObject } from '@vue/shared';
|
|
|
3
3
|
import { isArray, isString, isFunction } from 'lodash-es';
|
|
4
4
|
import { FIELD_SEX_VALUE } from '../constants/index.js';
|
|
5
5
|
import { isField } from '@formily/core';
|
|
6
|
-
import differenceInDays from '
|
|
7
|
-
import differenceInMonths from '../../../../node_modules/date-fns/esm/differenceInMonths/index.js';
|
|
8
|
-
import differenceInYears from '../../../../node_modules/date-fns/esm/differenceInYears/index.js';
|
|
9
|
-
import '../../../../node_modules/date-fns/esm/parse/_lib/parsers/index.js';
|
|
6
|
+
import { differenceInDays, differenceInMonths, differenceInYears } from 'date-fns';
|
|
10
7
|
|
|
11
8
|
function formRenderLog(message, type = "log") {
|
|
12
9
|
console[type](`[FormRender]: ${message}`);
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
.form-render__formItem {
|
|
26
26
|
grid-column: span var(--form-item-column) / span var(--form-item-column);
|
|
27
27
|
}
|
|
28
|
-
.form-render__formItem .n-date-picker
|
|
28
|
+
.form-render__formItem .n-date-picker,
|
|
29
|
+
.form-render__formItem .n-input-number {
|
|
29
30
|
width: 100%;
|
|
30
31
|
}
|
|
31
32
|
.form-render__formItemLabel {
|
|
@@ -42,6 +43,15 @@
|
|
|
42
43
|
transform: translateY(-50%);
|
|
43
44
|
right: calc(var(--icon-right) * 1px);
|
|
44
45
|
}
|
|
46
|
+
.form-render__formItem .n-form-item-label {
|
|
47
|
+
display: inline-flex;
|
|
48
|
+
}
|
|
49
|
+
.form-render__formItem .n-form-item-label [annotation-hover-show='true'] {
|
|
50
|
+
visibility: hidden;
|
|
51
|
+
}
|
|
52
|
+
.form-render__formItem .n-form-item-label:hover [annotation-hover-show='true'] {
|
|
53
|
+
visibility: visible;
|
|
54
|
+
}
|
|
45
55
|
.form-render__linebar {
|
|
46
56
|
grid-column: span var(--column) / span var(--column);
|
|
47
57
|
}
|
|
@@ -131,12 +141,3 @@
|
|
|
131
141
|
display: flex !important;
|
|
132
142
|
gap: 0 8px;
|
|
133
143
|
}
|
|
134
|
-
.form-render .n-form-item-label {
|
|
135
|
-
display: inline-flex;
|
|
136
|
-
}
|
|
137
|
-
.form-render .n-form-item-label [annotation-hover-show='true'] {
|
|
138
|
-
visibility: hidden;
|
|
139
|
-
}
|
|
140
|
-
.form-render .n-form-item-label:hover [annotation-hover-show='true'] {
|
|
141
|
-
visibility: visible;
|
|
142
|
-
}
|