diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/forms/umbsearchfilter.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/forms/umbsearchfilter.directive.js new file mode 100644 index 0000000000..7929316275 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/forms/umbsearchfilter.directive.js @@ -0,0 +1,84 @@ +/** +@ngdoc directive +@name umbraco.directives.directive:umbSearchFilter +@restrict E +@scope + +@description +Added in Umbraco version 8.7.0 Use this directive to render an umbraco search filter. + +

Markup example

+
+    
+ + + + +
+
+ +@param {boolean} model Set to true or false to set the checkbox to checked or unchecked. +@param {string} inputId Set the id of the checkbox. +@param {string} text Set the text for the checkbox label. +@param {string} labelKey Set a dictinary/localization string for the checkbox label +@param {callback} onChange Callback when the value of the checkbox change by interaction. +@param {boolean} autoFocus Add autofocus to the input field +@param {boolean} preventSubmitOnEnter Set the enter prevent directive or not + +**/ + +(function () { + 'use strict'; + + function UmbSearchFilterController($timeout, localizationService) { + + var vm = this; + + vm.$onInit = onInit; + vm.change = change; + + function onInit() { + vm.inputId = vm.inputId || "umb-check_" + String.CreateGuid(); + + // If a labelKey is passed let's update the returned text if it's does not contain an opening square bracket [ + if (vm.labelKey) { + localizationService.localize(vm.labelKey).then(function (data) { + if(data.indexOf('[') === -1){ + vm.text = data; + } + }); + } + } + + function change() { + if (vm.onChange) { + $timeout(function () { + vm.onChange({ model: vm.model, value: vm.value }); + }, 0); + } + } + } + + var component = { + templateUrl: 'views/components/forms/umb-search-filter.html', + controller: UmbSearchFilterController, + controllerAs: 'vm', + transclude: true, + bindings: { + model: "=", + inputId: "@", + text: "@", + labelKey: "@?", + onChange: "&?", + autoFocus: " -
- -
+ + diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/macroparameterpicker/macroparameterpicker.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/macroparameterpicker/macroparameterpicker.html index 9f2b56401d..e92ce65bde 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/macroparameterpicker/macroparameterpicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/macroparameterpicker/macroparameterpicker.html @@ -17,20 +17,15 @@ -
- -
+ + diff --git a/src/Umbraco.Web.UI.Client/src/views/components/forms/umb-search-filter.html b/src/Umbraco.Web.UI.Client/src/views/components/forms/umb-search-filter.html new file mode 100644 index 0000000000..0879f9b72c --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/components/forms/umb-search-filter.html @@ -0,0 +1,28 @@ +
+ +
diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/content/redirecturls.html b/src/Umbraco.Web.UI.Client/src/views/dashboard/content/redirecturls.html index f07b7f5e30..d60806e1ac 100644 --- a/src/Umbraco.Web.UI.Client/src/views/dashboard/content/redirecturls.html +++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/content/redirecturls.html @@ -32,22 +32,15 @@
- - + +