cx 26.4.4 → 26.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.
Files changed (90) hide show
  1. package/build/charts/axis/Axis.d.ts +8 -0
  2. package/build/charts/axis/Axis.d.ts.map +1 -1
  3. package/build/charts/axis/Axis.js +18 -1
  4. package/build/charts/axis/TimeAxis.js +1 -0
  5. package/build/locale/de-de.js +1 -0
  6. package/build/locale/en-us.js +1 -0
  7. package/build/locale/es-es.js +1 -0
  8. package/build/locale/fr-fr.js +1 -0
  9. package/build/locale/nl-nl.js +1 -0
  10. package/build/locale/pt-pt.js +1 -0
  11. package/build/locale/sr-latn-ba.js +1 -0
  12. package/build/ui/Format.d.ts.map +1 -1
  13. package/build/ui/Format.js +26 -2
  14. package/build/util/Format.d.ts.map +1 -1
  15. package/build/util/Format.js +6 -0
  16. package/build/util/date/dateQuarter.d.ts +7 -0
  17. package/build/util/date/dateQuarter.d.ts.map +1 -0
  18. package/build/util/date/dateQuarter.js +8 -0
  19. package/build/util/date/dayBefore.d.ts +12 -0
  20. package/build/util/date/dayBefore.d.ts.map +1 -0
  21. package/build/util/date/dayBefore.js +15 -0
  22. package/build/util/date/index.d.ts +2 -0
  23. package/build/util/date/index.d.ts.map +1 -1
  24. package/build/util/date/index.js +2 -0
  25. package/build/widgets/form/DateTimePicker.d.ts.map +1 -1
  26. package/build/widgets/form/DateTimePicker.js +53 -31
  27. package/build/widgets/form/Field.d.ts.map +1 -1
  28. package/build/widgets/form/Field.js +2 -1
  29. package/build/widgets/form/LookupField.d.ts +6 -0
  30. package/build/widgets/form/LookupField.d.ts.map +1 -1
  31. package/build/widgets/form/LookupField.js +12 -0
  32. package/build/widgets/form/Wheel.d.ts +8 -0
  33. package/build/widgets/form/Wheel.d.ts.map +1 -1
  34. package/build/widgets/form/Wheel.js +30 -7
  35. package/build/widgets/grid/Grid.d.ts +6 -1
  36. package/build/widgets/grid/Grid.d.ts.map +1 -1
  37. package/build/widgets/grid/Grid.js +3 -2
  38. package/dist/charts.css +6 -0
  39. package/dist/charts.js +18 -1
  40. package/dist/manifest.js +880 -871
  41. package/dist/ui.js +33 -1
  42. package/dist/util.js +32 -0
  43. package/dist/widgets.css +4 -0
  44. package/dist/widgets.js +243 -175
  45. package/package.json +1 -1
  46. package/src/charts/BarGraph.scss +31 -31
  47. package/src/charts/Legend.scss +57 -57
  48. package/src/charts/LegendEntry.scss +35 -35
  49. package/src/charts/LineGraph.scss +28 -28
  50. package/src/charts/RangeMarker.scss +3 -0
  51. package/src/charts/axis/Axis.tsx +31 -1
  52. package/src/charts/axis/TimeAxis.tsx +1 -0
  53. package/src/charts/helpers/SnapPointFinder.ts +136 -136
  54. package/src/charts/helpers/ValueAtFinder.ts +72 -72
  55. package/src/charts/index.scss +1 -0
  56. package/src/data/AugmentedViewBase.ts +89 -89
  57. package/src/data/View.ts +301 -301
  58. package/src/data/createAccessorModelProxy.ts +66 -66
  59. package/src/locale/de-de.ts +1 -0
  60. package/src/locale/en-us.ts +1 -0
  61. package/src/locale/es-es.ts +1 -0
  62. package/src/locale/fr-fr.ts +1 -0
  63. package/src/locale/nl-nl.ts +1 -0
  64. package/src/locale/pt-pt.ts +1 -0
  65. package/src/locale/sr-latn-ba.ts +1 -0
  66. package/src/ui/Format.spec.ts +32 -0
  67. package/src/ui/Format.ts +27 -2
  68. package/src/ui/Repeater.spec.tsx +181 -181
  69. package/src/util/Format.spec.ts +11 -0
  70. package/src/util/Format.ts +7 -0
  71. package/src/util/date/dateQuarter.ts +8 -0
  72. package/src/util/date/dayBefore.ts +15 -0
  73. package/src/util/date/index.ts +2 -0
  74. package/src/util/scss/include.scss +69 -69
  75. package/src/widgets/Button.maps.scss +103 -103
  76. package/src/widgets/form/Calendar.tsx +772 -772
  77. package/src/widgets/form/DateTimePicker.tsx +453 -392
  78. package/src/widgets/form/Field.tsx +2 -1
  79. package/src/widgets/form/LookupField.spec.tsx +149 -0
  80. package/src/widgets/form/LookupField.tsx +27 -0
  81. package/src/widgets/form/ValidationGroup.spec.tsx +30 -1
  82. package/src/widgets/form/Wheel.tsx +36 -7
  83. package/src/widgets/grid/Grid.scss +663 -657
  84. package/src/widgets/grid/Grid.tsx +9 -3
  85. package/src/widgets/grid/variables.scss +47 -47
  86. package/src/widgets/index.ts +63 -63
  87. package/src/widgets/nav/MenuItem.scss +150 -150
  88. package/src/widgets/nav/Tab.ts +122 -122
  89. package/src/widgets/overlay/Overlay.tsx +1029 -1029
  90. package/src/widgets/variables.scss +61 -61
