@xplortech/apollo-core 0.1.0 → 0.1.1

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 (82) hide show
  1. package/dist/apollo-core/apollo-core.css +2109 -5
  2. package/dist/apollo-core/apollo-core.esm.js +125 -1
  3. package/dist/apollo-core/app-globals-0f993ce5.js +3 -0
  4. package/dist/apollo-core/css-shim-bbdf0cc6.js +4 -0
  5. package/dist/apollo-core/dom-1f98a75f.js +73 -0
  6. package/dist/apollo-core/index-912d1a21.js +584 -0
  7. package/dist/apollo-core/index-f313719f.js +2938 -0
  8. package/dist/apollo-core/index.esm.js +1 -0
  9. package/dist/apollo-core/{p-1e6a342a.entry.js → p-6c4f9227.entry.js} +3 -3
  10. package/dist/apollo-core/shadow-css-67b66845.js +389 -0
  11. package/dist/apollo-core/xpl-avatar.entry.js +19 -0
  12. package/dist/apollo-core/xpl-badge.entry.js +17 -0
  13. package/dist/apollo-core/xpl-breadcrumb-item.entry.js +19 -0
  14. package/dist/apollo-core/xpl-breadcrumbs.entry.js +14 -0
  15. package/dist/apollo-core/xpl-button.entry.js +16086 -0
  16. package/dist/apollo-core/xpl-checkbox.entry.js +14 -0
  17. package/dist/apollo-core/xpl-choicelist.entry.js +12 -0
  18. package/dist/apollo-core/xpl-pagination.entry.js +72 -0
  19. package/dist/apollo-core/xpl-radio.entry.js +14 -0
  20. package/dist/apollo-core/xpl-table.entry.js +85 -0
  21. package/dist/apollo-core/xpl-utility-bar.entry.js +12 -0
  22. package/dist/cjs/apollo-core.cjs.js +112 -4
  23. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  24. package/dist/cjs/css-shim-a7379e2b.js +6 -0
  25. package/dist/cjs/dom-3e7d9c3b.js +75 -0
  26. package/dist/cjs/index-318d5fc7.js +586 -0
  27. package/dist/cjs/index-fca88002.js +2973 -0
  28. package/dist/cjs/index.cjs.js +1 -0
  29. package/dist/cjs/loader.cjs.js +18 -2
  30. package/dist/cjs/shadow-css-09555044.js +391 -0
  31. package/dist/cjs/xpl-avatar.cjs.entry.js +23 -0
  32. package/dist/cjs/{xpl-avatar_7.cjs.entry.js → xpl-avatar_9.cjs.entry.js} +27 -0
  33. package/dist/cjs/xpl-badge.cjs.entry.js +21 -0
  34. package/dist/cjs/xpl-breadcrumb-item.cjs.entry.js +23 -0
  35. package/dist/cjs/xpl-breadcrumbs.cjs.entry.js +18 -0
  36. package/dist/cjs/xpl-button.cjs.entry.js +16090 -0
  37. package/dist/cjs/xpl-checkbox.cjs.entry.js +18 -0
  38. package/dist/cjs/xpl-choicelist.cjs.entry.js +1 -1
  39. package/dist/cjs/xpl-pagination.cjs.entry.js +1 -1
  40. package/dist/cjs/xpl-radio.cjs.entry.js +18 -0
  41. package/dist/cjs/xpl-table.cjs.entry.js +89 -0
  42. package/dist/cjs/xpl-utility-bar.cjs.entry.js +16 -0
  43. package/dist/collection/collection-manifest.json +2 -0
  44. package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js +19 -0
  45. package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js +12 -0
  46. package/dist/custom-elements/index.js +560 -2
  47. package/dist/esm/apollo-core.js +112 -4
  48. package/dist/esm/app-globals-0f993ce5.js +3 -0
  49. package/dist/esm/css-shim-bbdf0cc6.js +4 -0
  50. package/dist/esm/dom-1f98a75f.js +73 -0
  51. package/dist/esm/index-912d1a21.js +584 -0
  52. package/dist/esm/index-f313719f.js +2938 -0
  53. package/dist/esm/index.js +1 -1
  54. package/dist/esm/loader.js +18 -2
  55. package/dist/esm/shadow-css-67b66845.js +389 -0
  56. package/dist/esm/xpl-avatar.entry.js +19 -0
  57. package/dist/esm/{xpl-avatar_7.entry.js → xpl-avatar_9.entry.js} +26 -1
  58. package/dist/esm/xpl-badge.entry.js +17 -0
  59. package/dist/esm/xpl-breadcrumb-item.entry.js +19 -0
  60. package/dist/esm/xpl-breadcrumbs.entry.js +14 -0
  61. package/dist/esm/xpl-button.entry.js +16086 -0
  62. package/dist/esm/xpl-checkbox.entry.js +14 -0
  63. package/dist/esm/xpl-choicelist.entry.js +1 -1
  64. package/dist/esm/xpl-pagination.entry.js +1 -1
  65. package/dist/esm/xpl-radio.entry.js +14 -0
  66. package/dist/esm/xpl-table.entry.js +85 -0
  67. package/dist/esm/xpl-utility-bar.entry.js +12 -0
  68. package/dist/stories/breadcrumbs.stories.js +115 -0
  69. package/dist/stories/table.stories.js +1 -1
  70. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/breadcrumbs.stories.d.ts +53 -0
  71. package/dist/types/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.d.ts +4 -0
  72. package/dist/types/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.d.ts +3 -0
  73. package/package.json +1 -1
  74. /package/dist/types/{home/runner/work/apollo → Users/fernandogelin/Projects}/apollo/.stencil/stories/avatar.stories.d.ts +0 -0
  75. /package/dist/types/{home/runner/work/apollo → Users/fernandogelin/Projects}/apollo/.stencil/stories/badge.stories.d.ts +0 -0
  76. /package/dist/types/{home/runner/work/apollo → Users/fernandogelin/Projects}/apollo/.stencil/stories/button.stories.d.ts +0 -0
  77. /package/dist/types/{home/runner/work/apollo → Users/fernandogelin/Projects}/apollo/.stencil/stories/checkbox.stories.d.ts +0 -0
  78. /package/dist/types/{home/runner/work/apollo → Users/fernandogelin/Projects}/apollo/.stencil/stories/pagination.stories.d.ts +0 -0
  79. /package/dist/types/{home/runner/work/apollo → Users/fernandogelin/Projects}/apollo/.stencil/stories/radio.stories.d.ts +0 -0
  80. /package/dist/types/{home/runner/work/apollo → Users/fernandogelin/Projects}/apollo/.stencil/stories/table.stories.d.ts +0 -0
  81. /package/dist/types/{home/runner/work/apollo → Users/fernandogelin/Projects}/apollo/.stencil/stories/tabs.stories.d.ts +0 -0
  82. /package/dist/types/{home/runner/work/apollo → Users/fernandogelin/Projects}/apollo/.stencil/stories/utility-bar.stories.d.ts +0 -0
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-fca88002.js');
6
+ const index$1 = require('./index-318d5fc7.js');
7
+
8
+ const XplCheckbox = class {
9
+ constructor(hostRef) {
10
+ index.registerInstance(this, hostRef);
11
+ this.id = index$1.v4();
12
+ }
13
+ render() {
14
+ return (index.h(index.Host, { class: "xpl-checkbox-container" }, index.h("input", { class: "xpl-checkbox", type: "checkbox", checked: this.checked, disabled: this.disabled, id: this.id, indeterminate: this.indeterminate, name: this.name, required: this.required, value: this.value }), index.h("label", { htmlFor: this.id }, index.h("slot", null), this.description && index.h("small", null, this.description))));
15
+ }
16
+ };
17
+
18
+ exports.xpl_checkbox = XplCheckbox;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-716d8f57.js');
5
+ const index = require('./index-fca88002.js');
6
6
 
