namirasoft-account-react 1.5.21 → 1.5.22

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 (141) 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.js +1 -0
  45. package/dist/layouts/NSASectionViewTabPage.js.map +1 -1
  46. package/dist/layouts/NSASectionViewTabPage.module.css +47 -47
  47. package/dist/pages/NSAConsentPage.module.css +26 -26
  48. package/dist/pages/NSAEmailVerificationPage.d.ts +1 -1
  49. package/dist/pages/NSAHomePage.d.ts +1 -1
  50. package/dist/pages/NSAHomePage.module.css +41 -41
  51. package/dist/pages/NSALoginPage.d.ts +1 -1
  52. package/dist/pages/NSALoginPage.module.css +26 -26
  53. package/dist/pages/NSAPhoneVerificationPage.d.ts +1 -1
  54. package/dist/pages/NSAVerificationPage.d.ts +1 -1
  55. package/dist/pages/NSAVerificationPage.module.css +31 -31
  56. package/package.json +95 -95
  57. package/public/index.html +21 -21
  58. package/src/App.tsx +19 -19
  59. package/src/CTFRow.ts +7 -7
  60. package/src/FieldCacheService.tsx +84 -84
  61. package/src/IEntityInfo.ts +33 -33
  62. package/src/NSACacheService.ts +120 -120
  63. package/src/NSAFilterOperators.ts +92 -92
  64. package/src/NSARouterMaker.tsx +140 -140
  65. package/src/NSARouterMakerProps.ts +23 -23
  66. package/src/NSARouterMakerResult.ts +24 -24
  67. package/src/NSFRouterMaker.tsx +35 -35
  68. package/src/NSFRouterProps.ts +7 -7
  69. package/src/NSFRoutes.ts +30 -30
  70. package/src/Router.tsx +48 -48
  71. package/src/UseParams.tsx +17 -17
  72. package/src/components/NSAAccessListDialog.module.css +71 -71
  73. package/src/components/NSAAccessListDialog.tsx +178 -178
  74. package/src/components/NSABoxSecret.module.css +23 -23
  75. package/src/components/NSABoxSecret.tsx +264 -264
  76. package/src/components/NSAMasterMenu.module.css +250 -250
  77. package/src/components/NSAMasterMenu.tsx +169 -169
  78. package/src/components/NSAMasterMenuItem.tsx +250 -250
  79. package/src/components/NSAMessageListDialog.module.css +99 -99
  80. package/src/components/NSAMessageListDialog.tsx +142 -142
  81. package/src/components/NSANavigationGuard.tsx +79 -79
  82. package/src/components/NSAProductListDialog.module.css +44 -44
  83. package/src/components/NSAProductListDialog.tsx +88 -88
  84. package/src/components/NSATable.tsx +494 -494
  85. package/src/components/NSATaskBar.module.css +57 -57
  86. package/src/components/NSATaskBar.tsx +193 -193
  87. package/src/components/NSAUserDialog.module.css +67 -67
  88. package/src/components/NSAUserDialog.tsx +122 -122
  89. package/src/components/NSAWorkspaceListDialog.module.css +41 -41
  90. package/src/components/NSAWorkspaceListDialog.tsx +147 -147
  91. package/src/components/NSFBoxCategoryScope.tsx +52 -52
  92. package/src/components/NSFBoxField.tsx +37 -37
  93. package/src/components/NSFBoxSlot.tsx +71 -71
  94. package/src/components/NSFBoxWrapper.tsx +69 -69
  95. package/src/components/NSLabelSecret.tsx +37 -37
  96. package/src/components/quickfilter/NSAFilterBoxBase.tsx +89 -89
  97. package/src/components/quickfilter/NSAFilterBoxBoolean.tsx +66 -66
  98. package/src/components/quickfilter/NSAFilterBoxDate.tsx +110 -110
  99. package/src/components/quickfilter/NSAFilterBoxDateTime.tsx +110 -110
  100. package/src/components/quickfilter/NSAFilterBoxEnum.module.css +44 -44
  101. package/src/components/quickfilter/NSAFilterBoxEnum.tsx +79 -79
  102. package/src/components/quickfilter/NSAFilterBoxNumber.tsx +145 -145
  103. package/src/components/quickfilter/NSAFilterBoxString.tsx +83 -83
  104. package/src/components/quickfilter/NSAFilterBoxTime.tsx +106 -106
  105. package/src/components/quickfilter/NSAQuickFilterBar.module.css +19 -19
  106. package/src/components/quickfilter/NSAQuickFilterBar.tsx +142 -142
  107. package/src/components/quickfilter/NSAQuickFilterDialog.module.css +74 -74
  108. package/src/components/quickfilter/NSAQuickFilterDialog.tsx +260 -260
  109. package/src/css.d.ts +13 -13
  110. package/src/formatters/SecretFormatter.tsx +24 -24
  111. package/src/index.tsx +26 -26
  112. package/src/layouts/Actions.ts +146 -146
  113. package/src/layouts/CFTUtil.ts +18 -18
  114. package/src/layouts/NSALayout.tsx +744 -744
  115. package/src/layouts/NSALayout_Field.ts +125 -125
  116. package/src/layouts/NSASectionEdit.tsx +281 -281
  117. package/src/layouts/NSASectionEditTabPage.module.css +4 -4
  118. package/src/layouts/NSASectionEditTabPage.tsx +256 -256
  119. package/src/layouts/NSASectionList.module.css +31 -31
  120. package/src/layouts/NSASectionList.tsx +147 -147
  121. package/src/layouts/NSASectionView.tsx +98 -98
  122. package/src/layouts/NSASectionViewTabMore.tsx +78 -78
  123. package/src/layouts/NSASectionViewTabPage.module.css +47 -47
  124. package/src/layouts/NSASectionViewTabPage.tsx +400 -399
  125. package/src/main.ts +52 -52
  126. package/src/pages/NSAConsentPage.module.css +26 -26
  127. package/src/pages/NSAConsentPage.tsx +120 -120
  128. package/src/pages/NSAEmailVerificationPage.tsx +30 -30
  129. package/src/pages/NSAHomePage.module.css +41 -41
  130. package/src/pages/NSAHomePage.tsx +124 -124
  131. package/src/pages/NSALoginPage.module.css +26 -26
  132. package/src/pages/NSALoginPage.tsx +87 -87
  133. package/src/pages/NSAPhoneVerificationPage.tsx +94 -94
  134. package/src/pages/NSAVerificationPage.module.css +31 -31
  135. package/src/pages/NSAVerificationPage.tsx +185 -185
  136. package/src/pages/NSFCategoryEditPage.tsx +87 -87
  137. package/src/pages/NSFCategoryListPage.tsx +23 -23
  138. package/src/pages/NSFCategoryViewPage.tsx +23 -23
  139. package/src/pages/NSFEntities.ts +58 -58
  140. package/src/pages/PaymentRequired.tsx +80 -80
  141. package/tsconfig.json +43 -43
