dce-reactkit 3.9.8 → 3.9.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/index.js +16 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/RadioButton.d.ts +2 -0
- package/dist/esm/index.js +16 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/RadioButton.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/CheckboxButton.tsx +15 -15
- package/src/components/RadioButton.tsx +25 -2
- package/src/components/SimpleDateChooser.tsx +8 -2
package/dist/cjs/index.js
CHANGED
|
@@ -1694,24 +1694,28 @@ const RadioButton = (props) => {
|
|
|
1694
1694
|
/* -------------------------------- Setup ------------------------------- */
|
|
1695
1695
|
/*------------------------------------------------------------------------*/
|
|
1696
1696
|
/* -------------- Props ------------- */
|
|
1697
|
-
const { text, onSelected, ariaLabel, title, selected, id, noMarginOnRight, selectedVariant = (isDarkModeOn()
|
|
1697
|
+
const { text, onSelected, ariaLabel, title, selected, id, className, noMarginOnRight, selectedVariant = (isDarkModeOn()
|
|
1698
1698
|
? Variant$1.Light
|
|
1699
1699
|
: Variant$1.Secondary), unselectedVariant = (isDarkModeOn()
|
|
1700
1700
|
? Variant$1.Secondary
|
|
1701
|
-
: Variant$1.Light), small, } = props;
|
|
1701
|
+
: Variant$1.Light), small, useComplexFormatting, } = props;
|
|
1702
1702
|
/*------------------------------------------------------------------------*/
|
|
1703
1703
|
/* ------------------------------- Render ------------------------------- */
|
|
1704
1704
|
/*------------------------------------------------------------------------*/
|
|
1705
1705
|
/*----------------------------------------*/
|
|
1706
1706
|
/* --------------- Main UI -------------- */
|
|
1707
1707
|
/*----------------------------------------*/
|
|
1708
|
-
return (React__default["default"].createElement("button", { type: "button", id: id, title: title, className: `btn btn-${selected ? selectedVariant : unselectedVariant}${selected ? ' selected' : ''}${small ? ' btn-sm' : ''} m-0${noMarginOnRight ? '' : ' me-1'}`, "aria-label": `${ariaLabel}${selected ? ': currently selected' : ''}`, onClick: () => {
|
|
1708
|
+
return (React__default["default"].createElement("button", { type: "button", id: id, title: title, className: `btn btn-${selected ? selectedVariant : unselectedVariant}${selected ? ' selected' : ''}${small ? ' btn-sm' : ''} m-0${noMarginOnRight ? '' : ' me-1'} ${className !== null && className !== void 0 ? className : ''}`, "aria-label": `${ariaLabel}${selected ? ': currently selected' : ''}`, onClick: () => {
|
|
1709
1709
|
if (!selected) {
|
|
1710
1710
|
onSelected();
|
|
1711
1711
|
}
|
|
1712
1712
|
} },
|
|
1713
1713
|
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: selected ? freeSolidSvgIcons.faDotCircle : freeRegularSvgIcons.faCircle, className: "me-1" }),
|
|
1714
|
-
|
|
1714
|
+
useComplexFormatting
|
|
1715
|
+
? (React__default["default"].createElement("pre", { className: "ps-2 text-start text-break", style: {
|
|
1716
|
+
whiteSpace: 'pre-wrap',
|
|
1717
|
+
} }, text))
|
|
1718
|
+
: (React__default["default"].createElement("div", { className: "flex-grow-1 text-start text-break ps-2" }, text))));
|
|
1715
1719
|
};
|
|
1716
1720
|
|
|
1717
1721
|
/**
|
|
@@ -1939,7 +1943,13 @@ const SimpleDateChooser = (props) => {
|
|
|
1939
1943
|
}
|
|
1940
1944
|
const monthName = getMonthName(month).full;
|
|
1941
1945
|
// Year is start year +1 for each 12 months
|
|
1942
|
-
|
|
1946
|
+
let yearsToAdd = 0;
|
|
1947
|
+
let monthsOfYearsToAdd = unmoddedMonth;
|
|
1948
|
+
while (monthsOfYearsToAdd > 12) {
|
|
1949
|
+
monthsOfYearsToAdd -= 12;
|
|
1950
|
+
yearsToAdd += 1;
|
|
1951
|
+
}
|
|
1952
|
+
const year = startYear + yearsToAdd;
|
|
1943
1953
|
// Figure out which days are allowed
|
|
1944
1954
|
const days = [];
|
|
1945
1955
|
const numDaysInMonth = (new Date(year, month, 0)).getDate();
|
|
@@ -1990,7 +2000,7 @@ const SimpleDateChooser = (props) => {
|
|
|
1990
2000
|
});
|
|
1991
2001
|
}
|
|
1992
2002
|
});
|
|
1993
|
-
return (React__default["default"].createElement("div", { className: "SimpleDateChooser d-inline-block", "aria-label": `date chooser with selected date: ${month}
|
|
2003
|
+
return (React__default["default"].createElement("div", { className: "SimpleDateChooser d-inline-block", "aria-label": `date chooser with selected date: ${month}/${day}/${year}` },
|
|
1994
2004
|
React__default["default"].createElement("select", { "aria-label": `month for ${ariaLabel}`, className: "custom-select d-inline-block mr-1", style: { width: 'auto' }, id: `SimpleDateChooser-${name}-month`, value: `${month}-${year}`, onChange: (e) => {
|
|
1995
2005
|
const choice = choices[e.target.selectedIndex];
|
|
1996
2006
|
// Change day, month, and year
|