@abpjs/theme-shared 3.1.0 → 4.0.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.
@@ -54,6 +54,13 @@ export interface ModalProps {
54
54
  * @default true
55
55
  */
56
56
  preventScroll?: boolean;
57
+ /**
58
+ * Whether to suppress the unsaved changes warning when closing the modal.
59
+ * When true, the modal will close without prompting for unsaved changes.
60
+ * @default false
61
+ * @since 4.0.0
62
+ */
63
+ suppressUnsavedChangesWarning?: boolean;
57
64
  }
58
65
  /**
59
66
  * Modal component - Generic modal/dialog container.
@@ -9,6 +9,9 @@
9
9
  *
10
10
  * @since 2.9.0 - Added RTL support for data-tables-filter
11
11
  *
12
+ * @since 3.2.0 - Added .datatable-scroll styles for ngx-datatable horizontal scroll fix
13
+ * @since 4.0.0 - Enhanced .is-invalid .form-control with error icon, added typeahead styles
14
+ *
12
15
  * @example
13
16
  * ```tsx
14
17
  * // Option 1: Use with a style tag in your app
@@ -33,5 +36,5 @@
33
36
  * @since 2.9.0
34
37
  */
35
38
  export declare const BOOTSTRAP = "bootstrap-{{dir}}.min.css";
