namirasoft-account-react 1.5.24 → 1.5.26
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.
- package/.env.template +15 -15
- package/SKILL.md +514 -514
- package/config-overrides.js +72 -72
- package/dist/App.d.ts +1 -1
- package/dist/FieldCacheService.js +1 -1
- package/dist/FieldCacheService.js.map +1 -1
- package/dist/Router.d.ts +1 -1
- package/dist/UseParams.d.ts +1 -1
- package/dist/components/NSAAccessListDialog.d.ts +2 -2
- package/dist/components/NSAAccessListDialog.js +1 -1
- package/dist/components/NSAAccessListDialog.js.map +1 -1
- package/dist/components/NSAAccessListDialog.module.css +71 -71
- package/dist/components/NSABoxSecret.d.ts +1 -1
- package/dist/components/NSABoxSecret.module.css +23 -23
- package/dist/components/NSAMasterMenu.d.ts +1 -1
- package/dist/components/NSAMasterMenu.module.css +250 -250
- package/dist/components/NSAMasterMenuItem.d.ts +1 -1
- package/dist/components/NSAMessageListDialog.d.ts +1 -1
- package/dist/components/NSAMessageListDialog.js +1 -1
- package/dist/components/NSAMessageListDialog.js.map +1 -1
- package/dist/components/NSAMessageListDialog.module.css +99 -99
- package/dist/components/NSANavigationGuard.d.ts +1 -1
- package/dist/components/NSAProductListDialog.d.ts +1 -1
- package/dist/components/NSAProductListDialog.js +1 -1
- package/dist/components/NSAProductListDialog.js.map +1 -1
- package/dist/components/NSAProductListDialog.module.css +44 -44
- package/dist/components/NSATaskBar.d.ts +1 -1
- package/dist/components/NSATaskBar.module.css +57 -57
- package/dist/components/NSAUserDialog.d.ts +1 -1
- package/dist/components/NSAUserDialog.js +2 -2
- package/dist/components/NSAUserDialog.js.map +1 -1
- package/dist/components/NSAUserDialog.module.css +67 -67
- package/dist/components/NSAWorkspaceListDialog.d.ts +1 -1
- package/dist/components/NSAWorkspaceListDialog.js +1 -1
- package/dist/components/NSAWorkspaceListDialog.js.map +1 -1
- package/dist/components/NSAWorkspaceListDialog.module.css +41 -41
- package/dist/components/NSFBoxCategoryScope.d.ts +1 -1
- package/dist/components/NSFBoxField.d.ts +1 -1
- package/dist/components/NSFBoxSlot.d.ts +1 -1
- package/dist/components/NSFBoxWrapper.d.ts +1 -1
- package/dist/components/NSLabelSecret.d.ts +1 -1
- package/dist/components/quickfilter/NSAFilterBoxEnum.module.css +44 -44
- package/dist/components/quickfilter/NSAQuickFilterBar.d.ts +1 -1
- package/dist/components/quickfilter/NSAQuickFilterBar.module.css +19 -19
- package/dist/components/quickfilter/NSAQuickFilterDialog.d.ts +1 -1
- package/dist/components/quickfilter/NSAQuickFilterDialog.module.css +74 -74
- package/dist/layouts/NSALayout.d.ts +1 -1
- package/dist/layouts/NSALayout.js +1 -1
- package/dist/layouts/NSALayout.js.map +1 -1
- package/dist/layouts/NSASectionEdit.d.ts +1 -1
- package/dist/layouts/NSASectionEdit.js +1 -1
- package/dist/layouts/NSASectionEdit.js.map +1 -1
- package/dist/layouts/NSASectionEditTabPage.d.ts +1 -1
- package/dist/layouts/NSASectionEditTabPage.module.css +4 -4
- package/dist/layouts/NSASectionList.d.ts +1 -1
- package/dist/layouts/NSASectionList.js +1 -1
- package/dist/layouts/NSASectionList.js.map +1 -1
- package/dist/layouts/NSASectionList.module.css +31 -31
- package/dist/layouts/NSASectionView.d.ts +1 -1
- package/dist/layouts/NSASectionView.js +1 -1
- package/dist/layouts/NSASectionView.js.map +1 -1
- package/dist/layouts/NSASectionViewTabMore.d.ts +1 -1
- package/dist/layouts/NSASectionViewTabPage.d.ts +1 -1
- package/dist/layouts/NSASectionViewTabPage.js +3 -3
- package/dist/layouts/NSASectionViewTabPage.js.map +1 -1
- package/dist/layouts/NSASectionViewTabPage.module.css +47 -47
- package/dist/pages/NSAConsentPage.js +1 -1
- package/dist/pages/NSAConsentPage.js.map +1 -1
- package/dist/pages/NSAConsentPage.module.css +26 -26
- package/dist/pages/NSAEmailVerificationPage.d.ts +1 -1
- package/dist/pages/NSAHomePage.d.ts +1 -1
- package/dist/pages/NSAHomePage.js +1 -1
- package/dist/pages/NSAHomePage.js.map +1 -1
- package/dist/pages/NSAHomePage.module.css +41 -41
- package/dist/pages/NSALoginPage.d.ts +1 -1
- package/dist/pages/NSALoginPage.js +1 -1
- package/dist/pages/NSALoginPage.js.map +1 -1
- package/dist/pages/NSALoginPage.module.css +26 -26
- package/dist/pages/NSAPhoneVerificationPage.d.ts +1 -1
- package/dist/pages/NSAVerificationPage.d.ts +1 -1
- package/dist/pages/NSAVerificationPage.module.css +31 -31
- package/dist/pages/PaymentRequired.js +1 -1
- package/dist/pages/PaymentRequired.js.map +1 -1
- package/package.json +95 -95
- package/public/index.html +21 -21
- package/src/App.tsx +19 -19
- package/src/CTFRow.ts +7 -7
- package/src/FieldCacheService.tsx +1 -1
- package/src/IEntityInfo.ts +33 -33
- package/src/NSACacheService.ts +120 -120
- package/src/NSAFilterOperators.ts +92 -92
- package/src/NSARouterMaker.tsx +140 -140
- package/src/NSARouterMakerProps.ts +23 -23
- package/src/NSARouterMakerResult.ts +24 -24
- package/src/NSFRouterMaker.tsx +35 -35
- package/src/Router.tsx +48 -48
- package/src/UseParams.tsx +17 -17
- package/src/components/NSAAccessListDialog.module.css +71 -71
- package/src/components/NSAAccessListDialog.tsx +178 -178
- package/src/components/NSABoxSecret.module.css +23 -23
- package/src/components/NSABoxSecret.tsx +264 -264
- package/src/components/NSAMasterMenu.module.css +250 -250
- package/src/components/NSAMasterMenu.tsx +169 -169
- package/src/components/NSAMasterMenuItem.tsx +250 -250
- package/src/components/NSAMessageListDialog.module.css +99 -99
- package/src/components/NSAMessageListDialog.tsx +144 -142
- package/src/components/NSANavigationGuard.tsx +79 -79
- package/src/components/NSAProductListDialog.module.css +44 -44
- package/src/components/NSAProductListDialog.tsx +88 -88
- package/src/components/NSATable.tsx +494 -494
- package/src/components/NSATaskBar.module.css +57 -57
- package/src/components/NSATaskBar.tsx +193 -193
- package/src/components/NSAUserDialog.module.css +67 -67
- package/src/components/NSAUserDialog.tsx +122 -122
- package/src/components/NSAWorkspaceListDialog.module.css +41 -41
- package/src/components/NSAWorkspaceListDialog.tsx +147 -147
- package/src/components/NSFBoxCategoryScope.tsx +52 -52
- package/src/components/NSFBoxField.tsx +37 -37
- package/src/components/NSFBoxSlot.tsx +71 -71
- package/src/components/NSFBoxWrapper.tsx +69 -69
- package/src/components/NSLabelSecret.tsx +37 -37
- package/src/components/quickfilter/NSAFilterBoxBase.tsx +89 -89
- package/src/components/quickfilter/NSAFilterBoxBoolean.tsx +66 -66
- package/src/components/quickfilter/NSAFilterBoxDate.tsx +110 -110
- package/src/components/quickfilter/NSAFilterBoxDateTime.tsx +110 -110
- package/src/components/quickfilter/NSAFilterBoxEnum.module.css +44 -44
- package/src/components/quickfilter/NSAFilterBoxEnum.tsx +79 -79
- package/src/components/quickfilter/NSAFilterBoxNumber.tsx +145 -145
- package/src/components/quickfilter/NSAFilterBoxString.tsx +83 -83
- package/src/components/quickfilter/NSAFilterBoxTime.tsx +106 -106
- package/src/components/quickfilter/NSAQuickFilterBar.module.css +19 -19
- package/src/components/quickfilter/NSAQuickFilterBar.tsx +142 -142
- package/src/components/quickfilter/NSAQuickFilterDialog.module.css +74 -74
- package/src/components/quickfilter/NSAQuickFilterDialog.tsx +260 -260
- package/src/css.d.ts +13 -13
- package/src/formatters/SecretFormatter.tsx +24 -24
- package/src/index.tsx +26 -26
- package/src/layouts/Actions.ts +146 -146
- package/src/layouts/CFTUtil.ts +18 -18
- package/src/layouts/NSALayout.tsx +744 -744
- package/src/layouts/NSASectionEdit.tsx +281 -281
- package/src/layouts/NSASectionEditTabPage.module.css +4 -4
- package/src/layouts/NSASectionEditTabPage.tsx +256 -256
- package/src/layouts/NSASectionList.module.css +31 -31
- package/src/layouts/NSASectionList.tsx +165 -166
- package/src/layouts/NSASectionView.tsx +98 -98
- package/src/layouts/NSASectionViewTabMore.tsx +78 -78
- package/src/layouts/NSASectionViewTabPage.module.css +47 -47
- package/src/layouts/NSASectionViewTabPage.tsx +400 -400
- package/src/main.ts +52 -52
- package/src/pages/NSAConsentPage.module.css +26 -26
- package/src/pages/NSAConsentPage.tsx +120 -120
- package/src/pages/NSAEmailVerificationPage.tsx +30 -30
- package/src/pages/NSAHomePage.module.css +41 -41
- package/src/pages/NSAHomePage.tsx +113 -113
- package/src/pages/NSALoginPage.module.css +26 -26
- package/src/pages/NSALoginPage.tsx +87 -87
- package/src/pages/NSAPhoneVerificationPage.tsx +94 -94
- package/src/pages/NSAVerificationPage.module.css +31 -31
- package/src/pages/NSAVerificationPage.tsx +185 -185
- package/src/pages/PaymentRequired.tsx +80 -80
- package/tsconfig.json +43 -43
|
@@ -1,167 +1,166 @@
|
|
|
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
|
-
getChildrenBefore?: (id: string, row: RowType | null) => ReactNode;
|
|
17
|
-
getChildrenAfter?: (id: string, row: RowType | null) => ReactNode;
|
|
18
|
-
};
|
|
19
|
-
onIDsChanged?: () => void;
|
|
20
|
-
children?: React.ReactNode;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface NSASectionListProps<RowType extends { id: string }, RowTypeInput = RowType> extends IBaseComponentProps, NSARouterMakerResult, NSASectionListCustomProps<RowType, RowTypeInput>
|
|
24
|
-
{
|
|
25
|
-
entity: IEntityInfo<RowType, RowTypeInput>;
|
|
26
|
-
ctf: {
|
|
27
|
-
enabled: boolean;
|
|
28
|
-
rows: EntityResolveResponseRow | null;
|
|
29
|
-
};
|
|
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
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
let
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
this.props.ui?.getChildrenBefore
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
{
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
this.props.ui?.getChildrenAfter
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
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
|
+
getChildrenBefore?: (id: string, row: RowType | null) => ReactNode;
|
|
17
|
+
getChildrenAfter?: (id: string, row: RowType | null) => ReactNode;
|
|
18
|
+
};
|
|
19
|
+
onIDsChanged?: () => void;
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface NSASectionListProps<RowType extends { id: string }, RowTypeInput = RowType> extends IBaseComponentProps, NSARouterMakerResult, NSASectionListCustomProps<RowType, RowTypeInput>
|
|
24
|
+
{
|
|
25
|
+
entity: IEntityInfo<RowType, RowTypeInput>;
|
|
26
|
+
ctf: {
|
|
27
|
+
enabled: boolean;
|
|
28
|
+
rows: EntityResolveResponseRow | null;
|
|
29
|
+
};
|
|
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
|
+
onChanged={e =>
|
|
114
|
+
{
|
|
115
|
+
this.setState({ mode: e.getValueOne(false) ?? "" });
|
|
116
|
+
}}
|
|
117
|
+
/>
|
|
118
|
+
</div>
|
|
119
|
+
</NSRow>
|
|
120
|
+
<NSSpace size={NSSpaceSizeType.MINI} />
|
|
121
|
+
</>
|
|
122
|
+
}
|
|
123
|
+
{
|
|
124
|
+
show_view ?
|
|
125
|
+
<NSSplitter
|
|
126
|
+
storage_key={`ns-splitter-product:${this.props.entity.product_id}-entity:${this.props.entity.name}-height`}
|
|
127
|
+
master_content={mode_current.getChild(this.props.entity)}
|
|
128
|
+
detail_content={
|
|
129
|
+
(() =>
|
|
130
|
+
{
|
|
131
|
+
let _id = this.getSelectedIDs()[0];
|
|
132
|
+
let _row = this.getSelectedRows()[0];
|
|
133
|
+
|
|
134
|
+
if (this.state.selected_row_ids.length === 1)
|
|
135
|
+
return <>
|
|
136
|
+
{
|
|
137
|
+
this.props.ui?.getChildrenBefore &&
|
|
138
|
+
this.props.ui?.getChildrenBefore(_id, _row)
|
|
139
|
+
}
|
|
140
|
+
<NSASectionViewTabPage<RowType, RowTypeInput>
|
|
141
|
+
key={this.state.selected_row_ids[0]}
|
|
142
|
+
ref={this.NSASectionViewTabPage_Ref}
|
|
143
|
+
{...this.props}
|
|
144
|
+
ui={this.props.ui?.tab_page_view}
|
|
145
|
+
model={{
|
|
146
|
+
id: _id,
|
|
147
|
+
row: _row
|
|
148
|
+
}}
|
|
149
|
+
/>
|
|
150
|
+
{
|
|
151
|
+
this.props.ui?.getChildrenAfter &&
|
|
152
|
+
this.props.ui?.getChildrenAfter(_id, _row)
|
|
153
|
+
}
|
|
154
|
+
</>;
|
|
155
|
+
return <></>;
|
|
156
|
+
})()
|
|
157
|
+
}
|
|
158
|
+
/> :
|
|
159
|
+
mode_current.getChild(this.props.entity)
|
|
160
|
+
}
|
|
161
|
+
</div>
|
|
162
|
+
{this.props.children}
|
|
163
|
+
</>
|
|
164
|
+
);
|
|
165
|
+
}
|
|
167
166
|
}
|
|
@@ -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
|
|
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 title="Loading row item ..." />;
|
|
98
|
+
}
|
|
99
99
|
}
|