@axa-ch/icon
Advanced tools
Comparing version 1.0.0-alpha.2 to 1.0.0-alpha.3
@@ -17,2 +17,3 @@ function ___$insertStyle(css) { | ||
import '@webcomponents/webcomponentsjs'; | ||
import { svg, LitElement } from 'lit-element'; | ||
@@ -43,17 +44,2 @@ import { ArrowRightSvg, CollapseSvg, DownloadSvg, EmailSvg, ExpandSvg, PhoneSvg, PlusSvg, SearchSvg, UploadSvg } from '@axa-ch/materials'; | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
function _inherits(subClass, superClass) { | ||
@@ -136,2 +122,13 @@ if (typeof superClass !== "function" && superClass !== null) { | ||
var defineOnce = (function (name, customElementClass) { | ||
// custom element not already registered? | ||
if (!window.customElements.get(name)) { | ||
// no, register it now | ||
window.customElements.define(name, customElementClass); | ||
} // return its name as a convenience | ||
return name; | ||
}); | ||
var AXAIcon = | ||
@@ -143,2 +140,22 @@ /*#__PURE__*/ | ||
_createClass(AXAIcon, null, [{ | ||
key: "tagName", | ||
get: function get() { | ||
return 'axa-icon'; | ||
} | ||
}, { | ||
key: "iconsMapping", | ||
get: function get() { | ||
return { | ||
'arrow-right': ArrowRightSvg, | ||
collapse: CollapseSvg, | ||
download: DownloadSvg, | ||
email: EmailSvg, | ||
expand: ExpandSvg, | ||
phone: PhoneSvg, | ||
plus: PlusSvg, | ||
search: SearchSvg, | ||
upload: UploadSvg | ||
}; | ||
} | ||
}, { | ||
key: "properties", | ||
@@ -171,5 +188,7 @@ get: function get() { | ||
if (/\.svg/.test(this.icon)) { | ||
var icon = this.icon; | ||
if (/\.svg/.test(icon)) { | ||
var req = new XMLHttpRequest(); | ||
req.open('GET', this.icon); | ||
req.open('GET', icon); | ||
@@ -195,18 +214,4 @@ req.onreadystatechange = function () { | ||
_defineProperty(AXAIcon, "tagName", 'axa-icon'); | ||
defineOnce(AXAIcon.tagName, AXAIcon); | ||
_defineProperty(AXAIcon, "iconsMapping", { | ||
'arrow-right': ArrowRightSvg, | ||
'collapse': CollapseSvg, | ||
'download': DownloadSvg, | ||
'email': EmailSvg, | ||
'expand': ExpandSvg, | ||
'phone': PhoneSvg, | ||
'plus': PlusSvg, | ||
'search': SearchSvg, | ||
'upload': UploadSvg | ||
}); | ||
customElements.define(AXAIcon.tagName, AXAIcon); | ||
export default AXAIcon; |
@@ -18,2 +18,3 @@ function ___$insertStyle(css) { | ||
import val from '@skatejs/val'; | ||
import '@webcomponents/webcomponentsjs'; | ||
import { svg, LitElement } from 'lit-element'; | ||
@@ -48,17 +49,2 @@ import { ArrowRightSvg, CollapseSvg, DownloadSvg, EmailSvg, ExpandSvg, PhoneSvg, PlusSvg, SearchSvg, UploadSvg } from '@axa-ch/materials'; | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
function _inherits(subClass, superClass) { | ||
@@ -141,2 +127,13 @@ if (typeof superClass !== "function" && superClass !== null) { | ||
var defineOnce = (function (name, customElementClass) { | ||
// custom element not already registered? | ||
if (!window.customElements.get(name)) { | ||
// no, register it now | ||
window.customElements.define(name, customElementClass); | ||
} // return its name as a convenience | ||
return name; | ||
}); | ||
var AXAIcon = | ||
@@ -148,2 +145,22 @@ /*#__PURE__*/ | ||
_createClass(AXAIcon, null, [{ | ||
key: "tagName", | ||
get: function get() { | ||
return 'axa-icon'; | ||
} | ||
}, { | ||
key: "iconsMapping", | ||
get: function get() { | ||
return { | ||
'arrow-right': ArrowRightSvg, | ||
collapse: CollapseSvg, | ||
download: DownloadSvg, | ||
email: EmailSvg, | ||
expand: ExpandSvg, | ||
phone: PhoneSvg, | ||
plus: PlusSvg, | ||
search: SearchSvg, | ||
upload: UploadSvg | ||
}; | ||
} | ||
}, { | ||
key: "properties", | ||
@@ -176,5 +193,7 @@ get: function get() { | ||
if (/\.svg/.test(this.icon)) { | ||
var icon = this.icon; | ||
if (/\.svg/.test(icon)) { | ||
var req = new XMLHttpRequest(); | ||
req.open('GET', this.icon); | ||
req.open('GET', icon); | ||
@@ -200,21 +219,8 @@ req.onreadystatechange = function () { | ||
_defineProperty(AXAIcon, "tagName", 'axa-icon'); | ||
defineOnce(AXAIcon.tagName, AXAIcon); | ||
_defineProperty(AXAIcon, "iconsMapping", { | ||
'arrow-right': ArrowRightSvg, | ||
'collapse': CollapseSvg, | ||
'download': DownloadSvg, | ||
'email': EmailSvg, | ||
'expand': ExpandSvg, | ||
'phone': PhoneSvg, | ||
'plus': PlusSvg, | ||
'search': SearchSvg, | ||
'upload': UploadSvg | ||
}); | ||
customElements.define(AXAIcon.tagName, AXAIcon); | ||
var index_react = (function (createElement) { | ||
return function (_ref) { | ||
var icon = _ref.icon; | ||
var _ref$icon = _ref.icon, | ||
icon = _ref$icon === void 0 ? '' : _ref$icon; | ||
return withReact(createElement)(AXAIcon.tagName, { | ||
@@ -221,0 +227,0 @@ icon: icon |
{ | ||
"name": "@axa-ch/icon", | ||
"version": "1.0.0-alpha.2", | ||
"version": "1.0.0-alpha.3", | ||
"description": "> TODO: description", | ||
@@ -26,8 +26,9 @@ "author": "Pattern Warriors", | ||
"dependencies": { | ||
"@axa-ch/materials": "^1.0.0-alpha.3", | ||
"@axa-ch/materials": "^1.0.0-alpha.4", | ||
"@skatejs/val": "^0.4.0", | ||
"@webcomponents/webcomponentsjs": "^2.2.7", | ||
"lit-element": "^2.1.0", | ||
"lit-html": "^1.0.0" | ||
}, | ||
"gitHead": "414c2c3a4e3f119921a2d407d5326040677abb2a" | ||
"gitHead": "6c8e82b6f3a1d7f4b0fef5facb5c607b6a86f4ef" | ||
} |
@@ -1,1 +0,3 @@ | ||
# AXA Versicherungen AG | ||
# Icon | ||
TODO Description |
11498
357
4
5
+ Added@webcomponents/webcomponentsjs@2.8.0(transitive)