MMOframework
Why AI Playground Libraries Documentation Search Agency
FR EN
Index

mmo-list

1 symbol · generated 27 Oct 2026

element

mmo-list

mmo-list.jhs:1

Edit a list of values: an array (its items numbered, in order) or, with withkeys, a map of string keys.

<mmo-list type withkeys src min max withorder disabled></mmo-list>
Extends
CustomElement
Each row shows its editor at once; the trash button removes it, « Add » appends one and focuses it, and Enter in the last row adds the next one. # HTML Inner html is used to replace the items value's input. the value of the given element is linked to the item's value

Index

typeused to set the type of the items value's input.
withkeysif present, keys are editable (Map).
srcthe view to use to edit the value of items, in a panel.
minminimum number of items (used by validity)
maxmaximum number of items (used by validity, « Add » is disabled when reached)
withorderif present, the rows carry a drag handle and can be reordered
disabledif present, nothing can be added, edited or removed
ViewDefault static readonly accessor
rows readonly accessorThe rows, in order
withkeys accessorGet the withkeys of the list
disabled accessorGet the disabled of the list
withorder accessorGet the withorder of the list
min accessorGet the min of the list
max accessorGet the max of the list
src accessorGet the src of the list
value accessorGet the value of the list
type accessorGet the type of the list
validity readonly accessorGet the validity of the list
validityMessage readonly accessorGet 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) staticA 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) staticA 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() asyncThe 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() asyncAdd an item at the end of the list and focus it: its key in a map, its value in a list
removeItem(node) asyncRemove 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.jhs

used to set the type of the items value's input. Incompatible with src

type

withkeys

mmo-list.jhs

if present, keys are editable (Map). else value is treated as a list.

withkeys

src

mmo-list.jhs

the view to use to edit the value of items, in a panel. Incompatible with type.

src

min

mmo-list.jhs

minimum number of items (used by validity)

min

max

mmo-list.jhs

maximum number of items (used by validity, « Add » is disabled when reached)

max

withorder

mmo-list.jhs

if present, the rows carry a drag handle and can be reordered

withorder

disabled

mmo-list.jhs

if present, nothing can be added, edited or removed

disabled

Properties12

rows

readonlyaccessormmo-list.jhs:86

The rows, in order

get rows()
Type
Array<HTMLElement>

withkeys

accessormmo-list.jhs:308

Get the withkeys of the list

get withkeys() set withkeys(value)
Type
boolean

disabled

accessormmo-list.jhs:324

Get the disabled of the list

get disabled() set disabled(value)
Type
boolean

withorder

accessormmo-list.jhs:343

Get the withorder of the list

get withorder() set withorder(value)
Type
boolean

min

accessormmo-list.jhs:388

Get the min of the list

get min() set min(value)
Type
integer

max

accessormmo-list.jhs:406

Get the max of the list

get max() set max(value)
Type
integer

src

accessormmo-list.jhs:424

Get the src of the list

get src() set src(value)
Type
string

value

accessormmo-list.jhs:440

Get the value of the list

get value() set value(value)
Type
array

type

accessormmo-list.jhs:456

Get the type of the list

get type() set type(value)
Type
string

validity

readonlyaccessormmo-list.jhs:492

Get the validity of the list

get validity()
Type
object

validityMessage

readonlyaccessormmo-list.jhs:501

Get the validity message of the list

get validityMessage()
Type
string

Methods24

keyOf(node)

mmo-list.jhs:95

The key of the item a node belongs to: an index in a list, a string in a map

keyOf(node)
nodeHTMLElement- any node of the row
returnsstring | number | nullnull when the node is not in a row

renderField(view)

mmo-list.jhs:108

Build the editor of a row's value: a clone of the inner html, or an input of type

renderField(view)
viewMMO.elements.View- the row's view

renderSummary(view)

mmo-list.jhs:126

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

renderSummary(view)
viewMMO.elements.View- the row's view

summaryOf(item)

mmo-list.jhs:147

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

summaryOf(item)
item*
returnsstring

SummaryText(value)

staticmmo-list.jhs:168

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

static SummaryText(value)
value*
returnsstring

itemSchema()

mmo-list.jhs:181

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)

itemSchema()
returns?MMO.schemas.Schemanull when the list is not described

updateCount()

mmo-list.jhs:197

Count the items, and write the text under the list: how many there are against the bounds

updateCount()

onKeydown(event)

mmo-list.jhs:208

Enter moves to the next row, and adds one from the last; in a key it moves to the value

onKeydown(event)
eventKeyboardEvent

focusRow(row, key)

mmo-list.jhs:231

Focus a row's editor

focusRow(row, key)
rowHTMLElement
keyboolean- focus the key rather than the value

onDragstart(event)

mmo-list.jhs:246

On drag start: only from a row's handle

onDragstart(event)
eventDragEvent- The event

onDragend(event)

mmo-list.jhs:261

On drag end

onDragend(event)
eventDragEvent- The event

onDragover(event)

mmo-list.jhs:276

On drag over

onDragover(event)
eventDragEvent- The event

onDrop(event)

mmo-list.jhs:294

On drop: the dragged row takes the place of the one it is dropped on

onDrop(event)
eventDragEvent- The event

Bool(value)

staticmmo-list.jhs:378

A boolean attribute's value: present (`) is true, false` is false

static Bool(value)
value*
returnsboolean

checkValidity()

mmo-list.jhs:475

Check the validity of the list

checkValidity()
returnsbooleanThe validity of the list

willValidate()

mmo-list.jhs:484

Check if the list will validate

willValidate()
returnsbooleanThe will validate of the list

newValue()

mmo-list.jhs:513

The value a new item starts with, by the type of its editor

newValue()
returns*

newEntity()

asyncmmo-list.jhs:529

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

async newEntity()
returnsPromise<MMO.elements.Entity | Object>{} when the items are not described

addItem()

asyncmmo-list.jhs:546

Add an item at the end of the list and focus it: its key in a map, its value in a list

async addItem()

removeItem(node)

asyncmmo-list.jhs:577

Remove the item a node belongs to. An item edited in a panel asks first: it holds a whole form

async removeItem(node)
nodeHTMLElement- any node of the row

renameItem(input)

mmo-list.jhs:600

Rename 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

renameItem(input)
inputHTMLInputElement

editItem(node)

mmo-list.jhs:624

Edit an item in its panel

editItem(node)
nodeHTMLElement- any node of the row

openPanel(key, isNew)

mmo-list.jhs:635

Open a panel to edit an item

openPanel(key, isNew = false)
keystring- The key of the item
isNew = falseboolean- If the item is new: cancelling removes it
returnsPromiseThe promise of the panel