@apexcura/ui-components 0.0.3 → 0.0.4

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
@@ -16,6 +16,7 @@ type ElementType = {
16
16
  name?: string;
17
17
  suffix?: React.ReactNode;
18
18
  maxLength?: number;
19
+ onChange?: (value: string | number | boolean) => void;
19
20
  };
20
21
 
21
22
  declare const TextElement: (props: ElementType) => React$1.JSX.Element;
package/dist/index.d.ts CHANGED
@@ -16,6 +16,7 @@ type ElementType = {
16
16
  name?: string;
17
17
  suffix?: React.ReactNode;
18
18
  maxLength?: number;
19
+ onChange?: (value: string | number | boolean) => void;
19
20
  };
20
21
 
21
22
  declare const TextElement: (props: ElementType) => React$1.JSX.Element;
package/dist/index.js CHANGED
@@ -41,10 +41,14 @@ module.exports = __toCommonJS(src_exports);
41
41
  // src/Components/TextElement.tsx
42
42
  var import_react = __toESM(require("react"));
43
43
  var import_antd = require("antd");
44
- var onHandleChange = ($event) => {
45
- console.log($event);
46
- };
47
44
  var TextElement = (props) => {
45
+ const [text, setText] = (0, import_react.useState)(props.value || "");
46
+ const onHandleChange = (e) => {
47
+ setText(e.target.value);
48
+ if (props.onChange) {
49
+ props.onChange(text);
50
+ }
51
+ };
48
52
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("label", { htmlFor: props.name }, props.label), /* @__PURE__ */ import_react.default.createElement(
49
53
  import_antd.Input,
50
54
  {
@@ -141,28 +145,34 @@ var NumberElement = (props) => {
141
145
  var import_react4 = __toESM(require("react"));
142
146
  var import_antd4 = require("antd");
143
147
  var { TextArea } = import_antd4.Input;
144
- var onHandleChange2 = ($event) => {
145
- console.log($event);
148
+ var TextareaElement = (props) => {
149
+ const [textarea, setTextarea] = (0, import_react4.useState)(props.value || "");
150
+ const onHandleChange = (e) => {
151
+ setTextarea(e.target.value);
152
+ if (props.onChange) {
153
+ props.onChange(textarea);
154
+ }
155
+ };
156
+ return /* @__PURE__ */ import_react4.default.createElement(import_antd4.Flex, { vertical: true, gap: 32 }, /* @__PURE__ */ import_react4.default.createElement(
157
+ TextArea,
158
+ {
159
+ placeholder: props.placeholder,
160
+ allowClear: true,
161
+ defaultValue: props.defaultValue,
162
+ disabled: props.disabled,
163
+ id: props.name,
164
+ value: props.value,
165
+ status: props.status,
166
+ style: props.styles,
167
+ className: props.classNames,
168
+ variant: props.variant,
169
+ name: props.name,
170
+ showCount: true,
171
+ maxLength: props.maxLength,
172
+ onChange: onHandleChange
173
+ }
174
+ ));
146
175
  };
147
- var TextareaElement = (props) => /* @__PURE__ */ import_react4.default.createElement(import_antd4.Flex, { vertical: true, gap: 32 }, /* @__PURE__ */ import_react4.default.createElement(
148
- TextArea,
149
- {
150
- placeholder: props.placeholder,
151
- allowClear: true,
152
- defaultValue: props.defaultValue,
153
- disabled: props.disabled,
154
- id: props.name,
155
- value: props.value,
156
- status: props.status,
157
- style: props.styles,
158
- className: props.classNames,
159
- variant: props.variant,
160
- name: props.name,
161
- showCount: true,
162
- maxLength: props.maxLength,
163
- onChange: onHandleChange2
164
- }
165
- ));
166
176
 
167
177
  // src/Components/SelectElement.tsx
168
178
  var import_react5 = __toESM(require("react"));
@@ -197,6 +207,10 @@ var SelectElement = (props) => /* @__PURE__ */ import_react5.default.createEleme
197
207
  options
198
208
  }
199
209
  );
210
+
211
+ // src/Components/Button.tsx
212
+ var import_react6 = __toESM(require("react"));
213
+ var import_antd6 = require("antd");
200
214
  // Annotate the CommonJS export names for ESM import in node:
201
215
  0 && (module.exports = {
202
216
  NumberElement,
package/dist/index.mjs CHANGED
@@ -1,10 +1,14 @@
1
1
  // src/Components/TextElement.tsx
2
- import React from "react";
2
+ import React, { useState } from "react";
3
3
  import { Input as AntInput } from "antd";
4
- var onHandleChange = ($event) => {
5
- console.log($event);
6
- };
7
4
  var TextElement = (props) => {
5
+ const [text, setText] = useState(props.value || "");
6
+ const onHandleChange = (e) => {
7
+ setText(e.target.value);
8
+ if (props.onChange) {
9
+ props.onChange(text);
10
+ }
11
+ };
8
12
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("label", { htmlFor: props.name }, props.label), /* @__PURE__ */ React.createElement(
9
13
  AntInput,
10
14
  {
@@ -28,11 +32,11 @@ var TextElement = (props) => {
28
32
  };
29
33
 
30
34
  // src/Components/PasswordElement.tsx
31
- import React2, { useState } from "react";
35
+ import React2, { useState as useState2 } from "react";
32
36
  import { EyeInvisibleOutlined, EyeTwoTone } from "@ant-design/icons";
33
37
  import { Button, Input, Space } from "antd";
34
38
  var PasswordElement = ({ inputData }) => {
35
- const [passwordVisible, setPasswordVisible] = useState(false);
39
+ const [passwordVisible, setPasswordVisible] = useState2(false);
36
40
  const handleVisibilityToggle = () => {
37
41
  setPasswordVisible((prev) => !prev);
38
42
  };
@@ -53,7 +57,7 @@ var PasswordElement = ({ inputData }) => {
53
57
  };
54
58
 
55
59
  // src/Components/NumberElement.tsx
56
- import React3, { useState as useState2 } from "react";
60
+ import React3, { useState as useState3 } from "react";
57
61
  import { Input as Input2, Tooltip } from "antd";
58
62
  var formatNumber = (value) => new Intl.NumberFormat().format(value);
59
63
  var NumericInput = (props) => {
@@ -85,7 +89,7 @@ var NumericInput = (props) => {
85
89
  ));
86
90
  };
87
91
  var NumberElement = (props) => {
88
- const [value, setValue] = useState2("");
92
+ const [value, setValue] = useState3("");
89
93
  return /* @__PURE__ */ React3.createElement(
90
94
  NumericInput,
91
95
  {
@@ -98,31 +102,37 @@ var NumberElement = (props) => {
98
102
  };
99
103
 
100
104
  // src/Components/TextareaElement.tsx
101
- import React4 from "react";
105
+ import React4, { useState as useState4 } from "react";
102
106
  import { Flex, Input as Input3 } from "antd";
103
107
  var { TextArea } = Input3;
104
- var onHandleChange2 = ($event) => {
105
- console.log($event);
108
+ var TextareaElement = (props) => {
109
+ const [textarea, setTextarea] = useState4(props.value || "");
110
+ const onHandleChange = (e) => {
111
+ setTextarea(e.target.value);
112
+ if (props.onChange) {
113
+ props.onChange(textarea);
114
+ }
115
+ };
116
+ return /* @__PURE__ */ React4.createElement(Flex, { vertical: true, gap: 32 }, /* @__PURE__ */ React4.createElement(
117
+ TextArea,
118
+ {
119
+ placeholder: props.placeholder,
120
+ allowClear: true,
121
+ defaultValue: props.defaultValue,
122
+ disabled: props.disabled,
123
+ id: props.name,
124
+ value: props.value,
125
+ status: props.status,
126
+ style: props.styles,
127
+ className: props.classNames,
128
+ variant: props.variant,
129
+ name: props.name,
130
+ showCount: true,
131
+ maxLength: props.maxLength,
132
+ onChange: onHandleChange
133
+ }
134
+ ));
106
135
  };
107
- var TextareaElement = (props) => /* @__PURE__ */ React4.createElement(Flex, { vertical: true, gap: 32 }, /* @__PURE__ */ React4.createElement(
108
- TextArea,
109
- {
110
- placeholder: props.placeholder,
111
- allowClear: true,
112
- defaultValue: props.defaultValue,
113
- disabled: props.disabled,
114
- id: props.name,
115
- value: props.value,
116
- status: props.status,
117
- style: props.styles,
118
- className: props.classNames,
119
- variant: props.variant,
120
- name: props.name,
121
- showCount: true,
122
- maxLength: props.maxLength,
123
- onChange: onHandleChange2
124
- }
125
- ));
126
136
 
127
137
  // src/Components/SelectElement.tsx
128
138
  import React5 from "react";
@@ -157,6 +167,10 @@ var SelectElement = (props) => /* @__PURE__ */ React5.createElement(
157
167
  options
158
168
  }
159
169
  );
170
+
171
+ // src/Components/Button.tsx
172
+ import React6 from "react";
173
+ import { Button as Button2, Flex as Flex2 } from "antd";
160
174
  export {
161
175
  NumberElement,
162
176
  PasswordElement,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords" : ["apex cura", "input", "ui", "react", "react-component"],
6
6
  "homepage": "https://www.apexcura.com/",