Document Create/Edit
Typical tag name: doc-create
Exported class: DocCreate
Inheritance: DocCreate <-- SKUIBase <-- (imm-dom stack)
Form for creating or editing Documents. Create uses m$_add_entry and edit uses m$_update_entry.
Data is presented as Object.fromEntries( FormData ).
Required Assets
- imm-dom, i18n
- sk.css
External Requirements
- Open Props
- Font Awesome 6
- Shoelace
WC Dependencies
ivc-zs
API
Attributes
| Attribute | Default | Enumerators | Usage |
|---|---|---|---|
ui |
button |
full, button, sl_menu_item |
Present UI as full form, button, or sl-menu-item which creates the form in a modal. |
disabled |
false |
N/A | Disabled from clicking. |
edit |
undefined |
N/A | Set to HK1 of Document to edit. |
label |
Create Document |
N/A | Set button label to attribute. |
icon |
fas fa-circle-plus |
N/A | Set button icon as prefix. |
is-circle |
false |
Boolean | Display button as a circle with icon only. |
Properties
| Property | Type | Default | Usage |
|---|---|---|---|
| (None.) |
Events
| Event | Detail | Usage |
|---|---|---|
doc-create-created |
map( key -> data) |
Map of Document key to data from added Document(s). |
doc-updated |
map( key -> data ) |
Map of Document key to data from updated Document(s). |
Methods
| Method | Arguments | Usage |
|---|---|---|
| (None.) |
Slots
| Slot | Usage |
|---|---|
| (None.) |
CSS Parts
| Part | Usage |
|---|---|
| (None.) |
Example
<link rel="stylesheet" type="text/css" href="/css/sk-root.css">
<script type=module src='/cdn/@encipher-sk/ivcore/esm/doc_create.js'></script>
<div class='example'>
<ivc-i18n></ivc-i18n>
<ivc-zs reload-ws></ivc-zs>
<doc-create ui=full></doc-create>
</div>