@@ -261,90 +261,4 @@ export class WorkflowTagFilter extends BtrixElement {
261
261
</ ul >
262
262
` ;
263
263
}
264
-
265
- private renderTagsInLabel ( tags : string [ ] ) {
266
- const formatter2 = this . localize . list (
267
- tags . length > MAX_TAGS_IN_LABEL
268
- ? [
269
- ...tags . slice ( 0 , MAX_TAGS_IN_LABEL ) ,
270
- msg (
271
- str `${ this . localize . number ( tags . length - MAX_TAGS_IN_LABEL ) } more` ,
272
- ) ,
273
- ]
274
- : tags ,
275
- ) ;
276
-
277
- return formatter2 . map ( ( part , index , array ) =>
278
- part . type === "literal"
279
- ? html `< span class ="opacity-75 "> ${ part . value } </ span > `
280
- : tags . length > MAX_TAGS_IN_LABEL && index === array . length - 1
281
- ? html `< span class ="text-primary-500 "> ${ part . value } </ span > `
282
- : html `< span > ${ part . value } </ span > ` ,
283
- ) ;
284
- }
285
-
286
- private renderSearch ( ) {
287
- return html `
288
- < label for ="tag-search " class ="sr-only "> ${ msg ( "Filter tags" ) } </ label >
289
- < sl-input
290
- class ="min-w-[30ch] "
291
- id ="tag-search "
292
- role ="combobox "
293
- aria-autocomplete ="list "
294
- aria-expanded ="true "
295
- aria-controls ="tag-listbox "
296
- aria-activedescendant ="tag-selected-option "
297
- value =${ this . searchString }
298
- placeholder =${ msg ( "Search for tag" ) }
299
- size="small"
300
- ?disabled=${ ! this . orgTagsTask . value ?. length }
301
- @sl-input=${ ( e : SlInputEvent ) =>
302
- ( this . searchString = ( e . target as SlInput ) . value ) }
303
- >
304
- ${ this . orgTagsTask . render ( {
305
- pending : ( ) => html `< sl-spinner slot ="prefix "> </ sl-spinner > ` ,
306
- complete : ( ) => html `< sl-icon slot ="prefix " name ="search "> </ sl-icon > ` ,
307
- } ) }
308
- </ sl-input >
309
- ` ;
310
- }
311
-
312
- private renderList ( opts : { item : string } [ ] ) {
313
- const tag = ( tag : string ) => {
314
- const checked = this . selected . get ( tag ) === true ;
315
-
316
- return html `
317
- < li role ="option " aria-checked =${ checked } >
318
- < sl-checkbox
319
- class ="w-full part-[base]:w-full part-[base]:rounded part-[base]:p-2 part-[base]:hover:bg-primary-50 part-[base]:focus:bg-primary-50 "
320
- value =${ tag }
321
- ?checked =${ checked }
322
- tabindex="0"
323
- > ${ tag }
324
- </ sl-checkbox >
325
- </ li >
326
- ` ;
327
- } ;
328
-
329
- return html `
330
- < ul
331
- id ="tag-listbox "
332
- class ="flex-1 overflow-auto p-1 "
333
- role ="listbox "
334
- aria-labelledby ="tag-list-label "
335
- aria-multiselectable ="true "
336
- @sl-change =${ async ( e : SlChangeEvent ) => {
337
- const { checked, value } = e . target as SlCheckbox ;
338
-
339
- this . selected . set ( value , checked ) ;
340
- } }
341
- >
342
- ${ repeat (
343
- opts ,
344
- ( { item } ) => item ,
345
- ( { item } ) => tag ( item ) ,
346
- ) }
347
- </ ul >
348
- ` ;
349
- }
350
264
}
0 commit comments