@schukai/monster 3.96.1 → 3.96.3
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 +20 -5
- package/package.json +1 -1
- package/source/components/datatable/change-button.mjs +39 -41
- package/source/components/datatable/dataset.mjs +335 -325
- package/source/components/datatable/datasource/rest.mjs +33 -29
- package/source/components/datatable/embedded-pagination.mjs +3 -1
- package/source/components/datatable/filter.mjs +164 -63
- package/source/components/datatable/pagination.mjs +13 -6
- package/source/components/datatable/save-button.mjs +25 -3
- package/source/components/datatable/status.mjs +21 -26
- package/source/components/datatable/style/status.pcss +12 -2
- package/source/components/datatable/stylesheet/status.mjs +1 -1
- package/source/components/datatable/util.mjs +1 -2
- package/source/components/form/form.mjs +5 -4
- package/source/components/form/select.mjs +2008 -2013
- package/source/components/form/style/field-set.pcss +28 -7
- package/source/components/form/style/toggle-switch.pcss +13 -2
- package/source/components/form/stylesheet/field-set.mjs +14 -7
- package/source/components/form/stylesheet/toggle-switch.mjs +14 -7
- package/source/components/form/toggle-switch.mjs +372 -380
- package/source/components/layout/tabs.mjs +1 -2
- package/source/constants.mjs +14 -1
- package/source/data/extend.mjs +2 -1
- package/source/data/transformer.mjs +2 -0
- package/source/dom/constants.mjs +0 -1
- package/source/dom/customelement.mjs +7 -3
- package/source/dom/updater.mjs +5 -1
- package/source/monster.mjs +1 -1
- package/source/text/formatter.mjs +5 -3
- package/source/types/is.mjs +13 -0
- package/source/types/proxyobserver.mjs +7 -2
- package/source/types/version.mjs +1 -1
- package/source/util/clone.mjs +9 -14
- package/test/cases/data/pathfinder.mjs +18 -0
- package/test/cases/monster.mjs +1 -1
- package/test/cases/text/formatter.mjs +21 -1
- package/test/web/test.html +2 -2
- package/test/web/tests.js +266 -176
@@ -12,30 +12,34 @@
|
|
12
12
|
* SPDX-License-Identifier: AGPL-3.0
|
13
13
|
*/
|
14
14
|
|
15
|
-
import {instanceSymbol} from "../../constants.mjs";
|
16
|
-
import {Pathfinder} from "../../data/pathfinder.mjs";
|
15
|
+
import { instanceSymbol } from "../../constants.mjs";
|
16
|
+
import { Pathfinder } from "../../data/pathfinder.mjs";
|
17
17
|
import {
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
assembleMethodSymbol,
|
19
|
+
CustomElement,
|
20
|
+
attributeObserverSymbol,
|
21
|
+
registerCustomElement,
|
22
22
|
} from "../../dom/customelement.mjs";
|
23
|
-
import {findElementWithSelectorUpwards, getDocument, getWindow} from "../../dom/util.mjs";
|
24
|
-
import {isString} from "../../types/is.mjs";
|
25
|
-
import {Observer} from "../../types/observer.mjs";
|
26
23
|
import {
|
27
|
-
|
28
|
-
|
24
|
+
findElementWithSelectorUpwards,
|
25
|
+
getDocument,
|
26
|
+
getWindow,
|
27
|
+
} from "../../dom/util.mjs";
|
28
|
+
import { isString } from "../../types/is.mjs";
|
29
|
+
import { Observer } from "../../types/observer.mjs";
|
30
|
+
import {
|
31
|
+
ATTRIBUTE_DATASOURCE_SELECTOR,
|
32
|
+
ATTRIBUTE_DATATABLE_INDEX,
|
29
33
|
} from "./constants.mjs";
|
30
|
-
import {Datasource} from "./datasource.mjs";
|
31
|
-
import {DatasetStyleSheet} from "./stylesheet/dataset.mjs";
|
34
|
+
import { Datasource } from "./datasource.mjs";
|
35
|
+
import { DatasetStyleSheet } from "./stylesheet/dataset.mjs";
|
32
36
|
import {
|
33
|
-
|
34
|
-
|
37
|
+
handleDataSourceChanges,
|
38
|
+
datasourceLinkedElementSymbol,
|
35
39
|
} from "./util.mjs";
|
36
|
-
import {FormStyleSheet} from "../stylesheet/form.mjs";
|
40
|
+
import { FormStyleSheet } from "../stylesheet/form.mjs";
|
37
41
|
|
38
|
-
export {DataSet};
|
42
|
+
export { DataSet };
|
39
43
|
|
40
44
|
/**
|
41
45
|
* A data set component
|
@@ -51,277 +55,283 @@ export {DataSet};
|
|
51
55
|
* @summary A dataset component that can be used to show the data of a data source
|
52
56
|
*/
|
53
57
|
class DataSet extends CustomElement {
|
54
|
-
|
55
|
-
|
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
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
58
|
+
/**
|
59
|
+
* This method is called by the `instanceof` operator.
|
60
|
+
* @return {symbol}
|
61
|
+
*/
|
62
|
+
static get [instanceSymbol]() {
|
63
|
+
return Symbol.for(
|
64
|
+
"@schukai/monster/components/datatable/dataset@@instance",
|
65
|
+
);
|
66
|
+
}
|
67
|
+
|
68
|
+
/**
|
69
|
+
* This method determines which attributes are to be monitored by `attributeChangedCallback()`.
|
70
|
+
*
|
71
|
+
* @return {string[]}
|
72
|
+
* @since 1.15.0
|
73
|
+
*/
|
74
|
+
static get observedAttributes() {
|
75
|
+
const attributes = super.observedAttributes;
|
76
|
+
attributes.push(ATTRIBUTE_DATATABLE_INDEX);
|
77
|
+
attributes.push("data-monster-option-mapping-index");
|
78
|
+
return attributes;
|
79
|
+
}
|
80
|
+
|
81
|
+
/**
|
82
|
+
* To set the options via the HTML tag, the attribute `data-monster-options` must be used.
|
83
|
+
* @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
|
84
|
+
*
|
85
|
+
* The individual configuration values can be found in the table.
|
86
|
+
*
|
87
|
+
* @property {Object} templates Template definitions
|
88
|
+
* @property {string} templates.main Main template
|
89
|
+
* @property {object} datasource The datasource
|
90
|
+
* @property {string} datasource.selector The selector of the datasource
|
91
|
+
* @property {object} mapping The mapping
|
92
|
+
* @property {string} mapping.data The data
|
93
|
+
* @property {number} mapping.index The index
|
94
|
+
* @property {object} features The features
|
95
|
+
* @property {boolean} features.refreshOnMutation Refresh on mutation
|
96
|
+
* @property {object} refreshOnMutation The refresh on mutation
|
97
|
+
* @property {string} refreshOnMutation.selector The selector
|
98
|
+
*/
|
99
|
+
get defaults() {
|
100
|
+
const obj = Object.assign({}, super.defaults, {
|
101
|
+
templates: {
|
102
|
+
main: getTemplate(),
|
103
|
+
},
|
104
|
+
|
105
|
+
datasource: {
|
106
|
+
selector: null,
|
107
|
+
},
|
108
|
+
|
109
|
+
mapping: {
|
110
|
+
data: "dataset",
|
111
|
+
index: 0,
|
112
|
+
},
|
113
|
+
|
114
|
+
features: {
|
115
|
+
/**
|
116
|
+
* @since 3.70.0
|
117
|
+
* @type {boolean}
|
118
|
+
*/
|
119
|
+
refreshOnMutation: true,
|
120
|
+
},
|
121
|
+
|
122
|
+
/**
|
123
|
+
* @since 3.70.0
|
124
|
+
* @type {boolean}
|
125
|
+
*/
|
126
|
+
refreshOnMutation: {
|
127
|
+
selector:
|
128
|
+
"input, select, textarea, monster-select, monster-toggle-switch",
|
129
|
+
},
|
130
|
+
|
131
|
+
data: {},
|
132
|
+
});
|
133
|
+
|
134
|
+
updateOptionsFromArguments.call(this, obj);
|
135
|
+
return obj;
|
136
|
+
}
|
137
|
+
|
138
|
+
/**
|
139
|
+
*
|
140
|
+
* @return {string}
|
141
|
+
*/
|
142
|
+
static getTag() {
|
143
|
+
return "monster-dataset";
|
144
|
+
}
|
145
|
+
|
146
|
+
/**
|
147
|
+
* This method is called when the component is created.
|
148
|
+
* @since 3.70.0
|
149
|
+
* @return {Promise}
|
150
|
+
*/
|
151
|
+
refresh() {
|
152
|
+
// makes sure that handleDataSourceChanges is called
|
153
|
+
this.setOption("data", {});
|
154
|
+
return Promise.resolve(this);
|
155
|
+
}
|
156
|
+
|
157
|
+
/**
|
158
|
+
*
|
159
|
+
* @return {Promise<unknown>}
|
160
|
+
*/
|
161
|
+
write() {
|
162
|
+
return new Promise((resolve, reject) => {
|
163
|
+
if (!this[datasourceLinkedElementSymbol]) {
|
164
|
+
reject(new Error("No datasource"));
|
165
|
+
return;
|
166
|
+
}
|
167
|
+
|
168
|
+
const internalUpdateCloneData = this.getInternalUpdateCloneData();
|
169
|
+
if (!internalUpdateCloneData) {
|
170
|
+
reject(new Error("No update data"));
|
171
|
+
return;
|
172
|
+
}
|
173
|
+
|
174
|
+
const internalData = internalUpdateCloneData?.["data"];
|
175
|
+
if (
|
176
|
+
internalData === undefined ||
|
177
|
+
internalData === null ||
|
178
|
+
internalData === ""
|
179
|
+
) {
|
180
|
+
reject(new Error("No data"));
|
181
|
+
return;
|
182
|
+
}
|
183
|
+
|
184
|
+
queueMicrotask(() => {
|
185
|
+
const path = this.getOption("mapping.data");
|
186
|
+
const index = this.getOption("mapping.index");
|
187
|
+
|
188
|
+
let pathWithIndex;
|
189
|
+
|
190
|
+
if (isString(path) && path !== "") {
|
191
|
+
pathWithIndex = path + "." + index;
|
192
|
+
} else {
|
193
|
+
pathWithIndex = String(index);
|
194
|
+
}
|
195
|
+
|
196
|
+
const data = this[datasourceLinkedElementSymbol]?.data;
|
197
|
+
if (!data) {
|
198
|
+
reject(new Error("No data"));
|
199
|
+
return;
|
200
|
+
}
|
201
|
+
|
202
|
+
const unref = JSON.stringify(data);
|
203
|
+
const ref = JSON.parse(unref);
|
204
|
+
|
205
|
+
new Pathfinder(ref).setVia(pathWithIndex, internalData);
|
206
|
+
|
207
|
+
this[datasourceLinkedElementSymbol].data = ref;
|
208
|
+
|
209
|
+
resolve();
|
210
|
+
});
|
211
|
+
});
|
212
|
+
}
|
213
|
+
|
214
|
+
/**
|
215
|
+
* This method is responsible for assembling the component.
|
216
|
+
*
|
217
|
+
* It calls the parent's assemble method first, then initializes control references and event handlers.
|
218
|
+
* If the `datasource.selector` option is provided and is a string, it searches for the corresponding
|
219
|
+
* element in the DOM using that selector.
|
220
|
+
*
|
221
|
+
* If the selector matches exactly one element, it checks if the element is an instance of the `Datasource` class.
|
222
|
+
*
|
223
|
+
* If it is, the component's `datasourceLinkedElementSymbol` property is set to the element, and the component
|
224
|
+
* attaches an observer to the datasource's changes.
|
225
|
+
*
|
226
|
+
* The observer is a function that calls the `handleDataSourceChanges` method in the context of the component.
|
227
|
+
* Additionally, the component attaches an observer to itself, which also calls the `handleDataSourceChanges`
|
228
|
+
* method in the component's context.
|
229
|
+
*/
|
230
|
+
[assembleMethodSymbol]() {
|
231
|
+
super[assembleMethodSymbol]();
|
232
|
+
|
233
|
+
requestAnimationFrame(() => {
|
234
|
+
if (!this[datasourceLinkedElementSymbol]) {
|
235
|
+
const selector = this.getOption("datasource.selector");
|
236
|
+
|
237
|
+
if (isString(selector)) {
|
238
|
+
const element = findElementWithSelectorUpwards(this, selector);
|
239
|
+
if (element === null) {
|
240
|
+
throw new Error("the selector must match exactly one element");
|
241
|
+
}
|
242
|
+
|
243
|
+
if (!(element instanceof Datasource)) {
|
244
|
+
throw new TypeError("the element must be a datasource");
|
245
|
+
}
|
246
|
+
|
247
|
+
this[datasourceLinkedElementSymbol] = element;
|
248
|
+
element.datasource.attachObserver(
|
249
|
+
new Observer(handleDataSourceChanges.bind(this)),
|
250
|
+
);
|
251
|
+
|
252
|
+
handleDataSourceChanges.call(this);
|
253
|
+
} else {
|
254
|
+
throw new Error("the selector must be a string");
|
255
|
+
}
|
256
|
+
}
|
257
|
+
|
258
|
+
if (
|
259
|
+
this.getOption("features.refreshOnMutation") &&
|
260
|
+
this.getOption("refreshOnMutation.selector")
|
261
|
+
) {
|
262
|
+
initMutationObserver.call(this);
|
263
|
+
}
|
264
|
+
|
265
|
+
initEventHandler.call(this);
|
266
|
+
});
|
267
|
+
}
|
268
|
+
|
269
|
+
/**
|
270
|
+
* @return [CSSStyleSheet]
|
271
|
+
*/
|
272
|
+
static getCSSStyleSheet() {
|
273
|
+
return [FormStyleSheet, DatasetStyleSheet];
|
274
|
+
}
|
268
275
|
}
|
269
276
|
|
270
277
|
/**
|
271
278
|
* @private
|
272
279
|
*/
|
273
280
|
function initEventHandler() {
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
281
|
+
this[attributeObserverSymbol][ATTRIBUTE_DATATABLE_INDEX] = () => {
|
282
|
+
// @deprecated use data-monster-option-mapping-index
|
283
|
+
const index = this.getAttribute(ATTRIBUTE_DATATABLE_INDEX);
|
284
|
+
if (index) {
|
285
|
+
this.setOption("mapping.index", parseInt(index, 10));
|
286
|
+
handleDataSourceChanges.call(this);
|
287
|
+
}
|
288
|
+
};
|
289
|
+
|
290
|
+
this[attributeObserverSymbol]["data-monster-option-mapping-index"] = () => {
|
291
|
+
const index = this.getAttribute("data-monster-option-mapping-index");
|
292
|
+
if (index !== null && index !== undefined && index !== "") {
|
293
|
+
this.setOption("mapping.index", parseInt(index, 10));
|
294
|
+
handleDataSourceChanges.call(this);
|
295
|
+
}
|
296
|
+
};
|
297
|
+
|
298
|
+
if (this[datasourceLinkedElementSymbol]) {
|
299
|
+
this[datasourceLinkedElementSymbol].datasource.attachObserver(
|
300
|
+
new Observer(() => {
|
301
|
+
let index = 0;
|
302
|
+
if (
|
303
|
+
typeof this[datasourceLinkedElementSymbol]?.currentPage === "function"
|
304
|
+
) {
|
305
|
+
const page = this[datasourceLinkedElementSymbol].currentPage();
|
306
|
+
if (page !== null && page !== undefined && page !== "") {
|
307
|
+
index = parseInt(page, 10) - 1;
|
308
|
+
}
|
309
|
+
}
|
310
|
+
|
311
|
+
this.setOption("mapping.index", index);
|
312
|
+
handleDataSourceChanges.call(this);
|
313
|
+
}),
|
314
|
+
);
|
315
|
+
|
316
|
+
this[datasourceLinkedElementSymbol].attachObserver(
|
317
|
+
new Observer(() => {
|
318
|
+
let index = 0;
|
319
|
+
if (
|
320
|
+
typeof this[datasourceLinkedElementSymbol]?.currentPage === "function"
|
321
|
+
) {
|
322
|
+
const page = this[datasourceLinkedElementSymbol].currentPage();
|
323
|
+
if (page !== null && page !== undefined && page !== "") {
|
324
|
+
index = parseInt(page, 10) - 1;
|
325
|
+
}
|
326
|
+
}
|
327
|
+
|
328
|
+
this.setOption("mapping.index", index);
|
329
|
+
handleDataSourceChanges.call(this);
|
330
|
+
}),
|
331
|
+
);
|
332
|
+
|
333
|
+
handleDataSourceChanges.call(this);
|
334
|
+
}
|
325
335
|
}
|
326
336
|
|
327
337
|
/**
|
@@ -329,56 +339,56 @@ function initEventHandler() {
|
|
329
339
|
* @param {Object} options
|
330
340
|
*/
|
331
341
|
function updateOptionsFromArguments(options) {
|
332
|
-
|
342
|
+
const index = this.getAttribute(ATTRIBUTE_DATATABLE_INDEX); // @deprecated use data-monster-option-mapping-index
|
333
343
|
|
334
|
-
|
335
|
-
|
336
|
-
|
344
|
+
if (index !== null && index !== undefined) {
|
345
|
+
options.mapping.index = parseInt(index, 10);
|
346
|
+
}
|
337
347
|
|
338
|
-
|
348
|
+
const selector = this.getAttribute(ATTRIBUTE_DATASOURCE_SELECTOR);
|
339
349
|
|
340
|
-
|
341
|
-
|
342
|
-
|
350
|
+
if (selector) {
|
351
|
+
options.datasource.selector = selector;
|
352
|
+
}
|
343
353
|
}
|
344
354
|
|
345
355
|
/**
|
346
356
|
* @private
|
347
357
|
*/
|
348
358
|
function initMutationObserver() {
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
359
|
+
const config = { attributes: false, childList: true, subtree: true };
|
360
|
+
|
361
|
+
const callback = (mutationList, observer) => {
|
362
|
+
if (mutationList.length === 0) {
|
363
|
+
return;
|
364
|
+
}
|
365
|
+
|
366
|
+
let doneFlag = false;
|
367
|
+
for (const mutation of mutationList) {
|
368
|
+
if (mutation.type === "childList") {
|
369
|
+
for (const node of mutation.addedNodes) {
|
370
|
+
if (
|
371
|
+
node instanceof HTMLElement &&
|
372
|
+
node.matches(this.getOption("refreshOnMutation.selector"))
|
373
|
+
) {
|
374
|
+
doneFlag = true;
|
375
|
+
break;
|
376
|
+
}
|
377
|
+
}
|
378
|
+
|
379
|
+
if (doneFlag) {
|
380
|
+
break;
|
381
|
+
}
|
382
|
+
}
|
383
|
+
}
|
384
|
+
|
385
|
+
if (doneFlag) {
|
386
|
+
this.refresh();
|
387
|
+
}
|
388
|
+
};
|
389
|
+
|
390
|
+
const observer = new MutationObserver(callback);
|
391
|
+
observer.observe(this, config);
|
382
392
|
}
|
383
393
|
|
384
394
|
/**
|
@@ -386,8 +396,8 @@ function initMutationObserver() {
|
|
386
396
|
* @return {string}
|
387
397
|
*/
|
388
398
|
function getTemplate() {
|
389
|
-
|
390
|
-
|
399
|
+
// language=HTML
|
400
|
+
return `
|
391
401
|
<div data-monster-role="control" part="control">
|
392
402
|
<slot></slot>
|
393
403
|
</div>
|