grid-template-utils
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1,2 +0,2 @@ | ||
/*! grid-template-utils - v1.0.0 */ | ||
/*! grid-template-utils - v1.0.1 */ | ||
@@ -6,3 +6,3 @@ (function (global, factory) { | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(factory((global.Split = {}))); | ||
(factory((global.GridTemplateUtils = {}))); | ||
}(this, (function (exports) { 'use strict'; | ||
@@ -9,0 +9,0 @@ |
@@ -1,3 +0,3 @@ | ||
/*! grid-template-utils - v1.0.0 */ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.Split={})}(this,function(e){"use strict";var t=function(e,t){return Number(e.slice(0,-1*t.length))},n=function(e){return e.endsWith("px")?{value:e,type:"px",numeric:t(e,"px")}:e.endsWith("fr")?{value:e,type:"fr",numeric:t(e,"fr")}:e.endsWith("%")?{value:e,type:"%",numeric:t(e,"%")}:"auto"===e?{value:e,type:"auto"}:null};e.parse=function(e){return e.split(" ").map(n)},e.combine=function(e,t){var n=e?e.split(" "):[];return t.forEach(function(e,t){if(t>n.length-1)throw new Error("Unable to set size of track index "+t+", there are only "+n.length+" tracks in the grid layout.");n[t]=e.value?e.value:""+e.numeric+e.type}),n.join(" ")},e.getSizeAtTrack=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=!1);var i=r?e+1:e;return t.slice(0,i).reduce(function(e,t){return e+t.numeric},0)+(n?e*n:0)},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
/*! grid-template-utils - v1.0.1 */ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.GridTemplateUtils={})}(this,function(e){"use strict";var t=function(e,t){return Number(e.slice(0,-1*t.length))},n=function(e){return e.endsWith("px")?{value:e,type:"px",numeric:t(e,"px")}:e.endsWith("fr")?{value:e,type:"fr",numeric:t(e,"fr")}:e.endsWith("%")?{value:e,type:"%",numeric:t(e,"%")}:"auto"===e?{value:e,type:"auto"}:null};e.parse=function(e){return e.split(" ").map(n)},e.combine=function(e,t){var n=e?e.split(" "):[];return t.forEach(function(e,t){if(t>n.length-1)throw new Error("Unable to set size of track index "+t+", there are only "+n.length+" tracks in the grid layout.");n[t]=e.value?e.value:""+e.numeric+e.type}),n.join(" ")},e.getSizeAtTrack=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=!1);var i=r?e+1:e;return t.slice(0,i).reduce(function(e,t){return e+t.numeric},0)+(n?e*n:0)},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=grid-template-utils.min.js.map |
{ | ||
"name": "grid-template-utils", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Utility functions for working with grid templates", | ||
@@ -5,0 +5,0 @@ "main": "dist/grid-template-utils.js", |
@@ -41,21 +41,21 @@ # Grid Template Utils [![CI](https://img.shields.io/circleci/project/github/nathancahill/split/master.svg)](https://circleci.com/gh/nathancahill/split) ![Dependencies](https://david-dm.org/nathancahill/split/status.svg) [![File size](https://img.badgesize.io/https://unpkg.com/grid-template-utils/dist/grid-template-utils.min.js?compression=gzip&label=size&v=1.0.0)](https://unpkg.com/grid-template-utils/dist/grid-template-utils.min.js) | ||
> parse('1fr 10px 1fr') | ||
{ | ||
0: { | ||
value: '1fr', | ||
type: 'fr', | ||
numeric: 1, | ||
}, | ||
1: { | ||
value: '10px', | ||
type: 'px', | ||
numeric: 10, | ||
}, | ||
2: { | ||
value: '1fr', | ||
type: 'fr', | ||
numeric: 1, | ||
}, | ||
} | ||
[ | ||
{ | ||
value: '1fr', | ||
type: 'fr', | ||
numeric: 1, | ||
}, | ||
{ | ||
value: '10px', | ||
type: 'px', | ||
numeric: 10, | ||
}, | ||
{ | ||
value: '1fr', | ||
type: 'fr', | ||
numeric: 1, | ||
}, | ||
] | ||
> combine('1fr 10px 1fr', { 1: { value: '20px' } }) | ||
> combine('1fr 10px 1fr', [,{ value: '20px' }]) | ||
'1fr 20px 1fr' | ||
@@ -62,0 +62,0 @@ |
Sorry, the diff of this file is not supported yet
11525