@perses-dev/components 0.55.0-rc.1 → 0.56.0-beta.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 (204) hide show
  1. package/dist/AlignSelector/AlignSelector.js +115 -25
  2. package/dist/AlignSelector/AlignSelector.js.map +1 -1
  3. package/dist/CodeEditor/CodeEditor.d.ts +19 -0
  4. package/dist/CodeEditor/CodeEditor.d.ts.map +1 -0
  5. package/dist/CodeEditor/CodeEditor.js +122 -0
  6. package/dist/CodeEditor/CodeEditor.js.map +1 -0
  7. package/dist/ColorPicker/ColorPicker.js +153 -61
  8. package/dist/ColorPicker/ColorPicker.js.map +1 -1
  9. package/dist/ColorPicker/OptionsColorPicker.js +147 -52
  10. package/dist/ColorPicker/OptionsColorPicker.js.map +1 -1
  11. package/dist/ContentWithLegend/ContentWithLegend.js +144 -41
  12. package/dist/ContentWithLegend/ContentWithLegend.js.map +1 -1
  13. package/dist/DensitySelector/DensitySelector.js +53 -20
  14. package/dist/DensitySelector/DensitySelector.js.map +1 -1
  15. package/dist/Dialog/Dialog.d.ts +3 -2
  16. package/dist/Dialog/Dialog.d.ts.map +1 -1
  17. package/dist/Dialog/Dialog.js +202 -49
  18. package/dist/Dialog/Dialog.js.map +1 -1
  19. package/dist/Dialog/DiscardChangesConfirmationDialog.js +79 -27
  20. package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +1 -1
  21. package/dist/DragAndDrop/DragAndDropList.js +184 -113
  22. package/dist/DragAndDrop/DragAndDropList.js.map +1 -1
  23. package/dist/DragAndDrop/DragButton.js +131 -52
  24. package/dist/DragAndDrop/DragButton.js.map +1 -1
  25. package/dist/DragAndDrop/DropIndicator.js +51 -26
  26. package/dist/DragAndDrop/DropIndicator.js.map +1 -1
  27. package/dist/Drawer/Drawer.js +75 -15
  28. package/dist/Drawer/Drawer.js.map +1 -1
  29. package/dist/EChart/EChart.js +179 -90
  30. package/dist/EChart/EChart.js.map +1 -1
  31. package/dist/ErrorAlert.js +14 -4
  32. package/dist/ErrorAlert.js.map +1 -1
  33. package/dist/ExemplarMetadata/ExemplarMetadataTooltip.js +463 -190
  34. package/dist/ExemplarMetadata/ExemplarMetadataTooltip.js.map +1 -1
  35. package/dist/FontSizeSelector/FontSizeSelector.js +82 -50
  36. package/dist/FontSizeSelector/FontSizeSelector.js.map +1 -1
  37. package/dist/FormEditor/FormActions.js +88 -14
  38. package/dist/FormEditor/FormActions.js.map +1 -1
  39. package/dist/FormatControls/FormatControls.js +246 -99
  40. package/dist/FormatControls/FormatControls.js.map +1 -1
  41. package/dist/FormatControls/UnitSelector.js +90 -25
  42. package/dist/FormatControls/UnitSelector.js.map +1 -1
  43. package/dist/InfoTooltip/InfoTooltip.js +105 -42
  44. package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
  45. package/dist/JSONEditor.d.ts +2 -6
  46. package/dist/JSONEditor.d.ts.map +1 -1
  47. package/dist/JSONEditor.js +24 -37
  48. package/dist/JSONEditor.js.map +1 -1
  49. package/dist/Legend/CompactLegend.js +77 -27
  50. package/dist/Legend/CompactLegend.js.map +1 -1
  51. package/dist/Legend/Legend.js +184 -82
  52. package/dist/Legend/Legend.js.map +1 -1
  53. package/dist/Legend/LegendColorBadge.js +54 -9
  54. package/dist/Legend/LegendColorBadge.js.map +1 -1
  55. package/dist/Legend/ListLegend.js +46 -16
  56. package/dist/Legend/ListLegend.js.map +1 -1
  57. package/dist/Legend/ListLegendItem.js +184 -48
  58. package/dist/Legend/ListLegendItem.js.map +1 -1
  59. package/dist/Legend/TableLegend.d.ts.map +1 -1
  60. package/dist/Legend/TableLegend.js +90 -48
  61. package/dist/Legend/TableLegend.js.map +1 -1
  62. package/dist/Legend/legend-model.d.ts +2 -2
  63. package/dist/Legend/legend-model.d.ts.map +1 -1
  64. package/dist/Legend/legend-model.js.map +1 -1
  65. package/dist/LinksEditor/LinkEditorForm.js +148 -67
  66. package/dist/LinksEditor/LinkEditorForm.js.map +1 -1
  67. package/dist/ModeSelector/ModeSelector.js +61 -19
  68. package/dist/ModeSelector/ModeSelector.js.map +1 -1
  69. package/dist/OptionsEditorLayout/OptionsEditorColumn.js +20 -9
  70. package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -1
  71. package/dist/OptionsEditorLayout/OptionsEditorControl.js +130 -54
  72. package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
  73. package/dist/OptionsEditorLayout/OptionsEditorGrid.js +17 -6
  74. package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
  75. package/dist/OptionsEditorLayout/OptionsEditorGroup.js +76 -28
  76. package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
  77. package/dist/Overlay/Overlay.js +71 -27
  78. package/dist/Overlay/Overlay.js.map +1 -1
  79. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js +96 -38
  80. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -1
  81. package/dist/RepeatGrid/RepeatGrid.js +117 -45
  82. package/dist/RepeatGrid/RepeatGrid.js.map +1 -1
  83. package/dist/SettingsAutocomplete/SettingsAutocomplete.js +99 -38
  84. package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
  85. package/dist/SortSelector/SortSelector.js +51 -18
  86. package/dist/SortSelector/SortSelector.js.map +1 -1
  87. package/dist/SortSelector/SortSelectorButtons.js +109 -25
  88. package/dist/SortSelector/SortSelectorButtons.js.map +1 -1
  89. package/dist/Table/InnerTable.js +46 -15
  90. package/dist/Table/InnerTable.js.map +1 -1
  91. package/dist/Table/Table.d.ts +3 -1
  92. package/dist/Table/Table.d.ts.map +1 -1
  93. package/dist/Table/Table.js +410 -158
  94. package/dist/Table/Table.js.map +1 -1
  95. package/dist/Table/TableBody.js +15 -4
  96. package/dist/Table/TableBody.js.map +1 -1
  97. package/dist/Table/TableCell.js +284 -107
  98. package/dist/Table/TableCell.js.map +1 -1
  99. package/dist/Table/TableCheckbox.js +101 -32
  100. package/dist/Table/TableCheckbox.js.map +1 -1
  101. package/dist/Table/TableFoot.js +15 -4
  102. package/dist/Table/TableFoot.js.map +1 -1
  103. package/dist/Table/TableHead.js +15 -4
  104. package/dist/Table/TableHead.js.map +1 -1
  105. package/dist/Table/TableHeaderCell.js +119 -62
  106. package/dist/Table/TableHeaderCell.js.map +1 -1
  107. package/dist/Table/TableRow.js +33 -9
  108. package/dist/Table/TableRow.js.map +1 -1
  109. package/dist/Table/TableToolbar.d.ts +5 -4
  110. package/dist/Table/TableToolbar.d.ts.map +1 -1
  111. package/dist/Table/TableToolbar.js +172 -100
  112. package/dist/Table/TableToolbar.js.map +1 -1
  113. package/dist/Table/VirtualizedTable.d.ts +11 -11
  114. package/dist/Table/VirtualizedTable.d.ts.map +1 -1
  115. package/dist/Table/VirtualizedTable.js +387 -219
  116. package/dist/Table/VirtualizedTable.js.map +1 -1
  117. package/dist/Table/VirtualizedTableContainer.js +27 -7
  118. package/dist/Table/VirtualizedTableContainer.js.map +1 -1
  119. package/dist/Table/hooks/useFuzzySearch.d.ts +6 -5
  120. package/dist/Table/hooks/useFuzzySearch.d.ts.map +1 -1
  121. package/dist/Table/hooks/useFuzzySearch.js +57 -32
  122. package/dist/Table/hooks/useFuzzySearch.js.map +1 -1
  123. package/dist/Table/hooks/useTableKeyboardNav.js +115 -74
  124. package/dist/Table/hooks/useTableKeyboardNav.js.map +1 -1
  125. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.d.ts +1 -1
  126. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.d.ts.map +1 -1
  127. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js +74 -53
  128. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js.map +1 -1
  129. package/dist/Table/model/table-model.d.ts +44 -15
  130. package/dist/Table/model/table-model.d.ts.map +1 -1
  131. package/dist/Table/model/table-model.js +33 -1
  132. package/dist/Table/model/table-model.js.map +1 -1
  133. package/dist/ThresholdsEditor/ThresholdInput.js +137 -47
  134. package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
  135. package/dist/ThresholdsEditor/ThresholdsEditor.js +341 -174
  136. package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
  137. package/dist/TimeRangeSelector/DateTimeRangePicker.js +368 -162
  138. package/dist/TimeRangeSelector/DateTimeRangePicker.js.map +1 -1
  139. package/dist/TimeRangeSelector/TimeRangeSelector.js +580 -209
  140. package/dist/TimeRangeSelector/TimeRangeSelector.js.map +1 -1
  141. package/dist/TimeSeriesTooltip/SeriesInfo.js +189 -65
  142. package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
  143. package/dist/TimeSeriesTooltip/SeriesLabelsStack.js +168 -78
  144. package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -1
  145. package/dist/TimeSeriesTooltip/SeriesMarker.js +38 -11
  146. package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -1
  147. package/dist/TimeSeriesTooltip/TimeChartTooltip.js +229 -72
  148. package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
  149. package/dist/TimeSeriesTooltip/TooltipContent.js +73 -27
  150. package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
  151. package/dist/TimeSeriesTooltip/TooltipHeader.js +221 -121
  152. package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
  153. package/dist/TimeSeriesTooltip/tooltip-model.js +44 -38
  154. package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
  155. package/dist/TimeZoneSelector.js +131 -36
  156. package/dist/TimeZoneSelector.js.map +1 -1
  157. package/dist/ToolbarIconButton/ToolbarIconButton.js +18 -7
  158. package/dist/ToolbarIconButton/ToolbarIconButton.js.map +1 -1
  159. package/dist/TransformsEditor/TransformEditor.js +830 -334
  160. package/dist/TransformsEditor/TransformEditor.js.map +1 -1
  161. package/dist/TransformsEditor/TransformEditorContainer.js +252 -90
  162. package/dist/TransformsEditor/TransformEditorContainer.js.map +1 -1
  163. package/dist/TransformsEditor/TransformsEditor.js +170 -59
  164. package/dist/TransformsEditor/TransformsEditor.js.map +1 -1
  165. package/dist/ValueMappingEditor/ValueMappingEditor.js +800 -322
  166. package/dist/ValueMappingEditor/ValueMappingEditor.js.map +1 -1
  167. package/dist/ValueMappingEditor/ValueMappingsEditor.js +218 -91
  168. package/dist/ValueMappingEditor/ValueMappingsEditor.js.map +1 -1
  169. package/dist/YAMLEditor/YAMLEditor.d.ts +12 -0
  170. package/dist/YAMLEditor/YAMLEditor.d.ts.map +1 -0
  171. package/dist/YAMLEditor/YAMLEditor.js +41 -0
  172. package/dist/YAMLEditor/YAMLEditor.js.map +1 -0
  173. package/dist/YAMLEditor/index.d.ts +2 -0
  174. package/dist/YAMLEditor/index.d.ts.map +1 -0
  175. package/dist/YAMLEditor/index.js +15 -0
  176. package/dist/YAMLEditor/index.js.map +1 -0
  177. package/dist/YAMLEditor/yaml-utils.d.ts +11 -0
  178. package/dist/YAMLEditor/yaml-utils.d.ts.map +1 -0
  179. package/dist/YAMLEditor/yaml-utils.js +52 -0
  180. package/dist/YAMLEditor/yaml-utils.js.map +1 -0
  181. package/dist/YAxisLabel.js +64 -20
  182. package/dist/YAxisLabel.js.map +1 -1
  183. package/dist/context/ChartsProvider.js +32 -16
  184. package/dist/context/ChartsProvider.js.map +1 -1
  185. package/dist/context/ItemActionsProvider.js +110 -61
  186. package/dist/context/ItemActionsProvider.js.map +1 -1
  187. package/dist/context/SelectionProvider.js +170 -66
  188. package/dist/context/SelectionProvider.js.map +1 -1
  189. package/dist/context/SnackbarProvider.js +101 -44
  190. package/dist/context/SnackbarProvider.js.map +1 -1
  191. package/dist/context/TimeZoneProvider.js +35 -14
  192. package/dist/context/TimeZoneProvider.js.map +1 -1
  193. package/dist/controls/TextField.js +86 -25
  194. package/dist/controls/TextField.js.map +1 -1
  195. package/dist/index.d.ts +1 -0
  196. package/dist/index.d.ts.map +1 -1
  197. package/dist/index.js +1 -0
  198. package/dist/index.js.map +1 -1
  199. package/dist/utils/browser-storage.js +64 -34
  200. package/dist/utils/browser-storage.js.map +1 -1
  201. package/dist/utils/time-series-data.d.ts.map +1 -1
  202. package/dist/utils/time-series-data.js +5 -2
  203. package/dist/utils/time-series-data.js.map +1 -1
  204. package/package.json +13 -7
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { c as _c } from "react-compiler-runtime";
2
3
  // Copyright The Perses Authors
