proto-table-wc 0.0.226 → 0.0.229
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/demo-table_2.cjs.entry.js +3 -3
- package/dist/cjs/{index-565185b8.js → index-d8659f4b.js} +4 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/proto-table-wc.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/esm/demo-table_2.entry.js +3 -3
- package/dist/esm/{index-cf16746a.js → index-a1cd4778.js} +4 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/proto-table-wc.js +2 -2
- package/dist/proto-table-wc/{p-1a5f009f.js → p-76484e28.js} +1 -1
- package/dist/proto-table-wc/p-e450d13c.entry.js +1 -0
- package/dist/proto-table-wc/proto-table-wc.esm.js +1 -1
- package/package.json +3 -3
- package/dist/proto-table-wc/p-b71cceaa.entry.js +0 -1
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const index = require('./index-
|
5
|
+
const index = require('./index-d8659f4b.js');
|
6
6
|
|
7
7
|
const demoTableCss = ".detailWrapper{font-weight:100;font-size:13px;display:flex;flex-direction:column;justify-items:start;padding:5px;padding-left:30px}";
|
8
8
|
|
9
|
-
|
9
|
+
const DemoTable = class {
|
10
10
|
constructor(hostRef) {
|
11
11
|
index.registerInstance(this, hostRef);
|
12
12
|
this.fields = [
|
@@ -100,7 +100,7 @@ const iconAliases = {
|
|
100
100
|
const aliasFor = name => {
|
101
101
|
return iconAliases[name];
|
102
102
|
};
|
103
|
-
|
103
|
+
const ProtoTable = class {
|
104
104
|
constructor(hostRef) {
|
105
105
|
index.registerInstance(this, hostRef);
|
106
106
|
this.data = [];
|
@@ -778,7 +778,10 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
778
778
|
const flags = hostRef.$flags$;
|
779
779
|
const instance = hostRef.$lazyInstance$ ;
|
780
780
|
newVal = parsePropertyValue(newVal);
|
781
|
-
|
781
|
+
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
782
|
+
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
783
|
+
const didValueChange = newVal !== oldVal && !areBothNaN;
|
784
|
+
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
782
785
|
// gadzooks! the property's value has changed!!
|
783
786
|
// set our new value!
|
784
787
|
hostRef.$instanceValues$.set(propName, newVal);
|
package/dist/cjs/loader.cjs.js
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const index = require('./index-
|
5
|
+
const index = require('./index-d8659f4b.js');
|
6
6
|
|
7
7
|
/*
|
8
|
-
Stencil Client Patch Esm v2.14.
|
8
|
+
Stencil Client Patch Esm v2.14.1 | MIT Licensed | https://stenciljs.com
|
9
9
|
*/
|
10
10
|
const patchEsm = () => {
|
11
11
|
return index.promiseResolve();
|
@@ -1,9 +1,9 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
const index = require('./index-
|
3
|
+
const index = require('./index-d8659f4b.js');
|
4
4
|
|
5
5
|
/*
|
6
|
-
Stencil Client Patch Browser v2.14.
|
6
|
+
Stencil Client Patch Browser v2.14.1 | MIT Licensed | https://stenciljs.com
|
7
7
|
*/
|
8
8
|
const patchBrowser = () => {
|
9
9
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('proto-table-wc.cjs.js', document.baseURI).href));
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
1
|
+
import { r as registerInstance, h } from './index-a1cd4778.js';
|
2
2
|
|
3
3
|
const demoTableCss = ".detailWrapper{font-weight:100;font-size:13px;display:flex;flex-direction:column;justify-items:start;padding:5px;padding-left:30px}";
|
4
4
|
|
5
|
-
|
5
|
+
const DemoTable = class {
|
6
6
|
constructor(hostRef) {
|
7
7
|
registerInstance(this, hostRef);
|
8
8
|
this.fields = [
|
@@ -96,7 +96,7 @@ const iconAliases = {
|
|
96
96
|
const aliasFor = name => {
|
97
97
|
return iconAliases[name];
|
98
98
|
};
|
99
|
-
|
99
|
+
const ProtoTable = class {
|
100
100
|
constructor(hostRef) {
|
101
101
|
registerInstance(this, hostRef);
|
102
102
|
this.data = [];
|
@@ -756,7 +756,10 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
756
756
|
const flags = hostRef.$flags$;
|
757
757
|
const instance = hostRef.$lazyInstance$ ;
|
758
758
|
newVal = parsePropertyValue(newVal);
|
759
|
-
|
759
|
+
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
760
|
+
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
761
|
+
const didValueChange = newVal !== oldVal && !areBothNaN;
|
762
|
+
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
760
763
|
// gadzooks! the property's value has changed!!
|
761
764
|
// set our new value!
|
762
765
|
hostRef.$instanceValues$.set(propName, newVal);
|
package/dist/esm/loader.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-a1cd4778.js';
|
2
2
|
|
3
3
|
/*
|
4
|
-
Stencil Client Patch Esm v2.14.
|
4
|
+
Stencil Client Patch Esm v2.14.1 | MIT Licensed | https://stenciljs.com
|
5
5
|
*/
|
6
6
|
const patchEsm = () => {
|
7
7
|
return promiseResolve();
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-a1cd4778.js';
|
2
2
|
|
3
3
|
/*
|
4
|
-
Stencil Client Patch Browser v2.14.
|
4
|
+
Stencil Client Patch Browser v2.14.1 | MIT Licensed | https://stenciljs.com
|
5
5
|
*/
|
6
6
|
const patchBrowser = () => {
|
7
7
|
const importMeta = import.meta.url;
|
@@ -1 +1 @@
|
|
1
|
-
let e,t,n=!1,l=!1;const o="undefined"!=typeof window?window:{},s=o.document||{head:{}},r={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},i=e=>Promise.resolve(e),c=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),u=new WeakMap,a=e=>"sc-"+e.o,f={},h=e=>"object"==(e=typeof e)||"function"===e,$=(e,t,...n)=>{let l=null,o=!1,s=!1,r=[];const i=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?i(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof e&&!h(l))&&(l+=""),o&&s?r[r.length-1].i+=l:r.push(o?p(null,l):l),s=o)};if(i(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const c=p(e,null);return c.u=t,r.length>0&&(c.h=r),c},p=(e,t)=>({t:0,$:e,i:t,p:null,h:null,u:null}),d={},
|
1
|
+
let e,t,n=!1,l=!1;const o="undefined"!=typeof window?window:{},s=o.document||{head:{}},r={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},i=e=>Promise.resolve(e),c=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),u=new WeakMap,a=e=>"sc-"+e.o,f={},h=e=>"object"==(e=typeof e)||"function"===e,$=(e,t,...n)=>{let l=null,o=!1,s=!1,r=[];const i=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?i(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof e&&!h(l))&&(l+=""),o&&s?r[r.length-1].i+=l:r.push(o?p(null,l):l),s=o)};if(i(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const c=p(e,null);return c.u=t,r.length>0&&(c.h=r),c},p=(e,t)=>({t:0,$:e,i:t,p:null,h:null,u:null}),d={},m=(e,t,n,l,s,i)=>{if(n!==l){let c=V(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,o=w(n),s=w(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("ref"===t)l&&l(e);else if(c||"o"!==t[0]||"n"!==t[1]){const o=h(l);if((c||o&&null!==l)&&!s)try{if(e.tagName.includes("-"))e[t]=l;else{let o=null==l?"":l;"list"===t?c=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!c||4&i||s)&&!o&&e.setAttribute(t,l=!0===l?"":l)}else t="-"===t[2]?t.slice(3):V(o,u)?u.slice(2):u[2]+t.slice(3),n&&r.rel(e,t,n,!1),l&&r.ael(e,t,l,!1)}},y=/\s/,w=e=>e?e.split(y):[],b=(e,t,n,l)=>{const o=11===t.p.nodeType&&t.p.host?t.p.host:t.p,s=e&&e.u||f,r=t.u||f;for(l in s)l in r||m(o,l,s[l],void 0,n,t.t);for(l in r)m(o,l,s[l],r[l],n,t.t)},g=(t,l,o)=>{let r,i,c=l.h[o],u=0;if(null!==c.i)r=c.p=s.createTextNode(c.i);else{if(n||(n="svg"===c.$),r=c.p=s.createElementNS(n?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",c.$),n&&"foreignObject"===c.$&&(n=!1),b(null,c,n),null!=e&&r["s-si"]!==e&&r.classList.add(r["s-si"]=e),c.h)for(u=0;u<c.h.length;++u)i=g(t,c,u),i&&r.appendChild(i);"svg"===c.$?n=!1:"foreignObject"===r.tagName&&(n=!0)}return r},S=(e,n,l,o,s,r)=>{let i,c=e;for(c.shadowRoot&&c.tagName===t&&(c=c.shadowRoot);s<=r;++s)o[s]&&(i=g(null,l,s),i&&(o[s].p=i,c.insertBefore(i,n)))},j=(e,t,n,l,o)=>{for(;t<=n;++t)(l=e[t])&&(o=l.p,M(l),o.remove())},v=(e,t)=>e.$===t.$,O=(e,t)=>{const l=t.p=e.p,o=e.h,s=t.h,r=t.$,i=t.i;null===i?(n="svg"===r||"foreignObject"!==r&&n,b(e,t,n),null!==o&&null!==s?((e,t,n,l)=>{let o,s=0,r=0,i=t.length-1,c=t[0],u=t[i],a=l.length-1,f=l[0],h=l[a];for(;s<=i&&r<=a;)null==c?c=t[++s]:null==u?u=t[--i]:null==f?f=l[++r]:null==h?h=l[--a]:v(c,f)?(O(c,f),c=t[++s],f=l[++r]):v(u,h)?(O(u,h),u=t[--i],h=l[--a]):v(c,h)?(O(c,h),e.insertBefore(c.p,u.p.nextSibling),c=t[++s],h=l[--a]):v(u,f)?(O(u,f),e.insertBefore(u.p,c.p),u=t[--i],f=l[++r]):(o=g(t&&t[r],n,r),f=l[++r],o&&c.p.parentNode.insertBefore(o,c.p));s>i?S(e,null==l[a+1]?null:l[a+1].p,n,l,r,a):r>a&&j(t,s,i)})(l,o,t,s):null!==s?(null!==e.i&&(l.textContent=""),S(l,null,t,s,0,s.length-1)):null!==o&&j(o,0,o.length-1),n&&"svg"===r&&(n=!1)):e.i!==i&&(l.data=i)},M=e=>{e.u&&e.u.ref&&e.u.ref(null),e.h&&e.h.map(M)},k=(e,t)=>{t&&!e.m&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.m=t)))},C=(e,t)=>{if(e.t|=16,!(4&e.t))return k(e,e.g),Z((()=>x(e,t)));e.t|=512},x=(e,t)=>{const n=e.S;let l;return t&&(l=T(n,"componentWillLoad")),W(l,(()=>L(e,n,t)))},L=async(e,t,n)=>{const l=e.j,o=l["s-rc"];n&&(e=>{const t=e.v,n=e.j,l=t.t,o=((e,t)=>{let n=a(t),l=G.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=u.get(e=e.head||e);o||u.set(e,o=new Set),o.has(n)||(t=s.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);P(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>E(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},P=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const o=n.j,s=n.O||p(null,null),r=(e=>e&&e.$===d)(l)?l:$(null,null,l);t=o.tagName,r.$=null,r.t|=4,n.O=r,r.p=s.p=o.shadowRoot||o,e=o["s-sc"],O(s,r)})(n,l)}catch(e){_(e,n.j)}return null},E=e=>{const t=e.j,n=e.S,l=e.g;64&e.t||(e.t|=64,A(t),T(n,"componentDidLoad"),e.M(t),l||N()),e.m&&(e.m(),e.m=void 0),512&e.t&&Y((()=>C(e,!1))),e.t&=-517},N=()=>{A(s.documentElement),Y((()=>(e=>{const t=r.ce("appload",{detail:{namespace:"proto-table-wc"}});return e.dispatchEvent(t),t})(o)))},T=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){_(e)}},W=(e,t)=>e&&e.then?e.then(t):t(),A=e=>e.classList.add("hydrated"),R=(e,t,n)=>{if(t.k){const l=Object.entries(t.k),o=e.prototype;if(l.map((([e,[t]])=>{(31&t||2&n&&32&t)&&Object.defineProperty(o,e,{get(){return((e,t)=>D(this).C.get(t))(0,e)},set(t){((e,t,n)=>{const l=D(e),o=l.C.get(t),s=l.t,r=l.S;n=(e=>(null==e||h(e),e))(n),8&s&&void 0!==o||n===o||Number.isNaN(o)&&Number.isNaN(n)||(l.C.set(t,n),r&&2==(18&s)&&C(l,!1))})(this,e,t)},configurable:!0,enumerable:!0})})),1&n){const t=new Map;o.attributeChangedCallback=function(e,n,l){r.jmp((()=>{const n=t.get(e);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(o.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))}}return e},U=(e,t={})=>{const n=[],l=t.exclude||[],i=o.customElements,u=s.head,f=u.querySelector("meta[charset]"),h=s.createElement("style"),$=[];let p,d=!0;Object.assign(r,t),r.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const o={t:t[0],o:t[1],k:t[2],L:t[3]};o.k=t[2];const s=o.o,u=class extends HTMLElement{constructor(e){super(e),H(e=this,o),1&o.t&&e.attachShadow({mode:"open"})}connectedCallback(){p&&(clearTimeout(p),p=null),d?$.push(this):r.jmp((()=>(e=>{if(0==(1&r.t)){const t=D(e),n=t.v,l=()=>{};if(!(1&t.t)){t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){k(t,t.g=n);break}}n.k&&Object.entries(n.k).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,o)=>{if(0==(32&t.t)){{if(t.t|=32,(o=B(n)).then){const e=()=>{};o=await o,e()}o.isProxied||(R(o,n,2),o.isProxied=!0);const e=()=>{};t.t|=8;try{new o(t)}catch(e){_(e)}t.t&=-9,e()}if(o.style){let e=o.style;const t=a(n);if(!G.has(t)){const l=()=>{};((e,t,n)=>{let l=G.get(e);c&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,G.set(e,l)})(t,e,!!(1&n.t)),l()}}}const s=t.g,r=()=>C(t,!0);s&&s["s-rc"]?s["s-rc"].push(r):r()})(0,t,n)}l()}})(this)))}disconnectedCallback(){r.jmp((()=>{}))}componentOnReady(){return D(this).P}};o.N=e[0],l.includes(s)||i.get(s)||(n.push(s),i.define(s,R(u,o,1)))}))})),h.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",h.setAttribute("data-styles",""),u.insertBefore(h,f?f.nextSibling:u.firstChild),d=!1,$.length?$.map((e=>e.connectedCallback())):r.jmp((()=>p=setTimeout(N,30)))},q=new WeakMap,D=e=>q.get(e),F=(e,t)=>q.set(t.S=e,t),H=(e,t)=>{const n={t:0,j:e,v:t,C:new Map};return n.P=new Promise((e=>n.M=e)),e["s-p"]=[],e["s-rc"]=[],q.set(e,n)},V=(e,t)=>t in e,_=(e,t)=>(0,console.error)(e,t),z=new Map,B=e=>{const t=e.o.replace(/-/g,"_"),n=e.N,l=z.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(z.set(n,e),e[t])),_)},G=new Map,I=[],J=[],K=(e,t)=>n=>{e.push(n),l||(l=!0,t&&4&r.t?Y(X):r.raf(X))},Q=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){_(e)}e.length=0},X=()=>{Q(I),Q(J),(l=I.length>0)&&r.raf(X)},Y=e=>i().then(e),Z=K(J,!0);export{U as b,$ as h,i as p,F as r}
|
@@ -0,0 +1 @@
|
|
1
|
+
import{r as t,h as e}from"./p-76484e28.js";const r=class{constructor(r){t(this,r),this.fields=[{label:"Date",prop:"date"},{label:"List Price",prop:"price"},{label:"% of Market",prop:"market"},{label:"ProfitTime Score",prop:"score"}],this.items=[],this.table=void 0,this.renderDetails=t=>{const{tags:r=[]}=t;return e("div",{class:"detailWrapper"},e("span",null,r.length," details..."),e("ul",null,r.map((t=>e("li",null,t)))))}}componentWillLoad(){this.items=[{date:"08/30/2020",price:"$24,000",market:"98%",score:"No Score",tags:["one","two","three"]},{date:"08/31/2020",price:"$24,000",market:"99%",score:"No Score",tags:["uno","duo"]},{date:"09/01/2020",price:"$27,000",market:"102%",score:"Platinum"},{date:"09/02/2020",price:"$27,423",market:"104%",score:"Platinum",tags:["dog","cat","fish","hamster"]},{date:"09/03/2020",price:"$27,521",market:"106%",score:"Platinum",tags:["4wd","sports"]},{date:"09/04/2020",price:"$27,687",market:"107%",score:"Platinum",tags:["leather","chrome"]}]}componentDidLoad(){const{table:t,items:e,fields:r}=this;t.data=e,t.fields=r,t.details=this.renderDetails}render(){return e("proto-table",{ref:t=>this.table=t})}};r.style=".detailWrapper{font-weight:100;font-size:13px;display:flex;flex-direction:column;justify-items:start;padding:5px;padding-left:30px}";const s={down:"M12 15.4L6.6 10 8 8.6l4 4 4-4 1.4 1.4z",up:"M16 15.4l-4-4-4 4L6.6 14 12 8.6l5.4 5.4z",left:"M14 17.4L8.6 12 14 6.6 15.4 8l-4 4 4 4z",right:"M10 17.4L8.6 16l4-4-4-4L10 6.6l5.4 5.4z",more:"M12 14a2 2 0 100-4 2 2 0 000 4zm-6 0a2 2 0 100-4 2 2 0 000 4zm12 0a2 2 0 100-4 2 2 0 000 4z","arrow-up":"M5.3 10.7l1.4 1.4L11 7.8V20h2V7.8l4.3 4.3 1.4-1.4L12 4z","arrow-down":"M18.7 13.3l-1.4-1.4-4.3 4.3V4h-2v12.2l-4.3-4.3-1.4 1.4L12 20z"},i={right:"show",down:"hide","arrow-up":"sort","arrow-down":"sort"},l=class{constructor(r){t(this,r),this.data=[],this.details=void 0,this.fields=[],this.expanded=void 0,this.sort=void 0,this.clicks=0,this.protoIcon=(t,r,l=24)=>{const o=s[t];return e("svg",{width:l,height:l,viewBox:"0 0 24 24",role:"img","aria-labelledby":"title"},e("title",null,(t=>i[t])(t)),e("g",{fill:r},e("path",{d:o})),e("path",{d:"M0 0h24v24H0z",fill:"none"}))},this.handleCellClick=(t,e)=>()=>{0===t&&(this.expanded=this.expanded===e?void 0:e)},this.handleSortClick=t=>()=>{this.sort===t?2===this.clicks?(this.clicks=0,this.sort=void 0):this.clicks=this.clicks+1:(this.sort=t,this.clicks=1)},this.iconFor=t=>this.sort===t&&2===this.clicks?"arrow-up":"arrow-down",this.header=()=>{const{fields:t,iconFor:r,protoIcon:s}=this;return e("div",{class:"header"},t.map((({label:t},i)=>{const l=i===this.sort?"headerCell sort":"headerCell",o=r(i);return e("div",{class:l,onClick:this.handleSortClick(i)},s(o),e("span",null,t))})))},this.row=(t,r)=>{const{fields:s,protoIcon:i}=this;return e("div",{class:"rowContainer"},e("div",{class:this.expanded===r?"row expanded":"row"},s.map((({prop:s},l)=>e("div",{class:l===this.sort?"cell sort":"cell",onClick:this.handleCellClick(l,r)},i(0===l&&this.details?this.expanded===r?"down":"right":"pad"),t[s])))),this.details&&this.expanded===r&&this.details(t))}}render(){const t=this.data||[];return e("div",{class:"table"},this.header(),t.map(((t,e)=>this.row(t,e))))}};l.style=".table{font-weight:400;font-size:13px;display:flex;flex-direction:column;width:100%;border:1px solid var(--clrs-navy);border-radius:2px}.table svg{fill:var(--clrs-navy)}.header{display:flex}.headerCell{flex-basis:100%;display:flex;align-items:center;justify-items:start;border-right:1px solid var(--clrs-navy);border-bottom:1px solid var(--clrs-navy);padding:5px;cursor:pointer}.headerCell svg g{display:none}.headerCell.sort svg g{display:inline}.headerCell:hover svg g{display:inline}.headerCell:hover{background-color:var(--clrs-silver)}.headerCell:last-child{border-right:none}.cell{flex-basis:100%;display:flex;align-items:center;justify-items:start;padding:5px}.cell:first-child svg{cursor:pointer}.sort{background-color:var(--cx-column-sort)}.row{display:flex;justify-items:stretch;width:100%}.row.expanded{background-color:var(--cx-row-expanded)}.row.expanded svg{fill:var(--clrs-red)}.row:hover{background-color:var(--cx-row-hover)}";export{r as demo_table,l as proto_table}
|
@@ -1 +1 @@
|
|
1
|
-
import{p as
|
1
|
+
import{p as e,b as t}from"./p-76484e28.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t([["p-e450d13c",[[1,"demo-table"],[0,"proto-table",{data:[16],details:[8],fields:[16],expanded:[32],sort:[32],clicks:[32]}]]]],e)));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "proto-table-wc",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.229",
|
4
4
|
"description": "Stencil Component Starter",
|
5
5
|
"main": "dist/index.cjs.js",
|
6
6
|
"module": "dist/index.js",
|
@@ -27,7 +27,7 @@
|
|
27
27
|
"format": "prettier --write src"
|
28
28
|
},
|
29
29
|
"dependencies": {
|
30
|
-
"@stencil/core": "2.14.
|
30
|
+
"@stencil/core": "2.14.1"
|
31
31
|
},
|
32
32
|
"devDependencies": {
|
33
33
|
"@types/jest": "27.4.1",
|
@@ -36,7 +36,7 @@
|
|
36
36
|
"eslint": "8.10.0",
|
37
37
|
"jest": "27.5.1",
|
38
38
|
"prettier": "2.5.1",
|
39
|
-
"puppeteer": "13.
|
39
|
+
"puppeteer": "13.5.1",
|
40
40
|
"tslint": "6.1.3",
|
41
41
|
"typescript": "4.6.2"
|
42
42
|
},
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as t,h as e}from"./p-1a5f009f.js";let r=class{constructor(r){t(this,r),this.fields=[{label:"Date",prop:"date"},{label:"List Price",prop:"price"},{label:"% of Market",prop:"market"},{label:"ProfitTime Score",prop:"score"}],this.items=[],this.table=void 0,this.renderDetails=t=>{const{tags:r=[]}=t;return e("div",{class:"detailWrapper"},e("span",null,r.length," details..."),e("ul",null,r.map((t=>e("li",null,t)))))}}componentWillLoad(){this.items=[{date:"08/30/2020",price:"$24,000",market:"98%",score:"No Score",tags:["one","two","three"]},{date:"08/31/2020",price:"$24,000",market:"99%",score:"No Score",tags:["uno","duo"]},{date:"09/01/2020",price:"$27,000",market:"102%",score:"Platinum"},{date:"09/02/2020",price:"$27,423",market:"104%",score:"Platinum",tags:["dog","cat","fish","hamster"]},{date:"09/03/2020",price:"$27,521",market:"106%",score:"Platinum",tags:["4wd","sports"]},{date:"09/04/2020",price:"$27,687",market:"107%",score:"Platinum",tags:["leather","chrome"]}]}componentDidLoad(){const{table:t,items:e,fields:r}=this;t.data=e,t.fields=r,t.details=this.renderDetails}render(){return e("proto-table",{ref:t=>this.table=t})}};r.style=".detailWrapper{font-weight:100;font-size:13px;display:flex;flex-direction:column;justify-items:start;padding:5px;padding-left:30px}";const s={down:"M12 15.4L6.6 10 8 8.6l4 4 4-4 1.4 1.4z",up:"M16 15.4l-4-4-4 4L6.6 14 12 8.6l5.4 5.4z",left:"M14 17.4L8.6 12 14 6.6 15.4 8l-4 4 4 4z",right:"M10 17.4L8.6 16l4-4-4-4L10 6.6l5.4 5.4z",more:"M12 14a2 2 0 100-4 2 2 0 000 4zm-6 0a2 2 0 100-4 2 2 0 000 4zm12 0a2 2 0 100-4 2 2 0 000 4z","arrow-up":"M5.3 10.7l1.4 1.4L11 7.8V20h2V7.8l4.3 4.3 1.4-1.4L12 4z","arrow-down":"M18.7 13.3l-1.4-1.4-4.3 4.3V4h-2v12.2l-4.3-4.3-1.4 1.4L12 20z"},i={right:"show",down:"hide","arrow-up":"sort","arrow-down":"sort"};let l=class{constructor(r){t(this,r),this.data=[],this.details=void 0,this.fields=[],this.expanded=void 0,this.sort=void 0,this.clicks=0,this.protoIcon=(t,r,l=24)=>{const o=s[t];return e("svg",{width:l,height:l,viewBox:"0 0 24 24",role:"img","aria-labelledby":"title"},e("title",null,(t=>i[t])(t)),e("g",{fill:r},e("path",{d:o})),e("path",{d:"M0 0h24v24H0z",fill:"none"}))},this.handleCellClick=(t,e)=>()=>{0===t&&(this.expanded=this.expanded===e?void 0:e)},this.handleSortClick=t=>()=>{this.sort===t?2===this.clicks?(this.clicks=0,this.sort=void 0):this.clicks=this.clicks+1:(this.sort=t,this.clicks=1)},this.iconFor=t=>this.sort===t&&2===this.clicks?"arrow-up":"arrow-down",this.header=()=>{const{fields:t,iconFor:r,protoIcon:s}=this;return e("div",{class:"header"},t.map((({label:t},i)=>{const l=i===this.sort?"headerCell sort":"headerCell",o=r(i);return e("div",{class:l,onClick:this.handleSortClick(i)},s(o),e("span",null,t))})))},this.row=(t,r)=>{const{fields:s,protoIcon:i}=this;return e("div",{class:"rowContainer"},e("div",{class:this.expanded===r?"row expanded":"row"},s.map((({prop:s},l)=>e("div",{class:l===this.sort?"cell sort":"cell",onClick:this.handleCellClick(l,r)},i(0===l&&this.details?this.expanded===r?"down":"right":"pad"),t[s])))),this.details&&this.expanded===r&&this.details(t))}}render(){const t=this.data||[];return e("div",{class:"table"},this.header(),t.map(((t,e)=>this.row(t,e))))}};l.style=".table{font-weight:400;font-size:13px;display:flex;flex-direction:column;width:100%;border:1px solid var(--clrs-navy);border-radius:2px}.table svg{fill:var(--clrs-navy)}.header{display:flex}.headerCell{flex-basis:100%;display:flex;align-items:center;justify-items:start;border-right:1px solid var(--clrs-navy);border-bottom:1px solid var(--clrs-navy);padding:5px;cursor:pointer}.headerCell svg g{display:none}.headerCell.sort svg g{display:inline}.headerCell:hover svg g{display:inline}.headerCell:hover{background-color:var(--clrs-silver)}.headerCell:last-child{border-right:none}.cell{flex-basis:100%;display:flex;align-items:center;justify-items:start;padding:5px}.cell:first-child svg{cursor:pointer}.sort{background-color:var(--cx-column-sort)}.row{display:flex;justify-items:stretch;width:100%}.row.expanded{background-color:var(--cx-row-expanded)}.row.expanded svg{fill:var(--clrs-red)}.row:hover{background-color:var(--cx-row-hover)}";export{r as demo_table,l as proto_table}
|