From 48b4de265f213215edf3100242daf6763ec240a2 Mon Sep 17 00:00:00 2001 From: sindhu Date: Mon, 6 May 2024 09:14:45 +0700 Subject: [PATCH] add active search dan text field biasa --- assets/sindhu/catatan_inputan.txt | 5 + .../customtextfield/customtextfield.templ | 17 ++ .../customtextfield/customtextfield_templ.go | 103 ++++++++++++ .../customtextfieldsearch.templ | 22 +++ .../customtextfieldsearch_templ.go | 146 ++++++++++++++++++ 5 files changed, 293 insertions(+) create mode 100644 assets/sindhu/catatan_inputan.txt create mode 100644 views/component/customtextfield/customtextfield.templ create mode 100644 views/component/customtextfield/customtextfield_templ.go create mode 100644 views/component/customtextfieldsearch/customtextfieldsearch.templ create mode 100644 views/component/customtextfieldsearch/customtextfieldsearch_templ.go diff --git a/assets/sindhu/catatan_inputan.txt b/assets/sindhu/catatan_inputan.txt new file mode 100644 index 0000000..f7e31fa --- /dev/null +++ b/assets/sindhu/catatan_inputan.txt @@ -0,0 +1,5 @@ +// Example Custom Text Field +@customtextfield.MainCustomTextField("Kode", "kode", "Kode", "text") + +// Example Active Search +@customtextfieldsearch.MainCustomTextFieldSearch("pid", "PID / Nama","text","/search", "", "input changed delay:500ms, search", ".htmx-indicator") \ No newline at end of file diff --git a/views/component/customtextfield/customtextfield.templ b/views/component/customtextfield/customtextfield.templ new file mode 100644 index 0000000..189b9be --- /dev/null +++ b/views/component/customtextfield/customtextfield.templ @@ -0,0 +1,17 @@ +package customtextfield + +templ MainCustomTextField(inpLabelText, + inpName, + inpPlaceHolder, + inpType string) { +
+ + +
+} diff --git a/views/component/customtextfield/customtextfield_templ.go b/views/component/customtextfield/customtextfield_templ.go new file mode 100644 index 0000000..eaa6d1d --- /dev/null +++ b/views/component/customtextfield/customtextfield_templ.go @@ -0,0 +1,103 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package customtextfield + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import "context" +import "io" +import "bytes" + +func MainCustomTextField(inpLabelText, + inpName, + inpPlaceHolder, + inpType string) 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 { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} diff --git a/views/component/customtextfieldsearch/customtextfieldsearch.templ b/views/component/customtextfieldsearch/customtextfieldsearch.templ new file mode 100644 index 0000000..a7c860f --- /dev/null +++ b/views/component/customtextfieldsearch/customtextfieldsearch.templ @@ -0,0 +1,22 @@ +package customtextfieldsearch + +templ MainCustomTextFieldSearch( + inpName, + inpPlaceHolder, + inpType, + hxPost, + hxTrigger, + hxTarget, + hxIndicator string) { + +} \ No newline at end of file diff --git a/views/component/customtextfieldsearch/customtextfieldsearch_templ.go b/views/component/customtextfieldsearch/customtextfieldsearch_templ.go new file mode 100644 index 0000000..cd7cf7c --- /dev/null +++ b/views/component/customtextfieldsearch/customtextfieldsearch_templ.go @@ -0,0 +1,146 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package customtextfieldsearch + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import "context" +import "io" +import "bytes" + +func MainCustomTextFieldSearch( + inpName, + inpPlaceHolder, + inpType, + hxPost, + hxTrigger, + hxTarget, + hxIndicator string) 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 { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +}