ar-design 0.2.5 → 0.2.7

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.
@@ -1,5 +1,5 @@
1
1
  .ar-modal-wrapper {
2
- position: absolute;
2
+ position: fixed;
3
3
  inset: 0;
4
4
  }
5
5
  .ar-modal-wrapper > .ar-modal-bg {
@@ -5,8 +5,8 @@ interface IProps extends IChildren, ISizes {
5
5
  *
6
6
  */
7
7
  open: {
8
- set: React.Dispatch<React.SetStateAction<boolean>>;
9
8
  get: boolean;
9
+ set: React.Dispatch<React.SetStateAction<boolean>>;
10
10
  };
11
11
  /**
12
12
  * ...
@@ -20,6 +20,7 @@ interface ISingle {
20
20
  }
21
21
  export type Props = {
22
22
  options: Option[];
23
+ onClick?: () => void;
23
24
  onCreate?: (option: Option) => void;
24
25
  placeholder?: string;
25
26
  upperCase?: boolean;
@@ -6,7 +6,7 @@ import Chip from "../../data-display/chip";
6
6
  import Checkbox from "../checkbox";
7
7
  import Utils from "../../../libs/infrastructure/shared/Utils";
8
8
  import ReactDOM from "react-dom";
9
- const Select = ({ variant = "outlined", status, border = { radius: "sm" }, options, value, onChange, onCreate, multiple, placeholder, validation, upperCase, disabled, }) => {
9
+ const Select = ({ variant = "outlined", status, border = { radius: "sm" }, options, value, onChange, onClick, onCreate, multiple, placeholder, validation, upperCase, disabled, }) => {
10
10
  const _selectionClassName = ["selections"];
11
11
  // refs
12
12
  const _arSelect = useRef(null);
@@ -242,7 +242,12 @@ const Select = ({ variant = "outlined", status, border = { radius: "sm" }, optio
242
242
  multiple ? (React.createElement("div", { className: _selectionClassName.map((c) => c).join(" "), onClick: () => setOptionsOpen((x) => !x) },
243
243
  React.createElement("div", { className: "items" }, value.length > 0 ? (value.map((_value, index) => (React.createElement(Chip, { key: index, variant: status?.selected?.variant || "filled", status: status?.selected?.color || status?.color, text: _value.text })))) : (React.createElement("span", { className: "placeholder" },
244
244
  validation ? "* " : "",
245
- placeholder))))) : (React.createElement(Input, { ref: _singleInput, variant: variant, status: !Utils.IsNullOrEmpty(validation?.text) ? "danger" : status, border: { radius: border.radius }, value: singleInputText, onClick: () => setOptionsOpen((prev) => !prev), onChange: (event) => {
245
+ placeholder))))) : (React.createElement(Input, { ref: _singleInput, variant: variant, status: !Utils.IsNullOrEmpty(validation?.text) ? "danger" : status, border: { radius: border.radius }, value: singleInputText, onClick: () => {
246
+ onClick && onClick();
247
+ (() => {
248
+ setOptionsOpen((prev) => !prev);
249
+ })();
250
+ }, onChange: (event) => {
246
251
  !optionsOpen && setOptionsOpen(true);
247
252
  if (upperCase)
248
253
  event.target.value = convertToUpperCase(event.target.value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ar-design",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",