@resconet/jsbridge 18.1.0 → 18.2.0-beta.2

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": "@resconet/jsbridge",
3
- "version": "18.1.0",
3
+ "version": "18.2.0-beta.2",
4
4
  "main": "./src/JSBridge.js",
5
5
  "types": "./src/JSBridge.d.ts",
6
6
  "description": "Install npm JSBridge module",
package/src/JSBridge.d.ts CHANGED
@@ -1121,7 +1121,14 @@ declare namespace MobileCRM {
1121
1121
  class Questionnaire {
1122
1122
  static getQuestionName(name: string, repeatIndex: number): string;
1123
1123
  static getGroupName(name: string, repeatIndex: number): string;
1124
- static showForm(id: string, failed?: (err: string) => void, scope?: any, relationship?: MobileCRM.Relationship);
1124
+ static showForm(
1125
+ id: string,
1126
+ failed?: (err: string) => void,
1127
+ scope?: any,
1128
+ relationship?: MobileCRM.Relationship,
1129
+ modal?: boolean,
1130
+ version?: number
1131
+ ): void;
1125
1132
  }
1126
1133
  }
1127
1134
  /**
@@ -1886,13 +1893,21 @@ declare module MobileCRM.UI {
1886
1893
  startEditItem(index: number);
1887
1894
  /**
1888
1895
  * @since 9.1
1889
- * Changes the data source for ComboBoxItem {MobileCRM.UI.DetailViewItems.ComboBoxItem}.</see>.
1896
+ * Changes the data source for ComboBoxItem {MobileCRM.UI.DetailViewItems.ComboBoxItem}.
1890
1897
  * @param index Item index on the view.
1891
1898
  * @param listDataSource The data source object (e.g. {label1 : 1, label2 : 2}).
1892
1899
  * @param defaultValue New data source default value. If not defined, the first item from listDataSource will be used.
1893
1900
  * @param valueType Type of list data source element value. Default is string, allowed int, string.
1894
1901
  */
1895
1902
  updateComboItemDataSource(index: number, listDataSource: any, defaultValue?: string, valueType?: string);
1903
+ /**
1904
+ * @since 18.1
1905
+ * Filters allowed StringList options in LinkItem {MobileCRM.UI.DetailViewItems.LinkItem}.
1906
+ * @param index Item index on the view.
1907
+ * @param allowedOptions An array with options to be allowed (e.g. ["Option1", "Option2"]).
1908
+ * @param defaultValue New data source default value. If not defined, the first item from allowedOptions will be used. Ignored, if value isn't in allowedOptions.
1909
+ */
1910
+ filterStringListOptions(index: number, allowedOptions: string[], defaultValue?: string);
1896
1911
  /**
1897
1912
  * @since 10.1
1898
1913
  * Changes the data source for MobileCRM.UI.DetailViewItems.ComboBoxItem.
package/src/JSBridge.js CHANGED
@@ -3915,7 +3915,7 @@
3915
3915
  /// <param name="index" type="Number">Item index on the view.</param>
3916
3916
  /// <param name="listDataSource" type="Object">The data source object (e.g. {&quot;label1&quot;:1, &quot;label2&quot;:2}).</param>
3917
3917
  /// <param name="valueType" type="String">Type of list data source element value. Default is string, allowed int, string.</param>
3918
- /// <param name="defaultValue" type="String">New data source default value. If not defined, the first item from listDataSource will be used.</param>
3918
+ /// <param name="defaultValue" type="String|Number">New data source default value. If not defined, the first item from listDataSource will be used.</param>
3919
3919
  var data = {
3920
3920
  action: "updateDataSource",
3921
3921
  viewName: this.name,
@@ -3928,6 +3928,20 @@
3928
3928
  //this.items[index].value = defaultValue !== undefined ? defaultValue : listDataSource[Object.keys(listDataSource)[0]];
3929
3929
  MobileCRM.bridge.command("detailViewAction", JSON.stringify(data));
3930
3930
  };
3931
+ MobileCRM.UI._DetailView.prototype.filterStringListOptions = function (index, allowedOptions, defaultValue) {
3932
+ /// <summary>[v18.1] Filters allowed StringList options in <see cref="MobileCRM.UI.DetailViewItems.Item">MobileCRM.UI.DetailViewItems.LinkItem</see>.</summary>
3933
+ /// <param name="index" type="Number">Item index on the view.</param>
3934
+ /// <param name="allowedOptions" type="string[]">An array with options to be allowed (e.g. [&quot;New&quot;, &quot;Completed&quot;]).</param>
3935
+ /// <param name="defaultValue" type="String">New data source default value. If not defined, the first item from allowedOptions will be used. Ignored, if value isn&apos;t in allowedOptions.</param>
3936
+ var data = {
3937
+ action: "filterStringList",
3938
+ viewName: this.name,
3939
+ index: index,
3940
+ filterOptions: allowedOptions,
3941
+ value: defaultValue || allowedOptions[0],
3942
+ };
3943
+ MobileCRM.bridge.command("detailViewAction", JSON.stringify(data));
3944
+ };
3931
3945
  MobileCRM.UI._DetailView.prototype.updateLinkItemViews = function (index, dialogSetup, inlinePickSetup, dialogOnly, allowCreateNew) {
3932
3946
  /// <summary>[v10.1] Changes the <see cref="MobileCRM.UI.DetailViewItems.ComboBoxItem">ComboBoxItem</see> views and/or filters.</summary>
3933
3947
  /// <param name="index" type="Number">Item index on the view.</param>
@@ -4570,13 +4584,15 @@
4570
4584
  MobileCRM.bridge.command("showMobileReportForm", JSON.stringify(params), null, failed, scope);
4571
4585
  };
4572
4586
  // MobileCRM.UI.Questionnaire
4573
- MobileCRM.Questionnaire.showForm = function (id, failed, scope, relationship) {
4587
+ MobileCRM.Questionnaire.showForm = function (id, failed, scope, relationship, modal, version) {
4574
4588
  /// <summary>[v10.2] Shows the questionnaire form.</summary>
4575
4589
  /// <param name="id" type="String">Id (guid) of the questionnaire.</param>
4576
4590
  /// <param name="failed" type="function(errorMsg)">A callback which is called in case of error.</param>
4577
4591
  /// <param name="scope" type="Object">The scope for callbacks.</param>
4578
4592
  /// <param name="relationship" type="MobileCRM.Relationship">Optional relationship with the parent record.</param>
4579
- var params = { id: id, relationship: relationship };
4593
+ /// <param name="modal" type="Boolean">Optional parameter determines if the form will be opened in modal dialog. Defaults to false.</param>
4594
+ /// <param name="version" type="Integer">Optional parameter for setting the Questionnaire player version to execute the questionnaire. Default is 1</param>
4595
+ var params = { id: id, relationship: relationship, modal: modal, version: version };
4580
4596
  MobileCRM.bridge.command("showQuestionnaire", JSON.stringify(params), null, failed, scope);
4581
4597
  };
4582
4598
  MobileCRM.Questionnaire._padTo3digits = function (num) {