Skip to content

Commit 32e1afa

Browse files
committed
chore: removed mock data
1 parent f180d02 commit 32e1afa

File tree

2 files changed

+2
-115
lines changed

2 files changed

+2
-115
lines changed

elements/pf-search-input/demo/pf-search-input-autocomplete.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="container">
22
<h1>Search with autocomplete</h1>
33
<pf-search-input placeholder="Search">
4-
<!-- <pf-option value="Alabama"> Alabama </pf-option>
4+
<pf-option value="Alabama"> Alabama </pf-option>
55
<pf-option value="New Jersey"> New Jersey </pf-option>
66
<pf-option value="New York"> New York </pf-option>
77
<pf-option value="New Mexico"> New Mexico </pf-option>
@@ -20,7 +20,7 @@ <h1>Search with autocomplete</h1>
2020
<pf-option value="New Jersey3"> New Jersey 3 </pf-option>
2121
<pf-option value="New York3"> New York 3 </pf-option>
2222
<pf-option value="New Mexico3"> New Mexico 3 </pf-option>
23-
<pf-option value="North Carolina3"> North Carolina 3 </pf-option> -->
23+
<pf-option value="North Carolina3"> North Carolina 3 </pf-option>
2424
</pf-search-input>
2525
</div>
2626

elements/pf-search-input/pf-search-input.ts

Lines changed: 0 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -41,104 +41,6 @@ export class PfSearchInput extends LitElement {
4141

4242
static instances: Set<PfSearchInput> = new Set<PfSearchInput>();
4343

44-
optionDetails: {
45-
text: string;
46-
value: string;
47-
}[] = [
48-
{
49-
'text': 'London',
50-
'value': 'london',
51-
},
52-
{
53-
'text': 'Paris',
54-
'value': 'paris',
55-
},
56-
{
57-
'text': 'Tokyo',
58-
'value': 'tokyo',
59-
},
60-
{
61-
'text': 'New York',
62-
'value': 'york',
63-
},
64-
{
65-
'text': 'Rome',
66-
'value': 'rome',
67-
},
68-
{
69-
'text': 'Sydney',
70-
'value': 'sydney',
71-
},
72-
{
73-
'text': 'Beijing',
74-
'value': 'beijing',
75-
},
76-
{
77-
'text': 'Dubai',
78-
'value': 'dubai',
79-
},
80-
{
81-
'text': 'Rio de Janeiro',
82-
'value': 'de',
83-
},
84-
{
85-
'text': 'Barcelona',
86-
'value': 'barcelona',
87-
},
88-
{
89-
'text': 'Istanbul',
90-
'value': 'istanbul',
91-
},
92-
{
93-
'text': 'Cairo',
94-
'value': 'cairo',
95-
},
96-
{
97-
'text': 'Havana',
98-
'value': 'havana',
99-
},
100-
{
101-
'text': 'Machu Picchu',
102-
'value': 'picchu',
103-
},
104-
{
105-
'text': 'The Great Barrier Reef',
106-
'value': 'great',
107-
},
108-
{
109-
'text': 'The Grand Canyon',
110-
'value': 'grand',
111-
},
112-
{
113-
'text': 'The Amazon Rainforest',
114-
'value': 'amazon',
115-
},
116-
{
117-
'text': 'The Great Barrier Reef1',
118-
'value': 'great1',
119-
},
120-
{
121-
'text': 'The Grand Canyon1',
122-
'value': 'grand1',
123-
},
124-
{
125-
'text': 'The Amazon Rainforest1',
126-
'value': 'amazon1',
127-
},
128-
{
129-
'text': 'The Maldives',
130-
'value': 'maldives',
131-
},
132-
{
133-
'text': 'Iceland',
134-
'value': 'iceland',
135-
},
136-
{
137-
'text': 'Bora Bora',
138-
'value': 'bora',
139-
},
140-
];
141-
14244
/** Accessible label for the select */
14345
@property({ attribute: 'accessible-label' }) accessibleLabel?: string;
14446

@@ -220,7 +122,6 @@ export class PfSearchInput extends LitElement {
220122
connectedCallback(): void {
221123
super.connectedCallback();
222124
PfSearchInput.instances.add(this);
223-
this.addOptions(this.optionDetails);
224125
}
225126

226127
disconnectedCallback(): void {
@@ -428,20 +329,6 @@ export class PfSearchInput extends LitElement {
428329
this._toggleInput!.value = this.value;
429330
this.#combobox.selected = [];
430331
}
431-
432-
addOptions(optionData: {
433-
text: string;
434-
value: string;
435-
}[]): void {
436-
const options: PfOption[] = optionData.map(optionDetail => {
437-
const option: PfOption = document.createElement('pf-option');
438-
option.textContent = `${optionDetail.text}`;
439-
option.value = `${optionDetail.text}`;
440-
option.setAttribute('suggestion', '');
441-
return option;
442-
});
443-
this.append(...options);
444-
}
445332
}
446333

447334
declare global {

0 commit comments

Comments
 (0)