@scania/tegel 1.21.1 → 1.22.0-feat-dropdown-allow-numbers-testing-beta.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/loader.cjs.js +1 -1
- package/dist/cjs/tds-button.cjs.entry.js +5 -3
- package/dist/cjs/tds-dropdown_2.cjs.entry.js +26 -12
- package/dist/cjs/tds-header-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/tds-icon.cjs.entry.js +1 -1
- package/dist/cjs/tds-popover-canvas.cjs.entry.js +3 -2
- package/dist/cjs/tds-popover-core.cjs.entry.js +44 -6
- package/dist/cjs/tds-popover-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/tds-popover-menu.cjs.entry.js +3 -2
- package/dist/cjs/tds-slider.cjs.entry.js +25 -16
- package/dist/cjs/tds-text-field.cjs.entry.js +12 -6
- package/dist/cjs/tds-toggle.cjs.entry.js +1 -1
- package/dist/cjs/tegel.cjs.js +1 -1
- package/dist/collection/components/banner/banner.js +1 -1
- package/dist/collection/components/button/button.css +3 -0
- package/dist/collection/components/button/button.js +22 -2
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.css +1 -0
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +6 -6
- package/dist/collection/components/dropdown/dropdown.css +19 -3
- package/dist/collection/components/dropdown/dropdown.js +49 -17
- package/dist/collection/components/header/header-dropdown/header-dropdown.css +1 -1
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/icon/iconsArray.js +2 -1
- package/dist/collection/components/popover-canvas/popover-canvas.js +21 -2
- package/dist/collection/components/popover-core/popover-core.js +48 -7
- package/dist/collection/components/popover-core/tds-popover-core.css +6965 -0
- package/dist/collection/components/popover-menu/popover-menu-item/popover-menu-item.css +1 -0
- package/dist/collection/components/popover-menu/popover-menu.js +21 -2
- package/dist/collection/components/slider/slider.css +4 -0
- package/dist/collection/components/slider/slider.js +24 -15
- package/dist/collection/components/text-field/text-field.js +34 -7
- package/dist/collection/components/toggle/toggle.css +1 -1
- package/dist/collection/utils/classList.js +22 -0
- package/dist/collection/utils/testConfiguration.js +65 -0
- package/dist/components/{p-d39c122f.js → p-4449e91e.js} +26 -11
- package/dist/components/{p-00352218.js → p-6d69bf43.js} +4 -4
- package/dist/components/{p-8a5ff20b.js → p-a32f9097.js} +1 -1
- package/dist/components/{p-88cff290.js → p-ad93662a.js} +1 -1
- package/dist/components/{p-cc6e8a0d.js → p-dcfecf4d.js} +5 -3
- package/dist/components/p-e02b091c.js +2052 -0
- package/dist/components/tds-accordion-item.js +1 -1
- package/dist/components/tds-banner.js +1 -1
- package/dist/components/tds-button.js +6 -3
- package/dist/components/tds-datetime.js +1 -1
- package/dist/components/tds-dropdown-option.js +1 -1
- package/dist/components/tds-dropdown.js +1 -1
- package/dist/components/tds-folder-tabs.js +1 -1
- package/dist/components/tds-footer-group.js +1 -1
- package/dist/components/tds-header-cell.js +1 -1
- package/dist/components/tds-header-dropdown.js +4 -4
- package/dist/components/tds-header-hamburger.js +1 -1
- package/dist/components/tds-header-launcher-button.js +1 -1
- package/dist/components/tds-header-launcher.js +4 -4
- package/dist/components/tds-icon.js +1 -1
- package/dist/components/tds-inline-tabs.js +1 -1
- package/dist/components/tds-message.js +1 -1
- package/dist/components/tds-modal.js +1 -1
- package/dist/components/tds-navigation-tabs.js +1 -1
- package/dist/components/tds-popover-canvas.js +1 -1
- package/dist/components/tds-popover-core.js +1 -1
- package/dist/components/tds-popover-menu-item.js +1 -1
- package/dist/components/tds-popover-menu.js +5 -3
- package/dist/components/tds-side-menu-close-button.js +1 -1
- package/dist/components/tds-side-menu-dropdown.js +1 -1
- package/dist/components/tds-slider.js +26 -17
- package/dist/components/tds-step.js +1 -1
- package/dist/components/tds-table-body-input-wrapper.js +1 -1
- package/dist/components/tds-table-footer.js +3 -3
- package/dist/components/tds-table-header-input-wrapper.js +1 -1
- package/dist/components/tds-table-toolbar.js +1 -1
- package/dist/components/tds-text-field.js +15 -8
- package/dist/components/tds-textarea.js +1 -1
- package/dist/components/tds-toast.js +1 -1
- package/dist/components/tds-toggle.js +1 -1
- package/dist/components/tds-tooltip.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tds-button.entry.js +5 -3
- package/dist/esm/tds-dropdown_2.entry.js +26 -12
- package/dist/esm/tds-header-dropdown.entry.js +1 -1
- package/dist/esm/tds-icon.entry.js +1 -1
- package/dist/esm/tds-popover-canvas.entry.js +3 -2
- package/dist/esm/tds-popover-core.entry.js +44 -6
- package/dist/esm/tds-popover-menu-item.entry.js +1 -1
- package/dist/esm/tds-popover-menu.entry.js +3 -2
- package/dist/esm/tds-slider.entry.js +25 -16
- package/dist/esm/tds-text-field.entry.js +12 -6
- package/dist/esm/tds-toggle.entry.js +1 -1
- package/dist/esm/tegel.js +1 -1
- package/dist/tegel/p-062adc6d.entry.js +1 -0
- package/dist/tegel/{p-cee33647.entry.js → p-07825c63.entry.js} +1 -1
- package/dist/tegel/p-23ddcd21.entry.js +1 -0
- package/dist/tegel/p-590b5f55.entry.js +1 -0
- package/dist/tegel/{p-588a05aa.entry.js → p-7097a39a.entry.js} +1 -1
- package/dist/tegel/p-7d39487c.entry.js +1 -0
- package/dist/tegel/p-845e1fca.entry.js +1 -0
- package/dist/tegel/p-dd060c11.entry.js +1 -0
- package/dist/tegel/p-e1df12b3.entry.js +1 -0
- package/dist/tegel/p-f45d905c.entry.js +1 -0
- package/dist/tegel/p-f91c6e9d.entry.js +1 -0
- package/dist/tegel/tegel.css +45 -28
- package/dist/tegel/tegel.esm.js +1 -1
- package/dist/types/components/button/button.d.ts +2 -0
- package/dist/types/components/dropdown/dropdown-option/dropdown-option.d.ts +2 -2
- package/dist/types/components/dropdown/dropdown.d.ts +7 -6
- package/dist/types/components/popover-canvas/popover-canvas.d.ts +2 -0
- package/dist/types/components/popover-core/popover-core.d.ts +3 -0
- package/dist/types/components/popover-menu/popover-menu.d.ts +2 -0
- package/dist/types/components/text-field/text-field.d.ts +2 -0
- package/dist/types/components.d.ts +45 -7
- package/dist/types/types/Icons.d.ts +1 -1
- package/dist/types/utils/classList.d.ts +18 -0
- package/dist/types/utils/testConfiguration.d.ts +13 -0
- package/package.json +1 -1
- package/dist/components/p-1e1cf7f4.js +0 -2012
- package/dist/tegel/p-0fe204ed.entry.js +0 -1
- package/dist/tegel/p-19571a64.entry.js +0 -1
- package/dist/tegel/p-66282839.entry.js +0 -1
- package/dist/tegel/p-945439c9.entry.js +0 -1
- package/dist/tegel/p-b21eb276.entry.js +0 -1
- package/dist/tegel/p-b810cf07.entry.js +0 -1
- package/dist/tegel/p-b8f8a973.entry.js +0 -1
- package/dist/tegel/p-bb86ab14.entry.js +0 -1
- package/dist/tegel/p-f04a31b1.entry.js +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Host, h, } from "@stencil/core";
|
|
2
2
|
import { createPopper } from "@popperjs/core";
|
|
3
3
|
import generateUniqueId from "../../utils/generateUniqueId";
|
|
4
|
+
import { generateClassList } from "../../utils/classList";
|
|
4
5
|
export class TdsPopoverCore {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.uuid = generateUniqueId();
|
|
@@ -12,6 +13,7 @@ export class TdsPopoverCore {
|
|
|
12
13
|
this.isShown = isShown;
|
|
13
14
|
}
|
|
14
15
|
if (this.isShown) {
|
|
16
|
+
this.hasShownAtLeastOnce = true;
|
|
15
17
|
this.internalTdsShow.emit();
|
|
16
18
|
}
|
|
17
19
|
else {
|
|
@@ -33,6 +35,7 @@ export class TdsPopoverCore {
|
|
|
33
35
|
this.selector = undefined;
|
|
34
36
|
this.referenceEl = undefined;
|
|
35
37
|
this.defaultShow = false;
|
|
38
|
+
this.animation = 'none';
|
|
36
39
|
this.show = null;
|
|
37
40
|
this.placement = 'auto';
|
|
38
41
|
this.offsetSkidding = 0;
|
|
@@ -45,6 +48,7 @@ export class TdsPopoverCore {
|
|
|
45
48
|
this.target = undefined;
|
|
46
49
|
this.isShown = false;
|
|
47
50
|
this.disableLogic = false;
|
|
51
|
+
this.hasShownAtLeastOnce = false;
|
|
48
52
|
}
|
|
49
53
|
/** Property for closing popover programmatically */
|
|
50
54
|
async close() {
|
|
@@ -147,11 +151,15 @@ export class TdsPopoverCore {
|
|
|
147
151
|
trigger: this.trigger,
|
|
148
152
|
});
|
|
149
153
|
}
|
|
150
|
-
/* To enable initial loading of a component if user controls show prop*/
|
|
154
|
+
/* To enable initial loading of a component if user controls show prop */
|
|
151
155
|
componentWillLoad() {
|
|
156
|
+
// Ensure initial visibility is handled properly
|
|
152
157
|
if (this.show === true || this.defaultShow === true) {
|
|
153
158
|
this.setIsShown(true);
|
|
154
159
|
}
|
|
160
|
+
else {
|
|
161
|
+
this.setIsShown(false);
|
|
162
|
+
}
|
|
155
163
|
}
|
|
156
164
|
componentDidRender() {
|
|
157
165
|
if (this.isShown && !this.renderedShowValue && !this.disableLogic) {
|
|
@@ -165,14 +173,28 @@ export class TdsPopoverCore {
|
|
|
165
173
|
this.cleanUp();
|
|
166
174
|
}
|
|
167
175
|
render() {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
176
|
+
const classes = {
|
|
177
|
+
'is-shown': (this.isShown && this.animation === 'none') || this.animation === undefined,
|
|
178
|
+
'is-hidden': (!this.isShown && this.animation === 'none') || this.animation === undefined,
|
|
179
|
+
'initially-hidden': !this.hasShownAtLeastOnce,
|
|
180
|
+
'tds-animation-enter-fade': this.isShown && this.animation === 'fade',
|
|
181
|
+
'tds-animation-exit-fade': !this.isShown && this.animation === 'fade',
|
|
182
|
+
};
|
|
183
|
+
const classList = generateClassList(classes);
|
|
184
|
+
return (h(Host, { key: '8893e2cca1fedd09a8dfff8ceeb12b47cbf07e09', class: classList, id: `tds-popover-core-${this.uuid}` }, h("slot", { key: '7e075900d43b4f6d3009ef37f11059fd646e708e' })));
|
|
173
185
|
}
|
|
174
186
|
static get is() { return "tds-popover-core"; }
|
|
175
187
|
static get encapsulation() { return "scoped"; }
|
|
188
|
+
static get originalStyleUrls() {
|
|
189
|
+
return {
|
|
190
|
+
"$": ["tds-popover-core.scss"]
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
static get styleUrls() {
|
|
194
|
+
return {
|
|
195
|
+
"$": ["tds-popover-core.css"]
|
|
196
|
+
};
|
|
197
|
+
}
|
|
176
198
|
static get properties() {
|
|
177
199
|
return {
|
|
178
200
|
"selector": {
|
|
@@ -230,6 +252,24 @@ export class TdsPopoverCore {
|
|
|
230
252
|
"reflect": false,
|
|
231
253
|
"defaultValue": "false"
|
|
232
254
|
},
|
|
255
|
+
"animation": {
|
|
256
|
+
"type": "string",
|
|
257
|
+
"mutable": false,
|
|
258
|
+
"complexType": {
|
|
259
|
+
"original": "'none' | 'fade' | string",
|
|
260
|
+
"resolved": "string",
|
|
261
|
+
"references": {}
|
|
262
|
+
},
|
|
263
|
+
"required": false,
|
|
264
|
+
"optional": false,
|
|
265
|
+
"docs": {
|
|
266
|
+
"tags": [],
|
|
267
|
+
"text": "Whether the popover should animate when being opened/closed or not"
|
|
268
|
+
},
|
|
269
|
+
"attribute": "animation",
|
|
270
|
+
"reflect": false,
|
|
271
|
+
"defaultValue": "'none'"
|
|
272
|
+
},
|
|
233
273
|
"show": {
|
|
234
274
|
"type": "boolean",
|
|
235
275
|
"mutable": false,
|
|
@@ -373,7 +413,8 @@ export class TdsPopoverCore {
|
|
|
373
413
|
"popperInstance": {},
|
|
374
414
|
"target": {},
|
|
375
415
|
"isShown": {},
|
|
376
|
-
"disableLogic": {}
|
|
416
|
+
"disableLogic": {},
|
|
417
|
+
"hasShownAtLeastOnce": {}
|
|
377
418
|
};
|
|
378
419
|
}
|
|
379
420
|
static get events() {
|