q2-tecton-elements 1.13.0-alpha.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/click-elsewhere.cjs.entry.js +5 -7
- package/dist/cjs/{icons-4595ee47.js → icons-08ffe5c9.js} +394 -384
- package/dist/cjs/{index-c2e53804.js → index-7febb200.js} +112 -65
- package/dist/cjs/{index-a55d3c34.js → index-dd823ee6.js} +27 -14
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/q2-avatar.cjs.entry.js +2 -2
- package/dist/cjs/q2-badge.cjs.entry.js +43 -0
- package/dist/cjs/q2-btn_2.cjs.entry.js +13 -13
- package/dist/cjs/q2-calendar.cjs.entry.js +53 -59
- package/dist/cjs/q2-card.cjs.entry.js +127 -0
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +5 -5
- package/dist/cjs/q2-carousel.cjs.entry.js +318 -106
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +6 -3
- package/dist/cjs/q2-checkbox.cjs.entry.js +18 -10
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +7 -7
- package/dist/cjs/q2-dropdown.cjs.entry.js +8 -17
- package/dist/cjs/q2-editable-field.cjs.entry.js +5 -8
- package/dist/cjs/q2-icon.cjs.entry.js +3 -3
- package/dist/cjs/q2-input.cjs.entry.js +439 -437
- package/dist/cjs/q2-loading-element.cjs.entry.js +3 -3
- package/dist/cjs/q2-loc.cjs.entry.js +2 -2
- package/dist/cjs/q2-message.cjs.entry.js +5 -5
- package/dist/cjs/q2-optgroup.cjs.entry.js +3 -3
- package/dist/cjs/q2-option-list.cjs.entry.js +359 -0
- package/dist/cjs/q2-option.cjs.entry.js +3 -11
- package/dist/cjs/q2-pagination.cjs.entry.js +116 -0
- package/dist/cjs/q2-pill.cjs.entry.js +137 -0
- package/dist/cjs/q2-radio-group.cjs.entry.js +43 -18
- package/dist/cjs/q2-radio.cjs.entry.js +21 -4
- package/dist/cjs/q2-section.cjs.entry.js +5 -7
- package/dist/cjs/q2-select.cjs.entry.js +23 -26
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +42 -4
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js +278 -0
- package/dist/cjs/q2-stepper.cjs.entry.js +10 -12
- package/dist/cjs/q2-tab-container.cjs.entry.js +12 -8
- package/dist/cjs/q2-tab-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-tag.cjs.entry.js +94 -0
- package/dist/cjs/q2-tecton-elements.cjs.js +3 -3
- package/dist/cjs/q2-textarea.cjs.entry.js +8 -8
- package/dist/cjs/{shapes-086c0365.js → shapes-305746b5.js} +9 -16
- package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -5
- package/dist/collection/collection-manifest.json +10 -3
- package/dist/collection/components/click-elsewhere/index.js +4 -6
- package/dist/collection/components/q2-badge/index.js +148 -0
- package/dist/collection/components/q2-badge/styles.css +134 -0
- package/dist/collection/components/q2-btn/index.js +14 -14
- package/dist/collection/components/q2-btn/styles.css +1 -1
- package/dist/collection/components/q2-calendar/helpers.js +22 -20
- package/dist/collection/components/q2-calendar/index.js +44 -37
- package/dist/collection/components/q2-calendar/validation.js +4 -2
- package/dist/collection/components/q2-card/index.js +347 -0
- package/dist/collection/components/q2-card/styles.css +177 -0
- package/dist/collection/components/q2-carousel/index.js +11 -16
- package/dist/collection/components/q2-carousel/styles.css +3 -3
- package/dist/collection/components/q2-carousel-pane/index.js +2 -2
- package/dist/collection/components/q2-carousel-pane/styles.css +8 -3
- package/dist/collection/components/q2-checkbox/index.js +37 -12
- package/dist/collection/components/q2-checkbox-group/index.js +22 -1
- package/dist/collection/components/q2-dropdown/index.js +6 -15
- package/dist/collection/components/q2-dropdown-item/index.js +5 -5
- package/dist/collection/components/q2-editable-field/index.js +3 -6
- package/dist/collection/components/q2-icon/icons.js +393 -383
- package/dist/collection/components/q2-input/formatting/credit-card.js +15 -13
- package/dist/collection/components/q2-input/formatting/currency.js +162 -162
- package/dist/collection/components/q2-input/formatting/date.js +1 -1
- package/dist/collection/components/q2-input/formatting/generic.js +7 -8
- package/dist/collection/components/q2-input/formatting/number.js +6 -9
- package/dist/collection/components/q2-input/formatting/numeric.js +5 -5
- package/dist/collection/components/q2-input/formatting/phone.js +215 -215
- package/dist/collection/components/q2-input/formatting/postal.js +1 -1
- package/dist/collection/components/q2-input/index.js +81 -25
- package/dist/collection/components/q2-input/styles.css +19 -14
- package/dist/collection/components/q2-loading/index.js +4 -4
- package/dist/collection/components/q2-loading/skeleton/q2-loading-element/index.js +1 -1
- package/dist/collection/components/q2-loading/skeleton/shapes.js +8 -15
- package/dist/collection/components/q2-message/index.js +3 -3
- package/dist/collection/components/q2-optgroup/index.js +1 -1
- package/dist/collection/components/q2-option/index.js +19 -25
- package/dist/collection/components/q2-option/styles.css +5 -0
- package/dist/collection/components/q2-option-list/index.js +648 -0
- package/dist/collection/components/q2-option-list/styles.css +128 -0
- package/dist/collection/components/q2-pagination/index.js +275 -0
- package/dist/collection/components/q2-pagination/styles.css +120 -0
- package/dist/collection/components/q2-pill/index.js +324 -0
- package/dist/collection/components/q2-pill/styles.css +229 -0
- package/dist/collection/components/q2-radio/index.js +38 -1
- package/dist/collection/components/q2-radio-group/index.js +66 -24
- package/dist/collection/components/q2-section/index.js +5 -7
- package/dist/collection/components/q2-select/index.js +40 -25
- package/dist/collection/components/q2-stepper/index.js +8 -10
- package/dist/collection/components/q2-stepper/styles.css +5 -5
- package/dist/collection/components/q2-stepper-pane/index.js +133 -5
- package/dist/collection/components/q2-stepper-vertical/index.js +346 -0
- package/dist/collection/components/q2-stepper-vertical/styles.css +273 -0
- package/dist/collection/components/q2-tab-container/index.js +11 -7
- package/dist/collection/components/q2-tag/index.js +200 -0
- package/dist/collection/components/q2-tag/styles.css +141 -0
- package/dist/collection/components/q2-textarea/index.js +6 -6
- package/dist/collection/components/tecton-tab-pane/index.js +3 -10
- package/dist/collection/utils/index.js +25 -13
- package/dist/esm/click-elsewhere.entry.js +5 -7
- package/dist/esm/{icons-3ee662ea.js → icons-b1e11526.js} +394 -384
- package/dist/esm/{index-ec6660af.js → index-0ff8de52.js} +27 -15
- package/dist/esm/{index-be8376c0.js → index-dbfb3ecc.js} +112 -65
- package/dist/esm/loader.js +3 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/q2-avatar.entry.js +2 -2
- package/dist/esm/q2-badge.entry.js +39 -0
- package/dist/esm/q2-btn_2.entry.js +13 -13
- package/dist/esm/q2-calendar.entry.js +53 -59
- package/dist/esm/q2-card.entry.js +123 -0
- package/dist/esm/q2-carousel-pane.entry.js +5 -5
- package/dist/esm/q2-carousel.entry.js +318 -106
- package/dist/esm/q2-checkbox-group.entry.js +6 -3
- package/dist/esm/q2-checkbox.entry.js +18 -10
- package/dist/esm/q2-dropdown-item.entry.js +7 -7
- package/dist/esm/q2-dropdown.entry.js +8 -17
- package/dist/esm/q2-editable-field.entry.js +5 -8
- package/dist/esm/q2-icon.entry.js +3 -3
- package/dist/esm/q2-input.entry.js +439 -437
- package/dist/esm/q2-loading-element.entry.js +3 -3
- package/dist/esm/q2-loc.entry.js +2 -2
- package/dist/esm/q2-message.entry.js +5 -5
- package/dist/esm/q2-optgroup.entry.js +3 -3
- package/dist/esm/q2-option-list.entry.js +355 -0
- package/dist/esm/q2-option.entry.js +3 -11
- package/dist/esm/q2-pagination.entry.js +112 -0
- package/dist/esm/q2-pill.entry.js +133 -0
- package/dist/esm/q2-radio-group.entry.js +43 -18
- package/dist/esm/q2-radio.entry.js +21 -4
- package/dist/esm/q2-section.entry.js +5 -7
- package/dist/esm/q2-select.entry.js +23 -26
- package/dist/esm/q2-stepper-pane.entry.js +42 -4
- package/dist/esm/q2-stepper-vertical.entry.js +274 -0
- package/dist/esm/q2-stepper.entry.js +10 -12
- package/dist/esm/q2-tab-container.entry.js +12 -8
- package/dist/esm/q2-tab-pane.entry.js +1 -1
- package/dist/esm/q2-tag.entry.js +90 -0
- package/dist/esm/q2-tecton-elements.js +3 -3
- package/dist/esm/q2-textarea.entry.js +8 -8
- package/dist/esm/{shapes-81c11dfe.js → shapes-cff4e1f0.js} +9 -16
- package/dist/esm/tecton-tab-pane.entry.js +2 -5
- package/dist/loader/index.d.ts +0 -1
- package/dist/q2-tecton-elements/{p-75e87cca.entry.js → p-00e8f782.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-0900bec1.entry.js +1 -0
- package/dist/q2-tecton-elements/p-10264ecb.entry.js +1 -0
- package/dist/q2-tecton-elements/p-123cdfb9.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-fbf7c5e6.entry.js → p-1305ec5f.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-148391d6.entry.js +1 -0
- package/dist/q2-tecton-elements/p-1dfaee64.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-32ad664c.entry.js → p-221abbf6.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-c90a6016.js → p-255b2b4c.js} +1 -1
- package/dist/q2-tecton-elements/p-27736b6b.entry.js +1 -0
- package/dist/q2-tecton-elements/p-2846ab94.entry.js +1 -0
- package/dist/q2-tecton-elements/p-2bc1de01.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-8ea2c4f7.entry.js → p-2c15414c.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-2caa89fd.js +1 -0
- package/dist/q2-tecton-elements/p-327cca41.entry.js +1 -0
- package/dist/q2-tecton-elements/p-3a420dbf.entry.js +1 -0
- package/dist/q2-tecton-elements/p-3abcb09d.entry.js +1 -0
- package/dist/q2-tecton-elements/p-3fe98e3e.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-bb2e110a.entry.js → p-430a979b.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-7e6fc65d.entry.js → p-45eb7739.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-750bcd33.entry.js → p-49b2abc4.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-9b50c3c3.entry.js → p-4ab30466.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-50e218c7.entry.js +1 -0
- package/dist/q2-tecton-elements/p-5bbf2bfe.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-ac859fcc.entry.js → p-6fec9235.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-824aebd9.js +1 -0
- package/dist/q2-tecton-elements/p-a4ae89cc.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-50967020.entry.js → p-a5562aaa.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-ae4fed23.entry.js +1 -0
- package/dist/q2-tecton-elements/p-b2302cd3.entry.js +1 -0
- package/dist/q2-tecton-elements/p-c20cbb2d.entry.js +1 -0
- package/dist/q2-tecton-elements/p-ca7a3380.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-a6f8d09a.entry.js → p-d33e152c.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-9024859f.entry.js → p-d5218cd6.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-d52b435e.entry.js +1 -0
- package/dist/q2-tecton-elements/p-dd02cf8d.js +1 -0
- package/dist/q2-tecton-elements/{p-07a5d703.entry.js → p-e0e7ae8b.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-7e030e92.entry.js → p-ede12fc1.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-df182f61.entry.js → p-fdfbe75b.entry.js} +1 -1
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/test/elements/q2-tag-test.js +151 -0
- package/dist/test/helpers.js +20 -9
- package/dist/types/components/q2-badge/index.d.ts +13 -0
- package/dist/types/components/q2-btn/index.d.ts +3 -3
- package/dist/types/components/q2-calendar/helpers.d.ts +1 -0
- package/dist/types/components/q2-calendar/index.d.ts +2 -1
- package/dist/types/components/q2-calendar/validation.d.ts +1 -1
- package/dist/types/components/q2-card/index.d.ts +35 -0
- package/dist/types/components/q2-checkbox/index.d.ts +3 -1
- package/dist/types/components/q2-checkbox-group/index.d.ts +1 -0
- package/dist/types/components/q2-dropdown/index.d.ts +1 -1
- package/dist/types/components/q2-editable-field/index.d.ts +1 -1
- package/dist/types/components/q2-input/formatting/credit-card.d.ts +1 -3
- package/dist/types/components/q2-input/index.d.ts +5 -2
- package/dist/types/components/q2-option/index.d.ts +2 -3
- package/dist/types/components/q2-option-list/index.d.ts +62 -0
- package/dist/types/components/q2-pagination/index.d.ts +30 -0
- package/dist/types/components/q2-pill/index.d.ts +39 -0
- package/dist/types/components/q2-radio/index.d.ts +4 -1
- package/dist/types/components/q2-radio-group/index.d.ts +5 -1
- package/dist/types/components/q2-select/index.d.ts +2 -1
- package/dist/types/components/q2-stepper/index.d.ts +1 -1
- package/dist/types/components/q2-stepper-pane/index.d.ts +16 -1
- package/dist/types/components/q2-stepper-vertical/index.d.ts +52 -0
- package/dist/types/components/q2-tab-container/index.d.ts +1 -1
- package/dist/types/components/q2-tag/index.d.ts +28 -0
- package/dist/types/components/tecton-tab-pane/index.d.ts +2 -2
- package/dist/types/components.d.ts +235 -11
- package/dist/types/global.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +6 -4
- package/dist/types/util.d.ts +2 -10
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/workspace/workspace/Tecton_tecton-production_master/packages/q2-tecton-elements/.stencil/test/elements/q2-tag-test.d.ts +1 -0
- package/dist/types/workspace/workspace/{_production_release_1.11.0-alpha → Tecton_tecton-production_master}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +6 -3
- package/package.json +13 -13
- package/dist/q2-tecton-elements/p-06fff43d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-080839ed.js +0 -1
- package/dist/q2-tecton-elements/p-29a37091.entry.js +0 -1
- package/dist/q2-tecton-elements/p-37aba2a4.js +0 -1
- package/dist/q2-tecton-elements/p-4cd00f1a.js +0 -1
- package/dist/q2-tecton-elements/p-6702eb4d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-768e3a5d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-843b1ee9.entry.js +0 -1
- package/dist/q2-tecton-elements/p-943c7745.entry.js +0 -1
- package/dist/q2-tecton-elements/p-95a73559.entry.js +0 -1
- package/dist/q2-tecton-elements/p-9a977ee6.entry.js +0 -1
- package/dist/q2-tecton-elements/p-b281c349.entry.js +0 -1
- package/dist/q2-tecton-elements/p-c5e55b9f.entry.js +0 -1
- package/dist/q2-tecton-elements/p-ccbe9158.entry.js +0 -1
- package/dist/q2-tecton-elements/p-db6f90ac.entry.js +0 -1
- package/dist/q2-tecton-elements/p-fa6eea5c.entry.js +0 -1
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { Component, State, Prop, h, Listen, Element, Fragment, Event, } from '@stencil/core';
|
|
2
|
+
import { isEventFromElement, loc, overrideFocus } from 'src/utils';
|
|
3
|
+
export class Q2Tag {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.role = 'listitem';
|
|
6
|
+
/// Getters ///
|
|
7
|
+
/// Helpers
|
|
8
|
+
this.determineHasOptions = () => {
|
|
9
|
+
const hasOptions = !!this.hostElement.querySelectorAll('q2-option').length;
|
|
10
|
+
this.hasOptions = hasOptions;
|
|
11
|
+
};
|
|
12
|
+
/// Event Handlers ///
|
|
13
|
+
this.handleChange = event => {
|
|
14
|
+
event.stopPropagation();
|
|
15
|
+
if (!this.hasOptions)
|
|
16
|
+
return;
|
|
17
|
+
const { value } = event.detail;
|
|
18
|
+
this.click.emit({ value });
|
|
19
|
+
};
|
|
20
|
+
this.handleClick = (event) => {
|
|
21
|
+
event.stopPropagation();
|
|
22
|
+
this.optionList.toggle();
|
|
23
|
+
};
|
|
24
|
+
this.handleKeydown = (event) => {
|
|
25
|
+
this.optionList.handleExternalKeydown(event);
|
|
26
|
+
};
|
|
27
|
+
this.handleButtonFocusout = (event) => {
|
|
28
|
+
var _a;
|
|
29
|
+
const relatedTarget = event.relatedTarget;
|
|
30
|
+
if ((_a = (relatedTarget === null || relatedTarget === void 0 ? void 0 : relatedTarget.tagName) === 'Q2-OPTION') !== null && _a !== void 0 ? _a : false)
|
|
31
|
+
return;
|
|
32
|
+
this.open = false;
|
|
33
|
+
};
|
|
34
|
+
this.handleOptionListFocusout = (event) => {
|
|
35
|
+
const relatedTarget = event.relatedTarget;
|
|
36
|
+
if (relatedTarget && !(event.relatedTarget instanceof HTMLElement))
|
|
37
|
+
return;
|
|
38
|
+
if (relatedTarget && relatedTarget.closest('.btn-wrapper'))
|
|
39
|
+
return;
|
|
40
|
+
this.open = false;
|
|
41
|
+
};
|
|
42
|
+
this.handleWrapperClick = () => {
|
|
43
|
+
this.dropdownBtn.focus();
|
|
44
|
+
this.dropdownBtn.click();
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/// LifeCycle Hooks ///
|
|
48
|
+
componentWillLoad() {
|
|
49
|
+
const observer = new MutationObserver(this.determineHasOptions);
|
|
50
|
+
observer.observe(this.hostElement, { childList: true, attributes: true });
|
|
51
|
+
this.mutationObserver = observer;
|
|
52
|
+
}
|
|
53
|
+
componentDidLoad() {
|
|
54
|
+
overrideFocus(this.hostElement);
|
|
55
|
+
}
|
|
56
|
+
disconnectedCallback() {
|
|
57
|
+
this.mutationObserver.disconnect();
|
|
58
|
+
this.mutationObserver = null;
|
|
59
|
+
}
|
|
60
|
+
/// Listeners ///
|
|
61
|
+
delegateFocus(event) {
|
|
62
|
+
if (!isEventFromElement(event, this.hostElement))
|
|
63
|
+
return;
|
|
64
|
+
if (!this.hasOptions)
|
|
65
|
+
return;
|
|
66
|
+
this.dropdownBtn.focus();
|
|
67
|
+
}
|
|
68
|
+
optionListStateEvent({ detail: { open } }) {
|
|
69
|
+
this.open = open;
|
|
70
|
+
if (!open)
|
|
71
|
+
this.dropdownBtn.focus();
|
|
72
|
+
}
|
|
73
|
+
/// DOM ///
|
|
74
|
+
render() {
|
|
75
|
+
const { hasOptions, open } = this;
|
|
76
|
+
const wrapperClassNames = ['tag-wrapper'];
|
|
77
|
+
if (hasOptions)
|
|
78
|
+
wrapperClassNames.push('has-options');
|
|
79
|
+
return (h(Fragment, null,
|
|
80
|
+
h("div", { class: wrapperClassNames.join(' '), onClick: e => e.stopPropagation() },
|
|
81
|
+
h("div", { class: "tag" }, this.label),
|
|
82
|
+
this.hasOptions && (h("div", { class: "btn-wrapper", onClick: this.handleWrapperClick },
|
|
83
|
+
h("button", { ref: el => (this.dropdownBtn = el), "test-id": "btn-control", onClick: this.handleClick, onKeyDown: this.handleKeydown, onFocusout: this.handleButtonFocusout, "aria-controls": "option-list", "aria-haspopup": "true", "aria-expanded": open ? 'true' : 'false', "aria-label": loc('tecton.element.tag.viewOptions') },
|
|
84
|
+
h("q2-icon", { type: "options" }))))),
|
|
85
|
+
this.hasOptions && (h("q2-option-list", { id: "option-list", ref: el => (this.optionList = el), open: this.open, onChange: this.handleChange, onFocusout: this.handleOptionListFocusout, align: "right", type: "menu", "no-select": true },
|
|
86
|
+
h("slot", null)))));
|
|
87
|
+
}
|
|
88
|
+
static get is() { return "q2-tag"; }
|
|
89
|
+
static get encapsulation() { return "shadow"; }
|
|
90
|
+
static get originalStyleUrls() { return {
|
|
91
|
+
"$": ["styles.scss"]
|
|
92
|
+
}; }
|
|
93
|
+
static get styleUrls() { return {
|
|
94
|
+
"$": ["styles.css"]
|
|
95
|
+
}; }
|
|
96
|
+
static get properties() { return {
|
|
97
|
+
"open": {
|
|
98
|
+
"type": "boolean",
|
|
99
|
+
"mutable": true,
|
|
100
|
+
"complexType": {
|
|
101
|
+
"original": "boolean",
|
|
102
|
+
"resolved": "boolean",
|
|
103
|
+
"references": {}
|
|
104
|
+
},
|
|
105
|
+
"required": false,
|
|
106
|
+
"optional": false,
|
|
107
|
+
"docs": {
|
|
108
|
+
"tags": [],
|
|
109
|
+
"text": ""
|
|
110
|
+
},
|
|
111
|
+
"attribute": "open",
|
|
112
|
+
"reflect": true
|
|
113
|
+
},
|
|
114
|
+
"role": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"mutable": false,
|
|
117
|
+
"complexType": {
|
|
118
|
+
"original": "string",
|
|
119
|
+
"resolved": "string",
|
|
120
|
+
"references": {}
|
|
121
|
+
},
|
|
122
|
+
"required": false,
|
|
123
|
+
"optional": false,
|
|
124
|
+
"docs": {
|
|
125
|
+
"tags": [],
|
|
126
|
+
"text": ""
|
|
127
|
+
},
|
|
128
|
+
"attribute": "role",
|
|
129
|
+
"reflect": true,
|
|
130
|
+
"defaultValue": "'listitem'"
|
|
131
|
+
},
|
|
132
|
+
"label": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"mutable": false,
|
|
135
|
+
"complexType": {
|
|
136
|
+
"original": "string",
|
|
137
|
+
"resolved": "string",
|
|
138
|
+
"references": {}
|
|
139
|
+
},
|
|
140
|
+
"required": false,
|
|
141
|
+
"optional": false,
|
|
142
|
+
"docs": {
|
|
143
|
+
"tags": [],
|
|
144
|
+
"text": ""
|
|
145
|
+
},
|
|
146
|
+
"attribute": "label",
|
|
147
|
+
"reflect": true
|
|
148
|
+
},
|
|
149
|
+
"theme": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"mutable": false,
|
|
152
|
+
"complexType": {
|
|
153
|
+
"original": "'primary' | 'secondary' | 'tertiary'",
|
|
154
|
+
"resolved": "\"primary\" | \"secondary\" | \"tertiary\"",
|
|
155
|
+
"references": {}
|
|
156
|
+
},
|
|
157
|
+
"required": false,
|
|
158
|
+
"optional": false,
|
|
159
|
+
"docs": {
|
|
160
|
+
"tags": [],
|
|
161
|
+
"text": ""
|
|
162
|
+
},
|
|
163
|
+
"attribute": "theme",
|
|
164
|
+
"reflect": true
|
|
165
|
+
}
|
|
166
|
+
}; }
|
|
167
|
+
static get states() { return {
|
|
168
|
+
"hasOptions": {}
|
|
169
|
+
}; }
|
|
170
|
+
static get events() { return [{
|
|
171
|
+
"method": "click",
|
|
172
|
+
"name": "click",
|
|
173
|
+
"bubbles": true,
|
|
174
|
+
"cancelable": true,
|
|
175
|
+
"composed": true,
|
|
176
|
+
"docs": {
|
|
177
|
+
"tags": [],
|
|
178
|
+
"text": ""
|
|
179
|
+
},
|
|
180
|
+
"complexType": {
|
|
181
|
+
"original": "{ value: string }",
|
|
182
|
+
"resolved": "{ value: string; }",
|
|
183
|
+
"references": {}
|
|
184
|
+
}
|
|
185
|
+
}]; }
|
|
186
|
+
static get elementRef() { return "hostElement"; }
|
|
187
|
+
static get listeners() { return [{
|
|
188
|
+
"name": "focus",
|
|
189
|
+
"method": "delegateFocus",
|
|
190
|
+
"target": undefined,
|
|
191
|
+
"capture": false,
|
|
192
|
+
"passive": false
|
|
193
|
+
}, {
|
|
194
|
+
"name": "optionListState",
|
|
195
|
+
"method": "optionListStateEvent",
|
|
196
|
+
"target": undefined,
|
|
197
|
+
"capture": false,
|
|
198
|
+
"passive": false
|
|
199
|
+
}]; }
|
|
200
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
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-tag-margin, var(--t-tag-margin, var(--app-scale-2x, 10px)));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.tag-wrapper {
|
|
77
|
+
--comp-tag-btn-size: var(--tct-tag-btn-size, var(--t-tag-btn-size, var(--app-scale-6x, 30px)));
|
|
78
|
+
--comp-tag-background: var(--tct-tag-background, var(--t-tag-background, var(--t-gray-13, #e6e6e6)));
|
|
79
|
+
--comp-tag-color: var(--tct-tag-color, var(--t-tag-color, var(--t-gray-3, #262626)));
|
|
80
|
+
position: relative;
|
|
81
|
+
}
|
|
82
|
+
:host([theme=primary]) .tag-wrapper {
|
|
83
|
+
--comp-tag-background: var(--t-primary-l5, #61c4ff);
|
|
84
|
+
--comp-tag-color: var(--t-primary-text, #ffffff);
|
|
85
|
+
}
|
|
86
|
+
:host([theme=secondary]) .tag-wrapper {
|
|
87
|
+
--comp-tag-background: var(--t-secondary-l5, #61c4ff);
|
|
88
|
+
--comp-tag-color: var(--t-secondary-text, #000000);
|
|
89
|
+
}
|
|
90
|
+
:host([theme=tertiary]) .tag-wrapper {
|
|
91
|
+
--comp-tag-background: var(--t-tertiary-l5, #61c4ff);
|
|
92
|
+
--comp-tag-color: var(--t-tertiary-text, #000000);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.tag {
|
|
96
|
+
height: var(--tct-tag-height, var(--t-tag-height, var(--app-scale-6x, 30px)));
|
|
97
|
+
line-height: var(--tct-tag-height, var(--t-tag-height, var(--app-scale-6x, 30px)));
|
|
98
|
+
padding-inline: var(--tct-tag-padding-inline, var(--t-tag-padding-inline, var(--app-scale-3x, 15px)));
|
|
99
|
+
background: var(--comp-tag-background);
|
|
100
|
+
color: var(--comp-tag-color);
|
|
101
|
+
border-radius: var(--tct-tag-border-radius, var(--t-tag-border-radius, var(--app-border-radius-1, 3px)));
|
|
102
|
+
}
|
|
103
|
+
.has-options .tag {
|
|
104
|
+
padding-right: var(--comp-tag-btn-size);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.btn-wrapper {
|
|
108
|
+
--comp-tag-clickable-size: var(--tct-tag-clickable-size, var(--t-tag-clickable-size, 44px));
|
|
109
|
+
--comp-tag-btn-offset: calc(
|
|
110
|
+
calc(calc(var(--comp-tag-clickable-size) - var(--comp-tag-btn-size)) / 2) * -1
|
|
111
|
+
);
|
|
112
|
+
height: var(--comp-tag-clickable-size);
|
|
113
|
+
width: var(--comp-tag-clickable-size);
|
|
114
|
+
display: flex;
|
|
115
|
+
align-items: center;
|
|
116
|
+
justify-content: center;
|
|
117
|
+
position: absolute;
|
|
118
|
+
right: var(--comp-tag-btn-offset);
|
|
119
|
+
top: var(--comp-tag-btn-offset);
|
|
120
|
+
cursor: pointer;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
button {
|
|
124
|
+
width: var(--comp-tag-btn-size);
|
|
125
|
+
height: var(--comp-tag-btn-size);
|
|
126
|
+
stroke: var(--comp-tag-color);
|
|
127
|
+
--tct-icon-stroke-primary: var(--comp-tag-color);
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
border: 0;
|
|
130
|
+
background: transparent;
|
|
131
|
+
display: flex;
|
|
132
|
+
align-items: center;
|
|
133
|
+
justify-content: center;
|
|
134
|
+
padding: 0;
|
|
135
|
+
--tct-icon-size: 18px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
q2-option-list {
|
|
139
|
+
position: absolute;
|
|
140
|
+
right: 0;
|
|
141
|
+
}
|
|
@@ -26,7 +26,7 @@ export class Q2Textarea {
|
|
|
26
26
|
setMessageHeight(this);
|
|
27
27
|
};
|
|
28
28
|
this.onTextareaBlur = () => {
|
|
29
|
-
const { valueOnFocus, textareaField: { value } } = this;
|
|
29
|
+
const { valueOnFocus, textareaField: { value }, } = this;
|
|
30
30
|
this.hasFocus = false;
|
|
31
31
|
setMessageHeight(this);
|
|
32
32
|
if (valueOnFocus !== value)
|
|
@@ -48,7 +48,7 @@ export class Q2Textarea {
|
|
|
48
48
|
width: contentContainer.offsetWidth,
|
|
49
49
|
height: contentContainer.offsetHeight,
|
|
50
50
|
x: event.clientX,
|
|
51
|
-
y: event.clientY
|
|
51
|
+
y: event.clientY,
|
|
52
52
|
};
|
|
53
53
|
document.addEventListener('mousemove', this.onMouseMove);
|
|
54
54
|
document.addEventListener('mouseup', this.onMouseUp);
|
|
@@ -67,7 +67,7 @@ export class Q2Textarea {
|
|
|
67
67
|
width: contentContainer.offsetWidth,
|
|
68
68
|
height: contentContainer.offsetHeight,
|
|
69
69
|
x: firstTouch.pageX,
|
|
70
|
-
y: firstTouch.pageY
|
|
70
|
+
y: firstTouch.pageY,
|
|
71
71
|
};
|
|
72
72
|
document.addEventListener('touchmove', this.onTouchMove);
|
|
73
73
|
document.addEventListener('touchend', this.onTouchMove);
|
|
@@ -157,7 +157,7 @@ export class Q2Textarea {
|
|
|
157
157
|
}
|
|
158
158
|
setWidth(event) {
|
|
159
159
|
var _a, _b;
|
|
160
|
-
const { contentContainer, resize, downParams: { width, x } } = this;
|
|
160
|
+
const { contentContainer, resize, downParams: { width, x }, } = this;
|
|
161
161
|
const resizeX = ['both', 'horizontal'].includes(resize);
|
|
162
162
|
if (!resizeX)
|
|
163
163
|
return;
|
|
@@ -167,7 +167,7 @@ export class Q2Textarea {
|
|
|
167
167
|
}
|
|
168
168
|
setHeight(event) {
|
|
169
169
|
var _a, _b;
|
|
170
|
-
const { contentContainer, resize, downParams: { height, y } } = this;
|
|
170
|
+
const { contentContainer, resize, downParams: { height, y }, } = this;
|
|
171
171
|
const resizeY = ['both', 'vertical'].includes(resize);
|
|
172
172
|
if (!resizeY)
|
|
173
173
|
return;
|
|
@@ -194,7 +194,7 @@ export class Q2Textarea {
|
|
|
194
194
|
inputDOM() {
|
|
195
195
|
return (h("div", { class: "input-container" },
|
|
196
196
|
h("textarea", { id: this.inputId, placeholder: (this.placeholder && loc(this.placeholder)) || undefined, "test-id": "inputField", maxLength: this.maxlength, "aria-describedby": this.inputDescribedBy, "aria-invalid": `${this.hasError}`, "aria-required": `${!this.optional}`, "aria-label": this.hideLabel && this.label, spellcheck: this.spellcheck, rows: this.rows || 3, cols: this.cols, value: this.value, ref: el => (this.textareaField = el), readonly: !!this.readonly, disabled: !!this.disabled, maxlength: this.maxlength, onInput: this.onTextareaInput, onChange: this.onTextareaChange, onFocus: this.onTextareaFocus, onBlur: this.onTextareaBlur }),
|
|
197
|
-
this.hasError ? h("q2-icon", { type: "error", class: "icon-error" }) : '',
|
|
197
|
+
this.hasError ? (h("q2-icon", { type: "error", class: "icon-error" })) : (''),
|
|
198
198
|
this.showResize && (h("button", { onMouseDown: this.onMouseDown, onTouchStart: this.onTouchStart, class: "btn-resize", "aria-label": loc('tecton.element.input.resize'), tabIndex: -1 },
|
|
199
199
|
h("svg", { "aria-hidden": "true", viewBox: "0 0 12 12", xmlns: "http://www.w3.org/2000/svg" },
|
|
200
200
|
h("path", { d: "M8.5 11.5l3-3m-7 3l7-7m-11 7l11-11", fill: "none", "stroke-stroke-linecap": "square" }))))));
|
|
@@ -9,10 +9,7 @@ export class TectonTabPane {
|
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
get iframeTitle() {
|
|
12
|
-
return this.moduleId
|
|
13
|
-
.split('.')
|
|
14
|
-
.slice(-2)
|
|
15
|
-
.join('-');
|
|
12
|
+
return this.moduleId.split('.').slice(-2).join('-');
|
|
16
13
|
}
|
|
17
14
|
componentWillRender() {
|
|
18
15
|
const loadingWrapper = this.hostElement.shadowRoot.querySelector('.loading-wrapper');
|
|
@@ -234,13 +231,9 @@ export class TectonTabPane {
|
|
|
234
231
|
"type": "unknown",
|
|
235
232
|
"mutable": false,
|
|
236
233
|
"complexType": {
|
|
237
|
-
"original": "
|
|
234
|
+
"original": "{ key: string; value: string }[]",
|
|
238
235
|
"resolved": "{ key: string; value: string; }[]",
|
|
239
|
-
"references": {
|
|
240
|
-
"Array": {
|
|
241
|
-
"location": "global"
|
|
242
|
-
}
|
|
243
|
-
}
|
|
236
|
+
"references": {}
|
|
244
237
|
},
|
|
245
238
|
"required": false,
|
|
246
239
|
"optional": false,
|
|
@@ -11,12 +11,15 @@ export function addSmoothScrollPolyfill() {
|
|
|
11
11
|
if (!isSafari())
|
|
12
12
|
return false;
|
|
13
13
|
smoothscroll.polyfill();
|
|
14
|
-
return (window
|
|
14
|
+
return (window.__forceSmoothScrollPolyfill__ = true);
|
|
15
15
|
}
|
|
16
16
|
export function isFirefox() {
|
|
17
17
|
const userAgent = navigator.userAgent.toLowerCase();
|
|
18
18
|
return userAgent.includes('firefox');
|
|
19
19
|
}
|
|
20
|
+
export function isTouchDevice() {
|
|
21
|
+
return 'ontouchstart' in window || navigator.maxTouchPoints > 0;
|
|
22
|
+
}
|
|
20
23
|
export function isSafari() {
|
|
21
24
|
const userAgent = navigator.userAgent.toLowerCase();
|
|
22
25
|
return userAgent.includes('safari') && !userAgent.includes('chrome');
|
|
@@ -54,9 +57,16 @@ export function labelDOM(target) {
|
|
|
54
57
|
const { label, hideLabel } = target;
|
|
55
58
|
if (!label || hideLabel)
|
|
56
59
|
return;
|
|
60
|
+
let helpText = '';
|
|
61
|
+
if (target.optional) {
|
|
62
|
+
helpText = h("span", { class: "optional-tag" }, loc('tecton.element.input.optional'));
|
|
63
|
+
}
|
|
64
|
+
if (target.readonly) {
|
|
65
|
+
helpText = h("span", { class: "optional-tag" }, loc('tecton.element.input.readonly'));
|
|
66
|
+
}
|
|
57
67
|
return (h("label", { htmlFor: target.inputId, class: target.readonly ? 'readonly-field' : '' },
|
|
58
68
|
loc(target.label),
|
|
59
|
-
|
|
69
|
+
helpText));
|
|
60
70
|
}
|
|
61
71
|
export function handleAriaLabel(target) {
|
|
62
72
|
const { ariaLabel } = target;
|
|
@@ -76,17 +86,19 @@ export function messagesDOM(target) {
|
|
|
76
86
|
export function setMessageHeight(target) {
|
|
77
87
|
const messageContainer = target.hostElement.shadowRoot.querySelector('.messages-container');
|
|
78
88
|
const q2Message = messageContainer.querySelector('q2-message');
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
nextPaint(() => {
|
|
90
|
+
const height = target.showMessages && target.hasFocus ? q2Message.getBoundingClientRect().height : 0;
|
|
91
|
+
if (messageContainer.style.getPropertyValue('height') === `${height}px`)
|
|
92
|
+
return;
|
|
93
|
+
if (height === 0) {
|
|
94
|
+
q2Message.classList.add('invisible');
|
|
95
|
+
messageContainer.style.removeProperty('height');
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
q2Message.classList.remove('invisible');
|
|
99
|
+
messageContainer.style.setProperty('height', `${height}px`);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
90
102
|
}
|
|
91
103
|
export function setPopProperties(target) {
|
|
92
104
|
const { dropdownContainer, popDirection } = target;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, g as getElement } from './index-dbfb3ecc.js';
|
|
2
2
|
|
|
3
3
|
const ClickElsewhere = class {
|
|
4
4
|
constructor(hostRef) {
|
|
@@ -11,8 +11,7 @@ const ClickElsewhere = class {
|
|
|
11
11
|
this.isCurrentlyFocused = false;
|
|
12
12
|
this.mouseHandler = (event) => {
|
|
13
13
|
const isCurrentlyFocused = this.shadowContains(this.findActiveElement());
|
|
14
|
-
const aboutToBeFocused = this.shadowContains(this.shadowEventTarget(event)) ||
|
|
15
|
-
this.originatesInSlots(event.target);
|
|
14
|
+
const aboutToBeFocused = this.shadowContains(this.shadowEventTarget(event)) || this.originatesInSlots(event.target);
|
|
16
15
|
if (!aboutToBeFocused && (this.isCurrentlyFocused || isCurrentlyFocused)) {
|
|
17
16
|
this.isCurrentlyFocused = false;
|
|
18
17
|
this.change.emit();
|
|
@@ -69,12 +68,11 @@ const ClickElsewhere = class {
|
|
|
69
68
|
}
|
|
70
69
|
originatesInSlots(target) {
|
|
71
70
|
const slots = this.hostElement.querySelectorAll('slot');
|
|
72
|
-
for (
|
|
73
|
-
const currentSlot = slots[slotIndex];
|
|
71
|
+
for (const currentSlot of Array.from(slots)) {
|
|
74
72
|
const lightNodes = (currentSlot && currentSlot.assignedNodes && currentSlot.assignedNodes()) ||
|
|
75
73
|
this.hostElement.childNodes;
|
|
76
|
-
for (
|
|
77
|
-
if (
|
|
74
|
+
for (const currentNode of Array.from(lightNodes)) {
|
|
75
|
+
if (currentNode.contains(target)) {
|
|
78
76
|
return true;
|
|
79
77
|
}
|
|
80
78
|
}
|