@integry/sdk 4.6.63 → 4.6.65

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.6.63",
3
+ "version": "4.6.65",
4
4
  "description": "Integry SDK",
5
5
  "main": "dist/umd/index.umd.js",
6
6
  "module": "dist/esm/index.csm.js",
@@ -359,7 +359,8 @@ const FieldDropdown = (props: FieldMenuProps) => {
359
359
  <a
360
360
  className=${styles.optionsRefresh}
361
361
  href="#"
362
- onclick=${() => {
362
+ onclick=${(e: Event) => {
363
+ e.preventDefault();
363
364
  if (handleRefreshClick) {
364
365
  setisLoadingOptions(true);
365
366
  handleRefreshClick(() =>
@@ -1557,7 +1557,22 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
1557
1557
  />
1558
1558
  </div>`;
1559
1559
  case 'TEXTFIELD':
1560
- case 'HIDDEN':
1560
+ case 'HIDDEN': {
1561
+ let fieldVal = null;
1562
+ if (this.props.onFieldChangeCallback) {
1563
+ if (
1564
+ Object.prototype.hasOwnProperty.call(
1565
+ this.state.dynamicFieldsData || {},
1566
+ el.activity_field?.machine_name || '',
1567
+ )
1568
+ ) {
1569
+ fieldVal = this.state.dynamicFieldsData[
1570
+ el.activity_field?.machine_name || ''
1571
+ ];
1572
+ } else {
1573
+ fieldVal = el.default_value;
1574
+ }
1575
+ }
1561
1576
  return (
1562
1577
  (this.textFieldParentHasValues(el) ||
1563
1578
  (this.props.userConfig || {}).viewAsIU) &&
@@ -1595,6 +1610,7 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
1595
1610
  }
1596
1611
  description=${elDescription}
1597
1612
  value=${
1613
+ fieldVal ||
1598
1614
  (selectedStepData &&
1599
1615
  selectedStepData[el.id] &&
1600
1616
  selectedStepData[el.id].value &&
@@ -1603,7 +1619,7 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
1603
1619
  selectedStepData[el.id].value) ||
1604
1620
  el.default_value ||
1605
1621
  ''
1606
- }
1622
+ }
1607
1623
  placeholder=${this.getPlaceholder(el)}
1608
1624
  showStepValidation=${showStepValidation}
1609
1625
  regex=${
@@ -1624,10 +1640,14 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
1624
1640
  passesRegexTest?: boolean,
1625
1641
  ) => {
1626
1642
  if (this.props.onFieldChangeCallback) {
1627
- this.props.onFieldChangeCallback(
1628
- el.activity_field?.machine_name || '',
1629
- val,
1630
- );
1643
+ this.onFieldChange({
1644
+ stepId: step.id,
1645
+ fieldId: el.id,
1646
+ value: val,
1647
+ isRequired: el.is_required,
1648
+ machineName:
1649
+ el.activity_field?.machine_name,
1650
+ });
1631
1651
  } else {
1632
1652
  setStepFieldData({
1633
1653
  stepId: `${step.id}`,
@@ -1686,7 +1706,7 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
1686
1706
  </div>
1687
1707
  `
1688
1708
  );
1689
-
1709
+ }
1690
1710
  case 'OBJECT':
1691
1711
  case 'OBJECT[]':
1692
1712
  return (
@@ -1954,7 +1974,22 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
1954
1974
  />
1955
1975
  </div>
1956
1976
  `;
1957
- case 'TEXTAREA':
1977
+ case 'TEXTAREA': {
1978
+ let fieldVal = null;
1979
+ if (this.props.onFieldChangeCallback) {
1980
+ if (
1981
+ Object.prototype.hasOwnProperty.call(
1982
+ this.state.dynamicFieldsData || {},
1983
+ el.activity_field?.machine_name || '',
1984
+ )
1985
+ ) {
1986
+ fieldVal = this.state.dynamicFieldsData[
1987
+ el.activity_field?.machine_name || ''
1988
+ ];
1989
+ } else {
1990
+ fieldVal = el.default_value;
1991
+ }
1992
+ }
1958
1993
  return html`
1959
1994
  <div key=${
1960
1995
  el.id
@@ -1972,6 +2007,7 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
1972
2007
  title=${el.title || el.activity_field?.title}
1973
2008
  description=${elDescription}
1974
2009
  value=${
2010
+ fieldVal ||
1975
2011
  (selectedStepData &&
1976
2012
  selectedStepData[el.id] &&
1977
2013
  selectedStepData[el.id].value &&
@@ -2001,10 +2037,14 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
2001
2037
  passesRegexTest?: boolean,
2002
2038
  ) => {
2003
2039
  if (this.props.onFieldChangeCallback) {
2004
- this.props.onFieldChangeCallback(
2005
- el.activity_field?.machine_name || '',
2006
- val,
2007
- );
2040
+ this.onFieldChange({
2041
+ stepId: step.id,
2042
+ fieldId: el.id,
2043
+ value: val,
2044
+ isRequired: el.is_required,
2045
+ machineName:
2046
+ el.activity_field?.machine_name,
2047
+ });
2008
2048
  } else {
2009
2049
  setStepFieldData({
2010
2050
  stepId: `${step.id}`,
@@ -2060,6 +2100,7 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
2060
2100
  </${ConfigureFieldWrapper}>
2061
2101
  </div>
2062
2102
  `;
2103
+ }
2063
2104
  case 'DATE':
2064
2105
  return html`
2065
2106
  <div