Skip to content

ItemSelect

Pick one item at a time (JSKOS concepts, schemes, languages, …) via:

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

  • options array, default []
    local options (small static lists like languages).
  • search function
    remote search function in OpenSearch Suggest format (see ItemSuggest). Default is based on options (if set) or on registry.suggest (if both registry and scheme are set).
  • resolve function
    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 on options (if set) or on registry.getConcepts (if available).
  • minChars number, default 1
    minimum query length before searching (applies to options and search).
  • registry object, default null
    Registry to load concepts from
  • scheme object, default null
    Concept Scheme to load concepts from. Must have field uri or identifier at least.
  • treeConcepts array
    top concepts for the ConceptTree browser below the input.
    Default is loaded via registry.getTop if both registry and scheme are set.
  • placeholder string, 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, items are normalized:

  • __label is derived from __label / prefLabel (fallback: uri)
  • prefLabel.und is ensured
  • notation is preserved; otherwise tries to derive DDC notation from /class/<notation>/ URIs

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 in the cache and you provided resolve, it calls resolve(uri) and emits the returned item (normalized).

After selecting via typeahead the tree is synced via conceptTree.navigateToUri(concept, { select: false }) (best effort).

Methods

Via component ref (ref="itemSelect"):

  • focus — focuses the internal ItemSuggest input.

Layout

  • .jskos-vue-itemSelect
  • .jskos-vue-itemSelect-tree

See ItemSuggest for styling of dropdown and ConceptTree for styling of tree.

Examples

Languages (local options)

DDC (remote, with tree)