@xplortech/apollo-core 0.5.2 → 0.5.3
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/apollo-core/apollo-core.css +5468 -9
- package/dist/apollo-core/apollo-core.esm.js +125 -1
- package/dist/apollo-core/app-globals-0f993ce5.js +3 -0
- package/dist/apollo-core/css-shim-bbdf0cc6.js +4 -0
- package/dist/apollo-core/dom-1f98a75f.js +73 -0
- package/dist/apollo-core/index-3c9f25ef.js +2938 -0
- package/dist/apollo-core/index-912d1a21.js +584 -0
- package/dist/apollo-core/index.esm.js +1 -0
- package/dist/{cjs/regular-872f5226.js → apollo-core/regular-133c23b5.js} +12 -3
- package/dist/apollo-core/shadow-css-67b66845.js +389 -0
- package/dist/apollo-core/xpl-application-shell.entry.js +50 -0
- package/dist/apollo-core/xpl-avatar.entry.js +19 -0
- package/dist/apollo-core/xpl-backdrop.entry.js +21 -0
- package/dist/{esm → apollo-core}/xpl-badge.entry.js +1 -1
- package/dist/{collection/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js → apollo-core/xpl-breadcrumb-item.entry.js} +9 -12
- package/dist/apollo-core/xpl-breadcrumbs.entry.js +14 -0
- package/dist/{esm → apollo-core}/xpl-button-row.entry.js +1 -1
- package/dist/apollo-core/xpl-button.entry.js +34 -0
- package/dist/apollo-core/xpl-checkbox.entry.js +25 -0
- package/dist/{esm → apollo-core}/xpl-choicelist.entry.js +1 -1
- package/dist/apollo-core/xpl-content-area.entry.js +16 -0
- package/dist/{esm → apollo-core}/xpl-divider.entry.js +1 -1
- package/dist/{esm → apollo-core}/xpl-grid-item.entry.js +1 -1
- package/dist/{esm → apollo-core}/xpl-grid.entry.js +1 -1
- package/dist/{esm → apollo-core}/xpl-input.entry.js +20 -3
- package/dist/{esm → apollo-core}/xpl-list.entry.js +2 -2
- package/dist/apollo-core/xpl-main-nav.entry.js +26 -0
- package/dist/apollo-core/xpl-nav-item.entry.js +12 -0
- package/dist/{esm → apollo-core}/xpl-pagination.entry.js +1 -1
- package/dist/apollo-core/xpl-radio.entry.js +25 -0
- package/dist/apollo-core/xpl-secondary-nav.entry.js +12 -0
- package/dist/{esm → apollo-core}/xpl-select.entry.js +43 -3
- package/dist/{esm → apollo-core}/xpl-table.entry.js +1 -1
- package/dist/{esm → apollo-core}/xpl-tag.entry.js +1 -1
- package/dist/{esm → apollo-core}/xpl-toggle.entry.js +2 -2
- package/dist/apollo-core/xpl-utility-bar.entry.js +25 -0
- package/dist/types/components/xpl-choicelist/choice.d.ts +1 -1
- package/dist/types/components/xpl-choicelist/xpl-choicelist.d.ts +1 -0
- package/dist/types/components/xpl-dropdown/dropdownchoice.d.ts +5 -5
- package/dist/types/components/xpl-dropdown/xpl-dropdown.d.ts +1 -0
- package/dist/types/components/xpl-list/listitem.d.ts +15 -15
- package/dist/types/components/xpl-list/xpl-list.d.ts +1 -0
- package/dist/types/components/xpl-select/xpl-select.d.ts +1 -0
- package/dist/types/components.d.ts +3 -0
- package/package.json +1 -1
- package/dist/apollo-core/p-0203d4e8.entry.js +0 -1
- package/dist/apollo-core/p-0b2c612e.entry.js +0 -1
- package/dist/apollo-core/p-128a0240.entry.js +0 -1
- package/dist/apollo-core/p-2f90296c.js +0 -10
- package/dist/apollo-core/p-30003b15.entry.js +0 -1
- package/dist/apollo-core/p-4e56a2ca.entry.js +0 -1
- package/dist/apollo-core/p-5854d1e4.entry.js +0 -1
- package/dist/apollo-core/p-611536d8.entry.js +0 -1
- package/dist/apollo-core/p-7c9fee7e.entry.js +0 -1
- package/dist/apollo-core/p-8b6633c7.js +0 -1
- package/dist/apollo-core/p-97cd1f73.entry.js +0 -1
- package/dist/apollo-core/p-9c5ca308.entry.js +0 -1
- package/dist/apollo-core/p-ad90fe4d.js +0 -1
- package/dist/apollo-core/p-bd4a7e3c.entry.js +0 -1
- package/dist/apollo-core/p-dab8e7a1.entry.js +0 -1
- package/dist/apollo-core/p-eb63b401.entry.js +0 -1
- package/dist/apollo-core/p-ee2f4422.entry.js +0 -1
- package/dist/apollo-core/p-f167aa05.entry.js +0 -1
- package/dist/cjs/apollo-core.cjs.js +0 -19
- package/dist/cjs/index-944adb2e.js +0 -1609
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/loader.cjs.js +0 -21
- package/dist/cjs/v4-14140ff3.js +0 -77
- package/dist/cjs/xpl-application-shell_11.cjs.entry.js +0 -230
- package/dist/cjs/xpl-badge.cjs.entry.js +0 -21
- package/dist/cjs/xpl-button-row.cjs.entry.js +0 -24
- package/dist/cjs/xpl-checkbox_2.cjs.entry.js +0 -51
- package/dist/cjs/xpl-choicelist.cjs.entry.js +0 -36
- package/dist/cjs/xpl-divider.cjs.entry.js +0 -18
- package/dist/cjs/xpl-grid-item.cjs.entry.js +0 -25
- package/dist/cjs/xpl-grid.cjs.entry.js +0 -35
- package/dist/cjs/xpl-input.cjs.entry.js +0 -2527
- package/dist/cjs/xpl-list.cjs.entry.js +0 -63
- package/dist/cjs/xpl-pagination.cjs.entry.js +0 -76
- package/dist/cjs/xpl-select.cjs.entry.js +0 -623
- package/dist/cjs/xpl-table.cjs.entry.js +0 -89
- package/dist/cjs/xpl-tag.cjs.entry.js +0 -21
- package/dist/cjs/xpl-toggle.cjs.entry.js +0 -34
- package/dist/collection/collection-manifest.json +0 -37
- package/dist/collection/components/xpl-application-shell/xpl-application-shell.js +0 -143
- package/dist/collection/components/xpl-avatar/xpl-avatar.js +0 -158
- package/dist/collection/components/xpl-backdrop/xpl-backdrop.js +0 -41
- package/dist/collection/components/xpl-badge/xpl-badge.js +0 -50
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js +0 -15
- package/dist/collection/components/xpl-button/xpl-button.js +0 -214
- package/dist/collection/components/xpl-button-row/xpl-button-row.js +0 -119
- package/dist/collection/components/xpl-checkbox/xpl-checkbox.js +0 -185
- package/dist/collection/components/xpl-choicelist/xpl-choicelist.js +0 -143
- package/dist/collection/components/xpl-content-area/xpl-content-area.js +0 -39
- package/dist/collection/components/xpl-divider/xpl-divider.js +0 -30
- package/dist/collection/components/xpl-dropdown/xpl-dropdown.js +0 -32
- package/dist/collection/components/xpl-grid/xpl-grid.js +0 -26
- package/dist/collection/components/xpl-grid-item/xpl-grid-item.js +0 -93
- package/dist/collection/components/xpl-input/xpl-input.js +0 -471
- package/dist/collection/components/xpl-list/xpl-list.js +0 -93
- package/dist/collection/components/xpl-main-nav/xpl-main-nav.js +0 -72
- package/dist/collection/components/xpl-nav-item/xpl-nav-item.js +0 -10
- package/dist/collection/components/xpl-pagination/xpl-pagination.js +0 -189
- package/dist/collection/components/xpl-radio/xpl-radio.js +0 -168
- package/dist/collection/components/xpl-secondary-nav/xpl-secondary-nav.js +0 -9
- package/dist/collection/components/xpl-select/xpl-select.js +0 -311
- package/dist/collection/components/xpl-table/xpl-table.js +0 -194
- package/dist/collection/components/xpl-tag/xpl-tag.js +0 -30
- package/dist/collection/components/xpl-toggle/xpl-toggle.js +0 -157
- package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js +0 -70
- package/dist/custom-elements/index.js +0 -19959
- package/dist/esm/apollo-core.js +0 -17
- package/dist/esm/index-899dba3b.js +0 -1580
- package/dist/esm/index.js +0 -1
- package/dist/esm/loader.js +0 -17
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/regular-86225e9d.js +0 -16041
- package/dist/esm/v4-929670b7.js +0 -75
- package/dist/esm/xpl-application-shell_11.entry.js +0 -216
- package/dist/esm/xpl-checkbox_2.entry.js +0 -46
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/stories/application-shell.stories.js +0 -766
- package/dist/stories/avatar.stories.js +0 -173
- package/dist/stories/backdrop.stories.js +0 -18
- package/dist/stories/badge.stories.js +0 -48
- package/dist/stories/breadcrumbs.stories.js +0 -115
- package/dist/stories/button-row.stories.js +0 -64
- package/dist/stories/button.stories.js +0 -98
- package/dist/stories/checkbox.stories.js +0 -76
- package/dist/stories/choicelist.stories.js +0 -112
- package/dist/stories/content-area.stories.js +0 -53
- package/dist/stories/divider.stories.js +0 -34
- package/dist/stories/grid.stories.js +0 -100
- package/dist/stories/input.stories.js +0 -252
- package/dist/stories/list.stories.js +0 -134
- package/dist/stories/main-nav.stories.js +0 -308
- package/dist/stories/pagination.stories.js +0 -84
- package/dist/stories/radio.stories.js +0 -66
- package/dist/stories/secondary-nav.stories.js +0 -76
- package/dist/stories/select.stories.js +0 -111
- package/dist/stories/table.stories.js +0 -107
- package/dist/stories/tabs.stories.js +0 -24
- package/dist/stories/toggle.stories.js +0 -80
- package/dist/stories/utility-bar.stories.js +0 -94
- /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/application-shell.stories.d.ts +0 -0
- /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/avatar.stories.d.ts +0 -0
- /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/backdrop.stories.d.ts +0 -0
- /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/badge.stories.d.ts +0 -0
- /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/breadcrumbs.stories.d.ts +0 -0
- /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/button-row.stories.d.ts +0 -0
- /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/button.stories.d.ts +0 -0
- /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/checkbox.stories.d.ts +0 -0
- /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/choicelist.stories.d.ts +0 -0
- /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/content-area.stories.d.ts +0 -0
- /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/divider.stories.d.ts +0 -0
- /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/grid.stories.d.ts +0 -0
- /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/input.stories.d.ts +0 -0
- /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/list.stories.d.ts +0 -0
- /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/main-nav.stories.d.ts +0 -0
- /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/pagination.stories.d.ts +0 -0
- /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/radio.stories.d.ts +0 -0
- /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/secondary-nav.stories.d.ts +0 -0
- /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/select.stories.d.ts +0 -0
- /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/table.stories.d.ts +0 -0
- /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/tabs.stories.d.ts +0 -0
- /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/toggle.stories.d.ts +0 -0
- /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/utility-bar.stories.d.ts +0 -0
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/// <reference path="./listitem.d.ts"></reference>
|
|
2
|
-
import { Component, Host, h, Prop, Fragment } from "@stencil/core";
|
|
3
|
-
import "../../../font-awesome/fontawesome";
|
|
4
|
-
import "../../../font-awesome/regular";
|
|
5
|
-
const ListItemCpt = ({ avatar, avatars, badges, href, title, subtext, metadata }) => {
|
|
6
|
-
const hasRight = avatars || badges || subtext;
|
|
7
|
-
const inner = (h(Fragment, null,
|
|
8
|
-
avatar && (avatar.slice(0, 1) === "/" || avatar.slice(0, 4) === "http" ?
|
|
9
|
-
h("xpl-avatar", { src: avatar, name: title }) :
|
|
10
|
-
h("xpl-avatar", { name: title }, avatar)),
|
|
11
|
-
h("div", { class: "xpl-list-item-content" },
|
|
12
|
-
h("div", { class: "xpl-list-left" },
|
|
13
|
-
h("div", null,
|
|
14
|
-
h("h4", null, title),
|
|
15
|
-
metadata && (h("ul", { class: "xpl-list-item-metadata" }, metadata.map(d => {
|
|
16
|
-
if (typeof d === "string") {
|
|
17
|
-
return h("li", null, d);
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
return h("li", null,
|
|
21
|
-
h("span", { class: `far fa-${d.icon}` }),
|
|
22
|
-
" ",
|
|
23
|
-
d.text);
|
|
24
|
-
}
|
|
25
|
-
}))))),
|
|
26
|
-
hasRight && (h("div", { class: "xpl-list-right" },
|
|
27
|
-
subtext && h("div", { class: "xpl-list-item-subtext" }, subtext),
|
|
28
|
-
avatars && (h("div", { class: "xpl-avatar-group xpl-avatar-group--s" }, avatars.map(a => h("img", { src: a, alt: "" })))),
|
|
29
|
-
badges && badges.map(b => {
|
|
30
|
-
if (typeof b === "string") {
|
|
31
|
-
return h("xpl-badge", null, b);
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
return h("xpl-badge", { dot: b.dot, variant: b.variant }, b.text);
|
|
35
|
-
}
|
|
36
|
-
}))))));
|
|
37
|
-
return href ?
|
|
38
|
-
h("a", { class: "xpl-list-item", href: href }, inner) :
|
|
39
|
-
h("div", { class: "xpl-list-item" }, inner);
|
|
40
|
-
};
|
|
41
|
-
export class XplList {
|
|
42
|
-
constructor() {
|
|
43
|
-
/**
|
|
44
|
-
* `items` should be an array of objects with the following signature:
|
|
45
|
-
* {
|
|
46
|
-
* avatar?: string; // The URL of the avatar, or the placeholder initials (ex. "SPD").
|
|
47
|
-
* avatars?: string[]; // The URLs of multiple avatars to be displayed in a group on the right.
|
|
48
|
-
* badges?: string[] | { // An array of strings or badge-like objects to be displayed as badges
|
|
49
|
-
* dot?: boolean; // in a group on the right. See <xpl-badge> for more details.
|
|
50
|
-
* text: string;
|
|
51
|
-
* variant?: string;
|
|
52
|
-
* }[];
|
|
53
|
-
* href?: string; // A URL, if this list item is meant to link somewhere.
|
|
54
|
-
* title: string; // The text to be displayed for the list item.
|
|
55
|
-
* metadata?: string[] | { // An array of strings or strings with icons (reference the allowed
|
|
56
|
-
* icon: string; // Font Awesome icons) to be displayed as metadata below the title.
|
|
57
|
-
* text: string;
|
|
58
|
-
* }[];
|
|
59
|
-
* subtext?: string; // Subtext to be displayed on the right.
|
|
60
|
-
* }
|
|
61
|
-
*
|
|
62
|
-
* - Note that you should *only use one of* `avatars`, `badges`, or `subtext`, to avoid cluttering
|
|
63
|
-
* the right-hand side of the list item.
|
|
64
|
-
*/
|
|
65
|
-
this.items = [];
|
|
66
|
-
}
|
|
67
|
-
render() {
|
|
68
|
-
return (h(Host, null, this.items.map(item => h(ListItemCpt, Object.assign({}, item)))));
|
|
69
|
-
}
|
|
70
|
-
static get is() { return "xpl-list"; }
|
|
71
|
-
static get properties() { return {
|
|
72
|
-
"items": {
|
|
73
|
-
"type": "unknown",
|
|
74
|
-
"mutable": false,
|
|
75
|
-
"complexType": {
|
|
76
|
-
"original": "ListItem[]",
|
|
77
|
-
"resolved": "ListItem[]",
|
|
78
|
-
"references": {
|
|
79
|
-
"ListItem": {
|
|
80
|
-
"location": "global"
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
"required": false,
|
|
85
|
-
"optional": true,
|
|
86
|
-
"docs": {
|
|
87
|
-
"tags": [],
|
|
88
|
-
"text": "`items` should be an array of objects with the following signature:\n{\n avatar?: string; // The URL of the avatar, or the placeholder initials (ex. \"SPD\").\n avatars?: string[]; // The URLs of multiple avatars to be displayed in a group on the right.\n badges?: string[] | { // An array of strings or badge-like objects to be displayed as badges\n dot?: boolean; // in a group on the right. See <xpl-badge> for more details.\n text: string;\n variant?: string;\n }[];\n href?: string; // A URL, if this list item is meant to link somewhere.\n title: string; // The text to be displayed for the list item.\n metadata?: string[] | { // An array of strings or strings with icons (reference the allowed\n icon: string; // Font Awesome icons) to be displayed as metadata below the title.\n text: string;\n }[];\n subtext?: string; // Subtext to be displayed on the right.\n}\n\n- Note that you should *only use one of* `avatars`, `badges`, or `subtext`, to avoid cluttering\n the right-hand side of the list item."
|
|
89
|
-
},
|
|
90
|
-
"defaultValue": "[]"
|
|
91
|
-
}
|
|
92
|
-
}; }
|
|
93
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { Component, Host, h, Prop, Event } from '@stencil/core';
|
|
2
|
-
export class XplMainNav {
|
|
3
|
-
constructor() {
|
|
4
|
-
/**
|
|
5
|
-
* @property {string} width - The width of the Main Nav.
|
|
6
|
-
*/
|
|
7
|
-
this.width = "default";
|
|
8
|
-
}
|
|
9
|
-
navWidthHandler() {
|
|
10
|
-
this.navWidth.emit(this.width);
|
|
11
|
-
}
|
|
12
|
-
connectedCallback() {
|
|
13
|
-
this.navWidthHandler();
|
|
14
|
-
}
|
|
15
|
-
componentDidUpdate() {
|
|
16
|
-
this.navWidthHandler();
|
|
17
|
-
}
|
|
18
|
-
render() {
|
|
19
|
-
return (h(Host, { class: `xpl-main-nav xpl-main-nav--${this.width}`, "aria-label": "Sidebar" },
|
|
20
|
-
h("nav", null,
|
|
21
|
-
h("header", { "aria-label": "Sidebar Header" },
|
|
22
|
-
h("slot", { name: "logo" }),
|
|
23
|
-
h("slot", { name: "brand-name" })),
|
|
24
|
-
h("div", { class: "xpl-main-nav__main_section" },
|
|
25
|
-
h("slot", { name: "navigation" })),
|
|
26
|
-
h("footer", { class: "xpl-main-nav__footer", "aria-label": "Sidebar Footer" },
|
|
27
|
-
h("slot", { name: "footer" })))));
|
|
28
|
-
}
|
|
29
|
-
static get is() { return "xpl-main-nav"; }
|
|
30
|
-
static get properties() { return {
|
|
31
|
-
"width": {
|
|
32
|
-
"type": "string",
|
|
33
|
-
"mutable": false,
|
|
34
|
-
"complexType": {
|
|
35
|
-
"original": "\"default\" | \"md\" | \"sm\"",
|
|
36
|
-
"resolved": "\"default\" | \"md\" | \"sm\"",
|
|
37
|
-
"references": {}
|
|
38
|
-
},
|
|
39
|
-
"required": false,
|
|
40
|
-
"optional": false,
|
|
41
|
-
"docs": {
|
|
42
|
-
"tags": [{
|
|
43
|
-
"text": "{string} width - The width of the Main Nav.",
|
|
44
|
-
"name": "property"
|
|
45
|
-
}],
|
|
46
|
-
"text": ""
|
|
47
|
-
},
|
|
48
|
-
"attribute": "width",
|
|
49
|
-
"reflect": false,
|
|
50
|
-
"defaultValue": "\"default\""
|
|
51
|
-
}
|
|
52
|
-
}; }
|
|
53
|
-
static get events() { return [{
|
|
54
|
-
"method": "navWidth",
|
|
55
|
-
"name": "navWidth",
|
|
56
|
-
"bubbles": true,
|
|
57
|
-
"cancelable": true,
|
|
58
|
-
"composed": true,
|
|
59
|
-
"docs": {
|
|
60
|
-
"tags": [{
|
|
61
|
-
"text": "{string} navWidth - Emits the `nav-width` prop set by the user\nwhen the component is attached to the DOM and when the component is updated.",
|
|
62
|
-
"name": "event"
|
|
63
|
-
}],
|
|
64
|
-
"text": ""
|
|
65
|
-
},
|
|
66
|
-
"complexType": {
|
|
67
|
-
"original": "string",
|
|
68
|
-
"resolved": "string",
|
|
69
|
-
"references": {}
|
|
70
|
-
}
|
|
71
|
-
}]; }
|
|
72
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Component, Host, h } from '@stencil/core';
|
|
2
|
-
export class XplNavItem {
|
|
3
|
-
render() {
|
|
4
|
-
return (h(Host, { class: "xpl-nav-item", role: "listitem" },
|
|
5
|
-
h("slot", { name: "link" },
|
|
6
|
-
h("slot", { name: "icon" }),
|
|
7
|
-
h("slot", null))));
|
|
8
|
-
}
|
|
9
|
-
static get is() { return "xpl-nav-item"; }
|
|
10
|
-
}
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import { Component, Host, h, Event, Prop, State, Method, } from "@stencil/core";
|
|
2
|
-
export class XplPagination {
|
|
3
|
-
constructor() {
|
|
4
|
-
this.current = 1;
|
|
5
|
-
/**
|
|
6
|
-
* Private `_goto` method respects the `waitForCallback` prop --
|
|
7
|
-
* it will always emit the `page` event, but won't actually update
|
|
8
|
-
* the state of what the current page is, leaving that to the caller
|
|
9
|
-
* to update once (presumably) some other data has loaded.
|
|
10
|
-
*/
|
|
11
|
-
this._goto = (n) => {
|
|
12
|
-
this.page.emit(n);
|
|
13
|
-
if (!this.waitForCallback) {
|
|
14
|
-
this.current = n;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
this.goPrev = () => {
|
|
18
|
-
if (this.current > 1)
|
|
19
|
-
this._goto(this.current - 1);
|
|
20
|
-
};
|
|
21
|
-
this.goNext = () => {
|
|
22
|
-
const numPages = Math.ceil(this.total / this.perPage);
|
|
23
|
-
if (this.current < numPages)
|
|
24
|
-
this._goto(this.current + 1);
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Calling `goto` with a page number (which should probably be
|
|
29
|
-
* taken from the `page` event) updates the pagination's state
|
|
30
|
-
* and re-renders it, showing the appropriate buttons given the current page.
|
|
31
|
-
* @param n
|
|
32
|
-
*/
|
|
33
|
-
async goto(n) {
|
|
34
|
-
this.current = n;
|
|
35
|
-
}
|
|
36
|
-
render() {
|
|
37
|
-
const numPages = Math.ceil(this.total / this.perPage);
|
|
38
|
-
let showing = [1];
|
|
39
|
-
if (numPages < 7)
|
|
40
|
-
showing = [1, 2, 3, 4, 5, 6];
|
|
41
|
-
if (this.current <= 3 || this.current >= numPages - 2) {
|
|
42
|
-
showing = [1, 2, 3, "...", numPages - 2, numPages - 1, numPages];
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
showing = [
|
|
46
|
-
1,
|
|
47
|
-
"...",
|
|
48
|
-
this.current - 1,
|
|
49
|
-
this.current,
|
|
50
|
-
this.current + 1,
|
|
51
|
-
"...",
|
|
52
|
-
numPages,
|
|
53
|
-
];
|
|
54
|
-
}
|
|
55
|
-
const showingFirst = (this.current - 1) * this.perPage + 1;
|
|
56
|
-
const showingLast = Math.min(showingFirst + this.perPage - 1, this.total);
|
|
57
|
-
return (h(Host, null,
|
|
58
|
-
h("div", { class: "xpl-pagination" },
|
|
59
|
-
h("div", null,
|
|
60
|
-
h("p", null,
|
|
61
|
-
"Showing ",
|
|
62
|
-
h("span", null, showingFirst),
|
|
63
|
-
" to ",
|
|
64
|
-
h("span", null, showingLast),
|
|
65
|
-
" ",
|
|
66
|
-
"of ",
|
|
67
|
-
h("span", null, this.total),
|
|
68
|
-
" results")),
|
|
69
|
-
h("div", null,
|
|
70
|
-
h("nav", { "aria-label": "Pagination" },
|
|
71
|
-
h("button", { onClick: this.goPrev, class: "xpl-pagination-prev" },
|
|
72
|
-
h("span", null, "Previous"),
|
|
73
|
-
h("svg", { viewBox: "0 0 20 20", "aria-hidden": "true" },
|
|
74
|
-
h("path", { "fill-rule": "evenodd", d: "M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z", "clip-rule": "evenodd" }))),
|
|
75
|
-
showing.map((n) => {
|
|
76
|
-
if (n === "...") {
|
|
77
|
-
return h("span", { class: "xpl-pagination-ellipsis" }, "...");
|
|
78
|
-
}
|
|
79
|
-
if (n === this.current) {
|
|
80
|
-
return (h("button", { "aria-current": "page", class: "xpl-pagination-current" }, n));
|
|
81
|
-
}
|
|
82
|
-
return h("button", { onClick: () => this._goto(n) }, n);
|
|
83
|
-
}),
|
|
84
|
-
h("button", { onClick: this.goNext, class: "xpl-pagination-next" },
|
|
85
|
-
h("span", null, "Next"),
|
|
86
|
-
h("svg", { viewBox: "0 0 20 20", "aria-hidden": "true" },
|
|
87
|
-
h("path", { "fill-rule": "evenodd", d: "M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z", "clip-rule": "evenodd" }))))))));
|
|
88
|
-
}
|
|
89
|
-
static get is() { return "xpl-pagination"; }
|
|
90
|
-
static get properties() { return {
|
|
91
|
-
"total": {
|
|
92
|
-
"type": "number",
|
|
93
|
-
"mutable": false,
|
|
94
|
-
"complexType": {
|
|
95
|
-
"original": "number",
|
|
96
|
-
"resolved": "number",
|
|
97
|
-
"references": {}
|
|
98
|
-
},
|
|
99
|
-
"required": false,
|
|
100
|
-
"optional": false,
|
|
101
|
-
"docs": {
|
|
102
|
-
"tags": [],
|
|
103
|
-
"text": ""
|
|
104
|
-
},
|
|
105
|
-
"attribute": "total",
|
|
106
|
-
"reflect": false
|
|
107
|
-
},
|
|
108
|
-
"perPage": {
|
|
109
|
-
"type": "number",
|
|
110
|
-
"mutable": false,
|
|
111
|
-
"complexType": {
|
|
112
|
-
"original": "number",
|
|
113
|
-
"resolved": "number",
|
|
114
|
-
"references": {}
|
|
115
|
-
},
|
|
116
|
-
"required": false,
|
|
117
|
-
"optional": false,
|
|
118
|
-
"docs": {
|
|
119
|
-
"tags": [],
|
|
120
|
-
"text": ""
|
|
121
|
-
},
|
|
122
|
-
"attribute": "per-page",
|
|
123
|
-
"reflect": false
|
|
124
|
-
},
|
|
125
|
-
"waitForCallback": {
|
|
126
|
-
"type": "boolean",
|
|
127
|
-
"mutable": false,
|
|
128
|
-
"complexType": {
|
|
129
|
-
"original": "boolean",
|
|
130
|
-
"resolved": "boolean",
|
|
131
|
-
"references": {}
|
|
132
|
-
},
|
|
133
|
-
"required": false,
|
|
134
|
-
"optional": false,
|
|
135
|
-
"docs": {
|
|
136
|
-
"tags": [],
|
|
137
|
-
"text": ""
|
|
138
|
-
},
|
|
139
|
-
"attribute": "wait-for-callback",
|
|
140
|
-
"reflect": false
|
|
141
|
-
}
|
|
142
|
-
}; }
|
|
143
|
-
static get states() { return {
|
|
144
|
-
"current": {}
|
|
145
|
-
}; }
|
|
146
|
-
static get events() { return [{
|
|
147
|
-
"method": "page",
|
|
148
|
-
"name": "page",
|
|
149
|
-
"bubbles": true,
|
|
150
|
-
"cancelable": true,
|
|
151
|
-
"composed": true,
|
|
152
|
-
"docs": {
|
|
153
|
-
"tags": [],
|
|
154
|
-
"text": ""
|
|
155
|
-
},
|
|
156
|
-
"complexType": {
|
|
157
|
-
"original": "any",
|
|
158
|
-
"resolved": "any",
|
|
159
|
-
"references": {}
|
|
160
|
-
}
|
|
161
|
-
}]; }
|
|
162
|
-
static get methods() { return {
|
|
163
|
-
"goto": {
|
|
164
|
-
"complexType": {
|
|
165
|
-
"signature": "(n: number) => Promise<void>",
|
|
166
|
-
"parameters": [{
|
|
167
|
-
"tags": [{
|
|
168
|
-
"text": "n",
|
|
169
|
-
"name": "param"
|
|
170
|
-
}],
|
|
171
|
-
"text": ""
|
|
172
|
-
}],
|
|
173
|
-
"references": {
|
|
174
|
-
"Promise": {
|
|
175
|
-
"location": "global"
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
"return": "Promise<void>"
|
|
179
|
-
},
|
|
180
|
-
"docs": {
|
|
181
|
-
"text": "Calling `goto` with a page number (which should probably be\ntaken from the `page` event) updates the pagination's state\nand re-renders it, showing the appropriate buttons given the current page.",
|
|
182
|
-
"tags": [{
|
|
183
|
-
"name": "param",
|
|
184
|
-
"text": "n"
|
|
185
|
-
}]
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}; }
|
|
189
|
-
}
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { Component, Host, h, Prop, State, Event } from "@stencil/core";
|
|
2
|
-
import { v4 as uuid } from "uuid";
|
|
3
|
-
export class XplRadio {
|
|
4
|
-
constructor() {
|
|
5
|
-
this.id = uuid();
|
|
6
|
-
}
|
|
7
|
-
render() {
|
|
8
|
-
return (h(Host, { class: {
|
|
9
|
-
"xpl-checkbox-radio-container": true,
|
|
10
|
-
"styled": this.styled,
|
|
11
|
-
"disabled": this.disabled,
|
|
12
|
-
} },
|
|
13
|
-
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, onChange: () => this.radioChange.emit(true) }),
|
|
14
|
-
h("label", { class: {
|
|
15
|
-
"xpl-label": true,
|
|
16
|
-
"xpl-label--disabled": this.disabled
|
|
17
|
-
}, htmlFor: this.id },
|
|
18
|
-
h("slot", null),
|
|
19
|
-
this.description && h("small", { class: {
|
|
20
|
-
"xpl-description": true,
|
|
21
|
-
"xpl-description--disabled": this.disabled
|
|
22
|
-
} }, this.description))));
|
|
23
|
-
}
|
|
24
|
-
static get is() { return "xpl-radio"; }
|
|
25
|
-
static get properties() { return {
|
|
26
|
-
"checked": {
|
|
27
|
-
"type": "boolean",
|
|
28
|
-
"mutable": false,
|
|
29
|
-
"complexType": {
|
|
30
|
-
"original": "boolean",
|
|
31
|
-
"resolved": "boolean",
|
|
32
|
-
"references": {}
|
|
33
|
-
},
|
|
34
|
-
"required": false,
|
|
35
|
-
"optional": true,
|
|
36
|
-
"docs": {
|
|
37
|
-
"tags": [],
|
|
38
|
-
"text": ""
|
|
39
|
-
},
|
|
40
|
-
"attribute": "checked",
|
|
41
|
-
"reflect": false
|
|
42
|
-
},
|
|
43
|
-
"description": {
|
|
44
|
-
"type": "string",
|
|
45
|
-
"mutable": false,
|
|
46
|
-
"complexType": {
|
|
47
|
-
"original": "string",
|
|
48
|
-
"resolved": "string",
|
|
49
|
-
"references": {}
|
|
50
|
-
},
|
|
51
|
-
"required": false,
|
|
52
|
-
"optional": true,
|
|
53
|
-
"docs": {
|
|
54
|
-
"tags": [],
|
|
55
|
-
"text": ""
|
|
56
|
-
},
|
|
57
|
-
"attribute": "description",
|
|
58
|
-
"reflect": false
|
|
59
|
-
},
|
|
60
|
-
"disabled": {
|
|
61
|
-
"type": "boolean",
|
|
62
|
-
"mutable": false,
|
|
63
|
-
"complexType": {
|
|
64
|
-
"original": "boolean",
|
|
65
|
-
"resolved": "boolean",
|
|
66
|
-
"references": {}
|
|
67
|
-
},
|
|
68
|
-
"required": false,
|
|
69
|
-
"optional": true,
|
|
70
|
-
"docs": {
|
|
71
|
-
"tags": [],
|
|
72
|
-
"text": ""
|
|
73
|
-
},
|
|
74
|
-
"attribute": "disabled",
|
|
75
|
-
"reflect": false
|
|
76
|
-
},
|
|
77
|
-
"name": {
|
|
78
|
-
"type": "string",
|
|
79
|
-
"mutable": false,
|
|
80
|
-
"complexType": {
|
|
81
|
-
"original": "string",
|
|
82
|
-
"resolved": "string",
|
|
83
|
-
"references": {}
|
|
84
|
-
},
|
|
85
|
-
"required": false,
|
|
86
|
-
"optional": true,
|
|
87
|
-
"docs": {
|
|
88
|
-
"tags": [],
|
|
89
|
-
"text": ""
|
|
90
|
-
},
|
|
91
|
-
"attribute": "name",
|
|
92
|
-
"reflect": false
|
|
93
|
-
},
|
|
94
|
-
"required": {
|
|
95
|
-
"type": "boolean",
|
|
96
|
-
"mutable": false,
|
|
97
|
-
"complexType": {
|
|
98
|
-
"original": "boolean",
|
|
99
|
-
"resolved": "boolean",
|
|
100
|
-
"references": {}
|
|
101
|
-
},
|
|
102
|
-
"required": false,
|
|
103
|
-
"optional": true,
|
|
104
|
-
"docs": {
|
|
105
|
-
"tags": [],
|
|
106
|
-
"text": ""
|
|
107
|
-
},
|
|
108
|
-
"attribute": "required",
|
|
109
|
-
"reflect": false
|
|
110
|
-
},
|
|
111
|
-
"styled": {
|
|
112
|
-
"type": "boolean",
|
|
113
|
-
"mutable": false,
|
|
114
|
-
"complexType": {
|
|
115
|
-
"original": "boolean",
|
|
116
|
-
"resolved": "boolean",
|
|
117
|
-
"references": {}
|
|
118
|
-
},
|
|
119
|
-
"required": false,
|
|
120
|
-
"optional": true,
|
|
121
|
-
"docs": {
|
|
122
|
-
"tags": [],
|
|
123
|
-
"text": ""
|
|
124
|
-
},
|
|
125
|
-
"attribute": "styled",
|
|
126
|
-
"reflect": false
|
|
127
|
-
},
|
|
128
|
-
"value": {
|
|
129
|
-
"type": "string",
|
|
130
|
-
"mutable": false,
|
|
131
|
-
"complexType": {
|
|
132
|
-
"original": "string",
|
|
133
|
-
"resolved": "string",
|
|
134
|
-
"references": {}
|
|
135
|
-
},
|
|
136
|
-
"required": false,
|
|
137
|
-
"optional": true,
|
|
138
|
-
"docs": {
|
|
139
|
-
"tags": [],
|
|
140
|
-
"text": ""
|
|
141
|
-
},
|
|
142
|
-
"attribute": "value",
|
|
143
|
-
"reflect": false
|
|
144
|
-
}
|
|
145
|
-
}; }
|
|
146
|
-
static get states() { return {
|
|
147
|
-
"id": {}
|
|
148
|
-
}; }
|
|
149
|
-
static get events() { return [{
|
|
150
|
-
"method": "radioChange",
|
|
151
|
-
"name": "radioChange",
|
|
152
|
-
"bubbles": true,
|
|
153
|
-
"cancelable": true,
|
|
154
|
-
"composed": true,
|
|
155
|
-
"docs": {
|
|
156
|
-
"tags": [{
|
|
157
|
-
"text": undefined,
|
|
158
|
-
"name": "private"
|
|
159
|
-
}],
|
|
160
|
-
"text": ""
|
|
161
|
-
},
|
|
162
|
-
"complexType": {
|
|
163
|
-
"original": "any",
|
|
164
|
-
"resolved": "any",
|
|
165
|
-
"references": {}
|
|
166
|
-
}
|
|
167
|
-
}]; }
|
|
168
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Component, Host, h } from '@stencil/core';
|
|
2
|
-
export class XplSecondaryNav {
|
|
3
|
-
render() {
|
|
4
|
-
return (h(Host, { class: "xpl-secondary-nav" },
|
|
5
|
-
h("nav", { "aria-label": "Secondary Nav" },
|
|
6
|
-
h("slot", null))));
|
|
7
|
-
}
|
|
8
|
-
static get is() { return "xpl-secondary-nav"; }
|
|
9
|
-
}
|