@@ -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
447334declare global {
0 commit comments