Generate functions for checkable-radio and checkable-checkbox
This commit is contained in:
parent
8d7fc2ecc9
commit
1ce5e8e8eb
1 changed files with 17 additions and 0 deletions
|
@ -25,6 +25,8 @@
|
|||
:select-sm
|
||||
:select-multiple
|
||||
:checkable
|
||||
:checkable-radio
|
||||
:checkable-checkbox
|
||||
:ctrl
|
||||
:search-form))
|
||||
|
||||
|
@ -140,6 +142,21 @@ VALUE: The value attribute for the control."
|
|||
:class "form-check-input")
|
||||
(format nil " ~a" value-str))))))
|
||||
|
||||
(defmacro define-checkable (type)
|
||||
(let ((func-name (intern (string-upcase (concatenate 'string "checkable-" type)))))
|
||||
`(defun ,func-name (name value)
|
||||
(checkable ,type name value))))
|
||||
|
||||
(defmacro define-checkables (types)
|
||||
"Generates multiple checkable functions based on the provided list of types.
|
||||
|
||||
TYPES: A list of strings that specifies the types for which to generate
|
||||
checkable macros."
|
||||
`(progn
|
||||
,@(loop for type in types collect `(define-checkable ,type))))
|
||||
|
||||
(define-checkables ("radio" "checkbox"))
|
||||
|
||||
(defun ctrl (type name label)
|
||||
"Generates a basic Bootstrap form control with a label.
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue