ag-common 0.0.427 → 0.0.429

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.
@@ -67,13 +67,13 @@ const SearchBase = (p) => {
67
67
  var _a, _b, _c, _d;
68
68
  const { maxDisplayItems = 20 } = p;
69
69
  const [searchText, setSearchText] = (0, react_1.useState)((_a = p.defaultValue) !== null && _a !== void 0 ? _a : '');
70
- const resWrap = (foundItem) => {
70
+ const resWrap = (foundItem, target) => {
71
71
  var _a, _b;
72
72
  if (!foundItem) {
73
73
  (_a = p.onSelectItem) === null || _a === void 0 ? void 0 : _a.call(p, undefined);
74
74
  }
75
75
  else {
76
- (_b = p.onSelectItem) === null || _b === void 0 ? void 0 : _b.call(p, { foundItem, searchText });
76
+ (_b = p.onSelectItem) === null || _b === void 0 ? void 0 : _b.call(p, { foundItem, searchText, target });
77
77
  }
78
78
  };
79
79
  const filteredItemsRaw = p.displayItems.filter((i) => p.willDisplayItem(searchText, i));
@@ -83,7 +83,7 @@ const SearchBase = (p) => {
83
83
  return (react_1.default.createElement(Base, { className: p.className },
84
84
  react_1.default.createElement(SearchBox_1.SearchBox, Object.assign({}, p, { searchText: searchText, setSearchText: setSearchText })),
85
85
  react_1.default.createElement(Content, { "data-hasitems": !!filteredItems.length, "data-type": "content" },
86
- filteredItems.map((item, index) => (react_1.default.createElement(Row, { key: p.getKeyF(item), onClick: () => resWrap(item) }, p.renderItem({ searchText, item, index })))),
86
+ filteredItems.map((item, index) => (react_1.default.createElement(Row, { key: p.getKeyF(item), onClick: (e) => resWrap(item, e.target) }, p.renderItem({ searchText, item, index })))),
87
87
  searchText && react_1.default.createElement(Row, null, showText))));
88
88
  };
89
89
  exports.SearchBase = SearchBase;
@@ -35,6 +35,7 @@ export interface ISearchDialog<T> {
35
35
  export type TSearchModalRes<T> = undefined | {
36
36
  foundItem: T;
37
37
  searchText: string;
38
+ target: EventTarget;
38
39
  };
39
40
  export type ISearchModal<T> = ISearchDialog<T>;
40
41
  export type ISearchInline<T> = ISearchDialog<T>;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.427",
2
+ "version": "0.0.429",
3
3
  "name": "ag-common",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
@@ -28,11 +28,11 @@
28
28
  "typescript": ">=5"
29
29
  },
30
30
  "devDependencies": {
31
- "@babel/core": "7.21.4",
32
- "@babel/preset-typescript": "^7.21.4",
33
- "@babel/types": "^7.21.4",
34
- "@emotion/react": "11.10.6",
35
- "@emotion/styled": "11.10.6",
31
+ "@babel/core": "7.21.5",
32
+ "@babel/preset-typescript": "^7.21.5",
33
+ "@babel/types": "^7.21.5",
34
+ "@emotion/react": "11.10.8",
35
+ "@emotion/styled": "11.10.8",
36
36
  "@storybook/addon-actions": "7.0.7",
37
37
  "@storybook/addon-docs": "7.0.7",
38
38
  "@storybook/addon-essentials": "7.0.7",
@@ -43,7 +43,7 @@
43
43
  "@storybook/react-webpack5": "7.0.7",
44
44
  "@storybook/theming": "7.0.7",
45
45
  "@types/jsonwebtoken": "9.0.2",
46
- "@types/node": "18.16.1",
46
+ "@types/node": "18.16.3",
47
47
  "@types/react": "18.2.0",
48
48
  "@types/react-dom": "18.2.1",
49
49
  "cross-env": "7.0.3",