@scania/tegel 1.30.0 → 1.31.1-feat-button-name-attribute-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.
Files changed (109) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/tds-accordion-item.cjs.entry.js +25 -3
  3. package/dist/cjs/tds-button.cjs.entry.js +5 -4
  4. package/dist/cjs/tds-folder-tab.cjs.entry.js +2 -2
  5. package/dist/cjs/tds-folder-tabs.cjs.entry.js +2 -2
  6. package/dist/cjs/tds-inline-tab.cjs.entry.js +2 -2
  7. package/dist/cjs/tds-inline-tabs.cjs.entry.js +2 -2
  8. package/dist/cjs/tds-modal.cjs.entry.js +14 -4
  9. package/dist/cjs/tds-navigation-tab.cjs.entry.js +2 -2
  10. package/dist/cjs/tds-navigation-tabs.cjs.entry.js +4 -4
  11. package/dist/cjs/tds-popover-core.cjs.entry.js +1 -1
  12. package/dist/cjs/tds-table-toolbar.cjs.entry.js +3 -3
  13. package/dist/cjs/tds-text-field.cjs.entry.js +5 -5
  14. package/dist/cjs/tds-textarea.cjs.entry.js +3 -3
  15. package/dist/cjs/tds-toast.cjs.entry.js +3 -3
  16. package/dist/cjs/tds-toggle.cjs.entry.js +2 -2
  17. package/dist/cjs/tds-tooltip.cjs.entry.js +2 -2
  18. package/dist/cjs/tegel.cjs.js +1 -1
  19. package/dist/collection/components/accordion/accordion-item/accordion-item.js +77 -4
  20. package/dist/collection/components/button/button.css +11 -11
  21. package/dist/collection/components/button/button.js +21 -3
  22. package/dist/collection/components/modal/modal.js +45 -4
  23. package/dist/collection/components/popover-core/tds-popover-core.css +843 -12
  24. package/dist/collection/components/table/table-toolbar/table-toolbar.css +6 -1
  25. package/dist/collection/components/table/table-toolbar/table-toolbar.js +3 -2
  26. package/dist/collection/components/tabs/folder-tabs/folder-tab/folder-tab.js +2 -2
  27. package/dist/collection/components/tabs/folder-tabs/folder-tabs.js +2 -2
  28. package/dist/collection/components/tabs/inline-tabs/inline-tab/inline-tab.js +2 -2
  29. package/dist/collection/components/tabs/inline-tabs/inline-tabs.js +2 -2
  30. package/dist/collection/components/tabs/navigation-tabs/navigation-tab/navigation-tab.js +2 -2
  31. package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.js +4 -4
  32. package/dist/collection/components/text-field/text-field.js +5 -5
  33. package/dist/collection/components/textarea/textarea.js +3 -3
  34. package/dist/collection/components/toast/toast.js +3 -3
  35. package/dist/collection/components/toggle/toggle.js +2 -2
  36. package/dist/collection/components/tooltip/tooltip.js +2 -2
  37. package/dist/components/{p-d4fa1832.js → p-516d8085.js} +1 -1
  38. package/dist/components/{p-a2dafd0e.js → p-69109003.js} +3 -3
  39. package/dist/components/p-96e83134.js +2098 -0
  40. package/dist/components/tds-accordion-item.js +30 -5
  41. package/dist/components/tds-button.js +6 -4
  42. package/dist/components/tds-folder-tab.js +2 -2
  43. package/dist/components/tds-folder-tabs.js +2 -2
  44. package/dist/components/tds-header-dropdown.js +2 -2
  45. package/dist/components/tds-header-launcher.js +2 -2
  46. package/dist/components/tds-inline-tab.js +2 -2
  47. package/dist/components/tds-inline-tabs.js +2 -2
  48. package/dist/components/tds-modal.js +15 -4
  49. package/dist/components/tds-navigation-tab.js +2 -2
  50. package/dist/components/tds-navigation-tabs.js +4 -4
  51. package/dist/components/tds-popover-canvas.js +1 -1
  52. package/dist/components/tds-popover-core.js +1 -1
  53. package/dist/components/tds-popover-menu.js +1 -1
  54. package/dist/components/tds-table-toolbar.js +3 -3
  55. package/dist/components/tds-text-field.js +5 -5
  56. package/dist/components/tds-textarea.js +5 -5
  57. package/dist/components/tds-toast.js +3 -3
  58. package/dist/components/tds-toggle.js +2 -2
  59. package/dist/components/tds-tooltip.js +1 -1
  60. package/dist/esm/loader.js +1 -1
  61. package/dist/esm/tds-accordion-item.entry.js +25 -3
  62. package/dist/esm/tds-button.entry.js +5 -4
  63. package/dist/esm/tds-folder-tab.entry.js +2 -2
  64. package/dist/esm/tds-folder-tabs.entry.js +2 -2
  65. package/dist/esm/tds-inline-tab.entry.js +2 -2
  66. package/dist/esm/tds-inline-tabs.entry.js +2 -2
  67. package/dist/esm/tds-modal.entry.js +14 -4
  68. package/dist/esm/tds-navigation-tab.entry.js +2 -2
  69. package/dist/esm/tds-navigation-tabs.entry.js +4 -4
  70. package/dist/esm/tds-popover-core.entry.js +1 -1
  71. package/dist/esm/tds-table-toolbar.entry.js +3 -3
  72. package/dist/esm/tds-text-field.entry.js +5 -5
  73. package/dist/esm/tds-textarea.entry.js +3 -3
  74. package/dist/esm/tds-toast.entry.js +3 -3
  75. package/dist/esm/tds-toggle.entry.js +2 -2
  76. package/dist/esm/tds-tooltip.entry.js +2 -2
  77. package/dist/esm/tegel.js +1 -1
  78. package/dist/tegel/{p-a1262f8f.entry.js → p-106e048d.entry.js} +1 -1
  79. package/dist/tegel/{p-2286d4c3.entry.js → p-10dfd194.entry.js} +1 -1
  80. package/dist/tegel/p-1297d40e.entry.js +1 -0
  81. package/dist/tegel/{p-0ca95c76.entry.js → p-212e1fff.entry.js} +1 -1
  82. package/dist/tegel/p-2b8e97e1.entry.js +1 -0
  83. package/dist/tegel/p-2c36022d.entry.js +1 -0
  84. package/dist/tegel/p-3a92d554.entry.js +1 -0
  85. package/dist/tegel/p-3e4707fb.entry.js +1 -0
  86. package/dist/tegel/p-3f81c19a.entry.js +1 -0
  87. package/dist/tegel/{p-2774f177.entry.js → p-46b66490.entry.js} +1 -1
  88. package/dist/tegel/{p-1116da44.entry.js → p-52adc30c.entry.js} +1 -1
  89. package/dist/tegel/{p-87ba6285.entry.js → p-64be21db.entry.js} +1 -1
  90. package/dist/tegel/{p-d29a777f.entry.js → p-67b4b2cf.entry.js} +1 -1
  91. package/dist/tegel/{p-e7a452a8.entry.js → p-76faaf70.entry.js} +1 -1
  92. package/dist/tegel/{p-9d8bb017.entry.js → p-78823da3.entry.js} +1 -1
  93. package/dist/tegel/p-b58c7bed.entry.js +1 -0
  94. package/dist/tegel/tegel.css +2 -2
  95. package/dist/tegel/tegel.esm.js +1 -1
  96. package/dist/types/components/accordion/accordion-item/accordion-item.d.ts +6 -0
  97. package/dist/types/components/button/button.d.ts +2 -0
  98. package/dist/types/components/modal/modal.d.ts +6 -2
  99. package/dist/types/components/table/table-toolbar/table-toolbar.d.ts +1 -0
  100. package/dist/types/components.d.ts +29 -0
  101. package/package.json +6 -1
  102. package/dist/components/p-2e25c35b.js +0 -2098
  103. package/dist/tegel/p-0955d5fc.entry.js +0 -1
  104. package/dist/tegel/p-26e8f033.entry.js +0 -1
  105. package/dist/tegel/p-5ade1970.entry.js +0 -1
  106. package/dist/tegel/p-b6a4f459.entry.js +0 -1
  107. package/dist/tegel/p-c3d91dfa.entry.js +0 -1
  108. package/dist/tegel/p-d38039b3.entry.js +0 -1
  109. package/dist/tegel/p-d56f426f.entry.js +0 -1
