@taiga-ui/addon-doc 3.45.0-canary.019e39b → 3.45.0-canary.1c27922
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.
- package/bundles/taiga-ui-addon-doc-components.umd.js +7 -4
- package/bundles/taiga-ui-addon-doc-components.umd.js.map +1 -1
- package/esm2015/components/navigation/navigation.component.js +8 -5
- package/fesm2015/taiga-ui-addon-doc-components.js +7 -4
- package/fesm2015/taiga-ui-addon-doc-components.js.map +1 -1
- package/package.json +1 -1
|
@@ -1603,7 +1603,7 @@
|
|
|
1603
1603
|
this.openPagesGroupsArr = [];
|
|
1604
1604
|
this.active = '';
|
|
1605
1605
|
this.search = new i5.FormControl('');
|
|
1606
|
-
this.filtered$ = i6.tuiControlValue(this.search).pipe(operators.filter(function (search) { return search.length > 2; }), operators.map(function (search) { return _this.filterItems(_this.flattenSubPages(_this.items), search); }));
|
|
1606
|
+
this.filtered$ = i6.tuiControlValue(this.search).pipe(operators.filter(function (search) { return search.trim().length > 2; }), operators.map(function (search) { return _this.filterItems(_this.flattenSubPages(_this.items), search); }));
|
|
1607
1607
|
this.mode$ = this.mode.change$.pipe(operators.startWith(null), operators.map(function () { return _this.mode.mode || 'onLight'; }));
|
|
1608
1608
|
// Angular can't navigate no anchor links
|
|
1609
1609
|
// https://stackoverflow.com/questions/36101756/angular2-routing-with-hashtag-to-page-anchor
|
|
@@ -1650,14 +1650,17 @@
|
|
|
1650
1650
|
TuiDocNavigationComponent.prototype.filterItems = function (items, search) {
|
|
1651
1651
|
return items.map(function (section) { return i6.tuiUniqBy(section.filter(function (_c) {
|
|
1652
1652
|
var title = _c.title, _d = _c.keywords, keywords = _d === void 0 ? '' : _d;
|
|
1653
|
-
|
|
1654
|
-
search = search.toLowerCase();
|
|
1653
|
+
search = search.toLowerCase().trim();
|
|
1655
1654
|
keywords = keywords.toLowerCase();
|
|
1655
|
+
title = title.toLowerCase();
|
|
1656
1656
|
return (title.includes(search) ||
|
|
1657
1657
|
keywords.includes(search) ||
|
|
1658
1658
|
title.includes(utils.tuiTransliterateKeyboardLayout(search)) ||
|
|
1659
1659
|
keywords.includes(utils.tuiTransliterateKeyboardLayout(search)) ||
|
|
1660
|
-
search.replace(/-/gi, '').includes(title)
|
|
1660
|
+
search.replace(/-/gi, '').includes(title) ||
|
|
1661
|
+
title.includes(search.replace(/\s|tui/g, '')) ||
|
|
1662
|
+
keywords.includes(search.replace(/\s|tui/g, '')) ||
|
|
1663
|
+
search.split(/\s/).find(function (word) { return title.includes(word); }));
|
|
1661
1664
|
}), 'title'); });
|
|
1662
1665
|
};
|
|
1663
1666
|
TuiDocNavigationComponent.prototype.flattenSubPages = function (items) {
|