@spectrum-web-components/meter 0.6.11 → 0.6.14-devmode.0
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/package.json +23 -10
- package/sp-meter.dev.js +3 -0
- package/sp-meter.dev.js.map +7 -0
- package/sp-meter.js +3 -14
- package/sp-meter.js.map +7 -1
- package/src/Meter.dev.js +87 -0
- package/src/Meter.dev.js.map +7 -0
- package/src/Meter.js +71 -73
- package/src/Meter.js.map +7 -1
- package/src/index.dev.js +2 -0
- package/src/index.dev.js.map +7 -0
- package/src/index.js +2 -13
- package/src/index.js.map +7 -1
- package/src/meter.css.dev.js +94 -0
- package/src/meter.css.dev.js.map +7 -0
- package/src/meter.css.js +3 -14
- package/src/meter.css.js.map +7 -1
- package/src/spectrum-meter.css.dev.js +94 -0
- package/src/spectrum-meter.css.dev.js.map +7 -0
- package/src/spectrum-meter.css.js +3 -14
- package/src/spectrum-meter.css.js.map +7 -1
- package/stories/meter-sizes.stories.js +9 -20
- package/stories/meter-sizes.stories.js.map +7 -1
- package/stories/meter.stories.js +11 -22
- package/stories/meter.stories.js.map +7 -1
- package/test/benchmark/basic-test.js +5 -16
- package/test/benchmark/basic-test.js.map +7 -1
- package/test/meter-sizes.test-vrt.js +4 -15
- package/test/meter-sizes.test-vrt.js.map +7 -1
- package/test/meter.test-vrt.js +4 -15
- package/test/meter.test-vrt.js.map +7 -1
- package/test/meter.test.js +38 -49
- package/test/meter.test.js.map +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/meter",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.14-devmode.0+07474d44f",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -20,11 +20,24 @@
|
|
|
20
20
|
"module": "src/index.js",
|
|
21
21
|
"type": "module",
|
|
22
22
|
"exports": {
|
|
23
|
-
".":
|
|
24
|
-
|
|
23
|
+
".": {
|
|
24
|
+
"development": "./src/index.dev.js",
|
|
25
|
+
"default": "./src/index.js"
|
|
26
|
+
},
|
|
25
27
|
"./package.json": "./package.json",
|
|
26
|
-
"./
|
|
27
|
-
|
|
28
|
+
"./src/Meter.js": {
|
|
29
|
+
"development": "./src/Meter.dev.js",
|
|
30
|
+
"default": "./src/Meter.js"
|
|
31
|
+
},
|
|
32
|
+
"./src/index.js": {
|
|
33
|
+
"development": "./src/index.dev.js",
|
|
34
|
+
"default": "./src/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./src/meter.css.js": "./src/meter.css.js",
|
|
37
|
+
"./sp-meter.js": {
|
|
38
|
+
"development": "./sp-meter.dev.js",
|
|
39
|
+
"default": "./sp-meter.js"
|
|
40
|
+
}
|
|
28
41
|
},
|
|
29
42
|
"scripts": {
|
|
30
43
|
"test": "echo \"Error: run tests from mono-repo root.\" && exit 1"
|
|
@@ -44,18 +57,18 @@
|
|
|
44
57
|
"lit-html"
|
|
45
58
|
],
|
|
46
59
|
"dependencies": {
|
|
47
|
-
"@spectrum-web-components/base": "^0.5.
|
|
48
|
-
"@spectrum-web-components/field-label": "^0.7.
|
|
49
|
-
"@spectrum-web-components/shared": "^0.14.
|
|
60
|
+
"@spectrum-web-components/base": "^0.5.9-devmode.24+07474d44f",
|
|
61
|
+
"@spectrum-web-components/field-label": "^0.7.14-devmode.0+07474d44f",
|
|
62
|
+
"@spectrum-web-components/shared": "^0.14.5-devmode.0+07474d44f",
|
|
50
63
|
"tslib": "^2.0.0"
|
|
51
64
|
},
|
|
52
65
|
"devDependencies": {
|
|
53
|
-
"@spectrum-css/progressbar": "^1.0.
|
|
66
|
+
"@spectrum-css/progressbar": "^1.0.32"
|
|
54
67
|
},
|
|
55
68
|
"types": "./src/index.d.ts",
|
|
56
69
|
"customElements": "custom-elements.json",
|
|
57
70
|
"sideEffects": [
|
|
58
71
|
"./sp-*.js"
|
|
59
72
|
],
|
|
60
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "07474d44f6cee1db241b9ccf3dc812514ffbe7fa"
|
|
61
74
|
}
|
package/sp-meter.dev.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-meter.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { Meter } from './src/Meter.dev.js'\n\ncustomElements.define('sp-meter', Meter);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-meter': Meter;\n }\n}\n"],
|
|
5
|
+
"mappings": "AAYA;AAEA,eAAe,OAAO,YAAY,KAAK;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/sp-meter.js
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
import { Meter } from './src/Meter.js';
|
|
13
|
-
customElements.define('sp-meter', Meter);
|
|
14
|
-
//# sourceMappingURL=sp-meter.js.map
|
|
1
|
+
import { Meter } from "./src/Meter.js";
|
|
2
|
+
customElements.define("sp-meter", Meter);
|
|
3
|
+
//# sourceMappingURL=sp-meter.js.map
|
package/sp-meter.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-meter.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { Meter } from './src/Meter.js';\n\ncustomElements.define('sp-meter', Meter);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-meter': Meter;\n }\n}\n"],
|
|
5
|
+
"mappings": "AAYA;AAEA,eAAe,OAAO,YAAY,KAAK;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/src/Meter.dev.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result)
|
|
9
|
+
__defProp(target, key, result);
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
import {
|
|
13
|
+
html,
|
|
14
|
+
SizedMixin,
|
|
15
|
+
SpectrumElement
|
|
16
|
+
} from "@spectrum-web-components/base";
|
|
17
|
+
import { property } from "@spectrum-web-components/base/src/decorators.js";
|
|
18
|
+
import { ObserveSlotText } from "@spectrum-web-components/shared/src/observe-slot-text.js";
|
|
19
|
+
import "@spectrum-web-components/field-label/sp-field-label.js";
|
|
20
|
+
import styles from "./meter.css.js";
|
|
21
|
+
export class Meter extends SizedMixin(ObserveSlotText(SpectrumElement, "")) {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this.progress = 0;
|
|
25
|
+
this.overBackground = false;
|
|
26
|
+
this.notice = false;
|
|
27
|
+
this.negative = false;
|
|
28
|
+
this.positive = false;
|
|
29
|
+
this.label = "";
|
|
30
|
+
this.sideLabel = false;
|
|
31
|
+
}
|
|
32
|
+
static get styles() {
|
|
33
|
+
return [styles];
|
|
34
|
+
}
|
|
35
|
+
render() {
|
|
36
|
+
return html`
|
|
37
|
+
<sp-field-label size=${this.size} class="label">
|
|
38
|
+
${this.slotHasContent ? html`` : this.label}
|
|
39
|
+
<slot>${this.label}</slot>
|
|
40
|
+
</sp-field-label>
|
|
41
|
+
<sp-field-label size=${this.size} class="percentage">
|
|
42
|
+
${this.progress}%
|
|
43
|
+
</sp-field-label>
|
|
44
|
+
<div class="track">
|
|
45
|
+
<div
|
|
46
|
+
class="fill"
|
|
47
|
+
style="transform: scaleX(calc(${this.progress} / 100));"
|
|
48
|
+
></div>
|
|
49
|
+
</div>
|
|
50
|
+
`;
|
|
51
|
+
}
|
|
52
|
+
firstUpdated(changes) {
|
|
53
|
+
super.firstUpdated(changes);
|
|
54
|
+
this.setAttribute("role", "progressbar");
|
|
55
|
+
}
|
|
56
|
+
updated(changes) {
|
|
57
|
+
super.updated(changes);
|
|
58
|
+
if (changes.has("progress")) {
|
|
59
|
+
this.setAttribute("aria-valuenow", "" + this.progress);
|
|
60
|
+
}
|
|
61
|
+
if (this.label && changes.has("label")) {
|
|
62
|
+
this.setAttribute("aria-label", this.label);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
__decorateClass([
|
|
67
|
+
property({ type: Number })
|
|
68
|
+
], Meter.prototype, "progress", 2);
|
|
69
|
+
__decorateClass([
|
|
70
|
+
property({ type: Boolean, reflect: true, attribute: "over-background" })
|
|
71
|
+
], Meter.prototype, "overBackground", 2);
|
|
72
|
+
__decorateClass([
|
|
73
|
+
property({ type: Boolean, reflect: true })
|
|
74
|
+
], Meter.prototype, "notice", 2);
|
|
75
|
+
__decorateClass([
|
|
76
|
+
property({ type: Boolean, reflect: true })
|
|
77
|
+
], Meter.prototype, "negative", 2);
|
|
78
|
+
__decorateClass([
|
|
79
|
+
property({ type: Boolean, reflect: true })
|
|
80
|
+
], Meter.prototype, "positive", 2);
|
|
81
|
+
__decorateClass([
|
|
82
|
+
property({ type: String, reflect: true })
|
|
83
|
+
], Meter.prototype, "label", 2);
|
|
84
|
+
__decorateClass([
|
|
85
|
+
property({ type: Boolean, reflect: true, attribute: "side-label" })
|
|
86
|
+
], Meter.prototype, "sideLabel", 2);
|
|
87
|
+
//# sourceMappingURL=Meter.dev.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["Meter.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SizedMixin,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\n\nimport { ObserveSlotText } from '@spectrum-web-components/shared/src/observe-slot-text.js';\nimport '@spectrum-web-components/field-label/sp-field-label.js';\nimport styles from './meter.css.js';\n\n/**\n * @element sp-meter\n *\n * @slot - text labeling the Meter\n */\nexport class Meter extends SizedMixin(ObserveSlotText(SpectrumElement, '')) {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ type: Number })\n public progress = 0;\n\n @property({ type: Boolean, reflect: true, attribute: 'over-background' })\n public overBackground = false;\n\n @property({ type: Boolean, reflect: true })\n public notice = false;\n\n @property({ type: Boolean, reflect: true })\n public negative = false;\n\n @property({ type: Boolean, reflect: true })\n public positive = false;\n\n @property({ type: String, reflect: true })\n public label = '';\n\n @property({ type: Boolean, reflect: true, attribute: 'side-label' })\n // called sideLabel\n public sideLabel = false;\n\n protected override render(): TemplateResult {\n return html`\n <sp-field-label size=${this.size} class=\"label\">\n ${this.slotHasContent ? html`` : this.label}\n <slot>${this.label}</slot>\n </sp-field-label>\n <sp-field-label size=${this.size} class=\"percentage\">\n ${this.progress}%\n </sp-field-label>\n <div class=\"track\">\n <div\n class=\"fill\"\n style=\"transform: scaleX(calc(${this.progress} / 100));\"\n ></div>\n </div>\n `;\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n this.setAttribute('role', 'progressbar');\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (changes.has('progress')) {\n this.setAttribute('aria-valuenow', '' + this.progress);\n }\n if (this.label && changes.has('label')) {\n this.setAttribute('aria-label', this.label);\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAYA;AAAA;AAAA;AAAA;AAAA;AAQA;AAEA;AACA;AACA;AAOO,aAAM,cAAc,WAAW,gBAAgB,iBAAiB,EAAE,CAAC,EAAE;AAAA,EAArE;AAAA;AAMI,oBAAW;AAGX,0BAAiB;AAGjB,kBAAS;AAGT,oBAAW;AAGX,oBAAW;AAGX,iBAAQ;AAIR,qBAAY;AAAA;AAAA,aAxBQ,SAAyB;AAChD,WAAO,CAAC,MAAM;AAAA,EAClB;AAAA,EAwBmB,SAAyB;AACxC,WAAO;AAAA,mCACoB,KAAK;AAAA,kBACtB,KAAK,iBAAiB,SAAS,KAAK;AAAA,wBAC9B,KAAK;AAAA;AAAA,mCAEM,KAAK;AAAA,kBACtB,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,oDAK6B,KAAK;AAAA;AAAA;AAAA;AAAA,EAIrD;AAAA,EAEmB,aAAa,SAA+B;AAC3D,UAAM,aAAa,OAAO;AAC1B,SAAK,aAAa,QAAQ,aAAa;AAAA,EAC3C;AAAA,EAEmB,QAAQ,SAA+B;AACtD,UAAM,QAAQ,OAAO;AACrB,QAAI,QAAQ,IAAI,UAAU,GAAG;AACzB,WAAK,aAAa,iBAAiB,KAAK,KAAK,QAAQ;AAAA,IACzD;AACA,QAAI,KAAK,SAAS,QAAQ,IAAI,OAAO,GAAG;AACpC,WAAK,aAAa,cAAc,KAAK,KAAK;AAAA,IAC9C;AAAA,EACJ;AACJ;AArDW;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GACnB,AANJ,MAMI;AAGA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM,WAAW,kBAAkB,CAAC;AAAA,GACjE,AATJ,MASI;AAGA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AAZJ,MAYI;AAGA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AAfJ,MAeI;AAGA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AAlBJ,MAkBI;AAGA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AAAA,GAClC,AArBJ,MAqBI;AAIA;AAAA,EAFP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM,WAAW,aAAa,CAAC;AAAA,GAE5D,AAzBJ,MAyBI;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/src/Meter.js
CHANGED
|
@@ -1,43 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
render() {
|
|
38
|
-
return html `
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result)
|
|
9
|
+
__defProp(target, key, result);
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
import {
|
|
13
|
+
html,
|
|
14
|
+
SizedMixin,
|
|
15
|
+
SpectrumElement
|
|
16
|
+
} from "@spectrum-web-components/base";
|
|
17
|
+
import { property } from "@spectrum-web-components/base/src/decorators.js";
|
|
18
|
+
import { ObserveSlotText } from "@spectrum-web-components/shared/src/observe-slot-text.js";
|
|
19
|
+
import "@spectrum-web-components/field-label/sp-field-label.js";
|
|
20
|
+
import styles from "./meter.css.js";
|
|
21
|
+
export class Meter extends SizedMixin(ObserveSlotText(SpectrumElement, "")) {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this.progress = 0;
|
|
25
|
+
this.overBackground = false;
|
|
26
|
+
this.notice = false;
|
|
27
|
+
this.negative = false;
|
|
28
|
+
this.positive = false;
|
|
29
|
+
this.label = "";
|
|
30
|
+
this.sideLabel = false;
|
|
31
|
+
}
|
|
32
|
+
static get styles() {
|
|
33
|
+
return [styles];
|
|
34
|
+
}
|
|
35
|
+
render() {
|
|
36
|
+
return html`
|
|
39
37
|
<sp-field-label size=${this.size} class="label">
|
|
40
|
-
${this.slotHasContent ? html
|
|
38
|
+
${this.slotHasContent ? html`` : this.label}
|
|
41
39
|
<slot>${this.label}</slot>
|
|
42
40
|
</sp-field-label>
|
|
43
41
|
<sp-field-label size=${this.size} class="percentage">
|
|
@@ -50,40 +48,40 @@ export class Meter extends SizedMixin(ObserveSlotText(SpectrumElement, '')) {
|
|
|
50
48
|
></div>
|
|
51
49
|
</div>
|
|
52
50
|
`;
|
|
51
|
+
}
|
|
52
|
+
firstUpdated(changes) {
|
|
53
|
+
super.firstUpdated(changes);
|
|
54
|
+
this.setAttribute("role", "progressbar");
|
|
55
|
+
}
|
|
56
|
+
updated(changes) {
|
|
57
|
+
super.updated(changes);
|
|
58
|
+
if (changes.has("progress")) {
|
|
59
|
+
this.setAttribute("aria-valuenow", "" + this.progress);
|
|
53
60
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
this.setAttribute('role', 'progressbar');
|
|
57
|
-
}
|
|
58
|
-
updated(changes) {
|
|
59
|
-
super.updated(changes);
|
|
60
|
-
if (changes.has('progress')) {
|
|
61
|
-
this.setAttribute('aria-valuenow', '' + this.progress);
|
|
62
|
-
}
|
|
63
|
-
if (this.label && changes.has('label')) {
|
|
64
|
-
this.setAttribute('aria-label', this.label);
|
|
65
|
-
}
|
|
61
|
+
if (this.label && changes.has("label")) {
|
|
62
|
+
this.setAttribute("aria-label", this.label);
|
|
66
63
|
}
|
|
64
|
+
}
|
|
67
65
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
], Meter.prototype, "progress",
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
], Meter.prototype, "overBackground",
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
], Meter.prototype, "notice",
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
], Meter.prototype, "negative",
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
], Meter.prototype, "positive",
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
], Meter.prototype, "label",
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
], Meter.prototype, "sideLabel",
|
|
89
|
-
//# sourceMappingURL=Meter.js.map
|
|
66
|
+
__decorateClass([
|
|
67
|
+
property({ type: Number })
|
|
68
|
+
], Meter.prototype, "progress", 2);
|
|
69
|
+
__decorateClass([
|
|
70
|
+
property({ type: Boolean, reflect: true, attribute: "over-background" })
|
|
71
|
+
], Meter.prototype, "overBackground", 2);
|
|
72
|
+
__decorateClass([
|
|
73
|
+
property({ type: Boolean, reflect: true })
|
|
74
|
+
], Meter.prototype, "notice", 2);
|
|
75
|
+
__decorateClass([
|
|
76
|
+
property({ type: Boolean, reflect: true })
|
|
77
|
+
], Meter.prototype, "negative", 2);
|
|
78
|
+
__decorateClass([
|
|
79
|
+
property({ type: Boolean, reflect: true })
|
|
80
|
+
], Meter.prototype, "positive", 2);
|
|
81
|
+
__decorateClass([
|
|
82
|
+
property({ type: String, reflect: true })
|
|
83
|
+
], Meter.prototype, "label", 2);
|
|
84
|
+
__decorateClass([
|
|
85
|
+
property({ type: Boolean, reflect: true, attribute: "side-label" })
|
|
86
|
+
], Meter.prototype, "sideLabel", 2);
|
|
87
|
+
//# sourceMappingURL=Meter.js.map
|
package/src/Meter.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["Meter.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SizedMixin,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\n\nimport { ObserveSlotText } from '@spectrum-web-components/shared/src/observe-slot-text.js';\nimport '@spectrum-web-components/field-label/sp-field-label.js';\nimport styles from './meter.css.js';\n\n/**\n * @element sp-meter\n *\n * @slot - text labeling the Meter\n */\nexport class Meter extends SizedMixin(ObserveSlotText(SpectrumElement, '')) {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ type: Number })\n public progress = 0;\n\n @property({ type: Boolean, reflect: true, attribute: 'over-background' })\n public overBackground = false;\n\n @property({ type: Boolean, reflect: true })\n public notice = false;\n\n @property({ type: Boolean, reflect: true })\n public negative = false;\n\n @property({ type: Boolean, reflect: true })\n public positive = false;\n\n @property({ type: String, reflect: true })\n public label = '';\n\n @property({ type: Boolean, reflect: true, attribute: 'side-label' })\n // called sideLabel\n public sideLabel = false;\n\n protected override render(): TemplateResult {\n return html`\n <sp-field-label size=${this.size} class=\"label\">\n ${this.slotHasContent ? html`` : this.label}\n <slot>${this.label}</slot>\n </sp-field-label>\n <sp-field-label size=${this.size} class=\"percentage\">\n ${this.progress}%\n </sp-field-label>\n <div class=\"track\">\n <div\n class=\"fill\"\n style=\"transform: scaleX(calc(${this.progress} / 100));\"\n ></div>\n </div>\n `;\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n this.setAttribute('role', 'progressbar');\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (changes.has('progress')) {\n this.setAttribute('aria-valuenow', '' + this.progress);\n }\n if (this.label && changes.has('label')) {\n this.setAttribute('aria-label', this.label);\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAYA;AAAA;AAAA;AAAA;AAAA;AAQA;AAEA;AACA;AACA;AAOO,aAAM,cAAc,WAAW,gBAAgB,iBAAiB,EAAE,CAAC,EAAE;AAAA,EAArE;AAAA;AAMI,oBAAW;AAGX,0BAAiB;AAGjB,kBAAS;AAGT,oBAAW;AAGX,oBAAW;AAGX,iBAAQ;AAIR,qBAAY;AAAA;AAAA,aAxBQ,SAAyB;AAChD,WAAO,CAAC,MAAM;AAAA,EAClB;AAAA,EAwBmB,SAAyB;AACxC,WAAO;AAAA,mCACoB,KAAK;AAAA,kBACtB,KAAK,iBAAiB,SAAS,KAAK;AAAA,wBAC9B,KAAK;AAAA;AAAA,mCAEM,KAAK;AAAA,kBACtB,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,oDAK6B,KAAK;AAAA;AAAA;AAAA;AAAA,EAIrD;AAAA,EAEmB,aAAa,SAA+B;AAC3D,UAAM,aAAa,OAAO;AAC1B,SAAK,aAAa,QAAQ,aAAa;AAAA,EAC3C;AAAA,EAEmB,QAAQ,SAA+B;AACtD,UAAM,QAAQ,OAAO;AACrB,QAAI,QAAQ,IAAI,UAAU,GAAG;AACzB,WAAK,aAAa,iBAAiB,KAAK,KAAK,QAAQ;AAAA,IACzD;AACA,QAAI,KAAK,SAAS,QAAQ,IAAI,OAAO,GAAG;AACpC,WAAK,aAAa,cAAc,KAAK,KAAK;AAAA,IAC9C;AAAA,EACJ;AACJ;AArDW;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GACnB,AANJ,MAMI;AAGA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM,WAAW,kBAAkB,CAAC;AAAA,GACjE,AATJ,MASI;AAGA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AAZJ,MAYI;AAGA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AAfJ,MAeI;AAGA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AAlBJ,MAkBI;AAGA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AAAA,GAClC,AArBJ,MAqBI;AAIA;AAAA,EAFP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM,WAAW,aAAa,CAAC;AAAA,GAE5D,AAzBJ,MAyBI;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/src/index.dev.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["index.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport * from './Meter.dev.js'\n"],
|
|
5
|
+
"mappings": "AAYA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/src/index.js
CHANGED
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
export * from './Meter.js';
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export * from "./Meter.js";
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["index.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport * from './Meter.js';\n"],
|
|
5
|
+
"mappings": "AAYA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { css } from "@spectrum-web-components/base";
|
|
2
|
+
const styles = css`
|
|
3
|
+
:host([size=s]){--spectrum-progressbar-border-radius:var(
|
|
4
|
+
--spectrum-progressbar-s-border-radius
|
|
5
|
+
);--spectrum-progressbar-indeterminate-fill-width:var(
|
|
6
|
+
--spectrum-progressbar-s-indeterminate-fill-width,var(--spectrum-global-dimension-static-percent-70)
|
|
7
|
+
);--spectrum-progressbar-indeterminate-duration:var(
|
|
8
|
+
--spectrum-progressbar-s-indeterminate-duration,var(--spectrum-global-animation-duration-2000)
|
|
9
|
+
);--spectrum-progressbar-value-gap-y:var(
|
|
10
|
+
--spectrum-progressbar-s-value-gap-y,0px
|
|
11
|
+
);--spectrum-progressbar-height:var(
|
|
12
|
+
--spectrum-progressbar-s-height,var(--spectrum-global-dimension-size-50)
|
|
13
|
+
);--spectrum-progressbar-width:var(
|
|
14
|
+
--spectrum-progressbar-s-width,var(--spectrum-global-dimension-static-size-2400)
|
|
15
|
+
)}:host([size=m]){--spectrum-progressbar-border-radius:var(
|
|
16
|
+
--spectrum-progressbar-m-border-radius
|
|
17
|
+
);--spectrum-progressbar-indeterminate-fill-width:var(
|
|
18
|
+
--spectrum-progressbar-m-indeterminate-fill-width,var(--spectrum-global-dimension-static-percent-70)
|
|
19
|
+
);--spectrum-progressbar-indeterminate-duration:var(
|
|
20
|
+
--spectrum-progressbar-m-indeterminate-duration,var(--spectrum-global-animation-duration-2000)
|
|
21
|
+
);--spectrum-progressbar-value-gap-y:var(
|
|
22
|
+
--spectrum-progressbar-m-value-gap-y,0px
|
|
23
|
+
);--spectrum-progressbar-height:var(
|
|
24
|
+
--spectrum-progressbar-m-height,var(--spectrum-global-dimension-size-75)
|
|
25
|
+
);--spectrum-progressbar-width:var(
|
|
26
|
+
--spectrum-progressbar-m-width,var(--spectrum-global-dimension-static-size-2400)
|
|
27
|
+
);--spectrum-fieldlabel-side-padding-right:var(
|
|
28
|
+
--spectrum-fieldlabel-m-side-padding-right,var(--spectrum-global-dimension-size-150)
|
|
29
|
+
)}:host([size=l]){--spectrum-progressbar-indeterminate-fill-width:var(
|
|
30
|
+
--spectrum-progressbar-l-indeterminate-fill-width,var(--spectrum-global-dimension-static-percent-70)
|
|
31
|
+
);--spectrum-progressbar-indeterminate-duration:var(
|
|
32
|
+
--spectrum-progressbar-l-indeterminate-duration,var(--spectrum-global-animation-duration-2000)
|
|
33
|
+
);--spectrum-progressbar-value-gap-y:var(
|
|
34
|
+
--spectrum-progressbar-l-value-gap-y,0px
|
|
35
|
+
);--spectrum-progressbar-height:var(
|
|
36
|
+
--spectrum-progressbar-l-height,var(--spectrum-global-dimension-size-100)
|
|
37
|
+
);--spectrum-progressbar-border-radius:var(
|
|
38
|
+
--spectrum-progressbar-l-border-radius,var(--spectrum-global-dimension-size-50)
|
|
39
|
+
);--spectrum-progressbar-width:var(
|
|
40
|
+
--spectrum-progressbar-l-width,var(--spectrum-global-dimension-static-size-2500)
|
|
41
|
+
)}:host([size=xl]){--spectrum-progressbar-border-radius:var(
|
|
42
|
+
--spectrum-progressbar-xl-border-radius
|
|
43
|
+
);--spectrum-progressbar-indeterminate-fill-width:var(
|
|
44
|
+
--spectrum-progressbar-xl-indeterminate-fill-width,var(--spectrum-global-dimension-static-percent-70)
|
|
45
|
+
);--spectrum-progressbar-indeterminate-duration:var(
|
|
46
|
+
--spectrum-progressbar-xl-indeterminate-duration,var(--spectrum-global-animation-duration-2000)
|
|
47
|
+
);--spectrum-progressbar-value-gap-y:var(
|
|
48
|
+
--spectrum-progressbar-xl-value-gap-y,0px
|
|
49
|
+
);--spectrum-progressbar-height:var(
|
|
50
|
+
--spectrum-progressbar-xl-height,var(--spectrum-global-dimension-size-125)
|
|
51
|
+
);--spectrum-progressbar-width:var(
|
|
52
|
+
--spectrum-progressbar-xl-width,var(--spectrum-global-dimension-static-size-2800)
|
|
53
|
+
)}:host{align-items:center;display:inline-flex;flex-flow:row wrap;justify-content:space-between;position:relative;vertical-align:top;width:var(--spectrum-progressbar-width)}.track{border-radius:var(--spectrum-progressbar-border-radius);overflow:hidden;width:100%;z-index:1}.fill,.track{height:var(--spectrum-progressbar-height)}.fill{border:none;transition:width 1s}:host([dir=ltr]) .label,:host([dir=ltr]) .percentage{text-align:left}:host([dir=rtl]) .label,:host([dir=rtl]) .percentage{text-align:right}.label,.percentage{margin-bottom:var(
|
|
54
|
+
--spectrum-progressbar-value-gap-y
|
|
55
|
+
)}.label{flex:1 1 0%}:host([dir=ltr]) .percentage{margin-left:var(
|
|
56
|
+
--spectrum-fieldlabel-side-padding-right
|
|
57
|
+
)}:host([dir=rtl]) .percentage{margin-right:var(
|
|
58
|
+
--spectrum-fieldlabel-side-padding-right
|
|
59
|
+
)}.percentage{align-self:flex-start}:host([side-label]){display:inline-flex;flex-flow:row;justify-content:space-between;width:auto}:host([side-label]) .track{flex:1 1 var(--spectrum-progressbar-width);min-width:var(
|
|
60
|
+
--spectrum-progressbar-width
|
|
61
|
+
)}:host([dir=ltr][side-label]) .label{margin-right:var(
|
|
62
|
+
--spectrum-fieldlabel-side-padding-right
|
|
63
|
+
)}:host([dir=rtl][side-label]) .label{margin-left:var(
|
|
64
|
+
--spectrum-fieldlabel-side-padding-right
|
|
65
|
+
)}:host([side-label]) .label{flex-grow:0;margin-bottom:0}:host([dir=ltr][side-label]) .percentage{text-align:right}:host([dir=rtl][side-label]) .percentage{text-align:left}:host([dir=ltr][side-label]) .percentage{margin-left:var(
|
|
66
|
+
--spectrum-fieldlabel-side-padding-right
|
|
67
|
+
)}:host([dir=rtl][side-label]) .percentage{margin-right:var(
|
|
68
|
+
--spectrum-fieldlabel-side-padding-right
|
|
69
|
+
)}:host([side-label]) .percentage{margin-bottom:0;order:3}:host([indeterminate]) .fill{animation-timing-function:var(
|
|
70
|
+
--spectrum-progressbar-indeterminate-animation-ease
|
|
71
|
+
);position:relative;width:var(
|
|
72
|
+
--spectrum-progressbar-indeterminate-fill-width
|
|
73
|
+
);will-change:transform}:host([dir=ltr][indeterminate]) .fill{animation:indeterminate-loop-ltr var(--spectrum-progressbar-indeterminate-duration) infinite}:host([dir=rtl][indeterminate]) .fill{animation:indeterminate-loop-rtl var(--spectrum-progressbar-indeterminate-duration) infinite}@keyframes indeterminate-loop-ltr{0%{transform:translate(calc(var(--spectrum-progressbar-indeterminate-fill-width)*-1))}to{transform:translate(var(--spectrum-progressbar-width))}}@keyframes indeterminate-loop-rtl{0%{transform:translate(var(--spectrum-progressbar-width))}to{transform:translate(calc(var(--spectrum-progressbar-width)*-1))}}.fill{background:var(
|
|
74
|
+
--spectrum-progressbar-m-track-fill-color,var(--spectrum-semantic-informative-color-default)
|
|
75
|
+
)}.track{background-color:var(
|
|
76
|
+
--spectrum-progressbar-m-track-color,var(--spectrum-alias-track-color-default)
|
|
77
|
+
)}:host([over-background]) .fill{background:var(
|
|
78
|
+
--spectrum-progressbar-m-overbackground-track-fill-color,var(--spectrum-alias-track-fill-color-overbackground)
|
|
79
|
+
)}:host([over-background]) .label,:host([over-background]) .percentage{color:var(
|
|
80
|
+
--spectrum-progressbar-m-overbackground-track-fill-color,var(--spectrum-alias-track-fill-color-overbackground)
|
|
81
|
+
)}:host([over-background]) .track{background-color:var(
|
|
82
|
+
--spectrum-progressbar-m-overbackground-track-color,var(--spectrum-alias-track-color-overbackground)
|
|
83
|
+
)}:host([positive]) .fill{background:var(
|
|
84
|
+
--spectrum-meter-m-positive-track-fill-color,var(--spectrum-semantic-positive-status-color)
|
|
85
|
+
)}:host([notice]) .fill{background:var(
|
|
86
|
+
--spectrum-meter-m-notice-track-fill-color,var(--spectrum-semantic-notice-status-color)
|
|
87
|
+
)}:host([negative]) .fill{background:var(
|
|
88
|
+
--spectrum-meter-m-negative-track-fill-color,var(--spectrum-semantic-negative-status-color)
|
|
89
|
+
)}.label,.percentage{color:var(
|
|
90
|
+
--spectrum-fieldlabel-m-text-color,var(--spectrum-alias-label-text-color)
|
|
91
|
+
)}@media (forced-colors:active){.track{--spectrum-progressbar-m-track-fill-color:ButtonText;--spectrum-progressbar-m-track-color:ButtonFace;border:1px solid ButtonText;forced-color-adjust:none}}.fill{transform-origin:left}:host([dir=rtl]) .fill{transform-origin:right}
|
|
92
|
+
`;
|
|
93
|
+
export default styles;
|
|
94
|
+
//# sourceMappingURL=meter.css.dev.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["meter.css.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host([size=s]){--spectrum-progressbar-border-radius:var(\n--spectrum-progressbar-s-border-radius\n);--spectrum-progressbar-indeterminate-fill-width:var(\n--spectrum-progressbar-s-indeterminate-fill-width,var(--spectrum-global-dimension-static-percent-70)\n);--spectrum-progressbar-indeterminate-duration:var(\n--spectrum-progressbar-s-indeterminate-duration,var(--spectrum-global-animation-duration-2000)\n);--spectrum-progressbar-value-gap-y:var(\n--spectrum-progressbar-s-value-gap-y,0px\n);--spectrum-progressbar-height:var(\n--spectrum-progressbar-s-height,var(--spectrum-global-dimension-size-50)\n);--spectrum-progressbar-width:var(\n--spectrum-progressbar-s-width,var(--spectrum-global-dimension-static-size-2400)\n)}:host([size=m]){--spectrum-progressbar-border-radius:var(\n--spectrum-progressbar-m-border-radius\n);--spectrum-progressbar-indeterminate-fill-width:var(\n--spectrum-progressbar-m-indeterminate-fill-width,var(--spectrum-global-dimension-static-percent-70)\n);--spectrum-progressbar-indeterminate-duration:var(\n--spectrum-progressbar-m-indeterminate-duration,var(--spectrum-global-animation-duration-2000)\n);--spectrum-progressbar-value-gap-y:var(\n--spectrum-progressbar-m-value-gap-y,0px\n);--spectrum-progressbar-height:var(\n--spectrum-progressbar-m-height,var(--spectrum-global-dimension-size-75)\n);--spectrum-progressbar-width:var(\n--spectrum-progressbar-m-width,var(--spectrum-global-dimension-static-size-2400)\n);--spectrum-fieldlabel-side-padding-right:var(\n--spectrum-fieldlabel-m-side-padding-right,var(--spectrum-global-dimension-size-150)\n)}:host([size=l]){--spectrum-progressbar-indeterminate-fill-width:var(\n--spectrum-progressbar-l-indeterminate-fill-width,var(--spectrum-global-dimension-static-percent-70)\n);--spectrum-progressbar-indeterminate-duration:var(\n--spectrum-progressbar-l-indeterminate-duration,var(--spectrum-global-animation-duration-2000)\n);--spectrum-progressbar-value-gap-y:var(\n--spectrum-progressbar-l-value-gap-y,0px\n);--spectrum-progressbar-height:var(\n--spectrum-progressbar-l-height,var(--spectrum-global-dimension-size-100)\n);--spectrum-progressbar-border-radius:var(\n--spectrum-progressbar-l-border-radius,var(--spectrum-global-dimension-size-50)\n);--spectrum-progressbar-width:var(\n--spectrum-progressbar-l-width,var(--spectrum-global-dimension-static-size-2500)\n)}:host([size=xl]){--spectrum-progressbar-border-radius:var(\n--spectrum-progressbar-xl-border-radius\n);--spectrum-progressbar-indeterminate-fill-width:var(\n--spectrum-progressbar-xl-indeterminate-fill-width,var(--spectrum-global-dimension-static-percent-70)\n);--spectrum-progressbar-indeterminate-duration:var(\n--spectrum-progressbar-xl-indeterminate-duration,var(--spectrum-global-animation-duration-2000)\n);--spectrum-progressbar-value-gap-y:var(\n--spectrum-progressbar-xl-value-gap-y,0px\n);--spectrum-progressbar-height:var(\n--spectrum-progressbar-xl-height,var(--spectrum-global-dimension-size-125)\n);--spectrum-progressbar-width:var(\n--spectrum-progressbar-xl-width,var(--spectrum-global-dimension-static-size-2800)\n)}:host{align-items:center;display:inline-flex;flex-flow:row wrap;justify-content:space-between;position:relative;vertical-align:top;width:var(--spectrum-progressbar-width)}.track{border-radius:var(--spectrum-progressbar-border-radius);overflow:hidden;width:100%;z-index:1}.fill,.track{height:var(--spectrum-progressbar-height)}.fill{border:none;transition:width 1s}:host([dir=ltr]) .label,:host([dir=ltr]) .percentage{text-align:left}:host([dir=rtl]) .label,:host([dir=rtl]) .percentage{text-align:right}.label,.percentage{margin-bottom:var(\n--spectrum-progressbar-value-gap-y\n)}.label{flex:1 1 0%}:host([dir=ltr]) .percentage{margin-left:var(\n--spectrum-fieldlabel-side-padding-right\n)}:host([dir=rtl]) .percentage{margin-right:var(\n--spectrum-fieldlabel-side-padding-right\n)}.percentage{align-self:flex-start}:host([side-label]){display:inline-flex;flex-flow:row;justify-content:space-between;width:auto}:host([side-label]) .track{flex:1 1 var(--spectrum-progressbar-width);min-width:var(\n--spectrum-progressbar-width\n)}:host([dir=ltr][side-label]) .label{margin-right:var(\n--spectrum-fieldlabel-side-padding-right\n)}:host([dir=rtl][side-label]) .label{margin-left:var(\n--spectrum-fieldlabel-side-padding-right\n)}:host([side-label]) .label{flex-grow:0;margin-bottom:0}:host([dir=ltr][side-label]) .percentage{text-align:right}:host([dir=rtl][side-label]) .percentage{text-align:left}:host([dir=ltr][side-label]) .percentage{margin-left:var(\n--spectrum-fieldlabel-side-padding-right\n)}:host([dir=rtl][side-label]) .percentage{margin-right:var(\n--spectrum-fieldlabel-side-padding-right\n)}:host([side-label]) .percentage{margin-bottom:0;order:3}:host([indeterminate]) .fill{animation-timing-function:var(\n--spectrum-progressbar-indeterminate-animation-ease\n);position:relative;width:var(\n--spectrum-progressbar-indeterminate-fill-width\n);will-change:transform}:host([dir=ltr][indeterminate]) .fill{animation:indeterminate-loop-ltr var(--spectrum-progressbar-indeterminate-duration) infinite}:host([dir=rtl][indeterminate]) .fill{animation:indeterminate-loop-rtl var(--spectrum-progressbar-indeterminate-duration) infinite}@keyframes indeterminate-loop-ltr{0%{transform:translate(calc(var(--spectrum-progressbar-indeterminate-fill-width)*-1))}to{transform:translate(var(--spectrum-progressbar-width))}}@keyframes indeterminate-loop-rtl{0%{transform:translate(var(--spectrum-progressbar-width))}to{transform:translate(calc(var(--spectrum-progressbar-width)*-1))}}.fill{background:var(\n--spectrum-progressbar-m-track-fill-color,var(--spectrum-semantic-informative-color-default)\n)}.track{background-color:var(\n--spectrum-progressbar-m-track-color,var(--spectrum-alias-track-color-default)\n)}:host([over-background]) .fill{background:var(\n--spectrum-progressbar-m-overbackground-track-fill-color,var(--spectrum-alias-track-fill-color-overbackground)\n)}:host([over-background]) .label,:host([over-background]) .percentage{color:var(\n--spectrum-progressbar-m-overbackground-track-fill-color,var(--spectrum-alias-track-fill-color-overbackground)\n)}:host([over-background]) .track{background-color:var(\n--spectrum-progressbar-m-overbackground-track-color,var(--spectrum-alias-track-color-overbackground)\n)}:host([positive]) .fill{background:var(\n--spectrum-meter-m-positive-track-fill-color,var(--spectrum-semantic-positive-status-color)\n)}:host([notice]) .fill{background:var(\n--spectrum-meter-m-notice-track-fill-color,var(--spectrum-semantic-notice-status-color)\n)}:host([negative]) .fill{background:var(\n--spectrum-meter-m-negative-track-fill-color,var(--spectrum-semantic-negative-status-color)\n)}.label,.percentage{color:var(\n--spectrum-fieldlabel-m-text-color,var(--spectrum-alias-label-text-color)\n)}@media (forced-colors:active){.track{--spectrum-progressbar-m-track-fill-color:ButtonText;--spectrum-progressbar-m-track-color:ButtonFace;border:1px solid ButtonText;forced-color-adjust:none}}.fill{transform-origin:left}:host([dir=rtl]) .fill{transform-origin:right}\n`;\nexport default styles;"],
|
|
5
|
+
"mappings": "AAWA;AACA,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2Ff,eAAe;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/src/meter.css.js
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
governing permissions and limitations under the License.
|
|
11
|
-
*/
|
|
12
|
-
import { css } from '@spectrum-web-components/base';
|
|
13
|
-
const styles = css `
|
|
1
|
+
import { css } from "@spectrum-web-components/base";
|
|
2
|
+
const styles = css`
|
|
14
3
|
:host([size=s]){--spectrum-progressbar-border-radius:var(
|
|
15
4
|
--spectrum-progressbar-s-border-radius
|
|
16
5
|
);--spectrum-progressbar-indeterminate-fill-width:var(
|
|
@@ -102,4 +91,4 @@ const styles = css `
|
|
|
102
91
|
)}@media (forced-colors:active){.track{--spectrum-progressbar-m-track-fill-color:ButtonText;--spectrum-progressbar-m-track-color:ButtonFace;border:1px solid ButtonText;forced-color-adjust:none}}.fill{transform-origin:left}:host([dir=rtl]) .fill{transform-origin:right}
|
|
103
92
|
`;
|
|
104
93
|
export default styles;
|
|
105
|
-
//# sourceMappingURL=meter.css.js.map
|
|
94
|
+
//# sourceMappingURL=meter.css.js.map
|