presets

package
v3.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2024 License: MIT Imports: 39 Imported by: 5

README

  • Preset
    • Model
      • Listing

        • Bulk Actions
          • UpdateForm
          • UpdateFunc
        • Filter Menu
        • Filter Tabs
      • Detailing

        • Actions
          • UpdateForm
          • UpdateFunc
      • Editing

        • Multiple Editing Form by Name
      • Creating

Documentation

Index

Constants

View Source
const (
	PermModule          = "presets"
	PermList            = "presets:list"
	PermGet             = "presets:get"
	PermCreate          = "presets:create"
	PermUpdate          = "presets:update"
	PermDelete          = "presets:delete"
	PermActions         = "presets:actions:*"
	PermDoListingAction = "presets:do_listing_action:*"
	PermBulkActions     = "presets:bulk_actions:*"
)
View Source
const (
	ParamID                       = "id"
	ParamAction                   = "action"
	ParamOverlay                  = "overlay"
	ParamOverlayAfterUpdateScript = "overlay_after_update_script"
	ParamOverlayUpdateID          = "overlay_update_id"
	ParamAfterDeleteEvent         = "presets_after_delete_event"
	ParamPortalName               = "portal_name"

	VarsPresetsDataChanged = "presetsDataChanged"

	// list editor
	ParamAddRowFormKey      = "listEditor_AddRowFormKey"
	ParamRemoveRowFormKey   = "listEditor_RemoveRowFormKey"
	ParamIsStartSort        = "listEditor_IsStartSort"
	ParamSortSectionFormKey = "listEditor_SortSectionFormKey"
	ParamSortResultFormKey  = "listEditor_SortResultFormKey"
)

params

View Source
const (
	EnLanguageIcon = `` /* 3758-byte string literal not displayed */

	ZhLanguageIcon = `` /* 585-byte string literal not displayed */

	JPIcon = `` /* 322-byte string literal not displayed */

)
View Source
const (
	PerPageDefault = 50
	PerPageMax     = 1000
)
View Source
const (
	OrderByASC  = "ASC"
	OrderByDESC = "DESC"
)
View Source
const (
	CoreI18nModuleKey   i18n.ModuleKey = "CoreI18nModuleKey"
	ModelsI18nModuleKey i18n.ModuleKey = "ModelsI18nModuleKey"
)
View Source
const (
	RightDrawerPortalName        = "presets_RightDrawerPortalName"
	RightDrawerContentPortalName = "presets_RightDrawerContentPortalName"
	DialogPortalName             = "presets_DialogPortalName"

	NotificationCenterPortalName   = "notification-center"
	DefaultConfirmDialogPortalName = "presets_confirmDialogPortalName"
	ListingDialogPortalName        = "presets_listingDialogPortalName"

	DeleteConfirmPortalName = "deleteConfirm"
)
View Source
const (
	CloseRightDrawerVarScript   = "vars.presetsRightDrawer = false"
	CloseDialogVarScript        = "vars.presetsDialog = false"
	CloseListingDialogVarScript = "vars.presetsListingDialog = false"
)
View Source
const (
	ConfirmDialogConfirmEvent     = "presets_ConfirmDialog_ConfirmEvent"
	ConfirmDialogTitleText        = "presets_ConfirmDialog_TitleText"
	ConfirmDialogPromptText       = "presets_ConfirmDialog_PromptText"
	ConfirmDialogOKText           = "presets_ConfirmDialog_OKText"
	ConfirmDialogCancelText       = "presets_ConfirmDialog_CancelText"
	ConfirmDialogDialogPortalName = "presets_ConfirmDialog_DialogPortalName"
)
View Source
const (
	CtxPageTitleComponent presetsCtx
)
View Source
const ListingCompo_CurrentActiveClass = "vx-list-item--active primary--text"
View Source
const ListingCompo_JsPreFixWhenNotifModelsDeleted = `` /* 143-byte string literal not displayed */
View Source
const ListingCompo_JsScrollToTop = "locals.document.querySelector(`#vt-app > div.v-layout > main`).scrollTop = 0"
View Source
const (
	OpenConfirmDialog = "presets_ConfirmDialog"
)
View Source
const ParamParentID = "parent_id"
View Source
const (
	ParamVarCurrentActive = "var_current_active"
)
View Source
const (
	SectionIsCancel = "isCancel"
)

Variables

View Source
var CloseRightDrawerVarConfirmScript = ConfirmLeaveScript("vars.confirmDrawerLeave=true;", "vars.presetsRightDrawer = false;")
View Source
var Divider = h.RawHTML(`<svg width="1120" height="2" viewBox="0 0 1120 2" fill="none">
<path d="M0 1H1120" stroke="#01012E" stroke-opacity="0.134"/>
</svg>`)
View Source
var ErrRecordNotFound = errors.New("record not found")
View Source
var Messages_en_US = &Messages{
	DialogTitleDefault:           "Confirm",
	SuccessfullyUpdated:          "Successfully Updated",
	SuccessfullyCreated:          "Successfully Created",
	Search:                       "Search",
	New:                          "New",
	Update:                       "Update",
	Delete:                       "Delete",
	Edit:                         "Edit",
	FormTitle:                    "Form",
	OK:                           "OK",
	Cancel:                       "Cancel",
	Clear:                        "Clear",
	Create:                       "Create",
	DeleteConfirmationText:       "Are you sure you want to delete this object?",
	CreatingObjectTitleTemplate:  "New {modelName}",
	EditingObjectTitleTemplate:   "Editing {modelName} {id}",
	ListingObjectTitleTemplate:   "Listing {modelName}",
	DetailingObjectTitleTemplate: "{modelName} {id}",
	FiltersClear:                 "Reset",
	FiltersAdd:                   "Add Filters",
	FilterApply:                  "Apply",
	FilterByTemplate:             "Filter by {filter}",
	FiltersDateInTheLast:         "is in the last",
	FiltersDateEquals:            "is equal to",
	FiltersDateBetween:           "is between",
	FiltersDateIsAfter:           "is after",
	FiltersDateIsAfterOrOn:       "is on or after",
	FiltersDateIsBefore:          "is before",
	FiltersDateIsBeforeOrOn:      "is before or on",
	FiltersDateDays:              "days",
	FiltersDateMonths:            "months",
	FiltersDateAnd:               "and",
	FiltersDateTo:                "to",
	FiltersDateClear:             "Clear",
	FiltersDateOK:                "OK",
	FiltersNumberEquals:          "is equal to",
	FiltersNumberBetween:         "between",
	FiltersNumberGreaterThan:     "is greater than",
	FiltersNumberLessThan:        "is less than",
	FiltersNumberAnd:             "and",
	FiltersStringEquals:          "is equal to",
	FiltersStringContains:        "contains",
	FiltersMultipleSelectIn:      "in",
	FiltersMultipleSelectNotIn:   "not in",
	PaginationRowsPerPage:        "Rows per page: ",
	ListingNoRecordToShow:        "No records to show",
	ListingSelectedCountNotice:   "{count} records are selected. ",
	ListingClearSelection:        "clear selection",
	BulkActionNoRecordsSelected:  "No records selected",
	BulkActionNoAvailableRecords: "None of the selected records can be executed with this action.",
	BulkActionSelectedIdsProcessNoticeTemplate: "Partially selected records cannot be executed with this action: {ids}.",
	ConfirmDialogTitleText:                     "Confirm",
	ConfirmDialogPromptText:                    "Are you sure?",
	Language:                                   "Language",
	Colon:                                      ":",
	NotFoundPageNotice:                         "Sorry, the requested page cannot be found. Please check the URL.",
	ButtonLabelActionsMenu:                     "Actions",
	Save:                                       "Save",
	AddRow:                                     "Add Row",
	CheckboxTrueLabel:                          "YES",
	CheckboxFalseLabel:                         "NO",

	HumanizeTimeAgo:       "ago",
	HumanizeTimeFromNow:   "from now",
	HumanizeTimeNow:       "now",
	HumanizeTime1Second:   "1 second %s",
	HumanizeTimeSeconds:   "%d seconds %s",
	HumanizeTime1Minute:   "1 minute %s",
	HumanizeTimeMinutes:   "%d minutes %s",
	HumanizeTime1Hour:     "1 hour %s",
	HumanizeTimeHours:     "%d hours %s",
	HumanizeTime1Day:      "1 day %s",
	HumanizeTimeDays:      "%d days %s",
	HumanizeTime1Week:     "1 week %s",
	HumanizeTimeWeeks:     "%d weeks %s",
	HumanizeTime1Month:    "1 month %s",
	HumanizeTimeMonths:    "%d months %s",
	HumanizeTime1Year:     "1 year %s",
	HumanizeTime2Years:    "2 years %s",
	HumanizeTimeYears:     "%d years %s",
	HumanizeTimeLongWhile: "a long while %s",

	LeaveBeforeUnsubmit: "If you leave before submitting the form, you will lose all the unsaved input.",
}
View Source
var Messages_ja_JP = &Messages{
	DialogTitleDefault:           "確認",
	SuccessfullyUpdated:          "更新に成功しました",
	SuccessfullyCreated:          "作成に成功しました",
	Search:                       "検索",
	New:                          "作成する",
	Update:                       "更新",
	Delete:                       "削除",
	Edit:                         "編集",
	FormTitle:                    "フォーム",
	OK:                           "OK",
	Cancel:                       "キャンセル",
	Clear:                        "消去する",
	Create:                       "作成する",
	DeleteConfirmationText:       "削除してもよろしいですか?",
	CreatingObjectTitleTemplate:  "新規{modelName}作成",
	EditingObjectTitleTemplate:   "{modelName} {id}を編集する",
	ListingObjectTitleTemplate:   "{modelName}のリスト",
	DetailingObjectTitleTemplate: "{modelName} {id}",
	FiltersClear:                 "フィルタのクリア",
	FiltersAdd:                   "フィルタの追加",
	FilterApply:                  "適用",
	FilterByTemplate:             "フィルタ",
	FiltersDateInTheLast:         "最後の",
	FiltersDateEquals:            "と同様",
	FiltersDateBetween:           "の間にある",
	FiltersDateIsAfter:           "の後である",
	FiltersDateIsAfterOrOn:       "の上または後である",
	FiltersDateIsBefore:          "は前",
	FiltersDateIsBeforeOrOn:      "が前か後か",
	FiltersDateDays:              "日",
	FiltersDateMonths:            "ヶ月",
	FiltersDateAnd:               "と",
	FiltersDateTo:                "に",
	FiltersDateClear:             "消去する",
	FiltersDateOK:                "OK",
	FiltersNumberEquals:          "と同様",
	FiltersNumberBetween:         "の間",
	FiltersNumberGreaterThan:     "より大きい",
	FiltersNumberLessThan:        "より小さい",
	FiltersNumberAnd:             "と",
	FiltersStringEquals:          "と同様",
	FiltersStringContains:        "を含む",
	FiltersMultipleSelectIn:      "で",
	FiltersMultipleSelectNotIn:   "でない",
	PaginationRowsPerPage:        "ページあたりの行数 ",
	ListingNoRecordToShow:        "表示できるレコードがありません",
	ListingSelectedCountNotice:   "{count}レコードが選択されています。",
	ListingClearSelection:        "クリア選択",
	BulkActionNoRecordsSelected:  "レコードが選択されていません",
	BulkActionNoAvailableRecords: "選択されたレコードのいずれも、このアクションでは実行できません。",
	BulkActionSelectedIdsProcessNoticeTemplate: "部分的に選択されたレコードは、このアクションでは実行できません:{ids}。",
	ConfirmDialogTitleText:                     "確認",
	ConfirmDialogPromptText:                    "実行してもよろしいですか?",
	Language:                                   "言語",
	Colon:                                      ":",
	NotFoundPageNotice:                         "リクエストされたページが見つかりません。URLを確認してください。",
	ButtonLabelActionsMenu:                     "アクション",
	Save:                                       "保存する",
	AddRow:                                     "行の追加",
	CheckboxTrueLabel:                          "選択済み",
	CheckboxFalseLabel:                         "未選択",

	HumanizeTimeAgo:       "前",
	HumanizeTimeFromNow:   "今後",
	HumanizeTimeNow:       "現在",
	HumanizeTime1Second:   "1 秒%s",
	HumanizeTimeSeconds:   "%d 秒%s",
	HumanizeTime1Minute:   "1 分%s",
	HumanizeTimeMinutes:   "%d 分%s",
	HumanizeTime1Hour:     "1 時間%s",
	HumanizeTimeHours:     "%d 時間%s",
	HumanizeTime1Day:      "1 日%s",
	HumanizeTimeDays:      "%d 日%s",
	HumanizeTime1Week:     "1 週間%s",
	HumanizeTimeWeeks:     "%d 週間%s",
	HumanizeTime1Month:    "1 ヶ月%s",
	HumanizeTimeMonths:    "%d ヶ月%s",
	HumanizeTime1Year:     "1 年間%s",
	HumanizeTime2Years:    "2 年間%s",
	HumanizeTimeYears:     "%d 年間%s",
	HumanizeTimeLongWhile: "a long while %s",

	LeaveBeforeUnsubmit: "フォームを送信する前に離れると、すべての未保存の入力が失われます。",
}
View Source
var Messages_zh_CN = &Messages{
	DialogTitleDefault:           "确认",
	SuccessfullyUpdated:          "成功更新了",
	SuccessfullyCreated:          "成功创建了",
	Search:                       "搜索",
	New:                          "新建",
	Update:                       "更新",
	Delete:                       "删除",
	Edit:                         "编辑",
	FormTitle:                    "表单",
	OK:                           "确定",
	Cancel:                       "取消",
	Clear:                        "清空",
	Create:                       "创建",
	DeleteConfirmationText:       "你确定你要删除这个对象吗?",
	CreatingObjectTitleTemplate:  "新建{modelName}",
	EditingObjectTitleTemplate:   "编辑{modelName} {id}",
	ListingObjectTitleTemplate:   "{modelName}列表",
	DetailingObjectTitleTemplate: "{modelName} {id}",
	FiltersClear:                 "清空筛选器",
	FiltersAdd:                   "添加筛选器",
	FilterApply:                  "应用",
	FilterByTemplate:             "按{filter}筛选",
	FiltersDateInTheLast:         "过去",
	FiltersDateEquals:            "等于",
	FiltersDateBetween:           "之间",
	FiltersDateIsAfter:           "之后",
	FiltersDateIsAfterOrOn:       "当天或之后",
	FiltersDateIsBefore:          "之前",
	FiltersDateIsBeforeOrOn:      "当天或之前",
	FiltersDateDays:              "天",
	FiltersDateMonths:            "月",
	FiltersDateAnd:               "和",
	FiltersDateTo:                "至",
	FiltersDateClear:             "清空",
	FiltersDateOK:                "确定",
	FiltersNumberEquals:          "等于",
	FiltersNumberBetween:         "之间",
	FiltersNumberGreaterThan:     "大于",
	FiltersNumberLessThan:        "小于",
	FiltersNumberAnd:             "和",
	FiltersStringEquals:          "等于",
	FiltersStringContains:        "包含",
	FiltersMultipleSelectIn:      "包含",
	FiltersMultipleSelectNotIn:   "不包含",
	PaginationRowsPerPage:        "每页: ",
	ListingNoRecordToShow:        "没有可显示的记录",
	ListingSelectedCountNotice:   "{count}条记录被选中。",
	ListingClearSelection:        "清除选择",
	BulkActionNoRecordsSelected:  "没有选中的记录",
	BulkActionNoAvailableRecords: "所有选中的记录均无法执行这个操作。",
	BulkActionSelectedIdsProcessNoticeTemplate: "部分选中的记录无法被执行这个操作: {ids}。",
	ConfirmDialogTitleText:                     "确认",
	ConfirmDialogPromptText:                    "你确定吗?",
	Language:                                   "语言",
	Colon:                                      ":",
	NotFoundPageNotice:                         "很抱歉,所请求的页面不存在,请检查URL。",
	ButtonLabelActionsMenu:                     "菜单",
	Save:                                       "保存",
	AddRow:                                     "新增",
	CheckboxTrueLabel:                          "是",
	CheckboxFalseLabel:                         "否",

	HumanizeTimeAgo:       "前",
	HumanizeTimeFromNow:   "后",
	HumanizeTimeNow:       "刚刚",
	HumanizeTime1Second:   "1 秒%s",
	HumanizeTimeSeconds:   "%d 秒%s",
	HumanizeTime1Minute:   "1 分钟%s",
	HumanizeTimeMinutes:   "%d 分钟%s",
	HumanizeTime1Hour:     "1 小时%s",
	HumanizeTimeHours:     "%d 小时%s",
	HumanizeTime1Day:      "1 天%s",
	HumanizeTimeDays:      "%d 天%s",
	HumanizeTime1Week:     "1 星期%s",
	HumanizeTimeWeeks:     "%d 星期%s",
	HumanizeTime1Month:    "1 个月%s",
	HumanizeTimeMonths:    "%d 个月%s",
	HumanizeTime1Year:     "1 年%s",
	HumanizeTime2Years:    "2 年%s",
	HumanizeTimeYears:     "%d 年%s",
	HumanizeTimeLongWhile: "很久之%s",

	LeaveBeforeUnsubmit: "如果您在提交表单之前离开,您将丢失所有未保存的输入。",
}
View Source
var PermRead = []string{PermList, PermGet}
View Source
var PhraseHasPresetsDataChanged = fmt.Sprintf("Object.values(vars.%s).some(value => value === true)", VarsPresetsDataChanged)

