namirasoft-account-react 1.4.431 → 1.4.433

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 (158) hide show
  1. package/.env.template +15 -15
  2. package/SKILLS.md +514 -514
  3. package/config-overrides.js +72 -72
  4. package/dist/App.d.ts +1 -1
  5. package/dist/NSARouterMaker.js +1 -0
  6. package/dist/NSARouterMaker.js.map +1 -1
  7. package/dist/NSARouterMakerProps.d.ts +2 -0
  8. package/dist/NSATaskService.d.ts +35 -0
  9. package/dist/NSATaskService.js +80 -0
  10. package/dist/NSATaskService.js.map +1 -0
  11. package/dist/UseParams.d.ts +1 -1
  12. package/dist/components/NSAAccessListDialog.d.ts +2 -2
  13. package/dist/components/NSAAccessListDialog.module.css +71 -71
  14. package/dist/components/NSAMasterMenu.d.ts +1 -1
  15. package/dist/components/NSAMasterMenu.module.css +248 -248
  16. package/dist/components/NSAMasterMenuItem.d.ts +1 -1
  17. package/dist/components/NSAMessageListDialog.d.ts +1 -1
  18. package/dist/components/NSAMessageListDialog.js +4 -3
  19. package/dist/components/NSAMessageListDialog.js.map +1 -1
  20. package/dist/components/NSAMessageListDialog.module.css +99 -99
  21. package/dist/components/NSANavigationGuard.d.ts +6 -0
  22. package/dist/components/NSANavigationGuard.js +37 -0
  23. package/dist/components/NSANavigationGuard.js.map +1 -0
  24. package/dist/components/NSAProductListDialog.d.ts +1 -1
  25. package/dist/components/NSAProductListDialog.module.css +44 -44
  26. package/dist/components/NSAReorderDialog.d.ts +1 -1
  27. package/dist/components/NSAReorderDialog.module.css +49 -49
  28. package/dist/components/NSASortDialog.d.ts +1 -1
  29. package/dist/components/NSATable.js +7 -0
  30. package/dist/components/NSATable.js.map +1 -1
  31. package/dist/components/NSATaskBar.d.ts +13 -0
  32. package/dist/components/NSATaskBar.js +53 -0
  33. package/dist/components/NSATaskBar.js.map +1 -0
  34. package/dist/components/NSATaskBar.module.css +58 -0
  35. package/dist/components/NSAUserDialog.d.ts +1 -1
  36. package/dist/components/NSAUserDialog.module.css +67 -67
  37. package/dist/components/NSAWorkspaceListDialog.d.ts +1 -1
  38. package/dist/components/NSAWorkspaceListDialog.module.css +41 -41
  39. package/dist/components/NSBoxSecret.d.ts +1 -1
  40. package/dist/components/NSBoxSecret.module.css +23 -23
  41. package/dist/components/NSLabelSecret.d.ts +1 -1
  42. package/dist/components/quickfilter/NSAQuickFilterBar.d.ts +1 -1
  43. package/dist/components/quickfilter/NSAQuickFilterDialog.d.ts +1 -1
  44. package/dist/index.js +5 -2
  45. package/dist/index.js.map +1 -1
  46. package/dist/layouts/Actions.d.ts +1 -1
  47. package/dist/layouts/Actions.js +8 -6
  48. package/dist/layouts/Actions.js.map +1 -1
  49. package/dist/layouts/NSALayout.d.ts +1 -6
  50. package/dist/layouts/NSALayout.js +36 -61
  51. package/dist/layouts/NSALayout.js.map +1 -1
  52. package/dist/layouts/NSASectionEdit.d.ts +3 -1
  53. package/dist/layouts/NSASectionEdit.js +28 -19
  54. package/dist/layouts/NSASectionEdit.js.map +1 -1
  55. package/dist/layouts/NSASectionEditTabPage.d.ts +1 -1
  56. package/dist/layouts/NSASectionEditTabPage.module.css +4 -4
  57. package/dist/layouts/NSASectionList.d.ts +1 -1
  58. package/dist/layouts/NSASectionList.module.css +31 -31
  59. package/dist/layouts/NSASectionView.d.ts +1 -1
  60. package/dist/layouts/NSASectionViewTabMore.d.ts +1 -1
  61. package/dist/layouts/NSASectionViewTabMore.js +3 -3
  62. package/dist/layouts/NSASectionViewTabMore.js.map +1 -1
  63. package/dist/layouts/NSASectionViewTabPage.d.ts +1 -1
  64. package/dist/layouts/NSASectionViewTabPage.module.css +47 -47
  65. package/dist/pages/NSAConsentPage.module.css +26 -26
  66. package/dist/pages/NSAEmailVerificationPage.d.ts +1 -1
  67. package/dist/pages/NSAHomePage.d.ts +1 -1
  68. package/dist/pages/NSAHomePage.module.css +41 -41
  69. package/dist/pages/NSALoginPage.d.ts +1 -1
  70. package/dist/pages/NSALoginPage.module.css +26 -26
  71. package/dist/pages/NSAPhoneVerificationPage.d.ts +1 -1
  72. package/dist/pages/NSAVerificationPage.d.ts +1 -1
  73. package/dist/pages/NSAVerificationPage.module.css +31 -31
  74. package/dist/pages/PaymentRequired.js +4 -2
  75. package/dist/pages/PaymentRequired.js.map +1 -1
  76. package/package.json +94 -94
  77. package/public/index.html +21 -21
  78. package/src/App.css +31 -31
  79. package/src/App.tsx +19 -19
  80. package/src/CTFRow.ts +7 -7
  81. package/src/IEntityInfo.ts +33 -33
  82. package/src/NSACacheService.ts +120 -120
  83. package/src/NSAFilterOperators.ts +92 -92
  84. package/src/NSARouterMaker.tsx +140 -139
  85. package/src/NSARouterMakerConfig.ts +15 -15
  86. package/src/NSARouterMakerProps.ts +24 -22
  87. package/src/NSATaskService.ts +123 -0
  88. package/src/Router.tsx +45 -45
  89. package/src/UseParams.tsx +18 -18
  90. package/src/components/NSAAccessListDialog.module.css +71 -71
  91. package/src/components/NSAAccessListDialog.tsx +178 -178
  92. package/src/components/NSAMasterMenu.module.css +248 -248
  93. package/src/components/NSAMasterMenu.tsx +169 -169
  94. package/src/components/NSAMasterMenuItem.tsx +250 -250
  95. package/src/components/NSAMessageListDialog.module.css +99 -99
  96. package/src/components/NSAMessageListDialog.tsx +142 -141
  97. package/src/components/NSANavigationGuard.tsx +65 -0
  98. package/src/components/NSAProductListDialog.module.css +44 -44
  99. package/src/components/NSAProductListDialog.tsx +88 -88
  100. package/src/components/NSAReorderDialog.module.css +49 -49
  101. package/src/components/NSAReorderDialog.tsx +149 -149
  102. package/src/components/NSASortDialog.tsx +117 -117
  103. package/src/components/NSATable.tsx +498 -489
  104. package/src/components/NSATaskBar.module.css +58 -0
  105. package/src/components/NSATaskBar.tsx +102 -0
  106. package/src/components/NSAUserDialog.module.css +67 -67
  107. package/src/components/NSAUserDialog.tsx +122 -122
  108. package/src/components/NSAWorkspaceListDialog.module.css +41 -41
  109. package/src/components/NSAWorkspaceListDialog.tsx +147 -147
  110. package/src/components/NSBoxSecret.module.css +23 -23
  111. package/src/components/NSBoxSecret.tsx +258 -258
  112. package/src/components/NSLabelSecret.tsx +37 -37
  113. package/src/components/quickfilter/NSAFilterBoxBase.tsx +55 -55
  114. package/src/components/quickfilter/NSAFilterBoxBoolean.tsx +54 -54
  115. package/src/components/quickfilter/NSAFilterBoxDate.tsx +104 -104
  116. package/src/components/quickfilter/NSAFilterBoxDateTime.tsx +105 -105
  117. package/src/components/quickfilter/NSAFilterBoxEnum.module.css +44 -44
  118. package/src/components/quickfilter/NSAFilterBoxEnum.tsx +79 -79
  119. package/src/components/quickfilter/NSAFilterBoxNumber.tsx +136 -136
  120. package/src/components/quickfilter/NSAFilterBoxString.tsx +81 -81
  121. package/src/components/quickfilter/NSAFilterBoxTime.tsx +101 -101
  122. package/src/components/quickfilter/NSAQuickFilterBar.module.css +19 -19
  123. package/src/components/quickfilter/NSAQuickFilterBar.tsx +114 -114
  124. package/src/components/quickfilter/NSAQuickFilterDialog.module.css +74 -74
  125. package/src/components/quickfilter/NSAQuickFilterDialog.tsx +260 -260
  126. package/src/css.d.ts +13 -13
  127. package/src/formatters/SecretFormatter.tsx +24 -24
  128. package/src/index.tsx +26 -24
  129. package/src/layouts/Actions.ts +146 -145
  130. package/src/layouts/CFTUtil.ts +18 -18
  131. package/src/layouts/NSALayout.tsx +790 -841
  132. package/src/layouts/NSASectionEdit.tsx +279 -260
  133. package/src/layouts/NSASectionEditTabPage.module.css +4 -4
  134. package/src/layouts/NSASectionEditTabPage.tsx +250 -250
  135. package/src/layouts/NSASectionList.module.css +31 -31
  136. package/src/layouts/NSASectionList.tsx +149 -149
  137. package/src/layouts/NSASectionView.tsx +100 -100
  138. package/src/layouts/NSASectionViewTabMore.tsx +77 -77
  139. package/src/layouts/NSASectionViewTabPage.module.css +47 -47
  140. package/src/layouts/NSASectionViewTabPage.tsx +419 -419
  141. package/src/main.ts +46 -46
  142. package/src/pages/NSAConsentPage.module.css +26 -26
  143. package/src/pages/NSAConsentPage.tsx +120 -120
  144. package/src/pages/NSAEmailVerificationPage.tsx +30 -30
  145. package/src/pages/NSAHomePage.module.css +41 -41
  146. package/src/pages/NSAHomePage.tsx +102 -102
  147. package/src/pages/NSALoginPage.module.css +26 -26
  148. package/src/pages/NSALoginPage.tsx +87 -87
  149. package/src/pages/NSAPhoneVerificationPage.tsx +94 -94
  150. package/src/pages/NSAVerificationPage.module.css +31 -31
  151. package/src/pages/NSAVerificationPage.tsx +186 -186
  152. package/src/pages/PaymentRequired.tsx +76 -74
  153. package/tsconfig.json +43 -43
  154. package/dist/App.css +0 -32
  155. package/dist/components/quickfilter/NSAFilterBoxEnum.module.css +0 -45
  156. package/dist/components/quickfilter/NSAQuickFilterBar.module.css +0 -20
  157. package/dist/components/quickfilter/NSAQuickFilterDialog.module.css +0 -75
  158. package/dist/index.css +0 -0
