From c9a6b21aaeb6b0d47fa1e10e8529e40c61bae63a Mon Sep 17 00:00:00 2001 From: adibwp Date: Tue, 4 Jun 2024 14:25:19 +0700 Subject: [PATCH] modal templ --- handlers/dev/md.nonlabtemplate.handlers.go | 2 + models/nonlabtemplate.models.go | 18 + .../mdnonlabtemplate/mdnonlabtemplate.templ | 4 +- .../mdnonlabtemplate_templ.go | 12 +- .../mdnonlabtemplate/mdnonlabtmptmodal.templ | 129 ++++++ .../mdnonlabtmptmodal_templ.go | 437 ++++++++++++++++++ .../mdnonlabtmptmodaldel.templ | 57 +++ .../mdnonlabtmptmodaldel_templ.go | 218 +++++++++ 8 files changed, 873 insertions(+), 4 deletions(-) create mode 100644 views/dev/mdnonlabtemplate/mdnonlabtmptmodal.templ create mode 100644 views/dev/mdnonlabtemplate/mdnonlabtmptmodal_templ.go create mode 100644 views/dev/mdnonlabtemplate/mdnonlabtmptmodaldel.templ create mode 100644 views/dev/mdnonlabtemplate/mdnonlabtmptmodaldel_templ.go diff --git a/handlers/dev/md.nonlabtemplate.handlers.go b/handlers/dev/md.nonlabtemplate.handlers.go index 8c468f7..fc62616 100644 --- a/handlers/dev/md.nonlabtemplate.handlers.go +++ b/handlers/dev/md.nonlabtemplate.handlers.go @@ -121,6 +121,8 @@ func (nlt *MDNonlabTemplateHandler) HandleShowNonlabTemplateScreen(c echo.Contex dev_mdnonlabtemplateview.AfterRequestContent(), ) + // dialog delete + content := dev_mdnonlabtemplateview.MdNonlabTemplateScreen( tableID, paginationID, diff --git a/models/nonlabtemplate.models.go b/models/nonlabtemplate.models.go index e087fc1..ac50cb4 100644 --- a/models/nonlabtemplate.models.go +++ b/models/nonlabtemplate.models.go @@ -1,5 +1,7 @@ package models +import "github.com/a-h/templ" + type MDNonlabTemplate struct { NonlabTemplateID int `db:"NonlabTemplateID"` NonlabTemplateName string `db:"NonlabTemplateName"` @@ -12,3 +14,19 @@ type MDNonlabTemplate struct { NonlabTemplateDelete string `db:"NonlabTemplateDelete"` NonlabTemplateDeleteUserID string `db:"NonlabTemplateDeleteUserID"` } + +type MDNonlabTemplateForm struct { + IDComponent string + Link string + HxTarget string + HxSwap string + HxInclude string + ModalID string + ModalTitle string + InputID CustomTextFieldv2Prm + InputName CustomTextFieldv2Prm + InputFlag CustomCheckboxv1Prm + DialogBody templ.Component + DialogAction templ.Component + ButtonClose templ.Component +} diff --git a/views/dev/mdnonlabtemplate/mdnonlabtemplate.templ b/views/dev/mdnonlabtemplate/mdnonlabtemplate.templ index c682678..b4d8453 100644 --- a/views/dev/mdnonlabtemplate/mdnonlabtemplate.templ +++ b/views/dev/mdnonlabtemplate/mdnonlabtemplate.templ @@ -20,7 +20,7 @@ templ MdNonlabTemplateScreen( paginationtable templ.Component, // modalAddForm templ.Component, // modalEditForm templ.Component, - // modalDeleteForm templ.Component, + modalDeleteForm templ.Component, ) {
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableID", @@ -99,7 +99,7 @@ templ MdNonlabTemplateScreen(
// @modalAddForm // @modalEditForm - // @modalDeleteForm + @modalDeleteForm
} diff --git a/views/dev/mdnonlabtemplate/mdnonlabtemplate_templ.go b/views/dev/mdnonlabtemplate/mdnonlabtemplate_templ.go index 939f0ac..cb49a66 100644 --- a/views/dev/mdnonlabtemplate/mdnonlabtemplate_templ.go +++ b/views/dev/mdnonlabtemplate/mdnonlabtemplate_templ.go @@ -30,7 +30,7 @@ func MdNonlabTemplateScreen( paginationtable templ.Component, // modalAddForm templ.Component, // modalEditForm templ.Component, - // modalDeleteForm templ.Component, + modalDeleteForm templ.Component, ) 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) @@ -161,7 +161,15 @@ func MdNonlabTemplateScreen( if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Loading...
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
Loading...
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = modalDeleteForm.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/views/dev/mdnonlabtemplate/mdnonlabtmptmodal.templ b/views/dev/mdnonlabtemplate/mdnonlabtmptmodal.templ new file mode 100644 index 0000000..c12d002 --- /dev/null +++ b/views/dev/mdnonlabtemplate/mdnonlabtmptmodal.templ @@ -0,0 +1,129 @@ +package dev_mdnonlabtemplateview + +import "cpone/models" +import "cpone/component/modal" +import "cpone/component/customtextfield" +import "cpone/component/customcheckbox" + +templ MDNonlabTmpltForm(data models.MDNonlabTemplateForm) { +
+
+ @modalcomponent.ModalXL(data.ModalID, + data.ModalTitle, + data.DialogBody, + data.DialogAction, + data.ButtonClose, + ) +
+
+} + +script HandleFormBeforeRequest() { + const btnActCancel = document.querySelectorAll('.btnactcancel'); + const btnActSaveData = document.querySelectorAll('.btnactsavedata'); + + for (let i = 0; i < btnActCancel.length; i++) { + btnActCancel[i].setAttribute('disabled', 'true'); + } + for (let i = 0; i < btnActSaveData.length; i++) { + btnActSaveData[i].setAttribute('disabled', 'true'); + } +} + +script HandleFormAfterRequest() { + const btnActCancel = document.querySelectorAll('.btnactcancel'); + const btnActSaveData = document.querySelectorAll('.btnactsavedata'); + + for (let i = 0; i < btnActCancel.length; i++) { + btnActCancel[i].removeAttribute('disabled'); + } + for (let i = 0; i < btnActSaveData.length; i++) { + btnActSaveData[i].removeAttribute('disabled'); + } +} + +templ BodyFormMDNonlabTemplate( + componentID string, + inputID models.CustomTextFieldv2Prm, + inputName models.CustomTextFieldv2Prm, + inputFlag models.CustomCheckboxv1Prm, + hxOnLoad templ.ComponentScript, +) { +
+ @customtextfield.CustomTextFieldv2(inputID) + @customtextfield.CustomTextFieldv2(inputName) + @customcheckbox.MainCustomCheckboxInput(inputFlag) +
+ +} + +script JSHideModal(modalID string) { + $(modalID).modal('hide') +} + +script JSShowModal(modalID string) { + $(modalID).modal('show') + const btnActCancel = document.querySelectorAll('.btnactcancel'); + const btnActSaveData = document.querySelectorAll('.btnactsavedata'); + + for (let i = 0; i < btnActCancel.length; i++) { + btnActCancel[i].removeAttribute('disabled'); + } + for (let i = 0; i < btnActSaveData.length; i++) { + btnActSaveData[i].removeAttribute('disabled'); + } +} + +templ ActionFormMDNonlabTmplt(LinkClose string, targetClose string, hxSwapClose string, modalID string) { +
+ + +
+} + +templ BtnCloseFormMDNonlabTmplt(LinkClose string, targetClose string, hxSwapClose string, modalID string) { + +} \ No newline at end of file diff --git a/views/dev/mdnonlabtemplate/mdnonlabtmptmodal_templ.go b/views/dev/mdnonlabtemplate/mdnonlabtmptmodal_templ.go new file mode 100644 index 0000000..0f28e68 --- /dev/null +++ b/views/dev/mdnonlabtemplate/mdnonlabtmptmodal_templ.go @@ -0,0 +1,437 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package dev_mdnonlabtemplateview + +//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" + +import "cpone/models" +import "cpone/component/modal" +import "cpone/component/customtextfield" +import "cpone/component/customcheckbox" + +func MDNonlabTmpltForm(data models.MDNonlabTemplateForm) 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 + } + templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HandleFormBeforeRequest(), HandleFormAfterRequest()) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = modalcomponent.ModalXL(data.ModalID, + data.ModalTitle, + data.DialogBody, + data.DialogAction, + data.ButtonClose, + ).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, 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 + }) +} + +func HandleFormBeforeRequest() templ.ComponentScript { + return templ.ComponentScript{ + Name: `__templ_HandleFormBeforeRequest_7bdf`, + Function: `function __templ_HandleFormBeforeRequest_7bdf(){const btnActCancel = document.querySelectorAll('.btnactcancel'); + const btnActSaveData = document.querySelectorAll('.btnactsavedata'); + + for (let i = 0; i < btnActCancel.length; i++) { + btnActCancel[i].setAttribute('disabled', 'true'); + } + for (let i = 0; i < btnActSaveData.length; i++) { + btnActSaveData[i].setAttribute('disabled', 'true'); + } +}`, + Call: templ.SafeScript(`__templ_HandleFormBeforeRequest_7bdf`), + CallInline: templ.SafeScriptInline(`__templ_HandleFormBeforeRequest_7bdf`), + } +} + +func HandleFormAfterRequest() templ.ComponentScript { + return templ.ComponentScript{ + Name: `__templ_HandleFormAfterRequest_cc6f`, + Function: `function __templ_HandleFormAfterRequest_cc6f(){const btnActCancel = document.querySelectorAll('.btnactcancel'); + const btnActSaveData = document.querySelectorAll('.btnactsavedata'); + + for (let i = 0; i < btnActCancel.length; i++) { + btnActCancel[i].removeAttribute('disabled'); + } + for (let i = 0; i < btnActSaveData.length; i++) { + btnActSaveData[i].removeAttribute('disabled'); + } +}`, + Call: templ.SafeScript(`__templ_HandleFormAfterRequest_cc6f`), + CallInline: templ.SafeScriptInline(`__templ_HandleFormAfterRequest_cc6f`), + } +} + +func BodyFormMDNonlabTemplate( + componentID string, + inputID models.CustomTextFieldv2Prm, + inputName models.CustomTextFieldv2Prm, + inputFlag models.CustomCheckboxv1Prm, + hxOnLoad templ.ComponentScript, +) 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_Var9 := templ.GetChildren(ctx) + if templ_7745c5c3_Var9 == nil { + templ_7745c5c3_Var9 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxOnLoad) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(inputID).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(inputName).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = customcheckbox.MainCustomCheckboxInput(inputFlag).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, 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 + }) +} + +func JSHideModal(modalID string) templ.ComponentScript { + return templ.ComponentScript{ + Name: `__templ_JSHideModal_4530`, + Function: `function __templ_JSHideModal_4530(modalID){$(modalID).modal('hide') +}`, + Call: templ.SafeScript(`__templ_JSHideModal_4530`, modalID), + CallInline: templ.SafeScriptInline(`__templ_JSHideModal_4530`, modalID), + } +} + +func JSShowModal(modalID string) templ.ComponentScript { + return templ.ComponentScript{ + Name: `__templ_JSShowModal_658d`, + Function: `function __templ_JSShowModal_658d(modalID){$(modalID).modal('show') + const btnActCancel = document.querySelectorAll('.btnactcancel'); + const btnActSaveData = document.querySelectorAll('.btnactsavedata'); + + for (let i = 0; i < btnActCancel.length; i++) { + btnActCancel[i].removeAttribute('disabled'); + } + for (let i = 0; i < btnActSaveData.length; i++) { + btnActSaveData[i].removeAttribute('disabled'); + } +}`, + Call: templ.SafeScript(`__templ_JSShowModal_658d`, modalID), + CallInline: templ.SafeScriptInline(`__templ_JSShowModal_658d`, modalID), + } +} + +func ActionFormMDNonlabTmplt(LinkClose string, targetClose string, hxSwapClose string, modalID 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_Var12 := templ.GetChildren(ctx) + if templ_7745c5c3_Var12 == nil { + templ_7745c5c3_Var12 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JSHideModal(modalID)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, 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 + }) +} + +func BtnCloseFormMDNonlabTmplt(LinkClose string, targetClose string, hxSwapClose string, modalID 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_Var17 := templ.GetChildren(ctx) + if templ_7745c5c3_Var17 == nil { + templ_7745c5c3_Var17 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JSHideModal(modalID)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, 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/dev/mdnonlabtemplate/mdnonlabtmptmodaldel.templ b/views/dev/mdnonlabtemplate/mdnonlabtmptmodaldel.templ new file mode 100644 index 0000000..1361b7b --- /dev/null +++ b/views/dev/mdnonlabtemplate/mdnonlabtmptmodaldel.templ @@ -0,0 +1,57 @@ +package dev_mdnonlabtemplateview + +import "cpone/models" +import "cpone/component/customtextfield" + +templ DeleteKonfirmasiBody( + inputID models.CustomTextFieldv2Prm, + componentID string, + message string, + dataHeader []string, + dataText []string, + hxOnLoad templ.ComponentScript, +) { +
+

{ message }

+
+
+
+ for _, v := range dataHeader { +
{ v }
+ } +
+
+ for _, v := range dataText { +
{ v }
+ } +
+
+
+ @customtextfield.CustomTextFieldv2(inputID) +
+} + +templ ActionFormMDSampleStationDelete(LinkClose string, targetClose string, hxSwapClose string, modalID string) { +
+ + +
+} \ No newline at end of file diff --git a/views/dev/mdnonlabtemplate/mdnonlabtmptmodaldel_templ.go b/views/dev/mdnonlabtemplate/mdnonlabtmptmodaldel_templ.go new file mode 100644 index 0000000..3e432e9 --- /dev/null +++ b/views/dev/mdnonlabtemplate/mdnonlabtmptmodaldel_templ.go @@ -0,0 +1,218 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package dev_mdnonlabtemplateview + +//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" + +import "cpone/models" +import "cpone/component/customtextfield" + +func DeleteKonfirmasiBody( + inputID models.CustomTextFieldv2Prm, + componentID string, + message string, + dataHeader []string, + dataText []string, + hxOnLoad templ.ComponentScript, +) 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.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxOnLoad) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var4 string + templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(message) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodaldel.templ`, Line: 15, Col: 20} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for _, v := range dataHeader { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var5 string + templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(v) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodaldel.templ`, Line: 20, Col: 86} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for _, v := range dataText { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var6 string + templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(v) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdnonlabtemplate\mdnonlabtmptmodaldel.templ`, Line: 25, Col: 67} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(inputID).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, 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 + }) +} + +func ActionFormMDSampleStationDelete(LinkClose string, targetClose string, hxSwapClose string, modalID 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_Var7 := templ.GetChildren(ctx) + if templ_7745c5c3_Var7 == nil { + templ_7745c5c3_Var7 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JSHideModal(modalID)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, 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 + }) +}