namirasoft-account-react 1.5.20 → 1.5.21

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 (139) hide show
  1. package/.env.template +15 -15
  2. package/SKILL.md +514 -514
  3. package/config-overrides.js +72 -72
  4. package/dist/App.d.ts +1 -1
  5. package/dist/Router.d.ts +1 -1
  6. package/dist/UseParams.d.ts +1 -1
  7. package/dist/components/NSAAccessListDialog.d.ts +2 -2
  8. package/dist/components/NSAAccessListDialog.module.css +71 -71
  9. package/dist/components/NSABoxSecret.d.ts +1 -1
  10. package/dist/components/NSABoxSecret.module.css +23 -23
  11. package/dist/components/NSAMasterMenu.d.ts +1 -1
  12. package/dist/components/NSAMasterMenu.module.css +250 -250
  13. package/dist/components/NSAMasterMenuItem.d.ts +1 -1
  14. package/dist/components/NSAMessageListDialog.d.ts +1 -1
  15. package/dist/components/NSAMessageListDialog.module.css +99 -99
  16. package/dist/components/NSANavigationGuard.d.ts +1 -1
  17. package/dist/components/NSAProductListDialog.d.ts +1 -1
  18. package/dist/components/NSAProductListDialog.module.css +44 -44
  19. package/dist/components/NSATaskBar.d.ts +1 -1
  20. package/dist/components/NSATaskBar.module.css +57 -57
  21. package/dist/components/NSAUserDialog.d.ts +1 -1
  22. package/dist/components/NSAUserDialog.module.css +67 -67
  23. package/dist/components/NSAWorkspaceListDialog.d.ts +1 -1
  24. package/dist/components/NSAWorkspaceListDialog.module.css +41 -41
  25. package/dist/components/NSFBoxCategoryScope.d.ts +1 -1
  26. package/dist/components/NSFBoxField.d.ts +1 -1
  27. package/dist/components/NSFBoxSlot.d.ts +1 -1
  28. package/dist/components/NSFBoxWrapper.d.ts +1 -1
  29. package/dist/components/NSLabelSecret.d.ts +1 -1
  30. package/dist/components/quickfilter/NSAFilterBoxEnum.module.css +44 -44
  31. package/dist/components/quickfilter/NSAQuickFilterBar.d.ts +1 -1
  32. package/dist/components/quickfilter/NSAQuickFilterBar.module.css +19 -19
  33. package/dist/components/quickfilter/NSAQuickFilterDialog.d.ts +1 -1
  34. package/dist/components/quickfilter/NSAQuickFilterDialog.module.css +74 -74
  35. package/dist/layouts/NSALayout.d.ts +1 -1
  36. package/dist/layouts/NSASectionEdit.d.ts +1 -1
  37. package/dist/layouts/NSASectionEditTabPage.d.ts +1 -1
  38. package/dist/layouts/NSASectionEditTabPage.module.css +4 -4
  39. package/dist/layouts/NSASectionList.d.ts +1 -1
  40. package/dist/layouts/NSASectionList.module.css +31 -31
  41. package/dist/layouts/NSASectionView.d.ts +1 -1
  42. package/dist/layouts/NSASectionViewTabMore.d.ts +1 -1
  43. package/dist/layouts/NSASectionViewTabPage.d.ts +1 -1
  44. package/dist/layouts/NSASectionViewTabPage.module.css +47 -47
  45. package/dist/pages/NSAConsentPage.module.css +26 -26
  46. package/dist/pages/NSAEmailVerificationPage.d.ts +1 -1
  47. package/dist/pages/NSAHomePage.d.ts +1 -1
  48. package/dist/pages/NSAHomePage.module.css +41 -41
  49. package/dist/pages/NSALoginPage.d.ts +1 -1
  50. package/dist/pages/NSALoginPage.module.css +26 -26
  51. package/dist/pages/NSAPhoneVerificationPage.d.ts +1 -1
  52. package/dist/pages/NSAVerificationPage.d.ts +1 -1
  53. package/dist/pages/NSAVerificationPage.module.css +31 -31
  54. package/package.json +95 -95
  55. package/public/index.html +21 -21
  56. package/src/App.tsx +19 -19
  57. package/src/CTFRow.ts +7 -7
  58. package/src/FieldCacheService.tsx +84 -84
  59. package/src/IEntityInfo.ts +33 -33
  60. package/src/NSACacheService.ts +120 -120
  61. package/src/NSAFilterOperators.ts +92 -92
  62. package/src/NSARouterMaker.tsx +140 -140
  63. package/src/NSARouterMakerProps.ts +23 -23
  64. package/src/NSARouterMakerResult.ts +24 -24
  65. package/src/NSFRouterMaker.tsx +35 -35
  66. package/src/NSFRouterProps.ts +7 -7
  67. package/src/NSFRoutes.ts +30 -30
  68. package/src/Router.tsx +48 -48
  69. package/src/UseParams.tsx +17 -17
  70. package/src/components/NSAAccessListDialog.module.css +71 -71
  71. package/src/components/NSAAccessListDialog.tsx +178 -178
  72. package/src/components/NSABoxSecret.module.css +23 -23
  73. package/src/components/NSABoxSecret.tsx +264 -264
  74. package/src/components/NSAMasterMenu.module.css +250 -250
  75. package/src/components/NSAMasterMenu.tsx +169 -169
  76. package/src/components/NSAMasterMenuItem.tsx +250 -250
  77. package/src/components/NSAMessageListDialog.module.css +99 -99
  78. package/src/components/NSAMessageListDialog.tsx +142 -142
  79. package/src/components/NSANavigationGuard.tsx +79 -79
  80. package/src/components/NSAProductListDialog.module.css +44 -44
  81. package/src/components/NSAProductListDialog.tsx +88 -88
  82. package/src/components/NSATable.tsx +494 -494
  83. package/src/components/NSATaskBar.module.css +57 -57
  84. package/src/components/NSATaskBar.tsx +193 -193
  85. package/src/components/NSAUserDialog.module.css +67 -67
  86. package/src/components/NSAUserDialog.tsx +122 -122
  87. package/src/components/NSAWorkspaceListDialog.module.css +41 -41
  88. package/src/components/NSAWorkspaceListDialog.tsx +147 -147
  89. package/src/components/NSFBoxCategoryScope.tsx +52 -52
  90. package/src/components/NSFBoxField.tsx +37 -37
  91. package/src/components/NSFBoxSlot.tsx +71 -71
  92. package/src/components/NSFBoxWrapper.tsx +69 -69
  93. package/src/components/NSLabelSecret.tsx +37 -37
  94. package/src/components/quickfilter/NSAFilterBoxBase.tsx +89 -89
  95. package/src/components/quickfilter/NSAFilterBoxBoolean.tsx +66 -66
  96. package/src/components/quickfilter/NSAFilterBoxDate.tsx +110 -110
  97. package/src/components/quickfilter/NSAFilterBoxDateTime.tsx +110 -110
  98. package/src/components/quickfilter/NSAFilterBoxEnum.module.css +44 -44
  99. package/src/components/quickfilter/NSAFilterBoxEnum.tsx +79 -79
  100. package/src/components/quickfilter/NSAFilterBoxNumber.tsx +145 -145
  101. package/src/components/quickfilter/NSAFilterBoxString.tsx +83 -83
  102. package/src/components/quickfilter/NSAFilterBoxTime.tsx +106 -106
  103. package/src/components/quickfilter/NSAQuickFilterBar.module.css +19 -19
  104. package/src/components/quickfilter/NSAQuickFilterBar.tsx +142 -142
  105. package/src/components/quickfilter/NSAQuickFilterDialog.module.css +74 -74
  106. package/src/components/quickfilter/NSAQuickFilterDialog.tsx +260 -260
  107. package/src/css.d.ts +13 -13
  108. package/src/formatters/SecretFormatter.tsx +24 -24
  109. package/src/index.tsx +26 -26
  110. package/src/layouts/Actions.ts +146 -146
  111. package/src/layouts/CFTUtil.ts +18 -18
  112. package/src/layouts/NSALayout.tsx +744 -744
  113. package/src/layouts/NSALayout_Field.ts +125 -125
  114. package/src/layouts/NSASectionEdit.tsx +281 -281
  115. package/src/layouts/NSASectionEditTabPage.module.css +4 -4
  116. package/src/layouts/NSASectionEditTabPage.tsx +256 -256
  117. package/src/layouts/NSASectionList.module.css +31 -31
  118. package/src/layouts/NSASectionList.tsx +147 -147
  119. package/src/layouts/NSASectionView.tsx +98 -98
  120. package/src/layouts/NSASectionViewTabMore.tsx +78 -78
  121. package/src/layouts/NSASectionViewTabPage.module.css +47 -47
  122. package/src/layouts/NSASectionViewTabPage.tsx +399 -399
  123. package/src/main.ts +52 -52
  124. package/src/pages/NSAConsentPage.module.css +26 -26
  125. package/src/pages/NSAConsentPage.tsx +120 -120
  126. package/src/pages/NSAEmailVerificationPage.tsx +30 -30
  127. package/src/pages/NSAHomePage.module.css +41 -41
  128. package/src/pages/NSAHomePage.tsx +124 -124
  129. package/src/pages/NSALoginPage.module.css +26 -26
  130. package/src/pages/NSALoginPage.tsx +87 -87
  131. package/src/pages/NSAPhoneVerificationPage.tsx +94 -94
  132. package/src/pages/NSAVerificationPage.module.css +31 -31
  133. package/src/pages/NSAVerificationPage.tsx +185 -185
  134. package/src/pages/NSFCategoryEditPage.tsx +87 -87
  135. package/src/pages/NSFCategoryListPage.tsx +23 -23
  136. package/src/pages/NSFCategoryViewPage.tsx +23 -23
  137. package/src/pages/NSFEntities.ts +58 -58
  138. package/src/pages/PaymentRequired.tsx +80 -80
  139. package/tsconfig.json +43 -43
