fit-ui 2.4.1 → 2.5.0

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": "fit-ui",
3
- "version": "2.4.1",
3
+ "version": "2.5.0",
4
4
  "title": "Fit.UI",
5
5
  "description": "Object Oriented framework for building rich User Interfaces",
6
6
  "main": "dist/Fit.UI.js",
package/types/index.d.ts CHANGED
@@ -4104,6 +4104,12 @@ declare namespace Fit
4104
4104
  */
4105
4105
  public GetItem(value:string):Fit.Controls.ListViewTypeDefs.ListViewItem | null;
4106
4106
  /**
4107
+ * Get all items - returns array containing objects with Title (string) and Value (string) properties.
4108
+ * @function GetItems
4109
+ * @returns Fit.Controls.ListViewTypeDefs.ListViewItem[]
4110
+ */
4111
+ public GetItems():Fit.Controls.ListViewTypeDefs.ListViewItem[];
4112
+ /**
4107
4113
  * Returns value indicating whether control contains item with specified value.
4108
4114
  * @function HasItem
4109
4115
  * @param {string} value - Value of item to check for.
@@ -4117,6 +4123,23 @@ declare namespace Fit
4117
4123
  */
4118
4124
  constructor(controlId?:string);
4119
4125
  /**
4126
+ * Register event handler fired when item is being selected.
4127
+ Selection can be canceled by returning False.
4128
+ The following arguments are passed to event handler function:
4129
+ Sender (ListView) and Item (with Title (string) and Value (string) properties).
4130
+ * @function OnSelect
4131
+ * @param {Fit.Controls.ListViewTypeDefs.OnSelectEventHandler<this>} cb - Event handler function.
4132
+ */
4133
+ public OnSelect(cb:Fit.Controls.ListViewTypeDefs.OnSelectEventHandler<this>):void;
4134
+ /**
4135
+ * Register event handler fired when item is selected.
4136
+ The following arguments are passed to event handler function:
4137
+ Sender (ListView) and Item (with Title (string) and Value (string) properties).
4138
+ * @function OnSelected
4139
+ * @param {Fit.Controls.ListViewTypeDefs.OnSelectedEventHandler<this>} cb - Event handler function.
4140
+ */
4141
+ public OnSelected(cb:Fit.Controls.ListViewTypeDefs.OnSelectedEventHandler<this>):void;
4142
+ /**
4120
4143
  * Remove item from ListView.
4121
4144
  * @function RemoveItem
4122
4145
  * @param {string} value - Value of item to remove.
@@ -4331,6 +4354,49 @@ declare namespace Fit
4331
4354
  public Render(toElement?:HTMLElement):void;
4332
4355
  }
4333
4356
  /**
4357
+ *
4358
+ * @namespace [Fit.Controls.ListViewTypeDefs ListViewTypeDefs]
4359
+ */
4360
+ namespace ListViewTypeDefs
4361
+ {
4362
+ // Functions defined by Fit.Controls.ListViewTypeDefs
4363
+ /**
4364
+ * OnSelected event handler.
4365
+ * @template TypeOfThis
4366
+ * @callback OnSelectedEventHandler
4367
+ * @param {TypeOfThis} sender - Instance of control.
4368
+ * @param {{ Title: string, Value: string }} item - Selected item.
4369
+ */
4370
+ type OnSelectedEventHandler<TypeOfThis> = (sender:TypeOfThis, item:{ Title: string, Value: string }) => void;
4371
+ /**
4372
+ * OnSelect event handler.
4373
+ * @template TypeOfThis
4374
+ * @callback OnSelectEventHandler
4375
+ * @param {TypeOfThis} sender - Instance of control.
4376
+ * @param {{ Title: string, Value: string }} item - Selected item.
4377
+ * @returns boolean | void
4378
+ */
4379
+ type OnSelectEventHandler<TypeOfThis> = (sender:TypeOfThis, item:{ Title: string, Value: string }) => boolean | void;
4380
+ /**
4381
+ * ListView item.
4382
+ * @class [Fit.Controls.ListViewTypeDefs.ListViewItem ListViewItem]
4383
+ */
4384
+ class ListViewItem
4385
+ {
4386
+ // Properties defined by Fit.Controls.ListViewTypeDefs.ListViewItem
4387
+ /**
4388
+ * Item title.
4389
+ * @member {string} Title
4390
+ */
4391
+ Title:string;
4392
+ /**
4393
+ * Unique item value.
4394
+ * @member {string} Value
4395
+ */
4396
+ Value:string;
4397
+ }
4398
+ }
4399
+ /**
4334
4400
  * Class from which all Picker Controls extend.
4335
4401
  Control developers must override: GetDomElement, Destroy.
4336
4402
  Overriding the following functions is optional:
@@ -6061,6 +6127,12 @@ declare namespace Fit
6061
6127
  */
