autocomplete refactor

This commit is contained in:
sindhu
2024-05-14 08:57:03 +07:00
parent 93186320d7
commit a99342edc7
8 changed files with 416 additions and 367 deletions

View File

@@ -2,7 +2,7 @@ package customtextfieldautocomplete;
import (
"cpone/layout"
services "cpone/services/dev"
"cpone/models"
)
templ MainCustomAutoComplete(value string) {
@@ -32,7 +32,7 @@ templ ListCustomAutoCompleteHide() {
<div id="hasilAutoComplete"></div>
}
templ ListCustomAutoComplete(limit string, param string, totalDataInt int, foundCount int, pageOf string, textFound string, data []services.AutoComplete) {
templ ListCustomAutoComplete(limit string, param string, totalDataInt int, foundCount int, pageOf string, textFound string, data []models.AutoComplete) {
<div id="contentList" class="bootstrap-autocomplete dropdown-menu-custom bg-white show">
if len(data) == 0 {
<a class="dropdown-item" href="#" style="overflow: hidden; text-overflow: ellipsis;">Data Tidak Ditemukan</a>

View File

@@ -12,7 +12,7 @@ import "bytes"
import (
"cpone/layout"
services "cpone/services/dev"
"cpone/models"
)
func MainCustomAutoComplete(value string) templ.Component {
@@ -76,7 +76,7 @@ func ListCustomAutoCompleteHide() templ.Component {
})
}
func ListCustomAutoComplete(limit string, param string, totalDataInt int, foundCount int, pageOf string, textFound string, data []services.AutoComplete) templ.Component {
func ListCustomAutoComplete(limit string, param string, totalDataInt int, foundCount int, pageOf string, textFound string, data []models.AutoComplete) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {