@otto-de/b2b-core-components 1.31.3 → 1.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/b2b-core-components/b2b-core-components.esm.js +1 -1
- package/dist/b2b-core-components/{p-61bc1384.entry.js → p-01f46118.entry.js} +1 -1
- package/dist/b2b-core-components/{p-6913515c.entry.js → p-0322b052.entry.js} +1 -1
- package/dist/b2b-core-components/{p-6536595a.entry.js → p-092855b3.entry.js} +1 -1
- package/dist/b2b-core-components/{p-f5b69b85.entry.js → p-0bd177d4.entry.js} +1 -1
- package/dist/b2b-core-components/p-0bf2c192.entry.js +1 -0
- package/dist/b2b-core-components/{p-a6ccf7f6.entry.js → p-15df2a47.entry.js} +1 -1
- package/dist/b2b-core-components/{p-74db37ef.entry.js → p-16872771.entry.js} +1 -1
- package/dist/b2b-core-components/{p-72dbc623.entry.js → p-190a7350.entry.js} +1 -1
- package/dist/b2b-core-components/{p-3d881765.entry.js → p-1abe3f2f.entry.js} +1 -1
- package/dist/b2b-core-components/p-1cfaf44a.js +1 -0
- package/dist/b2b-core-components/{p-05010d10.entry.js → p-1d6f73dd.entry.js} +1 -1
- package/dist/b2b-core-components/{p-71a4c9da.entry.js → p-26755654.entry.js} +1 -1
- package/dist/b2b-core-components/p-28a06853.entry.js +1 -0
- package/dist/b2b-core-components/{p-ca46f7fe.entry.js → p-2a2653c2.entry.js} +1 -1
- package/dist/b2b-core-components/{p-b9fed5dc.entry.js → p-2d625559.entry.js} +1 -1
- package/dist/b2b-core-components/{p-42058858.entry.js → p-3a088f2b.entry.js} +1 -1
- package/dist/b2b-core-components/p-3f8dc6e5.entry.js +1 -0
- package/dist/b2b-core-components/{p-a155219a.entry.js → p-40371f89.entry.js} +1 -1
- package/dist/b2b-core-components/{p-b510e8c5.entry.js → p-521303c4.entry.js} +1 -1
- package/dist/b2b-core-components/{p-9efb72c4.entry.js → p-58e9953b.entry.js} +1 -1
- package/dist/b2b-core-components/{p-e56705a6.entry.js → p-639d68a2.entry.js} +1 -1
- package/dist/b2b-core-components/{p-025896df.entry.js → p-660c758b.entry.js} +1 -1
- package/dist/b2b-core-components/p-67484ecc.entry.js +1 -0
- package/dist/b2b-core-components/{p-d13c613b.entry.js → p-6749d668.entry.js} +1 -1
- package/dist/b2b-core-components/{p-943a3829.entry.js → p-6c60d337.entry.js} +1 -1
- package/dist/b2b-core-components/p-6d64a994.entry.js +1 -0
- package/dist/b2b-core-components/{p-5077207f.entry.js → p-797c85c2.entry.js} +1 -1
- package/dist/b2b-core-components/{p-359e5f9d.entry.js → p-7df12ddf.entry.js} +1 -1
- package/dist/b2b-core-components/{p-d1c8105b.entry.js → p-82a2809e.entry.js} +1 -1
- package/dist/b2b-core-components/{p-66ab9de5.entry.js → p-848e4af7.entry.js} +1 -1
- package/dist/b2b-core-components/p-9fb493de.entry.js +1 -0
- package/dist/b2b-core-components/{p-2e0f9821.entry.js → p-b1191aa7.entry.js} +1 -1
- package/dist/b2b-core-components/{p-6ae8c29f.entry.js → p-bade1cab.entry.js} +1 -1
- package/dist/b2b-core-components/{p-1036bf3d.entry.js → p-bf9c8817.entry.js} +1 -1
- package/dist/b2b-core-components/p-d88113f5.entry.js +1 -0
- package/dist/b2b-core-components/{p-e78f9131.entry.js → p-db92de92.entry.js} +1 -1
- package/dist/b2b-core-components/{p-39a9ff8d.entry.js → p-dcef84a5.entry.js} +1 -1
- package/dist/b2b-core-components/{p-bd567ca9.entry.js → p-e2518c43.entry.js} +1 -1
- package/dist/b2b-core-components/{p-301695a4.entry.js → p-e7590b6e.entry.js} +1 -1
- package/dist/b2b-core-components/p-ed5c6006.entry.js +1 -0
- package/dist/b2b-core-components/{p-11f5ef4c.entry.js → p-ef598009.entry.js} +1 -1
- package/dist/b2b-core-components/{p-ccff4b4e.entry.js → p-f661154c.entry.js} +1 -1
- package/dist/b2b-core-components/{p-9c76af72.entry.js → p-fb0338a8.entry.js} +1 -1
- package/dist/b2b-core-components/{p-fc73eb96.entry.js → p-fc431bbe.entry.js} +1 -1
- package/dist/b2b-core-components/{p-46fc97cc.entry.js → p-fedefca2.entry.js} +1 -1
- package/dist/b2b-core-components/{p-27d8f295.entry.js → p-ff6a0874.entry.js} +1 -1
- package/dist/cjs/b2b-button_2.cjs.entry.js +1 -1
- package/dist/cjs/b2b-chip-component_2.cjs.entry.js +2 -2
- package/dist/cjs/b2b-core-components.cjs.js +1 -1
- package/dist/cjs/b2b-custom-dropdown-option.cjs.entry.js +57 -0
- package/dist/cjs/b2b-custom-dropdown.cjs.entry.js +94 -0
- package/dist/cjs/b2b-date-picker-days_5.cjs.entry.js +9 -9
- package/dist/cjs/b2b-dropdown.cjs.entry.js +10 -4
- package/dist/cjs/b2b-flyout-menu-option.cjs.entry.js +1 -1
- package/dist/cjs/b2b-flyout-menu.cjs.entry.js +5 -23
- package/dist/cjs/b2b-grid-col.cjs.entry.js +1 -1
- package/dist/cjs/b2b-grid-row.cjs.entry.js +2 -2
- package/dist/cjs/b2b-grid.cjs.entry.js +1 -1
- package/dist/cjs/b2b-input-group_2.cjs.entry.js +3 -3
- package/dist/cjs/b2b-input-label.cjs.entry.js +2 -2
- package/dist/cjs/b2b-input_2.cjs.entry.js +5 -5
- package/dist/cjs/b2b-label.cjs.entry.js +2 -2
- package/dist/cjs/b2b-modal.cjs.entry.js +2 -2
- package/dist/cjs/b2b-multiselect-dropdown.cjs.entry.js +3 -3
- package/dist/cjs/b2b-pagination.cjs.entry.js +1 -1
- package/dist/cjs/b2b-paragraph.cjs.entry.js +2 -2
- package/dist/cjs/b2b-progress-bar.cjs.entry.js +3 -3
- package/dist/cjs/b2b-radio-button.cjs.entry.js +2 -2
- package/dist/cjs/b2b-radio-group.cjs.entry.js +2 -2
- package/dist/cjs/b2b-required-separator.cjs.entry.js +1 -1
- package/dist/cjs/b2b-rounded-icon.cjs.entry.js +4 -4
- package/dist/cjs/b2b-scrollable-container.cjs.entry.js +1 -1
- package/dist/cjs/b2b-search.cjs.entry.js +1 -1
- package/dist/cjs/b2b-separator.cjs.entry.js +1 -1
- package/dist/cjs/b2b-shimmer.cjs.entry.js +1 -1
- package/dist/cjs/b2b-snackbar.cjs.entry.js +4 -4
- package/dist/cjs/b2b-tab-group.cjs.entry.js +1 -1
- package/dist/cjs/b2b-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/b2b-tab.cjs.entry.js +2 -2
- package/dist/cjs/b2b-table-cell_2.cjs.entry.js +3 -3
- package/dist/cjs/b2b-table-row.cjs.entry.js +2 -2
- package/dist/cjs/b2b-table-rowgroup.cjs.entry.js +2 -2
- package/dist/cjs/b2b-table.cjs.entry.js +2 -2
- package/dist/cjs/b2b-textarea.cjs.entry.js +2 -2
- package/dist/cjs/b2b-toggle-button.cjs.entry.js +3 -3
- package/dist/cjs/b2b-toggle-chip.cjs.entry.js +3 -3
- package/dist/cjs/b2b-toggle-group.cjs.entry.js +2 -2
- package/dist/cjs/b2b-toggle-switch.cjs.entry.js +4 -4
- package/dist/cjs/b2b-tooltip.cjs.entry.js +3 -3
- package/dist/cjs/b2b-wizard-icon.cjs.entry.js +1 -1
- package/dist/cjs/b2b-wizard-step.cjs.entry.js +2 -2
- package/dist/cjs/b2b-wizard.cjs.entry.js +1 -1
- package/dist/cjs/index-668808fd.js +12 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/utils-7919f19f.js +22 -0
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/custom-dropdown/custom-dropdown-option.css +296 -0
- package/dist/collection/components/custom-dropdown/custom-dropdown-option.js +247 -0
- package/dist/collection/components/custom-dropdown/custom-dropdown.css +280 -0
- package/dist/collection/components/custom-dropdown/custom-dropdown.e2e.js +66 -0
- package/dist/collection/components/custom-dropdown/custom-dropdown.js +227 -0
- package/dist/collection/components/custom-dropdown/custom-dropdown.stories.js +197 -0
- package/dist/collection/components/date-picker/date-picker-days-header.js +1 -1
- package/dist/collection/components/date-picker/date-picker-days.js +1 -1
- package/dist/collection/components/date-picker/date-picker-header.js +5 -5
- package/dist/collection/components/date-picker/date-picker-months.js +1 -1
- package/dist/collection/components/date-picker/date-picker-years.js +1 -1
- package/dist/collection/components/dropdown/dropdown.css +1 -1
- package/dist/collection/components/dropdown/dropdown.js +9 -3
- package/dist/collection/components/flyout-menu/flyout-menu-option.js +1 -1
- package/dist/collection/components/flyout-menu/flyout-menu.js +3 -3
- package/dist/collection/components/grid/column.js +1 -1
- package/dist/collection/components/grid/grid.js +1 -1
- package/dist/collection/components/grid/row.js +2 -2
- package/dist/collection/components/input/input.js +4 -4
- package/dist/collection/components/input-group/input-group.js +1 -1
- package/dist/collection/components/input-label/input-label.js +2 -2
- package/dist/collection/components/input-list/input-list-option.js +1 -1
- package/dist/collection/components/input-list/input-list.js +2 -2
- package/dist/collection/components/label/label.js +2 -2
- package/dist/collection/components/modal/modal.js +2 -2
- package/dist/collection/components/multiselect-dropdown/multiselect-dropdown.js +3 -3
- package/dist/collection/components/multiselect-dropdown/multiselect-option/multiselect-option.js +2 -2
- package/dist/collection/components/pagination/pagination.js +1 -1
- package/dist/collection/components/paragraph/paragraph.js +2 -2
- package/dist/collection/components/progress-bar/progress-bar.js +3 -3
- package/dist/collection/components/radio/radio.js +2 -2
- package/dist/collection/components/radio-group/radio-group.js +2 -2
- package/dist/collection/components/required-separator/required-separator.js +1 -1
- package/dist/collection/components/rounded-icon/rounded-icon.js +4 -4
- package/dist/collection/components/scrollable-container/scrollable-container.js +1 -1
- package/dist/collection/components/search/search.js +1 -1
- package/dist/collection/components/separator/separator.js +1 -1
- package/dist/collection/components/shimmer/shimmer.js +1 -1
- package/dist/collection/components/snackbar/snackbar.js +4 -4
- package/dist/collection/components/spinner/spinner.js +1 -1
- package/dist/collection/components/tab/tab.js +2 -2
- package/dist/collection/components/tab-group/tab-group.js +1 -1
- package/dist/collection/components/tab-panel/tab-panel.js +1 -1
- package/dist/collection/components/table/table-cell/table-cell.js +2 -2
- package/dist/collection/components/table/table-header/table-header.js +1 -1
- package/dist/collection/components/table/table-row/table-row.js +2 -2
- package/dist/collection/components/table/table-rowgroup/table-rowgroup.js +2 -2
- package/dist/collection/components/table/table.js +2 -2
- package/dist/collection/components/textarea/textarea.js +2 -2
- package/dist/collection/components/toggle-button/toggle-button.js +3 -3
- package/dist/collection/components/toggle-chip/toggle-chip.js +3 -3
- package/dist/collection/components/toggle-group/toggle-group.js +2 -2
- package/dist/collection/components/toggle-switch/toggle-switch.js +4 -4
- package/dist/collection/components/tooltip/tooltip.js +3 -3
- package/dist/collection/components/wizard/wizard-step.js +2 -2
- package/dist/collection/components/wizard/wizard.js +1 -1
- package/dist/collection/components/wizard-icon/wizard-icon.js +1 -1
- package/dist/components/b2b-background-box.js +1 -51
- package/dist/components/b2b-custom-dropdown-option.d.ts +11 -0
- package/dist/components/b2b-custom-dropdown-option.js +87 -0
- package/dist/components/b2b-custom-dropdown.d.ts +11 -0
- package/dist/components/b2b-custom-dropdown.js +142 -0
- package/dist/components/b2b-dropdown.js +10 -4
- package/dist/components/b2b-flyout-menu-option.js +1 -1
- package/dist/components/b2b-flyout-menu.js +4 -22
- package/dist/components/b2b-grid-col.js +1 -1
- package/dist/components/b2b-grid-row.js +2 -2
- package/dist/components/b2b-grid.js +1 -1
- package/dist/components/b2b-label.js +2 -2
- package/dist/components/b2b-modal.js +2 -2
- package/dist/components/b2b-multiselect-dropdown.js +3 -3
- package/dist/components/b2b-pagination.js +1 -1
- package/dist/components/b2b-paragraph.js +2 -2
- package/dist/components/b2b-progress-bar.js +3 -3
- package/dist/components/b2b-radio-button.js +2 -2
- package/dist/components/b2b-radio-group.js +2 -2
- package/dist/components/b2b-required-separator.js +1 -1
- package/dist/components/b2b-scrollable-container.js +1 -1
- package/dist/components/b2b-search.js +1 -1
- package/dist/components/b2b-shimmer.js +1 -1
- package/dist/components/b2b-snackbar.js +4 -4
- package/dist/components/b2b-tab-group.js +1 -1
- package/dist/components/b2b-tab-panel.js +1 -1
- package/dist/components/b2b-tab.js +2 -2
- package/dist/components/b2b-table-row.js +3 -3
- package/dist/components/b2b-table-rowgroup.js +3 -3
- package/dist/components/b2b-table.js +3 -3
- package/dist/components/b2b-textarea.js +2 -2
- package/dist/components/b2b-toggle-button.js +3 -3
- package/dist/components/b2b-toggle-chip.js +3 -3
- package/dist/components/b2b-toggle-group.js +2 -2
- package/dist/components/b2b-toggle-switch.js +4 -4
- package/dist/components/b2b-tooltip.js +3 -3
- package/dist/components/b2b-wizard-step.js +2 -2
- package/dist/components/b2b-wizard.js +1 -1
- package/dist/components/background-box.js +53 -0
- package/dist/components/date-picker-days-header.js +1 -1
- package/dist/components/date-picker-days.js +1 -1
- package/dist/components/date-picker-header.js +5 -5
- package/dist/components/date-picker-months.js +1 -1
- package/dist/components/date-picker-years.js +1 -1
- package/dist/components/input-group.js +1 -1
- package/dist/components/input-label.js +2 -2
- package/dist/components/input-list-option.js +1 -1
- package/dist/components/input-list.js +2 -2
- package/dist/components/input.js +4 -4
- package/dist/components/multiselect-option.js +2 -2
- package/dist/components/rounded-icon.js +4 -4
- package/dist/components/separator.js +1 -1
- package/dist/components/spinner.js +1 -1
- package/dist/components/table-cell.js +3 -3
- package/dist/components/table-header.js +2 -2
- package/dist/components/utils.js +18 -68
- package/dist/components/utils2.js +70 -0
- package/dist/components/wizard-icon.js +1 -1
- package/dist/custom-elements.json +74 -0
- package/dist/esm/b2b-button_2.entry.js +1 -1
- package/dist/esm/b2b-chip-component_2.entry.js +2 -2
- package/dist/esm/b2b-core-components.js +1 -1
- package/dist/esm/b2b-custom-dropdown-option.entry.js +53 -0
- package/dist/esm/b2b-custom-dropdown.entry.js +90 -0
- package/dist/esm/b2b-date-picker-days_5.entry.js +9 -9
- package/dist/esm/b2b-dropdown.entry.js +10 -4
- package/dist/esm/b2b-flyout-menu-option.entry.js +1 -1
- package/dist/esm/b2b-flyout-menu.entry.js +4 -22
- package/dist/esm/b2b-grid-col.entry.js +1 -1
- package/dist/esm/b2b-grid-row.entry.js +2 -2
- package/dist/esm/b2b-grid.entry.js +1 -1
- package/dist/esm/b2b-input-group_2.entry.js +3 -3
- package/dist/esm/b2b-input-label.entry.js +2 -2
- package/dist/esm/b2b-input_2.entry.js +5 -5
- package/dist/esm/b2b-label.entry.js +2 -2
- package/dist/esm/b2b-modal.entry.js +2 -2
- package/dist/esm/b2b-multiselect-dropdown.entry.js +3 -3
- package/dist/esm/b2b-pagination.entry.js +1 -1
- package/dist/esm/b2b-paragraph.entry.js +2 -2
- package/dist/esm/b2b-progress-bar.entry.js +3 -3
- package/dist/esm/b2b-radio-button.entry.js +2 -2
- package/dist/esm/b2b-radio-group.entry.js +2 -2
- package/dist/esm/b2b-required-separator.entry.js +1 -1
- package/dist/esm/b2b-rounded-icon.entry.js +4 -4
- package/dist/esm/b2b-scrollable-container.entry.js +1 -1
- package/dist/esm/b2b-search.entry.js +1 -1
- package/dist/esm/b2b-separator.entry.js +1 -1
- package/dist/esm/b2b-shimmer.entry.js +1 -1
- package/dist/esm/b2b-snackbar.entry.js +4 -4
- package/dist/esm/b2b-tab-group.entry.js +1 -1
- package/dist/esm/b2b-tab-panel.entry.js +1 -1
- package/dist/esm/b2b-tab.entry.js +2 -2
- package/dist/esm/b2b-table-cell_2.entry.js +3 -3
- package/dist/esm/b2b-table-row.entry.js +2 -2
- package/dist/esm/b2b-table-rowgroup.entry.js +2 -2
- package/dist/esm/b2b-table.entry.js +2 -2
- package/dist/esm/b2b-textarea.entry.js +2 -2
- package/dist/esm/b2b-toggle-button.entry.js +3 -3
- package/dist/esm/b2b-toggle-chip.entry.js +3 -3
- package/dist/esm/b2b-toggle-group.entry.js +2 -2
- package/dist/esm/b2b-toggle-switch.entry.js +4 -4
- package/dist/esm/b2b-tooltip.entry.js +3 -3
- package/dist/esm/b2b-wizard-icon.entry.js +1 -1
- package/dist/esm/b2b-wizard-step.entry.js +2 -2
- package/dist/esm/b2b-wizard.entry.js +1 -1
- package/dist/esm/index-ab9eb36d.js +12 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/utils-17e4d283.js +20 -0
- package/dist/types/components/custom-dropdown/custom-dropdown-option.d.ts +29 -0
- package/dist/types/components/custom-dropdown/custom-dropdown.d.ts +29 -0
- package/dist/types/components/custom-dropdown/custom-dropdown.stories.d.ts +12 -0
- package/dist/types/components.d.ts +157 -0
- package/dist/web-types.json +176 -1
- package/package.json +2 -2
- package/dist/b2b-core-components/p-383d0a10.entry.js +0 -1
- package/dist/b2b-core-components/p-3845cd27.entry.js +0 -1
- package/dist/b2b-core-components/p-3f592e92.entry.js +0 -1
- package/dist/b2b-core-components/p-400fa973.entry.js +0 -1
- package/dist/b2b-core-components/p-db205434.entry.js +0 -1
- package/dist/b2b-core-components/p-f5786cad.entry.js +0 -1
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { h, Host, } from "@stencil/core";
|
|
2
|
+
import { isClickOutside } from "../../utils/utils";
|
|
3
|
+
export class B2bCustomDropdownComponent {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.toggleMenu = () => {
|
|
6
|
+
this.opened = !this.opened;
|
|
7
|
+
};
|
|
8
|
+
this.closeMenu = () => {
|
|
9
|
+
this.opened = false;
|
|
10
|
+
};
|
|
11
|
+
this.handleInput = (event) => {
|
|
12
|
+
if (this.disabled) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
this.value = event.target.value.toLowerCase();
|
|
16
|
+
this.allOptions.forEach(option => {
|
|
17
|
+
var _a;
|
|
18
|
+
const optionValue = ((_a = option.option) === null || _a === void 0 ? void 0 : _a.toLowerCase()) ||
|
|
19
|
+
'';
|
|
20
|
+
if (optionValue.includes(this.value)) {
|
|
21
|
+
option.classList.remove('b2b-custom-dropdown__option--hidden');
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
option.classList.add('b2b-custom-dropdown__option--hidden');
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
this.placeholder = undefined;
|
|
29
|
+
this.disabled = false;
|
|
30
|
+
this.dropshadow = false;
|
|
31
|
+
this.border = false;
|
|
32
|
+
this.autoDisableSearch = true;
|
|
33
|
+
this.opened = false;
|
|
34
|
+
this.selectedOption = null;
|
|
35
|
+
this.value = '';
|
|
36
|
+
this.allOptions = [];
|
|
37
|
+
}
|
|
38
|
+
handleOptionSelected(event) {
|
|
39
|
+
event.stopPropagation();
|
|
40
|
+
const selectedValue = event.detail.selectedOption;
|
|
41
|
+
this.selectedOption = selectedValue;
|
|
42
|
+
this.allOptions.forEach(option => {
|
|
43
|
+
if (option.option === selectedValue) {
|
|
44
|
+
option.selected = true;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
option.selected = false;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
connectedCallback() {
|
|
52
|
+
this.initializeSlottedOptions();
|
|
53
|
+
const children = Array.from(this.hostElement.children).filter(x => !x.hasAttribute('option'));
|
|
54
|
+
if (children.length === 0) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
this.triggerEl = children[0];
|
|
58
|
+
this.triggerEl.addEventListener('click', this.toggleMenu, true);
|
|
59
|
+
}
|
|
60
|
+
initializeSlottedOptions() {
|
|
61
|
+
this.allOptions = Array.from(this.hostElement.querySelectorAll('[slot="option"]'));
|
|
62
|
+
}
|
|
63
|
+
handleClickOutside(event) {
|
|
64
|
+
if (isClickOutside(event, this.hostElement)) {
|
|
65
|
+
this.closeMenu();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
render() {
|
|
69
|
+
return (h(Host, { key: '4ab50ad17c43f38eae747029fa3d40a5c3248020' }, h("div", { key: '53cf5f6124a02eb89cb110d264529c938c300a38', class: "b2b-custom-dropdown__trigger" }, h("slot", { key: '52704de85cf40a3f281b2d286bf805063307803c', name: "trigger" })), h("div", { key: 'a740c4001a70a1d989ede124484ee01e0b5b7ba5', class: {
|
|
70
|
+
'b2b-custom-dropdown': true,
|
|
71
|
+
'b2b-custom-dropdown--on': this.opened && !this.disabled,
|
|
72
|
+
'b2b-custom-dropdown--drop-shadow': this.dropshadow,
|
|
73
|
+
'b2b-custom-dropdown--border': this.border,
|
|
74
|
+
} }, h("b2b-background-box", { key: 'f15f9489ddc9ffe94ee3b4b2a6236b97fdbe86ba', noPadding: true, borderTop: "none", borderBottom: "none", borderRight: "none", borderLeft: "none" }, h("div", { key: '7c578f211b4afeae771d9f09551fffc70c212315', class: {
|
|
75
|
+
'b2b-custom-dropdown-search': true,
|
|
76
|
+
'b2b-custom-dropdown-search--enabled': this.allOptions.length >= 6 && !this.disabled,
|
|
77
|
+
} }, h("b2b-input", { key: '6be5918919c8110a0020126f1b8f29794f3d9c1c', placeholder: this.placeholder, "onB2b-input": this.handleInput }, h("b2b-icon-100", { key: 'a1e3e511eaa8487dfb964ab24ee0f1e9bafbe10b', icon: "b2b_icon-search", slot: "end" })))), h("div", { key: '2daf4ce8c49192881fcfeb33ca35fd04835f3d60', class: this.allOptions.length >= 6
|
|
78
|
+
? 'b2b-custom-dropdown__options-scroll-container'
|
|
79
|
+
: 'b2b-custom-dropdown__options-container' }, h("slot", { key: '328ae2c6ae90b0fc45ba1c1c4e88736d73f021cc', name: "option" })))));
|
|
80
|
+
}
|
|
81
|
+
static get is() { return "b2b-custom-dropdown"; }
|
|
82
|
+
static get encapsulation() { return "shadow"; }
|
|
83
|
+
static get originalStyleUrls() {
|
|
84
|
+
return {
|
|
85
|
+
"$": ["custom-dropdown.scss"]
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
static get styleUrls() {
|
|
89
|
+
return {
|
|
90
|
+
"$": ["custom-dropdown.css"]
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
static get properties() {
|
|
94
|
+
return {
|
|
95
|
+
"placeholder": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"mutable": false,
|
|
98
|
+
"complexType": {
|
|
99
|
+
"original": "string",
|
|
100
|
+
"resolved": "string",
|
|
101
|
+
"references": {}
|
|
102
|
+
},
|
|
103
|
+
"required": false,
|
|
104
|
+
"optional": false,
|
|
105
|
+
"docs": {
|
|
106
|
+
"tags": [],
|
|
107
|
+
"text": "The placeholder shown in the input field."
|
|
108
|
+
},
|
|
109
|
+
"attribute": "placeholder",
|
|
110
|
+
"reflect": true
|
|
111
|
+
},
|
|
112
|
+
"disabled": {
|
|
113
|
+
"type": "boolean",
|
|
114
|
+
"mutable": false,
|
|
115
|
+
"complexType": {
|
|
116
|
+
"original": "boolean",
|
|
117
|
+
"resolved": "boolean",
|
|
118
|
+
"references": {}
|
|
119
|
+
},
|
|
120
|
+
"required": false,
|
|
121
|
+
"optional": false,
|
|
122
|
+
"docs": {
|
|
123
|
+
"tags": [],
|
|
124
|
+
"text": "Whether the dropdown is disabled. Default is false."
|
|
125
|
+
},
|
|
126
|
+
"attribute": "disabled",
|
|
127
|
+
"reflect": true,
|
|
128
|
+
"defaultValue": "false"
|
|
129
|
+
},
|
|
130
|
+
"dropshadow": {
|
|
131
|
+
"type": "boolean",
|
|
132
|
+
"mutable": false,
|
|
133
|
+
"complexType": {
|
|
134
|
+
"original": "boolean",
|
|
135
|
+
"resolved": "boolean",
|
|
136
|
+
"references": {}
|
|
137
|
+
},
|
|
138
|
+
"required": false,
|
|
139
|
+
"optional": false,
|
|
140
|
+
"docs": {
|
|
141
|
+
"tags": [],
|
|
142
|
+
"text": "Whether the dropdown should have a drop shadow. Default is false."
|
|
143
|
+
},
|
|
144
|
+
"attribute": "dropshadow",
|
|
145
|
+
"reflect": true,
|
|
146
|
+
"defaultValue": "false"
|
|
147
|
+
},
|
|
148
|
+
"border": {
|
|
149
|
+
"type": "boolean",
|
|
150
|
+
"mutable": false,
|
|
151
|
+
"complexType": {
|
|
152
|
+
"original": "boolean",
|
|
153
|
+
"resolved": "boolean",
|
|
154
|
+
"references": {}
|
|
155
|
+
},
|
|
156
|
+
"required": false,
|
|
157
|
+
"optional": false,
|
|
158
|
+
"docs": {
|
|
159
|
+
"tags": [],
|
|
160
|
+
"text": "Whether the dropdown should have a border. Default is false."
|
|
161
|
+
},
|
|
162
|
+
"attribute": "border",
|
|
163
|
+
"reflect": true,
|
|
164
|
+
"defaultValue": "false"
|
|
165
|
+
},
|
|
166
|
+
"autoDisableSearch": {
|
|
167
|
+
"type": "boolean",
|
|
168
|
+
"mutable": false,
|
|
169
|
+
"complexType": {
|
|
170
|
+
"original": "boolean",
|
|
171
|
+
"resolved": "boolean",
|
|
172
|
+
"references": {}
|
|
173
|
+
},
|
|
174
|
+
"required": false,
|
|
175
|
+
"optional": false,
|
|
176
|
+
"docs": {
|
|
177
|
+
"tags": [],
|
|
178
|
+
"text": "Search is automatically disabled for lists with fewer than six options."
|
|
179
|
+
},
|
|
180
|
+
"attribute": "auto-disable-search",
|
|
181
|
+
"reflect": false,
|
|
182
|
+
"defaultValue": "true"
|
|
183
|
+
},
|
|
184
|
+
"opened": {
|
|
185
|
+
"type": "boolean",
|
|
186
|
+
"mutable": true,
|
|
187
|
+
"complexType": {
|
|
188
|
+
"original": "boolean",
|
|
189
|
+
"resolved": "boolean",
|
|
190
|
+
"references": {}
|
|
191
|
+
},
|
|
192
|
+
"required": false,
|
|
193
|
+
"optional": false,
|
|
194
|
+
"docs": {
|
|
195
|
+
"tags": [],
|
|
196
|
+
"text": "Internal: if the dropdown is opened"
|
|
197
|
+
},
|
|
198
|
+
"attribute": "opened",
|
|
199
|
+
"reflect": false,
|
|
200
|
+
"defaultValue": "false"
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
static get states() {
|
|
205
|
+
return {
|
|
206
|
+
"selectedOption": {},
|
|
207
|
+
"value": {},
|
|
208
|
+
"allOptions": {}
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
static get elementRef() { return "hostElement"; }
|
|
212
|
+
static get listeners() {
|
|
213
|
+
return [{
|
|
214
|
+
"name": "b2b-custom-dropdown-option-selected",
|
|
215
|
+
"method": "handleOptionSelected",
|
|
216
|
+
"target": undefined,
|
|
217
|
+
"capture": false,
|
|
218
|
+
"passive": false
|
|
219
|
+
}, {
|
|
220
|
+
"name": "click",
|
|
221
|
+
"method": "handleClickOutside",
|
|
222
|
+
"target": "document",
|
|
223
|
+
"capture": false,
|
|
224
|
+
"passive": false
|
|
225
|
+
}];
|
|
226
|
+
}
|
|
227
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s)
|
|
4
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { html } from "lit-html";
|
|
14
|
+
import { getArgTypes } from "../../docs/config/utils";
|
|
15
|
+
const meta = {
|
|
16
|
+
title: 'Components/Form/Custom Dropdown',
|
|
17
|
+
component: 'b2b-custom-dropdown',
|
|
18
|
+
argTypes: getArgTypes('b2b-custom-dropdown'),
|
|
19
|
+
args: {
|
|
20
|
+
placeholder: 'Test Placeholder',
|
|
21
|
+
separator: false,
|
|
22
|
+
disabled: false,
|
|
23
|
+
dropshadow: true,
|
|
24
|
+
border: false,
|
|
25
|
+
hoverIcon: null,
|
|
26
|
+
hoverIconColor: null,
|
|
27
|
+
selectedIcon: null,
|
|
28
|
+
selectedIconColor: null,
|
|
29
|
+
opened: false,
|
|
30
|
+
selected: false,
|
|
31
|
+
},
|
|
32
|
+
render: (_a) => {
|
|
33
|
+
var args = __rest(_a, []);
|
|
34
|
+
return html `<div style="margin-left: 16px;width: 300px">
|
|
35
|
+
<b2b-custom-dropdown
|
|
36
|
+
placeholder="${args.placeholder}"
|
|
37
|
+
dropshadow="${args.dropshadow}"
|
|
38
|
+
border="${args.border}"
|
|
39
|
+
opened="${args.opened}">
|
|
40
|
+
<b2b-paragraph slot="trigger">
|
|
41
|
+
This is a custom dropdown
|
|
42
|
+
<b2b-icon-100
|
|
43
|
+
icon="b2b_icon-arrow-down"
|
|
44
|
+
focusable
|
|
45
|
+
clickable></b2b-icon-100>
|
|
46
|
+
</b2b-paragraph>
|
|
47
|
+
<b2b-custom-dropdown-option
|
|
48
|
+
slot="option"
|
|
49
|
+
option="Option 1"
|
|
50
|
+
separator="${args.separator}"
|
|
51
|
+
hover-icon="${args.hoverIcon}"
|
|
52
|
+
selected-icon="${args.selectedIcon}"
|
|
53
|
+
hover-icon-color="${args.hoverIconColor}"
|
|
54
|
+
selected-icon-color="${args.selectedIconColor}"
|
|
55
|
+
selected="${args.selected}"
|
|
56
|
+
disabled="${args.disabled}">
|
|
57
|
+
</b2b-custom-dropdown-option>
|
|
58
|
+
<b2b-custom-dropdown-option
|
|
59
|
+
slot="option"
|
|
60
|
+
option="Option 2"
|
|
61
|
+
separator="${args.separator}"
|
|
62
|
+
hover-icon="${args.hoverIcon}"
|
|
63
|
+
selected-icon="${args.selectedIcon}"
|
|
64
|
+
hover-icon-color="${args.hoverIconColor}"
|
|
65
|
+
selected-icon-color="${args.selectedIconColor}"
|
|
66
|
+
disabled="${args.disabled}">
|
|
67
|
+
</b2b-custom-dropdown-option>
|
|
68
|
+
<b2b-custom-dropdown-option
|
|
69
|
+
slot="option"
|
|
70
|
+
option="Option 3"
|
|
71
|
+
separator="${args.separator}"
|
|
72
|
+
hover-icon="${args.hoverIcon}"
|
|
73
|
+
selected-icon="${args.selectedIcon}"
|
|
74
|
+
hover-icon-color="${args.hoverIconColor}"
|
|
75
|
+
selected-icon-color="${args.selectedIconColor}"
|
|
76
|
+
disabled="${args.disabled}">
|
|
77
|
+
</b2b-custom-dropdown-option>
|
|
78
|
+
<b2b-custom-dropdown-option
|
|
79
|
+
slot="option"
|
|
80
|
+
option="Option 4"
|
|
81
|
+
separator="${args.separator}"
|
|
82
|
+
hover-icon="${args.hoverIcon}"
|
|
83
|
+
selected-icon="${args.selectedIcon}"
|
|
84
|
+
hover-icon-color="${args.hoverIconColor}"
|
|
85
|
+
selected-icon-color="${args.selectedIconColor}"
|
|
86
|
+
disabled="${args.disabled}">
|
|
87
|
+
</b2b-custom-dropdown-option>
|
|
88
|
+
<b2b-custom-dropdown-option
|
|
89
|
+
slot="option"
|
|
90
|
+
option="Option 5"
|
|
91
|
+
separator="${args.separator}"
|
|
92
|
+
hover-icon="${args.hoverIcon}"
|
|
93
|
+
selected-icon="${args.selectedIcon}"
|
|
94
|
+
hover-icon-color="${args.hoverIconColor}"
|
|
95
|
+
selected-icon-color="${args.selectedIconColor}"
|
|
96
|
+
disabled="${args.disabled}">
|
|
97
|
+
</b2b-custom-dropdown-option>
|
|
98
|
+
<b2b-custom-dropdown-option
|
|
99
|
+
slot="option"
|
|
100
|
+
option="Option 6"
|
|
101
|
+
separator="${args.separator}"
|
|
102
|
+
hover-icon="${args.hoverIcon}"
|
|
103
|
+
selected-icon="${args.selectedIcon}"
|
|
104
|
+
hover-icon-color="${args.hoverIconColor}"
|
|
105
|
+
selected-icon-color="${args.selectedIconColor}"
|
|
106
|
+
disabled="${args.disabled}">
|
|
107
|
+
</b2b-custom-dropdown-option>
|
|
108
|
+
<b2b-custom-dropdown-option
|
|
109
|
+
slot="option"
|
|
110
|
+
option="Option 7"
|
|
111
|
+
hover-icon="${args.hoverIcon}"
|
|
112
|
+
selected-icon="${args.selectedIcon}"
|
|
113
|
+
hover-icon-color="${args.hoverIconColor}"
|
|
114
|
+
selected-icon-color="${args.selectedIconColor}"
|
|
115
|
+
disabled="${args.disabled}">
|
|
116
|
+
</b2b-custom-dropdown-option>
|
|
117
|
+
</b2b-custom-dropdown>
|
|
118
|
+
</div>`;
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
export default meta;
|
|
122
|
+
export const Default = {
|
|
123
|
+
args: Object.assign({}, meta.args),
|
|
124
|
+
};
|
|
125
|
+
export const WithDropShadow = {
|
|
126
|
+
args: Object.assign(Object.assign({}, meta.args), { opened: true }),
|
|
127
|
+
};
|
|
128
|
+
export const WithBorder = {
|
|
129
|
+
args: Object.assign(Object.assign({}, meta.args), { dropshadow: false, border: true, opened: true }),
|
|
130
|
+
};
|
|
131
|
+
export const WithSeparator = {
|
|
132
|
+
args: Object.assign(Object.assign({}, meta.args), { separator: true, opened: true }),
|
|
133
|
+
};
|
|
134
|
+
export const WithIcon = {
|
|
135
|
+
args: Object.assign(Object.assign({}, meta.args), { opened: true, selected: true, hoverIcon: 'b2b_icon-arrow-long-right', hoverIconColor: 'b2b-color-grey-400', selectedIcon: 'b2b_icon-success', selectedIconColor: 'b2b-color-success-100' }),
|
|
136
|
+
};
|
|
137
|
+
export const CustomDropdownOptionsDisabled = {
|
|
138
|
+
args: Object.assign(Object.assign({}, meta.args), { disabled: true, opened: true }),
|
|
139
|
+
};
|
|
140
|
+
export const SearchAndScrollDisabled = {
|
|
141
|
+
args: Object.assign(Object.assign({}, meta.args), { opened: true }),
|
|
142
|
+
render: (_a) => {
|
|
143
|
+
var args = __rest(_a, []);
|
|
144
|
+
return html `<div style="margin-left: 16px;width: 300px">
|
|
145
|
+
<b2b-custom-dropdown
|
|
146
|
+
placeholder="${args.placeholder}"
|
|
147
|
+
dropshadow="${args.dropshadow}"
|
|
148
|
+
opened="${args.opened}">
|
|
149
|
+
<b2b-paragraph slot="trigger">
|
|
150
|
+
This is a custom dropdown
|
|
151
|
+
<b2b-icon-100
|
|
152
|
+
icon="b2b_icon-arrow-down"
|
|
153
|
+
focusable
|
|
154
|
+
clickable></b2b-icon-100>
|
|
155
|
+
</b2b-paragraph>
|
|
156
|
+
</b2b-custom-dropdown-option>
|
|
157
|
+
<b2b-custom-dropdown-option slot="option" option="Option 1">
|
|
158
|
+
</b2b-custom-dropdown-option>
|
|
159
|
+
<b2b-custom-dropdown-option slot="option" option="Option 2">
|
|
160
|
+
</b2b-custom-dropdown-option>
|
|
161
|
+
<b2b-custom-dropdown-option slot="option" option="Option 3">
|
|
162
|
+
</b2b-custom-dropdown-option>
|
|
163
|
+
<b2b-custom-dropdown-option slot="option" option="Option 4">
|
|
164
|
+
</b2b-custom-dropdown-option>
|
|
165
|
+
</b2b-custom-dropdown>
|
|
166
|
+
</div>`;
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
export const CustomDropdownDisabled = {
|
|
170
|
+
args: Object.assign(Object.assign({}, meta.args), { disabled: true, opened: true }),
|
|
171
|
+
render: (_a) => {
|
|
172
|
+
var args = __rest(_a, []);
|
|
173
|
+
return html `<div style="margin-left: 16px;width: 300px">
|
|
174
|
+
<b2b-custom-dropdown
|
|
175
|
+
placeholder="${args.placeholder}"
|
|
176
|
+
disabled="${args.disabled}"
|
|
177
|
+
opened="${args.opened}">
|
|
178
|
+
<b2b-paragraph slot="trigger">
|
|
179
|
+
This is a custom dropdown
|
|
180
|
+
<b2b-icon-100
|
|
181
|
+
icon="b2b_icon-arrow-down"
|
|
182
|
+
focusable
|
|
183
|
+
clickable></b2b-icon-100>
|
|
184
|
+
</b2b-paragraph>
|
|
185
|
+
</b2b-custom-dropdown-option>
|
|
186
|
+
<b2b-custom-dropdown-option slot="option" option="Option 1" >
|
|
187
|
+
</b2b-custom-dropdown-option>
|
|
188
|
+
<b2b-custom-dropdown-option slot="option" option="Option 2">
|
|
189
|
+
</b2b-custom-dropdown-option>
|
|
190
|
+
<b2b-custom-dropdown-option slot="option" option="Option 3">
|
|
191
|
+
</b2b-custom-dropdown-option>
|
|
192
|
+
<b2b-custom-dropdown-option slot="option" option="Option 4">
|
|
193
|
+
</b2b-custom-dropdown-option>
|
|
194
|
+
</b2b-custom-dropdown>
|
|
195
|
+
</div>`;
|
|
196
|
+
},
|
|
197
|
+
};
|
|
@@ -13,7 +13,7 @@ export class B2bDatePickerDaysHeader {
|
|
|
13
13
|
this.language = 'de';
|
|
14
14
|
}
|
|
15
15
|
render() {
|
|
16
|
-
return (h(Host, { key: '
|
|
16
|
+
return (h(Host, { key: '6ca6b61422e9664b0468ccee19cd3cd208d0fb97' }, h("div", { key: '69fd18279a42ecfb0a2a07f99bb04565153c8df6', class: "b2b-date-picker-days-header" }, this.displayWeekDays())));
|
|
17
17
|
}
|
|
18
18
|
static get is() { return "b2b-date-picker-days-header"; }
|
|
19
19
|
static get encapsulation() { return "shadow"; }
|
|
@@ -160,7 +160,7 @@ export class B2bDatePickerDays {
|
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
162
|
render() {
|
|
163
|
-
return (h(Host, { key: '
|
|
163
|
+
return (h(Host, { key: '73d99c811d52c00ddec7c3f044b7d850861f7a48' }, h("div", { key: '146b6533fc0d040a896e32baf3068793a8cdfe81', class: "b2b-date-picker-days" }, this.renderDatePickerDays())));
|
|
164
164
|
}
|
|
165
165
|
static get is() { return "b2b-date-picker-days"; }
|
|
166
166
|
static get encapsulation() { return "shadow"; }
|
|
@@ -8,9 +8,9 @@ export class B2bDatePickerHeader {
|
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
10
|
const Months = this.language === 'en' ? MonthsEnglish : MonthsGerman;
|
|
11
|
-
return (h(Host, { key: '
|
|
11
|
+
return (h(Host, { key: '149ffea5e265aa5988cbd5e9e49a6282a2c26620' }, h("div", { key: 'ff0afa53b9c874475bb1c7362d0b49e458d1cc57', class: "b2b-date-picker-header" }, h("button", { key: '785d10e6fa6339a2fe10b2a11ad9d02432792c16', class: "b2b-date-picker-nav--left", onClick: this.b2bDatePickerPreviousMonth.emit, onMouseOut: event => {
|
|
12
12
|
event.target.blur();
|
|
13
|
-
}, "aria-label": "previous month" }, h("b2b-icon-100", { key: '
|
|
13
|
+
}, "aria-label": "previous month" }, h("b2b-icon-100", { key: '7e52cd1f6da18c5fdbeb82c1481794aa3f0a81a5', icon: "b2b_icon-arrow-left", clickable: true })), h("b2b-headline", { key: 'd73a470a1e573c843bd45d7276563291fbed287c', size: '100', align: 'center', class: "b2b-date-picker-month", "aria-label": "select month", tabindex: 0, onClick: () => {
|
|
14
14
|
this.b2bDatePickerViewChanged.emit({
|
|
15
15
|
value: "Months" /* DatePickerView.Months */,
|
|
16
16
|
});
|
|
@@ -20,7 +20,7 @@ export class B2bDatePickerHeader {
|
|
|
20
20
|
value: "Months" /* DatePickerView.Months */,
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
-
} }, Months[this.selectedMonth]), h("b2b-headline", { key: '
|
|
23
|
+
} }, Months[this.selectedMonth]), h("b2b-headline", { key: '9a443891ff3bc1d64f8bd0c94dee0e99c2c899ee', size: '100', align: 'center', class: "b2b-date-picker-year", "aria-label": "select year", tabindex: 0, onClick: () => {
|
|
24
24
|
this.b2bDatePickerViewChanged.emit({
|
|
25
25
|
value: "Years" /* DatePickerView.Years */,
|
|
26
26
|
});
|
|
@@ -30,9 +30,9 @@ export class B2bDatePickerHeader {
|
|
|
30
30
|
value: "Years" /* DatePickerView.Years */,
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
} }, this.selectedYear), h("button", { key: '
|
|
33
|
+
} }, this.selectedYear), h("button", { key: '08ce033f80749a5d9b882fbf04939b9993289ead', class: "b2b-date-picker-nav--right", onClick: this.b2bDatePickerNextMonth.emit, onMouseOut: event => {
|
|
34
34
|
event.target.blur();
|
|
35
|
-
}, "aria-label": "next month" }, h("b2b-icon-100", { key: '
|
|
35
|
+
}, "aria-label": "next month" }, h("b2b-icon-100", { key: '8ba392f6c91dfd7e9c1a262ddca2e3640e7c3840', icon: "b2b_icon-arrow-right", clickable: true })))));
|
|
36
36
|
}
|
|
37
37
|
static get is() { return "b2b-date-picker-header"; }
|
|
38
38
|
static get encapsulation() { return "shadow"; }
|
|
@@ -73,7 +73,7 @@ export class B2bDatePickerMonths {
|
|
|
73
73
|
this.focusCurrentMonth(months[index]);
|
|
74
74
|
}
|
|
75
75
|
render() {
|
|
76
|
-
return (h(Host, { key: '
|
|
76
|
+
return (h(Host, { key: '9ddb8ebbb24997435ceca09cc47ba7dc12b39ba7' }, h("div", { key: 'a650207f538786bb680698ffc293fd59a717ea3a', class: "b2b-date-picker-months" }, this.renderDatePickerMonths())));
|
|
77
77
|
}
|
|
78
78
|
static get is() { return "b2b-date-picker-months"; }
|
|
79
79
|
static get encapsulation() { return "shadow"; }
|
|
@@ -98,7 +98,7 @@ export class B2bDatePickerYears {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
render() {
|
|
101
|
-
return (h(Host, { key: '
|
|
101
|
+
return (h(Host, { key: '22394d693b0a966c62b74de49c00d72b346a2e64' }, h("div", { key: 'a2c33dc133169c2cb558e9b92d78b56cf7fb108e', class: "b2b-date-picker-years" }, this.renderDatePickerYears())));
|
|
102
102
|
}
|
|
103
103
|
static get is() { return "b2b-date-picker-years"; }
|
|
104
104
|
static get encapsulation() { return "shadow"; }
|
|
@@ -261,7 +261,7 @@
|
|
|
261
261
|
border: 1px solid var(--b2b-color-grey-200);
|
|
262
262
|
border-right: var(--b2b-border-right);
|
|
263
263
|
border-radius: var(--b2b-border-radius);
|
|
264
|
-
padding: 7px
|
|
264
|
+
padding: 7px 11px 6px;
|
|
265
265
|
padding-right: calc(1.75rem + 6px);
|
|
266
266
|
height: var(--b2b-size-90);
|
|
267
267
|
line-height: var(--b2b-size-copy-line-height-100);
|
|
@@ -42,7 +42,13 @@ export class DropdownComponent {
|
|
|
42
42
|
if (!ctx)
|
|
43
43
|
return;
|
|
44
44
|
ctx.font = `${style.fontWeight} ${style.fontSize} ${style.fontFamily}`;
|
|
45
|
-
|
|
45
|
+
let baseWidth = this.selectEl.clientWidth;
|
|
46
|
+
const parentContainer = this.selectEl.parentElement;
|
|
47
|
+
if (parentContainer && parentContainer.clientWidth > baseWidth) {
|
|
48
|
+
baseWidth = parentContainer.clientWidth;
|
|
49
|
+
}
|
|
50
|
+
baseWidth = Math.max(baseWidth, 200);
|
|
51
|
+
const availableWidth = baseWidth - parseFloat(style.paddingRight || '0') - 24;
|
|
46
52
|
if (ctx.measureText(rawText).width <= availableWidth) {
|
|
47
53
|
this.truncatedText = rawText;
|
|
48
54
|
return;
|
|
@@ -138,11 +144,11 @@ export class DropdownComponent {
|
|
|
138
144
|
const hasError = this.invalid && !this.disabled;
|
|
139
145
|
const showHint = this.hint && (!this.invalid || this.disabled);
|
|
140
146
|
const showError = this.error && hasError;
|
|
141
|
-
return (h(Host, { key: '
|
|
147
|
+
return (h(Host, { key: '12c5872badf4168d07a0c3e0281c4014f50c05f6', class: {
|
|
142
148
|
'b2b-dropdown': true,
|
|
143
149
|
'b2b-dropdown--error': hasError,
|
|
144
150
|
'b2b-dropdown--disabled': this.disabled,
|
|
145
|
-
} }, this.label && (h("b2b-input-label", { id: this.name, required: this.required }, this.label)), h("div", { key: '
|
|
151
|
+
} }, this.label && (h("b2b-input-label", { id: this.name, required: this.required }, this.label)), h("div", { key: '9c1f7ee41956ee0ea6d9913bc6f0831a3800b749', class: "b2b-dropdown__wrapper", onFocus: this.onFocus, onBlur: this.onBlur }, h("div", { key: '580dcbbcdbc6e8d7c60ff2fbfcd89e94e419862c', class: {
|
|
146
152
|
'b2b-dropdown__select': true,
|
|
147
153
|
'b2b-dropdown__select--open': this.isOpen,
|
|
148
154
|
'b2b-dropdown__select--focused': this.focused,
|
|
@@ -16,7 +16,7 @@ export class FlyoutMenuOptionComponent {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
return (h(Host, { key: '
|
|
19
|
+
return (h(Host, { key: '6203f835788db06223c00d348c659a905710af8f', class: {
|
|
20
20
|
'b2b-flyout-menu__option': true,
|
|
21
21
|
'b2b-flyout-menu__option--disabled': this.disabled,
|
|
22
22
|
'b2b-flyout-menu__option--separator': this.separator,
|
|
@@ -144,12 +144,12 @@ export class FlyoutMenuComponent {
|
|
|
144
144
|
options[index].focus();
|
|
145
145
|
}
|
|
146
146
|
render() {
|
|
147
|
-
return (h(Host, { key: '
|
|
147
|
+
return (h(Host, { key: '5d9a147f1998a47c761af924c90da4b1f8c6ded1' }, h("div", { key: '1ae6d3742d1614e8a259b0a53f7b944d19c441db', class: {
|
|
148
148
|
'b2b-flyout-menu': true,
|
|
149
|
-
} }, h("div", { key: '
|
|
149
|
+
} }, h("div", { key: '7cd8b06ad714085def1431404dea0aca959eb96d', class: "b2b-flyout-menu__trigger" }, h("slot", { key: 'c0295db03bf2d77ae8ecea387c41cc2fb69ea0e1', name: "trigger" })), h("div", { key: '8eabaac43b7e03e0116e4079f1c27cd7bde14929', onFocusout: this.blurMenu, class: {
|
|
150
150
|
'b2b-flyout-menu__options__container': true,
|
|
151
151
|
'b2b-flyout-menu__options__container--on': this.opened,
|
|
152
|
-
} }, h("div", { key: '
|
|
152
|
+
} }, h("div", { key: '1646d526780846355dfd56856aa95bc0c4b43460', class: "b2b-flyout-menu__arrow" }), h("slot", { key: 'bae26a650e0e506ddc5e9cd791db3767056af9f4', name: "option" })))));
|
|
153
153
|
}
|
|
154
154
|
static get is() { return "b2b-flyout-menu"; }
|
|
155
155
|
static get encapsulation() { return "shadow"; }
|
|
@@ -13,7 +13,7 @@ export class B2bGridColumnComponent {
|
|
|
13
13
|
this.textAlign = 'left';
|
|
14
14
|
}
|
|
15
15
|
render() {
|
|
16
|
-
return (h(Host, { key: '
|
|
16
|
+
return (h(Host, { key: 'c934cbf6e57af0dd3be40e2149f49adb2802c1f4', style: Object.assign(Object.assign({}, this.calculateGrowDimension(this.span)), { ['text-align']: `${this.textAlign}` }) }, h("slot", { key: 'affb02d8aeefc039ce0a5d8fd2e290e376c8fc3d' })));
|
|
17
17
|
}
|
|
18
18
|
static get is() { return "b2b-grid-col"; }
|
|
19
19
|
static get encapsulation() { return "shadow"; }
|
|
@@ -4,7 +4,7 @@ export class B2bGridComponent {
|
|
|
4
4
|
this.margin = 24;
|
|
5
5
|
}
|
|
6
6
|
render() {
|
|
7
|
-
return (h(Host, { key: '
|
|
7
|
+
return (h(Host, { key: '3f706955f934472664948d8653a86d3ac898e3d1', style: { ['padding']: `${this.margin}px` }, class: "b2b-grid" }, h("slot", { key: 'a0ac4c214a5bf2f169c2adee55131e785324a7ff' })));
|
|
8
8
|
}
|
|
9
9
|
static get is() { return "b2b-grid"; }
|
|
10
10
|
static get encapsulation() { return "shadow"; }
|
|
@@ -66,7 +66,7 @@ export class B2bGridRowComponent {
|
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
render() {
|
|
69
|
-
return (h(Host, { key: '
|
|
69
|
+
return (h(Host, { key: '48eccc3f2f29de4a533859834065717ad6b58238', style: {
|
|
70
70
|
['justify-content']: `${this.justify}`,
|
|
71
71
|
['gap']: `${this.columnGap}px`,
|
|
72
72
|
['margin']: `${this.rowGap}px 0`,
|
|
@@ -74,7 +74,7 @@ export class B2bGridRowComponent {
|
|
|
74
74
|
['display']: 'flex',
|
|
75
75
|
['flex-wrap']: 'wrap',
|
|
76
76
|
['box-sizing']: 'border-box',
|
|
77
|
-
} }, h("slot", { key: '
|
|
77
|
+
} }, h("slot", { key: 'b814a34254890bde8a7690c9fa58bc42b3f8d35d' })));
|
|
78
78
|
}
|
|
79
79
|
static get is() { return "b2b-grid-row"; }
|
|
80
80
|
static get encapsulation() { return "shadow"; }
|
|
@@ -100,18 +100,18 @@ export class InputComponent {
|
|
|
100
100
|
this.filterHintSlotContent();
|
|
101
101
|
}
|
|
102
102
|
render() {
|
|
103
|
-
return (h(Host, { key: '
|
|
103
|
+
return (h(Host, { key: 'f24ddfd309213b97dde35beafeafe167164fab05', class: {
|
|
104
104
|
'b2b-input': true,
|
|
105
105
|
'b2b-input--error': this.invalid && !this.disabled,
|
|
106
|
-
} }, (this.label || this.labelSlot) && (h("b2b-input-label", { id: this.name, required: this.required }, h("slot", { name: "label" }, this.label))), h("div", { key: '
|
|
106
|
+
} }, (this.label || this.labelSlot) && (h("b2b-input-label", { id: this.name, required: this.required }, h("slot", { name: "label" }, this.label))), h("div", { key: '65948e5a8bf67ea0f2bf2e9a56af1e9211b854a7', class: {
|
|
107
107
|
'b2b-input__wrapper': true,
|
|
108
108
|
'b2b-input__wrapper--focused': this.hasFocus,
|
|
109
109
|
'b2b-input__wrapper--disabled': this.disabled || this.groupDisabled,
|
|
110
|
-
} }, h("slot", { key: '
|
|
110
|
+
} }, h("slot", { key: '2b8a7cc9ddd4457b9c833a04a5201912147958d8', name: "start" }), this.hasTextPrefix && h("div", { class: "border" }), h("input", { key: 'fd07b1da34c8d628521ebc59a5d8e2d279a167ba', class: {
|
|
111
111
|
'b2b-input__native-input': true,
|
|
112
112
|
['b2b-input__native-input--align-' + this.inputTextAlign]: true,
|
|
113
113
|
'b2b-input__native-input--disabled': this.disabled,
|
|
114
|
-
}, "aria-labelledby": this.name, type: this.type, placeholder: this.placeholder, value: this.value, name: this.name, disabled: this.disabled || this.groupDisabled, autoFocus: this.focusOnLoad, onFocus: this.onFocus, onBlur: this.onBlur, onInput: this.onInput, ref: el => (this.focusableElement = el) }), this.hasTextSuffix && h("div", { class: "border" }), h("slot", { key: '
|
|
114
|
+
}, "aria-labelledby": this.name, type: this.type, placeholder: this.placeholder, value: this.value, name: this.name, disabled: this.disabled || this.groupDisabled, autoFocus: this.focusOnLoad, onFocus: this.onFocus, onBlur: this.onBlur, onInput: this.onInput, ref: el => (this.focusableElement = el) }), this.hasTextSuffix && h("div", { class: "border" }), h("slot", { key: '1147f2bdf14ade737b8e3e02d03dea9424aef1e9', name: "end" })), (this.hint !== undefined || this.hintSlot) &&
|
|
115
115
|
(!this.invalid || this.disabled) ? (h("span", null, h("slot", { name: "hint" }, this.hint))) : (''), this.error !== undefined && this.invalid && !this.disabled ? (h("span", null, this.error)) : ('')));
|
|
116
116
|
}
|
|
117
117
|
static get is() { return "b2b-input"; }
|
|
@@ -56,7 +56,7 @@ export class B2BInputGroup {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
render() {
|
|
59
|
-
return (h(Host, { key: '
|
|
59
|
+
return (h(Host, { key: '57a5aa8deaadb27c20de3771a232833ae95e82a4' }, h("div", { key: 'fd0c4bc60e08a60fe6b5abc93bdac9219c41b09c', class: { 'b2b-input-wrapper': true } }, h("slot", { key: '36cd34bf6b4aa62c2f544d0329d9c95f3d70259d', name: "start" }), h("slot", { key: 'a32cec43572ec254a0eb91e09bc8136984f8143f' }), h("slot", { key: '7b99a7c32bc2c54e1400d90d947df0c63920b243', name: "end" })), (this.hint || (this.invalid && !this.disabled)) && (h("span", { class: {
|
|
60
60
|
'b2b-input-wrapper__hint': true,
|
|
61
61
|
'b2b-input-wrapper__hint--error': this.invalid && !this.disabled,
|
|
62
62
|
} }, this.invalid && !this.disabled ? this.error : this.hint))));
|