@xplortech/apollo-core 0.5.2 → 1.0.0-beta.0
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/build/style.css +758 -383
- package/dist/apollo-core/apollo-core.css +4 -4
- package/dist/apollo-core/apollo-core.esm.js +1 -1
- package/dist/apollo-core/{p-5854d1e4.entry.js → p-09b2f746.entry.js} +1 -1
- package/dist/apollo-core/p-0bc956c6.entry.js +1 -0
- package/dist/apollo-core/p-1b1e7207.entry.js +1 -0
- package/dist/apollo-core/{p-f167aa05.entry.js → p-20389bb6.entry.js} +1 -1
- package/dist/apollo-core/{p-ee2f4422.entry.js → p-25983fde.entry.js} +1 -1
- package/dist/apollo-core/{p-128a0240.entry.js → p-4a348764.entry.js} +1 -1
- package/dist/apollo-core/{p-eb63b401.entry.js → p-4e2b69e8.entry.js} +1 -1
- package/dist/apollo-core/{p-97cd1f73.entry.js → p-84bf6b2d.entry.js} +1 -1
- package/dist/apollo-core/{p-611536d8.entry.js → p-880c0359.entry.js} +1 -1
- package/dist/apollo-core/p-8e47a5be.entry.js +1 -0
- package/dist/apollo-core/p-93958292.entry.js +1 -0
- package/dist/apollo-core/p-93c27db5.entry.js +1 -0
- package/dist/apollo-core/{p-0b2c612e.entry.js → p-b2327e2c.entry.js} +1 -1
- package/dist/apollo-core/p-c55b5d9c.entry.js +1 -0
- package/dist/apollo-core/p-e369d7af.entry.js +1 -0
- package/dist/apollo-core/p-e60ecaef.entry.js +1 -0
- package/dist/apollo-core/p-f929c958.js +1 -0
- package/dist/cjs/apollo-core.cjs.js +2 -2
- package/dist/cjs/{index-944adb2e.js → index-54ba5804.js} +14 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/xpl-application-shell.cjs.entry.js +58 -0
- package/dist/cjs/xpl-avatar_12.cjs.entry.js +299 -0
- package/dist/cjs/xpl-backdrop.cjs.entry.js +25 -0
- package/dist/cjs/xpl-button-row.cjs.entry.js +2 -4
- package/dist/cjs/xpl-choicelist.cjs.entry.js +21 -14
- package/dist/cjs/xpl-divider.cjs.entry.js +2 -2
- package/dist/cjs/xpl-dropdown-group_3.cjs.entry.js +104 -0
- package/dist/cjs/xpl-dropdown_2.cjs.entry.js +123 -0
- package/dist/cjs/xpl-grid-item.cjs.entry.js +2 -2
- package/dist/cjs/xpl-grid.cjs.entry.js +12 -12
- package/dist/cjs/xpl-input.cjs.entry.js +33 -26
- package/dist/cjs/xpl-list.cjs.entry.js +17 -19
- package/dist/cjs/xpl-main-nav.cjs.entry.js +30 -0
- package/dist/cjs/xpl-pagination.cjs.entry.js +8 -8
- package/dist/cjs/xpl-select.cjs.entry.js +87 -85
- package/dist/cjs/xpl-toggle.cjs.entry.js +13 -13
- package/dist/collection/collection-manifest.json +4 -0
- package/dist/collection/components/xpl-application-shell/xpl-application-shell.js +11 -7
- package/dist/collection/components/xpl-avatar/xpl-avatar.js +7 -7
- package/dist/collection/components/xpl-backdrop/xpl-backdrop.js +1 -1
- package/dist/collection/components/xpl-badge/xpl-badge.js +5 -5
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js +0 -2
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js +0 -2
- package/dist/collection/components/xpl-button/xpl-button.js +79 -82
- package/dist/collection/components/xpl-button-row/xpl-button-row.js +7 -9
- package/dist/collection/components/xpl-checkbox/xpl-checkbox.js +11 -11
- package/dist/collection/components/xpl-choicelist/xpl-choicelist.js +22 -15
- package/dist/collection/components/xpl-content-area/xpl-content-area.js +5 -5
- package/dist/collection/components/xpl-divider/xpl-divider.js +1 -1
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.js +66 -0
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.js +27 -0
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.js +110 -0
- package/dist/collection/components/xpl-dropdown/xpl-dropdown.js +259 -31
- package/dist/collection/components/xpl-grid/xpl-grid.js +11 -11
- package/dist/collection/components/xpl-grid-item/xpl-grid-item.js +1 -1
- package/dist/collection/components/xpl-input/xpl-input.js +49 -42
- package/dist/collection/components/xpl-list/xpl-list.js +24 -26
- package/dist/collection/components/xpl-main-nav/xpl-main-nav.js +3 -3
- package/dist/collection/components/xpl-nav-item/xpl-nav-item.js +59 -2
- package/dist/collection/components/xpl-pagination/xpl-pagination.js +11 -10
- package/dist/collection/components/xpl-radio/xpl-radio.js +11 -11
- package/dist/collection/components/xpl-select/xpl-select.js +97 -64
- package/dist/collection/components/xpl-table/xpl-table.js +18 -12
- package/dist/collection/components/xpl-toggle/xpl-toggle.js +16 -16
- package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js +4 -8
- package/dist/custom-elements/index.d.ts +24 -0
- package/dist/custom-elements/index.js +18936 -18694
- package/dist/esm/apollo-core.js +2 -2
- package/dist/esm/{index-899dba3b.js → index-3df6db84.js} +14 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/xpl-application-shell.entry.js +54 -0
- package/dist/esm/xpl-avatar_12.entry.js +284 -0
- package/dist/esm/xpl-backdrop.entry.js +21 -0
- package/dist/esm/xpl-button-row.entry.js +2 -4
- package/dist/esm/xpl-choicelist.entry.js +21 -14
- package/dist/esm/xpl-divider.entry.js +2 -2
- package/dist/esm/xpl-dropdown-group_3.entry.js +98 -0
- package/dist/esm/xpl-dropdown_2.entry.js +118 -0
- package/dist/esm/xpl-grid-item.entry.js +2 -2
- package/dist/esm/xpl-grid.entry.js +12 -12
- package/dist/esm/xpl-input.entry.js +33 -26
- package/dist/esm/xpl-list.entry.js +17 -19
- package/dist/esm/xpl-main-nav.entry.js +26 -0
- package/dist/esm/xpl-pagination.entry.js +8 -8
- package/dist/esm/xpl-select.entry.js +87 -85
- package/dist/esm/xpl-toggle.entry.js +13 -13
- package/dist/stories/application-shell.stories.js +31 -30
- package/dist/stories/avatar.stories.js +38 -38
- package/dist/stories/backdrop.stories.js +3 -3
- package/dist/stories/badge.stories.js +16 -16
- package/dist/stories/breadcrumbs.stories.js +18 -16
- package/dist/stories/button-row.stories.js +18 -14
- package/dist/stories/button.stories.js +69 -57
- package/dist/stories/checkbox.stories.js +21 -19
- package/dist/stories/choicelist.stories.js +19 -19
- package/dist/stories/content-area.stories.js +6 -6
- package/dist/stories/divider.stories.js +7 -7
- package/dist/stories/dropdown.stories.js +377 -0
- package/dist/stories/grid.stories.js +19 -19
- package/dist/stories/input.stories.js +93 -77
- package/dist/stories/list.stories.js +72 -52
- package/dist/stories/main-nav.stories.js +8 -8
- package/dist/stories/radio.stories.js +18 -16
- package/dist/stories/secondary-nav.stories.js +5 -5
- package/dist/stories/select.stories.js +54 -46
- package/dist/stories/table.stories.js +29 -29
- package/dist/stories/toggle.stories.js +30 -26
- package/dist/stories/utility-bar.stories.js +4 -4
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/application-shell.stories.d.ts +4 -4
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/avatar.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/backdrop.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/badge.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/breadcrumbs.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/button-row.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/button.stories.d.ts +19 -10
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/checkbox.stories.d.ts +2 -2
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/choicelist.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/content-area.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/divider.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/dropdown.stories.d.ts +134 -0
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/grid.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/input.stories.d.ts +5 -5
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/list.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/main-nav.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/radio.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/secondary-nav.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/select.stories.d.ts +2 -2
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/table.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/toggle.stories.d.ts +2 -2
- package/dist/types/components/xpl-application-shell/xpl-application-shell.d.ts +2 -2
- package/dist/types/components/xpl-avatar/xpl-avatar.d.ts +3 -3
- package/dist/types/components/xpl-badge/xpl-badge.d.ts +1 -1
- package/dist/types/components/xpl-button/xpl-button.d.ts +32 -8
- package/dist/types/components/xpl-button-row/xpl-button-row.d.ts +3 -3
- package/dist/types/components/xpl-checkbox/xpl-checkbox.d.ts +1 -1
- package/dist/types/components/xpl-content-area/xpl-content-area.d.ts +3 -3
- package/dist/types/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.d.ts +7 -0
- package/dist/types/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.d.ts +5 -0
- package/dist/types/components/xpl-input/xpl-input.d.ts +4 -4
- package/dist/types/components/xpl-list/xpl-list.d.ts +2 -2
- package/dist/types/components/xpl-main-nav/xpl-main-nav.d.ts +1 -1
- package/dist/types/components/xpl-nav-item/xpl-nav-item.d.ts +10 -0
- package/dist/types/components/xpl-pagination/xpl-pagination.d.ts +1 -1
- package/dist/types/components/xpl-radio/xpl-radio.d.ts +1 -1
- package/dist/types/components/xpl-select/xpl-select.d.ts +6 -2
- package/dist/types/components/xpl-table/xpl-table.d.ts +1 -1
- package/dist/types/components/xpl-toggle/xpl-toggle.d.ts +1 -1
- package/dist/types/components.d.ts +264 -40
- package/package.json +10 -4
- package/dist/apollo-core/p-0203d4e8.entry.js +0 -1
- 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-7c9fee7e.entry.js +0 -1
- package/dist/apollo-core/p-8b6633c7.js +0 -1
- package/dist/apollo-core/p-9c5ca308.entry.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/cjs/xpl-application-shell_11.cjs.entry.js +0 -230
- package/dist/cjs/xpl-badge.cjs.entry.js +0 -21
- package/dist/cjs/xpl-checkbox_2.cjs.entry.js +0 -51
- package/dist/cjs/xpl-table.cjs.entry.js +0 -89
- package/dist/cjs/xpl-tag.cjs.entry.js +0 -21
- package/dist/esm/xpl-application-shell_11.entry.js +0 -216
- package/dist/esm/xpl-badge.entry.js +0 -17
- package/dist/esm/xpl-checkbox_2.entry.js +0 -46
- package/dist/esm/xpl-table.entry.js +0 -85
- package/dist/esm/xpl-tag.entry.js +0 -17
- package/dist/types/components/xpl-choicelist/choice.d.ts +0 -6
- package/dist/types/components/xpl-dropdown/dropdownchoice.d.ts +0 -6
- package/dist/types/components/xpl-dropdown/xpl-dropdown.d.ts +0 -10
- package/dist/types/components/xpl-list/listitem.d.ts +0 -16
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement } from './index-3df6db84.js';
|
|
2
|
+
|
|
3
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
4
|
+
var t = {};
|
|
5
|
+
for (var p in s)
|
|
6
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
9
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
10
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
11
|
+
t[p[i]] = s[p[i]];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
const XplDropdownGroup = class {
|
|
16
|
+
constructor(hostRef) {
|
|
17
|
+
registerInstance(this, hostRef);
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
const { groupName, options } = this;
|
|
21
|
+
const hasOptions = options && options.length;
|
|
22
|
+
const mappedOptions = hasOptions &&
|
|
23
|
+
options.map((_a) => {
|
|
24
|
+
var { groupName } = _a, properties = __rest(_a, ["groupName"]);
|
|
25
|
+
return groupName ? (h("xpl-dropdown-group", Object.assign({ label: groupName }, properties))) : (h("xpl-dropdown-option", Object.assign({}, properties)));
|
|
26
|
+
});
|
|
27
|
+
return (h(Host, { role: "group", "aria-label": groupName }, h("li", { class: "xpl-dropdown-list-item" }, h("xpl-dropdown-heading", { label: groupName }), h("ul", { class: "xpl-dropdown-list" }, mappedOptions || h("slot", { name: "options" })))));
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const XplDropdownHeading = class {
|
|
32
|
+
constructor(hostRef) {
|
|
33
|
+
registerInstance(this, hostRef);
|
|
34
|
+
}
|
|
35
|
+
render() {
|
|
36
|
+
return (h(Host, { class: { 'xpl-dropdown-heading': true }, role: "presentation" }, h("span", null, this.label || h("slot", { name: "heading" }))));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const XplDropdownOption = class {
|
|
41
|
+
constructor(hostRef) {
|
|
42
|
+
registerInstance(this, hostRef);
|
|
43
|
+
}
|
|
44
|
+
componentWillLoad() {
|
|
45
|
+
this.dropdown = this.hostElement.closest('xpl-dropdown');
|
|
46
|
+
}
|
|
47
|
+
handleClick(ev) {
|
|
48
|
+
const { closeOnSelect, mode } = this.dropdown;
|
|
49
|
+
if (Boolean(ev.x && ev.y)) {
|
|
50
|
+
this.dropdown.handleSelect(ev, { component: this });
|
|
51
|
+
if (mode === 'single' && closeOnSelect)
|
|
52
|
+
this.dropdown.isOpen = false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
handleKeyup(ev) {
|
|
56
|
+
const { dropdown } = this;
|
|
57
|
+
const navigationKeys = [
|
|
58
|
+
'ArrowDown',
|
|
59
|
+
'ArrowLeft',
|
|
60
|
+
'ArrowRight',
|
|
61
|
+
'ArrowUp',
|
|
62
|
+
'Tab',
|
|
63
|
+
];
|
|
64
|
+
const { closeOnSelect, mode, selectOnFocus } = this.dropdown;
|
|
65
|
+
if (selectOnFocus && navigationKeys.includes(ev.key)) {
|
|
66
|
+
const hostElement = document.activeElement.closest('xpl-dropdown-option');
|
|
67
|
+
dropdown.handleSelect(ev, { component: { hostElement } });
|
|
68
|
+
if (mode === 'single' && closeOnSelect)
|
|
69
|
+
this.dropdown.isOpen = false;
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const selectionKeys = ['Escape', 'Enter'];
|
|
73
|
+
if (selectionKeys.includes(ev.key)) {
|
|
74
|
+
dropdown.handleSelect(ev, { component: this });
|
|
75
|
+
if (this.dropdown.closeOnSelect)
|
|
76
|
+
this.dropdown.isOpen = false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
connectedCallback() {
|
|
80
|
+
this.hostElement.addEventListener('click', this.handleClick.bind(this));
|
|
81
|
+
this.hostElement.addEventListener('keyup', this.handleKeyup.bind(this));
|
|
82
|
+
}
|
|
83
|
+
disconnectedCallback() {
|
|
84
|
+
this.hostElement.removeEventListener('click', this.handleClick);
|
|
85
|
+
this.hostElement.removeEventListener('keyup', this.handleKeyup);
|
|
86
|
+
}
|
|
87
|
+
render() {
|
|
88
|
+
const { label, isSelected, isDisabled } = this;
|
|
89
|
+
return (h(Host, { class: {
|
|
90
|
+
'xpl-dropdown-option': true,
|
|
91
|
+
'xpl-dropdown-option--disabled': isDisabled,
|
|
92
|
+
'xpl-dropdown-option--selected': isSelected,
|
|
93
|
+
}, role: "option", "aria-checked": isSelected, "aria-disabled": isDisabled, "aria-selected": isSelected }, h("li", { class: "xpl-dropdown-list-item" }, label || h("slot", { name: "option" }))));
|
|
94
|
+
}
|
|
95
|
+
get hostElement() { return getElement(this); }
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export { XplDropdownGroup as xpl_dropdown_group, XplDropdownHeading as xpl_dropdown_heading, XplDropdownOption as xpl_dropdown_option };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-3df6db84.js';
|
|
2
|
+
|
|
3
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
4
|
+
var t = {};
|
|
5
|
+
for (var p in s)
|
|
6
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
9
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
10
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
11
|
+
t[p[i]] = s[p[i]];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
const XplDropdown = class {
|
|
16
|
+
constructor(hostRef) {
|
|
17
|
+
registerInstance(this, hostRef);
|
|
18
|
+
/** text to display as heading */
|
|
19
|
+
// eslint-disable-next-line @stencil/strict-mutable
|
|
20
|
+
this.isOpen = false;
|
|
21
|
+
/** options that are listed */
|
|
22
|
+
this.closeOnSelect = true;
|
|
23
|
+
/** constant representing number of options that can be selected */
|
|
24
|
+
this.mode = 'single';
|
|
25
|
+
/** whether selection should be made when focusing on interactable element */
|
|
26
|
+
this.selectOnFocus = false;
|
|
27
|
+
this.handleClickOutside = ({ target }) => {
|
|
28
|
+
const { triggerId } = this;
|
|
29
|
+
const isTrigger = triggerId && target.id === triggerId;
|
|
30
|
+
const isInside = this.hostElement.contains(target);
|
|
31
|
+
if (!isInside && !isTrigger)
|
|
32
|
+
this.isOpen = false;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* called on dropdown option click and keydown events to update isSelected states
|
|
37
|
+
*/
|
|
38
|
+
async handleSelect(e, { component }) {
|
|
39
|
+
const { hostElement, mode, options, update } = this;
|
|
40
|
+
const isSingle = mode === 'single';
|
|
41
|
+
const isMulti = mode === 'multi';
|
|
42
|
+
if (Boolean(options)) {
|
|
43
|
+
options
|
|
44
|
+
.reduce((acc, curr) => [
|
|
45
|
+
...acc,
|
|
46
|
+
...(curr.groupName ? curr.options : [curr]),
|
|
47
|
+
], [])
|
|
48
|
+
.forEach((option) => {
|
|
49
|
+
const isMatch = option.label === component.hostElement.label;
|
|
50
|
+
if (isSingle) {
|
|
51
|
+
option.isSelected = isMatch;
|
|
52
|
+
component.hostElement.isSelected = option.isSelected;
|
|
53
|
+
}
|
|
54
|
+
else if (isMulti && isMatch) {
|
|
55
|
+
option.isSelected = !option.isSelected;
|
|
56
|
+
component.hostElement.isSelected = option.isSelected;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
const mapOptions = (option) => {
|
|
60
|
+
option.options = option.groupName
|
|
61
|
+
? option.options.map(mapOptions)
|
|
62
|
+
: undefined;
|
|
63
|
+
return option;
|
|
64
|
+
};
|
|
65
|
+
this.options = options.map(mapOptions);
|
|
66
|
+
}
|
|
67
|
+
else if (isSingle) {
|
|
68
|
+
const optionNodes = Array.from(hostElement.querySelectorAll('xpl-dropdown-option'));
|
|
69
|
+
optionNodes.forEach((node) => (node.isSelected = node === component.hostElement));
|
|
70
|
+
}
|
|
71
|
+
else if (isMulti) {
|
|
72
|
+
component.isSelected = !component.isSelected;
|
|
73
|
+
}
|
|
74
|
+
if (Boolean(update))
|
|
75
|
+
update(e, { component: this });
|
|
76
|
+
}
|
|
77
|
+
componentWillLoad() {
|
|
78
|
+
this.handleSelect = this.handleSelect.bind(this);
|
|
79
|
+
}
|
|
80
|
+
connectedCallback() {
|
|
81
|
+
document.addEventListener('mousedown', this.handleClickOutside.bind(this));
|
|
82
|
+
}
|
|
83
|
+
disconnectedCallback() {
|
|
84
|
+
document.removeEventListener('mousedown', this.handleClickOutside);
|
|
85
|
+
}
|
|
86
|
+
render() {
|
|
87
|
+
let { isOpen } = this;
|
|
88
|
+
const { mode, options } = this;
|
|
89
|
+
const hasOptions = options && options.length;
|
|
90
|
+
const mappedOptions = hasOptions &&
|
|
91
|
+
options.map((_a) => {
|
|
92
|
+
var { groupName, options } = _a, properties = __rest(_a, ["groupName", "options"]);
|
|
93
|
+
return groupName ? (h("xpl-dropdown-group", Object.assign({ groupName: groupName, options: options }, properties))) : (h("xpl-dropdown-option", Object.assign({}, properties)));
|
|
94
|
+
});
|
|
95
|
+
return (h(Host, { "aria-expanded": isOpen, class: {
|
|
96
|
+
'xpl-dropdown': true,
|
|
97
|
+
'xpl-dropdown--multi': mode === 'multi',
|
|
98
|
+
'xpl-dropdown--open': isOpen,
|
|
99
|
+
}, role: "listbox" }, h("ul", { class: "xpl-dropdown-list" }, mappedOptions || h("slot", { name: "options" }))));
|
|
100
|
+
}
|
|
101
|
+
get hostElement() { return getElement(this); }
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const XplTag = class {
|
|
105
|
+
constructor(hostRef) {
|
|
106
|
+
registerInstance(this, hostRef);
|
|
107
|
+
this.close = createEvent(this, "close", 7);
|
|
108
|
+
}
|
|
109
|
+
render() {
|
|
110
|
+
return (h(Host, { class: "xpl-tag-container" }, h("button", { class: "xpl-tag", onClick: () => {
|
|
111
|
+
this.close.emit();
|
|
112
|
+
} }, h("slot", null)), h("button", { class: "xpl-tag__close", onClick: () => {
|
|
113
|
+
this.close.emit();
|
|
114
|
+
} }, "\u00D7")));
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export { XplDropdown as xpl_dropdown, XplTag as xpl_tag };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-3df6db84.js';
|
|
2
2
|
|
|
3
3
|
const XplGridItem = class {
|
|
4
4
|
constructor(hostRef) {
|
|
@@ -9,7 +9,7 @@ const XplGridItem = class {
|
|
|
9
9
|
this.lg = 6;
|
|
10
10
|
}
|
|
11
11
|
render() {
|
|
12
|
-
let className =
|
|
12
|
+
let className = 'xpl-grid-item';
|
|
13
13
|
className += ` xpl-grid-item-xs-${this.xs}`;
|
|
14
14
|
className += ` xpl-grid-item-sm-${this.sm}`;
|
|
15
15
|
className += ` xpl-grid-item-md-${this.md}`;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { r as registerInstance, h, g as getElement, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, h, g as getElement, H as Host } from './index-3df6db84.js';
|
|
2
2
|
|
|
3
3
|
const XplGrid = class {
|
|
4
4
|
constructor(hostRef) {
|
|
5
5
|
registerInstance(this, hostRef);
|
|
6
6
|
}
|
|
7
7
|
componentDidLoad() {
|
|
8
|
-
const items = Array.from(this.container.querySelectorAll(
|
|
8
|
+
const items = Array.from(this.container.querySelectorAll('.xpl-grid-item'));
|
|
9
9
|
let lgCounter = 0, mdCounter = 0, smCounter = 0, xsCounter = 0;
|
|
10
|
-
items.forEach(item => {
|
|
11
|
-
lgCounter += +item.getAttribute(
|
|
12
|
-
mdCounter += +item.getAttribute(
|
|
13
|
-
smCounter += +item.getAttribute(
|
|
14
|
-
xsCounter += +item.getAttribute(
|
|
10
|
+
items.forEach((item) => {
|
|
11
|
+
lgCounter += +item.getAttribute('lg') || 6;
|
|
12
|
+
mdCounter += +item.getAttribute('md') || 6;
|
|
13
|
+
smCounter += +item.getAttribute('sm') || 6;
|
|
14
|
+
xsCounter += +item.getAttribute('xs') || 6;
|
|
15
15
|
if (lgCounter % 6 === 0)
|
|
16
|
-
item.classList.add(
|
|
16
|
+
item.classList.add('xpl-grid-item-lg-last');
|
|
17
17
|
if (mdCounter % 6 === 0)
|
|
18
|
-
item.classList.add(
|
|
18
|
+
item.classList.add('xpl-grid-item-md-last');
|
|
19
19
|
if (smCounter % 6 === 0)
|
|
20
|
-
item.classList.add(
|
|
20
|
+
item.classList.add('xpl-grid-item-sm-last');
|
|
21
21
|
if (xsCounter % 6 === 0)
|
|
22
|
-
item.classList.add(
|
|
22
|
+
item.classList.add('xpl-grid-item-xs-last');
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
render() {
|
|
26
|
-
return
|
|
26
|
+
return h(Host, { class: "xpl-grid" });
|
|
27
27
|
}
|
|
28
28
|
get container() { return getElement(this); }
|
|
29
29
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-3df6db84.js';
|
|
2
2
|
import './regular-86225e9d.js';
|
|
3
3
|
import { v as v4 } from './v4-929670b7.js';
|
|
4
4
|
|
|
@@ -2441,27 +2441,29 @@ if (typeof window !== "undefined") {
|
|
|
2441
2441
|
window.flatpickr = flatpickr;
|
|
2442
2442
|
}
|
|
2443
2443
|
|
|
2444
|
-
const arrowSvg = (rotate = false) => `<svg width="8" height="12" viewBox="0 0 8 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="${rotate
|
|
2444
|
+
const arrowSvg = (rotate = false) => `<svg width="8" height="12" viewBox="0 0 8 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="${rotate
|
|
2445
|
+
? 'M0.557948 5.6813L6.06209 0.132167C6.23831 -0.0440556 6.52327 -0.0440556 6.69949 0.132167L7.44187 0.874551C7.61809 1.05077 7.61809 1.33573 7.44187 1.51195L2.99882 6L7.44187 10.488C7.61809 10.6643 7.61809 10.9492 7.44187 11.1254L6.69949 11.8678C6.52327 12.0441 6.23831 12.0441 6.06209 11.8678L0.557948 6.3187C0.381726 6.14248 0.381726 5.85752 0.557948 5.6813Z'
|
|
2446
|
+
: 'M7.44187 6.3187L1.93773 11.8678C1.76151 12.0441 1.47655 12.0441 1.30033 11.8678L0.557948 11.1254C0.381726 10.9492 0.381726 10.6643 0.557948 10.488L5.001 6L0.557948 1.51195C0.381726 1.33573 0.381726 1.05077 0.557948 0.874551L1.30033 0.132167C1.47655 -0.0440556 1.76151 -0.0440556 1.93773 0.132167L7.44187 5.6813C7.6181 5.85752 7.6181 6.14248 7.44187 6.3187Z'}" /></svg>`;
|
|
2445
2447
|
const XplInput = class {
|
|
2446
2448
|
constructor(hostRef) {
|
|
2447
2449
|
registerInstance(this, hostRef);
|
|
2448
2450
|
/**
|
|
2449
2451
|
* See https://flatpickr.js.org/formatting/
|
|
2450
2452
|
*/
|
|
2451
|
-
this.dateFormat =
|
|
2453
|
+
this.dateFormat = 'Y-m-d';
|
|
2452
2454
|
/**
|
|
2453
2455
|
* For datepicker inputs, whether to allow only a single
|
|
2454
2456
|
* date or a range of dates. (Multiple non-consecutive
|
|
2455
2457
|
* dates planned to be supported in the future.)
|
|
2456
2458
|
*/
|
|
2457
|
-
this.mode =
|
|
2459
|
+
this.mode = 'single';
|
|
2458
2460
|
/**
|
|
2459
2461
|
* Whether to render as a singleline text input or
|
|
2460
2462
|
* as a multiline textarea. (If `true`, `pre` and `post`
|
|
2461
2463
|
* values will be ignored, if present.)
|
|
2462
2464
|
*/
|
|
2463
2465
|
this.multiline = false;
|
|
2464
|
-
this.type =
|
|
2466
|
+
this.type = 'text';
|
|
2465
2467
|
this.characterCount = 0;
|
|
2466
2468
|
this.passwordVisible = false;
|
|
2467
2469
|
}
|
|
@@ -2469,14 +2471,15 @@ const XplInput = class {
|
|
|
2469
2471
|
this.characterCount = this.input.value.length;
|
|
2470
2472
|
}
|
|
2471
2473
|
componentWillLoad() {
|
|
2472
|
-
if (this._id === undefined || this._id === null || this._id ===
|
|
2474
|
+
if (this._id === undefined || this._id === null || this._id === '')
|
|
2473
2475
|
this._id = v4();
|
|
2474
2476
|
if (this.multiline && this.maxCharacterCount !== undefined) {
|
|
2475
|
-
this.characterCount =
|
|
2477
|
+
this.characterCount =
|
|
2478
|
+
this.value !== undefined ? this.value.length : 0;
|
|
2476
2479
|
}
|
|
2477
2480
|
}
|
|
2478
2481
|
componentDidLoad() {
|
|
2479
|
-
if (this.type ===
|
|
2482
|
+
if (this.type === 'date') {
|
|
2480
2483
|
flatpickr(this.input, {
|
|
2481
2484
|
allowInput: true,
|
|
2482
2485
|
dateFormat: this.dateFormat,
|
|
@@ -2485,38 +2488,42 @@ const XplInput = class {
|
|
|
2485
2488
|
minDate: this.min,
|
|
2486
2489
|
mode: this.mode,
|
|
2487
2490
|
nextArrow: arrowSvg(),
|
|
2488
|
-
prevArrow: arrowSvg(true)
|
|
2491
|
+
prevArrow: arrowSvg(true),
|
|
2489
2492
|
});
|
|
2490
2493
|
}
|
|
2491
2494
|
}
|
|
2492
2495
|
render() {
|
|
2493
|
-
let className =
|
|
2496
|
+
let className = 'xpl-input';
|
|
2494
2497
|
if (this.disabled)
|
|
2495
|
-
className +=
|
|
2498
|
+
className += ' xpl-input--disabled';
|
|
2496
2499
|
let hasError = false;
|
|
2497
2500
|
if (this.error !== undefined)
|
|
2498
2501
|
hasError = true;
|
|
2499
|
-
if (this.multiline &&
|
|
2502
|
+
if (this.multiline &&
|
|
2503
|
+
this.maxCharacterCount !== undefined &&
|
|
2504
|
+
this.characterCount > this.maxCharacterCount)
|
|
2500
2505
|
hasError = true;
|
|
2501
2506
|
if (hasError)
|
|
2502
|
-
className +=
|
|
2507
|
+
className += ' xpl-input--error';
|
|
2503
2508
|
let type = this.type;
|
|
2504
|
-
if (type ===
|
|
2505
|
-
type =
|
|
2506
|
-
}
|
|
2507
|
-
return (h(Host, { class: className }, h("label", { class: "xpl-input-label", htmlFor: this._id }, this.label, this.description && h("small", null, this.description)), h("div", { class: "xpl-input-wrapper" }, this.pre && !this.multiline && h("label", { class: "xpl-input-pre", htmlFor: this._id }, this.pre), !this.multiline ?
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
this.input = el;
|
|
2513
|
-
}, required: this.required }, this.value), this.type === "date" && h("span", { class: "xpl-input-calendar" }, h("i", { class: "far fa-calendar-alt" })), this.type === "password" && h("button", { class: "xpl-input-password", onClick: () => {
|
|
2509
|
+
if (type === 'password' && this.passwordVisible) {
|
|
2510
|
+
type = 'text';
|
|
2511
|
+
}
|
|
2512
|
+
return (h(Host, { class: className }, h("label", { class: "xpl-input-label", htmlFor: this._id }, this.label, this.description && h("small", null, this.description)), h("div", { class: "xpl-input-wrapper" }, this.pre && !this.multiline && (h("label", { class: "xpl-input-pre", htmlFor: this._id }, this.pre)), !this.multiline ? (h("input", { autocomplete: this.type === 'date' ? 'off' : this.autocomplete, disabled: this.disabled, id: this._id, max: this.max, min: this.min, name: this.name, placeholder: this.placeholder, readonly: this.readonly, ref: (el) => {
|
|
2513
|
+
this.input = el;
|
|
2514
|
+
}, required: this.required, step: this.step, type: type, value: this.value })) : (h("textarea", { disabled: this.disabled, id: this._id, name: this.name, onInput: () => this.updateCharacterCount(), placeholder: this.placeholder, readonly: this.readonly, ref: (el) => {
|
|
2515
|
+
this.input = el;
|
|
2516
|
+
}, required: this.required }, this.value)), this.type === 'date' && (h("span", { class: "xpl-input-calendar" }, h("i", { class: "far fa-calendar-alt" }))), this.type === 'password' && (h("button", { class: "xpl-input-password", onClick: () => {
|
|
2514
2517
|
this.passwordVisible = !this.passwordVisible;
|
|
2515
2518
|
}, role: "presentation" }, h("span", { class: "sr-only" }, "Toggle password visibility"), h("i", { class: "far fa-eye", style: {
|
|
2516
|
-
display: this.passwordVisible
|
|
2519
|
+
display: this.passwordVisible
|
|
2520
|
+
? 'none'
|
|
2521
|
+
: 'block',
|
|
2517
2522
|
} }), h("i", { class: "far fa-eye-slash", style: {
|
|
2518
|
-
display: this.passwordVisible
|
|
2519
|
-
|
|
2523
|
+
display: this.passwordVisible
|
|
2524
|
+
? 'block'
|
|
2525
|
+
: 'none',
|
|
2526
|
+
} }))), this.post && !this.multiline && (h("label", { class: "xpl-input-post", htmlFor: this._id }, this.post)), this.multiline && this.maxCharacterCount !== undefined && (h("span", { class: "xpl-input-characters" }, this.characterCount, "/", this.maxCharacterCount))), this.error !== undefined && this.error.length > 0 && (h("label", { class: "xpl-input-error", htmlFor: this._id }, h("svg", { width: "10", height: "11", viewBox: "0 0 10 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M9.84375 5.25C9.84375 2.59375 7.65625 0.40625 5 0.40625C2.32422 0.40625 0.15625 2.59375 0.15625 5.25C0.15625 7.92578 2.32422 10.0938 5 10.0938C7.65625 10.0938 9.84375 7.92578 9.84375 5.25ZM5 6.22656C5.48828 6.22656 5.89844 6.63672 5.89844 7.125C5.89844 7.63281 5.48828 8.02344 5 8.02344C4.49219 8.02344 4.10156 7.63281 4.10156 7.125C4.10156 6.63672 4.49219 6.22656 5 6.22656ZM4.14062 3.00391C4.12109 2.86719 4.23828 2.75 4.375 2.75H5.60547C5.74219 2.75 5.85938 2.86719 5.83984 3.00391L5.70312 5.66016C5.68359 5.79688 5.58594 5.875 5.46875 5.875H4.51172C4.39453 5.875 4.29688 5.79688 4.27734 5.66016L4.14062 3.00391Z" })), this.error))));
|
|
2520
2527
|
}
|
|
2521
2528
|
};
|
|
2522
2529
|
|
|
@@ -1,28 +1,26 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, F as Fragment } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host, F as Fragment } from './index-3df6db84.js';
|
|
2
2
|
import './regular-86225e9d.js';
|
|
3
3
|
|
|
4
|
-
const ListItemCpt = ({ avatar, avatars, badges, href, title, subtext, metadata }) => {
|
|
4
|
+
const ListItemCpt = ({ avatar, avatars, badges, href, title, subtext, metadata, }) => {
|
|
5
5
|
const hasRight = avatars || badges || subtext;
|
|
6
|
-
const inner = (h(Fragment, null, avatar &&
|
|
7
|
-
h("xpl-avatar", { src: avatar, name: title }) :
|
|
8
|
-
|
|
9
|
-
if (typeof d === "string") {
|
|
6
|
+
const inner = (h(Fragment, null, avatar &&
|
|
7
|
+
(avatar.slice(0, 1) === '/' || avatar.slice(0, 4) === 'http' ? (h("xpl-avatar", { src: avatar, name: title })) : (h("xpl-avatar", { name: title }, avatar))), h("div", { class: "xpl-list-item-content" }, h("div", { class: "xpl-list-left" }, h("div", null, h("h4", null, title), metadata && (h("ul", { class: "xpl-list-item-metadata" }, metadata.map((d) => {
|
|
8
|
+
if (typeof d === 'string') {
|
|
10
9
|
return h("li", null, d);
|
|
11
10
|
}
|
|
12
11
|
else {
|
|
13
|
-
return h("li", null, h("span", { class: `far fa-${d.icon}` }),
|
|
12
|
+
return (h("li", null, h("span", { class: `far fa-${d.icon}` }), ' ', d.text));
|
|
14
13
|
}
|
|
15
|
-
}))))), hasRight && (h("div", { class: "xpl-list-right" }, subtext && h("div", { class: "xpl-list-item-subtext" }, subtext), avatars && (h("div", { class: "xpl-avatar-group xpl-avatar-group--s" }, avatars.map(a => h("img", { src: a, alt: "" })))), badges &&
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
h("div", { class: "xpl-list-item" }, inner);
|
|
14
|
+
}))))), hasRight && (h("div", { class: "xpl-list-right" }, subtext && (h("div", { class: "xpl-list-item-subtext" }, subtext)), avatars && (h("div", { class: "xpl-avatar-group xpl-avatar-group--s" }, avatars.map((a) => (h("img", { src: a, alt: "" }))))), badges &&
|
|
15
|
+
badges.map((b) => {
|
|
16
|
+
if (typeof b === 'string') {
|
|
17
|
+
return h("xpl-badge", null, b);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
return (h("xpl-badge", { dot: b.dot, variant: b.variant }, b.text));
|
|
21
|
+
}
|
|
22
|
+
}))))));
|
|
23
|
+
return href ? (h("a", { class: "xpl-list-item", href: href }, inner)) : (h("div", { class: "xpl-list-item" }, inner));
|
|
26
24
|
};
|
|
27
25
|
const XplList = class {
|
|
28
26
|
constructor(hostRef) {
|
|
@@ -52,7 +50,7 @@ const XplList = class {
|
|
|
52
50
|
this.items = [];
|
|
53
51
|
}
|
|
54
52
|
render() {
|
|
55
|
-
return (h(Host, null, this.items.map(item => h(ListItemCpt, Object.assign({}, item)))));
|
|
53
|
+
return (h(Host, null, this.items.map((item) => (h(ListItemCpt, Object.assign({}, item))))));
|
|
56
54
|
}
|
|
57
55
|
};
|
|
58
56
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-3df6db84.js';
|
|
2
|
+
|
|
3
|
+
const XplMainNav = class {
|
|
4
|
+
constructor(hostRef) {
|
|
5
|
+
registerInstance(this, hostRef);
|
|
6
|
+
this.navWidth = createEvent(this, "navWidth", 7);
|
|
7
|
+
/**
|
|
8
|
+
* @property {string} width - The width of the Main Nav.
|
|
9
|
+
*/
|
|
10
|
+
this.width = 'default';
|
|
11
|
+
}
|
|
12
|
+
navWidthHandler() {
|
|
13
|
+
this.navWidth.emit(this.width);
|
|
14
|
+
}
|
|
15
|
+
connectedCallback() {
|
|
16
|
+
this.navWidthHandler();
|
|
17
|
+
}
|
|
18
|
+
componentDidUpdate() {
|
|
19
|
+
this.navWidthHandler();
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
return (h(Host, { class: `xpl-main-nav xpl-main-nav--${this.width}`, "aria-label": "Sidebar" }, h("nav", null, h("header", { "aria-label": "Sidebar Header" }, h("slot", { name: "logo" }), h("slot", { name: "brand-name" })), h("div", { class: "xpl-main-nav__main_section" }, h("slot", { name: "navigation" })), h("footer", { class: "xpl-main-nav__footer", "aria-label": "Sidebar Footer" }, h("slot", { name: "footer" })))));
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { XplMainNav as xpl_main_nav };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-3df6db84.js';
|
|
2
2
|
|
|
3
3
|
const XplPagination = class {
|
|
4
4
|
constructor(hostRef) {
|
|
@@ -42,29 +42,29 @@ const XplPagination = class {
|
|
|
42
42
|
if (numPages < 7)
|
|
43
43
|
showing = [1, 2, 3, 4, 5, 6];
|
|
44
44
|
if (this.current <= 3 || this.current >= numPages - 2) {
|
|
45
|
-
showing = [1, 2, 3,
|
|
45
|
+
showing = [1, 2, 3, '...', numPages - 2, numPages - 1, numPages];
|
|
46
46
|
}
|
|
47
47
|
else {
|
|
48
48
|
showing = [
|
|
49
49
|
1,
|
|
50
|
-
|
|
50
|
+
'...',
|
|
51
51
|
this.current - 1,
|
|
52
52
|
this.current,
|
|
53
53
|
this.current + 1,
|
|
54
|
-
|
|
54
|
+
'...',
|
|
55
55
|
numPages,
|
|
56
56
|
];
|
|
57
57
|
}
|
|
58
58
|
const showingFirst = (this.current - 1) * this.perPage + 1;
|
|
59
59
|
const showingLast = Math.min(showingFirst + this.perPage - 1, this.total);
|
|
60
|
-
return (h(Host, null, h("div", { class: "xpl-pagination" }, h("div", null, h("p", null, "Showing ", h("span", null, showingFirst), " to
|
|
61
|
-
if (n ===
|
|
62
|
-
return h("span", { class: "xpl-pagination-ellipsis" }, "...");
|
|
60
|
+
return (h(Host, null, h("div", { class: "xpl-pagination" }, h("div", null, h("p", null, "Showing ", h("span", null, showingFirst), " to", ' ', h("span", null, showingLast), " of", ' ', h("span", null, this.total), " results")), h("div", null, h("nav", { "aria-label": "Pagination" }, h("button", { onClick: this.goPrev, class: "xpl-pagination-prev" }, h("span", null, "Previous"), h("svg", { viewBox: "0 0 20 20", "aria-hidden": "true" }, 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" }))), showing.map((n) => {
|
|
61
|
+
if (n === '...') {
|
|
62
|
+
return (h("span", { class: "xpl-pagination-ellipsis" }, "..."));
|
|
63
63
|
}
|
|
64
64
|
if (n === this.current) {
|
|
65
65
|
return (h("button", { "aria-current": "page", class: "xpl-pagination-current" }, n));
|
|
66
66
|
}
|
|
67
|
-
return h("button", { onClick: () => this._goto(n) }, n);
|
|
67
|
+
return (h("button", { onClick: () => this._goto(n) }, n));
|
|
68
68
|
}), h("button", { onClick: this.goNext, class: "xpl-pagination-next" }, h("span", null, "Next"), h("svg", { viewBox: "0 0 20 20", "aria-hidden": "true" }, 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" }))))))));
|
|
69
69
|
}
|
|
70
70
|
};
|