36
- export declare const DEFAULT_STYLES = "\n.is-invalid .form-control {\n border-color: #dc3545;\n border-style: solid !important;\n}\n\n.is-invalid .invalid-feedback,\n.is-invalid + * .invalid-feedback {\n display: block;\n}\n\n.data-tables-filter {\n text-align: right;\n}\n\n/* RTL support - @since 2.9.0 */\n[dir=rtl] .data-tables-filter {\n text-align: left;\n}\n\n.pointer {\n cursor: pointer;\n}\n\n.navbar .dropdown-submenu a::after {\n transform: rotate(-90deg);\n position: absolute;\n right: 16px;\n top: 18px;\n}\n\n.navbar .dropdown-menu {\n min-width: 215px;\n}\n\n.ui-table-scrollable-body::-webkit-scrollbar {\n height: 5px !important;\n width: 5px !important;\n}\n\n.ui-table-scrollable-body::-webkit-scrollbar-track {\n background: #ddd;\n}\n\n.ui-table-scrollable-body::-webkit-scrollbar-thumb {\n background: #8a8686;\n}\n\n.abp-ellipsis-inline {\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.abp-ellipsis {\n overflow: hidden !important;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.ui-widget-overlay {\n z-index: 1000;\n}\n\n.color-white {\n color: #FFF !important;\n}\n\n.custom-checkbox > label {\n cursor: pointer;\n}\n\n/* <animations */\n\n.fade-in-top {\n animation: fadeInTop 0.2s ease-in-out;\n}\n\n.fade-out-top {\n animation: fadeOutTop 0.2s ease-in-out;\n}\n\n.abp-collapsed-height {\n -moz-transition: max-height linear 0.35s;\n -ms-transition: max-height linear 0.35s;\n -o-transition: max-height linear 0.35s;\n -webkit-transition: max-height linear 0.35s;\n overflow:hidden;\n transition:max-height 0.35s linear;\n height:auto;\n max-height: 0;\n}\n\n.abp-mh-25 {\n max-height: 25vh;\n}\n\n.abp-mh-50 {\n transition:max-height 0.65s linear;\n max-height: 50vh;\n}\n\n.abp-mh-75 {\n transition:max-height 0.85s linear;\n max-height: 75vh;\n}\n\n.abp-mh-100 {\n transition:max-height 1s linear;\n max-height: 100vh;\n}\n\n/* Sorting icon styles - @since 2.0.0 */\n[class^=\"sorting\"] {\n opacity: .3;\n cursor: pointer;\n}\n[class^=\"sorting\"]:before {\n right: 0.5rem;\n content: \"\u2191\";\n}\n[class^=\"sorting\"]:after {\n right: 0.5rem;\n content: \"\u2193\";\n}\n\n.sorting_desc {\n opacity: 1;\n}\n.sorting_desc:before {\n opacity: .3;\n}\n\n.sorting_asc {\n opacity: 1;\n}\n.sorting_asc:after {\n opacity: .3;\n}\n\n@keyframes fadeInTop {\n from {\n transform: translateY(-5px);\n opacity: 0;\n }\n\n to {\n transform: translateY(0px);\n opacity: 1;\n }\n}\n\n@keyframes fadeOutTop {\n to {\n transform: translateY(-5px);\n opacity: 0;\n }\n}\n\n/* </animations */\n\n/* Loader bar styles */\n.abp-loader-bar {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 3px;\n z-index: 9999;\n background-color: rgba(0, 0, 0, 0.1);\n overflow: hidden;\n}\n\n.abp-progress {\n height: 100%;\n background-color: #3182ce;\n transition: width 0.3s ease-out;\n}\n";
39
+ export declare const DEFAULT_STYLES = "\n/* Enhanced validation styles - @since 4.0.0 */\n.is-invalid .form-control {\n border-color: #dc3545;\n border-style: solid !important;\n padding-right: calc(1.5em + .75rem);\n background-image: url(data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e);\n background-repeat: no-repeat;\n background-position: right calc(.375em + .1875rem) center;\n background-size: calc(.75em + .375rem) calc(.75em + .375rem);\n}\n\n.is-invalid .invalid-feedback,\n.is-invalid + * .invalid-feedback {\n display: block;\n}\n\n.data-tables-filter {\n text-align: right;\n}\n\n/* RTL support - @since 2.9.0 */\n[dir=rtl] .data-tables-filter {\n text-align: left;\n}\n\n.pointer {\n cursor: pointer;\n}\n\n.navbar .dropdown-submenu a::after {\n transform: rotate(-90deg);\n position: absolute;\n right: 16px;\n top: 18px;\n}\n\n.navbar .dropdown-menu {\n min-width: 215px;\n}\n\n/* ngx-datatable scroll fix - @since 3.2.0 */\n.datatable-scroll {\n margin-bottom: 5px !important;\n width: unset !important;\n}\n\n.ui-table-scrollable-body::-webkit-scrollbar {\n height: 5px !important;\n width: 5px !important;\n}\n\n.ui-table-scrollable-body::-webkit-scrollbar-track {\n background: #ddd;\n}\n\n.ui-table-scrollable-body::-webkit-scrollbar-thumb {\n background: #8a8686;\n}\n\n.abp-ellipsis-inline {\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.abp-ellipsis {\n overflow: hidden !important;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.ui-widget-overlay {\n z-index: 1000;\n}\n\n.color-white {\n color: #FFF !important;\n}\n\n.custom-checkbox > label {\n cursor: pointer;\n}\n\n/* <animations */\n\n.fade-in-top {\n animation: fadeInTop 0.2s ease-in-out;\n}\n\n.fade-out-top {\n animation: fadeOutTop 0.2s ease-in-out;\n}\n\n.abp-collapsed-height {\n -moz-transition: max-height linear 0.35s;\n -ms-transition: max-height linear 0.35s;\n -o-transition: max-height linear 0.35s;\n -webkit-transition: max-height linear 0.35s;\n overflow:hidden;\n transition:max-height 0.35s linear;\n height:auto;\n max-height: 0;\n}\n\n.abp-mh-25 {\n max-height: 25vh;\n}\n\n.abp-mh-50 {\n transition:max-height 0.65s linear;\n max-height: 50vh;\n}\n\n.abp-mh-75 {\n transition:max-height 0.85s linear;\n max-height: 75vh;\n}\n\n.abp-mh-100 {\n transition:max-height 1s linear;\n max-height: 100vh;\n}\n\n/* Sorting icon styles - @since 2.0.0 */\n[class^=\"sorting\"] {\n opacity: .3;\n cursor: pointer;\n}\n[class^=\"sorting\"]:before {\n right: 0.5rem;\n content: \"\u2191\";\n}\n[class^=\"sorting\"]:after {\n right: 0.5rem;\n content: \"\u2193\";\n}\n\n.sorting_desc {\n opacity: 1;\n}\n.sorting_desc:before {\n opacity: .3;\n}\n\n.sorting_asc {\n opacity: 1;\n}\n.sorting_asc:after {\n opacity: .3;\n}\n.ngx-datatable.material {\n box-shadow: none;\n}\n/* Typeahead dropdown styles - @since 4.0.0 */\n.abp-typeahead-window {\n width: 100%;\n}\n\n@keyframes fadeInTop {\n from {\n transform: translateY(-5px);\n opacity: 0;\n }\n\n to {\n transform: translateY(0px);\n opacity: 1;\n }\n}\n\n@keyframes fadeOutTop {\n to {\n transform: translateY(-5px);\n opacity: 0;\n }\n}\n\n/* </animations */\n\n/* Loader bar styles */\n.abp-loader-bar {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 3px;\n z-index: 9999;\n background-color: rgba(0, 0, 0, 0.1);\n overflow: hidden;\n}\n\n.abp-progress {\n height: 100%;\n background-color: #3182ce;\n transition: width 0.3s ease-out;\n}\n";
37
40
  export default DEFAULT_STYLES;
