;;; -*- mode: Lisp; Syntax: Common-Lisp; -*- ;;; ;;; Copyright (c) 2009 by the authors. ;;; ;;; See LICENCE for details. (in-package :hu.dwim.wui) ;;;;;; ;;; primitive/inspector (def (component e) primitive/inspector (primitive/presentation t/inspector) () (:documentation "A PRIMITIVE/INSPECTOR displays or edits existing values of primitive TYPEs.")) (def render-xhtml :before primitive/inspector (when (edited-component? -self-) (ensure-client-state-sink -self-))) ;;;;;; ;;; unbound/inspector (def (component e) unbound/inspector (unbound/presentation primitive/inspector) ()) ;;;;;; ;;; null/inspector (def (component e) null/inspector (null/presentation primitive/inspector) ()) (def subtype-mapper *inspector-type-mapping* null null/inspector) ;;;;;; ;;; boolean/inspector (def (component e) boolean/inspector (boolean/presentation primitive/inspector) ()) (def subtype-mapper *inspector-type-mapping* boolean boolean/inspector) (def function render-boolean-component (component &key (component-value-transformer #'identity)) (bind (((:read-only-slots component-value-type edited-component client-state-sink) component) (has-component-value? (slot-boundp component 'component-value)) (component-value (funcall component-value-transformer (when has-component-value? (component-value-of component)))))
) ,(if (symbolp component-value-type) (bind ((checked (when component-value "checked")) (disabled (unless edited-component "disabled"))) ) (bind ((disabled (unless edited-component "disabled")))