q2-tecton-elements 1.11.4 → 1.12.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.
Files changed (126) hide show
  1. package/dist/cjs/{index-f5807a6a.js → index-773c3eec.js} +13 -11
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/q2-btn_2.cjs.entry.js +2 -2
  4. package/dist/cjs/q2-calendar.cjs.entry.js +12 -2
  5. package/dist/cjs/q2-card.cjs.entry.js +1 -1
  6. package/dist/cjs/q2-carousel-pane.cjs.entry.js +1 -1
  7. package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
  8. package/dist/cjs/q2-checkbox-group.cjs.entry.js +1 -1
  9. package/dist/cjs/q2-checkbox.cjs.entry.js +4 -3
  10. package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
  11. package/dist/cjs/q2-dropdown.cjs.entry.js +1 -1
  12. package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
  13. package/dist/cjs/q2-icon.cjs.entry.js +1 -1
  14. package/dist/cjs/q2-input.cjs.entry.js +4 -4
  15. package/dist/cjs/q2-loc.cjs.entry.js +1 -1
  16. package/dist/cjs/q2-message.cjs.entry.js +1 -1
  17. package/dist/cjs/q2-optgroup.cjs.entry.js +1 -1
  18. package/dist/cjs/q2-option-list.cjs.entry.js +357 -0
  19. package/dist/cjs/q2-option.cjs.entry.js +2 -10
  20. package/dist/cjs/q2-pagination.cjs.entry.js +1 -1
  21. package/dist/cjs/q2-pill.cjs.entry.js +137 -0
  22. package/dist/cjs/q2-radio-group.cjs.entry.js +1 -1
  23. package/dist/cjs/q2-radio.cjs.entry.js +1 -1
  24. package/dist/cjs/q2-section.cjs.entry.js +1 -1
  25. package/dist/cjs/q2-select.cjs.entry.js +15 -6
  26. package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
  27. package/dist/cjs/q2-stepper.cjs.entry.js +2 -2
  28. package/dist/cjs/q2-tab-container.cjs.entry.js +5 -1
  29. package/dist/cjs/q2-tag.cjs.entry.js +94 -0
  30. package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
  31. package/dist/cjs/q2-textarea.cjs.entry.js +1 -1
  32. package/dist/collection/collection-manifest.json +3 -0
  33. package/dist/collection/components/q2-btn/styles.css +1 -1
  34. package/dist/collection/components/q2-calendar/helpers.js +6 -0
  35. package/dist/collection/components/q2-calendar/index.js +6 -2
  36. package/dist/collection/components/q2-checkbox/index.js +3 -2
  37. package/dist/collection/components/q2-input/index.js +4 -3
  38. package/dist/collection/components/q2-input/styles.css +9 -2
  39. package/dist/collection/components/q2-option/index.js +19 -25
  40. package/dist/collection/components/q2-option/styles.css +5 -0
  41. package/dist/collection/components/q2-option-list/index.js +646 -0
  42. package/dist/collection/components/q2-option-list/styles.css +128 -0
  43. package/dist/collection/components/q2-pill/index.js +324 -0
  44. package/dist/collection/components/q2-pill/styles.css +227 -0
  45. package/dist/collection/components/q2-select/index.js +14 -5
  46. package/dist/collection/components/q2-stepper/styles.css +1 -1
  47. package/dist/collection/components/q2-tab-container/index.js +4 -0
  48. package/dist/collection/components/q2-tag/index.js +200 -0
  49. package/dist/collection/components/q2-tag/styles.css +141 -0
  50. package/dist/collection/utils/index.js +13 -11
  51. package/dist/esm/{index-0e13a57f.js → index-fa32f694.js} +13 -11
  52. package/dist/esm/loader.js +1 -1
  53. package/dist/esm/q2-btn_2.entry.js +2 -2
  54. package/dist/esm/q2-calendar.entry.js +12 -2
  55. package/dist/esm/q2-card.entry.js +1 -1
  56. package/dist/esm/q2-carousel-pane.entry.js +1 -1
  57. package/dist/esm/q2-carousel.entry.js +1 -1
  58. package/dist/esm/q2-checkbox-group.entry.js +1 -1
  59. package/dist/esm/q2-checkbox.entry.js +4 -3
  60. package/dist/esm/q2-dropdown-item.entry.js +1 -1
  61. package/dist/esm/q2-dropdown.entry.js +1 -1
  62. package/dist/esm/q2-editable-field.entry.js +1 -1
  63. package/dist/esm/q2-icon.entry.js +1 -1
  64. package/dist/esm/q2-input.entry.js +4 -4
  65. package/dist/esm/q2-loc.entry.js +1 -1
  66. package/dist/esm/q2-message.entry.js +1 -1
  67. package/dist/esm/q2-optgroup.entry.js +1 -1
  68. package/dist/esm/q2-option-list.entry.js +353 -0
  69. package/dist/esm/q2-option.entry.js +3 -11
  70. package/dist/esm/q2-pagination.entry.js +1 -1
  71. package/dist/esm/q2-pill.entry.js +133 -0
  72. package/dist/esm/q2-radio-group.entry.js +1 -1
  73. package/dist/esm/q2-radio.entry.js +1 -1
  74. package/dist/esm/q2-section.entry.js +1 -1
  75. package/dist/esm/q2-select.entry.js +15 -6
  76. package/dist/esm/q2-stepper-pane.entry.js +1 -1
  77. package/dist/esm/q2-stepper.entry.js +2 -2
  78. package/dist/esm/q2-tab-container.entry.js +5 -1
  79. package/dist/esm/q2-tag.entry.js +90 -0
  80. package/dist/esm/q2-tecton-elements.js +1 -1
  81. package/dist/esm/q2-textarea.entry.js +1 -1
  82. package/dist/q2-tecton-elements/{p-ca847db7.entry.js → p-08668234.entry.js} +1 -1
  83. package/dist/q2-tecton-elements/{p-2be33492.entry.js → p-0a7cff38.entry.js} +1 -1
  84. package/dist/q2-tecton-elements/p-167a19fd.entry.js +1 -0
  85. package/dist/q2-tecton-elements/{p-a72e7a12.entry.js → p-2afdc922.entry.js} +1 -1
  86. package/dist/q2-tecton-elements/{p-fe61c1aa.entry.js → p-30bf5f44.entry.js} +1 -1
  87. package/dist/q2-tecton-elements/{p-f85bf7fb.entry.js → p-34415315.entry.js} +1 -1
  88. package/dist/q2-tecton-elements/{p-3479847c.entry.js → p-54300d2f.entry.js} +1 -1
  89. package/dist/q2-tecton-elements/p-54f0d64e.entry.js +1 -0
  90. package/dist/q2-tecton-elements/p-5b906cf1.entry.js +1 -0
  91. package/dist/q2-tecton-elements/p-5effd81a.entry.js +1 -0
  92. package/dist/q2-tecton-elements/{p-27ec0a16.entry.js → p-7ce98c1a.entry.js} +1 -1
  93. package/dist/q2-tecton-elements/{p-346b65d5.entry.js → p-91dba21f.entry.js} +1 -1
  94. package/dist/q2-tecton-elements/{p-2372f988.entry.js → p-9a3c37ab.entry.js} +1 -1
  95. package/dist/q2-tecton-elements/{p-c83dba0a.entry.js → p-a0248299.entry.js} +1 -1
  96. package/dist/q2-tecton-elements/{p-f435dc7e.entry.js → p-aca8302b.entry.js} +1 -1
  97. package/dist/q2-tecton-elements/{p-bfd77f9b.entry.js → p-b9c2c1d3.entry.js} +1 -1
  98. package/dist/q2-tecton-elements/{p-f85da2a8.js → p-c3d68d5c.js} +1 -1
  99. package/dist/q2-tecton-elements/{p-841ec108.entry.js → p-c460e5ed.entry.js} +1 -1
  100. package/dist/q2-tecton-elements/{p-88bc2f49.entry.js → p-c5199147.entry.js} +1 -1
  101. package/dist/q2-tecton-elements/{p-492dfb55.entry.js → p-c5e6f7fa.entry.js} +1 -1
  102. package/dist/q2-tecton-elements/{p-9ccbc3d8.entry.js → p-d3058002.entry.js} +1 -1
  103. package/dist/q2-tecton-elements/{p-fc318ae2.entry.js → p-d65aaed2.entry.js} +1 -1
  104. package/dist/q2-tecton-elements/{p-701b381a.entry.js → p-d9bc6494.entry.js} +1 -1
  105. package/dist/q2-tecton-elements/p-df86f160.entry.js +1 -0
  106. package/dist/q2-tecton-elements/{p-f73df612.entry.js → p-e38080d2.entry.js} +1 -1
  107. package/dist/q2-tecton-elements/p-e9d69ba8.entry.js +1 -0
  108. package/dist/q2-tecton-elements/{p-d199fca8.entry.js → p-f98dc161.entry.js} +1 -1
  109. package/dist/q2-tecton-elements/{p-6a83a97c.entry.js → p-fa9e3825.entry.js} +1 -1
  110. package/dist/q2-tecton-elements/{p-b5b12e46.entry.js → p-fe6407a4.entry.js} +1 -1
  111. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  112. package/dist/test/elements/q2-tag-test.js +151 -0
  113. package/dist/test/helpers.js +7 -0
  114. package/dist/types/components/q2-calendar/helpers.d.ts +1 -0
  115. package/dist/types/components/q2-checkbox/index.d.ts +1 -1
  116. package/dist/types/components/q2-option/index.d.ts +2 -3
  117. package/dist/types/components/q2-option-list/index.d.ts +62 -0
  118. package/dist/types/components/q2-pill/index.d.ts +39 -0
  119. package/dist/types/components/q2-tag/index.d.ts +28 -0
  120. package/dist/types/components.d.ts +95 -1
  121. package/dist/types/workspace/workspace/tecton-production_release_1.12.x/packages/q2-tecton-elements/.stencil/test/elements/q2-tag-test.d.ts +1 -0
  122. package/dist/types/workspace/workspace/{tecton-production_release_1.11.x → tecton-production_release_1.12.x}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +1 -0
  123. package/package.json +2 -2
  124. package/dist/q2-tecton-elements/p-564154f3.entry.js +0 -1
  125. package/dist/q2-tecton-elements/p-6702eb4d.entry.js +0 -1
  126. package/dist/q2-tecton-elements/p-dffbcec3.entry.js +0 -1
