@schukai/monster 3.109.0 → 3.110.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/CHANGELOG.md
CHANGED
package/package.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.6.13","@popperjs/core":"^2.11.8","buffer":"^6.0.3"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"3.
|
1
|
+
{"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.6.13","@popperjs/core":"^2.11.8","buffer":"^6.0.3"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"3.110.0"}
|
@@ -30,6 +30,7 @@ import "./datasource/rest.mjs";
|
|
30
30
|
import "../form/popper.mjs";
|
31
31
|
import "../form/context-error.mjs";
|
32
32
|
import { StatusStyleSheet } from "./stylesheet/status.mjs";
|
33
|
+
import {Formatter} from "../../text/formatter.mjs";
|
33
34
|
|
34
35
|
export { DatasourceStatus };
|
35
36
|
|
@@ -82,6 +83,11 @@ class DatasourceStatus extends CustomElement {
|
|
82
83
|
* @property {string} templates.main Main template
|
83
84
|
* @property {Object} datasource Datasource configuration
|
84
85
|
* @property {string} datasource.selector The selector of the datasource
|
86
|
+
* @property {Object} callbacks Callbacks
|
87
|
+
* @property {Function} callbacks.onError Callback function for error handling
|
88
|
+
* @property {Object} timeouts Timeouts
|
89
|
+
* @property {number} timeouts.message Timeout for the message
|
90
|
+
* @property {Object} state State
|
85
91
|
*/
|
86
92
|
get defaults() {
|
87
93
|
return Object.assign({}, super.defaults, {
|
@@ -93,6 +99,11 @@ class DatasourceStatus extends CustomElement {
|
|
93
99
|
selector: null,
|
94
100
|
},
|
95
101
|
|
102
|
+
callbacks: {
|
103
|
+
onError: null
|
104
|
+
},
|
105
|
+
|
106
|
+
|
96
107
|
timeouts: {
|
97
108
|
message: 4000,
|
98
109
|
},
|
@@ -205,6 +216,12 @@ function initEventHandler() {
|
|
205
216
|
}
|
206
217
|
} catch (e) {
|
207
218
|
} finally {
|
219
|
+
|
220
|
+
const callback = self.getOption("callbacks.onError", null);
|
221
|
+
if (callback) {
|
222
|
+
msg = callback(msg);
|
223
|
+
}
|
224
|
+
|
208
225
|
self[errorElementSymbol].setErrorMessage(msg, timeout);
|
209
226
|
}
|
210
227
|
});
|