7
7
  const XplChoicelist = class {
8
8
  constructor(hostRef) {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-716d8f57.js');
5
+ const index = require('./index-fca88002.js');
6
6
 
7
7
  const XplPagination = class {
8
8
  constructor(hostRef) {
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-fca88002.js');
6
+ const index$1 = require('./index-318d5fc7.js');
7
+
8
+ const XplRadio = class {
9
+ constructor(hostRef) {
10
+ index.registerInstance(this, hostRef);
11
+ this.id = index$1.v4();
12
+ }
13
+ render() {
14
+ return (index.h(index.Host, { class: "xpl-radio-container" }, index.h("input", { class: "xpl-radio", type: "radio", checked: this.checked, disabled: this.disabled, id: this.id, name: this.name, required: this.required, value: this.value }), index.h("label", { htmlFor: this.id }, index.h("slot", null), this.description && index.h("small", null, this.description))));
15
+ }
16
+ };
17
+
18
+ exports.xpl_radio = XplRadio;
@@ -0,0 +1,89 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-fca88002.js');
6
+
7
+ const XplTable = class {
8
+ constructor(hostRef) {
9
+ index.registerInstance(this, hostRef);
10
+ this.tableSelect = index.createEvent(this, "tableSelect", 7);
11
+ this.areAllSelected = false;
12
+ this.hasScrolled = false;
13
+ this.selectAll = (e) => {
14
+ const { target } = e;
15
+ if (!(target instanceof HTMLInputElement))
16
+ return;
17
+ const { checked } = target;
18
+ this.areAllSelected = checked;
19
+ this.selected = this.selected.map(() => checked);
20
+ this.onChange();
21
+ };
22
+ this.selectOne = (e, i) => {
23
+ const { target } = e;
24
+ if (!(target instanceof HTMLInputElement))
25
+ return;
26
+ const { checked } = target;
27
+ this.areAllSelected = false;
28
+ this.selected = this.selected.map((v, _i) => (_i === i ? checked : v));
29
+ this.onChange();
30
+ };
31
+ this.onChange = () => {
32
+ this.tableSelect.emit({
33
+ selected: this.selected,
34
+ areAllSelected: this.areAllSelected,
35
+ });
36
+ };
37
+ this.onScroll = () => {
38
+ this.hasScrolled = this.container.scrollLeft > 0;
39
+ };
40
+ /**
41
+ * TODO: Need to figure out how this interplays with data
42
+ * received from an API/server
43
+ */
44
+ this.sortBy = (col, ascending = true) => {
45
+ this.rowData.sort((a, b) => {
46
+ const A = a[col];
47
+ const B = b[col];
48
+ if (typeof A === "number" && typeof B === "number") {
49
+ const f = ascending ? 1 : -1;
50
+ return A > B ? f : -f;
51
+ }
52
+ return -1;
53
+ });
54
+ this.rowData = Array.from(this.rowData);
55
+ this.render();
56
+ };
57
+ }
58
+ componentWillLoad() {
59
+ this.areAllSelected = false;
60
+ this.rowData = this.data ? Array.from(this.data) : [];
61
+ this.selected = new Array(this.rowData.length).fill(false);
62
+ }
63
+ render() {
64
+ let className = "xpl-table";
65
+ if (this.striped)
66
+ className += " xpl-table--striped";
67
+ if (this.freeze)
68
+ className += " xpl-table--freeze";
69
+ if (this.hasScrolled)
70
+ className += " xpl-table--has-scrolled";
71
+ return (index.h(index.Host, null, index.h("div", { class: "xpl-table-container", onScroll: this.onScroll, ref: (el) => (this.container = el) }, index.h("table", { class: className }, this.columns && (index.h("thead", null, this.columns.map((column, i) => {
72
+ return (index.h("th", null, this.multiselect && i === 0 ? (index.h("label", { htmlFor: "__xpl-table-th" }, index.h("input", { checked: this.areAllSelected, id: "__xpl-table-th",
73
+ // appear indeterminate when at least one but not all
74
+ // are selected
75
+ indeterminate: !this.areAllSelected &&
76
+ this.selected.some((a) => a), onChange: (e) => {
77
+ this.selectAll(e);
78
+ }, type: "checkbox" }), column)) : (column)));
79
+ }))), index.h("tbody", null, this.rowData.map((row, rowNum) => {
80
+ return (index.h("tr", { class: this.selected && this.selected[rowNum]
81
+ ? "xpl-table-row-selected"
82
+ : "" }, row.map((cell, i) => {
83
+ return (index.h("td", null, this.multiselect && i === 0 ? (index.h("label", { htmlFor: "__xpl-table-row-" + rowNum }, index.h("input", { id: "__xpl-table-row-" + rowNum, checked: this.selected[rowNum], type: "checkbox", onChange: (e) => this.selectOne(e, rowNum) }), index.h("div", { innerHTML: cell }))) : (index.h("div", { innerHTML: cell }))));
84
+ })));
85
+ }))))));
86
+ }
87
+ };
88
+
89
+ exports.xpl_table = XplTable;
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-fca88002.js');
6
+
7
+ const XplUtilityBar = class {
8
+ constructor(hostRef) {
9
+ index.registerInstance(this, hostRef);
10
+ }
11
+ render() {
12
+ return (index.h(index.Host, null, index.h("nav", { "aria-label": "utility navigation bar", class: "xpl-utility-bar" }, index.h("slot", { name: "main" }), index.h("slot", { name: "aside" }))));
13
+ }
14
+ };
15
+
16
+ exports.xpl_utility_bar = XplUtilityBar;
@@ -2,6 +2,8 @@
2
2
  "entries": [
3
3
  "./components/xpl-avatar/xpl-avatar.js",
4
4
  "./components/xpl-badge/xpl-badge.js",
5
+ "./components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js",
6
+ "./components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js",
5
7
  "./components/xpl-button/xpl-button.js",
6
8
  "./components/xpl-checkbox/xpl-checkbox.js",
7
9
  "./components/xpl-choicelist/xpl-choicelist.js",
@@ -0,0 +1,19 @@
1
+ import { Component, Host, h } from '@stencil/core';
2
+ export class XplBreadcrumbItem {
3
+ constructor() {
4
+ // This is temporary as we still don't have a xpl-icon component. When that's created we should update this code.
5
+ this.chevron = `<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="chevron-right" class="svg-inline--fa fa-chevron-right fa-w-10" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
6
+ <path fill="currentColor" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"></path>
7
+ </svg>
8
+ `;
9
+ }
10
+ render() {
11
+ return (h(Host, { class: "xpl-breadcrumb-item", role: "listitem" },
12
+ h("li", { role: "none" },
13
+ h("slot", null)),
14
+ h("span", { innerHTML: `${this.chevron}` })));
15
+ }
16
+ ;
17
+ static get is() { return "xpl-breadcrumb-item"; }
18
+ }
19
+ ;
@@ -0,0 +1,12 @@
1
+ import { Component, Host, h } from '@stencil/core';
2
+ export class XplBreadcrumbs {
3
+ render() {
4
+ return (h(Host, null,
5
+ h("nav", { class: "xpl-breadcrumbs", "aria-label": "Breadcrumb" },
6
+ h("ol", { role: "list" },
7
+ h("slot", null)))));
8
+ }
9
+ ;
10
+ static get is() { return "xpl-breadcrumbs"; }
11
+ }
12
+ ;