@xplortech/apollo-core 0.5.2 → 1.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/build/style.css +758 -383
  2. package/dist/apollo-core/apollo-core.css +4 -4
  3. package/dist/apollo-core/apollo-core.esm.js +1 -1
  4. package/dist/apollo-core/{p-5854d1e4.entry.js → p-09b2f746.entry.js} +1 -1
  5. package/dist/apollo-core/p-0bc956c6.entry.js +1 -0
  6. package/dist/apollo-core/p-1b1e7207.entry.js +1 -0
  7. package/dist/apollo-core/{p-f167aa05.entry.js → p-20389bb6.entry.js} +1 -1
  8. package/dist/apollo-core/{p-ee2f4422.entry.js → p-25983fde.entry.js} +1 -1
  9. package/dist/apollo-core/{p-128a0240.entry.js → p-4a348764.entry.js} +1 -1
  10. package/dist/apollo-core/{p-eb63b401.entry.js → p-4e2b69e8.entry.js} +1 -1
  11. package/dist/apollo-core/{p-97cd1f73.entry.js → p-84bf6b2d.entry.js} +1 -1
  12. package/dist/apollo-core/{p-611536d8.entry.js → p-880c0359.entry.js} +1 -1
  13. package/dist/apollo-core/p-8e47a5be.entry.js +1 -0
  14. package/dist/apollo-core/p-93958292.entry.js +1 -0
  15. package/dist/apollo-core/p-93c27db5.entry.js +1 -0
  16. package/dist/apollo-core/{p-0b2c612e.entry.js → p-b2327e2c.entry.js} +1 -1
  17. package/dist/apollo-core/p-c55b5d9c.entry.js +1 -0
  18. package/dist/apollo-core/p-e369d7af.entry.js +1 -0
  19. package/dist/apollo-core/p-e60ecaef.entry.js +1 -0
  20. package/dist/apollo-core/p-f929c958.js +1 -0
  21. package/dist/cjs/apollo-core.cjs.js +2 -2
  22. package/dist/cjs/{index-944adb2e.js → index-54ba5804.js} +14 -0
  23. package/dist/cjs/loader.cjs.js +2 -2
  24. package/dist/cjs/xpl-application-shell.cjs.entry.js +58 -0
  25. package/dist/cjs/xpl-avatar_12.cjs.entry.js +299 -0
  26. package/dist/cjs/xpl-backdrop.cjs.entry.js +25 -0
  27. package/dist/cjs/xpl-button-row.cjs.entry.js +2 -4
  28. package/dist/cjs/xpl-choicelist.cjs.entry.js +21 -14
  29. package/dist/cjs/xpl-divider.cjs.entry.js +2 -2
  30. package/dist/cjs/xpl-dropdown-group_3.cjs.entry.js +104 -0
  31. package/dist/cjs/xpl-dropdown_2.cjs.entry.js +123 -0
  32. package/dist/cjs/xpl-grid-item.cjs.entry.js +2 -2
  33. package/dist/cjs/xpl-grid.cjs.entry.js +12 -12
  34. package/dist/cjs/xpl-input.cjs.entry.js +33 -26
  35. package/dist/cjs/xpl-list.cjs.entry.js +17 -19
  36. package/dist/cjs/xpl-main-nav.cjs.entry.js +30 -0
  37. package/dist/cjs/xpl-pagination.cjs.entry.js +8 -8
  38. package/dist/cjs/xpl-select.cjs.entry.js +87 -85
  39. package/dist/cjs/xpl-toggle.cjs.entry.js +13 -13
  40. package/dist/collection/collection-manifest.json +4 -0
  41. package/dist/collection/components/xpl-application-shell/xpl-application-shell.js +11 -7
  42. package/dist/collection/components/xpl-avatar/xpl-avatar.js +7 -7
  43. package/dist/collection/components/xpl-backdrop/xpl-backdrop.js +1 -1
  44. package/dist/collection/components/xpl-badge/xpl-badge.js +5 -5
  45. package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js +0 -2
  46. package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js +0 -2
  47. package/dist/collection/components/xpl-button/xpl-button.js +79 -82
  48. package/dist/collection/components/xpl-button-row/xpl-button-row.js +7 -9
  49. package/dist/collection/components/xpl-checkbox/xpl-checkbox.js +11 -11
  50. package/dist/collection/components/xpl-choicelist/xpl-choicelist.js +22 -15
  51. package/dist/collection/components/xpl-content-area/xpl-content-area.js +5 -5
  52. package/dist/collection/components/xpl-divider/xpl-divider.js +1 -1
  53. package/dist/collection/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.js +66 -0
  54. package/dist/collection/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.js +27 -0
  55. package/dist/collection/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.js +110 -0
  56. package/dist/collection/components/xpl-dropdown/xpl-dropdown.js +259 -31
  57. package/dist/collection/components/xpl-grid/xpl-grid.js +11 -11
  58. package/dist/collection/components/xpl-grid-item/xpl-grid-item.js +1 -1
  59. package/dist/collection/components/xpl-input/xpl-input.js +49 -42
  60. package/dist/collection/components/xpl-list/xpl-list.js +24 -26
  61. package/dist/collection/components/xpl-main-nav/xpl-main-nav.js +3 -3
  62. package/dist/collection/components/xpl-nav-item/xpl-nav-item.js +59 -2
  63. package/dist/collection/components/xpl-pagination/xpl-pagination.js +11 -10
  64. package/dist/collection/components/xpl-radio/xpl-radio.js +11 -11
  65. package/dist/collection/components/xpl-select/xpl-select.js +97 -64
  66. package/dist/collection/components/xpl-table/xpl-table.js +18 -12
  67. package/dist/collection/components/xpl-toggle/xpl-toggle.js +16 -16
  68. package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js +4 -8
  69. package/dist/custom-elements/index.d.ts +24 -0
  70. package/dist/custom-elements/index.js +18936 -18694
  71. package/dist/esm/apollo-core.js +2 -2
  72. package/dist/esm/{index-899dba3b.js → index-3df6db84.js} +14 -0
  73. package/dist/esm/loader.js +2 -2
  74. package/dist/esm/xpl-application-shell.entry.js +54 -0
  75. package/dist/esm/xpl-avatar_12.entry.js +284 -0
  76. package/dist/esm/xpl-backdrop.entry.js +21 -0
  77. package/dist/esm/xpl-button-row.entry.js +2 -4
  78. package/dist/esm/xpl-choicelist.entry.js +21 -14
  79. package/dist/esm/xpl-divider.entry.js +2 -2
  80. package/dist/esm/xpl-dropdown-group_3.entry.js +98 -0
  81. package/dist/esm/xpl-dropdown_2.entry.js +118 -0
  82. package/dist/esm/xpl-grid-item.entry.js +2 -2
  83. package/dist/esm/xpl-grid.entry.js +12 -12
  84. package/dist/esm/xpl-input.entry.js +33 -26
  85. package/dist/esm/xpl-list.entry.js +17 -19
  86. package/dist/esm/xpl-main-nav.entry.js +26 -0
  87. package/dist/esm/xpl-pagination.entry.js +8 -8
  88. package/dist/esm/xpl-select.entry.js +87 -85
  89. package/dist/esm/xpl-toggle.entry.js +13 -13
  90. package/dist/stories/application-shell.stories.js +31 -30
  91. package/dist/stories/avatar.stories.js +38 -38
  92. package/dist/stories/backdrop.stories.js +3 -3
  93. package/dist/stories/badge.stories.js +16 -16
  94. package/dist/stories/breadcrumbs.stories.js +18 -16
  95. package/dist/stories/button-row.stories.js +18 -14
  96. package/dist/stories/button.stories.js +69 -57
  97. package/dist/stories/checkbox.stories.js +21 -19
  98. package/dist/stories/choicelist.stories.js +19 -19
  99. package/dist/stories/content-area.stories.js +6 -6
  100. package/dist/stories/divider.stories.js +7 -7
  101. package/dist/stories/dropdown.stories.js +377 -0
  102. package/dist/stories/grid.stories.js +19 -19
  103. package/dist/stories/input.stories.js +93 -77
  104. package/dist/stories/list.stories.js +72 -52
  105. package/dist/stories/main-nav.stories.js +8 -8
  106. package/dist/stories/radio.stories.js +18 -16
  107. package/dist/stories/secondary-nav.stories.js +5 -5
  108. package/dist/stories/select.stories.js +54 -46
  109. package/dist/stories/table.stories.js +29 -29
  110. package/dist/stories/toggle.stories.js +30 -26
  111. package/dist/stories/utility-bar.stories.js +4 -4
  112. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/application-shell.stories.d.ts +4 -4
  113. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/avatar.stories.d.ts +1 -1
  114. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/backdrop.stories.d.ts +1 -1
  115. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/badge.stories.d.ts +1 -1
  116. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/breadcrumbs.stories.d.ts +1 -1
  117. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/button-row.stories.d.ts +1 -1
  118. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/button.stories.d.ts +19 -10
  119. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/checkbox.stories.d.ts +2 -2
  120. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/choicelist.stories.d.ts +1 -1
  121. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/content-area.stories.d.ts +1 -1
  122. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/divider.stories.d.ts +1 -1
  123. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/dropdown.stories.d.ts +134 -0
  124. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/grid.stories.d.ts +1 -1
  125. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/input.stories.d.ts +5 -5
  126. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/list.stories.d.ts +1 -1
  127. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/main-nav.stories.d.ts +1 -1
  128. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/radio.stories.d.ts +1 -1
  129. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/secondary-nav.stories.d.ts +1 -1
  130. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/select.stories.d.ts +2 -2
  131. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/table.stories.d.ts +1 -1
  132. package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/toggle.stories.d.ts +2 -2
  133. package/dist/types/components/xpl-application-shell/xpl-application-shell.d.ts +2 -2
  134. package/dist/types/components/xpl-avatar/xpl-avatar.d.ts +3 -3
  135. package/dist/types/components/xpl-badge/xpl-badge.d.ts +1 -1
  136. package/dist/types/components/xpl-button/xpl-button.d.ts +32 -8
  137. package/dist/types/components/xpl-button-row/xpl-button-row.d.ts +3 -3
  138. package/dist/types/components/xpl-checkbox/xpl-checkbox.d.ts +1 -1
  139. package/dist/types/components/xpl-content-area/xpl-content-area.d.ts +3 -3
  140. package/dist/types/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.d.ts +7 -0
  141. package/dist/types/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.d.ts +5 -0
  142. package/dist/types/components/xpl-input/xpl-input.d.ts +4 -4
  143. package/dist/types/components/xpl-list/xpl-list.d.ts +2 -2
  144. package/dist/types/components/xpl-main-nav/xpl-main-nav.d.ts +1 -1
  145. package/dist/types/components/xpl-nav-item/xpl-nav-item.d.ts +10 -0
  146. package/dist/types/components/xpl-pagination/xpl-pagination.d.ts +1 -1
  147. package/dist/types/components/xpl-radio/xpl-radio.d.ts +1 -1
  148. package/dist/types/components/xpl-select/xpl-select.d.ts +6 -2
  149. package/dist/types/components/xpl-table/xpl-table.d.ts +1 -1
  150. package/dist/types/components/xpl-toggle/xpl-toggle.d.ts +1 -1
  151. package/dist/types/components.d.ts +264 -40
  152. package/package.json +10 -4
  153. package/dist/apollo-core/p-0203d4e8.entry.js +0 -1
  154. package/dist/apollo-core/p-30003b15.entry.js +0 -1
  155. package/dist/apollo-core/p-4e56a2ca.entry.js +0 -1
  156. package/dist/apollo-core/p-7c9fee7e.entry.js +0 -1
  157. package/dist/apollo-core/p-8b6633c7.js +0 -1
  158. package/dist/apollo-core/p-9c5ca308.entry.js +0 -1
  159. package/dist/apollo-core/p-bd4a7e3c.entry.js +0 -1
  160. package/dist/apollo-core/p-dab8e7a1.entry.js +0 -1
  161. package/dist/cjs/xpl-application-shell_11.cjs.entry.js +0 -230
  162. package/dist/cjs/xpl-badge.cjs.entry.js +0 -21
  163. package/dist/cjs/xpl-checkbox_2.cjs.entry.js +0 -51
  164. package/dist/cjs/xpl-table.cjs.entry.js +0 -89
  165. package/dist/cjs/xpl-tag.cjs.entry.js +0 -21
  166. package/dist/esm/xpl-application-shell_11.entry.js +0 -216
  167. package/dist/esm/xpl-badge.entry.js +0 -17
  168. package/dist/esm/xpl-checkbox_2.entry.js +0 -46
  169. package/dist/esm/xpl-table.entry.js +0 -85
  170. package/dist/esm/xpl-tag.entry.js +0 -17
  171. package/dist/types/components/xpl-choicelist/choice.d.ts +0 -6
  172. package/dist/types/components/xpl-dropdown/dropdownchoice.d.ts +0 -6
  173. package/dist/types/components/xpl-dropdown/xpl-dropdown.d.ts +0 -10
  174. package/dist/types/components/xpl-list/listitem.d.ts +0 -16
