@angular/flex-layout
Version:
Angular Flex-Layout =======
1 lines • 9.3 kB
Source Map (JSON)
{"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 ? 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 ? 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,MAAmC;IAClE,KAAK,IAAI,GAAG,IAAI,MAAM,EAAE;QACtB,IAAI,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QAE9B,QAAQ,GAAG;YACT,KAAK,SAAS;gBACZ,IAAI,KAAK,KAAK,MAAM,EAAE;oBACpB,MAAM,CAAC,SAAS,CAAC,GAAG;wBAClB,cAAc;wBACd,MAAM;qBACP,CAAC;iBACH;qBAAM,IAAI,KAAK,KAAK,aAAa,EAAE;oBAClC,MAAM,CAAC,SAAS,CAAC,GAAG;wBAClB,qBAAqB;wBACrB,aAAa;qBACd,CAAC;iBACH;qBAAM;oBACL,MAAM,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;iBAC3B;gBACD,MAAM;YAER,KAAK,aAAa,CAAC;YACnB,KAAK,YAAY,CAAC;YAClB,KAAK,eAAe,CAAC;YACrB,KAAK,M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