@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/index.js
CHANGED
|
@@ -74,21 +74,21 @@ function usePrevious(value) {
|
|
|
74
74
|
return prevValue.current;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
var __defProp$
|
|
77
|
+
var __defProp$c = Object.defineProperty;
|
|
78
78
|
var __defProps$9 = Object.defineProperties;
|
|
79
79
|
var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
|
|
80
|
-
var __getOwnPropSymbols$
|
|
81
|
-
var __hasOwnProp$
|
|
82
|
-
var __propIsEnum$
|
|
83
|
-
var __defNormalProp$
|
|
84
|
-
var __spreadValues$
|
|
80
|
+
var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
|
|
81
|
+
var __hasOwnProp$c = Object.prototype.hasOwnProperty;
|
|
82
|
+
var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
|
|
83
|
+
var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
84
|
+
var __spreadValues$c = (a, b) => {
|
|
85
85
|
for (var prop in b || (b = {}))
|
|
86
|
-
if (__hasOwnProp$
|
|
87
|
-
__defNormalProp$
|
|
88
|
-
if (__getOwnPropSymbols$
|
|
89
|
-
for (var prop of __getOwnPropSymbols$
|
|
90
|
-
if (__propIsEnum$
|
|
91
|
-
__defNormalProp$
|
|
86
|
+
if (__hasOwnProp$c.call(b, prop))
|
|
87
|
+
__defNormalProp$c(a, prop, b[prop]);
|
|
88
|
+
if (__getOwnPropSymbols$c)
|
|
89
|
+
for (var prop of __getOwnPropSymbols$c(b)) {
|
|
90
|
+
if (__propIsEnum$c.call(b, prop))
|
|
91
|
+
__defNormalProp$c(a, prop, b[prop]);
|
|
92
92
|
}
|
|
93
93
|
return a;
|
|
94
94
|
};
|
|
@@ -96,11 +96,11 @@ var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
|
|
|
96
96
|
var __objRest$9 = (source, exclude) => {
|
|
97
97
|
var target = {};
|
|
98
98
|
for (var prop in source)
|
|
99
|
-
if (__hasOwnProp$
|
|
99
|
+
if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
100
100
|
target[prop] = source[prop];
|
|
101
|
-
if (source != null && __getOwnPropSymbols$
|
|
102
|
-
for (var prop of __getOwnPropSymbols$
|
|
103
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
101
|
+
if (source != null && __getOwnPropSymbols$c)
|
|
102
|
+
for (var prop of __getOwnPropSymbols$c(source)) {
|
|
103
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
|
|
104
104
|
target[prop] = source[prop];
|
|
105
105
|
}
|
|
106
106
|
return target;
|
|
@@ -110,7 +110,7 @@ function AntdButton(props) {
|
|
|
110
110
|
const target = props.target === true ? "_blank" : props.target === false ? void 0 : props.target;
|
|
111
111
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
112
112
|
antd.Button,
|
|
113
|
-
__spreadProps$9(__spreadValues$
|
|
113
|
+
__spreadProps$9(__spreadValues$c(__spreadProps$9(__spreadValues$c({}, rest), {
|
|
114
114
|
htmlType: submitsForm ? "submit" : "button"
|
|
115
115
|
}), rest), {
|
|
116
116
|
target
|
|
@@ -180,7 +180,7 @@ function registerButton(loader) {
|
|
|
180
180
|
hidden: (props) => !props.href,
|
|
181
181
|
defaultValueHint: false
|
|
182
182
|
},
|
|
183
|
-
children: {
|
|
183
|
+
children: __spreadValues$c({
|
|
184
184
|
type: "slot",
|
|
185
185
|
defaultValue: [
|
|
186
186
|
{
|
|
@@ -188,7 +188,7 @@ function registerButton(loader) {
|
|
|
188
188
|
value: "Button"
|
|
189
189
|
}
|
|
190
190
|
]
|
|
191
|
-
},
|
|
191
|
+
}, { mergeWithParent: true }),
|
|
192
192
|
icon: {
|
|
193
193
|
type: "slot",
|
|
194
194
|
hidePlaceholder: true,
|
|
@@ -204,21 +204,21 @@ function registerButton(loader) {
|
|
|
204
204
|
});
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
var __defProp$
|
|
207
|
+
var __defProp$b = Object.defineProperty;
|
|
208
208
|
var __defProps$8 = Object.defineProperties;
|
|
209
209
|
var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
|
|
210
|
-
var __getOwnPropSymbols$
|
|
211
|
-
var __hasOwnProp$
|
|
212
|
-
var __propIsEnum$
|
|
213
|
-
var __defNormalProp$
|
|
214
|
-
var __spreadValues$
|
|
210
|
+
var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
|
|
211
|
+
var __hasOwnProp$b = Object.prototype.hasOwnProperty;
|
|
212
|
+
var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
|
|
213
|
+
var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
214
|
+
var __spreadValues$b = (a, b) => {
|
|
215
215
|
for (var prop in b || (b = {}))
|
|
216
|
-
if (__hasOwnProp$
|
|
217
|
-
__defNormalProp$
|
|
218
|
-
if (__getOwnPropSymbols$
|
|
219
|
-
for (var prop of __getOwnPropSymbols$
|
|
220
|
-
if (__propIsEnum$
|
|
221
|
-
__defNormalProp$
|
|
216
|
+
if (__hasOwnProp$b.call(b, prop))
|
|
217
|
+
__defNormalProp$b(a, prop, b[prop]);
|
|
218
|
+
if (__getOwnPropSymbols$b)
|
|
219
|
+
for (var prop of __getOwnPropSymbols$b(b)) {
|
|
220
|
+
if (__propIsEnum$b.call(b, prop))
|
|
221
|
+
__defNormalProp$b(a, prop, b[prop]);
|
|
222
222
|
}
|
|
223
223
|
return a;
|
|
224
224
|
};
|
|
@@ -226,11 +226,11 @@ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
|
|
|
226
226
|
var __objRest$8 = (source, exclude) => {
|
|
227
227
|
var target = {};
|
|
228
228
|
for (var prop in source)
|
|
229
|
-
if (__hasOwnProp$
|
|
229
|
+
if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
230
230
|
target[prop] = source[prop];
|
|
231
|
-
if (source != null && __getOwnPropSymbols$
|
|
232
|
-
for (var prop of __getOwnPropSymbols$
|
|
233
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
231
|
+
if (source != null && __getOwnPropSymbols$b)
|
|
232
|
+
for (var prop of __getOwnPropSymbols$b(source)) {
|
|
233
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
|
|
234
234
|
target[prop] = source[prop];
|
|
235
235
|
}
|
|
236
236
|
return target;
|
|
@@ -244,7 +244,7 @@ function AntdCheckbox(props) {
|
|
|
244
244
|
return void 0;
|
|
245
245
|
}
|
|
246
246
|
}, [onChange]);
|
|
247
|
-
return /* @__PURE__ */ React__default.default.createElement(antd.Checkbox, __spreadProps$8(__spreadValues$
|
|
247
|
+
return /* @__PURE__ */ React__default.default.createElement(antd.Checkbox, __spreadProps$8(__spreadValues$b({}, rest), { onChange: wrappedOnChange }));
|
|
248
248
|
}
|
|
249
249
|
const AntdCheckboxGroup = antd.Checkbox.Group;
|
|
250
250
|
function registerCheckbox(loader) {
|
|
@@ -280,7 +280,7 @@ function registerCheckbox(loader) {
|
|
|
280
280
|
defaultValueHint: false,
|
|
281
281
|
advanced: true
|
|
282
282
|
},
|
|
283
|
-
children: {
|
|
283
|
+
children: __spreadValues$b({
|
|
284
284
|
type: "slot",
|
|
285
285
|
defaultValue: [
|
|
286
286
|
{
|
|
@@ -288,7 +288,7 @@ function registerCheckbox(loader) {
|
|
|
288
288
|
value: "Checkbox"
|
|
289
289
|
}
|
|
290
290
|
]
|
|
291
|
-
},
|
|
291
|
+
}, { mergeWithParent: true }),
|
|
292
292
|
onChange: {
|
|
293
293
|
type: "eventHandler",
|
|
294
294
|
argTypes: [{ name: "checked", type: "boolean" }]
|
|
@@ -361,21 +361,21 @@ function registerCheckbox(loader) {
|
|
|
361
361
|
});
|
|
362
362
|
}
|
|
363
363
|
|
|
364
|
-
var __defProp$
|
|
364
|
+
var __defProp$a = Object.defineProperty;
|
|
365
365
|
var __defProps$7 = Object.defineProperties;
|
|
366
366
|
var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
|
|
367
|
-
var __getOwnPropSymbols$
|
|
368
|
-
var __hasOwnProp$
|
|
369
|
-
var __propIsEnum$
|
|
370
|
-
var __defNormalProp$
|
|
371
|
-
var __spreadValues$
|
|
367
|
+
var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
|
|
368
|
+
var __hasOwnProp$a = Object.prototype.hasOwnProperty;
|
|
369
|
+
var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
|
|
370
|
+
var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
371
|
+
var __spreadValues$a = (a, b) => {
|
|
372
372
|
for (var prop in b || (b = {}))
|
|
373
|
-
if (__hasOwnProp$
|
|
374
|
-
__defNormalProp$
|
|
375
|
-
if (__getOwnPropSymbols$
|
|
376
|
-
for (var prop of __getOwnPropSymbols$
|
|
377
|
-
if (__propIsEnum$
|
|
378
|
-
__defNormalProp$
|
|
373
|
+
if (__hasOwnProp$a.call(b, prop))
|
|
374
|
+
__defNormalProp$a(a, prop, b[prop]);
|
|
375
|
+
if (__getOwnPropSymbols$a)
|
|
376
|
+
for (var prop of __getOwnPropSymbols$a(b)) {
|
|
377
|
+
if (__propIsEnum$a.call(b, prop))
|
|
378
|
+
__defNormalProp$a(a, prop, b[prop]);
|
|
379
379
|
}
|
|
380
380
|
return a;
|
|
381
381
|
};
|
|
@@ -383,11 +383,11 @@ var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
|
|
|
383
383
|
var __objRest$7 = (source, exclude) => {
|
|
384
384
|
var target = {};
|
|
385
385
|
for (var prop in source)
|
|
386
|
-
if (__hasOwnProp$
|
|
386
|
+
if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
387
387
|
target[prop] = source[prop];
|
|
388
|
-
if (source != null && __getOwnPropSymbols$
|
|
389
|
-
for (var prop of __getOwnPropSymbols$
|
|
390
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
388
|
+
if (source != null && __getOwnPropSymbols$a)
|
|
389
|
+
for (var prop of __getOwnPropSymbols$a(source)) {
|
|
390
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
|
|
391
391
|
target[prop] = source[prop];
|
|
392
392
|
}
|
|
393
393
|
return target;
|
|
@@ -438,9 +438,9 @@ function AntdConfigProvider(props) {
|
|
|
438
438
|
const _a = props, { children, themeStyles } = _a, rest = __objRest$7(_a, ["children", "themeStyles"]);
|
|
439
439
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
440
440
|
antd.ConfigProvider,
|
|
441
|
-
__spreadValues$
|
|
441
|
+
__spreadValues$a({
|
|
442
442
|
locale: defaultLocale
|
|
443
|
-
}, themeToAntdConfig(__spreadProps$7(__spreadValues$
|
|
443
|
+
}, themeToAntdConfig(__spreadProps$7(__spreadValues$a({}, rest), {
|
|
444
444
|
fontFamily: themeStyles.fontFamily,
|
|
445
445
|
fontSize: themeStyles.fontSize ? parseInt(themeStyles.fontSize) : void 0,
|
|
446
446
|
lineHeight: themeStyles.lineHeight ? parseInt(themeStyles.lineHeight) : void 0,
|
|
@@ -476,7 +476,7 @@ function InnerConfigProvider(props) {
|
|
|
476
476
|
showNotification: (opts) => {
|
|
477
477
|
var _b;
|
|
478
478
|
const _a = opts, rest = __objRest$7(_a, ["type"]);
|
|
479
|
-
app.notification[(_b = opts.type) != null ? _b : "info"](__spreadValues$
|
|
479
|
+
app.notification[(_b = opts.type) != null ? _b : "info"](__spreadValues$a({}, rest));
|
|
480
480
|
},
|
|
481
481
|
hideNotifications: () => {
|
|
482
482
|
app.notification.destroy();
|
|
@@ -773,7 +773,7 @@ function registerTokens(loader) {
|
|
|
773
773
|
}
|
|
774
774
|
const registerConfigProvider = makeRegisterGlobalContext(
|
|
775
775
|
AntdConfigProvider,
|
|
776
|
-
__spreadProps$7(__spreadValues$
|
|
776
|
+
__spreadProps$7(__spreadValues$a({
|
|
777
777
|
name: "plasmic-antd5-config-provider",
|
|
778
778
|
displayName: "Ant Design System Settings",
|
|
779
779
|
props: {
|
|
@@ -875,6 +875,258 @@ const registerConfigProvider = makeRegisterGlobalContext(
|
|
|
875
875
|
})
|
|
876
876
|
);
|
|
877
877
|
|
|
878
|
+
var __defProp$9 = Object.defineProperty;
|
|
879
|
+
var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
|
|
880
|
+
var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
|
|
881
|
+
var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
|
|
882
|
+
var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
883
|
+
var __spreadValues$9 = (a, b) => {
|
|
884
|
+
for (var prop in b || (b = {}))
|
|
885
|
+
if (__hasOwnProp$9.call(b, prop))
|
|
886
|
+
__defNormalProp$9(a, prop, b[prop]);
|
|
887
|
+
if (__getOwnPropSymbols$9)
|
|
888
|
+
for (var prop of __getOwnPropSymbols$9(b)) {
|
|
889
|
+
if (__propIsEnum$9.call(b, prop))
|
|
890
|
+
__defNormalProp$9(a, prop, b[prop]);
|
|
891
|
+
}
|
|
892
|
+
return a;
|
|
893
|
+
};
|
|
894
|
+
const AntdMenu = antd.Menu;
|
|
895
|
+
const AntdMenuDivider = antd.Menu.Divider;
|
|
896
|
+
const AntdMenuItem = antd.Menu.Item;
|
|
897
|
+
const AntdMenuItemGroup = antd.Menu.ItemGroup;
|
|
898
|
+
const AntdSubMenu = antd.Menu.SubMenu;
|
|
899
|
+
const allowedMenuComponents = [
|
|
900
|
+
"plasmic-antd5-menu-item",
|
|
901
|
+
"plasmic-antd5-menu-divider",
|
|
902
|
+
"plasmic-antd5-submenu",
|
|
903
|
+
"plasmic-antd5-menu-item-group"
|
|
904
|
+
];
|
|
905
|
+
const MENU_ITEM_TYPE = {
|
|
906
|
+
type: "object",
|
|
907
|
+
nameFunc: (item) => {
|
|
908
|
+
if (item.type === "divider") {
|
|
909
|
+
return "Divider";
|
|
910
|
+
}
|
|
911
|
+
return item.label || item.value;
|
|
912
|
+
},
|
|
913
|
+
fields: {
|
|
914
|
+
type: {
|
|
915
|
+
type: "choice",
|
|
916
|
+
options: [
|
|
917
|
+
{ value: "item", label: "Menu item" },
|
|
918
|
+
{ value: "group", label: "Menu item group" },
|
|
919
|
+
{ value: "submenu", label: "Sub-menu" },
|
|
920
|
+
{ value: "divider", label: "Menu divider" }
|
|
921
|
+
],
|
|
922
|
+
defaultValue: "item"
|
|
923
|
+
},
|
|
924
|
+
key: {
|
|
925
|
+
type: "string",
|
|
926
|
+
displayName: "Menu item key",
|
|
927
|
+
description: "Key of the menu item; the onClick will receive this as the value to indicate which item was clicked.",
|
|
928
|
+
hidden: (ps) => ps.type !== "item"
|
|
929
|
+
},
|
|
930
|
+
label: {
|
|
931
|
+
type: "string",
|
|
932
|
+
description: "Label of the menu item; will use the key if not specified.",
|
|
933
|
+
hidden: (ps) => ps.type === "divider"
|
|
934
|
+
},
|
|
935
|
+
children: {
|
|
936
|
+
type: "array",
|
|
937
|
+
displayName: "Menu items",
|
|
938
|
+
hidden: (ps) => ps.type !== "submenu" && ps.type !== "group"
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
};
|
|
942
|
+
MENU_ITEM_TYPE.fields.children.itemType = MENU_ITEM_TYPE;
|
|
943
|
+
function registerMenu(loader) {
|
|
944
|
+
registerComponentHelper(loader, AntdMenu, {
|
|
945
|
+
name: "plasmic-antd5-menu",
|
|
946
|
+
displayName: "Menu",
|
|
947
|
+
props: {
|
|
948
|
+
expandIcon: {
|
|
949
|
+
type: "slot",
|
|
950
|
+
hidePlaceholder: true
|
|
951
|
+
},
|
|
952
|
+
mode: {
|
|
953
|
+
type: "choice",
|
|
954
|
+
options: ["horizontal", "vertical", "inline"],
|
|
955
|
+
description: "Type of menu",
|
|
956
|
+
defaultValueHint: "vertical"
|
|
957
|
+
},
|
|
958
|
+
multiple: {
|
|
959
|
+
type: "boolean",
|
|
960
|
+
description: "Allows selection of multiple items",
|
|
961
|
+
defaultValueHint: false
|
|
962
|
+
},
|
|
963
|
+
triggerSubMenuAction: {
|
|
964
|
+
type: "choice",
|
|
965
|
+
options: ["hover", "click"],
|
|
966
|
+
description: "Which action can trigger submenu open/close",
|
|
967
|
+
defaultValueHint: "hover",
|
|
968
|
+
advanced: true
|
|
969
|
+
},
|
|
970
|
+
children: {
|
|
971
|
+
type: "slot",
|
|
972
|
+
allowedComponents: allowedMenuComponents,
|
|
973
|
+
defaultValue: [
|
|
974
|
+
{
|
|
975
|
+
type: "component",
|
|
976
|
+
name: "plasmic-antd5-menu-item",
|
|
977
|
+
props: {
|
|
978
|
+
key: "menuItemKey1"
|
|
979
|
+
}
|
|
980
|
+
},
|
|
981
|
+
{
|
|
982
|
+
type: "component",
|
|
983
|
+
name: "plasmic-antd5-menu-item",
|
|
984
|
+
props: {
|
|
985
|
+
key: "menuItemKey2"
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
]
|
|
989
|
+
},
|
|
990
|
+
onSelect: {
|
|
991
|
+
type: "eventHandler",
|
|
992
|
+
argTypes: [{ name: "key", type: "string" }]
|
|
993
|
+
}
|
|
994
|
+
},
|
|
995
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
996
|
+
importName: "AntdMenu"
|
|
997
|
+
});
|
|
998
|
+
registerComponentHelper(loader, AntdMenuItem, {
|
|
999
|
+
name: "plasmic-antd5-menu-item",
|
|
1000
|
+
displayName: "Menu Item",
|
|
1001
|
+
props: {
|
|
1002
|
+
danger: {
|
|
1003
|
+
type: "boolean",
|
|
1004
|
+
description: "Display the danger style",
|
|
1005
|
+
defaultValueHint: false
|
|
1006
|
+
},
|
|
1007
|
+
disabled: {
|
|
1008
|
+
type: "boolean",
|
|
1009
|
+
description: "Whether disabled select",
|
|
1010
|
+
defaultValueHint: false
|
|
1011
|
+
},
|
|
1012
|
+
key: {
|
|
1013
|
+
type: "string",
|
|
1014
|
+
displayName: "Unique key",
|
|
1015
|
+
description: "Unique ID of the menu item. Used to determine which item is selected.",
|
|
1016
|
+
defaultValue: "menuItemKey"
|
|
1017
|
+
},
|
|
1018
|
+
title: {
|
|
1019
|
+
type: "string",
|
|
1020
|
+
description: "Set display title for collapsed item"
|
|
1021
|
+
},
|
|
1022
|
+
children: __spreadValues$9({
|
|
1023
|
+
type: "slot",
|
|
1024
|
+
defaultValue: [
|
|
1025
|
+
{
|
|
1026
|
+
type: "text",
|
|
1027
|
+
value: "Menu item"
|
|
1028
|
+
}
|
|
1029
|
+
]
|
|
1030
|
+
}, { mergeWithParent: true }),
|
|
1031
|
+
onClick: {
|
|
1032
|
+
type: "eventHandler",
|
|
1033
|
+
argTypes: []
|
|
1034
|
+
}
|
|
1035
|
+
},
|
|
1036
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
1037
|
+
importName: "AntdMenuItem",
|
|
1038
|
+
parentComponentName: "plasmic-antd5-menu"
|
|
1039
|
+
});
|
|
1040
|
+
registerComponentHelper(loader, AntdMenuItemGroup, {
|
|
1041
|
+
name: "plasmic-antd5-menu-item-group",
|
|
1042
|
+
displayName: "Item Group",
|
|
1043
|
+
props: {
|
|
1044
|
+
title: {
|
|
1045
|
+
type: "slot",
|
|
1046
|
+
defaultValue: [
|
|
1047
|
+
{
|
|
1048
|
+
type: "text",
|
|
1049
|
+
value: "Group"
|
|
1050
|
+
}
|
|
1051
|
+
]
|
|
1052
|
+
},
|
|
1053
|
+
children: {
|
|
1054
|
+
type: "slot",
|
|
1055
|
+
allowedComponents: allowedMenuComponents,
|
|
1056
|
+
defaultValue: [
|
|
1057
|
+
{
|
|
1058
|
+
type: "component",
|
|
1059
|
+
name: "plasmic-antd5-menu-item"
|
|
1060
|
+
}
|
|
1061
|
+
]
|
|
1062
|
+
}
|
|
1063
|
+
},
|
|
1064
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
1065
|
+
importName: "AntdMenuItemGroup",
|
|
1066
|
+
parentComponentName: "plasmic-antd5-menu"
|
|
1067
|
+
});
|
|
1068
|
+
registerComponentHelper(loader, AntdMenuDivider, {
|
|
1069
|
+
name: "plasmic-antd5-menu-divider",
|
|
1070
|
+
displayName: "Menu Divider",
|
|
1071
|
+
props: {
|
|
1072
|
+
dashed: {
|
|
1073
|
+
type: "boolean",
|
|
1074
|
+
description: "Whether line is dashed",
|
|
1075
|
+
defaultValueHint: false
|
|
1076
|
+
}
|
|
1077
|
+
},
|
|
1078
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
1079
|
+
importName: "AntdMenuDivider",
|
|
1080
|
+
parentComponentName: "plasmic-antd5-menu"
|
|
1081
|
+
});
|
|
1082
|
+
registerComponentHelper(loader, AntdSubMenu, {
|
|
1083
|
+
name: "plasmic-antd5-submenu",
|
|
1084
|
+
displayName: "Sub Menu",
|
|
1085
|
+
props: {
|
|
1086
|
+
disabled: {
|
|
1087
|
+
type: "boolean",
|
|
1088
|
+
description: "Whether sub-menu is disabled",
|
|
1089
|
+
defaultValueHint: false
|
|
1090
|
+
},
|
|
1091
|
+
key: {
|
|
1092
|
+
type: "string",
|
|
1093
|
+
displayName: "Unique key",
|
|
1094
|
+
description: "Unique ID of the sub-menu. Used to determine which item is selected.",
|
|
1095
|
+
advanced: true
|
|
1096
|
+
},
|
|
1097
|
+
title: {
|
|
1098
|
+
type: "slot",
|
|
1099
|
+
defaultValue: [
|
|
1100
|
+
{
|
|
1101
|
+
type: "text",
|
|
1102
|
+
value: "Sub-menu"
|
|
1103
|
+
}
|
|
1104
|
+
]
|
|
1105
|
+
},
|
|
1106
|
+
children: {
|
|
1107
|
+
type: "slot",
|
|
1108
|
+
allowedComponents: allowedMenuComponents,
|
|
1109
|
+
defaultValue: [1, 2].map((i) => ({
|
|
1110
|
+
type: "component",
|
|
1111
|
+
name: "plasmic-antd5-menu-item",
|
|
1112
|
+
props: {
|
|
1113
|
+
key: `subMenuItemKey${i}`,
|
|
1114
|
+
children: [
|
|
1115
|
+
{
|
|
1116
|
+
type: "text",
|
|
1117
|
+
value: `Sub-menu item ${i}`
|
|
1118
|
+
}
|
|
1119
|
+
]
|
|
1120
|
+
}
|
|
1121
|
+
}))
|
|
1122
|
+
}
|
|
1123
|
+
},
|
|
1124
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
1125
|
+
importName: "AntdSubMenu",
|
|
1126
|
+
parentComponentName: "plasmic-antd5-menu"
|
|
1127
|
+
});
|
|
1128
|
+
}
|
|
1129
|
+
|
|
878
1130
|
var __defProp$8 = Object.defineProperty;
|
|
879
1131
|
var __defProps$6 = Object.defineProperties;
|
|
880
1132
|
var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
|
|
@@ -905,60 +1157,46 @@ var __objRest$6 = (source, exclude) => {
|
|
|
905
1157
|
target[prop] = source[prop];
|
|
906
1158
|
}
|
|
907
1159
|
return target;
|
|
908
|
-
};
|
|
909
|
-
function AntdDropdown(props) {
|
|
910
|
-
const _a = props, {
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
}
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
advanced: true
|
|
945
|
-
},
|
|
946
|
-
placement: {
|
|
947
|
-
type: "choice",
|
|
948
|
-
options: [
|
|
949
|
-
"bottomLeft",
|
|
950
|
-
"bottomCenter",
|
|
951
|
-
"bottomRight",
|
|
952
|
-
"topLeft",
|
|
953
|
-
"topCenter",
|
|
954
|
-
"topRight"
|
|
955
|
-
],
|
|
956
|
-
description: "Placement of popup menu",
|
|
957
|
-
defaultValueHint: "bottomLeft",
|
|
958
|
-
advanced: true
|
|
959
|
-
},
|
|
1160
|
+
};
|
|
1161
|
+
function AntdDropdown(props) {
|
|
1162
|
+
const _a = props, {
|
|
1163
|
+
children,
|
|
1164
|
+
onAction,
|
|
1165
|
+
menuItems,
|
|
1166
|
+
useMenuItemsSlot = false,
|
|
1167
|
+
menuItemsJson,
|
|
1168
|
+
trigger = "click"
|
|
1169
|
+
} = _a, rest = __objRest$6(_a, [
|
|
1170
|
+
"children",
|
|
1171
|
+
"onAction",
|
|
1172
|
+
"menuItems",
|
|
1173
|
+
"useMenuItemsSlot",
|
|
1174
|
+
"menuItemsJson",
|
|
1175
|
+
"trigger"
|
|
1176
|
+
]);
|
|
1177
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
1178
|
+
antd.Dropdown,
|
|
1179
|
+
__spreadProps$6(__spreadValues$8({}, rest), {
|
|
1180
|
+
trigger: [trigger],
|
|
1181
|
+
overlay: () => {
|
|
1182
|
+
var _a2;
|
|
1183
|
+
const itemsChildren = useMenuItemsSlot ? (_a2 = menuItems == null ? void 0 : menuItems()) != null ? _a2 : [] : void 0;
|
|
1184
|
+
const items = useMenuItemsSlot ? void 0 : menuItemsJson;
|
|
1185
|
+
return /* @__PURE__ */ React__default.default.createElement(antd.Menu, { onClick: (event) => onAction == null ? void 0 : onAction(event.key), items }, itemsChildren);
|
|
1186
|
+
}
|
|
1187
|
+
}),
|
|
1188
|
+
typeof children === "string" ? /* @__PURE__ */ React__default.default.createElement("div", null, children) : children
|
|
1189
|
+
);
|
|
1190
|
+
}
|
|
1191
|
+
function registerDropdown(loader) {
|
|
1192
|
+
registerComponentHelper(loader, AntdDropdown, {
|
|
1193
|
+
name: "plasmic-antd5-dropdown",
|
|
1194
|
+
displayName: "Dropdown",
|
|
1195
|
+
props: {
|
|
960
1196
|
menuItems: {
|
|
961
1197
|
type: "slot",
|
|
1198
|
+
displayName: "Menu items",
|
|
1199
|
+
hidden: (ps) => !ps.useMenuItemsSlot,
|
|
962
1200
|
allowedComponents: [
|
|
963
1201
|
"plasmic-antd5-menu-item",
|
|
964
1202
|
"plasmic-antd5-menu-item-group",
|
|
@@ -983,13 +1221,67 @@ function registerDropdown(loader) {
|
|
|
983
1221
|
],
|
|
984
1222
|
renderPropParams: []
|
|
985
1223
|
},
|
|
1224
|
+
menuItemsJson: {
|
|
1225
|
+
type: "array",
|
|
1226
|
+
displayName: "Menu Items",
|
|
1227
|
+
hidden: (ps) => ps.useMenuItemsSlot,
|
|
1228
|
+
itemType: MENU_ITEM_TYPE,
|
|
1229
|
+
defaultValue: [
|
|
1230
|
+
{
|
|
1231
|
+
type: "item",
|
|
1232
|
+
value: "action1",
|
|
1233
|
+
label: "Action 1"
|
|
1234
|
+
},
|
|
1235
|
+
{
|
|
1236
|
+
type: "item",
|
|
1237
|
+
value: "action2",
|
|
1238
|
+
label: "Action 2"
|
|
1239
|
+
}
|
|
1240
|
+
]
|
|
1241
|
+
},
|
|
1242
|
+
open: {
|
|
1243
|
+
type: "boolean",
|
|
1244
|
+
description: "Toggle visibility of dropdown menu in Plasmic Editor",
|
|
1245
|
+
editOnly: true,
|
|
1246
|
+
uncontrolledProp: "fakeOpen",
|
|
1247
|
+
defaultValueHint: false
|
|
1248
|
+
},
|
|
1249
|
+
disabled: {
|
|
1250
|
+
type: "boolean",
|
|
1251
|
+
description: "Whether the dropdown menu is disabled",
|
|
1252
|
+
defaultValueHint: false
|
|
1253
|
+
},
|
|
1254
|
+
placement: {
|
|
1255
|
+
type: "choice",
|
|
1256
|
+
options: [
|
|
1257
|
+
"bottomLeft",
|
|
1258
|
+
"bottomCenter",
|
|
1259
|
+
"bottomRight",
|
|
1260
|
+
"topLeft",
|
|
1261
|
+
"topCenter",
|
|
1262
|
+
"topRight"
|
|
1263
|
+
],
|
|
1264
|
+
description: "Placement of popup menu",
|
|
1265
|
+
defaultValueHint: "bottomLeft",
|
|
1266
|
+
advanced: true
|
|
1267
|
+
},
|
|
986
1268
|
trigger: {
|
|
987
1269
|
type: "choice",
|
|
988
|
-
options: [
|
|
1270
|
+
options: [
|
|
1271
|
+
{ value: "click", label: "Click" },
|
|
1272
|
+
{ value: "hover", label: "Hover" },
|
|
1273
|
+
{ value: "contextMenu", label: "Right-click" }
|
|
1274
|
+
],
|
|
989
1275
|
description: "The trigger mode which executes the dropdown action",
|
|
990
|
-
defaultValueHint: "
|
|
1276
|
+
defaultValueHint: "click"
|
|
991
1277
|
},
|
|
992
|
-
|
|
1278
|
+
useMenuItemsSlot: {
|
|
1279
|
+
type: "boolean",
|
|
1280
|
+
displayName: "Use menu items slot",
|
|
1281
|
+
advanced: true,
|
|
1282
|
+
description: "Instead of configuring a list of menu items, build the menu items using MenuItem elements. This gives you greater control over item styling."
|
|
1283
|
+
},
|
|
1284
|
+
children: __spreadValues$8({
|
|
993
1285
|
type: "slot",
|
|
994
1286
|
defaultValue: [
|
|
995
1287
|
{
|
|
@@ -1003,6 +1295,12 @@ function registerDropdown(loader) {
|
|
|
1003
1295
|
}
|
|
1004
1296
|
}
|
|
1005
1297
|
]
|
|
1298
|
+
}, { mergeWithParent: true }),
|
|
1299
|
+
arrow: {
|
|
1300
|
+
type: "boolean",
|
|
1301
|
+
description: "Whether the dropdown arrow should be visible",
|
|
1302
|
+
defaultValueHint: false,
|
|
1303
|
+
advanced: true
|
|
1006
1304
|
},
|
|
1007
1305
|
onAction: {
|
|
1008
1306
|
type: "eventHandler",
|
|
@@ -1620,7 +1918,7 @@ function FormItemForwarder(_a) {
|
|
|
1620
1918
|
});
|
|
1621
1919
|
}
|
|
1622
1920
|
function registerFormItem(loader) {
|
|
1623
|
-
registerComponentHelper(loader, FormItemWrapper, {
|
|
1921
|
+
registerComponentHelper(loader, FormItemWrapper, __spreadValues$6({
|
|
1624
1922
|
name: "plasmic-antd5-form-item",
|
|
1625
1923
|
displayName: "Form Item",
|
|
1626
1924
|
parentComponentName: "plasmic-antd5-form",
|
|
@@ -1629,21 +1927,21 @@ function registerFormItem(loader) {
|
|
|
1629
1927
|
width: "stretch"
|
|
1630
1928
|
},
|
|
1631
1929
|
props: {
|
|
1632
|
-
label: {
|
|
1930
|
+
label: __spreadValues$6({
|
|
1633
1931
|
type: "slot",
|
|
1634
1932
|
defaultValue: {
|
|
1635
1933
|
type: "text",
|
|
1636
1934
|
value: "Label"
|
|
1637
1935
|
},
|
|
1638
1936
|
hidden: (ps) => !!ps.noLabel
|
|
1639
|
-
},
|
|
1640
|
-
children: {
|
|
1937
|
+
}, { mergeWithParent: true }),
|
|
1938
|
+
children: __spreadValues$6({
|
|
1641
1939
|
type: "slot",
|
|
1642
1940
|
defaultValue: {
|
|
1643
1941
|
type: "component",
|
|
1644
1942
|
name: "plasmic-antd5-input"
|
|
1645
1943
|
}
|
|
1646
|
-
},
|
|
1944
|
+
}, { mergeWithParent: true }),
|
|
1647
1945
|
name: {
|
|
1648
1946
|
type: "string"
|
|
1649
1947
|
},
|
|
@@ -1816,7 +2114,7 @@ function registerFormItem(loader) {
|
|
|
1816
2114
|
}
|
|
1817
2115
|
}
|
|
1818
2116
|
}
|
|
1819
|
-
});
|
|
2117
|
+
}, { trapsSelection: true }));
|
|
1820
2118
|
}
|
|
1821
2119
|
function FormGroup(props) {
|
|
1822
2120
|
const pathCtx = React__default.default.useContext(PathContext);
|
|
@@ -2132,14 +2430,14 @@ const COMMON_EVENT_HANDLERS = {
|
|
|
2132
2430
|
}
|
|
2133
2431
|
};
|
|
2134
2432
|
function registerInput(loader) {
|
|
2135
|
-
registerComponentHelper(loader, AntdInput, {
|
|
2433
|
+
registerComponentHelper(loader, AntdInput, __spreadProps$4(__spreadValues$5({
|
|
2136
2434
|
name: "plasmic-antd5-input",
|
|
2137
2435
|
displayName: "Input",
|
|
2138
2436
|
props: __spreadValues$5(__spreadValues$5(__spreadValues$5({
|
|
2139
2437
|
value: {
|
|
2140
2438
|
type: "string"
|
|
2141
2439
|
},
|
|
2142
|
-
|
|
2440
|
+
placeholder: {
|
|
2143
2441
|
type: "string"
|
|
2144
2442
|
},
|
|
2145
2443
|
size: {
|
|
@@ -2165,11 +2463,12 @@ function registerInput(loader) {
|
|
|
2165
2463
|
defaultValueHint: "text"
|
|
2166
2464
|
}
|
|
2167
2465
|
}, COMMON_ADVANCED_PROPS), COMMON_DECORATOR_PROPS), COMMON_EVENT_HANDLERS),
|
|
2168
|
-
states: __spreadValues$5({}, COMMON_STATES)
|
|
2466
|
+
states: __spreadValues$5({}, COMMON_STATES)
|
|
2467
|
+
}, { trapsSelection: true }), {
|
|
2169
2468
|
componentHelpers: COMMON_HELPERS_CONFIG,
|
|
2170
2469
|
importPath: "@plasmicpkgs/antd5/skinny/registerInput",
|
|
2171
2470
|
importName: "AntdInput"
|
|
2172
|
-
});
|
|
2471
|
+
}));
|
|
2173
2472
|
}
|
|
2174
2473
|
function registerTextArea(loader) {
|
|
2175
2474
|
registerComponentHelper(loader, AntdTextArea, {
|
|
@@ -2180,304 +2479,107 @@ function registerTextArea(loader) {
|
|
|
2180
2479
|
value: {
|
|
2181
2480
|
type: "string"
|
|
2182
2481
|
},
|
|
2183
|
-
|
|
2184
|
-
type: "string"
|
|
2185
|
-
},
|
|
2186
|
-
disabled: {
|
|
2187
|
-
type: "boolean"
|
|
2188
|
-
},
|
|
2189
|
-
maxLength: {
|
|
2190
|
-
type: "number",
|
|
2191
|
-
advanced: true
|
|
2192
|
-
},
|
|
2193
|
-
bordered: {
|
|
2194
|
-
type: "boolean",
|
|
2195
|
-
advanced: true,
|
|
2196
|
-
defaultValueHint: true
|
|
2197
|
-
}
|
|
2198
|
-
}, COMMON_EVENT_HANDLERS),
|
|
2199
|
-
states: __spreadValues$5({}, COMMON_STATES),
|
|
2200
|
-
componentHelpers: COMMON_HELPERS_CONFIG,
|
|
2201
|
-
importPath: "@plasmicpkgs/antd5/skinny/registerInput",
|
|
2202
|
-
importName: "AntdTextArea"
|
|
2203
|
-
});
|
|
2204
|
-
}
|
|
2205
|
-
function registerPasswordInput(loader) {
|
|
2206
|
-
registerComponentHelper(loader, AntdPassword, {
|
|
2207
|
-
name: "plasmic-antd5-input-password",
|
|
2208
|
-
parentComponentName: "plasmic-antd5-input",
|
|
2209
|
-
displayName: "Password Input",
|
|
2210
|
-
props: __spreadValues$5({
|
|
2211
|
-
value: {
|
|
2212
|
-
type: "string"
|
|
2213
|
-
},
|
|
2214
|
-
placholder: {
|
|
2215
|
-
type: "string"
|
|
2216
|
-
},
|
|
2217
|
-
disabled: {
|
|
2218
|
-
type: "boolean"
|
|
2219
|
-
},
|
|
2220
|
-
maxLength: {
|
|
2221
|
-
type: "number",
|
|
2222
|
-
advanced: true
|
|
2223
|
-
},
|
|
2224
|
-
bordered: {
|
|
2225
|
-
type: "boolean",
|
|
2226
|
-
advanced: true,
|
|
2227
|
-
defaultValueHint: true
|
|
2228
|
-
}
|
|
2229
|
-
}, COMMON_EVENT_HANDLERS),
|
|
2230
|
-
states: __spreadValues$5({}, COMMON_STATES),
|
|
2231
|
-
componentHelpers: COMMON_HELPERS_CONFIG,
|
|
2232
|
-
importPath: "@plasmicpkgs/antd5/skinny/registerInput",
|
|
2233
|
-
importName: "AntdPassword"
|
|
2234
|
-
});
|
|
2235
|
-
}
|
|
2236
|
-
function registerNumberInput(loader) {
|
|
2237
|
-
registerComponentHelper(loader, AntdInputNumber, {
|
|
2238
|
-
name: "plasmic-antd5-input-number",
|
|
2239
|
-
parentComponentName: "plasmic-antd5-input",
|
|
2240
|
-
displayName: "Number Input",
|
|
2241
|
-
props: __spreadProps$4(__spreadValues$5(__spreadValues$5(__spreadValues$5({
|
|
2242
|
-
value: {
|
|
2243
|
-
type: "number"
|
|
2244
|
-
},
|
|
2245
|
-
placholder: {
|
|
2246
|
-
type: "string"
|
|
2247
|
-
},
|
|
2248
|
-
disabled: {
|
|
2249
|
-
type: "boolean"
|
|
2250
|
-
},
|
|
2251
|
-
max: {
|
|
2252
|
-
type: "number"
|
|
2253
|
-
},
|
|
2254
|
-
min: {
|
|
2255
|
-
type: "number"
|
|
2256
|
-
},
|
|
2257
|
-
step: {
|
|
2258
|
-
type: "number",
|
|
2259
|
-
helpText: "Increment or decrement step"
|
|
2260
|
-
},
|
|
2261
|
-
controls: {
|
|
2262
|
-
type: "boolean",
|
|
2263
|
-
displayName: "Show add/minus controls?",
|
|
2264
|
-
advanced: true
|
|
2265
|
-
}
|
|
2266
|
-
}, COMMON_DECORATOR_PROPS), COMMON_ADVANCED_PROPS), COMMON_EVENT_HANDLERS), {
|
|
2267
|
-
// onChange directly called with the number
|
|
2268
|
-
onChange: {
|
|
2269
|
-
type: "eventHandler",
|
|
2270
|
-
argTypes: [
|
|
2271
|
-
{
|
|
2272
|
-
name: "value",
|
|
2273
|
-
type: "number"
|
|
2274
|
-
}
|
|
2275
|
-
]
|
|
2276
|
-
}
|
|
2277
|
-
}),
|
|
2278
|
-
states: __spreadValues$5({}, COMMON_STATES),
|
|
2279
|
-
// don't need component helpers
|
|
2280
|
-
importPath: "@plasmicpkgs/antd5/skinny/registerInput",
|
|
2281
|
-
importName: "AntdInputNumber"
|
|
2282
|
-
});
|
|
2283
|
-
}
|
|
2284
|
-
|
|
2285
|
-
const AntdMenu = antd.Menu;
|
|
2286
|
-
const AntdMenuDivider = antd.Menu.Divider;
|
|
2287
|
-
const AntdMenuItem = antd.Menu.Item;
|
|
2288
|
-
const AntdMenuItemGroup = antd.Menu.ItemGroup;
|
|
2289
|
-
const AntdSubMenu = antd.Menu.SubMenu;
|
|
2290
|
-
const allowedMenuComponents = [
|
|
2291
|
-
"plasmic-antd5-menu-item",
|
|
2292
|
-
"plasmic-antd5-menu-divider",
|
|
2293
|
-
"plasmic-antd5-submenu",
|
|
2294
|
-
"plasmic-antd5-menu-item-group"
|
|
2295
|
-
];
|
|
2296
|
-
function registerMenu(loader) {
|
|
2297
|
-
registerComponentHelper(loader, AntdMenu, {
|
|
2298
|
-
name: "plasmic-antd5-menu",
|
|
2299
|
-
displayName: "Menu",
|
|
2300
|
-
props: {
|
|
2301
|
-
expandIcon: {
|
|
2302
|
-
type: "slot",
|
|
2303
|
-
hidePlaceholder: true
|
|
2304
|
-
},
|
|
2305
|
-
mode: {
|
|
2306
|
-
type: "choice",
|
|
2307
|
-
options: ["horizontal", "vertical", "inline"],
|
|
2308
|
-
description: "Type of menu",
|
|
2309
|
-
defaultValueHint: "vertical"
|
|
2310
|
-
},
|
|
2311
|
-
multiple: {
|
|
2312
|
-
type: "boolean",
|
|
2313
|
-
description: "Allows selection of multiple items",
|
|
2314
|
-
defaultValueHint: false
|
|
2315
|
-
},
|
|
2316
|
-
triggerSubMenuAction: {
|
|
2317
|
-
type: "choice",
|
|
2318
|
-
options: ["hover", "click"],
|
|
2319
|
-
description: "Which action can trigger submenu open/close",
|
|
2320
|
-
defaultValueHint: "hover",
|
|
2321
|
-
advanced: true
|
|
2322
|
-
},
|
|
2323
|
-
children: {
|
|
2324
|
-
type: "slot",
|
|
2325
|
-
allowedComponents: allowedMenuComponents,
|
|
2326
|
-
defaultValue: [
|
|
2327
|
-
{
|
|
2328
|
-
type: "component",
|
|
2329
|
-
name: "plasmic-antd5-menu-item",
|
|
2330
|
-
props: {
|
|
2331
|
-
key: "menuItemKey1"
|
|
2332
|
-
}
|
|
2333
|
-
},
|
|
2334
|
-
{
|
|
2335
|
-
type: "component",
|
|
2336
|
-
name: "plasmic-antd5-menu-item",
|
|
2337
|
-
props: {
|
|
2338
|
-
key: "menuItemKey2"
|
|
2339
|
-
}
|
|
2340
|
-
}
|
|
2341
|
-
]
|
|
2342
|
-
},
|
|
2343
|
-
onSelect: {
|
|
2344
|
-
type: "eventHandler",
|
|
2345
|
-
argTypes: [{ name: "key", type: "string" }]
|
|
2346
|
-
}
|
|
2347
|
-
},
|
|
2348
|
-
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
2349
|
-
importName: "AntdMenu"
|
|
2350
|
-
});
|
|
2351
|
-
registerComponentHelper(loader, AntdMenuItem, {
|
|
2352
|
-
name: "plasmic-antd5-menu-item",
|
|
2353
|
-
displayName: "Menu Item",
|
|
2354
|
-
props: {
|
|
2355
|
-
danger: {
|
|
2356
|
-
type: "boolean",
|
|
2357
|
-
description: "Display the danger style",
|
|
2358
|
-
defaultValueHint: false
|
|
2359
|
-
},
|
|
2360
|
-
disabled: {
|
|
2361
|
-
type: "boolean",
|
|
2362
|
-
description: "Whether disabled select",
|
|
2363
|
-
defaultValueHint: false
|
|
2364
|
-
},
|
|
2365
|
-
key: {
|
|
2366
|
-
type: "string",
|
|
2367
|
-
displayName: "Unique key",
|
|
2368
|
-
description: "Unique ID of the menu item. Used to determine which item is selected.",
|
|
2369
|
-
defaultValue: "menuItemKey"
|
|
2370
|
-
},
|
|
2371
|
-
title: {
|
|
2372
|
-
type: "string",
|
|
2373
|
-
description: "Set display title for collapsed item"
|
|
2482
|
+
placeholder: {
|
|
2483
|
+
type: "string"
|
|
2374
2484
|
},
|
|
2375
|
-
|
|
2376
|
-
type: "
|
|
2377
|
-
defaultValue: [
|
|
2378
|
-
{
|
|
2379
|
-
type: "text",
|
|
2380
|
-
value: "Menu item"
|
|
2381
|
-
}
|
|
2382
|
-
]
|
|
2485
|
+
disabled: {
|
|
2486
|
+
type: "boolean"
|
|
2383
2487
|
},
|
|
2384
|
-
|
|
2385
|
-
type: "
|
|
2386
|
-
|
|
2387
|
-
}
|
|
2388
|
-
},
|
|
2389
|
-
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
2390
|
-
importName: "AntdMenuItem",
|
|
2391
|
-
parentComponentName: "plasmic-antd5-menu"
|
|
2392
|
-
});
|
|
2393
|
-
registerComponentHelper(loader, AntdMenuItemGroup, {
|
|
2394
|
-
name: "plasmic-antd5-menu-item-group",
|
|
2395
|
-
displayName: "Item Group",
|
|
2396
|
-
props: {
|
|
2397
|
-
title: {
|
|
2398
|
-
type: "slot",
|
|
2399
|
-
defaultValue: [
|
|
2400
|
-
{
|
|
2401
|
-
type: "text",
|
|
2402
|
-
value: "Group"
|
|
2403
|
-
}
|
|
2404
|
-
]
|
|
2488
|
+
maxLength: {
|
|
2489
|
+
type: "number",
|
|
2490
|
+
advanced: true
|
|
2405
2491
|
},
|
|
2406
|
-
|
|
2407
|
-
type: "
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
{
|
|
2411
|
-
type: "component",
|
|
2412
|
-
name: "plasmic-antd5-menu-item"
|
|
2413
|
-
}
|
|
2414
|
-
]
|
|
2492
|
+
bordered: {
|
|
2493
|
+
type: "boolean",
|
|
2494
|
+
advanced: true,
|
|
2495
|
+
defaultValueHint: true
|
|
2415
2496
|
}
|
|
2416
|
-
},
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2497
|
+
}, COMMON_EVENT_HANDLERS),
|
|
2498
|
+
states: __spreadValues$5({}, COMMON_STATES),
|
|
2499
|
+
componentHelpers: COMMON_HELPERS_CONFIG,
|
|
2500
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerInput",
|
|
2501
|
+
importName: "AntdTextArea"
|
|
2420
2502
|
});
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2503
|
+
}
|
|
2504
|
+
function registerPasswordInput(loader) {
|
|
2505
|
+
registerComponentHelper(loader, AntdPassword, {
|
|
2506
|
+
name: "plasmic-antd5-input-password",
|
|
2507
|
+
parentComponentName: "plasmic-antd5-input",
|
|
2508
|
+
displayName: "Password Input",
|
|
2509
|
+
props: __spreadValues$5({
|
|
2510
|
+
value: {
|
|
2511
|
+
type: "string"
|
|
2512
|
+
},
|
|
2513
|
+
placeholder: {
|
|
2514
|
+
type: "string"
|
|
2515
|
+
},
|
|
2516
|
+
disabled: {
|
|
2517
|
+
type: "boolean"
|
|
2518
|
+
},
|
|
2519
|
+
maxLength: {
|
|
2520
|
+
type: "number",
|
|
2521
|
+
advanced: true
|
|
2522
|
+
},
|
|
2523
|
+
bordered: {
|
|
2426
2524
|
type: "boolean",
|
|
2427
|
-
|
|
2428
|
-
defaultValueHint:
|
|
2525
|
+
advanced: true,
|
|
2526
|
+
defaultValueHint: true
|
|
2429
2527
|
}
|
|
2430
|
-
},
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2528
|
+
}, COMMON_EVENT_HANDLERS),
|
|
2529
|
+
states: __spreadValues$5({}, COMMON_STATES),
|
|
2530
|
+
componentHelpers: COMMON_HELPERS_CONFIG,
|
|
2531
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerInput",
|
|
2532
|
+
importName: "AntdPassword"
|
|
2434
2533
|
});
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2534
|
+
}
|
|
2535
|
+
function registerNumberInput(loader) {
|
|
2536
|
+
registerComponentHelper(loader, AntdInputNumber, __spreadProps$4(__spreadValues$5({
|
|
2537
|
+
name: "plasmic-antd5-input-number",
|
|
2538
|
+
parentComponentName: "plasmic-antd5-input",
|
|
2539
|
+
displayName: "Number Input",
|
|
2540
|
+
props: __spreadProps$4(__spreadValues$5(__spreadValues$5(__spreadValues$5({
|
|
2541
|
+
value: {
|
|
2542
|
+
type: "number"
|
|
2543
|
+
},
|
|
2544
|
+
placeholder: {
|
|
2545
|
+
type: "string"
|
|
2546
|
+
},
|
|
2439
2547
|
disabled: {
|
|
2440
|
-
type: "boolean"
|
|
2441
|
-
description: "Whether sub-menu is disabled",
|
|
2442
|
-
defaultValueHint: false
|
|
2548
|
+
type: "boolean"
|
|
2443
2549
|
},
|
|
2444
|
-
|
|
2445
|
-
type: "
|
|
2446
|
-
displayName: "Unique key",
|
|
2447
|
-
description: "Unique ID of the sub-menu. Used to determine which item is selected.",
|
|
2448
|
-
advanced: true
|
|
2550
|
+
max: {
|
|
2551
|
+
type: "number"
|
|
2449
2552
|
},
|
|
2450
|
-
|
|
2451
|
-
type: "
|
|
2452
|
-
|
|
2553
|
+
min: {
|
|
2554
|
+
type: "number"
|
|
2555
|
+
},
|
|
2556
|
+
step: {
|
|
2557
|
+
type: "number",
|
|
2558
|
+
helpText: "Increment or decrement step"
|
|
2559
|
+
},
|
|
2560
|
+
controls: {
|
|
2561
|
+
type: "boolean",
|
|
2562
|
+
displayName: "Show add/minus controls?",
|
|
2563
|
+
advanced: true
|
|
2564
|
+
}
|
|
2565
|
+
}, COMMON_DECORATOR_PROPS), COMMON_ADVANCED_PROPS), COMMON_EVENT_HANDLERS), {
|
|
2566
|
+
// onChange directly called with the number
|
|
2567
|
+
onChange: {
|
|
2568
|
+
type: "eventHandler",
|
|
2569
|
+
argTypes: [
|
|
2453
2570
|
{
|
|
2454
|
-
|
|
2455
|
-
|
|
2571
|
+
name: "value",
|
|
2572
|
+
type: "number"
|
|
2456
2573
|
}
|
|
2457
2574
|
]
|
|
2458
|
-
},
|
|
2459
|
-
children: {
|
|
2460
|
-
type: "slot",
|
|
2461
|
-
allowedComponents: allowedMenuComponents,
|
|
2462
|
-
defaultValue: [1, 2].map((i) => ({
|
|
2463
|
-
type: "component",
|
|
2464
|
-
name: "plasmic-antd5-menu-item",
|
|
2465
|
-
props: {
|
|
2466
|
-
key: `subMenuItemKey${i}`,
|
|
2467
|
-
children: [
|
|
2468
|
-
{
|
|
2469
|
-
type: "text",
|
|
2470
|
-
value: `Sub-menu item ${i}`
|
|
2471
|
-
}
|
|
2472
|
-
]
|
|
2473
|
-
}
|
|
2474
|
-
}))
|
|
2475
2575
|
}
|
|
2476
|
-
},
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2576
|
+
}),
|
|
2577
|
+
states: __spreadValues$5({}, COMMON_STATES)
|
|
2578
|
+
}, { trapsSelection: true }), {
|
|
2579
|
+
// don't need component helpers
|
|
2580
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerInput",
|
|
2581
|
+
importName: "AntdInputNumber"
|
|
2582
|
+
}));
|
|
2481
2583
|
}
|
|
2482
2584
|
|
|
2483
2585
|
var __defProp$4 = Object.defineProperty;
|
|
@@ -2672,7 +2774,7 @@ const RadioGroup = antd.Radio.Group;
|
|
|
2672
2774
|
const AntdRadio = antd.Radio;
|
|
2673
2775
|
antd.Radio.Button;
|
|
2674
2776
|
function AntdRadioGroup(props) {
|
|
2675
|
-
const _a = props, { onChange } = _a, rest = __objRest$3(_a, ["onChange"]);
|
|
2777
|
+
const _a = props, { onChange, useChildren } = _a, rest = __objRest$3(_a, ["onChange", "useChildren"]);
|
|
2676
2778
|
const wrappedOnChange = React__default.default.useMemo(() => {
|
|
2677
2779
|
if (onChange) {
|
|
2678
2780
|
return (event) => onChange(event.target.value);
|
|
@@ -2680,7 +2782,13 @@ function AntdRadioGroup(props) {
|
|
|
2680
2782
|
return void 0;
|
|
2681
2783
|
}
|
|
2682
2784
|
}, [onChange]);
|
|
2683
|
-
return /* @__PURE__ */ React__default.default.createElement(
|
|
2785
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
2786
|
+
RadioGroup,
|
|
2787
|
+
__spreadProps$2(__spreadValues$3({}, rest), {
|
|
2788
|
+
onChange: wrappedOnChange,
|
|
2789
|
+
options: useChildren ? void 0 : rest.options
|
|
2790
|
+
})
|
|
2791
|
+
);
|
|
2684
2792
|
}
|
|
2685
2793
|
function registerRadio(loader) {
|
|
2686
2794
|
registerComponentHelper(loader, AntdRadio, {
|
|
@@ -2701,7 +2809,7 @@ function registerRadio(loader) {
|
|
|
2701
2809
|
defaultValueHint: false,
|
|
2702
2810
|
advanced: true
|
|
2703
2811
|
},
|
|
2704
|
-
children: {
|
|
2812
|
+
children: __spreadValues$3({
|
|
2705
2813
|
type: "slot",
|
|
2706
2814
|
defaultValue: [
|
|
2707
2815
|
{
|
|
@@ -2709,7 +2817,7 @@ function registerRadio(loader) {
|
|
|
2709
2817
|
value: "Radio"
|
|
2710
2818
|
}
|
|
2711
2819
|
]
|
|
2712
|
-
}
|
|
2820
|
+
}, { mergeWithParent: true })
|
|
2713
2821
|
},
|
|
2714
2822
|
importPath: "@plasmicpkgs/antd5/skinny/registerRadio",
|
|
2715
2823
|
importName: "AntdRadio",
|
|
@@ -2733,7 +2841,7 @@ function registerRadio(loader) {
|
|
|
2733
2841
|
defaultValueHint: false,
|
|
2734
2842
|
advanced: true
|
|
2735
2843
|
},
|
|
2736
|
-
children: {
|
|
2844
|
+
children: __spreadValues$3({
|
|
2737
2845
|
type: "slot",
|
|
2738
2846
|
defaultValue: [
|
|
2739
2847
|
{
|
|
@@ -2741,30 +2849,66 @@ function registerRadio(loader) {
|
|
|
2741
2849
|
value: "Radio"
|
|
2742
2850
|
}
|
|
2743
2851
|
]
|
|
2744
|
-
}
|
|
2852
|
+
}, { mergeWithParent: true })
|
|
2745
2853
|
},
|
|
2746
2854
|
importPath: "@plasmicpkgs/antd5/skinny/registerRadio",
|
|
2747
2855
|
importName: "AntdRadioButton",
|
|
2748
2856
|
parentComponentName: "plasmic-antd5-radio-group"
|
|
2749
2857
|
});
|
|
2750
|
-
registerComponentHelper(loader, AntdRadioGroup, {
|
|
2858
|
+
registerComponentHelper(loader, AntdRadioGroup, __spreadValues$3({
|
|
2751
2859
|
name: "plasmic-antd5-radio-group",
|
|
2752
2860
|
displayName: "Radio Group",
|
|
2753
2861
|
props: {
|
|
2862
|
+
options: {
|
|
2863
|
+
type: "array",
|
|
2864
|
+
hidden: (ps) => !!ps.useChildren,
|
|
2865
|
+
itemType: {
|
|
2866
|
+
type: "object",
|
|
2867
|
+
nameFunc: (item) => item.label || item.value,
|
|
2868
|
+
fields: {
|
|
2869
|
+
value: "string",
|
|
2870
|
+
label: "string"
|
|
2871
|
+
}
|
|
2872
|
+
},
|
|
2873
|
+
defaultValue: [
|
|
2874
|
+
{
|
|
2875
|
+
value: "option1",
|
|
2876
|
+
label: "Option 1"
|
|
2877
|
+
},
|
|
2878
|
+
{
|
|
2879
|
+
value: "option2",
|
|
2880
|
+
label: "Option 2"
|
|
2881
|
+
}
|
|
2882
|
+
]
|
|
2883
|
+
},
|
|
2884
|
+
optionType: {
|
|
2885
|
+
type: "choice",
|
|
2886
|
+
options: [
|
|
2887
|
+
{ value: "default", label: "Radio" },
|
|
2888
|
+
{ value: "button", label: "Button" }
|
|
2889
|
+
],
|
|
2890
|
+
hidden: (ps) => !!ps.useChildren,
|
|
2891
|
+
defaultValueHint: "default"
|
|
2892
|
+
},
|
|
2754
2893
|
value: {
|
|
2755
2894
|
type: "choice",
|
|
2756
2895
|
editOnly: true,
|
|
2757
2896
|
uncontrolledProp: "defaultValue",
|
|
2758
2897
|
description: "Default selected value",
|
|
2759
2898
|
options: (ps) => {
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2899
|
+
var _a;
|
|
2900
|
+
if (ps.useChildren) {
|
|
2901
|
+
const options = /* @__PURE__ */ new Set();
|
|
2902
|
+
traverseReactEltTree(ps.children, (elt) => {
|
|
2903
|
+
var _a2;
|
|
2904
|
+
if (typeof ((_a2 = elt == null ? void 0 : elt.props) == null ? void 0 : _a2.value) === "string") {
|
|
2905
|
+
options.add(elt.props.value);
|
|
2906
|
+
}
|
|
2907
|
+
});
|
|
2908
|
+
return Array.from(options.keys());
|
|
2909
|
+
} else {
|
|
2910
|
+
return (_a = ps.options) != null ? _a : [];
|
|
2911
|
+
}
|
|
2768
2912
|
}
|
|
2769
2913
|
},
|
|
2770
2914
|
disabled: {
|
|
@@ -2772,6 +2916,13 @@ function registerRadio(loader) {
|
|
|
2772
2916
|
description: "Disables all radios",
|
|
2773
2917
|
defaultValueHint: false
|
|
2774
2918
|
},
|
|
2919
|
+
useChildren: {
|
|
2920
|
+
displayName: "Use slot",
|
|
2921
|
+
type: "boolean",
|
|
2922
|
+
defaultValueHint: false,
|
|
2923
|
+
advanced: true,
|
|
2924
|
+
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."
|
|
2925
|
+
},
|
|
2775
2926
|
children: {
|
|
2776
2927
|
type: "slot",
|
|
2777
2928
|
allowedComponents: [
|
|
@@ -2817,8 +2968,13 @@ function registerRadio(loader) {
|
|
|
2817
2968
|
}
|
|
2818
2969
|
},
|
|
2819
2970
|
importPath: "@plasmicpkgs/antd5/skinny/registerRadio",
|
|
2820
|
-
importName: "AntdRadioGroup"
|
|
2821
|
-
|
|
2971
|
+
importName: "AntdRadioGroup",
|
|
2972
|
+
defaultStyles: {
|
|
2973
|
+
layout: "hbox"
|
|
2974
|
+
}
|
|
2975
|
+
}, {
|
|
2976
|
+
trapsSelection: true
|
|
2977
|
+
}));
|
|
2822
2978
|
}
|
|
2823
2979
|
|
|
2824
2980
|
var __defProp$2 = Object.defineProperty;
|
|
@@ -2883,7 +3039,7 @@ function AntdSelect(props) {
|
|
|
2883
3039
|
);
|
|
2884
3040
|
}
|
|
2885
3041
|
function registerSelect(loader) {
|
|
2886
|
-
registerComponentHelper(loader, AntdSelect, {
|
|
3042
|
+
registerComponentHelper(loader, AntdSelect, __spreadProps$1(__spreadValues$2({
|
|
2887
3043
|
name: "plasmic-antd5-select",
|
|
2888
3044
|
displayName: "Select",
|
|
2889
3045
|
props: {
|
|
@@ -2892,10 +3048,35 @@ function registerSelect(loader) {
|
|
|
2892
3048
|
hidden: (ps) => !!ps.useChildren,
|
|
2893
3049
|
itemType: {
|
|
2894
3050
|
type: "object",
|
|
2895
|
-
nameFunc: (item) => item.label,
|
|
3051
|
+
nameFunc: (item) => item.label || item.value,
|
|
2896
3052
|
fields: {
|
|
2897
|
-
|
|
2898
|
-
|
|
3053
|
+
type: {
|
|
3054
|
+
type: "choice",
|
|
3055
|
+
options: [
|
|
3056
|
+
{ value: "option", label: "Option" },
|
|
3057
|
+
{ value: "option-group", label: "Option Group" }
|
|
3058
|
+
],
|
|
3059
|
+
defaultValue: "option"
|
|
3060
|
+
},
|
|
3061
|
+
value: {
|
|
3062
|
+
type: "string",
|
|
3063
|
+
hidden: (ps) => ps.type !== "option"
|
|
3064
|
+
},
|
|
3065
|
+
label: "string",
|
|
3066
|
+
options: {
|
|
3067
|
+
type: "array",
|
|
3068
|
+
hidden: (ps) => {
|
|
3069
|
+
return ps.type !== "option-group";
|
|
3070
|
+
},
|
|
3071
|
+
itemType: {
|
|
3072
|
+
type: "object",
|
|
3073
|
+
nameFunc: (item) => item.label || item.value,
|
|
3074
|
+
fields: {
|
|
3075
|
+
value: "string",
|
|
3076
|
+
label: "string"
|
|
3077
|
+
}
|
|
3078
|
+
}
|
|
3079
|
+
}
|
|
2899
3080
|
}
|
|
2900
3081
|
},
|
|
2901
3082
|
defaultValue: [
|
|
@@ -2913,6 +3094,7 @@ function registerSelect(loader) {
|
|
|
2913
3094
|
displayName: "Use slot",
|
|
2914
3095
|
type: "boolean",
|
|
2915
3096
|
defaultValueHint: false,
|
|
3097
|
+
advanced: true,
|
|
2916
3098
|
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."
|
|
2917
3099
|
},
|
|
2918
3100
|
children: {
|
|
@@ -2947,13 +3129,17 @@ function registerSelect(loader) {
|
|
|
2947
3129
|
var _a;
|
|
2948
3130
|
const options = /* @__PURE__ */ new Set();
|
|
2949
3131
|
if (!ps.useChildren) {
|
|
2950
|
-
|
|
3132
|
+
const rec = (op) => {
|
|
2951
3133
|
var _a2;
|
|
2952
|
-
|
|
2953
|
-
value:
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
3134
|
+
if (typeof op === "string") {
|
|
3135
|
+
return [{ value: op, label: op }];
|
|
3136
|
+
} else if ("options" in op) {
|
|
3137
|
+
return ((_a2 = op.options) != null ? _a2 : []).flatMap((sub) => rec(sub));
|
|
3138
|
+
} else {
|
|
3139
|
+
return [{ value: op.value, label: op.label || op.value }];
|
|
3140
|
+
}
|
|
3141
|
+
};
|
|
3142
|
+
return ((_a = ps.options) != null ? _a : []).flatMap((o) => rec(o));
|
|
2957
3143
|
} else {
|
|
2958
3144
|
traverseReactEltTree(ps.children, (elt) => {
|
|
2959
3145
|
var _a2;
|
|
@@ -3070,11 +3256,6 @@ function registerSelect(loader) {
|
|
|
3070
3256
|
},
|
|
3071
3257
|
defaultStylesClassName: {
|
|
3072
3258
|
type: "themeResetClass"
|
|
3073
|
-
},
|
|
3074
|
-
tagRender: {
|
|
3075
|
-
type: "slot",
|
|
3076
|
-
renderPropParams: ["tagProps"],
|
|
3077
|
-
hidePlaceholder: true
|
|
3078
3259
|
}
|
|
3079
3260
|
},
|
|
3080
3261
|
states: {
|
|
@@ -3084,19 +3265,20 @@ function registerSelect(loader) {
|
|
|
3084
3265
|
onChangeProp: "onChange",
|
|
3085
3266
|
variableType: "text"
|
|
3086
3267
|
}
|
|
3087
|
-
}
|
|
3268
|
+
}
|
|
3269
|
+
}, { trapsSelection: true }), {
|
|
3088
3270
|
importPath: "@plasmicpkgs/antd5/skinny/registerSelect",
|
|
3089
3271
|
importName: "AntdSelect"
|
|
3090
|
-
});
|
|
3272
|
+
}));
|
|
3091
3273
|
registerComponentHelper(loader, AntdOption, {
|
|
3092
3274
|
name: "plasmic-antd5-option",
|
|
3093
3275
|
displayName: "Option",
|
|
3094
3276
|
parentComponentName: "plasmic-antd5-select",
|
|
3095
3277
|
props: {
|
|
3096
|
-
children: {
|
|
3278
|
+
children: __spreadValues$2({
|
|
3097
3279
|
type: "slot",
|
|
3098
3280
|
defaultValue: "Option"
|
|
3099
|
-
},
|
|
3281
|
+
}, { mergeWithParent: true }),
|
|
3100
3282
|
value: {
|
|
3101
3283
|
type: "string"
|
|
3102
3284
|
}
|
|
@@ -3512,7 +3694,7 @@ function UploadWrapper(props) {
|
|
|
3512
3694
|
);
|
|
3513
3695
|
}
|
|
3514
3696
|
function registerUpload(loader) {
|
|
3515
|
-
registerComponentHelper(loader, UploadWrapper, {
|
|
3697
|
+
registerComponentHelper(loader, UploadWrapper, __spreadProps(__spreadValues({
|
|
3516
3698
|
name: "plasmic-antd5-upload",
|
|
3517
3699
|
displayName: "Upload",
|
|
3518
3700
|
props: {
|
|
@@ -3591,10 +3773,11 @@ function registerUpload(loader) {
|
|
|
3591
3773
|
variableType: "array",
|
|
3592
3774
|
onChangeProp: "onFilesChange"
|
|
3593
3775
|
}
|
|
3594
|
-
}
|
|
3776
|
+
}
|
|
3777
|
+
}, { trapsSelection: true }), {
|
|
3595
3778
|
importPath: "@plasmicpkgs/antd5/skinny/registerUpload",
|
|
3596
3779
|
importName: "UploadWrapper"
|
|
3597
|
-
});
|
|
3780
|
+
}));
|
|
3598
3781
|
}
|
|
3599
3782
|
|
|
3600
3783
|
function registerAll(loader) {
|