funnel-gfx-wc 0.0.196 → 0.0.200
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/{color-picker_6.cjs.entry.js → funnel-app.cjs.entry.js} +191 -188
- package/dist/cjs/funnel-gfx-wc.cjs.js +2 -2
- package/dist/cjs/{index-a44a40b7.js → index-53976b87.js} +34 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -6
- package/dist/collection/components/funnel-app/chevron-double-left.js +14 -0
- package/dist/collection/components/funnel-app/close.js +14 -0
- package/dist/collection/components/funnel-app/color-picker.js +16 -0
- package/dist/collection/components/funnel-app/data-source.js +25 -0
- package/dist/collection/components/funnel-app/data-values.js +14 -0
- package/dist/collection/components/funnel-app/eswat2-io.js +10 -0
- package/dist/collection/{icons/Fingerprint.js → components/funnel-app/fingerprint.js} +7 -3
- package/dist/collection/components/funnel-app/funnel-app.css +152 -12
- package/dist/collection/components/funnel-app/funnel-app.js +17 -7
- package/dist/collection/components/funnel-app/funnel-gfx.js +98 -0
- package/dist/collection/{icons/Paw.js → components/funnel-app/paw.js} +7 -3
- package/dist/collection/{icons/Radio.js → components/funnel-app/radio.js} +9 -3
- package/dist/collection/components/funnel-app/refresh.js +14 -0
- package/dist/collection/utils/named-colors.js +2 -1
- package/dist/esm/{color-picker_6.entry.js → funnel-app.entry.js} +192 -184
- package/dist/esm/funnel-gfx-wc.js +2 -2
- package/dist/esm/{index-6a5d4cdc.js → index-1fd7f459.js} +34 -0
- package/dist/esm/loader.js +2 -2
- package/dist/funnel-gfx-wc/funnel-gfx-wc.esm.js +1 -1
- package/dist/funnel-gfx-wc/p-0cac0962.js +1 -0
- package/dist/funnel-gfx-wc/p-978fdea0.entry.js +1 -0
- package/dist/types/components/funnel-app/chevron-double-left.d.ts +5 -0
- package/dist/types/components/funnel-app/close.d.ts +5 -0
- package/dist/types/components/funnel-app/color-picker.d.ts +4 -0
- package/dist/types/components/funnel-app/data-source.d.ts +4 -0
- package/dist/types/components/funnel-app/data-values.d.ts +4 -0
- package/dist/types/components/funnel-app/eswat2-io.d.ts +4 -0
- package/dist/types/components/funnel-app/fingerprint.d.ts +5 -0
- package/dist/types/components/funnel-app/funnel-app.d.ts +1 -0
- package/dist/types/components/funnel-app/funnel-gfx.d.ts +8 -0
- package/dist/types/components/funnel-app/paw.d.ts +5 -0
- package/dist/types/components/funnel-app/radio.d.ts +5 -0
- package/dist/types/components/funnel-app/refresh.d.ts +5 -0
- package/dist/types/components.d.ts +0 -75
- package/dist/types/utils/named-colors.d.ts +1 -1
- package/dist/types/utils/types.d.ts +8 -1
- package/package.json +7 -2
- package/dist/collection/components/color-picker/color-picker.css +0 -5
- package/dist/collection/components/color-picker/color-picker.js +0 -46
- package/dist/collection/components/data-source/data-source.css +0 -42
- package/dist/collection/components/data-source/data-source.js +0 -52
- package/dist/collection/components/data-values/data-values.css +0 -22
- package/dist/collection/components/data-values/data-values.js +0 -45
- package/dist/collection/components/eswat2-io/eswat2-io.css +0 -9
- package/dist/collection/components/eswat2-io/eswat2-io.js +0 -18
- package/dist/collection/components/funnel-gfx/funnel-gfx.css +0 -8
- package/dist/collection/components/funnel-gfx/funnel-gfx.js +0 -153
- package/dist/collection/icons/ChevronDoubleLeft.js +0 -10
- package/dist/collection/icons/Close.js +0 -10
- package/dist/collection/icons/Refresh.js +0 -10
- package/dist/collection/icons/index.js +0 -6
- package/dist/funnel-gfx-wc/p-032519c2.js +0 -1
- package/dist/funnel-gfx-wc/p-221e2caf.entry.js +0 -1
- package/dist/types/components/color-picker/color-picker.d.ts +0 -4
- package/dist/types/components/data-source/data-source.d.ts +0 -4
- package/dist/types/components/data-values/data-values.d.ts +0 -4
- package/dist/types/components/eswat2-io/eswat2-io.d.ts +0 -3
- package/dist/types/components/funnel-gfx/funnel-gfx.d.ts +0 -19
- package/dist/types/icons/ChevronDoubleLeft.d.ts +0 -6
- package/dist/types/icons/Close.d.ts +0 -6
- package/dist/types/icons/Fingerprint.d.ts +0 -6
- package/dist/types/icons/Paw.d.ts +0 -6
- package/dist/types/icons/Radio.d.ts +0 -7
- package/dist/types/icons/Refresh.d.ts +0 -6
- package/dist/types/icons/index.d.ts +0 -6
|
@@ -2,7 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-53976b87.js');
|
|
6
|
+
|
|
7
|
+
const Radio = props => {
|
|
8
|
+
const hex = props.hex || 'currentColor';
|
|
9
|
+
const klass = props.class;
|
|
10
|
+
const label = props.label || 'radio';
|
|
11
|
+
const selected = props.selected || false;
|
|
12
|
+
const size = props.size || 24;
|
|
13
|
+
return (index.h("svg", { class: klass, width: size, height: size, viewBox: "0 0 24 24", role: "img", "aria-label": "title" },
|
|
14
|
+
index.h("title", null, label),
|
|
15
|
+
' ',
|
|
16
|
+
index.h("g", { fill: hex }, selected ? (index.h("path", { d: "M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" })) : (index.h("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" }))),
|
|
17
|
+
index.h("path", { d: "M0 0h24v24H0z", fill: "none" })));
|
|
18
|
+
};
|
|
6
19
|
|
|
7
20
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
8
21
|
|
|
@@ -2193,6 +2206,8 @@ const black = '#111111';
|
|
|
2193
2206
|
const gray = '#aaaaaa';
|
|
2194
2207
|
const silver = '#dddddd';
|
|
2195
2208
|
const bada55 = '#bada55';
|
|
2209
|
+
const slate = '#708090';
|
|
2210
|
+
const slate4 = '#4e5964';
|
|
2196
2211
|
const white = '#ffffff';
|
|
2197
2212
|
// NOTE: this is ONLY used internally...
|
|
2198
2213
|
const _namedColors = {
|
|
@@ -2214,7 +2229,8 @@ const _namedColors = {
|
|
|
2214
2229
|
gray,
|
|
2215
2230
|
silver,
|
|
2216
2231
|
};
|
|
2217
|
-
const
|
|
2232
|
+
const _allColors = Object.assign(Object.assign({}, _namedColors), { slate, slate4, white });
|
|
2233
|
+
const colorFor = (key) => _allColors[key];
|
|
2218
2234
|
const colorKeys = Object.keys(_namedColors);
|
|
2219
2235
|
|
|
2220
2236
|
const appendToMap = (map, propName, value) => {
|
|
@@ -2423,230 +2439,217 @@ const actions = {
|
|
|
2423
2439
|
},
|
|
2424
2440
|
};
|
|
2425
2441
|
|
|
2426
|
-
const
|
|
2427
|
-
|
|
2442
|
+
const ColorPicker = _props => {
|
|
2443
|
+
const { pick } = store.state;
|
|
2444
|
+
return (index.h("div", { id: "toolbar", class: "flex flex-wrap", role: "radiogroup" }, colorKeys.map((key) => {
|
|
2445
|
+
const hex = colorFor(key);
|
|
2446
|
+
const selected = pick == key;
|
|
2447
|
+
return (index.h("div", { "aria-label": key, role: "radio", title: key, onClick: () => {
|
|
2448
|
+
actions.updatePick(key);
|
|
2449
|
+
} },
|
|
2450
|
+
index.h(Radio, { hex: hex, selected: selected })));
|
|
2451
|
+
})));
|
|
2452
|
+
};
|
|
2453
|
+
|
|
2454
|
+
const ChevronDoubleLeft = props => {
|
|
2455
|
+
const hex = props.hex || 'currentColor';
|
|
2456
|
+
const klass = props.class;
|
|
2457
|
+
const label = props.label || 'chevron-double-left';
|
|
2458
|
+
const size = props.size || 24;
|
|
2459
|
+
return (index.h("svg", { class: klass, width: size, height: size, viewBox: "0 0 24 24", role: "img", "aria-label": "title" },
|
|
2460
|
+
index.h("title", null, label),
|
|
2428
2461
|
index.h("g", { fill: hex },
|
|
2429
2462
|
index.h("path", { d: "M18.41,7.41L17,6L11,12L17,18L18.41,16.59L13.83,12L18.41,7.41M12.41,7.41L11,6L5,12L11,18L12.41,16.59L7.83,12L12.41,7.41Z" })),
|
|
2430
2463
|
index.h("path", { d: "M0 0h24v24H0z", fill: "none" })));
|
|
2431
2464
|
};
|
|
2432
2465
|
|
|
2433
|
-
const Close =
|
|
2434
|
-
|
|
2466
|
+
const Close = props => {
|
|
2467
|
+
const hex = props.hex || 'currentColor';
|
|
2468
|
+
const klass = props.class;
|
|
2469
|
+
const label = props.label || 'close';
|
|
2470
|
+
const size = props.size || 24;
|
|
2471
|
+
return (index.h("svg", { class: klass, width: size, height: size, viewBox: "0 0 24 24", role: "img", "aria-label": "title" },
|
|
2472
|
+
index.h("title", null, label),
|
|
2435
2473
|
index.h("g", { fill: hex },
|
|
2436
2474
|
index.h("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" })),
|
|
2437
2475
|
index.h("path", { d: "M0 0h24v24H0z", fill: "none" })));
|
|
2438
2476
|
};
|
|
2439
2477
|
|
|
2440
|
-
const
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
}
|
|
2446
|
-
|
|
2447
|
-
const Radio = ({ hex = white, selected = false, size = 24 }) => {
|
|
2448
|
-
return (index.h("svg", { width: size, height: size, viewBox: "0 0 24 24" },
|
|
2449
|
-
index.h("g", { fill: hex }, selected ? (index.h("path", { d: "M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" })) : (index.h("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" }))),
|
|
2450
|
-
index.h("path", { d: "M0 0h24v24H0z", fill: "none" })));
|
|
2451
|
-
};
|
|
2452
|
-
|
|
2453
|
-
const Refresh = ({ hex = white, size = 24 }) => {
|
|
2454
|
-
return (index.h("svg", { width: size, height: size, viewBox: "0 0 24 24" },
|
|
2478
|
+
const Refresh = props => {
|
|
2479
|
+
const hex = props.hex || 'currentColor';
|
|
2480
|
+
const klass = props.class;
|
|
2481
|
+
const label = props.label || 'refresh';
|
|
2482
|
+
const size = props.size || 24;
|
|
2483
|
+
return (index.h("svg", { class: klass, width: size, height: size, viewBox: "0 0 24 24", role: "img", "aria-label": "title" },
|
|
2484
|
+
index.h("title", null, label),
|
|
2455
2485
|
index.h("g", { fill: hex },
|
|
2456
|
-
index.h("path", { d: "M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99
|
|
2486
|
+
index.h("path", { d: "M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99\n 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65\n 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35\n 2.35z" })),
|
|
2457
2487
|
index.h("path", { d: "M0 0h24v24H0z", fill: "none" })));
|
|
2458
2488
|
};
|
|
2459
2489
|
|
|
2460
|
-
const colorPickerCss = "#toolbar{display:flex;flex-direction:row;flex-wrap:wrap}";
|
|
2461
|
-
|
|
2462
|
-
let FunnelGfx$1 = class {
|
|
2463
|
-
constructor(hostRef) {
|
|
2464
|
-
index.registerInstance(this, hostRef);
|
|
2465
|
-
this.tag = 'color-picker';
|
|
2466
|
-
}
|
|
2467
|
-
render() {
|
|
2468
|
-
const { pick } = store.state;
|
|
2469
|
-
return (index.h("div", { id: "toolbar", role: "radiogroup" }, colorKeys.map((key) => {
|
|
2470
|
-
const hex = colorFor(key);
|
|
2471
|
-
const selected = pick == key;
|
|
2472
|
-
return (index.h("div", { "aria-label": key, role: "radio", title: key, onClick: () => {
|
|
2473
|
-
actions.updatePick(key);
|
|
2474
|
-
} }, Radio({ hex, selected })));
|
|
2475
|
-
})));
|
|
2476
|
-
}
|
|
2477
|
-
};
|
|
2478
|
-
FunnelGfx$1.style = colorPickerCss;
|
|
2479
|
-
|
|
2480
|
-
const dataSourceCss = "#toolbar{display:flex;flex-direction:row;align-items:center;margin-top:10px;margin-bottom:10px}button{display:flex;align-content:center;border-radius:5px;border:1px solid #ccc;padding:5px;margin:0px;margin-right:5px;cursor:pointer}button:active{background-color:var(--clrs-gray)}.bg-blue{background:var(--clrs-blue)}.bg-red{background:var(--clrs-red)}.info{color:var(--clrs-navy);fill:var(--clrs-navy);display:flex;flex-direction:row;align-items:center}.help{font-style:italic}";
|
|
2481
|
-
|
|
2482
2490
|
const help = 'click a button... ';
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
}
|
|
2488
|
-
render() {
|
|
2489
|
-
const { count } = store.state;
|
|
2490
|
-
return (index.h("div", { id: "toolbar" }, index.h("button", { "aria-label": "Refresh", title: "Refresh", class: "bg-blue", onClick: () => {
|
|
2491
|
+
const DataSource = _props => {
|
|
2492
|
+
const { count } = store.state;
|
|
2493
|
+
return (index.h("div", { class: "flex mt-3 mb-10px items-center" },
|
|
2494
|
+
index.h("button", { "aria-label": "Refresh", title: "Refresh", class: "ds1-button data-button bg-clrs-blue", onClick: () => {
|
|
2491
2495
|
actions.refresh();
|
|
2492
|
-
} },
|
|
2496
|
+
} },
|
|
2497
|
+
index.h(Refresh, null)),
|
|
2498
|
+
index.h("button", { "aria-label": "Reset", title: "Reset", class: "ds1-button data-button bg-clrs-red", onClick: () => {
|
|
2493
2499
|
actions.reset();
|
|
2494
|
-
} },
|
|
2495
|
-
|
|
2500
|
+
} },
|
|
2501
|
+
index.h(Close, null)),
|
|
2502
|
+
index.h("span", { class: "flex items-center" },
|
|
2503
|
+
index.h(ChevronDoubleLeft, { size: 28 }),
|
|
2504
|
+
index.h("span", { class: "italic" },
|
|
2505
|
+
help,
|
|
2506
|
+
index.h("sup", null, count)))));
|
|
2507
|
+
};
|
|
2508
|
+
|
|
2509
|
+
const DataValues = _props => {
|
|
2510
|
+
const { values, pick, count } = store.state;
|
|
2511
|
+
return (index.h("div", { class: "flex flex-col" },
|
|
2512
|
+
index.h("div", { class: "flex" },
|
|
2513
|
+
index.h("span", { class: "font-bold mr-10px" }, "color:"),
|
|
2514
|
+
index.h("span", { class: "italic text-clrs-slate4" }, pick)),
|
|
2515
|
+
index.h("div", { class: "flex mt-5px" },
|
|
2516
|
+
index.h("span", { class: "font-bold mr-10px" }, "sample:"),
|
|
2517
|
+
index.h("span", { class: "italic text-clrs-slate4" }, `${count > 0 ? values : '...'}`))));
|
|
2496
2518
|
};
|
|
2497
|
-
DataSource.style = dataSourceCss;
|
|
2498
2519
|
|
|
2499
|
-
|
|
2520
|
+
var between = createCommonjsModule(function (module, exports) {
|
|
2521
|
+
/* Between.js v0.1.2-fix.2 */
|
|
2522
|
+
!function(t,n){module.exports=n();}(commonjsGlobal,function(){function O(t){return (O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}function n(t,n,e){return n&&r(t.prototype,n),e&&r(t,e),t}function M(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function I(t){return (I=Object.getPrototypeOf||function(t){return t.__proto__})(t)}function o(t,n){return (o=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function u(t,n,e){return (u="undefined"!=typeof Reflect&&Reflect.construct?Reflect.construct:function(t,n,e){var r=[null];r.push.apply(r,n);var u=new(t.bind.apply(t,r));return e&&o(u,e.prototype),u}).apply(null,arguments)}function _(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var t=function(o){var a={},i=[];(o=o||this).on=function(t,n,e){return (a[t]=a[t]||[]).push([n,e]),o},o.off=function(t,n){t||(a={});for(var e=a[t]||i,r=e.length=n?e.length:0;r--;)n==e[r][0]&&e.splice(r,1);return o},o.emit=function(t){for(var n,e=a[t]||i,r=0<e.length?e.slice(0,e.length):e,u=0;n=r[u++];)n[0].apply(n[1],i.slice.call(arguments,1));return o};};var V=function(t,n,e){return t*(1-e)+n*e},e="undefined"!=typeof window?window:"undefined"!=typeof commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:{};function a(t,n){return t(n={exports:{}},n.exports),n.exports}for(var i=a(function(t){var n=t.exports={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return (t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return --t*t*t+1},InOut:function(t){return (t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return (t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return --t*t*t*t*t+1},InOut:function(t){return (t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return .5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return (t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){var n,e=.1;return 0===t?0:1===t?1:(!e||e<1?(e=1,n=.1):n=.4*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/.4))},Out:function(t){var n,e=.1;return 0===t?0:1===t?1:(!e||e<1?(e=1,n=.1):n=.4*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-n)*(2*Math.PI)/.4)+1)},InOut:function(t){var n,e=.1;return 0===t?0:1===t?1:(!e||e<1?(e=1,n=.1):n=.4*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/.4)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/.4)*.5+1)}},Back:{In:function(t){return t*t*(2.70158*t-1.70158)},Out:function(t){return --t*t*(2.70158*t+1.70158)+1},InOut:function(t){var n=2.5949095;return (t*=2)<1?t*t*((n+1)*t-n)*.5:.5*((t-=2)*t*((n+1)*t+n)+2)}},Bounce:{In:function(t){return 1-n.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*n.Bounce.In(2*t):.5*n.Bounce.Out(2*t-1)+.5}}};}),c=(a(function(a){(function(){var t,n,e,r,u,o;"undefined"!=typeof performance&&null!==performance&&performance.now?a.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(a.exports=function(){return (t()-u)/1e6},n=process.hrtime,r=(t=function(){var t;return 1e9*(t=n())[0]+t[1]})(),o=1e9*process.uptime(),u=r-o):Date.now?(a.exports=function(){return Date.now()-e},e=Date.now()):(a.exports=function(){return (new Date).getTime()-e},e=(new Date).getTime());}).call(e);})),l="undefined"==typeof window?e:window,f=["moz","webkit"],s="AnimationFrame",p=l["request"+s],h=l["cancel"+s]||l["cancelRequest"+s],m=0;!p&&m<f.length;m++)p=l[f[m]+"Request"+s],h=l[f[m]+"Cancel"+s]||l[f[m]+"CancelRequest"+s];if(!p||!h){var d=0,y=0,v=[];p=function(t){if(0===v.length){var n=c(),e=Math.max(0,1e3/60-(n-d));d=e+n,setTimeout(function(){for(var t=v.slice(0),n=v.length=0;n<t.length;n++)if(!t[n].cancelled)try{t[n].callback(d);}catch(t){setTimeout(function(){throw t},0);}},Math.round(e));}return v.push({handle:++y,callback:t,cancelled:!1}),y},h=function(t){for(var n=0;n<v.length;n++)v[n].handle===t&&(v[n].cancelled=!0);};}var b=function(t){return p.call(l,t)};b.cancel=function(){h.apply(l,arguments);},b.polyfill=function(t){t||(t=l),t.requestAnimationFrame=p,t.cancelAnimationFrame=h;};var w,k,P=[],T=Symbol("type"),j=Symbol("start_time"),x=Symbol("completed"),D=Symbol("paused"),g=requestAnimationFrame||b,A=Date.now();!function t(){g(t),w=Date.now(),k=w-A;for(var n=0;n<P.length;n++)P[n][x]||P[n](k,Date.now()-P[n][j]);A=w;}();var E=function(t){function g(e,t){var n,r,u,o;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,g),u=this,o=I(g).call(this),M(_(_(r=!o||"object"!=typeof o&&"function"!=typeof o?_(u):o)),"update",function(){var e=_(_(r))._updateValue;return function(t,n){r[x]||r[D]||(0===r.localTime&&r.emit("start",r.value,_(_(r))),e(r.ease(r.loopFunction.progress(Math.min(1,(n||r.localTime)/r.duration)))),r.emit("update",r.value,_(_(r)),t),r.localTime>=r.duration&&r.loopFunction.complete(function(){r[x]=!0,r.emit("complete",r.value,_(_(r)));}),r.localTime+=t);}});var a=r.plugin=Object.values(g._plugins).reduce(function(t,n){return t||n&&n.test&&n.test(e)&&n},!1),i=a&&a.name||("object"===O(e)?Array.isArray(e)?"array":"object":"number");if(a){var c=a.initialize(e,t);e=c.startValue,t=c.destValue,r.data=c.data;}switch(Object.assign(_(_(r)),(M(n={duration:1e3,localTime:0,startValue:e,destValue:t,loopMode:"once",loopFunction:g.DEFAULT_LOOP,ease:function(t){return t},value:"array"===i?[].concat(e):"object"===i?Object.assign({},e):e},x,!1),M(n,T,i),M(n,j,Date.now()),M(n,D,!1),n)),r[T]){case"number":r._updateValue=function(t){r.value=V(r.startValue,r.destValue,t);};break;case"array":var l=r.value.length,f=_(_(r)),s=f.startValue,p=f.destValue,h=f.value;r._updateValue=function(t){for(var n=0;n<l;n++)h[n]=V(s[n],p[n],t);};break;case"object":var m=Object.keys(r.startValue),d=m.length,y=_(_(r)),v=y.startValue,b=y.destValue,w=y.value;r._updateValue=function(t){for(var n=0;n<d;n++){var e=m[n];w[e]=V(v[e],b[e],t);}};break;default:r.plugin?r._updateValue=function(t){r.value=r.plugin.interpolate(r.startValue,r.destValue,t,r.data);}:(console.warn("Between: startValue type was unrecognized."),r._updateValue=function(){return null});}return P.push(r.update()),r}return n(g,null,[{key:"between",value:function(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return u(g,n)}}]),n(g,[{key:"pause",value:function(){return this[D]=!0,this.emit("pause",this.value,this,k),this}},{key:"play",value:function(){return this[D]=!1,this.emit("play",this.value,this,k),this}},{key:"easing",value:function(t){return this.ease=t,this}},{key:"time",value:function(t){return this.duration=t,this}},{key:"loop",value:function(){for(var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"once",n="__loop_".concat(t),e=arguments.length,r=new Array(1<e?e-1:0),u=1;u<e;u++)r[u-1]=arguments[u];return this.loopFunction=n in this?Object.assign({},g.DEFAULT_LOOP,this[n].apply(this,r)):g.DEFAULT_LOOP,this}},{key:"__loop_repeat",value:function(t){var n=this,e=t;return this.times=0,{complete:function(t){n.localTime=0,Number.isInteger(e)&&++n.times===e?t():Number.isInteger(e)||++n.times;}}}},{key:"__loop_bounce",value:function(t){var n=this,e=t,r=1;return this.times=0,{complete:function(t){n.localTime=0,r=-r,Number.isInteger(e)&&++n.times===e?t():Number.isInteger(e)||++n.times;},progress:function(t){return 0<r?t:1-t}}}},{key:"isPaused",get:function(){return this[D]}}]),function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");o(t.prototype,n&&n.prototype),n&&o(t,n);}(g,t),g}(t);return M(E,"DEFAULT_LOOP",{complete:function(t){return t()},progress:function(t){return t}}),E.Easing=i,E._plugins={},E});
|
|
2523
|
+
});
|
|
2500
2524
|
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2525
|
+
between._plugins.color = ColorPlugin;
|
|
2526
|
+
let barHeight = [];
|
|
2527
|
+
let barRefs = undefined;
|
|
2528
|
+
const bgdFill = colorFor('white');
|
|
2529
|
+
const xFill = colorFor('bada55');
|
|
2530
|
+
let lastHex = '#bada55';
|
|
2531
|
+
let tween = undefined;
|
|
2532
|
+
let lastVal = [0, 0, 0, 0, 0];
|
|
2533
|
+
let tween2 = [undefined, undefined, undefined, undefined, undefined];
|
|
2534
|
+
const processColor = (next) => {
|
|
2535
|
+
if (!barRefs)
|
|
2536
|
+
return;
|
|
2537
|
+
const hex1 = lastHex;
|
|
2538
|
+
const hex2 = colorFor(next);
|
|
2539
|
+
// IMPORTANT: we are tweening between the hex values, not the names...
|
|
2540
|
+
if (hex1 !== null && hex1 !== hex2) {
|
|
2541
|
+
if (tween) {
|
|
2542
|
+
tween.pause();
|
|
2543
|
+
}
|
|
2544
|
+
tween = new between(hex1, hex2)
|
|
2545
|
+
.time(1000)
|
|
2546
|
+
.easing(between.Easing.Cubic.InOut)
|
|
2547
|
+
.on('update', (v) => {
|
|
2548
|
+
barRefs.forEach(bar => {
|
|
2549
|
+
bar.setAttribute('fill', `${v}`);
|
|
2550
|
+
});
|
|
2551
|
+
lastHex = v;
|
|
2552
|
+
});
|
|
2509
2553
|
}
|
|
2510
2554
|
};
|
|
2511
|
-
|
|
2555
|
+
const processValues = (next) => {
|
|
2556
|
+
if (!barRefs)
|
|
2557
|
+
return;
|
|
2558
|
+
barRefs.forEach((bar, index) => {
|
|
2559
|
+
const height = barHeight[index];
|
|
2560
|
+
const last = lastVal[index];
|
|
2561
|
+
const value = next[index];
|
|
2562
|
+
if (last !== null && last !== value) {
|
|
2563
|
+
if (tween2[index]) {
|
|
2564
|
+
tween2[index].pause();
|
|
2565
|
+
}
|
|
2566
|
+
// NOTE: next & last are values between 0-100 (aka. percentage)
|
|
2567
|
+
tween2[index] = new between(last, value)
|
|
2568
|
+
.time(1000)
|
|
2569
|
+
.easing(between.Easing.Cubic.InOut)
|
|
2570
|
+
.on('update', (v) => {
|
|
2571
|
+
const y = height * ((100 - v) / 100);
|
|
2572
|
+
bar.setAttribute('y', `${y}`);
|
|
2573
|
+
lastVal[index] = v;
|
|
2574
|
+
});
|
|
2575
|
+
}
|
|
2576
|
+
});
|
|
2577
|
+
};
|
|
2578
|
+
const createFunnel = ({ id, height, width, x, y, drop }) => {
|
|
2579
|
+
const obj = {
|
|
2580
|
+
id: id,
|
|
2581
|
+
height,
|
|
2582
|
+
width,
|
|
2583
|
+
x,
|
|
2584
|
+
y,
|
|
2585
|
+
maskId: `mask-${id}`,
|
|
2586
|
+
maskUri: `url('#mask-${id}')`,
|
|
2587
|
+
mask: `0.5,0.5,0.5,${height - 0.5},${width - 0.5},${height - drop - 0.5},${width - 0.5},${drop + 0.5}`,
|
|
2588
|
+
matrix: `matrix(1,0,0,1,${x},${y})`,
|
|
2589
|
+
points: `0,0,0,${height},${width},${height - drop},${width},${drop}`,
|
|
2590
|
+
};
|
|
2591
|
+
return obj;
|
|
2592
|
+
};
|
|
2593
|
+
const generateBars = () => {
|
|
2594
|
+
return funnelDefs.map(item => {
|
|
2595
|
+
return createFunnel(item);
|
|
2596
|
+
});
|
|
2597
|
+
};
|
|
2598
|
+
const FunnelGfx = _props => {
|
|
2599
|
+
const bars = generateBars();
|
|
2600
|
+
const stroke = 'currentColor';
|
|
2601
|
+
// IMPORTANT: initialize these arrays when you render...
|
|
2602
|
+
barHeight = Array(bars.length);
|
|
2603
|
+
barRefs = Array(bars.length);
|
|
2604
|
+
return (index.h("svg", { class: "funnel", viewBox: "0 0 600 420" },
|
|
2605
|
+
index.h("desc", null, "Created with Snap"),
|
|
2606
|
+
index.h("defs", null, bars.map(item => {
|
|
2607
|
+
return (index.h("mask", { id: item.maskId },
|
|
2608
|
+
index.h("polygon", { points: item.mask, fill: bgdFill })));
|
|
2609
|
+
})),
|
|
2610
|
+
bars.map((item, index$1) => {
|
|
2611
|
+
const { height, width, maskUri, matrix, points } = item;
|
|
2612
|
+
barHeight[index$1] = height;
|
|
2613
|
+
return (index.h("g", { transform: matrix },
|
|
2614
|
+
index.h("polygon", { points: points, fill: bgdFill, stroke: stroke }),
|
|
2615
|
+
index.h("rect", { ref: el => (barRefs[index$1] = el), x: "0", y: height, width: width, height: height, mask: maskUri, fill: xFill, stroke: stroke })));
|
|
2616
|
+
})));
|
|
2617
|
+
};
|
|
2512
2618
|
|
|
2513
|
-
const
|
|
2619
|
+
const Fingerprint = props => {
|
|
2620
|
+
const hex = props.hex || 'currentColor';
|
|
2621
|
+
const klass = props.class;
|
|
2622
|
+
const label = props.label || 'fingerprint';
|
|
2623
|
+
const size = props.size || 24;
|
|
2624
|
+
return (index.h("svg", { class: klass, width: size, height: size, viewBox: "0 0 24 24", role: "img", "aria-label": "title" },
|
|
2625
|
+
index.h("title", null, label),
|
|
2626
|
+
index.h("g", { fill: hex },
|
|
2627
|
+
index.h("path", { d: "M17.81,4.47C17.73,4.47 17.65,4.45 17.58,4.41C15.66,3.42 14,3\n 12,3C10.03,3 8.15,3.47 6.44,4.41C6.2,4.54 5.9,4.45 5.76,4.21C5.63,3.97\n 5.72,3.66 5.96,3.53C7.82,2.5 9.86,2 12,2C14.14,2 16,2.47\n 18.04,3.5C18.29,3.65 18.38,3.95 18.25,4.19C18.16,4.37 18,4.47\n 17.81,4.47M3.5,9.72C3.4,9.72 3.3,9.69 3.21,9.63C3,9.47 2.93,9.16\n 3.09,8.93C4.08,7.53 5.34,6.43 6.84,5.66C10,4.04 14,4.03\n 17.15,5.65C18.65,6.42 19.91,7.5 20.9,8.9C21.06,9.12 21,9.44\n 20.78,9.6C20.55,9.76 20.24,9.71 20.08,9.5C19.18,8.22 18.04,7.23\n 16.69,6.54C13.82,5.07 10.15,5.07 7.29,6.55C5.93,7.25 4.79,8.25\n 3.89,9.5C3.81,9.65 3.66,9.72 3.5,9.72M9.75,21.79C9.62,21.79 9.5,21.74\n 9.4,21.64C8.53,20.77 8.06,20.21 7.39,19C6.7,17.77 6.34,16.27\n 6.34,14.66C6.34,11.69 8.88,9.27 12,9.27C15.12,9.27 17.66,11.69\n 17.66,14.66A0.5,0.5 0 0,1 17.16,15.16A0.5,0.5 0 0,1\n 16.66,14.66C16.66,12.24 14.57,10.27 12,10.27C9.43,10.27 7.34,12.24\n 7.34,14.66C7.34,16.1 7.66,17.43 8.27,18.5C8.91,19.66 9.35,20.15\n 10.12,20.93C10.31,21.13 10.31,21.44 10.12,21.64C10,21.74 9.88,21.79\n 9.75,21.79M16.92,19.94C15.73,19.94 14.68,19.64 13.82,19.05C12.33,18.04\n 11.44,16.4 11.44,14.66A0.5,0.5 0 0,1 11.94,14.16A0.5,0.5 0 0,1\n 12.44,14.66C12.44,16.07 13.16,17.4 14.38,18.22C15.09,18.7 15.92,18.93\n 16.92,18.93C17.16,18.93 17.56,18.9 17.96,18.83C18.23,18.78 18.5,18.96\n 18.54,19.24C18.59,19.5 18.41,19.77 18.13,19.82C17.56,19.93 17.06,19.94\n 16.92,19.94M14.91,22C14.87,22 14.82,22 14.78,22C13.19,21.54 12.15,20.95\n 11.06,19.88C9.66,18.5 8.89,16.64 8.89,14.66C8.89,13.04 10.27,11.72\n 11.97,11.72C13.67,11.72 15.05,13.04 15.05,14.66C15.05,15.73 16,16.6\n 17.13,16.6C18.28,16.6 19.21,15.73 19.21,14.66C19.21,10.89 15.96,7.83\n 11.96,7.83C9.12,7.83 6.5,9.41 5.35,11.86C4.96,12.67 4.76,13.62\n 4.76,14.66C4.76,15.44 4.83,16.67 5.43,18.27C5.53,18.53 5.4,18.82\n 5.14,18.91C4.88,19 4.59,18.87 4.5,18.62C4,17.31 3.77,16\n 3.77,14.66C3.77,13.46 4,12.37 4.45,11.42C5.78,8.63 8.73,6.82\n 11.96,6.82C16.5,6.82 20.21,10.33 20.21,14.65C20.21,16.27 18.83,17.59\n 17.13,17.59C15.43,17.59 14.05,16.27 14.05,14.65C14.05,13.58 13.12,12.71\n 11.97,12.71C10.82,12.71 9.89,13.58 9.89,14.65C9.89,16.36 10.55,17.96\n 11.76,19.16C12.71,20.1 13.62,20.62 15.03,21C15.3,21.08 15.45,21.36\n 15.38,21.62C15.33,21.85 15.12,22 14.91,22Z" })),
|
|
2628
|
+
index.h("path", { d: "M0 0h24v24H0z", fill: "none" })));
|
|
2629
|
+
};
|
|
2514
2630
|
|
|
2515
2631
|
const url = 'https://eswat2.dev';
|
|
2516
2632
|
const who = 'eswat2';
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
index.
|
|
2520
|
-
}
|
|
2521
|
-
render() {
|
|
2522
|
-
return (index.h("a", { href: url, "aria-label": who, title: who }, Paw({ hex: gray })));
|
|
2523
|
-
}
|
|
2633
|
+
const Eswat2Io = _props => {
|
|
2634
|
+
return (index.h("a", { class: "absolute top-8 right-8 text-clrs-gray hover:text-clrs-navy", href: url, "aria-label": who, title: who },
|
|
2635
|
+
index.h(Fingerprint, { label: "eswat2" })));
|
|
2524
2636
|
};
|
|
2525
|
-
Eswat2Io.style = eswat2IoCss;
|
|
2526
2637
|
|
|
2527
|
-
const funnelAppCss = "#app{--clrs-navy:#001f3f;--clrs-blue:#0074d9;--clrs-aqua:#7fdbff;--clrs-teal:#39cccc;--clrs-olive:#3d9970;--clrs-green:#2ecc40;--clrs-lime:#01ff70;--clrs-yellow:#ffdc00;--clrs-orange:#ff851b;--clrs-red:#ff4136;--clrs-maroon:#85144b;--clrs-fuchsia:#f012be;--clrs-purple:#b10dc9;--clrs-black:#111111;--clrs-gray:#aaaaaa;--clrs-silver:#dddddd;--clrs-bada55:#bada55;--clrs-slate:#708090;--clrs-slate4:#4e5964;--clrs-white:#ffffff
|
|
2638
|
+
const funnelAppCss = ".transform{--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-transform:translateX(var(--tw-translate-x))\n translateY(var(--tw-translate-y)) rotate(var(--tw-rotate))\n skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x))\n scaleY(var(--tw-scale-y))}.shadow{--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000}.ds1-main{display:flex;flex-direction:column;padding:1rem;font-family:ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,\n 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif,\n 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';color:var(--clrs-navy, #001f3f);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ds1-button{display:flex;align-items:center;color:var(--clrs-white, #ffffff)}.ds1-button:active{background-color:var(--clrs-gray, #aaaaaa);color:var(--clrs-navy, #001f3f)}.absolute{position:absolute}.top-8{top:2rem}.right-8{right:2rem}.mt-3{margin-top:0.75rem}.mb-10px{margin-bottom:10px}.mr-10px{margin-right:10px}.mt-5px{margin-top:5px}.mr-0{margin-right:0px}.ml-0{margin-left:0px}.flex{display:flex}.transform{transform:var(--tw-transform)}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.bg-clrs-blue{background-color:var(--clrs-blue, #0074d9)}.bg-clrs-red{background-color:var(--clrs-red, #ff4136)}.font-bold{font-weight:700}.italic{font-style:italic}.text-clrs-slate4{color:var(--clrs-slate4, #4e5964)}.text-clrs-gray{color:var(--clrs-gray, #aaaaaa)}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),\n 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.data-button{border-radius:5px;border:1px solid var(--clrs-slate);padding:5px;margin:0px;margin-right:5px;cursor:pointer}.funnel{width:calc(100% - 20px);height:100%;padding:10px;background-color:var(--clrs-silver);border-radius:10px;border:1px solid var(--clrs-gray)}#app{--clrs-navy:#001f3f;--clrs-blue:#0074d9;--clrs-aqua:#7fdbff;--clrs-teal:#39cccc;--clrs-olive:#3d9970;--clrs-green:#2ecc40;--clrs-lime:#01ff70;--clrs-yellow:#ffdc00;--clrs-orange:#ff851b;--clrs-red:#ff4136;--clrs-maroon:#85144b;--clrs-fuchsia:#f012be;--clrs-purple:#b10dc9;--clrs-black:#111111;--clrs-gray:#aaaaaa;--clrs-silver:#dddddd;--clrs-bada55:#bada55;--clrs-slate:#708090;--clrs-slate4:#4e5964;--clrs-white:#ffffff}.hover\\:text-clrs-navy:hover{color:var(--clrs-navy, #001f3f)}";
|
|
2528
2639
|
|
|
2529
2640
|
let FunnelApp = class {
|
|
2530
2641
|
constructor(hostRef) {
|
|
2531
2642
|
index.registerInstance(this, hostRef);
|
|
2532
2643
|
this.tag = 'funnel-app';
|
|
2533
2644
|
}
|
|
2534
|
-
render() {
|
|
2535
|
-
return (index.h("div", { id: "app" }, index.h("eswat2-io", null), index.h("funnel-gfx", null), index.h("data-source", null), index.h("color-picker", null), index.h("hr", null), index.h("data-values", null)));
|
|
2536
|
-
}
|
|
2537
|
-
};
|
|
2538
|
-
FunnelApp.style = funnelAppCss;
|
|
2539
|
-
|
|
2540
|
-
var between = createCommonjsModule(function (module, exports) {
|
|
2541
|
-
/* Between.js v0.1.2-fix.2 */
|
|
2542
|
-
!function(t,n){module.exports=n();}(commonjsGlobal,function(){function O(t){return (O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r);}}function n(t,n,e){return n&&r(t.prototype,n),e&&r(t,e),t}function M(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function I(t){return (I=Object.getPrototypeOf||function(t){return t.__proto__})(t)}function o(t,n){return (o=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function u(t,n,e){return (u="undefined"!=typeof Reflect&&Reflect.construct?Reflect.construct:function(t,n,e){var r=[null];r.push.apply(r,n);var u=new(t.bind.apply(t,r));return e&&o(u,e.prototype),u}).apply(null,arguments)}function _(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var t=function(o){var a={},i=[];(o=o||this).on=function(t,n,e){return (a[t]=a[t]||[]).push([n,e]),o},o.off=function(t,n){t||(a={});for(var e=a[t]||i,r=e.length=n?e.length:0;r--;)n==e[r][0]&&e.splice(r,1);return o},o.emit=function(t){for(var n,e=a[t]||i,r=0<e.length?e.slice(0,e.length):e,u=0;n=r[u++];)n[0].apply(n[1],i.slice.call(arguments,1));return o};};var V=function(t,n,e){return t*(1-e)+n*e},e="undefined"!=typeof window?window:"undefined"!=typeof commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:{};function a(t,n){return t(n={exports:{}},n.exports),n.exports}for(var i=a(function(t){var n=t.exports={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return (t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return --t*t*t+1},InOut:function(t){return (t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return (t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return --t*t*t*t*t+1},InOut:function(t){return (t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return .5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return (t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){var n,e=.1;return 0===t?0:1===t?1:(!e||e<1?(e=1,n=.1):n=.4*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/.4))},Out:function(t){var n,e=.1;return 0===t?0:1===t?1:(!e||e<1?(e=1,n=.1):n=.4*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-n)*(2*Math.PI)/.4)+1)},InOut:function(t){var n,e=.1;return 0===t?0:1===t?1:(!e||e<1?(e=1,n=.1):n=.4*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/.4)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/.4)*.5+1)}},Back:{In:function(t){return t*t*(2.70158*t-1.70158)},Out:function(t){return --t*t*(2.70158*t+1.70158)+1},InOut:function(t){var n=2.5949095;return (t*=2)<1?t*t*((n+1)*t-n)*.5:.5*((t-=2)*t*((n+1)*t+n)+2)}},Bounce:{In:function(t){return 1-n.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*n.Bounce.In(2*t):.5*n.Bounce.Out(2*t-1)+.5}}};}),c=(a(function(a){(function(){var t,n,e,r,u,o;"undefined"!=typeof performance&&null!==performance&&performance.now?a.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(a.exports=function(){return (t()-u)/1e6},n=process.hrtime,r=(t=function(){var t;return 1e9*(t=n())[0]+t[1]})(),o=1e9*process.uptime(),u=r-o):Date.now?(a.exports=function(){return Date.now()-e},e=Date.now()):(a.exports=function(){return (new Date).getTime()-e},e=(new Date).getTime());}).call(e);})),l="undefined"==typeof window?e:window,f=["moz","webkit"],s="AnimationFrame",p=l["request"+s],h=l["cancel"+s]||l["cancelRequest"+s],m=0;!p&&m<f.length;m++)p=l[f[m]+"Request"+s],h=l[f[m]+"Cancel"+s]||l[f[m]+"CancelRequest"+s];if(!p||!h){var d=0,y=0,v=[];p=function(t){if(0===v.length){var n=c(),e=Math.max(0,1e3/60-(n-d));d=e+n,setTimeout(function(){for(var t=v.slice(0),n=v.length=0;n<t.length;n++)if(!t[n].cancelled)try{t[n].callback(d);}catch(t){setTimeout(function(){throw t},0);}},Math.round(e));}return v.push({handle:++y,callback:t,cancelled:!1}),y},h=function(t){for(var n=0;n<v.length;n++)v[n].handle===t&&(v[n].cancelled=!0);};}var b=function(t){return p.call(l,t)};b.cancel=function(){h.apply(l,arguments);},b.polyfill=function(t){t||(t=l),t.requestAnimationFrame=p,t.cancelAnimationFrame=h;};var w,k,P=[],T=Symbol("type"),j=Symbol("start_time"),x=Symbol("completed"),D=Symbol("paused"),g=requestAnimationFrame||b,A=Date.now();!function t(){g(t),w=Date.now(),k=w-A;for(var n=0;n<P.length;n++)P[n][x]||P[n](k,Date.now()-P[n][j]);A=w;}();var E=function(t){function g(e,t){var n,r,u,o;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,g),u=this,o=I(g).call(this),M(_(_(r=!o||"object"!=typeof o&&"function"!=typeof o?_(u):o)),"update",function(){var e=_(_(r))._updateValue;return function(t,n){r[x]||r[D]||(0===r.localTime&&r.emit("start",r.value,_(_(r))),e(r.ease(r.loopFunction.progress(Math.min(1,(n||r.localTime)/r.duration)))),r.emit("update",r.value,_(_(r)),t),r.localTime>=r.duration&&r.loopFunction.complete(function(){r[x]=!0,r.emit("complete",r.value,_(_(r)));}),r.localTime+=t);}});var a=r.plugin=Object.values(g._plugins).reduce(function(t,n){return t||n&&n.test&&n.test(e)&&n},!1),i=a&&a.name||("object"===O(e)?Array.isArray(e)?"array":"object":"number");if(a){var c=a.initialize(e,t);e=c.startValue,t=c.destValue,r.data=c.data;}switch(Object.assign(_(_(r)),(M(n={duration:1e3,localTime:0,startValue:e,destValue:t,loopMode:"once",loopFunction:g.DEFAULT_LOOP,ease:function(t){return t},value:"array"===i?[].concat(e):"object"===i?Object.assign({},e):e},x,!1),M(n,T,i),M(n,j,Date.now()),M(n,D,!1),n)),r[T]){case"number":r._updateValue=function(t){r.value=V(r.startValue,r.destValue,t);};break;case"array":var l=r.value.length,f=_(_(r)),s=f.startValue,p=f.destValue,h=f.value;r._updateValue=function(t){for(var n=0;n<l;n++)h[n]=V(s[n],p[n],t);};break;case"object":var m=Object.keys(r.startValue),d=m.length,y=_(_(r)),v=y.startValue,b=y.destValue,w=y.value;r._updateValue=function(t){for(var n=0;n<d;n++){var e=m[n];w[e]=V(v[e],b[e],t);}};break;default:r.plugin?r._updateValue=function(t){r.value=r.plugin.interpolate(r.startValue,r.destValue,t,r.data);}:(console.warn("Between: startValue type was unrecognized."),r._updateValue=function(){return null});}return P.push(r.update()),r}return n(g,null,[{key:"between",value:function(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return u(g,n)}}]),n(g,[{key:"pause",value:function(){return this[D]=!0,this.emit("pause",this.value,this,k),this}},{key:"play",value:function(){return this[D]=!1,this.emit("play",this.value,this,k),this}},{key:"easing",value:function(t){return this.ease=t,this}},{key:"time",value:function(t){return this.duration=t,this}},{key:"loop",value:function(){for(var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"once",n="__loop_".concat(t),e=arguments.length,r=new Array(1<e?e-1:0),u=1;u<e;u++)r[u-1]=arguments[u];return this.loopFunction=n in this?Object.assign({},g.DEFAULT_LOOP,this[n].apply(this,r)):g.DEFAULT_LOOP,this}},{key:"__loop_repeat",value:function(t){var n=this,e=t;return this.times=0,{complete:function(t){n.localTime=0,Number.isInteger(e)&&++n.times===e?t():Number.isInteger(e)||++n.times;}}}},{key:"__loop_bounce",value:function(t){var n=this,e=t,r=1;return this.times=0,{complete:function(t){n.localTime=0,r=-r,Number.isInteger(e)&&++n.times===e?t():Number.isInteger(e)||++n.times;},progress:function(t){return 0<r?t:1-t}}}},{key:"isPaused",get:function(){return this[D]}}]),function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");o(t.prototype,n&&n.prototype),n&&o(t,n);}(g,t),g}(t);return M(E,"DEFAULT_LOOP",{complete:function(t){return t()},progress:function(t){return t}}),E.Easing=i,E._plugins={},E});
|
|
2543
|
-
});
|
|
2544
|
-
|
|
2545
|
-
const funnelGfxCss = ".funnel{width:calc(100% - 20px);height:100%;padding:10px;background-color:var(--clrs-silver);border-radius:10px;border:1px solid var(--clrs-gray)}";
|
|
2546
|
-
|
|
2547
|
-
between._plugins.color = ColorPlugin;
|
|
2548
|
-
let FunnelGfx = class {
|
|
2549
|
-
constructor(hostRef) {
|
|
2550
|
-
index.registerInstance(this, hostRef);
|
|
2551
|
-
this.stroke = navy;
|
|
2552
|
-
this.tag = 'funnel-gfx';
|
|
2553
|
-
this.processColor = (next) => {
|
|
2554
|
-
if (!this.barRefs)
|
|
2555
|
-
return;
|
|
2556
|
-
const hex1 = this.lastHex;
|
|
2557
|
-
const hex2 = colorFor(next);
|
|
2558
|
-
// IMPORTANT: we are tweening between the hex values, not the names...
|
|
2559
|
-
if (hex1 !== null && hex1 !== hex2) {
|
|
2560
|
-
if (this.tween) {
|
|
2561
|
-
this.tween.pause();
|
|
2562
|
-
}
|
|
2563
|
-
this.tween = new between(hex1, hex2)
|
|
2564
|
-
.time(1000)
|
|
2565
|
-
.easing(between.Easing.Cubic.InOut)
|
|
2566
|
-
.on('update', (v) => {
|
|
2567
|
-
this.barRefs.forEach(bar => {
|
|
2568
|
-
bar.setAttribute('fill', `${v}`);
|
|
2569
|
-
});
|
|
2570
|
-
this.lastHex = v;
|
|
2571
|
-
});
|
|
2572
|
-
}
|
|
2573
|
-
};
|
|
2574
|
-
this.processValues = (next) => {
|
|
2575
|
-
if (!this.barRefs)
|
|
2576
|
-
return;
|
|
2577
|
-
this.barRefs.forEach((bar, index) => {
|
|
2578
|
-
const height = this.barHeight[index];
|
|
2579
|
-
const last = this.lastVal[index];
|
|
2580
|
-
const value = next[index];
|
|
2581
|
-
if (last !== null && last !== value) {
|
|
2582
|
-
if (this.tween2[index]) {
|
|
2583
|
-
this.tween2[index].pause();
|
|
2584
|
-
}
|
|
2585
|
-
// NOTE: next & last are values between 0-100 (aka. percentage)
|
|
2586
|
-
this.tween2[index] = new between(last, value)
|
|
2587
|
-
.time(1000)
|
|
2588
|
-
.easing(between.Easing.Cubic.InOut)
|
|
2589
|
-
.on('update', (v) => {
|
|
2590
|
-
const y = height * ((100 - v) / 100);
|
|
2591
|
-
bar.setAttribute('y', `${y}`);
|
|
2592
|
-
this.lastVal[index] = v;
|
|
2593
|
-
});
|
|
2594
|
-
}
|
|
2595
|
-
});
|
|
2596
|
-
};
|
|
2597
|
-
this.bgdFill = white;
|
|
2598
|
-
this.xFill = colorFor('bada55');
|
|
2599
|
-
this.barHeight = undefined;
|
|
2600
|
-
this.barRefs = undefined;
|
|
2601
|
-
this.lastHex = '#bada55';
|
|
2602
|
-
this.tween = undefined;
|
|
2603
|
-
this.lastVal = [0, 0, 0, 0, 0];
|
|
2604
|
-
this.tween2 = [undefined, undefined, undefined, undefined, undefined];
|
|
2605
|
-
this.createFunnel = ({ id, height, width, x, y, drop }) => {
|
|
2606
|
-
const obj = {
|
|
2607
|
-
id: id,
|
|
2608
|
-
height,
|
|
2609
|
-
width,
|
|
2610
|
-
x,
|
|
2611
|
-
y,
|
|
2612
|
-
maskId: `mask-${id}`,
|
|
2613
|
-
maskUri: `url('#mask-${id}')`,
|
|
2614
|
-
mask: `0.5,0.5,0.5,${height - 0.5},${width - 0.5},${height - drop - 0.5},${width - 0.5},${drop + 0.5}`,
|
|
2615
|
-
matrix: `matrix(1,0,0,1,${x},${y})`,
|
|
2616
|
-
points: `0,0,0,${height},${width},${height - drop},${width},${drop}`,
|
|
2617
|
-
};
|
|
2618
|
-
return obj;
|
|
2619
|
-
};
|
|
2620
|
-
this.generateBars = () => {
|
|
2621
|
-
return funnelDefs.map(item => {
|
|
2622
|
-
return this.createFunnel(item);
|
|
2623
|
-
});
|
|
2624
|
-
};
|
|
2625
|
-
}
|
|
2626
2645
|
componentDidLoad() {
|
|
2627
|
-
store.onChange('pick',
|
|
2628
|
-
store.onChange('values',
|
|
2646
|
+
store.onChange('pick', processColor);
|
|
2647
|
+
store.onChange('values', processValues);
|
|
2629
2648
|
}
|
|
2630
2649
|
render() {
|
|
2631
|
-
|
|
2632
|
-
const { bgdFill, xFill, stroke } = this;
|
|
2633
|
-
// IMPORTANT: initialize these arrays when you render...
|
|
2634
|
-
this.barHeight = Array(bars.length);
|
|
2635
|
-
this.barRefs = Array(bars.length);
|
|
2636
|
-
return (index.h("div", { class: "funnel" }, index.h("svg", { viewBox: "0 0 600 420" }, index.h("desc", null, "Created with Snap"), index.h("defs", null, bars.map(item => {
|
|
2637
|
-
return (index.h("mask", { id: item.maskId }, index.h("polygon", { points: item.mask, fill: bgdFill })));
|
|
2638
|
-
})), bars.map((item, index$1) => {
|
|
2639
|
-
const { height, width, maskUri, matrix, points } = item;
|
|
2640
|
-
this.barHeight[index$1] = height;
|
|
2641
|
-
return (index.h("g", { transform: matrix }, index.h("polygon", { points: points, fill: bgdFill, stroke: stroke }), index.h("rect", { ref: el => (this.barRefs[index$1] = el), x: "0", y: height, width: width, height: height, mask: maskUri, fill: xFill, stroke: stroke })));
|
|
2642
|
-
}))));
|
|
2650
|
+
return (index.h("div", { id: "app", class: "ds1-main" }, index.h(Eswat2Io, null), index.h(FunnelGfx, null), index.h(DataSource, null), index.h(ColorPicker, null), index.h("hr", { class: "mr-0 ml-0" }), index.h(DataValues, null)));
|
|
2643
2651
|
}
|
|
2644
2652
|
};
|
|
2645
|
-
|
|
2653
|
+
FunnelApp.style = funnelAppCss;
|
|
2646
2654
|
|
|
2647
|
-
exports.color_picker = FunnelGfx$1;
|
|
2648
|
-
exports.data_source = DataSource;
|
|
2649
|
-
exports.data_values = DataValues;
|
|
2650
|
-
exports.eswat2_io = Eswat2Io;
|
|
2651
2655
|
exports.funnel_app = FunnelApp;
|
|
2652
|
-
exports.funnel_gfx = FunnelGfx;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-53976b87.js');
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
Stencil Client Patch Browser v2.11.0 | MIT Licensed | https://stenciljs.com
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["
|
|
18
|
+
return index.bootstrapLazy([["funnel-app.cjs",[[1,"funnel-app",{"tag":[1]}]]]], options);
|
|
19
19
|
});
|
|
@@ -199,6 +199,10 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
+
if (typeof nodeName === 'function') {
|
|
203
|
+
// nodeName is a functional component
|
|
204
|
+
return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
|
|
205
|
+
}
|
|
202
206
|
const vnode = newVNode(nodeName, null);
|
|
203
207
|
vnode.$attrs$ = vnodeData;
|
|
204
208
|
if (vNodeChildren.length > 0) {
|
|
@@ -221,6 +225,36 @@ const newVNode = (tag, text) => {
|
|
|
221
225
|
};
|
|
222
226
|
const Host = {};
|
|
223
227
|
const isHost = (node) => node && node.$tag$ === Host;
|
|
228
|
+
const vdomFnUtils = {
|
|
229
|
+
forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
|
|
230
|
+
map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
|
|
231
|
+
};
|
|
232
|
+
const convertToPublic = (node) => ({
|
|
233
|
+
vattrs: node.$attrs$,
|
|
234
|
+
vchildren: node.$children$,
|
|
235
|
+
vkey: node.$key$,
|
|
236
|
+
vname: node.$name$,
|
|
237
|
+
vtag: node.$tag$,
|
|
238
|
+
vtext: node.$text$,
|
|
239
|
+
});
|
|
240
|
+
const convertToPrivate = (node) => {
|
|
241
|
+
if (typeof node.vtag === 'function') {
|
|
242
|
+
const vnodeData = Object.assign({}, node.vattrs);
|
|
243
|
+
if (node.vkey) {
|
|
244
|
+
vnodeData.key = node.vkey;
|
|
245
|
+
}
|
|
246
|
+
if (node.vname) {
|
|
247
|
+
vnodeData.name = node.vname;
|
|
248
|
+
}
|
|
249
|
+
return h(node.vtag, vnodeData, ...(node.vchildren || []));
|
|
250
|
+
}
|
|
251
|
+
const vnode = newVNode(node.vtag, node.vtext);
|
|
252
|
+
vnode.$attrs$ = node.vattrs;
|
|
253
|
+
vnode.$children$ = node.vchildren;
|
|
254
|
+
vnode.$key$ = node.vkey;
|
|
255
|
+
vnode.$name$ = node.vname;
|
|
256
|
+
return vnode;
|
|
257
|
+
};
|
|
224
258
|
/**
|
|
225
259
|
* Production setAccessor() function based on Preact by
|
|
226
260
|
* Jason Miller (@developit)
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-53976b87.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Stencil Client Patch Esm v2.11.0 | MIT Licensed | https://stenciljs.com
|
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["
|
|
17
|
+
return index.bootstrapLazy([["funnel-app.cjs",[[1,"funnel-app",{"tag":[1]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
|
-
"./components/
|
|
4
|
-
"./components/data-source/data-source.js",
|
|
5
|
-
"./components/data-values/data-values.js",
|
|
6
|
-
"./components/eswat2-io/eswat2-io.js",
|
|
7
|
-
"./components/funnel-app/funnel-app.js",
|
|
8
|
-
"./components/funnel-gfx/funnel-gfx.js"
|
|
3
|
+
"./components/funnel-app/funnel-app.js"
|
|
9
4
|
],
|
|
10
5
|
"compiler": {
|
|
11
6
|
"name": "@stencil/core",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
const ChevronDoubleLeft = props => {
|
|
3
|
+
const hex = props.hex || 'currentColor';
|
|
4
|
+
const klass = props.class;
|
|
5
|
+
const label = props.label || 'chevron-double-left';
|
|
6
|
+
const size = props.size || 24;
|
|
7
|
+
return (h("svg", { class: klass, width: size, height: size, viewBox: "0 0 24 24", role: "img", "aria-label": "title" },
|
|
8
|
+
h("title", null, label),
|
|
9
|
+
h("g", { fill: hex },
|
|
10
|
+
h("path", { d: "M18.41,7.41L17,6L11,12L17,18L18.41,16.59L13.83,12L18.41,7.41M12.41,7.41L11,6L5,12L11,18L12.41,16.59L7.83,12L12.41,7.41Z" })),
|
|
11
|
+
h("path", { d: "M0 0h24v24H0z", fill: "none" })));
|
|
12
|
+
};
|
|
13
|
+
export { ChevronDoubleLeft };
|
|
14
|
+
export default ChevronDoubleLeft;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
const Close = props => {
|
|
3
|
+
const hex = props.hex || 'currentColor';
|
|
4
|
+
const klass = props.class;
|
|
5
|
+
const label = props.label || 'close';
|
|
6
|
+
const size = props.size || 24;
|
|
7
|
+
return (h("svg", { class: klass, width: size, height: size, viewBox: "0 0 24 24", role: "img", "aria-label": "title" },
|
|
8
|
+
h("title", null, label),
|
|
9
|
+
h("g", { fill: hex },
|
|
10
|
+
h("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" })),
|
|
11
|
+
h("path", { d: "M0 0h24v24H0z", fill: "none" })));
|
|
12
|
+
};
|
|
13
|
+
export { Close };
|
|
14
|
+
export default Close;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { Radio } from './radio';
|
|
3
|
+
import { colorKeys, colorFor, store, actions } from '../../utils';
|
|
4
|
+
const ColorPicker = _props => {
|
|
5
|
+
const { pick } = store.state;
|
|
6
|
+
return (h("div", { id: "toolbar", class: "flex flex-wrap", role: "radiogroup" }, colorKeys.map((key) => {
|
|
7
|
+
const hex = colorFor(key);
|
|
8
|
+
const selected = pick == key;
|
|
9
|
+
return (h("div", { "aria-label": key, role: "radio", title: key, onClick: () => {
|
|
10
|
+
actions.updatePick(key);
|
|
11
|
+
} },
|
|
12
|
+
h(Radio, { hex: hex, selected: selected })));
|
|
13
|
+
})));
|
|
14
|
+
};
|
|
15
|
+
export { ColorPicker };
|
|
16
|
+
export default ColorPicker;
|