@@ -0,0 +1,128 @@
1
+ * {
2
+ box-sizing: border-box;
3
+ }
4
+
5
+ *:active {
6
+ outline: none;
7
+ }
8
+
9
+ *:focus {
10
+ outline: none;
11
+ box-shadow: var(--const-global-focus);
12
+ }
13
+
14
+ :host {
15
+ box-shadow: none !important;
16
+ }
17
+
18
+ ::-moz-focus-inner {
19
+ border: none;
20
+ }
21
+
22
+ input,
23
+ textarea,
24
+ button {
25
+ font-family: inherit;
26
+ font-size: inherit;
27
+ }
28
+
29
+ :host(.sr),
30
+ :host(.sr) button {
31
+ border: 0;
32
+ clip: rect(0 0 0 0);
33
+ height: 1px;
34
+ margin: -1px;
35
+ overflow: hidden;
36
+ padding: 0;
37
+ position: absolute;
38
+ width: 1px;
39
+ white-space: nowrap;
40
+ }
41
+
42
+ .sr,
43
+ .sr button {
44
+ border: 0;
45
+ clip: rect(0 0 0 0);
46
+ height: 1px;
47
+ margin: -1px;
48
+ overflow: hidden;
49
+ padding: 0;
50
+ position: absolute;
51
+ width: 1px;
52
+ white-space: nowrap;
53
+ }
54
+
55
+ .hidden {
56
+ display: none;
57
+ }
58
+
59
+ :host([hidden]) {
60
+ display: none;
61
+ }
62
+
63
+ .invisible {
64
+ visibility: hidden;
65
+ }
66
+
67
+ :host {
68
+ position: relative;
69
+ width: 100%;
70
+ display: block;
71
+ }
72
+
73
+ .content {
74
+ margin-top: var(--tct-option-list-margin, var(--t-option-list-margin, var(--app-scale-1x, 5px)));
75
+ position: absolute;
76
+ height: 0;
77
+ opacity: 0;
78
+ visibility: hidden;
79
+ background-color: var(--app-white);
80
+ color: var(--t-font-color);
81
+ z-index: 100;
82
+ width: max-content;
83
+ min-width: var(--tct-option-list-min-width, var(--t-option-list-min-width, 135px));
84
+ box-shadow: var(--app-shadow-1);
85
+ overflow: hidden;
86
+ text-align: start;
87
+ transition: opacity var(--app-tween-1);
88
+ border-radius: var(--tct-option-list-border-radius, var(--t-option-list-border-radius, 0));
89
+ --comp-scrollbar-size: var(--tct-scrollbar-size, var(--t-scrollbar-size, var(--app-scale-1x, 5px)));
90
+ --comp-scrollbar-border-radius: var(--tct-scrollbar-border-radius, var(--t-scrollbar-border-radius, var(--app-border-radius-1, 3px)));
91
+ --comp-scrollbar-color: var(--tct-scrollbar-color, var(--t-scrollbar-color, var(--t-a11y-gray-color, #747474)));
92
+ scrollbar-width: thin;
93
+ scrollbar-color: var(--comp-scrollbar-color) transparent;
94
+ }
95
+ .content::-webkit-scrollbar {
96
+ width: var(--comp-scrollbar-size);
97
+ height: var(--comp-scrollbar-size);
98
+ margin: 5px;
99
+ }
100
+ .content::-webkit-scrollbar-thumb {
101
+ background: var(--comp-scrollbar-color);
102
+ border-radius: var(--comp-scrollbar-border-radius);
103
+ }
104
+ .content::-webkit-scrollbar-track {
105
+ background: transparent;
106
+ border-radius: var(--comp-scrollbar-border-radius);
107
+ }
108
+ :host(:not([align=right])) .content {
109
+ left: 0;
110
+ }
111
+ :host([align=right]) .content {
112
+ right: 0;
113
+ }
114
+ :host([open]) .content {
115
+ display: block;
116
+ height: auto;
117
+ overflow: auto;
118
+ opacity: 1;
119
+ visibility: visible;
120
+ }
121
+ :host([is-sizeable]) .content {
122
+ display: block;
123
+ height: auto;
124
+ }
125
+ :host([alignment=right]) .content {
126
+ left: unset;
127
+ right: 0;
128
+ }
@@ -0,0 +1,324 @@
1
+ import { Component, State, Prop, h, Listen, Element, Fragment, Event } from '@stencil/core';
2
+ import { isEventFromElement, loc, overrideFocus } from 'src/utils';
3
+ export class Q2Pill {
4
+ constructor() {
5
+ this.selectedOptions = [];
6
+ this.scheduledAfterRender = [];
7
+ /// Helpers
8
+ this.determineHasOptions = () => {
9
+ const hasOptions = !!this.hostElement.querySelectorAll('q2-option').length;
10
+ this.hasOptions = hasOptions;
11
+ };
12
+ this.clearSelectedOptions = () => {
13
+ this.selectedOptions = [];
14
+ this.active = false;
15
+ this.open = false;
16
+ this.primaryBtn.focus();
17
+ this.change.emit({ value: null, values: [], active: false });
18
+ };
19
+ /// Event Handlers ///
20
+ this.handleClick = (event) => {
21
+ event.stopPropagation();
22
+ if (this.disabled)
23
+ return;
24
+ if (this.hasOptions) {
25
+ this.optionList.toggle();
26
+ }
27
+ else {
28
+ const { value, label } = this;
29
+ const isActive = (this.active = !this.active);
30
+ const values = isActive ? [{ value, display: label }] : [];
31
+ this.selectedOptions = values;
32
+ this.change.emit({
33
+ value: value,
34
+ values,
35
+ active: isActive
36
+ });
37
+ }
38
+ };
39
+ this.handleKeydown = (event) => {
40
+ if (!this.hasOptions || this.disabled)
41
+ return;
42
+ this.optionList.handleExternalKeydown(event);
43
+ };
44
+ this.handleChange = event => {
45
+ if (!this.hasOptions)
46
+ return;
47
+ const { value, values } = event.detail;
48
+ const isActive = !!values.length;
49
+ if (!this.hostElement.onchange) {
50
+ this.selectedOptions = values;
51
+ this.active = isActive;
52
+ }
53
+ this.change.emit({ value: value, values, active: isActive });
54
+ };
55
+ this.handleFocusout = (event) => {
56
+ const relatedTarget = event.relatedTarget;
57
+ if (Array.from(this.hostElement.children).includes(relatedTarget))
58
+ return;
59
+ if (relatedTarget && !(event.relatedTarget instanceof HTMLElement))
60
+ return;
61
+ if (relatedTarget && relatedTarget.closest('.btn-height-wrapper'))
62
+ return;
63
+ this.optionList.open = false;
64
+ };
65
+ this.handleWrapperClick = () => {
66
+ this.primaryBtn.focus();
67
+ this.primaryBtn.click();
68
+ };
69
+ }
70
+ /// LifeCycle Hooks ///
71
+ componentWillLoad() {
72
+ const observer = new MutationObserver(this.determineHasOptions);
73
+ observer.observe(this.hostElement, { childList: true, attributes: true });
74
+ this.mutationObserver = observer;
75
+ }
76
+ componentDidLoad() {
77
+ overrideFocus(this.hostElement);
78
+ }
79
+ componentDidRender() {
80
+ this.scheduledAfterRender.forEach(fn => fn());
81
+ this.scheduledAfterRender = [];
82
+ }
83
+ disconnectedCallback() {
84
+ this.mutationObserver.disconnect();
85
+ this.mutationObserver = null;
86
+ }
87
+ /// Getters ///
88
+ get buttonContent() {
89
+ const { label, selectedOptions, hasOptions } = this;
90
+ if (!hasOptions || selectedOptions.length === 0)
91
+ return label;
92
+ else if (selectedOptions.length === 1)
93
+ return selectedOptions[0].display;
94
+ return loc('tecton.element.pill.activeCount', { count: selectedOptions.length });
95
+ }
96
+ /// Listeners ///
97
+ delegateFocus(event) {
98
+ if (!isEventFromElement(event, this.hostElement))
99
+ return;
100
+ this.primaryBtn.focus();
101
+ }
102
+ optionListStateEvent({ detail: { open } }) {
103
+ this.open = open;
104
+ if (!open)
105
+ this.primaryBtn.focus();
106
+ }
107
+ /// DOM ///
108
+ generateIcon() {
109
+ const { hasOptions, active } = this;
110
+ const isButton = hasOptions && active;
111
+ const TagName = isButton ? 'button' : 'div';
112
+ const iconName = isButton || !hasOptions ? 'close' : 'chevron-down';
113
+ return (h(TagName, { class: "btn-close", onClick: isButton && this.clearSelectedOptions, disabled: isButton && this.disabled, "aria-label": isButton && loc('tecton.element.pill.clearSelection'), type: isButton && 'button' },
114
+ h("q2-icon", { type: iconName })));
115
+ }
116
+ render() {
117
+ const { hasOptions, active, open } = this;
118
+ let wrapperClassNames = ['btn-wrapper'];
119
+ if (hasOptions || active)
120
+ wrapperClassNames.push('has-icon');
121
+ if (hasOptions)
122
+ wrapperClassNames.push('has-options');
123
+ return (h(Fragment, null,
124
+ h("div", { class: wrapperClassNames.join(' ') },
125
+ h("div", { class: "btn-height-wrapper", onClick: this.handleWrapperClick, tabIndex: -1 },
126
+ h("button", { class: "btn-primary", type: "button", "test-id": "btn-control", ref: el => (this.primaryBtn = el), onClick: this.handleClick, onKeyDown: this.handleKeydown, disabled: this.disabled, onFocusout: this.handleFocusout, "aria-selected": !hasOptions && active ? 'true' : 'false', "aria-roledescription": !hasOptions && 'filter', "aria-controls": hasOptions && 'option-list', "aria-haspopup": hasOptions && 'true', "aria-expanded": hasOptions && open ? 'true' : 'false' },
127
+ this.buttonContent,
128
+ !hasOptions && active && (h("span", { class: "sr" },
129
+ "(",
130
+ loc('tecton.element.pill.active'),
131
+ ")")))),
132
+ this.generateIcon()),
133
+ this.hasOptions && (h("q2-option-list", { id: "option-list", ref: el => (this.optionList = el), open: this.open, onChange: this.handleChange, multiple: this.multiple, onFocusout: this.handleFocusout, selectedOptions: this.selectedOptions },
134
+ h("slot", null)))));
135
+ }
136
+ static get is() { return "q2-pill"; }
137
+ static get encapsulation() { return "shadow"; }
138
+ static get originalStyleUrls() { return {
139
+ "$": ["styles.scss"]
140
+ }; }
141
+ static get styleUrls() { return {
142
+ "$": ["styles.css"]
143
+ }; }
144
+ static get properties() { return {
145
+ "disabled": {
146
+ "type": "boolean",
147
+ "mutable": false,
148
+ "complexType": {
149
+ "original": "boolean",
150
+ "resolved": "boolean",
151
+ "references": {}
152
+ },
153
+ "required": false,
154
+ "optional": false,
155
+ "docs": {
156
+ "tags": [],
157
+ "text": ""
158
+ },
159
+ "attribute": "disabled",
160
+ "reflect": true
161
+ },
162
+ "active": {
163
+ "type": "boolean",
164
+ "mutable": true,
165
+ "complexType": {
166
+ "original": "boolean",
167
+ "resolved": "boolean",
168
+ "references": {}
169
+ },
170
+ "required": false,
171
+ "optional": false,
172
+ "docs": {
173
+ "tags": [],
174
+ "text": ""
175
+ },
176
+ "attribute": "active",
177
+ "reflect": true
178
+ },
179
+ "open": {
180
+ "type": "boolean",
181
+ "mutable": true,
182
+ "complexType": {
183
+ "original": "boolean",
184
+ "resolved": "boolean",
185
+ "references": {}
186
+ },
187
+ "required": false,
188
+ "optional": false,
189
+ "docs": {
190
+ "tags": [],
191
+ "text": ""
192
+ },
193
+ "attribute": "open",
194
+ "reflect": true
195
+ },
196
+ "multiple": {
197
+ "type": "boolean",
198
+ "mutable": false,
199
+ "complexType": {
200
+ "original": "boolean",
201
+ "resolved": "boolean",
202
+ "references": {}
203
+ },
204
+ "required": false,
205
+ "optional": false,
206
+ "docs": {
207
+ "tags": [],
208
+ "text": ""
209
+ },
210
+ "attribute": "multiple",
211
+ "reflect": true
212
+ },
213
+ "label": {
214
+ "type": "string",
215
+ "mutable": false,
216
+ "complexType": {
217
+ "original": "string",
218
+ "resolved": "string",
219
+ "references": {}
220
+ },
221
+ "required": false,
222
+ "optional": false,
223
+ "docs": {
224
+ "tags": [],
225
+ "text": ""
226
+ },
227
+ "attribute": "label",
228
+ "reflect": true
229
+ },
230
+ "value": {
231
+ "type": "string",
232
+ "mutable": false,
233
+ "complexType": {
234
+ "original": "string",
235
+ "resolved": "string",
236
+ "references": {}
237
+ },
238
+ "required": false,
239
+ "optional": false,
240
+ "docs": {
241
+ "tags": [],
242
+ "text": ""
243
+ },
244
+ "attribute": "value",
245
+ "reflect": true
246
+ },
247
+ "theme": {
248
+ "type": "string",
249
+ "mutable": false,
250
+ "complexType": {
251
+ "original": "'primary' | 'secondary' | 'tertiary'",
252
+ "resolved": "\"primary\" | \"secondary\" | \"tertiary\"",
253
+ "references": {}
254
+ },
255
+ "required": false,
256
+ "optional": false,
257
+ "docs": {
258
+ "tags": [],
259
+ "text": ""
260
+ },
261
+ "attribute": "theme",
262
+ "reflect": true
263
+ },
264
+ "selectedOptions": {
265
+ "type": "unknown",
266
+ "mutable": true,
267
+ "complexType": {
268
+ "original": "IOptionValue[]",
269
+ "resolved": "IOptionValue[]",
270
+ "references": {
271
+ "IOptionValue": {
272
+ "location": "import",
273
+ "path": "../q2-option-list"
274
+ }
275
+ }
276
+ },
277
+ "required": false,
278
+ "optional": false,
279
+ "docs": {
280
+ "tags": [],
281
+ "text": ""
282
+ },
283
+ "defaultValue": "[]"
284
+ }
285
+ }; }
286
+ static get states() { return {
287
+ "hasOptions": {}
288
+ }; }
289
+ static get events() { return [{
290
+ "method": "change",
291
+ "name": "change",
292
+ "bubbles": true,
293
+ "cancelable": true,
294
+ "composed": true,
295
+ "docs": {
296
+ "tags": [],
297
+ "text": ""
298
+ },
299
+ "complexType": {
300
+ "original": "{ value: string; values: IOptionValue[]; active: boolean }",
301
+ "resolved": "{ value: string; values: IOptionValue[]; active: boolean; }",
302
+ "references": {
303
+ "IOptionValue": {
304
+ "location": "import",
305
+ "path": "../q2-option-list"
306
+ }
307
+ }
308
+ }
309
+ }]; }
310
+ static get elementRef() { return "hostElement"; }
311
+ static get listeners() { return [{
312
+ "name": "focus",
313
+ "method": "delegateFocus",
314
+ "target": undefined,
315
+ "capture": false,
316
+ "passive": false
317
+ }, {
318
+ "name": "optionListState",
319
+ "method": "optionListStateEvent",
320
+ "target": undefined,
321
+ "capture": false,
322
+ "passive": false
323
+ }]; }
324
+ }
@@ -0,0 +1,227 @@
1
+ * {
2
+ box-sizing: border-box;
3
+ }
4
+
5
+ *:active {
6
+ outline: none;
7
+ }
8
+
9
+ *:focus {
10
+ outline: none;
11
+ box-shadow: var(--const-global-focus);
12
+ }
13
+
14
+ :host {
15
+ box-shadow: none !important;
16
+ }
17
+
18
+ ::-moz-focus-inner {
19
+ border: none;
20
+ }
21
+
22
+ input,
23
+ textarea,
24
+ button {
25
+ font-family: inherit;
26
+ font-size: inherit;
27
+ }
28
+
29
+ :host(.sr),
30
+ :host(.sr) button {
31
+ border: 0;
32
+ clip: rect(0 0 0 0);
33
+ height: 1px;
34
+ margin: -1px;
35
+ overflow: hidden;
36
+ padding: 0;
37
+ position: absolute;
38
+ width: 1px;
39
+ white-space: nowrap;
40
+ }
41
+
42
+ .sr,
43
+ .sr button {
44
+ border: 0;
45
+ clip: rect(0 0 0 0);
46
+ height: 1px;
47
+ margin: -1px;
48
+ overflow: hidden;
49
+ padding: 0;
50
+ position: absolute;
51
+ width: 1px;
52
+ white-space: nowrap;
53
+ }
54
+
55
+ .hidden {
56
+ display: none;
57
+ }
58
+
59
+ :host([hidden]) {
60
+ display: none;
61
+ }
62
+
63
+ .invisible {
64
+ visibility: hidden;
65
+ }
66
+
67
+ :host {
68
+ display: inline-block;
69
+ position: relative;
70
+ }
71
+
72
+ :host(:not(:last-child)) {
73
+ margin-inline-end: var(--tct-pill-margin, var(--t-pill-margin, var(--app-scale-2x, 10px)));
74
+ }
75
+
76
+ .btn-wrapper {
77
+ --comp-pill-min-height: var(--tct-pill-min-height, var(--t-pill-min-height, 44px));
78
+ --comp-pill-btn-border-width: var(--tct-pill-btn-border-width, var(--t-pill-btn-border-width, 2px));
79
+ --comp-pill-btn-height: var(--tct-pill-btn-height, var(--t-pill-btn-height, 30px));
80
+ --comp-close-size: 0px;
81
+ --comp-btn-background: var(--tct-pill-btn-background, var(--t-pill-btn-background, var(--t-base, #ffffff)));
82
+ --compt-hover-btn-background: var(--tct-pill-hover-btn-background, var(--t-pill-hover-btn-background, var(--t-gray-13, #e6e6e6)));
83
+ --comp-btn-padding: var(--tct-pill-btn-padding-inline, var(--t-pill-btn-padding-inline, var(--app-scale-3x, 15px)));
84
+ --comp-btn-color: var(--tct-pill-btn-color, var(--t-pill-btn-color, var(--t-gray-3, #262626)));
85
+ --comp-active-btn-background: var(--tct-pill-active-btn-background, var(--t-pill-active-btn-background, var(--t-gray-7, #666666)));
86
+ --comp-active-btn-border-color: var(--tct-pill-active-btn-border-color, var(--t-pill-active-btn-border-color, var(--t-gray-7, #666666)));
87
+ --comp-hover-active-btn-background: var(--tct-pill-active-btn-background, var(--t-pill-active-btn-background, var(--t-gray-6, #4d4d4d)));
88
+ --comp-hover-active-btn-border-color: var(--tct-pill-active-btn-background, var(--t-pill-active-btn-background, var(--t-gray-6, #4d4d4d)));
89
+ position: relative;
90
+ }
91
+ :host(:not(:empty)) .btn-wrapper, .btn-wrapper.has-icon {
92
+ --comp-close-size: var(--comp-pill-btn-height);
93
+ }
94
+ :host([active]) .btn-wrapper {
95
+ --comp-btn-color: var(--tct-pill-active-btn-color, var(--t-pill-active-btn-color, var(--t-base, #ffffff)));
96
+ }
97
+ :host([theme=primary]) .btn-wrapper {
98
+ --comp-active-btn-background: var(--t-primary-l5, #61c4ff);
99
+ --comp-btn-color: var(--t-primary-text, #ffffff);
100
+ --comp-active-btn-border-color: var(--t-primary-l5, #61c4ff);
101
+ --comp-hover-active-btn-background: var(--t-primary-l3, #21acff);
102
+ --comp-hover-active-btn-border-color: var(--t-primary-l3, #21acff);
103
+ }
104
+ :host([theme=secondary]) .btn-wrapper {
105
+ --comp-active-btn-background: var(--t-secondary-l5, #61c4ff);
106
+ --comp-btn-color: var(--t-secondary-text, #000000);
107
+ --comp-active-btn-border-color: var(--t-secondary-l5, #61c4ff);
108
+ --comp-hover-active-btn-background: var(--t-secondary-l3, #21acff);
109
+ --comp-hover-active-btn-border-color: var(--t-secondary-l3, #21acff);
110
+ }
111
+ :host([theme=tertiary]) .btn-wrapper {
112
+ --comp-active-btn-background: var(--t-tertiary-l5, #61c4ff);
113
+ --comp-btn-color: var(--t-tertiary-text, #000000);
114
+ --comp-active-btn-border-color: var(--t-tertiary-l5, #61c4ff);
115
+ --comp-hover-active-btn-background: var(--t-tertiary-l3, #21acff);
116
+ --comp-hover-active-btn-border-color: var(--t-tertiary-l3, #21acff);
117
+ }
118
+
119
+ q2-option-list {
120
+ position: absolute;
121
+ left: 0;
122
+ }
123
+
124
+ .btn-height-wrapper {
125
+ height: var(--comp-pill-min-height);
126
+ display: flex;
127
+ align-items: center;
128
+ cursor: pointer;
129
+ }
130
+ .btn-height-wrapper:focus {
131
+ box-shadow: none;
132
+ }
133
+ :host([disabled]) .btn-height-wrapper {
134
+ cursor: not-allowed;
135
+ }
136
+
137
+ .btn-close,
138
+ .btn-primary {
139
+ cursor: pointer;
140
+ height: var(--comp-pill-btn-height);
141
+ border-style: solid;
142
+ border-radius: var(--tct-pill-btn-border-radius, var(--t-pill-btn-border-radius, 30px));
143
+ transition-property: background, color, padding, width, opacity;
144
+ transition: var(--tct-pill-btn-tween, var(--t-pill-btn-tween, var(--app-tween-1, 0.2s ease)));
145
+ }
146
+
147
+ :host([disabled]) .btn-close,
148
+ :host([disabled]) .btn-primary,
149
+ :host([disabled]) q2-icon {
150
+ opacity: var(--tct-pill-disabled-opacity, var(--t-pill-disabled-opacity, var(--tct-disabled-opacity, var(--app-disabled-opacity, 0.4))));
151
+ cursor: not-allowed;
152
+ }
153
+
154
+ .btn-primary {
155
+ background: var(--comp-btn-background);
156
+ border-width: var(--comp-pill-btn-border-width);
157
+ border-color: var(--tct-pill-btn-border-color, var(--t-pill-btn-border-color, var(--t-gray-9, #999999)));
158
+ padding-inline: var(--comp-btn-padding);
159
+ padding-right: calc(var(--comp-btn-padding) + var(--comp-close-size));
160
+ font-size: var(--tct-pill-btn-font-size, var(--t-pill-btn-font-size, var(--app-font-size, 14px)));
161
+ color: var(--comp-btn-color);
162
+ display: block;
163
+ width: 100%;
164
+ text-align: start;
165
+ }
166
+ .btn-primary:focus, .btn-primary:hover {
167
+ background: var(--comp-hover-btn-background);
168
+ }
169
+ :host(:not(:empty)) .btn-primary, .has-icon .btn-primary {
170
+ padding-right: calc( var(--tct-pill-icon-gap, var(--t-pill-icon-gap, var(--app-size-1x, 5px))) + var(--comp-close-size) );
171
+ }
172
+ .has-options .btn-primary {
173
+ text-overflow: ellipsis;
174
+ overflow: hidden;
175
+ white-space: nowrap;
176
+ max-width: var(--tct-pill-max-width, var(--t-pill-max-width, 200px));
177
+ }
178
+ :host([active]) .btn-primary {
179
+ background: var(--comp-active-btn-background);
180
+ border-color: var(--comp-active-btn-border-color);
181
+ }
182
+ :host([active]) .btn-primary:focus, :host([active]) .btn-primary:hover {
183
+ background: var(--comp-hover-active-btn-background);
184
+ border-color: var(--comp-hover-active-btn-border-color);
185
+ }
186
+
187
+ .btn-close {
188
+ background: transparent;
189
+ border-color: transparent;
190
+ border-width: var(--comp-pill-btn-border-width);
191
+ width: var(--comp-close-size);
192
+ height: var(--comp-close-size);
193
+ padding: 0;
194
+ border: 0;
195
+ display: inline-flex;
196
+ justify-content: center;
197
+ align-items: center;
198
+ position: absolute;
199
+ right: 0;
200
+ top: 50%;
201
+ transform: translateY(-50%);
202
+ opacity: 0;
203
+ stroke: var(--comp-btn-color);
204
+ --tct-icon-stroke-primary: var(--comp-btn-color);
205
+ }
206
+ :host(:not(:empty)) .btn-close, .has-icon .btn-close {
207
+ opacity: 1;
208
+ }
209
+
210
+ q2-icon {
211
+ width: var(--tct-pill-icon-size, var(--t-pill-icon-size, 14px));
212
+ height: var(--tct-pill-icon-size, var(--t-pill-icon-size, 14px));
213
+ transition-property: transform;
214
+ transition: var(--tct-pill-btn-tween, var(--t-pill-btn-tween, var(--app-tween-1, 0.2s ease)));
215
+ }
216
+
217
+ div.btn-close {
218
+ pointer-events: none;
219
+ }
220
+ :host([open]) div.btn-close q2-icon {
221
+ transform: rotate(180deg);
222
+ }
223
+
224
+ :host([active]) button.btn-close:focus, :host([active]) button.btn-close:hover {
225
+ background: var(--tct-pill-hover-close-btn-background, var(--t-pill-hover-close-btn-background, var(--t-top-a1, rgba(13, 13, 13, 0.35))));
226
+ border-color: var(--tct-pill-hover-close-btn-border-color, var(--t-pill-hover-close-btn-border-color, var(--t-top-a1, rgba(13, 13, 13, 0.35))));
227
+ }