proto-table-wc 0.0.347 → 0.0.349

Sign up to get free protection for your applications and to get access to all the features.
@@ -103,12 +103,6 @@ const aliasFor = name => {
103
103
  const ProtoTable = class {
104
104
  constructor(hostRef) {
105
105
  index.registerInstance(this, hostRef);
106
- this.data = [];
107
- this.details = undefined;
108
- this.fields = [];
109
- this.expanded = undefined;
110
- this.sort = undefined;
111
- this.clicks = 0;
112
106
  this.protoIcon = (name, hex = undefined, size = 24) => {
113
107
  const path = iconPaths[name];
114
108
  return (index.h("svg", { width: size, height: size, viewBox: "0 0 24 24", role: "img", "aria-labelledby": "title" }, index.h("title", null, aliasFor(name)), index.h("g", { fill: hex }, index.h("path", { d: path })), index.h("path", { d: "M0 0h24v24H0z", fill: "none" })));
@@ -157,6 +151,12 @@ const ProtoTable = class {
157
151
  return (index.h("div", { class: cellClass, onClick: this.handleCellClick(index$1, row) }, index$1 === 0 && this.details ? protoIcon(this.expanded === row ? 'down' : 'right') : protoIcon('pad'), data[prop]));
158
152
  })), this.details && this.expanded === row && this.details(data)));
159
153
  };
154
+ this.data = [];
155
+ this.details = undefined;
156
+ this.fields = [];
157
+ this.expanded = undefined;
158
+ this.sort = undefined;
159
+ this.clicks = 0;
160
160
  }
