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.
Files changed (208) hide show
  1. package/dist/App.js +2 -2
  2. package/dist/App.js.map +1 -1
  3. package/dist/Validator.d.ts +6 -6
  4. package/dist/Validator.js.map +1 -1
  5. package/dist/components/NSButton.d.ts +5 -5
  6. package/dist/components/NSButton.js.map +1 -1
  7. package/dist/components/NSButtonBlue.d.ts +2 -2
  8. package/dist/components/NSButtonBlue.js.map +1 -1
  9. package/dist/components/NSButtonGreen.d.ts +2 -2
  10. package/dist/components/NSButtonGreen.js.map +1 -1
  11. package/dist/components/NSButtonRed.d.ts +2 -2
  12. package/dist/components/NSButtonRed.js.map +1 -1
  13. package/dist/components/NSCard.d.ts +7 -7
  14. package/dist/components/NSCard.js.map +1 -1
  15. package/dist/components/NSCopyToClipboard.d.ts +3 -3
  16. package/dist/components/NSCopyToClipboard.js.map +1 -1
  17. package/dist/components/NSEntityBar.d.ts +5 -5
  18. package/dist/components/NSEntityBar.js.map +1 -1
  19. package/dist/components/NSEntityCardBackground.d.ts +5 -5
  20. package/dist/components/NSEntityCardBackground.js.map +1 -1
  21. package/dist/components/NSFooter.d.ts +4 -4
  22. package/dist/components/NSFooter.js.map +1 -1
  23. package/dist/components/NSHeader.d.ts +5 -5
  24. package/dist/components/NSHeader.js.map +1 -1
  25. package/dist/components/NSInputDate.d.ts +5 -5
  26. package/dist/components/NSInputDate.js.map +1 -1
  27. package/dist/components/NSInputDuration.d.ts +7 -7
  28. package/dist/components/NSInputDuration.js.map +1 -1
  29. package/dist/components/NSInputEmail.d.ts +6 -6
  30. package/dist/components/NSInputEmail.js.map +1 -1
  31. package/dist/components/NSInputErrorNotifier.d.ts +3 -3
  32. package/dist/components/NSInputErrorNotifier.js.map +1 -1
  33. package/dist/components/NSInputFloat.d.ts +6 -6
  34. package/dist/components/NSInputFloat.js.map +1 -1
  35. package/dist/components/NSInputIP.d.ts +6 -6
  36. package/dist/components/NSInputIP.js.map +1 -1
  37. package/dist/components/NSInputInteger.d.ts +6 -6
  38. package/dist/components/NSInputInteger.js.map +1 -1
  39. package/dist/components/NSInputPassword.d.ts +6 -6
  40. package/dist/components/NSInputPassword.js.map +1 -1
  41. package/dist/components/NSInputPhone.d.ts +6 -6
  42. package/dist/components/NSInputPhone.js.map +1 -1
  43. package/dist/components/NSInputPrice.d.ts +6 -6
  44. package/dist/components/NSInputPrice.js.map +1 -1
  45. package/dist/components/NSInputSearch.d.ts +6 -6
  46. package/dist/components/NSInputSearch.js.map +1 -1
  47. package/dist/components/NSInputString.d.ts +6 -6
  48. package/dist/components/NSInputString.js.map +1 -1
  49. package/dist/components/NSInputText.d.ts +6 -6
  50. package/dist/components/NSInputText.js.map +1 -1
  51. package/dist/components/NSInputTime.d.ts +6 -6
  52. package/dist/components/NSInputTime.js.map +1 -1
  53. package/dist/components/NSLayout.d.ts +5 -5
  54. package/dist/components/NSLayout.js.map +1 -1
  55. package/dist/components/NSLayoutHeroBanner.d.ts +4 -4
  56. package/dist/components/NSLayoutHeroBanner.js.map +1 -1
  57. package/dist/components/NSLayoutTitle.d.ts +4 -4
  58. package/dist/components/NSLayoutTitle.js.map +1 -1
  59. package/dist/components/NSLink.d.ts +4 -4
  60. package/dist/components/NSLink.js.map +1 -1
  61. package/dist/components/NSLinkBlue.d.ts +2 -2
  62. package/dist/components/NSLinkBlue.js.map +1 -1
  63. package/dist/components/NSLinkGreen.d.ts +2 -2
  64. package/dist/components/NSLinkGreen.js.map +1 -1
  65. package/dist/components/NSLinkRed.d.ts +2 -2
  66. package/dist/components/NSLinkRed.js.map +1 -1
  67. package/dist/components/NSLoading.d.ts +3 -3
  68. package/dist/components/NSLoading.js.map +1 -1
  69. package/dist/components/NSNotification.d.ts +3 -3
  70. package/dist/components/NSNotification.js +1 -1
  71. package/dist/components/NSNotification.js.map +1 -1
  72. package/dist/components/NSPagination.d.ts +3 -3
  73. package/dist/components/NSPagination.js.map +1 -1
  74. package/dist/components/NSPanel.d.ts +3 -3
  75. package/dist/components/NSPanel.js.map +1 -1
  76. package/dist/components/NSSection.d.ts +3 -3
  77. package/dist/components/NSSection.js.map +1 -1
  78. package/dist/components/NSSectionBars.d.ts +5 -5
  79. package/dist/components/NSSectionBars.js.map +1 -1
  80. package/dist/components/NSSectionCards.d.ts +7 -7
  81. package/dist/components/NSSectionCards.js.map +1 -1
  82. package/dist/components/NSSectionTitle.d.ts +3 -3
  83. package/dist/components/NSSectionTitle.js.map +1 -1
  84. package/dist/components/NSSelectBox.d.ts +5 -5
  85. package/dist/components/NSSelectBox.js.map +1 -1
  86. package/dist/components/NSSpace.d.ts +3 -3
  87. package/dist/components/NSSpace.js.map +1 -1
  88. package/dist/components/NSTable.d.ts +4 -4
  89. package/dist/components/NSTable.js.map +1 -1
  90. package/dist/components/NSTitle.d.ts +3 -3
  91. package/dist/components/NSTitle.js.map +1 -1
  92. package/dist/main.d.ts +11 -0
  93. package/dist/main.js +11 -0
  94. package/dist/main.js.map +1 -1
  95. package/dist/pages/NSLoginPage.d.ts +2 -2
  96. package/dist/pages/NSLoginPage.js.map +1 -1
  97. package/dist/props/{BaseComponentProps.d.ts → IBaseComponentProps.d.ts} +1 -1
  98. package/dist/props/IBaseComponentProps.js +2 -0
  99. package/dist/props/IBaseComponentProps.js.map +1 -0
  100. package/dist/props/{ImageProps.d.ts → IImageProps.d.ts} +1 -1
  101. package/dist/props/IImageProps.js +2 -0
  102. package/dist/props/IImageProps.js.map +1 -0
  103. package/dist/props/{LinkProps.d.ts → ILinkProps.d.ts} +1 -1
  104. package/dist/props/ILinkProps.js +2 -0
  105. package/dist/props/ILinkProps.js.map +1 -0
  106. package/dist/props/INamirasoftProps.d.ts +4 -0
  107. package/dist/props/INamirasoftProps.js +2 -0
  108. package/dist/props/INamirasoftProps.js.map +1 -0
  109. package/dist/props/IValidationNumberProps.d.ts +4 -0
  110. package/dist/props/IValidationNumberProps.js +2 -0
  111. package/dist/props/IValidationNumberProps.js.map +1 -0
  112. package/dist/props/IValidationProps.d.ts +6 -0
  113. package/dist/props/IValidationProps.js +2 -0
  114. package/dist/props/IValidationProps.js.map +1 -0
  115. package/dist/props/IValidationRegexProps.d.ts +4 -0
  116. package/dist/props/IValidationRegexProps.js +2 -0
  117. package/dist/props/IValidationRegexProps.js.map +1 -0
  118. package/dist/props/{ValidationStringProps.d.ts → IValidationStringProps.d.ts} +1 -1
  119. package/dist/props/IValidationStringProps.js +2 -0
  120. package/dist/props/IValidationStringProps.js.map +1 -0
  121. package/dist/routing/INSRouterMaker.d.ts +5 -0
  122. package/dist/routing/INSRouterMaker.js +2 -0
  123. package/dist/routing/INSRouterMaker.js.map +1 -0
  124. package/dist/routing/NSRouterMaker.d.ts +11 -0
  125. package/dist/routing/NSRouterMaker.js +23 -0
  126. package/dist/routing/NSRouterMaker.js.map +1 -0
  127. package/dist/routing/Notifier.d.ts +18 -0
  128. package/dist/routing/Notifier.js +68 -0
  129. package/dist/routing/Notifier.js.map +1 -0
  130. package/package.json +1 -1
  131. package/src/App.tsx +9 -4
  132. package/src/Validator.ts +6 -6
  133. package/src/components/NSButton.tsx +5 -5
  134. package/src/components/NSButtonBlue.tsx +2 -2
  135. package/src/components/NSButtonGreen.tsx +2 -2
  136. package/src/components/NSButtonRed.tsx +2 -2
  137. package/src/components/NSCard.tsx +7 -7
  138. package/src/components/NSCopyToClipboard.tsx +3 -3
  139. package/src/components/NSEntityBar.tsx +5 -5
  140. package/src/components/NSEntityCardBackground.tsx +5 -5
  141. package/src/components/NSFooter.tsx +4 -4
  142. package/src/components/NSHeader.tsx +6 -6
  143. package/src/components/NSInputDate.tsx +5 -5
  144. package/src/components/NSInputDuration.tsx +7 -7
  145. package/src/components/NSInputEmail.tsx +6 -6
  146. package/src/components/NSInputErrorNotifier.tsx +3 -3
  147. package/src/components/NSInputFloat.tsx +6 -6
  148. package/src/components/NSInputIP.tsx +6 -6
  149. package/src/components/NSInputInteger.tsx +6 -6
  150. package/src/components/NSInputPassword.tsx +6 -6
  151. package/src/components/NSInputPhone.tsx +6 -6
  152. package/src/components/NSInputPrice.tsx +6 -6
  153. package/src/components/NSInputSearch.tsx +6 -6
  154. package/src/components/NSInputString.tsx +6 -6
  155. package/src/components/NSInputText.tsx +6 -6
  156. package/src/components/NSInputTime.tsx +6 -6
  157. package/src/components/NSLayout.tsx +5 -5
  158. package/src/components/NSLayoutHeroBanner.tsx +4 -4
  159. package/src/components/NSLayoutTitle.tsx +4 -4
  160. package/src/components/NSLink.tsx +4 -4
  161. package/src/components/NSLinkBlue.tsx +2 -2
  162. package/src/components/NSLinkGreen.tsx +2 -2
  163. package/src/components/NSLinkRed.tsx +2 -2
  164. package/src/components/NSLoading.tsx +3 -3
  165. package/src/components/NSNotification.tsx +4 -4
  166. package/src/components/NSPagination.tsx +3 -3
  167. package/src/components/NSPanel.tsx +3 -3
  168. package/src/components/NSSection.tsx +3 -3
  169. package/src/components/NSSectionBars.tsx +5 -5
  170. package/src/components/NSSectionCards.tsx +7 -7
  171. package/src/components/NSSectionTitle.tsx +3 -3
  172. package/src/components/NSSelectBox.tsx +5 -5
  173. package/src/components/NSSpace.tsx +3 -3
  174. package/src/components/NSTable.tsx +4 -4
  175. package/src/components/NSTitle.tsx +3 -3
  176. package/src/main.ts +12 -1
  177. package/src/pages/NSLoginPage.tsx +2 -2
  178. package/src/props/{BaseComponentProps.ts → IBaseComponentProps.ts} +1 -1
  179. package/src/props/{ImageProps.ts → IImageProps.ts} +1 -1
  180. package/src/props/{LinkProps.ts → ILinkProps.ts} +1 -1
  181. package/src/props/INamirasoftProps.ts +6 -0
  182. package/src/props/IValidationNumberProps.ts +5 -0
  183. package/src/props/IValidationProps.ts +8 -0
  184. package/src/props/IValidationRegexProps.ts +5 -0
  185. package/src/props/{ValidationStringProps.ts → IValidationStringProps.ts} +1 -1
  186. package/src/routing/INSRouterMaker.ts +7 -0
  187. package/src/routing/NSRouterMaker.tsx +33 -0
  188. package/src/routing/Notifier.ts +84 -0
  189. package/dist/props/BaseComponentProps.js +0 -2
  190. package/dist/props/BaseComponentProps.js.map +0 -1
  191. package/dist/props/ImageProps.js +0 -2
  192. package/dist/props/ImageProps.js.map +0 -1
  193. package/dist/props/LinkProps.js +0 -2
  194. package/dist/props/LinkProps.js.map +0 -1
  195. package/dist/props/ValidationNumberProps.d.ts +0 -4
  196. package/dist/props/ValidationNumberProps.js +0 -2
  197. package/dist/props/ValidationNumberProps.js.map +0 -1
  198. package/dist/props/ValidationProps.d.ts +0 -6
  199. package/dist/props/ValidationProps.js +0 -2
  200. package/dist/props/ValidationProps.js.map +0 -1
  201. package/dist/props/ValidationRegexProps.d.ts +0 -4
  202. package/dist/props/ValidationRegexProps.js +0 -2
  203. package/dist/props/ValidationRegexProps.js.map +0 -1
  204. package/dist/props/ValidationStringProps.js +0 -2
  205. package/dist/props/ValidationStringProps.js.map +0 -1
  206. package/src/props/ValidationNumberProps.ts +0 -5
  207. package/src/props/ValidationProps.ts +0 -8
  208. 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, NSLayoutProps } from './NSLayout';
