@xplortech/apollo-core 0.5.2 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/dist/apollo-core/apollo-core.css +5468 -9
  2. package/dist/apollo-core/apollo-core.esm.js +125 -1
  3. package/dist/apollo-core/app-globals-0f993ce5.js +3 -0
  4. package/dist/apollo-core/css-shim-bbdf0cc6.js +4 -0
  5. package/dist/apollo-core/dom-1f98a75f.js +73 -0
  6. package/dist/apollo-core/index-3c9f25ef.js +2938 -0
  7. package/dist/apollo-core/index-912d1a21.js +584 -0
  8. package/dist/apollo-core/index.esm.js +1 -0
  9. package/dist/{cjs/regular-872f5226.js → apollo-core/regular-133c23b5.js} +12 -3
  10. package/dist/apollo-core/shadow-css-67b66845.js +389 -0
  11. package/dist/apollo-core/xpl-application-shell.entry.js +50 -0
  12. package/dist/apollo-core/xpl-avatar.entry.js +19 -0
  13. package/dist/apollo-core/xpl-backdrop.entry.js +21 -0
  14. package/dist/{esm → apollo-core}/xpl-badge.entry.js +1 -1
  15. package/dist/{collection/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js → apollo-core/xpl-breadcrumb-item.entry.js} +9 -12
  16. package/dist/apollo-core/xpl-breadcrumbs.entry.js +14 -0
  17. package/dist/{esm → apollo-core}/xpl-button-row.entry.js +1 -1
  18. package/dist/apollo-core/xpl-button.entry.js +34 -0
  19. package/dist/apollo-core/xpl-checkbox.entry.js +25 -0
  20. package/dist/{esm → apollo-core}/xpl-choicelist.entry.js +1 -1
  21. package/dist/apollo-core/xpl-content-area.entry.js +16 -0
  22. package/dist/{esm → apollo-core}/xpl-divider.entry.js +1 -1
  23. package/dist/{esm → apollo-core}/xpl-grid-item.entry.js +1 -1
  24. package/dist/{esm → apollo-core}/xpl-grid.entry.js +1 -1
  25. package/dist/{esm → apollo-core}/xpl-input.entry.js +20 -3
  26. package/dist/{esm → apollo-core}/xpl-list.entry.js +2 -2
  27. package/dist/apollo-core/xpl-main-nav.entry.js +26 -0
  28. package/dist/apollo-core/xpl-nav-item.entry.js +12 -0
  29. package/dist/{esm → apollo-core}/xpl-pagination.entry.js +1 -1
  30. package/dist/apollo-core/xpl-radio.entry.js +25 -0
  31. package/dist/apollo-core/xpl-secondary-nav.entry.js +12 -0
  32. package/dist/{esm → apollo-core}/xpl-select.entry.js +43 -3
  33. package/dist/{esm → apollo-core}/xpl-table.entry.js +1 -1
  34. package/dist/{esm → apollo-core}/xpl-tag.entry.js +1 -1
  35. package/dist/{esm → apollo-core}/xpl-toggle.entry.js +2 -2
  36. package/dist/apollo-core/xpl-utility-bar.entry.js +25 -0
  37. package/dist/types/components/xpl-choicelist/choice.d.ts +1 -1
  38. package/dist/types/components/xpl-choicelist/xpl-choicelist.d.ts +1 -0
  39. package/dist/types/components/xpl-dropdown/dropdownchoice.d.ts +5 -5
  40. package/dist/types/components/xpl-dropdown/xpl-dropdown.d.ts +1 -0
  41. package/dist/types/components/xpl-list/listitem.d.ts +15 -15
  42. package/dist/types/components/xpl-list/xpl-list.d.ts +1 -0
  43. package/dist/types/components/xpl-select/xpl-select.d.ts +1 -0
  44. package/dist/types/components.d.ts +3 -0
  45. package/package.json +1 -1
  46. package/dist/apollo-core/p-0203d4e8.entry.js +0 -1
  47. package/dist/apollo-core/p-0b2c612e.entry.js +0 -1
  48. package/dist/apollo-core/p-128a0240.entry.js +0 -1
  49. package/dist/apollo-core/p-2f90296c.js +0 -10
  50. package/dist/apollo-core/p-30003b15.entry.js +0 -1
  51. package/dist/apollo-core/p-4e56a2ca.entry.js +0 -1
  52. package/dist/apollo-core/p-5854d1e4.entry.js +0 -1
  53. package/dist/apollo-core/p-611536d8.entry.js +0 -1
  54. package/dist/apollo-core/p-7c9fee7e.entry.js +0 -1
  55. package/dist/apollo-core/p-8b6633c7.js +0 -1
  56. package/dist/apollo-core/p-97cd1f73.entry.js +0 -1
  57. package/dist/apollo-core/p-9c5ca308.entry.js +0 -1
  58. package/dist/apollo-core/p-ad90fe4d.js +0 -1
  59. package/dist/apollo-core/p-bd4a7e3c.entry.js +0 -1
  60. package/dist/apollo-core/p-dab8e7a1.entry.js +0 -1
  61. package/dist/apollo-core/p-eb63b401.entry.js +0 -1
  62. package/dist/apollo-core/p-ee2f4422.entry.js +0 -1
  63. package/dist/apollo-core/p-f167aa05.entry.js +0 -1
  64. package/dist/cjs/apollo-core.cjs.js +0 -19
  65. package/dist/cjs/index-944adb2e.js +0 -1609
  66. package/dist/cjs/index.cjs.js +0 -2
  67. package/dist/cjs/loader.cjs.js +0 -21
  68. package/dist/cjs/v4-14140ff3.js +0 -77
  69. package/dist/cjs/xpl-application-shell_11.cjs.entry.js +0 -230
  70. package/dist/cjs/xpl-badge.cjs.entry.js +0 -21
  71. package/dist/cjs/xpl-button-row.cjs.entry.js +0 -24
  72. package/dist/cjs/xpl-checkbox_2.cjs.entry.js +0 -51
  73. package/dist/cjs/xpl-choicelist.cjs.entry.js +0 -36
  74. package/dist/cjs/xpl-divider.cjs.entry.js +0 -18
  75. package/dist/cjs/xpl-grid-item.cjs.entry.js +0 -25
  76. package/dist/cjs/xpl-grid.cjs.entry.js +0 -35
  77. package/dist/cjs/xpl-input.cjs.entry.js +0 -2527
  78. package/dist/cjs/xpl-list.cjs.entry.js +0 -63
  79. package/dist/cjs/xpl-pagination.cjs.entry.js +0 -76
  80. package/dist/cjs/xpl-select.cjs.entry.js +0 -623
  81. package/dist/cjs/xpl-table.cjs.entry.js +0 -89
  82. package/dist/cjs/xpl-tag.cjs.entry.js +0 -21
  83. package/dist/cjs/xpl-toggle.cjs.entry.js +0 -34
  84. package/dist/collection/collection-manifest.json +0 -37
  85. package/dist/collection/components/xpl-application-shell/xpl-application-shell.js +0 -143
  86. package/dist/collection/components/xpl-avatar/xpl-avatar.js +0 -158
  87. package/dist/collection/components/xpl-backdrop/xpl-backdrop.js +0 -41
  88. package/dist/collection/components/xpl-badge/xpl-badge.js +0 -50
  89. package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js +0 -15
  90. package/dist/collection/components/xpl-button/xpl-button.js +0 -214
  91. package/dist/collection/components/xpl-button-row/xpl-button-row.js +0 -119
  92. package/dist/collection/components/xpl-checkbox/xpl-checkbox.js +0 -185
  93. package/dist/collection/components/xpl-choicelist/xpl-choicelist.js +0 -143
  94. package/dist/collection/components/xpl-content-area/xpl-content-area.js +0 -39
  95. package/dist/collection/components/xpl-divider/xpl-divider.js +0 -30
  96. package/dist/collection/components/xpl-dropdown/xpl-dropdown.js +0 -32
  97. package/dist/collection/components/xpl-grid/xpl-grid.js +0 -26
  98. package/dist/collection/components/xpl-grid-item/xpl-grid-item.js +0 -93
  99. package/dist/collection/components/xpl-input/xpl-input.js +0 -471
  100. package/dist/collection/components/xpl-list/xpl-list.js +0 -93
  101. package/dist/collection/components/xpl-main-nav/xpl-main-nav.js +0 -72
  102. package/dist/collection/components/xpl-nav-item/xpl-nav-item.js +0 -10
  103. package/dist/collection/components/xpl-pagination/xpl-pagination.js +0 -189
  104. package/dist/collection/components/xpl-radio/xpl-radio.js +0 -168
  105. package/dist/collection/components/xpl-secondary-nav/xpl-secondary-nav.js +0 -9
  106. package/dist/collection/components/xpl-select/xpl-select.js +0 -311
  107. package/dist/collection/components/xpl-table/xpl-table.js +0 -194
  108. package/dist/collection/components/xpl-tag/xpl-tag.js +0 -30
  109. package/dist/collection/components/xpl-toggle/xpl-toggle.js +0 -157
  110. package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js +0 -70
  111. package/dist/custom-elements/index.js +0 -19959
  112. package/dist/esm/apollo-core.js +0 -17
  113. package/dist/esm/index-899dba3b.js +0 -1580
  114. package/dist/esm/index.js +0 -1
  115. package/dist/esm/loader.js +0 -17
  116. package/dist/esm/polyfills/core-js.js +0 -11
  117. package/dist/esm/polyfills/css-shim.js +0 -1
  118. package/dist/esm/polyfills/dom.js +0 -79
  119. package/dist/esm/polyfills/es5-html-element.js +0 -1
  120. package/dist/esm/polyfills/index.js +0 -34
  121. package/dist/esm/polyfills/system.js +0 -6
  122. package/dist/esm/regular-86225e9d.js +0 -16041
  123. package/dist/esm/v4-929670b7.js +0 -75
  124. package/dist/esm/xpl-application-shell_11.entry.js +0 -216
  125. package/dist/esm/xpl-checkbox_2.entry.js +0 -46
  126. package/dist/index.cjs.js +0 -1
  127. package/dist/index.js +0 -1
  128. package/dist/stories/application-shell.stories.js +0 -766
  129. package/dist/stories/avatar.stories.js +0 -173
  130. package/dist/stories/backdrop.stories.js +0 -18
  131. package/dist/stories/badge.stories.js +0 -48
  132. package/dist/stories/breadcrumbs.stories.js +0 -115
  133. package/dist/stories/button-row.stories.js +0 -64
  134. package/dist/stories/button.stories.js +0 -98
  135. package/dist/stories/checkbox.stories.js +0 -76
  136. package/dist/stories/choicelist.stories.js +0 -112
  137. package/dist/stories/content-area.stories.js +0 -53
  138. package/dist/stories/divider.stories.js +0 -34
  139. package/dist/stories/grid.stories.js +0 -100
  140. package/dist/stories/input.stories.js +0 -252
  141. package/dist/stories/list.stories.js +0 -134
  142. package/dist/stories/main-nav.stories.js +0 -308
  143. package/dist/stories/pagination.stories.js +0 -84
  144. package/dist/stories/radio.stories.js +0 -66
  145. package/dist/stories/secondary-nav.stories.js +0 -76
  146. package/dist/stories/select.stories.js +0 -111
  147. package/dist/stories/table.stories.js +0 -107
  148. package/dist/stories/tabs.stories.js +0 -24
  149. package/dist/stories/toggle.stories.js +0 -80
  150. package/dist/stories/utility-bar.stories.js +0 -94
  151. /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/application-shell.stories.d.ts +0 -0
  152. /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/avatar.stories.d.ts +0 -0
  153. /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/backdrop.stories.d.ts +0 -0
  154. /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/badge.stories.d.ts +0 -0
  155. /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/breadcrumbs.stories.d.ts +0 -0
  156. /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/button-row.stories.d.ts +0 -0
  157. /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/button.stories.d.ts +0 -0
  158. /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/checkbox.stories.d.ts +0 -0
  159. /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/choicelist.stories.d.ts +0 -0
  160. /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/content-area.stories.d.ts +0 -0
  161. /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/divider.stories.d.ts +0 -0
  162. /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/grid.stories.d.ts +0 -0
  163. /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/input.stories.d.ts +0 -0
  164. /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/list.stories.d.ts +0 -0
  165. /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/main-nav.stories.d.ts +0 -0
  166. /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/pagination.stories.d.ts +0 -0
  167. /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/radio.stories.d.ts +0 -0
  168. /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/secondary-nav.stories.d.ts +0 -0
  169. /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/select.stories.d.ts +0 -0
  170. /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/table.stories.d.ts +0 -0
  171. /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/tabs.stories.d.ts +0 -0
  172. /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/toggle.stories.d.ts +0 -0
  173. /package/dist/types/Users/{fernandogelin/Projects → roc/Sites}/apollo/.stencil/stories/utility-bar.stories.d.ts +0 -0
