@rxap/handlebars 21.0.1 → 22.0.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/compodoc/architecture.html +222 -0
  3. package/compodoc/changelog.html +57 -5
  4. package/compodoc/dependencies.html +84 -15
  5. package/compodoc/index.html +46 -5
  6. package/compodoc/js/architecture-graph.js +288 -0
  7. package/compodoc/js/libs/bootstrap-native.js +4 -2
  8. package/compodoc/js/libs/jszip.min.js +13 -0
  9. package/compodoc/js/libs/svg-pan-zoom.min.js +3 -3
  10. package/compodoc/js/libs/tablesort.min.js +3 -3
  11. package/compodoc/js/libs/tablesort.number.min.js +3 -3
  12. package/compodoc/js/libs/vis-network.min.js +78 -0
  13. package/compodoc/js/menu-wc.js +26 -13
  14. package/compodoc/js/menu.js +10 -11
  15. package/compodoc/js/routes/routes_index.js +1 -0
  16. package/compodoc/js/routes.js +142 -34
  17. package/compodoc/js/search/search-lunr.js +6 -8
  18. package/compodoc/js/search/search.js +118 -66
  19. package/compodoc/js/search/search_index.js +2 -2
  20. package/compodoc/js/tabs.js +98 -15
  21. package/compodoc/js/tree.js +44 -7
  22. package/compodoc/license.html +48 -6
  23. package/compodoc/llms.txt +26 -0
  24. package/compodoc/miscellaneous/functions.html +48 -6
  25. package/compodoc/miscellaneous/variables.html +51 -4
  26. package/compodoc/modules.html +44 -3
  27. package/compodoc/overview.html +55 -4
  28. package/compodoc/pipes/HandlebarsPipe.html +86 -10
  29. package/compodoc/properties.html +45 -4
  30. package/compodoc/routes.html +227 -0
  31. package/compodoc/styles/compodoc.css +365 -44
  32. package/compodoc/styles/dark.css +16 -0
  33. package/compodoc/template-playground/default-templates.json +192 -0
  34. package/compodoc/template-playground/hbs-render.service.ts +217 -0
  35. package/compodoc/template-playground/main.ts +9 -0
  36. package/compodoc/template-playground/template-editor.service.ts +173 -0
  37. package/compodoc/template-playground/template-playground.component.ts +614 -0
  38. package/compodoc/template-playground/template-playground.module.ts +29 -0
  39. package/compodoc/template-playground/zip-export.service.ts +86 -0
  40. package/compodoc/template-playground-app/app.js +1389 -0
  41. package/compodoc/template-playground-app/index.html +462 -0
  42. package/compodoc/todo.html +45 -58
  43. package/docs/documentation.json +25 -13
  44. package/docs/html/assets/highlight.css +1 -1
  45. package/docs/html/assets/icons.js +1 -1
  46. package/docs/html/assets/icons.svg +1 -1
  47. package/docs/html/assets/main.js +5 -5
  48. package/docs/html/assets/style.css +265 -228
  49. package/docs/html/classes/HandlebarsPipe.html +84 -3
  50. package/docs/html/hierarchy.html +29 -0
  51. package/docs/html/index.html +40 -4
  52. package/docs/html/modules.html +36 -1
  53. package/docs/markdown/README.md +1 -1
  54. package/docs/markdown/classes/HandlebarsPipe.md +6 -6
  55. package/docs/markdown/globals.md +2 -2
  56. package/docs/wiki/Class.HandlebarsPipe.md +5 -5
  57. package/docs/wiki/globals.md +1 -1
  58. package/fesm2022/rxap-handlebars.mjs +43 -27
  59. package/fesm2022/rxap-handlebars.mjs.map +1 -1
  60. package/package.json +7 -7
  61. package/types/rxap-handlebars.d.ts +10 -10
