@douyinfe/semi-foundation 2.87.0-beta.0 → 2.88.0-alpha.1-exact

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.
@@ -10,7 +10,9 @@ export interface JsonViewerAdapter<P = Record<string, any>, S = Record<string, a
10
10
  notifyHover: (value: string, el: HTMLElement) => HTMLElement | undefined;
11
11
  setSearchOptions: (key: string) => void;
12
12
  showSearchBar: () => void;
13
- notifyCustomRender: (customRenderMap: Map<HTMLElement, any>) => void
13
+ notifyCustomRender: (customRenderMap: Map<HTMLElement, any>) => void;
14
+ notifyFocus: (e: Event) => void;
15
+ notifyBlur: (e: Event) => void
14
16
  }
15
17
 
16
18
  class JsonViewerFoundation extends BaseFoundation<JsonViewerAdapter> {
@@ -37,7 +39,12 @@ class JsonViewerFoundation extends BaseFoundation<JsonViewerAdapter> {
37
39
  this.search(this._adapter.getSearchRef().value);
38
40
  }
39
41
  });
40
-
42
+ this.jsonViewer.emitter.on('focus', (e) => {
43
+ this._adapter.notifyFocus(e);
44
+ });
45
+ this.jsonViewer.emitter.on('blur', (e) => {
46
+ this._adapter.notifyBlur(e);
47
+ });
41
48
  }
42
49
 
43
50
  search(searchText: string, caseSensitive?: boolean, wholeWord?: boolean, regex?: boolean) {
@@ -9,6 +9,8 @@ export interface JsonViewerAdapter<P = Record<string, any>, S = Record<string, a
9
9
  setSearchOptions: (key: string) => void;
10
10
  showSearchBar: () => void;
11
11
  notifyCustomRender: (customRenderMap: Map<HTMLElement, any>) => void;
12
+ notifyFocus: (e: Event) => void;
13
+ notifyBlur: (e: Event) => void;
12
14
  }
13
15
  declare class JsonViewerFoundation extends BaseFoundation<JsonViewerAdapter> {
14
16
  constructor(adapter: JsonViewerAdapter);
@@ -30,6 +30,12 @@ class JsonViewerFoundation extends _foundation.default {
30
30
  this.search(this._adapter.getSearchRef().value);
31
31
  }
32
32
  });
33
+ this.jsonViewer.emitter.on('focus', e => {
34
+ this._adapter.notifyFocus(e);
35
+ });
36
+ this.jsonViewer.emitter.on('blur', e => {
37
+ this._adapter.notifyBlur(e);
38
+ });
33
39
  }
34
40
  search(searchText, caseSensitive, wholeWord, regex) {
35
41
  var _a;
@@ -9,6 +9,8 @@ export interface JsonViewerAdapter<P = Record<string, any>, S = Record<string, a
9
9
  setSearchOptions: (key: string) => void;
10
10
  showSearchBar: () => void;
11
11
  notifyCustomRender: (customRenderMap: Map<HTMLElement, any>) => void;
12
+ notifyFocus: (e: Event) => void;
13
+ notifyBlur: (e: Event) => void;
12
14
  }
13
15
  declare class JsonViewerFoundation extends BaseFoundation<JsonViewerAdapter> {
14
16
  constructor(adapter: JsonViewerAdapter);
@@ -23,6 +23,12 @@ class JsonViewerFoundation extends BaseFoundation {
23
23
  this.search(this._adapter.getSearchRef().value);
24
24
  }
25
25
  });
26
+ this.jsonViewer.emitter.on('focus', e => {
27
+ this._adapter.notifyFocus(e);
28
+ });
29
+ this.jsonViewer.emitter.on('blur', e => {
30
+ this._adapter.notifyBlur(e);
31
+ });
26
32
  }
27
33
  search(searchText, caseSensitive, wholeWord, regex) {
28
34
  var _a;
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.87.0-beta.0",
3
+ "version": "2.88.0-alpha.1-exact",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build:lib": "node ./scripts/compileLib.js",
7
7
  "prepublishOnly": "npm run build:lib"
8
8
  },
9
9
  "dependencies": {
10
- "@douyinfe/semi-animation": "2.87.0-beta.0",
11
- "@douyinfe/semi-json-viewer-core": "2.87.0-beta.0",
10
+ "@douyinfe/semi-animation": "^2.88.0-alpha.1-exact",
11
+ "@douyinfe/semi-json-viewer-core": "^2.88.0-alpha.1-exact",
12
12
  "@mdx-js/mdx": "^3.0.1",
13
13
  "async-validator": "^3.5.0",
14
14
  "classnames": "^2.2.6",
@@ -29,7 +29,7 @@
29
29
  "*.scss",
30
30
  "*.css"
31
31
  ],
32
- "gitHead": "0c83570b175e9797e8333124fa4d3134ead4a1c5",
32
+ "gitHead": "0f89092207f340633c04b8dc9ed4e08cb5fed4f4",
33
33
  "devDependencies": {
34
34
  "@babel/plugin-transform-runtime": "^7.15.8",
35
35
  "@babel/preset-env": "^7.15.8",