@xplortech/apollo-core 2.7.1 → 2.8.1
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/.typings/apollo-components.html-data.json +8 -4
- package/AGENTS.md +27 -0
- package/dist/apollo-core/apollo-core.esm.js +1 -1
- package/dist/apollo-core/p-689f1dae.entry.js +1 -0
- package/dist/apollo-core/p-cd56a3d5.entry.js +1 -0
- package/dist/cjs/apollo-core.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/xpl-avatar_54.cjs.entry.js +1071 -40
- package/dist/cjs/xpl-toggle.cjs.entry.js +8 -3
- package/dist/collection/components/xpl-avatar/xpl-avatar.js +4 -4
- package/dist/collection/components/xpl-badge/xpl-badge.js +1 -1
- package/dist/collection/components/xpl-checkbox/xpl-checkbox.js +7 -12
- package/dist/collection/components/xpl-choicelist/xpl-choicelist.js +7 -6
- package/dist/collection/components/xpl-input/xpl-input.js +28 -24
- package/dist/collection/components/xpl-popover/xpl-popover.js +1 -1
- package/dist/collection/components/xpl-radio/radio.stories.js +10 -1
- package/dist/collection/components/xpl-radio/xpl-radio.js +30 -5
- package/dist/collection/components/xpl-spotlight/xpl-spotlight.js +2 -2
- package/dist/collection/components/xpl-tag/xpl-tag.js +2 -2
- package/dist/collection/components/xpl-toggle/xpl-toggle.js +26 -4
- package/dist/components/xpl-checkbox2.js +1 -1
- package/dist/components/xpl-choicelist.js +1 -1
- package/dist/components/xpl-icon2.js +1 -1
- package/dist/components/xpl-input2.js +1 -1
- package/dist/components/xpl-radio2.js +1 -1
- package/dist/components/xpl-toggle.js +1 -1
- package/dist/docs/xpl-checkbox/readme.md +5 -3
- package/dist/docs/xpl-radio/readme.md +10 -9
- package/dist/docs/xpl-toggle/readme.md +16 -9
- package/dist/esm/apollo-core.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/xpl-avatar_54.entry.js +1071 -40
- package/dist/esm/xpl-toggle.entry.js +9 -4
- package/dist/types/components/xpl-checkbox/xpl-checkbox.d.ts +1 -1
- package/dist/types/components/xpl-input/xpl-input.d.ts +3 -2
- package/dist/types/components/xpl-radio/radio.stories.d.ts +10 -1
- package/dist/types/components/xpl-radio/xpl-radio.d.ts +2 -0
- package/dist/types/components/xpl-toggle/xpl-toggle.d.ts +3 -0
- package/dist/types/components.d.ts +39 -11
- package/package.json +33 -5
- package/dist/apollo-core/p-d1c9c233.entry.js +0 -1
- package/dist/apollo-core/p-e2a5d41c.entry.js +0 -1
- /package/dist/types/{home/runner/work/apollo → Users/roc/Sites}/apollo/packages/apollo-core/.stencil/css/typography.stories.d.ts +0 -0
|
@@ -6,8 +6,13 @@ var v4 = require('./v4-D4KzFnn8.js');
|
|
|
6
6
|
const Toggle = class {
|
|
7
7
|
constructor(hostRef) {
|
|
8
8
|
index.registerInstance(this, hostRef);
|
|
9
|
+
this.toggleChange = index.createEvent(this, "toggleChange", 7);
|
|
9
10
|
this.variant = 'default';
|
|
10
11
|
this.id = v4.v4();
|
|
12
|
+
this.onChange = (event) => {
|
|
13
|
+
const target = event.target;
|
|
14
|
+
this.toggleChange.emit(target.checked);
|
|
15
|
+
};
|
|
11
16
|
}
|
|
12
17
|
render() {
|
|
13
18
|
let containerClassName = 'xpl-toggle-container';
|
|
@@ -16,13 +21,13 @@ const Toggle = class {
|
|
|
16
21
|
let className = 'xpl-toggle';
|
|
17
22
|
if (this.variant === 'small')
|
|
18
23
|
className += ' xpl-toggle--small';
|
|
19
|
-
return (index.h(index.Host, { key: '
|
|
24
|
+
return (index.h(index.Host, { key: '2665ccecd2df94b7ed7443e2ecb6265fca7f235f', class: containerClassName }, (this.heading || this.description) && (index.h("label", { key: '75292b431419e1d34c127a82d61baa1ee024a2bb', class: {
|
|
20
25
|
'xpl-label': true,
|
|
21
26
|
'xpl-label--disabled': this.disabled,
|
|
22
|
-
}, htmlFor: this.id }, this.heading, this.description && (index.h("small", { key: '
|
|
27
|
+
}, htmlFor: this.id }, this.heading, this.description && (index.h("small", { key: '772e34c7d553faee5b1dfc448ecb95706dc3e8df', class: {
|
|
23
28
|
'xpl-description': true,
|
|
24
29
|
'xpl-description--disabled': this.disabled,
|
|
25
|
-
} }, this.description)))), index.h("input", { key: '
|
|
30
|
+
} }, this.description)))), index.h("input", { key: 'afec8fff16aadca330c804832dbd41c4b10f5caa', class: className, type: "checkbox", checked: this.checked, disabled: this.disabled, id: this.id, name: this.name, onChange: this.onChange }), this.label && index.h("label", { key: '1b25d01805915cb2dacf03ad9340beec61565bcc', htmlFor: this.id }, this.label)));
|
|
26
31
|
}
|
|
27
32
|
};
|
|
28
33
|
|
|
@@ -161,7 +161,7 @@ export class Avatar {
|
|
|
161
161
|
"references": {
|
|
162
162
|
"AvatarColor": {
|
|
163
163
|
"location": "local",
|
|
164
|
-
"path": "/
|
|
164
|
+
"path": "/Users/roc/Sites/apollo/packages/apollo-core/src/components/components/xpl-avatar/xpl-avatar.tsx",
|
|
165
165
|
"id": "src/components/components/xpl-avatar/xpl-avatar.tsx::AvatarColor"
|
|
166
166
|
}
|
|
167
167
|
}
|
|
@@ -206,7 +206,7 @@ export class Avatar {
|
|
|
206
206
|
"references": {
|
|
207
207
|
"AvatarGroupItem": {
|
|
208
208
|
"location": "local",
|
|
209
|
-
"path": "/
|
|
209
|
+
"path": "/Users/roc/Sites/apollo/packages/apollo-core/src/components/components/xpl-avatar/xpl-avatar.tsx",
|
|
210
210
|
"id": "src/components/components/xpl-avatar/xpl-avatar.tsx::AvatarGroupItem"
|
|
211
211
|
}
|
|
212
212
|
}
|
|
@@ -307,7 +307,7 @@ export class Avatar {
|
|
|
307
307
|
"references": {
|
|
308
308
|
"AvatarStatus": {
|
|
309
309
|
"location": "local",
|
|
310
|
-
"path": "/
|
|
310
|
+
"path": "/Users/roc/Sites/apollo/packages/apollo-core/src/components/components/xpl-avatar/xpl-avatar.tsx",
|
|
311
311
|
"id": "src/components/components/xpl-avatar/xpl-avatar.tsx::AvatarStatus"
|
|
312
312
|
}
|
|
313
313
|
}
|
|
@@ -373,7 +373,7 @@ export class Avatar {
|
|
|
373
373
|
"references": {
|
|
374
374
|
"AvatarVariant": {
|
|
375
375
|
"location": "local",
|
|
376
|
-
"path": "/
|
|
376
|
+
"path": "/Users/roc/Sites/apollo/packages/apollo-core/src/components/components/xpl-avatar/xpl-avatar.tsx",
|
|
377
377
|
"id": "src/components/components/xpl-avatar/xpl-avatar.tsx::AvatarVariant"
|
|
378
378
|
}
|
|
379
379
|
}
|
|
@@ -140,7 +140,7 @@ export class Badge {
|
|
|
140
140
|
"references": {
|
|
141
141
|
"BadgeVariantProp": {
|
|
142
142
|
"location": "local",
|
|
143
|
-
"path": "/
|
|
143
|
+
"path": "/Users/roc/Sites/apollo/packages/apollo-core/src/components/components/xpl-badge/xpl-badge.tsx",
|
|
144
144
|
"id": "src/components/components/xpl-badge/xpl-badge.tsx::BadgeVariantProp"
|
|
145
145
|
}
|
|
146
146
|
}
|
|
@@ -6,24 +6,19 @@ export class Checkbox {
|
|
|
6
6
|
this.ariaLabel = '';
|
|
7
7
|
this.onChange = (event) => {
|
|
8
8
|
const target = event.target;
|
|
9
|
-
|
|
10
|
-
this.checkboxChange.emit(this.value);
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
this.checkboxChange.emit(target.checked);
|
|
14
|
-
}
|
|
9
|
+
this.checkboxChange.emit(target.checked);
|
|
15
10
|
};
|
|
16
11
|
}
|
|
17
12
|
render() {
|
|
18
13
|
var _a;
|
|
19
|
-
return (h(Host, { key: '
|
|
14
|
+
return (h(Host, { key: 'dd508c61fc68052f2bbdfccd606ea8f0109783f3', class: {
|
|
20
15
|
'xpl-checkbox-radio-container': true,
|
|
21
16
|
styled: this.styled,
|
|
22
17
|
disabled: this.disabled,
|
|
23
|
-
} }, h("input", { key: '
|
|
18
|
+
} }, h("input", { key: 'c5b482a12c02cb4384444e3d385cccc17a8cbd3c', class: "xpl-checkbox", type: "checkbox", "aria-label": ((_a = this.ariaLabel) !== null && _a !== void 0 ? _a : '').trim() || undefined, checked: this.checked, "data-id": this.dataId, disabled: this.disabled, id: this.id, indeterminate: this.indeterminate, onChange: this.onChange, name: this.name, required: this.required, value: this.value }), h("label", { key: 'e5ae6eef395457ff6021b008bbb4221e7c36a3c9', class: {
|
|
24
19
|
'xpl-label': true,
|
|
25
20
|
'xpl-label--disabled': this.disabled,
|
|
26
|
-
}, htmlFor: this.id }, h("slot", { key: '
|
|
21
|
+
}, htmlFor: this.id }, h("slot", { key: '71ae02b761df01bea00b483e21a9b442b8fbdd9f' }), this.description && (h("small", { key: 'f34f7e323cd9c39ce1094177e7a4d3cf4b06f788', class: {
|
|
27
22
|
'xpl-description': true,
|
|
28
23
|
'xpl-description--disabled': this.disabled,
|
|
29
24
|
} }, this.description)))));
|
|
@@ -238,11 +233,11 @@ export class Checkbox {
|
|
|
238
233
|
"composed": true,
|
|
239
234
|
"docs": {
|
|
240
235
|
"tags": [],
|
|
241
|
-
"text": "
|
|
236
|
+
"text": "Emits the new checked state of the checkbox after a user interaction.\n\nAlways emits a boolean so the event payload reliably represents whether\nthe checkbox is now on or off. This is what Vue `v-model` binds to via\nthe `checked` attribute \u2014 emitting the `value` string here would coerce\nany non-empty string to `true` and make it impossible to uncheck a\ncheckbox that has a `value` prop set. Consumers that need the `value`\ncan read it from the host element (`event.target.value`) or rely on\nnative form submission (`name`/`value` pair)."
|
|
242
237
|
},
|
|
243
238
|
"complexType": {
|
|
244
|
-
"original": "
|
|
245
|
-
"resolved": "boolean
|
|
239
|
+
"original": "boolean",
|
|
240
|
+
"resolved": "boolean",
|
|
246
241
|
"references": {}
|
|
247
242
|
}
|
|
248
243
|
}];
|
|
@@ -3,20 +3,21 @@ import { v4 as uuid } from "uuid";
|
|
|
3
3
|
export class Choicelist {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.name = uuid();
|
|
6
|
-
this.onChoiceChange = (
|
|
6
|
+
this.onChoiceChange = (_value, choiceIndex) => {
|
|
7
|
+
const choice = this.choices[choiceIndex];
|
|
7
8
|
if (this.multi) {
|
|
8
9
|
this.selected = this.selected.map((isSelected, index) => index === choiceIndex ? !isSelected : isSelected);
|
|
9
|
-
if (
|
|
10
|
+
if ((choice === null || choice === void 0 ? void 0 : choice.value) !== undefined) {
|
|
10
11
|
const changedValues = this.choices
|
|
11
12
|
.filter((_, index) => this.selected[index])
|
|
12
|
-
.map((
|
|
13
|
+
.map((c, index) => { var _a; return (_a = c.value) !== null && _a !== void 0 ? _a : this.selected[index]; });
|
|
13
14
|
this.choicelistValueChange.emit(changedValues);
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
17
|
else {
|
|
17
18
|
this.selected = this.selected.map((_, index) => index === choiceIndex);
|
|
18
|
-
if (
|
|
19
|
-
this.choicelistValueChange.emit(value);
|
|
19
|
+
if ((choice === null || choice === void 0 ? void 0 : choice.value) !== undefined) {
|
|
20
|
+
this.choicelistValueChange.emit(choice.value);
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
};
|
|
@@ -35,7 +36,7 @@ export class Choicelist {
|
|
|
35
36
|
this.onChoicesPropChange(this.choices);
|
|
36
37
|
}
|
|
37
38
|
render() {
|
|
38
|
-
return (h(Host, { key: '
|
|
39
|
+
return (h(Host, { key: 'd2da0f5aeb424a36fb117711f34c0631c464ef6a', class: "xpl-choicelist-container" }, this.heading !== undefined || this.description !== undefined ? (h("div", { class: "xpl-choicelist-heading" }, this.heading && h("h3", null, this.heading), this.description && h("p", null, this.description))) : null, this.choices && (h("ul", { key: 'a40e08f0fd60a5268ed9f4d15a97b3fa677e2e46', class: {
|
|
39
40
|
'xpl-choicelist': true,
|
|
40
41
|
'xpl-choicelist--styled': this.styled,
|
|
41
42
|
} }, this.choices.map((choice, i) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h, Host, } from "@stencil/core";
|
|
2
2
|
import { v4 as uuid } from "uuid";
|
|
3
3
|
export class Input {
|
|
4
4
|
constructor() {
|
|
@@ -16,6 +16,10 @@ export class Input {
|
|
|
16
16
|
this.isInternational = true;
|
|
17
17
|
this.ariaLabel = '';
|
|
18
18
|
this.type = 'text';
|
|
19
|
+
this.handleChildValueChange = (event) => {
|
|
20
|
+
event.stopPropagation();
|
|
21
|
+
this.valueChange.emit(event.detail);
|
|
22
|
+
};
|
|
19
23
|
this.valueChanged = (event) => {
|
|
20
24
|
const target = event.target;
|
|
21
25
|
this.valueChange.emit(target.value);
|
|
@@ -103,19 +107,19 @@ export class Input {
|
|
|
103
107
|
var _a, _b, _c, _d, _e, _f;
|
|
104
108
|
switch (this.type) {
|
|
105
109
|
case 'file':
|
|
106
|
-
return (h("xpl-input-file", { accept: this.accept, disabled: this.disabled, hideAcceptText: this.hideAcceptText, hideFileNames: this.hideFileNames, hideTriggerOnSelect: this.hideTriggerOnSelect, multiple: this.multiple, name: this.name, _id: this._id }, h("slot", { name: "trigger" })));
|
|
110
|
+
return (h("xpl-input-file", { accept: this.accept, disabled: this.disabled, hideAcceptText: this.hideAcceptText, hideFileNames: this.hideFileNames, hideTriggerOnSelect: this.hideTriggerOnSelect, multiple: this.multiple, name: this.name, onInputChange: this.handleChildValueChange, _id: this._id }, h("slot", { name: "trigger" })));
|
|
107
111
|
case 'color':
|
|
108
|
-
return (h("xpl-input-color", { disabled: this.disabled, value: this.value, placeholder: this.placeholder, required: this.required, hideEyeDropper: this.hideEyeDropper }));
|
|
112
|
+
return (h("xpl-input-color", { disabled: this.disabled, value: this.value, placeholder: this.placeholder, required: this.required, hideEyeDropper: this.hideEyeDropper, onInputChange: this.handleChildValueChange }));
|
|
109
113
|
case 'date':
|
|
110
|
-
return (h("xpl-input-date", { inputId: this._id, disabled: this.disabled, name: this.name, required: this.required, readonly: this.readonly, value: this.value, placeholder: this.placeholder, post: this.post, pre: this.pre, max: this.max, min: this.min, dateFormat: this.dateFormat, mode: this.mode }));
|
|
114
|
+
return (h("xpl-input-date", { inputId: this._id, disabled: this.disabled, name: this.name, required: this.required, readonly: this.readonly, value: this.value, placeholder: this.placeholder, post: this.post, pre: this.pre, max: this.max, min: this.min, dateFormat: this.dateFormat, mode: this.mode, onValueChange: this.handleChildValueChange }));
|
|
111
115
|
case 'time':
|
|
112
|
-
return (h("xpl-input-time", { inputId: this._id, disabled: this.disabled, name: this.name, required: this.required, readonly: this.readonly, value: this.value, placeholder: this.placeholder, max: this.max, min: this.min, step: this.step, mode: this.mode, timeFormat: this.timeFormat, allowCustomOption: this.allowCustomOption }));
|
|
116
|
+
return (h("xpl-input-time", { inputId: this._id, disabled: this.disabled, name: this.name, required: this.required, readonly: this.readonly, value: this.value, placeholder: this.placeholder, max: this.max, min: this.min, step: this.step, mode: this.mode, timeFormat: this.timeFormat, allowCustomOption: this.allowCustomOption, onValueChange: this.handleChildValueChange }));
|
|
113
117
|
case 'phone':
|
|
114
|
-
return (h("xpl-input-phone", { inputId: this._id, disabled: this.disabled, name: this.name, required: this.required, readonly: this.readonly, value: this.value, placeholder: this.placeholder, defaultCountry: this.defaultCountry, preferredCountries: this.preferredCountries, isInternational: this.isInternational }));
|
|
118
|
+
return (h("xpl-input-phone", { inputId: this._id, disabled: this.disabled, name: this.name, required: this.required, readonly: this.readonly, value: this.value, placeholder: this.placeholder, defaultCountry: this.defaultCountry, preferredCountries: this.preferredCountries, isInternational: this.isInternational, onValueChange: this.handleChildValueChange }));
|
|
115
119
|
case 'search': {
|
|
116
120
|
const hasVisibleLabel = Boolean(((_a = this.label) !== null && _a !== void 0 ? _a : '').trim());
|
|
117
121
|
const hasErrorMessage = Boolean(this.error && this.error.length > 0);
|
|
118
|
-
return (h("xpl-input-search", { ariaLabel: ((_b = this.ariaLabel) !== null && _b !== void 0 ? _b : '').trim() || 'Search', autocomplete: (_c = this.autocomplete) !== null && _c !== void 0 ? _c : 'off', disabled: this.disabled, errorMessageId: hasErrorMessage ? `${this._id}-error` : undefined, hasError: hasErrorMessage, hasVisibleLabel: hasVisibleLabel, inputId: this._id, name: this.name, onBlurEvent: this.handleSearchBlurForward, onFocusEvent: this.handleSearchFocusForward, onSearch: this.handleSearchCommit, placeholder: (_d = this.placeholder) !== null && _d !== void 0 ? _d : 'Search', readonly: this.readonly, ref: (el) => {
|
|
122
|
+
return (h("xpl-input-search", { ariaLabel: ((_b = this.ariaLabel) !== null && _b !== void 0 ? _b : '').trim() || 'Search', autocomplete: (_c = this.autocomplete) !== null && _c !== void 0 ? _c : 'off', disabled: this.disabled, errorMessageId: hasErrorMessage ? `${this._id}-error` : undefined, hasError: hasErrorMessage, hasVisibleLabel: hasVisibleLabel, inputId: this._id, name: this.name, onBlurEvent: this.handleSearchBlurForward, onFocusEvent: this.handleSearchFocusForward, onSearch: this.handleSearchCommit, onValueChange: this.handleChildValueChange, placeholder: (_d = this.placeholder) !== null && _d !== void 0 ? _d : 'Search', readonly: this.readonly, ref: (el) => {
|
|
119
123
|
this.searchInputRef = el !== null && el !== void 0 ? el : undefined;
|
|
120
124
|
}, required: this.required, shape: (_e = this.shape) !== null && _e !== void 0 ? _e : 'rounded', value: (_f = this.value) !== null && _f !== void 0 ? _f : '' }));
|
|
121
125
|
}
|
|
@@ -147,13 +151,13 @@ export class Input {
|
|
|
147
151
|
if (type === 'password' && this.passwordVisible) {
|
|
148
152
|
type = 'text';
|
|
149
153
|
}
|
|
150
|
-
return (h(Host, { key: '
|
|
154
|
+
return (h(Host, { key: '406ab6d1b4d43ceb06cdb819cec8699d2d3322b3', class: {
|
|
151
155
|
'xpl-input': true,
|
|
152
156
|
'xpl-input--disabled': this.disabled,
|
|
153
157
|
'xpl-input--error': hasError,
|
|
154
158
|
'xpl-input--readonly': this.readonly,
|
|
155
159
|
[`xpl-input--${this.type}`]: true,
|
|
156
|
-
} }, this.label && (h("label", { key: '
|
|
160
|
+
} }, this.label && (h("label", { key: 'ab7ea9eb5cb82e6b602ce93ab3da482c12f59078', class: "xpl-input-label", htmlFor: this._id }, this.label, this.description && h("small", { key: '37435c5f1d3d8a30acba7788a7d215921e679327' }, this.description))), this.renderInput(), ((_a = this.error) === null || _a === void 0 ? void 0 : _a.length) > 0 && (h("label", { key: '57b66daa234d93d9f6d7ad582380960013596919', class: "xpl-input-error", htmlFor: this._id, id: `${this._id}-error` }, h("xpl-icon", { key: '9a14b46934a8d7edc5f5e48c3fecf87441e741ca', icon: "alert-circle", size: 16 }), h("span", { key: 'badecb1aba3b3ff35cbcf6d7cb4d5355844951e6' }, this.error)))));
|
|
157
161
|
}
|
|
158
162
|
static get is() { return "xpl-input"; }
|
|
159
163
|
static get properties() {
|
|
@@ -830,14 +834,14 @@ export class Input {
|
|
|
830
834
|
}
|
|
831
835
|
static get events() {
|
|
832
836
|
return [{
|
|
833
|
-
"method": "
|
|
834
|
-
"name": "
|
|
837
|
+
"method": "blurEvent",
|
|
838
|
+
"name": "blurEvent",
|
|
835
839
|
"bubbles": true,
|
|
836
840
|
"cancelable": true,
|
|
837
841
|
"composed": true,
|
|
838
842
|
"docs": {
|
|
839
843
|
"tags": [],
|
|
840
|
-
"text": "The event handler for the
|
|
844
|
+
"text": "The event handler for the blur event"
|
|
841
845
|
},
|
|
842
846
|
"complexType": {
|
|
843
847
|
"original": "FocusEvent",
|
|
@@ -850,14 +854,14 @@ export class Input {
|
|
|
850
854
|
}
|
|
851
855
|
}
|
|
852
856
|
}, {
|
|
853
|
-
"method": "
|
|
854
|
-
"name": "
|
|
857
|
+
"method": "focusEvent",
|
|
858
|
+
"name": "focusEvent",
|
|
855
859
|
"bubbles": true,
|
|
856
860
|
"cancelable": true,
|
|
857
861
|
"composed": true,
|
|
858
862
|
"docs": {
|
|
859
863
|
"tags": [],
|
|
860
|
-
"text": "The event handler for the
|
|
864
|
+
"text": "The event handler for the focus event"
|
|
861
865
|
},
|
|
862
866
|
"complexType": {
|
|
863
867
|
"original": "FocusEvent",
|
|
@@ -870,14 +874,14 @@ export class Input {
|
|
|
870
874
|
}
|
|
871
875
|
}
|
|
872
876
|
}, {
|
|
873
|
-
"method": "
|
|
874
|
-
"name": "
|
|
877
|
+
"method": "inputEvent",
|
|
878
|
+
"name": "inputEvent",
|
|
875
879
|
"bubbles": true,
|
|
876
880
|
"cancelable": true,
|
|
877
881
|
"composed": true,
|
|
878
882
|
"docs": {
|
|
879
883
|
"tags": [],
|
|
880
|
-
"text": "Event that emits the current value of the input
|
|
884
|
+
"text": "Event that emits the current value of the input\n\nApplies to text-like inputs and search inputs."
|
|
881
885
|
},
|
|
882
886
|
"complexType": {
|
|
883
887
|
"original": "string",
|
|
@@ -885,14 +889,14 @@ export class Input {
|
|
|
885
889
|
"references": {}
|
|
886
890
|
}
|
|
887
891
|
}, {
|
|
888
|
-
"method": "
|
|
889
|
-
"name": "
|
|
892
|
+
"method": "search",
|
|
893
|
+
"name": "search",
|
|
890
894
|
"bubbles": true,
|
|
891
895
|
"cancelable": true,
|
|
892
896
|
"composed": true,
|
|
893
897
|
"docs": {
|
|
894
898
|
"tags": [],
|
|
895
|
-
"text": "
|
|
899
|
+
"text": "Emitted when the user commits a search (Enter with no enclosing form owner, or submit of the\ninternal search form). `event.detail` is the trimmed query string.\n\nApplies to search inputs (`type=\"search\"`)."
|
|
896
900
|
},
|
|
897
901
|
"complexType": {
|
|
898
902
|
"original": "string",
|
|
@@ -900,14 +904,14 @@ export class Input {
|
|
|
900
904
|
"references": {}
|
|
901
905
|
}
|
|
902
906
|
}, {
|
|
903
|
-
"method": "
|
|
904
|
-
"name": "
|
|
907
|
+
"method": "valueChange",
|
|
908
|
+
"name": "valueChange",
|
|
905
909
|
"bubbles": true,
|
|
906
910
|
"cancelable": true,
|
|
907
911
|
"composed": true,
|
|
908
912
|
"docs": {
|
|
909
913
|
"tags": [],
|
|
910
|
-
"text": "
|
|
914
|
+
"text": "Event that emits the current value of the input (including search fields)."
|
|
911
915
|
},
|
|
912
916
|
"complexType": {
|
|
913
917
|
"original": "string",
|
|
@@ -269,7 +269,7 @@ export class Popover {
|
|
|
269
269
|
"references": {
|
|
270
270
|
"PopoverPosition": {
|
|
271
271
|
"location": "local",
|
|
272
|
-
"path": "/
|
|
272
|
+
"path": "/Users/roc/Sites/apollo/packages/apollo-core/src/components/components/xpl-popover/xpl-popover.tsx",
|
|
273
273
|
"id": "src/components/components/xpl-popover/xpl-popover.tsx::PopoverPosition"
|
|
274
274
|
}
|
|
275
275
|
}
|
|
@@ -28,6 +28,12 @@ export default {
|
|
|
28
28
|
name: {
|
|
29
29
|
type: { name: 'string', required: false },
|
|
30
30
|
},
|
|
31
|
+
selectedValue: {
|
|
32
|
+
type: { name: 'string', required: false },
|
|
33
|
+
description: 'When set, the radio is checked when `selectedValue` equals its `value`. ' +
|
|
34
|
+
'Use this to drive radio-group selection from a single source of truth ' +
|
|
35
|
+
'(e.g. Vue v-model on a shared `selectedValue`).',
|
|
36
|
+
},
|
|
31
37
|
},
|
|
32
38
|
parameters: {
|
|
33
39
|
actions: {
|
|
@@ -35,7 +41,7 @@ export default {
|
|
|
35
41
|
},
|
|
36
42
|
},
|
|
37
43
|
};
|
|
38
|
-
export const Radio = ({ label, description, checked, disabled, styled, value, name }) => {
|
|
44
|
+
export const Radio = ({ label, description, checked, disabled, styled, value, name, selectedValue, }) => {
|
|
39
45
|
let attrs = '';
|
|
40
46
|
if (description)
|
|
41
47
|
attrs += ` description="${description}"`;
|
|
@@ -49,6 +55,8 @@ export const Radio = ({ label, description, checked, disabled, styled, value, na
|
|
|
49
55
|
attrs += ` value="${value}"`;
|
|
50
56
|
if (name)
|
|
51
57
|
attrs += ` name="${name}"`;
|
|
58
|
+
if (selectedValue)
|
|
59
|
+
attrs += ` selected-value="${selectedValue}"`;
|
|
52
60
|
const demoAttr = attrs.replace('value', 'value="demo"');
|
|
53
61
|
return `
|
|
54
62
|
<form>
|
|
@@ -65,6 +73,7 @@ Radio.args = {
|
|
|
65
73
|
styled: false,
|
|
66
74
|
value: '',
|
|
67
75
|
name: 'demo-name',
|
|
76
|
+
selectedValue: '',
|
|
68
77
|
};
|
|
69
78
|
Radio.parameters = {
|
|
70
79
|
layout: 'centered',
|
|
@@ -13,15 +13,21 @@ export class Radio {
|
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
+
get isChecked() {
|
|
17
|
+
if (this.selectedValue !== undefined && this.value !== undefined) {
|
|
18
|
+
return this.selectedValue === this.value;
|
|
19
|
+
}
|
|
20
|
+
return Boolean(this.checked);
|
|
21
|
+
}
|
|
16
22
|
render() {
|
|
17
|
-
return (h(Host, { key: '
|
|
23
|
+
return (h(Host, { key: '1cda65b10ee03e06c30b2c501d7f2ec4153619f6', class: {
|
|
18
24
|
'xpl-checkbox-radio-container': true,
|
|
19
25
|
styled: this.styled,
|
|
20
26
|
disabled: this.disabled,
|
|
21
|
-
} }, h("input", { key: '
|
|
27
|
+
} }, h("input", { key: 'b19a87e42feb5953ace4b8bd049427959c40a7e6', class: "xpl-radio", type: "radio", checked: this.isChecked, disabled: this.disabled, id: this.id, name: this.name, required: this.required, onChange: this.onChange, value: this.value }), h("label", { key: 'd07051460f7503a182b969eeafcb8eba5d61bef2', class: {
|
|
22
28
|
'xpl-label': true,
|
|
23
29
|
'xpl-label--disabled': this.disabled,
|
|
24
|
-
}, htmlFor: this.id }, h("slot", { key: '
|
|
30
|
+
}, htmlFor: this.id }, h("slot", { key: '06835704869d514a0d3eb01d671b6bec42524e89' }), this.description && (h("small", { key: '3e798a699fa53ca6c932e6466b438ed47aa46148', class: {
|
|
25
31
|
'xpl-description': true,
|
|
26
32
|
'xpl-description--disabled': this.disabled,
|
|
27
33
|
} }, this.description)))));
|
|
@@ -98,7 +104,7 @@ export class Radio {
|
|
|
98
104
|
"optional": true,
|
|
99
105
|
"docs": {
|
|
100
106
|
"tags": [],
|
|
101
|
-
"text": "The name attribute for the html input.\n(
|
|
107
|
+
"text": "The name attribute for the html input.\n(submitted in form as name/value pair)"
|
|
102
108
|
},
|
|
103
109
|
"getter": false,
|
|
104
110
|
"setter": false,
|
|
@@ -117,7 +123,7 @@ export class Radio {
|
|
|
117
123
|
"optional": true,
|
|
118
124
|
"docs": {
|
|
119
125
|
"tags": [],
|
|
120
|
-
"text": "The value attribute for the radio input.\n(
|
|
126
|
+
"text": "The value attribute for the radio input.\n(submitted in form as name/value pair)"
|
|
121
127
|
},
|
|
122
128
|
"getter": false,
|
|
123
129
|
"setter": false,
|
|
@@ -143,6 +149,25 @@ export class Radio {
|
|
|
143
149
|
"reflect": false,
|
|
144
150
|
"attribute": "required"
|
|
145
151
|
},
|
|
152
|
+
"selectedValue": {
|
|
153
|
+
"type": "string",
|
|
154
|
+
"mutable": false,
|
|
155
|
+
"complexType": {
|
|
156
|
+
"original": "string",
|
|
157
|
+
"resolved": "string",
|
|
158
|
+
"references": {}
|
|
159
|
+
},
|
|
160
|
+
"required": false,
|
|
161
|
+
"optional": true,
|
|
162
|
+
"docs": {
|
|
163
|
+
"tags": [],
|
|
164
|
+
"text": "The currently selected value for the radio group this radio belongs to.\n\nWhen set, the radio renders as checked when `selectedValue` equals its\nown `value` prop. Use this to drive radio-group selection from a single\nsource of truth \u2014 e.g. Vue `v-model` on a shared `selectedValue` across\nevery radio in a group, where each radio still declares its own `value`.\n\nFalls back to the boolean `checked` prop when not set."
|
|
165
|
+
},
|
|
166
|
+
"getter": false,
|
|
167
|
+
"setter": false,
|
|
168
|
+
"reflect": false,
|
|
169
|
+
"attribute": "selected-value"
|
|
170
|
+
},
|
|
146
171
|
"styled": {
|
|
147
172
|
"type": "boolean",
|
|
148
173
|
"mutable": false,
|
|
@@ -705,7 +705,7 @@ export class Spotlight {
|
|
|
705
705
|
"references": {
|
|
706
706
|
"SpotlightActionLayout": {
|
|
707
707
|
"location": "local",
|
|
708
|
-
"path": "/
|
|
708
|
+
"path": "/Users/roc/Sites/apollo/packages/apollo-core/src/components/components/xpl-spotlight/xpl-spotlight.tsx",
|
|
709
709
|
"id": "src/components/components/xpl-spotlight/xpl-spotlight.tsx::SpotlightActionLayout"
|
|
710
710
|
}
|
|
711
711
|
}
|
|
@@ -731,7 +731,7 @@ export class Spotlight {
|
|
|
731
731
|
"references": {
|
|
732
732
|
"SpotlightAnchorPosition": {
|
|
733
733
|
"location": "local",
|
|
734
|
-
"path": "/
|
|
734
|
+
"path": "/Users/roc/Sites/apollo/packages/apollo-core/src/components/components/xpl-spotlight/xpl-spotlight.tsx",
|
|
735
735
|
"id": "src/components/components/xpl-spotlight/xpl-spotlight.tsx::SpotlightAnchorPosition"
|
|
736
736
|
}
|
|
737
737
|
}
|
|
@@ -276,7 +276,7 @@ export class Tag {
|
|
|
276
276
|
"references": {
|
|
277
277
|
"TagDragEndDetail": {
|
|
278
278
|
"location": "local",
|
|
279
|
-
"path": "/
|
|
279
|
+
"path": "/Users/roc/Sites/apollo/packages/apollo-core/src/components/components/xpl-tag/xpl-tag.tsx",
|
|
280
280
|
"id": "src/components/components/xpl-tag/xpl-tag.tsx::TagDragEndDetail"
|
|
281
281
|
}
|
|
282
282
|
}
|
|
@@ -297,7 +297,7 @@ export class Tag {
|
|
|
297
297
|
"references": {
|
|
298
298
|
"TagDragStartDetail": {
|
|
299
299
|
"location": "local",
|
|
300
|
-
"path": "/
|
|
300
|
+
"path": "/Users/roc/Sites/apollo/packages/apollo-core/src/components/components/xpl-tag/xpl-tag.tsx",
|
|
301
301
|
"id": "src/components/components/xpl-tag/xpl-tag.tsx::TagDragStartDetail"
|
|
302
302
|
}
|
|
303
303
|
}
|
|
@@ -4,6 +4,10 @@ export class Toggle {
|
|
|
4
4
|
constructor() {
|
|
5
5
|
this.variant = 'default';
|
|
6
6
|
this.id = uuid();
|
|
7
|
+
this.onChange = (event) => {
|
|
8
|
+
const target = event.target;
|
|
9
|
+
this.toggleChange.emit(target.checked);
|
|
10
|
+
};
|
|
7
11
|
}
|
|
8
12
|
render() {
|
|
9
13
|
let containerClassName = 'xpl-toggle-container';
|
|
@@ -12,13 +16,13 @@ export class Toggle {
|
|
|
12
16
|
let className = 'xpl-toggle';
|
|
13
17
|
if (this.variant === 'small')
|
|
14
18
|
className += ' xpl-toggle--small';
|
|
15
|
-
return (h(Host, { key: '
|
|
19
|
+
return (h(Host, { key: '2665ccecd2df94b7ed7443e2ecb6265fca7f235f', class: containerClassName }, (this.heading || this.description) && (h("label", { key: '75292b431419e1d34c127a82d61baa1ee024a2bb', class: {
|
|
16
20
|
'xpl-label': true,
|
|
17
21
|
'xpl-label--disabled': this.disabled,
|
|
18
|
-
}, htmlFor: this.id }, this.heading, this.description && (h("small", { key: '
|
|
22
|
+
}, htmlFor: this.id }, this.heading, this.description && (h("small", { key: '772e34c7d553faee5b1dfc448ecb95706dc3e8df', class: {
|
|
19
23
|
'xpl-description': true,
|
|
20
24
|
'xpl-description--disabled': this.disabled,
|
|
21
|
-
} }, this.description)))), h("input", { key: '
|
|
25
|
+
} }, this.description)))), h("input", { key: 'afec8fff16aadca330c804832dbd41c4b10f5caa', class: className, type: "checkbox", checked: this.checked, disabled: this.disabled, id: this.id, name: this.name, onChange: this.onChange }), this.label && h("label", { key: '1b25d01805915cb2dacf03ad9340beec61565bcc', htmlFor: this.id }, this.label)));
|
|
22
26
|
}
|
|
23
27
|
static get is() { return "xpl-toggle"; }
|
|
24
28
|
static get properties() {
|
|
@@ -130,7 +134,7 @@ export class Toggle {
|
|
|
130
134
|
"optional": true,
|
|
131
135
|
"docs": {
|
|
132
136
|
"tags": [],
|
|
133
|
-
"text": "The name attribute for the html input.\n(
|
|
137
|
+
"text": "The name attribute for the html input.\n(submitted in form as name/value pair)"
|
|
134
138
|
},
|
|
135
139
|
"getter": false,
|
|
136
140
|
"setter": false,
|
|
@@ -164,4 +168,22 @@ export class Toggle {
|
|
|
164
168
|
"id": {}
|
|
165
169
|
};
|
|
166
170
|
}
|
|
171
|
+
static get events() {
|
|
172
|
+
return [{
|
|
173
|
+
"method": "toggleChange",
|
|
174
|
+
"name": "toggleChange",
|
|
175
|
+
"bubbles": true,
|
|
176
|
+
"cancelable": true,
|
|
177
|
+
"composed": true,
|
|
178
|
+
"docs": {
|
|
179
|
+
"tags": [],
|
|
180
|
+
"text": "Emitted when the toggle checked state changes. Detail is the new `checked` value."
|
|
181
|
+
},
|
|
182
|
+
"complexType": {
|
|
183
|
+
"original": "boolean",
|
|
184
|
+
"resolved": "boolean",
|
|
185
|
+
"references": {}
|
|
186
|
+
}
|
|
187
|
+
}];
|
|
188
|
+
}
|
|
167
189
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as s,createEvent as i,h as t,Host as
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as s,createEvent as i,h as t,Host as c,transformTag as a}from"@stencil/core/internal/client";import{v as d}from"./v4.js";const l=e(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.checkboxChange=i(this,"checkboxChange",7),this.id=d(),this.ariaLabel="",this.onChange=e=>{this.checkboxChange.emit(e.target.checked)}}render(){var e;return t(c,{key:"dd508c61fc68052f2bbdfccd606ea8f0109783f3",class:{"xpl-checkbox-radio-container":!0,styled:this.styled,disabled:this.disabled}},t("input",{key:"c5b482a12c02cb4384444e3d385cccc17a8cbd3c",class:"xpl-checkbox",type:"checkbox","aria-label":(null!==(e=this.ariaLabel)&&void 0!==e?e:"").trim()||void 0,checked:this.checked,"data-id":this.dataId,disabled:this.disabled,id:this.id,indeterminate:this.indeterminate,onChange:this.onChange,name:this.name,required:this.required,value:this.value}),t("label",{key:"e5ae6eef395457ff6021b008bbb4221e7c36a3c9",class:{"xpl-label":!0,"xpl-label--disabled":this.disabled},htmlFor:this.id},t("slot",{key:"71ae02b761df01bea00b483e21a9b442b8fbdd9f"}),this.description&&t("small",{key:"f34f7e323cd9c39ce1094177e7a4d3cf4b06f788",class:{"xpl-description":!0,"xpl-description--disabled":this.disabled}},this.description)))}},[260,"xpl-checkbox",{ariaLabel:[1,"aria-label"],checked:[4],description:[1],disabled:[4],indeterminate:[4],name:[1],value:[1],required:[4],styled:[4],dataId:[1,"data-id"],id:[32]}]);function h(){"undefined"!=typeof customElements&&["xpl-checkbox"].forEach((e=>{"xpl-checkbox"===e&&(customElements.get(a(e))||customElements.define(a(e),l))}))}export{l as C,h as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as s,createEvent as
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as s,createEvent as i,h as t,Host as c,transformTag as h}from"@stencil/core/internal/client";import{d as l}from"./xpl-checkbox2.js";import{d as o}from"./xpl-radio2.js";import{v as n}from"./v4.js";const a=e(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.choicelistChange=i(this,"choicelistChange",7),this.choicelistValueChange=i(this,"choicelistValueChange",7),this.name=n(),this.onChoiceChange=(e,s)=>{const i=this.choices[s];if(this.multi){if(this.selected=this.selected.map(((e,i)=>i===s?!e:e)),void 0!==(null==i?void 0:i.value)){const e=this.choices.filter(((e,s)=>this.selected[s])).map(((e,s)=>{var i;return null!==(i=e.value)&&void 0!==i?i:this.selected[s]}));this.choicelistValueChange.emit(e)}}else this.selected=this.selected.map(((e,i)=>i===s)),void 0!==(null==i?void 0:i.value)&&this.choicelistValueChange.emit(i.value)},this.renderChoice=({description:e,label:s,value:i,checked:c},h)=>this.multi?t("xpl-checkbox",{value:i,description:e,name:this.name,checked:c,onCheckboxChange:e=>this.onChoiceChange(e.detail,h)},s):t("xpl-radio",{value:i,description:e,name:this.name,checked:c,onRadioChange:e=>this.onChoiceChange(e.detail,h)},s)}onChoicesPropChange(e){this.selected=null!=e&&e.length>0?e.map((e=>e.checked||!1)):[]}onSelectedChange(e){this.choicelistChange.emit(e)}componentWillLoad(){this.onChoicesPropChange(this.choices)}render(){return t(c,{key:"d2da0f5aeb424a36fb117711f34c0631c464ef6a",class:"xpl-choicelist-container"},void 0!==this.heading||void 0!==this.description?t("div",{class:"xpl-choicelist-heading"},this.heading&&t("h3",null,this.heading),this.description&&t("p",null,this.description)):null,this.choices&&t("ul",{key:"a40e08f0fd60a5268ed9f4d15a97b3fa677e2e46",class:{"xpl-choicelist":!0,"xpl-choicelist--styled":this.styled}},this.choices.map(((e,s)=>{const i=this.renderChoice(e,s);return t("li",{class:{selected:this.styled&&this.selected[s]}},i,e.children&&t("ul",null,e.children.map(((e,s)=>{const i=this.renderChoice(e,s);return t("li",null,i)}))))}))))}static get watchers(){return{choices:[{onChoicesPropChange:0}],selected:[{onSelectedChange:0}]}}},[0,"xpl-choicelist",{choices:[16],description:[1],heading:[1],multi:[4],name:[1],styled:[4],selected:[32]},void 0,{choices:[{onChoicesPropChange:0}],selected:[{onSelectedChange:0}]}]),d=a,r=function(){"undefined"!=typeof customElements&&["xpl-choicelist","xpl-checkbox","xpl-radio"].forEach((e=>{switch(e){case"xpl-choicelist":customElements.get(h(e))||customElements.define(h(e),a);break;case"xpl-checkbox":customElements.get(h(e))||l();break;case"xpl-radio":customElements.get(h(e))||o()}}))};export{d as XplChoicelist,r as defineCustomElement}
|