amis-editor 4.2.0-beta.3 → 5.1.8
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/6dbcbb49b6fd405190a9.png +0 -0
- package/dist/component/Editor.d.ts +16 -0
- package/dist/component/RegionWrapper.d.ts +10 -0
- package/dist/component/ScaffoldModal.d.ts +1 -1
- package/dist/component/VRenderer.d.ts +10 -0
- package/dist/component/control/APIControl.d.ts +1158 -0
- package/dist/component/control/ActionAPIControl.d.ts +1158 -0
- package/dist/component/control/BadgeControl.d.ts +133 -0
- package/dist/component/control/BaseControl.d.ts +248 -0
- package/dist/component/control/DataBindingControl.d.ts +14 -0
- package/dist/component/control/DataPickerControl.d.ts +13 -0
- package/dist/component/control/DateShortCutControl.d.ts +83 -0
- package/dist/component/control/FormulaControl.d.ts +51 -0
- package/dist/component/{Control → control}/OptionControl.d.ts +23 -34
- package/dist/component/{Control → control}/PopoverEdit.d.ts +0 -0
- package/dist/component/control/StatusControl.d.ts +39 -0
- package/dist/component/control/SwitchMoreControl.d.ts +224 -0
- package/dist/component/control/ValidationControl.d.ts +65 -0
- package/dist/component/control/ValidationItem.d.ts +46 -0
- package/dist/component/control/style-control/Background.d.ts +17 -0
- package/dist/component/control/style-control/Border.d.ts +18 -0
- package/dist/component/control/style-control/BoxModel.d.ts +17 -0
- package/dist/component/control/style-control/BoxShadow.d.ts +18 -0
- package/dist/component/control/style-control/Display.d.ts +14 -0
- package/dist/component/control/style-control/Font.d.ts +16 -0
- package/dist/component/control/style-control/font-family.d.ts +11 -0
- package/dist/component/control/style-control/transformation.d.ts +29 -0
- package/dist/component/control/style-control/types.d.ts +8 -0
- package/dist/component/schemaTpl.d.ts +8 -0
- package/dist/component/validator.d.ts +62 -0
- package/dist/dnd/index.d.ts +1 -1
- package/dist/event-action/action-config-panel.d.ts +8 -0
- package/dist/event-action/actions.d.ts +3 -0
- package/dist/event-action/comp-action-select.d.ts +11 -0
- package/dist/event-action/config.d.ts +13 -0
- package/dist/event-action/index.d.ts +459 -0
- package/dist/event-action/schema.d.ts +32 -0
- package/dist/exports.min.js +1 -1
- package/dist/index.d.ts +23 -5
- package/dist/index.min.js +1 -1
- package/dist/manager.d.ts +46 -1
- package/dist/plugin/Alert.d.ts +4 -2
- package/dist/plugin/Button.d.ts +5 -1
- package/dist/plugin/ButtonGroup.d.ts +13 -34
- package/dist/plugin/ButtonToolbar.d.ts +4 -10
- package/dist/plugin/CRUD.d.ts +2 -0
- package/dist/plugin/Chart.d.ts +2 -0
- package/dist/plugin/Collapse.d.ts +1 -0
- package/dist/plugin/CollapseGroup.d.ts +28 -4
- package/dist/plugin/Container.d.ts +2 -1
- package/dist/plugin/Dialog.d.ts +12 -2
- package/dist/plugin/Drawer.d.ts +12 -2
- package/dist/plugin/DropDownButton.d.ts +11 -11
- package/dist/plugin/Form/ButtonGroupSelect.d.ts +7 -2
- package/dist/plugin/Form/ButtonToolbar.d.ts +8 -7
- package/dist/plugin/Form/ChainedSelect.d.ts +3 -0
- package/dist/plugin/Form/Checkbox.d.ts +7 -2
- package/dist/plugin/Form/Checkboxes.d.ts +8 -2
- package/dist/plugin/Form/CodeEditor.d.ts +7 -22
- package/dist/plugin/Form/Combo.d.ts +3 -0
- package/dist/plugin/Form/Control.d.ts +6 -2
- package/dist/plugin/Form/DiffEditor.d.ts +7 -1
- package/dist/plugin/Form/Form.d.ts +6 -0
- package/dist/plugin/Form/Formula.d.ts +1 -25
- package/dist/plugin/Form/InputDate.d.ts +8 -2
- package/dist/plugin/Form/InputDateRange.d.ts +8 -2
- package/dist/plugin/Form/InputDateTime.d.ts +4 -4
- package/dist/plugin/Form/InputDateTimeRange.d.ts +4 -4
- package/dist/plugin/Form/InputEmail.d.ts +1 -0
- package/dist/plugin/Form/InputExcel.d.ts +6 -41
- package/dist/plugin/Form/InputFile.d.ts +7 -3
- package/dist/plugin/Form/InputKV.d.ts +6 -0
- package/dist/plugin/Form/InputMonth.d.ts +1 -0
- package/dist/plugin/Form/InputMonthRange.d.ts +4 -4
- package/dist/plugin/Form/InputPassword.d.ts +1 -0
- package/dist/plugin/Form/InputQuarter.d.ts +1 -0
- package/dist/plugin/Form/InputQuarterRange.d.ts +4 -4
- package/dist/plugin/Form/InputRange.d.ts +3 -0
- package/dist/plugin/Form/InputRating.d.ts +9 -3
- package/dist/plugin/Form/InputText.d.ts +24 -2
- package/dist/plugin/Form/InputTime.d.ts +3 -3
- package/dist/plugin/Form/InputTimeRange.d.ts +20 -0
- package/dist/plugin/Form/InputTree.d.ts +6 -2
- package/dist/plugin/Form/InputURL.d.ts +1 -0
- package/dist/plugin/Form/InputYear.d.ts +1 -0
- package/dist/plugin/Form/InputYearRange.d.ts +20 -0
- package/dist/plugin/Form/ListSelect.d.ts +6 -2
- package/dist/plugin/Form/LocationPicker.d.ts +1 -31
- package/dist/plugin/Form/NestedSelect.d.ts +5 -2
- package/dist/plugin/Form/Radios.d.ts +7 -2
- package/dist/plugin/Form/Select.d.ts +7 -2
- package/dist/plugin/Form/Switch.d.ts +7 -2
- package/dist/plugin/Form/TabsTransfer.d.ts +5 -2
- package/dist/plugin/Form/Textarea.d.ts +7 -1
- package/dist/plugin/Form/Transfer.d.ts +5 -2
- package/dist/plugin/Form/TreeSelect.d.ts +6 -2
- package/dist/plugin/IFrame.d.ts +2 -2
- package/dist/plugin/Nav.d.ts +1 -116
- package/dist/plugin/Others/Action.d.ts +5 -1
- package/dist/plugin/Page.d.ts +5 -2
- package/dist/plugin/Progress.d.ts +5 -1
- package/dist/plugin/Table.d.ts +2 -0
- package/dist/plugin/Tabs.d.ts +33 -2
- package/dist/plugin/TooltipWrapper.d.ts +10 -0
- package/dist/plugin/Tpl.d.ts +2 -1
- package/dist/plugin/Wizard.d.ts +4 -1
- package/dist/plugin.d.ts +37 -1
- package/dist/store/editor.d.ts +55 -28
- package/dist/store/node.d.ts +16 -0
- package/dist/style.css +1 -1
- package/dist/util.d.ts +36 -3
- package/package.json +14 -8
- package/src/component/schemaTpl.tsx +1198 -474
- package/src/plugin/.DS_Store +0 -0
- package/src/plugin/Alert.tsx +69 -48
- package/src/plugin/AnchorNav.tsx +1 -0
- package/src/plugin/Audio.tsx +9 -15
- package/src/plugin/Avatar.tsx +2 -1
- package/src/plugin/Breadcrumb.tsx +2 -1
- package/src/plugin/Button.tsx +257 -188
- package/src/plugin/ButtonGroup.tsx +99 -38
- package/src/plugin/ButtonToolbar.tsx +7 -13
- package/src/plugin/CRUD.tsx +77 -135
- package/src/plugin/Card.tsx +1 -0
- package/src/plugin/Cards.tsx +8 -14
- package/src/plugin/Carousel.tsx +1 -1
- package/src/plugin/Chart.tsx +26 -14
- package/src/plugin/Collapse.tsx +78 -78
- package/src/plugin/CollapseGroup.tsx +165 -83
- package/src/plugin/Container.tsx +59 -6
- package/src/plugin/Custom.tsx +2 -8
- package/src/plugin/CustomRegion.tsx +4 -3
- package/src/plugin/Dialog.tsx +55 -24
- package/src/plugin/Drawer.tsx +65 -35
- package/src/plugin/DropDownButton.tsx +95 -79
- package/src/plugin/Flex.tsx +123 -65
- package/src/plugin/Form/ButtonGroupSelect.tsx +114 -26
- package/src/plugin/Form/ButtonToolbar.tsx +62 -55
- package/src/plugin/Form/ChainedSelect.tsx +45 -0
- package/src/plugin/Form/Checkbox.tsx +122 -33
- package/src/plugin/Form/Checkboxes.tsx +154 -87
- package/src/plugin/Form/CodeEditor.tsx +163 -34
- package/src/plugin/Form/Combo.tsx +104 -65
- package/src/plugin/Form/Control.tsx +16 -70
- package/src/plugin/Form/DiffEditor.tsx +158 -54
- package/src/plugin/Form/FieldSet.tsx +6 -11
- package/src/plugin/Form/Form.tsx +277 -70
- package/src/plugin/Form/Formula.tsx +8 -14
- package/src/plugin/Form/InputArray.tsx +7 -16
- package/src/plugin/Form/InputCity.tsx +1 -1
- package/src/plugin/Form/InputDate.tsx +344 -121
- package/src/plugin/Form/InputDateRange.tsx +303 -161
- package/src/plugin/Form/InputDateTime.tsx +6 -150
- package/src/plugin/Form/InputDateTimeRange.tsx +7 -187
- package/src/plugin/Form/InputEmail.tsx +1 -0
- package/src/plugin/Form/InputExcel.tsx +70 -27
- package/src/plugin/Form/InputFile.tsx +326 -152
- package/src/plugin/Form/InputImage.tsx +1 -1
- package/src/plugin/Form/InputKV.tsx +61 -0
- package/src/plugin/Form/InputMonth.tsx +3 -1
- package/src/plugin/Form/InputMonthRange.tsx +6 -160
- package/src/plugin/Form/InputNumber.tsx +1 -1
- package/src/plugin/Form/InputPassword.tsx +2 -0
- package/src/plugin/Form/InputQuarter.tsx +3 -1
- package/src/plugin/Form/InputQuarterRange.tsx +6 -160
- package/src/plugin/Form/InputRange.tsx +74 -4
- package/src/plugin/Form/InputRating.tsx +347 -35
- package/src/plugin/Form/InputRichText.tsx +2 -3
- package/src/plugin/Form/InputTable.tsx +33 -49
- package/src/plugin/Form/InputTag.tsx +1 -1
- package/src/plugin/Form/InputText.tsx +310 -132
- package/src/plugin/Form/InputTime.tsx +4 -53
- package/src/plugin/Form/InputTimeRange.tsx +41 -0
- package/src/plugin/Form/InputTree.tsx +196 -46
- package/src/plugin/Form/InputURL.tsx +2 -0
- package/src/plugin/Form/InputYear.tsx +2 -0
- package/src/plugin/Form/InputYearRange.tsx +41 -0
- package/src/plugin/Form/Item.tsx +17 -18
- package/src/plugin/Form/ListSelect.tsx +75 -20
- package/src/plugin/Form/LocationPicker.tsx +2 -7
- package/src/plugin/Form/MatrixCheckboxes.tsx +1 -1
- package/src/plugin/Form/NestedSelect.tsx +110 -43
- package/src/plugin/Form/Picker.tsx +2 -5
- package/src/plugin/Form/Radios.tsx +122 -52
- package/src/plugin/Form/Select.tsx +239 -168
- package/src/plugin/Form/Static.tsx +1 -1
- package/src/plugin/Form/Switch.tsx +170 -58
- package/src/plugin/Form/TabsTransfer.tsx +175 -79
- package/src/plugin/Form/Textarea.tsx +146 -36
- package/src/plugin/Form/Transfer.tsx +295 -233
- package/src/plugin/Form/TreeSelect.tsx +287 -146
- package/src/plugin/Grid.tsx +340 -312
- package/src/plugin/HBox.tsx +1 -0
- package/src/plugin/IFrame.tsx +21 -12
- package/src/plugin/Image.tsx +7 -12
- package/src/plugin/Images.tsx +7 -12
- package/src/plugin/Link.tsx +6 -12
- package/src/plugin/List.tsx +6 -10
- package/src/plugin/ListItem.tsx +1 -0
- package/src/plugin/Nav.tsx +7 -9
- package/src/plugin/Others/Action.tsx +16 -10
- package/src/plugin/Others/BasicToolbar.tsx +4 -1
- package/src/plugin/Others/TableCell.tsx +19 -39
- package/src/plugin/Page.tsx +315 -229
- package/src/plugin/Panel.tsx +6 -7
- package/src/plugin/Plain.tsx +3 -6
- package/src/plugin/Progress.tsx +234 -94
- package/src/plugin/Service.tsx +10 -6
- package/src/plugin/Table.tsx +49 -20
- package/src/plugin/TableView.tsx +212 -106
- package/src/plugin/Tabs.tsx +306 -146
- package/src/plugin/TooltipWrapper.tsx +231 -135
- package/src/plugin/Tpl.tsx +68 -52
- package/src/plugin/Video.tsx +9 -20
- package/src/plugin/Wizard.tsx +537 -336
- package/src/plugin/Wrapper.tsx +82 -61
- package/src/plugin.ts +66 -4
- package/static/empty.png +0 -0
- package/dist/component/Control/APIControl.d.ts +0 -504
- package/dist/component/Control/ValidationControl.d.ts +0 -30
- package/dist/component/remarkTpl.d.ts +0 -150
@@ -1,18 +1,8 @@
|
|
1
|
-
import {relativeValueRe} from 'amis';
|
2
|
-
import {
|
3
|
-
defaultValue,
|
4
|
-
getSchemaTpl,
|
5
|
-
valuePipeOut
|
6
|
-
} from '../../component/schemaTpl';
|
7
1
|
import {registerEditorPlugin} from '../../manager';
|
8
|
-
import {
|
9
|
-
BasePlugin,
|
10
|
-
BasicSubRenderInfo,
|
11
|
-
RendererEventContext,
|
12
|
-
SubRendererInfo
|
13
|
-
} from '../../plugin';
|
14
2
|
|
15
|
-
|
3
|
+
import {DateRangeControlPlugin} from './InputDateRange';
|
4
|
+
|
5
|
+
export class MonthRangeControlPlugin extends DateRangeControlPlugin {
|
16
6
|
// 关联渲染器名字
|
17
7
|
rendererName = 'input-month-range';
|
18
8
|
$schema = '/schemas/MonthRangeControlSchema.json';
|
@@ -29,7 +19,7 @@ export class MonthRangeControlPlugin extends BasePlugin {
|
|
29
19
|
tags = ['表单项'];
|
30
20
|
scaffold = {
|
31
21
|
type: 'input-month-range',
|
32
|
-
label: '
|
22
|
+
label: '日期范围',
|
33
23
|
name: 'month-range'
|
34
24
|
};
|
35
25
|
previewSchema: any = {
|
@@ -44,152 +34,8 @@ export class MonthRangeControlPlugin extends BasePlugin {
|
|
44
34
|
]
|
45
35
|
};
|
46
36
|
|
47
|
-
|
48
|
-
|
49
|
-
getSchemaTpl('placeholder', {
|
50
|
-
pipeIn: defaultValue('请选择月份范围')
|
51
|
-
}),
|
52
|
-
|
53
|
-
{
|
54
|
-
type: 'input-text',
|
55
|
-
name: 'format',
|
56
|
-
label: '值格式',
|
57
|
-
description:
|
58
|
-
'请参考 <a href="https://momentjs.com/" target="_blank">moment</a> 中的格式用法。',
|
59
|
-
pipeIn: defaultValue('X')
|
60
|
-
},
|
61
|
-
|
62
|
-
getSchemaTpl('switchDefaultValue'),
|
63
|
-
|
64
|
-
{
|
65
|
-
type: 'input-text',
|
66
|
-
name: 'value',
|
67
|
-
label: '默认值',
|
68
|
-
visibleOn: 'typeof this.value !== "undefined"',
|
69
|
-
placeholder: '请输入相对值',
|
70
|
-
description:
|
71
|
-
'支持 <code>now、+1day、-2weeks</code>这种相对值用法,由于包含开始和结束时间,请用逗号隔开。'
|
72
|
-
},
|
73
|
-
|
74
|
-
{
|
75
|
-
type: 'fieldSet',
|
76
|
-
title: '使用固定值',
|
77
|
-
visibleOn: 'typeof this.value !== "undefined"',
|
78
|
-
collapsed: true,
|
79
|
-
collapsable: true,
|
80
|
-
className: 'fieldset',
|
81
|
-
body: [
|
82
|
-
{
|
83
|
-
type: 'input-month-range',
|
84
|
-
name: 'value',
|
85
|
-
pipeIn: (value: any) =>
|
86
|
-
value
|
87
|
-
? value
|
88
|
-
.split(',')
|
89
|
-
.map((item: any) =>
|
90
|
-
relativeValueRe.test(item) ||
|
91
|
-
~['now', 'today'].indexOf(item)
|
92
|
-
? ''
|
93
|
-
: item
|
94
|
-
)
|
95
|
-
: ''
|
96
|
-
}
|
97
|
-
]
|
98
|
-
},
|
99
|
-
getSchemaTpl('clearable', {
|
100
|
-
pipeIn: defaultValue(true)
|
101
|
-
}),
|
102
|
-
{
|
103
|
-
type: 'input-text',
|
104
|
-
name: 'minDate',
|
105
|
-
label: '最小日期',
|
106
|
-
placeholder: '请输入相对值',
|
107
|
-
description:
|
108
|
-
'支持 <code>now、+1day、-2weeks</code>这种相对值用法,同时支持变量如<code>\\${start_date}</code>'
|
109
|
-
},
|
110
|
-
|
111
|
-
{
|
112
|
-
type: 'fieldSet',
|
113
|
-
title: '使用固定值',
|
114
|
-
collapsed: true,
|
115
|
-
collapsable: true,
|
116
|
-
className: 'fieldset',
|
117
|
-
body: [
|
118
|
-
{
|
119
|
-
type: 'input-date',
|
120
|
-
name: 'minDate',
|
121
|
-
pipeIn: (value: any) =>
|
122
|
-
relativeValueRe.test(value) || ~['now', 'today'].indexOf(value)
|
123
|
-
? ''
|
124
|
-
: value
|
125
|
-
}
|
126
|
-
]
|
127
|
-
},
|
128
|
-
|
129
|
-
{
|
130
|
-
type: 'divider'
|
131
|
-
},
|
132
|
-
|
133
|
-
{
|
134
|
-
type: 'input-text',
|
135
|
-
name: 'maxDate',
|
136
|
-
label: '最大日期',
|
137
|
-
placeholder: '请输入相对值',
|
138
|
-
description:
|
139
|
-
'支持 <code>now、+1day、-2weeks</code>这种相对值用法,同时支持变量如<code>\\${start_date}</code>'
|
140
|
-
},
|
141
|
-
|
142
|
-
{
|
143
|
-
type: 'fieldSet',
|
144
|
-
title: '使用固定值',
|
145
|
-
collapsed: true,
|
146
|
-
collapsable: true,
|
147
|
-
className: 'fieldset',
|
148
|
-
body: [
|
149
|
-
{
|
150
|
-
type: 'input-date',
|
151
|
-
name: 'maxDate',
|
152
|
-
pipeIn: (value: any) =>
|
153
|
-
relativeValueRe.test(value) || ~['now', 'today'].indexOf(value)
|
154
|
-
? ''
|
155
|
-
: value
|
156
|
-
}
|
157
|
-
]
|
158
|
-
},
|
159
|
-
{
|
160
|
-
type: 'input-text',
|
161
|
-
name: 'minDuration',
|
162
|
-
label: '限制最小跨度',
|
163
|
-
description: '比如 2days'
|
164
|
-
},
|
165
|
-
{
|
166
|
-
type: 'input-text',
|
167
|
-
name: 'maxDuration',
|
168
|
-
label: '限制最大跨度',
|
169
|
-
description: '比如 1year'
|
170
|
-
},
|
171
|
-
{
|
172
|
-
name: 'utc',
|
173
|
-
label: '是否使用 UTC 时间',
|
174
|
-
type: 'switch',
|
175
|
-
mode: 'inline',
|
176
|
-
className: 'block'
|
177
|
-
},
|
178
|
-
{
|
179
|
-
name: 'clearable',
|
180
|
-
label: '是否可清除',
|
181
|
-
type: 'switch',
|
182
|
-
mode: 'inline',
|
183
|
-
className: 'block'
|
184
|
-
},
|
185
|
-
{
|
186
|
-
name: 'embed',
|
187
|
-
label: '是否内嵌模式',
|
188
|
-
type: 'switch',
|
189
|
-
mode: 'inline',
|
190
|
-
className: 'block'
|
191
|
-
}
|
192
|
-
];
|
37
|
+
disabledRendererPlugin = true;
|
38
|
+
notRenderFormZone = true;
|
193
39
|
}
|
194
40
|
|
195
41
|
registerEditorPlugin(MonthRangeControlPlugin);
|
@@ -8,7 +8,7 @@ export class InputQuarterPlugin extends DateControlPlugin {
|
|
8
8
|
$schema = '/schemas/QuarterControlSchema.json';
|
9
9
|
|
10
10
|
// 组件名称
|
11
|
-
name = '
|
11
|
+
name = '季度';
|
12
12
|
isBaseComponent = true;
|
13
13
|
icon = 'fa fa-calendar';
|
14
14
|
description = `季度选择`;
|
@@ -19,6 +19,8 @@ export class InputQuarterPlugin extends DateControlPlugin {
|
|
19
19
|
type: 'input-quarter',
|
20
20
|
name: 'month'
|
21
21
|
};
|
22
|
+
|
23
|
+
disabledRendererPlugin = true;
|
22
24
|
previewSchema: any = {
|
23
25
|
type: 'form',
|
24
26
|
wrapWithPanel: false,
|
@@ -1,18 +1,8 @@
|
|
1
|
-
import {relativeValueRe} from 'amis';
|
2
|
-
import {
|
3
|
-
defaultValue,
|
4
|
-
getSchemaTpl,
|
5
|
-
valuePipeOut
|
6
|
-
} from '../../component/schemaTpl';
|
7
1
|
import {registerEditorPlugin} from '../../manager';
|
8
|
-
import {
|
9
|
-
BasePlugin,
|
10
|
-
BasicSubRenderInfo,
|
11
|
-
RendererEventContext,
|
12
|
-
SubRendererInfo
|
13
|
-
} from '../../plugin';
|
14
2
|
|
15
|
-
|
3
|
+
import {DateRangeControlPlugin} from './InputDateRange';
|
4
|
+
|
5
|
+
export class QuarterRangePlugin extends DateRangeControlPlugin {
|
16
6
|
// 关联渲染器名字
|
17
7
|
rendererName = 'input-quarter-range';
|
18
8
|
$schema = '/schemas/MonthRangeControlSchema.json';
|
@@ -29,7 +19,7 @@ export class QuarterRangePlugin extends BasePlugin {
|
|
29
19
|
tags = ['表单项'];
|
30
20
|
scaffold = {
|
31
21
|
type: 'input-quarter-range',
|
32
|
-
label: '
|
22
|
+
label: '日期范围',
|
33
23
|
name: 'quarter-range'
|
34
24
|
};
|
35
25
|
previewSchema: any = {
|
@@ -44,152 +34,8 @@ export class QuarterRangePlugin extends BasePlugin {
|
|
44
34
|
]
|
45
35
|
};
|
46
36
|
|
47
|
-
|
48
|
-
|
49
|
-
getSchemaTpl('placeholder', {
|
50
|
-
pipeIn: defaultValue('请选择月份范围')
|
51
|
-
}),
|
52
|
-
|
53
|
-
{
|
54
|
-
type: 'input-text',
|
55
|
-
name: 'format',
|
56
|
-
label: '值格式',
|
57
|
-
description:
|
58
|
-
'请参考 <a href="https://momentjs.com/" target="_blank">moment</a> 中的格式用法。',
|
59
|
-
pipeIn: defaultValue('X')
|
60
|
-
},
|
61
|
-
|
62
|
-
getSchemaTpl('switchDefaultValue'),
|
63
|
-
|
64
|
-
{
|
65
|
-
type: 'input-text',
|
66
|
-
name: 'value',
|
67
|
-
label: '默认值',
|
68
|
-
visibleOn: 'typeof this.value !== "undefined"',
|
69
|
-
placeholder: '请输入相对值',
|
70
|
-
description:
|
71
|
-
'支持 <code>now、+1day、-2weeks</code>这种相对值用法,由于包含开始和结束时间,请用逗号隔开。'
|
72
|
-
},
|
73
|
-
|
74
|
-
{
|
75
|
-
type: 'fieldSet',
|
76
|
-
title: '使用固定值',
|
77
|
-
visibleOn: 'typeof this.value !== "undefined"',
|
78
|
-
collapsed: true,
|
79
|
-
collapsable: true,
|
80
|
-
className: 'fieldset',
|
81
|
-
body: [
|
82
|
-
{
|
83
|
-
type: 'input-quarter-range',
|
84
|
-
name: 'value',
|
85
|
-
pipeIn: (value: any) =>
|
86
|
-
value
|
87
|
-
? value
|
88
|
-
.split(',')
|
89
|
-
.map((item: any) =>
|
90
|
-
relativeValueRe.test(item) ||
|
91
|
-
~['now', 'today'].indexOf(item)
|
92
|
-
? ''
|
93
|
-
: item
|
94
|
-
)
|
95
|
-
: ''
|
96
|
-
}
|
97
|
-
]
|
98
|
-
},
|
99
|
-
getSchemaTpl('clearable', {
|
100
|
-
pipeIn: defaultValue(true)
|
101
|
-
}),
|
102
|
-
{
|
103
|
-
type: 'input-text',
|
104
|
-
name: 'minDate',
|
105
|
-
label: '最小日期',
|
106
|
-
placeholder: '请输入相对值',
|
107
|
-
description:
|
108
|
-
'支持 <code>now、+1day、-2weeks</code>这种相对值用法,同时支持变量如<code>\\${start_date}</code>'
|
109
|
-
},
|
110
|
-
|
111
|
-
{
|
112
|
-
type: 'fieldSet',
|
113
|
-
title: '使用固定值',
|
114
|
-
collapsed: true,
|
115
|
-
collapsable: true,
|
116
|
-
className: 'fieldset',
|
117
|
-
body: [
|
118
|
-
{
|
119
|
-
type: 'input-date',
|
120
|
-
name: 'minDate',
|
121
|
-
pipeIn: (value: any) =>
|
122
|
-
relativeValueRe.test(value) || ~['now', 'today'].indexOf(value)
|
123
|
-
? ''
|
124
|
-
: value
|
125
|
-
}
|
126
|
-
]
|
127
|
-
},
|
128
|
-
|
129
|
-
{
|
130
|
-
type: 'divider'
|
131
|
-
},
|
132
|
-
|
133
|
-
{
|
134
|
-
type: 'input-text',
|
135
|
-
name: 'maxDate',
|
136
|
-
label: '最大日期',
|
137
|
-
placeholder: '请输入相对值',
|
138
|
-
description:
|
139
|
-
'支持 <code>now、+1day、-2weeks</code>这种相对值用法,同时支持变量如<code>\\${start_date}</code>'
|
140
|
-
},
|
141
|
-
|
142
|
-
{
|
143
|
-
type: 'fieldSet',
|
144
|
-
title: '使用固定值',
|
145
|
-
collapsed: true,
|
146
|
-
collapsable: true,
|
147
|
-
className: 'fieldset',
|
148
|
-
body: [
|
149
|
-
{
|
150
|
-
type: 'input-date',
|
151
|
-
name: 'maxDate',
|
152
|
-
pipeIn: (value: any) =>
|
153
|
-
relativeValueRe.test(value) || ~['now', 'today'].indexOf(value)
|
154
|
-
? ''
|
155
|
-
: value
|
156
|
-
}
|
157
|
-
]
|
158
|
-
},
|
159
|
-
{
|
160
|
-
type: 'input-text',
|
161
|
-
name: 'minDuration',
|
162
|
-
label: '限制最小跨度',
|
163
|
-
description: '比如 2days'
|
164
|
-
},
|
165
|
-
{
|
166
|
-
type: 'input-text',
|
167
|
-
name: 'maxDuration',
|
168
|
-
label: '限制最大跨度',
|
169
|
-
description: '比如 1year'
|
170
|
-
},
|
171
|
-
{
|
172
|
-
name: 'utc',
|
173
|
-
label: '是否使用 UTC 时间',
|
174
|
-
type: 'switch',
|
175
|
-
mode: 'inline',
|
176
|
-
className: 'block'
|
177
|
-
},
|
178
|
-
{
|
179
|
-
name: 'clearable',
|
180
|
-
label: '是否可清除',
|
181
|
-
type: 'switch',
|
182
|
-
mode: 'inline',
|
183
|
-
className: 'block'
|
184
|
-
},
|
185
|
-
{
|
186
|
-
name: 'embed',
|
187
|
-
label: '是否内嵌模式',
|
188
|
-
type: 'switch',
|
189
|
-
mode: 'inline',
|
190
|
-
className: 'block'
|
191
|
-
}
|
192
|
-
];
|
37
|
+
disabledRendererPlugin = true;
|
38
|
+
notRenderFormZone = true;
|
193
39
|
}
|
194
40
|
|
195
41
|
registerEditorPlugin(QuarterRangePlugin);
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import {RendererAction, RendererEvent} from '../../event-action';
|
1
2
|
import {defaultValue, getSchemaTpl} from '../../component/schemaTpl';
|
2
3
|
import {registerEditorPlugin} from '../../manager';
|
3
4
|
import {BasePlugin} from '../../plugin';
|
@@ -31,6 +32,77 @@ export class RangeControlPlugin extends BasePlugin {
|
|
31
32
|
]
|
32
33
|
};
|
33
34
|
|
35
|
+
// 事件定义
|
36
|
+
events: RendererEvent[] = [
|
37
|
+
{
|
38
|
+
eventName: 'change',
|
39
|
+
eventLabel: '值变化',
|
40
|
+
description: '滑块值变化时触发',
|
41
|
+
dataSchema: [
|
42
|
+
{
|
43
|
+
type: 'object',
|
44
|
+
properties: {
|
45
|
+
'event.data.value': {
|
46
|
+
type: 'string',
|
47
|
+
title: '当前值'
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
]
|
52
|
+
},
|
53
|
+
{
|
54
|
+
eventName: 'focus',
|
55
|
+
eventLabel: '获取焦点',
|
56
|
+
description: '当设置 showInput 为 true 时,输入框获取焦点时触发',
|
57
|
+
dataSchema: [
|
58
|
+
{
|
59
|
+
type: 'object',
|
60
|
+
properties: {
|
61
|
+
'event.data.value': {
|
62
|
+
type: 'string',
|
63
|
+
title: '滑块当前值'
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
67
|
+
]
|
68
|
+
},
|
69
|
+
{
|
70
|
+
eventName: 'blur',
|
71
|
+
eventLabel: '失去焦点',
|
72
|
+
description: '当设置 showInput 为 true 时,输入框失去焦点时触发',
|
73
|
+
dataSchema: [
|
74
|
+
{
|
75
|
+
type: 'object',
|
76
|
+
properties: {
|
77
|
+
'event.data.value': {
|
78
|
+
type: 'string',
|
79
|
+
title: '滑块当前值'
|
80
|
+
}
|
81
|
+
}
|
82
|
+
}
|
83
|
+
]
|
84
|
+
}
|
85
|
+
];
|
86
|
+
|
87
|
+
// 动作定义
|
88
|
+
actions: RendererAction[] = [
|
89
|
+
{
|
90
|
+
actionType: 'clear',
|
91
|
+
actionLabel: '清空',
|
92
|
+
description: '清除输入框'
|
93
|
+
},
|
94
|
+
{
|
95
|
+
actionType: 'reset',
|
96
|
+
actionLabel: '重置',
|
97
|
+
description: '将值重置为resetValue,若没有配置resetValue,则清空'
|
98
|
+
},
|
99
|
+
{
|
100
|
+
actionType: 'setValue',
|
101
|
+
actionLabel: '赋值',
|
102
|
+
description: '触发组件数据更新'
|
103
|
+
}
|
104
|
+
];
|
105
|
+
|
34
106
|
panelTitle = '滑块';
|
35
107
|
panelBody = [
|
36
108
|
getSchemaTpl('switchDefaultValue'),
|
@@ -101,13 +173,11 @@ export class RangeControlPlugin extends BasePlugin {
|
|
101
173
|
value: ''
|
102
174
|
},
|
103
175
|
|
104
|
-
{
|
105
|
-
type: 'switch',
|
176
|
+
getSchemaTpl('switch', {
|
106
177
|
name: 'showInput',
|
107
|
-
mode: 'inline',
|
108
178
|
label: '是否显示输入框',
|
109
179
|
value: false
|
110
|
-
},
|
180
|
+
}),
|
111
181
|
|
112
182
|
getSchemaTpl('clearable'),
|
113
183
|
getSchemaTpl('multiple', {
|