namirasoft-account-react 1.5.20 → 1.5.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/.env.template +15 -15
  2. package/SKILL.md +514 -514
  3. package/config-overrides.js +72 -72
  4. package/dist/App.d.ts +1 -1
  5. package/dist/Router.d.ts +1 -1
  6. package/dist/UseParams.d.ts +1 -1
  7. package/dist/components/NSAAccessListDialog.d.ts +2 -2
  8. package/dist/components/NSAAccessListDialog.module.css +71 -71
  9. package/dist/components/NSABoxSecret.d.ts +1 -1
  10. package/dist/components/NSABoxSecret.module.css +23 -23
  11. package/dist/components/NSAMasterMenu.d.ts +1 -1
  12. package/dist/components/NSAMasterMenu.module.css +250 -250
  13. package/dist/components/NSAMasterMenuItem.d.ts +1 -1
  14. package/dist/components/NSAMessageListDialog.d.ts +1 -1
  15. package/dist/components/NSAMessageListDialog.module.css +99 -99
  16. package/dist/components/NSANavigationGuard.d.ts +1 -1
  17. package/dist/components/NSAProductListDialog.d.ts +1 -1
  18. package/dist/components/NSAProductListDialog.module.css +44 -44
  19. package/dist/components/NSATaskBar.d.ts +1 -1
  20. package/dist/components/NSATaskBar.module.css +57 -57
  21. package/dist/components/NSAUserDialog.d.ts +1 -1
  22. package/dist/components/NSAUserDialog.module.css +67 -67
  23. package/dist/components/NSAWorkspaceListDialog.d.ts +1 -1
  24. package/dist/components/NSAWorkspaceListDialog.module.css +41 -41
  25. package/dist/components/NSFBoxCategoryScope.d.ts +1 -1
  26. package/dist/components/NSFBoxField.d.ts +1 -1
  27. package/dist/components/NSFBoxSlot.d.ts +1 -1
  28. package/dist/components/NSFBoxWrapper.d.ts +1 -1
  29. package/dist/components/NSLabelSecret.d.ts +1 -1
  30. package/dist/components/quickfilter/NSAFilterBoxEnum.module.css +44 -44
  31. package/dist/components/quickfilter/NSAQuickFilterBar.d.ts +1 -1
  32. package/dist/components/quickfilter/NSAQuickFilterBar.module.css +19 -19
  33. package/dist/components/quickfilter/NSAQuickFilterDialog.d.ts +1 -1
  34. package/dist/components/quickfilter/NSAQuickFilterDialog.module.css +74 -74
  35. package/dist/layouts/NSALayout.d.ts +1 -1
  36. package/dist/layouts/NSASectionEdit.d.ts +1 -1
  37. package/dist/layouts/NSASectionEditTabPage.d.ts +1 -1
  38. package/dist/layouts/NSASectionEditTabPage.module.css +4 -4
  39. package/dist/layouts/NSASectionList.d.ts +1 -1
  40. package/dist/layouts/NSASectionList.module.css +31 -31
  41. package/dist/layouts/NSASectionView.d.ts +1 -1
  42. package/dist/layouts/NSASectionViewTabMore.d.ts +1 -1
  43. package/dist/layouts/NSASectionViewTabPage.d.ts +1 -1
  44. package/dist/layouts/NSASectionViewTabPage.module.css +47 -47
  45. package/dist/pages/NSAConsentPage.module.css +26 -26
  46. package/dist/pages/NSAEmailVerificationPage.d.ts +1 -1
  47. package/dist/pages/NSAHomePage.d.ts +1 -1
  48. package/dist/pages/NSAHomePage.module.css +41 -41
  49. package/dist/pages/NSALoginPage.d.ts +1 -1
  50. package/dist/pages/NSALoginPage.module.css +26 -26
  51. package/dist/pages/NSAPhoneVerificationPage.d.ts +1 -1
  52. package/dist/pages/NSAVerificationPage.d.ts +1 -1
  53. package/dist/pages/NSAVerificationPage.module.css +31 -31
  54. package/package.json +95 -95
  55. package/public/index.html +21 -21
  56. package/src/App.tsx +19 -19
  57. package/src/CTFRow.ts +7 -7
  58. package/src/FieldCacheService.tsx +84 -84
  59. package/src/IEntityInfo.ts +33 -33
  60. package/src/NSACacheService.ts +120 -120
  61. package/src/NSAFilterOperators.ts +92 -92
  62. package/src/NSARouterMaker.tsx +140 -140
  63. package/src/NSARouterMakerProps.ts +23 -23
  64. package/src/NSARouterMakerResult.ts +24 -24
  65. package/src/NSFRouterMaker.tsx +35 -35
  66. package/src/NSFRouterProps.ts +7 -7
  67. package/src/NSFRoutes.ts +30 -30
  68. package/src/Router.tsx +48 -48
  69. package/src/UseParams.tsx +17 -17
  70. package/src/components/NSAAccessListDialog.module.css +71 -71
  71. package/src/components/NSAAccessListDialog.tsx +178 -178
  72. package/src/components/NSABoxSecret.module.css +23 -23
  73. package/src/components/NSABoxSecret.tsx +264 -264
  74. package/src/components/NSAMasterMenu.module.css +250 -250
  75. package/src/components/NSAMasterMenu.tsx +169 -169
  76. package/src/components/NSAMasterMenuItem.tsx +250 -250
  77. package/src/components/NSAMessageListDialog.module.css +99 -99
  78. package/src/components/NSAMessageListDialog.tsx +142 -142
  79. package/src/components/NSANavigationGuard.tsx +79 -79
  80. package/src/components/NSAProductListDialog.module.css +44 -44
  81. package/src/components/NSAProductListDialog.tsx +88 -88
  82. package/src/components/NSATable.tsx +494 -494
  83. package/src/components/NSATaskBar.module.css +57 -57
  84. package/src/components/NSATaskBar.tsx +193 -193
  85. package/src/components/NSAUserDialog.module.css +67 -67
  86. package/src/components/NSAUserDialog.tsx +122 -122
  87. package/src/components/NSAWorkspaceListDialog.module.css +41 -41
  88. package/src/components/NSAWorkspaceListDialog.tsx +147 -147
  89. package/src/components/NSFBoxCategoryScope.tsx +52 -52
  90. package/src/components/NSFBoxField.tsx +37 -37
  91. package/src/components/NSFBoxSlot.tsx +71 -71
  92. package/src/components/NSFBoxWrapper.tsx +69 -69
  93. package/src/components/NSLabelSecret.tsx +37 -37
  94. package/src/components/quickfilter/NSAFilterBoxBase.tsx +89 -89
  95. package/src/components/quickfilter/NSAFilterBoxBoolean.tsx +66 -66
  96. package/src/components/quickfilter/NSAFilterBoxDate.tsx +110 -110
  97. package/src/components/quickfilter/NSAFilterBoxDateTime.tsx +110 -110
  98. package/src/components/quickfilter/NSAFilterBoxEnum.module.css +44 -44
  99. package/src/components/quickfilter/NSAFilterBoxEnum.tsx +79 -79
  100. package/src/components/quickfilter/NSAFilterBoxNumber.tsx +145 -145
  101. package/src/components/quickfilter/NSAFilterBoxString.tsx +83 -83
  102. package/src/components/quickfilter/NSAFilterBoxTime.tsx +106 -106
  103. package/src/components/quickfilter/NSAQuickFilterBar.module.css +19 -19
  104. package/src/components/quickfilter/NSAQuickFilterBar.tsx +142 -142
  105. package/src/components/quickfilter/NSAQuickFilterDialog.module.css +74 -74
  106. package/src/components/quickfilter/NSAQuickFilterDialog.tsx +260 -260
  107. package/src/css.d.ts +13 -13
  108. package/src/formatters/SecretFormatter.tsx +24 -24
  109. package/src/index.tsx +26 -26
  110. package/src/layouts/Actions.ts +146 -146
  111. package/src/layouts/CFTUtil.ts +18 -18
  112. package/src/layouts/NSALayout.tsx +744 -744
  113. package/src/layouts/NSALayout_Field.ts +125 -125
  114. package/src/layouts/NSASectionEdit.tsx +281 -281
  115. package/src/layouts/NSASectionEditTabPage.module.css +4 -4
  116. package/src/layouts/NSASectionEditTabPage.tsx +256 -256
  117. package/src/layouts/NSASectionList.module.css +31 -31
  118. package/src/layouts/NSASectionList.tsx +147 -147
  119. package/src/layouts/NSASectionView.tsx +98 -98
  120. package/src/layouts/NSASectionViewTabMore.tsx +78 -78
  121. package/src/layouts/NSASectionViewTabPage.module.css +47 -47
  122. package/src/layouts/NSASectionViewTabPage.tsx +399 -399
  123. package/src/main.ts +52 -52
  124. package/src/pages/NSAConsentPage.module.css +26 -26
  125. package/src/pages/NSAConsentPage.tsx +120 -120
  126. package/src/pages/NSAEmailVerificationPage.tsx +30 -30
  127. package/src/pages/NSAHomePage.module.css +41 -41
  128. package/src/pages/NSAHomePage.tsx +124 -124
  129. package/src/pages/NSALoginPage.module.css +26 -26
  130. package/src/pages/NSALoginPage.tsx +87 -87
  131. package/src/pages/NSAPhoneVerificationPage.tsx +94 -94
  132. package/src/pages/NSAVerificationPage.module.css +31 -31
  133. package/src/pages/NSAVerificationPage.tsx +185 -185
  134. package/src/pages/NSFCategoryEditPage.tsx +87 -87
  135. package/src/pages/NSFCategoryListPage.tsx +23 -23
  136. package/src/pages/NSFCategoryViewPage.tsx +23 -23
  137. package/src/pages/NSFEntities.ts +58 -58
  138. package/src/pages/PaymentRequired.tsx +80 -80
  139. package/tsconfig.json +43 -43
@@ -1,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, copy: boolean = true, 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, copy, 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, copy: boolean = true, 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, copy, 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,27 +1,27 @@
1
- import ReactDOM from "react-dom/client";
2
- import Router from "./Router";
3
- import { createBrowserRouter, RouterProvider } 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
- const router = createBrowserRouter([
22
- { path: "*", element: <Router /> }
23
- ]);
24
-
25
- root.render(
26
- <RouterProvider router={router} />
1
+ import ReactDOM from "react-dom/client";
2
+ import Router from "./Router";
3
+ import { createBrowserRouter, RouterProvider } 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
+ const router = createBrowserRouter([
22
+ { path: "*", element: <Router /> }
23
+ ]);
24
+
25
+ root.render(
26
+ <RouterProvider router={router} />
27
27
  );