@plasmicpkgs/antd 2.0.4 → 2.0.6
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/antd.cjs.development.js +2325 -0
- package/dist/antd.cjs.development.js.map +1 -0
- package/dist/antd.cjs.production.min.js +2 -0
- package/dist/antd.cjs.production.min.js.map +1 -0
- package/dist/antd.css +27184 -0
- package/dist/antd.esm.js +720 -724
- package/dist/antd.esm.js.map +1 -1
- package/dist/customControls.d.ts +17 -17
- package/dist/index.d.ts +16 -16
- package/dist/index.js +5 -2353
- package/dist/registerButton.d.ts +5 -5
- package/dist/registerCarousel.d.ts +5 -5
- package/dist/registerCheckbox.d.ts +8 -8
- package/dist/registerCollapse.d.ts +14 -14
- package/dist/registerDropdown.d.ts +11 -11
- package/dist/registerInput.d.ts +14 -13
- package/dist/registerMenu.d.ts +15 -14
- package/dist/registerOption.d.ts +8 -8
- package/dist/registerRate.d.ts +5 -5
- package/dist/registerSelect.d.ts +8 -8
- package/dist/registerSlider.d.ts +19 -19
- package/dist/registerSwitch.d.ts +5 -5
- package/dist/registerTable.d.ts +30 -30
- package/dist/registerTabs.d.ts +13 -14
- package/dist/registerable.d.ts +4 -4
- package/package.json +9 -14
- package/skinny/customControls-8143c119.js +27 -0
- package/skinny/{customControls-f5378e2f.js.map → customControls-8143c119.js.map} +1 -1
- package/skinny/customControls.d.ts +17 -17
- package/skinny/index.d.ts +16 -0
- package/skinny/package.json +2 -2
- package/skinny/registerButton.d.ts +5 -5
- package/skinny/registerButton.js +94 -78
- package/skinny/registerButton.js.map +1 -1
- package/skinny/registerCarousel.d.ts +5 -5
- package/skinny/registerCarousel.js +80 -64
- package/skinny/registerCarousel.js.map +1 -1
- package/skinny/registerCheckbox.d.ts +8 -8
- package/skinny/registerCheckbox.js +140 -123
- package/skinny/registerCheckbox.js.map +1 -1
- package/skinny/registerCollapse.d.ts +14 -14
- package/skinny/registerCollapse.js +173 -172
- package/skinny/registerCollapse.js.map +1 -1
- package/skinny/registerDropdown.d.ts +11 -11
- package/skinny/registerDropdown.js +190 -172
- package/skinny/registerDropdown.js.map +1 -1
- package/skinny/registerInput.d.ts +14 -13
- package/skinny/registerInput.js +341 -360
- package/skinny/registerInput.js.map +1 -1
- package/skinny/registerMenu.d.ts +15 -14
- package/skinny/registerMenu.js +326 -274
- package/skinny/registerMenu.js.map +1 -1
- package/skinny/registerOption.d.ts +8 -8
- package/skinny/registerOption.js +95 -72
- package/skinny/registerOption.js.map +1 -1
- package/skinny/registerRate.d.ts +5 -5
- package/skinny/registerSelect.d.ts +8 -8
- package/skinny/registerSelect.js +144 -128
- package/skinny/registerSelect.js.map +1 -1
- package/skinny/registerSlider.d.ts +19 -19
- package/skinny/registerSlider.js +120 -130
- package/skinny/registerSlider.js.map +1 -1
- package/skinny/registerSwitch.d.ts +5 -5
- package/skinny/registerSwitch.js +69 -53
- package/skinny/registerSwitch.js.map +1 -1
- package/skinny/registerTable.d.ts +30 -30
- package/skinny/registerTable.js +204 -201
- package/skinny/registerTable.js.map +1 -1
- package/skinny/registerTabs.d.ts +13 -14
- package/skinny/registerTabs.js +330 -342
- package/skinny/registerTabs.js.map +1 -1
- package/skinny/registerable.d.ts +4 -4
- package/skinny/tslib.es6-40998fef.js +59 -0
- package/skinny/tslib.es6-40998fef.js.map +1 -0
- package/dist/index.js.map +0 -1
- package/skinny/customControls-f5378e2f.js +0 -20
|
@@ -0,0 +1,2325 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
6
|
+
|
|
7
|
+
var registerComponent = _interopDefault(require('@plasmicapp/host/registerComponent'));
|
|
8
|
+
var Button = _interopDefault(require('antd/lib/button'));
|
|
9
|
+
var Carousel = _interopDefault(require('antd/lib/carousel'));
|
|
10
|
+
var Checkbox = _interopDefault(require('antd/lib/checkbox/Checkbox'));
|
|
11
|
+
var CheckboxGroup = _interopDefault(require('antd/lib/checkbox/Group'));
|
|
12
|
+
var React = _interopDefault(require('react'));
|
|
13
|
+
var AntdCollapse = _interopDefault(require('antd/lib/collapse/Collapse'));
|
|
14
|
+
var CollapsePanel = _interopDefault(require('antd/lib/collapse/CollapsePanel'));
|
|
15
|
+
var AntdDropdown = _interopDefault(require('antd/lib/dropdown'));
|
|
16
|
+
var DropdownButton = _interopDefault(require('antd/lib/dropdown/dropdown-button'));
|
|
17
|
+
var Input = _interopDefault(require('antd/lib/input'));
|
|
18
|
+
var InputGroup = _interopDefault(require('antd/lib/input/Group'));
|
|
19
|
+
var Password = _interopDefault(require('antd/lib/input/Password'));
|
|
20
|
+
var Search = _interopDefault(require('antd/lib/input/Search'));
|
|
21
|
+
var TextArea = _interopDefault(require('antd/lib/input/TextArea'));
|
|
22
|
+
var Menu = _interopDefault(require('antd/lib/menu/index'));
|
|
23
|
+
var MenuDivider = _interopDefault(require('antd/lib/menu/MenuDivider'));
|
|
24
|
+
var MenuItem = _interopDefault(require('antd/lib/menu/MenuItem'));
|
|
25
|
+
var SubMenu = _interopDefault(require('antd/lib/menu/SubMenu'));
|
|
26
|
+
var rcMenu = require('rc-menu');
|
|
27
|
+
var rcSelect = require('rc-select');
|
|
28
|
+
var Rate = _interopDefault(require('antd/lib/rate'));
|
|
29
|
+
var Select = _interopDefault(require('antd/lib/select'));
|
|
30
|
+
var AntdSlider = _interopDefault(require('antd/lib/slider'));
|
|
31
|
+
var Switch = _interopDefault(require('antd/lib/switch'));
|
|
32
|
+
var host = require('@plasmicapp/host');
|
|
33
|
+
var Table = _interopDefault(require('antd/lib/table/Table'));
|
|
34
|
+
var antd = require('antd');
|
|
35
|
+
var AntdTabs = _interopDefault(require('antd/lib/tabs'));
|
|
36
|
+
var rcTabs = require('rc-tabs');
|
|
37
|
+
|
|
38
|
+
var buttonMeta = {
|
|
39
|
+
name: "AntdButton",
|
|
40
|
+
displayName: "Antd Button",
|
|
41
|
+
props: {
|
|
42
|
+
type: {
|
|
43
|
+
type: "choice",
|
|
44
|
+
options: ["default", "primary", "ghost", "dashed", "link", "text"],
|
|
45
|
+
description: "Can be set to primary, ghost, dashed, link, text, default",
|
|
46
|
+
defaultValueHint: "default"
|
|
47
|
+
},
|
|
48
|
+
size: {
|
|
49
|
+
type: "choice",
|
|
50
|
+
options: ["small", "medium", "large"],
|
|
51
|
+
description: "Set the size of button",
|
|
52
|
+
defaultValueHint: "medium"
|
|
53
|
+
},
|
|
54
|
+
shape: {
|
|
55
|
+
type: "choice",
|
|
56
|
+
options: ["default", "circle", "round"],
|
|
57
|
+
description: "Can be set button shape",
|
|
58
|
+
defaultValueHint: "default"
|
|
59
|
+
},
|
|
60
|
+
disabled: {
|
|
61
|
+
type: "boolean",
|
|
62
|
+
description: "Disabled state of button",
|
|
63
|
+
defaultValueHint: false
|
|
64
|
+
},
|
|
65
|
+
ghost: {
|
|
66
|
+
type: "boolean",
|
|
67
|
+
description: "Make background transparent and invert text and border colors",
|
|
68
|
+
defaultValueHint: false
|
|
69
|
+
},
|
|
70
|
+
danger: {
|
|
71
|
+
type: "boolean",
|
|
72
|
+
description: "Set the danger status of button",
|
|
73
|
+
defaultValueHint: false
|
|
74
|
+
},
|
|
75
|
+
block: {
|
|
76
|
+
type: "boolean",
|
|
77
|
+
description: "Option to fit button width to its parent width",
|
|
78
|
+
defaultValueHint: false
|
|
79
|
+
},
|
|
80
|
+
loading: {
|
|
81
|
+
type: "boolean",
|
|
82
|
+
description: "Set the loading status of button",
|
|
83
|
+
defaultValueHint: false
|
|
84
|
+
},
|
|
85
|
+
href: {
|
|
86
|
+
type: "string",
|
|
87
|
+
description: "Redirect url of link button"
|
|
88
|
+
},
|
|
89
|
+
target: {
|
|
90
|
+
type: "choice",
|
|
91
|
+
options: ["_blank", "_self", "_parent", "_top"],
|
|
92
|
+
description: "Same as target attribute of a, works when href is specified",
|
|
93
|
+
hidden: function hidden(props) {
|
|
94
|
+
return !props.href;
|
|
95
|
+
},
|
|
96
|
+
defaultValueHint: "_self"
|
|
97
|
+
},
|
|
98
|
+
children: {
|
|
99
|
+
type: "slot",
|
|
100
|
+
defaultValue: [{
|
|
101
|
+
type: "text",
|
|
102
|
+
value: "Button"
|
|
103
|
+
}]
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
importPath: "antd/lib/button",
|
|
107
|
+
isDefaultExport: true,
|
|
108
|
+
importName: "Button"
|
|
109
|
+
};
|
|
110
|
+
function registerButton(loader, customButtonMeta) {
|
|
111
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
112
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
doRegisterComponent(Button, customButtonMeta != null ? customButtonMeta : buttonMeta);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
var contentStyle = {
|
|
119
|
+
height: "160px",
|
|
120
|
+
color: "#fff",
|
|
121
|
+
lineHeight: "160px",
|
|
122
|
+
textAlign: "center",
|
|
123
|
+
backgroundColor: "#364d79"
|
|
124
|
+
};
|
|
125
|
+
var carouselMeta = {
|
|
126
|
+
name: "AntdCarousel",
|
|
127
|
+
displayName: "Antd Carousel",
|
|
128
|
+
props: {
|
|
129
|
+
autoplay: {
|
|
130
|
+
type: "boolean",
|
|
131
|
+
description: "Whether to scroll automatically",
|
|
132
|
+
defaultValueHint: false
|
|
133
|
+
},
|
|
134
|
+
dotPosition: {
|
|
135
|
+
type: "choice",
|
|
136
|
+
options: ["top", "bottom", "left", "right"],
|
|
137
|
+
description: "The position of the dots",
|
|
138
|
+
defaultValueHint: "bottom"
|
|
139
|
+
},
|
|
140
|
+
dots: {
|
|
141
|
+
type: "boolean",
|
|
142
|
+
description: "Whether to show the dots at the bottom of the gallery",
|
|
143
|
+
defaultValueHint: true
|
|
144
|
+
},
|
|
145
|
+
effect: {
|
|
146
|
+
type: "choice",
|
|
147
|
+
options: ["scrollx", "fade"],
|
|
148
|
+
defaultValueHint: "scrollx"
|
|
149
|
+
},
|
|
150
|
+
children: {
|
|
151
|
+
type: "slot",
|
|
152
|
+
defaultValue: [{
|
|
153
|
+
type: "vbox",
|
|
154
|
+
children: {
|
|
155
|
+
type: "text",
|
|
156
|
+
value: "1",
|
|
157
|
+
styles: contentStyle
|
|
158
|
+
}
|
|
159
|
+
}, {
|
|
160
|
+
type: "vbox",
|
|
161
|
+
children: {
|
|
162
|
+
type: "text",
|
|
163
|
+
value: "2",
|
|
164
|
+
styles: contentStyle
|
|
165
|
+
}
|
|
166
|
+
}]
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
importPath: "antd/lib/carousel",
|
|
170
|
+
importName: "Carousel",
|
|
171
|
+
isDefaultExport: true
|
|
172
|
+
};
|
|
173
|
+
function registerCarousel(loader, customCarouselMeta) {
|
|
174
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
175
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
doRegisterComponent(Carousel, customCarouselMeta != null ? customCarouselMeta : carouselMeta);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function _extends() {
|
|
182
|
+
_extends = Object.assign || function (target) {
|
|
183
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
184
|
+
var source = arguments[i];
|
|
185
|
+
|
|
186
|
+
for (var key in source) {
|
|
187
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
188
|
+
target[key] = source[key];
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return target;
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
return _extends.apply(this, arguments);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function _inheritsLoose(subClass, superClass) {
|
|
200
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
201
|
+
subClass.prototype.constructor = subClass;
|
|
202
|
+
|
|
203
|
+
_setPrototypeOf(subClass, superClass);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function _setPrototypeOf(o, p) {
|
|
207
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
208
|
+
o.__proto__ = p;
|
|
209
|
+
return o;
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
return _setPrototypeOf(o, p);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
216
|
+
if (source == null) return {};
|
|
217
|
+
var target = {};
|
|
218
|
+
var sourceKeys = Object.keys(source);
|
|
219
|
+
var key, i;
|
|
220
|
+
|
|
221
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
222
|
+
key = sourceKeys[i];
|
|
223
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
224
|
+
target[key] = source[key];
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
return target;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Traverses the tree of elements from a `React.createElement`. Notice we can't
|
|
232
|
+
* traverse elements created within the children's render function since this is
|
|
233
|
+
* the tree before rendering.
|
|
234
|
+
*/
|
|
235
|
+
function traverseReactEltTree(children, callback) {
|
|
236
|
+
var rec = function rec(elts) {
|
|
237
|
+
(Array.isArray(elts) ? elts : [elts]).forEach(function (elt) {
|
|
238
|
+
if (elt) {
|
|
239
|
+
var _elt$props;
|
|
240
|
+
|
|
241
|
+
callback(elt);
|
|
242
|
+
|
|
243
|
+
if (elt.children) {
|
|
244
|
+
rec(elt.children);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
if ((_elt$props = elt.props) != null && _elt$props.children && elt.props.children !== elt.children) {
|
|
248
|
+
rec(elt.props.children);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
rec(children);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
var CheckboxWrapper = /*#__PURE__*/function (_React$Component) {
|
|
258
|
+
_inheritsLoose(CheckboxWrapper, _React$Component);
|
|
259
|
+
|
|
260
|
+
function CheckboxWrapper() {
|
|
261
|
+
return _React$Component.apply(this, arguments) || this;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
var _proto = CheckboxWrapper.prototype;
|
|
265
|
+
|
|
266
|
+
_proto.render = function render() {
|
|
267
|
+
return React.createElement(Checkbox, Object.assign({}, this.props));
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
return CheckboxWrapper;
|
|
271
|
+
}(React.Component);
|
|
272
|
+
|
|
273
|
+
var checkboxMeta = {
|
|
274
|
+
name: "AntdCheckbox",
|
|
275
|
+
displayName: "Antd Checkbox",
|
|
276
|
+
props: {
|
|
277
|
+
autoFocus: {
|
|
278
|
+
type: "boolean",
|
|
279
|
+
description: "If get focus when component mounted",
|
|
280
|
+
defaultValueHint: false
|
|
281
|
+
},
|
|
282
|
+
checked: {
|
|
283
|
+
type: "boolean",
|
|
284
|
+
editOnly: true,
|
|
285
|
+
uncontrolledProp: "defaultChecked",
|
|
286
|
+
description: "Specifies the initial state: whether or not the checkbox is selected",
|
|
287
|
+
defaultValueHint: false
|
|
288
|
+
},
|
|
289
|
+
disabled: {
|
|
290
|
+
type: "boolean",
|
|
291
|
+
description: "If disable checkbox",
|
|
292
|
+
defaultValueHint: false
|
|
293
|
+
},
|
|
294
|
+
indeterminate: {
|
|
295
|
+
type: "boolean",
|
|
296
|
+
description: "The indeterminate checked state of checkbox",
|
|
297
|
+
defaultValueHint: false
|
|
298
|
+
},
|
|
299
|
+
value: {
|
|
300
|
+
type: "string",
|
|
301
|
+
description: "The checkbox value"
|
|
302
|
+
},
|
|
303
|
+
children: {
|
|
304
|
+
type: "slot",
|
|
305
|
+
defaultValue: [{
|
|
306
|
+
type: "text",
|
|
307
|
+
value: "Checkbox"
|
|
308
|
+
}]
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
importPath: "antd/lib/checkbox/Checkbox",
|
|
312
|
+
importName: "Checkbox",
|
|
313
|
+
defaultStyles: {
|
|
314
|
+
marginLeft: 0
|
|
315
|
+
},
|
|
316
|
+
isDefaultExport: true
|
|
317
|
+
};
|
|
318
|
+
function registerCheckbox(loader, customCheckboxMeta) {
|
|
319
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
320
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
doRegisterComponent(CheckboxWrapper, customCheckboxMeta != null ? customCheckboxMeta : checkboxMeta);
|
|
324
|
+
}
|
|
325
|
+
var checkboxGroupMeta = {
|
|
326
|
+
name: "AntdCheckboxGroup",
|
|
327
|
+
displayName: "Antd Checkbox Group",
|
|
328
|
+
props: {
|
|
329
|
+
disabled: {
|
|
330
|
+
type: "boolean",
|
|
331
|
+
description: "If disable all checkboxes",
|
|
332
|
+
defaultValueHint: false
|
|
333
|
+
},
|
|
334
|
+
value: {
|
|
335
|
+
type: "choice",
|
|
336
|
+
editOnly: true,
|
|
337
|
+
uncontrolledProp: "defaultValue",
|
|
338
|
+
description: "Default selected value",
|
|
339
|
+
multiSelect: true,
|
|
340
|
+
options: function options(componentProps) {
|
|
341
|
+
var options = new Set();
|
|
342
|
+
traverseReactEltTree(componentProps.children, function (elt) {
|
|
343
|
+
var _elt$props;
|
|
344
|
+
|
|
345
|
+
if ((elt == null ? void 0 : elt.type) === CheckboxWrapper && typeof (elt == null ? void 0 : (_elt$props = elt.props) == null ? void 0 : _elt$props.value) === "string") {
|
|
346
|
+
options.add(elt.props.value);
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
return Array.from(options.keys());
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
children: {
|
|
353
|
+
type: "slot",
|
|
354
|
+
allowedComponents: ["AntdCheckbox"],
|
|
355
|
+
defaultValue: [{
|
|
356
|
+
type: "component",
|
|
357
|
+
name: "AntdCheckbox"
|
|
358
|
+
}]
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
importPath: "antd/lib/checkbox/Group",
|
|
362
|
+
importName: "CheckboxGroup",
|
|
363
|
+
parentComponentName: "AntdCheckbox",
|
|
364
|
+
isDefaultExport: true
|
|
365
|
+
};
|
|
366
|
+
function registerCheckboxGroup(loader, customCheckboxGroupMeta) {
|
|
367
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
368
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
doRegisterComponent(CheckboxGroup, customCheckboxGroupMeta != null ? customCheckboxGroupMeta : checkboxGroupMeta);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
var _excluded = ["openIcon", "closeIcon"];
|
|
375
|
+
var collapstePanelMeta = {
|
|
376
|
+
name: "AntdCollapsePanel",
|
|
377
|
+
displayName: "Antd Collapse Panel",
|
|
378
|
+
props: {
|
|
379
|
+
collapsible: {
|
|
380
|
+
type: "choice",
|
|
381
|
+
options: ["header", "disabled"],
|
|
382
|
+
description: "Specify whether the panel be collapsible or the trigger area of collapsible"
|
|
383
|
+
},
|
|
384
|
+
forceRender: {
|
|
385
|
+
type: "boolean",
|
|
386
|
+
description: "Forced render of content on panel, instead of lazy rending after clicking on header",
|
|
387
|
+
defaultValueHint: false
|
|
388
|
+
},
|
|
389
|
+
header: {
|
|
390
|
+
type: "slot",
|
|
391
|
+
defaultValue: [{
|
|
392
|
+
type: "text",
|
|
393
|
+
value: "Header"
|
|
394
|
+
}]
|
|
395
|
+
},
|
|
396
|
+
key: {
|
|
397
|
+
type: "string",
|
|
398
|
+
description: "Unique key identifying the panel from among its siblings"
|
|
399
|
+
},
|
|
400
|
+
showArrow: {
|
|
401
|
+
type: "boolean",
|
|
402
|
+
description: "If false, panel will not show arrow icon",
|
|
403
|
+
defaultValueHint: true
|
|
404
|
+
},
|
|
405
|
+
extra: {
|
|
406
|
+
type: "slot",
|
|
407
|
+
hidePlaceholder: true
|
|
408
|
+
},
|
|
409
|
+
children: {
|
|
410
|
+
type: "slot",
|
|
411
|
+
defaultValue: [{
|
|
412
|
+
type: "text",
|
|
413
|
+
value: "Insert text here"
|
|
414
|
+
}]
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
importPath: "antd/lib/collapse/CollapsePanel",
|
|
418
|
+
importName: "CollapsePanel",
|
|
419
|
+
parentComponentName: "AntdCollapse",
|
|
420
|
+
isDefaultExport: true
|
|
421
|
+
};
|
|
422
|
+
function registerCollapsePanel(loader, customCollapsePanelMeta) {
|
|
423
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
424
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
doRegisterComponent(CollapsePanel, customCollapsePanelMeta != null ? customCollapsePanelMeta : collapstePanelMeta);
|
|
428
|
+
}
|
|
429
|
+
var collapsteMeta = {
|
|
430
|
+
name: "AntdCollapse",
|
|
431
|
+
displayName: "Antd Collapse",
|
|
432
|
+
props: {
|
|
433
|
+
accordion: {
|
|
434
|
+
type: "boolean",
|
|
435
|
+
description: "If true, Collapse renders as Accordion",
|
|
436
|
+
defaultValueHint: false
|
|
437
|
+
},
|
|
438
|
+
activeKey: {
|
|
439
|
+
type: "choice",
|
|
440
|
+
editOnly: true,
|
|
441
|
+
uncontrolledProp: "defaultActiveKey",
|
|
442
|
+
description: "Key of the active panel",
|
|
443
|
+
multiSelect: true,
|
|
444
|
+
options: function options(componentProps) {
|
|
445
|
+
var options = new Set(); // `children` is not defined in the Collapse props
|
|
446
|
+
|
|
447
|
+
traverseReactEltTree(componentProps.children, function (elt) {
|
|
448
|
+
if ((elt == null ? void 0 : elt.type) === CollapsePanel && typeof (elt == null ? void 0 : elt.key) === "string") {
|
|
449
|
+
options.add(elt.key);
|
|
450
|
+
}
|
|
451
|
+
});
|
|
452
|
+
return Array.from(options.keys());
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
bordered: {
|
|
456
|
+
type: "boolean",
|
|
457
|
+
description: "Toggles rendering of the border around the collapse block",
|
|
458
|
+
defaultValueHint: true
|
|
459
|
+
},
|
|
460
|
+
collapsible: {
|
|
461
|
+
type: "choice",
|
|
462
|
+
options: ["header", "disabled"],
|
|
463
|
+
description: "Specify whether the panels of children be collapsible or the trigger area of collapsible"
|
|
464
|
+
},
|
|
465
|
+
expandIconPosition: {
|
|
466
|
+
type: "choice",
|
|
467
|
+
options: ["left", "right"],
|
|
468
|
+
description: "Set expand icon position",
|
|
469
|
+
defaultValueHint: "left"
|
|
470
|
+
},
|
|
471
|
+
ghost: {
|
|
472
|
+
type: "boolean",
|
|
473
|
+
description: "Make the collapse borderless and its background transparent",
|
|
474
|
+
defaultValueHint: false
|
|
475
|
+
},
|
|
476
|
+
children: {
|
|
477
|
+
type: "slot",
|
|
478
|
+
allowedComponents: ["AntdCollapsePanel"],
|
|
479
|
+
defaultValue: [{
|
|
480
|
+
type: "component",
|
|
481
|
+
name: "AntdCollapsePanel",
|
|
482
|
+
props: {
|
|
483
|
+
key: "1"
|
|
484
|
+
}
|
|
485
|
+
}]
|
|
486
|
+
},
|
|
487
|
+
openIcon: {
|
|
488
|
+
type: "slot",
|
|
489
|
+
hidePlaceholder: true
|
|
490
|
+
},
|
|
491
|
+
closeIcon: {
|
|
492
|
+
type: "slot",
|
|
493
|
+
hidePlaceholder: true
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
importPath: "@plasmicpkgs/antd/skinny/registerCollapse",
|
|
497
|
+
importName: "Collapse"
|
|
498
|
+
};
|
|
499
|
+
function Collapse(props) {
|
|
500
|
+
var openIcon = props.openIcon,
|
|
501
|
+
closeIcon = props.closeIcon,
|
|
502
|
+
rest = _objectWithoutPropertiesLoose(props, _excluded);
|
|
503
|
+
|
|
504
|
+
return React.createElement(AntdCollapse, Object.assign({}, rest, {
|
|
505
|
+
expandIcon: openIcon || closeIcon ? function (_ref) {
|
|
506
|
+
var isActive = _ref.isActive;
|
|
507
|
+
return isActive ? openIcon : closeIcon;
|
|
508
|
+
} : undefined
|
|
509
|
+
}));
|
|
510
|
+
}
|
|
511
|
+
function registerCollapse(loader, customCollapseMeta) {
|
|
512
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
513
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
514
|
+
};
|
|
515
|
+
|
|
516
|
+
doRegisterComponent(Collapse, customCollapseMeta != null ? customCollapseMeta : collapsteMeta);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
var Dropdown = /*#__PURE__*/function (_React$Component) {
|
|
520
|
+
_inheritsLoose(Dropdown, _React$Component);
|
|
521
|
+
|
|
522
|
+
function Dropdown() {
|
|
523
|
+
return _React$Component.apply(this, arguments) || this;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
var _proto = Dropdown.prototype;
|
|
527
|
+
|
|
528
|
+
_proto.render = function render() {
|
|
529
|
+
var finalProps = _extends({}, this.props);
|
|
530
|
+
|
|
531
|
+
finalProps.children = typeof this.props.children === "string" ? React.createElement("div", null, this.props.children) : this.props.children;
|
|
532
|
+
return React.createElement(AntdDropdown, Object.assign({}, finalProps));
|
|
533
|
+
};
|
|
534
|
+
|
|
535
|
+
return Dropdown;
|
|
536
|
+
}(React.Component);
|
|
537
|
+
var dropdownMeta = {
|
|
538
|
+
name: "AntdDropdown",
|
|
539
|
+
displayName: "Antd Dropdown",
|
|
540
|
+
props: {
|
|
541
|
+
arrow: {
|
|
542
|
+
type: "boolean",
|
|
543
|
+
description: "Whether the dropdown arrow should be visible",
|
|
544
|
+
defaultValueHint: false
|
|
545
|
+
},
|
|
546
|
+
disabled: {
|
|
547
|
+
type: "boolean",
|
|
548
|
+
description: "Whether the dropdown menu is disabled",
|
|
549
|
+
defaultValueHint: false
|
|
550
|
+
},
|
|
551
|
+
overlay: {
|
|
552
|
+
type: "slot",
|
|
553
|
+
allowedComponents: ["AntdMenu"],
|
|
554
|
+
defaultValue: [{
|
|
555
|
+
type: "component",
|
|
556
|
+
name: "AntdMenu"
|
|
557
|
+
}]
|
|
558
|
+
},
|
|
559
|
+
placement: {
|
|
560
|
+
type: "choice",
|
|
561
|
+
options: ["bottomLeft", "bottomCenter", "bottomRight", "topLeft", "topCenter", "topRight"],
|
|
562
|
+
description: "Placement of popup menu",
|
|
563
|
+
defaultValueHint: "bottomLeft"
|
|
564
|
+
},
|
|
565
|
+
trigger: {
|
|
566
|
+
type: "choice",
|
|
567
|
+
options: ["click", "hover", "contextMenu"],
|
|
568
|
+
description: "The trigger mode which executes the dropdown action",
|
|
569
|
+
defaultValueHint: "hover"
|
|
570
|
+
},
|
|
571
|
+
visible: {
|
|
572
|
+
type: "boolean",
|
|
573
|
+
description: "Toggle visibility of dropdown menu in Plasmic Editor",
|
|
574
|
+
editOnly: true,
|
|
575
|
+
defaultValueHint: false
|
|
576
|
+
},
|
|
577
|
+
children: {
|
|
578
|
+
type: "slot",
|
|
579
|
+
defaultValue: [{
|
|
580
|
+
type: "text",
|
|
581
|
+
value: "Dropdown"
|
|
582
|
+
}]
|
|
583
|
+
}
|
|
584
|
+
},
|
|
585
|
+
importPath: "@plasmicpkgs/antd/skinny/registerDropdown",
|
|
586
|
+
importName: "Dropdown"
|
|
587
|
+
};
|
|
588
|
+
function registerDropdown(loader, customDropdownMeta) {
|
|
589
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
590
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
591
|
+
};
|
|
592
|
+
|
|
593
|
+
doRegisterComponent(Dropdown, customDropdownMeta != null ? customDropdownMeta : dropdownMeta);
|
|
594
|
+
}
|
|
595
|
+
var dropdownButtonMeta = {
|
|
596
|
+
name: "AntdDropdownButton",
|
|
597
|
+
displayName: "Antd Dropdown Button",
|
|
598
|
+
props: {
|
|
599
|
+
disabled: {
|
|
600
|
+
type: "boolean",
|
|
601
|
+
description: "Whether the dropdown menu is disabled",
|
|
602
|
+
defaultValueHint: false
|
|
603
|
+
},
|
|
604
|
+
icon: {
|
|
605
|
+
type: "slot",
|
|
606
|
+
hidePlaceholder: true
|
|
607
|
+
},
|
|
608
|
+
overlay: {
|
|
609
|
+
type: "slot",
|
|
610
|
+
allowedComponents: ["AntdMenu"],
|
|
611
|
+
defaultValue: [{
|
|
612
|
+
type: "component",
|
|
613
|
+
name: "AntdMenu"
|
|
614
|
+
}]
|
|
615
|
+
},
|
|
616
|
+
placement: {
|
|
617
|
+
type: "choice",
|
|
618
|
+
options: ["bottomLeft", "bottomCenter", "bottomRight", "topLeft", "topCenter", "topRight"],
|
|
619
|
+
description: "Placement of popup menu",
|
|
620
|
+
defaultValueHint: "bottomLeft"
|
|
621
|
+
},
|
|
622
|
+
size: {
|
|
623
|
+
type: "choice",
|
|
624
|
+
options: ["small", "medium", "large"],
|
|
625
|
+
description: "Set the size of button",
|
|
626
|
+
defaultValueHint: "medium"
|
|
627
|
+
},
|
|
628
|
+
trigger: {
|
|
629
|
+
type: "choice",
|
|
630
|
+
options: ["click", "hover", "contextMenu"],
|
|
631
|
+
description: "The trigger mode which executes the dropdown action",
|
|
632
|
+
defaultValueHint: "hover"
|
|
633
|
+
},
|
|
634
|
+
type: {
|
|
635
|
+
type: "choice",
|
|
636
|
+
options: ["default", "primary", "ghost", "dashed", "link", "text"],
|
|
637
|
+
description: "Can be set to primary, ghost, dashed, link, text, default",
|
|
638
|
+
defaultValueHint: "default"
|
|
639
|
+
},
|
|
640
|
+
visible: {
|
|
641
|
+
type: "boolean",
|
|
642
|
+
description: "Toggle visibility of dropdown menu in Plasmic Editor",
|
|
643
|
+
editOnly: true,
|
|
644
|
+
defaultValueHint: false
|
|
645
|
+
},
|
|
646
|
+
children: {
|
|
647
|
+
type: "slot",
|
|
648
|
+
defaultValue: [{
|
|
649
|
+
type: "text",
|
|
650
|
+
value: "Dropdown"
|
|
651
|
+
}]
|
|
652
|
+
}
|
|
653
|
+
},
|
|
654
|
+
importPath: "antd/lib/dropdown/dropdown-button",
|
|
655
|
+
importName: "DropdownButton",
|
|
656
|
+
parentComponentName: "AntdDropdown",
|
|
657
|
+
isDefaultExport: true
|
|
658
|
+
};
|
|
659
|
+
function registerDropdownButton(loader, customDropdownButtonMeta) {
|
|
660
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
661
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
662
|
+
};
|
|
663
|
+
|
|
664
|
+
doRegisterComponent(DropdownButton, customDropdownButtonMeta != null ? customDropdownButtonMeta : dropdownButtonMeta);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
function sortObjectKeys(obj) {
|
|
668
|
+
return Object.fromEntries(Object.entries(obj).sort());
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
function sortProps(props) {
|
|
672
|
+
return sortObjectKeys(props);
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
var commonHtmlAttributes = {
|
|
676
|
+
"aria-label": {
|
|
677
|
+
type: "string",
|
|
678
|
+
description: "The ARIA label for this input"
|
|
679
|
+
},
|
|
680
|
+
"aria-labelledby": {
|
|
681
|
+
type: "string",
|
|
682
|
+
description: "Identifies the element(s) that labels this input"
|
|
683
|
+
},
|
|
684
|
+
name: {
|
|
685
|
+
type: "string",
|
|
686
|
+
description: "The HTML name of the input"
|
|
687
|
+
}
|
|
688
|
+
};
|
|
689
|
+
var inputMeta = {
|
|
690
|
+
name: "AntdInput",
|
|
691
|
+
displayName: "Antd Input",
|
|
692
|
+
props: /*#__PURE__*/sortProps( /*#__PURE__*/_extends({}, commonHtmlAttributes, {
|
|
693
|
+
addonAfter: {
|
|
694
|
+
type: "slot",
|
|
695
|
+
hidePlaceholder: true
|
|
696
|
+
},
|
|
697
|
+
addonBefore: {
|
|
698
|
+
type: "slot",
|
|
699
|
+
hidePlaceholder: true
|
|
700
|
+
},
|
|
701
|
+
allowClear: {
|
|
702
|
+
type: "boolean",
|
|
703
|
+
description: "If allow to remove input content with clear icon",
|
|
704
|
+
defaultValueHint: false
|
|
705
|
+
},
|
|
706
|
+
bordered: {
|
|
707
|
+
type: "boolean",
|
|
708
|
+
description: "Whether has border style",
|
|
709
|
+
defaultValueHint: true
|
|
710
|
+
},
|
|
711
|
+
disabled: {
|
|
712
|
+
type: "boolean",
|
|
713
|
+
description: "Whether the input is disabled",
|
|
714
|
+
defaultValueHint: false
|
|
715
|
+
},
|
|
716
|
+
id: {
|
|
717
|
+
type: "string",
|
|
718
|
+
description: "The ID for input"
|
|
719
|
+
},
|
|
720
|
+
maxLength: {
|
|
721
|
+
type: "number",
|
|
722
|
+
description: "The max length"
|
|
723
|
+
},
|
|
724
|
+
placeholder: {
|
|
725
|
+
type: "string",
|
|
726
|
+
description: "Placeholder for the input"
|
|
727
|
+
},
|
|
728
|
+
prefix: {
|
|
729
|
+
type: "slot",
|
|
730
|
+
hidePlaceholder: true
|
|
731
|
+
},
|
|
732
|
+
size: {
|
|
733
|
+
type: "choice",
|
|
734
|
+
options: ["small", "middle", "large"],
|
|
735
|
+
description: "The size of the input box",
|
|
736
|
+
defaultValueHint: "middle,"
|
|
737
|
+
},
|
|
738
|
+
suffix: {
|
|
739
|
+
type: "slot",
|
|
740
|
+
hidePlaceholder: true
|
|
741
|
+
},
|
|
742
|
+
type: {
|
|
743
|
+
type: "string",
|
|
744
|
+
description: "The type of input",
|
|
745
|
+
defaultValueHint: "text"
|
|
746
|
+
},
|
|
747
|
+
value: {
|
|
748
|
+
type: "string",
|
|
749
|
+
editOnly: true,
|
|
750
|
+
uncontrolledProp: "defaultValue"
|
|
751
|
+
}
|
|
752
|
+
})),
|
|
753
|
+
importPath: "antd/lib/input",
|
|
754
|
+
importName: "Input",
|
|
755
|
+
isDefaultExport: true
|
|
756
|
+
};
|
|
757
|
+
function registerInput(loader, customInputMeta) {
|
|
758
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
759
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
760
|
+
};
|
|
761
|
+
|
|
762
|
+
doRegisterComponent(Input, customInputMeta != null ? customInputMeta : inputMeta);
|
|
763
|
+
}
|
|
764
|
+
var inputTextAreaMeta = {
|
|
765
|
+
name: "AntdInputTextArea",
|
|
766
|
+
displayName: "Antd Input Text Area",
|
|
767
|
+
props: /*#__PURE__*/sortProps( /*#__PURE__*/_extends({}, commonHtmlAttributes, {
|
|
768
|
+
allowClear: {
|
|
769
|
+
type: "boolean",
|
|
770
|
+
description: "If allow to remove input content with clear icon",
|
|
771
|
+
defaultValueHint: false
|
|
772
|
+
},
|
|
773
|
+
autoSize: {
|
|
774
|
+
type: "object",
|
|
775
|
+
description: "Height autosize feature, can be set to true | false or an object { minRows: 2, maxRows: 6 }"
|
|
776
|
+
},
|
|
777
|
+
disabled: {
|
|
778
|
+
type: "boolean",
|
|
779
|
+
description: "Whether the input is disabled",
|
|
780
|
+
defaultValueHint: false
|
|
781
|
+
},
|
|
782
|
+
bordered: {
|
|
783
|
+
type: "boolean",
|
|
784
|
+
description: "Whether has border style",
|
|
785
|
+
defaultValueHint: true
|
|
786
|
+
},
|
|
787
|
+
showCount: {
|
|
788
|
+
type: "boolean",
|
|
789
|
+
description: "Whether show text count",
|
|
790
|
+
defaultValueHint: false
|
|
791
|
+
},
|
|
792
|
+
id: {
|
|
793
|
+
type: "string",
|
|
794
|
+
description: "The ID for input"
|
|
795
|
+
},
|
|
796
|
+
maxLength: {
|
|
797
|
+
type: "number",
|
|
798
|
+
description: "The max length"
|
|
799
|
+
},
|
|
800
|
+
placeholder: {
|
|
801
|
+
type: "string",
|
|
802
|
+
description: "Placeholder for the input"
|
|
803
|
+
},
|
|
804
|
+
value: {
|
|
805
|
+
type: "string",
|
|
806
|
+
editOnly: true,
|
|
807
|
+
uncontrolledProp: "defaultValue"
|
|
808
|
+
}
|
|
809
|
+
})),
|
|
810
|
+
importPath: "antd/lib/input/TextArea",
|
|
811
|
+
importName: "TextArea",
|
|
812
|
+
isDefaultExport: true,
|
|
813
|
+
parentComponentName: "AntdInput"
|
|
814
|
+
};
|
|
815
|
+
function registerInputTextArea(loader, customInputTextAreaMeta) {
|
|
816
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
817
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
doRegisterComponent(TextArea, customInputTextAreaMeta != null ? customInputTextAreaMeta : inputTextAreaMeta);
|
|
821
|
+
}
|
|
822
|
+
var inputSearchMeta = {
|
|
823
|
+
name: "AntdInputSearch",
|
|
824
|
+
displayName: "Antd Input Search",
|
|
825
|
+
props: /*#__PURE__*/sortProps( /*#__PURE__*/_extends({}, commonHtmlAttributes, {
|
|
826
|
+
addonBefore: {
|
|
827
|
+
type: "slot",
|
|
828
|
+
hidePlaceholder: true
|
|
829
|
+
},
|
|
830
|
+
allowClear: {
|
|
831
|
+
type: "boolean",
|
|
832
|
+
description: "If allow to remove input content with clear icon",
|
|
833
|
+
defaultValueHint: false
|
|
834
|
+
},
|
|
835
|
+
bordered: {
|
|
836
|
+
type: "boolean",
|
|
837
|
+
description: "Whether has border style",
|
|
838
|
+
defaultValueHint: true
|
|
839
|
+
},
|
|
840
|
+
disabled: {
|
|
841
|
+
type: "boolean",
|
|
842
|
+
description: "Whether the input is disabled",
|
|
843
|
+
defaultValueHint: false
|
|
844
|
+
},
|
|
845
|
+
enterButton: {
|
|
846
|
+
type: "slot",
|
|
847
|
+
hidePlaceholder: true
|
|
848
|
+
},
|
|
849
|
+
id: {
|
|
850
|
+
type: "string",
|
|
851
|
+
description: "The ID for input"
|
|
852
|
+
},
|
|
853
|
+
loading: {
|
|
854
|
+
type: "boolean",
|
|
855
|
+
description: "Search box with loading",
|
|
856
|
+
defaultValueHint: false
|
|
857
|
+
},
|
|
858
|
+
maxLength: {
|
|
859
|
+
type: "number",
|
|
860
|
+
description: "The max length"
|
|
861
|
+
},
|
|
862
|
+
placeholder: {
|
|
863
|
+
type: "string",
|
|
864
|
+
description: "Placeholder for the input"
|
|
865
|
+
},
|
|
866
|
+
prefix: {
|
|
867
|
+
type: "slot",
|
|
868
|
+
hidePlaceholder: true
|
|
869
|
+
},
|
|
870
|
+
size: {
|
|
871
|
+
type: "choice",
|
|
872
|
+
options: ["small", "middle", "large"],
|
|
873
|
+
description: "The size of the input box",
|
|
874
|
+
defaultValueHint: "middle"
|
|
875
|
+
},
|
|
876
|
+
suffix: {
|
|
877
|
+
type: "slot",
|
|
878
|
+
hidePlaceholder: true
|
|
879
|
+
},
|
|
880
|
+
type: {
|
|
881
|
+
type: "string",
|
|
882
|
+
description: "The type of input"
|
|
883
|
+
},
|
|
884
|
+
value: {
|
|
885
|
+
type: "string",
|
|
886
|
+
editOnly: true,
|
|
887
|
+
uncontrolledProp: "defaultValue"
|
|
888
|
+
}
|
|
889
|
+
})),
|
|
890
|
+
importPath: "antd/lib/input/Search",
|
|
891
|
+
importName: "Search",
|
|
892
|
+
isDefaultExport: true,
|
|
893
|
+
parentComponentName: "AntdInput"
|
|
894
|
+
};
|
|
895
|
+
function registerInputSearch(loader, customInputSearchMeta) {
|
|
896
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
897
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
898
|
+
};
|
|
899
|
+
|
|
900
|
+
doRegisterComponent(Search, customInputSearchMeta != null ? customInputSearchMeta : inputSearchMeta);
|
|
901
|
+
}
|
|
902
|
+
var inputPasswordMeta = {
|
|
903
|
+
name: "AntdInputPassword",
|
|
904
|
+
displayName: "Antd Input Password",
|
|
905
|
+
props: /*#__PURE__*/sortProps( /*#__PURE__*/_extends({}, commonHtmlAttributes, {
|
|
906
|
+
addonAfter: {
|
|
907
|
+
type: "slot",
|
|
908
|
+
hidePlaceholder: true
|
|
909
|
+
},
|
|
910
|
+
addonBefore: {
|
|
911
|
+
type: "slot",
|
|
912
|
+
hidePlaceholder: true
|
|
913
|
+
},
|
|
914
|
+
allowClear: {
|
|
915
|
+
type: "boolean",
|
|
916
|
+
description: "If allow to remove input content with clear icon",
|
|
917
|
+
defaultValueHint: false
|
|
918
|
+
},
|
|
919
|
+
bordered: {
|
|
920
|
+
type: "boolean",
|
|
921
|
+
description: "Whether has border style",
|
|
922
|
+
defaultValueHint: true
|
|
923
|
+
},
|
|
924
|
+
disabled: {
|
|
925
|
+
type: "boolean",
|
|
926
|
+
description: "Whether the input is disabled",
|
|
927
|
+
defaultValueHint: false
|
|
928
|
+
},
|
|
929
|
+
id: {
|
|
930
|
+
type: "string",
|
|
931
|
+
description: "The ID for input"
|
|
932
|
+
},
|
|
933
|
+
maxLength: {
|
|
934
|
+
type: "number",
|
|
935
|
+
description: "The max length"
|
|
936
|
+
},
|
|
937
|
+
placeholder: {
|
|
938
|
+
type: "string",
|
|
939
|
+
description: "Placeholder for the input"
|
|
940
|
+
},
|
|
941
|
+
prefix: {
|
|
942
|
+
type: "slot",
|
|
943
|
+
hidePlaceholder: true
|
|
944
|
+
},
|
|
945
|
+
size: {
|
|
946
|
+
type: "choice",
|
|
947
|
+
options: ["small", "middle", "large"],
|
|
948
|
+
description: "The size of the input box",
|
|
949
|
+
defaultValueHint: "middle"
|
|
950
|
+
},
|
|
951
|
+
type: {
|
|
952
|
+
type: "string",
|
|
953
|
+
description: "The type of input"
|
|
954
|
+
},
|
|
955
|
+
value: {
|
|
956
|
+
type: "string",
|
|
957
|
+
editOnly: true,
|
|
958
|
+
uncontrolledProp: "defaultValue"
|
|
959
|
+
},
|
|
960
|
+
visibilityToggle: {
|
|
961
|
+
type: "boolean",
|
|
962
|
+
description: "Whether show toggle button",
|
|
963
|
+
defaultValueHint: true
|
|
964
|
+
}
|
|
965
|
+
})),
|
|
966
|
+
importPath: "antd/lib/input/Password",
|
|
967
|
+
importName: "Password",
|
|
968
|
+
isDefaultExport: true,
|
|
969
|
+
parentComponentName: "AntdInput"
|
|
970
|
+
};
|
|
971
|
+
function registerInputPassword(loader, customInputPasswordMeta) {
|
|
972
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
973
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
974
|
+
};
|
|
975
|
+
|
|
976
|
+
doRegisterComponent(Password, customInputPasswordMeta != null ? customInputPasswordMeta : inputPasswordMeta);
|
|
977
|
+
}
|
|
978
|
+
var inputGroupMeta = {
|
|
979
|
+
name: "AntdInputGroup",
|
|
980
|
+
displayName: "Antd Input Group",
|
|
981
|
+
props: {
|
|
982
|
+
compact: {
|
|
983
|
+
type: "boolean",
|
|
984
|
+
description: "Whether use compact style",
|
|
985
|
+
defaultValueHint: false
|
|
986
|
+
},
|
|
987
|
+
size: {
|
|
988
|
+
type: "choice",
|
|
989
|
+
options: ["small", "default", "large"],
|
|
990
|
+
description: "The size of Input.Group specifies the size of the included Input fields",
|
|
991
|
+
defaultValueHint: "default"
|
|
992
|
+
},
|
|
993
|
+
children: {
|
|
994
|
+
type: "slot",
|
|
995
|
+
defaultValue: [{
|
|
996
|
+
type: "component",
|
|
997
|
+
name: "AntdInput"
|
|
998
|
+
}, {
|
|
999
|
+
type: "component",
|
|
1000
|
+
name: "AntdInput"
|
|
1001
|
+
}]
|
|
1002
|
+
}
|
|
1003
|
+
},
|
|
1004
|
+
importPath: "antd/lib/input/Group",
|
|
1005
|
+
importName: "InputGroup",
|
|
1006
|
+
isDefaultExport: true,
|
|
1007
|
+
parentComponentName: "AntdInput"
|
|
1008
|
+
};
|
|
1009
|
+
function registerInputGroup(loader, customInputGroupMeta) {
|
|
1010
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
1011
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
1012
|
+
};
|
|
1013
|
+
|
|
1014
|
+
doRegisterComponent(InputGroup, customInputGroupMeta != null ? customInputGroupMeta : inputGroupMeta);
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
var menuDividerMeta = {
|
|
1018
|
+
name: "AntdMenuDivider",
|
|
1019
|
+
displayName: "Antd Menu Divider",
|
|
1020
|
+
props: {
|
|
1021
|
+
dashed: {
|
|
1022
|
+
type: "boolean",
|
|
1023
|
+
description: "Whether line is dashed",
|
|
1024
|
+
defaultValueHint: false
|
|
1025
|
+
}
|
|
1026
|
+
},
|
|
1027
|
+
importPath: "antd/lib/menu/MenuDivider",
|
|
1028
|
+
importName: "MenuDivider",
|
|
1029
|
+
isDefaultExport: true,
|
|
1030
|
+
parentComponentName: "AntdMenu"
|
|
1031
|
+
};
|
|
1032
|
+
function registerMenuDivider(loader, customMenuDividerMeta) {
|
|
1033
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
1034
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
1035
|
+
};
|
|
1036
|
+
|
|
1037
|
+
doRegisterComponent(MenuDivider, customMenuDividerMeta != null ? customMenuDividerMeta : menuDividerMeta);
|
|
1038
|
+
}
|
|
1039
|
+
var menuItemMeta = {
|
|
1040
|
+
name: "AntdMenuItem",
|
|
1041
|
+
displayName: "Antd Menu Item",
|
|
1042
|
+
props: {
|
|
1043
|
+
danger: {
|
|
1044
|
+
type: "boolean",
|
|
1045
|
+
description: "Display the danger style",
|
|
1046
|
+
defaultValueHint: false
|
|
1047
|
+
},
|
|
1048
|
+
disabled: {
|
|
1049
|
+
type: "boolean",
|
|
1050
|
+
description: "Whether disabled select",
|
|
1051
|
+
defaultValueHint: false
|
|
1052
|
+
},
|
|
1053
|
+
key: {
|
|
1054
|
+
type: "string",
|
|
1055
|
+
description: "Unique ID of the menu item",
|
|
1056
|
+
defaultValue: "menuItemKey"
|
|
1057
|
+
},
|
|
1058
|
+
title: {
|
|
1059
|
+
type: "string",
|
|
1060
|
+
description: "Set display title for collapsed item"
|
|
1061
|
+
},
|
|
1062
|
+
children: {
|
|
1063
|
+
type: "slot",
|
|
1064
|
+
defaultValue: [{
|
|
1065
|
+
type: "text",
|
|
1066
|
+
value: "Option"
|
|
1067
|
+
}]
|
|
1068
|
+
}
|
|
1069
|
+
},
|
|
1070
|
+
importPath: "antd/lib/menu/MenuItem",
|
|
1071
|
+
importName: "MenuItem",
|
|
1072
|
+
isDefaultExport: true,
|
|
1073
|
+
parentComponentName: "AntdMenu"
|
|
1074
|
+
};
|
|
1075
|
+
function registerMenuItem(loader, customMenuItemMeta) {
|
|
1076
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
1077
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
1078
|
+
};
|
|
1079
|
+
|
|
1080
|
+
doRegisterComponent(MenuItem, customMenuItemMeta != null ? customMenuItemMeta : menuItemMeta);
|
|
1081
|
+
}
|
|
1082
|
+
var menuItemGroupMeta = {
|
|
1083
|
+
name: "AntdMenuItemGroup",
|
|
1084
|
+
displayName: "Antd Menu Item Group",
|
|
1085
|
+
props: {
|
|
1086
|
+
title: {
|
|
1087
|
+
type: "slot",
|
|
1088
|
+
defaultValue: [{
|
|
1089
|
+
type: "text",
|
|
1090
|
+
value: "Group"
|
|
1091
|
+
}]
|
|
1092
|
+
},
|
|
1093
|
+
children: {
|
|
1094
|
+
type: "slot",
|
|
1095
|
+
allowedComponents: ["AntdMenuItem", "AntdMenuDivider", "AntdMenuItemGroup"],
|
|
1096
|
+
defaultValue: [{
|
|
1097
|
+
type: "component",
|
|
1098
|
+
name: "AntdMenuItem"
|
|
1099
|
+
}]
|
|
1100
|
+
}
|
|
1101
|
+
},
|
|
1102
|
+
importPath: "rc-menu",
|
|
1103
|
+
importName: "ItemGroup",
|
|
1104
|
+
parentComponentName: "AntdMenu"
|
|
1105
|
+
};
|
|
1106
|
+
function registerMenuItemGroup(loader, customMenuItemGroupMeta) {
|
|
1107
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
1108
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
1109
|
+
};
|
|
1110
|
+
|
|
1111
|
+
doRegisterComponent(rcMenu.ItemGroup, customMenuItemGroupMeta != null ? customMenuItemGroupMeta : menuItemGroupMeta);
|
|
1112
|
+
}
|
|
1113
|
+
var subMenuMeta = {
|
|
1114
|
+
name: "AntdSubMenu",
|
|
1115
|
+
displayName: "Antd SubMenu",
|
|
1116
|
+
props: {
|
|
1117
|
+
disabled: {
|
|
1118
|
+
type: "boolean",
|
|
1119
|
+
description: "Whether sub-menu is disabled",
|
|
1120
|
+
defaultValueHint: false
|
|
1121
|
+
},
|
|
1122
|
+
key: {
|
|
1123
|
+
type: "string",
|
|
1124
|
+
description: "Unique ID of the sub-menu",
|
|
1125
|
+
defaultValue: "subMenuKey"
|
|
1126
|
+
},
|
|
1127
|
+
title: {
|
|
1128
|
+
type: "slot",
|
|
1129
|
+
defaultValue: [{
|
|
1130
|
+
type: "text",
|
|
1131
|
+
value: "Sub-menu"
|
|
1132
|
+
}]
|
|
1133
|
+
},
|
|
1134
|
+
children: {
|
|
1135
|
+
type: "slot",
|
|
1136
|
+
allowedComponents: ["AntdMenuItem", "AntdMenuDivider", "AntdMenuItemGroup", "AntdSubMenu"],
|
|
1137
|
+
defaultValue: /*#__PURE__*/[1, 2].map(function (i) {
|
|
1138
|
+
return {
|
|
1139
|
+
type: "component",
|
|
1140
|
+
name: "AntdMenuItem",
|
|
1141
|
+
props: {
|
|
1142
|
+
key: "subMenuItemKey" + i,
|
|
1143
|
+
children: [{
|
|
1144
|
+
type: "text",
|
|
1145
|
+
value: "Sub-menu item " + i
|
|
1146
|
+
}]
|
|
1147
|
+
}
|
|
1148
|
+
};
|
|
1149
|
+
})
|
|
1150
|
+
}
|
|
1151
|
+
},
|
|
1152
|
+
importPath: "antd/lib/menu/SubMenu",
|
|
1153
|
+
importName: "SubMenu",
|
|
1154
|
+
isDefaultExport: true,
|
|
1155
|
+
parentComponentName: "AntdMenu"
|
|
1156
|
+
};
|
|
1157
|
+
function registerSubMenu(loader, customSubMenuMeta) {
|
|
1158
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
1159
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
1160
|
+
};
|
|
1161
|
+
|
|
1162
|
+
doRegisterComponent(SubMenu, customSubMenuMeta != null ? customSubMenuMeta : subMenuMeta);
|
|
1163
|
+
}
|
|
1164
|
+
var menuMeta = {
|
|
1165
|
+
name: "AntdMenu",
|
|
1166
|
+
displayName: "Antd Menu",
|
|
1167
|
+
props: {
|
|
1168
|
+
expandIcon: {
|
|
1169
|
+
type: "slot",
|
|
1170
|
+
hidePlaceholder: true
|
|
1171
|
+
},
|
|
1172
|
+
forceSubMenuRender: {
|
|
1173
|
+
type: "boolean",
|
|
1174
|
+
description: "Render submenu into DOM before it becomes visible",
|
|
1175
|
+
defaultValueHint: false
|
|
1176
|
+
},
|
|
1177
|
+
inlineIndent: {
|
|
1178
|
+
type: "number",
|
|
1179
|
+
description: "Indent (in pixels) of inline menu items on each level",
|
|
1180
|
+
defaultValueHint: 24
|
|
1181
|
+
},
|
|
1182
|
+
mode: {
|
|
1183
|
+
type: "choice",
|
|
1184
|
+
options: ["horizontal", "vertical", "inline"],
|
|
1185
|
+
description: "Type of menu",
|
|
1186
|
+
defaultValueHint: "vertical"
|
|
1187
|
+
},
|
|
1188
|
+
multiple: {
|
|
1189
|
+
type: "boolean",
|
|
1190
|
+
description: "Allows selection of multiple items",
|
|
1191
|
+
defaultValueHint: false
|
|
1192
|
+
},
|
|
1193
|
+
openKeys: {
|
|
1194
|
+
type: "choice",
|
|
1195
|
+
editOnly: true,
|
|
1196
|
+
uncontrolledProp: "defaultOpenKeys",
|
|
1197
|
+
description: "Array with the keys of default opened sub menus",
|
|
1198
|
+
multiSelect: true,
|
|
1199
|
+
options: function options(componentProps) {
|
|
1200
|
+
var options = new Set();
|
|
1201
|
+
traverseReactEltTree(componentProps.children, function (elt) {
|
|
1202
|
+
if ((elt == null ? void 0 : elt.type) === SubMenu && typeof (elt == null ? void 0 : elt.key) === "string") {
|
|
1203
|
+
options.add(elt.key);
|
|
1204
|
+
}
|
|
1205
|
+
});
|
|
1206
|
+
return Array.from(options.keys());
|
|
1207
|
+
}
|
|
1208
|
+
},
|
|
1209
|
+
overflowedIndicator: {
|
|
1210
|
+
type: "slot",
|
|
1211
|
+
hidePlaceholder: true
|
|
1212
|
+
},
|
|
1213
|
+
selectable: {
|
|
1214
|
+
type: "boolean",
|
|
1215
|
+
description: "Allows selecting menu items",
|
|
1216
|
+
defaultValueHint: true
|
|
1217
|
+
},
|
|
1218
|
+
selectedKeys: {
|
|
1219
|
+
type: "choice",
|
|
1220
|
+
editOnly: true,
|
|
1221
|
+
uncontrolledProp: "defaultSelectedKeys",
|
|
1222
|
+
description: "Array with the keys of default selected menu items",
|
|
1223
|
+
multiSelect: true,
|
|
1224
|
+
options: function options(componentProps) {
|
|
1225
|
+
var options = new Set();
|
|
1226
|
+
traverseReactEltTree(componentProps.children, function (elt) {
|
|
1227
|
+
if ([SubMenu, MenuItem].includes(elt == null ? void 0 : elt.type) && typeof (elt == null ? void 0 : elt.key) === "string") {
|
|
1228
|
+
options.add(elt.key);
|
|
1229
|
+
}
|
|
1230
|
+
});
|
|
1231
|
+
return Array.from(options.keys());
|
|
1232
|
+
}
|
|
1233
|
+
},
|
|
1234
|
+
subMenuCloseDelay: {
|
|
1235
|
+
type: "number",
|
|
1236
|
+
description: "Delay time to hide submenu when mouse leaves (in seconds)",
|
|
1237
|
+
defaultValueHint: 0.1
|
|
1238
|
+
},
|
|
1239
|
+
subMenuOpenDelay: {
|
|
1240
|
+
type: "number",
|
|
1241
|
+
description: "Delay time to show submenu when mouse enters, (in seconds)",
|
|
1242
|
+
defaultValueHint: 0
|
|
1243
|
+
},
|
|
1244
|
+
theme: {
|
|
1245
|
+
type: "choice",
|
|
1246
|
+
options: ["light", "dark"],
|
|
1247
|
+
description: "Color theme of the menu",
|
|
1248
|
+
defaultValueHint: "light"
|
|
1249
|
+
},
|
|
1250
|
+
triggerSubMenuAction: {
|
|
1251
|
+
type: "choice",
|
|
1252
|
+
options: ["hover", "click"],
|
|
1253
|
+
description: "Which action can trigger submenu open/close",
|
|
1254
|
+
defaultValueHint: "hover"
|
|
1255
|
+
},
|
|
1256
|
+
children: {
|
|
1257
|
+
type: "slot",
|
|
1258
|
+
allowedComponents: ["AntdMenuItem", "AntdMenuDivider", "AntdSubMenu"],
|
|
1259
|
+
defaultValue: [{
|
|
1260
|
+
type: "component",
|
|
1261
|
+
name: "AntdMenuItem"
|
|
1262
|
+
}, {
|
|
1263
|
+
type: "component",
|
|
1264
|
+
name: "AntdSubMenu"
|
|
1265
|
+
}]
|
|
1266
|
+
}
|
|
1267
|
+
},
|
|
1268
|
+
importPath: "antd/lib/menu/index",
|
|
1269
|
+
importName: "Menu",
|
|
1270
|
+
isDefaultExport: true
|
|
1271
|
+
};
|
|
1272
|
+
function registerMenu(loader, customMenuMeta) {
|
|
1273
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
1274
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
1275
|
+
};
|
|
1276
|
+
|
|
1277
|
+
doRegisterComponent(Menu, customMenuMeta != null ? customMenuMeta : menuMeta);
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
var optionMeta = {
|
|
1281
|
+
name: "AntdOption",
|
|
1282
|
+
displayName: "Antd Option",
|
|
1283
|
+
props: {
|
|
1284
|
+
disabled: {
|
|
1285
|
+
type: "boolean",
|
|
1286
|
+
description: "Disable this option",
|
|
1287
|
+
defaultValueHint: false
|
|
1288
|
+
},
|
|
1289
|
+
title: {
|
|
1290
|
+
type: "string",
|
|
1291
|
+
description: "title of Select after select this Option"
|
|
1292
|
+
},
|
|
1293
|
+
value: {
|
|
1294
|
+
type: "string",
|
|
1295
|
+
description: "Default to filter with this property"
|
|
1296
|
+
},
|
|
1297
|
+
key: {
|
|
1298
|
+
type: "string",
|
|
1299
|
+
description: "Option key"
|
|
1300
|
+
},
|
|
1301
|
+
children: {
|
|
1302
|
+
type: "slot",
|
|
1303
|
+
defaultValue: [{
|
|
1304
|
+
type: "text",
|
|
1305
|
+
value: "Option"
|
|
1306
|
+
}]
|
|
1307
|
+
}
|
|
1308
|
+
},
|
|
1309
|
+
importPath: "rc-select",
|
|
1310
|
+
importName: "Option",
|
|
1311
|
+
parentComponentName: "AntdSelect"
|
|
1312
|
+
};
|
|
1313
|
+
function registerOption(loader, customOptionMeta) {
|
|
1314
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
1315
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
1316
|
+
};
|
|
1317
|
+
|
|
1318
|
+
doRegisterComponent(rcSelect.Option, customOptionMeta != null ? customOptionMeta : optionMeta);
|
|
1319
|
+
}
|
|
1320
|
+
var optGroupMeta = {
|
|
1321
|
+
name: "AntdOptionGroup",
|
|
1322
|
+
displayName: "Antd Option Group",
|
|
1323
|
+
props: {
|
|
1324
|
+
key: {
|
|
1325
|
+
type: "string",
|
|
1326
|
+
description: "Group key"
|
|
1327
|
+
},
|
|
1328
|
+
label: {
|
|
1329
|
+
type: "string",
|
|
1330
|
+
description: "Group label"
|
|
1331
|
+
},
|
|
1332
|
+
children: {
|
|
1333
|
+
type: "slot",
|
|
1334
|
+
allowedComponents: ["AntdOption"],
|
|
1335
|
+
defaultValue: [{
|
|
1336
|
+
type: "component",
|
|
1337
|
+
name: "AntdOption"
|
|
1338
|
+
}]
|
|
1339
|
+
}
|
|
1340
|
+
},
|
|
1341
|
+
importPath: "rc-select",
|
|
1342
|
+
importName: "OptGroup",
|
|
1343
|
+
parentComponentName: "AntdSelect"
|
|
1344
|
+
};
|
|
1345
|
+
function registerOptGroup(loader, customOptGroupMeta) {
|
|
1346
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
1347
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
1348
|
+
};
|
|
1349
|
+
|
|
1350
|
+
doRegisterComponent(rcSelect.OptGroup, customOptGroupMeta != null ? customOptGroupMeta : optGroupMeta);
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
var rateMeta = {
|
|
1354
|
+
name: "AntdRate",
|
|
1355
|
+
displayName: "Antd Rate",
|
|
1356
|
+
props: {
|
|
1357
|
+
allowClear: {
|
|
1358
|
+
type: "boolean",
|
|
1359
|
+
description: "Whether to allow clear when clicking again",
|
|
1360
|
+
defaultValueHint: true
|
|
1361
|
+
},
|
|
1362
|
+
allowHalf: {
|
|
1363
|
+
type: "boolean",
|
|
1364
|
+
description: "Whether to allow semi selection",
|
|
1365
|
+
defaultValueHint: false
|
|
1366
|
+
},
|
|
1367
|
+
autoFocus: {
|
|
1368
|
+
type: "boolean",
|
|
1369
|
+
description: "If componet is focused when mounted",
|
|
1370
|
+
defaultValueHint: false
|
|
1371
|
+
},
|
|
1372
|
+
count: {
|
|
1373
|
+
type: "number",
|
|
1374
|
+
description: "Star count"
|
|
1375
|
+
},
|
|
1376
|
+
disabled: {
|
|
1377
|
+
type: "boolean",
|
|
1378
|
+
description: "Disabled state of component",
|
|
1379
|
+
defaultValueHint: false
|
|
1380
|
+
},
|
|
1381
|
+
tooltips: {
|
|
1382
|
+
type: "array",
|
|
1383
|
+
description: "Array to customize tooltip for each icon"
|
|
1384
|
+
},
|
|
1385
|
+
value: {
|
|
1386
|
+
type: "number",
|
|
1387
|
+
description: "The default value",
|
|
1388
|
+
editOnly: true,
|
|
1389
|
+
uncontrolledProp: "defaultValue",
|
|
1390
|
+
defaultValueHint: 0
|
|
1391
|
+
},
|
|
1392
|
+
character: {
|
|
1393
|
+
type: "slot",
|
|
1394
|
+
hidePlaceholder: true
|
|
1395
|
+
}
|
|
1396
|
+
},
|
|
1397
|
+
importPath: "antd/lib/rate",
|
|
1398
|
+
importName: "Rate",
|
|
1399
|
+
isDefaultExport: true
|
|
1400
|
+
};
|
|
1401
|
+
function registerRate(loader, customRateMeta) {
|
|
1402
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
1403
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
1404
|
+
};
|
|
1405
|
+
|
|
1406
|
+
doRegisterComponent(Rate, customRateMeta != null ? customRateMeta : rateMeta);
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
var selectMeta = {
|
|
1410
|
+
name: "AntdSelect",
|
|
1411
|
+
displayName: "Antd Select",
|
|
1412
|
+
props: {
|
|
1413
|
+
allowClear: {
|
|
1414
|
+
type: "boolean",
|
|
1415
|
+
description: "Show clear button",
|
|
1416
|
+
defaultValueHint: false
|
|
1417
|
+
},
|
|
1418
|
+
autoClearSearchValue: {
|
|
1419
|
+
type: "boolean",
|
|
1420
|
+
description: "Whether the current search will be cleared on selecting an item",
|
|
1421
|
+
defaultValueHint: true,
|
|
1422
|
+
hidden: function hidden(props) {
|
|
1423
|
+
return props.mode !== "multiple" && props.mode !== "tags";
|
|
1424
|
+
}
|
|
1425
|
+
},
|
|
1426
|
+
autoFocus: {
|
|
1427
|
+
type: "boolean",
|
|
1428
|
+
description: "Get focus by default",
|
|
1429
|
+
defaultValueHint: false
|
|
1430
|
+
},
|
|
1431
|
+
bordered: {
|
|
1432
|
+
type: "boolean",
|
|
1433
|
+
description: "Whether has border style",
|
|
1434
|
+
defaultValueHint: true
|
|
1435
|
+
},
|
|
1436
|
+
disabled: {
|
|
1437
|
+
type: "boolean",
|
|
1438
|
+
description: "Whether disabled select",
|
|
1439
|
+
defaultValueHint: false
|
|
1440
|
+
},
|
|
1441
|
+
listHeight: {
|
|
1442
|
+
type: "number",
|
|
1443
|
+
description: "Config popup height",
|
|
1444
|
+
defaultValueHint: 256
|
|
1445
|
+
},
|
|
1446
|
+
loading: {
|
|
1447
|
+
type: "boolean",
|
|
1448
|
+
description: "Indicate loading state",
|
|
1449
|
+
defaultValueHint: false
|
|
1450
|
+
},
|
|
1451
|
+
mode: {
|
|
1452
|
+
type: "choice",
|
|
1453
|
+
options: ["multiple", "tags"],
|
|
1454
|
+
description: "Set mode of Select"
|
|
1455
|
+
},
|
|
1456
|
+
open: {
|
|
1457
|
+
type: "boolean",
|
|
1458
|
+
editOnly: true,
|
|
1459
|
+
uncontrolledProp: "defaultOpen",
|
|
1460
|
+
description: "Initial open state of dropdown",
|
|
1461
|
+
defaultValueHint: false
|
|
1462
|
+
},
|
|
1463
|
+
placeholder: {
|
|
1464
|
+
type: "slot",
|
|
1465
|
+
defaultValue: [{
|
|
1466
|
+
type: "text",
|
|
1467
|
+
value: "Select"
|
|
1468
|
+
}]
|
|
1469
|
+
},
|
|
1470
|
+
showArrow: {
|
|
1471
|
+
type: "boolean",
|
|
1472
|
+
description: "Whether to show the drop-down arrow",
|
|
1473
|
+
defaultValueHint: true
|
|
1474
|
+
},
|
|
1475
|
+
showSearch: {
|
|
1476
|
+
type: "boolean",
|
|
1477
|
+
description: "Whether show search input in single mode",
|
|
1478
|
+
defaultValueHint: false
|
|
1479
|
+
},
|
|
1480
|
+
size: {
|
|
1481
|
+
type: "choice",
|
|
1482
|
+
options: ["large", "middle", "small"],
|
|
1483
|
+
description: "Set mode of Select",
|
|
1484
|
+
defaultValueHint: "middle"
|
|
1485
|
+
},
|
|
1486
|
+
value: {
|
|
1487
|
+
type: "choice",
|
|
1488
|
+
editOnly: true,
|
|
1489
|
+
uncontrolledProp: "defaultValue",
|
|
1490
|
+
description: "Initial selected option",
|
|
1491
|
+
options: function options(componentProps) {
|
|
1492
|
+
var options = new Set();
|
|
1493
|
+
traverseReactEltTree(componentProps.children, function (elt) {
|
|
1494
|
+
var _elt$props;
|
|
1495
|
+
|
|
1496
|
+
if ((elt == null ? void 0 : elt.type) === rcSelect.Option && typeof (elt == null ? void 0 : (_elt$props = elt.props) == null ? void 0 : _elt$props.value) === "string") {
|
|
1497
|
+
options.add(elt.props.value);
|
|
1498
|
+
}
|
|
1499
|
+
});
|
|
1500
|
+
return Array.from(options.keys());
|
|
1501
|
+
}
|
|
1502
|
+
},
|
|
1503
|
+
virtual: {
|
|
1504
|
+
type: "boolean",
|
|
1505
|
+
description: "Disable virtual scroll when set to false",
|
|
1506
|
+
defaultValueHint: true
|
|
1507
|
+
},
|
|
1508
|
+
children: {
|
|
1509
|
+
type: "slot",
|
|
1510
|
+
allowedComponents: ["AntdOption, AntdOptionGroup"],
|
|
1511
|
+
defaultValue: [{
|
|
1512
|
+
type: "component",
|
|
1513
|
+
name: "AntdOption",
|
|
1514
|
+
props: {
|
|
1515
|
+
value: "Option",
|
|
1516
|
+
children: {
|
|
1517
|
+
type: "text",
|
|
1518
|
+
value: "Option"
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
}]
|
|
1522
|
+
}
|
|
1523
|
+
},
|
|
1524
|
+
importPath: "antd/lib/select",
|
|
1525
|
+
importName: "Select",
|
|
1526
|
+
isDefaultExport: true
|
|
1527
|
+
};
|
|
1528
|
+
function registerSelect(loader, customSelectMeta) {
|
|
1529
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
1530
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
1531
|
+
};
|
|
1532
|
+
|
|
1533
|
+
doRegisterComponent(Select, customSelectMeta != null ? customSelectMeta : selectMeta);
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
var _excluded$1 = ["value", "defaultValue", "value2", "defaultValue2"];
|
|
1537
|
+
var Slider = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
1538
|
+
var value = _ref.value,
|
|
1539
|
+
defaultValue = _ref.defaultValue,
|
|
1540
|
+
value2 = _ref.value2,
|
|
1541
|
+
defaultValue2 = _ref.defaultValue2,
|
|
1542
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
1543
|
+
|
|
1544
|
+
var newProps = _extends({}, props);
|
|
1545
|
+
|
|
1546
|
+
if (props.range) {
|
|
1547
|
+
if (typeof value === "number" || typeof value2 === "number") {
|
|
1548
|
+
newProps.value = [value != null ? value : 0, value2 != null ? value2 : 0];
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1551
|
+
if (typeof defaultValue === "number" || typeof defaultValue2 === "number") {
|
|
1552
|
+
newProps.defaultValue = [defaultValue != null ? defaultValue : 0, defaultValue2 != null ? defaultValue2 : 0];
|
|
1553
|
+
}
|
|
1554
|
+
} else {
|
|
1555
|
+
if (typeof value === "number") {
|
|
1556
|
+
newProps.value = value;
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
if (typeof defaultValue === "number") {
|
|
1560
|
+
newProps.defaultValue = defaultValue;
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
return React.createElement(AntdSlider, Object.assign({}, newProps, {
|
|
1565
|
+
ref: ref
|
|
1566
|
+
}));
|
|
1567
|
+
});
|
|
1568
|
+
var sliderMeta = {
|
|
1569
|
+
name: "AntdSlider",
|
|
1570
|
+
displayName: "Antd Slider",
|
|
1571
|
+
props: {
|
|
1572
|
+
max: {
|
|
1573
|
+
type: "number",
|
|
1574
|
+
description: "The maximum value the slider can slide to",
|
|
1575
|
+
defaultValueHint: 100
|
|
1576
|
+
},
|
|
1577
|
+
min: {
|
|
1578
|
+
type: "number",
|
|
1579
|
+
description: "The minimum value the slider can slide to",
|
|
1580
|
+
defaultValueHint: 0
|
|
1581
|
+
},
|
|
1582
|
+
included: {
|
|
1583
|
+
type: "boolean",
|
|
1584
|
+
description: "Make effect when marks not null, true means containment and false means coordinative",
|
|
1585
|
+
defaultValueHint: true
|
|
1586
|
+
},
|
|
1587
|
+
disabled: {
|
|
1588
|
+
type: "boolean",
|
|
1589
|
+
description: "If true, the slider will not be interactable",
|
|
1590
|
+
defaultValueHint: false
|
|
1591
|
+
},
|
|
1592
|
+
range: {
|
|
1593
|
+
type: "boolean",
|
|
1594
|
+
description: "Dual thumb mode",
|
|
1595
|
+
defaultValueHint: false
|
|
1596
|
+
},
|
|
1597
|
+
reverse: {
|
|
1598
|
+
type: "boolean",
|
|
1599
|
+
description: "Reverse the component",
|
|
1600
|
+
defaultValueHint: false
|
|
1601
|
+
},
|
|
1602
|
+
vertical: {
|
|
1603
|
+
type: "boolean",
|
|
1604
|
+
description: "If true, the slider will be vertical",
|
|
1605
|
+
defaultValueHint: false
|
|
1606
|
+
},
|
|
1607
|
+
value: {
|
|
1608
|
+
type: "number",
|
|
1609
|
+
editOnly: true,
|
|
1610
|
+
uncontrolledProp: "defaultValue",
|
|
1611
|
+
description: "The default value of slider"
|
|
1612
|
+
},
|
|
1613
|
+
value2: {
|
|
1614
|
+
type: "number",
|
|
1615
|
+
displayName: "value 2",
|
|
1616
|
+
editOnly: true,
|
|
1617
|
+
uncontrolledProp: "defaultValue2",
|
|
1618
|
+
description: "The default value for the second value of the slider",
|
|
1619
|
+
hidden: function hidden(props) {
|
|
1620
|
+
return !props.range;
|
|
1621
|
+
}
|
|
1622
|
+
},
|
|
1623
|
+
step: {
|
|
1624
|
+
type: "number",
|
|
1625
|
+
description: "The granularity the slider can step through values. Must greater than 0, and be divided by (max - min)." + " When marks no null, step can be null",
|
|
1626
|
+
defaultValueHint: 1
|
|
1627
|
+
},
|
|
1628
|
+
marks: {
|
|
1629
|
+
type: "object",
|
|
1630
|
+
description: "Tick mark of Slider, type of key must be number, and must in closed interval [min, max]," + " each mark can declare its own style"
|
|
1631
|
+
}
|
|
1632
|
+
},
|
|
1633
|
+
defaultStyles: {
|
|
1634
|
+
width: "200px",
|
|
1635
|
+
maxWidth: "100%"
|
|
1636
|
+
},
|
|
1637
|
+
importPath: "@plasmicpkgs/antd/skinny/registerSlider",
|
|
1638
|
+
importName: "Slider"
|
|
1639
|
+
};
|
|
1640
|
+
function registerSlider(loader, customSliderMeta) {
|
|
1641
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
1642
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
1643
|
+
};
|
|
1644
|
+
|
|
1645
|
+
doRegisterComponent(Slider, customSliderMeta != null ? customSliderMeta : sliderMeta);
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
var switchMeta = {
|
|
1649
|
+
name: "AntdSwitch",
|
|
1650
|
+
displayName: "Antd Switch",
|
|
1651
|
+
props: {
|
|
1652
|
+
autoFocus: {
|
|
1653
|
+
type: "boolean",
|
|
1654
|
+
description: "Whether get focus when component mounted",
|
|
1655
|
+
defaultValueHint: false
|
|
1656
|
+
},
|
|
1657
|
+
checked: {
|
|
1658
|
+
type: "boolean",
|
|
1659
|
+
editOnly: true,
|
|
1660
|
+
uncontrolledProp: "defaultChecked",
|
|
1661
|
+
description: "Whether to set the initial state",
|
|
1662
|
+
defaultValueHint: false
|
|
1663
|
+
},
|
|
1664
|
+
disabled: {
|
|
1665
|
+
type: "boolean",
|
|
1666
|
+
description: "Disable switch",
|
|
1667
|
+
defaultValueHint: false
|
|
1668
|
+
},
|
|
1669
|
+
loading: {
|
|
1670
|
+
type: "boolean",
|
|
1671
|
+
description: "Loading state of switch",
|
|
1672
|
+
defaultValueHint: false
|
|
1673
|
+
},
|
|
1674
|
+
checkedChildren: {
|
|
1675
|
+
type: "slot",
|
|
1676
|
+
defaultValue: [],
|
|
1677
|
+
hidePlaceholder: true
|
|
1678
|
+
},
|
|
1679
|
+
unCheckedChildren: {
|
|
1680
|
+
type: "slot",
|
|
1681
|
+
defaultValue: [],
|
|
1682
|
+
hidePlaceholder: true
|
|
1683
|
+
},
|
|
1684
|
+
size: {
|
|
1685
|
+
type: "choice",
|
|
1686
|
+
options: ["small", "default"],
|
|
1687
|
+
description: "The size of the Switch",
|
|
1688
|
+
defaultValueHint: "default"
|
|
1689
|
+
}
|
|
1690
|
+
},
|
|
1691
|
+
importPath: "antd/lib/switch",
|
|
1692
|
+
importName: "Switch",
|
|
1693
|
+
isDefaultExport: true
|
|
1694
|
+
};
|
|
1695
|
+
function registerSwitch(loader, customSwitchMeta) {
|
|
1696
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
1697
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
1698
|
+
};
|
|
1699
|
+
|
|
1700
|
+
doRegisterComponent(Switch, customSwitchMeta != null ? customSwitchMeta : switchMeta);
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
var _excluded$2 = ["columnTemplate", "title", "dataIndex"];
|
|
1704
|
+
// properties in plasmic.
|
|
1705
|
+
|
|
1706
|
+
function TableColumn(_props) {
|
|
1707
|
+
return null;
|
|
1708
|
+
}
|
|
1709
|
+
function TableValue(props) {
|
|
1710
|
+
var _column$toString;
|
|
1711
|
+
|
|
1712
|
+
var className = props.className;
|
|
1713
|
+
var column = host.useSelector("currentColumn");
|
|
1714
|
+
return React.createElement("div", {
|
|
1715
|
+
className: className
|
|
1716
|
+
}, (_column$toString = column == null ? void 0 : column.toString()) != null ? _column$toString : "");
|
|
1717
|
+
}
|
|
1718
|
+
/**
|
|
1719
|
+
* Wrapper used to consume internal canvas props
|
|
1720
|
+
*/
|
|
1721
|
+
|
|
1722
|
+
function ColumnWrapper(props) {
|
|
1723
|
+
return props.children;
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
function TableWrapper(props) {
|
|
1727
|
+
var _columns$props$childr, _columns$props;
|
|
1728
|
+
|
|
1729
|
+
var className = props.className,
|
|
1730
|
+
items = props.items,
|
|
1731
|
+
columns = props.columns,
|
|
1732
|
+
size = props.size,
|
|
1733
|
+
onSelect = props.onSelect,
|
|
1734
|
+
pagination = props.pagination; // Plasmic Studio Canvas currently renders items in a slightly different way than the generated code:
|
|
1735
|
+
// - In the studio:
|
|
1736
|
+
// - The `columns` prop value is an array of nested react <Column /> nodes.
|
|
1737
|
+
// - In the generated code (preview mode):
|
|
1738
|
+
// - The `columns` prop value is a React Node with a `children` property that contains
|
|
1739
|
+
// an array of the nested react <Column /> components.
|
|
1740
|
+
|
|
1741
|
+
var tableColumns = (_columns$props$childr = columns == null ? void 0 : (_columns$props = columns.props) == null ? void 0 : _columns$props.children) != null ? _columns$props$childr : columns; // Convert the props.columns slot children to an array of column definitions
|
|
1742
|
+
|
|
1743
|
+
var columnDefinitions = React.useMemo(function () {
|
|
1744
|
+
return React.Children.map(tableColumns, function (column, columnIndex) {
|
|
1745
|
+
if (!column) {
|
|
1746
|
+
return undefined;
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
var _column$props = column.props,
|
|
1750
|
+
columnTemplate = _column$props.columnTemplate,
|
|
1751
|
+
title = _column$props.title,
|
|
1752
|
+
dataIndex = _column$props.dataIndex,
|
|
1753
|
+
rest = _objectWithoutPropertiesLoose(_column$props, _excluded$2);
|
|
1754
|
+
|
|
1755
|
+
var columnDefinition = {
|
|
1756
|
+
columnIndex: columnIndex,
|
|
1757
|
+
title: title,
|
|
1758
|
+
dataIndex: dataIndex,
|
|
1759
|
+
key: columnIndex,
|
|
1760
|
+
render: function render(value, record, rowIndex) {
|
|
1761
|
+
return React.createElement(host.DataProvider, {
|
|
1762
|
+
name: "currentRow",
|
|
1763
|
+
data: record
|
|
1764
|
+
}, React.createElement(host.DataProvider, {
|
|
1765
|
+
name: "currentRowIndex",
|
|
1766
|
+
data: rowIndex
|
|
1767
|
+
}, React.createElement(host.DataProvider, {
|
|
1768
|
+
name: "currentColumn",
|
|
1769
|
+
data: value
|
|
1770
|
+
}, host.repeatedElement(rowIndex, React.createElement(ColumnWrapper, Object.assign({}, rest), columnTemplate)))));
|
|
1771
|
+
}
|
|
1772
|
+
};
|
|
1773
|
+
return columnDefinition;
|
|
1774
|
+
}).filter(Boolean);
|
|
1775
|
+
}, [tableColumns]);
|
|
1776
|
+
return React.createElement(Table, {
|
|
1777
|
+
className: className,
|
|
1778
|
+
columns: columnDefinitions,
|
|
1779
|
+
dataSource: items,
|
|
1780
|
+
size: size,
|
|
1781
|
+
onRow: function onRow(record) {
|
|
1782
|
+
return {
|
|
1783
|
+
onMouseUp: function onMouseUp() {
|
|
1784
|
+
return onSelect == null ? void 0 : onSelect(record.id);
|
|
1785
|
+
}
|
|
1786
|
+
};
|
|
1787
|
+
},
|
|
1788
|
+
pagination: pagination ? undefined : pagination,
|
|
1789
|
+
rowKey: "id"
|
|
1790
|
+
});
|
|
1791
|
+
}
|
|
1792
|
+
var DEFAULT_ITEMS = [{
|
|
1793
|
+
name: "John Brown",
|
|
1794
|
+
age: 19,
|
|
1795
|
+
address: "New York No. 1 Lake Park",
|
|
1796
|
+
tags: ["student", "developer"]
|
|
1797
|
+
}, {
|
|
1798
|
+
name: "Jim Green",
|
|
1799
|
+
age: 42,
|
|
1800
|
+
address: "London No. 1 Lake Park",
|
|
1801
|
+
tags: ["teacher"]
|
|
1802
|
+
}, {
|
|
1803
|
+
name: "Joe Black",
|
|
1804
|
+
age: 32,
|
|
1805
|
+
address: "Sidney No. 1 Lake Park",
|
|
1806
|
+
tags: ["cool", "teacher"]
|
|
1807
|
+
}];
|
|
1808
|
+
|
|
1809
|
+
function capitalize(input) {
|
|
1810
|
+
return input.charAt(0).toUpperCase() + input.slice(1);
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
var tableMeta = {
|
|
1814
|
+
name: "AntdTable",
|
|
1815
|
+
displayName: "Antd Table",
|
|
1816
|
+
props: {
|
|
1817
|
+
items: {
|
|
1818
|
+
type: "array",
|
|
1819
|
+
description: "The data to display in the table, as a list of objects (one object per row)",
|
|
1820
|
+
defaultValue: DEFAULT_ITEMS
|
|
1821
|
+
},
|
|
1822
|
+
columns: {
|
|
1823
|
+
type: "slot",
|
|
1824
|
+
allowedComponents: ["AntdTableColumn"],
|
|
1825
|
+
defaultValue: /*#__PURE__*/Object.keys(DEFAULT_ITEMS[0]).map(function (columnName) {
|
|
1826
|
+
return {
|
|
1827
|
+
type: "component",
|
|
1828
|
+
name: "AntdTableColumn",
|
|
1829
|
+
props: {
|
|
1830
|
+
title: capitalize(columnName),
|
|
1831
|
+
dataIndex: columnName
|
|
1832
|
+
}
|
|
1833
|
+
};
|
|
1834
|
+
})
|
|
1835
|
+
},
|
|
1836
|
+
size: {
|
|
1837
|
+
type: "choice",
|
|
1838
|
+
options: ["large", "middle", "small"],
|
|
1839
|
+
defaultValueHint: "large"
|
|
1840
|
+
},
|
|
1841
|
+
pagination: {
|
|
1842
|
+
type: "boolean",
|
|
1843
|
+
defaultValueHint: true
|
|
1844
|
+
}
|
|
1845
|
+
},
|
|
1846
|
+
importPath: "@plasmicpkgs/antd/skinny/registerTable",
|
|
1847
|
+
importName: "TableWrapper"
|
|
1848
|
+
};
|
|
1849
|
+
var tableColumnMeta = {
|
|
1850
|
+
name: "AntdTableColumn",
|
|
1851
|
+
parentComponentName: "AntdTable",
|
|
1852
|
+
providesData: true,
|
|
1853
|
+
props: {
|
|
1854
|
+
title: {
|
|
1855
|
+
type: "string",
|
|
1856
|
+
defaultValue: "Name"
|
|
1857
|
+
},
|
|
1858
|
+
dataIndex: {
|
|
1859
|
+
type: "string",
|
|
1860
|
+
defaultValue: "name",
|
|
1861
|
+
description: "The field to show. The table accepts some data as a list of objects, and this is the name of the field in those objects that this column will display."
|
|
1862
|
+
},
|
|
1863
|
+
columnTemplate: {
|
|
1864
|
+
type: "slot",
|
|
1865
|
+
defaultValue: {
|
|
1866
|
+
type: "vbox",
|
|
1867
|
+
styles: {
|
|
1868
|
+
padding: 0
|
|
1869
|
+
},
|
|
1870
|
+
children: [{
|
|
1871
|
+
type: "component",
|
|
1872
|
+
name: "AntdTableValue"
|
|
1873
|
+
}]
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
},
|
|
1877
|
+
importPath: "@plasmicpkgs/antd/skinny/registerTable",
|
|
1878
|
+
importName: "TableColumn"
|
|
1879
|
+
};
|
|
1880
|
+
var tableValueMeta = {
|
|
1881
|
+
name: "AntdTableValue",
|
|
1882
|
+
parentComponentName: "AntdTableColumn",
|
|
1883
|
+
props: {},
|
|
1884
|
+
importPath: "@plasmicpkgs/antd/skinny/registerTable",
|
|
1885
|
+
importName: "TableValue"
|
|
1886
|
+
};
|
|
1887
|
+
function registerTable(loader, customMeta) {
|
|
1888
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
1889
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : host.registerComponent.apply(void 0, arguments);
|
|
1890
|
+
};
|
|
1891
|
+
|
|
1892
|
+
doRegisterComponent(TableWrapper, customMeta != null ? customMeta : tableMeta);
|
|
1893
|
+
}
|
|
1894
|
+
function registerTableColumn(loader, customMeta) {
|
|
1895
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
1896
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : host.registerComponent.apply(void 0, arguments);
|
|
1897
|
+
};
|
|
1898
|
+
|
|
1899
|
+
doRegisterComponent(TableColumn, customMeta != null ? customMeta : tableColumnMeta);
|
|
1900
|
+
}
|
|
1901
|
+
function registerTableValue(loader, customMeta) {
|
|
1902
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
1903
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : host.registerComponent.apply(void 0, arguments);
|
|
1904
|
+
};
|
|
1905
|
+
|
|
1906
|
+
doRegisterComponent(TableValue, customMeta != null ? customMeta : tableValueMeta);
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
var _excluded$3 = ["leftTabBarExtraContent", "rightTabBarExtraContent"];
|
|
1910
|
+
var tabPaneMeta = {
|
|
1911
|
+
name: "AntdTabPane",
|
|
1912
|
+
displayName: "Antd Tab Pane",
|
|
1913
|
+
props: {
|
|
1914
|
+
tab: {
|
|
1915
|
+
type: "slot",
|
|
1916
|
+
defaultValue: [{
|
|
1917
|
+
type: "text",
|
|
1918
|
+
value: "Tab"
|
|
1919
|
+
}]
|
|
1920
|
+
},
|
|
1921
|
+
key: {
|
|
1922
|
+
type: "string",
|
|
1923
|
+
description: "Unique TabPane's key",
|
|
1924
|
+
defaultValue: "tabPaneKey"
|
|
1925
|
+
},
|
|
1926
|
+
closable: {
|
|
1927
|
+
type: "boolean",
|
|
1928
|
+
description: "Wether the tab can be closed or not. Only works for editable tabs",
|
|
1929
|
+
defaultValueHint: true
|
|
1930
|
+
},
|
|
1931
|
+
disabled: {
|
|
1932
|
+
type: "boolean",
|
|
1933
|
+
description: "Disabled state of tab",
|
|
1934
|
+
defaultValueHint: false
|
|
1935
|
+
},
|
|
1936
|
+
forceRender: {
|
|
1937
|
+
type: "boolean",
|
|
1938
|
+
description: "Forced render of content in tabs, not lazy render after clicking on tabs",
|
|
1939
|
+
defaultValueHint: false
|
|
1940
|
+
},
|
|
1941
|
+
closeIcon: {
|
|
1942
|
+
type: "slot",
|
|
1943
|
+
hidePlaceholder: true
|
|
1944
|
+
},
|
|
1945
|
+
children: {
|
|
1946
|
+
type: "slot",
|
|
1947
|
+
defaultValue: [{
|
|
1948
|
+
type: "text",
|
|
1949
|
+
value: "Tab Content"
|
|
1950
|
+
}]
|
|
1951
|
+
}
|
|
1952
|
+
},
|
|
1953
|
+
parentComponentName: "AntdTabs",
|
|
1954
|
+
importPath: "rc-tabs",
|
|
1955
|
+
importName: "TabPane"
|
|
1956
|
+
};
|
|
1957
|
+
function registerTabPane(loader, customTabPaneMeta) {
|
|
1958
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
1959
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
1960
|
+
};
|
|
1961
|
+
|
|
1962
|
+
doRegisterComponent(rcTabs.TabPane, customTabPaneMeta != null ? customTabPaneMeta : tabPaneMeta);
|
|
1963
|
+
}
|
|
1964
|
+
function Tabs(props) {
|
|
1965
|
+
var leftTabBarExtraContent = props.leftTabBarExtraContent,
|
|
1966
|
+
rightTabBarExtraContent = props.rightTabBarExtraContent,
|
|
1967
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$3);
|
|
1968
|
+
|
|
1969
|
+
return React.createElement(AntdTabs, Object.assign({}, otherProps, {
|
|
1970
|
+
tabBarExtraContent: {
|
|
1971
|
+
left: leftTabBarExtraContent,
|
|
1972
|
+
right: rightTabBarExtraContent
|
|
1973
|
+
}
|
|
1974
|
+
}));
|
|
1975
|
+
}
|
|
1976
|
+
|
|
1977
|
+
function NavigateTabs(_ref) {
|
|
1978
|
+
var componentProps = _ref.componentProps,
|
|
1979
|
+
studioOps = _ref.studioOps;
|
|
1980
|
+
var tabPanes = [];
|
|
1981
|
+
traverseReactEltTree(componentProps.children, function (elt) {
|
|
1982
|
+
if ((elt == null ? void 0 : elt.type) === rcTabs.TabPane && typeof (elt == null ? void 0 : elt.key) === "string") {
|
|
1983
|
+
tabPanes.push(elt.key);
|
|
1984
|
+
}
|
|
1985
|
+
});
|
|
1986
|
+
var activeKey = componentProps.activeKey;
|
|
1987
|
+
var currTabPos = activeKey ? tabPanes.findIndex(function (tabKey) {
|
|
1988
|
+
return tabKey === activeKey;
|
|
1989
|
+
}) : 0;
|
|
1990
|
+
return React.createElement("div", {
|
|
1991
|
+
style: {
|
|
1992
|
+
width: "100%",
|
|
1993
|
+
display: "flex",
|
|
1994
|
+
flexDirection: "row",
|
|
1995
|
+
gap: "10px",
|
|
1996
|
+
justifyContent: "space-between"
|
|
1997
|
+
}
|
|
1998
|
+
}, React.createElement(antd.Button, {
|
|
1999
|
+
style: {
|
|
2000
|
+
width: "100%"
|
|
2001
|
+
},
|
|
2002
|
+
onClick: function onClick() {
|
|
2003
|
+
if (tabPanes.length > 0) {
|
|
2004
|
+
var prevTabPos = (currTabPos - 1 + tabPanes.length) % tabPanes.length;
|
|
2005
|
+
studioOps.updateProps({
|
|
2006
|
+
activeKey: tabPanes[prevTabPos]
|
|
2007
|
+
});
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
}, "Prev tab"), React.createElement(antd.Button, {
|
|
2011
|
+
style: {
|
|
2012
|
+
width: "100%"
|
|
2013
|
+
},
|
|
2014
|
+
onClick: function onClick() {
|
|
2015
|
+
if (tabPanes.length > 0) {
|
|
2016
|
+
var nextTabPos = (currTabPos + 1) % tabPanes.length;
|
|
2017
|
+
studioOps.updateProps({
|
|
2018
|
+
activeKey: tabPanes[nextTabPos]
|
|
2019
|
+
});
|
|
2020
|
+
}
|
|
2021
|
+
}
|
|
2022
|
+
}, "Next tab"));
|
|
2023
|
+
}
|
|
2024
|
+
|
|
2025
|
+
function OutlineMessage() {
|
|
2026
|
+
return React.createElement("div", null, "* To re-arrange tab panes, use the Outline panel");
|
|
2027
|
+
}
|
|
2028
|
+
|
|
2029
|
+
var tabsMeta = {
|
|
2030
|
+
name: "AntdTabs",
|
|
2031
|
+
displayName: "Antd Tabs",
|
|
2032
|
+
props: {
|
|
2033
|
+
type: {
|
|
2034
|
+
type: "choice",
|
|
2035
|
+
options: ["line", "card", "editable-card"],
|
|
2036
|
+
defaultValueHint: "line",
|
|
2037
|
+
description: "Basic style of tabs"
|
|
2038
|
+
},
|
|
2039
|
+
addIcon: {
|
|
2040
|
+
type: "slot",
|
|
2041
|
+
hidePlaceholder: true
|
|
2042
|
+
},
|
|
2043
|
+
animated: {
|
|
2044
|
+
type: "object",
|
|
2045
|
+
hidden: function hidden(props) {
|
|
2046
|
+
return props.tabPosition !== "top" && !!props.tabPosition;
|
|
2047
|
+
},
|
|
2048
|
+
defaultValueHint: {
|
|
2049
|
+
inkBar: true,
|
|
2050
|
+
tabPane: false
|
|
2051
|
+
},
|
|
2052
|
+
description: "Whether to change tabs with animation. Can be either a boolean or specify for inkBar and tabPane"
|
|
2053
|
+
},
|
|
2054
|
+
hideAdd: {
|
|
2055
|
+
type: "boolean",
|
|
2056
|
+
hidden: function hidden(props) {
|
|
2057
|
+
return props.type !== "editable-card";
|
|
2058
|
+
},
|
|
2059
|
+
defaultValueHint: false,
|
|
2060
|
+
description: "Hide plus icon or not"
|
|
2061
|
+
},
|
|
2062
|
+
moreIcon: {
|
|
2063
|
+
type: "slot",
|
|
2064
|
+
hidePlaceholder: true
|
|
2065
|
+
},
|
|
2066
|
+
size: {
|
|
2067
|
+
type: "choice",
|
|
2068
|
+
options: ["large", "default", "small"],
|
|
2069
|
+
defaultValueHint: "default",
|
|
2070
|
+
description: "Preset tab bar size"
|
|
2071
|
+
},
|
|
2072
|
+
tabPosition: {
|
|
2073
|
+
type: "choice",
|
|
2074
|
+
options: ["top", "right", "bottom", "left"],
|
|
2075
|
+
defaultValueHint: "top",
|
|
2076
|
+
description: "Position of tabs"
|
|
2077
|
+
},
|
|
2078
|
+
tabBarGutter: {
|
|
2079
|
+
type: "number",
|
|
2080
|
+
description: "The gap between tabs"
|
|
2081
|
+
},
|
|
2082
|
+
centered: {
|
|
2083
|
+
type: "boolean",
|
|
2084
|
+
description: "Centers tabs",
|
|
2085
|
+
defaultValueHint: false
|
|
2086
|
+
},
|
|
2087
|
+
leftTabBarExtraContent: {
|
|
2088
|
+
type: "slot",
|
|
2089
|
+
hidePlaceholder: true
|
|
2090
|
+
},
|
|
2091
|
+
rightTabBarExtraContent: {
|
|
2092
|
+
type: "slot",
|
|
2093
|
+
hidePlaceholder: true
|
|
2094
|
+
},
|
|
2095
|
+
tabBarStyle: {
|
|
2096
|
+
type: "object",
|
|
2097
|
+
description: "CSS for the Tab Bar style"
|
|
2098
|
+
},
|
|
2099
|
+
activeKey: {
|
|
2100
|
+
type: "choice",
|
|
2101
|
+
editOnly: true,
|
|
2102
|
+
uncontrolledProp: "defaultActiveKey",
|
|
2103
|
+
description: "Initial active TabPane's key",
|
|
2104
|
+
options: function options(props) {
|
|
2105
|
+
var options = new Set();
|
|
2106
|
+
traverseReactEltTree(props.children, function (elt) {
|
|
2107
|
+
if ((elt == null ? void 0 : elt.type) === rcTabs.TabPane && typeof (elt == null ? void 0 : elt.key) === "string") {
|
|
2108
|
+
options.add(elt.key);
|
|
2109
|
+
}
|
|
2110
|
+
});
|
|
2111
|
+
return Array.from(options.keys());
|
|
2112
|
+
}
|
|
2113
|
+
},
|
|
2114
|
+
children: {
|
|
2115
|
+
type: "slot",
|
|
2116
|
+
allowedComponents: ["AntdTabPane"],
|
|
2117
|
+
defaultValue: [{
|
|
2118
|
+
type: "component",
|
|
2119
|
+
name: "AntdTabPane",
|
|
2120
|
+
props: {
|
|
2121
|
+
key: "1",
|
|
2122
|
+
tab: [{
|
|
2123
|
+
type: "text",
|
|
2124
|
+
value: "Tab"
|
|
2125
|
+
}],
|
|
2126
|
+
children: [{
|
|
2127
|
+
type: "text",
|
|
2128
|
+
value: "Tab content"
|
|
2129
|
+
}]
|
|
2130
|
+
}
|
|
2131
|
+
}, {
|
|
2132
|
+
type: "component",
|
|
2133
|
+
name: "AntdTabPane",
|
|
2134
|
+
props: {
|
|
2135
|
+
key: "2",
|
|
2136
|
+
tab: [{
|
|
2137
|
+
type: "text",
|
|
2138
|
+
value: "Tab"
|
|
2139
|
+
}],
|
|
2140
|
+
children: [{
|
|
2141
|
+
type: "text",
|
|
2142
|
+
value: "Tab content"
|
|
2143
|
+
}]
|
|
2144
|
+
}
|
|
2145
|
+
}]
|
|
2146
|
+
}
|
|
2147
|
+
},
|
|
2148
|
+
actions: [{
|
|
2149
|
+
type: "custom-action",
|
|
2150
|
+
control: NavigateTabs
|
|
2151
|
+
}, {
|
|
2152
|
+
type: "button-action",
|
|
2153
|
+
label: "Add new tab",
|
|
2154
|
+
onClick: function onClick(_ref2) {
|
|
2155
|
+
var componentProps = _ref2.componentProps,
|
|
2156
|
+
studioOps = _ref2.studioOps;
|
|
2157
|
+
|
|
2158
|
+
// Get the first positive integer that isn't already a key
|
|
2159
|
+
var generateNewKey = function generateNewKey() {
|
|
2160
|
+
var keysSet = new Set();
|
|
2161
|
+
traverseReactEltTree(componentProps.children, function (elt) {
|
|
2162
|
+
if ((elt == null ? void 0 : elt.type) === rcTabs.TabPane && typeof (elt == null ? void 0 : elt.key) === "string") {
|
|
2163
|
+
keysSet.add(elt.key);
|
|
2164
|
+
}
|
|
2165
|
+
});
|
|
2166
|
+
|
|
2167
|
+
for (var keyCandidate = 1; keyCandidate <= keysSet.size + 1; keyCandidate++) {
|
|
2168
|
+
var strKey = keyCandidate.toString();
|
|
2169
|
+
|
|
2170
|
+
if (!keysSet.has(strKey)) {
|
|
2171
|
+
return strKey;
|
|
2172
|
+
}
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
return undefined;
|
|
2176
|
+
};
|
|
2177
|
+
|
|
2178
|
+
var tabKey = generateNewKey();
|
|
2179
|
+
studioOps.appendToSlot({
|
|
2180
|
+
type: "component",
|
|
2181
|
+
name: "AntdTabPane",
|
|
2182
|
+
props: {
|
|
2183
|
+
key: tabKey
|
|
2184
|
+
}
|
|
2185
|
+
}, "children");
|
|
2186
|
+
studioOps.updateProps({
|
|
2187
|
+
activeKey: tabKey
|
|
2188
|
+
});
|
|
2189
|
+
}
|
|
2190
|
+
}, {
|
|
2191
|
+
type: "button-action",
|
|
2192
|
+
label: "Delete current tab",
|
|
2193
|
+
onClick: function onClick(_ref3) {
|
|
2194
|
+
var componentProps = _ref3.componentProps,
|
|
2195
|
+
studioOps = _ref3.studioOps;
|
|
2196
|
+
|
|
2197
|
+
if (componentProps.activeKey) {
|
|
2198
|
+
var tabPanes = [];
|
|
2199
|
+
traverseReactEltTree(componentProps.children, function (elt) {
|
|
2200
|
+
if ((elt == null ? void 0 : elt.type) === rcTabs.TabPane && typeof (elt == null ? void 0 : elt.key) === "string") {
|
|
2201
|
+
tabPanes.push(elt.key);
|
|
2202
|
+
}
|
|
2203
|
+
});
|
|
2204
|
+
var activeKey = componentProps.activeKey;
|
|
2205
|
+
var currTabPos = tabPanes.findIndex(function (tabKey) {
|
|
2206
|
+
return tabKey === activeKey;
|
|
2207
|
+
});
|
|
2208
|
+
|
|
2209
|
+
if (currTabPos !== -1) {
|
|
2210
|
+
studioOps.removeFromSlotAt(currTabPos, "children");
|
|
2211
|
+
|
|
2212
|
+
if (tabPanes.length - 1 > 0) {
|
|
2213
|
+
var prevTabPos = (currTabPos - 1 + tabPanes.length) % tabPanes.length;
|
|
2214
|
+
studioOps.updateProps({
|
|
2215
|
+
activeKey: tabPanes[prevTabPos]
|
|
2216
|
+
});
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2220
|
+
}
|
|
2221
|
+
}, {
|
|
2222
|
+
type: "custom-action",
|
|
2223
|
+
control: OutlineMessage
|
|
2224
|
+
}],
|
|
2225
|
+
importPath: "@plasmicpkgs/antd/skinny/registerTabs",
|
|
2226
|
+
importName: "Tabs"
|
|
2227
|
+
};
|
|
2228
|
+
function registerTabs(loader, customTabsMeta) {
|
|
2229
|
+
var doRegisterComponent = function doRegisterComponent() {
|
|
2230
|
+
return loader ? loader.registerComponent.apply(loader, arguments) : registerComponent.apply(void 0, arguments);
|
|
2231
|
+
};
|
|
2232
|
+
|
|
2233
|
+
doRegisterComponent(Tabs, customTabsMeta != null ? customTabsMeta : tabsMeta);
|
|
2234
|
+
}
|
|
2235
|
+
|
|
2236
|
+
function registerAll(loader) {
|
|
2237
|
+
registerButton(loader);
|
|
2238
|
+
registerSlider(loader);
|
|
2239
|
+
registerSwitch(loader);
|
|
2240
|
+
registerOption(loader);
|
|
2241
|
+
registerOptGroup(loader);
|
|
2242
|
+
registerSelect(loader);
|
|
2243
|
+
registerCollapsePanel(loader);
|
|
2244
|
+
registerCollapse(loader);
|
|
2245
|
+
registerCheckbox(loader);
|
|
2246
|
+
registerCheckboxGroup(loader);
|
|
2247
|
+
registerMenuDivider(loader);
|
|
2248
|
+
registerMenuItem(loader);
|
|
2249
|
+
registerMenuItemGroup(loader);
|
|
2250
|
+
registerSubMenu(loader);
|
|
2251
|
+
registerMenu(loader);
|
|
2252
|
+
registerDropdown(loader);
|
|
2253
|
+
registerDropdownButton(loader);
|
|
2254
|
+
registerCarousel(loader);
|
|
2255
|
+
registerInput(loader);
|
|
2256
|
+
registerInputTextArea(loader);
|
|
2257
|
+
registerInputSearch(loader);
|
|
2258
|
+
registerInputPassword(loader);
|
|
2259
|
+
registerInputGroup(loader);
|
|
2260
|
+
registerTabPane(loader);
|
|
2261
|
+
registerTable(loader);
|
|
2262
|
+
registerTableColumn(loader);
|
|
2263
|
+
registerTableValue(loader);
|
|
2264
|
+
registerTabs(loader);
|
|
2265
|
+
registerRate(loader);
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2268
|
+
exports.Collapse = Collapse;
|
|
2269
|
+
exports.Dropdown = Dropdown;
|
|
2270
|
+
exports.Slider = Slider;
|
|
2271
|
+
exports.Tabs = Tabs;
|
|
2272
|
+
exports.buttonMeta = buttonMeta;
|
|
2273
|
+
exports.carouselMeta = carouselMeta;
|
|
2274
|
+
exports.checkboxGroupMeta = checkboxGroupMeta;
|
|
2275
|
+
exports.checkboxMeta = checkboxMeta;
|
|
2276
|
+
exports.collapsteMeta = collapsteMeta;
|
|
2277
|
+
exports.collapstePanelMeta = collapstePanelMeta;
|
|
2278
|
+
exports.dropdownButtonMeta = dropdownButtonMeta;
|
|
2279
|
+
exports.dropdownMeta = dropdownMeta;
|
|
2280
|
+
exports.inputGroupMeta = inputGroupMeta;
|
|
2281
|
+
exports.inputMeta = inputMeta;
|
|
2282
|
+
exports.inputPasswordMeta = inputPasswordMeta;
|
|
2283
|
+
exports.inputSearchMeta = inputSearchMeta;
|
|
2284
|
+
exports.inputTextAreaMeta = inputTextAreaMeta;
|
|
2285
|
+
exports.menuDividerMeta = menuDividerMeta;
|
|
2286
|
+
exports.menuItemGroupMeta = menuItemGroupMeta;
|
|
2287
|
+
exports.menuItemMeta = menuItemMeta;
|
|
2288
|
+
exports.menuMeta = menuMeta;
|
|
2289
|
+
exports.optGroupMeta = optGroupMeta;
|
|
2290
|
+
exports.optionMeta = optionMeta;
|
|
2291
|
+
exports.rateMeta = rateMeta;
|
|
2292
|
+
exports.registerAll = registerAll;
|
|
2293
|
+
exports.registerButton = registerButton;
|
|
2294
|
+
exports.registerCarousel = registerCarousel;
|
|
2295
|
+
exports.registerCheckbox = registerCheckbox;
|
|
2296
|
+
exports.registerCheckboxGroup = registerCheckboxGroup;
|
|
2297
|
+
exports.registerCollapse = registerCollapse;
|
|
2298
|
+
exports.registerCollapsePanel = registerCollapsePanel;
|
|
2299
|
+
exports.registerDropdown = registerDropdown;
|
|
2300
|
+
exports.registerDropdownButton = registerDropdownButton;
|
|
2301
|
+
exports.registerInput = registerInput;
|
|
2302
|
+
exports.registerInputGroup = registerInputGroup;
|
|
2303
|
+
exports.registerInputPassword = registerInputPassword;
|
|
2304
|
+
exports.registerInputSearch = registerInputSearch;
|
|
2305
|
+
exports.registerInputTextArea = registerInputTextArea;
|
|
2306
|
+
exports.registerMenu = registerMenu;
|
|
2307
|
+
exports.registerMenuDivider = registerMenuDivider;
|
|
2308
|
+
exports.registerMenuItem = registerMenuItem;
|
|
2309
|
+
exports.registerMenuItemGroup = registerMenuItemGroup;
|
|
2310
|
+
exports.registerOptGroup = registerOptGroup;
|
|
2311
|
+
exports.registerOption = registerOption;
|
|
2312
|
+
exports.registerRate = registerRate;
|
|
2313
|
+
exports.registerSelect = registerSelect;
|
|
2314
|
+
exports.registerSlider = registerSlider;
|
|
2315
|
+
exports.registerSubMenu = registerSubMenu;
|
|
2316
|
+
exports.registerSwitch = registerSwitch;
|
|
2317
|
+
exports.registerTabPane = registerTabPane;
|
|
2318
|
+
exports.registerTabs = registerTabs;
|
|
2319
|
+
exports.selectMeta = selectMeta;
|
|
2320
|
+
exports.sliderMeta = sliderMeta;
|
|
2321
|
+
exports.subMenuMeta = subMenuMeta;
|
|
2322
|
+
exports.switchMeta = switchMeta;
|
|
2323
|
+
exports.tabPaneMeta = tabPaneMeta;
|
|
2324
|
+
exports.tabsMeta = tabsMeta;
|
|
2325
|
+
//# sourceMappingURL=antd.cjs.development.js.map
|