dce-reactkit 4.2.0 → 4.2.1

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.
@@ -20,6 +20,7 @@ type Props = {
20
20
  numMonthsToShow?: number;
21
21
  dontAllowPast?: boolean;
22
22
  dontAllowFuture?: boolean;
23
+ isDisabled?: boolean;
23
24
  };
24
25
  declare const SimpleDateChooser: React.FC<Props>;
25
26
  export default SimpleDateChooser;
@@ -15,6 +15,7 @@ type Props = {
15
15
  */
16
16
  onChange: (hour: number, minute: number) => void;
17
17
  intervalMin?: number;
18
+ isDisabled?: boolean;
18
19
  };
19
20
  declare const SimpleTimeChooser: React.FC<Props>;
20
21
  export default SimpleTimeChooser;
package/dist/esm/index.js CHANGED
@@ -2789,7 +2789,7 @@ const SimpleDateChooser = (props) => {
2789
2789
  /* -------------------------------- Setup ------------------------------- */
2790
2790
  /*------------------------------------------------------------------------*/
2791
2791
  /* -------------- Props ------------- */
2792
- const { ariaLabel, name, dontAllowPast, dontAllowFuture, numMonthsToShow, onChange, month, day, year, } = props;
2792
+ const { ariaLabel, name, dontAllowPast, dontAllowFuture, numMonthsToShow, onChange, month, day, year, isDisabled = false, } = props;
2793
2793
  // Get choices
2794
2794
  const choices = getChoices({
2795
2795
  numMonthsToShow,
@@ -2874,11 +2874,11 @@ const SimpleDateChooser = (props) => {
2874
2874
  const choice = choices[e.target.selectedIndex];
2875
2875
  // Change day, month, and year
2876
2876
  onChange(choice.month, choice.days[0], choice.year);
2877
- } }, monthOptions),
2877
+ }, disabled: isDisabled }, monthOptions),
2878
2878
  React__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) => {
2879
2879
  // Only change the day
2880
2880
  onChange(month, Number.parseInt(e.target.value, 10), year);
2881
- } }, dayOptions)));
2881
+ }, disabled: isDisabled }, dayOptions)));
2882
2882
  }
2883
2883
  /* --------- DateOutOfRange --------- */
2884
2884
  if (view === View.InvalidDate) {
@@ -2936,7 +2936,7 @@ const SimpleTimeChooser = (props) => {
2936
2936
  /* -------------------------------- Setup ------------------------------- */
2937
2937
  /*------------------------------------------------------------------------*/
2938
2938
  /* -------------- Props ------------- */
2939
- const { ariaLabel, name, hour, minute, onChange, } = props;
2939
+ const { ariaLabel, name, hour, minute, onChange, isDisabled = false, } = props;
2940
2940
  let { intervalMin = DEFAULT_INTERVAL, } = props;
2941
2941
  // Use default interval if not supported
2942
2942
  if (!ALLOWED_INTERVALS.includes(intervalMin)) {
@@ -3015,7 +3015,7 @@ const SimpleTimeChooser = (props) => {
3015
3015
  const timeInfo = convertMinSinceMidnightToHoursAndMin(newTime);
3016
3016
  // Notify parent
3017
3017
  onChange(timeInfo.hours, timeInfo.minutes);
3018
- } }, timeOptions)));
3018
+ }, disabled: isDisabled }, timeOptions)));
3019
3019
  };
3020
3020
 
3021
3021
  /**