package/dist/widgets.js CHANGED
@@ -6708,6 +6708,7 @@ class Field extends PureContainerBase {
6708
6708
  data._readOnly = data.readOnly;
6709
6709
  data._viewMode = data.mode === "view" || data.viewMode;
6710
6710
  data._tabOnEnterKey = data.tabOnEnterKey;
6711
+ data._visited = data.visited;
6711
6712
  data.validationValue = this.getValidationValue(data);
6712
6713
  instance.parentDisabled = context.parentDisabled;
6713
6714
  instance.parentReadOnly = context.parentReadOnly;
@@ -6745,7 +6746,7 @@ class Field extends PureContainerBase {
6745
6746
  data._tabOnEnterKey,
6746
6747
  context.parentTabOnEnterKey,
6747
6748
  );
6748
- data.visited = coalesce(context.parentStrict ? context.parentVisited : null, data.visited, context.parentVisited);
6749
+ data.visited = coalesce(context.parentStrict ? context.parentVisited : null, data._visited, context.parentVisited);
6749
6750
  if (!data.error && !data.disabled && !data.viewMode) this.validate(context, instance);
6750
6751
  if (data.visited && !state?.visited) {
6751
6752
  //feels hacky but it should be ok since we're in the middle of a new render cycle
@@ -8676,6 +8677,19 @@ class LookupField extends Field {
8676
8677
  }
8677
8678
  }
8678
8679
  instance.lastDropdown = context.lastDropdown;
8680
+ if (this.validateOptionExists && isArray(data.options) && !this.isEmpty(data)) {
8681
+ let invalid = this.multiple
8682
+ ? isArray(data.values) && data.records.length < data.values.length
8683
+ : !data.options.some(($option) =>
8684
+ areKeysEqual(
8685
+ getOptionKey(this.keyBindings, {
8686
+ $option,
8687
+ }),
8688
+ data.selectedKeys[0],
8689
+ ),
8690
+ );
8691
+ if (invalid) data.error = this.invalidOptionText;
8692
+ }
8679
8693
  super.prepareData(context, instance);
8680
8694
  }
