@apexcura/ui-components 0.0.12-Beta26 → 0.0.12-Beta29

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.d.mts CHANGED
@@ -27,6 +27,7 @@ type ElementType = {
27
27
  variable_data?: any[];
28
28
  optionType?: string;
29
29
  selectedClassName?: string;
30
+ action?: React.MouseEventHandler<HTMLElement> | string;
30
31
  };
31
32
 
32
33
  interface ElementExecuterProps$3 extends ElementType {
@@ -71,7 +72,7 @@ declare const SingleSelectElement: (props: ElementType) => React$1.JSX.Element;
71
72
 
72
73
  declare const MultipleSelectElement: (props: ElementType) => React$1.JSX.Element;
73
74
 
74
- declare const ButtonElement: () => React$1.JSX.Element;
75
+ declare const ButtonElement: (props: ElementType) => React$1.JSX.Element;
75
76
 
76
77
  declare const AddMoreTable: (props: ElementType) => React$1.JSX.Element;
77
78
 
package/dist/index.d.ts CHANGED
@@ -27,6 +27,7 @@ type ElementType = {
27
27
  variable_data?: any[];
28
28
  optionType?: string;
29
29
  selectedClassName?: string;
30
+ action?: React.MouseEventHandler<HTMLElement> | string;
30
31
  };
31
32
 
32
33
  interface ElementExecuterProps$3 extends ElementType {
@@ -71,7 +72,7 @@ declare const SingleSelectElement: (props: ElementType) => React$1.JSX.Element;
71
72
 
72
73
  declare const MultipleSelectElement: (props: ElementType) => React$1.JSX.Element;
73
74
 
74
- declare const ButtonElement: () => React$1.JSX.Element;
75
+ declare const ButtonElement: (props: ElementType) => React$1.JSX.Element;
75
76
 
76
77
  declare const AddMoreTable: (props: ElementType) => React$1.JSX.Element;
77
78
 
package/dist/index.js CHANGED
@@ -115,7 +115,6 @@ var NumberElement = (props) => {
115
115
  prefix: props.prefix,
116
116
  type: props.type,
117
117
  status: props.status,
118
- style: props.styles,
119
118
  className: props.classNames,
120
119
  variant: props.variant,
121
120
  name: props.name,
@@ -203,17 +202,8 @@ var RadioElement = (props) => {
203
202
  props.onChange(selectedOptions);
204
203
  }
205
204
  };
206
- const renderOptions = () => {
207
- return props.options && props.options.map((option) => /* @__PURE__ */ import_react6.default.createElement(
208
- import_antd6.Radio.Button,
209
- {
210
- key: option.value,
211
- value: option.value,
212
- className: selectedValue === option.value ? option.selectedClassName : option.className,
213
- disabled: isDisabled
214
- },
215
- option.label
216
- ));
205
+ const getButtonStyle = (option) => {
206
+ return selectedValue === option.value ? option.selectedClassName : option.className;
217
207
  };
218
208
  return /* @__PURE__ */ import_react6.default.createElement(
219
209
  import_antd6.Radio.Group,
@@ -223,7 +213,15 @@ var RadioElement = (props) => {
223
213
  optionType,
224
214
  className: props.className ? props.className : ""
225
215
  },
226
- renderOptions()
216
+ props.options && props.options.map((option) => /* @__PURE__ */ import_react6.default.createElement(
217
+ import_antd6.Radio,
218
+ {
219
+ key: option.value,
220
+ value: option.value,
221
+ className: `${getButtonStyle(option)} ${isDisabled ? "cursor-not-allowed" : ""}`
222
+ },
223
+ option.label
224
+ ))
227
225
  );
228
226
  };
229
227
 
@@ -385,7 +383,12 @@ var MultipleSelectElement = (props) => {
385
383
  // src/Components/Button.tsx
386
384
  var import_react12 = __toESM(require("react"));
387
385
  var import_antd10 = require("antd");
388
- var ButtonElement = () => /* @__PURE__ */ import_react12.default.createElement(import_antd10.Flex, { gap: "small" }, /* @__PURE__ */ import_react12.default.createElement(import_antd10.Button, { type: "primary" }, "Primary Button"));
386
+ var ButtonElement = (props) => {
387
+ const handleClick = typeof props.action === "string" ? () => {
388
+ console.log("Performing action:", props.action);
389
+ } : props.action;
390
+ return /* @__PURE__ */ import_react12.default.createElement(import_antd10.Flex, null, /* @__PURE__ */ import_react12.default.createElement(import_antd10.Button, { onClick: handleClick, className: props.className }, props.name));
391
+ };
389
392
 
390
393
  // src/Components/AddMoreTable.tsx
391
394
  var import_react13 = __toESM(require("react"));
package/dist/index.mjs CHANGED
@@ -68,7 +68,6 @@ var NumberElement = (props) => {
68
68
  prefix: props.prefix,
69
69
  type: props.type,
70
70
  status: props.status,
71
- style: props.styles,
72
71
  className: props.classNames,
73
72
  variant: props.variant,
74
73
  name: props.name,
@@ -156,17 +155,8 @@ var RadioElement = (props) => {
156
155
  props.onChange(selectedOptions);
157
156
  }
158
157
  };
159
- const renderOptions = () => {
160
- return props.options && props.options.map((option) => /* @__PURE__ */ React6.createElement(
161
- Radio.Button,
162
- {
163
- key: option.value,
164
- value: option.value,
165
- className: selectedValue === option.value ? option.selectedClassName : option.className,
166
- disabled: isDisabled
167
- },
168
- option.label
169
- ));
158
+ const getButtonStyle = (option) => {
159
+ return selectedValue === option.value ? option.selectedClassName : option.className;
170
160
  };
171
161
  return /* @__PURE__ */ React6.createElement(
172
162
  Radio.Group,
@@ -176,7 +166,15 @@ var RadioElement = (props) => {
176
166
  optionType,
177
167
  className: props.className ? props.className : ""
178
168
  },
179
- renderOptions()
169
+ props.options && props.options.map((option) => /* @__PURE__ */ React6.createElement(
170
+ Radio,
171
+ {
172
+ key: option.value,
173
+ value: option.value,
174
+ className: `${getButtonStyle(option)} ${isDisabled ? "cursor-not-allowed" : ""}`
175
+ },
176
+ option.label
177
+ ))
180
178
  );
181
179
  };
182
180
 
@@ -338,7 +336,12 @@ var MultipleSelectElement = (props) => {
338
336
  // src/Components/Button.tsx
339
337
  import React11 from "react";
340
338
  import { Button as Button2, Flex as Flex2 } from "antd";
341
- var ButtonElement = () => /* @__PURE__ */ React11.createElement(Flex2, { gap: "small" }, /* @__PURE__ */ React11.createElement(Button2, { type: "primary" }, "Primary Button"));
339
+ var ButtonElement = (props) => {
340
+ const handleClick = typeof props.action === "string" ? () => {
341
+ console.log("Performing action:", props.action);
342
+ } : props.action;
343
+ return /* @__PURE__ */ React11.createElement(Flex2, null, /* @__PURE__ */ React11.createElement(Button2, { onClick: handleClick, className: props.className }, props.name));
344
+ };
342
345
 
343
346
  // src/Components/AddMoreTable.tsx
344
347
  import React12, { useEffect, useState as useState4 } from "react";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.12-Beta26",
3
+ "version": "0.0.12-Beta29",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",