jqwidgets-ng 19.2.2 → 20.0.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.
Files changed (189) hide show
  1. package/esm2020/jqxinput/angular_jqxinput.mjs +25 -3
  2. package/fesm2015/jqwidgets-ng-jqxinput.mjs +25 -3
  3. package/fesm2020/jqwidgets-ng-jqxinput.mjs +25 -3
  4. package/jqwidgets/jqx-all.js +13 -13
  5. package/jqwidgets/jqxangular.js +1 -1
  6. package/jqwidgets/jqxbarcode.js +1 -1
  7. package/jqwidgets/jqxbargauge.js +2 -2
  8. package/jqwidgets/jqxbulletchart.js +1 -1
  9. package/jqwidgets/jqxbuttongroup.js +1 -1
  10. package/jqwidgets/jqxbuttons.js +2 -2
  11. package/jqwidgets/jqxcalendar.js +1 -1
  12. package/jqwidgets/jqxchart.annotations.js +1 -1
  13. package/jqwidgets/jqxchart.api.js +1 -1
  14. package/jqwidgets/jqxchart.core.js +1 -1
  15. package/jqwidgets/jqxchart.js +1 -1
  16. package/jqwidgets/jqxchart.rangeselector.js +1 -1
  17. package/jqwidgets/jqxchart.waterfall.js +1 -1
  18. package/jqwidgets/jqxcheckbox.js +1 -1
  19. package/jqwidgets/jqxcheckboxgroup.js +1 -1
  20. package/jqwidgets/jqxcolorpicker.js +1 -1
  21. package/jqwidgets/jqxcombobox.js +1 -1
  22. package/jqwidgets/jqxcomplexinput.js +1 -1
  23. package/jqwidgets/jqxcore.js +1 -1
  24. package/jqwidgets/jqxdata.export.js +1 -1
  25. package/jqwidgets/jqxdata.js +1 -1
  26. package/jqwidgets/jqxdatatable.js +2 -2
  27. package/jqwidgets/jqxdate.js +1 -1
  28. package/jqwidgets/jqxdatetimeinput.js +1 -1
  29. package/jqwidgets/jqxdocking.js +1 -1
  30. package/jqwidgets/jqxdockinglayout.js +1 -1
  31. package/jqwidgets/jqxdockpanel.js +1 -1
  32. package/jqwidgets/jqxdragdrop.js +1 -1
  33. package/jqwidgets/jqxdraw.js +1 -1
  34. package/jqwidgets/jqxdropdownbutton.js +1 -1
  35. package/jqwidgets/jqxdropdownlist.js +2 -2
  36. package/jqwidgets/jqxeditor.js +1 -1
  37. package/jqwidgets/jqxexpander.js +1 -1
  38. package/jqwidgets/jqxfileupload.js +1 -1
  39. package/jqwidgets/jqxform.js +1 -1
  40. package/jqwidgets/jqxformattedinput.js +1 -1
  41. package/jqwidgets/jqxgantt.js +1 -1
  42. package/jqwidgets/jqxgauge.js +1 -1
  43. package/jqwidgets/jqxgrid.aggregates.js +1 -1
  44. package/jqwidgets/jqxgrid.columnsreorder.js +1 -1
  45. package/jqwidgets/jqxgrid.columnsresize.js +1 -1
  46. package/jqwidgets/jqxgrid.edit.js +1 -1
  47. package/jqwidgets/jqxgrid.export.js +1 -1
  48. package/jqwidgets/jqxgrid.filter.js +2 -2
  49. package/jqwidgets/jqxgrid.grouping.js +1 -1
  50. package/jqwidgets/jqxgrid.js +2 -2
  51. package/jqwidgets/jqxgrid.pager.js +1 -1
  52. package/jqwidgets/jqxgrid.selection.js +2 -2
  53. package/jqwidgets/jqxgrid.sort.js +1 -1
  54. package/jqwidgets/jqxgrid.storage.js +1 -1
  55. package/jqwidgets/jqxheatmap.js +1 -1
  56. package/jqwidgets/jqxinput.js +2 -2
  57. package/jqwidgets/jqxkanban.js +2 -2
  58. package/jqwidgets/jqxknob.js +1 -1
  59. package/jqwidgets/jqxknockout.js +1 -1
  60. package/jqwidgets/jqxlayout.js +1 -1
  61. package/jqwidgets/jqxlistbox.js +1 -1
  62. package/jqwidgets/jqxlistmenu.js +1 -1
  63. package/jqwidgets/jqxloader.js +1 -1
  64. package/jqwidgets/jqxmaskedinput.js +1 -1
  65. package/jqwidgets/jqxmenu.js +1 -1
  66. package/jqwidgets/jqxnavbar.js +1 -1
  67. package/jqwidgets/jqxnavigationbar.js +1 -1
  68. package/jqwidgets/jqxnotification.js +1 -1
  69. package/jqwidgets/jqxnumberinput.js +1 -1
  70. package/jqwidgets/jqxpanel.js +1 -1
  71. package/jqwidgets/jqxpasswordinput.js +1 -1
  72. package/jqwidgets/jqxpivot.js +1 -1
  73. package/jqwidgets/jqxpivotdesigner.js +2 -2
  74. package/jqwidgets/jqxpivotgrid.js +1 -1
  75. package/jqwidgets/jqxpopover.js +1 -1
  76. package/jqwidgets/jqxprogressbar.js +1 -1
  77. package/jqwidgets/jqxqrcode.js +1 -1
  78. package/jqwidgets/jqxradiobutton.js +1 -1
  79. package/jqwidgets/jqxradiobuttongroup.js +2 -2
  80. package/jqwidgets/jqxrangeselector.js +1 -1
  81. package/jqwidgets/jqxrating.js +1 -1
  82. package/jqwidgets/jqxresponsivepanel.js +1 -1
  83. package/jqwidgets/jqxribbon.js +1 -1
  84. package/jqwidgets/jqxscheduler.api.js +1 -1
  85. package/jqwidgets/jqxscheduler.js +1 -1
  86. package/jqwidgets/jqxscrollbar.js +1 -1
  87. package/jqwidgets/jqxscrollview.js +1 -1
  88. package/jqwidgets/jqxslider.js +1 -1
  89. package/jqwidgets/jqxsortable.js +1 -1
  90. package/jqwidgets/jqxsplitter.js +1 -1
  91. package/jqwidgets/jqxswitchbutton.js +1 -1
  92. package/jqwidgets/jqxtabs.js +2 -2
  93. package/jqwidgets/jqxtagcloud.js +1 -1
  94. package/jqwidgets/jqxtextarea.js +1 -1
  95. package/jqwidgets/jqxtimeline.js +1 -1
  96. package/jqwidgets/jqxtimepicker.js +1 -1
  97. package/jqwidgets/jqxtoolbar.js +1 -1
  98. package/jqwidgets/jqxtooltip.js +1 -1
  99. package/jqwidgets/jqxtouch.js +1 -1
  100. package/jqwidgets/jqxtree.js +1 -1
  101. package/jqwidgets/jqxtreegrid.js +1 -1
  102. package/jqwidgets/jqxtreemap.js +1 -1
  103. package/jqwidgets/jqxvalidator.js +1 -1
  104. package/jqwidgets/jqxwindow.js +1 -1
  105. package/jqwidgets/modules/jqxbarcode.js +48 -36
  106. package/jqwidgets/modules/jqxbargauge.js +67 -39
  107. package/jqwidgets/modules/jqxbulletchart.js +85 -41
  108. package/jqwidgets/modules/jqxbuttongroup.js +73 -39
  109. package/jqwidgets/modules/jqxbuttons.js +54 -36
  110. package/jqwidgets/modules/jqxcalendar.js +96 -43
  111. package/jqwidgets/modules/jqxchart.js +189 -53
  112. package/jqwidgets/modules/jqxcheckbox.js +92 -42
  113. package/jqwidgets/modules/jqxcheckboxgroup.js +92 -42
  114. package/jqwidgets/modules/jqxcolorpicker.js +111 -45
  115. package/jqwidgets/modules/jqxcombobox.js +149 -51
  116. package/jqwidgets/modules/jqxcomplexinput.js +73 -39
  117. package/jqwidgets/modules/jqxdatatable.js +343 -84
  118. package/jqwidgets/modules/jqxdatetimeinput.js +266 -69
  119. package/jqwidgets/modules/jqxdocking.js +92 -42
  120. package/jqwidgets/modules/jqxdockinglayout.js +167 -53
  121. package/jqwidgets/modules/jqxdockpanel.js +73 -39
  122. package/jqwidgets/modules/jqxdragdrop.js +90 -40
  123. package/jqwidgets/modules/jqxdraw.js +47 -35
  124. package/jqwidgets/modules/jqxdropdownbutton.js +73 -39
  125. package/jqwidgets/modules/jqxdropdownlist.js +248 -67
  126. package/jqwidgets/modules/jqxeditor.js +360 -83
  127. package/jqwidgets/modules/jqxexpander.js +113 -47
  128. package/jqwidgets/modules/jqxfileupload.js +67 -39
  129. package/jqwidgets/modules/jqxform.js +325 -80
  130. package/jqwidgets/modules/jqxformattedinput.js +251 -70
  131. package/jqwidgets/modules/jqxgantt.js +50 -38
  132. package/jqwidgets/modules/jqxgauge.js +110 -44
  133. package/jqwidgets/modules/jqxgrid.js +4452 -3974
  134. package/jqwidgets/modules/jqxheatmap.js +67 -39
  135. package/jqwidgets/modules/jqxinput.js +1263 -989
  136. package/jqwidgets/modules/jqxkanban.js +1557 -1273
  137. package/jqwidgets/modules/jqxknob.js +91 -41
  138. package/jqwidgets/modules/jqxlayout.js +167 -53
  139. package/jqwidgets/modules/jqxlineargauge.js +110 -44
  140. package/jqwidgets/modules/jqxlinkbutton.js +54 -36
  141. package/jqwidgets/modules/jqxlistbox.js +171 -54
  142. package/jqwidgets/modules/jqxlistmenu.js +307 -78
  143. package/jqwidgets/modules/jqxloader.js +48 -36
  144. package/jqwidgets/modules/jqxmaskedinput.js +48 -36
  145. package/jqwidgets/modules/jqxmenu.js +150 -52
  146. package/jqwidgets/modules/jqxnavbar.js +113 -47
  147. package/jqwidgets/modules/jqxnavigationbar.js +188 -58
  148. package/jqwidgets/modules/jqxnotification.js +129 -47
  149. package/jqwidgets/modules/jqxnumberinput.js +187 -57
  150. package/jqwidgets/modules/jqxpanel.js +110 -44
  151. package/jqwidgets/modules/jqxpasswordinput.js +128 -46
  152. package/jqwidgets/modules/jqxpivotdesigner.js +382 -89
  153. package/jqwidgets/modules/jqxpivotgrid.js +382 -89
  154. package/jqwidgets/modules/jqxpopover.js +73 -39
  155. package/jqwidgets/modules/jqxprogressbar.js +48 -36
  156. package/jqwidgets/modules/jqxqrcode.js +106 -46
  157. package/jqwidgets/modules/jqxradiobutongroup.js +93 -43
  158. package/jqwidgets/modules/jqxradiobutton.js +73 -39
  159. package/jqwidgets/modules/jqxrangeselector.js +85 -41
  160. package/jqwidgets/modules/jqxrating.js +73 -39
  161. package/jqwidgets/modules/jqxrepeatbutton.js +54 -36
  162. package/jqwidgets/modules/jqxresponsivepanel.js +67 -39
  163. package/jqwidgets/modules/jqxribbon.js +92 -42
  164. package/jqwidgets/modules/jqxscheduler.js +1572 -971
  165. package/jqwidgets/modules/jqxscrollbar.js +10627 -91161
  166. package/jqwidgets/modules/jqxscrollview.js +72 -38
  167. package/jqwidgets/modules/jqxslider.js +72 -38
  168. package/jqwidgets/modules/jqxsortable.js +72 -38
  169. package/jqwidgets/modules/jqxsplitlayout.js +2022 -2082
  170. package/jqwidgets/modules/jqxsplitter.js +72 -38
  171. package/jqwidgets/modules/jqxswitchbutton.js +109 -43
  172. package/jqwidgets/modules/jqxtabs.js +169 -55
  173. package/jqwidgets/modules/jqxtagcloud.js +128 -46
  174. package/jqwidgets/modules/jqxtextarea.js +128 -46
  175. package/jqwidgets/modules/jqxtimeline.js +48 -36
  176. package/jqwidgets/modules/jqxtimepicker.js +65 -37
  177. package/jqwidgets/modules/jqxtogglebutton.js +54 -36
  178. package/jqwidgets/modules/jqxtoolbar.js +1507 -1032
  179. package/jqwidgets/modules/jqxtooltip.js +47 -35
  180. package/jqwidgets/modules/jqxtree.js +6451 -187
  181. package/jqwidgets/modules/jqxtreegrid.js +361 -86
  182. package/jqwidgets/modules/jqxtreemap.js +84 -40
  183. package/jqwidgets/modules/jqxvalidator.js +109 -43
  184. package/jqwidgets/modules/jqxwindow.js +73 -39
  185. package/jqwidgets/styles/gantt/jqx.gantt.css +98 -98
  186. package/jqwidgets/styles/jqx.base.css +20 -20
  187. package/jqwidgets.d.ts +2 -0
  188. package/jqxinput/angular_jqxinput.d.ts +5 -1
  189. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
 
2
- /* Release Date: 28-May-2024
2
+ /* Release Date: Sep-17-2024
3
3
  Copyright (c) 2011-2024 jQWidgets.
4
4
  License: https://jqwidgets.com/license/ */
5
5
 
@@ -15,6 +15,9 @@ License: https://jqwidgets.com/license/ */
15
15
  /* tslint:disable */
16
16
  /* eslint-disable */
17
17
  (function() {
18
+ if (typeof document === 'undefined') {
19
+ return;
20
+ }
18
21
  /*!
19
22
  * Globalize
20
23
  *
@@ -2211,6 +2214,12 @@ document.Globalize = Globalize;
2211
2214
  that.element.disabled = true;
2212
2215
  that.element.setAttribute('disabled', 'true');
2213
2216
  }
2217
+
2218
+ if (that.textPosition){
2219
+ $.jqx.utilities.resize(this.host, function () {
2220
+ that._positionTextAndImage();
2221
+ });
2222
+ }
2214
2223
  }, // createInstance
2215
2224
 
2216
2225
  resize: function (width, height) {
@@ -2794,7 +2803,23 @@ document.Globalize = Globalize;
2794
2803
  //// End of ToggleButton
2795
2804
 
2796
2805
  })(jqxBaseFramework);
2797
- })();
2806
+ })();
2807
+
2808
+
2809
+
2810
+
2811
+
2812
+
2813
+
2814
+
2815
+
2816
+
2817
+
2818
+
2819
+
2820
+
2821
+
2822
+
2798
2823
 
2799
2824
  /***/ }),
2800
2825
 
@@ -6632,7 +6657,23 @@ document.Globalize = Globalize;
6632
6657
  } // calendar month
6633
6658
 
6634
6659
  })(jqxBaseFramework);
6635
- })();
6660
+ })();
6661
+
6662
+
6663
+
6664
+
6665
+
6666
+
6667
+
6668
+
6669
+
6670
+
6671
+
6672
+
6673
+
6674
+
6675
+
6676
+
6636
6677
 
6637
6678
  /***/ }),
6638
6679
 
@@ -7478,7 +7519,23 @@ document.Globalize = Globalize;
7478
7519
  }
7479
7520
  });
7480
7521
  })(jqxBaseFramework);
7481
- })();
7522
+ })();
7523
+
7524
+
7525
+
7526
+
7527
+
7528
+
7529
+
7530
+
7531
+
7532
+
7533
+
7534
+
7535
+
7536
+
7537
+
7538
+
7482
7539
 
7483
7540
  /***/ }),
7484
7541
 
@@ -8798,7 +8855,23 @@ document.Globalize = Globalize;
8798
8855
  });
8799
8856
 
8800
8857
  })(jqxBaseFramework);
8801
- })();
8858
+ })();
8859
+
8860
+
8861
+
8862
+
8863
+
8864
+
8865
+
8866
+
8867
+
8868
+
8869
+
8870
+
8871
+
8872
+
8873
+
8874
+
8802
8875
 
8803
8876
  /***/ }),
8804
8877
 
@@ -12075,7 +12148,23 @@ document.Globalize = Globalize;
12075
12148
  }
12076
12149
  });
12077
12150
  })(jqxBaseFramework);
12078
- })();
12151
+ })();
12152
+
12153
+
12154
+
12155
+
12156
+
12157
+
12158
+
12159
+
12160
+
12161
+
12162
+
12163
+
12164
+
12165
+
12166
+
12167
+
12079
12168
 
12080
12169
  /***/ }),
12081
12170
 
@@ -23435,6 +23524,22 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* tslint:disabl
23435
23524
  }
23436
23525
  })(jqxBaseFramework);
23437
23526
  })();
23527
+
23528
+
23529
+
23530
+
23531
+
23532
+
23533
+
23534
+
23535
+
23536
+
23537
+
23538
+
23539
+
23540
+
23541
+
23542
+
23438
23543
 
23439
23544
 
23440
23545
  /***/ }),
@@ -28379,7 +28484,23 @@ var saveAs = window.jqxSaveAs = saveAs
28379
28484
 
28380
28485
 
28381
28486
  })(pdfDataExport.API)
28382
- })();
28487
+ })();
28488
+
28489
+
28490
+
28491
+
28492
+
28493
+
28494
+
28495
+
28496
+
28497
+
28498
+
28499
+
28500
+
28501
+
28502
+
28503
+
28383
28504
 
28384
28505
  /***/ }),
28385
28506
 
@@ -34526,7 +34647,23 @@ var saveAs = window.jqxSaveAs = saveAs
34526
34647
  }
34527
34648
  }
34528
34649
  } )( jqxBaseFramework );
34529
- })();
34650
+ })();
34651
+
34652
+
34653
+
34654
+
34655
+
34656
+
34657
+
34658
+
34659
+
34660
+
34661
+
34662
+
34663
+
34664
+
34665
+
34666
+
34530
34667
 
34531
34668
  /***/ }),
34532
34669
 
@@ -36447,7 +36584,23 @@ if (!Array.prototype.filter) {
36447
36584
  return res;
36448
36585
  };
36449
36586
  }
36450
- })();
36587
+ })();
36588
+
36589
+
36590
+
36591
+
36592
+
36593
+
36594
+
36595
+
36596
+
36597
+
36598
+
36599
+
36600
+
36601
+
36602
+
36603
+
36451
36604
 
36452
36605
  /***/ }),
36453
36606
 
@@ -42915,6 +43068,22 @@ if (!Array.prototype.filter) {
42915
43068
  })(jqxBaseFramework);
42916
43069
  })();
42917
43070
 
43071
+
43072
+
43073
+
43074
+
43075
+
43076
+
43077
+
43078
+
43079
+
43080
+
43081
+
43082
+
43083
+
43084
+
43085
+
43086
+
42918
43087
 
42919
43088
 
42920
43089
  /***/ }),
@@ -43644,7 +43813,7 @@ if (!Array.prototype.filter) {
43644
43813
  }
43645
43814
  else self.focus();
43646
43815
 
43647
- event.stopPropagation();
43816
+ // event.stopPropagation();
43648
43817
  }
43649
43818
  }
43650
43819
  }
@@ -45056,7 +45225,23 @@ if (!Array.prototype.filter) {
45056
45225
  }
45057
45226
  });
45058
45227
  })(jqxBaseFramework);
45059
- })();
45228
+ })();
45229
+
45230
+
45231
+
45232
+
45233
+
45234
+
45235
+
45236
+
45237
+
45238
+
45239
+
45240
+
45241
+
45242
+
45243
+
45244
+
45060
45245
 
45061
45246
  /***/ }),
45062
45247
 
