UNPKG

46.4 kBJavaScriptView Raw
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://github.com/material-components/material-components-web/blob/master/LICENSE
7 */
8(function webpackUniversalModuleDefinition(root, factory) {
9 if(typeof exports === 'object' && typeof module === 'object')
10 module.exports = factory();
11 else if(typeof define === 'function' && define.amd)
12 define("@material/linear-progress", [], factory);
13 else if(typeof exports === 'object')
14 exports["linear-progress"] = factory();
15 else
16 root["mdc"] = root["mdc"] || {}, root["mdc"]["linear-progress"] = factory();
17})(this, function() {
18return /******/ (function(modules) { // webpackBootstrap
19/******/ // The module cache
20/******/ var installedModules = {};
21/******/
22/******/ // The require function
23/******/ function __webpack_require__(moduleId) {
24/******/
25/******/ // Check if module is in cache
26/******/ if(installedModules[moduleId]) {
27/******/ return installedModules[moduleId].exports;
28/******/ }
29/******/ // Create a new module (and put it into the cache)
30/******/ var module = installedModules[moduleId] = {
31/******/ i: moduleId,
32/******/ l: false,
33/******/ exports: {}
34/******/ };
35/******/
36/******/ // Execute the module function
37/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
38/******/
39/******/ // Flag the module as loaded
40/******/ module.l = true;
41/******/
42/******/ // Return the exports of the module
43/******/ return module.exports;
44/******/ }
45/******/
46/******/
47/******/ // expose the modules object (__webpack_modules__)
48/******/ __webpack_require__.m = modules;
49/******/
50/******/ // expose the module cache
51/******/ __webpack_require__.c = installedModules;
52/******/
53/******/ // define getter function for harmony exports
54/******/ __webpack_require__.d = function(exports, name, getter) {
55/******/ if(!__webpack_require__.o(exports, name)) {
56/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
57/******/ }
58/******/ };
59/******/
60/******/ // define __esModule on exports
61/******/ __webpack_require__.r = function(exports) {
62/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
63/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
64/******/ }
65/******/ Object.defineProperty(exports, '__esModule', { value: true });
66/******/ };
67/******/
68/******/ // create a fake namespace object
69/******/ // mode & 1: value is a module id, require it
70/******/ // mode & 2: merge all properties of value into the ns
71/******/ // mode & 4: return value when already ns object
72/******/ // mode & 8|1: behave like require
73/******/ __webpack_require__.t = function(value, mode) {
74/******/ if(mode & 1) value = __webpack_require__(value);
75/******/ if(mode & 8) return value;
76/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
77/******/ var ns = Object.create(null);
78/******/ __webpack_require__.r(ns);
79/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
80/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
81/******/ return ns;
82/******/ };
83/******/
84/******/ // getDefaultExport function for compatibility with non-harmony modules
85/******/ __webpack_require__.n = function(module) {
86/******/ var getter = module && module.__esModule ?
87/******/ function getDefault() { return module['default']; } :
88/******/ function getModuleExports() { return module; };
89/******/ __webpack_require__.d(getter, 'a', getter);
90/******/ return getter;
91/******/ };
92/******/
93/******/ // Object.prototype.hasOwnProperty.call
94/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
95/******/
96/******/ // __webpack_public_path__
97/******/ __webpack_require__.p = "";
98/******/
99/******/
100/******/ // Load entry module and return exports
101/******/ return __webpack_require__(__webpack_require__.s = "./packages/mdc-linear-progress/index.ts");
102/******/ })
103/************************************************************************/
104/******/ ({
105
106/***/ "./packages/mdc-animation/util.ts":
107/*!****************************************!*\
108 !*** ./packages/mdc-animation/util.ts ***!
109 \****************************************/
110/*! no static exports found */
111/***/ (function(module, exports, __webpack_require__) {
112
113"use strict";
114
115/**
116 * @license
117 * Copyright 2016 Google Inc.
118 *
119 * Permission is hereby granted, free of charge, to any person obtaining a copy
120 * of this software and associated documentation files (the "Software"), to deal
121 * in the Software without restriction, including without limitation the rights
122 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
123 * copies of the Software, and to permit persons to whom the Software is
124 * furnished to do so, subject to the following conditions:
125 *
126 * The above copyright notice and this permission notice shall be included in
127 * all copies or substantial portions of the Software.
128 *
129 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
130 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
131 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
132 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
133 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
134 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
135 * THE SOFTWARE.
136 */
137
138Object.defineProperty(exports, "__esModule", { value: true });
139exports.getCorrectEventName = exports.getCorrectPropertyName = void 0;
140var cssPropertyNameMap = {
141 animation: {
142 prefixed: '-webkit-animation',
143 standard: 'animation'
144 },
145 transform: {
146 prefixed: '-webkit-transform',
147 standard: 'transform'
148 },
149 transition: {
150 prefixed: '-webkit-transition',
151 standard: 'transition'
152 }
153};
154var jsEventTypeMap = {
155 animationend: {
156 cssProperty: 'animation',
157 prefixed: 'webkitAnimationEnd',
158 standard: 'animationend'
159 },
160 animationiteration: {
161 cssProperty: 'animation',
162 prefixed: 'webkitAnimationIteration',
163 standard: 'animationiteration'
164 },
165 animationstart: {
166 cssProperty: 'animation',
167 prefixed: 'webkitAnimationStart',
168 standard: 'animationstart'
169 },
170 transitionend: {
171 cssProperty: 'transition',
172 prefixed: 'webkitTransitionEnd',
173 standard: 'transitionend'
174 }
175};
176function isWindow(windowObj) {
177 return Boolean(windowObj.document) && typeof windowObj.document.createElement === 'function';
178}
179function getCorrectPropertyName(windowObj, cssProperty) {
180 if (isWindow(windowObj) && cssProperty in cssPropertyNameMap) {
181 var el = windowObj.document.createElement('div');
182 var _a = cssPropertyNameMap[cssProperty],
183 standard = _a.standard,
184 prefixed = _a.prefixed;
185 var isStandard = standard in el.style;
186 return isStandard ? standard : prefixed;
187 }
188 return cssProperty;
189}
190exports.getCorrectPropertyName = getCorrectPropertyName;
191function getCorrectEventName(windowObj, eventType) {
192 if (isWindow(windowObj) && eventType in jsEventTypeMap) {
193 var el = windowObj.document.createElement('div');
194 var _a = jsEventTypeMap[eventType],
195 standard = _a.standard,
196 prefixed = _a.prefixed,
197 cssProperty = _a.cssProperty;
198 var isStandard = cssProperty in el.style;
199 return isStandard ? standard : prefixed;
200 }
201 return eventType;
202}
203exports.getCorrectEventName = getCorrectEventName;
204
205/***/ }),
206
207/***/ "./packages/mdc-base/component.ts":
208/*!****************************************!*\
209 !*** ./packages/mdc-base/component.ts ***!
210 \****************************************/
211/*! no static exports found */
212/***/ (function(module, exports, __webpack_require__) {
213
214"use strict";
215
216/**
217 * @license
218 * Copyright 2016 Google Inc.
219 *
220 * Permission is hereby granted, free of charge, to any person obtaining a copy
221 * of this software and associated documentation files (the "Software"), to deal
222 * in the Software without restriction, including without limitation the rights
223 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
224 * copies of the Software, and to permit persons to whom the Software is
225 * furnished to do so, subject to the following conditions:
226 *
227 * The above copyright notice and this permission notice shall be included in
228 * all copies or substantial portions of the Software.
229 *
230 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
231 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
232 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
233 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
234 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
235 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
236 * THE SOFTWARE.
237 */
238
239var __read = this && this.__read || function (o, n) {
240 var m = typeof Symbol === "function" && o[Symbol.iterator];
241 if (!m) return o;
242 var i = m.call(o),
243 r,
244 ar = [],
245 e;
246 try {
247 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
248 ar.push(r.value);
249 }
250 } catch (error) {
251 e = { error: error };
252 } finally {
253 try {
254 if (r && !r.done && (m = i["return"])) m.call(i);
255 } finally {
256 if (e) throw e.error;
257 }
258 }
259 return ar;
260};
261var __spreadArray = this && this.__spreadArray || function (to, from) {
262 for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) {
263 to[j] = from[i];
264 }return to;
265};
266Object.defineProperty(exports, "__esModule", { value: true });
267exports.MDCComponent = void 0;
268var foundation_1 = __webpack_require__(/*! ./foundation */ "./packages/mdc-base/foundation.ts");
269var MDCComponent = /** @class */function () {
270 function MDCComponent(root, foundation) {
271 var args = [];
272 for (var _i = 2; _i < arguments.length; _i++) {
273 args[_i - 2] = arguments[_i];
274 }
275 this.root = root;
276 this.initialize.apply(this, __spreadArray([], __read(args)));
277 // Note that we initialize foundation here and not within the constructor's
278 // default param so that this.root is defined and can be used within the
279 // foundation class.
280 this.foundation = foundation === undefined ? this.getDefaultFoundation() : foundation;
281 this.foundation.init();
282 this.initialSyncWithDOM();
283 }
284 MDCComponent.attachTo = function (root) {
285 // Subclasses which extend MDCBase should provide an attachTo() method that takes a root element and
286 // returns an instantiated component with its root set to that element. Also note that in the cases of
287 // subclasses, an explicit foundation class will not have to be passed in; it will simply be initialized
288 // from getDefaultFoundation().
289 return new MDCComponent(root, new foundation_1.MDCFoundation({}));
290 };
291 /* istanbul ignore next: method param only exists for typing purposes; it does not need to be unit tested */
292 MDCComponent.prototype.initialize = function () {
293 var _args = [];
294 for (var _i = 0; _i < arguments.length; _i++) {
295 _args[_i] = arguments[_i];
296 }
297 // Subclasses can override this to do any additional setup work that would be considered part of a
298 // "constructor". Essentially, it is a hook into the parent constructor before the foundation is
299 // initialized. Any additional arguments besides root and foundation will be passed in here.
300 };
301 MDCComponent.prototype.getDefaultFoundation = function () {
302 // Subclasses must override this method to return a properly configured foundation class for the
303 // component.
304 throw new Error('Subclasses must override getDefaultFoundation to return a properly configured ' + 'foundation class');
305 };
306 MDCComponent.prototype.initialSyncWithDOM = function () {
307 // Subclasses should override this method if they need to perform work to synchronize with a host DOM
308 // object. An example of this would be a form control wrapper that needs to synchronize its internal state
309 // to some property or attribute of the host DOM. Please note: this is *not* the place to perform DOM
310 // reads/writes that would cause layout / paint, as this is called synchronously from within the constructor.
311 };
312 MDCComponent.prototype.destroy = function () {
313 // Subclasses may implement this method to release any resources / deregister any listeners they have
314 // attached. An example of this might be deregistering a resize event from the window object.
315 this.foundation.destroy();
316 };
317 MDCComponent.prototype.listen = function (evtType, handler, options) {
318 this.root.addEventListener(evtType, handler, options);
319 };
320 MDCComponent.prototype.unlisten = function (evtType, handler, options) {
321 this.root.removeEventListener(evtType, handler, options);
322 };
323 /**
324 * Fires a cross-browser-compatible custom event from the component root of the given type, with the given data.
325 */
326 MDCComponent.prototype.emit = function (evtType, evtData, shouldBubble) {
327 if (shouldBubble === void 0) {
328 shouldBubble = false;
329 }
330 var evt;
331 if (typeof CustomEvent === 'function') {
332 evt = new CustomEvent(evtType, {
333 bubbles: shouldBubble,
334 detail: evtData
335 });
336 } else {
337 evt = document.createEvent('CustomEvent');
338 evt.initCustomEvent(evtType, shouldBubble, false, evtData);
339 }
340 this.root.dispatchEvent(evt);
341 };
342 return MDCComponent;
343}();
344exports.MDCComponent = MDCComponent;
345// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.
346exports.default = MDCComponent;
347
348/***/ }),
349
350/***/ "./packages/mdc-base/foundation.ts":
351/*!*****************************************!*\
352 !*** ./packages/mdc-base/foundation.ts ***!
353 \*****************************************/
354/*! no static exports found */
355/***/ (function(module, exports, __webpack_require__) {
356
357"use strict";
358
359/**
360 * @license
361 * Copyright 2016 Google Inc.
362 *
363 * Permission is hereby granted, free of charge, to any person obtaining a copy
364 * of this software and associated documentation files (the "Software"), to deal
365 * in the Software without restriction, including without limitation the rights
366 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
367 * copies of the Software, and to permit persons to whom the Software is
368 * furnished to do so, subject to the following conditions:
369 *
370 * The above copyright notice and this permission notice shall be included in
371 * all copies or substantial portions of the Software.
372 *
373 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
374 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
375 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
376 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
377 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
378 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
379 * THE SOFTWARE.
380 */
381
382Object.defineProperty(exports, "__esModule", { value: true });
383exports.MDCFoundation = void 0;
384var MDCFoundation = /** @class */function () {
385 function MDCFoundation(adapter) {
386 if (adapter === void 0) {
387 adapter = {};
388 }
389 this.adapter = adapter;
390 }
391 Object.defineProperty(MDCFoundation, "cssClasses", {
392 get: function get() {
393 // Classes extending MDCFoundation should implement this method to return an object which exports every
394 // CSS class the foundation class needs as a property. e.g. {ACTIVE: 'mdc-component--active'}
395 return {};
396 },
397 enumerable: false,
398 configurable: true
399 });
400 Object.defineProperty(MDCFoundation, "strings", {
401 get: function get() {
402 // Classes extending MDCFoundation should implement this method to return an object which exports all
403 // semantic strings as constants. e.g. {ARIA_ROLE: 'tablist'}
404 return {};
405 },
406 enumerable: false,
407 configurable: true
408 });
409 Object.defineProperty(MDCFoundation, "numbers", {
410 get: function get() {
411 // Classes extending MDCFoundation should implement this method to return an object which exports all
412 // of its semantic numbers as constants. e.g. {ANIMATION_DELAY_MS: 350}
413 return {};
414 },
415 enumerable: false,
416 configurable: true
417 });
418 Object.defineProperty(MDCFoundation, "defaultAdapter", {
419 get: function get() {
420 // Classes extending MDCFoundation may choose to implement this getter in order to provide a convenient
421 // way of viewing the necessary methods of an adapter. In the future, this could also be used for adapter
422 // validation.
423 return {};
424 },
425 enumerable: false,
426 configurable: true
427 });
428 MDCFoundation.prototype.init = function () {
429 // Subclasses should override this method to perform initialization routines (registering events, etc.)
430 };
431 MDCFoundation.prototype.destroy = function () {
432 // Subclasses should override this method to perform de-initialization routines (de-registering events, etc.)
433 };
434 return MDCFoundation;
435}();
436exports.MDCFoundation = MDCFoundation;
437// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.
438exports.default = MDCFoundation;
439
440/***/ }),
441
442/***/ "./packages/mdc-linear-progress/adapter.ts":
443/*!*************************************************!*\
444 !*** ./packages/mdc-linear-progress/adapter.ts ***!
445 \*************************************************/
446/*! no static exports found */
447/***/ (function(module, exports, __webpack_require__) {
448
449"use strict";
450
451/**
452 * @license
453 * Copyright 2019 Google Inc.
454 *
455 * Permission is hereby granted, free of charge, to any person obtaining a copy
456 * of this software and associated documentation files (the "Software"), to deal
457 * in the Software without restriction, including without limitation the rights
458 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
459 * copies of the Software, and to permit persons to whom the Software is
460 * furnished to do so, subject to the following conditions:
461 *
462 * The above copyright notice and this permission notice shall be included in
463 * all copies or substantial portions of the Software.
464 *
465 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
466 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
467 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
468 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
469 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
470 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
471 * THE SOFTWARE.
472 */
473
474Object.defineProperty(exports, "__esModule", { value: true });
475
476/***/ }),
477
478/***/ "./packages/mdc-linear-progress/component.ts":
479/*!***************************************************!*\
480 !*** ./packages/mdc-linear-progress/component.ts ***!
481 \***************************************************/
482/*! no static exports found */
483/***/ (function(module, exports, __webpack_require__) {
484
485"use strict";
486
487/**
488 * @license
489 * Copyright 2017 Google Inc.
490 *
491 * Permission is hereby granted, free of charge, to any person obtaining a copy
492 * of this software and associated documentation files (the "Software"), to deal
493 * in the Software without restriction, including without limitation the rights
494 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
495 * copies of the Software, and to permit persons to whom the Software is
496 * furnished to do so, subject to the following conditions:
497 *
498 * The above copyright notice and this permission notice shall be included in
499 * all copies or substantial portions of the Software.
500 *
501 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
502 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
503 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
504 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
505 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
506 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
507 * THE SOFTWARE.
508 */
509
510var __extends = this && this.__extends || function () {
511 var _extendStatics = function extendStatics(d, b) {
512 _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
513 d.__proto__ = b;
514 } || function (d, b) {
515 for (var p in b) {
516 if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
517 }
518 };
519 return _extendStatics(d, b);
520 };
521 return function (d, b) {
522 if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
523 _extendStatics(d, b);
524 function __() {
525 this.constructor = d;
526 }
527 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
528 };
529}();
530Object.defineProperty(exports, "__esModule", { value: true });
531exports.MDCLinearProgress = void 0;
532var component_1 = __webpack_require__(/*! @material/base/component */ "./packages/mdc-base/component.ts");
533var foundation_1 = __webpack_require__(/*! ./foundation */ "./packages/mdc-linear-progress/foundation.ts");
534var MDCLinearProgress = /** @class */function (_super) {
535 __extends(MDCLinearProgress, _super);
536 function MDCLinearProgress() {
537 return _super !== null && _super.apply(this, arguments) || this;
538 }
539 MDCLinearProgress.attachTo = function (root) {
540 return new MDCLinearProgress(root);
541 };
542 Object.defineProperty(MDCLinearProgress.prototype, "determinate", {
543 set: function set(value) {
544 this.foundation.setDeterminate(value);
545 },
546 enumerable: false,
547 configurable: true
548 });
549 Object.defineProperty(MDCLinearProgress.prototype, "progress", {
550 set: function set(value) {
551 this.foundation.setProgress(value);
552 },
553 enumerable: false,
554 configurable: true
555 });
556 Object.defineProperty(MDCLinearProgress.prototype, "buffer", {
557 set: function set(value) {
558 this.foundation.setBuffer(value);
559 },
560 enumerable: false,
561 configurable: true
562 });
563 MDCLinearProgress.prototype.open = function () {
564 this.foundation.open();
565 };
566 MDCLinearProgress.prototype.close = function () {
567 this.foundation.close();
568 };
569 MDCLinearProgress.prototype.initialSyncWithDOM = function () {
570 var _this = this;
571 this.root.addEventListener('transitionend', function () {
572 _this.foundation.handleTransitionEnd();
573 });
574 };
575 MDCLinearProgress.prototype.getDefaultFoundation = function () {
576 var _this = this;
577 // DO NOT INLINE this variable. For backward compatibility, foundations take
578 // a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any
579 // methods, we need a separate, strongly typed adapter variable.
580 var adapter = {
581 addClass: function addClass(className) {
582 _this.root.classList.add(className);
583 },
584 forceLayout: function forceLayout() {
585 _this.root.getBoundingClientRect();
586 },
587 setBufferBarStyle: function setBufferBarStyle(styleProperty, value) {
588 var bufferBar = _this.root.querySelector(foundation_1.MDCLinearProgressFoundation.strings.BUFFER_BAR_SELECTOR);
589 if (bufferBar) {
590 bufferBar.style.setProperty(styleProperty, value);
591 }
592 },
593 setPrimaryBarStyle: function setPrimaryBarStyle(styleProperty, value) {
594 var primaryBar = _this.root.querySelector(foundation_1.MDCLinearProgressFoundation.strings.PRIMARY_BAR_SELECTOR);
595 if (primaryBar) {
596 primaryBar.style.setProperty(styleProperty, value);
597 }
598 },
599 hasClass: function hasClass(className) {
600 return _this.root.classList.contains(className);
601 },
602 removeAttribute: function removeAttribute(attributeName) {
603 _this.root.removeAttribute(attributeName);
604 },
605 removeClass: function removeClass(className) {
606 _this.root.classList.remove(className);
607 },
608 setAttribute: function setAttribute(attributeName, value) {
609 _this.root.setAttribute(attributeName, value);
610 },
611 setStyle: function setStyle(name, value) {
612 _this.root.style.setProperty(name, value);
613 },
614 attachResizeObserver: function attachResizeObserver(callback) {
615 var RO = window.ResizeObserver;
616 if (RO) {
617 var ro = new RO(callback);
618 ro.observe(_this.root);
619 return ro;
620 }
621 return null;
622 },
623 getWidth: function getWidth() {
624 return _this.root.offsetWidth;
625 }
626 };
627 return new foundation_1.MDCLinearProgressFoundation(adapter);
628 };
629 return MDCLinearProgress;
630}(component_1.MDCComponent);
631exports.MDCLinearProgress = MDCLinearProgress;
632
633/***/ }),
634
635/***/ "./packages/mdc-linear-progress/constants.ts":
636/*!***************************************************!*\
637 !*** ./packages/mdc-linear-progress/constants.ts ***!
638 \***************************************************/
639/*! no static exports found */
640/***/ (function(module, exports, __webpack_require__) {
641
642"use strict";
643
644/**
645 * @license
646 * Copyright 2017 Google Inc.
647 *
648 * Permission is hereby granted, free of charge, to any person obtaining a copy
649 * of this software and associated documentation files (the "Software"), to deal
650 * in the Software without restriction, including without limitation the rights
651 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
652 * copies of the Software, and to permit persons to whom the Software is
653 * furnished to do so, subject to the following conditions:
654 *
655 * The above copyright notice and this permission notice shall be included in
656 * all copies or substantial portions of the Software.
657 *
658 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
659 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
660 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
661 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
662 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
663 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
664 * THE SOFTWARE.
665 */
666
667Object.defineProperty(exports, "__esModule", { value: true });
668exports.animationDimensionPercentages = exports.strings = exports.cssClasses = void 0;
669exports.cssClasses = {
670 CLOSED_CLASS: 'mdc-linear-progress--closed',
671 CLOSED_ANIMATION_OFF_CLASS: 'mdc-linear-progress--closed-animation-off',
672 INDETERMINATE_CLASS: 'mdc-linear-progress--indeterminate',
673 REVERSED_CLASS: 'mdc-linear-progress--reversed',
674 ANIMATION_READY_CLASS: 'mdc-linear-progress--animation-ready'
675};
676exports.strings = {
677 ARIA_HIDDEN: 'aria-hidden',
678 ARIA_VALUEMAX: 'aria-valuemax',
679 ARIA_VALUEMIN: 'aria-valuemin',
680 ARIA_VALUENOW: 'aria-valuenow',
681 BUFFER_BAR_SELECTOR: '.mdc-linear-progress__buffer-bar',
682 FLEX_BASIS: 'flex-basis',
683 PRIMARY_BAR_SELECTOR: '.mdc-linear-progress__primary-bar'
684};
685// these are percentages pulled from keyframes.scss
686exports.animationDimensionPercentages = {
687 PRIMARY_HALF: .8367142,
688 PRIMARY_FULL: 2.00611057,
689 SECONDARY_QUARTER: .37651913,
690 SECONDARY_HALF: .84386165,
691 SECONDARY_FULL: 1.60277782
692};
693
694/***/ }),
695
696/***/ "./packages/mdc-linear-progress/foundation.ts":
697/*!****************************************************!*\
698 !*** ./packages/mdc-linear-progress/foundation.ts ***!
699 \****************************************************/
700/*! no static exports found */
701/***/ (function(module, exports, __webpack_require__) {
702
703"use strict";
704
705/**
706 * @license
707 * Copyright 2017 Google Inc.
708 *
709 * Permission is hereby granted, free of charge, to any person obtaining a copy
710 * of this software and associated documentation files (the "Software"), to deal
711 * in the Software without restriction, including without limitation the rights
712 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
713 * copies of the Software, and to permit persons to whom the Software is
714 * furnished to do so, subject to the following conditions:
715 *
716 * The above copyright notice and this permission notice shall be included in
717 * all copies or substantial portions of the Software.
718 *
719 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
720 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
721 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
722 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
723 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
724 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
725 * THE SOFTWARE.
726 */
727
728var __extends = this && this.__extends || function () {
729 var _extendStatics = function extendStatics(d, b) {
730 _extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
731 d.__proto__ = b;
732 } || function (d, b) {
733 for (var p in b) {
734 if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
735 }
736 };
737 return _extendStatics(d, b);
738 };
739 return function (d, b) {
740 if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
741 _extendStatics(d, b);
742 function __() {
743 this.constructor = d;
744 }
745 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
746 };
747}();
748var __assign = this && this.__assign || function () {
749 __assign = Object.assign || function (t) {
750 for (var s, i = 1, n = arguments.length; i < n; i++) {
751 s = arguments[i];
752 for (var p in s) {
753 if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
754 }
755 }
756 return t;
757 };
758 return __assign.apply(this, arguments);
759};
760var __values = this && this.__values || function (o) {
761 var s = typeof Symbol === "function" && Symbol.iterator,
762 m = s && o[s],
763 i = 0;
764 if (m) return m.call(o);
765 if (o && typeof o.length === "number") return {
766 next: function next() {
767 if (o && i >= o.length) o = void 0;
768 return { value: o && o[i++], done: !o };
769 }
770 };
771 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
772};
773Object.defineProperty(exports, "__esModule", { value: true });
774exports.MDCLinearProgressFoundation = void 0;
775var util_1 = __webpack_require__(/*! @material/animation/util */ "./packages/mdc-animation/util.ts");
776var foundation_1 = __webpack_require__(/*! @material/base/foundation */ "./packages/mdc-base/foundation.ts");
777var constants_1 = __webpack_require__(/*! ./constants */ "./packages/mdc-linear-progress/constants.ts");
778var MDCLinearProgressFoundation = /** @class */function (_super) {
779 __extends(MDCLinearProgressFoundation, _super);
780 function MDCLinearProgressFoundation(adapter) {
781 var _this = _super.call(this, __assign(__assign({}, MDCLinearProgressFoundation.defaultAdapter), adapter)) || this;
782 _this.observer = null;
783 return _this;
784 }
785 Object.defineProperty(MDCLinearProgressFoundation, "cssClasses", {
786 get: function get() {
787 return constants_1.cssClasses;
788 },
789 enumerable: false,
790 configurable: true
791 });
792 Object.defineProperty(MDCLinearProgressFoundation, "strings", {
793 get: function get() {
794 return constants_1.strings;
795 },
796 enumerable: false,
797 configurable: true
798 });
799 Object.defineProperty(MDCLinearProgressFoundation, "defaultAdapter", {
800 get: function get() {
801 return {
802 addClass: function addClass() {
803 return undefined;
804 },
805 attachResizeObserver: function attachResizeObserver() {
806 return null;
807 },
808 forceLayout: function forceLayout() {
809 return undefined;
810 },
811 getWidth: function getWidth() {
812 return 0;
813 },
814 hasClass: function hasClass() {
815 return false;
816 },
817 setBufferBarStyle: function setBufferBarStyle() {
818 return null;
819 },
820 setPrimaryBarStyle: function setPrimaryBarStyle() {
821 return null;
822 },
823 setStyle: function setStyle() {
824 return undefined;
825 },
826 removeAttribute: function removeAttribute() {
827 return undefined;
828 },
829 removeClass: function removeClass() {
830 return undefined;
831 },
832 setAttribute: function setAttribute() {
833 return undefined;
834 }
835 };
836 },
837 enumerable: false,
838 configurable: true
839 });
840 MDCLinearProgressFoundation.prototype.init = function () {
841 var _this = this;
842 this.determinate = !this.adapter.hasClass(constants_1.cssClasses.INDETERMINATE_CLASS);
843 this.adapter.addClass(constants_1.cssClasses.ANIMATION_READY_CLASS);
844 this.progress = 0;
845 this.buffer = 1;
846 this.observer = this.adapter.attachResizeObserver(function (entries) {
847 var e_1, _a;
848 if (_this.determinate) {
849 return;
850 }
851 try {
852 for (var entries_1 = __values(entries), entries_1_1 = entries_1.next(); !entries_1_1.done; entries_1_1 = entries_1.next()) {
853 var entry = entries_1_1.value;
854 if (entry.contentRect) {
855 _this.calculateAndSetDimensions(entry.contentRect.width);
856 }
857 }
858 } catch (e_1_1) {
859 e_1 = { error: e_1_1 };
860 } finally {
861 try {
862 if (entries_1_1 && !entries_1_1.done && (_a = entries_1.return)) _a.call(entries_1);
863 } finally {
864 if (e_1) throw e_1.error;
865 }
866 }
867 });
868 if (!this.determinate && this.observer) {
869 this.calculateAndSetDimensions(this.adapter.getWidth());
870 }
871 };
872 MDCLinearProgressFoundation.prototype.setDeterminate = function (isDeterminate) {
873 this.determinate = isDeterminate;
874 if (this.determinate) {
875 this.adapter.removeClass(constants_1.cssClasses.INDETERMINATE_CLASS);
876 this.adapter.setAttribute(constants_1.strings.ARIA_VALUENOW, this.progress.toString());
877 this.adapter.setAttribute(constants_1.strings.ARIA_VALUEMAX, '1');
878 this.adapter.setAttribute(constants_1.strings.ARIA_VALUEMIN, '0');
879 this.setPrimaryBarProgress(this.progress);
880 this.setBufferBarProgress(this.buffer);
881 return;
882 }
883 if (this.observer) {
884 this.calculateAndSetDimensions(this.adapter.getWidth());
885 }
886 this.adapter.addClass(constants_1.cssClasses.INDETERMINATE_CLASS);
887 this.adapter.removeAttribute(constants_1.strings.ARIA_VALUENOW);
888 this.adapter.removeAttribute(constants_1.strings.ARIA_VALUEMAX);
889 this.adapter.removeAttribute(constants_1.strings.ARIA_VALUEMIN);
890 this.setPrimaryBarProgress(1);
891 this.setBufferBarProgress(1);
892 };
893 MDCLinearProgressFoundation.prototype.isDeterminate = function () {
894 return this.determinate;
895 };
896 MDCLinearProgressFoundation.prototype.setProgress = function (value) {
897 this.progress = value;
898 if (this.determinate) {
899 this.setPrimaryBarProgress(value);
900 this.adapter.setAttribute(constants_1.strings.ARIA_VALUENOW, value.toString());
901 }
902 };
903 MDCLinearProgressFoundation.prototype.getProgress = function () {
904 return this.progress;
905 };
906 MDCLinearProgressFoundation.prototype.setBuffer = function (value) {
907 this.buffer = value;
908 if (this.determinate) {
909 this.setBufferBarProgress(value);
910 }
911 };
912 MDCLinearProgressFoundation.prototype.getBuffer = function () {
913 return this.buffer;
914 };
915 MDCLinearProgressFoundation.prototype.open = function () {
916 this.adapter.removeClass(constants_1.cssClasses.CLOSED_CLASS);
917 this.adapter.removeClass(constants_1.cssClasses.CLOSED_ANIMATION_OFF_CLASS);
918 this.adapter.removeAttribute(constants_1.strings.ARIA_HIDDEN);
919 };
920 MDCLinearProgressFoundation.prototype.close = function () {
921 this.adapter.addClass(constants_1.cssClasses.CLOSED_CLASS);
922 this.adapter.setAttribute(constants_1.strings.ARIA_HIDDEN, 'true');
923 };
924 MDCLinearProgressFoundation.prototype.isClosed = function () {
925 return this.adapter.hasClass(constants_1.cssClasses.CLOSED_CLASS);
926 };
927 /**
928 * Handles the transitionend event emitted after `close()` is called and the
929 * opacity fades out. This is so that animations are removed only after the
930 * progress indicator is completely hidden.
931 */
932 MDCLinearProgressFoundation.prototype.handleTransitionEnd = function () {
933 if (this.adapter.hasClass(constants_1.cssClasses.CLOSED_CLASS)) {
934 this.adapter.addClass(constants_1.cssClasses.CLOSED_ANIMATION_OFF_CLASS);
935 }
936 };
937 MDCLinearProgressFoundation.prototype.destroy = function () {
938 _super.prototype.destroy.call(this);
939 if (this.observer) {
940 this.observer.disconnect();
941 }
942 };
943 MDCLinearProgressFoundation.prototype.restartAnimation = function () {
944 this.adapter.removeClass(constants_1.cssClasses.ANIMATION_READY_CLASS);
945 this.adapter.forceLayout();
946 this.adapter.addClass(constants_1.cssClasses.ANIMATION_READY_CLASS);
947 };
948 MDCLinearProgressFoundation.prototype.setPrimaryBarProgress = function (progressValue) {
949 var value = "scaleX(" + progressValue + ")";
950 // Accessing `window` without a `typeof` check will throw on Node
951 // environments.
952 var transformProp = typeof window !== 'undefined' ? util_1.getCorrectPropertyName(window, 'transform') : 'transform';
953 this.adapter.setPrimaryBarStyle(transformProp, value);
954 };
955 MDCLinearProgressFoundation.prototype.setBufferBarProgress = function (progressValue) {
956 var value = progressValue * 100 + "%";
957 this.adapter.setBufferBarStyle(constants_1.strings.FLEX_BASIS, value);
958 };
959 MDCLinearProgressFoundation.prototype.calculateAndSetDimensions = function (width) {
960 var primaryHalf = width * constants_1.animationDimensionPercentages.PRIMARY_HALF;
961 var primaryFull = width * constants_1.animationDimensionPercentages.PRIMARY_FULL;
962 var secondaryQuarter = width * constants_1.animationDimensionPercentages.SECONDARY_QUARTER;
963 var secondaryHalf = width * constants_1.animationDimensionPercentages.SECONDARY_HALF;
964 var secondaryFull = width * constants_1.animationDimensionPercentages.SECONDARY_FULL;
965 this.adapter.setStyle('--mdc-linear-progress-primary-half', primaryHalf + "px");
966 this.adapter.setStyle('--mdc-linear-progress-primary-half-neg', -primaryHalf + "px");
967 this.adapter.setStyle('--mdc-linear-progress-primary-full', primaryFull + "px");
968 this.adapter.setStyle('--mdc-linear-progress-primary-full-neg', -primaryFull + "px");
969 this.adapter.setStyle('--mdc-linear-progress-secondary-quarter', secondaryQuarter + "px");
970 this.adapter.setStyle('--mdc-linear-progress-secondary-quarter-neg', -secondaryQuarter + "px");
971 this.adapter.setStyle('--mdc-linear-progress-secondary-half', secondaryHalf + "px");
972 this.adapter.setStyle('--mdc-linear-progress-secondary-half-neg', -secondaryHalf + "px");
973 this.adapter.setStyle('--mdc-linear-progress-secondary-full', secondaryFull + "px");
974 this.adapter.setStyle('--mdc-linear-progress-secondary-full-neg', -secondaryFull + "px");
975 // need to restart animation for custom props to apply to keyframes
976 this.restartAnimation();
977 };
978 return MDCLinearProgressFoundation;
979}(foundation_1.MDCFoundation);
980exports.MDCLinearProgressFoundation = MDCLinearProgressFoundation;
981// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.
982exports.default = MDCLinearProgressFoundation;
983
984/***/ }),
985
986/***/ "./packages/mdc-linear-progress/index.ts":
987/*!***********************************************!*\
988 !*** ./packages/mdc-linear-progress/index.ts ***!
989 \***********************************************/
990/*! no static exports found */
991/***/ (function(module, exports, __webpack_require__) {
992
993"use strict";
994
995/**
996 * @license
997 * Copyright 2019 Google Inc.
998 *
999 * Permission is hereby granted, free of charge, to any person obtaining a copy
1000 * of this software and associated documentation files (the "Software"), to deal
1001 * in the Software without restriction, including without limitation the rights
1002 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1003 * copies of the Software, and to permit persons to whom the Software is
1004 * furnished to do so, subject to the following conditions:
1005 *
1006 * The above copyright notice and this permission notice shall be included in
1007 * all copies or substantial portions of the Software.
1008 *
1009 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1010 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1011 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1012 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1013 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1014 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1015 * THE SOFTWARE.
1016 */
1017
1018var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
1019 if (k2 === undefined) k2 = k;
1020 Object.defineProperty(o, k2, { enumerable: true, get: function get() {
1021 return m[k];
1022 } });
1023} : function (o, m, k, k2) {
1024 if (k2 === undefined) k2 = k;
1025 o[k2] = m[k];
1026});
1027var __exportStar = this && this.__exportStar || function (m, exports) {
1028 for (var p in m) {
1029 if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1030 }
1031};
1032Object.defineProperty(exports, "__esModule", { value: true });
1033__exportStar(__webpack_require__(/*! ./adapter */ "./packages/mdc-linear-progress/adapter.ts"), exports);
1034__exportStar(__webpack_require__(/*! ./component */ "./packages/mdc-linear-progress/component.ts"), exports);
1035__exportStar(__webpack_require__(/*! ./constants */ "./packages/mdc-linear-progress/constants.ts"), exports);
1036__exportStar(__webpack_require__(/*! ./foundation */ "./packages/mdc-linear-progress/foundation.ts"), exports);
1037__exportStar(__webpack_require__(/*! ./types */ "./packages/mdc-linear-progress/types.ts"), exports);
1038
1039/***/ }),
1040
1041/***/ "./packages/mdc-linear-progress/types.ts":
1042/*!***********************************************!*\
1043 !*** ./packages/mdc-linear-progress/types.ts ***!
1044 \***********************************************/
1045/*! no static exports found */
1046/***/ (function(module, exports, __webpack_require__) {
1047
1048"use strict";
1049
1050/**
1051 * @license
1052 * Copyright 2021 Google Inc.
1053 *
1054 * Permission is hereby granted, free of charge, to any person obtaining a copy
1055 * of this software and associated documentation files (the "Software"), to deal
1056 * in the Software without restriction, including without limitation the rights
1057 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1058 * copies of the Software, and to permit persons to whom the Software is
1059 * furnished to do so, subject to the following conditions:
1060 *
1061 * The above copyright notice and this permission notice shall be included in
1062 * all copies or substantial portions of the Software.
1063 *
1064 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1065 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1066 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1067 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1068 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1069 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1070 * THE SOFTWARE.
1071 */
1072
1073Object.defineProperty(exports, "__esModule", { value: true });
1074
1075/***/ })
1076
1077/******/ });
1078});
1079//# sourceMappingURL=mdc.linearProgress.js.map
\No newline at end of file