@plasmicpkgs/antd5 0.0.186 → 0.0.188

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
@@ -2923,13 +2923,34 @@ var __objRest$d = (source, exclude) => {
2923
2923
  }
2924
2924
  return target;
2925
2925
  };
2926
+ function addKeysToUnkeyedMenuItems(unkeyedMenuItems, maybeGenKey) {
2927
+ const genKey = maybeGenKey != null ? maybeGenKey : (() => {
2928
+ let key = 0;
2929
+ return () => {
2930
+ return `${key++}`;
2931
+ };
2932
+ })();
2933
+ return unkeyedMenuItems == null ? void 0 : unkeyedMenuItems.map((item) => {
2934
+ if (!item) {
2935
+ return null;
2936
+ }
2937
+ const newItem = __spreadValues$i({}, item);
2938
+ if (!newItem.key) {
2939
+ newItem.key = genKey();
2940
+ }
2941
+ if ("children" in newItem && newItem.children) {
2942
+ newItem.children = addKeysToUnkeyedMenuItems(newItem.children, genKey);
2943
+ }
2944
+ return newItem;
2945
+ });
2946
+ }
2926
2947
  function AntdDropdown(props) {
2927
2948
  const _a = props, {
2928
2949
  children,
2929
2950
  onAction,
2930
2951
  menuItems,
2931
2952
  useMenuItemsSlot = false,
2932
- menuItemsJson,
2953
+ menuItemsJson: unkeyedMenuItems,
2933
2954
  trigger = "click",
2934
2955
  dropdownMenuScopeClassName
2935
2956
  } = _a, rest = __objRest$d(_a, [
@@ -2941,6 +2962,7 @@ function AntdDropdown(props) {
2941
2962
  "trigger",
2942
2963
  "dropdownMenuScopeClassName"
2943
2964
  ]);
2965
+ const keyedMenuItems = addKeysToUnkeyedMenuItems(unkeyedMenuItems);
2944
2966
  return /* @__PURE__ */ React.createElement(
2945
2967
  Dropdown,
2946
2968
  __spreadProps$a(__spreadValues$i({}, rest), {
@@ -2948,7 +2970,7 @@ function AntdDropdown(props) {
2948
2970
  overlay: () => {
2949
2971
  var _a2;
2950
2972
  const itemsChildren = useMenuItemsSlot ? (_a2 = menuItems == null ? void 0 : menuItems()) != null ? _a2 : [] : void 0;
2951
- const items = useMenuItemsSlot ? void 0 : menuItemsJson;
2973
+ const items = useMenuItemsSlot ? void 0 : keyedMenuItems;
2952
2974
  return /* @__PURE__ */ React.createElement(
2953
2975
  Menu,
2954
2976
  {
@@ -3285,6 +3307,10 @@ function registerTextArea(loader) {
3285
3307
  type: "boolean",
3286
3308
  advanced: true,
3287
3309
  defaultValueHint: true
3310
+ },
3311
+ autoSize: {
3312
+ type: "boolean",
3313
+ displayName: "Auto grow height?"
3288
3314
  }
3289
3315
  }, COMMON_EVENT_HANDLERS),
3290
3316
  states: __spreadValues$h({}, COMMON_STATES),
@@ -3812,8 +3838,9 @@ function registerSelect(loader) {
3812
3838
  },
3813
3839
  mode: {
3814
3840
  type: "choice",
3815
- options: ["single", "multiple"],
3816
- defaultValueHint: "single"
3841
+ options: ["single", "multiple", "tags"],
3842
+ defaultValueHint: "single",
3843
+ description: "Whether to allow single or multiple selection. Tags mode additionally allows selecting options outside the specified set of options."
3817
3844
  },
3818
3845
  size: {
3819
3846
  type: "choice",
@@ -3856,6 +3883,12 @@ function registerSelect(loader) {
3856
3883
  defaultValueHint: true,
3857
3884
  advanced: true
3858
3885
  },
3886
+ allowClear: {
3887
+ type: "boolean",
3888
+ displayName: "Allow clearing the Select",
3889
+ defaultValueHint: false,
3890
+ advanced: true
3891
+ },
3859
3892
  triggerClassName: {
3860
3893
  type: "class",
3861
3894
  displayName: "Trigger styles",