8681
8695
  renderInput(context, instance, key) {
@@ -8741,6 +8755,8 @@ LookupField.prototype.hideSearchField = false;
8741
8755
  LookupField.prototype.minOptionsForSearchField = 7;
8742
8756
  LookupField.prototype.loadingText = "Loading...";
8743
8757
  LookupField.prototype.queryErrorText = "Error occurred while querying for lookup data.";
8758
+ LookupField.prototype.validateOptionExists = false;
8759
+ LookupField.prototype.invalidOptionText = "The selected option is no longer available.";
8744
8760
  LookupField.prototype.noResultsText = "No results found.";
8745
8761
  LookupField.prototype.optionIdField = "id";
8746
8762
  LookupField.prototype.optionTextField = "text";
@@ -13164,6 +13180,9 @@ class Wheel extends PureContainerBase {
13164
13180
  Wheel.prototype.baseClass = "wheel";
13165
13181
  Wheel.prototype.size = 3;
13166
13182
  Wheel.prototype.styled = true;
13183
+ /** A cyclic wheel renders its option list this many times, leaving scroll
13184
+ * headroom on both sides of the centre copy. */
13185
+ const WHEEL_BUFFER_COPIES = 3;
13167
13186
  class WheelComponent extends VDOM.Component {
13168
13187
  index;
13169
13188
  wheelEl;
@@ -13185,28 +13204,34 @@ class WheelComponent extends VDOM.Component {
13185
13204
  wheelRef;
13186
13205
  scrollRef;
13187
13206
  render() {
13188
- let { size, children, CSS, baseClass, active, className, style, onMouseDown } = this.props;
13207
+ let { size, children, CSS, baseClass, active, className, style, onMouseDown, cycle } = this.props;
13189
13208
  let optionClass = CSS.element(baseClass, "option");
13190
13209
  let dummyClass = CSS.element(baseClass, "option", {
13191
13210
  dummy: true,
13192
13211
  });
13212
+ // A cyclic wheel repeats the option list so it can scroll past either end.
13213
+ let options = children;
13214
+ if (cycle) {
13215
+ options = [];
13216
+ for (let i = 0; i < WHEEL_BUFFER_COPIES; i++) options.push(...children);
13217
+ }
13193
13218
  let tpad = [],
13194
13219
  bpad = [];
13195
13220
  for (let i = 0; i < (size - 1) / 2; i++) {
13196
13221
  tpad.push({
13197
13222
  key: -1 - i,
13198
- child: children[0],
13223
+ child: options[0],
13199
13224
  cls: dummyClass,
13200
13225
  });
13201
13226
  bpad.push({
13202
13227
  key: -100 - i,
13203
- child: children[0],
13228
+ child: options[0],
13204
13229
  cls: dummyClass,
13205
13230
  });
13206
13231
  }
13207
13232
  let displayedOptions = [
13208
13233
  ...tpad,
13209
- ...children.map((c, i) => ({
13234
+ ...options.map((c, i) => ({
13210
13235
  key: i,
13211
13236
  child: c,
13212
13237
  cls: optionClass,
@@ -13314,7 +13339,19 @@ class WheelComponent extends VDOM.Component {
13314
13339
  if (this.props.onPipeKeyDown) this.props.onPipeKeyDown(this.onKeyDown);
13315
13340
  }
13316
13341
  UNSAFE_componentWillReceiveProps(props) {
13317
- this.index = props.index || 0;
13342
+ let newIndex = props.index || 0;
13343
+ // A cyclic wheel renders the option list several times, so the same value
13344
+ // appears in several copies. Snap to the copy nearest the wheel's current
13345
+ // position rather than the one `props.index` names — a wrap then scrolls
13346
+ // one item into the adjacent (identical) copy with no jump, instead of
13347
+ // animating all the way back to the centre copy.
13348
+ if (props.cycle) {
13349
+ let period = props.children.length;
13350
+ let value = ((newIndex % period) + period) % period;
13351
+ newIndex = value + period * Math.round((this.index - value) / period);
13352
+ newIndex = Math.max(0, Math.min(period * WHEEL_BUFFER_COPIES - 1, newIndex));
13353
+ }
13354
+ this.index = newIndex;
13318
13355
  this.scrollTo();
13319
13356
  }
13320
13357
  componentWillUnmount() {
@@ -13351,8 +13388,9 @@ class WheelComponent extends VDOM.Component {
13351
13388
  }
13352
13389
  }
13353
13390
  select(newIndex) {
13354
- let { children } = this.props;
13355
- newIndex = Math.max(0, Math.min(children.length - 1, newIndex));
13391
+ let { children, cycle } = this.props;
13392
+ let length = children.length * (cycle ? WHEEL_BUFFER_COPIES : 1);
13393
+ newIndex = Math.max(0, Math.min(length - 1, newIndex));
13356
13394
  if (this.index !== newIndex) {
13357
13395
  this.index = newIndex;
13358
13396
  this.props.onChange(newIndex);
@@ -13408,6 +13446,24 @@ DateTimePicker.prototype.size = 3;
13408
13446
  DateTimePicker.prototype.autoFocus = false;
13409
13447
  DateTimePicker.prototype.segment = "datetime";
13410
13448
  DateTimePicker.prototype.showSeconds = false;
13449
+ // Builds the option spans for a numeric wheel — one zero-padded span per value.
13450
+ // Pass the result to a WheelComponent with `cycle` set to make it scroll
13451
+ // endlessly; centre the current value by passing `index = value + range`.
13452
+ function buildNumberWheel(range, startAt) {
13453
+ return Array.from(
13454
+ {
13455
+ length: range,
13456
+ },
13457
+ (_, j) =>
13458
+ jsx(
13459
+ "span",
13460
+ {
13461
+ children: String(j + startAt).padStart(2, "0"),
13462
+ },
13463
+ j,
13464
+ ),
13465
+ );
13466
+ }
13411
13467
  class DateTimePickerComponent extends VDOM.Component {
13412
13468
  el;
13413
13469
  keyDownPipes;
@@ -13419,6 +13475,7 @@ class DateTimePickerComponent extends VDOM.Component {
13419
13475
  date: date,
13420
13476
  activeWheel: null,
13421
13477
  };
13478
+ this.century = (date.getFullYear() / 100) | 0;
13422
13479
  let { widget } = props.instance;
13423
13480
  let pickerWidget = widget;
13424
13481
  this.handleChange = this.handleChange.bind(this);
@@ -13481,56 +13538,37 @@ class DateTimePickerComponent extends VDOM.Component {
13481
13538
  let date = this.state.date;
13482
13539
  let culture = Culture.getDateTimeCulture();
13483
13540
  let monthNames = culture.getMonthNames("short");
13484
- let years = [];
13485
- for (let y = 1970; y <= 2050; y++)
13486
- years.push(
13487
- jsx(
13488
- "span",
13489
- {
13490
- children: y,
13491
- },
13492
- y,
13493
- ),
13494
- );
13495
- let days = [];
13496
- let start = new Date(date.getFullYear(), date.getMonth(), 1);
13497
- while (start.getMonth() === date.getMonth()) {
13498
- let day = start.getDate();
13499
- days.push(
13500
- jsx(
13501
- "span",
13502
- {
13503
- children: day < 10 ? "0" + day : day,
13504
- },
13505
- day,
13506
- ),
13507
- );
13508
- start.setDate(start.getDate() + 1);
13509
- }
13510
- let hours = [];
13511
- for (let h = 0; h < 24; h++) {
13512
- hours.push(
13513
- jsx(
13514
- "span",
13515
- {
13516
- children: h < 10 ? "0" + h : h,
13517
- },
13518
- h,
13519
- ),
13520
- );
13521
- }
13522
- let minutes = [];
13523
- for (let m = 0; m < 60; m++) {
13524
- minutes.push(
13525
- jsx(
13526
- "span",
13527
- {
13528
- children: m < 10 ? "0" + m : m,
13529
- },
13530
- m,
13531
- ),
13532
- );
13541
+ // Years: a window spanning the current century, rebuilt when it changes.
13542
+ let currentCentury = (date.getFullYear() / 100) | 0;
13543
+ if (!this.years || this.century !== currentCentury) {
13544
+ this.century = currentCentury;
13545
+ this.firstYear = currentCentury * 100 - 3;
13546
+ let lastYear = (currentCentury + 1) * 100 + 5;
13547
+ this.years = [];
13548
+ for (let y = this.firstYear; y <= lastYear; y++)
13549
+ this.years.push(
13550
+ jsx(
13551
+ "span",
13552
+ {
13553
+ children: y,
13554
+ },
13555
+ y,
13556
+ ),
13557
+ );
13533
13558
  }
13559
+ let years = this.years;
13560
+ // Day/hour/minute wheels use a 3x buffer (see buildNumberWheel). The day
13561
+ // buffer depends on the month length, so it is rebuilt when that changes.
13562
+ const numberOfDaysInMonth = new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();
13563
+ if (!this.days || this.numberOfDaysInMonth !== numberOfDaysInMonth) {
13564
+ this.numberOfDaysInMonth = numberOfDaysInMonth;
13565
+ this.days = buildNumberWheel(numberOfDaysInMonth, 1);
13566
+ }
13567
+ let days = this.days;
13568
+ if (!this.hours) this.hours = buildNumberWheel(24, 0);
13569
+ let hours = this.hours;
13570
+ if (!this.minutes) this.minutes = buildNumberWheel(60, 0);
13571
+ let minutes = this.minutes;
13534
13572
  return jsxs("div", {
13535
13573
  tabIndex: 0,
13536
13574
  ref: (el) => {
@@ -13542,30 +13580,34 @@ class DateTimePickerComponent extends VDOM.Component {
13542
13580
  onKeyDown: this.onKeyDown,
13543
13581
  children: [
13544
13582
  this.wheels.year &&
13545
- jsx(WheelComponent, {
13546
- size: size,
13547
- CSS: CSS,
13548
- active: this.state.activeWheel === "year",
13549
- baseClass: baseClass + "-wheel",
13550
- index: date.getFullYear() - 1970,
13551
- onChange: (newIndex) => {
13552
- this.setState(
13553
- (state) => ({
13554
- date: this.setDateComponent(this.state.date, "year", newIndex + 1970),
13555
- }),
13556
- this.handleChange,
13557
- );
13558
- },
13559
- onPipeKeyDown: (kd) => {
13560
- this.keyDownPipes["year"] = kd;
13561
- },
13562
- onMouseDown: () => {
13563
- this.setState({
13564
- activeWheel: "year",
13565
- });
13583
+ jsx(
13584
+ WheelComponent,
13585
+ {
13586
+ size: size,
13587
+ CSS: CSS,
13588
+ active: this.state.activeWheel === "year",
13589
+ baseClass: baseClass + "-wheel",
13590
+ index: date.getFullYear() - this.firstYear,
13591
+ onChange: (newIndex) => {
13592
+ this.setState(
13593
+ (state) => ({
13594
+ date: this.setDateComponent(state.date, "year", newIndex + this.firstYear),
13595
+ }),
13596
+ this.handleChange,
13597
+ );
13598
+ },
13599
+ onPipeKeyDown: (kd) => {
13600
+ this.keyDownPipes["year"] = kd;
13601
+ },
13602
+ onMouseDown: () => {
13603
+ this.setState({
13604
+ activeWheel: "year",
13605
+ });
13606
+ },
13607
+ children: years,
13566
13608
  },
13567
- children: years,
13568
- }),
13609
+ `years-${this.century}`,
13610
+ ),
13569
13611
  this.wheels.year &&
13570
13612
  this.wheels.month &&
13571
13613
  jsx("span", {
@@ -13581,7 +13623,7 @@ class DateTimePickerComponent extends VDOM.Component {
13581
13623
  onChange: (newIndex) => {
13582
13624
  this.setState(
13583
13625
  (state) => ({
13584
- date: this.setDateComponent(this.state.date, "month", newIndex),
13626
+ date: this.setDateComponent(state.date, "month", newIndex),
13585
13627
  }),
13586
13628
  this.handleChange,
13587
13629
  );
@@ -13610,120 +13652,144 @@ class DateTimePickerComponent extends VDOM.Component {
13610
13652
  children: "-",
13611
13653
  }),
13612
13654
  this.wheels.date &&
13613
- jsx(WheelComponent, {
13614
- size: size,
13615
- CSS: CSS,
13616
- active: this.state.activeWheel === "date",
13617
- baseClass: baseClass + "-wheel",
13618
- index: date.getDate() - 1,
13619
- onChange: (newIndex) => {
13620
- this.setState(
13621
- (state) => ({
13622
- date: this.setDateComponent(this.state.date, "date", newIndex + 1),
13623
- }),
13624
- this.handleChange,
13625
- );
13626
- },
13627
- onPipeKeyDown: (kd) => {
13628
- this.keyDownPipes["date"] = kd;
13629
- },
13630
- onMouseDown: () => {
13631
- this.setState({
13632
- activeWheel: "date",
13633
- });
13655
+ jsx(
13656
+ WheelComponent,
13657
+ {
13658
+ size: size,
13659
+ CSS: CSS,
13660
+ cycle: true,
13661
+ active: this.state.activeWheel === "date",
13662
+ baseClass: baseClass + "-wheel",
13663
+ index: date.getDate() - 1 + this.numberOfDaysInMonth,
13664
+ onChange: (rawIndex) => {
13665
+ let day = rawIndex % this.numberOfDaysInMonth;
13666
+ this.setState(
13667
+ (state) => ({
13668
+ date: this.setDateComponent(state.date, "date", day + 1),
13669
+ }),
13670
+ this.handleChange,
13671
+ );
13672
+ },
13673
+ onPipeKeyDown: (kd) => {
13674
+ this.keyDownPipes["date"] = kd;
13675
+ },
13676
+ onMouseDown: () => {
13677
+ this.setState({
13678
+ activeWheel: "date",
13679
+ });
13680
+ },
13681
+ children: days,
13634
13682
  },
13635
- children: days,
13636
- }),
13683
+ "date",
13684
+ ),
13637
13685
  this.wheels.hours &&
13638
13686
  this.wheels.year &&
13639
13687
  jsx("span", {
13640
13688
  className: CSS.element(baseClass, "spacer"),
13641
13689
  }),
13642
13690
  this.wheels.hours &&
13643
- jsx(WheelComponent, {
13644
- size: size,
13645
- CSS: CSS,
13646
- active: this.state.activeWheel === "hours",
13647
- baseClass: baseClass + "-wheel",
13648
- index: date.getHours(),
13649
- onChange: (newIndex) => {
13650
- this.setState(
13651
- (state) => ({
13652
- date: this.setDateComponent(this.state.date, "hours", newIndex),
13653
- }),
13654
- this.handleChange,
13655
- );
13656
- },
13657
- onPipeKeyDown: (kd) => {
13658
- this.keyDownPipes["hours"] = kd;
13659
- },
13660
- onMouseDown: () => {
13661
- this.setState({
13662
- activeWheel: "hours",
13663
- });
13691
+ jsx(
13692
+ WheelComponent,
13693
+ {
13694
+ size: size,
13695
+ CSS: CSS,
13696
+ cycle: true,
13697
+ active: this.state.activeWheel === "hours",
13698
+ baseClass: baseClass + "-wheel",
13699
+ index: date.getHours() + 24,
13700
+ onChange: (rawIndex) => {
13701
+ let hour = rawIndex % 24;
13702
+ this.setState(
13703
+ (state) => ({
13704
+ date: this.setDateComponent(state.date, "hours", hour),
13705
+ }),
13706
+ this.handleChange,
13707
+ );
13708
+ },
13709
+ onPipeKeyDown: (kd) => {
13710
+ this.keyDownPipes["hours"] = kd;
13711
+ },
13712
+ onMouseDown: () => {
13713
+ this.setState({
13714
+ activeWheel: "hours",
13715
+ });
13716
+ },
13717
+ children: hours,
13664
13718
  },
13665
- children: hours,
13666
- }),
13719
+ "hours",
13720
+ ),
13667
13721
  this.wheels.hours &&
13668
13722
  this.wheels.minutes &&
13669
13723
  jsx("span", {
13670
13724
  children: ":",
13671
13725
  }),
13672
13726
  this.wheels.minutes &&
13673
- jsx(WheelComponent, {
13674
- size: size,
13675
- CSS: CSS,
13676
- baseClass: baseClass + "-wheel",
13677
- active: this.state.activeWheel === "minutes",
13678
- index: date.getMinutes(),
13679
- onChange: (newIndex) => {
13680
- this.setState(
13681
- (state) => ({
13682
- date: this.setDateComponent(this.state.date, "minutes", newIndex),
13683
- }),
13684
- this.handleChange,
13685
- );
13686
- },
13687
- onPipeKeyDown: (kd) => {
13688
- this.keyDownPipes["minutes"] = kd;
13689
- },
13690
- onMouseDown: () => {
13691
- this.setState({
13692
- activeWheel: "minutes",
13693
- });
13727
+ jsx(
13728
+ WheelComponent,
13729
+ {
13730
+ size: size,
13731
+ CSS: CSS,
13732
+ cycle: true,
13733
+ baseClass: baseClass + "-wheel",
13734
+ active: this.state.activeWheel === "minutes",
13735
+ index: date.getMinutes() + 60,
13736
+ onChange: (rawIndex) => {
13737
+ let minute = rawIndex % 60;
13738
+ this.setState(
13739
+ (state) => ({
13740
+ date: this.setDateComponent(state.date, "minutes", minute),
13741
+ }),
13742
+ this.handleChange,
13743
+ );
13744
+ },
13745
+ onPipeKeyDown: (kd) => {
13746
+ this.keyDownPipes["minutes"] = kd;
13747
+ },
13748
+ onMouseDown: () => {
13749
+ this.setState({
13750
+ activeWheel: "minutes",
13751
+ });
13752
+ },
13753
+ children: minutes,
13694
13754
  },
13695
- children: minutes,
13696
- }),
13755
+ "minutes",
13756
+ ),
13697
13757
  this.wheels.minutes &&
13698
13758
  this.wheels.seconds &&
13699
13759
  jsx("span", {
13700
13760
  children: ":",
13701
13761
  }),
13702
13762
  this.wheels.seconds &&
13703
- jsx(WheelComponent, {
13704
- size: size,
13705
- CSS: CSS,
13706
- baseClass: baseClass + "-wheel",
13707
- active: this.state.activeWheel === "seconds",
13708
- index: date.getSeconds(),
13709
- onChange: (newIndex) => {
13710
- this.setState(
13711
- (state) => ({
13712
- date: this.setDateComponent(this.state.date, "seconds", newIndex),
13713
- }),
13714
- this.handleChange,
13715
- );
13716
- },
13717
- onPipeKeyDown: (kd) => {
13718
- this.keyDownPipes["seconds"] = kd;
13719
- },
13720
- onMouseDown: () => {
13721
- this.setState({
13722
- activeWheel: "seconds",
13723
- });
13763
+ jsx(
13764
+ WheelComponent,
13765
+ {
13766
+ size: size,
13767
+ CSS: CSS,
13768
+ cycle: true,
13769
+ baseClass: baseClass + "-wheel",
13770
+ active: this.state.activeWheel === "seconds",
13771
+ index: date.getSeconds() + 60,
13772
+ onChange: (rawIndex) => {
13773
+ let second = rawIndex % 60;
13774
+ this.setState(
13775
+ (state) => ({
13776
+ date: this.setDateComponent(state.date, "seconds", second),
13777
+ }),
13778
+ this.handleChange,
13779
+ );
13780
+ },
13781
+ onPipeKeyDown: (kd) => {
13782
+ this.keyDownPipes["seconds"] = kd;
13783
+ },
13784
+ onMouseDown: () => {
13785
+ this.setState({
13786
+ activeWheel: "seconds",
13787
+ });
13788
+ },
13789
+ children: minutes,
13724
13790
  },
13725
- children: minutes,
13726
- }),
13791
+ "seconds",
13792
+ ),
13727
13793
  ],
13728
13794
  });
13729
13795
  }
@@ -15549,12 +15615,13 @@ class Grid extends ContainerBase {
15549
15615
  renderGroupHeader(context, instance, g, level, group, i, store, fixedColumns) {
15550
15616
  let { CSS, baseClass } = this;
15551
15617
  let data = store.getData();
15618
+ let resetRowNumbers = g.resetRowNumbers ? "reset-row-numbers" : null;
15552
15619
  if (g.caption) {
15553
15620
  let caption = g.caption(data);
15554
15621
  return jsx(
15555
15622
  "tbody",
15556
15623
  {
15557
- className: CSS.element(baseClass, "group-caption", ["level-" + level]),
15624
+ className: CSS.element(baseClass, "group-caption", ["level-" + level, resetRowNumbers]),
15558
15625
  "data-group-key": group.$key,
15559
15626
  "data-group-element": `group-caption-${level}`,
15560
15627
  children: jsx("tr", {
@@ -15645,7 +15712,7 @@ class Grid extends ContainerBase {
15645
15712
  return jsx(
15646
15713
  "tbody",
15647
15714
  {
15648
- className: CSS.element(baseClass, "group-caption", ["level-" + level]),
15715
+ className: CSS.element(baseClass, "group-caption", ["level-" + level, resetRowNumbers]),
15649
15716
  "data-group-key": group.$key,
15650
15717
  "data-group-element": `group-caption-${level}`,
15651
15718
  children: lines,
@@ -18586,6 +18653,7 @@ export {
18586
18653
  ValidationError,
18587
18654
  ValidationGroup,
18588
18655
  Validator,
18656
+ WHEEL_BUFFER_COPIES,
18589
18657
  Wheel,
18590
18658
  WheelComponent,
18591
18659
  Window,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cx",
3
- "version": "26.4.4",
3
+ "version": "26.6.0",
4
4
  "description": "Advanced JavaScript UI framework for admin and dashboard applications with ready to use grid, form and chart components.",
5
5
  "exports": {
6
6
  "./data": {
@@ -1,31 +1,31 @@
1
- @use "sass:math";
2
- @use "sass:map";
3
- @use "../util/scss/besm.scss" as *;
4
- @use "../util/scss/include.scss" as *;
5
- @use "../util/scss/add-rules.scss" as *;
6
- @use "../util/scss/clockwise.scss" as *;
7
- @use "./variables" as *;
8
-
9
- @mixin cx-bargraph($name: "bargraph", $besm: $cx-besm) {
10
- $block: map.get($besm, block);
11
- $element: map.get($besm, element);
12
- $state: map.get($besm, state);
13
-
14
- .#{$element}#{$name}-bar {
15
- stroke-width: $cx-default-chart-shape-stroke-width;
16
- fill: $cx-default-chart-shape-fill-color;
17
- stroke: $cx-default-chart-shape-stroke-color;
18
-
19
- &.#{$state}selectable {
20
- cursor: pointer;
21
- }
22
-
23
- &.#{$state}selected {
24
- stroke-width: $cx-default-chart-selected-stroke-width;
25
- }
26
- }
27
- }
28
-
29
- @if (cx-should-include("cx/charts/BarGraph")) {
30
- @include cx-bargraph();
31
- }
1
+ @use "sass:math";
2
+ @use "sass:map";
3
+ @use "../util/scss/besm.scss" as *;
4
+ @use "../util/scss/include.scss" as *;
5
+ @use "../util/scss/add-rules.scss" as *;
6
+ @use "../util/scss/clockwise.scss" as *;
7
+ @use "./variables" as *;
8
+
9
+ @mixin cx-bargraph($name: "bargraph", $besm: $cx-besm) {
10
+ $block: map.get($besm, block);
11
+ $element: map.get($besm, element);
12
+ $state: map.get($besm, state);
13
+
14
+ .#{$element}#{$name}-bar {
15
+ stroke-width: $cx-default-chart-shape-stroke-width;
16
+ fill: $cx-default-chart-shape-fill-color;
17
+ stroke: $cx-default-chart-shape-stroke-color;
18
+
19
+ &.#{$state}selectable {
20
+ cursor: pointer;
21
+ }
22
+
23
+ &.#{$state}selected {
24
+ stroke-width: $cx-default-chart-selected-stroke-width;
25
+ }
26
+ }
27
+ }
28
+
29
+ @if (cx-should-include("cx/charts/BarGraph")) {
30
+ @include cx-bargraph();
31
+ }