@@ -1,32 +1,260 @@
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
- }))));
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
32
11
  };
12
+ import { Component, Element, Host, h, Method, Prop } from '@stencil/core';
13
+ export class XplDropdown {
14
+ constructor() {
15
+ /** text to display as heading */
16
+ // eslint-disable-next-line @stencil/strict-mutable
17
+ this.isOpen = false;
18
+ /** options that are listed */
19
+ this.closeOnSelect = true;
20
+ /** constant representing number of options that can be selected */
21
+ this.mode = 'single';
22
+ /** whether selection should be made when focusing on interactable element */
23
+ this.selectOnFocus = false;
24
+ this.handleClickOutside = ({ target }) => {
25
+ const { triggerId } = this;
26
+ const isTrigger = triggerId && target.id === triggerId;
27
+ const isInside = this.hostElement.contains(target);
28
+ if (!isInside && !isTrigger)
29
+ this.isOpen = false;
30
+ };
31
+ }
32
+ /**
33
+ * called on dropdown option click and keydown events to update isSelected states
34
+ */
35
+ async handleSelect(e, { component }) {
36
+ const { hostElement, mode, options, update } = this;
37
+ const isSingle = mode === 'single';
38
+ const isMulti = mode === 'multi';
39
+ if (Boolean(options)) {
40
+ options
41
+ .reduce((acc, curr) => [
42
+ ...acc,
43
+ ...(curr.groupName ? curr.options : [curr]),
44
+ ], [])
45
+ .forEach((option) => {
46
+ const isMatch = option.label === component.hostElement.label;
47
+ if (isSingle) {
48
+ option.isSelected = isMatch;
49
+ component.hostElement.isSelected = option.isSelected;
50
+ }
51
+ else if (isMulti && isMatch) {
52
+ option.isSelected = !option.isSelected;
53
+ component.hostElement.isSelected = option.isSelected;
54
+ }
55
+ });
56
+ const mapOptions = (option) => {
57
+ option.options = option.groupName
58
+ ? option.options.map(mapOptions)
59
+ : undefined;
60
+ return option;
61
+ };
62
+ this.options = options.map(mapOptions);
63
+ }
64
+ else if (isSingle) {
65
+ const optionNodes = Array.from(hostElement.querySelectorAll('xpl-dropdown-option'));
66
+ optionNodes.forEach((node) => (node.isSelected = node === component.hostElement));
67
+ }
68
+ else if (isMulti) {
69
+ component.isSelected = !component.isSelected;
70
+ }
71
+ if (Boolean(update))
72
+ update(e, { component: this });
73
+ }
74
+ componentWillLoad() {
75
+ this.handleSelect = this.handleSelect.bind(this);
76
+ }
77
+ connectedCallback() {
78
+ document.addEventListener('mousedown', this.handleClickOutside.bind(this));
79
+ }
80
+ disconnectedCallback() {
81
+ document.removeEventListener('mousedown', this.handleClickOutside);
82
+ }
83
+ render() {
84
+ let { isOpen } = this;
85
+ const { mode, options } = this;
86
+ const hasOptions = options && options.length;
87
+ const mappedOptions = hasOptions &&
88
+ options.map((_a) => {
89
+ var { groupName, options } = _a, properties = __rest(_a, ["groupName", "options"]);
90
+ return groupName ? (h("xpl-dropdown-group", Object.assign({ groupName: groupName, options: options }, properties))) : (h("xpl-dropdown-option", Object.assign({}, properties)));
91
+ });
92
+ return (h(Host, { "aria-expanded": isOpen, class: {
93
+ 'xpl-dropdown': true,
94
+ 'xpl-dropdown--multi': mode === 'multi',
95
+ 'xpl-dropdown--open': isOpen,
96
+ }, role: "listbox" },
97
+ h("ul", { class: "xpl-dropdown-list" }, mappedOptions || h("slot", { name: "options" }))));
98
+ }
99
+ static get is() { return "xpl-dropdown"; }
100
+ static get properties() { return {
101
+ "isOpen": {
102
+ "type": "boolean",
103
+ "mutable": true,
104
+ "complexType": {
105
+ "original": "boolean",
106
+ "resolved": "boolean",
107
+ "references": {}
108
+ },
109
+ "required": false,
110
+ "optional": false,
111
+ "docs": {
112
+ "tags": [],
113
+ "text": "text to display as heading"
114
+ },
115
+ "attribute": "open",
116
+ "reflect": true,
117
+ "defaultValue": "false"
118
+ },
119
+ "closeOnSelect": {
120
+ "type": "boolean",
121
+ "mutable": false,
122
+ "complexType": {
123
+ "original": "boolean",
124
+ "resolved": "boolean",
125
+ "references": {}
126
+ },
127
+ "required": false,
128
+ "optional": false,
129
+ "docs": {
130
+ "tags": [],
131
+ "text": "options that are listed"
132
+ },
133
+ "attribute": "close-on-select",
134
+ "reflect": false,
135
+ "defaultValue": "true"
136
+ },
137
+ "mode": {
138
+ "type": "string",
139
+ "mutable": false,
140
+ "complexType": {
141
+ "original": "'single' | 'multi'",
142
+ "resolved": "\"multi\" | \"single\"",
143
+ "references": {}
144
+ },
145
+ "required": false,
146
+ "optional": false,
147
+ "docs": {
148
+ "tags": [],
149
+ "text": "constant representing number of options that can be selected"
150
+ },
151
+ "attribute": "mode",
152
+ "reflect": false,
153
+ "defaultValue": "'single'"
154
+ },
155
+ "options": {
156
+ "type": "unknown",
157
+ "mutable": false,
158
+ "complexType": {
159
+ "original": "DropdownItem[]",
160
+ "resolved": "Partial<DropdownOption & DropdownOptionGroup>[]",
161
+ "references": {
162
+ "DropdownItem": {
163
+ "location": "global"
164
+ }
165
+ }
166
+ },
167
+ "required": false,
168
+ "optional": true,
169
+ "docs": {
170
+ "tags": [],
171
+ "text": "options that are listed"
172
+ }
173
+ },
174
+ "selectOnFocus": {
175
+ "type": "boolean",
176
+ "mutable": false,
177
+ "complexType": {
178
+ "original": "boolean",
179
+ "resolved": "boolean",
180
+ "references": {}
181
+ },
182
+ "required": false,
183
+ "optional": false,
184
+ "docs": {
185
+ "tags": [],
186
+ "text": "whether selection should be made when focusing on interactable element"
187
+ },
188
+ "attribute": "select-on-focus",
189
+ "reflect": false,
190
+ "defaultValue": "false"
191
+ },
192
+ "triggerId": {
193
+ "type": "string",
194
+ "mutable": false,
195
+ "complexType": {
196
+ "original": "string",
197
+ "resolved": "string",
198
+ "references": {}
199
+ },
200
+ "required": false,
201
+ "optional": false,
202
+ "docs": {
203
+ "tags": [],
204
+ "text": "the id for the element that triggers the open state"
205
+ },
206
+ "attribute": "trigger-id",
207
+ "reflect": false
208
+ },
209
+ "update": {
210
+ "type": "unknown",
211
+ "mutable": false,
212
+ "complexType": {
213
+ "original": "(e: Event, { component: XplDropdown }) => void",
214
+ "resolved": "(e: Event, { component: XplDropdown }: { component: any; }) => void",
215
+ "references": {
216
+ "Event": {
217
+ "location": "global"
218
+ }
219
+ }
220
+ },
221
+ "required": false,
222
+ "optional": true,
223
+ "docs": {
224
+ "tags": [],
225
+ "text": "call back function invoked when a selection is made"
226
+ }
227
+ }
228
+ }; }
229
+ static get methods() { return {
230
+ "handleSelect": {
231
+ "complexType": {
232
+ "signature": "(e: Event, { component }: { component: any; }) => Promise<void>",
233
+ "parameters": [{
234
+ "tags": [],
235
+ "text": ""
236
+ }, {
237
+ "tags": [],
238
+ "text": ""
239
+ }],
240
+ "references": {
241
+ "Promise": {
242
+ "location": "global"
243
+ },
244
+ "Event": {
245
+ "location": "global"
246
+ },
247
+ "DropdownItem": {
248
+ "location": "global"
249
+ }
250
+ },
251
+ "return": "Promise<void>"
252
+ },
253
+ "docs": {
254
+ "text": "called on dropdown option click and keydown events to update isSelected states",
255
+ "tags": []
256
+ }
257
+ }
258
+ }; }
259
+ static get elementRef() { return "hostElement"; }
260
+ }
@@ -1,25 +1,25 @@
1
1
  import { Component, Host, h, Element } from '@stencil/core';
