@dugararchit/flex-layout 13.0.0-dugararchit
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/README.md +7 -0
- package/_private-utils/angular-flex-layout-_private-utils.d.ts +5 -0
- package/_private-utils/auto-prefixer.d.ts +24 -0
- package/_private-utils/index.d.ts +10 -0
- package/_private-utils/layout-validator.d.ts +32 -0
- package/_private-utils/object-extend.d.ts +15 -0
- package/_private-utils/package.json +10 -0
- package/_private-utils/testing/angular-flex-layout-_private-utils-testing.d.ts +5 -0
- package/_private-utils/testing/custom-matchers.d.ts +65 -0
- package/_private-utils/testing/dom-tools.d.ts +47 -0
- package/_private-utils/testing/helpers.d.ts +24 -0
- package/_private-utils/testing/index.d.ts +10 -0
- package/_private-utils/testing/package.json +10 -0
- package/angular-flex-layout-13.0.0-beta.38.tgz +0 -0
- package/angular-flex-layout.d.ts +5 -0
- package/core/README.md +25 -0
- package/core/add-alias.d.ts +14 -0
- package/core/angular-flex-layout-core.d.ts +5 -0
- package/core/base/base2.d.ts +60 -0
- package/core/base/index.d.ts +8 -0
- package/core/basis-validator/basis-validator.d.ts +13 -0
- package/core/breakpoints/break-point-registry.d.ts +42 -0
- package/core/breakpoints/break-point.d.ts +14 -0
- package/core/breakpoints/break-points-token.d.ts +14 -0
- package/core/breakpoints/breakpoint-tools.d.ts +19 -0
- package/core/breakpoints/data/break-points.d.ts +12 -0
- package/core/breakpoints/data/orientation-break-points.d.ts +23 -0
- package/core/breakpoints/index.d.ts +12 -0
- package/core/browser-provider.d.ts +24 -0
- package/core/match-media/index.d.ts +9 -0
- package/core/match-media/match-media.d.ts +59 -0
- package/core/match-media/mock/mock-match-media.d.ts +92 -0
- package/core/media-change.d.ts +30 -0
- package/core/media-marshaller/media-marshaller.d.ts +123 -0
- package/core/media-marshaller/print-hook.d.ts +95 -0
- package/core/media-observer/index.d.ts +8 -0
- package/core/media-observer/media-observer.d.ts +115 -0
- package/core/media-trigger/index.d.ts +8 -0
- package/core/media-trigger/media-trigger.d.ts +73 -0
- package/core/module.d.ts +11 -0
- package/core/multiply/multiplier.d.ts +5 -0
- package/core/package.json +10 -0
- package/core/public-api.d.ts +25 -0
- package/core/sass/_layout-bp.scss +76 -0
- package/core/style-builder/style-builder.d.ts +21 -0
- package/core/style-utils/style-utils.d.ts +53 -0
- package/core/stylesheet-map/index.d.ts +8 -0
- package/core/stylesheet-map/stylesheet-map.d.ts +24 -0
- package/core/tokens/breakpoint-token.d.ts +10 -0
- package/core/tokens/index.d.ts +10 -0
- package/core/tokens/library-config.d.ts +26 -0
- package/core/tokens/server-token.d.ts +15 -0
- package/core/utils/array.d.ts +9 -0
- package/core/utils/index.d.ts +9 -0
- package/core/utils/sort.d.ts +15 -0
- package/esm2020/_private-utils/angular-flex-layout-_private-utils.mjs +5 -0
- package/esm2020/_private-utils/auto-prefixer.mjs +65 -0
- package/esm2020/_private-utils/index.mjs +11 -0
- package/esm2020/_private-utils/layout-validator.mjs +83 -0
- package/esm2020/_private-utils/object-extend.mjs +30 -0
- package/esm2020/_private-utils/testing/angular-flex-layout-_private-utils-testing.mjs +5 -0
- package/esm2020/_private-utils/testing/custom-matchers.mjs +201 -0
- package/esm2020/_private-utils/testing/dom-tools.mjs +101 -0
- package/esm2020/_private-utils/testing/helpers.mjs +43 -0
- package/esm2020/_private-utils/testing/index.mjs +11 -0
- package/esm2020/angular-flex-layout.mjs +5 -0
- package/esm2020/core/add-alias.mjs +23 -0
- package/esm2020/core/angular-flex-layout-core.mjs +5 -0
- package/esm2020/core/base/base2.mjs +131 -0
- package/esm2020/core/base/index.mjs +9 -0
- package/esm2020/core/basis-validator/basis-validator.mjs +48 -0
- package/esm2020/core/breakpoints/break-point-registry.mjs +76 -0
- package/esm2020/core/breakpoints/break-point.mjs +2 -0
- package/esm2020/core/breakpoints/break-points-token.mjs +30 -0
- package/esm2020/core/breakpoints/breakpoint-tools.mjs +53 -0
- package/esm2020/core/breakpoints/data/break-points.mjs +78 -0
- package/esm2020/core/breakpoints/data/orientation-break-points.mjs +40 -0
- package/esm2020/core/breakpoints/index.mjs +13 -0
- package/esm2020/core/browser-provider.mjs +41 -0
- package/esm2020/core/match-media/index.mjs +10 -0
- package/esm2020/core/match-media/match-media.mjs +186 -0
- package/esm2020/core/match-media/mock/mock-match-media.mjs +224 -0
- package/esm2020/core/media-change.mjs +25 -0
- package/esm2020/core/media-marshaller/media-marshaller.mjs +317 -0
- package/esm2020/core/media-marshaller/print-hook.mjs +265 -0
- package/esm2020/core/media-observer/index.mjs +9 -0
- package/esm2020/core/media-observer/media-observer.mjs +195 -0
- package/esm2020/core/media-trigger/index.mjs +9 -0
- package/esm2020/core/media-trigger/media-trigger.mjs +188 -0
- package/esm2020/core/module.mjs +27 -0
- package/esm2020/core/multiply/multiplier.mjs +16 -0
- package/esm2020/core/public-api.mjs +26 -0
- package/esm2020/core/style-builder/style-builder.mjs +15 -0
- package/esm2020/core/style-utils/style-utils.mjs +174 -0
- package/esm2020/core/stylesheet-map/index.mjs +9 -0
- package/esm2020/core/stylesheet-map/stylesheet-map.mjs +59 -0
- package/esm2020/core/tokens/breakpoint-token.mjs +13 -0
- package/esm2020/core/tokens/index.mjs +11 -0
- package/esm2020/core/tokens/library-config.mjs +30 -0
- package/esm2020/core/tokens/server-token.mjs +19 -0
- package/esm2020/core/utils/array.mjs +12 -0
- package/esm2020/core/utils/index.mjs +10 -0
- package/esm2020/core/utils/sort.mjs +20 -0
- package/esm2020/extended/angular-flex-layout-extended.mjs +5 -0
- package/esm2020/extended/class/class.mjs +88 -0
- package/esm2020/extended/img-src/img-src.mjs +106 -0
- package/esm2020/extended/module.mjs +45 -0
- package/esm2020/extended/public-api.mjs +13 -0
- package/esm2020/extended/show-hide/show-hide.mjs +176 -0
- package/esm2020/extended/style/style-transforms.mjs +76 -0
- package/esm2020/extended/style/style.mjs +130 -0
- package/esm2020/flex/angular-flex-layout-flex.mjs +5 -0
- package/esm2020/flex/flex/flex.mjs +291 -0
- package/esm2020/flex/flex-align/flex-align.mjs +80 -0
- package/esm2020/flex/flex-fill/flex-fill.mjs +50 -0
- package/esm2020/flex/flex-offset/flex-offset.mjs +121 -0
- package/esm2020/flex/flex-order/flex-order.mjs +66 -0
- package/esm2020/flex/layout/layout.mjs +86 -0
- package/esm2020/flex/layout-align/layout-align.mjs +194 -0
- package/esm2020/flex/layout-gap/layout-gap.mjs +282 -0
- package/esm2020/flex/module.mjs +62 -0
- package/esm2020/flex/public-api.mjs +17 -0
- package/esm2020/grid/align-columns/align-columns.mjs +137 -0
- package/esm2020/grid/align-rows/align-rows.mjs +119 -0
- package/esm2020/grid/angular-flex-layout-grid.mjs +5 -0
- package/esm2020/grid/area/area.mjs +67 -0
- package/esm2020/grid/areas/areas.mjs +86 -0
- package/esm2020/grid/auto/auto.mjs +89 -0
- package/esm2020/grid/column/column.mjs +67 -0
- package/esm2020/grid/columns/columns.mjs +96 -0
- package/esm2020/grid/gap/gap.mjs +85 -0
- package/esm2020/grid/grid-align/grid-align.mjs +111 -0
- package/esm2020/grid/module.mjs +73 -0
- package/esm2020/grid/public-api.mjs +20 -0
- package/esm2020/grid/row/row.mjs +67 -0
- package/esm2020/grid/rows/rows.mjs +96 -0
- package/esm2020/module.mjs +64 -0
- package/esm2020/public-api.mjs +20 -0
- package/esm2020/server/angular-flex-layout-server.mjs +5 -0
- package/esm2020/server/module.mjs +22 -0
- package/esm2020/server/public-api.mjs +10 -0
- package/esm2020/server/server-match-media.mjs +151 -0
- package/esm2020/server/server-provider.mjs +140 -0
- package/esm2020/version.mjs +11 -0
- package/extended/README.md +18 -0
- package/extended/angular-flex-layout-extended.d.ts +5 -0
- package/extended/class/class.d.ts +38 -0
- package/extended/img-src/img-src.d.ts +51 -0
- package/extended/module.d.ts +16 -0
- package/extended/package.json +10 -0
- package/extended/public-api.d.ts +12 -0
- package/extended/show-hide/show-hide.d.ts +61 -0
- package/extended/style/style-transforms.d.ts +36 -0
- package/extended/style/style.d.ts +45 -0
- package/fesm2015/angular-flex-layout-_private-utils-testing.mjs +357 -0
- package/fesm2015/angular-flex-layout-_private-utils-testing.mjs.map +1 -0
- package/fesm2015/angular-flex-layout-_private-utils.mjs +193 -0
- package/fesm2015/angular-flex-layout-_private-utils.mjs.map +1 -0
- package/fesm2015/angular-flex-layout-core.mjs +2331 -0
- package/fesm2015/angular-flex-layout-core.mjs.map +1 -0
- package/fesm2015/angular-flex-layout-extended.mjs +621 -0
- package/fesm2015/angular-flex-layout-extended.mjs.map +1 -0
- package/fesm2015/angular-flex-layout-flex.mjs +1206 -0
- package/fesm2015/angular-flex-layout-flex.mjs.map +1 -0
- package/fesm2015/angular-flex-layout-grid.mjs +1047 -0
- package/fesm2015/angular-flex-layout-grid.mjs.map +1 -0
- package/fesm2015/angular-flex-layout-server.mjs +324 -0
- package/fesm2015/angular-flex-layout-server.mjs.map +1 -0
- package/fesm2015/angular-flex-layout.mjs +94 -0
- package/fesm2015/angular-flex-layout.mjs.map +1 -0
- package/fesm2020/angular-flex-layout-_private-utils-testing.mjs +357 -0
- package/fesm2020/angular-flex-layout-_private-utils-testing.mjs.map +1 -0
- package/fesm2020/angular-flex-layout-_private-utils.mjs +192 -0
- package/fesm2020/angular-flex-layout-_private-utils.mjs.map +1 -0
- package/fesm2020/angular-flex-layout-core.mjs +2304 -0
- package/fesm2020/angular-flex-layout-core.mjs.map +1 -0
- package/fesm2020/angular-flex-layout-extended.mjs +612 -0
- package/fesm2020/angular-flex-layout-extended.mjs.map +1 -0
- package/fesm2020/angular-flex-layout-flex.mjs +1198 -0
- package/fesm2020/angular-flex-layout-flex.mjs.map +1 -0
- package/fesm2020/angular-flex-layout-grid.mjs +1047 -0
- package/fesm2020/angular-flex-layout-grid.mjs.map +1 -0
- package/fesm2020/angular-flex-layout-server.mjs +322 -0
- package/fesm2020/angular-flex-layout-server.mjs.map +1 -0
- package/fesm2020/angular-flex-layout.mjs +92 -0
- package/fesm2020/angular-flex-layout.mjs.map +1 -0
- package/flex/README.md +19 -0
- package/flex/angular-flex-layout-flex.d.ts +5 -0
- package/flex/flex/flex.d.ts +59 -0
- package/flex/flex-align/flex-align.d.ts +32 -0
- package/flex/flex-fill/flex-fill.d.ts +33 -0
- package/flex/flex-offset/flex-offset.d.ts +44 -0
- package/flex/flex-order/flex-order.d.ts +34 -0
- package/flex/layout/layout.d.ts +43 -0
- package/flex/layout-align/layout-align.d.ts +49 -0
- package/flex/layout-gap/layout-gap.d.ts +65 -0
- package/flex/module.d.ts +21 -0
- package/flex/package.json +10 -0
- package/flex/public-api.d.ts +16 -0
- package/grid/README.md +19 -0
- package/grid/align-columns/align-columns.d.ts +39 -0
- package/grid/align-rows/align-rows.d.ts +39 -0
- package/grid/angular-flex-layout-grid.d.ts +5 -0
- package/grid/area/area.d.ts +34 -0
- package/grid/areas/areas.d.ts +41 -0
- package/grid/auto/auto.d.ts +41 -0
- package/grid/column/column.d.ts +34 -0
- package/grid/columns/columns.d.ts +43 -0
- package/grid/gap/gap.d.ts +42 -0
- package/grid/grid-align/grid-align.d.ts +37 -0
- package/grid/module.d.ts +23 -0
- package/grid/package.json +10 -0
- package/grid/public-api.d.ts +19 -0
- package/grid/row/row.d.ts +34 -0
- package/grid/rows/rows.d.ts +43 -0
- package/module.d.ts +30 -0
- package/package.json +100 -0
- package/public-api.d.ts +18 -0
- package/server/README.md +23 -0
- package/server/angular-flex-layout-server.d.ts +5 -0
- package/server/module.d.ts +6 -0
- package/server/package.json +10 -0
- package/server/public-api.d.ts +9 -0
- package/server/server-match-media.d.ts +61 -0
- package/server/server-provider.d.ts +44 -0
- package/version.d.ts +10 -0
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import { extendObject, applyCssPrefixes } from '@angular/flex-layout/_private-utils';
|
|
2
|
+
import { TestBed } from '@angular/core/testing';
|
|
3
|
+
import { By } from '@angular/platform-browser';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright Google LLC All Rights Reserved.
|
|
8
|
+
*
|
|
9
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
10
|
+
* found in the LICENSE file at https://angular.io/license
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Exported DOM accessor utility functions
|
|
14
|
+
*/
|
|
15
|
+
const _dom = {
|
|
16
|
+
hasStyle,
|
|
17
|
+
getDistributedNodes,
|
|
18
|
+
getShadowRoot,
|
|
19
|
+
getText,
|
|
20
|
+
getStyle,
|
|
21
|
+
childNodes,
|
|
22
|
+
childNodesAsList,
|
|
23
|
+
hasClass,
|
|
24
|
+
hasAttribute,
|
|
25
|
+
getAttribute,
|
|
26
|
+
hasShadowRoot,
|
|
27
|
+
isCommentNode,
|
|
28
|
+
isElementNode,
|
|
29
|
+
isPresent,
|
|
30
|
+
isShadowRoot,
|
|
31
|
+
tagName,
|
|
32
|
+
lastElementChild
|
|
33
|
+
};
|
|
34
|
+
// ******************************************************************************************
|
|
35
|
+
// These functions are cloned from
|
|
36
|
+
// * @angular/platform-browser/src/browser/GenericBrowserDomAdapter
|
|
37
|
+
// and are to be used ONLY internally in custom-matchers.ts and Unit Tests
|
|
38
|
+
// ******************************************************************************************
|
|
39
|
+
function getStyle(element, stylename) {
|
|
40
|
+
return element.style[stylename];
|
|
41
|
+
}
|
|
42
|
+
function hasStyle(element, styleName, styleValue = '', inlineOnly = true) {
|
|
43
|
+
let value = getStyle(element, styleName) || '';
|
|
44
|
+
if (!value && !inlineOnly) {
|
|
45
|
+
// Search stylesheets
|
|
46
|
+
value = typeof getComputedStyle === 'function' &&
|
|
47
|
+
getComputedStyle(element).getPropertyValue(styleName) || '';
|
|
48
|
+
}
|
|
49
|
+
return styleValue ? value == styleValue : value.length > 0;
|
|
50
|
+
}
|
|
51
|
+
function getDistributedNodes(el) {
|
|
52
|
+
return el.getDistributedNodes();
|
|
53
|
+
}
|
|
54
|
+
function getShadowRoot(el) {
|
|
55
|
+
return el.shadowRoot;
|
|
56
|
+
}
|
|
57
|
+
function getText(el) {
|
|
58
|
+
return el.textContent || '';
|
|
59
|
+
}
|
|
60
|
+
function childNodesAsList(el) {
|
|
61
|
+
const list = el.childNodes;
|
|
62
|
+
const res = new Array(list.length);
|
|
63
|
+
for (let i = 0; i < list.length; i++) {
|
|
64
|
+
res[i] = list[i];
|
|
65
|
+
}
|
|
66
|
+
return res;
|
|
67
|
+
}
|
|
68
|
+
function hasClass(element, className) {
|
|
69
|
+
return element.classList.contains(className);
|
|
70
|
+
}
|
|
71
|
+
function hasAttribute(element, attributeName) {
|
|
72
|
+
return element.hasAttribute(attributeName);
|
|
73
|
+
}
|
|
74
|
+
function getAttribute(element, attributeName) {
|
|
75
|
+
return element.getAttribute(attributeName);
|
|
76
|
+
}
|
|
77
|
+
function childNodes(el) {
|
|
78
|
+
return el.childNodes;
|
|
79
|
+
}
|
|
80
|
+
function hasShadowRoot(node) {
|
|
81
|
+
return isPresent(node.shadowRoot) && node instanceof HTMLElement;
|
|
82
|
+
}
|
|
83
|
+
function isCommentNode(node) {
|
|
84
|
+
return node.nodeType === Node.COMMENT_NODE;
|
|
85
|
+
}
|
|
86
|
+
function isElementNode(node) {
|
|
87
|
+
return node.nodeType === Node.ELEMENT_NODE;
|
|
88
|
+
}
|
|
89
|
+
function isShadowRoot(node) {
|
|
90
|
+
return node instanceof DocumentFragment;
|
|
91
|
+
}
|
|
92
|
+
function isPresent(obj) {
|
|
93
|
+
return obj != null;
|
|
94
|
+
}
|
|
95
|
+
function tagName(element) {
|
|
96
|
+
return element.tagName;
|
|
97
|
+
}
|
|
98
|
+
// ******************************************************************************************
|
|
99
|
+
// These functions are part of the DOM API
|
|
100
|
+
// and are to be used ONLY internally in custom-matchers.ts and Unit Tests
|
|
101
|
+
// ******************************************************************************************
|
|
102
|
+
function lastElementChild(element) {
|
|
103
|
+
return element.lastElementChild;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const _global = (typeof window === 'undefined' ? global : window);
|
|
107
|
+
const expect$1 = _global.expect;
|
|
108
|
+
/**
|
|
109
|
+
* NOTE: These custom JASMINE Matchers are used only
|
|
110
|
+
* in the Karma/Jasmine testing for the Layout Directives
|
|
111
|
+
* in `src/lib/flex/api`
|
|
112
|
+
*/
|
|
113
|
+
const customMatchers = {
|
|
114
|
+
toEqual: function (util) {
|
|
115
|
+
return {
|
|
116
|
+
compare: function (actual, expected) {
|
|
117
|
+
return { pass: util.equals(actual, expected, [compareMap]) };
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
function compareMap(actual, expected) {
|
|
121
|
+
if (actual instanceof Map) {
|
|
122
|
+
let pass = actual.size === expected.size;
|
|
123
|
+
if (pass) {
|
|
124
|
+
actual.forEach((v, k) => {
|
|
125
|
+
pass = pass && util.equals(v, expected.get(k));
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
return pass;
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
toHaveText: function () {
|
|
136
|
+
return {
|
|
137
|
+
compare: function (actual, expectedText) {
|
|
138
|
+
const actualText = elementText(actual);
|
|
139
|
+
return {
|
|
140
|
+
pass: actualText == expectedText,
|
|
141
|
+
get message() {
|
|
142
|
+
return 'Expected ' + actualText + ' to be equal to ' + expectedText;
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
},
|
|
148
|
+
toHaveCssClass: function () {
|
|
149
|
+
return { compare: buildError(false), negativeCompare: buildError(true) };
|
|
150
|
+
function buildError(isNot) {
|
|
151
|
+
return function (actual, className) {
|
|
152
|
+
return {
|
|
153
|
+
pass: _dom.hasClass(actual, className) == !isNot,
|
|
154
|
+
get message() {
|
|
155
|
+
return `
|
|
156
|
+
Expected ${actual.outerHTML} ${isNot ? 'not ' : ''}
|
|
157
|
+
to contain the CSS class '${className}'
|
|
158
|
+
`;
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
toHaveMap: function () {
|
|
165
|
+
return {
|
|
166
|
+
compare: function (actual, map) {
|
|
167
|
+
let allPassed;
|
|
168
|
+
allPassed = Object.keys(map).length !== 0;
|
|
169
|
+
Object.keys(map).forEach(key => {
|
|
170
|
+
allPassed = allPassed && (actual[key] === map[key]);
|
|
171
|
+
});
|
|
172
|
+
return {
|
|
173
|
+
pass: allPassed,
|
|
174
|
+
get message() {
|
|
175
|
+
return `
|
|
176
|
+
Expected ${JSON.stringify(actual)} ${!allPassed ? ' ' : 'not '} to contain the
|
|
177
|
+
'${JSON.stringify(map)}'
|
|
178
|
+
`;
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
},
|
|
184
|
+
toHaveAttributes: function () {
|
|
185
|
+
return {
|
|
186
|
+
compare: function (actual, map) {
|
|
187
|
+
let allPassed;
|
|
188
|
+
let attributeNames = Object.keys(map);
|
|
189
|
+
allPassed = attributeNames.length !== 0;
|
|
190
|
+
attributeNames.forEach(name => {
|
|
191
|
+
allPassed = allPassed && _dom.hasAttribute(actual, name)
|
|
192
|
+
&& _dom.getAttribute(actual, name) === map[name];
|
|
193
|
+
});
|
|
194
|
+
return {
|
|
195
|
+
pass: allPassed,
|
|
196
|
+
get message() {
|
|
197
|
+
return `
|
|
198
|
+
Expected ${actual.outerHTML} ${allPassed ? 'not ' : ''} attributes to contain
|
|
199
|
+
'${JSON.stringify(map)}'
|
|
200
|
+
`;
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
},
|
|
206
|
+
/**
|
|
207
|
+
* Check element's inline styles only
|
|
208
|
+
*/
|
|
209
|
+
toHaveStyle: function () {
|
|
210
|
+
return {
|
|
211
|
+
compare: buildCompareStyleFunction(true)
|
|
212
|
+
};
|
|
213
|
+
},
|
|
214
|
+
/**
|
|
215
|
+
* Check element's css stylesheet only (if not present inline)
|
|
216
|
+
*/
|
|
217
|
+
toHaveCSS: function () {
|
|
218
|
+
return {
|
|
219
|
+
compare: buildCompareStyleFunction(false)
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
/**
|
|
224
|
+
* Curried value to function to check styles that are inline or in a stylesheet for the
|
|
225
|
+
* specified DOM element.
|
|
226
|
+
*/
|
|
227
|
+
function buildCompareStyleFunction(inlineOnly = true) {
|
|
228
|
+
return function (actual, styles, styler) {
|
|
229
|
+
const found = {};
|
|
230
|
+
const styleMap = {};
|
|
231
|
+
if (typeof styles === 'string') {
|
|
232
|
+
styleMap[styles] = '';
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
Object.assign(styleMap, styles);
|
|
236
|
+
}
|
|
237
|
+
let allPassed = Object.keys(styleMap).length !== 0;
|
|
238
|
+
Object.keys(styleMap).forEach(prop => {
|
|
239
|
+
let { elHasStyle, current } = hasPrefixedStyles(actual, prop, styleMap[prop], inlineOnly, styler);
|
|
240
|
+
allPassed = allPassed && elHasStyle;
|
|
241
|
+
if (!elHasStyle) {
|
|
242
|
+
extendObject(found, current);
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
return {
|
|
246
|
+
pass: allPassed,
|
|
247
|
+
get message() {
|
|
248
|
+
const expectedValueStr = (typeof styles === 'string') ? styleMap :
|
|
249
|
+
JSON.stringify(styleMap, null, 2);
|
|
250
|
+
const foundValueStr = inlineOnly ? actual.outerHTML : JSON.stringify(found);
|
|
251
|
+
return `
|
|
252
|
+
Expected ${foundValueStr}${!allPassed ? '' : ' not'} to contain the
|
|
253
|
+
CSS ${typeof styles === 'string' ? 'property' : 'styles'} '${expectedValueStr}'
|
|
254
|
+
`;
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Validate presence of requested style or use fallback
|
|
261
|
+
* to possible `prefixed` styles. Useful when some browsers
|
|
262
|
+
* (Safari, IE, etc) will use prefixed style instead of defaults.
|
|
263
|
+
*/
|
|
264
|
+
function hasPrefixedStyles(actual, key, value, inlineOnly, styler) {
|
|
265
|
+
const current = {};
|
|
266
|
+
if (value === '*') {
|
|
267
|
+
return { elHasStyle: styler.lookupStyle(actual, key, inlineOnly) !== '', current };
|
|
268
|
+
}
|
|
269
|
+
value = value.trim();
|
|
270
|
+
let elHasStyle = styler.lookupStyle(actual, key, inlineOnly) === value;
|
|
271
|
+
if (!elHasStyle) {
|
|
272
|
+
let prefixedStyles = applyCssPrefixes({ [key]: value });
|
|
273
|
+
Object.keys(prefixedStyles).forEach(prop => {
|
|
274
|
+
// Search for optional prefixed values
|
|
275
|
+
elHasStyle = elHasStyle ||
|
|
276
|
+
styler.lookupStyle(actual, prop, inlineOnly) === prefixedStyles[prop];
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
// Return BOTH confirmation and current computed key values (if confirmation == false)
|
|
280
|
+
return { elHasStyle, current };
|
|
281
|
+
}
|
|
282
|
+
function elementText(n) {
|
|
283
|
+
const hasNodes = (m) => {
|
|
284
|
+
const children = _dom.childNodes(m);
|
|
285
|
+
return children && children['length'];
|
|
286
|
+
};
|
|
287
|
+
if (n instanceof Array) {
|
|
288
|
+
return n.map(elementText).join('');
|
|
289
|
+
}
|
|
290
|
+
if (_dom.isCommentNode(n)) {
|
|
291
|
+
return '';
|
|
292
|
+
}
|
|
293
|
+
if (_dom.isElementNode(n) && _dom.tagName(n) == 'CONTENT') {
|
|
294
|
+
return elementText(Array.prototype.slice.apply(_dom.getDistributedNodes(n)));
|
|
295
|
+
}
|
|
296
|
+
if (_dom.hasShadowRoot(n)) {
|
|
297
|
+
return elementText(_dom.childNodesAsList(_dom.getShadowRoot(n)));
|
|
298
|
+
}
|
|
299
|
+
if (hasNodes(n)) {
|
|
300
|
+
return elementText(_dom.childNodesAsList(n));
|
|
301
|
+
}
|
|
302
|
+
return _dom.getText(n);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Function generator that captures a Component Type accessor and enables
|
|
307
|
+
* `createTestComponent()` to be reusable for *any* captured Component class.
|
|
308
|
+
*/
|
|
309
|
+
function makeCreateTestComponent(getClass) {
|
|
310
|
+
let componentAny;
|
|
311
|
+
// Return actual `createTestComponent()` function
|
|
312
|
+
return function createTestComponent(template, styles) {
|
|
313
|
+
if (!componentAny) {
|
|
314
|
+
// Defer access to Component class to enable metadata to be configured properly...
|
|
315
|
+
componentAny = getClass();
|
|
316
|
+
}
|
|
317
|
+
return TestBed
|
|
318
|
+
.overrideComponent(componentAny, {
|
|
319
|
+
set: {
|
|
320
|
+
template: template,
|
|
321
|
+
styles: styles || [],
|
|
322
|
+
}
|
|
323
|
+
})
|
|
324
|
+
.createComponent(componentAny);
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
*
|
|
329
|
+
*/
|
|
330
|
+
function expectNativeEl(fixture, instanceOptions) {
|
|
331
|
+
extendObject(fixture.componentInstance, instanceOptions || {});
|
|
332
|
+
fixture.detectChanges();
|
|
333
|
+
return expect(fixture.debugElement.children[0].nativeElement);
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
*
|
|
337
|
+
*/
|
|
338
|
+
function expectEl(debugEl) {
|
|
339
|
+
return expect(debugEl.nativeElement);
|
|
340
|
+
}
|
|
341
|
+
function queryFor(fixture, selector) {
|
|
342
|
+
return fixture.debugElement.queryAll(By.css(selector));
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* @license
|
|
347
|
+
* Copyright Google LLC All Rights Reserved.
|
|
348
|
+
*
|
|
349
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
350
|
+
* found in the LICENSE file at https://angular.io/license
|
|
351
|
+
*/
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Generated bundle index. Do not edit.
|
|
355
|
+
*/
|
|
356
|
+
|
|
357
|
+
export { _dom, customMatchers, expect$1 as expect, expectEl, expectNativeEl, makeCreateTestComponent, queryFor };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"angular-flex-layout-_private-utils-testing.mjs","sources":["../../../../projects/libs/flex-layout/_private-utils/testing/dom-tools.ts","../../../../projects/libs/flex-layout/_private-utils/testing/custom-matchers.ts","../../../../projects/libs/flex-layout/_private-utils/testing/helpers.ts","../../../../projects/libs/flex-layout/_private-utils/testing/index.ts","../../../../projects/libs/flex-layout/_private-utils/testing/angular-flex-layout-_private-utils-testing.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Exported DOM accessor utility functions\n */\nexport const _dom = {\n hasStyle,\n getDistributedNodes,\n getShadowRoot,\n getText,\n getStyle,\n childNodes,\n childNodesAsList,\n hasClass,\n hasAttribute,\n getAttribute,\n hasShadowRoot,\n isCommentNode,\n isElementNode,\n isPresent,\n isShadowRoot,\n tagName,\n lastElementChild\n};\n\n// ******************************************************************************************\n// These functions are cloned from\n// * @angular/platform-browser/src/browser/GenericBrowserDomAdapter\n// and are to be used ONLY internally in custom-matchers.ts and Unit Tests\n// ******************************************************************************************\n\nfunction getStyle(element: any, stylename: string): string {\n return element.style[stylename];\n}\n\nfunction hasStyle(element: any,\n styleName: string,\n styleValue: string = '',\n inlineOnly = true): boolean {\n let value = getStyle(element, styleName) || '';\n if (!value && !inlineOnly) {\n // Search stylesheets\n value = typeof getComputedStyle === 'function' &&\n getComputedStyle(element).getPropertyValue(styleName) || '';\n }\n return styleValue ? value == styleValue : value.length > 0;\n}\n\nfunction getDistributedNodes(el: HTMLElement): Node[] {\n return (<any>el).getDistributedNodes();\n}\n\nfunction getShadowRoot(el: HTMLElement): DocumentFragment {\n return (<any>el).shadowRoot;\n}\n\nfunction getText(el: Node): string {\n return el.textContent || '';\n}\n\nfunction childNodesAsList(el: Node): any[] {\n const list = el.childNodes;\n const res = new Array(list.length);\n for (let i = 0; i < list.length; i++) {\n res[i] = list[i];\n }\n return res;\n}\n\nfunction hasClass(element: any, className: string): boolean {\n return element.classList.contains(className);\n}\n\nfunction hasAttribute(element: any, attributeName: string): boolean {\n return element.hasAttribute(attributeName);\n}\n\nfunction getAttribute(element: any, attributeName: string): string {\n return element.getAttribute(attributeName);\n}\n\nfunction childNodes(el: any): Node[] {\n return el.childNodes;\n}\n\nfunction hasShadowRoot(node: any): boolean {\n return isPresent(node.shadowRoot) && node instanceof HTMLElement;\n}\n\nfunction isCommentNode(node: Node): boolean {\n return node.nodeType === Node.COMMENT_NODE;\n}\n\nfunction isElementNode(node: Node): boolean {\n return node.nodeType === Node.ELEMENT_NODE;\n}\n\nfunction isShadowRoot(node: any): boolean {\n return node instanceof DocumentFragment;\n}\n\nfunction isPresent(obj: any): boolean {\n return obj != null;\n}\n\nfunction tagName(element: any): string {\n return element.tagName;\n}\n\n// ******************************************************************************************\n// These functions are part of the DOM API\n// and are to be used ONLY internally in custom-matchers.ts and Unit Tests\n// ******************************************************************************************\n\nfunction lastElementChild(element: any): Node|null {\n return element.lastElementChild;\n}\n\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\ndeclare var global: any;\nconst _global = <any>(typeof window === 'undefined' ? global : window);\n\nimport {_dom as _} from './dom-tools';\n\nimport {applyCssPrefixes, extendObject, } from '@angular/flex-layout/_private-utils';\nimport {StyleUtils} from '@angular/flex-layout/core';\n\nexport const expect: (actual: any) => NgMatchers = <any> _global.expect;\n\n/**\n * Jasmine matchers that check Angular specific conditions.\n */\nexport interface NgMatchers extends jasmine.Matchers<any> {\n /**\n * Expect the element to have exactly the given text.\n *\n * ## Example\n *\n * {@example testing/ts/matchers.ts region='toHaveText'}\n */\n toHaveText(expected: string): boolean;\n\n /**\n * Compare key:value pairs as matching EXACTLY\n */\n toHaveMap(expected: { [k: string]: string }): boolean;\n\n /**\n * Expect the element to have the given CSS class.\n *\n * ## Example\n *\n * {@example testing/ts/matchers.ts region='toHaveCssClass'}\n */\n toHaveCssClass(expected: string): boolean;\n\n /**\n * Expect the element to have the given pairs of attribute name and attribute value\n */\n toHaveAttributes(expected: { [k: string]: string }): boolean;\n\n /**\n * Expect the element to have the given CSS styles injected INLINE\n *\n * ## Example\n *\n * {@example testing/ts/matchers.ts region='toHaveStyle'}\n */\n toHaveStyle(expected: { [k: string]: string } | string): boolean;\n\n /**\n * Expect the element to have the given CSS inline OR computed styles.\n *\n * ## Example\n *\n * {@example testing/ts/matchers.ts region='toHaveStyle'}\n */\n toHaveStyle(expected: { [k: string]: string } | string): boolean;\n\n /**\n * Invert the matchers.\n */\n not: NgMatchers;\n}\n\n/**\n * NOTE: These custom JASMINE Matchers are used only\n * in the Karma/Jasmine testing for the Layout Directives\n * in `src/lib/flex/api`\n */\nexport const customMatchers: jasmine.CustomMatcherFactories = {\n\n toEqual: function (util) {\n return {\n compare: function (actual: any, expected: any) {\n return {pass: util.equals(actual, expected, [compareMap])};\n }\n };\n\n function compareMap(actual: any, expected: any) {\n if (actual instanceof Map) {\n let pass = actual.size === expected.size;\n if (pass) {\n actual.forEach((v: any, k: any) => {\n pass = pass && util.equals(v, expected.get(k));\n });\n }\n return pass;\n } else {\n return undefined;\n }\n }\n },\n\n toHaveText: function () {\n return {\n compare: function (actual: any, expectedText: string) {\n const actualText = elementText(actual);\n return {\n pass: actualText == expectedText,\n get message() {\n return 'Expected ' + actualText + ' to be equal to ' + expectedText;\n }\n };\n }\n };\n },\n\n toHaveCssClass: function () {\n return {compare: buildError(false), negativeCompare: buildError(true)};\n\n function buildError(isNot: boolean) {\n return function (actual: any, className: string) {\n return {\n pass: _.hasClass(actual, className) == !isNot,\n get message() {\n return `\n Expected ${actual.outerHTML} ${isNot ? 'not ' : ''}\n to contain the CSS class '${className}'\n `;\n }\n };\n };\n }\n },\n\n toHaveMap: function () {\n return {\n compare: function (actual: { [k: string]: string }, map: { [k: string]: string }) {\n let allPassed: boolean;\n allPassed = Object.keys(map).length !== 0;\n Object.keys(map).forEach(key => {\n allPassed = allPassed && (actual[key] === map[key]);\n });\n\n return {\n pass: allPassed,\n get message() {\n return `\n Expected ${JSON.stringify(actual)} ${!allPassed ? ' ' : 'not '} to contain the\n '${JSON.stringify(map)}'\n `;\n }\n };\n }\n };\n },\n\n toHaveAttributes: function () {\n return {\n compare: function (actual: any, map: { [k: string]: string }) {\n let allPassed: boolean;\n let attributeNames = Object.keys(map);\n allPassed = attributeNames.length !== 0;\n attributeNames.forEach(name => {\n allPassed = allPassed && _.hasAttribute(actual, name)\n && _.getAttribute(actual, name) === map[name];\n });\n return {\n pass: allPassed,\n get message() {\n return `\n Expected ${actual.outerHTML} ${allPassed ? 'not ' : ''} attributes to contain\n '${JSON.stringify(map)}'\n `;\n }\n };\n }\n };\n },\n\n /**\n * Check element's inline styles only\n */\n toHaveStyle: function () {\n return {\n compare: buildCompareStyleFunction(true)\n };\n },\n\n\n /**\n * Check element's css stylesheet only (if not present inline)\n */\n toHaveCSS: function () {\n return {\n compare: buildCompareStyleFunction(false)\n };\n }\n\n};\n\n/**\n * Curried value to function to check styles that are inline or in a stylesheet for the\n * specified DOM element.\n */\nfunction buildCompareStyleFunction(inlineOnly = true) {\n return function (actual: any, styles: { [k: string]: string } | string, styler: StyleUtils) {\n const found = {};\n const styleMap: {[k: string]: string} = {};\n\n if (typeof styles === 'string') {\n styleMap[styles] = '';\n } else {\n Object.assign(styleMap, styles);\n }\n\n let allPassed = Object.keys(styleMap).length !== 0;\n Object.keys(styleMap).forEach(prop => {\n let {elHasStyle, current} = hasPrefixedStyles(actual, prop, styleMap[prop], inlineOnly,\n styler);\n allPassed = allPassed && elHasStyle;\n if (!elHasStyle) {\n extendObject(found, current);\n }\n });\n\n return {\n pass: allPassed,\n get message() {\n const expectedValueStr = (typeof styles === 'string') ? styleMap :\n JSON.stringify(styleMap, null, 2);\n const foundValueStr = inlineOnly ? actual.outerHTML : JSON.stringify(found);\n return `\n Expected ${foundValueStr}${!allPassed ? '' : ' not'} to contain the\n CSS ${typeof styles === 'string' ? 'property' : 'styles'} '${expectedValueStr}'\n `;\n }\n };\n };\n}\n\n/**\n * Validate presence of requested style or use fallback\n * to possible `prefixed` styles. Useful when some browsers\n * (Safari, IE, etc) will use prefixed style instead of defaults.\n */\nfunction hasPrefixedStyles(actual: HTMLElement,\n key: string,\n value: string,\n inlineOnly: boolean,\n styler: StyleUtils) {\n const current = {};\n\n if (value === '*') {\n return {elHasStyle: styler.lookupStyle(actual, key, inlineOnly) !== '', current};\n }\n\n value = value.trim();\n let elHasStyle = styler.lookupStyle(actual, key, inlineOnly) === value;\n if (!elHasStyle) {\n let prefixedStyles = applyCssPrefixes({[key]: value});\n Object.keys(prefixedStyles).forEach(prop => {\n // Search for optional prefixed values\n elHasStyle = elHasStyle ||\n styler.lookupStyle(actual, prop, inlineOnly) === prefixedStyles[prop];\n });\n }\n // Return BOTH confirmation and current computed key values (if confirmation == false)\n return {elHasStyle, current};\n}\n\nfunction elementText(n: any): string {\n const hasNodes = (m: any) => {\n const children = _.childNodes(m);\n return children && children['length'];\n };\n\n if (n instanceof Array) {\n return n.map(elementText).join('');\n }\n\n if (_.isCommentNode(n)) {\n return '';\n }\n\n if (_.isElementNode(n) && _.tagName(n) == 'CONTENT') {\n return elementText(Array.prototype.slice.apply(_.getDistributedNodes(n)));\n }\n\n if (_.hasShadowRoot(n)) {\n return elementText(_.childNodesAsList(_.getShadowRoot(n)));\n }\n\n if (hasNodes(n)) {\n return elementText(_.childNodesAsList(n));\n }\n\n return _.getText(n);\n}\n\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {Type, DebugElement} from '@angular/core';\nimport {ComponentFixture, TestBed} from '@angular/core/testing';\nimport {By} from '@angular/platform-browser';\nimport {extendObject} from '@angular/flex-layout/_private-utils';\n\nexport type ComponentClazzFn = () => Type<any>;\n\n/**\n * Function generator that captures a Component Type accessor and enables\n * `createTestComponent()` to be reusable for *any* captured Component class.\n */\nexport function makeCreateTestComponent(getClass: ComponentClazzFn) {\n let componentAny: Type<any>;\n\n // Return actual `createTestComponent()` function\n return function createTestComponent(template: string, styles?: any): ComponentFixture<Type<any>> {\n if (!componentAny) {\n // Defer access to Component class to enable metadata to be configured properly...\n componentAny = getClass();\n }\n return TestBed\n .overrideComponent(componentAny, {\n set: {\n template: template,\n styles: styles || [],\n }\n })\n .createComponent(componentAny);\n };\n}\n\n/**\n *\n */\nexport function expectNativeEl(fixture: ComponentFixture<any>, instanceOptions ?: any): any {\n extendObject(fixture.componentInstance, instanceOptions || {});\n fixture.detectChanges();\n return expect(fixture.debugElement.children[0].nativeElement);\n}\n\n/**\n *\n */\nexport function expectEl(debugEl: DebugElement): any {\n return expect(debugEl.nativeElement);\n}\n\n\nexport function queryFor(fixture: ComponentFixture<any>, selector: string): DebugElement[] {\n return fixture.debugElement.queryAll(By.css(selector));\n}\n\n\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './custom-matchers';\nexport * from './dom-tools';\nexport * from './helpers';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["expect","_"],"mappings":";;;;AAAA;;;;;;;AAQA;;;MAGa,IAAI,GAAG;IAClB,QAAQ;IACR,mBAAmB;IACnB,aAAa;IACb,OAAO;IACP,QAAQ;IACR,UAAU;IACV,gBAAgB;IAChB,QAAQ;IACR,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,aAAa;IACb,aAAa;IACb,SAAS;IACT,YAAY;IACZ,OAAO;IACP,gBAAgB;EAChB;AAEF;AACA;AACA;AACA;AACA;AAEA,SAAS,QAAQ,CAAC,OAAY,EAAE,SAAiB;IAC/C,OAAO,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AAClC,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,EAAE;gBACH,QAAQ,EAAE,QAAQ;gBAClB,MAAM,EAAE,MAAM,IAAI,EAAE;aACrB;SACF,CAAC;aACD,eAAe,CAAC,YAAY,CAAC,CAAC;KACpC,CAAC;AACJ,CAAC;AAED;;;SAGgB,cAAc,CAAC,OAA8B,EAAE,eAAsB;IACnF,YAAY,CAAC,OAAO,CAAC,iBAAiB,EAAE,eAAe,IAAI,EAAE,CAAC,CAAC;IAC/D,OAAO,CAAC,aAAa,EAAE,CAAC;IACxB,OAAO,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;AAChE,CAAC;AAED;;;SAGgB,QAAQ,CAAC,OAAqB;IAC5C,OAAO,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;AACvC,CAAC;SAGe,QAAQ,CAAC,OAA8B,EAAE,QAAgB;IACvE,OAAO,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;AACzD;;ACzDA;;;;;;;;ACAA;;;;;;"}
|
|
@@ -0,0 +1,192 @@
|
|
|
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
|
+
/**
|
|
9
|
+
* Applies CSS prefixes to appropriate style keys.
|
|
10
|
+
*
|
|
11
|
+
* Note: `-ms-`, `-moz` and `-webkit-box` are no longer supported. e.g.
|
|
12
|
+
* {
|
|
13
|
+
* display: -webkit-flex; NEW - Safari 6.1+. iOS 7.1+, BB10
|
|
14
|
+
* display: flex; NEW, Spec - Firefox, Chrome, Opera
|
|
15
|
+
* // display: -webkit-box; OLD - iOS 6-, Safari 3.1-6, BB7
|
|
16
|
+
* // display: -ms-flexbox; TWEENER - IE 10
|
|
17
|
+
* // display: -moz-flexbox; OLD - Firefox
|
|
18
|
+
* }
|
|
19
|
+
*/
|
|
20
|
+
function applyCssPrefixes(target) {
|
|
21
|
+
for (let key in target) {
|
|
22
|
+
let value = target[key] || '';
|
|
23
|
+
switch (key) {
|
|
24
|
+
case 'display':
|
|
25
|
+
if (value === 'flex') {
|
|
26
|
+
target['display'] = [
|
|
27
|
+
'-webkit-flex',
|
|
28
|
+
'flex'
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
else if (value === 'inline-flex') {
|
|
32
|
+
target['display'] = [
|
|
33
|
+
'-webkit-inline-flex',
|
|
34
|
+
'inline-flex'
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
target['display'] = value;
|
|
39
|
+
}
|
|
40
|
+
break;
|
|
41
|
+
case 'align-items':
|
|
42
|
+
case 'align-self':
|
|
43
|
+
case 'align-content':
|
|
44
|
+
case 'flex':
|
|
45
|
+
case 'flex-basis':
|
|
46
|
+
case 'flex-flow':
|
|
47
|
+
case 'flex-grow':
|
|
48
|
+
case 'flex-shrink':
|
|
49
|
+
case 'flex-wrap':
|
|
50
|
+
case 'justify-content':
|
|
51
|
+
target['-webkit-' + key] = value;
|
|
52
|
+
break;
|
|
53
|
+
case 'flex-direction':
|
|
54
|
+
value = value || 'row';
|
|
55
|
+
target['-webkit-flex-direction'] = value;
|
|
56
|
+
target['flex-direction'] = value;
|
|
57
|
+
break;
|
|
58
|
+
case 'order':
|
|
59
|
+
target['order'] = target['-webkit-' + key] = isNaN(+value) ? '0' : value;
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return target;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @license
|
|
68
|
+
* Copyright Google LLC All Rights Reserved.
|
|
69
|
+
*
|
|
70
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
71
|
+
* found in the LICENSE file at https://angular.io/license
|
|
72
|
+
*/
|
|
73
|
+
const INLINE = 'inline';
|
|
74
|
+
const LAYOUT_VALUES = ['row', 'column', 'row-reverse', 'column-reverse'];
|
|
75
|
+
/**
|
|
76
|
+
* Validate the direction|'direction wrap' value and then update the host's inline flexbox styles
|
|
77
|
+
*/
|
|
78
|
+
function buildLayoutCSS(value) {
|
|
79
|
+
let [direction, wrap, isInline] = validateValue(value);
|
|
80
|
+
return buildCSS(direction, wrap, isInline);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Validate the value to be one of the acceptable value options
|
|
84
|
+
* Use default fallback of 'row'
|
|
85
|
+
*/
|
|
86
|
+
function validateValue(value) {
|
|
87
|
+
value = value?.toLowerCase() ?? '';
|
|
88
|
+
let [direction, wrap, inline] = value.split(' ');
|
|
89
|
+
// First value must be the `flex-direction`
|
|
90
|
+
if (!LAYOUT_VALUES.find(x => x === direction)) {
|
|
91
|
+
direction = LAYOUT_VALUES[0];
|
|
92
|
+
}
|
|
93
|
+
if (wrap === INLINE) {
|
|
94
|
+
wrap = (inline !== INLINE) ? inline : '';
|
|
95
|
+
inline = INLINE;
|
|
96
|
+
}
|
|
97
|
+
return [direction, validateWrapValue(wrap), !!inline];
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Determine if the validated, flex-direction value specifies
|
|
101
|
+
* a horizontal/row flow.
|
|
102
|
+
*/
|
|
103
|
+
function isFlowHorizontal(value) {
|
|
104
|
+
let [flow,] = validateValue(value);
|
|
105
|
+
return flow.indexOf('row') > -1;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Convert layout-wrap='<value>' to expected flex-wrap style
|
|
109
|
+
*/
|
|
110
|
+
function validateWrapValue(value) {
|
|
111
|
+
if (!!value) {
|
|
112
|
+
switch (value.toLowerCase()) {
|
|
113
|
+
case 'reverse':
|
|
114
|
+
case 'wrap-reverse':
|
|
115
|
+
case 'reverse-wrap':
|
|
116
|
+
value = 'wrap-reverse';
|
|
117
|
+
break;
|
|
118
|
+
case 'no':
|
|
119
|
+
case 'none':
|
|
120
|
+
case 'nowrap':
|
|
121
|
+
value = 'nowrap';
|
|
122
|
+
break;
|
|
123
|
+
// All other values fallback to 'wrap'
|
|
124
|
+
default:
|
|
125
|
+
value = 'wrap';
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return value;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Build the CSS that should be assigned to the element instance
|
|
133
|
+
* BUG:
|
|
134
|
+
* 1) min-height on a column flex container won’t apply to its flex item children in IE 10-11.
|
|
135
|
+
* Use height instead if possible; height : <xxx>vh;
|
|
136
|
+
*
|
|
137
|
+
* This way any padding or border specified on the child elements are
|
|
138
|
+
* laid out and drawn inside that element's specified width and height.
|
|
139
|
+
*/
|
|
140
|
+
function buildCSS(direction, wrap = null, inline = false) {
|
|
141
|
+
return {
|
|
142
|
+
display: inline ? 'inline-flex' : 'flex',
|
|
143
|
+
'box-sizing': 'border-box',
|
|
144
|
+
'flex-direction': direction,
|
|
145
|
+
'flex-wrap': wrap || null,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* @license
|
|
151
|
+
* Copyright Google LLC All Rights Reserved.
|
|
152
|
+
*
|
|
153
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
154
|
+
* found in the LICENSE file at https://angular.io/license
|
|
155
|
+
*/
|
|
156
|
+
/**
|
|
157
|
+
* Extends an object with the *enumerable* and *own* properties of one or more source objects,
|
|
158
|
+
* similar to Object.assign.
|
|
159
|
+
*
|
|
160
|
+
* @param dest The object which will have properties copied to it.
|
|
161
|
+
* @param sources The source objects from which properties will be copied.
|
|
162
|
+
*/
|
|
163
|
+
function extendObject(dest, ...sources) {
|
|
164
|
+
if (dest == null) {
|
|
165
|
+
throw TypeError('Cannot convert undefined or null to object');
|
|
166
|
+
}
|
|
167
|
+
for (let source of sources) {
|
|
168
|
+
if (source != null) {
|
|
169
|
+
for (let key in source) {
|
|
170
|
+
if (source.hasOwnProperty(key)) {
|
|
171
|
+
dest[key] = source[key];
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return dest;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* @license
|
|
181
|
+
* Copyright Google LLC All Rights Reserved.
|
|
182
|
+
*
|
|
183
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
184
|
+
* found in the LICENSE file at https://angular.io/license
|
|
185
|
+
*/
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Generated bundle index. Do not edit.
|
|
189
|
+
*/
|
|
190
|
+
|
|
191
|
+
export { INLINE, LAYOUT_VALUES, applyCssPrefixes, buildLayoutCSS, extendObject, isFlowHorizontal, validateValue, validateWrapValue };
|
|
192
|
+
//# sourceMappingURL=angular-flex-layout-_private-utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"angular-flex-layout-_private-utils.mjs","sources":["../../../../projects/libs/flex-layout/_private-utils/auto-prefixer.ts","../../../../projects/libs/flex-layout/_private-utils/layout-validator.ts","../../../../projects/libs/flex-layout/_private-utils/object-extend.ts","../../../../projects/libs/flex-layout/_private-utils/index.ts","../../../../projects/libs/flex-layout/_private-utils/angular-flex-layout-_private-utils.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Applies CSS prefixes to appropriate style keys.\n *\n * Note: `-ms-`, `-moz` and `-webkit-box` are no longer supported. e.g.\n * {\n * display: -webkit-flex; NEW - Safari 6.1+. iOS 7.1+, BB10\n * display: flex; NEW, Spec - Firefox, Chrome, Opera\n * // display: -webkit-box; OLD - iOS 6-, Safari 3.1-6, BB7\n * // display: -ms-flexbox; TWEENER - IE 10\n * // display: -moz-flexbox; OLD - Firefox\n * }\n */\nexport function applyCssPrefixes(target: {[key: string]: any | null}) {\n for (let key in target) {\n let value = target[key] || '';\n\n switch (key) {\n case 'display':\n if (value === 'flex') {\n target['display'] = [\n '-webkit-flex',\n 'flex'\n ];\n } else if (value === 'inline-flex') {\n target['display'] = [\n '-webkit-inline-flex',\n 'inline-flex'\n ];\n } else {\n target['display'] = value;\n }\n break;\n\n case 'align-items':\n case 'align-self':\n case 'align-content':\n case 'flex':\n case 'flex-basis':\n case 'flex-flow':\n case 'flex-grow':\n case 'flex-shrink':\n case 'flex-wrap':\n case 'justify-content':\n target['-webkit-' + key] = value;\n break;\n\n case 'flex-direction':\n value = value || 'row';\n target['-webkit-flex-direction'] = value;\n target['flex-direction'] = value;\n break;\n\n case 'order':\n target['order'] = target['-webkit-' + key] = isNaN(+value) ? '0' : value;\n break;\n }\n }\n return target;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nexport const INLINE = 'inline';\nexport const LAYOUT_VALUES = ['row', 'column', 'row-reverse', 'column-reverse'];\n\n/**\n * Validate the direction|'direction wrap' value and then update the host's inline flexbox styles\n */\nexport function buildLayoutCSS(value: string) {\n let [direction, wrap, isInline] = validateValue(value);\n return buildCSS(direction, wrap, isInline);\n}\n\n/**\n * Validate the value to be one of the acceptable value options\n * Use default fallback of 'row'\n */\nexport function validateValue(value: string): [string, string, boolean] {\n value = value?.toLowerCase() ?? '';\n let [direction, wrap, inline] = value.split(' ');\n\n // First value must be the `flex-direction`\n if (!LAYOUT_VALUES.find(x => x === direction)) {\n direction = LAYOUT_VALUES[0];\n }\n\n if (wrap === INLINE) {\n wrap = (inline !== INLINE) ? inline : '';\n inline = INLINE;\n }\n\n return [direction, validateWrapValue(wrap), !!inline];\n}\n\n/**\n * Determine if the validated, flex-direction value specifies\n * a horizontal/row flow.\n */\nexport function isFlowHorizontal(value: string): boolean {\n let [flow, ] = validateValue(value);\n return flow.indexOf('row') > -1;\n}\n\n/**\n * Convert layout-wrap='<value>' to expected flex-wrap style\n */\nexport function validateWrapValue(value: string) {\n if (!!value) {\n switch (value.toLowerCase()) {\n case 'reverse':\n case 'wrap-reverse':\n case 'reverse-wrap':\n value = 'wrap-reverse';\n break;\n\n case 'no':\n case 'none':\n case 'nowrap':\n value = 'nowrap';\n break;\n\n // All other values fallback to 'wrap'\n default:\n value = 'wrap';\n break;\n }\n }\n return value;\n}\n\n/**\n * Build the CSS that should be assigned to the element instance\n * BUG:\n * 1) min-height on a column flex container won’t apply to its flex item children in IE 10-11.\n * Use height instead if possible; height : <xxx>vh;\n *\n * This way any padding or border specified on the child elements are\n * laid out and drawn inside that element's specified width and height.\n */\nfunction buildCSS(direction: string, wrap: string | null = null, inline = false) {\n return {\n display: inline ? 'inline-flex' : 'flex',\n 'box-sizing': 'border-box',\n 'flex-direction': direction,\n 'flex-wrap': wrap || null,\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Extends an object with the *enumerable* and *own* properties of one or more source objects,\n * similar to Object.assign.\n *\n * @param dest The object which will have properties copied to it.\n * @param sources The source objects from which properties will be copied.\n */\nexport function extendObject(dest: any, ...sources: any[]): any {\n if (dest == null) {\n throw TypeError('Cannot convert undefined or null to object');\n }\n\n for (let source of sources) {\n if (source != null) {\n for (let key in source) {\n if (source.hasOwnProperty(key)) {\n dest[key] = source[key];\n }\n }\n }\n }\n\n return dest;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './auto-prefixer';\nexport * from './layout-validator';\nexport * from './object-extend';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAA;;;;;;;AAOA;;;;;;;;;;;;SAYgB,gBAAgB,CAAC,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