@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,554 +0,0 @@
|
|
|
1
|
-
import { h, Host, } from '@stencil/core';
|
|
2
|
-
export class Dropdown {
|
|
3
|
-
constructor() {
|
|
4
|
-
this.placeholder = undefined;
|
|
5
|
-
this.defaultOption = undefined;
|
|
6
|
-
this.selectedOption = undefined;
|
|
7
|
-
this.disabled = undefined;
|
|
8
|
-
this.type = 'default';
|
|
9
|
-
this.size = 'lg';
|
|
10
|
-
this.inline = false;
|
|
11
|
-
this.labelPosition = 'no-label';
|
|
12
|
-
this.label = undefined;
|
|
13
|
-
this.state = 'default';
|
|
14
|
-
this.helper = '';
|
|
15
|
-
this.openDirection = 'auto';
|
|
16
|
-
this.optionValues = [];
|
|
17
|
-
this.optionLabels = [];
|
|
18
|
-
this.open = false;
|
|
19
|
-
this.node = undefined;
|
|
20
|
-
this.selectedLabel = '';
|
|
21
|
-
this.selectedValue = '';
|
|
22
|
-
this.selectedValuesArray = [];
|
|
23
|
-
this.selectedLabelsArray = [];
|
|
24
|
-
this.dropdownUniqueClass = '';
|
|
25
|
-
this.openUpwards = false;
|
|
26
|
-
this.dropdownMenuHeight = 0;
|
|
27
|
-
this.dropdownMenuSelector = undefined;
|
|
28
|
-
this.listItemIndex = -1;
|
|
29
|
-
this.listItemArray = undefined;
|
|
30
|
-
}
|
|
31
|
-
componentWillLoad() {
|
|
32
|
-
// If default option is set, update the default selectedLabel value
|
|
33
|
-
// this.host.children is a HTMLCollection type, cannot use forEach
|
|
34
|
-
this.listItemArray = Array.from(this.host.children);
|
|
35
|
-
this.listItemArray.map((listItem) => {
|
|
36
|
-
this.optionValues.push(listItem.value);
|
|
37
|
-
this.optionLabels.push(listItem.innerText.trim());
|
|
38
|
-
});
|
|
39
|
-
this.setOptionFromOutside(this.defaultOption);
|
|
40
|
-
if (this.size === 'small') {
|
|
41
|
-
this.size = 'sm';
|
|
42
|
-
console.warn('size="small" is deprecated, use size="sm" instead');
|
|
43
|
-
}
|
|
44
|
-
if (this.size === 'medium') {
|
|
45
|
-
this.size = 'md';
|
|
46
|
-
console.warn('size="medium" is deprecated, use size="md" instead');
|
|
47
|
-
}
|
|
48
|
-
if (this.size === 'large') {
|
|
49
|
-
this.size = 'lg';
|
|
50
|
-
console.warn('size="large" is deprecated, use size="lg" instead');
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
setOptionFromOutside(optionValue) {
|
|
54
|
-
if (optionValue) {
|
|
55
|
-
this.deselectAll();
|
|
56
|
-
// TODO
|
|
57
|
-
// eslint-disable-next-line no-param-reassign
|
|
58
|
-
optionValue = optionValue.split(',');
|
|
59
|
-
for (let i = 0; i < this.host.children.length; i++) {
|
|
60
|
-
// Todo - specify type
|
|
61
|
-
const el = this.host.children[i];
|
|
62
|
-
if (optionValue.includes(el.value.trim())) {
|
|
63
|
-
this.selectedLabelsArray = [...this.selectedLabelsArray, el.textContent.trim()];
|
|
64
|
-
this.selectedValuesArray = [...this.selectedValuesArray, el.value];
|
|
65
|
-
this.selectedLabel = el.textContent;
|
|
66
|
-
this.selectedValue = el.value;
|
|
67
|
-
el.setAttribute('selectedLabel', 'true');
|
|
68
|
-
el.setAttribute('selected', 'true');
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
el.setAttribute('selectedLabel', 'false');
|
|
72
|
-
el.setAttribute('selected', 'false');
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
changeSelectedOption() {
|
|
78
|
-
if (this.selectedValuesArray.includes(this.selectedOption)) {
|
|
79
|
-
this.resetOption();
|
|
80
|
-
}
|
|
81
|
-
this.setOptionFromOutside(this.selectedOption);
|
|
82
|
-
this.host.setAttribute('selected-option', '');
|
|
83
|
-
}
|
|
84
|
-
handleDocClick(ev) {
|
|
85
|
-
// To stop bubble click
|
|
86
|
-
ev.stopPropagation();
|
|
87
|
-
const target = ev ? ev.composedPath()[0] : window.event.target[0];
|
|
88
|
-
if (this.node !== undefined && this.node.contains(target)) {
|
|
89
|
-
if (typeof this.textInput !== 'undefined' || this.textInput === null) {
|
|
90
|
-
this.textInput.focus();
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
this.tabbingLabelReset();
|
|
95
|
-
this.open = false;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
keyListener(ev) {
|
|
99
|
-
if (!this.disabled) {
|
|
100
|
-
switch (ev.key) {
|
|
101
|
-
case 'ArrowDown':
|
|
102
|
-
if (this.open) {
|
|
103
|
-
ev.preventDefault();
|
|
104
|
-
if (this.listItemIndex < this.listItemArray.length - 1) {
|
|
105
|
-
this.listItemIndex++;
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
this.listItemIndex = 0;
|
|
109
|
-
}
|
|
110
|
-
this.listItemArray[this.listItemIndex].focus();
|
|
111
|
-
}
|
|
112
|
-
break;
|
|
113
|
-
case 'ArrowUp':
|
|
114
|
-
if (this.open) {
|
|
115
|
-
ev.preventDefault();
|
|
116
|
-
if (this.listItemIndex > 0) {
|
|
117
|
-
this.listItemIndex--;
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
this.listItemIndex = this.listItemArray.length - 1;
|
|
121
|
-
}
|
|
122
|
-
this.listItemArray[this.listItemIndex].focus();
|
|
123
|
-
}
|
|
124
|
-
break;
|
|
125
|
-
case 'Tab':
|
|
126
|
-
this.open = false;
|
|
127
|
-
break;
|
|
128
|
-
case 'Escape':
|
|
129
|
-
this.open = false;
|
|
130
|
-
this.node.focus();
|
|
131
|
-
break;
|
|
132
|
-
default:
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
handleClick() {
|
|
138
|
-
this.open = this.open === false;
|
|
139
|
-
if (this.openDirection === 'auto') {
|
|
140
|
-
this.dropdownMenuHeight = this.dropdownMenuSelector.offsetHeight;
|
|
141
|
-
const distanceToBottom = this.host.getBoundingClientRect().top;
|
|
142
|
-
const viewportHeight = window.innerHeight;
|
|
143
|
-
this.openUpwards = distanceToBottom + this.dropdownMenuHeight + 57 > viewportHeight;
|
|
144
|
-
// If summary of dropdown menu height and its distance to the bottom is more than viewport height, open menu upwards
|
|
145
|
-
// Additional 57px is added as compensation for dropdown element own input/button height
|
|
146
|
-
// It is added on handleClick due to possible dynamic injection of data when component is already rendered
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
this.openUpwards = this.openDirection === 'up';
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
tabbingLabelReset() {
|
|
153
|
-
if (typeof this.textInput !== 'undefined' || this.textInput === null) {
|
|
154
|
-
if (!this.selectedLabel && this.selectedLabel.length <= 0) {
|
|
155
|
-
this.textInput.value = '';
|
|
156
|
-
this.inputSearch.emit('');
|
|
157
|
-
}
|
|
158
|
-
if (this.selectedLabel !== this.textInput.value) {
|
|
159
|
-
this.textInput.value = this.selectedLabel;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
selectOptionHandler(event) {
|
|
164
|
-
this.open = this.type === 'multiselect';
|
|
165
|
-
if (this.type !== 'multiselect') {
|
|
166
|
-
this.selectedLabel = event.detail.label;
|
|
167
|
-
this.selectedValue = event.detail.value;
|
|
168
|
-
this.tabbingLabelReset();
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
if (this.selectedValuesArray.includes(event.detail.value)) {
|
|
172
|
-
const itemIndex = this.selectedValuesArray.indexOf(event.detail.value);
|
|
173
|
-
this.selectedValuesArray = this.selectedValuesArray.filter((_value, index) => index !== itemIndex);
|
|
174
|
-
this.selectedLabelsArray = this.selectedLabelsArray.filter((_value, index) => index !== itemIndex);
|
|
175
|
-
}
|
|
176
|
-
else {
|
|
177
|
-
this.selectedValuesArray = [...this.selectedValuesArray, event.detail.value];
|
|
178
|
-
this.selectedLabelsArray = [...this.selectedLabelsArray, event.detail.label.trim()];
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
handleSearch(ev) {
|
|
183
|
-
const searchTerm = ev.target.value;
|
|
184
|
-
this.inputSearch.emit(searchTerm);
|
|
185
|
-
this.open = true;
|
|
186
|
-
}
|
|
187
|
-
deselectAll() {
|
|
188
|
-
this.selectedLabel = '';
|
|
189
|
-
this.selectedValue = '';
|
|
190
|
-
this.selectedLabelsArray = [];
|
|
191
|
-
this.selectedValuesArray = [];
|
|
192
|
-
this.listItemArray = this.listItemArray.map((optionItem) => (Object.assign(Object.assign({}, optionItem), { selected: false })));
|
|
193
|
-
}
|
|
194
|
-
async resetOption() {
|
|
195
|
-
this.deselectAll();
|
|
196
|
-
this.open = false;
|
|
197
|
-
if (this.defaultOption) {
|
|
198
|
-
this.setOptionFromOutside(this.defaultOption);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
render() {
|
|
202
|
-
return (h(Host, { class: {
|
|
203
|
-
'sdds-dropdown--open': this.open && !this.disabled,
|
|
204
|
-
'sdds-dropdown-multiselect': this.type === 'multiselect',
|
|
205
|
-
'sdds-dropdown-inline': this.inline,
|
|
206
|
-
'sdds-dropdown--selected': this.selectedLabel.length > 0 || this.selectedLabel === '',
|
|
207
|
-
'sdds-dropdown--error': this.state === 'error',
|
|
208
|
-
'sdds-dropdown--open-upwards': this.openUpwards,
|
|
209
|
-
'sdds-dropdown--label-inside-position': this.labelPosition === 'inside' && this.selectedLabelsArray.length > 0,
|
|
210
|
-
}, "selected-value": this.selectedValue, "selected-text": this.selectedLabel, "multi-selected-values": JSON.stringify(this.selectedValuesArray), "multi-selected-labels": JSON.stringify(this.selectedLabelsArray) }, h("span", { class: `sdds-dropdown sdds-dropdown-${this.size}` }, this.labelPosition === 'outside' && this.label.length > 0 ? (h("span", { class: "sdds-dropdown-label-outside" }, this.label)) : (''), h("button", { part: this.disabled ? 'dropdown-filter-disabled' : '', disabled: this.disabled, tabindex: this.disabled ? '-1' : null, class: `sdds-dropdown-toggle ${this.selectedValue === 'filter' ? 'is-filter' : ''} ${this.selectedValue !== '' || this.selectedLabelsArray.length > 0
|
|
211
|
-
? 'sdds-dropdown-toggle--selected'
|
|
212
|
-
: ''}
|
|
213
|
-
${this.labelPosition === 'inside' && this.selectedValue !== '' && this.size !== 'sm'
|
|
214
|
-
? `sdds-dropdown-toggle-label-inside-${this.size}`
|
|
215
|
-
: `sdds-dropdown-toggle-${this.size}`}`, type: "button", onClick: () => this.handleClick(), ref: (node) => (this.node = node) }, h("span", { class: "sdds-dropdown-label" }, this.type === 'filter' ? (h("input", { part: this.disabled ? 'dropdown-filter-disabled' : '', disabled: this.disabled, tabindex: "-1", ref: (inputEl) => (this.textInput = inputEl), class: "sdds-dropdown-filter", type: "text", placeholder: this.placeholder, value: this.selectedLabel, onInput: (event) => this.handleSearch(event), autoComplete: "off" })) : (h("span", { class: {
|
|
216
|
-
'sdds-dropdown-label-container': true,
|
|
217
|
-
'sdds-dropdown-label-container--label-inside': this.labelPosition === 'inside' &&
|
|
218
|
-
this.size !== 'sm' &&
|
|
219
|
-
(this.selectedLabel.length > 0 || this.selectedLabelsArray.length > 0),
|
|
220
|
-
} }, this.size !== 'sm' &&
|
|
221
|
-
(this.selectedLabel.length > 0 || this.selectedLabelsArray.length > 0) &&
|
|
222
|
-
this.labelPosition === 'inside' &&
|
|
223
|
-
this.label.length > 0 && (h("span", { class: "sdds-dropdown-label-inside" }, this.label)), h("span", { class: `sdds-dropdown-label-main ${(this.selectedLabel.length === 0 ||
|
|
224
|
-
(this.labelPosition === 'inside' && this.label.length < 0)) &&
|
|
225
|
-
'sdds-dropdown-placeholder'}` }, this.selectedLabel.length > 0 &&
|
|
226
|
-
this.type !== 'multiselect' &&
|
|
227
|
-
this.selectedLabel, this.type === 'multiselect' && (h("span", { class: "sdds-dropdown-multiselect-result" }, this.labelPosition !== 'inside' &&
|
|
228
|
-
this.selectedLabelsArray.toString().length < 1 &&
|
|
229
|
-
this.placeholder, this.selectedLabelsArray.toString().length > 0 &&
|
|
230
|
-
this.selectedLabelsArray.toString().split(',').join(', '))), !this.selectedLabel &&
|
|
231
|
-
this.labelPosition === 'inside' &&
|
|
232
|
-
this.size !== 'sm' &&
|
|
233
|
-
this.label, !this.selectedLabel &&
|
|
234
|
-
this.type !== 'multiselect' &&
|
|
235
|
-
this.labelPosition !== 'inside' &&
|
|
236
|
-
this.placeholder, !this.selectedLabel &&
|
|
237
|
-
this.size === 'sm' &&
|
|
238
|
-
this.labelPosition === 'inside' &&
|
|
239
|
-
this.placeholder)))), h("svg", { class: "sdds-dropdown-arrow", width: "12", height: "7", viewBox: "0 0 12 7", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M1 1L6 6L11 1", stroke: "currentColor", "stroke-width": "1.25", "stroke-linecap": "round", "stroke-linejoin": "round" }))), h("span", { class: "sdds-dropdown-menu",
|
|
240
|
-
// Need to have reference in order to calc height and distance from bottom
|
|
241
|
-
ref: (dropdownMenu) => (this.dropdownMenuSelector = dropdownMenu) }, h("slot", null))), h("p", { class: "sdds-dropdown-helper" }, h("svg", { class: "sdds-dropdown-error-icon", fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M16 4C9.37 4 3.996 9.374 3.996 16.004S9.371 28.007 16 28.007c6.63 0 12.004-5.374 12.004-12.003C28.004 9.374 22.629 4 16 4ZM2 16.004c0-7.732 6.268-14 14-14s14 6.268 14 14-6.268 14-14 14-14-6.268-14-14Z", fill: "currentColor" }), h("path", { d: "M14.803 14.47V10h2.376v4.47l-.352 4.295h-1.672l-.352-4.295Zm-.053 5.632h2.5v2.394h-2.5v-2.394Z", fill: "currentColor" })), h("span", null, this.helper))));
|
|
242
|
-
}
|
|
243
|
-
static get is() { return "sdds-dropdown"; }
|
|
244
|
-
static get encapsulation() { return "shadow"; }
|
|
245
|
-
static get originalStyleUrls() {
|
|
246
|
-
return {
|
|
247
|
-
"$": ["dropdown.scss"]
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
|
-
static get styleUrls() {
|
|
251
|
-
return {
|
|
252
|
-
"$": ["dropdown.css"]
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
static get properties() {
|
|
256
|
-
return {
|
|
257
|
-
"placeholder": {
|
|
258
|
-
"type": "string",
|
|
259
|
-
"mutable": false,
|
|
260
|
-
"complexType": {
|
|
261
|
-
"original": "string",
|
|
262
|
-
"resolved": "string",
|
|
263
|
-
"references": {}
|
|
264
|
-
},
|
|
265
|
-
"required": false,
|
|
266
|
-
"optional": false,
|
|
267
|
-
"docs": {
|
|
268
|
-
"tags": [],
|
|
269
|
-
"text": "Placeholder text for dropdown with no selectedLabel item"
|
|
270
|
-
},
|
|
271
|
-
"attribute": "placeholder",
|
|
272
|
-
"reflect": false
|
|
273
|
-
},
|
|
274
|
-
"defaultOption": {
|
|
275
|
-
"type": "string",
|
|
276
|
-
"mutable": false,
|
|
277
|
-
"complexType": {
|
|
278
|
-
"original": "string",
|
|
279
|
-
"resolved": "string",
|
|
280
|
-
"references": {}
|
|
281
|
-
},
|
|
282
|
-
"required": false,
|
|
283
|
-
"optional": false,
|
|
284
|
-
"docs": {
|
|
285
|
-
"tags": [],
|
|
286
|
-
"text": "Add the value of the option as string to set it as default"
|
|
287
|
-
},
|
|
288
|
-
"attribute": "default-option",
|
|
289
|
-
"reflect": false
|
|
290
|
-
},
|
|
291
|
-
"selectedOption": {
|
|
292
|
-
"type": "string",
|
|
293
|
-
"mutable": false,
|
|
294
|
-
"complexType": {
|
|
295
|
-
"original": "string",
|
|
296
|
-
"resolved": "string",
|
|
297
|
-
"references": {}
|
|
298
|
-
},
|
|
299
|
-
"required": false,
|
|
300
|
-
"optional": false,
|
|
301
|
-
"docs": {
|
|
302
|
-
"tags": [],
|
|
303
|
-
"text": "Add the value of the option as string to set it as new selected value"
|
|
304
|
-
},
|
|
305
|
-
"attribute": "selected-option",
|
|
306
|
-
"reflect": false
|
|
307
|
-
},
|
|
308
|
-
"disabled": {
|
|
309
|
-
"type": "boolean",
|
|
310
|
-
"mutable": false,
|
|
311
|
-
"complexType": {
|
|
312
|
-
"original": "boolean",
|
|
313
|
-
"resolved": "boolean",
|
|
314
|
-
"references": {}
|
|
315
|
-
},
|
|
316
|
-
"required": false,
|
|
317
|
-
"optional": false,
|
|
318
|
-
"docs": {
|
|
319
|
-
"tags": [],
|
|
320
|
-
"text": "Set to true for disabled states"
|
|
321
|
-
},
|
|
322
|
-
"attribute": "disabled",
|
|
323
|
-
"reflect": false
|
|
324
|
-
},
|
|
325
|
-
"type": {
|
|
326
|
-
"type": "string",
|
|
327
|
-
"mutable": false,
|
|
328
|
-
"complexType": {
|
|
329
|
-
"original": "'default' | 'multiselect' | 'filter'",
|
|
330
|
-
"resolved": "\"default\" | \"filter\" | \"multiselect\"",
|
|
331
|
-
"references": {}
|
|
332
|
-
},
|
|
333
|
-
"required": false,
|
|
334
|
-
"optional": false,
|
|
335
|
-
"docs": {
|
|
336
|
-
"tags": [],
|
|
337
|
-
"text": "`Controls type of dropdown. 'Default', 'multiselect' and 'filter' are correct values"
|
|
338
|
-
},
|
|
339
|
-
"attribute": "type",
|
|
340
|
-
"reflect": false,
|
|
341
|
-
"defaultValue": "'default'"
|
|
342
|
-
},
|
|
343
|
-
"size": {
|
|
344
|
-
"type": "string",
|
|
345
|
-
"mutable": false,
|
|
346
|
-
"complexType": {
|
|
347
|
-
"original": "'sm' | 'md' | 'lg' | 'small' | 'medium' | 'large'",
|
|
348
|
-
"resolved": "\"large\" | \"lg\" | \"md\" | \"medium\" | \"sm\" | \"small\"",
|
|
349
|
-
"references": {}
|
|
350
|
-
},
|
|
351
|
-
"required": false,
|
|
352
|
-
"optional": false,
|
|
353
|
-
"docs": {
|
|
354
|
-
"tags": [],
|
|
355
|
-
"text": "Controls the size of dropdown. 'sm', 'md' and 'lg' correct values and 'small', 'medium' and 'large' are deprecated"
|
|
356
|
-
},
|
|
357
|
-
"attribute": "size",
|
|
358
|
-
"reflect": false,
|
|
359
|
-
"defaultValue": "'lg'"
|
|
360
|
-
},
|
|
361
|
-
"inline": {
|
|
362
|
-
"type": "boolean",
|
|
363
|
-
"mutable": false,
|
|
364
|
-
"complexType": {
|
|
365
|
-
"original": "boolean",
|
|
366
|
-
"resolved": "boolean",
|
|
367
|
-
"references": {}
|
|
368
|
-
},
|
|
369
|
-
"required": false,
|
|
370
|
-
"optional": false,
|
|
371
|
-
"docs": {
|
|
372
|
-
"tags": [],
|
|
373
|
-
"text": "Set to true to make the width following the label text length"
|
|
374
|
-
},
|
|
375
|
-
"attribute": "inline",
|
|
376
|
-
"reflect": false,
|
|
377
|
-
"defaultValue": "false"
|
|
378
|
-
},
|
|
379
|
-
"labelPosition": {
|
|
380
|
-
"type": "string",
|
|
381
|
-
"mutable": false,
|
|
382
|
-
"complexType": {
|
|
383
|
-
"original": "'no-label' | 'inside' | 'outside'",
|
|
384
|
-
"resolved": "\"inside\" | \"no-label\" | \"outside\"",
|
|
385
|
-
"references": {}
|
|
386
|
-
},
|
|
387
|
-
"required": false,
|
|
388
|
-
"optional": false,
|
|
389
|
-
"docs": {
|
|
390
|
-
"tags": [],
|
|
391
|
-
"text": "Controls position of label"
|
|
392
|
-
},
|
|
393
|
-
"attribute": "label-position",
|
|
394
|
-
"reflect": false,
|
|
395
|
-
"defaultValue": "'no-label'"
|
|
396
|
-
},
|
|
397
|
-
"label": {
|
|
398
|
-
"type": "string",
|
|
399
|
-
"mutable": false,
|
|
400
|
-
"complexType": {
|
|
401
|
-
"original": "string",
|
|
402
|
-
"resolved": "string",
|
|
403
|
-
"references": {}
|
|
404
|
-
},
|
|
405
|
-
"required": false,
|
|
406
|
-
"optional": false,
|
|
407
|
-
"docs": {
|
|
408
|
-
"tags": [],
|
|
409
|
-
"text": "Label text for label inside & outside"
|
|
410
|
-
},
|
|
411
|
-
"attribute": "label",
|
|
412
|
-
"reflect": false
|
|
413
|
-
},
|
|
414
|
-
"state": {
|
|
415
|
-
"type": "string",
|
|
416
|
-
"mutable": false,
|
|
417
|
-
"complexType": {
|
|
418
|
-
"original": "string",
|
|
419
|
-
"resolved": "string",
|
|
420
|
-
"references": {}
|
|
421
|
-
},
|
|
422
|
-
"required": false,
|
|
423
|
-
"optional": false,
|
|
424
|
-
"docs": {
|
|
425
|
-
"tags": [],
|
|
426
|
-
"text": "Support `error` state"
|
|
427
|
-
},
|
|
428
|
-
"attribute": "state",
|
|
429
|
-
"reflect": false,
|
|
430
|
-
"defaultValue": "'default'"
|
|
431
|
-
},
|
|
432
|
-
"helper": {
|
|
433
|
-
"type": "string",
|
|
434
|
-
"mutable": false,
|
|
435
|
-
"complexType": {
|
|
436
|
-
"original": "string",
|
|
437
|
-
"resolved": "string",
|
|
438
|
-
"references": {}
|
|
439
|
-
},
|
|
440
|
-
"required": false,
|
|
441
|
-
"optional": false,
|
|
442
|
-
"docs": {
|
|
443
|
-
"tags": [],
|
|
444
|
-
"text": "Add helper text in the bottom of dropdown"
|
|
445
|
-
},
|
|
446
|
-
"attribute": "helper",
|
|
447
|
-
"reflect": false,
|
|
448
|
-
"defaultValue": "''"
|
|
449
|
-
},
|
|
450
|
-
"openDirection": {
|
|
451
|
-
"type": "string",
|
|
452
|
-
"mutable": false,
|
|
453
|
-
"complexType": {
|
|
454
|
-
"original": "'down' | 'up' | 'auto'",
|
|
455
|
-
"resolved": "\"auto\" | \"down\" | \"up\"",
|
|
456
|
-
"references": {}
|
|
457
|
-
},
|
|
458
|
-
"required": false,
|
|
459
|
-
"optional": false,
|
|
460
|
-
"docs": {
|
|
461
|
-
"tags": [],
|
|
462
|
-
"text": "Direction that the dropdown will open. By default set to auto."
|
|
463
|
-
},
|
|
464
|
-
"attribute": "open-direction",
|
|
465
|
-
"reflect": false,
|
|
466
|
-
"defaultValue": "'auto'"
|
|
467
|
-
}
|
|
468
|
-
};
|
|
469
|
-
}
|
|
470
|
-
static get states() {
|
|
471
|
-
return {
|
|
472
|
-
"optionValues": {},
|
|
473
|
-
"optionLabels": {},
|
|
474
|
-
"open": {},
|
|
475
|
-
"node": {},
|
|
476
|
-
"selectedLabel": {},
|
|
477
|
-
"selectedValue": {},
|
|
478
|
-
"selectedValuesArray": {},
|
|
479
|
-
"selectedLabelsArray": {},
|
|
480
|
-
"dropdownUniqueClass": {},
|
|
481
|
-
"openUpwards": {},
|
|
482
|
-
"dropdownMenuHeight": {},
|
|
483
|
-
"dropdownMenuSelector": {},
|
|
484
|
-
"listItemIndex": {},
|
|
485
|
-
"listItemArray": {}
|
|
486
|
-
};
|
|
487
|
-
}
|
|
488
|
-
static get events() {
|
|
489
|
-
return [{
|
|
490
|
-
"method": "inputSearch",
|
|
491
|
-
"name": "inputSearch",
|
|
492
|
-
"bubbles": true,
|
|
493
|
-
"cancelable": true,
|
|
494
|
-
"composed": true,
|
|
495
|
-
"docs": {
|
|
496
|
-
"tags": [],
|
|
497
|
-
"text": ""
|
|
498
|
-
},
|
|
499
|
-
"complexType": {
|
|
500
|
-
"original": "any",
|
|
501
|
-
"resolved": "any",
|
|
502
|
-
"references": {}
|
|
503
|
-
}
|
|
504
|
-
}];
|
|
505
|
-
}
|
|
506
|
-
static get methods() {
|
|
507
|
-
return {
|
|
508
|
-
"resetOption": {
|
|
509
|
-
"complexType": {
|
|
510
|
-
"signature": "() => Promise<void>",
|
|
511
|
-
"parameters": [],
|
|
512
|
-
"references": {
|
|
513
|
-
"Promise": {
|
|
514
|
-
"location": "global"
|
|
515
|
-
}
|
|
516
|
-
},
|
|
517
|
-
"return": "Promise<void>"
|
|
518
|
-
},
|
|
519
|
-
"docs": {
|
|
520
|
-
"text": "",
|
|
521
|
-
"tags": []
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
};
|
|
525
|
-
}
|
|
526
|
-
static get elementRef() { return "host"; }
|
|
527
|
-
static get watchers() {
|
|
528
|
-
return [{
|
|
529
|
-
"propName": "selectedOption",
|
|
530
|
-
"methodName": "changeSelectedOption"
|
|
531
|
-
}];
|
|
532
|
-
}
|
|
533
|
-
static get listeners() {
|
|
534
|
-
return [{
|
|
535
|
-
"name": "click",
|
|
536
|
-
"method": "handleDocClick",
|
|
537
|
-
"target": "document",
|
|
538
|
-
"capture": false,
|
|
539
|
-
"passive": false
|
|
540
|
-
}, {
|
|
541
|
-
"name": "keydown",
|
|
542
|
-
"method": "keyListener",
|
|
543
|
-
"target": undefined,
|
|
544
|
-
"capture": false,
|
|
545
|
-
"passive": false
|
|
546
|
-
}, {
|
|
547
|
-
"name": "selectOption",
|
|
548
|
-
"method": "selectOptionHandler",
|
|
549
|
-
"target": undefined,
|
|
550
|
-
"capture": false,
|
|
551
|
-
"passive": false
|
|
552
|
-
}];
|
|
553
|
-
}
|
|
554
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import readme from './readme.md';
|
|
2
|
-
import { formatHtmlPreview } from '../../utils/utils';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Components/Footer',
|
|
5
|
-
parameters: {
|
|
6
|
-
notes: readme,
|
|
7
|
-
layout: 'fullscreen',
|
|
8
|
-
design: [
|
|
9
|
-
{
|
|
10
|
-
name: 'Figma',
|
|
11
|
-
type: 'figma',
|
|
12
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=7568%3A298118&t=Ne6myqwca5m00de7-1',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: 'Link',
|
|
16
|
-
type: 'link',
|
|
17
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=7568%3A298118&t=Ne6myqwca5m00de7-1',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
argTypes: {
|
|
22
|
-
topPart: {
|
|
23
|
-
name: 'Top part',
|
|
24
|
-
description: 'Adds top part of the footer with more links',
|
|
25
|
-
control: {
|
|
26
|
-
type: 'boolean',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
const Template = ({ topPart }) => formatHtmlPreview(`
|
|
32
|
-
<style>
|
|
33
|
-
.demo-wrapper {
|
|
34
|
-
padding: 0;
|
|
35
|
-
margin: 0;
|
|
36
|
-
font-size: 14px;
|
|
37
|
-
}
|
|
38
|
-
</style>
|
|
39
|
-
|
|
40
|
-
<div class="demo-wrapper">
|
|
41
|
-
<div class="sdds-footer">
|
|
42
|
-
${topPart
|
|
43
|
-
? `
|
|
44
|
-
<div class="sdds-footer-top sdds-container-fluid">
|
|
45
|
-
<div class="sdds-row">
|
|
46
|
-
<div class="sdds-footer-top-col sdds-col-max sdds-col-xxlg sdds-col-xlg sdds-col-lg sdds-col-md-12 sdds-col-sm-12 sdds-col-xs-12">
|
|
47
|
-
<div class="sdds-footer-title opened">
|
|
48
|
-
<span>Title 1</span>
|
|
49
|
-
<span class="sdds-footer-top-icon">
|
|
50
|
-
<sdds-icon name="chevron_down" size="16px"></sdds-icon>
|
|
51
|
-
</span>
|
|
52
|
-
</div>
|
|
53
|
-
<ul class="sdds-footer-main-links opened">
|
|
54
|
-
<li><a href="#">Legal link</a></li>
|
|
55
|
-
<li><a href="#">Legal link</a></li>
|
|
56
|
-
<li><a href="#">Legal link</a></li>
|
|
57
|
-
<li><a href="#">Legal link</a></li>
|
|
58
|
-
</ul>
|
|
59
|
-
</div>
|
|
60
|
-
|
|
61
|
-
<div class="sdds-col-max sdds-col-xxlg sdds-col-xlg sdds-col-lg sdds-col-md-12 sdds-col-sm-12 sdds-col-xs-12">
|
|
62
|
-
<div class="sdds-footer-title">
|
|
63
|
-
<span>Title 2</span>
|
|
64
|
-
<span class="sdds-footer-top-icon">
|
|
65
|
-
<sdds-icon name="chevron_down" size="16px"></sdds-icon>
|
|
66
|
-
</span>
|
|
67
|
-
</div>
|
|
68
|
-
<ul class="sdds-footer-main-links">
|
|
69
|
-
<li><a href="#">Legal link</a></li>
|
|
70
|
-
<li><a href="#">Legal link</a></li>
|
|
71
|
-
<li><a href="#">Legal link</a></li>
|
|
72
|
-
<li><a href="#">Legal link</a></li>
|
|
73
|
-
</ul>
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
`
|
|
78
|
-
: ''}
|
|
79
|
-
<div class="sdds-footer-main">
|
|
80
|
-
<ul class="sdds-footer-main-links">
|
|
81
|
-
<li><a href="#">Legal link</a></li>
|
|
82
|
-
<li><a href="#">Legal link</a></li>
|
|
83
|
-
<li><a href="#">Legal link</a></li>
|
|
84
|
-
</ul>
|
|
85
|
-
<ul class="sdds-footer-social-links">
|
|
86
|
-
<li><a href="#">Social 1</a></li>
|
|
87
|
-
<li><a href="#">Social 1</a></li>
|
|
88
|
-
<li><a href="#">Social 1</a></li>
|
|
89
|
-
</ul>
|
|
90
|
-
<div class="sdds-footer-main-brand">
|
|
91
|
-
<p>Copyright © 2022 Scania</p>
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
`);
|
|
97
|
-
export const Default = Template.bind({});
|
|
98
|
-
Default.args = {
|
|
99
|
-
topPart: false,
|
|
100
|
-
};
|