@@ -1,30 +0,0 @@
1
- import { Component, Host, h, Prop } from '@stencil/core';
2
- export class XplDivider {
3
- render() {
4
- let className = "xpl-divider";
5
- className += ` xpl-divider--${this.tier}`;
6
- return (h(Host, { class: className },
7
- h("span", null,
8
- h("slot", null))));
9
- }
10
- static get is() { return "xpl-divider"; }
11
- static get properties() { return {
12
- "tier": {
13
- "type": "number",
14
- "mutable": false,
15
- "complexType": {
16
- "original": "number",
17
- "resolved": "number",
18
- "references": {}
19
- },
20
- "required": false,
21
- "optional": true,
22
- "docs": {
23
- "tags": [],
24
- "text": "The tier should be an integer between 0 and 3.\nTier 0 dividers do not display text, and 1-3 increase\nin size with each increasing tier."
25
- },
26
- "attribute": "tier",
27
- "reflect": false
28
- }
29
- }; }
30
- }
@@ -1,32 +0,0 @@
1
- /// <reference path="./dropdownchoice.d.ts"></reference>
2
- import { h } from '@stencil/core';
3
- export const XplDropdown = ({ active, choices, mode, selected, update, }) => {
4
- return (h("div", { class: {
5
- "xpl-dropdown": true,
6
- "xpl-dropdown--multi": mode === "multi",
7
- "active": active,
8
- } },
9
- h("ul", null, choices.map(({ label, isGroupHeading }, i) => {
10
- return isGroupHeading ?
11
- h("span", null, label) :
12
- h("li", null,
13
- h("button", { class: {
14
- selected: selected[i]
15
- }, onClick: () => {
16
- let newSelected;
17
- if (mode === "single") {
18
- // @ts-expect-error
19
- newSelected = selected.map((v, j) => {
20
- return i === j ? !selected[i] : false;
21
- });
22
- active = false;
23
- }
24
- else if (mode === "multi") {
25
- newSelected = selected.map((v, j) => {
26
- return i === j ? !selected[i] : v;
27
- });
28
- }
29
- update(newSelected);
30
- }, tabIndex: active ? 0 : -1 }, label));
31
- }))));
32
- };
@@ -1,26 +0,0 @@
1
- import { Component, Host, h, Element } from '@stencil/core';
2
- export class XplGrid {
3
- componentDidLoad() {
4
- const items = Array.from(this.container.querySelectorAll(".xpl-grid-item"));
5
- let lgCounter = 0, mdCounter = 0, smCounter = 0, xsCounter = 0;
6
- items.forEach(item => {
7
- lgCounter += +item.getAttribute("lg") || 6;
8
- mdCounter += +item.getAttribute("md") || 6;
9
- smCounter += +item.getAttribute("sm") || 6;
10
- xsCounter += +item.getAttribute("xs") || 6;
11
- if (lgCounter % 6 === 0)
12
- item.classList.add("xpl-grid-item-lg-last");
13
- if (mdCounter % 6 === 0)
14
- item.classList.add("xpl-grid-item-md-last");
15
- if (smCounter % 6 === 0)
16
- item.classList.add("xpl-grid-item-sm-last");
17
- if (xsCounter % 6 === 0)
18
- item.classList.add("xpl-grid-item-xs-last");
19
- });
20
- }
21
- render() {
22
- return (h(Host, { class: "xpl-grid" }));
23
- }
24
- static get is() { return "xpl-grid"; }
25
- static get elementRef() { return "container"; }
26
- }
@@ -1,93 +0,0 @@
1
- import { Component, Host, h, Prop } from '@stencil/core';
2
- export class XplGridItem {
3
- constructor() {
4
- this.xs = 6;
5
- this.sm = 6;
6
- this.md = 6;
7
- this.lg = 6;
8
- }
9
- render() {
10
- let className = "xpl-grid-item";
11
- className += ` xpl-grid-item-xs-${this.xs}`;
12
- className += ` xpl-grid-item-sm-${this.sm}`;
13
- className += ` xpl-grid-item-md-${this.md}`;
14
- className += ` xpl-grid-item-lg-${this.lg}`;
15
- return (h(Host, { class: className },
16
- h("slot", null)));
17
- }
18
- static get is() { return "xpl-grid-item"; }
19
- static get properties() { return {
20
- "xs": {
21
- "type": "number",
22
- "mutable": false,
23
- "complexType": {
24
- "original": "number",
25
- "resolved": "number",
26
- "references": {}
27
- },
28
- "required": false,
29
- "optional": false,
30
- "docs": {
31
- "tags": [],
32
- "text": ""
33
- },
34
- "attribute": "xs",
35
- "reflect": false,
36
- "defaultValue": "6"
37
- },
38
- "sm": {
39
- "type": "number",
40
- "mutable": false,
41
- "complexType": {
42
- "original": "number",
43
- "resolved": "number",
44
- "references": {}
45
- },
46
- "required": false,
47
- "optional": false,
48
- "docs": {
49
- "tags": [],
50
- "text": ""
51
- },
52
- "attribute": "sm",
53
- "reflect": false,
54
- "defaultValue": "6"
55
- },
56
- "md": {
57
- "type": "number",
58
- "mutable": false,
59
- "complexType": {
60
- "original": "number",
61
- "resolved": "number",
62
- "references": {}
63
- },
64
- "required": false,
65
- "optional": false,
66
- "docs": {
67
- "tags": [],
68
- "text": ""
69
- },
70
- "attribute": "md",
71
- "reflect": false,
72
- "defaultValue": "6"
73
- },
74
- "lg": {
75
- "type": "number",
76
- "mutable": false,
77
- "complexType": {
78
- "original": "number",
79
- "resolved": "number",
80
- "references": {}
81
- },
82
- "required": false,
83
- "optional": false,
84
- "docs": {
85
- "tags": [],
86
- "text": ""
87
- },
88
- "attribute": "lg",
89
- "reflect": false,
90
- "defaultValue": "6"
91
- }
92
- }; }
93
- }
@@ -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
- }