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
|
@@ -11,10 +11,12 @@ type Props = {
|
|
|
11
11
|
title?: string;
|
|
12
12
|
selected?: boolean;
|
|
13
13
|
id?: string;
|
|
14
|
+
className?: string;
|
|
14
15
|
noMarginOnRight?: boolean;
|
|
15
16
|
selectedVariant?: Variant;
|
|
16
17
|
unselectedVariant?: Variant;
|
|
17
18
|
small?: boolean;
|
|
19
|
+
useComplexFormatting?: boolean;
|
|
18
20
|
};
|
|
19
21
|
declare const RadioButton: React.FC<Props>;
|
|
20
22
|
export default RadioButton;
|
package/dist/esm/index.js
CHANGED
|
@@ -1666,24 +1666,28 @@ const RadioButton = (props) => {
|
|
|
1666
1666
|
/* -------------------------------- Setup ------------------------------- */
|
|
1667
1667
|
/*------------------------------------------------------------------------*/
|
|
1668
1668
|
/* -------------- Props ------------- */
|
|
1669
|
-
const { text, onSelected, ariaLabel, title, selected, id, noMarginOnRight, selectedVariant = (isDarkModeOn()
|
|
1669
|
+
const { text, onSelected, ariaLabel, title, selected, id, className, noMarginOnRight, selectedVariant = (isDarkModeOn()
|
|
1670
1670
|
? Variant$1.Light
|
|
1671
1671
|
: Variant$1.Secondary), unselectedVariant = (isDarkModeOn()
|
|
1672
1672
|
? Variant$1.Secondary
|
|
1673
|
-
: Variant$1.Light), small, } = props;
|
|
1673
|
+
: Variant$1.Light), small, useComplexFormatting, } = props;
|
|
1674
1674
|
/*------------------------------------------------------------------------*/
|
|
1675
1675
|
/* ------------------------------- Render ------------------------------- */
|
|
1676
1676
|
/*------------------------------------------------------------------------*/
|
|
1677
1677
|
/*----------------------------------------*/
|
|
1678
1678
|
/* --------------- Main UI -------------- */
|
|
1679
1679
|
/*----------------------------------------*/
|
|
1680
|
-
return (React__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: () => {
|
|
1680
|
+
return (React__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: () => {
|
|
1681
1681
|
if (!selected) {
|
|
1682
1682
|
onSelected();
|
|
1683
1683
|
}
|
|
1684
1684
|
} },
|
|
1685
1685
|
React__default.createElement(FontAwesomeIcon, { icon: selected ? faDotCircle : faCircle$1, className: "me-1" }),
|
|
1686
|
-
|
|
1686
|
+
useComplexFormatting
|
|
1687
|
+
? (React__default.createElement("pre", { className: "ps-2 text-start text-break", style: {
|
|
1688
|
+
whiteSpace: 'pre-wrap',
|
|
1689
|
+
} }, text))
|
|
1690
|
+
: (React__default.createElement("div", { className: "flex-grow-1 text-start text-break ps-2" }, text))));
|
|
1687
1691
|
};
|
|
1688
1692
|
|
|
1689
1693
|
/**
|
|
@@ -1911,7 +1915,13 @@ const SimpleDateChooser = (props) => {
|
|
|
1911
1915
|
}
|
|
1912
1916
|
const monthName = getMonthName(month).full;
|
|
1913
1917
|
// Year is start year +1 for each 12 months
|
|
1914
|
-
|
|
1918
|
+
let yearsToAdd = 0;
|
|
1919
|
+
let monthsOfYearsToAdd = unmoddedMonth;
|
|
1920
|
+
while (monthsOfYearsToAdd > 12) {
|
|
1921
|
+
monthsOfYearsToAdd -= 12;
|
|
1922
|
+
yearsToAdd += 1;
|
|
1923
|
+
}
|
|
1924
|
+
const year = startYear + yearsToAdd;
|
|
1915
1925
|
// Figure out which days are allowed
|
|
1916
1926
|
const days = [];
|
|
1917
1927
|
const numDaysInMonth = (new Date(year, month, 0)).getDate();
|
|
@@ -1962,7 +1972,7 @@ const SimpleDateChooser = (props) => {
|
|
|
1962
1972
|
});
|
|
1963
1973
|
}
|
|
1964
1974
|
});
|
|
1965
|
-
return (React__default.createElement("div", { className: "SimpleDateChooser d-inline-block", "aria-label": `date chooser with selected date: ${month}
|
|
1975
|
+
return (React__default.createElement("div", { className: "SimpleDateChooser d-inline-block", "aria-label": `date chooser with selected date: ${month}/${day}/${year}` },
|
|
1966
1976
|
React__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) => {
|
|
1967
1977
|
const choice = choices[e.target.selectedIndex];
|
|
1968
1978
|
// Change day, month, and year
|