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.
Files changed (43) hide show
  1. package/README.md +46 -0
  2. package/dist/FormComponents/FormCheckbox/FormCheckbox.d.ts +3 -0
  3. package/dist/FormComponents/FormCheckbox/form-checkbox.type.d.ts +4 -0
  4. package/dist/FormComponents/FormCodeEditor/FormCodeEditor.d.ts +4 -0
  5. package/dist/FormComponents/FormCodeEditor/form-code-editor.type.d.ts +7 -0
  6. package/dist/FormComponents/FormInput/FormInput.d.ts +5 -0
  7. package/dist/FormComponents/FormInput/form-input.type.d.ts +4 -0
  8. package/dist/FormComponents/FormInputNumber/FormInputNumber.d.ts +5 -0
  9. package/dist/FormComponents/FormInputNumber/form-input-number.type.d.ts +4 -0
  10. package/dist/FormComponents/FormInputPassword/FormInputPassword.d.ts +5 -0
  11. package/dist/FormComponents/FormInputPassword/form-input-password.type.d.ts +4 -0
  12. package/dist/FormComponents/FormRadioGroup/FormRadioGroup.d.ts +4 -0
  13. package/dist/FormComponents/FormRadioGroup/form-radio-group.type.d.ts +7 -0
  14. package/dist/FormComponents/FormSelect/FormSelect.d.ts +5 -0
  15. package/dist/FormComponents/FormSelect/form-select.type.d.ts +4 -0
  16. package/dist/FormComponents/FormTextArea/FormTextArea.d.ts +5 -0
  17. package/dist/FormComponents/FormTextArea/form-text-area.type.d.ts +4 -0
  18. package/dist/FormComponents/FormTreeSelect/FormTreeSelect.d.ts +5 -0
  19. package/dist/FormComponents/FormTreeSelect/form-tree-select.type.d.ts +4 -0
  20. package/dist/FormComponents/formTypes.d.ts +17 -0
  21. package/dist/FormComponents/index.d.ts +9 -0
  22. package/dist/Layout/Column/Column.d.ts +4 -0
  23. package/dist/Layout/Column/column.type.d.ts +22 -0
  24. package/dist/Layout/ContentColumn/ContentColumn.d.ts +5 -0
  25. package/dist/Layout/ContentColumn/content-column.d.ts +3 -0
  26. package/dist/Layout/EmptyData/EmptyData.d.ts +3 -0
  27. package/dist/Layout/ErrorPage/ErrorPage.d.ts +5 -0
  28. package/dist/Layout/ErrorPage/error-page.d.ts +3 -0
  29. package/dist/Layout/HomePage/HomePage.d.ts +5 -0
  30. package/dist/Layout/HomePage/home-page.d.ts +4 -0
  31. package/dist/Layout/NoData/NoData.d.ts +3 -0
  32. package/dist/Layout/NotFoundPage/NotFoundPage.d.ts +5 -0
  33. package/dist/Layout/NotFoundPage/not-found-page.d.ts +3 -0
  34. package/dist/Layout/ThreeColumn/ThreeColumn.d.ts +4 -0
  35. package/dist/Layout/ThreeColumn/three-column.type.d.ts +4 -0
  36. package/dist/Layout/index.d.ts +8 -0
  37. package/dist/SearchInput/SearchInput.d.ts +3 -0
  38. package/dist/SearchInput/search-input.type.d.ts +3 -0
  39. package/dist/hooks/useAuth.d.ts +25 -0
  40. package/dist/index.d.ts +7 -0
  41. package/dist/index.js +1 -0
  42. package/dist/utils/configUtils.d.ts +8 -0
  43. 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 { CheckboxProps } from 'antd/lib';