3
+ import { NSLayout, INSLayoutProps } from './NSLayout';
4
4
  import { NSSpace, NSSpaceSizeType } from './NSSpace';
5
- import { BaseComponentProps } from '../props/BaseComponentProps';
5
+ import { IBaseComponentProps } from '../props/IBaseComponentProps';
6
6
 
7
- export interface NSLayoutTitleProps extends NSLayoutProps, BaseComponentProps
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: NSLayoutTitleProps)
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 { BaseComponentProps } from "../props/BaseComponentProps";
2
- import { LinkProps } from "../props/LinkProps";
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 NSLinkProps extends LinkProps, BaseComponentProps
5
+ export interface INSILinkProps extends ILinkProps, IBaseComponentProps
6
6
  {
7
7
  }
8
8
 
9
- export function NSLink(props: NSLinkProps)
9
+ export function NSLink(props: INSILinkProps)
10
10
  {
11
11
  return (
12
12
  <div
@@ -1,6 +1,6 @@
1
- import { NSLink, NSLinkProps } from "./NSLink";
1
+ import { NSLink, INSILinkProps } from "./NSLink";
2
2
 
3
- export function NSLinkBlue(props: NSLinkProps)
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, NSLinkProps } from "./NSLink";
1
+ import { NSLink, INSILinkProps } from "./NSLink";
2
2
 
3
- export function NSLinkGreen(props: NSLinkProps)
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, NSLinkProps } from "./NSLink";
1
+ import { NSLink, INSILinkProps } from "./NSLink";
2
2
 
