cx 25.5.2 → 25.6.0

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.
@@ -154,6 +154,7 @@ MonthPicker.prototype.range = false;
154
154
  MonthPicker.prototype.startYear = 1980;
155
155
  MonthPicker.prototype.endYear = 2030;
156
156
  MonthPicker.prototype.bufferSize = 15;
157
+ MonthPicker.prototype.hideQuarters = false;
157
158
 
158
159
  // Localization
159
160
  MonthPicker.prototype.maxValueErrorText = "Select {0:d} or before.";
@@ -193,7 +194,7 @@ export class MonthPickerComponent extends VDOM.Component {
193
194
  cursorQuarter: cursor.getMonth() / 3,
194
195
  column: "M",
195
196
  start: widget.startYear,
196
- end: widget.startYear + widget.bufferSize,
197
+ end: Math.min(widget.startYear + widget.bufferSize, widget.endYear),
197
198
  };
198
199
 
199
200
  this.handleMouseDown = this.handleMouseDown.bind(this);
@@ -427,8 +428,9 @@ export class MonthPickerComponent extends VDOM.Component {
427
428
  }
428
429
 
429
430
  render() {
430
- let { data, widget } = this.props.instance;
431
- let { CSS, baseClass, startYear, endYear } = widget;
431
+ let { instance } = this.props;
432
+ let { data, widget } = instance;
433
+ let { CSS, baseClass, startYear, endYear, hideQuarters } = widget;
432
434
 
433
435
  let years = [];
434
436
 
@@ -512,24 +514,26 @@ export class MonthPickerComponent extends VDOM.Component {
512
514
  </td>,
513
515
  );
514
516
  }
515
- row.push(
516
- <th
517
- key={`q${q}`}
518
- className={CSS.state({
519
- cursor:
520
- showCursor &&
521
- this.state.column == "Q" &&
522
- y == this.state.cursorYear &&
523
- q == this.state.cursorQuarter,
524
- })}
525
- data-point={`Y-${y}-Q-${q}`}
526
- onMouseEnter={this.handleMouseEnter}
527
- onMouseDown={this.handleMouseDown}
528
- onMouseUp={this.handleMouseUp}
529
- >
530
- {`Q${q + 1}`}
531
- </th>,
532
- );
517
+
518
+ if (!hideQuarters)
519
+ row.push(
520
+ <th
521
+ key={`q${q}`}
522
+ className={CSS.state({
523
+ cursor:
524
+ showCursor &&
525
+ this.state.column == "Q" &&
526
+ y == this.state.cursorYear &&
527
+ q == this.state.cursorQuarter,
528
+ })}
529
+ data-point={`Y-${y}-Q-${q}`}
530
+ onMouseEnter={this.handleMouseEnter}
531
+ onMouseDown={this.handleMouseDown}
532
+ onMouseUp={this.handleMouseUp}
533
+ >
534
+ {`Q${q + 1}`}
535
+ </th>,
536
+ );
533
537
  rows.push(row);
534
538
  }
535
539
  years.push(rows);