namirasoft-site-react 1.3.310 → 1.3.313

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 (268) hide show
  1. package/.dockerignore +87 -0
  2. package/Dockerfile +19 -0
  3. package/dist/App.d.ts +9 -0
  4. package/dist/App.js +96 -0
  5. package/dist/App.js.map +1 -0
  6. package/dist/CopyToClipboard.d.ts +3 -0
  7. package/dist/CopyToClipboard.js +7 -0
  8. package/dist/CopyToClipboard.js.map +1 -0
  9. package/dist/Validator.d.ts +14 -0
  10. package/dist/Validator.js +94 -0
  11. package/dist/Validator.js.map +1 -0
  12. package/dist/components/NSActionMenu.d.ts +14 -0
  13. package/dist/components/NSActionMenu.js +33 -0
  14. package/dist/components/NSActionMenu.js.map +1 -0
  15. package/dist/components/NSAssistantButton.d.ts +6 -0
  16. package/dist/components/NSAssistantButton.js +20 -0
  17. package/dist/components/NSAssistantButton.js.map +1 -0
  18. package/dist/components/NSBarAction.d.ts +12 -0
  19. package/dist/components/NSBarAction.js +20 -0
  20. package/dist/components/NSBarAction.js.map +1 -0
  21. package/dist/components/NSBarHeroBanner.d.ts +7 -0
  22. package/dist/components/NSBarHeroBanner.js +8 -0
  23. package/dist/components/NSBarHeroBanner.js.map +1 -0
  24. package/dist/components/NSBarNotification.d.ts +21 -0
  25. package/dist/components/NSBarNotification.js +37 -0
  26. package/dist/components/NSBarNotification.js.map +1 -0
  27. package/dist/components/NSBarTitle.d.ts +5 -0
  28. package/dist/components/NSBarTitle.js +11 -0
  29. package/dist/components/NSBarTitle.js.map +1 -0
  30. package/dist/components/NSBoxBoolean.d.ts +23 -0
  31. package/dist/components/NSBoxBoolean.js +40 -0
  32. package/dist/components/NSBoxBoolean.js.map +1 -0
  33. package/dist/components/NSBoxCombo.d.ts +33 -0
  34. package/dist/components/NSBoxCombo.js +65 -0
  35. package/dist/components/NSBoxCombo.js.map +1 -0
  36. package/dist/components/NSBoxDate.d.ts +22 -0
  37. package/dist/components/NSBoxDate.js +42 -0
  38. package/dist/components/NSBoxDate.js.map +1 -0
  39. package/dist/components/NSBoxDateTime.d.ts +22 -0
  40. package/dist/components/NSBoxDateTime.js +42 -0
  41. package/dist/components/NSBoxDateTime.js.map +1 -0
  42. package/dist/components/NSBoxDouble.d.ts +23 -0
  43. package/dist/components/NSBoxDouble.js +42 -0
  44. package/dist/components/NSBoxDouble.js.map +1 -0
  45. package/dist/components/NSBoxDuration.d.ts +24 -0
  46. package/dist/components/NSBoxDuration.js +43 -0
  47. package/dist/components/NSBoxDuration.js.map +1 -0
  48. package/dist/components/NSBoxEmail.d.ts +25 -0
  49. package/dist/components/NSBoxEmail.js +50 -0
  50. package/dist/components/NSBoxEmail.js.map +1 -0
  51. package/dist/components/NSBoxEntity.d.ts +42 -0
  52. package/dist/components/NSBoxEntity.js +86 -0
  53. package/dist/components/NSBoxEntity.js.map +1 -0
  54. package/dist/components/NSBoxEnum.d.ts +19 -0
  55. package/dist/components/NSBoxEnum.js +46 -0
  56. package/dist/components/NSBoxEnum.js.map +1 -0
  57. package/dist/components/NSBoxErrorNotifier.d.ts +6 -0
  58. package/dist/components/NSBoxErrorNotifier.js +11 -0
  59. package/dist/components/NSBoxErrorNotifier.js.map +1 -0
  60. package/dist/components/NSBoxIPV4.d.ts +23 -0
  61. package/dist/components/NSBoxIPV4.js +45 -0
  62. package/dist/components/NSBoxIPV4.js.map +1 -0
  63. package/dist/components/NSBoxIPV6.d.ts +23 -0
  64. package/dist/components/NSBoxIPV6.js +45 -0
  65. package/dist/components/NSBoxIPV6.js.map +1 -0
  66. package/dist/components/NSBoxInteger.d.ts +23 -0
  67. package/dist/components/NSBoxInteger.js +42 -0
  68. package/dist/components/NSBoxInteger.js.map +1 -0
  69. package/dist/components/NSBoxLabel.d.ts +12 -0
  70. package/dist/components/NSBoxLabel.js +11 -0
  71. package/dist/components/NSBoxLabel.js.map +1 -0
  72. package/dist/components/NSBoxOTP.d.ts +9 -0
  73. package/dist/components/NSBoxOTP.js +34 -0
  74. package/dist/components/NSBoxOTP.js.map +1 -0
  75. package/dist/components/NSBoxPassword.d.ts +23 -0
  76. package/dist/components/NSBoxPassword.js +43 -0
  77. package/dist/components/NSBoxPassword.js.map +1 -0
  78. package/dist/components/NSBoxPhone.d.ts +25 -0
  79. package/dist/components/NSBoxPhone.js +45 -0
  80. package/dist/components/NSBoxPhone.js.map +1 -0
  81. package/dist/components/NSBoxPrice.d.ts +23 -0
  82. package/dist/components/NSBoxPrice.js +42 -0
  83. package/dist/components/NSBoxPrice.js.map +1 -0
  84. package/dist/components/NSBoxSearch.d.ts +25 -0
  85. package/dist/components/NSBoxSearch.js +52 -0
  86. package/dist/components/NSBoxSearch.js.map +1 -0
  87. package/dist/components/NSBoxString.d.ts +25 -0
  88. package/dist/components/NSBoxString.js +48 -0
  89. package/dist/components/NSBoxString.js.map +1 -0
  90. package/dist/components/NSBoxTextArea.d.ts +27 -0
  91. package/dist/components/NSBoxTextArea.js +60 -0
  92. package/dist/components/NSBoxTextArea.js.map +1 -0
  93. package/dist/components/NSBoxTime.d.ts +23 -0
  94. package/dist/components/NSBoxTime.js +44 -0
  95. package/dist/components/NSBoxTime.js.map +1 -0
  96. package/dist/components/NSButton.d.ts +9 -0
  97. package/dist/components/NSButton.js +8 -0
  98. package/dist/components/NSButton.js.map +1 -0
  99. package/dist/components/NSButtonBlue.d.ts +2 -0
  100. package/dist/components/NSButtonBlue.js +11 -0
  101. package/dist/components/NSButtonBlue.js.map +1 -0
  102. package/dist/components/NSButtonGreen.d.ts +2 -0
  103. package/dist/components/NSButtonGreen.js +11 -0
  104. package/dist/components/NSButtonGreen.js.map +1 -0
  105. package/dist/components/NSButtonRed.d.ts +2 -0
  106. package/dist/components/NSButtonRed.js +11 -0
  107. package/dist/components/NSButtonRed.js.map +1 -0
  108. package/dist/components/NSCard.d.ts +14 -0
  109. package/dist/components/NSCard.js +18 -0
  110. package/dist/components/NSCard.js.map +1 -0
  111. package/dist/components/NSCopyToClipboard.d.ts +6 -0
  112. package/dist/components/NSCopyToClipboard.js +12 -0
  113. package/dist/components/NSCopyToClipboard.js.map +1 -0
  114. package/dist/components/NSElectronicCard.d.ts +9 -0
  115. package/dist/components/NSElectronicCard.js +13 -0
  116. package/dist/components/NSElectronicCard.js.map +1 -0
  117. package/dist/components/NSEntityBar.d.ts +8 -0
  118. package/dist/components/NSEntityBar.js +7 -0
  119. package/dist/components/NSEntityBar.js.map +1 -0
  120. package/dist/components/NSEntityCardBackground.d.ts +7 -0
  121. package/dist/components/NSEntityCardBackground.js +9 -0
  122. package/dist/components/NSEntityCardBackground.js.map +1 -0
  123. package/dist/components/NSFilterBox.d.ts +61 -0
  124. package/dist/components/NSFilterBox.js +230 -0
  125. package/dist/components/NSFilterBox.js.map +1 -0
  126. package/dist/components/NSFilterBoxDialog.d.ts +12 -0
  127. package/dist/components/NSFilterBoxDialog.js +17 -0
  128. package/dist/components/NSFilterBoxDialog.js.map +1 -0
  129. package/dist/components/NSFilterItem.d.ts +17 -0
  130. package/dist/components/NSFilterItem.js +30 -0
  131. package/dist/components/NSFilterItem.js.map +1 -0
  132. package/dist/components/NSFooter.d.ts +20 -0
  133. package/dist/components/NSFooter.js +56 -0
  134. package/dist/components/NSFooter.js.map +1 -0
  135. package/dist/components/NSGroupedList.d.ts +31 -0
  136. package/dist/components/NSGroupedList.js +42 -0
  137. package/dist/components/NSGroupedList.js.map +1 -0
  138. package/dist/components/NSHeader.d.ts +26 -0
  139. package/dist/components/NSHeader.js +81 -0
  140. package/dist/components/NSHeader.js.map +1 -0
  141. package/dist/components/NSLayout.d.ts +22 -0
  142. package/dist/components/NSLayout.js +30 -0
  143. package/dist/components/NSLayout.js.map +1 -0
  144. package/dist/components/NSLine.d.ts +4 -0
  145. package/dist/components/NSLine.js +6 -0
  146. package/dist/components/NSLine.js.map +1 -0
  147. package/dist/components/NSLink.d.ts +5 -0
  148. package/dist/components/NSLink.js +7 -0
  149. package/dist/components/NSLink.js.map +1 -0
  150. package/dist/components/NSLinkBlue.d.ts +2 -0
  151. package/dist/components/NSLinkBlue.js +13 -0
  152. package/dist/components/NSLinkBlue.js.map +1 -0
  153. package/dist/components/NSLinkGreen.d.ts +2 -0
  154. package/dist/components/NSLinkGreen.js +6 -0
  155. package/dist/components/NSLinkGreen.js.map +1 -0
  156. package/dist/components/NSLinkRed.d.ts +2 -0
  157. package/dist/components/NSLinkRed.js +6 -0
  158. package/dist/components/NSLinkRed.js.map +1 -0
  159. package/dist/components/NSLoading.d.ts +4 -0
  160. package/dist/components/NSLoading.js +7 -0
  161. package/dist/components/NSLoading.js.map +1 -0
  162. package/dist/components/NSModal.d.ts +10 -0
  163. package/dist/components/NSModal.js +13 -0
  164. package/dist/components/NSModal.js.map +1 -0
  165. package/dist/components/NSNoData.d.ts +5 -0
  166. package/dist/components/NSNoData.js +7 -0
  167. package/dist/components/NSNoData.js.map +1 -0
  168. package/dist/components/NSPagination.d.ts +20 -0
  169. package/dist/components/NSPagination.js +82 -0
  170. package/dist/components/NSPagination.js.map +1 -0
  171. package/dist/components/NSPanel.d.ts +7 -0
  172. package/dist/components/NSPanel.js +7 -0
  173. package/dist/components/NSPanel.js.map +1 -0
  174. package/dist/components/NSPrintModal.d.ts +15 -0
  175. package/dist/components/NSPrintModal.js +35 -0
  176. package/dist/components/NSPrintModal.js.map +1 -0
  177. package/dist/components/NSRadioButton.d.ts +5 -0
  178. package/dist/components/NSRadioButton.js +15 -0
  179. package/dist/components/NSRadioButton.js.map +1 -0
  180. package/dist/components/NSSection.d.ts +7 -0
  181. package/dist/components/NSSection.js +10 -0
  182. package/dist/components/NSSection.js.map +1 -0
  183. package/dist/components/NSSectionBars.d.ts +7 -0
  184. package/dist/components/NSSectionBars.js +10 -0
  185. package/dist/components/NSSectionBars.js.map +1 -0
  186. package/dist/components/NSSectionCards.d.ts +13 -0
  187. package/dist/components/NSSectionCards.js +15 -0
  188. package/dist/components/NSSectionCards.js.map +1 -0
  189. package/dist/components/NSSectionTitle.d.ts +7 -0
  190. package/dist/components/NSSectionTitle.js +8 -0
  191. package/dist/components/NSSectionTitle.js.map +1 -0
  192. package/dist/components/NSSpace.d.ts +17 -0
  193. package/dist/components/NSSpace.js +19 -0
  194. package/dist/components/NSSpace.js.map +1 -0
  195. package/dist/components/NSTabPage.d.ts +13 -0
  196. package/dist/components/NSTabPage.js +9 -0
  197. package/dist/components/NSTabPage.js.map +1 -0
  198. package/dist/components/NSTable.d.ts +50 -0
  199. package/dist/components/NSTable.js +154 -0
  200. package/dist/components/NSTable.js.map +1 -0
  201. package/dist/components/NSTable.module.css +3 -3
  202. package/dist/components/NSTag.d.ts +2 -0
  203. package/dist/components/NSTag.js +22 -0
  204. package/dist/components/NSTag.js.map +1 -0
  205. package/dist/components/NSTitle.d.ts +5 -0
  206. package/dist/components/NSTitle.js +7 -0
  207. package/dist/components/NSTitle.js.map +1 -0
  208. package/dist/components/NSVerification.d.ts +9 -0
  209. package/dist/components/NSVerification.js +19 -0
  210. package/dist/components/NSVerification.js.map +1 -0
  211. package/dist/index.d.ts +1 -0
  212. package/dist/index.js +7 -0
  213. package/dist/index.js.map +1 -0
  214. package/dist/main.d.ts +81 -0
  215. package/dist/main.js +82 -0
  216. package/dist/main.js.map +1 -0
  217. package/dist/pages/NSLoginPage.d.ts +6 -0
  218. package/dist/pages/NSLoginPage.js +8 -0
  219. package/dist/pages/NSLoginPage.js.map +1 -0
  220. package/dist/pages/NSNotFoundPage.d.ts +1 -0
  221. package/dist/pages/NSNotFoundPage.js +7 -0
  222. package/dist/pages/NSNotFoundPage.js.map +1 -0
  223. package/dist/props/IBaseComponentProps.d.ts +7 -0
  224. package/dist/props/IBaseComponentProps.js +2 -0
  225. package/dist/props/IBaseComponentProps.js.map +1 -0
  226. package/dist/props/IHeaderIconProps.d.ts +8 -0
  227. package/dist/props/IHeaderIconProps.js +2 -0
  228. package/dist/props/IHeaderIconProps.js.map +1 -0
  229. package/dist/props/IHeaderProps.d.ts +5 -0
  230. package/dist/props/IHeaderProps.js +2 -0
  231. package/dist/props/IHeaderProps.js.map +1 -0
  232. package/dist/props/IImageProps.d.ts +4 -0
  233. package/dist/props/IImageProps.js +2 -0
  234. package/dist/props/IImageProps.js.map +1 -0
  235. package/dist/props/ILinkProps.d.ts +5 -0
  236. package/dist/props/ILinkProps.js +2 -0
  237. package/dist/props/ILinkProps.js.map +1 -0
  238. package/dist/props/IValidationNumberProps.d.ts +4 -0
  239. package/dist/props/IValidationNumberProps.js +2 -0
  240. package/dist/props/IValidationNumberProps.js.map +1 -0
  241. package/dist/props/IValidationProps.d.ts +6 -0
  242. package/dist/props/IValidationProps.js +2 -0
  243. package/dist/props/IValidationProps.js.map +1 -0
  244. package/dist/props/IValidationRegexProps.d.ts +4 -0
  245. package/dist/props/IValidationRegexProps.js +2 -0
  246. package/dist/props/IValidationRegexProps.js.map +1 -0
  247. package/dist/props/IValidationStringProps.d.ts +4 -0
  248. package/dist/props/IValidationStringProps.js +2 -0
  249. package/dist/props/IValidationStringProps.js.map +1 -0
  250. package/dist/routing/INSRouterMaker.d.ts +5 -0
  251. package/dist/routing/INSRouterMaker.js +2 -0
  252. package/dist/routing/INSRouterMaker.js.map +1 -0
  253. package/dist/routing/INSRouterProps.d.ts +4 -0
  254. package/dist/routing/INSRouterProps.js +2 -0
  255. package/dist/routing/INSRouterProps.js.map +1 -0
  256. package/dist/routing/INSRouterState.d.ts +4 -0
  257. package/dist/routing/INSRouterState.js +2 -0
  258. package/dist/routing/INSRouterState.js.map +1 -0
  259. package/dist/routing/NSRouterMaker.d.ts +11 -0
  260. package/dist/routing/NSRouterMaker.js +23 -0
  261. package/dist/routing/NSRouterMaker.js.map +1 -0
  262. package/dist/routing/Notifier.d.ts +16 -0
  263. package/dist/routing/Notifier.js +68 -0
  264. package/dist/routing/Notifier.js.map +1 -0
  265. package/package.json +1 -1
  266. package/src/components/NSTable.module.css +3 -3
  267. package/src/components/NSTable.tsx +1 -1
  268. package/tsconfig.json +7 -8