Functions

func AddRowBtnKey added in v3.0.6

func AddRowBtnKey(fromKey string) string

func CloneFieldsLayout added in v3.0.5

func CloneFieldsLayout(layout []interface{}) (r []interface{})

func ConfirmLeaveScript added in v3.0.4

func ConfirmLeaveScript(confirmEvent, leaveEvent string) string

func CustomizeColumnHeader added in v3.0.2

func CustomizeColumnHeader(f func(evCtx *web.EventContext, col *Column, th h.MutableAttrHTMLComponent) (h.MutableAttrHTMLComponent, error), fields ...string) func(in ColumnsProcessor) ColumnsProcessor

func CustomizeColumnLabel added in v3.0.2

func CustomizeColumnLabel(mapper func(evCtx *web.EventContext) (map[string]string, error)) func(in ColumnsProcessor) ColumnsProcessor

func DateTimePicker added in v3.1.1

func DateTimePicker(obj interface{}, field *FieldContext, ctx *web.EventContext) *vuetifyx.VXDateTimePickerBuilder

func DateTimeSetter added in v3.1.1

func DateTimeSetter(obj interface{}, field *FieldContext, ctx *web.EventContext) (err error)

func EditDeleteRowMenuItemFuncs

func EditDeleteRowMenuItemFuncs(mi *ModelInfo, url string, editExtraParams url.Values) []vx.RowMenuItemFunc

func GetActionsComponentTeleportToID added in v3.0.2

func GetActionsComponentTeleportToID(ctx *web.EventContext) string

func GetComponentFromContext added in v3.0.1

func GetComponentFromContext(ctx *web.EventContext, key presetsCtx) (h.HTMLComponent, bool)

func IsInDialog

func IsInDialog(ctx *web.EventContext) bool

func JsonCopy added in v3.0.2

func JsonCopy(dst, src any) error

func ListingCompo_GetVarCurrentActive added in v3.0.4

func ListingCompo_GetVarCurrentActive(evCtx *web.EventContext) string

func MustJsonCopy added in v3.0.2

func MustJsonCopy(dst, src any)

func MustObjectID added in v3.0.2

func MustObjectID(obj any) string

func NotifModelsCreated added in v3.0.2

func NotifModelsCreated(v any) string

func NotifModelsDeleted added in v3.0.2

func NotifModelsDeleted(v any) string

func NotifModelsUpdated added in v3.0.2

func NotifModelsUpdated(v any) string

func ObjectID added in v3.0.2

func ObjectID(obj any) string

func ReadonlyCheckbox added in v3.0.6

func ReadonlyCheckbox(obj interface{}, field *FieldContext, ctx *web.EventContext) *vuetifyx.VXCheckboxBuilder

func ReadonlyText added in v3.0.6

func ReadonlyText(obj interface{}, field *FieldContext, ctx *web.EventContext) *vuetifyx.VXReadonlyFieldBuilder

func RecoverPrimaryColumnValuesBySlug

func RecoverPrimaryColumnValuesBySlug(dec SlugDecoder, slug string) (r map[string]string, err error)

func SelectField added in v3.0.6

func SelectField(obj interface{}, field *FieldContext, ctx *web.EventContext) *vuetifyx.VXSelectBuilder

func ShowMessage

func ShowMessage(r *web.EventResponse, msg string, color string)

func ShowSnackbarScript added in v3.0.3

func ShowSnackbarScript(msg string, color string) string

func TextField added in v3.0.6

func TextField(obj interface{}, field *FieldContext, ctx *web.EventContext) *vuetifyx.VXFieldBuilder

func UpdateToPortal added in v3.0.2

func UpdateToPortal(update *web.PortalUpdate) *web.PortalBuilder

func WrapEventFuncAddon added in v3.0.2

func WrapEventFuncAddon(ctx *web.EventContext, w func(in EventFuncAddon) EventFuncAddon)

func WrapperFieldLabel added in v3.0.5

func WrapperFieldLabel(mapper func(evCtx *web.EventContext, obj interface{}, field *FieldContext) (name2label map[string]string, err error)) func(in FieldComponentFunc) FieldComponentFunc

WrapperFieldLabel a snippet for LazyWrapComponentFunc

Types

type ActionBuilder

type ActionBuilder struct {
	NameLabel
	// contains filtered or unexported fields
}

func (*ActionBuilder) ButtonColor

func (b *ActionBuilder) ButtonColor(v string) (r *ActionBuilder)

ButtonColor defines the color of default button if buttonCompFunc is not defined.

func (*ActionBuilder) ButtonCompFunc

func (b *ActionBuilder) ButtonCompFunc(v ComponentFunc) (r *ActionBuilder)

ButtonCompFunc defines the components of the button area.

func (*ActionBuilder) ComponentFunc

func (b *ActionBuilder) ComponentFunc(v ActionComponentFunc) (r *ActionBuilder)

ComponentFunc defines the components in dialog of button click.

func (*ActionBuilder) DialogWidth

func (b *ActionBuilder) DialogWidth(v string) (r *ActionBuilder)

func (*ActionBuilder) Label

func (b *ActionBuilder) Label(v string) (r *ActionBuilder)

func (*ActionBuilder) UpdateFunc

