proto-table-wc 0.0.389 → 0.0.391
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/demo-table_2.cjs.entry.js +3 -1
- package/dist/cjs/demo-table_2.cjs.entry.js.map +1 -0
- package/dist/cjs/{index-0be3c3a3.js → index-52ab0f4a.js} +60 -1
- package/dist/cjs/index-52ab0f4a.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +4 -2
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/proto-table-wc.cjs.js +7 -2
- package/dist/cjs/proto-table-wc.cjs.js.map +1 -0
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/demo-table/demo-table.js +1 -0
- package/dist/collection/components/demo-table/demo-table.js.map +1 -0
- package/dist/collection/components/proto-table/iconPaths.js +1 -0
- package/dist/collection/components/proto-table/iconPaths.js.map +1 -0
- package/dist/collection/components/proto-table/proto-table.js +1 -0
- package/dist/collection/components/proto-table/proto-table.js.map +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/esm/demo-table_2.entry.js +3 -1
- package/dist/esm/demo-table_2.entry.js.map +1 -0
- package/dist/esm/{index-851629b1.js → index-f60c9fab.js} +60 -1
- package/dist/esm/index-f60c9fab.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +5 -3
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/proto-table-wc.js +8 -3
- package/dist/esm/proto-table-wc.js.map +1 -0
- package/dist/proto-table-wc/index.esm.js +2 -0
- package/dist/proto-table-wc/index.esm.js.map +1 -0
- package/dist/proto-table-wc/p-6cf8a72f.js +3 -0
- package/dist/proto-table-wc/p-6cf8a72f.js.map +1 -0
- package/dist/proto-table-wc/p-ed869df7.entry.js +2 -0
- package/dist/proto-table-wc/p-ed869df7.entry.js.map +1 -0
- package/dist/proto-table-wc/proto-table-wc.esm.js +2 -1
- package/dist/proto-table-wc/proto-table-wc.esm.js.map +1 -0
- package/dist/types/stencil-public-runtime.d.ts +23 -12
- package/package.json +2 -8
- package/dist/proto-table-wc/p-62dd685d.entry.js +0 -1
- package/dist/proto-table-wc/p-83af3a87.js +0 -2
@@ -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-52ab0f4a.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
|
|
@@ -167,3 +167,5 @@ ProtoTable.style = protoTableCss;
|
|
167
167
|
|
168
168
|
exports.demo_table = DemoTable;
|
169
169
|
exports.proto_table = ProtoTable;
|
170
|
+
|
171
|
+
//# sourceMappingURL=demo-table_2.cjs.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"demo-table.proto-table.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,YAAY,GAAG,qIAAqI;;MCO7I,SAAS;EALtB;;IA4DE,WAAM,GAAG;MACP,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE;MAC/B,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE;MACtC,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE;MACxC,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,OAAO,EAAE;KAC7C,CAAC;IAEF,UAAK,GAAG,EAAE,CAAC;IACX,UAAK,GAAG,SAAS,CAAC;IAElB,kBAAa,GAAG,IAAI;MAClB,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC;MAE3B,QACEA,iBAAK,KAAK,EAAC,eAAe,IACxBA,s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;;;;;;;","names":["h","index"],"sources":["./src/components/demo-table/demo-table.css?tag=demo-table&encapsulation=shadow","./src/components/demo-table/demo-table.tsx","./src/components/proto-table/iconPaths.ts","./src/components/proto-table/proto-table.css?tag=proto-table","./src/components/proto-table/proto-table.tsx"],"sourcesContent":[".detailWrapper {\n font-weight: 100;\n font-size: 13px;\n display: flex;\n flex-direction: column;\n justify-items: start;\n padding: 5px;\n padding-left: 30px;\n}\n","import { Component, h } from '@stencil/core';\n\n@Component({\n tag: 'demo-table',\n styleUrl: 'demo-table.css',\n shadow: true,\n})\nexport class DemoTable {\n componentWillLoad() {\n this.items = [\n {\n date: '08/30/2020',\n price: '$24,000',\n market: '98%',\n score: 'No Score',\n tags: ['one', 'two', 'three'],\n },\n {\n date: '08/31/2020',\n price: '$24,000',\n market: '99%',\n score: 'No Score',\n tags: ['uno', 'duo'],\n },\n {\n date: '09/01/2020',\n price: '$27,000',\n market: '102%',\n score: 'Platinum',\n },\n {\n date: '09/02/2020',\n price: '$27,423',\n market: '104%',\n score: 'Platinum',\n tags: ['dog', 'cat', 'fish', 'hamster'],\n },\n {\n date: '09/03/2020',\n price: '$27,521',\n market: '106%',\n score: 'Platinum',\n tags: ['4wd', 'sports'],\n },\n {\n date: '09/04/2020',\n price: '$27,687',\n market: '107%',\n score: 'Platinum',\n tags: ['leather', 'chrome'],\n },\n ];\n }\n\n componentDidLoad() {\n const { table, items, fields } = this;\n\n table.data = items;\n table.fields = fields;\n table.details = this.renderDetails;\n }\n\n fields = [\n { label: 'Date', prop: 'date' },\n { label: 'List Price', prop: 'price' },\n { label: '% of Market', prop: 'market' },\n { label: 'ProfitTime Score', prop: 'score' },\n ];\n\n items = [];\n table = undefined;\n\n renderDetails = item => {\n const { tags = [] } = item;\n\n return (\n <div class=\"detailWrapper\">\n <span>{tags.length} details...</span>\n <ul>\n {tags.map(tag => (\n <li>{tag}</li>\n ))}\n </ul>\n </div>\n );\n };\n\n render() {\n return <proto-table ref={el => (this.table = el)} />;\n }\n}\n","const iconPaths = {\n 'down': 'M12 15.4L6.6 10 8 8.6l4 4 4-4 1.4 1.4z',\n 'up': 'M16 15.4l-4-4-4 4L6.6 14 12 8.6l5.4 5.4z',\n 'left': 'M14 17.4L8.6 12 14 6.6 15.4 8l-4 4 4 4z',\n 'right': 'M10 17.4L8.6 16l4-4-4-4L10 6.6l5.4 5.4z',\n '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',\n 'arrow-up': 'M5.3 10.7l1.4 1.4L11 7.8V20h2V7.8l4.3 4.3 1.4-1.4L12 4z',\n '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',\n};\n\nexport { iconPaths };\nexport default iconPaths;\n",".table {\n font-weight: 400;\n font-size: 13px;\n display: flex;\n flex-direction: column;\n width: 100%;\n border: 1px solid var(--clrs-navy);\n border-radius: 2px;\n}\n\n.table svg {\n fill: var(--clrs-navy);\n}\n\n.header {\n display: flex;\n}\n\n.headerCell {\n flex-basis: 100%;\n display: flex;\n align-items: center;\n justify-items: start;\n border-right: 1px solid var(--clrs-navy);\n border-bottom: 1px solid var(--clrs-navy);\n padding: 5px;\n cursor: pointer;\n}\n\n.headerCell svg g {\n display: none;\n}\n\n.headerCell.sort svg g {\n display: inline;\n}\n\n.headerCell:hover svg g {\n display: inline;\n}\n\n.headerCell:hover {\n background-color: var(--clrs-silver);\n}\n\n.headerCell:last-child {\n border-right: none;\n}\n\n.cell {\n flex-basis: 100%;\n display: flex;\n align-items: center;\n justify-items: start;\n padding: 5px;\n}\n\n.cell:first-child svg {\n cursor: pointer;\n}\n\n.sort {\n background-color: var(--cx-column-sort);\n}\n\n.row {\n display: flex;\n justify-items: stretch;\n width: 100%;\n}\n\n.row.expanded {\n background-color: var(--cx-row-expanded);\n}\n\n.row.expanded svg {\n fill: var(--clrs-red);\n}\n\n.row:hover {\n background-color: var(--cx-row-hover);\n}\n","import { Component, h, Prop, State } from '@stencil/core';\nimport { iconPaths } from './iconPaths';\n\nconst iconAliases = {\n 'right': 'show',\n 'down': 'hide',\n 'arrow-up': 'sort',\n 'arrow-down': 'sort',\n};\n\nconst aliasFor = name => {\n return iconAliases[name];\n};\n\n@Component({\n tag: 'proto-table',\n styleUrl: 'proto-table.css',\n})\nexport class ProtoTable {\n @Prop() data = [];\n @Prop() details = undefined;\n @Prop() fields = [];\n @State() expanded = undefined;\n @State() sort = undefined;\n @State() clicks = 0;\n\n protoIcon = (name, hex = undefined, size = 24) => {\n const path = iconPaths[name];\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" role=\"img\" aria-labelledby=\"title\">\n <title>{aliasFor(name)}</title>\n <g fill={hex}>\n <path d={path} />\n </g>\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n </svg>\n );\n };\n\n handleCellClick = (index, row) => {\n return () => {\n if (index === 0) {\n this.expanded = this.expanded === row ? undefined : row;\n }\n };\n };\n\n handleSortClick = index => {\n // NOTE: small state machine for dealing with sorting...\n return () => {\n if (this.sort === index) {\n if (this.clicks === 2) {\n this.clicks = 0;\n this.sort = undefined;\n } else {\n this.clicks = this.clicks + 1;\n }\n } else {\n this.sort = index;\n this.clicks = 1;\n }\n };\n };\n\n iconFor = column => {\n return this.sort === column && this.clicks === 2 ? 'arrow-up' : 'arrow-down';\n };\n\n header = () => {\n const { fields, iconFor, protoIcon } = this;\n return (\n <div class=\"header\">\n {fields.map(({ label }, index) => {\n const cellClass = index === this.sort ? 'headerCell sort' : 'headerCell';\n const ikon = iconFor(index);\n return (\n <div class={cellClass} onClick={this.handleSortClick(index)}>\n {protoIcon(ikon)}\n <span>{label}</span>\n </div>\n );\n })}\n </div>\n );\n };\n\n row = (data, row) => {\n const { fields, protoIcon } = this;\n const rowClass = this.expanded === row ? 'row expanded' : 'row';\n return (\n <div class=\"rowContainer\">\n <div class={rowClass}>\n {fields.map(({ prop }, index) => {\n const cellClass = index === this.sort ? 'cell sort' : 'cell';\n return (\n <div class={cellClass} onClick={this.handleCellClick(index, row)}>\n {index === 0 && this.details ? protoIcon(this.expanded === row ? 'down' : 'right') : protoIcon('pad')}\n {data[prop]}\n </div>\n );\n })}\n </div>\n\n {this.details && this.expanded === row && this.details(data)}\n </div>\n );\n };\n\n render() {\n const items = this.data || [];\n return (\n <div class=\"table\">\n {this.header()}\n {items.map((item, index) => this.row(item, index))}\n </div>\n );\n }\n}\n"],"version":3}
|
@@ -138,6 +138,14 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
138
138
|
}
|
139
139
|
return vnode;
|
140
140
|
};
|
141
|
+
/**
|
142
|
+
* A utility function for creating a virtual DOM node from a tag and some
|
143
|
+
* possible text content.
|
144
|
+
*
|
145
|
+
* @param tag the tag for this element
|
146
|
+
* @param text possible text content for the node
|
147
|
+
* @returns a newly-minted virtual DOM node
|
148
|
+
*/
|
141
149
|
const newVNode = (tag, text) => {
|
142
150
|
const vnode = {
|
143
151
|
$flags$: 0,
|
@@ -152,6 +160,12 @@ const newVNode = (tag, text) => {
|
|
152
160
|
return vnode;
|
153
161
|
};
|
154
162
|
const Host = {};
|
163
|
+
/**
|
164
|
+
* Check whether a given node is a Host node or not
|
165
|
+
*
|
166
|
+
* @param node the virtual DOM node to check
|
167
|
+
* @returns whether it's a Host node or not
|
168
|
+
*/
|
155
169
|
const isHost = (node) => node && node.$tag$ === Host;
|
156
170
|
/**
|
157
171
|
* Parse a new property value for a given property type.
|
@@ -232,6 +246,7 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
232
246
|
}
|
233
247
|
if (!appliedStyles.has(scopeId)) {
|
234
248
|
{
|
249
|
+
// TODO(STENCIL-659): Remove code implementing the CSS variable shim
|
235
250
|
{
|
236
251
|
styleElm = doc.createElement('style');
|
237
252
|
styleElm.innerHTML = style;
|
@@ -260,6 +275,7 @@ const attachStyles = (hostRef) => {
|
|
260
275
|
const flags = cmpMeta.$flags$;
|
261
276
|
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
262
277
|
const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
278
|
+
// TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
|
263
279
|
if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
|
264
280
|
// only required when we're NOT using native shadow dom (slot)
|
265
281
|
// or this browser doesn't support native shadow dom
|
@@ -462,6 +478,21 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
462
478
|
}
|
463
479
|
return elm;
|
464
480
|
};
|
481
|
+
/**
|
482
|
+
* Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
|
483
|
+
* add them to the DOM in the appropriate place.
|
484
|
+
*
|
485
|
+
* @param parentElm the DOM node which should be used as a parent for the new
|
486
|
+
* DOM nodes
|
487
|
+
* @param before a child of the `parentElm` which the new children should be
|
488
|
+
* inserted before (optional)
|
489
|
+
* @param parentVNode the parent virtual DOM node
|
490
|
+
* @param vnodes the new child virtual DOM nodes to produce DOM nodes for
|
491
|
+
* @param startIdx the index in the child virtual DOM nodes at which to start
|
492
|
+
* creating DOM nodes (inclusive)
|
493
|
+
* @param endIdx the index in the child virtual DOM nodes at which to stop
|
494
|
+
* creating DOM nodes (inclusive)
|
495
|
+
*/
|
465
496
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
466
497
|
let containerElm = (parentElm);
|
467
498
|
let childNode;
|
@@ -478,6 +509,19 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
|
|
478
509
|
}
|
479
510
|
}
|
480
511
|
};
|
512
|
+
/**
|
513
|
+
* Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
|
514
|
+
* This can be used to, for instance, clean up after a list of children which
|
515
|
+
* should no longer be shown.
|
516
|
+
*
|
517
|
+
* This function also handles some of Stencil's slot relocation logic.
|
518
|
+
*
|
519
|
+
* @param vnodes a list of virtual DOM nodes to remove
|
520
|
+
* @param startIdx the index at which to start removing nodes (inclusive)
|
521
|
+
* @param endIdx the index at which to stop removing nodes (inclusive)
|
522
|
+
* @param vnode a VNode
|
523
|
+
* @param elm an element
|
524
|
+
*/
|
481
525
|
const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
482
526
|
for (; startIdx <= endIdx; ++startIdx) {
|
483
527
|
if ((vnode = vnodes[startIdx])) {
|
@@ -670,7 +714,8 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
670
714
|
*
|
671
715
|
* So, in other words, if `key` attrs are not set on VNodes which may be
|
672
716
|
* changing order within a `children` array or something along those lines then
|
673
|
-
* we could obtain a false
|
717
|
+
* we could obtain a false negative and then have to do needless re-rendering
|
718
|
+
* (i.e. we'd say two VNodes aren't equal when in fact they should be).
|
674
719
|
*
|
675
720
|
* @param leftVNode the first VNode to check
|
676
721
|
* @param rightVNode the second VNode to check
|
@@ -746,6 +791,18 @@ const callNodeRefs = (vNode) => {
|
|
746
791
|
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
747
792
|
}
|
748
793
|
};
|
794
|
+
/**
|
795
|
+
* The main entry point for Stencil's virtual DOM-based rendering engine
|
796
|
+
*
|
797
|
+
* Given a {@link d.HostRef} container and some virtual DOM nodes, this
|
798
|
+
* function will handle creating a virtual DOM tree with a single root, patching
|
799
|
+
* the current virtual DOM tree onto an old one (if any), dealing with slot
|
800
|
+
* relocation, and reflecting attributes.
|
801
|
+
*
|
802
|
+
* @param hostRef data needed to root and render the virtual DOM tree, such as
|
803
|
+
* the DOM node into which it should be rendered.
|
804
|
+
* @param renderFnResults the virtual DOM nodes to be rendered
|
805
|
+
*/
|
749
806
|
const renderVdom = (hostRef, renderFnResults) => {
|
750
807
|
const hostElm = hostRef.$hostElement$;
|
751
808
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
@@ -1372,3 +1429,5 @@ exports.h = h;
|
|
1372
1429
|
exports.promiseResolve = promiseResolve;
|
1373
1430
|
exports.registerInstance = registerInstance;
|
1374
1431
|
exports.setNonce = setNonce;
|
1432
|
+
|
1433
|
+
//# sourceMappingURL=index-52ab0f4a.js.map
|