@tecsinapse/react-web-kit 3.4.7 → 3.4.8
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/dist/cjs/components/molecules/Menubar/SearchResultItem/utils.js +1 -0
- package/dist/cjs/components/molecules/Menubar/utils.js +3 -1
- package/dist/esm/components/molecules/Menubar/SearchResultItem/utils.js +1 -1
- package/dist/esm/components/molecules/Menubar/utils.js +3 -1
- package/dist/types/components/molecules/Menubar/SearchResultItem/utils.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var utils = require('./SearchResultItem/utils.js');
|
|
4
|
+
|
|
3
5
|
const filterAndTransform = (options, search) => {
|
|
4
6
|
const normalized = [];
|
|
5
7
|
options.forEach((option) => {
|
|
6
8
|
option.items.forEach((item) => {
|
|
7
|
-
if (item.title.toLowerCase().
|
|
9
|
+
if (utils.normalize(item.title.toLowerCase()).includes(utils.normalize(search.toLowerCase()))) {
|
|
8
10
|
normalized.push({
|
|
9
11
|
title: item.title,
|
|
10
12
|
Component: item.Component,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { normalize } from './SearchResultItem/utils.js';
|
|
2
|
+
|
|
1
3
|
const filterAndTransform = (options, search) => {
|
|
2
4
|
const normalized = [];
|
|
3
5
|
options.forEach((option) => {
|
|
4
6
|
option.items.forEach((item) => {
|
|
5
|
-
if (item.title.toLowerCase().
|
|
7
|
+
if (normalize(item.title.toLowerCase()).includes(normalize(search.toLowerCase()))) {
|
|
6
8
|
normalized.push({
|
|
7
9
|
title: item.title,
|
|
8
10
|
Component: item.Component,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
export declare const normalize: (str: string) => string;
|
|
2
3
|
export declare const stringMatcher: (searchTerm: string, textToReplace: string) => RegExpMatchArray[];
|
|
3
4
|
export declare const highlight: <T>(searchTerm: string, textToReplace: string, Component: React.ElementType, props: T) => React.ReactNode;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tecsinapse/react-web-kit",
|
|
3
3
|
"description": "React components library for web",
|
|
4
|
-
"version": "3.4.
|
|
4
|
+
"version": "3.4.8",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
7
7
|
"module": "dist/esm/index.js",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"react-dom": ">=18.0.0",
|
|
41
41
|
"react-native-web": ">=0.18.0 <1"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "1a1832667a3459af70db9f31e70fb4bebb10a03f"
|
|
44
44
|
}
|