@scania/tegel 0.0.1-beta.2 → 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 +2 -2
- 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,185 +0,0 @@
|
|
|
1
|
-
import { h, Host, } from '@stencil/core';
|
|
2
|
-
export class DropdownOption {
|
|
3
|
-
constructor() {
|
|
4
|
-
this.innerValue = undefined;
|
|
5
|
-
this.selected = false;
|
|
6
|
-
this.disabled = false;
|
|
7
|
-
this.value = undefined;
|
|
8
|
-
}
|
|
9
|
-
changeFocusHandler() {
|
|
10
|
-
this.host.focus();
|
|
11
|
-
}
|
|
12
|
-
removeFocusHandler() {
|
|
13
|
-
this.host.blur();
|
|
14
|
-
}
|
|
15
|
-
onKeyDown(event) {
|
|
16
|
-
if (event.code === 'Enter') {
|
|
17
|
-
this.selectOptionHandler({
|
|
18
|
-
value: this.value,
|
|
19
|
-
label: this.host.innerText,
|
|
20
|
-
parent: this.host.parentNode,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
componentWillLoad() {
|
|
25
|
-
this.innerValue = this.value;
|
|
26
|
-
this.isMultiSelectOption = this.host
|
|
27
|
-
.closest('sdds-dropdown')
|
|
28
|
-
.classList.contains('sdds-dropdown-multiselect');
|
|
29
|
-
}
|
|
30
|
-
selectOptionHandler(value) {
|
|
31
|
-
if (!this.disabled) {
|
|
32
|
-
const listOptions = value.parent.childNodes;
|
|
33
|
-
this.selectOption.emit(value);
|
|
34
|
-
if (!this.isMultiSelectOption) {
|
|
35
|
-
listOptions.forEach((optionEl) => {
|
|
36
|
-
// TODO: fix and enable rule
|
|
37
|
-
// eslint-disable-next-line no-param-reassign
|
|
38
|
-
optionEl.selected = false;
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
const optionCheckbox = this.host.shadowRoot.querySelector('input');
|
|
42
|
-
if (this.selected) {
|
|
43
|
-
this.selected = false;
|
|
44
|
-
if (optionCheckbox) {
|
|
45
|
-
optionCheckbox.checked = false;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
this.selected = true;
|
|
50
|
-
if (optionCheckbox) {
|
|
51
|
-
optionCheckbox.checked = true;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
render() {
|
|
57
|
-
return (h(Host, { onClick: (ev) => {
|
|
58
|
-
if (this.isMultiSelectOption) {
|
|
59
|
-
ev.stopPropagation();
|
|
60
|
-
}
|
|
61
|
-
return this.selectOptionHandler({
|
|
62
|
-
value: this.value,
|
|
63
|
-
label: this.host.innerText,
|
|
64
|
-
parent: ev.target.parentNode,
|
|
65
|
-
});
|
|
66
|
-
}, class: {
|
|
67
|
-
'selected': this.selected,
|
|
68
|
-
'sdds-dropdown-option-disabled': this.disabled,
|
|
69
|
-
}, tabindex: "-1", "aria-disabled": this.disabled }, this.isMultiSelectOption && (h("div", { class: "sdds-checkbox-item sdds-option-checkbox" }, h("label", { class: "sdds-form-label" }, h("input", { class: "sdds-form-input", type: "checkbox", checked: this.selected, disabled: this.disabled })))), h("span", { class: "sdds-option-label" }, h("slot", null)), !this.isMultiSelectOption && (h("span", { class: "sdds-option-checkmark" }, h("svg", { width: "10", height: "7", viewBox: "0 0 10 7", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M1 3L4 6L9 1", stroke: "currentColor", "stroke-width": "1.25", "stroke-linecap": "round", "stroke-linejoin": "round" }))))));
|
|
70
|
-
}
|
|
71
|
-
static get is() { return "sdds-dropdown-option"; }
|
|
72
|
-
static get encapsulation() { return "shadow"; }
|
|
73
|
-
static get originalStyleUrls() {
|
|
74
|
-
return {
|
|
75
|
-
"$": ["./../dropdown.scss"]
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
static get styleUrls() {
|
|
79
|
-
return {
|
|
80
|
-
"$": ["../dropdown.css"]
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
static get properties() {
|
|
84
|
-
return {
|
|
85
|
-
"selected": {
|
|
86
|
-
"type": "boolean",
|
|
87
|
-
"mutable": false,
|
|
88
|
-
"complexType": {
|
|
89
|
-
"original": "boolean",
|
|
90
|
-
"resolved": "boolean",
|
|
91
|
-
"references": {}
|
|
92
|
-
},
|
|
93
|
-
"required": false,
|
|
94
|
-
"optional": false,
|
|
95
|
-
"docs": {
|
|
96
|
-
"tags": [],
|
|
97
|
-
"text": "Selected set to true if selected"
|
|
98
|
-
},
|
|
99
|
-
"attribute": "selected",
|
|
100
|
-
"reflect": false,
|
|
101
|
-
"defaultValue": "false"
|
|
102
|
-
},
|
|
103
|
-
"disabled": {
|
|
104
|
-
"type": "boolean",
|
|
105
|
-
"mutable": false,
|
|
106
|
-
"complexType": {
|
|
107
|
-
"original": "boolean",
|
|
108
|
-
"resolved": "boolean",
|
|
109
|
-
"references": {}
|
|
110
|
-
},
|
|
111
|
-
"required": false,
|
|
112
|
-
"optional": false,
|
|
113
|
-
"docs": {
|
|
114
|
-
"tags": [],
|
|
115
|
-
"text": "Sets option to disabled state if true"
|
|
116
|
-
},
|
|
117
|
-
"attribute": "disabled",
|
|
118
|
-
"reflect": false,
|
|
119
|
-
"defaultValue": "false"
|
|
120
|
-
},
|
|
121
|
-
"value": {
|
|
122
|
-
"type": "string",
|
|
123
|
-
"mutable": false,
|
|
124
|
-
"complexType": {
|
|
125
|
-
"original": "string",
|
|
126
|
-
"resolved": "string",
|
|
127
|
-
"references": {}
|
|
128
|
-
},
|
|
129
|
-
"required": false,
|
|
130
|
-
"optional": false,
|
|
131
|
-
"docs": {
|
|
132
|
-
"tags": [],
|
|
133
|
-
"text": "Value is a unique string that will be used for application logic"
|
|
134
|
-
},
|
|
135
|
-
"attribute": "value",
|
|
136
|
-
"reflect": true
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
static get states() {
|
|
141
|
-
return {
|
|
142
|
-
"innerValue": {}
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
static get events() {
|
|
146
|
-
return [{
|
|
147
|
-
"method": "selectOption",
|
|
148
|
-
"name": "selectOption",
|
|
149
|
-
"bubbles": true,
|
|
150
|
-
"cancelable": true,
|
|
151
|
-
"composed": true,
|
|
152
|
-
"docs": {
|
|
153
|
-
"tags": [],
|
|
154
|
-
"text": ""
|
|
155
|
-
},
|
|
156
|
-
"complexType": {
|
|
157
|
-
"original": "any",
|
|
158
|
-
"resolved": "any",
|
|
159
|
-
"references": {}
|
|
160
|
-
}
|
|
161
|
-
}];
|
|
162
|
-
}
|
|
163
|
-
static get elementRef() { return "host"; }
|
|
164
|
-
static get listeners() {
|
|
165
|
-
return [{
|
|
166
|
-
"name": "mouseover",
|
|
167
|
-
"method": "changeFocusHandler",
|
|
168
|
-
"target": undefined,
|
|
169
|
-
"capture": false,
|
|
170
|
-
"passive": true
|
|
171
|
-
}, {
|
|
172
|
-
"name": "mouseout",
|
|
173
|
-
"method": "removeFocusHandler",
|
|
174
|
-
"target": undefined,
|
|
175
|
-
"capture": false,
|
|
176
|
-
"passive": true
|
|
177
|
-
}, {
|
|
178
|
-
"name": "keydown",
|
|
179
|
-
"method": "onKeyDown",
|
|
180
|
-
"target": undefined,
|
|
181
|
-
"capture": false,
|
|
182
|
-
"passive": false
|
|
183
|
-
}];
|
|
184
|
-
}
|
|
185
|
-
}
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import readme from './readme.md';
|
|
2
|
-
import readmeOption from './dropdown-option/readme.md';
|
|
3
|
-
import { formatHtmlPreview } from '../../utils/utils';
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Components/Dropdown',
|
|
6
|
-
parameters: {
|
|
7
|
-
layout: 'centered',
|
|
8
|
-
notes: { 'Dropdown': readme, 'Dropdown option': readmeOption },
|
|
9
|
-
design: [
|
|
10
|
-
{
|
|
11
|
-
name: 'Figma',
|
|
12
|
-
type: 'figma',
|
|
13
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=9754%3A22916&t=M7Ova7xZaoeMwb5e-1',
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: 'Link',
|
|
17
|
-
type: 'link',
|
|
18
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=9754%3A22916&t=M7Ova7xZaoeMwb5e-1',
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
},
|
|
22
|
-
argTypes: {
|
|
23
|
-
size: {
|
|
24
|
-
name: 'Size',
|
|
25
|
-
control: {
|
|
26
|
-
type: 'radio',
|
|
27
|
-
},
|
|
28
|
-
options: ['Large', 'Medium', 'Small'],
|
|
29
|
-
description: 'Size of the dropdown',
|
|
30
|
-
},
|
|
31
|
-
placeholder: {
|
|
32
|
-
name: 'Placeholder',
|
|
33
|
-
type: 'string',
|
|
34
|
-
description: 'Placeholder text when no option is selected',
|
|
35
|
-
},
|
|
36
|
-
labelPosition: {
|
|
37
|
-
name: 'Label position',
|
|
38
|
-
control: {
|
|
39
|
-
type: 'radio',
|
|
40
|
-
},
|
|
41
|
-
options: ['None', 'Inside', 'Outside'],
|
|
42
|
-
description: 'Label text position',
|
|
43
|
-
},
|
|
44
|
-
labelText: {
|
|
45
|
-
name: 'Label text',
|
|
46
|
-
control: 'text',
|
|
47
|
-
description: 'Label text helps to describe what the dropdown contains',
|
|
48
|
-
if: { arg: 'labelPosition', neq: 'None' },
|
|
49
|
-
},
|
|
50
|
-
disabled: {
|
|
51
|
-
name: 'Disabled',
|
|
52
|
-
description: 'Disables the component',
|
|
53
|
-
control: {
|
|
54
|
-
type: 'boolean',
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
state: {
|
|
58
|
-
name: 'State',
|
|
59
|
-
control: {
|
|
60
|
-
type: 'radio',
|
|
61
|
-
},
|
|
62
|
-
options: ['Default', 'Error'],
|
|
63
|
-
description: 'Support error state',
|
|
64
|
-
},
|
|
65
|
-
helper: {
|
|
66
|
-
name: 'Add helper text',
|
|
67
|
-
control: 'boolean',
|
|
68
|
-
description: 'Adds a helper text.',
|
|
69
|
-
},
|
|
70
|
-
helperText: {
|
|
71
|
-
name: 'Helper text',
|
|
72
|
-
description: 'Helper text assists the user with additional information about the dropdown',
|
|
73
|
-
control: 'text',
|
|
74
|
-
if: { arg: 'helper', eq: true },
|
|
75
|
-
},
|
|
76
|
-
defaultOption: {
|
|
77
|
-
if: { arg: 'type', neq: 'Multiselect' },
|
|
78
|
-
name: 'Default option',
|
|
79
|
-
description: 'Sets a pre-selected option and replaces placeholder',
|
|
80
|
-
control: {
|
|
81
|
-
type: 'radio',
|
|
82
|
-
},
|
|
83
|
-
options: ['No default', 'Option 1', 'Option 2', 'Option 3'],
|
|
84
|
-
},
|
|
85
|
-
openDirection: {
|
|
86
|
-
name: 'Open direction',
|
|
87
|
-
description: 'The direction the dropdown will open.',
|
|
88
|
-
control: {
|
|
89
|
-
type: 'radio',
|
|
90
|
-
},
|
|
91
|
-
options: ['Up', 'Down', 'Auto'],
|
|
92
|
-
table: {
|
|
93
|
-
summary: {
|
|
94
|
-
defaultValue: 'auto',
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
args: {
|
|
100
|
-
size: 'Large',
|
|
101
|
-
placeholder: 'Placeholder',
|
|
102
|
-
state: 'Default',
|
|
103
|
-
disabled: false,
|
|
104
|
-
labelPosition: 'None',
|
|
105
|
-
labelText: 'Label text',
|
|
106
|
-
helper: false,
|
|
107
|
-
helperText: 'Helper text',
|
|
108
|
-
defaultOption: 'Option 1',
|
|
109
|
-
openDirection: 'Auto',
|
|
110
|
-
},
|
|
111
|
-
};
|
|
112
|
-
const Template = ({ size, disabled = false, labelPosition, helper, helperText, labelText, state = 'default', placeholder, defaultOption, openDirection, }) => {
|
|
113
|
-
const stateValue = state === 'Error' ? 'error' : 'default';
|
|
114
|
-
const sizeLookup = { Large: 'lg', Medium: 'md', Small: 'sm' };
|
|
115
|
-
const labelPosLookup = { None: 'no-default', Inside: 'inside', Outside: 'outside' };
|
|
116
|
-
const defaultOptionLookup = {
|
|
117
|
-
'No default': 'no-default',
|
|
118
|
-
'Option 1': 'option-1',
|
|
119
|
-
'Option 2': 'option-2',
|
|
120
|
-
'Option 3': 'option-3',
|
|
121
|
-
};
|
|
122
|
-
return formatHtmlPreview(`
|
|
123
|
-
<style>
|
|
124
|
-
/* demo-wrapper is for demonstration purposes only*/
|
|
125
|
-
.demo-wrapper {
|
|
126
|
-
width: 300px;
|
|
127
|
-
height:200px;
|
|
128
|
-
}
|
|
129
|
-
</style>
|
|
130
|
-
|
|
131
|
-
<div class="demo-wrapper">
|
|
132
|
-
<sdds-dropdown
|
|
133
|
-
id="sdds-dropdown-reg"
|
|
134
|
-
size="${sizeLookup[size]}"
|
|
135
|
-
placeholder="${placeholder}"
|
|
136
|
-
disabled="${disabled}"
|
|
137
|
-
open-direction="${openDirection.toLowerCase()}"
|
|
138
|
-
label-position="${labelPosLookup[labelPosition]}"
|
|
139
|
-
${labelPosLookup[labelPosition] !== 'no-default' ? `label="${labelText}"` : ''}
|
|
140
|
-
${helper ? `helper="${helperText}"` : ''}
|
|
141
|
-
state="${stateValue}"
|
|
142
|
-
type="default"
|
|
143
|
-
default-option="${defaultOptionLookup[defaultOption]}" >
|
|
144
|
-
<sdds-dropdown-option value="option-1" tabindex="0" disabled>Option 1</sdds-dropdown-option>
|
|
145
|
-
<sdds-dropdown-option value="option-2" tabindex="0">Option 2</sdds-dropdown-option>
|
|
146
|
-
<sdds-dropdown-option value="option-3" tabindex="0">Option 3</sdds-dropdown-option>
|
|
147
|
-
</sdds-dropdown>
|
|
148
|
-
</div>
|
|
149
|
-
`);
|
|
150
|
-
};
|
|
151
|
-
export const WebComponentDefault = Template.bind({});
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import readme from './readme.md';
|
|
2
|
-
import readmeOption from './dropdown-option/readme.md';
|
|
3
|
-
import { formatHtmlPreview } from '../../utils/utils';
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Components/Dropdown',
|
|
6
|
-
parameters: {
|
|
7
|
-
layout: 'centered',
|
|
8
|
-
notes: { 'Dropdown': readme, 'Dropdown option': readmeOption },
|
|
9
|
-
design: [
|
|
10
|
-
{
|
|
11
|
-
name: 'Figma',
|
|
12
|
-
type: 'figma',
|
|
13
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=9754%3A22916&t=M7Ova7xZaoeMwb5e-1',
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: 'Link',
|
|
17
|
-
type: 'link',
|
|
18
|
-
url: 'https://www.figma.com/file/d8bTgEx7h694MSesi2CTLF/Tegel-UI-Library?node-id=9754%3A22916&t=M7Ova7xZaoeMwb5e-1',
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
},
|
|
22
|
-
argTypes: {
|
|
23
|
-
size: {
|
|
24
|
-
name: 'Size',
|
|
25
|
-
control: {
|
|
26
|
-
type: 'radio',
|
|
27
|
-
},
|
|
28
|
-
options: ['Large', 'Medium', 'Small'],
|
|
29
|
-
description: 'Size of the dropdown',
|
|
30
|
-
},
|
|
31
|
-
placeholder: {
|
|
32
|
-
name: 'Placeholder',
|
|
33
|
-
type: 'string',
|
|
34
|
-
description: 'Placeholder text when no option is selected',
|
|
35
|
-
},
|
|
36
|
-
labelPosition: {
|
|
37
|
-
name: 'Label position',
|
|
38
|
-
control: {
|
|
39
|
-
type: 'radio',
|
|
40
|
-
},
|
|
41
|
-
options: ['None', 'Inside', 'Outside'],
|
|
42
|
-
description: 'Label text position',
|
|
43
|
-
},
|
|
44
|
-
labelText: {
|
|
45
|
-
name: 'Label text',
|
|
46
|
-
control: 'text',
|
|
47
|
-
description: 'Label text helps to describe what the dropdown contains',
|
|
48
|
-
if: { arg: 'labelPosition', neq: 'None' },
|
|
49
|
-
},
|
|
50
|
-
disabled: {
|
|
51
|
-
name: 'Disabled',
|
|
52
|
-
description: 'Disables the component',
|
|
53
|
-
control: {
|
|
54
|
-
type: 'boolean',
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
state: {
|
|
58
|
-
name: 'State',
|
|
59
|
-
control: {
|
|
60
|
-
type: 'radio',
|
|
61
|
-
},
|
|
62
|
-
options: ['Default', 'Error'],
|
|
63
|
-
description: 'Support error state',
|
|
64
|
-
},
|
|
65
|
-
helper: {
|
|
66
|
-
name: 'Add helper text',
|
|
67
|
-
control: 'boolean',
|
|
68
|
-
description: 'Adds a helper text.',
|
|
69
|
-
},
|
|
70
|
-
helperText: {
|
|
71
|
-
name: 'Helper text',
|
|
72
|
-
description: 'Helper text assists the user with additional information about the dropdown',
|
|
73
|
-
control: 'text',
|
|
74
|
-
if: { arg: 'helper', eq: true },
|
|
75
|
-
},
|
|
76
|
-
multiDefaultOption: {
|
|
77
|
-
name: 'Default options',
|
|
78
|
-
description: 'Sets a pre-selected option and replaces placeholder',
|
|
79
|
-
if: { arg: 'type', neq: 'Default' },
|
|
80
|
-
control: {
|
|
81
|
-
type: 'check',
|
|
82
|
-
},
|
|
83
|
-
options: ['Option 1', 'Option 2', 'Option 3'],
|
|
84
|
-
},
|
|
85
|
-
openDirection: {
|
|
86
|
-
name: 'Open direction',
|
|
87
|
-
description: 'The direction the dropdown will open.',
|
|
88
|
-
control: {
|
|
89
|
-
type: 'radio',
|
|
90
|
-
},
|
|
91
|
-
options: ['Up', 'Down', 'Auto'],
|
|
92
|
-
table: {
|
|
93
|
-
summary: {
|
|
94
|
-
defaultValue: 'auto',
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
args: {
|
|
100
|
-
size: 'Large',
|
|
101
|
-
placeholder: 'Placeholder',
|
|
102
|
-
state: 'Default',
|
|
103
|
-
disabled: false,
|
|
104
|
-
labelPosition: 'None',
|
|
105
|
-
labelText: 'Label text',
|
|
106
|
-
helper: false,
|
|
107
|
-
helperText: 'Helper text',
|
|
108
|
-
multiDefaultOption: ['Option 1', 'Option 2'],
|
|
109
|
-
openDirection: 'Auto',
|
|
110
|
-
},
|
|
111
|
-
};
|
|
112
|
-
const Template = ({ size, disabled = false, labelPosition, labelText, helper, helperText, state = 'default', placeholder, multiDefaultOption, openDirection, }) => {
|
|
113
|
-
const stateValue = state === 'Error' ? 'error' : 'default';
|
|
114
|
-
const sizeLookup = { Large: 'lg', Medium: 'md', Small: 'sm' };
|
|
115
|
-
const labelPosLookup = { None: 'no-default', Inside: 'inside', Outside: 'outside' };
|
|
116
|
-
const multiDefaultOptionValue = multiDefaultOption.map((value) => value.toLowerCase().replace(' ', '-'));
|
|
117
|
-
return formatHtmlPreview(`
|
|
118
|
-
<style>
|
|
119
|
-
/* demo-wrapper is for demonstration purposes only*/
|
|
120
|
-
.demo-wrapper {
|
|
121
|
-
width: 300px;
|
|
122
|
-
height:200px;
|
|
123
|
-
}
|
|
124
|
-
</style>
|
|
125
|
-
|
|
126
|
-
<div class="demo-wrapper">
|
|
127
|
-
<sdds-dropdown
|
|
128
|
-
id="sdds-dropdown-reg"
|
|
129
|
-
size="${sizeLookup[size]}"
|
|
130
|
-
placeholder="${placeholder}"
|
|
131
|
-
disabled="${disabled}"
|
|
132
|
-
open-direction="${openDirection.toLowerCase()}"
|
|
133
|
-
label-position="${labelPosLookup[labelPosition]}"
|
|
134
|
-
${labelPosLookup[labelPosition] !== 'no-default' ? `label="${labelText}"` : ''}
|
|
135
|
-
${helper ? `helper="${helperText}"` : ''}
|
|
136
|
-
state="${stateValue}"
|
|
137
|
-
type="multiselect"
|
|
138
|
-
default-option="${multiDefaultOptionValue}" >
|
|
139
|
-
<sdds-dropdown-option value="option-1" tabindex="0">Option 1</sdds-dropdown-option>
|
|
140
|
-
<sdds-dropdown-option value="option-2" tabindex="0" disabled>Option 2</sdds-dropdown-option>
|
|
141
|
-
<sdds-dropdown-option value="option-3" tabindex="0">Option 3</sdds-dropdown-option>
|
|
142
|
-
</sdds-dropdown>
|
|
143
|
-
</div>
|
|
144
|
-
`);
|
|
145
|
-
};
|
|
146
|
-
export const WebComponentMultiselect = Template.bind({});
|