namirasoft-site-react 1.3.65 → 1.3.67
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/App.js +2 -2
- package/dist/App.js.map +1 -1
- package/dist/Validator.d.ts +6 -6
- package/dist/Validator.js.map +1 -1
- package/dist/components/NSButton.d.ts +5 -5
- package/dist/components/NSButton.js.map +1 -1
- package/dist/components/NSButtonBlue.d.ts +2 -2
- package/dist/components/NSButtonBlue.js.map +1 -1
- package/dist/components/NSButtonGreen.d.ts +2 -2
- package/dist/components/NSButtonGreen.js.map +1 -1
- package/dist/components/NSButtonRed.d.ts +2 -2
- package/dist/components/NSButtonRed.js.map +1 -1
- package/dist/components/NSCard.d.ts +7 -7
- package/dist/components/NSCard.js.map +1 -1
- package/dist/components/NSCopyToClipboard.d.ts +3 -3
- package/dist/components/NSCopyToClipboard.js.map +1 -1
- package/dist/components/NSEntityBar.d.ts +5 -5
- package/dist/components/NSEntityBar.js.map +1 -1
- package/dist/components/NSEntityCardBackground.d.ts +5 -5
- package/dist/components/NSEntityCardBackground.js.map +1 -1
- package/dist/components/NSFooter.d.ts +4 -4
- package/dist/components/NSFooter.js.map +1 -1
- package/dist/components/NSHeader.d.ts +5 -5
- package/dist/components/NSHeader.js.map +1 -1
- package/dist/components/NSInputDate.d.ts +5 -5
- package/dist/components/NSInputDate.js.map +1 -1
- package/dist/components/NSInputDuration.d.ts +7 -7
- package/dist/components/NSInputDuration.js.map +1 -1
- package/dist/components/NSInputEmail.d.ts +6 -6
- package/dist/components/NSInputEmail.js.map +1 -1
- package/dist/components/NSInputErrorNotifier.d.ts +3 -3
- package/dist/components/NSInputErrorNotifier.js.map +1 -1
- package/dist/components/NSInputFloat.d.ts +6 -6
- package/dist/components/NSInputFloat.js.map +1 -1
- package/dist/components/NSInputIP.d.ts +6 -6
- package/dist/components/NSInputIP.js.map +1 -1
- package/dist/components/NSInputInteger.d.ts +6 -6
- package/dist/components/NSInputInteger.js.map +1 -1
- package/dist/components/NSInputPassword.d.ts +6 -6
- package/dist/components/NSInputPassword.js.map +1 -1
- package/dist/components/NSInputPhone.d.ts +6 -6
- package/dist/components/NSInputPhone.js.map +1 -1
- package/dist/components/NSInputPrice.d.ts +6 -6
- package/dist/components/NSInputPrice.js.map +1 -1
- package/dist/components/NSInputSearch.d.ts +6 -6
- package/dist/components/NSInputSearch.js.map +1 -1
- package/dist/components/NSInputString.d.ts +6 -6
- package/dist/components/NSInputString.js.map +1 -1
- package/dist/components/NSInputText.d.ts +6 -6
- package/dist/components/NSInputText.js.map +1 -1
- package/dist/components/NSInputTime.d.ts +6 -6
- package/dist/components/NSInputTime.js.map +1 -1
- package/dist/components/NSLayout.d.ts +5 -5
- package/dist/components/NSLayout.js.map +1 -1
- package/dist/components/NSLayoutHeroBanner.d.ts +4 -4
- package/dist/components/NSLayoutHeroBanner.js.map +1 -1
- package/dist/components/NSLayoutTitle.d.ts +4 -4
- package/dist/components/NSLayoutTitle.js.map +1 -1
- package/dist/components/NSLink.d.ts +4 -4
- package/dist/components/NSLink.js.map +1 -1
- package/dist/components/NSLinkBlue.d.ts +2 -2
- package/dist/components/NSLinkBlue.js.map +1 -1
- package/dist/components/NSLinkGreen.d.ts +2 -2
- package/dist/components/NSLinkGreen.js.map +1 -1
- package/dist/components/NSLinkRed.d.ts +2 -2
- package/dist/components/NSLinkRed.js.map +1 -1
- package/dist/components/NSLoading.d.ts +3 -3
- package/dist/components/NSLoading.js.map +1 -1
- package/dist/components/NSNotification.d.ts +3 -3
- package/dist/components/NSNotification.js +1 -1
- package/dist/components/NSNotification.js.map +1 -1
- package/dist/components/NSPagination.d.ts +3 -3
- package/dist/components/NSPagination.js.map +1 -1
- package/dist/components/NSPanel.d.ts +3 -3
- package/dist/components/NSPanel.js.map +1 -1
- package/dist/components/NSSection.d.ts +3 -3
- package/dist/components/NSSection.js.map +1 -1
- package/dist/components/NSSectionBars.d.ts +5 -5
- package/dist/components/NSSectionBars.js.map +1 -1
- package/dist/components/NSSectionCards.d.ts +7 -7
- package/dist/components/NSSectionCards.js.map +1 -1
- package/dist/components/NSSectionTitle.d.ts +3 -3
- package/dist/components/NSSectionTitle.js.map +1 -1
- package/dist/components/NSSelectBox.d.ts +5 -5
- package/dist/components/NSSelectBox.js.map +1 -1
- package/dist/components/NSSpace.d.ts +3 -3
- package/dist/components/NSSpace.js.map +1 -1
- package/dist/components/NSTable.d.ts +4 -4
- package/dist/components/NSTable.js.map +1 -1
- package/dist/components/NSTitle.d.ts +3 -3
- package/dist/components/NSTitle.js.map +1 -1
- package/dist/main.d.ts +11 -0
- package/dist/main.js +11 -0
- package/dist/main.js.map +1 -1
- package/dist/pages/NSLoginPage.d.ts +2 -2
- package/dist/pages/NSLoginPage.js.map +1 -1
- package/dist/props/{BaseComponentProps.d.ts → IBaseComponentProps.d.ts} +1 -1
- package/dist/props/IBaseComponentProps.js +2 -0
- package/dist/props/IBaseComponentProps.js.map +1 -0
- package/dist/props/{ImageProps.d.ts → IImageProps.d.ts} +1 -1
- package/dist/props/IImageProps.js +2 -0
- package/dist/props/IImageProps.js.map +1 -0
- package/dist/props/{LinkProps.d.ts → ILinkProps.d.ts} +1 -1
- package/dist/props/ILinkProps.js +2 -0
- package/dist/props/ILinkProps.js.map +1 -0
- package/dist/props/INamirasoftProps.d.ts +4 -0
- package/dist/props/INamirasoftProps.js +2 -0
- package/dist/props/INamirasoftProps.js.map +1 -0
- package/dist/props/IValidationNumberProps.d.ts +4 -0
- package/dist/props/IValidationNumberProps.js +2 -0
- package/dist/props/IValidationNumberProps.js.map +1 -0
- package/dist/props/IValidationProps.d.ts +6 -0
- package/dist/props/IValidationProps.js +2 -0
- package/dist/props/IValidationProps.js.map +1 -0
- package/dist/props/IValidationRegexProps.d.ts +4 -0
- package/dist/props/IValidationRegexProps.js +2 -0
- package/dist/props/IValidationRegexProps.js.map +1 -0
- package/dist/props/{ValidationStringProps.d.ts → IValidationStringProps.d.ts} +1 -1
- package/dist/props/IValidationStringProps.js +2 -0
- package/dist/props/IValidationStringProps.js.map +1 -0
- package/dist/routing/INSRouterMaker.d.ts +5 -0
- package/dist/routing/INSRouterMaker.js +2 -0
- package/dist/routing/INSRouterMaker.js.map +1 -0
- package/dist/routing/NSRouterMaker.d.ts +11 -0
- package/dist/routing/NSRouterMaker.js +23 -0
- package/dist/routing/NSRouterMaker.js.map +1 -0
- package/dist/routing/Notifier.d.ts +18 -0
- package/dist/routing/Notifier.js +68 -0
- package/dist/routing/Notifier.js.map +1 -0
- package/package.json +1 -1
- package/src/App.tsx +9 -4
- package/src/Validator.ts +6 -6
- package/src/components/NSButton.tsx +5 -5
- package/src/components/NSButtonBlue.tsx +2 -2
- package/src/components/NSButtonGreen.tsx +2 -2
- package/src/components/NSButtonRed.tsx +2 -2
- package/src/components/NSCard.tsx +7 -7
- package/src/components/NSCopyToClipboard.tsx +3 -3
- package/src/components/NSEntityBar.tsx +5 -5
- package/src/components/NSEntityCardBackground.tsx +5 -5
- package/src/components/NSFooter.tsx +4 -4
- package/src/components/NSHeader.tsx +6 -6
- package/src/components/NSInputDate.tsx +5 -5
- package/src/components/NSInputDuration.tsx +7 -7
- package/src/components/NSInputEmail.tsx +6 -6
- package/src/components/NSInputErrorNotifier.tsx +3 -3
- package/src/components/NSInputFloat.tsx +6 -6
- package/src/components/NSInputIP.tsx +6 -6
- package/src/components/NSInputInteger.tsx +6 -6
- package/src/components/NSInputPassword.tsx +6 -6
- package/src/components/NSInputPhone.tsx +6 -6
- package/src/components/NSInputPrice.tsx +6 -6
- package/src/components/NSInputSearch.tsx +6 -6
- package/src/components/NSInputString.tsx +6 -6
- package/src/components/NSInputText.tsx +6 -6
- package/src/components/NSInputTime.tsx +6 -6
- package/src/components/NSLayout.tsx +5 -5
- package/src/components/NSLayoutHeroBanner.tsx +4 -4
- package/src/components/NSLayoutTitle.tsx +4 -4
- package/src/components/NSLink.tsx +4 -4
- package/src/components/NSLinkBlue.tsx +2 -2
- package/src/components/NSLinkGreen.tsx +2 -2
- package/src/components/NSLinkRed.tsx +2 -2
- package/src/components/NSLoading.tsx +3 -3
- package/src/components/NSNotification.tsx +4 -4
- package/src/components/NSPagination.tsx +3 -3
- package/src/components/NSPanel.tsx +3 -3
- package/src/components/NSSection.tsx +3 -3
- package/src/components/NSSectionBars.tsx +5 -5
- package/src/components/NSSectionCards.tsx +7 -7
- package/src/components/NSSectionTitle.tsx +3 -3
- package/src/components/NSSelectBox.tsx +5 -5
- package/src/components/NSSpace.tsx +3 -3
- package/src/components/NSTable.tsx +4 -4
- package/src/components/NSTitle.tsx +3 -3
- package/src/main.ts +12 -1
- package/src/pages/NSLoginPage.tsx +2 -2
- package/src/props/{BaseComponentProps.ts → IBaseComponentProps.ts} +1 -1
- package/src/props/{ImageProps.ts → IImageProps.ts} +1 -1
- package/src/props/{LinkProps.ts → ILinkProps.ts} +1 -1
- package/src/props/INamirasoftProps.ts +6 -0
- package/src/props/IValidationNumberProps.ts +5 -0
- package/src/props/IValidationProps.ts +8 -0
- package/src/props/IValidationRegexProps.ts +5 -0
- package/src/props/{ValidationStringProps.ts → IValidationStringProps.ts} +1 -1
- package/src/routing/INSRouterMaker.ts +7 -0
- package/src/routing/NSRouterMaker.tsx +33 -0
- package/src/routing/Notifier.ts +84 -0
- package/dist/props/BaseComponentProps.js +0 -2
- package/dist/props/BaseComponentProps.js.map +0 -1
- package/dist/props/ImageProps.js +0 -2
- package/dist/props/ImageProps.js.map +0 -1
- package/dist/props/LinkProps.js +0 -2
- package/dist/props/LinkProps.js.map +0 -1
- package/dist/props/ValidationNumberProps.d.ts +0 -4
- package/dist/props/ValidationNumberProps.js +0 -2
- package/dist/props/ValidationNumberProps.js.map +0 -1
- package/dist/props/ValidationProps.d.ts +0 -6
- package/dist/props/ValidationProps.js +0 -2
- package/dist/props/ValidationProps.js.map +0 -1
- package/dist/props/ValidationRegexProps.d.ts +0 -4
- package/dist/props/ValidationRegexProps.js +0 -2
- package/dist/props/ValidationRegexProps.js.map +0 -1
- package/dist/props/ValidationStringProps.js +0 -2
- package/dist/props/ValidationStringProps.js.map +0 -1
- package/src/props/ValidationNumberProps.ts +0 -5
- package/src/props/ValidationProps.ts +0 -8
- package/src/props/ValidationRegexProps.ts +0 -5
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import Styles from './NSLayoutTitle.module.css';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { NSLayout,
|
|
3
|
+
import { NSLayout, INSLayoutProps } from './NSLayout';
|
|
4
4
|
import { NSSpace, NSSpaceSizeType } from './NSSpace';
|
|
5
|
-
import {
|
|
5
|
+
import { IBaseComponentProps } from '../props/IBaseComponentProps';
|
|
6
6
|
|
|
7
|
-
export interface
|
|
7
|
+
export interface INSLayoutTitleProps extends INSLayoutProps, IBaseComponentProps
|
|
8
8
|
{
|
|
9
9
|
title: string;
|
|
10
10
|
description?: string;
|
|
11
11
|
children: ReactNode;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export function NSLayoutTitle(props:
|
|
14
|
+
export function NSLayoutTitle(props: INSLayoutTitleProps)
|
|
15
15
|
{
|
|
16
16
|
let lines = (props.description ?? "").split(/(\n|\\n|<br>|<br\s*\/>)/gm);
|
|
17
17
|
return (
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
2
|
+
import { ILinkProps } from "../props/ILinkProps";
|
|
3
3
|
import Styles from "./NSLink.module.css";
|
|
4
4
|
|
|
5
|
-
export interface
|
|
5
|
+
export interface INSILinkProps extends ILinkProps, IBaseComponentProps
|
|
6
6
|
{
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export function NSLink(props:
|
|
9
|
+
export function NSLink(props: INSILinkProps)
|
|
10
10
|
{
|
|
11
11
|
return (
|
|
12
12
|
<div
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { NSLink,
|
|
1
|
+
import { NSLink, INSILinkProps } from "./NSLink";
|
|
2
2
|
|
|
3
|
-
export function NSLinkBlue(props:
|
|
3
|
+
export function NSLinkBlue(props: INSILinkProps)
|
|
4
4
|
{
|
|
5
5
|
return <NSLink id={props.id} classList={props.classList} style={{ ...props.style, backgroundColor: "#366EFF" }} title={props.title} href={props.href} target={props.target} />;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { NSLink,
|
|
1
|
+
import { NSLink, INSILinkProps } from "./NSLink";
|
|
2
2
|
|
|
3
|
-
export function NSLinkGreen(props:
|
|
3
|
+
export function NSLinkGreen(props: INSILinkProps)
|
|
4
4
|
{
|
|
5
5
|
return <NSLink id={props.id} classList={props.classList} style={{ ...props.style, backgroundColor: "#06D182" }} title={props.title} href={props.href} target={props.target} />;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { NSLink,
|
|
1
|
+
import { NSLink, INSILinkProps } from "./NSLink";
|
|
2
2
|
|
|
3
|
-
export function NSLinkRed(props:
|
|
3
|
+
export function NSLinkRed(props: INSILinkProps)
|
|
4
4
|
{
|
|
5
5
|
return <NSLink id={props.id} classList={props.classList} style={{ ...props.style, backgroundColor: "rgb(265, 63, 63, 1)" }} title={props.title} href={props.href} target={props.target} />;
|
|
6
6
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import Styles from './NSLoading.module.css';
|
|
2
2
|
import { NSSection } from './NSSection';
|
|
3
|
-
import {
|
|
3
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
4
4
|
|
|
5
|
-
export interface
|
|
5
|
+
export interface INSLoadingProps extends IBaseComponentProps
|
|
6
6
|
{
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export function NSLoading(props:
|
|
9
|
+
export function NSLoading(props: INSLoadingProps)
|
|
10
10
|
{
|
|
11
11
|
return (
|
|
12
12
|
<NSSection {...props}>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Exit from '../assets/images/close-vector.png';
|
|
2
2
|
import Styles from "./NSNotification.module.css";
|
|
3
|
-
import {
|
|
3
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
4
4
|
|
|
5
|
-
export interface
|
|
5
|
+
export interface INSNotificationProps extends IBaseComponentProps
|
|
6
6
|
{
|
|
7
7
|
text: string;
|
|
8
8
|
type: NotificationType;
|
|
@@ -27,9 +27,9 @@ export enum NotificationType
|
|
|
27
27
|
Error = "Error",
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export function NSNotification(props:
|
|
30
|
+
export function NSNotification(props: INSNotificationProps)
|
|
31
31
|
{
|
|
32
|
-
let className = Styles["ns_" + props.color.toString().toLowerCase];
|
|
32
|
+
let className = Styles["ns_" + props.color.toString().toLowerCase()];
|
|
33
33
|
return (
|
|
34
34
|
<div id={props.id}
|
|
35
35
|
className={`${Styles.ns_messenger} ${className}`}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IBaseComponentProps } from '../props/IBaseComponentProps';
|
|
2
2
|
import Styles from './NSPagination.module.css';
|
|
3
3
|
|
|
4
|
-
export interface
|
|
4
|
+
export interface INSPaginationProps extends IBaseComponentProps
|
|
5
5
|
{
|
|
6
6
|
size: number;
|
|
7
7
|
page: number;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export function NSPagination(props:
|
|
10
|
+
export function NSPagination(props: INSPaginationProps)
|
|
11
11
|
{
|
|
12
12
|
let page = props.page;
|
|
13
13
|
let size = props.size;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import Styles from './NSPanel.module.css';
|
|
3
|
-
import {
|
|
3
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
4
4
|
|
|
5
|
-
export interface
|
|
5
|
+
export interface INSSectionProps extends IBaseComponentProps
|
|
6
6
|
{
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
grid: boolean;
|
|
9
9
|
}
|
|
10
|
-
export function NSPanel(props:
|
|
10
|
+
export function NSPanel(props: INSSectionProps)
|
|
11
11
|
{
|
|
12
12
|
return (
|
|
13
13
|
<section id={props.id}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import Styles from './NSSection.module.css'
|
|
3
|
-
import {
|
|
3
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
4
4
|
|
|
5
|
-
export interface
|
|
5
|
+
export interface INSSectionProps extends IBaseComponentProps
|
|
6
6
|
{
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
center_items?: boolean;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export function NSSection(props:
|
|
11
|
+
export function NSSection(props: INSSectionProps)
|
|
12
12
|
{
|
|
13
13
|
let styles = [Styles.ns_section];
|
|
14
14
|
if (props.center_items)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import Styles from './NSSectionBars.module.css';
|
|
2
|
-
import { NSEntityBar,
|
|
2
|
+
import { NSEntityBar, INSEntityBarProps } from './NSEntityBar';
|
|
3
3
|
import { NSSection } from './NSSection';
|
|
4
4
|
import { NSSpace, NSSpaceSizeType } from './NSSpace';
|
|
5
|
-
import {
|
|
5
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
6
6
|
|
|
7
|
-
export interface
|
|
7
|
+
export interface INSSectionBarsProps extends IBaseComponentProps
|
|
8
8
|
{
|
|
9
9
|
title?: string;
|
|
10
|
-
bars:
|
|
10
|
+
bars: INSEntityBarProps[]
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export function NSSectionBars(props:
|
|
13
|
+
export function NSSectionBars(props: INSSectionBarsProps)
|
|
14
14
|
{
|
|
15
15
|
return (
|
|
16
16
|
<NSSection {...props} >
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import Styles from './NSSectionCards.module.css';
|
|
2
2
|
import { NSTitle } from './NSTitle';
|
|
3
|
-
import { NSCard,
|
|
3
|
+
import { NSCard, INSCardProps } from './NSCard';
|
|
4
4
|
import { NSSection } from './NSSection';
|
|
5
5
|
import { NSLinkBlue } from './NSLinkBlue';
|
|
6
6
|
import { NSSpace, NSSpaceSizeType } from './NSSpace';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
8
|
+
import { ILinkProps } from '../props/ILinkProps';
|
|
9
9
|
|
|
10
|
-
export interface
|
|
10
|
+
export interface INSSectionCardsProps extends IBaseComponentProps
|
|
11
11
|
{
|
|
12
12
|
title?: string;
|
|
13
13
|
description?: {
|
|
14
14
|
text: string,
|
|
15
15
|
color?: string
|
|
16
16
|
};
|
|
17
|
-
button?:
|
|
18
|
-
cards:
|
|
17
|
+
button?: ILinkProps;
|
|
18
|
+
cards: INSCardProps[];
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export function NSSectionCards(props:
|
|
21
|
+
export function NSSectionCards(props: INSSectionCardsProps)
|
|
22
22
|
{
|
|
23
23
|
return (
|
|
24
24
|
<NSSection {...props} >
|
|
@@ -2,15 +2,15 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { NSSection } from './NSSection';
|
|
3
3
|
import { NSTitle } from './NSTitle';
|
|
4
4
|
import { NSSpace, NSSpaceSizeType } from './NSSpace';
|
|
5
|
-
import {
|
|
5
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
6
6
|
|
|
7
|
-
export interface
|
|
7
|
+
export interface INSSectionTitleProps extends IBaseComponentProps
|
|
8
8
|
{
|
|
9
9
|
title: string;
|
|
10
10
|
children: ReactNode
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export function NSSectionTitle(props:
|
|
13
|
+
export function NSSectionTitle(props: INSSectionTitleProps)
|
|
14
14
|
{
|
|
15
15
|
return (
|
|
16
16
|
<NSSection {...props} >
|
|
@@ -5,12 +5,12 @@ import Styles from "./NSSelectBox.module.css";
|
|
|
5
5
|
import { Select, Space } from 'antd';
|
|
6
6
|
import type { SelectProps } from 'antd';
|
|
7
7
|
import IconSelectBox from '../assets/images/icon-select-box.svg';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
9
|
+
import { IValidationProps } from "../props/IValidationProps";
|
|
10
10
|
import { Validator } from "../Validator";
|
|
11
11
|
import { NSInputErrorNotifier } from "./NSInputErrorNotifier";
|
|
12
12
|
|
|
13
|
-
export interface
|
|
13
|
+
export interface INSSelectBoxProps extends IBaseComponentProps, IValidationProps
|
|
14
14
|
{
|
|
15
15
|
title: string;
|
|
16
16
|
options: SelectProps['options'];
|
|
@@ -23,9 +23,9 @@ export interface NSSelectBoxState
|
|
|
23
23
|
error?: string;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
export class NSSelectBox extends React.Component<
|
|
26
|
+
export class NSSelectBox extends React.Component<INSSelectBoxProps, NSSelectBoxState>
|
|
27
27
|
{
|
|
28
|
-
constructor(props:
|
|
28
|
+
constructor(props: INSSelectBoxProps)
|
|
29
29
|
{
|
|
30
30
|
super(props);
|
|
31
31
|
this.state = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
2
2
|
|
|
3
|
-
export interface
|
|
3
|
+
export interface INSSpaceProps extends IBaseComponentProps
|
|
4
4
|
{
|
|
5
5
|
size: NSSpaceSizeType;
|
|
6
6
|
}
|
|
@@ -19,7 +19,7 @@ export enum NSSpaceSizeType
|
|
|
19
19
|
XXXLARGE = "128px",
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export function NSSpace(props:
|
|
22
|
+
export function NSSpace(props: INSSpaceProps)
|
|
23
23
|
{
|
|
24
24
|
return (
|
|
25
25
|
<hr id={props.id}
|
|
@@ -6,9 +6,9 @@ import { NSPagination } from './NSPagination';
|
|
|
6
6
|
import { NSSpace, NSSpaceSizeType } from './NSSpace';
|
|
7
7
|
import Styles from './NSTable.module.css';
|
|
8
8
|
import { Component } from 'react';
|
|
9
|
-
import {
|
|
9
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
10
10
|
|
|
11
|
-
export interface
|
|
11
|
+
export interface INSTableProps<RowType> extends IBaseComponentProps
|
|
12
12
|
{
|
|
13
13
|
columns: { [key: string]: string };
|
|
14
14
|
rows: RowType[];
|
|
@@ -24,9 +24,9 @@ export interface NSTableState<RowType>
|
|
|
24
24
|
modalState: boolean
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export class NSTable<RowType> extends Component<
|
|
27
|
+
export class NSTable<RowType> extends Component<INSTableProps<RowType>, NSTableState<RowType>>
|
|
28
28
|
{
|
|
29
|
-
constructor(props:
|
|
29
|
+
constructor(props: INSTableProps<RowType>)
|
|
30
30
|
{
|
|
31
31
|
super(props);
|
|
32
32
|
this.state = { columns: props.columns, rows: props.rows, modalState: false };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import Styles from './NSTitle.module.css';
|
|
2
|
-
import {
|
|
2
|
+
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
3
3
|
|
|
4
|
-
export interface
|
|
4
|
+
export interface INSTitleProps extends IBaseComponentProps
|
|
5
5
|
{
|
|
6
6
|
title: string;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export function NSTitle(props:
|
|
9
|
+
export function NSTitle(props: INSTitleProps)
|
|
10
10
|
{
|
|
11
11
|
return (
|
|
12
12
|
<h2
|
package/src/main.ts
CHANGED
|
@@ -40,4 +40,15 @@ export * from "./components/NSPagination";
|
|
|
40
40
|
export * from "./components/NSTable";
|
|
41
41
|
export * from "./components/NSTitle";
|
|
42
42
|
export * from "./pages/NSLoginPage";
|
|
43
|
-
export * from "./pages/NSNotFoundPage";
|
|
43
|
+
export * from "./pages/NSNotFoundPage";
|
|
44
|
+
export * from "./props/IBaseComponentProps";
|
|
45
|
+
export * from "./props/IImageProps";
|
|
46
|
+
export * from "./props/ILinkProps";
|
|
47
|
+
export * from "./props/INamirasoftProps";
|
|
48
|
+
export * from "./props/IValidationNumberProps";
|
|
49
|
+
export * from "./props/IValidationProps";
|
|
50
|
+
export * from "./props/IValidationRegexProps";
|
|
51
|
+
export * from "./props/IValidationStringProps";
|
|
52
|
+
export * from "./routing/INSRouterMaker";
|
|
53
|
+
export * from "./routing/NSRouterMaker";
|
|
54
|
+
export * from "./routing/Notifier";
|
|
@@ -3,7 +3,7 @@ import { NSButtonGreen } from '../components/NSButtonGreen';
|
|
|
3
3
|
import { NSLinkBlue } from '../components/NSLinkBlue';
|
|
4
4
|
import { NSSpace, NSSpaceSizeType } from '../components/NSSpace';
|
|
5
5
|
|
|
6
|
-
export interface
|
|
6
|
+
export interface INSLoginPageProps
|
|
7
7
|
{
|
|
8
8
|
title: string;
|
|
9
9
|
logo: string;
|
|
@@ -12,7 +12,7 @@ export interface NSLoginPageProps
|
|
|
12
12
|
onClick?: () => void;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export function NSLoginPage(props:
|
|
15
|
+
export function NSLoginPage(props: INSLoginPageProps)
|
|
16
16
|
{
|
|
17
17
|
let button = <></>;
|
|
18
18
|
if (props.href)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { INamirasoftProps } from '../props/INamirasoftProps';
|
|
2
|
+
import { INotifierState, Notifier } from './Notifier';
|
|
3
|
+
import { INSRouterMaker } from './INSRouterMaker';
|
|
4
|
+
|
|
5
|
+
export class NSRouterMaker
|
|
6
|
+
{
|
|
7
|
+
private state: INotifierState | undefined;
|
|
8
|
+
private setState: React.Dispatch<React.SetStateAction<INotifierState | undefined>>;
|
|
9
|
+
private component: INSRouterMaker;
|
|
10
|
+
constructor(state: INotifierState | undefined, setState: React.Dispatch<React.SetStateAction<INotifierState | undefined>>, component: INSRouterMaker)
|
|
11
|
+
{
|
|
12
|
+
this.state = state;
|
|
13
|
+
this.setState = setState;
|
|
14
|
+
this.component = component;
|
|
15
|
+
this.init = this.init.bind(this);
|
|
16
|
+
this.onRender = this.onRender.bind(this);
|
|
17
|
+
}
|
|
18
|
+
private init(): { props: INamirasoftProps }
|
|
19
|
+
{
|
|
20
|
+
let notifier: Notifier = new Notifier(this.state, this.setState);
|
|
21
|
+
|
|
22
|
+
let props: INamirasoftProps = {
|
|
23
|
+
notifier
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return { props };
|
|
27
|
+
}
|
|
28
|
+
onRender(): React.JSX.Element
|
|
29
|
+
{
|
|
30
|
+
let { props } = this.init();
|
|
31
|
+
return this.component.onRender(props);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { NSNotificationColor, INSNotificationProps, NotificationType } from "../components/NSNotification";
|
|
3
|
+
|
|
4
|
+
export interface INotifierState
|
|
5
|
+
{
|
|
6
|
+
notifications?: INSNotificationProps[];
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export class Notifier
|
|
10
|
+
{
|
|
11
|
+
private static Counter: number = 1;
|
|
12
|
+
private state: INotifierState | undefined;
|
|
13
|
+
private setState: React.Dispatch<React.SetStateAction<INotifierState | undefined>>;
|
|
14
|
+
constructor(state: INotifierState | undefined, setState: React.Dispatch<React.SetStateAction<INotifierState | undefined>>)
|
|
15
|
+
{
|
|
16
|
+
this.state = state;
|
|
17
|
+
this.setState = setState;
|
|
18
|
+
this.notify = this.notify.bind(this);
|
|
19
|
+
this.onInformation = this.onInformation.bind(this);
|
|
20
|
+
this.onSuccess = this.onSuccess.bind(this);
|
|
21
|
+
this.onWarning = this.onWarning.bind(this);
|
|
22
|
+
this.onError = this.onError.bind(this);
|
|
23
|
+
this.delNotification = this.delNotification.bind(this);
|
|
24
|
+
this.getNotifications = this.getNotifications.bind(this);
|
|
25
|
+
}
|
|
26
|
+
private notify(message: INSNotificationProps)
|
|
27
|
+
{
|
|
28
|
+
let notifications: INSNotificationProps[] = [];
|
|
29
|
+
if (this.state?.notifications)
|
|
30
|
+
notifications.push(...this.state.notifications);
|
|
31
|
+
notifications.push(message);
|
|
32
|
+
this.setState({ notifications });
|
|
33
|
+
setTimeout(() =>
|
|
34
|
+
{
|
|
35
|
+
message.onClose();
|
|
36
|
+
}, 5000);
|
|
37
|
+
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
|
|
38
|
+
}
|
|
39
|
+
onInformation(text: string)
|
|
40
|
+
{
|
|
41
|
+
let id = Notifier.Counter++ + "";
|
|
42
|
+
this.notify({ id, text, type: NotificationType.Information, color: NSNotificationColor.GRAY, onClose: () => this.delNotification(id) });
|
|
43
|
+
}
|
|
44
|
+
onSuccess(text: string)
|
|
45
|
+
{
|
|
46
|
+
let id = Notifier.Counter++ + "";
|
|
47
|
+
this.notify({ id, text, type: NotificationType.Success, color: NSNotificationColor.GREEN, onClose: () => this.delNotification(id) });
|
|
48
|
+
}
|
|
49
|
+
onWarning(text: string)
|
|
50
|
+
{
|
|
51
|
+
let id = Notifier.Counter++ + "";
|
|
52
|
+
this.notify({ id, text, type: NotificationType.Warning, color: NSNotificationColor.YELLOW, onClose: () => this.delNotification(id) });
|
|
53
|
+
}
|
|
54
|
+
onError(error: Error | string)
|
|
55
|
+
{
|
|
56
|
+
let id = Notifier.Counter++ + "";
|
|
57
|
+
let text: string = "";
|
|
58
|
+
if (error instanceof Error)
|
|
59
|
+
{
|
|
60
|
+
text = error.message;
|
|
61
|
+
if (axios.isAxiosError(error))
|
|
62
|
+
if (error.response?.data)
|
|
63
|
+
text = error.response.data;
|
|
64
|
+
}
|
|
65
|
+
else
|
|
66
|
+
text = error;
|
|
67
|
+
this.notify({ id, text, type: NotificationType.Error, color: NSNotificationColor.RED, onClose: () => this.delNotification(id) });
|
|
68
|
+
}
|
|
69
|
+
delNotification(id: string): void
|
|
70
|
+
{
|
|
71
|
+
if (!this.state)
|
|
72
|
+
return;
|
|
73
|
+
|
|
74
|
+
let notifications: INSNotificationProps[] = [];
|
|
75
|
+
if (this.state.notifications)
|
|
76
|
+
notifications.push(...this.state.notifications);
|
|
77
|
+
notifications = notifications.filter(x => x.id !== id);
|
|
78
|
+
this.setState({ notifications });
|
|
79
|
+
}
|
|
80
|
+
getNotifications(): INSNotificationProps[]
|
|
81
|
+
{
|
|
82
|
+
return this.state?.notifications ?? [];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BaseComponentProps.js","sourceRoot":"","sources":["../../src/props/BaseComponentProps.ts"],"names":[],"mappings":""}
|
package/dist/props/ImageProps.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImageProps.js","sourceRoot":"","sources":["../../src/props/ImageProps.ts"],"names":[],"mappings":""}
|
package/dist/props/LinkProps.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LinkProps.js","sourceRoot":"","sources":["../../src/props/LinkProps.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ValidationNumberProps.js","sourceRoot":"","sources":["../../src/props/ValidationNumberProps.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ValidationProps.js","sourceRoot":"","sources":["../../src/props/ValidationProps.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ValidationRegexProps.js","sourceRoot":"","sources":["../../src/props/ValidationRegexProps.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ValidationStringProps.js","sourceRoot":"","sources":["../../src/props/ValidationStringProps.ts"],"names":[],"mappings":""}
|