@schukai/monster 3.64.0 → 3.65.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +32 -0
- package/example/components/form/button.mjs +1 -1
- package/example/components/form/field-set.mjs +4 -0
- package/example/components/form/select.mjs +1 -1
- package/package.json +2 -1
- package/source/components/datatable/datatable/header.mjs +228 -221
- package/source/components/datatable/style/dataset.pcss +1 -0
- package/source/components/datatable/style/datatable.pcss +1 -0
- package/source/components/datatable/stylesheet/change-button.mjs +8 -4
- package/source/components/datatable/stylesheet/column-bar.mjs +8 -4
- package/source/components/datatable/stylesheet/dataset.mjs +9 -5
- package/source/components/datatable/stylesheet/datasource.mjs +8 -4
- package/source/components/datatable/stylesheet/datatable.mjs +9 -5
- package/source/components/datatable/stylesheet/embedded-pagination.mjs +8 -4
- package/source/components/datatable/stylesheet/filter-button.mjs +8 -4
- package/source/components/datatable/stylesheet/filter-controls-defaults.mjs +8 -4
- package/source/components/datatable/stylesheet/filter-date-range.mjs +8 -4
- package/source/components/datatable/stylesheet/filter-range.mjs +8 -4
- package/source/components/datatable/stylesheet/filter.mjs +8 -4
- package/source/components/datatable/stylesheet/pagination.mjs +8 -4
- package/source/components/datatable/stylesheet/save-button.mjs +8 -4
- package/source/components/datatable/stylesheet/select-filter.mjs +8 -4
- package/source/components/datatable/stylesheet/status.mjs +8 -4
- package/source/components/form/button.mjs +263 -281
- package/source/components/form/field-set.mjs +300 -0
- package/source/components/form/popper.mjs +13 -480
- package/source/components/form/style/field-set.pcss +13 -0
- package/source/components/form/stylesheet/action-button.mjs +8 -4
- package/source/components/form/stylesheet/api-button.mjs +8 -4
- package/source/components/form/stylesheet/button-bar.mjs +9 -5
- package/source/components/form/stylesheet/button.mjs +8 -4
- package/source/components/form/stylesheet/confirm-button.mjs +9 -5
- package/source/components/form/stylesheet/context-error.mjs +8 -4
- package/source/components/form/stylesheet/context-help.mjs +8 -4
- package/source/components/form/stylesheet/field-set.mjs +31 -0
- package/source/components/form/stylesheet/form.mjs +9 -5
- package/source/components/form/stylesheet/message-state-button.mjs +8 -4
- package/source/components/form/stylesheet/popper-button.mjs +8 -4
- package/source/components/form/stylesheet/select.mjs +8 -4
- package/source/components/form/stylesheet/state-button.mjs +8 -4
- package/source/components/form/stylesheet/toggle-switch.mjs +8 -4
- package/source/components/form/stylesheet/tree-select.mjs +8 -4
- package/source/components/host/collapse.mjs +14 -516
- package/source/components/host/config-manager.mjs +9 -2
- package/source/components/host/constants.mjs +9 -4
- package/source/components/host/details.mjs +14 -253
- package/source/components/host/stylesheet/call-button.mjs +8 -4
- package/source/components/host/stylesheet/config-manager.mjs +8 -4
- package/source/components/host/stylesheet/host.mjs +9 -5
- package/source/components/host/stylesheet/overlay.mjs +9 -5
- package/source/components/host/stylesheet/toggle-button.mjs +8 -4
- package/source/components/host/stylesheet/viewer.mjs +8 -4
- package/source/components/layout/collapse.mjs +542 -0
- package/source/components/layout/details.mjs +271 -0
- package/source/components/layout/panel.mjs +6 -0
- package/source/components/layout/popper.mjs +476 -0
- package/source/components/{host → layout}/stylesheet/collapse.mjs +8 -4
- package/source/components/{host → layout}/stylesheet/details.mjs +8 -4
- package/source/components/layout/stylesheet/panel.mjs +8 -4
- package/source/components/{form → layout}/stylesheet/popper.mjs +8 -4
- package/source/components/layout/stylesheet/split-panel.mjs +8 -4
- package/source/components/layout/stylesheet/tabs.mjs +8 -4
- package/source/components/layout/stylesheet/width-toggle.mjs +8 -4
- package/source/components/layout/tabs.mjs +3 -3
- package/source/components/layout/width-toggle.mjs +3 -3
- package/source/components/navigation/style/table-of-content.pcss +84 -0
- package/source/components/navigation/stylesheet/table-of-content.mjs +31 -0
- package/source/components/navigation/table-of-content.mjs +418 -0
- package/source/components/notify/stylesheet/message.mjs +8 -4
- package/source/components/notify/stylesheet/notify.mjs +8 -4
- package/source/components/state/stylesheet/log.mjs +8 -4
- package/source/components/state/stylesheet/state.mjs +9 -5
- package/source/components/style/link.pcss +0 -1
- package/source/components/style/mixin/typography.pcss +7 -7
- package/source/components/style/typography.pcss +1 -1
- package/source/components/stylesheet/badge.mjs +8 -4
- package/source/components/stylesheet/border.mjs +8 -4
- package/source/components/stylesheet/button.mjs +8 -4
- package/source/components/stylesheet/card.mjs +8 -4
- package/source/components/stylesheet/color.mjs +8 -4
- package/source/components/stylesheet/common.mjs +8 -4
- package/source/components/stylesheet/control.mjs +8 -4
- package/source/components/stylesheet/data-grid.mjs +8 -4
- package/source/components/stylesheet/display.mjs +8 -4
- package/source/components/stylesheet/floating-ui.mjs +8 -4
- package/source/components/stylesheet/form.mjs +8 -4
- package/source/components/stylesheet/host.mjs +8 -4
- package/source/components/stylesheet/icons.mjs +8 -4
- package/source/components/stylesheet/link.mjs +8 -4
- package/source/components/stylesheet/mixin/badge.mjs +31 -0
- package/source/components/stylesheet/mixin/button.mjs +31 -0
- package/source/components/stylesheet/mixin/form.mjs +31 -0
- package/source/components/stylesheet/mixin/hover.mjs +31 -0
- package/source/components/stylesheet/mixin/icon.mjs +31 -0
- package/source/components/stylesheet/mixin/media.mjs +31 -0
- package/source/components/stylesheet/mixin/property.mjs +31 -0
- package/source/components/stylesheet/mixin/skeleton.mjs +31 -0
- package/source/components/stylesheet/mixin/spinner.mjs +31 -0
- package/source/components/stylesheet/mixin/typography.mjs +31 -0
- package/source/components/stylesheet/normalize.mjs +8 -4
- package/source/components/stylesheet/popper.mjs +8 -4
- package/source/components/stylesheet/property.mjs +8 -4
- package/source/components/stylesheet/ripple.mjs +8 -4
- package/source/components/stylesheet/skeleton.mjs +8 -4
- package/source/components/stylesheet/space.mjs +8 -4
- package/source/components/stylesheet/spinner.mjs +8 -4
- package/source/components/stylesheet/table.mjs +8 -4
- package/source/components/stylesheet/theme.mjs +8 -4
- package/source/components/stylesheet/typography.mjs +9 -5
- package/source/components/tree-menu/stylesheet/tree-menu.mjs +8 -4
- package/source/dom/ready.mjs +10 -4
- package/source/monster.mjs +17 -80
- package/source/types/proxyobserver.mjs +4 -2
- package/source/types/version.mjs +1 -1
- package/test/cases/monster.mjs +1 -1
- package/test/web/tests.js +4 -4
- package/source/components/form/form-field.mjs +0 -341
- package/source/components/form/style/form-field.pcss +0 -4
- package/source/components/form/stylesheet/form-field.mjs +0 -27
- /package/source/components/{host → layout}/style/collapse.pcss +0 -0
- /package/source/components/{host → layout}/style/details.pcss +0 -0
- /package/source/components/{form → layout}/style/popper.pcss +0 -0
@@ -0,0 +1,476 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright © schukai GmbH and all contributing authors, {{copyRightYear}}. All rights reserved.
|
3
|
+
* Node module: @schukai/monster
|
4
|
+
*
|
5
|
+
* This source code is licensed under the GNU Affero General Public License version 3 (AGPLv3).
|
6
|
+
* The full text of the license can be found at: https://www.gnu.org/licenses/agpl-3.0.en.html
|
7
|
+
*
|
8
|
+
* For those who do not wish to adhere to the AGPLv3, a commercial license is available.
|
9
|
+
* Acquiring a commercial license allows you to use this software without complying with the AGPLv3 terms.
|
10
|
+
* For more information about purchasing a commercial license, please contact schukai GmbH.
|
11
|
+
*/
|
12
|
+
import {instanceSymbol} from "../../constants.mjs";
|
13
|
+
import {
|
14
|
+
addAttributeToken,
|
15
|
+
removeAttributeToken,
|
16
|
+
} from "../../dom/attributes.mjs";
|
17
|
+
import {ATTRIBUTE_ROLE} from "../../dom/constants.mjs";
|
18
|
+
import {
|
19
|
+
assembleMethodSymbol,
|
20
|
+
registerCustomElement,
|
21
|
+
} from "../../dom/customelement.mjs";
|
22
|
+
import {fireCustomEvent} from "../../dom/events.mjs";
|
23
|
+
import {getDocument} from "../../dom/util.mjs";
|
24
|
+
import {DeadMansSwitch} from "../../util/deadmansswitch.mjs";
|
25
|
+
import {Button} from "../form/button.mjs";
|
26
|
+
import {STYLE_DISPLAY_MODE_BLOCK} from "../form/constants.mjs";
|
27
|
+
import {positionPopper} from "../form/util/floating-ui.mjs";
|
28
|
+
import {CustomControl} from "../../dom/customcontrol.mjs";
|
29
|
+
import {PopperStyleSheet} from "./stylesheet/popper.mjs";
|
30
|
+
import {isArray} from "../../types/is.mjs";
|
31
|
+
|
32
|
+
export {Popper};
|
33
|
+
|
34
|
+
/**
|
35
|
+
* @private
|
36
|
+
* @type {symbol}
|
37
|
+
*/
|
38
|
+
const timerCallbackSymbol = Symbol("timerCallback");
|
39
|
+
|
40
|
+
/**
|
41
|
+
* local symbol
|
42
|
+
* @private
|
43
|
+
* @type {symbol}
|
44
|
+
*/
|
45
|
+
const resizeObserverSymbol = Symbol("resizeObserver");
|
46
|
+
|
47
|
+
/**
|
48
|
+
* local symbol
|
49
|
+
* @private
|
50
|
+
* @type {symbol}
|
51
|
+
*/
|
52
|
+
const closeEventHandler = Symbol("closeEventHandler");
|
53
|
+
|
54
|
+
/**
|
55
|
+
* @private
|
56
|
+
* @type {symbol}
|
57
|
+
*/
|
58
|
+
const controlElementSymbol = Symbol("controlElement");
|
59
|
+
|
60
|
+
/**
|
61
|
+
* @private
|
62
|
+
* @type {symbol}
|
63
|
+
*/
|
64
|
+
const buttonElementSymbol = Symbol("buttonElement");
|
65
|
+
|
66
|
+
/**
|
67
|
+
* local symbol
|
68
|
+
* @private
|
69
|
+
* @type {symbol}
|
70
|
+
*/
|
71
|
+
const popperElementSymbol = Symbol("popperElement");
|
72
|
+
|
73
|
+
/**
|
74
|
+
* local symbol
|
75
|
+
* @private
|
76
|
+
* @type {symbol}
|
77
|
+
*/
|
78
|
+
const arrowElementSymbol = Symbol("arrowElement");
|
79
|
+
|
80
|
+
/**
|
81
|
+
* This action callback executes the actions when a button is clicked.
|
82
|
+
*
|
83
|
+
* @callback Monster.Components.Form~exampleActionCallback
|
84
|
+
* @param {Event} e Event
|
85
|
+
* @memberOf Monster.Components.Form
|
86
|
+
* @this {CustomControl}
|
87
|
+
*/
|
88
|
+
|
89
|
+
/**
|
90
|
+
* A Popper is a floating UI element that can be shown or hidden.
|
91
|
+
*
|
92
|
+
* @fragments /fragments/components/layout/popper/
|
93
|
+
*
|
94
|
+
* @example /examples/components/layout/popper-simple
|
95
|
+
* @example /examples/components/layout/popper-click
|
96
|
+
*
|
97
|
+
* @since 1.66.0
|
98
|
+
* @copyright schukai GmbH
|
99
|
+
* @summary A beautiful popper that can make your life easier and also looks good.
|
100
|
+
* @fires monster-popper-hide fired when the popper is hide.
|
101
|
+
* @fires monster-popper-hidden fired when the popper is hidden.
|
102
|
+
* @fires monster-popper-open fired when the popper is open.
|
103
|
+
* @fires monster-popper-opened fired when the popper is opened.
|
104
|
+
*
|
105
|
+
*/
|
106
|
+
class Popper extends CustomControl {
|
107
|
+
/**
|
108
|
+
* This method is called by the `instanceof` operator.
|
109
|
+
* @returns {symbol}
|
110
|
+
*/
|
111
|
+
static get [instanceSymbol]() {
|
112
|
+
return Symbol.for("@schukai/monster/components/layout/popper@@instance");
|
113
|
+
}
|
114
|
+
|
115
|
+
/**
|
116
|
+
* To set the options via the html tag the attribute `data-monster-options` must be used.
|
117
|
+
* @see {@link https://monsterjs.org/en/doc/#configurate-a-monster-control}
|
118
|
+
*
|
119
|
+
* The individual configuration values can be found in the table.
|
120
|
+
*
|
121
|
+
* @property {Object} templates The templates for the control.
|
122
|
+
* @property {string} templates.main The main template.
|
123
|
+
* @property {string} mode The mode of the popper. Possible values are `click`, `enter`, `manual`, `focus`, "auto" or a combination of them.
|
124
|
+
* @property {string} content The content of the popper.
|
125
|
+
* @property {object} popper The popper options.
|
126
|
+
* @property {string} popper.placement The placement of the popper. Possible values are `top`, `bottom`, `left` and `right`.
|
127
|
+
* @property {function[]} popper.middleware The middleware functions of the popper.
|
128
|
+
* @property {function[]} popper.middlewareInit The middleware init functions of the popper.
|
129
|
+
* @property {Object} features The features of the popper.
|
130
|
+
* @property {boolean} features.preventPropagateOpenEvents Prevents the open event from being sent.
|
131
|
+
*/
|
132
|
+
get defaults() {
|
133
|
+
return Object.assign({}, super.defaults, {
|
134
|
+
templates: {
|
135
|
+
main: getTemplate(),
|
136
|
+
},
|
137
|
+
mode: "auto focus",
|
138
|
+
content: "<slot></slot>",
|
139
|
+
popper: {
|
140
|
+
placement: "top",
|
141
|
+
middleware: ["autoPlacement", "offset:10", "arrow"],
|
142
|
+
},
|
143
|
+
features: {
|
144
|
+
preventOpenEventSent: false,
|
145
|
+
},
|
146
|
+
});
|
147
|
+
}
|
148
|
+
|
149
|
+
/**
|
150
|
+
*
|
151
|
+
* @return {Popper}
|
152
|
+
*/
|
153
|
+
[assembleMethodSymbol]() {
|
154
|
+
super[assembleMethodSymbol]();
|
155
|
+
initControlReferences.call(this);
|
156
|
+
initEventHandler.call(this);
|
157
|
+
|
158
|
+
return this;
|
159
|
+
}
|
160
|
+
|
161
|
+
/**
|
162
|
+
* @return {string}
|
163
|
+
*/
|
164
|
+
static getTag() {
|
165
|
+
return "monster-popper";
|
166
|
+
}
|
167
|
+
|
168
|
+
/**
|
169
|
+
* @return {Array<CSSStyleSheet>}
|
170
|
+
*/
|
171
|
+
static getCSSStyleSheet() {
|
172
|
+
return [PopperStyleSheet];
|
173
|
+
}
|
174
|
+
|
175
|
+
/**
|
176
|
+
* @return {void}
|
177
|
+
*/
|
178
|
+
connectedCallback() {
|
179
|
+
super.connectedCallback();
|
180
|
+
|
181
|
+
const document = getDocument();
|
182
|
+
|
183
|
+
for (const [, type] of Object.entries(["click", "touch"])) {
|
184
|
+
// close on outside ui-events
|
185
|
+
document.addEventListener(type, this[closeEventHandler]);
|
186
|
+
}
|
187
|
+
|
188
|
+
updatePopper.call(this);
|
189
|
+
attachResizeObserver.call(this);
|
190
|
+
}
|
191
|
+
|
192
|
+
/**
|
193
|
+
* @return {void}
|
194
|
+
*/
|
195
|
+
disconnectedCallback() {
|
196
|
+
super.disconnectedCallback();
|
197
|
+
|
198
|
+
// close on outside ui-events
|
199
|
+
for (const [, type] of Object.entries(["click", "touch"])) {
|
200
|
+
document.removeEventListener(type, this[closeEventHandler]);
|
201
|
+
}
|
202
|
+
|
203
|
+
disconnectResizeObserver.call(this);
|
204
|
+
}
|
205
|
+
|
206
|
+
/**
|
207
|
+
* @return {Popper}
|
208
|
+
*/
|
209
|
+
showDialog() {
|
210
|
+
show.call(this);
|
211
|
+
return this;
|
212
|
+
}
|
213
|
+
|
214
|
+
/**
|
215
|
+
* @return {Popper}
|
216
|
+
*/
|
217
|
+
hideDialog() {
|
218
|
+
hide.call(this);
|
219
|
+
return this;
|
220
|
+
}
|
221
|
+
|
222
|
+
/**
|
223
|
+
* @return {Popper}
|
224
|
+
*/
|
225
|
+
toggleDialog() {
|
226
|
+
if (this[popperElementSymbol].style.display === STYLE_DISPLAY_MODE_BLOCK) {
|
227
|
+
this.hideDialog();
|
228
|
+
} else {
|
229
|
+
this.showDialog();
|
230
|
+
}
|
231
|
+
return this;
|
232
|
+
}
|
233
|
+
}
|
234
|
+
|
235
|
+
/**
|
236
|
+
* @private
|
237
|
+
* @return {Popper}
|
238
|
+
*/
|
239
|
+
function initEventHandler() {
|
240
|
+
this[closeEventHandler] = (event) => {
|
241
|
+
const path = event.composedPath();
|
242
|
+
|
243
|
+
for (const [, element] of Object.entries(path)) {
|
244
|
+
if (element === this) {
|
245
|
+
return;
|
246
|
+
}
|
247
|
+
}
|
248
|
+
hide.call(this);
|
249
|
+
};
|
250
|
+
|
251
|
+
let modes = null;
|
252
|
+
const modeOption = this.getOption("mode");
|
253
|
+
|
254
|
+
if (typeof modeOption === "string") {
|
255
|
+
modes = modeOption.split(" ");
|
256
|
+
}
|
257
|
+
|
258
|
+
if (
|
259
|
+
modes === null ||
|
260
|
+
modes === undefined ||
|
261
|
+
isArray(modes) === false ||
|
262
|
+
modes.length === 0
|
263
|
+
) {
|
264
|
+
modes = ["manual"];
|
265
|
+
}
|
266
|
+
|
267
|
+
for (const [, mode] of Object.entries(modes)) {
|
268
|
+
initEventHandlerByMode.call(this, mode);
|
269
|
+
}
|
270
|
+
|
271
|
+
return this;
|
272
|
+
}
|
273
|
+
|
274
|
+
/**
|
275
|
+
* @private
|
276
|
+
* @param mode
|
277
|
+
* @return {Popper}
|
278
|
+
* @throws Error
|
279
|
+
*/
|
280
|
+
function initEventHandlerByMode(mode) {
|
281
|
+
switch (mode) {
|
282
|
+
case "manual":
|
283
|
+
break;
|
284
|
+
|
285
|
+
case "focus":
|
286
|
+
this[buttonElementSymbol].addEventListener("focus", (event) => {
|
287
|
+
if (this.getOption("features.preventOpenEventSent") === true) {
|
288
|
+
event.preventDefault();
|
289
|
+
}
|
290
|
+
this.showDialog();
|
291
|
+
});
|
292
|
+
this[buttonElementSymbol].addEventListener("blur", (event) => {
|
293
|
+
if (this.getOption("features.preventOpenEventSent") === true) {
|
294
|
+
event.preventDefault();
|
295
|
+
}
|
296
|
+
this.hideDialog();
|
297
|
+
});
|
298
|
+
break;
|
299
|
+
|
300
|
+
case "click":
|
301
|
+
this[buttonElementSymbol].addEventListener("click", (event) => {
|
302
|
+
if (this.getOption("features.preventOpenEventSent") === true) {
|
303
|
+
event.preventDefault();
|
304
|
+
}
|
305
|
+
this.toggleDialog();
|
306
|
+
});
|
307
|
+
break;
|
308
|
+
case "enter":
|
309
|
+
this[buttonElementSymbol].addEventListener("mouseenter", (event) => {
|
310
|
+
if (this.getOption("features.preventOpenEventSent") === true) {
|
311
|
+
event.preventDefault();
|
312
|
+
}
|
313
|
+
this.showDialog();
|
314
|
+
});
|
315
|
+
break;
|
316
|
+
|
317
|
+
case "auto": // is hover
|
318
|
+
this[buttonElementSymbol].addEventListener("mouseenter", (event) => {
|
319
|
+
if (this.getOption("features.preventOpenEventSent") === true) {
|
320
|
+
event.preventDefault();
|
321
|
+
}
|
322
|
+
this.showDialog();
|
323
|
+
});
|
324
|
+
this[buttonElementSymbol].addEventListener("mouseleave", (event) => {
|
325
|
+
if (this.getOption("features.preventOpenEventSent") === true) {
|
326
|
+
event.preventDefault();
|
327
|
+
}
|
328
|
+
this.hideDialog();
|
329
|
+
});
|
330
|
+
break;
|
331
|
+
default:
|
332
|
+
throw new Error(`Unknown mode ${mode}`);
|
333
|
+
}
|
334
|
+
}
|
335
|
+
|
336
|
+
/**
|
337
|
+
* @private
|
338
|
+
*/
|
339
|
+
function attachResizeObserver() {
|
340
|
+
// against flickering
|
341
|
+
this[resizeObserverSymbol] = new ResizeObserver((entries) => {
|
342
|
+
if (this[timerCallbackSymbol] instanceof DeadMansSwitch) {
|
343
|
+
try {
|
344
|
+
this[timerCallbackSymbol].touch();
|
345
|
+
return;
|
346
|
+
} catch (e) {
|
347
|
+
delete this[timerCallbackSymbol];
|
348
|
+
}
|
349
|
+
}
|
350
|
+
|
351
|
+
this[timerCallbackSymbol] = new DeadMansSwitch(200, () => {
|
352
|
+
updatePopper.call(this);
|
353
|
+
});
|
354
|
+
});
|
355
|
+
|
356
|
+
this[resizeObserverSymbol].observe(this.parentElement);
|
357
|
+
}
|
358
|
+
|
359
|
+
function disconnectResizeObserver() {
|
360
|
+
if (this[resizeObserverSymbol] instanceof ResizeObserver) {
|
361
|
+
this[resizeObserverSymbol].disconnect();
|
362
|
+
}
|
363
|
+
}
|
364
|
+
|
365
|
+
/**
|
366
|
+
* @private
|
367
|
+
*/
|
368
|
+
function hide() {
|
369
|
+
const self = this;
|
370
|
+
|
371
|
+
fireCustomEvent(self, "monster-popper-hide", {
|
372
|
+
self,
|
373
|
+
});
|
374
|
+
|
375
|
+
self[popperElementSymbol].style.display = "none";
|
376
|
+
removeAttributeToken(self[controlElementSymbol], "class", "open");
|
377
|
+
|
378
|
+
setTimeout(() => {
|
379
|
+
fireCustomEvent(self, "monster-popper-hidden", {
|
380
|
+
self,
|
381
|
+
});
|
382
|
+
}, 0);
|
383
|
+
}
|
384
|
+
|
385
|
+
/**
|
386
|
+
* @private
|
387
|
+
* @this PopperButton
|
388
|
+
*/
|
389
|
+
function show() {
|
390
|
+
const self = this;
|
391
|
+
|
392
|
+
if (self.getOption("disabled", false) === true) {
|
393
|
+
return;
|
394
|
+
}
|
395
|
+
|
396
|
+
if (self[popperElementSymbol].style.display === STYLE_DISPLAY_MODE_BLOCK) {
|
397
|
+
return;
|
398
|
+
}
|
399
|
+
|
400
|
+
fireCustomEvent(self, "monster-popper-open", {
|
401
|
+
self,
|
402
|
+
});
|
403
|
+
|
404
|
+
self[popperElementSymbol].style.visibility = "hidden";
|
405
|
+
self[popperElementSymbol].style.display = STYLE_DISPLAY_MODE_BLOCK;
|
406
|
+
|
407
|
+
addAttributeToken(self[controlElementSymbol], "class", "open");
|
408
|
+
updatePopper.call(self);
|
409
|
+
|
410
|
+
setTimeout(() => {
|
411
|
+
fireCustomEvent(self, "monster-popper-opened", {
|
412
|
+
self,
|
413
|
+
});
|
414
|
+
}, 0);
|
415
|
+
}
|
416
|
+
|
417
|
+
/**
|
418
|
+
* @private
|
419
|
+
*/
|
420
|
+
function updatePopper() {
|
421
|
+
if (this[popperElementSymbol].style.display !== STYLE_DISPLAY_MODE_BLOCK) {
|
422
|
+
return;
|
423
|
+
}
|
424
|
+
|
425
|
+
if (this.getOption("disabled", false) === true) {
|
426
|
+
return;
|
427
|
+
}
|
428
|
+
|
429
|
+
positionPopper.call(
|
430
|
+
this,
|
431
|
+
this[controlElementSymbol],
|
432
|
+
this[popperElementSymbol],
|
433
|
+
this.getOption("popper", {}),
|
434
|
+
);
|
435
|
+
}
|
436
|
+
|
437
|
+
/**
|
438
|
+
* @private
|
439
|
+
* @return {Popper}
|
440
|
+
*/
|
441
|
+
function initControlReferences() {
|
442
|
+
this[controlElementSymbol] = this.shadowRoot.querySelector(
|
443
|
+
`[${ATTRIBUTE_ROLE}=control]`,
|
444
|
+
);
|
445
|
+
this[buttonElementSymbol] = this.shadowRoot.querySelector(
|
446
|
+
`[${ATTRIBUTE_ROLE}=button]`,
|
447
|
+
);
|
448
|
+
this[popperElementSymbol] = this.shadowRoot.querySelector(
|
449
|
+
`[${ATTRIBUTE_ROLE}=popper]`,
|
450
|
+
);
|
451
|
+
this[arrowElementSymbol] = this.shadowRoot.querySelector(
|
452
|
+
`[${ATTRIBUTE_ROLE}=arrow]`,
|
453
|
+
);
|
454
|
+
return this;
|
455
|
+
}
|
456
|
+
|
457
|
+
/**
|
458
|
+
* @private
|
459
|
+
* @return {string}
|
460
|
+
*/
|
461
|
+
function getTemplate() {
|
462
|
+
// language=HTML
|
463
|
+
return `
|
464
|
+
<div data-monster-role="control" part="control">
|
465
|
+
<slot name="button" data-monster-role="button"></slot>
|
466
|
+
|
467
|
+
<div data-monster-role="popper" part="popper" tabindex="-1" class="monster-color-primary-1">
|
468
|
+
<div data-monster-role="arrow"></div>
|
469
|
+
<div part="content" class="flex" data-monster-replace="path:content">
|
470
|
+
</div>
|
471
|
+
</div>
|
472
|
+
</div>
|
473
|
+
`;
|
474
|
+
}
|
475
|
+
|
476
|
+
registerCustomElement(Popper);
|
@@ -1,9 +1,13 @@
|
|
1
|
-
|
2
1
|
/**
|
3
|
-
* Copyright schukai GmbH and
|
2
|
+
* Copyright © schukai GmbH and all contributing authors, 2024. All rights reserved.
|
4
3
|
* Node module: @schukai/monster
|
5
|
-
*
|
6
|
-
*
|
4
|
+
*
|
5
|
+
* This source code is licensed under the GNU Affero General Public License version 3 (AGPLv3).
|
6
|
+
* The full text of the license can be found at: https://www.gnu.org/licenses/agpl-3.0.en.html
|
7
|
+
*
|
8
|
+
* For those who do not wish to adhere to the AGPLv3, a commercial license is available.
|
9
|
+
* Acquiring a commercial license allows you to use this software without complying with the AGPLv3 terms.
|
10
|
+
* For more information about purchasing a commercial license, please contact schukai GmbH.
|
7
11
|
*/
|
8
12
|
|
9
13
|
import {addAttributeToken} from "../../../dom/attributes.mjs";
|
@@ -1,9 +1,13 @@
|
|
1
|
-
|
2
1
|
/**
|
3
|
-
* Copyright schukai GmbH and
|
2
|
+
* Copyright © schukai GmbH and all contributing authors, 2024. All rights reserved.
|
4
3
|
* Node module: @schukai/monster
|
5
|
-
*
|
6
|
-
*
|
4
|
+
*
|
5
|
+
* This source code is licensed under the GNU Affero General Public License version 3 (AGPLv3).
|
6
|
+
* The full text of the license can be found at: https://www.gnu.org/licenses/agpl-3.0.en.html
|
7
|
+
*
|
8
|
+
* For those who do not wish to adhere to the AGPLv3, a commercial license is available.
|
9
|
+
* Acquiring a commercial license allows you to use this software without complying with the AGPLv3 terms.
|
10
|
+
* For more information about purchasing a commercial license, please contact schukai GmbH.
|
7
11
|
*/
|
8
12
|
|
9
13
|
import {addAttributeToken} from "../../../dom/attributes.mjs";
|
@@ -1,9 +1,13 @@
|
|
1
|
-
|
2
1
|
/**
|
3
|
-
* Copyright schukai GmbH and
|
2
|
+
* Copyright © schukai GmbH and all contributing authors, 2024. All rights reserved.
|
4
3
|
* Node module: @schukai/monster
|
5
|
-
*
|
6
|
-
*
|
4
|
+
*
|
5
|
+
* This source code is licensed under the GNU Affero General Public License version 3 (AGPLv3).
|
6
|
+
* The full text of the license can be found at: https://www.gnu.org/licenses/agpl-3.0.en.html
|
7
|
+
*
|
8
|
+
* For those who do not wish to adhere to the AGPLv3, a commercial license is available.
|
9
|
+
* Acquiring a commercial license allows you to use this software without complying with the AGPLv3 terms.
|
10
|
+
* For more information about purchasing a commercial license, please contact schukai GmbH.
|
7
11
|
*/
|
8
12
|
|
9
13
|
import {addAttributeToken} from "../../../dom/attributes.mjs";
|
@@ -1,9 +1,13 @@
|
|
1
|
-
|
2
1
|
/**
|
3
|
-
* Copyright schukai GmbH and
|
2
|
+
* Copyright © schukai GmbH and all contributing authors, 2024. All rights reserved.
|
4
3
|
* Node module: @schukai/monster
|
5
|
-
*
|
6
|
-
*
|
4
|
+
*
|
5
|
+
* This source code is licensed under the GNU Affero General Public License version 3 (AGPLv3).
|
6
|
+
* The full text of the license can be found at: https://www.gnu.org/licenses/agpl-3.0.en.html
|
7
|
+
*
|
8
|
+
* For those who do not wish to adhere to the AGPLv3, a commercial license is available.
|
9
|
+
* Acquiring a commercial license allows you to use this software without complying with the AGPLv3 terms.
|
10
|
+
* For more information about purchasing a commercial license, please contact schukai GmbH.
|
7
11
|
*/
|
8
12
|
|
9
13
|
import {addAttributeToken} from "../../../dom/attributes.mjs";
|
@@ -1,9 +1,13 @@
|
|
1
|
-
|
2
1
|
/**
|
3
|
-
* Copyright schukai GmbH and
|
2
|
+
* Copyright © schukai GmbH and all contributing authors, 2024. All rights reserved.
|
4
3
|
* Node module: @schukai/monster
|
5
|
-
*
|
6
|
-
*
|
4
|
+
*
|
5
|
+
* This source code is licensed under the GNU Affero General Public License version 3 (AGPLv3).
|
6
|
+
* The full text of the license can be found at: https://www.gnu.org/licenses/agpl-3.0.en.html
|
7
|
+
*
|
8
|
+
* For those who do not wish to adhere to the AGPLv3, a commercial license is available.
|
9
|
+
* Acquiring a commercial license allows you to use this software without complying with the AGPLv3 terms.
|
10
|
+
* For more information about purchasing a commercial license, please contact schukai GmbH.
|
7
11
|
*/
|
8
12
|
|
9
13
|
import {addAttributeToken} from "../../../dom/attributes.mjs";
|
@@ -1,9 +1,13 @@
|
|
1
|
-
|
2
1
|
/**
|
3
|
-
* Copyright schukai GmbH and
|
2
|
+
* Copyright © schukai GmbH and all contributing authors, 2024. All rights reserved.
|
4
3
|
* Node module: @schukai/monster
|
5
|
-
*
|
6
|
-
*
|
4
|
+
*
|
5
|
+
* This source code is licensed under the GNU Affero General Public License version 3 (AGPLv3).
|
6
|
+
* The full text of the license can be found at: https://www.gnu.org/licenses/agpl-3.0.en.html
|
7
|
+
*
|
8
|
+
* For those who do not wish to adhere to the AGPLv3, a commercial license is available.
|
9
|
+
* Acquiring a commercial license allows you to use this software without complying with the AGPLv3 terms.
|
10
|
+
* For more information about purchasing a commercial license, please contact schukai GmbH.
|
7
11
|
*/
|
8
12
|
|
9
13
|
import {addAttributeToken} from "../../../dom/attributes.mjs";
|
@@ -1,9 +1,13 @@
|
|
1
|
-
|
2
1
|
/**
|
3
|
-
* Copyright schukai GmbH and
|
2
|
+
* Copyright © schukai GmbH and all contributing authors, 2024. All rights reserved.
|
4
3
|
* Node module: @schukai/monster
|
5
|
-
*
|
6
|
-
*
|
4
|
+
*
|
5
|
+
* This source code is licensed under the GNU Affero General Public License version 3 (AGPLv3).
|
6
|
+
* The full text of the license can be found at: https://www.gnu.org/licenses/agpl-3.0.en.html
|
7
|
+
*
|
8
|
+
* For those who do not wish to adhere to the AGPLv3, a commercial license is available.
|
9
|
+
* Acquiring a commercial license allows you to use this software without complying with the AGPLv3 terms.
|
10
|
+
* For more information about purchasing a commercial license, please contact schukai GmbH.
|
7
11
|
*/
|
8
12
|
|
9
13
|
import {addAttributeToken} from "../../../dom/attributes.mjs";
|
@@ -585,15 +585,15 @@ function show(element) {
|
|
585
585
|
node.classList.add("active");
|
586
586
|
|
587
587
|
const openDelay = parseInt(this.getOption("features.openDelay"), 10);
|
588
|
-
|
588
|
+
|
589
589
|
if(!isNaN(openDelay) && openDelay>0) {
|
590
590
|
node.style.visibility = "hidden";
|
591
591
|
|
592
592
|
setTimeout(() => {
|
593
593
|
node.style.visibility = "visible";
|
594
594
|
}, openDelay);
|
595
|
-
}
|
596
|
-
|
595
|
+
}
|
596
|
+
|
597
597
|
// get all data- from button and filter out data-monster-attributes and data-monster-insert
|
598
598
|
const data = {};
|
599
599
|
const mask = [
|
@@ -51,8 +51,8 @@ const MODE_WIDE = "wide";
|
|
51
51
|
*
|
52
52
|
* <img src="./images/widthToggle.png">
|
53
53
|
*
|
54
|
-
* You can create this control either by specifying the HTML tag <monster-
|
55
|
-
* Javascript via the `document.createElement('monster-
|
54
|
+
* You can create this control either by specifying the HTML tag <monster-width-toggle />` directly in the HTML or using
|
55
|
+
* Javascript via the `document.createElement('monster-width-toggle');` method.
|
56
56
|
*
|
57
57
|
* ```html
|
58
58
|
* <monster-width-toggle></monster-width-toggle>
|
@@ -85,7 +85,7 @@ class WidthToggle extends CustomElement {
|
|
85
85
|
* @returns {symbol}
|
86
86
|
*/
|
87
87
|
static get [instanceSymbol]() {
|
88
|
-
return Symbol.for("@schukai/monster/components/layout/
|
88
|
+
return Symbol.for("@schukai/monster/components/layout/width-toggle@@instance");
|
89
89
|
}
|
90
90
|
|
91
91
|
/**
|