@cloudtower/eagle 490.0.9 → 490.0.10
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/cjs/core/Checkbox/index.js +28 -2
- package/dist/cjs/core/Radio/index.js +30 -6
- package/dist/cjs/stats1.html +1 -1
- package/dist/components.css +1477 -1477
- package/dist/esm/core/Checkbox/index.js +29 -3
- package/dist/esm/core/Radio/index.js +31 -7
- package/dist/esm/stats1.html +1 -1
- package/dist/linaria.merged.scss +2101 -2101
- package/dist/style.css +1477 -1477
- package/package.json +4 -4
|
@@ -43,13 +43,39 @@ var __objRest = (source, exclude) => {
|
|
|
43
43
|
return target;
|
|
44
44
|
};
|
|
45
45
|
const Checkbox = (_a) => {
|
|
46
|
-
var _b = _a, {
|
|
46
|
+
var _b = _a, {
|
|
47
|
+
className,
|
|
48
|
+
children,
|
|
49
|
+
description,
|
|
50
|
+
compact,
|
|
51
|
+
"data-testid": dataTestId
|
|
52
|
+
} = _b, props = __objRest(_b, [
|
|
53
|
+
"className",
|
|
54
|
+
"children",
|
|
55
|
+
"description",
|
|
56
|
+
"compact",
|
|
57
|
+
"data-testid"
|
|
58
|
+
]);
|
|
59
|
+
const markerRef = React.useCallback(
|
|
60
|
+
(node) => {
|
|
61
|
+
if (node) {
|
|
62
|
+
const label = node.closest("label.ant-checkbox-wrapper");
|
|
63
|
+
if (label) {
|
|
64
|
+
const testId = dataTestId || props.value;
|
|
65
|
+
if (testId) {
|
|
66
|
+
label.setAttribute("data-testid", String(testId));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
[dataTestId, props.value]
|
|
72
|
+
);
|
|
47
73
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
48
74
|
antd.Checkbox,
|
|
49
75
|
__spreadProps(__spreadValues({}, props), {
|
|
50
|
-
"data-testid": props["data-testid"] || props.value,
|
|
51
76
|
className: cs__default.default(className, checkbox_style.CheckboxStyle, compact && "compact")
|
|
52
77
|
}),
|
|
78
|
+
(dataTestId || props.value) && /* @__PURE__ */ React__default.default.createElement("span", { ref: markerRef, style: { display: "none" } }),
|
|
53
79
|
children ? /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement("div", { className: cs__default.default("main", index.Typo.Label.l2_regular) }, children), description ? /* @__PURE__ */ React__default.default.createElement("div", { className: cs__default.default("sub", index.Typo.Label.l4_regular) }, description) : null) : null
|
|
54
80
|
);
|
|
55
81
|
};
|
|
@@ -57,17 +57,29 @@ const Radio = _a => {
|
|
|
57
57
|
description
|
|
58
58
|
} = props;
|
|
59
59
|
const context = React__default.default.useContext(KitRadioGroupContext);
|
|
60
|
+
const markerRef = React.useCallback(node => {
|
|
61
|
+
if (node && dataTestId) {
|
|
62
|
+
const label = node.closest("label.ant-radio-wrapper");
|
|
63
|
+
if (label) {
|
|
64
|
+
label.setAttribute("data-testid", dataTestId);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}, [dataTestId]);
|
|
60
68
|
if (description) {
|
|
61
69
|
children = /* @__PURE__ */React__default.default.createElement(React__default.default.Fragment, null, children, /* @__PURE__ */React__default.default.createElement("div", {
|
|
62
70
|
className: core.cx("radio-description", index.Typo.Label.l4_regular)
|
|
63
71
|
}, description));
|
|
64
72
|
}
|
|
65
|
-
return /* @__PURE__ */React__default.default.createElement(
|
|
73
|
+
return /* @__PURE__ */React__default.default.createElement(antd.Radio, __spreadValues({
|
|
66
74
|
className: core.cx(className, RadioStyle, compact && "compact"),
|
|
67
75
|
checked: checked || false,
|
|
68
|
-
"data-testid": dataTestId,
|
|
69
76
|
"data-test": context.name ? `${context.name}-${String(props.value)}` : String(props.value)
|
|
70
|
-
}, props),
|
|
77
|
+
}, props), dataTestId && /* @__PURE__ */React__default.default.createElement("span", {
|
|
78
|
+
ref: markerRef,
|
|
79
|
+
style: {
|
|
80
|
+
display: "none"
|
|
81
|
+
}
|
|
82
|
+
}), children ? children : null);
|
|
71
83
|
};
|
|
72
84
|
const RadioGroup = _c => {
|
|
73
85
|
var _d = _c,
|
|
@@ -107,6 +119,14 @@ const RadioButton = _e => {
|
|
|
107
119
|
const [inputValue, setInputValue] = React.useState(initialValue);
|
|
108
120
|
const radioButtonValue = type === "input" || type === "input-number" ? inputValue : props.value;
|
|
109
121
|
const radioGroupContext = React__default.default.useContext(KitRadioGroupContext);
|
|
122
|
+
const markerRef = React.useCallback(node => {
|
|
123
|
+
if (node && dataTestId) {
|
|
124
|
+
const label = node.closest("label.ant-radio-button-wrapper");
|
|
125
|
+
if (label) {
|
|
126
|
+
label.setAttribute("data-testid", dataTestId);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}, [dataTestId]);
|
|
110
130
|
const renderInput = () => {
|
|
111
131
|
const inputDisabled = props.disabled || (radioGroupContext == null ? void 0 : radioGroupContext.disabled);
|
|
112
132
|
if (type === "input-number") return /* @__PURE__ */React__default.default.createElement(antd.InputNumber, {
|
|
@@ -144,9 +164,13 @@ const RadioButton = _e => {
|
|
|
144
164
|
};
|
|
145
165
|
return /* @__PURE__ */React__default.default.createElement(antd.Radio.Button, __spreadValues({
|
|
146
166
|
className: core.cx(className, RadioButtonStyle),
|
|
147
|
-
value: radioButtonValue
|
|
148
|
-
|
|
149
|
-
|
|
167
|
+
value: radioButtonValue
|
|
168
|
+
}, props), dataTestId && /* @__PURE__ */React__default.default.createElement("span", {
|
|
169
|
+
ref: markerRef,
|
|
170
|
+
style: {
|
|
171
|
+
display: "none"
|
|
172
|
+
}
|
|
173
|
+
}), renderChildren());
|
|
150
174
|
};
|
|
151
175
|
var Radio$1 = Radio;
|
|
152
176
|
|