@integry/sdk 4.5.27 → 4.5.29

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": "@integry/sdk",
3
- "version": "4.5.27",
3
+ "version": "4.5.29",
4
4
  "description": "Integry SDK",
5
5
  "main": "dist/umd/index.umd.js",
6
6
  "module": "dist/esm/index.csm.js",
@@ -8,6 +8,7 @@ import { isScrolledIntoView } from '@/utils/common';
8
8
  import { searchJSON } from '@/utils/searchJson';
9
9
  import { Input } from '@/components/Input';
10
10
  import { createElement } from 'preact/compat';
11
+ import ReactCompat from 'preact/compat';
11
12
  import { TagOptions } from '../TagOptions';
12
13
  import { ThreeDotLoader } from '../../ThreeDotLoader';
13
14
  import styles from './styles.module.scss';
@@ -212,12 +213,19 @@ const FieldDropdown = (props: FieldMenuProps) => {
212
213
  }
213
214
  }
214
215
 
215
- let tagsComponentRender: any = null;
216
- if (tagsComponent) {
217
- tagsComponentRender = createElement(tagsComponent, {
218
- onSelect: () => alert('Selected!'),
219
- });
220
- }
216
+ const convertReactToPreact = (
217
+ ReactComponent: any,
218
+ propsLocal = {},
219
+ mountNode: any,
220
+ ) => {
221
+ const PreactComponent = ReactCompat.createElement(
222
+ ReactComponent,
223
+ propsLocal,
224
+ );
225
+ ReactCompat.render(PreactComponent, mountNode);
226
+ };
227
+
228
+ const mountNode = document.getElementById('x-integry-container');
221
229
 
222
230
  return html` <div
223
231
  class=${`${styles.tagMenu} ${enableSearch ? styles.tagMenuWithSearch : ''}`}
@@ -344,7 +352,13 @@ const FieldDropdown = (props: FieldMenuProps) => {
344
352
  </div>`
345
353
  : html` <div className="${styles.mappedFieldMenu}">
346
354
  ${tagsComponent
347
- ? html`<div>${tagsComponentRender}</div>`
355
+ ? html`<div>
356
+ ${convertReactToPreact(
357
+ tagsComponent,
358
+ { onSelect: '' },
359
+ mountNode,
360
+ )}
361
+ </div>`
348
362
  : html`${Object.keys(
349
363
  !isEditable ? searchJSON(tags, searchValue) : tags,
350
364
  ).length > 0
package/src/index.ts CHANGED
@@ -2018,7 +2018,7 @@ export class IntegryJS {
2018
2018
  isReadOnly="${false}"
2019
2019
  selectedAuthId="${options.connectedAccountId}"
2020
2020
  accountConnected=${true}
2021
- tagsComponent=${TestComponent}
2021
+ tagsComponent=${options.tagsComponent}
2022
2022
  onFieldChangeCallback=${options.onFieldChangeCallback}
2023
2023
  tagsTree=${options.tagsTree}
2024
2024
  />