3
4
  // Licensed under the Apache License, Version 2.0 (the "License");
4
5
  // you may not use this file except in compliance with the License.
@@ -14,75 +15,155 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
15
  import { Checkbox, FormControlLabel, Stack } from "@mui/material";
15
16
  import { TextField } from "../controls/index.js";
16
17
  export const LinkEditorForm = (props)=>{
18
+ const $ = _c(29);
17
19
  const { mode, url, name, newTabOpen, renderVariables, tooltip } = props;
18
- return /*#__PURE__*/ _jsxs(Stack, {
19
- direction: "column",
20
- gap: 2,
21
- flexGrow: 1,
22
- children: [
23
- /*#__PURE__*/ _jsx(TextField, {
24
- label: url.label,
25
- error: url.error?.hasError,
26
- helperText: url.error?.helperText,
27
- onChange: url.onChange,
28
- onBlur: url.onBlur,
29
- placeholder: url.placeholder,
30
- multiline: true,
31
- maxRows: 5,
32
- required: true,
33
- fullWidth: true,
34
- value: url.value
35
- }),
36
- (name || tooltip) && /*#__PURE__*/ _jsxs(Stack, {
37
- gap: 1,
38
- direction: mode === 'inline' ? 'row' : 'column',
39
- children: [
40
- name && /*#__PURE__*/ _jsx(TextField, {
41
- sx: {
42
- flexGrow: '1'
43
- },
44
- label: name.label,
45
- onChange: name?.onChange,
46
- placeholder: name?.placeholder,
47
- value: name?.value
48
- }),
49
- tooltip && /*#__PURE__*/ _jsx(TextField, {
50
- sx: {
51
- flexGrow: '1'
52
- },
53
- label: tooltip.label,
54
- onChange: tooltip?.onChange,
55
- placeholder: tooltip?.placeholder,
56
- value: tooltip?.value
57
- })
58
- ]
59
- }),
60
- /*#__PURE__*/ _jsxs(Stack, {
61
- direction: "row",
62
- gap: 1,
63
- children: [
64
- renderVariables && /*#__PURE__*/ _jsx(FormControlLabel, {
65
- label: renderVariables.label,
66
- control: /*#__PURE__*/ _jsx(Checkbox, {
67
- checked: renderVariables.value,
68
- onChange: (e)=>{
69
- renderVariables?.onChange(e.target.checked);
70
- }
71
- })
72
- }),
73
- /*#__PURE__*/ _jsx(FormControlLabel, {
74
- label: newTabOpen.label,
75
- control: /*#__PURE__*/ _jsx(Checkbox, {
76
- checked: newTabOpen.value,
77
- onChange: (e)=>{
78
- newTabOpen?.onChange(e.target.checked);
79
- }
80
- })
81
- })
82
- ]
20
+ const t0 = url.error?.hasError;
21
+ const t1 = url.error?.helperText;
22
+ let t2;
23
+ if ($[0] !== t0 || $[1] !== t1 || $[2] !== url.label || $[3] !== url.onBlur || $[4] !== url.onChange || $[5] !== url.placeholder || $[6] !== url.value) {
24
+ t2 = /*#__PURE__*/ _jsx(TextField, {
25
+ label: url.label,
26
+ error: t0,
27
+ helperText: t1,
28
+ onChange: url.onChange,
29
+ onBlur: url.onBlur,
30
+ placeholder: url.placeholder,
31
+ multiline: true,
32
+ maxRows: 5,
33
+ required: true,
34
+ fullWidth: true,
35
+ value: url.value
36
+ });
37
+ $[0] = t0;
38
+ $[1] = t1;
39
+ $[2] = url.label;
40
+ $[3] = url.onBlur;
41
+ $[4] = url.onChange;
42
+ $[5] = url.placeholder;
43
+ $[6] = url.value;
44
+ $[7] = t2;
45
+ } else {
46
+ t2 = $[7];
47
+ }
48
+ let t3;
49
+ if ($[8] !== mode || $[9] !== name || $[10] !== tooltip) {
50
+ t3 = (name || tooltip) && /*#__PURE__*/ _jsxs(Stack, {
51
+ gap: 1,
52
+ direction: mode === "inline" ? "row" : "column",
53
+ children: [
54
+ name && /*#__PURE__*/ _jsx(TextField, {
55
+ sx: {
56
+ flexGrow: "1"
57
+ },
58
+ label: name.label,
59
+ onChange: name?.onChange,
60
+ placeholder: name?.placeholder,
61
+ value: name?.value
62
+ }),
63
+ tooltip && /*#__PURE__*/ _jsx(TextField, {
64
+ sx: {
65
+ flexGrow: "1"
66
+ },
67
+ label: tooltip.label,
68
+ onChange: tooltip?.onChange,
69
+ placeholder: tooltip?.placeholder,
70
+ value: tooltip?.value
71
+ })
72
+ ]
73
+ });
74
+ $[8] = mode;
75
+ $[9] = name;
76
+ $[10] = tooltip;
77
+ $[11] = t3;
78
+ } else {
79
+ t3 = $[11];
80
+ }
81
+ let t4;
82
+ if ($[12] !== renderVariables) {
83
+ t4 = renderVariables && /*#__PURE__*/ _jsx(FormControlLabel, {
84
+ label: renderVariables.label,
85
+ control: /*#__PURE__*/ _jsx(Checkbox, {
86
+ checked: renderVariables.value,
87
+ onChange: (e)=>{
88
+ renderVariables?.onChange(e.target.checked);
89
+ }
83
90
  })
84
- ]
85
- });
91
+ });
92
+ $[12] = renderVariables;
93
+ $[13] = t4;
94
+ } else {
95
+ t4 = $[13];
96
+ }
97
+ let t5;
98
+ if ($[14] !== newTabOpen) {
99
+ t5 = (e_0)=>{
100
+ newTabOpen?.onChange(e_0.target.checked);
101
+ };
102
+ $[14] = newTabOpen;
103
+ $[15] = t5;
104
+ } else {
105
+ t5 = $[15];
106
+ }
107
+ let t6;
108
+ if ($[16] !== newTabOpen.value || $[17] !== t5) {
109
+ t6 = /*#__PURE__*/ _jsx(Checkbox, {
110
+ checked: newTabOpen.value,
111
+ onChange: t5
112
+ });
113
+ $[16] = newTabOpen.value;
114
+ $[17] = t5;
115
+ $[18] = t6;
116
+ } else {
117
+ t6 = $[18];
118
+ }
119
+ let t7;
120
+ if ($[19] !== newTabOpen.label || $[20] !== t6) {
121
+ t7 = /*#__PURE__*/ _jsx(FormControlLabel, {
122
+ label: newTabOpen.label,
123
+ control: t6
124
+ });
125
+ $[19] = newTabOpen.label;
126
+ $[20] = t6;
127
+ $[21] = t7;
128
+ } else {
129
+ t7 = $[21];
130
+ }
131
+ let t8;
132
+ if ($[22] !== t4 || $[23] !== t7) {
133
+ t8 = /*#__PURE__*/ _jsxs(Stack, {
134
+ direction: "row",
135
+ gap: 1,
136
+ children: [
137
+ t4,
138
+ t7
139
+ ]
140
+ });
141
+ $[22] = t4;
142
+ $[23] = t7;
143
+ $[24] = t8;
144
+ } else {
145
+ t8 = $[24];
146
+ }
147
+ let t9;
148
+ if ($[25] !== t2 || $[26] !== t3 || $[27] !== t8) {
149
+ t9 = /*#__PURE__*/ _jsxs(Stack, {
150
+ direction: "column",
151
+ gap: 2,
152
+ flexGrow: 1,
153
+ children: [
154
+ t2,
155
+ t3,
156
+ t8
157
+ ]
158
+ });
159
+ $[25] = t2;
160
+ $[26] = t3;
161
+ $[27] = t8;
162
+ $[28] = t9;
163
+ } else {
164
+ t9 = $[28];
165
+ }
166
+ return t9;
86
167
  };
87
168
 
88
169
  //# sourceMappingURL=LinkEditorForm.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/LinksEditor/LinkEditorForm.tsx"],"sourcesContent":["// Copyright 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 { Checkbox, FormControlLabel, Stack } from '@mui/material';\nimport type { ReactElement } from 'react';\n\nimport { TextField } from '../controls';\n\nexport interface LinkEditorFormField<T> {\n value: T;\n onChange: (value: T) => void;\n onBlur?: () => void;\n placeholder?: string;\n label: string;\n error: { hasError?: boolean; helperText?: string };\n}\n\nexport interface LinkEditorFormProps {\n mode: 'inline' | 'modalEmbedded';\n url: LinkEditorFormField<string>;\n name?: Omit<LinkEditorFormField<string>, 'error'>;\n tooltip?: Omit<LinkEditorFormField<string>, 'error'>;\n newTabOpen: Omit<LinkEditorFormField<boolean>, 'error'>;\n renderVariables?: Omit<LinkEditorFormField<boolean>, 'error'>;\n}\n\nexport const LinkEditorForm = (props: LinkEditorFormProps): ReactElement => {\n const { mode, url, name, newTabOpen, renderVariables, tooltip } = props;\n\n return (\n <Stack direction=\"column\" gap={2} flexGrow={1}>\n <TextField\n label={url.label}\n error={url.error?.hasError}\n helperText={url.error?.helperText}\n onChange={url.onChange}\n onBlur={url.onBlur}\n placeholder={url.placeholder}\n multiline\n maxRows={5}\n required\n fullWidth\n value={url.value}\n />\n {(name || tooltip) && (\n <Stack gap={1} direction={mode === 'inline' ? 'row' : 'column'}>\n {name && (\n <TextField\n sx={{ flexGrow: '1' }}\n label={name.label}\n onChange={name?.onChange}\n placeholder={name?.placeholder}\n value={name?.value}\n />\n )}\n {tooltip && (\n <TextField\n sx={{ flexGrow: '1' }}\n label={tooltip.label}\n onChange={tooltip?.onChange}\n placeholder={tooltip?.placeholder}\n value={tooltip?.value}\n />\n )}\n </Stack>\n )}\n <Stack direction=\"row\" gap={1}>\n {renderVariables && (\n <FormControlLabel\n label={renderVariables.label}\n control={\n <Checkbox\n checked={renderVariables.value}\n onChange={(e) => {\n renderVariables?.onChange(e.target.checked);\n }}\n />\n }\n />\n )}\n\n <FormControlLabel\n label={newTabOpen.label}\n control={\n <Checkbox\n checked={newTabOpen.value}\n onChange={(e) => {\n newTabOpen?.onChange(e.target.checked);\n }}\n />\n }\n />\n </Stack>\n </Stack>\n );\n};\n"],"names":["Checkbox","FormControlLabel","Stack","TextField","LinkEditorForm","props","mode","url","name","newTabOpen","renderVariables","tooltip","direction","gap","flexGrow","label","error","hasError","helperText","onChange","onBlur","placeholder","multiline","maxRows","required","fullWidth","value","sx","control","checked","e","target"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,QAAQ,EAAEC,gBAAgB,EAAEC,KAAK,QAAQ,gBAAgB;AAGlE,SAASC,SAAS,QAAQ,uBAAc;AAoBxC,OAAO,MAAMC,iBAAiB,CAACC;IAC7B,MAAM,EAAEC,IAAI,EAAEC,GAAG,EAAEC,IAAI,EAAEC,UAAU,EAAEC,eAAe,EAAEC,OAAO,EAAE,GAAGN;IAElE,qBACE,MAACH;QAAMU,WAAU;QAASC,KAAK;QAAGC,UAAU;;0BAC1C,KAACX;gBACCY,OAAOR,IAAIQ,KAAK;gBAChBC,OAAOT,IAAIS,KAAK,EAAEC;gBAClBC,YAAYX,IAAIS,KAAK,EAAEE;gBACvBC,UAAUZ,IAAIY,QAAQ;gBACtBC,QAAQb,IAAIa,MAAM;gBAClBC,aAAad,IAAIc,WAAW;gBAC5BC,SAAS;gBACTC,SAAS;gBACTC,QAAQ;gBACRC,SAAS;gBACTC,OAAOnB,IAAImB,KAAK;;YAEhBlB,CAAAA,QAAQG,OAAM,mBACd,MAACT;gBAAMW,KAAK;gBAAGD,WAAWN,SAAS,WAAW,QAAQ;;oBACnDE,sBACC,KAACL;wBACCwB,IAAI;4BAAEb,UAAU;wBAAI;wBACpBC,OAAOP,KAAKO,KAAK;wBACjBI,UAAUX,MAAMW;wBAChBE,aAAab,MAAMa;wBACnBK,OAAOlB,MAAMkB;;oBAGhBf,yBACC,KAACR;wBACCwB,IAAI;4BAAEb,UAAU;wBAAI;wBACpBC,OAAOJ,QAAQI,KAAK;wBACpBI,UAAUR,SAASQ;wBACnBE,aAAaV,SAASU;wBACtBK,OAAOf,SAASe;;;;0BAKxB,MAACxB;gBAAMU,WAAU;gBAAMC,KAAK;;oBACzBH,iCACC,KAACT;wBACCc,OAAOL,gBAAgBK,KAAK;wBAC5Ba,uBACE,KAAC5B;4BACC6B,SAASnB,gBAAgBgB,KAAK;4BAC9BP,UAAU,CAACW;gCACTpB,iBAAiBS,SAASW,EAAEC,MAAM,CAACF,OAAO;4BAC5C;;;kCAMR,KAAC5B;wBACCc,OAAON,WAAWM,KAAK;wBACvBa,uBACE,KAAC5B;4BACC6B,SAASpB,WAAWiB,KAAK;4BACzBP,UAAU,CAACW;gCACTrB,YAAYU,SAASW,EAAEC,MAAM,CAACF,OAAO;4BACvC;;;;;;;AAOd,EAAE"}
1
+ {"version":3,"sources":["../../src/LinksEditor/LinkEditorForm.tsx"],"sourcesContent":["// Copyright 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 { Checkbox, FormControlLabel, Stack } from '@mui/material';\nimport type { ReactElement } from 'react';\n\nimport { TextField } from '../controls';\n\nexport interface LinkEditorFormField<T> {\n value: T;\n onChange: (value: T) => void;\n onBlur?: () => void;\n placeholder?: string;\n label: string;\n error: { hasError?: boolean; helperText?: string };\n}\n\nexport interface LinkEditorFormProps {\n mode: 'inline' | 'modalEmbedded';\n url: LinkEditorFormField<string>;\n name?: Omit<LinkEditorFormField<string>, 'error'>;\n tooltip?: Omit<LinkEditorFormField<string>, 'error'>;\n newTabOpen: Omit<LinkEditorFormField<boolean>, 'error'>;\n renderVariables?: Omit<LinkEditorFormField<boolean>, 'error'>;\n}\n\nexport const LinkEditorForm = (props: LinkEditorFormProps): ReactElement => {\n const { mode, url, name, newTabOpen, renderVariables, tooltip } = props;\n\n return (\n <Stack direction=\"column\" gap={2} flexGrow={1}>\n <TextField\n label={url.label}\n error={url.error?.hasError}\n helperText={url.error?.helperText}\n onChange={url.onChange}\n onBlur={url.onBlur}\n placeholder={url.placeholder}\n multiline\n maxRows={5}\n required\n fullWidth\n value={url.value}\n />\n {(name || tooltip) && (\n <Stack gap={1} direction={mode === 'inline' ? 'row' : 'column'}>\n {name && (\n <TextField\n sx={{ flexGrow: '1' }}\n label={name.label}\n onChange={name?.onChange}\n placeholder={name?.placeholder}\n value={name?.value}\n />\n )}\n {tooltip && (\n <TextField\n sx={{ flexGrow: '1' }}\n label={tooltip.label}\n onChange={tooltip?.onChange}\n placeholder={tooltip?.placeholder}\n value={tooltip?.value}\n />\n )}\n </Stack>\n )}\n <Stack direction=\"row\" gap={1}>\n {renderVariables && (\n <FormControlLabel\n label={renderVariables.label}\n control={\n <Checkbox\n checked={renderVariables.value}\n onChange={(e) => {\n renderVariables?.onChange(e.target.checked);\n }}\n />\n }\n />\n )}\n\n <FormControlLabel\n label={newTabOpen.label}\n control={\n <Checkbox\n checked={newTabOpen.value}\n onChange={(e) => {\n newTabOpen?.onChange(e.target.checked);\n }}\n />\n }\n />\n </Stack>\n </Stack>\n );\n};\n"],"names":["Checkbox","FormControlLabel","Stack","TextField","LinkEditorForm"],"mappings":";;AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,QAAQ,EAAEC,gBAAgB,EAAEC,KAAK,QAAQ,gBAAgB;AAGlE,SAASC,SAAS,QAAQ,uBAAc;AAoBxC,OAAO,MAAMC,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqE5B"}
@@ -11,33 +11,75 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { c as _c } from "react-compiler-runtime";
14
15
  import { OptionsEditorControl } from "../OptionsEditorLayout/index.js";
15
16
  import { SettingsAutocomplete } from "../SettingsAutocomplete/index.js";
16
17
  const MODE_OPTIONS = [
17
18
  {
18
- id: 'value',
19
- label: 'Value'
19
+ id: "value",
20
+ label: "Value"
20
21
  },
21
22
  {
22
- id: 'percentage',
23
- label: 'Percentage'
23
+ id: "percentage",
24
+ label: "Percentage"
24
25
  }
25
26
  ];
26
- export function ModeSelector({ disablePercentageMode, onChange, value = 'value' }) {
27
- const handleModeChange = (_, { id })=>{
28
- onChange(id);
29
- };
30
- return /*#__PURE__*/ _jsx(OptionsEditorControl, {
31
- label: "Mode",
32
- control: /*#__PURE__*/ _jsx(SettingsAutocomplete, {
33
- value: MODE_OPTIONS.find((o)=>o.id === value),
34
- options: MODE_OPTIONS,
35
- getOptionLabel: (o)=>o.label,
36
- getOptionDisabled: (o)=>o.id === 'percentage' && disablePercentageMode,
37
- onChange: handleModeChange,
38
- disableClearable: true
39
- })
40
- });
27
+ export function ModeSelector(t0) {
28
+ const $ = _c(10);
29
+ const { disablePercentageMode, onChange, value: t1 } = t0;
30
+ const value = t1 === undefined ? "value" : t1;
31
+ let t2;
32
+ if ($[0] !== onChange) {
33
+ t2 = (_, t3)=>{
34
+ const { id } = t3;
35
+ onChange(id);
36
+ };
37
+ $[0] = onChange;
38
+ $[1] = t2;
39
+ } else {
40
+ t2 = $[1];
41
+ }
42
+ const handleModeChange = t2;
43
+ let t3;
44
+ if ($[2] !== value) {
45
+ t3 = MODE_OPTIONS.find((o)=>o.id === value);
46
+ $[2] = value;
47
+ $[3] = t3;
48
+ } else {
49
+ t3 = $[3];
50
+ }
51
+ let t4;
52
+ if ($[4] !== disablePercentageMode) {
53
+ t4 = (o_1)=>o_1.id === "percentage" && disablePercentageMode;
54
+ $[4] = disablePercentageMode;
55
+ $[5] = t4;
56
+ } else {
57
+ t4 = $[5];
58
+ }
59
+ let t5;
60
+ if ($[6] !== handleModeChange || $[7] !== t3 || $[8] !== t4) {
61
+ t5 = /*#__PURE__*/ _jsx(OptionsEditorControl, {
62
+ label: "Mode",
63
+ control: /*#__PURE__*/ _jsx(SettingsAutocomplete, {
64
+ value: t3,
65
+ options: MODE_OPTIONS,
66
+ getOptionLabel: _temp,
67
+ getOptionDisabled: t4,
68
+ onChange: handleModeChange,
69
+ disableClearable: true
70
+ })
71
+ });
72
+ $[6] = handleModeChange;
73
+ $[7] = t3;
74
+ $[8] = t4;
75
+ $[9] = t5;
76
+ } else {
77
+ t5 = $[9];
78
+ }
79
+ return t5;
80
+ }
81
+ function _temp(o_0) {
82
+ return o_0.label;
41
83
  }
42
84
 
43
85
  //# sourceMappingURL=ModeSelector.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ModeSelector/ModeSelector.tsx"],"sourcesContent":["// Copyright 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 type { ReactElement } from 'react';\n\nimport { OptionsEditorControl } from '../OptionsEditorLayout';\nimport { SettingsAutocomplete } from '../SettingsAutocomplete';\n\nconst MODE_OPTIONS: Array<{ id: ModeOption; label: string }> = [\n { id: 'value', label: 'Value' },\n { id: 'percentage', label: 'Percentage' },\n];\n\nexport type ModeOption = 'value' | 'percentage';\n\nexport interface ModeSelectorProps {\n disablePercentageMode: boolean;\n onChange: (mode: ModeOption) => void;\n value?: ModeOption;\n}\n\nexport function ModeSelector({ disablePercentageMode, onChange, value = 'value' }: ModeSelectorProps): ReactElement {\n const handleModeChange = (_: unknown, { id }: { id: ModeOption }): void => {\n onChange(id);\n };\n\n return (\n <OptionsEditorControl\n label=\"Mode\"\n control={\n <SettingsAutocomplete\n value={MODE_OPTIONS.find((o) => o.id === value)}\n options={MODE_OPTIONS}\n getOptionLabel={(o) => o.label}\n getOptionDisabled={(o) => o.id === 'percentage' && disablePercentageMode}\n onChange={handleModeChange}\n disableClearable\n />\n }\n />\n );\n}\n"],"names":["OptionsEditorControl","SettingsAutocomplete","MODE_OPTIONS","id","label","ModeSelector","disablePercentageMode","onChange","value","handleModeChange","_","control","find","o","options","getOptionLabel","getOptionDisabled","disableClearable"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,wEAAwE;AACxE,qEAAqE;AACrE,6EAA6E;AAC7E,sEAAsE;AACtE,iCAAiC;;AAIjC,SAASA,oBAAoB,QAAQ,kCAAyB;AAC9D,SAASC,oBAAoB,QAAQ,mCAA0B;AAE/D,MAAMC,eAAyD;IAC7D;QAAEC,IAAI;QAASC,OAAO;IAAQ;IAC9B;QAAED,IAAI;QAAcC,OAAO;IAAa;CACzC;AAUD,OAAO,SAASC,aAAa,EAAEC,qBAAqB,EAAEC,QAAQ,EAAEC,QAAQ,OAAO,EAAqB;IAClG,MAAMC,mBAAmB,CAACC,GAAY,EAAEP,EAAE,EAAsB;QAC9DI,SAASJ;IACX;IAEA,qBACE,KAACH;QACCI,OAAM;QACNO,uBACE,KAACV;YACCO,OAAON,aAAaU,IAAI,CAAC,CAACC,IAAMA,EAAEV,EAAE,KAAKK;YACzCM,SAASZ;YACTa,gBAAgB,CAACF,IAAMA,EAAET,KAAK;YAC9BY,mBAAmB,CAACH,IAAMA,EAAEV,EAAE,KAAK,gBAAgBG;YACnDC,UAAUE;YACVQ,gBAAgB;;;AAK1B"}
1
+ {"version":3,"sources":["../../src/ModeSelector/ModeSelector.tsx"],"sourcesContent":["// Copyright 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 type { ReactElement } from 'react';\n\nimport { OptionsEditorControl } from '../OptionsEditorLayout';\nimport { SettingsAutocomplete } from '../SettingsAutocomplete';\n\nconst MODE_OPTIONS: Array<{ id: ModeOption; label: string }> = [\n { id: 'value', label: 'Value' },\n { id: 'percentage', label: 'Percentage' },\n];\n\nexport type ModeOption = 'value' | 'percentage';\n\nexport interface ModeSelectorProps {\n disablePercentageMode: boolean;\n onChange: (mode: ModeOption) => void;\n value?: ModeOption;\n}\n\nexport function ModeSelector({ disablePercentageMode, onChange, value = 'value' }: ModeSelectorProps): ReactElement {\n const handleModeChange = (_: unknown, { id }: { id: ModeOption }): void => {\n onChange(id);\n };\n\n return (\n <OptionsEditorControl\n label=\"Mode\"\n control={\n <SettingsAutocomplete\n value={MODE_OPTIONS.find((o) => o.id === value)}\n options={MODE_OPTIONS}\n getOptionLabel={(o) => o.label}\n getOptionDisabled={(o) => o.id === 'percentage' && disablePercentageMode}\n onChange={handleModeChange}\n disableClearable\n />\n }\n />\n );\n}\n"],"names":["OptionsEditorControl","SettingsAutocomplete","MODE_OPTIONS","id","label"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,wEAAwE;AACxE,qEAAqE;AACrE,6EAA6E;AAC7E,sEAAsE;AACtE,iCAAiC;;;AAIjC,SAASA,oBAAoB,QAAQ,kCAAyB;AAC9D,SAASC,oBAAoB,QAAQ,mCAA0B;AAE/D,MAAMC,eAAyD;IAC7D;QAAEC,IAAI;QAASC,OAAO;IAAQ;IAC9B;QAAED,IAAI;QAAcC,OAAO;IAAa;CACzC;AAUD,OAAO"}
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { c as _c } from "react-compiler-runtime";
2
3
  // Copyright The Perses Authors
3
4
  // Licensed under the Apache License, Version 2.0 (the "License");
4
5
  // you may not use this file except in compliance with the License.
@@ -14,15 +15,25 @@ import { jsx as _jsx } from "react/jsx-runtime";
14
15
  import { Grid, Stack } from "@mui/material";
15
16
  /**
16
17
  * Lay out content in a column within panel options.
17
- */ export const OptionsEditorColumn = ({ children })=>{
18
- return /*#__PURE__*/ _jsx(Grid, {
19
- item: true,
20
- xs: 4,
21
- children: /*#__PURE__*/ _jsx(Stack, {
22
- spacing: 3,
23
- children: children
24
- })
25
- });
18
+ */ export const OptionsEditorColumn = (t0)=>{
19
+ const $ = _c(2);
20
+ const { children } = t0;
21
+ let t1;
22
+ if ($[0] !== children) {
23
+ t1 = /*#__PURE__*/ _jsx(Grid, {
24
+ item: true,
25
+ xs: 4,
26
+ children: /*#__PURE__*/ _jsx(Stack, {
27
+ spacing: 3,
28
+ children: children
29
+ })
30
+ });
31
+ $[0] = children;
32
+ $[1] = t1;
33
+ } else {
34
+ t1 = $[1];
35
+ }
36
+ return t1;
26
37
  };
27
38
 
28
39
  //# sourceMappingURL=OptionsEditorColumn.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorColumn.tsx"],"sourcesContent":["// Copyright 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 { Grid, Stack } from '@mui/material';\nimport type { ReactElement } from 'react';\n\nexport type OptionsEditorColumnProps = {\n /**\n * Components to render in the column. These will usually be\n * `OptionsEditorGroup` components.\n */\n children: React.ReactNode;\n};\n\n/**\n * Lay out content in a column within panel options.\n */\nexport const OptionsEditorColumn = ({ children }: OptionsEditorColumnProps): ReactElement => {\n return (\n <Grid item xs={4}>\n <Stack spacing={3}>{children}</Stack>\n </Grid>\n );\n};\n"],"names":["Grid","Stack","OptionsEditorColumn","children","item","xs","spacing"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,IAAI,EAAEC,KAAK,QAAQ,gBAAgB;AAW5C;;CAEC,GACD,OAAO,MAAMC,sBAAsB,CAAC,EAAEC,QAAQ,EAA4B;IACxE,qBACE,KAACH;QAAKI,IAAI;QAACC,IAAI;kBACb,cAAA,KAACJ;YAAMK,SAAS;sBAAIH;;;AAG1B,EAAE"}
1
+ {"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorColumn.tsx"],"sourcesContent":["// Copyright 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 { Grid, Stack } from '@mui/material';\nimport type { ReactElement } from 'react';\n\nexport type OptionsEditorColumnProps = {\n /**\n * Components to render in the column. These will usually be\n * `OptionsEditorGroup` components.\n */\n children: React.ReactNode;\n};\n\n/**\n * Lay out content in a column within panel options.\n */\nexport const OptionsEditorColumn = ({ children }: OptionsEditorColumnProps): ReactElement => {\n return (\n <Grid item xs={4}>\n <Stack spacing={3}>{children}</Stack>\n </Grid>\n );\n};\n"],"names":["Grid","Stack","OptionsEditorColumn"],"mappings":";;AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,IAAI,EAAEC,KAAK,QAAQ,gBAAgB;AAW5C;;CAEC,GACD,OAAO,MAAMC,sBAAsB;;;;;;;;;;;;;;;;;;;EAMjC"}
@@ -11,71 +11,147 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { c as _c } from "react-compiler-runtime";
14
15
  import { FormControl, FormLabel, Stack, Box, IconButton } from "@mui/material";
15
16
  import InformationOutlineIcon from "mdi-material-ui/InformationOutline";
16
17
  import React, { useId } from "react";
17
18
  import { InfoTooltip } from "../InfoTooltip/index.js";
18
- export const OptionsEditorControl = ({ label, control, description })=>{
19
- // Make sure we have a unique ID we can use for associating labels and
20
- // controls for a11y.
19
+ export const OptionsEditorControl = (t0)=>{
20
+ const $ = _c(21);
21
+ const { label, control, description } = t0;
21
22
  const generatedControlId = `EditorSectionControl-${useId()}`;
22
23
  const controlId = `${generatedControlId}-control`;
23
24
  const labelId = `${generatedControlId}-label`;
24
- const controlProps = {
25
- id: controlId,
26
- 'aria-labelledby': labelId
27
- };
28
- return /*#__PURE__*/ _jsx(FormControl, {
29
- children: /*#__PURE__*/ _jsxs(Stack, {
25
+ let t1;
26
+ if ($[0] !== controlId || $[1] !== labelId) {
27
+ t1 = {
28
+ id: controlId,
29
+ "aria-labelledby": labelId
30
+ };
31
+ $[0] = controlId;
32
+ $[1] = labelId;
33
+ $[2] = t1;
34
+ } else {
35
+ t1 = $[2];
36
+ }
37
+ const controlProps = t1;
38
+ let t2;
39
+ if ($[3] !== controlId || $[4] !== label || $[5] !== labelId) {
40
+ t2 = /*#__PURE__*/ _jsx(FormLabel, {
41
+ id: labelId,
42
+ htmlFor: controlId,
43
+ children: label
44
+ });
45
+ $[3] = controlId;
46
+ $[4] = label;
47
+ $[5] = labelId;
48
+ $[6] = t2;
49
+ } else {
50
+ t2 = $[6];
51
+ }
52
+ let t3;
53
+ if ($[7] !== description) {
54
+ t3 = description && /*#__PURE__*/ _jsx(InfoTooltip, {
55
+ description: description,
56
+ enterDelay: 100,
57
+ children: /*#__PURE__*/ _jsx(IconButton, {
58
+ size: "small",
59
+ sx: _temp,
60
+ children: /*#__PURE__*/ _jsx(InformationOutlineIcon, {
61
+ "aria-describedby": "info-tooltip",
62
+ "aria-hidden": false,
63
+ fontSize: "inherit",
64
+ sx: {
65
+ color: _temp2
66
+ }
67
+ })
68
+ })
69
+ });
70
+ $[7] = description;
71
+ $[8] = t3;
72
+ } else {
73
+ t3 = $[8];
74
+ }
75
+ let t4;
76
+ if ($[9] !== t2 || $[10] !== t3) {
77
+ t4 = /*#__PURE__*/ _jsxs(Stack, {
30
78
  direction: "row",
31
79
  alignItems: "center",
32
- justifyContent: "space-between",
80
+ justifyContent: "center",
33
81
  children: [
34
- /*#__PURE__*/ _jsxs(Stack, {
35
- direction: "row",
36
- alignItems: "center",
37
- justifyContent: "center",
38
- children: [
39
- /*#__PURE__*/ _jsx(FormLabel, {
40
- id: labelId,
41
- htmlFor: controlId,
42
- children: label
43
- }),
44
- description && /*#__PURE__*/ _jsx(InfoTooltip, {
45
- description: description,
46
- enterDelay: 100,
47
- children: /*#__PURE__*/ _jsx(IconButton, {
48
- size: "small",
49
- sx: (theme)=>({
50
- borderRadius: theme.shape.borderRadius,
51
- padding: '4x',
52
- margin: '0 2px'
53
- }),
54
- children: /*#__PURE__*/ _jsx(InformationOutlineIcon, {
55
- "aria-describedby": "info-tooltip",
56
- "aria-hidden": false,
57
- fontSize: "inherit",
58
- sx: {
59
- color: (theme)=>theme.palette.grey[700]
60
- }
61
- })
62
- })
63
- })
64
- ]
65
- }),
66
- /*#__PURE__*/ _jsxs(Box, {
67
- sx: {
68
- width: '180px',
69
- textAlign: 'right'
70
- },
71
- children: [
72
- " ",
73
- /*#__PURE__*/ React.cloneElement(control, controlProps)
74
- ]
75
- })
82
+ t2,
83
+ t3
84
+ ]
85
+ });
86
+ $[9] = t2;
87
+ $[10] = t3;
88
+ $[11] = t4;
89
+ } else {
90
+ t4 = $[11];
91
+ }
92
+ let t5;
93
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
94
+ t5 = {
95
+ width: "180px",
96
+ textAlign: "right"
97
+ };
98
+ $[12] = t5;
99
+ } else {
100
+ t5 = $[12];
101
+ }
102
+ let t6;
103
+ if ($[13] !== control || $[14] !== controlProps) {
104
+ t6 = /*#__PURE__*/ React.cloneElement(control, controlProps);
105
+ $[13] = control;
106
+ $[14] = controlProps;
107
+ $[15] = t6;
108
+ } else {
109
+ t6 = $[15];
110
+ }
111
+ let t7;
112
+ if ($[16] !== t6) {
113
+ t7 = /*#__PURE__*/ _jsxs(Box, {
114
+ sx: t5,
115
+ children: [
116
+ " ",
117
+ t6
76
118
  ]
77
- })
78
- });
119
+ });
120
+ $[16] = t6;
121
+ $[17] = t7;
122
+ } else {
123
+ t7 = $[17];
124
+ }
125
+ let t8;
126
+ if ($[18] !== t4 || $[19] !== t7) {
127
+ t8 = /*#__PURE__*/ _jsx(FormControl, {
128
+ children: /*#__PURE__*/ _jsxs(Stack, {
129
+ direction: "row",
130
+ alignItems: "center",
131
+ justifyContent: "space-between",
132
+ children: [
133
+ t4,
134
+ t7
135
+ ]
136
+ })
137
+ });
138
+ $[18] = t4;
139
+ $[19] = t7;
140
+ $[20] = t8;
141
+ } else {
142
+ t8 = $[20];
143
+ }
144
+ return t8;
79
145
  };
146
+ function _temp(theme) {
147
+ return {
148
+ borderRadius: theme.shape.borderRadius,
149
+ padding: "4x",
150
+ margin: "0 2px"
151
+ };
152
+ }
153
+ function _temp2(theme_0) {
154
+ return theme_0.palette.grey[700];
155
+ }
80
156
 
81
157
  //# sourceMappingURL=OptionsEditorControl.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorControl.tsx"],"sourcesContent":["// Copyright 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 type { FormControlLabelProps } from '@mui/material';\nimport { FormControl, FormLabel, Stack, Box, IconButton } from '@mui/material';\nimport InformationOutlineIcon from 'mdi-material-ui/InformationOutline';\nimport type { ReactElement } from 'react';\nimport React, { useId } from 'react';\n\nimport { InfoTooltip } from '../InfoTooltip';\n\nexport type OptionsEditorControlProps = Pick<FormControlLabelProps, 'label' | 'control'> & {\n description?: string;\n};\n\nexport const OptionsEditorControl = ({ label, control, description }: OptionsEditorControlProps): ReactElement => {\n // Make sure we have a unique ID we can use for associating labels and\n // controls for a11y.\n const generatedControlId = `EditorSectionControl-${useId()}`;\n const controlId = `${generatedControlId}-control`;\n const labelId = `${generatedControlId}-label`;\n\n const controlProps = {\n id: controlId,\n 'aria-labelledby': labelId,\n };\n\n return (\n <FormControl>\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"space-between\">\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"center\">\n <FormLabel id={labelId} htmlFor={controlId}>\n {label}\n </FormLabel>\n {description && (\n <InfoTooltip description={description} enterDelay={100}>\n <IconButton\n size=\"small\"\n sx={(theme) => ({ borderRadius: theme.shape.borderRadius, padding: '4x', margin: '0 2px' })}\n >\n <InformationOutlineIcon\n aria-describedby=\"info-tooltip\"\n aria-hidden={false}\n fontSize=\"inherit\"\n sx={{ color: (theme) => theme.palette.grey[700] }}\n />\n </IconButton>\n </InfoTooltip>\n )}\n </Stack>\n <Box sx={{ width: '180px', textAlign: 'right' }}> {React.cloneElement(control, controlProps)}</Box>\n </Stack>\n </FormControl>\n );\n};\n"],"names":["FormControl","FormLabel","Stack","Box","IconButton","InformationOutlineIcon","React","useId","InfoTooltip","OptionsEditorControl","label","control","description","generatedControlId","controlId","labelId","controlProps","id","direction","alignItems","justifyContent","htmlFor","enterDelay","size","sx","theme","borderRadius","shape","padding","margin","aria-describedby","aria-hidden","fontSize","color","palette","grey","width","textAlign","cloneElement"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAGjC,SAASA,WAAW,EAAEC,SAAS,EAAEC,KAAK,EAAEC,GAAG,EAAEC,UAAU,QAAQ,gBAAgB;AAC/E,OAAOC,4BAA4B,qCAAqC;AAExE,OAAOC,SAASC,KAAK,QAAQ,QAAQ;AAErC,SAASC,WAAW,QAAQ,0BAAiB;AAM7C,OAAO,MAAMC,uBAAuB,CAAC,EAAEC,KAAK,EAAEC,OAAO,EAAEC,WAAW,EAA6B;IAC7F,sEAAsE;IACtE,qBAAqB;IACrB,MAAMC,qBAAqB,CAAC,qBAAqB,EAAEN,SAAS;IAC5D,MAAMO,YAAY,GAAGD,mBAAmB,QAAQ,CAAC;IACjD,MAAME,UAAU,GAAGF,mBAAmB,MAAM,CAAC;IAE7C,MAAMG,eAAe;QACnBC,IAAIH;QACJ,mBAAmBC;IACrB;IAEA,qBACE,KAACf;kBACC,cAAA,MAACE;YAAMgB,WAAU;YAAMC,YAAW;YAASC,gBAAe;;8BACxD,MAAClB;oBAAMgB,WAAU;oBAAMC,YAAW;oBAASC,gBAAe;;sCACxD,KAACnB;4BAAUgB,IAAIF;4BAASM,SAASP;sCAC9BJ;;wBAEFE,6BACC,KAACJ;4BAAYI,aAAaA;4BAAaU,YAAY;sCACjD,cAAA,KAAClB;gCACCmB,MAAK;gCACLC,IAAI,CAACC,QAAW,CAAA;wCAAEC,cAAcD,MAAME,KAAK,CAACD,YAAY;wCAAEE,SAAS;wCAAMC,QAAQ;oCAAQ,CAAA;0CAEzF,cAAA,KAACxB;oCACCyB,oBAAiB;oCACjBC,eAAa;oCACbC,UAAS;oCACTR,IAAI;wCAAES,OAAO,CAACR,QAAUA,MAAMS,OAAO,CAACC,IAAI,CAAC,IAAI;oCAAC;;;;;;8BAM1D,MAAChC;oBAAIqB,IAAI;wBAAEY,OAAO;wBAASC,WAAW;oBAAQ;;wBAAG;sCAAE/B,MAAMgC,YAAY,CAAC3B,SAASK;;;;;;AAIvF,EAAE"}
1
+ {"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorControl.tsx"],"sourcesContent":["// Copyright 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 type { FormControlLabelProps } from '@mui/material';\nimport { FormControl, FormLabel, Stack, Box, IconButton } from '@mui/material';\nimport InformationOutlineIcon from 'mdi-material-ui/InformationOutline';\nimport type { ReactElement } from 'react';\nimport React, { useId } from 'react';\n\nimport { InfoTooltip } from '../InfoTooltip';\n\nexport type OptionsEditorControlProps = Pick<FormControlLabelProps, 'label' | 'control'> & {\n description?: string;\n};\n\nexport const OptionsEditorControl = ({ label, control, description }: OptionsEditorControlProps): ReactElement => {\n // Make sure we have a unique ID we can use for associating labels and\n // controls for a11y.\n const generatedControlId = `EditorSectionControl-${useId()}`;\n const controlId = `${generatedControlId}-control`;\n const labelId = `${generatedControlId}-label`;\n\n const controlProps = {\n id: controlId,\n 'aria-labelledby': labelId,\n };\n\n return (\n <FormControl>\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"space-between\">\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"center\">\n <FormLabel id={labelId} htmlFor={controlId}>\n {label}\n </FormLabel>\n {description && (\n <InfoTooltip description={description} enterDelay={100}>\n <IconButton\n size=\"small\"\n sx={(theme) => ({ borderRadius: theme.shape.borderRadius, padding: '4x', margin: '0 2px' })}\n >\n <InformationOutlineIcon\n aria-describedby=\"info-tooltip\"\n aria-hidden={false}\n fontSize=\"inherit\"\n sx={{ color: (theme) => theme.palette.grey[700] }}\n />\n </IconButton>\n </InfoTooltip>\n )}\n </Stack>\n <Box sx={{ width: '180px', textAlign: 'right' }}> {React.cloneElement(control, controlProps)}</Box>\n </Stack>\n </FormControl>\n );\n};\n"],"names":["FormControl","FormLabel","Stack","Box","IconButton","InformationOutlineIcon","React","useId","InfoTooltip","OptionsEditorControl"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;AAGjC,SAASA,WAAW,EAAEC,SAAS,EAAEC,KAAK,EAAEC,GAAG,EAAEC,UAAU,QAAQ,gBAAgB;AAC/E,OAAOC,4BAA4B,qCAAqC;AAExE,OAAOC,SAASC,KAAK,QAAQ,QAAQ;AAErC,SAASC,WAAW,QAAQ,0BAAiB;AAM7C,OAAO,MAAMC,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuClC"}