2
2
  export class XplGrid {
3
3
  componentDidLoad() {
4
- const items = Array.from(this.container.querySelectorAll(".xpl-grid-item"));
4
+ const items = Array.from(this.container.querySelectorAll('.xpl-grid-item'));
5
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;
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
11
  if (lgCounter % 6 === 0)
12
- item.classList.add("xpl-grid-item-lg-last");
12
+ item.classList.add('xpl-grid-item-lg-last');
13
13
  if (mdCounter % 6 === 0)
14
- item.classList.add("xpl-grid-item-md-last");
14
+ item.classList.add('xpl-grid-item-md-last');
15
15
  if (smCounter % 6 === 0)
16
- item.classList.add("xpl-grid-item-sm-last");
16
+ item.classList.add('xpl-grid-item-sm-last');
17
17
  if (xsCounter % 6 === 0)
18
- item.classList.add("xpl-grid-item-xs-last");
18
+ item.classList.add('xpl-grid-item-xs-last');
19
19
  });
20
20
  }
21
21
  render() {
22
- return (h(Host, { class: "xpl-grid" }));
22
+ return h(Host, { class: "xpl-grid" });
23
23
  }
24
24
  static get is() { return "xpl-grid"; }
25
25
  static get elementRef() { return "container"; }
@@ -7,7 +7,7 @@ export class XplGridItem {
7
7
  this.lg = 6;
8
8
  }
9
9
  render() {
10
- let className = "xpl-grid-item";
10
+ let className = 'xpl-grid-item';
11
11
  className += ` xpl-grid-item-xs-${this.xs}`;
12
12
  className += ` xpl-grid-item-sm-${this.sm}`;
13
13
  className += ` xpl-grid-item-md-${this.md}`;
@@ -1,28 +1,30 @@
1
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>`;
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
7
+ ? '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'
8
+ : '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
9
  export class XplInput {
8
10
  constructor() {
9
11
  /**
10
12
  * See https://flatpickr.js.org/formatting/
11
13
  */
12
- this.dateFormat = "Y-m-d";
14
+ this.dateFormat = 'Y-m-d';
13
15
  /**
14
16
  * For datepicker inputs, whether to allow only a single
15
17
  * date or a range of dates. (Multiple non-consecutive
16
18
  * dates planned to be supported in the future.)
17
19
  */
18
- this.mode = "single";
20
+ this.mode = 'single';
19
21
  /**
20
22
  * Whether to render as a singleline text input or
21
23
  * as a multiline textarea. (If `true`, `pre` and `post`
22
24
  * values will be ignored, if present.)
23
25
  */
24
26
  this.multiline = false;
25
- this.type = "text";
27
+ this.type = 'text';
26
28
  this.characterCount = 0;
27
29
  this.passwordVisible = false;
28
30
  }
@@ -30,14 +32,15 @@ export class XplInput {
30
32
  this.characterCount = this.input.value.length;
31
33
  }
32
34
  componentWillLoad() {
33
- if (this._id === undefined || this._id === null || this._id === "")
35
+ if (this._id === undefined || this._id === null || this._id === '')
34
36
  this._id = uuid();
35
37
  if (this.multiline && this.maxCharacterCount !== undefined) {
36
- this.characterCount = this.value !== undefined ? this.value.length : 0;
38
+ this.characterCount =
39
+ this.value !== undefined ? this.value.length : 0;
37
40
  }
38
41
  }
39
42
  componentDidLoad() {
40
- if (this.type === "date") {
43
+ if (this.type === 'date') {
41
44
  flatpickr(this.input, {
42
45
  allowInput: true,
43
46
  dateFormat: this.dateFormat,
@@ -46,59 +49,63 @@ export class XplInput {
46
49
  minDate: this.min,
47
50
  mode: this.mode,
48
51
  nextArrow: arrowSvg(),
49
- prevArrow: arrowSvg(true)
52
+ prevArrow: arrowSvg(true),
50
53
  });
51
54
  }
52
55
  }
53
56
  render() {
54
- let className = "xpl-input";
57
+ let className = 'xpl-input';
55
58
  if (this.disabled)
56
- className += " xpl-input--disabled";
59
+ className += ' xpl-input--disabled';
57
60
  let hasError = false;
58
61
  if (this.error !== undefined)
59
62
  hasError = true;
60
- if (this.multiline && this.maxCharacterCount !== undefined && this.characterCount > this.maxCharacterCount)
63
+ if (this.multiline &&
64
+ this.maxCharacterCount !== undefined &&
65
+ this.characterCount > this.maxCharacterCount)
61
66
  hasError = true;
62
67
  if (hasError)
63
- className += " xpl-input--error";
68
+ className += ' xpl-input--error';
64
69
  let type = this.type;
65
- if (type === "password" && this.passwordVisible) {
66
- type = "text";
70
+ if (type === 'password' && this.passwordVisible) {
71
+ type = 'text';
67
72
  }
68
73
  return (h(Host, { class: className },
69
74
  h("label", { class: "xpl-input-label", htmlFor: this._id },
70
75
  this.label,
71
76
  this.description && h("small", null, this.description)),
72
77
  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: () => {
78
+ this.pre && !this.multiline && (h("label", { class: "xpl-input-pre", htmlFor: this._id }, this.pre)),
79
+ !this.multiline ? (h("input", { autocomplete: this.type === 'date' ? 'off' : this.autocomplete, disabled: this.disabled, id: this._id, max: this.max, min: this.min, name: this.name, placeholder: this.placeholder, readonly: this.readonly, ref: (el) => {
80
+ this.input = el;
81
+ }, required: this.required, step: this.step, type: type, value: this.value })) : (h("textarea", { disabled: this.disabled, id: this._id, name: this.name, onInput: () => this.updateCharacterCount(), placeholder: this.placeholder, readonly: this.readonly, ref: (el) => {
82
+ this.input = el;
83
+ }, required: this.required }, this.value)),
84
+ this.type === 'date' && (h("span", { class: "xpl-input-calendar" },
85
+ h("i", { class: "far fa-calendar-alt" }))),
86
+ this.type === 'password' && (h("button", { class: "xpl-input-password", onClick: () => {
84
87
  this.passwordVisible = !this.passwordVisible;
85
88
  }, role: "presentation" },
86
89
  h("span", { class: "sr-only" }, "Toggle password visibility"),
87
90
  h("i", { class: "far fa-eye", style: {
88
- display: this.passwordVisible ? "none" : "block"
91
+ display: this.passwordVisible
92
+ ? 'none'
93
+ : 'block',
89
94
  } }),
90
95
  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" },
96
+ display: this.passwordVisible
97
+ ? 'block'
98
+ : 'none',
99
+ } }))),
100
+ this.post && !this.multiline && (h("label", { class: "xpl-input-post", htmlFor: this._id }, this.post)),
101
+ this.multiline && this.maxCharacterCount !== undefined && (h("span", { class: "xpl-input-characters" },
95
102
  this.characterCount,
96
103
  "/",
97
- this.maxCharacterCount)),
98
- this.error !== undefined && this.error.length > 0 && h("label", { class: "xpl-input-error", htmlFor: this._id },
104
+ this.maxCharacterCount))),
105
+ this.error !== undefined && this.error.length > 0 && (h("label", { class: "xpl-input-error", htmlFor: this._id },
99
106
  h("svg", { width: "10", height: "11", viewBox: "0 0 10 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
100
107
  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)));
108
+ this.error))));
102
109
  }
103
110
  static get is() { return "xpl-input"; }
104
111
  static get properties() { return {
@@ -152,7 +159,7 @@ export class XplInput {
152
159
  },
153
160
  "attribute": "date-format",
154
161
  "reflect": false,
155
- "defaultValue": "\"Y-m-d\""
162
+ "defaultValue": "'Y-m-d'"
156
163
  },
157
164
  "description": {
158
165
  "type": "string",
@@ -277,7 +284,7 @@ export class XplInput {
277
284
  "type": "string",
278
285
  "mutable": false,
279
286
  "complexType": {
280
- "original": "\"single\" | /* \"multiple\" | */ \"range\"",
287
+ "original": "'single' | /* \"multiple\" | */ 'range'",
281
288
  "resolved": "\"range\" | \"single\"",
282
289
  "references": {}
283
290
  },
@@ -289,7 +296,7 @@ export class XplInput {
289
296
  },
290
297
  "attribute": "mode",
291
298
  "reflect": false,
292
- "defaultValue": "\"single\""
299
+ "defaultValue": "'single'"
293
300
  },
294
301
  "multiline": {
295
302
  "type": "boolean",
@@ -432,7 +439,7 @@ export class XplInput {
432
439
  "type": "string",
433
440
  "mutable": false,
434
441
  "complexType": {
435
- "original": "\"date\" | \"text\" | \"number\" | \"password\"",
442
+ "original": "'date' | 'text' | 'number' | 'password'",
436
443
  "resolved": "\"date\" | \"number\" | \"password\" | \"text\"",
437
444
  "references": {}
438
445
  },
@@ -444,7 +451,7 @@ export class XplInput {
444
451
  },
445
452
  "attribute": "type",
446
453
  "reflect": false,
447
- "defaultValue": "\"text\""
454
+ "defaultValue": "'text'"
448
455
  },
449
456
  "value": {
450
457
  "type": "string",
@@ -1,42 +1,40 @@
1
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 }) => {
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
6
  const hasRight = avatars || badges || subtext;
7
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)),
8
+ avatar &&
9
+ (avatar.slice(0, 1) === '/' || avatar.slice(0, 4) === 'http' ? (h("xpl-avatar", { src: avatar, name: title })) : (h("xpl-avatar", { name: title }, avatar))),
11
10
  h("div", { class: "xpl-list-item-content" },
12
11
  h("div", { class: "xpl-list-left" },
13
12
  h("div", null,
14
13
  h("h4", null, title),
15
- metadata && (h("ul", { class: "xpl-list-item-metadata" }, metadata.map(d => {
16
- if (typeof d === "string") {
14
+ metadata && (h("ul", { class: "xpl-list-item-metadata" }, metadata.map((d) => {
15
+ if (typeof d === 'string') {
17
16
  return h("li", null, d);
18
17
  }
19
18
  else {
20
- return h("li", null,
19
+ return (h("li", null,
21
20
  h("span", { class: `far fa-${d.icon}` }),
22
- " ",
23
- d.text);
21
+ ' ',
22
+ d.text));
24
23
  }
25
24
  }))))),
26
25
  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);
26
+ subtext && (h("div", { class: "xpl-list-item-subtext" }, subtext)),
27
+ avatars && (h("div", { class: "xpl-avatar-group xpl-avatar-group--s" }, avatars.map((a) => (h("img", { src: a, alt: "" }))))),
28
+ badges &&
29
+ 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 ? (h("a", { class: "xpl-list-item", href: href }, inner)) : (h("div", { class: "xpl-list-item" }, inner));
40
38
  };
41
39
  export class XplList {
42
40
  constructor() {
@@ -65,7 +63,7 @@ export class XplList {
65
63
  this.items = [];
66
64
  }
67
65
  render() {
68
- return (h(Host, null, this.items.map(item => h(ListItemCpt, Object.assign({}, item)))));
66
+ return (h(Host, null, this.items.map((item) => (h(ListItemCpt, Object.assign({}, item))))));
69
67
  }
70
68
  static get is() { return "xpl-list"; }
71
69
  static get properties() { return {
@@ -4,7 +4,7 @@ export class XplMainNav {
4
4
  /**
5
5
  * @property {string} width - The width of the Main Nav.
6
6
  */
7
- this.width = "default";
7
+ this.width = 'default';
8
8
  }
9
9
  navWidthHandler() {
10
10
  this.navWidth.emit(this.width);
@@ -32,7 +32,7 @@ export class XplMainNav {
32
32
  "type": "string",
33
33
  "mutable": false,
34
34
  "complexType": {
35
- "original": "\"default\" | \"md\" | \"sm\"",
35
+ "original": "'default' | 'md' | 'sm'",
36
36
  "resolved": "\"default\" | \"md\" | \"sm\"",
37
37
  "references": {}
38
38
  },
@@ -47,7 +47,7 @@ export class XplMainNav {
47
47
  },
48
48
  "attribute": "width",
49
49
  "reflect": false,
50
- "defaultValue": "\"default\""
50
+ "defaultValue": "'default'"
51
51
  }
52
52
  }; }
53
53
  static get events() { return [{