func (b *ActionBuilder) UpdateFunc(v ActionUpdateFunc) (r *ActionBuilder)

UpdateFunc defines event when the button is clicked.

type ActionComponentFunc

type ActionComponentFunc func(id string, ctx *web.EventContext) h.HTMLComponent

type ActionUpdateFunc

type ActionUpdateFunc func(id string, ctx *web.EventContext, r *web.EventResponse) (err error)

type AddListItemRowEvent

type AddListItemRowEvent struct {
	Event string
}

type AssetFunc

type AssetFunc func(ctx *web.EventContext)

type AutocompleteDataResult

type AutocompleteDataResult struct {
	Items   []OptionItem `json:"items"`
	Total   int          `json:"total"`
	Current int          `json:"current"`
	Pages   int          `json:"pages"`
}

type AutocompleteDataSourceConfig

type AutocompleteDataSourceConfig struct {
	OptionValue string
	OptionText  interface{} // func(interface{}) string or string
	OptionIcon  func(interface{}) string

	IsPaging bool

	KeywordColumns []string
	SQLConditions  []*SQLCondition
	OrderBy        string
	PerPage        int64
}

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func New

func New() *Builder

func (*Builder) AddMenuTopItemFunc

func (b *Builder) AddMenuTopItemFunc(key string, v ComponentFunc) (r *Builder)

func (*Builder) AddWrapHandler

func (b *Builder) AddWrapHandler(key string, f func(in http.Handler) (out http.Handler))

func (*Builder) AssetFunc

func (b *Builder) AssetFunc(v AssetFunc) (r *Builder)

func (*Builder) BrandFunc

func (b *Builder) BrandFunc(v ComponentFunc) (r *Builder)

func (*Builder) BrandProfileSwitchLanguageDisplayFuncFunc

func (b *Builder) BrandProfileSwitchLanguageDisplayFuncFunc(f func(brand, profile, switchLanguage h.HTMLComponent) h.HTMLComponent) (r *Builder)

func (*Builder) BrandTitle

func (b *Builder) BrandTitle(v string) (r *Builder)

func (*Builder) Build added in v3.0.1

func (b *Builder) Build()

func (*Builder) Builder

func (b *Builder) Builder(v *web.Builder) (r *Builder)

func (*Builder) ContainerClass added in v3.0.3

func (b *Builder) ContainerClass(name string) (r *Builder)

func (*Builder) DataOperator

func (b *Builder) DataOperator(v DataOperator) (r *Builder)

func (*Builder) DefaultNotFoundPageFunc

func (b *Builder) DefaultNotFoundPageFunc(ctx *web.EventContext) (r web.PageResponse, err error)

func (*Builder) DetailLayoutFunc

func (b *Builder) DetailLayoutFunc(v func(in web.PageFunc, cfg *LayoutConfig) (out web.PageFunc)) (r *Builder)

func (*Builder) ExtraAsset

func (b *Builder) ExtraAsset(path string, contentType string, body web.ComponentsPack, refTag ...string) (r *Builder)

func (*Builder) FieldDefaults

func (b *Builder) FieldDefaults(v FieldMode) (r *FieldDefaults)

func (*Builder) GetBrandTitle

func (b *Builder) GetBrandTitle() string

func (*Builder) GetDependencyCenter added in v3.0.2

func (b *Builder) GetDependencyCenter() *stateful.DependencyCenter

func (*Builder) GetDetailLayoutFunc

func (b *Builder) GetDetailLayoutFunc() func(in web.PageFunc, cfg *LayoutConfig) (out web.PageFunc)

func (*Builder) GetI18n added in v3.0.2

func (b *Builder) GetI18n() (r *i18n.Builder)

func (*Builder) GetLayoutFunc

func (b *Builder) GetLayoutFunc() func(in web.PageFunc, cfg *LayoutConfig) (out web.PageFunc)

func (*Builder) GetPermission

func (b *Builder) GetPermission() (r *perm.Builder)

func (*Builder) GetProfileFunc

func (b *Builder) GetProfileFunc() ComponentFunc

func (*Builder) GetProgressBarColor

func (b *Builder) GetProgressBarColor() string

func (*Builder) GetURIPrefix

func (b *Builder) GetURIPrefix() string

func (*Builder) GetVerifier added in v3.1.0

func (b *Builder) GetVerifier() (r *perm.Verifier)

func (*Builder) GetWebBuilder

func (b *Builder) GetWebBuilder() (r *web.Builder)

func (*Builder) HomePageFunc

func (b *Builder) HomePageFunc(v web.PageFunc) (r *Builder)

func (*Builder) HomePageLayoutConfig

func (b *Builder) HomePageLayoutConfig(v *LayoutConfig) (r *Builder)

func (*Builder) I18n

func (b *Builder) I18n(v *i18n.Builder) (r *Builder)

func (*Builder) InjectAssets

func (b *Builder) InjectAssets(ctx *web.EventContext)

func (*Builder) InjectExtraAssets

func (b *Builder) InjectExtraAssets(ctx *web.EventContext)

func (*Builder) LayoutFunc

func (b *Builder) LayoutFunc(v func(in web.PageFunc, cfg *LayoutConfig) (out web.PageFunc)) (r *Builder)

func (*Builder) Logger

func (b *Builder) Logger(v *zap.Logger) (r *Builder)

func (*Builder) LookUpModelBuilder added in v3.0.4

func (b *Builder) LookUpModelBuilder(uriName string) *ModelBuilder

func (*Builder) MenuGroup

func (b *Builder) MenuGroup(name string) *MenuGroupBuilder

func (*Builder) MenuOrder

func (b *Builder) MenuOrder(items ...interface{})

item can be Slug name, model name, *MenuGroupBuilder the underlying logic is using Slug name, so if the Slug name is customized, item must be the Slug name example: b.MenuOrder(

b.MenuGroup("Product Management").SubItems(
	"products",
	"Variant",
),
"customized-uri",

)

func (*Builder) MessagesFunc

func (b *Builder) MessagesFunc(v MessagesFunc) (r *Builder)

func (*Builder) Model

func (b *Builder) Model(v interface{}) (r *ModelBuilder)

func (*Builder) NewFieldsBuilder

func (b *Builder) NewFieldsBuilder(v FieldMode) (r *FieldsBuilder)

func (*Builder) NotFoundFunc

func (b *Builder) NotFoundFunc(v web.PageFunc) (r *Builder)

func (*Builder) NotFoundPageLayoutConfig

func (b *Builder) NotFoundPageLayoutConfig(v *LayoutConfig) (r *Builder)

func (*Builder) NotificationFunc

func (b *Builder) NotificationFunc(contentFunc ComponentFunc, countFunc func(ctx *web.EventContext) int) (r *Builder)

func (*Builder) Permission

func (b *Builder) Permission(v *perm.Builder) (r *Builder)

func (*Builder) PlainLayout

func (b *Builder) PlainLayout(in web.PageFunc) (out web.PageFunc)

for pages outside the default presets layout

func (*Builder) ProfileFunc

func (b *Builder) ProfileFunc(v ComponentFunc) (r *Builder)

func (*Builder) ProgressBarColor

func (b *Builder) ProgressBarColor(v string) (r *Builder)

func (*Builder) RightDrawerWidth

func (b *Builder) RightDrawerWidth(v string) (r *Builder)

func (*Builder) RunBrandFunc

func (b *Builder) RunBrandFunc(ctx *web.EventContext) (r h.HTMLComponent)

func (*Builder) RunBrandProfileSwitchLanguageDisplayFunc

func (b *Builder) RunBrandProfileSwitchLanguageDisplayFunc(brand, profile, switchLanguage h.HTMLComponent, ctx *web.EventContext) (r h.HTMLComponent)

func (*Builder) RunSwitchLanguageFunc

func (b *Builder) RunSwitchLanguageFunc(ctx *web.EventContext) (r h.HTMLComponent)

func (*Builder) ServeHTTP

func (b *Builder) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Builder) SwitchLanguageFunc

func (b *Builder) SwitchLanguageFunc(v ComponentFunc) (r *Builder)

func (*Builder) URIPrefix

func (b *Builder) URIPrefix(v string) (r *Builder)

func (*Builder) Use added in v3.0.1

func (b *Builder) Use(vs ...Plugin) (r *Builder)

func (*Builder) VuetifyOptions

func (b *Builder) VuetifyOptions(v string) (r *Builder)

func (*Builder) WrapNotFoundHandler added in v3.0.3

func (b *Builder) WrapNotFoundHandler(w func(in http.Handler) (out http.Handler))

type BulkActionBuilder

type BulkActionBuilder struct {
	NameLabel
	// contains filtered or unexported fields
}

func (*BulkActionBuilder) ButtonColor

func (b *BulkActionBuilder) ButtonColor(v string) (r *BulkActionBuilder)

func (*BulkActionBuilder) ButtonCompFunc

func (b *BulkActionBuilder) ButtonCompFunc(v ComponentFunc) (r *BulkActionBuilder)

func (*BulkActionBuilder) ComponentFunc

func (*BulkActionBuilder) DialogWidth

func (b *BulkActionBuilder) DialogWidth(v string) (r *BulkActionBuilder)

func (*BulkActionBuilder) Label

func (b *BulkActionBuilder) Label(v string) (r *BulkActionBuilder)

func (*BulkActionBuilder) SelectedIdsProcessorFunc

func (b *BulkActionBuilder) SelectedIdsProcessorFunc(v BulkActionSelectedIdsProcessorFunc) (r *BulkActionBuilder)

func (*BulkActionBuilder) SelectedIdsProcessorNoticeFunc

func (b *BulkActionBuilder) SelectedIdsProcessorNoticeFunc(v BulkActionSelectedIdsProcessorNoticeFunc) (r *BulkActionBuilder)

func (*BulkActionBuilder) UpdateFunc

type BulkActionComponentFunc

type BulkActionComponentFunc func(selectedIds []string, ctx *web.EventContext) h.HTMLComponent

type BulkActionSelectedIdsProcessorFunc

type BulkActionSelectedIdsProcessorFunc func(selectedIds []string, ctx *web.EventContext) (processedSelectedIds []string, err error)

type BulkActionSelectedIdsProcessorNoticeFunc

type BulkActionSelectedIdsProcessorNoticeFunc func(selectedIds []string, processedSelectedIds []string, unactionableIds []string) string

type BulkActionUpdateFunc

type BulkActionUpdateFunc func(selectedIds []string, ctx *web.EventContext, r *web.EventResponse) (err error)

type CellProcessor added in v3.0.3

type CellProcessor func(evCtx *web.EventContext, cell h.MutableAttrHTMLComponent, id string, obj any) (h.MutableAttrHTMLComponent, error)

type ColOrderBy

type ColOrderBy struct {
	FieldName string
	OrderBy   string
}

type Column added in v3.0.2

type Column struct {
	*DisplayColumn
	Label      string                                                                                                        `json:"label"`
	WrapHeader func(evCtx *web.EventContext, col *Column, th h.MutableAttrHTMLComponent) (h.MutableAttrHTMLComponent, error) `json:"-"`
}

type ColumnsProcessor added in v3.0.2

type ColumnsProcessor func(evCtx *web.EventContext, columns []*Column) ([]*Column, error)

type ComponentFunc

type ComponentFunc func(ctx *web.EventContext) h.HTMLComponent

type DataOperator

