@xplortech/apollo-core 0.4.1 → 0.5.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/CHANGELOG.md +7 -0
- package/build/style.css +291 -104
- package/dist/apollo-core/apollo-core.css +5509 -7
- 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-3eb5568f.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 +52 -0
- package/dist/apollo-core/xpl-avatar.entry.js +19 -0
- package/dist/apollo-core/xpl-backdrop.entry.js +21 -0
- package/dist/apollo-core/xpl-badge.entry.js +17 -0
- 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 -2
- package/dist/apollo-core/xpl-table.entry.js +85 -0
- 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/custom-elements/index.d.ts +6 -0
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/application-shell.stories.d.ts +62 -0
- package/dist/types/components/xpl-application-shell/test/xpl-application-shell.e2e.d.ts +1 -0
- package/dist/types/components/xpl-application-shell/xpl-application-shell.d.ts +24 -0
- package/dist/types/components/xpl-avatar/test/xpl-avatar.e2e.d.ts +1 -0
- package/dist/types/components/xpl-avatar/test/xpl-avatar.spec.d.ts +1 -0
- package/dist/types/components/xpl-backdrop/test/xpl-backdrop.e2e.d.ts +1 -0
- package/dist/types/components/xpl-backdrop/xpl-backdrop.d.ts +5 -0
- package/dist/types/components/xpl-badge/test/xpl-badge.e2e.d.ts +1 -0
- package/dist/types/components/xpl-badge/test/xpl-badge.spec.d.ts +1 -0
- package/dist/types/components/xpl-breadcrumbs/xpl-breadcrumb-item/test/xpl-breadcrumb-item.e2e.d.ts +1 -0
- package/dist/types/components/xpl-breadcrumbs/xpl-breadcrumbs/test/xpl-breadcrumbs.e2e.d.ts +1 -0
- package/dist/types/components/xpl-button/test/xpl-button.e2e.d.ts +1 -0
- package/dist/types/components/xpl-button/test/xpl-button.spec.d.ts +1 -0
- package/dist/types/components/xpl-button-row/test/xpl-button-row.e2e.d.ts +1 -0
- package/dist/types/components/xpl-button-row/test/xpl-button-row.spec.d.ts +1 -0
- package/dist/types/components/xpl-checkbox/test/xpl-checkbox.e2e.d.ts +1 -0
- package/dist/types/components/xpl-checkbox/test/xpl-checkbox.spec.d.ts +1 -0
- package/dist/types/components/xpl-choicelist/test/xpl-choicelist.e2e.d.ts +1 -0
- package/dist/types/components/xpl-choicelist/test/xpl-choicelist.spec.d.ts +1 -0
- package/dist/types/components/xpl-content-area/test/xpl-content-area.e2e.d.ts +1 -0
- package/dist/types/components/xpl-divider/test/xpl-divider.e2e.d.ts +1 -0
- package/dist/types/components/xpl-divider/test/xpl-divider.spec.d.ts +1 -0
- package/dist/types/components/xpl-grid/test/xpl-grid.e2e.d.ts +1 -0
- package/dist/types/components/xpl-grid/test/xpl-grid.spec.d.ts +1 -0
- package/dist/types/components/xpl-grid-item/test/xpl-grid-item.e2e.d.ts +1 -0
- package/dist/types/components/xpl-grid-item/test/xpl-grid-item.spec.d.ts +1 -0
- package/dist/types/components/xpl-input/test/xpl-input.e2e.d.ts +1 -0
- package/dist/types/components/xpl-input/test/xpl-input.spec.d.ts +1 -0
- package/dist/types/components/xpl-list/test/xpl-list.e2e.d.ts +1 -0
- package/dist/types/components/xpl-list/test/xpl-list.spec.d.ts +1 -0
- package/dist/types/components/xpl-main-nav/test/xpl-main-nav.e2e.d.ts +1 -0
- package/dist/types/components/xpl-main-nav/xpl-main-nav.d.ts +9 -0
- package/dist/types/components/xpl-nav-item/test/xpl-nav-item.e2e.d.ts +1 -0
- package/dist/types/components/xpl-pagination/test/xpl-pagination.e2e.d.ts +1 -0
- package/dist/types/components/xpl-pagination/test/xpl-pagination.spec.d.ts +1 -0
- package/dist/types/components/xpl-radio/test/xpl-radio.e2e.d.ts +1 -0
- package/dist/types/components/xpl-radio/test/xpl-radio.spec.d.ts +1 -0
- package/dist/types/components/xpl-secondary-nav/test/secondary-nav.e2e.d.ts +1 -0
- package/dist/types/components/xpl-select/test/xpl-select.e2e.d.ts +1 -0
- package/dist/types/components/xpl-select/test/xpl-select.spec.d.ts +1 -0
- package/dist/types/components/xpl-table/test/xpl-table.e2e.d.ts +1 -0
- package/dist/types/components/xpl-table/test/xpl-table.spec.d.ts +1 -0
- package/dist/types/components/xpl-tag/test/xpl-tag.e2e.d.ts +1 -0
- package/dist/types/components/xpl-tag/test/xpl-tag.spec.d.ts +1 -0
- package/dist/types/components/xpl-toggle/test/xpl-toggle.e2e.d.ts +1 -0
- package/dist/types/components/xpl-toggle/test/xpl-toggle.spec.d.ts +1 -0
- package/dist/types/components/xpl-utility-bar/test/xpl-utility-bar.e2e.d.ts +1 -0
- package/dist/types/components/xpl-utility-bar/xpl-utility-bar.d.ts +12 -0
- package/dist/types/components.d.ts +61 -0
- package/package.json +1 -1
- package/dist/apollo-core/p-0027c582.entry.js +0 -1
- package/dist/apollo-core/p-2c551f4d.entry.js +0 -1
- package/dist/apollo-core/p-2f90296c.js +0 -10
- package/dist/apollo-core/p-6081e432.entry.js +0 -1
- package/dist/apollo-core/p-612984e5.entry.js +0 -1
- package/dist/apollo-core/p-63ea199d.entry.js +0 -1
- package/dist/apollo-core/p-650f6416.entry.js +0 -1
- package/dist/apollo-core/p-6ad97405.entry.js +0 -1
- package/dist/apollo-core/p-9b9511e4.entry.js +0 -1
- package/dist/apollo-core/p-ad90fe4d.js +0 -1
- package/dist/apollo-core/p-c6fec744.entry.js +0 -1
- package/dist/apollo-core/p-ea8e0991.js +0 -1
- package/dist/apollo-core/p-ed04cedd.entry.js +0 -1
- package/dist/apollo-core/p-eec5a0f1.entry.js +0 -1
- package/dist/apollo-core/p-f4f646d9.entry.js +0 -1
- package/dist/cjs/apollo-core.cjs.js +0 -19
- package/dist/cjs/index-9662f096.js +0 -1541
- 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-avatar_14.cjs.entry.js +0 -293
- package/dist/cjs/xpl-button-row.cjs.entry.js +0 -24
- 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-tag.cjs.entry.js +0 -21
- package/dist/cjs/xpl-toggle.cjs.entry.js +0 -34
- package/dist/collection/collection-manifest.json +0 -36
- package/dist/collection/components/xpl-avatar/xpl-avatar.js +0 -158
- package/dist/collection/components/xpl-backdrop/xpl-backdrop.js +0 -7
- 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 -43
- 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 -10
- package/dist/custom-elements/index.js +0 -19877
- package/dist/esm/apollo-core.js +0 -17
- package/dist/esm/index-619763f9.js +0 -1512
- 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-avatar_14.entry.js +0 -276
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- 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
|
@@ -1,471 +0,0 @@
|
|
|
1
|
-
import { Component, Host, h, Prop, State } from '@stencil/core';
|
|
2
|
-
import { v4 as uuid } from "uuid";
|
|
3
|
-
import flatpickr from "flatpickr";
|
|
4
|
-
import "../../../font-awesome/fontawesome";
|
|
5
|
-
import "../../../font-awesome/regular";
|
|
6
|
-
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 ? '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' : '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>`;
|
|
7
|
-
export class XplInput {
|
|
8
|
-
constructor() {
|
|
9
|
-
/**
|
|
10
|
-
* See https://flatpickr.js.org/formatting/
|
|
11
|
-
*/
|
|
12
|
-
this.dateFormat = "Y-m-d";
|
|
13
|
-
/**
|
|
14
|
-
* For datepicker inputs, whether to allow only a single
|
|
15
|
-
* date or a range of dates. (Multiple non-consecutive
|
|
16
|
-
* dates planned to be supported in the future.)
|
|
17
|
-
*/
|
|
18
|
-
this.mode = "single";
|
|
19
|
-
/**
|
|
20
|
-
* Whether to render as a singleline text input or
|
|
21
|
-
* as a multiline textarea. (If `true`, `pre` and `post`
|
|
22
|
-
* values will be ignored, if present.)
|
|
23
|
-
*/
|
|
24
|
-
this.multiline = false;
|
|
25
|
-
this.type = "text";
|
|
26
|
-
this.characterCount = 0;
|
|
27
|
-
this.passwordVisible = false;
|
|
28
|
-
}
|
|
29
|
-
updateCharacterCount() {
|
|
30
|
-
this.characterCount = this.input.value.length;
|
|
31
|
-
}
|
|
32
|
-
componentWillLoad() {
|
|
33
|
-
if (this._id === undefined || this._id === null || this._id === "")
|
|
34
|
-
this._id = uuid();
|
|
35
|
-
if (this.multiline && this.maxCharacterCount !== undefined) {
|
|
36
|
-
this.characterCount = this.value !== undefined ? this.value.length : 0;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
componentDidLoad() {
|
|
40
|
-
if (this.type === "date") {
|
|
41
|
-
flatpickr(this.input, {
|
|
42
|
-
allowInput: true,
|
|
43
|
-
dateFormat: this.dateFormat,
|
|
44
|
-
defaultDate: this.value,
|
|
45
|
-
maxDate: this.max,
|
|
46
|
-
minDate: this.min,
|
|
47
|
-
mode: this.mode,
|
|
48
|
-
nextArrow: arrowSvg(),
|
|
49
|
-
prevArrow: arrowSvg(true)
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
render() {
|
|
54
|
-
let className = "xpl-input";
|
|
55
|
-
if (this.disabled)
|
|
56
|
-
className += " xpl-input--disabled";
|
|
57
|
-
let hasError = false;
|
|
58
|
-
if (this.error !== undefined)
|
|
59
|
-
hasError = true;
|
|
60
|
-
if (this.multiline && this.maxCharacterCount !== undefined && this.characterCount > this.maxCharacterCount)
|
|
61
|
-
hasError = true;
|
|
62
|
-
if (hasError)
|
|
63
|
-
className += " xpl-input--error";
|
|
64
|
-
let type = this.type;
|
|
65
|
-
if (type === "password" && this.passwordVisible) {
|
|
66
|
-
type = "text";
|
|
67
|
-
}
|
|
68
|
-
return (h(Host, { class: className },
|
|
69
|
-
h("label", { class: "xpl-input-label", htmlFor: this._id },
|
|
70
|
-
this.label,
|
|
71
|
-
this.description && h("small", null, this.description)),
|
|
72
|
-
h("div", { class: "xpl-input-wrapper" },
|
|
73
|
-
this.pre && !this.multiline && h("label", { class: "xpl-input-pre", htmlFor: this._id }, this.pre),
|
|
74
|
-
!this.multiline ?
|
|
75
|
-
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) => {
|
|
76
|
-
this.input = el;
|
|
77
|
-
}, required: this.required, step: this.step, type: type, value: this.value }) :
|
|
78
|
-
h("textarea", { disabled: this.disabled, id: this._id, name: this.name, onInput: () => this.updateCharacterCount(), placeholder: this.placeholder, readonly: this.readonly, ref: (el) => {
|
|
79
|
-
this.input = el;
|
|
80
|
-
}, required: this.required }, this.value),
|
|
81
|
-
this.type === "date" && h("span", { class: "xpl-input-calendar" },
|
|
82
|
-
h("i", { class: "far fa-calendar-alt" })),
|
|
83
|
-
this.type === "password" && h("button", { class: "xpl-input-password", onClick: () => {
|
|
84
|
-
this.passwordVisible = !this.passwordVisible;
|
|
85
|
-
}, role: "presentation" },
|
|
86
|
-
h("span", { class: "sr-only" }, "Toggle password visibility"),
|
|
87
|
-
h("i", { class: "far fa-eye", style: {
|
|
88
|
-
display: this.passwordVisible ? "none" : "block"
|
|
89
|
-
} }),
|
|
90
|
-
h("i", { class: "far fa-eye-slash", style: {
|
|
91
|
-
display: this.passwordVisible ? "block" : "none"
|
|
92
|
-
} })),
|
|
93
|
-
this.post && !this.multiline && h("label", { class: "xpl-input-post", htmlFor: this._id }, this.post),
|
|
94
|
-
this.multiline && this.maxCharacterCount !== undefined && h("span", { class: "xpl-input-characters" },
|
|
95
|
-
this.characterCount,
|
|
96
|
-
"/",
|
|
97
|
-
this.maxCharacterCount)),
|
|
98
|
-
this.error !== undefined && this.error.length > 0 && h("label", { class: "xpl-input-error", htmlFor: this._id },
|
|
99
|
-
h("svg", { width: "10", height: "11", viewBox: "0 0 10 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
100
|
-
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" })),
|
|
101
|
-
this.error)));
|
|
102
|
-
}
|
|
103
|
-
static get is() { return "xpl-input"; }
|
|
104
|
-
static get properties() { return {
|
|
105
|
-
"_id": {
|
|
106
|
-
"type": "string",
|
|
107
|
-
"mutable": false,
|
|
108
|
-
"complexType": {
|
|
109
|
-
"original": "string",
|
|
110
|
-
"resolved": "string",
|
|
111
|
-
"references": {}
|
|
112
|
-
},
|
|
113
|
-
"required": false,
|
|
114
|
-
"optional": true,
|
|
115
|
-
"docs": {
|
|
116
|
-
"tags": [],
|
|
117
|
-
"text": "Because `id` is a reserved HTMLElement attribute,\nwe prefix it with an underscore here so that it\ndoesn't get automatically applied to the outer container."
|
|
118
|
-
},
|
|
119
|
-
"attribute": "_id",
|
|
120
|
-
"reflect": false
|
|
121
|
-
},
|
|
122
|
-
"autocomplete": {
|
|
123
|
-
"type": "string",
|
|
124
|
-
"mutable": false,
|
|
125
|
-
"complexType": {
|
|
126
|
-
"original": "string",
|
|
127
|
-
"resolved": "string",
|
|
128
|
-
"references": {}
|
|
129
|
-
},
|
|
130
|
-
"required": false,
|
|
131
|
-
"optional": true,
|
|
132
|
-
"docs": {
|
|
133
|
-
"tags": [],
|
|
134
|
-
"text": ""
|
|
135
|
-
},
|
|
136
|
-
"attribute": "autocomplete",
|
|
137
|
-
"reflect": false
|
|
138
|
-
},
|
|
139
|
-
"dateFormat": {
|
|
140
|
-
"type": "string",
|
|
141
|
-
"mutable": false,
|
|
142
|
-
"complexType": {
|
|
143
|
-
"original": "string",
|
|
144
|
-
"resolved": "string",
|
|
145
|
-
"references": {}
|
|
146
|
-
},
|
|
147
|
-
"required": false,
|
|
148
|
-
"optional": true,
|
|
149
|
-
"docs": {
|
|
150
|
-
"tags": [],
|
|
151
|
-
"text": "See https://flatpickr.js.org/formatting/"
|
|
152
|
-
},
|
|
153
|
-
"attribute": "date-format",
|
|
154
|
-
"reflect": false,
|
|
155
|
-
"defaultValue": "\"Y-m-d\""
|
|
156
|
-
},
|
|
157
|
-
"description": {
|
|
158
|
-
"type": "string",
|
|
159
|
-
"mutable": false,
|
|
160
|
-
"complexType": {
|
|
161
|
-
"original": "string",
|
|
162
|
-
"resolved": "string",
|
|
163
|
-
"references": {}
|
|
164
|
-
},
|
|
165
|
-
"required": false,
|
|
166
|
-
"optional": true,
|
|
167
|
-
"docs": {
|
|
168
|
-
"tags": [],
|
|
169
|
-
"text": "Optional text that appears below the input label."
|
|
170
|
-
},
|
|
171
|
-
"attribute": "description",
|
|
172
|
-
"reflect": false
|
|
173
|
-
},
|
|
174
|
-
"disabled": {
|
|
175
|
-
"type": "boolean",
|
|
176
|
-
"mutable": false,
|
|
177
|
-
"complexType": {
|
|
178
|
-
"original": "boolean",
|
|
179
|
-
"resolved": "boolean",
|
|
180
|
-
"references": {}
|
|
181
|
-
},
|
|
182
|
-
"required": false,
|
|
183
|
-
"optional": true,
|
|
184
|
-
"docs": {
|
|
185
|
-
"tags": [],
|
|
186
|
-
"text": ""
|
|
187
|
-
},
|
|
188
|
-
"attribute": "disabled",
|
|
189
|
-
"reflect": false
|
|
190
|
-
},
|
|
191
|
-
"error": {
|
|
192
|
-
"type": "string",
|
|
193
|
-
"mutable": false,
|
|
194
|
-
"complexType": {
|
|
195
|
-
"original": "string",
|
|
196
|
-
"resolved": "string",
|
|
197
|
-
"references": {}
|
|
198
|
-
},
|
|
199
|
-
"required": false,
|
|
200
|
-
"optional": true,
|
|
201
|
-
"docs": {
|
|
202
|
-
"tags": [],
|
|
203
|
-
"text": "If an empty string (attribute present with no value),\nwill display visually as an error. If a string is\nincluded, will display visually as an error and include\nthe value as an error message."
|
|
204
|
-
},
|
|
205
|
-
"attribute": "error",
|
|
206
|
-
"reflect": false
|
|
207
|
-
},
|
|
208
|
-
"label": {
|
|
209
|
-
"type": "string",
|
|
210
|
-
"mutable": false,
|
|
211
|
-
"complexType": {
|
|
212
|
-
"original": "string",
|
|
213
|
-
"resolved": "string",
|
|
214
|
-
"references": {}
|
|
215
|
-
},
|
|
216
|
-
"required": false,
|
|
217
|
-
"optional": false,
|
|
218
|
-
"docs": {
|
|
219
|
-
"tags": [],
|
|
220
|
-
"text": ""
|
|
221
|
-
},
|
|
222
|
-
"attribute": "label",
|
|
223
|
-
"reflect": false
|
|
224
|
-
},
|
|
225
|
-
"max": {
|
|
226
|
-
"type": "any",
|
|
227
|
-
"mutable": false,
|
|
228
|
-
"complexType": {
|
|
229
|
-
"original": "number | string",
|
|
230
|
-
"resolved": "number | string",
|
|
231
|
-
"references": {}
|
|
232
|
-
},
|
|
233
|
-
"required": false,
|
|
234
|
-
"optional": true,
|
|
235
|
-
"docs": {
|
|
236
|
-
"tags": [],
|
|
237
|
-
"text": "Only used when `type` = 'number' or 'date'"
|
|
238
|
-
},
|
|
239
|
-
"attribute": "max",
|
|
240
|
-
"reflect": false
|
|
241
|
-
},
|
|
242
|
-
"maxCharacterCount": {
|
|
243
|
-
"type": "number",
|
|
244
|
-
"mutable": false,
|
|
245
|
-
"complexType": {
|
|
246
|
-
"original": "number",
|
|
247
|
-
"resolved": "number",
|
|
248
|
-
"references": {}
|
|
249
|
-
},
|
|
250
|
-
"required": false,
|
|
251
|
-
"optional": true,
|
|
252
|
-
"docs": {
|
|
253
|
-
"tags": [],
|
|
254
|
-
"text": "For multiline inputs, a max. character count will\ndisplay along with the current character count,\nand will automatically render as an error if the\ncharacter count exceeds the max."
|
|
255
|
-
},
|
|
256
|
-
"attribute": "max-character-count",
|
|
257
|
-
"reflect": false
|
|
258
|
-
},
|
|
259
|
-
"min": {
|
|
260
|
-
"type": "any",
|
|
261
|
-
"mutable": false,
|
|
262
|
-
"complexType": {
|
|
263
|
-
"original": "number | string",
|
|
264
|
-
"resolved": "number | string",
|
|
265
|
-
"references": {}
|
|
266
|
-
},
|
|
267
|
-
"required": false,
|
|
268
|
-
"optional": true,
|
|
269
|
-
"docs": {
|
|
270
|
-
"tags": [],
|
|
271
|
-
"text": "Only used when `type` = 'number' or 'date'"
|
|
272
|
-
},
|
|
273
|
-
"attribute": "min",
|
|
274
|
-
"reflect": false
|
|
275
|
-
},
|
|
276
|
-
"mode": {
|
|
277
|
-
"type": "string",
|
|
278
|
-
"mutable": false,
|
|
279
|
-
"complexType": {
|
|
280
|
-
"original": "\"single\" | /* \"multiple\" | */ \"range\"",
|
|
281
|
-
"resolved": "\"range\" | \"single\"",
|
|
282
|
-
"references": {}
|
|
283
|
-
},
|
|
284
|
-
"required": false,
|
|
285
|
-
"optional": true,
|
|
286
|
-
"docs": {
|
|
287
|
-
"tags": [],
|
|
288
|
-
"text": "For datepicker inputs, whether to allow only a single\ndate or a range of dates. (Multiple non-consecutive\ndates planned to be supported in the future.)"
|
|
289
|
-
},
|
|
290
|
-
"attribute": "mode",
|
|
291
|
-
"reflect": false,
|
|
292
|
-
"defaultValue": "\"single\""
|
|
293
|
-
},
|
|
294
|
-
"multiline": {
|
|
295
|
-
"type": "boolean",
|
|
296
|
-
"mutable": false,
|
|
297
|
-
"complexType": {
|
|
298
|
-
"original": "boolean",
|
|
299
|
-
"resolved": "boolean",
|
|
300
|
-
"references": {}
|
|
301
|
-
},
|
|
302
|
-
"required": false,
|
|
303
|
-
"optional": true,
|
|
304
|
-
"docs": {
|
|
305
|
-
"tags": [],
|
|
306
|
-
"text": "Whether to render as a singleline text input or\nas a multiline textarea. (If `true`, `pre` and `post`\nvalues will be ignored, if present.)"
|
|
307
|
-
},
|
|
308
|
-
"attribute": "multiline",
|
|
309
|
-
"reflect": false,
|
|
310
|
-
"defaultValue": "false"
|
|
311
|
-
},
|
|
312
|
-
"name": {
|
|
313
|
-
"type": "string",
|
|
314
|
-
"mutable": false,
|
|
315
|
-
"complexType": {
|
|
316
|
-
"original": "string",
|
|
317
|
-
"resolved": "string",
|
|
318
|
-
"references": {}
|
|
319
|
-
},
|
|
320
|
-
"required": false,
|
|
321
|
-
"optional": true,
|
|
322
|
-
"docs": {
|
|
323
|
-
"tags": [],
|
|
324
|
-
"text": "Most inputs are used in forms, and should have a\n`name` associated with the input for handling form data."
|
|
325
|
-
},
|
|
326
|
-
"attribute": "name",
|
|
327
|
-
"reflect": false
|
|
328
|
-
},
|
|
329
|
-
"placeholder": {
|
|
330
|
-
"type": "string",
|
|
331
|
-
"mutable": false,
|
|
332
|
-
"complexType": {
|
|
333
|
-
"original": "string",
|
|
334
|
-
"resolved": "string",
|
|
335
|
-
"references": {}
|
|
336
|
-
},
|
|
337
|
-
"required": false,
|
|
338
|
-
"optional": true,
|
|
339
|
-
"docs": {
|
|
340
|
-
"tags": [],
|
|
341
|
-
"text": ""
|
|
342
|
-
},
|
|
343
|
-
"attribute": "placeholder",
|
|
344
|
-
"reflect": false
|
|
345
|
-
},
|
|
346
|
-
"post": {
|
|
347
|
-
"type": "string",
|
|
348
|
-
"mutable": false,
|
|
349
|
-
"complexType": {
|
|
350
|
-
"original": "string",
|
|
351
|
-
"resolved": "string",
|
|
352
|
-
"references": {}
|
|
353
|
-
},
|
|
354
|
-
"required": false,
|
|
355
|
-
"optional": true,
|
|
356
|
-
"docs": {
|
|
357
|
-
"tags": [],
|
|
358
|
-
"text": "A string (recommended max 3 characters) that gets shown\nvisually to the left of (before) the input."
|
|
359
|
-
},
|
|
360
|
-
"attribute": "post",
|
|
361
|
-
"reflect": false
|
|
362
|
-
},
|
|
363
|
-
"pre": {
|
|
364
|
-
"type": "string",
|
|
365
|
-
"mutable": false,
|
|
366
|
-
"complexType": {
|
|
367
|
-
"original": "string",
|
|
368
|
-
"resolved": "string",
|
|
369
|
-
"references": {}
|
|
370
|
-
},
|
|
371
|
-
"required": false,
|
|
372
|
-
"optional": true,
|
|
373
|
-
"docs": {
|
|
374
|
-
"tags": [],
|
|
375
|
-
"text": "A string (recommended max 8 characters) that gets shown\nvisually to the right of (after) the input."
|
|
376
|
-
},
|
|
377
|
-
"attribute": "pre",
|
|
378
|
-
"reflect": false
|
|
379
|
-
},
|
|
380
|
-
"readonly": {
|
|
381
|
-
"type": "boolean",
|
|
382
|
-
"mutable": false,
|
|
383
|
-
"complexType": {
|
|
384
|
-
"original": "boolean",
|
|
385
|
-
"resolved": "boolean",
|
|
386
|
-
"references": {}
|
|
387
|
-
},
|
|
388
|
-
"required": false,
|
|
389
|
-
"optional": true,
|
|
390
|
-
"docs": {
|
|
391
|
-
"tags": [],
|
|
392
|
-
"text": ""
|
|
393
|
-
},
|
|
394
|
-
"attribute": "readonly",
|
|
395
|
-
"reflect": false
|
|
396
|
-
},
|
|
397
|
-
"required": {
|
|
398
|
-
"type": "boolean",
|
|
399
|
-
"mutable": false,
|
|
400
|
-
"complexType": {
|
|
401
|
-
"original": "boolean",
|
|
402
|
-
"resolved": "boolean",
|
|
403
|
-
"references": {}
|
|
404
|
-
},
|
|
405
|
-
"required": false,
|
|
406
|
-
"optional": true,
|
|
407
|
-
"docs": {
|
|
408
|
-
"tags": [],
|
|
409
|
-
"text": ""
|
|
410
|
-
},
|
|
411
|
-
"attribute": "required",
|
|
412
|
-
"reflect": false
|
|
413
|
-
},
|
|
414
|
-
"step": {
|
|
415
|
-
"type": "number",
|
|
416
|
-
"mutable": false,
|
|
417
|
-
"complexType": {
|
|
418
|
-
"original": "number",
|
|
419
|
-
"resolved": "number",
|
|
420
|
-
"references": {}
|
|
421
|
-
},
|
|
422
|
-
"required": false,
|
|
423
|
-
"optional": true,
|
|
424
|
-
"docs": {
|
|
425
|
-
"tags": [],
|
|
426
|
-
"text": ""
|
|
427
|
-
},
|
|
428
|
-
"attribute": "step",
|
|
429
|
-
"reflect": false
|
|
430
|
-
},
|
|
431
|
-
"type": {
|
|
432
|
-
"type": "string",
|
|
433
|
-
"mutable": false,
|
|
434
|
-
"complexType": {
|
|
435
|
-
"original": "\"date\" | \"text\" | \"number\" | \"password\"",
|
|
436
|
-
"resolved": "\"date\" | \"number\" | \"password\" | \"text\"",
|
|
437
|
-
"references": {}
|
|
438
|
-
},
|
|
439
|
-
"required": false,
|
|
440
|
-
"optional": true,
|
|
441
|
-
"docs": {
|
|
442
|
-
"tags": [],
|
|
443
|
-
"text": ""
|
|
444
|
-
},
|
|
445
|
-
"attribute": "type",
|
|
446
|
-
"reflect": false,
|
|
447
|
-
"defaultValue": "\"text\""
|
|
448
|
-
},
|
|
449
|
-
"value": {
|
|
450
|
-
"type": "string",
|
|
451
|
-
"mutable": false,
|
|
452
|
-
"complexType": {
|
|
453
|
-
"original": "string",
|
|
454
|
-
"resolved": "string",
|
|
455
|
-
"references": {}
|
|
456
|
-
},
|
|
457
|
-
"required": false,
|
|
458
|
-
"optional": true,
|
|
459
|
-
"docs": {
|
|
460
|
-
"tags": [],
|
|
461
|
-
"text": "Including a `value` will prepopulate the input\nwith the given string."
|
|
462
|
-
},
|
|
463
|
-
"attribute": "value",
|
|
464
|
-
"reflect": false
|
|
465
|
-
}
|
|
466
|
-
}; }
|
|
467
|
-
static get states() { return {
|
|
468
|
-
"characterCount": {},
|
|
469
|
-
"passwordVisible": {}
|
|
470
|
-
}; }
|
|
471
|
-
}
|
|
@@ -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,43 +0,0 @@
|
|
|
1
|
-
import { Component, Host, h, Prop } 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
|
-
render() {
|
|
10
|
-
return (h(Host, { class: `xpl-main-nav xpl-main-nav__${this.width}`, "aria-label": "Sidebar" },
|
|
11
|
-
h("nav", null,
|
|
12
|
-
h("header", { "aria-label": "Sidebar Header" },
|
|
13
|
-
h("slot", { name: "logo" }),
|
|
14
|
-
h("slot", { name: "brand-name" })),
|
|
15
|
-
h("slot", { name: "navigation" })),
|
|
16
|
-
h("footer", { class: "xpl-main-nav-footer", "aria-label": "Sidebar Footer" },
|
|
17
|
-
h("slot", { name: "footer" }))));
|
|
18
|
-
}
|
|
19
|
-
static get is() { return "xpl-main-nav"; }
|
|
20
|
-
static get properties() { return {
|
|
21
|
-
"width": {
|
|
22
|
-
"type": "string",
|
|
23
|
-
"mutable": false,
|
|
24
|
-
"complexType": {
|
|
25
|
-
"original": "\"default\" | \"md\" | \"sm\"",
|
|
26
|
-
"resolved": "\"default\" | \"md\" | \"sm\"",
|
|
27
|
-
"references": {}
|
|
28
|
-
},
|
|
29
|
-
"required": false,
|
|
30
|
-
"optional": false,
|
|
31
|
-
"docs": {
|
|
32
|
-
"tags": [{
|
|
33
|
-
"text": "{string} width - The width of the Main Nav.",
|
|
34
|
-
"name": "property"
|
|
35
|
-
}],
|
|
36
|
-
"text": ""
|
|
37
|
-
},
|
|
38
|
-
"attribute": "width",
|
|
39
|
-
"reflect": false,
|
|
40
|
-
"defaultValue": "\"default\""
|
|
41
|
-
}
|
|
42
|
-
}; }
|
|
43
|
-
}
|
|
@@ -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
|
-
}
|