tyrell-components 1.0.0-RC14 → 1.0.0-RC15

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 (113) hide show
  1. package/README.md +9 -1
  2. package/css/tyrell-theme.css +25 -2
  3. package/css/tyrell.css +4 -0
  4. package/dist/tyrell-colors-static.css +1 -316
  5. package/dist/tyrell-theme.css +1 -1443
  6. package/dist/tyrell.css +1 -1390
  7. package/dist/tyrell.js +1 -1
  8. package/lib/base/ty-component.js +196 -196
  9. package/lib/components/button.d.ts +1 -1
  10. package/lib/components/button.js +261 -259
  11. package/lib/components/calendar-month.d.ts +2 -2
  12. package/lib/components/calendar-month.js +439 -416
  13. package/lib/components/calendar-navigation.js +238 -238
  14. package/lib/components/calendar.d.ts +5 -3
  15. package/lib/components/calendar.js +611 -602
  16. package/lib/components/checkbox.d.ts +1 -1
  17. package/lib/components/checkbox.js +273 -272
  18. package/lib/components/copy.d.ts +1 -1
  19. package/lib/components/copy.js +280 -278
  20. package/lib/components/date-picker.d.ts +8 -1
  21. package/lib/components/date-picker.js +1128 -1108
  22. package/lib/components/file-upload.js +404 -404
  23. package/lib/components/icon.js +141 -141
  24. package/lib/components/input.d.ts +1 -1
  25. package/lib/components/input.js +593 -596
  26. package/lib/components/modal.js +319 -319
  27. package/lib/components/option.js +167 -167
  28. package/lib/components/popup.js +233 -233
  29. package/lib/components/radio.d.ts +2 -2
  30. package/lib/components/radio.js +407 -406
  31. package/lib/components/resize-observer.js +67 -67
  32. package/lib/components/scroll-container.js +292 -294
  33. package/lib/components/select.d.ts +71 -12
  34. package/lib/components/select.js +1605 -1529
  35. package/lib/components/selected-tags.d.ts +1 -1
  36. package/lib/components/selected-tags.js +188 -182
  37. package/lib/components/step.js +62 -62
  38. package/lib/components/switch.d.ts +1 -1
  39. package/lib/components/switch.js +214 -213
  40. package/lib/components/tab.js +62 -62
  41. package/lib/components/tabs.d.ts +1 -0
  42. package/lib/components/tabs.js +523 -492
  43. package/lib/components/tag.d.ts +1 -1
  44. package/lib/components/tag.js +236 -235
  45. package/lib/components/textarea.d.ts +1 -1
  46. package/lib/components/textarea.js +457 -456
  47. package/lib/components/tooltip.js +283 -283
  48. package/lib/components/wizard.js +384 -384
  49. package/lib/icons/heroicons/micro.js +392 -392
  50. package/lib/icons/heroicons/mini.js +382 -382
  51. package/lib/icons/heroicons/outline.js +337 -337
  52. package/lib/icons/heroicons/solid.js +407 -407
  53. package/lib/icons/lucide.js +22843 -22843
  54. package/lib/icons/material/filled.js +9653 -9653
  55. package/lib/icons/material/outlined.js +10271 -10271
  56. package/lib/icons/material/round.js +10495 -10495
  57. package/lib/icons/material/sharp.js +9905 -9905
  58. package/lib/icons/material/two-tone.js +12792 -12792
  59. package/lib/index.js +21 -21
  60. package/lib/styles/button.js +200 -302
  61. package/lib/styles/calendar-month.js +123 -183
  62. package/lib/styles/calendar-navigation.d.ts +1 -1
  63. package/lib/styles/calendar-navigation.js +64 -79
  64. package/lib/styles/calendar.d.ts +1 -1
  65. package/lib/styles/calendar.js +9 -9
  66. package/lib/styles/checkbox.js +45 -72
  67. package/lib/styles/copy.js +67 -91
  68. package/lib/styles/custom-scrollbar.js +80 -100
  69. package/lib/styles/date-picker.js +261 -331
  70. package/lib/styles/field-size.d.ts +6 -0
  71. package/lib/styles/field-size.js +91 -0
  72. package/lib/styles/file-upload.js +139 -169
  73. package/lib/styles/icon.js +92 -156
  74. package/lib/styles/input.js +125 -241
  75. package/lib/styles/modal.js +67 -102
  76. package/lib/styles/option.d.ts +1 -1
  77. package/lib/styles/option.js +47 -67
  78. package/lib/styles/popup.js +34 -65
  79. package/lib/styles/radio.js +69 -96
  80. package/lib/styles/resize-observer.js +2 -5
  81. package/lib/styles/scroll-container.js +100 -130
  82. package/lib/styles/select-base.js +596 -773
  83. package/lib/styles/select.js +140 -228
  84. package/lib/styles/step.js +22 -29
  85. package/lib/styles/switch.js +34 -55
  86. package/lib/styles/tab.d.ts +1 -1
  87. package/lib/styles/tab.js +22 -29
  88. package/lib/styles/tabs.d.ts +1 -1
  89. package/lib/styles/tabs.js +186 -180
  90. package/lib/styles/tag.js +135 -188
  91. package/lib/styles/textarea.d.ts +1 -1
  92. package/lib/styles/textarea.js +205 -271
  93. package/lib/styles/tooltip.js +3 -3
  94. package/lib/styles/wizard.js +170 -226
  95. package/lib/types/common.d.ts +2 -0
  96. package/lib/types/common.js +6 -5
  97. package/lib/utils/calendar-utils.js +100 -100
  98. package/lib/utils/custom-scrollbar.js +272 -272
  99. package/lib/utils/flavor-sheet.js +14 -14
  100. package/lib/utils/icon-registry.js +127 -127
  101. package/lib/utils/loader-registry.js +3 -3
  102. package/lib/utils/locale.js +34 -34
  103. package/lib/utils/mobile.js +1 -1
  104. package/lib/utils/number-format.js +54 -54
  105. package/lib/utils/positioning.js +212 -212
  106. package/lib/utils/property-capture.js +36 -36
  107. package/lib/utils/property-manager.js +125 -125
  108. package/lib/utils/resize-observer.js +23 -23
  109. package/lib/utils/scroll-lock.js +57 -57
  110. package/lib/utils/styles.js +17 -17
  111. package/lib/version.d.ts +1 -1
  112. package/lib/version.js +1 -1
  113. package/package.json +4 -4