@@ -45065,1170 +45250,1416 @@ if (!Array.prototype.filter) {
45065
45250
 
45066
45251
  /* tslint:disable */
45067
45252
  /* eslint-disable */
45068
- (function(){
45069
- if (typeof document === 'undefined') {
45070
- return;
45071
- }
45253
+ (function () {
45254
+ if (typeof document === 'undefined') {
45255
+ return;
45256
+ }
45072
45257
 
45073
- (function ($) {
45074
- 'use strict';
45075
- $.jqx.jqxWidget('jqxInput', '', {});
45258
+ (function ($) {
45259
+ 'use strict';
45260
+ $.jqx.jqxWidget('jqxInput', '', {});
45076
45261
 
45077
- $.extend($.jqx._jqxInput.prototype, {
45078
- defineInstance: function () {
45079
- var that = this;
45080
- var settings = {
45081
- disabled: false,
45082
- filter: that._filter,
45083
- sort: that._sort,
45084
- highlight: that._highlight,
45085
- dropDownWidth: null,
45086
- renderer: that._renderer,
45087
- opened: false,
45088
- $popup: document.createElement('ul'),
45089
- source: [],
45090
- roundedCorners: true,
45091
- searchMode: 'default',
45092
- placeHolder: '',
45093
- width: null,
45094
- height: null,
45095
- value: '',
45096
- rtl: false,
45097
- enableBrowserBoundsDetection: true,
45098
- hint: true,
45099
- displayMember: '',
45100
- valueMember: '',
45101
- events: ['select', 'open', 'close', 'change'],
45102
- popupZIndex: 1000,
45103
- items: 8,
45104
- minLength: 1,
45105
- maxLength: null
45106
- };
45107
- if (this === $.jqx._jqxInput.prototype) {
45262
+ $.extend($.jqx._jqxInput.prototype, {
45263
+ defineInstance: function () {
45264
+ var that = this;
45265
+ var settings = {
45266
+ disabled: false,
45267
+ filter: that._filter,
45268
+ sort: that._sort,
45269
+ highlight: that._highlight,
45270
+ dropDownWidth: null,
45271
+ renderer: that._renderer,
45272
+ opened: false,
45273
+ $popup: document.createElement('ul'),
45274
+ source: [],
45275
+ roundedCorners: true,
45276
+ searchMode: 'default',
45277
+ placeHolder: '',
45278
+ width: null,
45279
+ height: null,
45280
+ value: '',
45281
+ rtl: false,
45282
+ enableBrowserBoundsDetection: true,
45283
+ hint: true,
45284
+ displayMember: '',
45285
+ valueMember: '',
45286
+ inlineAutoComplete: false,
45287
+ events: ['select', 'open', 'close', 'change'],
45288
+ popupZIndex: 1000,
45289
+ items: 8,
45290
+ minLength: 1,
45291
+ maxLength: null,
45292
+ aiKey: ''
45293
+ };
45294
+ if (this === $.jqx._jqxInput.prototype) {
45295
+ return settings;
45296
+ }
45297
+ $.extend(true, this, settings);
45108
45298
  return settings;
45109
- }
45110
- $.extend(true, this, settings);
45111
- return settings;
45112
- },
45113
-
45114
- createInstance: function () {
45115
- var that = this;
45116
- if (that.host.css('display') === 'none' || document.body.contains(that.element) === false) {
45117
- that._initiallyHidden = true;
45118
- }
45119
- that._popupHelper = $(that.$popup);
45120
- that.render();
45121
- },
45299
+ },
45122
45300
 
45123
- render: function () {
45124
- var that = this;
45301
+ createInstance: function () {
45302
+ var that = this;
45303
+ if (that.host.css('display') === 'none' || document.body.contains(that.element) === false) {
45304
+ that._initiallyHidden = true;
45305
+ }
45306
+ that._popupHelper = $(that.$popup);
45307
+ that.render();
45308
+ },
45125
45309
 
45126
- this.input = this.element;
45310
+ getAISuggestions: function (callback) {
45311
+ var that = this;
45312
+ var response = '';
45313
+ if (!that.aiKey) {
45314
+ callback('');
45315
+ }
45127
45316
 
45128
- if (that.isMaterialized() && this.input instanceof HTMLInputElement) {
45129
- var children = this.host.children();
45130
- $.each(children, function (index) {
45131
- var classToAdd = 'jqx-input-group-addon';
45132
- $(this).removeClass(that.toThemeProperty('jqx-rc-all'));
45133
- if (index === 0) {
45134
- classToAdd += ' jqx-rc-l';
45135
- }
45136
- if (index === children.length - 1) {
45137
- classToAdd += ' jqx-rc-r';
45138
- }
45139
- if (this !== that.element) {
45140
- classToAdd += ' jqx-fill-state-normal';
45141
- }
45142
- this.className += ' ' + that.toThemeProperty(classToAdd);
45143
- });
45317
+ function buildPrompt(textBefore, textAfter) {
45318
+ var systemMessageBuilder = [];
45319
+ systemMessageBuilder.push("Predict what text the user in the given ROLE would insert after the cursor position indicated by ^^^. Auto-correct the text.\n");
45320
+ systemMessageBuilder.push("RULES:\n");
45321
+ systemMessageBuilder.push("1. Reply with OK:, then in square brackets the predicted text, then END_INSERTION, and no other output.\n");
45322
+ systemMessageBuilder.push("2. When a specific value or quantity cannot be inferred and would need to be provided, use the word NEED_INFO.\n");
45323
+ systemMessageBuilder.push("3. If there isn't enough information to predict any words that the user would type next, just reply with the word NO_PREDICTION.\n");
45324
+ systemMessageBuilder.push("4. NEVER invent new information. If you can't be sure what the user is about to type, ALWAYS stop the prediction with END_INSERTION.\n");
45144
45325
 
45145
- var group = $("<div></div>");
45146
- group.addClass(that.toThemeProperty('jqx-input-group'));
45147
- this.host.after(group);
45148
- var input = this.element;
45149
- var data = this.host.data();
45326
+ /*
45327
+ if (that.userPhrases.length) {
45328
+ systemMessageBuilder.push("\nAlways try to use variations on the following phrases as part of the predictions:\n");
45329
+ for (let i = 0; i < that.userPhrases.length; i++) {
45330
+ systemMessageBuilder.push("- {0}\n", that.userPhrases[i]);
45331
+ }
45332
+ }*/
45150
45333
 
45151
- group.append(input);
45152
- var label = $("<label></label");
45334
+ systemMessageBuilder.push("\n\nROLE: " + "User" + " USER_TEXT: " + textBefore + textAfter + "^^^");
45153
45335
 
45154
- if (this.hint) {
45155
- label[0].innerHTML = this.placeHolder;
45336
+ return systemMessageBuilder.join('\n');
45156
45337
  }
45157
45338
 
45158
- label.addClass(that.toThemeProperty('jqx-input-label'));
45159
- group.append(label);
45339
+ function fetchAIResponse(prompt, callback) {
45340
+ var apiKey = that.aiKey; // Replace this with your OpenAI API key (don't expose it on public websites)
45160
45341
 
45161
- var bar = $("<span></span>");
45162
- group.append(bar);
45163
- bar.addClass(that.toThemeProperty('jqx-input-bar'));
45342
+ var headers = {
45343
+ 'Content-Type': 'application/json',
45344
+ 'Authorization': 'Bearer ' + apiKey
45345
+ };
45164
45346
 
45165
- group[0].id = this.element.id;
45166
- this.element.removeAttribute('id');
45347
+ var body = JSON.stringify({
45348
+ model: "gpt-3.5-turbo", // or "gpt-4" if you have access
45349
+ messages: [{ role: "user", content: prompt }], // The conversation format
45350
+ // stop_frequences: ["END_INSERTION", "NEED_INFO"],
45351
+ max_tokens: 200 // You can adjust token length based on your needs,
45352
+ });
45167
45353
 
45168
- group[0].style.cssText = this.element.style.cssText;
45169
- if (this.element.className.indexOf('underlined') >= 0) {
45170
- group.addClass('underlined');
45171
- }
45354
+ var xhr = new XMLHttpRequest();
45355
+ xhr.open('POST', 'https://api.openai.com/v1/chat/completions', true);
45356
+ xhr.setRequestHeader('Content-Type', 'application/json');
45357
+ xhr.setRequestHeader('Authorization', 'Bearer ' + apiKey);
45358
+
45359
+ xhr.onreadystatechange = function () {
45360
+ if (xhr.readyState === 4) {
45361
+ if (xhr.status === 200) {
45362
+ var response = JSON.parse(xhr.responseText);
45363
+ // Make sure there are choices and content in the response
45364
+ if (response.choices && response.choices.length > 0 && response.choices[0].message.content) {
45365
+ var content = response.choices[0].message.content;
45366
+
45367
+ if (content.length > 5 && content.startsWith("OK")) {
45368
+ content = content.substring(4);
45369
+ content = content.replace('END_INSERTION', '');
45370
+
45371
+ var matches = content.match(/\[(.*?)\]/g);
45372
+
45373
+ // Remove the brackets from the extracted text
45374
+ if (matches) {
45375
+ // Use map to strip out brackets
45376
+ var extractedText = matches.map(function (match) {
45377
+ return match.replace(/^\[|\]$/g, '');
45378
+ });
45379
+
45380
+ content = extractedText[0]
45381
+ }
45172
45382
 
45173
- that.input = that.element;
45174
- if (!(this.input instanceof HTMLInputElement)) {
45175
- this.input = this.host.find('input');
45176
- if (this.input.length > 0) {
45177
- this.input = this.input[0];
45178
- }
45179
- $(this.input).addClass(this.toThemeProperty("jqx-input-widget"));
45180
- }
45181
- this.label = label;
45182
- this.bar = bar;
45183
- this.element.style.cssText = '';
45184
- this.host = group;
45185
- this.element = group[0];
45186
- this.host.data(data);
45383
+ content = content.replace('[', '');
45384
+ content = content.replace(']', '');
45385
+ }
45187
45386
 
45188
- var that = this;
45387
+ if (content.indexOf('NO_PREDICTION') >= 0) {
45388
+ content = '';
45389
+ }
45189
45390
 
45190
- if (that.template) {
45191
- that.bar.addClass(that.toThemeProperty("jqx-" + that.template));
45192
- that.label.addClass(that.toThemeProperty("jqx-" + that.template));
45193
- }
45391
+ callback(null, content);
45392
+ }
45393
+ else {
45394
+ callback('Error: No valid response from AI', null);
45395
+ }
45396
+ } else {
45397
+ callback('Error fetching AI response: ' + xhr.statusText, null);
45398
+ }
45399
+ }
45400
+ };
45194
45401
 
45195
- if (children.length > 0) {
45196
- that._hasAddons = true;
45402
+ xhr.send(body);
45197
45403
  }
45198
- }
45199
- else if (this.element.nodeName.toLowerCase() === 'textarea') {
45200
- this.element.style.overflow = 'auto';
45201
- } else
45202
- if (this.element.nodeName.toLowerCase() === 'div') {
45203
- this.baseHost = this.element;
45204
- var input = that.element.getElementsByTagName('input');
45205
- var hasTextInput = false;
45206
45404
 
45207
- $.each(input, function () {
45208
- var type = this.type;
45209
- if (type == null || type === 'text' || type === 'textarea') {
45210
- input = $(this);
45211
- hasTextInput = true;
45212
- return false;
45405
+ var textBefore = that.input.value.substring(0, that.input.selectionStart);
45406
+ var textAfter = that.input.value.substring(that.input.selectionStart + 1);
45407
+ var text = textBefore + textAfter;
45408
+ if (text.endsWith(' ')) {
45409
+ var prompt = buildPrompt(textBefore, textAfter);
45410
+ fetchAIResponse(prompt.toString(), function (error, aiResponse) {
45411
+ if (error) {
45412
+ callback('');
45413
+ } else {
45414
+ callback(aiResponse);
45213
45415
  }
45214
- });
45215
- if (!hasTextInput) {
45216
- throw new Error('jqxInput: Missing Text Input in the Input Group');
45217
- }
45218
-
45219
- if (input.length > 0) {
45220
- this.baseHost = $(this.element);
45221
- that.baseElement = that.element;
45222
- var data = this.host.data();
45223
- this.host = input;
45224
- this.element = input[0];
45225
- that.input = input[0];
45226
- this.host.data(data);
45227
- that.baseElement.className += ' ' + that.toThemeProperty('jqx-widget jqx-rc-all jqx-input-group');
45228
- var children = this.baseHost.children();
45229
- $.each(children, function (index) {
45230
- var classToAdd = 'jqx-input-group-addon';
45231
- $(this).removeClass(that.toThemeProperty('jqx-rc-all'));
45232
- if (index === 0) {
45233
- classToAdd += ' jqx-rc-l';
45234
- }
45235
- if (index === children.length - 1) {
45236
- classToAdd += ' jqx-rc-r';
45237
- }
45238
- if (this !== that.element) {
45239
- classToAdd += ' jqx-fill-state-normal';
45240
- }
45241
- this.className += ' ' + that.toThemeProperty(classToAdd);
45242
- });
45243
45416
  }
45417
+ );
45244
45418
  }
45419
+ },
45245
45420
 
45246
- this.addHandlers();
45247
- if (this.rtl) {
45248
- that.element.className += ' ' + that.toThemeProperty('jqx-rtl');
45249
- }
45250
- that.element.setAttribute('role', 'textbox');
45251
- $.jqx.aria(this, 'aria-autocomplete', 'both');
45252
- $.jqx.aria(this, 'aria-disabled', this.disabled);
45253
- $.jqx.aria(this, 'aria-readonly', false);
45254
- $.jqx.aria(this, 'aria-multiline', false);
45255
- if (this.source && this.source.length) {
45256
- $.jqx.aria(this, 'aria-haspopup', true);
45257
- }
45258
- if (this.value !== '') {
45259
- this.input.value = this.value;
45260
- }
45421
+ render: function () {
45422
+ var that = this;
45261
45423
 
45262
- this._oldsource = this.source;
45263
- this._updateSource();
45264
- },
45424
+ this.input = this.element;
45265
45425
 
45266
- _updateSource: function () {
45267
- var that = this;
45426
+ if (that.isMaterialized() && this.input instanceof HTMLInputElement) {
45427
+ var children = this.host.children();
45428
+ $.each(children, function (index) {
45429
+ var classToAdd = 'jqx-input-group-addon';
45430
+ $(this).removeClass(that.toThemeProperty('jqx-rc-all'));
45431
+ if (index === 0) {
45432
+ classToAdd += ' jqx-rc-l';
45433
+ }
45434
+ if (index === children.length - 1) {
45435
+ classToAdd += ' jqx-rc-r';
45436
+ }
45437
+ if (this !== that.element) {
45438
+ classToAdd += ' jqx-fill-state-normal';
45439
+ }
45440
+ this.className += ' ' + that.toThemeProperty(classToAdd);
45441
+ });
45268
45442
 
45269
- var mapItem = function (item) {
45270
- if (item === undefined) {
45271
- return null;
45272
- }
45443
+ var group = $("<div></div>");
45444
+ group.addClass(that.toThemeProperty('jqx-input-group'));
45445
+ this.host.after(group);
45446
+ var input = this.element;
45447
+ var data = this.host.data();
45273
45448
 
45274
- if (typeof item === 'string' || item instanceof String) {
45275
- return { label: item, value: item };
45276
- }
45277
45449
 
45278
- if (typeof item !== 'string' && item instanceof String === false) {
45279
- var label = '';
45280
- var value = '';
45450
+ group.append(input);
45451
+ var label = $("<label></label");
45281
45452
 
45282
- if (that.displayMember !== '' && that.displayMember !== undefined) {
45283
- if (item[that.displayMember]) {
45284
- label = item[that.displayMember];
45285
- }
45453
+ if (this.hint) {
45454
+ label[0].innerHTML = this.placeHolder;
45286
45455
  }
45287
45456
 
45288
- if (that.valueMember !== '' && that.valueMember !== undefined) {
45289
- value = item[that.valueMember];
45290
- }
45457
+ label.addClass(that.toThemeProperty('jqx-input-label'));
45458
+ group.append(label);
45291
45459
 
45292
- if (label === '') {
45293
- label = item.label;
45294
- }
45295
- if (value === '') {
45296
- value = item.value;
45297
- }
45460
+ var autoCompleteLabel = $("<label class='jqx-input-inline'></label");
45461
+ autoCompleteLabel[0].style.display = 'none';
45462
+ this._inlineLabel = autoCompleteLabel[0];
45298
45463
 
45299
- return { label: label, value: value };
45300
- }
45464
+ group.append(autoCompleteLabel);
45301
45465
 
45302
- return item;
45303
- };
45304
45466
 
45305
- var mapItems = function (source) {
45306
- var items = [];
45307
- for (var i = 0; i < source.length; i++) {
45308
- items[i] = mapItem(source[i]);
45309
- }
45310
- return items;
45311
- };
45467
+ var bar = $("<span></span>");
45468
+ group.append(bar);
45469
+ bar.addClass(that.toThemeProperty('jqx-input-bar'));
45312
45470
 
45313
- if (this.source && this.source._source) {
45314
- this.adapter = this.source;
45315
- if (this.adapter._source.localdata != null) {
45316
- this.adapter.unbindBindingUpdate(this.element.id);
45317
- this.adapter.bindBindingUpdate(this.element.id, function () {
45318
- that.source = mapItems(that.adapter.records);
45319
- });
45320
- }
45321
- else {
45322
- var postdata = {};
45323
- if (this.adapter._options.data) {
45324
- $.extend(that.adapter._options.data, postdata);
45471
+ group[0].id = this.element.id;
45472
+ this.element.removeAttribute('id');
45473
+
45474
+ group[0].style.cssText = this.element.style.cssText;
45475
+ if (this.element.className.indexOf('underlined') >= 0) {
45476
+ group.addClass('underlined');
45325
45477
  }
45326
- else {
45327
- if (this.source._source.data) {
45328
- $.extend(postdata, this.source._source.data);
45478
+
45479
+ that.input = that.element;
45480
+ if (!(this.input instanceof HTMLInputElement)) {
45481
+ this.input = this.host.find('input');
45482
+ if (this.input.length > 0) {
45483
+ this.input = this.input[0];
45329
45484
  }
45330
- this.adapter._options.data = postdata;
45485
+ $(this.input).addClass(this.toThemeProperty("jqx-input-widget"));
45331
45486
  }
45332
- this.adapter.unbindDownloadComplete(this.element.id);
45333
- this.adapter.bindDownloadComplete(this.element.id, function () {
45334
- that.source = mapItems(that.adapter.records);
45335
- });
45336
- }
45337
- this.source.dataBind();
45338
- return;
45339
- }
45487
+ this.label = label;
45488
+ this.bar = bar;
45489
+ this.element.style.cssText = '';
45490
+ this.host = group;
45491
+ this.element = group[0];
45492
+ this.host.data(data);
45340
45493
 
45341
- if (!$.isFunction(this.source)) {
45342
- this.source = mapItems(this.source);
45343
- }
45344
- },
45494
+ var that = this;
45495
+
45496
+ if (that.template) {
45497
+ that.bar.addClass(that.toThemeProperty("jqx-" + that.template));
45498
+ that.label.addClass(that.toThemeProperty("jqx-" + that.template));
45499
+ }
45345
45500
 
45346
- _refreshClasses: function (add) {
45347
- var func = add ? 'addClass' : 'removeClass',
45348
- hostClass = 'jqx-widget-content jqx-input-widget jqx-input jqx-widget',
45349
- popupClass = 'jqx-popup jqx-input-popup jqx-menu jqx-menu-vertical jqx-menu-dropdown jqx-widget jqx-widget-content';
45501
+ if (children.length > 0) {
45502
+ that._hasAddons = true;
45503
+ }
45504
+ }
45505
+ else if (this.element.nodeName.toLowerCase() === 'textarea') {
45506
+ this.element.style.overflow = 'auto';
45507
+ } else
45508
+ if (this.element.nodeName.toLowerCase() === 'div') {
45509
+ this.baseHost = this.element;
45510
+ var input = that.element.getElementsByTagName('input');
45511
+ var hasTextInput = false;
45350
45512
 
45351
- if ($.jqx.browser.msie) {
45352
- popupClass += ' jqx-noshadow';
45353
- }
45354
- if (this.roundedCorners) {
45355
- hostClass += ' jqx-rc-all';
45356
- popupClass += ' jqx-rc-all';
45357
- }
45358
- if (this.disabled) {
45359
- hostClass += ' jqx-fill-state-disabled';
45360
- } else {
45361
- this.host.removeClass(this.toThemeProperty('jqx-fill-state-disabled'));
45362
- }
45363
- this.host[func](this.toThemeProperty(hostClass));
45364
- this._popupHelper[func](this.toThemeProperty(popupClass));
45365
- },
45513
+ $.each(input, function () {
45514
+ var type = this.type;
45515
+ if (type == null || type === 'text' || type === 'textarea') {
45516
+ input = $(this);
45517
+ hasTextInput = true;
45518
+ return false;
45519
+ }
45520
+ });
45521
+ if (!hasTextInput) {
45522
+ throw new Error('jqxInput: Missing Text Input in the Input Group');
45523
+ }
45524
+
45525
+ if (input.length > 0) {
45526
+ this.baseHost = $(this.element);
45527
+ that.baseElement = that.element;
45528
+ var data = this.host.data();
45529
+ this.host = input;
45530
+ this.element = input[0];
45531
+ that.input = input[0];
45532
+ this.host.data(data);
45533
+ that.baseElement.className += ' ' + that.toThemeProperty('jqx-widget jqx-rc-all jqx-input-group');
45534
+ var children = this.baseHost.children();
45535
+ $.each(children, function (index) {
45536
+ var classToAdd = 'jqx-input-group-addon';
45537
+ $(this).removeClass(that.toThemeProperty('jqx-rc-all'));
45538
+ if (index === 0) {
45539
+ classToAdd += ' jqx-rc-l';
45540
+ }
45541
+ if (index === children.length - 1) {
45542
+ classToAdd += ' jqx-rc-r';
45543
+ }
45544
+ if (this !== that.element) {
45545
+ classToAdd += ' jqx-fill-state-normal';
45546
+ }
45547
+ this.className += ' ' + that.toThemeProperty(classToAdd);
45548
+ });
45549
+ }
45550
+ }
45366
45551
 
45367
- selectAll: function () {
45368
- var that = this;
45369
- var textbox = this.host;
45552
+ this.addHandlers();
45553
+ if (this.rtl) {
45554
+ that.element.className += ' ' + that.toThemeProperty('jqx-rtl');
45555
+ }
45370
45556
 
45371
- if (textbox[0] instanceof HTMLInputElement === false) {
45372
- textbox = $(that.input);
45373
- }
45557
+ that.input.setAttribute('autocomplete', 'off');
45558
+ that.input.setAttribute('autocorrect', 'off');
45559
+ that.input.setAttribute('spellcheck', false);
45374
45560
 
45375
- setTimeout(function () {
45376
- if ('selectionStart' in textbox[0]) {
45377
- textbox[0].focus();
45378
- textbox[0].setSelectionRange(0, textbox[0].value.length);
45561
+ that.element.setAttribute('role', 'textbox');
45562
+ $.jqx.aria(this, 'aria-autocomplete', 'both');
45563
+ $.jqx.aria(this, 'aria-disabled', this.disabled);
45564
+ $.jqx.aria(this, 'aria-readonly', false);
45565
+ $.jqx.aria(this, 'aria-multiline', false);
45566
+ if (this.source && this.source.length) {
45567
+ $.jqx.aria(this, 'aria-haspopup', true);
45379
45568
  }
45380
- else {
45381
- var range = textbox[0].createTextRange();
45382
- range.collapse(true);
45383
- range.moveEnd('character', textbox[0].value.length);
45384
- range.moveStart('character', 0);
45385
- range.select();
45569
+ if (this.value !== '') {
45570
+ this.input.value = this.value;
45386
45571
  }
45387
- }, 10);
45388
- },
45389
45572
 
45390
- selectLast: function () {
45391
- var that = this;
45392
- var textbox = this.host;
45573
+ this._oldsource = this.source;
45574
+ this._updateSource();
45575
+ },
45393
45576
 
45394
- if (textbox[0] instanceof HTMLInputElement === false) {
45395
- textbox = $(that.input);
45396
- }
45577
+ _updateSource: function () {
45578
+ var that = this;
45397
45579
 
45398
- this.selectStart(textbox[0].value.length);
45399
- },
45580
+ var mapItem = function (item) {
45581
+ if (item === undefined) {
45582
+ return null;
45583
+ }
45400
45584
 
45401
- selectFirst: function () {
45402
- //var textbox = this.host;
45403
- this.selectStart(0);
45404
- },
45585
+ if (typeof item === 'string' || item instanceof String) {
45586
+ return { label: item, value: item };
45587
+ }
45405
45588
 
45406
- selectStart: function (index) {
45407
- var that = this;
45408
- var textbox = this.host;
45589
+ if (typeof item !== 'string' && item instanceof String === false) {
45590
+ var label = '';
45591
+ var value = '';
45409
45592
 
45410
- if (textbox[0] instanceof HTMLInputElement === false) {
45411
- textbox = $(that.input);
45412
- }
45593
+ if (that.displayMember !== '' && that.displayMember !== undefined) {
45594
+ if (item[that.displayMember]) {
45595
+ label = item[that.displayMember];
45596
+ }
45597
+ }
45413
45598
 
45414
- setTimeout(function () {
45415
- if ('selectionStart' in textbox[0]) {
45416
- textbox[0].focus();
45417
- textbox[0].setSelectionRange(index, index);
45418
- }
45419
- else {
45420
- var range = textbox[0].createTextRange();
45421
- range.collapse(true);
45422
- range.moveEnd('character', index);
45423
- range.moveStart('character', index);
45424
- range.select();
45425
- }
45426
- }, 10);
45427
- },
45599
+ if (that.valueMember !== '' && that.valueMember !== undefined) {
45600
+ value = item[that.valueMember];
45601
+ }
45428
45602
 
45429
- focus: function () {
45430
- try {
45431
- var that = this;
45432
- that.element.focus();
45433
- setTimeout(function () {
45434
- that.element.focus();
45435
- }, 25);
45603
+ if (label === '') {
45604
+ label = item.label;
45605
+ }
45606
+ if (value === '') {
45607
+ value = item.value;
45608
+ }
45436
45609
 
45437
- }
45438
- catch (error) {
45439
- }
45440
- },
45610
+ return { label: label, value: value };
45611
+ }
45441
45612
 
45442
- resize: function (width, height) {
45443
- this.width = width;
45444
- this.height = height;
45445
- this.refresh();
45446
- },
45613
+ return item;
45614
+ };
45447
45615
 
45448
- refresh: function () {
45449
- this._refreshClasses(false);
45450
- this._refreshClasses(true);
45616
+ var mapItems = function (source) {
45617
+ var items = [];
45618
+ for (var i = 0; i < source.length; i++) {
45619
+ items[i] = mapItem(source[i]);
45620
+ }
45621
+ return items;
45622
+ };
45451
45623
 
45452
- if (!this.baseHost) {
45453
- if (this.width != null && this.width.toString().indexOf("px") != -1) {
45454
- this.element.style.width = parseInt(this.width) + 'px';
45455
- }
45456
- else if (this.width != undefined && !isNaN(this.width)) {
45457
- this.element.style.width = this.width + 'px';
45458
- }
45459
- else {
45460
- this.element.style.width = this.width;
45624
+ if (this.source && this.source._source) {
45625
+ this.adapter = this.source;
45626
+ if (this.adapter._source.localdata != null) {
45627
+ this.adapter.unbindBindingUpdate(this.element.id);
45628
+ this.adapter.bindBindingUpdate(this.element.id, function () {
45629
+ that.source = mapItems(that.adapter.records);
45630
+ });
45631
+ }
45632
+ else {
45633
+ var postdata = {};
45634
+ if (this.adapter._options.data) {
45635
+ $.extend(that.adapter._options.data, postdata);
45636
+ }
45637
+ else {
45638
+ if (this.source._source.data) {
45639
+ $.extend(postdata, this.source._source.data);
45640
+ }
45641
+ this.adapter._options.data = postdata;
45642
+ }
45643
+ this.adapter.unbindDownloadComplete(this.element.id);
45644
+ this.adapter.bindDownloadComplete(this.element.id, function () {
45645
+ that.source = mapItems(that.adapter.records);
45646
+ });
45647
+ }
45648
+ this.source.dataBind();
45649
+ return;
45461
45650
  }
45462
45651
 
45463
- if (this.height != null && this.height.toString().indexOf("px") != -1) {
45464
- this.element.style.height = parseInt(this.height) + 'px';;
45465
- }
45466
- else if (this.height != undefined && !isNaN(this.height)) {
45467
- this.element.style.height = this.height + 'px';
45652
+ if (!$.isFunction(this.source)) {
45653
+ this.source = mapItems(this.source);
45468
45654
  }
45469
- else {
45470
- this.element.style.height = this.height;
45471
- }
45472
- if (this._hasAddons) {
45473
- this._addonsWidth = 35;
45474
- this.input.style.width = 'calc(100% - ' + this._addonsWidth + 'px)';
45655
+ },
45656
+
45657
+ _refreshClasses: function (add) {
45658
+ var func = add ? 'addClass' : 'removeClass',
45659
+ hostClass = 'jqx-widget-content jqx-input-widget jqx-input jqx-widget',
45660
+ popupClass = 'jqx-popup jqx-input-popup jqx-menu jqx-menu-vertical jqx-menu-dropdown jqx-widget jqx-widget-content';
45661
+
45662
+ if ($.jqx.browser.msie) {
45663
+ popupClass += ' jqx-noshadow';
45475
45664
  }
45476
- } else {
45477
- if (this.width != null && this.width.toString().indexOf("px") != -1) {
45478
- this.baseElement.style.width = parseInt(this.width) + 'px';
45665
+ if (this.roundedCorners) {
45666
+ hostClass += ' jqx-rc-all';
45667
+ popupClass += ' jqx-rc-all';
45479
45668
  }
45480
- else if (this.width != undefined && !isNaN(this.width)) {
45481
- this.baseElement.style.width = this.width + 'px';
45669
+ if (this.disabled) {
45670
+ hostClass += ' jqx-fill-state-disabled';
45671
+ } else {
45672
+ this.host.removeClass(this.toThemeProperty('jqx-fill-state-disabled'));
45482
45673
  }
45674
+ this.host[func](this.toThemeProperty(hostClass));
45675
+ this._popupHelper[func](this.toThemeProperty(popupClass));
45676
+ },
45483
45677
 
45484
- if (this.height != null && this.height.toString().indexOf("px") != -1) {
45485
- this.baseElement.style.height = parseInt(this.height) + 'px';
45678
+ selectAll: function () {
45679
+ var that = this;
45680
+ var textbox = this.host;
45681
+
45682
+ if (textbox[0] instanceof HTMLInputElement === false) {
45683
+ textbox = $(that.input);
45486
45684
  }
45487
- else if (this.height != undefined && !isNaN(this.height)) {
45488
- this.baseElement.style.height = this.height + 'px';
45489
- };
45490
- var that = this,
45491
- IE8 = $.jqx.browser.msie && $.jqx.browser.version < 9,
45492
- totalWidth = 0;
45493
- $.each(this.baseHost.children(), function () {
45494
- this.style.height = '100%';
45495
- if (this !== that.element) {
45496
- totalWidth += $(this).outerWidth();
45685
+
45686
+ setTimeout(function () {
45687
+ if ('selectionStart' in textbox[0]) {
45688
+ textbox[0].focus();
45689
+ textbox[0].setSelectionRange(0, textbox[0].value.length);
45497
45690
  }
45498
- });
45499
- that._addonsWidth = totalWidth;
45500
- if (IE8) {
45501
- var height = Math.max(0, that.baseElement.offsetHeight - 2);
45502
- that.element.style.width = Math.max(0, (that.baseElement.offsetWidth - totalWidth - 1)) + 'px';
45503
- that.element.style.minHeight = height + 'px';
45504
- that.element.style.lineHeight = height + 'px';
45505
- } else {
45506
- that.element.style.width = 'calc(100% - ' + totalWidth + 'px)';
45507
- }
45508
- $.jqx.utilities.resize(that.baseHost, function () {
45509
- if (IE8 && typeof that.width === 'string' && that.width.indexOf('%') !== -1 && !that._initiallyHidden) {
45510
- that.element.style.width = (that.baseElement.offsetWidth - that._addonsWidth - 1) + 'px';
45511
- } else if (that._initiallyHidden) {
45512
- that._addonsWidth = that._getAddonsWidth();
45513
- if (!IE8) {
45514
- that.element.style.width = 'calc(100% - ' + that._addonsWidth + 'px)';
45515
- } else {
45516
- that.element.style.width = (that.baseElement.offsetWidth - that._addonsWidth - 1) + 'px';
45517
- var height = that.baseElement.offsetHeight - 2;
45518
- that.element.style.minHeight = height + 'px';
45519
- that.element.style.lineHeight = height + 'px';
45520
- }
45521
- that._initiallyHidden = false;
45691
+ else {
45692
+ var range = textbox[0].createTextRange();
45693
+ range.collapse(true);
45694
+ range.moveEnd('character', textbox[0].value.length);
45695
+ range.moveStart('character', 0);
45696
+ range.select();
45522
45697
  }
45523
- });
45524
- }
45698
+ }, 10);
45699
+ },
45525
45700
 
45526
- if (this.disabled) {
45527
- this.element.setAttribute('disabled', true);
45528
- } else {
45529
- this.element.removeAttribute('disabled');
45530
- }
45531
- if (this.maxLength) {
45532
- this.element.setAttribute('maxlength', this.maxLength);
45701
+ selectLast: function () {
45702
+ var that = this;
45703
+ var textbox = this.host;
45533
45704
 
45534
- if (this.input) {
45535
- this.input.setAttribute('maxlength', this.maxLength);
45705
+ if (textbox[0] instanceof HTMLInputElement === false) {
45706
+ textbox = $(that.input);
45536
45707
  }
45537
- }
45538
45708
 
45539
- if (!this.element.getAttribute('placeholder')) {
45540
- this._refreshPlaceHolder();
45541
- }
45542
- },
45709
+ this.selectStart(textbox[0].value.length);
45710
+ },
45543
45711
 
45544
- _refreshPlaceHolder: function () {
45545
- var that = this;
45712
+ selectFirst: function () {
45713
+ //var textbox = this.host;
45714
+ this.selectStart(0);
45715
+ },
45546
45716
 
45547
- if (!that.isMaterialized() || !that.hint) {
45548
- if ('placeholder' in this.input && !($.jqx.browser.msie && $.jqx.browser.version < 9)) {
45549
- that.input.setAttribute('placeHolder', that.placeHolder);
45550
- } else {
45551
- if (that.input.value === '') {
45552
- that.input.value = that.placeHolder;
45553
- }
45717
+ selectStart: function (index) {
45718
+ var that = this;
45719
+ var textbox = this.host;
45720
+
45721
+ if (textbox[0] instanceof HTMLInputElement === false) {
45722
+ textbox = $(that.input);
45554
45723
  }
45555
- }
45556
45724
 
45557
- if (!that.hint) {
45558
- return;
45559
- }
45725
+ setTimeout(function () {
45726
+ if ('selectionStart' in textbox[0]) {
45727
+ textbox[0].focus();
45728
+ textbox[0].setSelectionRange(index, index);
45729
+ }
45730
+ else {
45731
+ var range = textbox[0].createTextRange();
45732
+ range.collapse(true);
45733
+ range.moveEnd('character', index);
45734
+ range.moveStart('character', index);
45735
+ range.select();
45736
+ }
45737
+ }, 10);
45738
+ },
45560
45739
 
45561
- if (that.input.value !== "") {
45562
- that.element.setAttribute("hint", true);
45563
- }
45564
- else {
45565
- that.element.removeAttribute("hint");
45566
- }
45740
+ focus: function () {
45741
+ try {
45742
+ var that = this;
45743
+ that.element.focus();
45744
+ setTimeout(function () {
45745
+ that.element.focus();
45746
+ }, 25);
45567
45747
 
45568
- if (that.label) {
45569
- that.label.innerHTML = that.placeHolder;
45570
- }
45571
- },
45748
+ }
45749
+ catch (error) {
45750
+ }
45751
+ },
45572
45752
 
45573
- destroy: function () {
45574
- this.removeHandlers();
45575
- if (this.baseHost) {
45576
- this.baseHost.remove();
45577
- } else {
45578
- this.host.remove();
45579
- }
45580
- if (this.$popup) {
45581
- this._popupHelper.remove();
45582
- }
45583
- },
45753
+ resize: function (width, height) {
45754
+ this.width = width;
45755
+ this.height = height;
45756
+ this.refresh();
45757
+ },
45584
45758
 
45585
- propertiesChangedHandler: function (object, key, value) {
45586
- if (value.width && value.height && Object.keys(value).length === 2) {
45587
- object.refresh();
45588
- }
45589
- },
45759
+ refresh: function () {
45760
+ this._refreshClasses(false);
45761
+ this._refreshClasses(true);
45590
45762
 
45591
- propertyChangedHandler: function (object, key, oldvalue, value) {
45592
- if (key === 'width' && value !== oldvalue) {
45593
- if (object.baseHost) {
45594
- object.baseElement.style.width = object._toPx(value);
45595
- if ($.jqx.browser.msie && $.jqx.browser.version < 9) {
45596
- object.element.style.width = (object.baseElement.offsetWidth - object._addonsWidth - 1) + 'px';
45763
+ if (!this.baseHost) {
45764
+ if (this.width != null && this.width.toString().indexOf("px") != -1) {
45765
+ this.element.style.width = parseInt(this.width) + 'px';
45766
+ }
45767
+ else if (this.width != undefined && !isNaN(this.width)) {
45768
+ this.element.style.width = this.width + 'px';
45769
+ }
45770
+ else {
45771
+ this.element.style.width = this.width;
45772
+ }
45773
+
45774
+ if (this.height != null && this.height.toString().indexOf("px") != -1) {
45775
+ this.element.style.height = parseInt(this.height) + 'px';;
45776
+ }
45777
+ else if (this.height != undefined && !isNaN(this.height)) {
45778
+ this.element.style.height = this.height + 'px';
45779
+ }
45780
+ else {
45781
+ this.element.style.height = this.height;
45782
+ }
45783
+ if (this._hasAddons) {
45784
+ this._addonsWidth = 35;
45785
+ this.input.style.width = 'calc(100% - ' + this._addonsWidth + 'px)';
45597
45786
  }
45598
45787
  } else {
45599
- object.element.style.width = object._toPx(value);
45788
+ if (this.width != null && this.width.toString().indexOf("px") != -1) {
45789
+ this.baseElement.style.width = parseInt(this.width) + 'px';
45790
+ }
45791
+ else if (this.width != undefined && !isNaN(this.width)) {
45792
+ this.baseElement.style.width = this.width + 'px';
45793
+ }
45794
+
45795
+ if (this.height != null && this.height.toString().indexOf("px") != -1) {
45796
+ this.baseElement.style.height = parseInt(this.height) + 'px';
45797
+ }
45798
+ else if (this.height != undefined && !isNaN(this.height)) {
45799
+ this.baseElement.style.height = this.height + 'px';
45800
+ };
45801
+ var that = this,
45802
+ IE8 = $.jqx.browser.msie && $.jqx.browser.version < 9,
45803
+ totalWidth = 0;
45804
+ $.each(this.baseHost.children(), function () {
45805
+ this.style.height = '100%';
45806
+ if (this !== that.element) {
45807
+ totalWidth += $(this).outerWidth();
45808
+ }
45809
+ });
45810
+ that._addonsWidth = totalWidth;
45811
+ if (IE8) {
45812
+ var height = Math.max(0, that.baseElement.offsetHeight - 2);
45813
+ that.element.style.width = Math.max(0, (that.baseElement.offsetWidth - totalWidth - 1)) + 'px';
45814
+ that.element.style.minHeight = height + 'px';
45815
+ that.element.style.lineHeight = height + 'px';
45816
+ } else {
45817
+ that.element.style.width = 'calc(100% - ' + totalWidth + 'px)';
45818
+ }
45819
+ $.jqx.utilities.resize(that.baseHost, function () {
45820
+ if (IE8 && typeof that.width === 'string' && that.width.indexOf('%') !== -1 && !that._initiallyHidden) {
45821
+ that.element.style.width = (that.baseElement.offsetWidth - that._addonsWidth - 1) + 'px';
45822
+ } else if (that._initiallyHidden) {
45823
+ that._addonsWidth = that._getAddonsWidth();
45824
+ if (!IE8) {
45825
+ that.element.style.width = 'calc(100% - ' + that._addonsWidth + 'px)';
45826
+ } else {
45827
+ that.element.style.width = (that.baseElement.offsetWidth - that._addonsWidth - 1) + 'px';
45828
+ var height = that.baseElement.offsetHeight - 2;
45829
+ that.element.style.minHeight = height + 'px';
45830
+ that.element.style.lineHeight = height + 'px';
45831
+ }
45832
+ that._initiallyHidden = false;
45833
+ }
45834
+ });
45600
45835
  }
45601
- return;
45602
- }
45603
45836
 
45604
- if (key === 'placeHolder') {
45605
- if ((!('placeholder' in object.element) || ($.jqx.browser.msie && $.jqx.browser.version < 9)) && object.input.value === oldvalue) {
45606
- object.input.value = '';
45837
+ if (this.disabled) {
45838
+ this.element.setAttribute('disabled', true);
45839
+ } else {
45840
+ this.element.removeAttribute('disabled');
45607
45841
  }
45608
- object._refreshPlaceHolder();
45609
- return;
45610
- }
45842
+ if (this.maxLength) {
45843
+ this.element.setAttribute('maxlength', this.maxLength);
45611
45844
 
45612
- if (object.batchUpdate && object.batchUpdate.width && object.batchUpdate.height && Object.keys(object.batchUpdate).length === 2) {
45613
- return;
45614
- }
45845
+ if (this.input) {
45846
+ this.input.setAttribute('maxlength', this.maxLength);
45847
+ }
45848
+ }
45615
45849
 
45616
- if (key === 'theme') {
45617
- $.jqx.utilities.setTheme(oldvalue, value, object.host);
45618
- }
45850
+ if (!this.element.getAttribute('placeholder')) {
45851
+ this._refreshPlaceHolder();
45852
+ }
45853
+ },
45619
45854
 
45620
- if (key === 'opened') {
45621
- if (value) {
45622
- object.open();
45855
+ _refreshPlaceHolder: function () {
45856
+ var that = this;
45857
+
45858
+ if (!that.isMaterialized() || !that.hint) {
45859
+
45860
+ if ('placeholder' in this.input && !($.jqx.browser.msie && $.jqx.browser.version < 9)) {
45861
+ that.input.setAttribute('placeHolder', that.placeHolder);
45862
+ } else {
45863
+ if (that.input.value === '') {
45864
+ that.input.value = that.placeHolder;
45865
+ }
45866
+ }
45867
+ }
45868
+
45869
+ if (!that.hint) {
45870
+ return;
45871
+ }
45872
+
45873
+ if (that.input.value !== "") {
45874
+ that.element.setAttribute("hint", true);
45875
+ }
45876
+ else {
45877
+ that.element.removeAttribute("hint");
45878
+ }
45879
+
45880
+ if (that.label) {
45881
+ that.label.innerHTML = that.placeHolder;
45882
+ }
45883
+
45884
+ if (this._inlineLabel && that.inlineAutoComplete) {
45885
+ this._inlineLabel.style.display = 'none';
45886
+ that.host.css('overflow', 'visible');
45887
+ }
45888
+
45889
+ },
45890
+
45891
+ destroy: function () {
45892
+ this.removeHandlers();
45893
+ if (this.baseHost) {
45894
+ this.baseHost.remove();
45623
45895
  } else {
45624
- object.close();
45896
+ this.host.remove();
45625
45897
  }
45626
- return;
45627
- }
45628
- if (key === 'source') {
45629
- object._oldsource = value;
45630
- object._updateSource();
45631
- }
45632
- if (key === 'displayMember' || key === 'valueMember') {
45633
- object.source = object._oldsource;
45634
- object._updateSource();
45635
- }
45636
- if (key === 'disabled') {
45637
- $.jqx.aria(object, 'aria-disabled', object.disabled);
45638
- }
45898
+ if (this.$popup) {
45899
+ this._popupHelper.remove();
45900
+ }
45901
+ },
45639
45902
 
45640
- if (key === 'value') {
45641
- object.input.value = value;
45642
- object._refreshPlaceHolder();
45643
- }
45903
+ propertiesChangedHandler: function (object, key, value) {
45904
+ if (value.width && value.height && Object.keys(value).length === 2) {
45905
+ object.refresh();
45906
+ }
45907
+ },
45644
45908
 
45645
- object.refresh();
45646
- },
45909
+ propertyChangedHandler: function (object, key, oldvalue, value) {
45910
+ if (key === 'width' && value !== oldvalue) {
45911
+ if (object.baseHost) {
45912
+ object.baseElement.style.width = object._toPx(value);
45913
+ if ($.jqx.browser.msie && $.jqx.browser.version < 9) {
45914
+ object.element.style.width = (object.baseElement.offsetWidth - object._addonsWidth - 1) + 'px';
45915
+ }
45916
+ } else {
45917
+ object.element.style.width = object._toPx(value);
45918
+ }
45919
+ return;
45920
+ }
45647
45921
 
45648
- select: function (event, ui, changeType) {
45649
- var selectedItem = this._find('jqx-fill-state-pressed', this._popupHelper);
45650
- var val = selectedItem.getAttribute('data-value');
45651
- var label = selectedItem.getAttribute('data-name');
45652
- this.input.value = this.renderer(label, this.input.value);
45653
- this.selectedItem = { 'label': label, 'value': val };
45654
- this.element.setAttribute('data-value', val);
45655
- this.element.setAttribute('data-label', label);
45656
- this._raiseEvent('0', { 'item': { 'label': label, 'value': val }, 'label': label, 'value': val });
45657
- this._raiseEvent('3', { type: changeType, 'item': { 'label': label, 'value': val }, 'label': label, 'value': val });
45658
- this.value = label;
45659
- return this.close();
45660
- },
45922
+ if (key === 'placeHolder') {
45923
+ if ((!('placeholder' in object.element) || ($.jqx.browser.msie && $.jqx.browser.version < 9)) && object.input.value === oldvalue) {
45924
+ object.input.value = '';
45925
+ }
45926
+ object._refreshPlaceHolder();
45927
+ return;
45928
+ }
45661
45929
 
45662
- val: function (value) {
45663
- if (arguments.length === 0 || (value != null && typeof (value) === 'object' && !value.label && !value.value)) {
45664
- if (this.displayMember !== '' && this.valueMember !== '' && this.selectedItem) {
45665
- if (this.input.value === '') {
45666
- return '';
45930
+ if (object.batchUpdate && object.batchUpdate.width && object.batchUpdate.height && Object.keys(object.batchUpdate).length === 2) {
45931
+ return;
45932
+ }
45933
+
45934
+ if (key === 'theme') {
45935
+ $.jqx.utilities.setTheme(oldvalue, value, object.host);
45936
+ }
45937
+
45938
+ if (key === 'opened') {
45939
+ if (value) {
45940
+ object.open();
45941
+ } else {
45942
+ object.close();
45667
45943
  }
45668
- return this.selectedItem;
45944
+ return;
45945
+ }
45946
+ if (key === 'source') {
45947
+ object._oldsource = value;
45948
+ object._updateSource();
45949
+ }
45950
+ if (key === 'displayMember' || key === 'valueMember') {
45951
+ object.source = object._oldsource;
45952
+ object._updateSource();
45953
+ }
45954
+ if (key === 'disabled') {
45955
+ $.jqx.aria(object, 'aria-disabled', object.disabled);
45669
45956
  }
45670
45957
 
45671
- return this.input.value;
45672
- }
45958
+ if (key === 'value') {
45959
+ object.input.value = value;
45960
+ object._refreshPlaceHolder();
45961
+ }
45673
45962
 
45674
- if (value && value.label) {
45675
- this.selectedItem = { 'label': value.label, 'value': value.value };
45676
- this.element.setAttribute('data-value', value.value);
45677
- this.element.setAttribute('data-label', value.label);
45678
- this.value = value;
45679
- this.input.value = value.label;
45680
- if (this.input) {
45963
+ object.refresh();
45964
+ },
45965
+
45966
+ select: function (event, ui, changeType) {
45967
+ var that = this;
45968
+ var selectedItem = this._find('jqx-fill-state-pressed', this._popupHelper);
45969
+
45970
+ if (this.inlineAutoComplete) {
45971
+ selectedItem = this.element.querySelector('.jqx-input-inline');
45972
+ selectedItem.style.display = 'none';
45973
+ that.host.css('overflow', 'visible');
45974
+ }
45975
+
45976
+ var val = selectedItem.getAttribute('data-value');
45977
+ var label = selectedItem.getAttribute('data-name');
45978
+ this.input.value = this.renderer(label, this.input.value);
45979
+ this.selectedItem = { 'label': label, 'value': val };
45980
+ this.element.setAttribute('data-value', val);
45981
+ this.element.setAttribute('data-label', label);
45982
+ this._raiseEvent('0', { 'item': { 'label': label, 'value': val }, 'label': label, 'value': val });
45983
+ this._raiseEvent('3', { type: changeType, 'item': { 'label': label, 'value': val }, 'label': label, 'value': val });
45984
+ this.value = label;
45985
+ return this.close();
45986
+ },
45987
+
45988
+ val: function (value) {
45989
+ if (arguments.length === 0 || (value != null && typeof (value) === 'object' && !value.label && !value.value)) {
45990
+ if (this.displayMember !== '' && this.valueMember !== '' && this.selectedItem) {
45991
+ if (this.input.value === '') {
45992
+ return '';
45993
+ }
45994
+ return this.selectedItem;
45995
+ }
45996
+
45997
+ return this.input.value;
45998
+ }
45999
+
46000
+ if (value && value.label) {
46001
+ this.selectedItem = { 'label': value.label, 'value': value.value };
46002
+ this.element.setAttribute('data-value', value.value);
46003
+ this.element.setAttribute('data-label', value.label);
46004
+ this.value = value;
45681
46005
  this.input.value = value.label;
46006
+ if (this.input) {
46007
+ this.input.value = value.label;
46008
+ }
46009
+ return this.input.value;
45682
46010
  }
45683
- return this.input.value;
45684
- }
45685
46011
 
45686
- this.value = value;
45687
- this.input.value = value;
46012
+ this.value = value;
46013
+ this.input.value = value;
45688
46014
 
45689
- this.element.setAttribute('data-value', value);
45690
- this.element.setAttribute('data-label', value);
45691
- if (value && value.label) {
45692
- this._raiseEvent('3', { type: null, 'item': { 'label': value.label, 'value': value.value }, 'label': value.label, 'value': value.value });
45693
- }
45694
- else {
45695
- this._raiseEvent('3', { type: null, 'item': { 'label': value, 'value': value }, 'label': value, 'value': value });
45696
- }
45697
- this._refreshPlaceHolder();
45698
- return this.input.value;
45699
- },
46015
+ this.element.setAttribute('data-value', value);
46016
+ this.element.setAttribute('data-label', value);
46017
+ if (value && value.label) {
46018
+ this._raiseEvent('3', { type: null, 'item': { 'label': value.label, 'value': value.value }, 'label': value.label, 'value': value.value });
46019
+ }
46020
+ else {
46021
+ this._raiseEvent('3', { type: null, 'item': { 'label': value, 'value': value }, 'label': value, 'value': value });
46022
+ }
46023
+ this._refreshPlaceHolder();
46024
+ return this.input.value;
46025
+ },
45700
46026
 
45701
- _raiseEvent: function (id, arg) {
45702
- if (arg === undefined) {
45703
- arg = { owner: null };
45704
- }
46027
+ _raiseEvent: function (id, arg) {
46028
+ if (arg === undefined) {
46029
+ arg = { owner: null };
46030
+ }
45705
46031
 
45706
- var evt = this.events[id];
45707
- arg.owner = this;
46032
+ var evt = this.events[id];
46033
+ arg.owner = this;
45708
46034
 
45709
- var event = new $.Event(evt);
45710
- event.owner = this;
45711
- event.args = arg;
45712
- if (event.preventDefault) {
45713
- event.preventDefault();
45714
- }
46035
+ var event = new $.Event(evt);
46036
+ event.owner = this;
46037
+ event.args = arg;
46038
+ if (event.preventDefault) {
46039
+ event.preventDefault();
46040
+ }
45715
46041
 
45716
- var result = this.host.trigger(event);
45717
- return result;
45718
- },
46042
+ var result = this.host.trigger(event);
46043
+ return result;
46044
+ },
45719
46045
 
45720
- _renderer: function (item) {
45721
- return item;
45722
- },
46046
+ _renderer: function (item) {
46047
+ return item;
46048
+ },
45723
46049
 
45724
- open: function () {
45725
- if ($.jqx.isHidden(this.host)) {
45726
- return;
45727
- }
46050
+ open: function () {
46051
+ if ($.jqx.isHidden(this.host)) {
46052
+ return;
46053
+ }
45728
46054
 
45729
- var position = $.extend({}, this.host.coord(true), {
45730
- height: this.element.offsetHeight
45731
- });
46055
+ var position = $.extend({}, this.host.coord(true), {
46056
+ height: this.element.offsetHeight
46057
+ });
45732
46058
 
45733
- if (this.$popup.parentNode !== document.body) {
45734
- var popupId = this.element.id + '_popup';
45735
- this.$popup.id = popupId;
45736
- $.jqx.aria(this, 'aria-owns', popupId);
45737
- document.body.appendChild(this.$popup);
45738
- }
46059
+ if (this.$popup.parentNode !== document.body) {
46060
+ var popupId = this.element.id + '_popup';
46061
+ this.$popup.id = popupId;
46062
+ $.jqx.aria(this, 'aria-owns', popupId);
46063
+ document.body.appendChild(this.$popup);
46064
+ }
45739
46065
 
45740
- this.$popup.style.position = 'absolute';
45741
- this.$popup.style.zIndex = this.popupZIndex;
45742
- this.$popup.style.top = this._toPx(position.top + position.height);
45743
- this.$popup.style.left = this._toPx(position.left);
45744
- this.$popup.style.display = 'block';
46066
+ this.$popup.style.position = 'absolute';
46067
+ this.$popup.style.zIndex = this.popupZIndex;
46068
+ this.$popup.style.top = this._toPx(position.top + position.height);
46069
+ this.$popup.style.left = this._toPx(position.left);
46070
+ this.$popup.style.display = 'block';
45745
46071
 
45746
- var height = 0;
45747
- var children = this._popupHelper.children();
45748
- $.each(children, function () {
45749
- height += $(this).outerHeight() + 1;
45750
- });
45751
- this.$popup.style.height = this._toPx(height);
46072
+ var height = 0;
46073
+ var children = this._popupHelper.children();
46074
+ $.each(children, function () {
46075
+ height += $(this).outerHeight() + 1;
46076
+ });
46077
+ this.$popup.style.height = this._toPx(height);
45752
46078
 
45753
- if (this.enableBrowserBoundsDetection) {
45754
- var viewHeight = $(window).height() + $(window).scrollTop();
45755
- var offset = $(this.$popup).offset();
45756
- var dpHeight = $(this.$popup).outerHeight();
46079
+ if (this.enableBrowserBoundsDetection) {
46080
+ var viewHeight = $(window).height() + $(window).scrollTop();
46081
+ var offset = $(this.$popup).offset();
46082
+ var dpHeight = $(this.$popup).outerHeight();
45757
46083
 
45758
- if (offset.top + dpHeight > viewHeight) {
45759
- var newPosition = position.top + position.height - dpHeight - this.host.height();
45760
- if (newPosition < 0) {
45761
- newPosition = 0;
46084
+ if (offset.top + dpHeight > viewHeight) {
46085
+ var newPosition = position.top + position.height - dpHeight - this.host.height();
46086
+ if (newPosition < 0) {
46087
+ newPosition = 0;
46088
+ }
46089
+ this.$popup.style.top = newPosition + 'px';
45762
46090
  }
45763
- this.$popup.style.top = newPosition + 'px';
45764
46091
  }
45765
- }
45766
46092
 
45767
- this.opened = true;
45768
- this._raiseEvent('1', { popup: this.$popup });
45769
- $.jqx.aria(this, 'aria-expanded', true);
45770
- return this;
45771
- },
45772
-
45773
- close: function () {
45774
- if (!this.opened) {
45775
- return;
45776
- }
46093
+ this.opened = true;
46094
+ this._raiseEvent('1', { popup: this.$popup });
46095
+ $.jqx.aria(this, 'aria-expanded', true);
46096
+ return this;
46097
+ },
45777
46098
 
45778
- this.$popup.style.display = 'none';
45779
- this.opened = false;
45780
- this._raiseEvent('2', { popup: this.$popup });
45781
- $.jqx.aria(this, 'aria-expanded', false);
45782
- this._refreshPlaceHolder();
45783
- return this;
45784
- },
46099
+ close: function () {
46100
+ if (this._inlineLabel) {
46101
+ this._inlineLabel.style.display = 'none';
46102
+ }
45785
46103
 
45786
- suggest: function () {
45787
- var items;
45788
- this.query = this.input.value;
46104
+ if (!this.opened) {
46105
+ return;
46106
+ }
45789
46107
 
45790
- if (!this.query || this.query.length < this.minLength) {
45791
- return this.opened ? this.close() : this;
45792
- }
46108
+ this.$popup.style.display = 'none';
46109
+ this.opened = false;
46110
+ this._raiseEvent('2', { popup: this.$popup });
46111
+ $.jqx.aria(this, 'aria-expanded', false);
46112
+ this._refreshPlaceHolder();
46113
+ return this;
46114
+ },
45793
46115
 
45794
- if ($.isFunction(this.source)) {
45795
- items = this.source(this.query, $.proxy(this.load, this));
45796
- }
45797
- else {
45798
- items = this.source;
45799
- }
46116
+ suggest: function () {
46117
+ var items;
46118
+ var that = this;
46119
+ this.query = this.input.value;
45800
46120
 
45801
- if (items) {
45802
- return this.load(items);
45803
- }
46121
+ if (that.inlineAutoComplete && that.aiKey) {
46122
+ this.load([]);
46123
+ return;
46124
+ }
46125
+ if (!this.query || this.query.length < this.minLength) {
46126
+ if (this._inlineLabel) {
46127
+ this._inlineLabel.style.display = 'none';
46128
+ }
45804
46129
 
45805
- return this;
45806
- },
46130
+ return this.opened ? this.close() : this;
46131
+ }
45807
46132
 
45808
- load: function (originalItems) {
45809
- var that = this,
45810
- items = [];
46133
+ if ($.isFunction(this.source)) {
46134
+ items = this.source(this.query, $.proxy(this.load, this));
46135
+ }
46136
+ else {
46137
+ items = this.source;
46138
+ }
45811
46139
 
45812
- for (var i = 0; i < originalItems.length; i++) {
45813
- var item = originalItems[i];
45814
- if (that.filter(item)) {
45815
- items.push(item);
46140
+ if (items) {
46141
+ return this.load(items);
45816
46142
  }
45817
- }
45818
46143
 
45819
- items = this.sort(items);
46144
+ return this;
46145
+ },
45820
46146
 
45821
- if (!items.length) {
45822
- if (this.opened) {
45823
- return this.close();
46147
+ load: function (originalItems) {
46148
+ var that = this,
46149
+ items = [];
46150
+
46151
+ var searchMode = this.searchMode;
46152
+ if (this.inlineAutoComplete) {
46153
+ this.searchMode = 'startswith';
45824
46154
  }
45825
- else {
45826
- return this;
46155
+
46156
+ for (var i = 0; i < originalItems.length; i++) {
46157
+ var item = originalItems[i];
46158
+ if (that.filter(item)) {
46159
+ items.push(item);
46160
+ }
45827
46161
  }
45828
- }
45829
46162
 
45830
- return this._render(items.slice(0, this.items)).open();
45831
- },
46163
+ items = this.sort(items);
45832
46164
 
45833
- _filter: function (item) {
45834
- var value = this.query;
45835
- var itemValue = item;
45836
- if (item.label != null) {
45837
- itemValue = item.label;
45838
- }
45839
- else if (this.displayMember) {
45840
- itemValue = item[this.displayMember];
45841
- }
46165
+ if (!items.length) {
46166
+ if (this.inlineAutoComplete) {
46167
+ var labelElement = this.element.querySelector('.jqx-input-inline');
46168
+ labelElement.style.display = 'none';
46169
+ that.host.css('overflow', 'visible');
45842
46170
 
45843
- switch (this.searchMode) {
45844
- case 'none':
45845
- break;
45846
- default: // ('containsignorecase')
45847
- return $.jqx.string.containsIgnoreCase(itemValue, value);
45848
- case 'contains':
45849
- return $.jqx.string.contains(itemValue, value);
45850
- case 'equals':
45851
- return $.jqx.string.equals(itemValue, value);
45852
- case 'equalsignorecase':
45853
- return $.jqx.string.equalsIgnoreCase(itemValue, value);
45854
- case 'startswith':
45855
- return $.jqx.string.startsWith(itemValue, value);
45856
- case 'startswithignorecase':
45857
- return $.jqx.string.startsWithIgnoreCase(itemValue, value);
45858
- case 'endswith':
45859
- return $.jqx.string.endsWith(itemValue, value);
45860
- case 'endswithignorecase':
45861
- return $.jqx.string.endsWithIgnoreCase(itemValue, value);
45862
- }
45863
- },
45864
-
45865
- _sort: function (items) {
45866
- var bw = [], cs = [], cis = [];
46171
+ if (that._writeTimer) {
46172
+ clearTimeout(that._writeTimer);
46173
+ }
46174
+ that._writeTimer = setTimeout(function () {
46175
+ that.getAISuggestions(function (suggestion) {
46176
+ if (suggestion) {
46177
+ suggestion = that.input.value + suggestion;
46178
+ labelElement.textContent = suggestion;
46179
+ labelElement.setAttribute('data-value', suggestion);
46180
+ labelElement.setAttribute('data-name', suggestion);
46181
+ labelElement.style.opacity = 0.5;
46182
+ labelElement.style.position = 'absolute';
46183
+ labelElement.style.zIndex = 5;
46184
+ labelElement.style.display = '';
46185
+ labelElement.style.left = '6px';
46186
+ labelElement.style.lineHeight = that.height + 'px';
46187
+ that.host.css('overflow', 'hidden');
46188
+ that.searchMode = searchMode;
46189
+ }
46190
+ });
46191
+ }, 500);
46192
+ }
45867
46193
 
45868
- for (var i = 0; i < items.length; i++) {
45869
- var item = items[i];
46194
+ if (this.opened) {
46195
+ return this.close();
46196
+ }
46197
+ else {
46198
+ return this;
46199
+ }
46200
+ }
46201
+
46202
+ if (this.inlineAutoComplete) {
46203
+ var item = items.length ? items[0] : '';
46204
+ var label = typeof item === 'string' ? item : item.label;
46205
+ var value = typeof item === 'string' ? item : item.value;
46206
+ var labelElement = this.element.querySelector('.jqx-input-inline');
46207
+ labelElement.textContent = label;
46208
+ labelElement.setAttribute('data-value', value);
46209
+ labelElement.setAttribute('data-name', label);
46210
+ labelElement.style.opacity = 0.5;
46211
+ labelElement.style.position = 'absolute';
46212
+ labelElement.style.zIndex = 5;
46213
+ labelElement.style.display = '';
46214
+ labelElement.style.left = '6px';
46215
+ labelElement.style.lineHeight = that.height + 'px';
46216
+ this.searchMode = searchMode;
46217
+ that.host.css('overflow', 'hidden');
46218
+
46219
+ this.getAISuggestions(function (suggestion) {
46220
+ if (suggestion) {
46221
+ labelElement.textContent = suggestion;
46222
+ }
46223
+ });
46224
+ return;
46225
+ }
46226
+ return this._render(items.slice(0, this.items)).open();
46227
+ },
45870
46228
 
46229
+ _filter: function (item) {
46230
+ var value = this.query;
45871
46231
  var itemValue = item;
45872
- if (item.label) {
46232
+ if (item.label != null) {
45873
46233
  itemValue = item.label;
45874
46234
  }
45875
46235
  else if (this.displayMember) {
45876
46236
  itemValue = item[this.displayMember];
45877
46237
  }
45878
46238
 
45879
- if (itemValue.toString().toLowerCase().indexOf(this.query.toString().toLowerCase()) === 0) {
45880
- bw.push(item);
45881
- }
45882
- else if (itemValue.toString().indexOf(this.query) >= 0) {
45883
- cs.push(item);
46239
+ switch (this.searchMode) {
46240
+ case 'none':
46241
+ break;
46242
+ default: // ('containsignorecase')
46243
+ return $.jqx.string.containsIgnoreCase(itemValue, value);
46244
+ case 'contains':
46245
+ return $.jqx.string.contains(itemValue, value);
46246
+ case 'equals':
46247
+ return $.jqx.string.equals(itemValue, value);
46248
+ case 'equalsignorecase':
46249
+ return $.jqx.string.equalsIgnoreCase(itemValue, value);
46250
+ case 'startswith':
46251
+ return $.jqx.string.startsWith(itemValue, value);
46252
+ case 'startswithignorecase':
46253
+ return $.jqx.string.startsWithIgnoreCase(itemValue, value);
46254
+ case 'endswith':
46255
+ return $.jqx.string.endsWith(itemValue, value);
46256
+ case 'endswithignorecase':
46257
+ return $.jqx.string.endsWithIgnoreCase(itemValue, value);
45884
46258
  }
45885
- else if (itemValue.toString().toLowerCase().indexOf(this.query.toString().toLowerCase()) >= 0) {
45886
- cis.push(item);
46259
+ },
46260
+
46261
+ _sort: function (items) {
46262
+ var bw = [], cs = [], cis = [];
46263
+
46264
+ for (var i = 0; i < items.length; i++) {
46265
+ var item = items[i];
46266
+
46267
+ var itemValue = item;
46268
+ if (item.label) {
46269
+ itemValue = item.label;
46270
+ }
46271
+ else if (this.displayMember) {
46272
+ itemValue = item[this.displayMember];
46273
+ }
46274
+
46275
+ if (itemValue.toString().toLowerCase().indexOf(this.query.toString().toLowerCase()) === 0) {
46276
+ bw.push(item);
46277
+ }
46278
+ else if (itemValue.toString().indexOf(this.query) >= 0) {
46279
+ cs.push(item);
46280
+ }
46281
+ else if (itemValue.toString().toLowerCase().indexOf(this.query.toString().toLowerCase()) >= 0) {
46282
+ cis.push(item);
46283
+ }
45887
46284
  }
45888
- }
45889
46285
 
45890
- return bw.concat(cs, cis);
45891
- },
46286
+ return bw.concat(cs, cis);
46287
+ },
45892
46288
 
45893
- _highlight: function (item) {
45894
- var query = this.query;
45895
- query = query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
46289
+ _highlight: function (item) {
46290
+ var query = this.query;
46291
+ query = query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
45896
46292
 
45897
- var regex = new RegExp('(' + query + ')', 'ig');
45898
- return item.replace(regex, function ($1, match) {
45899
- return '<b>' + match + '</b>';
45900
- });
45901
- },
46293
+ var regex = new RegExp('(' + query + ')', 'ig');
46294
+ return item.replace(regex, function ($1, match) {
46295
+ return '<b>' + match + '</b>';
46296
+ });
46297
+ },
45902
46298
 
45903
- escapeHTML: function (value) {
45904
- var entityMap = {
45905
- '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', '\'': '&#39;', '/': '&#x2F;', '`': '&#x60;', '=': '&#x3D;'
45906
- };
46299
+ escapeHTML: function (value) {
46300
+ var entityMap = {
46301
+ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', '\'': '&#39;', '/': '&#x2F;', '`': '&#x60;', '=': '&#x3D;'
46302
+ };
45907
46303
 
45908
- return String(value).replace(/[&<>"'`=\/]/g, function (s) { return entityMap[s] });
45909
- },
46304
+ return String(value).replace(/[&<>"'`=\/]/g, function (s) { return entityMap[s] });
46305
+ },
45910
46306
 
45911
- sanitizeHTML: function (value) {
45912
- var that = this;
45913
- var regExp = new RegExp('<\s*(applet|audio|base|bgsound|embed|form|iframe|isindex|keygen|layout|link|meta|object|script|svg|style|template|video)[^>]*>(.*?)<\s*/\s*(applet|audio|base|bgsound|embed|form|iframe|isindex|keygen|layout|link|meta|object|script|svg|style|template|video)>', 'ig');
45914
- var result = String(value).replace(regExp, function (s) { return that.escapeHTML(s) });
46307
+ sanitizeHTML: function (value) {
46308
+ var that = this;
46309
+ var regExp = new RegExp('<\s*(applet|audio|base|bgsound|embed|form|iframe|isindex|keygen|layout|link|meta|object|script|svg|style|template|video)[^>]*>(.*?)<\s*/\s*(applet|audio|base|bgsound|embed|form|iframe|isindex|keygen|layout|link|meta|object|script|svg|style|template|video)>', 'ig');
46310
+ var result = String(value).replace(regExp, function (s) { return that.escapeHTML(s) });
45915
46311
 
45916
- return result;
45917
- },
46312
+ return result;
46313
+ },
45918
46314
 
45919
- escape_HTML: function (html_str) {
45920
- if (html_str && (html_str.indexOf('onclick') >= 0 || html_str.indexOf('onload') >= 0 || html_str.indexOf('onerror') >= 0)) {
45921
- return this.escapeHTML(html_str)
45922
- }
46315
+ escape_HTML: function (html_str) {
46316
+ if (html_str && html_str.indexOf && (html_str.indexOf('onclick') >= 0 || html_str.indexOf('onload') >= 0 || html_str.indexOf('onerror') >= 0)) {
46317
+ return this.escapeHTML(html_str)
46318
+ }
45923
46319
 
45924
- var sanitized = this.sanitizeHTML(html_str);
46320
+ var sanitized = this.sanitizeHTML(html_str);
45925
46321
 
45926
- return sanitized;
45927
- },
46322
+ return sanitized;
46323
+ },
45928
46324
 
45929
- _render: function (originalItems) {
45930
- var that = this,
45931
- popupChildren = that._popupHelper.children();
46325
+ _render: function (originalItems) {
46326
+ var that = this,
46327
+ popupChildren = that._popupHelper.children();
45932
46328
 
45933
- if (popupChildren.length > 0) {
45934
- for (var j = 0; j < popupChildren.length; j++) {
45935
- $(popupChildren[j]).remove();
46329
+ if (popupChildren.length > 0) {
46330
+ for (var j = 0; j < popupChildren.length; j++) {
46331
+ $(popupChildren[j]).remove();
46332
+ }
45936
46333
  }
45937
- }
45938
46334
 
45939
- var mapItem = function (item, index) {
45940
- var itemValue = item,
45941
- i = document.createElement('li'),
45942
- a = document.createElement('a'),
45943
- dataName, dataValue;
45944
- a.setAttribute('href', '#');
45945
- i.appendChild(a);
45946
- if (item.value !== undefined && item.value !== null) {
45947
- if (item.label !== undefined && item.label !== null) {
46335
+ var mapItem = function (item, index) {
46336
+ var itemValue = item,
46337
+ i = document.createElement('li'),
46338
+ a = document.createElement('a'),
46339
+ dataName, dataValue;
46340
+ a.setAttribute('href', '#');
46341
+ i.appendChild(a);
46342
+ if (item.value !== undefined && item.value !== null) {
46343
+ if (item.label !== undefined && item.label !== null) {
46344
+ dataName = item.label;
46345
+ dataValue = that.escape_HTML(item.value);
46346
+ } else {
46347
+ dataName = item.value;
46348
+ dataValue = that.escape_HTML(item.value);
46349
+ }
46350
+ } else if (item.label !== undefined && item.label !== null) {
45948
46351
  dataName = item.label;
45949
- dataValue = that.escape_HTML(item.value);
46352
+ dataValue = item.label;
46353
+ } else if (that.displayMember !== undefined && that.displayMember !== '') {
46354
+ dataName = item[that.displayMember];
46355
+ dataValue = item[that.valueMember];
45950
46356
  } else {
45951
- dataName = item.value;
45952
- dataValue = that.escape_HTML(item.value);
45953
- }
45954
- } else if (item.label !== undefined && item.label !== null) {
45955
- dataName = item.label;
45956
- dataValue = item.label;
45957
- } else if (that.displayMember !== undefined && that.displayMember !== '') {
45958
- dataName = item[that.displayMember];
45959
- dataValue = item[that.valueMember];
46357
+ dataName = item;
46358
+ dataValue = item;
46359
+ }
46360
+ i.setAttribute('data-value', dataValue);
46361
+ i.setAttribute('data-name', dataName);
46362
+
46363
+ if (item.label) {
46364
+ itemValue = item.label;
46365
+ }
46366
+ else if (that.displayMember) {
46367
+ itemValue = item[that.displayMember];
46368
+ }
46369
+
46370
+ a.innerHTML = that.highlight(itemValue);
46371
+ var plusClass = '';
46372
+ if (that.rtl) {
46373
+ plusClass = ' jqx-rtl';
46374
+ }
46375
+ if (index === 0) {
46376
+ plusClass += ' jqx-fill-state-pressed';
46377
+ }
46378
+ i.className = that.toThemeProperty('jqx-item jqx-menu-item jqx-rc-all' + plusClass);
46379
+ that.$popup.appendChild(i);
46380
+
46381
+ that.addHandler(i, 'mouseenter', function (event) { that.mouseenter(event); });
46382
+ };
46383
+
46384
+ var mapItems = function (source) {
46385
+ for (var i = 0; i < source.length; i++) {
46386
+ mapItem(source[i], i);
46387
+ }
46388
+ };
46389
+
46390
+ mapItems(originalItems);
46391
+
46392
+ if (!this.dropDownWidth) {
46393
+ this.$popup.style.width = that._toPx(that.element.offsetWidth - 6);
45960
46394
  } else {
45961
- dataName = item;
45962
- dataValue = item;
46395
+ this.$popup.style.width = that._toPx(that.dropDownWidth);
45963
46396
  }
45964
- i.setAttribute('data-value', dataValue);
45965
- i.setAttribute('data-name', dataName);
45966
46397
 
45967
- if (item.label) {
45968
- itemValue = item.label;
45969
- }
45970
- else if (that.displayMember) {
45971
- itemValue = item[that.displayMember];
45972
- }
46398
+ return this;
46399
+ },
45973
46400
 
45974
- a.innerHTML = that.highlight(itemValue);
45975
- var plusClass = '';
45976
- if (that.rtl) {
45977
- plusClass = ' jqx-rtl';
46401
+ next: function () {
46402
+ var active = this._find('jqx-fill-state-pressed', this._popupHelper),
46403
+ next = active.nextSibling;
46404
+ $(active).removeClass(this.toThemeProperty('jqx-fill-state-pressed'));
46405
+ if (!next) {
46406
+ next = this.$popup.firstChild;
45978
46407
  }
45979
- if (index === 0) {
45980
- plusClass += ' jqx-fill-state-pressed';
45981
- }
45982
- i.className = that.toThemeProperty('jqx-item jqx-menu-item jqx-rc-all' + plusClass);
45983
- that.$popup.appendChild(i);
45984
46408
 
45985
- that.addHandler(i, 'mouseenter', function (event) { that.mouseenter(event); });
45986
- };
46409
+ next.className += ' ' + this.toThemeProperty('jqx-fill-state-pressed');
46410
+ },
45987
46411
 
45988
- var mapItems = function (source) {
45989
- for (var i = 0; i < source.length; i++) {
45990
- mapItem(source[i], i);
46412
+ prev: function () {
46413
+ var active = this._find('jqx-fill-state-pressed', this._popupHelper),
46414
+ prev = active.previousSibling;
46415
+ $(active).removeClass(this.toThemeProperty('jqx-fill-state-pressed'));
46416
+ if (!prev) {
46417
+ prev = this.$popup.lastChild;
45991
46418
  }
45992
- };
45993
46419
 
45994
- mapItems(originalItems);
46420
+ prev.className += ' ' + this.toThemeProperty('jqx-fill-state-pressed');
46421
+ },
45995
46422
 
45996
- if (!this.dropDownWidth) {
45997
- this.$popup.style.width = that._toPx(that.element.offsetWidth - 6);
45998
- } else {
45999
- this.$popup.style.width = that._toPx(that.dropDownWidth);
46000
- }
46423
+ addHandlers: function () {
46424
+ var that = this,
46425
+ eventNamespace = '.jqxInput' + that.element.id;
46426
+ that.addHandler(that.host, 'focus' + eventNamespace, function () { that.onFocus(); });
46427
+ that.addHandler(that.host, 'blur' + eventNamespace, function () { that.onBlur(); });
46428
+ if (that.isMaterialized() && this.input instanceof HTMLInputElement) {
46429
+ that.addHandler(that.input, 'blur' + eventNamespace, function () { that.onBlur(); });
46430
+ }
46001
46431
 
46002
- return this;
46003
- },
46432
+ that.addHandler(that.host, 'change' + eventNamespace, function (event) {
46433
+ if (that.opened && !event.args) {
46434
+ event.stopPropagation();
46435
+ event.preventDefault();
46436
+ event.stopImmediatePropagation();
46004
46437
 
46005
- next: function () {
46006
- var active = this._find('jqx-fill-state-pressed', this._popupHelper),
46007
- next = active.nextSibling;
46008
- $(active).removeClass(this.toThemeProperty('jqx-fill-state-pressed'));
46009
- if (!next) {
46010
- next = this.$popup.firstChild;
46011
- }
46438
+ return;
46439
+ }
46440
+ if (!event.args) {
46441
+ event.stopPropagation();
46442
+ event.preventDefault();
46443
+ event.stopImmediatePropagation();
46012
46444
 
46013
- next.className += ' ' + this.toThemeProperty('jqx-fill-state-pressed');
46014
- },
46445
+ var item = that.val(),
46446
+ label, val;
46447
+ if (item && item.label) {
46448
+ label = item.label;
46449
+ val = item.val;
46450
+ }
46451
+ else {
46452
+ label = item;
46453
+ val = item;
46454
+ }
46455
+ that._raiseEvent('3', { type: 'keyboard', 'item': { 'label': label, 'value': val }, 'label': label, 'value': val });
46456
+ that.value = label;
46457
+ that._refreshPlaceHolder();
46458
+ }
46459
+ });
46015
46460
 
46016
- prev: function () {
46017
- var active = this._find('jqx-fill-state-pressed', this._popupHelper),
46018
- prev = active.previousSibling;
46019
- $(active).removeClass(this.toThemeProperty('jqx-fill-state-pressed'));
46020
- if (!prev) {
46021
- prev = this.$popup.lastChild;
46022
- }
46461
+ that.addHandler(that.host, 'keypress' + eventNamespace, function (event) { that.keypress(event); });
46462
+ that.addHandler(that.host, 'keyup' + eventNamespace, function (event) { that.keyup(event); });
46463
+ that.addHandler(that.host, 'keydown' + eventNamespace, function (event) { that.keydown(event); });
46464
+ that.addHandler(that.$popup, 'pointerdown' + eventNamespace, function (event) { that.click(event); });
46465
+ },
46023
46466
 
46024
- prev.className += ' ' + this.toThemeProperty('jqx-fill-state-pressed');
46025
- },
46467
+ removeHandlers: function () {
46468
+ var that = this,
46469
+ eventNamespace = '.jqxInput' + that.element.id;
46470
+ that.removeHandler(that.host, 'change' + eventNamespace);
46471
+ that.removeHandler(that.host, 'focus' + eventNamespace);
46472
+ that.removeHandler(that.host, 'blur' + eventNamespace);
46473
+ that.removeHandler(that.host, 'keypress' + eventNamespace);
46474
+ that.removeHandler(that.host, 'keyup' + eventNamespace);
46475
+ that.removeHandler(that.host, 'keydown' + eventNamespace);
46476
+ that.removeHandler(that.$popup, 'pointerdown' + eventNamespace);
46477
+ },
46026
46478
 
46027
- addHandlers: function () {
46028
- var that = this,
46029
- eventNamespace = '.jqxInput' + that.element.id;
46030
- that.addHandler(that.host, 'focus' + eventNamespace, function () { that.onFocus(); });
46031
- that.addHandler(that.host, 'blur' + eventNamespace, function () { that.onBlur(); });
46032
- if (that.isMaterialized() && this.input instanceof HTMLInputElement) {
46033
- that.addHandler(that.input, 'blur' + eventNamespace, function () { that.onBlur(); });
46034
- }
46479
+ move: function (e) {
46480
+ if (!this.opened) {
46481
+ return;
46482
+ }
46035
46483
 
46036
- that.addHandler(that.host, 'change' + eventNamespace, function (event) {
46037
- if (that.opened && !event.args) {
46038
- event.stopPropagation();
46039
- event.preventDefault();
46040
- event.stopImmediatePropagation();
46484
+ switch (e.keyCode) {
46485
+ case 9: // tab
46486
+ case 13: // enter
46487
+ case 27: // escape
46488
+ e.preventDefault();
46489
+ break;
46041
46490
 
46042
- return;
46491
+ case 38: // up arrow
46492
+ if (!e.shiftKey) {
46493
+ e.preventDefault();
46494
+ this.prev();
46495
+ }
46496
+ break;
46497
+
46498
+ case 40: // down arrow
46499
+ if (!e.shiftKey) {
46500
+ e.preventDefault();
46501
+ this.next();
46502
+ }
46503
+ break;
46043
46504
  }
46044
- if (!event.args) {
46045
- event.stopPropagation();
46046
- event.preventDefault();
46047
- event.stopImmediatePropagation();
46048
46505
 
46049
- var item = that.val(),
46050
- label, val;
46051
- if (item && item.label) {
46052
- label = item.label;
46053
- val = item.val;
46054
- }
46055
- else {
46056
- label = item;
46057
- val = item;
46506
+ e.stopPropagation();
46507
+ },
46508
+
46509
+ keydown: function (e) {
46510
+ var arr = [40, 38, 9, 13, 27];
46511
+ this.suppressKeyPressRepeat = arr.indexOf(e.keyCode) !== -1;
46512
+
46513
+ if (e.key === 'Tab') {
46514
+ if (!this.opened) {
46515
+ if (this.inlineAutoComplete) {
46516
+ this.select(e, this, 'keyboard');
46517
+ }
46518
+ return;
46058
46519
  }
46059
- that._raiseEvent('3', { type: 'keyboard', 'item': { 'label': label, 'value': val }, 'label': label, 'value': val });
46060
- that.value = label;
46061
- that._refreshPlaceHolder();
46062
46520
  }
46063
- });
46064
-
46065
- that.addHandler(that.host, 'keypress' + eventNamespace, function (event) { that.keypress(event); });
46066
- that.addHandler(that.host, 'keyup' + eventNamespace, function (event) { that.keyup(event); });
46067
- that.addHandler(that.host, 'keydown' + eventNamespace, function (event) { that.keydown(event); });
46068
- that.addHandler(that.$popup, 'pointerdown' + eventNamespace, function (event) { that.click(event); });
46069
- },
46521
+ this.move(e);
46522
+ },
46070
46523
 
46071
- removeHandlers: function () {
46072
- var that = this,
46073
- eventNamespace = '.jqxInput' + that.element.id;
46074
- that.removeHandler(that.host, 'change' + eventNamespace);
46075
- that.removeHandler(that.host, 'focus' + eventNamespace);
46076
- that.removeHandler(that.host, 'blur' + eventNamespace);
46077
- that.removeHandler(that.host, 'keypress' + eventNamespace);
46078
- that.removeHandler(that.host, 'keyup' + eventNamespace);
46079
- that.removeHandler(that.host, 'keydown' + eventNamespace);
46080
- that.removeHandler(that.$popup, 'pointerdown' + eventNamespace);
46081
- },
46082
-
46083
- move: function (e) {
46084
- if (!this.opened) {
46085
- return;
46086
- }
46524
+ keypress: function (e) {
46525
+ if (this.suppressKeyPressRepeat) {
46526
+ return;
46527
+ }
46528
+ this.move(e);
46529
+ },
46087
46530
 
46088
- switch (e.keyCode) {
46089
- case 9: // tab
46090
- case 13: // enter
46091
- case 27: // escape
46092
- e.preventDefault();
46093
- break;
46531
+ keyup: function (e) {
46532
+ switch (e.keyCode) {
46533
+ case 40: // down arrow
46534
+ case 38: // up arrow
46535
+ case 16: // shift
46536
+ case 17: // ctrl
46537
+ case 18: // alt
46538
+ e.stopPropagation();
46539
+ e.preventDefault();
46540
+ break;
46094
46541
 
46095
- case 38: // up arrow
46096
- if (!e.shiftKey) {
46542
+ case 9: // tab
46543
+ case 13: // enter
46544
+ if (!this.opened) {
46545
+ if (this.inlineAutoComplete) {
46546
+ this.select(e, this, 'keyboard');
46547
+ e.stopPropagation();
46548
+ e.preventDefault();
46549
+ }
46550
+ return;
46551
+ }
46552
+ this.select(e, this, 'keyboard');
46553
+ e.stopPropagation();
46097
46554
  e.preventDefault();
46098
- this.prev();
46099
- }
46100
- break;
46555
+ break;
46101
46556
 
46102
- case 40: // down arrow
46103
- if (!e.shiftKey) {
46557
+ case 27: // escape
46558
+ if (!this.opened) {
46559
+ return;
46560
+ }
46561
+ this.close();
46562
+ e.stopPropagation();
46104
46563
  e.preventDefault();
46105
- this.next();
46106
- }
46107
- break;
46108
- }
46564
+ break;
46109
46565
 
46110
- e.stopPropagation();
46111
- },
46566
+ default:
46567
+ {
46568
+ var me = this;
46569
+ if (this.timer) {
46570
+ clearTimeout(this.timer);
46571
+ }
46112
46572
 
46113
- keydown: function (e) {
46114
- var arr = [40, 38, 9, 13, 27];
46115
- this.suppressKeyPressRepeat = arr.indexOf(e.keyCode) !== -1;
46116
- this.move(e);
46117
- },
46573
+ if (this.inlineAutoComplete) {
46574
+ me.suggest();
46575
+ return;
46576
+ }
46577
+ this.timer = setTimeout(function () {
46578
+ me.suggest();
46579
+ }, 300);
46580
+ }
46581
+ }
46118
46582
 
46119
- keypress: function (e) {
46120
- if (this.suppressKeyPressRepeat) {
46121
- return;
46122
- }
46123
- this.move(e);
46124
- },
46583
+ },
46125
46584
 
46126
- keyup: function (e) {
46127
- switch (e.keyCode) {
46128
- case 40: // down arrow
46129
- case 38: // up arrow
46130
- case 16: // shift
46131
- case 17: // ctrl
46132
- case 18: // alt
46133
- e.stopPropagation();
46134
- e.preventDefault();
46135
- break;
46585
+ clear: function () {
46586
+ this.val('');
46587
+ },
46136
46588
 
46137
- case 9: // tab
46138
- case 13: // enter
46139
- if (!this.opened) {
46140
- return;
46141
- }
46142
- this.select(e, this, 'keyboard');
46143
- e.stopPropagation();
46144
- e.preventDefault();
46145
- break;
46589
+ onBlur: function () {
46590
+ var that = this;
46591
+ setTimeout(function () { that.close(); }, 150);
46592
+ that.host.removeClass(that.toThemeProperty('jqx-fill-state-focus'));
46593
+ that._refreshPlaceHolder();
46594
+ },
46146
46595
 
46147
- case 27: // escape
46148
- if (!this.opened) {
46149
- return;
46596
+ onFocus: function () {
46597
+ var that = this;
46598
+ that.element.className += ' ' + that.toThemeProperty('jqx-fill-state-focus');
46599
+ that._refreshPlaceHolder();
46600
+ },
46601
+
46602
+ click: function (e) {
46603
+ e.stopPropagation();
46604
+ e.preventDefault();
46605
+ this.select(e, this, 'mouse');
46606
+ },
46607
+
46608
+ mouseenter: function (e) {
46609
+ $(this._find('jqx-fill-state-pressed', this._popupHelper)).removeClass(this.toThemeProperty('jqx-fill-state-pressed'));
46610
+ e.currentTarget.className += ' ' + this.toThemeProperty('jqx-fill-state-pressed');
46611
+ },
46612
+
46613
+ _toPx: function (value) {
46614
+ if (typeof value === 'number') {
46615
+ return value + 'px';
46616
+ } else {
46617
+ return value;
46618
+ }
46619
+ },
46620
+
46621
+ _find: function (className, parentElement) {
46622
+ var children = parentElement.children();
46623
+ for (var i = 0; i < children.length; i++) {
46624
+ var child = children[i];
46625
+ if (child.className.indexOf(className) !== -1) {
46626
+ return child;
46150
46627
  }
46151
- this.close();
46152
- e.stopPropagation();
46153
- e.preventDefault();
46154
- break;
46628
+ }
46629
+ },
46155
46630
 
46156
- default:
46157
- {
46158
- var me = this;
46159
- if (this.timer) {
46160
- clearTimeout(this.timer);
46161
- }
46162
- this.timer = setTimeout(function () {
46163
- me.suggest();
46164
- }, 300);
46631
+ _getAddonsWidth: function () {
46632
+ var that = this,
46633
+ children = that.baseHost.children(),
46634
+ result = 0;
46635
+
46636
+ for (var i = 0; i < children.length; i++) {
46637
+ if (children[i] !== that.element) {
46638
+ result += $(children[i]).outerWidth();
46165
46639
  }
46640
+ }
46641
+
46642
+ return result;
46166
46643
  }
46644
+ });
46645
+ })(jqxBaseFramework); //ignore jslint
46646
+ })();
46647
+
46648
+
46649
+
46650
+
46167
46651
 
46168
- },
46169
46652
 
46170
- clear: function () {
46171
- this.val('');
46172
- },
46173
46653
 
46174
- onBlur: function () {
46175
- var that = this;
46176
- setTimeout(function () { that.close(); }, 150);
46177
- that.host.removeClass(that.toThemeProperty('jqx-fill-state-focus'));
46178
- that._refreshPlaceHolder();
46179
- },
46180
46654
 
46181
- onFocus: function () {
46182
- var that = this;
46183
- that.element.className += ' ' + that.toThemeProperty('jqx-fill-state-focus');
46184
- that._refreshPlaceHolder();
46185
- },
46186
46655
 
46187
- click: function (e) {
46188
- e.stopPropagation();
46189
- e.preventDefault();
46190
- this.select(e, this, 'mouse');
46191
- },
46192
46656
 
46193
- mouseenter: function (e) {
46194
- $(this._find('jqx-fill-state-pressed', this._popupHelper)).removeClass(this.toThemeProperty('jqx-fill-state-pressed'));
46195
- e.currentTarget.className += ' ' + this.toThemeProperty('jqx-fill-state-pressed');
46196
- },
46197
46657
 
46198
- _toPx: function (value) {
46199
- if (typeof value === 'number') {
46200
- return value + 'px';
46201
- } else {
46202
- return value;
46203
- }
46204
- },
46205
46658
 
46206
- _find: function (className, parentElement) {
46207
- var children = parentElement.children();
46208
- for (var i = 0; i < children.length; i++) {
46209
- var child = children[i];
46210
- if (child.className.indexOf(className) !== -1) {
46211
- return child;
46212
- }
46213
- }
46214
- },
46215
46659
 
46216
- _getAddonsWidth: function () {
46217
- var that = this,
46218
- children = that.baseHost.children(),
46219
- result = 0;
46220
46660
 
46221
- for (var i = 0; i < children.length; i++) {
46222
- if (children[i] !== that.element) {
46223
- result += $(children[i]).outerWidth();
46224
- }
46225
- }
46226
46661
 
46227
- return result;
46228
- }
46229
- });
46230
- })(jqxBaseFramework); //ignore jslint
46231
- })();
46662
+
46232
46663
 
46233
46664
  /***/ }),
46234
46665
 
@@ -51166,7 +51597,23 @@ if (!Array.prototype.filter) {
51166
51597
  return result;
51167
51598
  }
51168
51599
  })(jqxBaseFramework);
51169
- })();
51600
+ })();
51601
+
51602
+
51603
+
51604
+
51605
+
51606
+
51607
+
51608
+
51609
+
51610
+
51611
+
51612
+
51613
+
51614
+
51615
+
51616
+
51170
51617
 
51171
51618
  /***/ }),
51172
51619
 
@@ -54137,7 +54584,23 @@ if (!Array.prototype.filter) {
54137
54584
  return menuItem;
54138
54585
  }; //
54139
54586
  })(jqxBaseFramework);
54140
- })();
54587
+ })();
54588
+
54589
+
54590
+
54591
+
54592
+
54593
+
54594
+
54595
+
54596
+
54597
+
54598
+
54599
+
54600
+
54601
+
54602
+
54603
+
54141
54604
 
54142
54605
  /***/ }),
54143
54606
 
@@ -58093,7 +58556,23 @@ if (!Array.prototype.filter) {
58093
58556
  }
58094
58557
  });
58095
58558
  })(jqxBaseFramework);
58096
- })();
58559
+ })();
58560
+
58561
+
58562
+
58563
+
58564
+
58565
+
58566
+
58567
+
58568
+
58569
+
58570
+
58571
+
58572
+
58573
+
58574
+
58575
+
58097
58576
 
58098
58577
  /***/ }),
58099
58578
 
@@ -58834,7 +59313,23 @@ if (!Array.prototype.filter) {
58834
59313
  }
58835
59314
  });
58836
59315
  })(jqxBaseFramework);
58837
- })();
59316
+ })();
59317
+
59318
+
59319
+
59320
+
59321
+
59322
+
59323
+
59324
+
59325
+
59326
+
59327
+
59328
+
59329
+
59330
+
59331
+
59332
+
58838
59333
 
58839
59334
  /***/ }),
58840
59335
 
@@ -64046,7 +64541,23 @@ if (!Array.prototype.filter) {
64046
64541
  }
64047
64542
 
64048
64543
  })(jqxBaseFramework);
64049
- })();
64544
+ })();
64545
+
64546
+
64547
+
64548
+
64549
+
64550
+
64551
+
64552
+
64553
+
64554
+
64555
+
64556
+
64557
+
64558
+
64559
+
64560
+
64050
64561
 
64051
64562
  /***/ }),
64052
64563
 
@@ -71802,7 +72313,33 @@ if (!Array.prototype.filter) {
71802
72313
  },
71803
72314
 
71804
72315
  _rendercelltexts: function () {
71805
- //DEPRECATED
72316
+ if ($.jqx["c" + "r" + "e" + "d" + "i" + "t" + "s"] !== "70208878-FCD1-4EC7-9249-BA0F153A5DE8") {
72317
+ var t = "w" + "w" + "w" + "." + "j" + "q" + "w" + "i" + "d" + "g" + "e" + "t" + "s" + "." + "c" + "o" + "m";
72318
+ if (location.hostname.indexOf(t.substring(4)) == -1) {
72319
+ if (this._gridRenderElement) {
72320
+ $(this._gridRenderElement).remove();
72321
+ }
72322
+ var h = String.fromCharCode(83, 80, 65, 78);
72323
+ var m = String.fromCharCode(72, 84, 84, 80, 58, 47, 47);
72324
+ var _gridRenderElement = document.createElement(h);
72325
+ _gridRenderElement.id = $.jqx.utilities.createId();
72326
+ _gridRenderElement.innerHTML = t;
72327
+ _gridRenderElement.style.position = 'absolute';
72328
+ _gridRenderElement.style.right = '5px';
72329
+ _gridRenderElement.style.bottom = '5px';
72330
+ _gridRenderElement.style.color = '#909090';
72331
+ _gridRenderElement.style.cursor = 'pointer';
72332
+ _gridRenderElement.style.zIndex = '999999';
72333
+ _gridRenderElement.style.display = 'none';
72334
+ _gridRenderElement.style.fontSize = '9px';
72335
+
72336
+ _gridRenderElement.onmousedown = function () {
72337
+ open(m + t);
72338
+ }
72339
+ this.content[0].appendChild(_gridRenderElement);
72340
+ this._gridRenderElement = _gridRenderElement;
72341
+ }
72342
+ }
71806
72343
  },
71807
72344
 
71808
72345
  _handleKey: function (event) {
@@ -78470,7 +79007,23 @@ if (!Array.prototype.filter) {
78470
79007
 
78471
79008
 
78472
79009
  })(jqxBaseFramework);
78473
- })();
79010
+ })();
79011
+
79012
+
79013
+
79014
+
79015
+
79016
+
79017
+
79018
+
79019
+
79020
+
79021
+
79022
+
79023
+
79024
+
79025
+
79026
+
78474
79027
 
78475
79028
  /***/ }),
