Use Math.min to simplify ternary clamping expressions (S7766)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -68,7 +68,7 @@
|
||||
dataKey="id"
|
||||
breakpoint="0"
|
||||
:tableClass="tableClass"
|
||||
@row-select="onRowSelect"
|
||||
@row-select="onRowSelectionChange"
|
||||
>
|
||||
<ColumnGroup type="header">
|
||||
<Row>
|
||||
@@ -140,8 +140,8 @@
|
||||
dataKey="id"
|
||||
breakpoint="0"
|
||||
tableClass="w-full !border-separate !border-spacing-x-2 !table-auto text-sm"
|
||||
@row-select="onRowSelect"
|
||||
@row-unselect="onRowUnselect"
|
||||
@row-select="onRowSelectionChange"
|
||||
@row-unselect="onRowSelectionChange"
|
||||
@row-select-all="onRowSelectAll($event)"
|
||||
@row-unselect-all="onRowUnelectAll"
|
||||
>
|
||||
@@ -526,21 +526,9 @@ const labelsData = computed(() => {
|
||||
});
|
||||
|
||||
/**
|
||||
* Selects an option in the categorical table.
|
||||
* Emits the current attribute selection when a row is selected or deselected.
|
||||
*/
|
||||
function onRowSelect() {
|
||||
const type = selectedAttName.value.type;
|
||||
const data = {
|
||||
type: type,
|
||||
data: selectedAttRange.value,
|
||||
};
|
||||
emit("select-attribute", data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deselects an option in the categorical table.
|
||||
*/
|
||||
function onRowUnselect() {
|
||||
function onRowSelectionChange() {
|
||||
const type = selectedAttName.value.type;
|
||||
const data = {
|
||||
type: type,
|
||||
@@ -915,7 +903,7 @@ function sliderValueRange(e, direction) {
|
||||
(sliderData[sliderData.length - 1] - sliderData[0])) *
|
||||
sliderData.length;
|
||||
let result = Math.round(Math.abs(closestIndex));
|
||||
result = result > selectRange.value ? selectRange.value : result;
|
||||
result = Math.min(result, selectRange.value);
|
||||
return result;
|
||||
});
|
||||
// Update the slider
|
||||
|
||||
@@ -381,7 +381,7 @@ function sliderTimeRange(e, direction) {
|
||||
(sliderDataVal[sliderDataVal.length - 1] - sliderDataVal[0])) *
|
||||
sliderDataVal.length;
|
||||
let result = Math.round(Math.abs(closestIndex));
|
||||
result = result > selectRange.value ? selectRange.value : result;
|
||||
result = Math.min(result, selectRange.value);
|
||||
return result;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user