@schukai/monster 3.95.2 → 3.96.1
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 +26 -0
- package/package.json +1 -1
- package/source/components/content/copy.mjs +1 -1
- package/source/components/datatable/dataset.mjs +29 -25
- package/source/components/datatable/datasource/dom.mjs +4 -6
- package/source/components/datatable/datasource/rest.mjs +472 -474
- package/source/components/datatable/datasource.mjs +0 -8
- package/source/components/datatable/pagination.mjs +434 -440
- package/source/components/datatable/status.mjs +1 -3
- package/source/components/datatable/stylesheet/pagination.mjs +13 -6
- package/source/components/datatable/util.mjs +1 -1
- package/source/components/form/api-bar.mjs +1 -1
- package/source/components/form/api-button.mjs +1 -1
- package/source/components/form/button-bar.mjs +1 -1
- package/source/components/form/button.mjs +2 -2
- package/source/components/form/confirm-button.mjs +1 -1
- package/source/components/form/form.mjs +7 -5
- package/source/components/form/select.mjs +2014 -2006
- package/source/components/form/style/field-set.pcss +9 -0
- package/source/components/form/style/toggle-switch.pcss +3 -0
- package/source/components/form/stylesheet/field-set.mjs +7 -14
- package/source/components/form/stylesheet/toggle-switch.mjs +7 -14
- package/source/components/form/toggle-switch.mjs +386 -334
- package/source/components/layout/tabs.mjs +900 -898
- package/source/components/layout/width-toggle.mjs +1 -1
- package/source/components/navigation/table-of-content.mjs +1 -1
- package/source/components/notify/message.mjs +11 -15
- package/source/components/notify/notify.mjs +11 -15
- package/source/components/notify/stylesheet/notify.mjs +13 -6
- package/source/components/state/log.mjs +185 -185
- package/source/components/state/state.mjs +1 -1
- package/source/components/state/stylesheet/log.mjs +13 -6
- package/source/components/style/theme.css +4 -4
- package/source/data/datasource/server/restapi.mjs +2 -3
- package/source/data/transformer.mjs +803 -806
- package/source/dom/constants.mjs +8 -5
- package/source/dom/customelement.mjs +0 -34
- package/source/dom/updater.mjs +764 -767
- package/source/i18n/time-ago.mjs +1352 -636
- package/source/monster.mjs +2 -0
- package/source/types/has.mjs +3 -6
- package/source/types/version.mjs +1 -1
- package/test/cases/components/form/form.mjs +166 -125
- package/test/cases/components/form/toggle-switch.mjs +80 -65
- package/test/cases/monster.mjs +1 -1
- package/test/web/import.js +1 -0
- package/test/web/test.html +2 -2
- package/test/web/tests.js +2080 -1433
@@ -59,7 +59,7 @@ const MODE_WIDE = "wide";
|
|
59
59
|
*
|
60
60
|
* @fragments /fragments/components/layout/width-toggle/
|
61
61
|
*
|
62
|
-
* @example /examples/components/layout/width-toggle-simple
|
62
|
+
* @example /examples/components/layout/width-toggle-simple Toggle Width
|
63
63
|
*
|
64
64
|
* @since 3.57.0
|
65
65
|
* @copyright schukai GmbH
|
@@ -73,7 +73,7 @@ const scrollableEventHandlerSymbol = Symbol("scrollableEventHandler");
|
|
73
73
|
*
|
74
74
|
* @fragments /fragments/components/form/table-of-content
|
75
75
|
*
|
76
|
-
* @example /examples/components/form/table-of-content-simple
|
76
|
+
* @example /examples/components/form/table-of-content-simple Table of content
|
77
77
|
*
|
78
78
|
* @since 3.65.0
|
79
79
|
* @copyright schukai GmbH
|
@@ -70,7 +70,7 @@ const removeEventHandlerSymbol = Symbol("removeEventHandler");
|
|
70
70
|
*
|
71
71
|
* @fragments /fragments/components/notify/message
|
72
72
|
*
|
73
|
-
* @example /examples/components/notify/message-simple
|
73
|
+
* @example /examples/components/notify/message-simple Message
|
74
74
|
*
|
75
75
|
* @issue https://localhost.alvine.dev:8443/development/issues/closed/269.html
|
76
76
|
*
|
@@ -108,21 +108,17 @@ class Message extends CustomElement {
|
|
108
108
|
* @property {string} content The content of the message
|
109
109
|
*/
|
110
110
|
get defaults() {
|
111
|
-
return Object.assign(
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
features: {
|
117
|
-
close: true,
|
118
|
-
disappear: true,
|
119
|
-
},
|
120
|
-
content: "<slot></slot>",
|
121
|
-
templates: {
|
122
|
-
main: getTemplate(),
|
123
|
-
},
|
111
|
+
return Object.assign({}, super.defaults, {
|
112
|
+
timeout: 6000,
|
113
|
+
features: {
|
114
|
+
close: true,
|
115
|
+
disappear: true,
|
124
116
|
},
|
125
|
-
|
117
|
+
content: "<slot></slot>",
|
118
|
+
templates: {
|
119
|
+
main: getTemplate(),
|
120
|
+
},
|
121
|
+
});
|
126
122
|
}
|
127
123
|
|
128
124
|
/**
|
@@ -49,8 +49,8 @@ const queueSymbol = Symbol("queue");
|
|
49
49
|
*
|
50
50
|
* @fragments /fragments/components/notify/notify
|
51
51
|
*
|
52
|
-
* @example /examples/components/notify/notify-simple
|
53
|
-
* @example /examples/components/notify/notify-inline
|
52
|
+
* @example /examples/components/notify/notify-simple Notify
|
53
|
+
* @example /examples/components/notify/notify-inline Inline Notify
|
54
54
|
*
|
55
55
|
* @issue https://localhost.alvine.dev:8443/development/issues/closed/269.html
|
56
56
|
*
|
@@ -73,20 +73,16 @@ class Notify extends CustomElement {
|
|
73
73
|
* @property {string} classes.control The control class of the notify element.
|
74
74
|
*/
|
75
75
|
get defaults() {
|
76
|
-
return Object.assign(
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
orientation: "left top",
|
81
|
-
templates: {
|
82
|
-
main: getTemplate(),
|
83
|
-
},
|
84
|
-
classes: {
|
85
|
-
container: "",
|
86
|
-
control: "center"
|
87
|
-
}
|
76
|
+
return Object.assign({}, super.defaults, {
|
77
|
+
orientation: "left top",
|
78
|
+
templates: {
|
79
|
+
main: getTemplate(),
|
88
80
|
},
|
89
|
-
|
81
|
+
classes: {
|
82
|
+
container: "",
|
83
|
+
control: "center",
|
84
|
+
},
|
85
|
+
});
|
90
86
|
}
|
91
87
|
|
92
88
|
/**
|
@@ -10,10 +10,10 @@
|
|
10
10
|
* For more information about purchasing a commercial license, please contact schukai GmbH.
|
11
11
|
*/
|
12
12
|
|
13
|
-
import {addAttributeToken} from "../../../dom/attributes.mjs";
|
14
|
-
import {ATTRIBUTE_ERRORMESSAGE} from "../../../dom/constants.mjs";
|
13
|
+
import { addAttributeToken } from "../../../dom/attributes.mjs";
|
14
|
+
import { ATTRIBUTE_ERRORMESSAGE } from "../../../dom/constants.mjs";
|
15
15
|
|
16
|
-
export {NotifyStyleSheet}
|
16
|
+
export { NotifyStyleSheet };
|
17
17
|
|
18
18
|
/**
|
19
19
|
* @private
|
@@ -22,10 +22,17 @@ export {NotifyStyleSheet}
|
|
22
22
|
const NotifyStyleSheet = new CSSStyleSheet();
|
23
23
|
|
24
24
|
try {
|
25
|
-
|
25
|
+
NotifyStyleSheet.insertRule(
|
26
|
+
`
|
26
27
|
@layer notify {
|
27
28
|
.block{display:block}.inline{display:inline}.inline-block{display:inline-block}.grid{display:grid}.inline-grid{display:inline-grid}.flex{display:flex}.inline-flex{display:inline-flex}.hidden,.hide,.none{display:none}.visible{visibility:visible}.invisible{visibility:hidden}.monster-border-primary-1,.monster-border-primary-2,.monster-border-primary-3,.monster-border-primary-4{border-radius:var(--monster-border-radius);border-style:var(--monster-border-style);border-width:var(--monster-border-width)}.monster-border-0{border-radius:0;border-style:none;border-width:0}.monster-border-primary-1{border-color:var(--monster-bg-color-primary-1)}.monster-border-primary-2{border-color:var(--monster-bg-color-primary-2)}.monster-border-primary-3{border-color:var(--monster-bg-color-primary-3)}.monster-border-primary-4{border-color:var(--monster-bg-color-primary-4)}.monster-border-secondary-1,.monster-border-secondary-2,.monster-border-secondary-3,.monster-border-secondary-4{border-radius:var(--monster-border-radius);border-style:var(--monster-border-style);border-width:var(--monster-border-width)}.monster-border-secondary-1{border-color:var(--monster-bg-color-secondary-1)}.monster-border-secondary-2{border-color:var(--monster-bg-color-secondary-2)}.monster-border-secondary-3{border-color:var(--monster-bg-color-secondary-3)}.monster-border-secondary-4{border-color:var(--monster-bg-color-secondary-4)}.monster-border-tertiary-1,.monster-border-tertiary-2,.monster-border-tertiary-3,.monster-border-tertiary-4{border-radius:var(--monster-border-radius);border-style:var(--monster-border-style);border-width:var(--monster-border-width)}.monster-border-tertiary-1{border-color:var(--monster-bg-color-tertiary-1)}.monster-border-tertiary-2{border-color:var(--monster-bg-color-tertiary-2)}.monster-border-tertiary-3{border-color:var(--monster-bg-color-tertiary-3)}.monster-border-tertiary-4{border-color:var(--monster-bg-color-tertiary-4)}[data-monster-role=control]{box-sizing:border-box;outline:none;width:100%}[data-monster-role=control].flex{align-items:center;display:flex;flex-direction:row}:host{box-sizing:border-box;display:block}div[data-monster-role=control]{align-items:flex-start;border:0;box-sizing:border-box;display:flex;flex-direction:row;justify-content:space-between;margin:0;max-height:100vH;pointer-events:none;right:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:25rem;z-index:var(--monster-z-index-modal-overlay)}div[data-monster-role=control]:not(.inline){position:absolute}div[data-monster-role=control].inline{--monster-message-border-shadow:none}[data-monster-role=control][data-monster-orientation*=left]{left:0;right:auto}[data-monster-role=control][data-monster-orientation*=right]{left:auto;right:0}[data-monster-role=control][data-monster-orientation*=center]{left:50%;transform:translate(-50%)}[data-monster-role=control][data-monster-orientation*=bottom]{align-items:flex-end;bottom:0}[data-monster-role=control][data-monster-orientation*=top]{align-items:flex-start;top:0}[data-monster-role=container]{width:100%}[data-monster-role=message]{background-clip:padding-box;background-color:var(--monster-bg-color-primary-1);border-color:var(--monster-message-border-color,rgba(0,0,0,.1));border-radius:var(--monster-message-border-radius,.25rem);border-style:var(--monster-message-border-style,solid);border-width:var(--monster-message-border-width,1px);box-shadow:var(--monster-message-border-shadow,0 .5rem 1rem rgba(0,0,0,.15));color:var(--monster-color-primary-1);display:flex;font-size:.875rem;margin:var(--monster-message-margin-top,15px) var(--monster-message-margin-right,5px) var(--monster-message-margin-bottom,0) var(--monster-message-margin-left,0);max-height:200px;max-width:100%;overflow:hidden;padding:var(--monster-message-padding-top,5px) var(--monster-message-padding-right,5px) var(--monster-message-padding-bottom,5px) var(--monster-message-padding-left,5px);pointer-events:auto;position:relative;text-overflow:ellipsis;-webkit-user-select:text;-moz-user-select:text;user-select:text;width:100%}[data-monster-role=message]:first-child{margin-top:0}[data-monster-role=message].fadeout{border:0;margin-bottom:0;margin-top:0;max-height:0;padding-bottom:0;padding-top:0;transition:all .2s cubic-bezier(1,-.04,0,1.03)}
|
28
|
-
}`,
|
29
|
+
}`,
|
30
|
+
0,
|
31
|
+
);
|
29
32
|
} catch (e) {
|
30
|
-
|
33
|
+
addAttributeToken(
|
34
|
+
document.getRootNode().querySelector("html"),
|
35
|
+
ATTRIBUTE_ERRORMESSAGE,
|
36
|
+
e + "",
|
37
|
+
);
|
31
38
|
}
|
@@ -12,20 +12,20 @@
|
|
12
12
|
* SPDX-License-Identifier: AGPL-3.0
|
13
13
|
*/
|
14
14
|
|
15
|
-
import {instanceSymbol} from "../../constants.mjs";
|
15
|
+
import { instanceSymbol } from "../../constants.mjs";
|
16
16
|
import {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
assembleMethodSymbol,
|
18
|
+
CustomElement,
|
19
|
+
getSlottedElements,
|
20
|
+
registerCustomElement,
|
21
21
|
} from "../../dom/customelement.mjs";
|
22
|
-
import {LogStyleSheet} from "./stylesheet/log.mjs";
|
23
|
-
import {Entry} from "./log/entry.mjs";
|
24
|
-
import {validateInstance, validateString} from "../../types/validate.mjs";
|
22
|
+
import { LogStyleSheet } from "./stylesheet/log.mjs";
|
23
|
+
import { Entry } from "./log/entry.mjs";
|
24
|
+
import { validateInstance, validateString } from "../../types/validate.mjs";
|
25
25
|
import "./state.mjs";
|
26
|
-
import {getWindow} from "../../dom/util.mjs";
|
26
|
+
import { getWindow } from "../../dom/util.mjs";
|
27
27
|
|
28
|
-
export {Log};
|
28
|
+
export { Log };
|
29
29
|
|
30
30
|
/**
|
31
31
|
* @private
|
@@ -44,7 +44,7 @@ const emptyStateElementSymbol = Symbol("emptyStateElement");
|
|
44
44
|
*
|
45
45
|
* @fragments /fragments/components/state/log
|
46
46
|
*
|
47
|
-
* @example /examples/components/state/log-simple
|
47
|
+
* @example /examples/components/state/log-simple Log
|
48
48
|
*
|
49
49
|
* @issue https://localhost.alvine.dev:8444/development/issues/closed/270.html
|
50
50
|
*
|
@@ -53,146 +53,146 @@ const emptyStateElementSymbol = Symbol("emptyStateElement");
|
|
53
53
|
* @summary The log entry is a single entry in the log.
|
54
54
|
**/
|
55
55
|
class Log extends CustomElement {
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
56
|
+
/**
|
57
|
+
* @return {void}
|
58
|
+
*/
|
59
|
+
[assembleMethodSymbol]() {
|
60
|
+
super[assembleMethodSymbol]();
|
61
|
+
|
62
|
+
initControlReferences.call(this);
|
63
|
+
initEventHandler.call(this);
|
64
|
+
}
|
65
|
+
|
66
|
+
/**
|
67
|
+
* This method is called by the `instanceof` operator.
|
68
|
+
* @return {symbol}
|
69
|
+
*/
|
70
|
+
static get [instanceSymbol]() {
|
71
|
+
return Symbol.for("@schukai/monster/components/state/log@@instance");
|
72
|
+
}
|
73
|
+
|
74
|
+
/**
|
75
|
+
* To set the options via the HTML tag, the attribute `data-monster-options` must be used.
|
76
|
+
* @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
|
77
|
+
*
|
78
|
+
* The individual configuration values can be found in the table.
|
79
|
+
*
|
80
|
+
* @property {Object} templates Template definitions
|
81
|
+
* @property {string} templates.main Main template
|
82
|
+
* @property {Object} labels Labels
|
83
|
+
* @property {string} labels.nothingToReport Label for empty state
|
84
|
+
* @property {Object} classes Classes
|
85
|
+
* @property {string} classes.direction Direction of the log: ascending or descending
|
86
|
+
* @property {number} updateFrequency Update frequency in milliseconds for the timestamp
|
87
|
+
*/
|
88
|
+
get defaults() {
|
89
|
+
return Object.assign({}, super.defaults, {
|
90
|
+
templates: {
|
91
|
+
main: getTemplate(),
|
92
|
+
},
|
93
|
+
|
94
|
+
labels: {
|
95
|
+
nothingToReport: "There is nothing to report yet.",
|
96
|
+
},
|
97
|
+
|
98
|
+
features: {
|
99
|
+
direction: "ascending",
|
100
|
+
},
|
101
|
+
|
102
|
+
updateFrequency: 10000,
|
103
|
+
|
104
|
+
entries: [],
|
105
|
+
|
106
|
+
timestamp: 0,
|
107
|
+
});
|
108
|
+
}
|
109
|
+
|
110
|
+
/**
|
111
|
+
* @return {void}
|
112
|
+
*/
|
113
|
+
connectedCallback() {
|
114
|
+
super.connectedCallback();
|
115
|
+
|
116
|
+
const slottedElements = getSlottedElements.call(this);
|
117
|
+
if (slottedElements.size > 0) {
|
118
|
+
this[emptyStateElementSymbol].style.display = "none";
|
119
|
+
}
|
120
|
+
}
|
121
|
+
|
122
|
+
/**
|
123
|
+
* Clear the log
|
124
|
+
*
|
125
|
+
* @return {Log}
|
126
|
+
*/
|
127
|
+
clear() {
|
128
|
+
this[logElementSymbol].setOption("entries", []);
|
129
|
+
return this;
|
130
|
+
}
|
131
|
+
|
132
|
+
/**
|
133
|
+
* Add an entry to the log
|
134
|
+
* @param {Entry} entry
|
135
|
+
* @return {Log}
|
136
|
+
*/
|
137
|
+
addEntry(entry) {
|
138
|
+
validateInstance(entry, Entry);
|
139
|
+
|
140
|
+
if (entry.date === undefined || entry.date === null) {
|
141
|
+
entry.date = new Date();
|
142
|
+
}
|
143
|
+
|
144
|
+
const entries = this.getOption("entries");
|
145
|
+
if (this.getOption("features.direction") === "ascending") {
|
146
|
+
entries.unshift(entry);
|
147
|
+
} else {
|
148
|
+
entries.push(entry);
|
149
|
+
}
|
150
|
+
|
151
|
+
/** this field is not used, but triggers a change event */
|
152
|
+
this.setOption("length", entries.length - 1);
|
153
|
+
|
154
|
+
return this;
|
155
|
+
}
|
156
|
+
|
157
|
+
/**
|
158
|
+
* Add a log message
|
159
|
+
*
|
160
|
+
* @param {string} message
|
161
|
+
* @param {Date} date
|
162
|
+
* @return {Log}
|
163
|
+
* @throws {TypeError} message is not a string
|
164
|
+
*/
|
165
|
+
addMessage(message, date) {
|
166
|
+
if (!date) {
|
167
|
+
date = new Date();
|
168
|
+
}
|
169
|
+
|
170
|
+
validateString(message);
|
171
|
+
|
172
|
+
this.addEntry(
|
173
|
+
new Entry({
|
174
|
+
message: message,
|
175
|
+
date: date,
|
176
|
+
}),
|
177
|
+
);
|
178
|
+
|
179
|
+
return this;
|
180
|
+
}
|
181
|
+
|
182
|
+
/**
|
183
|
+
*
|
184
|
+
* @return {string}
|
185
|
+
*/
|
186
|
+
static getTag() {
|
187
|
+
return "monster-log";
|
188
|
+
}
|
189
|
+
|
190
|
+
/**
|
191
|
+
* @return {CSSStyleSheet[]}
|
192
|
+
*/
|
193
|
+
static getCSSStyleSheet() {
|
194
|
+
return [LogStyleSheet];
|
195
|
+
}
|
196
196
|
}
|
197
197
|
|
198
198
|
/**
|
@@ -201,44 +201,44 @@ class Log extends CustomElement {
|
|
201
201
|
* @throws {Error} no shadow-root is defined
|
202
202
|
*/
|
203
203
|
function initControlReferences() {
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
204
|
+
if (!this.shadowRoot) {
|
205
|
+
throw new Error("no shadow-root is defined");
|
206
|
+
}
|
207
|
+
|
208
|
+
this[logElementSymbol] = this.shadowRoot.querySelector(
|
209
|
+
"[data-monster-role=control]",
|
210
|
+
);
|
211
|
+
this[emptyStateElementSymbol] = this.shadowRoot.querySelector(
|
212
|
+
"[data-monster-role=empty-state]",
|
213
|
+
);
|
214
214
|
}
|
215
215
|
|
216
216
|
/**
|
217
217
|
* @private
|
218
218
|
*/
|
219
219
|
function initEventHandler() {
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
220
|
+
if (!this.shadowRoot) {
|
221
|
+
throw new Error("no shadow-root is defined");
|
222
|
+
}
|
223
|
+
|
224
|
+
this.shadowRoot.addEventListener("slotchange", (event) => {
|
225
|
+
const slottedElements = getSlottedElements.call(this);
|
226
|
+
|
227
|
+
if (slottedElements.size > 0) {
|
228
|
+
this[emptyStateElementSymbol].style.display = "none";
|
229
|
+
} else {
|
230
|
+
this[emptyStateElementSymbol].style.display = "block";
|
231
|
+
}
|
232
|
+
});
|
233
|
+
|
234
|
+
setInterval(() => {
|
235
|
+
getWindow().requestAnimationFrame(() => {
|
236
|
+
const timestamp = new Date().toTimeString();
|
237
|
+
this.setOption("timestamp", timestamp);
|
238
|
+
});
|
239
|
+
}, this.getOption("updateFrequency"));
|
240
|
+
|
241
|
+
return this;
|
242
242
|
}
|
243
243
|
|
244
244
|
/**
|
@@ -246,8 +246,8 @@ function initEventHandler() {
|
|
246
246
|
* @return {string}
|
247
247
|
*/
|
248
248
|
function getTemplate() {
|
249
|
-
|
250
|
-
|
249
|
+
// language=HTML
|
250
|
+
return `
|
251
251
|
<template id="entry">
|
252
252
|
<li data-monster-role="entry">
|
253
253
|
<span data-monster-replace="path:entry.user"
|
@@ -10,10 +10,10 @@
|
|
10
10
|
* For more information about purchasing a commercial license, please contact schukai GmbH.
|
11
11
|
*/
|
12
12
|
|
13
|
-
import {addAttributeToken} from "../../../dom/attributes.mjs";
|
14
|
-
import {ATTRIBUTE_ERRORMESSAGE} from "../../../dom/constants.mjs";
|
13
|
+
import { addAttributeToken } from "../../../dom/attributes.mjs";
|
14
|
+
import { ATTRIBUTE_ERRORMESSAGE } from "../../../dom/constants.mjs";
|
15
15
|
|
16
|
-
export {LogStyleSheet}
|
16
|
+
export { LogStyleSheet };
|
17
17
|
|
18
18
|
/**
|
19
19
|
* @private
|
@@ -22,10 +22,17 @@ export {LogStyleSheet}
|
|
22
22
|
const LogStyleSheet = new CSSStyleSheet();
|
23
23
|
|
24
24
|
try {
|
25
|
-
|
25
|
+
LogStyleSheet.insertRule(
|
26
|
+
`
|
26
27
|
@layer log {
|
27
28
|
[data-monster-role=control]{box-sizing:border-box;outline:none;width:100%}[data-monster-role=control].flex{align-items:center;display:flex;flex-direction:row}:host{box-sizing:border-box;display:block}.block{display:block}.inline{display:inline}.inline-block{display:inline-block}.grid{display:grid}.inline-grid{display:inline-grid}.flex{display:flex}.inline-flex{display:inline-flex}.hidden,.hide,.none{display:none}.visible{visibility:visible}.invisible{visibility:hidden}.monster-border-primary-1,.monster-border-primary-2,.monster-border-primary-3,.monster-border-primary-4{border-radius:var(--monster-border-radius);border-style:var(--monster-border-style);border-width:var(--monster-border-width)}.monster-border-0{border-radius:0;border-style:none;border-width:0}.monster-border-primary-1{border-color:var(--monster-bg-color-primary-1)}.monster-border-primary-2{border-color:var(--monster-bg-color-primary-2)}.monster-border-primary-3{border-color:var(--monster-bg-color-primary-3)}.monster-border-primary-4{border-color:var(--monster-bg-color-primary-4)}.monster-border-secondary-1,.monster-border-secondary-2,.monster-border-secondary-3,.monster-border-secondary-4{border-radius:var(--monster-border-radius);border-style:var(--monster-border-style);border-width:var(--monster-border-width)}.monster-border-secondary-1{border-color:var(--monster-bg-color-secondary-1)}.monster-border-secondary-2{border-color:var(--monster-bg-color-secondary-2)}.monster-border-secondary-3{border-color:var(--monster-bg-color-secondary-3)}.monster-border-secondary-4{border-color:var(--monster-bg-color-secondary-4)}.monster-border-tertiary-1,.monster-border-tertiary-2,.monster-border-tertiary-3,.monster-border-tertiary-4{border-radius:var(--monster-border-radius);border-style:var(--monster-border-style);border-width:var(--monster-border-width)}.monster-border-tertiary-1{border-color:var(--monster-bg-color-tertiary-1)}.monster-border-tertiary-2{border-color:var(--monster-bg-color-tertiary-2)}.monster-border-tertiary-3{border-color:var(--monster-bg-color-tertiary-3)}.monster-border-tertiary-4{border-color:var(--monster-bg-color-tertiary-4)}[data-monster-role=entries]{align-items:flex-start;border:0;box-sizing:border-box;display:flex;flex-direction:column;margin:0;padding:0;position:relative}[data-monster-role=entries] ul{list-style-type:none;margin:0;padding:0 0 0 1.8rem;width:100%}[data-monster-role=entries] ul:before{border-left:1px dotted var(--monster-bg-color-primary-3);bottom:0;content:\"\";display:block;height:100%;left:1rem;position:absolute;top:0;width:2px}[data-monster-role=entries] ul li{background-color:var(--monster-bg-color-primary-1);color:var(--monster-color-primary-1);margin:0;padding:.35rem .3rem;position:relative}:is([data-monster-role=entries] ul li) .title{font-stretch:expanded;font-weight:bolder}:is([data-monster-role=entries] ul li) .title:before{content:\"—\";font-weight:400;margin-right:.3rem}[data-monster-role=entries] ul li:before{background:var(--monster-bg-color-primary-3);border:1px solid var(--monster-color-primary-2);border-radius:50%;box-sizing:border-box;content:\"\";height:6px;left:calc(-1rem + 1.25px);position:absolute;top:.85rem;width:6px}
|
28
|
-
}`,
|
29
|
+
}`,
|
30
|
+
0,
|
31
|
+
);
|
29
32
|
} catch (e) {
|
30
|
-
|
33
|
+
addAttributeToken(
|
34
|
+
document.getRootNode().querySelector("html"),
|
35
|
+
ATTRIBUTE_ERRORMESSAGE,
|
36
|
+
e + "",
|
37
|
+
);
|
31
38
|
}
|
@@ -36,7 +36,7 @@
|
|
36
36
|
color: var(--monster-color-selection-1);
|
37
37
|
}
|
38
38
|
.monster-border-color-1 {
|
39
|
-
border-color: var(--monster-color-
|
39
|
+
border-color: var(--monster-color-primary-4);
|
40
40
|
}
|
41
41
|
.monster-color-neutral-1 {
|
42
42
|
color: var(--monster-color-primary-1);
|
@@ -119,7 +119,7 @@
|
|
119
119
|
color: var(--monster-color-selection-2);
|
120
120
|
}
|
121
121
|
.monster-border-color-2 {
|
122
|
-
border-color: var(--monster-color-
|
122
|
+
border-color: var(--monster-color-primary-3);
|
123
123
|
}
|
124
124
|
.monster-color-neutral-2 {
|
125
125
|
color: var(--monster-color-primary-2);
|
@@ -202,7 +202,7 @@
|
|
202
202
|
color: var(--monster-color-selection-3);
|
203
203
|
}
|
204
204
|
.monster-border-color-3 {
|
205
|
-
border-color: var(--monster-color-
|
205
|
+
border-color: var(--monster-color-primary-2);
|
206
206
|
}
|
207
207
|
.monster-color-neutral-3 {
|
208
208
|
color: var(--monster-color-primary-3);
|
@@ -285,7 +285,7 @@
|
|
285
285
|
color: var(--monster-color-selection-4);
|
286
286
|
}
|
287
287
|
.monster-border-color-4 {
|
288
|
-
border-color: var(--monster-color-
|
288
|
+
border-color: var(--monster-color-primary-1);
|
289
289
|
}
|
290
290
|
.monster-color-neutral-4 {
|
291
291
|
color: var(--monster-color-primary-4);
|
@@ -18,7 +18,7 @@ import { diff } from "../../diff.mjs";
|
|
18
18
|
import { Server } from "../server.mjs";
|
19
19
|
import { WriteError } from "./restapi/writeerror.mjs";
|
20
20
|
import { DataFetchError } from "./restapi/data-fetch-error.mjs";
|
21
|
-
import {clone} from "../../../util/clone.mjs";
|
21
|
+
import { clone } from "../../../util/clone.mjs";
|
22
22
|
|
23
23
|
export { RestAPI };
|
24
24
|
|
@@ -176,7 +176,7 @@ class RestAPI extends Server {
|
|
176
176
|
* @return {RestAPI}
|
177
177
|
*/
|
178
178
|
getClone() {
|
179
|
-
const api =
|
179
|
+
const api = new RestAPI();
|
180
180
|
|
181
181
|
const read = clone(this[internalSymbol].getRealSubject()["options"].read);
|
182
182
|
const write = clone(this[internalSymbol].getRealSubject()["options"].write);
|
@@ -185,7 +185,6 @@ class RestAPI extends Server {
|
|
185
185
|
api.setOption("write", write);
|
186
186
|
|
187
187
|
return api;
|
188
|
-
|
189
188
|
}
|
190
189
|
}
|
191
190
|
|