@rededor/cura 0.1.8 → 0.2.0
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/dist/cjs/{app-globals-7ae6e3ee.js → app-globals-af978331.js} +0 -5
- package/dist/cjs/cura-icon_2.cjs.entry.js +31 -5
- package/dist/cjs/cura.cjs.js +3 -3
- package/dist/cjs/dummy-component.cjs.entry.js +1 -1
- package/dist/cjs/{index-322d0c88.js → index-9092c64d.js} +34 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/collection/api/modules/cura-theme-module.js +0 -5
- package/dist/collection/components/cura-icon/cura-icon.css +7 -53
- package/dist/collection/components/cura-icon/cura-icon.js +31 -3
- package/dist/collection/components/cura-icons-view/cura-icons-view.js +2 -1
- package/dist/components/cura-icon2.js +29 -4
- package/dist/components/cura-icons-view.js +2 -1
- package/dist/components/index.js +0 -5
- package/dist/cura/cura.esm.js +1 -1
- package/dist/cura/cura.js +1 -1
- package/dist/cura/p-3132f4b7.system.js +2 -0
- package/dist/cura/p-70abb532.system.js +1 -0
- package/dist/cura/p-81ae13d7.entry.js +1 -0
- package/dist/cura/{p-26939de0.system.js → p-a0cd4b75.system.js} +0 -0
- package/dist/cura/p-abcda1d1.js +2 -0
- package/dist/cura/{p-d4559ca3.entry.js → p-ac79f9d1.entry.js} +1 -1
- package/dist/cura/{p-cfe07efc.system.entry.js → p-b4c69836.system.entry.js} +1 -1
- package/dist/cura/{p-0e08324a.js → p-d2dcd470.js} +0 -0
- package/dist/cura/p-e1e4b2ea.system.entry.js +1 -0
- package/dist/esm/{app-globals-5c6eb474.js → app-globals-962e5cc3.js} +0 -5
- package/dist/esm/cura-icon_2.entry.js +31 -5
- package/dist/esm/cura.js +3 -3
- package/dist/esm/dummy-component.entry.js +1 -1
- package/dist/esm/{index-70d7a4f9.js → index-cec9b650.js} +34 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm-es5/{app-globals-5c6eb474.js → app-globals-962e5cc3.js} +0 -0
- package/dist/esm-es5/cura-icon_2.entry.js +1 -1
- package/dist/esm-es5/cura.js +1 -1
- package/dist/esm-es5/dummy-component.entry.js +1 -1
- package/dist/esm-es5/index-cec9b650.js +2 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/types/api/cura-api.type.d.ts +1 -1
- package/dist/types/components/cura-icon/cura-icon.d.ts +45 -0
- package/dist/types/components/cura-icons-view/cura-icons-view.d.ts +1 -0
- package/package.json +4 -3
- package/dist/cura/p-25adccc6.system.js +0 -2
- package/dist/cura/p-29a8ae0b.system.entry.js +0 -1
- package/dist/cura/p-54be87f7.js +0 -2
- package/dist/cura/p-c0121c44.entry.js +0 -1
- package/dist/cura/p-cf0d42ef.system.js +0 -1
- package/dist/esm-es5/index-70d7a4f9.js +0 -2
|
@@ -81,7 +81,6 @@ class CuraThemeModule {
|
|
|
81
81
|
/** Set css var based on object structure */
|
|
82
82
|
this.setCssVar = (prop, path) => {
|
|
83
83
|
const varName = this.groupPath(path, prop[0]);
|
|
84
|
-
// console.log('Setting %s: %s', varName, prop[1]);
|
|
85
84
|
this.body.style.setProperty(varName, prop[1]);
|
|
86
85
|
};
|
|
87
86
|
this.groupPath = (a, b) => `${a}-${b}`;
|
|
@@ -103,7 +102,6 @@ class CuraThemeModule {
|
|
|
103
102
|
/** Set css vars from preset object */
|
|
104
103
|
this.buildCssVars = (path, obj) => {
|
|
105
104
|
const entries = Object.entries(obj);
|
|
106
|
-
// console.log('Reading %s', path);
|
|
107
105
|
for (let e of entries) {
|
|
108
106
|
if (this.isObject(e[1])) {
|
|
109
107
|
this.buildCssVars(this.groupPath(path, e[0]), e[1]);
|
|
@@ -121,7 +119,6 @@ class CuraThemeModule {
|
|
|
121
119
|
*/
|
|
122
120
|
load(theme = 'default') {
|
|
123
121
|
const preset = ThemePresets[theme] ? ThemePresets[theme] : ThemePresets.default;
|
|
124
|
-
// console.log('Loading Theme: %s', theme, preset);
|
|
125
122
|
this.buildCssVars(this.prefix, preset);
|
|
126
123
|
}
|
|
127
124
|
/**
|
|
@@ -140,9 +137,7 @@ class CuraThemeModule {
|
|
|
140
137
|
: ThemePresets.default;
|
|
141
138
|
const newTheme = Object.assign({}, JSON.parse(JSON.stringify(preset)));
|
|
142
139
|
this.mergeObject(customTheme.definitions, newTheme);
|
|
143
|
-
// console.log('Custom Theme: %s', newTheme);
|
|
144
140
|
ThemePresets[customTag] = newTheme;
|
|
145
|
-
// console.log('Presets:', ThemePresets);
|
|
146
141
|
this.load(customTag);
|
|
147
142
|
}
|
|
148
143
|
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-9092c64d.js');
|
|
6
6
|
|
|
7
|
-
const curaIconCss = ":host{--stroke-color:#B7B7B7
|
|
7
|
+
const curaIconCss = ":host{--stroke-color:#B7B7B7}:host svg.icon-neutral{--stroke-color:#B7B7B7}:host svg.icon-primary{--stroke-color:var(--cura-color-primary-base, #004186)}:host svg.icon-secondary{--stroke-color:var(--cura-color-secondary-base, #AA8E0B)}:host svg.icon-accent{--stroke-color:var(--cura-color-accent-base, #DF8D2C)}:host svg.icon-success{--stroke-color:#5FD290}:host svg.icon-info{--stroke-color:#6EA8FF}:host svg.icon-error{--stroke-color:#EB5757}:host svg.icon-warning{--stroke-color:#FFCF3C}:host svg.icon-white{--stroke-color:#F6F6F6}:host svg.icon-black{--stroke-color:#262626}:host svg.icon-disabled{--stroke-color:#D4D4D4}:host{width:var(--size);height:var(--size)}:host svg{display:inline-block;stroke:var(--stroke-color);width:var(--size);height:var(--size);stroke-width:var(--stroke);fill:none}";
|
|
8
8
|
|
|
9
9
|
const CuraIcon = class {
|
|
10
10
|
constructor(hostRef) {
|
|
@@ -13,22 +13,47 @@ const CuraIcon = class {
|
|
|
13
13
|
this.color = 'neutral';
|
|
14
14
|
this.iconset = 'default';
|
|
15
15
|
this.disabled = false;
|
|
16
|
+
this.sizes = {
|
|
17
|
+
"128": { size: 128, stroke: 5.25 },
|
|
18
|
+
"72": { size: 72, stroke: 3.5 },
|
|
19
|
+
"64": { size: 64, stroke: 3.25 },
|
|
20
|
+
"48": { size: 48, stroke: 2.75 },
|
|
21
|
+
"40": { size: 40, stroke: 2.5 },
|
|
22
|
+
"32": { size: 32, stroke: 2.25 },
|
|
23
|
+
"24": { size: 24, stroke: 2 },
|
|
24
|
+
"20": { size: 20, stroke: 1.75 },
|
|
25
|
+
"16": { size: 16, stroke: 1.5 },
|
|
26
|
+
"default": { size: 24, stroke: 2 }
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
sizeHandler(size) {
|
|
30
|
+
const scaledStroke = (iconSize) => {
|
|
31
|
+
return `${this.sizes[iconSize].stroke * (this.sizes.default.size / this.sizes[iconSize].size)}px`;
|
|
32
|
+
};
|
|
33
|
+
this.setHostProperty('--size', this.sizes[`${size}`] ? `${this.sizes[size].size}px` : `${this.sizes.default.size}px`);
|
|
34
|
+
this.setHostProperty('--stroke', this.sizes[`${size}`] ? scaledStroke(size) : scaledStroke("default"));
|
|
16
35
|
}
|
|
17
36
|
connectedCallback() {
|
|
18
37
|
this.assetsPath = window.CuraAPI.localAssetsPath;
|
|
38
|
+
this.sizeHandler(this.size);
|
|
19
39
|
}
|
|
20
40
|
getClasses() {
|
|
21
41
|
const classes = {};
|
|
22
42
|
classes[`icon-${this.color}`] = true;
|
|
23
|
-
if (this.size)
|
|
24
|
-
classes[`icon-${this.size}`] = true;
|
|
25
43
|
if (this.disabled)
|
|
26
44
|
classes[`icon-disabled`] = true;
|
|
27
45
|
return classes;
|
|
28
46
|
}
|
|
47
|
+
setHostProperty(prop, value) {
|
|
48
|
+
this.host.style.setProperty(prop, value);
|
|
49
|
+
}
|
|
29
50
|
render() {
|
|
30
51
|
return (index.h(index.Host, null, index.h("svg", { version: "1.1", viewBox: "0 0 24 24", preserveAspectRatio: "xMidYMid meet", xmlns: "http://www.w3.org/2000/svg", class: this.getClasses() }, index.h("use", { xlinkHref: `${this.assetsPath}/icons/iconset-${this.iconset}.svg#${this.name}` }))));
|
|
31
52
|
}
|
|
53
|
+
get host() { return index.getElement(this); }
|
|
54
|
+
static get watchers() { return {
|
|
55
|
+
"size": ["sizeHandler"]
|
|
56
|
+
}; }
|
|
32
57
|
};
|
|
33
58
|
CuraIcon.style = curaIconCss;
|
|
34
59
|
|
|
@@ -40,13 +65,14 @@ const CuraIconsView = class {
|
|
|
40
65
|
constructor(hostRef) {
|
|
41
66
|
index.registerInstance(this, hostRef);
|
|
42
67
|
this.sizes = [16, 20, 24, 32, 40, 48, 64, 72, 128];
|
|
68
|
+
this.colors = ['primary', 'secondary', 'accent', 'info', 'warning', 'error', 'success', 'neutral'];
|
|
43
69
|
this.selected = '360';
|
|
44
70
|
this.setSelected = (icon) => {
|
|
45
71
|
this.selected = icon;
|
|
46
72
|
};
|
|
47
73
|
}
|
|
48
74
|
render() {
|
|
49
|
-
return (index.h(index.Host, null, index.h("div", { class: "iconDetail" }, index.h("h4", null, this.selected), index.h("div", { class: "iconSizes" }, this.sizes.map(size => index.h("div", { class: "size" }, index.h("cura-icon", { name: this.selected, size: size }), index.h("span", null, size)))), index.h("div", { class: "iconSizes invert" }, this.sizes.map(size => index.h("div", { class: "size" }, index.h("cura-icon", { name: this.selected, size: size, color: "white" }), index.h("span", null, size)))), index.h("div", { class: "iconSizes" },
|
|
75
|
+
return (index.h(index.Host, null, index.h("div", { class: "iconDetail" }, index.h("h4", null, this.selected), index.h("div", { class: "iconSizes" }, this.sizes.map(size => index.h("div", { class: "size" }, index.h("cura-icon", { name: this.selected, size: size }), index.h("span", null, size)))), index.h("div", { class: "iconSizes invert" }, this.sizes.map(size => index.h("div", { class: "size" }, index.h("cura-icon", { name: this.selected, size: size, color: "white" }), index.h("span", null, size)))), index.h("div", { class: "iconSizes" }, this.colors.map(color => index.h("div", { class: "size" }, index.h("cura-icon", { name: this.selected, color: color }), index.h("span", null, color))), index.h("div", { class: "size" }, index.h("cura-icon", { name: this.selected, disabled: true }), index.h("span", null, "Disabled")))), index.h("div", { class: "icons" }, iconsetdefaulticons.map(icon => index.h("div", { class: "icon", onClick: () => this.setSelected(icon) }, index.h("cura-icon", { name: icon }), index.h("span", null, icon))))));
|
|
50
76
|
}
|
|
51
77
|
};
|
|
52
78
|
CuraIconsView.style = curaIconsViewCss;
|
package/dist/cjs/cura.cjs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
4
|
-
const appGlobals = require('./app-globals-
|
|
3
|
+
const index = require('./index-9092c64d.js');
|
|
4
|
+
const appGlobals = require('./app-globals-af978331.js');
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
Stencil Client Patch Browser v2.18.1 | MIT Licensed | https://stenciljs.com
|
|
@@ -17,5 +17,5 @@ const patchBrowser = () => {
|
|
|
17
17
|
|
|
18
18
|
patchBrowser().then(options => {
|
|
19
19
|
appGlobals.globalScripts();
|
|
20
|
-
return index.bootstrapLazy([["dummy-component.cjs",[[1,"dummy-component"]]],["cura-icon_2.cjs",[[1,"cura-icons-view",{"selected":[32]}],[1,"cura-icon",{"name":[513],"color":[513],"size":[
|
|
20
|
+
return index.bootstrapLazy([["dummy-component.cjs",[[1,"dummy-component"]]],["cura-icon_2.cjs",[[1,"cura-icons-view",{"selected":[32]}],[1,"cura-icon",{"name":[513],"color":[513],"size":[8],"iconset":[513],"disabled":[516]}]]]], options);
|
|
21
21
|
});
|
|
@@ -186,6 +186,7 @@ const parsePropertyValue = (propValue, propType) => {
|
|
|
186
186
|
// so no need to change to a different type
|
|
187
187
|
return propValue;
|
|
188
188
|
};
|
|
189
|
+
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
189
190
|
/**
|
|
190
191
|
* Helper function to create & dispatch a custom Event on a provided target
|
|
191
192
|
* @param elm the target of the Event
|
|
@@ -922,6 +923,7 @@ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propNam
|
|
|
922
923
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
923
924
|
// check our new property value against our internal value
|
|
924
925
|
const hostRef = getHostRef(ref);
|
|
926
|
+
const elm = hostRef.$hostElement$ ;
|
|
925
927
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
926
928
|
const flags = hostRef.$flags$;
|
|
927
929
|
const instance = hostRef.$lazyInstance$ ;
|
|
@@ -934,6 +936,22 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
934
936
|
// set our new value!
|
|
935
937
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
936
938
|
if (instance) {
|
|
939
|
+
// get an array of method names of watch functions to call
|
|
940
|
+
if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
|
|
941
|
+
const watchMethods = cmpMeta.$watchers$[propName];
|
|
942
|
+
if (watchMethods) {
|
|
943
|
+
// this instance is watching for when this property changed
|
|
944
|
+
watchMethods.map((watchMethodName) => {
|
|
945
|
+
try {
|
|
946
|
+
// fire off each of the watch methods that are watching this property
|
|
947
|
+
instance[watchMethodName](newVal, oldVal, propName);
|
|
948
|
+
}
|
|
949
|
+
catch (e) {
|
|
950
|
+
consoleError(e, elm);
|
|
951
|
+
}
|
|
952
|
+
});
|
|
953
|
+
}
|
|
954
|
+
}
|
|
937
955
|
if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
938
956
|
// looks like this value actually changed, so we've got work to do!
|
|
939
957
|
// but only if we've already rendered, otherwise just chill out
|
|
@@ -956,6 +974,9 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
956
974
|
*/
|
|
957
975
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
958
976
|
if (cmpMeta.$members$) {
|
|
977
|
+
if (Cstr.watchers) {
|
|
978
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
979
|
+
}
|
|
959
980
|
// It's better to have a const than two Object.entries()
|
|
960
981
|
const members = Object.entries(cmpMeta.$members$);
|
|
961
982
|
const prototype = Cstr.prototype;
|
|
@@ -1063,6 +1084,12 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1063
1084
|
endLoad();
|
|
1064
1085
|
}
|
|
1065
1086
|
if (!Cstr.isProxied) {
|
|
1087
|
+
// we've never proxied this Constructor before
|
|
1088
|
+
// let's add the getters/setters to its prototype before
|
|
1089
|
+
// the first time we create an instance of the implementation
|
|
1090
|
+
{
|
|
1091
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1092
|
+
}
|
|
1066
1093
|
proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
|
|
1067
1094
|
Cstr.isProxied = true;
|
|
1068
1095
|
}
|
|
@@ -1086,6 +1113,9 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1086
1113
|
{
|
|
1087
1114
|
hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1088
1115
|
}
|
|
1116
|
+
{
|
|
1117
|
+
hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
|
|
1118
|
+
}
|
|
1089
1119
|
endNewInstance();
|
|
1090
1120
|
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
1091
1121
|
}
|
|
@@ -1198,6 +1228,9 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1198
1228
|
{
|
|
1199
1229
|
cmpMeta.$attrsToReflect$ = [];
|
|
1200
1230
|
}
|
|
1231
|
+
{
|
|
1232
|
+
cmpMeta.$watchers$ = {};
|
|
1233
|
+
}
|
|
1201
1234
|
const tagName = cmpMeta.$tagName$;
|
|
1202
1235
|
const HostElement = class extends HTMLElement {
|
|
1203
1236
|
// StencilLazyHost
|
|
@@ -1371,6 +1404,7 @@ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
|
1371
1404
|
|
|
1372
1405
|
exports.Host = Host;
|
|
1373
1406
|
exports.bootstrapLazy = bootstrapLazy;
|
|
1407
|
+
exports.getElement = getElement;
|
|
1374
1408
|
exports.h = h;
|
|
1375
1409
|
exports.promiseResolve = promiseResolve;
|
|
1376
1410
|
exports.registerInstance = registerInstance;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const appGlobals = require('./app-globals-
|
|
5
|
+
const index = require('./index-9092c64d.js');
|
|
6
|
+
const appGlobals = require('./app-globals-af978331.js');
|
|
7
7
|
|
|
8
8
|
/*
|
|
9
9
|
Stencil Client Patch Esm v2.18.1 | MIT Licensed | https://stenciljs.com
|
|
@@ -16,7 +16,7 @@ const defineCustomElements = (win, options) => {
|
|
|
16
16
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
17
17
|
return patchEsm().then(() => {
|
|
18
18
|
appGlobals.globalScripts();
|
|
19
|
-
return index.bootstrapLazy([["dummy-component.cjs",[[1,"dummy-component"]]],["cura-icon_2.cjs",[[1,"cura-icons-view",{"selected":[32]}],[1,"cura-icon",{"name":[513],"color":[513],"size":[
|
|
19
|
+
return index.bootstrapLazy([["dummy-component.cjs",[[1,"dummy-component"]]],["cura-icon_2.cjs",[[1,"cura-icons-view",{"selected":[32]}],[1,"cura-icon",{"name":[513],"color":[513],"size":[8],"iconset":[513],"disabled":[516]}]]]], options);
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -6,7 +6,6 @@ export default class CuraThemeModule {
|
|
|
6
6
|
/** Set css var based on object structure */
|
|
7
7
|
this.setCssVar = (prop, path) => {
|
|
8
8
|
const varName = this.groupPath(path, prop[0]);
|
|
9
|
-
// console.log('Setting %s: %s', varName, prop[1]);
|
|
10
9
|
this.body.style.setProperty(varName, prop[1]);
|
|
11
10
|
};
|
|
12
11
|
this.groupPath = (a, b) => `${a}-${b}`;
|
|
@@ -28,7 +27,6 @@ export default class CuraThemeModule {
|
|
|
28
27
|
/** Set css vars from preset object */
|
|
29
28
|
this.buildCssVars = (path, obj) => {
|
|
30
29
|
const entries = Object.entries(obj);
|
|
31
|
-
// console.log('Reading %s', path);
|
|
32
30
|
for (let e of entries) {
|
|
33
31
|
if (this.isObject(e[1])) {
|
|
34
32
|
this.buildCssVars(this.groupPath(path, e[0]), e[1]);
|
|
@@ -46,7 +44,6 @@ export default class CuraThemeModule {
|
|
|
46
44
|
*/
|
|
47
45
|
load(theme = 'default') {
|
|
48
46
|
const preset = ThemePresets[theme] ? ThemePresets[theme] : ThemePresets.default;
|
|
49
|
-
// console.log('Loading Theme: %s', theme, preset);
|
|
50
47
|
this.buildCssVars(this.prefix, preset);
|
|
51
48
|
}
|
|
52
49
|
/**
|
|
@@ -65,9 +62,7 @@ export default class CuraThemeModule {
|
|
|
65
62
|
: ThemePresets.default;
|
|
66
63
|
const newTheme = Object.assign({}, JSON.parse(JSON.stringify(preset)));
|
|
67
64
|
this.mergeObject(customTheme.definitions, newTheme);
|
|
68
|
-
// console.log('Custom Theme: %s', newTheme);
|
|
69
65
|
ThemePresets[customTag] = newTheme;
|
|
70
|
-
// console.log('Presets:', ThemePresets);
|
|
71
66
|
this.load(customTag);
|
|
72
67
|
}
|
|
73
68
|
}
|
|
@@ -2,58 +2,8 @@
|
|
|
2
2
|
/* Private */
|
|
3
3
|
/* Colors */
|
|
4
4
|
/* Lists */
|
|
5
|
-
/* Sizes */
|
|
6
|
-
/* Strokes */
|
|
7
5
|
:host {
|
|
8
6
|
--stroke-color: #B7B7B7;
|
|
9
|
-
--stroke-width: 2px;
|
|
10
|
-
--width: 24px;
|
|
11
|
-
--height: 24px;
|
|
12
|
-
}
|
|
13
|
-
:host svg.icon-128 {
|
|
14
|
-
--width: 128px;
|
|
15
|
-
--height: 128px;
|
|
16
|
-
--stroke-width: 0.984375px;
|
|
17
|
-
}
|
|
18
|
-
:host svg.icon-72 {
|
|
19
|
-
--width: 72px;
|
|
20
|
-
--height: 72px;
|
|
21
|
-
--stroke-width: 1.1666666667px;
|
|
22
|
-
}
|
|
23
|
-
:host svg.icon-64 {
|
|
24
|
-
--width: 64px;
|
|
25
|
-
--height: 64px;
|
|
26
|
-
--stroke-width: 1.21875px;
|
|
27
|
-
}
|
|
28
|
-
:host svg.icon-48 {
|
|
29
|
-
--width: 48px;
|
|
30
|
-
--height: 48px;
|
|
31
|
-
--stroke-width: 1.375px;
|
|
32
|
-
}
|
|
33
|
-
:host svg.icon-40 {
|
|
34
|
-
--width: 40px;
|
|
35
|
-
--height: 40px;
|
|
36
|
-
--stroke-width: 1.5px;
|
|
37
|
-
}
|
|
38
|
-
:host svg.icon-32 {
|
|
39
|
-
--width: 32px;
|
|
40
|
-
--height: 32px;
|
|
41
|
-
--stroke-width: 1.6875px;
|
|
42
|
-
}
|
|
43
|
-
:host svg.icon-24 {
|
|
44
|
-
--width: 24px;
|
|
45
|
-
--height: 24px;
|
|
46
|
-
--stroke-width: 2px;
|
|
47
|
-
}
|
|
48
|
-
:host svg.icon-20 {
|
|
49
|
-
--width: 20px;
|
|
50
|
-
--height: 20px;
|
|
51
|
-
--stroke-width: 2.1px;
|
|
52
|
-
}
|
|
53
|
-
:host svg.icon-16 {
|
|
54
|
-
--width: 16px;
|
|
55
|
-
--height: 16px;
|
|
56
|
-
--stroke-width: 2.25px;
|
|
57
7
|
}
|
|
58
8
|
:host svg.icon-neutral {
|
|
59
9
|
--stroke-color: #B7B7B7;
|
|
@@ -89,11 +39,15 @@
|
|
|
89
39
|
--stroke-color: #D4D4D4;
|
|
90
40
|
}
|
|
91
41
|
|
|
42
|
+
:host {
|
|
43
|
+
width: var(--size);
|
|
44
|
+
height: var(--size);
|
|
45
|
+
}
|
|
92
46
|
:host svg {
|
|
93
47
|
display: inline-block;
|
|
94
48
|
stroke: var(--stroke-color);
|
|
95
|
-
width: var(--
|
|
96
|
-
height: var(--
|
|
97
|
-
stroke-width: var(--stroke
|
|
49
|
+
width: var(--size);
|
|
50
|
+
height: var(--size);
|
|
51
|
+
stroke-width: var(--stroke);
|
|
98
52
|
fill: none;
|
|
99
53
|
}
|
|
@@ -5,19 +5,40 @@ export class CuraIcon {
|
|
|
5
5
|
this.color = 'neutral';
|
|
6
6
|
this.iconset = 'default';
|
|
7
7
|
this.disabled = false;
|
|
8
|
+
this.sizes = {
|
|
9
|
+
"128": { size: 128, stroke: 5.25 },
|
|
10
|
+
"72": { size: 72, stroke: 3.5 },
|
|
11
|
+
"64": { size: 64, stroke: 3.25 },
|
|
12
|
+
"48": { size: 48, stroke: 2.75 },
|
|
13
|
+
"40": { size: 40, stroke: 2.5 },
|
|
14
|
+
"32": { size: 32, stroke: 2.25 },
|
|
15
|
+
"24": { size: 24, stroke: 2 },
|
|
16
|
+
"20": { size: 20, stroke: 1.75 },
|
|
17
|
+
"16": { size: 16, stroke: 1.5 },
|
|
18
|
+
"default": { size: 24, stroke: 2 }
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
sizeHandler(size) {
|
|
22
|
+
const scaledStroke = (iconSize) => {
|
|
23
|
+
return `${this.sizes[iconSize].stroke * (this.sizes.default.size / this.sizes[iconSize].size)}px`;
|
|
24
|
+
};
|
|
25
|
+
this.setHostProperty('--size', this.sizes[`${size}`] ? `${this.sizes[size].size}px` : `${this.sizes.default.size}px`);
|
|
26
|
+
this.setHostProperty('--stroke', this.sizes[`${size}`] ? scaledStroke(size) : scaledStroke("default"));
|
|
8
27
|
}
|
|
9
28
|
connectedCallback() {
|
|
10
29
|
this.assetsPath = window.CuraAPI.localAssetsPath;
|
|
30
|
+
this.sizeHandler(this.size);
|
|
11
31
|
}
|
|
12
32
|
getClasses() {
|
|
13
33
|
const classes = {};
|
|
14
34
|
classes[`icon-${this.color}`] = true;
|
|
15
|
-
if (this.size)
|
|
16
|
-
classes[`icon-${this.size}`] = true;
|
|
17
35
|
if (this.disabled)
|
|
18
36
|
classes[`icon-disabled`] = true;
|
|
19
37
|
return classes;
|
|
20
38
|
}
|
|
39
|
+
setHostProperty(prop, value) {
|
|
40
|
+
this.host.style.setProperty(prop, value);
|
|
41
|
+
}
|
|
21
42
|
render() {
|
|
22
43
|
return (h(Host, null, h("svg", { version: "1.1", viewBox: "0 0 24 24", preserveAspectRatio: "xMidYMid meet", xmlns: "http://www.w3.org/2000/svg", class: this.getClasses() }, h("use", { xlinkHref: `${this.assetsPath}/icons/iconset-${this.iconset}.svg#${this.name}` }))));
|
|
23
44
|
}
|
|
@@ -86,7 +107,7 @@ export class CuraIcon {
|
|
|
86
107
|
"text": ""
|
|
87
108
|
},
|
|
88
109
|
"attribute": "size",
|
|
89
|
-
"reflect":
|
|
110
|
+
"reflect": false
|
|
90
111
|
},
|
|
91
112
|
"iconset": {
|
|
92
113
|
"type": "string",
|
|
@@ -126,4 +147,11 @@ export class CuraIcon {
|
|
|
126
147
|
}
|
|
127
148
|
};
|
|
128
149
|
}
|
|
150
|
+
static get elementRef() { return "host"; }
|
|
151
|
+
static get watchers() {
|
|
152
|
+
return [{
|
|
153
|
+
"propName": "size",
|
|
154
|
+
"methodName": "sizeHandler"
|
|
155
|
+
}];
|
|
156
|
+
}
|
|
129
157
|
}
|
|
@@ -3,13 +3,14 @@ import iconsetdefaulticons from '../../assets/icons/iconset-default-list';
|
|
|
3
3
|
export class CuraIconsView {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.sizes = [16, 20, 24, 32, 40, 48, 64, 72, 128];
|
|
6
|
+
this.colors = ['primary', 'secondary', 'accent', 'info', 'warning', 'error', 'success', 'neutral'];
|
|
6
7
|
this.selected = '360';
|
|
7
8
|
this.setSelected = (icon) => {
|
|
8
9
|
this.selected = icon;
|
|
9
10
|
};
|
|
10
11
|
}
|
|
11
12
|
render() {
|
|
12
|
-
return (h(Host, null, h("div", { class: "iconDetail" }, h("h4", null, this.selected), h("div", { class: "iconSizes" }, this.sizes.map(size => h("div", { class: "size" }, h("cura-icon", { name: this.selected, size: size }), h("span", null, size)))), h("div", { class: "iconSizes invert" }, this.sizes.map(size => h("div", { class: "size" }, h("cura-icon", { name: this.selected, size: size, color: "white" }), h("span", null, size)))), h("div", { class: "iconSizes" },
|
|
13
|
+
return (h(Host, null, h("div", { class: "iconDetail" }, h("h4", null, this.selected), h("div", { class: "iconSizes" }, this.sizes.map(size => h("div", { class: "size" }, h("cura-icon", { name: this.selected, size: size }), h("span", null, size)))), h("div", { class: "iconSizes invert" }, this.sizes.map(size => h("div", { class: "size" }, h("cura-icon", { name: this.selected, size: size, color: "white" }), h("span", null, size)))), h("div", { class: "iconSizes" }, this.colors.map(color => h("div", { class: "size" }, h("cura-icon", { name: this.selected, color: color }), h("span", null, color))), h("div", { class: "size" }, h("cura-icon", { name: this.selected, disabled: true }), h("span", null, "Disabled")))), h("div", { class: "icons" }, iconsetdefaulticons.map(icon => h("div", { class: "icon", onClick: () => this.setSelected(icon) }, h("cura-icon", { name: icon }), h("span", null, icon))))));
|
|
13
14
|
}
|
|
14
15
|
static get is() { return "cura-icons-view"; }
|
|
15
16
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
|
-
const curaIconCss = ":host{--stroke-color:#B7B7B7
|
|
3
|
+
const curaIconCss = ":host{--stroke-color:#B7B7B7}:host svg.icon-neutral{--stroke-color:#B7B7B7}:host svg.icon-primary{--stroke-color:var(--cura-color-primary-base, #004186)}:host svg.icon-secondary{--stroke-color:var(--cura-color-secondary-base, #AA8E0B)}:host svg.icon-accent{--stroke-color:var(--cura-color-accent-base, #DF8D2C)}:host svg.icon-success{--stroke-color:#5FD290}:host svg.icon-info{--stroke-color:#6EA8FF}:host svg.icon-error{--stroke-color:#EB5757}:host svg.icon-warning{--stroke-color:#FFCF3C}:host svg.icon-white{--stroke-color:#F6F6F6}:host svg.icon-black{--stroke-color:#262626}:host svg.icon-disabled{--stroke-color:#D4D4D4}:host{width:var(--size);height:var(--size)}:host svg{display:inline-block;stroke:var(--stroke-color);width:var(--size);height:var(--size);stroke-width:var(--stroke);fill:none}";
|
|
4
4
|
|
|
5
5
|
const CuraIcon = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
6
|
constructor() {
|
|
@@ -11,27 +11,52 @@ const CuraIcon = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
11
11
|
this.color = 'neutral';
|
|
12
12
|
this.iconset = 'default';
|
|
13
13
|
this.disabled = false;
|
|
14
|
+
this.sizes = {
|
|
15
|
+
"128": { size: 128, stroke: 5.25 },
|
|
16
|
+
"72": { size: 72, stroke: 3.5 },
|
|
17
|
+
"64": { size: 64, stroke: 3.25 },
|
|
18
|
+
"48": { size: 48, stroke: 2.75 },
|
|
19
|
+
"40": { size: 40, stroke: 2.5 },
|
|
20
|
+
"32": { size: 32, stroke: 2.25 },
|
|
21
|
+
"24": { size: 24, stroke: 2 },
|
|
22
|
+
"20": { size: 20, stroke: 1.75 },
|
|
23
|
+
"16": { size: 16, stroke: 1.5 },
|
|
24
|
+
"default": { size: 24, stroke: 2 }
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
sizeHandler(size) {
|
|
28
|
+
const scaledStroke = (iconSize) => {
|
|
29
|
+
return `${this.sizes[iconSize].stroke * (this.sizes.default.size / this.sizes[iconSize].size)}px`;
|
|
30
|
+
};
|
|
31
|
+
this.setHostProperty('--size', this.sizes[`${size}`] ? `${this.sizes[size].size}px` : `${this.sizes.default.size}px`);
|
|
32
|
+
this.setHostProperty('--stroke', this.sizes[`${size}`] ? scaledStroke(size) : scaledStroke("default"));
|
|
14
33
|
}
|
|
15
34
|
connectedCallback() {
|
|
16
35
|
this.assetsPath = window.CuraAPI.localAssetsPath;
|
|
36
|
+
this.sizeHandler(this.size);
|
|
17
37
|
}
|
|
18
38
|
getClasses() {
|
|
19
39
|
const classes = {};
|
|
20
40
|
classes[`icon-${this.color}`] = true;
|
|
21
|
-
if (this.size)
|
|
22
|
-
classes[`icon-${this.size}`] = true;
|
|
23
41
|
if (this.disabled)
|
|
24
42
|
classes[`icon-disabled`] = true;
|
|
25
43
|
return classes;
|
|
26
44
|
}
|
|
45
|
+
setHostProperty(prop, value) {
|
|
46
|
+
this.host.style.setProperty(prop, value);
|
|
47
|
+
}
|
|
27
48
|
render() {
|
|
28
49
|
return (h(Host, null, h("svg", { version: "1.1", viewBox: "0 0 24 24", preserveAspectRatio: "xMidYMid meet", xmlns: "http://www.w3.org/2000/svg", class: this.getClasses() }, h("use", { xlinkHref: `${this.assetsPath}/icons/iconset-${this.iconset}.svg#${this.name}` }))));
|
|
29
50
|
}
|
|
51
|
+
get host() { return this; }
|
|
52
|
+
static get watchers() { return {
|
|
53
|
+
"size": ["sizeHandler"]
|
|
54
|
+
}; }
|
|
30
55
|
static get style() { return curaIconCss; }
|
|
31
56
|
}, [1, "cura-icon", {
|
|
32
57
|
"name": [513],
|
|
33
58
|
"color": [513],
|
|
34
|
-
"size": [
|
|
59
|
+
"size": [8],
|
|
35
60
|
"iconset": [513],
|
|
36
61
|
"disabled": [516]
|
|
37
62
|
}]);
|
|
@@ -11,13 +11,14 @@ const CuraIconsView$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
11
11
|
this.__registerHost();
|
|
12
12
|
this.__attachShadow();
|
|
13
13
|
this.sizes = [16, 20, 24, 32, 40, 48, 64, 72, 128];
|
|
14
|
+
this.colors = ['primary', 'secondary', 'accent', 'info', 'warning', 'error', 'success', 'neutral'];
|
|
14
15
|
this.selected = '360';
|
|
15
16
|
this.setSelected = (icon) => {
|
|
16
17
|
this.selected = icon;
|
|
17
18
|
};
|
|
18
19
|
}
|
|
19
20
|
render() {
|
|
20
|
-
return (h(Host, null, h("div", { class: "iconDetail" }, h("h4", null, this.selected), h("div", { class: "iconSizes" }, this.sizes.map(size => h("div", { class: "size" }, h("cura-icon", { name: this.selected, size: size }), h("span", null, size)))), h("div", { class: "iconSizes invert" }, this.sizes.map(size => h("div", { class: "size" }, h("cura-icon", { name: this.selected, size: size, color: "white" }), h("span", null, size)))), h("div", { class: "iconSizes" },
|
|
21
|
+
return (h(Host, null, h("div", { class: "iconDetail" }, h("h4", null, this.selected), h("div", { class: "iconSizes" }, this.sizes.map(size => h("div", { class: "size" }, h("cura-icon", { name: this.selected, size: size }), h("span", null, size)))), h("div", { class: "iconSizes invert" }, this.sizes.map(size => h("div", { class: "size" }, h("cura-icon", { name: this.selected, size: size, color: "white" }), h("span", null, size)))), h("div", { class: "iconSizes" }, this.colors.map(color => h("div", { class: "size" }, h("cura-icon", { name: this.selected, color: color }), h("span", null, color))), h("div", { class: "size" }, h("cura-icon", { name: this.selected, disabled: true }), h("span", null, "Disabled")))), h("div", { class: "icons" }, iconsetdefaulticons.map(icon => h("div", { class: "icon", onClick: () => this.setSelected(icon) }, h("cura-icon", { name: icon }), h("span", null, icon))))));
|
|
21
22
|
}
|
|
22
23
|
static get style() { return curaIconsViewCss; }
|
|
23
24
|
}, [1, "cura-icons-view", {
|
package/dist/components/index.js
CHANGED
|
@@ -84,7 +84,6 @@ class CuraThemeModule {
|
|
|
84
84
|
/** Set css var based on object structure */
|
|
85
85
|
this.setCssVar = (prop, path) => {
|
|
86
86
|
const varName = this.groupPath(path, prop[0]);
|
|
87
|
-
// console.log('Setting %s: %s', varName, prop[1]);
|
|
88
87
|
this.body.style.setProperty(varName, prop[1]);
|
|
89
88
|
};
|
|
90
89
|
this.groupPath = (a, b) => `${a}-${b}`;
|
|
@@ -106,7 +105,6 @@ class CuraThemeModule {
|
|
|
106
105
|
/** Set css vars from preset object */
|
|
107
106
|
this.buildCssVars = (path, obj) => {
|
|
108
107
|
const entries = Object.entries(obj);
|
|
109
|
-
// console.log('Reading %s', path);
|
|
110
108
|
for (let e of entries) {
|
|
111
109
|
if (this.isObject(e[1])) {
|
|
112
110
|
this.buildCssVars(this.groupPath(path, e[0]), e[1]);
|
|
@@ -124,7 +122,6 @@ class CuraThemeModule {
|
|
|
124
122
|
*/
|
|
125
123
|
load(theme = 'default') {
|
|
126
124
|
const preset = ThemePresets[theme] ? ThemePresets[theme] : ThemePresets.default;
|
|
127
|
-
// console.log('Loading Theme: %s', theme, preset);
|
|
128
125
|
this.buildCssVars(this.prefix, preset);
|
|
129
126
|
}
|
|
130
127
|
/**
|
|
@@ -143,9 +140,7 @@ class CuraThemeModule {
|
|
|
143
140
|
: ThemePresets.default;
|
|
144
141
|
const newTheme = Object.assign({}, JSON.parse(JSON.stringify(preset)));
|
|
145
142
|
this.mergeObject(customTheme.definitions, newTheme);
|
|
146
|
-
// console.log('Custom Theme: %s', newTheme);
|
|
147
143
|
ThemePresets[customTag] = newTheme;
|
|
148
|
-
// console.log('Presets:', ThemePresets);
|
|
149
144
|
this.load(customTag);
|
|
150
145
|
}
|
|
151
146
|
}
|
package/dist/cura/cura.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import{p as o,b as c}from"./p-abcda1d1.js";import{g as e}from"./p-d2dcd470.js";(()=>{const c=import.meta.url,e={};return""!==c&&(e.resourcesUrl=new URL(".",c).href),o(e)})().then((o=>(e(),c([["p-ac79f9d1",[[1,"dummy-component"]]],["p-81ae13d7",[[1,"cura-icons-view",{selected:[32]}],[1,"cura-icon",{name:[513],color:[513],size:[8],iconset:[513],disabled:[516]}]]]],o))));
|
package/dist/cura/cura.js
CHANGED
|
@@ -115,7 +115,7 @@ DOMTokenList
|
|
|
115
115
|
var resourcesUrl = scriptElm ? scriptElm.getAttribute('data-resources-url') || scriptElm.src : '';
|
|
116
116
|
var start = function() {
|
|
117
117
|
// if src is not present then origin is "null", and new URL() throws TypeError: Failed to construct 'URL': Invalid base URL
|
|
118
|
-
var url = new URL('./p-
|
|
118
|
+
var url = new URL('./p-70abb532.system.js', new URL(resourcesUrl, window.location.origin !== 'null' ? window.location.origin : undefined));
|
|
119
119
|
System.import(url.href);
|
|
120
120
|
};
|
|
121
121
|
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var __extends=this&&this.__extends||function(){var e=function(t,r){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]};return e(t,r)};return function(t,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var __awaiter=this&&this.__awaiter||function(e,t,r,n){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function l(e){try{s(n.next(e))}catch(e){i(e)}}function o(e){try{s(n["throw"](e))}catch(e){i(e)}}function s(e){e.done?r(e.value):a(e.value).then(l,o)}s((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,l;return l={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function o(e){return function(t){return s([e,t])}}function s(l){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,a&&(i=l[0]&2?a["return"]:l[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,l[1])).done)return i;if(a=0,i)l=[l[0]&2,i.value];switch(l[0]){case 0:case 1:i=l;break;case 4:r.label++;return{value:l[1],done:false};case 5:r.label++;a=l[1];l=[0];continue;case 7:l=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){r.label=l[1];break}if(l[0]===6&&r.label<i[1]){r.label=i[1];i=l;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(l);break}if(i[2])r.ops.pop();r.trys.pop();continue}l=t.call(e,r)}catch(e){l=[6,e];a=0}finally{n=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,i;n<a;n++){if(i||!(n in t)){if(!i)i=Array.prototype.slice.call(t,0,n);i[n]=t[n]}}return e.concat(i||Array.prototype.slice.call(t))};System.register([],(function(e,t){"use strict";return{execute:function(){var r=this;var n="cura";var a;var i;var l=false;var o=false;var s=function(e,t){if(t===void 0){t=""}{return function(){return}}};var f=function(e,t){{return function(){return}}};var u="{visibility:hidden}.hydrated{visibility:inherit}";var c="http://www.w3.org/1999/xlink";var $={};var v="http://www.w3.org/2000/svg";var h="http://www.w3.org/1999/xhtml";var p=function(e){return e!=null};var d=function(e){e=typeof e;return e==="object"||e==="function"};var m=e("h",(function(e,t){var r=[];for(var n=2;n<arguments.length;n++){r[n-2]=arguments[n]}var a=null;var i=false;var l=false;var o=[];var s=function(t){for(var r=0;r<t.length;r++){a=t[r];if(Array.isArray(a)){s(a)}else if(a!=null&&typeof a!=="boolean"){if(i=typeof e!=="function"&&!d(a)){a=String(a)}if(i&&l){o[o.length-1].$text$+=a}else{o.push(i?g(null,a):a)}l=i}}};s(r);if(t){{var f=t.className||t.class;if(f){t.class=typeof f!=="object"?f:Object.keys(f).filter((function(e){return f[e]})).join(" ")}}}var u=g(e,null);u.$attrs$=t;if(o.length>0){u.$children$=o}return u}));var g=function(e,t){var r={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null};{r.$attrs$=null}return r};var y=e("H",{});var w=function(e){return e&&e.$tag$===y};var b=function(e,t){if(e!=null&&!d(e)){if(t&4){return e==="false"?false:e===""||!!e}if(t&1){return String(e)}return e}return e};var _=e("g",(function(e){return ie(e).$hostElement$}));var S=function(e,t,r){var n=pe.ce(t,r);e.dispatchEvent(n);return n};var N=new WeakMap;var R=function(e,t,r){var n=$e.get(e);if(me&&r){n=n||new CSSStyleSheet;if(typeof n==="string"){n=t}else{n.replaceSync(t)}}else{n=t}$e.set(e,n)};var x=function(e,t,r,n){var a=C(t);var i=$e.get(a);e=e.nodeType===11?e:he;if(i){if(typeof i==="string"){e=e.head||e;var l=N.get(e);var o=void 0;if(!l){N.set(e,l=new Set)}if(!l.has(a)){{{o=he.createElement("style");o.innerHTML=i}e.insertBefore(o,e.querySelector("link"))}if(l){l.add(a)}}}else if(!e.adoptedStyleSheets.includes(i)){e.adoptedStyleSheets=__spreadArray(__spreadArray([],e.adoptedStyleSheets,true),[i],false)}}return a};var j=function(e){var t=e.$cmpMeta$;var r=e.$hostElement$;var n=t.$flags$;var a=s("attachStyles",t.$tagName$);var i=x(r.shadowRoot?r.shadowRoot:r.getRootNode(),t);if(n&10){r["s-sc"]=i;r.classList.add(i+"-h")}a()};var C=function(e,t){return"sc-"+e.$tagName$};var E=function(e,t,r,n,a,i){if(r!==n){var l=se(e,t);var o=t.toLowerCase();if(t==="class"){var s=e.classList;var f=A(r);var u=A(n);s.remove.apply(s,f.filter((function(e){return e&&!u.includes(e)})));s.add.apply(s,u.filter((function(e){return e&&!f.includes(e)})))}else if(!l&&t[0]==="o"&&t[1]==="n"){if(t[2]==="-"){t=t.slice(3)}else if(se(ve,o)){t=o.slice(2)}else{t=o[2]+t.slice(3)}if(r){pe.rel(e,t,r,false)}if(n){pe.ael(e,t,n,false)}}else{var $=d(n);if((l||$&&n!==null)&&!a){try{if(!e.tagName.includes("-")){var v=n==null?"":n;if(t==="list"){l=false}else if(r==null||e[t]!=v){e[t]=v}}else{e[t]=n}}catch(e){}}var h=false;{if(o!==(o=o.replace(/^xlink\:?/,""))){t=o;h=true}}if(n==null||n===false){if(n!==false||e.getAttribute(t)===""){if(h){e.removeAttributeNS(c,t)}else{e.removeAttribute(t)}}}else if((!l||i&4||a)&&!$){n=n===true?"":n;if(h){e.setAttributeNS(c,t,n)}else{e.setAttribute(t,n)}}}}};var k=/\s/;var A=function(e){return!e?[]:e.split(k)};var M=function(e,t,r,n){var a=t.$elm$.nodeType===11&&t.$elm$.host?t.$elm$.host:t.$elm$;var i=e&&e.$attrs$||$;var l=t.$attrs$||$;{for(n in i){if(!(n in l)){E(a,n,i[n],undefined,r,t.$flags$)}}}for(n in l){E(a,n,i[n],l[n],r,t.$flags$)}};var O=function(e,t,r,n){var i=t.$children$[r];var o=0;var s;var f;if(i.$text$!==null){s=i.$elm$=he.createTextNode(i.$text$)}else{if(!l){l=i.$tag$==="svg"}s=i.$elm$=he.createElementNS(l?v:h,i.$tag$);if(l&&i.$tag$==="foreignObject"){l=false}{M(null,i,l)}if(p(a)&&s["s-si"]!==a){s.classList.add(s["s-si"]=a)}if(i.$children$){for(o=0;o<i.$children$.length;++o){f=O(e,i,o);if(f){s.appendChild(f)}}}{if(i.$tag$==="svg"){l=false}else if(s.tagName==="foreignObject"){l=true}}}return s};var P=function(e,t,r,n,a,l){var o=e;var s;if(o.shadowRoot&&o.tagName===i){o=o.shadowRoot}for(;a<=l;++a){if(n[a]){s=O(null,r,a);if(s){n[a].$elm$=s;o.insertBefore(s,t)}}}};var T=function(e,t,r,n,a){for(;t<=r;++t){if(n=e[t]){a=n.$elm$;a.remove()}}};var L=function(e,t,r,n){var a=0;var i=0;var l=t.length-1;var o=t[0];var s=t[l];var f=n.length-1;var u=n[0];var c=n[f];var $;while(a<=l&&i<=f){if(o==null){o=t[++a]}else if(s==null){s=t[--l]}else if(u==null){u=n[++i]}else if(c==null){c=n[--f]}else if(I(o,u)){B(o,u);o=t[++a];u=n[++i]}else if(I(s,c)){B(s,c);s=t[--l];c=n[--f]}else if(I(o,c)){B(o,c);e.insertBefore(o.$elm$,s.$elm$.nextSibling);o=t[++a];c=n[--f]}else if(I(s,u)){B(s,u);e.insertBefore(s.$elm$,o.$elm$);s=t[--l];u=n[++i]}else{{$=O(t&&t[i],r,i);u=n[++i]}if($){{o.$elm$.parentNode.insertBefore($,o.$elm$)}}}}if(a>l){P(e,n[f+1]==null?null:n[f+1].$elm$,r,n,i,f)}else if(i>f){T(t,a,l)}};var I=function(e,t){if(e.$tag$===t.$tag$){return true}return false};var B=function(e,t){var r=t.$elm$=e.$elm$;var n=e.$children$;var a=t.$children$;var i=t.$tag$;var o=t.$text$;if(o===null){{l=i==="svg"?true:i==="foreignObject"?false:l}{if(i==="slot");else{M(e,t,l)}}if(n!==null&&a!==null){L(r,n,t,a)}else if(a!==null){if(e.$text$!==null){r.textContent=""}P(r,null,t,a,0,a.length-1)}else if(n!==null){T(n,0,n.length-1)}if(l&&i==="svg"){l=false}}else if(e.$text$!==o){r.data=o}};var z=function(e,t){var r=e.$hostElement$;var n=e.$cmpMeta$;var l=e.$vnode$||g(null,null);var o=w(t)?t:m(null,null,t);i=r.tagName;if(n.$attrsToReflect$){o.$attrs$=o.$attrs$||{};n.$attrsToReflect$.map((function(e){var t=e[0],n=e[1];return o.$attrs$[n]=r[t]}))}o.$tag$=null;o.$flags$|=4;e.$vnode$=o;o.$elm$=l.$elm$=r.shadowRoot||r;{a=r["s-sc"]}B(l,o)};var U=function(e,t){if(t&&!e.$onRenderResolve$&&t["s-p"]){t["s-p"].push(new Promise((function(t){return e.$onRenderResolve$=t})))}};var H=function(e,t){{e.$flags$|=16}if(e.$flags$&4){e.$flags$|=512;return}U(e,e.$ancestorComponent$);var r=function(){return V(e,t)};return Ne(r)};var V=function(e,t){var r=s("scheduleUpdate",e.$cmpMeta$.$tagName$);var n=e.$lazyInstance$;var a;r();return J(a,(function(){return q(e,n,t)}))};var q=function(e,t,n){return __awaiter(r,void 0,void 0,(function(){var r,a,i,l,o,f;return __generator(this,(function(u){r=e.$hostElement$;a=s("update",e.$cmpMeta$.$tagName$);i=r["s-rc"];if(n){j(e)}l=s("render",e.$cmpMeta$.$tagName$);{W(e,t)}if(i){i.map((function(e){return e()}));r["s-rc"]=undefined}l();a();{o=r["s-p"];f=function(){return F(e)};if(o.length===0){f()}else{Promise.all(o).then(f);e.$flags$|=4;o.length=0}}return[2]}))}))};var W=function(e,t,r){try{t=t.render();{e.$flags$&=~16}{e.$flags$|=2}{{{z(e,t)}}}}catch(t){fe(t,e.$hostElement$)}return null};var F=function(e){var t=e.$cmpMeta$.$tagName$;var r=e.$hostElement$;var n=s("postUpdate",t);var a=e.$ancestorComponent$;if(!(e.$flags$&64)){e.$flags$|=64;{K(r)}n();{e.$onReadyResolve$(r);if(!a){G()}}}else{n()}{if(e.$onRenderResolve$){e.$onRenderResolve$();e.$onRenderResolve$=undefined}if(e.$flags$&512){Se((function(){return H(e,false)}))}e.$flags$&=~(4|512)}};var G=function(e){{K(he.documentElement)}Se((function(){return S(ve,"appload",{detail:{namespace:n}})}))};var D=function(e,t,r){if(e&&e[t]){try{return e[t](r)}catch(e){fe(e)}}return undefined};var J=function(e,t){return e&&e.then?e.then(t):t()};var K=function(e){return e.classList.add("hydrated")};var Q=function(e,t){return ie(e).$instanceValues$.get(t)};var X=function(e,t,r,n){var a=ie(e);var i=a.$hostElement$;var l=a.$instanceValues$.get(t);var o=a.$flags$;var s=a.$lazyInstance$;r=b(r,n.$members$[t][0]);var f=Number.isNaN(l)&&Number.isNaN(r);var u=r!==l&&!f;if((!(o&8)||l===undefined)&&u){a.$instanceValues$.set(t,r);if(s){if(n.$watchers$&&o&128){var c=n.$watchers$[t];if(c){c.map((function(e){try{s[e](r,l,t)}catch(e){fe(e,i)}}))}}if((o&(2|16))===2){H(a,false)}}}};var Y=function(e,t,r){if(t.$members$){if(e.watchers){t.$watchers$=e.watchers}var n=Object.entries(t.$members$);var a=e.prototype;n.map((function(e){var n=e[0],i=e[1][0];if(i&31||r&2&&i&32){Object.defineProperty(a,n,{get:function(){return Q(this,n)},set:function(e){X(this,n,e,t)},configurable:true,enumerable:true})}}));if(r&1){var i=new Map;a.attributeChangedCallback=function(e,t,r){var n=this;pe.jmp((function(){var t=i.get(e);if(n.hasOwnProperty(t)){r=n[t];delete n[t]}else if(a.hasOwnProperty(t)&&typeof n[t]==="number"&&n[t]==r){return}n[t]=r===null&&typeof n[t]==="boolean"?false:r}))};e.observedAttributes=n.filter((function(e){var t=e[0],r=e[1];return r[0]&15})).map((function(e){var r=e[0],n=e[1];var a=n[1]||r;i.set(a,r);if(n[0]&512){t.$attrsToReflect$.push([r,a])}return a}))}}return e};var Z=function(e,t,n,a,i){return __awaiter(r,void 0,void 0,(function(){var e,r,a,l,o,u,c;return __generator(this,(function($){switch($.label){case 0:if(!((t.$flags$&32)===0))return[3,3];t.$flags$|=32;i=ce(n);if(!i.then)return[3,2];e=f();return[4,i];case 1:i=$.sent();e();$.label=2;case 2:if(!i.isProxied){{n.$watchers$=i.watchers}Y(i,n,2);i.isProxied=true}r=s("createInstance",n.$tagName$);{t.$flags$|=8}try{new i(t)}catch(e){fe(e)}{t.$flags$&=~8}{t.$flags$|=128}r();ee(t.$lazyInstance$);if(i.style){a=i.style;l=C(n);if(!$e.has(l)){o=s("registerStyles",n.$tagName$);R(l,a,!!(n.$flags$&1));o()}}$.label=3;case 3:u=t.$ancestorComponent$;c=function(){return H(t,true)};if(u&&u["s-rc"]){u["s-rc"].push(c)}else{c()}return[2]}}))}))};var ee=function(e){{D(e,"connectedCallback")}};var te=function(e){if((pe.$flags$&1)===0){var t=ie(e);var r=t.$cmpMeta$;var n=s("connectedCallback",r.$tagName$);if(!(t.$flags$&1)){t.$flags$|=1;{var a=e;while(a=a.parentNode||a.host){if(a["s-p"]){U(t,t.$ancestorComponent$=a);break}}}if(r.$members$){Object.entries(r.$members$).map((function(t){var r=t[0],n=t[1][0];if(n&31&&e.hasOwnProperty(r)){var a=e[r];delete e[r];e[r]=a}}))}{Z(e,t,r)}}else{ee(t.$lazyInstance$)}n()}};var re=function(e){if((pe.$flags$&1)===0){ie(e)}};var ne=e("b",(function(e,t){if(t===void 0){t={}}var r=s();var n=[];var a=t.exclude||[];var i=ve.customElements;var l=he.head;var o=l.querySelector("meta[charset]");var f=he.createElement("style");var c=[];var $;var v=true;Object.assign(pe,t);pe.$resourcesUrl$=new URL(t.resourcesUrl||"./",he.baseURI).href;e.map((function(e){e[1].map((function(t){var r={$flags$:t[0],$tagName$:t[1],$members$:t[2],$listeners$:t[3]};{r.$members$=t[2]}{r.$attrsToReflect$=[]}{r.$watchers$={}}var l=r.$tagName$;var o=function(e){__extends(t,e);function t(t){var n=e.call(this,t)||this;t=n;oe(t,r);if(r.$flags$&1){{{t.attachShadow({mode:"open"})}}}return n}t.prototype.connectedCallback=function(){var e=this;if($){clearTimeout($);$=null}if(v){c.push(this)}else{pe.jmp((function(){return te(e)}))}};t.prototype.disconnectedCallback=function(){var e=this;pe.jmp((function(){return re(e)}))};t.prototype.componentOnReady=function(){return ie(this).$onReadyPromise$};return t}(HTMLElement);r.$lazyBundleId$=e[0];if(!a.includes(l)&&!i.get(l)){n.push(l);i.define(l,Y(o,r,1))}}))}));{f.innerHTML=n+u;f.setAttribute("data-styles","");l.insertBefore(f,o?o.nextSibling:l.firstChild)}v=false;if(c.length){c.map((function(e){return e.connectedCallback()}))}else{{pe.jmp((function(){return $=setTimeout(G,30)}))}}r()}));var ae=new WeakMap;var ie=function(e){return ae.get(e)};var le=e("r",(function(e,t){return ae.set(t.$lazyInstance$=e,t)}));var oe=function(e,t){var r={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};{r.$onReadyPromise$=new Promise((function(e){return r.$onReadyResolve$=e}));e["s-p"]=[];e["s-rc"]=[]}return ae.set(e,r)};var se=function(e,t){return t in e};var fe=function(e,t){return(0,console.error)(e,t)};var ue=new Map;var ce=function(e,r,n){var a=e.$tagName$.replace(/-/g,"_");var i=e.$lazyBundleId$;var l=ue.get(i);if(l){return l[a]}
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/return t.import("./".concat(i,".entry.js").concat("")).then((function(e){{ue.set(i,e)}return e[a]}),fe)};var $e=new Map;var ve=typeof window!=="undefined"?window:{};var he=ve.document||{head:{}};var pe={$flags$:0,$resourcesUrl$:"",jmp:function(e){return e()},raf:function(e){return requestAnimationFrame(e)},ael:function(e,t,r,n){return e.addEventListener(t,r,n)},rel:function(e,t,r,n){return e.removeEventListener(t,r,n)},ce:function(e,t){return new CustomEvent(e,t)}};var de=e("p",(function(e){return Promise.resolve(e)}));var me=function(){try{new CSSStyleSheet;return typeof(new CSSStyleSheet).replaceSync==="function"}catch(e){}return false}();var ge=[];var ye=[];var we=function(e,t){return function(r){e.push(r);if(!o){o=true;if(t&&pe.$flags$&4){Se(_e)}else{pe.raf(_e)}}}};var be=function(e){for(var t=0;t<e.length;t++){try{e[t](performance.now())}catch(e){fe(e)}}e.length=0};var _e=function(){be(ge);{be(ye);if(o=ge.length>0){pe.raf(_e)}}};var Se=function(e){return de().then(e)};var Ne=we(ye,true)}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["./p-3132f4b7.system.js","./p-a0cd4b75.system.js"],(function(e,t){"use strict";var n,s,r;return{setters:[function(e){n=e.p;s=e.b},function(e){r=e.g}],execute:function(){var e=function(){var e=t.meta.url;var s={};if(e!==""){s.resourcesUrl=new URL(".",e).href}return n(s)};e().then((function(e){r();return s([["p-b4c69836.system",[[1,"dummy-component"]]],["p-e1e4b2ea.system",[[1,"cura-icons-view",{selected:[32]}],[1,"cura-icon",{name:[513],color:[513],size:[8],iconset:[513],disabled:[516]}]]]],e)}))}}}));
|