From 022887258fbdf0a4c51e9bf1977818d834d3e7fc Mon Sep 17 00:00:00 2001 From: Stephen Abello Date: Wed, 26 May 2021 14:11:13 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B03923=20Hide=20caret=20in=20autocomplete?= =?UTF-8?q?=20ext=20key=20input?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/ui.extkeywidget.class.inc.php | 9 +++++++-- css/backoffice/components/input/_input-select.scss | 8 ++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/application/ui.extkeywidget.class.inc.php b/application/ui.extkeywidget.class.inc.php index bbff0237f..78e45746d 100644 --- a/application/ui.extkeywidget.class.inc.php +++ b/application/ui.extkeywidget.class.inc.php @@ -160,7 +160,8 @@ class UIExtKeyWidget $sMessage = Dict::S('UI:Message:EmptyList:UseSearchForm'); $sAttrFieldPrefix = ($this->bSearchMode) ? '' : 'attr_'; - $sHTMLValue = "
sAttCode."\" data-validation=\"untouched\">"; + + $sFilter = addslashes($oAllowedValues->GetFilter()->ToOQL()); if ($this->bSearchMode) { $sWizHelper = 'null'; @@ -183,8 +184,12 @@ class UIExtKeyWidget $bDoSearch = !utils::IsHighCardinality($this->sTargetClass); $sJSDoSearch = $bDoSearch ? 'true' : 'false'; + $bIsAutocomplete = $oAllowedValues->CountExceeds($iMaxComboLength); + $sWrapperCssClass = $bIsAutocomplete ? 'ibo-input-select-autocomplete-wrapper' : 'ibo-input-select-wrapper'; + $sHTMLValue = "
sAttCode."\" data-validation=\"untouched\">"; + // We just need to compare the number of entries with MaxComboLength, so no need to get the real count. - if (!$oAllowedValues->CountExceeds($iMaxComboLength)) { + if (!$bIsAutocomplete) { // Discrete list of values, use a SELECT or RADIO buttons depending on the config $sHelpText = ''; //$this->oAttDef->GetHelpOnEdition(); //$sHTMLValue .= "
\n"; diff --git a/css/backoffice/components/input/_input-select.scss b/css/backoffice/components/input/_input-select.scss index a1154a000..a2f30b3a7 100644 --- a/css/backoffice/components/input/_input-select.scss +++ b/css/backoffice/components/input/_input-select.scss @@ -24,11 +24,12 @@ $ibo-input-select-wrapper--after--color: $ibo-color-grey-900 !default; $ibo-input-select--action-button--height: 28px !default; $ibo-input-select--action-button--width: 23px !default; $ibo-input-select--action-button--margin-top: 0px !default; -$ibo-input-select--action-button--margin-right: 20px !default; +$ibo-input-select--action-button--margin-right: 3px !default; $ibo-input-select--action-button--background-color: inherit !default; $ibo-input-select--action-button--color: $ibo-color-grey-800 !default; $ibo-input-select--action-button--padding-x: 2px !default; $ibo-input-select--action-button--padding-y: 0px !default; +$ibo-input-select--select-wrapper--action-button--margin-right: 20px !default; $ibo-input-select--action-button--padding-left: 6px !default; $ibo-input-select--action-button--padding-right: 2px !default; @@ -113,7 +114,7 @@ $ibo-input-select--action-button--padding-right: 2px !default; display: flex; } -.ibo-input-select-wrapper--with-buttons::after { +.ibo-input-select-wrapper--with-buttons:not(.ibo-input-select-autocomplete-wrapper)::after { position: absolute; content: "\f0d7"; font-family: "Font Awesome 5 Free"; @@ -152,7 +153,10 @@ $ibo-input-select--action-button--padding-right: 2px !default; -ms-transition: all 200ms ease-in-out; -o-transition: all 200ms ease-in-out; transition: all 200ms ease-in-out; +} +.ibo-input-select-wrapper .ibo-input-select--action-buttons{ + margin-right: $ibo-input-select--select-wrapper--action-button--margin-right; } .ibo-input-select--action-button {