@@ -0,0 +1,86 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import React from "react";
4
+ import Styles from "./NSBoxEntity.module.css";
5
+ import { Select, Space } from 'antd';
6
+ import IconSelectBox from '../assets/images/icon-select-box.svg';
7
+ import { Validator } from "../Validator";
8
+ import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
9
+ import { NSLoading } from "./NSLoading";
10
+ export class NSBoxEntity extends React.Component {
11
+ constructor(props) {
12
+ super(props);
13
+ this.state = {
14
+ items: null,
15
+ items_string: null,
16
+ value: null,
17
+ values: [],
18
+ };
19
+ this.getValues = this.getValues.bind(this);
20
+ this.setValues = this.setValues.bind(this);
21
+ this.setValue = this.setValue.bind(this);
22
+ this.getValue = this.getValue.bind(this);
23
+ this.onChanged = this.onChanged.bind(this);
24
+ }
25
+ getError(value) {
26
+ let value_string = value == null ? "" : this.props.getValue(value);
27
+ return (Validator.getError(this.props.title, value_string, this.props));
28
+ }
29
+ getValue() {
30
+ let error = this.getError(this.state.value);
31
+ if (error) {
32
+ this.setState({ error });
33
+ throw new Error(error);
34
+ }
35
+ return this.state.value;
36
+ }
37
+ getValues() {
38
+ this.state.values.forEach(value => {
39
+ let error = this.getError(value);
40
+ if (error) {
41
+ this.setState({ error });
42
+ throw new Error(error);
43
+ }
44
+ });
45
+ return this.state.values;
46
+ }
47
+ setValue(value) {
48
+ this.setState({ value }, () => {
49
+ if (this.props.onChanged)
50
+ this.props.onChanged(this);
51
+ });
52
+ }
53
+ setValues(values) {
54
+ this.setState({ values }, () => {
55
+ if (this.props.onChanged)
56
+ this.props.onChanged(this);
57
+ });
58
+ }
59
+ onChanged(value) {
60
+ var _a, _b;
61
+ if (this.state.items)
62
+ if (this.props.multiple) {
63
+ let string_values = value;
64
+ let ds = (_a = this.state.items.filter(item => string_values.includes(this.props.getValue(item)))) !== null && _a !== void 0 ? _a : [];
65
+ this.setValues(ds);
66
+ }
67
+ else {
68
+ let d = (_b = this.state.items.find(item => this.props.getValue(item) === value)) !== null && _b !== void 0 ? _b : null;
69
+ this.setValue(d);
70
+ }
71
+ }
72
+ componentDidMount() {
73
+ this.props.getItems([], null, null).then(items => {
74
+ let items_string = items.rows.map(item => { return { value: this.props.getValue(item), desc: this.props.getText(item) }; });
75
+ this.setState({ items: items.rows, items_string });
76
+ }).catch(() => { });
77
+ }
78
+ render() {
79
+ var _a;
80
+ if (this.state.items == null) {
81
+ return _jsx(NSLoading, {});
82
+ }
83
+ return (_jsx(_Fragment, { children: _jsxs("div", { id: this.props.id, className: `${Styles.ns_input_parent}`, children: [_jsxs("span", { className: Styles.ns_input_title, children: [" ", this.props.required && _jsx("span", { style: { color: "red" }, children: "*" }), " ", this.props.title, " "] }), _jsx(Select, { mode: this.props.multiple ? "multiple" : undefined, style: { width: '100%' }, className: Styles.ns_input_entity, placeholder: this.props.placeholder, onChange: this.onChanged, onClick: () => this.props.onClicked, optionLabelProp: "label", options: (_a = this.state.items_string) !== null && _a !== void 0 ? _a : [], optionRender: (option) => (_jsx(Space, { className: Styles.ns_input_select_option, children: option.data.desc })), suffixIcon: _jsx("img", { src: IconSelectBox, alt: "SelectBox Icon" }) }), _jsx(NSBoxErrorNotifier, { error: this.state.error, clearError: () => this.setState({ error: "" }) })] }) }));
84
+ }
85
+ }
86
+ //# sourceMappingURL=NSBoxEntity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NSBoxEntity.js","sourceRoot":"","sources":["../../src/components/NSBoxEntity.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,aAAa,MAAM,sCAAsC,CAAC;AAGjE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG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E,MAAM,CAAC,cAAc,kBAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,eAAM,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAW,OAAG,IAAI,CAAC,KAAK,CAAC,KAAK,SAAS,EACrI,KAAC,MAAM,IACN,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAClD,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EACxB,SAAS,EAAE,MAAM,CAAC,eAAe,EACjC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EACnC,eAAe,EAAC,OAAO,EACvB,OAAO,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,YAAY,mCAAI,EAAE,EACtC,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CACzB,KAAC,KAAK,IAAC,SAAS,EAAE,MAAM,CAAC,sBAAsB,YAC7C,MAAM,CAAC,IAAI,CAAC,IAAI,GACV,CACR,EACD,UAAU,EAAE,cAAK,GAAG,EAAE,aAAa,EAAE,GAAG,EAAC,gBAAgB,GAAG,GAC3D,EACF,KAAC,kBAAkB,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAI,IAC1F,GACJ,CACH,CAAC;IACH,CAAC;CACD"}
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import { INSBoxComboProps, NSBoxCombo } from "./NSBoxCombo";
3
+ export interface INSBoxEnumProps extends INSBoxComboProps {
4
+ options: any;
5
+ }
6
+ export declare class NSBoxEnum extends React.Component<INSBoxEnumProps> {
7
+ NSBoxCombo: React.RefObject<NSBoxCombo>;
8
+ constructor(props: INSBoxEnumProps);
9
+ getError(value: string): string | null;
10
+ getValue<T>(enumObj: {
11
+ [s: string]: T;
12
+ }, _default: T): T | null;
13
+ getValues<T>(enumObj: {
14
+ [s: string]: T;
15
+ }, _default: T): T[];
16
+ setValue(value: string | null): void;
17
+ setValues(values: string[]): void;
18
+ render(): import("react/jsx-runtime").JSX.Element;
19
+ }
@@ -0,0 +1,46 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import React, { createRef } from "react";
4
+ import { ObjectService } from "namirasoft-core";
5
+ import { NSBoxCombo } from "./NSBoxCombo";
6
+ export class NSBoxEnum extends React.Component {
7
+ constructor(props) {
8
+ super(props);
9
+ this.NSBoxCombo = createRef();
10
+ this.getValues = this.getValues.bind(this);
11
+ this.setValues = this.setValues.bind(this);
12
+ this.setValue = this.setValue.bind(this);
13
+ this.getValue = this.getValue.bind(this);
14
+ }
15
+ getError(value) {
16
+ var _a, _b;
17
+ return (_b = (_a = this.NSBoxCombo.current) === null || _a === void 0 ? void 0 : _a.getError(value)) !== null && _b !== void 0 ? _b : null;
18
+ }
19
+ getValue(enumObj, _default) {
20
+ var _a;
21
+ return new ObjectService((_a = this.NSBoxCombo.current) === null || _a === void 0 ? void 0 : _a.getValue()).getEnum(enumObj, _default);
22
+ }
23
+ getValues(enumObj, _default) {
24
+ var _a, _b;
25
+ let values = (_b = (_a = this.NSBoxCombo.current) === null || _a === void 0 ? void 0 : _a.getValues()) !== null && _b !== void 0 ? _b : [];
26
+ return values.map(value => new ObjectService(value).getEnum(enumObj, _default));
27
+ }
28
+ setValue(value) {
29
+ var _a;
30
+ (_a = this.NSBoxCombo.current) === null || _a === void 0 ? void 0 : _a.setValue(value);
31
+ }
32
+ setValues(values) {
33
+ var _a;
34
+ (_a = this.NSBoxCombo.current) === null || _a === void 0 ? void 0 : _a.setValues(values);
35
+ }
36
+ render() {
37
+ let options = Object.keys(this.props.options).map(key => {
38
+ return {
39
+ desc: key,
40
+ value: key,
41
+ };
42
+ });
43
+ return (_jsx(NSBoxCombo, Object.assign({ ref: this.NSBoxCombo }, this.props, { options: options })));
44
+ }
45
+ }
46
+ //# sourceMappingURL=NSBoxEnum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NSBoxEnum.js","sourceRoot":"","sources":["../../src/components/NSBoxEnum.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAuC,UAAU,EAAE,MAAM,cAAc,CAAC;AAO/E,MAAM,OAAO,SAAU,SAAQ,KAAK,CAAC,SAA0B;IAG9D,YAAY,KAAsB;QAEjC,KAAK,CAAC,KAAK,CAAC,CAAC;QAHP,eAAU,GAAG,SAAS,EAAc,CAAC;QAI3C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;IACD,QAAQ,CAAC,KAAa;;QAErB,OAAO,MAAA,MAAA,IAAI,CAAC,UAAU,CAAC,OAAO,0CAAE,QAAQ,CAAC,KAAK,CAAC,mCAAI,IAAI,CAAC;IACzD,CAAC;IACD,QAAQ,CAAI,OAA2B,EAAE,QAAW;;QAEnD,OAAO,IAAI,aAAa,CAAC,MAAA,IAAI,CAAC,UAAU,CAAC,OAAO,0CAAE,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC1F,CAAC;IACD,SAAS,CAAI,OAA2B,EAAE,QAAW;;QAEpD,IAAI,MAAM,GAAG,MAAA,MAAA,IAAI,CAAC,UAAU,CAAC,OAAO,0CAAE,SAAS,EAAE,mCAAI,EAAE,CAAC;QACxD,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;IACjF,CAAC;IACD,QAAQ,CAAC,KAAoB;;QAE5B,MAAA,IAAI,CAAC,UAAU,CAAC,OAAO,0CAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IACD,SAAS,CAAC,MAAgB;;QAEzB,MAAA,IAAI,CAAC,UAAU,CAAC,OAAO,0CAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;IACQ,MAAM;QAEd,IAAI,OAAO,GAAwB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YAE5E,OAAO;gBACN,IAAI,EAAE,GAAG;gBACT,KAAK,EAAE,GAAG;aACV,CAAC;QACH,CAAC,CAAC,CAAC;QACH,OAAO,CACN,KAAC,UAAU,kBAAC,GAAG,EAAE,IAAI,CAAC,UAAU,IAAM,IAAI,CAAC,KAAK,IAAE,OAAO,EAAE,OAAO,IAAe,CACjF,CAAC;IACH,CAAC;CACD"}
@@ -0,0 +1,6 @@
1
+ import { IBaseComponentProps } from "../props/IBaseComponentProps";
2
+ export interface INSBoxErrorNotifierProps extends IBaseComponentProps {
3
+ error?: string;
4
+ clearError: () => void;
5
+ }
6
+ export declare function NSBoxErrorNotifier(props: INSBoxErrorNotifierProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import Styles from "./NSBoxErrorNotifier.module.css";
3
+ import Danger from '../assets/images/danger.svg';
4
+ export function NSBoxErrorNotifier(props) {
5
+ if (props.error)
6
+ setTimeout(() => {
7
+ props.clearError();
8
+ }, 5000);
9
+ return _jsx(_Fragment, { children: props.error && (_jsxs("div", { id: props.id, className: "d-flex justify-content-start align-items-center gap-2 ms-2", children: [_jsx("img", { className: "", src: Danger, alt: "Error Icon", width: 13, height: 13 }), _jsx("span", { className: Styles.ns_input_error, children: props.error })] })) });
10
+ }
11
+ //# sourceMappingURL=NSBoxErrorNotifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NSBoxErrorNotifier.js","sourceRoot":"","sources":["../../src/components/NSBoxErrorNotifier.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,iCAAiC,CAAC;AACrD,OAAO,MAAM,MAAM,6BAA6B,CAAC;AASjD,MAAM,UAAU,kBAAkB,CAAC,KAA+B;IAEjE,IAAI,KAAK,CAAC,KAAK;QACd,UAAU,CAAC,GAAG,EAAE;YAEf,KAAK,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC,EAAE,IAAI,CAAC,CAAC;IACV,OAAO,4BAEL,KAAK,CAAC,KAAK,IAAI,CACd,eAAK,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,SAAS,EAAC,4DAA4D,aACxF,cACC,SAAS,EAAE,EAAE,EACb,GAAG,EAAE,MAAM,EACX,GAAG,EAAC,YAAY,EAChB,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,GACT,EACF,eAAM,SAAS,EAAE,MAAM,CAAC,cAAc,YAAG,KAAK,CAAC,KAAK,GAAQ,IACtD,CACP,GAEA,CAAC;AACL,CAAC"}
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import { IBaseComponentProps } from "../props/IBaseComponentProps";
3
+ import { IValidationProps } from "../props/IValidationProps";
4
+ import { IValidationStringProps } from "../props/IValidationStringProps";
5
+ export interface INSBoxIPV4Props extends IBaseComponentProps, IValidationProps, IValidationStringProps {
6
+ title: string;
7
+ placeholder?: string;
8
+ defaultValue?: string;
9
+ onChanged?: (e: NSBoxIPV4) => void;
10
+ onClicked?: (e: NSBoxIPV4) => void;
11
+ }
12
+ export interface INSBoxIPV4State {
13
+ value: string;
14
+ error?: string;
15
+ }
16
+ export declare class NSBoxIPV4 extends React.Component<INSBoxIPV4Props, INSBoxIPV4State> {
17
+ constructor(props: INSBoxIPV4Props);
18
+ getError(): string | null;
19
+ getValue(): string;
20
+ setValue(value: string): void;
21
+ private onChanged;
22
+ render(): import("react/jsx-runtime").JSX.Element;
23
+ }
@@ -0,0 +1,45 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import React from "react";
4
+ import Styles from "./NSBox.module.css";
5
+ import IconInputIP from '../assets/images/icon-input-ip.svg';
6
+ import { Validator } from "../Validator";
7
+ import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
8
+ const IPV4_PATTERN = "^((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$";
9
+ export class NSBoxIPV4 extends React.Component {
10
+ constructor(props) {
11
+ var _a;
12
+ super(props);
13
+ this.state = { value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : "" };
14
+ this.getValue = this.getValue.bind(this);
15
+ this.setValue = this.setValue.bind(this);
16
+ this.onChanged = this.onChanged.bind(this);
17
+ }
18
+ getError() {
19
+ return (Validator.getError(this.props.title, this.state.value, this.props) ||
20
+ Validator.getErrorString(this.props.title, this.state.value, this.props) ||
21
+ Validator.getErrorIP(this.props.title, this.state.value));
22
+ }
23
+ getValue() {
24
+ let error = this.getError();
25
+ if (error) {
26
+ this.setState({ error });
27
+ throw new Error(error);
28
+ }
29
+ return this.state.value;
30
+ }
31
+ setValue(value) {
32
+ this.setState({ value }, () => {
33
+ if (this.props.onChanged)
34
+ this.props.onChanged(this);
35
+ });
36
+ }
37
+ onChanged(e) {
38
+ this.setValue(e.target.value);
39
+ }
40
+ render() {
41
+ var _a;
42
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { id: this.props.id, className: `${Styles.ns_input_parent} ${(_a = this.props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")}`, style: this.props.style, children: [_jsxs("span", { className: Styles.ns_input_title, children: [" ", this.props.required && _jsx("span", { style: { color: "red" }, children: "*" }), " ", this.props.title, " "] }), _jsx("input", { type: "text", name: this.props.name, className: Styles.ns_input, placeholder: this.props.placeholder, value: this.state.value, onChange: this.onChanged, onClick: () => this.props.onClicked, minLength: 7, maxLength: 15, size: 15, pattern: IPV4_PATTERN, style: { background: `url(${IconInputIP}) white no-repeat scroll center right 16px` } })] }), _jsx(NSBoxErrorNotifier, { error: this.state.error, clearError: () => this.setState({ error: "" }) })] }));
43
+ }
44
+ }
45
+ //# sourceMappingURL=NSBoxIPV4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NSBoxIPV4.js","sourceRoot":"","sources":["../../src/components/NSBoxIPV4.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,WAAW,MAAM,oCAAoC,CAAC;AAI7D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,MAAM,YAAY,GAAW,2EAA2E,CAAA;AAgBxG,MAAM,OAAO,SAAU,SAAQ,KAAK,CAAC,SAA2C;IAE/E,YAAY,KAAsB;;QAEjC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAE,KAAK,EAAE,MAAA,KAAK,CAAC,YAAY,mCAAI,EAAE,EAAE,CAAC;QACjD,IAAI,CAAC,QAAQ,GAAG,IAAI,C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AC/B,CAAC;IACQ,MAAM;;QAEd,OAAO,CACN,8BACC,eAAK,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,eAAe,IAAI,MAAA,IAAI,CAAC,KAAK,CAAC,SAAS,0CAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,aACzH,gBAAM,SAAS,EAAE,MAAM,CAAC,cAAc,kBAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,eAAM,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAW,OAAG,IAAI,CAAC,KAAK,CAAC,KAAK,SAAS,EACrI,gBACC,IAAI,EAAC,MAAM,EACX,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EACrB,SAAS,EAAE,MAAM,CAAC,QAAQ,EAC1B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EACnC,SAAS,EAAE,CAAC,EACZ,SAAS,EAAE,EAAE,EACb,IAAI,EAAE,EAAE,EACR,OAAO,EAAE,YAAY,EACrB,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,WAAW,4CAA4C,EAAE,GACpF,IACG,EACN,KAAC,kBAAkB,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAI,IAC7F,CACH,CAAC;IACH,CAAC;CACD"}
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import { IBaseComponentProps } from "../props/IBaseComponentProps";
3
+ import { IValidationProps } from "../props/IValidationProps";
4
+ import { IValidationStringProps } from "../props/IValidationStringProps";
5
+ export interface INSBoxIPV6Props extends IBaseComponentProps, IValidationProps, IValidationStringProps {
6
+ title: string;
7
+ placeholder?: string;
8
+ defaultValue?: string;
9
+ onChanged?: (e: NSBoxIPV6) => void;
10
+ onClicked?: (e: NSBoxIPV6) => void;
11
+ }
12
+ export interface INSBoxIPV6State {
13
+ value: string;
14
+ error?: string;
15
+ }
16
+ export declare class NSBoxIPV6 extends React.Component<INSBoxIPV6Props, INSBoxIPV6State> {
17
+ constructor(props: INSBoxIPV6Props);
18
+ getError(): string | null;
19
+ getValue(): string;
20
+ setValue(value: string): void;
21
+ private onChanged;
22
+ render(): import("react/jsx-runtime").JSX.Element;
23
+ }
@@ -0,0 +1,45 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import React from "react";
4
+ import Styles from "./NSBox.module.css";
5
+ import IconInputIP from '../assets/images/icon-input-ip.svg';
6
+ import { Validator } from "../Validator";
7
+ import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
8
+ const IPV6_PATTERN = '^((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?$';
9
+ export class NSBoxIPV6 extends React.Component {
10
+ constructor(props) {
11
+ var _a;
12
+ super(props);
13
+ this.state = { value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : "" };
14
+ this.getValue = this.getValue.bind(this);
15
+ this.setValue = this.setValue.bind(this);
16
+ this.onChanged = this.onChanged.bind(this);
17
+ }
18
+ getError() {
19
+ return (Validator.getError(this.props.title, this.state.value, this.props) ||
20
+ Validator.getErrorString(this.props.title, this.state.value, this.props) ||
21
+ Validator.getErrorIP(this.props.title, this.state.value));
22
+ }
23
+ getValue() {
24
+ let error = this.getError();
25
+ if (error) {
26
+ this.setState({ error });
27
+ throw new Error(error);
28
+ }
29
+ return this.state.value;
30
+ }
31
+ setValue(value) {
32
+ this.setState({ value }, () => {
33
+ if (this.props.onChanged)
34
+ this.props.onChanged(this);
35
+ });
36
+ }
37
+ onChanged(e) {
38
+ this.setValue(e.target.value);
39
+ }
40
+ render() {
41
+ var _a;
42
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { id: this.props.id, className: `${Styles.ns_input_parent} ${(_a = this.props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")}`, style: this.props.style, children: [_jsxs("span", { className: Styles.ns_input_title, children: [" ", this.props.required && _jsx("span", { style: { color: "red" }, children: "*" }), " ", this.props.title, " "] }), _jsx("input", { type: "text", name: this.props.name, className: Styles.ns_input, placeholder: this.props.placeholder, value: this.state.value, onChange: this.onChanged, onClick: () => this.props.onClicked, pattern: IPV6_PATTERN, style: { background: `url(${IconInputIP}) white no-repeat scroll center right 16px` } })] }), _jsx(NSBoxErrorNotifier, { error: this.state.error, clearError: () => this.setState({ error: "" }) })] }));
43
+ }
44
+ }
45
+ //# sourceMappingURL=NSBoxIPV6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NSBoxIPV6.js","sourceRoot":"","sources":["../../src/components/NSBoxIPV6.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,WAAW,MAAM,oCAAoC,CAAC;AAI7D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,MAAM,YAAY,GAAW,mjCAAmjC,CAAC;AAgBjlC,MAAM,OAAO,SAAU,SAAQ,KAAK,CAAC,SAA2C;IAE/E,YAAY,KAAsB;;QAEjC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAE,KAAK,EAAE,MAAA,KAAK,CAAC,YAAY,mCAAI,EAAE,EAAE,CAAC;QACjD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,QAA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I,CAAC,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,eAAe,IAAI,MAAA,IAAI,CAAC,KAAK,CAAC,SAAS,0CAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,aACzH,gBAAM,SAAS,EAAE,MAAM,CAAC,cAAc,kBAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,eAAM,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAW,OAAG,IAAI,CAAC,KAAK,CAAC,KAAK,SAAS,EACrI,gBACC,IAAI,EAAC,MAAM,EACX,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EACrB,SAAS,EAAE,MAAM,CAAC,QAAQ,EAC1B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EACnC,OAAO,EAAE,YAAY,EACrB,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,WAAW,4CAA4C,EAAE,GACpF,IACG,EACN,KAAC,kBAAkB,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAI,IAC7F,CACH,CAAC;IACH,CAAC;CACD"}
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import { IBaseComponentProps } from "../props/IBaseComponentProps";
3
+ import { IValidationNumberProps } from "../props/IValidationNumberProps";
4
+ import { IValidationProps } from "../props/IValidationProps";
5
+ export interface INSBoxIntegerProps extends IBaseComponentProps, IValidationProps, IValidationNumberProps {
6
+ title: string;
7
+ placeholder?: string;
8
+ defaultValue?: number;
9
+ onChanged?: (e: NSBoxInteger) => void;
10
+ onClicked?: (e: NSBoxInteger) => void;
11
+ }
12
+ export interface INSBoxIntegerState {
13
+ value?: number;
14
+ error?: string;
15
+ }
16
+ export declare class NSBoxInteger extends React.Component<INSBoxIntegerProps, INSBoxIntegerState> {
17
+ constructor(props: INSBoxIntegerProps);
18
+ getError(): string | null;
19
+ getValue(): number | undefined;
20
+ setValue(value: number | undefined): void;
21
+ private onChanged;
22
+ render(): import("react/jsx-runtime").JSX.Element;
23
+ }
@@ -0,0 +1,42 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import React from "react";
4
+ import Styles from "./NSBox.module.css";
5
+ import IconInputInteger from '../assets/images/icon-input-integer.svg';
6
+ import { Validator } from "../Validator";
7
+ import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
8
+ export class NSBoxInteger extends React.Component {
9
+ constructor(props) {
10
+ super(props);
11
+ this.state = { value: props.defaultValue };
12
+ this.getValue = this.getValue.bind(this);
13
+ this.setValue = this.setValue.bind(this);
14
+ this.onChanged = this.onChanged.bind(this);
15
+ }
16
+ getError() {
17
+ return (Validator.getError(this.props.title, this.state.value, this.props) ||
18
+ Validator.getErrorNumber(this.props.title, this.state.value, this.props));
19
+ }
20
+ getValue() {
21
+ let error = this.getError();
22
+ if (error) {
23
+ this.setState({ error });
24
+ throw new Error(error);
25
+ }
26
+ return this.state.value;
27
+ }
28
+ setValue(value) {
29
+ this.setState({ value }, () => {
30
+ if (this.props.onChanged)
31
+ this.props.onChanged(this);
32
+ });
33
+ }
34
+ onChanged(e) {
35
+ this.setValue(parseInt(e.target.value));
36
+ }
37
+ render() {
38
+ var _a;
39
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { id: this.props.id, className: `${Styles.ns_input_parent} ${(_a = this.props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")}`, style: this.props.style, children: [_jsxs("span", { className: Styles.ns_input_title, children: [" ", this.props.required && _jsx("span", { style: { color: "red" }, children: "*" }), " ", this.props.title, " "] }), _jsx("input", { type: "number", name: this.props.name, className: Styles.ns_input, placeholder: this.props.placeholder, value: this.state.value, onChange: this.onChanged, onClick: () => this.props.onClicked, style: { background: `url(${IconInputInteger}) white no-repeat scroll center right 16px` } })] }), _jsx(NSBoxErrorNotifier, { error: this.state.error, clearError: () => this.setState({ error: "" }) })] }));
40
+ }
41
+ }
42
+ //# sourceMappingURL=NSBoxInteger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NSBoxInteger.js","sourceRoot":"","sources":["../../src/components/NSBoxInteger.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,gBAAgB,MAAM,yCAAyC,CAAC;AAIvE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAiB1D,MAAM,OAAO,YAAa,SAAQ,KAAK,CAAC,SAAiD;IAExF,YAAY,KAAyB;QAEpC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IACD,QAAQ;QAEP,OAAO,CACN,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK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CAAC,KAAK,SAAS,EACrI,gBACC,IAAI,EAAC,QAAQ,EACb,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EACrB,SAAS,EAAE,MAAM,CAAC,QAAQ,EAC1B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EACnC,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,gBAAgB,4CAA4C,EAAE,GACzF,IACG,EACN,KAAC,kBAAkB,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAI,IAC7F,CACH,CAAC;IACH,CAAC;CACD"}
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import { ReactNode } from "react";
3
+ import { IBaseComponentProps } from '../main';
4
+ export interface INSBoxLabelProps extends IBaseComponentProps {
5
+ title: string;
6
+ children: ReactNode;
7
+ }
8
+ export interface INSBoxLabelState {
9
+ }
10
+ export declare class NSBoxLabel extends React.Component<INSBoxLabelProps, INSBoxLabelState> {
11
+ render(): import("react/jsx-runtime").JSX.Element;
12
+ }
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import Styles from './NSBoxLabel.module.css';
4
+ import React from "react";
5
+ export class NSBoxLabel extends React.Component {
6
+ render() {
7
+ var _a;
8
+ return (_jsxs("div", { id: this.props.id, className: `${Styles.ns_tab_item} ${(_a = this.props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")}`, style: this.props.style, children: [_jsx("span", { className: `${Styles.ns_box_label_title} ns_font_16_bold`, children: this.props.title }), _jsx("div", { children: this.props.children })] }));
9
+ }
10
+ }
11
+ //# sourceMappingURL=NSBoxLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NSBoxLabel.js","sourceRoot":"","sources":["../../src/components/NSBoxLabel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,MAAM,MAAM,yBAAyB,CAAA;AAC5C,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,MAAM,OAAO,UAAW,SAAQ,KAAK,CAAC,SAA6C;IAEtE,MAAM;;QAEX,OAAO,CACH,eAAK,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,WAAW,IAAI,MAAA,IAAI,CAAC,KAAK,CAAC,SAAS,0CAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,aAClH,eAAM,SAAS,EAAE,GAAG,MAAM,CAAC,kBAAkB,kBAAkB,YAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAQ,EAC1F,wBACK,IAAI,CAAC,KAAK,CAAC,QAAQ,GAClB,IACJ,CACT,CAAC;IACN,CAAC;CACJ"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { IBaseComponentProps } from '../main';
3
+ interface INSBoxOTPProps extends IBaseComponentProps {
4
+ placeholder?: string;
5
+ defaultValue?: string;
6
+ onChanged?: (e: React.ChangeEvent<HTMLInputElement>) => void;
7
+ }
8
+ declare function NSBoxOTP(props: INSBoxOTPProps): import("react/jsx-runtime").JSX.Element;
9
+ export default NSBoxOTP;
@@ -0,0 +1,34 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useState, useRef } from 'react';
3
+ import Styles from './NSBoxOTP.module.css';
4
+ function NSBoxOTP(props) {
5
+ var _a;
6
+ let [state, setState] = useState("");
7
+ const [values, setValues] = useState(Array(6).fill(''));
8
+ const inputsRef = useRef([]);
9
+ const handleChange = (index) => (event) => {
10
+ var _a;
11
+ const newValue = event.target.value;
12
+ setState(state + newValue);
13
+ if (/^\d?$/.test(newValue)) {
14
+ const updatedValues = [...values];
15
+ updatedValues[index] = newValue;
16
+ setValues(updatedValues);
17
+ if (newValue && index < 5) {
18
+ (_a = inputsRef.current[index + 1]) === null || _a === void 0 ? void 0 : _a.focus();
19
+ }
20
+ }
21
+ if (props.onChanged)
22
+ props.onChanged(event);
23
+ };
24
+ const handleKeyDown = (index) => (event) => {
25
+ var _a;
26
+ if (event.key === 'Backspace' && !values[index] && index > 0) {
27
+ (_a = inputsRef.current[index - 1]) === null || _a === void 0 ? void 0 : _a.focus();
28
+ }
29
+ };
30
+ return (_jsx("div", { id: props.id, className: `${Styles.ns_input_parent} ${(_a = props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")}`, style: Object.assign(Object.assign({}, props.style), { display: 'flex', gap: '10px' }), children: values.map((value, index) => (_jsx("input", { ref: el => inputsRef.current[index] = el, type: "text", value: value, onChange: handleChange(index), onKeyDown: handleKeyDown(index), maxLength: 1, style: { width: '30px', textAlign: 'center' }, className: Styles.ns_otp_input }, index + 10))) }));
31
+ }
32
+ ;
33
+ export default NSBoxOTP;
34
+ //# sourceMappingURL=NSBoxOTP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NSBoxOTP.js","sourceRoot":"","sources":["../../src/components/NSBoxOTP.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAe,MAAM,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,MAAM,MAAM,uBAAuB,CAAA;AAU1C,SAAS,QAAQ,CAAC,KAAqB;;IAEnC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAErC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAW,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IAClE,MAAM,SA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,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CACzB,gBAEI,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,EACxC,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,YAAY,CAAC,KAAK,CAAC,EAC7B,SAAS,EAAE,aAAa,CAAC,KAAK,CAAC,EAC/B,SAAS,EAAE,CAAC,EACZ,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,EAC7C,SAAS,EAAE,MAAM,CAAC,YAAY,IARzB,KAAK,GAAG,EAAE,CASjB,CACL,CAAC,GAEH,CACV,CAAC;AACN,CAAC;AAAA,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import { IBaseComponentProps } from "../props/IBaseComponentProps";
3
+ import { IValidationProps } from "../props/IValidationProps";
4
+ import { IValidationStringProps } from "../props/IValidationStringProps";
5
+ export interface INSBoxPasswordProps extends IBaseComponentProps, IValidationProps, IValidationStringProps {
6
+ title: string;
7
+ placeholder?: string;
8
+ defaultValue?: string;
9
+ onChanged?: (e: NSBoxPassword) => void;
10
+ onClicked?: (e: NSBoxPassword) => void;
11
+ }
12
+ export interface INSBoxPasswordState {
13
+ value: string;
14
+ error?: string;
15
+ }
16
+ export declare class NSBoxPassword extends React.Component<INSBoxPasswordProps, INSBoxPasswordState> {
17
+ constructor(props: INSBoxPasswordProps);
18
+ getError(): string | null;
19
+ getValue(): string;
20
+ setValue(value: string): void;
21
+ private onChanged;
22
+ render(): import("react/jsx-runtime").JSX.Element;
23
+ }
@@ -0,0 +1,43 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import React from "react";
4
+ import Styles from "./NSBox.module.css";
5
+ import IconInputString from '../assets/images/icon-input-string.svg';
6
+ import { Validator } from "../Validator";
7
+ import { NSBoxErrorNotifier } from "./NSBoxErrorNotifier";
8
+ export class NSBoxPassword extends React.Component {
9
+ constructor(props) {
10
+ var _a;
11
+ super(props);
12
+ this.state = { value: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : "" };
13
+ this.getValue = this.getValue.bind(this);
14
+ this.setValue = this.setValue.bind(this);
15
+ this.onChanged = this.onChanged.bind(this);
16
+ }
17
+ getError() {
18
+ return (Validator.getError(this.props.title, this.state.value, this.props) ||
19
+ Validator.getErrorString(this.props.title, this.state.value, this.props));
20
+ }
21
+ getValue() {
22
+ let error = this.getError();
23
+ if (error) {
24
+ this.setState({ error });
25
+ throw new Error(error);
26
+ }
27
+ return this.state.value;
28
+ }
29
+ setValue(value) {
30
+ this.setState({ value }, () => {
31
+ if (this.props.onChanged)
32
+ this.props.onChanged(this);
33
+ });
34
+ }
35
+ onChanged(e) {
36
+ this.setValue(e.target.value);
37
+ }
38
+ render() {
39
+ var _a;
40
+ return (_jsx(_Fragment, { children: _jsxs("div", { id: this.props.id, className: `${Styles.ns_input_parent} ${(_a = this.props.classList) === null || _a === void 0 ? void 0 : _a.join(" ")}`, style: this.props.style, children: [_jsxs("span", { className: Styles.ns_input_title, children: [" ", this.props.required && _jsx("span", { style: { color: "red" }, children: "*" }), " ", this.props.title, " "] }), _jsx("input", { type: "password", name: this.props.name, className: Styles.ns_input, placeholder: this.props.placeholder, value: this.state.value, onChange: this.onChanged, onClick: () => this.props.onClicked, style: { background: `url(${IconInputString}) white no-repeat scroll center right 16px` } }), _jsx(NSBoxErrorNotifier, { error: this.state.error, clearError: () => this.setState({ error: "" }) })] }) }));
41
+ }
42
+ }
43
+ //# sourceMappingURL=NSBoxPassword.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NSBoxPassword.js","sourceRoot":"","sources":["../../src/components/NSBoxPassword.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MA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AC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAI,IAC1F,GACJ,CACH,CAAC;IACH,CAAC;CACD"}
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ import 'react-phone-input-2/lib/style.css';
3
+ import { IBaseComponentProps } from "../props/IBaseComponentProps";
4
+ import { IValidationProps } from "../props/IValidationProps";
5
+ import { IValidationStringProps } from "../props/IValidationStringProps";
6
+ export interface INSBoxPhoneProps extends IBaseComponentProps, IValidationProps, IValidationStringProps {
7
+ title: string;
8
+ placeholder?: string;
9
+ defaultValue?: string;
10
+ onChanged?: (e: NSBoxPhone) => void;
11
+ onClicked?: (e: NSBoxPhone) => void;
12
+ }
13
+ export interface INSBoxPhoneState {
14
+ value: string;
15
+ error?: string;
16
+ isFullScreen: boolean;
17
+ }
18
+ export declare class NSBoxPhone extends React.Component<INSBoxPhoneProps, INSBoxPhoneState> {
19
+ constructor(props: INSBoxPhoneProps);
20
+ getError(): string | null;
21
+ getValue(): string;
22
+ setValue(value: string): void;
23
+ private toggleFullScreen;
24
+ render(): import("react/jsx-runtime").JSX.Element;
25
+ }