@plasmicpkgs/antd5 0.0.89 → 0.0.91
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 +39 -2
- package/dist/antd.esm.js.map +1 -1
- package/dist/index.js +39 -2
- package/dist/index.js.map +1 -1
- package/dist/registerUpload.d.ts +6 -0
- package/package.json +5 -3
- package/skinny/registerForm.cjs.js +32 -0
- package/skinny/registerForm.cjs.js.map +1 -1
- package/skinny/registerForm.esm.js +32 -0
- package/skinny/registerForm.esm.js.map +1 -1
- package/skinny/registerUpload.cjs.js +7 -2
- package/skinny/registerUpload.cjs.js.map +1 -1
- package/skinny/registerUpload.d.ts +6 -0
- package/skinny/registerUpload.esm.js +7 -2
- package/skinny/registerUpload.esm.js.map +1 -1
package/dist/index.js
CHANGED
|
@@ -3231,6 +3231,7 @@ function FormItemWrapper(props) {
|
|
|
3231
3231
|
help: hideValidationMessage ? "" : props.help,
|
|
3232
3232
|
colon: noLabel ? false : void 0,
|
|
3233
3233
|
valuePropName: deriveValuePropName(props),
|
|
3234
|
+
trigger: deriveOnChangePropName(props),
|
|
3234
3235
|
wrapperCol: (layoutContext == null ? void 0 : layoutContext.layout) === "horizontal" && noLabel && alignLabellessWithControls && layoutContext.labelSpan ? { offset: layoutContext.labelSpan } : void 0
|
|
3235
3236
|
}),
|
|
3236
3237
|
/* @__PURE__ */ React__default.default.createElement(FormItemForwarder, { formItemProps: props })
|
|
@@ -3263,6 +3264,29 @@ function deriveValuePropName(props) {
|
|
|
3263
3264
|
}
|
|
3264
3265
|
return void 0;
|
|
3265
3266
|
}
|
|
3267
|
+
function deriveOnChangePropName(props) {
|
|
3268
|
+
var _a;
|
|
3269
|
+
if (props.trigger) {
|
|
3270
|
+
return props.trigger;
|
|
3271
|
+
}
|
|
3272
|
+
const triggerProps = ((_a = React__default.default.Children.map(props.children, (child) => {
|
|
3273
|
+
var _a2;
|
|
3274
|
+
if (React__default.default.isValidElement(child)) {
|
|
3275
|
+
const childType = child.type;
|
|
3276
|
+
if (childType) {
|
|
3277
|
+
const x = (_a2 = childType.__plasmicFormFieldMeta) == null ? void 0 : _a2.onChangeProp;
|
|
3278
|
+
if (x) {
|
|
3279
|
+
return x;
|
|
3280
|
+
}
|
|
3281
|
+
}
|
|
3282
|
+
}
|
|
3283
|
+
return void 0;
|
|
3284
|
+
})) != null ? _a : []).filter((x) => !!x);
|
|
3285
|
+
if (triggerProps.length > 0) {
|
|
3286
|
+
return triggerProps[0];
|
|
3287
|
+
}
|
|
3288
|
+
return void 0;
|
|
3289
|
+
}
|
|
3266
3290
|
function FormItemForwarder(_a) {
|
|
3267
3291
|
var _b = _a, { formItemProps } = _b, props = __objRest$3(_b, ["formItemProps"]);
|
|
3268
3292
|
var _a2;
|
|
@@ -3323,6 +3347,13 @@ const commonFormItemProps = {
|
|
|
3323
3347
|
defaultValueHint: "value",
|
|
3324
3348
|
description: "The prop name for specifying the value of the form control component"
|
|
3325
3349
|
},
|
|
3350
|
+
trigger: {
|
|
3351
|
+
type: "string",
|
|
3352
|
+
displayName: "Trigger prop name",
|
|
3353
|
+
advanced: true,
|
|
3354
|
+
defaultValueHint: "onChange",
|
|
3355
|
+
description: "The prop name of event handler that is called when value is changed"
|
|
3356
|
+
},
|
|
3326
3357
|
noLabel: {
|
|
3327
3358
|
type: "boolean",
|
|
3328
3359
|
advanced: true
|
|
@@ -3432,6 +3463,7 @@ function registerFormItem(loader) {
|
|
|
3432
3463
|
}, commonFormItemProps),
|
|
3433
3464
|
importPath: "@plasmicpkgs/antd5/skinny/registerForm",
|
|
3434
3465
|
importName: "FormItemWrapper",
|
|
3466
|
+
treeLabel: (ps) => ps.name,
|
|
3435
3467
|
templates: {
|
|
3436
3468
|
Text: {
|
|
3437
3469
|
props: {
|
|
@@ -4242,6 +4274,10 @@ function UploadWrapper(props) {
|
|
|
4242
4274
|
})
|
|
4243
4275
|
);
|
|
4244
4276
|
}
|
|
4277
|
+
UploadWrapper.__plasmicFormFieldMeta = {
|
|
4278
|
+
valueProp: "files",
|
|
4279
|
+
onChangePropName: "onFilesChange"
|
|
4280
|
+
};
|
|
4245
4281
|
function registerUpload(loader) {
|
|
4246
4282
|
registerComponentHelper(loader, UploadWrapper, __spreadProps$1(__spreadValues$1({
|
|
4247
4283
|
name: "plasmic-antd5-upload",
|
|
@@ -4277,7 +4313,8 @@ function registerUpload(loader) {
|
|
|
4277
4313
|
files: {
|
|
4278
4314
|
type: "object",
|
|
4279
4315
|
displayName: "Files",
|
|
4280
|
-
defaultValue: []
|
|
4316
|
+
defaultValue: [],
|
|
4317
|
+
hidden: (ps) => !!ps.__plasmicFormField
|
|
4281
4318
|
},
|
|
4282
4319
|
children: {
|
|
4283
4320
|
type: "slot",
|
|
@@ -4305,7 +4342,7 @@ function registerUpload(loader) {
|
|
|
4305
4342
|
argTypes: [
|
|
4306
4343
|
{
|
|
4307
4344
|
name: "files",
|
|
4308
|
-
type: "
|
|
4345
|
+
type: "array"
|
|
4309
4346
|
}
|
|
4310
4347
|
]
|
|
4311
4348
|
},
|