type DataOperator interface {
	Search(ctx *web.EventContext, params *SearchParams) (result *SearchResult, err error)
	// return ErrRecordNotFound if record not found
	Fetch(obj interface{}, id string, ctx *web.EventContext) (r interface{}, err error)
	Save(obj interface{}, id string, ctx *web.EventContext) (err error)
	Delete(obj interface{}, id string, ctx *web.EventContext) (err error)
}

type DeleteFunc

type DeleteFunc func(obj interface{}, id string, ctx *web.EventContext) (err error)

type DetailingBuilder

type DetailingBuilder struct {
	FieldsBuilder
	// contains filtered or unexported fields
}

func (*DetailingBuilder) Action

func (b *DetailingBuilder) Action(name string) (r *ActionBuilder)

func (*DetailingBuilder) AfterTitleCompFunc added in v3.0.1

func (b *DetailingBuilder) AfterTitleCompFunc(v ObjectComponentFunc) (r *DetailingBuilder)

func (*DetailingBuilder) AppendTabsPanelFunc

func (b *DetailingBuilder) AppendTabsPanelFunc(v TabComponentFunc) (r *DetailingBuilder)

func (*DetailingBuilder) ContainerClass added in v3.0.3

func (b *DetailingBuilder) ContainerClass(layoutVal DetailingLayout) (r *DetailingBuilder)

let u easier to adjust the detailing page by each project

func (*DetailingBuilder) Drawer

func (b *DetailingBuilder) Drawer(v bool) (r *DetailingBuilder)

func (*DetailingBuilder) EnableRefreshOnUpdate added in v3.0.2

func (b *DetailingBuilder) EnableRefreshOnUpdate() *DetailingBuilder

func (*DetailingBuilder) Except

func (b *DetailingBuilder) Except(vs ...string) (r *DetailingBuilder)

func (*DetailingBuilder) FetchFunc

func (b *DetailingBuilder) FetchFunc(v FetchFunc) (r *DetailingBuilder)

func (*DetailingBuilder) GetDrawer added in v3.0.1

func (b *DetailingBuilder) GetDrawer() bool

func (*DetailingBuilder) GetFetchFunc

func (b *DetailingBuilder) GetFetchFunc() FetchFunc

func (*DetailingBuilder) GetPageFunc

func (b *DetailingBuilder) GetPageFunc() web.PageFunc

func (*DetailingBuilder) Only

func (b *DetailingBuilder) Only(vs ...interface{}) (r *DetailingBuilder)

string / []string / *FieldsSection

func (*DetailingBuilder) PageFunc

func (b *DetailingBuilder) PageFunc(pf web.PageFunc) (r *DetailingBuilder)

func (*DetailingBuilder) Prepend added in v3.0.1

func (b *DetailingBuilder) Prepend(vs ...interface{}) (r *DetailingBuilder)

func (*DetailingBuilder) Section added in v3.1.1

func (b *DetailingBuilder) Section(sections ...*SectionBuilder) *DetailingBuilder

func (*DetailingBuilder) SidePanelFunc added in v3.0.1

func (b *DetailingBuilder) SidePanelFunc(v ObjectComponentFunc) (r *DetailingBuilder)

func (*DetailingBuilder) TabsPanelFunc

func (b *DetailingBuilder) TabsPanelFunc() (r []TabComponentFunc)

func (*DetailingBuilder) TabsPanels added in v3.0.1

func (b *DetailingBuilder) TabsPanels(vs ...TabComponentFunc) (r *DetailingBuilder)

func (*DetailingBuilder) Title added in v3.0.2

func (b *DetailingBuilder) Title(f func(evCtx *web.EventContext, obj any, style DetailingStyle, defaultTitle string) (title string, titleCompo h.HTMLComponent, err error)) (r *DetailingBuilder)

The title must not return empty, and titleCompo can return nil

func (*DetailingBuilder) WrapFetchFunc added in v3.0.1

func (b *DetailingBuilder) WrapFetchFunc(w func(in FetchFunc) FetchFunc) (r *DetailingBuilder)

func (*DetailingBuilder) WrapIdCurrentActive added in v3.0.4

type DetailingLayout added in v3.0.3

type DetailingLayout string
const (
	LayoutCenter DetailingLayout = "layout-center"
)

type DetailingStyle added in v3.0.2

type DetailingStyle string
const (
	DetailingStylePage   DetailingStyle = "Page"
	DetailingStyleDrawer DetailingStyle = "Drawer"
	DetailingStyleDialog DetailingStyle = "Dialog"
)

type DisplayColumn added in v3.0.2

type DisplayColumn struct {
	Name    string `json:"name"`
	Visible bool   `json:"visible"`
}

type DisplayFieldInSorter

type DisplayFieldInSorter struct {
	Field string
}

type DoActionRequest added in v3.0.2

type DoActionRequest struct {
	Name string `json:"name"`
}

type DoBulkActionRequest added in v3.0.2

type DoBulkActionRequest struct {
	Name string `json:"name"`
}

type EditingBuilder

type EditingBuilder struct {
	Fetcher   FetchFunc
	Setter    SetterFunc
	Saver     SaveFunc
	Deleter   DeleteFunc
	Validator ValidateFunc

	FieldsBuilder
	// contains filtered or unexported fields
}

func (*EditingBuilder) ActionsFunc

func (b *EditingBuilder) ActionsFunc(v ObjectComponentFunc) (r *EditingBuilder)

func (*EditingBuilder) AppendHiddenFunc

func (b *EditingBuilder) AppendHiddenFunc(v ObjectComponentFunc) (r *EditingBuilder)

func (*EditingBuilder) AppendTabsPanelFunc

func (b *EditingBuilder) AppendTabsPanelFunc(v TabComponentFunc) (r *EditingBuilder)

func (*EditingBuilder) Creating

func (b *EditingBuilder) Creating(vs ...interface{}) (r *EditingBuilder)

func (*EditingBuilder) DeleteFunc

func (b *EditingBuilder) DeleteFunc(v DeleteFunc) (r *EditingBuilder)

func (*EditingBuilder) EditingTitleFunc

func (b *EditingBuilder) EditingTitleFunc(v EditingTitleComponentFunc) (r *EditingBuilder)

func (*EditingBuilder) Except

func (b *EditingBuilder) Except(vs ...string) (r *EditingBuilder)

func (*EditingBuilder) FetchAndUnmarshal

func (b *EditingBuilder) FetchAndUnmarshal(id string, removeDeletedAndSort bool, ctx *web.EventContext) (obj interface{}, vErr web.ValidationErrors)

func (*EditingBuilder) FetchFunc

func (b *EditingBuilder) FetchFunc(v FetchFunc) (r *EditingBuilder)

func (*EditingBuilder) OnChangeActionFunc added in v3.0.1

func (b *EditingBuilder) OnChangeActionFunc(v OnChangeActionFunc) (r *EditingBuilder)

func (*EditingBuilder) Only

func (b *EditingBuilder) Only(vs ...interface{}) (r *EditingBuilder)

string / []string / *FieldsSection

func (*EditingBuilder) RunSetterFunc

func (b *EditingBuilder) RunSetterFunc(ctx *web.EventContext, removeDeletedAndSort bool, toObj interface{}) (vErr web.ValidationErrors)

func (*EditingBuilder) SaveFunc

func (b *EditingBuilder) SaveFunc(v SaveFunc) (r *EditingBuilder)

func (*EditingBuilder) SaveOverlayContent

func (b *EditingBuilder) SaveOverlayContent(
	ctx *web.EventContext,
	r *web.EventResponse,
) (err error)

func (*EditingBuilder) Section added in v3.1.1

func (b *EditingBuilder) Section(sections ...*SectionBuilder) *EditingBuilder

func (*EditingBuilder) SetterFunc

func (b *EditingBuilder) SetterFunc(v SetterFunc) (r *EditingBuilder)

func (*EditingBuilder) SidePanelFunc

func (b *EditingBuilder) SidePanelFunc(v ObjectComponentFunc) (r *EditingBuilder)

func (*EditingBuilder) TabsPanels added in v3.0.1

func (b *EditingBuilder) TabsPanels(vs ...TabComponentFunc) (r *EditingBuilder)

func (*EditingBuilder) UpdateOverlayContent

func (b *EditingBuilder) UpdateOverlayContent(
	ctx *web.EventContext,
	r *web.EventResponse,
	obj interface{},
	successMessage string,
	err error,
)

func (*EditingBuilder) ValidateFunc

func (b *EditingBuilder) ValidateFunc(v ValidateFunc) (r *EditingBuilder)

func (*EditingBuilder) WrapDeleteFunc added in v3.0.1

func (b *EditingBuilder) WrapDeleteFunc(w func(in DeleteFunc) DeleteFunc) (r *EditingBuilder)

func (*EditingBuilder) WrapFetchFunc added in v3.0.1

func (b *EditingBuilder) WrapFetchFunc(w func(in FetchFunc) FetchFunc) (r *EditingBuilder)

func (*EditingBuilder) WrapIdCurrentActive added in v3.0.4

func (b *EditingBuilder) WrapIdCurrentActive(w func(in IdCurrentActiveProcessor) IdCurrentActiveProcessor) (r *EditingBuilder)

func (*EditingBuilder) WrapSaveFunc added in v3.0.1

func (b *EditingBuilder) WrapSaveFunc(w func(in SaveFunc) SaveFunc) (r *EditingBuilder)

func (*EditingBuilder) WrapSetterFunc added in v3.0.1

func (b *EditingBuilder) WrapSetterFunc(w func(in SetterFunc) SetterFunc) (r *EditingBuilder)

func (*EditingBuilder) WrapValidateFunc added in v3.0.1

func (b *EditingBuilder) WrapValidateFunc(w func(in ValidateFunc) ValidateFunc) (r *EditingBuilder)

type EditingTitleComponentFunc

type EditingTitleComponentFunc func(obj interface{}, defaultTitle string, ctx *web.EventContext) h.HTMLComponent

type EventFuncAddon added in v3.0.2

type EventFuncAddon func(ctx *web.EventContext, r *web.EventResponse) (err error)

type FetchFunc

type FetchFunc func(obj interface{}, id string, ctx *web.EventContext) (r interface{}, err error)

type FieldBuilder

type FieldBuilder struct {
	NameLabel
	// contains filtered or unexported fields
}

func (*FieldBuilder) AppendTabs added in v3.0.5

func (b *FieldBuilder) AppendTabs(fb *FieldBuilder) (r *FieldBuilder)

func (*FieldBuilder) Clone

func (b *FieldBuilder) Clone() (r *FieldBuilder)

func (*FieldBuilder) Component added in v3.1.1

func (b *FieldBuilder) Component(v FieldComponentInterface) (r *FieldBuilder)

func (*FieldBuilder) ComponentFunc

func (b *FieldBuilder) ComponentFunc(v FieldComponentFunc) (r *FieldBuilder)

func (*FieldBuilder) GetCompFunc added in v3.0.1

func (b *FieldBuilder) GetCompFunc() FieldComponentFunc

func (*FieldBuilder) GetComponent added in v3.1.1

func (b *FieldBuilder) GetComponent() FieldComponentInterface

func (*FieldBuilder) GetNestedFieldsBuilder added in v3.1.0

func (b *FieldBuilder) GetNestedFieldsBuilder() *FieldsBuilder

func (*FieldBuilder) Label

func (b *FieldBuilder) Label(v string) (r *FieldBuilder)

func (*FieldBuilder) LazyWrapComponentFunc added in v3.0.5

