namirasoft-account-react 1.4.430 → 1.4.432

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 (138) 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/NSARouterMaker.js +1 -0
  7. package/dist/NSARouterMaker.js.map +1 -1
  8. package/dist/NSARouterMakerProps.d.ts +2 -0
  9. package/dist/UseParams.d.ts +1 -1
  10. package/dist/components/NSAAccessListDialog.d.ts +2 -2
  11. package/dist/components/NSAAccessListDialog.module.css +71 -71
  12. package/dist/components/NSAMasterMenu.d.ts +1 -1
  13. package/dist/components/NSAMasterMenu.module.css +248 -248
  14. package/dist/components/NSAMasterMenuItem.d.ts +1 -1
  15. package/dist/components/NSAMessageListDialog.d.ts +1 -1
  16. package/dist/components/NSAMessageListDialog.js +4 -3
  17. package/dist/components/NSAMessageListDialog.js.map +1 -1
  18. package/dist/components/NSAMessageListDialog.module.css +99 -99
  19. package/dist/components/NSAProductListDialog.d.ts +1 -1
  20. package/dist/components/NSAProductListDialog.module.css +44 -44
  21. package/dist/components/NSAReorderDialog.d.ts +1 -1
  22. package/dist/components/NSAReorderDialog.module.css +49 -49
  23. package/dist/components/NSASortDialog.d.ts +1 -1
  24. package/dist/components/NSAUserDialog.d.ts +1 -1
  25. package/dist/components/NSAUserDialog.module.css +67 -67
  26. package/dist/components/NSAWorkspaceListDialog.d.ts +1 -1
  27. package/dist/components/NSAWorkspaceListDialog.module.css +41 -41
  28. package/dist/components/NSBoxSecret.d.ts +1 -1
  29. package/dist/components/NSBoxSecret.module.css +23 -23
  30. package/dist/components/NSLabelSecret.d.ts +1 -1
  31. package/dist/components/quickfilter/NSAFilterBoxEnum.module.css +45 -0
  32. package/dist/components/quickfilter/NSAQuickFilterBar.d.ts +1 -1
  33. package/dist/components/quickfilter/NSAQuickFilterBar.module.css +20 -0
  34. package/dist/components/quickfilter/NSAQuickFilterDialog.d.ts +1 -1
  35. package/dist/components/quickfilter/NSAQuickFilterDialog.module.css +75 -0
  36. package/dist/index.css +0 -0
  37. package/dist/layouts/Actions.d.ts +1 -1
  38. package/dist/layouts/Actions.js +8 -6
  39. package/dist/layouts/Actions.js.map +1 -1
  40. package/dist/layouts/NSALayout.d.ts +1 -1
  41. package/dist/layouts/NSALayout.js +4 -1
  42. package/dist/layouts/NSALayout.js.map +1 -1
  43. package/dist/layouts/NSASectionEdit.d.ts +1 -1
  44. package/dist/layouts/NSASectionEditTabPage.d.ts +1 -1
  45. package/dist/layouts/NSASectionEditTabPage.module.css +4 -4
  46. package/dist/layouts/NSASectionList.d.ts +1 -1
  47. package/dist/layouts/NSASectionList.module.css +31 -31
  48. package/dist/layouts/NSASectionView.d.ts +1 -1
  49. package/dist/layouts/NSASectionViewTabMore.d.ts +1 -1
  50. package/dist/layouts/NSASectionViewTabMore.js +3 -3
  51. package/dist/layouts/NSASectionViewTabMore.js.map +1 -1
  52. package/dist/layouts/NSASectionViewTabPage.d.ts +1 -1
  53. package/dist/layouts/NSASectionViewTabPage.module.css +47 -47
  54. package/dist/pages/NSAConsentPage.module.css +26 -26
  55. package/dist/pages/NSAEmailVerificationPage.d.ts +1 -1
  56. package/dist/pages/NSAHomePage.d.ts +1 -1
  57. package/dist/pages/NSAHomePage.module.css +41 -41
  58. package/dist/pages/NSALoginPage.d.ts +1 -1
  59. package/dist/pages/NSALoginPage.module.css +26 -26
  60. package/dist/pages/NSAPhoneVerificationPage.d.ts +1 -1
  61. package/dist/pages/NSAVerificationPage.d.ts +1 -1
  62. package/dist/pages/NSAVerificationPage.module.css +31 -31
  63. package/dist/pages/PaymentRequired.js +4 -2
  64. package/dist/pages/PaymentRequired.js.map +1 -1
  65. package/package.json +94 -94
  66. package/public/index.html +21 -21
  67. package/src/App.css +31 -31
  68. package/src/App.tsx +19 -19
  69. package/src/CTFRow.ts +7 -7
  70. package/src/IEntityInfo.ts +33 -33
  71. package/src/NSACacheService.ts +120 -120
  72. package/src/NSAFilterOperators.ts +92 -92
  73. package/src/NSARouterMaker.tsx +140 -139
  74. package/src/NSARouterMakerConfig.ts +15 -15
  75. package/src/NSARouterMakerProps.ts +24 -22
  76. package/src/Router.tsx +45 -45
  77. package/src/UseParams.tsx +18 -18
  78. package/src/components/NSAAccessListDialog.module.css +71 -71
  79. package/src/components/NSAAccessListDialog.tsx +178 -178
  80. package/src/components/NSAMasterMenu.module.css +248 -248
  81. package/src/components/NSAMasterMenu.tsx +169 -169
  82. package/src/components/NSAMasterMenuItem.tsx +250 -250
  83. package/src/components/NSAMessageListDialog.module.css +99 -99
  84. package/src/components/NSAMessageListDialog.tsx +142 -141
  85. package/src/components/NSAProductListDialog.module.css +44 -44
  86. package/src/components/NSAProductListDialog.tsx +88 -88
  87. package/src/components/NSAReorderDialog.module.css +49 -49
  88. package/src/components/NSAReorderDialog.tsx +149 -149
  89. package/src/components/NSASortDialog.tsx +117 -117
  90. package/src/components/NSATable.tsx +489 -489
  91. package/src/components/NSAUserDialog.module.css +67 -67
  92. package/src/components/NSAUserDialog.tsx +122 -122
  93. package/src/components/NSAWorkspaceListDialog.module.css +41 -41
  94. package/src/components/NSAWorkspaceListDialog.tsx +147 -147
  95. package/src/components/NSBoxSecret.module.css +23 -23
  96. package/src/components/NSBoxSecret.tsx +258 -258
  97. package/src/components/NSLabelSecret.tsx +37 -37
  98. package/src/components/quickfilter/NSAFilterBoxBase.tsx +55 -55
  99. package/src/components/quickfilter/NSAFilterBoxBoolean.tsx +54 -54
  100. package/src/components/quickfilter/NSAFilterBoxDate.tsx +104 -104
  101. package/src/components/quickfilter/NSAFilterBoxDateTime.tsx +105 -105
  102. package/src/components/quickfilter/NSAFilterBoxEnum.module.css +44 -44
  103. package/src/components/quickfilter/NSAFilterBoxEnum.tsx +79 -79
  104. package/src/components/quickfilter/NSAFilterBoxNumber.tsx +136 -136
  105. package/src/components/quickfilter/NSAFilterBoxString.tsx +81 -81
  106. package/src/components/quickfilter/NSAFilterBoxTime.tsx +101 -101
  107. package/src/components/quickfilter/NSAQuickFilterBar.module.css +19 -19
  108. package/src/components/quickfilter/NSAQuickFilterBar.tsx +114 -114
  109. package/src/components/quickfilter/NSAQuickFilterDialog.module.css +74 -74
  110. package/src/components/quickfilter/NSAQuickFilterDialog.tsx +260 -260
  111. package/src/css.d.ts +13 -13
  112. package/src/formatters/SecretFormatter.tsx +24 -24
  113. package/src/index.tsx +24 -24
  114. package/src/layouts/Actions.ts +146 -145
  115. package/src/layouts/CFTUtil.ts +18 -18
  116. package/src/layouts/NSALayout.tsx +844 -841
  117. package/src/layouts/NSASectionEdit.tsx +260 -260
  118. package/src/layouts/NSASectionEditTabPage.module.css +4 -4
  119. package/src/layouts/NSASectionEditTabPage.tsx +250 -250
  120. package/src/layouts/NSASectionList.module.css +31 -31
  121. package/src/layouts/NSASectionList.tsx +149 -149
  122. package/src/layouts/NSASectionView.tsx +100 -100
  123. package/src/layouts/NSASectionViewTabMore.tsx +77 -77
  124. package/src/layouts/NSASectionViewTabPage.module.css +47 -47
  125. package/src/layouts/NSASectionViewTabPage.tsx +419 -419
  126. package/src/main.ts +46 -46
  127. package/src/pages/NSAConsentPage.module.css +26 -26
  128. package/src/pages/NSAConsentPage.tsx +120 -120
  129. package/src/pages/NSAEmailVerificationPage.tsx +30 -30
  130. package/src/pages/NSAHomePage.module.css +41 -41
  131. package/src/pages/NSAHomePage.tsx +102 -102
  132. package/src/pages/NSALoginPage.module.css +26 -26
  133. package/src/pages/NSALoginPage.tsx +87 -87
  134. package/src/pages/NSAPhoneVerificationPage.tsx +94 -94
  135. package/src/pages/NSAVerificationPage.module.css +31 -31
  136. package/src/pages/NSAVerificationPage.tsx +186 -186
  137. package/src/pages/PaymentRequired.tsx +76 -74
  138. 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
  );