mmo-list
1 symbol · generated 27 Oct 2026
mmo-list
mmo-list.jhs:1Edit a list of values: an array (its items numbered, in order) or, with withkeys, a map of string keys.
- Extends
- CustomElement
Index
| type | used to set the type of the items value's input. | |
| withkeys | if present, keys are editable (Map). | |
| src | the view to use to edit the value of items, in a panel. | |
| min | minimum number of items (used by validity) | |
| max | maximum number of items (used by validity, « Add » is disabled when reached) | |
| withorder | if present, the rows carry a drag handle and can be reordered | |
| disabled | if present, nothing can be added, edited or removed | |
| ViewDefault static readonly accessor | ||
| rows readonly accessor | The rows, in order | |
| withkeys accessor | Get the withkeys of the list | |
| disabled accessor | Get the disabled of the list | |
| withorder accessor | Get the withorder of the list | |
| min accessor | Get the min of the list | |
| max accessor | Get the max of the list | |
| src accessor | Get the src of the list | |
| value accessor | Get the value of the list | |
| type accessor | Get the type of the list | |
| validity readonly accessor | Get the validity of the list | |
| validityMessage readonly accessor | Get the validity message of the list | |
| init() async | ||
| keyOf(node) | The key of the item a node belongs to: an index in a list, a string in a map | |
| renderField(view) | Build the editor of a row's value: a clone of the inner html, or an input of type | |
| renderSummary(view) | Write the summary of a row edited in a panel (src): its item's title, as text, again whenever the item changes -- edited in the panel, or merged with what the server saved | |
| summaryOf(item) | The text of an item in its row: its schema's title (a template: {type} [{dateDebut} - {dateFin}]) filled with its values, so an item not saved yet has one too; else its entity's title | |
| SummaryText(value) static | A value as the text of a summary: a date as d/m/Y (and its time when it has one), an entity as its title | |
| itemSchema() | The schema of the items, from the list's schema, or from the one of the entity holding the list (a list loaded from the server may come without its own) | |
| updateCount() | Count the items, and write the text under the list: how many there are against the bounds | |
| onKeydown(event) | Enter moves to the next row, and adds one from the last; in a key it moves to the value | |
| focusRow(row, key) | Focus a row's editor | |
| onDragstart(event) | On drag start: only from a row's handle | |
| onDragend(event) | On drag end | |
| onDragover(event) | On drag over | |
| onDrop(event) | On drop: the dragged row takes the place of the one it is dropped on | |
| Bool(value) static | A boolean attribute's value: present (`) is true, false` is false | |
| checkValidity() | Check the validity of the list | |
| willValidate() | Check if the list will validate | |
| newValue() | The value a new item starts with, by the type of its editor | |
| newEntity() async | The item an « Add » of a list edited in panels (src) starts with: an entity of the items' class, with its defaults and its schema (its title, its dates as dates), rather than a {} that had neither | |
| addItem() async | Add an item at the end of the list and focus it: its key in a map, its value in a list | |
| removeItem(node) async | Remove the item a node belongs to. | |
| renameItem(input) | Rename the key of an item, from its key input. | |
| editItem(node) | Edit an item in its panel | |
| openPanel(key, isNew) | Open a panel to edit an item |
Attributes7
type
mmo-list.jhsused to set the type of the items value's input. Incompatible with src
type
withkeys
mmo-list.jhsif present, keys are editable (Map). else value is treated as a list.
withkeys
src
mmo-list.jhsthe view to use to edit the value of items, in a panel. Incompatible with type.
src
min
mmo-list.jhsminimum number of items (used by validity)
min
max
mmo-list.jhsmaximum number of items (used by validity, « Add » is disabled when reached)
max
withorder
mmo-list.jhsif present, the rows carry a drag handle and can be reordered
withorder
disabled
mmo-list.jhsif present, nothing can be added, edited or removed
disabled
Properties12
ViewDefault
staticreadonlyaccessormmo-list.jhs:47rows
readonlyaccessormmo-list.jhs:86The rows, in order
- Type
Array<HTMLElement>
withkeys
accessormmo-list.jhs:308Get the withkeys of the list
- Type
boolean
disabled
accessormmo-list.jhs:324Get the disabled of the list
- Type
boolean
withorder
accessormmo-list.jhs:343Get the withorder of the list
- Type
boolean
min
accessormmo-list.jhs:388Get the min of the list
- Type
integer
max
accessormmo-list.jhs:406Get the max of the list
- Type
integer
src
accessormmo-list.jhs:424Get the src of the list
- Type
string
value
accessormmo-list.jhs:440Get the value of the list
- Type
array
type
accessormmo-list.jhs:456Get the type of the list
- Type
string
validity
readonlyaccessormmo-list.jhs:492Get the validity of the list
- Type
object
validityMessage
readonlyaccessormmo-list.jhs:501Get the validity message of the list
- Type
string
Methods24
init()
asyncmmo-list.jhs:58keyOf(node)
mmo-list.jhs:95The key of the item a node belongs to: an index in a list, a string in a map
| node | HTMLElement | - any node of the row |
| returns | string | number | null | null when the node is not in a row |
renderField(view)
mmo-list.jhs:108Build the editor of a row's value: a clone of the inner html, or an input of type
| view | MMO.elements.View | - the row's view |
renderSummary(view)
mmo-list.jhs:126Write the summary of a row edited in a panel (src): its item's title, as text, again whenever the item changes -- edited in the panel, or merged with what the server saved
| view | MMO.elements.View | - the row's view |
summaryOf(item)
mmo-list.jhs:147The text of an item in its row: its schema's title (a template: {type} [{dateDebut} - {dateFin}]) filled with its values, so an item not saved yet has one too; else its entity's title
| item | * | |
| returns | string |
SummaryText(value)
staticmmo-list.jhs:168A value as the text of a summary: a date as d/m/Y (and its time when it has one), an entity as its title
| value | * | |
| returns | string |
itemSchema()
mmo-list.jhs:181The schema of the items, from the list's schema, or from the one of the entity holding the list (a list loaded from the server may come without its own)
| returns | ?MMO.schemas.Schema | null when the list is not described |
updateCount()
mmo-list.jhs:197Count the items, and write the text under the list: how many there are against the bounds
onKeydown(event)
mmo-list.jhs:208Enter moves to the next row, and adds one from the last; in a key it moves to the value
| event | KeyboardEvent |
focusRow(row, key)
mmo-list.jhs:231Focus a row's editor
| row | HTMLElement | |
| key | boolean | - focus the key rather than the value |
onDragstart(event)
mmo-list.jhs:246On drag start: only from a row's handle
| event | DragEvent | - The event |
onDragend(event)
mmo-list.jhs:261On drag end
| event | DragEvent | - The event |
onDragover(event)
mmo-list.jhs:276On drag over
| event | DragEvent | - The event |
onDrop(event)
mmo-list.jhs:294On drop: the dragged row takes the place of the one it is dropped on
| event | DragEvent | - The event |
Bool(value)
staticmmo-list.jhs:378A boolean attribute's value: present (`) is true, false` is false
| value | * | |
| returns | boolean |
checkValidity()
mmo-list.jhs:475Check the validity of the list
| returns | boolean | The validity of the list |
willValidate()
mmo-list.jhs:484Check if the list will validate
| returns | boolean | The will validate of the list |
newValue()
mmo-list.jhs:513The value a new item starts with, by the type of its editor
| returns | * |
newEntity()
asyncmmo-list.jhs:529The item an « Add » of a list edited in panels (src) starts with: an entity of the items' class, with its defaults and its schema (its title, its dates as dates), rather than a {} that had neither
| returns | Promise<MMO.elements.Entity | Object> | {} when the items are not described |
addItem()
asyncmmo-list.jhs:546Add an item at the end of the list and focus it: its key in a map, its value in a list
removeItem(node)
asyncmmo-list.jhs:577Remove the item a node belongs to. An item edited in a panel asks first: it holds a whole form
| node | HTMLElement | - any node of the row |
renameItem(input)
mmo-list.jhs:600Rename the key of an item, from its key input. An empty key or one already used is refused: renaming onto another key would replace its item
| input | HTMLInputElement |
editItem(node)
mmo-list.jhs:624Edit an item in its panel
| node | HTMLElement | - any node of the row |
openPanel(key, isNew)
mmo-list.jhs:635Open a panel to edit an item
| key | string | - The key of the item |
| isNew = false | boolean | - If the item is new: cancelling removes it |
| returns | Promise | The promise of the panel |