@plasmicpkgs/antd5 0.0.5 → 0.0.7
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 +949 -39
- package/dist/antd.esm.js.map +1 -1
- package/dist/index.js +949 -39
- package/dist/registerButton.d.ts +13 -0
- package/dist/registerCheckbox.d.ts +8 -0
- package/dist/registerDropdown.d.ts +8 -0
- package/dist/registerMenu.d.ts +13 -0
- package/dist/registerModal.d.ts +7 -0
- package/dist/registerRadio.d.ts +12 -0
- package/package.json +3 -3
- package/skinny/registerButton.d.ts +13 -0
- package/skinny/registerButton.js +81 -0
- package/skinny/registerButton.js.map +1 -0
- package/skinny/registerCheckbox.d.ts +8 -0
- package/skinny/registerCheckbox.js +159 -0
- package/skinny/registerCheckbox.js.map +1 -0
- package/skinny/registerConfigProvider.js +26 -6
- package/skinny/registerConfigProvider.js.map +1 -1
- package/skinny/registerDropdown.d.ts +8 -0
- package/skinny/registerDropdown.js +146 -0
- package/skinny/registerDropdown.js.map +1 -0
- package/skinny/registerMenu.d.ts +13 -0
- package/skinny/registerMenu.js +202 -0
- package/skinny/registerMenu.js.map +1 -0
- package/skinny/registerModal.d.ts +7 -0
- package/skinny/registerModal.js +161 -0
- package/skinny/registerModal.js.map +1 -0
- package/skinny/registerRadio.d.ts +12 -0
- package/skinny/registerRadio.js +170 -0
- package/skinny/registerRadio.js.map +1 -0
- package/skinny/registerSelect.js +5 -0
- package/skinny/registerSelect.js.map +1 -1
- package/skinny/registerTable.js +7 -4
- package/skinny/registerTable.js.map +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var Button = require('antd/lib/button');
|
|
4
|
+
var registerComponent = require('@plasmicapp/host/registerComponent');
|
|
5
|
+
var registerGlobalContext = require('@plasmicapp/host/registerGlobalContext');
|
|
6
|
+
var Checkbox = require('antd/lib/checkbox');
|
|
7
|
+
var CheckboxGroup = require('antd/lib/checkbox/Group');
|
|
8
|
+
var React = require('react');
|
|
3
9
|
var host = require('@plasmicapp/host');
|
|
4
10
|
var registerToken = require('@plasmicapp/host/registerToken');
|
|
5
11
|
var query = require('@plasmicapp/query');
|
|
6
|
-
var App = require('antd/lib/app');
|
|
7
12
|
var ConfigProvider = require('antd/lib/config-provider');
|
|
13
|
+
var useMessage = require('antd/lib/message/useMessage');
|
|
14
|
+
var useNotification = require('antd/lib/notification/useNotification');
|
|
8
15
|
var theme = require('antd/lib/theme');
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
16
|
+
var Dropdown = require('antd/lib/dropdown');
|
|
17
|
+
var Menu = require('antd/lib/menu');
|
|
18
|
+
var Modal = require('antd/lib/modal');
|
|
19
|
+
var Radio = require('antd/lib/radio');
|
|
20
|
+
var RadioGroup = require('antd/lib/radio/group');
|
|
21
|
+
require('antd/lib/radio/radioButton');
|
|
12
22
|
var Select = require('antd/lib/select');
|
|
13
23
|
var Table = require('antd/lib/table');
|
|
14
24
|
|
|
@@ -55,33 +65,256 @@ function asArray(x) {
|
|
|
55
65
|
}
|
|
56
66
|
}
|
|
57
67
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
const AntdButton = Button;
|
|
69
|
+
function registerButton(loader) {
|
|
70
|
+
registerComponentHelper(loader, AntdButton, {
|
|
71
|
+
name: "plasmic-antd5-button",
|
|
72
|
+
displayName: "Button",
|
|
73
|
+
props: {
|
|
74
|
+
type: {
|
|
75
|
+
type: "choice",
|
|
76
|
+
options: ["default", "primary", "ghost", "dashed", "link", "text"],
|
|
77
|
+
description: "Can be set to primary, ghost, dashed, link, text, default",
|
|
78
|
+
defaultValueHint: "default"
|
|
79
|
+
},
|
|
80
|
+
size: {
|
|
81
|
+
type: "choice",
|
|
82
|
+
options: ["small", "medium", "large"],
|
|
83
|
+
description: "Set the size of button",
|
|
84
|
+
defaultValueHint: "medium"
|
|
85
|
+
},
|
|
86
|
+
shape: {
|
|
87
|
+
type: "choice",
|
|
88
|
+
options: ["default", "circle", "round"],
|
|
89
|
+
description: "Can be set button shape",
|
|
90
|
+
defaultValueHint: "default"
|
|
91
|
+
},
|
|
92
|
+
disabled: {
|
|
93
|
+
type: "boolean",
|
|
94
|
+
description: "Disabled state of button",
|
|
95
|
+
defaultValueHint: false
|
|
96
|
+
},
|
|
97
|
+
ghost: {
|
|
98
|
+
type: "boolean",
|
|
99
|
+
description: "Make background transparent and invert text and border colors",
|
|
100
|
+
defaultValueHint: false
|
|
101
|
+
},
|
|
102
|
+
danger: {
|
|
103
|
+
type: "boolean",
|
|
104
|
+
description: "Set the danger status of button",
|
|
105
|
+
defaultValueHint: false
|
|
106
|
+
},
|
|
107
|
+
loading: {
|
|
108
|
+
type: "boolean",
|
|
109
|
+
description: "Set the loading status of button",
|
|
110
|
+
defaultValueHint: false
|
|
111
|
+
},
|
|
112
|
+
href: {
|
|
113
|
+
type: "string",
|
|
114
|
+
description: "Redirect url of link button"
|
|
115
|
+
},
|
|
116
|
+
target: {
|
|
117
|
+
type: "choice",
|
|
118
|
+
options: ["_blank", "_self", "_parent", "_top"],
|
|
119
|
+
description: "Same as target attribute of a, works when href is specified",
|
|
120
|
+
hidden: (props) => !props.href,
|
|
121
|
+
defaultValueHint: "_self"
|
|
122
|
+
},
|
|
123
|
+
children: {
|
|
124
|
+
type: "slot",
|
|
125
|
+
defaultValue: [
|
|
126
|
+
{
|
|
127
|
+
type: "text",
|
|
128
|
+
value: "Button"
|
|
129
|
+
}
|
|
130
|
+
]
|
|
131
|
+
},
|
|
132
|
+
icon: {
|
|
133
|
+
type: "slot",
|
|
134
|
+
hidePlaceholder: true
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerButton",
|
|
138
|
+
importName: "AntdButton"
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
var __defProp$6 = Object.defineProperty;
|
|
143
|
+
var __defProps$5 = Object.defineProperties;
|
|
144
|
+
var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
|
|
145
|
+
var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
|
|
146
|
+
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
|
147
|
+
var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
|
|
148
|
+
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
149
|
+
var __spreadValues$6 = (a, b) => {
|
|
66
150
|
for (var prop in b || (b = {}))
|
|
67
|
-
if (__hasOwnProp$
|
|
68
|
-
__defNormalProp$
|
|
69
|
-
if (__getOwnPropSymbols$
|
|
70
|
-
for (var prop of __getOwnPropSymbols$
|
|
71
|
-
if (__propIsEnum$
|
|
72
|
-
__defNormalProp$
|
|
151
|
+
if (__hasOwnProp$6.call(b, prop))
|
|
152
|
+
__defNormalProp$6(a, prop, b[prop]);
|
|
153
|
+
if (__getOwnPropSymbols$6)
|
|
154
|
+
for (var prop of __getOwnPropSymbols$6(b)) {
|
|
155
|
+
if (__propIsEnum$6.call(b, prop))
|
|
156
|
+
__defNormalProp$6(a, prop, b[prop]);
|
|
73
157
|
}
|
|
74
158
|
return a;
|
|
75
159
|
};
|
|
76
|
-
var __spreadProps$
|
|
77
|
-
var __objRest$
|
|
160
|
+
var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
|
|
161
|
+
var __objRest$6 = (source, exclude) => {
|
|
78
162
|
var target = {};
|
|
79
163
|
for (var prop in source)
|
|
80
|
-
if (__hasOwnProp$
|
|
164
|
+
if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
81
165
|
target[prop] = source[prop];
|
|
82
|
-
if (source != null && __getOwnPropSymbols$
|
|
83
|
-
for (var prop of __getOwnPropSymbols$
|
|
84
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
166
|
+
if (source != null && __getOwnPropSymbols$6)
|
|
167
|
+
for (var prop of __getOwnPropSymbols$6(source)) {
|
|
168
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
|
|
169
|
+
target[prop] = source[prop];
|
|
170
|
+
}
|
|
171
|
+
return target;
|
|
172
|
+
};
|
|
173
|
+
function AntdCheckbox(props) {
|
|
174
|
+
const _a = props, { onChange } = _a, rest = __objRest$6(_a, ["onChange"]);
|
|
175
|
+
const wrappedOnChange = React.useMemo(() => {
|
|
176
|
+
if (onChange) {
|
|
177
|
+
return (event) => onChange(event.target.checked);
|
|
178
|
+
} else {
|
|
179
|
+
return void 0;
|
|
180
|
+
}
|
|
181
|
+
}, [onChange]);
|
|
182
|
+
return /* @__PURE__ */ React.createElement(Checkbox, __spreadProps$5(__spreadValues$6({}, rest), {
|
|
183
|
+
onChange: wrappedOnChange
|
|
184
|
+
}));
|
|
185
|
+
}
|
|
186
|
+
function registerCheckbox(loader) {
|
|
187
|
+
registerComponentHelper(loader, AntdCheckbox, {
|
|
188
|
+
name: "plasmic-antd5-checkbox",
|
|
189
|
+
displayName: "Checkbox",
|
|
190
|
+
props: {
|
|
191
|
+
checked: {
|
|
192
|
+
type: "boolean",
|
|
193
|
+
editOnly: true,
|
|
194
|
+
uncontrolledProp: "defaultChecked",
|
|
195
|
+
description: "Specifies the initial state: whether or not the checkbox is selected",
|
|
196
|
+
defaultValueHint: false
|
|
197
|
+
},
|
|
198
|
+
disabled: {
|
|
199
|
+
type: "boolean",
|
|
200
|
+
description: "If disable checkbox",
|
|
201
|
+
defaultValueHint: false
|
|
202
|
+
},
|
|
203
|
+
indeterminate: {
|
|
204
|
+
type: "boolean",
|
|
205
|
+
description: "The indeterminate checked state of checkbox",
|
|
206
|
+
defaultValueHint: false
|
|
207
|
+
},
|
|
208
|
+
value: {
|
|
209
|
+
type: "string",
|
|
210
|
+
description: "The checkbox value",
|
|
211
|
+
advanced: true
|
|
212
|
+
},
|
|
213
|
+
autoFocus: {
|
|
214
|
+
type: "boolean",
|
|
215
|
+
description: "If get focus when component mounted",
|
|
216
|
+
defaultValueHint: false,
|
|
217
|
+
advanced: true
|
|
218
|
+
},
|
|
219
|
+
children: {
|
|
220
|
+
type: "slot",
|
|
221
|
+
defaultValue: [
|
|
222
|
+
{
|
|
223
|
+
type: "text",
|
|
224
|
+
value: "Checkbox"
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
},
|
|
228
|
+
onChange: {
|
|
229
|
+
type: "eventHandler",
|
|
230
|
+
argTypes: [{ name: "checked", type: "boolean" }]
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
unstable__states: {
|
|
234
|
+
checked: {
|
|
235
|
+
type: "writable",
|
|
236
|
+
valueProp: "checked",
|
|
237
|
+
onChangeProp: "onChange"
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerCheckbox",
|
|
241
|
+
importName: "AntdCheckbox"
|
|
242
|
+
});
|
|
243
|
+
registerComponentHelper(loader, CheckboxGroup, {
|
|
244
|
+
name: "plasmic-antd5-checkbox-group",
|
|
245
|
+
displayName: "Checkbox Group",
|
|
246
|
+
props: {
|
|
247
|
+
value: {
|
|
248
|
+
type: "choice",
|
|
249
|
+
editOnly: true,
|
|
250
|
+
uncontrolledProp: "defaultValue",
|
|
251
|
+
description: "Default selected value",
|
|
252
|
+
multiSelect: true,
|
|
253
|
+
options: (ps) => {
|
|
254
|
+
const options = /* @__PURE__ */ new Set();
|
|
255
|
+
traverseReactEltTree(ps.children, (elt) => {
|
|
256
|
+
var _a;
|
|
257
|
+
if ((elt == null ? void 0 : elt.type) === AntdCheckbox && typeof ((_a = elt == null ? void 0 : elt.props) == null ? void 0 : _a.value) === "string") {
|
|
258
|
+
options.add(elt.props.value);
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
return Array.from(options.keys());
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
disabled: {
|
|
265
|
+
type: "boolean",
|
|
266
|
+
description: "Disables all checkboxes",
|
|
267
|
+
defaultValueHint: false
|
|
268
|
+
},
|
|
269
|
+
children: {
|
|
270
|
+
type: "slot",
|
|
271
|
+
allowedComponents: ["plasmic-antd5-checkbox"]
|
|
272
|
+
},
|
|
273
|
+
onChange: {
|
|
274
|
+
type: "eventHandler",
|
|
275
|
+
argTypes: [{ name: "value", type: "object" }]
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
unstable__states: {
|
|
279
|
+
value: {
|
|
280
|
+
type: "writable",
|
|
281
|
+
valueProp: "value",
|
|
282
|
+
onChangeProp: "onChange"
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
importPath: "@plasmicapp/antd5/skinny/registerCheckbox",
|
|
286
|
+
importName: "AntdCheckboxGroup",
|
|
287
|
+
parentComponentName: "plasmic-antd5-checkbox"
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
var __defProp$5 = Object.defineProperty;
|
|
292
|
+
var __defProps$4 = Object.defineProperties;
|
|
293
|
+
var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
|
|
294
|
+
var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
|
|
295
|
+
var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
|
|
296
|
+
var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
|
|
297
|
+
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
298
|
+
var __spreadValues$5 = (a, b) => {
|
|
299
|
+
for (var prop in b || (b = {}))
|
|
300
|
+
if (__hasOwnProp$5.call(b, prop))
|
|
301
|
+
__defNormalProp$5(a, prop, b[prop]);
|
|
302
|
+
if (__getOwnPropSymbols$5)
|
|
303
|
+
for (var prop of __getOwnPropSymbols$5(b)) {
|
|
304
|
+
if (__propIsEnum$5.call(b, prop))
|
|
305
|
+
__defNormalProp$5(a, prop, b[prop]);
|
|
306
|
+
}
|
|
307
|
+
return a;
|
|
308
|
+
};
|
|
309
|
+
var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
|
|
310
|
+
var __objRest$5 = (source, exclude) => {
|
|
311
|
+
var target = {};
|
|
312
|
+
for (var prop in source)
|
|
313
|
+
if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
314
|
+
target[prop] = source[prop];
|
|
315
|
+
if (source != null && __getOwnPropSymbols$5)
|
|
316
|
+
for (var prop of __getOwnPropSymbols$5(source)) {
|
|
317
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
|
|
85
318
|
target[prop] = source[prop];
|
|
86
319
|
}
|
|
87
320
|
return target;
|
|
@@ -103,7 +336,7 @@ function themeToAntdConfig(opts) {
|
|
|
103
336
|
wireframe,
|
|
104
337
|
spacing
|
|
105
338
|
} = opts;
|
|
106
|
-
return __spreadProps$
|
|
339
|
+
return __spreadProps$4(__spreadValues$5({}, spacing && { size: spacing }), {
|
|
107
340
|
theme: {
|
|
108
341
|
token: Object.fromEntries(Object.entries({
|
|
109
342
|
colorTextBase,
|
|
@@ -124,13 +357,13 @@ function themeToAntdConfig(opts) {
|
|
|
124
357
|
});
|
|
125
358
|
}
|
|
126
359
|
function AntdConfigProvider(props) {
|
|
127
|
-
const _a = props, { children, themeStyles } = _a, rest = __objRest$
|
|
128
|
-
return /* @__PURE__ */ React.createElement(ConfigProvider, __spreadValues$
|
|
360
|
+
const _a = props, { children, themeStyles } = _a, rest = __objRest$5(_a, ["children", "themeStyles"]);
|
|
361
|
+
return /* @__PURE__ */ React.createElement(ConfigProvider, __spreadValues$5({}, themeToAntdConfig(__spreadProps$4(__spreadValues$5({}, rest), {
|
|
129
362
|
fontFamily: themeStyles.fontFamily,
|
|
130
363
|
fontSize: themeStyles.fontSize ? parseInt(themeStyles.fontSize) : void 0,
|
|
131
364
|
lineHeight: themeStyles.lineHeight ? parseInt(themeStyles.lineHeight) : void 0,
|
|
132
365
|
colorTextBase: themeStyles.color
|
|
133
|
-
}))), /* @__PURE__ */ React.createElement(
|
|
366
|
+
}))), /* @__PURE__ */ React.createElement(ForkedApp, null, /* @__PURE__ */ React.createElement(InnerConfigProvider, null, children)));
|
|
134
367
|
}
|
|
135
368
|
function InnerConfigProvider(props) {
|
|
136
369
|
const { children } = props;
|
|
@@ -141,12 +374,12 @@ function InnerConfigProvider(props) {
|
|
|
141
374
|
${Object.entries(token).map(([key, val]) => `${makeVarName(key)}:${typeof val === "string" ? val.trim() : val};`).join("\n")}
|
|
142
375
|
}
|
|
143
376
|
`, [token]);
|
|
144
|
-
const app =
|
|
377
|
+
const app = useAppContext();
|
|
145
378
|
const actions = React.useMemo(() => ({
|
|
146
379
|
showNotification: (opts) => {
|
|
147
380
|
var _b;
|
|
148
|
-
const _a = opts, rest = __objRest$
|
|
149
|
-
app.notification[(_b = opts.type) != null ? _b : "info"](__spreadValues$
|
|
381
|
+
const _a = opts, rest = __objRest$5(_a, ["type"]);
|
|
382
|
+
app.notification[(_b = opts.type) != null ? _b : "info"](__spreadValues$5({}, rest));
|
|
150
383
|
},
|
|
151
384
|
hideNotifications: () => {
|
|
152
385
|
app.notification.destroy();
|
|
@@ -155,10 +388,10 @@ function InnerConfigProvider(props) {
|
|
|
155
388
|
if (!host.GlobalActionsProvider) {
|
|
156
389
|
warnOutdatedDeps();
|
|
157
390
|
}
|
|
158
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("style", null, cssStyles), host.GlobalActionsProvider
|
|
391
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("style", null, cssStyles), host.GlobalActionsProvider ? /* @__PURE__ */ React.createElement(host.GlobalActionsProvider, {
|
|
159
392
|
contextName: "plasmic-antd5-config-provider",
|
|
160
393
|
actions
|
|
161
|
-
}, children), /* @__PURE__ */ React.createElement(GlobalLoadingIndicator, null));
|
|
394
|
+
}, children) : children, /* @__PURE__ */ React.createElement(GlobalLoadingIndicator, null));
|
|
162
395
|
}
|
|
163
396
|
let warned = false;
|
|
164
397
|
function warnOutdatedDeps() {
|
|
@@ -168,7 +401,7 @@ function warnOutdatedDeps() {
|
|
|
168
401
|
}
|
|
169
402
|
}
|
|
170
403
|
function GlobalLoadingIndicator() {
|
|
171
|
-
const app =
|
|
404
|
+
const app = useAppContext();
|
|
172
405
|
React.useEffect(() => {
|
|
173
406
|
if (query.addLoadingStateListener) {
|
|
174
407
|
return query.addLoadingStateListener((isLoading) => {
|
|
@@ -190,6 +423,25 @@ function GlobalLoadingIndicator() {
|
|
|
190
423
|
}, [app]);
|
|
191
424
|
return null;
|
|
192
425
|
}
|
|
426
|
+
const ForkedAppContext = React.createContext(void 0);
|
|
427
|
+
function useAppContext() {
|
|
428
|
+
const context = React.useContext(ForkedAppContext);
|
|
429
|
+
if (!context) {
|
|
430
|
+
throw new Error("Must call useAppContext from under ForkedApp");
|
|
431
|
+
}
|
|
432
|
+
return context;
|
|
433
|
+
}
|
|
434
|
+
function ForkedApp(props) {
|
|
435
|
+
const [messageApi, messageContextHolder] = useMessage();
|
|
436
|
+
const [notificationApi, notificationContextHolder] = useNotification();
|
|
437
|
+
const appContext = React.useMemo(() => ({
|
|
438
|
+
message: messageApi,
|
|
439
|
+
notification: notificationApi
|
|
440
|
+
}), [messageApi, notificationApi]);
|
|
441
|
+
return /* @__PURE__ */ React.createElement(ForkedAppContext.Provider, {
|
|
442
|
+
value: appContext
|
|
443
|
+
}, messageContextHolder, notificationContextHolder, props.children);
|
|
444
|
+
}
|
|
193
445
|
function registerTokens(loader) {
|
|
194
446
|
const regs = [];
|
|
195
447
|
const makeColorToken = (name) => {
|
|
@@ -383,7 +635,7 @@ function registerTokens(loader) {
|
|
|
383
635
|
regs.forEach((t) => registerToken(t));
|
|
384
636
|
}
|
|
385
637
|
}
|
|
386
|
-
const registerConfigProvider = makeRegisterGlobalContext(AntdConfigProvider, __spreadProps$
|
|
638
|
+
const registerConfigProvider = makeRegisterGlobalContext(AntdConfigProvider, __spreadProps$4(__spreadValues$5({
|
|
387
639
|
name: "plasmic-antd5-config-provider",
|
|
388
640
|
displayName: "Ant Design System Settings",
|
|
389
641
|
props: {
|
|
@@ -488,6 +740,650 @@ const registerConfigProvider = makeRegisterGlobalContext(AntdConfigProvider, __s
|
|
|
488
740
|
importName: "AntdConfigProvider"
|
|
489
741
|
}));
|
|
490
742
|
|
|
743
|
+
var __defProp$4 = Object.defineProperty;
|
|
744
|
+
var __defProps$3 = Object.defineProperties;
|
|
745
|
+
var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
|
|
746
|
+
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
747
|
+
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
748
|
+
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
749
|
+
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
750
|
+
var __spreadValues$4 = (a, b) => {
|
|
751
|
+
for (var prop in b || (b = {}))
|
|
752
|
+
if (__hasOwnProp$4.call(b, prop))
|
|
753
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
754
|
+
if (__getOwnPropSymbols$4)
|
|
755
|
+
for (var prop of __getOwnPropSymbols$4(b)) {
|
|
756
|
+
if (__propIsEnum$4.call(b, prop))
|
|
757
|
+
__defNormalProp$4(a, prop, b[prop]);
|
|
758
|
+
}
|
|
759
|
+
return a;
|
|
760
|
+
};
|
|
761
|
+
var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
|
|
762
|
+
var __objRest$4 = (source, exclude) => {
|
|
763
|
+
var target = {};
|
|
764
|
+
for (var prop in source)
|
|
765
|
+
if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
766
|
+
target[prop] = source[prop];
|
|
767
|
+
if (source != null && __getOwnPropSymbols$4)
|
|
768
|
+
for (var prop of __getOwnPropSymbols$4(source)) {
|
|
769
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
|
|
770
|
+
target[prop] = source[prop];
|
|
771
|
+
}
|
|
772
|
+
return target;
|
|
773
|
+
};
|
|
774
|
+
function AntdDropdown(props) {
|
|
775
|
+
const _a = props, { children, onAction, menuItems } = _a, rest = __objRest$4(_a, ["children", "onAction", "menuItems"]);
|
|
776
|
+
return /* @__PURE__ */ React.createElement(Dropdown, __spreadProps$3(__spreadValues$4({}, rest), {
|
|
777
|
+
overlay: () => {
|
|
778
|
+
var _a2;
|
|
779
|
+
const items = (_a2 = menuItems == null ? void 0 : menuItems()) != null ? _a2 : [];
|
|
780
|
+
return /* @__PURE__ */ React.createElement(Menu, {
|
|
781
|
+
onClick: (event) => onAction == null ? void 0 : onAction(event.key)
|
|
782
|
+
}, items);
|
|
783
|
+
}
|
|
784
|
+
}), typeof children === "string" ? /* @__PURE__ */ React.createElement("div", null, children) : children);
|
|
785
|
+
}
|
|
786
|
+
function registerDropdown(loader) {
|
|
787
|
+
registerComponentHelper(loader, AntdDropdown, {
|
|
788
|
+
name: "plasmic-antd5-dropdown",
|
|
789
|
+
displayName: "Dropdown",
|
|
790
|
+
props: {
|
|
791
|
+
open: {
|
|
792
|
+
type: "boolean",
|
|
793
|
+
description: "Toggle visibility of dropdown menu in Plasmic Editor",
|
|
794
|
+
editOnly: true,
|
|
795
|
+
uncontrolledProp: "fakeOpen",
|
|
796
|
+
defaultValueHint: false
|
|
797
|
+
},
|
|
798
|
+
disabled: {
|
|
799
|
+
type: "boolean",
|
|
800
|
+
description: "Whether the dropdown menu is disabled",
|
|
801
|
+
defaultValueHint: false
|
|
802
|
+
},
|
|
803
|
+
arrow: {
|
|
804
|
+
type: "boolean",
|
|
805
|
+
description: "Whether the dropdown arrow should be visible",
|
|
806
|
+
defaultValueHint: false,
|
|
807
|
+
advanced: true
|
|
808
|
+
},
|
|
809
|
+
placement: {
|
|
810
|
+
type: "choice",
|
|
811
|
+
options: [
|
|
812
|
+
"bottomLeft",
|
|
813
|
+
"bottomCenter",
|
|
814
|
+
"bottomRight",
|
|
815
|
+
"topLeft",
|
|
816
|
+
"topCenter",
|
|
817
|
+
"topRight"
|
|
818
|
+
],
|
|
819
|
+
description: "Placement of popup menu",
|
|
820
|
+
defaultValueHint: "bottomLeft",
|
|
821
|
+
advanced: true
|
|
822
|
+
},
|
|
823
|
+
menuItems: {
|
|
824
|
+
type: "slot",
|
|
825
|
+
allowedComponents: [
|
|
826
|
+
"plasmic-antd5-menu-item",
|
|
827
|
+
"plasmic-antd5-menu-item-group",
|
|
828
|
+
"plasmic-antd5-menu-divider",
|
|
829
|
+
"plasmic-antd5-submenu"
|
|
830
|
+
],
|
|
831
|
+
defaultValue: [
|
|
832
|
+
{
|
|
833
|
+
type: "component",
|
|
834
|
+
name: "plasmic-antd5-menu-item",
|
|
835
|
+
props: {
|
|
836
|
+
key: "menu-item-1"
|
|
837
|
+
}
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
type: "component",
|
|
841
|
+
name: "plasmic-antd5-menu-item",
|
|
842
|
+
props: {
|
|
843
|
+
key: "menu-item-2"
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
],
|
|
847
|
+
renderPropParams: []
|
|
848
|
+
},
|
|
849
|
+
trigger: {
|
|
850
|
+
type: "choice",
|
|
851
|
+
options: ["click", "hover", "contextMenu"],
|
|
852
|
+
description: "The trigger mode which executes the dropdown action",
|
|
853
|
+
defaultValueHint: "hover"
|
|
854
|
+
},
|
|
855
|
+
children: {
|
|
856
|
+
type: "slot",
|
|
857
|
+
defaultValue: [
|
|
858
|
+
{
|
|
859
|
+
type: "default-component",
|
|
860
|
+
kind: "button",
|
|
861
|
+
props: {
|
|
862
|
+
children: {
|
|
863
|
+
type: "text",
|
|
864
|
+
value: "Dropdown"
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
]
|
|
869
|
+
},
|
|
870
|
+
onAction: {
|
|
871
|
+
type: "eventHandler",
|
|
872
|
+
argTypes: [{ name: "key", type: "string" }]
|
|
873
|
+
}
|
|
874
|
+
},
|
|
875
|
+
importPath: "@plasmicpkgs/antd/skinny/registerDropdown",
|
|
876
|
+
importName: "AntdDropdown"
|
|
877
|
+
});
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
const AntdMenu = Menu;
|
|
881
|
+
const AntdMenuDivider = Menu.Divider;
|
|
882
|
+
const AntdMenuItem = Menu.Item;
|
|
883
|
+
const AntdMenuItemGroup = Menu.ItemGroup;
|
|
884
|
+
const AntdSubMenu = Menu.SubMenu;
|
|
885
|
+
function registerMenu(loader) {
|
|
886
|
+
registerComponentHelper(loader, AntdMenu, {
|
|
887
|
+
name: "plasmic-antd5-menu",
|
|
888
|
+
displayName: "Menu",
|
|
889
|
+
props: {
|
|
890
|
+
expandIcon: {
|
|
891
|
+
type: "slot",
|
|
892
|
+
hidePlaceholder: true
|
|
893
|
+
},
|
|
894
|
+
mode: {
|
|
895
|
+
type: "choice",
|
|
896
|
+
options: ["horizontal", "vertical", "inline"],
|
|
897
|
+
description: "Type of menu",
|
|
898
|
+
defaultValueHint: "vertical"
|
|
899
|
+
},
|
|
900
|
+
multiple: {
|
|
901
|
+
type: "boolean",
|
|
902
|
+
description: "Allows selection of multiple items",
|
|
903
|
+
defaultValueHint: false
|
|
904
|
+
},
|
|
905
|
+
triggerSubMenuAction: {
|
|
906
|
+
type: "choice",
|
|
907
|
+
options: ["hover", "click"],
|
|
908
|
+
description: "Which action can trigger submenu open/close",
|
|
909
|
+
defaultValueHint: "hover",
|
|
910
|
+
advanced: true
|
|
911
|
+
},
|
|
912
|
+
children: {
|
|
913
|
+
type: "slot",
|
|
914
|
+
allowedComponents: [
|
|
915
|
+
"plasmic-antd5-menu-item",
|
|
916
|
+
"plasmic-antd5-menu-divider",
|
|
917
|
+
"plasmic-antd5-submenu",
|
|
918
|
+
"plasmic-antd5-menu-group"
|
|
919
|
+
],
|
|
920
|
+
defaultValue: [
|
|
921
|
+
{
|
|
922
|
+
type: "component",
|
|
923
|
+
name: "plasmic-antd5-menu-item"
|
|
924
|
+
},
|
|
925
|
+
{
|
|
926
|
+
type: "component",
|
|
927
|
+
name: "plasmic-antd5-menu-item"
|
|
928
|
+
}
|
|
929
|
+
]
|
|
930
|
+
},
|
|
931
|
+
onSelect: {
|
|
932
|
+
type: "eventHandler",
|
|
933
|
+
argTypes: [{ name: "key", type: "string" }]
|
|
934
|
+
}
|
|
935
|
+
},
|
|
936
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
937
|
+
importName: "AntdMenu"
|
|
938
|
+
});
|
|
939
|
+
registerComponentHelper(loader, AntdMenuItem, {
|
|
940
|
+
name: "plasmic-antd5-menu-item",
|
|
941
|
+
displayName: "Menu Item",
|
|
942
|
+
props: {
|
|
943
|
+
danger: {
|
|
944
|
+
type: "boolean",
|
|
945
|
+
description: "Display the danger style",
|
|
946
|
+
defaultValueHint: false
|
|
947
|
+
},
|
|
948
|
+
disabled: {
|
|
949
|
+
type: "boolean",
|
|
950
|
+
description: "Whether disabled select",
|
|
951
|
+
defaultValueHint: false
|
|
952
|
+
},
|
|
953
|
+
key: {
|
|
954
|
+
type: "string",
|
|
955
|
+
description: "Unique ID of the menu item",
|
|
956
|
+
defaultValue: "menuItemKey"
|
|
957
|
+
},
|
|
958
|
+
title: {
|
|
959
|
+
type: "string",
|
|
960
|
+
description: "Set display title for collapsed item"
|
|
961
|
+
},
|
|
962
|
+
children: {
|
|
963
|
+
type: "slot",
|
|
964
|
+
defaultValue: [
|
|
965
|
+
{
|
|
966
|
+
type: "text",
|
|
967
|
+
value: "Option"
|
|
968
|
+
}
|
|
969
|
+
]
|
|
970
|
+
}
|
|
971
|
+
},
|
|
972
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
973
|
+
importName: "AntdMenuItem",
|
|
974
|
+
parentComponentName: "plasmic-antd5-menu"
|
|
975
|
+
});
|
|
976
|
+
registerComponentHelper(loader, AntdMenuItemGroup, {
|
|
977
|
+
name: "plasmic-antd5-menu-item-group",
|
|
978
|
+
displayName: "Item Group",
|
|
979
|
+
props: {
|
|
980
|
+
title: {
|
|
981
|
+
type: "slot",
|
|
982
|
+
defaultValue: [
|
|
983
|
+
{
|
|
984
|
+
type: "text",
|
|
985
|
+
value: "Group"
|
|
986
|
+
}
|
|
987
|
+
]
|
|
988
|
+
},
|
|
989
|
+
children: {
|
|
990
|
+
type: "slot",
|
|
991
|
+
allowedComponents: [
|
|
992
|
+
"plasmic-antd5-menu-item",
|
|
993
|
+
"plasmic-antd5-menu-divider",
|
|
994
|
+
"plasmic-antd5-menu-item-group",
|
|
995
|
+
"plasmic-antd5-submenu"
|
|
996
|
+
],
|
|
997
|
+
defaultValue: [
|
|
998
|
+
{
|
|
999
|
+
type: "component",
|
|
1000
|
+
name: "plasmic-antd5-menu-item"
|
|
1001
|
+
}
|
|
1002
|
+
]
|
|
1003
|
+
}
|
|
1004
|
+
},
|
|
1005
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
1006
|
+
importName: "AntdMenuItemGroup",
|
|
1007
|
+
parentComponentName: "plasmic-antd5-menu"
|
|
1008
|
+
});
|
|
1009
|
+
registerComponentHelper(loader, AntdMenuDivider, {
|
|
1010
|
+
name: "plasmic-antd5-menu-divider",
|
|
1011
|
+
displayName: "Menu Divider",
|
|
1012
|
+
props: {
|
|
1013
|
+
dashed: {
|
|
1014
|
+
type: "boolean",
|
|
1015
|
+
description: "Whether line is dashed",
|
|
1016
|
+
defaultValueHint: false
|
|
1017
|
+
}
|
|
1018
|
+
},
|
|
1019
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
1020
|
+
importName: "AntdMenuDivider",
|
|
1021
|
+
parentComponentName: "plasmic-antd5-menu"
|
|
1022
|
+
});
|
|
1023
|
+
registerComponentHelper(loader, AntdSubMenu, {
|
|
1024
|
+
name: "plasmic-antd5-submenu",
|
|
1025
|
+
displayName: "Sub Menu",
|
|
1026
|
+
props: {
|
|
1027
|
+
disabled: {
|
|
1028
|
+
type: "boolean",
|
|
1029
|
+
description: "Whether sub-menu is disabled",
|
|
1030
|
+
defaultValueHint: false
|
|
1031
|
+
},
|
|
1032
|
+
key: {
|
|
1033
|
+
type: "string",
|
|
1034
|
+
description: "Unique ID of the sub-menu",
|
|
1035
|
+
advanced: true
|
|
1036
|
+
},
|
|
1037
|
+
title: {
|
|
1038
|
+
type: "slot",
|
|
1039
|
+
defaultValue: [
|
|
1040
|
+
{
|
|
1041
|
+
type: "text",
|
|
1042
|
+
value: "Sub-menu"
|
|
1043
|
+
}
|
|
1044
|
+
]
|
|
1045
|
+
},
|
|
1046
|
+
children: {
|
|
1047
|
+
type: "slot",
|
|
1048
|
+
allowedComponents: [
|
|
1049
|
+
"plasmic-antd5-menu-item",
|
|
1050
|
+
"plasmic-antd5-menu-divider",
|
|
1051
|
+
"plasmic-antd5-menu-item-group",
|
|
1052
|
+
"plasmic-antd5-submenu"
|
|
1053
|
+
],
|
|
1054
|
+
defaultValue: [1, 2].map((i) => ({
|
|
1055
|
+
type: "component",
|
|
1056
|
+
name: "plasmic-antd5-menu-item",
|
|
1057
|
+
props: {
|
|
1058
|
+
key: `subMenuItemKey${i}`,
|
|
1059
|
+
children: [
|
|
1060
|
+
{
|
|
1061
|
+
type: "text",
|
|
1062
|
+
value: `Sub-menu item ${i}`
|
|
1063
|
+
}
|
|
1064
|
+
]
|
|
1065
|
+
}
|
|
1066
|
+
}))
|
|
1067
|
+
}
|
|
1068
|
+
},
|
|
1069
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerMenu",
|
|
1070
|
+
importName: "AntdSubMenu",
|
|
1071
|
+
parentComponentName: "plasmic-antd5-menu"
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
var __defProp$3 = Object.defineProperty;
|
|
1076
|
+
var __defProps$2 = Object.defineProperties;
|
|
1077
|
+
var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
|
|
1078
|
+
var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
|
|
1079
|
+
var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
|
|
1080
|
+
var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
|
|
1081
|
+
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1082
|
+
var __spreadValues$3 = (a, b) => {
|
|
1083
|
+
for (var prop in b || (b = {}))
|
|
1084
|
+
if (__hasOwnProp$3.call(b, prop))
|
|
1085
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
1086
|
+
if (__getOwnPropSymbols$3)
|
|
1087
|
+
for (var prop of __getOwnPropSymbols$3(b)) {
|
|
1088
|
+
if (__propIsEnum$3.call(b, prop))
|
|
1089
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
1090
|
+
}
|
|
1091
|
+
return a;
|
|
1092
|
+
};
|
|
1093
|
+
var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
|
1094
|
+
var __objRest$3 = (source, exclude) => {
|
|
1095
|
+
var target = {};
|
|
1096
|
+
for (var prop in source)
|
|
1097
|
+
if (__hasOwnProp$3.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1098
|
+
target[prop] = source[prop];
|
|
1099
|
+
if (source != null && __getOwnPropSymbols$3)
|
|
1100
|
+
for (var prop of __getOwnPropSymbols$3(source)) {
|
|
1101
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$3.call(source, prop))
|
|
1102
|
+
target[prop] = source[prop];
|
|
1103
|
+
}
|
|
1104
|
+
return target;
|
|
1105
|
+
};
|
|
1106
|
+
function AntdModal(props) {
|
|
1107
|
+
const _a = props, { onOpenChange, onOk, onCancel, open, footer } = _a, rest = __objRest$3(_a, ["onOpenChange", "onOk", "onCancel", "open", "footer"]);
|
|
1108
|
+
const memoOnOk = React.useMemo(() => {
|
|
1109
|
+
if (onOpenChange || onOk) {
|
|
1110
|
+
return (e) => {
|
|
1111
|
+
onOpenChange == null ? void 0 : onOpenChange(false);
|
|
1112
|
+
onOk == null ? void 0 : onOk(e);
|
|
1113
|
+
};
|
|
1114
|
+
} else {
|
|
1115
|
+
return void 0;
|
|
1116
|
+
}
|
|
1117
|
+
}, [onOpenChange, onOk]);
|
|
1118
|
+
const memoOnCancel = React.useMemo(() => {
|
|
1119
|
+
if (onOpenChange || onCancel) {
|
|
1120
|
+
return (e) => {
|
|
1121
|
+
onOpenChange == null ? void 0 : onOpenChange(false);
|
|
1122
|
+
onCancel == null ? void 0 : onCancel(e);
|
|
1123
|
+
};
|
|
1124
|
+
} else {
|
|
1125
|
+
return void 0;
|
|
1126
|
+
}
|
|
1127
|
+
}, [onOpenChange, onCancel]);
|
|
1128
|
+
return /* @__PURE__ */ React.createElement(Modal, __spreadProps$2(__spreadValues$3({}, rest), {
|
|
1129
|
+
onOk: memoOnOk,
|
|
1130
|
+
onCancel: memoOnCancel,
|
|
1131
|
+
open,
|
|
1132
|
+
footer: footer != null ? footer : void 0
|
|
1133
|
+
}));
|
|
1134
|
+
}
|
|
1135
|
+
function registerModal(loader) {
|
|
1136
|
+
registerComponentHelper(loader, AntdModal, {
|
|
1137
|
+
name: "plasmic-antd5-modal",
|
|
1138
|
+
displayName: "Modal",
|
|
1139
|
+
props: {
|
|
1140
|
+
open: {
|
|
1141
|
+
type: "boolean"
|
|
1142
|
+
},
|
|
1143
|
+
children: {
|
|
1144
|
+
type: "slot",
|
|
1145
|
+
defaultValue: {
|
|
1146
|
+
type: "vbox",
|
|
1147
|
+
children: ["Modal content"]
|
|
1148
|
+
}
|
|
1149
|
+
},
|
|
1150
|
+
title: {
|
|
1151
|
+
type: "slot",
|
|
1152
|
+
defaultValue: "Modal title"
|
|
1153
|
+
},
|
|
1154
|
+
footer: {
|
|
1155
|
+
type: "slot",
|
|
1156
|
+
hidePlaceholder: true
|
|
1157
|
+
},
|
|
1158
|
+
closeIcon: {
|
|
1159
|
+
type: "slot",
|
|
1160
|
+
hidePlaceholder: true
|
|
1161
|
+
},
|
|
1162
|
+
onOk: {
|
|
1163
|
+
type: "eventHandler",
|
|
1164
|
+
argTypes: []
|
|
1165
|
+
},
|
|
1166
|
+
onCancel: {
|
|
1167
|
+
type: "eventHandler",
|
|
1168
|
+
argTypes: []
|
|
1169
|
+
},
|
|
1170
|
+
okText: {
|
|
1171
|
+
type: "string",
|
|
1172
|
+
hidden: (ps) => !!ps.footer,
|
|
1173
|
+
advanced: true
|
|
1174
|
+
},
|
|
1175
|
+
cancelText: {
|
|
1176
|
+
type: "string",
|
|
1177
|
+
hidden: (ps) => !!ps.footer,
|
|
1178
|
+
advanced: true
|
|
1179
|
+
},
|
|
1180
|
+
onOpenChange: {
|
|
1181
|
+
type: "eventHandler",
|
|
1182
|
+
argTypes: [{ name: "open", type: "boolean" }]
|
|
1183
|
+
},
|
|
1184
|
+
modalScopeClassName: {
|
|
1185
|
+
type: "styleScopeClass",
|
|
1186
|
+
scopeName: "modal"
|
|
1187
|
+
},
|
|
1188
|
+
modalClassName: {
|
|
1189
|
+
type: "class",
|
|
1190
|
+
displayName: "Modal content styles",
|
|
1191
|
+
noSelf: true,
|
|
1192
|
+
selectors: [
|
|
1193
|
+
{
|
|
1194
|
+
selector: ":modal .ant-modal .ant-modal-content",
|
|
1195
|
+
label: "Base"
|
|
1196
|
+
}
|
|
1197
|
+
],
|
|
1198
|
+
advanced: true
|
|
1199
|
+
},
|
|
1200
|
+
closeButtonClassName: {
|
|
1201
|
+
type: "class",
|
|
1202
|
+
displayName: "Close button styles",
|
|
1203
|
+
noSelf: true,
|
|
1204
|
+
selectors: [
|
|
1205
|
+
{
|
|
1206
|
+
selector: ":modal .ant-modal .ant-modal-close",
|
|
1207
|
+
label: "Base"
|
|
1208
|
+
}
|
|
1209
|
+
],
|
|
1210
|
+
advanced: true
|
|
1211
|
+
},
|
|
1212
|
+
defaultStylesClassName: {
|
|
1213
|
+
type: "themeResetClass"
|
|
1214
|
+
}
|
|
1215
|
+
},
|
|
1216
|
+
unstable__states: {
|
|
1217
|
+
open: {
|
|
1218
|
+
type: "writable",
|
|
1219
|
+
valueProp: "open",
|
|
1220
|
+
onChangeProp: "onOpenChange"
|
|
1221
|
+
}
|
|
1222
|
+
},
|
|
1223
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerModal",
|
|
1224
|
+
importName: "AntdModal"
|
|
1225
|
+
});
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
var __defProp$2 = Object.defineProperty;
|
|
1229
|
+
var __defProps$1 = Object.defineProperties;
|
|
1230
|
+
var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
|
|
1231
|
+
var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
|
|
1232
|
+
var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
|
|
1233
|
+
var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
|
|
1234
|
+
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1235
|
+
var __spreadValues$2 = (a, b) => {
|
|
1236
|
+
for (var prop in b || (b = {}))
|
|
1237
|
+
if (__hasOwnProp$2.call(b, prop))
|
|
1238
|
+
__defNormalProp$2(a, prop, b[prop]);
|
|
1239
|
+
if (__getOwnPropSymbols$2)
|
|
1240
|
+
for (var prop of __getOwnPropSymbols$2(b)) {
|
|
1241
|
+
if (__propIsEnum$2.call(b, prop))
|
|
1242
|
+
__defNormalProp$2(a, prop, b[prop]);
|
|
1243
|
+
}
|
|
1244
|
+
return a;
|
|
1245
|
+
};
|
|
1246
|
+
var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
|
|
1247
|
+
var __objRest$2 = (source, exclude) => {
|
|
1248
|
+
var target = {};
|
|
1249
|
+
for (var prop in source)
|
|
1250
|
+
if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1251
|
+
target[prop] = source[prop];
|
|
1252
|
+
if (source != null && __getOwnPropSymbols$2)
|
|
1253
|
+
for (var prop of __getOwnPropSymbols$2(source)) {
|
|
1254
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
|
|
1255
|
+
target[prop] = source[prop];
|
|
1256
|
+
}
|
|
1257
|
+
return target;
|
|
1258
|
+
};
|
|
1259
|
+
const AntdRadio = Radio;
|
|
1260
|
+
function AntdRadioGroup(props) {
|
|
1261
|
+
const _a = props, { onChange } = _a, rest = __objRest$2(_a, ["onChange"]);
|
|
1262
|
+
const wrappedOnChange = React.useMemo(() => {
|
|
1263
|
+
if (onChange) {
|
|
1264
|
+
return (event) => onChange(event.target.value);
|
|
1265
|
+
} else {
|
|
1266
|
+
return void 0;
|
|
1267
|
+
}
|
|
1268
|
+
}, [onChange]);
|
|
1269
|
+
return /* @__PURE__ */ React.createElement(RadioGroup, __spreadProps$1(__spreadValues$2({}, rest), {
|
|
1270
|
+
onChange: wrappedOnChange
|
|
1271
|
+
}));
|
|
1272
|
+
}
|
|
1273
|
+
function registerRadio(loader) {
|
|
1274
|
+
registerComponentHelper(loader, AntdRadio, {
|
|
1275
|
+
name: "plasmic-antd5-radio",
|
|
1276
|
+
displayName: "Radio",
|
|
1277
|
+
props: {
|
|
1278
|
+
value: {
|
|
1279
|
+
type: "string",
|
|
1280
|
+
description: "The radio option value"
|
|
1281
|
+
},
|
|
1282
|
+
disabled: {
|
|
1283
|
+
type: "boolean",
|
|
1284
|
+
defaultValueHint: false
|
|
1285
|
+
},
|
|
1286
|
+
autoFocus: {
|
|
1287
|
+
type: "boolean",
|
|
1288
|
+
description: "If focused when first shown",
|
|
1289
|
+
defaultValueHint: false,
|
|
1290
|
+
advanced: true
|
|
1291
|
+
},
|
|
1292
|
+
children: {
|
|
1293
|
+
type: "slot",
|
|
1294
|
+
defaultValue: [
|
|
1295
|
+
{
|
|
1296
|
+
type: "text",
|
|
1297
|
+
value: "Radio"
|
|
1298
|
+
}
|
|
1299
|
+
]
|
|
1300
|
+
}
|
|
1301
|
+
},
|
|
1302
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerRadio",
|
|
1303
|
+
importName: "AntdRadio",
|
|
1304
|
+
parentComponentName: "plasmic-antd5-radio-group"
|
|
1305
|
+
});
|
|
1306
|
+
registerComponentHelper(loader, AntdRadio, {
|
|
1307
|
+
name: "plasmic-antd5-radio-button",
|
|
1308
|
+
displayName: "Radio Button",
|
|
1309
|
+
props: {
|
|
1310
|
+
value: {
|
|
1311
|
+
type: "string",
|
|
1312
|
+
description: "The radio option value"
|
|
1313
|
+
},
|
|
1314
|
+
disabled: {
|
|
1315
|
+
type: "boolean",
|
|
1316
|
+
defaultValueHint: false
|
|
1317
|
+
},
|
|
1318
|
+
autoFocus: {
|
|
1319
|
+
type: "boolean",
|
|
1320
|
+
description: "If focused when first shown",
|
|
1321
|
+
defaultValueHint: false,
|
|
1322
|
+
advanced: true
|
|
1323
|
+
},
|
|
1324
|
+
children: {
|
|
1325
|
+
type: "slot",
|
|
1326
|
+
defaultValue: [
|
|
1327
|
+
{
|
|
1328
|
+
type: "text",
|
|
1329
|
+
value: "Radio"
|
|
1330
|
+
}
|
|
1331
|
+
]
|
|
1332
|
+
}
|
|
1333
|
+
},
|
|
1334
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerRadio",
|
|
1335
|
+
importName: "AntdRadioButton",
|
|
1336
|
+
parentComponentName: "plasmic-antd5-radio-group"
|
|
1337
|
+
});
|
|
1338
|
+
registerComponentHelper(loader, AntdRadioGroup, {
|
|
1339
|
+
name: "plasmic-antd5-radio-group",
|
|
1340
|
+
displayName: "Radio Group",
|
|
1341
|
+
props: {
|
|
1342
|
+
value: {
|
|
1343
|
+
type: "choice",
|
|
1344
|
+
editOnly: true,
|
|
1345
|
+
uncontrolledProp: "defaultValue",
|
|
1346
|
+
description: "Default selected value",
|
|
1347
|
+
options: (ps) => {
|
|
1348
|
+
const options = /* @__PURE__ */ new Set();
|
|
1349
|
+
traverseReactEltTree(ps.children, (elt) => {
|
|
1350
|
+
var _a;
|
|
1351
|
+
if (typeof ((_a = elt == null ? void 0 : elt.props) == null ? void 0 : _a.value) === "string") {
|
|
1352
|
+
options.add(elt.props.value);
|
|
1353
|
+
}
|
|
1354
|
+
});
|
|
1355
|
+
return Array.from(options.keys());
|
|
1356
|
+
}
|
|
1357
|
+
},
|
|
1358
|
+
disabled: {
|
|
1359
|
+
type: "boolean",
|
|
1360
|
+
description: "Disables all radios",
|
|
1361
|
+
defaultValueHint: false
|
|
1362
|
+
},
|
|
1363
|
+
children: {
|
|
1364
|
+
type: "slot",
|
|
1365
|
+
allowedComponents: [
|
|
1366
|
+
"plasmic-antd5-radio",
|
|
1367
|
+
"plasmic-antd5-radio-button"
|
|
1368
|
+
]
|
|
1369
|
+
},
|
|
1370
|
+
onChange: {
|
|
1371
|
+
type: "eventHandler",
|
|
1372
|
+
argTypes: [{ name: "value", type: "string" }]
|
|
1373
|
+
}
|
|
1374
|
+
},
|
|
1375
|
+
unstable__states: {
|
|
1376
|
+
value: {
|
|
1377
|
+
type: "writable",
|
|
1378
|
+
valueProp: "value",
|
|
1379
|
+
onChangeProp: "onChange"
|
|
1380
|
+
}
|
|
1381
|
+
},
|
|
1382
|
+
importPath: "@plasmicapp/antd5/skinny/registerRadio",
|
|
1383
|
+
importName: "AntdRadioGroup"
|
|
1384
|
+
});
|
|
1385
|
+
}
|
|
1386
|
+
|
|
491
1387
|
var __defProp$1 = Object.defineProperty;
|
|
492
1388
|
var __defProps = Object.defineProperties;
|
|
493
1389
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
@@ -588,6 +1484,10 @@ function registerSelect(loader) {
|
|
|
588
1484
|
type: "choice",
|
|
589
1485
|
options: ["small", "middle", "large"]
|
|
590
1486
|
},
|
|
1487
|
+
disabled: {
|
|
1488
|
+
type: "boolean",
|
|
1489
|
+
defaultValueHint: false
|
|
1490
|
+
},
|
|
591
1491
|
showSearch: {
|
|
592
1492
|
type: "boolean",
|
|
593
1493
|
defaultValueHint: false,
|
|
@@ -605,6 +1505,7 @@ function registerSelect(loader) {
|
|
|
605
1505
|
autoFocus: {
|
|
606
1506
|
type: "boolean",
|
|
607
1507
|
displayName: "Focus automatically",
|
|
1508
|
+
defaultValueHint: false,
|
|
608
1509
|
advanced: true
|
|
609
1510
|
},
|
|
610
1511
|
onChange: {
|
|
@@ -886,7 +1787,7 @@ function registerTable(loader) {
|
|
|
886
1787
|
hidden: (ps) => !ps.isSelectable
|
|
887
1788
|
}
|
|
888
1789
|
},
|
|
889
|
-
importPath: "@plasmicpkgs/antd5/registerTable",
|
|
1790
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerTable",
|
|
890
1791
|
importName: "AntdTable",
|
|
891
1792
|
unstable__states: {
|
|
892
1793
|
selectedRowKeys: {
|
|
@@ -928,11 +1829,14 @@ function registerTable(loader) {
|
|
|
928
1829
|
defaultValue: "Column Name"
|
|
929
1830
|
},
|
|
930
1831
|
dataIndex: {
|
|
931
|
-
type: "string"
|
|
1832
|
+
type: "string",
|
|
1833
|
+
displayName: "Column key"
|
|
932
1834
|
},
|
|
933
1835
|
render: {
|
|
934
1836
|
type: "slot",
|
|
935
|
-
renderPropParams: ["cell", "row", "index"]
|
|
1837
|
+
renderPropParams: ["cell", "row", "index"],
|
|
1838
|
+
hidePlaceholder: true,
|
|
1839
|
+
displayName: "Custom render"
|
|
936
1840
|
},
|
|
937
1841
|
align: {
|
|
938
1842
|
type: "choice",
|
|
@@ -949,7 +1853,7 @@ function registerTable(loader) {
|
|
|
949
1853
|
advanced: true
|
|
950
1854
|
}
|
|
951
1855
|
},
|
|
952
|
-
importPath: "@plasmicpkgs/antd5/registerTable",
|
|
1856
|
+
importPath: "@plasmicpkgs/antd5/skinny/registerTable",
|
|
953
1857
|
importName: "AntdColumn"
|
|
954
1858
|
}, { isRenderless: true }));
|
|
955
1859
|
registerComponentHelper(loader, AntdColumnGroup, __spreadValues({
|
|
@@ -976,6 +1880,12 @@ function registerAll(loader) {
|
|
|
976
1880
|
registerTokens(loader);
|
|
977
1881
|
registerSelect(loader);
|
|
978
1882
|
registerTable(loader);
|
|
1883
|
+
registerCheckbox(loader);
|
|
1884
|
+
registerRadio(loader);
|
|
1885
|
+
registerModal(loader);
|
|
1886
|
+
registerButton(loader);
|
|
1887
|
+
registerMenu(loader);
|
|
1888
|
+
registerDropdown(loader);
|
|
979
1889
|
}
|
|
980
1890
|
|
|
981
1891
|
exports.registerAll = registerAll;
|