@mpen/react-basic-inputs 0.1.8 → 0.1.9
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/bundle.cjs +5 -1
- package/dist/bundle.mjs +5 -1
- package/dist/components/RadioMenu.d.ts +4 -1
- package/package.json +1 -1
package/dist/bundle.cjs
CHANGED
|
@@ -289,21 +289,25 @@ function RadioMenu(menu) {
|
|
|
289
289
|
return jsxRuntime.jsx("ul", {
|
|
290
290
|
className: menu.className,
|
|
291
291
|
children: fixedOptions.map(((opt, idx) => {
|
|
292
|
-
const {value, text, key, itemClassName, ...rest} = opt;
|
|
292
|
+
const {value, text, key, itemClassName, labelClassName, inputClassName, textClassName, ...rest} = opt;
|
|
293
293
|
const fixedKey = fixer.fix(opt, idx);
|
|
294
294
|
if (menu.value !== undefined) {
|
|
295
295
|
rest.checked = eq(value, menu.value);
|
|
296
296
|
}
|
|
297
297
|
return jsxRuntime.jsx("li", {
|
|
298
298
|
className: itemClassName,
|
|
299
|
+
"aria-disabled": rest.disabled,
|
|
299
300
|
children: jsxRuntime.jsxs("label", {
|
|
301
|
+
className: labelClassName,
|
|
300
302
|
children: [ jsxRuntime.jsx("input", {
|
|
301
303
|
...rest,
|
|
304
|
+
className: inputClassName,
|
|
302
305
|
value: idx,
|
|
303
306
|
onChange,
|
|
304
307
|
name,
|
|
305
308
|
type: "radio"
|
|
306
309
|
}), jsxRuntime.jsx("span", {
|
|
310
|
+
className: textClassName,
|
|
307
311
|
children: text
|
|
308
312
|
}) ]
|
|
309
313
|
})
|
package/dist/bundle.mjs
CHANGED
|
@@ -287,21 +287,25 @@ function RadioMenu(menu) {
|
|
|
287
287
|
return jsx("ul", {
|
|
288
288
|
className: menu.className,
|
|
289
289
|
children: fixedOptions.map(((opt, idx) => {
|
|
290
|
-
const {value, text, key, itemClassName, ...rest} = opt;
|
|
290
|
+
const {value, text, key, itemClassName, labelClassName, inputClassName, textClassName, ...rest} = opt;
|
|
291
291
|
const fixedKey = fixer.fix(opt, idx);
|
|
292
292
|
if (menu.value !== undefined) {
|
|
293
293
|
rest.checked = eq(value, menu.value);
|
|
294
294
|
}
|
|
295
295
|
return jsx("li", {
|
|
296
296
|
className: itemClassName,
|
|
297
|
+
"aria-disabled": rest.disabled,
|
|
297
298
|
children: jsxs("label", {
|
|
299
|
+
className: labelClassName,
|
|
298
300
|
children: [ jsx("input", {
|
|
299
301
|
...rest,
|
|
302
|
+
className: inputClassName,
|
|
300
303
|
value: idx,
|
|
301
304
|
onChange,
|
|
302
305
|
name,
|
|
303
306
|
type: "radio"
|
|
304
307
|
}), jsx("span", {
|
|
308
|
+
className: textClassName,
|
|
305
309
|
children: text
|
|
306
310
|
}) ]
|
|
307
311
|
})
|
|
@@ -7,7 +7,10 @@ export type RadioMenuOption<T extends NonNil> = OverrideProps<'input', {
|
|
|
7
7
|
text: ReactNode;
|
|
8
8
|
key?: Resolvable<Key, [RadioMenuOption<T>, number]>;
|
|
9
9
|
itemClassName?: string;
|
|
10
|
-
|
|
10
|
+
labelClassName?: string;
|
|
11
|
+
inputClassName?: string;
|
|
12
|
+
textClassName?: string;
|
|
13
|
+
}, 'type' | 'children' | 'checked' | 'name' | 'className'>;
|
|
11
14
|
export type RadioMenuChangeEvent<T> = {
|
|
12
15
|
value: T;
|
|
13
16
|
index: number;
|