@vizzly/dashboard 0.15.0-dev-8918a59c86fe6247b4e6ab94c7292899afc191c9 → 0.15.0-dev-b45c36b267f57597301af4c568315651ecc53893
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.
|
@@ -24512,6 +24512,14 @@ var asyncLoadFilterOptions = function asyncLoadFilterOptions(filter, runQueriesC
|
|
|
24512
24512
|
}();
|
|
24513
24513
|
};
|
|
24514
24514
|
|
|
24515
|
+
/**
|
|
24516
|
+
* Calculates the width of the given text by creating a temporary HTML element and measuring its offsetWidth.
|
|
24517
|
+
* @param text - The text string to measure.
|
|
24518
|
+
* @param element - The HTML element type to use for measurement (e.g., 'span').
|
|
24519
|
+
* @param styles - Optional styling properties, including fontSize and fontWeight.
|
|
24520
|
+
* @returns The calculated width of the text in pixels.
|
|
24521
|
+
* OBS: For every function call you should use useMemo to avoid infinitely re-renders (especially in Google Chrome).
|
|
24522
|
+
*/
|
|
24515
24523
|
var calculateTextWidth = function calculateTextWidth(text, element, styles) {
|
|
24516
24524
|
// Create a temporary HTML element to measure the width
|
|
24517
24525
|
|
|
@@ -24545,6 +24553,14 @@ var calculateTextWidth = function calculateTextWidth(text, element, styles) {
|
|
|
24545
24553
|
document.body.removeChild(wrapperDiv);
|
|
24546
24554
|
return textWidth;
|
|
24547
24555
|
};
|
|
24556
|
+
|
|
24557
|
+
/**
|
|
24558
|
+
* Calculates the width of a label text, ensuring a minimum width.
|
|
24559
|
+
* @param label - The text label to measure.
|
|
24560
|
+
* @param labelStyles - Optional styling properties from the theme, including fontSize and fontWeight.
|
|
24561
|
+
* @returns The calculated width in pixels, with a minimum of 124 (100 + 24 for padding).
|
|
24562
|
+
* OBS: For every function call you should use useMemo to avoid infinitely re-renders (especially in Google Chrome).
|
|
24563
|
+
*/
|
|
24548
24564
|
function calculateLabelWidth(label, labelStyles) {
|
|
24549
24565
|
var calculateLabelWidth = calculateTextWidth(label, 'span', {
|
|
24550
24566
|
fontSize: labelStyles == null ? void 0 : labelStyles.fontSize,
|
|
@@ -24554,7 +24570,7 @@ function calculateLabelWidth(label, labelStyles) {
|
|
|
24554
24570
|
}
|
|
24555
24571
|
|
|
24556
24572
|
var AdditionalSingleSelectFilter = function AdditionalSingleSelectFilter(props) {
|
|
24557
|
-
var _theme$
|
|
24573
|
+
var _theme$forms2, _props$filter$title;
|
|
24558
24574
|
var _useDashboardContext = useDashboardContext(),
|
|
24559
24575
|
runQueriesCallback = _useDashboardContext.runQueriesCallback;
|
|
24560
24576
|
var _useDashboardBehaviou = useDashboardBehaviourContext(),
|
|
@@ -24641,7 +24657,10 @@ var AdditionalSingleSelectFilter = function AdditionalSingleSelectFilter(props)
|
|
|
24641
24657
|
prevFilterRef.current = filter.optionsFilters;
|
|
24642
24658
|
}, [filter.optionsFilters]);
|
|
24643
24659
|
var label = getTitle(filter, dataSets, textOverride);
|
|
24644
|
-
var labelWidth =
|
|
24660
|
+
var labelWidth = React.useMemo(function () {
|
|
24661
|
+
var _theme$forms;
|
|
24662
|
+
return calculateLabelWidth(label, theme == null || (_theme$forms = theme.forms) == null ? void 0 : _theme$forms.select);
|
|
24663
|
+
}, [label, theme == null || (_theme$forms2 = theme.forms) == null ? void 0 : _theme$forms2.select]);
|
|
24645
24664
|
if (props.filter.hidden) return null;
|
|
24646
24665
|
var currentValue = function () {
|
|
24647
24666
|
if (valueAlias) {
|
|
@@ -25972,11 +25991,14 @@ var Modal = /*#__PURE__*/Object.assign(BaseModal, {
|
|
|
25972
25991
|
});
|
|
25973
25992
|
|
|
25974
25993
|
var AdvancedPicker = function AdvancedPicker(props) {
|
|
25975
|
-
var _theme$
|
|
25994
|
+
var _theme$forms2, _theme$modals;
|
|
25976
25995
|
var theme = useTheme();
|
|
25977
25996
|
var _useDashboardBehaviou = useDashboardBehaviourContext(),
|
|
25978
25997
|
featureToggles = _useDashboardBehaviou.featureToggles;
|
|
25979
|
-
var labelWidth =
|
|
25998
|
+
var labelWidth = React.useMemo(function () {
|
|
25999
|
+
var _theme$forms;
|
|
26000
|
+
return calculateLabelWidth(props.label, theme == null || (_theme$forms = theme.forms) == null ? void 0 : _theme$forms.select);
|
|
26001
|
+
}, [props.label, theme == null || (_theme$forms2 = theme.forms) == null ? void 0 : _theme$forms2.select]);
|
|
25980
26002
|
var inputRef = React.useRef(null);
|
|
25981
26003
|
var _useState = React.useState({}),
|
|
25982
26004
|
position = _useState[0],
|
|
@@ -29965,7 +29987,7 @@ function buildDateTimePayload(type, filter, value) {
|
|
|
29965
29987
|
}
|
|
29966
29988
|
|
|
29967
29989
|
var DateFilter$1 = function DateFilter(props) {
|
|
29968
|
-
var _theme$
|
|
29990
|
+
var _theme$forms2, _props$filter$title;
|
|
29969
29991
|
var theme = useTheme();
|
|
29970
29992
|
var _useDashboardBehaviou = useDashboardBehaviourContext(),
|
|
29971
29993
|
textOverride = _useDashboardBehaviou.textOverride,
|
|
@@ -29978,7 +30000,10 @@ var DateFilter$1 = function DateFilter(props) {
|
|
|
29978
30000
|
showClearBtn = props.showClearBtn,
|
|
29979
30001
|
type = props.type;
|
|
29980
30002
|
var label = getTitle(filter, dataSets, textOverride);
|
|
29981
|
-
var labelWidth =
|
|
30003
|
+
var labelWidth = React.useMemo(function () {
|
|
30004
|
+
var _theme$forms;
|
|
30005
|
+
return calculateLabelWidth(label, theme == null || (_theme$forms = theme.forms) == null ? void 0 : _theme$forms.select);
|
|
30006
|
+
}, [label, theme == null || (_theme$forms2 = theme.forms) == null ? void 0 : _theme$forms2.select]);
|
|
29982
30007
|
var isDateTimeFilter = !!(type === DATE_FILTER && 'allowTimeSelection' in filter && filter.allowTimeSelection);
|
|
29983
30008
|
if (props.filter.hidden) return null;
|
|
29984
30009
|
return jsxRuntime.jsx(View, {
|
|
@@ -30150,13 +30175,16 @@ var DisplayChips = function DisplayChips(_ref) {
|
|
|
30150
30175
|
};
|
|
30151
30176
|
|
|
30152
30177
|
var AdvancedDisplayValues = function AdvancedDisplayValues(props) {
|
|
30153
|
-
var
|
|
30178
|
+
var _theme$forms3, _theme$forms4, _props$label2, _theme$forms5, _theme$forms6;
|
|
30154
30179
|
var theme = useTheme();
|
|
30155
30180
|
var showSelect = props.pickerOpen || !props.defined;
|
|
30156
|
-
var textWidth =
|
|
30157
|
-
|
|
30158
|
-
|
|
30159
|
-
|
|
30181
|
+
var textWidth = React.useMemo(function () {
|
|
30182
|
+
var _props$label, _theme$forms, _theme$forms2;
|
|
30183
|
+
return calculateTextWidth((_props$label = props == null ? void 0 : props.label) != null ? _props$label : '', 'label', {
|
|
30184
|
+
fontSize: theme == null || (_theme$forms = theme.forms) == null || (_theme$forms = _theme$forms.input) == null ? void 0 : _theme$forms.fontSize,
|
|
30185
|
+
fontWeight: theme == null || (_theme$forms2 = theme.forms) == null || (_theme$forms2 = _theme$forms2.input) == null ? void 0 : _theme$forms2.fontWeight
|
|
30186
|
+
});
|
|
30187
|
+
}, [props.label, theme == null || (_theme$forms3 = theme.forms) == null || (_theme$forms3 = _theme$forms3.input) == null ? void 0 : _theme$forms3.fontSize, theme == null || (_theme$forms4 = theme.forms) == null || (_theme$forms4 = _theme$forms4.input) == null ? void 0 : _theme$forms4.fontWeight]);
|
|
30160
30188
|
var chips = getChips(props.filter, props.type, props.filter.options);
|
|
30161
30189
|
return jsxRuntime.jsx("div", {
|
|
30162
30190
|
onClick: function onClick() {
|
|
@@ -30192,7 +30220,7 @@ var AdvancedDisplayValues = function AdvancedDisplayValues(props) {
|
|
|
30192
30220
|
width: 26.5
|
|
30193
30221
|
})
|
|
30194
30222
|
}), jsxRuntime.jsx("div", {
|
|
30195
|
-
className: joinClassNames(selectControlsStyles.arrowContainer(theme == null || (_theme$
|
|
30223
|
+
className: joinClassNames(selectControlsStyles.arrowContainer(theme == null || (_theme$forms5 = theme.forms) == null ? void 0 : _theme$forms5.select, 26.5)({
|
|
30196
30224
|
subtle: 'off'
|
|
30197
30225
|
}), styles({
|
|
30198
30226
|
position: 'absolute',
|
|
@@ -30203,7 +30231,7 @@ var AdvancedDisplayValues = function AdvancedDisplayValues(props) {
|
|
|
30203
30231
|
children: jsxRuntime.jsx(ArrowButton, {
|
|
30204
30232
|
label: "open",
|
|
30205
30233
|
arrowStart: "up",
|
|
30206
|
-
styled: theme == null || (_theme$
|
|
30234
|
+
styled: theme == null || (_theme$forms6 = theme.forms) == null ? void 0 : _theme$forms6.select,
|
|
30207
30235
|
expanded: showSelect
|
|
30208
30236
|
})
|
|
30209
30237
|
})]
|
|
@@ -30494,7 +30522,7 @@ var Form = function Form(props) {
|
|
|
30494
30522
|
};
|
|
30495
30523
|
|
|
30496
30524
|
var MultiSelectFilter = function MultiSelectFilter(props) {
|
|
30497
|
-
var _theme$
|
|
30525
|
+
var _theme$forms2, _filter$value, _filter$value2, _filter$value3;
|
|
30498
30526
|
var theme = useTheme();
|
|
30499
30527
|
var prevFilterRef = React.useRef(undefined);
|
|
30500
30528
|
var _useDashboardBehaviou = useDashboardBehaviourContext(),
|
|
@@ -30634,7 +30662,10 @@ var MultiSelectFilter = function MultiSelectFilter(props) {
|
|
|
30634
30662
|
}
|
|
30635
30663
|
prevFilterRef.current = filter.optionsFilters;
|
|
30636
30664
|
}, [filter.optionsFilters]);
|
|
30637
|
-
var labelWidth =
|
|
30665
|
+
var labelWidth = React.useMemo(function () {
|
|
30666
|
+
var _theme$forms;
|
|
30667
|
+
return calculateLabelWidth(label, theme == null || (_theme$forms = theme.forms) == null ? void 0 : _theme$forms.select);
|
|
30668
|
+
}, [label, theme == null || (_theme$forms2 = theme.forms) == null ? void 0 : _theme$forms2.select]);
|
|
30638
30669
|
if (props.filter.hidden) return null;
|
|
30639
30670
|
return jsxRuntime.jsx(View, {
|
|
30640
30671
|
minWidth: labelWidth + 36,
|