mmo-search
1 symbole · générée le 27 Oct 2026
mmo-search
mmo-search.jhs:1The search bar of a repository query, on one line: free text, and one chip per filter.
- Étend
- CustomShadowElement
Index
| value | the url of the query | |
| schema | the schema of the collection, or its class name | |
| fulltext | the free text is the repository's full text search (search[type]=$text) rather than a filter | |
| text-fields | the paths the free text is looked for in, comma separated (default: every text property) | |
| ViewDefault static readonly accessor | ||
| value accessor | Get the url of the query | |
| schema accessor | Get the schema of the collection | |
| constructor() | ||
| init() | ||
| setSchema(value) | Set the schema of the collection: the fields the chips are made of. | |
| setAPI(api) | Use another requester: the bar reads its query and writes into it. | |
| update() | Read the requester again: its filters become the chips, its last response the page. | |
| fetchRefs(field, options) | List entities a ref field points to, and learn their labels. | |
| loadRefLabels() | The chips of a ref field show the labels of their entities: those not known yet are fetched. | |
| search() | Run the query again. | |
| textFields() | ||
| textSearchType() | ||
| commit() | Write the chips into the requester, and run the query. | |
| setCondition(cond, index) | ||
| removeChip(type, index) | Remove a chip and run the query again. | |
| toggleAny() | Switch between "every filter" and "any filter". | |
| renderChips() | Draw the chips, the pinned enum chips and the all/any button. | |
| revealInput() | The chips scroll sideways: the input being typed in stays in view. | |
| createChip(type, index, field, op, value, title) | ||
| editChip(type, index, anchor) | Edit a chip: in the form, or, for the free text, back in the input. | |
| focusInput(event) | A click on the bar, out of a chip or a button, is a click in the input. | |
| onInput() | ||
| startDraft(field, word, before, after) | Turn what is being typed into a chip of that field. | |
| cancelDraft(giveBack) | Drop the chip being typed. | |
| renderDraft() | ||
| updatePlaceholder() | The input says what it expects: a value of the field being typed, or a search. | |
| onKeyDown(event) | ||
| disarm() | ||
| onBlur() | ||
| restoreText() | ||
| submit() | Enter: the chip being typed is added, or the text is searched for. | |
| showSuggestions(ask) | List what the input could become: a field to filter on, a value of the field being typed, the search. | |
| searchRefs(field, word) | Ask the collection for the entities whose label holds a word being typed: the suggestions are drawn again with them, if the word is still the one typed. | |
| renderSuggestions() | ||
| hideSuggestions() | ||
| moveSuggestion(step) | ||
| pickSuggestion(index) | ||
| addFilter(anchor) | The filter button: a new chip, in the form. | |
| openEditor(cond, origin, index, anchor) | Edit a chip in a form. | |
| fieldOf(path) | ||
| renderEditor() | ||
| createValueInputs(field, op, value) | The controls a value is given with, after the kind of field and the operator. | |
| createRefSelect(field, value) | The entities of a ref field, picked by their label: the select lists those whose label holds what is typed. | |
| toInputValue(field, value) | ||
| readEditorValue() | ||
| readEditor() | The form, as a condition. | |
| applyEditor() | ||
| openAdvanced(anchor) | Edit the whole filter in <mmo-filter>: groups in groups, every operator. | |
| applyAdvanced(filters) | ||
| renderPaging() | Write the page the last response is (1–50 / 342), and which way the arrows can go. | |
| openPaging(anchor) | ||
| setLimit(value) | ||
| setOffset(value) | ||
| inputURL() | Ask for the url of the query, and run it. | |
| loadPrevious() | Load the previous page | |
| loadNext() | Load the next page | |
| placePopover(pop, anchor) | Open a popover under (or, short of room, above) an element of the bar, inside the screen. | |
| search | a control of the page's own, put before the chips | |
| (default) | the buttons added at the end of the bar |
Attributs4
value
mmo-search.jhsthe url of the query
value
schema
mmo-search.jhsthe schema of the collection, or its class name
schema
fulltext
mmo-search.jhsthe free text is the repository's full text search (search[type]=$text) rather than a filter
fulltext
text-fields
mmo-search.jhsthe paths the free text is looked for in, comma separated (default: every text property)
text-fields
Propriétés3
ViewDefault
staticreadonlyaccessormmo-search.jhs:71value
accessormmo-search.jhs:107Get the url of the query
- Type
URL
schema
accessormmo-search.jhs:120Get the schema of the collection
Méthodes55
constructor()
mmo-search.jhs:75init()
mmo-search.jhs:88setSchema(value)
mmo-search.jhs:133Set the schema of the collection: the fields the chips are made of.
| value | MMO.schemas.Schema | string | the schema, or its class name |
| retourne | Promise<?MMO.schemas.Schema> | resolved once the fields are known |
setAPI(api)
mmo-search.jhs:155Use another requester: the bar reads its query and writes into it.
update()
mmo-search.jhs:163Read the requester again: its filters become the chips, its last response the page.
fetchRefs(field, options)
mmo-search.jhs:192List entities a ref field points to, and learn their labels. A repository whose label search finds nothing (a json one compares the stored title, not the one its template makes) has its first entities looked into instead.
| field | Object | |
| options | Object | MMO.core.SearchQuery.RefQuery |
| retourne | Promise<Array<string>> | their uids, none when they cannot be listed |
loadRefLabels()
mmo-search.jhs:212The chips of a ref field show the labels of their entities: those not known yet are fetched.
search()
mmo-search.jhs:221Run the query again.
textFields()
mmo-search.jhs:231| retourne | Array<string> | the paths the free text is a $regex on |
textSearchType()
mmo-search.jhs:240| retourne | ?string | the search the free text goes to instead of the filters: $text with fulltext, the collection's label search property when it has no text field, null otherwise |
commit()
mmo-search.jhs:252Write the chips into the requester, and run the query.
setCondition(cond, index)
mmo-search.jhs:272| cond | Object | a condition, or a search ($search) |
| index = null | ?number | the condition it replaces |
removeChip(type, index)
mmo-search.jhs:282Remove a chip and run the query again.
| type | string | condition, search, text or advanced |
| index | number |
toggleAny()
mmo-search.jhs:295Switch between "every filter" and "any filter".
renderChips()
mmo-search.jhs:306Draw the chips, the pinned enum chips and the all/any button.
revealInput()
mmo-search.jhs:350The chips scroll sideways: the input being typed in stays in view.
createChip(type, index, field, op, value, title)
mmo-search.jhs:368| type | string | condition, search, text or advanced |
| index | number | its index in the state |
| field | string | what it filters on |
| op | string | how |
| value | string | on what |
| title = null | ?string | its tooltip |
| retourne | HTMLElement |
editChip(type, index, anchor)
mmo-search.jhs:396Edit a chip: in the form, or, for the free text, back in the input.
| type | string | |
| index | number | |
| anchor | HTMLElement | what the form opens under |
focusInput(event)
mmo-search.jhs:417A click on the bar, out of a chip or a button, is a click in the input.
| event | MouseEvent |
onInput()
mmo-search.jhs:424startDraft(field, word, before, after)
mmo-search.jhs:445Turn what is being typed into a chip of that field.
| field | Object | |
| word | string | what named it, given back on Backspace |
| before = '' | string | the text typed before it: the free text |
| after = '' | string | the text typed after the colon: the start of the value |
cancelDraft(giveBack)
mmo-search.jhs:460Drop the chip being typed.
| giveBack = false | boolean | put the word that named its field back in the input |
renderDraft()
mmo-search.jhs:468updatePlaceholder()
mmo-search.jhs:487The input says what it expects: a value of the field being typed, or a search.
onKeyDown(event)
mmo-search.jhs:514| event | KeyboardEvent |
disarm()
mmo-search.jhs:564onBlur()
mmo-search.jhs:568restoreText()
mmo-search.jhs:575submit()
mmo-search.jhs:585Enter: the chip being typed is added, or the text is searched for.
showSuggestions(ask)
mmo-search.jhs:617List what the input could become: a field to filter on, a value of the field being typed, the search.
| ask = true | boolean | ask the collection of a ref field for the entities the value being typed names |
searchRefs(field, word)
mmo-search.jhs:661Ask the collection for the entities whose label holds a word being typed: the suggestions are drawn again with them, if the word is still the one typed.
| field | Object | a ref field |
| word | string |
renderSuggestions()
mmo-search.jhs:671hideSuggestions()
mmo-search.jhs:698moveSuggestion(step)
mmo-search.jhs:709| step | number | 1 for the next one, -1 for the previous one |
pickSuggestion(index)
mmo-search.jhs:720| index | number | the suggestion picked |
addFilter(anchor)
mmo-search.jhs:754The filter button: a new chip, in the form.
| anchor | HTMLElement |
openEditor(cond, origin, index, anchor)
mmo-search.jhs:770Edit a chip in a form.
| cond | Object | the condition ($search for a search property) |
| origin | string | condition, search or new |
| index | ?number | the condition's index |
| anchor | HTMLElement | what the form opens under |
fieldOf(path)
mmo-search.jhs:785| path | string | |
| retourne | Object | its field, or a text field for a path the schema does not describe |
renderEditor()
mmo-search.jhs:789createValueInputs(field, op, value)
mmo-search.jhs:858The controls a value is given with, after the kind of field and the operator.
| field | Object | |
| op | string | an editor operator (MMO.core.SearchQuery.Operators) |
| value | * | the current value |
| retourne | Array<HTMLElement> |
createRefSelect(field, value)
mmo-search.jhs:896The entities of a ref field, picked by their label: the select lists those whose label holds what is typed.
| field | Object | |
| value | ?string | the uid picked |
| retourne | HTMLElement | a <mmo-select> |
toInputValue(field, value)
mmo-search.jhs:925| field | Object | |
| value | * | |
| retourne | string | the value as an input holds it (a date as YYYY-MM-DD) |
readEditorValue()
mmo-search.jhs:933| retourne | * | the value the form holds, before it is a condition: kept when only the operator changes |
readEditor()
mmo-search.jhs:957The form, as a condition.
| retourne | ?Object | null when it holds no value |
applyEditor()
mmo-search.jhs:978openAdvanced(anchor)
mmo-search.jhs:1005Edit the whole filter in <mmo-filter>: groups in groups, every operator.
| anchor | HTMLElement |
applyAdvanced(filters)
mmo-search.jhs:1033| filters | Object | what <mmo-filter> built |
renderPaging()
mmo-search.jhs:1048Write the page the last response is (1–50 / 342), and which way the arrows can go.
openPaging(anchor)
mmo-search.jhs:1069| anchor | HTMLElement |
setLimit(value)
mmo-search.jhs:1079| value | string | '' for every result |
setOffset(value)
mmo-search.jhs:1088| value | string |
inputURL()
mmo-search.jhs:1096Ask for the url of the query, and run it.
loadPrevious()
mmo-search.jhs:1112Load the previous page
loadNext()
mmo-search.jhs:1122Load the next page
placePopover(pop, anchor)
mmo-search.jhs:1137Open a popover under (or, short of room, above) an element of the bar, inside the screen.
| pop | HTMLElement | |
| anchor | HTMLElement |
Slots2
search
mmo-search.jhsa control of the page's own, put before the chips
<slot name="search">
(default)
mmo-search.jhsthe buttons added at the end of the bar
<slot>