namirasoft-account-react 1.4.430 → 1.4.431

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 (124) 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.css +32 -0
  5. package/dist/App.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/NSAMasterMenu.d.ts +1 -1
  10. package/dist/components/NSAMasterMenu.module.css +248 -248
  11. package/dist/components/NSAMasterMenuItem.d.ts +1 -1
  12. package/dist/components/NSAMessageListDialog.d.ts +1 -1
  13. package/dist/components/NSAMessageListDialog.module.css +99 -99
  14. package/dist/components/NSAProductListDialog.d.ts +1 -1
  15. package/dist/components/NSAProductListDialog.module.css +44 -44
  16. package/dist/components/NSAReorderDialog.d.ts +1 -1
  17. package/dist/components/NSAReorderDialog.module.css +49 -49
  18. package/dist/components/NSASortDialog.d.ts +1 -1
  19. package/dist/components/NSAUserDialog.d.ts +1 -1
  20. package/dist/components/NSAUserDialog.module.css +67 -67
  21. package/dist/components/NSAWorkspaceListDialog.d.ts +1 -1
  22. package/dist/components/NSAWorkspaceListDialog.module.css +41 -41
  23. package/dist/components/NSBoxSecret.d.ts +1 -1
  24. package/dist/components/NSBoxSecret.module.css +23 -23
  25. package/dist/components/NSLabelSecret.d.ts +1 -1
  26. package/dist/components/quickfilter/NSAFilterBoxEnum.module.css +45 -0
  27. package/dist/components/quickfilter/NSAQuickFilterBar.d.ts +1 -1
  28. package/dist/components/quickfilter/NSAQuickFilterBar.module.css +20 -0
  29. package/dist/components/quickfilter/NSAQuickFilterDialog.d.ts +1 -1
  30. package/dist/components/quickfilter/NSAQuickFilterDialog.module.css +75 -0
  31. package/dist/index.css +0 -0
  32. package/dist/layouts/NSALayout.d.ts +1 -1
  33. package/dist/layouts/NSASectionEdit.d.ts +1 -1
  34. package/dist/layouts/NSASectionEditTabPage.d.ts +1 -1
  35. package/dist/layouts/NSASectionEditTabPage.module.css +4 -4
  36. package/dist/layouts/NSASectionList.d.ts +1 -1
  37. package/dist/layouts/NSASectionList.module.css +31 -31
  38. package/dist/layouts/NSASectionView.d.ts +1 -1
  39. package/dist/layouts/NSASectionViewTabMore.d.ts +1 -1
  40. package/dist/layouts/NSASectionViewTabPage.d.ts +1 -1
  41. package/dist/layouts/NSASectionViewTabPage.module.css +47 -47
  42. package/dist/pages/NSAConsentPage.module.css +26 -26
  43. package/dist/pages/NSAEmailVerificationPage.d.ts +1 -1
  44. package/dist/pages/NSAHomePage.d.ts +1 -1
  45. package/dist/pages/NSAHomePage.module.css +41 -41
  46. package/dist/pages/NSALoginPage.d.ts +1 -1
  47. package/dist/pages/NSALoginPage.module.css +26 -26
  48. package/dist/pages/NSAPhoneVerificationPage.d.ts +1 -1
  49. package/dist/pages/NSAVerificationPage.d.ts +1 -1
  50. package/dist/pages/NSAVerificationPage.module.css +31 -31
  51. package/package.json +94 -94
  52. package/public/index.html +21 -21
  53. package/src/App.css +31 -31
  54. package/src/App.tsx +19 -19
  55. package/src/CTFRow.ts +7 -7
  56. package/src/IEntityInfo.ts +33 -33
  57. package/src/NSACacheService.ts +120 -120
  58. package/src/NSAFilterOperators.ts +92 -92
  59. package/src/NSARouterMaker.tsx +139 -139
  60. package/src/NSARouterMakerConfig.ts +15 -15
  61. package/src/NSARouterMakerProps.ts +22 -22
  62. package/src/Router.tsx +45 -45
  63. package/src/UseParams.tsx +18 -18
  64. package/src/components/NSAAccessListDialog.module.css +71 -71
  65. package/src/components/NSAAccessListDialog.tsx +178 -178
  66. package/src/components/NSAMasterMenu.module.css +248 -248
  67. package/src/components/NSAMasterMenu.tsx +169 -169
  68. package/src/components/NSAMasterMenuItem.tsx +250 -250
  69. package/src/components/NSAMessageListDialog.module.css +99 -99
  70. package/src/components/NSAMessageListDialog.tsx +141 -141
  71. package/src/components/NSAProductListDialog.module.css +44 -44
  72. package/src/components/NSAProductListDialog.tsx +88 -88
  73. package/src/components/NSAReorderDialog.module.css +49 -49
  74. package/src/components/NSAReorderDialog.tsx +149 -149
  75. package/src/components/NSASortDialog.tsx +117 -117
  76. package/src/components/NSATable.tsx +489 -489
  77. package/src/components/NSAUserDialog.module.css +67 -67
  78. package/src/components/NSAUserDialog.tsx +122 -122
  79. package/src/components/NSAWorkspaceListDialog.module.css +41 -41
  80. package/src/components/NSAWorkspaceListDialog.tsx +147 -147
  81. package/src/components/NSBoxSecret.module.css +23 -23
  82. package/src/components/NSBoxSecret.tsx +258 -258
  83. package/src/components/NSLabelSecret.tsx +37 -37
  84. package/src/components/quickfilter/NSAFilterBoxBase.tsx +55 -55
  85. package/src/components/quickfilter/NSAFilterBoxBoolean.tsx +54 -54
  86. package/src/components/quickfilter/NSAFilterBoxDate.tsx +104 -104
  87. package/src/components/quickfilter/NSAFilterBoxDateTime.tsx +105 -105
  88. package/src/components/quickfilter/NSAFilterBoxEnum.module.css +44 -44
  89. package/src/components/quickfilter/NSAFilterBoxEnum.tsx +79 -79
  90. package/src/components/quickfilter/NSAFilterBoxNumber.tsx +136 -136
  91. package/src/components/quickfilter/NSAFilterBoxString.tsx +81 -81
  92. package/src/components/quickfilter/NSAFilterBoxTime.tsx +101 -101
  93. package/src/components/quickfilter/NSAQuickFilterBar.module.css +19 -19
  94. package/src/components/quickfilter/NSAQuickFilterBar.tsx +114 -114
  95. package/src/components/quickfilter/NSAQuickFilterDialog.module.css +74 -74
  96. package/src/components/quickfilter/NSAQuickFilterDialog.tsx +260 -260
  97. package/src/css.d.ts +13 -13
  98. package/src/formatters/SecretFormatter.tsx +24 -24
  99. package/src/index.tsx +24 -24
  100. package/src/layouts/Actions.ts +145 -145
  101. package/src/layouts/CFTUtil.ts +18 -18
  102. package/src/layouts/NSALayout.tsx +841 -841
  103. package/src/layouts/NSASectionEdit.tsx +260 -260
  104. package/src/layouts/NSASectionEditTabPage.module.css +4 -4
  105. package/src/layouts/NSASectionEditTabPage.tsx +250 -250
  106. package/src/layouts/NSASectionList.module.css +31 -31
  107. package/src/layouts/NSASectionList.tsx +149 -149
  108. package/src/layouts/NSASectionView.tsx +100 -100
  109. package/src/layouts/NSASectionViewTabMore.tsx +77 -77
  110. package/src/layouts/NSASectionViewTabPage.module.css +47 -47
  111. package/src/layouts/NSASectionViewTabPage.tsx +419 -419
  112. package/src/main.ts +46 -46
  113. package/src/pages/NSAConsentPage.module.css +26 -26
  114. package/src/pages/NSAConsentPage.tsx +120 -120
  115. package/src/pages/NSAEmailVerificationPage.tsx +30 -30
  116. package/src/pages/NSAHomePage.module.css +41 -41
  117. package/src/pages/NSAHomePage.tsx +102 -102
  118. package/src/pages/NSALoginPage.module.css +26 -26
  119. package/src/pages/NSALoginPage.tsx +87 -87
  120. package/src/pages/NSAPhoneVerificationPage.tsx +94 -94
  121. package/src/pages/NSAVerificationPage.module.css +31 -31
  122. package/src/pages/NSAVerificationPage.tsx +186 -186
  123. package/src/pages/PaymentRequired.tsx +74 -74
  124. package/tsconfig.json +43 -43
