@xh/hoist 69.0.0-SNAPSHOT.1728081402362 → 69.0.0-SNAPSHOT.1728424290087

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.
@@ -180,6 +180,10 @@ export class ClientErrorsModel extends HoistModel {
180
180
  this.startDay = this.endDay.subtract(value, unit).nextDay();
181
181
  }
182
182
 
183
+ isInterval(value, unit) {
184
+ return this.startDay === this.endDay.subtract(value, unit).nextDay();
185
+ }
186
+
183
187
  @computed
184
188
  private get query() {
185
189
  return {
@@ -49,25 +49,29 @@ const tbar = hoistCmp.factory<ClientErrorsModel>(({model}) => {
49
49
  text: '6m',
50
50
  outlined: true,
51
51
  width: 40,
52
- onClick: () => model.adjustStartDate(6, 'months')
52
+ onClick: () => model.adjustStartDate(6, 'months'),
53
+ active: model.isInterval(6, 'months')
53
54
  }),
54
55
  button({
55
56
  text: '1m',
56
57
  outlined: true,
57
58
  width: 40,
58
- onClick: () => model.adjustStartDate(1, 'months')
59
+ onClick: () => model.adjustStartDate(1, 'months'),
60
+ active: model.isInterval(1, 'months')
59
61
  }),
60
62
  button({
61
63
  text: '7d',
62
64
  outlined: true,
63
65
  width: 40,
64
- onClick: () => model.adjustStartDate(7, 'days')
66
+ onClick: () => model.adjustStartDate(7, 'days'),
67
+ active: model.isInterval(7, 'days')
65
68
  }),
66
69
  button({
67
70
  text: '1d',
68
71
  outlined: true,
69
72
  width: 40,
70
- onClick: () => model.adjustStartDate(1, 'days')
73
+ onClick: () => model.adjustStartDate(1, 'days'),
74
+ active: model.isInterval(1, 'days')
71
75
  })
72
76
  ),
73
77
  hspacer(),
@@ -70,7 +70,7 @@ export class ActivityTrackingModel extends HoistModel {
70
70
  }
71
71
 
72
72
  private _monthFormat = 'MMM YYYY';
73
- private _defaultDims = ['day', 'username'];
73
+ private _defaultDims = ['username'];
74
74
 
75
75
  constructor() {
76
76
  super();
@@ -288,6 +288,11 @@ export class ActivityTrackingModel extends HoistModel {
288
288
  });
289
289
  }
290
290
 
291
+ isInterval(value, unit) {
292
+ const {startDay, endDay} = this.formModel.values;
293
+ return startDay === endDay.subtract(value, unit).nextDay();
294
+ }
295
+
291
296
  cubeLabelComparator(valA, valB, sortDir, abs, {recordA, recordB, defaultComparator}) {
292
297
  const rawA = recordA?.raw,
293
298
  rawB = recordB?.raw,
@@ -69,25 +69,29 @@ const tbar = hoistCmp.factory<ActivityTrackingModel>(({model}) => {
69
69
  text: '6m',
70
70
  outlined: true,
71
71
  width: 40,
72
- onClick: () => model.adjustStartDate(6, 'months')
72
+ onClick: () => model.adjustStartDate(6, 'months'),
73
+ active: model.isInterval(6, 'months')
73
74
  }),
74
75
  button({
75
76
  text: '1m',
76
77
  outlined: true,
77
78
  width: 40,
78
- onClick: () => model.adjustStartDate(1, 'months')
79
+ onClick: () => model.adjustStartDate(1, 'months'),
80
+ active: model.isInterval(1, 'months')
79
81
  }),
80
82
  button({
81
83
  text: '7d',
82
84
  outlined: true,
83
85
  width: 40,
84
- onClick: () => model.adjustStartDate(7, 'days')
86
+ onClick: () => model.adjustStartDate(7, 'days'),
87
+ active: model.isInterval(7, 'days')
85
88
  }),
86
89
  button({
87
90
  text: '1d',
88
91
  outlined: true,
89
92
  width: 40,
90
- onClick: () => model.adjustStartDate(1, 'days')
93
+ onClick: () => model.adjustStartDate(1, 'days'),
94
+ active: model.isInterval(1, 'days')
91
95
  })
92
96
  ),
93
97
  toolbarSep(),
@@ -22,6 +22,7 @@ export declare class ClientErrorsModel extends HoistModel {
22
22
  showEntryDetail(detailRec: StoreRecord): void;
23
23
  adjustDates(dir: 'subtract' | 'add'): void;
24
24
  adjustStartDate(value: any, unit: any): void;
25
+ isInterval(value: any, unit: any): boolean;
25
26
  private get query();
26
27
  private get defaultStartDay();
27
28
  private get defaultEndDay();
@@ -39,6 +39,7 @@ export declare class ActivityTrackingModel extends HoistModel {
39
39
  resetQuery(): void;
40
40
  adjustDates(dir: any): void;
41
41
  adjustStartDate(value: any, unit: any): void;
42
+ isInterval(value: any, unit: any): boolean;
42
43
  cubeLabelComparator(valA: any, valB: any, sortDir: any, abs: any, { recordA, recordB, defaultComparator }: {
43
44
  recordA: any;
44
45
  recordB: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "69.0.0-SNAPSHOT.1728081402362",
3
+ "version": "69.0.0-SNAPSHOT.1728424290087",
4
4
  "description": "Hoist add-on for building and deploying React Applications.",
5
5
  "repository": "github:xh/hoist-react",
6
6
  "homepage": "https://xh.io",