@funcd-dev/ui 0.9.1 → 0.10.1
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.
- package/dist/hm-flow/components/canvas-form/canvas-form.d.ts +1 -1
- package/dist/hm-flow/components/header-status/header-status.types.d.ts +1 -1
- package/dist/hm-flow/components/node-editor/node-editor.d.ts +1 -1
- package/dist/hm-flow/components/node-search/nodes-search.d.ts +1 -1
- package/dist/hm-flow/components/toolbar/toolbar.types.d.ts +1 -1
- package/dist/index.es.js +2268 -2197
- package/dist/index.umd.js +2 -2
- package/dist/molecules/data-grid/hm/hm-data-grid.util.d.ts +1 -1
- package/dist/molecules/data-grid/hm/types.d.ts +1 -1
- package/dist/molecules/data-grid/hm/use-data-gri-parser.hook.d.ts +1 -1
- package/dist/molecules/data-grid/hm/use-render-row.hook.d.ts +1 -1
- package/dist/molecules/hm-chart/hm-chart.util.d.ts +1 -1
- package/dist/molecules/stat-card/stat-card.d.ts +2 -0
- package/dist/reactive-chart/dashboard/dynamic-chart.d.ts +3 -1
- package/dist/reactive-chart/dashboard/reactive-dashboard.d.ts +2 -2
- package/dist/reactive-chart/dashboard/types.d.ts +2 -2
- package/dist/reactive-chart/reactive-charts/index.d.ts +1 -0
- package/dist/reactive-chart/reactive-charts/reactive-bar-chart/reactive-bar-chart.util.d.ts +1 -1
- package/dist/reactive-chart/reactive-charts/reactive-bar-chart/types.d.ts +1 -1
- package/dist/reactive-chart/reactive-charts/reactive-card/index.d.ts +2 -0
- package/dist/reactive-chart/reactive-charts/reactive-card/reactive-card.d.ts +11 -0
- package/dist/reactive-chart/reactive-charts/reactive-card/types.d.ts +47 -0
- package/dist/reactive-chart/reactive-charts/reactive-line-chart/types.d.ts +1 -1
- package/dist/reactive-chart/reactive-charts/reactive-pie-chart/types.d.ts +2 -2
- package/dist/reactive-chart/reactive-charts/types/chart-custom-meta.d.ts +4 -1
- package/dist/reactive-chart/reactive-charts/types/chart-custom-props.d.ts +3 -1
- package/dist/reactive-chart/reactive-charts/types/reactive-chart-base.d.ts +10 -5
- package/dist/reactive-chart/reactive-charts/utils/chart-option.util.d.ts +1 -1
- package/dist/reactive-chart/reactive-charts/utils/use-chart-rows.d.ts +1 -1
- package/dist/reactive-form/form/dynamic-field.d.ts +1 -1
- package/dist/reactive-form/form/types.d.ts +2 -2
- package/dist/reactive-form/form-builder.d.ts +1 -1
- package/dist/reactive-form/reactive-fields/reactive-list/reactive-list-field.d.ts +1 -1
- package/dist/reactive-form/reactive-fields/reactive-list/types.d.ts +3 -3
- package/dist/reactive-form/reactive-fields/types/field-custom-meta.d.ts +1 -1
- package/dist/reactive-form/reactive-fields/types/field-custom-props.d.ts +1 -1
- package/dist/reactive-form/reactive-fields/types/field-filter-key.d.ts +1 -1
- package/dist/reactive-form/reactive-fields/types/reactive-field-base.d.ts +1 -1
- package/dist/reactive-form/reactive-fields/utils/field-error-interceptor.d.ts +1 -1
- package/dist/ui.css +1 -1
- package/dist/utils/data-utils.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Flatten } from '
|
|
1
|
+
import { Flatten } from '../../../types';
|
|
2
2
|
import { DataGridProps } from 'react-data-grid';
|
|
3
3
|
import { RDGParserParams } from './types';
|
|
4
4
|
export declare const reactDataGridParser: <TRow extends Record<string, any>>(params: RDGParserParams<Flatten<TRow>>) => DataGridProps<Flatten<TRow>, unknown, import("react").Key>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Flatten } from '
|
|
1
|
+
import { Flatten } from '../../../types';
|
|
2
2
|
import { IHMDataGrid } from './types';
|
|
3
3
|
export default function useRGDParser<TRow extends Record<string, any>>(params: IHMDataGrid<Flatten<TRow>>): import("react-data-grid").DataGridProps<{ [E in Extract<(TRow extends readonly any[] ? {
|
|
4
4
|
'0': TRow[number];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PyColorsType } from '
|
|
1
|
+
import { PyColorsType } from '../../mantine.theme';
|
|
2
2
|
import { MantineTheme } from '@mantine/core';
|
|
3
3
|
export declare const getPaletteColor: (theme: MantineTheme, color: PyColorsType, colorScheme: 'light' | 'dark') => string;
|
|
4
4
|
export declare const getSeriesColors: (theme: MantineTheme, colorScheme: 'light' | 'dark') => string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JSONData } from '
|
|
1
|
+
import { FormProps, JSONData } from '../../types';
|
|
2
2
|
import { FC } from 'react';
|
|
3
3
|
import { IChartClickParams } from '../reactive-charts/types';
|
|
4
4
|
import { IDynamicChartMeta } from './types';
|
|
@@ -6,6 +6,8 @@ interface IDynamicChart {
|
|
|
6
6
|
chart: IDynamicChartMeta;
|
|
7
7
|
data: JSONData;
|
|
8
8
|
loading?: boolean;
|
|
9
|
+
/** The form of the dashboard's filter bar, for a card's callbacks */
|
|
10
|
+
filtersForm?: FormProps<JSONData>;
|
|
9
11
|
onChartClick?: (params: IChartClickParams) => void;
|
|
10
12
|
}
|
|
11
13
|
declare const DynamicChart: FC<IDynamicChart>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IReactiveFieldMeta } from '
|
|
2
|
-
import { FormProps, JSONData } from '
|
|
1
|
+
import { IReactiveFieldMeta } from '../../reactive-form/form/types';
|
|
2
|
+
import { FormProps, JSONData } from '../../types';
|
|
3
3
|
import { IChartClickParams } from '../reactive-charts/types';
|
|
4
4
|
import { IReactiveChartMeta } from './types';
|
|
5
5
|
export interface IDashboardFilters<TFilterValues extends JSONData> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ECOption } from '
|
|
2
|
-
import { DataKeyOf, JSONData, RowOf } from '
|
|
1
|
+
import { ECOption } from '../../molecules/hm-chart';
|
|
2
|
+
import { DataKeyOf, JSONData, RowOf } from '../../types';
|
|
3
3
|
import { ReactElement, ReactNode } from 'react';
|
|
4
4
|
import { ChartType, CommonChartProps, IConditionalChartProp } from '../reactive-charts/types';
|
|
5
5
|
export interface IChartLayout {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JSONData, NestedKeyOf } from '
|
|
1
|
+
import { JSONData, NestedKeyOf } from '../../../types';
|
|
2
2
|
import { IChartSeries } from '../types/reactive-chart-base';
|
|
3
3
|
export type BarChartCustomProps<TRow extends JSONData = JSONData> = {
|
|
4
4
|
/** Row key of the categories */
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { IReactiveChart } from '../types';
|
|
3
|
+
import { CardCustomProps } from './types';
|
|
4
|
+
type ReactiveCardProps = IReactiveChart<CardCustomProps>;
|
|
5
|
+
/**
|
|
6
|
+
* One number, or a short text, in a card: taken from the first row at a key,
|
|
7
|
+
* or computed, formatted and drawn by callbacks that receive the card's
|
|
8
|
+
* context (its rows, the dashboard's data and the filter bar's values).
|
|
9
|
+
*/
|
|
10
|
+
declare const ReactiveCard: FC<ReactiveCardProps>;
|
|
11
|
+
export default ReactiveCard;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { JSONData, NestedKeyOf } from '../../../types';
|
|
2
|
+
import { MantineColor } from '@mantine/core';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
/** What a card's callbacks receive */
|
|
5
|
+
export interface ICardContext<TRow extends JSONData = JSONData> {
|
|
6
|
+
/** The rows at the card's `dataKey` */
|
|
7
|
+
rows: TRow[];
|
|
8
|
+
/** The dashboard's whole `data` */
|
|
9
|
+
data: JSONData;
|
|
10
|
+
/**
|
|
11
|
+
* The values of the dashboard's filter bar as the user sets them, before the
|
|
12
|
+
* rows that they keep arrive; empty without a bar
|
|
13
|
+
*/
|
|
14
|
+
filters: JSONData;
|
|
15
|
+
loading: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** A card's value: a number, a text, or null for none */
|
|
18
|
+
export type CardValueType = number | string | null;
|
|
19
|
+
export type CardCustomProps<TRow extends JSONData = JSONData> = {
|
|
20
|
+
/**
|
|
21
|
+
* A row key, whose value the card takes from the first row, or a callback
|
|
22
|
+
* that computes the value from the context, such as a sum of the rows
|
|
23
|
+
*/
|
|
24
|
+
value: NestedKeyOf<TRow> | ((ctx: ICardContext<TRow>) => CardValueType);
|
|
25
|
+
/**
|
|
26
|
+
* Number format of a number value, in the browser's locale, as the charts'
|
|
27
|
+
* `format`; or a callback that writes the value. Without it a number shows
|
|
28
|
+
* in the locale's format and a text as it is. A missing value shows `–`.
|
|
29
|
+
*/
|
|
30
|
+
format?: Intl.NumberFormatOptions | ((input: ICardContext<TRow> & {
|
|
31
|
+
value: CardValueType;
|
|
32
|
+
}) => string);
|
|
33
|
+
/** Text under the value, or a callback that gives it */
|
|
34
|
+
hint?: string | ((ctx: ICardContext<TRow>) => string | undefined);
|
|
35
|
+
/** Theme color of the icon */
|
|
36
|
+
color?: MantineColor;
|
|
37
|
+
/** Icon on the right of the title; a callback-free meta can be saved */
|
|
38
|
+
icon?: ReactNode;
|
|
39
|
+
/**
|
|
40
|
+
* Draws the card's body under its title instead of the value and the hint,
|
|
41
|
+
* from the value, the written value and the context
|
|
42
|
+
*/
|
|
43
|
+
renderCard?: (input: ICardContext<TRow> & {
|
|
44
|
+
value: CardValueType;
|
|
45
|
+
formatted: string;
|
|
46
|
+
}) => ReactNode;
|
|
47
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JSONData, NestedKeyOf } from '
|
|
1
|
+
import { JSONData, NestedKeyOf } from '../../../types';
|
|
2
2
|
import { IChartSeries } from '../types/reactive-chart-base';
|
|
3
3
|
export type LineChartCustomProps<TRow extends JSONData = JSONData> = {
|
|
4
4
|
/** Row key of the x axis values */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PyColorsType } from '
|
|
2
|
-
import { JSONData, NestedKeyOf } from '
|
|
1
|
+
import { PyColorsType } from '../../../mantine.theme';
|
|
2
|
+
import { JSONData, NestedKeyOf } from '../../../types';
|
|
3
3
|
export type PieChartCustomProps<TRow extends JSONData = JSONData> = {
|
|
4
4
|
/** Row key of the slice names */
|
|
5
5
|
nameKey: NestedKeyOf<TRow>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JSONData } from '
|
|
1
|
+
import { JSONData } from '../../../types';
|
|
2
2
|
import { IChartCustomProps } from './chart-custom-props';
|
|
3
3
|
export interface IConditionalChartProp<TRow extends JSONData> {
|
|
4
4
|
bar: {
|
|
@@ -10,4 +10,7 @@ export interface IConditionalChartProp<TRow extends JSONData> {
|
|
|
10
10
|
pie: {
|
|
11
11
|
customProps: IChartCustomProps<TRow>['pie'];
|
|
12
12
|
};
|
|
13
|
+
card: {
|
|
14
|
+
customProps: IChartCustomProps<TRow>['card'];
|
|
15
|
+
};
|
|
13
16
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { JSONData } from '
|
|
1
|
+
import { JSONData } from '../../../types';
|
|
2
2
|
import { BarChartCustomProps } from '../reactive-bar-chart/types';
|
|
3
|
+
import { CardCustomProps } from '../reactive-card/types';
|
|
3
4
|
import { LineChartCustomProps } from '../reactive-line-chart/types';
|
|
4
5
|
import { PieChartCustomProps } from '../reactive-pie-chart/types';
|
|
5
6
|
import { CommonChartProps } from './reactive-chart-base';
|
|
@@ -7,4 +8,5 @@ export interface IChartCustomProps<TRow extends JSONData> {
|
|
|
7
8
|
bar: CommonChartProps<BarChartCustomProps<TRow>>;
|
|
8
9
|
line: CommonChartProps<LineChartCustomProps<TRow>>;
|
|
9
10
|
pie: CommonChartProps<PieChartCustomProps<TRow>>;
|
|
11
|
+
card: CommonChartProps<CardCustomProps<TRow>>;
|
|
10
12
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { PyColorsType } from '
|
|
2
|
-
import { ECOption } from '
|
|
3
|
-
import { JSONData, NestedKeyOf } from '
|
|
1
|
+
import { PyColorsType } from '../../../mantine.theme';
|
|
2
|
+
import { ECOption } from '../../../molecules/hm-chart';
|
|
3
|
+
import { FormProps, JSONData, NestedKeyOf } from '../../../types';
|
|
4
4
|
import { ECElementEvent } from 'echarts/core';
|
|
5
|
-
export type ChartType = 'bar' | 'line' | 'pie';
|
|
5
|
+
export type ChartType = 'bar' | 'line' | 'pie' | 'card';
|
|
6
6
|
export interface IChartClickParams {
|
|
7
7
|
chartKey: string;
|
|
8
8
|
/** The clicked row, as it is in `data` */
|
|
@@ -40,7 +40,12 @@ export interface IReactiveChart<TChartProps extends JSONData, TChartData extends
|
|
|
40
40
|
options?: ECOption;
|
|
41
41
|
data: TChartData;
|
|
42
42
|
loading?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* The form of the dashboard's filter bar, whose values a card's callbacks
|
|
45
|
+
* receive
|
|
46
|
+
*/
|
|
47
|
+
filtersForm?: FormProps<JSONData>;
|
|
43
48
|
onChartClick?: (params: IChartClickParams) => void;
|
|
44
49
|
customProps: CommonChartProps<TChartProps>;
|
|
45
50
|
}
|
|
46
|
-
export type ReactiveChartStoryType<TChartProps extends JSONData, TChartData extends JSONData = JSONData> = Omit<IReactiveChart<TChartProps, TChartData>, 'data' | 'onChartClick'>;
|
|
51
|
+
export type ReactiveChartStoryType<TChartProps extends JSONData, TChartData extends JSONData = JSONData> = Omit<IReactiveChart<TChartProps, TChartData>, 'data' | 'filtersForm' | 'onChartClick'>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JSONData } from '
|
|
1
|
+
import { JSONData } from '../../../types';
|
|
2
2
|
export type ChartAxisType = 'category' | 'value' | 'time';
|
|
3
3
|
/** Axis type of the values at `key`, read from the first row like the data grid does */
|
|
4
4
|
export declare const getChartAxisType: (rows: JSONData[], key: string) => ChartAxisType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InputType, ReactiveFieldErrorType } from '
|
|
1
|
+
import { InputType, ReactiveFieldErrorType } from '../reactive-fields';
|
|
2
2
|
import { FormProps, JSONData } from '../../types';
|
|
3
3
|
import { FieldMeta } from './types';
|
|
4
4
|
interface IDynamicField<TFormValues extends JSONData> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { FormFieldOption, IConditionalProp, InputType } from '
|
|
3
|
-
import { JSONData, NestedKeyOf } from '
|
|
2
|
+
import { FormFieldOption, IConditionalProp, InputType } from '../reactive-fields/types';
|
|
3
|
+
import { JSONData, NestedKeyOf } from '../../types';
|
|
4
4
|
type PartialOption<TFormValues extends JSONData> = Omit<FormFieldOption<TFormValues>, 'onChange' | 'onBlur'>;
|
|
5
5
|
interface IPatialReactiveField<TFormValues extends JSONData, TInputType extends InputType> {
|
|
6
6
|
/** Key is used for register, input id and array map key */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElementType, FunctionComponent } from 'react';
|
|
2
|
-
import { JSONData } from '
|
|
2
|
+
import { JSONData } from '../types';
|
|
3
3
|
import { InputType, IReactiveField } from './reactive-fields';
|
|
4
4
|
type FieldMapType<TField extends JSONData, TFormValues extends JSONData = JSONData> = Record<string, ElementType<IReactiveField<TField, TFormValues>>>;
|
|
5
5
|
declare function getField<TField extends JSONData, TFormValues extends JSONData>(field: string): ElementType<IReactiveField<TField, TFormValues>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JSONData } from '
|
|
1
|
+
import { JSONData } from '../../../types';
|
|
2
2
|
import { IReactiveField } from '../types';
|
|
3
3
|
import { ListFieldCustomProps } from './types';
|
|
4
4
|
declare const ReactiveListField: <TFormValues extends JSONData>(props: IReactiveField<ListFieldCustomProps<TFormValues>, TFormValues>) => import("react").JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IHMColumn } from '
|
|
2
|
-
import { FieldMeta } from '
|
|
1
|
+
import { IHMColumn } from '../../../molecules/table/types';
|
|
2
|
+
import { FieldMeta } from '../../form/types';
|
|
3
3
|
import { MantineSize } from '@mantine/core';
|
|
4
4
|
import { InputType } from '../types';
|
|
5
|
-
import { JSONData } from '
|
|
5
|
+
import { JSONData } from '../../../types';
|
|
6
6
|
export type ListFieldColumnType<TFormValues extends JSONData> = FieldMeta<TFormValues, Exclude<InputType, 'list'>> & Pick<IHMColumn, 'rowRender'>;
|
|
7
7
|
export type ListFieldCustomProps<TFormValues extends JSONData> = {
|
|
8
8
|
size?: MantineSize;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JSONData } from '
|
|
1
|
+
import { JSONData } from '../../../types';
|
|
2
2
|
import { AutocompleteCustomProps } from '../reactive-autocomplete';
|
|
3
3
|
import { CheckCustomProps } from '../reactive-checkbox';
|
|
4
4
|
import { MultiSelectCustomProps } from '../reactive-multi-select';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DeepOmitVariableKind, JSONData } from '
|
|
1
|
+
import { DeepOmitVariableKind, JSONData } from '../../../types';
|
|
2
2
|
export interface IFilterKeys<TFormValues extends JSONData> {
|
|
3
3
|
text: DeepOmitVariableKind<TFormValues, boolean | any[]>;
|
|
4
4
|
checkbox: DeepOmitVariableKind<TFormValues, number | any[] | string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'react';
|
|
2
2
|
import { RegisterOptions } from 'react-hook-form';
|
|
3
|
-
import { JSONData, Simplify } from '
|
|
3
|
+
import { JSONData, Simplify } from '../../../types';
|
|
4
4
|
import { FormProps } from '../../../types/form';
|
|
5
5
|
export type InputType = 'text' | 'textarea' | 'number' | 'password' | 'checkbox' | 'switch' | 'select' | 'multi-select' | 'radio' | 'range' | 'range-slider' | 'period' | 'autocomplete' | 'list';
|
|
6
6
|
export type FormFieldOption<TFieldValues extends JSONData> = RegisterOptions<TFieldValues>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactiveFieldErrorType } from '
|
|
1
|
+
import { ReactiveFieldErrorType } from '../types';
|
|
2
2
|
export declare const getError: (fieldKey: string, errors: ReactiveFieldErrorType) => any;
|
|
3
3
|
export declare const errorsArrayToObject: (errorsArray: ReactiveFieldErrorType[], listKey: string) => Record<string, ReactiveFieldErrorType>;
|
|
4
4
|
export declare const getMantineError: (error: ReactiveFieldErrorType | undefined) => string | boolean;
|