@@ -1,13 +1,15 @@
1
1
  (function (compodoc) {
2
2
  var usePushState = typeof history.pushState !== 'undefined',
3
3
  // DOM Elements
4
- $body = $('body'),
4
+ $body = document.querySelector('body'),
5
5
  $searchResults,
6
6
  $searchInput,
7
7
  $searchList,
8
8
  $searchTitle,
9
9
  $searchResultsCount,
10
10
  $searchQuery,
11
+ $searchInputs,
12
+ $searchClearButtons,
11
13
  $mainContainer,
12
14
  $xsMenu;
13
15
 
@@ -30,14 +32,18 @@
30
32
  function displayResults(res) {
31
33
  var noResults = res.count == 0;
32
34
  var groups = {};
33
- $searchResults.toggleClass('no-results', noResults);
35
+ if (noResults) {
36
+ $searchResults.classList.add('no-results');
37
+ } else {
38
+ $searchResults.classList.remove('no-results');
39
+ }
34
40
 
35
41
  // Clear old results
36
- $searchList.empty();
42
+ $searchList.innerText = '';
37
43
 
38
44
  // Display title for research
39
- $searchResultsCount.text(res.count);
40
- $searchQuery.text(res.query);
45
+ $searchResultsCount.innerText = res.count;
46
+ $searchQuery.innerText = res.query;
41
47
 
42
48
  // Group result by context
43
49
  res.results.forEach(function (res) {
@@ -56,9 +62,8 @@
56
62
  for (var i = 0; i < sortedGroups.length; i++) {
57
63
  var property = sortedGroups[i];
58
64
 
59
- var $li = $('<li>', {
60
- class: 'search-results-group'
61
- });
65
+ var $li = document.createElement('li');
66
+ $li.classList.add('search-results-group');
62
67
  var finalPropertyLabel = '';
63
68
  var propertyLabels = property.split('-');
64
69
 
@@ -87,20 +92,17 @@
87
92
  groups[property].results.length +
88
93
  ')';
89
94
  }
90
- var $groupTitle = $('<h3>', {
91
- text: finalPropertyLabel
92
- });
93
- $groupTitle.appendTo($li);
95
+ var $groupTitle = document.createElement('h3');
96
+ $groupTitle.innerText = finalPropertyLabel;
97
+ $li.appendChild($groupTitle);
94
98
 
95
- var $ulResults = $('<ul>', {
96
- class: 'search-results-list'
97
- });
99
+ var $ulResults = document.createElement('ul');
100
+ $ulResults.classList.add('search-results-list');
98
101
 
99
102
  groups[property].results.forEach(function (res) {
100
103
  var link = '';
101
- var $liResult = $('<li>', {
102
- class: 'search-results-item'
103
- });
104
+ var $liResult = document.createElement('li');
105
+ $liResult.classList.add('search-results-item');
104
106
  switch (COMPODOC_CURRENT_PAGE_DEPTH) {
105
107
  case 0:
106
108
  link = './';
@@ -116,25 +118,24 @@
116
118
  var finalResLabel =
117
119
  res.title.split(' - ')[1].charAt(0).toUpperCase() +
118
120
  res.title.split(' - ')[1].substring(1);
119
- var $link = $('<a>', {
120
- href: link + res.url,
121
- text: finalResLabel
122
- });
123
- $link.appendTo($liResult);
124
- $liResult.appendTo($ulResults);
121
+ var $link = document.createElement('a');
122
+ $link.innerText = finalResLabel;
123
+ $link.href = link + res.url;
124
+ $liResult.appendChild($link);
125
+ $ulResults.appendChild($liResult);
125
126
  });
126
- $ulResults.appendTo($li);
127
+ $li.appendChild($ulResults);
127
128
 
128
- $li.appendTo($searchList);
129
+ $searchList.appendChild($li);
129
130
  }
130
131
  }
131
132
 
132
133
  function launchSearch(q) {
133
- $body.addClass('with-search');
134
+ $body.classList.add('with-search');
134
135
 
135
- if ($xsMenu.css('display') === 'block') {
136
- $mainContainer.css('height', 'calc(100% - 100px)');
137
- $mainContainer.css('margin-top', '100px');
136
+ if ($xsMenu.style.display === 'block') {
137
+ $mainContainer.style.height = 'calc(100% - 100px)';
138
+ $mainContainer.style.marginTop = '100px';
138
139
  }
139
140
 
140
141
  throttle(
@@ -146,40 +147,71 @@
146
147
  }
147
148
 
148
149
  function closeSearch() {
149
- $body.removeClass('with-search');
150
- if ($xsMenu.css('display') === 'block') {
151
- $mainContainer.css('height', 'calc(100% - 50px)');
150
+ $body.classList.remove('with-search');
151
+ if ($xsMenu.style.display === 'block') {
152
+ $mainContainer.style.height = 'calc(100% - 50px)';
152
153
  }
153
154
  }
154
155
 
155
156
  function bindMenuButton() {
156
157
  document.getElementById('btn-menu').addEventListener('click', function () {
157
- if ($xsMenu.css('display') === 'none') {
158
- $body.removeClass('with-search');
159
- $mainContainer.css('height', 'calc(100% - 50px)');
158
+ if ($xsMenu.style.display === 'none') {
159
+ $body.classList.remove('with-search');
160
+ $mainContainer.style.height = 'calc(100% - 50px)';
160
161
  }
161
- $.each($searchInputs, function (index, item) {
162
- var item = $(item);
163
- item.val('');
162
+ $searchInputs.forEach((item, index) => {
163
+ item.value = '';
164
164
  });
165
+ syncSearchClearButtons();
166
+ });
167
+ }
168
+
169
+ function getSearchInputContainer(element) {
170
+ var current = element;
171
+ while (current && current !== document) {
172
+ if (current.id === 'book-search-input') {
173
+ return current;
174
+ }
175
+ current = current.parentNode;
176
+ }
177
+ return null;
178
+ }
179
+
180
+ function syncSearchClearButtons() {
181
+ if (!$searchInputs || !$searchClearButtons) {
182
+ return;
183
+ }
184
+
185
+ var hasValue = false;
186
+ $searchInputs.forEach((input) => {
187
+ if (input.value && input.value.length > 0) {
188
+ hasValue = true;
189
+ }
190
+ });
191
+
192
+ $searchClearButtons.forEach((button) => {
193
+ button.classList.toggle('is-visible', hasValue);
165
194
  });
166
195
  }
167
196
 
168
197
  function bindSearch() {
169
198
  // Bind DOM
170
- $searchInputs = $('#book-search-input input');
199
+ $searchInputs = document.querySelectorAll('#book-search-input input');
200
+ $searchClearButtons = document.querySelectorAll(
201
+ '#book-search-input [data-search-input-clear]'
202
+ );
171
203
 
172
- $searchResults = $('.search-results');
173
- $searchList = $searchResults.find('.search-results-list');
174
- $searchTitle = $searchResults.find('.search-results-title');
175
- $searchResultsCount = $searchTitle.find('.search-results-count');
176
- $searchQuery = $searchTitle.find('.search-query');
177
- $mainContainer = $('.container-fluid');
178
- $xsMenu = $('.xs-menu');
204
+ $searchResults = document.querySelector('.search-results');
205
+ $searchList = $searchResults.querySelector('.search-results-list');
206
+ $searchTitle = $searchResults.querySelector('.search-results-title');
207
+ $searchResultsCount = $searchTitle.querySelector('.search-results-count');
208
+ $searchQuery = $searchTitle.querySelector('.search-query');
209
+ $mainContainer = document.querySelector('.container-fluid');
210
+ $xsMenu = document.querySelector('.xs-menu');
179
211
 
180
212
  // Launch query based on input content
181
213
  function handleUpdate(item) {
182
- var q = item.val();
214
+ var q = item.value;
183
215
 
184
216
  if (q.length == 0) {
185
217
  closeSearch();
@@ -192,45 +224,65 @@
192
224
  // Detect true content change in search input
193
225
  var propertyChangeUnbound = false;
194
226
 
195
- $.each($searchInputs, function (index, item) {
196
- var item = $(item);
227
+ $searchInputs.forEach((item, index) => {
197
228
  // HTML5 (IE9 & others)
198
- item.on('input', function (e) {
199
- // Unbind propertychange event for IE9+
200
- if (!propertyChangeUnbound) {
201
- $(this).unbind('propertychange');
202
- propertyChangeUnbound = true;
203
- }
204
-
205
- handleUpdate($(this));
229
+ item.addEventListener('input', function (e) {
230
+ handleUpdate(this);
231
+ syncSearchClearButtons();
206
232
  });
207
233
  // Workaround for IE < 9
208
- item.on('propertychange', function (e) {
234
+ item.addEventListener('propertychange', function (e) {
209
235
  if (e.originalEvent.propertyName == 'value') {
210
- handleUpdate($(this));
236
+ handleUpdate(this);
237
+ syncSearchClearButtons();
211
238
  }
212
239
  });
213
240
  // Push to history on blur
214
- item.on('blur', function (e) {
241
+ item.addEventListener('blur', function (e) {
215
242
  // Update history state
216
243
  if (usePushState) {
217
- var uri = updateQueryString('q', $(this).val());
218
- if ($(this).val() !== '') {
244
+ var uri = updateQueryString('q', this.value);
245
+ if (this.value !== '') {
219
246
  history.pushState({ path: uri }, null, uri);
220
247
  }
221
248
  }
222
249
  });
223
250
  });
251
+
252
+ $searchClearButtons.forEach((button) => {
253
+ button.addEventListener('click', function (e) {
254
+ e.preventDefault();
255
+
256
+ var container = getSearchInputContainer(this);
257
+ var containerInput = container ? container.querySelector('input') : null;
258
+ var nextValue = '';
259
+
260
+ $searchInputs.forEach((input) => {
261
+ input.value = nextValue;
262
+ });
263
+
264
+ if (containerInput) {
265
+ handleUpdate(containerInput);
266
+ containerInput.focus();
267
+ } else if ($searchInputs.length > 0) {
268
+ handleUpdate($searchInputs[0]);
269
+ }
270
+
271
+ syncSearchClearButtons();
272
+ });
273
+ });
274
+
275
+ syncSearchClearButtons();
224
276
  }
225
277
 
226
278
  function launchSearchFromQueryString() {
227
279
  var q = getParameterByName('q');
228
280
  if (q && q.length > 0) {
229
281
  // Update search inputs
230
- $.each($searchInputs, function (index, item) {
231
- var item = $(item);
232
- item.val(q);
282
+ $searchInputs.forEach((item, index) => {
283
+ item.value = q;
233
284
  });
285
+ syncSearchClearButtons();
234
286
  // Launch search
235
287
  launchSearch(q);
236
288
  }