3
- export function NSLinkRed(props: NSLinkProps)
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 { BaseComponentProps } from "../props/BaseComponentProps";
3
+ import { IBaseComponentProps } from "../props/IBaseComponentProps";
4
4
 
5
- export interface NSLoadingProps extends BaseComponentProps
5
+ export interface INSLoadingProps extends IBaseComponentProps
6
6
  {
7
7
  }
8
8
 
9
- export function NSLoading(props: NSLoadingProps)
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 { BaseComponentProps } from "../props/BaseComponentProps";
3
+ import { IBaseComponentProps } from "../props/IBaseComponentProps";
4
4
 
5
- export interface NSNotificationProps extends BaseComponentProps
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: NSNotificationProps)
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 { BaseComponentProps } from '../props/BaseComponentProps';
1
+ import { IBaseComponentProps } from '../props/IBaseComponentProps';
2
2
  import Styles from './NSPagination.module.css';
3
3
 
4
- export interface NSPaginationProps extends BaseComponentProps
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: NSPaginationProps)
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 { BaseComponentProps } from "../props/BaseComponentProps";
3
+ import { IBaseComponentProps } from "../props/IBaseComponentProps";
4
4
 
5
- export interface NSSectionProps extends BaseComponentProps
5
+ export interface INSSectionProps extends IBaseComponentProps
6
6
  {
7
7
  children: ReactNode;
8
8
  grid: boolean;
9
9
  }
