@otto-de/b2b-core-components 1.36.0 → 1.37.1
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-19a043a8.entry.js +1 -0
- package/dist/b2b-core-components/{p-0f0fcb25.entry.js → p-3628e4cb.entry.js} +1 -1
- package/dist/b2b-core-components/{p-1a232e86.entry.js → p-9cbda7b3.entry.js} +1 -1
- package/dist/b2b-core-components/{p-703da47c.entry.js → p-c9a10980.entry.js} +1 -1
- package/dist/b2b-core-components/{p-a95ed002.entry.js → p-ceab4af0.entry.js} +1 -1
- package/dist/b2b-core-components/{p-fdb7d12c.entry.js → p-e143cad0.entry.js} +1 -1
- package/dist/b2b-core-components/{p-98ee5fd5.entry.js → p-f32e783e.entry.js} +1 -1
- package/dist/cjs/b2b-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/b2b-core-components.cjs.js +1 -1
- package/dist/cjs/b2b-dropdown.cjs.entry.js +9 -4
- package/dist/cjs/b2b-flyout-menu.cjs.entry.js +1 -1
- package/dist/cjs/b2b-input-group_2.cjs.entry.js +1 -1
- package/dist/cjs/b2b-input-list-option.cjs.entry.js +1 -1
- package/dist/cjs/b2b-pagination.cjs.entry.js +1 -1
- package/dist/cjs/b2b-table-rowgroup.cjs.entry.js +4 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/alert/alert.stories.js +5 -5
- package/dist/collection/components/anchor/anchor.stories.js +6 -6
- package/dist/collection/components/background-box/background-box.stories.js +6 -6
- package/dist/collection/components/breadcrumb/breadcrumb.stories.js +3 -5
- package/dist/collection/components/button/button.stories.js +41 -41
- package/dist/collection/components/card/card.stories.js +1 -1
- package/dist/collection/components/checkbox/checkbox.css +3 -3
- package/dist/collection/components/checkbox/checkbox.stories.js +9 -9
- package/dist/collection/components/checkbox-group/checkbox-group.stories.js +9 -9
- package/dist/collection/components/chip/chip.stories.js +13 -13
- package/dist/collection/components/custom-dropdown/custom-dropdown.stories.js +47 -47
- package/dist/collection/components/date-picker/date-picker.stories.js +2 -2
- package/dist/collection/components/dropdown/dropdown.e2e.js +22 -3
- package/dist/collection/components/dropdown/dropdown.js +27 -4
- package/dist/collection/components/dropdown/dropdown.stories.js +17 -10
- package/dist/collection/components/flyout-menu/flyout-menu.css +5 -3
- package/dist/collection/components/flyout-menu/flyout-menu.stories.js +4 -4
- package/dist/collection/components/grid/grid.stories.js +38 -38
- package/dist/collection/components/headline/headline.stories.js +1 -4
- package/dist/collection/components/icon/icon.stories.js +5 -8
- package/dist/collection/components/icon-100/icon-100.stories.js +11 -11
- package/dist/collection/components/icon-50/icon-50.stories.js +9 -9
- package/dist/collection/components/input/input.stories.js +44 -44
- package/dist/collection/components/input-group/input-group.stories.js +4 -4
- package/dist/collection/components/input-list/input-list.css +5 -3
- package/dist/collection/components/input-list/input-list.stories.js +13 -13
- package/dist/collection/components/label/label.stories.js +1 -1
- package/dist/collection/components/modal/modal.stories.js +5 -5
- package/dist/collection/components/pagination/pagination.css +5 -3
- package/dist/collection/components/pagination/pagination.stories.js +2 -2
- package/dist/collection/components/paragraph/paragraph.stories.js +18 -18
- package/dist/collection/components/progress-bar/progress-bar.stories.js +4 -4
- package/dist/collection/components/radio/radio.stories.js +9 -9
- package/dist/collection/components/radio-group/radio-group.stories.js +10 -10
- package/dist/collection/components/required-separator/required-separator.stories.js +1 -1
- package/dist/collection/components/rounded-icon/rounded-icon.stories.js +3 -3
- package/dist/collection/components/search/search.stories.js +2 -2
- package/dist/collection/components/separator/separator.stories.js +2 -2
- package/dist/collection/components/shimmer/shimmer.js +1 -1
- package/dist/collection/components/shimmer/shimmer.stories.js +4 -4
- package/dist/collection/components/snackbar/snackbar.stories.js +8 -8
- package/dist/collection/components/spinner/spinner.stories.js +1 -1
- package/dist/collection/components/tab-group/tab-group.stories.js +1 -1
- package/dist/collection/components/table/table-rowgroup/table-rowgroup.js +4 -3
- package/dist/collection/components/table/table.stories.js +35 -35
- package/dist/collection/components/textarea/textarea.stories.js +12 -12
- package/dist/collection/components/toggle-group/toggle-group.stories.js +6 -6
- package/dist/collection/components/toggle-switch/toggle-switch.stories.js +4 -4
- package/dist/collection/components/tooltip/tooltip.stories.js +8 -8
- package/dist/collection/components/wizard/wizard.stories.js +6 -6
- package/dist/collection/components/wizard-icon/wizard-icon.stories.js +1 -1
- package/dist/components/b2b-dropdown.js +10 -4
- package/dist/components/b2b-flyout-menu.js +1 -1
- package/dist/components/b2b-pagination.js +1 -1
- package/dist/components/b2b-table-rowgroup.js +4 -3
- package/dist/components/checkbox.js +1 -1
- package/dist/components/input-list-option.js +1 -1
- package/dist/components/input-list.js +1 -1
- package/dist/custom-elements.json +5 -1
- package/dist/esm/b2b-checkbox.entry.js +1 -1
- package/dist/esm/b2b-core-components.js +1 -1
- package/dist/esm/b2b-dropdown.entry.js +9 -4
- package/dist/esm/b2b-flyout-menu.entry.js +1 -1
- package/dist/esm/b2b-input-group_2.entry.js +1 -1
- package/dist/esm/b2b-input-list-option.entry.js +1 -1
- package/dist/esm/b2b-pagination.entry.js +1 -1
- package/dist/esm/b2b-table-rowgroup.entry.js +4 -3
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/dropdown/dropdown.d.ts +2 -0
- package/dist/types/components/dropdown/dropdown.stories.d.ts +1 -0
- package/dist/types/components/shimmer/shimmer.d.ts +1 -1
- package/dist/types/components.d.ts +10 -2
- package/dist/web-types.json +12 -2
- package/package.json +2 -2
- package/dist/b2b-core-components/p-470378e2.entry.js +0 -1
|
@@ -17,11 +17,11 @@ const Template = ({ type, opened, size, hasCloseButton, customIcon, }) => {
|
|
|
17
17
|
|
|
18
18
|
<b2b-alert
|
|
19
19
|
@b2b-close=${closeAlert}
|
|
20
|
-
opened
|
|
21
|
-
type
|
|
22
|
-
size
|
|
23
|
-
has-close-button
|
|
24
|
-
custom-icon
|
|
20
|
+
opened=${opened}
|
|
21
|
+
type=${type}
|
|
22
|
+
size=${size}
|
|
23
|
+
has-close-button=${hasCloseButton}
|
|
24
|
+
custom-icon=${customIcon}>
|
|
25
25
|
<strong>${type}</strong> This is an alert.
|
|
26
26
|
</b2b-alert>
|
|
27
27
|
`;
|
|
@@ -2,12 +2,12 @@ import { html } from "lit-html";
|
|
|
2
2
|
import { getArgTypes } from "../../docs/config/utils";
|
|
3
3
|
const Template = ({ href, download, size, target, hoverColor, underlineText, }) => {
|
|
4
4
|
return html ` <b2b-anchor
|
|
5
|
-
href
|
|
6
|
-
download
|
|
7
|
-
size
|
|
8
|
-
hover-color
|
|
9
|
-
target
|
|
10
|
-
underline-text
|
|
5
|
+
href=${href}
|
|
6
|
+
download=${download}
|
|
7
|
+
size=${size}
|
|
8
|
+
hover-color=${hoverColor}
|
|
9
|
+
target=${target}
|
|
10
|
+
underline-text=${underlineText}>
|
|
11
11
|
Click me!
|
|
12
12
|
</b2b-anchor>`;
|
|
13
13
|
};
|
|
@@ -27,12 +27,12 @@ const meta = {
|
|
|
27
27
|
render: (_a) => {
|
|
28
28
|
var args = __rest(_a, []);
|
|
29
29
|
return html ` <b2b-background-box
|
|
30
|
-
max-width
|
|
31
|
-
no-padding
|
|
32
|
-
border-top
|
|
33
|
-
border-right
|
|
34
|
-
border-bottom
|
|
35
|
-
border-left
|
|
30
|
+
max-width=${args.maxWidth}
|
|
31
|
+
no-padding=${args.noPadding}
|
|
32
|
+
border-top=${args.borderTop}
|
|
33
|
+
border-right=${args.borderRight}
|
|
34
|
+
border-bottom=${args.borderBottom}
|
|
35
|
+
border-left=${args.borderLeft}>
|
|
36
36
|
<b2b-paragraph>
|
|
37
37
|
The BackgroundBox component adjusts its width and padding based on two
|
|
38
38
|
properties: maxWidth and noPadding. When maxWidth is true, it fills the
|
|
@@ -2,12 +2,10 @@ import { html } from "lit-html";
|
|
|
2
2
|
import { getArgTypes } from "../../docs/config/utils";
|
|
3
3
|
const Template = ({ href, active, paddingTop, paddingBottom }) => {
|
|
4
4
|
return html `
|
|
5
|
-
<b2b-breadcrumb
|
|
6
|
-
|
|
7
|
-
padding-bottom="${paddingBottom}">
|
|
8
|
-
<b2b-breadcrumb-item href="${href}">Start</b2b-breadcrumb-item>
|
|
5
|
+
<b2b-breadcrumb padding-top=${paddingTop} padding-bottom=${paddingBottom}>
|
|
6
|
+
<b2b-breadcrumb-item href=${href}>Start</b2b-breadcrumb-item>
|
|
9
7
|
<b2b-breadcrumb-item>Weiter</b2b-breadcrumb-item>
|
|
10
|
-
<b2b-breadcrumb-item active
|
|
8
|
+
<b2b-breadcrumb-item active=${active}>Ende</b2b-breadcrumb-item>
|
|
11
9
|
</b2b-breadcrumb>
|
|
12
10
|
`;
|
|
13
11
|
};
|
|
@@ -30,11 +30,11 @@ const button = {
|
|
|
30
30
|
render: (_a) => {
|
|
31
31
|
var args = __rest(_a, []);
|
|
32
32
|
return html `<b2b-button
|
|
33
|
-
variant
|
|
34
|
-
size
|
|
35
|
-
disabled
|
|
36
|
-
loading
|
|
37
|
-
type
|
|
33
|
+
variant=${args.variant}
|
|
34
|
+
size=${args.size}
|
|
35
|
+
disabled=${args.disabled}
|
|
36
|
+
loading=${args.loading}
|
|
37
|
+
type=${args.type}>
|
|
38
38
|
${args.label}
|
|
39
39
|
</b2b-button>`;
|
|
40
40
|
},
|
|
@@ -54,11 +54,11 @@ export const IconStart = {
|
|
|
54
54
|
render: (_a) => {
|
|
55
55
|
var args = __rest(_a, []);
|
|
56
56
|
return html `<b2b-button
|
|
57
|
-
variant
|
|
58
|
-
size
|
|
59
|
-
disabled
|
|
60
|
-
loading
|
|
61
|
-
type
|
|
57
|
+
variant=${args.variant}
|
|
58
|
+
size=${args.size}
|
|
59
|
+
disabled=${args.disabled}
|
|
60
|
+
loading=${args.loading}
|
|
61
|
+
type=${args.type}>
|
|
62
62
|
<b2b-icon-100 slot="start" icon="b2b_icon-check"></b2b-icon-100>
|
|
63
63
|
${args.label}
|
|
64
64
|
</b2b-button>`;
|
|
@@ -69,11 +69,11 @@ export const IconEnd = {
|
|
|
69
69
|
render: (_a) => {
|
|
70
70
|
var args = __rest(_a, []);
|
|
71
71
|
return html `<b2b-button
|
|
72
|
-
variant
|
|
73
|
-
size
|
|
74
|
-
disabled
|
|
75
|
-
loading
|
|
76
|
-
type
|
|
72
|
+
variant=${args.variant}
|
|
73
|
+
size=${args.size}
|
|
74
|
+
disabled=${args.disabled}
|
|
75
|
+
loading=${args.loading}
|
|
76
|
+
type=${args.type}>
|
|
77
77
|
${args.label}
|
|
78
78
|
<b2b-icon-100 slot="end" icon="b2b_icon-check"></b2b-icon-100>
|
|
79
79
|
</b2b-button>`;
|
|
@@ -84,11 +84,11 @@ export const PaliIcon = {
|
|
|
84
84
|
render: (_a) => {
|
|
85
85
|
var args = __rest(_a, []);
|
|
86
86
|
return html `<b2b-button
|
|
87
|
-
variant
|
|
88
|
-
size
|
|
89
|
-
disabled
|
|
90
|
-
loading
|
|
91
|
-
type
|
|
87
|
+
variant=${args.variant}
|
|
88
|
+
size=${args.size}
|
|
89
|
+
disabled=${args.disabled}
|
|
90
|
+
loading=${args.loading}
|
|
91
|
+
type=${args.type}>
|
|
92
92
|
<i slot="start" class="obc_icon-info"></i>
|
|
93
93
|
${args.label}
|
|
94
94
|
</b2b-button>`;
|
|
@@ -99,11 +99,11 @@ export const IconOnly = {
|
|
|
99
99
|
render: (_a) => {
|
|
100
100
|
var args = __rest(_a, []);
|
|
101
101
|
return html `<b2b-button
|
|
102
|
-
variant
|
|
103
|
-
size
|
|
104
|
-
disabled
|
|
105
|
-
loading
|
|
106
|
-
type
|
|
102
|
+
variant=${args.variant}
|
|
103
|
+
size=${args.size}
|
|
104
|
+
disabled=${args.disabled}
|
|
105
|
+
loading=${args.loading}
|
|
106
|
+
type=${args.type}>
|
|
107
107
|
<b2b-icon-100 slot="end" icon="b2b_icon-search"></b2b-icon-100>
|
|
108
108
|
</b2b-button>`;
|
|
109
109
|
},
|
|
@@ -116,13 +116,13 @@ export const Anchor = {
|
|
|
116
116
|
render: (_a) => {
|
|
117
117
|
var args = __rest(_a, []);
|
|
118
118
|
return html `<b2b-button
|
|
119
|
-
variant
|
|
120
|
-
size
|
|
121
|
-
disabled
|
|
122
|
-
loading
|
|
119
|
+
variant=${args.variant}
|
|
120
|
+
size=${args.size}
|
|
121
|
+
disabled=${args.disabled}
|
|
122
|
+
loading=${args.loading}
|
|
123
123
|
href="www.otto.de"
|
|
124
124
|
target="blank"
|
|
125
|
-
type
|
|
125
|
+
type=${args.type}>
|
|
126
126
|
Go to otto.de
|
|
127
127
|
</b2b-button>`;
|
|
128
128
|
},
|
|
@@ -132,13 +132,13 @@ export const DisabledAnchor = {
|
|
|
132
132
|
render: (_a) => {
|
|
133
133
|
var args = __rest(_a, []);
|
|
134
134
|
return html `<b2b-button
|
|
135
|
-
variant
|
|
136
|
-
size
|
|
137
|
-
disabled
|
|
138
|
-
loading
|
|
135
|
+
variant=${args.variant}
|
|
136
|
+
size=${args.size}
|
|
137
|
+
disabled=${args.disabled}
|
|
138
|
+
loading=${args.loading}
|
|
139
139
|
href="www.otto.de"
|
|
140
140
|
target="blank"
|
|
141
|
-
type
|
|
141
|
+
type=${args.type}>
|
|
142
142
|
Go to otto.de
|
|
143
143
|
</b2b-button>`;
|
|
144
144
|
},
|
|
@@ -150,12 +150,12 @@ export const CustomWidth = {
|
|
|
150
150
|
return html ` <b2b-button
|
|
151
151
|
class="docs-button-obc-overwrite"
|
|
152
152
|
style="width: 300px"
|
|
153
|
-
variant
|
|
154
|
-
size
|
|
155
|
-
width
|
|
156
|
-
disabled
|
|
157
|
-
loading
|
|
158
|
-
type
|
|
153
|
+
variant=${args.variant}
|
|
154
|
+
size=${args.size}
|
|
155
|
+
width=${args.width}
|
|
156
|
+
disabled=${args.disabled}
|
|
157
|
+
loading=${args.loading}
|
|
158
|
+
type=${args.type}>
|
|
159
159
|
300px custom width
|
|
160
160
|
</b2b-button>`;
|
|
161
161
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { html } from "lit-html";
|
|
2
2
|
import { getArgTypes } from "../../docs/config/utils";
|
|
3
3
|
const Template = ({ disabled, href, target }) => {
|
|
4
|
-
return html `<b2b-card disabled
|
|
4
|
+
return html `<b2b-card disabled=${disabled} href=${href} target=${target}>
|
|
5
5
|
<b2b-headline size="100">An Interactive Card</b2b-headline>
|
|
6
6
|
<b2b-paragraph
|
|
7
7
|
>You can hover over me or press tab on your keyboard to see me pop out. I
|
|
@@ -286,9 +286,6 @@
|
|
|
286
286
|
line-height: var(--b2b-size-copy-line-height-75);
|
|
287
287
|
user-select: none;
|
|
288
288
|
}
|
|
289
|
-
.b2b-checkbox--error {
|
|
290
|
-
/* When an input is both checked AND has an error */
|
|
291
|
-
}
|
|
292
289
|
.b2b-checkbox--error .b2b-checkbox__input {
|
|
293
290
|
background-color: var(--b2b-color-error-50);
|
|
294
291
|
border: 1px solid var(--b2b-color-error-100);
|
|
@@ -296,6 +293,9 @@
|
|
|
296
293
|
.b2b-checkbox--error span {
|
|
297
294
|
color: var(--b2b-color-error-100);
|
|
298
295
|
}
|
|
296
|
+
.b2b-checkbox--error {
|
|
297
|
+
/* When an input is both checked AND has an error */
|
|
298
|
+
}
|
|
299
299
|
.b2b-checkbox--error.b2b-checkbox--checked .b2b-checkbox__input {
|
|
300
300
|
background-color: var(--b2b-color-error-100);
|
|
301
301
|
border-color: var(--b2b-color-error-100);
|
|
@@ -2,15 +2,15 @@ import { html } from "lit-html";
|
|
|
2
2
|
import { getArgTypes } from "../../docs/config/utils";
|
|
3
3
|
const Template = ({ label, required, checked, disabled, hint, error, name, value, invalid, }) => {
|
|
4
4
|
return html `<b2b-checkbox
|
|
5
|
-
label
|
|
6
|
-
required
|
|
7
|
-
checked
|
|
8
|
-
disabled
|
|
9
|
-
hint
|
|
10
|
-
error
|
|
11
|
-
name
|
|
12
|
-
value
|
|
13
|
-
invalid
|
|
5
|
+
label=${label}
|
|
6
|
+
required=${required}
|
|
7
|
+
checked=${checked}
|
|
8
|
+
disabled=${disabled}
|
|
9
|
+
hint=${hint}
|
|
10
|
+
error=${error}
|
|
11
|
+
name=${name}
|
|
12
|
+
value=${value}
|
|
13
|
+
invalid=${invalid}></b2b-checkbox>`;
|
|
14
14
|
};
|
|
15
15
|
const defaultArgs = {
|
|
16
16
|
label: 'Checkbox Label',
|
|
@@ -4,15 +4,15 @@ const Template = ({ label, required, disabled, invalid, hint, error, alignment,
|
|
|
4
4
|
const firstLabel = 'One';
|
|
5
5
|
const secondLabel = 'Two';
|
|
6
6
|
return html `<b2b-checkbox-group
|
|
7
|
-
label
|
|
8
|
-
required
|
|
9
|
-
disabled
|
|
10
|
-
invalid
|
|
11
|
-
hint
|
|
12
|
-
error
|
|
13
|
-
alignment
|
|
14
|
-
<b2b-checkbox label
|
|
15
|
-
<b2b-checkbox label
|
|
7
|
+
label=${label}
|
|
8
|
+
required=${required}
|
|
9
|
+
disabled=${disabled}
|
|
10
|
+
invalid=${invalid}
|
|
11
|
+
hint=${hint}
|
|
12
|
+
error=${error}
|
|
13
|
+
alignment=${alignment}>
|
|
14
|
+
<b2b-checkbox label=${firstLabel}></b2b-checkbox>
|
|
15
|
+
<b2b-checkbox label=${secondLabel}></b2b-checkbox>
|
|
16
16
|
</b2b-checkbox-group>`;
|
|
17
17
|
};
|
|
18
18
|
const defaultArgs = {
|
|
@@ -28,13 +28,13 @@ const meta = {
|
|
|
28
28
|
render: (_a) => {
|
|
29
29
|
var args = __rest(_a, []);
|
|
30
30
|
return html `<b2b-chip-component
|
|
31
|
-
custom-margin
|
|
32
|
-
label
|
|
33
|
-
type
|
|
34
|
-
label-style
|
|
35
|
-
disabled
|
|
36
|
-
value
|
|
37
|
-
has-close-button
|
|
31
|
+
custom-margin=${args.customMargin}
|
|
32
|
+
label=${args.label}
|
|
33
|
+
type=${args.type}
|
|
34
|
+
label-style=${args.labelStyle}
|
|
35
|
+
disabled=${args.disabled}
|
|
36
|
+
value=${args.value}
|
|
37
|
+
has-close-button=${args.hasCloseButton} />`;
|
|
38
38
|
},
|
|
39
39
|
};
|
|
40
40
|
export default meta;
|
|
@@ -58,12 +58,12 @@ export const story040WithTruncatedText = {
|
|
|
58
58
|
return html `<div
|
|
59
59
|
style="width: 170px; border: 1px solid grey; border-radius: 3px; padding: 6px;">
|
|
60
60
|
<b2b-chip-component
|
|
61
|
-
label
|
|
62
|
-
type
|
|
63
|
-
label-style
|
|
64
|
-
disabled
|
|
65
|
-
value
|
|
66
|
-
has-close-button
|
|
61
|
+
label=${args.label}
|
|
62
|
+
type=${args.type}
|
|
63
|
+
label-style=${args.labelStyle}
|
|
64
|
+
disabled=${args.disabled}
|
|
65
|
+
value=${args.value}
|
|
66
|
+
has-close-button=${args.hasCloseButton} />
|
|
67
67
|
</div>`;
|
|
68
68
|
},
|
|
69
69
|
};
|
|
@@ -34,11 +34,11 @@ const meta = {
|
|
|
34
34
|
var args = __rest(_a, []);
|
|
35
35
|
return html `<div style="margin-left: 16px;width: 300px">
|
|
36
36
|
<b2b-custom-dropdown
|
|
37
|
-
placeholder
|
|
38
|
-
dropshadow
|
|
39
|
-
border
|
|
40
|
-
alignment
|
|
41
|
-
opened
|
|
37
|
+
placeholder=${args.placeholder}
|
|
38
|
+
dropshadow=${args.dropshadow}
|
|
39
|
+
border=${args.border}
|
|
40
|
+
alignment=${args.alignment}
|
|
41
|
+
opened=${args.opened}>
|
|
42
42
|
<b2b-paragraph slot="trigger">
|
|
43
43
|
This is a custom dropdown
|
|
44
44
|
<b2b-icon-100
|
|
@@ -49,72 +49,72 @@ const meta = {
|
|
|
49
49
|
<b2b-custom-dropdown-option
|
|
50
50
|
slot="option"
|
|
51
51
|
option="Option 1"
|
|
52
|
-
separator
|
|
53
|
-
hover-icon
|
|
54
|
-
selected-icon
|
|
55
|
-
hover-icon-color
|
|
56
|
-
selected-icon-color
|
|
57
|
-
selected
|
|
58
|
-
disabled
|
|
52
|
+
separator=${args.separator}
|
|
53
|
+
hover-icon=${args.hoverIcon}
|
|
54
|
+
selected-icon=${args.selectedIcon}
|
|
55
|
+
hover-icon-color=${args.hoverIconColor}
|
|
56
|
+
selected-icon-color=${args.selectedIconColor}
|
|
57
|
+
selected=${args.selected}
|
|
58
|
+
disabled=${args.disabled}>
|
|
59
59
|
</b2b-custom-dropdown-option>
|
|
60
60
|
<b2b-custom-dropdown-option
|
|
61
61
|
slot="option"
|
|
62
62
|
option="Option 2"
|
|
63
|
-
separator
|
|
64
|
-
hover-icon
|
|
65
|
-
selected-icon
|
|
66
|
-
hover-icon-color
|
|
67
|
-
selected-icon-color
|
|
68
|
-
disabled
|
|
63
|
+
separator=${args.separator}
|
|
64
|
+
hover-icon=${args.hoverIcon}
|
|
65
|
+
selected-icon=${args.selectedIcon}
|
|
66
|
+
hover-icon-color=${args.hoverIconColor}
|
|
67
|
+
selected-icon-color=${args.selectedIconColor}
|
|
68
|
+
disabled=${args.disabled}>
|
|
69
69
|
</b2b-custom-dropdown-option>
|
|
70
70
|
<b2b-custom-dropdown-option
|
|
71
71
|
slot="option"
|
|
72
72
|
option="Option 3"
|
|
73
|
-
separator
|
|
74
|
-
hover-icon
|
|
75
|
-
selected-icon
|
|
76
|
-
hover-icon-color
|
|
77
|
-
selected-icon-color
|
|
78
|
-
disabled
|
|
73
|
+
separator=${args.separator}
|
|
74
|
+
hover-icon=${args.hoverIcon}
|
|
75
|
+
selected-icon=${args.selectedIcon}
|
|
76
|
+
hover-icon-color=${args.hoverIconColor}
|
|
77
|
+
selected-icon-color=${args.selectedIconColor}
|
|
78
|
+
disabled=${args.disabled}>
|
|
79
79
|
</b2b-custom-dropdown-option>
|
|
80
80
|
<b2b-custom-dropdown-option
|
|
81
81
|
slot="option"
|
|
82
82
|
option="Option 4"
|
|
83
|
-
separator
|
|
84
|
-
hover-icon
|
|
85
|
-
selected-icon
|
|
86
|
-
hover-icon-color
|
|
87
|
-
selected-icon-color
|
|
88
|
-
disabled
|
|
83
|
+
separator=${args.separator}
|
|
84
|
+
hover-icon=${args.hoverIcon}
|
|
85
|
+
selected-icon=${args.selectedIcon}
|
|
86
|
+
hover-icon-color=${args.hoverIconColor}
|
|
87
|
+
selected-icon-color=${args.selectedIconColor}
|
|
88
|
+
disabled=${args.disabled}>
|
|
89
89
|
</b2b-custom-dropdown-option>
|
|
90
90
|
<b2b-custom-dropdown-option
|
|
91
91
|
slot="option"
|
|
92
92
|
option="Option 5"
|
|
93
|
-
separator
|
|
94
|
-
hover-icon
|
|
95
|
-
selected-icon
|
|
96
|
-
hover-icon-color
|
|
97
|
-
selected-icon-color
|
|
98
|
-
disabled
|
|
93
|
+
separator=${args.separator}
|
|
94
|
+
hover-icon=${args.hoverIcon}
|
|
95
|
+
selected-icon=${args.selectedIcon}
|
|
96
|
+
hover-icon-color=${args.hoverIconColor}
|
|
97
|
+
selected-icon-color=${args.selectedIconColor}
|
|
98
|
+
disabled=${args.disabled}>
|
|
99
99
|
</b2b-custom-dropdown-option>
|
|
100
100
|
<b2b-custom-dropdown-option
|
|
101
101
|
slot="option"
|
|
102
102
|
option="Option 6"
|
|
103
|
-
separator
|
|
104
|
-
hover-icon
|
|
105
|
-
selected-icon
|
|
106
|
-
hover-icon-color
|
|
107
|
-
selected-icon-color
|
|
108
|
-
disabled
|
|
103
|
+
separator=${args.separator}
|
|
104
|
+
hover-icon=${args.hoverIcon}
|
|
105
|
+
selected-icon=${args.selectedIcon}
|
|
106
|
+
hover-icon-color=${args.hoverIconColor}
|
|
107
|
+
selected-icon-color=${args.selectedIconColor}
|
|
108
|
+
disabled=${args.disabled}>
|
|
109
109
|
</b2b-custom-dropdown-option>
|
|
110
110
|
<b2b-custom-dropdown-option
|
|
111
111
|
slot="option"
|
|
112
112
|
option="Option 7"
|
|
113
|
-
hover-icon
|
|
114
|
-
selected-icon
|
|
115
|
-
hover-icon-color
|
|
116
|
-
selected-icon-color
|
|
117
|
-
disabled
|
|
113
|
+
hover-icon=${args.hoverIcon}
|
|
114
|
+
selected-icon=${args.selectedIcon}
|
|
115
|
+
hover-icon-color=${args.hoverIconColor}
|
|
116
|
+
selected-icon-color=${args.selectedIconColor}
|
|
117
|
+
disabled=${args.disabled}>
|
|
118
118
|
</b2b-custom-dropdown-option>
|
|
119
119
|
</b2b-custom-dropdown>
|
|
120
120
|
</div>`;
|
|
@@ -45,7 +45,7 @@ const meta = {
|
|
|
45
45
|
disable-future-dates=${args.disableFutureDates}
|
|
46
46
|
disable-weekends=${args.disableWeekends}
|
|
47
47
|
disable-dates=${args.disableDates}
|
|
48
|
-
.pre-selected-date
|
|
48
|
+
.pre-selected-date=${args.preSelectedDate}
|
|
49
49
|
disable-days=${args.disableDays}
|
|
50
50
|
disable-dates-until=${args.disableDatesUntil}
|
|
51
51
|
disable-dates-from=${args.disableDatesFrom}
|
|
@@ -65,7 +65,7 @@ const meta = {
|
|
|
65
65
|
disable-future-dates=${args.disableFutureDates}
|
|
66
66
|
disable-weekends=${args.disableWeekends}
|
|
67
67
|
disable-dates=${args.disableDates}
|
|
68
|
-
pre-selected-date
|
|
68
|
+
pre-selected-date=${args.preSelectedDate}
|
|
69
69
|
disable-days=${args.disableDays}
|
|
70
70
|
disable-dates-until=${args.disableDatesUntil}
|
|
71
71
|
disable-dates-from=${args.disableDatesFrom}
|
|
@@ -47,12 +47,27 @@ describe('B2B-Dropdown', () => {
|
|
|
47
47
|
element = await page.find('b2b-dropdown');
|
|
48
48
|
expect(element).toHaveClass('b2b-dropdown--error');
|
|
49
49
|
});
|
|
50
|
-
it('ensure clear icon is visible', async () => {
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
it('ensure clear icon is visible when the clear is enabled', async () => {
|
|
51
|
+
const dropdown = await page.find('b2b-dropdown');
|
|
52
|
+
dropdown.setProperty('clear', true);
|
|
53
|
+
dropdown.setProperty('selectedText', 'Option 1');
|
|
54
|
+
await page.waitForChanges();
|
|
55
|
+
const clearIcon = await page.find('b2b-dropdown >>> b2b-icon-100.b2b-dropdown__clear-icon');
|
|
53
56
|
expect(clearIcon).not.toBeNull();
|
|
54
57
|
});
|
|
58
|
+
it('ensure clear icon is not visible when the clear is disabled', async () => {
|
|
59
|
+
const dropdown = await page.find('b2b-dropdown');
|
|
60
|
+
dropdown.setProperty('clear', false);
|
|
61
|
+
dropdown.setProperty('selectedText', 'Option 1');
|
|
62
|
+
await page.waitForChanges();
|
|
63
|
+
const clearIcon = await page.find('b2b-dropdown >>> b2b-icon-100.b2b-dropdown__clear-icon');
|
|
64
|
+
expect(clearIcon).toBeNull();
|
|
65
|
+
});
|
|
55
66
|
it('ensure text is cleared when clear icon is clicked', async () => {
|
|
67
|
+
const dropdown = await page.find('b2b-dropdown');
|
|
68
|
+
dropdown.setProperty('clear', true);
|
|
69
|
+
dropdown.setProperty('selectedText', 'Option 1');
|
|
70
|
+
await page.waitForChanges();
|
|
56
71
|
const clearIcon = await page.find('b2b-dropdown >>> b2b-icon-100.b2b-dropdown__clear-icon');
|
|
57
72
|
expect(clearIcon).not.toBeNull();
|
|
58
73
|
await clearIcon.click();
|
|
@@ -64,6 +79,9 @@ describe('B2B-Dropdown', () => {
|
|
|
64
79
|
it('ensure text is cleared when clear icon is clicked when search is enabled', async () => {
|
|
65
80
|
let dropdown = await page.find('b2b-dropdown');
|
|
66
81
|
dropdown.setProperty('search', true);
|
|
82
|
+
dropdown.setProperty('clear', true);
|
|
83
|
+
dropdown.setProperty('selectedText', 'Option 1');
|
|
84
|
+
await page.waitForChanges();
|
|
67
85
|
const clearIcon = await page.find('b2b-dropdown >>> b2b-icon-100.b2b-dropdown__clear-icon');
|
|
68
86
|
expect(clearIcon).not.toBeNull();
|
|
69
87
|
await clearIcon.click();
|
|
@@ -74,6 +92,7 @@ describe('B2B-Dropdown', () => {
|
|
|
74
92
|
});
|
|
75
93
|
it('should clear the selection and reset to placeholder', async () => {
|
|
76
94
|
let dropdown = await page.find('b2b-dropdown');
|
|
95
|
+
dropdown.setProperty('clear', true);
|
|
77
96
|
await dropdown.callMethod('clearSelection');
|
|
78
97
|
await page.waitForChanges();
|
|
79
98
|
dropdown = await page.find('b2b-dropdown');
|
|
@@ -117,6 +117,7 @@ export class DropdownComponent {
|
|
|
117
117
|
};
|
|
118
118
|
this.label = undefined;
|
|
119
119
|
this.search = false;
|
|
120
|
+
this.clear = false;
|
|
120
121
|
this.required = false;
|
|
121
122
|
this.name = undefined;
|
|
122
123
|
this.placeholder = 'Select an option...';
|
|
@@ -209,20 +210,24 @@ export class DropdownComponent {
|
|
|
209
210
|
const showHint = this.hint && !hasError;
|
|
210
211
|
const showError = this.error && hasError;
|
|
211
212
|
const filteredOptions = this.options.filter(opt => opt.label.toLowerCase().includes(this.searchValue.toLowerCase()));
|
|
212
|
-
return (h(Host, { key: '
|
|
213
|
+
return (h(Host, { key: '785fa8173bebeb605d409ea84ca3e334006336ab', class: {
|
|
213
214
|
'b2b-dropdown': true,
|
|
214
215
|
'b2b-dropdown--error': hasError,
|
|
215
216
|
'b2b-dropdown--disabled': this.disabled || this.groupDisabled,
|
|
216
|
-
} }, this.label && (h("b2b-input-label", { id: this.name, required: this.required }, this.label)), h("div", { key: '
|
|
217
|
+
} }, this.label && (h("b2b-input-label", { id: this.name, required: this.required }, this.label)), h("div", { key: 'f1d77d99955532bf600ab91d36b716d1f02ede62', class: "b2b-dropdown__wrapper", onFocus: this.onFocus, onBlur: this.onBlur }, this.search ? (h("b2b-input", { placeholder: this.placeholder, invalid: hasError, value: this.truncatedText || this.searchValue, disabled: this.disabled || this.groupDisabled, "onB2b-focus": () => {
|
|
217
218
|
this.isOpen = true;
|
|
218
219
|
this.focused = true;
|
|
219
220
|
}, "onB2b-input": this.handleSearchInput }, h("div", { slot: "end" }, (this.selectedText || this.searchValue) &&
|
|
220
221
|
!this.disabled &&
|
|
221
|
-
!this.groupDisabled &&
|
|
222
|
+
!this.groupDisabled &&
|
|
223
|
+
this.clear && (h("b2b-icon-100", { class: "b2b-dropdown__clear-icon", icon: 'b2b_icon-close', clickable: true, onClick: this.clearSelectedValue })), h("b2b-icon-100", { class: "b2b-dropdown__arrow-icon", icon: 'b2b_icon-arrow-down', onClick: this.toggleDropdownWithSearch })))) : (h("div", { class: {
|
|
222
224
|
'b2b-dropdown__select': true,
|
|
223
225
|
'b2b-dropdown__select--open': this.isOpen,
|
|
224
226
|
'b2b-dropdown__select--focused': this.focused,
|
|
225
|
-
}, ref: el => (this.selectEl = el), onClick: this.toggleDropdown, role: "combobox", "aria-expanded": `${this.isOpen}`, "aria-labelledby": this.name }, this.truncatedText, this.selectedText &&
|
|
227
|
+
}, ref: el => (this.selectEl = el), onClick: this.toggleDropdown, role: "combobox", "aria-expanded": `${this.isOpen}`, "aria-labelledby": this.name }, this.truncatedText, this.selectedText &&
|
|
228
|
+
!this.disabled &&
|
|
229
|
+
!this.groupDisabled &&
|
|
230
|
+
this.clear && (h("b2b-icon-100", { class: "b2b-dropdown__clear-icon", onClick: this.clearSelectedValue, clickable: true, icon: 'b2b_icon-close' })))), this.isOpen && (h("div", { class: "b2b-dropdown__options", role: "listbox" }, filteredOptions.map(option => (h("div", { key: option.value, class: {
|
|
226
231
|
'b2b-dropdown__option': true,
|
|
227
232
|
'b2b-dropdown__option--selected': option.selected,
|
|
228
233
|
'b2b-dropdown__option--disabled': option.disabled,
|
|
@@ -277,6 +282,24 @@ export class DropdownComponent {
|
|
|
277
282
|
"reflect": true,
|
|
278
283
|
"defaultValue": "false"
|
|
279
284
|
},
|
|
285
|
+
"clear": {
|
|
286
|
+
"type": "boolean",
|
|
287
|
+
"mutable": false,
|
|
288
|
+
"complexType": {
|
|
289
|
+
"original": "boolean",
|
|
290
|
+
"resolved": "boolean",
|
|
291
|
+
"references": {}
|
|
292
|
+
},
|
|
293
|
+
"required": false,
|
|
294
|
+
"optional": false,
|
|
295
|
+
"docs": {
|
|
296
|
+
"tags": [],
|
|
297
|
+
"text": "Adds a clear button to the select to clear the current selection."
|
|
298
|
+
},
|
|
299
|
+
"attribute": "clear",
|
|
300
|
+
"reflect": true,
|
|
301
|
+
"defaultValue": "false"
|
|
302
|
+
},
|
|
280
303
|
"required": {
|
|
281
304
|
"type": "boolean",
|
|
282
305
|
"mutable": false,
|