@@ -1,150 +1,150 @@
1
- import { CategoryRow, FieldRow } 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 { NSARouterMakerProps } from "../NSARouterMakerProps";
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, NSARouterMakerProps, NSASectionListCustomProps<RowType, RowTypeInput>
22
- {
23
- entity: IEntityInfo<RowType, RowTypeInput>;
24
- ctf: {
25
- enabled: boolean;
26
- fields: FieldRow[] | null;
27
- categories: CategoryRow[] | null;
28
- };
29
- deleteFieldCache: () => void;
30
- children?: ReactNode;
31
- }
32
-
33
- export interface NSASectionListState
34
- {
35
- mode: string;
36
- selected_row_ids: string[];
37
- }
38
-
39
- export class NSASectionList<RowType extends { id: string }, RowTypeInput = RowType>
40
- extends Component<NSASectionListProps<RowType, RowTypeInput>, NSASectionListState>
41
- {
42
- public NSBoxCombo_Mode = createRef<NSBoxCombo>();
43
- public NSATable_Main = createRef<NSATable<RowType, RowTypeInput>>();
44
- public NSASectionViewTabPage_Ref = createRef<NSASectionViewTabPage<RowType, RowTypeInput>>();
45
-
46
- constructor(props: NSASectionListProps<RowType, RowTypeInput>)
47
- {
48
- super(props);
49
- this.state = { mode: props.ui?.default_mode ?? "", selected_row_ids: [] };
50
- }
51
-
52
- getSelectedIDs(): string[]
53
- {
54
- return this.NSATable_Main.current?.getSelectedIDs() ?? [];
55
- }
56
- getSelectedRows(): RowType[]
57
- {
58
- return this.NSATable_Main.current?.getSelectedRows() ?? [];
59
- }
60
-
61
- override render()
62
- {
63
- let table_renderer = () => (
64
- <NSATable<RowType, RowTypeInput>
65
- ref={this.NSATable_Main}
66
- entity={this.props.entity}
67
- ctf={this.props.ctf}
68
- url={this.props.url}
69
- ui={this.props.ui}
70
- classList={[Styles.nsa_table]}
71
- onSelectionChanged={() =>
72
- {
73
- this.props.onIDsChanged?.();
74
- this.setState({ selected_row_ids: this.getSelectedIDs() });
75
- }}
76
- />
77
- );
78
-
79
- let modes = this.props.ui?.modes ?? {};
80
- if (!modes)
81
- modes = {};
82
- if (!modes["Table"])
83
- modes = { Table: { getChild: table_renderer, show_view: true }, ...modes };
84
-
85
- let mode_names = Object.keys(modes);
86
- let mode_name_current = this.state.mode;
87
- if (!mode_names.includes(mode_name_current))
88
- mode_name_current = mode_names[0];
89
- let mode_current = modes[mode_name_current];
90
- let show_view = (mode_current.show_view ?? false);
91
- return (
92
- <>
93
- <div
94
- id={this.props.id}
95
- className={`${this.props.classList?.join(" ") ?? ""}`}
96
- style={{ ...this.props.style }}
97
- >
98
- {
99
- mode_names.length > 1 &&
100
- <>
101
- <NSRow style={{ justifyContent: "flex-end", alignItems: "center" }}>
102
- <div className={Styles.nsa_section_list_actions}>
103
- <NSBoxCombo
104
- ref={this.NSBoxCombo_Mode}
105
- title="Mode"
106
- hideHeader
107
- required
108
- searchable={false}
109
- placeholder=""
110
- defaultValue={mode_name_current}
111
- getOptions={() => mode_names.map(m => ({ value: m, title: m }))}
112
- multiple={false}
113
- style={{ width: "100px" }}
114
- onChanged={e =>
115
- {
116
- this.setState({ mode: e.getValueOne(false) ?? "" });
117
- }}
118
- />
119
- </div>
120
- </NSRow>
121
- <NSSpace size={NSSpaceSizeType.MINI} />
122
- </>
123
- }
124
- {
125
- show_view ?
126
- <NSSplitter
127
- storage_key={`nsa_splitter_${this.props.entity.product_id}_${this.props.entity.name}`}
128
- master_content={mode_current.getChild(this.props.entity)}
129
- detail_content={(
130
- this.state.selected_row_ids.length === 1 &&
131
- <NSASectionViewTabPage<RowType, RowTypeInput>
132
- key={this.state.selected_row_ids[0]}
133
- ref={this.NSASectionViewTabPage_Ref}
134
- {...this.props}
135
- ui={this.props.ui?.tab_page_view}
136
- model={{
137
- id: this.getSelectedIDs()[0],
138
- row: this.getSelectedRows()[0]
139
- }}
140
- />
141
- )}
142
- /> :
143
- mode_current.getChild(this.props.entity)
144
- }
145
- </div>
146
- {this.props.children}
147
- </>
148
- );
149
- }
1
+ import { CategoryRow, FieldRow } 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 { NSARouterMakerProps } from "../NSARouterMakerProps";
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, NSARouterMakerProps, NSASectionListCustomProps<RowType, RowTypeInput>
22
+ {
23
+ entity: IEntityInfo<RowType, RowTypeInput>;
24
+ ctf: {
25
+ enabled: boolean;
26
+ fields: FieldRow[] | null;
27
+ categories: CategoryRow[] | null;
28
+ };
29
+ deleteFieldCache: () => void;
30
+ children?: ReactNode;
31
+ }
32
+
33
+ export interface NSASectionListState
34
+ {
35
+ mode: string;
36
+ selected_row_ids: string[];
37
+ }
38
+
39
+ export class NSASectionList<RowType extends { id: string }, RowTypeInput = RowType>
40
+ extends Component<NSASectionListProps<RowType, RowTypeInput>, NSASectionListState>
41
+ {
42
+ public NSBoxCombo_Mode = createRef<NSBoxCombo>();
43
+ public NSATable_Main = createRef<NSATable<RowType, RowTypeInput>>();
44
+ public NSASectionViewTabPage_Ref = createRef<NSASectionViewTabPage<RowType, RowTypeInput>>();
45
+
46
+ constructor(props: NSASectionListProps<RowType, RowTypeInput>)
47
+ {
48
+ super(props);
49
+ this.state = { mode: props.ui?.default_mode ?? "", selected_row_ids: [] };
50
+ }
51
+
52
+ getSelectedIDs(): string[]
53
+ {
54
+ return this.NSATable_Main.current?.getSelectedIDs() ?? [];
55
+ }
56
+ getSelectedRows(): RowType[]
57
+ {
58
+ return this.NSATable_Main.current?.getSelectedRows() ?? [];
59
+ }
60
+
61
+ override render()
62
+ {
63
+ let table_renderer = () => (
64
+ <NSATable<RowType, RowTypeInput>
65
+ ref={this.NSATable_Main}
66
+ entity={this.props.entity}
67
+ ctf={this.props.ctf}
68
+ url={this.props.url}
69
+ ui={this.props.ui}
70
+ classList={[Styles.nsa_table]}
71
+ onSelectionChanged={() =>
72
+ {
73
+ this.props.onIDsChanged?.();
74
+ this.setState({ selected_row_ids: this.getSelectedIDs() });
75
+ }}
76
+ />
77
+ );
78
+
79
+ let modes = this.props.ui?.modes ?? {};
80
+ if (!modes)
81
+ modes = {};
82
+ if (!modes["Table"])
83
+ modes = { Table: { getChild: table_renderer, show_view: true }, ...modes };
84
+
85
+ let mode_names = Object.keys(modes);
86
+ let mode_name_current = this.state.mode;
87
+ if (!mode_names.includes(mode_name_current))
88
+ mode_name_current = mode_names[0];
89
+ let mode_current = modes[mode_name_current];
90
+ let show_view = (mode_current.show_view ?? false);
91
+ return (
92
+ <>
93
+ <div
94
+ id={this.props.id}
95
+ className={`${this.props.classList?.join(" ") ?? ""}`}
96
+ style={{ ...this.props.style }}
97
+ >
98
+ {
99
+ mode_names.length > 1 &&
100
+ <>
101
+ <NSRow style={{ justifyContent: "flex-end", alignItems: "center" }}>
102
+ <div className={Styles.nsa_section_list_actions}>
103
+ <NSBoxCombo
104
+ ref={this.NSBoxCombo_Mode}
105
+ title="Mode"
106
+ hideHeader
107
+ required
108
+ searchable={false}
109
+ placeholder=""
110
+ defaultValue={mode_name_current}
111
+ getOptions={() => mode_names.map(m => ({ value: m, title: m }))}
112
+ multiple={false}
113
+ style={{ width: "100px" }}
114
+ onChanged={e =>
115
+ {
116
+ this.setState({ mode: e.getValueOne(false) ?? "" });
117
+ }}
118
+ />
119
+ </div>
120
+ </NSRow>
121
+ <NSSpace size={NSSpaceSizeType.MINI} />
122
+ </>
123
+ }
124
+ {
125
+ show_view ?
126
+ <NSSplitter
127
+ storage_key={`nsa_splitter_${this.props.entity.product_id}_${this.props.entity.name}`}
128
+ master_content={mode_current.getChild(this.props.entity)}
129
+ detail_content={(
130
+ this.state.selected_row_ids.length === 1 &&
131
+ <NSASectionViewTabPage<RowType, RowTypeInput>
132
+ key={this.state.selected_row_ids[0]}
133
+ ref={this.NSASectionViewTabPage_Ref}
134
+ {...this.props}
135
+ ui={this.props.ui?.tab_page_view}
136
+ model={{
137
+ id: this.getSelectedIDs()[0],
138
+ row: this.getSelectedRows()[0]
139
+ }}
140
+ />
141
+ )}
142
+ /> :
143
+ mode_current.getChild(this.props.entity)
144
+ }
145
+ </div>
146
+ {this.props.children}
147
+ </>
148
+ );
149
+ }
150
150
  }
@@ -1,101 +1,101 @@
1
- import { CategoryRow, FieldRow } 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 { NSARouterMakerProps } from "../NSARouterMakerProps";
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 NSARouterMakerProps, NSASectionViewCutomProps<RowType>
20
- {
21
- entity: IEntityInfo<RowType, RowTypeInput>;
22
- ctf: {
23
- enabled: boolean;
24
- fields: FieldRow[] | null;
25
- categories: CategoryRow[] | null;
26
- };
27
- model: {
28
- id: string | null;
29
- row: RowType | null;
30
- };
31
- deleteFieldCache: () => void;
32
- }
33
-
34
- interface NSASectionViewState<RowType>
35
- {
36
- row: RowType | null;
37
- }
38
-
39
- export class NSASectionView<RowType extends { id: string }, RowTypeInput = RowType> extends Component<NSASectionViewProps<RowType, RowTypeInput>, NSASectionViewState<RowType>>
40
- {
41
- NSASectionViewTabPage_Ref = createRef<NSASectionViewTabPage<RowType, RowTypeInput>>();
42
-
43
- constructor(props: NSASectionViewProps<RowType, RowTypeInput>)
44
- {
45
- super(props);
46
-
47
- this.state = { row: this.props.model.row };
48
-
49
- this.reload = this.reload.bind(this);
50
- this.getRow = this.getRow.bind(this);
51
- }
52
- reload()
53
- {
54
- this.setState(prev => ({ ...prev, row: null }));
55
- if (this.props.model.id)
56
- if (this.props.entity.server.get)
57
- this.props.entity.server.get(this.props.model.id).then(row =>
58
- {
59
- this.setState(prev => ({ ...prev, row }), () =>
60
- {
61
- this.props.onRowLoaded?.(row);
62
- });
63
- }).catch(() => { });
64
- }
65
- getRow()
66
- {
67
- return this.state.row;
68
- }
69
- override componentDidMount()
70
- {
71
- if (this.props.model.id)
72
- if (!this.props.model.row || this.props.model.row.id !== this.props.model.id)
73
- this.reload();
74
- }
75
- override render()
76
- {
77
- if (this.props.model.id && this.state.row != null)
78
- return (
79
- <div
80
- id={this.props.id}
81
- className={`${this.props.classList?.join(" ") ?? ""}`}
82
- style={{ ...this.props.style }}
83
- >
84
- {this.props.ui?.getChildrenBefore && this.props.ui?.getChildrenBefore(this.props.model.id, this.state.row)}
85
- <NSASectionViewTabPage<RowType, RowTypeInput>
86
- ref={this.NSASectionViewTabPage_Ref}
87
- {...this.props}
88
- model={{
89
- id: this.props.model.id,
90
- row: this.state.row
91
- }}
92
- ui={this.props.ui?.tab_page_view}
93
- />
94
- {this.props.ui?.getChildrenAfter && this.props.ui?.getChildrenAfter(this.props.model.id, this.state.row)}
95
- {this.props.children}
96
- </div>
97
- );
98
-
99
- return <NSLoading></NSLoading>;
100
- }
1
+ import { CategoryRow, FieldRow } 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 { NSARouterMakerProps } from "../NSARouterMakerProps";
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 NSARouterMakerProps, NSASectionViewCutomProps<RowType>
20
+ {
21
+ entity: IEntityInfo<RowType, RowTypeInput>;
22
+ ctf: {
23
+ enabled: boolean;
24
+ fields: FieldRow[] | null;
25
+ categories: CategoryRow[] | null;
26
+ };
27
+ model: {
28
+ id: string | null;
29
+ row: RowType | null;
30
+ };
31
+ deleteFieldCache: () => void;
32
+ }
33
+
34
+ interface NSASectionViewState<RowType>
35
+ {
36
+ row: RowType | null;
37
+ }
38
+
39
+ export class NSASectionView<RowType extends { id: string }, RowTypeInput = RowType> extends Component<NSASectionViewProps<RowType, RowTypeInput>, NSASectionViewState<RowType>>
40
+ {
41
+ NSASectionViewTabPage_Ref = createRef<NSASectionViewTabPage<RowType, RowTypeInput>>();
42
+
43
+ constructor(props: NSASectionViewProps<RowType, RowTypeInput>)
44
+ {
45
+ super(props);
46
+
47
+ this.state = { row: this.props.model.row };
48
+
49
+ this.reload = this.reload.bind(this);
50
+ this.getRow = this.getRow.bind(this);
51
+ }
52
+ reload()
53
+ {
54
+ this.setState(prev => ({ ...prev, row: null }));
55
+ if (this.props.model.id)
56
+ if (this.props.entity.server.get)
57
+ this.props.entity.server.get(this.props.model.id).then(row =>
58
+ {
59
+ this.setState(prev => ({ ...prev, row }), () =>
60
+ {
61
+ this.props.onRowLoaded?.(row);
62
+ });
63
+ }).catch(() => { });
64
+ }
65
+ getRow()
66
+ {
67
+ return this.state.row;
68
+ }
69
+ override componentDidMount()
70
+ {
71
+ if (this.props.model.id)
72
+ if (!this.props.model.row || this.props.model.row.id !== this.props.model.id)
73
+ this.reload();
74
+ }
75
+ override render()
76
+ {
77
+ if (this.props.model.id && this.state.row != null)
78
+ return (
79
+ <div
80
+ id={this.props.id}
81
+ className={`${this.props.classList?.join(" ") ?? ""}`}
82
+ style={{ ...this.props.style }}
83
+ >
84
+ {this.props.ui?.getChildrenBefore && this.props.ui?.getChildrenBefore(this.props.model.id, this.state.row)}
85
+ <NSASectionViewTabPage<RowType, RowTypeInput>
86
+ ref={this.NSASectionViewTabPage_Ref}
87
+ {...this.props}
88
+ model={{
89
+ id: this.props.model.id,
90
+ row: this.state.row
91
+ }}
92
+ ui={this.props.ui?.tab_page_view}
93
+ />
94
+ {this.props.ui?.getChildrenAfter && this.props.ui?.getChildrenAfter(this.props.model.id, this.state.row)}
95
+ {this.props.children}
96
+ </div>
97
+ );
98
+
99
+ return <NSLoading></NSLoading>;
100
+ }
101
101
  }
@@ -1,78 +1,78 @@
1
- import { EnvService } from "namirasoft-core";
2
- import { NSButtonGreen, NSColumn, NSLabel, NSLine, NSRow } from "namirasoft-site-react";
3
- import { Component } from "react";
4
-
5
- export interface NSASectionViewTabMoreProps
6
- {
7
- deleteFieldCache: () => void;
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
- window.open(REACT_APP_BASE_URL_FIELD_CONSOLE + "/field/list", "_blank");
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
- window.open(REACT_APP_BASE_URL_FIELD_CONSOLE + "/category/list", "_blank");
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
- this.props.deleteFieldCache?.();
69
- document.location.reload();
70
- },
71
- showLoading: false
72
- }}
73
- ></NSButtonGreen>
74
- </NSRow>
75
- </NSColumn>
76
- );
77
- }
1
+ import { EnvService } from "namirasoft-core";
2
+ import { LinkOperation, NSButtonGreen, NSColumn, NSLabel, NSLine, NSRow } from "namirasoft-site-react";
3
+ import { Component } from "react";
4
+
5
+ export interface NSASectionViewTabMoreProps
6
+ {
7
+ deleteFieldCache: () => void;
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
+ this.props.deleteFieldCache?.();
69
+ document.location.reload();
70
+ },
71
+ showLoading: false
72
+ }}
73
+ ></NSButtonGreen>
74
+ </NSRow>
75
+ </NSColumn>
76
+ );
77
+ }
78
78
  }