func (b *FieldBuilder) LazyWrapComponentFunc(w func(in FieldComponentFunc) FieldComponentFunc) (r *FieldBuilder)

func (*FieldBuilder) LazyWrapSetterFunc added in v3.0.5

func (b *FieldBuilder) LazyWrapSetterFunc(w func(in FieldSetterFunc) FieldSetterFunc) (r *FieldBuilder)

func (*FieldBuilder) Nested

func (b *FieldBuilder) Nested(fb *FieldsBuilder, cfgs ...NestedConfig) (r *FieldBuilder)

func (*FieldBuilder) SetterFunc

func (b *FieldBuilder) SetterFunc(v FieldSetterFunc) (r *FieldBuilder)

func (*FieldBuilder) Tab added in v3.0.5

func (b *FieldBuilder) Tab(fb *TabsFieldBuilder) (r *FieldBuilder)

func (*FieldBuilder) Use added in v3.0.2

func (fb *FieldBuilder) Use(vs ...FieldPlugin) (r *FieldBuilder)

func (*FieldBuilder) WithContextValue

func (b *FieldBuilder) WithContextValue(key interface{}, val interface{}) (r *FieldBuilder)

type FieldComponentFunc

type FieldComponentFunc func(obj interface{}, field *FieldContext, ctx *web.EventContext) h.HTMLComponent

func (FieldComponentFunc) FieldComponent added in v3.1.1

func (f FieldComponentFunc) FieldComponent(obj interface{}, field *FieldContext, ctx *web.EventContext) h.HTMLComponent

type FieldComponentInterface added in v3.1.1

type FieldComponentInterface interface {
	FieldComponent(obj interface{}, field *FieldContext, ctx *web.EventContext) h.HTMLComponent
}

type FieldContext

type FieldContext struct {
	Name                string
	FormKey             string
	Label               string
	Errors              []string
	ModelInfo           *ModelInfo
	NestedFieldsBuilder *FieldsBuilder
	Context             context.Context
	Disabled            bool
}

func (*FieldContext) ContextValue

func (fc *FieldContext) ContextValue(key interface{}) (r interface{})

func (*FieldContext) StringValue

func (fc *FieldContext) StringValue(obj interface{}) (r string)

func (*FieldContext) Value

func (fc *FieldContext) Value(obj interface{}) (r interface{})

type FieldDefaultBuilder

type FieldDefaultBuilder struct {
	// contains filtered or unexported fields
}

func NewFieldDefault

func NewFieldDefault(t reflect.Type) (r *FieldDefaultBuilder)

func (*FieldDefaultBuilder) ComponentFunc

func (*FieldDefaultBuilder) SetterFunc

type FieldDefaults

type FieldDefaults struct {
	// contains filtered or unexported fields
}

func NewFieldDefaults

func NewFieldDefaults(t FieldMode) (r *FieldDefaults)

func (*FieldDefaults) Exclude

func (b *FieldDefaults) Exclude(patterns ...string) (r *FieldDefaults)

func (*FieldDefaults) FieldType

func (b *FieldDefaults) FieldType(v interface{}) (r *FieldDefaultBuilder)

func (*FieldDefaults) InspectFields

func (b *FieldDefaults) InspectFields(val interface{}) (r *FieldsBuilder)

func (*FieldDefaults) String

func (b *FieldDefaults) String() string

type FieldInstallFunc added in v3.0.2

type FieldInstallFunc func(fb *FieldBuilder) error

type FieldMode

type FieldMode int
const (
	WRITE FieldMode = iota
	LIST
	DETAIL
)

type FieldPlugin added in v3.0.2

type FieldPlugin interface {
	FieldInstall(fb *FieldBuilder) error
}

type FieldSetterFunc

type FieldSetterFunc func(obj interface{}, field *FieldContext, ctx *web.EventContext) (err error)

type FieldsBuilder

type FieldsBuilder struct {
	// contains filtered or unexported fields
}

func NewFieldsBuilder

func NewFieldsBuilder() *FieldsBuilder

func (*FieldsBuilder) Clone

func (b *FieldsBuilder) Clone() (r *FieldsBuilder)

func (*FieldsBuilder) Defaults

func (b *FieldsBuilder) Defaults(v *FieldDefaults) (r *FieldsBuilder)

func (*FieldsBuilder) Except

func (b *FieldsBuilder) Except(patterns ...string) (r *FieldsBuilder)

func (*FieldsBuilder) Field

func (b *FieldsBuilder) Field(name string) (r *FieldBuilder)

func (*FieldsBuilder) FieldNames added in v3.0.1

func (b *FieldsBuilder) FieldNames() (r []any)

func (*FieldsBuilder) GetField

func (b *FieldsBuilder) GetField(name string) (r *FieldBuilder)

func (*FieldsBuilder) Labels

func (b *FieldsBuilder) Labels(vs ...string) (r *FieldsBuilder)

func (*FieldsBuilder) Model

func (b *FieldsBuilder) Model(v interface{}) (r *FieldsBuilder)

func (*FieldsBuilder) NewFieldWithName added in v3.0.5

func (b *FieldsBuilder) NewFieldWithName(name string) (r *FieldBuilder)

func (*FieldsBuilder) Only

func (b *FieldsBuilder) Only(vs ...interface{}) (r *FieldsBuilder)

func (*FieldsBuilder) Prepend added in v3.0.1

func (b *FieldsBuilder) Prepend(names ...any) (r *FieldsBuilder)

func (*FieldsBuilder) SetObjectFields

func (b *FieldsBuilder) SetObjectFields(fromObj interface{}, toObj interface{}, parent *FieldContext, removeDeletedAndSort bool, modifiedIndexes *ModifiedIndexesBuilder, ctx *web.EventContext) (vErr web.ValidationErrors)

func (*FieldsBuilder) String

func (b *FieldsBuilder) String() (r string)

func (*FieldsBuilder) ToComponent

func (b *FieldsBuilder) ToComponent(info *ModelInfo, obj interface{}, ctx *web.EventContext) h.HTMLComponent

func (*FieldsBuilder) ToComponentForEach

func (b *FieldsBuilder) ToComponentForEach(field *FieldContext, slice interface{}, ctx *web.EventContext, rowFunc RowFunc) h.HTMLComponent

func (*FieldsBuilder) Unmarshal

func (b *FieldsBuilder) Unmarshal(toObj interface{}, info *ModelInfo, removeDeletedAndSort bool, ctx *web.EventContext) (vErr web.ValidationErrors)

type FieldsSection

type FieldsSection struct {
	Title string
	Rows  [][]string
}

type FilterDataFunc

type FilterDataFunc func(ctx *web.EventContext) vuetifyx.FilterData

type FilterTab

type FilterTab struct {
	ID    string
	Label string
	// render AdvancedLabel if it is not nil
	AdvancedLabel h.HTMLComponent
	Query         url.Values
}

type FilterTabsFunc

type FilterTabsFunc func(ctx *web.EventContext) []*FilterTab

type FooterActionBuilder added in v3.0.1

type FooterActionBuilder struct {
	NameLabel
	// contains filtered or unexported fields
}

func (*FooterActionBuilder) ButtonCompFunc added in v3.0.1

func (b *FooterActionBuilder) ButtonCompFunc(v ComponentFunc) (r *FooterActionBuilder)

type IdCurrentActiveProcessor added in v3.0.4

type IdCurrentActiveProcessor func(ctx *web.EventContext, current string) (string, error)

type InstallFunc added in v3.0.1

type InstallFunc func(pb *Builder) error

type LayoutConfig

type LayoutConfig struct {
	NotificationCenterInvisible bool
}

type ListEditorBuilder

type ListEditorBuilder struct {
	// contains filtered or unexported fields
}

func NewListEditor

func NewListEditor(v *FieldContext) *ListEditorBuilder

func (*ListEditorBuilder) AddListItemRowEvnet

func (b *ListEditorBuilder) AddListItemRowEvnet(v string) (r *ListEditorBuilder)

func (*ListEditorBuilder) DisplayFieldInSorter

func (b *ListEditorBuilder) DisplayFieldInSorter(v string) (r *ListEditorBuilder)

func (*ListEditorBuilder) MarshalHTML

func (b *ListEditorBuilder) MarshalHTML(c context.Context) (r []byte, err error)

func (*ListEditorBuilder) RemoveListItemRowEvent

func (b *ListEditorBuilder) RemoveListItemRowEvent(v string) (r *ListEditorBuilder)

func (*ListEditorBuilder) SortListItemsEvent

func (b *ListEditorBuilder) SortListItemsEvent(v string) (r *ListEditorBuilder)

func (*ListEditorBuilder) Value

func (b *ListEditorBuilder) Value(v interface{}) (r *ListEditorBuilder)

type ListSorter

type ListSorter struct {
	Items []ListSorterItem `json:"items"`
}

type ListSorterItem

type ListSorterItem struct {
	Index int    `json:"index"`
	Label string `json:"label"`
}

type ListingBuilder

type ListingBuilder struct {
	Searcher SearchFunc

	FieldsBuilder
	// contains filtered or unexported fields
}

func (*ListingBuilder) Action

func (b *ListingBuilder) Action(name string) (r *ActionBuilder)

func (*ListingBuilder) ActionsAsMenu

func (b *ListingBuilder) ActionsAsMenu(v bool) (r *ListingBuilder)

func (*ListingBuilder) BulkAction

func (b *ListingBuilder) BulkAction(name string) (r *BulkActionBuilder)

func (*ListingBuilder) CellWrapperFunc

func (b *ListingBuilder) CellWrapperFunc(cwf vx.CellWrapperFunc) (r *ListingBuilder)

CellWrapperFunc Deprecated: Use WrapCell instead.

func (*ListingBuilder) Conditions

func (b *ListingBuilder) Conditions(v []*SQLCondition) (r *ListingBuilder)

func (*ListingBuilder) DefaultOrderBys added in v3.0.6

func (b *ListingBuilder) DefaultOrderBys(v ...relay.OrderBy) (r *ListingBuilder)

func (*ListingBuilder) DialogHeight

func (b *ListingBuilder) DialogHeight(v string) (r *ListingBuilder)

func (*ListingBuilder) DialogWidth

func (b *ListingBuilder) DialogWidth(v string) (r *ListingBuilder)

func (*ListingBuilder) DisableModelListeners added in v3.0.2

func (b *ListingBuilder) DisableModelListeners(v bool) (r *ListingBuilder)

func (*ListingBuilder) DisablePagination

func (b *ListingBuilder) DisablePagination(v bool) (r *ListingBuilder)

func (*ListingBuilder) Except

func (b *ListingBuilder) Except(vs ...string) (r *ListingBuilder)

func (*ListingBuilder) FilterDataFunc

func (b *ListingBuilder) FilterDataFunc(v FilterDataFunc)

func (*ListingBuilder) FilterTabsFunc

func (b *ListingBuilder) FilterTabsFunc(v FilterTabsFunc)

func (*ListingBuilder) FooterAction added in v3.0.1

func (b *ListingBuilder) FooterAction(name string) (r *FooterActionBuilder)

func (*ListingBuilder) GetPageFunc

func (b *ListingBuilder) GetPageFunc() web.PageFunc

func (*ListingBuilder) KeywordSearchOff added in v3.0.2

func (b *ListingBuilder) KeywordSearchOff(v bool) (r *ListingBuilder)

func (*ListingBuilder) NewButtonFunc