@@ -1,32 +1,32 @@
1
- .nsa_verification_container {
2
- background-color: #FFF;
3
- border: 1px solid #A1A4B0;
4
- backdrop-filter: blur(5px);
5
- border-radius: 8px;
6
- width: 100%;
7
- max-width: 594px;
8
- padding: 16px;
9
- color: #141B5C !important;
10
- display: flex;
11
- flex-direction: column;
12
- gap: 16px;
13
- align-items: center;
14
- }
15
-
16
- .nsa_verification_container p {
17
- text-align: center;
18
- }
19
-
20
- .nsa_verification_vector {
21
- width: 224px;
22
- height: 224px;
23
- }
24
-
25
- .nsa_resend_button {
26
- border: 0;
27
- outline: 0;
28
- background: none;
29
- color: #141B5C;
30
- font-size: 16px;
31
- font-weight: 500;
1
+ .nsa_verification_container {
2
+ background-color: #FFF;
3
+ border: 1px solid #A1A4B0;
4
+ backdrop-filter: blur(5px);
5
+ border-radius: 8px;
6
+ width: 100%;
7
+ max-width: 594px;
8
+ padding: 16px;
9
+ color: #141B5C !important;
10
+ display: flex;
11
+ flex-direction: column;
12
+ gap: 16px;
13
+ align-items: center;
14
+ }
15
+
16
+ .nsa_verification_container p {
17
+ text-align: center;
18
+ }
19
+
20
+ .nsa_verification_vector {
21
+ width: 224px;
22
+ height: 224px;
23
+ }
24
+
25
+ .nsa_resend_button {
26
+ border: 0;
27
+ outline: 0;
28
+ background: none;
29
+ color: #141B5C;
30
+ font-size: 16px;
31
+ font-weight: 500;
32
32
  }
@@ -1,186 +1,186 @@
1
- import { BaseServer } from "namirasoft-core";
2
- import { IBaseComponentProps, NSBoxString, NSButtonBlue, NSRouterMakerResult, NSSection, NSSpace, NSSpaceSizeType } from 'namirasoft-site-react';
3
- import React, { createRef, ReactNode } from "react";
4
- import { NSARouterMakerResult } from '../NSARouterMakerResult';
5
- import Styles from './NSAVerificationPage.module.css';
6
-
7
- export interface NSAVerificationPageProps extends IBaseComponentProps, NSRouterMakerResult, NSARouterMakerResult
8
- {
9
- contact_type: string;
10
- contact_value_name: string;
11
- getContactValue: (checkErrors: boolean) => string;
12
- onRequest: (address: string) => Promise<void>;
13
- onVerify: (code: string) => Promise<void>;
14
- onFinished: () => void;
15
- onChange?: () => void;
16
- children?: ReactNode;
17
- }
18
-
19
- export interface NSAVerificationPageState
20
- {
21
- isSendCode: boolean;
22
- }
23
-
24
- export class NSAVerificationPage extends React.Component<NSAVerificationPageProps, NSAVerificationPageState>
25
- {
26
- private NSButtonBlue_Verify = createRef<NSButtonBlue>();
27
- private NSBoxString_Code = createRef<NSBoxString>();
28
- constructor(props: NSAVerificationPageProps)
29
- {
30
- super(props);
31
- this.state = { isSendCode: false };
32
- this.onRequest = this.onRequest.bind(this);
33
- this.onVerify = this.onVerify.bind(this);
34
- }
35
- private async onRequest(onFinshied: () => void)
36
- {
37
- try
38
- {
39
- this.props.onRequest(this.props.getContactValue(true)).then(() =>
40
- {
41
- this.setState({ isSendCode: true });
42
- this.props.notifier.onSuccess(`Verification code has been sent successfully.`);
43
- onFinshied();
44
- }).catch(onFinshied);
45
- } catch (error)
46
- {
47
- this.props.notifier.onError(error as Error);
48
- onFinshied();
49
- }
50
- }
51
- private async onVerify(onFinshied: () => void)
52
- {
53
- try
54
- {
55
- let code = this.NSBoxString_Code.current?.getValue() ?? "";
56
- this.props.onVerify(code).then(() =>
57
- {
58
- this.props.notifier.onSuccess("Verification has been done successfully.");
59
- this.props.notifier.onSuccess("Redirecting ...", 2000);
60
- setTimeout(() =>
61
- {
62
- this.props.onFinished();
63
- onFinshied();
64
- }, 2000);
65
- }).catch(e =>
66
- {
67
- onFinshied();
68
- if (BaseServer.isErrorCode(e, 410) || BaseServer.isErrorCode(e, 404))
69
- this.setState({ isSendCode: false });
70
- });
71
- } catch (error)
72
- {
73
- this.props.notifier.onError(error as Error);
74
- onFinshied();
75
- }
76
- }
77
- override componentDidMount(): void
78
- {
79
- let code = this.props.url.getQuery("code", false, true) ?? "";
80
- if (code)
81
- {
82
- this.setState({ isSendCode: true }, () =>
83
- {
84
- this.NSBoxString_Code.current?.setValue(code, () =>
85
- {
86
- this.NSButtonBlue_Verify.current?.performClick();
87
- });
88
- });
89
- }
90
- }
91
- override render()
92
- {
93
- return (
94
- <NSSection>
95
- <div
96
- className={`${Styles.nsa_verification_container} ${this.props.classList?.join(" ") ?? ""}`}
97
- style={this.props.style}
98
- >
99
- <img
100
- src={"https://static.namirasoft.com/image/concept/verification/purple.png"}
101
- alt={'verification vector'}
102
- className={Styles.nsa_verification_vector}
103
- />
104
- <div className='m-0'>
105
- <p className='m-2'>Type: {this.props.contact_type}</p>
106
- {
107
- ((this.state.isSendCode || !this.props.children) && this.props.getContactValue(false)) &&
108
- <p className='m-2'>{this.props.contact_value_name}: {this.props.getContactValue(false)}</p>
109
- }
110
- {
111
- this.props.children &&
112
- <div style={{ display: this.state.isSendCode ? "none" : undefined }}>
113
- {this.props.children}
114
- </div>
115
- }
116
- </div>
117
- {
118
- this.state.isSendCode ?
119
- <>
120
- <p style={{ margin: 0 }}>
121
- Please enter the code you received
122
- </p>
123
- <NSBoxString
124
- ref={this.NSBoxString_Code}
125
- title='Verification Code'
126
- placeholder='Enter the code'
127
- hideHeader={true}
128
- required={true}
129
- min_length={6}
130
- max_length={6}
131
- input={{ style: { fontSize: '24px', fontWeight: "bold", textAlign: "center" } }}
132
- />
133
- </>
134
- :
135
- <>
136
- {
137
- this.props.onChange &&
138
- <>
139
- <button
140
- onClick={this.props.onChange}
141
- className={Styles.nsa_resend_button}
142
- style={{ marginTop: "8px" }}
143
- >Change {this.props.contact_value_name}</button>
144
- <NSSpace size={NSSpaceSizeType.NANO} />
145
- </>
146
- }
147
- <NSButtonBlue
148
- title='Send Code'
149
- onClick={{
150
- action: (onFinished) =>
151
- {
152
- this.onRequest(onFinished);
153
- },
154
- }}
155
- />
156
- </>
157
- }
158
- </div>
159
- <NSSpace size={NSSpaceSizeType.NORMAL}></NSSpace>
160
- {
161
- this.state.isSendCode &&
162
- <>
163
- <NSButtonBlue
164
- ref={this.NSButtonBlue_Verify}
165
- title="Verify"
166
- onClick={{
167
- action: (onFinished) =>
168
- {
169
- this.onVerify(onFinished);
170
- },
171
- }}
172
- />
173
- <NSSpace size={NSSpaceSizeType.SMALL}></NSSpace>
174
- <button
175
- onClick={() =>
176
- {
177
- this.setState(prev => ({ ...prev, isSendCode: false }));
178
- }}
179
- className={Styles.nsa_resend_button}
180
- >Resend Code</button>
181
- </>
182
- }
183
- </NSSection>
184
- );
185
- }
1
+ import { BaseServer } from "namirasoft-core";
2
+ import { IBaseComponentProps, NSBoxString, NSButtonBlue, NSRouterMakerResult, NSSection, NSSpace, NSSpaceSizeType } from 'namirasoft-site-react';
3
+ import React, { createRef, ReactNode } from "react";
4
+ import { NSARouterMakerResult } from '../NSARouterMakerResult';
5
+ import Styles from './NSAVerificationPage.module.css';
6
+
7
+ export interface NSAVerificationPageProps extends IBaseComponentProps, NSRouterMakerResult, NSARouterMakerResult
8
+ {
9
+ contact_type: string;
10
+ contact_value_name: string;
11
+ getContactValue: (checkErrors: boolean) => string;
12
+ onRequest: (address: string) => Promise<void>;
13
+ onVerify: (code: string) => Promise<void>;
14
+ onFinished: () => void;
15
+ onChange?: () => void;
16
+ children?: ReactNode;
17
+ }
18
+
19
+ export interface NSAVerificationPageState
20
+ {
21
+ isSendCode: boolean;
22
+ }
23
+
24
+ export class NSAVerificationPage extends React.Component<NSAVerificationPageProps, NSAVerificationPageState>
25
+ {
26
+ private NSButtonBlue_Verify = createRef<NSButtonBlue>();
27
+ private NSBoxString_Code = createRef<NSBoxString>();
28
+ constructor(props: NSAVerificationPageProps)
29
+ {
30
+ super(props);
31
+ this.state = { isSendCode: false };
32
+ this.onRequest = this.onRequest.bind(this);
33
+ this.onVerify = this.onVerify.bind(this);
34
+ }
35
+ private async onRequest(onFinshied: () => void)
36
+ {
37
+ try
38
+ {
39
+ this.props.onRequest(this.props.getContactValue(true)).then(() =>
40
+ {
41
+ this.setState({ isSendCode: true });
42
+ this.props.notifier.onSuccess(`Verification code has been sent successfully.`);
43
+ onFinshied();
44
+ }).catch(onFinshied);
45
+ } catch (error)
46
+ {
47
+ this.props.notifier.onError(error as Error);
48
+ onFinshied();
49
+ }
50
+ }
51
+ private async onVerify(onFinshied: () => void)
52
+ {
53
+ try
54
+ {
55
+ let code = this.NSBoxString_Code.current?.getValue() ?? "";
56
+ this.props.onVerify(code).then(() =>
57
+ {
58
+ this.props.notifier.onSuccess("Verification has been done successfully.");
59
+ this.props.notifier.onSuccess("Redirecting ...", 2000);
60
+ setTimeout(() =>
61
+ {
62
+ this.props.onFinished();
63
+ onFinshied();
64
+ }, 2000);
65
+ }).catch(e =>
66
+ {
67
+ onFinshied();
68
+ if (BaseServer.isErrorCode(e, 410) || BaseServer.isErrorCode(e, 404))
69
+ this.setState({ isSendCode: false });
70
+ });
71
+ } catch (error)
72
+ {
73
+ this.props.notifier.onError(error as Error);
74
+ onFinshied();
75
+ }
76
+ }
77
+ override componentDidMount(): void
78
+ {
79
+ let code = this.props.url.getQuery("code", false, true) ?? "";
80
+ if (code)
81
+ {
82
+ this.setState({ isSendCode: true }, () =>
83
+ {
84
+ this.NSBoxString_Code.current?.setValue(code, () =>
85
+ {
86
+ this.NSButtonBlue_Verify.current?.performClick();
87
+ });
88
+ });
89
+ }
90
+ }
91
+ override render()
92
+ {
93
+ return (
94
+ <NSSection>
95
+ <div
96
+ className={`${Styles.nsa_verification_container} ${this.props.classList?.join(" ") ?? ""}`}
97
+ style={this.props.style}
98
+ >
99
+ <img
100
+ src={"https://static.namirasoft.com/image/concept/verification/purple.png"}
101
+ alt={'verification vector'}
102
+ className={Styles.nsa_verification_vector}
103
+ />
104
+ <div className='m-0'>
105
+ <p className='m-2'>Type: {this.props.contact_type}</p>
106
+ {
107
+ ((this.state.isSendCode || !this.props.children) && this.props.getContactValue(false)) &&
108
+ <p className='m-2'>{this.props.contact_value_name}: {this.props.getContactValue(false)}</p>
109
+ }
110
+ {
111
+ this.props.children &&
112
+ <div style={{ display: this.state.isSendCode ? "none" : undefined }}>
113
+ {this.props.children}
114
+ </div>
115
+ }
116
+ </div>
117
+ {
118
+ this.state.isSendCode ?
119
+ <>
120
+ <p style={{ margin: 0 }}>
121
+ Please enter the code you received
122
+ </p>
123
+ <NSBoxString
124
+ ref={this.NSBoxString_Code}
125
+ title='Verification Code'
126
+ placeholder='Enter the code'
127
+ hideHeader={true}
128
+ required={true}
129
+ min_length={6}
130
+ max_length={6}
131
+ input={{ style: { fontSize: '24px', fontWeight: "bold", textAlign: "center" } }}
132
+ />
133
+ </>
134
+ :
135
+ <>
136
+ {
137
+ this.props.onChange &&
138
+ <>
139
+ <button
140
+ onClick={this.props.onChange}
141
+ className={Styles.nsa_resend_button}
142
+ style={{ marginTop: "8px" }}
143
+ >Change {this.props.contact_value_name}</button>
144
+ <NSSpace size={NSSpaceSizeType.NANO} />
145
+ </>
146
+ }
147
+ <NSButtonBlue
148
+ title='Send Code'
149
+ onClick={{
150
+ action: (onFinished) =>
151
+ {
152
+ this.onRequest(onFinished);
153
+ },
154
+ }}
155
+ />
156
+ </>
157
+ }
158
+ </div>
159
+ <NSSpace size={NSSpaceSizeType.NORMAL}></NSSpace>
160
+ {
161
+ this.state.isSendCode &&
162
+ <>
163
+ <NSButtonBlue
164
+ ref={this.NSButtonBlue_Verify}
165
+ title="Verify"
166
+ onClick={{
167
+ action: (onFinished) =>
168
+ {
169
+ this.onVerify(onFinished);
170
+ },
171
+ }}
172
+ />
173
+ <NSSpace size={NSSpaceSizeType.SMALL}></NSSpace>
174
+ <button
175
+ onClick={() =>
176
+ {
177
+ this.setState(prev => ({ ...prev, isSendCode: false }));
178
+ }}
179
+ className={Styles.nsa_resend_button}
180
+ >Resend Code</button>
181
+ </>
182
+ }
183
+ </NSSection>
184
+ );
185
+ }
186
186
  }
@@ -1,88 +1,88 @@
1
- import { CategoryInputRow, CategoryRow, CategoryScopeRow, SlotRow } from "namirasoft-field";
2
- import { NSBox, NSBoxString, NSBoxTextArea, NSColumn, NSRow } from "namirasoft-site-react";
3
- import { Component, createRef } from "react";
4
- import { NSALayoutCustomProps } from "../layouts/NSALayout";
5
- import { NSFRouterProps } from "../NSFRouterProps";
6
- import { NSFEntities } from "./NSFEntities";
7
-
8
- export interface NSFCategoryEditPageProps extends NSALayoutCustomProps<CategoryRow>, NSFRouterProps
9
- {
10
- slot: SlotRow;
11
- category_scope: CategoryScopeRow;
12
- isEdit: boolean;
13
- }
14
-
15
- interface NSFCategoryEditPageState { }
16
-
17
- export class NSFCategoryEditPage extends Component<NSFCategoryEditPageProps, NSFCategoryEditPageState>
18
- {
19
- NSBoxString_Name = createRef<NSBoxString>();
20
- NSBoxTexArea_Description = createRef<NSBoxTextArea>();
21
-
22
- constructor(props: NSFCategoryEditPageProps)
23
- {
24
- super(props);
25
- this.state = {};
26
- }
27
-
28
- override render()
29
- {
30
- return this.props.layout.getNSALayout<CategoryRow, CategoryInputRow>({
31
- ...this.props,
32
- action: {
33
- description: this.props.isEdit ? "This section allows you to update the details of an existing category." : "This section allows you to add a new category by entering its details."
34
- },
35
- pages: {
36
- entity: NSFEntities.category(this.props, this.props.slot, this.props.category_scope),
37
- edit: {
38
- ...this.props,
39
- ui: {
40
- tab_page_edit: {
41
- editor: {
42
- getInputRow: () =>
43
- {
44
- let category_scope_id = this.props.category_scope.id;
45
- let name = this.NSBoxString_Name.current?.getValue() ?? "";
46
- let description = this.NSBoxTexArea_Description.current?.getValue() ?? "";
47
-
48
- return {
49
- workspace_id: "",
50
- category_scope_id,
51
- name,
52
- description,
53
- category_category: [],
54
- category_field: [],
55
- category_tag: [],
56
- };
57
- },
58
- setRow: (row) =>
59
- {
60
- this.NSBoxString_Name.current?.setValue(row.name);
61
- this.NSBoxTexArea_Description.current?.setValue(row.description ?? "");
62
- }
63
- }
64
- }
65
- }
66
- }
67
- },
68
- children: <NSColumn>
69
- <NSRow>
70
- <NSBoxString
71
- ref={this.NSBoxString_Name}
72
- title="Name"
73
- required
74
- style={{ width: NSBox.width.double }}
75
- info={{ link: "https://namirasoft.com/field/console-guide/category/#field-name" }}
76
- />
77
- </NSRow>
78
- <NSBoxTextArea
79
- ref={this.NSBoxTexArea_Description}
80
- title="Description"
81
- required={false}
82
- style={{ width: NSBox.width.double }}
83
- info={{ link: "https://namirasoft.com/field/console-guide/category/#field-description" }}
84
- />
85
- </NSColumn>
86
- }, "nsf-page-category-view");
87
- }
1
+ import { CategoryInputRow, CategoryRow, CategoryScopeRow, SlotRow } from "namirasoft-field";
2
+ import { NSBox, NSBoxString, NSBoxTextArea, NSColumn, NSRow } from "namirasoft-site-react";
3
+ import { Component, createRef } from "react";
4
+ import { NSALayoutCustomProps } from "../layouts/NSALayout";
5
+ import { NSFRouterProps } from "../NSFRouterProps";
6
+ import { NSFEntities } from "./NSFEntities";
7
+
8
+ export interface NSFCategoryEditPageProps extends NSALayoutCustomProps<CategoryRow>, NSFRouterProps
9
+ {
10
+ slot: SlotRow;
11
+ category_scope: CategoryScopeRow;
12
+ isEdit: boolean;
13
+ }
14
+
15
+ interface NSFCategoryEditPageState { }
16
+
17
+ export class NSFCategoryEditPage extends Component<NSFCategoryEditPageProps, NSFCategoryEditPageState>
18
+ {
19
+ NSBoxString_Name = createRef<NSBoxString>();
20
+ NSBoxTexArea_Description = createRef<NSBoxTextArea>();
21
+
22
+ constructor(props: NSFCategoryEditPageProps)
23
+ {
24
+ super(props);
25
+ this.state = {};
26
+ }
27
+
28
+ override render()
29
+ {
30
+ return this.props.layout.getNSALayout<CategoryRow, CategoryInputRow>({
31
+ ...this.props,
32
+ action: {
33
+ description: this.props.isEdit ? "This section allows you to update the details of an existing category." : "This section allows you to add a new category by entering its details."
34
+ },
35
+ pages: {
36
+ entity: NSFEntities.category(this.props, this.props.slot, this.props.category_scope),
37
+ edit: {
38
+ ...this.props,
39
+ ui: {
40
+ tab_page_edit: {
41
+ editor: {
42
+ getInputRow: () =>
43
+ {
44
+ let category_scope_id = this.props.category_scope.id;
45
+ let name = this.NSBoxString_Name.current?.getValue() ?? "";
46
+ let description = this.NSBoxTexArea_Description.current?.getValue() ?? "";
47
+
48
+ return {
49
+ workspace_id: "",
50
+ category_scope_id,
51
+ name,
52
+ description,
53
+ category_category: [],
54
+ category_field: [],
55
+ category_tag: [],
56
+ };
57
+ },
58
+ setRow: (row) =>
59
+ {
60
+ this.NSBoxString_Name.current?.setValue(row.name);
61
+ this.NSBoxTexArea_Description.current?.setValue(row.description ?? "");
62
+ }
63
+ }
64
+ }
65
+ }
66
+ }
67
+ },
68
+ children: <NSColumn>
69
+ <NSRow>
70
+ <NSBoxString
71
+ ref={this.NSBoxString_Name}
72
+ title="Name"
73
+ required
74
+ style={{ width: NSBox.width.double }}
75
+ info={{ link: "https://namirasoft.com/field/console-guide/category/#field-name" }}
76
+ />
77
+ </NSRow>
78
+ <NSBoxTextArea
79
+ ref={this.NSBoxTexArea_Description}
80
+ title="Description"
81
+ required={false}
82
+ style={{ width: NSBox.width.double }}
83
+ info={{ link: "https://namirasoft.com/field/console-guide/category/#field-description" }}
84
+ />
85
+ </NSColumn>
86
+ }, "nsf-page-category-view");
87
+ }
88
88
  }
@@ -1,24 +1,24 @@
1
- import { CategoryRow, CategoryScopeRow, SlotRow } from "namirasoft-field";
2
- import { NSALayoutCustomProps } from "../layouts/NSALayout";
3
- import { NSFRouterProps } from "../NSFRouterProps";
4
- import { NSFEntities } from "./NSFEntities";
5
-
6
- export interface NSFCategoryListPageProps extends NSALayoutCustomProps<CategoryRow>, NSFRouterProps
7
- {
8
- slot: SlotRow;
9
- category_scope: CategoryScopeRow;
10
- }
11
-
12
- export function NSFCategoryListPage(props: NSFCategoryListPageProps)
13
- {
14
- return props.layout.getNSALayout({
15
- ...props,
16
- action: {
17
- description: "This section displays all categories you have created with their basic information."
18
- },
19
- pages: {
20
- entity: NSFEntities.category(props, props.slot, props.category_scope),
21
- list: {}
22
- }
23
- }, "nsf-page-category-list");
1
+ import { CategoryRow, CategoryScopeRow, SlotRow } from "namirasoft-field";
2
+ import { NSALayoutCustomProps } from "../layouts/NSALayout";
3
+ import { NSFRouterProps } from "../NSFRouterProps";
4
+ import { NSFEntities } from "./NSFEntities";
5
+
6
+ export interface NSFCategoryListPageProps extends NSALayoutCustomProps<CategoryRow>, NSFRouterProps
7
+ {
8
+ slot: SlotRow;
9
+ category_scope: CategoryScopeRow;
10
+ }
11
+
12
+ export function NSFCategoryListPage(props: NSFCategoryListPageProps)
13
+ {
14
+ return props.layout.getNSALayout({
15
+ ...props,
16
+ action: {
17
+ description: "This section displays all categories you have created with their basic information."
18
+ },
19
+ pages: {
20
+ entity: NSFEntities.category(props, props.slot, props.category_scope),
21
+ list: {}
22
+ }
23
+ }, "nsf-page-category-list");
24
24
  }