@spectrum-web-components/progress-bar 0.4.1 → 0.5.3-express.0
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +5 -5
- package/src/ProgressBar.d.ts +1 -1
- package/src/ProgressBar.js +2 -1
- package/src/ProgressBar.js.map +1 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@spectrum-web-components/progress-bar",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.5.3-express.0+5d9e2a2ca",
|
4
4
|
"publishConfig": {
|
5
5
|
"access": "public"
|
6
6
|
},
|
@@ -44,17 +44,17 @@
|
|
44
44
|
"lit-html"
|
45
45
|
],
|
46
46
|
"dependencies": {
|
47
|
-
"@spectrum-web-components/base": "^0.
|
48
|
-
"@spectrum-web-components/field-label": "^0.
|
47
|
+
"@spectrum-web-components/base": "^0.5.2-express.41+5d9e2a2ca",
|
48
|
+
"@spectrum-web-components/field-label": "^0.7.3-express.0+5d9e2a2ca",
|
49
49
|
"tslib": "^2.0.0"
|
50
50
|
},
|
51
51
|
"devDependencies": {
|
52
|
-
"@spectrum-css/progressbar": "
|
52
|
+
"@spectrum-css/progressbar": "latest"
|
53
53
|
},
|
54
54
|
"types": "./src/index.d.ts",
|
55
55
|
"customElements": "custom-elements.json",
|
56
56
|
"sideEffects": [
|
57
57
|
"./sp-*.js"
|
58
58
|
],
|
59
|
-
"gitHead": "
|
59
|
+
"gitHead": "5d9e2a2ca93deff51e4b2c7b8354f1127009a4e3"
|
60
60
|
}
|
package/src/ProgressBar.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { CSSResultArray, PropertyValues, SpectrumElement, TemplateResult } from '@spectrum-web-components/base';
|
2
2
|
import '@spectrum-web-components/field-label/sp-field-label.js';
|
3
3
|
declare const ProgressBar_base: typeof SpectrumElement & {
|
4
4
|
new (...args: any[]): import("@spectrum-web-components/base").SizedElementInterface;
|
package/src/ProgressBar.js
CHANGED
@@ -10,7 +10,8 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
10
10
|
governing permissions and limitations under the License.
|
11
11
|
*/
|
12
12
|
import { __decorate } from "tslib";
|
13
|
-
import { html,
|
13
|
+
import { html, SizedMixin, SpectrumElement, } from '@spectrum-web-components/base';
|
14
|
+
import { property } from '@spectrum-web-components/base/src/decorators.js';
|
14
15
|
import '@spectrum-web-components/field-label/sp-field-label.js';
|
15
16
|
import styles from './progress-bar.css.js';
|
16
17
|
/**
|
package/src/ProgressBar.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ProgressBar.js","sourceRoot":"","sources":["ProgressBar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,
|
1
|
+
{"version":3,"file":"ProgressBar.js","sourceRoot":"","sources":["ProgressBar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAEH,IAAI,EAEJ,UAAU,EACV,eAAe,GAElB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAE3E,OAAO,wDAAwD,CAAC;AAChE,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAE3C;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,UAAU,CAAC,eAAe,CAAC;IAA5D;;QAMW,kBAAa,GAAG,KAAK,CAAC;QAGtB,UAAK,GAAG,EAAE,CAAC;QAGX,mBAAc,GAAG,KAAK,CAAC;QAGvB,cAAS,GAAG,KAAK,CAAC;QAGlB,aAAQ,GAAG,CAAC,CAAC;IAyDxB,CAAC;IA1EU,MAAM,KAAK,MAAM;QACpB,OAAO,CAAC,MAAM,CAAC,CAAC;IACpB,CAAC;IAiBS,MAAM;QACZ,OAAO,IAAI,CAAA;cACL,IAAI,CAAC,KAAK;YACR,CAAC,CAAC,IAAI,CAAA;6CACuB,IAAI,CAAC,IAAI;4BAC1B,IAAI,CAAC,KAAK;;wBAEd,IAAI,CAAC,aAAa;gBAChB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AY,CAAC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;SAC/C;IACL,CAAC;CACJ;AArEG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDACd;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CACT;AAGlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;mDAC3C;AAG9B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;8CAC3C;AAGzB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CACP","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 '@spectrum-web-components/field-label/sp-field-label.js';\nimport styles from './progress-bar.css.js';\n\n/**\n * @element sp-progress-bar\n */\nexport class ProgressBar extends SizedMixin(SpectrumElement) {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ type: Boolean, reflect: true })\n public indeterminate = false;\n\n @property({ type: String })\n public label = '';\n\n @property({ type: Boolean, reflect: true, attribute: 'over-background' })\n public overBackground = false;\n\n @property({ type: Boolean, reflect: true, attribute: 'side-label' })\n public sideLabel = false;\n\n @property({ type: Number })\n public progress = 0;\n\n protected render(): TemplateResult {\n return html`\n ${this.label\n ? html`\n <sp-field-label size=${this.size} class=\"label\">\n ${this.label}\n </sp-field-label>\n ${this.indeterminate\n ? html``\n : html`\n <sp-field-label\n size=${this.size}\n class=\"percentage\"\n >\n ${this.progress}%\n </sp-field-label>\n `}\n `\n : html``}\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 firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'progressbar');\n }\n }\n\n protected updated(changes: PropertyValues): void {\n super.updated(changes);\n if (changes.has('indeterminate')) {\n if (this.indeterminate) {\n this.removeAttribute('aria-valuemin');\n this.removeAttribute('aria-valuemax');\n } else {\n this.setAttribute('aria-valuemin', '0');\n this.setAttribute('aria-valuemax', '100');\n }\n }\n if (!this.indeterminate && changes.has('progress')) {\n this.setAttribute('aria-valuenow', '' + this.progress);\n } else if (this.hasAttribute('aria-valuenow')) {\n this.removeAttribute('aria-valuenow');\n }\n if (this.label && changes.has('label')) {\n this.setAttribute('aria-label', this.label);\n }\n }\n}\n"]}
|