dce-reactkit 5.0.2 → 5.0.4
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 +37 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/SimpleDateChooser.d.ts +1 -0
- package/dist/cjs/types/components/SimpleMonthChooser.d.ts +23 -0
- package/dist/cjs/types/index.d.ts +3 -2
- package/dist/esm/index.js +34 -9
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/SimpleDateChooser.d.ts +1 -0
- package/dist/esm/types/components/SimpleMonthChooser.d.ts +23 -0
- package/dist/esm/types/index.d.ts +3 -2
- package/dist/index.d.ts +40 -16
- package/package.json +2 -2
- package/src/components/SimpleDateChooser.tsx +31 -22
- package/src/components/SimpleMonthChooser.tsx +98 -0
- package/src/index.ts +4 -0
package/dist/cjs/index.js
CHANGED
|
@@ -1930,7 +1930,7 @@ const SimpleDateChooser = (props) => {
|
|
|
1930
1930
|
/* -------------------------------- Setup ------------------------------- */
|
|
1931
1931
|
/*------------------------------------------------------------------------*/
|
|
1932
1932
|
/* -------------- Props ------------- */
|
|
1933
|
-
const { ariaLabel, name, dontAllowPast, dontAllowFuture, numMonthsToShow, onChange, month, day, year, isDisabled = false, } = props;
|
|
1933
|
+
const { ariaLabel, name, dontAllowPast, dontAllowFuture, numMonthsToShow, onChange, month, day, year, isDisabled = false, hideDay, } = props;
|
|
1934
1934
|
// Get choices
|
|
1935
1935
|
const choices = getChoices({
|
|
1936
1936
|
numMonthsToShow,
|
|
@@ -2016,20 +2016,21 @@ const SimpleDateChooser = (props) => {
|
|
|
2016
2016
|
// Change day, month, and year
|
|
2017
2017
|
onChange(choice.month, choice.days[0], choice.year);
|
|
2018
2018
|
}, disabled: isDisabled }, monthOptions),
|
|
2019
|
-
React__default["default"].createElement("select", { "aria-label": `day for ${ariaLabel}`, className: "custom-select form-select d-inline-block", style: { width: 'auto' }, id: `SimpleDateChooser-${name}-day`, value: day, onChange: (e) => {
|
|
2019
|
+
!hideDay && (React__default["default"].createElement("select", { "aria-label": `day for ${ariaLabel}`, className: "custom-select form-select d-inline-block", style: { width: 'auto' }, id: `SimpleDateChooser-${name}-day`, value: day, onChange: (e) => {
|
|
2020
2020
|
// Only change the day
|
|
2021
2021
|
onChange(month, Number.parseInt(e.target.value, 10), year);
|
|
2022
|
-
}, disabled: isDisabled }, dayOptions)));
|
|
2022
|
+
}, disabled: isDisabled }, dayOptions))));
|
|
2023
2023
|
}
|
|
2024
2024
|
/* --------- DateOutOfRange --------- */
|
|
2025
2025
|
if (view === View.InvalidDate) {
|
|
2026
2026
|
body = (React__default["default"].createElement("div", { className: "SimpleDateChooser-inner-container d-inline-block" },
|
|
2027
2027
|
React__default["default"].createElement("button", { type: "button", className: "btn btn-light", onClick: askToEditInvalidDate, "aria-label": `edit date for ${ariaLabel}` },
|
|
2028
2028
|
dceCommonkit.getMonthName(month).full,
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2029
|
+
!hideDay && (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
2030
|
+
' ',
|
|
2031
|
+
day,
|
|
2032
|
+
dceCommonkit.getOrdinal(day),
|
|
2033
|
+
",")),
|
|
2033
2034
|
' ',
|
|
2034
2035
|
year),
|
|
2035
2036
|
React__default["default"].createElement("button", { type: "button", className: "btn btn-secondary", onClick: askToEditInvalidDate, "aria-label": `edit date for ${ariaLabel}` }, "Edit")));
|
|
@@ -2040,6 +2041,30 @@ const SimpleDateChooser = (props) => {
|
|
|
2040
2041
|
return (React__default["default"].createElement("span", { className: "SimpleDateChooser-outer-container" }, body));
|
|
2041
2042
|
};
|
|
2042
2043
|
|
|
2044
|
+
/**
|
|
2045
|
+
* A very simple, lightweight month chooser
|
|
2046
|
+
* @author Gabe Abrams
|
|
2047
|
+
*/
|
|
2048
|
+
/*------------------------------------------------------------------------*/
|
|
2049
|
+
/* ------------------------------ Component ----------------------------- */
|
|
2050
|
+
/*------------------------------------------------------------------------*/
|
|
2051
|
+
const SimpleMonthChooser = (props) => {
|
|
2052
|
+
/*------------------------------------------------------------------------*/
|
|
2053
|
+
/* -------------------------------- Setup ------------------------------- */
|
|
2054
|
+
/*------------------------------------------------------------------------*/
|
|
2055
|
+
/* -------------- Props ------------- */
|
|
2056
|
+
const { ariaLabel, name, dontAllowPast, dontAllowFuture, numMonthsToShow, onChange, month, year, isDisabled, } = props;
|
|
2057
|
+
/*------------------------------------------------------------------------*/
|
|
2058
|
+
/* ------------------------------- Render ------------------------------- */
|
|
2059
|
+
/*------------------------------------------------------------------------*/
|
|
2060
|
+
/*----------------------------------------*/
|
|
2061
|
+
/* --------------- Main UI -------------- */
|
|
2062
|
+
/*----------------------------------------*/
|
|
2063
|
+
return (React__default["default"].createElement(SimpleDateChooser, { ariaLabel: ariaLabel, name: name, month: month, day: 1, year: year, numMonthsToShow: numMonthsToShow, dontAllowPast: dontAllowPast, dontAllowFuture: dontAllowFuture, isDisabled: isDisabled, hideDay: true, onChange: (newMonth, newDay, newYear) => {
|
|
2064
|
+
onChange(newMonth, newYear);
|
|
2065
|
+
} }));
|
|
2066
|
+
};
|
|
2067
|
+
|
|
2043
2068
|
/**
|
|
2044
2069
|
* A very simple, lightweight time chooser
|
|
2045
2070
|
* @author Gardenia Liu
|
|
@@ -14956,6 +14981,10 @@ Object.defineProperty(exports, 'someAsync', {
|
|
|
14956
14981
|
enumerable: true,
|
|
14957
14982
|
get: function () { return dceCommonkit.someAsync; }
|
|
14958
14983
|
});
|
|
14984
|
+
Object.defineProperty(exports, 'spaceAtCapitals', {
|
|
14985
|
+
enumerable: true,
|
|
14986
|
+
get: function () { return dceCommonkit.spaceAtCapitals; }
|
|
14987
|
+
});
|
|
14959
14988
|
Object.defineProperty(exports, 'startMinWait', {
|
|
14960
14989
|
enumerable: true,
|
|
14961
14990
|
get: function () { return dceCommonkit.startMinWait; }
|
|
@@ -15014,6 +15043,7 @@ exports.ProgressBar = ProgressBar;
|
|
|
15014
15043
|
exports.ProgressBarSize = ProgressBarSize$1;
|
|
15015
15044
|
exports.RadioButton = RadioButton;
|
|
15016
15045
|
exports.SimpleDateChooser = SimpleDateChooser;
|
|
15046
|
+
exports.SimpleMonthChooser = SimpleMonthChooser;
|
|
15017
15047
|
exports.SimpleTimeChooser = SimpleTimeChooser;
|
|
15018
15048
|
exports.TabBox = TabBox;
|
|
15019
15049
|
exports.ToggleSwitch = ToggleSwitch;
|