@schukai/monster 3.63.0 → 3.63.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/package.json +1 -1
  3. package/source/components/datatable/dataset.mjs +0 -3
  4. package/source/components/datatable/datatable.mjs +18 -4
  5. package/source/components/datatable/pagination.mjs +0 -2
  6. package/source/components/datatable/save-button.mjs +269 -239
  7. package/source/components/datatable/status.mjs +2 -2
  8. package/source/components/datatable/style/column-bar.pcss +5 -3
  9. package/source/components/datatable/style/dataset.pcss +1 -0
  10. package/source/components/datatable/style/datatable.pcss +8 -18
  11. package/source/components/datatable/style/embedded-pagination.pcss +2 -2
  12. package/source/components/datatable/style/filter.pcss +1 -1
  13. package/source/components/datatable/style/pagination.pcss +3 -3
  14. package/source/components/datatable/stylesheet/change-button.mjs +1 -1
  15. package/source/components/datatable/stylesheet/column-bar.mjs +1 -1
  16. package/source/components/datatable/stylesheet/dataset.mjs +1 -1
  17. package/source/components/datatable/stylesheet/datatable.mjs +1 -1
  18. package/source/components/datatable/stylesheet/embedded-pagination.mjs +1 -1
  19. package/source/components/datatable/stylesheet/filter.mjs +1 -1
  20. package/source/components/datatable/stylesheet/pagination.mjs +1 -1
  21. package/source/components/datatable/stylesheet/save-button.mjs +1 -1
  22. package/source/components/datatable/stylesheet/select-filter.mjs +1 -1
  23. package/source/components/datatable/stylesheet/status.mjs +1 -1
  24. package/source/components/form/context-error.mjs +7 -8
  25. package/source/components/form/context-help.mjs +7 -2
  26. package/source/components/form/select.mjs +22 -5
  27. package/source/components/form/style/context-error.pcss +1 -1
  28. package/source/components/form/style/context-help.pcss +5 -1
  29. package/source/components/form/style/select.pcss +81 -56
  30. package/source/components/form/style/toggle-switch.pcss +0 -6
  31. package/source/components/form/stylesheet/action-button.mjs +1 -1
  32. package/source/components/form/stylesheet/context-error.mjs +1 -1
  33. package/source/components/form/stylesheet/context-help.mjs +1 -1
  34. package/source/components/form/stylesheet/select.mjs +1 -1
  35. package/source/components/form/stylesheet/state-button.mjs +1 -1
  36. package/source/components/form/stylesheet/toggle-switch.mjs +1 -1
  37. package/source/components/form/toggle-switch.mjs +23 -19
  38. package/source/components/host/collapse.mjs +0 -5
  39. package/source/components/host/style/collapse.pcss +3 -2
  40. package/source/components/host/stylesheet/call-button.mjs +1 -1
  41. package/source/components/host/stylesheet/collapse.mjs +1 -1
  42. package/source/components/host/stylesheet/details.mjs +1 -1
  43. package/source/components/host/stylesheet/host.mjs +1 -1
  44. package/source/components/host/stylesheet/overlay.mjs +1 -1
  45. package/source/components/host/stylesheet/toggle-button.mjs +1 -1
  46. package/source/components/host/stylesheet/viewer.mjs +1 -1
  47. package/source/components/layout/split-screen.mjs +3 -1
  48. package/source/components/layout/style/tabs.pcss +0 -1
  49. package/source/components/layout/style/width-toggle.pcss +26 -0
  50. package/source/components/layout/stylesheet/tabs.mjs +1 -1
  51. package/source/components/layout/stylesheet/width-toggle.mjs +27 -0
  52. package/source/components/layout/tabs.mjs +17 -1
  53. package/source/components/layout/width-toggle.mjs +242 -0
  54. package/source/components/notify/stylesheet/message.mjs +1 -1
  55. package/source/components/style/color.pcss +11 -0
  56. package/source/components/style/icons.pcss +73 -69
  57. package/source/components/style/mixin/icon.pcss +32 -37
  58. package/source/components/style/mixin/property.pcss +38 -2
  59. package/source/components/style/property.pcss +2 -0
  60. package/source/components/style/table.pcss +6 -4
  61. package/source/components/style/theme.pcss +33 -5
  62. package/source/components/stylesheet/color.mjs +1 -1
  63. package/source/components/stylesheet/icons.mjs +1 -1
  64. package/source/components/stylesheet/property.mjs +1 -1
  65. package/source/components/stylesheet/table.mjs +1 -1
  66. package/source/components/stylesheet/theme.mjs +1 -1
  67. package/source/dom/customcontrol.mjs +7 -1
  68. package/source/dom/util/init-options-from-attributes.mjs +61 -48
  69. package/source/monster.mjs +2 -0
  70. package/source/types/version.mjs +1 -1
  71. package/test/cases/monster.mjs +1 -1
  72. package/test/web/test.html +2 -2
  73. package/test/web/tests.js +54 -26
