@apexcura/ui-components 0.0.3 → 0.0.5
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 +13 -4
- package/dist/index.d.ts +13 -4
- package/dist/index.js +41 -42
- package/dist/index.mjs +42 -44
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -7,7 +7,7 @@ type ElementType = {
|
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
prefix?: React.ReactNode;
|
|
9
9
|
type?: string;
|
|
10
|
-
value?: string;
|
|
10
|
+
value?: string | number | boolean | undefined;
|
|
11
11
|
status?: "error" | "warning";
|
|
12
12
|
styles?: React.CSSProperties;
|
|
13
13
|
classNames?: string;
|
|
@@ -16,9 +16,13 @@ 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
|
+
interface ElementExecuterProps$1 extends ElementType {
|
|
23
|
+
onChange: (value: string | number | boolean) => void;
|
|
24
|
+
}
|
|
25
|
+
declare const TextElement: (props: ElementExecuterProps$1) => React$1.JSX.Element;
|
|
22
26
|
|
|
23
27
|
interface InputData {
|
|
24
28
|
placeholder?: string;
|
|
@@ -34,8 +38,13 @@ declare const PasswordElement: React$1.FC<PasswordProps>;
|
|
|
34
38
|
|
|
35
39
|
declare const NumberElement: (props: ElementType) => React$1.JSX.Element;
|
|
36
40
|
|
|
37
|
-
|
|
41
|
+
interface ElementExecuterProps extends ElementType {
|
|
42
|
+
onChange: (value: string | number | boolean) => void;
|
|
43
|
+
}
|
|
44
|
+
declare const TextareaElement: (props: ElementExecuterProps) => React$1.JSX.Element;
|
|
38
45
|
|
|
39
46
|
declare const SelectElement: (props: ElementType) => React$1.JSX.Element;
|
|
40
47
|
|
|
41
|
-
|
|
48
|
+
declare const ButtonElement: () => React$1.JSX.Element;
|
|
49
|
+
|
|
50
|
+
export { ButtonElement, NumberElement, PasswordElement, SelectElement, TextElement, TextareaElement };
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ type ElementType = {
|
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
prefix?: React.ReactNode;
|
|
9
9
|
type?: string;
|
|
10
|
-
value?: string;
|
|
10
|
+
value?: string | number | boolean | undefined;
|
|
11
11
|
status?: "error" | "warning";
|
|
12
12
|
styles?: React.CSSProperties;
|
|
13
13
|
classNames?: string;
|
|
@@ -16,9 +16,13 @@ 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
|
+
interface ElementExecuterProps$1 extends ElementType {
|
|
23
|
+
onChange: (value: string | number | boolean) => void;
|
|
24
|
+
}
|
|
25
|
+
declare const TextElement: (props: ElementExecuterProps$1) => React$1.JSX.Element;
|
|
22
26
|
|
|
23
27
|
interface InputData {
|
|
24
28
|
placeholder?: string;
|
|
@@ -34,8 +38,13 @@ declare const PasswordElement: React$1.FC<PasswordProps>;
|
|
|
34
38
|
|
|
35
39
|
declare const NumberElement: (props: ElementType) => React$1.JSX.Element;
|
|
36
40
|
|
|
37
|
-
|
|
41
|
+
interface ElementExecuterProps extends ElementType {
|
|
42
|
+
onChange: (value: string | number | boolean) => void;
|
|
43
|
+
}
|
|
44
|
+
declare const TextareaElement: (props: ElementExecuterProps) => React$1.JSX.Element;
|
|
38
45
|
|
|
39
46
|
declare const SelectElement: (props: ElementType) => React$1.JSX.Element;
|
|
40
47
|
|
|
41
|
-
|
|
48
|
+
declare const ButtonElement: () => React$1.JSX.Element;
|
|
49
|
+
|
|
50
|
+
export { ButtonElement, NumberElement, PasswordElement, SelectElement, TextElement, TextareaElement };
|
package/dist/index.js
CHANGED
|
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
|
+
ButtonElement: () => ButtonElement,
|
|
33
34
|
NumberElement: () => NumberElement,
|
|
34
35
|
PasswordElement: () => PasswordElement,
|
|
35
36
|
SelectElement: () => SelectElement,
|
|
@@ -41,9 +42,6 @@ module.exports = __toCommonJS(src_exports);
|
|
|
41
42
|
// src/Components/TextElement.tsx
|
|
42
43
|
var import_react = __toESM(require("react"));
|
|
43
44
|
var import_antd = require("antd");
|
|
44
|
-
var onHandleChange = ($event) => {
|
|
45
|
-
console.log($event);
|
|
46
|
-
};
|
|
47
45
|
var TextElement = (props) => {
|
|
48
46
|
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
47
|
import_antd.Input,
|
|
@@ -56,13 +54,12 @@ var TextElement = (props) => {
|
|
|
56
54
|
id: props.name,
|
|
57
55
|
prefix: props.prefix,
|
|
58
56
|
type: props.type,
|
|
59
|
-
value: props.value,
|
|
60
57
|
status: props.status,
|
|
61
58
|
style: props.styles,
|
|
62
59
|
className: props.classNames,
|
|
63
60
|
variant: props.variant,
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
name: props.name,
|
|
62
|
+
onChange: (e) => props.onChange(e.target.value)
|
|
66
63
|
}
|
|
67
64
|
));
|
|
68
65
|
};
|
|
@@ -141,64 +138,66 @@ var NumberElement = (props) => {
|
|
|
141
138
|
var import_react4 = __toESM(require("react"));
|
|
142
139
|
var import_antd4 = require("antd");
|
|
143
140
|
var { TextArea } = import_antd4.Input;
|
|
144
|
-
var
|
|
145
|
-
|
|
141
|
+
var TextareaElement = (props) => {
|
|
142
|
+
return /* @__PURE__ */ import_react4.default.createElement(import_antd4.Flex, { vertical: true, gap: 32 }, /* @__PURE__ */ import_react4.default.createElement(
|
|
143
|
+
TextArea,
|
|
144
|
+
{
|
|
145
|
+
placeholder: props.placeholder,
|
|
146
|
+
allowClear: true,
|
|
147
|
+
defaultValue: props.defaultValue,
|
|
148
|
+
disabled: props.disabled,
|
|
149
|
+
id: props.name,
|
|
150
|
+
status: props.status,
|
|
151
|
+
style: props.styles,
|
|
152
|
+
className: props.classNames,
|
|
153
|
+
variant: props.variant,
|
|
154
|
+
name: props.name,
|
|
155
|
+
showCount: true,
|
|
156
|
+
maxLength: props.maxLength,
|
|
157
|
+
onChange: (e) => props.onChange(e.target.value)
|
|
158
|
+
}
|
|
159
|
+
));
|
|
146
160
|
};
|
|
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
161
|
|
|
167
162
|
// src/Components/SelectElement.tsx
|
|
168
163
|
var import_react5 = __toESM(require("react"));
|
|
169
164
|
var import_antd5 = require("antd");
|
|
170
165
|
var options = [
|
|
171
|
-
{
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
value: "female",
|
|
177
|
-
label: "female"
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
value: "other",
|
|
181
|
-
label: "other"
|
|
182
|
-
}
|
|
166
|
+
{ label: "female", value: "female" },
|
|
167
|
+
{ label: "male", value: "male" },
|
|
168
|
+
{ label: "other", value: "other" }
|
|
183
169
|
];
|
|
170
|
+
var labelRender = (props) => {
|
|
171
|
+
const { label, value } = props;
|
|
172
|
+
if (label) {
|
|
173
|
+
return value;
|
|
174
|
+
}
|
|
175
|
+
return /* @__PURE__ */ import_react5.default.createElement("span", null, "select gender");
|
|
176
|
+
};
|
|
184
177
|
var SelectElement = (props) => /* @__PURE__ */ import_react5.default.createElement(
|
|
185
178
|
import_antd5.Select,
|
|
186
179
|
{
|
|
180
|
+
labelRender,
|
|
181
|
+
options,
|
|
187
182
|
placeholder: props.placeholder,
|
|
188
183
|
allowClear: true,
|
|
189
184
|
defaultValue: props.defaultValue,
|
|
190
185
|
disabled: props.disabled,
|
|
191
186
|
id: props.name,
|
|
192
|
-
value: props.value,
|
|
193
187
|
status: props.status,
|
|
194
188
|
style: props.styles,
|
|
195
189
|
className: props.classNames,
|
|
196
|
-
variant: props.variant
|
|
197
|
-
options
|
|
190
|
+
variant: props.variant
|
|
198
191
|
}
|
|
199
192
|
);
|
|
193
|
+
|
|
194
|
+
// src/Components/Button.tsx
|
|
195
|
+
var import_react6 = __toESM(require("react"));
|
|
196
|
+
var import_antd6 = require("antd");
|
|
197
|
+
var ButtonElement = () => /* @__PURE__ */ import_react6.default.createElement(import_antd6.Flex, { gap: "small" }, /* @__PURE__ */ import_react6.default.createElement(import_antd6.Button, { type: "primary" }, "Primary Button"));
|
|
200
198
|
// Annotate the CommonJS export names for ESM import in node:
|
|
201
199
|
0 && (module.exports = {
|
|
200
|
+
ButtonElement,
|
|
202
201
|
NumberElement,
|
|
203
202
|
PasswordElement,
|
|
204
203
|
SelectElement,
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
// src/Components/TextElement.tsx
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Input as AntInput } from "antd";
|
|
4
|
-
var onHandleChange = ($event) => {
|
|
5
|
-
console.log($event);
|
|
6
|
-
};
|
|
7
4
|
var TextElement = (props) => {
|
|
8
5
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("label", { htmlFor: props.name }, props.label), /* @__PURE__ */ React.createElement(
|
|
9
6
|
AntInput,
|
|
@@ -16,13 +13,12 @@ var TextElement = (props) => {
|
|
|
16
13
|
id: props.name,
|
|
17
14
|
prefix: props.prefix,
|
|
18
15
|
type: props.type,
|
|
19
|
-
value: props.value,
|
|
20
16
|
status: props.status,
|
|
21
17
|
style: props.styles,
|
|
22
18
|
className: props.classNames,
|
|
23
19
|
variant: props.variant,
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
name: props.name,
|
|
21
|
+
onChange: (e) => props.onChange(e.target.value)
|
|
26
22
|
}
|
|
27
23
|
));
|
|
28
24
|
};
|
|
@@ -101,63 +97,65 @@ var NumberElement = (props) => {
|
|
|
101
97
|
import React4 from "react";
|
|
102
98
|
import { Flex, Input as Input3 } from "antd";
|
|
103
99
|
var { TextArea } = Input3;
|
|
104
|
-
var
|
|
105
|
-
|
|
100
|
+
var TextareaElement = (props) => {
|
|
101
|
+
return /* @__PURE__ */ React4.createElement(Flex, { vertical: true, gap: 32 }, /* @__PURE__ */ React4.createElement(
|
|
102
|
+
TextArea,
|
|
103
|
+
{
|
|
104
|
+
placeholder: props.placeholder,
|
|
105
|
+
allowClear: true,
|
|
106
|
+
defaultValue: props.defaultValue,
|
|
107
|
+
disabled: props.disabled,
|
|
108
|
+
id: props.name,
|
|
109
|
+
status: props.status,
|
|
110
|
+
style: props.styles,
|
|
111
|
+
className: props.classNames,
|
|
112
|
+
variant: props.variant,
|
|
113
|
+
name: props.name,
|
|
114
|
+
showCount: true,
|
|
115
|
+
maxLength: props.maxLength,
|
|
116
|
+
onChange: (e) => props.onChange(e.target.value)
|
|
117
|
+
}
|
|
118
|
+
));
|
|
106
119
|
};
|
|
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
120
|
|
|
127
121
|
// src/Components/SelectElement.tsx
|
|
128
122
|
import React5 from "react";
|
|
129
|
-
import { Select
|
|
123
|
+
import { Select } from "antd";
|
|
130
124
|
var options = [
|
|
131
|
-
{
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
value: "female",
|
|
137
|
-
label: "female"
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
value: "other",
|
|
141
|
-
label: "other"
|
|
142
|
-
}
|
|
125
|
+
{ label: "female", value: "female" },
|
|
126
|
+
{ label: "male", value: "male" },
|
|
127
|
+
{ label: "other", value: "other" }
|
|
143
128
|
];
|
|
129
|
+
var labelRender = (props) => {
|
|
130
|
+
const { label, value } = props;
|
|
131
|
+
if (label) {
|
|
132
|
+
return value;
|
|
133
|
+
}
|
|
134
|
+
return /* @__PURE__ */ React5.createElement("span", null, "select gender");
|
|
135
|
+
};
|
|
144
136
|
var SelectElement = (props) => /* @__PURE__ */ React5.createElement(
|
|
145
|
-
|
|
137
|
+
Select,
|
|
146
138
|
{
|
|
139
|
+
labelRender,
|
|
140
|
+
options,
|
|
147
141
|
placeholder: props.placeholder,
|
|
148
142
|
allowClear: true,
|
|
149
143
|
defaultValue: props.defaultValue,
|
|
150
144
|
disabled: props.disabled,
|
|
151
145
|
id: props.name,
|
|
152
|
-
value: props.value,
|
|
153
146
|
status: props.status,
|
|
154
147
|
style: props.styles,
|
|
155
148
|
className: props.classNames,
|
|
156
|
-
variant: props.variant
|
|
157
|
-
options
|
|
149
|
+
variant: props.variant
|
|
158
150
|
}
|
|
159
151
|
);
|
|
152
|
+
|
|
153
|
+
// src/Components/Button.tsx
|
|
154
|
+
import React6 from "react";
|
|
155
|
+
import { Button as Button2, Flex as Flex2 } from "antd";
|
|
156
|
+
var ButtonElement = () => /* @__PURE__ */ React6.createElement(Flex2, { gap: "small" }, /* @__PURE__ */ React6.createElement(Button2, { type: "primary" }, "Primary Button"));
|
|
160
157
|
export {
|
|
158
|
+
ButtonElement,
|
|
161
159
|
NumberElement,
|
|
162
160
|
PasswordElement,
|
|
163
161
|
SelectElement,
|
package/package.json
CHANGED