@abpjs/theme-shared 1.1.0 → 2.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/components/confirmation/Confirmation.d.ts +3 -0
- package/dist/components/toast/Toast.d.ts +11 -1
- package/dist/constants/styles.d.ts +6 -1
- package/dist/contexts/confirmation.context.d.ts +92 -29
- package/dist/contexts/toaster.context.d.ts +88 -19
- package/dist/index.d.ts +14 -1
- package/dist/index.js +254 -88
- package/dist/index.mjs +271 -102
- package/dist/models/confirmation.d.ts +48 -19
- package/dist/models/toaster.d.ts +60 -10
- package/package.json +3 -3
|
@@ -1,36 +1,65 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Confirmation namespace containing types for confirmation dialogs.
|
|
3
3
|
* Translated from @abp/ng.theme.shared/lib/models/confirmation.ts
|
|
4
|
+
*
|
|
5
|
+
* @since 2.0.0 - Major changes:
|
|
6
|
+
* - Options no longer extends Toaster.Options
|
|
7
|
+
* - Added DialogData interface
|
|
8
|
+
* - Added Severity type
|
|
9
|
+
* - Removed deprecated cancelCopy/yesCopy
|
|
10
|
+
*
|
|
11
|
+
* @since 2.1.0 - Added Status enum (confirmation-specific, replaces Toaster.Status usage)
|
|
4
12
|
*/
|
|
5
13
|
import type { Config } from '@abpjs/core';
|
|
6
|
-
import { Toaster } from './toaster';
|
|
7
14
|
export declare namespace Confirmation {
|
|
8
15
|
/**
|
|
9
16
|
* Options for configuring a confirmation dialog.
|
|
10
|
-
*
|
|
17
|
+
* @since 2.0.0 - No longer extends Toaster.Options
|
|
11
18
|
*/
|
|
12
|
-
interface Options
|
|
19
|
+
interface Options {
|
|
20
|
+
/** Unique identifier for the confirmation */
|
|
21
|
+
id?: string | number;
|
|
22
|
+
/** Whether the confirmation can be closed by clicking outside or pressing escape */
|
|
23
|
+
closable?: boolean;
|
|
24
|
+
/** Parameters for localizing the message */
|
|
25
|
+
messageLocalizationParams?: string[];
|
|
26
|
+
/** Parameters for localizing the title */
|
|
27
|
+
titleLocalizationParams?: string[];
|
|
13
28
|
/** Hide the cancel button */
|
|
14
29
|
hideCancelBtn?: boolean;
|
|
15
30
|
/** Hide the yes/confirm button */
|
|
16
31
|
hideYesBtn?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Custom text for the cancel button
|
|
19
|
-
* @since 1.1.0 - Now accepts Config.LocalizationParam
|
|
20
|
-
*/
|
|
32
|
+
/** Custom text for the cancel button */
|
|
21
33
|
cancelText?: Config.LocalizationParam;
|
|
22
|
-
/**
|
|
23
|
-
* Custom text for the yes button
|
|
24
|
-
* @since 1.1.0 - Now accepts Config.LocalizationParam
|
|
25
|
-
*/
|
|
34
|
+
/** Custom text for the yes button */
|
|
26
35
|
yesText?: Config.LocalizationParam;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Dialog data structure for confirmation dialogs.
|
|
39
|
+
* @since 2.0.0
|
|
40
|
+
*/
|
|
41
|
+
interface DialogData {
|
|
42
|
+
/** The message content */
|
|
43
|
+
message: Config.LocalizationParam;
|
|
44
|
+
/** The title */
|
|
45
|
+
title?: Config.LocalizationParam;
|
|
46
|
+
/** Severity level affects the styling */
|
|
47
|
+
severity?: Severity;
|
|
48
|
+
/** Options for the confirmation */
|
|
49
|
+
options?: Partial<Options>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Severity levels for confirmation dialogs.
|
|
53
|
+
* @since 2.0.0
|
|
54
|
+
*/
|
|
55
|
+
type Severity = 'neutral' | 'success' | 'info' | 'warning' | 'error';
|
|
56
|
+
/**
|
|
57
|
+
* Status values for confirmation dialog responses.
|
|
58
|
+
* @since 2.1.0 - Moved from Toaster.Status to be confirmation-specific
|
|
59
|
+
*/
|
|
60
|
+
enum Status {
|
|
61
|
+
confirm = "confirm",
|
|
62
|
+
reject = "reject",
|
|
63
|
+
dismiss = "dismiss"
|
|
35
64
|
}
|
|
36
65
|
}
|
package/dist/models/toaster.d.ts
CHANGED
|
@@ -1,33 +1,62 @@
|
|
|
1
|
+
import type { Config } from '@abpjs/core';
|
|
1
2
|
/**
|
|
2
3
|
* Toaster namespace containing types and interfaces for toast notifications.
|
|
3
4
|
* Translated from @abp/ng.theme.shared/lib/models/toaster.ts
|
|
5
|
+
*
|
|
6
|
+
* @since 2.0.0 - Major changes:
|
|
7
|
+
* - `Options` renamed to `ToastOptions`
|
|
8
|
+
* - New `Toast` interface
|
|
9
|
+
* - `Severity` type changed: 'warn' → 'warning', added 'neutral'
|
|
10
|
+
* - ToasterService methods now return number (toast ID) instead of Observable
|
|
11
|
+
*
|
|
12
|
+
* @since 2.1.0 - Status enum deprecated, use Confirmation.Status instead
|
|
4
13
|
*/
|
|
5
14
|
export declare namespace Toaster {
|
|
6
15
|
/**
|
|
7
16
|
* Options for configuring a toast notification.
|
|
17
|
+
* @since 2.0.0 - Renamed from Options, restructured properties
|
|
8
18
|
*/
|
|
9
|
-
interface
|
|
10
|
-
/**
|
|
11
|
-
id?: string;
|
|
12
|
-
/** Whether the toast can be manually closed */
|
|
13
|
-
closable?: boolean;
|
|
14
|
-
/** Duration in milliseconds before auto-dismiss (default varies by implementation) */
|
|
19
|
+
interface ToastOptions {
|
|
20
|
+
/** Duration in milliseconds before auto-dismiss */
|
|
15
21
|
life?: number;
|
|
16
22
|
/** If true, toast won't auto-dismiss */
|
|
17
23
|
sticky?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
|
|
24
|
+
/** Whether the toast can be manually closed */
|
|
25
|
+
closable?: boolean;
|
|
26
|
+
/** Whether tapping the toast dismisses it */
|
|
27
|
+
tapToDismiss?: boolean;
|
|
20
28
|
/** Parameters for localizing the message */
|
|
21
29
|
messageLocalizationParams?: string[];
|
|
22
30
|
/** Parameters for localizing the title */
|
|
23
31
|
titleLocalizationParams?: string[];
|
|
32
|
+
/** Unique identifier for the toast */
|
|
33
|
+
id: number | string;
|
|
34
|
+
/** Container key for positioning toasts in specific containers */
|
|
35
|
+
containerKey?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Complete toast structure.
|
|
39
|
+
* @since 2.0.0
|
|
40
|
+
*/
|
|
41
|
+
interface Toast {
|
|
42
|
+
/** The message content (can be a localization key) */
|
|
43
|
+
message: Config.LocalizationParam;
|
|
44
|
+
/** The title (can be a localization key) */
|
|
45
|
+
title?: Config.LocalizationParam;
|
|
46
|
+
/** Severity level of the toast */
|
|
47
|
+
severity?: string;
|
|
48
|
+
/** Options for the toast */
|
|
49
|
+
options?: ToastOptions;
|
|
24
50
|
}
|
|
25
51
|
/**
|
|
26
52
|
* Severity levels for toast notifications.
|
|
53
|
+
* @since 2.0.0 - Changed 'warn' to 'warning', added 'neutral'
|
|
27
54
|
*/
|
|
28
|
-
type Severity = 'success' | 'info' | '
|
|
55
|
+
type Severity = 'neutral' | 'success' | 'info' | 'warning' | 'error';
|
|
29
56
|
/**
|
|
30
57
|
* Status values for toast/confirmation interactions.
|
|
58
|
+
* @deprecated Status will be removed from toaster model in v2.2. Use Confirmation.Status instead.
|
|
59
|
+
* @since 2.1.0 - Deprecated in favor of Confirmation.Status
|
|
31
60
|
*/
|
|
32
61
|
enum Status {
|
|
33
62
|
confirm = "confirm",
|
|
@@ -35,7 +64,28 @@ export declare namespace Toaster {
|
|
|
35
64
|
dismiss = "dismiss"
|
|
36
65
|
}
|
|
37
66
|
/**
|
|
38
|
-
*
|
|
67
|
+
* @deprecated Use ToastOptions instead. Scheduled for removal in v3.0.0
|
|
68
|
+
* Preserved for backward compatibility.
|
|
69
|
+
*/
|
|
70
|
+
interface Options {
|
|
71
|
+
/** Unique identifier for the toast */
|
|
72
|
+
id?: string;
|
|
73
|
+
/** Whether the toast can be manually closed */
|
|
74
|
+
closable?: boolean;
|
|
75
|
+
/** Duration in milliseconds before auto-dismiss (default varies by implementation) */
|
|
76
|
+
life?: number;
|
|
77
|
+
/** If true, toast won't auto-dismiss */
|
|
78
|
+
sticky?: boolean;
|
|
79
|
+
/** Custom data to attach to the toast */
|
|
80
|
+
data?: unknown;
|
|
81
|
+
/** Parameters for localizing the message */
|
|
82
|
+
messageLocalizationParams?: string[];
|
|
83
|
+
/** Parameters for localizing the title */
|
|
84
|
+
titleLocalizationParams?: string[];
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* @deprecated Use Toast instead. Scheduled for removal in v3.0.0
|
|
88
|
+
* Preserved for backward compatibility.
|
|
39
89
|
*/
|
|
40
90
|
interface Message extends Options {
|
|
41
91
|
/** The message content (can be a localization key) */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abpjs/theme-shared",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "ABP Framework Theme Shared components for React - translated from @abp/ng.theme.shared",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"next-themes": "^0.4.6",
|
|
28
28
|
"react-hook-form": "^7.48.0",
|
|
29
29
|
"react-icons": "^5.5.0",
|
|
30
|
-
"@abpjs/core": "
|
|
30
|
+
"@abpjs/core": "2.1.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@abp/ng.theme.shared": "
|
|
33
|
+
"@abp/ng.theme.shared": "2.1.0",
|
|
34
34
|
"@vitest/coverage-v8": "^3.2.0"
|
|
35
35
|
},
|
|
36
36
|
"author": "tekthar.com",
|