source: trip-planner-front/node_modules/@angular/compiler/src/render3/view/style_parser.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 14.0 KB
Line 
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://angular.io/license
7 */
8(function (factory) {
9 if (typeof module === "object" && typeof module.exports === "object") {
10 var v = factory(require, exports);
11 if (v !== undefined) module.exports = v;
12 }
13 else if (typeof define === "function" && define.amd) {
14 define("@angular/compiler/src/render3/view/style_parser", ["require", "exports"], factory);
15 }
16})(function (require, exports) {
17 "use strict";
18 Object.defineProperty(exports, "__esModule", { value: true });
19 exports.hyphenate = exports.stripUnnecessaryQuotes = exports.parse = void 0;
20 /**
21 * Parses string representation of a style and converts it into object literal.
22 *
23 * @param value string representation of style as used in the `style` attribute in HTML.
24 * Example: `color: red; height: auto`.
25 * @returns An array of style property name and value pairs, e.g. `['color', 'red', 'height',
26 * 'auto']`
27 */
28 function parse(value) {
29 // we use a string array here instead of a string map
30 // because a string-map is not guaranteed to retain the
31 // order of the entries whereas a string array can be
32 // constructed in a [key, value, key, value] format.
33 var styles = [];
34 var i = 0;
35 var parenDepth = 0;
36 var quote = 0 /* QuoteNone */;
37 var valueStart = 0;
38 var propStart = 0;
39 var currentProp = null;
40 var valueHasQuotes = false;
41 while (i < value.length) {
42 var token = value.charCodeAt(i++);
43 switch (token) {
44 case 40 /* OpenParen */:
45 parenDepth++;
46 break;
47 case 41 /* CloseParen */:
48 parenDepth--;
49 break;
50 case 39 /* QuoteSingle */:
51 // valueStart needs to be there since prop values don't
52 // have quotes in CSS
53 valueHasQuotes = valueHasQuotes || valueStart > 0;
54 if (quote === 0 /* QuoteNone */) {
55 quote = 39 /* QuoteSingle */;
56 }
57 else if (quote === 39 /* QuoteSingle */ && value.charCodeAt(i - 1) !== 92 /* BackSlash */) {
58 quote = 0 /* QuoteNone */;
59 }
60 break;
61 case 34 /* QuoteDouble */:
62 // same logic as above
63 valueHasQuotes = valueHasQuotes || valueStart > 0;
64 if (quote === 0 /* QuoteNone */) {
65 quote = 34 /* QuoteDouble */;
66 }
67 else if (quote === 34 /* QuoteDouble */ && value.charCodeAt(i - 1) !== 92 /* BackSlash */) {
68 quote = 0 /* QuoteNone */;
69 }
70 break;
71 case 58 /* Colon */:
72 if (!currentProp && parenDepth === 0 && quote === 0 /* QuoteNone */) {
73 currentProp = hyphenate(value.substring(propStart, i - 1).trim());
74 valueStart = i;
75 }
76 break;
77 case 59 /* Semicolon */:
78 if (currentProp && valueStart > 0 && parenDepth === 0 && quote === 0 /* QuoteNone */) {
79 var styleVal = value.substring(valueStart, i - 1).trim();
80 styles.push(currentProp, valueHasQuotes ? stripUnnecessaryQuotes(styleVal) : styleVal);
81 propStart = i;
82 valueStart = 0;
83 currentProp = null;
84 valueHasQuotes = false;
85 }
86 break;
87 }
88 }
89 if (currentProp && valueStart) {
90 var styleVal = value.substr(valueStart).trim();
91 styles.push(currentProp, valueHasQuotes ? stripUnnecessaryQuotes(styleVal) : styleVal);
92 }
93 return styles;
94 }
95 exports.parse = parse;
96 function stripUnnecessaryQuotes(value) {
97 var qS = value.charCodeAt(0);
98 var qE = value.charCodeAt(value.length - 1);
99 if (qS == qE && (qS == 39 /* QuoteSingle */ || qS == 34 /* QuoteDouble */)) {
100 var tempValue = value.substring(1, value.length - 1);
101 // special case to avoid using a multi-quoted string that was just chomped
102 // (e.g. `font-family: "Verdana", "sans-serif"`)
103 if (tempValue.indexOf('\'') == -1 && tempValue.indexOf('"') == -1) {
104 value = tempValue;
105 }
106 }
107 return value;
108 }
109 exports.stripUnnecessaryQuotes = stripUnnecessaryQuotes;
110 function hyphenate(value) {
111 return value
112 .replace(/[a-z][A-Z]/g, function (v) {
113 return v.charAt(0) + '-' + v.charAt(1);
114 })
115 .toLowerCase();
116 }
117 exports.hyphenate = hyphenate;
118});
119//# sourceMappingURL=data:application/json;base64,eyJ2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