func (b *ListingBuilder) NewButtonFunc(v ComponentFunc) (r *ListingBuilder)

func (*ListingBuilder) Only

func (b *ListingBuilder) Only(vs ...string) (r *ListingBuilder)

func (*ListingBuilder) OrderableFields

func (b *ListingBuilder) OrderableFields(v []*OrderableField) (r *ListingBuilder)

func (*ListingBuilder) PageFunc

func (b *ListingBuilder) PageFunc(pf web.PageFunc) (r *ListingBuilder)

func (*ListingBuilder) PerPage

func (b *ListingBuilder) PerPage(v int64) (r *ListingBuilder)

func (*ListingBuilder) RelayPagination added in v3.0.6

func (b *ListingBuilder) RelayPagination(v RelayPagination) (r *ListingBuilder)

func (*ListingBuilder) RowMenu

func (b *ListingBuilder) RowMenu(listings ...string) *RowMenuBuilder

func (*ListingBuilder) SearchColumns

func (b *ListingBuilder) SearchColumns(vs ...string) (r *ListingBuilder)

func (*ListingBuilder) SearchFunc

func (b *ListingBuilder) SearchFunc(v SearchFunc) (r *ListingBuilder)

func (*ListingBuilder) SelectableColumns

func (b *ListingBuilder) SelectableColumns(v bool) (r *ListingBuilder)

func (*ListingBuilder) Title

func (b *ListingBuilder) Title(f func(evCtx *web.EventContext, style ListingStyle, defaultTitle string) (title string, titleCompo h.HTMLComponent, err error)) (r *ListingBuilder)

Title The title must not return empty, and titleCompo can return nil

func (*ListingBuilder) WrapCell added in v3.0.3

func (b *ListingBuilder) WrapCell(w func(in CellProcessor) CellProcessor) (r *ListingBuilder)

func (*ListingBuilder) WrapColumns added in v3.0.2

func (b *ListingBuilder) WrapColumns(w func(in ColumnsProcessor) ColumnsProcessor) (r *ListingBuilder)

func (*ListingBuilder) WrapRow added in v3.0.4

func (b *ListingBuilder) WrapRow(w func(in RowProcessor) RowProcessor) (r *ListingBuilder)

func (*ListingBuilder) WrapSearchFunc added in v3.0.1

func (b *ListingBuilder) WrapSearchFunc(w func(in SearchFunc) SearchFunc) (r *ListingBuilder)

func (*ListingBuilder) WrapTable added in v3.0.5

func (b *ListingBuilder) WrapTable(w func(in TableProcessor) TableProcessor) (r *ListingBuilder)

type ListingCompo added in v3.0.2

type ListingCompo struct {
	ID                 string           `json:"id"`
	Popup              bool             `json:"popup"`
	LongStyleSearchBox bool             `json:"long_style_search_box"`
	SelectedIds        []string         `json:"selected_ids" query:",omitempty"`
	Keyword            string           `json:"keyword" query:",omitempty"`
	OrderBys           []ColOrderBy     `json:"order_bys" query:",omitempty"`
	After              *string          `json:"after" query:",omitempty"`
	Before             *string          `json:"before" query:",omitempty"`
	Page               int64            `json:"page" query:",omitempty"`
	PerPage            int64            `json:"per_page" query:",omitempty;cookie"`
	DisplayColumns     []*DisplayColumn `json:"display_columns" query:",omitempty;cookie"`
	ActiveFilterTab    string           `json:"active_filter_tab" query:",omitempty"`
	FilterQuery        string           `json:"filter_query" query:";method:bare,f_"`

	OnMounted string `json:"on_mounted"`
	ParentID  string `json:"parent_id,omitempty"`
	// contains filtered or unexported fields
}

func ListingCompoFromContext added in v3.0.2

func ListingCompoFromContext(ctx context.Context) *ListingCompo

func ListingCompoFromEventContext added in v3.0.2

func ListingCompoFromEventContext(evCtx *web.EventContext) *ListingCompo

func (*ListingCompo) ActionsComponentTeleportToID added in v3.0.2

func (c *ListingCompo) ActionsComponentTeleportToID() string

func (*ListingCompo) CompoID added in v3.0.2

func (c *ListingCompo) CompoID() string

func (*ListingCompo) DoAction added in v3.0.2

func (c *ListingCompo) DoAction(ctx context.Context, req DoActionRequest) (r web.EventResponse, err error)

func (*ListingCompo) DoBulkAction added in v3.0.2

func (c *ListingCompo) DoBulkAction(ctx context.Context, req DoBulkActionRequest) (r web.EventResponse, err error)

func (*ListingCompo) MarshalHTML added in v3.0.2

func (c *ListingCompo) MarshalHTML(ctx context.Context) (r []byte, err error)

func (*ListingCompo) MustGetEventContext added in v3.0.2

func (c *ListingCompo) MustGetEventContext(ctx context.Context) (*web.EventContext, *Messages)

func (*ListingCompo) OpenActionDialog added in v3.0.2

func (c *ListingCompo) OpenActionDialog(ctx context.Context, req OpenBulkActionDialogRequest) (r web.EventResponse, err error)

func (*ListingCompo) OpenBulkActionDialog added in v3.0.2

func (c *ListingCompo) OpenBulkActionDialog(ctx context.Context, req OpenBulkActionDialogRequest) (r web.EventResponse, err error)

func (*ListingCompo) VarCurrentActive added in v3.0.4

func (c *ListingCompo) VarCurrentActive() string

type ListingStyle added in v3.0.2

type ListingStyle string
const (
	ListingStylePage   ListingStyle = "Page"
	ListingStyleDialog ListingStyle = "Dialog"
	ListingStyleNested ListingStyle = "Nested"
)
type MenuGroupBuilder struct {
	// contains filtered or unexported fields
}
func (b *MenuGroupBuilder) Icon(v string) (r *MenuGroupBuilder)
func (b *MenuGroupBuilder) SubItems(ss ...string) (r *MenuGroupBuilder)
type MenuGroups struct {
	// contains filtered or unexported fields
}
func (g *MenuGroups) MenuGroup(name string) (r *MenuGroupBuilder)
type MenuOrderBuilder struct {
	// contains filtered or unexported fields
}
func (b *MenuOrderBuilder) Append(items ...interface{})
func (b *MenuOrderBuilder) CreateMenus(ctx *web.EventContext) h.HTMLComponent

type Messages

type Messages struct {
	DialogTitleDefault                         string
	SuccessfullyUpdated                        string
	SuccessfullyCreated                        string
	Search                                     string
	New                                        string
	Update                                     string
	Delete                                     string
	Edit                                       string
	FormTitle                                  string
	OK                                         string
	Cancel                                     string
	Clear                                      string
	Create                                     string
	DeleteConfirmationText                     string
	CreatingObjectTitleTemplate                string
	EditingObjectTitleTemplate                 string
	ListingObjectTitleTemplate                 string
	DetailingObjectTitleTemplate               string
	FiltersClear                               string
	FiltersAdd                                 string
	FilterApply                                string
	FilterByTemplate                           string
	FiltersDateInTheLast                       string
	FiltersDateEquals                          string
	FiltersDateBetween                         string
	FiltersDateIsAfter                         string
	FiltersDateIsAfterOrOn                     string
	FiltersDateIsBefore                        string
	FiltersDateIsBeforeOrOn                    string
	FiltersDateDays                            string
	FiltersDateMonths                          string
	FiltersDateAnd                             string
	FiltersDateTo                              string
	FiltersDateClear                           string
	FiltersDateOK                              string
	FiltersNumberEquals                        string
	FiltersNumberBetween                       string
	FiltersNumberGreaterThan                   string
	FiltersNumberLessThan                      string
	FiltersNumberAnd                           string
	FiltersStringEquals                        string
	FiltersStringContains                      string
	FiltersMultipleSelectIn                    string
	FiltersMultipleSelectNotIn                 string
	PaginationRowsPerPage                      string
	ListingNoRecordToShow                      string
	ListingSelectedCountNotice                 string
	ListingClearSelection                      string
	BulkActionNoRecordsSelected                string
	BulkActionNoAvailableRecords               string
	BulkActionSelectedIdsProcessNoticeTemplate string
	ConfirmDialogTitleText                     string
	ConfirmDialogPromptText                    string
	Language                                   string
	Colon                                      string
	NotFoundPageNotice                         string
	ButtonLabelActionsMenu                     string
	Save                                       string
	AddRow                                     string
	CheckboxTrueLabel                          string
	CheckboxFalseLabel                         string

	HumanizeTimeAgo       string
	HumanizeTimeFromNow   string
	HumanizeTimeNow       string
	HumanizeTime1Second   string
	HumanizeTimeSeconds   string
	HumanizeTime1Minute   string
	HumanizeTimeMinutes   string
	HumanizeTime1Hour     string
	HumanizeTimeHours     string
	HumanizeTime1Day      string
	HumanizeTimeDays      string
	HumanizeTime1Week     string
	HumanizeTimeWeeks     string
	HumanizeTime1Month    string
	HumanizeTimeMonths    string
	HumanizeTime1Year     string
	HumanizeTime2Years    string
	HumanizeTimeYears     string
	HumanizeTimeLongWhile string

	LeaveBeforeUnsubmit string
}

func MustGetMessages

func MustGetMessages(r *http.Request) *Messages

func (*Messages) BulkActionSelectedIdsProcessNotice

func (msgr *Messages) BulkActionSelectedIdsProcessNotice(ids string) string

func (*Messages) CreatingObjectTitle

func (msgr *Messages) CreatingObjectTitle(modelName string) string

func (*Messages) DetailingObjectTitle

func (msgr *Messages) DetailingObjectTitle(label string, name string) string

func (*Messages) EditingObjectTitle

func (msgr *Messages) EditingObjectTitle(label string, name string) string

func (*Messages) FilterBy

func (msgr *Messages) FilterBy(filter string) string

func (*Messages) HumanizeTime added in v3.0.3

func (msgr *Messages) HumanizeTime(then time.Time) string

func (*Messages) ListingObjectTitle

func (msgr *Messages) ListingObjectTitle(label string) string

type MessagesFunc

type MessagesFunc func(r *http.Request) *Messages

type ModelBuilder

type ModelBuilder struct {
	web.EventsHub
	// contains filtered or unexported fields
}

func NewModelBuilder

func NewModelBuilder(p *Builder, model interface{}) (mb *ModelBuilder)

func (*ModelBuilder) DefaultMenuItem added in v3.0.3

func (m *ModelBuilder) DefaultMenuItem(
	customizeChildren func(evCtx *web.EventContext, isSub bool, menuIcon string, children ...h.HTMLComponent) ([]h.HTMLComponent, error),
) func(evCtx *web.EventContext, isSub bool) (h.HTMLComponent, error)

func (*ModelBuilder) DefaultURLQueryFunc

func (mb *ModelBuilder) DefaultURLQueryFunc(v func(*http.Request) url.Values) (r *ModelBuilder)

func (*ModelBuilder) Detailing

func (mb *ModelBuilder) Detailing(vs ...interface{}) (r *DetailingBuilder)

string / []string / *FieldsSection

func (*ModelBuilder) Editing

func (mb *ModelBuilder) Editing(vs ...interface{}) (r *EditingBuilder)

string / []string / *FieldsSection

func (*ModelBuilder) GetPresetsBuilder added in v3.0.2

func (mb *ModelBuilder) GetPresetsBuilder() *Builder

