@perses-dev/components 0.46.0 → 0.47.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 (136) hide show
  1. package/dist/AlignSelector/AlignSelector.d.ts +8 -0
  2. package/dist/AlignSelector/AlignSelector.d.ts.map +1 -0
  3. package/dist/AlignSelector/AlignSelector.js +45 -0
  4. package/dist/AlignSelector/AlignSelector.js.map +1 -0
  5. package/dist/AlignSelector/index.d.ts +2 -0
  6. package/dist/AlignSelector/index.d.ts.map +1 -0
  7. package/dist/AlignSelector/index.js +15 -0
  8. package/dist/AlignSelector/index.js.map +1 -0
  9. package/dist/ColorPicker/OptionsColorPicker.d.ts +7 -0
  10. package/dist/ColorPicker/OptionsColorPicker.d.ts.map +1 -0
  11. package/dist/{ThresholdsEditor/ThresholdColorPicker.js → ColorPicker/OptionsColorPicker.js} +5 -5
  12. package/dist/ColorPicker/OptionsColorPicker.js.map +1 -0
  13. package/dist/ColorPicker/index.d.ts +1 -0
  14. package/dist/ColorPicker/index.d.ts.map +1 -1
  15. package/dist/ColorPicker/index.js +1 -0
  16. package/dist/ColorPicker/index.js.map +1 -1
  17. package/dist/DensitySelector/DensitySelector.d.ts +7 -0
  18. package/dist/DensitySelector/DensitySelector.d.ts.map +1 -0
  19. package/dist/DensitySelector/DensitySelector.js +46 -0
  20. package/dist/DensitySelector/DensitySelector.js.map +1 -0
  21. package/dist/DensitySelector/index.d.ts +2 -0
  22. package/dist/DensitySelector/index.d.ts.map +1 -0
  23. package/dist/DensitySelector/index.js +15 -0
  24. package/dist/DensitySelector/index.js.map +1 -0
  25. package/dist/Dialog/Dialog.d.ts +2 -7
  26. package/dist/Dialog/Dialog.d.ts.map +1 -1
  27. package/dist/Dialog/Dialog.js +7 -2
  28. package/dist/Dialog/Dialog.js.map +1 -1
  29. package/dist/LinksEditor/LinksEditor.d.ts +6 -1
  30. package/dist/LinksEditor/LinksEditor.d.ts.map +1 -1
  31. package/dist/LinksEditor/LinksEditor.js +15 -8
  32. package/dist/LinksEditor/LinksEditor.js.map +1 -1
  33. package/dist/Overlay/Overlay.d.ts +15 -0
  34. package/dist/Overlay/Overlay.d.ts.map +1 -0
  35. package/dist/Overlay/Overlay.js +52 -0
  36. package/dist/Overlay/Overlay.js.map +1 -0
  37. package/dist/Overlay/index.d.ts +2 -0
  38. package/dist/Overlay/index.d.ts.map +1 -0
  39. package/dist/Overlay/index.js +15 -0
  40. package/dist/Overlay/index.js.map +1 -0
  41. package/dist/SortSelector/SortSelectorButtons.d.ts +8 -0
  42. package/dist/SortSelector/SortSelectorButtons.d.ts.map +1 -0
  43. package/dist/SortSelector/SortSelectorButtons.js +45 -0
  44. package/dist/SortSelector/SortSelectorButtons.js.map +1 -0
  45. package/dist/SortSelector/index.d.ts +1 -0
  46. package/dist/SortSelector/index.d.ts.map +1 -1
  47. package/dist/SortSelector/index.js +2 -1
  48. package/dist/SortSelector/index.js.map +1 -1
  49. package/dist/Table/InnerTable.d.ts.map +1 -1
  50. package/dist/Table/InnerTable.js +2 -1
  51. package/dist/Table/InnerTable.js.map +1 -1
  52. package/dist/Table/TableCell.d.ts +1 -1
  53. package/dist/Table/TableCell.d.ts.map +1 -1
  54. package/dist/Table/TableCell.js +3 -1
  55. package/dist/Table/TableCell.js.map +1 -1
  56. package/dist/Table/TableHeaderCell.d.ts +1 -1
  57. package/dist/Table/TableHeaderCell.d.ts.map +1 -1
  58. package/dist/Table/TableHeaderCell.js.map +1 -1
  59. package/dist/Table/model/table-model.d.ts +1 -1
  60. package/dist/Table/model/table-model.d.ts.map +1 -1
  61. package/dist/Table/model/table-model.js +25 -20
  62. package/dist/Table/model/table-model.js.map +1 -1
  63. package/dist/ThresholdsEditor/ThresholdInput.js +2 -2
  64. package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
  65. package/dist/ThresholdsEditor/ThresholdsEditor.d.ts.map +1 -1
  66. package/dist/ThresholdsEditor/ThresholdsEditor.js +2 -2
  67. package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
  68. package/dist/TimeRangeSelector/DateTimeRangePicker.d.ts +18 -0
  69. package/dist/TimeRangeSelector/DateTimeRangePicker.d.ts.map +1 -0
  70. package/dist/{DateTimeRangePicker/AbsoluteTimePicker.js → TimeRangeSelector/DateTimeRangePicker.js} +45 -28
  71. package/dist/TimeRangeSelector/DateTimeRangePicker.js.map +1 -0
  72. package/dist/TimeRangeSelector/TimeRangeSelector.d.ts +35 -0
  73. package/dist/TimeRangeSelector/TimeRangeSelector.d.ts.map +1 -0
  74. package/dist/TimeRangeSelector/TimeRangeSelector.js +119 -0
  75. package/dist/TimeRangeSelector/TimeRangeSelector.js.map +1 -0
  76. package/dist/{DateTimeRangePicker → TimeRangeSelector}/index.d.ts +1 -2
  77. package/dist/TimeRangeSelector/index.d.ts.map +1 -0
  78. package/dist/{DateTimeRangePicker → TimeRangeSelector}/index.js +2 -3
  79. package/dist/TimeRangeSelector/index.js.map +1 -0
  80. package/dist/TimeRangeSelector/utils.d.ts +25 -0
  81. package/dist/TimeRangeSelector/utils.d.ts.map +1 -0
  82. package/dist/{DateTimeRangePicker → TimeRangeSelector}/utils.js +23 -2
  83. package/dist/TimeRangeSelector/utils.js.map +1 -0
  84. package/dist/cjs/AlignSelector/AlignSelector.js +53 -0
  85. package/dist/cjs/AlignSelector/index.js +30 -0
  86. package/dist/cjs/{ThresholdsEditor/ThresholdColorPicker.js → ColorPicker/OptionsColorPicker.js} +6 -6
  87. package/dist/cjs/ColorPicker/index.js +1 -0
  88. package/dist/cjs/DensitySelector/DensitySelector.js +54 -0
  89. package/dist/cjs/DensitySelector/index.js +30 -0
  90. package/dist/cjs/Dialog/Dialog.js +7 -2
  91. package/dist/cjs/LinksEditor/LinksEditor.js +15 -8
  92. package/dist/cjs/Overlay/Overlay.js +71 -0
  93. package/dist/cjs/Overlay/index.js +30 -0
  94. package/dist/cjs/SortSelector/SortSelectorButtons.js +53 -0
  95. package/dist/cjs/SortSelector/index.js +2 -1
  96. package/dist/cjs/Table/InnerTable.js +2 -1
  97. package/dist/cjs/Table/TableCell.js +3 -1
  98. package/dist/cjs/Table/model/table-model.js +25 -20
  99. package/dist/cjs/ThresholdsEditor/ThresholdInput.js +2 -2
  100. package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +2 -2
  101. package/dist/cjs/{DateTimeRangePicker/AbsoluteTimePicker.js → TimeRangeSelector/DateTimeRangePicker.js} +39 -30
  102. package/dist/cjs/TimeRangeSelector/TimeRangeSelector.js +127 -0
  103. package/dist/cjs/{DateTimeRangePicker → TimeRangeSelector}/index.js +2 -3
  104. package/dist/cjs/{DateTimeRangePicker → TimeRangeSelector}/utils.js +24 -1
  105. package/dist/cjs/index.js +4 -1
  106. package/dist/cjs/model/timeOption.js +19 -1
  107. package/dist/index.d.ts +4 -1
  108. package/dist/index.d.ts.map +1 -1
  109. package/dist/index.js +4 -1
  110. package/dist/index.js.map +1 -1
  111. package/dist/model/timeOption.d.ts +2 -1
  112. package/dist/model/timeOption.d.ts.map +1 -1
  113. package/dist/model/timeOption.js +13 -2
  114. package/dist/model/timeOption.js.map +1 -1
  115. package/package.json +7 -6
  116. package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts +0 -9
  117. package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts.map +0 -1
  118. package/dist/DateTimeRangePicker/AbsoluteTimePicker.js.map +0 -1
  119. package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts +0 -11
  120. package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +0 -1
  121. package/dist/DateTimeRangePicker/DateTimeRangePicker.js +0 -80
  122. package/dist/DateTimeRangePicker/DateTimeRangePicker.js.map +0 -1
  123. package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts +0 -13
  124. package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts.map +0 -1
  125. package/dist/DateTimeRangePicker/TimeRangeSelector.js +0 -67
  126. package/dist/DateTimeRangePicker/TimeRangeSelector.js.map +0 -1
  127. package/dist/DateTimeRangePicker/index.d.ts.map +0 -1
  128. package/dist/DateTimeRangePicker/index.js.map +0 -1
  129. package/dist/DateTimeRangePicker/utils.d.ts +0 -7
  130. package/dist/DateTimeRangePicker/utils.d.ts.map +0 -1
  131. package/dist/DateTimeRangePicker/utils.js.map +0 -1
  132. package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts +0 -3
  133. package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts.map +0 -1
  134. package/dist/ThresholdsEditor/ThresholdColorPicker.js.map +0 -1
  135. package/dist/cjs/DateTimeRangePicker/DateTimeRangePicker.js +0 -88
  136. package/dist/cjs/DateTimeRangePicker/TimeRangeSelector.js +0 -80
