@maggioli-design-system/mds-input-range 2.1.0 → 2.1.1
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/cjs/{index-52e46581.js → index-27635fed.js} +168 -73
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mds-input-range.cjs.entry.js +14 -7
- package/dist/cjs/mds-input-range.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/common/floating-controller.js +180 -0
- package/dist/collection/common/slot.js +10 -4
- package/dist/collection/components/mds-input-range/mds-input-range.js +23 -6
- package/dist/collection/dictionary/tree.js +13 -0
- package/dist/collection/type/tree.js +1 -0
- package/dist/components/mds-input-range.js +13 -6
- package/dist/documentation.d.ts +8 -0
- package/dist/documentation.json +17 -7
- package/dist/esm/{index-36162582.js → index-c0c11860.js} +168 -73
- package/dist/esm/loader.js +2 -2
- package/dist/esm/mds-input-range.entry.js +14 -7
- package/dist/esm/mds-input-range.js +3 -3
- package/dist/esm-es5/index-c0c11860.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mds-input-range.entry.js +1 -1
- package/dist/esm-es5/mds-input-range.js +1 -1
- package/dist/mds-input-range/mds-input-range.esm.js +1 -1
- package/dist/mds-input-range/mds-input-range.js +1 -1
- package/dist/mds-input-range/{p-d9e1b94c.system.entry.js → p-16118dde.system.entry.js} +1 -1
- package/dist/mds-input-range/p-71d27af5.system.js +2 -0
- package/dist/mds-input-range/p-7a612415.system.js +1 -0
- package/dist/mds-input-range/p-8951c4d3.entry.js +1 -0
- package/dist/mds-input-range/p-dd7b28fc.js +2 -0
- package/dist/stats.json +72 -42
- package/dist/types/common/floating-controller.d.ts +46 -0
- package/dist/types/common/slot.d.ts +2 -1
- package/dist/types/dictionary/tree.d.ts +4 -0
- package/dist/types/type/tree.d.ts +3 -0
- package/documentation.json +42 -12
- package/package.json +4 -4
- package/src/common/floating-controller.ts +263 -0
- package/src/common/slot.ts +12 -3
- package/src/dictionary/tree.ts +21 -0
- package/src/fixtures/icons.json +20 -0
- package/src/fixtures/iconsauce.json +6 -0
- package/src/type/tree.ts +12 -0
- package/www/build/mds-input-range.esm.js +1 -1
- package/www/build/mds-input-range.js +1 -1
- package/www/build/{p-d9e1b94c.system.entry.js → p-16118dde.system.entry.js} +1 -1
- package/www/build/p-71d27af5.system.js +2 -0
- package/www/build/p-7a612415.system.js +1 -0
- package/www/build/p-8951c4d3.entry.js +1 -0
- package/www/build/p-dd7b28fc.js +2 -0
- package/dist/esm-es5/index-36162582.js +0 -1
- package/dist/mds-input-range/p-939e9c32.system.js +0 -1
- package/dist/mds-input-range/p-c39460f4.system.js +0 -2
- package/dist/mds-input-range/p-d06a229e.js +0 -2
- package/dist/mds-input-range/p-e5a76261.entry.js +0 -1
- package/www/build/p-939e9c32.system.js +0 -1
- package/www/build/p-c39460f4.system.js +0 -2
- package/www/build/p-d06a229e.js +0 -2
- package/www/build/p-e5a76261.entry.js +0 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { FloatingUIPlacement, FloatingUIStrategy } from "../type/floating-ui";
|
|
2
|
+
import { HTMLStencilElement } from '../stencil-public-runtime';
|
|
3
|
+
export interface FloatingElement extends PositionOptions {
|
|
4
|
+
host: HTMLFloatingElement;
|
|
5
|
+
}
|
|
6
|
+
export interface HTMLFloatingElement extends HTMLStencilElement, PositionOptions {
|
|
7
|
+
visible: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface PositionOptions {
|
|
10
|
+
arrow: boolean;
|
|
11
|
+
arrowPadding: number;
|
|
12
|
+
autoPlacement: boolean;
|
|
13
|
+
flip: boolean;
|
|
14
|
+
offset: number;
|
|
15
|
+
placement: FloatingUIPlacement;
|
|
16
|
+
shift: boolean;
|
|
17
|
+
shiftPadding: number;
|
|
18
|
+
strategy: FloatingUIStrategy;
|
|
19
|
+
}
|
|
20
|
+
export declare class FloatingController {
|
|
21
|
+
private _caller;
|
|
22
|
+
private readonly _host;
|
|
23
|
+
arrowEl: HTMLElement | undefined;
|
|
24
|
+
private cleanupAutoUpdate;
|
|
25
|
+
constructor(host: HTMLFloatingElement, arrowEl?: HTMLElement);
|
|
26
|
+
updateCaller(target: string): HTMLElement;
|
|
27
|
+
private readonly arrowInset;
|
|
28
|
+
private readonly arrowTransform;
|
|
29
|
+
private readonly arrowTransformOrigin;
|
|
30
|
+
private readonly calculatePosition;
|
|
31
|
+
updatePosition(): void;
|
|
32
|
+
dismiss(): void;
|
|
33
|
+
}
|
|
34
|
+
export declare class Backdrop {
|
|
35
|
+
private readonly defaultBackdropId;
|
|
36
|
+
private readonly backdropBackgroundVisible;
|
|
37
|
+
private readonly backdropBackgroundHidden;
|
|
38
|
+
private readonly backdropId;
|
|
39
|
+
private readonly cssBackdropZIndex;
|
|
40
|
+
private readonly cssBackdropDuration;
|
|
41
|
+
private backdropEl;
|
|
42
|
+
private backdropTimer;
|
|
43
|
+
constructor(backdropId?: string);
|
|
44
|
+
attachBackdrop(): void;
|
|
45
|
+
detachBackdrop(): void;
|
|
46
|
+
}
|
package/documentation.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "
|
|
2
|
+
"timestamp": "2025-02-06T07:52:44",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
|
-
"version": "4.
|
|
5
|
+
"version": "4.25.1",
|
|
6
6
|
"typescriptVersion": "5.5.4"
|
|
7
7
|
},
|
|
8
8
|
"components": [
|
|
@@ -42,7 +42,9 @@
|
|
|
42
42
|
}
|
|
43
43
|
],
|
|
44
44
|
"optional": true,
|
|
45
|
-
"required": false
|
|
45
|
+
"required": false,
|
|
46
|
+
"getter": false,
|
|
47
|
+
"setter": false
|
|
46
48
|
},
|
|
47
49
|
{
|
|
48
50
|
"name": "max",
|
|
@@ -64,7 +66,9 @@
|
|
|
64
66
|
}
|
|
65
67
|
],
|
|
66
68
|
"optional": false,
|
|
67
|
-
"required": false
|
|
69
|
+
"required": false,
|
|
70
|
+
"getter": false,
|
|
71
|
+
"setter": false
|
|
68
72
|
},
|
|
69
73
|
{
|
|
70
74
|
"name": "min",
|
|
@@ -86,7 +90,9 @@
|
|
|
86
90
|
}
|
|
87
91
|
],
|
|
88
92
|
"optional": false,
|
|
89
|
-
"required": false
|
|
93
|
+
"required": false,
|
|
94
|
+
"getter": false,
|
|
95
|
+
"setter": false
|
|
90
96
|
},
|
|
91
97
|
{
|
|
92
98
|
"name": "step",
|
|
@@ -108,7 +114,9 @@
|
|
|
108
114
|
}
|
|
109
115
|
],
|
|
110
116
|
"optional": false,
|
|
111
|
-
"required": false
|
|
117
|
+
"required": false,
|
|
118
|
+
"getter": false,
|
|
119
|
+
"setter": false
|
|
112
120
|
},
|
|
113
121
|
{
|
|
114
122
|
"name": "value",
|
|
@@ -129,7 +137,9 @@
|
|
|
129
137
|
}
|
|
130
138
|
],
|
|
131
139
|
"optional": false,
|
|
132
|
-
"required": false
|
|
140
|
+
"required": false,
|
|
141
|
+
"getter": false,
|
|
142
|
+
"setter": false
|
|
133
143
|
}
|
|
134
144
|
],
|
|
135
145
|
"methods": [],
|
|
@@ -316,6 +326,11 @@
|
|
|
316
326
|
"docstring": "",
|
|
317
327
|
"path": "src/type/button.ts"
|
|
318
328
|
},
|
|
329
|
+
"src/type/text.ts::TypographyTruncateType": {
|
|
330
|
+
"declaration": "export type TypographyTruncateType =\n | 'all'\n | 'none'\n | 'word'",
|
|
331
|
+
"docstring": "",
|
|
332
|
+
"path": "src/type/text.ts"
|
|
333
|
+
},
|
|
319
334
|
"src/type/variant.ts::ChipVariantType": {
|
|
320
335
|
"declaration": "export type ChipVariantType =\n | 'primary'\n | 'secondary'\n | 'dark'\n | 'error'\n | 'info'\n | 'success'\n | 'warning'",
|
|
321
336
|
"docstring": "",
|
|
@@ -356,11 +371,6 @@
|
|
|
356
371
|
"docstring": "",
|
|
357
372
|
"path": "src/components/mds-file/meta/event-detail.ts"
|
|
358
373
|
},
|
|
359
|
-
"src/type/text.ts::TypographyTruncateType": {
|
|
360
|
-
"declaration": "export type TypographyTruncateType =\n | 'all'\n | 'none'\n | 'word'",
|
|
361
|
-
"docstring": "",
|
|
362
|
-
"path": "src/type/text.ts"
|
|
363
|
-
},
|
|
364
374
|
"src/components/mds-file-preview/meta/event-detail.ts::MdsFilePreviewEventDetail": {
|
|
365
375
|
"declaration": "export interface MdsFilePreviewEventDetail {\n extension: string\n filename: string\n target: HTMLMdsFilePreviewElement\n}",
|
|
366
376
|
"docstring": "",
|
|
@@ -681,6 +691,26 @@
|
|
|
681
691
|
"docstring": "",
|
|
682
692
|
"path": "src/type/typography.ts"
|
|
683
693
|
},
|
|
694
|
+
"src/type/tree.ts::TreeAppearance": {
|
|
695
|
+
"declaration": "export type TreeAppearance =\n | 'none'\n | 'depth'",
|
|
696
|
+
"docstring": "",
|
|
697
|
+
"path": "src/type/tree.ts"
|
|
698
|
+
},
|
|
699
|
+
"src/type/tree.ts::TreeIcon": {
|
|
700
|
+
"declaration": "export type TreeIcon =\n | 'folder'\n | 'chevron'",
|
|
701
|
+
"docstring": "",
|
|
702
|
+
"path": "src/type/tree.ts"
|
|
703
|
+
},
|
|
704
|
+
"src/type/tree.ts::TreeActions": {
|
|
705
|
+
"declaration": "export type TreeActions =\n | 'auto'\n | 'visible'",
|
|
706
|
+
"docstring": "",
|
|
707
|
+
"path": "src/type/tree.ts"
|
|
708
|
+
},
|
|
709
|
+
"src/components/mds-tree-item/meta/event-detail.ts::MdsTreeItemEventDetail": {
|
|
710
|
+
"declaration": "export interface MdsTreeItemEventDetail {\n element: HTMLMdsTreeItemElement\n}",
|
|
711
|
+
"docstring": "",
|
|
712
|
+
"path": "src/components/mds-tree-item/meta/event-detail.ts"
|
|
713
|
+
},
|
|
684
714
|
"src/components/mds-usage/meta/types.ts::UsageType": {
|
|
685
715
|
"declaration": "export type UsageType =\n | 'do'\n | 'dont'\n | 'info'\n | 'warn'",
|
|
686
716
|
"docstring": "",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maggioli-design-system/mds-input-range",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "mds-input-range is a web-component from Magma Design System, built with StencilJS, TypeScript, Storybook. It's based on the web-component standard and it's designed to be agnostic from the JavaScript framework you are using.",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"test": "stencil test --spec --e2e"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@maggioli-design-system/styles": "15.
|
|
28
|
-
"@maggioli-design-system/mds-text": "4.5.
|
|
29
|
-
"@stencil/core": "4.
|
|
27
|
+
"@maggioli-design-system/styles": "15.7.0",
|
|
28
|
+
"@maggioli-design-system/mds-text": "4.5.3",
|
|
29
|
+
"@stencil/core": "4.25.1"
|
|
30
30
|
},
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"author": {
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import {
|
|
2
|
+
arrow,
|
|
3
|
+
autoPlacement,
|
|
4
|
+
autoUpdate,
|
|
5
|
+
computePosition,
|
|
6
|
+
flip,
|
|
7
|
+
Middleware,
|
|
8
|
+
MiddlewareData,
|
|
9
|
+
offset,
|
|
10
|
+
shift,
|
|
11
|
+
} from '@floating-ui/dom'
|
|
12
|
+
import { FloatingUIPlacement, FloatingUIStrategy } from '@type/floating-ui'
|
|
13
|
+
import { cssDurationToMilliseconds } from './unit'
|
|
14
|
+
import { setAttributeIfEmpty } from './aria'
|
|
15
|
+
import { HTMLStencilElement } from '@stencil/core/internal'
|
|
16
|
+
|
|
17
|
+
export interface FloatingElement extends PositionOptions {
|
|
18
|
+
host: HTMLFloatingElement,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface HTMLFloatingElement extends HTMLStencilElement, PositionOptions {
|
|
22
|
+
visible: boolean,
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface PositionOptions {
|
|
26
|
+
arrow: boolean;
|
|
27
|
+
arrowPadding: number;
|
|
28
|
+
autoPlacement: boolean;
|
|
29
|
+
flip: boolean;
|
|
30
|
+
offset: number;
|
|
31
|
+
placement: FloatingUIPlacement;
|
|
32
|
+
shift: boolean;
|
|
33
|
+
shiftPadding: number;
|
|
34
|
+
strategy: FloatingUIStrategy;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export class FloatingController {
|
|
38
|
+
private _caller: HTMLElement
|
|
39
|
+
private readonly _host: HTMLFloatingElement
|
|
40
|
+
arrowEl: HTMLElement | undefined
|
|
41
|
+
|
|
42
|
+
private cleanupAutoUpdate: () => void
|
|
43
|
+
|
|
44
|
+
constructor (host: HTMLFloatingElement, arrowEl?: HTMLElement) {
|
|
45
|
+
this._host = host
|
|
46
|
+
this.arrowEl = arrowEl
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
updateCaller (target: string): HTMLElement {
|
|
50
|
+
// search caller in document or rootNode of host (if target is in shadowDOM)
|
|
51
|
+
const caller = (this._host.parentElement?.shadowRoot?.querySelector(target) as HTMLElement) ??
|
|
52
|
+
((this._host.getRootNode() as HTMLElement).querySelector(target) as HTMLElement)
|
|
53
|
+
|
|
54
|
+
if (!caller) {
|
|
55
|
+
throw Error(`Target not found: ${target}`)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
this._caller = caller
|
|
59
|
+
|
|
60
|
+
setAttributeIfEmpty(this._caller, 'aria-haspopup', 'true')
|
|
61
|
+
setAttributeIfEmpty(this._caller, 'aria-controls', target)
|
|
62
|
+
setAttributeIfEmpty(this._host, 'role', 'menu')
|
|
63
|
+
setAttributeIfEmpty(this._host, 'aria-labelledby', target)
|
|
64
|
+
return caller
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
private readonly arrowInset = (
|
|
68
|
+
middleware: MiddlewareData,
|
|
69
|
+
arrowPosition: string,
|
|
70
|
+
): { bottom?: string; left?: string; right?: string; top?: string } => {
|
|
71
|
+
const { arrow } = middleware
|
|
72
|
+
const inset = { bottom: '', left: '', right: '', top: '' }
|
|
73
|
+
|
|
74
|
+
if (arrow === undefined) {
|
|
75
|
+
return {}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
switch (arrowPosition) {
|
|
79
|
+
case 'bottom':
|
|
80
|
+
inset.left = arrow.x !== null ? `${arrow.x}px` : ''
|
|
81
|
+
inset.top = '100%'
|
|
82
|
+
break
|
|
83
|
+
case 'left':
|
|
84
|
+
inset.right = '100%'
|
|
85
|
+
inset.top = arrow.y !== null ? `${arrow.y}px` : ''
|
|
86
|
+
break
|
|
87
|
+
case 'right':
|
|
88
|
+
inset.left = '100%'
|
|
89
|
+
inset.top = arrow.y !== null ? `${arrow.y}px` : ''
|
|
90
|
+
break
|
|
91
|
+
case 'top':
|
|
92
|
+
inset.left = arrow.x !== null ? `${arrow.x}px` : ''
|
|
93
|
+
inset.top = ''
|
|
94
|
+
break
|
|
95
|
+
default:
|
|
96
|
+
break
|
|
97
|
+
}
|
|
98
|
+
return inset
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
private readonly arrowTransform = (
|
|
102
|
+
arrowPosition: string,
|
|
103
|
+
): { transform: string } => {
|
|
104
|
+
let transformProps = this._host.arrow && this._host.visible ? 'scale(1)' : 'scale(0)'
|
|
105
|
+
switch (arrowPosition) {
|
|
106
|
+
case 'bottom':
|
|
107
|
+
transformProps = `rotate(180deg) ${transformProps} translate(0, -100%)`
|
|
108
|
+
break
|
|
109
|
+
case 'left':
|
|
110
|
+
transformProps = `rotate(-90deg) ${transformProps} translate(50%, -50%)`
|
|
111
|
+
break
|
|
112
|
+
case 'right':
|
|
113
|
+
transformProps = `rotate(90deg) ${transformProps} translate(-50%, -50%)`
|
|
114
|
+
break
|
|
115
|
+
case 'top':
|
|
116
|
+
transformProps = `rotate(0deg) ${transformProps} translate(0, 0)`
|
|
117
|
+
break
|
|
118
|
+
default:
|
|
119
|
+
break
|
|
120
|
+
}
|
|
121
|
+
return { transform: transformProps }
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
private readonly arrowTransformOrigin = (
|
|
125
|
+
arrowPosition: string,
|
|
126
|
+
): { transformOrigin: string } => {
|
|
127
|
+
switch (arrowPosition) {
|
|
128
|
+
case 'bottom':
|
|
129
|
+
return { transformOrigin: 'center top' }
|
|
130
|
+
case 'left':
|
|
131
|
+
return { transformOrigin: 'right center' }
|
|
132
|
+
case 'right':
|
|
133
|
+
return { transformOrigin: 'left center' }
|
|
134
|
+
case 'top':
|
|
135
|
+
return { transformOrigin: 'center bottom' }
|
|
136
|
+
default:
|
|
137
|
+
return { transformOrigin: 'center top' }
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
private readonly calculatePosition = (): void => {
|
|
142
|
+
if (!this._caller) return
|
|
143
|
+
|
|
144
|
+
const middleware: Middleware[] = new Array<Middleware>()
|
|
145
|
+
const config: { padding?: number } = {}
|
|
146
|
+
|
|
147
|
+
if (this._host.shiftPadding) {
|
|
148
|
+
config.padding = this._host.shiftPadding
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (this._host.autoPlacement) {
|
|
152
|
+
middleware.push(autoPlacement())
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (this._host.offset) {
|
|
156
|
+
middleware.push(offset(this._host.offset))
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (!this._host.autoPlacement && this._host.flip) {
|
|
160
|
+
middleware.push(flip(config))
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (this._host.shift) {
|
|
164
|
+
middleware.push(shift(config))
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (this.arrowEl && this._host.arrow) {
|
|
168
|
+
middleware.push(
|
|
169
|
+
arrow({
|
|
170
|
+
element: this.arrowEl,
|
|
171
|
+
padding: this._host.arrowPadding,
|
|
172
|
+
}),
|
|
173
|
+
)
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
computePosition(this._caller, this._host, {
|
|
177
|
+
middleware,
|
|
178
|
+
placement: this._host.placement,
|
|
179
|
+
strategy: this._host.strategy,
|
|
180
|
+
}).then(({ x, y, placement, middlewareData }) => {
|
|
181
|
+
Object.assign(this._host.style, {
|
|
182
|
+
left: `${x}px`,
|
|
183
|
+
top: `${y}px`,
|
|
184
|
+
})
|
|
185
|
+
|
|
186
|
+
const arrowStyle = {}
|
|
187
|
+
const arrowPosition = {
|
|
188
|
+
top: 'bottom',
|
|
189
|
+
right: 'left',
|
|
190
|
+
bottom: 'top',
|
|
191
|
+
left: 'right',
|
|
192
|
+
}[placement.split('-')[0]]
|
|
193
|
+
|
|
194
|
+
if (arrowPosition && this.arrowEl) {
|
|
195
|
+
Object.assign(arrowStyle, this.arrowTransform(arrowPosition))
|
|
196
|
+
Object.assign(
|
|
197
|
+
arrowStyle,
|
|
198
|
+
this.arrowInset(middlewareData, arrowPosition),
|
|
199
|
+
)
|
|
200
|
+
Object.assign(arrowStyle, this.arrowTransformOrigin(arrowPosition))
|
|
201
|
+
Object.assign(this.arrowEl.style, arrowStyle)
|
|
202
|
+
}
|
|
203
|
+
})
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
updatePosition (): void {
|
|
207
|
+
if (this.cleanupAutoUpdate) this.cleanupAutoUpdate()
|
|
208
|
+
this.cleanupAutoUpdate = autoUpdate(this._caller, this._host, this.calculatePosition)
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
dismiss (): void {
|
|
212
|
+
this.cleanupAutoUpdate()
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export class Backdrop {
|
|
217
|
+
private readonly defaultBackdropId = 'mds-backdrop'
|
|
218
|
+
private readonly backdropBackgroundVisible = 'rgba(var(--magma-backdrop-color, 0 0 0) / var(--magma-backdrop-opacity, 0.1))'
|
|
219
|
+
private readonly backdropBackgroundHidden = 'rgba(var(--magma-backdrop-color, 0 0 0) / 0)'
|
|
220
|
+
|
|
221
|
+
private readonly backdropId
|
|
222
|
+
private readonly cssBackdropZIndex
|
|
223
|
+
private readonly cssBackdropDuration
|
|
224
|
+
|
|
225
|
+
private backdropEl: HTMLElement
|
|
226
|
+
private backdropTimer: NodeJS.Timeout
|
|
227
|
+
|
|
228
|
+
constructor (backdropId?: string) {
|
|
229
|
+
this.backdropId = backdropId ?? this.defaultBackdropId
|
|
230
|
+
this.cssBackdropZIndex = `var(--${this.backdropId}-z-index)`
|
|
231
|
+
this.cssBackdropDuration = `var(--${this.backdropId}-duration)`
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
attachBackdrop (): void {
|
|
235
|
+
if (!this.backdropEl) {
|
|
236
|
+
this.backdropEl = document.createElement('div')
|
|
237
|
+
this.backdropEl.className = this.backdropId
|
|
238
|
+
this.backdropEl.style.inset = '0'
|
|
239
|
+
this.backdropEl.style.pointerEvents = 'none'
|
|
240
|
+
this.backdropEl.style.position = 'fixed'
|
|
241
|
+
this.backdropEl.style.transition = `background-color ${this.cssBackdropDuration} ease-out`
|
|
242
|
+
this.backdropEl.style.zIndex = this.cssBackdropZIndex
|
|
243
|
+
}
|
|
244
|
+
this.backdropEl.style.backgroundColor = this.backdropBackgroundHidden
|
|
245
|
+
document.body.appendChild(this.backdropEl)
|
|
246
|
+
|
|
247
|
+
clearTimeout(this.backdropTimer)
|
|
248
|
+
this.backdropTimer = setTimeout(() => {
|
|
249
|
+
this.backdropEl.style.backgroundColor = this.backdropBackgroundVisible
|
|
250
|
+
}, 1)
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
detachBackdrop (): void {
|
|
254
|
+
if (!this.backdropEl) {
|
|
255
|
+
return
|
|
256
|
+
}
|
|
257
|
+
this.backdropEl.style.backgroundColor = 'transparent'
|
|
258
|
+
clearTimeout(this.backdropTimer)
|
|
259
|
+
this.backdropTimer = setTimeout(() => {
|
|
260
|
+
this.backdropEl.remove()
|
|
261
|
+
}, cssDurationToMilliseconds(this.cssBackdropDuration))
|
|
262
|
+
}
|
|
263
|
+
}
|
package/src/common/slot.ts
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
const hasSlottedElements = (el: HTMLElement, name?: string): boolean => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
const query = name ? `slot[name="${name}"]` : 'slot:not([name])'
|
|
3
|
+
|
|
4
|
+
const slot: HTMLSlotElement = el.shadowRoot?.querySelector(query) as HTMLSlotElement
|
|
5
|
+
if (slot) {
|
|
6
|
+
return slot.assignedElements({ flatten: true }).length > 0
|
|
5
7
|
}
|
|
8
|
+
return false
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const hasSlottedNodes = (el: HTMLElement, name?: string): boolean => {
|
|
12
|
+
const query = name ? `slot[name="${name}"]` : 'slot:not([name])'
|
|
13
|
+
|
|
6
14
|
const slot: HTMLSlotElement = el.shadowRoot?.querySelector(query) as HTMLSlotElement
|
|
7
15
|
if (slot) {
|
|
8
16
|
return slot.assignedNodes().length > 0
|
|
@@ -12,4 +20,5 @@ const hasSlottedElements = (el: HTMLElement, name?: string): boolean => {
|
|
|
12
20
|
|
|
13
21
|
export {
|
|
14
22
|
hasSlottedElements,
|
|
23
|
+
hasSlottedNodes,
|
|
15
24
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const treeActionsDictionary = [
|
|
2
|
+
'auto',
|
|
3
|
+
'visible',
|
|
4
|
+
]
|
|
5
|
+
|
|
6
|
+
const treeAppearanceDictionary = [
|
|
7
|
+
'depth',
|
|
8
|
+
'none',
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
const treeIconDictionary = [
|
|
12
|
+
'folder',
|
|
13
|
+
'chevron',
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
treeActionsDictionary,
|
|
18
|
+
treeAppearanceDictionary,
|
|
19
|
+
treeIconDictionary,
|
|
20
|
+
}
|
|
21
|
+
|
package/src/fixtures/icons.json
CHANGED
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
"mdi/dots-vertical",
|
|
8
8
|
"mdi/email",
|
|
9
9
|
"mdi/file-document-remove-outline",
|
|
10
|
+
"mdi/file-download-outline",
|
|
11
|
+
"mdi/file-upload-outline",
|
|
12
|
+
"mdi/folder-open",
|
|
13
|
+
"mdi/handshake",
|
|
10
14
|
"mdi/harddisk",
|
|
11
15
|
"mdi/license",
|
|
12
16
|
"mdi/map-marker",
|
|
@@ -44,6 +48,7 @@
|
|
|
44
48
|
"mgg/ai-status-processing",
|
|
45
49
|
"mgg/ai-status-suspended",
|
|
46
50
|
"mgg/alerts-pagopa",
|
|
51
|
+
"mgg/anagrafe-nazionale",
|
|
47
52
|
"mgg/anpr",
|
|
48
53
|
"mgg/ansc",
|
|
49
54
|
"mgg/area-edificabile",
|
|
@@ -68,6 +73,7 @@
|
|
|
68
73
|
"mgg/cancelled-sheet",
|
|
69
74
|
"mgg/car-license",
|
|
70
75
|
"mgg/card-stamping",
|
|
76
|
+
"mgg/cash-register-settings",
|
|
71
77
|
"mgg/check-small",
|
|
72
78
|
"mgg/checklist",
|
|
73
79
|
"mgg/checklist-settings",
|
|
@@ -164,7 +170,9 @@
|
|
|
164
170
|
"mgg/home-hammer",
|
|
165
171
|
"mgg/home-link",
|
|
166
172
|
"mgg/home-number",
|
|
173
|
+
"mgg/inad",
|
|
167
174
|
"mgg/inagibile",
|
|
175
|
+
"mgg/inps",
|
|
168
176
|
"mgg/input-calendar-costs",
|
|
169
177
|
"mgg/input-calendar-period",
|
|
170
178
|
"mgg/input-calendar-time",
|
|
@@ -237,7 +245,9 @@
|
|
|
237
245
|
"mgg/places-park",
|
|
238
246
|
"mgg/places-park-alt",
|
|
239
247
|
"mgg/places-store-access-denied",
|
|
248
|
+
"mgg/pos",
|
|
240
249
|
"mgg/property-owner",
|
|
250
|
+
"mgg/registro-imprese",
|
|
241
251
|
"mgg/relevance",
|
|
242
252
|
"mgg/reporting-abuse",
|
|
243
253
|
"mgg/residency-permit",
|
|
@@ -332,21 +342,27 @@
|
|
|
332
342
|
"mi/baseline/check-box",
|
|
333
343
|
"mi/baseline/check-box-outline-blank",
|
|
334
344
|
"mi/baseline/check-circle",
|
|
345
|
+
"mi/baseline/chevron-right",
|
|
335
346
|
"mi/baseline/close",
|
|
336
347
|
"mi/baseline/contrast",
|
|
337
348
|
"mi/baseline/css",
|
|
338
349
|
"mi/baseline/dark-mode",
|
|
339
350
|
"mi/baseline/delete",
|
|
340
351
|
"mi/baseline/description",
|
|
352
|
+
"mi/baseline/desk",
|
|
341
353
|
"mi/baseline/directions-run",
|
|
342
354
|
"mi/baseline/directions-walk",
|
|
343
355
|
"mi/baseline/done",
|
|
344
356
|
"mi/baseline/downhill-skiing",
|
|
357
|
+
"mi/baseline/draw",
|
|
345
358
|
"mi/baseline/eco",
|
|
346
359
|
"mi/baseline/email",
|
|
347
360
|
"mi/baseline/error",
|
|
348
361
|
"mi/baseline/explore",
|
|
362
|
+
"mi/baseline/favorite",
|
|
363
|
+
"mi/baseline/favorite-border",
|
|
349
364
|
"mi/baseline/file-download-done",
|
|
365
|
+
"mi/baseline/folder",
|
|
350
366
|
"mi/baseline/folder-zip",
|
|
351
367
|
"mi/baseline/horizontal-rule",
|
|
352
368
|
"mi/baseline/indeterminate-check-box",
|
|
@@ -356,9 +372,12 @@
|
|
|
356
372
|
"mi/baseline/keyboard-arrow-up",
|
|
357
373
|
"mi/baseline/light-mode",
|
|
358
374
|
"mi/baseline/local-activity",
|
|
375
|
+
"mi/baseline/location-city",
|
|
359
376
|
"mi/baseline/lock-open",
|
|
360
377
|
"mi/baseline/login",
|
|
361
378
|
"mi/baseline/logout",
|
|
379
|
+
"mi/baseline/meeting-room",
|
|
380
|
+
"mi/baseline/more-vert",
|
|
362
381
|
"mi/baseline/navigate-next",
|
|
363
382
|
"mi/baseline/panorama",
|
|
364
383
|
"mi/baseline/person",
|
|
@@ -376,6 +395,7 @@
|
|
|
376
395
|
"mi/baseline/terminal",
|
|
377
396
|
"mi/baseline/timer",
|
|
378
397
|
"mi/baseline/tv",
|
|
398
|
+
"mi/baseline/unfold-less",
|
|
379
399
|
"mi/baseline/unfold-more",
|
|
380
400
|
"mi/baseline/videocam",
|
|
381
401
|
"mi/baseline/visibility",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"mgg/ai-status-processing",
|
|
32
32
|
"mgg/ai-status-suspended",
|
|
33
33
|
"mgg/alerts-pagopa",
|
|
34
|
+
"mgg/anagrafe-nazionale",
|
|
34
35
|
"mgg/anpr",
|
|
35
36
|
"mgg/ansc",
|
|
36
37
|
"mgg/area-edificabile",
|
|
@@ -55,6 +56,7 @@
|
|
|
55
56
|
"mgg/cancelled-sheet",
|
|
56
57
|
"mgg/car-license",
|
|
57
58
|
"mgg/card-stamping",
|
|
59
|
+
"mgg/cash-register-settings",
|
|
58
60
|
"mgg/check-small",
|
|
59
61
|
"mgg/checklist-settings",
|
|
60
62
|
"mgg/checklist",
|
|
@@ -151,7 +153,9 @@
|
|
|
151
153
|
"mgg/home-hammer",
|
|
152
154
|
"mgg/home-link",
|
|
153
155
|
"mgg/home-number",
|
|
156
|
+
"mgg/inad",
|
|
154
157
|
"mgg/inagibile",
|
|
158
|
+
"mgg/inps",
|
|
155
159
|
"mgg/input-calendar-costs",
|
|
156
160
|
"mgg/input-calendar-period",
|
|
157
161
|
"mgg/input-calendar-time",
|
|
@@ -224,7 +228,9 @@
|
|
|
224
228
|
"mgg/places-park-alt",
|
|
225
229
|
"mgg/places-park",
|
|
226
230
|
"mgg/places-store-access-denied",
|
|
231
|
+
"mgg/pos",
|
|
227
232
|
"mgg/property-owner",
|
|
233
|
+
"mgg/registro-imprese",
|
|
228
234
|
"mgg/relevance",
|
|
229
235
|
"mgg/reporting-abuse",
|
|
230
236
|
"mgg/residency-permit",
|
package/src/type/tree.ts
ADDED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as a,b as e}from"./p-
|
|
1
|
+
import{p as a,b as e}from"./p-dd7b28fc.js";export{s as setNonce}from"./p-dd7b28fc.js";import{g as d}from"./p-e1255160.js";(()=>{const e=import.meta.url,s={};return""!==e&&(s.resourcesUrl=new URL(".",e).href),a(s)})().then((async a=>(await d(),e([["p-8951c4d3",[[65,"mds-input-range",{max:[2],min:[2],step:[2],disabled:[1540],value:[1538],progress:[32]},null,{disabled:["disabledChanged"],value:["valueChanged"],min:["minChanged"],max:["maxChanged"],step:["stepChanged"]}]]]],a))));
|
|
@@ -115,7 +115,7 @@ DOMTokenList
|
|
|
115
115
|
var resourcesUrl = scriptElm ? scriptElm.getAttribute('data-resources-url') || scriptElm.src : '';
|
|
116
116
|
var start = function() {
|
|
117
117
|
// if src is not present then origin is "null", and new URL() throws TypeError: Failed to construct 'URL': Invalid base URL
|
|
118
|
-
var url = new URL('./p-
|
|
118
|
+
var url = new URL('./p-7a612415.system.js', new URL(resourcesUrl, window.location.origin !== 'null' ? window.location.origin : undefined));
|
|
119
119
|
System.import(url.href);
|
|
120
120
|
};
|
|
121
121
|
|