@educarehq/solaris-components 0.5.3 → 0.5.5
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.
|
@@ -1147,7 +1147,7 @@ class SolarisPopover {
|
|
|
1147
1147
|
host.style.left = '0px';
|
|
1148
1148
|
host.style.display = 'none';
|
|
1149
1149
|
host.style.position = 'fixed';
|
|
1150
|
-
host.style.zIndex = 'var(--solaris-z-
|
|
1150
|
+
host.style.zIndex = 'var(--solaris-z-max)';
|
|
1151
1151
|
host.className = `solaris-popover-panel ${this.panelClass || ''}`.trim();
|
|
1152
1152
|
const view = this.panelDir.templateRef.createEmbeddedView({});
|
|
1153
1153
|
this.appRef.attachView(view);
|
|
@@ -7682,6 +7682,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
7682
7682
|
}], customErrorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "customErrorKey", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], customErrorParams: [{ type: i0.Input, args: [{ isSignal: true, alias: "customErrorParams", required: false }] }] } });
|
|
7683
7683
|
|
|
7684
7684
|
class SolarisSelect {
|
|
7685
|
+
translationService = inject(SOLARIS_TRANSLATION);
|
|
7685
7686
|
destroyRef = inject(DestroyRef);
|
|
7686
7687
|
injector = inject(Injector);
|
|
7687
7688
|
field = inject(SolarisFormFieldController, { optional: true });
|
|
@@ -7708,24 +7709,6 @@ class SolarisSelect {
|
|
|
7708
7709
|
if (changed)
|
|
7709
7710
|
this._value.set(next);
|
|
7710
7711
|
}
|
|
7711
|
-
sameCvaValue(a, b) {
|
|
7712
|
-
if (this.multiple) {
|
|
7713
|
-
const aa = Array.isArray(a) ? a : [];
|
|
7714
|
-
const bb = Array.isArray(b) ? b : [];
|
|
7715
|
-
if (aa.length !== bb.length)
|
|
7716
|
-
return false;
|
|
7717
|
-
for (let i = 0; i < aa.length; i++) {
|
|
7718
|
-
if (!this.eq(aa[i], bb[i]))
|
|
7719
|
-
return false;
|
|
7720
|
-
}
|
|
7721
|
-
return true;
|
|
7722
|
-
}
|
|
7723
|
-
if (a == null && b == null)
|
|
7724
|
-
return true;
|
|
7725
|
-
if (a == null || b == null)
|
|
7726
|
-
return false;
|
|
7727
|
-
return this.eq(a, b);
|
|
7728
|
-
}
|
|
7729
7712
|
_multiple = false;
|
|
7730
7713
|
set multiple(v) {
|
|
7731
7714
|
this._multiple = v;
|
|
@@ -7735,7 +7718,9 @@ class SolarisSelect {
|
|
|
7735
7718
|
if (!this._multiple && Array.isArray(cur))
|
|
7736
7719
|
this._value.set(null);
|
|
7737
7720
|
}
|
|
7738
|
-
get multiple() {
|
|
7721
|
+
get multiple() {
|
|
7722
|
+
return this._multiple;
|
|
7723
|
+
}
|
|
7739
7724
|
valueKey;
|
|
7740
7725
|
backKey = '';
|
|
7741
7726
|
placeholder = '';
|
|
@@ -7757,11 +7742,25 @@ class SolarisSelect {
|
|
|
7757
7742
|
if (v)
|
|
7758
7743
|
this.open.set(false);
|
|
7759
7744
|
}
|
|
7760
|
-
get disabled() {
|
|
7745
|
+
get disabled() {
|
|
7746
|
+
return this._disabled();
|
|
7747
|
+
}
|
|
7761
7748
|
open = signal(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
7762
7749
|
searchTerm = signal('', ...(ngDevMode ? [{ debugName: "searchTerm" }] : []));
|
|
7763
7750
|
activeIndex = signal(0, ...(ngDevMode ? [{ debugName: "activeIndex" }] : []));
|
|
7764
7751
|
showCount = signal(false, ...(ngDevMode ? [{ debugName: "showCount" }] : []));
|
|
7752
|
+
_value = signal(null, ...(ngDevMode ? [{ debugName: "_value" }] : []));
|
|
7753
|
+
_stack = signal([], ...(ngDevMode ? [{ debugName: "_stack" }] : []));
|
|
7754
|
+
selectedItems = computed(() => {
|
|
7755
|
+
const all = [];
|
|
7756
|
+
this.collectAllItems(this._rootNodes(), all);
|
|
7757
|
+
const v = this._value();
|
|
7758
|
+
if (this.multiple) {
|
|
7759
|
+
const arr = Array.isArray(v) ? v : [];
|
|
7760
|
+
return all.filter(it => arr.some(s => this.eq(s, it.value)));
|
|
7761
|
+
}
|
|
7762
|
+
return all.filter(it => v != null && this.eq(v, it.value));
|
|
7763
|
+
}, ...(ngDevMode ? [{ debugName: "selectedItems" }] : []));
|
|
7765
7764
|
showToken = computed(() => {
|
|
7766
7765
|
return this.selectedCount() > 0;
|
|
7767
7766
|
}, ...(ngDevMode ? [{ debugName: "showToken" }] : []));
|
|
@@ -7769,7 +7768,10 @@ class SolarisSelect {
|
|
|
7769
7768
|
const items = this.selectedItems();
|
|
7770
7769
|
if (!items.length)
|
|
7771
7770
|
return '';
|
|
7772
|
-
return items
|
|
7771
|
+
return items
|
|
7772
|
+
.map(it => this.itemLabel(it))
|
|
7773
|
+
.filter(Boolean)
|
|
7774
|
+
.join(this.selectionSeparator);
|
|
7773
7775
|
}, ...(ngDevMode ? [{ debugName: "selectedText" }] : []));
|
|
7774
7776
|
triggerValue = computed(() => {
|
|
7775
7777
|
if (this.isSearchMode())
|
|
@@ -7787,8 +7789,8 @@ class SolarisSelect {
|
|
|
7787
7789
|
if (this.searchTerm().length > 0)
|
|
7788
7790
|
return '';
|
|
7789
7791
|
return this.open() && this.searchable
|
|
7790
|
-
?
|
|
7791
|
-
:
|
|
7792
|
+
? this.searchPlaceholderKey || this.placeholderKey || ''
|
|
7793
|
+
: this.placeholderKey || '';
|
|
7792
7794
|
}, ...(ngDevMode ? [{ debugName: "inputPlaceholderKey" }] : []));
|
|
7793
7795
|
inputPlaceholderText = computed(() => {
|
|
7794
7796
|
if (this.selectedCount() > 0)
|
|
@@ -7796,21 +7798,9 @@ class SolarisSelect {
|
|
|
7796
7798
|
if (this.searchTerm().length > 0)
|
|
7797
7799
|
return '';
|
|
7798
7800
|
return this.open() && this.searchable
|
|
7799
|
-
?
|
|
7800
|
-
:
|
|
7801
|
+
? this.searchPlaceholder || this.placeholder || 'Search...'
|
|
7802
|
+
: this.placeholder || '';
|
|
7801
7803
|
}, ...(ngDevMode ? [{ debugName: "inputPlaceholderText" }] : []));
|
|
7802
|
-
_value = signal(null, ...(ngDevMode ? [{ debugName: "_value" }] : []));
|
|
7803
|
-
selectedItems = computed(() => {
|
|
7804
|
-
const all = [];
|
|
7805
|
-
this.collectAllItems(this._rootNodes(), all);
|
|
7806
|
-
const v = this._value();
|
|
7807
|
-
if (this.multiple) {
|
|
7808
|
-
const arr = Array.isArray(v) ? v : [];
|
|
7809
|
-
return all.filter(it => arr.some(s => this.eq(s, it.value)));
|
|
7810
|
-
}
|
|
7811
|
-
return all.filter(it => v != null && this.eq(v, it.value));
|
|
7812
|
-
}, ...(ngDevMode ? [{ debugName: "selectedItems" }] : []));
|
|
7813
|
-
_stack = signal([], ...(ngDevMode ? [{ debugName: "_stack" }] : []));
|
|
7814
7804
|
viewModel = computed(() => {
|
|
7815
7805
|
const lvl = this.currentLevel();
|
|
7816
7806
|
const ordered = this.applySelectedFirst(lvl.nodes);
|
|
@@ -7827,10 +7817,10 @@ class SolarisSelect {
|
|
|
7827
7817
|
static seq = 0;
|
|
7828
7818
|
_measureNonce = 0;
|
|
7829
7819
|
resizeObs;
|
|
7830
|
-
matchWidthEl = null;
|
|
7831
7820
|
propagateTouched = () => { };
|
|
7832
7821
|
propagateChange = () => { };
|
|
7833
7822
|
resolvedNgControl = undefined;
|
|
7823
|
+
matchWidthEl = null;
|
|
7834
7824
|
_id = `solaris-select-${++SolarisSelect.seq}`;
|
|
7835
7825
|
constructor() {
|
|
7836
7826
|
this.resetStack();
|
|
@@ -7859,8 +7849,8 @@ class SolarisSelect {
|
|
|
7859
7849
|
const trigger = this.triggerWrap?.nativeElement;
|
|
7860
7850
|
if (trigger) {
|
|
7861
7851
|
this.matchWidthEl =
|
|
7862
|
-
trigger.closest('.solaris-form-field')?.querySelector('.solaris-form-field__frame')
|
|
7863
|
-
|
|
7852
|
+
trigger.closest('.solaris-form-field')?.querySelector('.solaris-form-field__frame') ??
|
|
7853
|
+
null;
|
|
7864
7854
|
}
|
|
7865
7855
|
const el = this.triggerWrap?.nativeElement;
|
|
7866
7856
|
if (!el)
|
|
@@ -7880,8 +7870,64 @@ class SolarisSelect {
|
|
|
7880
7870
|
registerOnChange(fn) {
|
|
7881
7871
|
this.propagateChange = fn;
|
|
7882
7872
|
}
|
|
7883
|
-
registerOnTouched(fn) {
|
|
7884
|
-
|
|
7873
|
+
registerOnTouched(fn) {
|
|
7874
|
+
this.propagateTouched = fn;
|
|
7875
|
+
}
|
|
7876
|
+
setDisabledState(isDisabled) {
|
|
7877
|
+
this._disabled.set(isDisabled);
|
|
7878
|
+
}
|
|
7879
|
+
translate(key, params) {
|
|
7880
|
+
if (!key)
|
|
7881
|
+
return '';
|
|
7882
|
+
return this.translationService.translate(key, params);
|
|
7883
|
+
}
|
|
7884
|
+
itemLabel(item) {
|
|
7885
|
+
if (item.labelKey)
|
|
7886
|
+
return this.translate(item.labelKey);
|
|
7887
|
+
return item.label ?? item.searchText ?? '';
|
|
7888
|
+
}
|
|
7889
|
+
itemDescription(item) {
|
|
7890
|
+
if (item.descriptionKey)
|
|
7891
|
+
return this.translate(item.descriptionKey);
|
|
7892
|
+
return item.description ?? '';
|
|
7893
|
+
}
|
|
7894
|
+
itemEndText(item) {
|
|
7895
|
+
if (item.endTextKey)
|
|
7896
|
+
return this.translate(item.endTextKey);
|
|
7897
|
+
return item.endText ?? '';
|
|
7898
|
+
}
|
|
7899
|
+
itemSearchText(item) {
|
|
7900
|
+
return [
|
|
7901
|
+
item.searchText,
|
|
7902
|
+
this.itemLabel(item),
|
|
7903
|
+
this.itemDescription(item),
|
|
7904
|
+
this.itemEndText(item),
|
|
7905
|
+
item.labelKey,
|
|
7906
|
+
item.descriptionKey,
|
|
7907
|
+
item.endTextKey,
|
|
7908
|
+
]
|
|
7909
|
+
.filter(Boolean)
|
|
7910
|
+
.join(' ')
|
|
7911
|
+
.toLowerCase();
|
|
7912
|
+
}
|
|
7913
|
+
sameCvaValue(a, b) {
|
|
7914
|
+
if (this.multiple) {
|
|
7915
|
+
const aa = Array.isArray(a) ? a : [];
|
|
7916
|
+
const bb = Array.isArray(b) ? b : [];
|
|
7917
|
+
if (aa.length !== bb.length)
|
|
7918
|
+
return false;
|
|
7919
|
+
for (let i = 0; i < aa.length; i++) {
|
|
7920
|
+
if (!this.eq(aa[i], bb[i]))
|
|
7921
|
+
return false;
|
|
7922
|
+
}
|
|
7923
|
+
return true;
|
|
7924
|
+
}
|
|
7925
|
+
if (a == null && b == null)
|
|
7926
|
+
return true;
|
|
7927
|
+
if (a == null || b == null)
|
|
7928
|
+
return false;
|
|
7929
|
+
return this.eq(a, b);
|
|
7930
|
+
}
|
|
7885
7931
|
eq(a, b) {
|
|
7886
7932
|
if (this.compareWith)
|
|
7887
7933
|
return this.compareWith(a, b);
|
|
@@ -7900,15 +7946,13 @@ class SolarisSelect {
|
|
|
7900
7946
|
this.field?.registerControl(this.resolvedNgControl);
|
|
7901
7947
|
}
|
|
7902
7948
|
}
|
|
7903
|
-
itemLabel(item) {
|
|
7904
|
-
return item.label ?? item.searchText ?? '';
|
|
7905
|
-
}
|
|
7906
7949
|
collectAllItems(nodes, out) {
|
|
7907
7950
|
for (const n of nodes) {
|
|
7908
7951
|
if (n.kind === 'item') {
|
|
7909
7952
|
out.push(n);
|
|
7910
|
-
if (n.children?.length)
|
|
7953
|
+
if (n.children?.length) {
|
|
7911
7954
|
this.collectAllItems(n.children, out);
|
|
7955
|
+
}
|
|
7912
7956
|
}
|
|
7913
7957
|
else if (n.kind === 'group') {
|
|
7914
7958
|
this.collectAllItems(n.items, out);
|
|
@@ -7930,7 +7974,14 @@ class SolarisSelect {
|
|
|
7930
7974
|
enterChildren(item) {
|
|
7931
7975
|
if (!item.children?.length)
|
|
7932
7976
|
return;
|
|
7933
|
-
this._stack.set([
|
|
7977
|
+
this._stack.set([
|
|
7978
|
+
...this._stack(),
|
|
7979
|
+
{
|
|
7980
|
+
title: item.childrenTitle,
|
|
7981
|
+
titleKey: item.childrenTitleKey,
|
|
7982
|
+
nodes: item.children,
|
|
7983
|
+
},
|
|
7984
|
+
]);
|
|
7934
7985
|
this.activeIndex.set(0);
|
|
7935
7986
|
this.scheduleFocusTrigger();
|
|
7936
7987
|
}
|
|
@@ -7939,8 +7990,7 @@ class SolarisSelect {
|
|
|
7939
7990
|
if (!term)
|
|
7940
7991
|
return nodes;
|
|
7941
7992
|
const matchItem = (it) => {
|
|
7942
|
-
|
|
7943
|
-
return hay.includes(term);
|
|
7993
|
+
return this.itemSearchText(it).includes(term);
|
|
7944
7994
|
};
|
|
7945
7995
|
const walk = (list) => {
|
|
7946
7996
|
const res = [];
|
|
@@ -7951,14 +8001,16 @@ class SolarisSelect {
|
|
|
7951
8001
|
}
|
|
7952
8002
|
if (n.kind === 'group') {
|
|
7953
8003
|
const sub = walk(n.items);
|
|
7954
|
-
if (sub.some(x => x.kind !== 'divider'))
|
|
8004
|
+
if (sub.some(x => x.kind !== 'divider')) {
|
|
7955
8005
|
res.push({ ...n, items: sub });
|
|
8006
|
+
}
|
|
7956
8007
|
continue;
|
|
7957
8008
|
}
|
|
7958
8009
|
if (n.children?.length) {
|
|
7959
8010
|
const sub = walk(n.children);
|
|
7960
|
-
if (matchItem(n) || sub.some(x => x.kind !== 'divider'))
|
|
8011
|
+
if (matchItem(n) || sub.some(x => x.kind !== 'divider')) {
|
|
7961
8012
|
res.push({ ...n, children: sub });
|
|
8013
|
+
}
|
|
7962
8014
|
}
|
|
7963
8015
|
else if (matchItem(n)) {
|
|
7964
8016
|
res.push(n);
|
|
@@ -7997,17 +8049,26 @@ class SolarisSelect {
|
|
|
7997
8049
|
const items = [];
|
|
7998
8050
|
const others = [];
|
|
7999
8051
|
for (const n of segment) {
|
|
8000
|
-
if (n.kind === 'item')
|
|
8052
|
+
if (n.kind === 'item') {
|
|
8001
8053
|
items.push(n);
|
|
8002
|
-
|
|
8054
|
+
}
|
|
8055
|
+
else if (n.kind === 'group') {
|
|
8003
8056
|
others.push({ ...n, items: this.applySelectedFirst(n.items) });
|
|
8004
|
-
|
|
8057
|
+
}
|
|
8058
|
+
else {
|
|
8005
8059
|
others.push(n);
|
|
8060
|
+
}
|
|
8006
8061
|
}
|
|
8007
8062
|
const sel = [];
|
|
8008
8063
|
const non = [];
|
|
8009
|
-
for (const it of items)
|
|
8010
|
-
(selected(it)
|
|
8064
|
+
for (const it of items) {
|
|
8065
|
+
if (selected(it)) {
|
|
8066
|
+
sel.push(it);
|
|
8067
|
+
}
|
|
8068
|
+
else {
|
|
8069
|
+
non.push(it);
|
|
8070
|
+
}
|
|
8071
|
+
}
|
|
8011
8072
|
return [...sel, ...non, ...others];
|
|
8012
8073
|
};
|
|
8013
8074
|
const res = [];
|
|
@@ -8023,8 +8084,9 @@ class SolarisSelect {
|
|
|
8023
8084
|
flush();
|
|
8024
8085
|
res.push(n);
|
|
8025
8086
|
}
|
|
8026
|
-
else
|
|
8087
|
+
else {
|
|
8027
8088
|
buf.push(n);
|
|
8089
|
+
}
|
|
8028
8090
|
}
|
|
8029
8091
|
flush();
|
|
8030
8092
|
return this.cleanupDividers(res);
|
|
@@ -8094,10 +8156,12 @@ class SolarisSelect {
|
|
|
8094
8156
|
const cur = this._value();
|
|
8095
8157
|
const arr = Array.isArray(cur) ? [...cur] : [];
|
|
8096
8158
|
const idx = arr.findIndex(v => this.eq(v, value));
|
|
8097
|
-
if (idx >= 0)
|
|
8159
|
+
if (idx >= 0) {
|
|
8098
8160
|
arr.splice(idx, 1);
|
|
8099
|
-
|
|
8161
|
+
}
|
|
8162
|
+
else {
|
|
8100
8163
|
arr.push(value);
|
|
8164
|
+
}
|
|
8101
8165
|
this.setValue(arr);
|
|
8102
8166
|
this.searchTerm.set('');
|
|
8103
8167
|
this.activeIndex.set(0);
|
|
@@ -8131,22 +8195,25 @@ class SolarisSelect {
|
|
|
8131
8195
|
openFromTrigger() {
|
|
8132
8196
|
if (this.disabled)
|
|
8133
8197
|
return;
|
|
8134
|
-
if (!this.open())
|
|
8198
|
+
if (!this.open()) {
|
|
8135
8199
|
this.open.set(true);
|
|
8200
|
+
}
|
|
8136
8201
|
}
|
|
8137
8202
|
toggleOpen() {
|
|
8138
8203
|
if (this.disabled)
|
|
8139
8204
|
return;
|
|
8140
8205
|
const next = !this.open();
|
|
8141
|
-
if (next)
|
|
8206
|
+
if (next) {
|
|
8142
8207
|
this.searchTerm.set('');
|
|
8208
|
+
}
|
|
8143
8209
|
this.open.set(next);
|
|
8144
8210
|
}
|
|
8145
8211
|
onTriggerInput(v) {
|
|
8146
8212
|
if (this.disabled)
|
|
8147
8213
|
return;
|
|
8148
|
-
if (!this.open())
|
|
8214
|
+
if (!this.open()) {
|
|
8149
8215
|
this.open.set(true);
|
|
8216
|
+
}
|
|
8150
8217
|
this.searchTerm.set(v);
|
|
8151
8218
|
this.activeIndex.set(0);
|
|
8152
8219
|
}
|
|
@@ -8170,7 +8237,12 @@ class SolarisSelect {
|
|
|
8170
8237
|
}
|
|
8171
8238
|
return;
|
|
8172
8239
|
}
|
|
8173
|
-
if (ev.key === 'ArrowDown' ||
|
|
8240
|
+
if (ev.key === 'ArrowDown' ||
|
|
8241
|
+
ev.key === 'ArrowUp' ||
|
|
8242
|
+
ev.key === 'Home' ||
|
|
8243
|
+
ev.key === 'End' ||
|
|
8244
|
+
ev.key === 'Enter' ||
|
|
8245
|
+
ev.key === 'Escape') {
|
|
8174
8246
|
this.onPanelKeydown(ev);
|
|
8175
8247
|
return;
|
|
8176
8248
|
}
|
|
@@ -8282,9 +8354,12 @@ class SolarisSelect {
|
|
|
8282
8354
|
const current = this.showCount();
|
|
8283
8355
|
const marginForward = 1;
|
|
8284
8356
|
const marginBack = 3;
|
|
8285
|
-
const next = current
|
|
8286
|
-
|
|
8357
|
+
const next = current
|
|
8358
|
+
? needed > available - marginBack
|
|
8359
|
+
: needed > available + marginForward;
|
|
8360
|
+
if (next !== current) {
|
|
8287
8361
|
this.showCount.set(next);
|
|
8362
|
+
}
|
|
8288
8363
|
}
|
|
8289
8364
|
px(v) {
|
|
8290
8365
|
const first = (v ?? '0').split(' ')[0];
|
|
@@ -8294,8 +8369,9 @@ class SolarisSelect {
|
|
|
8294
8369
|
scheduleFocusTrigger() {
|
|
8295
8370
|
requestAnimationFrame(() => {
|
|
8296
8371
|
this.triggerInput?.nativeElement?.focus?.();
|
|
8297
|
-
if (this.searchable)
|
|
8372
|
+
if (this.searchable) {
|
|
8298
8373
|
this.triggerInput?.nativeElement?.select?.();
|
|
8374
|
+
}
|
|
8299
8375
|
});
|
|
8300
8376
|
}
|
|
8301
8377
|
isSelectableValue(v) {
|
|
@@ -8313,8 +8389,9 @@ class SolarisSelect {
|
|
|
8313
8389
|
selectable = !n.children?.length;
|
|
8314
8390
|
return;
|
|
8315
8391
|
}
|
|
8316
|
-
if (n.children?.length)
|
|
8392
|
+
if (n.children?.length) {
|
|
8317
8393
|
walk(n.children);
|
|
8394
|
+
}
|
|
8318
8395
|
}
|
|
8319
8396
|
}
|
|
8320
8397
|
};
|
|
@@ -8330,13 +8407,23 @@ class SolarisSelect {
|
|
|
8330
8407
|
}
|
|
8331
8408
|
selectedCountLabel() {
|
|
8332
8409
|
const count = this.selectedCount();
|
|
8333
|
-
if (this.
|
|
8410
|
+
if (this.selectedCountKey) {
|
|
8411
|
+
return this.translate(this.selectedCountKey, { count });
|
|
8412
|
+
}
|
|
8413
|
+
if (this.selectedCountText) {
|
|
8334
8414
|
return this.selectedCountText.replace('{count}', String(count));
|
|
8415
|
+
}
|
|
8335
8416
|
return `${count} selecionados`;
|
|
8336
8417
|
}
|
|
8337
8418
|
trackRow = (_, r) => r.key;
|
|
8338
8419
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8339
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisSelect, isStandalone: true, selector: "solaris-select", inputs: { items: "items", multiple: "multiple", valueKey: "valueKey", backKey: "backKey", placeholder: "placeholder", placeholderKey: "placeholderKey", searchable: "searchable", selectedCountKey: "selectedCountKey", selectedFirst: "selectedFirst", searchPlaceholder: "searchPlaceholder", selectedCountText: "selectedCountText", panelMaxHeight: "panelMaxHeight", searchPlaceholderKey: "searchPlaceholderKey", selectionSeparator: "selectionSeparator", compareWith: "compareWith", backText: "backText", selectionDisplay: "selectionDisplay", disabled: "disabled" }, host: { properties: { "attr.data-open": "this.dataOpen", "attr.data-compact": "this.dataCompact", "attr.data-multiple": "this.dataMultiple" } }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SolarisSelect), multi: true }], viewQueries: [{ propertyName: "tokenEl", first: true, predicate: ["tokenEl"], descendants: true, read: ElementRef }, { propertyName: "measureSlot", first: true, predicate: ["measureSlot"], descendants: true, read: ElementRef }, { propertyName: "triggerWrap", first: true, predicate: ["triggerWrap"], descendants: true, read: ElementRef }, { propertyName: "triggerInput", first: true, predicate: ["triggerInput"], descendants: true, read: ElementRef }], ngImport: i0, template: "<solaris-popover [open]=\"open()\" (openChange)=\"open.set($event)\" placement=\"bottom-start\" [offset]=\"6\"\r\n [matchWidth]=\"true\" [anchorElement]=\"matchWidthEl\" [matchWidthElement]=\"matchWidthEl\"\r\n [closeOnOutsideClick]=\"true\" [closeOnEscape]=\"true\" panelClass=\"solaris-select__popover\">\r\n <div #triggerWrap solaris-popover-trigger class=\"solaris-select__trigger\" (click)=\"openFromTrigger()\">\r\n @if (showToken()) {\r\n <span #tokenEl class=\"solaris-select__token\" aria-hidden=\"true\">\r\n @if (multiple && showCount()) {\r\n @if (selectedCountKey) { {{ selectedCountKey | translate:{ count: selectedCount() } }} }\r\n @else { {{ selectedCountLabel() }} }\r\n } @else {\r\n {{ selectedText() }}\r\n }\r\n </span>\r\n }\r\n\r\n <input #triggerInput type=\"text\" class=\"solaris-select__input\" [disabled]=\"disabled\"\r\n [attr.aria-activedescendant]=\"open() ? activeOptionId() : null\" (click)=\"openFromTrigger()\"\r\n [readonly]=\"!isSearchMode()\" role=\"combobox\" aria-autocomplete=\"list\" aria-haspopup=\"listbox\"\r\n aria-controls=\"{{ _id }}-listbox\" aria-expanded=\"false\" [attr.aria-expanded]=\"open() ? 'true' : 'false'\"\r\n [attr.placeholder]=\"inputPlaceholderKey() ? (inputPlaceholderKey() | translate) : inputPlaceholderText()\"\r\n [value]=\"triggerValue()\" (keydown)=\"onTriggerKeydown($event)\" (focus)=\"openFromTrigger()\" (input)=\"onTriggerInput(triggerInput.value)\"/>\r\n\r\n <button type=\"button\" class=\"solaris-select__chevron-btn\" [disabled]=\"disabled\" (click)=\"toggleOpen()\"\r\n [attr.aria-label]=\"('ui.solaris.aria.toggleOptions' | translate)\">\r\n <i class=\"ph ph-caret-down\" aria-hidden=\"true\"></i>\r\n </button>\r\n\r\n <span class=\"solaris-select__measure solaris-select__token\" #measureSlot aria-hidden=\"true\">\r\n {{ selectedText() }}\r\n </span>\r\n </div>\r\n\r\n <ng-template solaris-popover-panel>\r\n <div class=\"solaris-select__panel\" (keydown)=\"onPanelKeydown($event)\" [style.max-height]=\"panelMaxHeight\">\r\n @if (canGoBack()) {\r\n <div class=\"solaris-select__nav\">\r\n <button type=\"button\" class=\"solaris-select__back\" (click)=\"goBack()\">\r\n <i class=\"ph ph-arrow-left\"></i>\r\n <span>\r\n @if (backKey) { {{ backKey | translate }} }\r\n @else { {{ backText | translate }} }\r\n </span>\r\n </button>\r\n\r\n <div class=\"solaris-select__title\">\r\n @if (currentLevel().titleKey) { {{ currentLevel().titleKey! | translate }} }\r\n @else { {{ currentLevel().title ?? '' }} }\r\n </div>\r\n </div>\r\n }\r\n\r\n <div class=\"solaris-select__list\" role=\"listbox\" [id]=\"_id + '-listbox'\"\r\n [attr.aria-multiselectable]=\"multiple ? 'true' : null\"\r\n [attr.aria-activedescendant]=\"activeOptionId()\">\r\n @for (row of rows(); track trackRow($index, row)) {\r\n @if (row.kind === 'group') {\r\n <div class=\"solaris-select__group\">\r\n @if (row.labelKey) { {{ row.labelKey | translate }} }\r\n @else { {{ row.label }} }\r\n </div>\r\n }\r\n\r\n @if (row.kind === 'divider') {\r\n <div class=\"solaris-select__divider\" aria-hidden=\"true\"></div>\r\n }\r\n\r\n @if (row.kind === 'item') {\r\n <button type=\"button\" class=\"solaris-select__option\" [id]=\"row.id\" [disabled]=\"row.disabled\"\r\n [attr.aria-selected]=\"row.selected ? 'true' : 'false'\" [class.is-active]=\"row.optionIndex === activeIndex()\"\r\n [class.is-selected]=\"row.selected\" [class.is-navigable]=\"row.hasChildren\" (click)=\"onOptionClick(row.item)\">\r\n <span class=\"solaris-select__option-leading\">\r\n @if (multiple) {\r\n @if (!row.hasChildren) {\r\n <span class=\"solaris-select__checkbox\" aria-hidden=\"true\" [class.is-checked]=\"row.selected\">\r\n <i class=\"ph ph-check\"></i>\r\n </span>\r\n } @else {\r\n @if (row.item.imageUrl) {\r\n <img class=\"solaris-select__avatar\" [ngSrc]=\"row.item.imageUrl\" alt=\"\" fill/>\r\n } @else if (row.item.icon) {\r\n <i class=\"solaris-select__icon\" [class]=\"row.item.icon\" aria-hidden=\"true\"></i>\r\n } @else {\r\n <span class=\"solaris-select__checkbox-spacer\" aria-hidden=\"true\"></span>\r\n }\r\n }\r\n }\r\n\r\n @if (!multiple) {\r\n @if (row.item.imageUrl) {\r\n <img class=\"solaris-select__avatar\" [ngSrc]=\"row.item.imageUrl\" alt=\"\" fill />\r\n } @else if (row.item.icon) {\r\n <i class=\"solaris-select__icon\" [class]=\"row.item.icon\" aria-hidden=\"true\"></i>\r\n }\r\n }\r\n </span>\r\n\r\n <span class=\"solaris-select__option-main\">\r\n <span class=\"solaris-select__option-label\">\r\n @if (row.item.labelKey) { {{ row.item.labelKey | translate }} }\r\n @else { {{ row.item.label }} }\r\n </span>\r\n\r\n @if (row.item.description || row.item.descriptionKey) {\r\n <span class=\"solaris-select__option-desc\">\r\n @if (row.item.descriptionKey) { {{ row.item.descriptionKey | translate }} }\r\n @else { {{ row.item.description }} }\r\n </span>\r\n }\r\n </span>\r\n\r\n <span class=\"solaris-select__option-end\">\r\n @if (row.item.endTextKey) {\r\n <span class=\"solaris-select__end-text\">{{ row.item.endTextKey | translate }}</span>\r\n } @else if (row.item.endText) {\r\n <span class=\"solaris-select__end-text\">{{ row.item.endText }}</span>\r\n }\r\n\r\n @if (!multiple && row.selected) {\r\n <i class=\"ph ph-check\" aria-hidden=\"true\"></i>\r\n }\r\n\r\n @if (row.hasChildren) {\r\n <i class=\"ph ph-caret-right\" aria-hidden=\"true\"></i>\r\n }\r\n </span>\r\n </button>\r\n }\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n</solaris-popover>\r\n", styles: [":host{width:100%;display:block}.solaris-select__trigger{width:100%;min-width:0;display:flex;position:relative;align-items:center;padding-right:2.8rem;gap:var(--solaris-space-2)}.solaris-select__token{opacity:1;min-width:0;flex:0 1 auto;max-width:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--solaris-color-text)}.solaris-select__input{border:0;width:100%;min-width:0;outline:none;flex:1 1 auto;padding:1rem 0;background:transparent;font-size:var(--solaris-fs-14);color:var(--solaris-color-text);line-height:var(--solaris-lh-normal)}:host([data-compact=true]) .solaris-select__input{flex:0 0 2ch;width:2ch;min-width:2ch}.solaris-select__input::placeholder{opacity:.9;color:var(--solaris-color-text-muted)}.solaris-select__chevron-btn i.ph{margin-right:1.5rem;transform:rotate(0);transition:transform .16s ease,opacity .16s ease}:host([data-open=true]) .solaris-select__chevron-btn i.ph{opacity:.95;transform:rotate(180deg)}:host([data-multiple=false]) .solaris-select__trigger,:host([data-multiple=false]) .solaris-select__input,:host([data-multiple=false]) .solaris-select__chevron-btn:not(:disabled){cursor:pointer}.solaris-select__display{top:0;left:0;bottom:0;display:flex;right:2.8rem;overflow:hidden;position:absolute;align-items:center;white-space:nowrap;pointer-events:none;text-overflow:ellipsis}.solaris-select__display.is-hidden{opacity:0}.solaris-select__input::placeholder,.solaris-select__placeholder{opacity:.9;color:var(--solaris-color-text-muted)}.solaris-select__input::placeholder,.solaris-select__placeholder,.solaris-select__token{font-size:var(--solaris-fs-14)}.solaris-select__chevron-btn{top:50%;right:0;border:0;display:grid;width:2.8rem;opacity:.85;height:3.6rem;cursor:pointer;position:absolute;place-items:center;background:transparent;transform:translateY(-50%);color:var(--solaris-color-text-muted)}.solaris-select__chevron-btn:disabled{opacity:.5;cursor:not-allowed}.solaris-select__measure{top:-9999px;left:-9999px;position:absolute;visibility:hidden;pointer-events:none;max-width:none!important;overflow:visible!important;width:max-content!important;white-space:nowrap!important;text-overflow:clip!important;display:inline-block!important}.solaris-select__popover{padding:var(--solaris-space-2)}.solaris-select__panel{display:grid;overflow:auto;max-height:32rem;padding:.25rem;gap:var(--solaris-space-2);border-radius:var(--solaris-radius-sm);background:var(--solaris-color-surface-2);border:1px solid var(--solaris-color-border)}.solaris-select__checkbox-spacer{width:1.6rem;height:1.6rem}.solaris-select__nav{display:grid;align-items:center;padding-right:1rem;gap:var(--solaris-space-2);grid-template-columns:auto 1fr}.solaris-select__back{border:0;cursor:pointer;align-items:center;display:inline-flex;background:transparent;gap:var(--solaris-space-1);padding:var(--solaris-space-2);color:var(--solaris-color-text);border-radius:var(--solaris-radius-sm)}.solaris-select__back:hover{background:var(--solaris-color-surface-2)}.solaris-select__title{justify-self:end;font-size:var(--solaris-fs-12);padding-right:var(--solaris-space-1);color:var(--solaris-color-text-muted)}.solaris-select__list{gap:.25rem;display:grid}.solaris-select__group{opacity:.9;padding:.4rem .6rem;text-transform:uppercase;font-size:var(--solaris-fs-10);letter-spacing:var(--solaris-ls-md);color:var(--solaris-color-text-muted)}.solaris-select__divider{height:1px;margin:.35rem .2rem;background:color-mix(in srgb,var(--solaris-color-border) 75%,transparent)}.solaris-select__option{width:100%;border:0;display:grid;cursor:pointer;text-align:left;align-items:center;padding:.7rem .8rem;background:transparent;gap:var(--solaris-space-4);color:var(--solaris-color-text);grid-template-columns:auto 1fr auto;border-radius:var(--solaris-radius-sm)}.solaris-select__option:hover{background:var(--solaris-color-surface-2)}.solaris-select__option.is-active{background:color-mix(in srgb,var(--solaris-color-primary) 7%,var(--solaris-color-surface-2))}.solaris-select__option:disabled{opacity:.45;cursor:not-allowed}.solaris-select__option-leading{align-items:center;display:inline-flex;gap:var(--solaris-space-2)}.solaris-select__checkbox{display:grid;width:1.6rem;height:1.6rem;place-items:center;border-radius:.4rem;background:var(--solaris-color-surface);color:var(--solaris-color-primary-contrast);border:1px solid color-mix(in srgb,var(--solaris-color-border) 85%,transparent)}.solaris-select__checkbox i.ph{opacity:0;line-height:1;font-size:1.2rem;transform:scale(.9);transition:opacity .12s ease,transform .12s ease}.solaris-select__checkbox.is-checked{background:var(--solaris-color-primary);border-color:color-mix(in srgb,var(--solaris-color-primary) 70%,var(--solaris-color-border))}.solaris-select__checkbox.is-checked i.ph{opacity:1;transform:scale(1)}.solaris-select__avatar{width:1.8rem;height:1.8rem;object-fit:cover;border-radius:var(--solaris-radius-full)}.solaris-select__icon{opacity:.9;font-size:var(--solaris-fs-16);color:var(--solaris-color-text-muted)}.solaris-select__option-main{min-width:0;gap:.15rem;display:grid}.solaris-select__option-label{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.solaris-select__option-desc{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:var(--solaris-fs-12);color:var(--solaris-color-text-muted)}.solaris-select__option-end{opacity:.9;align-items:center;display:inline-flex;gap:var(--solaris-space-2);color:var(--solaris-color-text-muted)}.solaris-select__option-end i.ph-check{color:var(--solaris-color-success)}.solaris-select__end-text{font-size:var(--solaris-fs-12);color:var(--solaris-color-text-muted)}\n"], dependencies: [{ kind: "component", type: SolarisPopover, selector: "solaris-popover", inputs: ["offset", "panelClass", "autoFlip", "autoShift", "matchWidth", "viewportPadding", "closeOnEscape", "closeOnOutsideClick", "anchorElement", "matchWidthElement", "placement", "open"], outputs: ["openChange"] }, { kind: "directive", type: SolarisPopoverTriggerDirective, selector: "[solaris-popover-trigger]" }, { kind: "directive", type: SolarisPopoverPanelDirective, selector: "ng-template[solaris-popover-panel]" }, { kind: "directive", type: NgOptimizedImage, selector: "img[ngSrc]", inputs: ["ngSrc", "ngSrcset", "sizes", "width", "height", "decoding", "loading", "priority", "loaderParams", "disableOptimizedSrcset", "fill", "placeholder", "placeholderConfig", "src", "srcset"] }, { kind: "pipe", type: SolarisTranslationPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8420
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisSelect, isStandalone: true, selector: "solaris-select", inputs: { items: "items", multiple: "multiple", valueKey: "valueKey", backKey: "backKey", placeholder: "placeholder", placeholderKey: "placeholderKey", searchable: "searchable", selectedCountKey: "selectedCountKey", selectedFirst: "selectedFirst", searchPlaceholder: "searchPlaceholder", selectedCountText: "selectedCountText", panelMaxHeight: "panelMaxHeight", searchPlaceholderKey: "searchPlaceholderKey", selectionSeparator: "selectionSeparator", compareWith: "compareWith", backText: "backText", selectionDisplay: "selectionDisplay", disabled: "disabled" }, host: { properties: { "attr.data-open": "this.dataOpen", "attr.data-compact": "this.dataCompact", "attr.data-multiple": "this.dataMultiple" } }, providers: [
|
|
8421
|
+
{
|
|
8422
|
+
provide: NG_VALUE_ACCESSOR,
|
|
8423
|
+
useExisting: forwardRef(() => SolarisSelect),
|
|
8424
|
+
multi: true,
|
|
8425
|
+
},
|
|
8426
|
+
], viewQueries: [{ propertyName: "tokenEl", first: true, predicate: ["tokenEl"], descendants: true, read: ElementRef }, { propertyName: "measureSlot", first: true, predicate: ["measureSlot"], descendants: true, read: ElementRef }, { propertyName: "triggerWrap", first: true, predicate: ["triggerWrap"], descendants: true, read: ElementRef }, { propertyName: "triggerInput", first: true, predicate: ["triggerInput"], descendants: true, read: ElementRef }], ngImport: i0, template: "<solaris-popover [open]=\"open()\" (openChange)=\"open.set($event)\" placement=\"bottom-start\" [offset]=\"6\"\r\n [matchWidth]=\"true\" [anchorElement]=\"matchWidthEl\" [matchWidthElement]=\"matchWidthEl\"\r\n [closeOnOutsideClick]=\"true\" [closeOnEscape]=\"true\" panelClass=\"solaris-select__popover\">\r\n <div #triggerWrap solaris-popover-trigger class=\"solaris-select__trigger\" (click)=\"openFromTrigger()\">\r\n @if (showToken()) {\r\n <span #tokenEl class=\"solaris-select__token\" aria-hidden=\"true\">\r\n @if (multiple && showCount()) {\r\n @if (selectedCountKey) { {{ selectedCountKey | translate:{ count: selectedCount() } }} }\r\n @else { {{ selectedCountLabel() }} }\r\n } @else {\r\n {{ selectedText() }}\r\n }\r\n </span>\r\n }\r\n\r\n <input #triggerInput type=\"text\" class=\"solaris-select__input\" [disabled]=\"disabled\"\r\n [attr.aria-activedescendant]=\"open() ? activeOptionId() : null\" (click)=\"openFromTrigger()\"\r\n [readonly]=\"!isSearchMode()\" role=\"combobox\" aria-autocomplete=\"list\" aria-haspopup=\"listbox\"\r\n aria-controls=\"{{ _id }}-listbox\" aria-expanded=\"false\" [attr.aria-expanded]=\"open() ? 'true' : 'false'\"\r\n [attr.placeholder]=\"inputPlaceholderKey() ? (inputPlaceholderKey() | translate) : inputPlaceholderText()\"\r\n [value]=\"triggerValue()\" (keydown)=\"onTriggerKeydown($event)\" (focus)=\"openFromTrigger()\" (input)=\"onTriggerInput(triggerInput.value)\"/>\r\n\r\n <button type=\"button\" class=\"solaris-select__chevron-btn\" [disabled]=\"disabled\" (click)=\"toggleOpen()\"\r\n [attr.aria-label]=\"('ui.solaris.aria.toggleOptions' | translate)\">\r\n <i class=\"ph ph-caret-down\" aria-hidden=\"true\"></i>\r\n </button>\r\n\r\n <span class=\"solaris-select__measure solaris-select__token\" #measureSlot aria-hidden=\"true\">\r\n {{ selectedText() }}\r\n </span>\r\n </div>\r\n\r\n <ng-template solaris-popover-panel>\r\n <div class=\"solaris-select__panel\" (keydown)=\"onPanelKeydown($event)\" [style.max-height]=\"panelMaxHeight\">\r\n @if (canGoBack()) {\r\n <div class=\"solaris-select__nav\">\r\n <button type=\"button\" class=\"solaris-select__back\" (click)=\"goBack()\">\r\n <i class=\"ph ph-arrow-left\"></i>\r\n <span>\r\n @if (backKey) { {{ backKey | translate }} }\r\n @else { {{ backText | translate }} }\r\n </span>\r\n </button>\r\n\r\n <div class=\"solaris-select__title\">\r\n @if (currentLevel().titleKey) { {{ currentLevel().titleKey! | translate }} }\r\n @else { {{ currentLevel().title ?? '' }} }\r\n </div>\r\n </div>\r\n }\r\n\r\n <div class=\"solaris-select__list\" role=\"listbox\" [id]=\"_id + '-listbox'\"\r\n [attr.aria-multiselectable]=\"multiple ? 'true' : null\"\r\n [attr.aria-activedescendant]=\"activeOptionId()\">\r\n @for (row of rows(); track trackRow($index, row)) {\r\n @if (row.kind === 'group') {\r\n <div class=\"solaris-select__group\">\r\n @if (row.labelKey) { {{ row.labelKey | translate }} }\r\n @else { {{ row.label }} }\r\n </div>\r\n }\r\n\r\n @if (row.kind === 'divider') {\r\n <div class=\"solaris-select__divider\" aria-hidden=\"true\"></div>\r\n }\r\n\r\n @if (row.kind === 'item') {\r\n <button type=\"button\" class=\"solaris-select__option\" [id]=\"row.id\" [disabled]=\"row.disabled\"\r\n [attr.aria-selected]=\"row.selected ? 'true' : 'false'\" [class.is-active]=\"row.optionIndex === activeIndex()\"\r\n [class.is-selected]=\"row.selected\" [class.is-navigable]=\"row.hasChildren\" (click)=\"onOptionClick(row.item)\">\r\n <span class=\"solaris-select__option-leading\">\r\n @if (multiple) {\r\n @if (!row.hasChildren) {\r\n <span class=\"solaris-select__checkbox\" aria-hidden=\"true\" [class.is-checked]=\"row.selected\">\r\n <i class=\"ph ph-check\"></i>\r\n </span>\r\n } @else {\r\n @if (row.item.imageUrl) {\r\n <img class=\"solaris-select__avatar\" [ngSrc]=\"row.item.imageUrl\" alt=\"\" fill/>\r\n } @else if (row.item.icon) {\r\n <i class=\"solaris-select__icon\" [class]=\"row.item.icon\" aria-hidden=\"true\"></i>\r\n } @else {\r\n <span class=\"solaris-select__checkbox-spacer\" aria-hidden=\"true\"></span>\r\n }\r\n }\r\n }\r\n\r\n @if (!multiple) {\r\n @if (row.item.imageUrl) {\r\n <img class=\"solaris-select__avatar\" [ngSrc]=\"row.item.imageUrl\" alt=\"\" fill />\r\n } @else if (row.item.icon) {\r\n <i class=\"solaris-select__icon\" [class]=\"row.item.icon\" aria-hidden=\"true\"></i>\r\n }\r\n }\r\n </span>\r\n\r\n <span class=\"solaris-select__option-main\">\r\n <span class=\"solaris-select__option-label\">\r\n @if (row.item.labelKey) { {{ row.item.labelKey | translate }} }\r\n @else { {{ row.item.label }} }\r\n </span>\r\n\r\n @if (row.item.description || row.item.descriptionKey) {\r\n <span class=\"solaris-select__option-desc\">\r\n @if (row.item.descriptionKey) { {{ row.item.descriptionKey | translate }} }\r\n @else { {{ row.item.description }} }\r\n </span>\r\n }\r\n </span>\r\n\r\n <span class=\"solaris-select__option-end\">\r\n @if (row.item.endTextKey) {\r\n <span class=\"solaris-select__end-text\">{{ row.item.endTextKey | translate }}</span>\r\n } @else if (row.item.endText) {\r\n <span class=\"solaris-select__end-text\">{{ row.item.endText }}</span>\r\n }\r\n\r\n @if (!multiple && row.selected) {\r\n <i class=\"ph ph-check\" aria-hidden=\"true\"></i>\r\n }\r\n\r\n @if (row.hasChildren) {\r\n <i class=\"ph ph-caret-right\" aria-hidden=\"true\"></i>\r\n }\r\n </span>\r\n </button>\r\n }\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n</solaris-popover>\r\n", styles: [":host{width:100%;display:block}.solaris-select__trigger{width:100%;min-width:0;display:flex;position:relative;align-items:center;padding-right:2.8rem;gap:var(--solaris-space-2)}.solaris-select__token{opacity:1;min-width:0;flex:0 1 auto;max-width:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--solaris-color-text)}.solaris-select__input{border:0;width:100%;min-width:0;outline:none;flex:1 1 auto;padding:1rem 0;background:transparent;font-size:var(--solaris-fs-14);color:var(--solaris-color-text);line-height:var(--solaris-lh-normal)}:host([data-compact=true]) .solaris-select__input{flex:0 0 2ch;width:2ch;min-width:2ch}.solaris-select__input::placeholder{opacity:.9;color:var(--solaris-color-text-muted)}.solaris-select__chevron-btn i.ph{margin-right:1.5rem;transform:rotate(0);transition:transform .16s ease,opacity .16s ease}:host([data-open=true]) .solaris-select__chevron-btn i.ph{opacity:.95;transform:rotate(180deg)}:host([data-multiple=false]) .solaris-select__trigger,:host([data-multiple=false]) .solaris-select__input,:host([data-multiple=false]) .solaris-select__chevron-btn:not(:disabled){cursor:pointer}.solaris-select__display{top:0;left:0;bottom:0;display:flex;right:2.8rem;overflow:hidden;position:absolute;align-items:center;white-space:nowrap;pointer-events:none;text-overflow:ellipsis}.solaris-select__display.is-hidden{opacity:0}.solaris-select__input::placeholder,.solaris-select__placeholder{opacity:.9;color:var(--solaris-color-text-muted)}.solaris-select__input::placeholder,.solaris-select__placeholder,.solaris-select__token{font-size:var(--solaris-fs-14)}.solaris-select__chevron-btn{top:50%;right:0;border:0;display:grid;width:2.8rem;opacity:.85;height:3.6rem;cursor:pointer;position:absolute;place-items:center;background:transparent;transform:translateY(-50%);color:var(--solaris-color-text-muted)}.solaris-select__chevron-btn:disabled{opacity:.5;cursor:not-allowed}.solaris-select__measure{top:-9999px;left:-9999px;position:absolute;visibility:hidden;pointer-events:none;max-width:none!important;overflow:visible!important;width:max-content!important;white-space:nowrap!important;text-overflow:clip!important;display:inline-block!important}.solaris-select__popover{padding:var(--solaris-space-2)}.solaris-select__panel{display:grid;overflow:auto;max-height:32rem;padding:.25rem;gap:var(--solaris-space-2);border-radius:var(--solaris-radius-sm);background:var(--solaris-color-surface-2);border:1px solid var(--solaris-color-border)}.solaris-select__checkbox-spacer{width:1.6rem;height:1.6rem}.solaris-select__nav{display:grid;align-items:center;padding-right:1rem;gap:var(--solaris-space-2);grid-template-columns:auto 1fr}.solaris-select__back{border:0;cursor:pointer;align-items:center;display:inline-flex;background:transparent;gap:var(--solaris-space-1);padding:var(--solaris-space-2);color:var(--solaris-color-text);border-radius:var(--solaris-radius-sm)}.solaris-select__back:hover{background:var(--solaris-color-surface-2)}.solaris-select__title{justify-self:end;font-size:var(--solaris-fs-12);padding-right:var(--solaris-space-1);color:var(--solaris-color-text-muted)}.solaris-select__list{gap:.25rem;display:grid}.solaris-select__group{opacity:.9;padding:.4rem .6rem;text-transform:uppercase;font-size:var(--solaris-fs-10);letter-spacing:var(--solaris-ls-md);color:var(--solaris-color-text-muted)}.solaris-select__divider{height:1px;margin:.35rem .2rem;background:color-mix(in srgb,var(--solaris-color-border) 75%,transparent)}.solaris-select__option{width:100%;border:0;display:grid;cursor:pointer;text-align:left;align-items:center;padding:.7rem .8rem;background:transparent;gap:var(--solaris-space-4);color:var(--solaris-color-text);grid-template-columns:auto 1fr auto;border-radius:var(--solaris-radius-sm)}.solaris-select__option:hover{background:var(--solaris-color-surface-2)}.solaris-select__option.is-active{background:color-mix(in srgb,var(--solaris-color-primary) 7%,var(--solaris-color-surface-2))}.solaris-select__option:disabled{opacity:.45;cursor:not-allowed}.solaris-select__option-leading{align-items:center;display:inline-flex;gap:var(--solaris-space-2)}.solaris-select__checkbox{display:grid;width:1.6rem;height:1.6rem;place-items:center;border-radius:.4rem;background:var(--solaris-color-surface);color:var(--solaris-color-primary-contrast);border:1px solid color-mix(in srgb,var(--solaris-color-border) 85%,transparent)}.solaris-select__checkbox i.ph{opacity:0;line-height:1;font-size:1.2rem;transform:scale(.9);transition:opacity .12s ease,transform .12s ease}.solaris-select__checkbox.is-checked{background:var(--solaris-color-primary);border-color:color-mix(in srgb,var(--solaris-color-primary) 70%,var(--solaris-color-border))}.solaris-select__checkbox.is-checked i.ph{opacity:1;transform:scale(1)}.solaris-select__avatar{width:1.8rem;height:1.8rem;object-fit:cover;border-radius:var(--solaris-radius-full)}.solaris-select__icon{opacity:.9;font-size:var(--solaris-fs-16);color:var(--solaris-color-text-muted)}.solaris-select__option-main{min-width:0;gap:.15rem;display:grid}.solaris-select__option-label{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.solaris-select__option-desc{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:var(--solaris-fs-12);color:var(--solaris-color-text-muted)}.solaris-select__option-end{opacity:.9;align-items:center;display:inline-flex;gap:var(--solaris-space-2);color:var(--solaris-color-text-muted)}.solaris-select__option-end i.ph-check{color:var(--solaris-color-success)}.solaris-select__end-text{font-size:var(--solaris-fs-12);color:var(--solaris-color-text-muted)}\n"], dependencies: [{ kind: "component", type: SolarisPopover, selector: "solaris-popover", inputs: ["offset", "panelClass", "autoFlip", "autoShift", "matchWidth", "viewportPadding", "closeOnEscape", "closeOnOutsideClick", "anchorElement", "matchWidthElement", "placement", "open"], outputs: ["openChange"] }, { kind: "directive", type: SolarisPopoverTriggerDirective, selector: "[solaris-popover-trigger]" }, { kind: "directive", type: SolarisPopoverPanelDirective, selector: "ng-template[solaris-popover-panel]" }, { kind: "directive", type: NgOptimizedImage, selector: "img[ngSrc]", inputs: ["ngSrc", "ngSrcset", "sizes", "width", "height", "decoding", "loading", "priority", "loaderParams", "disableOptimizedSrcset", "fill", "placeholder", "placeholderConfig", "src", "srcset"] }, { kind: "pipe", type: SolarisTranslationPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8340
8427
|
}
|
|
8341
8428
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisSelect, decorators: [{
|
|
8342
8429
|
type: Component,
|
|
@@ -8346,7 +8433,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
8346
8433
|
SolarisPopoverPanelDirective,
|
|
8347
8434
|
SolarisTranslationPipe,
|
|
8348
8435
|
NgOptimizedImage,
|
|
8349
|
-
], providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SolarisSelect), multi: true }], changeDetection: ChangeDetectionStrategy.OnPush, template: "<solaris-popover [open]=\"open()\" (openChange)=\"open.set($event)\" placement=\"bottom-start\" [offset]=\"6\"\r\n [matchWidth]=\"true\" [anchorElement]=\"matchWidthEl\" [matchWidthElement]=\"matchWidthEl\"\r\n [closeOnOutsideClick]=\"true\" [closeOnEscape]=\"true\" panelClass=\"solaris-select__popover\">\r\n <div #triggerWrap solaris-popover-trigger class=\"solaris-select__trigger\" (click)=\"openFromTrigger()\">\r\n @if (showToken()) {\r\n <span #tokenEl class=\"solaris-select__token\" aria-hidden=\"true\">\r\n @if (multiple && showCount()) {\r\n @if (selectedCountKey) { {{ selectedCountKey | translate:{ count: selectedCount() } }} }\r\n @else { {{ selectedCountLabel() }} }\r\n } @else {\r\n {{ selectedText() }}\r\n }\r\n </span>\r\n }\r\n\r\n <input #triggerInput type=\"text\" class=\"solaris-select__input\" [disabled]=\"disabled\"\r\n [attr.aria-activedescendant]=\"open() ? activeOptionId() : null\" (click)=\"openFromTrigger()\"\r\n [readonly]=\"!isSearchMode()\" role=\"combobox\" aria-autocomplete=\"list\" aria-haspopup=\"listbox\"\r\n aria-controls=\"{{ _id }}-listbox\" aria-expanded=\"false\" [attr.aria-expanded]=\"open() ? 'true' : 'false'\"\r\n [attr.placeholder]=\"inputPlaceholderKey() ? (inputPlaceholderKey() | translate) : inputPlaceholderText()\"\r\n [value]=\"triggerValue()\" (keydown)=\"onTriggerKeydown($event)\" (focus)=\"openFromTrigger()\" (input)=\"onTriggerInput(triggerInput.value)\"/>\r\n\r\n <button type=\"button\" class=\"solaris-select__chevron-btn\" [disabled]=\"disabled\" (click)=\"toggleOpen()\"\r\n [attr.aria-label]=\"('ui.solaris.aria.toggleOptions' | translate)\">\r\n <i class=\"ph ph-caret-down\" aria-hidden=\"true\"></i>\r\n </button>\r\n\r\n <span class=\"solaris-select__measure solaris-select__token\" #measureSlot aria-hidden=\"true\">\r\n {{ selectedText() }}\r\n </span>\r\n </div>\r\n\r\n <ng-template solaris-popover-panel>\r\n <div class=\"solaris-select__panel\" (keydown)=\"onPanelKeydown($event)\" [style.max-height]=\"panelMaxHeight\">\r\n @if (canGoBack()) {\r\n <div class=\"solaris-select__nav\">\r\n <button type=\"button\" class=\"solaris-select__back\" (click)=\"goBack()\">\r\n <i class=\"ph ph-arrow-left\"></i>\r\n <span>\r\n @if (backKey) { {{ backKey | translate }} }\r\n @else { {{ backText | translate }} }\r\n </span>\r\n </button>\r\n\r\n <div class=\"solaris-select__title\">\r\n @if (currentLevel().titleKey) { {{ currentLevel().titleKey! | translate }} }\r\n @else { {{ currentLevel().title ?? '' }} }\r\n </div>\r\n </div>\r\n }\r\n\r\n <div class=\"solaris-select__list\" role=\"listbox\" [id]=\"_id + '-listbox'\"\r\n [attr.aria-multiselectable]=\"multiple ? 'true' : null\"\r\n [attr.aria-activedescendant]=\"activeOptionId()\">\r\n @for (row of rows(); track trackRow($index, row)) {\r\n @if (row.kind === 'group') {\r\n <div class=\"solaris-select__group\">\r\n @if (row.labelKey) { {{ row.labelKey | translate }} }\r\n @else { {{ row.label }} }\r\n </div>\r\n }\r\n\r\n @if (row.kind === 'divider') {\r\n <div class=\"solaris-select__divider\" aria-hidden=\"true\"></div>\r\n }\r\n\r\n @if (row.kind === 'item') {\r\n <button type=\"button\" class=\"solaris-select__option\" [id]=\"row.id\" [disabled]=\"row.disabled\"\r\n [attr.aria-selected]=\"row.selected ? 'true' : 'false'\" [class.is-active]=\"row.optionIndex === activeIndex()\"\r\n [class.is-selected]=\"row.selected\" [class.is-navigable]=\"row.hasChildren\" (click)=\"onOptionClick(row.item)\">\r\n <span class=\"solaris-select__option-leading\">\r\n @if (multiple) {\r\n @if (!row.hasChildren) {\r\n <span class=\"solaris-select__checkbox\" aria-hidden=\"true\" [class.is-checked]=\"row.selected\">\r\n <i class=\"ph ph-check\"></i>\r\n </span>\r\n } @else {\r\n @if (row.item.imageUrl) {\r\n <img class=\"solaris-select__avatar\" [ngSrc]=\"row.item.imageUrl\" alt=\"\" fill/>\r\n } @else if (row.item.icon) {\r\n <i class=\"solaris-select__icon\" [class]=\"row.item.icon\" aria-hidden=\"true\"></i>\r\n } @else {\r\n <span class=\"solaris-select__checkbox-spacer\" aria-hidden=\"true\"></span>\r\n }\r\n }\r\n }\r\n\r\n @if (!multiple) {\r\n @if (row.item.imageUrl) {\r\n <img class=\"solaris-select__avatar\" [ngSrc]=\"row.item.imageUrl\" alt=\"\" fill />\r\n } @else if (row.item.icon) {\r\n <i class=\"solaris-select__icon\" [class]=\"row.item.icon\" aria-hidden=\"true\"></i>\r\n }\r\n }\r\n </span>\r\n\r\n <span class=\"solaris-select__option-main\">\r\n <span class=\"solaris-select__option-label\">\r\n @if (row.item.labelKey) { {{ row.item.labelKey | translate }} }\r\n @else { {{ row.item.label }} }\r\n </span>\r\n\r\n @if (row.item.description || row.item.descriptionKey) {\r\n <span class=\"solaris-select__option-desc\">\r\n @if (row.item.descriptionKey) { {{ row.item.descriptionKey | translate }} }\r\n @else { {{ row.item.description }} }\r\n </span>\r\n }\r\n </span>\r\n\r\n <span class=\"solaris-select__option-end\">\r\n @if (row.item.endTextKey) {\r\n <span class=\"solaris-select__end-text\">{{ row.item.endTextKey | translate }}</span>\r\n } @else if (row.item.endText) {\r\n <span class=\"solaris-select__end-text\">{{ row.item.endText }}</span>\r\n }\r\n\r\n @if (!multiple && row.selected) {\r\n <i class=\"ph ph-check\" aria-hidden=\"true\"></i>\r\n }\r\n\r\n @if (row.hasChildren) {\r\n <i class=\"ph ph-caret-right\" aria-hidden=\"true\"></i>\r\n }\r\n </span>\r\n </button>\r\n }\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n</solaris-popover>\r\n", styles: [":host{width:100%;display:block}.solaris-select__trigger{width:100%;min-width:0;display:flex;position:relative;align-items:center;padding-right:2.8rem;gap:var(--solaris-space-2)}.solaris-select__token{opacity:1;min-width:0;flex:0 1 auto;max-width:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--solaris-color-text)}.solaris-select__input{border:0;width:100%;min-width:0;outline:none;flex:1 1 auto;padding:1rem 0;background:transparent;font-size:var(--solaris-fs-14);color:var(--solaris-color-text);line-height:var(--solaris-lh-normal)}:host([data-compact=true]) .solaris-select__input{flex:0 0 2ch;width:2ch;min-width:2ch}.solaris-select__input::placeholder{opacity:.9;color:var(--solaris-color-text-muted)}.solaris-select__chevron-btn i.ph{margin-right:1.5rem;transform:rotate(0);transition:transform .16s ease,opacity .16s ease}:host([data-open=true]) .solaris-select__chevron-btn i.ph{opacity:.95;transform:rotate(180deg)}:host([data-multiple=false]) .solaris-select__trigger,:host([data-multiple=false]) .solaris-select__input,:host([data-multiple=false]) .solaris-select__chevron-btn:not(:disabled){cursor:pointer}.solaris-select__display{top:0;left:0;bottom:0;display:flex;right:2.8rem;overflow:hidden;position:absolute;align-items:center;white-space:nowrap;pointer-events:none;text-overflow:ellipsis}.solaris-select__display.is-hidden{opacity:0}.solaris-select__input::placeholder,.solaris-select__placeholder{opacity:.9;color:var(--solaris-color-text-muted)}.solaris-select__input::placeholder,.solaris-select__placeholder,.solaris-select__token{font-size:var(--solaris-fs-14)}.solaris-select__chevron-btn{top:50%;right:0;border:0;display:grid;width:2.8rem;opacity:.85;height:3.6rem;cursor:pointer;position:absolute;place-items:center;background:transparent;transform:translateY(-50%);color:var(--solaris-color-text-muted)}.solaris-select__chevron-btn:disabled{opacity:.5;cursor:not-allowed}.solaris-select__measure{top:-9999px;left:-9999px;position:absolute;visibility:hidden;pointer-events:none;max-width:none!important;overflow:visible!important;width:max-content!important;white-space:nowrap!important;text-overflow:clip!important;display:inline-block!important}.solaris-select__popover{padding:var(--solaris-space-2)}.solaris-select__panel{display:grid;overflow:auto;max-height:32rem;padding:.25rem;gap:var(--solaris-space-2);border-radius:var(--solaris-radius-sm);background:var(--solaris-color-surface-2);border:1px solid var(--solaris-color-border)}.solaris-select__checkbox-spacer{width:1.6rem;height:1.6rem}.solaris-select__nav{display:grid;align-items:center;padding-right:1rem;gap:var(--solaris-space-2);grid-template-columns:auto 1fr}.solaris-select__back{border:0;cursor:pointer;align-items:center;display:inline-flex;background:transparent;gap:var(--solaris-space-1);padding:var(--solaris-space-2);color:var(--solaris-color-text);border-radius:var(--solaris-radius-sm)}.solaris-select__back:hover{background:var(--solaris-color-surface-2)}.solaris-select__title{justify-self:end;font-size:var(--solaris-fs-12);padding-right:var(--solaris-space-1);color:var(--solaris-color-text-muted)}.solaris-select__list{gap:.25rem;display:grid}.solaris-select__group{opacity:.9;padding:.4rem .6rem;text-transform:uppercase;font-size:var(--solaris-fs-10);letter-spacing:var(--solaris-ls-md);color:var(--solaris-color-text-muted)}.solaris-select__divider{height:1px;margin:.35rem .2rem;background:color-mix(in srgb,var(--solaris-color-border) 75%,transparent)}.solaris-select__option{width:100%;border:0;display:grid;cursor:pointer;text-align:left;align-items:center;padding:.7rem .8rem;background:transparent;gap:var(--solaris-space-4);color:var(--solaris-color-text);grid-template-columns:auto 1fr auto;border-radius:var(--solaris-radius-sm)}.solaris-select__option:hover{background:var(--solaris-color-surface-2)}.solaris-select__option.is-active{background:color-mix(in srgb,var(--solaris-color-primary) 7%,var(--solaris-color-surface-2))}.solaris-select__option:disabled{opacity:.45;cursor:not-allowed}.solaris-select__option-leading{align-items:center;display:inline-flex;gap:var(--solaris-space-2)}.solaris-select__checkbox{display:grid;width:1.6rem;height:1.6rem;place-items:center;border-radius:.4rem;background:var(--solaris-color-surface);color:var(--solaris-color-primary-contrast);border:1px solid color-mix(in srgb,var(--solaris-color-border) 85%,transparent)}.solaris-select__checkbox i.ph{opacity:0;line-height:1;font-size:1.2rem;transform:scale(.9);transition:opacity .12s ease,transform .12s ease}.solaris-select__checkbox.is-checked{background:var(--solaris-color-primary);border-color:color-mix(in srgb,var(--solaris-color-primary) 70%,var(--solaris-color-border))}.solaris-select__checkbox.is-checked i.ph{opacity:1;transform:scale(1)}.solaris-select__avatar{width:1.8rem;height:1.8rem;object-fit:cover;border-radius:var(--solaris-radius-full)}.solaris-select__icon{opacity:.9;font-size:var(--solaris-fs-16);color:var(--solaris-color-text-muted)}.solaris-select__option-main{min-width:0;gap:.15rem;display:grid}.solaris-select__option-label{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.solaris-select__option-desc{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:var(--solaris-fs-12);color:var(--solaris-color-text-muted)}.solaris-select__option-end{opacity:.9;align-items:center;display:inline-flex;gap:var(--solaris-space-2);color:var(--solaris-color-text-muted)}.solaris-select__option-end i.ph-check{color:var(--solaris-color-success)}.solaris-select__end-text{font-size:var(--solaris-fs-12);color:var(--solaris-color-text-muted)}\n"] }]
|
|
8436
|
+
], providers: [
|
|
8437
|
+
{
|
|
8438
|
+
provide: NG_VALUE_ACCESSOR,
|
|
8439
|
+
useExisting: forwardRef(() => SolarisSelect),
|
|
8440
|
+
multi: true,
|
|
8441
|
+
},
|
|
8442
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<solaris-popover [open]=\"open()\" (openChange)=\"open.set($event)\" placement=\"bottom-start\" [offset]=\"6\"\r\n [matchWidth]=\"true\" [anchorElement]=\"matchWidthEl\" [matchWidthElement]=\"matchWidthEl\"\r\n [closeOnOutsideClick]=\"true\" [closeOnEscape]=\"true\" panelClass=\"solaris-select__popover\">\r\n <div #triggerWrap solaris-popover-trigger class=\"solaris-select__trigger\" (click)=\"openFromTrigger()\">\r\n @if (showToken()) {\r\n <span #tokenEl class=\"solaris-select__token\" aria-hidden=\"true\">\r\n @if (multiple && showCount()) {\r\n @if (selectedCountKey) { {{ selectedCountKey | translate:{ count: selectedCount() } }} }\r\n @else { {{ selectedCountLabel() }} }\r\n } @else {\r\n {{ selectedText() }}\r\n }\r\n </span>\r\n }\r\n\r\n <input #triggerInput type=\"text\" class=\"solaris-select__input\" [disabled]=\"disabled\"\r\n [attr.aria-activedescendant]=\"open() ? activeOptionId() : null\" (click)=\"openFromTrigger()\"\r\n [readonly]=\"!isSearchMode()\" role=\"combobox\" aria-autocomplete=\"list\" aria-haspopup=\"listbox\"\r\n aria-controls=\"{{ _id }}-listbox\" aria-expanded=\"false\" [attr.aria-expanded]=\"open() ? 'true' : 'false'\"\r\n [attr.placeholder]=\"inputPlaceholderKey() ? (inputPlaceholderKey() | translate) : inputPlaceholderText()\"\r\n [value]=\"triggerValue()\" (keydown)=\"onTriggerKeydown($event)\" (focus)=\"openFromTrigger()\" (input)=\"onTriggerInput(triggerInput.value)\"/>\r\n\r\n <button type=\"button\" class=\"solaris-select__chevron-btn\" [disabled]=\"disabled\" (click)=\"toggleOpen()\"\r\n [attr.aria-label]=\"('ui.solaris.aria.toggleOptions' | translate)\">\r\n <i class=\"ph ph-caret-down\" aria-hidden=\"true\"></i>\r\n </button>\r\n\r\n <span class=\"solaris-select__measure solaris-select__token\" #measureSlot aria-hidden=\"true\">\r\n {{ selectedText() }}\r\n </span>\r\n </div>\r\n\r\n <ng-template solaris-popover-panel>\r\n <div class=\"solaris-select__panel\" (keydown)=\"onPanelKeydown($event)\" [style.max-height]=\"panelMaxHeight\">\r\n @if (canGoBack()) {\r\n <div class=\"solaris-select__nav\">\r\n <button type=\"button\" class=\"solaris-select__back\" (click)=\"goBack()\">\r\n <i class=\"ph ph-arrow-left\"></i>\r\n <span>\r\n @if (backKey) { {{ backKey | translate }} }\r\n @else { {{ backText | translate }} }\r\n </span>\r\n </button>\r\n\r\n <div class=\"solaris-select__title\">\r\n @if (currentLevel().titleKey) { {{ currentLevel().titleKey! | translate }} }\r\n @else { {{ currentLevel().title ?? '' }} }\r\n </div>\r\n </div>\r\n }\r\n\r\n <div class=\"solaris-select__list\" role=\"listbox\" [id]=\"_id + '-listbox'\"\r\n [attr.aria-multiselectable]=\"multiple ? 'true' : null\"\r\n [attr.aria-activedescendant]=\"activeOptionId()\">\r\n @for (row of rows(); track trackRow($index, row)) {\r\n @if (row.kind === 'group') {\r\n <div class=\"solaris-select__group\">\r\n @if (row.labelKey) { {{ row.labelKey | translate }} }\r\n @else { {{ row.label }} }\r\n </div>\r\n }\r\n\r\n @if (row.kind === 'divider') {\r\n <div class=\"solaris-select__divider\" aria-hidden=\"true\"></div>\r\n }\r\n\r\n @if (row.kind === 'item') {\r\n <button type=\"button\" class=\"solaris-select__option\" [id]=\"row.id\" [disabled]=\"row.disabled\"\r\n [attr.aria-selected]=\"row.selected ? 'true' : 'false'\" [class.is-active]=\"row.optionIndex === activeIndex()\"\r\n [class.is-selected]=\"row.selected\" [class.is-navigable]=\"row.hasChildren\" (click)=\"onOptionClick(row.item)\">\r\n <span class=\"solaris-select__option-leading\">\r\n @if (multiple) {\r\n @if (!row.hasChildren) {\r\n <span class=\"solaris-select__checkbox\" aria-hidden=\"true\" [class.is-checked]=\"row.selected\">\r\n <i class=\"ph ph-check\"></i>\r\n </span>\r\n } @else {\r\n @if (row.item.imageUrl) {\r\n <img class=\"solaris-select__avatar\" [ngSrc]=\"row.item.imageUrl\" alt=\"\" fill/>\r\n } @else if (row.item.icon) {\r\n <i class=\"solaris-select__icon\" [class]=\"row.item.icon\" aria-hidden=\"true\"></i>\r\n } @else {\r\n <span class=\"solaris-select__checkbox-spacer\" aria-hidden=\"true\"></span>\r\n }\r\n }\r\n }\r\n\r\n @if (!multiple) {\r\n @if (row.item.imageUrl) {\r\n <img class=\"solaris-select__avatar\" [ngSrc]=\"row.item.imageUrl\" alt=\"\" fill />\r\n } @else if (row.item.icon) {\r\n <i class=\"solaris-select__icon\" [class]=\"row.item.icon\" aria-hidden=\"true\"></i>\r\n }\r\n }\r\n </span>\r\n\r\n <span class=\"solaris-select__option-main\">\r\n <span class=\"solaris-select__option-label\">\r\n @if (row.item.labelKey) { {{ row.item.labelKey | translate }} }\r\n @else { {{ row.item.label }} }\r\n </span>\r\n\r\n @if (row.item.description || row.item.descriptionKey) {\r\n <span class=\"solaris-select__option-desc\">\r\n @if (row.item.descriptionKey) { {{ row.item.descriptionKey | translate }} }\r\n @else { {{ row.item.description }} }\r\n </span>\r\n }\r\n </span>\r\n\r\n <span class=\"solaris-select__option-end\">\r\n @if (row.item.endTextKey) {\r\n <span class=\"solaris-select__end-text\">{{ row.item.endTextKey | translate }}</span>\r\n } @else if (row.item.endText) {\r\n <span class=\"solaris-select__end-text\">{{ row.item.endText }}</span>\r\n }\r\n\r\n @if (!multiple && row.selected) {\r\n <i class=\"ph ph-check\" aria-hidden=\"true\"></i>\r\n }\r\n\r\n @if (row.hasChildren) {\r\n <i class=\"ph ph-caret-right\" aria-hidden=\"true\"></i>\r\n }\r\n </span>\r\n </button>\r\n }\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n</solaris-popover>\r\n", styles: [":host{width:100%;display:block}.solaris-select__trigger{width:100%;min-width:0;display:flex;position:relative;align-items:center;padding-right:2.8rem;gap:var(--solaris-space-2)}.solaris-select__token{opacity:1;min-width:0;flex:0 1 auto;max-width:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--solaris-color-text)}.solaris-select__input{border:0;width:100%;min-width:0;outline:none;flex:1 1 auto;padding:1rem 0;background:transparent;font-size:var(--solaris-fs-14);color:var(--solaris-color-text);line-height:var(--solaris-lh-normal)}:host([data-compact=true]) .solaris-select__input{flex:0 0 2ch;width:2ch;min-width:2ch}.solaris-select__input::placeholder{opacity:.9;color:var(--solaris-color-text-muted)}.solaris-select__chevron-btn i.ph{margin-right:1.5rem;transform:rotate(0);transition:transform .16s ease,opacity .16s ease}:host([data-open=true]) .solaris-select__chevron-btn i.ph{opacity:.95;transform:rotate(180deg)}:host([data-multiple=false]) .solaris-select__trigger,:host([data-multiple=false]) .solaris-select__input,:host([data-multiple=false]) .solaris-select__chevron-btn:not(:disabled){cursor:pointer}.solaris-select__display{top:0;left:0;bottom:0;display:flex;right:2.8rem;overflow:hidden;position:absolute;align-items:center;white-space:nowrap;pointer-events:none;text-overflow:ellipsis}.solaris-select__display.is-hidden{opacity:0}.solaris-select__input::placeholder,.solaris-select__placeholder{opacity:.9;color:var(--solaris-color-text-muted)}.solaris-select__input::placeholder,.solaris-select__placeholder,.solaris-select__token{font-size:var(--solaris-fs-14)}.solaris-select__chevron-btn{top:50%;right:0;border:0;display:grid;width:2.8rem;opacity:.85;height:3.6rem;cursor:pointer;position:absolute;place-items:center;background:transparent;transform:translateY(-50%);color:var(--solaris-color-text-muted)}.solaris-select__chevron-btn:disabled{opacity:.5;cursor:not-allowed}.solaris-select__measure{top:-9999px;left:-9999px;position:absolute;visibility:hidden;pointer-events:none;max-width:none!important;overflow:visible!important;width:max-content!important;white-space:nowrap!important;text-overflow:clip!important;display:inline-block!important}.solaris-select__popover{padding:var(--solaris-space-2)}.solaris-select__panel{display:grid;overflow:auto;max-height:32rem;padding:.25rem;gap:var(--solaris-space-2);border-radius:var(--solaris-radius-sm);background:var(--solaris-color-surface-2);border:1px solid var(--solaris-color-border)}.solaris-select__checkbox-spacer{width:1.6rem;height:1.6rem}.solaris-select__nav{display:grid;align-items:center;padding-right:1rem;gap:var(--solaris-space-2);grid-template-columns:auto 1fr}.solaris-select__back{border:0;cursor:pointer;align-items:center;display:inline-flex;background:transparent;gap:var(--solaris-space-1);padding:var(--solaris-space-2);color:var(--solaris-color-text);border-radius:var(--solaris-radius-sm)}.solaris-select__back:hover{background:var(--solaris-color-surface-2)}.solaris-select__title{justify-self:end;font-size:var(--solaris-fs-12);padding-right:var(--solaris-space-1);color:var(--solaris-color-text-muted)}.solaris-select__list{gap:.25rem;display:grid}.solaris-select__group{opacity:.9;padding:.4rem .6rem;text-transform:uppercase;font-size:var(--solaris-fs-10);letter-spacing:var(--solaris-ls-md);color:var(--solaris-color-text-muted)}.solaris-select__divider{height:1px;margin:.35rem .2rem;background:color-mix(in srgb,var(--solaris-color-border) 75%,transparent)}.solaris-select__option{width:100%;border:0;display:grid;cursor:pointer;text-align:left;align-items:center;padding:.7rem .8rem;background:transparent;gap:var(--solaris-space-4);color:var(--solaris-color-text);grid-template-columns:auto 1fr auto;border-radius:var(--solaris-radius-sm)}.solaris-select__option:hover{background:var(--solaris-color-surface-2)}.solaris-select__option.is-active{background:color-mix(in srgb,var(--solaris-color-primary) 7%,var(--solaris-color-surface-2))}.solaris-select__option:disabled{opacity:.45;cursor:not-allowed}.solaris-select__option-leading{align-items:center;display:inline-flex;gap:var(--solaris-space-2)}.solaris-select__checkbox{display:grid;width:1.6rem;height:1.6rem;place-items:center;border-radius:.4rem;background:var(--solaris-color-surface);color:var(--solaris-color-primary-contrast);border:1px solid color-mix(in srgb,var(--solaris-color-border) 85%,transparent)}.solaris-select__checkbox i.ph{opacity:0;line-height:1;font-size:1.2rem;transform:scale(.9);transition:opacity .12s ease,transform .12s ease}.solaris-select__checkbox.is-checked{background:var(--solaris-color-primary);border-color:color-mix(in srgb,var(--solaris-color-primary) 70%,var(--solaris-color-border))}.solaris-select__checkbox.is-checked i.ph{opacity:1;transform:scale(1)}.solaris-select__avatar{width:1.8rem;height:1.8rem;object-fit:cover;border-radius:var(--solaris-radius-full)}.solaris-select__icon{opacity:.9;font-size:var(--solaris-fs-16);color:var(--solaris-color-text-muted)}.solaris-select__option-main{min-width:0;gap:.15rem;display:grid}.solaris-select__option-label{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.solaris-select__option-desc{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:var(--solaris-fs-12);color:var(--solaris-color-text-muted)}.solaris-select__option-end{opacity:.9;align-items:center;display:inline-flex;gap:var(--solaris-space-2);color:var(--solaris-color-text-muted)}.solaris-select__option-end i.ph-check{color:var(--solaris-color-success)}.solaris-select__end-text{font-size:var(--solaris-fs-12);color:var(--solaris-color-text-muted)}\n"] }]
|
|
8350
8443
|
}], ctorParameters: () => [], propDecorators: { field: [{
|
|
8351
8444
|
type: Optional
|
|
8352
8445
|
}], tokenEl: [{
|