@itwin/itwinui-react 2.3.1-dev.0 → 2.3.2-dev.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.
|
@@ -27,22 +27,22 @@ export default class Toaster {
|
|
|
27
27
|
* Set global Toaster settings for toasts order and placement.
|
|
28
28
|
* Settings will be applied to new toasts on the page.
|
|
29
29
|
*/
|
|
30
|
-
setSettings(newSettings: ToasterSettings):
|
|
30
|
+
setSettings(newSettings: ToasterSettings): void;
|
|
31
31
|
positive(content: React.ReactNode, options?: ToastOptions): {
|
|
32
|
-
close: () =>
|
|
32
|
+
close: () => void;
|
|
33
33
|
};
|
|
34
34
|
informational(content: React.ReactNode, options?: ToastOptions): {
|
|
35
|
-
close: () =>
|
|
35
|
+
close: () => void;
|
|
36
36
|
};
|
|
37
37
|
negative(content: React.ReactNode, options?: ToastOptions): {
|
|
38
|
-
close: () =>
|
|
38
|
+
close: () => void;
|
|
39
39
|
};
|
|
40
40
|
warning(content: React.ReactNode, options?: ToastOptions): {
|
|
41
|
-
close: () =>
|
|
41
|
+
close: () => void;
|
|
42
42
|
};
|
|
43
43
|
private createToast;
|
|
44
44
|
private removeToast;
|
|
45
45
|
private updateView;
|
|
46
46
|
private closeToast;
|
|
47
|
-
closeAll():
|
|
47
|
+
closeAll(): void;
|
|
48
48
|
}
|
|
@@ -83,14 +83,14 @@ class Toaster {
|
|
|
83
83
|
* Set global Toaster settings for toasts order and placement.
|
|
84
84
|
* Settings will be applied to new toasts on the page.
|
|
85
85
|
*/
|
|
86
|
-
|
|
86
|
+
setSettings(newSettings) {
|
|
87
87
|
var _a, _b, _c;
|
|
88
88
|
(_a = newSettings.placement) !== null && _a !== void 0 ? _a : (newSettings.placement = this.settings.placement);
|
|
89
89
|
(_b = newSettings.order) !== null && _b !== void 0 ? _b : (newSettings.order = ((_c = newSettings.placement) === null || _c === void 0 ? void 0 : _c.startsWith('bottom'))
|
|
90
90
|
? 'ascending'
|
|
91
91
|
: 'descending');
|
|
92
92
|
this.settings = newSettings;
|
|
93
|
-
|
|
93
|
+
this.asyncInit().then(() => {
|
|
94
94
|
var _a, _b;
|
|
95
95
|
(_a = this.toastsRef.current) === null || _a === void 0 ? void 0 : _a.setPlacement((_b = this.settings.placement) !== null && _b !== void 0 ? _b : 'top');
|
|
96
96
|
});
|
|
@@ -126,37 +126,36 @@ class Toaster {
|
|
|
126
126
|
},
|
|
127
127
|
...(this.settings.order === 'descending' ? this.toasts : []),
|
|
128
128
|
];
|
|
129
|
-
// cannot `await` this, for backwards compat with the return value
|
|
130
129
|
this.updateView();
|
|
131
130
|
return { close: () => this.closeToast(currentId) };
|
|
132
131
|
}
|
|
133
|
-
|
|
132
|
+
removeToast(id) {
|
|
134
133
|
this.toasts = this.toasts.filter((toast) => toast.id !== id);
|
|
135
134
|
this.updateView();
|
|
136
135
|
}
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
updateView() {
|
|
137
|
+
this.asyncInit().then(() => {
|
|
139
138
|
var _a;
|
|
140
139
|
(_a = this.toastsRef.current) === null || _a === void 0 ? void 0 : _a.setToasts(this.toasts);
|
|
141
140
|
});
|
|
142
141
|
}
|
|
143
|
-
|
|
142
|
+
closeToast(toastId) {
|
|
144
143
|
this.toasts = this.toasts.map((toast) => {
|
|
145
144
|
return {
|
|
146
145
|
...toast,
|
|
147
146
|
isVisible: toast.id !== toastId,
|
|
148
147
|
};
|
|
149
148
|
});
|
|
150
|
-
|
|
149
|
+
this.updateView();
|
|
151
150
|
}
|
|
152
|
-
|
|
151
|
+
closeAll() {
|
|
153
152
|
this.toasts = this.toasts.map((toast) => {
|
|
154
153
|
return {
|
|
155
154
|
...toast,
|
|
156
155
|
isVisible: false,
|
|
157
156
|
};
|
|
158
157
|
});
|
|
159
|
-
|
|
158
|
+
this.updateView();
|
|
160
159
|
}
|
|
161
160
|
}
|
|
162
161
|
exports.default = Toaster;
|
|
@@ -27,22 +27,22 @@ export default class Toaster {
|
|
|
27
27
|
* Set global Toaster settings for toasts order and placement.
|
|
28
28
|
* Settings will be applied to new toasts on the page.
|
|
29
29
|
*/
|
|
30
|
-
setSettings(newSettings: ToasterSettings):
|
|
30
|
+
setSettings(newSettings: ToasterSettings): void;
|
|
31
31
|
positive(content: React.ReactNode, options?: ToastOptions): {
|
|
32
|
-
close: () =>
|
|
32
|
+
close: () => void;
|
|
33
33
|
};
|
|
34
34
|
informational(content: React.ReactNode, options?: ToastOptions): {
|
|
35
|
-
close: () =>
|
|
35
|
+
close: () => void;
|
|
36
36
|
};
|
|
37
37
|
negative(content: React.ReactNode, options?: ToastOptions): {
|
|
38
|
-
close: () =>
|
|
38
|
+
close: () => void;
|
|
39
39
|
};
|
|
40
40
|
warning(content: React.ReactNode, options?: ToastOptions): {
|
|
41
|
-
close: () =>
|
|
41
|
+
close: () => void;
|
|
42
42
|
};
|
|
43
43
|
private createToast;
|
|
44
44
|
private removeToast;
|
|
45
45
|
private updateView;
|
|
46
46
|
private closeToast;
|
|
47
|
-
closeAll():
|
|
47
|
+
closeAll(): void;
|
|
48
48
|
}
|
|
@@ -55,14 +55,14 @@ export default class Toaster {
|
|
|
55
55
|
* Set global Toaster settings for toasts order and placement.
|
|
56
56
|
* Settings will be applied to new toasts on the page.
|
|
57
57
|
*/
|
|
58
|
-
|
|
58
|
+
setSettings(newSettings) {
|
|
59
59
|
var _a, _b, _c;
|
|
60
60
|
(_a = newSettings.placement) !== null && _a !== void 0 ? _a : (newSettings.placement = this.settings.placement);
|
|
61
61
|
(_b = newSettings.order) !== null && _b !== void 0 ? _b : (newSettings.order = ((_c = newSettings.placement) === null || _c === void 0 ? void 0 : _c.startsWith('bottom'))
|
|
62
62
|
? 'ascending'
|
|
63
63
|
: 'descending');
|
|
64
64
|
this.settings = newSettings;
|
|
65
|
-
|
|
65
|
+
this.asyncInit().then(() => {
|
|
66
66
|
var _a, _b;
|
|
67
67
|
(_a = this.toastsRef.current) === null || _a === void 0 ? void 0 : _a.setPlacement((_b = this.settings.placement) !== null && _b !== void 0 ? _b : 'top');
|
|
68
68
|
});
|
|
@@ -98,36 +98,35 @@ export default class Toaster {
|
|
|
98
98
|
},
|
|
99
99
|
...(this.settings.order === 'descending' ? this.toasts : []),
|
|
100
100
|
];
|
|
101
|
-
// cannot `await` this, for backwards compat with the return value
|
|
102
101
|
this.updateView();
|
|
103
102
|
return { close: () => this.closeToast(currentId) };
|
|
104
103
|
}
|
|
105
|
-
|
|
104
|
+
removeToast(id) {
|
|
106
105
|
this.toasts = this.toasts.filter((toast) => toast.id !== id);
|
|
107
106
|
this.updateView();
|
|
108
107
|
}
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
updateView() {
|
|
109
|
+
this.asyncInit().then(() => {
|
|
111
110
|
var _a;
|
|
112
111
|
(_a = this.toastsRef.current) === null || _a === void 0 ? void 0 : _a.setToasts(this.toasts);
|
|
113
112
|
});
|
|
114
113
|
}
|
|
115
|
-
|
|
114
|
+
closeToast(toastId) {
|
|
116
115
|
this.toasts = this.toasts.map((toast) => {
|
|
117
116
|
return {
|
|
118
117
|
...toast,
|
|
119
118
|
isVisible: toast.id !== toastId,
|
|
120
119
|
};
|
|
121
120
|
});
|
|
122
|
-
|
|
121
|
+
this.updateView();
|
|
123
122
|
}
|
|
124
|
-
|
|
123
|
+
closeAll() {
|
|
125
124
|
this.toasts = this.toasts.map((toast) => {
|
|
126
125
|
return {
|
|
127
126
|
...toast,
|
|
128
127
|
isVisible: false,
|
|
129
128
|
};
|
|
130
129
|
});
|
|
131
|
-
|
|
130
|
+
this.updateView();
|
|
132
131
|
}
|
|
133
132
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/itwinui-react",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2-dev.0",
|
|
4
4
|
"author": "Bentley Systems",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "cjs/index.js",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"dev:types": "concurrently \"tsc -p tsconfig.cjs.json --emitDeclarationOnly --watch --preserveWatchOutput\" \"tsc -p tsconfig.esm.json --emitDeclarationOnly --watch --preserveWatchOutput\""
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@itwin/itwinui-css": "
|
|
65
|
+
"@itwin/itwinui-css": "1.4.1-dev.0",
|
|
66
66
|
"@itwin/itwinui-illustrations-react": "^2.0.0",
|
|
67
67
|
"@itwin/itwinui-variables": "^1.0.0",
|
|
68
68
|
"@tippyjs/react": "^4.2.6",
|