@@ -3,30 +3,32 @@
3
3
  * SPDX-License-Identifier: AGPL-3.0
4
4
  */
5
5
 
6
- import { instanceSymbol, internalSymbol } from "../../constants.mjs";
7
- import { diff } from "../../data/diff.mjs";
6
+ import {instanceSymbol, internalSymbol} from "../../constants.mjs";
7
+ import {diff} from "../../data/diff.mjs";
8
+ import {addAttributeToken} from "../../dom/attributes.mjs";
9
+ import {ATTRIBUTE_ERRORMESSAGE} from "../../dom/constants.mjs";
8
10
  import {
9
- assembleMethodSymbol,
10
- CustomElement,
11
- attributeObserverSymbol,
12
- registerCustomElement,
11
+ assembleMethodSymbol,
12
+ CustomElement,
13
+ attributeObserverSymbol,
14
+ registerCustomElement,
13
15
  } from "../../dom/customelement.mjs";
14
- import { isString, isArray } from "../../types/is.mjs";
15
- import { Observer } from "../../types/observer.mjs";
16
- import { TokenList } from "../../types/tokenlist.mjs";
17
- import { clone } from "../../util/clone.mjs";
18
- import { State } from "../form/types/state.mjs";
19
- import { ATTRIBUTE_DATASOURCE_SELECTOR } from "./constants.mjs";
20
- import { Datasource } from "./datasource.mjs";
21
- import { BadgeStyleSheet } from "../stylesheet/badge.mjs";
22
- import { SaveButtonStyleSheet } from "./stylesheet/save-button.mjs";
16
+ import {isString, isArray} from "../../types/is.mjs";
17
+ import {Observer} from "../../types/observer.mjs";
18
+ import {TokenList} from "../../types/tokenlist.mjs";
19
+ import {clone} from "../../util/clone.mjs";
20
+ import {State} from "../form/types/state.mjs";
21
+ import {ATTRIBUTE_DATASOURCE_SELECTOR} from "./constants.mjs";
22
+ import {Datasource} from "./datasource.mjs";
23
+ import {BadgeStyleSheet} from "../stylesheet/badge.mjs";
24
+ import {SaveButtonStyleSheet} from "./stylesheet/save-button.mjs";
23
25
 
24
26
  import {
25
- handleDataSourceChanges,
26
- datasourceLinkedElementSymbol,
27
+ handleDataSourceChanges,
28
+ datasourceLinkedElementSymbol,
27
29
  } from "./util.mjs";
28
30
 
29
- export { SaveButton };
31
+ export {SaveButton};
30
32
 
