diff --git a/packages/corelib/src/ui/datagrid/quicksearchinput.ts b/packages/corelib/src/ui/datagrid/quicksearchinput.tsx similarity index 76% rename from packages/corelib/src/ui/datagrid/quicksearchinput.ts rename to packages/corelib/src/ui/datagrid/quicksearchinput.tsx index ae75c9be30..6b143e0f93 100644 --- a/packages/corelib/src/ui/datagrid/quicksearchinput.ts +++ b/packages/corelib/src/ui/datagrid/quicksearchinput.tsx @@ -17,7 +17,7 @@ export interface QuickSearchInputOptions { @Decorators.registerClass('Serenity.QuickSearchInput') export class QuickSearchInput
extends Widget
{ - static override createDefaultElement() { return Fluent("input").attr("type", "text").getNode(); } + static override createDefaultElement() { return as HTMLInputElement; } declare readonly domNode: HTMLInputElement; declare private lastValue: string; @@ -29,46 +29,29 @@ export class QuickSearchInput
) { super(props); - this.domNode.setAttribute('title', localText('Controls.QuickSearch.Hint')); - this.domNode.setAttribute('placeholder', localText('Controls.QuickSearch.Placeholder')); + this.domNode.title = localText('Controls.QuickSearch.Hint'); + this.domNode.placeholder = localText('Controls.QuickSearch.Placeholder'); this.lastValue = (this.domNode.value ?? "").trim(); Fluent.on(this.domNode, "keyup." + this.uniqueName, this.checkIfValueChanged.bind(this)); Fluent.on(this.domNode, "change." + this.uniqueName, this.checkIfValueChanged.bind(this)); - Fluent("span") - .class("quick-search-icon") - .append(Fluent("i")) - .insertBefore(this.domNode); - - if (this.options.fields?.length > 0) { - var dropdown = Fluent("div") - .class("dropdown quick-search-field") - .insertBefore(this.domNode); - - this.fieldLink = Fluent("a").class('.quick-search-field-toggle') - .attr('title', localText('Controls.QuickSearch.FieldSelection')) - .data("bs-toggle", "dropdown") - .appendTo(dropdown) - .getNode(); - - var menu = Fluent("ul").class("dropdown-menu") - .appendTo(dropdown); - - this.options.fields.forEach(item => - Fluent("li") - .appendTo(menu) - .append(Fluent("a") - .class("dropdown-item") - .attr("href", "#") - .text(item.title ?? '') - .on("click", e => { + this.domNode.before(
) + + if (this.options.fields?.length) { + this.domNode.before( + ); this.field = this.options.fields[0]; this.updateInputPlaceHolder(); diff --git a/packages/corelib/src/ui/editors/comboboxeditor.tsx b/packages/corelib/src/ui/editors/comboboxeditor.tsx index 3c931e7519..d88941e8cc 100644 --- a/packages/corelib/src/ui/editors/comboboxeditor.tsx +++ b/packages/corelib/src/ui/editors/comboboxeditor.tsx @@ -301,21 +301,18 @@ export class ComboboxEditorextends Widget
implements var self = this; addTitle = (addTitle ?? localText('Controls.SelectEditor.InplaceAdd')); editTitle = (editTitle ?? localText('Controls.SelectEditor.InplaceEdit')); - var inplaceButton = Fluent("a") - .class('inplace-button inplace-create') - .attr('title', addTitle) - .append(Fluent("b")) - .insertAfter(this.domNode) - .on("click", function (e) { - self.inplaceCreateClick(e as any); - }); + const inplaceButton = ( { + self.inplaceCreateClick(e as any); + }}>) as HTMLElement; + this.domNode.after(inplaceButton); this.getComboboxContainer()?.classList.add("has-inplace-button"); this.domNode.classList.add("has-inplace-button"); this.element.on("change", () => { var isNew = this.isMultiple() || !this.get_value(); - inplaceButton.attr('title', (isNew ? addTitle : editTitle)).toggleClass('edit', !isNew); + inplaceButton.title = (isNew ? addTitle : editTitle); + inplaceButton.classList.toggle('edit', !isNew); }); this.element.on("change", (e: any) => {