@xplortech/apollo-core 1.0.0-beta.5 → 1.0.0-beta.6
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 +1 -1
- package/dist/apollo-core/apollo-core.css +9 -5841
- package/dist/apollo-core/apollo-core.esm.js +1 -125
- package/dist/apollo-core/index.esm.js +0 -1
- package/dist/apollo-core/p-ee16942f.entry.js +1 -0
- package/dist/cjs/apollo-core.cjs.js +4 -112
- package/dist/cjs/index.cjs.js +0 -1
- package/dist/cjs/loader.cjs.js +2 -18
- package/dist/cjs/xpl-application-shell.cjs.entry.js +1 -1
- package/dist/cjs/xpl-avatar_12.cjs.entry.js +17 -17
- package/dist/cjs/xpl-backdrop.cjs.entry.js +1 -1
- package/dist/cjs/xpl-button-row.cjs.entry.js +1 -1
- package/dist/cjs/xpl-choicelist.cjs.entry.js +1 -1
- package/dist/cjs/xpl-divider.cjs.entry.js +1 -1
- package/dist/cjs/xpl-dropdown-group_3.cjs.entry.js +4 -1
- package/dist/cjs/xpl-dropdown_2.cjs.entry.js +1 -2
- package/dist/cjs/xpl-grid-item.cjs.entry.js +1 -1
- package/dist/cjs/xpl-grid.cjs.entry.js +1 -1
- package/dist/cjs/xpl-input.cjs.entry.js +4 -21
- package/dist/cjs/xpl-list.cjs.entry.js +2 -2
- package/dist/cjs/xpl-main-nav.cjs.entry.js +1 -1
- package/dist/cjs/xpl-pagination.cjs.entry.js +1 -1
- package/dist/cjs/xpl-select.cjs.entry.js +3 -44
- package/dist/cjs/xpl-toggle.cjs.entry.js +3 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/xpl-choicelist/choice.js +1 -0
- package/dist/collection/components/xpl-choicelist/xpl-choicelist.js +3 -3
- package/dist/collection/components/xpl-dropdown/dropdownoption.js +1 -0
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.js +2 -1
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.js +4 -1
- package/dist/collection/components/xpl-dropdown/xpl-dropdown.js +16 -8
- package/dist/collection/components/xpl-list/listitem.js +1 -0
- package/dist/collection/components/xpl-list/xpl-list.js +2 -2
- package/dist/collection/components/xpl-select/selectchoice.js +1 -0
- package/dist/collection/components/xpl-select/xpl-select.js +2 -1
- package/dist/collection/components/xpl-table/xpl-table.js +17 -17
- package/dist/custom-elements/index.js +23 -604
- package/dist/esm/apollo-core.js +4 -112
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +2 -18
- package/dist/esm/xpl-application-shell.entry.js +1 -1
- package/dist/esm/xpl-avatar_12.entry.js +17 -17
- package/dist/esm/xpl-backdrop.entry.js +1 -1
- package/dist/esm/xpl-button-row.entry.js +1 -1
- package/dist/esm/xpl-choicelist.entry.js +1 -1
- package/dist/esm/xpl-divider.entry.js +1 -1
- package/dist/esm/xpl-dropdown-group_3.entry.js +4 -1
- package/dist/esm/xpl-dropdown_2.entry.js +1 -2
- package/dist/esm/xpl-grid-item.entry.js +1 -1
- package/dist/esm/xpl-grid.entry.js +1 -1
- package/dist/esm/xpl-input.entry.js +3 -20
- package/dist/esm/xpl-list.entry.js +2 -2
- package/dist/esm/xpl-main-nav.entry.js +1 -1
- package/dist/esm/xpl-pagination.entry.js +1 -1
- package/dist/esm/xpl-select.entry.js +2 -43
- package/dist/esm/xpl-toggle.entry.js +2 -2
- package/dist/types/components/xpl-choicelist/choice.d.ts +5 -5
- package/dist/types/components/xpl-choicelist/xpl-choicelist.d.ts +2 -1
- package/dist/types/components/xpl-dropdown/dropdownoption.d.ts +8 -10
- package/dist/types/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.d.ts +1 -0
- package/dist/types/components/xpl-dropdown/xpl-dropdown.d.ts +6 -4
- package/dist/types/components/xpl-list/listitem.d.ts +15 -19
- package/dist/types/components/xpl-list/xpl-list.d.ts +1 -0
- package/dist/types/components/xpl-select/selectchoice.d.ts +3 -2
- package/dist/types/components/xpl-select/xpl-select.d.ts +1 -0
- package/dist/types/components/xpl-table/xpl-table.d.ts +5 -6
- package/dist/types/components.d.ts +17 -6
- package/package.json +2 -2
- package/dist/apollo-core/app-globals-0f993ce5.js +0 -3
- package/dist/apollo-core/css-shim-bbdf0cc6.js +0 -4
- package/dist/apollo-core/dom-1f98a75f.js +0 -73
- package/dist/apollo-core/index-5b4a209e.js +0 -2938
- package/dist/apollo-core/index-912d1a21.js +0 -584
- package/dist/apollo-core/p-50eb8239.entry.js +0 -1
- package/dist/apollo-core/regular-133c23b5.js +0 -16052
- package/dist/apollo-core/shadow-css-67b66845.js +0 -389
- package/dist/apollo-core/xpl-application-shell.entry.js +0 -60
- package/dist/apollo-core/xpl-avatar.entry.js +0 -19
- package/dist/apollo-core/xpl-backdrop.entry.js +0 -21
- package/dist/apollo-core/xpl-badge.entry.js +0 -17
- package/dist/apollo-core/xpl-breadcrumb-item.entry.js +0 -17
- package/dist/apollo-core/xpl-breadcrumbs.entry.js +0 -12
- package/dist/apollo-core/xpl-button-row.entry.js +0 -18
- package/dist/apollo-core/xpl-button.entry.js +0 -60
- package/dist/apollo-core/xpl-checkbox.entry.js +0 -25
- package/dist/apollo-core/xpl-choicelist.entry.js +0 -39
- package/dist/apollo-core/xpl-content-area.entry.js +0 -16
- package/dist/apollo-core/xpl-divider.entry.js +0 -14
- package/dist/apollo-core/xpl-dropdown-group.entry.js +0 -31
- package/dist/apollo-core/xpl-dropdown-heading.entry.js +0 -12
- package/dist/apollo-core/xpl-dropdown-option.entry.js +0 -61
- package/dist/apollo-core/xpl-dropdown.entry.js +0 -104
- package/dist/apollo-core/xpl-grid-item.entry.js +0 -21
- package/dist/apollo-core/xpl-grid.entry.js +0 -31
- package/dist/apollo-core/xpl-input.entry.js +0 -2547
- package/dist/apollo-core/xpl-list.entry.js +0 -57
- package/dist/apollo-core/xpl-main-nav.entry.js +0 -26
- package/dist/apollo-core/xpl-nav-item.entry.js +0 -26
- package/dist/apollo-core/xpl-pagination.entry.js +0 -72
- package/dist/apollo-core/xpl-radio.entry.js +0 -25
- package/dist/apollo-core/xpl-secondary-nav.entry.js +0 -12
- package/dist/apollo-core/xpl-select.entry.js +0 -662
- package/dist/apollo-core/xpl-table.entry.js +0 -91
- package/dist/apollo-core/xpl-tag.entry.js +0 -17
- package/dist/apollo-core/xpl-toggle.entry.js +0 -30
- package/dist/apollo-core/xpl-utility-bar.entry.js +0 -27
- package/dist/cjs/app-globals-3a1e7e63.js +0 -5
- package/dist/cjs/css-shim-a7379e2b.js +0 -6
- package/dist/cjs/dom-3e7d9c3b.js +0 -75
- package/dist/cjs/index-318d5fc7.js +0 -586
- package/dist/cjs/index-88e58962.js +0 -2975
- package/dist/cjs/regular-503465f4.js +0 -16054
- package/dist/cjs/shadow-css-09555044.js +0 -391
- package/dist/cjs/xpl-avatar.cjs.entry.js +0 -23
- package/dist/cjs/xpl-badge.cjs.entry.js +0 -21
- package/dist/cjs/xpl-breadcrumb-item.cjs.entry.js +0 -21
- package/dist/cjs/xpl-breadcrumbs.cjs.entry.js +0 -16
- package/dist/cjs/xpl-button.cjs.entry.js +0 -64
- package/dist/cjs/xpl-checkbox.cjs.entry.js +0 -29
- package/dist/cjs/xpl-content-area.cjs.entry.js +0 -20
- package/dist/cjs/xpl-dropdown-group.cjs.entry.js +0 -35
- package/dist/cjs/xpl-dropdown-heading.cjs.entry.js +0 -16
- package/dist/cjs/xpl-dropdown-option.cjs.entry.js +0 -65
- package/dist/cjs/xpl-dropdown.cjs.entry.js +0 -108
- package/dist/cjs/xpl-nav-item.cjs.entry.js +0 -30
- package/dist/cjs/xpl-radio.cjs.entry.js +0 -29
- package/dist/cjs/xpl-secondary-nav.cjs.entry.js +0 -16
- package/dist/cjs/xpl-table.cjs.entry.js +0 -95
- package/dist/cjs/xpl-tag.cjs.entry.js +0 -21
- package/dist/cjs/xpl-utility-bar.cjs.entry.js +0 -31
- package/dist/esm/app-globals-0f993ce5.js +0 -3
- package/dist/esm/css-shim-bbdf0cc6.js +0 -4
- package/dist/esm/dom-1f98a75f.js +0 -73
- package/dist/esm/index-5b4a209e.js +0 -2938
- package/dist/esm/index-912d1a21.js +0 -584
- package/dist/esm/regular-133c23b5.js +0 -16052
- package/dist/esm/shadow-css-67b66845.js +0 -389
- package/dist/esm/xpl-avatar.entry.js +0 -19
- package/dist/esm/xpl-badge.entry.js +0 -17
- package/dist/esm/xpl-breadcrumb-item.entry.js +0 -17
- package/dist/esm/xpl-breadcrumbs.entry.js +0 -12
- package/dist/esm/xpl-button.entry.js +0 -60
- package/dist/esm/xpl-checkbox.entry.js +0 -25
- package/dist/esm/xpl-content-area.entry.js +0 -16
- package/dist/esm/xpl-dropdown-group.entry.js +0 -31
- package/dist/esm/xpl-dropdown-heading.entry.js +0 -12
- package/dist/esm/xpl-dropdown-option.entry.js +0 -61
- package/dist/esm/xpl-dropdown.entry.js +0 -104
- package/dist/esm/xpl-nav-item.entry.js +0 -26
- package/dist/esm/xpl-radio.entry.js +0 -25
- package/dist/esm/xpl-secondary-nav.entry.js +0 -12
- package/dist/esm/xpl-table.entry.js +0 -91
- package/dist/esm/xpl-tag.entry.js +0 -17
- package/dist/esm/xpl-utility-bar.entry.js +0 -27
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, e as Host } from './index-5b4a209e.js';
|
|
2
|
-
|
|
3
|
-
const XplChoicelist = class {
|
|
4
|
-
constructor(hostRef) {
|
|
5
|
-
registerInstance(this, hostRef);
|
|
6
|
-
}
|
|
7
|
-
componentWillLoad() {
|
|
8
|
-
this.selected =
|
|
9
|
-
this.choices !== undefined &&
|
|
10
|
-
this.choices !== null &&
|
|
11
|
-
this.choices.length > 0
|
|
12
|
-
? this.choices.map(() => false)
|
|
13
|
-
: [];
|
|
14
|
-
}
|
|
15
|
-
render() {
|
|
16
|
-
let className = 'xpl-choicelist';
|
|
17
|
-
if (this.styled)
|
|
18
|
-
className += ' xpl-choicelist--styled';
|
|
19
|
-
return (h(Host, { class: "xpl-choicelist-container" }, this.heading !== undefined ||
|
|
20
|
-
this.description !== undefined ? (h("div", { class: "xpl-choicelist-heading" }, this.heading && h("h3", null, this.heading), this.description && h("p", null, this.description))) : null, this.choices && (h("ul", { class: className }, this.choices.map(({ children, description, label }, i) => {
|
|
21
|
-
const inner = this.multi ? (h("xpl-checkbox", { description: description, name: this.name, onCheckboxChange: (e) => {
|
|
22
|
-
const { detail } = e;
|
|
23
|
-
this.selected = this.selected.map((v, j) => (i === j ? detail : v));
|
|
24
|
-
} }, label)) : (h("xpl-radio", { description: description, name: this.name, onRadioChange: () => {
|
|
25
|
-
this.selected = this.selected.map((_, j) => i === j);
|
|
26
|
-
} }, label));
|
|
27
|
-
let className = this.styled && this.selected[i]
|
|
28
|
-
? 'selected'
|
|
29
|
-
: '';
|
|
30
|
-
return (h("li", { class: className }, inner, children && (h("ul", null, children.map((child) => {
|
|
31
|
-
const childInner = this
|
|
32
|
-
.multi ? (h("xpl-checkbox", { description: child.description }, child.label)) : (h("xpl-radio", { description: child.description }, child.label));
|
|
33
|
-
return (h("li", null, childInner));
|
|
34
|
-
})))));
|
|
35
|
-
})))));
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export { XplChoicelist as xpl_choicelist };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, e as Host } from './index-5b4a209e.js';
|
|
2
|
-
|
|
3
|
-
const XplContentArea = class {
|
|
4
|
-
constructor(hostRef) {
|
|
5
|
-
registerInstance(this, hostRef);
|
|
6
|
-
/**
|
|
7
|
-
* @property {string} size - The content-area size.
|
|
8
|
-
*/
|
|
9
|
-
this.size = 'wide';
|
|
10
|
-
}
|
|
11
|
-
render() {
|
|
12
|
-
return (h(Host, null, h("main", { class: `xpl-content-area-wrapper xpl-content-area-wrapper__${this.size}` }, h("div", { class: "xpl-content-area" }, h("slot", null)))));
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export { XplContentArea as xpl_content_area };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, e as Host } from './index-5b4a209e.js';
|
|
2
|
-
|
|
3
|
-
const XplDivider = class {
|
|
4
|
-
constructor(hostRef) {
|
|
5
|
-
registerInstance(this, hostRef);
|
|
6
|
-
}
|
|
7
|
-
render() {
|
|
8
|
-
let className = 'xpl-divider';
|
|
9
|
-
className += ` xpl-divider--${this.tier}`;
|
|
10
|
-
return (h(Host, { class: className }, h("span", null, h("slot", null))));
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export { XplDivider as xpl_divider };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, e as Host } from './index-5b4a209e.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
|
-
export { XplDropdownGroup as xpl_dropdown_group };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, e as Host } from './index-5b4a209e.js';
|
|
2
|
-
|
|
3
|
-
const XplDropdownHeading = class {
|
|
4
|
-
constructor(hostRef) {
|
|
5
|
-
registerInstance(this, hostRef);
|
|
6
|
-
}
|
|
7
|
-
render() {
|
|
8
|
-
return (h(Host, { class: { 'xpl-dropdown-heading': true }, role: "presentation" }, h("span", null, this.label || h("slot", { name: "heading" }))));
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export { XplDropdownHeading as xpl_dropdown_heading };
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, e as Host, g as getElement } from './index-5b4a209e.js';
|
|
2
|
-
|
|
3
|
-
const XplDropdownOption = class {
|
|
4
|
-
constructor(hostRef) {
|
|
5
|
-
registerInstance(this, hostRef);
|
|
6
|
-
}
|
|
7
|
-
componentWillLoad() {
|
|
8
|
-
this.dropdown = this.hostElement.closest('xpl-dropdown');
|
|
9
|
-
}
|
|
10
|
-
handleClick(ev) {
|
|
11
|
-
const { closeOnSelect, mode } = this.dropdown;
|
|
12
|
-
if (Boolean(ev.x && ev.y)) {
|
|
13
|
-
this.dropdown.handleSelect(ev, { component: this });
|
|
14
|
-
if (mode === 'single' && closeOnSelect)
|
|
15
|
-
this.dropdown.isOpen = false;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
handleKeyup(ev) {
|
|
19
|
-
const { dropdown } = this;
|
|
20
|
-
const navigationKeys = [
|
|
21
|
-
'ArrowDown',
|
|
22
|
-
'ArrowLeft',
|
|
23
|
-
'ArrowRight',
|
|
24
|
-
'ArrowUp',
|
|
25
|
-
'Tab',
|
|
26
|
-
];
|
|
27
|
-
const { closeOnSelect, mode, selectOnFocus } = this.dropdown;
|
|
28
|
-
if (selectOnFocus && navigationKeys.includes(ev.key)) {
|
|
29
|
-
const hostElement = document.activeElement.closest('xpl-dropdown-option');
|
|
30
|
-
dropdown.handleSelect(ev, { component: { hostElement } });
|
|
31
|
-
if (mode === 'single' && closeOnSelect)
|
|
32
|
-
this.dropdown.isOpen = false;
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
const selectionKeys = ['Escape', 'Enter'];
|
|
36
|
-
if (selectionKeys.includes(ev.key)) {
|
|
37
|
-
dropdown.handleSelect(ev, { component: this });
|
|
38
|
-
if (this.dropdown.closeOnSelect)
|
|
39
|
-
this.dropdown.isOpen = false;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
connectedCallback() {
|
|
43
|
-
this.hostElement.addEventListener('click', this.handleClick.bind(this));
|
|
44
|
-
this.hostElement.addEventListener('keyup', this.handleKeyup.bind(this));
|
|
45
|
-
}
|
|
46
|
-
disconnectedCallback() {
|
|
47
|
-
this.hostElement.removeEventListener('click', this.handleClick);
|
|
48
|
-
this.hostElement.removeEventListener('keyup', this.handleKeyup);
|
|
49
|
-
}
|
|
50
|
-
render() {
|
|
51
|
-
const { label, isSelected, isDisabled } = this;
|
|
52
|
-
return (h(Host, { class: {
|
|
53
|
-
'xpl-dropdown-option': true,
|
|
54
|
-
'xpl-dropdown-option--disabled': isDisabled,
|
|
55
|
-
'xpl-dropdown-option--selected': isSelected,
|
|
56
|
-
}, role: "option", "aria-checked": isSelected, "aria-disabled": isDisabled, "aria-selected": isSelected }, h("li", { class: "xpl-dropdown-list-item" }, label || h("slot", { name: "option" }))));
|
|
57
|
-
}
|
|
58
|
-
get hostElement() { return getElement(this); }
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export { XplDropdownOption as xpl_dropdown_option };
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, e as Host, g as getElement } from './index-5b4a209e.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
|
-
export { XplDropdown as xpl_dropdown };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, e as Host } from './index-5b4a209e.js';
|
|
2
|
-
|
|
3
|
-
const XplGridItem = class {
|
|
4
|
-
constructor(hostRef) {
|
|
5
|
-
registerInstance(this, hostRef);
|
|
6
|
-
this.xs = 6;
|
|
7
|
-
this.sm = 6;
|
|
8
|
-
this.md = 6;
|
|
9
|
-
this.lg = 6;
|
|
10
|
-
}
|
|
11
|
-
render() {
|
|
12
|
-
let className = 'xpl-grid-item';
|
|
13
|
-
className += ` xpl-grid-item-xs-${this.xs}`;
|
|
14
|
-
className += ` xpl-grid-item-sm-${this.sm}`;
|
|
15
|
-
className += ` xpl-grid-item-md-${this.md}`;
|
|
16
|
-
className += ` xpl-grid-item-lg-${this.lg}`;
|
|
17
|
-
return (h(Host, { class: className }, h("slot", null)));
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export { XplGridItem as xpl_grid_item };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, e as Host, g as getElement } from './index-5b4a209e.js';
|
|
2
|
-
|
|
3
|
-
const XplGrid = class {
|
|
4
|
-
constructor(hostRef) {
|
|
5
|
-
registerInstance(this, hostRef);
|
|
6
|
-
}
|
|
7
|
-
componentDidLoad() {
|
|
8
|
-
const items = Array.from(this.container.querySelectorAll('.xpl-grid-item'));
|
|
9
|
-
let lgCounter = 0, mdCounter = 0, smCounter = 0, xsCounter = 0;
|
|
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
|
-
if (lgCounter % 6 === 0)
|
|
16
|
-
item.classList.add('xpl-grid-item-lg-last');
|
|
17
|
-
if (mdCounter % 6 === 0)
|
|
18
|
-
item.classList.add('xpl-grid-item-md-last');
|
|
19
|
-
if (smCounter % 6 === 0)
|
|
20
|
-
item.classList.add('xpl-grid-item-sm-last');
|
|
21
|
-
if (xsCounter % 6 === 0)
|
|
22
|
-
item.classList.add('xpl-grid-item-xs-last');
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
render() {
|
|
26
|
-
return h(Host, { class: "xpl-grid" });
|
|
27
|
-
}
|
|
28
|
-
get container() { return getElement(this); }
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export { XplGrid as xpl_grid };
|