From c6e8fc6235d30a0df96e5d0f66466c0607c840f6 Mon Sep 17 00:00:00 2001 From: Trif Adriana Date: Wed, 31 May 2023 16:44:47 +0300 Subject: [PATCH 1/3] Remove user prefix --- package-lock.json | 2 +- package.json | 2 +- src_ts/EtoolsDropdown.ts | 1 + src_ts/EtoolsDropdownMulti.ts | 1 + src_ts/mixins/list-item-utils-mixin.ts | 11 +++++++++++ 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9a47063..163eb12 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@unicef-polymer/etools-dropdown", - "version": "5.0.1", + "version": "5.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d8c5a13..6fc9b11 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@unicef-polymer/etools-dropdown", "description": "Polymer 3 dropdown element with searchable options, single and multiple selection", - "version": "5.0.1", + "version": "5.1.0", "homepage": "https://github.com/unicef-polymer/etools-dropdown", "repository": { "type": "git", diff --git a/src_ts/EtoolsDropdown.ts b/src_ts/EtoolsDropdown.ts index 685fc70..2ae6034 100644 --- a/src_ts/EtoolsDropdown.ts +++ b/src_ts/EtoolsDropdown.ts @@ -264,6 +264,7 @@ export class EtoolsDropdown extends CommonFunctionalityMixin(MissingOptionsMixin @show-more="${this.onShowMore}" @shown-options="${this.onShownOptions}" .language="${this.language}" + ?unprefixName="${this.unprefixName}" > diff --git a/src_ts/EtoolsDropdownMulti.ts b/src_ts/EtoolsDropdownMulti.ts index fcc43ad..1b2ce4e 100644 --- a/src_ts/EtoolsDropdownMulti.ts +++ b/src_ts/EtoolsDropdownMulti.ts @@ -147,6 +147,7 @@ export class EtoolsDropdownMulti extends CommonFunctionalityMixin(MissingOptions @show-more="${this.onShowMore}" @shown-options="${this.onShownOptions}" .language="${this.language}" + ?unprefixName="${this.unprefixName}" > @property({type: String, attribute: 'language'}) language!: string; + @property({type: Boolean, attribute: 'unprefix-name'}) + unprefixName = false; + /** * Get option primary label. All chars until `|` . * @param label @@ -48,6 +51,10 @@ export const ListItemUtilsMixin = dedupeMixin( if (this.capitalize) { l = this._capitalizeString(l); } + + if (this.unprefixName && label && label.lastIndexOf(']') > 0) { + label = label.substring(label.lastIndexOf(']') + 1); + } } return l; } @@ -98,6 +105,10 @@ export const ListItemUtilsMixin = dedupeMixin( // capitalize label label = this._capitalizeString(label); } + + if (this.unprefixName && label && label.lastIndexOf(']') > 0) { + label = label.substring(label.lastIndexOf(']') + 1); + } } return label; } From 2d931f5270c8ceed6ffe00b0494f2910886b5dd5 Mon Sep 17 00:00:00 2001 From: Trif Adriana Date: Wed, 31 May 2023 16:49:09 +0300 Subject: [PATCH 2/3] Remove user prefix --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 163eb12..5bf9949 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@unicef-polymer/etools-dropdown", - "version": "5.1.0", + "version": "5.1.0-rc.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6fc9b11..31413fc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@unicef-polymer/etools-dropdown", "description": "Polymer 3 dropdown element with searchable options, single and multiple selection", - "version": "5.1.0", + "version": "5.1.0-rc.1", "homepage": "https://github.com/unicef-polymer/etools-dropdown", "repository": { "type": "git", From dcc08f07ad0cab10964c8acf4ed57e28ce1a49fc Mon Sep 17 00:00:00 2001 From: Trif Adriana Date: Tue, 6 Jun 2023 14:37:35 +0300 Subject: [PATCH 3/3] Remove user prefix --- src_ts/EtoolsDropdown.ts | 2 +- src_ts/EtoolsDropdownMulti.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src_ts/EtoolsDropdown.ts b/src_ts/EtoolsDropdown.ts index 2ae6034..f38d70c 100644 --- a/src_ts/EtoolsDropdown.ts +++ b/src_ts/EtoolsDropdown.ts @@ -264,7 +264,7 @@ export class EtoolsDropdown extends CommonFunctionalityMixin(MissingOptionsMixin @show-more="${this.onShowMore}" @shown-options="${this.onShownOptions}" .language="${this.language}" - ?unprefixName="${this.unprefixName}" + ?unprefix-name="${this.unprefixName}" > diff --git a/src_ts/EtoolsDropdownMulti.ts b/src_ts/EtoolsDropdownMulti.ts index 1b2ce4e..540718a 100644 --- a/src_ts/EtoolsDropdownMulti.ts +++ b/src_ts/EtoolsDropdownMulti.ts @@ -93,6 +93,7 @@ export class EtoolsDropdownMulti extends CommonFunctionalityMixin(MissingOptions .openMenu="${this._openMenu}" .onInputFocus="${this.onInputFocus}" exportparts="esmm-label-container, esmm-label, esmm-label-suffix" + ?unprefix-name="${this.unprefixName}" > @@ -147,7 +148,7 @@ export class EtoolsDropdownMulti extends CommonFunctionalityMixin(MissingOptions @show-more="${this.onShowMore}" @shown-options="${this.onShownOptions}" .language="${this.language}" - ?unprefixName="${this.unprefixName}" + ?unprefix-name="${this.unprefixName}" >