@m3e/core 1.0.5 → 1.0.6
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/dist/custom-elements.json +152 -118
- package/dist/index.js +84 -76
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +90 -90
- package/dist/index.min.js.map +1 -1
- package/dist/src/shared/controllers/FocusController.d.ts.map +1 -1
- package/dist/src/shared/utils/forcedColorsActive.d.ts +6 -0
- package/dist/src/shared/utils/forcedColorsActive.d.ts.map +1 -0
- package/dist/src/shared/utils/index.d.ts +1 -0
- package/dist/src/shared/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -5331,6 +5331,56 @@
|
|
|
5331
5331
|
}
|
|
5332
5332
|
]
|
|
5333
5333
|
},
|
|
5334
|
+
{
|
|
5335
|
+
"kind": "javascript-module",
|
|
5336
|
+
"path": "src/shared/decorators/debounce.ts",
|
|
5337
|
+
"declarations": [
|
|
5338
|
+
{
|
|
5339
|
+
"kind": "function",
|
|
5340
|
+
"name": "debounce",
|
|
5341
|
+
"return": {
|
|
5342
|
+
"type": {
|
|
5343
|
+
"text": "MethodDecorator"
|
|
5344
|
+
}
|
|
5345
|
+
},
|
|
5346
|
+
"parameters": [
|
|
5347
|
+
{
|
|
5348
|
+
"name": "timeout",
|
|
5349
|
+
"type": {
|
|
5350
|
+
"text": "number"
|
|
5351
|
+
},
|
|
5352
|
+
"description": "The timeout, in milliseconds, after which the function is invoked."
|
|
5353
|
+
}
|
|
5354
|
+
],
|
|
5355
|
+
"description": "A decorator that runs a function once after a given \"cooldown\" period."
|
|
5356
|
+
}
|
|
5357
|
+
],
|
|
5358
|
+
"exports": [
|
|
5359
|
+
{
|
|
5360
|
+
"kind": "js",
|
|
5361
|
+
"name": "debounce",
|
|
5362
|
+
"declaration": {
|
|
5363
|
+
"name": "debounce",
|
|
5364
|
+
"module": "src/shared/decorators/debounce.ts"
|
|
5365
|
+
}
|
|
5366
|
+
}
|
|
5367
|
+
]
|
|
5368
|
+
},
|
|
5369
|
+
{
|
|
5370
|
+
"kind": "javascript-module",
|
|
5371
|
+
"path": "src/shared/decorators/index.ts",
|
|
5372
|
+
"declarations": [],
|
|
5373
|
+
"exports": [
|
|
5374
|
+
{
|
|
5375
|
+
"kind": "js",
|
|
5376
|
+
"name": "*",
|
|
5377
|
+
"declaration": {
|
|
5378
|
+
"name": "*",
|
|
5379
|
+
"package": "\"./debounce\""
|
|
5380
|
+
}
|
|
5381
|
+
}
|
|
5382
|
+
]
|
|
5383
|
+
},
|
|
5334
5384
|
{
|
|
5335
5385
|
"kind": "javascript-module",
|
|
5336
5386
|
"path": "src/shared/controllers/FocusController.ts",
|
|
@@ -8245,124 +8295,6 @@
|
|
|
8245
8295
|
}
|
|
8246
8296
|
]
|
|
8247
8297
|
},
|
|
8248
|
-
{
|
|
8249
|
-
"kind": "javascript-module",
|
|
8250
|
-
"path": "src/shared/decorators/debounce.ts",
|
|
8251
|
-
"declarations": [
|
|
8252
|
-
{
|
|
8253
|
-
"kind": "function",
|
|
8254
|
-
"name": "debounce",
|
|
8255
|
-
"return": {
|
|
8256
|
-
"type": {
|
|
8257
|
-
"text": "MethodDecorator"
|
|
8258
|
-
}
|
|
8259
|
-
},
|
|
8260
|
-
"parameters": [
|
|
8261
|
-
{
|
|
8262
|
-
"name": "timeout",
|
|
8263
|
-
"type": {
|
|
8264
|
-
"text": "number"
|
|
8265
|
-
},
|
|
8266
|
-
"description": "The timeout, in milliseconds, after which the function is invoked."
|
|
8267
|
-
}
|
|
8268
|
-
],
|
|
8269
|
-
"description": "A decorator that runs a function once after a given \"cooldown\" period."
|
|
8270
|
-
}
|
|
8271
|
-
],
|
|
8272
|
-
"exports": [
|
|
8273
|
-
{
|
|
8274
|
-
"kind": "js",
|
|
8275
|
-
"name": "debounce",
|
|
8276
|
-
"declaration": {
|
|
8277
|
-
"name": "debounce",
|
|
8278
|
-
"module": "src/shared/decorators/debounce.ts"
|
|
8279
|
-
}
|
|
8280
|
-
}
|
|
8281
|
-
]
|
|
8282
|
-
},
|
|
8283
|
-
{
|
|
8284
|
-
"kind": "javascript-module",
|
|
8285
|
-
"path": "src/shared/decorators/index.ts",
|
|
8286
|
-
"declarations": [],
|
|
8287
|
-
"exports": [
|
|
8288
|
-
{
|
|
8289
|
-
"kind": "js",
|
|
8290
|
-
"name": "*",
|
|
8291
|
-
"declaration": {
|
|
8292
|
-
"name": "*",
|
|
8293
|
-
"package": "\"./debounce\""
|
|
8294
|
-
}
|
|
8295
|
-
}
|
|
8296
|
-
]
|
|
8297
|
-
},
|
|
8298
|
-
{
|
|
8299
|
-
"kind": "javascript-module",
|
|
8300
|
-
"path": "src/shared/directives/index.ts",
|
|
8301
|
-
"declarations": [],
|
|
8302
|
-
"exports": [
|
|
8303
|
-
{
|
|
8304
|
-
"kind": "js",
|
|
8305
|
-
"name": "*",
|
|
8306
|
-
"declaration": {
|
|
8307
|
-
"name": "*",
|
|
8308
|
-
"package": "\"./safeStyleMap\""
|
|
8309
|
-
}
|
|
8310
|
-
}
|
|
8311
|
-
]
|
|
8312
|
-
},
|
|
8313
|
-
{
|
|
8314
|
-
"kind": "javascript-module",
|
|
8315
|
-
"path": "src/shared/directives/safeStyleMap.ts",
|
|
8316
|
-
"declarations": [
|
|
8317
|
-
{
|
|
8318
|
-
"kind": "class",
|
|
8319
|
-
"description": "",
|
|
8320
|
-
"name": "SafeStyleMapDirective",
|
|
8321
|
-
"members": [
|
|
8322
|
-
{
|
|
8323
|
-
"kind": "field",
|
|
8324
|
-
"name": "_previousStyleProperties",
|
|
8325
|
-
"type": {
|
|
8326
|
-
"text": "Set<string> | undefined"
|
|
8327
|
-
},
|
|
8328
|
-
"privacy": "private"
|
|
8329
|
-
}
|
|
8330
|
-
],
|
|
8331
|
-
"superclass": {
|
|
8332
|
-
"name": "Directive",
|
|
8333
|
-
"package": "lit/directive.js"
|
|
8334
|
-
}
|
|
8335
|
-
},
|
|
8336
|
-
{
|
|
8337
|
-
"kind": "variable",
|
|
8338
|
-
"name": "safeStyleMap",
|
|
8339
|
-
"description": "A directive that applies CSS properties to an element.\r\n\r\n`safeStyleMap` can only be used in the `style` attribute and must be the only\r\nexpression in the attribute. It takes the property names in the\r\nStyleInfostyleInfo object and adds the properties to the inline\r\nstyle of the element.\r\n\r\nProperty names with dashes (`-`) are assumed to be valid CSS\r\nproperty names and set on the element's style object using `setProperty()`.\r\nNames without dashes are assumed to be camelCased JavaScript property names\r\nand set on the element's style object using property assignment, allowing the\r\nstyle object to translate JavaScript-style names to CSS property names.\r\n\r\nFor example `safeStyleMap({backgroundColor: 'red', 'border-top': '5px', '--size':\r\n'0'})` sets the `background-color`, `border-top` and `--size` properties.",
|
|
8340
|
-
"parameters": [
|
|
8341
|
-
{
|
|
8342
|
-
"name": "styleInfo"
|
|
8343
|
-
}
|
|
8344
|
-
]
|
|
8345
|
-
}
|
|
8346
|
-
],
|
|
8347
|
-
"exports": [
|
|
8348
|
-
{
|
|
8349
|
-
"kind": "js",
|
|
8350
|
-
"name": "safeStyleMap",
|
|
8351
|
-
"declaration": {
|
|
8352
|
-
"name": "safeStyleMap",
|
|
8353
|
-
"module": "src/shared/directives/safeStyleMap.ts"
|
|
8354
|
-
}
|
|
8355
|
-
},
|
|
8356
|
-
{
|
|
8357
|
-
"kind": "js",
|
|
8358
|
-
"name": "SafeStyleMapDirective",
|
|
8359
|
-
"declaration": {
|
|
8360
|
-
"name": "SafeStyleMapDirective",
|
|
8361
|
-
"module": "src/shared/directives/safeStyleMap.ts"
|
|
8362
|
-
}
|
|
8363
|
-
}
|
|
8364
|
-
]
|
|
8365
|
-
},
|
|
8366
8298
|
{
|
|
8367
8299
|
"kind": "javascript-module",
|
|
8368
8300
|
"path": "src/shared/mixins/AttachInternals.ts",
|
|
@@ -10905,6 +10837,74 @@
|
|
|
10905
10837
|
}
|
|
10906
10838
|
]
|
|
10907
10839
|
},
|
|
10840
|
+
{
|
|
10841
|
+
"kind": "javascript-module",
|
|
10842
|
+
"path": "src/shared/directives/index.ts",
|
|
10843
|
+
"declarations": [],
|
|
10844
|
+
"exports": [
|
|
10845
|
+
{
|
|
10846
|
+
"kind": "js",
|
|
10847
|
+
"name": "*",
|
|
10848
|
+
"declaration": {
|
|
10849
|
+
"name": "*",
|
|
10850
|
+
"package": "\"./safeStyleMap\""
|
|
10851
|
+
}
|
|
10852
|
+
}
|
|
10853
|
+
]
|
|
10854
|
+
},
|
|
10855
|
+
{
|
|
10856
|
+
"kind": "javascript-module",
|
|
10857
|
+
"path": "src/shared/directives/safeStyleMap.ts",
|
|
10858
|
+
"declarations": [
|
|
10859
|
+
{
|
|
10860
|
+
"kind": "class",
|
|
10861
|
+
"description": "",
|
|
10862
|
+
"name": "SafeStyleMapDirective",
|
|
10863
|
+
"members": [
|
|
10864
|
+
{
|
|
10865
|
+
"kind": "field",
|
|
10866
|
+
"name": "_previousStyleProperties",
|
|
10867
|
+
"type": {
|
|
10868
|
+
"text": "Set<string> | undefined"
|
|
10869
|
+
},
|
|
10870
|
+
"privacy": "private"
|
|
10871
|
+
}
|
|
10872
|
+
],
|
|
10873
|
+
"superclass": {
|
|
10874
|
+
"name": "Directive",
|
|
10875
|
+
"package": "lit/directive.js"
|
|
10876
|
+
}
|
|
10877
|
+
},
|
|
10878
|
+
{
|
|
10879
|
+
"kind": "variable",
|
|
10880
|
+
"name": "safeStyleMap",
|
|
10881
|
+
"description": "A directive that applies CSS properties to an element.\r\n\r\n`safeStyleMap` can only be used in the `style` attribute and must be the only\r\nexpression in the attribute. It takes the property names in the\r\nStyleInfostyleInfo object and adds the properties to the inline\r\nstyle of the element.\r\n\r\nProperty names with dashes (`-`) are assumed to be valid CSS\r\nproperty names and set on the element's style object using `setProperty()`.\r\nNames without dashes are assumed to be camelCased JavaScript property names\r\nand set on the element's style object using property assignment, allowing the\r\nstyle object to translate JavaScript-style names to CSS property names.\r\n\r\nFor example `safeStyleMap({backgroundColor: 'red', 'border-top': '5px', '--size':\r\n'0'})` sets the `background-color`, `border-top` and `--size` properties.",
|
|
10882
|
+
"parameters": [
|
|
10883
|
+
{
|
|
10884
|
+
"name": "styleInfo"
|
|
10885
|
+
}
|
|
10886
|
+
]
|
|
10887
|
+
}
|
|
10888
|
+
],
|
|
10889
|
+
"exports": [
|
|
10890
|
+
{
|
|
10891
|
+
"kind": "js",
|
|
10892
|
+
"name": "safeStyleMap",
|
|
10893
|
+
"declaration": {
|
|
10894
|
+
"name": "safeStyleMap",
|
|
10895
|
+
"module": "src/shared/directives/safeStyleMap.ts"
|
|
10896
|
+
}
|
|
10897
|
+
},
|
|
10898
|
+
{
|
|
10899
|
+
"kind": "js",
|
|
10900
|
+
"name": "SafeStyleMapDirective",
|
|
10901
|
+
"declaration": {
|
|
10902
|
+
"name": "SafeStyleMapDirective",
|
|
10903
|
+
"module": "src/shared/directives/safeStyleMap.ts"
|
|
10904
|
+
}
|
|
10905
|
+
}
|
|
10906
|
+
]
|
|
10907
|
+
},
|
|
10908
10908
|
{
|
|
10909
10909
|
"kind": "javascript-module",
|
|
10910
10910
|
"path": "src/shared/primitives/CollapsibleElement.ts",
|
|
@@ -13524,6 +13524,32 @@
|
|
|
13524
13524
|
}
|
|
13525
13525
|
]
|
|
13526
13526
|
},
|
|
13527
|
+
{
|
|
13528
|
+
"kind": "javascript-module",
|
|
13529
|
+
"path": "src/shared/utils/forcedColorsActive.ts",
|
|
13530
|
+
"declarations": [
|
|
13531
|
+
{
|
|
13532
|
+
"kind": "function",
|
|
13533
|
+
"name": "forcedColorsActive",
|
|
13534
|
+
"return": {
|
|
13535
|
+
"type": {
|
|
13536
|
+
"text": "boolean"
|
|
13537
|
+
}
|
|
13538
|
+
},
|
|
13539
|
+
"description": "Determines whether forced colors are active."
|
|
13540
|
+
}
|
|
13541
|
+
],
|
|
13542
|
+
"exports": [
|
|
13543
|
+
{
|
|
13544
|
+
"kind": "js",
|
|
13545
|
+
"name": "forcedColorsActive",
|
|
13546
|
+
"declaration": {
|
|
13547
|
+
"name": "forcedColorsActive",
|
|
13548
|
+
"module": "src/shared/utils/forcedColorsActive.ts"
|
|
13549
|
+
}
|
|
13550
|
+
}
|
|
13551
|
+
]
|
|
13552
|
+
},
|
|
13527
13553
|
{
|
|
13528
13554
|
"kind": "javascript-module",
|
|
13529
13555
|
"path": "src/shared/utils/getTextContent.ts",
|
|
@@ -13634,6 +13660,14 @@
|
|
|
13634
13660
|
"path": "src/shared/utils/index.ts",
|
|
13635
13661
|
"declarations": [],
|
|
13636
13662
|
"exports": [
|
|
13663
|
+
{
|
|
13664
|
+
"kind": "js",
|
|
13665
|
+
"name": "*",
|
|
13666
|
+
"declaration": {
|
|
13667
|
+
"name": "*",
|
|
13668
|
+
"package": "\"./forcedColorsActive\""
|
|
13669
|
+
}
|
|
13670
|
+
},
|
|
13637
13671
|
{
|
|
13638
13672
|
"kind": "js",
|
|
13639
13673
|
"name": "*",
|
package/dist/index.js
CHANGED
|
@@ -112,6 +112,88 @@ class MonitorControllerBase {
|
|
|
112
112
|
}
|
|
113
113
|
_MonitorControllerBase_host = new WeakMap(), _MonitorControllerBase_target = new WeakMap(), _MonitorControllerBase_targets = new WeakMap();
|
|
114
114
|
|
|
115
|
+
/**
|
|
116
|
+
* Determines whether forced colors are active.
|
|
117
|
+
* @returns {boolean} Whether forced colors are active.
|
|
118
|
+
*/
|
|
119
|
+
function forcedColorsActive() {
|
|
120
|
+
return !isServer && matchMedia("(forced-colors: active)").matches;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Gets the text content of a given node, including slotted content.
|
|
125
|
+
* @param {Node} node The node for which to get text content.
|
|
126
|
+
* @param {boolean} [trim = false] A value indicating whether to trim content.
|
|
127
|
+
* @returns {string} The text content of `node`.
|
|
128
|
+
*/
|
|
129
|
+
function getTextContent(node, trim = false) {
|
|
130
|
+
let textContent = "";
|
|
131
|
+
switch (node.nodeType) {
|
|
132
|
+
case Node.TEXT_NODE:
|
|
133
|
+
textContent = node.nodeValue ?? "";
|
|
134
|
+
break;
|
|
135
|
+
case Node.ELEMENT_NODE:
|
|
136
|
+
if (node instanceof HTMLSlotElement) {
|
|
137
|
+
for (const assignedNode of node.assignedNodes({ flatten: true })) {
|
|
138
|
+
textContent += getTextContent(assignedNode, trim);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
for (const child of node.childNodes) {
|
|
143
|
+
textContent += getTextContent(child, trim);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
if (trim) {
|
|
149
|
+
textContent = textContent.trim();
|
|
150
|
+
}
|
|
151
|
+
return textContent;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Generates a new globally unique identifier (GUID).
|
|
156
|
+
* @returns {string} A new globally unique identifier.
|
|
157
|
+
*/
|
|
158
|
+
function guid() {
|
|
159
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
160
|
+
const r = (Math.random() * 16) | 0;
|
|
161
|
+
const v = c === "x" ? r : (r & 0x3) | 0x8;
|
|
162
|
+
return v.toString(16);
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Determines whether a slot has any assigned nodes.
|
|
168
|
+
* @param {HTMLSlotElement} slot The slot to test.
|
|
169
|
+
* @returns {boolean} Whether `slot` has any assigned nodes.
|
|
170
|
+
*/
|
|
171
|
+
function hasAssignedNodes(slot) {
|
|
172
|
+
return slot.assignedNodes({ flatten: true }).length > 0;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Determines whether reduced motion is preferred.
|
|
177
|
+
* @returns {boolean} Whether reduced motion is preferred.
|
|
178
|
+
*/
|
|
179
|
+
function prefersReducedMotion() {
|
|
180
|
+
return isServer || matchMedia("(prefers-reduced-motion)").matches;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* If needed, scrolls an element into view within a given scroll container.
|
|
185
|
+
* @param {HTMLElement} element The element to scroll into view.
|
|
186
|
+
* @param {HTMLElement} scrollContainer The scrollable container.
|
|
187
|
+
* @param {ScrollIntoViewOptions} [options=undefined] Options used to scroll into view.
|
|
188
|
+
*/
|
|
189
|
+
function scrollIntoViewIfNeeded(element, scrollContainer, options) {
|
|
190
|
+
const containerBounds = scrollContainer.getBoundingClientRect();
|
|
191
|
+
const elementBounds = element.getBoundingClientRect();
|
|
192
|
+
if (elementBounds.top < containerBounds.top || elementBounds.bottom > containerBounds.bottom) {
|
|
193
|
+
element.scrollIntoView(options);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
115
197
|
var _FocusController_instances, _FocusController_callback, _FocusController_focusInHandler, _FocusController_focusOutHandler, _FocusController_handleFocusIn, _FocusController_handleFocusOut;
|
|
116
198
|
/** A `ReactiveController` used to monitor the focused state of one or more elements. */
|
|
117
199
|
class FocusController extends MonitorControllerBase {
|
|
@@ -149,7 +231,7 @@ class FocusController extends MonitorControllerBase {
|
|
|
149
231
|
}
|
|
150
232
|
_FocusController_callback = new WeakMap(), _FocusController_focusInHandler = new WeakMap(), _FocusController_focusOutHandler = new WeakMap(), _FocusController_instances = new WeakSet(), _FocusController_handleFocusIn = function _FocusController_handleFocusIn(e) {
|
|
151
233
|
const target = e.target;
|
|
152
|
-
__classPrivateFieldGet(this, _FocusController_callback, "f").call(this, true, target.matches(":focus-visible") ||
|
|
234
|
+
__classPrivateFieldGet(this, _FocusController_callback, "f").call(this, true, target.matches(":focus-visible") || forcedColorsActive(), target);
|
|
153
235
|
}, _FocusController_handleFocusOut = function _FocusController_handleFocusOut(e) {
|
|
154
236
|
__classPrivateFieldGet(this, _FocusController_callback, "f").call(this, false, false, e.target);
|
|
155
237
|
};
|
|
@@ -2896,80 +2978,6 @@ function Vertical(base) {
|
|
|
2896
2978
|
return _VerticalMixin;
|
|
2897
2979
|
}
|
|
2898
2980
|
|
|
2899
|
-
/**
|
|
2900
|
-
* Gets the text content of a given node, including slotted content.
|
|
2901
|
-
* @param {Node} node The node for which to get text content.
|
|
2902
|
-
* @param {boolean} [trim = false] A value indicating whether to trim content.
|
|
2903
|
-
* @returns {string} The text content of `node`.
|
|
2904
|
-
*/
|
|
2905
|
-
function getTextContent(node, trim = false) {
|
|
2906
|
-
let textContent = "";
|
|
2907
|
-
switch (node.nodeType) {
|
|
2908
|
-
case Node.TEXT_NODE:
|
|
2909
|
-
textContent = node.nodeValue ?? "";
|
|
2910
|
-
break;
|
|
2911
|
-
case Node.ELEMENT_NODE:
|
|
2912
|
-
if (node instanceof HTMLSlotElement) {
|
|
2913
|
-
for (const assignedNode of node.assignedNodes({ flatten: true })) {
|
|
2914
|
-
textContent += getTextContent(assignedNode, trim);
|
|
2915
|
-
}
|
|
2916
|
-
}
|
|
2917
|
-
else {
|
|
2918
|
-
for (const child of node.childNodes) {
|
|
2919
|
-
textContent += getTextContent(child, trim);
|
|
2920
|
-
}
|
|
2921
|
-
}
|
|
2922
|
-
break;
|
|
2923
|
-
}
|
|
2924
|
-
if (trim) {
|
|
2925
|
-
textContent = textContent.trim();
|
|
2926
|
-
}
|
|
2927
|
-
return textContent;
|
|
2928
|
-
}
|
|
2929
|
-
|
|
2930
|
-
/**
|
|
2931
|
-
* Generates a new globally unique identifier (GUID).
|
|
2932
|
-
* @returns {string} A new globally unique identifier.
|
|
2933
|
-
*/
|
|
2934
|
-
function guid() {
|
|
2935
|
-
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
2936
|
-
const r = (Math.random() * 16) | 0;
|
|
2937
|
-
const v = c === "x" ? r : (r & 0x3) | 0x8;
|
|
2938
|
-
return v.toString(16);
|
|
2939
|
-
});
|
|
2940
|
-
}
|
|
2941
|
-
|
|
2942
|
-
/**
|
|
2943
|
-
* Determines whether a slot has any assigned nodes.
|
|
2944
|
-
* @param {HTMLSlotElement} slot The slot to test.
|
|
2945
|
-
* @returns {boolean} Whether `slot` has any assigned nodes.
|
|
2946
|
-
*/
|
|
2947
|
-
function hasAssignedNodes(slot) {
|
|
2948
|
-
return slot.assignedNodes({ flatten: true }).length > 0;
|
|
2949
|
-
}
|
|
2950
|
-
|
|
2951
|
-
/**
|
|
2952
|
-
* Determines whether reduced motion is preferred.
|
|
2953
|
-
* @returns {boolean} Whether reduced motion is preferred.
|
|
2954
|
-
*/
|
|
2955
|
-
function prefersReducedMotion() {
|
|
2956
|
-
return isServer || matchMedia("(prefers-reduced-motion)").matches;
|
|
2957
|
-
}
|
|
2958
|
-
|
|
2959
|
-
/**
|
|
2960
|
-
* If needed, scrolls an element into view within a given scroll container.
|
|
2961
|
-
* @param {HTMLElement} element The element to scroll into view.
|
|
2962
|
-
* @param {HTMLElement} scrollContainer The scrollable container.
|
|
2963
|
-
* @param {ScrollIntoViewOptions} [options=undefined] Options used to scroll into view.
|
|
2964
|
-
*/
|
|
2965
|
-
function scrollIntoViewIfNeeded(element, scrollContainer, options) {
|
|
2966
|
-
const containerBounds = scrollContainer.getBoundingClientRect();
|
|
2967
|
-
const elementBounds = element.getBoundingClientRect();
|
|
2968
|
-
if (elementBounds.top < containerBounds.top || elementBounds.bottom > containerBounds.bottom) {
|
|
2969
|
-
element.scrollIntoView(options);
|
|
2970
|
-
}
|
|
2971
|
-
}
|
|
2972
|
-
|
|
2973
2981
|
/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
|
|
2974
2982
|
var _M3eCollapsibleElement_instances, _M3eCollapsibleElement_slotChanged, _M3eCollapsibleElement_hasOpened, _M3eCollapsibleElement_handleSlotChange, _M3eCollapsibleElement_autoSize, _M3eCollapsibleElement_clearSize, _M3eCollapsibleElement_actualSize;
|
|
2975
2983
|
/**
|
|
@@ -4756,5 +4764,5 @@ M3eTextHighlightElement = M3eTextHighlightElement_1 = __decorate([
|
|
|
4756
4764
|
t$2("m3e-text-highlight")
|
|
4757
4765
|
], M3eTextHighlightElement);
|
|
4758
4766
|
|
|
4759
|
-
export { AttachInternals, Checked, CheckedIndeterminate, ConstraintValidation, DesignToken, Dirty, Disabled, DisabledInteractive, EventAttribute, FocusController, Focusable, FormAssociated, FormSubmitter, HoverController, HtmlFor, IntersectionController, KeyboardClick, Labelled, LinkButton, LongPressController, M3eCollapsibleElement, M3eElevationElement, M3eFocusRingElement, M3ePseudoCheckboxElement, M3ePseudoRadioElement, M3eRippleElement, M3eScrollContainerElement, M3eSlideElement, M3eStateLayerElement, M3eTextHighlightElement, M3eTextOverflowElement, MutationController, PressedController, ReadOnly, Required, RequiredConstraintValidation, ResizeController, Role, ScrollController, Selected, Touched, Vertical, checkOrSelect, debounce, defaultValue, formValue, getTextContent, guid, hasAssignedNodes, hasKeys, internals, isAttachInternalsMixin, isCheckedIndeterminateMixin, isCheckedMixin, isCheckedOrSelected, isCheckedOrSelectedMixin, isConstraintValidationMixin, isDirtyMixin, isDisabledInteractiveMixin, isDisabledMixin, isFormAssociatedMixin, isFormSubmitterMixin, isHtmlForMixin, isLabelledMixin, isLinkButtonMixin, isReadOnlyMixin, isRequiredConstraintValidationMixin, isRequiredMixin, isSelectedMixin, isTouchedMixin, isVerticalMixin, prefersReducedMotion, renderPseudoLink, safeStyleMap, scrollIntoViewIfNeeded, updateLabels, validate };
|
|
4767
|
+
export { AttachInternals, Checked, CheckedIndeterminate, ConstraintValidation, DesignToken, Dirty, Disabled, DisabledInteractive, EventAttribute, FocusController, Focusable, FormAssociated, FormSubmitter, HoverController, HtmlFor, IntersectionController, KeyboardClick, Labelled, LinkButton, LongPressController, M3eCollapsibleElement, M3eElevationElement, M3eFocusRingElement, M3ePseudoCheckboxElement, M3ePseudoRadioElement, M3eRippleElement, M3eScrollContainerElement, M3eSlideElement, M3eStateLayerElement, M3eTextHighlightElement, M3eTextOverflowElement, MutationController, PressedController, ReadOnly, Required, RequiredConstraintValidation, ResizeController, Role, ScrollController, Selected, Touched, Vertical, checkOrSelect, debounce, defaultValue, forcedColorsActive, formValue, getTextContent, guid, hasAssignedNodes, hasKeys, internals, isAttachInternalsMixin, isCheckedIndeterminateMixin, isCheckedMixin, isCheckedOrSelected, isCheckedOrSelectedMixin, isConstraintValidationMixin, isDirtyMixin, isDisabledInteractiveMixin, isDisabledMixin, isFormAssociatedMixin, isFormSubmitterMixin, isHtmlForMixin, isLabelledMixin, isLinkButtonMixin, isReadOnlyMixin, isRequiredConstraintValidationMixin, isRequiredMixin, isSelectedMixin, isTouchedMixin, isVerticalMixin, prefersReducedMotion, renderPseudoLink, safeStyleMap, scrollIntoViewIfNeeded, updateLabels, validate };
|
|
4760
4768
|
//# sourceMappingURL=index.js.map
|