ar-design 0.2.37 → 0.2.39
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.
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
.ar-radio-wrapper > label > :is(input[type="radio"]):checked + span > .ar-radio {
|
|
22
22
|
background-color: var(--primary);
|
|
23
23
|
box-shadow: 0 0 0 3.5px rgba(var(--primary-rgb), 0.25);
|
|
24
|
+
z-index: 2;
|
|
24
25
|
}
|
|
25
26
|
.ar-radio-wrapper > label > :is(input[type="radio"]):checked + span > .ar-radio::before {
|
|
26
27
|
position: absolute;
|
|
@@ -35,3 +36,16 @@
|
|
|
35
36
|
border-right-color: var(--white);
|
|
36
37
|
border-bottom-color: var(--white);
|
|
37
38
|
}
|
|
39
|
+
|
|
40
|
+
.ar-radio-wrapper > label > span > .trace {
|
|
41
|
+
position: absolute;
|
|
42
|
+
top: 50%;
|
|
43
|
+
left: 50%;
|
|
44
|
+
transform: translate(-50%, -50%);
|
|
45
|
+
display: inline-block;
|
|
46
|
+
content: "";
|
|
47
|
+
width: 1rem;
|
|
48
|
+
height: 1rem;
|
|
49
|
+
border-radius: var(--border-radius-pill);
|
|
50
|
+
z-index: 1;
|
|
51
|
+
}
|
|
@@ -369,9 +369,7 @@ const Table = forwardRef(({ children, title, description, data, columns, actions
|
|
|
369
369
|
c.filters && (React.createElement(Popover, { content: React.createElement("div", null, c.filters.map((filter, fIndex) => {
|
|
370
370
|
const name = typeof c.key !== "object" ? String(c.key) : String(c.key.field);
|
|
371
371
|
return (React.createElement("div", null,
|
|
372
|
-
React.createElement(Checkbox, { ref: (element) => (_filterCheckboxItems.current[fIndex] = element), label: filter.text, name: name, status: "primary",
|
|
373
|
-
// value={filter.value}
|
|
374
|
-
checked: checkboxSelectedParams?.[name]?.includes(String(filter.value)), onChange: async (event) => await handleCheckboxChange(event) })));
|
|
372
|
+
React.createElement(Checkbox, { ref: (element) => (_filterCheckboxItems.current[fIndex] = element), label: filter.text, name: name, status: "primary", value: filter.value, checked: checkboxSelectedParams?.[name]?.includes(String(filter.value)), onChange: async (event) => await handleCheckboxChange(event) })));
|
|
375
373
|
})), windowBlur: true },
|
|
376
374
|
React.createElement(Button, { variant: "borderless", icon: { element: React.createElement(ARIcon, { icon: "Filter", stroke: "var(--primary)", size: 16 }) } })))))));
|
|
377
375
|
})))),
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { IGlobalProps, ISizes } from "../../../libs/types/IGlobalProps";
|
|
3
|
+
import { Status } from "../../../libs/types";
|
|
3
4
|
interface IProps extends Omit<IGlobalProps, "children">, ISizes, Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "size"> {
|
|
4
5
|
label?: string;
|
|
6
|
+
trace?: {
|
|
7
|
+
color: Status;
|
|
8
|
+
};
|
|
5
9
|
}
|
|
6
10
|
export default IProps;
|
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
import React, { forwardRef, useRef } from "react";
|
|
3
3
|
import "../../../assets/css/components/form/radio/radio.css";
|
|
4
4
|
import Utils from "../../../libs/infrastructure/shared/Utils";
|
|
5
|
-
const Radio = forwardRef(({ label, size = "normal", status, border = { radius: "sm" }, upperCase, ...attributes }, ref) => {
|
|
5
|
+
const Radio = forwardRef(({ label, size = "normal", status, border = { radius: "sm" }, trace, upperCase, ...attributes }, ref) => {
|
|
6
6
|
// refs
|
|
7
7
|
const _checkbox = useRef(null);
|
|
8
8
|
const _checkboxClassName = ["ar-radio"];
|
|
9
|
+
const _traceClassName = ["trace", "filled"];
|
|
9
10
|
_checkboxClassName.push(...Utils.GetClassName("filled", status, border, size, undefined, attributes.className));
|
|
11
|
+
if (trace && Object.keys(trace).length > 0)
|
|
12
|
+
_traceClassName.push(trace.color);
|
|
10
13
|
return (React.createElement("div", { className: "ar-radio-wrapper" },
|
|
11
14
|
React.createElement("label", null,
|
|
12
15
|
React.createElement("input", { ref: ref, type: "radio", ...attributes, size: 0, onChange: (event) => {
|
|
@@ -19,6 +22,7 @@ const Radio = forwardRef(({ label, size = "normal", status, border = { radius: "
|
|
|
19
22
|
} }),
|
|
20
23
|
React.createElement("span", null,
|
|
21
24
|
React.createElement("span", { ref: _checkbox, className: _checkboxClassName.map((c) => c).join(" ") }),
|
|
25
|
+
trace && Object.keys(trace).length > 0 && (React.createElement("span", { className: _traceClassName.map((c) => c).join(" ") })),
|
|
22
26
|
label && React.createElement("span", { className: "label" }, upperCase ? label.toUpperCase() : label)))));
|
|
23
27
|
});
|
|
24
28
|
Radio.displayName = "Radio";
|