349 lines
9.2 KiB
JavaScript
349 lines
9.2 KiB
JavaScript
(function webpackUniversalModuleDefinition(root, factory) {
|
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
module.exports = factory();
|
|
else if(typeof define === 'function' && define.amd)
|
|
define([], factory);
|
|
else if(typeof exports === 'object')
|
|
exports["cssVendor"] = factory();
|
|
else
|
|
root["cssVendor"] = factory();
|
|
})(this, function() {
|
|
return /******/ (function(modules) { // webpackBootstrap
|
|
/******/ // The module cache
|
|
/******/ var installedModules = {};
|
|
|
|
/******/ // The require function
|
|
/******/ function __webpack_require__(moduleId) {
|
|
|
|
/******/ // Check if module is in cache
|
|
/******/ if(installedModules[moduleId])
|
|
/******/ return installedModules[moduleId].exports;
|
|
|
|
/******/ // Create a new module (and put it into the cache)
|
|
/******/ var module = installedModules[moduleId] = {
|
|
/******/ exports: {},
|
|
/******/ id: moduleId,
|
|
/******/ loaded: false
|
|
/******/ };
|
|
|
|
/******/ // Execute the module function
|
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
|
|
/******/ // Flag the module as loaded
|
|
/******/ module.loaded = true;
|
|
|
|
/******/ // Return the exports of the module
|
|
/******/ return module.exports;
|
|
/******/ }
|
|
|
|
|
|
/******/ // expose the modules object (__webpack_modules__)
|
|
/******/ __webpack_require__.m = modules;
|
|
|
|
/******/ // expose the module cache
|
|
/******/ __webpack_require__.c = installedModules;
|
|
|
|
/******/ // __webpack_public_path__
|
|
/******/ __webpack_require__.p = "";
|
|
|
|
/******/ // Load entry module and return exports
|
|
/******/ return __webpack_require__(0);
|
|
/******/ })
|
|
/************************************************************************/
|
|
/******/ ([
|
|
/* 0 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.supportedValue = exports.supportedProperty = exports.prefix = undefined;
|
|
|
|
var _prefix = __webpack_require__(1);
|
|
|
|
var _prefix2 = _interopRequireDefault(_prefix);
|
|
|
|
var _supportedProperty = __webpack_require__(3);
|
|
|
|
var _supportedProperty2 = _interopRequireDefault(_supportedProperty);
|
|
|
|
var _supportedValue = __webpack_require__(5);
|
|
|
|
var _supportedValue2 = _interopRequireDefault(_supportedValue);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
|
|
exports['default'] = {
|
|
prefix: _prefix2['default'],
|
|
supportedProperty: _supportedProperty2['default'],
|
|
supportedValue: _supportedValue2['default']
|
|
}; /**
|
|
* CSS Vendor prefix detection and property feature testing.
|
|
*
|
|
* @copyright Oleg Slobodskoi 2015
|
|
* @website https://github.com/jsstyles/css-vendor
|
|
* @license MIT
|
|
*/
|
|
|
|
exports.prefix = _prefix2['default'];
|
|
exports.supportedProperty = _supportedProperty2['default'];
|
|
exports.supportedValue = _supportedValue2['default'];
|
|
|
|
/***/ },
|
|
/* 1 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
|
|
var _isInBrowser = __webpack_require__(2);
|
|
|
|
var _isInBrowser2 = _interopRequireDefault(_isInBrowser);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
|
|
var js = ''; /**
|
|
* Export javascript style and css style vendor prefixes.
|
|
* Based on "transform" support test.
|
|
*/
|
|
|
|
var css = '';
|
|
|
|
// We should not do anything if required serverside.
|
|
if (_isInBrowser2['default']) {
|
|
// Order matters. We need to check Webkit the last one because
|
|
// other vendors use to add Webkit prefixes to some properties
|
|
var jsCssMap = {
|
|
Moz: '-moz-',
|
|
// IE did it wrong again ...
|
|
ms: '-ms-',
|
|
O: '-o-',
|
|
Webkit: '-webkit-'
|
|
};
|
|
var style = document.createElement('p').style;
|
|
var testProp = 'Transform';
|
|
|
|
for (var key in jsCssMap) {
|
|
if (key + testProp in style) {
|
|
js = key;
|
|
css = jsCssMap[key];
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Vendor prefix string for the current browser.
|
|
*
|
|
* @type {{js: String, css: String}}
|
|
* @api public
|
|
*/
|
|
exports['default'] = { js: js, css: css };
|
|
|
|
/***/ },
|
|
/* 2 */
|
|
/***/ function(module, exports) {
|
|
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
|
|
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
|
|
var isBrowser = exports.isBrowser = (typeof window === "undefined" ? "undefined" : _typeof(window)) === "object" && (typeof document === "undefined" ? "undefined" : _typeof(document)) === 'object' && document.nodeType === 9;
|
|
|
|
exports.default = isBrowser;
|
|
|
|
/***/ },
|
|
/* 3 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports['default'] = supportedProperty;
|
|
|
|
var _isInBrowser = __webpack_require__(2);
|
|
|
|
var _isInBrowser2 = _interopRequireDefault(_isInBrowser);
|
|
|
|
var _prefix = __webpack_require__(1);
|
|
|
|
var _prefix2 = _interopRequireDefault(_prefix);
|
|
|
|
var _camelize = __webpack_require__(4);
|
|
|
|
var _camelize2 = _interopRequireDefault(_camelize);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
|
|
var el = void 0;
|
|
var cache = {};
|
|
|
|
if (_isInBrowser2['default']) {
|
|
el = document.createElement('p');
|
|
|
|
/**
|
|
* We test every property on vendor prefix requirement.
|
|
* Once tested, result is cached. It gives us up to 70% perf boost.
|
|
* http://jsperf.com/element-style-object-access-vs-plain-object
|
|
*
|
|
* Prefill cache with known css properties to reduce amount of
|
|
* properties we need to feature test at runtime.
|
|
* http://davidwalsh.name/vendor-prefix
|
|
*/
|
|
var computed = window.getComputedStyle(document.documentElement, '');
|
|
for (var key in computed) {
|
|
if (!isNaN(key)) cache[computed[key]] = computed[key];
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Test if a property is supported, returns supported property with vendor
|
|
* prefix if required. Returns `false` if not supported.
|
|
*
|
|
* @param {String} prop dash separated
|
|
* @return {String|Boolean}
|
|
* @api public
|
|
*/
|
|
function supportedProperty(prop) {
|
|
// For server-side rendering.
|
|
if (!el) return prop;
|
|
|
|
// We have not tested this prop yet, lets do the test.
|
|
if (cache[prop] != null) return cache[prop];
|
|
|
|
// Camelization is required because we can't test using
|
|
// css syntax for e.g. in FF.
|
|
// Test if property is supported as it is.
|
|
if ((0, _camelize2['default'])(prop) in el.style) {
|
|
cache[prop] = prop;
|
|
}
|
|
// Test if property is supported with vendor prefix.
|
|
else if (_prefix2['default'].js + (0, _camelize2['default'])('-' + prop) in el.style) {
|
|
cache[prop] = _prefix2['default'].css + prop;
|
|
} else {
|
|
cache[prop] = false;
|
|
}
|
|
|
|
return cache[prop];
|
|
}
|
|
|
|
/***/ },
|
|
/* 4 */
|
|
/***/ function(module, exports) {
|
|
|
|
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports['default'] = camelize;
|
|
var regExp = /[-\s]+(.)?/g;
|
|
|
|
/**
|
|
* Convert dash separated strings to camel cased.
|
|
*
|
|
* @param {String} str
|
|
* @return {String}
|
|
*/
|
|
function camelize(str) {
|
|
return str.replace(regExp, toUpper);
|
|
}
|
|
|
|
function toUpper(match, c) {
|
|
return c ? c.toUpperCase() : '';
|
|
}
|
|
|
|
/***/ },
|
|
/* 5 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports['default'] = supportedValue;
|
|
|
|
var _isInBrowser = __webpack_require__(2);
|
|
|
|
var _isInBrowser2 = _interopRequireDefault(_isInBrowser);
|
|
|
|
var _prefix = __webpack_require__(1);
|
|
|
|
var _prefix2 = _interopRequireDefault(_prefix);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
|
|
var cache = {};
|
|
var el = void 0;
|
|
|
|
if (_isInBrowser2['default']) el = document.createElement('p');
|
|
|
|
/**
|
|
* Returns prefixed value if needed. Returns `false` if value is not supported.
|
|
*
|
|
* @param {String} property
|
|
* @param {String} value
|
|
* @return {String|Boolean}
|
|
* @api public
|
|
*/
|
|
function supportedValue(property, value) {
|
|
// For server-side rendering.
|
|
if (!el) return value;
|
|
|
|
// It is a string or a number as a string like '1'.
|
|
// We want only prefixable values here.
|
|
if (typeof value !== 'string' || !isNaN(parseInt(value, 10))) return value;
|
|
|
|
var cacheKey = property + value;
|
|
|
|
if (cache[cacheKey] != null) return cache[cacheKey];
|
|
|
|
// IE can even throw an error in some cases, for e.g. style.content = 'bar'
|
|
try {
|
|
// Test value as it is.
|
|
el.style[property] = value;
|
|
} catch (err) {
|
|
cache[cacheKey] = false;
|
|
return false;
|
|
}
|
|
|
|
// Value is supported as it is.
|
|
if (el.style[property] !== '') {
|
|
cache[cacheKey] = value;
|
|
} else {
|
|
// Test value with vendor prefix.
|
|
value = _prefix2['default'].css + value;
|
|
|
|
// Hardcode test to convert "flex" to "-ms-flexbox" for IE10.
|
|
if (value === '-ms-flex') value = '-ms-flexbox';
|
|
|
|
el.style[property] = value;
|
|
|
|
// Value is supported with vendor prefix.
|
|
if (el.style[property] !== '') cache[cacheKey] = value;
|
|
}
|
|
|
|
if (!cache[cacheKey]) cache[cacheKey] = false;
|
|
|
|
// Reset style value.
|
|
el.style[property] = '';
|
|
|
|
return cache[cacheKey];
|
|
}
|
|
|
|
/***/ }
|
|
/******/ ])
|
|
});
|
|
; |