@plasmicpkgs/antd5 0.0.61 → 0.0.63

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/index.js CHANGED
@@ -2004,13 +2004,13 @@ function registerSelect(loader) {
2004
2004
  },
2005
2005
  value: {
2006
2006
  type: "string",
2007
- hidden: (ps) => ps.type !== "option"
2007
+ hidden: (_ps, _ctx, { item }) => item.type !== "option"
2008
2008
  },
2009
2009
  label: "string",
2010
2010
  options: {
2011
2011
  type: "array",
2012
- hidden: (ps) => {
2013
- return ps.type !== "option-group";
2012
+ hidden: (_ps, _ctx, { item }) => {
2013
+ return item.type !== "option-group";
2014
2014
  },
2015
2015
  itemType: {
2016
2016
  type: "object",
@@ -2026,11 +2026,13 @@ function registerSelect(loader) {
2026
2026
  defaultValue: [
2027
2027
  {
2028
2028
  value: "option1",
2029
- label: "Option 1"
2029
+ label: "Option 1",
2030
+ type: "option"
2030
2031
  },
2031
2032
  {
2032
2033
  value: "option2",
2033
- label: "Option 2"
2034
+ label: "Option 2",
2035
+ type: "option"
2034
2036
  }
2035
2037
  ]
2036
2038
  },
@@ -2043,10 +2045,7 @@ function registerSelect(loader) {
2043
2045
  },
2044
2046
  children: {
2045
2047
  type: "slot",
2046
- allowedComponents: [
2047
- optionComponentName,
2048
- optionGroupComponentName
2049
- ],
2048
+ allowedComponents: [optionComponentName, optionGroupComponentName],
2050
2049
  hidden: (ps) => !ps.useChildren
2051
2050
  },
2052
2051
  placeholder: {
@@ -2419,7 +2418,7 @@ const Internal = (props) => {
2419
2418
  noLabel: formItem.inputType === "Checkbox" /* Checkbox */ || formItem.noLabel,
2420
2419
  style: { width: "100%" }
2421
2420
  }),
2422
- formItem.inputType === "Text" /* Text */ ? /* @__PURE__ */ React__default.default.createElement(antd.Input, null) : formItem.inputType === "Password" /* Password */ ? /* @__PURE__ */ React__default.default.createElement(antd.Input.Password, null) : formItem.inputType === "Text Area" /* TextArea */ ? /* @__PURE__ */ React__default.default.createElement(antd.Input.TextArea, null) : formItem.inputType === "Number" /* Number */ ? /* @__PURE__ */ React__default.default.createElement(antd.InputNumber, null) : formItem.inputType === "Checkbox" /* Checkbox */ ? /* @__PURE__ */ React__default.default.createElement(antd.Checkbox, null, formItem.label) : formItem.inputType === "Select" /* Select */ ? /* @__PURE__ */ React__default.default.createElement(antd.Select, { options: formItem.options }) : formItem.inputType === "Radio" /* Radio */ ? /* @__PURE__ */ React__default.default.createElement(
2421
+ formItem.inputType === "Text" /* Text */ ? /* @__PURE__ */ React__default.default.createElement(antd.Input, null) : formItem.inputType === "Password" /* Password */ ? /* @__PURE__ */ React__default.default.createElement(antd.Input.Password, null) : formItem.inputType === "Text Area" /* TextArea */ ? /* @__PURE__ */ React__default.default.createElement(antd.Input.TextArea, null) : formItem.inputType === "Number" /* Number */ ? /* @__PURE__ */ React__default.default.createElement(antd.InputNumber, null) : formItem.inputType === "Checkbox" /* Checkbox */ ? /* @__PURE__ */ React__default.default.createElement(antd.Checkbox, null, formItem.label) : formItem.inputType === "Select" /* Select */ ? /* @__PURE__ */ React__default.default.createElement(antd.Select, { options: formItem.options }) : formItem.inputType === "Radio Group" /* RadioGroup */ ? /* @__PURE__ */ React__default.default.createElement(
2423
2422
  antd.Radio.Group,
2424
2423
  {
2425
2424
  options: formItem.options,
@@ -2502,7 +2501,7 @@ const COMMON_ACTIONS = [
2502
2501
  "children"
2503
2502
  );
2504
2503
  },
2505
- hidden: (props) => props.mode !== "advanced"
2504
+ hidden: (props) => props.mode === "simplified"
2506
2505
  }
2507
2506
  // {
2508
2507
  // type: "button-action" as const,
@@ -2578,7 +2577,13 @@ function registerForm(loader) {
2578
2577
  label: "string",
2579
2578
  inputType: {
2580
2579
  type: "choice",
2581
- options: Object.values(InputType),
2580
+ options: Object.values(InputType).filter(
2581
+ (inputType) => ![
2582
+ "Option" /* Option */,
2583
+ "Option Group" /* OptionGroup */,
2584
+ "Radio" /* Radio */
2585
+ ].includes(inputType)
2586
+ ),
2582
2587
  defaultValue: "Text" /* Text */
2583
2588
  },
2584
2589
  options: {
@@ -2592,12 +2597,25 @@ function registerForm(loader) {
2592
2597
  { value: "option", label: "Option" },
2593
2598
  { value: "option-group", label: "Option Group" }
2594
2599
  ],
2595
- defaultValue: "option"
2600
+ defaultValue: "option",
2601
+ hidden: (ps, _ctx, { path }) => {
2602
+ var _a, _b;
2603
+ if (((_b = (_a = ps.formItems) == null ? void 0 : _a[path[1]]) == null ? void 0 : _b.inputType) !== "Select" /* Select */) {
2604
+ return true;
2605
+ }
2606
+ return false;
2607
+ }
2596
2608
  },
2597
2609
  label: "string",
2598
2610
  value: {
2599
2611
  type: "string",
2600
- hidden: (ps) => ps.type !== "option-group"
2612
+ hidden: (ps, _ctx, { path, item }) => {
2613
+ var _a, _b;
2614
+ if (((_b = (_a = ps.formItems) == null ? void 0 : _a[path[1]]) == null ? void 0 : _b.inputType) !== "Select" /* Select */) {
2615
+ return false;
2616
+ }
2617
+ return item.type !== "option";
2618
+ }
2601
2619
  },
2602
2620
  options: {
2603
2621
  type: "array",
@@ -2608,12 +2626,21 @@ function registerForm(loader) {
2608
2626
  value: "string",
2609
2627
  label: "string"
2610
2628
  }
2629
+ },
2630
+ hidden: (ps, _ctx, { path, item }) => {
2631
+ var _a, _b;
2632
+ if (((_b = (_a = ps.formItems) == null ? void 0 : _a[path[1]]) == null ? void 0 : _b.inputType) !== "Select" /* Select */) {
2633
+ return true;
2634
+ }
2635
+ return item.type !== "option-group";
2611
2636
  }
2612
2637
  }
2613
2638
  },
2614
2639
  nameFunc: (item) => item == null ? void 0 : item.label
2615
2640
  },
2616
- hidden: (ps) => !["Select" /* Select */, "Radio" /* Radio */].includes(ps.inputType)
2641
+ hidden: (_ps, _ctx, { item }) => !["Select" /* Select */, "Radio Group" /* RadioGroup */].includes(
2642
+ item.inputType
2643
+ )
2617
2644
  },
2618
2645
  optionType: {
2619
2646
  type: "choice",
@@ -2621,14 +2648,14 @@ function registerForm(loader) {
2621
2648
  { value: "default", label: "Radio" },
2622
2649
  { value: "button", label: "Button" }
2623
2650
  ],
2624
- hidden: (ps) => "Radio" /* Radio */ !== ps.inputType,
2651
+ hidden: (_ps, _ctx, { item }) => "Radio Group" /* RadioGroup */ !== item.inputType,
2625
2652
  defaultValueHint: "Radio",
2626
2653
  displayName: "Option Type"
2627
2654
  }
2628
2655
  }, commonFormItemProps),
2629
2656
  nameFunc: (item) => item.label
2630
2657
  },
2631
- hidden: (props) => props.mode === "advanced"
2658
+ hidden: (props) => props.mode !== "simplified"
2632
2659
  },
2633
2660
  submitSlot: __spreadValues$3({
2634
2661
  type: "slot",
@@ -2695,7 +2722,7 @@ function registerForm(loader) {
2695
2722
  }
2696
2723
  }
2697
2724
  ],
2698
- hidden: (props) => props.mode !== "advanced"
2725
+ hidden: (props) => props.mode === "simplified"
2699
2726
  },
2700
2727
  initialValues: {
2701
2728
  type: "object"