@@ -0,0 +1,127 @@
1
+ // Copyright 2024 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "TimeRangeSelector", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return TimeRangeSelector;
21
+ }
22
+ });
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _material = require("@mui/material");
25
+ const _Calendar = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Calendar"));
26
+ const _core = require("@perses-dev/core");
27
+ const _react = require("react");
28
+ const _context = require("../context");
29
+ const _DateTimeRangePicker = require("./DateTimeRangePicker");
30
+ const _utils = require("./utils");
31
+ function _interop_require_default(obj) {
32
+ return obj && obj.__esModule ? obj : {
33
+ default: obj
34
+ };
35
+ }
36
+ function TimeRangeSelector({ value, timeOptions, onChange, height, showCustomTimeRange = true }) {
37
+ const { timeZone } = (0, _context.useTimeZone)();
38
+ const anchorEl = (0, _react.useRef)(); // Used to position the absolute time range picker
39
+ // Control the open state of the absolute time range picker
40
+ const [showCustomDateSelector, setShowCustomDateSelector] = (0, _react.useState)(false);
41
+ // Build the initial value of the absolute time range picker
42
+ const convertedTimeRange = (0, _react.useMemo)(()=>{
43
+ return (0, _core.isRelativeTimeRange)(value) ? (0, _core.toAbsoluteTimeRange)(value) : value;
44
+ }, [
45
+ value
46
+ ]);
47
+ // Last option is the absolute time range option (custom)
48
+ // If the value is an absolute time range, we display this time range
49
+ // If the value is a relative time range, we make a default CustomTimeOption built from undefined value
50
+ const lastOption = (0, _react.useMemo)(()=>(0, _utils.buildCustomTimeOption)((0, _core.isRelativeTimeRange)(value) ? undefined : value, timeZone), [
51
+ value,
52
+ timeZone
53
+ ]);
54
+ // Control the open state of the select component to prevent the menu from closing when the custom date picker is
55
+ // opened.
56
+ //
57
+ // Note that the value state of the select is here for display only. The real value (the one from props) is managed
58
+ // by click events on each menu item.
59
+ // This is a trick to get around the limitation of select with menu item that doesn't support objects as value...
60
+ const [open, setOpen] = (0, _react.useState)(false);
61
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
62
+ children: [
63
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Popover, {
64
+ anchorEl: anchorEl.current,
65
+ anchorOrigin: {
66
+ vertical: 'bottom',
67
+ horizontal: 'center'
68
+ },
69
+ open: showCustomDateSelector,
70
+ onClose: ()=>setShowCustomDateSelector(false),
71
+ sx: (theme)=>({
72
+ padding: theme.spacing(2)
73
+ }),
74
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DateTimeRangePicker.DateTimeRangePicker, {
75
+ initialTimeRange: convertedTimeRange,
76
+ onChange: (value)=>{
77
+ onChange(value);
78
+ setShowCustomDateSelector(false);
79
+ setOpen(false);
80
+ },
81
+ onCancel: ()=>setShowCustomDateSelector(false)
82
+ })
83
+ }),
84
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
85
+ ref: anchorEl,
86
+ children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Select, {
87
+ open: open,
88
+ value: (0, _utils.formatTimeRange)(value, timeZone),
89
+ onClick: ()=>setOpen(!open),
90
+ IconComponent: _Calendar.default,
91
+ inputProps: {
92
+ 'aria-label': `Select time range. Currently set to ${value}`
93
+ },
94
+ sx: {
95
+ // `transform: none` prevents calendar icon from flipping over when menu is open
96
+ '.MuiSelect-icon': {
97
+ marginTop: '1px',
98
+ transform: 'none'
99
+ },
100
+ // paddingRight creates more space for the calendar icon (it's a bigger icon)
101
+ '.MuiSelect-select.MuiSelect-outlined.MuiInputBase-input': {
102
+ paddingRight: '36px'
103
+ },
104
+ '.MuiSelect-select': height ? {
105
+ lineHeight: height,
106
+ paddingY: 0
107
+ } : {}
108
+ },
109
+ children: [
110
+ timeOptions.map((item, idx)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
111
+ value: (0, _utils.formatTimeRange)(item.value, timeZone),
112
+ onClick: ()=>{
113
+ onChange(item.value);
114
+ },
115
+ children: item.display
116
+ }, idx)),
117
+ showCustomTimeRange && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
118
+ value: (0, _utils.formatTimeRange)(lastOption.value, timeZone),
119
+ onClick: ()=>setShowCustomDateSelector(true),
120
+ children: lastOption.display
121
+ })
122
+ ]
123
+ })
124
+ })
125
+ ]
126
+ });
127
+ }
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright 2024 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -14,9 +14,8 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- _export_star(require("./DateTimeRangePicker"), exports);
18
17
  _export_star(require("./TimeRangeSelector"), exports);
