namirasoft-site-react 1.5.14 → 1.5.16

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 (372) hide show
  1. package/.dockerignore +86 -86
  2. package/.env.template +10 -10
  3. package/Dockerfile +18 -18
  4. package/SKILL.md +307 -307
  5. package/config-overrides.js +72 -72
  6. package/dist/App.css +33 -33
  7. package/dist/components/NSBanner.module.css +47 -47
  8. package/dist/components/NSBarAction.module.css +91 -91
  9. package/dist/components/NSBarAlert.module.css +79 -79
  10. package/dist/components/NSBarNotification.module.css +34 -34
  11. package/dist/components/NSBarTitle.module.css +9 -9
  12. package/dist/components/NSBox.module.css +87 -87
  13. package/dist/components/NSBoxBaseCombo.js +1 -1
  14. package/dist/components/NSBoxBaseCombo.js.map +1 -1
  15. package/dist/components/NSBoxBaseCombo.module.css +6 -6
  16. package/dist/components/NSBoxBoolean.module.css +73 -73
  17. package/dist/components/NSBoxDate.module.css +4 -4
  18. package/dist/components/NSBoxDateRangeBase.module.css +73 -73
  19. package/dist/components/NSBoxDateTime.module.css +4 -4
  20. package/dist/components/NSBoxDuration.module.css +4 -4
  21. package/dist/components/NSBoxFile.module.css +10 -10
  22. package/dist/components/NSBoxInteger.module.css +16 -16
  23. package/dist/components/NSBoxOptions.module.css +53 -53
  24. package/dist/components/NSBoxPhone.module.css +35 -35
  25. package/dist/components/NSBoxRadio.module.css +33 -33
  26. package/dist/components/NSBoxSchemaBase.module.css +17 -17
  27. package/dist/components/NSBoxSchemaVariable.module.css +16 -16
  28. package/dist/components/NSBoxTextArea.module.css +12 -12
  29. package/dist/components/NSBoxTime.module.css +4 -4
  30. package/dist/components/NSButton.module.css +57 -57
  31. package/dist/components/NSButtonBlue.module.css +4 -4
  32. package/dist/components/NSButtonGreen.module.css +4 -4
  33. package/dist/components/NSButtonRed.module.css +4 -4
  34. package/dist/components/NSCard.module.css +113 -113
  35. package/dist/components/NSCardScreenshot.module.css +41 -41
  36. package/dist/components/NSColumn.module.css +16 -16
  37. package/dist/components/NSCopyBox.module.css +39 -39
  38. package/dist/components/NSDialog.module.css +105 -105
  39. package/dist/components/NSDialogPageSelection.d.ts +3 -1
  40. package/dist/components/NSDialogPageSelection.js +5 -3
  41. package/dist/components/NSDialogPageSelection.js.map +1 -1
  42. package/dist/components/NSDialogPageSelection.module.css +103 -103
  43. package/dist/components/NSDownTimer.module.css +55 -55
  44. package/dist/components/NSDownload.module.css +46 -46
  45. package/dist/components/NSElectronicCard.module.css +60 -60
  46. package/dist/components/NSEntityCardBackground.module.css +27 -27
  47. package/dist/components/NSFilterBox.module.css +27 -27
  48. package/dist/components/NSFilterBoxItems.module.css +15 -15
  49. package/dist/components/NSFilterItem.module.css +24 -24
  50. package/dist/components/NSFooter.module.css +140 -140
  51. package/dist/components/NSGauge.module.css +67 -67
  52. package/dist/components/NSGaugeDate.module.css +57 -57
  53. package/dist/components/NSGaugeNumber.js.map +1 -1
  54. package/dist/components/NSGaugeNumber.module.css +66 -66
  55. package/dist/components/NSHeader.module.css +316 -316
  56. package/dist/components/NSHeaderScreenshot.module.css +35 -35
  57. package/dist/components/NSLabel.module.css +25 -25
  58. package/dist/components/NSLabelErrorNotifier.module.css +2 -2
  59. package/dist/components/NSLabelSensitive.module.css +9 -9
  60. package/dist/components/NSLayout.module.css +22 -22
  61. package/dist/components/NSLine.module.css +15 -15
  62. package/dist/components/NSLineText.module.css +38 -38
  63. package/dist/components/NSLink.module.css +36 -36
  64. package/dist/components/NSListGrouped.js +1 -1
  65. package/dist/components/NSListGrouped.js.map +1 -1
  66. package/dist/components/NSListGrouped.module.css +69 -69
  67. package/dist/components/NSListMenu.d.ts +9 -9
  68. package/dist/components/NSListMenu.js +134 -111
  69. package/dist/components/NSListMenu.js.map +1 -1
  70. package/dist/components/NSLoading.module.css +10 -10
  71. package/dist/components/NSMegaMenu.module.css +133 -133
  72. package/dist/components/NSMenuAction.module.css +88 -88
  73. package/dist/components/NSMenuButton.module.css +44 -44
  74. package/dist/components/NSNoData.module.css +11 -11
  75. package/dist/components/NSPagination.module.css +87 -87
  76. package/dist/components/NSPanel.module.css +28 -28
  77. package/dist/components/NSPanelAccordion.module.css +4 -4
  78. package/dist/components/NSProductSearch.module.css +73 -73
  79. package/dist/components/NSProgressBar.module.css +38 -38
  80. package/dist/components/NSRange.module.css +66 -66
  81. package/dist/components/NSReorderDialog.d.ts +3 -0
  82. package/dist/components/NSReorderDialog.js +23 -3
  83. package/dist/components/NSReorderDialog.js.map +1 -1
  84. package/dist/components/NSReorderDialog.module.css +49 -49
  85. package/dist/components/NSRow.module.css +17 -17
  86. package/dist/components/NSSection.module.css +4 -4
  87. package/dist/components/NSSectionCards.module.css +38 -38
  88. package/dist/components/NSSectionTiles.module.css +10 -10
  89. package/dist/components/NSSplitter.module.css +59 -59
  90. package/dist/components/NSTabPage.module.css +59 -59
  91. package/dist/components/NSTable.d.ts +9 -2
  92. package/dist/components/NSTable.js +191 -29
  93. package/dist/components/NSTable.js.map +1 -1
  94. package/dist/components/NSTable.module.css +372 -372
  95. package/dist/components/NSTableChart.module.css +119 -119
  96. package/dist/components/NSTile.module.css +76 -76
  97. package/dist/components/NSTimelineMonthly.module.css +71 -71
  98. package/dist/components/NSTitle.module.css +15 -15
  99. package/dist/index.css +5 -5
  100. package/dist/main.d.ts +0 -1
  101. package/dist/main.js +0 -1
  102. package/dist/main.js.map +1 -1
  103. package/dist/pages/NSImplementing.module.css +35 -35
  104. package/dist/pages/NSNotFoundPage.module.css +18 -18
  105. package/dist/pages/NSUpdating.module.css +35 -35
  106. package/package.json +86 -86
  107. package/public/index.html +38 -38
  108. package/src/App.css +33 -33
  109. package/src/App.tsx +167 -167
  110. package/src/BrowserDetector.ts +109 -109
  111. package/src/Color.tsx +10 -10
  112. package/src/CopyToClipboard.ts +6 -6
  113. package/src/EncryptionOperation.ts +98 -98
  114. package/src/KeyOperation.ts +109 -109
  115. package/src/LinkOperation.ts +101 -101
  116. package/src/NSBoxBuilder.tsx +922 -922
  117. package/src/ProductCacheService.ts +15 -15
  118. package/src/Validator.ts +199 -199
  119. package/src/components/INSBox.tsx +7 -7
  120. package/src/components/NSBanner.module.css +47 -47
  121. package/src/components/NSBanner.tsx +80 -80
  122. package/src/components/NSBarAction.module.css +91 -91
  123. package/src/components/NSBarAction.tsx +95 -95
  124. package/src/components/NSBarAlert.module.css +79 -79
  125. package/src/components/NSBarAlert.tsx +35 -35
  126. package/src/components/NSBarNotification.module.css +34 -34
  127. package/src/components/NSBarNotification.tsx +89 -89
  128. package/src/components/NSBarTitle.module.css +9 -9
  129. package/src/components/NSBarTitle.tsx +23 -23
  130. package/src/components/NSBox.module.css +87 -87
  131. package/src/components/NSBox.tsx +19 -19
  132. package/src/components/NSBoxBaseCombo.module.css +6 -6
  133. package/src/components/NSBoxBaseCombo.tsx +488 -488
  134. package/src/components/NSBoxBaseLayout.tsx +163 -163
  135. package/src/components/NSBoxBaseLayoutRecursive.tsx +59 -59
  136. package/src/components/NSBoxBoolean.module.css +73 -73
  137. package/src/components/NSBoxBoolean.tsx +152 -152
  138. package/src/components/NSBoxBooleans.tsx +181 -181
  139. package/src/components/NSBoxColor.tsx +107 -107
  140. package/src/components/NSBoxCombo.tsx +95 -95
  141. package/src/components/NSBoxDate.module.css +4 -4
  142. package/src/components/NSBoxDate.tsx +144 -144
  143. package/src/components/NSBoxDateRange.tsx +88 -88
  144. package/src/components/NSBoxDateRangeBase.module.css +73 -73
  145. package/src/components/NSBoxDateRangeBase.tsx +236 -236
  146. package/src/components/NSBoxDateTime.module.css +4 -4
  147. package/src/components/NSBoxDateTime.tsx +136 -136
  148. package/src/components/NSBoxDateTimeRange.tsx +66 -66
  149. package/src/components/NSBoxDouble.tsx +110 -110
  150. package/src/components/NSBoxDuration.module.css +4 -4
  151. package/src/components/NSBoxDuration.tsx +107 -107
  152. package/src/components/NSBoxDynamic.tsx +73 -73
  153. package/src/components/NSBoxDynamics.tsx +68 -68
  154. package/src/components/NSBoxEmail.tsx +117 -117
  155. package/src/components/NSBoxEntity.tsx +181 -181
  156. package/src/components/NSBoxEnum.tsx +113 -113
  157. package/src/components/NSBoxFile.module.css +10 -10
  158. package/src/components/NSBoxFile.tsx +106 -106
  159. package/src/components/NSBoxFilePath.tsx +106 -106
  160. package/src/components/NSBoxFont.tsx +107 -107
  161. package/src/components/NSBoxIPV4.tsx +107 -107
  162. package/src/components/NSBoxIPV4Range.tsx +107 -107
  163. package/src/components/NSBoxIPV6.tsx +104 -104
  164. package/src/components/NSBoxIPV6Range.tsx +107 -107
  165. package/src/components/NSBoxInteger.module.css +16 -16
  166. package/src/components/NSBoxInteger.tsx +126 -126
  167. package/src/components/NSBoxMoney.tsx +115 -115
  168. package/src/components/NSBoxOptions.module.css +53 -53
  169. package/src/components/NSBoxOptions.tsx +182 -182
  170. package/src/components/NSBoxPhone.module.css +35 -35
  171. package/src/components/NSBoxPhone.tsx +120 -120
  172. package/src/components/NSBoxRadio.module.css +33 -33
  173. package/src/components/NSBoxRadio.tsx +104 -104
  174. package/src/components/NSBoxSchemaBase.module.css +17 -17
  175. package/src/components/NSBoxSchemaBase.tsx +562 -562
  176. package/src/components/NSBoxSchemaVariable.module.css +16 -16
  177. package/src/components/NSBoxSchemaVariable.tsx +263 -263
  178. package/src/components/NSBoxSearch.tsx +112 -112
  179. package/src/components/NSBoxSensitive.tsx +133 -133
  180. package/src/components/NSBoxString.tsx +106 -106
  181. package/src/components/NSBoxTextArea.module.css +12 -12
  182. package/src/components/NSBoxTextArea.tsx +136 -136
  183. package/src/components/NSBoxTime.module.css +4 -4
  184. package/src/components/NSBoxTime.tsx +106 -106
  185. package/src/components/NSBoxTimeRange.tsx +220 -220
  186. package/src/components/NSBoxTimeZone.tsx +122 -122
  187. package/src/components/NSBoxURL.tsx +117 -117
  188. package/src/components/NSBoxVersion.tsx +107 -107
  189. package/src/components/NSButton.module.css +57 -57
  190. package/src/components/NSButton.tsx +74 -74
  191. package/src/components/NSButtonBlue.module.css +4 -4
  192. package/src/components/NSButtonBlue.tsx +29 -29
  193. package/src/components/NSButtonGreen.module.css +4 -4
  194. package/src/components/NSButtonGreen.tsx +29 -29
  195. package/src/components/NSButtonRed.module.css +4 -4
  196. package/src/components/NSButtonRed.tsx +29 -29
  197. package/src/components/NSCard.module.css +113 -113
  198. package/src/components/NSCard.tsx +67 -67
  199. package/src/components/NSCardScreenshot.module.css +41 -41
  200. package/src/components/NSCardScreenshot.tsx +31 -31
  201. package/src/components/NSChartBar.tsx +134 -134
  202. package/src/components/NSChartDoughnut.tsx +114 -114
  203. package/src/components/NSChartLine.tsx +110 -110
  204. package/src/components/NSChartPie.tsx +105 -105
  205. package/src/components/NSChartRange.tsx +14 -14
  206. package/src/components/NSColumn.module.css +16 -16
  207. package/src/components/NSColumn.tsx +24 -24
  208. package/src/components/NSCopy.tsx +95 -95
  209. package/src/components/NSCopyBox.module.css +39 -39
  210. package/src/components/NSCopyBox.tsx +53 -53
  211. package/src/components/NSDialog.module.css +105 -105
  212. package/src/components/NSDialog.tsx +72 -72
  213. package/src/components/NSDialogBox.tsx +38 -38
  214. package/src/components/NSDialogBoxDate.tsx +28 -28
  215. package/src/components/NSDialogBoxDateTime.tsx +28 -28
  216. package/src/components/NSDialogBoxPhone.tsx +28 -28
  217. package/src/components/NSDialogBoxString.tsx +28 -28
  218. package/src/components/NSDialogDelete.tsx +36 -36
  219. package/src/components/NSDialogInfo.tsx +49 -49
  220. package/src/components/NSDialogPageSelection.module.css +103 -103
  221. package/src/components/NSDialogPageSelection.tsx +233 -219
  222. package/src/components/NSDownTimer.module.css +55 -55
  223. package/src/components/NSDownTimer.tsx +91 -91
  224. package/src/components/NSDownload.module.css +46 -46
  225. package/src/components/NSDownload.tsx +69 -69
  226. package/src/components/NSElectronicCard.module.css +60 -60
  227. package/src/components/NSElectronicCard.tsx +46 -46
  228. package/src/components/NSEntityCardBackground.module.css +27 -27
  229. package/src/components/NSEntityCardBackground.tsx +36 -36
  230. package/src/components/NSFilterBox.module.css +27 -27
  231. package/src/components/NSFilterBox.tsx +477 -477
  232. package/src/components/NSFilterBoxItems.module.css +15 -15
  233. package/src/components/NSFilterBoxItems.tsx +52 -52
  234. package/src/components/NSFilterItem.module.css +24 -24
  235. package/src/components/NSFilterItem.tsx +27 -27
  236. package/src/components/NSFooter.module.css +140 -140
  237. package/src/components/NSFooter.tsx +321 -321
  238. package/src/components/NSGauge.module.css +67 -67
  239. package/src/components/NSGauge.tsx +52 -52
  240. package/src/components/NSGaugeDate.module.css +57 -57
  241. package/src/components/NSGaugeDate.tsx +125 -125
  242. package/src/components/NSGaugeNumber.module.css +66 -66
  243. package/src/components/NSGaugeNumber.tsx +93 -90
  244. package/src/components/NSHeader.module.css +316 -316
  245. package/src/components/NSHeader.tsx +337 -337
  246. package/src/components/NSHeaderScreenshot.module.css +35 -35
  247. package/src/components/NSHeaderScreenshot.tsx +39 -39
  248. package/src/components/NSID.tsx +188 -188
  249. package/src/components/NSInfo.tsx +50 -50
  250. package/src/components/NSLabel.module.css +25 -25
  251. package/src/components/NSLabel.tsx +47 -47
  252. package/src/components/NSLabelErrorNotifier.module.css +2 -2
  253. package/src/components/NSLabelErrorNotifier.tsx +35 -35
  254. package/src/components/NSLabelSensitive.module.css +9 -9
  255. package/src/components/NSLabelSensitive.tsx +101 -101
  256. package/src/components/NSLayout.module.css +22 -22
  257. package/src/components/NSLayout.tsx +143 -143
  258. package/src/components/NSLine.module.css +15 -15
  259. package/src/components/NSLine.tsx +13 -13
  260. package/src/components/NSLineText.module.css +38 -38
  261. package/src/components/NSLineText.tsx +17 -17
  262. package/src/components/NSLink.module.css +36 -36
  263. package/src/components/NSLink.tsx +26 -26
  264. package/src/components/NSLinkBlue.tsx +22 -22
  265. package/src/components/NSLinkGreen.tsx +13 -13
  266. package/src/components/NSLinkRed.tsx +13 -13
  267. package/src/components/NSListGrouped.module.css +69 -69
  268. package/src/components/NSListGrouped.tsx +106 -106
  269. package/src/components/NSListProduct.tsx +78 -78
  270. package/src/components/NSLoading.module.css +10 -10
  271. package/src/components/NSLoading.tsx +43 -43
  272. package/src/components/NSMegaMenu.module.css +133 -133
  273. package/src/components/NSMegaMenu.tsx +188 -188
  274. package/src/components/NSMenuAction.module.css +88 -88
  275. package/src/components/NSMenuAction.tsx +106 -106
  276. package/src/components/NSMenuButton.module.css +44 -44
  277. package/src/components/NSMenuButton.tsx +198 -198
  278. package/src/components/NSNoData.module.css +11 -11
  279. package/src/components/NSNoData.tsx +24 -24
  280. package/src/components/NSPagination.module.css +87 -87
  281. package/src/components/NSPagination.tsx +183 -183
  282. package/src/components/NSPanel.module.css +28 -28
  283. package/src/components/NSPanel.tsx +26 -26
  284. package/src/components/NSPanelAccordion.module.css +4 -4
  285. package/src/components/NSPanelAccordion.tsx +51 -51
  286. package/src/components/NSProductSearch.module.css +73 -73
  287. package/src/components/NSProductSearch.tsx +193 -193
  288. package/src/components/NSProgressBar.module.css +38 -38
  289. package/src/components/NSProgressBar.tsx +29 -29
  290. package/src/components/NSRange.module.css +66 -66
  291. package/src/components/NSRange.tsx +83 -83
  292. package/src/components/NSReorderDialog.module.css +49 -49
  293. package/src/components/NSReorderDialog.tsx +184 -154
  294. package/src/components/NSRepeater.tsx +328 -328
  295. package/src/components/NSRepeaterNSBoxSchemaVariable.tsx +94 -94
  296. package/src/components/NSRepeaterNSTag.tsx +86 -86
  297. package/src/components/NSRow.module.css +17 -17
  298. package/src/components/NSRow.tsx +24 -24
  299. package/src/components/NSSection.module.css +4 -4
  300. package/src/components/NSSection.tsx +26 -26
  301. package/src/components/NSSectionCards.module.css +38 -38
  302. package/src/components/NSSectionCards.tsx +51 -51
  303. package/src/components/NSSectionTiles.module.css +10 -10
  304. package/src/components/NSSectionTiles.tsx +25 -25
  305. package/src/components/NSSectionTitle.tsx +19 -19
  306. package/src/components/NSSortDialog.tsx +124 -124
  307. package/src/components/NSSpace.tsx +28 -28
  308. package/src/components/NSSplitter.module.css +59 -59
  309. package/src/components/NSSplitter.tsx +211 -211
  310. package/src/components/NSTabPage.module.css +59 -59
  311. package/src/components/NSTabPage.tsx +122 -122
  312. package/src/components/NSTable.module.css +372 -372
  313. package/src/components/NSTable.tsx +1443 -1248
  314. package/src/components/NSTableChart.module.css +119 -119
  315. package/src/components/NSTableChart.tsx +732 -732
  316. package/src/components/NSTag.tsx +74 -74
  317. package/src/components/NSTile.module.css +76 -76
  318. package/src/components/NSTile.tsx +27 -27
  319. package/src/components/NSTimelineMonthly.module.css +71 -71
  320. package/src/components/NSTimelineMonthly.tsx +44 -44
  321. package/src/components/NSTitle.module.css +15 -15
  322. package/src/components/NSTitle.tsx +19 -19
  323. package/src/css.d.ts +13 -13
  324. package/src/formatter/BackColorFormatter.tsx +23 -23
  325. package/src/formatter/BaseColumnFormatter.ts +86 -86
  326. package/src/formatter/BaseURLImageFormatter.tsx +37 -37
  327. package/src/formatter/BooleanFormatter.ts +26 -26
  328. package/src/formatter/BytesFormatter.tsx +19 -19
  329. package/src/formatter/DateFormatter.ts +26 -26
  330. package/src/formatter/DateTimeFormatter.ts +26 -26
  331. package/src/formatter/DurationFormatter.ts +17 -17
  332. package/src/formatter/EmailFormatter.tsx +25 -25
  333. package/src/formatter/EnumFormatter.ts +17 -17
  334. package/src/formatter/FloatFormatter.ts +27 -27
  335. package/src/formatter/ForeColorFormatter.tsx +24 -24
  336. package/src/formatter/IDFormatter.tsx +57 -57
  337. package/src/formatter/IPFormatter.ts +39 -39
  338. package/src/formatter/IntegerFormatter.ts +27 -27
  339. package/src/formatter/JsonFormatter.tsx +77 -77
  340. package/src/formatter/MoneyFormatter.ts +39 -39
  341. package/src/formatter/PercentFormatter.tsx +43 -43
  342. package/src/formatter/PhoneFormatter.tsx +25 -25
  343. package/src/formatter/SensitiveFormatter.tsx +40 -40
  344. package/src/formatter/StringFormatter.tsx +47 -47
  345. package/src/formatter/TimeFormatter.ts +25 -25
  346. package/src/formatter/URLFormatter.tsx +28 -28
  347. package/src/formatter/UnknowFormatter.ts +22 -22
  348. package/src/index.css +5 -5
  349. package/src/index.tsx +7 -7
  350. package/src/main.ts +263 -264
  351. package/src/pages/NSImplementing.module.css +35 -35
  352. package/src/pages/NSImplementing.tsx +32 -32
  353. package/src/pages/NSNotFoundPage.module.css +18 -18
  354. package/src/pages/NSNotFoundPage.tsx +14 -14
  355. package/src/pages/NSUpdating.module.css +35 -35
  356. package/src/pages/NSUpdating.tsx +32 -32
  357. package/src/props/IBackgroundProps.ts +5 -5
  358. package/src/props/IBaseComponentProps.ts +8 -8
  359. package/src/props/IHeaderIconProps.ts +10 -10
  360. package/src/props/IHeaderLeftProps.ts +6 -6
  361. package/src/props/IHeaderRightProps.ts +8 -8
  362. package/src/props/IImageProps.ts +4 -4
  363. package/src/props/ILinkProps.ts +4 -4
  364. package/src/props/IValidationNumberProps.ts +4 -4
  365. package/src/props/IValidationPrecisionProps.ts +3 -3
  366. package/src/props/IValidationProps.ts +9 -9
  367. package/src/props/IValidationRegexProps.ts +4 -4
  368. package/src/props/IValidationStringProps.ts +4 -4
  369. package/src/routing/NSNotifier.ts +114 -114
  370. package/src/routing/NSRouterMaker.tsx +28 -28
  371. package/tsconfig.json +43 -43
  372. package/src/components/NSListMenu.tsx +0 -185
