1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
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() {
|
18 | return (function(modules) {
|
19 |
|
20 | var installedModules = {};
|
21 |
|
22 |
|
23 | function __webpack_require__(moduleId) {
|
24 |
|
25 |
|
26 | if(installedModules[moduleId]) {
|
27 | return installedModules[moduleId].exports;
|
28 | }
|
29 |
|
30 | var module = installedModules[moduleId] = {
|
31 | i: moduleId,
|
32 | l: false,
|
33 | exports: {}
|
34 | };
|
35 |
|
36 |
|
37 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
38 |
|
39 |
|
40 | module.l = true;
|
41 |
|
42 |
|
43 | return module.exports;
|
44 | }
|
45 |
|
46 |
|
47 |
|
48 | __webpack_require__.m = modules;
|
49 |
|
50 |
|
51 | __webpack_require__.c = installedModules;
|
52 |
|
53 |
|
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 |
|
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 |
|
69 |
|
70 |
|
71 |
|
72 |
|
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 |
|
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 |
|
94 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
95 |
|
96 |
|
97 | __webpack_require__.p = "";
|
98 |
|
99 |
|
100 |
|
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 |
|
109 |
|
110 |
|
111 | (function(module, exports, __webpack_require__) {
|
112 |
|
113 | "use strict";
|
114 |
|
115 |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 |
|
137 |
|
138 | Object.defineProperty(exports, "__esModule", { value: true });
|
139 | exports.getCorrectEventName = exports.getCorrectPropertyName = void 0;
|
140 | var 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 | };
|
154 | var 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 | };
|
176 | function isWindow(windowObj) {
|
177 | return Boolean(windowObj.document) && typeof windowObj.document.createElement === 'function';
|
178 | }
|
179 | function 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 | }
|
190 | exports.getCorrectPropertyName = getCorrectPropertyName;
|
191 | function 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 | }
|
203 | exports.getCorrectEventName = getCorrectEventName;
|
204 |
|
205 | }),
|
206 |
|
207 | "./packages/mdc-base/component.ts":
|
208 |
|
209 |
|
210 |
|
211 |
|
212 | (function(module, exports, __webpack_require__) {
|
213 |
|
214 | "use strict";
|
215 |
|
216 |
|
217 |
|
218 |
|
219 |
|
220 |
|
221 |
|
222 |
|
223 |
|
224 |
|
225 |
|
226 |
|
227 |
|
228 |
|
229 |
|
230 |
|
231 |
|
232 |
|
233 |
|
234 |
|
235 |
|
236 |
|
237 |
|
238 |
|
239 | var __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 | };
|
261 | var __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 | };
|
266 | Object.defineProperty(exports, "__esModule", { value: true });
|
267 | exports.MDCComponent = void 0;
|
268 | var foundation_1 = __webpack_require__( "./packages/mdc-base/foundation.ts");
|
269 | var MDCComponent = 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 |
|
278 |
|
279 |
|
280 | this.foundation = foundation === undefined ? this.getDefaultFoundation() : foundation;
|
281 | this.foundation.init();
|
282 | this.initialSyncWithDOM();
|
283 | }
|
284 | MDCComponent.attachTo = function (root) {
|
285 |
|
286 |
|
287 |
|
288 |
|
289 | return new MDCComponent(root, new foundation_1.MDCFoundation({}));
|
290 | };
|
291 |
|
292 | MDCComponent.prototype.initialize = function () {
|
293 | var _args = [];
|
294 | for (var _i = 0; _i < arguments.length; _i++) {
|
295 | _args[_i] = arguments[_i];
|
296 | }
|
297 |
|
298 |
|
299 |
|
300 | };
|
301 | MDCComponent.prototype.getDefaultFoundation = function () {
|
302 |
|
303 |
|
304 | throw new Error('Subclasses must override getDefaultFoundation to return a properly configured ' + 'foundation class');
|
305 | };
|
306 | MDCComponent.prototype.initialSyncWithDOM = function () {
|
307 |
|
308 |
|
309 |
|
310 |
|
311 | };
|
312 | MDCComponent.prototype.destroy = function () {
|
313 |
|
314 |
|
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 |
|
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 | }();
|
344 | exports.MDCComponent = MDCComponent;
|
345 |
|
346 | exports.default = MDCComponent;
|
347 |
|
348 | }),
|
349 |
|
350 | "./packages/mdc-base/foundation.ts":
|
351 |
|
352 |
|
353 |
|
354 |
|
355 | (function(module, exports, __webpack_require__) {
|
356 |
|
357 | "use strict";
|
358 |
|
359 |
|
360 |
|
361 |
|
362 |
|
363 |
|
364 |
|
365 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 |
|
371 |
|
372 |
|
373 |
|
374 |
|
375 |
|
376 |
|
377 |
|
378 |
|
379 |
|
380 |
|
381 |
|
382 | Object.defineProperty(exports, "__esModule", { value: true });
|
383 | exports.MDCFoundation = void 0;
|
384 | var MDCFoundation = 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 |
|
394 |
|
395 | return {};
|
396 | },
|
397 | enumerable: false,
|
398 | configurable: true
|
399 | });
|
400 | Object.defineProperty(MDCFoundation, "strings", {
|
401 | get: function get() {
|
402 |
|
403 |
|
404 | return {};
|
405 | },
|
406 | enumerable: false,
|
407 | configurable: true
|
408 | });
|
409 | Object.defineProperty(MDCFoundation, "numbers", {
|
410 | get: function get() {
|
411 |
|
412 |
|
413 | return {};
|
414 | },
|
415 | enumerable: false,
|
416 | configurable: true
|
417 | });
|
418 | Object.defineProperty(MDCFoundation, "defaultAdapter", {
|
419 | get: function get() {
|
420 |
|
421 |
|
422 |
|
423 | return {};
|
424 | },
|
425 | enumerable: false,
|
426 | configurable: true
|
427 | });
|
428 | MDCFoundation.prototype.init = function () {
|
429 |
|
430 | };
|
431 | MDCFoundation.prototype.destroy = function () {
|
432 |
|
433 | };
|
434 | return MDCFoundation;
|
435 | }();
|
436 | exports.MDCFoundation = MDCFoundation;
|
437 |
|
438 | exports.default = MDCFoundation;
|
439 |
|
440 | }),
|
441 |
|
442 | "./packages/mdc-linear-progress/adapter.ts":
|
443 |
|
444 |
|
445 |
|
446 |
|
447 | (function(module, exports, __webpack_require__) {
|
448 |
|
449 | "use strict";
|
450 |
|
451 |
|
452 |
|
453 |
|
454 |
|
455 |
|
456 |
|
457 |
|
458 |
|
459 |
|
460 |
|
461 |
|
462 |
|
463 |
|
464 |
|
465 |
|
466 |
|
467 |
|
468 |
|
469 |
|
470 |
|
471 |
|
472 |
|
473 |
|
474 | Object.defineProperty(exports, "__esModule", { value: true });
|
475 |
|
476 | }),
|
477 |
|
478 | "./packages/mdc-linear-progress/component.ts":
|
479 |
|
480 |
|
481 |
|
482 |
|
483 | (function(module, exports, __webpack_require__) {
|
484 |
|
485 | "use strict";
|
486 |
|
487 |
|
488 |
|
489 |
|
490 |
|
491 |
|
492 |
|
493 |
|
494 |
|
495 |
|
496 |
|
497 |
|
498 |
|
499 |
|
500 |
|
501 |
|
502 |
|
503 |
|
504 |
|
505 |
|
506 |
|
507 |
|
508 |
|
509 |
|
510 | var __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 | }();
|
530 | Object.defineProperty(exports, "__esModule", { value: true });
|
531 | exports.MDCLinearProgress = void 0;
|
532 | var component_1 = __webpack_require__( "./packages/mdc-base/component.ts");
|
533 | var foundation_1 = __webpack_require__( "./packages/mdc-linear-progress/foundation.ts");
|
534 | var MDCLinearProgress = 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 |
|
578 |
|
579 |
|
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);
|
631 | exports.MDCLinearProgress = MDCLinearProgress;
|
632 |
|
633 | }),
|
634 |
|
635 | "./packages/mdc-linear-progress/constants.ts":
|
636 |
|
637 |
|
638 |
|
639 |
|
640 | (function(module, exports, __webpack_require__) {
|
641 |
|
642 | "use strict";
|
643 |
|
644 |
|
645 |
|
646 |
|
647 |
|
648 |
|
649 |
|
650 |
|
651 |
|
652 |
|
653 |
|
654 |
|
655 |
|
656 |
|
657 |
|
658 |
|
659 |
|
660 |
|
661 |
|
662 |
|
663 |
|
664 |
|
665 |
|
666 |
|
667 | Object.defineProperty(exports, "__esModule", { value: true });
|
668 | exports.animationDimensionPercentages = exports.strings = exports.cssClasses = void 0;
|
669 | exports.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 | };
|
676 | exports.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 |
|
686 | exports.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 |
|
699 |
|
700 |
|
701 | (function(module, exports, __webpack_require__) {
|
702 |
|
703 | "use strict";
|
704 |
|
705 |
|
706 |
|
707 |
|
708 |
|
709 |
|
710 |
|
711 |
|
712 |
|
713 |
|
714 |
|
715 |
|
716 |
|
717 |
|
718 |
|
719 |
|
720 |
|
721 |
|
722 |
|
723 |
|
724 |
|
725 |
|
726 |
|
727 |
|
728 | var __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 | }();
|
748 | var __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 | };
|
760 | var __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 | };
|
773 | Object.defineProperty(exports, "__esModule", { value: true });
|
774 | exports.MDCLinearProgressFoundation = void 0;
|
775 | var util_1 = __webpack_require__( "./packages/mdc-animation/util.ts");
|
776 | var foundation_1 = __webpack_require__( "./packages/mdc-base/foundation.ts");
|
777 | var constants_1 = __webpack_require__( "./packages/mdc-linear-progress/constants.ts");
|
778 | var MDCLinearProgressFoundation = 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 |
|
929 |
|
930 |
|
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 |
|
951 |
|
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 |
|
976 | this.restartAnimation();
|
977 | };
|
978 | return MDCLinearProgressFoundation;
|
979 | }(foundation_1.MDCFoundation);
|
980 | exports.MDCLinearProgressFoundation = MDCLinearProgressFoundation;
|
981 |
|
982 | exports.default = MDCLinearProgressFoundation;
|
983 |
|
984 | }),
|
985 |
|
986 | "./packages/mdc-linear-progress/index.ts":
|
987 |
|
988 |
|
989 |
|
990 |
|
991 | (function(module, exports, __webpack_require__) {
|
992 |
|
993 | "use strict";
|
994 |
|
995 |
|
996 |
|
997 |
|
998 |
|
999 |
|
1000 |
|
1001 |
|
1002 |
|
1003 |
|
1004 |
|
1005 |
|
1006 |
|
1007 |
|
1008 |
|
1009 |
|
1010 |
|
1011 |
|
1012 |
|
1013 |
|
1014 |
|
1015 |
|
1016 |
|
1017 |
|
1018 | var __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 | });
|
1027 | var __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 | };
|
1032 | Object.defineProperty(exports, "__esModule", { value: true });
|
1033 | __exportStar(__webpack_require__( "./packages/mdc-linear-progress/adapter.ts"), exports);
|
1034 | __exportStar(__webpack_require__( "./packages/mdc-linear-progress/component.ts"), exports);
|
1035 | __exportStar(__webpack_require__( "./packages/mdc-linear-progress/constants.ts"), exports);
|
1036 | __exportStar(__webpack_require__( "./packages/mdc-linear-progress/foundation.ts"), exports);
|
1037 | __exportStar(__webpack_require__( "./packages/mdc-linear-progress/types.ts"), exports);
|
1038 |
|
1039 | }),
|
1040 |
|
1041 | "./packages/mdc-linear-progress/types.ts":
|
1042 |
|
1043 |
|
1044 |
|
1045 |
|
1046 | (function(module, exports, __webpack_require__) {
|
1047 |
|
1048 | "use strict";
|
1049 |
|
1050 |
|
1051 |
|
1052 |
|
1053 |
|
1054 |
|
1055 |
|
1056 |
|
1057 |
|
1058 |
|
1059 |
|
1060 |
|
1061 |
|
1062 |
|
1063 |
|
1064 |
|
1065 |
|
1066 |
|
1067 |
|
1068 |
|
1069 |
|
1070 |
|
1071 |
|
1072 |
|
1073 | Object.defineProperty(exports, "__esModule", { value: true });
|
1074 |
|
1075 | })
|
1076 |
|
1077 | });
|
1078 | });
|
1079 |
|
\ | No newline at end of file |