Use an MD icon for the clear button

This commit is contained in:
Jeremy Stretch 2024-02-08 13:14:27 -05:00
parent 3fa5168ea8
commit 7f3c181d06
4 changed files with 10 additions and 11 deletions

Binary file not shown.

View File

@ -1,10 +1,9 @@
export const config = { export const config = {
plugins: {
// Provides the "clear" button on the widget // Provides the "clear" button on the widget
plugins: { clear_button: {
'clear_button': { html: (data: Dict) =>
'html': (data: Dict) => `<i class="mdi mdi-close-circle ${data.className}" title="${data.title}"></i>` `<i class="mdi mdi-close-circle ${data.className}" title="${data.title}"></i>`,
} },
}, },
};
}

View File

@ -1,7 +1,7 @@
import { TomOption } from 'tom-select/src/types'; import { TomOption } from 'tom-select/src/types';
import { escape_html } from 'tom-select/src/utils'; import { escape_html } from 'tom-select/src/utils';
import { DynamicTomSelect } from './classes/dynamicTomSelect'; import { DynamicTomSelect } from './classes/dynamicTomSelect';
import { config } from './config' import { config } from './config';
import { getElements } from '../util'; import { getElements } from '../util';
const VALUE_FIELD = 'id'; const VALUE_FIELD = 'id';

View File

@ -1,7 +1,7 @@
import { TomOption } from 'tom-select/src/types'; import { TomOption } from 'tom-select/src/types';
import TomSelect from 'tom-select'; import TomSelect from 'tom-select';
import { escape_html } from 'tom-select/src/utils'; import { escape_html } from 'tom-select/src/utils';
import { config } from './config' import { config } from './config';
import { getElements } from '../util'; import { getElements } from '../util';
// Initialize <select> elements with statically-defined options // Initialize <select> elements with statically-defined options