@maggioli-design-system/mds-input-range 2.0.0 → 2.0.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/mds-input-range.cjs.entry.js +4 -3
- package/dist/collection/common/aria.js +17 -1
- package/dist/collection/common/device.js +6 -0
- package/dist/collection/common/keyboard-manager.js +2 -2
- package/dist/collection/components/mds-input-range/mds-input-range.js +4 -3
- package/dist/collection/components/mds-input-range/test/mds-input-range.stories.js +4 -4
- package/dist/collection/dictionary/file-extensions.js +114 -56
- package/dist/collection/dictionary/text.js +60 -1
- package/dist/components/mds-input-range.js +4 -3
- package/dist/documentation.json +1 -1
- package/dist/esm/mds-input-range.entry.js +4 -3
- package/dist/esm-es5/mds-input-range.entry.js +1 -1
- package/dist/mds-input-range/mds-input-range.esm.js +1 -1
- package/dist/mds-input-range/{p-a84fc6af.system.entry.js → p-48fdc5db.system.entry.js} +1 -1
- package/dist/mds-input-range/p-76412b19.system.js +1 -1
- package/dist/mds-input-range/p-d697edb0.entry.js +1 -0
- package/dist/stats.json +19 -16
- package/dist/types/common/aria.d.ts +3 -1
- package/dist/types/common/device.d.ts +2 -0
- package/dist/types/components/mds-input-range/mds-input-range.d.ts +1 -0
- package/dist/types/components/mds-input-range/test/mds-input-range.stories.d.ts +0 -4
- package/dist/types/dictionary/text.d.ts +3 -1
- package/dist/types/type/text.d.ts +2 -0
- package/documentation.json +9 -4
- package/package.json +2 -2
- package/src/common/aria.ts +22 -2
- package/src/common/device.ts +9 -0
- package/src/common/keyboard-manager.ts +2 -2
- package/src/components/mds-input-range/mds-input-range.tsx +3 -0
- package/src/components/mds-input-range/test/mds-input-range.stories.tsx +4 -4
- package/src/dictionary/file-extensions.ts +115 -56
- package/src/dictionary/text.ts +64 -0
- package/src/fixtures/icons.json +8 -0
- package/src/fixtures/iconsauce.json +5 -0
- package/src/meta/file-format/locale.el.json +39 -0
- package/src/meta/file-format/locale.en.json +39 -0
- package/src/meta/file-format/locale.es.json +39 -0
- package/src/meta/file-format/locale.it.json +39 -0
- package/src/type/text.ts +59 -0
- package/www/build/mds-input-range.esm.js +1 -1
- package/www/build/{p-a84fc6af.system.entry.js → p-48fdc5db.system.entry.js} +1 -1
- package/www/build/p-76412b19.system.js +1 -1
- package/www/build/p-d697edb0.entry.js +1 -0
- package/dist/mds-input-range/p-b81446a9.entry.js +0 -1
- package/www/build/p-b81446a9.entry.js +0 -1
|
@@ -60,13 +60,14 @@ const MdsInputRange = class {
|
|
|
60
60
|
this.calculateProgress();
|
|
61
61
|
}
|
|
62
62
|
componentDidLoad() {
|
|
63
|
-
var _a;
|
|
64
|
-
this.
|
|
63
|
+
var _a, _b;
|
|
64
|
+
this.label = (_a = this.element.textContent) !== null && _a !== void 0 ? _a : '';
|
|
65
|
+
this.inputElement = (_b = this.element.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('.field');
|
|
65
66
|
this.value = parseInt(this.inputElement.value);
|
|
66
67
|
this.calculateProgress();
|
|
67
68
|
}
|
|
68
69
|
render() {
|
|
69
|
-
return (index.h(index.Host, { key: '
|
|
70
|
+
return (index.h(index.Host, { key: '4f58f56b2bf1af905741bbcab323e583dd907a35' }, index.h("header", { key: '69a2e6c483558f0ce70eca8e1ec45f4ce7f63b10', class: "header", part: "header" }, index.h("mds-text", { key: '1d5f89b89f5bdf1ca6746567eb23d2b96444c2d9', class: "label", typography: "label" }, index.h("slot", { key: '534eb663ff412980069c4308a2a15a784e2bf1cf' })), index.h("mds-text", { key: 'e187c33fb9124f1d20032c822b535d0ddc839fe3', class: "value", typography: "label" }, this.value)), index.h("div", { key: 'fb3245af7eefbab656b68810577d77a328e312c5', class: "range" }, index.h("div", { key: 'f146b8b59fbd5bbb3db2350d94686fad986b4dfc', class: "track" }, index.h("div", { key: '04aaec03384f51e3ad2ad8cc695274c36062d6bf', class: "contrast-area" }), index.h("div", { key: '2de981fb668e8056a24ca82163dca106fcc5878e', class: "track-total" }, index.h("div", { key: '2044a5ce25454e56d950c2c7f68ce11369babd87', class: "track-progress", style: { width: `${this.progress}%` } }))), index.h("input", { key: '423eb3d5b176748d0376374888c7ef3298dc54d9', class: "field", "aria-label": this.label, max: this.max, min: this.min, onInput: this.onInput, step: this.step, type: "range", value: this.value }))));
|
|
70
71
|
}
|
|
71
72
|
static get formAssociated() { return true; }
|
|
72
73
|
get element() { return index.getElement(this); }
|
|
@@ -18,6 +18,22 @@ const setAttributeIfEmpty = (element, attribute, value) => {
|
|
|
18
18
|
element.setAttribute(attribute, value);
|
|
19
19
|
return value;
|
|
20
20
|
};
|
|
21
|
+
const removeAttributesIf = (element, attribute, valueCheck = 'true', cleanAttributes) => {
|
|
22
|
+
if (ifAttribute(element, attribute, valueCheck)) {
|
|
23
|
+
const attributesList = Array.isArray(cleanAttributes) ? cleanAttributes : [cleanAttributes];
|
|
24
|
+
attributesList.forEach(attributeToRemove => {
|
|
25
|
+
element.removeAttribute(attributeToRemove);
|
|
26
|
+
});
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
};
|
|
31
|
+
const ifAttribute = (element, attribute, valueCheck = 'true') => {
|
|
32
|
+
if (element.hasAttribute(attribute) && element.getAttribute(attribute) === valueCheck) {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
return false;
|
|
36
|
+
};
|
|
21
37
|
const hashValue = (value) => `${value}-${hash(value)}`;
|
|
22
38
|
const hashRandomValue = (value) => {
|
|
23
39
|
const randomValue = randomInt(1000000);
|
|
@@ -26,4 +42,4 @@ const hashRandomValue = (value) => {
|
|
|
26
42
|
}
|
|
27
43
|
return hash(randomValue.toString());
|
|
28
44
|
};
|
|
29
|
-
export {
|
|
45
|
+
export { hashRandomValue, hashValue, removeAttributesIf, setAttributeIfEmpty, ifAttribute, unslugName, };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const isMobileDevice = () => {
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3
|
+
const userAgent = navigator.userAgent || navigator.vendor || window.opera;
|
|
4
|
+
return /android|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(userAgent);
|
|
5
|
+
};
|
|
6
|
+
export { isMobileDevice, };
|
|
@@ -31,13 +31,13 @@ export class KeyboardManager {
|
|
|
31
31
|
};
|
|
32
32
|
this.attachEscapeBehavior = (callback) => {
|
|
33
33
|
this.escapeCallback = callback;
|
|
34
|
-
if (window !== undefined) {
|
|
34
|
+
if (typeof window !== 'undefined') {
|
|
35
35
|
window.addEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
this.detachEscapeBehavior = () => {
|
|
39
39
|
this.escapeCallback = () => { return; };
|
|
40
|
-
if (window !== undefined) {
|
|
40
|
+
if (typeof window !== 'undefined') {
|
|
41
41
|
window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this));
|
|
42
42
|
}
|
|
43
43
|
};
|
|
@@ -46,13 +46,14 @@ export class MdsInputRange {
|
|
|
46
46
|
this.calculateProgress();
|
|
47
47
|
}
|
|
48
48
|
componentDidLoad() {
|
|
49
|
-
var _a;
|
|
50
|
-
this.
|
|
49
|
+
var _a, _b;
|
|
50
|
+
this.label = (_a = this.element.textContent) !== null && _a !== void 0 ? _a : '';
|
|
51
|
+
this.inputElement = (_b = this.element.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('.field');
|
|
51
52
|
this.value = parseInt(this.inputElement.value);
|
|
52
53
|
this.calculateProgress();
|
|
53
54
|
}
|
|
54
55
|
render() {
|
|
55
|
-
return (h(Host, { key: '
|
|
56
|
+
return (h(Host, { key: '4f58f56b2bf1af905741bbcab323e583dd907a35' }, h("header", { key: '69a2e6c483558f0ce70eca8e1ec45f4ce7f63b10', class: "header", part: "header" }, h("mds-text", { key: '1d5f89b89f5bdf1ca6746567eb23d2b96444c2d9', class: "label", typography: "label" }, h("slot", { key: '534eb663ff412980069c4308a2a15a784e2bf1cf' })), h("mds-text", { key: 'e187c33fb9124f1d20032c822b535d0ddc839fe3', class: "value", typography: "label" }, this.value)), h("div", { key: 'fb3245af7eefbab656b68810577d77a328e312c5', class: "range" }, h("div", { key: 'f146b8b59fbd5bbb3db2350d94686fad986b4dfc', class: "track" }, h("div", { key: '04aaec03384f51e3ad2ad8cc695274c36062d6bf', class: "contrast-area" }), h("div", { key: '2de981fb668e8056a24ca82163dca106fcc5878e', class: "track-total" }, h("div", { key: '2044a5ce25454e56d950c2c7f68ce11369babd87', class: "track-progress", style: { width: `${this.progress}%` } }))), h("input", { key: '423eb3d5b176748d0376374888c7ef3298dc54d9', class: "field", "aria-label": this.label, max: this.max, min: this.min, onInput: this.onInput, step: this.step, type: "range", value: this.value }))));
|
|
56
57
|
}
|
|
57
58
|
static get is() { return "mds-input-range"; }
|
|
58
59
|
static get encapsulation() { return "shadow"; }
|
|
@@ -3,19 +3,19 @@ export default {
|
|
|
3
3
|
title: 'Form / Range',
|
|
4
4
|
argTypes: {
|
|
5
5
|
min: {
|
|
6
|
-
type: { name: 'number'
|
|
6
|
+
type: { name: 'number' },
|
|
7
7
|
description: 'The lowest value in the range of permitted values',
|
|
8
8
|
},
|
|
9
9
|
max: {
|
|
10
|
-
type: { name: 'number'
|
|
10
|
+
type: { name: 'number' },
|
|
11
11
|
description: 'The greatest value in the range of permitted values',
|
|
12
12
|
},
|
|
13
13
|
step: {
|
|
14
|
-
type: { name: 'number'
|
|
14
|
+
type: { name: 'number' },
|
|
15
15
|
description: 'The step attribute is a number that specifies the granularity that the value must adhere to, or the special value any, which is described below',
|
|
16
16
|
},
|
|
17
17
|
value: {
|
|
18
|
-
type: { name: 'number'
|
|
18
|
+
type: { name: 'number' },
|
|
19
19
|
description: 'The value attribute contains a number which contains a representation of the selected number',
|
|
20
20
|
},
|
|
21
21
|
},
|
|
@@ -1,61 +1,119 @@
|
|
|
1
1
|
const fileExtensionsDictionary = {
|
|
2
|
-
'7z': { format: 'archive', description: '
|
|
3
|
-
ace: { format: 'archive', description: '
|
|
4
|
-
ai: { format: 'vector', description: '
|
|
5
|
-
dart: { format: 'code', description: '
|
|
6
|
-
db: { format: 'data', description: '
|
|
7
|
-
default: { format: 'attachment', description: '
|
|
8
|
-
dmg: { format: 'executable', description: '
|
|
9
|
-
doc: { format: 'text', description: '
|
|
10
|
-
docm: { format: 'text', description: '
|
|
11
|
-
docx: { format: 'text', description: '
|
|
12
|
-
eml: { format: 'email', description: '
|
|
13
|
-
eps: { format: 'vector', description: '
|
|
14
|
-
exe: { format: 'executable', description: '
|
|
15
|
-
flac: { format: 'audio', description: '
|
|
16
|
-
gif: { format: 'image', description: '
|
|
17
|
-
htm: { format: 'markup', description: '
|
|
18
|
-
heic: { format: 'image', description: '
|
|
19
|
-
html: { format: 'markup', description: '
|
|
20
|
-
jpe: { format: 'image', description: '
|
|
21
|
-
jpeg: { format: 'image', description: '
|
|
22
|
-
jpg: { format: 'image', description: '
|
|
23
|
-
js: { format: 'code', description: '
|
|
24
|
-
json: { format: 'data', description: '
|
|
25
|
-
jsx: { format: 'code', description: '
|
|
26
|
-
m2v: { format: 'video', description: '
|
|
27
|
-
mp2: { format: 'audio', description: '
|
|
28
|
-
mp3: { format: 'audio', description: '
|
|
29
|
-
mp4: { format: 'video', description: '
|
|
30
|
-
mp4v: { format: 'video', description: '
|
|
31
|
-
mpeg: { format: 'video', description: '
|
|
32
|
-
mpg4: { format: 'video', description: '
|
|
33
|
-
mpg: { format: 'video', description: '
|
|
34
|
-
mpga: { format: 'audio', description: '
|
|
35
|
-
odp: { format: 'slide', description: '
|
|
36
|
-
ods: { format: 'spreadsheet', description: '
|
|
37
|
-
odt: { format: 'text', description: '
|
|
38
|
-
pdf: { format: 'document', description: '
|
|
39
|
-
php: { format: 'code', description: '
|
|
40
|
-
png: { format: 'image', description: '
|
|
41
|
-
ppt: { format: 'slide', description: '
|
|
42
|
-
rar: { format: 'archive', description: '
|
|
43
|
-
rtf: { format: 'text', description: '
|
|
44
|
-
sass: { format: 'code', description: '
|
|
45
|
-
shtml: { format: 'markup', description: '
|
|
46
|
-
svg: { format: 'vector', description: '
|
|
47
|
-
tar: { format: 'archive', description: '
|
|
48
|
-
tiff: { format: 'image', description: '
|
|
49
|
-
ts: { format: 'code', description: '
|
|
50
|
-
tsx: { format: 'code', description: '
|
|
51
|
-
txt: { format: 'text', description: '
|
|
52
|
-
wav: { format: 'audio', description: '
|
|
53
|
-
webp: { format: 'image', description: '
|
|
54
|
-
xar: { format: 'archive', description: '
|
|
55
|
-
xls: { format: 'spreadsheet', description: '
|
|
56
|
-
xlsx: { format: 'spreadsheet', description: '
|
|
57
|
-
zip: { format: 'archive', description: '
|
|
2
|
+
'7z': { format: 'archive', description: 'compressedArchive' },
|
|
3
|
+
ace: { format: 'archive', description: 'compressedArchive' },
|
|
4
|
+
ai: { format: 'vector', description: 'fileAI' },
|
|
5
|
+
dart: { format: 'code', description: 'dart' },
|
|
6
|
+
db: { format: 'data', description: 'fileDB' },
|
|
7
|
+
default: { format: 'attachment', description: 'unknown' },
|
|
8
|
+
dmg: { format: 'executable', description: 'appleDiskImage' },
|
|
9
|
+
doc: { format: 'text', description: 'documentMS' },
|
|
10
|
+
docm: { format: 'text', description: 'documentMS' },
|
|
11
|
+
docx: { format: 'text', description: 'compressedDocumentMS' },
|
|
12
|
+
eml: { format: 'email', description: 'email' },
|
|
13
|
+
eps: { format: 'vector', description: 'fileEPS' },
|
|
14
|
+
exe: { format: 'executable', description: 'fileEXE' },
|
|
15
|
+
flac: { format: 'audio', description: 'uncompressedAudio' },
|
|
16
|
+
gif: { format: 'image', description: 'compressedImage', preview: true },
|
|
17
|
+
htm: { format: 'markup', description: 'documentWeb' },
|
|
18
|
+
heic: { format: 'image', description: 'imageHEFF' },
|
|
19
|
+
html: { format: 'markup', description: 'documentWeb' },
|
|
20
|
+
jpe: { format: 'image', description: 'compressedImage', preview: true },
|
|
21
|
+
jpeg: { format: 'image', description: 'compressedImage', preview: true },
|
|
22
|
+
jpg: { format: 'image', description: 'compressedImage', preview: true },
|
|
23
|
+
js: { format: 'code', description: 'fileJS' },
|
|
24
|
+
json: { format: 'data', description: 'fileJSON' },
|
|
25
|
+
jsx: { format: 'code', description: 'fileJS' },
|
|
26
|
+
m2v: { format: 'video', description: 'videoSD' },
|
|
27
|
+
mp2: { format: 'audio', description: 'compressedAudio' },
|
|
28
|
+
mp3: { format: 'audio', description: 'compressedAudio' },
|
|
29
|
+
mp4: { format: 'video', description: 'videoHD' },
|
|
30
|
+
mp4v: { format: 'video', description: 'videoHD' },
|
|
31
|
+
mpeg: { format: 'video', description: 'videoSD' },
|
|
32
|
+
mpg4: { format: 'video', description: 'videoSD' },
|
|
33
|
+
mpg: { format: 'video', description: 'videoSD' },
|
|
34
|
+
mpga: { format: 'audio', description: 'compressedAudio' },
|
|
35
|
+
odp: { format: 'slide', description: 'slideLO' },
|
|
36
|
+
ods: { format: 'spreadsheet', description: 'spreadsheetLO' },
|
|
37
|
+
odt: { format: 'text', description: 'documentLO' },
|
|
38
|
+
pdf: { format: 'document', description: 'documentAdobe' },
|
|
39
|
+
php: { format: 'code', description: 'filePHP' },
|
|
40
|
+
png: { format: 'image', description: 'imagePNG', preview: true },
|
|
41
|
+
ppt: { format: 'slide', description: 'slidePowerPoint' },
|
|
42
|
+
rar: { format: 'archive', description: 'compressedArchive' },
|
|
43
|
+
rtf: { format: 'text', description: 'documentRTF' },
|
|
44
|
+
sass: { format: 'code', description: 'fileSASS' },
|
|
45
|
+
shtml: { format: 'markup', description: 'documentWeb' },
|
|
46
|
+
svg: { format: 'vector', description: 'imageSVG', preview: true },
|
|
47
|
+
tar: { format: 'archive', description: 'uncompressedArchive' },
|
|
48
|
+
tiff: { format: 'image', description: 'imageTIFF' },
|
|
49
|
+
ts: { format: 'code', description: 'fileTS' },
|
|
50
|
+
tsx: { format: 'code', description: 'fileTSX' },
|
|
51
|
+
txt: { format: 'text', description: 'documentTXT' },
|
|
52
|
+
wav: { format: 'audio', description: 'uncompressedAudio' },
|
|
53
|
+
webp: { format: 'image', description: 'imageWEBP', preview: true },
|
|
54
|
+
xar: { format: 'archive', description: 'compressedArchive' },
|
|
55
|
+
xls: { format: 'spreadsheet', description: 'spreadsheetMS' },
|
|
56
|
+
xlsx: { format: 'spreadsheet', description: 'spreadsheetMS' },
|
|
57
|
+
zip: { format: 'archive', description: 'compressedArchive' },
|
|
58
58
|
};
|
|
59
|
+
// const fileExtensionsDictionary: FileExtenstion = {
|
|
60
|
+
// '7z': { format: 'archive', description: 'Archivio compresso' },
|
|
61
|
+
// ace: { format: 'archive', description: 'Archivio compresso' },
|
|
62
|
+
// ai: { format: 'vector', description: 'Vettoriale Adobe Illustrator' },
|
|
63
|
+
// dart: { format: 'code', description: 'Dart' },
|
|
64
|
+
// db: { format: 'data', description: 'File di database' },
|
|
65
|
+
// default: { format: 'attachment', description: 'Formato sconosciuto' },
|
|
66
|
+
// dmg: { format: 'executable', description: 'Apple Disk Image' },
|
|
67
|
+
// doc: { format: 'text', description: 'Documento Microsoft Word' },
|
|
68
|
+
// docm: { format: 'text', description: 'Documento Microsoft Word' },
|
|
69
|
+
// docx: { format: 'text', description: 'Documento Microsoft Word Compresso' },
|
|
70
|
+
// eml: { format: 'email', description: 'E-mail di posta elettronica' },
|
|
71
|
+
// eps: { format: 'vector', description: 'Vettoriale Corel Draw' },
|
|
72
|
+
// exe: { format: 'executable', description: 'File eseguibile Windows' },
|
|
73
|
+
// flac: { format: 'audio', description: 'Audio non compresso' },
|
|
74
|
+
// gif: { format: 'image', description: 'Immagine compressa', preview: true },
|
|
75
|
+
// htm: { format: 'markup', description: 'Pagina web' },
|
|
76
|
+
// heic: { format: 'image', description: 'High Efficiency Image File Format' },
|
|
77
|
+
// html: { format: 'markup', description: 'Pagina web' },
|
|
78
|
+
// jpe: { format: 'image', description: 'Immagine compressa', preview: true },
|
|
79
|
+
// jpeg: { format: 'image', description: 'Immagine compressa', preview: true },
|
|
80
|
+
// jpg: { format: 'image', description: 'Immagine compressa', preview: true },
|
|
81
|
+
// js: { format: 'code', description: 'JavaScript' },
|
|
82
|
+
// json: { format: 'data', description: 'JavaScript Object Notation' },
|
|
83
|
+
// jsx: { format: 'code', description: 'JavaScript' },
|
|
84
|
+
// m2v: { format: 'video', description: 'Filmato SD' },
|
|
85
|
+
// mp2: { format: 'audio', description: 'Audio compresso' },
|
|
86
|
+
// mp3: { format: 'audio', description: 'Audio compresso' },
|
|
87
|
+
// mp4: { format: 'video', description: 'Filmato HD' },
|
|
88
|
+
// mp4v: { format: 'video', description: 'Filmato HD' },
|
|
89
|
+
// mpeg: { format: 'video', description: 'Filmato SD' },
|
|
90
|
+
// mpg4: { format: 'video', description: 'Filmato SD' },
|
|
91
|
+
// mpg: { format: 'video', description: 'Filmato SD' },
|
|
92
|
+
// mpga: { format: 'audio', description: 'Audio compresso' },
|
|
93
|
+
// odp: { format: 'slide', description: 'Slide di presentazione LibreOffice' },
|
|
94
|
+
// ods: { format: 'spreadsheet', description: 'Foglio di calcolo LibreOffice' },
|
|
95
|
+
// odt: { format: 'text', description: 'File di testo LibreOffice' },
|
|
96
|
+
// pdf: { format: 'document', description: 'Documento Adobe' },
|
|
97
|
+
// php: { format: 'code', description: 'Hypertext Preprocessor' },
|
|
98
|
+
// png: { format: 'image', description: 'Immagine Portable Network Graphics', preview: true },
|
|
99
|
+
// ppt: { format: 'slide', description: 'Slide di presentazione PowerPoint' },
|
|
100
|
+
// rar: { format: 'archive', description: 'Archivio compresso' },
|
|
101
|
+
// rtf: { format: 'text', description: 'Documento di testo Rich Text Format' },
|
|
102
|
+
// sass: { format: 'code', description: 'Syntactically Awesome StyleSheets' },
|
|
103
|
+
// shtml: { format: 'markup', description: 'Pagina web' },
|
|
104
|
+
// svg: { format: 'vector', description: 'Scalable Vector Graphics', preview: true },
|
|
105
|
+
// tar: { format: 'archive', description: 'Archivio non compresso' },
|
|
106
|
+
// tiff: { format: 'image', description: 'Tag Image File Format' },
|
|
107
|
+
// ts: { format: 'code', description: 'TypeScript' },
|
|
108
|
+
// tsx: { format: 'code', description: 'TypeScript Extended Syntax' },
|
|
109
|
+
// txt: { format: 'text', description: 'Documento di testo non formattato' },
|
|
110
|
+
// wav: { format: 'audio', description: 'Audio non compresso' },
|
|
111
|
+
// webp: { format: 'image', description: 'Immagine Web Picture', preview: true },
|
|
112
|
+
// xar: { format: 'archive', description: 'Archivio compresso' },
|
|
113
|
+
// xls: { format: 'spreadsheet', description: 'Foglio di calcolo Office' },
|
|
114
|
+
// xlsx: { format: 'spreadsheet', description: 'Foglio di calcolo Office' },
|
|
115
|
+
// zip: { format: 'archive', description: 'Archivio compresso' },
|
|
116
|
+
// }
|
|
59
117
|
const genericMimeToExt = new Map([
|
|
60
118
|
['image', ['.png', '.jpg', '.jpeg', '.tiff', '.webp', '.jpe', '.gif', '.heic']],
|
|
61
119
|
['audio', ['.mp2', '.mp3', '.mpga', '.wav', '.flac']],
|
|
@@ -1,6 +1,65 @@
|
|
|
1
|
+
const typographyTagDictionary = [
|
|
2
|
+
'abbr',
|
|
3
|
+
'address',
|
|
4
|
+
'article',
|
|
5
|
+
'b',
|
|
6
|
+
'bdo',
|
|
7
|
+
'blockquote',
|
|
8
|
+
'cite',
|
|
9
|
+
'code',
|
|
10
|
+
'dd',
|
|
11
|
+
'del',
|
|
12
|
+
'details',
|
|
13
|
+
'dfn',
|
|
14
|
+
'div',
|
|
15
|
+
'dl',
|
|
16
|
+
'dt',
|
|
17
|
+
'em',
|
|
18
|
+
'figcaption',
|
|
19
|
+
'h1',
|
|
20
|
+
'h2',
|
|
21
|
+
'h3',
|
|
22
|
+
'h4',
|
|
23
|
+
'h5',
|
|
24
|
+
'h6',
|
|
25
|
+
'i',
|
|
26
|
+
'ins',
|
|
27
|
+
'kbd',
|
|
28
|
+
'label',
|
|
29
|
+
'legend',
|
|
30
|
+
'li',
|
|
31
|
+
'mark',
|
|
32
|
+
'ol',
|
|
33
|
+
'p',
|
|
34
|
+
'pre',
|
|
35
|
+
'q',
|
|
36
|
+
'rb',
|
|
37
|
+
'rt',
|
|
38
|
+
'ruby',
|
|
39
|
+
's',
|
|
40
|
+
'samp',
|
|
41
|
+
'small',
|
|
42
|
+
'span',
|
|
43
|
+
'strong',
|
|
44
|
+
'sub',
|
|
45
|
+
'summary',
|
|
46
|
+
'sup',
|
|
47
|
+
'time',
|
|
48
|
+
'u',
|
|
49
|
+
'ul',
|
|
50
|
+
'var',
|
|
51
|
+
];
|
|
52
|
+
const typographyHeadingTagDictionary = [
|
|
53
|
+
'h1',
|
|
54
|
+
'h2',
|
|
55
|
+
'h3',
|
|
56
|
+
'h4',
|
|
57
|
+
'h5',
|
|
58
|
+
'h6',
|
|
59
|
+
];
|
|
1
60
|
const truncateDictionary = [
|
|
2
61
|
'all',
|
|
3
62
|
'none',
|
|
4
63
|
'word',
|
|
5
64
|
];
|
|
6
|
-
export { truncateDictionary, };
|
|
65
|
+
export { truncateDictionary, typographyHeadingTagDictionary, typographyTagDictionary, };
|
|
@@ -52,13 +52,14 @@ const MdsInputRange$1 = /*@__PURE__*/ proxyCustomElement(class MdsInputRange ext
|
|
|
52
52
|
this.calculateProgress();
|
|
53
53
|
}
|
|
54
54
|
componentDidLoad() {
|
|
55
|
-
var _a;
|
|
56
|
-
this.
|
|
55
|
+
var _a, _b;
|
|
56
|
+
this.label = (_a = this.element.textContent) !== null && _a !== void 0 ? _a : '';
|
|
57
|
+
this.inputElement = (_b = this.element.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('.field');
|
|
57
58
|
this.value = parseInt(this.inputElement.value);
|
|
58
59
|
this.calculateProgress();
|
|
59
60
|
}
|
|
60
61
|
render() {
|
|
61
|
-
return (h(Host, { key: '
|
|
62
|
+
return (h(Host, { key: '4f58f56b2bf1af905741bbcab323e583dd907a35' }, h("header", { key: '69a2e6c483558f0ce70eca8e1ec45f4ce7f63b10', class: "header", part: "header" }, h("mds-text", { key: '1d5f89b89f5bdf1ca6746567eb23d2b96444c2d9', class: "label", typography: "label" }, h("slot", { key: '534eb663ff412980069c4308a2a15a784e2bf1cf' })), h("mds-text", { key: 'e187c33fb9124f1d20032c822b535d0ddc839fe3', class: "value", typography: "label" }, this.value)), h("div", { key: 'fb3245af7eefbab656b68810577d77a328e312c5', class: "range" }, h("div", { key: 'f146b8b59fbd5bbb3db2350d94686fad986b4dfc', class: "track" }, h("div", { key: '04aaec03384f51e3ad2ad8cc695274c36062d6bf', class: "contrast-area" }), h("div", { key: '2de981fb668e8056a24ca82163dca106fcc5878e', class: "track-total" }, h("div", { key: '2044a5ce25454e56d950c2c7f68ce11369babd87', class: "track-progress", style: { width: `${this.progress}%` } }))), h("input", { key: '423eb3d5b176748d0376374888c7ef3298dc54d9', class: "field", "aria-label": this.label, max: this.max, min: this.min, onInput: this.onInput, step: this.step, type: "range", value: this.value }))));
|
|
62
63
|
}
|
|
63
64
|
static get formAssociated() { return true; }
|
|
64
65
|
get element() { return this; }
|
package/dist/documentation.json
CHANGED
|
@@ -56,13 +56,14 @@ const MdsInputRange = class {
|
|
|
56
56
|
this.calculateProgress();
|
|
57
57
|
}
|
|
58
58
|
componentDidLoad() {
|
|
59
|
-
var _a;
|
|
60
|
-
this.
|
|
59
|
+
var _a, _b;
|
|
60
|
+
this.label = (_a = this.element.textContent) !== null && _a !== void 0 ? _a : '';
|
|
61
|
+
this.inputElement = (_b = this.element.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('.field');
|
|
61
62
|
this.value = parseInt(this.inputElement.value);
|
|
62
63
|
this.calculateProgress();
|
|
63
64
|
}
|
|
64
65
|
render() {
|
|
65
|
-
return (h(Host, { key: '
|
|
66
|
+
return (h(Host, { key: '4f58f56b2bf1af905741bbcab323e583dd907a35' }, h("header", { key: '69a2e6c483558f0ce70eca8e1ec45f4ce7f63b10', class: "header", part: "header" }, h("mds-text", { key: '1d5f89b89f5bdf1ca6746567eb23d2b96444c2d9', class: "label", typography: "label" }, h("slot", { key: '534eb663ff412980069c4308a2a15a784e2bf1cf' })), h("mds-text", { key: 'e187c33fb9124f1d20032c822b535d0ddc839fe3', class: "value", typography: "label" }, this.value)), h("div", { key: 'fb3245af7eefbab656b68810577d77a328e312c5', class: "range" }, h("div", { key: 'f146b8b59fbd5bbb3db2350d94686fad986b4dfc', class: "track" }, h("div", { key: '04aaec03384f51e3ad2ad8cc695274c36062d6bf', class: "contrast-area" }), h("div", { key: '2de981fb668e8056a24ca82163dca106fcc5878e', class: "track-total" }, h("div", { key: '2044a5ce25454e56d950c2c7f68ce11369babd87', class: "track-progress", style: { width: `${this.progress}%` } }))), h("input", { key: '423eb3d5b176748d0376374888c7ef3298dc54d9', class: "field", "aria-label": this.label, max: this.max, min: this.min, onInput: this.onInput, step: this.step, type: "range", value: this.value }))));
|
|
66
67
|
}
|
|
67
68
|
static get formAssociated() { return true; }
|
|
68
69
|
get element() { return getElement(this); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-e0ac0a55.js";var mdsInputRangeCss="@-webkit-keyframes focus-bounce {\n 0%, 75%, 100% {\n outline-offset: var(--magma-outline-focus-offset, 6px);\n }\n\n 50% {\n outline-offset: var(--magma-outline-blur-offset, 2px);\n }\n}\n\n@keyframes focus-bounce {\n 0%, 75%, 100% {\n outline-offset: var(--magma-outline-focus-offset, 6px);\n }\n\n 50% {\n outline-offset: var(--magma-outline-blur-offset, 2px);\n }\n}\n\n@tailwind components;\n@tailwind utilities;\n\n/**\n * @prop --mds-input-range-thumb-size: Sets the thumb width and height of the component\n * @prop --mds-input-range-thumb-background:\n * @prop --mds-input-range-track-background:\n * @prop --mds-input-range-track-size:\n * @prop --mds-input-range-track-progress-background:\n */\n\n:host {\n\n --mds-input-range-thumb-size: 1rem;\n --mds-input-range-thumb-background: rgb(var(--variant-primary-04));\n --mds-input-range-thumb-shadow: 0 0 0 2px rgb(var(--tone-neutral));\n --mds-input-range-track-background: rgb(var(--tone-neutral-09));\n --mds-input-range-track-size: 0.5rem;\n --mds-input-range-track-progress-background: rgb(var(--variant-primary-03));\n gap: 0.25rem;\n -webkit-transition-duration: 200ms;\n transition-duration: 200ms;\n\n display: grid;\n -webkit-transition-property: color;\n transition-property: color;\n}\n\n.header {\n gap: 0.5rem;\n\n display: -ms-flexbox;\n\n display: flex;\n}\n\n.label {\n min-width: 0rem;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.value {\n margin-left: auto;\n}\n\n.range {\n -ms-flex-align: center;\n align-items: center;\n display: -ms-flexbox;\n display: flex;\n height: var(--mds-input-range-thumb-size);\n position: relative;\n}\n\n.track {\n width: 100%;\n\n --margin: calc(var(--mds-input-range-track-size) / 2);\n\n -webkit-box-sizing: border-box;\n\n box-sizing: border-box;\n padding: 0 var(--margin);\n position: absolute;\n}\n\n.field {\n -webkit-animation-duration: var(--magma-outline-animation-duration, 1s);\n animation-duration: var(--magma-outline-animation-duration, 1s);\n -webkit-animation-fill-mode: forwards;\n animation-fill-mode: forwards;\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite;\n -webkit-animation-name: focus-bounce;\n animation-name: focus-bounce;\n -webkit-animation-play-state: paused;\n animation-play-state: paused;\n -webkit-animation-timing-function: cubic-bezier(0, 0, 0.2, 1);\n animation-timing-function: cubic-bezier(0, 0, 0.2, 1);\n outline: var(--magma-outline-blur);\n -webkit-transition-duration: 200ms;\n transition-duration: 200ms;\n -webkit-transition-property: background-color, border-color, color, fill, outline, outline-offset, -webkit-box-shadow, -webkit-transform;\n transition-property: background-color, border-color, color, fill, outline, outline-offset, -webkit-box-shadow, -webkit-transform;\n transition-property: background-color, border-color, box-shadow, color, fill, outline, outline-offset, transform;\n transition-property: background-color, border-color, box-shadow, color, fill, outline, outline-offset, transform, -webkit-box-shadow, -webkit-transform;\n -webkit-transition-timing-function: ease-in-out;\n transition-timing-function: ease-in-out;\n }\n\n.field:focus-visible {\n\n --magma-outline-blur: var(--magma-outline-focus);\n\n -webkit-animation-play-state: running;\n\n animation-play-state: running;\n }\n\n.field {\n z-index: 20;\n height: 1rem;\n\n -webkit-appearance: none;\n\n -moz-appearance: none;\n\n appearance: none;\n background-color: transparent;\n border-radius: 1000px;\n -ms-flex-positive: 1;\n flex-grow: 1;\n margin: 0;\n}\n\n.field:focus-visible {\n\n --magma-outline-blur: var(--magma-outline-focus);\n\n -webkit-animation-play-state: running;\n\n animation-play-state: running;\n }\n\n.field::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n background-color: var(--mds-input-range-thumb-background);\n border: 0;\n border-radius: var(--mds-input-range-thumb-size);\n -webkit-box-shadow: var(--mds-input-range-thumb-shadow);\n box-shadow: var(--mds-input-range-thumb-shadow);\n cursor: -webkit-grab;\n cursor: grab;\n height: var(--mds-input-range-thumb-size);\n line-height: 0;\n -webkit-transform: translate(0, -50%);\n transform: translate(0, -50%);\n width: var(--mds-input-range-thumb-size);\n}\n\n.field::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n border: 0;\n height: 0;\n width: 100%;\n}\n\n.track-progress {\n -webkit-transition-duration: 300ms;\n transition-duration: 300ms;\n -webkit-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n\n background-color: var(--mds-input-range-track-progress-background);\n display: -ms-flexbox;\n display: flex;\n height: var(--mds-input-range-track-size);\n -webkit-transition-property: background-color;\n transition-property: background-color;\n}\n\n.track-total {\n -webkit-transition-duration: 300ms;\n transition-duration: 300ms;\n -webkit-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n\n background-color: var(--mds-input-range-track-background);\n border-radius: var(--mds-input-range-track-size);\n display: -ms-flexbox;\n display: flex;\n height: var(--mds-input-range-track-size);\n overflow: hidden;\n -webkit-transition-property: background-color;\n transition-property: background-color;\n width: 100%;\n}\n\n.contrast-area {\n margin-left: 0.25rem;\n margin-right: 0.25rem;\n\n border-radius: var(--mds-input-range-track-size);\n}\n\n@tailwind utilities;\n\n@container style(--magma-pref-animation: reduce) {\n :host,\n .field::-webkit-slider-thumb,\n .field::-webkit-slider-runnable-track,\n .track-progress,\n .track-total {\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n }\n}\n\n@container style(--magma-pref-animation: system) {\n\n @media (prefers-reduced-motion) {\n :host,\n .field::-webkit-slider-thumb,\n .field::-webkit-slider-runnable-track,\n .track-progress,\n .track-total {\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n }\n }\n}\n\n@tailwind utilities;\n\n@container style(--magma-pref-theme: dark) {\n :host {\n\n --mds-input-range-thumb-background: rgb(var(--variant-primary-04));\n --mds-input-range-track-background: rgb(var(--tone-neutral-07));\n --mds-input-range-track-progress-background: rgb(var(--variant-primary-05));\n }\n}\n\n@container style(--magma-pref-theme: system) {\n\n @media (prefers-color-scheme: dark) {\n :host {\n\n --mds-input-range-thumb-background: rgb(var(--variant-primary-04));\n --mds-input-range-track-background: rgb(var(--tone-neutral-07));\n --mds-input-range-track-progress-background: rgb(var(--variant-primary-05));\n }\n }\n}\n\n@container style(--magma-pref-contrast: more) {\n :host {\n color: rgb(var(--tone-neutral-01));\n }\n}\n\n@container style(--magma-pref-contrast: system) {\n\n @media (prefers-contrast: more) {\n :host {\n color: rgb(var(--tone-neutral-01));\n }\n }\n}\n\n\n";var MdsInputRangeStyle0=mdsInputRangeCss;var MdsInputRange=function(){function n(n){var t=this;registerInstance(this,n);this.changeEvent=createEvent(this,"mdsInputRangeChange",7);if(n.$hostElement$["s-ei"]){this.internals=n.$hostElement$["s-ei"]}else{this.internals=n.$hostElement$.attachInternals();n.$hostElement$["s-ei"]=this.internals}this.onInput=function(){t.value=parseInt(t.inputElement.value)};this.progress=undefined;this.max=100;this.min=0;this.step=1;this.value=undefined}n.prototype.calculateProgress=function(){var n=parseInt(this.inputElement.value);if(n>this.max)n=this.max;else if(n<this.min)n=this.min;if((n-this.min)%this.step!==0)n=Math.round(n/this.step)*this.step-this.min;this.value=n;this.internals.setFormValue(this.value.toString());var t=this.max-this.min;var a=this.value-this.min;this.progress=a*100/t};n.prototype.valueChanged=function(){this.inputElement.value=this.value.toString();this.calculateProgress();this.changeEvent.emit(this.value)};n.prototype.minChanged=function(){this.calculateProgress()};n.prototype.maxChanged=function(){this.calculateProgress()};n.prototype.stepChanged=function(){if(this.step<1)throw Error("step cant be negative or zero");this.calculateProgress()};n.prototype.componentDidLoad=function(){var n;this.inputElement=(n=this.element.shadowRoot)===null||n===void 0?void 0:n.querySelector(".field");this.value=parseInt(this.inputElement.value);this.calculateProgress()};n.prototype.render=function(){return h(Host,{key:"1bf968bd8ada3e6859369e0748d4c91441d54d32"},h("header",{key:"1871c6d5eb4b437563e045fbbed982061e31a145",class:"header",part:"header"},h("mds-text",{key:"9db4e20a523bb0182b4df3413161485c7d8649b7",class:"label",typography:"label"},h("slot",{key:"b5c8da4e94dc2a6adce7dd411b36f0f8dc78f461"})),h("mds-text",{key:"018703c3f4470b2f9f9971d404e2ac1de9f23b96",class:"value",typography:"label"},this.value)),h("div",{key:"46fc7c92462b5b5ad72c95cbceabaa2a63f68b29",class:"range"},h("div",{key:"7c4c6590c8f4b497370a1e992593080dea24037f",class:"track"},h("div",{key:"8d8c34357408bd1ddd44cda3a3bdd7883aaaa70c",class:"contrast-area"}),h("div",{key:"25f597c9b4a1889568468ec8a4e6130dd68e0afa",class:"track-total"},h("div",{key:"f64b454fac7145354eae16804315bb424507dc70",class:"track-progress",style:{width:"".concat(this.progress,"%")}}))),h("input",{key:"17ffd9fe1584698de222e619d17e3b849b5b82ae",class:"field",max:this.max,min:this.min,onInput:this.onInput,step:this.step,type:"range",value:this.value})))};Object.defineProperty(n,"formAssociated",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(n.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{value:["valueChanged"],min:["minChanged"],max:["maxChanged"],step:["stepChanged"]}},enumerable:false,configurable:true});return n}();MdsInputRange.style=MdsInputRangeStyle0;export{MdsInputRange as mds_input_range};
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-e0ac0a55.js";var mdsInputRangeCss="@-webkit-keyframes focus-bounce {\n 0%, 75%, 100% {\n outline-offset: var(--magma-outline-focus-offset, 6px);\n }\n\n 50% {\n outline-offset: var(--magma-outline-blur-offset, 2px);\n }\n}\n\n@keyframes focus-bounce {\n 0%, 75%, 100% {\n outline-offset: var(--magma-outline-focus-offset, 6px);\n }\n\n 50% {\n outline-offset: var(--magma-outline-blur-offset, 2px);\n }\n}\n\n@tailwind components;\n@tailwind utilities;\n\n/**\n * @prop --mds-input-range-thumb-size: Sets the thumb width and height of the component\n * @prop --mds-input-range-thumb-background:\n * @prop --mds-input-range-track-background:\n * @prop --mds-input-range-track-size:\n * @prop --mds-input-range-track-progress-background:\n */\n\n:host {\n\n --mds-input-range-thumb-size: 1rem;\n --mds-input-range-thumb-background: rgb(var(--variant-primary-04));\n --mds-input-range-thumb-shadow: 0 0 0 2px rgb(var(--tone-neutral));\n --mds-input-range-track-background: rgb(var(--tone-neutral-09));\n --mds-input-range-track-size: 0.5rem;\n --mds-input-range-track-progress-background: rgb(var(--variant-primary-03));\n gap: 0.25rem;\n -webkit-transition-duration: 200ms;\n transition-duration: 200ms;\n\n display: grid;\n -webkit-transition-property: color;\n transition-property: color;\n}\n\n.header {\n gap: 0.5rem;\n\n display: -ms-flexbox;\n\n display: flex;\n}\n\n.label {\n min-width: 0rem;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.value {\n margin-left: auto;\n}\n\n.range {\n -ms-flex-align: center;\n align-items: center;\n display: -ms-flexbox;\n display: flex;\n height: var(--mds-input-range-thumb-size);\n position: relative;\n}\n\n.track {\n width: 100%;\n\n --margin: calc(var(--mds-input-range-track-size) / 2);\n\n -webkit-box-sizing: border-box;\n\n box-sizing: border-box;\n padding: 0 var(--margin);\n position: absolute;\n}\n\n.field {\n -webkit-animation-duration: var(--magma-outline-animation-duration, 1s);\n animation-duration: var(--magma-outline-animation-duration, 1s);\n -webkit-animation-fill-mode: forwards;\n animation-fill-mode: forwards;\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite;\n -webkit-animation-name: focus-bounce;\n animation-name: focus-bounce;\n -webkit-animation-play-state: paused;\n animation-play-state: paused;\n -webkit-animation-timing-function: cubic-bezier(0, 0, 0.2, 1);\n animation-timing-function: cubic-bezier(0, 0, 0.2, 1);\n outline: var(--magma-outline-blur);\n -webkit-transition-duration: 200ms;\n transition-duration: 200ms;\n -webkit-transition-property: background-color, border-color, color, fill, outline, outline-offset, -webkit-box-shadow, -webkit-transform;\n transition-property: background-color, border-color, color, fill, outline, outline-offset, -webkit-box-shadow, -webkit-transform;\n transition-property: background-color, border-color, box-shadow, color, fill, outline, outline-offset, transform;\n transition-property: background-color, border-color, box-shadow, color, fill, outline, outline-offset, transform, -webkit-box-shadow, -webkit-transform;\n -webkit-transition-timing-function: ease-in-out;\n transition-timing-function: ease-in-out;\n }\n\n.field:focus-visible {\n\n --magma-outline-blur: var(--magma-outline-focus);\n\n -webkit-animation-play-state: running;\n\n animation-play-state: running;\n }\n\n.field {\n z-index: 20;\n height: 1rem;\n\n -webkit-appearance: none;\n\n -moz-appearance: none;\n\n appearance: none;\n background-color: transparent;\n border-radius: 1000px;\n -ms-flex-positive: 1;\n flex-grow: 1;\n margin: 0;\n}\n\n.field:focus-visible {\n\n --magma-outline-blur: var(--magma-outline-focus);\n\n -webkit-animation-play-state: running;\n\n animation-play-state: running;\n }\n\n.field::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n background-color: var(--mds-input-range-thumb-background);\n border: 0;\n border-radius: var(--mds-input-range-thumb-size);\n -webkit-box-shadow: var(--mds-input-range-thumb-shadow);\n box-shadow: var(--mds-input-range-thumb-shadow);\n cursor: -webkit-grab;\n cursor: grab;\n height: var(--mds-input-range-thumb-size);\n line-height: 0;\n -webkit-transform: translate(0, -50%);\n transform: translate(0, -50%);\n width: var(--mds-input-range-thumb-size);\n}\n\n.field::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n border: 0;\n height: 0;\n width: 100%;\n}\n\n.track-progress {\n -webkit-transition-duration: 300ms;\n transition-duration: 300ms;\n -webkit-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n\n background-color: var(--mds-input-range-track-progress-background);\n display: -ms-flexbox;\n display: flex;\n height: var(--mds-input-range-track-size);\n -webkit-transition-property: background-color;\n transition-property: background-color;\n}\n\n.track-total {\n -webkit-transition-duration: 300ms;\n transition-duration: 300ms;\n -webkit-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n\n background-color: var(--mds-input-range-track-background);\n border-radius: var(--mds-input-range-track-size);\n display: -ms-flexbox;\n display: flex;\n height: var(--mds-input-range-track-size);\n overflow: hidden;\n -webkit-transition-property: background-color;\n transition-property: background-color;\n width: 100%;\n}\n\n.contrast-area {\n margin-left: 0.25rem;\n margin-right: 0.25rem;\n\n border-radius: var(--mds-input-range-track-size);\n}\n\n@tailwind utilities;\n\n@container style(--magma-pref-animation: reduce) {\n :host,\n .field::-webkit-slider-thumb,\n .field::-webkit-slider-runnable-track,\n .track-progress,\n .track-total {\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n }\n}\n\n@container style(--magma-pref-animation: system) {\n\n @media (prefers-reduced-motion) {\n :host,\n .field::-webkit-slider-thumb,\n .field::-webkit-slider-runnable-track,\n .track-progress,\n .track-total {\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n }\n }\n}\n\n@tailwind utilities;\n\n@container style(--magma-pref-theme: dark) {\n :host {\n\n --mds-input-range-thumb-background: rgb(var(--variant-primary-04));\n --mds-input-range-track-background: rgb(var(--tone-neutral-07));\n --mds-input-range-track-progress-background: rgb(var(--variant-primary-05));\n }\n}\n\n@container style(--magma-pref-theme: system) {\n\n @media (prefers-color-scheme: dark) {\n :host {\n\n --mds-input-range-thumb-background: rgb(var(--variant-primary-04));\n --mds-input-range-track-background: rgb(var(--tone-neutral-07));\n --mds-input-range-track-progress-background: rgb(var(--variant-primary-05));\n }\n }\n}\n\n@container style(--magma-pref-contrast: more) {\n :host {\n color: rgb(var(--tone-neutral-01));\n }\n}\n\n@container style(--magma-pref-contrast: system) {\n\n @media (prefers-contrast: more) {\n :host {\n color: rgb(var(--tone-neutral-01));\n }\n }\n}\n\n\n";var MdsInputRangeStyle0=mdsInputRangeCss;var MdsInputRange=function(){function n(n){var t=this;registerInstance(this,n);this.changeEvent=createEvent(this,"mdsInputRangeChange",7);if(n.$hostElement$["s-ei"]){this.internals=n.$hostElement$["s-ei"]}else{this.internals=n.$hostElement$.attachInternals();n.$hostElement$["s-ei"]=this.internals}this.onInput=function(){t.value=parseInt(t.inputElement.value)};this.progress=undefined;this.max=100;this.min=0;this.step=1;this.value=undefined}n.prototype.calculateProgress=function(){var n=parseInt(this.inputElement.value);if(n>this.max)n=this.max;else if(n<this.min)n=this.min;if((n-this.min)%this.step!==0)n=Math.round(n/this.step)*this.step-this.min;this.value=n;this.internals.setFormValue(this.value.toString());var t=this.max-this.min;var a=this.value-this.min;this.progress=a*100/t};n.prototype.valueChanged=function(){this.inputElement.value=this.value.toString();this.calculateProgress();this.changeEvent.emit(this.value)};n.prototype.minChanged=function(){this.calculateProgress()};n.prototype.maxChanged=function(){this.calculateProgress()};n.prototype.stepChanged=function(){if(this.step<1)throw Error("step cant be negative or zero");this.calculateProgress()};n.prototype.componentDidLoad=function(){var n,t;this.label=(n=this.element.textContent)!==null&&n!==void 0?n:"";this.inputElement=(t=this.element.shadowRoot)===null||t===void 0?void 0:t.querySelector(".field");this.value=parseInt(this.inputElement.value);this.calculateProgress()};n.prototype.render=function(){return h(Host,{key:"4f58f56b2bf1af905741bbcab323e583dd907a35"},h("header",{key:"69a2e6c483558f0ce70eca8e1ec45f4ce7f63b10",class:"header",part:"header"},h("mds-text",{key:"1d5f89b89f5bdf1ca6746567eb23d2b96444c2d9",class:"label",typography:"label"},h("slot",{key:"534eb663ff412980069c4308a2a15a784e2bf1cf"})),h("mds-text",{key:"e187c33fb9124f1d20032c822b535d0ddc839fe3",class:"value",typography:"label"},this.value)),h("div",{key:"fb3245af7eefbab656b68810577d77a328e312c5",class:"range"},h("div",{key:"f146b8b59fbd5bbb3db2350d94686fad986b4dfc",class:"track"},h("div",{key:"04aaec03384f51e3ad2ad8cc695274c36062d6bf",class:"contrast-area"}),h("div",{key:"2de981fb668e8056a24ca82163dca106fcc5878e",class:"track-total"},h("div",{key:"2044a5ce25454e56d950c2c7f68ce11369babd87",class:"track-progress",style:{width:"".concat(this.progress,"%")}}))),h("input",{key:"423eb3d5b176748d0376374888c7ef3298dc54d9",class:"field","aria-label":this.label,max:this.max,min:this.min,onInput:this.onInput,step:this.step,type:"range",value:this.value})))};Object.defineProperty(n,"formAssociated",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(n.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{value:["valueChanged"],min:["minChanged"],max:["maxChanged"],step:["stepChanged"]}},enumerable:false,configurable:true});return n}();MdsInputRange.style=MdsInputRangeStyle0;export{MdsInputRange as mds_input_range};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as a}from"./p-f6cc8c2e.js";export{s as setNonce}from"./p-f6cc8c2e.js";import{g as n}from"./p-e1255160.js";(()=>{const a=import.meta.url,s={};return""!==a&&(s.resourcesUrl=new URL(".",a).href),e(s)})().then((async e=>(await n(),a([["p-
|
|
1
|
+
import{p as e,b as a}from"./p-f6cc8c2e.js";export{s as setNonce}from"./p-f6cc8c2e.js";import{g as n}from"./p-e1255160.js";(()=>{const a=import.meta.url,s={};return""!==a&&(s.resourcesUrl=new URL(".",a).href),e(s)})().then((async e=>(await n(),a([["p-d697edb0",[[65,"mds-input-range",{max:[2],min:[2],step:[2],value:[1538],progress:[32]},null,{value:["valueChanged"],min:["minChanged"],max:["maxChanged"],step:["stepChanged"]}]]]],e))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-4e0b934e.system.js"],(function(n){"use strict";var t,i,a,e,r;return{setters:[function(n){t=n.r;i=n.c;a=n.h;e=n.H;r=n.g}],execute:function(){var o="@-webkit-keyframes focus-bounce {\n 0%, 75%, 100% {\n outline-offset: var(--magma-outline-focus-offset, 6px);\n }\n\n 50% {\n outline-offset: var(--magma-outline-blur-offset, 2px);\n }\n}\n\n@keyframes focus-bounce {\n 0%, 75%, 100% {\n outline-offset: var(--magma-outline-focus-offset, 6px);\n }\n\n 50% {\n outline-offset: var(--magma-outline-blur-offset, 2px);\n }\n}\n\n@tailwind components;\n@tailwind utilities;\n\n/**\n * @prop --mds-input-range-thumb-size: Sets the thumb width and height of the component\n * @prop --mds-input-range-thumb-background:\n * @prop --mds-input-range-track-background:\n * @prop --mds-input-range-track-size:\n * @prop --mds-input-range-track-progress-background:\n */\n\n:host {\n\n --mds-input-range-thumb-size: 1rem;\n --mds-input-range-thumb-background: rgb(var(--variant-primary-04));\n --mds-input-range-thumb-shadow: 0 0 0 2px rgb(var(--tone-neutral));\n --mds-input-range-track-background: rgb(var(--tone-neutral-09));\n --mds-input-range-track-size: 0.5rem;\n --mds-input-range-track-progress-background: rgb(var(--variant-primary-03));\n gap: 0.25rem;\n -webkit-transition-duration: 200ms;\n transition-duration: 200ms;\n\n display: grid;\n -webkit-transition-property: color;\n transition-property: color;\n}\n\n.header {\n gap: 0.5rem;\n\n display: -ms-flexbox;\n\n display: flex;\n}\n\n.label {\n min-width: 0rem;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.value {\n margin-left: auto;\n}\n\n.range {\n -ms-flex-align: center;\n align-items: center;\n display: -ms-flexbox;\n display: flex;\n height: var(--mds-input-range-thumb-size);\n position: relative;\n}\n\n.track {\n width: 100%;\n\n --margin: calc(var(--mds-input-range-track-size) / 2);\n\n -webkit-box-sizing: border-box;\n\n box-sizing: border-box;\n padding: 0 var(--margin);\n position: absolute;\n}\n\n.field {\n -webkit-animation-duration: var(--magma-outline-animation-duration, 1s);\n animation-duration: var(--magma-outline-animation-duration, 1s);\n -webkit-animation-fill-mode: forwards;\n animation-fill-mode: forwards;\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite;\n -webkit-animation-name: focus-bounce;\n animation-name: focus-bounce;\n -webkit-animation-play-state: paused;\n animation-play-state: paused;\n -webkit-animation-timing-function: cubic-bezier(0, 0, 0.2, 1);\n animation-timing-function: cubic-bezier(0, 0, 0.2, 1);\n outline: var(--magma-outline-blur);\n -webkit-transition-duration: 200ms;\n transition-duration: 200ms;\n -webkit-transition-property: background-color, border-color, color, fill, outline, outline-offset, -webkit-box-shadow, -webkit-transform;\n transition-property: background-color, border-color, color, fill, outline, outline-offset, -webkit-box-shadow, -webkit-transform;\n transition-property: background-color, border-color, box-shadow, color, fill, outline, outline-offset, transform;\n transition-property: background-color, border-color, box-shadow, color, fill, outline, outline-offset, transform, -webkit-box-shadow, -webkit-transform;\n -webkit-transition-timing-function: ease-in-out;\n transition-timing-function: ease-in-out;\n }\n\n.field:focus-visible {\n\n --magma-outline-blur: var(--magma-outline-focus);\n\n -webkit-animation-play-state: running;\n\n animation-play-state: running;\n }\n\n.field {\n z-index: 20;\n height: 1rem;\n\n -webkit-appearance: none;\n\n -moz-appearance: none;\n\n appearance: none;\n background-color: transparent;\n border-radius: 1000px;\n -ms-flex-positive: 1;\n flex-grow: 1;\n margin: 0;\n}\n\n.field:focus-visible {\n\n --magma-outline-blur: var(--magma-outline-focus);\n\n -webkit-animation-play-state: running;\n\n animation-play-state: running;\n }\n\n.field::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n background-color: var(--mds-input-range-thumb-background);\n border: 0;\n border-radius: var(--mds-input-range-thumb-size);\n -webkit-box-shadow: var(--mds-input-range-thumb-shadow);\n box-shadow: var(--mds-input-range-thumb-shadow);\n cursor: -webkit-grab;\n cursor: grab;\n height: var(--mds-input-range-thumb-size);\n line-height: 0;\n -webkit-transform: translate(0, -50%);\n transform: translate(0, -50%);\n width: var(--mds-input-range-thumb-size);\n}\n\n.field::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n border: 0;\n height: 0;\n width: 100%;\n}\n\n.track-progress {\n -webkit-transition-duration: 300ms;\n transition-duration: 300ms;\n -webkit-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n\n background-color: var(--mds-input-range-track-progress-background);\n display: -ms-flexbox;\n display: flex;\n height: var(--mds-input-range-track-size);\n -webkit-transition-property: background-color;\n transition-property: background-color;\n}\n\n.track-total {\n -webkit-transition-duration: 300ms;\n transition-duration: 300ms;\n -webkit-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n\n background-color: var(--mds-input-range-track-background);\n border-radius: var(--mds-input-range-track-size);\n display: -ms-flexbox;\n display: flex;\n height: var(--mds-input-range-track-size);\n overflow: hidden;\n -webkit-transition-property: background-color;\n transition-property: background-color;\n width: 100%;\n}\n\n.contrast-area {\n margin-left: 0.25rem;\n margin-right: 0.25rem;\n\n border-radius: var(--mds-input-range-track-size);\n}\n\n@tailwind utilities;\n\n@container style(--magma-pref-animation: reduce) {\n :host,\n .field::-webkit-slider-thumb,\n .field::-webkit-slider-runnable-track,\n .track-progress,\n .track-total {\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n }\n}\n\n@container style(--magma-pref-animation: system) {\n\n @media (prefers-reduced-motion) {\n :host,\n .field::-webkit-slider-thumb,\n .field::-webkit-slider-runnable-track,\n .track-progress,\n .track-total {\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n }\n }\n}\n\n@tailwind utilities;\n\n@container style(--magma-pref-theme: dark) {\n :host {\n\n --mds-input-range-thumb-background: rgb(var(--variant-primary-04));\n --mds-input-range-track-background: rgb(var(--tone-neutral-07));\n --mds-input-range-track-progress-background: rgb(var(--variant-primary-05));\n }\n}\n\n@container style(--magma-pref-theme: system) {\n\n @media (prefers-color-scheme: dark) {\n :host {\n\n --mds-input-range-thumb-background: rgb(var(--variant-primary-04));\n --mds-input-range-track-background: rgb(var(--tone-neutral-07));\n --mds-input-range-track-progress-background: rgb(var(--variant-primary-05));\n }\n }\n}\n\n@container style(--magma-pref-contrast: more) {\n :host {\n color: rgb(var(--tone-neutral-01));\n }\n}\n\n@container style(--magma-pref-contrast: system) {\n\n @media (prefers-contrast: more) {\n :host {\n color: rgb(var(--tone-neutral-01));\n }\n }\n}\n\n\n";var s=o;var u=n("mds_input_range",function(){function n(n){var a=this;t(this,n);this.changeEvent=i(this,"mdsInputRangeChange",7);if(n.$hostElement$["s-ei"]){this.internals=n.$hostElement$["s-ei"]}else{this.internals=n.$hostElement$.attachInternals();n.$hostElement$["s-ei"]=this.internals}this.onInput=function(){a.value=parseInt(a.inputElement.value)};this.progress=undefined;this.max=100;this.min=0;this.step=1;this.value=undefined}n.prototype.calculateProgress=function(){var n=parseInt(this.inputElement.value);if(n>this.max)n=this.max;else if(n<this.min)n=this.min;if((n-this.min)%this.step!==0)n=Math.round(n/this.step)*this.step-this.min;this.value=n;this.internals.setFormValue(this.value.toString());var t=this.max-this.min;var i=this.value-this.min;this.progress=i*100/t};n.prototype.valueChanged=function(){this.inputElement.value=this.value.toString();this.calculateProgress();this.changeEvent.emit(this.value)};n.prototype.minChanged=function(){this.calculateProgress()};n.prototype.maxChanged=function(){this.calculateProgress()};n.prototype.stepChanged=function(){if(this.step<1)throw Error("step cant be negative or zero");this.calculateProgress()};n.prototype.componentDidLoad=function(){var n;this.inputElement=(n=this.element.shadowRoot)===null||n===void 0?void 0:n.querySelector(".field");this.value=parseInt(this.inputElement.value);this.calculateProgress()};n.prototype.render=function(){return a(e,{key:"1bf968bd8ada3e6859369e0748d4c91441d54d32"},a("header",{key:"1871c6d5eb4b437563e045fbbed982061e31a145",class:"header",part:"header"},a("mds-text",{key:"9db4e20a523bb0182b4df3413161485c7d8649b7",class:"label",typography:"label"},a("slot",{key:"b5c8da4e94dc2a6adce7dd411b36f0f8dc78f461"})),a("mds-text",{key:"018703c3f4470b2f9f9971d404e2ac1de9f23b96",class:"value",typography:"label"},this.value)),a("div",{key:"46fc7c92462b5b5ad72c95cbceabaa2a63f68b29",class:"range"},a("div",{key:"7c4c6590c8f4b497370a1e992593080dea24037f",class:"track"},a("div",{key:"8d8c34357408bd1ddd44cda3a3bdd7883aaaa70c",class:"contrast-area"}),a("div",{key:"25f597c9b4a1889568468ec8a4e6130dd68e0afa",class:"track-total"},a("div",{key:"f64b454fac7145354eae16804315bb424507dc70",class:"track-progress",style:{width:"".concat(this.progress,"%")}}))),a("input",{key:"17ffd9fe1584698de222e619d17e3b849b5b82ae",class:"field",max:this.max,min:this.min,onInput:this.onInput,step:this.step,type:"range",value:this.value})))};Object.defineProperty(n,"formAssociated",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(n.prototype,"element",{get:function(){return r(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{value:["valueChanged"],min:["minChanged"],max:["maxChanged"],step:["stepChanged"]}},enumerable:false,configurable:true});return n}());u.style=s}}}));
|
|
1
|
+
System.register(["./p-4e0b934e.system.js"],(function(n){"use strict";var t,i,a,e,r;return{setters:[function(n){t=n.r;i=n.c;a=n.h;e=n.H;r=n.g}],execute:function(){var o="@-webkit-keyframes focus-bounce {\n 0%, 75%, 100% {\n outline-offset: var(--magma-outline-focus-offset, 6px);\n }\n\n 50% {\n outline-offset: var(--magma-outline-blur-offset, 2px);\n }\n}\n\n@keyframes focus-bounce {\n 0%, 75%, 100% {\n outline-offset: var(--magma-outline-focus-offset, 6px);\n }\n\n 50% {\n outline-offset: var(--magma-outline-blur-offset, 2px);\n }\n}\n\n@tailwind components;\n@tailwind utilities;\n\n/**\n * @prop --mds-input-range-thumb-size: Sets the thumb width and height of the component\n * @prop --mds-input-range-thumb-background:\n * @prop --mds-input-range-track-background:\n * @prop --mds-input-range-track-size:\n * @prop --mds-input-range-track-progress-background:\n */\n\n:host {\n\n --mds-input-range-thumb-size: 1rem;\n --mds-input-range-thumb-background: rgb(var(--variant-primary-04));\n --mds-input-range-thumb-shadow: 0 0 0 2px rgb(var(--tone-neutral));\n --mds-input-range-track-background: rgb(var(--tone-neutral-09));\n --mds-input-range-track-size: 0.5rem;\n --mds-input-range-track-progress-background: rgb(var(--variant-primary-03));\n gap: 0.25rem;\n -webkit-transition-duration: 200ms;\n transition-duration: 200ms;\n\n display: grid;\n -webkit-transition-property: color;\n transition-property: color;\n}\n\n.header {\n gap: 0.5rem;\n\n display: -ms-flexbox;\n\n display: flex;\n}\n\n.label {\n min-width: 0rem;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.value {\n margin-left: auto;\n}\n\n.range {\n -ms-flex-align: center;\n align-items: center;\n display: -ms-flexbox;\n display: flex;\n height: var(--mds-input-range-thumb-size);\n position: relative;\n}\n\n.track {\n width: 100%;\n\n --margin: calc(var(--mds-input-range-track-size) / 2);\n\n -webkit-box-sizing: border-box;\n\n box-sizing: border-box;\n padding: 0 var(--margin);\n position: absolute;\n}\n\n.field {\n -webkit-animation-duration: var(--magma-outline-animation-duration, 1s);\n animation-duration: var(--magma-outline-animation-duration, 1s);\n -webkit-animation-fill-mode: forwards;\n animation-fill-mode: forwards;\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite;\n -webkit-animation-name: focus-bounce;\n animation-name: focus-bounce;\n -webkit-animation-play-state: paused;\n animation-play-state: paused;\n -webkit-animation-timing-function: cubic-bezier(0, 0, 0.2, 1);\n animation-timing-function: cubic-bezier(0, 0, 0.2, 1);\n outline: var(--magma-outline-blur);\n -webkit-transition-duration: 200ms;\n transition-duration: 200ms;\n -webkit-transition-property: background-color, border-color, color, fill, outline, outline-offset, -webkit-box-shadow, -webkit-transform;\n transition-property: background-color, border-color, color, fill, outline, outline-offset, -webkit-box-shadow, -webkit-transform;\n transition-property: background-color, border-color, box-shadow, color, fill, outline, outline-offset, transform;\n transition-property: background-color, border-color, box-shadow, color, fill, outline, outline-offset, transform, -webkit-box-shadow, -webkit-transform;\n -webkit-transition-timing-function: ease-in-out;\n transition-timing-function: ease-in-out;\n }\n\n.field:focus-visible {\n\n --magma-outline-blur: var(--magma-outline-focus);\n\n -webkit-animation-play-state: running;\n\n animation-play-state: running;\n }\n\n.field {\n z-index: 20;\n height: 1rem;\n\n -webkit-appearance: none;\n\n -moz-appearance: none;\n\n appearance: none;\n background-color: transparent;\n border-radius: 1000px;\n -ms-flex-positive: 1;\n flex-grow: 1;\n margin: 0;\n}\n\n.field:focus-visible {\n\n --magma-outline-blur: var(--magma-outline-focus);\n\n -webkit-animation-play-state: running;\n\n animation-play-state: running;\n }\n\n.field::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n background-color: var(--mds-input-range-thumb-background);\n border: 0;\n border-radius: var(--mds-input-range-thumb-size);\n -webkit-box-shadow: var(--mds-input-range-thumb-shadow);\n box-shadow: var(--mds-input-range-thumb-shadow);\n cursor: -webkit-grab;\n cursor: grab;\n height: var(--mds-input-range-thumb-size);\n line-height: 0;\n -webkit-transform: translate(0, -50%);\n transform: translate(0, -50%);\n width: var(--mds-input-range-thumb-size);\n}\n\n.field::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n border: 0;\n height: 0;\n width: 100%;\n}\n\n.track-progress {\n -webkit-transition-duration: 300ms;\n transition-duration: 300ms;\n -webkit-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n\n background-color: var(--mds-input-range-track-progress-background);\n display: -ms-flexbox;\n display: flex;\n height: var(--mds-input-range-track-size);\n -webkit-transition-property: background-color;\n transition-property: background-color;\n}\n\n.track-total {\n -webkit-transition-duration: 300ms;\n transition-duration: 300ms;\n -webkit-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n\n background-color: var(--mds-input-range-track-background);\n border-radius: var(--mds-input-range-track-size);\n display: -ms-flexbox;\n display: flex;\n height: var(--mds-input-range-track-size);\n overflow: hidden;\n -webkit-transition-property: background-color;\n transition-property: background-color;\n width: 100%;\n}\n\n.contrast-area {\n margin-left: 0.25rem;\n margin-right: 0.25rem;\n\n border-radius: var(--mds-input-range-track-size);\n}\n\n@tailwind utilities;\n\n@container style(--magma-pref-animation: reduce) {\n :host,\n .field::-webkit-slider-thumb,\n .field::-webkit-slider-runnable-track,\n .track-progress,\n .track-total {\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n }\n}\n\n@container style(--magma-pref-animation: system) {\n\n @media (prefers-reduced-motion) {\n :host,\n .field::-webkit-slider-thumb,\n .field::-webkit-slider-runnable-track,\n .track-progress,\n .track-total {\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n }\n }\n}\n\n@tailwind utilities;\n\n@container style(--magma-pref-theme: dark) {\n :host {\n\n --mds-input-range-thumb-background: rgb(var(--variant-primary-04));\n --mds-input-range-track-background: rgb(var(--tone-neutral-07));\n --mds-input-range-track-progress-background: rgb(var(--variant-primary-05));\n }\n}\n\n@container style(--magma-pref-theme: system) {\n\n @media (prefers-color-scheme: dark) {\n :host {\n\n --mds-input-range-thumb-background: rgb(var(--variant-primary-04));\n --mds-input-range-track-background: rgb(var(--tone-neutral-07));\n --mds-input-range-track-progress-background: rgb(var(--variant-primary-05));\n }\n }\n}\n\n@container style(--magma-pref-contrast: more) {\n :host {\n color: rgb(var(--tone-neutral-01));\n }\n}\n\n@container style(--magma-pref-contrast: system) {\n\n @media (prefers-contrast: more) {\n :host {\n color: rgb(var(--tone-neutral-01));\n }\n }\n}\n\n\n";var s=o;var u=n("mds_input_range",function(){function n(n){var a=this;t(this,n);this.changeEvent=i(this,"mdsInputRangeChange",7);if(n.$hostElement$["s-ei"]){this.internals=n.$hostElement$["s-ei"]}else{this.internals=n.$hostElement$.attachInternals();n.$hostElement$["s-ei"]=this.internals}this.onInput=function(){a.value=parseInt(a.inputElement.value)};this.progress=undefined;this.max=100;this.min=0;this.step=1;this.value=undefined}n.prototype.calculateProgress=function(){var n=parseInt(this.inputElement.value);if(n>this.max)n=this.max;else if(n<this.min)n=this.min;if((n-this.min)%this.step!==0)n=Math.round(n/this.step)*this.step-this.min;this.value=n;this.internals.setFormValue(this.value.toString());var t=this.max-this.min;var i=this.value-this.min;this.progress=i*100/t};n.prototype.valueChanged=function(){this.inputElement.value=this.value.toString();this.calculateProgress();this.changeEvent.emit(this.value)};n.prototype.minChanged=function(){this.calculateProgress()};n.prototype.maxChanged=function(){this.calculateProgress()};n.prototype.stepChanged=function(){if(this.step<1)throw Error("step cant be negative or zero");this.calculateProgress()};n.prototype.componentDidLoad=function(){var n,t;this.label=(n=this.element.textContent)!==null&&n!==void 0?n:"";this.inputElement=(t=this.element.shadowRoot)===null||t===void 0?void 0:t.querySelector(".field");this.value=parseInt(this.inputElement.value);this.calculateProgress()};n.prototype.render=function(){return a(e,{key:"4f58f56b2bf1af905741bbcab323e583dd907a35"},a("header",{key:"69a2e6c483558f0ce70eca8e1ec45f4ce7f63b10",class:"header",part:"header"},a("mds-text",{key:"1d5f89b89f5bdf1ca6746567eb23d2b96444c2d9",class:"label",typography:"label"},a("slot",{key:"534eb663ff412980069c4308a2a15a784e2bf1cf"})),a("mds-text",{key:"e187c33fb9124f1d20032c822b535d0ddc839fe3",class:"value",typography:"label"},this.value)),a("div",{key:"fb3245af7eefbab656b68810577d77a328e312c5",class:"range"},a("div",{key:"f146b8b59fbd5bbb3db2350d94686fad986b4dfc",class:"track"},a("div",{key:"04aaec03384f51e3ad2ad8cc695274c36062d6bf",class:"contrast-area"}),a("div",{key:"2de981fb668e8056a24ca82163dca106fcc5878e",class:"track-total"},a("div",{key:"2044a5ce25454e56d950c2c7f68ce11369babd87",class:"track-progress",style:{width:"".concat(this.progress,"%")}}))),a("input",{key:"423eb3d5b176748d0376374888c7ef3298dc54d9",class:"field","aria-label":this.label,max:this.max,min:this.min,onInput:this.onInput,step:this.step,type:"range",value:this.value})))};Object.defineProperty(n,"formAssociated",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(n.prototype,"element",{get:function(){return r(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{value:["valueChanged"],min:["minChanged"],max:["maxChanged"],step:["stepChanged"]}},enumerable:false,configurable:true});return n}());u.style=s}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(n,t,e,r){function i(n){return n instanceof e?n:new e((function(t){t(n)}))}return new(e||(e=Promise))((function(e,u){function a(n){try{o(r.next(n))}catch(n){u(n)}}function c(n){try{o(r["throw"](n))}catch(n){u(n)}}function o(n){n.done?e(n.value):i(n.value).then(a,c)}o((r=r.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var e={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},r,i,u,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(n){return function(t){return o([n,t])}}function o(c){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,c[0]&&(e=0)),e)try{if(r=1,i&&(u=c[0]&2?i["return"]:c[0]?i["throw"]||((u=i["return"])&&u.call(i),0):i.next)&&!(u=u.call(i,c[1])).done)return u;if(i=0,u)c=[c[0]&2,u.value];switch(c[0]){case 0:case 1:u=c;break;case 4:e.label++;return{value:c[1],done:false};case 5:e.label++;i=c[1];c=[0];continue;case 7:c=e.ops.pop();e.trys.pop();continue;default:if(!(u=e.trys,u=u.length>0&&u[u.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!u||c[1]>u[0]&&c[1]<u[3])){e.label=c[1];break}if(c[0]===6&&e.label<u[1]){e.label=u[1];u=c;break}if(u&&e.label<u[2]){e.label=u[2];e.ops.push(c);break}if(u[2])e.ops.pop();e.trys.pop();continue}c=t.call(n,e)}catch(n){c=[6,n];i=0}finally{r=u=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};System.register(["./p-4e0b934e.system.js","./p-56ba5cbf.system.js"],(function(n,t){"use strict";var e,r,i;return{setters:[function(t){e=t.p;r=t.b;n("setNonce",t.s)},function(n){i=n.g}],execute:function(){var n=this;var u=function(){var n=t.meta.url;var r={};if(n!==""){r.resourcesUrl=new URL(".",n).href}return e(r)};u().then((function(t){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return[4,i()];case 1:n.sent();return[2,r([["p-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(n,t,e,r){function i(n){return n instanceof e?n:new e((function(t){t(n)}))}return new(e||(e=Promise))((function(e,u){function a(n){try{o(r.next(n))}catch(n){u(n)}}function c(n){try{o(r["throw"](n))}catch(n){u(n)}}function o(n){n.done?e(n.value):i(n.value).then(a,c)}o((r=r.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var e={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},r,i,u,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(n){return function(t){return o([n,t])}}function o(c){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,c[0]&&(e=0)),e)try{if(r=1,i&&(u=c[0]&2?i["return"]:c[0]?i["throw"]||((u=i["return"])&&u.call(i),0):i.next)&&!(u=u.call(i,c[1])).done)return u;if(i=0,u)c=[c[0]&2,u.value];switch(c[0]){case 0:case 1:u=c;break;case 4:e.label++;return{value:c[1],done:false};case 5:e.label++;i=c[1];c=[0];continue;case 7:c=e.ops.pop();e.trys.pop();continue;default:if(!(u=e.trys,u=u.length>0&&u[u.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!u||c[1]>u[0]&&c[1]<u[3])){e.label=c[1];break}if(c[0]===6&&e.label<u[1]){e.label=u[1];u=c;break}if(u&&e.label<u[2]){e.label=u[2];e.ops.push(c);break}if(u[2])e.ops.pop();e.trys.pop();continue}c=t.call(n,e)}catch(n){c=[6,n];i=0}finally{r=u=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};System.register(["./p-4e0b934e.system.js","./p-56ba5cbf.system.js"],(function(n,t){"use strict";var e,r,i;return{setters:[function(t){e=t.p;r=t.b;n("setNonce",t.s)},function(n){i=n.g}],execute:function(){var n=this;var u=function(){var n=t.meta.url;var r={};if(n!==""){r.resourcesUrl=new URL(".",n).href}return e(r)};u().then((function(t){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return[4,i()];case 1:n.sent();return[2,r([["p-48fdc5db.system",[[65,"mds-input-range",{max:[2],min:[2],step:[2],value:[1538],progress:[32]},null,{value:["valueChanged"],min:["minChanged"],max:["maxChanged"],step:["stepChanged"]}]]]],t)]}}))}))}))}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as n,c as t,h as a,H as i,g as r}from"./p-f6cc8c2e.js";const e=class{constructor(a){n(this,a),this.changeEvent=t(this,"mdsInputRangeChange",7),a.$hostElement$["s-ei"]?this.internals=a.$hostElement$["s-ei"]:(this.internals=a.$hostElement$.attachInternals(),a.$hostElement$["s-ei"]=this.internals),this.onInput=()=>{this.value=parseInt(this.inputElement.value)},this.progress=void 0,this.max=100,this.min=0,this.step=1,this.value=void 0}calculateProgress(){let n=parseInt(this.inputElement.value);n>this.max?n=this.max:n<this.min&&(n=this.min),(n-this.min)%this.step!=0&&(n=Math.round(n/this.step)*this.step-this.min),this.value=n,this.internals.setFormValue(this.value.toString()),this.progress=100*(this.value-this.min)/(this.max-this.min)}valueChanged(){this.inputElement.value=this.value.toString(),this.calculateProgress(),this.changeEvent.emit(this.value)}minChanged(){this.calculateProgress()}maxChanged(){this.calculateProgress()}stepChanged(){if(this.step<1)throw Error("step cant be negative or zero");this.calculateProgress()}componentDidLoad(){var n,t;this.label=null!==(n=this.element.textContent)&&void 0!==n?n:"",this.inputElement=null===(t=this.element.shadowRoot)||void 0===t?void 0:t.querySelector(".field"),this.value=parseInt(this.inputElement.value),this.calculateProgress()}render(){return a(i,{key:"4f58f56b2bf1af905741bbcab323e583dd907a35"},a("header",{key:"69a2e6c483558f0ce70eca8e1ec45f4ce7f63b10",class:"header",part:"header"},a("mds-text",{key:"1d5f89b89f5bdf1ca6746567eb23d2b96444c2d9",class:"label",typography:"label"},a("slot",{key:"534eb663ff412980069c4308a2a15a784e2bf1cf"})),a("mds-text",{key:"e187c33fb9124f1d20032c822b535d0ddc839fe3",class:"value",typography:"label"},this.value)),a("div",{key:"fb3245af7eefbab656b68810577d77a328e312c5",class:"range"},a("div",{key:"f146b8b59fbd5bbb3db2350d94686fad986b4dfc",class:"track"},a("div",{key:"04aaec03384f51e3ad2ad8cc695274c36062d6bf",class:"contrast-area"}),a("div",{key:"2de981fb668e8056a24ca82163dca106fcc5878e",class:"track-total"},a("div",{key:"2044a5ce25454e56d950c2c7f68ce11369babd87",class:"track-progress",style:{width:`${this.progress}%`}}))),a("input",{key:"423eb3d5b176748d0376374888c7ef3298dc54d9",class:"field","aria-label":this.label,max:this.max,min:this.min,onInput:this.onInput,step:this.step,type:"range",value:this.value})))}static get formAssociated(){return!0}get element(){return r(this)}static get watchers(){return{value:["valueChanged"],min:["minChanged"],max:["maxChanged"],step:["stepChanged"]}}};e.style="@-webkit-keyframes focus-bounce {\n 0%, 75%, 100% {\n outline-offset: var(--magma-outline-focus-offset, 6px);\n }\n\n 50% {\n outline-offset: var(--magma-outline-blur-offset, 2px);\n }\n}\n\n@keyframes focus-bounce {\n 0%, 75%, 100% {\n outline-offset: var(--magma-outline-focus-offset, 6px);\n }\n\n 50% {\n outline-offset: var(--magma-outline-blur-offset, 2px);\n }\n}\n\n@tailwind components;\n@tailwind utilities;\n\n/**\n * @prop --mds-input-range-thumb-size: Sets the thumb width and height of the component\n * @prop --mds-input-range-thumb-background:\n * @prop --mds-input-range-track-background:\n * @prop --mds-input-range-track-size:\n * @prop --mds-input-range-track-progress-background:\n */\n\n:host {\n\n --mds-input-range-thumb-size: 1rem;\n --mds-input-range-thumb-background: rgb(var(--variant-primary-04));\n --mds-input-range-thumb-shadow: 0 0 0 2px rgb(var(--tone-neutral));\n --mds-input-range-track-background: rgb(var(--tone-neutral-09));\n --mds-input-range-track-size: 0.5rem;\n --mds-input-range-track-progress-background: rgb(var(--variant-primary-03));\n gap: 0.25rem;\n -webkit-transition-duration: 200ms;\n transition-duration: 200ms;\n\n display: grid;\n -webkit-transition-property: color;\n transition-property: color;\n}\n\n.header {\n gap: 0.5rem;\n\n display: -ms-flexbox;\n\n display: flex;\n}\n\n.label {\n min-width: 0rem;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.value {\n margin-left: auto;\n}\n\n.range {\n -ms-flex-align: center;\n align-items: center;\n display: -ms-flexbox;\n display: flex;\n height: var(--mds-input-range-thumb-size);\n position: relative;\n}\n\n.track {\n width: 100%;\n\n --margin: calc(var(--mds-input-range-track-size) / 2);\n\n -webkit-box-sizing: border-box;\n\n box-sizing: border-box;\n padding: 0 var(--margin);\n position: absolute;\n}\n\n.field {\n -webkit-animation-duration: var(--magma-outline-animation-duration, 1s);\n animation-duration: var(--magma-outline-animation-duration, 1s);\n -webkit-animation-fill-mode: forwards;\n animation-fill-mode: forwards;\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite;\n -webkit-animation-name: focus-bounce;\n animation-name: focus-bounce;\n -webkit-animation-play-state: paused;\n animation-play-state: paused;\n -webkit-animation-timing-function: cubic-bezier(0, 0, 0.2, 1);\n animation-timing-function: cubic-bezier(0, 0, 0.2, 1);\n outline: var(--magma-outline-blur);\n -webkit-transition-duration: 200ms;\n transition-duration: 200ms;\n -webkit-transition-property: background-color, border-color, color, fill, outline, outline-offset, -webkit-box-shadow, -webkit-transform;\n transition-property: background-color, border-color, color, fill, outline, outline-offset, -webkit-box-shadow, -webkit-transform;\n transition-property: background-color, border-color, box-shadow, color, fill, outline, outline-offset, transform;\n transition-property: background-color, border-color, box-shadow, color, fill, outline, outline-offset, transform, -webkit-box-shadow, -webkit-transform;\n -webkit-transition-timing-function: ease-in-out;\n transition-timing-function: ease-in-out;\n }\n\n.field:focus-visible {\n\n --magma-outline-blur: var(--magma-outline-focus);\n\n -webkit-animation-play-state: running;\n\n animation-play-state: running;\n }\n\n.field {\n z-index: 20;\n height: 1rem;\n\n -webkit-appearance: none;\n\n -moz-appearance: none;\n\n appearance: none;\n background-color: transparent;\n border-radius: 1000px;\n -ms-flex-positive: 1;\n flex-grow: 1;\n margin: 0;\n}\n\n.field:focus-visible {\n\n --magma-outline-blur: var(--magma-outline-focus);\n\n -webkit-animation-play-state: running;\n\n animation-play-state: running;\n }\n\n.field::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n background-color: var(--mds-input-range-thumb-background);\n border: 0;\n border-radius: var(--mds-input-range-thumb-size);\n -webkit-box-shadow: var(--mds-input-range-thumb-shadow);\n box-shadow: var(--mds-input-range-thumb-shadow);\n cursor: -webkit-grab;\n cursor: grab;\n height: var(--mds-input-range-thumb-size);\n line-height: 0;\n -webkit-transform: translate(0, -50%);\n transform: translate(0, -50%);\n width: var(--mds-input-range-thumb-size);\n}\n\n.field::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n appearance: none;\n border: 0;\n height: 0;\n width: 100%;\n}\n\n.track-progress {\n -webkit-transition-duration: 300ms;\n transition-duration: 300ms;\n -webkit-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n\n background-color: var(--mds-input-range-track-progress-background);\n display: -ms-flexbox;\n display: flex;\n height: var(--mds-input-range-track-size);\n -webkit-transition-property: background-color;\n transition-property: background-color;\n}\n\n.track-total {\n -webkit-transition-duration: 300ms;\n transition-duration: 300ms;\n -webkit-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n\n background-color: var(--mds-input-range-track-background);\n border-radius: var(--mds-input-range-track-size);\n display: -ms-flexbox;\n display: flex;\n height: var(--mds-input-range-track-size);\n overflow: hidden;\n -webkit-transition-property: background-color;\n transition-property: background-color;\n width: 100%;\n}\n\n.contrast-area {\n margin-left: 0.25rem;\n margin-right: 0.25rem;\n\n border-radius: var(--mds-input-range-track-size);\n}\n\n@tailwind utilities;\n\n@container style(--magma-pref-animation: reduce) {\n :host,\n .field::-webkit-slider-thumb,\n .field::-webkit-slider-runnable-track,\n .track-progress,\n .track-total {\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n }\n}\n\n@container style(--magma-pref-animation: system) {\n\n @media (prefers-reduced-motion) {\n :host,\n .field::-webkit-slider-thumb,\n .field::-webkit-slider-runnable-track,\n .track-progress,\n .track-total {\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n }\n }\n}\n\n@tailwind utilities;\n\n@container style(--magma-pref-theme: dark) {\n :host {\n\n --mds-input-range-thumb-background: rgb(var(--variant-primary-04));\n --mds-input-range-track-background: rgb(var(--tone-neutral-07));\n --mds-input-range-track-progress-background: rgb(var(--variant-primary-05));\n }\n}\n\n@container style(--magma-pref-theme: system) {\n\n @media (prefers-color-scheme: dark) {\n :host {\n\n --mds-input-range-thumb-background: rgb(var(--variant-primary-04));\n --mds-input-range-track-background: rgb(var(--tone-neutral-07));\n --mds-input-range-track-progress-background: rgb(var(--variant-primary-05));\n }\n }\n}\n\n@container style(--magma-pref-contrast: more) {\n :host {\n color: rgb(var(--tone-neutral-01));\n }\n}\n\n@container style(--magma-pref-contrast: system) {\n\n @media (prefers-contrast: more) {\n :host {\n color: rgb(var(--tone-neutral-01));\n }\n }\n}\n\n\n";export{e as mds_input_range}
|