@dhasdk/simple-ui 1.0.60 → 1.0.61
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/README.md +16 -1
- package/index.js +15 -15
- package/index.mjs +729 -726
- package/lib/RadioGroup.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,6 +53,8 @@ Tooltip
|
|
|
53
53
|
|
|
54
54
|
## Changelog
|
|
55
55
|
|
|
56
|
+
1.0.61 - added **selectedId** prop to **`RadioGroup`** as well as updated documentation with the **RadioOptions** interface
|
|
57
|
+
|
|
56
58
|
1.0.60 - added **classNameSvgLine** and **classNameIcon** props to **`CheckBox`** the former to share duties with and more focus **classNameSvg**. The latter allows for positioning of the checkbox icon if needed.
|
|
57
59
|
|
|
58
60
|
1.0.59 - added **method** property to the **RadioOption** type for RadioGroup, allowing user to pass in a callback method for checked/unchecked state changes
|
|
@@ -1052,7 +1054,7 @@ A reference can also be created and passed to the input component, and the compo
|
|
|
1052
1054
|
|
|
1053
1055
|
### Additional Properties & Attributes
|
|
1054
1056
|
|
|
1055
|
-
This component as mentioned also takes any other property or attribute that a
|
|
1057
|
+
This component as mentioned also takes any other property or attribute that a normal input form field would take, including the **required** property. Setting this property to true will not only requires this input field to have a value for form completion, but also adds an asterisk to the beginning of the label.
|
|
1056
1058
|
|
|
1057
1059
|
### Example Usage
|
|
1058
1060
|
|
|
@@ -1421,6 +1423,7 @@ Full list of props below
|
|
|
1421
1423
|
| dataTestId | string | Yes | undefined | A **'data-testid'** value that is applied to the fieldset element that wraps RadioGroup for testing purposes |
|
|
1422
1424
|
| method | (id: string, value: string) => void | Yes | undefined | A callback method that is called anytime a radio item is clicked on. The value **`method={(id, value) => console.log("id/value: " + id + "/" + value)}`** might print something like **id/value: 2/value-2** |
|
|
1423
1425
|
| options | **`string`** | No | | Array of RadioOption objects that define the options available for selection. |
|
|
1426
|
+
| selectedId | **`string`** | Yes | | A string value matching one of the passed in **`id`** values in the options array. This **`selectedId`** will be pre-selected. |
|
|
1424
1427
|
|
|
1425
1428
|
1. Base CSS Classes
|
|
1426
1429
|
|
|
@@ -1433,6 +1436,18 @@ Full list of props below
|
|
|
1433
1436
|
**`appearance-none w-4 h-4 rounded-[50%] border border-black bg-clip-content checked:bg-black checked:p-[2.5px] checked:border-black`**
|
|
1434
1437
|
|
|
1435
1438
|
|
|
1439
|
+
2. Options interface
|
|
1440
|
+
|
|
1441
|
+
```ts
|
|
1442
|
+
export type RadioOption = {
|
|
1443
|
+
label: string;
|
|
1444
|
+
value: string;
|
|
1445
|
+
id: string;
|
|
1446
|
+
disabled?: boolean;
|
|
1447
|
+
};
|
|
1448
|
+
```
|
|
1449
|
+
|
|
1450
|
+
|
|
1436
1451
|
### Example Usage
|
|
1437
1452
|
|
|
1438
1453
|
Basic RadioGroup
|