tyrell-components 1.0.0-TC55 → 1.0.0-TC56
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/README.md +53 -53
- package/css/tyrell-theme.css +7 -2
- package/css/tyrell.css +6 -15
- package/dist/tyrell-theme.css +1 -1
- package/dist/tyrell.css +1 -1
- package/dist/tyrell.js +1 -1
- package/lib/base/ty-component.d.ts +14 -0
- package/lib/base/ty-component.d.ts.map +1 -0
- package/lib/base/ty-component.js +27 -0
- package/lib/base/ty-component.js.map +1 -0
- package/lib/components/button.d.ts.map +1 -0
- package/lib/components/button.js +7 -0
- package/lib/components/button.js.map +1 -0
- package/lib/components/calendar-month.d.ts.map +1 -0
- package/lib/components/calendar-month.js +3 -2
- package/lib/components/calendar-month.js.map +1 -0
- package/lib/components/calendar-navigation.d.ts +11 -0
- package/lib/components/calendar-navigation.d.ts.map +1 -0
- package/lib/components/calendar-navigation.js +51 -40
- package/lib/components/calendar-navigation.js.map +1 -0
- package/lib/components/calendar.d.ts +26 -0
- package/lib/components/calendar.d.ts.map +1 -0
- package/lib/components/calendar.js +177 -4
- package/lib/components/calendar.js.map +1 -0
- package/lib/components/checkbox.d.ts.map +1 -0
- package/lib/components/checkbox.js +3 -3
- package/lib/components/checkbox.js.map +1 -0
- package/lib/components/copy.d.ts.map +1 -0
- package/lib/components/copy.js +9 -2
- package/lib/components/copy.js.map +1 -0
- package/lib/components/date-picker.d.ts +15 -16
- package/lib/components/date-picker.d.ts.map +1 -0
- package/lib/components/date-picker.js +175 -249
- package/lib/components/date-picker.js.map +1 -0
- package/lib/components/dropdown.d.ts +403 -0
- package/lib/components/dropdown.d.ts.map +1 -0
- package/lib/components/dropdown.js +1315 -0
- package/lib/components/dropdown.js.map +1 -0
- package/lib/components/file-upload.d.ts +4 -0
- package/lib/components/file-upload.js +14 -0
- package/lib/components/icon.d.ts.map +1 -0
- package/lib/components/icon.js.map +1 -0
- package/lib/components/input.d.ts.map +1 -0
- package/lib/components/input.js +3 -3
- package/lib/components/input.js.map +1 -0
- package/lib/components/modal.d.ts +2 -8
- package/lib/components/modal.d.ts.map +1 -0
- package/lib/components/modal.js +8 -18
- package/lib/components/modal.js.map +1 -0
- package/lib/components/multiselect.d.ts +389 -0
- package/lib/components/multiselect.d.ts.map +1 -0
- package/lib/components/multiselect.js +1301 -0
- package/lib/components/multiselect.js.map +1 -0
- package/lib/components/option.d.ts.map +1 -0
- package/lib/components/option.js.map +1 -0
- package/lib/components/popup.d.ts.map +1 -0
- package/lib/components/popup.js +4 -1
- package/lib/components/popup.js.map +1 -0
- package/lib/components/radio.d.ts +15 -0
- package/lib/components/radio.js +34 -4
- package/lib/components/resize-observer.d.ts.map +1 -0
- package/lib/components/resize-observer.js.map +1 -0
- package/lib/components/scroll-container.d.ts +3 -2
- package/lib/components/scroll-container.d.ts.map +1 -0
- package/lib/components/scroll-container.js +5 -8
- package/lib/components/scroll-container.js.map +1 -0
- package/lib/components/select.d.ts +14 -6
- package/lib/components/select.js +61 -19
- package/lib/components/step.d.ts.map +1 -0
- package/lib/components/step.js.map +1 -0
- package/lib/components/switch.js +3 -3
- package/lib/components/tab.d.ts +49 -1
- package/lib/components/tab.d.ts.map +1 -0
- package/lib/components/tab.js +151 -10
- package/lib/components/tab.js.map +1 -0
- package/lib/components/tabs.d.ts +14 -2
- package/lib/components/tabs.d.ts.map +1 -0
- package/lib/components/tabs.js +184 -135
- package/lib/components/tabs.js.map +1 -0
- package/lib/components/tag.d.ts +4 -7
- package/lib/components/tag.d.ts.map +1 -0
- package/lib/components/tag.js +6 -7
- package/lib/components/tag.js.map +1 -0
- package/lib/components/textarea.d.ts +4 -3
- package/lib/components/textarea.d.ts.map +1 -0
- package/lib/components/textarea.js +16 -15
- package/lib/components/textarea.js.map +1 -0
- package/lib/components/tooltip.d.ts +4 -3
- package/lib/components/tooltip.d.ts.map +1 -0
- package/lib/components/tooltip.js +34 -24
- package/lib/components/tooltip.js.map +1 -0
- package/lib/components/wizard.d.ts +5 -4
- package/lib/components/wizard.d.ts.map +1 -0
- package/lib/components/wizard.js +120 -156
- package/lib/components/wizard.js.map +1 -0
- package/lib/icons/fontawesome/brands.d.ts.map +1 -0
- package/lib/icons/fontawesome/brands.js.map +1 -0
- package/lib/icons/fontawesome/regular.d.ts.map +1 -0
- package/lib/icons/fontawesome/regular.js.map +1 -0
- package/lib/icons/fontawesome/solid.d.ts.map +1 -0
- package/lib/icons/fontawesome/solid.js.map +1 -0
- package/lib/icons/heroicons/micro.d.ts.map +1 -0
- package/lib/icons/heroicons/micro.js.map +1 -0
- package/lib/icons/heroicons/mini.d.ts.map +1 -0
- package/lib/icons/heroicons/mini.js.map +1 -0
- package/lib/icons/heroicons/outline.d.ts.map +1 -0
- package/lib/icons/heroicons/outline.js.map +1 -0
- package/lib/icons/heroicons/solid.d.ts.map +1 -0
- package/lib/icons/heroicons/solid.js.map +1 -0
- package/lib/icons/lucide.d.ts.map +1 -0
- package/lib/icons/lucide.js.map +1 -0
- package/lib/icons/material/filled.d.ts.map +1 -0
- package/lib/icons/material/filled.js.map +1 -0
- package/lib/icons/material/outlined.d.ts.map +1 -0
- package/lib/icons/material/outlined.js.map +1 -0
- package/lib/icons/material/round.d.ts.map +1 -0
- package/lib/icons/material/round.js.map +1 -0
- package/lib/icons/material/sharp.d.ts.map +1 -0
- package/lib/icons/material/sharp.js.map +1 -0
- package/lib/icons/material/two-tone.d.ts.map +1 -0
- package/lib/icons/material/two-tone.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js.map +1 -0
- package/lib/styles/button.d.ts.map +1 -0
- package/lib/styles/button.js +68 -58
- package/lib/styles/button.js.map +1 -0
- package/lib/styles/calendar-month.d.ts +3 -0
- package/lib/styles/calendar-month.d.ts.map +1 -0
- package/lib/styles/calendar-month.js +43 -27
- package/lib/styles/calendar-month.js.map +1 -0
- package/lib/styles/calendar-navigation.d.ts +1 -1
- package/lib/styles/calendar-navigation.d.ts.map +1 -0
- package/lib/styles/calendar-navigation.js +55 -26
- package/lib/styles/calendar-navigation.js.map +1 -0
- package/lib/styles/calendar.d.ts +3 -2
- package/lib/styles/calendar.d.ts.map +1 -0
- package/lib/styles/calendar.js +74 -0
- package/lib/styles/calendar.js.map +1 -0
- package/lib/styles/checkbox.js +22 -10
- package/lib/styles/copy.d.ts.map +1 -0
- package/lib/styles/copy.js +5 -1
- package/lib/styles/copy.js.map +1 -0
- package/lib/styles/date-picker.d.ts.map +1 -0
- package/lib/styles/date-picker.js +52 -22
- package/lib/styles/date-picker.js.map +1 -0
- package/lib/styles/dropdown.d.ts +12 -0
- package/lib/styles/dropdown.d.ts.map +1 -0
- package/lib/styles/dropdown.js +725 -0
- package/lib/styles/dropdown.js.map +1 -0
- package/lib/styles/icon.d.ts.map +1 -0
- package/lib/styles/icon.js.map +1 -0
- package/lib/styles/input.d.ts.map +1 -0
- package/lib/styles/input.js.map +1 -0
- package/lib/styles/modal.d.ts.map +1 -0
- package/lib/styles/modal.js.map +1 -0
- package/lib/styles/multiselect.d.ts +6 -0
- package/lib/styles/multiselect.d.ts.map +1 -0
- package/lib/styles/multiselect.js +568 -0
- package/lib/styles/multiselect.js.map +1 -0
- package/lib/styles/option.d.ts +1 -1
- package/lib/styles/option.d.ts.map +1 -0
- package/lib/styles/option.js +3 -3
- package/lib/styles/option.js.map +1 -0
- package/lib/styles/popup.d.ts +1 -1
- package/lib/styles/popup.d.ts.map +1 -0
- package/lib/styles/popup.js +8 -5
- package/lib/styles/popup.js.map +1 -0
- package/lib/styles/radio.js +8 -2
- package/lib/styles/resize-observer.d.ts.map +1 -0
- package/lib/styles/resize-observer.js.map +1 -0
- package/lib/styles/scroll-container.d.ts +1 -1
- package/lib/styles/scroll-container.d.ts.map +1 -0
- package/lib/styles/scroll-container.js +1 -1
- package/lib/styles/scroll-container.js.map +1 -0
- package/lib/styles/select.d.ts +1 -1
- package/lib/styles/select.js +6 -0
- package/lib/styles/step.d.ts +1 -1
- package/lib/styles/step.d.ts.map +1 -0
- package/lib/styles/step.js +1 -9
- package/lib/styles/step.js.map +1 -0
- package/lib/styles/switch.js +6 -3
- package/lib/styles/tab.d.ts +1 -1
- package/lib/styles/tab.d.ts.map +1 -0
- package/lib/styles/tab.js +67 -3
- package/lib/styles/tab.js.map +1 -0
- package/lib/styles/tabs.d.ts +1 -1
- package/lib/styles/tabs.d.ts.map +1 -0
- package/lib/styles/tabs.js +7 -3
- package/lib/styles/tabs.js.map +1 -0
- package/lib/styles/tag.d.ts.map +1 -0
- package/lib/styles/tag.js +1 -2
- package/lib/styles/tag.js.map +1 -0
- package/lib/styles/textarea.d.ts.map +1 -0
- package/lib/styles/textarea.js.map +1 -0
- package/lib/styles/tooltip.d.ts.map +1 -0
- package/lib/styles/tooltip.js.map +1 -0
- package/lib/styles/wizard.d.ts +9 -5
- package/lib/styles/wizard.d.ts.map +1 -0
- package/lib/styles/wizard.js +211 -99
- package/lib/styles/wizard.js.map +1 -0
- package/lib/types/common.d.ts +2 -2
- package/lib/types/common.d.ts.map +1 -0
- package/lib/types/common.js.map +1 -0
- package/lib/utils/calendar-utils.d.ts.map +1 -0
- package/lib/utils/calendar-utils.js.map +1 -0
- package/lib/utils/icon-registry.d.ts.map +1 -0
- package/lib/utils/icon-registry.js.map +1 -0
- package/lib/utils/locale.d.ts.map +1 -0
- package/lib/utils/locale.js.map +1 -0
- package/lib/utils/number-format.d.ts.map +1 -0
- package/lib/utils/number-format.js.map +1 -0
- package/lib/utils/parse-boolean.d.ts +39 -0
- package/lib/utils/parse-boolean.d.ts.map +1 -0
- package/lib/utils/parse-boolean.js +23 -0
- package/lib/utils/parse-boolean.js.map +1 -0
- package/lib/utils/positioning.d.ts.map +1 -0
- package/lib/utils/positioning.js.map +1 -0
- package/lib/utils/property-capture.d.ts.map +1 -0
- package/lib/utils/property-capture.js.map +1 -0
- package/lib/utils/property-manager.d.ts +1 -1
- package/lib/utils/property-manager.d.ts.map +1 -0
- package/lib/utils/property-manager.js +2 -0
- package/lib/utils/property-manager.js.map +1 -0
- package/lib/utils/resize-observer.d.ts.map +1 -0
- package/lib/utils/resize-observer.js.map +1 -0
- package/lib/utils/scroll-lock.d.ts.map +1 -0
- package/lib/utils/scroll-lock.js.map +1 -0
- package/lib/utils/styles.d.ts.map +1 -0
- package/lib/utils/styles.js.map +1 -0
- package/lib/utils/validity.d.ts +26 -0
- package/lib/utils/validity.js +53 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.d.ts.map +1 -0
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -0
- package/package.json +25 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tab.d.ts","sourceRoot":"","sources":["../../src/components/tab.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AASH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;CACnB;AA0DD;;GAEG;AACH,qBAAa,KAAM,SAAQ,WAAW;IACpC,0BAA0B;IAC1B,MAAM,KAAK,kBAAkB,aAE5B;;IAOD,iBAAiB;IAIjB,oBAAoB;IAIpB,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;CAG3F"}
|
package/lib/components/tab.js
CHANGED
|
@@ -1,44 +1,185 @@
|
|
|
1
1
|
import { ensureStyles } from '../utils/styles.js';
|
|
2
2
|
import { tabStyles } from '../styles/tab.js';
|
|
3
3
|
import { CustomScrollbar, isCustomScrollbarEnabled } from '../utils/custom-scrollbar.js';
|
|
4
|
+
import { getLoaderSvg } from '../utils/loader-registry.js';
|
|
5
|
+
const STATUS_SLOTS = new Set(['loading', 'error']);
|
|
6
|
+
const INERT_ELEMENTS = new Set(['template', 'script', 'style']);
|
|
4
7
|
export class TyTab extends HTMLElement {
|
|
5
8
|
static get observedAttributes() {
|
|
6
|
-
return ['id', 'label', 'disabled'];
|
|
9
|
+
return ['id', 'label', 'disabled', 'lazy'];
|
|
7
10
|
}
|
|
8
11
|
constructor() {
|
|
9
12
|
super();
|
|
10
13
|
this._scrollbar = null;
|
|
14
|
+
this._panelLabel = null;
|
|
15
|
+
this._shown = true;
|
|
16
|
+
this._load = 'idle';
|
|
17
|
+
this._contentObserver = null;
|
|
18
|
+
this._contentChanged = false;
|
|
11
19
|
this.attachShadow({ mode: 'open' });
|
|
12
20
|
}
|
|
13
21
|
connectedCallback() {
|
|
14
22
|
this._render();
|
|
23
|
+
if (!this._scrollbar)
|
|
24
|
+
this._setupScrollbar();
|
|
25
|
+
this._watchContent();
|
|
26
|
+
}
|
|
27
|
+
setPanelLabel(label) {
|
|
28
|
+
this._panelLabel = label;
|
|
29
|
+
this._syncPanel();
|
|
30
|
+
}
|
|
31
|
+
setShown(shown) {
|
|
32
|
+
this._shown = shown;
|
|
33
|
+
this._syncPanel();
|
|
15
34
|
}
|
|
16
35
|
disconnectedCallback() {
|
|
17
36
|
this._destroyScrollbar();
|
|
37
|
+
this._contentChanged = !!this._contentObserver?.takeRecords().length;
|
|
38
|
+
this._contentObserver?.disconnect();
|
|
39
|
+
this._contentObserver = null;
|
|
40
|
+
}
|
|
41
|
+
_requestLoad(index) {
|
|
42
|
+
if (this._contentObserver?.takeRecords().length)
|
|
43
|
+
this._checkContent(false);
|
|
44
|
+
if (this._load === 'empty' || this._load === 'failed')
|
|
45
|
+
this._fireLoad(index);
|
|
46
|
+
}
|
|
47
|
+
loadFailed() {
|
|
48
|
+
if (this._load === 'loading' || this._load === 'empty')
|
|
49
|
+
this._setLoad('failed');
|
|
18
50
|
}
|
|
19
|
-
attributeChangedCallback(
|
|
51
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
20
52
|
this._render();
|
|
53
|
+
if (name === 'lazy') {
|
|
54
|
+
if (this.isConnected)
|
|
55
|
+
this._watchContent();
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const tabs = this.parentElement;
|
|
59
|
+
if (oldValue !== newValue && this.isConnected && tabs?.localName === 'ty-tabs') {
|
|
60
|
+
tabs._queueUpdate?.(true);
|
|
61
|
+
}
|
|
21
62
|
}
|
|
22
63
|
_render() {
|
|
23
64
|
const shadowRoot = this.shadowRoot;
|
|
24
65
|
if (!shadowRoot)
|
|
25
66
|
return;
|
|
26
|
-
const id = this.getAttribute('id');
|
|
27
67
|
if (!shadowRoot.querySelector('.tab-wrapper')) {
|
|
28
68
|
ensureStyles(shadowRoot, { css: tabStyles, id: 'ty-tab' });
|
|
29
69
|
shadowRoot.innerHTML = `
|
|
30
|
-
<div class="tab-wrapper"
|
|
31
|
-
role="tabpanel"
|
|
32
|
-
${id ? `id="panel-${id}"` : ''}
|
|
33
|
-
${id ? `aria-labelledby="tab-${id}"` : ''}
|
|
34
|
-
>
|
|
35
|
-
<div class="tab-panel">
|
|
70
|
+
<div class="tab-wrapper">
|
|
71
|
+
<div class="tab-panel" role="tabpanel" tabindex="0">
|
|
36
72
|
<slot></slot>
|
|
37
73
|
</div>
|
|
38
74
|
</div>
|
|
39
75
|
`;
|
|
40
|
-
this._setupScrollbar();
|
|
41
76
|
}
|
|
77
|
+
this._syncPanel();
|
|
78
|
+
}
|
|
79
|
+
_watchContent() {
|
|
80
|
+
const lazy = this.hasAttribute('lazy');
|
|
81
|
+
if (lazy && !this._contentObserver) {
|
|
82
|
+
this._contentObserver = new MutationObserver(() => this._checkContent(true));
|
|
83
|
+
this._contentObserver.observe(this, { childList: true, characterData: true, subtree: true });
|
|
84
|
+
}
|
|
85
|
+
else if (!lazy && this._contentObserver) {
|
|
86
|
+
this._contentObserver.disconnect();
|
|
87
|
+
this._contentObserver = null;
|
|
88
|
+
}
|
|
89
|
+
const changed = this._contentChanged;
|
|
90
|
+
this._contentChanged = false;
|
|
91
|
+
this._checkContent(changed);
|
|
92
|
+
}
|
|
93
|
+
_hasContent() {
|
|
94
|
+
for (const node of Array.from(this.childNodes)) {
|
|
95
|
+
if (node.nodeType === Node.TEXT_NODE && node.textContent.trim())
|
|
96
|
+
return true;
|
|
97
|
+
if (node.nodeType !== Node.ELEMENT_NODE)
|
|
98
|
+
continue;
|
|
99
|
+
const el = node;
|
|
100
|
+
if (!STATUS_SLOTS.has(el.getAttribute('slot') ?? '') && !INERT_ELEMENTS.has(el.localName))
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
_checkContent(mutated) {
|
|
106
|
+
if (!this.hasAttribute('lazy') || this._hasContent()) {
|
|
107
|
+
this._setLoad('idle');
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (this._load !== 'idle')
|
|
111
|
+
return;
|
|
112
|
+
this._setLoad('empty');
|
|
113
|
+
if (!mutated)
|
|
114
|
+
return;
|
|
115
|
+
queueMicrotask(() => {
|
|
116
|
+
if (this._load === 'empty' && this._shown && this.parentElement?.localName === 'ty-tabs')
|
|
117
|
+
this._fireLoad();
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
_fireLoad(index) {
|
|
121
|
+
const tabs = this.parentElement;
|
|
122
|
+
if (index === undefined) {
|
|
123
|
+
index = tabs?.localName === 'ty-tabs'
|
|
124
|
+
? Array.from(tabs.querySelectorAll(':scope > ty-tab')).indexOf(this)
|
|
125
|
+
: 0;
|
|
126
|
+
}
|
|
127
|
+
this._setLoad('loading');
|
|
128
|
+
this.dispatchEvent(new CustomEvent('ty-tab-load', { detail: { id: this.id, index } }));
|
|
129
|
+
}
|
|
130
|
+
_ensureStatus(panel) {
|
|
131
|
+
if (panel.querySelector('.tab-loading'))
|
|
132
|
+
return;
|
|
133
|
+
panel.insertAdjacentHTML('beforeend', `
|
|
134
|
+
<div class="tab-loading" part="loading">
|
|
135
|
+
<slot name="loading"><span class="tab-spinner" part="spinner" aria-hidden="true"></span></slot>
|
|
136
|
+
</div>
|
|
137
|
+
<div class="tab-error" part="error" role="alert">
|
|
138
|
+
<slot name="error">Couldn't load.</slot>
|
|
139
|
+
<button type="button" class="tab-retry" part="retry">Retry</button>
|
|
140
|
+
</div>
|
|
141
|
+
`);
|
|
142
|
+
panel.querySelector('.tab-retry').addEventListener('click', () => {
|
|
143
|
+
panel.focus({ preventScroll: true });
|
|
144
|
+
this._fireLoad();
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
_setLoad(state) {
|
|
148
|
+
if (state === this._load)
|
|
149
|
+
return;
|
|
150
|
+
this._load = state;
|
|
151
|
+
const panel = this.shadowRoot?.querySelector('.tab-panel');
|
|
152
|
+
if (!panel)
|
|
153
|
+
return;
|
|
154
|
+
if (state === 'loading' || state === 'failed') {
|
|
155
|
+
this._ensureStatus(panel);
|
|
156
|
+
panel.dataset.load = state;
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
delete panel.dataset.load;
|
|
160
|
+
}
|
|
161
|
+
if (state === 'loading') {
|
|
162
|
+
panel.setAttribute('aria-busy', 'true');
|
|
163
|
+
panel.querySelector('.tab-spinner').innerHTML = getLoaderSvg();
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
panel.removeAttribute('aria-busy');
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
_syncPanel() {
|
|
170
|
+
const panel = this.shadowRoot?.querySelector('.tab-panel');
|
|
171
|
+
if (!panel)
|
|
172
|
+
return;
|
|
173
|
+
const tabs = this.parentElement;
|
|
174
|
+
const rich = !this._panelLabel && this.id && tabs?.localName === 'ty-tabs'
|
|
175
|
+
? tabs.querySelector(`:scope > [slot="label-${CSS.escape(this.id)}"]`)
|
|
176
|
+
: null;
|
|
177
|
+
const label = this._panelLabel || rich?.textContent?.trim() || this.getAttribute('label');
|
|
178
|
+
if (label)
|
|
179
|
+
panel.setAttribute('aria-label', label);
|
|
180
|
+
else
|
|
181
|
+
panel.removeAttribute('aria-label');
|
|
182
|
+
panel.parentElement.inert = !this._shown;
|
|
42
183
|
}
|
|
43
184
|
_setupScrollbar() {
|
|
44
185
|
const panel = this.shadowRoot?.querySelector('.tab-panel');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tab.js","sourceRoot":"","sources":["../../src/components/tab.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAe7C,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E;;GAEG;AACH,SAAS,gBAAgB,CAAC,EAAS;IACjC,OAAO;QACL,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC;QACzB,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC;QAC/B,QAAQ,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC;KACtC,CAAC;AACJ,CAAC;AAED,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E;;;GAGG;AACH,SAAS,MAAM,CAAC,EAAS;IACvB,MAAM,UAAU,GAAG,EAAE,CAAC,UAAU,CAAC;IACjC,IAAI,CAAC,UAAU;QAAE,OAAO;IAExB,MAAM,EAAE,EAAE,EAAE,GAAG,gBAAgB,CAAC,EAAE,CAAC,CAAC;IAEpC,2BAA2B;IAC3B,YAAY,CAAC,UAAU,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IAE3D,mEAAmE;IACnE,0EAA0E;IAC1E,UAAU,CAAC,SAAS,GAAG;;;WAGd,EAAE,CAAC,CAAC,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE;WAC5B,EAAE,CAAC,CAAC,CAAC,wBAAwB,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE;;;;GAI/C,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,OAAO,CAAC,GAAU;IACzB,6BAA6B;AAC/B,CAAC;AAED,+EAA+E;AAC/E,uBAAuB;AACvB,+EAA+E;AAE/E;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC,0BAA0B;IAC1B,MAAM,KAAK,kBAAkB;QAC3B,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IACrC,CAAC;IAED;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACtC,CAAC;IAED,iBAAiB;QACf,MAAM,CAAC,IAAI,CAAC,CAAC;IACf,CAAC;IAED,oBAAoB;QAClB,OAAO,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAED,wBAAwB,CAAC,KAAa,EAAE,SAAwB,EAAE,SAAwB;QACxF,MAAM,CAAC,IAAI,CAAC,CAAC;IACf,CAAC;CACF;AAED,8BAA8B;AAC9B,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;IAClC,cAAc,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AACzC,CAAC"}
|
package/lib/components/tabs.d.ts
CHANGED
|
@@ -14,7 +14,8 @@ export interface TabsAttributes {
|
|
|
14
14
|
fixed: boolean;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
* Tab change event detail
|
|
17
|
+
* Tab change event detail. Fired whenever the shown tab changes after the
|
|
18
|
+
* first one is shown — never for the initial tab.
|
|
18
19
|
*/
|
|
19
20
|
export interface TabChangeDetail {
|
|
20
21
|
activeId: string;
|
|
@@ -29,8 +30,19 @@ export declare class TyTabs extends HTMLElement {
|
|
|
29
30
|
static get observedAttributes(): string[];
|
|
30
31
|
constructor();
|
|
31
32
|
private _childObserver;
|
|
32
|
-
private
|
|
33
|
+
private _updateQueued;
|
|
34
|
+
private _structureDirty;
|
|
35
|
+
/** ID of the tab currently shown (`active` may be stale or missing after a morph). */
|
|
36
|
+
get activeTab(): string | null;
|
|
33
37
|
connectedCallback(): void;
|
|
34
38
|
disconnectedCallback(): void;
|
|
39
|
+
/**
|
|
40
|
+
* External changes (`active` set by app or server, children added or
|
|
41
|
+
* removed, a ty-tab's id/label/disabled changed — ty-tab reports those)
|
|
42
|
+
* settle in one microtask: a morph sets attributes and swaps children in
|
|
43
|
+
* one go, and the shown tab must be decided once the whole batch has
|
|
44
|
+
* landed — `active` may name a tab that is appended after it.
|
|
45
|
+
*/
|
|
46
|
+
_queueUpdate(structure: boolean): void;
|
|
35
47
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
36
48
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/components/tabs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AASH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,KAAK,GAAG,QAAQ,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AA8pBD;;GAEG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC,0BAA0B;IAC1B,MAAM,KAAK,kBAAkB,aAE5B;;IAOD,iBAAiB;IAIjB,oBAAoB;IAIpB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;CAcxF"}
|