Signature

Signature canvas Pad (work in progress …)

Read more Read less

TODO:

  • data saved as a PNG dataURL and loaded again do not preserve signature size
  • when clicking on the validate button:
    • the dataURL should be persisted in a hidden input field.
    • a custom event will be triggered. Parent liveview will handle the event and set the signature as readonly
  • must support a readonly attribute: disables the buttons, disables the canvas (transparent overlay?)
<.signature id="signature-single-default-signature"/>
<.signature id="signature-single-custom-colors" background_color="#F0F0F0" pen_color="blue"/>
<.signature id="signature-single-custom-pen-width" max_pen_width={1.5} min_pen_width={1.5}/>
<.signature
  id="signature-single-with-input-data"
  data_url="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAACWCAYAAABkW7XSAAAAAXNSR0IArs4c6QAACyxJREFUeF7tnc111TwQQJ0OWLKEDqACYMUyJUA6CBUQKgAqCJTAkhWkAzqAJUs6yPfNOyhHEZIt/4zk8dy3gZPY0uiO3o0ky/bZ7e3t7cAHAhCAgAECZwjLQJYIEQIQOBFAWHQECEDADAGEZSZVBAoBCCAs+gAEIGCGAMIykyoChQAEEBZ9AAIQMEMAYZlJFYFCAAIIiz4AAQiYIYCwzKSKQCEAAYRFH4AABMwQQFhmUkWgEIAAwqIPQAACZgggLDOpIlAIQABh0QcgAAEzBBCWmVQRKAQggLDoAxCAgBkCCMtMqggUAhBAWPQBCEDADAGEZSZVBAoBCCAs+gAEIGCGAMIykyoChQAEEBZ9AAIQMEMAYZlJFYFCAAIIiz4AAQiYIYCwzKSKQCEAAYRFH4AABMwQQFhmUkWgEIAAwqIPQAACZgggLDOpIlAIQABh0Qcg8JfA9+/fh+fPn8NjxwQQ1o6TQ2htCIio3r17N8i/8vn27RviaoN+di0IazYyTjgKgVRUoV1v374drq6ujtLMQ7UDYR0qnT4aI9O2m5ubU2NzU7hnz579I5wwepJ/5dwfP34Mf/78yQJDWPvtRwhrv7khsoRAGPXI9E3jI/ITWbGOpUF3mzIR1jYcKUWZgMgKUSlDNlA8wjKQJO8hvnjx4m5BfEsWjx49Gq6vrxlRbQlVuSyEpQy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