vmui: update package-lock.json (#6532)

1. Updated `package-lock.json` to resolve [Dependabot
alerts](https://github.com/VictoriaMetrics/VictoriaMetrics/security/dependabot).
2. Updated types to align with the latest `Preact` update.

(cherry picked from commit 6cab811134)
This commit is contained in:
Yury Molodov 2024-06-26 11:11:59 +02:00 committed by hagen1778
parent 6ad66b3317
commit 25f3e700a6
No known key found for this signature in database
GPG Key ID: 3BF75F3741CA9640
5 changed files with 1732 additions and 1838 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,4 @@
import { useCallback, useEffect, useMemo, useState } from "preact/compat";
import { StateUpdater } from "preact/hooks";
import { Dispatch, SetStateAction, useCallback, useEffect, useMemo, useState } from "preact/compat";
import { getQueryRangeUrl, getQueryUrl } from "../api/query-range";
import { useAppState } from "../state/common/StateContext";
import { InstantMetricResult, MetricBase, MetricResult, QueryStats } from "../api/types";
@ -31,7 +30,7 @@ interface FetchQueryReturn {
liveData?: InstantMetricResult[],
error?: ErrorTypes | string,
queryErrors: (ErrorTypes | string)[],
setQueryErrors: StateUpdater<string[]>,
setQueryErrors: Dispatch<SetStateAction<string[]>>,
queryStats: QueryStats[],
warning?: string,
traces?: Trace[],

View File

@ -1,5 +1,4 @@
import React, { useEffect, useState, useRef } from "preact/compat";
import { StateUpdater } from "preact/hooks";
import React, { useEffect, useState, useRef, Dispatch, SetStateAction } from "preact/compat";
import { useAppState } from "../state/common/StateContext";
import { AutocompleteOptions } from "../components/Main/Autocomplete/Autocomplete";
import { LabelIcon, MetricIcon, ValueIcon } from "../components/Main/Icons";
@ -21,7 +20,7 @@ enum TypeData {
type FetchDataArgs = {
value: string;
urlSuffix: string;
setter: StateUpdater<AutocompleteOptions[]>;
setter: Dispatch<SetStateAction<AutocompleteOptions[]>>
type: TypeData;
params?: URLSearchParams;
}

View File

@ -1,8 +1,7 @@
import { useState, useEffect } from "preact/compat";
import { StateUpdater } from "preact/hooks";
import { Dispatch, useState, useEffect, SetStateAction } from "preact/compat";
import { useSearchParams } from "react-router-dom";
const useStateSearchParams = <T>(defaultState: T, key: string): [T, StateUpdater<T>] => {
const useStateSearchParams = <T>(defaultState: T, key: string): [T, Dispatch<SetStateAction<T>>] => {
const [searchParams] = useSearchParams();
const currentValue = searchParams.get(key) ? searchParams.get(key) as unknown as T : defaultState;
const [state, setState] = useState<T>(currentValue);

View File

@ -1,5 +1,4 @@
import React, { FC, useEffect, useState } from "preact/compat";
import { StateUpdater } from "preact/hooks";
import React, { Dispatch, FC, SetStateAction, useEffect, useState } from "preact/compat";
import QueryEditor from "../../../components/Configurators/QueryEditor/QueryEditor";
import AdditionalSettings from "../../../components/Configurators/AdditionalSettings/AdditionalSettings";
import usePrevious from "../../../hooks/usePrevious";
@ -28,8 +27,8 @@ import AnomalyConfig from "../../../components/ExploreAnomaly/AnomalyConfig";
export interface QueryConfiguratorProps {
queryErrors: string[];
setQueryErrors: StateUpdater<string[]>;
setHideError: StateUpdater<boolean>;
setQueryErrors: Dispatch<SetStateAction<string[]>>;
setHideError: Dispatch<SetStateAction<boolean>>;
stats: QueryStats[];
onHideQuery?: (queries: number[]) => void
onRunQuery: () => void;