isp-ui-kit 0.9.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/README.md +46 -0
- package/dist/FormComponents/FormCheckbox/FormCheckbox.d.ts +3 -0
- package/dist/FormComponents/FormCheckbox/form-checkbox.type.d.ts +4 -0
- package/dist/FormComponents/FormCodeEditor/FormCodeEditor.d.ts +4 -0
- package/dist/FormComponents/FormCodeEditor/form-code-editor.type.d.ts +7 -0
- package/dist/FormComponents/FormInput/FormInput.d.ts +5 -0
- package/dist/FormComponents/FormInput/form-input.type.d.ts +4 -0
- package/dist/FormComponents/FormInputNumber/FormInputNumber.d.ts +5 -0
- package/dist/FormComponents/FormInputNumber/form-input-number.type.d.ts +4 -0
- package/dist/FormComponents/FormInputPassword/FormInputPassword.d.ts +5 -0
- package/dist/FormComponents/FormInputPassword/form-input-password.type.d.ts +4 -0
- package/dist/FormComponents/FormRadioGroup/FormRadioGroup.d.ts +4 -0
- package/dist/FormComponents/FormRadioGroup/form-radio-group.type.d.ts +7 -0
- package/dist/FormComponents/FormSelect/FormSelect.d.ts +5 -0
- package/dist/FormComponents/FormSelect/form-select.type.d.ts +4 -0
- package/dist/FormComponents/FormTextArea/FormTextArea.d.ts +5 -0
- package/dist/FormComponents/FormTextArea/form-text-area.type.d.ts +4 -0
- package/dist/FormComponents/FormTreeSelect/FormTreeSelect.d.ts +5 -0
- package/dist/FormComponents/FormTreeSelect/form-tree-select.type.d.ts +4 -0
- package/dist/FormComponents/formTypes.d.ts +17 -0
- package/dist/FormComponents/index.d.ts +9 -0
- package/dist/Layout/Column/Column.d.ts +4 -0
- package/dist/Layout/Column/column.type.d.ts +22 -0
- package/dist/Layout/ContentColumn/ContentColumn.d.ts +5 -0
- package/dist/Layout/ContentColumn/content-column.d.ts +3 -0
- package/dist/Layout/EmptyData/EmptyData.d.ts +3 -0
- package/dist/Layout/ErrorPage/ErrorPage.d.ts +5 -0
- package/dist/Layout/ErrorPage/error-page.d.ts +3 -0
- package/dist/Layout/HomePage/HomePage.d.ts +5 -0
- package/dist/Layout/HomePage/home-page.d.ts +4 -0
- package/dist/Layout/NoData/NoData.d.ts +3 -0
- package/dist/Layout/NotFoundPage/NotFoundPage.d.ts +5 -0
- package/dist/Layout/NotFoundPage/not-found-page.d.ts +3 -0
- package/dist/Layout/ThreeColumn/ThreeColumn.d.ts +4 -0
- package/dist/Layout/ThreeColumn/three-column.type.d.ts +4 -0
- package/dist/Layout/index.d.ts +8 -0
- package/dist/SearchInput/SearchInput.d.ts +3 -0
- package/dist/SearchInput/search-input.type.d.ts +3 -0
- package/dist/hooks/useAuth.d.ts +25 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +1 -0
- package/dist/utils/configUtils.d.ts +8 -0
- package/package.json +106 -0
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
## Команды
|
|
2
|
+
|
|
3
|
+
`npm install --legacy-peer-deps` - установка зависимостей
|
|
4
|
+
|
|
5
|
+
`npm build` - Собрать пакет
|
|
6
|
+
|
|
7
|
+
`npm storybook` - Запустить storybook
|
|
8
|
+
|
|
9
|
+
`npm build-storybook` - Собрать storybook
|
|
10
|
+
|
|
11
|
+
`npm pub` - сборка проекта, фиксирование версии, публикация пакета
|
|
12
|
+
|
|
13
|
+
## Обновление версии
|
|
14
|
+
|
|
15
|
+
Обязательно перед пушем новой версии. собрать команду через `npm build`
|
|
16
|
+
|
|
17
|
+
## Установка пакета в другие проекты
|
|
18
|
+
|
|
19
|
+
Для установки пакета необходимо установить его через ссылку github
|
|
20
|
+
|
|
21
|
+
### Возможные проблемы
|
|
22
|
+
|
|
23
|
+
#### Не подгружаются стили
|
|
24
|
+
|
|
25
|
+
Для поддержки смены светлой/темной темы используются `css переменные`
|
|
26
|
+
|
|
27
|
+
Для включения их в проекте, необходимо добавить `antd-конфиг`
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
<ConfigProvider theme={{cssVar: true}} locale={ruRu}>
|
|
31
|
+
<App/>
|
|
32
|
+
</ConfigProvider>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
#### Ошибка импорта vite
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
TypeError: Super expression must either be null or a function
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Добавить плагин для vite
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
vite-plugin-node-polyfills
|
|
45
|
+
```
|
|
46
|
+
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
|
2
|
+
import { FormCheckboxGroupProps } from './form-checkbox.type';
|
|
3
|
+
export default function FormCheckbox<T extends FieldValues>({ control, name, label, rules, ...rest }: FormCheckboxGroupProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
|
2
|
+
import { FormCodeEditorProps } from './form-code-editor.type';
|
|
3
|
+
declare const _default: <T extends FieldValues>({ control, name, height, disable, language, ...rest }: FormCodeEditorProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
|
2
|
+
import { EditorProps } from '@monaco-editor/react';
|
|
3
|
+
import { FormComponentProps } from '../formTypes';
|
|
4
|
+
export type FormCodeEditorProps<TFormValues extends FieldValues> = FormComponentProps<TFormValues> & EditorProps & {
|
|
5
|
+
height?: string;
|
|
6
|
+
disable?: boolean;
|
|
7
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
|
2
|
+
import { FormInputProps } from './form-input.type';
|
|
3
|
+
import '../form-components.scss';
|
|
4
|
+
declare const _default: <T extends FieldValues>({ control, name, rules, label, controlClassName, ...rest }: FormInputProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
|
2
|
+
import { FormInputNumberProps } from './form-input-number.type';
|
|
3
|
+
import '../form-components.scss';
|
|
4
|
+
declare const _default: <T extends FieldValues>({ control, name, rules, label, controlClassName, ...rest }: FormInputNumberProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
|
2
|
+
import { FormInputPasswordProps } from './form-input-password.type';
|
|
3
|
+
import '../form-components.scss';
|
|
4
|
+
declare const _default: <T extends FieldValues>({ control, name, rules, label, ...rest }: FormInputPasswordProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
|
2
|
+
import { FormRadioGroupProps } from './form-radio-group.type';
|
|
3
|
+
declare const _default: <T extends FieldValues>({ control, name, label, rules, type, items, ...rest }: FormRadioGroupProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RadioGroupProps } from 'antd';
|
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
|
3
|
+
import { FormComponentProps, LabelItem } from '../formTypes';
|
|
4
|
+
export type FormRadioGroupProps<TFormValues extends FieldValues> = FormComponentProps<TFormValues> & RadioGroupProps & {
|
|
5
|
+
type?: 'radio' | 'button';
|
|
6
|
+
items: LabelItem[];
|
|
7
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
|
2
|
+
import { FormSelectProps } from './form-select.type';
|
|
3
|
+
import '../form-components.scss';
|
|
4
|
+
declare const _default: <T extends FieldValues>({ defaultValue, control, name, label, mode, rules, ...rest }: FormSelectProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
|
2
|
+
import { FormTextAreaProps } from './form-text-area.type';
|
|
3
|
+
import '../form-components.scss';
|
|
4
|
+
declare const _default: <T extends FieldValues>({ control, name, rules, label, controlClassName, ...rest }: FormTextAreaProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
|
2
|
+
import { FormTreeSelectProps } from './form-tree-select.type';
|
|
3
|
+
import '../form-components.scss';
|
|
4
|
+
declare const _default: <T extends FieldValues>({ control, name, label, rules, ...rest }: FormTreeSelectProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Control, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
2
|
+
export interface FormComponentProps<TFormValues extends FieldValues> {
|
|
3
|
+
control: Control<TFormValues>;
|
|
4
|
+
name: Path<TFormValues>;
|
|
5
|
+
rules?: Omit<RegisterOptions<TFormValues>, 'required'> & {
|
|
6
|
+
required?: {
|
|
7
|
+
value: boolean;
|
|
8
|
+
message: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
controlClassName?: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
}
|
|
14
|
+
export type LabelItem = {
|
|
15
|
+
value: any;
|
|
16
|
+
label: any;
|
|
17
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as FormCheckbox } from './FormCheckbox/FormCheckbox';
|
|
2
|
+
export { default as FormCodeEditor } from './FormCodeEditor/FormCodeEditor';
|
|
3
|
+
export { default as FormInput } from './FormInput/FormInput';
|
|
4
|
+
export { default as FormInputNumber } from './FormInputNumber/FormInputNumber';
|
|
5
|
+
export { default as FormInputPassword } from './FormInputPassword/FormInputPassword';
|
|
6
|
+
export { default as FormRadioGroup } from './FormRadioGroup/FormRadioGroup';
|
|
7
|
+
export { default as FormSelect } from './FormSelect/FormSelect';
|
|
8
|
+
export { default as FormTextArea } from './FormTextArea/FormTextArea';
|
|
9
|
+
export { default as FormTreeSelect } from './FormTreeSelect/FormTreeSelect';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ColumnProps } from './column.type';
|
|
2
|
+
import './column.scss';
|
|
3
|
+
declare const Column: <T extends {}>({ title, searchPlaceholder, items, onAddItem, onUpdateItem, onRemoveItem, showRemoveBtn, showUpdateBtn, showAddBtn, selectedItemId, setSelectedItemId, searchValue, onChangeSearchValue, renderItems, }: ColumnProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export default Column;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ChangeEvent, ReactElement, ReactNode } from 'react';
|
|
2
|
+
export interface ColumnProps<T extends {}> {
|
|
3
|
+
title?: string;
|
|
4
|
+
items: ColumnItem<T>[];
|
|
5
|
+
renderItems: (item: T) => ReactElement;
|
|
6
|
+
searchPlaceholder?: string;
|
|
7
|
+
searchValue: string;
|
|
8
|
+
selectedItemId: string;
|
|
9
|
+
showAddBtn?: boolean;
|
|
10
|
+
showUpdateBtn?: boolean;
|
|
11
|
+
showRemoveBtn?: boolean;
|
|
12
|
+
setSelectedItemId: (itemId: string) => void;
|
|
13
|
+
onChangeSearchValue: (value: string, event: ChangeEvent<HTMLInputElement>) => void;
|
|
14
|
+
onAddItem?: () => void;
|
|
15
|
+
onUpdateItem?: (id: string) => void;
|
|
16
|
+
onRemoveItem?: (id: string) => void;
|
|
17
|
+
}
|
|
18
|
+
export type ColumnItem<T extends {}> = T & {
|
|
19
|
+
name: string;
|
|
20
|
+
id: string | number;
|
|
21
|
+
icon?: ReactNode;
|
|
22
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as Column } from './Column/Column';
|
|
2
|
+
export { default as ContentColumn } from './ContentColumn/ContentColumn';
|
|
3
|
+
export { default as NoData } from './NoData/NoData';
|
|
4
|
+
export { default as EmptyData } from './EmptyData/EmptyData';
|
|
5
|
+
export { default as HomePage } from './HomePage/HomePage';
|
|
6
|
+
export { default as ErrorPage } from './ErrorPage/ErrorPage';
|
|
7
|
+
export { default as NotFoundPage } from './NotFoundPage/NotFoundPage';
|
|
8
|
+
export { default as ThreeColumn } from './ThreeColumn/ThreeColumn';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface UserData {
|
|
2
|
+
email: string;
|
|
3
|
+
password: string;
|
|
4
|
+
}
|
|
5
|
+
export interface AuthResponse {
|
|
6
|
+
expired: string;
|
|
7
|
+
headerName: string;
|
|
8
|
+
token: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SudirRequest {
|
|
11
|
+
authCode: string;
|
|
12
|
+
}
|
|
13
|
+
export interface IsLogged {
|
|
14
|
+
type: 'basic' | 'sudir';
|
|
15
|
+
value: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface UseAuth {
|
|
18
|
+
isLogged: IsLogged;
|
|
19
|
+
isLoading: boolean;
|
|
20
|
+
login: (path: string, data: UserData, headers?: Record<string, string>) => Promise<AuthResponse>;
|
|
21
|
+
logout: (path: string, headers?: Record<string, string>) => Promise<void>;
|
|
22
|
+
sudirLogin: (path: string, data: SudirRequest, headers?: Record<string, string>) => Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
declare const useAuth: () => UseAuth;
|
|
25
|
+
export default useAuth;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as FormComponents from './FormComponents';
|
|
2
|
+
import * as Layout from './Layout';
|
|
3
|
+
import SearchInput from './SearchInput/SearchInput';
|
|
4
|
+
import useAuth from './hooks/useAuth';
|
|
5
|
+
import { getConfigProperty } from './utils/configUtils';
|
|
6
|
+
import ReactJsonView from './ReactJsonView/js';
|
|
7
|
+
export { FormComponents, SearchInput, Layout, useAuth, getConfigProperty, ReactJsonView, };
|