kts-component-invoice-operate 1.2.23 → 1.2.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "1.2.23",
3
+ "version": "1.2.26",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -509,6 +509,16 @@ class MyDiv extends React.Component<{ value?: any }> {
509
509
  function formatSearch(value: string, search: string) {
510
510
  if (!value || !search) return value;
511
511
 
512
- const __html = value.split(new RegExp(search, 'g')).join(`<span class="kts-invoice-operate-goods-list-table-search-protrude" >${search}</span>`);
512
+ const __html = ucoding(value).split(new RegExp(ucoding(search), 'g')).map(e => dcoding(e)).join(`<span class="kts-invoice-operate-goods-list-table-search-protrude" >${search}</span>`);
513
513
  return <span dangerouslySetInnerHTML={{ __html }} />
514
514
  }
515
+
516
+ /** 编码 */
517
+ function ucoding(v: string): string {
518
+ return v.split('').map(e => `U${e.charCodeAt(0)}E`).join('');
519
+ }
520
+
521
+ /** 解码 */
522
+ function dcoding(v: string): string {
523
+ return v.split('U').map(e => e ? String.fromCharCode(parseInt(e.replace('E', ''))) : '').join('');
524
+ }
@@ -27,7 +27,7 @@ export default function Search() {
27
27
 
28
28
  React.useEffect(() => {
29
29
  controller.run(async s => {
30
- s.goodsListState.searchValue = value;
30
+ s.goodsListState.searchValue = value.replace(/^ */, '').replace(/ *$/, '');
31
31
  })
32
32
  }, [value, controller])
33
33