10
- export function NSPanel(props: NSSectionProps)
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 { BaseComponentProps } from "../props/BaseComponentProps";
3
+ import { IBaseComponentProps } from "../props/IBaseComponentProps";
4
4
 
5
- export interface NSSectionProps extends BaseComponentProps
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: NSSectionProps)
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, NSEntityBarProps } from './NSEntityBar';
2
+ import { NSEntityBar, INSEntityBarProps } from './NSEntityBar';
3
3
  import { NSSection } from './NSSection';
4
4
  import { NSSpace, NSSpaceSizeType } from './NSSpace';
5
- import { BaseComponentProps } from "../props/BaseComponentProps";
5
+ import { IBaseComponentProps } from "../props/IBaseComponentProps";
6
6
 
7
- export interface NSSectionBarsProps extends BaseComponentProps
7
+ export interface INSSectionBarsProps extends IBaseComponentProps
8
8
  {
9
9
  title?: string;
10
- bars: NSEntityBarProps[]
10
+ bars: INSEntityBarProps[]
11
11
  }
12
12
 
13
- export function NSSectionBars(props: NSSectionBarsProps)
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, NSCardProps } from './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 { BaseComponentProps } from "../props/BaseComponentProps";
8
- import { LinkProps } from '../props/LinkProps';
7
+ import { IBaseComponentProps } from "../props/IBaseComponentProps";
8
+ import { ILinkProps } from '../props/ILinkProps';
9
9
 
