diff --git a/ext/search_kit/Civi/Api4/Action/SearchDisplay/GetDefault.php b/ext/search_kit/Civi/Api4/Action/SearchDisplay/GetDefault.php index 9ae2d8ad6dfd..56dc8967b975 100644 --- a/ext/search_kit/Civi/Api4/Action/SearchDisplay/GetDefault.php +++ b/ext/search_kit/Civi/Api4/Action/SearchDisplay/GetDefault.php @@ -72,6 +72,7 @@ public function _run(\Civi\Api4\Generic\Result $result) { 'show_count' => TRUE, 'expose_limit' => TRUE, ], + 'placeholder' => 5, 'sort' => [], 'columns' => [], ], diff --git a/ext/search_kit/ang/crmSearchAdmin/displays/common/searchAdminPlaceholderConfig.component.js b/ext/search_kit/ang/crmSearchAdmin/displays/common/searchAdminPlaceholderConfig.component.js new file mode 100644 index 000000000000..452945487399 --- /dev/null +++ b/ext/search_kit/ang/crmSearchAdmin/displays/common/searchAdminPlaceholderConfig.component.js @@ -0,0 +1,27 @@ +(function(angular, $, _) { + "use strict"; + + angular.module('crmSearchAdmin').component('searchAdminPlaceholderConfig', { + bindings: { + display: '<', + }, + templateUrl: '~/crmSearchAdmin/displays/common/searchAdminPlaceholderConfig.html', + controller: function($scope) { + var ts = $scope.ts = CRM.ts('org.civicrm.search_kit'), + ctrl = this; + + this.$onInit = function() { + // Legacy support + if (!('placeholder' in this.display.settings)) { + this.display.settings.placeholder = 5; + } + }; + + this.togglePlaceholder = function() { + this.display.settings.placeholder = this.display.settings.placeholder ? 0 : 5; + }; + + } + }); + +})(angular, CRM.$, CRM._); diff --git a/ext/search_kit/ang/crmSearchAdmin/displays/common/searchAdminPlaceholderConfig.html b/ext/search_kit/ang/crmSearchAdmin/displays/common/searchAdminPlaceholderConfig.html new file mode 100644 index 000000000000..a988a9060960 --- /dev/null +++ b/ext/search_kit/ang/crmSearchAdmin/displays/common/searchAdminPlaceholderConfig.html @@ -0,0 +1,9 @@ +
+
+ + +
+
diff --git a/ext/search_kit/ang/crmSearchAdmin/displays/searchAdminDisplayGrid.html b/ext/search_kit/ang/crmSearchAdmin/displays/searchAdminDisplayGrid.html index f08c98c63376..a614443acdb5 100644 --- a/ext/search_kit/ang/crmSearchAdmin/displays/searchAdminDisplayGrid.html +++ b/ext/search_kit/ang/crmSearchAdmin/displays/searchAdminDisplayGrid.html @@ -11,6 +11,7 @@
+
diff --git a/ext/search_kit/ang/crmSearchAdmin/displays/searchAdminDisplayList.html b/ext/search_kit/ang/crmSearchAdmin/displays/searchAdminDisplayList.html index 3561df20b923..57a5dbac5c81 100644 --- a/ext/search_kit/ang/crmSearchAdmin/displays/searchAdminDisplayList.html +++ b/ext/search_kit/ang/crmSearchAdmin/displays/searchAdminDisplayList.html @@ -15,6 +15,7 @@
+
diff --git a/ext/search_kit/ang/crmSearchAdmin/displays/searchAdminDisplayTable.html b/ext/search_kit/ang/crmSearchAdmin/displays/searchAdminDisplayTable.html index 99971ebbb03a..f45b49342e46 100644 --- a/ext/search_kit/ang/crmSearchAdmin/displays/searchAdminDisplayTable.html +++ b/ext/search_kit/ang/crmSearchAdmin/displays/searchAdminDisplayTable.html @@ -28,6 +28,7 @@ +
diff --git a/ext/search_kit/ang/crmSearchDisplay/traits/searchDisplayBaseTrait.service.js b/ext/search_kit/ang/crmSearchDisplay/traits/searchDisplayBaseTrait.service.js index 9014c30393d5..9f4a63c33ab4 100644 --- a/ext/search_kit/ang/crmSearchDisplay/traits/searchDisplayBaseTrait.service.js +++ b/ext/search_kit/ang/crmSearchDisplay/traits/searchDisplayBaseTrait.service.js @@ -21,6 +21,11 @@ this.limit = this.settings.limit; this.sort = this.settings.sort ? _.cloneDeep(this.settings.sort) : []; this.seed = Date.now(); + this.placeholders = []; + var placeholderCount = 'placeholder' in this.settings ? this.settings.placeholder : 5; + for (var p=0; p < placeholderCount; ++p) { + this.placeholders.push({}); + } this.getResults = _.debounce(function() { $scope.$apply(function() { diff --git a/ext/search_kit/ang/crmSearchDisplayGrid/crmSearchDisplayGridLoading.html b/ext/search_kit/ang/crmSearchDisplayGrid/crmSearchDisplayGridLoading.html index b63dd058f7fa..40b5a4614443 100644 --- a/ext/search_kit/ang/crmSearchDisplayGrid/crmSearchDisplayGridLoading.html +++ b/ext/search_kit/ang/crmSearchDisplayGrid/crmSearchDisplayGridLoading.html @@ -1,4 +1,4 @@ -
+
diff --git a/ext/search_kit/ang/crmSearchDisplayList/crmSearchDisplayListLoading.html b/ext/search_kit/ang/crmSearchDisplayList/crmSearchDisplayListLoading.html index af84f53ea46e..9a669b9284dc 100644 --- a/ext/search_kit/ang/crmSearchDisplayList/crmSearchDisplayListLoading.html +++ b/ext/search_kit/ang/crmSearchDisplayList/crmSearchDisplayListLoading.html @@ -1,4 +1,4 @@ -
  • +
  • diff --git a/ext/search_kit/ang/crmSearchDisplayTable/crmSearchDisplayTableLoading.html b/ext/search_kit/ang/crmSearchDisplayTable/crmSearchDisplayTableLoading.html index 8054df17d46b..f0a0d2ed5a1e 100644 --- a/ext/search_kit/ang/crmSearchDisplayTable/crmSearchDisplayTableLoading.html +++ b/ext/search_kit/ang/crmSearchDisplayTable/crmSearchDisplayTableLoading.html @@ -1,5 +1,5 @@ - + diff --git a/ext/search_kit/css/crmSearchDisplay.css b/ext/search_kit/css/crmSearchDisplay.css index 1438c50815de..095115e4946e 100644 --- a/ext/search_kit/css/crmSearchDisplay.css +++ b/ext/search_kit/css/crmSearchDisplay.css @@ -26,7 +26,7 @@ width: 80%; position: relative; overflow: hidden; - background-color: rgba(0,0,0,.04); + background-color: rgba(0,0,0,.03); display: inline-block; } #bootstrap-theme .crm-search-loading-placeholder::before { @@ -37,7 +37,7 @@ top: 0; height: 100%; width: 150px; - background: linear-gradient(to right, transparent 0%, rgba(0,0,0,.1) 50%, transparent 100%); + background: linear-gradient(to right, transparent 0%, rgba(0,0,0,.05) 50%, transparent 100%); animation: searchKitLoadingAnimation 1s cubic-bezier(0.4, 0.0, 0.2, 1) infinite; } @keyframes searchKitLoadingAnimation {