amis-editor 4.2.0-beta.0 → 5.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (221) hide show
  1. package/dist/6dbcbb49b6fd405190a9.png +0 -0
  2. package/dist/component/Editor.d.ts +16 -0
  3. package/dist/component/RegionWrapper.d.ts +10 -0
  4. package/dist/component/VRenderer.d.ts +10 -0
  5. package/dist/component/base/ShortcutKey.d.ts +23 -0
  6. package/dist/component/control/APIControl.d.ts +1158 -0
  7. package/dist/component/control/ActionAPIControl.d.ts +1158 -0
  8. package/dist/component/control/BadgeControl.d.ts +133 -0
  9. package/dist/component/control/BaseControl.d.ts +248 -0
  10. package/dist/component/control/DataBindingControl.d.ts +14 -0
  11. package/dist/component/control/DataPickerControl.d.ts +13 -0
  12. package/dist/component/control/DateShortCutControl.d.ts +83 -0
  13. package/dist/component/control/FormulaControl.d.ts +51 -0
  14. package/dist/component/{Control → control}/OptionControl.d.ts +23 -34
  15. package/dist/component/{Control → control}/PopoverEdit.d.ts +1 -1
  16. package/dist/component/control/StatusControl.d.ts +39 -0
  17. package/dist/component/control/SwitchMoreControl.d.ts +224 -0
  18. package/dist/component/control/ValidationControl.d.ts +65 -0
  19. package/dist/component/control/ValidationItem.d.ts +46 -0
  20. package/dist/component/control/style-control/Background.d.ts +17 -0
  21. package/dist/component/control/style-control/Border.d.ts +18 -0
  22. package/dist/component/control/style-control/BoxModel.d.ts +17 -0
  23. package/dist/component/control/style-control/BoxShadow.d.ts +18 -0
  24. package/dist/component/control/style-control/Display.d.ts +14 -0
  25. package/dist/component/control/style-control/Font.d.ts +16 -0
  26. package/dist/component/control/style-control/font-family.d.ts +11 -0
  27. package/dist/component/control/style-control/transformation.d.ts +29 -0
  28. package/dist/component/control/style-control/types.d.ts +8 -0
  29. package/dist/component/schemaTpl.d.ts +8 -0
  30. package/dist/component/validator.d.ts +62 -0
  31. package/dist/dnd/index.d.ts +1 -1
  32. package/dist/event-action/action-config-panel.d.ts +8 -0
  33. package/dist/event-action/actions.d.ts +3 -0
  34. package/dist/event-action/comp-action-select.d.ts +11 -0
  35. package/dist/event-action/config.d.ts +13 -0
  36. package/dist/event-action/index.d.ts +459 -0
  37. package/dist/event-action/schema.d.ts +32 -0
  38. package/dist/exports.min.js +1 -1
  39. package/dist/index.d.ts +24 -5
  40. package/dist/index.min.js +1 -1
  41. package/dist/manager.d.ts +46 -1
  42. package/dist/plugin/Alert.d.ts +4 -2
  43. package/dist/plugin/Button.d.ts +5 -1
  44. package/dist/plugin/ButtonGroup.d.ts +13 -34
  45. package/dist/plugin/ButtonToolbar.d.ts +4 -10
  46. package/dist/plugin/CRUD.d.ts +2 -0
  47. package/dist/plugin/Chart.d.ts +2 -0
  48. package/dist/plugin/Collapse.d.ts +1 -0
  49. package/dist/plugin/CollapseGroup.d.ts +28 -4
  50. package/dist/plugin/Container.d.ts +2 -1
  51. package/dist/plugin/Dialog.d.ts +12 -2
  52. package/dist/plugin/Drawer.d.ts +12 -2
  53. package/dist/plugin/DropDownButton.d.ts +11 -11
  54. package/dist/plugin/Form/ButtonGroupSelect.d.ts +7 -2
  55. package/dist/plugin/Form/ButtonToolbar.d.ts +8 -7
  56. package/dist/plugin/Form/ChainedSelect.d.ts +3 -0
  57. package/dist/plugin/Form/Checkbox.d.ts +7 -2
  58. package/dist/plugin/Form/Checkboxes.d.ts +8 -2
  59. package/dist/plugin/Form/CodeEditor.d.ts +7 -22
  60. package/dist/plugin/Form/Combo.d.ts +3 -0
  61. package/dist/plugin/Form/Control.d.ts +6 -2
  62. package/dist/plugin/Form/DiffEditor.d.ts +7 -1
  63. package/dist/plugin/Form/Form.d.ts +6 -0
  64. package/dist/plugin/Form/Formula.d.ts +1 -25
  65. package/dist/plugin/Form/InputDate.d.ts +8 -2
  66. package/dist/plugin/Form/InputDateRange.d.ts +8 -2
  67. package/dist/plugin/Form/InputDateTime.d.ts +4 -4
  68. package/dist/plugin/Form/InputDateTimeRange.d.ts +4 -4
  69. package/dist/plugin/Form/InputEmail.d.ts +1 -0
  70. package/dist/plugin/Form/InputExcel.d.ts +6 -41
  71. package/dist/plugin/Form/InputFile.d.ts +7 -3
  72. package/dist/plugin/Form/InputKV.d.ts +6 -0
  73. package/dist/plugin/Form/InputMonth.d.ts +1 -0
  74. package/dist/plugin/Form/InputMonthRange.d.ts +4 -4
  75. package/dist/plugin/Form/InputPassword.d.ts +1 -0
  76. package/dist/plugin/Form/InputQuarter.d.ts +1 -0
  77. package/dist/plugin/Form/InputQuarterRange.d.ts +4 -4
  78. package/dist/plugin/Form/InputRange.d.ts +3 -0
  79. package/dist/plugin/Form/InputRating.d.ts +9 -3
  80. package/dist/plugin/Form/InputText.d.ts +24 -2
  81. package/dist/plugin/Form/InputTime.d.ts +3 -3
  82. package/dist/plugin/Form/InputTimeRange.d.ts +20 -0
  83. package/dist/plugin/Form/InputTree.d.ts +6 -2
  84. package/dist/plugin/Form/InputURL.d.ts +1 -0
  85. package/dist/plugin/Form/InputYear.d.ts +1 -0
  86. package/dist/plugin/Form/InputYearRange.d.ts +20 -0
  87. package/dist/plugin/Form/ListSelect.d.ts +6 -2
  88. package/dist/plugin/Form/LocationPicker.d.ts +1 -31
  89. package/dist/plugin/Form/NestedSelect.d.ts +5 -2
  90. package/dist/plugin/Form/Radios.d.ts +7 -2
  91. package/dist/plugin/Form/Select.d.ts +7 -2
  92. package/dist/plugin/Form/Switch.d.ts +7 -2
  93. package/dist/plugin/Form/TabsTransfer.d.ts +5 -2
  94. package/dist/plugin/Form/Textarea.d.ts +7 -1
  95. package/dist/plugin/Form/Transfer.d.ts +5 -2
  96. package/dist/plugin/Form/TreeSelect.d.ts +6 -2
  97. package/dist/plugin/IFrame.d.ts +2 -2
  98. package/dist/plugin/Nav.d.ts +1 -116
  99. package/dist/plugin/Others/Action.d.ts +5 -1
  100. package/dist/plugin/Page.d.ts +5 -2
  101. package/dist/plugin/Progress.d.ts +5 -1
  102. package/dist/plugin/Table.d.ts +2 -0
  103. package/dist/plugin/Tabs.d.ts +33 -2
  104. package/dist/plugin/TooltipWrapper.d.ts +10 -0
  105. package/dist/plugin/Tpl.d.ts +2 -1
  106. package/dist/plugin/Wizard.d.ts +4 -1
  107. package/dist/plugin.d.ts +37 -1
  108. package/dist/store/editor.d.ts +65 -38
  109. package/dist/store/node.d.ts +16 -0
  110. package/dist/style.css +1 -1
  111. package/dist/util.d.ts +36 -3
  112. package/package.json +14 -9
  113. package/src/component/schemaTpl.tsx +1198 -474
  114. package/src/plugin/.DS_Store +0 -0
  115. package/src/plugin/Alert.tsx +69 -48
  116. package/src/plugin/AnchorNav.tsx +1 -0
  117. package/src/plugin/Audio.tsx +9 -15
  118. package/src/plugin/Avatar.tsx +2 -1
  119. package/src/plugin/Breadcrumb.tsx +2 -1
  120. package/src/plugin/Button.tsx +257 -188
  121. package/src/plugin/ButtonGroup.tsx +99 -38
  122. package/src/plugin/ButtonToolbar.tsx +7 -13
  123. package/src/plugin/CRUD.tsx +77 -135
  124. package/src/plugin/Card.tsx +1 -0
  125. package/src/plugin/Cards.tsx +8 -14
  126. package/src/plugin/Carousel.tsx +1 -1
  127. package/src/plugin/Chart.tsx +26 -14
  128. package/src/plugin/Collapse.tsx +78 -78
  129. package/src/plugin/CollapseGroup.tsx +165 -83
  130. package/src/plugin/Container.tsx +59 -6
  131. package/src/plugin/Custom.tsx +2 -8
  132. package/src/plugin/CustomRegion.tsx +4 -3
  133. package/src/plugin/Dialog.tsx +55 -24
  134. package/src/plugin/Drawer.tsx +65 -35
  135. package/src/plugin/DropDownButton.tsx +95 -79
  136. package/src/plugin/Flex.tsx +123 -65
  137. package/src/plugin/Form/ButtonGroupSelect.tsx +114 -26
  138. package/src/plugin/Form/ButtonToolbar.tsx +62 -55
  139. package/src/plugin/Form/ChainedSelect.tsx +45 -0
  140. package/src/plugin/Form/Checkbox.tsx +122 -33
  141. package/src/plugin/Form/Checkboxes.tsx +154 -87
  142. package/src/plugin/Form/CodeEditor.tsx +163 -34
  143. package/src/plugin/Form/Combo.tsx +104 -65
  144. package/src/plugin/Form/Control.tsx +16 -70
  145. package/src/plugin/Form/DiffEditor.tsx +158 -54
  146. package/src/plugin/Form/FieldSet.tsx +6 -11
  147. package/src/plugin/Form/Form.tsx +277 -70
  148. package/src/plugin/Form/Formula.tsx +8 -14
  149. package/src/plugin/Form/InputArray.tsx +7 -16
  150. package/src/plugin/Form/InputCity.tsx +1 -1
  151. package/src/plugin/Form/InputDate.tsx +344 -121
  152. package/src/plugin/Form/InputDateRange.tsx +303 -161
  153. package/src/plugin/Form/InputDateTime.tsx +6 -150
  154. package/src/plugin/Form/InputDateTimeRange.tsx +7 -187
  155. package/src/plugin/Form/InputEmail.tsx +1 -0
  156. package/src/plugin/Form/InputExcel.tsx +70 -27
  157. package/src/plugin/Form/InputFile.tsx +326 -152
  158. package/src/plugin/Form/InputImage.tsx +1 -1
  159. package/src/plugin/Form/InputKV.tsx +61 -0
  160. package/src/plugin/Form/InputMonth.tsx +3 -1
  161. package/src/plugin/Form/InputMonthRange.tsx +6 -160
  162. package/src/plugin/Form/InputNumber.tsx +1 -1
  163. package/src/plugin/Form/InputPassword.tsx +2 -0
  164. package/src/plugin/Form/InputQuarter.tsx +3 -1
  165. package/src/plugin/Form/InputQuarterRange.tsx +6 -160
  166. package/src/plugin/Form/InputRange.tsx +74 -4
  167. package/src/plugin/Form/InputRating.tsx +347 -35
  168. package/src/plugin/Form/InputRichText.tsx +2 -3
  169. package/src/plugin/Form/InputTable.tsx +33 -49
  170. package/src/plugin/Form/InputTag.tsx +1 -1
  171. package/src/plugin/Form/InputText.tsx +310 -132
  172. package/src/plugin/Form/InputTime.tsx +4 -53
  173. package/src/plugin/Form/InputTimeRange.tsx +41 -0
  174. package/src/plugin/Form/InputTree.tsx +196 -46
  175. package/src/plugin/Form/InputURL.tsx +2 -0
  176. package/src/plugin/Form/InputYear.tsx +2 -0
  177. package/src/plugin/Form/InputYearRange.tsx +41 -0
  178. package/src/plugin/Form/Item.tsx +17 -18
  179. package/src/plugin/Form/ListSelect.tsx +75 -20
  180. package/src/plugin/Form/LocationPicker.tsx +2 -7
  181. package/src/plugin/Form/MatrixCheckboxes.tsx +1 -1
  182. package/src/plugin/Form/NestedSelect.tsx +110 -43
  183. package/src/plugin/Form/Picker.tsx +2 -5
  184. package/src/plugin/Form/Radios.tsx +122 -52
  185. package/src/plugin/Form/Select.tsx +239 -168
  186. package/src/plugin/Form/Static.tsx +1 -1
  187. package/src/plugin/Form/Switch.tsx +170 -58
  188. package/src/plugin/Form/TabsTransfer.tsx +175 -79
  189. package/src/plugin/Form/Textarea.tsx +146 -36
  190. package/src/plugin/Form/Transfer.tsx +295 -233
  191. package/src/plugin/Form/TreeSelect.tsx +287 -146
  192. package/src/plugin/Grid.tsx +340 -312
  193. package/src/plugin/HBox.tsx +1 -0
  194. package/src/plugin/IFrame.tsx +21 -12
  195. package/src/plugin/Image.tsx +7 -12
  196. package/src/plugin/Images.tsx +7 -12
  197. package/src/plugin/Link.tsx +6 -12
  198. package/src/plugin/List.tsx +6 -10
  199. package/src/plugin/ListItem.tsx +1 -0
  200. package/src/plugin/Nav.tsx +7 -9
  201. package/src/plugin/Others/Action.tsx +16 -10
  202. package/src/plugin/Others/BasicToolbar.tsx +4 -1
  203. package/src/plugin/Others/TableCell.tsx +19 -39
  204. package/src/plugin/Page.tsx +315 -229
  205. package/src/plugin/Panel.tsx +6 -7
  206. package/src/plugin/Plain.tsx +3 -6
  207. package/src/plugin/Progress.tsx +234 -94
  208. package/src/plugin/Service.tsx +10 -6
  209. package/src/plugin/Table.tsx +49 -20
  210. package/src/plugin/TableView.tsx +212 -106
  211. package/src/plugin/Tabs.tsx +306 -146
  212. package/src/plugin/TooltipWrapper.tsx +231 -135
  213. package/src/plugin/Tpl.tsx +68 -52
  214. package/src/plugin/Video.tsx +9 -20
  215. package/src/plugin/Wizard.tsx +537 -336
  216. package/src/plugin/Wrapper.tsx +82 -61
  217. package/src/plugin.ts +66 -4
  218. package/static/empty.png +0 -0
  219. package/dist/component/Control/APIControl.d.ts +0 -504
  220. package/dist/component/Control/ValidationControl.d.ts +0 -30
  221. package/dist/component/remarkTpl.d.ts +0 -150