2
+ import { FieldValues } from 'react-hook-form';
3
+ import { FormComponentProps } from '../formTypes';
4
+ export type FormCheckboxGroupProps<TFormValues extends FieldValues> = FormComponentProps<TFormValues> & CheckboxProps;
@@ -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,4 @@
1
+ import { InputProps } from 'antd';
2
+ import { FieldValues } from 'react-hook-form';
3
+ import { FormComponentProps } from '../formTypes';
4
+ export type FormInputProps<TFormValues extends FieldValues> = FormComponentProps<TFormValues> & InputProps;
@@ -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,4 @@
1
+ import { InputProps } from 'antd';
2
+ import { FieldValues } from 'react-hook-form';
3
+ import { FormComponentProps } from '../formTypes';
4
+ export type FormInputNumberProps<TFormValues extends FieldValues> = FormComponentProps<TFormValues> & InputProps;
@@ -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 { InputProps } from 'antd';
2
+ import { FieldValues } from 'react-hook-form';
3
+ import { FormComponentProps } from '../formTypes';
4
+ export type FormInputPasswordProps<TFormValues extends FieldValues> = FormComponentProps<TFormValues> & InputProps;
@@ -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,4 @@
1
+ import { SelectProps } from 'antd';
2
+ import { FieldValues } from 'react-hook-form';
3
+ import { FormComponentProps } from '../formTypes';
4
+ export type FormSelectProps<TFormValues extends FieldValues> = FormComponentProps<TFormValues> & SelectProps;
@@ -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,4 @@
1
+ import { FieldValues } from 'react-hook-form';
2
+ import { TextAreaProps } from 'antd/lib/input';
3
+ import { FormComponentProps } from '../formTypes';
4
+ export type FormTextAreaProps<TFormValues extends FieldValues> = FormComponentProps<TFormValues> & TextAreaProps;
@@ -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,4 @@
1
+ import { TreeSelectProps } from 'antd';
2
+ import { FieldValues } from 'react-hook-form';
3
+ import { FormComponentProps } from '../formTypes';
4
+ export type FormTreeSelectProps<TFormValues extends FieldValues> = FormComponentProps<TFormValues> & TreeSelectProps & {};
@@ -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,5 @@
1
+ import './content-column.scss';
2
+ import { FC } from 'react';
3
+ import { ContentColumnProps } from './content-column';
4
+ declare const ContentColumn: FC<ContentColumnProps>;
5
+ export default ContentColumn;
@@ -0,0 +1,3 @@
1
+ import { HTMLAttributes, PropsWithChildren } from 'react';
2
+ export interface ContentColumnProps extends PropsWithChildren<HTMLAttributes<HTMLDivElement>> {
3
+ }
@@ -0,0 +1,3 @@
1
+ import './empty-data.scss';
2
+ declare const EmptyData: () => import("react/jsx-runtime").JSX.Element;
3
+ export default EmptyData;
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { ErrorPageProps } from './error-page';
3
+ import './error-page.scss';
4
+ declare const ErrorPage: FC<ErrorPageProps>;
5
+ export default ErrorPage;
@@ -0,0 +1,3 @@
1
+ import { PropsWithChildren } from 'react';
2
+ export interface ErrorPageProps extends PropsWithChildren {
3
+ }
@@ -0,0 +1,5 @@
1
+ import './home-page.scss';
2
+ import { FC } from 'react';
3
+ import { HomePageProps } from './home-page';
4
+ declare const HomePage: FC<HomePageProps>;
5
+ export default HomePage;
@@ -0,0 +1,4 @@
1
+ import { PropsWithChildren } from 'react';
2
+ export interface HomePageProps extends PropsWithChildren {
3
+ backgroundImage?: string;
4
+ }
@@ -0,0 +1,3 @@
1
+ import './noData.scss';
2
+ declare const NoData: () => import("react/jsx-runtime").JSX.Element;
3
+ export default NoData;
@@ -0,0 +1,5 @@
1
+ import './not-found-page.scss';
2
+ import { FC } from 'react';
3
+ import { NotFoundPageProps } from './not-found-page';
4
+ declare const NotFoundPage: FC<NotFoundPageProps>;
5
+ export default NotFoundPage;
@@ -0,0 +1,3 @@
1
+ import { PropsWithChildren } from 'react';
2
+ export interface NotFoundPageProps extends PropsWithChildren {
3
+ }
@@ -0,0 +1,4 @@
1
+ import { ThreeColumnProps } from './three-column.type';
2
+ import './three-column.scss';
3
+ declare const ThreeColumn: ({ children, ...rest }: ThreeColumnProps) => import("react/jsx-runtime").JSX.Element;
4
+ export default ThreeColumn;
@@ -0,0 +1,4 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export interface ThreeColumnProps extends HTMLAttributes<HTMLDivElement> {
3
+ children: ReactNode;
4
+ }
@@ -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,3 @@
1
+ import SearchInputProps from './search-input.type';
2
+ declare const SearchInput: ({ ...rest }: SearchInputProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default SearchInput;
@@ -0,0 +1,3 @@
1
+ import { InputProps } from 'antd';
2
+ type SearchInputProps = InputProps;
3
+ export default SearchInputProps;
@@ -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;
@@ -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, };