161
161
  render() {
162
162
  const items = this.data || [];
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-7559d0c1.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Esm v2.18.1 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Esm v2.19.1 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  const patchEsm = () => {
11
11
  return index.promiseResolve();
@@ -3,7 +3,7 @@
3
3
  const index = require('./index-7559d0c1.js');
4
4
 
5
5
  /*
6
- Stencil Client Patch Browser v2.18.1 | MIT Licensed | https://stenciljs.com
6
+ Stencil Client Patch Browser v2.19.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));
@@ -5,7 +5,7 @@
5
5
  ],
6
6
  "compiler": {
7
7
  "name": "@stencil/core",
8
- "version": "2.18.1",
8
+ "version": "2.19.1",
9
9
  "typescriptVersion": "4.7.4"
10
10
  },
11
11
  "collections": [],
@@ -11,12 +11,6 @@ const aliasFor = name => {
11
11
  };
12
12
  export class ProtoTable {
13
13
  constructor() {
14
- this.data = [];
15
- this.details = undefined;
16
- this.fields = [];
17
- this.expanded = undefined;
18
- this.sort = undefined;
19
- this.clicks = 0;
20
14
  this.protoIcon = (name, hex = undefined, size = 24) => {
21
15
  const path = iconPaths[name];
22
16
  return (h("svg", { width: size, height: size, viewBox: "0 0 24 24", role: "img", "aria-labelledby": "title" }, h("title", null, aliasFor(name)), h("g", { fill: hex }, h("path", { d: path })), h("path", { d: "M0 0h24v24H0z", fill: "none" })));
@@ -65,6 +59,12 @@ export class ProtoTable {
65
59
  return (h("div", { class: cellClass, onClick: this.handleCellClick(index, row) }, index === 0 && this.details ? protoIcon(this.expanded === row ? 'down' : 'right') : protoIcon('pad'), data[prop]));
66
60
  })), this.details && this.expanded === row && this.details(data)));
67
61
  };
62
+ this.data = [];
63
+ this.details = undefined;
64
+ this.fields = [];
65
+ this.expanded = undefined;
66
+ this.sort = undefined;
67
+ this.clicks = 0;
68
68
  }
69
69
  render() {
70
70
  const items = this.data || [];
@@ -99,12 +99,6 @@ const aliasFor = name => {
99
99
  const ProtoTable = class {
100
100
  constructor(hostRef) {
101
101
  registerInstance(this, hostRef);
102
- this.data = [];
103
- this.details = undefined;
104
- this.fields = [];
105
- this.expanded = undefined;
106
- this.sort = undefined;
107
- this.clicks = 0;
108
102
  this.protoIcon = (name, hex = undefined, size = 24) => {
109
103
  const path = iconPaths[name];
110
104
  return (h("svg", { width: size, height: size, viewBox: "0 0 24 24", role: "img", "aria-labelledby": "title" }, h("title", null, aliasFor(name)), h("g", { fill: hex }, h("path", { d: path })), h("path", { d: "M0 0h24v24H0z", fill: "none" })));
@@ -153,6 +147,12 @@ const ProtoTable = class {
153
147
  return (h("div", { class: cellClass, onClick: this.handleCellClick(index, row) }, index === 0 && this.details ? protoIcon(this.expanded === row ? 'down' : 'right') : protoIcon('pad'), data[prop]));
154
148
  })), this.details && this.expanded === row && this.details(data)));
155
149
  };
150
+ this.data = [];
151
+ this.details = undefined;
152
+ this.fields = [];
153
+ this.expanded = undefined;
154
+ this.sort = undefined;
155
+ this.clicks = 0;
156
156
  }
157
157
  render() {
158
158
  const items = this.data || [];
@@ -1,7 +1,7 @@
1
1
  import { p as promiseResolve, b as bootstrapLazy } from './index-c0e084ef.js';
2
2
 
3
3
  /*
4
- Stencil Client Patch Esm v2.18.1 | MIT Licensed | https://stenciljs.com
4
+ Stencil Client Patch Esm v2.19.1 | MIT Licensed | https://stenciljs.com
5
5
  */
6
6
  const patchEsm = () => {
7
7
  return promiseResolve();
@@ -1,7 +1,7 @@
1
1
  import { p as promiseResolve, b as bootstrapLazy } from './index-c0e084ef.js';
2
2
 
3
3
  /*
4
- Stencil Client Patch Browser v2.18.1 | MIT Licensed | https://stenciljs.com
4
+ Stencil Client Patch Browser v2.19.1 | MIT Licensed | https://stenciljs.com
5
5
  */
6
6
  const patchBrowser = () => {
7
7
  const importMeta = import.meta.url;
@@ -1 +1 @@
1
- import{r as t,h as e}from"./p-44c495c4.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
+ import{r as t,h as e}from"./p-44c495c4.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.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))},this.data=[],this.details=void 0,this.fields=[],this.expanded=void 0,this.sort=void 0,this.clicks=0}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 t,b as a}from"./p-44c495c4.js";(()=>{const a=import.meta.url,e={};return""!==a&&(e.resourcesUrl=new URL(".",a).href),t(e)})().then((t=>a([["p-767a4c79",[[1,"demo-table"],[0,"proto-table",{data:[16],details:[8],fields:[16],expanded:[32],sort:[32],clicks:[32]}]]]],t)));
1
+ import{p as e,b as t}from"./p-44c495c4.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t([["p-ae7deec4",[[1,"demo-table"],[0,"proto-table",{data:[16],details:[8],fields:[16],expanded:[32],sort:[32],clicks:[32]}]]]],e)));
@@ -223,6 +223,7 @@ export declare const setMode: (handler: ResolutionHandler) => void;
223
223
  /**
224
224
  * `getMode()` is used for libraries which provide multiple "modes" for styles.
225
225
  * @param ref a reference to the node to get styles for
226
+ * @returns the current mode or undefined, if not found
226
227
  */
227
228
  export declare function getMode<T = string | undefined>(ref: any): T;
228
229
  export declare function setPlatformHelpers(helpers: {
@@ -237,6 +238,7 @@ export declare function setPlatformHelpers(helpers: {
237
238
  * if the path needs to be customized.
238
239
  * @param path the path to use in calculating the asset path. this value will be
239
240
  * used in conjunction with the base asset path
241
+ * @returns the base path
240
242
  */
241
243
  export declare function getAssetPath(path: string): string;
242
244
  /**
@@ -252,11 +254,13 @@ export declare function getAssetPath(path: string): string;
252
254
  * bundling, and where your assets can be loaded from. Additionally custom bundling
253
255
  * will have to ensure the static assets are copied to its build directory.
254
256
  * @param path the asset path to set
257
+ * @returns the set path
255
258
  */
256
259
  export declare function setAssetPath(path: string): string;
257
260
  /**
258
261
  * Retrieve a Stencil element for a given reference
259
262
  * @param ref the ref to get the Stencil element for
263
+ * @returns a reference to the element
260
264
  */
261
265
  export declare function getElement(ref: any): HTMLStencilElement;
262
266
  /**
@@ -269,6 +273,7 @@ export declare function getElement(ref: any): HTMLStencilElement;
269
273
  export declare function forceUpdate(ref: any): void;
270
274
  /**
271
275
  * getRenderingRef
276
+ * @returns the rendering ref
272
277
  */
273
278
  export declare function getRenderingRef(): any;
274
279
  export interface HTMLStencilElement extends HTMLElement {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "proto-table-wc",
3
- "version": "0.0.347",
3
+ "version": "0.0.349",
4
4
  "description": "Stencil Component Starter",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -27,16 +27,16 @@
27
27
  "format": "prettier --write src"
28
28
  },
29
29
  "dependencies": {
30
- "@stencil/core": "2.18.1"
30
+ "@stencil/core": "2.19.1"
31
31
  },
32
32
  "devDependencies": {
33
- "@types/jest": "29.1.2",
33
+ "@types/jest": "29.2.0",
34
34
  "@types/puppeteer": "5.4.7",
35
35
  "cspell": "6.12.0",
36
- "eslint": "8.25.0",
37
- "jest": "29.2.0",
36
+ "eslint": "8.26.0",
37
+ "jest": "29.2.2",
38
38
  "prettier": "2.7.1",
39
- "puppeteer": "19.0.0",
39
+ "puppeteer": "19.2.0",
40
40
  "tslint": "6.1.3",
41
41
  "typescript": "4.8.4"
42
42
  },