31
33
  /**
32
34
  * @private
@@ -41,166 +43,194 @@ const stateButtonElementSymbol = Symbol("stateButtonElement");
41
43
  const badgeElementSymbol = Symbol("badgeElement");
42
44
 
43
45
  class SaveButton extends CustomElement {
44
- /**
45
- * This method is called by the `instanceof` operator.
46
- * @returns {symbol}
47
- */
48
- static get [instanceSymbol]() {
49
- return Symbol.for(
50
- "@schukai/monster/components/datasource/save-button@@instance",
51
- );
52
- }
53
-
54
- /**
55
- * To set the options via the html tag the attribute `data-monster-options` must be used.
56
- * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
57
- *
58
- * The individual configuration values can be found in the table.
59
- *
60
- * @property {Object} templates Template definitions
61
- * @property {string} templates.main Main template
62
- * @property {object} datasource The datasource
63
- * @property {string} datasource.selector The selector of the datasource
64
- * @property {object} mapping The mapping
65
- * @property {string} mapping.data The data
66
- * @property {number} mapping.index The index
67
- * @property {Array} data The data
68
- * @return {Object}
69
- */
70
- get defaults() {
71
- const obj = Object.assign({}, super.defaults, {
72
- templates: {
73
- main: getTemplate(),
74
- },
75
-
76
- labels: {
77
- button: "save",
78
- },
79
-
80
- classes: {
81
- bar: "monster-button-primary",
82
- badge: "monster-badge-secondary hidden",
83
- },
84
-
85
- datasource: {
86
- selector: null,
87
- },
88
-
89
- changes: "0",
90
-
91
- mapping: {
92
- data: "dataset",
93
- index: 0,
94
- },
95
-
96
- data: {},
97
-
98
- disabled: false,
99
- });
100
-
101
- updateOptionsFromArguments.call(this, obj);
102
- return obj;
103
- }
104
-
105
- /**
106
- *
107
- * @return {string}
108
- */
109
- static getTag() {
110
- return "monster-datasource-save-button";
111
- }
112
-
113
- /**
114
- * This method is responsible for assembling the component.
115
- *
116
- * It calls the parent's assemble method first, then initializes control references and event handlers.
117
- * If the `datasource.selector` option is provided and is a string, it searches for the corresponding
118
- * element in the DOM using that selector.
119
- *
120
- * If the selector matches exactly one element, it checks if the element is an instance of the `Datasource` class.
121
- *
122
- * If it is, the component's `datasourceLinkedElementSymbol` property is set to the element, and the component
123
- * attaches an observer to the datasource's changes.
124
- *
125
- * The observer is a function that calls the `handleDataSourceChanges` method in the context of the component.
126
- * Additionally, the component attaches an observer to itself, which also calls the `handleDataSourceChanges`
127
- * method in the component's context.
128
- */
129
- [assembleMethodSymbol]() {
130
- super[assembleMethodSymbol]();
131
- const self = this;
132
-
133
- initControlReferences.call(this);
134
- initEventHandler.call(this);
135
-
136
- const selector = this.getOption("datasource.selector");
137
-
138
- if (isString(selector)) {
139
- const elements = document.querySelectorAll(selector);
140
- if (elements.length !== 1) {
141
- throw new Error("the selector must match exactly one element");
142
- }
143
-
144
- const element = elements[0];
145
- if (!(element instanceof Datasource)) {
146
- throw new TypeError("the element must be a datasource");
147
- }
148
-
149
- this[datasourceLinkedElementSymbol] = element;
150
- element.datasource.attachObserver(
151
- new Observer(handleDataSourceChanges.bind(this)),
152
- );
153
-
154
- let originValues;
155
-
156
- element.datasource.attachObserver(
157
- new Observer(function () {
158
- if (!originValues) {
159
- originValues = clone(self[datasourceLinkedElementSymbol].data);
160
- }
161
-
162
- const currentValues = this.getRealSubject();
163
-
164
- const result = diff(originValues, currentValues);
165
- if (isArray(result) && result.length > 0) {
166
- self[stateButtonElementSymbol].setState("changed");
167
- self[stateButtonElementSymbol].setOption("disabled", false);
168
- self.setOption("changes", result.length);
169
- self.setOption(
170
- "classes.badge",
171
- new TokenList(self.getOption("classes.badge"))
172
- .remove("hidden")
173
- .toString(),
174
- );
175
- } else {
176
- self[stateButtonElementSymbol].removeState();
177
- self[stateButtonElementSymbol].setOption("disabled", true);
178
- self.setOption("changes", 0);
179
- self.setOption(
180
- "classes.badge",
181
- new TokenList(self.getOption("classes.badge"))
182
- .add("hidden")
183
- .toString(),
184
- );
185
- }
186
- }),
187
- );
188
- }
189
-
190
- this.attachObserver(
191
- new Observer(() => {
192
- handleDataSourceChanges.call(this);
193
- }),
194
- );
195
- }
196
-
197
- /**
198
- *
199
- * @return [CSSStyleSheet]
200
- */
201
- static getCSSStyleSheet() {
202
- return [SaveButtonStyleSheet, BadgeStyleSheet];
203
- }
46
+ /**
47
+ * This method is called by the `instanceof` operator.
48
+ * @returns {symbol}
49
+ */
50
+ static get [instanceSymbol]() {
51
+ return Symbol.for(
52
+ "@schukai/monster/components/datasource/save-button@@instance",
53
+ );
54
+ }
55
+
56
+ /**
57
+ * To set the options via the html tag the attribute `data-monster-options` must be used.
58
+ * @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
59
+ *
60
+ * The individual configuration values can be found in the table.
61
+ *
62
+ * @property {Object} templates Template definitions
63
+ * @property {string} templates.main Main template
64
+ * @property {object} datasource The datasource
65
+ * @property {string} datasource.selector The selector of the datasource
66
+ * @property {string} labels.button The button label
67
+ * @property {Object} classes The classes
68
+ * @property {string} classes.bar The bar class
69
+ * @property {string} classes.badge The badge class
70
+ * @property {object} mapping The mapping
71
+ * @property {string} mapping.data The data
72
+ * @property {number} mapping.index The index
73
+ * @property {Array} ignoreChanges The ignore changes (regex)
74
+ * @property {Array} data The data
75
+ * @return {Object}
76
+ */
77
+ get defaults() {
78
+ const obj = Object.assign({}, super.defaults, {
79
+ templates: {
80
+ main: getTemplate(),
81
+ },
82
+
83
+ labels: {
84
+ button: "save",
85
+ },
86
+
87
+ classes: {
88
+ bar: "monster-button-primary",
89
+ badge: "monster-badge-secondary hidden",
90
+ },
91
+
92
+ datasource: {
93
+ selector: null,
94
+ },
95
+
96
+ changes: "0",
97
+
98
+ mapping: {
99
+ data: "dataset",
100
+ index: 0,
101
+ },
102
+
103
+ ignoreChanges: [],
104
+
105
+ data: {},
106
+
107
+ disabled: false,
108
+ });
109
+
110
+ updateOptionsFromArguments.call(this, obj);
111
+ return obj;
112
+ }
113
+
114
+ /**
115
+ *
116
+ * @return {string}
117
+ */
118
+ static getTag() {
119
+ return "monster-datasource-save-button";
120
+ }
121
+
122
+ /**
123
+ * This method is responsible for assembling the component.
124
+ *
125
+ * It calls the parent's assemble method first, then initializes control references and event handlers.
126
+ * If the `datasource.selector` option is provided and is a string, it searches for the corresponding
127
+ * element in the DOM using that selector.
128
+ *
129
+ * If the selector matches exactly one element, it checks if the element is an instance of the `Datasource` class.
130
+ *
131
+ * If it is, the component's `datasourceLinkedElementSymbol` property is set to the element, and the component
132
+ * attaches an observer to the datasource's changes.
133
+ *
134
+ * The observer is a function that calls the `handleDataSourceChanges` method in the context of the component.
135
+ * Additionally, the component attaches an observer to itself, which also calls the `handleDataSourceChanges`
136
+ * method in the component's context.
137
+ */
138
+ [assembleMethodSymbol]() {
139
+ super[assembleMethodSymbol]();
140
+ const self = this;
141
+
142
+ initControlReferences.call(this);
143
+ initEventHandler.call(this);
144
+
145
+ const selector = this.getOption("datasource.selector");
146
+
147
+ if (isString(selector)) {
148
+ const elements = document.querySelectorAll(selector);
149
+ if (elements.length !== 1) {
150
+ throw new Error("the selector must match exactly one element");
151
+ }
152
+
153
+ const element = elements[0];
154
+ if (!(element instanceof Datasource)) {
155
+ throw new TypeError("the element must be a datasource");
156
+ }
157
+
158
+ this[datasourceLinkedElementSymbol] = element;
159
+ element.datasource.attachObserver(
160
+ new Observer(handleDataSourceChanges.bind(this)),
161
+ );
162
+
163
+ let originValues;
164
+
165
+ element.datasource.attachObserver(
166
+ new Observer(function () {
167
+ if (!originValues) {
168
+ originValues = clone(self[datasourceLinkedElementSymbol].data);
169
+ }
170
+
171
+ const currentValues = this.getRealSubject();
172
+ const ignoreChanges = self.getOption("ignoreChanges");
173
+
174
+ const result = diff(originValues, currentValues);
175
+ if (isArray(ignoreChanges) && ignoreChanges.length > 0) {
176
+ const itemsToRemove = [];
177
+ for (const item of result) {
178
+ for (const ignorePattern of ignoreChanges) {
179
+ const p = new RegExp(ignorePattern);
180
+ if (p.test(item.path)) {
181
+ itemsToRemove.push(item);
182
+ break;
183
+ }
184
+ }
185
+ }
186
+
187
+ for (const itemToRemove of itemsToRemove) {
188
+ const index = result.indexOf(itemToRemove);
189
+ if (index > -1) {
190
+ result.splice(index, 1);
191
+ }
192
+ }
193
+ }
194
+
195
+ if (isArray(result) && result.length > 0) {
196
+ self[stateButtonElementSymbol].setState("changed");
197
+ self[stateButtonElementSymbol].setOption("disabled", false);
198
+ self.setOption("changes", result.length);
199
+ self.setOption(
200
+ "classes.badge",
201
+ new TokenList(self.getOption("classes.badge"))
202
+ .remove("hidden")
203
+ .toString(),
204
+ );
205
+ } else {
206
+ self[stateButtonElementSymbol].removeState();
207
+ self[stateButtonElementSymbol].setOption("disabled", true);
208
+ self.setOption("changes", 0);
209
+ self.setOption(
210
+ "classes.badge",
211
+ new TokenList(self.getOption("classes.badge"))
212
+ .add("hidden")
213
+ .toString(),
214
+ );
215
+ }
216
+ }),
217
+ );
218
+ }
219
+
220
+ this.attachObserver(
221
+ new Observer(() => {
222
+ handleDataSourceChanges.call(this);
223
+ }),
224
+ );
225
+ }
226
+
227
+ /**
228
+ *
229
+ * @return [CSSStyleSheet]
230
+ */
231
+ static getCSSStyleSheet() {
232
+ return [SaveButtonStyleSheet, BadgeStyleSheet];
233
+ }
204
234
  }
