@integry/sdk 4.5.10 → 4.5.11

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.
@@ -363,6 +363,7 @@ const MultipurposeField = (props: MultipurposeFieldProps) => {
363
363
  };
364
364
 
365
365
  const onTagClick = (tag: string) => {
366
+ console.log('tag', tag);
366
367
  if (tagify) {
367
368
  if (!allowTagsInText) {
368
369
  tagify.removeAllTags();
@@ -679,6 +680,7 @@ const MultipurposeField = (props: MultipurposeFieldProps) => {
679
680
  ? true
680
681
  : false}
681
682
  refreshRootStepData=${refreshRootStepData}
683
+ tagsComponent=${tagsComponent}
682
684
  />
683
685
  </div>`}
684
686
  </div>
@@ -3,19 +3,69 @@ import cx from 'classnames';
3
3
 
4
4
  import { Hint } from '@/components/Tooltip';
5
5
  import { ThreeDotLoader } from '@/components/ThreeDotLoader';
6
+ import { TagOptions } from '@/components/MultipurposeField/TagOptions';
6
7
 
7
8
  import styles from './styles.module.scss';
8
9
 
9
10
  export interface TestProps {
10
- label: string;
11
+ tags: any;
12
+ onSelect: (tag: any) => void;
11
13
  }
12
14
 
13
15
  /**
14
16
  * Test component
15
17
  *
16
18
  */
17
- export const Test = (props: TestProps) => {
18
- const { label, ...restOfProps } = props;
19
+ export const TestComponent = (props: TestProps) => {
20
+ const { tags, onSelect, ...restOfProps } = props;
21
+ const tagsLocal: any = {
22
+ FirstName: 'John',
23
+ LastName: 'Doe',
24
+ Gender: 'male',
25
+ Age: 20,
26
+ DateOfBirth: '1990-01-01',
27
+ Email: 'johndoe@example.com',
28
+ Phone: '555-555-1234',
29
+ Address: {
30
+ Street: '123 Main St',
31
+ City: 'New York',
32
+ State: 'NY',
33
+ PostalCode: '10001',
34
+ Country: 'USA',
35
+ },
36
+ PreferredContactMethod: 'email',
37
+ LastContacted: '2023-01-15',
38
+ Twitter: '@johndoe',
39
+ Website: 'https://www.example.com',
40
+ LinkedIn: 'https://www.linkedin.com/in/johndoe',
41
+ Bio: 'John Doe is a software engineer with over 10 years of experience.',
42
+ Relationship: 'professional',
43
+ Tags: ['tech', 'conference', 'networking'],
44
+ JobTitle: 'Software Engineer',
45
+ Company: 'Example Corp.',
46
+ DateCreated: '2023-04-14T12:00:00Z',
47
+ DateUpdated: '2023-04-14T12:00:00Z',
48
+ NextMeeting: {
49
+ Date: '2023-05-01',
50
+ Topic: 'Project Planning',
51
+ Location: 'New York',
52
+ },
53
+ Notes: 'Met at the 2022 Tech Conference in San Francisco.',
54
+ };
19
55
 
20
- return html` <div>Hello world</div> `;
56
+ return html`
57
+ <div>
58
+ ${Object.keys(tagsLocal).map(
59
+ (objKey, index, arr) => html`
60
+ <${TagOptions}
61
+ objectKey="${objKey}"
62
+ keyValue="${objKey}"
63
+ objectData="${tagsLocal[objKey]}"
64
+ onSelect=${onSelect}
65
+ isRoot="${true}"
66
+ />
67
+ `,
68
+ )}
69
+ </div>
70
+ `;
21
71
  };
@@ -48,6 +48,8 @@ interface ActionFormPropsType extends StoreType {
48
48
  accountConnected: boolean;
49
49
  selectedAuthId: string;
50
50
  onFieldChangeCallback?: (fieldId: string, value: string) => void;
51
+ tagsComponent?: any;
52
+ tagsTree?: any;
51
53
  }
52
54
 
53
55
  interface ActionFormStateType {
@@ -1437,13 +1439,19 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
1437
1439
  el.title || el.activity_field?.title
1438
1440
  }
1439
1441
  activityOutputData=${this.arrayToNestedJSONWithFirstValue(
1440
- this.props.activityOutputData,
1442
+ this.props.activityOutputData ||
1443
+ JSONToActivityOutputData(
1444
+ this.props.tagsTree || {},
1445
+ ),
1441
1446
  this.props.dynamicFieldData ||
1442
1447
  this.state.dynamicFieldDataState ||
1443
1448
  {},
1444
1449
  )}
1445
1450
  activityOutputDataRaw=${
1446
- this.props.activityOutputData
1451
+ this.props.activityOutputData ||
1452
+ JSONToActivityOutputData(
1453
+ this.props.tagsTree || {},
1454
+ )
1447
1455
  }
1448
1456
  description=${elDescription}
1449
1457
  value=${
@@ -1527,6 +1535,7 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
1527
1535
  el.data_type === 'STRING[]' ||
1528
1536
  el.data_type === 'NUMBER[]'
1529
1537
  )}
1538
+ tagsComponent=${this.props.tagsComponent}
1530
1539
  ><//>
1531
1540
  </${ConfigureFieldWrapper}>
1532
1541
  </div>
@@ -1824,13 +1833,19 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
1824
1833
  type=${el.activity_field?.type}
1825
1834
  labelTags=${getFieldLabelTags(el, false)}
1826
1835
  activityOutputData=${this.arrayToNestedJSONWithFirstValue(
1827
- this.props.activityOutputData,
1836
+ this.props.activityOutputData ||
1837
+ JSONToActivityOutputData(
1838
+ this.props.tagsTree || {},
1839
+ ),
1828
1840
  this.props.dynamicFieldData ||
1829
1841
  this.state.dynamicFieldDataState ||
1830
1842
  {},
1831
1843
  )}
1832
1844
  activityOutputDataRaw=${
1833
- this.props.activityOutputData
1845
+ this.props.activityOutputData ||
1846
+ JSONToActivityOutputData(
1847
+ this.props.tagsTree || {},
1848
+ )
1834
1849
  }
1835
1850
  isMappable=${el.is_mappable}
1836
1851
  isEditable=${el.is_editable}
@@ -1839,6 +1854,7 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
1839
1854
  refreshRootStepData=${
1840
1855
  this.refreshRootStepData
1841
1856
  }
1857
+ tagsComponent=${this.props.tagsComponent}
1842
1858
  />
1843
1859
 
1844
1860
  </${ConfigureFieldWrapper}>
package/src/index.ts CHANGED
@@ -48,6 +48,7 @@ import FunctionForm from '@/features/common/FunctionForm';
48
48
  import { openPopupWindow } from '@/utils/popup';
49
49
  import { Modal } from '@/components/Modal';
50
50
  import { ListBox } from '@/components/MultipurposeField/Dropdown';
51
+ // import { TestComponent } from '@/components/TestComponent';
51
52
  import { MultipurposeField } from './components/MultipurposeField';
52
53
  import SDKDebugContainer from './features/containers/SDKDebugContainer';
53
54
 
@@ -1988,6 +1989,7 @@ export class IntegryJS {
1988
1989
  step: {},
1989
1990
  connectedAccountId: '',
1990
1991
  tagsComponent: null,
1992
+ tagsTree: {},
1991
1993
  onFieldChangeCallback: () => {
1992
1994
  // Placeholder function for future implementation
1993
1995
  },
@@ -2018,6 +2020,7 @@ export class IntegryJS {
2018
2020
  accountConnected=${true}
2019
2021
  tagsComponent=${options.tagsComponent}
2020
2022
  onFieldChangeCallback=${options.onFieldChangeCallback}
2023
+ tagsTree=${options.tagsTree}
2021
2024
  />
2022
2025
  <//>
2023
2026
  <//>
@@ -295,4 +295,5 @@ export type RenderFlowStepOptions = {
295
295
  connectedAccountId: string;
296
296
  tagsComponent?: any;
297
297
  onFieldChangeCallback: (fieldId: string, value: any) => void;
298
+ tagsTree: any;
298
299
  };