10
- export interface NSSectionCardsProps extends BaseComponentProps
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?: LinkProps;
18
- cards: NSCardProps[];
17
+ button?: ILinkProps;
18
+ cards: INSCardProps[];
19
19
  }
20
20
 
21
- export function NSSectionCards(props: NSSectionCardsProps)
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 { BaseComponentProps } from "../props/BaseComponentProps";
5
+ import { IBaseComponentProps } from "../props/IBaseComponentProps";
6
6
 
7
- export interface NSSectionTitleProps extends BaseComponentProps
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: NSSectionTitleProps)
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 { BaseComponentProps } from "../props/BaseComponentProps";
9
- import { ValidationProps } from "../props/ValidationProps";
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 NSSelectBoxProps extends BaseComponentProps, ValidationProps
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<NSSelectBoxProps, NSSelectBoxState>
26
+ export class NSSelectBox extends React.Component<INSSelectBoxProps, NSSelectBoxState>
27
27
  {
28
- constructor(props: NSSelectBoxProps)
28
+ constructor(props: INSSelectBoxProps)
29
29
  {
30
30
  super(props);
31
31
  this.state = {
@@ -1,6 +1,6 @@
1
- import { BaseComponentProps } from "../props/BaseComponentProps";
1
+ import { IBaseComponentProps } from "../props/IBaseComponentProps";
2
2
 
3
- export interface NSSpaceProps extends BaseComponentProps
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: NSSpaceProps)
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 { BaseComponentProps } from "../props/BaseComponentProps";
9
+ import { IBaseComponentProps } from "../props/IBaseComponentProps";
10
10
 
11
- export interface NSTableProps<RowType> extends BaseComponentProps
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<NSTableProps<RowType>, NSTableState<RowType>>
27
+ export class NSTable<RowType> extends Component<INSTableProps<RowType>, NSTableState<RowType>>
28
28
  {
29
- constructor(props: NSTableProps<RowType>)
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 { BaseComponentProps } from "../props/BaseComponentProps";
2
+ import { IBaseComponentProps } from "../props/IBaseComponentProps";
3
3
 
4
- export interface NSTitleProps extends BaseComponentProps
4
+ export interface INSTitleProps extends IBaseComponentProps
5
5
  {
6
6
  title: string;
7
7
  }
8
8
 
9
- export function NSTitle(props: NSTitleProps)
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 NSLoginPageProps
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: NSLoginPageProps)
15
+ export function NSLoginPage(props: INSLoginPageProps)
16
16
  {
17
17
  let button = <></>;
18
18
  if (props.href)
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
 
3
- export interface BaseComponentProps
3
+ export interface IBaseComponentProps
4
4
  {
5
5
  id?: string;
6
6
  classList?: string[]
@@ -1,4 +1,4 @@
1
- export interface ImageProps
1
+ export interface IImageProps
2
2
  {
3
3
  src: string;
4
4
  alt?: string;
@@ -1,4 +1,4 @@
1
- export interface LinkProps
1
+ export interface ILinkProps
2
2
  {
3
3
  title?: string;
4
4
  href: string;
@@ -0,0 +1,6 @@
1
+ import { Notifier } from "../routing/Notifier";
2
+
3
+ export interface INamirasoftProps
4
+ {
5
+ notifier: Notifier;
6
+ }
@@ -0,0 +1,5 @@
1
+ export interface IValidationNumberProps
2
+ {
3
+ min?: number;
4
+ max?: number;
5
+ }
@@ -0,0 +1,8 @@
1
+ import { IValidationRegexProps } from "./IValidationRegexProps";
2
+
3
+ export interface IValidationProps
4
+ {
5
+ required: boolean;
6
+ regex?: IValidationRegexProps;
7
+ validator?: (name: string, value: string | number | null | undefined) => string | null;
8
+ }
@@ -0,0 +1,5 @@
1
+ export interface IValidationRegexProps
2
+ {
3
+ name: string
4
+ regex: RegExp;
5
+ }
@@ -1,4 +1,4 @@
1
- export interface ValidationStringProps
1
+ export interface IValidationStringProps
2
2
  {
3
3
  min_length?: number;
4
4
  max_length?: number;
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import { INamirasoftProps } from "../props/INamirasoftProps";
3
+
4
+ export interface INSRouterMaker
5
+ {
6
+ onRender(props: INamirasoftProps): React.JSX.Element;
7
+ }
@@ -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,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=BaseComponentProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseComponentProps.js","sourceRoot":"","sources":["../../src/props/BaseComponentProps.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ImageProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ImageProps.js","sourceRoot":"","sources":["../../src/props/ImageProps.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=LinkProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LinkProps.js","sourceRoot":"","sources":["../../src/props/LinkProps.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- export interface ValidationNumberProps {
2
- min?: number;
3
- max?: number;
4
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ValidationNumberProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ValidationNumberProps.js","sourceRoot":"","sources":["../../src/props/ValidationNumberProps.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- import { ValidationRegexProps } from "./ValidationRegexProps";
2
- export interface ValidationProps {
3
- required: boolean;
4
- regex?: ValidationRegexProps;
5
- validator?: (name: string, value: string | number | null | undefined) => string | null;
6
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ValidationProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ValidationProps.js","sourceRoot":"","sources":["../../src/props/ValidationProps.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- export interface ValidationRegexProps {
2
- name: string;
3
- regex: RegExp;
4
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ValidationRegexProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ValidationRegexProps.js","sourceRoot":"","sources":["../../src/props/ValidationRegexProps.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ValidationStringProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ValidationStringProps.js","sourceRoot":"","sources":["../../src/props/ValidationStringProps.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- export interface ValidationNumberProps
2
- {
3
- min?: number;
4
- max?: number;
5
- }