19
- _export_star(require("./AbsoluteTimePicker"), exports);
18
+ _export_star(require("./DateTimeRangePicker"), exports);
20
19
  function _export_star(from, to) {
21
20
  Object.keys(from).forEach(function(k) {
22
21
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright 2024 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -21,15 +21,32 @@ function _export(target, all) {
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
+ DATE_TIME_FORMAT: function() {
25
+ return DATE_TIME_FORMAT;
26
+ },
27
+ buildCustomTimeOption: function() {
28
+ return buildCustomTimeOption;
29
+ },
24
30
  formatAbsoluteRange: function() {
25
31
  return formatAbsoluteRange;
26
32
  },
33
+ formatTimeRange: function() {
34
+ return formatTimeRange;
35
+ },
27
36
  validateDateRange: function() {
28
37
  return validateDateRange;
29
38
  }
30
39
  });
31
40
  const _datefns = require("date-fns");
41
+ const _core = require("@perses-dev/core");
32
42
  const _utils = require("../utils");
43
+ const DATE_TIME_FORMAT = 'yyyy-MM-dd HH:mm:ss';
44
+ function buildCustomTimeOption(value, timeZone) {
45
+ return {
46
+ value,
47
+ display: formatTimeRange(value, timeZone)
48
+ };
49
+ }
33
50
  function validateDateRange(startDate, endDate) {
34
51
  // TODO: display error as helperText
35
52
  if (!(0, _datefns.isValid)(startDate) || !(0, _datefns.isValid)(endDate)) {
@@ -47,3 +64,9 @@ function formatAbsoluteRange(timeRange, dateFormat, timeZone) {
47
64
  const formattedEnd = (0, _utils.formatWithTimeZone)(timeRange.end, dateFormat, timeZone);
48
65
  return `${formattedStart} - ${formattedEnd}`;
49
66
  }
67
+ function formatTimeRange(value, timeZone) {
68
+ if (!value) {
69
+ return 'Custom Time Range';
70
+ }
71
+ return !(0, _core.isRelativeTimeRange)(value) ? formatAbsoluteRange(value, DATE_TIME_FORMAT, timeZone) : value.pastDuration;
72
+ }
package/dist/cjs/index.js CHANGED
@@ -14,11 +14,12 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
+ _export_star(require("./AlignSelector"), exports);
17
18
  _export_star(require("./BarChart"), exports);
18
19
  _export_star(require("./ColorPicker"), exports);
19
20
  _export_star(require("./ContentWithLegend"), exports);
20
- _export_star(require("./DateTimeRangePicker"), exports);
21
21
  _export_star(require("./Dialog"), exports);
22
+ _export_star(require("./DensitySelector"), exports);
22
23
  _export_star(require("./Drawer"), exports);
23
24
  _export_star(require("./EChart"), exports);
24
25
  _export_star(require("./ErrorAlert"), exports);
@@ -32,12 +33,14 @@ _export_star(require("./LineChart"), exports);
32
33
  _export_star(require("./LinksEditor"), exports);
33
34
  _export_star(require("./ModeSelector"), exports);
34
35
  _export_star(require("./OptionsEditorLayout"), exports);
36
+ _export_star(require("./Overlay"), exports);
35
37
  _export_star(require("./SettingsAutocomplete"), exports);
36
38
  _export_star(require("./SortSelector"), exports);
37
39
  _export_star(require("./StatChart"), exports);
38
40
  _export_star(require("./Table"), exports);
39
41
  _export_star(require("./ThresholdsEditor"), exports);
40
42
  _export_star(require("./TimeChart"), exports);
43
+ _export_star(require("./TimeRangeSelector"), exports);
41
44
  _export_star(require("./TimeSeriesTooltip"), exports);
42
45
  _export_star(require("./ToolbarIconButton"), exports);
43
46
  _export_star(require("./FormatControls"), exports);
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright 2024 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -14,3 +14,21 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
+ Object.defineProperty(exports, "buildRelativeTimeOption", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return buildRelativeTimeOption;
21
+ }
22
+ });
23
+ const _core = require("@perses-dev/core");
24
+ const _datefns = require("date-fns");
25
+ function buildRelativeTimeOption(duration) {
26
+ return {
27
+ value: {
28
+ pastDuration: duration
29
+ },
30
+ display: `Last ${(0, _datefns.formatDuration)((0, _core.parseDurationString)(duration), {
31
+ delimiter: ', '
32
+ })}`
33
+ };
34
+ }
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
+ export * from './AlignSelector';
1
2
  export * from './BarChart';
2
3
  export * from './ColorPicker';
3
4
  export * from './ContentWithLegend';
4
- export * from './DateTimeRangePicker';
5
5
  export * from './Dialog';
6
+ export * from './DensitySelector';
6
7
  export * from './Drawer';
7
8
  export * from './EChart';
8
9
  export * from './ErrorAlert';
@@ -16,12 +17,14 @@ export * from './LineChart';
16
17
  export * from './LinksEditor';
17
18
  export * from './ModeSelector';
18
19
  export * from './OptionsEditorLayout';
20
+ export * from './Overlay';
19
21
  export * from './SettingsAutocomplete';
20
22
  export * from './SortSelector';
21
23
  export * from './StatChart';
22
24
  export * from './Table';
23
25
  export * from './ThresholdsEditor';
24
26
  export * from './TimeChart';
27
+ export * from './TimeRangeSelector';
25
28
  export * from './TimeSeriesTooltip';
26
29
  export * from './ToolbarIconButton';
27
30
  export * from './FormatControls';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC"}
package/dist/index.js CHANGED
@@ -10,11 +10,12 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
+ export * from './AlignSelector';
13
14
  export * from './BarChart';
14
15
  export * from './ColorPicker';
15
16
  export * from './ContentWithLegend';
16
- export * from './DateTimeRangePicker';
17
17
  export * from './Dialog';
18
+ export * from './DensitySelector';
18
19
  export * from './Drawer';
19
20
  export * from './EChart';
20
21
  export * from './ErrorAlert';
@@ -28,12 +29,14 @@ export * from './LineChart';
28
29
  export * from './LinksEditor';
29
30
  export * from './ModeSelector';
30
31
  export * from './OptionsEditorLayout';
32
+ export * from './Overlay';
31
33
  export * from './SettingsAutocomplete';
32
34
  export * from './SortSelector';
33
35
  export * from './StatChart';
34
36
  export * from './Table';
35
37
  export * from './ThresholdsEditor';
36
38
  export * from './TimeChart';
39
+ export * from './TimeRangeSelector';
37
40
  export * from './TimeSeriesTooltip';
38
41
  export * from './ToolbarIconButton';
39
42
  export * from './FormatControls';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './BarChart';\nexport * from './ColorPicker';\nexport * from './ContentWithLegend';\nexport * from './DateTimeRangePicker';\nexport * from './Dialog';\nexport * from './Drawer';\nexport * from './EChart';\nexport * from './ErrorAlert';\nexport * from './ErrorBoundary';\nexport * from './FontSizeSelector';\nexport * from './GaugeChart';\nexport * from './InfoTooltip';\nexport * from './JSONEditor';\nexport * from './Legend';\nexport * from './LineChart';\nexport * from './LinksEditor';\nexport * from './ModeSelector';\nexport * from './OptionsEditorLayout';\nexport * from './SettingsAutocomplete';\nexport * from './SortSelector';\nexport * from './StatChart';\nexport * from './Table';\nexport * from './ThresholdsEditor';\nexport * from './TimeChart';\nexport * from './TimeSeriesTooltip';\nexport * from './ToolbarIconButton';\nexport * from './FormatControls';\nexport * from './YAxisLabel';\nexport * from './context';\nexport * from './utils';\nexport * from './model';\nexport * from './test-utils';\nexport * from './theme';\nexport * from './RefreshIntervalPicker';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,aAAa;AAC3B,cAAc,gBAAgB;AAC9B,cAAc,sBAAsB;AACpC,cAAc,wBAAwB;AACtC,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,eAAe;AAC7B,cAAc,kBAAkB;AAChC,cAAc,qBAAqB;AACnC,cAAc,eAAe;AAC7B,cAAc,gBAAgB;AAC9B,cAAc,eAAe;AAC7B,cAAc,WAAW;AACzB,cAAc,cAAc;AAC5B,cAAc,gBAAgB;AAC9B,cAAc,iBAAiB;AAC/B,cAAc,wBAAwB;AACtC,cAAc,yBAAyB;AACvC,cAAc,iBAAiB;AAC/B,cAAc,cAAc;AAC5B,cAAc,UAAU;AACxB,cAAc,qBAAqB;AACnC,cAAc,cAAc;AAC5B,cAAc,sBAAsB;AACpC,cAAc,sBAAsB;AACpC,cAAc,mBAAmB;AACjC,cAAc,eAAe;AAC7B,cAAc,YAAY;AAC1B,cAAc,UAAU;AACxB,cAAc,UAAU;AACxB,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,0BAA0B"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './AlignSelector';\nexport * from './BarChart';\nexport * from './ColorPicker';\nexport * from './ContentWithLegend';\nexport * from './Dialog';\nexport * from './DensitySelector';\nexport * from './Drawer';\nexport * from './EChart';\nexport * from './ErrorAlert';\nexport * from './ErrorBoundary';\nexport * from './FontSizeSelector';\nexport * from './GaugeChart';\nexport * from './InfoTooltip';\nexport * from './JSONEditor';\nexport * from './Legend';\nexport * from './LineChart';\nexport * from './LinksEditor';\nexport * from './ModeSelector';\nexport * from './OptionsEditorLayout';\nexport * from './Overlay';\nexport * from './SettingsAutocomplete';\nexport * from './SortSelector';\nexport * from './StatChart';\nexport * from './Table';\nexport * from './ThresholdsEditor';\nexport * from './TimeChart';\nexport * from './TimeRangeSelector';\nexport * from './TimeSeriesTooltip';\nexport * from './ToolbarIconButton';\nexport * from './FormatControls';\nexport * from './YAxisLabel';\nexport * from './context';\nexport * from './utils';\nexport * from './model';\nexport * from './test-utils';\nexport * from './theme';\nexport * from './RefreshIntervalPicker';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,kBAAkB;AAChC,cAAc,aAAa;AAC3B,cAAc,gBAAgB;AAC9B,cAAc,sBAAsB;AACpC,cAAc,WAAW;AACzB,cAAc,oBAAoB;AAClC,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,eAAe;AAC7B,cAAc,kBAAkB;AAChC,cAAc,qBAAqB;AACnC,cAAc,eAAe;AAC7B,cAAc,gBAAgB;AAC9B,cAAc,eAAe;AAC7B,cAAc,WAAW;AACzB,cAAc,cAAc;AAC5B,cAAc,gBAAgB;AAC9B,cAAc,iBAAiB;AAC/B,cAAc,wBAAwB;AACtC,cAAc,YAAY;AAC1B,cAAc,yBAAyB;AACvC,cAAc,iBAAiB;AAC/B,cAAc,cAAc;AAC5B,cAAc,UAAU;AACxB,cAAc,qBAAqB;AACnC,cAAc,cAAc;AAC5B,cAAc,sBAAsB;AACpC,cAAc,sBAAsB;AACpC,cAAc,sBAAsB;AACpC,cAAc,mBAAmB;AACjC,cAAc,eAAe;AAC7B,cAAc,YAAY;AAC1B,cAAc,UAAU;AACxB,cAAc,UAAU;AACxB,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,0BAA0B"}
@@ -1,6 +1,7 @@
1
- import { RelativeTimeRange } from '@perses-dev/core';
1
+ import { DurationString, RelativeTimeRange } from '@perses-dev/core';
2
2
  export interface TimeOption {
3
3
  value: RelativeTimeRange;
4
4
  display: string;
5
5
  }
6
+ export declare function buildRelativeTimeOption(duration: DurationString): TimeOption;
6
7
  //# sourceMappingURL=timeOption.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"timeOption.d.ts","sourceRoot":"","sources":["../../src/model/timeOption.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,iBAAiB,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;CACjB"}
1
+ {"version":3,"file":"timeOption.d.ts","sourceRoot":"","sources":["../../src/model/timeOption.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAuB,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG1F,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,iBAAiB,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,cAAc,GAAG,UAAU,CAK5E"}
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright 2024 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -10,6 +10,17 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- export { };
13
+ import { parseDurationString } from '@perses-dev/core';
14
+ import { formatDuration } from 'date-fns';
15
+ export function buildRelativeTimeOption(duration) {
16
+ return {
17
+ value: {
18
+ pastDuration: duration
19
+ },
20
+ display: `Last ${formatDuration(parseDurationString(duration), {
21
+ delimiter: ', '
22
+ })}`
23
+ };
24
+ }
14
25
 
15
26
  //# sourceMappingURL=timeOption.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/timeOption.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { RelativeTimeRange } from '@perses-dev/core';\n\nexport interface TimeOption {\n value: RelativeTimeRange;\n display: string;\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,WAGC"}
1
+ {"version":3,"sources":["../../src/model/timeOption.ts"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { DurationString, parseDurationString, RelativeTimeRange } from '@perses-dev/core';\nimport { formatDuration } from 'date-fns';\n\nexport interface TimeOption {\n value: RelativeTimeRange;\n display: string;\n}\n\nexport function buildRelativeTimeOption(duration: DurationString): TimeOption {\n return {\n value: { pastDuration: duration },\n display: `Last ${formatDuration(parseDurationString(duration), { delimiter: ', ' })}`,\n };\n}\n"],"names":["parseDurationString","formatDuration","buildRelativeTimeOption","duration","value","pastDuration","display","delimiter"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAAyBA,mBAAmB,QAA2B,mBAAmB;AAC1F,SAASC,cAAc,QAAQ,WAAW;AAO1C,OAAO,SAASC,wBAAwBC,QAAwB;IAC9D,OAAO;QACLC,OAAO;YAAEC,cAAcF;QAAS;QAChCG,SAAS,CAAC,KAAK,EAAEL,eAAeD,oBAAoBG,WAAW;YAAEI,WAAW;QAAK,GAAG,CAAC;IACvF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perses-dev/components",
3
- "version": "0.46.0",
3
+ "version": "0.47.0",
4
4
  "description": "Common UI components used across Perses features",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/perses/perses/blob/main/README.md",
@@ -36,8 +36,8 @@
36
36
  "@codemirror/lang-json": "^6.0.1",
37
37
  "@fontsource/lato": "^4.5.10",
38
38
  "@mui/x-date-pickers": "^6.12.1",
39
- "@perses-dev/core": "0.46.0",
40
- "@tanstack/react-table": "^8.9.1",
39
+ "@perses-dev/core": "0.47.0",
40
+ "@tanstack/react-table": "^8.19.2",
41
41
  "@uiw/react-codemirror": "^4.19.1",
42
42
  "date-fns": "^2.28.0",
43
43
  "date-fns-tz": "^1.3.7",
@@ -49,13 +49,14 @@
49
49
  "react-colorful": "^5.6.1",
50
50
  "react-error-boundary": "^3.1.4",
51
51
  "react-hook-form": "^7.51.3",
52
- "react-virtuoso": "^4.3.6"
52
+ "react-virtuoso": "^4.3.6",
53
+ "zod": "^3.21.4"
53
54
  },
54
55
  "devDependencies": {
55
- "@perses-dev/storybook": "0.46.0"
56
+ "@perses-dev/storybook": "0.47.0"
56
57
  },
57
58
  "peerDependencies": {
58
- "@mui/material": "^5.10.0",
59
+ "@mui/material": "^5.15.20",
59
60
  "react": "^17.0.2 || ^18.0.0",
60
61
  "react-dom": "^17.0.2 || ^18.0.0"
61
62
  },
@@ -1,9 +0,0 @@
1
- import { AbsoluteTimeRange } from '@perses-dev/core';
2
- interface AbsoluteTimeFormProps {
3
- initialTimeRange: AbsoluteTimeRange;
4
- onChange: (timeRange: AbsoluteTimeRange) => void;
5
- onCancel: () => void;
6
- }
7
- export declare const AbsoluteTimePicker: ({ initialTimeRange, onChange, onCancel }: AbsoluteTimeFormProps) => import("react/jsx-runtime").JSX.Element;
8
- export {};
9
- //# sourceMappingURL=AbsoluteTimePicker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AbsoluteTimePicker.d.ts","sourceRoot":"","sources":["../../src/DateTimeRangePicker/AbsoluteTimePicker.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAMrD,UAAU,qBAAqB;IAC7B,gBAAgB,EAAE,iBAAiB,CAAC;IACpC,QAAQ,EAAE,CAAC,SAAS,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACjD,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAMD,eAAO,MAAM,kBAAkB,6CAA8C,qBAAqB,4CAsKjG,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/DateTimeRangePicker/AbsoluteTimePicker.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useState } from 'react';\nimport { Box, Stack, TextField, Typography, Button } from '@mui/material';\nimport { LocalizationProvider, StaticDateTimePicker } from '@mui/x-date-pickers';\nimport { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';\nimport { AbsoluteTimeRange } from '@perses-dev/core';\nimport { useTimeZone } from '../context/TimeZoneProvider';\nimport { validateDateRange } from './utils';\n\nconst DATE_TIME_FORMAT = 'yyyy-MM-dd HH:mm:ss';\n\ninterface AbsoluteTimeFormProps {\n initialTimeRange: AbsoluteTimeRange;\n onChange: (timeRange: AbsoluteTimeRange) => void;\n onCancel: () => void;\n}\n\ntype AbsoluteTimeRangeInputValue = {\n [Property in keyof AbsoluteTimeRange]: string;\n};\n\nexport const AbsoluteTimePicker = ({ initialTimeRange, onChange, onCancel }: AbsoluteTimeFormProps) => {\n const { formatWithUserTimeZone } = useTimeZone();\n\n // Time range values as dates that can be used as a time range.\n const [timeRange, setTimeRange] = useState<AbsoluteTimeRange>(initialTimeRange);\n\n // Time range values as strings used to populate the text inputs. May not\n // be valid as dates when the user is typing.\n const [timeRangeInputs, setTimeRangeInputs] = useState<AbsoluteTimeRangeInputValue>({\n start: formatWithUserTimeZone(initialTimeRange.start, DATE_TIME_FORMAT),\n end: formatWithUserTimeZone(initialTimeRange.end, DATE_TIME_FORMAT),\n });\n\n const [showStartCalendar, setShowStartCalendar] = useState<boolean>(true);\n\n const changeTimeRange = (newTime: string | Date, segment: keyof AbsoluteTimeRange) => {\n const isInputChange = typeof newTime === 'string';\n const newInputTime = isInputChange ? newTime : formatWithUserTimeZone(newTime, DATE_TIME_FORMAT);\n\n setTimeRangeInputs((prevTimeRangeInputs) => {\n return {\n ...prevTimeRangeInputs,\n [segment]: newInputTime,\n };\n });\n\n // When the change is a string from an input, do not try to convert it to\n // a date because there are likely to be interim stages of editing where it\n // is not valid as a date. When the change is a Date from the calendar/clock\n // interface, we can be sure it is a date.\n if (!isInputChange) {\n setTimeRange((prevTimeRange) => {\n return {\n ...prevTimeRange,\n [segment]: newTime,\n };\n });\n }\n };\n\n const onChangeStartTime = (newStartTime: string | Date) => {\n changeTimeRange(newStartTime, 'start');\n };\n\n const onChangeEndTime = (newEndTime: string | Date) => {\n changeTimeRange(newEndTime, 'end');\n };\n\n const updateDateRange = () => {\n const newDates = {\n start: new Date(timeRangeInputs.start),\n end: new Date(timeRangeInputs.end),\n };\n const isValidDateRange = validateDateRange(newDates.start, newDates.end);\n if (isValidDateRange) {\n setTimeRange(newDates);\n return newDates;\n }\n };\n\n const onApply = () => {\n const newDates = updateDateRange();\n if (newDates) {\n onChange(newDates);\n }\n };\n\n return (\n <LocalizationProvider dateAdapter={AdapterDateFns}>\n <Stack\n spacing={2}\n sx={(theme) => ({\n padding: theme.spacing(1, 0, 2),\n })}\n >\n {showStartCalendar && (\n <Box\n sx={(theme) => ({\n // TODO: create separate reusable calendar component\n '.MuiPickersLayout-contentWrapper': {\n backgroundColor: theme.palette.background.default,\n },\n })}\n >\n <Typography variant=\"h3\" padding={1} paddingLeft={2}>\n Select Start Time\n </Typography>\n <StaticDateTimePicker\n displayStaticWrapperAs=\"desktop\"\n openTo=\"day\"\n disableHighlightToday={true}\n value={initialTimeRange.start}\n onChange={(newValue) => {\n if (newValue === null) return;\n onChangeStartTime(newValue);\n }}\n onAccept={() => {\n setShowStartCalendar(false);\n }}\n />\n </Box>\n )}\n {!showStartCalendar && (\n <Box\n sx={(theme) => ({\n '.MuiPickersLayout-contentWrapper': {\n backgroundColor: theme.palette.background.default,\n },\n })}\n >\n <Typography variant=\"h3\" padding={1} paddingLeft={2}>\n Select End Time\n </Typography>\n <StaticDateTimePicker\n displayStaticWrapperAs=\"desktop\"\n openTo=\"day\"\n disableHighlightToday={true}\n value={initialTimeRange.end}\n minDateTime={timeRange.start}\n onChange={(newValue) => {\n if (newValue === null) return;\n onChangeEndTime(newValue);\n }}\n onAccept={(newValue) => {\n if (newValue === null) return;\n setShowStartCalendar(true);\n onChangeEndTime(newValue);\n }}\n />\n </Box>\n )}\n <Stack direction=\"row\" alignItems=\"center\" gap={1} pl={1} pr={1}>\n <TextField\n onChange={(event: React.ChangeEvent<HTMLInputElement>) => {\n // TODO: add helperText, fix validation after we decide on form state solution\n onChangeStartTime(event.target.value);\n }}\n onBlur={() => updateDateRange()}\n value={timeRangeInputs.start}\n label=\"Start Time\"\n placeholder={DATE_TIME_FORMAT}\n // tel used to match MUI DateTimePicker, may change in future: https://github.com/mui/material-ui/issues/27590\n type=\"tel\"\n />\n <TextField\n onChange={(event: React.ChangeEvent<HTMLInputElement>) => {\n onChangeEndTime(event.target.value);\n }}\n onBlur={() => updateDateRange()}\n value={timeRangeInputs.end}\n label=\"End Time\"\n placeholder={DATE_TIME_FORMAT}\n type=\"tel\"\n />\n </Stack>\n <Stack direction=\"row\" sx={{ padding: (theme) => theme.spacing(0, 1) }} gap={1}>\n <Button variant=\"contained\" onClick={() => onApply()} fullWidth>\n Apply\n </Button>\n <Button variant=\"outlined\" onClick={() => onCancel()} fullWidth>\n Cancel\n </Button>\n </Stack>\n </Stack>\n </LocalizationProvider>\n );\n};\n"],"names":["useState","Box","Stack","TextField","Typography","Button","LocalizationProvider","StaticDateTimePicker","AdapterDateFns","useTimeZone","validateDateRange","DATE_TIME_FORMAT","AbsoluteTimePicker","initialTimeRange","onChange","onCancel","formatWithUserTimeZone","timeRange","setTimeRange","timeRangeInputs","setTimeRangeInputs","start","end","showStartCalendar","setShowStartCalendar","changeTimeRange","newTime","segment","isInputChange","newInputTime","prevTimeRangeInputs","prevTimeRange","onChangeStartTime","newStartTime","onChangeEndTime","newEndTime","updateDateRange","newDates","Date","isValidDateRange","onApply","dateAdapter","spacing","sx","theme","padding","backgroundColor","palette","background","default","variant","paddingLeft","displayStaticWrapperAs","openTo","disableHighlightToday","value","newValue","onAccept","minDateTime","direction","alignItems","gap","pl","pr","event","target","onBlur","label","placeholder","type","onClick","fullWidth"],"mappings":"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"}
@@ -1,11 +0,0 @@
1
- import { TimeRangeValue } from '@perses-dev/core';
2
- import { TimeOption } from '../model';
3
- interface DateTimeRangePickerProps {
4
- value: TimeRangeValue;
5
- onChange: (value: TimeRangeValue) => void;
6
- timeOptions: TimeOption[];
7
- height?: string;
8
- }
9
- export declare function DateTimeRangePicker(props: DateTimeRangePickerProps): import("react/jsx-runtime").JSX.Element;
10
- export {};
11
- //# sourceMappingURL=DateTimeRangePicker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DateTimeRangePicker.d.ts","sourceRoot":"","sources":["../../src/DateTimeRangePicker/DateTimeRangePicker.tsx"],"names":[],"mappings":"AAeA,OAAO,EAML,cAAc,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAItC,UAAU,wBAAwB;IAChC,KAAK,EAAE,cAAc,CAAC;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC1C,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CAwDlE"}
@@ -1,80 +0,0 @@
1
- // Copyright 2023 The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
- import { useRef, useState, useMemo } from 'react';
15
- import { Box, FormControl, Popover, Stack } from '@mui/material';
16
- import { isRelativeTimeRange, toAbsoluteTimeRange } from '@perses-dev/core';
17
- import { AbsoluteTimePicker } from './AbsoluteTimePicker';
18
- import { TimeRangeSelector } from './TimeRangeSelector';
19
- export function DateTimeRangePicker(props) {
20
- const { value, onChange, timeOptions, height } = props;
21
- const [showCustomDateSelector, setShowCustomDateSelector] = useState(false);
22
- const anchorEl = useRef();
23
- const convertedTimeRange = useMemo(()=>{
24
- return isRelativeTimeRange(value) ? toAbsoluteTimeRange(value) : value;
25
- }, [
26
- value
27
- ]);
28
- return /*#__PURE__*/ _jsxs(Stack, {
29
- direction: "row",
30
- spacing: 1,
31
- height: height,
32
- children: [
33
- /*#__PURE__*/ _jsx(Popover, {
34
- anchorEl: anchorEl.current,
35
- anchorOrigin: {
36
- vertical: 'bottom',
37
- horizontal: 'center'
38
- },
39
- open: showCustomDateSelector,
40
- onClose: ()=>setShowCustomDateSelector(false),
41
- sx: (theme)=>({
42
- padding: theme.spacing(2)
43
- }),
44
- children: /*#__PURE__*/ _jsx(AbsoluteTimePicker, {
45
- initialTimeRange: convertedTimeRange,
46
- onChange: (value)=>{
47
- onChange(value);
48
- setShowCustomDateSelector(false);
49
- },
50
- onCancel: ()=>setShowCustomDateSelector(false)
51
- })
52
- }),
53
- /*#__PURE__*/ _jsx(FormControl, {
54
- fullWidth: true,
55
- children: /*#__PURE__*/ _jsx(Box, {
56
- ref: anchorEl,
57
- children: /*#__PURE__*/ _jsx(TimeRangeSelector, {
58
- timeOptions: timeOptions,
59
- value: value,
60
- height: height,
61
- onSelectChange: (event)=>{
62
- const duration = event.target.value;
63
- const relativeTimeInput = {
64
- pastDuration: duration,
65
- end: new Date()
66
- };
67
- onChange(relativeTimeInput);
68
- setShowCustomDateSelector(false);
69
- },
70
- onCustomClick: ()=>{
71
- setShowCustomDateSelector(true);
72
- }
73
- })
74
- })
75
- })
76
- ]
77
- });
78
- }
79
-
80
- //# sourceMappingURL=DateTimeRangePicker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/DateTimeRangePicker/DateTimeRangePicker.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useRef, useState, useMemo } from 'react';\nimport { Box, FormControl, Popover, Stack } from '@mui/material';\nimport {\n DurationString,\n RelativeTimeRange,\n AbsoluteTimeRange,\n isRelativeTimeRange,\n toAbsoluteTimeRange,\n TimeRangeValue,\n} from '@perses-dev/core';\nimport { TimeOption } from '../model';\nimport { AbsoluteTimePicker } from './AbsoluteTimePicker';\nimport { TimeRangeSelector } from './TimeRangeSelector';\n\ninterface DateTimeRangePickerProps {\n value: TimeRangeValue;\n onChange: (value: TimeRangeValue) => void;\n timeOptions: TimeOption[];\n height?: string;\n}\n\nexport function DateTimeRangePicker(props: DateTimeRangePickerProps) {\n const { value, onChange, timeOptions, height } = props;\n\n const [showCustomDateSelector, setShowCustomDateSelector] = useState(false);\n const anchorEl = useRef();\n\n const convertedTimeRange = useMemo(() => {\n return isRelativeTimeRange(value) ? toAbsoluteTimeRange(value) : value;\n }, [value]);\n\n return (\n <Stack direction=\"row\" spacing={1} height={height}>\n <Popover\n anchorEl={anchorEl.current}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center',\n }}\n open={showCustomDateSelector}\n onClose={() => setShowCustomDateSelector(false)}\n sx={(theme) => ({\n padding: theme.spacing(2),\n })}\n >\n <AbsoluteTimePicker\n initialTimeRange={convertedTimeRange}\n onChange={(value: AbsoluteTimeRange) => {\n onChange(value);\n setShowCustomDateSelector(false);\n }}\n onCancel={() => setShowCustomDateSelector(false)}\n />\n </Popover>\n <FormControl fullWidth>\n <Box ref={anchorEl}>\n <TimeRangeSelector\n timeOptions={timeOptions}\n value={value}\n height={height}\n onSelectChange={(event) => {\n const duration = event.target.value;\n const relativeTimeInput: RelativeTimeRange = {\n pastDuration: duration as DurationString,\n end: new Date(),\n };\n onChange(relativeTimeInput);\n setShowCustomDateSelector(false);\n }}\n onCustomClick={() => {\n setShowCustomDateSelector(true);\n }}\n />\n </Box>\n </FormControl>\n </Stack>\n );\n}\n"],"names":["useRef","useState","useMemo","Box","FormControl","Popover","Stack","isRelativeTimeRange","toAbsoluteTimeRange","AbsoluteTimePicker","TimeRangeSelector","DateTimeRangePicker","props","value","onChange","timeOptions","height","showCustomDateSelector","setShowCustomDateSelector","anchorEl","convertedTimeRange","direction","spacing","current","anchorOrigin","vertical","horizontal","open","onClose","sx","theme","padding","initialTimeRange","onCancel","fullWidth","ref","onSelectChange","event","duration","target","relativeTimeInput","pastDuration","end","Date","onCustomClick"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,MAAM,EAAEC,QAAQ,EAAEC,OAAO,QAAQ,QAAQ;AAClD,SAASC,GAAG,EAAEC,WAAW,EAAEC,OAAO,EAAEC,KAAK,QAAQ,gBAAgB;AACjE,SAIEC,mBAAmB,EACnBC,mBAAmB,QAEd,mBAAmB;AAE1B,SAASC,kBAAkB,QAAQ,uBAAuB;AAC1D,SAASC,iBAAiB,QAAQ,sBAAsB;AASxD,OAAO,SAASC,oBAAoBC,KAA+B;IACjE,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,MAAM,EAAE,GAAGJ;IAEjD,MAAM,CAACK,wBAAwBC,0BAA0B,GAAGjB,SAAS;IACrE,MAAMkB,WAAWnB;IAEjB,MAAMoB,qBAAqBlB,QAAQ;QACjC,OAAOK,oBAAoBM,SAASL,oBAAoBK,SAASA;IACnE,GAAG;QAACA;KAAM;IAEV,qBACE,MAACP;QAAMe,WAAU;QAAMC,SAAS;QAAGN,QAAQA;;0BACzC,KAACX;gBACCc,UAAUA,SAASI,OAAO;gBAC1BC,cAAc;oBACZC,UAAU;oBACVC,YAAY;gBACd;gBACAC,MAAMV;gBACNW,SAAS,IAAMV,0BAA0B;gBACzCW,IAAI,CAACC,QAAW,CAAA;wBACdC,SAASD,MAAMR,OAAO,CAAC;oBACzB,CAAA;0BAEA,cAAA,KAACb;oBACCuB,kBAAkBZ;oBAClBN,UAAU,CAACD;wBACTC,SAASD;wBACTK,0BAA0B;oBAC5B;oBACAe,UAAU,IAAMf,0BAA0B;;;0BAG9C,KAACd;gBAAY8B,SAAS;0BACpB,cAAA,KAAC/B;oBAAIgC,KAAKhB;8BACR,cAAA,KAACT;wBACCK,aAAaA;wBACbF,OAAOA;wBACPG,QAAQA;wBACRoB,gBAAgB,CAACC;4BACf,MAAMC,WAAWD,MAAME,MAAM,CAAC1B,KAAK;4BACnC,MAAM2B,oBAAuC;gCAC3CC,cAAcH;gCACdI,KAAK,IAAIC;4BACX;4BACA7B,SAAS0B;4BACTtB,0BAA0B;wBAC5B;wBACA0B,eAAe;4BACb1B,0BAA0B;wBAC5B;;;;;;AAMZ"}
@@ -1,13 +0,0 @@
1
- import { SelectChangeEvent } from '@mui/material';
2
- import { TimeRangeValue } from '@perses-dev/core';
3
- import { TimeOption } from '../model';
4
- interface TimeRangeSelectorProps {
5
- value: TimeRangeValue;
6
- timeOptions: TimeOption[];
7
- onSelectChange: (event: SelectChangeEvent<string>) => void;
8
- onCustomClick: () => void;
9
- height?: string;
10
- }
11
- export declare function TimeRangeSelector(props: TimeRangeSelectorProps): import("react/jsx-runtime").JSX.Element;
12
- export {};
13
- //# sourceMappingURL=TimeRangeSelector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TimeRangeSelector.d.ts","sourceRoot":"","sources":["../../src/DateTimeRangePicker/TimeRangeSelector.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAoB,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAuB,MAAM,kBAAkB,CAAC;AAEvE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAKtC,UAAU,sBAAsB;IAC9B,KAAK,EAAE,cAAc,CAAC;IACtB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,cAAc,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IAC3D,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAqD9D"}