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.
Files changed (41) hide show
  1. package/dist/cjs/demo-table_2.cjs.entry.js +3 -1
  2. package/dist/cjs/demo-table_2.cjs.entry.js.map +1 -0
  3. package/dist/cjs/{index-0be3c3a3.js → index-52ab0f4a.js} +60 -1
  4. package/dist/cjs/index-52ab0f4a.js.map +1 -0
  5. package/dist/cjs/index.cjs.js +2 -0
  6. package/dist/cjs/index.cjs.js.map +1 -0
  7. package/dist/cjs/loader.cjs.js +4 -2
  8. package/dist/cjs/loader.cjs.js.map +1 -0
  9. package/dist/cjs/proto-table-wc.cjs.js +7 -2
  10. package/dist/cjs/proto-table-wc.cjs.js.map +1 -0
  11. package/dist/collection/collection-manifest.json +1 -1
  12. package/dist/collection/components/demo-table/demo-table.js +1 -0
  13. package/dist/collection/components/demo-table/demo-table.js.map +1 -0
  14. package/dist/collection/components/proto-table/iconPaths.js +1 -0
  15. package/dist/collection/components/proto-table/iconPaths.js.map +1 -0
  16. package/dist/collection/components/proto-table/proto-table.js +1 -0
  17. package/dist/collection/components/proto-table/proto-table.js.map +1 -0
  18. package/dist/collection/index.js +1 -0
  19. package/dist/collection/index.js.map +1 -0
  20. package/dist/esm/demo-table_2.entry.js +3 -1
  21. package/dist/esm/demo-table_2.entry.js.map +1 -0
  22. package/dist/esm/{index-851629b1.js → index-f60c9fab.js} +60 -1
  23. package/dist/esm/index-f60c9fab.js.map +1 -0
  24. package/dist/esm/index.js +2 -0
  25. package/dist/esm/index.js.map +1 -0
  26. package/dist/esm/loader.js +5 -3
  27. package/dist/esm/loader.js.map +1 -0
  28. package/dist/esm/proto-table-wc.js +8 -3
  29. package/dist/esm/proto-table-wc.js.map +1 -0
  30. package/dist/proto-table-wc/index.esm.js +2 -0
  31. package/dist/proto-table-wc/index.esm.js.map +1 -0
  32. package/dist/proto-table-wc/p-6cf8a72f.js +3 -0
  33. package/dist/proto-table-wc/p-6cf8a72f.js.map +1 -0
  34. package/dist/proto-table-wc/p-ed869df7.entry.js +2 -0
  35. package/dist/proto-table-wc/p-ed869df7.entry.js.map +1 -0
  36. package/dist/proto-table-wc/proto-table-wc.esm.js +2 -1
  37. package/dist/proto-table-wc/proto-table-wc.esm.js.map +1 -0
  38. package/dist/types/stencil-public-runtime.d.ts +23 -12
  39. package/package.json +2 -8
  40. package/dist/proto-table-wc/p-62dd685d.entry.js +0 -1
  41. package/dist/proto-table-wc/p-83af3a87.js +0 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"demo-table.js","sourceRoot":"","sources":["../../../src/components/demo-table/demo-table.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAO7C,MAAM,OAAO,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,CAAC,EAAE;MACrB,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC;MAE3B,OAAO,CACL,WAAK,KAAK,EAAC,eAAe;QACxB;UAAO,IAAI,CAAC,MAAM;wBAAmB;QACrC,cACG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CACf,cAAK,GAAG,CAAM,CACf,CAAC,CACC,CACD,CACP,CAAC;IACJ,CAAC,CAAC;GAKH;EAlFC,iBAAiB;IACf,IAAI,CAAC,KAAK,GAAG;MACX;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CAAC,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,GAAI,CAAC;EACvD,CAAC;;;;;;;;;CACF","sourcesContent":["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"]}
@@ -9,3 +9,4 @@ const iconPaths = {
9
9
  };
10
10
  export { iconPaths };
11
11
  export default iconPaths;
12
+ //# sourceMappingURL=iconPaths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iconPaths.js","sourceRoot":"","sources":["../../../src/components/proto-table/iconPaths.ts"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG;EAChB,MAAM,EAAE,wCAAwC;EAChD,IAAI,EAAE,0CAA0C;EAChD,MAAM,EAAE,yCAAyC;EACjD,OAAO,EAAE,yCAAyC;EAClD,MAAM,EAAE,6FAA6F;EACrG,UAAU,EAAE,yDAAyD;EACrE,YAAY,EAAE,+DAA+D;CAC9E,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,eAAe,SAAS,CAAC","sourcesContent":["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"]}
@@ -143,3 +143,4 @@ export class ProtoTable {
143
143
  };
144
144
  }
145
145
  }
146
+ //# sourceMappingURL=proto-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proto-table.js","sourceRoot":"","sources":["../../../src/components/proto-table/proto-table.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,WAAW,GAAG;EAClB,OAAO,EAAE,MAAM;EACf,MAAM,EAAE,MAAM;E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{ 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"]}
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"","sourcesContent":["export { Components, JSX } from './components';\n"]}
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h } from './index-851629b1.js';
1
+ import { r as registerInstance, h } from './index-f60c9fab.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
 