@@ -1,261 +1,261 @@
1
- import { FilterItemOperator } from "namirasoft-core";
2
- import { VariableType } from "namirasoft-schema";
3
- import { NSBoxBaseCombo, NSBoxCombo, NSButton, NSButtonBlue, NSColumn, NSDialog, NSNoData, NSTitle, TableColumnInfo } from "namirasoft-site-react";
4
- import { Component, Fragment } from "react";
5
- import { NSAFilterOperators } from "../../NSAFilterOperators";
6
- import Styles from "./NSAQuickFilterDialog.module.css";
7
-
8
- export interface QuickFilterConfig
9
- {
10
- id: string;
11
- column: {
12
- table: { name: string; text: string };
13
- name: string;
14
- text: string;
15
- type: string;
16
- columnType: VariableType;
17
- };
18
- operatorName?: string;
19
- }
20
-
21
- interface NSAQuickFilterDialogProps
22
- {
23
- configs: QuickFilterConfig[];
24
- getColumns: () => TableColumnInfo[];
25
- typeConverter: (type: string) => VariableType;
26
- onSave: (configs: QuickFilterConfig[]) => void;
27
- onConfirm: (configs: QuickFilterConfig[]) => void;
28
- onClose: () => void;
29
- }
30
-
31
- interface NSAQuickFilterDialogState
32
- {
33
- configs: QuickFilterConfig[];
34
- formMode: "add" | "edit" | null;
35
- editingId: string | null;
36
- formColumn: TableColumnInfo | null;
37
- formOperatorName: string | null;
38
- formKey: number;
39
- }
40
-
41
- export class NSAQuickFilterDialog extends Component<NSAQuickFilterDialogProps, NSAQuickFilterDialogState>
42
- {
43
- constructor(props: NSAQuickFilterDialogProps)
44
- {
45
- super(props);
46
- this.state = {
47
- configs: [...props.configs],
48
- formMode: null,
49
- editingId: null,
50
- formColumn: null,
51
- formOperatorName: null,
52
- formKey: 0,
53
- };
54
- }
55
-
56
- private openAdd = () =>
57
- {
58
- this.setState(prev => ({
59
- formMode: "add",
60
- editingId: null,
61
- formColumn: null,
62
- formOperatorName: null,
63
- formKey: prev.formKey + 1,
64
- }));
65
- };
66
-
67
- private openEdit = (config: QuickFilterConfig) =>
68
- {
69
- const col = this.props.getColumns().find(
70
- c => c.table.name === config.column.table.name && c.name === config.column.name
71
- ) ?? null;
72
- this.setState(prev => ({
73
- formMode: "edit",
74
- editingId: config.id,
75
- formColumn: col,
76
- formOperatorName: config.operatorName ?? null,
77
- formKey: prev.formKey + 1,
78
- }));
79
- };
80
-
81
- private deleteConfig = (id: string) =>
82
- {
83
- this.setState(prev => ({ configs: prev.configs.filter(c => c.id !== id) }));
84
- };
85
-
86
- private hasChanges(): boolean
87
- {
88
- return JSON.stringify(this.state.configs) !== JSON.stringify(this.props.configs);
89
- }
90
-
91
- private saveForm = () =>
92
- {
93
- const { formColumn, formOperatorName, formMode, editingId, configs } = this.state;
94
- if (!formColumn) return;
95
-
96
- const columnType = this.props.typeConverter(formColumn.type);
97
- const isBoolean = columnType === VariableType.Boolean;
98
-
99
- const newConfig: QuickFilterConfig = {
100
- id: formMode === "edit" && editingId ? editingId : crypto.randomUUID(),
101
- column: {
102
- table: { name: formColumn.table.name, text: formColumn.table.text },
103
- name: formColumn.name,
104
- text: formColumn.text,
105
- type: formColumn.type,
106
- columnType,
107
- },
108
- operatorName: isBoolean ? undefined : (formOperatorName ?? undefined),
109
- };
110
-
111
- const updatedConfigs = formMode === "edit" && editingId
112
- ? configs.map(c => c.id === editingId ? newConfig : c)
113
- : [...configs, newConfig];
114
-
115
- this.setState({ configs: updatedConfigs, formMode: null }, () =>
116
- {
117
- this.props.onSave(updatedConfigs);
118
- });
119
- };
120
-
121
- override render()
122
- {
123
- const { onClose, onConfirm, getColumns, typeConverter } = this.props;
124
- const { configs, formMode, formColumn, formOperatorName, formKey } = this.state;
125
-
126
- const columns = getColumns();
127
- const columnType = formColumn ? typeConverter(formColumn.type) : null;
128
- const isBoolean = columnType === VariableType.Boolean;
129
- const operators = columnType && !isBoolean ? NSAFilterOperators.getQuickFilterOperators(columnType) : [];
130
-
131
- return (
132
- <NSDialog
133
- center_dialog
134
- closeButton={{ show: true }}
135
- onClose={onClose}
136
- >
137
- <NSColumn classList={["align-items-center"]}>
138
- <NSTitle
139
- title="Quick Filters"
140
- style={{ marginBottom: 0, fontSize: 24 }}
141
- />
142
-
143
- {
144
- configs.length === 0 && !formMode &&
145
- <NSNoData lable="No quick filters defined" style={{ marginBottom: 16, fontSize: 20 }} />
146
- }
147
-
148
- {
149
- configs.length > 0 && !formMode && (
150
- <NSColumn classList={["gap-2"]}>
151
- {
152
- configs.map(cfg =>
153
- {
154
- const opLabel = cfg.operatorName
155
- ? FilterItemOperator.getByName(cfg.operatorName).name
156
- : "—";
157
- return (
158
- <div key={cfg.id} className={Styles.qf_item}>
159
- <div className={Styles.qf_item_info}>
160
- <span className={Styles.qf_item_label}>{cfg.column.text}</span>
161
- <span className={Styles.qf_item_op}>{opLabel}</span>
162
- </div>
163
- <div className={Styles.qf_item_actions}>
164
- <NSButton
165
- title=""
166
- icon={{ src: "https://static.namirasoft.com/image/concept/edit/blue.svg", alt: "edit" }}
167
- classList={[Styles.qf_item_btn]}
168
- onClick={{ action: () => this.openEdit(cfg), showLoading: false }}
169
- />
170
- <NSButton
171
- title=""
172
- icon={{ src: "https://static.namirasoft.com/image/concept/delete/blue.svg", alt: "delete" }}
173
- classList={[Styles.qf_item_btn]}
174
- onClick={{ action: () => this.deleteConfig(cfg.id), showLoading: false }}
175
- />
176
- </div>
177
- </div>
178
- );
179
- })
180
- }
181
- </NSColumn>
182
- )
183
- }
184
-
185
- {
186
- formMode &&
187
- <Fragment key={formKey}>
188
- <NSBoxBaseCombo<TableColumnInfo>
189
- title="Column"
190
- required
191
- defaultValue={formColumn?.name}
192
- getItems={async () => ({ count: columns.length, rows: columns })}
193
- getTitle={c => c.text}
194
- getValue={c => c.name}
195
- getSort={() => null}
196
- multiple={false}
197
- onChanged={e =>
198
- {
199
- const col = e.getDataOne();
200
- this.setState({ formColumn: col ?? null, formOperatorName: null });
201
- }}
202
- menu={{
203
- builtin: {
204
- copy: { enabled: false, getValue: () => "" }
205
- },
206
- items: []
207
- }}
208
- />
209
- <NSBoxCombo
210
- key={formColumn?.name}
211
- title="Operator"
212
- required
213
- disabled={!formColumn || isBoolean}
214
- defaultValue={formOperatorName ?? undefined}
215
- getOptions={() => operators.map(op => ({ value: NSAFilterOperators.getOperatorKey(op), title: `${op.sign} (${op.name})` }))}
216
- multiple={false}
217
- searchable={false}
218
- onChanged={e => this.setState({ formOperatorName: e.getValueOne(false) ?? null })}
219
- menu={{
220
- builtin: {
221
- copy: { enabled: false, getValue: () => "" }
222
- },
223
- items: []
224
- }}
225
- />
226
- <NSButtonBlue
227
- title="Save"
228
- onClick={{ action: this.saveForm, showLoading: false }}
229
- />
230
- <NSButton
231
- title=""
232
- icon={{ src: "https://static.namirasoft.com/image/concept/arrow/left/blue.svg", alt: "back" }}
233
- classList={[Styles.qf_back_btn]}
234
- onClick={{ action: () => this.setState({ formMode: null }), showLoading: false }}
235
- style={{ width: 40, height: 40 }}
236
- />
237
- </Fragment>
238
- }
239
-
240
- {
241
- !formMode &&
242
- <>
243
- <NSButton
244
- title="+ Add Filter"
245
- onClick={{ action: this.openAdd, showLoading: false }}
246
- style={{ border: "1px solid #000" }}
247
- />
248
- {
249
- this.hasChanges() &&
250
- <NSButtonBlue
251
- title="Save Changes"
252
- onClick={{ action: () => onConfirm(this.state.configs), showLoading: false }}
253
- />
254
- }
255
- </>
256
- }
257
- </NSColumn>
258
- </NSDialog>
259
- );
260
- }
1
+ import { FilterItemOperator } from "namirasoft-core";
2
+ import { VariableType } from "namirasoft-schema";
3
+ import { NSBoxBaseCombo, NSBoxCombo, NSButton, NSButtonBlue, NSColumn, NSDialog, NSNoData, NSTitle, TableColumnInfo } from "namirasoft-site-react";
4
+ import { Component, Fragment } from "react";
5
+ import { NSAFilterOperators } from "../../NSAFilterOperators";
6
+ import Styles from "./NSAQuickFilterDialog.module.css";
7
+
8
+ export interface QuickFilterConfig
9
+ {
10
+ id: string;
11
+ column: {
12
+ table: { name: string; text: string };
13
+ name: string;
14
+ text: string;
15
+ type: string;
16
+ columnType: VariableType;
17
+ };
18
+ operatorName?: string;
19
+ }
20
+
21
+ interface NSAQuickFilterDialogProps
22
+ {
23
+ configs: QuickFilterConfig[];
24
+ getColumns: () => TableColumnInfo[];
25
+ typeConverter: (type: string) => VariableType;
26
+ onSave: (configs: QuickFilterConfig[]) => void;
27
+ onConfirm: (configs: QuickFilterConfig[]) => void;
28
+ onClose: () => void;
29
+ }
30
+
31
+ interface NSAQuickFilterDialogState
32
+ {
33
+ configs: QuickFilterConfig[];
34
+ formMode: "add" | "edit" | null;
35
+ editingId: string | null;
36
+ formColumn: TableColumnInfo | null;
37
+ formOperatorName: string | null;
38
+ formKey: number;
39
+ }
40
+
41
+ export class NSAQuickFilterDialog extends Component<NSAQuickFilterDialogProps, NSAQuickFilterDialogState>
42
+ {
43
+ constructor(props: NSAQuickFilterDialogProps)
44
+ {
45
+ super(props);
46
+ this.state = {
47
+ configs: [...props.configs],
48
+ formMode: null,
49
+ editingId: null,
50
+ formColumn: null,
51
+ formOperatorName: null,
52
+ formKey: 0,
53
+ };
54
+ }
55
+
56
+ private openAdd = () =>
57
+ {
58
+ this.setState(prev => ({
59
+ formMode: "add",
60
+ editingId: null,
61
+ formColumn: null,
62
+ formOperatorName: null,
63
+ formKey: prev.formKey + 1,
64
+ }));
65
+ };
66
+
67
+ private openEdit = (config: QuickFilterConfig) =>
68
+ {
69
+ const col = this.props.getColumns().find(
70
+ c => c.table.name === config.column.table.name && c.name === config.column.name
71
+ ) ?? null;
72
+ this.setState(prev => ({
73
+ formMode: "edit",
74
+ editingId: config.id,
75
+ formColumn: col,
76
+ formOperatorName: config.operatorName ?? null,
77
+ formKey: prev.formKey + 1,
78
+ }));
79
+ };
80
+
81
+ private deleteConfig = (id: string) =>
82
+ {
83
+ this.setState(prev => ({ configs: prev.configs.filter(c => c.id !== id) }));
84
+ };
85
+
86
+ private hasChanges(): boolean
87
+ {
88
+ return JSON.stringify(this.state.configs) !== JSON.stringify(this.props.configs);
89
+ }
90
+
91
+ private saveForm = () =>
92
+ {
93
+ const { formColumn, formOperatorName, formMode, editingId, configs } = this.state;
94
+ if (!formColumn) return;
95
+
96
+ const columnType = this.props.typeConverter(formColumn.type);
97
+ const isBoolean = columnType === VariableType.Boolean;
98
+
99
+ const newConfig: QuickFilterConfig = {
100
+ id: formMode === "edit" && editingId ? editingId : crypto.randomUUID(),
101
+ column: {
102
+ table: { name: formColumn.table.name, text: formColumn.table.text },
103
+ name: formColumn.name,
104
+ text: formColumn.text,
105
+ type: formColumn.type,
106
+ columnType,
107
+ },
108
+ operatorName: isBoolean ? undefined : (formOperatorName ?? undefined),
109
+ };
110
+
111
+ const updatedConfigs = formMode === "edit" && editingId
112
+ ? configs.map(c => c.id === editingId ? newConfig : c)
113
+ : [...configs, newConfig];
114
+
115
+ this.setState({ configs: updatedConfigs, formMode: null }, () =>
116
+ {
117
+ this.props.onSave(updatedConfigs);
118
+ });
119
+ };
120
+
121
+ override render()
122
+ {
123
+ const { onClose, onConfirm, getColumns, typeConverter } = this.props;
124
+ const { configs, formMode, formColumn, formOperatorName, formKey } = this.state;
125
+
126
+ const columns = getColumns();
127
+ const columnType = formColumn ? typeConverter(formColumn.type) : null;
128
+ const isBoolean = columnType === VariableType.Boolean;
129
+ const operators = columnType && !isBoolean ? NSAFilterOperators.getQuickFilterOperators(columnType) : [];
130
+
131
+ return (
132
+ <NSDialog
133
+ center_dialog
134
+ closeButton={{ show: true }}
135
+ onClose={onClose}
136
+ >
137
+ <NSColumn classList={["align-items-center"]}>
138
+ <NSTitle
139
+ title="Quick Filters"
140
+ style={{ marginBottom: 0, fontSize: 24 }}
141
+ />
142
+
143
+ {
144
+ configs.length === 0 && !formMode &&
145
+ <NSNoData lable="No quick filters defined" style={{ marginBottom: 16, fontSize: 20 }} />
146
+ }
147
+
148
+ {
149
+ configs.length > 0 && !formMode && (
150
+ <NSColumn classList={["gap-2"]}>
151
+ {
152
+ configs.map(cfg =>
153
+ {
154
+ const opLabel = cfg.operatorName
155
+ ? FilterItemOperator.getByName(cfg.operatorName).name
156
+ : "—";
157
+ return (
158
+ <div key={cfg.id} className={Styles.qf_item}>
159
+ <div className={Styles.qf_item_info}>
160
+ <span className={Styles.qf_item_label}>{cfg.column.text}</span>
161
+ <span className={Styles.qf_item_op}>{opLabel}</span>
162
+ </div>
163
+ <div className={Styles.qf_item_actions}>
164
+ <NSButton
165
+ title=""
166
+ icon={{ src: "https://static.namirasoft.com/image/concept/edit/blue.svg", alt: "edit" }}
167
+ classList={[Styles.qf_item_btn]}
168
+ onClick={{ action: () => this.openEdit(cfg), showLoading: false }}
169
+ />
170
+ <NSButton
171
+ title=""
172
+ icon={{ src: "https://static.namirasoft.com/image/concept/delete/blue.svg", alt: "delete" }}
173
+ classList={[Styles.qf_item_btn]}
174
+ onClick={{ action: () => this.deleteConfig(cfg.id), showLoading: false }}
175
+ />
176
+ </div>
177
+ </div>
178
+ );
179
+ })
180
+ }
181
+ </NSColumn>
182
+ )
183
+ }
184
+
185
+ {
186
+ formMode &&
187
+ <Fragment key={formKey}>
188
+ <NSBoxBaseCombo<TableColumnInfo>
189
+ title="Column"
190
+ required
191
+ defaultValue={formColumn?.name}
192
+ getItems={async () => ({ count: columns.length, rows: columns })}
193
+ getTitle={c => c.text}
194
+ getValue={c => c.name}
195
+ getSort={() => null}
196
+ multiple={false}
197
+ onChanged={e =>
198
+ {
199
+ const col = e.getDataOne();
200
+ this.setState({ formColumn: col ?? null, formOperatorName: null });
201
+ }}
202
+ menu={{
203
+ builtin: {
204
+ copy: { enabled: false, getValue: () => "" }
205
+ },
206
+ items: []
207
+ }}
208
+ />
209
+ <NSBoxCombo
210
+ key={formColumn?.name}
211
+ title="Operator"
212
+ required
213
+ disabled={!formColumn || isBoolean}
214
+ defaultValue={formOperatorName ?? undefined}
215
+ getOptions={() => operators.map(op => ({ value: NSAFilterOperators.getOperatorKey(op), title: `${op.sign} (${op.name})` }))}
216
+ multiple={false}
217
+ searchable={false}
218
+ onChanged={e => this.setState({ formOperatorName: e.getValueOne(false) ?? null })}
219
+ menu={{
220
+ builtin: {
221
+ copy: { enabled: false, getValue: () => "" }
222
+ },
223
+ items: []
224
+ }}
225
+ />
226
+ <NSButtonBlue
227
+ title="Save"
228
+ onClick={{ action: this.saveForm, showLoading: false }}
229
+ />
230
+ <NSButton
231
+ title=""
232
+ icon={{ src: "https://static.namirasoft.com/image/concept/arrow/left/blue.svg", alt: "back" }}
233
+ classList={[Styles.qf_back_btn]}
234
+ onClick={{ action: () => this.setState({ formMode: null }), showLoading: false }}
235
+ style={{ width: 40, height: 40 }}
236
+ />
237
+ </Fragment>
238
+ }
239
+
240
+ {
241
+ !formMode &&
242
+ <>
243
+ <NSButton
244
+ title="+ Add Filter"
245
+ onClick={{ action: this.openAdd, showLoading: false }}
246
+ style={{ border: "1px solid #000" }}
247
+ />
248
+ {
249
+ this.hasChanges() &&
250
+ <NSButtonBlue
251
+ title="Save Changes"
252
+ onClick={{ action: () => onConfirm(this.state.configs), showLoading: false }}
253
+ />
254
+ }
255
+ </>
256
+ }
257
+ </NSColumn>
258
+ </NSDialog>
259
+ );
260
+ }
261
261
  }
package/src/css.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- let css_d = "";
2
-
3
- declare module "*.module.css" {
4
- const classes: { readonly [key: string]: string };
5
- export default classes;
6
- }
7
-
8
- declare module "*.module.scss" {
9
- const classes: { readonly [key: string]: string };
10
- export default classes;
11
- }
12
-
13
- declare module "*.css";
1
+ let css_d = "";
2
+
3
+ declare module "*.module.css" {
4
+ const classes: { readonly [key: string]: string };
5
+ export default classes;
6
+ }
7
+
8
+ declare module "*.module.scss" {
9
+ const classes: { readonly [key: string]: string };
10
+ export default classes;
11
+ }
12
+
13
+ declare module "*.css";
14
14
  declare module "*.scss";
@@ -1,25 +1,25 @@
1
- import { NamirasoftSecretServer } from "namirasoft-secret";
2
- import { BaseColumnFormatter, SensitiveFormatter, TableColumnInfo, TableRowInfo } from "namirasoft-site-react";
3
-
4
- export class SecretFormatter<RowType = any> extends BaseColumnFormatter
5
- {
6
- private sensitive_formatter;
7
- public decryptor?: (value: string) => Promise<string>;
8
- constructor(public server: NamirasoftSecretServer, public isSensitive: (col: TableColumnInfo, row: TableRowInfo<RowType>) => boolean, width: string = "240px")
9
- {
10
- super();
11
- this.width = width;
12
- let decryptor_secret = async (value: string) =>
13
- {
14
- let decrypted = await this.server.secret.GetValue(value);
15
- if (this.decryptor)
16
- decrypted = await this.decryptor(decrypted);
17
- return decrypted;
18
- };
19
- this.sensitive_formatter = new SensitiveFormatter(decryptor_secret, this.isSensitive, this.width);
20
- }
21
- override format(value: any, col: TableColumnInfo, row: TableRowInfo<RowType>, printable: boolean): any
22
- {
23
- return this.sensitive_formatter.format(value, col, row, printable);
24
- }
1
+ import { NamirasoftSecretServer } from "namirasoft-secret";
2
+ import { BaseColumnFormatter, SensitiveFormatter, TableColumnInfo, TableRowInfo } from "namirasoft-site-react";
3
+
4
+ export class SecretFormatter<RowType = any> extends BaseColumnFormatter
5
+ {
6
+ private sensitive_formatter;
7
+ public decryptor?: (value: string) => Promise<string>;
8
+ constructor(public server: NamirasoftSecretServer, public isSensitive: (col: TableColumnInfo, row: TableRowInfo<RowType>) => boolean, width: string = "240px")
9
+ {
10
+ super();
11
+ this.width = width;
12
+ let decryptor_secret = async (value: string) =>
13
+ {
14
+ let decrypted = await this.server.secret.GetValue(value);
15
+ if (this.decryptor)
16
+ decrypted = await this.decryptor(decrypted);
17
+ return decrypted;
18
+ };
19
+ this.sensitive_formatter = new SensitiveFormatter(decryptor_secret, this.isSensitive, this.width);
20
+ }
21
+ override format(value: any, col: TableColumnInfo, row: TableRowInfo<RowType>, printable: boolean): any
22
+ {
23
+ return this.sensitive_formatter.format(value, col, row, printable);
24
+ }
25
25
  }
package/src/index.tsx CHANGED
@@ -1,25 +1,25 @@
1
- import ReactDOM from "react-dom/client";
2
- import Router from "./Router";
3
- import { BrowserRouter } from "react-router-dom";
4
- import 'bootstrap/dist/css/bootstrap.min.css';
5
- import "./index.css";
6
-
7
- const root = ReactDOM.createRoot(
8
- document.getElementById("root") as HTMLElement
9
- );
10
-
11
- // base
12
- const REACT_APP_BASE_PATH = process.env.REACT_APP_BASE_PATH;
13
- if (REACT_APP_BASE_PATH)
14
- {
15
- const baseElement = document.createElement('base');
16
- baseElement.href = REACT_APP_BASE_PATH + "/";
17
- const head = document.querySelector('head');
18
- head?.appendChild(baseElement);
19
- }
20
-
21
- root.render(
22
- <BrowserRouter>
23
- <Router />
24
- </BrowserRouter>
1
+ import ReactDOM from "react-dom/client";
2
+ import Router from "./Router";
3
+ import { BrowserRouter } from "react-router-dom";
4
+ import 'bootstrap/dist/css/bootstrap.min.css';
5
+ import "./index.css";
6
+
7
+ const root = ReactDOM.createRoot(
8
+ document.getElementById("root") as HTMLElement
9
+ );
10
+
11
+ // base
12
+ const REACT_APP_BASE_PATH = process.env.REACT_APP_BASE_PATH;
13
+ if (REACT_APP_BASE_PATH)
14
+ {
15
+ const baseElement = document.createElement('base');
16
+ baseElement.href = REACT_APP_BASE_PATH + "/";
17
+ const head = document.querySelector('head');
18
+ head?.appendChild(baseElement);
19
+ }
20
+
21
+ root.render(
22
+ <BrowserRouter>
23
+ <Router />
24
+ </BrowserRouter>
25
25
  );