@@ -1,5 +1,5 @@
1
1
  import React, { type ReactNode } from 'react';
2
- import type { Config } from '@abpjs/core';
2
+ import type { LocalizationParam } from '@abpjs/core';
3
3
  import { Confirmation } from '../models';
4
4
  /**
5
5
  * Subscriber callback type for confirmation$ observable pattern
@@ -11,7 +11,7 @@ type ConfirmationSubscriber = (data: Confirmation.DialogData | null) => void;
11
11
  * @since 2.0.0 - Major changes:
12
12
  * - No longer extends AbstractToaster
13
13
  * - Added confirmation$ ReplaySubject pattern via subscribe method
14
- * - Now accepts Config.LocalizationParam for message and title
14
+ * - Now accepts LocalizationParam for message and title
15
15
  *
16
16
  * @since 2.1.0 - Changed from Toaster.Status to Confirmation.Status
17
17
  */
@@ -23,7 +23,7 @@ export interface ConfirmationService {
23
23
  * @param options Confirmation options
24
24
  * @returns Promise resolving to user's response status
25
25
  */
26
- info(message: Config.LocalizationParam, title?: Config.LocalizationParam, options?: Partial<Confirmation.Options>): Promise<Confirmation.Status>;
26
+ info(message: LocalizationParam, title?: LocalizationParam, options?: Partial<Confirmation.Options>): Promise<Confirmation.Status>;
27
27
  /**
28
28
  * Show a success confirmation
29
29
  * @param message Message content (supports localization)
@@ -31,7 +31,7 @@ export interface ConfirmationService {
31
31
  * @param options Confirmation options
32
32
  * @returns Promise resolving to user's response status
33
33
  */
34
- success(message: Config.LocalizationParam, title?: Config.LocalizationParam, options?: Partial<Confirmation.Options>): Promise<Confirmation.Status>;
34
+ success(message: LocalizationParam, title?: LocalizationParam, options?: Partial<Confirmation.Options>): Promise<Confirmation.Status>;
35
35
  /**
36
36
  * Show a warning confirmation
37
37
  * @param message Message content (supports localization)
@@ -39,7 +39,7 @@ export interface ConfirmationService {
39
39
  * @param options Confirmation options
40
40
  * @returns Promise resolving to user's response status
41
41
  */
42
- warn(message: Config.LocalizationParam, title?: Config.LocalizationParam, options?: Partial<Confirmation.Options>): Promise<Confirmation.Status>;
42
+ warn(message: LocalizationParam, title?: LocalizationParam, options?: Partial<Confirmation.Options>): Promise<Confirmation.Status>;
43
43
  /**
44
44
  * Show an error confirmation
45
45
  * @param message Message content (supports localization)
@@ -47,7 +47,7 @@ export interface ConfirmationService {
47
47
  * @param options Confirmation options
48
48
  * @returns Promise resolving to user's response status
49
49
  */
50
- error(message: Config.LocalizationParam, title?: Config.LocalizationParam, options?: Partial<Confirmation.Options>): Promise<Confirmation.Status>;
50
+ error(message: LocalizationParam, title?: LocalizationParam, options?: Partial<Confirmation.Options>): Promise<Confirmation.Status>;
51
51
  /**
52
52
  * Show a confirmation with specified severity
53
53
  * @param message Message content (supports localization)
@@ -58,7 +58,7 @@ export interface ConfirmationService {
58
58
  * @since 2.0.0
59
59
  * @since 2.1.0 - Uses Confirmation.Severity instead of Toaster.Severity
60
60
  */
61
- show(message: Config.LocalizationParam, title?: Config.LocalizationParam, severity?: Confirmation.Severity, options?: Partial<Confirmation.Options>): Promise<Confirmation.Status>;
61
+ show(message: LocalizationParam, title?: LocalizationParam, severity?: Confirmation.Severity, options?: Partial<Confirmation.Options>): Promise<Confirmation.Status>;
62
62
  /**
63
63
  * Clear the current confirmation
64
64
  * @param status Optional status to resolve with (default: dismiss)
@@ -99,7 +99,7 @@ export interface ConfirmationProviderProps {
99
99
  * Wrap your app with this provider to enable confirmation dialogs.
100
100
  *
101
101
  * @since 2.0.0 - Major changes:
102
- * - Now accepts Config.LocalizationParam for message and title
102
+ * - Now accepts LocalizationParam for message and title
103
103
  * - Added subscribe method for observable pattern
104
104
  * - Added listenToEscape method
105
105
  * - Uses Confirmation.DialogData structure
@@ -121,7 +121,7 @@ export declare function ConfirmationProvider({ children }: ConfirmationProviderP
121
121
  * @returns ConfirmationService with methods to show confirmation dialogs
122
122
  * @throws Error if used outside of ConfirmationProvider
123
123
  *
124
- * @since 2.0.0 - Service now accepts Config.LocalizationParam
124
+ * @since 2.0.0 - Service now accepts LocalizationParam
125
125
  * @since 2.1.0 - Uses Confirmation.Status instead of Toaster.Status
126
126
  *
127
127
  * @example
@@ -1,5 +1,5 @@
1
1
  import React, { type ReactNode } from 'react';
2
- import type { Config } from '@abpjs/core';
2
+ import type { LocalizationParam, Strict } from '@abpjs/core';
3
3
  import { Toaster } from '../models';
4
4
  /**
5
5
  * Internal toast with numeric ID for tracking.
@@ -20,6 +20,7 @@ type ToastsSubscriber = (toasts: Toaster.Toast[]) => void;
20
20
  * - Methods now return number (toast ID) instead of Observable<Status>
21
21
  * - Added toasts$ ReplaySubject pattern via subscribe method
22
22
  * - Removed addAll method (use show directly)
23
+ * @since 4.0.0 - Methods use LocalizationParam, return Toaster.ToasterId
23
24
  */
24
25
  export interface ToasterService {
25
26
  /**
@@ -28,36 +29,32 @@ export interface ToasterService {
28
29
  * @param title Title of the toast
29
30
  * @param options Specific style or structural options for individual toast
30
31
  * @returns Toast ID
31
- * @since 2.0.0 - Now returns number instead of Promise<Status>
32
32
  */
33
- info(message: Config.LocalizationParam, title?: Config.LocalizationParam, options?: Partial<Toaster.ToastOptions>): number;
33
+ info(message: LocalizationParam, title?: LocalizationParam, options?: Partial<Toaster.ToastOptions>): Toaster.ToasterId;
34
34
  /**
35
35
  * Creates a success toast with given parameters.
36
36
  * @param message Content of the toast
37
37
  * @param title Title of the toast
38
38
  * @param options Specific style or structural options for individual toast
39
39
  * @returns Toast ID
40
- * @since 2.0.0 - Now returns number instead of Promise<Status>
41
40
  */
42
- success(message: Config.LocalizationParam, title?: Config.LocalizationParam, options?: Partial<Toaster.ToastOptions>): number;
41
+ success(message: LocalizationParam, title?: LocalizationParam, options?: Partial<Toaster.ToastOptions>): Toaster.ToasterId;
43
42
  /**
44
43
  * Creates a warning toast with given parameters.
45
44
  * @param message Content of the toast
46
45
  * @param title Title of the toast
47
46
  * @param options Specific style or structural options for individual toast
48
47
  * @returns Toast ID
49
- * @since 2.0.0 - Now returns number instead of Promise<Status>
50
48
  */
51
- warn(message: Config.LocalizationParam, title?: Config.LocalizationParam, options?: Partial<Toaster.ToastOptions>): number;
49
+ warn(message: LocalizationParam, title?: LocalizationParam, options?: Partial<Toaster.ToastOptions>): Toaster.ToasterId;
52
50
  /**
53
51
  * Creates an error toast with given parameters.
54
52
  * @param message Content of the toast
55
53
  * @param title Title of the toast
56
54
  * @param options Specific style or structural options for individual toast
57
55
  * @returns Toast ID
58
- * @since 2.0.0 - Now returns number instead of Promise<Status>
59
56
  */
60
- error(message: Config.LocalizationParam, title?: Config.LocalizationParam, options?: Partial<Toaster.ToastOptions>): number;
57
+ error(message: LocalizationParam, title?: LocalizationParam, options?: Partial<Toaster.ToastOptions>): Toaster.ToasterId;
61
58
  /**
62
59
  * Creates a toast with given parameters.
63
60
  * @param message Content of the toast
@@ -65,29 +62,31 @@ export interface ToasterService {
65
62
  * @param severity Sets color of the toast. "success", "warning" etc.
66
63
  * @param options Specific style or structural options for individual toast
67
64
  * @returns Toast ID
68
- * @since 2.0.0
69
65
  */
70
- show(message: Config.LocalizationParam, title?: Config.LocalizationParam, severity?: Toaster.Severity, options?: Partial<Toaster.ToastOptions>): number;
66
+ show(message: LocalizationParam, title?: LocalizationParam, severity?: Toaster.Severity, options?: Partial<Toaster.ToastOptions>): Toaster.ToasterId;
71
67
  /**
72
68
  * Removes the toast with given id.
73
69
  * @param id ID of the toast to be removed.
74
- * @since 2.0.0
75
70
  */
76
71
  remove(id: number): void;
77
72
  /**
78
73
  * Removes all open toasts at once.
79
- * @param key Optional container key to clear toasts from specific container
80
- * @since 2.0.0
74
+ * @param containerKey Optional container key to clear toasts from specific container
75
+ * @since 4.0.0 - Renamed parameter from key to containerKey
81
76
  */
82
- clear(key?: string): void;
77
+ clear(containerKey?: string): void;
83
78
  /**
84
79
  * Subscribe to toast updates (mimics RxJS ReplaySubject pattern).
85
80
  * @param subscriber Callback function called with current toasts
86
81
  * @returns Unsubscribe function
87
- * @since 2.0.0
88
82
  */
89
83
  subscribe(subscriber: ToastsSubscriber): () => void;
90
84
  }
85
+ /**
86
+ * Type constraint ensuring ToasterService satisfies the Toaster.Service contract.
87
+ * @since 4.0.0
88
+ */
89
+ export type ToasterContract = Strict<ToasterService, Toaster.Service>;
91
90
  /**
92
91
  * Context value containing the service and current toasts.
93
92
  */
package/dist/index.d.ts CHANGED
@@ -2,11 +2,30 @@
2
2
  * @abpjs/theme-shared
3
3
  *
4
4
  * ABP Framework Theme Shared components for React.
5
- * Translated from @abp/ng.theme.shared v3.0.0
5
+ * Translated from @abp/ng.theme.shared v4.0.0
6
6
  *
7
7
  * This package provides shared UI components, services, and utilities
8
8
  * for theme/modal management in ABP Framework React applications.
9
9
  *
10
+ * Changes in v4.0.0:
11
+ * - Toaster.Toast now uses LocalizationParam instead of Config.LocalizationParam
12
+ * - Added Toaster.ToasterId type (string | number)
13
+ * - Added Toaster.Service interface (contract for toaster implementations)
14
+ * - Added ToasterContract type (Strict<ToasterService, Toaster.Service>)
15
+ * - Confirmation.Options: cancelText/yesText now use LocalizationParam
16
+ * - ConfirmationService/ToasterService: parameters use LocalizationParam
17
+ * - ToasterService methods now return Toaster.ToasterId
18
+ * - ToasterService.clear parameter renamed from key to containerKey
19
+ * - Added SUPPRESS_UNSAVED_CHANGES_WARNING token and context
20
+ * - Added suppressUnsavedChangesWarning prop to Modal component
21
+ * - Enhanced form validation styles with error icon SVG
22
+ * - Added typeahead dropdown styles
23
+ * - Dependency updates to @abp/ng.core v4.0.0
24
+ *
25
+ * Changes in v3.2.0:
26
+ * - Added .datatable-scroll CSS styles for ngx-datatable horizontal scroll fix
27
+ * - Dependency updates to @abp/ng.core v3.2.0
28
+ *
10
29
  * Changes in v3.0.0:
11
30
  * - Added NavItemsService (replaces nav-items utility functions)
12
31
  * - Added NavItem.id property (required unique identifier)