@apexcura/ui-components 0.0.5 → 0.0.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.
- package/dist/index.d.mts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +43 -51
- package/dist/index.mjs +48 -56
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -19,10 +19,10 @@ type ElementType = {
|
|
|
19
19
|
onChange?: (value: string | number | boolean) => void;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
interface ElementExecuterProps$
|
|
22
|
+
interface ElementExecuterProps$2 extends ElementType {
|
|
23
23
|
onChange: (value: string | number | boolean) => void;
|
|
24
24
|
}
|
|
25
|
-
declare const TextElement: (props: ElementExecuterProps$
|
|
25
|
+
declare const TextElement: (props: ElementExecuterProps$2) => React$1.JSX.Element;
|
|
26
26
|
|
|
27
27
|
interface InputData {
|
|
28
28
|
placeholder?: string;
|
|
@@ -36,7 +36,10 @@ interface PasswordProps {
|
|
|
36
36
|
}
|
|
37
37
|
declare const PasswordElement: React$1.FC<PasswordProps>;
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
interface ElementExecuterProps$1 extends ElementType {
|
|
40
|
+
onChange: (value: string | number | boolean) => void;
|
|
41
|
+
}
|
|
42
|
+
declare const NumberElement: (props: ElementExecuterProps$1) => React$1.JSX.Element;
|
|
40
43
|
|
|
41
44
|
interface ElementExecuterProps extends ElementType {
|
|
42
45
|
onChange: (value: string | number | boolean) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -19,10 +19,10 @@ type ElementType = {
|
|
|
19
19
|
onChange?: (value: string | number | boolean) => void;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
interface ElementExecuterProps$
|
|
22
|
+
interface ElementExecuterProps$2 extends ElementType {
|
|
23
23
|
onChange: (value: string | number | boolean) => void;
|
|
24
24
|
}
|
|
25
|
-
declare const TextElement: (props: ElementExecuterProps$
|
|
25
|
+
declare const TextElement: (props: ElementExecuterProps$2) => React$1.JSX.Element;
|
|
26
26
|
|
|
27
27
|
interface InputData {
|
|
28
28
|
placeholder?: string;
|
|
@@ -36,7 +36,10 @@ interface PasswordProps {
|
|
|
36
36
|
}
|
|
37
37
|
declare const PasswordElement: React$1.FC<PasswordProps>;
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
interface ElementExecuterProps$1 extends ElementType {
|
|
40
|
+
onChange: (value: string | number | boolean) => void;
|
|
41
|
+
}
|
|
42
|
+
declare const NumberElement: (props: ElementExecuterProps$1) => React$1.JSX.Element;
|
|
40
43
|
|
|
41
44
|
interface ElementExecuterProps extends ElementType {
|
|
42
45
|
onChange: (value: string | number | boolean) => void;
|
package/dist/index.js
CHANGED
|
@@ -92,47 +92,31 @@ var PasswordElement = ({ inputData }) => {
|
|
|
92
92
|
// src/Components/NumberElement.tsx
|
|
93
93
|
var import_react3 = __toESM(require("react"));
|
|
94
94
|
var import_antd3 = require("antd");
|
|
95
|
-
var
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const { value: inputValue } = e.target;
|
|
100
|
-
const reg = /^-?\d*(\.\d*)?$/;
|
|
101
|
-
if (reg.test(inputValue) || inputValue === "" || inputValue === "-") {
|
|
102
|
-
onChange(inputValue);
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
const handleBlur = () => {
|
|
106
|
-
let valueTemp = value;
|
|
107
|
-
if (value.charAt(value.length - 1) === "." || value === "-") {
|
|
108
|
-
valueTemp = value.slice(0, -1);
|
|
109
|
-
}
|
|
110
|
-
onChange(valueTemp.replace(/0*(\d+)/, "$1"));
|
|
95
|
+
var NumberElement = (props) => {
|
|
96
|
+
const handleInputChange = (e) => {
|
|
97
|
+
const newValue = e.target.value.replace(/[^0-9]/g, "");
|
|
98
|
+
props.onChange(newValue);
|
|
111
99
|
};
|
|
112
|
-
|
|
113
|
-
return /* @__PURE__ */ import_react3.default.createElement(import_antd3.Tooltip, { trigger: ["focus"], title, placement: "topLeft", overlayClassName: "numeric-input" }, /* @__PURE__ */ import_react3.default.createElement(
|
|
100
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_react3.default.Fragment, null, /* @__PURE__ */ import_react3.default.createElement("label", { htmlFor: props.name }, props.label), /* @__PURE__ */ import_react3.default.createElement(
|
|
114
101
|
import_antd3.Input,
|
|
115
102
|
{
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
103
|
+
placeholder: props.placeholder,
|
|
104
|
+
addonBefore: props.addonBefore,
|
|
105
|
+
allowClear: true,
|
|
106
|
+
defaultValue: props.defaultValue,
|
|
107
|
+
disabled: props.disabled,
|
|
108
|
+
id: props.name,
|
|
109
|
+
prefix: props.prefix,
|
|
110
|
+
type: props.type,
|
|
111
|
+
status: props.status,
|
|
112
|
+
style: props.styles,
|
|
113
|
+
className: props.classNames,
|
|
114
|
+
variant: props.variant,
|
|
115
|
+
name: props.name,
|
|
116
|
+
onChange: handleInputChange
|
|
121
117
|
}
|
|
122
118
|
));
|
|
123
119
|
};
|
|
124
|
-
var NumberElement = (props) => {
|
|
125
|
-
const [value, setValue] = (0, import_react3.useState)("");
|
|
126
|
-
return /* @__PURE__ */ import_react3.default.createElement(
|
|
127
|
-
NumericInput,
|
|
128
|
-
{
|
|
129
|
-
...props,
|
|
130
|
-
style: { width: 120 },
|
|
131
|
-
value,
|
|
132
|
-
onChange: setValue
|
|
133
|
-
}
|
|
134
|
-
);
|
|
135
|
-
};
|
|
136
120
|
|
|
137
121
|
// src/Components/TextareaElement.tsx
|
|
138
122
|
var import_react4 = __toESM(require("react"));
|
|
@@ -174,22 +158,30 @@ var labelRender = (props) => {
|
|
|
174
158
|
}
|
|
175
159
|
return /* @__PURE__ */ import_react5.default.createElement("span", null, "select gender");
|
|
176
160
|
};
|
|
177
|
-
var SelectElement = (props) =>
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
161
|
+
var SelectElement = (props) => {
|
|
162
|
+
const handleChange = (value) => {
|
|
163
|
+
if (props.onChange) {
|
|
164
|
+
props.onChange(value);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
return /* @__PURE__ */ import_react5.default.createElement(
|
|
168
|
+
import_antd5.Select,
|
|
169
|
+
{
|
|
170
|
+
labelRender,
|
|
171
|
+
options,
|
|
172
|
+
placeholder: props.placeholder,
|
|
173
|
+
allowClear: true,
|
|
174
|
+
defaultValue: props.defaultValue,
|
|
175
|
+
disabled: props.disabled,
|
|
176
|
+
id: props.name,
|
|
177
|
+
status: props.status,
|
|
178
|
+
style: props.styles,
|
|
179
|
+
className: props.classNames,
|
|
180
|
+
variant: props.variant,
|
|
181
|
+
onChange: handleChange
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
};
|
|
193
185
|
|
|
194
186
|
// src/Components/Button.tsx
|
|
195
187
|
var import_react6 = __toESM(require("react"));
|
package/dist/index.mjs
CHANGED
|
@@ -49,54 +49,38 @@ var PasswordElement = ({ inputData }) => {
|
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
// src/Components/NumberElement.tsx
|
|
52
|
-
import React3
|
|
53
|
-
import { Input as
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const { value: inputValue } = e.target;
|
|
59
|
-
const reg = /^-?\d*(\.\d*)?$/;
|
|
60
|
-
if (reg.test(inputValue) || inputValue === "" || inputValue === "-") {
|
|
61
|
-
onChange(inputValue);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
const handleBlur = () => {
|
|
65
|
-
let valueTemp = value;
|
|
66
|
-
if (value.charAt(value.length - 1) === "." || value === "-") {
|
|
67
|
-
valueTemp = value.slice(0, -1);
|
|
68
|
-
}
|
|
69
|
-
onChange(valueTemp.replace(/0*(\d+)/, "$1"));
|
|
52
|
+
import React3 from "react";
|
|
53
|
+
import { Input as AntInput2 } from "antd";
|
|
54
|
+
var NumberElement = (props) => {
|
|
55
|
+
const handleInputChange = (e) => {
|
|
56
|
+
const newValue = e.target.value.replace(/[^0-9]/g, "");
|
|
57
|
+
props.onChange(newValue);
|
|
70
58
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
Input2,
|
|
59
|
+
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement("label", { htmlFor: props.name }, props.label), /* @__PURE__ */ React3.createElement(
|
|
60
|
+
AntInput2,
|
|
74
61
|
{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
62
|
+
placeholder: props.placeholder,
|
|
63
|
+
addonBefore: props.addonBefore,
|
|
64
|
+
allowClear: true,
|
|
65
|
+
defaultValue: props.defaultValue,
|
|
66
|
+
disabled: props.disabled,
|
|
67
|
+
id: props.name,
|
|
68
|
+
prefix: props.prefix,
|
|
69
|
+
type: props.type,
|
|
70
|
+
status: props.status,
|
|
71
|
+
style: props.styles,
|
|
72
|
+
className: props.classNames,
|
|
73
|
+
variant: props.variant,
|
|
74
|
+
name: props.name,
|
|
75
|
+
onChange: handleInputChange
|
|
80
76
|
}
|
|
81
77
|
));
|
|
82
78
|
};
|
|
83
|
-
var NumberElement = (props) => {
|
|
84
|
-
const [value, setValue] = useState2("");
|
|
85
|
-
return /* @__PURE__ */ React3.createElement(
|
|
86
|
-
NumericInput,
|
|
87
|
-
{
|
|
88
|
-
...props,
|
|
89
|
-
style: { width: 120 },
|
|
90
|
-
value,
|
|
91
|
-
onChange: setValue
|
|
92
|
-
}
|
|
93
|
-
);
|
|
94
|
-
};
|
|
95
79
|
|
|
96
80
|
// src/Components/TextareaElement.tsx
|
|
97
81
|
import React4 from "react";
|
|
98
|
-
import { Flex, Input as
|
|
99
|
-
var { TextArea } =
|
|
82
|
+
import { Flex, Input as Input2 } from "antd";
|
|
83
|
+
var { TextArea } = Input2;
|
|
100
84
|
var TextareaElement = (props) => {
|
|
101
85
|
return /* @__PURE__ */ React4.createElement(Flex, { vertical: true, gap: 32 }, /* @__PURE__ */ React4.createElement(
|
|
102
86
|
TextArea,
|
|
@@ -133,22 +117,30 @@ var labelRender = (props) => {
|
|
|
133
117
|
}
|
|
134
118
|
return /* @__PURE__ */ React5.createElement("span", null, "select gender");
|
|
135
119
|
};
|
|
136
|
-
var SelectElement = (props) =>
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
120
|
+
var SelectElement = (props) => {
|
|
121
|
+
const handleChange = (value) => {
|
|
122
|
+
if (props.onChange) {
|
|
123
|
+
props.onChange(value);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
return /* @__PURE__ */ React5.createElement(
|
|
127
|
+
Select,
|
|
128
|
+
{
|
|
129
|
+
labelRender,
|
|
130
|
+
options,
|
|
131
|
+
placeholder: props.placeholder,
|
|
132
|
+
allowClear: true,
|
|
133
|
+
defaultValue: props.defaultValue,
|
|
134
|
+
disabled: props.disabled,
|
|
135
|
+
id: props.name,
|
|
136
|
+
status: props.status,
|
|
137
|
+
style: props.styles,
|
|
138
|
+
className: props.classNames,
|
|
139
|
+
variant: props.variant,
|
|
140
|
+
onChange: handleChange
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
};
|
|
152
144
|
|
|
153
145
|
// src/Components/Button.tsx
|
|
154
146
|
import React6 from "react";
|
package/package.json
CHANGED