func (*ModelBuilder) GetSingleton added in v3.0.1

func (mb *ModelBuilder) GetSingleton() bool

func (*ModelBuilder) HasDetailing added in v3.0.1

func (mb *ModelBuilder) HasDetailing() bool

func (*ModelBuilder) InMenu

func (mb *ModelBuilder) InMenu(v bool) (r *ModelBuilder)

func (*ModelBuilder) Info

func (mb *ModelBuilder) Info() (r *ModelInfo)

func (*ModelBuilder) Label

func (mb *ModelBuilder) Label(v string) (r *ModelBuilder)

func (*ModelBuilder) LabelName added in v3.0.2

func (mb *ModelBuilder) LabelName(f func(evCtx *web.EventContext, singular bool) string) *ModelBuilder

func (*ModelBuilder) Labels

func (mb *ModelBuilder) Labels(vs ...string) (r *ModelBuilder)

func (*ModelBuilder) LayoutConfig

func (mb *ModelBuilder) LayoutConfig(v *LayoutConfig) (r *ModelBuilder)
func (mb *ModelBuilder) Link(v string) *ModelBuilder

func (*ModelBuilder) Listing

func (mb *ModelBuilder) Listing(vs ...string) (r *ListingBuilder)

func (*ModelBuilder) MenuIcon

func (mb *ModelBuilder) MenuIcon(v string) (r *ModelBuilder)

func (*ModelBuilder) MenuItem added in v3.0.3

func (mb *ModelBuilder) MenuItem(v func(evCtx *web.EventContext, isSub bool) (h.HTMLComponent, error)) (r *ModelBuilder)

func (*ModelBuilder) NestedMany added in v3.0.2

func (parent *ModelBuilder) NestedMany(elementModel any, foreignKey string) *NestedManyBuilder

func (*ModelBuilder) NewModel

func (mb *ModelBuilder) NewModel() (r interface{})

func (*ModelBuilder) NewModelSlice

func (mb *ModelBuilder) NewModelSlice() (r interface{})

func (*ModelBuilder) NotifModelsCreated added in v3.0.2

func (mb *ModelBuilder) NotifModelsCreated() string

func (*ModelBuilder) NotifModelsDeleted added in v3.0.2

func (mb *ModelBuilder) NotifModelsDeleted() string

func (*ModelBuilder) NotifModelsUpdated added in v3.0.2

func (mb *ModelBuilder) NotifModelsUpdated() string

func (*ModelBuilder) NotifRowUpdated added in v3.0.2

func (mb *ModelBuilder) NotifRowUpdated() string

func (*ModelBuilder) Placeholders

func (mb *ModelBuilder) Placeholders(vs ...string) (r *ModelBuilder)

func (*ModelBuilder) PrimaryField

func (mb *ModelBuilder) PrimaryField(v string) (r *ModelBuilder)

func (*ModelBuilder) RightDrawerWidth

func (mb *ModelBuilder) RightDrawerWidth(v string) *ModelBuilder

func (*ModelBuilder) Singleton

func (mb *ModelBuilder) Singleton(v bool) (r *ModelBuilder)

func (*ModelBuilder) URIName

func (mb *ModelBuilder) URIName(v string) (r *ModelBuilder)

func (*ModelBuilder) Use added in v3.0.1

func (mb *ModelBuilder) Use(vs ...ModelPlugin) (r *ModelBuilder)

func (*ModelBuilder) WrapVerifier added in v3.1.0

func (mb *ModelBuilder) WrapVerifier(w func(in func() *perm.Verifier) func() *perm.Verifier) *ModelBuilder

type ModelInfo

type ModelInfo struct {
	// contains filtered or unexported fields
}

func (ModelInfo) DetailingHref

func (b ModelInfo) DetailingHref(id string) string

func (ModelInfo) DetailingInDrawer

func (b ModelInfo) DetailingInDrawer() bool

func (ModelInfo) EditingHref

func (b ModelInfo) EditingHref(id string) string

func (ModelInfo) HasDetailing

func (b ModelInfo) HasDetailing() bool

func (ModelInfo) Label

func (b ModelInfo) Label() string

func (ModelInfo) LabelName added in v3.0.2

func (b ModelInfo) LabelName(evCtx *web.EventContext, singular bool) string

func (ModelInfo) ListingHref

func (b ModelInfo) ListingHref() string

func (ModelInfo) PresetsPrefix

func (b ModelInfo) PresetsPrefix() string

func (ModelInfo) URIName

func (b ModelInfo) URIName() string

func (ModelInfo) Verifier

func (b ModelInfo) Verifier() *perm.Verifier

type ModelInstallFunc added in v3.0.1

type ModelInstallFunc func(pb *Builder, mb *ModelBuilder) error

type ModelPlugin added in v3.0.1

type ModelPlugin interface {
	ModelInstall(pb *Builder, mb *ModelBuilder) (err error)
}

type ModifiedIndexesBuilder

type ModifiedIndexesBuilder struct {
	// contains filtered or unexported fields
}

func ContextModifiedIndexesBuilder

func ContextModifiedIndexesBuilder(ctx *web.EventContext) (r *ModifiedIndexesBuilder)

func (*ModifiedIndexesBuilder) AppendDeleted

func (b *ModifiedIndexesBuilder) AppendDeleted(sliceFormKey string, index int) (r *ModifiedIndexesBuilder)

func (*ModifiedIndexesBuilder) DeletedContains

func (b *ModifiedIndexesBuilder) DeletedContains(sliceFormKey string, index int) (r bool)

func (*ModifiedIndexesBuilder) FromHidden

func (b *ModifiedIndexesBuilder) FromHidden(req *http.Request) (r *ModifiedIndexesBuilder)

func (*ModifiedIndexesBuilder) ReversedModifiedIndexes added in v3.0.2

func (b *ModifiedIndexesBuilder) ReversedModifiedIndexes(sliceFormKey string) (r []int)

func (*ModifiedIndexesBuilder) Sorted added in v3.0.2

func (b *ModifiedIndexesBuilder) Sorted(sliceFormKey string, indexes []string) (r *ModifiedIndexesBuilder)

func (*ModifiedIndexesBuilder) SortedForEach

func (b *ModifiedIndexesBuilder) SortedForEach(slice interface{}, sliceFormKey string, f func(obj interface{}, i int))

func (*ModifiedIndexesBuilder) ToFormHidden

func (b *ModifiedIndexesBuilder) ToFormHidden() h.HTMLComponent

type NameLabel

type NameLabel struct {
	// contains filtered or unexported fields
}

type NestedConfig

type NestedConfig interface {
	// contains filtered or unexported methods
}

type NestedManyBuilder added in v3.0.2

type NestedManyBuilder struct {
	*ModelBuilder
	// contains filtered or unexported fields
}

func (*NestedManyBuilder) FieldInstall added in v3.0.2

func (mb *NestedManyBuilder) FieldInstall(fb *FieldBuilder) error

func (*NestedManyBuilder) InitialListingCompoProcessor added in v3.0.2

func (mb *NestedManyBuilder) InitialListingCompoProcessor(f func(evCtx *web.EventContext, lb *ListingBuilder, compo *ListingCompo) error) *NestedManyBuilder

type ObjectBoolFunc added in v3.0.1

type ObjectBoolFunc func(obj interface{}, ctx *web.EventContext) bool

type ObjectComponentFunc

type ObjectComponentFunc func(obj interface{}, ctx *web.EventContext) h.HTMLComponent

type OnChangeActionFunc added in v3.0.1

type OnChangeActionFunc func(id string, ctx *web.EventContext) (s string)

type OpenActionDialogRequest added in v3.0.2

type OpenActionDialogRequest struct {
	Name string `json:"name"`
}

type OpenBulkActionDialogRequest added in v3.0.2

type OpenBulkActionDialogRequest struct {
	Name string `json:"name"`
}

type OptionItem

type OptionItem struct {
	Text  string `json:"text,omitempty"`
	Value string `json:"value,omitempty"`
	Icon  string `json:"icon,omitempty"`
}

type OrderableField

type OrderableField struct {
	FieldName string
	DBColumn  string
}

type PayloadModelsCreated added in v3.0.2

type PayloadModelsCreated struct {
	Models []any `json:"models"`
}

type PayloadModelsDeleted added in v3.0.2

type PayloadModelsDeleted struct {
	Ids []string `json:"ids"`
}

type PayloadModelsUpdated added in v3.0.2

type PayloadModelsUpdated struct {
	Ids    []string       `json:"ids"`
	Models map[string]any `json:"models"`
}

type PayloadRowUpdated added in v3.0.2

type PayloadRowUpdated struct {
	Id string `json:"id"`
}

type Plugin added in v3.0.1

type Plugin interface {
	Install(pb *Builder) (err error)
}

type RelayPagination added in v3.0.6

type RelayPagination func(ctx *web.EventContext) (relay.Pagination[any], error)

type RemoveListItemRowEvent

type RemoveListItemRowEvent struct {
	Event string
}

type RowFunc

type RowFunc func(obj interface{}, formKey string, content h.HTMLComponent, ctx *web.EventContext) h.HTMLComponent

type RowMenuBuilder

type RowMenuBuilder struct {
	// contains filtered or unexported fields
}

func (*RowMenuBuilder) Empty

func (b *RowMenuBuilder) Empty()

func (*RowMenuBuilder) RowMenuItem

func (b *RowMenuBuilder) RowMenuItem(name string) *RowMenuItemBuilder

type RowMenuItemBuilder

type RowMenuItemBuilder struct {
	// contains filtered or unexported fields
}

func (*RowMenuItemBuilder) ComponentFunc

func (*RowMenuItemBuilder) Icon

func (*RowMenuItemBuilder) OnClick

func (*RowMenuItemBuilder) PermAction

func (b *RowMenuItemBuilder) PermAction(v string) *RowMenuItemBuilder

type RowMenuItemClickFunc

type RowMenuItemClickFunc func(ctx *web.EventContext, id string) (r web.EventResponse, err error)

type RowProcessor added in v3.0.4

type RowProcessor func(evCtx *web.EventContext, row h.MutableAttrHTMLComponent, id string, obj any) (h.MutableAttrHTMLComponent, error)

type SQLCondition

type SQLCondition struct {
	Query string
	Args  []interface{}
}

type SaveFunc

type SaveFunc func(obj interface{}, id string, ctx *web.EventContext) (err error)

type SearchFunc

type SearchFunc func(ctx *web.EventContext, params *SearchParams) (result *SearchResult, err error)

type SearchParams

type SearchParams struct {
	Model   any
	PageURL *url.URL

	KeywordColumns []string
	Keyword        string
	SQLConditions  []*SQLCondition

	Page     int64
	PerPage  int64
	OrderBys []relay.OrderBy

	// Both must exist simultaneously, and when they do, Page, PerPage, and OrderBys will be ignored
	// Or you can use the default pagination
	RelayPaginateRequest *relay.PaginateRequest[any]
	RelayPagination      RelayPagination
}

type SearchResult added in v3.0.6

type SearchResult struct {
	PageInfo   relay.PageInfo
	TotalCount *int
	Nodes      interface{}
}

type SectionBuilder added in v3.0.1

type SectionBuilder struct {
	NameLabel
	// contains filtered or unexported fields
}

SectionBuilder is a builder for a section in the detail page. save: fetcher => setter => saver show, edit: fetcher => setter

func NewSectionBuilder added in v3.1.1