@@ -162,3 +162,5 @@ const ProtoTable = class {
162
162
  ProtoTable.style = protoTableCss;
163
163
 
164
164
  export { DemoTable as demo_table, ProtoTable as proto_table };
165
+
166
+ //# sourceMappingURL=demo-table_2.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"demo-table.proto-table.entry.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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E,KAAK,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAC9C,EACN;GACH;;;;;;","names":[],"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}
@@ -116,6 +116,14 @@ const h = (nodeName, vnodeData, ...children) => {
116
116
  }
117
117
  return vnode;
118
118
  };
119
+ /**
120
+ * A utility function for creating a virtual DOM node from a tag and some
121
+ * possible text content.
122
+ *
123
+ * @param tag the tag for this element
124
+ * @param text possible text content for the node
125
+ * @returns a newly-minted virtual DOM node
126
+ */
119
127
  const newVNode = (tag, text) => {
120
128
  const vnode = {
121
129
  $flags$: 0,
@@ -130,6 +138,12 @@ const newVNode = (tag, text) => {
130
138
  return vnode;
131
139
  };
132
140
  const Host = {};
141
+ /**
142
+ * Check whether a given node is a Host node or not
143
+ *
144
+ * @param node the virtual DOM node to check
145
+ * @returns whether it's a Host node or not
146
+ */
133
147
  const isHost = (node) => node && node.$tag$ === Host;
134
148
  /**
135
149
  * Parse a new property value for a given property type.
@@ -210,6 +224,7 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
210
224
  }
211
225
  if (!appliedStyles.has(scopeId)) {
212
226
  {
227
+ // TODO(STENCIL-659): Remove code implementing the CSS variable shim
213
228
  {
214
229
  styleElm = doc.createElement('style');
215
230
  styleElm.innerHTML = style;
@@ -238,6 +253,7 @@ const attachStyles = (hostRef) => {
238
253
  const flags = cmpMeta.$flags$;
239
254
  const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
240
255
  const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
256
+ // TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
241
257
  if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
242
258
  // only required when we're NOT using native shadow dom (slot)
243
259
  // or this browser doesn't support native shadow dom
@@ -440,6 +456,21 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
440
456
  }
441
457
  return elm;
442
458
  };
459
+ /**
460
+ * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
461
+ * add them to the DOM in the appropriate place.
462
+ *
463
+ * @param parentElm the DOM node which should be used as a parent for the new
464
+ * DOM nodes
465
+ * @param before a child of the `parentElm` which the new children should be
466
+ * inserted before (optional)
467
+ * @param parentVNode the parent virtual DOM node
468
+ * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
469
+ * @param startIdx the index in the child virtual DOM nodes at which to start
470
+ * creating DOM nodes (inclusive)
471
+ * @param endIdx the index in the child virtual DOM nodes at which to stop
472
+ * creating DOM nodes (inclusive)
473
+ */
443
474
  const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
444
475
  let containerElm = (parentElm);
445
476
  let childNode;
@@ -456,6 +487,19 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
456
487
  }
457
488
  }
458
489
  };
490
+ /**
491
+ * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
492
+ * This can be used to, for instance, clean up after a list of children which
493
+ * should no longer be shown.
494
+ *
495
+ * This function also handles some of Stencil's slot relocation logic.
496
+ *
497
+ * @param vnodes a list of virtual DOM nodes to remove
498
+ * @param startIdx the index at which to start removing nodes (inclusive)
499
+ * @param endIdx the index at which to stop removing nodes (inclusive)
500
+ * @param vnode a VNode
501
+ * @param elm an element
502
+ */
459
503
  const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
460
504
  for (; startIdx <= endIdx; ++startIdx) {
461
505
  if ((vnode = vnodes[startIdx])) {
@@ -648,7 +692,8 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
648
692
  *
649
693
  * So, in other words, if `key` attrs are not set on VNodes which may be
650
694
  * changing order within a `children` array or something along those lines then
651
- * we could obtain a false positive and then have to do needless re-rendering.
695
+ * we could obtain a false negative and then have to do needless re-rendering
696
+ * (i.e. we'd say two VNodes aren't equal when in fact they should be).
652
697
  *
653
698
  * @param leftVNode the first VNode to check
654
699
  * @param rightVNode the second VNode to check
@@ -724,6 +769,18 @@ const callNodeRefs = (vNode) => {
724
769
  vNode.$children$ && vNode.$children$.map(callNodeRefs);
725
770
  }
726
771
  };
772
+ /**
773
+ * The main entry point for Stencil's virtual DOM-based rendering engine
774
+ *
775
+ * Given a {@link d.HostRef} container and some virtual DOM nodes, this
776
+ * function will handle creating a virtual DOM tree with a single root, patching
777
+ * the current virtual DOM tree onto an old one (if any), dealing with slot
778
+ * relocation, and reflecting attributes.
779
+ *
780
+ * @param hostRef data needed to root and render the virtual DOM tree, such as
781
+ * the DOM node into which it should be rendered.
782
+ * @param renderFnResults the virtual DOM nodes to be rendered
783
+ */
727
784
  const renderVdom = (hostRef, renderFnResults) => {
728
785
  const hostElm = hostRef.$hostElement$;
729
786
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
@@ -1346,3 +1403,5 @@ const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1346
1403
  const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1347
1404
 
1348
1405
  export { bootstrapLazy as b, h, promiseResolve as p, registerInstance as r, setNonce as s };
1406
+
1407
+ //# sourceMappingURL=index-f60c9fab.js.map