6062
6128
  public Url(wsUrl?:string):string;
6063
6129
  /**
6130
+ * Get/set value indicating whether control uses the built-in action menu to ease addition and removal of items.
6131
+ * @function UseActionMenu
6132
+ * @param {boolean} [val=undefined] - If defined, True enables the action menu, False disables it.
6133
+ */
6134
+ public UseActionMenu(val?:boolean):void;
6135
+ /**
6064
6136
  * Create instance of WSDropDown control.
6065
6137
  * @function WSDropDown
6066
6138
  * @param {string} [ctlId=undefined] - Unique control ID that can be used to access control using Fit.Controls.Find(..).
@@ -6828,6 +6900,12 @@ declare namespace Fit
6828
6900
  */
6829
6901
  public GetItem(value:string):Fit.Controls.ListViewTypeDefs.ListViewItem | null;
6830
6902
  /**
6903
+ * Get all items - returns array containing objects with Title (string) and Value (string) properties.
6904
+ * @function GetItems
6905
+ * @returns Fit.Controls.ListViewTypeDefs.ListViewItem[]
6906
+ */
6907
+ public GetItems():Fit.Controls.ListViewTypeDefs.ListViewItem[];
6908
+ /**
6831
6909
  * Returns value indicating whether control contains item with specified value.
6832
6910
  * @function HasItem
6833
6911
  * @param {string} value - Value of item to check for.
@@ -6835,6 +6913,23 @@ declare namespace Fit
6835
6913
  */
6836
6914
  public HasItem(value:string):boolean;
6837
6915
  /**
6916
+ * Register event handler fired when item is being selected.
6917
+ Selection can be canceled by returning False.
6918
+ The following arguments are passed to event handler function:
6919
+ Sender (ListView) and Item (with Title (string) and Value (string) properties).
6920
+ * @function OnSelect
6921
+ * @param {Fit.Controls.ListViewTypeDefs.OnSelectEventHandler<this>} cb - Event handler function.
6922
+ */
6923
+ public OnSelect(cb:Fit.Controls.ListViewTypeDefs.OnSelectEventHandler<this>):void;
6924
+ /**
6925
+ * Register event handler fired when item is selected.
6926
+ The following arguments are passed to event handler function:
6927
+ Sender (ListView) and Item (with Title (string) and Value (string) properties).
6928
+ * @function OnSelected
6929
+ * @param {Fit.Controls.ListViewTypeDefs.OnSelectedEventHandler<this>} cb - Event handler function.
6930
+ */
6931
+ public OnSelected(cb:Fit.Controls.ListViewTypeDefs.OnSelectedEventHandler<this>):void;
6932
+ /**
6838
6933
  * Remove item from ListView.
6839
6934
  * @function RemoveItem
6840
6935
  * @param {string} value - Value of item to remove.
@@ -8143,31 +8238,6 @@ declare namespace Fit
8143
8238
  }
8144
8239
  }
8145
8240
  /**
8146
- *
8147
- * @namespace [Fit.Controls.ListViewTypeDefs ListViewTypeDefs]
8148
- */
8149
- namespace ListViewTypeDefs
8150
- {
8151
- /**
8152
- * ListView item.
8153
- * @class [Fit.Controls.ListViewTypeDefs.ListViewItem ListViewItem]
8154
- */
8155
- class ListViewItem
8156
- {
8157
- // Properties defined by Fit.Controls.ListViewTypeDefs.ListViewItem
8158
- /**
8159
- * Item title.
8160
- * @member {string} Title
8161
- */
8162
- Title:string;
8163
- /**
8164
- * Unique item value.
8165
- * @member {string} Value
8166
- */
8167
- Value:string;
8168
- }
8169
- }
8170
- /**
8171
8241
  * Enum values determining visual appearance of button controls.
8172
8242
  * @enum {string}
8173
8243
  */