0.6.1 master

Cascara

Action Edit

Modules are private components that are used inside of Form and Table. They are not exported from Cascara and cannot be used independently.

A special action module, fully controled by esp-auth. Use it when you want the data to be editable. In contrast with the button module, this module renders up to 2 buttons, depending on the edit state of the parent context:

  1. when not in edit mode, it will render a single button with the text you pass as editLabel prop, clicking that button will make the edit mode kick-in
  2. when in edit mode, it will render a button for exiting edit mode (AKA cancel) and one for accepting the changes made during edit mode (AKA saving).

All these three buttons will cause your Table or Form to emit the following onAction events:

  1. edit.start when entering in edit mode
  2. edit.cancel when exiting the edit mode via the cancel button
  3. edit.save when exiting the edit mode via the save button

Using the module

Additional to the props specified in the aside table, you need to pass the module prop, with its value set to edit.

Sandbox

Feel free to play around with the following code: