diff --git a/lib/ui/elements/_elements.mjs b/lib/ui/elements/_elements.mjs index f991becf9..823b4218a 100644 --- a/lib/ui/elements/_elements.mjs +++ b/lib/ui/elements/_elements.mjs @@ -20,7 +20,7 @@ import searchbox from './searchbox.mjs'; import slider from './slider.mjs'; import slider_ab from './slider_ab.mjs'; import { numericFormatter, getSeparators } from './numericFormatter.mjs'; -import pillComponent from './pillComponent.mjs' +import pills from './pills.mjs' /** UI elements object containing various UI components. @@ -40,7 +40,7 @@ UI elements object containing various UI components. @property {Function} slider_ab - Slider with A/B comparison component. @property {Function} numericFormatter - Numeric formatter function. @property {Function} getSeparators - Function to get numeric separators. -@property {Function} pillComponent - pill component. +@property {Function} pills - pills component. Exporting UI elements. @type {UIElements} @@ -56,7 +56,7 @@ export default { dropdown_multi, legendIcon, modal, - pillComponent, + pills, helpModal, searchbox, slider, diff --git a/lib/ui/elements/pillComponent.mjs b/lib/ui/elements/pills.mjs similarity index 72% rename from lib/ui/elements/pillComponent.mjs rename to lib/ui/elements/pills.mjs index 6a59363cd..5279ed8be 100644 --- a/lib/ui/elements/pillComponent.mjs +++ b/lib/ui/elements/pills.mjs @@ -1,21 +1,23 @@ /** -### mapp.ui.elements.pillComponent() -Module that returns a pillComponent UI element used in mapp. -@module /ui/elements/pillComponent +### mapp.ui.elements.pill() +Module that returns a pill UI element used in mapp. +@module /ui/elements/pills +*/ +/** Creates a searchbox component. -@function pillComponent +@function pill @param {Object} component The config object argument. -@param {HTMLElement} pillComponent.target The target element to append to. -@param {Object} pillComponent.pills array of values to be initially selected -@param {Function} [pillComponent.addCallback] function to execute once a pill has been added. Takes as arguments added value and array of selected values -@param {Function} [pillComponent.removeCallback] function to execute once a pill has been removed. Takes as arguments removed value and array of selected values +@param {HTMLElement} pill.target The target element to append to. +@param {Object} pill.pills array of values to be initially selected +@param {Function} [pill.addCallback] function to execute once a pill has been added. Takes as arguments added value and array of selected values +@param {Function} [pill.removeCallback] function to execute once a pill has been removed. Takes as arguments removed value and array of selected values @returns {Object} The decorated object argument. */ mapp.utils.merge(mapp.dictionaries, { en: { - pill_component_remove: "Remove" + pill_component_remove: 'Remove' } }); diff --git a/lib/ui/locations/entries/pills.mjs b/lib/ui/locations/entries/pills.mjs index 599617ef5..f5d39c1b1 100644 --- a/lib/ui/locations/entries/pills.mjs +++ b/lib/ui/locations/entries/pills.mjs @@ -2,7 +2,7 @@ export default entry => { entry.pills ??= entry.value || [] - mapp.ui.elements.pillComponent(entry) + mapp.ui.elements.pills(entry) return entry.container } \ No newline at end of file