Skip to content

Commit

Permalink
refactor comp
Browse files Browse the repository at this point in the history
  • Loading branch information
zrcoder committed Feb 8, 2025
1 parent 0a7bdcf commit c79cf5c
Show file tree
Hide file tree
Showing 162 changed files with 360 additions and 187 deletions.
354 changes: 176 additions & 178 deletions comp.go

Large diffs are not rendered by default.

181 changes: 181 additions & 0 deletions comp/comp.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
package comp

import (
"github.com/zrcoder/amisgo/internal/comp"
)

type (
Action = comp.Action

Alert = comp.Alert
AnchorNav = comp.AnchorNav
App = comp.App
Audio = comp.Audio
Avatar = comp.Avatar
Barcode = comp.Barcode
Breadcrumb = comp.Breadcrumb
Button = comp.Action
ButtonGroup = comp.ButtonGroup
ButtonGroupSelect = comp.Select
ButtonToolbar = comp.ButtonToolbar
Calendar = comp.Calendar
Card = comp.Card
Cards = comp.Cards
Carousel = comp.Carousel
ChainedSelect = comp.ChainedSelect
Chart = comp.Chart
ChartRadios = comp.ChartRadios
Checkbox = comp.Checkbox
Checkboxes = comp.Checkboxes
Code = comp.Code
Collapse = comp.Collapse
CollapseGroup = comp.CollapseGroup
Color = comp.Color
Combo = comp.Combo
ConditionBuilder = comp.ConditionBuilder
ConditionGroupValue = comp.ConditionGroupValue
Container = comp.Container
Control = comp.Control
CopyButton = comp.CopyButton
Crud = comp.Crud
CrudCards = comp.Crud
CrudList = comp.Crud
CrudTable = comp.Crud
Custom = comp.Custom
Date = comp.Date
DateRange = comp.DateRange
Dialog = comp.Dialog
DialogAction = comp.DialogAction
DiffEditor = comp.DiffEditor
Divider = comp.Divider
Drawer = comp.Drawer
DrawerAction = comp.DrawerAction
DropdownButton = comp.DropdownButton
Each = comp.Each
Editor = comp.Editor
EmailAction = comp.EmailAction
FieldSet = comp.FieldSet
Flex = comp.Flex
Form = comp.Form
Formula = comp.Formula
Grid = comp.Grid
Grid2d = comp.Grid2d
GridNav = comp.GridNav
Group = comp.Group
HBox = comp.HBox
Hidden = comp.Hidden
Html = comp.Tpl
Icon = comp.Icon
IconPicker = comp.IconPicker
Iframe = comp.Iframe
Image = comp.Image
Images = comp.Images
InputArray = comp.InputArray
InputCity = comp.InputCity
InputColor = comp.InputColor
InputDate = comp.InputDate
InputDateRange = comp.InputDateRange
InputDatetime = comp.InputDatetime
InputDatetimeRange = comp.InputDatetimeRange
InputEmail = comp.InputText
InputExcel = comp.InputExcel
InputFile = comp.InputFile
InputGroup = comp.InputGroup
InputImage = comp.InputImage
InputKV = comp.InputKV
InputKVS = comp.InputKVS
InputMonth = comp.InputMonth
InputMonthRange = comp.InputMonthRange
InputNumber = comp.InputNumber
InputPassword = comp.InputText
InputQuarter = comp.InputQuarter
InputQuarterRange = comp.InputQuarterRange
InputRange = comp.InputRange
InputRating = comp.InputRating
InputRepeat = comp.InputRepeat
InputRichText = comp.InputRichText
InputSignature = comp.InputSignature
InputSubForm = comp.InputSubForm
InputTable = comp.InputTable
InputTag = comp.InputTag
InputText = comp.InputText
InputTime = comp.InputTime
InputTimeRange = comp.InputTimeRange
InputTree = comp.InputTree
InputUrl = comp.InputText
InputYear = comp.InputYear
InputYearRange = comp.InputYearRange
Json = comp.Json
JsonEditor = comp.Editor
JsonSchemaEditor = comp.JsonSchemaEditor
Link = comp.Link
LinkAction = comp.LinkAction
List = comp.List
ListSelect = comp.ListSelect
LocationPicker = comp.LocationPicker
Log = comp.Log
Mapping = comp.Mapping
Markdown = comp.Markdown
MatrixCheckboxes = comp.MatrixCheckboxes
MultilineText = comp.MultilineText
Nav = comp.Nav
NestedSelect = comp.NestedSelect
Timeline = comp.Timeline
Operation = comp.Operation
OtherAction = comp.OtherAction
Page = comp.Page
Pagination = comp.Pagination
PaginationWrapper = comp.PaginationWrapper
Panel = comp.Panel
Password = comp.Password
Picker = comp.Picker
Plain = comp.Plain
Portlet = comp.Portlet
Progress = comp.Progress
Property = comp.Property
QRCode = comp.QRCode
Radio = comp.Radio
Radios = comp.Radios
ReloadAction = comp.ReloadAction
Remark = comp.Remark
SearchBox = comp.SearchBox
Select = comp.Select
Service = comp.Service
SparkLine = comp.SparkLine
Spinner = comp.Spinner
Static = comp.Static
Status = comp.Status
Steps = comp.Steps
SubmitAction = comp.Action
SvgIcon = comp.SvgIcon
Switch = comp.SwitchControl
SwitchContainer = comp.SwitchContainer
Table = comp.Table
Table2 = comp.Table
TableView = comp.TableView
Tabs = comp.Tabs
TabsTransfer = comp.TabsTransfer
TabsTransferPicker = comp.TabsTransferPicker
Tag = comp.Tag
Tasks = comp.Tasks
Text = comp.Text
Textarea = comp.Textarea
ToastAction = comp.ToastAction
TooltipWrapper = comp.TooltipWrapper
Tpl = comp.Tpl
Transfer = comp.Transfer
TransferPicker = comp.TransferPicker
TreeSelect = comp.TreeSelect
UUID = comp.UUID
UrlAction = comp.UrlAction
UserSelect = comp.UserSelect
VBox = comp.VBox
Video = comp.Video
WangEditor = comp.WangEditor
Watermark = comp.Watermark
WebComponent = comp.WebComponent
Wizard = comp.Wizard
WizardStep = comp.WizardStep
Words = comp.Words
Wrapper = comp.Wrapper
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 3 additions & 9 deletions comp/select.go → internal/comp/select.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ func NewButtonGroupSelect() Select {
return Select{"type": "button-group-select"}
}

// NewThemeSelect creates a new select instance for theme selection.
// Themes makes the select for theme selection.
// Note: Ensure that `conf.WithThemes` is called during app initialization to avoid a panic.
func NewThemeSelect(mux *http.ServeMux, templ *template.Templ) Select {
func (s Select) Themes(mux *http.ServeMux, templ *template.Templ) Select {
const theme = "theme"
themes := templ.GetThemes()
if len(themes) == 0 {
Expand All @@ -33,7 +33,7 @@ func NewThemeSelect(mux *http.ServeMux, templ *template.Templ) Select {
templ.Theme = templ.GetTheme(m[theme])
return nil
}, theme)
return NewSelect().Name(theme).Source(servemux.ServeData(mux, func() (any, error) {
return s.Name(theme).Source(servemux.ServeData(mux, func() (any, error) {
return model.SuccessResponse(" ", model.Schema{
"value": templ.Theme.Value,
"options": themes,
Expand All @@ -50,12 +50,6 @@ func NewThemeSelect(mux *http.ServeMux, templ *template.Templ) Select {
)
}

// NewThemeButtonGroupSelect creates a new button group select instance for theme selection.
// Note: Ensure that `conf.WithThemes` is called during app initialization to avoid a panic.
func NewThemeButtonGroupSelect(mux *http.ServeMux, templ *template.Templ) Select {
return NewThemeSelect(mux, templ).set("type", "button-group-select")
}

// set sets the key-value pair in the selectControl instance
func (sc Select) set(key string, value any) Select {
sc[key] = value
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit c79cf5c

Please sign in to comment.