func NewSectionBuilder(mb *ModelBuilder, name string) (r *SectionBuilder)

func (*SectionBuilder) AlwaysShowListLabel added in v3.0.1

func (b *SectionBuilder) AlwaysShowListLabel() *SectionBuilder

func (*SectionBuilder) Clone added in v3.1.1

func (s *SectionBuilder) Clone() *SectionBuilder

func (*SectionBuilder) ComponentEditBtnFunc added in v3.0.1

func (b *SectionBuilder) ComponentEditBtnFunc(v ObjectBoolFunc) *SectionBuilder

func (*SectionBuilder) ComponentFunc added in v3.0.1

func (b *SectionBuilder) ComponentFunc(v FieldComponentFunc) *SectionBuilder

ComponentFunc set FieldBuilder compFunc

func (*SectionBuilder) ComponentHoverFunc added in v3.0.1

func (b *SectionBuilder) ComponentHoverFunc(v ObjectBoolFunc) *SectionBuilder

func (*SectionBuilder) CreateDetailListField added in v3.1.1

func (b *SectionBuilder) CreateDetailListField(ctx *web.EventContext) (r web.EventResponse, err error)

CreateDetailListField Event: click detail list field element Add row button

func (*SectionBuilder) DefaultElementUnmarshal added in v3.0.1

func (b *SectionBuilder) DefaultElementUnmarshal() func(toObj, formObj any, prefix string, ctx *web.EventContext) error

func (*SectionBuilder) DefaultListUnmarshalFunc added in v3.0.5

func (b *SectionBuilder) DefaultListUnmarshalFunc(ctx *web.EventContext, obj interface{}) (err error)

func (*SectionBuilder) DefaultUnmarshalFunc added in v3.0.5

func (b *SectionBuilder) DefaultUnmarshalFunc(ctx *web.EventContext, obj interface{}) (err error)

func (*SectionBuilder) DeleteBtnKey added in v3.0.1

func (b *SectionBuilder) DeleteBtnKey() string

func (*SectionBuilder) DeleteDetailListField added in v3.1.1

func (b *SectionBuilder) DeleteDetailListField(ctx *web.EventContext) (r web.EventResponse, err error)

DeleteDetailListField Event: click detail list field element Delete button

func (*SectionBuilder) DisableElementCreateBtn added in v3.0.1

func (b *SectionBuilder) DisableElementCreateBtn() *SectionBuilder

func (*SectionBuilder) DisableElementDeleteBtn added in v3.0.1

func (b *SectionBuilder) DisableElementDeleteBtn() *SectionBuilder

func (*SectionBuilder) DisableLabel added in v3.0.2

func (b *SectionBuilder) DisableLabel() (r *SectionBuilder)

func (*SectionBuilder) EditBtnKey added in v3.0.1

func (b *SectionBuilder) EditBtnKey() string

func (*SectionBuilder) EditComponentFunc added in v3.0.1

func (b *SectionBuilder) EditComponentFunc(v FieldComponentFunc) (r *SectionBuilder)

func (*SectionBuilder) EditDetailField added in v3.1.1

func (b *SectionBuilder) EditDetailField(ctx *web.EventContext) (r web.EventResponse, err error)

EditDetailField EventFunc: click detail field component edit button

func (*SectionBuilder) EditDetailListField added in v3.1.1

func (b *SectionBuilder) EditDetailListField(ctx *web.EventContext) (r web.EventResponse, err error)

EditDetailListField Event: click detail list field element edit button

func (*SectionBuilder) Editing added in v3.0.1

func (b *SectionBuilder) Editing(fields ...interface{}) (r *SectionBuilder)

Editing default saver only save these field

func (*SectionBuilder) EditingField added in v3.0.1

func (b *SectionBuilder) EditingField(name string) (r *FieldBuilder)

func (*SectionBuilder) ElementEditBtnFunc added in v3.0.1

func (b *SectionBuilder) ElementEditBtnFunc(v ObjectBoolFunc) *SectionBuilder

func (*SectionBuilder) ElementEditComponentFunc added in v3.0.1

func (b *SectionBuilder) ElementEditComponentFunc(v FieldComponentFunc) (r *SectionBuilder)

func (*SectionBuilder) ElementHoverFunc added in v3.0.1

func (b *SectionBuilder) ElementHoverFunc(v ObjectBoolFunc) *SectionBuilder

func (*SectionBuilder) ElementShowComponentFunc added in v3.0.1

func (b *SectionBuilder) ElementShowComponentFunc(v FieldComponentFunc) (r *SectionBuilder)

func (*SectionBuilder) ElementUnmarshalFunc added in v3.0.1

func (b *SectionBuilder) ElementUnmarshalFunc(v func(toObj, formObj any, prefix string, ctx *web.EventContext) error) (r *SectionBuilder)

func (*SectionBuilder) EventCreate added in v3.1.1

func (b *SectionBuilder) EventCreate() string

func (*SectionBuilder) EventDelete added in v3.1.1

func (b *SectionBuilder) EventDelete() string

func (*SectionBuilder) EventEdit added in v3.1.1

func (b *SectionBuilder) EventEdit() string

func (*SectionBuilder) EventSave added in v3.1.1

func (b *SectionBuilder) EventSave() string

func (*SectionBuilder) FieldComponent added in v3.1.1

func (b *SectionBuilder) FieldComponent(obj interface{}, field *FieldContext, ctx *web.EventContext) h.HTMLComponent

func (*SectionBuilder) FieldPortalName added in v3.0.1

func (b *SectionBuilder) FieldPortalName() string

func (*SectionBuilder) HiddenFuncs added in v3.0.1

func (b *SectionBuilder) HiddenFuncs(funcs ...ObjectComponentFunc) (r *SectionBuilder)

func (*SectionBuilder) IsList added in v3.0.1

func (b *SectionBuilder) IsList(v interface{}) (r *SectionBuilder)

func (*SectionBuilder) Label added in v3.0.1

func (b *SectionBuilder) Label(label string) (r *SectionBuilder)

func (*SectionBuilder) ListElementIsEditing added in v3.0.1

func (b *SectionBuilder) ListElementIsEditing(index int) string

func (*SectionBuilder) ListElementPortalName added in v3.0.1

func (b *SectionBuilder) ListElementPortalName(index int) string

func (*SectionBuilder) ListFieldPrefix added in v3.0.1

func (b *SectionBuilder) ListFieldPrefix(index int) string

func (*SectionBuilder) SaveBtnKey added in v3.0.1

func (b *SectionBuilder) SaveBtnKey() string

func (*SectionBuilder) SaveDetailField added in v3.1.1

func (b *SectionBuilder) SaveDetailField(ctx *web.EventContext) (r web.EventResponse, err error)

SaveDetailField EventFunc: click save button

func (*SectionBuilder) SaveDetailListField added in v3.1.1

func (b *SectionBuilder) SaveDetailListField(ctx *web.EventContext) (r web.EventResponse, err error)

SaveDetailListField Event: click detail list field element Save button

func (*SectionBuilder) SaveFunc added in v3.0.1

func (b *SectionBuilder) SaveFunc(v SaveFunc) (r *SectionBuilder)

func (*SectionBuilder) SetterFunc added in v3.0.1

func (b *SectionBuilder) SetterFunc(v SetterFunc) (r *SectionBuilder)

func (*SectionBuilder) UnmarshalFunc added in v3.0.5

func (b *SectionBuilder) UnmarshalFunc(v func(ctx *web.EventContext, obj interface{}) error) (r *SectionBuilder)

func (*SectionBuilder) ViewComponentFunc added in v3.0.1

func (b *SectionBuilder) ViewComponentFunc(v FieldComponentFunc) (r *SectionBuilder)

func (*SectionBuilder) Viewing added in v3.0.1

func (b *SectionBuilder) Viewing(fields ...interface{}) (r *SectionBuilder)

func (*SectionBuilder) ViewingField added in v3.0.1

func (b *SectionBuilder) ViewingField(name string) (r *FieldBuilder)

func (*SectionBuilder) WrapComponentEditBtnFunc added in v3.0.1

func (b *SectionBuilder) WrapComponentEditBtnFunc(w func(in ObjectBoolFunc) ObjectBoolFunc) (r *SectionBuilder)

func (*SectionBuilder) WrapComponentHoverFunc added in v3.0.1

func (b *SectionBuilder) WrapComponentHoverFunc(w func(in ObjectBoolFunc) ObjectBoolFunc) (r *SectionBuilder)

func (*SectionBuilder) WrapElementEditBtnFunc added in v3.0.2

func (b *SectionBuilder) WrapElementEditBtnFunc(w func(in ObjectBoolFunc) ObjectBoolFunc) (r *SectionBuilder)

func (*SectionBuilder) WrapElementHoverFunc added in v3.0.2

func (b *SectionBuilder) WrapElementHoverFunc(w func(in ObjectBoolFunc) ObjectBoolFunc) (r *SectionBuilder)

func (*SectionBuilder) WrapSaveBtnFunc added in v3.1.1

func (b *SectionBuilder) WrapSaveBtnFunc(w func(in ObjectBoolFunc) ObjectBoolFunc) (r *SectionBuilder)

func (*SectionBuilder) WrapSaveFunc added in v3.0.5

func (b *SectionBuilder) WrapSaveFunc(w func(in SaveFunc) SaveFunc) (r *SectionBuilder)

func (*SectionBuilder) WrapSetterFunc added in v3.0.4

func (b *SectionBuilder) WrapSetterFunc(w func(in SetterFunc) SetterFunc) (r *SectionBuilder)

func (*SectionBuilder) WrapValidateFunc added in v3.0.5

func (b *SectionBuilder) WrapValidateFunc(w func(in ValidateFunc) ValidateFunc) (r *SectionBuilder)

WrapValidateFunc only used in detailing

type SetterFunc

type SetterFunc func(obj interface{}, ctx *web.EventContext)

type SlugDecoder

type SlugDecoder interface {
	PrimaryColumnValuesBySlug(slug string) map[string]string
}

type SlugEncoder

type SlugEncoder interface {
	PrimarySlug() string
}

type SortListItemsEvent

type SortListItemsEvent struct {
	Event string
}

type TabComponentFunc

type TabComponentFunc func(obj interface{}, ctx *web.EventContext) (tab h.HTMLComponent, content h.HTMLComponent)

type TableProcessor added in v3.0.5

type TableProcessor func(evCtx *web.EventContext, table *vx.DataTableBuilder) (*vx.DataTableBuilder, error)

type TabsFieldBuilder added in v3.0.5

type TabsFieldBuilder struct {
	FieldBuilder
	// contains filtered or unexported fields
}

func NewTabsFieldBuilder added in v3.0.5

func NewTabsFieldBuilder() *TabsFieldBuilder

func (*TabsFieldBuilder) AppendTabField added in v3.0.5

func (tb *TabsFieldBuilder) AppendTabField(tabName, tabLabel string, comp FieldComponentFunc)

func (*TabsFieldBuilder) ComponentFunc added in v3.0.5

func (tb *TabsFieldBuilder) ComponentFunc() FieldComponentFunc

func (*TabsFieldBuilder) TabsOrderFunc added in v3.0.5

func (tb *TabsFieldBuilder) TabsOrderFunc(v func(obj interface{}, field *FieldContext, ctx *web.EventContext) []string) *TabsFieldBuilder

type ValidateFunc

type ValidateFunc func(obj interface{}, ctx *web.EventContext) (err web.ValidationErrors)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL