@apexcura/ui-components 0.0.7-Beta0 → 0.0.7-Beta2
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 +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +117 -2
- package/dist/index.mjs +114 -2
- 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 | number | boolean |
|
|
10
|
+
value?: string | number | boolean | any[];
|
|
11
11
|
status?: "error" | "warning";
|
|
12
12
|
styles?: React.CSSProperties;
|
|
13
13
|
classNames?: string;
|
|
@@ -48,6 +48,12 @@ declare const TextareaElement: (props: ElementExecuterProps) => React$1.JSX.Elem
|
|
|
48
48
|
|
|
49
49
|
declare const SelectElement: (props: ElementType) => React$1.JSX.Element;
|
|
50
50
|
|
|
51
|
+
declare const RadioElement: (props: ElementType) => void;
|
|
52
|
+
|
|
53
|
+
declare const CheckboxElement: (props: ElementType) => React$1.JSX.Element;
|
|
54
|
+
|
|
55
|
+
declare const CkEditor: React$1.FC;
|
|
56
|
+
|
|
51
57
|
declare const ButtonElement: () => React$1.JSX.Element;
|
|
52
58
|
|
|
53
|
-
export { ButtonElement, NumberElement, PasswordElement, SelectElement, TextElement, TextareaElement };
|
|
59
|
+
export { ButtonElement, CheckboxElement, CkEditor, NumberElement, PasswordElement, RadioElement, 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 | number | boolean |
|
|
10
|
+
value?: string | number | boolean | any[];
|
|
11
11
|
status?: "error" | "warning";
|
|
12
12
|
styles?: React.CSSProperties;
|
|
13
13
|
classNames?: string;
|
|
@@ -48,6 +48,12 @@ declare const TextareaElement: (props: ElementExecuterProps) => React$1.JSX.Elem
|
|
|
48
48
|
|
|
49
49
|
declare const SelectElement: (props: ElementType) => React$1.JSX.Element;
|
|
50
50
|
|
|
51
|
+
declare const RadioElement: (props: ElementType) => void;
|
|
52
|
+
|
|
53
|
+
declare const CheckboxElement: (props: ElementType) => React$1.JSX.Element;
|
|
54
|
+
|
|
55
|
+
declare const CkEditor: React$1.FC;
|
|
56
|
+
|
|
51
57
|
declare const ButtonElement: () => React$1.JSX.Element;
|
|
52
58
|
|
|
53
|
-
export { ButtonElement, NumberElement, PasswordElement, SelectElement, TextElement, TextareaElement };
|
|
59
|
+
export { ButtonElement, CheckboxElement, CkEditor, NumberElement, PasswordElement, RadioElement, SelectElement, TextElement, TextareaElement };
|
package/dist/index.js
CHANGED
|
@@ -31,8 +31,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
33
|
ButtonElement: () => ButtonElement,
|
|
34
|
+
CheckboxElement: () => CheckboxElement,
|
|
35
|
+
CkEditor: () => CkEditor,
|
|
34
36
|
NumberElement: () => NumberElement,
|
|
35
37
|
PasswordElement: () => PasswordElement,
|
|
38
|
+
RadioElement: () => RadioElement,
|
|
36
39
|
SelectElement: () => SelectElement,
|
|
37
40
|
TextElement: () => TextElement,
|
|
38
41
|
TextareaElement: () => TextareaElement
|
|
@@ -183,15 +186,127 @@ var SelectElement = (props) => {
|
|
|
183
186
|
);
|
|
184
187
|
};
|
|
185
188
|
|
|
186
|
-
// src/Components/
|
|
189
|
+
// src/Components/RadioElement.tsx
|
|
187
190
|
var import_react6 = __toESM(require("react"));
|
|
188
191
|
var import_antd6 = require("antd");
|
|
189
|
-
var
|
|
192
|
+
var RadioElement = (props) => {
|
|
193
|
+
const handleChange = (e) => {
|
|
194
|
+
if (props && props.onChange) {
|
|
195
|
+
props.onChange(e.target.value);
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
/* @__PURE__ */ import_react6.default.createElement(import_antd6.Radio.Group, { name: "radiogroup", defaultValue: 1 }, /* @__PURE__ */ import_react6.default.createElement(import_antd6.Radio, { value: 1, onChange: handleChange }, "A"), /* @__PURE__ */ import_react6.default.createElement(import_antd6.Radio, { value: 2, onChange: handleChange }, "B"), /* @__PURE__ */ import_react6.default.createElement(import_antd6.Radio, { value: 3, onChange: handleChange }, "C"), /* @__PURE__ */ import_react6.default.createElement(import_antd6.Radio, { value: 4, onChange: handleChange }, "D"));
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
// src/Components/Checkbox.tsx
|
|
202
|
+
var import_react7 = __toESM(require("react"));
|
|
203
|
+
var import_antd7 = require("antd");
|
|
204
|
+
var CheckboxGroup = import_antd7.Checkbox.Group;
|
|
205
|
+
var plainOptions = ["Apple", "Pear", "Orange"];
|
|
206
|
+
var defaultCheckedList = [];
|
|
207
|
+
var CheckboxElement = (props) => {
|
|
208
|
+
const [checkedList, setCheckedList] = (0, import_react7.useState)(defaultCheckedList);
|
|
209
|
+
const checkAll = plainOptions.length === checkedList.length;
|
|
210
|
+
const indeterminate = checkedList.length > 0 && checkedList.length < plainOptions.length;
|
|
211
|
+
const handleChange = (list) => {
|
|
212
|
+
setCheckedList(list);
|
|
213
|
+
if (props.onChange) {
|
|
214
|
+
props.onChange(checkedList);
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
const onHandleAllChanges = (e) => {
|
|
218
|
+
setCheckedList(e.target.checked ? plainOptions : []);
|
|
219
|
+
if (props.onChange) {
|
|
220
|
+
props.onChange(checkedList);
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, /* @__PURE__ */ import_react7.default.createElement(
|
|
224
|
+
import_antd7.Checkbox,
|
|
225
|
+
{
|
|
226
|
+
disabled: props.disabled,
|
|
227
|
+
id: props.name,
|
|
228
|
+
style: props.styles,
|
|
229
|
+
className: props.classNames,
|
|
230
|
+
indeterminate,
|
|
231
|
+
onChange: onHandleAllChanges,
|
|
232
|
+
checked: checkAll
|
|
233
|
+
},
|
|
234
|
+
"Check all"
|
|
235
|
+
), /* @__PURE__ */ import_react7.default.createElement(import_antd7.Divider, null), /* @__PURE__ */ import_react7.default.createElement(
|
|
236
|
+
CheckboxGroup,
|
|
237
|
+
{
|
|
238
|
+
disabled: props.disabled,
|
|
239
|
+
style: props.styles,
|
|
240
|
+
className: props.classNames,
|
|
241
|
+
options: plainOptions,
|
|
242
|
+
value: checkedList,
|
|
243
|
+
onChange: handleChange
|
|
244
|
+
}
|
|
245
|
+
));
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
// src/Components/CkEditor.tsx
|
|
249
|
+
var import_react8 = require("react");
|
|
250
|
+
var import_tinymce_react = require("@tinymce/tinymce-react");
|
|
251
|
+
var import_react9 = __toESM(require("react"));
|
|
252
|
+
var CkEditor = () => {
|
|
253
|
+
const editorRef = (0, import_react8.useRef)(null);
|
|
254
|
+
const log = () => {
|
|
255
|
+
if (editorRef.current) {
|
|
256
|
+
console.log(editorRef.current.getContent());
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
return /* @__PURE__ */ import_react9.default.createElement("div", null, /* @__PURE__ */ import_react9.default.createElement(
|
|
260
|
+
import_tinymce_react.Editor,
|
|
261
|
+
{
|
|
262
|
+
apiKey: "your-api-key",
|
|
263
|
+
onInit: (_evt, editor) => {
|
|
264
|
+
if (editor)
|
|
265
|
+
editorRef.current = editor;
|
|
266
|
+
},
|
|
267
|
+
initialValue: "<p>This is the initial content of the editor.</p>",
|
|
268
|
+
init: {
|
|
269
|
+
height: 500,
|
|
270
|
+
menubar: false,
|
|
271
|
+
plugins: [
|
|
272
|
+
"advlist",
|
|
273
|
+
"autolink",
|
|
274
|
+
"lists",
|
|
275
|
+
"link",
|
|
276
|
+
"image",
|
|
277
|
+
"charmap",
|
|
278
|
+
"preview",
|
|
279
|
+
"anchor",
|
|
280
|
+
"searchreplace",
|
|
281
|
+
"visualblocks",
|
|
282
|
+
"code",
|
|
283
|
+
"fullscreen",
|
|
284
|
+
"insertdatetime",
|
|
285
|
+
"media",
|
|
286
|
+
"table",
|
|
287
|
+
"code",
|
|
288
|
+
"help",
|
|
289
|
+
"wordcount"
|
|
290
|
+
],
|
|
291
|
+
toolbar: "undo redo | blocks | bold italic forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help",
|
|
292
|
+
content_style: "body { font-family:Helvetica,Arial,sans-serif; font-size:14px }"
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
), /* @__PURE__ */ import_react9.default.createElement("button", { onClick: log }, "Log editor content"));
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
// src/Components/Button.tsx
|
|
299
|
+
var import_react10 = __toESM(require("react"));
|
|
300
|
+
var import_antd8 = require("antd");
|
|
301
|
+
var ButtonElement = () => /* @__PURE__ */ import_react10.default.createElement(import_antd8.Flex, { gap: "small" }, /* @__PURE__ */ import_react10.default.createElement(import_antd8.Button, { type: "primary" }, "Primary Button"));
|
|
190
302
|
// Annotate the CommonJS export names for ESM import in node:
|
|
191
303
|
0 && (module.exports = {
|
|
192
304
|
ButtonElement,
|
|
305
|
+
CheckboxElement,
|
|
306
|
+
CkEditor,
|
|
193
307
|
NumberElement,
|
|
194
308
|
PasswordElement,
|
|
309
|
+
RadioElement,
|
|
195
310
|
SelectElement,
|
|
196
311
|
TextElement,
|
|
197
312
|
TextareaElement
|
package/dist/index.mjs
CHANGED
|
@@ -142,14 +142,126 @@ var SelectElement = (props) => {
|
|
|
142
142
|
);
|
|
143
143
|
};
|
|
144
144
|
|
|
145
|
-
// src/Components/
|
|
145
|
+
// src/Components/RadioElement.tsx
|
|
146
146
|
import React6 from "react";
|
|
147
|
+
import { Radio } from "antd";
|
|
148
|
+
var RadioElement = (props) => {
|
|
149
|
+
const handleChange = (e) => {
|
|
150
|
+
if (props && props.onChange) {
|
|
151
|
+
props.onChange(e.target.value);
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
/* @__PURE__ */ React6.createElement(Radio.Group, { name: "radiogroup", defaultValue: 1 }, /* @__PURE__ */ React6.createElement(Radio, { value: 1, onChange: handleChange }, "A"), /* @__PURE__ */ React6.createElement(Radio, { value: 2, onChange: handleChange }, "B"), /* @__PURE__ */ React6.createElement(Radio, { value: 3, onChange: handleChange }, "C"), /* @__PURE__ */ React6.createElement(Radio, { value: 4, onChange: handleChange }, "D"));
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
// src/Components/Checkbox.tsx
|
|
158
|
+
import React7, { useState as useState2 } from "react";
|
|
159
|
+
import { Checkbox, Divider } from "antd";
|
|
160
|
+
var CheckboxGroup = Checkbox.Group;
|
|
161
|
+
var plainOptions = ["Apple", "Pear", "Orange"];
|
|
162
|
+
var defaultCheckedList = [];
|
|
163
|
+
var CheckboxElement = (props) => {
|
|
164
|
+
const [checkedList, setCheckedList] = useState2(defaultCheckedList);
|
|
165
|
+
const checkAll = plainOptions.length === checkedList.length;
|
|
166
|
+
const indeterminate = checkedList.length > 0 && checkedList.length < plainOptions.length;
|
|
167
|
+
const handleChange = (list) => {
|
|
168
|
+
setCheckedList(list);
|
|
169
|
+
if (props.onChange) {
|
|
170
|
+
props.onChange(checkedList);
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
const onHandleAllChanges = (e) => {
|
|
174
|
+
setCheckedList(e.target.checked ? plainOptions : []);
|
|
175
|
+
if (props.onChange) {
|
|
176
|
+
props.onChange(checkedList);
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(
|
|
180
|
+
Checkbox,
|
|
181
|
+
{
|
|
182
|
+
disabled: props.disabled,
|
|
183
|
+
id: props.name,
|
|
184
|
+
style: props.styles,
|
|
185
|
+
className: props.classNames,
|
|
186
|
+
indeterminate,
|
|
187
|
+
onChange: onHandleAllChanges,
|
|
188
|
+
checked: checkAll
|
|
189
|
+
},
|
|
190
|
+
"Check all"
|
|
191
|
+
), /* @__PURE__ */ React7.createElement(Divider, null), /* @__PURE__ */ React7.createElement(
|
|
192
|
+
CheckboxGroup,
|
|
193
|
+
{
|
|
194
|
+
disabled: props.disabled,
|
|
195
|
+
style: props.styles,
|
|
196
|
+
className: props.classNames,
|
|
197
|
+
options: plainOptions,
|
|
198
|
+
value: checkedList,
|
|
199
|
+
onChange: handleChange
|
|
200
|
+
}
|
|
201
|
+
));
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
// src/Components/CkEditor.tsx
|
|
205
|
+
import { useRef } from "react";
|
|
206
|
+
import { Editor } from "@tinymce/tinymce-react";
|
|
207
|
+
import React8 from "react";
|
|
208
|
+
var CkEditor = () => {
|
|
209
|
+
const editorRef = useRef(null);
|
|
210
|
+
const log = () => {
|
|
211
|
+
if (editorRef.current) {
|
|
212
|
+
console.log(editorRef.current.getContent());
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
return /* @__PURE__ */ React8.createElement("div", null, /* @__PURE__ */ React8.createElement(
|
|
216
|
+
Editor,
|
|
217
|
+
{
|
|
218
|
+
apiKey: "your-api-key",
|
|
219
|
+
onInit: (_evt, editor) => {
|
|
220
|
+
if (editor)
|
|
221
|
+
editorRef.current = editor;
|
|
222
|
+
},
|
|
223
|
+
initialValue: "<p>This is the initial content of the editor.</p>",
|
|
224
|
+
init: {
|
|
225
|
+
height: 500,
|
|
226
|
+
menubar: false,
|
|
227
|
+
plugins: [
|
|
228
|
+
"advlist",
|
|
229
|
+
"autolink",
|
|
230
|
+
"lists",
|
|
231
|
+
"link",
|
|
232
|
+
"image",
|
|
233
|
+
"charmap",
|
|
234
|
+
"preview",
|
|
235
|
+
"anchor",
|
|
236
|
+
"searchreplace",
|
|
237
|
+
"visualblocks",
|
|
238
|
+
"code",
|
|
239
|
+
"fullscreen",
|
|
240
|
+
"insertdatetime",
|
|
241
|
+
"media",
|
|
242
|
+
"table",
|
|
243
|
+
"code",
|
|
244
|
+
"help",
|
|
245
|
+
"wordcount"
|
|
246
|
+
],
|
|
247
|
+
toolbar: "undo redo | blocks | bold italic forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help",
|
|
248
|
+
content_style: "body { font-family:Helvetica,Arial,sans-serif; font-size:14px }"
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
), /* @__PURE__ */ React8.createElement("button", { onClick: log }, "Log editor content"));
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
// src/Components/Button.tsx
|
|
255
|
+
import React9 from "react";
|
|
147
256
|
import { Button as Button2, Flex as Flex2 } from "antd";
|
|
148
|
-
var ButtonElement = () => /* @__PURE__ */
|
|
257
|
+
var ButtonElement = () => /* @__PURE__ */ React9.createElement(Flex2, { gap: "small" }, /* @__PURE__ */ React9.createElement(Button2, { type: "primary" }, "Primary Button"));
|
|
149
258
|
export {
|
|
150
259
|
ButtonElement,
|
|
260
|
+
CheckboxElement,
|
|
261
|
+
CkEditor,
|
|
151
262
|
NumberElement,
|
|
152
263
|
PasswordElement,
|
|
264
|
+
RadioElement,
|
|
153
265
|
SelectElement,
|
|
154
266
|
TextElement,
|
|
155
267
|
TextareaElement
|