@plasmicpkgs/antd5 0.0.55 → 0.0.56
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/.tsbuildinfo +1 -1
- package/dist/antd.esm.js +629 -446
- package/dist/antd.esm.js.map +1 -1
- package/dist/index.js +628 -445
- package/dist/index.js.map +1 -1
- package/dist/registerDropdown.d.ts +4 -1
- package/dist/registerMenu.d.ts +30 -0
- package/dist/registerRadio.d.ts +1 -0
- package/package.json +4 -4
- package/skinny/registerButton.cjs.js +2 -2
- package/skinny/registerButton.cjs.js.map +1 -1
- package/skinny/registerButton.esm.js +2 -2
- package/skinny/registerButton.esm.js.map +1 -1
- package/skinny/registerCheckbox.cjs.js +2 -2
- package/skinny/registerCheckbox.cjs.js.map +1 -1
- package/skinny/registerCheckbox.esm.js +2 -2
- package/skinny/registerCheckbox.esm.js.map +1 -1
- package/skinny/registerDropdown.cjs.js +85 -38
- package/skinny/registerDropdown.cjs.js.map +1 -1
- package/skinny/registerDropdown.d.ts +4 -1
- package/skinny/registerDropdown.esm.js +85 -38
- package/skinny/registerDropdown.esm.js.map +1 -1
- package/skinny/registerForm.cjs.js +6 -6
- package/skinny/registerForm.cjs.js.map +1 -1
- package/skinny/registerForm.esm.js +6 -6
- package/skinny/registerForm.esm.js.map +1 -1
- package/skinny/registerInput.cjs.js +12 -10
- package/skinny/registerInput.cjs.js.map +1 -1
- package/skinny/registerInput.esm.js +12 -10
- package/skinny/registerInput.esm.js.map +1 -1
- package/skinny/registerMenu.cjs.js +57 -2
- package/skinny/registerMenu.cjs.js.map +1 -1
- package/skinny/registerMenu.d.ts +30 -0
- package/skinny/registerMenu.esm.js +57 -3
- package/skinny/registerMenu.esm.js.map +1 -1
- package/skinny/registerRadio.cjs.js +71 -17
- package/skinny/registerRadio.cjs.js.map +1 -1
- package/skinny/registerRadio.d.ts +1 -0
- package/skinny/registerRadio.esm.js +71 -17
- package/skinny/registerRadio.esm.js.map +1 -1
- package/skinny/registerSelect.cjs.js +45 -19
- package/skinny/registerSelect.cjs.js.map +1 -1
- package/skinny/registerSelect.esm.js +45 -19
- package/skinny/registerSelect.esm.js.map +1 -1
- package/skinny/registerUpload.cjs.js +4 -3
- package/skinny/registerUpload.cjs.js.map +1 -1
- package/skinny/registerUpload.esm.js +4 -3
- package/skinny/registerUpload.esm.js.map +1 -1
package/dist/antd.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { isValidElement, cloneElement } from 'react';
|
|
2
|
-
import { Button, Checkbox, ConfigProvider, theme, message, notification,
|
|
2
|
+
import { Button, Checkbox, ConfigProvider, theme, message, notification, Menu, Dropdown, Form, Input, InputNumber, Modal, Radio, Select, Table, Upload } from 'antd';
|
|
3
3
|
import registerComponent from '@plasmicapp/host/registerComponent';
|
|
4
4
|
import registerGlobalContext from '@plasmicapp/host/registerGlobalContext';
|
|
5
5
|
import { GlobalActionsProvider, usePlasmicCanvasContext, DataProvider, repeatedElement } from '@plasmicapp/host';
|
|
@@ -62,21 +62,21 @@ function usePrevious(value) {
|
|
|
62
62
|
return prevValue.current;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
var __defProp$
|
|
65
|
+
var __defProp$c = Object.defineProperty;
|
|
66
66
|
var __defProps$9 = Object.defineProperties;
|
|
67
67
|
var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
|
|
68
|
-
var __getOwnPropSymbols$
|
|
69
|
-
var __hasOwnProp$
|
|
70
|
-
var __propIsEnum$
|
|
71
|
-
var __defNormalProp$
|
|
72
|
-
var __spreadValues$
|
|
68
|
+
var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
|
|
69
|
+
var __hasOwnProp$c = Object.prototype.hasOwnProperty;
|
|
70
|
+
var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
|
|
71
|
+
var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
72
|
+
var __spreadValues$c = (a, b) => {
|
|
73
73
|
for (var prop in b || (b = {}))
|
|
74
|
-
if (__hasOwnProp$
|
|
75
|
-
__defNormalProp$
|
|
76
|
-
if (__getOwnPropSymbols$
|
|
77
|
-
for (var prop of __getOwnPropSymbols$
|
|
78
|
-
if (__propIsEnum$
|
|
79
|
-
__defNormalProp$
|
|
74
|
+
if (__hasOwnProp$c.call(b, prop))
|
|
75
|
+
__defNormalProp$c(a, prop, b[prop]);
|
|
76
|
+
if (__getOwnPropSymbols$c)
|
|
77
|
+
for (var prop of __getOwnPropSymbols$c(b)) {
|
|
78
|
+
if (__propIsEnum$c.call(b, prop))
|
|
79
|
+
__defNormalProp$c(a, prop, b[prop]);
|
|
80
80
|
}
|
|
81
81
|
return a;
|
|
82
82
|
};
|
|
@@ -84,11 +84,11 @@ var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
|
|
|
84
84
|
var __objRest$9 = (source, exclude) => {
|
|
85
85
|
var target = {};
|
|
86
86
|
for (var prop in source)
|
|
87
|
-
if (__hasOwnProp$
|
|
87
|
+
if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
88
88
|
target[prop] = source[prop];
|
|
89
|
-
if (source != null && __getOwnPropSymbols$
|
|
90
|
-
for (var prop of __getOwnPropSymbols$
|
|
91
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
89
|
+
if (source != null && __getOwnPropSymbols$c)
|
|
90
|
+
for (var prop of __getOwnPropSymbols$c(source)) {
|
|
91
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
|
|
92
92
|
target[prop] = source[prop];
|
|
93
93
|
}
|
|
94
94
|
return target;
|
|
@@ -98,7 +98,7 @@ function AntdButton(props) {
|
|
|
98
98
|
const target = props.target === true ? "_blank" : props.target === false ? void 0 : props.target;
|
|
99
99
|
return /* @__PURE__ */ React.createElement(
|
|
100
100
|
Button,
|
|
101
|
-
__spreadProps$9(__spreadValues$
|
|
101
|
+
__spreadProps$9(__spreadValues$c(__spreadProps$9(__spreadValues$c({}, rest), {
|
|
102
102
|
htmlType: submitsForm ? "submit" : "button"
|
|
103
103
|
}), rest), {
|
|
104
104
|
target
|
|
@@ -168,7 +168,7 @@ function registerButton(loader) {
|
|
|
168
168
|
hidden: (props) => !props.href,
|
|
169
169
|
defaultValueHint: false
|
|
170
170
|
},
|
|
171
|
-
children: {
|
|
171
|
+
children: __spreadValues$c({
|
|
172
172
|
type: "slot",
|
|
173
173
|
defaultValue: [
|
|
174
174
|
{
|
|
@@ -176,7 +176,7 @@ function registerButton(loader) {
|
|
|
176
176
|
value: "Button"
|
|
177
177
|
}
|
|
178
178
|
]
|
|
179
|
-
},
|
|
179
|
+
}, { mergeWithParent: true }),
|
|
180
180
|
icon: {
|
|
181
181
|
type: "slot",
|
|
182
182
|
hidePlaceholder: true,
|
|
@@ -192,21 +192,21 @@ function registerButton(loader) {
|
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
var __defProp$
|
|
195
|
+
var __defProp$b = Object.defineProperty;
|
|
196
196
|
var __defProps$8 = Object.defineProperties;
|
|
197
197
|
var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
|
|
198
|
-
var __getOwnPropSymbols$
|
|
199
|
-
var __hasOwnProp$
|
|
200
|
-
var __propIsEnum$
|
|
201
|
-
var __defNormalProp$
|
|
202
|
-
var __spreadValues$
|
|
198
|
+
var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
|
|
199
|
+
var __hasOwnProp$b = Object.prototype.hasOwnProperty;
|
|
200
|
+
var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
|
|
201
|
+
var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
202
|
+
var __spreadValues$b = (a, b) => {
|
|
203
203
|
for (var prop in b || (b = {}))
|
|
204
|
-
if (__hasOwnProp$
|
|
205
|
-
__defNormalProp$
|
|
206
|
-
if (__getOwnPropSymbols$
|
|
207
|
-
for (var prop of __getOwnPropSymbols$
|
|
208
|
-
if (__propIsEnum$
|
|
209
|
-
__defNormalProp$
|
|
204
|
+
if (__hasOwnProp$b.call(b, prop))
|
|
205
|
+
__defNormalProp$b(a, prop, b[prop]);
|
|
206
|
+
if (__getOwnPropSymbols$b)
|
|
207
|
+
for (var prop of __getOwnPropSymbols$b(b)) {
|
|
208
|
+
if (__propIsEnum$b.call(b, prop))
|
|
209
|
+
__defNormalProp$b(a, prop, b[prop]);
|
|
210
210
|
}
|
|
211
211
|
return a;
|
|
212
212
|
};
|
|
@@ -214,11 +214,11 @@ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
|
|
|
214
214
|
var __objRest$8 = (source, exclude) => {
|
|
215
215
|
var target = {};
|
|
216
216
|
for (var prop in source)
|
|
217
|
-
if (__hasOwnProp$
|
|
217
|
+
if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
218
218
|
target[prop] = source[prop];
|
|
219
|
-
if (source != null && __getOwnPropSymbols$
|
|
220
|
-
for (var prop of __getOwnPropSymbols$
|
|
221
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
219
|
+
if (source != null && __getOwnPropSymbols$b)
|
|
220
|
+
for (var prop of __getOwnPropSymbols$b(source)) {
|
|
221
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
|
|
222
222
|
target[prop] = source[prop];
|
|
223
223
|
}
|
|
224
224
|
return target;
|
|
@@ -232,7 +232,7 @@ function AntdCheckbox(props) {
|
|
|
232
232
|
return void 0;
|
|
233
233
|
}
|
|
234
234
|
}, [onChange]);
|
|
235
|
-
return /* @__PURE__ */ React.createElement(Checkbox, __spreadProps$8(__spreadValues$
|
|
235
|
+
return /* @__PURE__ */ React.createElement(Checkbox, __spreadProps$8(__spreadValues$b({}, rest), { onChange: wrappedOnChange }));
|
|
236
236
|
}
|
|
237
237
|
const AntdCheckboxGroup = Checkbox.Group;
|
|
238
238
|
function registerCheckbox(loader) {
|
|
@@ -268,7 +268,7 @@ function registerCheckbox(loader) {
|
|
|
268
268
|
defaultValueHint: false,
|
|
269
269
|
advanced: true
|
|
270
270
|
},
|
|
271
|
-
children: {
|
|
271
|
+
children: __spreadValues$b({
|
|
272
272
|
type: "slot",
|
|
273
273
|
defaultValue: [
|
|
274
274
|
{
|
|
@@ -276,7 +276,7 @@ function registerCheckbox(loader) {
|
|
|
276
276
|
value: "Checkbox"
|
|
277
277
|
}
|
|
278
278
|
]
|
|
279
|
-
},
|
|
279
|
+
}, { mergeWithParent: true }),
|
|
280
280
|
onChange: {
|
|
281
281
|
type: "eventHandler",
|
|
282
282
|
argTypes: [{ name: "checked", type: "boolean" }]
|
|
@@ -349,21 +349,21 @@ function registerCheckbox(loader) {
|
|
|
349
349
|
});
|
|
350
350
|
}
|
|
351
351
|
|
|
352
|
-
var __defProp$
|
|
352
|
+
var __defProp$a = Object.defineProperty;
|
|
353
353
|
var __defProps$7 = Object.defineProperties;
|
|
354
354
|
var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
|
|
355
|
-
var __getOwnPropSymbols$
|
|
356
|
-
var __hasOwnProp$
|
|
357
|
-
var __propIsEnum$
|
|
358
|
-
var __defNormalProp$
|
|
359
|
-
var __spreadValues$
|
|
355
|
+
var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
|
|
356
|
+
var __hasOwnProp$a = Object.prototype.hasOwnProperty;
|
|
357
|
+
var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
|
|
358
|
+
var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
359
|
+
var __spreadValues$a = (a, b) => {
|
|
360
360
|
for (var prop in b || (b = {}))
|
|
361
|
-
if (__hasOwnProp$
|
|
362
|
-
__defNormalProp$
|
|
363
|
-
if (__getOwnPropSymbols$
|
|
364
|
-
for (var prop of __getOwnPropSymbols$
|
|
365
|
-
if (__propIsEnum$
|
|
366
|
-
__defNormalProp$
|
|
361
|
+
if (__hasOwnProp$a.call(b, prop))
|
|
362
|
+
__defNormalProp$a(a, prop, b[prop]);
|
|
363
|
+
if (__getOwnPropSymbols$a)
|
|
364
|
+
for (var prop of __getOwnPropSymbols$a(b)) {
|
|
365
|
+
if (__propIsEnum$a.call(b, prop))
|
|
366
|
+
__defNormalProp$a(a, prop, b[prop]);
|
|
367
367
|
}
|
|
368
368
|
return a;
|
|
369
369
|
};
|
|
@@ -371,11 +371,11 @@ var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
|
|
|
371
371
|
var __objRest$7 = (source, exclude) => {
|
|
372
372
|
var target = {};
|
|
373
373
|
for (var prop in source)
|
|
374
|
-
if (__hasOwnProp$
|
|
374
|
+
if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
375
375
|
target[prop] = source[prop];
|
|
376
|
-
if (source != null && __getOwnPropSymbols$
|
|
377
|
-
for (var prop of __getOwnPropSymbols$
|
|
378
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
376
|
+
if (source != null && __getOwnPropSymbols$a)
|
|
377
|
+
for (var prop of __getOwnPropSymbols$a(source)) {
|
|
378
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
|
|
379
379
|
target[prop] = source[prop];
|
|
380
380
|
}
|
|
381
381
|
return target;
|
|
@@ -426,9 +426,9 @@ function AntdConfigProvider(props) {
|
|
|
426
426
|
const _a = props, { children, themeStyles } = _a, rest = __objRest$7(_a, ["children", "themeStyles"]);
|
|
427
427
|
return /* @__PURE__ */ React.createElement(
|
|
428
428
|
ConfigProvider,
|
|
429
|
-
__spreadValues$
|
|
429
|
+
__spreadValues$a({
|
|
430
430
|
locale: defaultLocale
|
|
431
|
-
}, themeToAntdConfig(__spreadProps$7(__spreadValues$
|
|
431
|
+
}, themeToAntdConfig(__spreadProps$7(__spreadValues$a({}, rest), {
|
|
432
432
|
fontFamily: themeStyles.fontFamily,
|
|
433
433
|
fontSize: themeStyles.fontSize ? parseInt(themeStyles.fontSize) : void 0,
|
|
434
434
|
lineHeight: themeStyles.lineHeight ? parseInt(themeStyles.lineHeight) : void 0,
|
|
@@ -464,7 +464,7 @@ function InnerConfigProvider(props) {
|
|
|
464
464
|
showNotification: (opts) => {
|
|
465
465
|
var _b;
|
|
466
466
|
const _a = opts, rest = __objRest$7(_a, ["type"]);
|
|
467
|
-
app.notification[(_b = opts.type) != null ? _b : "info"](__spreadValues$
|
|
467
|
+
app.notification[(_b = opts.type) != null ? _b : "info"](__spreadValues$a({}, rest));
|
|
468
468
|
},
|
|
469
469
|
hideNotifications: () => {
|
|
470
470
|
app.notification.destroy();
|
|
@@ -761,7 +761,7 @@ function registerTokens(loader) {
|
|
|
761
761
|
}
|
|
762
762
|
const registerConfigProvider = makeRegisterGlobalContext(
|
|
763
763
|
AntdConfigProvider,
|
|
764
|
-
__spreadProps$7(__spreadValues$
|
|
764
|
+
__spreadProps$7(__spreadValues$a({
|
|
765
765
|
name: "plasmic-antd5-config-provider",
|
|
766
766
|
displayName: "Ant Design System Settings",
|
|
767
767
|
props: {
|
|
@@ -863,6 +863,258 @@ const registerConfigProvider = makeRegisterGlobalContext(
|
|
|
863
863
|
})
|
|
864
864
|
);
|
|
865
865
|
|
|
866
|
+
var __defProp$9 = Object.defineProperty;
|
|
867
|
+
var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
|
|
868
|
+
var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
|
|
869
|
+
var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
|
|
870
|
+
var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
871
|
+
var __spreadValues$9 = (a, b) => {
|
|
872
|
+
for (var prop in b || (b = {}))
|
|
873
|
+
if (__hasOwnProp$9.call(b, prop))
|
|
874
|
+
__defNormalProp$9(a, prop, b[prop]);
|
|
875
|
+
if (__getOwnPropSymbols$9)
|
|
876
|
+
for (var prop of __getOwnPropSymbols$9(b)) {
|
|
877
|
+
if (__propIsEnum$9.call(b, prop))
|
|
878
|
+
__defNormalProp$9(a, prop, b[prop]);
|
|
879
|
+
}
|
|
880
|
+
return a;
|
|
881
|
+
};
|
|
882
|
+
const AntdMenu = Menu;
|
|
883
|
+
const AntdMenuDivider = Menu.Divider;
|
|
884
|
+
const AntdMenuItem = Menu.Item;
|
|
885
|
+
const AntdMenuItemGroup = Menu.ItemGroup;
|
|
886
|
+
const AntdSubMenu = Menu.SubMenu;
|
|
887
|
+
const allowedMenuComponents = [
|
|
888
|
+
"plasmic-antd5-menu-item",
|
|
889
|
+
"plasmic-antd5-menu-divider",
|
|
890
|
+
"plasmic-antd5-submenu",
|
|
891
|
+
"plasmic-antd5-menu-item-group"
|
|
892
|
+
];
|
|
893
|
+
const MENU_ITEM_TYPE = {
|
|
894
|
+
type: "object",
|
|
895
|
+
nameFunc: (item) => {
|
|
896
|
+
if (item.type === "divider") {
|
|
897
|
+
return "Divider";
|
|
898
|
+
}
|
|
899
|
+
return item.label || item.value;
|
|
900
|
+
},
|
|
901
|
+
fields: {
|
|
902
|
+
type: {
|
|
903
|
+
type: "choice",
|
|
904
|
+
options: [
|
|
905
|
+
{ value: "item", label: "Menu item" },
|
|
906
|
+
{ value: "group", label: "Menu item group" },
|
|
907
|
+
{ value: "submenu", label: "Sub-menu" },
|
|
908
|
+
{ value: "divider", label: "Menu divider" }
|
|
909
|
+
],
|
|
910
|
+
defaultValue: "item"
|
|
911
|
+
},
|
|
912
|
+
key: {
|
|
913
|
+
type: "string",
|
|
914
|
+
displayName: "Menu item key",
|
|
915
|
+
description: "Key of the menu item; the onClick will receive this as the value to indicate which item was clicked.",
|
|
916
|
+
hidden: (ps) => ps.type !== "item"
|
|
917
|
+
},
|
|
918
|
+
label: {
|
|
919
|
+
type: "string",
|
|
920
|
+
description: "Label of the menu item; will use the key if not specified.",
|
|
921
|
+
hidden: (ps) => ps.type === "divider"
|
|
922
|
+
},
|
|
923
|
+
children: {
|
|
924
|
+
type: "array",
|
|
925
|
+
displayName: "Menu items",
|
|
926
|
+
hidden: (ps) => ps.type !== "submenu" && ps.type !== "group"
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
};
|
|
930
|
+
MENU_ITEM_TYPE.fields.children.itemType = MENU_ITEM_TYPE;
|
|
931
|
+
function registerMenu(loader) {
|
|
932
|
+
registerComponentHelper(loader, AntdMenu, {
|
|
933
|
+
name: "plasmic-antd5-menu",
|
|
934
|
+
displayName: "Menu",
|
|
935
|
+
props: {
|
|
936
|
+
expandIcon: {
|
|
937
|
+
type: "slot",
|
|
938
|
+
hidePlaceholder: true
|
|
939
|
+
},
|
|
940
|
+
mode: {
|
|
941
|
+
type: "choice",
|
|
942
|
+
options: ["horizontal", "vertical", "inline"],
|
|
943
|
+
description: "Type of menu",
|
|
944
|
+
defaultValueHint: "vertical"
|
|
945
|
+
},
|
|
946
|
+
multiple: {
|
|
947
|
+
type: "boolean",
|
|
948
|
+
description: "Allows selection of multiple items",
|
|
949
|
+
defaultValueHint: false
|
|
950
|
+
},
|
|
951
|
+
triggerSubMenuAction: {
|
|
952
|
+
type: "choice",
|
|
953
|
+
options: ["hover", "click"],
|
|
954
|
+
description: "Which action can trigger submenu open/close",
|
|
955
|
+
defaultValueHint: "hover",
|
|
956
|
+
advanced: true
|
|
957
|
+
},
|
|
958
|
+
children: {
|
|
959
|
+
type: "slot",
|
|
960
|
+
allowedComponents: allowedMenuComponents,
|
|
961
|
+
defaultValue: [
|
|
962
|
+
{
|
|
963
|
+
type: "component",
|
|
964
|
+
name: "plasmic-antd5-menu-item",
|
|
965
|
+
props: {
|
|
966
|
+
key: "menuItemKey1"
|
|
967
|
+
}
|
|
968
|
+
},
|
|
969
|
+
{
|
|
970
|
+
type: "component",
|
|
971
|
+
name: "plasmic-antd5-menu-item",
|
|
972
|
+
props: {
|
|
973
|
+
key: "menuItemKey2"
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
]
|
|
977
|
+
},
|
|
978
|
+
onSelect: {
|
|
979
|
+
type: "eventHandler",
|
|
980
|
+
argTypes: [{ name: "key", type: "string" }]
|
|
981
|
+
}
|
|
982
|
+
},
|
|
983
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
984
|
+
importName: "AntdMenu"
|
|
985
|
+
});
|
|
986
|
+
registerComponentHelper(loader, AntdMenuItem, {
|
|
987
|
+
name: "plasmic-antd5-menu-item",
|
|
988
|
+
displayName: "Menu Item",
|
|
989
|
+
props: {
|
|
990
|
+
danger: {
|
|
991
|
+
type: "boolean",
|
|
992
|
+
description: "Display the danger style",
|
|
993
|
+
defaultValueHint: false
|
|
994
|
+
},
|
|
995
|
+
disabled: {
|
|
996
|
+
type: "boolean",
|
|
997
|
+
description: "Whether disabled select",
|
|
998
|
+
defaultValueHint: false
|
|
999
|
+
},
|
|
1000
|
+
key: {
|
|
1001
|
+
type: "string",
|
|
1002
|
+
displayName: "Unique key",
|
|
1003
|
+
description: "Unique ID of the menu item. Used to determine which item is selected.",
|
|
1004
|
+
defaultValue: "menuItemKey"
|
|
1005
|
+
},
|
|
1006
|
+
title: {
|
|
1007
|
+
type: "string",
|
|
1008
|
+
description: "Set display title for collapsed item"
|
|
1009
|
+
},
|
|
1010
|
+
children: __spreadValues$9({
|
|
1011
|
+
type: "slot",
|
|
1012
|
+
defaultValue: [
|
|
1013
|
+
{
|
|
1014
|
+
type: "text",
|
|
1015
|
+
value: "Menu item"
|
|
1016
|
+
}
|
|
1017
|
+
]
|
|
1018
|
+
}, { mergeWithParent: true }),
|
|
1019
|
+
onClick: {
|
|
1020
|
+
type: "eventHandler",
|
|
1021
|
+
argTypes: []
|
|
1022
|
+
}
|
|
1023
|
+
},
|
|
1024
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
1025
|
+
importName: "AntdMenuItem",
|
|
1026
|
+
parentComponentName: "plasmic-antd5-menu"
|
|
1027
|
+
});
|
|
1028
|
+
registerComponentHelper(loader, AntdMenuItemGroup, {
|
|
1029
|
+
name: "plasmic-antd5-menu-item-group",
|
|
1030
|
+
displayName: "Item Group",
|
|
1031
|
+
props: {
|
|
1032
|
+
title: {
|
|
1033
|
+
type: "slot",
|
|
1034
|
+
defaultValue: [
|
|
1035
|
+
{
|
|
1036
|
+
type: "text",
|
|
1037
|
+
value: "Group"
|
|
1038
|
+
}
|
|
1039
|
+
]
|
|
1040
|
+
},
|
|
1041
|
+
children: {
|
|
1042
|
+
type: "slot",
|
|
1043
|
+
allowedComponents: allowedMenuComponents,
|
|
1044
|
+
defaultValue: [
|
|
1045
|
+
{
|
|
1046
|
+
type: "component",
|
|
1047
|
+
name: "plasmic-antd5-menu-item"
|
|
1048
|
+
}
|
|
1049
|
+
]
|
|
1050
|
+
}
|
|
1051
|
+
},
|
|
1052
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
1053
|
+
importName: "AntdMenuItemGroup",
|
|
1054
|
+
parentComponentName: "plasmic-antd5-menu"
|
|
1055
|
+
});
|
|
1056
|
+
registerComponentHelper(loader, AntdMenuDivider, {
|
|
1057
|
+
name: "plasmic-antd5-menu-divider",
|
|
1058
|
+
displayName: "Menu Divider",
|
|
1059
|
+
props: {
|
|
1060
|
+
dashed: {
|
|
1061
|
+
type: "boolean",
|
|
1062
|
+
description: "Whether line is dashed",
|
|
1063
|
+
defaultValueHint: false
|
|
1064
|
+
}
|
|
1065
|
+
},
|
|
1066
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
1067
|
+
importName: "AntdMenuDivider",
|
|
1068
|
+
parentComponentName: "plasmic-antd5-menu"
|
|
1069
|
+
});
|
|
1070
|
+
registerComponentHelper(loader, AntdSubMenu, {
|
|
1071
|
+
name: "plasmic-antd5-submenu",
|
|
1072
|
+
displayName: "Sub Menu",
|
|
1073
|
+
props: {
|
|
1074
|
+
disabled: {
|
|
1075
|
+
type: "boolean",
|
|
1076
|
+
description: "Whether sub-menu is disabled",
|
|
1077
|
+
defaultValueHint: false
|
|
1078
|
+
},
|
|
1079
|
+
key: {
|
|
1080
|
+
type: "string",
|
|
1081
|
+
displayName: "Unique key",
|
|
1082
|
+
description: "Unique ID of the sub-menu. Used to determine which item is selected.",
|
|
1083
|
+
advanced: true
|
|
1084
|
+
},
|
|
1085
|
+
title: {
|
|
1086
|
+
type: "slot",
|
|
1087
|
+
defaultValue: [
|
|
1088
|
+
{
|
|
1089
|
+
type: "text",
|
|
1090
|
+
value: "Sub-menu"
|
|
1091
|
+
}
|
|
1092
|
+
]
|
|
1093
|
+
},
|
|
1094
|
+
children: {
|
|
1095
|
+
type: "slot",
|
|
1096
|
+
allowedComponents: allowedMenuComponents,
|
|
1097
|
+
defaultValue: [1, 2].map((i) => ({
|
|
1098
|
+
type: "component",
|
|
1099
|
+
name: "plasmic-antd5-menu-item",
|
|
1100
|
+
props: {
|
|
1101
|
+
key: `subMenuItemKey${i}`,
|
|
1102
|
+
children: [
|
|
1103
|
+
{
|
|
1104
|
+
type: "text",
|
|
1105
|
+
value: `Sub-menu item ${i}`
|
|
1106
|
+
}
|
|
1107
|
+
]
|
|
1108
|
+
}
|
|
1109
|
+
}))
|
|
1110
|
+
}
|
|
1111
|
+
},
|
|
1112
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
1113
|
+
importName: "AntdSubMenu",
|
|
1114
|
+
parentComponentName: "plasmic-antd5-menu"
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
1117
|
+
|
|
866
1118
|
var __defProp$8 = Object.defineProperty;
|
|
867
1119
|
var __defProps$6 = Object.defineProperties;
|
|
868
1120
|
var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
|
|
@@ -893,60 +1145,46 @@ var __objRest$6 = (source, exclude) => {
|
|
|
893
1145
|
target[prop] = source[prop];
|
|
894
1146
|
}
|
|
895
1147
|
return target;
|
|
896
|
-
};
|
|
897
|
-
function AntdDropdown(props) {
|
|
898
|
-
const _a = props, {
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
advanced: true
|
|
933
|
-
},
|
|
934
|
-
placement: {
|
|
935
|
-
type: "choice",
|
|
936
|
-
options: [
|
|
937
|
-
"bottomLeft",
|
|
938
|
-
"bottomCenter",
|
|
939
|
-
"bottomRight",
|
|
940
|
-
"topLeft",
|
|
941
|
-
"topCenter",
|
|
942
|
-
"topRight"
|
|
943
|
-
],
|
|
944
|
-
description: "Placement of popup menu",
|
|
945
|
-
defaultValueHint: "bottomLeft",
|
|
946
|
-
advanced: true
|
|
947
|
-
},
|
|
1148
|
+
};
|
|
1149
|
+
function AntdDropdown(props) {
|
|
1150
|
+
const _a = props, {
|
|
1151
|
+
children,
|
|
1152
|
+
onAction,
|
|
1153
|
+
menuItems,
|
|
1154
|
+
useMenuItemsSlot = false,
|
|
1155
|
+
menuItemsJson,
|
|
1156
|
+
trigger = "click"
|
|
1157
|
+
} = _a, rest = __objRest$6(_a, [
|
|
1158
|
+
"children",
|
|
1159
|
+
"onAction",
|
|
1160
|
+
"menuItems",
|
|
1161
|
+
"useMenuItemsSlot",
|
|
1162
|
+
"menuItemsJson",
|
|
1163
|
+
"trigger"
|
|
1164
|
+
]);
|
|
1165
|
+
return /* @__PURE__ */ React.createElement(
|
|
1166
|
+
Dropdown,
|
|
1167
|
+
__spreadProps$6(__spreadValues$8({}, rest), {
|
|
1168
|
+
trigger: [trigger],
|
|
1169
|
+
overlay: () => {
|
|
1170
|
+
var _a2;
|
|
1171
|
+
const itemsChildren = useMenuItemsSlot ? (_a2 = menuItems == null ? void 0 : menuItems()) != null ? _a2 : [] : void 0;
|
|
1172
|
+
const items = useMenuItemsSlot ? void 0 : menuItemsJson;
|
|
1173
|
+
return /* @__PURE__ */ React.createElement(Menu, { onClick: (event) => onAction == null ? void 0 : onAction(event.key), items }, itemsChildren);
|
|
1174
|
+
}
|
|
1175
|
+
}),
|
|
1176
|
+
typeof children === "string" ? /* @__PURE__ */ React.createElement("div", null, children) : children
|
|
1177
|
+
);
|
|
1178
|
+
}
|
|
1179
|
+
function registerDropdown(loader) {
|
|
1180
|
+
registerComponentHelper(loader, AntdDropdown, {
|
|
1181
|
+
name: "plasmic-antd5-dropdown",
|
|
1182
|
+
displayName: "Dropdown",
|
|
1183
|
+
props: {
|
|
948
1184
|
menuItems: {
|
|
949
1185
|
type: "slot",
|
|
1186
|
+
displayName: "Menu items",
|
|
1187
|
+
hidden: (ps) => !ps.useMenuItemsSlot,
|
|
950
1188
|
allowedComponents: [
|
|
951
1189
|
"plasmic-antd5-menu-item",
|
|
952
1190
|
"plasmic-antd5-menu-item-group",
|
|
@@ -971,13 +1209,67 @@ function registerDropdown(loader) {
|
|
|
971
1209
|
],
|
|
972
1210
|
renderPropParams: []
|
|
973
1211
|
},
|
|
1212
|
+
menuItemsJson: {
|
|
1213
|
+
type: "array",
|
|
1214
|
+
displayName: "Menu Items",
|
|
1215
|
+
hidden: (ps) => ps.useMenuItemsSlot,
|
|
1216
|
+
itemType: MENU_ITEM_TYPE,
|
|
1217
|
+
defaultValue: [
|
|
1218
|
+
{
|
|
1219
|
+
type: "item",
|
|
1220
|
+
value: "action1",
|
|
1221
|
+
label: "Action 1"
|
|
1222
|
+
},
|
|
1223
|
+
{
|
|
1224
|
+
type: "item",
|
|
1225
|
+
value: "action2",
|
|
1226
|
+
label: "Action 2"
|
|
1227
|
+
}
|
|
1228
|
+
]
|
|
1229
|
+
},
|
|
1230
|
+
open: {
|
|
1231
|
+
type: "boolean",
|
|
1232
|
+
description: "Toggle visibility of dropdown menu in Plasmic Editor",
|
|
1233
|
+
editOnly: true,
|
|
1234
|
+
uncontrolledProp: "fakeOpen",
|
|
1235
|
+
defaultValueHint: false
|
|
1236
|
+
},
|
|
1237
|
+
disabled: {
|
|
1238
|
+
type: "boolean",
|
|
1239
|
+
description: "Whether the dropdown menu is disabled",
|
|
1240
|
+
defaultValueHint: false
|
|
1241
|
+
},
|
|
1242
|
+
placement: {
|
|
1243
|
+
type: "choice",
|
|
1244
|
+
options: [
|
|
1245
|
+
"bottomLeft",
|
|
1246
|
+
"bottomCenter",
|
|
1247
|
+
"bottomRight",
|
|
1248
|
+
"topLeft",
|
|
1249
|
+
"topCenter",
|
|
1250
|
+
"topRight"
|
|
1251
|
+
],
|
|
1252
|
+
description: "Placement of popup menu",
|
|
1253
|
+
defaultValueHint: "bottomLeft",
|
|
1254
|
+
advanced: true
|
|
1255
|
+
},
|
|
974
1256
|
trigger: {
|
|
975
1257
|
type: "choice",
|
|
976
|
-
options: [
|
|
1258
|
+
options: [
|
|
1259
|
+
{ value: "click", label: "Click" },
|
|
1260
|
+
{ value: "hover", label: "Hover" },
|
|
1261
|
+
{ value: "contextMenu", label: "Right-click" }
|
|
1262
|
+
],
|
|
977
1263
|
description: "The trigger mode which executes the dropdown action",
|
|
978
|
-
defaultValueHint: "
|
|
1264
|
+
defaultValueHint: "click"
|
|
979
1265
|
},
|
|
980
|
-
|
|
1266
|
+
useMenuItemsSlot: {
|
|
1267
|
+
type: "boolean",
|
|
1268
|
+
displayName: "Use menu items slot",
|
|
1269
|
+
advanced: true,
|
|
1270
|
+
description: "Instead of configuring a list of menu items, build the menu items using MenuItem elements. This gives you greater control over item styling."
|
|
1271
|
+
},
|
|
1272
|
+
children: __spreadValues$8({
|
|
981
1273
|
type: "slot",
|
|
982
1274
|
defaultValue: [
|
|
983
1275
|
{
|
|
@@ -991,6 +1283,12 @@ function registerDropdown(loader) {
|
|
|
991
1283
|
}
|
|
992
1284
|
}
|
|
993
1285
|
]
|
|
1286
|
+
}, { mergeWithParent: true }),
|
|
1287
|
+
arrow: {
|
|
1288
|
+
type: "boolean",
|
|
1289
|
+
description: "Whether the dropdown arrow should be visible",
|
|
1290
|
+
defaultValueHint: false,
|
|
1291
|
+
advanced: true
|
|
994
1292
|
},
|
|
995
1293
|
onAction: {
|
|
996
1294
|
type: "eventHandler",
|
|
@@ -1608,7 +1906,7 @@ function FormItemForwarder(_a) {
|
|
|
1608
1906
|
});
|
|
1609
1907
|
}
|
|
1610
1908
|
function registerFormItem(loader) {
|
|
1611
|
-
registerComponentHelper(loader, FormItemWrapper, {
|
|
1909
|
+
registerComponentHelper(loader, FormItemWrapper, __spreadValues$6({
|
|
1612
1910
|
name: "plasmic-antd5-form-item",
|
|
1613
1911
|
displayName: "Form Item",
|
|
1614
1912
|
parentComponentName: "plasmic-antd5-form",
|
|
@@ -1617,21 +1915,21 @@ function registerFormItem(loader) {
|
|
|
1617
1915
|
width: "stretch"
|
|
1618
1916
|
},
|
|
1619
1917
|
props: {
|
|
1620
|
-
label: {
|
|
1918
|
+
label: __spreadValues$6({
|
|
1621
1919
|
type: "slot",
|
|
1622
1920
|
defaultValue: {
|
|
1623
1921
|
type: "text",
|
|
1624
1922
|
value: "Label"
|
|
1625
1923
|
},
|
|
1626
1924
|
hidden: (ps) => !!ps.noLabel
|
|
1627
|
-
},
|
|
1628
|
-
children: {
|
|
1925
|
+
}, { mergeWithParent: true }),
|
|
1926
|
+
children: __spreadValues$6({
|
|
1629
1927
|
type: "slot",
|
|
1630
1928
|
defaultValue: {
|
|
1631
1929
|
type: "component",
|
|
1632
1930
|
name: "plasmic-antd5-input"
|
|
1633
1931
|
}
|
|
1634
|
-
},
|
|
1932
|
+
}, { mergeWithParent: true }),
|
|
1635
1933
|
name: {
|
|
1636
1934
|
type: "string"
|
|
1637
1935
|
},
|
|
@@ -1804,7 +2102,7 @@ function registerFormItem(loader) {
|
|
|
1804
2102
|
}
|
|
1805
2103
|
}
|
|
1806
2104
|
}
|
|
1807
|
-
});
|
|
2105
|
+
}, { trapsSelection: true }));
|
|
1808
2106
|
}
|
|
1809
2107
|
function FormGroup(props) {
|
|
1810
2108
|
const pathCtx = React.useContext(PathContext);
|
|
@@ -2120,14 +2418,14 @@ const COMMON_EVENT_HANDLERS = {
|
|
|
2120
2418
|
}
|
|
2121
2419
|
};
|
|
2122
2420
|
function registerInput(loader) {
|
|
2123
|
-
registerComponentHelper(loader, AntdInput, {
|
|
2421
|
+
registerComponentHelper(loader, AntdInput, __spreadProps$4(__spreadValues$5({
|
|
2124
2422
|
name: "plasmic-antd5-input",
|
|
2125
2423
|
displayName: "Input",
|
|
2126
2424
|
props: __spreadValues$5(__spreadValues$5(__spreadValues$5({
|
|
2127
2425
|
value: {
|
|
2128
2426
|
type: "string"
|
|
2129
2427
|
},
|
|
2130
|
-
|
|
2428
|
+
placeholder: {
|
|
2131
2429
|
type: "string"
|
|
2132
2430
|
},
|
|
2133
2431
|
size: {
|
|
@@ -2153,11 +2451,12 @@ function registerInput(loader) {
|
|
|
2153
2451
|
defaultValueHint: "text"
|
|
2154
2452
|
}
|
|
2155
2453
|
}, COMMON_ADVANCED_PROPS), COMMON_DECORATOR_PROPS), COMMON_EVENT_HANDLERS),
|
|
2156
|
-
states: __spreadValues$5({}, COMMON_STATES)
|
|
2454
|
+
states: __spreadValues$5({}, COMMON_STATES)
|
|
2455
|
+
}, { trapsSelection: true }), {
|
|
2157
2456
|
componentHelpers: COMMON_HELPERS_CONFIG,
|
|
2158
2457
|
importPath: "@plasmicpkgs/antd5/skinny/registerInput",
|
|
2159
2458
|
importName: "AntdInput"
|
|
2160
|
-
});
|
|
2459
|
+
}));
|
|
2161
2460
|
}
|
|
2162
2461
|
function registerTextArea(loader) {
|
|
2163
2462
|
registerComponentHelper(loader, AntdTextArea, {
|
|
@@ -2168,304 +2467,107 @@ function registerTextArea(loader) {
|
|
|
2168
2467
|
value: {
|
|
2169
2468
|
type: "string"
|
|
2170
2469
|
},
|
|
2171
|
-
|
|
2172
|
-
type: "string"
|
|
2173
|
-
},
|
|
2174
|
-
disabled: {
|
|
2175
|
-
type: "boolean"
|
|
2176
|
-
},
|
|
2177
|
-
maxLength: {
|
|
2178
|
-
type: "number",
|
|
2179
|
-
advanced: true
|
|
2180
|
-
},
|
|
2181
|
-
bordered: {
|
|
2182
|
-
type: "boolean",
|
|
2183
|
-
advanced: true,
|
|
2184
|
-
defaultValueHint: true
|
|
2185
|
-
}
|
|
2186
|
-
}, COMMON_EVENT_HANDLERS),
|
|
2187
|
-
states: __spreadValues$5({}, COMMON_STATES),
|
|
2188
|
-
componentHelpers: COMMON_HELPERS_CONFIG,
|
|
2189
|
-
importPath: "@plasmicpkgs/antd5/skinny/registerInput",
|
|
2190
|
-
importName: "AntdTextArea"
|
|
2191
|
-
});
|
|
2192
|
-
}
|
|
2193
|
-
function registerPasswordInput(loader) {
|
|
2194
|
-
registerComponentHelper(loader, AntdPassword, {
|
|
2195
|
-
name: "plasmic-antd5-input-password",
|
|
2196
|
-
parentComponentName: "plasmic-antd5-input",
|
|
2197
|
-
displayName: "Password Input",
|
|
2198
|
-
props: __spreadValues$5({
|
|
2199
|
-
value: {
|
|
2200
|
-
type: "string"
|
|
2201
|
-
},
|
|
2202
|
-
placholder: {
|
|
2203
|
-
type: "string"
|
|
2204
|
-
},
|
|
2205
|
-
disabled: {
|
|
2206
|
-
type: "boolean"
|
|
2207
|
-
},
|
|
2208
|
-
maxLength: {
|
|
2209
|
-
type: "number",
|
|
2210
|
-
advanced: true
|
|
2211
|
-
},
|
|
2212
|
-
bordered: {
|
|
2213
|
-
type: "boolean",
|
|
2214
|
-
advanced: true,
|
|
2215
|
-
defaultValueHint: true
|
|
2216
|
-
}
|
|
2217
|
-
}, COMMON_EVENT_HANDLERS),
|
|
2218
|
-
states: __spreadValues$5({}, COMMON_STATES),
|
|
2219
|
-
componentHelpers: COMMON_HELPERS_CONFIG,
|
|
2220
|
-
importPath: "@plasmicpkgs/antd5/skinny/registerInput",
|
|
2221
|
-
importName: "AntdPassword"
|
|
2222
|
-
});
|
|
2223
|
-
}
|
|
2224
|
-
function registerNumberInput(loader) {
|
|
2225
|
-
registerComponentHelper(loader, AntdInputNumber, {
|
|
2226
|
-
name: "plasmic-antd5-input-number",
|
|
2227
|
-
parentComponentName: "plasmic-antd5-input",
|
|
2228
|
-
displayName: "Number Input",
|
|
2229
|
-
props: __spreadProps$4(__spreadValues$5(__spreadValues$5(__spreadValues$5({
|
|
2230
|
-
value: {
|
|
2231
|
-
type: "number"
|
|
2232
|
-
},
|
|
2233
|
-
placholder: {
|
|
2234
|
-
type: "string"
|
|
2235
|
-
},
|
|
2236
|
-
disabled: {
|
|
2237
|
-
type: "boolean"
|
|
2238
|
-
},
|
|
2239
|
-
max: {
|
|
2240
|
-
type: "number"
|
|
2241
|
-
},
|
|
2242
|
-
min: {
|
|
2243
|
-
type: "number"
|
|
2244
|
-
},
|
|
2245
|
-
step: {
|
|
2246
|
-
type: "number",
|
|
2247
|
-
helpText: "Increment or decrement step"
|
|
2248
|
-
},
|
|
2249
|
-
controls: {
|
|
2250
|
-
type: "boolean",
|
|
2251
|
-
displayName: "Show add/minus controls?",
|
|
2252
|
-
advanced: true
|
|
2253
|
-
}
|
|
2254
|
-
}, COMMON_DECORATOR_PROPS), COMMON_ADVANCED_PROPS), COMMON_EVENT_HANDLERS), {
|
|
2255
|
-
// onChange directly called with the number
|
|
2256
|
-
onChange: {
|
|
2257
|
-
type: "eventHandler",
|
|
2258
|
-
argTypes: [
|
|
2259
|
-
{
|
|
2260
|
-
name: "value",
|
|
2261
|
-
type: "number"
|
|
2262
|
-
}
|
|
2263
|
-
]
|
|
2264
|
-
}
|
|
2265
|
-
}),
|
|
2266
|
-
states: __spreadValues$5({}, COMMON_STATES),
|
|
2267
|
-
// don't need component helpers
|
|
2268
|
-
importPath: "@plasmicpkgs/antd5/skinny/registerInput",
|
|
2269
|
-
importName: "AntdInputNumber"
|
|
2270
|
-
});
|
|
2271
|
-
}
|
|
2272
|
-
|
|
2273
|
-
const AntdMenu = Menu;
|
|
2274
|
-
const AntdMenuDivider = Menu.Divider;
|
|
2275
|
-
const AntdMenuItem = Menu.Item;
|
|
2276
|
-
const AntdMenuItemGroup = Menu.ItemGroup;
|
|
2277
|
-
const AntdSubMenu = Menu.SubMenu;
|
|
2278
|
-
const allowedMenuComponents = [
|
|
2279
|
-
"plasmic-antd5-menu-item",
|
|
2280
|
-
"plasmic-antd5-menu-divider",
|
|
2281
|
-
"plasmic-antd5-submenu",
|
|
2282
|
-
"plasmic-antd5-menu-item-group"
|
|
2283
|
-
];
|
|
2284
|
-
function registerMenu(loader) {
|
|
2285
|
-
registerComponentHelper(loader, AntdMenu, {
|
|
2286
|
-
name: "plasmic-antd5-menu",
|
|
2287
|
-
displayName: "Menu",
|
|
2288
|
-
props: {
|
|
2289
|
-
expandIcon: {
|
|
2290
|
-
type: "slot",
|
|
2291
|
-
hidePlaceholder: true
|
|
2292
|
-
},
|
|
2293
|
-
mode: {
|
|
2294
|
-
type: "choice",
|
|
2295
|
-
options: ["horizontal", "vertical", "inline"],
|
|
2296
|
-
description: "Type of menu",
|
|
2297
|
-
defaultValueHint: "vertical"
|
|
2298
|
-
},
|
|
2299
|
-
multiple: {
|
|
2300
|
-
type: "boolean",
|
|
2301
|
-
description: "Allows selection of multiple items",
|
|
2302
|
-
defaultValueHint: false
|
|
2303
|
-
},
|
|
2304
|
-
triggerSubMenuAction: {
|
|
2305
|
-
type: "choice",
|
|
2306
|
-
options: ["hover", "click"],
|
|
2307
|
-
description: "Which action can trigger submenu open/close",
|
|
2308
|
-
defaultValueHint: "hover",
|
|
2309
|
-
advanced: true
|
|
2310
|
-
},
|
|
2311
|
-
children: {
|
|
2312
|
-
type: "slot",
|
|
2313
|
-
allowedComponents: allowedMenuComponents,
|
|
2314
|
-
defaultValue: [
|
|
2315
|
-
{
|
|
2316
|
-
type: "component",
|
|
2317
|
-
name: "plasmic-antd5-menu-item",
|
|
2318
|
-
props: {
|
|
2319
|
-
key: "menuItemKey1"
|
|
2320
|
-
}
|
|
2321
|
-
},
|
|
2322
|
-
{
|
|
2323
|
-
type: "component",
|
|
2324
|
-
name: "plasmic-antd5-menu-item",
|
|
2325
|
-
props: {
|
|
2326
|
-
key: "menuItemKey2"
|
|
2327
|
-
}
|
|
2328
|
-
}
|
|
2329
|
-
]
|
|
2330
|
-
},
|
|
2331
|
-
onSelect: {
|
|
2332
|
-
type: "eventHandler",
|
|
2333
|
-
argTypes: [{ name: "key", type: "string" }]
|
|
2334
|
-
}
|
|
2335
|
-
},
|
|
2336
|
-
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
2337
|
-
importName: "AntdMenu"
|
|
2338
|
-
});
|
|
2339
|
-
registerComponentHelper(loader, AntdMenuItem, {
|
|
2340
|
-
name: "plasmic-antd5-menu-item",
|
|
2341
|
-
displayName: "Menu Item",
|
|
2342
|
-
props: {
|
|
2343
|
-
danger: {
|
|
2344
|
-
type: "boolean",
|
|
2345
|
-
description: "Display the danger style",
|
|
2346
|
-
defaultValueHint: false
|
|
2347
|
-
},
|
|
2348
|
-
disabled: {
|
|
2349
|
-
type: "boolean",
|
|
2350
|
-
description: "Whether disabled select",
|
|
2351
|
-
defaultValueHint: false
|
|
2352
|
-
},
|
|
2353
|
-
key: {
|
|
2354
|
-
type: "string",
|
|
2355
|
-
displayName: "Unique key",
|
|
2356
|
-
description: "Unique ID of the menu item. Used to determine which item is selected.",
|
|
2357
|
-
defaultValue: "menuItemKey"
|
|
2358
|
-
},
|
|
2359
|
-
title: {
|
|
2360
|
-
type: "string",
|
|
2361
|
-
description: "Set display title for collapsed item"
|
|
2470
|
+
placeholder: {
|
|
2471
|
+
type: "string"
|
|
2362
2472
|
},
|
|
2363
|
-
|
|
2364
|
-
type: "
|
|
2365
|
-
defaultValue: [
|
|
2366
|
-
{
|
|
2367
|
-
type: "text",
|
|
2368
|
-
value: "Menu item"
|
|
2369
|
-
}
|
|
2370
|
-
]
|
|
2473
|
+
disabled: {
|
|
2474
|
+
type: "boolean"
|
|
2371
2475
|
},
|
|
2372
|
-
|
|
2373
|
-
type: "
|
|
2374
|
-
|
|
2375
|
-
}
|
|
2376
|
-
},
|
|
2377
|
-
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
2378
|
-
importName: "AntdMenuItem",
|
|
2379
|
-
parentComponentName: "plasmic-antd5-menu"
|
|
2380
|
-
});
|
|
2381
|
-
registerComponentHelper(loader, AntdMenuItemGroup, {
|
|
2382
|
-
name: "plasmic-antd5-menu-item-group",
|
|
2383
|
-
displayName: "Item Group",
|
|
2384
|
-
props: {
|
|
2385
|
-
title: {
|
|
2386
|
-
type: "slot",
|
|
2387
|
-
defaultValue: [
|
|
2388
|
-
{
|
|
2389
|
-
type: "text",
|
|
2390
|
-
value: "Group"
|
|
2391
|
-
}
|
|
2392
|
-
]
|
|
2476
|
+
maxLength: {
|
|
2477
|
+
type: "number",
|
|
2478
|
+
advanced: true
|
|
2393
2479
|
},
|
|
2394
|
-
|
|
2395
|
-
type: "
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
{
|
|
2399
|
-
type: "component",
|
|
2400
|
-
name: "plasmic-antd5-menu-item"
|
|
2401
|
-
}
|
|
2402
|
-
]
|
|
2480
|
+
bordered: {
|
|
2481
|
+
type: "boolean",
|
|
2482
|
+
advanced: true,
|
|
2483
|
+
defaultValueHint: true
|
|
2403
2484
|
}
|
|
2404
|
-
},
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2485
|
+
}, COMMON_EVENT_HANDLERS),
|
|
2486
|
+
states: __spreadValues$5({}, COMMON_STATES),
|
|
2487
|
+
componentHelpers: COMMON_HELPERS_CONFIG,
|
|
2488
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerInput",
|
|
2489
|
+
importName: "AntdTextArea"
|
|
2408
2490
|
});
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2491
|
+
}
|
|
2492
|
+
function registerPasswordInput(loader) {
|
|
2493
|
+
registerComponentHelper(loader, AntdPassword, {
|
|
2494
|
+
name: "plasmic-antd5-input-password",
|
|
2495
|
+
parentComponentName: "plasmic-antd5-input",
|
|
2496
|
+
displayName: "Password Input",
|
|
2497
|
+
props: __spreadValues$5({
|
|
2498
|
+
value: {
|
|
2499
|
+
type: "string"
|
|
2500
|
+
},
|
|
2501
|
+
placeholder: {
|
|
2502
|
+
type: "string"
|
|
2503
|
+
},
|
|
2504
|
+
disabled: {
|
|
2505
|
+
type: "boolean"
|
|
2506
|
+
},
|
|
2507
|
+
maxLength: {
|
|
2508
|
+
type: "number",
|
|
2509
|
+
advanced: true
|
|
2510
|
+
},
|
|
2511
|
+
bordered: {
|
|
2414
2512
|
type: "boolean",
|
|
2415
|
-
|
|
2416
|
-
defaultValueHint:
|
|
2513
|
+
advanced: true,
|
|
2514
|
+
defaultValueHint: true
|
|
2417
2515
|
}
|
|
2418
|
-
},
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2516
|
+
}, COMMON_EVENT_HANDLERS),
|
|
2517
|
+
states: __spreadValues$5({}, COMMON_STATES),
|
|
2518
|
+
componentHelpers: COMMON_HELPERS_CONFIG,
|
|
2519
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerInput",
|
|
2520
|
+
importName: "AntdPassword"
|
|
2422
2521
|
});
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2522
|
+
}
|
|
2523
|
+
function registerNumberInput(loader) {
|
|
2524
|
+
registerComponentHelper(loader, AntdInputNumber, __spreadProps$4(__spreadValues$5({
|
|
2525
|
+
name: "plasmic-antd5-input-number",
|
|
2526
|
+
parentComponentName: "plasmic-antd5-input",
|
|
2527
|
+
displayName: "Number Input",
|
|
2528
|
+
props: __spreadProps$4(__spreadValues$5(__spreadValues$5(__spreadValues$5({
|
|
2529
|
+
value: {
|
|
2530
|
+
type: "number"
|
|
2531
|
+
},
|
|
2532
|
+
placeholder: {
|
|
2533
|
+
type: "string"
|
|
2534
|
+
},
|
|
2427
2535
|
disabled: {
|
|
2428
|
-
type: "boolean"
|
|
2429
|
-
description: "Whether sub-menu is disabled",
|
|
2430
|
-
defaultValueHint: false
|
|
2536
|
+
type: "boolean"
|
|
2431
2537
|
},
|
|
2432
|
-
|
|
2433
|
-
type: "
|
|
2434
|
-
displayName: "Unique key",
|
|
2435
|
-
description: "Unique ID of the sub-menu. Used to determine which item is selected.",
|
|
2436
|
-
advanced: true
|
|
2538
|
+
max: {
|
|
2539
|
+
type: "number"
|
|
2437
2540
|
},
|
|
2438
|
-
|
|
2439
|
-
type: "
|
|
2440
|
-
|
|
2541
|
+
min: {
|
|
2542
|
+
type: "number"
|
|
2543
|
+
},
|
|
2544
|
+
step: {
|
|
2545
|
+
type: "number",
|
|
2546
|
+
helpText: "Increment or decrement step"
|
|
2547
|
+
},
|
|
2548
|
+
controls: {
|
|
2549
|
+
type: "boolean",
|
|
2550
|
+
displayName: "Show add/minus controls?",
|
|
2551
|
+
advanced: true
|
|
2552
|
+
}
|
|
2553
|
+
}, COMMON_DECORATOR_PROPS), COMMON_ADVANCED_PROPS), COMMON_EVENT_HANDLERS), {
|
|
2554
|
+
// onChange directly called with the number
|
|
2555
|
+
onChange: {
|
|
2556
|
+
type: "eventHandler",
|
|
2557
|
+
argTypes: [
|
|
2441
2558
|
{
|
|
2442
|
-
|
|
2443
|
-
|
|
2559
|
+
name: "value",
|
|
2560
|
+
type: "number"
|
|
2444
2561
|
}
|
|
2445
2562
|
]
|
|
2446
|
-
},
|
|
2447
|
-
children: {
|
|
2448
|
-
type: "slot",
|
|
2449
|
-
allowedComponents: allowedMenuComponents,
|
|
2450
|
-
defaultValue: [1, 2].map((i) => ({
|
|
2451
|
-
type: "component",
|
|
2452
|
-
name: "plasmic-antd5-menu-item",
|
|
2453
|
-
props: {
|
|
2454
|
-
key: `subMenuItemKey${i}`,
|
|
2455
|
-
children: [
|
|
2456
|
-
{
|
|
2457
|
-
type: "text",
|
|
2458
|
-
value: `Sub-menu item ${i}`
|
|
2459
|
-
}
|
|
2460
|
-
]
|
|
2461
|
-
}
|
|
2462
|
-
}))
|
|
2463
2563
|
}
|
|
2464
|
-
},
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2564
|
+
}),
|
|
2565
|
+
states: __spreadValues$5({}, COMMON_STATES)
|
|
2566
|
+
}, { trapsSelection: true }), {
|
|
2567
|
+
// don't need component helpers
|
|
2568
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerInput",
|
|
2569
|
+
importName: "AntdInputNumber"
|
|
2570
|
+
}));
|
|
2469
2571
|
}
|
|
2470
2572
|
|
|
2471
2573
|
var __defProp$4 = Object.defineProperty;
|
|
@@ -2660,7 +2762,7 @@ const RadioGroup = Radio.Group;
|
|
|
2660
2762
|
const AntdRadio = Radio;
|
|
2661
2763
|
Radio.Button;
|
|
2662
2764
|
function AntdRadioGroup(props) {
|
|
2663
|
-
const _a = props, { onChange } = _a, rest = __objRest$3(_a, ["onChange"]);
|
|
2765
|
+
const _a = props, { onChange, useChildren } = _a, rest = __objRest$3(_a, ["onChange", "useChildren"]);
|
|
2664
2766
|
const wrappedOnChange = React.useMemo(() => {
|
|
2665
2767
|
if (onChange) {
|
|
2666
2768
|
return (event) => onChange(event.target.value);
|
|
@@ -2668,7 +2770,13 @@ function AntdRadioGroup(props) {
|
|
|
2668
2770
|
return void 0;
|
|
2669
2771
|
}
|
|
2670
2772
|
}, [onChange]);
|
|
2671
|
-
return /* @__PURE__ */ React.createElement(
|
|
2773
|
+
return /* @__PURE__ */ React.createElement(
|
|
2774
|
+
RadioGroup,
|
|
2775
|
+
__spreadProps$2(__spreadValues$3({}, rest), {
|
|
2776
|
+
onChange: wrappedOnChange,
|
|
2777
|
+
options: useChildren ? void 0 : rest.options
|
|
2778
|
+
})
|
|
2779
|
+
);
|
|
2672
2780
|
}
|
|
2673
2781
|
function registerRadio(loader) {
|
|
2674
2782
|
registerComponentHelper(loader, AntdRadio, {
|
|
@@ -2689,7 +2797,7 @@ function registerRadio(loader) {
|
|
|
2689
2797
|
defaultValueHint: false,
|
|
2690
2798
|
advanced: true
|
|
2691
2799
|
},
|
|
2692
|
-
children: {
|
|
2800
|
+
children: __spreadValues$3({
|
|
2693
2801
|
type: "slot",
|
|
2694
2802
|
defaultValue: [
|
|
2695
2803
|
{
|
|
@@ -2697,7 +2805,7 @@ function registerRadio(loader) {
|
|
|
2697
2805
|
value: "Radio"
|
|
2698
2806
|
}
|
|
2699
2807
|
]
|
|
2700
|
-
}
|
|
2808
|
+
}, { mergeWithParent: true })
|
|
2701
2809
|
},
|
|
2702
2810
|
importPath: "@plasmicpkgs/antd5/skinny/registerRadio",
|
|
2703
2811
|
importName: "AntdRadio",
|
|
@@ -2721,7 +2829,7 @@ function registerRadio(loader) {
|
|
|
2721
2829
|
defaultValueHint: false,
|
|
2722
2830
|
advanced: true
|
|
2723
2831
|
},
|
|
2724
|
-
children: {
|
|
2832
|
+
children: __spreadValues$3({
|
|
2725
2833
|
type: "slot",
|
|
2726
2834
|
defaultValue: [
|
|
2727
2835
|
{
|
|
@@ -2729,30 +2837,66 @@ function registerRadio(loader) {
|
|
|
2729
2837
|
value: "Radio"
|
|
2730
2838
|
}
|
|
2731
2839
|
]
|
|
2732
|
-
}
|
|
2840
|
+
}, { mergeWithParent: true })
|
|
2733
2841
|
},
|
|
2734
2842
|
importPath: "@plasmicpkgs/antd5/skinny/registerRadio",
|
|
2735
2843
|
importName: "AntdRadioButton",
|
|
2736
2844
|
parentComponentName: "plasmic-antd5-radio-group"
|
|
2737
2845
|
});
|
|
2738
|
-
registerComponentHelper(loader, AntdRadioGroup, {
|
|
2846
|
+
registerComponentHelper(loader, AntdRadioGroup, __spreadValues$3({
|
|
2739
2847
|
name: "plasmic-antd5-radio-group",
|
|
2740
2848
|
displayName: "Radio Group",
|
|
2741
2849
|
props: {
|
|
2850
|
+
options: {
|
|
2851
|
+
type: "array",
|
|
2852
|
+
hidden: (ps) => !!ps.useChildren,
|
|
2853
|
+
itemType: {
|
|
2854
|
+
type: "object",
|
|
2855
|
+
nameFunc: (item) => item.label || item.value,
|
|
2856
|
+
fields: {
|
|
2857
|
+
value: "string",
|
|
2858
|
+
label: "string"
|
|
2859
|
+
}
|
|
2860
|
+
},
|
|
2861
|
+
defaultValue: [
|
|
2862
|
+
{
|
|
2863
|
+
value: "option1",
|
|
2864
|
+
label: "Option 1"
|
|
2865
|
+
},
|
|
2866
|
+
{
|
|
2867
|
+
value: "option2",
|
|
2868
|
+
label: "Option 2"
|
|
2869
|
+
}
|
|
2870
|
+
]
|
|
2871
|
+
},
|
|
2872
|
+
optionType: {
|
|
2873
|
+
type: "choice",
|
|
2874
|
+
options: [
|
|
2875
|
+
{ value: "default", label: "Radio" },
|
|
2876
|
+
{ value: "button", label: "Button" }
|
|
2877
|
+
],
|
|
2878
|
+
hidden: (ps) => !!ps.useChildren,
|
|
2879
|
+
defaultValueHint: "default"
|
|
2880
|
+
},
|
|
2742
2881
|
value: {
|
|
2743
2882
|
type: "choice",
|
|
2744
2883
|
editOnly: true,
|
|
2745
2884
|
uncontrolledProp: "defaultValue",
|
|
2746
2885
|
description: "Default selected value",
|
|
2747
2886
|
options: (ps) => {
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2887
|
+
var _a;
|
|
2888
|
+
if (ps.useChildren) {
|
|
2889
|
+
const options = /* @__PURE__ */ new Set();
|
|
2890
|
+
traverseReactEltTree(ps.children, (elt) => {
|
|
2891
|
+
var _a2;
|
|
2892
|
+
if (typeof ((_a2 = elt == null ? void 0 : elt.props) == null ? void 0 : _a2.value) === "string") {
|
|
2893
|
+
options.add(elt.props.value);
|
|
2894
|
+
}
|
|
2895
|
+
});
|
|
2896
|
+
return Array.from(options.keys());
|
|
2897
|
+
} else {
|
|
2898
|
+
return (_a = ps.options) != null ? _a : [];
|
|
2899
|
+
}
|
|
2756
2900
|
}
|
|
2757
2901
|
},
|
|
2758
2902
|
disabled: {
|
|
@@ -2760,6 +2904,13 @@ function registerRadio(loader) {
|
|
|
2760
2904
|
description: "Disables all radios",
|
|
2761
2905
|
defaultValueHint: false
|
|
2762
2906
|
},
|
|
2907
|
+
useChildren: {
|
|
2908
|
+
displayName: "Use slot",
|
|
2909
|
+
type: "boolean",
|
|
2910
|
+
defaultValueHint: false,
|
|
2911
|
+
advanced: true,
|
|
2912
|
+
description: "Instead of configuring a list of options, customize the contents of the RadioGroup by dragging and dropping Radio in the outline/canvas, inside the 'children' slot. Lets you use any content or formatting within the Radio and RadioButton."
|
|
2913
|
+
},
|
|
2763
2914
|
children: {
|
|
2764
2915
|
type: "slot",
|
|
2765
2916
|
allowedComponents: [
|
|
@@ -2805,8 +2956,13 @@ function registerRadio(loader) {
|
|
|
2805
2956
|
}
|
|
2806
2957
|
},
|
|
2807
2958
|
importPath: "@plasmicpkgs/antd5/skinny/registerRadio",
|
|
2808
|
-
importName: "AntdRadioGroup"
|
|
2809
|
-
|
|
2959
|
+
importName: "AntdRadioGroup",
|
|
2960
|
+
defaultStyles: {
|
|
2961
|
+
layout: "hbox"
|
|
2962
|
+
}
|
|
2963
|
+
}, {
|
|
2964
|
+
trapsSelection: true
|
|
2965
|
+
}));
|
|
2810
2966
|
}
|
|
2811
2967
|
|
|
2812
2968
|
var __defProp$2 = Object.defineProperty;
|
|
@@ -2871,7 +3027,7 @@ function AntdSelect(props) {
|
|
|
2871
3027
|
);
|
|
2872
3028
|
}
|
|
2873
3029
|
function registerSelect(loader) {
|
|
2874
|
-
registerComponentHelper(loader, AntdSelect, {
|
|
3030
|
+
registerComponentHelper(loader, AntdSelect, __spreadProps$1(__spreadValues$2({
|
|
2875
3031
|
name: "plasmic-antd5-select",
|
|
2876
3032
|
displayName: "Select",
|
|
2877
3033
|
props: {
|
|
@@ -2880,10 +3036,35 @@ function registerSelect(loader) {
|
|
|
2880
3036
|
hidden: (ps) => !!ps.useChildren,
|
|
2881
3037
|
itemType: {
|
|
2882
3038
|
type: "object",
|
|
2883
|
-
nameFunc: (item) => item.label,
|
|
3039
|
+
nameFunc: (item) => item.label || item.value,
|
|
2884
3040
|
fields: {
|
|
2885
|
-
|
|
2886
|
-
|
|
3041
|
+
type: {
|
|
3042
|
+
type: "choice",
|
|
3043
|
+
options: [
|
|
3044
|
+
{ value: "option", label: "Option" },
|
|
3045
|
+
{ value: "option-group", label: "Option Group" }
|
|
3046
|
+
],
|
|
3047
|
+
defaultValue: "option"
|
|
3048
|
+
},
|
|
3049
|
+
value: {
|
|
3050
|
+
type: "string",
|
|
3051
|
+
hidden: (ps) => ps.type !== "option"
|
|
3052
|
+
},
|
|
3053
|
+
label: "string",
|
|
3054
|
+
options: {
|
|
3055
|
+
type: "array",
|
|
3056
|
+
hidden: (ps) => {
|
|
3057
|
+
return ps.type !== "option-group";
|
|
3058
|
+
},
|
|
3059
|
+
itemType: {
|
|
3060
|
+
type: "object",
|
|
3061
|
+
nameFunc: (item) => item.label || item.value,
|
|
3062
|
+
fields: {
|
|
3063
|
+
value: "string",
|
|
3064
|
+
label: "string"
|
|
3065
|
+
}
|
|
3066
|
+
}
|
|
3067
|
+
}
|
|
2887
3068
|
}
|
|
2888
3069
|
},
|
|
2889
3070
|
defaultValue: [
|
|
@@ -2901,6 +3082,7 @@ function registerSelect(loader) {
|
|
|
2901
3082
|
displayName: "Use slot",
|
|
2902
3083
|
type: "boolean",
|
|
2903
3084
|
defaultValueHint: false,
|
|
3085
|
+
advanced: true,
|
|
2904
3086
|
description: "Instead of configuring a list of options, customize the contents of the Select by dragging and dropping options in the outline/canvas, inside the 'children' slot. Lets you use any content or formatting within the Options, and also use Option Groups."
|
|
2905
3087
|
},
|
|
2906
3088
|
children: {
|
|
@@ -2935,13 +3117,17 @@ function registerSelect(loader) {
|
|
|
2935
3117
|
var _a;
|
|
2936
3118
|
const options = /* @__PURE__ */ new Set();
|
|
2937
3119
|
if (!ps.useChildren) {
|
|
2938
|
-
|
|
3120
|
+
const rec = (op) => {
|
|
2939
3121
|
var _a2;
|
|
2940
|
-
|
|
2941
|
-
value:
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
3122
|
+
if (typeof op === "string") {
|
|
3123
|
+
return [{ value: op, label: op }];
|
|
3124
|
+
} else if ("options" in op) {
|
|
3125
|
+
return ((_a2 = op.options) != null ? _a2 : []).flatMap((sub) => rec(sub));
|
|
3126
|
+
} else {
|
|
3127
|
+
return [{ value: op.value, label: op.label || op.value }];
|
|
3128
|
+
}
|
|
3129
|
+
};
|
|
3130
|
+
return ((_a = ps.options) != null ? _a : []).flatMap((o) => rec(o));
|
|
2945
3131
|
} else {
|
|
2946
3132
|
traverseReactEltTree(ps.children, (elt) => {
|
|
2947
3133
|
var _a2;
|
|
@@ -3058,11 +3244,6 @@ function registerSelect(loader) {
|
|
|
3058
3244
|
},
|
|
3059
3245
|
defaultStylesClassName: {
|
|
3060
3246
|
type: "themeResetClass"
|
|
3061
|
-
},
|
|
3062
|
-
tagRender: {
|
|
3063
|
-
type: "slot",
|
|
3064
|
-
renderPropParams: ["tagProps"],
|
|
3065
|
-
hidePlaceholder: true
|
|
3066
3247
|
}
|
|
3067
3248
|
},
|
|
3068
3249
|
states: {
|
|
@@ -3072,19 +3253,20 @@ function registerSelect(loader) {
|
|
|
3072
3253
|
onChangeProp: "onChange",
|
|
3073
3254
|
variableType: "text"
|
|
3074
3255
|
}
|
|
3075
|
-
}
|
|
3256
|
+
}
|
|
3257
|
+
}, { trapsSelection: true }), {
|
|
3076
3258
|
importPath: "@plasmicpkgs/antd5/skinny/registerSelect",
|
|
3077
3259
|
importName: "AntdSelect"
|
|
3078
|
-
});
|
|
3260
|
+
}));
|
|
3079
3261
|
registerComponentHelper(loader, AntdOption, {
|
|
3080
3262
|
name: "plasmic-antd5-option",
|
|
3081
3263
|
displayName: "Option",
|
|
3082
3264
|
parentComponentName: "plasmic-antd5-select",
|
|
3083
3265
|
props: {
|
|
3084
|
-
children: {
|
|
3266
|
+
children: __spreadValues$2({
|
|
3085
3267
|
type: "slot",
|
|
3086
3268
|
defaultValue: "Option"
|
|
3087
|
-
},
|
|
3269
|
+
}, { mergeWithParent: true }),
|
|
3088
3270
|
value: {
|
|
3089
3271
|
type: "string"
|
|
3090
3272
|
}
|
|
@@ -3500,7 +3682,7 @@ function UploadWrapper(props) {
|
|
|
3500
3682
|
);
|
|
3501
3683
|
}
|
|
3502
3684
|
function registerUpload(loader) {
|
|
3503
|
-
registerComponentHelper(loader, UploadWrapper, {
|
|
3685
|
+
registerComponentHelper(loader, UploadWrapper, __spreadProps(__spreadValues({
|
|
3504
3686
|
name: "plasmic-antd5-upload",
|
|
3505
3687
|
displayName: "Upload",
|
|
3506
3688
|
props: {
|
|
@@ -3579,10 +3761,11 @@ function registerUpload(loader) {
|
|
|
3579
3761
|
variableType: "array",
|
|
3580
3762
|
onChangeProp: "onFilesChange"
|
|
3581
3763
|
}
|
|
3582
|
-
}
|
|
3764
|
+
}
|
|
3765
|
+
}, { trapsSelection: true }), {
|
|
3583
3766
|
importPath: "@plasmicpkgs/antd5/skinny/registerUpload",
|
|
3584
3767
|
importName: "UploadWrapper"
|
|
3585
|
-
});
|
|
3768
|
+
}));
|
|
3586
3769
|
}
|
|
3587
3770
|
|
|
3588
3771
|
function registerAll(loader) {
|