205
235
 
206
236
  /**
@@ -208,77 +238,77 @@ class SaveButton extends CustomElement {
208
238
  * @return {Monster.Components.Datatable.Form}
209
239
  */
210
240
  function initControlReferences() {
211
- if (!this.shadowRoot) {
212
- throw new Error("no shadow-root is defined");
213
- }
214
-
215
- this[stateButtonElementSymbol] = this.shadowRoot.querySelector(
216
- "[data-monster-role=state-button]",
217
- );
218
-
219
- this[badgeElementSymbol] = this.shadowRoot.querySelector(
220
- "[data-monster-role=badge]",
221
- );
222
-
223
- if (this[stateButtonElementSymbol]) {
224
- setTimeout(() => {
225
- const states = {
226
- changed: new State(
227
- "changed",
228
- '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-cloud-arrow-up" viewBox="0 0 16 16">\n' +
229
- ' <path fill-rule="evenodd" d="M7.646 5.146a.5.5 0 0 1 .708 0l2 2a.5.5 0 0 1-.708.708L8.5 6.707V10.5a.5.5 0 0 1-1 0V6.707L6.354 7.854a.5.5 0 1 1-.708-.708z"/>\n' +
230
- ' <path d="M4.406 3.342A5.53 5.53 0 0 1 8 2c2.69 0 4.923 2 5.166 4.579C14.758 6.804 16 8.137 16 9.773 16 11.569 14.502 13 12.687 13H3.781C1.708 13 0 11.366 0 9.318c0-1.763 1.266-3.223 2.942-3.593.143-.863.698-1.723 1.464-2.383m.653.757c-.757.653-1.153 1.44-1.153 2.056v.448l-.445.049C2.064 6.805 1 7.952 1 9.318 1 10.785 2.23 12 3.781 12h8.906C13.98 12 15 10.988 15 9.773c0-1.216-1.02-2.228-2.313-2.228h-.5v-.5C12.188 4.825 10.328 3 8 3a4.53 4.53 0 0 0-2.941 1.1z"/>\n' +
231
- "</svg>",
232
- ),
233
- };
234
-
235
- this[stateButtonElementSymbol].removeState();
236
- this[stateButtonElementSymbol].setOption("disabled", "disabled");
237
- this[stateButtonElementSymbol].setOption("states", states);
238
- this[stateButtonElementSymbol].setOption(
239
- "labels.button",
240
- this.getOption("labels.button"),
241
- );
242
- }, 1);
243
- }
244
-
245
- return this;
241
+ if (!this.shadowRoot) {
242
+ throw new Error("no shadow-root is defined");
243
+ }
244
+
245
+ this[stateButtonElementSymbol] = this.shadowRoot.querySelector(
246
+ "[data-monster-role=state-button]",
247
+ );
248
+
249
+ this[badgeElementSymbol] = this.shadowRoot.querySelector(
250
+ "[data-monster-role=badge]",
251
+ );
252
+
253
+ if (this[stateButtonElementSymbol]) {
254
+ setTimeout(() => {
255
+ const states = {
256
+ changed: new State(
257
+ "changed",
258
+ '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-cloud-arrow-up" viewBox="0 0 16 16">\n' +
259
+ ' <path fill-rule="evenodd" d="M7.646 5.146a.5.5 0 0 1 .708 0l2 2a.5.5 0 0 1-.708.708L8.5 6.707V10.5a.5.5 0 0 1-1 0V6.707L6.354 7.854a.5.5 0 1 1-.708-.708z"/>\n' +
260
+ ' <path d="M4.406 3.342A5.53 5.53 0 0 1 8 2c2.69 0 4.923 2 5.166 4.579C14.758 6.804 16 8.137 16 9.773 16 11.569 14.502 13 12.687 13H3.781C1.708 13 0 11.366 0 9.318c0-1.763 1.266-3.223 2.942-3.593.143-.863.698-1.723 1.464-2.383m.653.757c-.757.653-1.153 1.44-1.153 2.056v.448l-.445.049C2.064 6.805 1 7.952 1 9.318 1 10.785 2.23 12 3.781 12h8.906C13.98 12 15 10.988 15 9.773c0-1.216-1.02-2.228-2.313-2.228h-.5v-.5C12.188 4.825 10.328 3 8 3a4.53 4.53 0 0 0-2.941 1.1z"/>\n' +
261
+ "</svg>",
262
+ ),
263
+ };
264
+
265
+ this[stateButtonElementSymbol].removeState();
266
+ this[stateButtonElementSymbol].setOption("disabled", "disabled");
267
+ this[stateButtonElementSymbol].setOption("states", states);
268
+ this[stateButtonElementSymbol].setOption(
269
+ "labels.button",
270
+ this.getOption("labels.button"),
271
+ );
272
+ }, 1);
273
+ }
274
+
275
+ return this;
246
276
  }