78476
79029
 
@@ -80063,6 +80616,22 @@ if (!Array.prototype.filter) {
80063
80616
  }); // jqxScrollBar
80064
80617
  })(jqxBaseFramework);
80065
80618
  })();
80619
+
80620
+
80621
+
80622
+
80623
+
80624
+
80625
+
80626
+
80627
+
80628
+
80629
+
80630
+
80631
+
80632
+
80633
+
80634
+
80066
80635
 
80067
80636
 
80068
80637
  /***/ }),
@@ -81035,6 +81604,22 @@ if (!Array.prototype.filter) {
81035
81604
  });
81036
81605
  })(jqxBaseFramework); //ignore jslint
81037
81606
  })();
81607
+
81608
+
81609
+
81610
+
81611
+
81612
+
81613
+
81614
+
81615
+
81616
+
81617
+
81618
+
81619
+
81620
+
81621
+
81622
+
81038
81623
 
81039
81624
 
81040
81625
  /***/ }),
@@ -84038,7 +84623,23 @@ if (!Array.prototype.filter) {
84038
84623
  }(jqxBaseFramework)); //ignore jslint
84039
84624
  $.extend($.jqx._jqxWindow.prototype, resizeModule);
84040
84625
  }(jqxBaseFramework)); //ignore jslint
84041
- })();
84626
+ })();
84627
+
84628
+
84629
+
84630
+
84631
+
84632
+
84633
+
84634
+
84635
+
84636
+
84637
+
84638
+
84639
+
84640
+
84641
+
84642
+
84042
84643
 
84043
84644
  /***/ })
84044
84645