@scania/tegel 0.0.1-beta.1 → 0.0.1-beta.3
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/components/dropdown-option.js +1 -0
- package/dist/components/dropdown.js +1 -0
- package/dist/components/icon.js +1 -0
- package/dist/components/sdds-accordion-item.js +1 -0
- package/dist/components/sdds-accordion.js +1 -0
- package/dist/components/sdds-badges.js +1 -0
- package/dist/components/sdds-button.js +1 -0
- package/dist/components/sdds-datetime.js +1 -0
- package/dist/components/sdds-dropdown-filter.js +1 -0
- package/dist/components/sdds-header-cell.js +1 -0
- package/dist/components/sdds-inline-tabs-fullbleed.js +1 -0
- package/dist/components/sdds-inline-tabs.js +1 -0
- package/dist/components/sdds-modal.js +1 -0
- package/dist/components/sdds-navigation-tabs.js +1 -0
- package/dist/components/sdds-popover-canvas.js +1 -0
- package/dist/components/sdds-popover-menu.js +1 -0
- package/dist/components/sdds-slider.js +1 -0
- package/dist/components/sdds-spinner.js +1 -0
- package/dist/components/sdds-table-body-row-expandable.js +1 -0
- package/dist/components/sdds-table-body.js +1 -0
- package/dist/components/sdds-table-footer.js +1 -0
- package/dist/components/sdds-table-header.js +1 -0
- package/dist/components/sdds-table-toolbar.js +1 -0
- package/dist/components/sdds-table.js +1 -0
- package/dist/components/sdds-textarea.js +1 -0
- package/dist/components/sdds-textfield.js +1 -0
- package/dist/components/sdds-tooltip.js +1 -0
- package/dist/components/table-body-cell.js +1 -0
- package/dist/components/table-body-row.js +1 -0
- package/package.json +3 -3
- package/dist/cjs/index-e1c79686.js +0 -1912
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/loader.cjs.js +0 -21
- package/dist/cjs/popper-11d5f714.js +0 -1801
- package/dist/cjs/sdds-accordion-item.cjs.entry.js +0 -34
- package/dist/cjs/sdds-accordion.cjs.entry.js +0 -21
- package/dist/cjs/sdds-badges.cjs.entry.js +0 -55
- package/dist/cjs/sdds-body-cell_2.cjs.entry.js +0 -173
- package/dist/cjs/sdds-button.cjs.entry.js +0 -36
- package/dist/cjs/sdds-datetime.cjs.entry.js +0 -66
- package/dist/cjs/sdds-dropdown-filter.cjs.entry.js +0 -92
- package/dist/cjs/sdds-dropdown_2.cjs.entry.js +0 -335
- package/dist/cjs/sdds-header-cell.cjs.entry.js +0 -141
- package/dist/cjs/sdds-icon.cjs.entry.js +0 -42
- package/dist/cjs/sdds-inline-tabs-fullbleed.cjs.entry.js +0 -96
- package/dist/cjs/sdds-inline-tabs.cjs.entry.js +0 -211
- package/dist/cjs/sdds-modal.cjs.entry.js +0 -49
- package/dist/cjs/sdds-navigation-tabs.cjs.entry.js +0 -95
- package/dist/cjs/sdds-popover-canvas.cjs.entry.js +0 -76
- package/dist/cjs/sdds-popover-menu.cjs.entry.js +0 -75
- package/dist/cjs/sdds-slider.cjs.entry.js +0 -336
- package/dist/cjs/sdds-spinner.cjs.entry.js +0 -21
- package/dist/cjs/sdds-table-body-row-expandable.cjs.entry.js +0 -81
- package/dist/cjs/sdds-table-body.cjs.entry.js +0 -289
- package/dist/cjs/sdds-table-footer.cjs.entry.js +0 -165
- package/dist/cjs/sdds-table-header.cjs.entry.js +0 -100
- package/dist/cjs/sdds-table-toolbar.cjs.entry.js +0 -66
- package/dist/cjs/sdds-table.cjs.entry.js +0 -69
- package/dist/cjs/sdds-textarea.cjs.entry.js +0 -61
- package/dist/cjs/sdds-textfield.cjs.entry.js +0 -82
- package/dist/cjs/sdds-tooltip.cjs.entry.js +0 -95
- package/dist/cjs/tegel.cjs.js +0 -19
- package/dist/collection/collection-manifest.json +0 -40
- package/dist/collection/components/accordion/accordion-item/accordion-item.css +0 -134
- package/dist/collection/components/accordion/accordion-item/accordion-item.js +0 -146
- package/dist/collection/components/accordion/accordion.css +0 -77
- package/dist/collection/components/accordion/accordion.js +0 -62
- package/dist/collection/components/accordion/accordion.stories.js +0 -91
- package/dist/collection/components/badge/badge.stories.js +0 -101
- package/dist/collection/components/badge/badges.css +0 -42
- package/dist/collection/components/badge/badges.js +0 -150
- package/dist/collection/components/banner/banner.stories.js +0 -93
- package/dist/collection/components/block/block.stories.js +0 -46
- package/dist/collection/components/breadcrumb/breadcrumb.stories.js +0 -26
- package/dist/collection/components/button/button-component.js +0 -154
- package/dist/collection/components/button/button-native.stories.js +0 -183
- package/dist/collection/components/button/button-webcomponent.stories.js +0 -182
- package/dist/collection/components/button/button.css +0 -658
- package/dist/collection/components/card/card.stories.js +0 -181
- package/dist/collection/components/checkbox/checkbox.stories.js +0 -54
- package/dist/collection/components/chips/chips.stories.js +0 -124
- package/dist/collection/components/data-table/native-table.stories.js +0 -182
- package/dist/collection/components/data-table/table/table.css +0 -15
- package/dist/collection/components/data-table/table/table.js +0 -253
- package/dist/collection/components/data-table/table-body/table-body.css +0 -22
- package/dist/collection/components/data-table/table-body/table-body.js +0 -425
- package/dist/collection/components/data-table/table-body-cell/table-body-cell.css +0 -40
- package/dist/collection/components/data-table/table-body-cell/table-body-cell.js +0 -169
- package/dist/collection/components/data-table/table-body-row/table-body-row.css +0 -196
- package/dist/collection/components/data-table/table-body-row/table-body-row.js +0 -164
- package/dist/collection/components/data-table/table-body-row-expandable/table-body-row-expandable.css +0 -79
- package/dist/collection/components/data-table/table-body-row-expandable/table-body-row-expandable.js +0 -155
- package/dist/collection/components/data-table/table-component-basic.stories.js +0 -163
- package/dist/collection/components/data-table/table-component-batch-actions.stories.js +0 -129
- package/dist/collection/components/data-table/table-component-bodydata.stories.js +0 -58
- package/dist/collection/components/data-table/table-component-custom-width.stories.js +0 -198
- package/dist/collection/components/data-table/table-component-event-listeners.stories.js +0 -153
- package/dist/collection/components/data-table/table-component-expandable-rows.stories.js +0 -137
- package/dist/collection/components/data-table/table-component-filtering.stories.js +0 -139
- package/dist/collection/components/data-table/table-component-multiselect.stories.js +0 -160
- package/dist/collection/components/data-table/table-component-pagination.stories.js +0 -129
- package/dist/collection/components/data-table/table-component-sorting.stories.js +0 -107
- package/dist/collection/components/data-table/table-footer/table-footer.css +0 -93
- package/dist/collection/components/data-table/table-footer/table-footer.js +0 -355
- package/dist/collection/components/data-table/table-header/table-header.css +0 -204
- package/dist/collection/components/data-table/table-header/table-header.js +0 -153
- package/dist/collection/components/data-table/table-header-cell/table-header-cell.css +0 -126
- package/dist/collection/components/data-table/table-header-cell/table-header-cell.js +0 -320
- package/dist/collection/components/data-table/table-toolbar/table-toolbar.css +0 -92
- package/dist/collection/components/data-table/table-toolbar/table-toolbar.js +0 -142
- package/dist/collection/components/datetime/datetime.css +0 -375
- package/dist/collection/components/datetime/datetime.js +0 -251
- package/dist/collection/components/datetime/datetime.stories.js +0 -149
- package/dist/collection/components/divider/divider.stories.js +0 -116
- package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.js +0 -339
- package/dist/collection/components/dropdown/dropdown-filter/dropdown-filter.stories.js +0 -130
- package/dist/collection/components/dropdown/dropdown-native.stories.js +0 -90
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +0 -185
- package/dist/collection/components/dropdown/dropdown-wc-default.stories.js +0 -151
- package/dist/collection/components/dropdown/dropdown-wc-multiselect.stories.js +0 -146
- package/dist/collection/components/dropdown/dropdown.css +0 -891
- package/dist/collection/components/dropdown/dropdown.js +0 -554
- package/dist/collection/components/footer/footer.stories.js +0 -100
- package/dist/collection/components/header/header-all.stories.js +0 -217
- package/dist/collection/components/header/header-default.stories.js +0 -47
- package/dist/collection/components/header/header-inline.stories.js +0 -113
- package/dist/collection/components/header/header-search.stories.js +0 -263
- package/dist/collection/components/header/header-toolbar.stories.js +0 -204
- package/dist/collection/components/icon/icon-font.stories.js +0 -57
- package/dist/collection/components/icon/icon-web-component.stories.js +0 -51
- package/dist/collection/components/icon/icon.css +0 -16
- package/dist/collection/components/icon/icon.js +0 -89
- package/dist/collection/components/icon/iconsArray.js +0 -2
- package/dist/collection/components/link/link.stories.js +0 -45
- package/dist/collection/components/message/message.stories.js +0 -117
- package/dist/collection/components/modal/modal-native.stories.js +0 -121
- package/dist/collection/components/modal/modal-webcomponent.stories.js +0 -78
- package/dist/collection/components/modal/modal.css +0 -324
- package/dist/collection/components/modal/modal.js +0 -146
- package/dist/collection/components/popover-canvas/popover-canvas.css +0 -20
- package/dist/collection/components/popover-canvas/popover-canvas.js +0 -190
- package/dist/collection/components/popover-canvas/popover-canvas.stories.js +0 -87
- package/dist/collection/components/popover-menu/popover-menu-icons.stories.js +0 -132
- package/dist/collection/components/popover-menu/popover-menu.css +0 -19
- package/dist/collection/components/popover-menu/popover-menu.js +0 -189
- package/dist/collection/components/popover-menu/popover-menu.stories.js +0 -109
- package/dist/collection/components/radio-button/radio-button.stories.js +0 -68
- package/dist/collection/components/side-menu/side-menu.stories.js +0 -182
- package/dist/collection/components/slider/slider.css +0 -260
- package/dist/collection/components/slider/slider.js +0 -682
- package/dist/collection/components/slider/slider.stories.js +0 -251
- package/dist/collection/components/spinner/spinner.css +0 -79
- package/dist/collection/components/spinner/spinner.js +0 -61
- package/dist/collection/components/spinner/spinner.stories.js +0 -59
- package/dist/collection/components/stepper/stepper.stories.js +0 -139
- package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.css +0 -159
- package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.js +0 -302
- package/dist/collection/components/tabs/inline-tabs-default/inline-tabs.stories.js +0 -65
- package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.css +0 -172
- package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.js +0 -126
- package/dist/collection/components/tabs/inline-tabs-fullbleed/inline-tabs-fullbleed.stories.js +0 -43
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.css +0 -153
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.js +0 -103
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.stories.js +0 -32
- package/dist/collection/components/textarea/textarea.css +0 -283
- package/dist/collection/components/textarea/textarea.js +0 -336
- package/dist/collection/components/textarea/textarea.stories.js +0 -149
- package/dist/collection/components/textfield/textfield.css +0 -494
- package/dist/collection/components/textfield/textfield.js +0 -359
- package/dist/collection/components/textfield/textfield.stories.js +0 -222
- package/dist/collection/components/toast/toast.stories.js +0 -119
- package/dist/collection/components/toggle/toggle.stories.js +0 -62
- package/dist/collection/components/tooltip/tooltip.css +0 -46
- package/dist/collection/components/tooltip/tooltip.js +0 -200
- package/dist/collection/components/tooltip/tooltip.stories.js +0 -113
- package/dist/collection/components/utility/colour/background-color.stories.js +0 -96
- package/dist/collection/components/utility/colour/text-color.stories.js +0 -94
- package/dist/collection/foundations-stories/colour/colour-brand.stories.js +0 -38
- package/dist/collection/foundations-stories/colour/colour-scales.stories.js +0 -71
- package/dist/collection/foundations-stories/colour/colour-semantic.stories.js +0 -40
- package/dist/collection/foundations-stories/grid/grid.stories.js +0 -386
- package/dist/collection/foundations-stories/spacing/spacing-element.stories.js +0 -100
- package/dist/collection/foundations-stories/spacing/spacing-layout.stories.js +0 -94
- package/dist/collection/foundations-stories/typography/typography-body.stories.js +0 -16
- package/dist/collection/foundations-stories/typography/typography-detail.stories.js +0 -17
- package/dist/collection/foundations-stories/typography/typography-headline.stories.js +0 -39
- package/dist/collection/foundations-stories/typography/typography-paragraph.stories.js +0 -12
- package/dist/collection/index.js +0 -1
- package/dist/collection/stories/assets/code-brackets.svg +0 -1
- package/dist/collection/stories/assets/colors.svg +0 -1
- package/dist/collection/stories/assets/comments.svg +0 -1
- package/dist/collection/stories/assets/direction.svg +0 -1
- package/dist/collection/stories/assets/flow.svg +0 -1
- package/dist/collection/stories/assets/plugin.svg +0 -1
- package/dist/collection/stories/assets/repo.svg +0 -1
- package/dist/collection/stories/assets/stackalt.svg +0 -1
- package/dist/collection/utils/utils.js +0 -12
- package/dist/esm/index-b67b15a6.js +0 -1884
- package/dist/esm/index.js +0 -1
- package/dist/esm/loader.js +0 -17
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/popper-f860750c.js +0 -1799
- package/dist/esm/sdds-accordion-item.entry.js +0 -30
- package/dist/esm/sdds-accordion.entry.js +0 -17
- package/dist/esm/sdds-badges.entry.js +0 -51
- package/dist/esm/sdds-body-cell_2.entry.js +0 -168
- package/dist/esm/sdds-button.entry.js +0 -32
- package/dist/esm/sdds-datetime.entry.js +0 -62
- package/dist/esm/sdds-dropdown-filter.entry.js +0 -88
- package/dist/esm/sdds-dropdown_2.entry.js +0 -330
- package/dist/esm/sdds-header-cell.entry.js +0 -137
- package/dist/esm/sdds-icon.entry.js +0 -38
- package/dist/esm/sdds-inline-tabs-fullbleed.entry.js +0 -92
- package/dist/esm/sdds-inline-tabs.entry.js +0 -207
- package/dist/esm/sdds-modal.entry.js +0 -45
- package/dist/esm/sdds-navigation-tabs.entry.js +0 -91
- package/dist/esm/sdds-popover-canvas.entry.js +0 -72
- package/dist/esm/sdds-popover-menu.entry.js +0 -71
- package/dist/esm/sdds-slider.entry.js +0 -332
- package/dist/esm/sdds-spinner.entry.js +0 -17
- package/dist/esm/sdds-table-body-row-expandable.entry.js +0 -77
- package/dist/esm/sdds-table-body.entry.js +0 -285
- package/dist/esm/sdds-table-footer.entry.js +0 -161
- package/dist/esm/sdds-table-header.entry.js +0 -96
- package/dist/esm/sdds-table-toolbar.entry.js +0 -62
- package/dist/esm/sdds-table.entry.js +0 -65
- package/dist/esm/sdds-textarea.entry.js +0 -57
- package/dist/esm/sdds-textfield.entry.js +0 -78
- package/dist/esm/sdds-tooltip.entry.js +0 -91
- package/dist/esm/tegel.js +0 -17
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/tegel/index.esm.js +0 -0
- package/dist/tegel/p-040efb32.entry.js +0 -1
- package/dist/tegel/p-12ca5cfa.entry.js +0 -1
- package/dist/tegel/p-157e1618.js +0 -2
- package/dist/tegel/p-1fe61cf6.entry.js +0 -1
- package/dist/tegel/p-2f376504.entry.js +0 -1
- package/dist/tegel/p-44ced895.entry.js +0 -1
- package/dist/tegel/p-4880f03d.entry.js +0 -1
- package/dist/tegel/p-4aba73a3.entry.js +0 -1
- package/dist/tegel/p-4b58a02c.entry.js +0 -1
- package/dist/tegel/p-4cb85347.entry.js +0 -1
- package/dist/tegel/p-52031b5a.entry.js +0 -1
- package/dist/tegel/p-677baf7f.entry.js +0 -1
- package/dist/tegel/p-71797eaf.entry.js +0 -1
- package/dist/tegel/p-7373284c.entry.js +0 -1
- package/dist/tegel/p-7451779b.entry.js +0 -1
- package/dist/tegel/p-77aeea3b.entry.js +0 -1
- package/dist/tegel/p-8582d6a7.entry.js +0 -1
- package/dist/tegel/p-96021bd0.entry.js +0 -1
- package/dist/tegel/p-9d8caf51.entry.js +0 -1
- package/dist/tegel/p-a5919930.entry.js +0 -1
- package/dist/tegel/p-b01cface.entry.js +0 -1
- package/dist/tegel/p-bf896643.entry.js +0 -1
- package/dist/tegel/p-c311725c.entry.js +0 -1
- package/dist/tegel/p-cf72dfd9.entry.js +0 -1
- package/dist/tegel/p-d91caec6.entry.js +0 -1
- package/dist/tegel/p-e10eec33.entry.js +0 -1
- package/dist/tegel/p-ec26fc38.js +0 -1
- package/dist/tegel/p-f2262a69.entry.js +0 -1
- package/dist/tegel/p-f2f7aa45.entry.js +0 -1
- package/dist/tegel/tegel.css +0 -101
- package/dist/tegel/tegel.esm.js +0 -1
- package/loader/cdn.js +0 -3
- package/loader/index.cjs.js +0 -3
- package/loader/index.d.ts +0 -12
- package/loader/index.es2017.js +0 -3
- package/loader/index.js +0 -4
- package/loader/package.json +0 -11
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { h, Host } from '@stencil/core';
|
|
2
|
-
export class Modal {
|
|
3
|
-
constructor() {
|
|
4
|
-
this.prevent = false;
|
|
5
|
-
this.size = 'md';
|
|
6
|
-
this.actions = 'static';
|
|
7
|
-
this.open = false;
|
|
8
|
-
}
|
|
9
|
-
/** Shows the modal */
|
|
10
|
-
async openModal() {
|
|
11
|
-
this.open = true;
|
|
12
|
-
}
|
|
13
|
-
setDissmissButtons() {
|
|
14
|
-
const nodes = this.el.querySelectorAll('[data-dismiss-modal]');
|
|
15
|
-
nodes.forEach((el) => {
|
|
16
|
-
el.addEventListener('click', () => {
|
|
17
|
-
this.open = false;
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
handleClick(e) {
|
|
22
|
-
const targetList = e.composedPath();
|
|
23
|
-
const target = targetList[0];
|
|
24
|
-
if (target.classList[0] === 'sdds-modal-btn' ||
|
|
25
|
-
(target.classList[0] === 'sdds-modal-backdrop' && this.prevent === false)) {
|
|
26
|
-
this.open = false;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
componentDidRender() {
|
|
30
|
-
this.setDissmissButtons();
|
|
31
|
-
}
|
|
32
|
-
render() {
|
|
33
|
-
return (h(Host, { onClick: (event) => {
|
|
34
|
-
this.handleClick(event);
|
|
35
|
-
}, class: `sdds-modal-backdrop ${this.open ? 'show' : 'hide'}` }, h("div", { class: `sdds-modal ${this.actions ? `sdds-modal__actions-${this.actions}` : ''} ${this.size ? `sdds-modal-${this.size}` : ''} ` }, h("div", { class: "sdds-modal-header" }, h("slot", { name: "sdds-modal-headline" }), h("button", { class: "sdds-modal-btn" })), h("div", { class: "sdds-modal-body" }, h("slot", { name: "sdds-modal-body" })), h("div", { class: "sdds-modal-actions" }, h("slot", { name: "sdds-modal-actions" })))));
|
|
36
|
-
}
|
|
37
|
-
static get is() { return "sdds-modal"; }
|
|
38
|
-
static get encapsulation() { return "shadow"; }
|
|
39
|
-
static get originalStyleUrls() {
|
|
40
|
-
return {
|
|
41
|
-
"$": ["modal.scss"]
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
static get styleUrls() {
|
|
45
|
-
return {
|
|
46
|
-
"$": ["modal.css"]
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
static get properties() {
|
|
50
|
-
return {
|
|
51
|
-
"prevent": {
|
|
52
|
-
"type": "boolean",
|
|
53
|
-
"mutable": false,
|
|
54
|
-
"complexType": {
|
|
55
|
-
"original": "boolean",
|
|
56
|
-
"resolved": "boolean",
|
|
57
|
-
"references": {}
|
|
58
|
-
},
|
|
59
|
-
"required": false,
|
|
60
|
-
"optional": false,
|
|
61
|
-
"docs": {
|
|
62
|
-
"tags": [],
|
|
63
|
-
"text": "Disables closing modal on clicking on overlay area."
|
|
64
|
-
},
|
|
65
|
-
"attribute": "prevent",
|
|
66
|
-
"reflect": false,
|
|
67
|
-
"defaultValue": "false"
|
|
68
|
-
},
|
|
69
|
-
"size": {
|
|
70
|
-
"type": "string",
|
|
71
|
-
"mutable": false,
|
|
72
|
-
"complexType": {
|
|
73
|
-
"original": "'xs' | 'sm' | 'md' | 'lg'",
|
|
74
|
-
"resolved": "\"lg\" | \"md\" | \"sm\" | \"xs\"",
|
|
75
|
-
"references": {}
|
|
76
|
-
},
|
|
77
|
-
"required": false,
|
|
78
|
-
"optional": false,
|
|
79
|
-
"docs": {
|
|
80
|
-
"tags": [],
|
|
81
|
-
"text": "Size of modal. Accepted strings are: xs, sm, md, lg."
|
|
82
|
-
},
|
|
83
|
-
"attribute": "size",
|
|
84
|
-
"reflect": false,
|
|
85
|
-
"defaultValue": "'md'"
|
|
86
|
-
},
|
|
87
|
-
"actions": {
|
|
88
|
-
"type": "string",
|
|
89
|
-
"mutable": false,
|
|
90
|
-
"complexType": {
|
|
91
|
-
"original": "'sticky' | 'static'",
|
|
92
|
-
"resolved": "\"static\" | \"sticky\"",
|
|
93
|
-
"references": {}
|
|
94
|
-
},
|
|
95
|
-
"required": false,
|
|
96
|
-
"optional": false,
|
|
97
|
-
"docs": {
|
|
98
|
-
"tags": [],
|
|
99
|
-
"text": "Sticky or Static Actions"
|
|
100
|
-
},
|
|
101
|
-
"attribute": "actions",
|
|
102
|
-
"reflect": false,
|
|
103
|
-
"defaultValue": "'static'"
|
|
104
|
-
},
|
|
105
|
-
"open": {
|
|
106
|
-
"type": "boolean",
|
|
107
|
-
"mutable": false,
|
|
108
|
-
"complexType": {
|
|
109
|
-
"original": "boolean",
|
|
110
|
-
"resolved": "boolean",
|
|
111
|
-
"references": {}
|
|
112
|
-
},
|
|
113
|
-
"required": false,
|
|
114
|
-
"optional": false,
|
|
115
|
-
"docs": {
|
|
116
|
-
"tags": [],
|
|
117
|
-
"text": ""
|
|
118
|
-
},
|
|
119
|
-
"attribute": "open",
|
|
120
|
-
"reflect": false,
|
|
121
|
-
"defaultValue": "false"
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
static get methods() {
|
|
126
|
-
return {
|
|
127
|
-
"openModal": {
|
|
128
|
-
"complexType": {
|
|
129
|
-
"signature": "() => Promise<void>",
|
|
130
|
-
"parameters": [],
|
|
131
|
-
"references": {
|
|
132
|
-
"Promise": {
|
|
133
|
-
"location": "global"
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
"return": "Promise<void>"
|
|
137
|
-
},
|
|
138
|
-
"docs": {
|
|
139
|
-
"text": "Shows the modal",
|
|
140
|
-
"tags": []
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
static get elementRef() { return "el"; }
|
|
146
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
box-sizing: border-box;
|
|
3
|
-
min-width: 160px;
|
|
4
|
-
min-height: 160px;
|
|
5
|
-
background-color: var(--sdds-popover-bg-default);
|
|
6
|
-
padding: 16px;
|
|
7
|
-
box-shadow: 0 3px 3px rgba(0, 0, 0, 0.15), 0 -1px 1px rgba(0, 0, 0, 0.1);
|
|
8
|
-
border-radius: 4px;
|
|
9
|
-
z-index: 20000;
|
|
10
|
-
/* same as tooltip */
|
|
11
|
-
display: none;
|
|
12
|
-
}
|
|
13
|
-
:host * {
|
|
14
|
-
box-sizing: border-box;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
:host(.sdds-popover-canvas-show) {
|
|
18
|
-
opacity: 1;
|
|
19
|
-
display: block;
|
|
20
|
-
}
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
import { Host, h } from '@stencil/core';
|
|
2
|
-
import { createPopper } from '@popperjs/core';
|
|
3
|
-
export class PopoverCanvas {
|
|
4
|
-
constructor() {
|
|
5
|
-
this.selector = '';
|
|
6
|
-
this.show = false;
|
|
7
|
-
this.placement = 'auto';
|
|
8
|
-
this.offsetSkidding = 0;
|
|
9
|
-
this.offsetDistance = 8;
|
|
10
|
-
this.target = undefined;
|
|
11
|
-
}
|
|
12
|
-
handleOutsideClick() {
|
|
13
|
-
if (this.show) {
|
|
14
|
-
this.show = false;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
componentDidLoad() {
|
|
18
|
-
this.target = document.querySelector(this.selector);
|
|
19
|
-
const _this = this;
|
|
20
|
-
createPopper(this.target, this.popoverCanvasElement, {
|
|
21
|
-
placement: _this.placement,
|
|
22
|
-
modifiers: [
|
|
23
|
-
{
|
|
24
|
-
name: 'positionCalc',
|
|
25
|
-
enabled: true,
|
|
26
|
-
phase: 'main',
|
|
27
|
-
fn({ state }) {
|
|
28
|
-
console.log('popover fn', state);
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
name: 'offset',
|
|
33
|
-
options: {
|
|
34
|
-
offset: [this.offsetSkidding, this.offsetDistance],
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
});
|
|
39
|
-
const showCanvas = () => {
|
|
40
|
-
this.show = true;
|
|
41
|
-
};
|
|
42
|
-
const hideCanvas = () => {
|
|
43
|
-
this.show = false;
|
|
44
|
-
};
|
|
45
|
-
this.target.addEventListener('mousedown', event => {
|
|
46
|
-
event.stopPropagation();
|
|
47
|
-
if (this.show) {
|
|
48
|
-
hideCanvas();
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
showCanvas();
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
this.popoverCanvasElement.addEventListener('mousemove', event => {
|
|
55
|
-
event.stopPropagation();
|
|
56
|
-
});
|
|
57
|
-
this.popoverCanvasElement.addEventListener('mousedown', event => {
|
|
58
|
-
event.stopPropagation();
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
render() {
|
|
62
|
-
return (h(Host, { class: `sdds-popover-canvas ${this.show ? 'sdds-popover-canvas-show' : ''}` }, h("slot", null)));
|
|
63
|
-
}
|
|
64
|
-
static get is() { return "sdds-popover-canvas"; }
|
|
65
|
-
static get encapsulation() { return "shadow"; }
|
|
66
|
-
static get originalStyleUrls() {
|
|
67
|
-
return {
|
|
68
|
-
"$": ["popover-canvas.scss"]
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
static get styleUrls() {
|
|
72
|
-
return {
|
|
73
|
-
"$": ["popover-canvas.css"]
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
static get properties() {
|
|
77
|
-
return {
|
|
78
|
-
"selector": {
|
|
79
|
-
"type": "string",
|
|
80
|
-
"mutable": false,
|
|
81
|
-
"complexType": {
|
|
82
|
-
"original": "string",
|
|
83
|
-
"resolved": "string",
|
|
84
|
-
"references": {}
|
|
85
|
-
},
|
|
86
|
-
"required": false,
|
|
87
|
-
"optional": false,
|
|
88
|
-
"docs": {
|
|
89
|
-
"tags": [],
|
|
90
|
-
"text": "The CSS-selector that will trigger this Popover Canvas"
|
|
91
|
-
},
|
|
92
|
-
"attribute": "selector",
|
|
93
|
-
"reflect": false,
|
|
94
|
-
"defaultValue": "''"
|
|
95
|
-
},
|
|
96
|
-
"show": {
|
|
97
|
-
"type": "boolean",
|
|
98
|
-
"mutable": false,
|
|
99
|
-
"complexType": {
|
|
100
|
-
"original": "boolean",
|
|
101
|
-
"resolved": "boolean",
|
|
102
|
-
"references": {}
|
|
103
|
-
},
|
|
104
|
-
"required": false,
|
|
105
|
-
"optional": false,
|
|
106
|
-
"docs": {
|
|
107
|
-
"tags": [],
|
|
108
|
-
"text": "Decides if the Popover Canvas should be visible from the start"
|
|
109
|
-
},
|
|
110
|
-
"attribute": "show",
|
|
111
|
-
"reflect": false,
|
|
112
|
-
"defaultValue": "false"
|
|
113
|
-
},
|
|
114
|
-
"placement": {
|
|
115
|
-
"type": "string",
|
|
116
|
-
"mutable": false,
|
|
117
|
-
"complexType": {
|
|
118
|
-
"original": "Placement",
|
|
119
|
-
"resolved": "\"auto\" | \"auto-end\" | \"auto-start\" | \"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\"",
|
|
120
|
-
"references": {
|
|
121
|
-
"Placement": {
|
|
122
|
-
"location": "import",
|
|
123
|
-
"path": "@popperjs/core"
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
"required": false,
|
|
128
|
-
"optional": false,
|
|
129
|
-
"docs": {
|
|
130
|
-
"tags": [],
|
|
131
|
-
"text": "Decides the placement of the Popover Canvas"
|
|
132
|
-
},
|
|
133
|
-
"attribute": "placement",
|
|
134
|
-
"reflect": false,
|
|
135
|
-
"defaultValue": "'auto'"
|
|
136
|
-
},
|
|
137
|
-
"offsetSkidding": {
|
|
138
|
-
"type": "number",
|
|
139
|
-
"mutable": false,
|
|
140
|
-
"complexType": {
|
|
141
|
-
"original": "number",
|
|
142
|
-
"resolved": "number",
|
|
143
|
-
"references": {}
|
|
144
|
-
},
|
|
145
|
-
"required": false,
|
|
146
|
-
"optional": false,
|
|
147
|
-
"docs": {
|
|
148
|
-
"tags": [],
|
|
149
|
-
"text": "Sets the offset skidding"
|
|
150
|
-
},
|
|
151
|
-
"attribute": "offset-skidding",
|
|
152
|
-
"reflect": false,
|
|
153
|
-
"defaultValue": "0"
|
|
154
|
-
},
|
|
155
|
-
"offsetDistance": {
|
|
156
|
-
"type": "number",
|
|
157
|
-
"mutable": false,
|
|
158
|
-
"complexType": {
|
|
159
|
-
"original": "number",
|
|
160
|
-
"resolved": "number",
|
|
161
|
-
"references": {}
|
|
162
|
-
},
|
|
163
|
-
"required": false,
|
|
164
|
-
"optional": false,
|
|
165
|
-
"docs": {
|
|
166
|
-
"tags": [],
|
|
167
|
-
"text": "Sets the offset distance"
|
|
168
|
-
},
|
|
169
|
-
"attribute": "offset-distance",
|
|
170
|
-
"reflect": false,
|
|
171
|
-
"defaultValue": "8"
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
static get states() {
|
|
176
|
-
return {
|
|
177
|
-
"target": {}
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
static get elementRef() { return "popoverCanvasElement"; }
|
|
181
|
-
static get listeners() {
|
|
182
|
-
return [{
|
|
183
|
-
"name": "mousedown",
|
|
184
|
-
"method": "handleOutsideClick",
|
|
185
|
-
"target": "window",
|
|
186
|
-
"capture": false,
|
|
187
|
-
"passive": true
|
|
188
|
-
}];
|
|
189
|
-
}
|
|
190
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { formatHtmlPreview } from '../../utils/utils';
|
|
2
|
-
import readme from './readme.md';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Components/Popover Canvas',
|
|
5
|
-
parameters: {
|
|
6
|
-
layout: 'centered',
|
|
7
|
-
notes: readme,
|
|
8
|
-
},
|
|
9
|
-
argTypes: {
|
|
10
|
-
canvasPosition: {
|
|
11
|
-
name: 'Canvas position',
|
|
12
|
-
description: 'Position of the PopoverCanvas',
|
|
13
|
-
type: { summary: 'string' },
|
|
14
|
-
control: {
|
|
15
|
-
type: 'select',
|
|
16
|
-
},
|
|
17
|
-
options: [
|
|
18
|
-
'Bottom',
|
|
19
|
-
'Bottom start',
|
|
20
|
-
'Bottom end',
|
|
21
|
-
'Top',
|
|
22
|
-
'Top start',
|
|
23
|
-
'Top end',
|
|
24
|
-
'Left',
|
|
25
|
-
'Left-start',
|
|
26
|
-
'Left end',
|
|
27
|
-
'Right',
|
|
28
|
-
'Right start',
|
|
29
|
-
'Right end',
|
|
30
|
-
],
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
args: {
|
|
34
|
-
canvasPosition: 'Bottom',
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
const ComponentPopoverCanvas = ({ canvasPosition }) => {
|
|
38
|
-
const canvasPosLookup = {
|
|
39
|
-
'Bottom': 'bottom',
|
|
40
|
-
'Bottom start': 'bottom-start',
|
|
41
|
-
'Bottom end': 'bottom-end',
|
|
42
|
-
'Top': 'top',
|
|
43
|
-
'Top start': 'top-start',
|
|
44
|
-
'Top end': 'top-end',
|
|
45
|
-
'Left': 'left',
|
|
46
|
-
'Left star': 'left-start',
|
|
47
|
-
'Left end': 'left-end',
|
|
48
|
-
'Right': 'right',
|
|
49
|
-
'Right start': 'right-start',
|
|
50
|
-
'Right end': 'right-end',
|
|
51
|
-
};
|
|
52
|
-
return formatHtmlPreview(`
|
|
53
|
-
<style>
|
|
54
|
-
/* demo-wrapper and demo-styles is for demonstration purposes only */
|
|
55
|
-
.demo-wrapper {
|
|
56
|
-
display: flex;
|
|
57
|
-
flex-wrap; nowrap;
|
|
58
|
-
align-items: center;
|
|
59
|
-
}
|
|
60
|
-
sdds-icon:hover {
|
|
61
|
-
cursor:pointer;
|
|
62
|
-
}
|
|
63
|
-
</style>
|
|
64
|
-
|
|
65
|
-
<sdds-popover-canvas
|
|
66
|
-
placement="${canvasPosLookup[canvasPosition]}"
|
|
67
|
-
selector="#trigger">
|
|
68
|
-
<div>
|
|
69
|
-
<h2>A popover canvas!</h2>
|
|
70
|
-
<p>
|
|
71
|
-
Where you can put anything you want!
|
|
72
|
-
</p>
|
|
73
|
-
<p>
|
|
74
|
-
<a target="_blank" href="https://digitaldesign.scania.com">Even links!</a>
|
|
75
|
-
</p>
|
|
76
|
-
</div>
|
|
77
|
-
</sdds-popover-canvas>
|
|
78
|
-
|
|
79
|
-
<!-- demo-wrapper and demo-styles is for demonstration purposes only -->
|
|
80
|
-
<div class="demo-wrapper">
|
|
81
|
-
<span style="user-select: none;margin-right: 16px;">Click icon for popover canvas</span>
|
|
82
|
-
<sdds-icon id="trigger" name="kebab" size="16px"></sdds-icon>
|
|
83
|
-
</div>
|
|
84
|
-
`);
|
|
85
|
-
};
|
|
86
|
-
export const Default = ComponentPopoverCanvas.bind({});
|
|
87
|
-
Default.args = {};
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import { formatHtmlPreview } from '../../utils/utils';
|
|
2
|
-
import readme from './readme.md';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Components/Popover Menu',
|
|
5
|
-
parameters: {
|
|
6
|
-
layout: 'centered',
|
|
7
|
-
notes: readme,
|
|
8
|
-
design: [
|
|
9
|
-
{
|
|
10
|
-
name: 'Figma',
|
|
11
|
-
type: 'figma',
|
|
12
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=16794%3A59241&t=Ne6myqwca5m00de7-1',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: 'Link',
|
|
16
|
-
type: 'link',
|
|
17
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=16794%3A59241&t=Ne6myqwca5m00de7-1',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
argTypes: {
|
|
22
|
-
menuPosition: {
|
|
23
|
-
name: 'Menu position',
|
|
24
|
-
description: 'Position of the Popover menu',
|
|
25
|
-
control: {
|
|
26
|
-
type: 'select',
|
|
27
|
-
},
|
|
28
|
-
options: [
|
|
29
|
-
'Bottom',
|
|
30
|
-
'Bottom start',
|
|
31
|
-
'Bottom end',
|
|
32
|
-
'Top',
|
|
33
|
-
'Top start',
|
|
34
|
-
'Top end',
|
|
35
|
-
'Left',
|
|
36
|
-
'Left-start',
|
|
37
|
-
'Left end',
|
|
38
|
-
'Right',
|
|
39
|
-
'Right start',
|
|
40
|
-
'Right end',
|
|
41
|
-
],
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
args: {
|
|
45
|
-
menuPosition: 'Bottom',
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
const Template = ({ menuPosition }) => {
|
|
49
|
-
const menuPosLookup = {
|
|
50
|
-
'Bottom': 'bottom',
|
|
51
|
-
'Bottom start': 'bottom-start',
|
|
52
|
-
'Bottom end': 'bottom-end',
|
|
53
|
-
'Top': 'top',
|
|
54
|
-
'Top start': 'top-start',
|
|
55
|
-
'Top end': 'top-end',
|
|
56
|
-
'Left': 'left',
|
|
57
|
-
'Left star': 'left-start',
|
|
58
|
-
'Left end': 'left-end',
|
|
59
|
-
'Right': 'right',
|
|
60
|
-
'Right start': 'right-start',
|
|
61
|
-
'Right end': 'right-end',
|
|
62
|
-
};
|
|
63
|
-
return formatHtmlPreview(`
|
|
64
|
-
<style>
|
|
65
|
-
/* demo-wrapper is for demonstration purposes only*/
|
|
66
|
-
.demo-wrapper {
|
|
67
|
-
display: flex;
|
|
68
|
-
flex-wrap: nowrap;
|
|
69
|
-
alignt-items: center;
|
|
70
|
-
}
|
|
71
|
-
sdds-icon:hover {
|
|
72
|
-
cursor:pointer;
|
|
73
|
-
}
|
|
74
|
-
</style>
|
|
75
|
-
|
|
76
|
-
<sdds-popover-menu
|
|
77
|
-
placement="${menuPosLookup[menuPosition]}"
|
|
78
|
-
selector="#trigger">
|
|
79
|
-
<ul class="sdds-popover-menu-wrapper">
|
|
80
|
-
<li>
|
|
81
|
-
<a target="_blank" href="https://digitaldesign.scania.com">
|
|
82
|
-
<i>
|
|
83
|
-
<sdds-icon name="save" size="16px"></sdds-icon>
|
|
84
|
-
</i>
|
|
85
|
-
Menu item 1
|
|
86
|
-
</a>
|
|
87
|
-
</li>
|
|
88
|
-
<li>
|
|
89
|
-
<a target="_blank" href="https://digitaldesign.scania.com">
|
|
90
|
-
<i>
|
|
91
|
-
<sdds-icon name="save" size="16px"></sdds-icon>
|
|
92
|
-
</i>
|
|
93
|
-
Menu item 2
|
|
94
|
-
</a>
|
|
95
|
-
</li>
|
|
96
|
-
<li>
|
|
97
|
-
<a target="_blank" href="https://digitaldesign.scania.com">
|
|
98
|
-
<i>
|
|
99
|
-
<sdds-icon name="save" size="16px"></sdds-icon>
|
|
100
|
-
</i>
|
|
101
|
-
Menu item 3
|
|
102
|
-
</a>
|
|
103
|
-
</li>
|
|
104
|
-
<li class="divider"></li>
|
|
105
|
-
<li>
|
|
106
|
-
<a target="_blank" href="https://digitaldesign.scania.com">
|
|
107
|
-
<i>
|
|
108
|
-
<sdds-icon name="save" size="16px"></sdds-icon>
|
|
109
|
-
</i>
|
|
110
|
-
Menu item 4
|
|
111
|
-
</a>
|
|
112
|
-
</li>
|
|
113
|
-
<li>
|
|
114
|
-
<a target="_blank" href="https://digitaldesign.scania.com">
|
|
115
|
-
<i>
|
|
116
|
-
<sdds-icon name="save" size="16px"></sdds-icon>
|
|
117
|
-
</i>
|
|
118
|
-
Menu item 5
|
|
119
|
-
</a>
|
|
120
|
-
</li>
|
|
121
|
-
</ul>
|
|
122
|
-
</sdds-popover-menu>
|
|
123
|
-
|
|
124
|
-
<!-- demo-wrapper code below is for demonstration purposes only -->
|
|
125
|
-
<div class="demo-wrapper">
|
|
126
|
-
<span style="user-select: none;margin-right: 16px;">Click icon for popover menu</span>
|
|
127
|
-
<sdds-icon id="trigger" name="kebab" size="16px"></sdds-icon>
|
|
128
|
-
</div>
|
|
129
|
-
`);
|
|
130
|
-
};
|
|
131
|
-
export const WithIcons = Template.bind({});
|
|
132
|
-
WithIcons.args = {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
box-sizing: border-box;
|
|
3
|
-
overflow: hidden;
|
|
4
|
-
width: 160px;
|
|
5
|
-
background-color: var(--sdds-popover-bg-default);
|
|
6
|
-
padding: 16px;
|
|
7
|
-
box-shadow: 0 3px 3px rgba(0, 0, 0, 0.15), 0 -1px 1px rgba(0, 0, 0, 0.1);
|
|
8
|
-
border-radius: 4px;
|
|
9
|
-
display: none;
|
|
10
|
-
z-index: 20000;
|
|
11
|
-
}
|
|
12
|
-
:host * {
|
|
13
|
-
box-sizing: border-box;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
:host(.sdds-popover-menu-show) {
|
|
17
|
-
opacity: 1;
|
|
18
|
-
display: block;
|
|
19
|
-
}
|