247
277
 
248
278
  /**
249
279
  * @private
250
280
  */
251
281
  function initEventHandler() {
252
- setTimeout(() => {
253
- this[stateButtonElementSymbol].setOption("actions.click", () => {
254
- this[datasourceLinkedElementSymbol]
255
- .write()
256
- .then(() => {
257
- this[stateButtonElementSymbol].removeState();
258
- this[stateButtonElementSymbol].setOption("disabled", true);
259
- this.setOption("changes", 0);
260
- this.setOption(
261
- "classes.badge",
262
- new TokenList(this.getOption("classes.badge"))
263
- .add("hidden")
264
- .toString(),
265
- );
266
- })
267
- .catch((error) => {
268
- console.error(error);
269
- });
270
- });
271
- }, 1);
282
+ setTimeout(() => {
283
+ this[stateButtonElementSymbol].setOption("actions.click", () => {
284
+ this[datasourceLinkedElementSymbol]
285
+ .write()
286
+ .then(() => {
287
+ this[stateButtonElementSymbol].removeState();
288
+ this[stateButtonElementSymbol].setOption("disabled", true);
289
+ this.setOption("changes", 0);
290
+ this.setOption(
291
+ "classes.badge",
292
+ new TokenList(this.getOption("classes.badge"))
293
+ .add("hidden")
294
+ .toString(),
295
+ );
296
+ })
297
+ .catch((error) => {
298
+ addAttributeToken(this, ATTRIBUTE_ERRORMESSAGE, e.toString());
299
+ });
300
+ });
301
+ }, 1);
272
302
  }
