revdev-components 0.53.0 → 0.55.0

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/build/index.js CHANGED
@@ -4698,7 +4698,7 @@ var RangePickerField = function (props) {
4698
4698
  var SelectField = function (props) {
4699
4699
  var _a = useLineProps(props), lineProps = _a[0], controlProps = _a[1];
4700
4700
  return (React.createElement(FormLine, __assign({}, lineProps),
4701
- React.createElement(antd.Select, __assign({}, controlProps, { options: true }))));
4701
+ React.createElement(antd.Select, __assign({}, controlProps))));
4702
4702
  };
4703
4703
 
4704
4704
  var TextArea = antd.Input.TextArea;
@@ -5102,10 +5102,9 @@ var PopoverSelect = function (_a) {
5102
5102
  }, [options, value]);
5103
5103
  var popoverContent = React.useMemo(function () { return (React.createElement("div", { className: s.popover }, options
5104
5104
  .filter(function (x) { return x.value !== value; })
5105
- .map(function (x) { return (React.createElement("div", { key: x.value, className: s.item, onClick: function () { return handleChange(x.value); } }, renderOption ? renderOption(x) : x.label)); }))); }, [options, value, handleChange, renderOption]);
5106
- return (React.createElement("div", { className: s.root },
5107
- React.createElement(antd.Popover, { content: popoverContent, open: open, onOpenChange: closePopover, placement: "bottomRight" },
5108
- React.createElement(IconDivision, { icon: icon, onClick: handleOpen, rightIcon: open ? "expand-less" : "expand-more" }, selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label))));
5105
+ .map(function (x) { return (React.createElement(React.Fragment, { key: x.value }, renderOption ? (renderOption(x, { className: s.item, onClick: function () { return handleChange(x.value); } })) : (React.createElement("div", { className: s.item, onClick: function () { return handleChange(x.value); } }, x.label)))); }))); }, [options, value, handleChange, renderOption]);
5106
+ return (React.createElement(antd.Popover, { content: popoverContent, open: open, onOpenChange: closePopover, placement: "bottomRight" },
5107
+ React.createElement(IconDivision, { icon: icon, onClick: handleOpen, rightIcon: open ? "expand-less" : "expand-more" }, selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label)));
5109
5108
  };
5110
5109
 
5111
5110
  exports.AppForm = AppForm;
@@ -1,12 +1,17 @@
1
1
  import React from "react";
2
2
  import { RegularIconName } from "src/icon";
3
3
  import { ValueOption } from "src/interfaces";
4
+ interface RenderViewOption {
5
+ className: string;
6
+ onClick: (value: string) => void;
7
+ }
8
+ export type PopoverSelectRenderOption<TOption = ValueOption> = (option: TOption, viewOption: RenderViewOption) => React.ReactNode;
4
9
  interface Props<TOption = ValueOption> {
5
10
  value: string;
6
11
  options: TOption[];
7
12
  onChange: (value: string) => void;
8
13
  icon?: RegularIconName;
9
- renderOption?: (option: TOption) => React.ReactNode;
14
+ renderOption?: PopoverSelectRenderOption<TOption>;
10
15
  }
11
16
  export declare const PopoverSelect: React.FC<Props>;
12
17
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revdev-components",
3
- "version": "0.53.0",
3
+ "version": "0.55.0",
4
4
  "main": "build/index.js",
5
5
  "module": "build/index.esm.js",
6
6
  "scripts": {