@@ -11,7 +11,7 @@ export declare class TySelectedOptions extends HTMLElement {
11
11
  private _childObserver;
12
12
  private _pickerObserver;
13
13
  private _lastTemplate;
14
- private _restoreDisplay;
14
+ private _pickerOpen;
15
15
  private _onPickerOpen;
16
16
  private _onPickerClose;
17
17
  connectedCallback(): void;
@@ -1,192 +1,198 @@
1
1
  function parseValues(raw) {
2
- return raw.split(',').map(s => s.trim()).filter(Boolean);
2
+ return raw.split(',').map(s => s.trim()).filter(Boolean);
3
3
  }
4
4
  function interpolate(text, ctx) {
5
- return text.replace(/\{([\w-]+)\}/g, (match, key) => ctx[key] ?? match);
5
+ return text.replace(/\{([\w-]+)\}/g, (match, key) => ctx[key] ?? match);
6
6
  }
7
7
  export class TySelectedOptions extends HTMLElement {
8
- constructor() {
9
- super(...arguments);
10
- this._picker = null;
11
- this._onChange = () => this.renderChips();
12
- this._childObserver = null;
13
- this._pickerObserver = null;
14
- this._lastTemplate = null;
15
- this._restoreDisplay = 'contents';
16
- this._onPickerOpen = () => {
17
- this._restoreDisplay = this.style.display || 'contents';
18
- this.style.display = 'none';
19
- };
20
- this._onPickerClose = () => {
21
- this.style.display = this._restoreDisplay;
22
- };
23
- }
24
- static get observedAttributes() {
25
- return ['for'];
26
- }
27
- connectedCallback() {
28
- if (!this.style.display)
29
- this.style.display = 'contents';
30
- this.bind();
31
- this.renderChips();
32
- this._childObserver = new MutationObserver(() => {
33
- const template = this.template();
34
- if (template !== this._lastTemplate) {
35
- this.renderChips();
36
- }
37
- });
38
- this._childObserver.observe(this, { childList: true });
39
- }
40
- disconnectedCallback() {
41
- this.unbind();
42
- this._childObserver?.disconnect();
43
- this._childObserver = null;
44
- }
45
- attributeChangedCallback() {
46
- if (!this.isConnected)
47
- return;
48
- this.bind();
49
- this.renderChips();
50
- }
51
- resolvePicker() {
52
- const id = this.getAttribute('for');
53
- const el = id
54
- ? document.getElementById(id)
55
- : this.previousElementSibling;
56
- return el ?? null;
57
- }
58
- bind() {
59
- const next = this.resolvePicker();
60
- if (next === this._picker)
61
- return;
62
- this.unbind();
63
- this._picker = next;
64
- this._picker?.addEventListener('change', this._onChange);
65
- this._picker?.addEventListener('open', this._onPickerOpen);
66
- this._picker?.addEventListener('close', this._onPickerClose);
67
- if (this._picker) {
68
- this._pickerObserver = new MutationObserver(() => this.renderChips());
69
- this._pickerObserver.observe(this._picker, {
70
- childList: true,
71
- subtree: true,
72
- attributes: true,
73
- attributeFilter: ['selected'],
74
- });
75
- }
76
- }
77
- unbind() {
78
- this._picker?.removeEventListener('change', this._onChange);
79
- this._picker?.removeEventListener('open', this._onPickerOpen);
80
- this._picker?.removeEventListener('close', this._onPickerClose);
81
- this._pickerObserver?.disconnect();
82
- this._pickerObserver = null;
83
- this._picker = null;
84
- this.style.display = this._restoreDisplay;
85
- }
86
- values() {
87
- return parseValues(this._picker?.value ?? '');
88
- }
89
- template() {
90
- return this.querySelector(':scope > template');
91
- }
92
- context(value) {
93
- const opt = this._picker?.querySelector(`[value="${CSS.escape(value)}"]`);
94
- const ctx = {
95
- value,
96
- label: opt?.getAttribute('label') || opt?.textContent?.trim() || value,
97
- flavor: opt?.getAttribute('flavor') ?? '',
98
- };
99
- if (opt) {
100
- for (const attr of Array.from(opt.attributes)) {
101
- if (attr.name.startsWith('data-'))
102
- ctx[attr.name] = attr.value;
103
- }
104
- }
105
- return ctx;
106
- }
107
- templateSource(template) {
108
- if (template.content.hasChildNodes())
109
- return template.content;
110
- const frag = document.createDocumentFragment();
111
- template.childNodes.forEach(n => frag.appendChild(n.cloneNode(true)));
112
- return frag;
113
- }
114
- stampTemplate(template, value) {
115
- const ctx = this.context(value);
116
- const clone = this.templateSource(template).cloneNode(true);
117
- const walker = document.createTreeWalker(clone, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT);
118
- for (let node = walker.nextNode(); node; node = walker.nextNode()) {
119
- if (node.nodeType === Node.TEXT_NODE) {
120
- if (node.textContent?.includes('{')) {
121
- node.textContent = interpolate(node.textContent, ctx);
122
- }
123
- }
124
- else {
125
- const el = node;
126
- for (const attr of Array.from(el.attributes)) {
127
- if (!attr.value.includes('{'))
128
- continue;
129
- const resolved = interpolate(attr.value, ctx);
130
- if (/^\{[\w-]+\}$/.test(attr.value) && (resolved === '' || resolved === attr.value)) {
131
- el.removeAttribute(attr.name);
132
- }
133
- else {
134
- el.setAttribute(attr.name, resolved);
135
- }
136
- }
137
- }
138
- }
139
- for (const el of Array.from(clone.children)) {
140
- el.addEventListener('dismiss', (e) => {
141
- e.stopPropagation();
142
- this.deselect(value);
143
- });
144
- }
145
- return clone;
146
- }
147
- defaultChip(value) {
148
- const ctx = this.context(value);
149
- const tag = document.createElement('ty-tag');
150
- tag.setAttribute('value', value);
151
- tag.setAttribute('dismissible', 'true');
152
- if (ctx.flavor)
153
- tag.setAttribute('flavor', ctx.flavor);
154
- tag.textContent = ctx.label;
155
- tag.addEventListener('dismiss', () => this.deselect(value));
156
- return tag;
157
- }
158
- renderChips() {
159
- const template = this.template();
160
- this._lastTemplate = template;
161
- if (!this._picker) {
162
- this.replaceChildren(...(template ? [template] : []));
163
- return;
164
- }
165
- const frag = document.createDocumentFragment();
166
- if (template)
167
- frag.appendChild(template);
168
- for (const value of this.values()) {
169
- frag.appendChild(template ? this.stampTemplate(template, value) : this.defaultChip(value));
170
- }
171
- this.replaceChildren(frag);
172
- }
173
- deselect(value) {
174
- if (!this._picker)
175
- return;
176
- const picker = this._picker;
177
- if (typeof picker.deselectValue === 'function') {
178
- picker.deselectValue(value);
179
- }
180
- else {
181
- picker.value = this.values().filter(v => v !== value).join(',');
182
- this.renderChips();
183
- }
184
- }
8
+ constructor() {
9
+ super(...arguments);
10
+ this._picker = null;
11
+ this._onChange = () => this.renderChips();
12
+ this._childObserver = null;
13
+ this._pickerObserver = null;
14
+ this._lastTemplate = null;
15
+ this._pickerOpen = false;
16
+ this._onPickerOpen = () => {
17
+ this._pickerOpen = true;
18
+ };
19
+ this._onPickerClose = () => {
20
+ this._pickerOpen = false;
21
+ this.renderChips();
22
+ };
23
+ }
24
+ static get observedAttributes() {
25
+ return ['for'];
26
+ }
27
+ connectedCallback() {
28
+ if (!this.style.display)
29
+ this.style.display = 'contents';
30
+ this.bind();
31
+ this.renderChips();
32
+ if (document.readyState === 'loading') {
33
+ document.addEventListener('DOMContentLoaded', () => { if (this.isConnected)
34
+ this.renderChips(); }, { once: true });
35
+ }
36
+ this._childObserver = new MutationObserver(() => {
37
+ const template = this.template();
38
+ if (template !== this._lastTemplate) {
39
+ this.renderChips();
40
+ }
41
+ });
42
+ this._childObserver.observe(this, { childList: true });
43
+ }
44
+ disconnectedCallback() {
45
+ this.unbind();
46
+ this._childObserver?.disconnect();
47
+ this._childObserver = null;
48
+ }
49
+ attributeChangedCallback() {
50
+ if (!this.isConnected)
51
+ return;
52
+ this.bind();
53
+ this.renderChips();
54
+ }
55
+ resolvePicker() {
56
+ const id = this.getAttribute('for');
57
+ const el = id
58
+ ? document.getElementById(id)
59
+ : this.previousElementSibling;
60
+ return el ?? null;
61
+ }
62
+ bind() {
63
+ const next = this.resolvePicker();
64
+ if (next === this._picker)
65
+ return;
66
+ this.unbind();
67
+ this._picker = next;
68
+ this._picker?.addEventListener('change', this._onChange);
69
+ this._picker?.addEventListener('open', this._onPickerOpen);
70
+ this._picker?.addEventListener('close', this._onPickerClose);
71
+ if (this._picker) {
72
+ this._pickerObserver = new MutationObserver(() => this.renderChips());
73
+ this._pickerObserver.observe(this._picker, {
74
+ childList: true,
75
+ subtree: true,
76
+ attributes: true,
77
+ attributeFilter: ['selected'],
78
+ });
79
+ }
80
+ }
81
+ unbind() {
82
+ this._picker?.removeEventListener('change', this._onChange);
83
+ this._picker?.removeEventListener('open', this._onPickerOpen);
84
+ this._picker?.removeEventListener('close', this._onPickerClose);
85
+ this._pickerObserver?.disconnect();
86
+ this._pickerObserver = null;
87
+ this._picker = null;
88
+ this._pickerOpen = false;
89
+ }
90
+ values() {
91
+ return parseValues(this._picker?.value ?? '');
92
+ }
93
+ template() {
94
+ return this.querySelector(':scope > template');
95
+ }
96
+ context(value) {
97
+ const opt = this._picker?.querySelector(`[value="${CSS.escape(value)}"]`);
98
+ const ctx = {
99
+ value,
100
+ label: opt?.getAttribute('label') || opt?.textContent?.trim() || value,
101
+ flavor: opt?.getAttribute('flavor') ?? '',
102
+ };
103
+ if (opt) {
104
+ for (const attr of Array.from(opt.attributes)) {
105
+ if (attr.name.startsWith('data-'))
106
+ ctx[attr.name] = attr.value;
107
+ }
108
+ }
109
+ return ctx;
110
+ }
111
+ templateSource(template) {
112
+ if (template.content.hasChildNodes())
113
+ return template.content;
114
+ const frag = document.createDocumentFragment();
115
+ template.childNodes.forEach(n => frag.appendChild(n.cloneNode(true)));
116
+ return frag;
117
+ }
118
+ stampTemplate(template, value) {
119
+ const ctx = this.context(value);
120
+ const clone = this.templateSource(template).cloneNode(true);
121
+ const walker = document.createTreeWalker(clone, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT);
122
+ for (let node = walker.nextNode(); node; node = walker.nextNode()) {
123
+ if (node.nodeType === Node.TEXT_NODE) {
124
+ if (node.textContent?.includes('{')) {
125
+ node.textContent = interpolate(node.textContent, ctx);
126
+ }
127
+ }
128
+ else {
129
+ const el = node;
130
+ for (const attr of Array.from(el.attributes)) {
131
+ if (!attr.value.includes('{'))
132
+ continue;
133
+ const resolved = interpolate(attr.value, ctx);
134
+ if (/^\{[\w-]+\}$/.test(attr.value) && (resolved === '' || resolved === attr.value)) {
135
+ el.removeAttribute(attr.name);
136
+ }
137
+ else {
138
+ el.setAttribute(attr.name, resolved);
139
+ }
140
+ }
141
+ }
142
+ }
143
+ for (const el of Array.from(clone.children)) {
144
+ el.addEventListener('dismiss', (e) => {
145
+ e.stopPropagation();
146
+ this.deselect(value);
147
+ });
148
+ }
149
+ return clone;
150
+ }
151
+ defaultChip(value) {
152
+ const ctx = this.context(value);
153
+ const tag = document.createElement('ty-tag');
154
+ tag.setAttribute('value', value);
155
+ tag.setAttribute('dismissible', 'true');
156
+ if (ctx.flavor)
157
+ tag.setAttribute('flavor', ctx.flavor);
158
+ tag.textContent = ctx.label;
159
+ tag.addEventListener('dismiss', () => this.deselect(value));
160
+ return tag;
161
+ }
162
+ renderChips() {
163
+ if (this._pickerOpen)
164
+ return;
165
+ const template = this.template();
166
+ this._lastTemplate = template;
167
+ if (!this._picker) {
168
+ this.replaceChildren(...(template ? [template] : []));
169
+ return;
170
+ }
171
+ const frag = document.createDocumentFragment();
172
+ if (template)
173
+ frag.appendChild(template);
174
+ for (const value of this.values()) {
175
+ frag.appendChild(template ? this.stampTemplate(template, value) : this.defaultChip(value));
176
+ }
177
+ this.replaceChildren(frag);
178
+ }
179
+ deselect(value) {
180
+ if (!this._picker)
181
+ return;
182
+ const picker = this._picker;
183
+ if (typeof picker.deselectValue === 'function') {
184
+ picker.deselectValue(value);
185
+ }
186
+ else {
187
+ picker.value = this.values().filter(v => v !== value).join(',');
188
+ this.renderChips();
189
+ }
190
+ }
185
191
  }
186
192
  if (!customElements.get('ty-selected-options')) {
187
- customElements.define('ty-selected-options', TySelectedOptions);
193
+ customElements.define('ty-selected-options', TySelectedOptions);
188
194
  }
189
195
  if (!customElements.get('ty-selected-tags')) {
190
- customElements.define('ty-selected-tags', class TySelectedTags extends TySelectedOptions {
191
- });
196
+ customElements.define('ty-selected-tags', class TySelectedTags extends TySelectedOptions {
197
+ });
192
198
  }
@@ -2,68 +2,68 @@ import { ensureStyles } from '../utils/styles.js';
2
2
  import { stepStyles } from '../styles/step.js';
3
3
  import { CustomScrollbar, isCustomScrollbarEnabled } from '../utils/custom-scrollbar.js';
4
4
  export class TyStep extends HTMLElement {
5
- static get observedAttributes() {
6
- return ['id', 'label', 'description', 'disabled', 'status'];
7
- }
8
- constructor() {
9
- super();
10
- this._scrollbar = null;
11
- this.attachShadow({ mode: 'open' });
12
- }
13
- connectedCallback() {
14
- this._render();
15
- }
16
- disconnectedCallback() {
17
- this._destroyScrollbar();
18
- }
19
- attributeChangedCallback(_name, _oldValue, _newValue) {
20
- this._render();
21
- }
22
- _render() {
23
- const shadowRoot = this.shadowRoot;
24
- if (!shadowRoot)
25
- return;
26
- const id = this.getAttribute('id');
27
- if (!shadowRoot.querySelector('.step-wrapper')) {
28
- ensureStyles(shadowRoot, { css: stepStyles, id: 'ty-step' });
29
- shadowRoot.innerHTML = `
30
- <div class="step-wrapper"
31
- role="tabpanel"
32
- ${id ? `id="panel-${id}"` : ''}
33
- ${id ? `aria-labelledby="step-${id}"` : ''}
34
- >
35
- <div class="step-panel">
36
- <slot></slot>
37
- </div>
38
- </div>
39
- `;
40
- this._setupScrollbar();
41
- }
42
- }
43
- _setupScrollbar() {
44
- const panel = this.shadowRoot?.querySelector('.step-panel');
45
- const wrapper = this.shadowRoot?.querySelector('.step-wrapper');
46
- if (!panel || !wrapper)
47
- return;
48
- if (!isCustomScrollbarEnabled())
49
- return;
50
- panel.classList.add('ty-custom-scroll');
51
- this._scrollbar = new CustomScrollbar(panel, { vertical: true });
52
- if (this._scrollbar.trackY) {
53
- wrapper.appendChild(this._scrollbar.trackY);
54
- }
55
- }
56
- _destroyScrollbar() {
57
- if (this._scrollbar) {
58
- this._scrollbar.trackY?.remove();
59
- this._scrollbar.destroy();
60
- this._scrollbar = null;
61
- }
62
- }
63
- resetScroll() {
64
- this._scrollbar?.scrollToTop(false);
65
- }
5
+ static get observedAttributes() {
6
+ return ['id', 'label', 'description', 'disabled', 'status'];
7
+ }
8
+ constructor() {
9
+ super();
10
+ this._scrollbar = null;
11
+ this.attachShadow({ mode: 'open' });
12
+ }
13
+ connectedCallback() {
14
+ this._render();
15
+ }
16
+ disconnectedCallback() {
17
+ this._destroyScrollbar();
18
+ }
19
+ attributeChangedCallback(_name, _oldValue, _newValue) {
20
+ this._render();
21
+ }
22
+ _render() {
23
+ const shadowRoot = this.shadowRoot;
24
+ if (!shadowRoot)
25
+ return;
26
+ const id = this.getAttribute('id');
27
+ if (!shadowRoot.querySelector('.step-wrapper')) {
28
+ ensureStyles(shadowRoot, { css: stepStyles, id: 'ty-step' });
29
+ shadowRoot.innerHTML = `
30
+ <div class="step-wrapper"
31
+ role="tabpanel"
32
+ ${id ? `id="panel-${id}"` : ''}
33
+ ${id ? `aria-labelledby="step-${id}"` : ''}
34
+ >
35
+ <div class="step-panel">
36
+ <slot></slot>
37
+ </div>
38
+ </div>
39
+ `;
40
+ this._setupScrollbar();
41
+ }
42
+ }
43
+ _setupScrollbar() {
44
+ const panel = this.shadowRoot?.querySelector('.step-panel');
45
+ const wrapper = this.shadowRoot?.querySelector('.step-wrapper');
46
+ if (!panel || !wrapper)
47
+ return;
48
+ if (!isCustomScrollbarEnabled())
49
+ return;
50
+ panel.classList.add('ty-custom-scroll');
51
+ this._scrollbar = new CustomScrollbar(panel, { vertical: true });
52
+ if (this._scrollbar.trackY) {
53
+ wrapper.appendChild(this._scrollbar.trackY);
54
+ }
55
+ }
56
+ _destroyScrollbar() {
57
+ if (this._scrollbar) {
58
+ this._scrollbar.trackY?.remove();
59
+ this._scrollbar.destroy();
60
+ this._scrollbar = null;
61
+ }
62
+ }
63
+ resetScroll() {
64
+ this._scrollbar?.scrollToTop(false);
65
+ }
66
66
  }
67
67
  if (!customElements.get('ty-step')) {
68
- customElements.define('ty-step', TyStep);
68
+ customElements.define('ty-step', TyStep);
69
69
  }
@@ -53,7 +53,7 @@ export declare class TySwitch extends TyComponent<SwitchState> implements TySwit
53
53
  size: {
54
54
  type: "string";
55
55
  visual: boolean;
56
- default: string;
56
+ default: Size;
57
57
  validate: (v: any) => boolean;
58
58
  coerce: (v: any) => any;
59
59
  };