@schukai/monster 4.154.0 → 4.154.2
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 +1392 -19
- package/package.json +1 -1
- package/source/components/accessibility/locale-picker.mjs +6 -6
- package/source/components/accessibility/locale-select.mjs +1 -1
- package/source/components/content/camera-capture.mjs +3 -3
- package/source/components/content/copy.mjs +1 -1
- package/source/components/content/fetch-box.mjs +1 -1
- package/source/components/content/image-editor.mjs +2 -4
- package/source/components/content/viewer/html.mjs +2 -2
- package/source/components/content/viewer/message.mjs +3 -3
- package/source/components/content/viewer/sanitize-html.mjs +1 -1
- package/source/components/data/kpi-tile.mjs +5 -5
- package/source/components/data/metric-graph.mjs +2 -2
- package/source/components/data/metric.mjs +1 -1
- package/source/components/datatable/change-button.mjs +1 -1
- package/source/components/datatable/columnbar.mjs +2 -2
- package/source/components/datatable/datasource/rest.mjs +2 -4
- package/source/components/datatable/datatable.mjs +3 -3
- package/source/components/datatable/filter/date-presets.mjs +1 -1
- package/source/components/datatable/filter/input.mjs +1 -1
- package/source/components/datatable/filter/range.mjs +1 -1
- package/source/components/datatable/filter/settings.mjs +1 -3
- package/source/components/datatable/filter/text-operator.mjs +1 -1
- package/source/components/datatable/filter.mjs +1 -1
- package/source/components/datatable/pagination.mjs +2 -4
- package/source/components/datatable/status.mjs +1 -1
- package/source/components/files/file-manager.mjs +1 -1
- package/source/components/form/action-button.mjs +1 -1
- package/source/components/form/api-bar.mjs +1 -1
- package/source/components/form/buy-box.mjs +1 -1
- package/source/components/form/cart-control.mjs +1 -1
- package/source/components/form/checklist.mjs +1 -1
- package/source/components/form/digits.mjs +4 -4
- package/source/components/form/dropzone.mjs +1 -1
- package/source/components/form/field-set.mjs +1 -1
- package/source/components/form/input-group.mjs +1 -1
- package/source/components/form/login.mjs +15 -15
- package/source/components/form/password.mjs +1 -1
- package/source/components/form/popper.mjs +1 -0
- package/source/components/form/repeat-field-set.mjs +1 -1
- package/source/components/form/select-link.mjs +3 -0
- package/source/components/form/select.mjs +33 -33
- package/source/components/form/sheet.mjs +3 -0
- package/source/components/form/tabs.mjs +1 -0
- package/source/components/form/toggle-switch.mjs +1 -1
- package/source/components/form/util/fetch.mjs +3 -3
- package/source/components/form/variant-select.mjs +1 -1
- package/source/components/form/wizard.mjs +1 -3
- package/source/components/host/collapse.mjs +1 -0
- package/source/components/host/config-manager.mjs +2 -2
- package/source/components/host/details.mjs +1 -0
- package/source/components/host/host.mjs +2 -2
- package/source/components/host/overlay.mjs +1 -0
- package/source/components/host/viewer.mjs +1 -0
- package/source/components/layout/board.mjs +1 -1
- package/source/components/layout/collapse.mjs +2 -2
- package/source/components/layout/details.mjs +1 -1
- package/source/components/layout/full-screen.mjs +2 -2
- package/source/components/layout/popper.mjs +1 -1
- package/source/components/layout/tabs.mjs +5 -8
- package/source/components/layout/utils/attach-tabs-hash-sync.mjs +1 -1
- package/source/components/layout/vertical-tabs.mjs +5 -8
- package/source/components/navigation/site-navigation.mjs +3 -3
- package/source/components/navigation/table-of-content.mjs +1 -1
- package/source/components/navigation/wizard-navigation.mjs +9 -11
- package/source/components/notify/monitor-attribute-errors.mjs +1 -1
- package/source/components/time/day.mjs +1 -1
- package/source/components/time/month-calendar.mjs +8 -8
- package/source/components/time/timeline/appointment.mjs +1 -1
- package/source/components/time/timeline/segment.mjs +1 -1
- package/source/components/tree-menu/tree-menu.mjs +0 -1
- package/source/data/datasource/dom.mjs +1 -0
- package/source/dom/customelement.mjs +13 -13
- package/source/dom/sanitize-html.mjs +1 -1
- package/source/i18n/internal.mjs +2 -2
- package/source/i18n/providers/embed.mjs +1 -1
- package/source/i18n/time-ago.mjs +1 -1
- package/source/text/formatter.mjs +1 -0
- package/source/types/dataurl.mjs +1 -0
- package/source/types/has.mjs +1 -1
- package/source/types/is.mjs +2 -2
- package/source/types/mediatype.mjs +1 -0
- package/source/types/observer.mjs +6 -6
- package/source/types/observerlist.mjs +1 -0
- package/source/types/proxyobserver.mjs +1 -0
- package/source/types/stack.mjs +1 -0
- package/source/types/tokenlist.mjs +1 -0
- package/source/types/uuid.mjs +1 -0
- package/source/util/accessiblecolor.mjs +2 -2
- package/source/util/comparator.mjs +3 -3
- package/source/util/deadmansswitch.mjs +3 -4
- package/source/util/processing.mjs +1 -1
- package/test/cases/components/datatable/drag-scroll.mjs +51 -9
- package/test/cases/components/navigation/site-navigation.mjs +10 -1
|
@@ -432,7 +432,7 @@ class Tabs extends CustomElement {
|
|
|
432
432
|
/**
|
|
433
433
|
* This method is called internal and should not be called directly.
|
|
434
434
|
* @param tabId
|
|
435
|
-
* @
|
|
435
|
+
* @return {Tabs}
|
|
436
436
|
*/
|
|
437
437
|
removeTab(tabId) {
|
|
438
438
|
const tabs = getAllTabPanels.call(this);
|
|
@@ -452,7 +452,7 @@ class Tabs extends CustomElement {
|
|
|
452
452
|
|
|
453
453
|
/**
|
|
454
454
|
* This method is called internal and should not be called directly.
|
|
455
|
-
* @
|
|
455
|
+
* @return {[]}
|
|
456
456
|
*/
|
|
457
457
|
getTabs() {
|
|
458
458
|
return getAllTabPanels.call(this).filter((node) => isTabAvailable(node));
|
|
@@ -461,11 +461,8 @@ class Tabs extends CustomElement {
|
|
|
461
461
|
/**
|
|
462
462
|
* This method is called internal and should not be called directly.
|
|
463
463
|
* @param content
|
|
464
|
-
* @param active
|
|
465
|
-
* @
|
|
466
|
-
* @param tabId
|
|
467
|
-
* @param removable
|
|
468
|
-
* @returns {Tabs}
|
|
464
|
+
* @param {object} options Options for active state, label, tab ID and removability.
|
|
465
|
+
* @return {Tabs}
|
|
469
466
|
*/
|
|
470
467
|
addTab(
|
|
471
468
|
content,
|
|
@@ -679,7 +676,7 @@ class Tabs extends CustomElement {
|
|
|
679
676
|
|
|
680
677
|
/**
|
|
681
678
|
* @private
|
|
682
|
-
* @
|
|
679
|
+
* @return {object}
|
|
683
680
|
*/
|
|
684
681
|
function getTranslations() {
|
|
685
682
|
const locale = getLocaleOfDocument();
|
|
@@ -31,7 +31,7 @@ export function attachTabsHashSync(
|
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Reads active and all tab IDs from the URL hash.
|
|
34
|
-
* @
|
|
34
|
+
* @return {{activeTabId: string|null, allTabIds: string[]}}
|
|
35
35
|
*/
|
|
36
36
|
function getTabStateFromHash() {
|
|
37
37
|
const hashObj = parseBracketedKeyValueHash(location.hash);
|
|
@@ -291,7 +291,7 @@ class VerticalTabs extends CustomElement {
|
|
|
291
291
|
/**
|
|
292
292
|
* This method is called internal and should not be called directly.
|
|
293
293
|
* @param tabId
|
|
294
|
-
* @
|
|
294
|
+
* @return {VerticalTabs}
|
|
295
295
|
*/
|
|
296
296
|
removeTab(tabId) {
|
|
297
297
|
const tabs = this.getTabs();
|
|
@@ -311,7 +311,7 @@ class VerticalTabs extends CustomElement {
|
|
|
311
311
|
|
|
312
312
|
/**
|
|
313
313
|
* This method is called internal and should not be called directly.
|
|
314
|
-
* @
|
|
314
|
+
* @return {[]}
|
|
315
315
|
*/
|
|
316
316
|
getTabs() {
|
|
317
317
|
const nodes = getSlottedElements.call(this);
|
|
@@ -327,11 +327,8 @@ class VerticalTabs extends CustomElement {
|
|
|
327
327
|
/**
|
|
328
328
|
* This method is called internal and should not be called directly.
|
|
329
329
|
* @param content
|
|
330
|
-
* @param active
|
|
331
|
-
* @
|
|
332
|
-
* @param tabId
|
|
333
|
-
* @param removable
|
|
334
|
-
* @returns {VerticalTabs}
|
|
330
|
+
* @param {object} options Options for active state, label, tab ID and removability.
|
|
331
|
+
* @return {VerticalTabs}
|
|
335
332
|
*/
|
|
336
333
|
addTab(
|
|
337
334
|
content,
|
|
@@ -487,7 +484,7 @@ class VerticalTabs extends CustomElement {
|
|
|
487
484
|
|
|
488
485
|
/**
|
|
489
486
|
* @private
|
|
490
|
-
* @
|
|
487
|
+
* @return {object}
|
|
491
488
|
*/
|
|
492
489
|
function getTranslations() {
|
|
493
490
|
const locale = getLocaleOfDocument();
|
|
@@ -598,7 +598,7 @@ function setupSubmenu(parentLi, context = "visible", level = 1) {
|
|
|
598
598
|
* for styling and handling active states.
|
|
599
599
|
* @private
|
|
600
600
|
* @param {HTMLLIElement} item The original list item to clone.
|
|
601
|
-
* @
|
|
601
|
+
* @return {HTMLLIElement} The cloned and configured list item.
|
|
602
602
|
*/
|
|
603
603
|
function cloneNavItem(item) {
|
|
604
604
|
const liClone = item.cloneNode(true);
|
|
@@ -893,7 +893,7 @@ function populateTabs() {
|
|
|
893
893
|
* A simple template literal tag function for clarity.
|
|
894
894
|
* @private
|
|
895
895
|
* @param {TemplateStringsArray} strings
|
|
896
|
-
* @
|
|
896
|
+
* @return {string} The combined string.
|
|
897
897
|
*/
|
|
898
898
|
function html(strings) {
|
|
899
899
|
return strings.join("");
|
|
@@ -902,7 +902,7 @@ function html(strings) {
|
|
|
902
902
|
/**
|
|
903
903
|
* Returns the HTML template for the component's shadow DOM.
|
|
904
904
|
* @private
|
|
905
|
-
* @
|
|
905
|
+
* @return {string} The HTML template string.
|
|
906
906
|
*/
|
|
907
907
|
function getTemplate() {
|
|
908
908
|
return html`<div data-monster-role="control" part="control">
|
|
@@ -300,7 +300,7 @@ function removeNavigationScrollBinding() {
|
|
|
300
300
|
/**
|
|
301
301
|
* @private
|
|
302
302
|
* @param element
|
|
303
|
-
* @
|
|
303
|
+
* @return {number|number|*|number}
|
|
304
304
|
*/
|
|
305
305
|
function getScrollHeight(element) {
|
|
306
306
|
if (element instanceof ShadowRoot) {
|
|
@@ -86,9 +86,8 @@ class WizardNavigation extends CustomElement {
|
|
|
86
86
|
/**
|
|
87
87
|
* Navigates to the specified main step if the transition logic allows it.
|
|
88
88
|
* @param {number} index The index of the target step.
|
|
89
|
-
* @param {object} [options={}]
|
|
90
|
-
* @
|
|
91
|
-
* @returns {Promise<void>}
|
|
89
|
+
* @param {object} [options={}] Set `force` to skip the `beforeStepChange` callback.
|
|
90
|
+
* @return {Promise<void>}
|
|
92
91
|
* @fires monster-wizard-step-changed
|
|
93
92
|
*/
|
|
94
93
|
async goToStep(index, options = {}) {
|
|
@@ -175,9 +174,8 @@ class WizardNavigation extends CustomElement {
|
|
|
175
174
|
* Activates a specific main step and sub-step.
|
|
176
175
|
* @param {number} mainIndex The index of the main step.
|
|
177
176
|
* @param {number} subIndex The index of the sub-step.
|
|
178
|
-
* @param {object} [options={}]
|
|
179
|
-
* @
|
|
180
|
-
* @returns {Promise<void>}
|
|
177
|
+
* @param {object} [options={}] Set `force` to skip the `beforeStepChange` callback.
|
|
178
|
+
* @return {Promise<void>}
|
|
181
179
|
* @fires monster-wizard-substep-changed
|
|
182
180
|
*/
|
|
183
181
|
async activate(mainIndex, subIndex, options = {}) {
|
|
@@ -232,7 +230,7 @@ class WizardNavigation extends CustomElement {
|
|
|
232
230
|
|
|
233
231
|
/**
|
|
234
232
|
* Navigates to the next step or sub-step in sequence.
|
|
235
|
-
* @
|
|
233
|
+
* @return {Promise<void>}
|
|
236
234
|
*/
|
|
237
235
|
async next() {
|
|
238
236
|
const mainIndex = this[currentStepIndexSymbol];
|
|
@@ -261,7 +259,7 @@ class WizardNavigation extends CustomElement {
|
|
|
261
259
|
|
|
262
260
|
/**
|
|
263
261
|
* Navigates to the previous step or sub-step in sequence.
|
|
264
|
-
* @
|
|
262
|
+
* @return {Promise<void>}
|
|
265
263
|
*/
|
|
266
264
|
async previous() {
|
|
267
265
|
const mainIndex = this[currentStepIndexSymbol];
|
|
@@ -286,7 +284,7 @@ class WizardNavigation extends CustomElement {
|
|
|
286
284
|
|
|
287
285
|
/**
|
|
288
286
|
* Marks the current step as completed and automatically navigates to the next step.
|
|
289
|
-
* @
|
|
287
|
+
* @return {Promise<void>}
|
|
290
288
|
*/
|
|
291
289
|
async completeAndNext() {
|
|
292
290
|
const currentIndex = this[currentStepIndexSymbol];
|
|
@@ -341,7 +339,7 @@ class WizardNavigation extends CustomElement {
|
|
|
341
339
|
|
|
342
340
|
/**
|
|
343
341
|
* Gets the index of the currently active main step.
|
|
344
|
-
* @
|
|
342
|
+
* @return {number} The index of the current step, or -1 if none is active.
|
|
345
343
|
*/
|
|
346
344
|
getCurrentStepIndex() {
|
|
347
345
|
return this[currentStepIndexSymbol];
|
|
@@ -349,7 +347,7 @@ class WizardNavigation extends CustomElement {
|
|
|
349
347
|
|
|
350
348
|
/**
|
|
351
349
|
* Gets the index of the currently active sub-step within the main step.
|
|
352
|
-
* @
|
|
350
|
+
* @return {number} The index of the current sub-step, or -1 if none is active.
|
|
353
351
|
*/
|
|
354
352
|
getCurrentSubStepIndex() {
|
|
355
353
|
return this[currentSubStepIndexSymbol];
|
|
@@ -52,7 +52,7 @@ const mutationObserversSymbol = Symbol("mutationObservers");
|
|
|
52
52
|
class MonitorAttributeErrors extends CustomElement {
|
|
53
53
|
/**
|
|
54
54
|
* This method is called by the `instanceof` operator.
|
|
55
|
-
* @
|
|
55
|
+
* @return {symbol}
|
|
56
56
|
*/
|
|
57
57
|
static get [instanceSymbol]() {
|
|
58
58
|
return Symbol.for(
|
|
@@ -80,7 +80,7 @@ const boundDaysSymbol = Symbol("boundDays");
|
|
|
80
80
|
class MonthCalendar extends CustomElement {
|
|
81
81
|
/**
|
|
82
82
|
* This method is called by the `instanceof` operator.
|
|
83
|
-
* @
|
|
83
|
+
* @return {symbol}
|
|
84
84
|
*/
|
|
85
85
|
static get [instanceSymbol]() {
|
|
86
86
|
return Symbol.for("@schukai/monster/components/time/calendar@@instance");
|
|
@@ -216,7 +216,7 @@ class MonthCalendar extends CustomElement {
|
|
|
216
216
|
|
|
217
217
|
/**
|
|
218
218
|
* @private
|
|
219
|
-
* @
|
|
219
|
+
* @return {object}
|
|
220
220
|
*/
|
|
221
221
|
function getTranslations() {
|
|
222
222
|
const locale = getLocaleOfDocument();
|
|
@@ -312,7 +312,7 @@ function getTranslations() {
|
|
|
312
312
|
* @param {Date} appointmentStart - Start date of the appointment.
|
|
313
313
|
* @param {Date} appointmentEnd - End date of the appointment (inclusive).
|
|
314
314
|
* @param {Date} calendarGridStart - The first day of the calendar grid (e.g., the Monday from generateCalendarData()).
|
|
315
|
-
* @
|
|
315
|
+
* @return {number[]} Array indicating how many days the appointment spans per row.
|
|
316
316
|
*
|
|
317
317
|
* Example:
|
|
318
318
|
* - Appointment: 01.03.2025 (Saturday) to 01.03.2025:
|
|
@@ -360,7 +360,7 @@ function getAppointmentRowsUsingCalendar(
|
|
|
360
360
|
/**
|
|
361
361
|
* @private
|
|
362
362
|
* @param format
|
|
363
|
-
* @
|
|
363
|
+
* @return {*[]}
|
|
364
364
|
*/
|
|
365
365
|
function getWeekdays(format = "long") {
|
|
366
366
|
// Intl needs the language tag. Handing it the Locale instance makes
|
|
@@ -393,7 +393,7 @@ function getWeekdays(format = "long") {
|
|
|
393
393
|
* {"columns":7,"label":"03/11/2025 - 04/05/2025","start":"2025-03-24","startIndex":28},
|
|
394
394
|
* {"columns":6,"label":"03/11/2025 - 04/05/2025","start":"2025-03-31","startIndex":35}
|
|
395
395
|
* ]
|
|
396
|
-
* @
|
|
396
|
+
* @return {Array} The segments with assigned "line" property
|
|
397
397
|
*/
|
|
398
398
|
function assignLinesToSegments(segments) {
|
|
399
399
|
const groups = {};
|
|
@@ -747,7 +747,7 @@ function placeAppointments() {
|
|
|
747
747
|
|
|
748
748
|
/**
|
|
749
749
|
* @private
|
|
750
|
-
* @
|
|
750
|
+
* @return {{maxHeaderHeight: number, maxFooterHeight: number}}
|
|
751
751
|
*/
|
|
752
752
|
function calcHeaderAndFooterHeight() {
|
|
753
753
|
let maxHeaderHeight = 0;
|
|
@@ -812,7 +812,7 @@ function calcHeaderAndFooterHeight() {
|
|
|
812
812
|
* Generates two arrays: one for the calendar grid (42 days) and one for the weekday headers (7 days).
|
|
813
813
|
* The grid always starts on the Monday of the week that contains the first of the given month.
|
|
814
814
|
*
|
|
815
|
-
* @
|
|
815
|
+
* @return {Object} An object containing:
|
|
816
816
|
* - calendarDays: Array of 42 objects, each representing a day.
|
|
817
817
|
* - calendarWeekdays: Array of seven objects, each representing a weekday header.
|
|
818
818
|
*/
|
|
@@ -945,7 +945,7 @@ function refreshCalendar() {
|
|
|
945
945
|
* @param {Array} appointments - Array of appointment objects. Expected properties: "startDate" and "endDate".
|
|
946
946
|
* @param {Date|string} start - Calendar start date.
|
|
947
947
|
* @param {Date|string} end - Calendar end date.
|
|
948
|
-
* @
|
|
948
|
+
* @return {Object} A map in the format { "YYYY-MM-DD": [appointment1, appointment2, ...] }
|
|
949
949
|
*/
|
|
950
950
|
function getAppointmentsPerDay(appointments, start, end) {
|
|
951
951
|
const appointmentsMap = {};
|
|
@@ -41,7 +41,7 @@ const controlElementSymbol = Symbol("calendarElement");
|
|
|
41
41
|
class Appointment extends CustomElement {
|
|
42
42
|
/**
|
|
43
43
|
* This method is called by the `instanceof` operator.
|
|
44
|
-
* @
|
|
44
|
+
* @return {symbol}
|
|
45
45
|
*/
|
|
46
46
|
static get [instanceSymbol]() {
|
|
47
47
|
return Symbol.for(
|
|
@@ -54,7 +54,7 @@ const controlElementSymbol = Symbol("calendarElement");
|
|
|
54
54
|
class Segment extends CustomElement {
|
|
55
55
|
/**
|
|
56
56
|
* This method is called by the `instanceof` operator.
|
|
57
|
-
* @
|
|
57
|
+
* @return {symbol}
|
|
58
58
|
*/
|
|
59
59
|
static get [instanceSymbol]() {
|
|
60
60
|
return Symbol.for(
|
|
@@ -313,7 +313,7 @@ class CustomElement extends HTMLElement {
|
|
|
313
313
|
/**
|
|
314
314
|
* Returns whether the host element is currently visible.
|
|
315
315
|
*
|
|
316
|
-
* @
|
|
316
|
+
* @return {boolean}
|
|
317
317
|
*/
|
|
318
318
|
get visible() {
|
|
319
319
|
return !this.hidden;
|
|
@@ -322,7 +322,7 @@ class CustomElement extends HTMLElement {
|
|
|
322
322
|
/**
|
|
323
323
|
* Alias for the current host visibility state.
|
|
324
324
|
*
|
|
325
|
-
* @
|
|
325
|
+
* @return {boolean}
|
|
326
326
|
*/
|
|
327
327
|
get isVisible() {
|
|
328
328
|
return this.visible;
|
|
@@ -333,7 +333,7 @@ class CustomElement extends HTMLElement {
|
|
|
333
333
|
* Unlike the defaults that expect an object, the customization is a Map.
|
|
334
334
|
* This also allows overwriting individual values in a deeper structure
|
|
335
335
|
* without having to redefine the entire structure and thus changing the defaults.
|
|
336
|
-
* @
|
|
336
|
+
* @return {Map}
|
|
337
337
|
*/
|
|
338
338
|
get customization() {
|
|
339
339
|
return new Map();
|
|
@@ -587,7 +587,7 @@ class CustomElement extends HTMLElement {
|
|
|
587
587
|
/**
|
|
588
588
|
* Shows the host element.
|
|
589
589
|
*
|
|
590
|
-
* @
|
|
590
|
+
* @return {CustomElement}
|
|
591
591
|
*/
|
|
592
592
|
show() {
|
|
593
593
|
return this.setVisible(true);
|
|
@@ -596,7 +596,7 @@ class CustomElement extends HTMLElement {
|
|
|
596
596
|
/**
|
|
597
597
|
* Hides the host element.
|
|
598
598
|
*
|
|
599
|
-
* @
|
|
599
|
+
* @return {CustomElement}
|
|
600
600
|
*/
|
|
601
601
|
hide() {
|
|
602
602
|
return this.setVisible(false);
|
|
@@ -606,7 +606,7 @@ class CustomElement extends HTMLElement {
|
|
|
606
606
|
* Sets the host visibility.
|
|
607
607
|
*
|
|
608
608
|
* @param {boolean} visible
|
|
609
|
-
* @
|
|
609
|
+
* @return {CustomElement}
|
|
610
610
|
*/
|
|
611
611
|
setVisible(visible) {
|
|
612
612
|
if (visible) {
|
|
@@ -622,7 +622,7 @@ class CustomElement extends HTMLElement {
|
|
|
622
622
|
* Toggles the host visibility.
|
|
623
623
|
*
|
|
624
624
|
* @param {boolean} [force]
|
|
625
|
-
* @
|
|
625
|
+
* @return {CustomElement}
|
|
626
626
|
*/
|
|
627
627
|
toggleVisibility(force) {
|
|
628
628
|
if (typeof force === "boolean") {
|
|
@@ -1720,7 +1720,7 @@ function getManagedShadowRoot() {
|
|
|
1720
1720
|
/**
|
|
1721
1721
|
* @private
|
|
1722
1722
|
* @param html
|
|
1723
|
-
* @
|
|
1723
|
+
* @return {*|string}
|
|
1724
1724
|
*/
|
|
1725
1725
|
function substituteI18n(html) {
|
|
1726
1726
|
if (!this.getOption("templateFormatter.i18n", false)) {
|
|
@@ -1761,7 +1761,7 @@ function initHtmlContent() {
|
|
|
1761
1761
|
|
|
1762
1762
|
/**
|
|
1763
1763
|
* @private
|
|
1764
|
-
* @
|
|
1764
|
+
* @return {void}
|
|
1765
1765
|
*/
|
|
1766
1766
|
function syncVisibilityState() {
|
|
1767
1767
|
const visible = !this.hidden;
|
|
@@ -1787,7 +1787,7 @@ function syncVisibilityState() {
|
|
|
1787
1787
|
|
|
1788
1788
|
/**
|
|
1789
1789
|
* @private
|
|
1790
|
-
* @
|
|
1790
|
+
* @return {void}
|
|
1791
1791
|
*/
|
|
1792
1792
|
function blurFocusedElement() {
|
|
1793
1793
|
const shadowRoot = getManagedShadowRoot.call(this);
|
|
@@ -1814,7 +1814,7 @@ function blurFocusedElement() {
|
|
|
1814
1814
|
/**
|
|
1815
1815
|
* @private
|
|
1816
1816
|
* @param {boolean} visible
|
|
1817
|
-
* @
|
|
1817
|
+
* @return {void}
|
|
1818
1818
|
*/
|
|
1819
1819
|
function dispatchVisibilityChangedEvent(visible) {
|
|
1820
1820
|
this.dispatchEvent(
|
|
@@ -1889,7 +1889,7 @@ function initCSSStylesheet() {
|
|
|
1889
1889
|
|
|
1890
1890
|
/**
|
|
1891
1891
|
* @private
|
|
1892
|
-
* @
|
|
1892
|
+
* @return {CSSStyleSheet}
|
|
1893
1893
|
*/
|
|
1894
1894
|
function getHostVisibilityStyleSheet() {
|
|
1895
1895
|
if (hostVisibilityStyleSheet instanceof CSSStyleSheet) {
|
|
@@ -1907,7 +1907,7 @@ function getHostVisibilityStyleSheet() {
|
|
|
1907
1907
|
/**
|
|
1908
1908
|
* @private
|
|
1909
1909
|
* @param {ShadowRoot} shadowRoot
|
|
1910
|
-
* @
|
|
1910
|
+
* @return {void}
|
|
1911
1911
|
*/
|
|
1912
1912
|
function appendVisibilityHostStyle(shadowRoot) {
|
|
1913
1913
|
if (!(shadowRoot instanceof ShadowRoot)) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Helper function to sanitize HTML content by removing potentially dangerous content.
|
|
3
3
|
* @param {string} htmlString - The HTML string to sanitize.
|
|
4
4
|
* @param {Object} [options={}] - Optional configuration options.
|
|
5
|
-
* @
|
|
5
|
+
* @return {string} The sanitized HTML string.
|
|
6
6
|
*/
|
|
7
7
|
export function sanitizeHtml(htmlString, options = {}) {
|
|
8
8
|
const parser = new DOMParser();
|
package/source/i18n/internal.mjs
CHANGED
|
@@ -23,7 +23,7 @@ getInternalTranslations();
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
*
|
|
26
|
-
* @
|
|
26
|
+
* @return {*|Translations}
|
|
27
27
|
*/
|
|
28
28
|
function getInternalTranslations() {
|
|
29
29
|
if (internalTranslations) {
|
|
@@ -170,7 +170,7 @@ function getInternalTranslations() {
|
|
|
170
170
|
/**
|
|
171
171
|
* Returns the internal localization message.
|
|
172
172
|
* @param message
|
|
173
|
-
* @
|
|
173
|
+
* @return {string}
|
|
174
174
|
*/
|
|
175
175
|
|
|
176
176
|
function getInternalLocalizationMessage(message) {
|
|
@@ -147,7 +147,7 @@ class Embed extends Provider {
|
|
|
147
147
|
* `script[data-monster-role=translations]` is searched for and the translations are assigned to the element.
|
|
148
148
|
*
|
|
149
149
|
* @param element
|
|
150
|
-
* @
|
|
150
|
+
* @return {Promise<Awaited<*[]>>|Promise<Awaited<unknown>[]>}
|
|
151
151
|
*/
|
|
152
152
|
static assignTranslationsToElement(element) {
|
|
153
153
|
const d = getDocument();
|
package/source/i18n/time-ago.mjs
CHANGED
|
@@ -121,6 +121,7 @@ const workingDataSymbol = Symbol("workingData");
|
|
|
121
121
|
* @license AGPLv3
|
|
122
122
|
* @since 1.12.0
|
|
123
123
|
* @copyright Volker Schukai
|
|
124
|
+
* @summary Formats placeholder-based messages from structured values and pipes.
|
|
124
125
|
*/
|
|
125
126
|
class Formatter extends BaseWithOptions {
|
|
126
127
|
/**
|
package/source/types/dataurl.mjs
CHANGED
|
@@ -37,6 +37,7 @@ const internal = Symbol("internal");
|
|
|
37
37
|
* @copyright Volker Schukai
|
|
38
38
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
|
|
39
39
|
* @see https://datatracker.ietf.org/doc/html/rfc2397
|
|
40
|
+
* @summary Parses and represents data URLs with media type and content.
|
|
40
41
|
*/
|
|
41
42
|
class DataUrl extends Base {
|
|
42
43
|
/**
|
package/source/types/has.mjs
CHANGED
package/source/types/is.mjs
CHANGED
|
@@ -33,7 +33,7 @@ export {
|
|
|
33
33
|
/**
|
|
34
34
|
* Checks whether the value passed is a DOM Element.
|
|
35
35
|
* @param {*} value
|
|
36
|
-
* @
|
|
36
|
+
* @return {boolean}
|
|
37
37
|
*/
|
|
38
38
|
function isElement(value) {
|
|
39
39
|
if (typeof Element === "undefined") {
|
|
@@ -46,7 +46,7 @@ function isElement(value) {
|
|
|
46
46
|
* Checks whether the value passed is a Proxy.
|
|
47
47
|
*
|
|
48
48
|
* @param {*} value
|
|
49
|
-
* @
|
|
49
|
+
* @return {boolean}
|
|
50
50
|
*/
|
|
51
51
|
function isProxy(value) {
|
|
52
52
|
return value?.[proxyInstanceMarker] === proxyInstanceMarker;
|
|
@@ -75,7 +75,7 @@ class Observer extends Base {
|
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* This method is called by the `instanceof` operator.
|
|
78
|
-
* @
|
|
78
|
+
* @return {symbol}
|
|
79
79
|
* @since 2.1.0
|
|
80
80
|
*/
|
|
81
81
|
static get [instanceSymbol]() {
|
|
@@ -97,7 +97,7 @@ class Observer extends Base {
|
|
|
97
97
|
* the callback is only executed once. All callers will receive the same promise.
|
|
98
98
|
*
|
|
99
99
|
* @param {object} subject The subject object that triggered the update.
|
|
100
|
-
* @
|
|
100
|
+
* @return {Promise<*>} A promise that resolves with the return value of the callback,
|
|
101
101
|
* or rejects if the callback throws an error.
|
|
102
102
|
*/
|
|
103
103
|
update(subject) {
|
|
@@ -129,7 +129,7 @@ class Observer extends Base {
|
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
131
|
* @param {string} tag
|
|
132
|
-
* @
|
|
132
|
+
* @return {Observer}
|
|
133
133
|
*/
|
|
134
134
|
addTag(tag) {
|
|
135
135
|
this.#tags.add(tag);
|
|
@@ -138,7 +138,7 @@ class Observer extends Base {
|
|
|
138
138
|
|
|
139
139
|
/**
|
|
140
140
|
* @param {string} tag
|
|
141
|
-
* @
|
|
141
|
+
* @return {Observer}
|
|
142
142
|
*/
|
|
143
143
|
removeTag(tag) {
|
|
144
144
|
this.#tags.remove(tag);
|
|
@@ -146,7 +146,7 @@ class Observer extends Base {
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
/**
|
|
149
|
-
* @
|
|
149
|
+
* @return {string[]}
|
|
150
150
|
*/
|
|
151
151
|
getTags() {
|
|
152
152
|
return this.#tags.entries();
|
|
@@ -154,7 +154,7 @@ class Observer extends Base {
|
|
|
154
154
|
|
|
155
155
|
/**
|
|
156
156
|
* @param {string} tag
|
|
157
|
-
* @
|
|
157
|
+
* @return {boolean}
|
|
158
158
|
*/
|
|
159
159
|
hasTag(tag) {
|
|
160
160
|
return this.#tags.contains(tag);
|
package/source/types/stack.mjs
CHANGED
package/source/types/uuid.mjs
CHANGED
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
*
|
|
92
92
|
* @param color
|
|
93
93
|
* @param minContrast
|
|
94
|
-
* @
|
|
94
|
+
* @return {string|string}
|
|
95
95
|
* @summary This function generates a color that meets the WCAG contrast ratio requirements against a given base color.
|
|
96
96
|
*/
|
|
97
97
|
export function accessibleColor(color, minContrast = 4.5) {
|
|
@@ -187,7 +187,7 @@ function luminance(hex) {
|
|
|
187
187
|
*
|
|
188
188
|
* @param {number} l1 - The relative luminance of the lighter element.
|
|
189
189
|
* @param {number} l2 - The relative luminance of the darker element.
|
|
190
|
-
* @
|
|
190
|
+
* @return {number} The contrast ratio, a value ranging from 1 to 21.
|
|
191
191
|
*/
|
|
192
192
|
const contrastRatio = (l1, l2) =>
|
|
193
193
|
(Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05);
|