@abpjs/setting-management 0.9.0 → 1.1.0
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/dist/index.d.mts +80 -3
- package/dist/index.d.ts +80 -3
- package/dist/index.js +69 -0
- package/dist/index.mjs +67 -0
- package/package.json +9 -7
package/dist/index.d.mts
CHANGED
|
@@ -3,9 +3,32 @@ export { SettingTab } from '@abpjs/theme-shared';
|
|
|
3
3
|
import { ABP } from '@abpjs/core';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Setting Management Models
|
|
8
|
+
* Translated from @abp/ng.setting-management v1.1.0
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Setting Management namespace containing types and interfaces
|
|
13
|
+
* @since 1.1.0
|
|
14
|
+
*/
|
|
15
|
+
declare namespace SettingManagement {
|
|
16
|
+
/**
|
|
17
|
+
* State interface for setting management
|
|
18
|
+
* Tracks the currently selected setting tab
|
|
19
|
+
*/
|
|
20
|
+
interface State {
|
|
21
|
+
selectedTab: SettingTab | null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
6
25
|
/**
|
|
7
26
|
* Setting Management Routes
|
|
8
|
-
* Translated from @abp/ng.setting-management
|
|
27
|
+
* Translated from @abp/ng.setting-management v1.0.0
|
|
28
|
+
*
|
|
29
|
+
* Note: In Angular v1.0.0, route constants were removed from the package.
|
|
30
|
+
* In React, we keep these route constants as they are useful for
|
|
31
|
+
* programmatic navigation and route configuration.
|
|
9
32
|
*/
|
|
10
33
|
|
|
11
34
|
/**
|
|
@@ -17,7 +40,11 @@ declare const SETTING_MANAGEMENT_ROUTES: {
|
|
|
17
40
|
|
|
18
41
|
/**
|
|
19
42
|
* Setting Management Service
|
|
20
|
-
* Translated from @abp/ng.setting-management
|
|
43
|
+
* Translated from @abp/ng.setting-management v1.1.0
|
|
44
|
+
*
|
|
45
|
+
* Note: In Angular, the SettingManagementService was removed in favor
|
|
46
|
+
* of using Store directly. In React, we keep this service as it provides
|
|
47
|
+
* a clean API for managing settings tabs without requiring a global store.
|
|
21
48
|
*/
|
|
22
49
|
|
|
23
50
|
/**
|
|
@@ -84,6 +111,56 @@ declare class SettingManagementService {
|
|
|
84
111
|
*/
|
|
85
112
|
declare function getSettingManagementService(): SettingManagementService;
|
|
86
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Setting Management State Service
|
|
116
|
+
* Translated from @abp/ng.setting-management v1.1.0
|
|
117
|
+
*
|
|
118
|
+
* This service provides state management for setting tabs,
|
|
119
|
+
* equivalent to the Angular NGXS SettingManagementState.
|
|
120
|
+
*/
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* State service for managing setting management state.
|
|
124
|
+
* Provides methods equivalent to Angular's NGXS state selectors and actions.
|
|
125
|
+
*
|
|
126
|
+
* @since 1.1.0
|
|
127
|
+
*/
|
|
128
|
+
declare class SettingManagementStateService {
|
|
129
|
+
private _state;
|
|
130
|
+
private _subscribers;
|
|
131
|
+
/**
|
|
132
|
+
* Get the currently selected setting tab
|
|
133
|
+
* Equivalent to Angular's @Selector() getSelectedTab
|
|
134
|
+
*/
|
|
135
|
+
getSelectedTab(): SettingTab | null;
|
|
136
|
+
/**
|
|
137
|
+
* Set the selected setting tab
|
|
138
|
+
* Equivalent to Angular's SetSelectedSettingTab action
|
|
139
|
+
* @param tab The setting tab to select
|
|
140
|
+
*/
|
|
141
|
+
setSelectedTab(tab: SettingTab | null): void;
|
|
142
|
+
/**
|
|
143
|
+
* Get the current state
|
|
144
|
+
*/
|
|
145
|
+
getState(): SettingManagement.State;
|
|
146
|
+
/**
|
|
147
|
+
* Reset the state to initial values
|
|
148
|
+
*/
|
|
149
|
+
reset(): void;
|
|
150
|
+
/**
|
|
151
|
+
* Subscribe to state changes
|
|
152
|
+
* @param callback Function to call when state changes
|
|
153
|
+
* @returns Unsubscribe function
|
|
154
|
+
*/
|
|
155
|
+
subscribe(callback: () => void): () => void;
|
|
156
|
+
private notifySubscribers;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Get the singleton instance of SettingManagementStateService
|
|
160
|
+
* @since 1.1.0
|
|
161
|
+
*/
|
|
162
|
+
declare function getSettingManagementStateService(): SettingManagementStateService;
|
|
163
|
+
|
|
87
164
|
/**
|
|
88
165
|
* Return type for useSettingManagement hook
|
|
89
166
|
*/
|
|
@@ -188,4 +265,4 @@ interface SettingLayoutProps {
|
|
|
188
265
|
*/
|
|
189
266
|
declare function SettingLayout({ children, onTabSelect, className, }: SettingLayoutProps): React.ReactElement;
|
|
190
267
|
|
|
191
|
-
export { SETTING_MANAGEMENT_ROUTES, SettingLayout, type SettingLayoutProps, SettingManagementService, type UseSettingManagementReturn, getSettingManagementService, useSettingManagement };
|
|
268
|
+
export { SETTING_MANAGEMENT_ROUTES, SettingLayout, type SettingLayoutProps, SettingManagement, SettingManagementService, SettingManagementStateService, type UseSettingManagementReturn, getSettingManagementService, getSettingManagementStateService, useSettingManagement };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,9 +3,32 @@ export { SettingTab } from '@abpjs/theme-shared';
|
|
|
3
3
|
import { ABP } from '@abpjs/core';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Setting Management Models
|
|
8
|
+
* Translated from @abp/ng.setting-management v1.1.0
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Setting Management namespace containing types and interfaces
|
|
13
|
+
* @since 1.1.0
|
|
14
|
+
*/
|
|
15
|
+
declare namespace SettingManagement {
|
|
16
|
+
/**
|
|
17
|
+
* State interface for setting management
|
|
18
|
+
* Tracks the currently selected setting tab
|
|
19
|
+
*/
|
|
20
|
+
interface State {
|
|
21
|
+
selectedTab: SettingTab | null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
6
25
|
/**
|
|
7
26
|
* Setting Management Routes
|
|
8
|
-
* Translated from @abp/ng.setting-management
|
|
27
|
+
* Translated from @abp/ng.setting-management v1.0.0
|
|
28
|
+
*
|
|
29
|
+
* Note: In Angular v1.0.0, route constants were removed from the package.
|
|
30
|
+
* In React, we keep these route constants as they are useful for
|
|
31
|
+
* programmatic navigation and route configuration.
|
|
9
32
|
*/
|
|
10
33
|
|
|
11
34
|
/**
|
|
@@ -17,7 +40,11 @@ declare const SETTING_MANAGEMENT_ROUTES: {
|
|
|
17
40
|
|
|
18
41
|
/**
|
|
19
42
|
* Setting Management Service
|
|
20
|
-
* Translated from @abp/ng.setting-management
|
|
43
|
+
* Translated from @abp/ng.setting-management v1.1.0
|
|
44
|
+
*
|
|
45
|
+
* Note: In Angular, the SettingManagementService was removed in favor
|
|
46
|
+
* of using Store directly. In React, we keep this service as it provides
|
|
47
|
+
* a clean API for managing settings tabs without requiring a global store.
|
|
21
48
|
*/
|
|
22
49
|
|
|
23
50
|
/**
|
|
@@ -84,6 +111,56 @@ declare class SettingManagementService {
|
|
|
84
111
|
*/
|
|
85
112
|
declare function getSettingManagementService(): SettingManagementService;
|
|
86
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Setting Management State Service
|
|
116
|
+
* Translated from @abp/ng.setting-management v1.1.0
|
|
117
|
+
*
|
|
118
|
+
* This service provides state management for setting tabs,
|
|
119
|
+
* equivalent to the Angular NGXS SettingManagementState.
|
|
120
|
+
*/
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* State service for managing setting management state.
|
|
124
|
+
* Provides methods equivalent to Angular's NGXS state selectors and actions.
|
|
125
|
+
*
|
|
126
|
+
* @since 1.1.0
|
|
127
|
+
*/
|
|
128
|
+
declare class SettingManagementStateService {
|
|
129
|
+
private _state;
|
|
130
|
+
private _subscribers;
|
|
131
|
+
/**
|
|
132
|
+
* Get the currently selected setting tab
|
|
133
|
+
* Equivalent to Angular's @Selector() getSelectedTab
|
|
134
|
+
*/
|
|
135
|
+
getSelectedTab(): SettingTab | null;
|
|
136
|
+
/**
|
|
137
|
+
* Set the selected setting tab
|
|
138
|
+
* Equivalent to Angular's SetSelectedSettingTab action
|
|
139
|
+
* @param tab The setting tab to select
|
|
140
|
+
*/
|
|
141
|
+
setSelectedTab(tab: SettingTab | null): void;
|
|
142
|
+
/**
|
|
143
|
+
* Get the current state
|
|
144
|
+
*/
|
|
145
|
+
getState(): SettingManagement.State;
|
|
146
|
+
/**
|
|
147
|
+
* Reset the state to initial values
|
|
148
|
+
*/
|
|
149
|
+
reset(): void;
|
|
150
|
+
/**
|
|
151
|
+
* Subscribe to state changes
|
|
152
|
+
* @param callback Function to call when state changes
|
|
153
|
+
* @returns Unsubscribe function
|
|
154
|
+
*/
|
|
155
|
+
subscribe(callback: () => void): () => void;
|
|
156
|
+
private notifySubscribers;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Get the singleton instance of SettingManagementStateService
|
|
160
|
+
* @since 1.1.0
|
|
161
|
+
*/
|
|
162
|
+
declare function getSettingManagementStateService(): SettingManagementStateService;
|
|
163
|
+
|
|
87
164
|
/**
|
|
88
165
|
* Return type for useSettingManagement hook
|
|
89
166
|
*/
|
|
@@ -188,4 +265,4 @@ interface SettingLayoutProps {
|
|
|
188
265
|
*/
|
|
189
266
|
declare function SettingLayout({ children, onTabSelect, className, }: SettingLayoutProps): React.ReactElement;
|
|
190
267
|
|
|
191
|
-
export { SETTING_MANAGEMENT_ROUTES, SettingLayout, type SettingLayoutProps, SettingManagementService, type UseSettingManagementReturn, getSettingManagementService, useSettingManagement };
|
|
268
|
+
export { SETTING_MANAGEMENT_ROUTES, SettingLayout, type SettingLayoutProps, SettingManagement, SettingManagementService, SettingManagementStateService, type UseSettingManagementReturn, getSettingManagementService, getSettingManagementStateService, useSettingManagement };
|
package/dist/index.js
CHANGED
|
@@ -23,7 +23,9 @@ __export(index_exports, {
|
|
|
23
23
|
SETTING_MANAGEMENT_ROUTES: () => SETTING_MANAGEMENT_ROUTES,
|
|
24
24
|
SettingLayout: () => SettingLayout,
|
|
25
25
|
SettingManagementService: () => SettingManagementService,
|
|
26
|
+
SettingManagementStateService: () => SettingManagementStateService,
|
|
26
27
|
getSettingManagementService: () => getSettingManagementService,
|
|
28
|
+
getSettingManagementStateService: () => getSettingManagementStateService,
|
|
27
29
|
useSettingManagement: () => useSettingManagement
|
|
28
30
|
});
|
|
29
31
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -160,6 +162,71 @@ function getSettingManagementService() {
|
|
|
160
162
|
return _instance;
|
|
161
163
|
}
|
|
162
164
|
|
|
165
|
+
// src/services/setting-management-state.service.ts
|
|
166
|
+
var SettingManagementStateService = class {
|
|
167
|
+
constructor() {
|
|
168
|
+
this._state = {
|
|
169
|
+
selectedTab: null
|
|
170
|
+
};
|
|
171
|
+
this._subscribers = /* @__PURE__ */ new Set();
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Get the currently selected setting tab
|
|
175
|
+
* Equivalent to Angular's @Selector() getSelectedTab
|
|
176
|
+
*/
|
|
177
|
+
getSelectedTab() {
|
|
178
|
+
return this._state.selectedTab;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Set the selected setting tab
|
|
182
|
+
* Equivalent to Angular's SetSelectedSettingTab action
|
|
183
|
+
* @param tab The setting tab to select
|
|
184
|
+
*/
|
|
185
|
+
setSelectedTab(tab) {
|
|
186
|
+
this._state = {
|
|
187
|
+
...this._state,
|
|
188
|
+
selectedTab: tab
|
|
189
|
+
};
|
|
190
|
+
this.notifySubscribers();
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Get the current state
|
|
194
|
+
*/
|
|
195
|
+
getState() {
|
|
196
|
+
return { ...this._state };
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Reset the state to initial values
|
|
200
|
+
*/
|
|
201
|
+
reset() {
|
|
202
|
+
this._state = {
|
|
203
|
+
selectedTab: null
|
|
204
|
+
};
|
|
205
|
+
this.notifySubscribers();
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Subscribe to state changes
|
|
209
|
+
* @param callback Function to call when state changes
|
|
210
|
+
* @returns Unsubscribe function
|
|
211
|
+
*/
|
|
212
|
+
subscribe(callback) {
|
|
213
|
+
this._subscribers.add(callback);
|
|
214
|
+
return () => {
|
|
215
|
+
this._subscribers.delete(callback);
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
notifySubscribers() {
|
|
219
|
+
this._subscribers.forEach((callback) => callback());
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
var _stateInstance = null;
|
|
223
|
+
function getSettingManagementStateService() {
|
|
224
|
+
if (!_stateInstance) {
|
|
225
|
+
_stateInstance = new SettingManagementStateService();
|
|
226
|
+
}
|
|
227
|
+
return _stateInstance;
|
|
228
|
+
}
|
|
229
|
+
|
|
163
230
|
// src/hooks/useSettingManagement.ts
|
|
164
231
|
var import_react = require("react");
|
|
165
232
|
function useSettingManagement() {
|
|
@@ -313,6 +380,8 @@ var styles = {
|
|
|
313
380
|
SETTING_MANAGEMENT_ROUTES,
|
|
314
381
|
SettingLayout,
|
|
315
382
|
SettingManagementService,
|
|
383
|
+
SettingManagementStateService,
|
|
316
384
|
getSettingManagementService,
|
|
385
|
+
getSettingManagementStateService,
|
|
317
386
|
useSettingManagement
|
|
318
387
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -130,6 +130,71 @@ function getSettingManagementService() {
|
|
|
130
130
|
return _instance;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
// src/services/setting-management-state.service.ts
|
|
134
|
+
var SettingManagementStateService = class {
|
|
135
|
+
constructor() {
|
|
136
|
+
this._state = {
|
|
137
|
+
selectedTab: null
|
|
138
|
+
};
|
|
139
|
+
this._subscribers = /* @__PURE__ */ new Set();
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Get the currently selected setting tab
|
|
143
|
+
* Equivalent to Angular's @Selector() getSelectedTab
|
|
144
|
+
*/
|
|
145
|
+
getSelectedTab() {
|
|
146
|
+
return this._state.selectedTab;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Set the selected setting tab
|
|
150
|
+
* Equivalent to Angular's SetSelectedSettingTab action
|
|
151
|
+
* @param tab The setting tab to select
|
|
152
|
+
*/
|
|
153
|
+
setSelectedTab(tab) {
|
|
154
|
+
this._state = {
|
|
155
|
+
...this._state,
|
|
156
|
+
selectedTab: tab
|
|
157
|
+
};
|
|
158
|
+
this.notifySubscribers();
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Get the current state
|
|
162
|
+
*/
|
|
163
|
+
getState() {
|
|
164
|
+
return { ...this._state };
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Reset the state to initial values
|
|
168
|
+
*/
|
|
169
|
+
reset() {
|
|
170
|
+
this._state = {
|
|
171
|
+
selectedTab: null
|
|
172
|
+
};
|
|
173
|
+
this.notifySubscribers();
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Subscribe to state changes
|
|
177
|
+
* @param callback Function to call when state changes
|
|
178
|
+
* @returns Unsubscribe function
|
|
179
|
+
*/
|
|
180
|
+
subscribe(callback) {
|
|
181
|
+
this._subscribers.add(callback);
|
|
182
|
+
return () => {
|
|
183
|
+
this._subscribers.delete(callback);
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
notifySubscribers() {
|
|
187
|
+
this._subscribers.forEach((callback) => callback());
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
var _stateInstance = null;
|
|
191
|
+
function getSettingManagementStateService() {
|
|
192
|
+
if (!_stateInstance) {
|
|
193
|
+
_stateInstance = new SettingManagementStateService();
|
|
194
|
+
}
|
|
195
|
+
return _stateInstance;
|
|
196
|
+
}
|
|
197
|
+
|
|
133
198
|
// src/hooks/useSettingManagement.ts
|
|
134
199
|
import { useState, useEffect, useCallback, useMemo } from "react";
|
|
135
200
|
function useSettingManagement() {
|
|
@@ -282,6 +347,8 @@ export {
|
|
|
282
347
|
SETTING_MANAGEMENT_ROUTES,
|
|
283
348
|
SettingLayout,
|
|
284
349
|
SettingManagementService,
|
|
350
|
+
SettingManagementStateService,
|
|
285
351
|
getSettingManagementService,
|
|
352
|
+
getSettingManagementStateService,
|
|
286
353
|
useSettingManagement
|
|
287
354
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abpjs/setting-management",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "ABP Framework setting-management components for React - translated from @abp/ng.setting-management",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@chakra-ui/react": "^3.2.0",
|
|
27
27
|
"@emotion/react": "^11.11.0",
|
|
28
|
-
"@abpjs/
|
|
29
|
-
"@abpjs/
|
|
30
|
-
"@abpjs/permission-management": "
|
|
28
|
+
"@abpjs/theme-shared": "1.1.0",
|
|
29
|
+
"@abpjs/core": "1.1.0",
|
|
30
|
+
"@abpjs/permission-management": "1.1.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@abp/ng.setting-management": "
|
|
33
|
+
"@abp/ng.setting-management": "1.1.0",
|
|
34
34
|
"@testing-library/jest-dom": "^6.9.1",
|
|
35
35
|
"@testing-library/react": "^14.0.0",
|
|
36
36
|
"@testing-library/user-event": "^14.6.1",
|
|
@@ -62,7 +62,8 @@
|
|
|
62
62
|
},
|
|
63
63
|
"repository": {
|
|
64
64
|
"type": "git",
|
|
65
|
-
"url": "https://github.com/abpjs/abp-react"
|
|
65
|
+
"url": "https://github.com/abpjs/abp-react",
|
|
66
|
+
"directory": "packages/setting-management"
|
|
66
67
|
},
|
|
67
68
|
"homepage": "https://docs.abpjs.io/docs/packages/setting-management/overview",
|
|
68
69
|
"bugs": {
|
|
@@ -81,6 +82,7 @@
|
|
|
81
82
|
"format": "prettier --write \"src/**/*.{ts,tsx,json,md}\"",
|
|
82
83
|
"format:check": "prettier --check \"src/**/*.{ts,tsx,json,md}\"",
|
|
83
84
|
"type-check": "tsc --noEmit",
|
|
84
|
-
"test": "vitest"
|
|
85
|
+
"test": "vitest run",
|
|
86
|
+
"test:watch": "vitest"
|
|
85
87
|
}
|
|
86
88
|
}
|