@funcd-dev/ui 0.0.0-bootstrap.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.
- package/Readme.md +10 -0
- package/dist/atoms/index.d.ts +1 -0
- package/dist/atoms/logo/cnd.d.ts +6 -0
- package/dist/atoms/logo/index.d.ts +1 -0
- package/dist/auth/auth.context.d.ts +3 -0
- package/dist/auth/auth.guard.d.ts +7 -0
- package/dist/auth/auth.hooks.d.ts +3 -0
- package/dist/auth/auth.provider.d.ts +10 -0
- package/dist/auth/index.d.ts +4 -0
- package/dist/favicon.svg +1 -0
- package/dist/hm-flow/components/canvas-form/canvas-form.d.ts +10 -0
- package/dist/hm-flow/components/canvas-form/index.d.ts +1 -0
- package/dist/hm-flow/components/header-status/header-status.d.ts +11 -0
- package/dist/hm-flow/components/header-status/header-status.types.d.ts +13 -0
- package/dist/hm-flow/components/header-status/index.d.ts +2 -0
- package/dist/hm-flow/components/hm-flow-bottom/hm-flow-bottom.d.ts +7 -0
- package/dist/hm-flow/components/hm-flow-bottom/hm-flow-bottom.type.d.ts +5 -0
- package/dist/hm-flow/components/hm-flow-bottom/index.d.ts +3 -0
- package/dist/hm-flow/components/hm-flow-header/hm-flow-header.d.ts +7 -0
- package/dist/hm-flow/components/hm-flow-header/hm-flow-header.type.d.ts +5 -0
- package/dist/hm-flow/components/hm-flow-header/index.d.ts +3 -0
- package/dist/hm-flow/components/hm-flow-modal/hm-flow-modal.d.ts +11 -0
- package/dist/hm-flow/components/hm-flow-modal/hm-flow-modal.type.d.ts +13 -0
- package/dist/hm-flow/components/hm-flow-modal/index.d.ts +3 -0
- package/dist/hm-flow/components/hm-flow-sidebar/hm-flow-sidebar.d.ts +11 -0
- package/dist/hm-flow/components/hm-flow-sidebar/hm-flow-sidebar.type.d.ts +5 -0
- package/dist/hm-flow/components/hm-flow-sidebar/index.d.ts +3 -0
- package/dist/hm-flow/components/index.d.ts +9 -0
- package/dist/hm-flow/components/node-editor/index.d.ts +1 -0
- package/dist/hm-flow/components/node-editor/node-editor.d.ts +7 -0
- package/dist/hm-flow/components/node-search/index.d.ts +2 -0
- package/dist/hm-flow/components/node-search/nodes-item.d.ts +8 -0
- package/dist/hm-flow/components/node-search/nodes-search.d.ts +8 -0
- package/dist/hm-flow/components/toolbar/index.d.ts +1 -0
- package/dist/hm-flow/components/toolbar/toolbar.d.ts +7 -0
- package/dist/hm-flow/components/toolbar/toolbar.types.d.ts +17 -0
- package/dist/hm-flow/hm-flow-base.d.ts +18 -0
- package/dist/hm-flow/hm-flow-base.types.d.ts +61 -0
- package/dist/hm-flow/hm-flow.d.ts +18 -0
- package/dist/hm-flow/hm-flow.types.d.ts +60 -0
- package/dist/hm-flow/hooks/index.d.ts +7 -0
- package/dist/hm-flow/hooks/use-hm-flow-children-deps.d.ts +2 -0
- package/dist/hm-flow/hooks/use-hm-flow-interactions.d.ts +28 -0
- package/dist/hm-flow/hooks/use-hm-flow-service.d.ts +19 -0
- package/dist/hm-flow/hooks/use-hm-flow.d.ts +2 -0
- package/dist/hm-flow/hooks/use-nodes-edges-handlers.d.ts +21 -0
- package/dist/hm-flow/hooks/use-nodes-service.d.ts +11 -0
- package/dist/hm-flow/index.d.ts +9 -0
- package/dist/hm-flow/node/index.d.ts +4 -0
- package/dist/hm-flow/node/node-wrapper.d.ts +9 -0
- package/dist/hm-flow/node/node.d.ts +5 -0
- package/dist/hm-flow/node/types.d.ts +35 -0
- package/dist/hm-flow/node/utils.d.ts +3 -0
- package/dist/hm-flow/provider/hm-flow-children-deps-context.d.ts +5 -0
- package/dist/hm-flow/provider/hm-flow-children-deps-provider.d.ts +8 -0
- package/dist/hm-flow/provider/hm-flow-context.d.ts +5 -0
- package/dist/hm-flow/provider/hm-flow-provider.d.ts +8 -0
- package/dist/hm-flow/provider/index.d.ts +5 -0
- package/dist/hm-flow/utils.d.ts +5 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.es.js +6905 -0
- package/dist/index.umd.js +1 -0
- package/dist/layouts/app-layout/app-layout.d.ts +15 -0
- package/dist/layouts/app-layout/index.d.ts +1 -0
- package/dist/layouts/bottom-bar/bottom-bar-button.d.ts +12 -0
- package/dist/layouts/bottom-bar/bottom-bar.d.ts +8 -0
- package/dist/layouts/bottom-bar/index.d.ts +1 -0
- package/dist/layouts/header/header.d.ts +8 -0
- package/dist/layouts/header/index.d.ts +1 -0
- package/dist/layouts/index.d.ts +5 -0
- package/dist/layouts/sidebar/index.d.ts +1 -0
- package/dist/layouts/sidebar/navbar-button.d.ts +11 -0
- package/dist/layouts/sidebar/sidebar.d.ts +7 -0
- package/dist/layouts/types/common.d.ts +10 -0
- package/dist/layouts/types/index.d.ts +1 -0
- package/dist/mantine.theme.d.ts +6 -0
- package/dist/molecules/data-grid/data-grid.d.ts +5 -0
- package/dist/molecules/data-grid/hm/data-grid-container.d.ts +8 -0
- package/dist/molecules/data-grid/hm/hm-data-grid.util.d.ts +7 -0
- package/dist/molecules/data-grid/hm/render-checkbox.d.ts +3 -0
- package/dist/molecules/data-grid/hm/render-row.d.ts +7 -0
- package/dist/molecules/data-grid/hm/types.d.ts +171 -0
- package/dist/molecules/data-grid/hm/use-data-gri-parser.hook.d.ts +359 -0
- package/dist/molecules/data-grid/hm/use-render-row.hook.d.ts +3 -0
- package/dist/molecules/data-grid/hm-data-grid.d.ts +4 -0
- package/dist/molecules/data-grid/index.d.ts +2 -0
- package/dist/molecules/flow-card/card.d.ts +14 -0
- package/dist/molecules/flow-card/index.d.ts +1 -0
- package/dist/molecules/hm-chart/hm-chart.util.d.ts +113 -0
- package/dist/molecules/hm-chart/index.d.ts +21 -0
- package/dist/molecules/hm-drawer.d.ts +5 -0
- package/dist/molecules/index.d.ts +9 -0
- package/dist/molecules/nav-bar-link.d.ts +7 -0
- package/dist/molecules/search-bar/index.d.ts +4 -0
- package/dist/molecules/stats-ring/index.d.ts +10 -0
- package/dist/molecules/table/HmTableAction.d.ts +8 -0
- package/dist/molecules/table/HmTableHead.d.ts +7 -0
- package/dist/molecules/table/HmTableRow.d.ts +8 -0
- package/dist/molecules/table/index.d.ts +9 -0
- package/dist/molecules/table/types.d.ts +15 -0
- package/dist/molecules/toggle-theme-mode/index.d.ts +4 -0
- package/dist/reactive-chart/chart-builder.d.ts +15 -0
- package/dist/reactive-chart/dashboard/chart-group.d.ts +9 -0
- package/dist/reactive-chart/dashboard/dynamic-chart.d.ts +12 -0
- package/dist/reactive-chart/dashboard/index.d.ts +3 -0
- package/dist/reactive-chart/dashboard/reactive-dashboard.d.ts +13 -0
- package/dist/reactive-chart/dashboard/types.d.ts +58 -0
- package/dist/reactive-chart/dashboard-layout/layout-grid-item.d.ts +10 -0
- package/dist/reactive-chart/dashboard-layout/layout-grid.d.ts +8 -0
- package/dist/reactive-chart/index.d.ts +3 -0
- package/dist/reactive-chart/reactive-charts/index.d.ts +5 -0
- package/dist/reactive-chart/reactive-charts/reactive-bar-chart/index.d.ts +2 -0
- package/dist/reactive-chart/reactive-charts/reactive-bar-chart/reactive-bar-chart.d.ts +5 -0
- package/dist/reactive-chart/reactive-charts/reactive-bar-chart/types.d.ts +11 -0
- package/dist/reactive-chart/reactive-charts/reactive-line-chart/index.d.ts +2 -0
- package/dist/reactive-chart/reactive-charts/reactive-line-chart/reactive-line-chart.d.ts +5 -0
- package/dist/reactive-chart/reactive-charts/reactive-line-chart/types.d.ts +11 -0
- package/dist/reactive-chart/reactive-charts/reactive-pie-chart/index.d.ts +2 -0
- package/dist/reactive-chart/reactive-charts/reactive-pie-chart/reactive-pie-chart.d.ts +5 -0
- package/dist/reactive-chart/reactive-charts/reactive-pie-chart/types.d.ts +12 -0
- package/dist/reactive-chart/reactive-charts/types/chart-custom-meta.d.ts +13 -0
- package/dist/reactive-chart/reactive-charts/types/chart-custom-props.d.ts +10 -0
- package/dist/reactive-chart/reactive-charts/types/index.d.ts +3 -0
- package/dist/reactive-chart/reactive-charts/types/reactive-chart-base.d.ts +37 -0
- package/dist/reactive-chart/reactive-charts/utils/chart-container.d.ts +13 -0
- package/dist/reactive-chart/reactive-charts/utils/chart-option.util.d.ts +9 -0
- package/dist/reactive-chart/reactive-charts/utils/index.d.ts +3 -0
- package/dist/reactive-chart/reactive-charts/utils/use-chart-rows.d.ts +10 -0
- package/dist/reactive-form/form/dynamic-field.d.ts +10 -0
- package/dist/reactive-form/form/form-group.d.ts +9 -0
- package/dist/reactive-form/form/index.d.ts +3 -0
- package/dist/reactive-form/form/reactive-form.d.ts +8 -0
- package/dist/reactive-form/form/types.d.ts +25 -0
- package/dist/reactive-form/form-builder.d.ts +16 -0
- package/dist/reactive-form/form-layout/layout-flex.d.ts +5 -0
- package/dist/reactive-form/index.d.ts +3 -0
- package/dist/reactive-form/reactive-fields/index.d.ts +14 -0
- package/dist/reactive-form/reactive-fields/reactive-autocomplete/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-autocomplete/reactive-autocomplete.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-autocomplete/types.d.ts +12 -0
- package/dist/reactive-form/reactive-fields/reactive-checkbox/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-checkbox/reactive-checkbox.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-checkbox/types.d.ts +4 -0
- package/dist/reactive-form/reactive-fields/reactive-list/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-list/reactive-list-field.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-list/types.d.ts +10 -0
- package/dist/reactive-form/reactive-fields/reactive-multi-select/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-multi-select/reactive-multi-select.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-multi-select/types.d.ts +12 -0
- package/dist/reactive-form/reactive-fields/reactive-number-field/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-number-field/number-field.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-number-field/types.d.ts +6 -0
- package/dist/reactive-form/reactive-fields/reactive-password-field/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-password-field/reactive-password-field.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-password-field/types.d.ts +11 -0
- package/dist/reactive-form/reactive-fields/reactive-radio/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-radio/reactive-radio.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-radio/types.d.ts +9 -0
- package/dist/reactive-form/reactive-fields/reactive-range/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-range/reactive-range.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-range/types.d.ts +18 -0
- package/dist/reactive-form/reactive-fields/reactive-select/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-select/reactive-select.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-select/types.d.ts +6 -0
- package/dist/reactive-form/reactive-fields/reactive-switch/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-switch/reactive-switch.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-switch/types.d.ts +4 -0
- package/dist/reactive-form/reactive-fields/reactive-text-field/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-text-field/reactive-text-field.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-text-field/types.d.ts +4 -0
- package/dist/reactive-form/reactive-fields/reactive-textarea-field/index.d.ts +2 -0
- package/dist/reactive-form/reactive-fields/reactive-textarea-field/reactive-textarea-field.d.ts +5 -0
- package/dist/reactive-form/reactive-fields/reactive-textarea-field/types.d.ts +6 -0
- package/dist/reactive-form/reactive-fields/types/field-custom-meta.d.ts +22 -0
- package/dist/reactive-form/reactive-fields/types/field-custom-props.d.ts +29 -0
- package/dist/reactive-form/reactive-fields/types/field-filter-key.d.ts +6 -0
- package/dist/reactive-form/reactive-fields/types/index.d.ts +4 -0
- package/dist/reactive-form/reactive-fields/types/reactive-field-base.d.ts +35 -0
- package/dist/reactive-form/reactive-fields/utils/field-error-interceptor.d.ts +4 -0
- package/dist/reactive-form/reactive-fields/utils/index.d.ts +1 -0
- package/dist/template/create-node-form/create-node-form.d.ts +8 -0
- package/dist/template/create-node-form/index.d.ts +3 -0
- package/dist/template/create-node-form/parameter-block.d.ts +16 -0
- package/dist/template/create-node-form/useCreateNodeForm.d.ts +27 -0
- package/dist/template/index.d.ts +1 -0
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/theme.context.d.ts +10 -0
- package/dist/theme/theme.provider.d.ts +8 -0
- package/dist/types/common.d.ts +1 -0
- package/dist/types/form.d.ts +2 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/nested-props.d.ts +60 -0
- package/dist/types/object-utils.d.ts +43 -0
- package/dist/types/path-value.d.ts +10 -0
- package/dist/ui.css +2 -0
- package/dist/utils/async-response-parser.util.d.ts +31 -0
- package/dist/utils/data-utils.d.ts +3 -0
- package/dist/utils/field-regex.util.d.ts +6 -0
- package/dist/utils/index.d.ts +3 -0
- package/package.json +115 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ElementType, FunctionComponent } from 'react';
|
|
2
|
+
import { JSONData } from '@/types';
|
|
3
|
+
import { InputType, IReactiveField } from './reactive-fields';
|
|
4
|
+
type FieldMapType<TField extends JSONData, TFormValues extends JSONData = JSONData> = Record<string, ElementType<IReactiveField<TField, TFormValues>>>;
|
|
5
|
+
declare function getField<TField extends JSONData, TFormValues extends JSONData>(field: string): ElementType<IReactiveField<TField, TFormValues>>;
|
|
6
|
+
interface IDefineComponent {
|
|
7
|
+
name: InputType;
|
|
8
|
+
component: FunctionComponent<IReactiveField<any>>;
|
|
9
|
+
}
|
|
10
|
+
declare const defineWidget: (params: IDefineComponent) => void;
|
|
11
|
+
declare const _default: {
|
|
12
|
+
fieldMap: FieldMapType<any, JSONData>;
|
|
13
|
+
defineWidget: typeof defineWidget;
|
|
14
|
+
getField: typeof getField;
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './reactive-multi-select';
|
|
2
|
+
export * from './reactive-autocomplete';
|
|
3
|
+
export * from './reactive-checkbox';
|
|
4
|
+
export * from './reactive-number-field';
|
|
5
|
+
export * from './reactive-password-field';
|
|
6
|
+
export * from './reactive-radio';
|
|
7
|
+
export * from './reactive-range';
|
|
8
|
+
export * from './reactive-select';
|
|
9
|
+
export * from './reactive-switch';
|
|
10
|
+
export * from './reactive-text-field';
|
|
11
|
+
export * from './reactive-textarea-field';
|
|
12
|
+
export * from './reactive-list';
|
|
13
|
+
export * from './types';
|
|
14
|
+
export * from './utils';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComboboxData, MantineSize } from '@mantine/core';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export type AutocompleteCustomProps = {
|
|
4
|
+
data: ComboboxData;
|
|
5
|
+
size?: MantineSize;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
limit?: number;
|
|
8
|
+
maxDropdownHeight?: number;
|
|
9
|
+
leftSection?: ReactNode;
|
|
10
|
+
rightSection?: ReactNode;
|
|
11
|
+
onDropdownOpen?: () => void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { JSONData } from '@/types';
|
|
2
|
+
import { IReactiveField } from '../types';
|
|
3
|
+
import { ListFieldCustomProps } from './types';
|
|
4
|
+
declare const ReactiveListField: <TFormValues extends JSONData>(props: IReactiveField<ListFieldCustomProps<TFormValues>, TFormValues>) => import("react").JSX.Element;
|
|
5
|
+
export default ReactiveListField;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IHMColumn } from '@/molecules/table/types';
|
|
2
|
+
import { FieldMeta } from '@/reactive-form/form/types';
|
|
3
|
+
import { MantineSize } from '@mantine/core';
|
|
4
|
+
import { InputType } from '../types';
|
|
5
|
+
import { JSONData } from '@/types';
|
|
6
|
+
export type ListFieldColumnType<TFormValues extends JSONData> = FieldMeta<TFormValues, Exclude<InputType, 'list'>> & Pick<IHMColumn, 'rowRender'>;
|
|
7
|
+
export type ListFieldCustomProps<TFormValues extends JSONData> = {
|
|
8
|
+
size?: MantineSize;
|
|
9
|
+
columns: ListFieldColumnType<TFormValues>[];
|
|
10
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComboboxData, MantineSize } from '@mantine/core';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export type MultiSelectCustomProps = {
|
|
4
|
+
data: ComboboxData;
|
|
5
|
+
size?: MantineSize;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
limit?: number;
|
|
8
|
+
maxDropdownHeight?: number;
|
|
9
|
+
leftSection?: ReactNode;
|
|
10
|
+
rightSection?: ReactNode;
|
|
11
|
+
onDropdownOpen?: () => void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MantineSize } from '@mantine/core';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
export type PasswordFieldCustomProps = {
|
|
4
|
+
/** Adds icon on the left side of input */
|
|
5
|
+
size?: MantineSize;
|
|
6
|
+
leftSection?: React.ReactNode;
|
|
7
|
+
rightSection?: React.ReactNode;
|
|
8
|
+
visibilityToggleIcon?: FC<{
|
|
9
|
+
reveal: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MantineSize } from '@mantine/core';
|
|
2
|
+
export type RangeCustomProps = {
|
|
3
|
+
/** Marks which will be placed on the track */
|
|
4
|
+
marks?: {
|
|
5
|
+
value: number;
|
|
6
|
+
label?: React.ReactNode;
|
|
7
|
+
}[];
|
|
8
|
+
size?: MantineSize;
|
|
9
|
+
step?: number;
|
|
10
|
+
thumbSize?: number;
|
|
11
|
+
/** Thumb children, can be used to add icon */
|
|
12
|
+
thumbChildren?: React.ReactNode;
|
|
13
|
+
max?: number;
|
|
14
|
+
min?: number;
|
|
15
|
+
inverted?: boolean;
|
|
16
|
+
/** A transformation function, to change the scale of the slider */
|
|
17
|
+
scale?: (value: number) => number;
|
|
18
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { JSONData } from '@/types';
|
|
2
|
+
import { ICustomProps } from './field-custom-props';
|
|
3
|
+
import { InputType } from './reactive-field-base';
|
|
4
|
+
type CustomProps<TInputType extends InputType, TFormValues extends JSONData> = {
|
|
5
|
+
customProps: ICustomProps<TFormValues>[TInputType];
|
|
6
|
+
};
|
|
7
|
+
export type ConditionalProp<TInputType extends InputType, TFormValues extends JSONData = JSONData, IsPartialProps extends boolean = false> = IsPartialProps extends true ? Partial<CustomProps<TInputType, TFormValues>> : CustomProps<TInputType, TFormValues>;
|
|
8
|
+
export interface IConditionalProp<TFormValues extends JSONData> {
|
|
9
|
+
autocomplete: ConditionalProp<'autocomplete', TFormValues>;
|
|
10
|
+
text: ConditionalProp<'text', TFormValues, true>;
|
|
11
|
+
textarea: ConditionalProp<'textarea', TFormValues, true>;
|
|
12
|
+
password: ConditionalProp<'password', TFormValues, true>;
|
|
13
|
+
number: ConditionalProp<'number', TFormValues, true>;
|
|
14
|
+
checkbox: ConditionalProp<'checkbox', TFormValues, true>;
|
|
15
|
+
switch: ConditionalProp<'switch', TFormValues, true>;
|
|
16
|
+
select: ConditionalProp<'select', TFormValues, true>;
|
|
17
|
+
radio: ConditionalProp<'radio', TFormValues>;
|
|
18
|
+
range: ConditionalProp<'range', TFormValues>;
|
|
19
|
+
'multi-select': ConditionalProp<'multi-select', TFormValues>;
|
|
20
|
+
list: ConditionalProp<'list'>;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { JSONData } from '@/types';
|
|
2
|
+
import { AutocompleteCustomProps } from '../reactive-autocomplete';
|
|
3
|
+
import { CheckCustomProps } from '../reactive-checkbox';
|
|
4
|
+
import { MultiSelectCustomProps } from '../reactive-multi-select';
|
|
5
|
+
import { NumberFieldCustomProps } from '../reactive-number-field';
|
|
6
|
+
import { PasswordFieldCustomProps } from '../reactive-password-field';
|
|
7
|
+
import { RadioCustomProps } from '../reactive-radio';
|
|
8
|
+
import { RangeCustomProps } from '../reactive-range';
|
|
9
|
+
import { SelectCustomProps } from '../reactive-select';
|
|
10
|
+
import { SwitchCustomProps } from '../reactive-switch';
|
|
11
|
+
import { TextFieldCustomProps } from '../reactive-text-field';
|
|
12
|
+
import { CommonProps, InputType } from './reactive-field-base';
|
|
13
|
+
import { ListFieldCustomProps } from '../reactive-list';
|
|
14
|
+
import { TextareaFieldCustomProps } from '../reactive-textarea-field';
|
|
15
|
+
export type CustomPropsType = Record<InputType, any>;
|
|
16
|
+
export interface ICustomProps<TFormValues extends JSONData> {
|
|
17
|
+
autocomplete: CommonProps<AutocompleteCustomProps, TFormValues>;
|
|
18
|
+
text: CommonProps<TextFieldCustomProps, TFormValues>;
|
|
19
|
+
textarea: CommonProps<TextareaFieldCustomProps, TFormValues>;
|
|
20
|
+
password: CommonProps<PasswordFieldCustomProps, TFormValues>;
|
|
21
|
+
number: CommonProps<NumberFieldCustomProps, TFormValues>;
|
|
22
|
+
checkbox: CommonProps<CheckCustomProps, TFormValues>;
|
|
23
|
+
switch: CommonProps<SwitchCustomProps, TFormValues>;
|
|
24
|
+
select: CommonProps<SelectCustomProps, TFormValues>;
|
|
25
|
+
radio: CommonProps<RadioCustomProps, TFormValues>;
|
|
26
|
+
range: CommonProps<RangeCustomProps, TFormValues>;
|
|
27
|
+
'multi-select': CommonProps<MultiSelectCustomProps, TFormValues>;
|
|
28
|
+
list: CommonProps<ListFieldCustomProps<TFormValues>, TFormValues>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DeepOmitVariableKind, JSONData } from '@/types';
|
|
2
|
+
export interface IFilterKeys<TFormValues extends JSONData> {
|
|
3
|
+
text: DeepOmitVariableKind<TFormValues, boolean | any[]>;
|
|
4
|
+
checkbox: DeepOmitVariableKind<TFormValues, number | any[] | string>;
|
|
5
|
+
switch: DeepOmitVariableKind<TFormValues, number | any[] | string>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { RegisterOptions } from 'react-hook-form';
|
|
3
|
+
import { JSONData, Simplify } from '@/types';
|
|
4
|
+
import { FormProps } from '../../../types/form';
|
|
5
|
+
export type InputType = 'text' | 'textarea' | 'number' | 'password' | 'checkbox' | 'switch' | 'select' | 'multi-select' | 'radio' | 'range' | 'autocomplete' | 'list';
|
|
6
|
+
export type FormFieldOption<TFieldValues extends JSONData> = RegisterOptions<TFieldValues>;
|
|
7
|
+
export type ErrorFormType = {
|
|
8
|
+
type: string;
|
|
9
|
+
message: string;
|
|
10
|
+
ref: Ref<HTMLElement>;
|
|
11
|
+
};
|
|
12
|
+
export type ReactiveFieldErrorType = ErrorFormType | Record<string, any>;
|
|
13
|
+
export type ReactiveFieldProps<TFieldProps extends JSONData> = Simplify<{
|
|
14
|
+
'data-testid': string;
|
|
15
|
+
} & TFieldProps>;
|
|
16
|
+
export interface IReactiveField<TFieldProps extends JSONData, TFormValues extends JSONData = JSONData> {
|
|
17
|
+
/** Key is used for register, input id and array map key */
|
|
18
|
+
fieldKey: string;
|
|
19
|
+
/** label is used for the input displayed name */
|
|
20
|
+
label: string;
|
|
21
|
+
/** react-hook-form register's options */
|
|
22
|
+
options?: FormFieldOption<TFormValues>;
|
|
23
|
+
form: FormProps<TFormValues>;
|
|
24
|
+
customProps: CommonProps<TFieldProps, TFormValues>;
|
|
25
|
+
error?: ReactiveFieldErrorType;
|
|
26
|
+
}
|
|
27
|
+
export type ReactiveFieldStoryType<TFieldProps extends JSONData, TFormValues extends JSONData = JSONData> = Omit<IReactiveField<TFieldProps, TFormValues>, 'error' | 'form'>;
|
|
28
|
+
export type CommonProps<TFieldProps extends JSONData, TFormValues extends JSONData = JSONData> = {
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
hidden?: boolean;
|
|
31
|
+
handleChange?: (params: {
|
|
32
|
+
form: FormProps<TFormValues>;
|
|
33
|
+
event: any;
|
|
34
|
+
}) => void;
|
|
35
|
+
} & TFieldProps;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ReactiveFieldErrorType } from '@/reactive-form/reactive-fields/types';
|
|
2
|
+
export declare const getError: (fieldKey: string, errors: ReactiveFieldErrorType) => any;
|
|
3
|
+
export declare const errorsArrayToObject: (errorsArray: ReactiveFieldErrorType[], listKey: string) => Record<string, ReactiveFieldErrorType>;
|
|
4
|
+
export declare const getMantineError: (error: ReactiveFieldErrorType | undefined) => string | boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './field-error-interceptor';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { useCreateNodeForm } from './useCreateNodeForm';
|
|
3
|
+
interface ICreateNodeForm {
|
|
4
|
+
submitButtonText: string;
|
|
5
|
+
onSubmit: (formValues: ReturnType<typeof useCreateNodeForm>['formValues'], parameters: ReturnType<typeof useCreateNodeForm>['parameters'], wasmFile: File | null) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const CreateNodeForm: FC<ICreateNodeForm>;
|
|
8
|
+
export default CreateNodeForm;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface IParameter {
|
|
3
|
+
name: string;
|
|
4
|
+
defaultValue: string;
|
|
5
|
+
type: string;
|
|
6
|
+
description: string;
|
|
7
|
+
required: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface IParameterBlock {
|
|
10
|
+
index: number;
|
|
11
|
+
param: IParameter;
|
|
12
|
+
onUpdate: <K extends keyof IParameter>(index: number, field: K, value: IParameter[K]) => void;
|
|
13
|
+
onDelete: () => void;
|
|
14
|
+
}
|
|
15
|
+
declare const ParameterBlock: FC<IParameterBlock>;
|
|
16
|
+
export default ParameterBlock;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface IFormValues {
|
|
2
|
+
name: string;
|
|
3
|
+
label: string;
|
|
4
|
+
icon: File | Blob | null;
|
|
5
|
+
color: string;
|
|
6
|
+
version: string;
|
|
7
|
+
description: string;
|
|
8
|
+
}
|
|
9
|
+
export interface IParameter {
|
|
10
|
+
name: string;
|
|
11
|
+
defaultValue: string;
|
|
12
|
+
type: string;
|
|
13
|
+
description: string;
|
|
14
|
+
required: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const initialFormValues: IFormValues;
|
|
17
|
+
export declare const useCreateNodeForm: () => {
|
|
18
|
+
formValues: IFormValues;
|
|
19
|
+
updateFormValue: <K extends keyof IFormValues>(field: K, value: IFormValues[K]) => void;
|
|
20
|
+
parameters: IParameter[];
|
|
21
|
+
addParameter: () => void;
|
|
22
|
+
updateParameter: <K extends keyof IParameter>(index: number, field: K, value: IParameter[K]) => void;
|
|
23
|
+
deleteParameter: (index: number) => void;
|
|
24
|
+
wasmFile: File | null;
|
|
25
|
+
setWasmFile: import("react").Dispatch<import("react").SetStateAction<File | null>>;
|
|
26
|
+
resetForm: () => void;
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './create-node-form';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface IThemeContext {
|
|
2
|
+
}
|
|
3
|
+
/**
|
|
4
|
+
* HMR breaks by Vitejs with React context provider
|
|
5
|
+
* The workaround is to dedicate a seperate file for context and his related provider
|
|
6
|
+
* @see https://github.com/vitejs/vite/issues/3301#issuecomment-1192661323
|
|
7
|
+
* work in progress to resolve this vitejs isssue
|
|
8
|
+
* @see https://github.com/vitejs/vite/issues/3301#issuecomment-1257374648
|
|
9
|
+
*/
|
|
10
|
+
export declare const ThemeContext: import("react").Context<IThemeContext>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type JSONData = Record<string, any>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @see https://gist.github.com/staltz/368866ea6b8a167fbdac58cddf79c1bf?permalink_comment_id=3805194#gistcomment-3805194
|
|
3
|
+
* @see https://dev.to/pffigueiredo/typescript-utility-keyof-nested-object-2pa3
|
|
4
|
+
* @see https://steveholgado.com/typescript-types-from-arrays/
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* not implemented yet @see https://github.com/microsoft/TypeScript/issues/34933
|
|
8
|
+
*/
|
|
9
|
+
export type NestedKeyOf<DynamicValue extends object> = {
|
|
10
|
+
[Key in keyof DynamicValue & (string | number)]: DynamicValue[Key] extends any[] ? `${Key}` : DynamicValue[Key] extends object ? `${Key}.${NestedKeyOf2<DynamicValue[Key]>}` : `${Key}`;
|
|
11
|
+
}[keyof DynamicValue & (string | number)];
|
|
12
|
+
type NestedKeyOf2<DynamicValue extends object> = {
|
|
13
|
+
[Key in keyof DynamicValue & (string | number)]: DynamicValue[Key] extends any[] ? `${Key}` : DynamicValue[Key] extends object ? `${Key}.${NestedKeyOf3<DynamicValue[Key]>}` : `${Key}`;
|
|
14
|
+
}[keyof DynamicValue & (string | number)];
|
|
15
|
+
type NestedKeyOf3<DynamicValue extends object> = {
|
|
16
|
+
[Key in keyof DynamicValue & (string | number)]: DynamicValue[Key] extends any[] ? `${Key}` : DynamicValue[Key] extends object ? `${Key}.${NestedKeyOf4<DynamicValue[Key]>}` : `${Key}`;
|
|
17
|
+
}[keyof DynamicValue & (string | number)];
|
|
18
|
+
type NestedKeyOf4<DynamicValue extends object> = {
|
|
19
|
+
[Key in keyof DynamicValue & (string | number)]: DynamicValue[Key] extends any[] ? `${Key}` : DynamicValue[Key] extends object ? `${Key}.${NestedKeyOf5<DynamicValue[Key]>}` : `${Key}`;
|
|
20
|
+
}[keyof DynamicValue & (string | number)];
|
|
21
|
+
type NestedKeyOf5<DynamicValue extends object> = {
|
|
22
|
+
[Key in keyof DynamicValue & (string | number)]: `${Key}`;
|
|
23
|
+
}[keyof DynamicValue & (string | number)];
|
|
24
|
+
/** Union of primitives to skip with deep omit utilities. */
|
|
25
|
+
export type Primitive = string | number | boolean | undefined | null;
|
|
26
|
+
/** Variable Kind */
|
|
27
|
+
type VariableKind = string | number | boolean;
|
|
28
|
+
/**
|
|
29
|
+
* @see https://gist.github.com/ahuggins-nhs/826906a58e4c1e59306bc0792e7826d1
|
|
30
|
+
*/
|
|
31
|
+
/** Deeply omit members of an array of interface or array of type. */
|
|
32
|
+
export type DeepOmitArray<T extends object[], K> = {
|
|
33
|
+
[P in keyof T]: DeepOmit<T[P], K>;
|
|
34
|
+
};
|
|
35
|
+
export type DeepOmit<T, K> = T extends Primitive ? T : {
|
|
36
|
+
[P in Exclude<keyof T, K>]: T[P] extends infer TP ? TP extends Primitive[] ? TP : TP extends object[] ? DeepOmitArray<TP, K> : TP extends Primitive ? TP : DeepOmit<TP, K> : never;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Omit given variable
|
|
40
|
+
*/
|
|
41
|
+
export type DeepOmitVariableKind<T, U extends VariableKind | Primitive[] | Record<string, any>[] | any[]> = {
|
|
42
|
+
[P in Exclude<keyof T, GetKeyKind<T, U>>]: T[P] extends infer TP ? TP extends any[] ? TP : TP extends object ? DeepOmitVariableKind<TP, U> : TP : never;
|
|
43
|
+
};
|
|
44
|
+
type GetKeyKind<T, U extends VariableKind | Primitive[] | Record<string, any>[]> = {
|
|
45
|
+
[K in keyof T]: T[K] extends U ? K : never;
|
|
46
|
+
}[keyof T];
|
|
47
|
+
export type DeepNonNullable<T> = T extends Primitive ? T : {
|
|
48
|
+
[P in keyof T]: T[P] extends infer TP ? TP extends object ? DeepNonNullable<TP> : NonNullable<TP> : never;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Deep remove undefined
|
|
52
|
+
*/
|
|
53
|
+
export type DeepRequired<T> = {
|
|
54
|
+
[P in keyof T]-?: DeepRequired<T[P]>;
|
|
55
|
+
};
|
|
56
|
+
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & Partial<T>;
|
|
57
|
+
export {};
|
|
58
|
+
/**
|
|
59
|
+
* below is a test for NestedKeyOf
|
|
60
|
+
*/
|