ItemSelect
Pick one item at a time (JSKOS concepts, schemes, languages, …) via:
- a typeahead dropdown (via ItemSuggest)
- optional hierarchy browsing (via ConceptTree)
ItemSelect does not keep a selection list. It only emits the picked item. If you want to show/edit a list, combine it with ItemSelected in your app.
Props
optionsarray, default[]— local options (small static lists like languages).searchfunction — remote search function in OpenSearch Suggest format (see ItemSuggest). Default is based onoptions(if set) or onregistry.suggest(if bothregistryandschemeare set).resolvefunction — optional async resolver to turn a selected URI into a full JSKOS item object when it is not available in the internal suggestion cache. Default is based onoptions(if set) or onregistry.getConcepts(if available).minCharsnumber, default1— minimum query length before searching (applies tooptionsandsearch).registryobject, defaultnull— Registry to load concepts fromschemeobject, defaultnull— Concept Scheme to load concepts from. Must have fieldurioridentifierat least.treeConceptsarray — top concepts for theConceptTreebrowser below the input.
Default is loaded viaregistry.getTopif bothregistryandschemeare set.placeholderstring, default"Search…"—
ConceptTree integration
treeConceptsarray, default[]— top concepts for theConceptTreebrowser below the input.
default:[](no tree is shown for empty array)treeLoadNarrowerfunction — called when a tree node is opened; should loadnarrower.
Optional resolving
resolvefunction optional async resolver to turn a selected URI into a full item object
when it is not available in the internal suggestion cache.
Signature:async (uri) => item
UI
placeholderstring, default"Search…"— input placeholder.
See concept loading of ConceptTree for background information on registry and scheme.
Slots
The default slot is shown between input field and hierarchy.
Events
select— emitted when an item is picked (via typeahead or tree). Payload is usually a normalized item. If resolving is not possible, it may fall back to{ uri }.
Behavior notes
Before emitting select, items are normalized:
__labelis kept or selected fromprefLabelwithjskos-tools.prefLabel.undis added for display. Existing labels are kept.notationis kept. If missing,jskos-toolstries to derive it from the item URI and scheme.
ItemSuggest emits only { uri }. ItemSelect caches the current suggestion result set so it can emit a full object when available. If the URI is not cached, resolve(uri) can provide the item.
The hierarchy browser starts collapsed. Selecting via typeahead opens it and tries to show the selected concept. If the tree is closed and opened again, the selected concept is synced again.
Methods
Via component ref (ref="itemSelect"):
focus— focuses the internalItemSuggestinput.
Layout
.jskos-vue-itemSelect.jskos-vue-itemSelect-tree
See ItemSuggest for styling of dropdown and ConceptTree for styling of tree.