273
303
 
274
304
  /**
275
305
  * @param {Object} options
276
306
  */
277
307
  function updateOptionsFromArguments(options) {
278
- const selector = this.getAttribute(ATTRIBUTE_DATASOURCE_SELECTOR);
279
- if (selector) {
280
- options.datasource.selector = selector;
281
- }
308
+ const selector = this.getAttribute(ATTRIBUTE_DATASOURCE_SELECTOR);
309
+ if (selector) {
310
+ options.datasource.selector = selector;
311
+ }
282
312
  }
283
313
 
284
314
  /**
@@ -286,8 +316,8 @@ function updateOptionsFromArguments(options) {
286
316
  * @return {string}
287
317
  */
288
318
  function getTemplate() {
289
- // language=HTML
290
- return `
319
+ // language=HTML
320
+ return `
291
321
  <div data-monster-role="control" part="control"
292
322
  data-monster-attributes="disabled path:disabled | if:true">
293
323
  <monster-state-button data-monster-role="state-button">save</monster-state-button>
@@ -220,8 +220,8 @@ function getTemplate() {
220
220
  <div data-monster-role="control" part="control"
221
221
  data-monster-attributes="disabled path:disabled | if:true">
222
222
  <monster-context-error
223
- data-monster-option-classes-button="monster-theme-error-2 monster-bg-color-primary-2"></monster-context-error>
224
- <div class="monster-spinner monster-theme-primary-4"
223
+ data-monster-option-classes-button="monster-theme-error-2 monster-theme-background-inherit"></monster-context-error>
224
+ <div class="monster-theme-control-element"
225
225
  data-monster-attributes="data-monster-state-loader path:state.spinner"></div>
226
226
  </div>
227
227
  `;
@@ -20,7 +20,6 @@
20
20
  justify-content: flex-start;
21
21
  padding: 0;
22
22
  margin: 0 15px 0 0;
23
- //margin-left: 10px;
24
23
 
25
24
  & li {
26
25
  list-style: none;
@@ -30,16 +29,19 @@
30
29
  background-clip: border-box;
31
30
 
32
31
  & .is-visible {
33
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 16 16'%3E%3Cpath d='M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z'/%3E%3C/svg%3E");
32
+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 16 16'%3E%3Cpath d='M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z'/%3E%3C/svg%3E");
33
+ background-color: var(--monster-bg-color-primary-4);
34
34
  background-repeat: no-repeat no-repeat;
35
35
  background-position: center center;
36
36
  background-size: cover;
37
+
37
38
  width: 8px;
38
39
  height: 8px;
39
40
  }
40
41
 
41
42
  & .is-hidden {
42
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='8'/%3E%3C/svg%3E");
43
+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='8'/%3E%3C/svg%3E");
44
+ background-color: var(--monster-bg-color-primary-4);
43
45
  background-repeat: no-repeat no-repeat;
44
46
  background-position: center center;
45
47
  background-size: cover;
@@ -8,6 +8,7 @@
8
8
  @import "../../style/property.pcss";
9
9
  @import "../../style/ripple.pcss";
10
10
  @import "../../style/badge.pcss";
11
+ @import "../../style/icons.pcss";
11
12
  @import "../../style/link.pcss";
12
13
 
13
14