@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/antd.esm.js CHANGED
@@ -3218,6 +3218,7 @@ function FormItemWrapper(props) {
3218
3218
  help: hideValidationMessage ? "" : props.help,
3219
3219
  colon: noLabel ? false : void 0,
3220
3220
  valuePropName: deriveValuePropName(props),
3221
+ trigger: deriveOnChangePropName(props),
3221
3222
  wrapperCol: (layoutContext == null ? void 0 : layoutContext.layout) === "horizontal" && noLabel && alignLabellessWithControls && layoutContext.labelSpan ? { offset: layoutContext.labelSpan } : void 0
3222
3223
  }),
3223
3224
  /* @__PURE__ */ React.createElement(FormItemForwarder, { formItemProps: props })
@@ -3250,6 +3251,29 @@ function deriveValuePropName(props) {
3250
3251
  }
3251
3252
  return void 0;
3252
3253
  }
3254
+ function deriveOnChangePropName(props) {
3255
+ var _a;
3256
+ if (props.trigger) {
3257
+ return props.trigger;
3258
+ }
3259
+ const triggerProps = ((_a = React.Children.map(props.children, (child) => {
3260
+ var _a2;
3261
+ if (React.isValidElement(child)) {
3262
+ const childType = child.type;
3263
+ if (childType) {
3264
+ const x = (_a2 = childType.__plasmicFormFieldMeta) == null ? void 0 : _a2.onChangeProp;
3265
+ if (x) {
3266
+ return x;
3267
+ }
3268
+ }
3269
+ }
3270
+ return void 0;
3271
+ })) != null ? _a : []).filter((x) => !!x);
3272
+ if (triggerProps.length > 0) {
3273
+ return triggerProps[0];
3274
+ }
3275
+ return void 0;
3276
+ }
3253
3277
  function FormItemForwarder(_a) {
3254
3278
  var _b = _a, { formItemProps } = _b, props = __objRest$3(_b, ["formItemProps"]);
3255
3279
  var _a2;
@@ -3310,6 +3334,13 @@ const commonFormItemProps = {
3310
3334
  defaultValueHint: "value",
3311
3335
  description: "The prop name for specifying the value of the form control component"
3312
3336
  },
3337
+ trigger: {
3338
+ type: "string",
3339
+ displayName: "Trigger prop name",
3340
+ advanced: true,
3341
+ defaultValueHint: "onChange",
3342
+ description: "The prop name of event handler that is called when value is changed"
3343
+ },
3313
3344
  noLabel: {
3314
3345
  type: "boolean",
3315
3346
  advanced: true
@@ -3419,6 +3450,7 @@ function registerFormItem(loader) {
3419
3450
  }, commonFormItemProps),
3420
3451
  importPath: "@plasmicpkgs/antd5/skinny/registerForm",
3421
3452
  importName: "FormItemWrapper",
3453
+ treeLabel: (ps) => ps.name,
3422
3454
  templates: {
3423
3455
  Text: {
3424
3456
  props: {
@@ -4229,6 +4261,10 @@ function UploadWrapper(props) {
4229
4261
  })
4230
4262
  );
4231
4263
  }
4264
+ UploadWrapper.__plasmicFormFieldMeta = {
4265
+ valueProp: "files",
4266
+ onChangePropName: "onFilesChange"
4267
+ };
4232
4268
  function registerUpload(loader) {
4233
4269
  registerComponentHelper(loader, UploadWrapper, __spreadProps$1(__spreadValues$1({
4234
4270
  name: "plasmic-antd5-upload",
@@ -4264,7 +4300,8 @@ function registerUpload(loader) {
4264
4300
  files: {
4265
4301
  type: "object",
4266
4302
  displayName: "Files",
4267
- defaultValue: []
4303
+ defaultValue: [],
4304
+ hidden: (ps) => !!ps.__plasmicFormField
4268
4305
  },
4269
4306
  children: {
4270
4307
  type: "slot",
@@ -4292,7 +4329,7 @@ function registerUpload(loader) {
4292
4329
  argTypes: [
4293
4330
  {
4294
4331
  name: "files",
4295
- type: "object"
4332
+ type: "array"
4296
4333
  }
4297
4334
  ]
4298
4335
  },