@@ -1,184 +1,184 @@
1
- import { Component } from 'react';
2
- import { IBaseComponentProps } from '../props/IBaseComponentProps';
3
- import Styles from './NSPagination.module.css';
4
- import React from "react";
5
- import { NSBoxCombo } from './NSBoxCombo';
6
- import { NSRow } from './NSRow';
7
-
8
- export interface NSPaginationProps extends IBaseComponentProps
9
- {
10
- totalItems: number;
11
- onPageChange: (page: number, size: number) => void;
12
- }
13
-
14
- interface NSPaginationState
15
- {
16
- currentPage: number;
17
- }
18
-
19
- let pageSizes = [25, 50, 100, 200, 500];
20
-
21
- export class NSPagination extends Component<NSPaginationProps, NSPaginationState>
22
- {
23
- PageSize = React.createRef<NSBoxCombo>();
24
- constructor(props: NSPaginationProps)
25
- {
26
- super(props);
27
- this.state = { currentPage: 1 };
28
- }
29
- getCurrentPage(): number
30
- {
31
- return this.state.currentPage;
32
- }
33
- getPageSize(): number
34
- {
35
- let ans = this.PageSize.current?.getValue(false);
36
- if (!ans)
37
- ans = pageSizes[0].toString();
38
- return parseInt(ans as string);
39
- }
40
- override render()
41
- {
42
- let pageSize = this.getPageSize();
43
- const { totalItems, onPageChange } = this.props;
44
- const totalPages = Math.ceil(totalItems / pageSize);
45
- const windowSize = 2;
46
- const minPage = Math.max(2, this.state.currentPage - windowSize);
47
- const maxPage = Math.min(this.state.currentPage + windowSize, totalPages - 1);
48
- const current_min = Math.min(totalItems, (this.state.currentPage - 1) * pageSize + 1);
49
- const current_max = Math.min(totalItems, this.state.currentPage * pageSize);
50
- const pages: JSX.Element[] = [];
51
-
52
- const pushButton = (name: string, selected: boolean, onClick: () => void) =>
53
- {
54
- pages.push(
55
- <div key={name} className={`${Styles.ns_pagination_button_parent}`}>
56
- <button
57
- className={`${Styles.ns_pagination_button} ${selected ? Styles.ns_pagination_button_selected : ''}`}
58
- onClick={(e) =>
59
- {
60
- e.preventDefault();
61
- onClick();
62
- }}
63
- >
64
- {name}
65
- </button>
66
- </div>
67
- );
68
- };
69
- const pushPage = (page: number) =>
70
- {
71
- pushButton(page.toLocaleString(), page === this.state.currentPage, () =>
72
- {
73
- let currentPage = page;
74
- this.setState({ currentPage }, () =>
75
- {
76
- let pageSize = this.getPageSize();
77
- onPageChange(currentPage, pageSize);
78
- });
79
- });
80
- };
81
- const pushArrow = (key: string, logo: string, onClick: () => void) =>
82
- {
83
- pages.push(
84
- <div key={key} className={`${Styles.ns_pagination_button_parent}`}>
85
- <button
86
- className={Styles.ns_pagination_button}
87
- onClick={e =>
88
- {
89
- e.preventDefault();
90
- onClick();
91
- }}
92
- >
93
- <img
94
- src={logo}
95
- alt={key}
96
- width={32}
97
- height={32}
98
- />
99
- </button>
100
- </div >
101
- );
102
- };
103
- // Previous
104
- pushArrow("previous", "https://static.namirasoft.com/image/concept/arrow/left/white-blue.svg", () =>
105
- {
106
- if (this.state.currentPage > 1)
107
- {
108
- let currentPage = this.state.currentPage - 1;
109
- this.setState({ currentPage }, () =>
110
- {
111
- let pageSize = this.getPageSize();
112
- onPageChange(currentPage, pageSize);
113
- });
114
- }
115
- });
116
- //FirstPage
117
- pushPage(1);
118
- if (this.state.currentPage > windowSize + 2)
119
- {
120
- pushButton("...", false, () => { });
121
- }
122
- for (let i = minPage; i <= maxPage; i++)
123
- pushPage(i);
124
- if (this.state.currentPage < totalPages - windowSize - 1)
125
- {
126
- pushButton("...", false, () => { });
127
- }
128
- //LastPage
129
- if (totalPages > 1)
130
- {
131
- pushPage(totalPages);
132
- }
133
- // Next
134
- pushArrow("next", "https://static.namirasoft.com/image/concept/arrow/right/white-blue.svg", () =>
135
- {
136
- if (this.state.currentPage < totalPages)
137
- {
138
- let currentPage = this.state.currentPage + 1;
139
- this.setState({ currentPage }, () =>
140
- {
141
- let pageSize = this.getPageSize();
142
- onPageChange(currentPage, pageSize);
143
- });
144
- }
145
- });
146
- return (
147
- <div
148
- id={this.props.id}
149
- className={`${Styles.ns_pagination_container} ${this.props.classList?.join(' ')}`}
150
- style={this.props.style}
151
- >
152
- <div className={Styles.ns_pagination_buttons_container}>
153
- {pages}
154
- </div>
155
-
156
- <NSRow classList={["flex-nowrap w-auto"]}>
157
- <NSBoxCombo
158
- ref={this.PageSize}
159
- title=''
160
- required={false}
161
- searchable={false}
162
- multiple={false}
163
- defaultValue="25"
164
- hideHeader
165
- getOptions={() => pageSizes.map(pagesize => ({ value: pagesize.toString(), title: pagesize.toString() }))}
166
- onChanged={() =>
167
- {
168
- let currentPage = this.state.currentPage;
169
- this.setState({ currentPage }, () =>
170
- {
171
- let pageSize = this.getPageSize();
172
- onPageChange(currentPage, pageSize);
173
- });
174
- }}
175
- style={{ width: "72px" }}
176
- />
177
- <p className={Styles.ns_pagination_info}>
178
- {`(${current_min.toLocaleString()} - ${current_max.toLocaleString()}) of ${totalItems.toLocaleString()}`}
179
- </p>
180
- </NSRow>
181
- </div>
182
- );
183
- }
1
+ import { Component } from 'react';
2
+ import { IBaseComponentProps } from '../props/IBaseComponentProps';
3
+ import Styles from './NSPagination.module.css';
4
+ import React from "react";
5
+ import { NSBoxCombo } from './NSBoxCombo';
6
+ import { NSRow } from './NSRow';
7
+
8
+ export interface NSPaginationProps extends IBaseComponentProps
9
+ {
10
+ totalItems: number;
11
+ onPageChange: (page: number, size: number) => void;
12
+ }
13
+
14
+ interface NSPaginationState
15
+ {
16
+ currentPage: number;
17
+ }
18
+
19
+ let pageSizes = [25, 50, 100, 200, 500];
20
+
21
+ export class NSPagination extends Component<NSPaginationProps, NSPaginationState>
22
+ {
23
+ PageSize = React.createRef<NSBoxCombo>();
24
+ constructor(props: NSPaginationProps)
25
+ {
26
+ super(props);
27
+ this.state = { currentPage: 1 };
28
+ }
29
+ getCurrentPage(): number
30
+ {
31
+ return this.state.currentPage;
32
+ }
33
+ getPageSize(): number
34
+ {
35
+ let ans = this.PageSize.current?.getValue(false);
36
+ if (!ans)
37
+ ans = pageSizes[0].toString();
38
+ return parseInt(ans as string);
39
+ }
40
+ override render()
41
+ {
42
+ let pageSize = this.getPageSize();
43
+ const { totalItems, onPageChange } = this.props;
44
+ const totalPages = Math.ceil(totalItems / pageSize);
45
+ const windowSize = 2;
46
+ const minPage = Math.max(2, this.state.currentPage - windowSize);
47
+ const maxPage = Math.min(this.state.currentPage + windowSize, totalPages - 1);
48
+ const current_min = Math.min(totalItems, (this.state.currentPage - 1) * pageSize + 1);
49
+ const current_max = Math.min(totalItems, this.state.currentPage * pageSize);
50
+ const pages: JSX.Element[] = [];
51
+
52
+ const pushButton = (name: string, selected: boolean, onClick: () => void) =>
53
+ {
54
+ pages.push(
55
+ <div key={name} className={`${Styles.ns_pagination_button_parent}`}>
56
+ <button
57
+ className={`${Styles.ns_pagination_button} ${selected ? Styles.ns_pagination_button_selected : ''}`}
58
+ onClick={(e) =>
59
+ {
60
+ e.preventDefault();
61
+ onClick();
62
+ }}
63
+ >
64
+ {name}
65
+ </button>
66
+ </div>
67
+ );
68
+ };
69
+ const pushPage = (page: number) =>
70
+ {
71
+ pushButton(page.toLocaleString(), page === this.state.currentPage, () =>
72
+ {
73
+ let currentPage = page;
74
+ this.setState({ currentPage }, () =>
75
+ {
76
+ let pageSize = this.getPageSize();
77
+ onPageChange(currentPage, pageSize);
78
+ });
79
+ });
80
+ };
81
+ const pushArrow = (key: string, logo: string, onClick: () => void) =>
82
+ {
83
+ pages.push(
84
+ <div key={key} className={`${Styles.ns_pagination_button_parent}`}>
85
+ <button
86
+ className={Styles.ns_pagination_button}
87
+ onClick={e =>
88
+ {
89
+ e.preventDefault();
90
+ onClick();
91
+ }}
92
+ >
93
+ <img
94
+ src={logo}
95
+ alt={key}
96
+ width={32}
97
+ height={32}
98
+ />
99
+ </button>
100
+ </div >
101
+ );
102
+ };
103
+ // Previous
104
+ pushArrow("previous", "https://static.namirasoft.com/image/concept/arrow/left/white-blue.svg", () =>
105
+ {
106
+ if (this.state.currentPage > 1)
107
+ {
108
+ let currentPage = this.state.currentPage - 1;
109
+ this.setState({ currentPage }, () =>
110
+ {
111
+ let pageSize = this.getPageSize();
112
+ onPageChange(currentPage, pageSize);
113
+ });
114
+ }
115
+ });
116
+ //FirstPage
117
+ pushPage(1);
118
+ if (this.state.currentPage > windowSize + 2)
119
+ {
120
+ pushButton("...", false, () => { });
121
+ }
122
+ for (let i = minPage; i <= maxPage; i++)
123
+ pushPage(i);
124
+ if (this.state.currentPage < totalPages - windowSize - 1)
125
+ {
126
+ pushButton("...", false, () => { });
127
+ }
128
+ //LastPage
129
+ if (totalPages > 1)
130
+ {
131
+ pushPage(totalPages);
132
+ }
133
+ // Next
134
+ pushArrow("next", "https://static.namirasoft.com/image/concept/arrow/right/white-blue.svg", () =>
135
+ {
136
+ if (this.state.currentPage < totalPages)
137
+ {
138
+ let currentPage = this.state.currentPage + 1;
139
+ this.setState({ currentPage }, () =>
140
+ {
141
+ let pageSize = this.getPageSize();
142
+ onPageChange(currentPage, pageSize);
143
+ });
144
+ }
145
+ });
146
+ return (
147
+ <div
148
+ id={this.props.id}
149
+ className={`${Styles.ns_pagination_container} ${this.props.classList?.join(' ')}`}
150
+ style={this.props.style}
151
+ >
152
+ <div className={Styles.ns_pagination_buttons_container}>
153
+ {pages}
154
+ </div>
155
+
156
+ <NSRow classList={["flex-nowrap w-auto"]}>
157
+ <NSBoxCombo
158
+ ref={this.PageSize}
159
+ title=''
160
+ required={false}
161
+ searchable={false}
162
+ multiple={false}
163
+ defaultValue="25"
164
+ hideHeader
165
+ getOptions={() => pageSizes.map(pagesize => ({ value: pagesize.toString(), title: pagesize.toString() }))}
166
+ onChanged={() =>
167
+ {
168
+ let currentPage = this.state.currentPage;
169
+ this.setState({ currentPage }, () =>
170
+ {
171
+ let pageSize = this.getPageSize();
172
+ onPageChange(currentPage, pageSize);
173
+ });
174
+ }}
175
+ style={{ width: "72px" }}
176
+ />
177
+ <p className={Styles.ns_pagination_info}>
178
+ {`(${current_min.toLocaleString()} - ${current_max.toLocaleString()}) of ${totalItems.toLocaleString()}`}
179
+ </p>
180
+ </NSRow>
181
+ </div>
182
+ );
183
+ }
184
184
  }
@@ -1,29 +1,29 @@
1
- .ns_panel {
2
- background-color: #fff;
3
- padding: 16px;
4
- display: flex;
5
- flex-direction: column;
6
- align-items: center;
7
- border-radius: 8px;
8
- gap: 16px;
9
- margin: 0;
10
- width: 100%;
11
- max-width: 100%;
12
- border: 1px solid rgba(161, 164, 176, 1);
13
- box-shadow: 0px 0px 2px 0px rgba(161, 164, 176, 1);
14
- }
15
-
16
- .ns_panel_title {
17
- font-size: 11px;
18
- color: #666;
19
- font-weight: 600;
20
- text-transform: uppercase;
21
- letter-spacing: 0.5px;
22
- align-self: flex-start;
23
- }
24
-
25
- @media only screen and (min-width: 480px) {
26
- .ns_panel {
27
- width: max-content;
28
- }
1
+ .ns_panel {
2
+ background-color: #fff;
3
+ padding: 16px;
4
+ display: flex;
5
+ flex-direction: column;
6
+ align-items: center;
7
+ border-radius: 8px;
8
+ gap: 16px;
9
+ margin: 0;
10
+ width: 100%;
11
+ max-width: 100%;
12
+ border: 1px solid rgba(161, 164, 176, 1);
13
+ box-shadow: 0px 0px 2px 0px rgba(161, 164, 176, 1);
14
+ }
15
+
16
+ .ns_panel_title {
17
+ font-size: 11px;
18
+ color: #666;
19
+ font-weight: 600;
20
+ text-transform: uppercase;
21
+ letter-spacing: 0.5px;
22
+ align-self: flex-start;
23
+ }
24
+
25
+ @media only screen and (min-width: 480px) {
26
+ .ns_panel {
27
+ width: max-content;
28
+ }
29
29
  }
@@ -1,27 +1,27 @@
1
- import { ReactNode } from "react";
2
- import Styles from './NSPanel.module.css';
3
- import { IBaseComponentProps } from "../props/IBaseComponentProps";
4
-
5
- export interface NSPanelProps extends IBaseComponentProps
6
- {
7
- title?: string;
8
- children: ReactNode;
9
- onEnterPressed?: () => void;
10
- }
11
- export function NSPanel(props: NSPanelProps)
12
- {
13
- return (
14
- <div id={props.id}
15
- className={`${Styles.ns_panel} ${props.classList?.join(" ") ?? ""}`}
16
- style={props.style}
17
- onKeyUp={e =>
18
- {
19
- if (e.key === "Enter")
20
- props.onEnterPressed?.();
21
- }}
22
- >
23
- {props.title && <div className={Styles.ns_panel_title}>{props.title}</div>}
24
- {props.children}
25
- </div>
26
- );
1
+ import { ReactNode } from "react";
2
+ import Styles from './NSPanel.module.css';
3
+ import { IBaseComponentProps } from "../props/IBaseComponentProps";
4
+
5
+ export interface NSPanelProps extends IBaseComponentProps
6
+ {
7
+ title?: string;
8
+ children: ReactNode;
9
+ onEnterPressed?: () => void;
10
+ }
11
+ export function NSPanel(props: NSPanelProps)
12
+ {
13
+ return (
14
+ <div id={props.id}
15
+ className={`${Styles.ns_panel} ${props.classList?.join(" ") ?? ""}`}
16
+ style={props.style}
17
+ onKeyUp={e =>
18
+ {
19
+ if (e.key === "Enter")
20
+ props.onEnterPressed?.();
21
+ }}
22
+ >
23
+ {props.title && <div className={Styles.ns_panel_title}>{props.title}</div>}
24
+ {props.children}
25
+ </div>
26
+ );
27
27
  }
@@ -1,5 +1,5 @@
1
- .NSPanelAccordion_parent {
2
- border-radius: 8px;
3
- width: 100%;
4
- max-width: 1150px;
1
+ .NSPanelAccordion_parent {
2
+ border-radius: 8px;
3
+ width: 100%;
4
+ max-width: 1150px;
5
5
  }
@@ -1,52 +1,52 @@
1
- import React, { useState, useRef, useEffect } from 'react';
2
- import { IBaseComponentProps } from '../props/IBaseComponentProps';
3
- import Styles from "./NSPanelAccordion.module.css"
4
-
5
- interface NSPanelAccordionProps extends IBaseComponentProps
6
- {
7
- getHeader: () => React.ReactNode;
8
- children: React.ReactNode;
9
- }
10
-
11
- export function NSPanelAccordion(props: NSPanelAccordionProps)
12
- {
13
- const [isOpen, setIsOpen] = useState(true);
14
- const [height, setHeight] = useState<number | 'auto'>(0);
15
- const contentRef = useRef<HTMLDivElement>(null);
16
-
17
- const toggleAccordion = () =>
18
- {
19
- setIsOpen(!isOpen);
20
- };
21
-
22
- useEffect(() =>
23
- {
24
- if (isOpen)
25
- {
26
- setHeight(contentRef.current?.scrollHeight || 'auto');
27
- } else
28
- {
29
- setHeight(0);
30
- }
31
- }, [isOpen]);
32
-
33
- return (
34
- <div className={`${Styles.NSPanelAccordion_parent} ${props.classList?.join(" ") ?? ""}`} style={props.style}>
35
- <div
36
- onClick={toggleAccordion}
37
- >
38
- {props.getHeader()}
39
- </div>
40
- <div
41
- ref={contentRef}
42
- style={{
43
- height: height,
44
- overflow: 'hidden',
45
- transition: 'height 0.3s ease',
46
- }}
47
- >
48
- {props.children}
49
- </div>
50
- </div>
51
- );
1
+ import React, { useState, useRef, useEffect } from 'react';
2
+ import { IBaseComponentProps } from '../props/IBaseComponentProps';
3
+ import Styles from "./NSPanelAccordion.module.css"
4
+
5
+ interface NSPanelAccordionProps extends IBaseComponentProps
6
+ {
7
+ getHeader: () => React.ReactNode;
8
+ children: React.ReactNode;
9
+ }
10
+
11
+ export function NSPanelAccordion(props: NSPanelAccordionProps)
12
+ {
13
+ const [isOpen, setIsOpen] = useState(true);
14
+ const [height, setHeight] = useState<number | 'auto'>(0);
15
+ const contentRef = useRef<HTMLDivElement>(null);
16
+
17
+ const toggleAccordion = () =>
18
+ {
19
+ setIsOpen(!isOpen);
20
+ };
21
+
22
+ useEffect(() =>
23
+ {
24
+ if (isOpen)
25
+ {
26
+ setHeight(contentRef.current?.scrollHeight || 'auto');
27
+ } else
28
+ {
29
+ setHeight(0);
30
+ }
31
+ }, [isOpen]);
32
+
33
+ return (
34
+ <div className={`${Styles.NSPanelAccordion_parent} ${props.classList?.join(" ") ?? ""}`} style={props.style}>
35
+ <div
36
+ onClick={toggleAccordion}
37
+ >
38
+ {props.getHeader()}
39
+ </div>
40
+ <div
41
+ ref={contentRef}
42
+ style={{
43
+ height: height,
44
+ overflow: 'hidden',
45
+ transition: 'height 0.3s ease',
46
+ }}
47
+ >
48
+ {props.children}
49
+ </div>
50
+ </div>
51
+ );
52
52
  };