@@ -1,148 +1,148 @@
1
- import { EntityResolveResponseRow } from "namirasoft-field";
2
- import { IBaseComponentProps, NSBoxCombo, NSRow, NSSpace, NSSpaceSizeType, NSSplitter } from "namirasoft-site-react";
3
- import { Component, ReactNode, createRef } from "react";
4
- import { IEntityInfo } from "../IEntityInfo";
5
- import { NSARouterMakerResult } from "../NSARouterMakerResult";
6
- import { NSATable, NSATableUIProps } from "../components/NSATable";
7
- import Styles from "./NSASectionList.module.css";
8
- import { NSASectionViewTabPage, NSASectionViewTabPageUIProps } from "./NSASectionViewTabPage";
9
-
10
- export interface NSASectionListCustomProps<RowType extends { id: string }, RowTypeInput = RowType>
11
- {
12
- ui?: NSATableUIProps<RowType> & {
13
- modes?: { [name: string]: { getChild: (entity: IEntityInfo<RowType, RowTypeInput>) => JSX.Element, show_view?: boolean } };
14
- default_mode?: string;
15
- tab_page_view?: NSASectionViewTabPageUIProps<RowType>;
16
- };
17
- onIDsChanged?: () => void;
18
- children?: React.ReactNode;
19
- }
20
-
21
- export interface NSASectionListProps<RowType extends { id: string }, RowTypeInput = RowType> extends IBaseComponentProps, NSARouterMakerResult, NSASectionListCustomProps<RowType, RowTypeInput>
22
- {
23
- entity: IEntityInfo<RowType, RowTypeInput>;
24
- ctf: {
25
- enabled: boolean;
26
- rows: EntityResolveResponseRow | null;
27
- };
28
- children?: ReactNode;
29
- }
30
-
31
- export interface NSASectionListState
32
- {
33
- mode: string;
34
- selected_row_ids: string[];
35
- }
36
-
37
- export class NSASectionList<RowType extends { id: string }, RowTypeInput = RowType>
38
- extends Component<NSASectionListProps<RowType, RowTypeInput>, NSASectionListState>
39
- {
40
- public NSBoxCombo_Mode = createRef<NSBoxCombo>();
41
- public NSATable_Main = createRef<NSATable<RowType, RowTypeInput>>();
42
- public NSASectionViewTabPage_Ref = createRef<NSASectionViewTabPage<RowType, RowTypeInput>>();
43
-
44
- constructor(props: NSASectionListProps<RowType, RowTypeInput>)
45
- {
46
- super(props);
47
- this.state = { mode: props.ui?.default_mode ?? "", selected_row_ids: [] };
48
- }
49
-
50
- getSelectedIDs(): string[]
51
- {
52
- return this.NSATable_Main.current?.getSelectedIDs() ?? [];
53
- }
54
- getSelectedRows(): RowType[]
55
- {
56
- return this.NSATable_Main.current?.getSelectedRows() ?? [];
57
- }
58
-
59
- override render()
60
- {
61
- let table_renderer = () => (
62
- <NSATable<RowType, RowTypeInput>
63
- ref={this.NSATable_Main}
64
- entity={this.props.entity}
65
- ctf={this.props.ctf}
66
- url={this.props.url}
67
- ui={this.props.ui}
68
- classList={[Styles.nsa_table]}
69
- onSelectionChanged={() =>
70
- {
71
- this.props.onIDsChanged?.();
72
- this.setState({ selected_row_ids: this.getSelectedIDs() });
73
- }}
74
- />
75
- );
76
-
77
- let modes = this.props.ui?.modes ?? {};
78
- if (!modes)
79
- modes = {};
80
- if (!modes["Table"])
81
- modes = { Table: { getChild: table_renderer, show_view: true }, ...modes };
82
-
83
- let mode_names = Object.keys(modes);
84
- let mode_name_current = this.state.mode;
85
- if (!mode_names.includes(mode_name_current))
86
- mode_name_current = mode_names[0];
87
- let mode_current = modes[mode_name_current];
88
- let show_view = (mode_current.show_view ?? false);
89
- return (
90
- <>
91
- <div
92
- id={this.props.id}
93
- className={`${this.props.classList?.join(" ") ?? ""}`}
94
- style={{ ...this.props.style }}
95
- >
96
- {
97
- mode_names.length > 1 &&
98
- <>
99
- <NSRow style={{ justifyContent: "flex-end", alignItems: "center" }}>
100
- <div className={Styles.nsa_section_list_actions}>
101
- <NSBoxCombo
102
- ref={this.NSBoxCombo_Mode}
103
- title="Mode"
104
- hideHeader
105
- required
106
- searchable={false}
107
- placeholder=""
108
- defaultValue={mode_name_current}
109
- getOptions={() => mode_names.map(m => ({ value: m, title: m }))}
110
- multiple={false}
111
- style={{ width: "100px" }}
112
- onChanged={e =>
113
- {
114
- this.setState({ mode: e.getValueOne(false) ?? "" });
115
- }}
116
- />
117
- </div>
118
- </NSRow>
119
- <NSSpace size={NSSpaceSizeType.MINI} />
120
- </>
121
- }
122
- {
123
- show_view ?
124
- <NSSplitter
125
- storage_key={`ns-splitter-product:${this.props.entity.product_id}-entity:${this.props.entity.name}-height`}
126
- master_content={mode_current.getChild(this.props.entity)}
127
- detail_content={(
128
- this.state.selected_row_ids.length === 1 &&
129
- <NSASectionViewTabPage<RowType, RowTypeInput>
130
- key={this.state.selected_row_ids[0]}
131
- ref={this.NSASectionViewTabPage_Ref}
132
- {...this.props}
133
- ui={this.props.ui?.tab_page_view}
134
- model={{
135
- id: this.getSelectedIDs()[0],
136
- row: this.getSelectedRows()[0]
137
- }}
138
- />
139
- )}
140
- /> :
141
- mode_current.getChild(this.props.entity)
142
- }
143
- </div>
144
- {this.props.children}
145
- </>
146
- );
147
- }
1
+ import { EntityResolveResponseRow } from "namirasoft-field";
2
+ import { IBaseComponentProps, NSBoxCombo, NSRow, NSSpace, NSSpaceSizeType, NSSplitter } from "namirasoft-site-react";
3
+ import { Component, ReactNode, createRef } from "react";
4
+ import { IEntityInfo } from "../IEntityInfo";
5
+ import { NSARouterMakerResult } from "../NSARouterMakerResult";
6
+ import { NSATable, NSATableUIProps } from "../components/NSATable";
7
+ import Styles from "./NSASectionList.module.css";
8
+ import { NSASectionViewTabPage, NSASectionViewTabPageUIProps } from "./NSASectionViewTabPage";
9
+
10
+ export interface NSASectionListCustomProps<RowType extends { id: string }, RowTypeInput = RowType>
11
+ {
12
+ ui?: NSATableUIProps<RowType> & {
13
+ modes?: { [name: string]: { getChild: (entity: IEntityInfo<RowType, RowTypeInput>) => JSX.Element, show_view?: boolean } };
14
+ default_mode?: string;
15
+ tab_page_view?: NSASectionViewTabPageUIProps<RowType>;
16
+ };
17
+ onIDsChanged?: () => void;
18
+ children?: React.ReactNode;
19
+ }
20
+
21
+ export interface NSASectionListProps<RowType extends { id: string }, RowTypeInput = RowType> extends IBaseComponentProps, NSARouterMakerResult, NSASectionListCustomProps<RowType, RowTypeInput>
22
+ {
23
+ entity: IEntityInfo<RowType, RowTypeInput>;
24
+ ctf: {
25
+ enabled: boolean;
26
+ rows: EntityResolveResponseRow | null;
27
+ };
28
+ children?: ReactNode;
29
+ }
30
+
31
+ export interface NSASectionListState
32
+ {
33
+ mode: string;
34
+ selected_row_ids: string[];
35
+ }
36
+
37
+ export class NSASectionList<RowType extends { id: string }, RowTypeInput = RowType>
38
+ extends Component<NSASectionListProps<RowType, RowTypeInput>, NSASectionListState>
39
+ {
40
+ public NSBoxCombo_Mode = createRef<NSBoxCombo>();
41
+ public NSATable_Main = createRef<NSATable<RowType, RowTypeInput>>();
42
+ public NSASectionViewTabPage_Ref = createRef<NSASectionViewTabPage<RowType, RowTypeInput>>();
43
+
44
+ constructor(props: NSASectionListProps<RowType, RowTypeInput>)
45
+ {
46
+ super(props);
47
+ this.state = { mode: props.ui?.default_mode ?? "", selected_row_ids: [] };
48
+ }
49
+
50
+ getSelectedIDs(): string[]
51
+ {
52
+ return this.NSATable_Main.current?.getSelectedIDs() ?? [];
53
+ }
54
+ getSelectedRows(): RowType[]
55
+ {
56
+ return this.NSATable_Main.current?.getSelectedRows() ?? [];
57
+ }
58
+
59
+ override render()
60
+ {
61
+ let table_renderer = () => (
62
+ <NSATable<RowType, RowTypeInput>
63
+ ref={this.NSATable_Main}
64
+ entity={this.props.entity}
65
+ ctf={this.props.ctf}
66
+ url={this.props.url}
67
+ ui={this.props.ui}
68
+ classList={[Styles.nsa_table]}
69
+ onSelectionChanged={() =>
70
+ {
71
+ this.props.onIDsChanged?.();
72
+ this.setState({ selected_row_ids: this.getSelectedIDs() });
73
+ }}
74
+ />
75
+ );
76
+
77
+ let modes = this.props.ui?.modes ?? {};
78
+ if (!modes)
79
+ modes = {};
80
+ if (!modes["Table"])
81
+ modes = { Table: { getChild: table_renderer, show_view: true }, ...modes };
82
+
83
+ let mode_names = Object.keys(modes);
84
+ let mode_name_current = this.state.mode;
85
+ if (!mode_names.includes(mode_name_current))
86
+ mode_name_current = mode_names[0];
87
+ let mode_current = modes[mode_name_current];
88
+ let show_view = (mode_current.show_view ?? false);
89
+ return (
90
+ <>
91
+ <div
92
+ id={this.props.id}
93
+ className={`${this.props.classList?.join(" ") ?? ""}`}
94
+ style={{ ...this.props.style }}
95
+ >
96
+ {
97
+ mode_names.length > 1 &&
98
+ <>
99
+ <NSRow style={{ justifyContent: "flex-end", alignItems: "center" }}>
100
+ <div className={Styles.nsa_section_list_actions}>
101
+ <NSBoxCombo
102
+ ref={this.NSBoxCombo_Mode}
103
+ title="Mode"
104
+ hideHeader
105
+ required
106
+ searchable={false}
107
+ placeholder=""
108
+ defaultValue={mode_name_current}
109
+ getOptions={() => mode_names.map(m => ({ value: m, title: m }))}
110
+ multiple={false}
111
+ style={{ width: "100px" }}
112
+ onChanged={e =>
113
+ {
114
+ this.setState({ mode: e.getValueOne(false) ?? "" });
115
+ }}
116
+ />
117
+ </div>
118
+ </NSRow>
119
+ <NSSpace size={NSSpaceSizeType.MINI} />
120
+ </>
121
+ }
122
+ {
123
+ show_view ?
124
+ <NSSplitter
125
+ storage_key={`ns-splitter-product:${this.props.entity.product_id}-entity:${this.props.entity.name}-height`}
126
+ master_content={mode_current.getChild(this.props.entity)}
127
+ detail_content={(
128
+ this.state.selected_row_ids.length === 1 &&
129
+ <NSASectionViewTabPage<RowType, RowTypeInput>
130
+ key={this.state.selected_row_ids[0]}
131
+ ref={this.NSASectionViewTabPage_Ref}
132
+ {...this.props}
133
+ ui={this.props.ui?.tab_page_view}
134
+ model={{
135
+ id: this.getSelectedIDs()[0],
136
+ row: this.getSelectedRows()[0]
137
+ }}
138
+ />
139
+ )}
140
+ /> :
141
+ mode_current.getChild(this.props.entity)
142
+ }
143
+ </div>
144
+ {this.props.children}
145
+ </>
146
+ );
147
+ }
148
148
  }
@@ -1,99 +1,99 @@
1
- import { EntityResolveResponseRow } from "namirasoft-field";
2
- import { IBaseComponentProps, NSLoading } from "namirasoft-site-react";
3
- import { Component, createRef, ReactNode } from "react";
4
- import { IEntityInfo } from "../IEntityInfo";
5
- import { NSARouterMakerResult } from "../NSARouterMakerResult";
6
- import { NSASectionViewTabPage, NSASectionViewTabPageUIProps } from "./NSASectionViewTabPage";
7
-
8
- export interface NSASectionViewCutomProps<RowType> extends IBaseComponentProps
9
- {
10
- ui?: {
11
- tab_page_view?: NSASectionViewTabPageUIProps<RowType>;
12
- getChildrenBefore?: (id: string, row: RowType) => ReactNode;
13
- getChildrenAfter?: (id: string, row: RowType) => ReactNode;
14
- };
15
- onRowLoaded?: (row: RowType) => void;
16
- children?: React.ReactNode;
17
- }
18
-
19
- export interface NSASectionViewProps<RowType extends { id: string }, RowTypeInput = RowType> extends NSARouterMakerResult, NSASectionViewCutomProps<RowType>
20
- {
21
- entity: IEntityInfo<RowType, RowTypeInput>;
22
- ctf: {
23
- enabled: boolean;
24
- rows: EntityResolveResponseRow | null;
25
- };
26
- model: {
27
- id: string | null;
28
- row: RowType | null;
29
- };
30
- }
31
-
32
- interface NSASectionViewState<RowType>
33
- {
34
- row: RowType | null;
35
- }
36
-
37
- export class NSASectionView<RowType extends { id: string }, RowTypeInput = RowType> extends Component<NSASectionViewProps<RowType, RowTypeInput>, NSASectionViewState<RowType>>
38
- {
39
- NSASectionViewTabPage_Ref = createRef<NSASectionViewTabPage<RowType, RowTypeInput>>();
40
-
41
- constructor(props: NSASectionViewProps<RowType, RowTypeInput>)
42
- {
43
- super(props);
44
-
45
- this.state = { row: this.props.model.row };
46
-
47
- this.reload = this.reload.bind(this);
48
- this.getRow = this.getRow.bind(this);
49
- }
50
- reload()
51
- {
52
- this.setState(prev => ({ ...prev, row: null }));
53
- if (this.props.model.id)
54
- if (this.props.entity.server.get)
55
- this.props.entity.server.get(this.props.model.id).then(row =>
56
- {
57
- this.setState(prev => ({ ...prev, row }), () =>
58
- {
59
- this.props.onRowLoaded?.(row);
60
- });
61
- }).catch(() => { });
62
- }
63
- getRow()
64
- {
65
- return this.state.row;
66
- }
67
- override componentDidMount()
68
- {
69
- if (this.props.model.id)
70
- if (!this.props.model.row || this.props.model.row.id !== this.props.model.id)
71
- this.reload();
72
- }
73
- override render()
74
- {
75
- if (this.props.model.id && this.state.row != null)
76
- return (
77
- <div
78
- id={this.props.id}
79
- className={`${this.props.classList?.join(" ") ?? ""}`}
80
- style={{ ...this.props.style }}
81
- >
82
- {this.props.ui?.getChildrenBefore && this.props.ui?.getChildrenBefore(this.props.model.id, this.state.row)}
83
- <NSASectionViewTabPage<RowType, RowTypeInput>
84
- ref={this.NSASectionViewTabPage_Ref}
85
- {...this.props}
86
- model={{
87
- id: this.props.model.id,
88
- row: this.state.row
89
- }}
90
- ui={this.props.ui?.tab_page_view}
91
- />
92
- {this.props.ui?.getChildrenAfter && this.props.ui?.getChildrenAfter(this.props.model.id, this.state.row)}
93
- {this.props.children}
94
- </div>
95
- );
96
-
97
- return <NSLoading></NSLoading>;
98
- }
1
+ import { EntityResolveResponseRow } from "namirasoft-field";
2
+ import { IBaseComponentProps, NSLoading } from "namirasoft-site-react";
3
+ import { Component, createRef, ReactNode } from "react";
4
+ import { IEntityInfo } from "../IEntityInfo";
5
+ import { NSARouterMakerResult } from "../NSARouterMakerResult";
6
+ import { NSASectionViewTabPage, NSASectionViewTabPageUIProps } from "./NSASectionViewTabPage";
7
+
8
+ export interface NSASectionViewCutomProps<RowType> extends IBaseComponentProps
9
+ {
10
+ ui?: {
11
+ tab_page_view?: NSASectionViewTabPageUIProps<RowType>;
12
+ getChildrenBefore?: (id: string, row: RowType) => ReactNode;
13
+ getChildrenAfter?: (id: string, row: RowType) => ReactNode;
14
+ };
15
+ onRowLoaded?: (row: RowType) => void;
16
+ children?: React.ReactNode;
17
+ }
18
+
19
+ export interface NSASectionViewProps<RowType extends { id: string }, RowTypeInput = RowType> extends NSARouterMakerResult, NSASectionViewCutomProps<RowType>
20
+ {
21
+ entity: IEntityInfo<RowType, RowTypeInput>;
22
+ ctf: {
23
+ enabled: boolean;
24
+ rows: EntityResolveResponseRow | null;
25
+ };
26
+ model: {
27
+ id: string | null;
28
+ row: RowType | null;
29
+ };
30
+ }
31
+
32
+ interface NSASectionViewState<RowType>
33
+ {
34
+ row: RowType | null;
35
+ }
36
+
37
+ export class NSASectionView<RowType extends { id: string }, RowTypeInput = RowType> extends Component<NSASectionViewProps<RowType, RowTypeInput>, NSASectionViewState<RowType>>
38
+ {
39
+ NSASectionViewTabPage_Ref = createRef<NSASectionViewTabPage<RowType, RowTypeInput>>();
40
+
41
+ constructor(props: NSASectionViewProps<RowType, RowTypeInput>)
42
+ {
43
+ super(props);
44
+
45
+ this.state = { row: this.props.model.row };
46
+
47
+ this.reload = this.reload.bind(this);
48
+ this.getRow = this.getRow.bind(this);
49
+ }
50
+ reload()
51
+ {
52
+ this.setState(prev => ({ ...prev, row: null }));
53
+ if (this.props.model.id)
54
+ if (this.props.entity.server.get)
55
+ this.props.entity.server.get(this.props.model.id).then(row =>
56
+ {
57
+ this.setState(prev => ({ ...prev, row }), () =>
58
+ {
59
+ this.props.onRowLoaded?.(row);
60
+ });
61
+ }).catch(() => { });
62
+ }
63
+ getRow()
64
+ {
65
+ return this.state.row;
66
+ }
67
+ override componentDidMount()
68
+ {
69
+ if (this.props.model.id)
70
+ if (!this.props.model.row || this.props.model.row.id !== this.props.model.id)
71
+ this.reload();
72
+ }
73
+ override render()
74
+ {
75
+ if (this.props.model.id && this.state.row != null)
76
+ return (
77
+ <div
78
+ id={this.props.id}
79
+ className={`${this.props.classList?.join(" ") ?? ""}`}
80
+ style={{ ...this.props.style }}
81
+ >
82
+ {this.props.ui?.getChildrenBefore && this.props.ui?.getChildrenBefore(this.props.model.id, this.state.row)}
83
+ <NSASectionViewTabPage<RowType, RowTypeInput>
84
+ ref={this.NSASectionViewTabPage_Ref}
85
+ {...this.props}
86
+ model={{
87
+ id: this.props.model.id,
88
+ row: this.state.row
89
+ }}
90
+ ui={this.props.ui?.tab_page_view}
91
+ />
92
+ {this.props.ui?.getChildrenAfter && this.props.ui?.getChildrenAfter(this.props.model.id, this.state.row)}
93
+ {this.props.children}
94
+ </div>
95
+ );
96
+
97
+ return <NSLoading></NSLoading>;
98
+ }
99
99
  }
@@ -1,79 +1,79 @@
1
- import { EnvService } from "namirasoft-core";
2
- import { LinkOperation, NSButtonGreen, NSColumn, NSLabel, NSLine, NSRow } from "namirasoft-site-react";
3
- import { Component } from "react";
4
- import { FieldCacheService } from "../FieldCacheService";
5
- import { NSARouterMakerResult } from "../NSARouterMakerResult";
6
-
7
- export interface NSASectionViewTabMoreProps extends NSARouterMakerResult
8
- { }
9
-
10
- export interface NSASectionViewTabMoreState
11
- { }
12
-
13
- export class NSASectionViewTabMore extends Component<NSASectionViewTabMoreProps, NSASectionViewTabMoreState>
14
- {
15
- override render()
16
- {
17
- return (
18
- <NSColumn
19
- >
20
- <NSLabel
21
- title="Namirasoft Field - Field"
22
- description="Here you can see the list of fields that are available in the system."
23
- ></NSLabel>
24
- <NSRow>
25
- <NSButtonGreen
26
- title="See Field List"
27
- onClick={{
28
- action: () =>
29
- {
30
- let REACT_APP_BASE_URL_FIELD_CONSOLE = new EnvService("REACT_APP_BASE_URL_FIELD_CONSOLE", true).getString();
31
- LinkOperation.open(REACT_APP_BASE_URL_FIELD_CONSOLE + "/field/list");
32
- },
33
- showLoading: false
34
- }}
35
- ></NSButtonGreen>
36
- </NSRow>
37
- <NSLine />
38
- <NSLabel
39
- title="Namirasoft Field - Category"
40
- description="Here you can see the list of categories that are available in the system."
41
- >
42
- </NSLabel>
43
- <NSRow>
44
- <NSButtonGreen
45
- title="See Category List"
46
- onClick={{
47
- action: () =>
48
- {
49
- let REACT_APP_BASE_URL_FIELD_CONSOLE = new EnvService("REACT_APP_BASE_URL_FIELD_CONSOLE", true).getString();
50
- LinkOperation.open(REACT_APP_BASE_URL_FIELD_CONSOLE + "/category/list");
51
- },
52
- showLoading: false
53
- }}
54
- ></NSButtonGreen>
55
- </NSRow>
56
- <NSLine />
57
- <NSLabel
58
- title="Namirasoft Field"
59
- description="We use a 24-hour cache to speed up rendering the page, so if you have recently made changes and you do not see it here, please clear it using the following button."
60
- >
61
- </NSLabel>
62
- <NSRow>
63
- <NSButtonGreen
64
- title="Clear Cache"
65
- onClick={{
66
- action: () =>
67
- {
68
- let cache = FieldCacheService.get(this.props.account.token_manager, this.props.product_id, this.props.notifier.onError);
69
- cache.del();
70
- document.location.reload();
71
- },
72
- showLoading: false
73
- }}
74
- ></NSButtonGreen>
75
- </NSRow>
76
- </NSColumn>
77
- );
78
- }
1
+ import { EnvService } from "namirasoft-core";
2
+ import { LinkOperation, NSButtonGreen, NSColumn, NSLabel, NSLine, NSRow } from "namirasoft-site-react";
3
+ import { Component } from "react";
4
+ import { FieldCacheService } from "../FieldCacheService";
5
+ import { NSARouterMakerResult } from "../NSARouterMakerResult";
6
+
7
+ export interface NSASectionViewTabMoreProps extends NSARouterMakerResult
8
+ { }
9
+
10
+ export interface NSASectionViewTabMoreState
11
+ { }
12
+
13
+ export class NSASectionViewTabMore extends Component<NSASectionViewTabMoreProps, NSASectionViewTabMoreState>
14
+ {
15
+ override render()
16
+ {
17
+ return (
18
+ <NSColumn
19
+ >
20
+ <NSLabel
21
+ title="Namirasoft Field - Field"
22
+ description="Here you can see the list of fields that are available in the system."
23
+ ></NSLabel>
24
+ <NSRow>
25
+ <NSButtonGreen
26
+ title="See Field List"
27
+ onClick={{
28
+ action: () =>
29
+ {
30
+ let REACT_APP_BASE_URL_FIELD_CONSOLE = new EnvService("REACT_APP_BASE_URL_FIELD_CONSOLE", true).getString();
31
+ LinkOperation.open(REACT_APP_BASE_URL_FIELD_CONSOLE + "/field/list");
32
+ },
33
+ showLoading: false
34
+ }}
35
+ ></NSButtonGreen>
36
+ </NSRow>
37
+ <NSLine />
38
+ <NSLabel
39
+ title="Namirasoft Field - Category"
40
+ description="Here you can see the list of categories that are available in the system."
41
+ >
42
+ </NSLabel>
43
+ <NSRow>
44
+ <NSButtonGreen
45
+ title="See Category List"
46
+ onClick={{
47
+ action: () =>
48
+ {
49
+ let REACT_APP_BASE_URL_FIELD_CONSOLE = new EnvService("REACT_APP_BASE_URL_FIELD_CONSOLE", true).getString();
50
+ LinkOperation.open(REACT_APP_BASE_URL_FIELD_CONSOLE + "/category/list");
51
+ },
52
+ showLoading: false
53
+ }}
54
+ ></NSButtonGreen>
55
+ </NSRow>
56
+ <NSLine />
57
+ <NSLabel
58
+ title="Namirasoft Field"
59
+ description="We use a 24-hour cache to speed up rendering the page, so if you have recently made changes and you do not see it here, please clear it using the following button."
60
+ >
61
+ </NSLabel>
62
+ <NSRow>
63
+ <NSButtonGreen
64
+ title="Clear Cache"
65
+ onClick={{
66
+ action: () =>
67
+ {
68
+ let cache = FieldCacheService.get(this.props.account.token_manager, this.props.product_id, this.props.notifier.onError);
69
+ cache.del();
70
+ document.location.reload();
71
+ },
72
+ showLoading: false
73
+ }}
74
+ ></NSButtonGreen>
75
+ </NSRow>
76
+ </NSColumn>
77
+ );
78
+ }
79
79
  }