@@ -11,11 +11,16 @@ export class TdsModal {
11
11
  this.handleClose = (event) => {
12
12
  const closeEvent = this.tdsClose.emit(event);
13
13
  this.returnFocusOnClose();
14
- if (!closeEvent.defaultPrevented) {
15
- this.isShown = false;
14
+ if (closeEvent.defaultPrevented) {
15
+ return;
16
16
  }
17
+ this.isShown = false;
17
18
  };
18
19
  this.handleShow = () => {
20
+ const showEvent = this.tdsOpen.emit();
21
+ if (showEvent.defaultPrevented) {
22
+ return;
23
+ }
19
24
  this.isShown = true;
20
25
  };
21
26
  /** Checks if click on Modal is on overlay, if so it closes the Modal if prevent is not true. */
@@ -80,6 +85,10 @@ export class TdsModal {
80
85
  this.isShown = false;
81
86
  this.returnFocusOnClose();
82
87
  }
88
+ /** Returns the current open state of the Modal. */
89
+ async isOpen() {
90
+ return this.isShown;
91
+ }
83
92
  connectedCallback() {
84
93
  if (this.closable === undefined) {
85
94
  this.closable = true;
@@ -196,10 +205,10 @@ export class TdsModal {
196
205
  const usesActionsSlot = hasSlot('actions', this.host);
197
206
  const headerId = this.header ? `tds-modal-header-${generateUniqueId()}` : undefined;
198
207
  const bodyId = `tds-modal-body-${generateUniqueId()}`;
199
- return (h(Host, { key: 'b6fb1dda221f31cf3491d6f00c94c0afc71f202d', role: this.tdsAlertDialog, "aria-modal": "true", "aria-describedby": bodyId, "aria-labelledby": headerId, class: {
208
+ return (h(Host, { key: '2d39760de58fd957585e4370aa88447d85249eca', role: this.tdsAlertDialog, "aria-modal": "true", "aria-describedby": bodyId, "aria-labelledby": headerId, class: {
200
209
  show: this.isShown,
201
210
  hide: !this.isShown,
202
- }, onClick: (event) => this.handleOverlayClick(event) }, h("div", { key: 'c684d1abcbf62e14ab2ea677c99d5da262aa7796', class: "tds-modal-backdrop" }), h("div", { key: '4f6c74bba05c15ff7c5e63759b71e8414b122d01', class: `tds-modal tds-modal__actions-${this.actionsPosition} tds-modal-${this.size}` }, h("div", { key: '2c8d39f0ff25d0e2496039c90793fd76897d8c8f', id: headerId, class: "header" }, this.header && h("div", { key: '35947f6bd06b54a2ea6f8cdbfde9d8374b17f250', class: "header-text" }, this.header), usesHeaderSlot && h("slot", { key: '3149db0af6218f90723e95345da1fd705c3d121e', name: "header" }), this.closable && (h("button", { key: 'e0f1c8afdbb2e4e7bd08933f7becf6b7b042267b', class: "tds-modal-close", "aria-label": "close", onClick: (event) => this.handleClose(event) }, h("tds-icon", { key: 'b650bf57c65e3314ce5e73963393f9b53fe7e191', name: "cross", size: "20px" })))), h("div", { key: '94992a62e1d75d0decf7583e5d97d498a8f0ce16', id: bodyId, class: "body" }, h("slot", { key: '3d7efacca7e0124c8344050e9d34523971e77448', name: "body" })), usesActionsSlot && h("slot", { key: '735a622c7218961ec631585595485e7722907c6b', name: "actions" }))));
211
+ }, onClick: (event) => this.handleOverlayClick(event) }, h("div", { key: '5eeaf5c29529bf77ddde4892067f13d312d1bba7', class: "tds-modal-backdrop" }), h("div", { key: '8a6ccd911dfec947a809320a0631d5f9904ef78d', class: `tds-modal tds-modal__actions-${this.actionsPosition} tds-modal-${this.size}` }, h("div", { key: 'b7c760ebded4e98319cec75c161002a579316902', id: headerId, class: "header" }, this.header && h("div", { key: 'db14e71913052ba5367ab95a41a366c7f2dea4a3', class: "header-text" }, this.header), usesHeaderSlot && h("slot", { key: '62b394718c78e564fd50e7ff3328e637a63679e6', name: "header" }), this.closable && (h("button", { key: '9ff8ad81be4f72ee6a298a9ba39a1024269d3ec2', class: "tds-modal-close", "aria-label": "close", onClick: (event) => this.handleClose(event) }, h("tds-icon", { key: 'b34b8a55c7f5c65ce7a3fdee6114c66ee4ab82c3', name: "cross", size: "20px" })))), h("div", { key: 'ab04e506dd94c69d8f91fb774fa85f355f3629d4', id: bodyId, class: "body" }, h("slot", { key: 'f4a8e2377b4cae3a9c4fa1032e896b0b0c58a06a', name: "body" })), usesActionsSlot && h("slot", { key: '09137d7c8b81f91dbf419b10c8a085de25df1272', name: "actions" }))));
203
212
  }
204
213
  static get is() { return "tds-modal"; }
205
214
  static get encapsulation() { return "shadow"; }
@@ -400,6 +409,21 @@ export class TdsModal {
400
409
  "resolved": "any",
401
410
  "references": {}
402
411
  }
412
+ }, {
413
+ "method": "tdsOpen",
414
+ "name": "tdsOpen",
415
+ "bubbles": true,
416
+ "cancelable": true,
417
+ "composed": true,
418
+ "docs": {
419
+ "tags": [],
420
+ "text": "Emits just before Modal is opened."
421
+ },
422
+ "complexType": {
423
+ "original": "void",
424
+ "resolved": "void",
425
+ "references": {}
426
+ }
403
427
  }];
404
428
  }
405
429
  static get methods() {
@@ -438,6 +462,23 @@ export class TdsModal {
438
462
  "tags": []
439
463
  }
440
464
  },
465
+ "isOpen": {
466
+ "complexType": {
467
+ "signature": "() => Promise<boolean>",
468
+ "parameters": [],
469
+ "references": {
470
+ "Promise": {
471
+ "location": "global",
472
+ "id": "global::Promise"
473
+ }
474
+ },
475
+ "return": "Promise<boolean>"
476
+ },
477
+ "docs": {
478
+ "text": "Returns the current open state of the Modal.",
479
+ "tags": []
480
+ }
481
+ },
441
482
  "initializeModal": {
442
483
  "complexType": {
443
484
  "signature": "() => Promise<void>",