@dhasdk/simple-ui 1.0.57 → 1.0.59
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 +27 -0
- package/index.js +15 -15
- package/index.mjs +671 -670
- package/lib/RadioGroup.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,6 +53,10 @@ Tooltip
|
|
|
53
53
|
|
|
54
54
|
## Changelog
|
|
55
55
|
|
|
56
|
+
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
|
|
57
|
+
|
|
58
|
+
1.0.58 - removed console.log statement from **`RadioGroup`** component
|
|
59
|
+
|
|
56
60
|
1.0.57 - added **`className`** prop to **`ProgressBar`** to style the outer div that is the container
|
|
57
61
|
for the ProgressBar component.
|
|
58
62
|
|
|
@@ -1396,6 +1400,7 @@ This component takes multiple optional props in addition to any other html attri
|
|
|
1396
1400
|
|
|
1397
1401
|
See **example usage** below for an example of retrieving the selected radio item.
|
|
1398
1402
|
|
|
1403
|
+
The **method** prop allows for a callback method that is called for every change on a radio item in the group. Example below.
|
|
1399
1404
|
|
|
1400
1405
|
Full list of props below
|
|
1401
1406
|
|
|
@@ -1408,6 +1413,7 @@ Full list of props below
|
|
|
1408
1413
|
| classNameInput | **`string`** | Yes | see below | a group of alternate css classes that can be specified by the developer for use in the input element of the component. |
|
|
1409
1414
|
| classNameLabel | **`string`** | Yes | see below | a group of alternate css classes that can be specified by the developer for use in the label element of the component. |
|
|
1410
1415
|
| dataTestId | string | Yes | undefined | A **'data-testid'** value that is applied to the fieldset element that wraps RadioGroup for testing purposes |
|
|
1416
|
+
| 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** |
|
|
1411
1417
|
| options | **`string`** | No | | Array of RadioOption objects that define the options available for selection. |
|
|
1412
1418
|
|
|
1413
1419
|
1. Base CSS Classes
|
|
@@ -1488,6 +1494,27 @@ Example checking radio items for checked state
|
|
|
1488
1494
|
console.log(radio?.checked);
|
|
1489
1495
|
```
|
|
1490
1496
|
|
|
1497
|
+
Using a callback method
|
|
1498
|
+
|
|
1499
|
+
```jsx
|
|
1500
|
+
const radioOptions: RadioOption[] = [
|
|
1501
|
+
{
|
|
1502
|
+
label: 'Option One',
|
|
1503
|
+
value:'item-1',
|
|
1504
|
+
},
|
|
1505
|
+
{
|
|
1506
|
+
label: 'Option Two',
|
|
1507
|
+
value: 'item-2',
|
|
1508
|
+
}
|
|
1509
|
+
]
|
|
1510
|
+
|
|
1511
|
+
<RadioGroup title="Radio Title"
|
|
1512
|
+
options={radioOptions}
|
|
1513
|
+
method={(id, value) => console.log("id/value: " + id + "/" + value)}
|
|
1514
|
+
// would print "id/value 1/item-1" or "id/value 2/item-2"
|
|
1515
|
+
/>
|
|
1516
|
+
```
|
|
1517
|
+
|
|
1491
1518
|
### Dependencies
|
|
1492
1519
|
|
|
1493
1520
|
**_none_**
|