@@ -1,6 +1,12 @@
1
- import {getSchemaTpl} from '../../component/schemaTpl';
1
+ import {defaultValue, getSchemaTpl} from '../../component/schemaTpl';
2
2
  import {registerEditorPlugin} from '../../manager';
3
3
  import {BasePlugin} from '../../plugin';
4
+ import {tipedLabel} from '../../component/control/BaseControl';
5
+
6
+ import type {BaseEventContext} from '../../plugin';
7
+ import {ValidatorTag} from '../../component/validator';
8
+ import {getEventControlConfig} from '../../util';
9
+ import {RendererAction, RendererEvent} from '../../event-action';
4
10
 
5
11
  export class TextareaControlPlugin extends BasePlugin {
6
12
  // 关联渲染器名字
@@ -30,54 +36,158 @@ export class TextareaControlPlugin extends BasePlugin {
30
36
  }
31
37
  };
32
38
 
39
+ notRenderFormZone = true;
40
+
33
41
  panelTitle = '多行文本';
34
- panelBody = [
35
- getSchemaTpl('switchDefaultValue'),
36
- {
37
- type: 'textarea',
38
- name: 'value',
39
- label: '默认值',
40
- visibleOn: 'typeof this.value !== "undefined"'
41
- },
42
+
43
+ events: RendererEvent[] = [
42
44
  {
43
- type: 'input-number',
44
- name: 'minRows',
45
- value: 3,
46
- label: '最小行数'
45
+ eventName: 'change',
46
+ eventLabel: '值变化',
47
+ description: '输入框值变化时触发',
48
+ dataSchema: [
49
+ {
50
+ type: 'object',
51
+ properties: {
52
+ 'event.data.value': {
53
+ type: 'string',
54
+ title: '输入值'
55
+ }
56
+ }
57
+ }
58
+ ]
47
59
  },
48
60
  {
49
- type: 'input-number',
50
- name: 'maxRows',
51
- value: 20,
52
- label: '最大行数'
61
+ eventName: 'focus',
62
+ eventLabel: '获取焦点',
63
+ description: '输入框获取焦点时触发',
64
+ dataSchema: [
65
+ {
66
+ type: 'object',
67
+ properties: {
68
+ 'event.data.value': {
69
+ type: 'string',
70
+ title: '输入值'
71
+ }
72
+ }
73
+ }
74
+ ]
53
75
  },
54
76
  {
55
- type: 'input-number',
56
- name: 'minLength',
57
- value: 5,
58
- label: '最小字数限制'
59
- },
77
+ eventName: 'blur',
78
+ eventLabel: '失去焦点',
79
+ description: '输入框失去焦点时触发',
80
+ dataSchema: [
81
+ {
82
+ type: 'object',
83
+ properties: {
84
+ 'event.data.value': {
85
+ type: 'string',
86
+ title: '输入值'
87
+ }
88
+ }
89
+ }
90
+ ]
91
+ }
92
+ ];
93
+
94
+ actions: RendererAction[] = [
60
95
  {
61
- type: 'input-number',
62
- name: 'maxLength',
63
- value: 120,
64
- label: '最大字数限制'
96
+ actionType: 'clear',
97
+ actionLabel: '清空',
98
+ description: '清空输入框内容'
65
99
  },
66
- getSchemaTpl('showCounter'),
67
100
  {
68
- type: 'switch',
69
- name: 'readOnly',
70
- label: '是否只读'
101
+ actionType: 'reset',
102
+ actionLabel: '重置',
103
+ description: '将值重置为resetValue,若没有配置resetValue,则清空'
71
104
  },
72
105
  {
73
- type: 'switch',
74
- name: 'trimContents',
75
- label: '去除首尾空白',
76
- mode: 'inline',
77
- className: 'w-full',
78
- description: '开启后,将不允许用户输入前后空格'
106
+ actionType: 'setValue',
107
+ actionLabel: '赋值',
108
+ description: '触发组件数据更新'
79
109
  }
80
110
  ];
