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/index.d.ts CHANGED
@@ -316,6 +316,7 @@ type Props$g = {
316
316
  numMonthsToShow?: number;
317
317
  dontAllowPast?: boolean;
318
318
  dontAllowFuture?: boolean;
319
+ isDisabled?: boolean;
319
320
  };
320
321
  declare const SimpleDateChooser: React$1.FC<Props$g>;
321
322
 
@@ -336,6 +337,7 @@ type Props$f = {
336
337
  */
337
338
  onChange: (hour: number, minute: number) => void;
338
339
  intervalMin?: number;
340
+ isDisabled?: boolean;
339
341
  };
340
342
  declare const SimpleTimeChooser: React$1.FC<Props$f>;
341
343
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dce-reactkit",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "description": "Shared components for Harvard DCE apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -51,6 +51,8 @@ type Props = {
51
51
  dontAllowPast?: boolean,
52
52
  // If true, the user isn't allowed to select dates in the future
53
53
  dontAllowFuture?: boolean,
54
+ // If true, the chooser is disabled
55
+ isDisabled?: boolean,
54
56
  };
55
57
 
56
58
  /*------------------------------------------------------------------------*/
@@ -291,6 +293,7 @@ const SimpleDateChooser: React.FC<Props> = (props) => {
291
293
  month,
292
294
  day,
293
295
  year,
296
+ isDisabled = false,
294
297
  } = props;
295
298
 
296
299
  // Get choices
@@ -435,6 +438,7 @@ const SimpleDateChooser: React.FC<Props> = (props) => {
435
438
  choice.year,
436
439
  );
437
440
  }}
441
+ disabled={isDisabled}
438
442
  >
439
443
  {monthOptions}
440
444
  </select>
@@ -454,6 +458,7 @@ const SimpleDateChooser: React.FC<Props> = (props) => {
454
458
  year,
455
459
  );
456
460
  }}
461
+ disabled={isDisabled}
457
462
  >
458
463
  {dayOptions}
459
464
  </select>
@@ -32,6 +32,8 @@ type Props = {
32
32
  // Allowed options: 15, 30, 60, defaults to 15
33
33
  // If an unsupported interval is passed in, it will default to 15
34
34
  intervalMin?: number,
35
+ // If true, the chooser is disabled
36
+ isDisabled?: boolean,
35
37
  };
36
38
 
37
39
  /*------------------------------------------------------------------------*/
@@ -61,6 +63,7 @@ const SimpleTimeChooser: React.FC<Props> = (props) => {
61
63
  hour,
62
64
  minute,
63
65
  onChange,
66
+ isDisabled = false,
64
67
  } = props;
65
68
  let {
66
69
  intervalMin = DEFAULT_INTERVAL,
@@ -181,6 +184,7 @@ const SimpleTimeChooser: React.FC<Props> = (props) => {
181
184
  // Notify parent
182
185
  onChange(timeInfo.hours, timeInfo.minutes);
183
186
  }}
187
+ disabled={isDisabled}
184
188
  >
185
189
  {timeOptions}
186
190
  </select>