@1024pix/pix-ui 54.6.0 → 54.7.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.
|
@@ -50,10 +50,19 @@
|
|
|
50
50
|
{{on-enter-action (fn @onChange option)}}
|
|
51
51
|
{{on-space-action (fn @onChange option)}}
|
|
52
52
|
>
|
|
53
|
+
|
|
54
|
+
{{#if option.icon}}
|
|
55
|
+
<PixIcon role="presentation" @name={{option.icon}} @title={{option.iconTitle}} />
|
|
56
|
+
{{/if}}
|
|
57
|
+
|
|
53
58
|
{{option.label}}
|
|
54
59
|
|
|
55
60
|
{{#if (eq option.value @value)}}
|
|
56
|
-
<PixIcon
|
|
61
|
+
<PixIcon
|
|
62
|
+
@name="check"
|
|
63
|
+
role="presentation"
|
|
64
|
+
class="pix-select-list-category__option-checked"
|
|
65
|
+
/>
|
|
57
66
|
{{/if}}
|
|
58
67
|
</li>
|
|
59
68
|
{{/each}}
|
|
@@ -74,10 +83,18 @@
|
|
|
74
83
|
{{on-enter-action (fn @onChange option)}}
|
|
75
84
|
{{on-space-action (fn @onChange option)}}
|
|
76
85
|
>
|
|
86
|
+
{{#if option.icon}}
|
|
87
|
+
<PixIcon role="presentation" @name={{option.icon}} @title={{option.iconTitle}} />
|
|
88
|
+
{{/if}}
|
|
89
|
+
|
|
77
90
|
{{option.label}}
|
|
78
91
|
|
|
79
92
|
{{#if (eq option.value @value)}}
|
|
80
|
-
<PixIcon
|
|
93
|
+
<PixIcon
|
|
94
|
+
@name="check"
|
|
95
|
+
role="presentation"
|
|
96
|
+
class="pix-select-list-category__option-checked"
|
|
97
|
+
/>
|
|
81
98
|
{{/if}}
|
|
82
99
|
</li>
|
|
83
100
|
{{/each}}
|
|
@@ -29,12 +29,12 @@ export default class PixSelectList extends Component {
|
|
|
29
29
|
|
|
30
30
|
if (!this.displayCategory) return options;
|
|
31
31
|
|
|
32
|
-
options.forEach(({ category, value, label }) => {
|
|
32
|
+
options.forEach(({ category, value, label, icon, iconTitle }) => {
|
|
33
33
|
const categoryIndex = results.findIndex((result) => result.category === category);
|
|
34
34
|
if (categoryIndex !== -1) {
|
|
35
|
-
results[categoryIndex].options.push({ value, label });
|
|
35
|
+
results[categoryIndex].options.push({ value, label, icon, iconTitle });
|
|
36
36
|
} else {
|
|
37
|
-
results.push({ category, options: [{ label, value }] });
|
|
37
|
+
results.push({ category, options: [{ label, value, icon, iconTitle }] });
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
return results;
|
|
@@ -30,6 +30,9 @@
|
|
|
30
30
|
@extend %pix-body-s;
|
|
31
31
|
|
|
32
32
|
position: relative;
|
|
33
|
+
display: flex;
|
|
34
|
+
gap: var(--pix-spacing-2x);
|
|
35
|
+
align-items: center;
|
|
33
36
|
padding: var(--pix-spacing-2x) var(--pix-spacing-10x) var(--pix-spacing-2x) var(--pix-spacing-3x);
|
|
34
37
|
color: var(--pix-neutral-900);
|
|
35
38
|
border-radius: 0.25rem;
|
|
@@ -46,19 +49,19 @@
|
|
|
46
49
|
cursor: pointer;
|
|
47
50
|
}
|
|
48
51
|
|
|
49
|
-
svg {
|
|
50
|
-
position: absolute;
|
|
51
|
-
top: 50%;
|
|
52
|
-
right: var(--pix-spacing-3x);
|
|
53
|
-
transform: translateY(-50%);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
52
|
&--selected {
|
|
57
53
|
color: var(--pix-primary-900);
|
|
58
54
|
font-weight: var(--pix-font-bold);
|
|
59
55
|
background-color: var(--pix-primary-10);
|
|
60
56
|
}
|
|
61
57
|
}
|
|
58
|
+
|
|
59
|
+
&__option-checked {
|
|
60
|
+
position: absolute;
|
|
61
|
+
top: 50%;
|
|
62
|
+
right: var(--pix-spacing-3x);
|
|
63
|
+
transform: translateY(-50%);
|
|
64
|
+
}
|
|
62
65
|
}
|
|
63
66
|
|
|
64
67
|
.pix-select-list__empty-search-message {
|