111
+
112
+ panelJustify = true;
113
+ panelBodyCreator = (context: BaseEventContext) => {
114
+ return getSchemaTpl('tabs', [
115
+ {
116
+ title: '属性',
117
+ body: getSchemaTpl('collapseGroup', [
118
+ {
119
+ title: '基本',
120
+ body: [
121
+ getSchemaTpl('formItemName', {
122
+ required: true
123
+ }),
124
+ getSchemaTpl('label'),
125
+ {
126
+ type: 'textarea',
127
+ name: 'value',
128
+ label: '默认值'
129
+ },
130
+ getSchemaTpl('switch', {
131
+ name: 'trimContents',
132
+ pipeIn: defaultValue(true),
133
+ label: tipedLabel(
134
+ '去除首尾空白',
135
+ '开启后,将不允许用户输入前后空格'
136
+ )
137
+ }),
138
+ getSchemaTpl('showCounter'),
139
+ getSchemaTpl('labelRemark'),
140
+ getSchemaTpl('remark'),
141
+ getSchemaTpl('placeholder'),
142
+ getSchemaTpl('description')
143
+ ]
144
+ },
145
+ getSchemaTpl('status', {
146
+ isFormItem: true,
147
+ readonly: true
148
+ }),
149
+ getSchemaTpl('validation', {
150
+ tag: ValidatorTag.Text
151
+ })
152
+ ])
153
+ },
154
+ {
155
+ title: '外观',
156
+ body: [
157
+ getSchemaTpl('collapseGroup', [
158
+ getSchemaTpl('style:formItem', {
159
+ renderer: context.info.renderer,
160
+ schema: [
161
+ {
162
+ type: 'input-number',
163
+ name: 'minRows',
164
+ value: 3,
165
+ label: '最小展示行数'
166
+ },
167
+ {
168
+ type: 'input-number',
169
+ name: 'maxRows',
170
+ value: 20,
171
+ label: '最大展示行数'
172
+ }
173
+ ]
174
+ }),
175
+ getSchemaTpl('style:classNames')
176
+ ])
177
+ ]
178
+ },
179
+ {
180
+ title: '事件',
181
+ className: 'p-none',
182
+ body: [
183
+ getSchemaTpl('eventControl', {
184
+ name: 'onEvent',
185
+ ...getEventControlConfig(this.manager, context)
186
+ })
187
+ ]
188
+ }
189
+ ]);
190
+ };
81
191
  }
82
192
 
83
193
  registerEditorPlugin(TextareaControlPlugin);