@sapui5/sap.rules.ui 1.107.0 → 1.108.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/sap/rules/ui/.library +1 -1
- package/src/sap/rules/ui/AstExpressionBasic.js +27 -6
- package/src/sap/rules/ui/AstExpressionBasicRenderer.js +71 -55
- package/src/sap/rules/ui/AutoCompleteSuggestionContent.js +5 -3
- package/src/sap/rules/ui/AutoCompleteSuggestionContentRenderer.js +39 -40
- package/src/sap/rules/ui/BindingSpy.js +1 -1
- package/src/sap/rules/ui/DecisionTable.js +2157 -2154
- package/src/sap/rules/ui/DecisionTableCell.js +7 -4
- package/src/sap/rules/ui/DecisionTableCellAstExpressionBasic.js +7 -4
- package/src/sap/rules/ui/DecisionTableCellAstExpressionBasicRenderer.js +5 -3
- package/src/sap/rules/ui/DecisionTableCellExpressionAdvanced.js +238 -236
- package/src/sap/rules/ui/DecisionTableCellExpressionAdvancedRenderer.js +6 -4
- package/src/sap/rules/ui/DecisionTableCellExpressionBasic.js +7 -4
- package/src/sap/rules/ui/DecisionTableCellExpressionBasicRenderer.js +6 -4
- package/src/sap/rules/ui/DecisionTableCellRenderer.js +10 -10
- package/src/sap/rules/ui/DecisionTableConfiguration.js +1 -1
- package/src/sap/rules/ui/DecisionTableRenderer.js +163 -161
- package/src/sap/rules/ui/DecisionTableSettings.js +6 -4
- package/src/sap/rules/ui/DecisionTableSettingsOld.js +963 -961
- package/src/sap/rules/ui/DecisionTableSettingsOldRenderer.js +9 -10
- package/src/sap/rules/ui/DecisionTableSettingsRenderer.js +9 -10
- package/src/sap/rules/ui/ExpressionAdvanced.js +1726 -1724
- package/src/sap/rules/ui/ExpressionAdvancedRenderer.js +8 -8
- package/src/sap/rules/ui/ExpressionBase.js +1 -1
- package/src/sap/rules/ui/ExpressionBasic.js +7 -4
- package/src/sap/rules/ui/ExpressionBasicRenderer.js +8 -7
- package/src/sap/rules/ui/InstructionRenderer.js +73 -33
- package/src/sap/rules/ui/RuleBase.js +1 -1
- package/src/sap/rules/ui/RuleBuilder.js +433 -430
- package/src/sap/rules/ui/RuleBuilderRenderer.js +8 -9
- package/src/sap/rules/ui/TextRule.js +7 -4
- package/src/sap/rules/ui/TextRuleConfiguration.js +1 -1
- package/src/sap/rules/ui/TextRuleRenderer.js +45 -44
- package/src/sap/rules/ui/TextRuleSettings.js +6 -4
- package/src/sap/rules/ui/TextRuleSettingsRenderer.js +9 -9
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionAdvancedFunctionPanel.js +4 -3
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionAdvancedFunctionPanelRenderer.js +10 -11
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionAggregateFunctionPanel.js +100 -98
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionAggregateFunctionPanelRenderer.js +9 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionArrayOperatorPanel.js +4 -3
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionArrayOperatorPanelRenderer.js +10 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionComparisionOperatorPanel.js +109 -107
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionComparisionOperatorPanelRenderer.js +39 -40
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionDateAndTimePanel.js +5 -3
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionDateAndTimePanelRenderer.js +10 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionFixedValuePanel.js +840 -838
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionFixedValuePanelRenderer.js +40 -40
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionFunctionalOperatorPanel.js +4 -3
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionFunctionalOperatorPanelRenderer.js +10 -11
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionLogicalOperatorPanel.js +112 -110
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionLogicalOperatorPanelRenderer.js +39 -40
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionLoopFunctionPanel.js +100 -98
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionLoopFunctionPanelRenderer.js +9 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionMathematicalOperatorPanel.js +122 -119
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionMathematicalOperatorPanelRenderer.js +39 -40
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionMiscellaneousOperatorPanel.js +5 -2
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionMiscellaneousOperatorPanelRenderer.js +10 -11
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionOperationsPanel.js +4 -3
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionOperationsPanelRenderer.js +10 -11
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionRangeOperatorPanel.js +4 -3
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionRangeOperatorPanelRenderer.js +10 -11
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionSelectFunctionPanel.js +108 -106
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionSelectFunctionPanelRenderer.js +40 -40
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionTimeAndDurationFunctionPanel.js +254 -252
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionTimeAndDurationFunctionPanelRenderer.js +40 -40
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionVocabularyPanel.js +631 -629
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionVocabularyPanelRenderer.js +40 -40
- package/src/sap/rules/ui/library.js +31 -10
- package/src/sap/rules/ui/type/ExpressionAbs.js +1 -1
|
@@ -1,1727 +1,1729 @@
|
|
|
1
|
-
/*!
|
|
1
|
+
/*!
|
|
2
2
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
3
|
|
|
4
4
|
(c) Copyright 2009-2016 SAP SE. All rights reserved
|
|
5
|
-
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
// Provides the sap.rules.ui.ExpressionAdvanced control
|
|
9
|
-
sap.ui.define([
|
|
10
|
-
"
|
|
11
|
-
"sap/
|
|
12
|
-
"sap/
|
|
13
|
-
"sap/
|
|
14
|
-
"sap/m/
|
|
15
|
-
"sap/m/
|
|
16
|
-
"sap/m/
|
|
17
|
-
"sap/
|
|
18
|
-
"sap/
|
|
19
|
-
"sap/ui/
|
|
20
|
-
"
|
|
21
|
-
"sap
|
|
22
|
-
"sap/ui/
|
|
23
|
-
"sap/
|
|
24
|
-
"sap/ui/
|
|
25
|
-
"sap/
|
|
26
|
-
"sap/rules/ui/
|
|
27
|
-
"sap/rules/ui/codemirror/
|
|
28
|
-
"sap/rules/ui/codemirror/
|
|
29
|
-
"sap/rules/ui/codemirror/
|
|
30
|
-
"sap/rules/ui/codemirror/addon/
|
|
31
|
-
"sap/rules/ui/codemirror/addon/
|
|
32
|
-
"sap/rules/ui/codemirror/addon/
|
|
33
|
-
"sap/rules/ui/codemirror/addon/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* @param {
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* @
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* @
|
|
53
|
-
* @
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* @
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
* The
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
"
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
jQuery.sap.
|
|
145
|
-
jQuery.sap.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
this.
|
|
150
|
-
this.
|
|
151
|
-
this.
|
|
152
|
-
this.
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
this.
|
|
162
|
-
this.
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
this.
|
|
177
|
-
this.
|
|
178
|
-
this.
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
this.
|
|
190
|
-
|
|
191
|
-
this.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
var
|
|
205
|
-
var
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
var
|
|
231
|
-
var
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
var
|
|
241
|
-
var
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
'
|
|
251
|
-
'
|
|
252
|
-
|
|
253
|
-
'aria-
|
|
254
|
-
|
|
255
|
-
'
|
|
256
|
-
|
|
257
|
-
'
|
|
258
|
-
|
|
259
|
-
'
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
pop.
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
jQuery(".sapMText").css('
|
|
274
|
-
jQuery(".sapMText").css('padding-
|
|
275
|
-
jQuery(".sapMText").css('padding-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
oDataModel.
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
var
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
tokenMetaData.end = tokenMetaData.end + 1;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
this.
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
this.
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
/*
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
*
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
this.codeMirror.
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
this.
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
//
|
|
467
|
-
//
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
this.
|
|
471
|
-
this.
|
|
472
|
-
this.
|
|
473
|
-
this.
|
|
474
|
-
this.
|
|
475
|
-
this.
|
|
476
|
-
this.
|
|
477
|
-
this.
|
|
478
|
-
this.
|
|
479
|
-
this.
|
|
480
|
-
this.
|
|
481
|
-
this.
|
|
482
|
-
this.
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
this.
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
var
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
that.
|
|
536
|
-
that.
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
that.
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
var
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
this.
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
//
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
this._raiseError("model
|
|
625
|
-
} else if (
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
var
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
var
|
|
689
|
-
var
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
this.
|
|
713
|
-
this.
|
|
714
|
-
this.oValueHelpDialog.
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
this.
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
that.
|
|
749
|
-
that.
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
that.
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
that.
|
|
762
|
-
that.
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
this.
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
var
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
oTable.
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
this.oValueHelpDialog.getTable().setNoData(that.oBundle.getText("
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
oTable.
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
var
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
aFilters = that.
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
_valueField
|
|
1004
|
-
|
|
1005
|
-
_valueField
|
|
1006
|
-
|
|
1007
|
-
_valueField
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
var
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
aComputeFilterParma = aFilters[0].aFilters[index].aFilters;
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
_valueField
|
|
1037
|
-
|
|
1038
|
-
_valueField
|
|
1039
|
-
|
|
1040
|
-
_valueField
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
*
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
var
|
|
1100
|
-
var
|
|
1101
|
-
var
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
curPostion
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
}
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
var
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
}
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
(businessDataType ===
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
var
|
|
1170
|
-
var
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
this.codeMirror.
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
this.codeMirror.
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
oAdvancedExpressionEditor.timer
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
*
|
|
1259
|
-
*
|
|
1260
|
-
*
|
|
1261
|
-
*
|
|
1262
|
-
*
|
|
1263
|
-
*
|
|
1264
|
-
*
|
|
1265
|
-
*
|
|
1266
|
-
*
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
"
|
|
1303
|
-
"
|
|
1304
|
-
"
|
|
1305
|
-
"
|
|
1306
|
-
"
|
|
1307
|
-
"'
|
|
1308
|
-
"'
|
|
1309
|
-
"'
|
|
1310
|
-
"'
|
|
1311
|
-
"'
|
|
1312
|
-
"'
|
|
1313
|
-
"'
|
|
1314
|
-
"'
|
|
1315
|
-
"'
|
|
1316
|
-
"'
|
|
1317
|
-
"'
|
|
1318
|
-
"'
|
|
1319
|
-
"'
|
|
1320
|
-
"'
|
|
1321
|
-
"'
|
|
1322
|
-
"'
|
|
1323
|
-
"'
|
|
1324
|
-
"'
|
|
1325
|
-
"'
|
|
1326
|
-
"'
|
|
1327
|
-
"'
|
|
1328
|
-
"'
|
|
1329
|
-
"'
|
|
1330
|
-
"'
|
|
1331
|
-
"'
|
|
1332
|
-
"'
|
|
1333
|
-
"'
|
|
1334
|
-
"'
|
|
1335
|
-
"'
|
|
1336
|
-
"'
|
|
1337
|
-
"'
|
|
1338
|
-
"'
|
|
1339
|
-
"'
|
|
1340
|
-
"'
|
|
1341
|
-
"'
|
|
1342
|
-
"'
|
|
1343
|
-
"'
|
|
1344
|
-
"'
|
|
1345
|
-
"'
|
|
1346
|
-
"'
|
|
1347
|
-
"'
|
|
1348
|
-
"'
|
|
1349
|
-
"'
|
|
1350
|
-
"'
|
|
1351
|
-
"'
|
|
1352
|
-
"'
|
|
1353
|
-
"'
|
|
1354
|
-
"'
|
|
1355
|
-
"'
|
|
1356
|
-
"'
|
|
1357
|
-
"'
|
|
1358
|
-
"'
|
|
1359
|
-
"'
|
|
1360
|
-
"'
|
|
1361
|
-
"'
|
|
1362
|
-
"'
|
|
1363
|
-
"'
|
|
1364
|
-
"'
|
|
1365
|
-
"'
|
|
1366
|
-
"'
|
|
1367
|
-
"'
|
|
1368
|
-
"'
|
|
1369
|
-
"'
|
|
1370
|
-
"'
|
|
1371
|
-
"'
|
|
1372
|
-
"'
|
|
1373
|
-
"'
|
|
1374
|
-
"'
|
|
1375
|
-
"
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
var
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
//
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
//
|
|
1451
|
-
|
|
1452
|
-
//
|
|
1453
|
-
|
|
1454
|
-
//
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
jQuery(
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
jQuery(this.codeMirror.getWrapperElement()).
|
|
1466
|
-
}
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
oCodeMirror.
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
*
|
|
1573
|
-
* @
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
}
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
oAdvancedExpressionEditor.
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
oAdvancedExpressionEditor.
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
//
|
|
1627
|
-
//
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
oAdvancedExpressionEditor.
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
jQuery(
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
this.
|
|
1703
|
-
}
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
this.
|
|
1714
|
-
|
|
1715
|
-
this.
|
|
1716
|
-
}
|
|
1717
|
-
this.oContextMenu.
|
|
1718
|
-
}
|
|
1719
|
-
|
|
1720
|
-
}
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
5
|
+
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// Provides the sap.rules.ui.ExpressionAdvanced control
|
|
9
|
+
sap.ui.define([
|
|
10
|
+
"./ExpressionAdvancedRenderer",
|
|
11
|
+
"sap/base/Log",
|
|
12
|
+
"sap/m/Dialog",
|
|
13
|
+
"sap/ui/core/Control",
|
|
14
|
+
"sap/m/Button",
|
|
15
|
+
"sap/m/TextArea",
|
|
16
|
+
"sap/m/Text",
|
|
17
|
+
"sap/m/MessageBox",
|
|
18
|
+
"sap/ui/layout/HorizontalLayout",
|
|
19
|
+
"sap/rules/ui/Utils",
|
|
20
|
+
"sap/ui/core/Popup",
|
|
21
|
+
"jquery.sap.global",
|
|
22
|
+
"sap/rules/ui/ExpressionBase",
|
|
23
|
+
"sap/ui/comp/odata/MetadataAnalyser",
|
|
24
|
+
"sap/rules/ui/providers/ValueHelpProvider",
|
|
25
|
+
"sap/ui/core/LocaleData",
|
|
26
|
+
"sap/rules/ui/Constants",
|
|
27
|
+
"sap/rules/ui/codemirror/lib/codemirror",
|
|
28
|
+
"sap/rules/ui/codemirror/addon/hint/show-hint",
|
|
29
|
+
"sap/rules/ui/codemirror/mode/hdf/hdf",
|
|
30
|
+
"sap/rules/ui/codemirror/addon/display/placeholder",
|
|
31
|
+
"sap/rules/ui/codemirror/addon/mh/mark-selection",
|
|
32
|
+
"sap/rules/ui/codemirror/addon/hint/hdf-hint",
|
|
33
|
+
"sap/rules/ui/codemirror/addon/closeBrackets/closebrackets",
|
|
34
|
+
"sap/rules/ui/codemirror/addon/search/search"
|
|
35
|
+
|
|
36
|
+
], function(ExpressionAdvancedRenderer, Log, Dialog, Control, Button, TextArea, Text, MessageBox, HorizontalLayout, Utils, Popup, jQ, ExpressionBase, MetadataAnalyser,
|
|
37
|
+
ValueHelpProvider, LocaleData, Constants) {
|
|
38
|
+
"use strict";
|
|
39
|
+
/**
|
|
40
|
+
* Constructor for a new ExpressionAdvanced.
|
|
41
|
+
*
|
|
42
|
+
* @param {string} [sId] ID for the new control, generated automatically if no ID is given
|
|
43
|
+
* @param {object} [mSettings] Initial settings for the new control
|
|
44
|
+
*
|
|
45
|
+
* @class
|
|
46
|
+
* The <code>sap.rules.ui.ExpressionAdvanced</code> control provides the ability to define expressions for complex rules in a decision table.
|
|
47
|
+
* @extends sap.ui.core.Control
|
|
48
|
+
*
|
|
49
|
+
* @author SAP SE
|
|
50
|
+
* @version 1.58.1
|
|
51
|
+
*
|
|
52
|
+
* @constructor
|
|
53
|
+
* @private
|
|
54
|
+
* @experimental Only for internal use.
|
|
55
|
+
*
|
|
56
|
+
* @alias sap.rules.ui.ExpressionAdvanced
|
|
57
|
+
* @ui5-metamodel This control also will be described in the UI5 (legacy) designtime metamodel
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
var ExpressionAdvanced = ExpressionBase.extend("sap.rules.ui.ExpressionAdvanced", {
|
|
61
|
+
|
|
62
|
+
metadata: {
|
|
63
|
+
properties: {
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The business data type of the expression (e.g. String, Number, Boolean).
|
|
67
|
+
* The default value <code>sap.rules.ui.ExpressionType.All</code> means that all valid business data types are permitted.
|
|
68
|
+
*/
|
|
69
|
+
type: {
|
|
70
|
+
type: "sap.rules.ui.ExpressionType",
|
|
71
|
+
defaultValue: sap.rules.ui.ExpressionType.All,
|
|
72
|
+
bindable: "bindable"
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Defines weather the expression evaluates to a collection of values or to a single value.
|
|
77
|
+
*/
|
|
78
|
+
collection: {
|
|
79
|
+
type: "boolean",
|
|
80
|
+
defaultValue: false
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Defines a short hint intended to aid the user with data entry when the control has no value.
|
|
85
|
+
*/
|
|
86
|
+
placeholder: {
|
|
87
|
+
type: "string",
|
|
88
|
+
defaultValue: null
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Defines whether the focus is set to the control upon loading.
|
|
93
|
+
*/
|
|
94
|
+
focusOnLoad: {
|
|
95
|
+
type: "boolean",
|
|
96
|
+
defaultValue: false
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
attributeInfo: {
|
|
100
|
+
type: "string",
|
|
101
|
+
defaultValue: "",
|
|
102
|
+
bindable: "bindable"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
aggregations: {
|
|
106
|
+
|
|
107
|
+
// A hidden text area is provided for the codemirror rendering.
|
|
108
|
+
_expressionArea: {
|
|
109
|
+
type: "sap.m.TextArea",
|
|
110
|
+
multiple: false,
|
|
111
|
+
visibility: "hidden"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
events: {
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* This event is fired when the text in the input field has changed and the focus leaves the input field or the enter key is pressed.
|
|
118
|
+
*/
|
|
119
|
+
"change": {},
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* This event is fired when the value of the input is changed - e.g. at each keypress
|
|
123
|
+
*/
|
|
124
|
+
"liveChange": {},
|
|
125
|
+
"valueHelpRequest": {
|
|
126
|
+
parameters: {
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* The event parameter is set to true, when the button at the end of the suggestion table is clicked, otherwise false. It can be used to determine whether the "value help" trigger or the "show all items" trigger has been pressed.
|
|
130
|
+
*/
|
|
131
|
+
fromSuggestions: {
|
|
132
|
+
type: "boolean"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
publicMethosds: ["validate"]
|
|
138
|
+
},
|
|
139
|
+
renderer: ExpressionAdvancedRenderer
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
ExpressionAdvanced.prototype.init = function() {
|
|
143
|
+
ExpressionBase.prototype.init.apply(this, arguments);
|
|
144
|
+
var codeMirrorCSS = jQuery.sap.getModulePath("sap.rules.ui.codemirror.lib") + "/codemirror.css";
|
|
145
|
+
var showHintCSS = jQuery.sap.getModulePath("sap.rules.ui.codemirror.addon.hint") + "/show-hint.css";
|
|
146
|
+
jQuery.sap.includeStyleSheet(codeMirrorCSS);
|
|
147
|
+
jQuery.sap.includeStyleSheet(showHintCSS);
|
|
148
|
+
|
|
149
|
+
this.pop = new Popup(jQ('<span></span>')[0], false, false, false);
|
|
150
|
+
this.errorWidgets = [];
|
|
151
|
+
this.expressionTokens = [];
|
|
152
|
+
this._liveValue = "";
|
|
153
|
+
this.oBundle = sap.ui.getCore().getLibraryResourceBundle("sap.rules.ui.i18n");
|
|
154
|
+
this.dataModel = this.initControlDataModel();
|
|
155
|
+
|
|
156
|
+
// Expression area
|
|
157
|
+
this.oTextArea = new TextArea({
|
|
158
|
+
width: "100%"
|
|
159
|
+
});
|
|
160
|
+
this.validationCompleteEvent = document.createEvent("Event");
|
|
161
|
+
this.validationCompleteEvent.initEvent("validationCompleteEvent", true, false);
|
|
162
|
+
//this.validationCompleteEvent = document.createEvent("validationCompleteEvent");
|
|
163
|
+
this.setAggregation("_expressionArea", this.oTextArea, true);
|
|
164
|
+
this.bFlagForEventListener = true;
|
|
165
|
+
|
|
166
|
+
// Date instance which is used to convert the selected date from calendar control to short format
|
|
167
|
+
var oLocale = sap.ui.getCore().getConfiguration().getFormatSettings().getFormatLocale();
|
|
168
|
+
var oLocaleData = LocaleData.getInstance(oLocale);
|
|
169
|
+
|
|
170
|
+
this.oFormatDate = sap.ui.core.format.DateFormat.getInstance({
|
|
171
|
+
pattern: oLocaleData.getDatePattern('short'),
|
|
172
|
+
calendarType: sap.ui.core.CalendarType.Gregorian
|
|
173
|
+
},
|
|
174
|
+
oLocale
|
|
175
|
+
);
|
|
176
|
+
this._dateBusinessDataType = "Date";
|
|
177
|
+
this._valueHelpSelectionText = "Select from value help...";
|
|
178
|
+
this._hasValueSource = "HasValueSource";
|
|
179
|
+
this._propertyValue = "Value";
|
|
180
|
+
this._propertyDescription = "Description";
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
ExpressionAdvanced.prototype._processValidationResult = function(result) {
|
|
184
|
+
if (result.status === sap.rules.ui.ValidationStatus.Error) {
|
|
185
|
+
var msg = Utils.parseUTFToString(result.errorDetails /* || "unknown message" */ );
|
|
186
|
+
msg = msg.replace(/\r\n/g, " ").replace(/\r/g, " ").replace(/\n/g, " ");
|
|
187
|
+
this.errorCursorPosition = result.cursorPosition;
|
|
188
|
+
this.setValueStateText(msg);
|
|
189
|
+
//this._showPopUp();
|
|
190
|
+
} else {
|
|
191
|
+
this.oTextArea.setValueState("None");
|
|
192
|
+
this.oTextArea.setValueStateText("");
|
|
193
|
+
this.setValueStateText("");
|
|
194
|
+
jQuery(this.codeMirror.getWrapperElement()).removeClass('sapMInputBaseStateInner sapMInputBaseErrorInner sapMInputBaseContentWrapper sapMInputBaseContentWrapperState sapMInputBaseContentWrapperError');
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
ExpressionAdvanced.prototype.validateExpression = function(sInput) {
|
|
200
|
+
for (var i = 0; i < this.errorWidgets.length; i++) {
|
|
201
|
+
this.codeMirror.removeLineWidget(this.errorWidgets[i]);
|
|
202
|
+
}
|
|
203
|
+
this.errorWidgets = [];
|
|
204
|
+
var expressionValue = this.codeMirror ? this.codeMirror.getValue() : this.getValue();
|
|
205
|
+
var result = {};
|
|
206
|
+
var incomingdata = {};
|
|
207
|
+
var oEL = sap.ui.getCore().byId(this.getExpressionLanguage());
|
|
208
|
+
if (oEL) {
|
|
209
|
+
incomingdata = oEL.validateExpression(
|
|
210
|
+
sInput || expressionValue,
|
|
211
|
+
this.getProperty("type"),
|
|
212
|
+
this.getCollection(),
|
|
213
|
+
false
|
|
214
|
+
);
|
|
215
|
+
if (incomingdata && this.isActive()) {
|
|
216
|
+
result = incomingdata;
|
|
217
|
+
this._processValidationResult(result);
|
|
218
|
+
if (result.deferredResult) {
|
|
219
|
+
result.deferredResult.done(function(result) {
|
|
220
|
+
this._processValidationResult(result);
|
|
221
|
+
document.dispatchEvent(this.validationCompleteEvent);
|
|
222
|
+
}.bind(this));
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return incomingdata;
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
ExpressionAdvanced.prototype._showPopUp = function() {
|
|
230
|
+
var errorState = "Error";
|
|
231
|
+
var errorMessage = this.getProperty("valueStateText");
|
|
232
|
+
var thisId = this.getId() + '-message';
|
|
233
|
+
var pop = this.pop; //new Popup(jQ('<span></span>')[0], false, false, false);
|
|
234
|
+
if (!this.pop) { //bug 4813
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
pop.attachClosed(function() {
|
|
238
|
+
jQ.sap.byId(thisId).remove();
|
|
239
|
+
});
|
|
240
|
+
var dock = Popup.Dock;
|
|
241
|
+
var cssClass = 'sapMInputBaseMessage' + errorState + ' sapMFocus';
|
|
242
|
+
var T = 'sapMValueStateMessageError sapMText';
|
|
243
|
+
var r = sap.ui.getCore().getLibraryResourceBundle('sap.m');
|
|
244
|
+
|
|
245
|
+
if (errorState === sap.ui.core.ValueState.Success) {
|
|
246
|
+
cssClass = 'sapUiInvisibleText';
|
|
247
|
+
errorMessage = '';
|
|
248
|
+
}
|
|
249
|
+
var oContent = jQ('<div>', {
|
|
250
|
+
'id': thisId,
|
|
251
|
+
'class': cssClass,
|
|
252
|
+
'role': 'tooltip',
|
|
253
|
+
'aria-live': 'assertive'
|
|
254
|
+
}).append(jQ('<span>', {
|
|
255
|
+
'aria-hidden': true,
|
|
256
|
+
'class': 'sapUiHidden',
|
|
257
|
+
'text': r.getText('INPUTBASE_VALUE_STATE_' + errorState.toUpperCase())
|
|
258
|
+
})).append(jQ('<span>', {
|
|
259
|
+
'id': thisId + '-text',
|
|
260
|
+
'class': T,
|
|
261
|
+
'text': errorMessage
|
|
262
|
+
}));
|
|
263
|
+
pop.setContent(oContent[0]);
|
|
264
|
+
pop.close(0);
|
|
265
|
+
pop.open(0, dock.BeginTop, dock.BeginBottom, jQuery(this.codeMirror.getWrapperElement()), null, "none flip", true);
|
|
266
|
+
var sPopUpWidth = this.pop.oContent.clientWidth;
|
|
267
|
+
var oTextAreaHTMLElement = document.getElementById(this.getAggregation("_expressionArea"));
|
|
268
|
+
if (!oTextAreaHTMLElement) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
var sExpressionAdvancedWidth = oTextAreaHTMLElement.sId.clientWidth;
|
|
272
|
+
if (sPopUpWidth > sExpressionAdvancedWidth) {
|
|
273
|
+
jQuery(".sapMText").css('width', sExpressionAdvancedWidth);
|
|
274
|
+
jQuery(".sapMText").css('padding-left', '12px');
|
|
275
|
+
jQuery(".sapMText").css('padding-right', '12px');
|
|
276
|
+
jQuery(".sapMText").css('padding-top', '8px');
|
|
277
|
+
jQuery(".sapMText").css('padding-bottom', '8px');
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
ExpressionAdvanced.prototype._closePopUp = function() {
|
|
282
|
+
if (this.pop) {
|
|
283
|
+
this.pop.close(0);
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
ExpressionAdvanced.prototype._showErrorMessage = function() {
|
|
288
|
+
var errorMessage = this.getValueStateText();
|
|
289
|
+
if (errorMessage && errorMessage !== "") {
|
|
290
|
+
this._setExpressionErrorStyle();
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
ExpressionAdvanced.prototype.initControlDataModel = function() {
|
|
295
|
+
var oDataModel = new sap.ui.model.json.JSONModel();
|
|
296
|
+
var data = {};
|
|
297
|
+
oDataModel.setData(data);
|
|
298
|
+
return oDataModel;
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
ExpressionAdvanced.prototype.setExpressionTokens = function(tokens) {
|
|
302
|
+
var maxLineEnd = 0,
|
|
303
|
+
newLineExist = false;
|
|
304
|
+
this.expressionTokens = [];
|
|
305
|
+
if (tokens instanceof Array) {
|
|
306
|
+
for (var i = 0; i < tokens.length; i++) {
|
|
307
|
+
var tokenMetaData = tokens[i];
|
|
308
|
+
//minimize the number of cached tokens
|
|
309
|
+
var newLineReg = /\n/;
|
|
310
|
+
if (newLineReg.test(tokenMetaData.token)) {
|
|
311
|
+
maxLineEnd = tokenMetaData.start + tokenMetaData.token.lastIndexOf('\n') + 1;
|
|
312
|
+
newLineExist = true;
|
|
313
|
+
continue;
|
|
314
|
+
}
|
|
315
|
+
if (newLineExist) {
|
|
316
|
+
tokenMetaData.start = tokenMetaData.start - maxLineEnd;
|
|
317
|
+
tokenMetaData.end = tokenMetaData.end - maxLineEnd + 1;
|
|
318
|
+
} else {
|
|
319
|
+
tokenMetaData.end = tokenMetaData.end + 1;
|
|
320
|
+
}
|
|
321
|
+
this.expressionTokens.push(tokenMetaData);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
ExpressionAdvanced.prototype.getExpressionTokens = function() {
|
|
327
|
+
return this.expressionTokens;
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
/** INTERFACE */
|
|
331
|
+
|
|
332
|
+
ExpressionAdvanced.prototype.getValue = function() {
|
|
333
|
+
if (this.codeMirror !== undefined) {
|
|
334
|
+
return this.codeMirror.getValue();
|
|
335
|
+
}
|
|
336
|
+
return this.getProperty("value");
|
|
337
|
+
};
|
|
338
|
+
ExpressionAdvanced.prototype.setValue = function(value) {
|
|
339
|
+
if (value === undefined || value === null) {
|
|
340
|
+
value = "";
|
|
341
|
+
}
|
|
342
|
+
this._liveValue = value;
|
|
343
|
+
this.oTextArea.setValue(value);
|
|
344
|
+
if (this.getProperty("value") === value) {
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
this.setProperty("value", value, true);
|
|
348
|
+
if (this.codeMirror !== undefined) {
|
|
349
|
+
this.codeMirror.setValue(value);
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
ExpressionAdvanced.prototype.setPlaceholder = function(value) {
|
|
354
|
+
this.setProperty("placeholder", value);
|
|
355
|
+
var modelValue = (this.getEditable()) ? value : "";
|
|
356
|
+
this.dataModel.setProperty("/placeholder", modelValue);
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
ExpressionAdvanced.prototype.getPlaceholder = function() {
|
|
360
|
+
return this.dataModel.getProperty("/placeholder");
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
ExpressionAdvanced.prototype.setValueStateText = function(message) {
|
|
364
|
+
this.setProperty("valueStateText", message, true);
|
|
365
|
+
if (message){
|
|
366
|
+
this._showErrorMessage(message);
|
|
367
|
+
} else {
|
|
368
|
+
jQuery(this.codeMirror.getWrapperElement()).removeClass('CodeMirror-error');
|
|
369
|
+
jQuery(this.codeMirror.getWrapperElement()).removeClass('sapMInputBaseStateInner sapMInputBaseErrorInner sapMInputBaseContentWrapper sapMInputBaseContentWrapperState sapMInputBaseContentWrapperError');
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
ExpressionAdvanced.prototype.setEditable = function(value) {
|
|
374
|
+
this.setProperty("editable", value);
|
|
375
|
+
this.getAggregation("_expressionArea").setProperty("editable", value);
|
|
376
|
+
if (this.codeMirror) {
|
|
377
|
+
jQuery(this.codeMirror.getWrapperElement()).addClass('CodeMirror-rules-Not-Editable');
|
|
378
|
+
}
|
|
379
|
+
// placeholder is relevant only for editable field
|
|
380
|
+
var _placeholder = (value) ? this.getProperty("placeholder") : "";
|
|
381
|
+
this.dataModel.setProperty("/placeholder", _placeholder);
|
|
382
|
+
this.invalidate();
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
ExpressionAdvanced.prototype.setType = function(type) {
|
|
386
|
+
if (type === Constants.DATE_BUSINESS_TYPE || type === Constants.TIMESTAMP_BUSINESS_TYPE || type === Constants.NUMBER || type ===
|
|
387
|
+
Constants.STRING || type === Constants.BOOLEAN_BUSINESS_TYPE || type === Constants.BOOLEAN_ENHANCED_BUSINESS_TYPE) {
|
|
388
|
+
this.setProperty("type", type);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
if (this.codeMirror) {
|
|
392
|
+
this.codeMirror.options.returnType = type;
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
ExpressionAdvanced.prototype.setCollection = function(isCollection) {
|
|
397
|
+
this.setProperty("collection", isCollection, true);
|
|
398
|
+
if (this.codeMirror) {
|
|
399
|
+
this.codeMirror.options.collection = isCollection;
|
|
400
|
+
}
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
/* end INTERFACE section */
|
|
404
|
+
|
|
405
|
+
/* Public methods section */
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* validates the current value of the control.
|
|
409
|
+
* @internal
|
|
410
|
+
* @return {object} [oResult] validation object.
|
|
411
|
+
*/
|
|
412
|
+
ExpressionAdvanced.prototype.validate = function() {
|
|
413
|
+
return this.validateExpression();
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
ExpressionAdvanced.prototype.setFocusOnLoad = function(value) {
|
|
417
|
+
this.dataModel.setProperty("/focus", value);
|
|
418
|
+
this.setProperty("focusOnLoad", value, true);
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
ExpressionAdvanced.prototype.focus = function() {
|
|
422
|
+
if (this.codeMirror) {
|
|
423
|
+
var lastLine = this.codeMirror.getLine(this.codeMirror.lastLine());
|
|
424
|
+
var cursorPos = lastLine.length;
|
|
425
|
+
this.codeMirror.setCursor({
|
|
426
|
+
line: this.codeMirror.lastLine(),
|
|
427
|
+
ch: cursorPos
|
|
428
|
+
});
|
|
429
|
+
this.codeMirror.focus();
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
ExpressionAdvanced.prototype.onAliasLinkPress = function(aliasName) {
|
|
434
|
+
var expressionLanguage = sap.ui.getCore().byId(this.getExpressionLanguage());
|
|
435
|
+
if (expressionLanguage) {
|
|
436
|
+
expressionLanguage.onAliasLinkPress(aliasName);
|
|
437
|
+
expressionLanguage.attachEvent("aliasDialogClosed", this.aliasClickCancel, this);
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
ExpressionAdvanced.prototype.onCreateAliasLinkForText = function(text) {
|
|
442
|
+
var expressionLanguage = sap.ui.getCore().byId(this.getExpressionLanguage());
|
|
443
|
+
if (expressionLanguage) {
|
|
444
|
+
expressionLanguage.attachEvent("aliasDialogClosed", this.replaceTextWithAlias, this);
|
|
445
|
+
expressionLanguage.onCreateAliasLinkForText(text);
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
ExpressionAdvanced.prototype.replaceTextWithAlias = function(oEvent) {
|
|
450
|
+
if (oEvent.getParameter("isSave")) {
|
|
451
|
+
this.codeMirror.replaceSelection(oEvent.getParameter("savedAliasName"));
|
|
452
|
+
}
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
ExpressionAdvanced.prototype.aliasClickCancel = function(oEvent) {
|
|
456
|
+
this.codeMirror.focus();
|
|
457
|
+
this.codeMirror.execCommand("goLineEnd");
|
|
458
|
+
this.fireDialog({
|
|
459
|
+
dialogStatus: sap.rules.ui.ValueListDialogMode.Close
|
|
460
|
+
});
|
|
461
|
+
};
|
|
462
|
+
|
|
463
|
+
ExpressionAdvanced.prototype.onAfterRendering = function() {
|
|
464
|
+
|
|
465
|
+
this.timer = null;
|
|
466
|
+
// needAutoComplete tells us whether an auto complete action is required.
|
|
467
|
+
// we need it since we execute the popup opening in a delayed manner. sometimes it should not open (case 2):
|
|
468
|
+
// case 1. press key -> ... -> delayed open of popup (need to open)
|
|
469
|
+
// case 2. press key -> ... -> press Enter (to select form list) -> ... -> delayed open of popup (need not open)
|
|
470
|
+
this.needAutoComplete = false;
|
|
471
|
+
this.endCompletion = false;
|
|
472
|
+
this._setCodeMirror();
|
|
473
|
+
this._setEditorStyle();
|
|
474
|
+
this._handleMousedown();
|
|
475
|
+
this._handleChange();
|
|
476
|
+
this._handleFocusLeave(); //blur
|
|
477
|
+
this._handleEndCodeCompletion();
|
|
478
|
+
this._handleKeyPress();
|
|
479
|
+
this._handleEditableProperty();
|
|
480
|
+
this._handleOnLoadValidation();
|
|
481
|
+
this._refreshOnNavigationEnd();
|
|
482
|
+
this._handleFocus();
|
|
483
|
+
this._handleValueListSelect();
|
|
484
|
+
this._handleCalendarChange();
|
|
485
|
+
|
|
486
|
+
//bug RULES-4848\5031\5030 after choose value from auto complete - popover will not closed
|
|
487
|
+
if (this.bFlagForEventListener) {
|
|
488
|
+
this.bFlagForEventListener = false;
|
|
489
|
+
this.fnMouseDownListsner = function(oEvent) {
|
|
490
|
+
this.bFlagForChangeBeforeBlur = oEvent.target.className.indexOf("CodeMirror-hint") > -1;
|
|
491
|
+
}.bind(this);
|
|
492
|
+
|
|
493
|
+
this.fnBlurListsner = function(oEvent) {
|
|
494
|
+
if (this.bFlagForChangeBeforeBlur) {
|
|
495
|
+
this.bFlagForChangeBeforeBlur = false;
|
|
496
|
+
oEvent.stopPropagation();
|
|
497
|
+
this.codeMirror.focus();
|
|
498
|
+
}
|
|
499
|
+
}.bind(this);
|
|
500
|
+
|
|
501
|
+
document.addEventListener("mousedown", this.fnMouseDownListsner, true);
|
|
502
|
+
document.getElementById(this.getId()).addEventListener("blur", this.fnBlurListsner, true);
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
};
|
|
506
|
+
|
|
507
|
+
// Event listerner for change date click event
|
|
508
|
+
ExpressionAdvanced.prototype._handleCalendarChange = function() {
|
|
509
|
+
var that = this;
|
|
510
|
+
this.codeMirror.on('onChangeDate', function() {
|
|
511
|
+
that._createCalendarDialog(that.codeMirror.getCursor());
|
|
512
|
+
}.bind(this));
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
// Utility function to oprn calendate dialog
|
|
516
|
+
ExpressionAdvanced.prototype._createCalendarDialog = function(curPos) {
|
|
517
|
+
var bAddSpace = false;
|
|
518
|
+
var that = this;
|
|
519
|
+
|
|
520
|
+
var oCalendar = new sap.ui.unified.Calendar({
|
|
521
|
+
width: "100%",
|
|
522
|
+
select: this.handleCalendarSelect.bind(this)
|
|
523
|
+
});
|
|
524
|
+
|
|
525
|
+
this._oSelectNewDateDialog = new Dialog({
|
|
526
|
+
title: this.oBundle.getText("calendarTitle"),
|
|
527
|
+
content: [
|
|
528
|
+
oCalendar
|
|
529
|
+
],
|
|
530
|
+
beginButton: new Button({
|
|
531
|
+
text: this.oBundle.getText("okBtn"),
|
|
532
|
+
enabled: false,
|
|
533
|
+
press: function() {
|
|
534
|
+
var date = this.updateText(oCalendar);
|
|
535
|
+
that._updateModal(false);
|
|
536
|
+
that.setTextOnCursor(date, curPos, false, this._dateBusinessDataType, bAddSpace, false);
|
|
537
|
+
that._oSelectNewDateDialog.close();
|
|
538
|
+
that.focus(that.codeMirror);
|
|
539
|
+
}.bind(this)
|
|
540
|
+
}),
|
|
541
|
+
endButton: new Button({
|
|
542
|
+
text: this.oBundle.getText("clsBtn"),
|
|
543
|
+
press: function() {
|
|
544
|
+
that._updateModal(false);
|
|
545
|
+
that._oSelectNewDateDialog.close();
|
|
546
|
+
that.focus(that.codeMirror);
|
|
547
|
+
}.bind(this)
|
|
548
|
+
})
|
|
549
|
+
});
|
|
550
|
+
|
|
551
|
+
this._oSelectNewDateDialog.open();
|
|
552
|
+
|
|
553
|
+
};
|
|
554
|
+
|
|
555
|
+
// Utility function to update Modal Property of modal
|
|
556
|
+
ExpressionAdvanced.prototype._updateModal = function(modalValue) {
|
|
557
|
+
var pop = sap.ui.getCore().byId("popover");
|
|
558
|
+
if (pop) {
|
|
559
|
+
pop.setModal(modalValue);
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
// Utility function to set calendar enabled property
|
|
564
|
+
ExpressionAdvanced.prototype.handleCalendarSelect = function(oEvent) {
|
|
565
|
+
var oCalendar = oEvent.getSource(),
|
|
566
|
+
oSelectedDate = oCalendar.getSelectedDates()[0].getStartDate();
|
|
567
|
+
|
|
568
|
+
if (oSelectedDate) {
|
|
569
|
+
this._oSelectNewDateDialog.getBeginButton().setEnabled(true);
|
|
570
|
+
}
|
|
571
|
+
};
|
|
572
|
+
|
|
573
|
+
// Utility function to format date
|
|
574
|
+
ExpressionAdvanced.prototype.updateText = function(oCalendar) {
|
|
575
|
+
var aSelectedDates = oCalendar.getSelectedDates();
|
|
576
|
+
var oDate;
|
|
577
|
+
if (aSelectedDates.length > 0) {
|
|
578
|
+
oDate = aSelectedDates[0].getStartDate();
|
|
579
|
+
return this.oFormatDate.format(oDate);
|
|
580
|
+
}
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
ExpressionAdvanced.prototype._raiseError = function(sError) {
|
|
584
|
+
//handling a scenario when the callback or the model are invalid
|
|
585
|
+
Log.error(sError);
|
|
586
|
+
var oBundle = sap.ui.getCore().getLibraryResourceBundle("sap.rules.ui.i18n");
|
|
587
|
+
this.setValueStateText(oBundle.getText("valueHelpTechnicalError"));
|
|
588
|
+
this._showPopUp();
|
|
589
|
+
};
|
|
590
|
+
|
|
591
|
+
/*
|
|
592
|
+
* Invoke this function once user select on 'Select value from list' suggestion
|
|
593
|
+
* This is listener to 'onValueListSelect' code mirror event/signal.
|
|
594
|
+
*/
|
|
595
|
+
ExpressionAdvanced.prototype._handleValueListSelect = function() {
|
|
596
|
+
|
|
597
|
+
this.codeMirror.on('onValueListSelect', function() {
|
|
598
|
+
var suggestions = this.codeMirror.currentHintData.data.listCompletion;
|
|
599
|
+
var valueHelpInfo = [];
|
|
600
|
+
for (var sugg = 0; sugg < suggestions.length; sugg++) {
|
|
601
|
+
if (suggestions[sugg].text === this._valueHelpSelectionText) {
|
|
602
|
+
valueHelpInfo = suggestions[sugg].info;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
var expressionLanguage = sap.ui.getCore().byId(this.getExpressionLanguage());
|
|
606
|
+
valueHelpInfo.expressionLanguage = expressionLanguage;
|
|
607
|
+
var callback = expressionLanguage.getValueHelpCallback();
|
|
608
|
+
this.oTextArea.setValueState("None");
|
|
609
|
+
this.oTextArea.setValueStateText("");
|
|
610
|
+
this.setValueStateText("");
|
|
611
|
+
jQuery(this.codeMirror.getWrapperElement()).removeClass('sapMInputBaseStateInner sapMInputBaseErrorInner sapMInputBaseContentWrapper sapMInputBaseContentWrapperState sapMInputBaseContentWrapperError');
|
|
612
|
+
if ((typeof callback) !== "function" && valueHelpInfo.metadata.hasOwnProperty(this._hasValueSource) && valueHelpInfo.metadata.HasValueSource ===
|
|
613
|
+
true) {
|
|
614
|
+
this._createCpValueHelp(valueHelpInfo, this.codeMirror.getCursor(), false);
|
|
615
|
+
} else {
|
|
616
|
+
if ((typeof callback) !== "function") {
|
|
617
|
+
this._raiseError("value help callback is not set or is not a function");
|
|
618
|
+
} else {
|
|
619
|
+
// enrich the valueHelpInfo with the valueHelp model
|
|
620
|
+
callback.call(this, valueHelpInfo);
|
|
621
|
+
// create provider
|
|
622
|
+
var oModel = valueHelpInfo[0].model;
|
|
623
|
+
if (!(oModel instanceof sap.ui.model.odata.v2.ODataModel)) {
|
|
624
|
+
this._raiseError("value help model is not an oData V2 model");
|
|
625
|
+
} else if (oModel.isMetadataLoadingFailed()) {
|
|
626
|
+
this._raiseError("model metadata loading has failed in the past");
|
|
627
|
+
} else if (!(oModel.getMetaModel().oModel)) {
|
|
628
|
+
oModel.attachMetadataLoaded(function() {
|
|
629
|
+
this._createValueHelpProvider(valueHelpInfo[0]);
|
|
630
|
+
}.bind(this));
|
|
631
|
+
oModel.attachMetadataFailed(function() {
|
|
632
|
+
this._raiseError("attached model metadata failed");
|
|
633
|
+
}.bind(this));
|
|
634
|
+
} else {
|
|
635
|
+
this._createValueHelpProvider(valueHelpInfo[0]);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
}.bind(this));
|
|
640
|
+
};
|
|
641
|
+
|
|
642
|
+
ExpressionAdvanced.prototype._createValueHelpProvider = function(valueHelpInfo, bReplaceWord) {
|
|
643
|
+
|
|
644
|
+
var oModel = valueHelpInfo.model;
|
|
645
|
+
this.oMetadataAnalyzer = new sap.ui.comp.odata.MetadataAnalyser(oModel);
|
|
646
|
+
var sAnnotationPath = valueHelpInfo.metadata.propertyPath;
|
|
647
|
+
var oValueListAnnotation = this.oMetadataAnalyzer.getValueListAnnotation(sAnnotationPath);
|
|
648
|
+
if (!oValueListAnnotation.primaryValueListAnnotation) {
|
|
649
|
+
this._raiseError("proprety path is wrong");
|
|
650
|
+
return;
|
|
651
|
+
}
|
|
652
|
+
var tokens = this.getExpressionTokens();
|
|
653
|
+
var bAddSpace = false;
|
|
654
|
+
if (tokens.length > 0) {
|
|
655
|
+
bAddSpace = (tokens[tokens.length - 1].tokenType !== "whitespace");
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
if (this.oValueHelpDialogProvider) {
|
|
659
|
+
this.oValueHelpDialogProvider.destroy();
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
this.oValueHelpDialogProvider = new ValueHelpProvider({
|
|
663
|
+
annotation: oValueListAnnotation.primaryValueListAnnotation,
|
|
664
|
+
additionalAnnotations: oValueListAnnotation.additionalAnnotations,
|
|
665
|
+
control: this,
|
|
666
|
+
model: oModel,
|
|
667
|
+
preventInitialDataFetchInValueHelpDialog: false,
|
|
668
|
+
supportMultiSelect: false,
|
|
669
|
+
supportRanges: false,
|
|
670
|
+
takeOverInputValue: false,
|
|
671
|
+
fieldName: oValueListAnnotation.primaryValueListAnnotation.valueListTitle,
|
|
672
|
+
title: oValueListAnnotation.primaryValueListAnnotation.valueListTitle,
|
|
673
|
+
cursorPosition: this.codeMirror.getCursor(),
|
|
674
|
+
bReplaceWord: bReplaceWord,
|
|
675
|
+
businessDataType: valueHelpInfo.metadata.businessDataType,
|
|
676
|
+
bAddSpace: bAddSpace
|
|
677
|
+
|
|
678
|
+
});
|
|
679
|
+
|
|
680
|
+
// open dialog
|
|
681
|
+
this.fireValueHelpRequest({
|
|
682
|
+
fromSuggestions: false
|
|
683
|
+
});
|
|
684
|
+
|
|
685
|
+
};
|
|
686
|
+
|
|
687
|
+
ExpressionAdvanced.prototype._createCpValueHelp = function(valueHelpInfo, curPos, bReplaceWord, bValuehelpLinkPress) {
|
|
688
|
+
var businessDataType = valueHelpInfo.metadata.businessDataType;
|
|
689
|
+
var tokens = this.getExpressionTokens();
|
|
690
|
+
var bAddSpace = false;
|
|
691
|
+
var pop = sap.ui.getCore().byId("popover");
|
|
692
|
+
if (pop) {
|
|
693
|
+
pop.setModal(true);
|
|
694
|
+
}
|
|
695
|
+
if (tokens.length > 0) {
|
|
696
|
+
bAddSpace = (tokens[tokens.length - 1].tokenType !== "whitespace");
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
if (this.oDialog) {
|
|
700
|
+
this.oDialog.destroy();
|
|
701
|
+
}
|
|
702
|
+
var basePath = sap.ui.getCore().byId(this.getExpressionLanguage()).getModel().sServiceUrl;
|
|
703
|
+
this._createDialog(basePath, valueHelpInfo, curPos, businessDataType, bAddSpace, bReplaceWord, bValuehelpLinkPress);
|
|
704
|
+
};
|
|
705
|
+
|
|
706
|
+
/*
|
|
707
|
+
* Creates the necessary control for the value Help Dialog.
|
|
708
|
+
*
|
|
709
|
+
*/
|
|
710
|
+
ExpressionAdvanced.prototype._createDialog = function(basePath, valueHelpInfo, curPos, businessDataType, bAddSpace, bReplaceWord,
|
|
711
|
+
bValuehelpLinkPress) {
|
|
712
|
+
this._createValueHelpDialog(basePath, valueHelpInfo, curPos, businessDataType, bAddSpace, bReplaceWord, bValuehelpLinkPress);
|
|
713
|
+
this._createSmartFilterBar(basePath, valueHelpInfo);
|
|
714
|
+
this.oValueHelpDialog.setFilterBar(this.oFilterBar);
|
|
715
|
+
this.oValueHelpDialog.open();
|
|
716
|
+
this.oValueHelpDialog.getTable().setBusy(true);
|
|
717
|
+
};
|
|
718
|
+
|
|
719
|
+
/*
|
|
720
|
+
* Creates the Value Help Dialog.
|
|
721
|
+
*/
|
|
722
|
+
|
|
723
|
+
ExpressionAdvanced.prototype._createValueHelpDialog = function(basePath, valueHelpInfo, curPos, businessDataType, bAddSpace,
|
|
724
|
+
bReplaceWord, bValuehelpLinkPress) {
|
|
725
|
+
var that = this;
|
|
726
|
+
var expressionData = valueHelpInfo.expressionLanguage.getModel();
|
|
727
|
+
var attributePath = "Attributes(Id='"+ valueHelpInfo.metadata.attributeId + "',VocabularyId='" + valueHelpInfo.metadata.vocabularyId + "',DataObjectId='" + valueHelpInfo.metadata.dataObjectId + "')";
|
|
728
|
+
if(attributePath.includes(":")) {
|
|
729
|
+
attributePath = attributePath = attributePath.replace(":","%3A");
|
|
730
|
+
}
|
|
731
|
+
this.attributeName = expressionData.oData[attributePath].Name;
|
|
732
|
+
sap.ui.core.BusyIndicator.show(0);
|
|
733
|
+
this.oValueHelpDialog = new sap.ui.comp.valuehelpdialog.ValueHelpDialog({
|
|
734
|
+
supportMultiselect : false,
|
|
735
|
+
supportRanges : false,
|
|
736
|
+
horizontalScrolling : false,
|
|
737
|
+
title : that.attributeName,
|
|
738
|
+
resizable : false,
|
|
739
|
+
beforeOpen : function() {
|
|
740
|
+
that._bindTable(basePath, valueHelpInfo);
|
|
741
|
+
},
|
|
742
|
+
ok : function(oEvt) {
|
|
743
|
+
var oSelRow = oEvt.getParameter("tokens")[0].data("row");
|
|
744
|
+
var value = oSelRow.Value;
|
|
745
|
+
if (businessDataType === that._dateBusinessDataType) {
|
|
746
|
+
value = that._formatDate(value);
|
|
747
|
+
}
|
|
748
|
+
that.setTextOnCursor(value, curPos, bReplaceWord, businessDataType, bAddSpace, bValuehelpLinkPress);
|
|
749
|
+
that._updateModal(false);
|
|
750
|
+
that.oValueHelpDialog.close();
|
|
751
|
+
that.focus(that.codeMirror);
|
|
752
|
+
|
|
753
|
+
},
|
|
754
|
+
cancel : function() {
|
|
755
|
+
that._updateModal(false);
|
|
756
|
+
that.oValueHelpDialog.close();
|
|
757
|
+
that.focus(that.codeMirror);
|
|
758
|
+
|
|
759
|
+
},
|
|
760
|
+
afterClose : function() {
|
|
761
|
+
that._updateModal(false);
|
|
762
|
+
that.oValueHelpDialog.destroy();
|
|
763
|
+
that.focus(that.codeMirror);
|
|
764
|
+
that.oFilterBar.destroy();
|
|
765
|
+
sap.ui.core.BusyIndicator.hide();
|
|
766
|
+
}
|
|
767
|
+
});
|
|
768
|
+
};
|
|
769
|
+
|
|
770
|
+
/*
|
|
771
|
+
* Utility function to format Date.
|
|
772
|
+
*/
|
|
773
|
+
ExpressionAdvanced.prototype._formatDate = function(value) {
|
|
774
|
+
return this.oFormatDate.format(this.oFormatDate.parse(value));
|
|
775
|
+
};
|
|
776
|
+
|
|
777
|
+
/*
|
|
778
|
+
* Creates the necessary control os SmartFilterBar for the ValueHelp Dialog.
|
|
779
|
+
*/
|
|
780
|
+
ExpressionAdvanced.prototype._createSmartFilterBar = function(basePath, valueHelpInfo) {
|
|
781
|
+
var that = this;
|
|
782
|
+
this.oFilterBar = new sap.ui.comp.smartfilterbar.SmartFilterBar({
|
|
783
|
+
entitySet : valueHelpInfo.metadata.entitySet,
|
|
784
|
+
enableBasicSearch : true,
|
|
785
|
+
advancedMode : true,
|
|
786
|
+
filterBarExpanded: true,
|
|
787
|
+
search : function() {
|
|
788
|
+
that.onSearch(basePath, valueHelpInfo);
|
|
789
|
+
|
|
790
|
+
},
|
|
791
|
+
filterChange: function(oEvent) {
|
|
792
|
+
that.setValueStateFilter(oEvent);
|
|
793
|
+
},
|
|
794
|
+
controlConfiguration : [ that._createControlConfiguration() ]
|
|
795
|
+
});
|
|
796
|
+
var oModel = new sap.ui.model.odata.v2.ODataModel(basePath);
|
|
797
|
+
this.oFilterBar.setModel(oModel);
|
|
798
|
+
};
|
|
799
|
+
|
|
800
|
+
/*
|
|
801
|
+
* Creating the Control Configuration for the smartFilter of the valueHelp Dialog.
|
|
802
|
+
*/
|
|
803
|
+
ExpressionAdvanced.prototype._createControlConfiguration = function() {
|
|
804
|
+
var aControlConfiguration = [ new sap.ui.comp.smartfilterbar.ControlConfiguration({
|
|
805
|
+
hasValueHelpDialog : true,
|
|
806
|
+
key : "Value",
|
|
807
|
+
label : "Value",
|
|
808
|
+
visibleInAdvancedArea : true,
|
|
809
|
+
width : "100px",
|
|
810
|
+
index : 1
|
|
811
|
+
|
|
812
|
+
}), new sap.ui.comp.smartfilterbar.ControlConfiguration({
|
|
813
|
+
hasValueHelpDialog : true,
|
|
814
|
+
key : "Description",
|
|
815
|
+
label : "Description",
|
|
816
|
+
visibleInAdvancedArea : true,
|
|
817
|
+
width : "100px",
|
|
818
|
+
index : 2
|
|
819
|
+
|
|
820
|
+
}), new sap.ui.comp.smartfilterbar.ControlConfiguration({
|
|
821
|
+
hasValueHelpDialog : true,
|
|
822
|
+
key : "VocabularyId",
|
|
823
|
+
label : "VocabularyId",
|
|
824
|
+
width : "100px",
|
|
825
|
+
visible : false,
|
|
826
|
+
index : 3
|
|
827
|
+
|
|
828
|
+
}), new sap.ui.comp.smartfilterbar.ControlConfiguration({
|
|
829
|
+
hasValueHelpDialog : true,
|
|
830
|
+
key : "DataObjectId",
|
|
831
|
+
label : "DataObjectId",
|
|
832
|
+
visible : false,
|
|
833
|
+
width : "100px",
|
|
834
|
+
groupId : "abc",
|
|
835
|
+
index : 4
|
|
836
|
+
|
|
837
|
+
}), new sap.ui.comp.smartfilterbar.ControlConfiguration({
|
|
838
|
+
hasValueHelpDialog : true,
|
|
839
|
+
key : "AttributeId",
|
|
840
|
+
label : "AttributeId",
|
|
841
|
+
visible : false,
|
|
842
|
+
width : "100px",
|
|
843
|
+
index : 5
|
|
844
|
+
|
|
845
|
+
}),
|
|
846
|
+
new sap.ui.comp.smartfilterbar.ControlConfiguration({
|
|
847
|
+
hasValueHelpDialog : true,
|
|
848
|
+
key : "Version",
|
|
849
|
+
label : "Version",
|
|
850
|
+
visible : false,
|
|
851
|
+
width : "100px",
|
|
852
|
+
index : 6
|
|
853
|
+
|
|
854
|
+
})];
|
|
855
|
+
return aControlConfiguration;
|
|
856
|
+
};
|
|
857
|
+
|
|
858
|
+
/*
|
|
859
|
+
* Called when the search is triggered in SmartFilter.
|
|
860
|
+
*/
|
|
861
|
+
ExpressionAdvanced.prototype.onSearch = function(basePath, valueHelpInfo) {
|
|
862
|
+
this.oValueHelpDialog.getTable().setBusy(true);
|
|
863
|
+
this._unBindTable();
|
|
864
|
+
this._bindTable(basePath, valueHelpInfo);
|
|
865
|
+
};
|
|
866
|
+
|
|
867
|
+
/*
|
|
868
|
+
* Binds the table taking current filters parameters into account.
|
|
869
|
+
*/
|
|
870
|
+
ExpressionAdvanced.prototype._bindTable = function(basePath, valueHelpInfo) {
|
|
871
|
+
var serviceUrl = valueHelpInfo.metadata.serviceURL;
|
|
872
|
+
var aFilterParams = this._fetchFilterParams(valueHelpInfo);
|
|
873
|
+
var mEntities = {
|
|
874
|
+
valueHelp : {
|
|
875
|
+
collection : serviceUrl,
|
|
876
|
+
properties : [ this._propertyValue, this._propertyDescription ]
|
|
877
|
+
}
|
|
878
|
+
};
|
|
879
|
+
|
|
880
|
+
var oTable = this.oValueHelpDialog.getTable();
|
|
881
|
+
oTable.setThreshold(10);
|
|
882
|
+
|
|
883
|
+
for (var i = 0; i < mEntities.valueHelp.properties.length; i++) {
|
|
884
|
+
this._addValueHelpColumn(mEntities.valueHelp.properties[i], oTable);
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
var oModel = new sap.ui.model.odata.v2.ODataModel(basePath);
|
|
888
|
+
oTable.setModel(oModel);
|
|
889
|
+
oTable.bindRows(mEntities.valueHelp.collection, null, aFilterParams);
|
|
890
|
+
oTable.getBinding("rows").attachDataReceived(this._handleRowsDataReceived, this);
|
|
891
|
+
};
|
|
892
|
+
|
|
893
|
+
//handles the Busy State of the busy state for the data recieved.
|
|
894
|
+
ExpressionAdvanced.prototype._handleRowsDataReceived = function(oEvent) {
|
|
895
|
+
var that = this;
|
|
896
|
+
var data = oEvent.getParameter("data");
|
|
897
|
+
if (jQuery.isEmptyObject(data) || (data && data.results && data.results.length === 0)) {
|
|
898
|
+
this.oValueHelpDialog.getTable().setNoData(that.oBundle.getText("no_data"));
|
|
899
|
+
} else {
|
|
900
|
+
this.oValueHelpDialog.getTable().setNoData(that.oBundle.getText("searching"));
|
|
901
|
+
}
|
|
902
|
+
this.oValueHelpDialog.getTable().setBusy(false);
|
|
903
|
+
};
|
|
904
|
+
|
|
905
|
+
// Utility function to create columns for the table.
|
|
906
|
+
ExpressionAdvanced.prototype._addValueHelpColumn = function(oColumName, oTable) {
|
|
907
|
+
var oColumn = new sap.ui.table.Column().setLabel(new sap.m.Label({
|
|
908
|
+
text : oColumName
|
|
909
|
+
}));
|
|
910
|
+
if (oColumName === this._propertyValue) {
|
|
911
|
+
oColumn.setSortProperty(oColumName);
|
|
912
|
+
}
|
|
913
|
+
oTable.addColumn(oColumn.setTemplate(new sap.m.Text().bindProperty("text", oColumName)));
|
|
914
|
+
};
|
|
915
|
+
|
|
916
|
+
/*
|
|
917
|
+
* unBind the table Rows.
|
|
918
|
+
*/
|
|
919
|
+
ExpressionAdvanced.prototype._unBindTable = function() {
|
|
920
|
+
var oTable = this.oValueHelpDialog.getTable();
|
|
921
|
+
oTable.destroyColumns();
|
|
922
|
+
oTable.unbindRows();
|
|
923
|
+
|
|
924
|
+
};
|
|
925
|
+
|
|
926
|
+
|
|
927
|
+
/*
|
|
928
|
+
* fetch the latest filter parmas depending on the filter or the search param set.
|
|
929
|
+
*/
|
|
930
|
+
ExpressionAdvanced.prototype._fetchFilterParams = function(valueHelpInfo) {
|
|
931
|
+
var that = this;
|
|
932
|
+
var aSearchParams = [];
|
|
933
|
+
var aFilterParams = [ new sap.ui.model.Filter("AttributeId", sap.ui.model.FilterOperator.EQ, valueHelpInfo.metadata.attributeId),
|
|
934
|
+
new sap.ui.model.Filter("DataObjectId", sap.ui.model.FilterOperator.EQ, valueHelpInfo.metadata.dataObjectId),
|
|
935
|
+
new sap.ui.model.Filter("VocabularyId", sap.ui.model.FilterOperator.EQ, valueHelpInfo.metadata.vocabularyId) ];
|
|
936
|
+
|
|
937
|
+
var aFilters = this.oFilterBar.getFilters();
|
|
938
|
+
var searchParam = this.oFilterBar.getParameters();
|
|
939
|
+
//When both search and filter is selected
|
|
940
|
+
if (!jQuery.isEmptyObject(searchParam) && aFilters && aFilters.length > 0) {
|
|
941
|
+
searchParam = this.oFilterBar.getParameters().custom.search;
|
|
942
|
+
aSearchParams = this._getSearchFilters(searchParam);
|
|
943
|
+
aFilters = that._formatFilterParams(aFilters);
|
|
944
|
+
aFilterParams.push(new sap.ui.model.Filter({
|
|
945
|
+
filters : [ new sap.ui.model.Filter(aFilters), new sap.ui.model.Filter(aSearchParams) ],
|
|
946
|
+
and : true
|
|
947
|
+
}));
|
|
948
|
+
} else if (!jQuery.isEmptyObject(searchParam)) {
|
|
949
|
+
//when only Search is selected.
|
|
950
|
+
searchParam = this.oFilterBar.getParameters().custom.search;
|
|
951
|
+
aSearchParams = this._getSearchFilters(searchParam);
|
|
952
|
+
aFilterParams.push(aSearchParams);
|
|
953
|
+
} else if (aFilters && aFilters.length > 0) {
|
|
954
|
+
//When only filters is selected.
|
|
955
|
+
aFilters = that._formatFilterParams(aFilters);
|
|
956
|
+
aFilterParams.push(aFilters[0]);
|
|
957
|
+
}
|
|
958
|
+
return aFilterParams;
|
|
959
|
+
};
|
|
960
|
+
|
|
961
|
+
/*
|
|
962
|
+
* format the filterParams to support Contains and Between.
|
|
963
|
+
*/
|
|
964
|
+
ExpressionAdvanced.prototype._formatFilterParams = function(aFilters) {
|
|
965
|
+
var that = this;
|
|
966
|
+
if (aFilters[0] && aFilters.length === 1 && aFilters[0].aFilters[0] && aFilters[0].aFilters[0].sOperator) {
|
|
967
|
+
aFilters = that._formatSingleFilter(aFilters);
|
|
968
|
+
} else if (aFilters[0] && aFilters[0].aFilters[0] && aFilters[0].aFilters[0].aFilters[0] && aFilters[0].aFilters[0].aFilters[0].aFilters && aFilters[0].aFilters[1].aFilters[0].aFilters) {
|
|
969
|
+
aFilters = that._formatMultiFilter(aFilters, 0, true);
|
|
970
|
+
aFilters = that._formatMultiFilter(aFilters, 1, true);
|
|
971
|
+
|
|
972
|
+
} else if (aFilters[0] && aFilters[0].aFilters[0] && aFilters[0].aFilters[1] && aFilters[0].aFilters[0].aFilters[0] && aFilters[0].aFilters[0].aFilters[0].aFilters && aFilters[0].aFilters[1].aFilters) {
|
|
973
|
+
aFilters = that._formatMultiFilter(aFilters, 0, true);
|
|
974
|
+
aFilters = that._formatMultiFilter(aFilters, 1, false);
|
|
975
|
+
|
|
976
|
+
} else if (aFilters[0] && aFilters[0].aFilters[0] && aFilters[0].aFilters[1] && aFilters[0].aFilters[1].aFilters[0] && aFilters[0].aFilters[0].aFilters && aFilters[0].aFilters[1].aFilters[0].aFilters) {
|
|
977
|
+
aFilters = that._formatMultiFilter(aFilters, 0, false);
|
|
978
|
+
aFilters = that._formatMultiFilter(aFilters, 1, true);
|
|
979
|
+
|
|
980
|
+
} else if (aFilters[0] && aFilters[0].aFilters[0] && aFilters[0].aFilters[1] && aFilters[0].aFilters[0].aFilters && aFilters[0].aFilters[1].aFilters) {
|
|
981
|
+
aFilters = that._formatMultiFilter(aFilters, 0, false);
|
|
982
|
+
aFilters = that._formatMultiFilter(aFilters, 1, false);
|
|
983
|
+
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
return aFilters;
|
|
987
|
+
};
|
|
988
|
+
|
|
989
|
+
ExpressionAdvanced.prototype._formatSingleFilter = function(aFilters) {
|
|
990
|
+
var that = this;
|
|
991
|
+
var _valueField = null;
|
|
992
|
+
|
|
993
|
+
for (var iterator = 0; iterator < aFilters[0].aFilters.length; iterator++) {
|
|
994
|
+
if (aFilters[0].aFilters[iterator].sOperator === "Contains") {
|
|
995
|
+
aFilters[0].aFilters[iterator].sOperator = "EQ";
|
|
996
|
+
} else if (aFilters[0].aFilters[iterator].sOperator === "BT") {
|
|
997
|
+
|
|
998
|
+
var convertedFilterParam = that._manageParam(aFilters[0].aFilters[iterator].sPath,aFilters[0].aFilters[iterator].sOperator,
|
|
999
|
+
aFilters[0].aFilters[iterator].oValue1, aFilters[0].aFilters[iterator].oValue2);
|
|
1000
|
+
delete aFilters[0].aFilters[iterator];
|
|
1001
|
+
aFilters[0].aFilters[iterator] = convertedFilterParam;
|
|
1002
|
+
} else if (aFilters[0].aFilters[iterator].sOperator === "StartsWith") {
|
|
1003
|
+
_valueField = (aFilters[0].aFilters[iterator].sPath === this._propertyValue) ? this._valueFieldValue : this._valueFieldDescription;
|
|
1004
|
+
_valueField.setValueState("Error");
|
|
1005
|
+
_valueField.setValueStateText(aFilters[0].aFilters[iterator].sOperator + " operator not supported");
|
|
1006
|
+
} else if (aFilters[0].aFilters[iterator].sOperator === "EndsWith") {
|
|
1007
|
+
_valueField = (aFilters[0].aFilters[iterator].sPath === this._propertyValue) ? this._valueFieldValue : this._valueFieldDescription;
|
|
1008
|
+
_valueField.setValueState("Error");
|
|
1009
|
+
_valueField.setValueStateText(aFilters[0].aFilters[iterator].sOperator + " operator not supported");
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
}
|
|
1013
|
+
return aFilters;
|
|
1014
|
+
|
|
1015
|
+
};
|
|
1016
|
+
ExpressionAdvanced.prototype._formatMultiFilter = function(aFilters, index, bMultifilter) {
|
|
1017
|
+
var that = this;
|
|
1018
|
+
var _valueField = null;
|
|
1019
|
+
var aComputeFilterParma = [];
|
|
1020
|
+
if (bMultifilter) {
|
|
1021
|
+
aComputeFilterParma = aFilters[0].aFilters[index].aFilters[0].aFilters;
|
|
1022
|
+
} else {
|
|
1023
|
+
aComputeFilterParma = aFilters[0].aFilters[index].aFilters;
|
|
1024
|
+
}
|
|
1025
|
+
for (var iterator = 0; iterator < aComputeFilterParma.length; iterator++) {
|
|
1026
|
+
if (aComputeFilterParma[iterator].sOperator === "Contains") {
|
|
1027
|
+
aComputeFilterParma[iterator].sOperator = "EQ";
|
|
1028
|
+
} else if (aComputeFilterParma[iterator].sOperator === "BT") {
|
|
1029
|
+
|
|
1030
|
+
var convertedFilterParam = that._manageParam(aComputeFilterParma[iterator].sPath,aComputeFilterParma[iterator].sOperator,
|
|
1031
|
+
aComputeFilterParma[iterator].oValue1, aComputeFilterParma[iterator].oValue2);
|
|
1032
|
+
delete aComputeFilterParma[iterator];
|
|
1033
|
+
aComputeFilterParma[iterator] = convertedFilterParam;
|
|
1034
|
+
|
|
1035
|
+
} else if (aComputeFilterParma[iterator].sOperator === "StartsWith") {
|
|
1036
|
+
_valueField = (aComputeFilterParma[iterator].sPath === this._propertyValue) ? this._valueFieldValue : this._valueFieldDescription;
|
|
1037
|
+
_valueField.setValueState("Error");
|
|
1038
|
+
_valueField.setValueStateText(aComputeFilterParma[iterator].sOperator + " operator not supported");
|
|
1039
|
+
} else if (aComputeFilterParma[iterator].sOperator === "EndsWith") {
|
|
1040
|
+
_valueField = (aComputeFilterParma[iterator].sPath === this._propertyValue) ? this._valueFieldValue : this._valueFieldDescription;
|
|
1041
|
+
_valueField.setValueState("Error");
|
|
1042
|
+
_valueField.setValueStateText(aComputeFilterParma[iterator].sOperator + " operator not supported");
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
return aFilters;
|
|
1046
|
+
};
|
|
1047
|
+
|
|
1048
|
+
/*
|
|
1049
|
+
* Converts the Between Operator to Less than and Equal to Operator.
|
|
1050
|
+
*/
|
|
1051
|
+
ExpressionAdvanced.prototype._manageParam = function(sPath, operator, value1, value2) {
|
|
1052
|
+
var filterParam = [];
|
|
1053
|
+
if (value1 && value2) {
|
|
1054
|
+
filterParam = new sap.ui.model.Filter({
|
|
1055
|
+
filters : [ new sap.ui.model.Filter(sPath, sap.ui.model.FilterOperator.GT, value1),
|
|
1056
|
+
new sap.ui.model.Filter(sPath, sap.ui.model.FilterOperator.LT, value2) ],
|
|
1057
|
+
and : true
|
|
1058
|
+
});
|
|
1059
|
+
}
|
|
1060
|
+
return filterParam;
|
|
1061
|
+
};
|
|
1062
|
+
|
|
1063
|
+
// Utility function to form the search filter params.
|
|
1064
|
+
ExpressionAdvanced.prototype._getSearchFilters = function(searchParam) {
|
|
1065
|
+
return new sap.ui.model.Filter({
|
|
1066
|
+
filters : [ new sap.ui.model.Filter(this._propertyValue, sap.ui.model.FilterOperator.EQ, searchParam),
|
|
1067
|
+
new sap.ui.model.Filter(this._propertyDescription, sap.ui.model.FilterOperator.EQ, searchParam) ],
|
|
1068
|
+
and : false
|
|
1069
|
+
});
|
|
1070
|
+
};
|
|
1071
|
+
|
|
1072
|
+
ExpressionAdvanced.prototype.setValueStateFilter = function(oEvent) {
|
|
1073
|
+
var sId = oEvent.getSource().sId;
|
|
1074
|
+
this._valueFieldValue = sap.ui.getCore().byId(sId + "-filterItemControlA_-Value");
|
|
1075
|
+
if (this._valueFieldValue) {
|
|
1076
|
+
this._valueFieldValue.setValueState("None");
|
|
1077
|
+
this._valueFieldValue.setValueStateText("");
|
|
1078
|
+
}
|
|
1079
|
+
this._valueFieldDescription = sap.ui.getCore().byId(sId + "-filterItemControlA_-Description");
|
|
1080
|
+
if (this._valueFieldDescription) {
|
|
1081
|
+
this._valueFieldDescription.setValueState("None");
|
|
1082
|
+
this._valueFieldDescription.setValueStateText("");
|
|
1083
|
+
}
|
|
1084
|
+
};
|
|
1085
|
+
|
|
1086
|
+
/*
|
|
1087
|
+
* Callback fucntion event which is fired once the user clicked on 'ValueHelp' token link. onValueHelpLinkPress : create code mirror
|
|
1088
|
+
* search cursor based on the 'ValueList' token which has been clicked. Create Select Dialog display all 'ValueList' suggestions. @param
|
|
1089
|
+
* valueHelpText : 'ValueHelp' token text value. @param valueHelpId : ValueHelp Id of the token.
|
|
1090
|
+
*/
|
|
1091
|
+
ExpressionAdvanced.prototype.onValueHelpLinkPress = function(valueHelpText, valueHelpId) {
|
|
1092
|
+
if (!this.getEditable()) {
|
|
1093
|
+
return;
|
|
1094
|
+
}
|
|
1095
|
+
var expressionLanguage = sap.ui.getCore().byId(this.getExpressionLanguage());
|
|
1096
|
+
var callback = expressionLanguage.getValueHelpCallback();
|
|
1097
|
+
|
|
1098
|
+
//build valueHelpInfo
|
|
1099
|
+
var tokens = this.getExpressionTokens();
|
|
1100
|
+
var i;
|
|
1101
|
+
var valueHelpInfo;
|
|
1102
|
+
var line = this.codeMirror.getCursor().line;
|
|
1103
|
+
var valueListPosition;
|
|
1104
|
+
for (i = 0; i < tokens.length; i++) {
|
|
1105
|
+
if (tokens[i].tokenType === 'valueList' && tokens[i].info && tokens[i].info.id === valueHelpId &&
|
|
1106
|
+
tokens[i].token === valueHelpText) {
|
|
1107
|
+
valueHelpInfo = [tokens[i].info];
|
|
1108
|
+
valueListPosition = tokens[i].end;
|
|
1109
|
+
break;
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
var curPostion = {};
|
|
1113
|
+
curPostion.ch = valueListPosition;
|
|
1114
|
+
curPostion.line = line;
|
|
1115
|
+
|
|
1116
|
+
if ((typeof callback) === "function") {
|
|
1117
|
+
|
|
1118
|
+
callback.call(this, valueHelpInfo);
|
|
1119
|
+
var oModel = valueHelpInfo[0].model;
|
|
1120
|
+
if (!oModel.getMetaModel().oModel) {
|
|
1121
|
+
oModel.attachMetadataLoaded(function() {
|
|
1122
|
+
this._createValueHelpProvider(valueHelpInfo[0], true);
|
|
1123
|
+
}.bind(this));
|
|
1124
|
+
} else {
|
|
1125
|
+
this._createValueHelpProvider(valueHelpInfo[0], true);
|
|
1126
|
+
}
|
|
1127
|
+
} else if (valueHelpInfo && valueHelpInfo[0].metadata.hasOwnProperty(this._hasValueSource) && valueHelpInfo[0].metadata.HasValueSource ===
|
|
1128
|
+
true) {
|
|
1129
|
+
valueHelpInfo[0].expressionLanguage = expressionLanguage;
|
|
1130
|
+
this._createCpValueHelp(valueHelpInfo[0], curPostion, true, true);
|
|
1131
|
+
}
|
|
1132
|
+
};
|
|
1133
|
+
|
|
1134
|
+
ExpressionAdvanced.prototype._createSearchCursor = function(valueHelpText) {
|
|
1135
|
+
var cm = this.codeMirror;
|
|
1136
|
+
cm.getCursor().ch = cm.getCursor().ch + valueHelpText.length;
|
|
1137
|
+
var cursor = cm.getSearchCursor(valueHelpText, cm.getCursor(), typeof valueHelpText == "string" && valueHelpText == valueHelpText.toLowerCase());
|
|
1138
|
+
return cursor;
|
|
1139
|
+
};
|
|
1140
|
+
|
|
1141
|
+
ExpressionAdvanced.prototype.setTextOnCursor = function(sValue, cursorPosition, bReplaceWord, businessDataType, bAddSpace,
|
|
1142
|
+
bValuehelpLinkPress) {
|
|
1143
|
+
|
|
1144
|
+
function getNextLine(currentLine, arrLines) {
|
|
1145
|
+
// this function skips empty lines
|
|
1146
|
+
var nextLine = currentLine + 1;
|
|
1147
|
+
for (var j = nextLine; j < arrLines.length; j++) {
|
|
1148
|
+
if (arrLines[j].length === 0) {
|
|
1149
|
+
nextLine++;
|
|
1150
|
+
} else {
|
|
1151
|
+
break;
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
return nextLine;
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
var TYPE_STRING = "String",
|
|
1158
|
+
TYPE_DATE = "Date",
|
|
1159
|
+
TYPE_TIMESTAMP = "Timestamp",
|
|
1160
|
+
TYPE_TIME = "Time";
|
|
1161
|
+
|
|
1162
|
+
// inserting a new selection
|
|
1163
|
+
var cursorPos;
|
|
1164
|
+
var sFormatedValue = ((businessDataType === TYPE_STRING) ||
|
|
1165
|
+
(businessDataType === TYPE_DATE) ||
|
|
1166
|
+
(businessDataType === TYPE_TIMESTAMP) ||
|
|
1167
|
+
(businessDataType === TYPE_TIME)) ? "'" + sValue + "'" : sValue;
|
|
1168
|
+
|
|
1169
|
+
var tokens = this.getExpressionTokens();
|
|
1170
|
+
var lines = this.getValue().split("\n");
|
|
1171
|
+
var line = -1;
|
|
1172
|
+
var oToken = {
|
|
1173
|
+
start: {
|
|
1174
|
+
line: cursorPosition.line,
|
|
1175
|
+
ch: cursorPosition.ch
|
|
1176
|
+
},
|
|
1177
|
+
end: {
|
|
1178
|
+
line: cursorPosition.line,
|
|
1179
|
+
ch: cursorPosition.ch
|
|
1180
|
+
}
|
|
1181
|
+
};
|
|
1182
|
+
for (var i = 0; i < tokens.length; i++) {
|
|
1183
|
+
line = (tokens[i].start === 0) ? getNextLine(line, lines) : line;
|
|
1184
|
+
if (line === cursorPosition.line && (tokens[i].end > cursorPosition.ch) || (tokens[i].end >= cursorPosition.ch && bValuehelpLinkPress)) {
|
|
1185
|
+
oToken.start.ch = tokens[i].start;
|
|
1186
|
+
oToken.end.ch = tokens[i].end;
|
|
1187
|
+
bReplaceWord = true;
|
|
1188
|
+
break;
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
if (bReplaceWord) {
|
|
1192
|
+
this.codeMirror.replaceRange(sFormatedValue, oToken.start, oToken.end); // replace the selection
|
|
1193
|
+
cursorPos = this.codeMirror.findPosH(oToken.start, sFormatedValue.length, "char", true);
|
|
1194
|
+
this.codeMirror.setCursor(cursorPos); // set the cursor at the end of the word
|
|
1195
|
+
} else {
|
|
1196
|
+
sFormatedValue = bAddSpace ? " " + sFormatedValue : sFormatedValue;
|
|
1197
|
+
this.codeMirror.replaceRange(sFormatedValue, cursorPosition); // insert the selection
|
|
1198
|
+
cursorPos = this.codeMirror.findPosH(cursorPosition, sFormatedValue.length, "char", true);
|
|
1199
|
+
this.codeMirror.setCursor(cursorPos); // set the cursor past the new selection
|
|
1200
|
+
}
|
|
1201
|
+
var oExpressionLanguage = sap.ui.getCore().byId(this.getExpressionLanguage());
|
|
1202
|
+
this.getFormattingTokens(oExpressionLanguage);
|
|
1203
|
+
this.ValueHelpRequested = false;
|
|
1204
|
+
};
|
|
1205
|
+
|
|
1206
|
+
ExpressionAdvanced.prototype._setCodeMirror = function() {
|
|
1207
|
+
var editable = this.getEditable();
|
|
1208
|
+
var attributeInfo;
|
|
1209
|
+
if ("getAttributeInfo" in this && this.getAttributeInfo()) {
|
|
1210
|
+
attributeInfo = this.getAttributeInfo();
|
|
1211
|
+
}
|
|
1212
|
+
var expressionLanguage = sap.ui.getCore().byId(this.getExpressionLanguage());
|
|
1213
|
+
var valueListAttribute;
|
|
1214
|
+
if (attributeInfo) {
|
|
1215
|
+
valueListAttribute = expressionLanguage.getValueListAttribute(attributeInfo);
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
function autoComplete(cm, commandName, timeout) {
|
|
1219
|
+
var oAdvancedExpressionEditor = cm.options.expressionEditor;
|
|
1220
|
+
if ((oAdvancedExpressionEditor.getEditable() !== false) && sap.ui.getCore().byId(oAdvancedExpressionEditor.getExpressionLanguage())) {
|
|
1221
|
+
window.clearTimeout(oAdvancedExpressionEditor.timer);
|
|
1222
|
+
oAdvancedExpressionEditor.timer = window.setTimeout(function() {
|
|
1223
|
+
cm.execCommand(commandName);
|
|
1224
|
+
}, timeout);
|
|
1225
|
+
return window.CodeMirror.Pass; // tell CodeMirror we didn't handle the key
|
|
1226
|
+
}
|
|
1227
|
+
return null;
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
function ordinaryKeyCallback(cm) {
|
|
1231
|
+
var oAdvancedExpressionEditor = cm.options.expressionEditor;
|
|
1232
|
+
if (oAdvancedExpressionEditor.getEditable() !== false) {
|
|
1233
|
+
window.clearTimeout(oAdvancedExpressionEditor.timer);
|
|
1234
|
+
oAdvancedExpressionEditor.needAutoComplete = true;
|
|
1235
|
+
oAdvancedExpressionEditor.timer = window.setTimeout(function() {
|
|
1236
|
+
if (oAdvancedExpressionEditor.needAutoComplete && sap.ui.getCore().byId(oAdvancedExpressionEditor.getExpressionLanguage())) {
|
|
1237
|
+
cm.execCommand("autocomplete");
|
|
1238
|
+
}
|
|
1239
|
+
}, 500);
|
|
1240
|
+
return window.CodeMirror.Pass; // tell CodeMirror we didn't handle the key
|
|
1241
|
+
}
|
|
1242
|
+
return null;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
function enterKeyCallback(cm) {
|
|
1246
|
+
return autoComplete(cm, "enterAutocomplete", 500);
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
function colonKeyCallback(cm) {
|
|
1250
|
+
return autoComplete(cm, "colonAutocomplete", 500);
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
function ctrlSpaceKeysCallback(cm) {
|
|
1254
|
+
autoComplete(cm, "autocomplete", 0);
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
/*
|
|
1258
|
+
* SPACE is use for both opening the hints, and closing them if writing a non-existent expression.
|
|
1259
|
+
* As such, it is separated from the common ordinaryKeyCallback() key handling.
|
|
1260
|
+
* If not so, it alternately opens the hints every 2nd press. Example flow:
|
|
1261
|
+
* press SPACE:
|
|
1262
|
+
* 1. ordinaryKeyCallback() sets the timeout
|
|
1263
|
+
* 2. ordinaryKeyCallback() delayed opening of hints
|
|
1264
|
+
* press SPACE (not in one of the hints):
|
|
1265
|
+
* 1. ordinaryKeyCallback() sets the timeout
|
|
1266
|
+
* 2. _handleEndCodeCompletion sets needAutoComplete as false (event coming from CodeMirror hints)
|
|
1267
|
+
* 3. ordinaryKeyCallback() delayed opening of hints - not opening the hints as needAutoComplete is false
|
|
1268
|
+
* **/
|
|
1269
|
+
function spaceKeyCallback(cm) {
|
|
1270
|
+
return autoComplete(cm, "autocomplete", 500);
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
function valueHelpCallback(cm) {
|
|
1274
|
+
var oAdvancedExpressionEditor = cm.options.expressionEditor;
|
|
1275
|
+
var input = cm.getRange({
|
|
1276
|
+
line: 0,
|
|
1277
|
+
ch: 0
|
|
1278
|
+
}, cm.getCursor());
|
|
1279
|
+
if (cm.options.headerValue) {
|
|
1280
|
+
var prefix = cm.options.headerValue + " ";
|
|
1281
|
+
if (cm.options.fixedOperator) {
|
|
1282
|
+
prefix = prefix + cm.options.fixedOperator + " ";
|
|
1283
|
+
}
|
|
1284
|
+
input = prefix + input;
|
|
1285
|
+
}
|
|
1286
|
+
var autoSuggestions = cm.options.relDelegate.getSuggestions(
|
|
1287
|
+
input,
|
|
1288
|
+
cm.options.returnType,
|
|
1289
|
+
cm.options.collection);
|
|
1290
|
+
var suggestions;
|
|
1291
|
+
if (autoSuggestions && autoSuggestions.hasOwnProperty("suggs") && autoSuggestions.suggs.length > 0) {
|
|
1292
|
+
suggestions = autoSuggestions.suggs;
|
|
1293
|
+
for (var i = 0; i < suggestions.length; i++) {
|
|
1294
|
+
if (suggestions[i].tokenType === 'valueList' && suggestions[i].info.metadata.hasOwnProperty(oAdvancedExpressionEditor._hasValueSource)) {
|
|
1295
|
+
oAdvancedExpressionEditor._createCpValueHelp(suggestions[i].info, cm.getCursor(), false);
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
this.keyMap = {
|
|
1302
|
+
"Tab": false,
|
|
1303
|
+
"Shift-Tab": false,
|
|
1304
|
+
"Ctrl-Space": ctrlSpaceKeysCallback,
|
|
1305
|
+
"Backspace": ordinaryKeyCallback,
|
|
1306
|
+
"Enter": enterKeyCallback,
|
|
1307
|
+
"':'": colonKeyCallback,
|
|
1308
|
+
"'+'": ordinaryKeyCallback,
|
|
1309
|
+
"'-'": ordinaryKeyCallback,
|
|
1310
|
+
"'*'": ordinaryKeyCallback,
|
|
1311
|
+
"'/'": ordinaryKeyCallback,
|
|
1312
|
+
"'_'": ordinaryKeyCallback,
|
|
1313
|
+
"'o'": ordinaryKeyCallback,
|
|
1314
|
+
"'q'": ordinaryKeyCallback,
|
|
1315
|
+
"'w'": ordinaryKeyCallback,
|
|
1316
|
+
"'e'": ordinaryKeyCallback,
|
|
1317
|
+
"'r'": ordinaryKeyCallback,
|
|
1318
|
+
"'t'": ordinaryKeyCallback,
|
|
1319
|
+
"'y'": ordinaryKeyCallback,
|
|
1320
|
+
"'u'": ordinaryKeyCallback,
|
|
1321
|
+
"'i'": ordinaryKeyCallback,
|
|
1322
|
+
"'p'": ordinaryKeyCallback,
|
|
1323
|
+
"'.'": ordinaryKeyCallback,
|
|
1324
|
+
"'a'": ordinaryKeyCallback,
|
|
1325
|
+
"'s'": ordinaryKeyCallback,
|
|
1326
|
+
"'d'": ordinaryKeyCallback,
|
|
1327
|
+
"'f'": ordinaryKeyCallback,
|
|
1328
|
+
"'g'": ordinaryKeyCallback,
|
|
1329
|
+
"'h'": ordinaryKeyCallback,
|
|
1330
|
+
"'j'": ordinaryKeyCallback,
|
|
1331
|
+
"'k'": ordinaryKeyCallback,
|
|
1332
|
+
"'l'": ordinaryKeyCallback,
|
|
1333
|
+
"'z'": ordinaryKeyCallback,
|
|
1334
|
+
"'x'": ordinaryKeyCallback,
|
|
1335
|
+
"'c'": ordinaryKeyCallback,
|
|
1336
|
+
"'v'": ordinaryKeyCallback,
|
|
1337
|
+
"'b'": ordinaryKeyCallback,
|
|
1338
|
+
"'n'": ordinaryKeyCallback,
|
|
1339
|
+
"'m'": ordinaryKeyCallback,
|
|
1340
|
+
"'O'": ordinaryKeyCallback,
|
|
1341
|
+
"'Q'": ordinaryKeyCallback,
|
|
1342
|
+
"'W'": ordinaryKeyCallback,
|
|
1343
|
+
"'E'": ordinaryKeyCallback,
|
|
1344
|
+
"'R'": ordinaryKeyCallback,
|
|
1345
|
+
"'T'": ordinaryKeyCallback,
|
|
1346
|
+
"'Y'": ordinaryKeyCallback,
|
|
1347
|
+
"'U'": ordinaryKeyCallback,
|
|
1348
|
+
"'I'": ordinaryKeyCallback,
|
|
1349
|
+
"'P'": ordinaryKeyCallback,
|
|
1350
|
+
"'A'": ordinaryKeyCallback,
|
|
1351
|
+
"'S'": ordinaryKeyCallback,
|
|
1352
|
+
"'D'": ordinaryKeyCallback,
|
|
1353
|
+
"'F'": ordinaryKeyCallback,
|
|
1354
|
+
"'G'": ordinaryKeyCallback,
|
|
1355
|
+
"'H'": ordinaryKeyCallback,
|
|
1356
|
+
"'J'": ordinaryKeyCallback,
|
|
1357
|
+
"'K'": ordinaryKeyCallback,
|
|
1358
|
+
"'L'": ordinaryKeyCallback,
|
|
1359
|
+
"'Z'": ordinaryKeyCallback,
|
|
1360
|
+
"'X'": ordinaryKeyCallback,
|
|
1361
|
+
"'C'": ordinaryKeyCallback,
|
|
1362
|
+
"'V'": ordinaryKeyCallback,
|
|
1363
|
+
"'B'": ordinaryKeyCallback,
|
|
1364
|
+
"'N'": ordinaryKeyCallback,
|
|
1365
|
+
"'M'": ordinaryKeyCallback,
|
|
1366
|
+
"'0'": false,
|
|
1367
|
+
"'1'": false,
|
|
1368
|
+
"'2'": false,
|
|
1369
|
+
"'3'": false,
|
|
1370
|
+
"'4'": false,
|
|
1371
|
+
"'5'": false,
|
|
1372
|
+
"'6'": false,
|
|
1373
|
+
"'7'": false,
|
|
1374
|
+
"'8'": false,
|
|
1375
|
+
"'9'": false,
|
|
1376
|
+
"' '": spaceKeyCallback,
|
|
1377
|
+
"F4": valueHelpCallback
|
|
1378
|
+
};
|
|
1379
|
+
|
|
1380
|
+
function keyMapping(oAdvancedExpressionEditor) {
|
|
1381
|
+
return oAdvancedExpressionEditor.keyMap;
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
if (this.expressionTokens.length === 0) {
|
|
1385
|
+
var oEL = sap.ui.getCore().byId(this.getExpressionLanguage());
|
|
1386
|
+
if (oEL) {
|
|
1387
|
+
this.getFormattingTokens(oEL);
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
var keyMap = keyMapping(this);
|
|
1391
|
+
var textAreaId = this.oTextArea.getId() + '-inner';
|
|
1392
|
+
var isMSIE = (Utils.msieversion() >= 0);
|
|
1393
|
+
if (isMSIE) {
|
|
1394
|
+
jQuery('#' + textAreaId).attr('placeholder', this.getProperty('placeholder'));
|
|
1395
|
+
}
|
|
1396
|
+
this.codeMirror = window.CodeMirror.fromTextArea(document.getElementById(textAreaId), {
|
|
1397
|
+
mode: "text/hdf",
|
|
1398
|
+
lineNumbers: false,
|
|
1399
|
+
lineWrapping: true,
|
|
1400
|
+
matchBrackets: editable === true ? true : false,
|
|
1401
|
+
highlightSelectionMatches: editable === true ? {
|
|
1402
|
+
showToken: /\w/
|
|
1403
|
+
} : {},
|
|
1404
|
+
relDelegate: expressionLanguage,
|
|
1405
|
+
returnType: this.getProperty("type"),
|
|
1406
|
+
collection: this.getProperty("collection"),
|
|
1407
|
+
valueListAttribute: valueListAttribute,
|
|
1408
|
+
expressionEditor: this,
|
|
1409
|
+
stillNeedShowHint: true,
|
|
1410
|
+
shouldValidate: true,
|
|
1411
|
+
styleSelectedText: true,
|
|
1412
|
+
smartIndent: true,
|
|
1413
|
+
autoCloseBrackets: true,
|
|
1414
|
+
indentUnit: 6
|
|
1415
|
+
});
|
|
1416
|
+
this.codeMirror.addKeyMap(keyMap, true);
|
|
1417
|
+
|
|
1418
|
+
// //In order to support aliases - we must reset the aliases after initialization of codeMirror object
|
|
1419
|
+
// if (window.CodeMirror.mimeModes.hasOwnProperty('text/hdf'))
|
|
1420
|
+
// window.CodeMirror.mimeModes['text/hdf'].aliases = me.getRelDelegate().vocabualryAliasesNames;
|
|
1421
|
+
};
|
|
1422
|
+
|
|
1423
|
+
ExpressionAdvanced.prototype.getFormattingTokens = function(oExpressionLanguage) {
|
|
1424
|
+
this.tokens = [];
|
|
1425
|
+
this.valueListAttrInfo = oExpressionLanguage.getValueListAttribute(this.mProperties.attributeInfo);
|
|
1426
|
+
var exprssionMetadata = oExpressionLanguage.getExpressionMetadata(this._liveValue);
|
|
1427
|
+
if (exprssionMetadata) {
|
|
1428
|
+
this.tokens = exprssionMetadata.tokens;
|
|
1429
|
+
}
|
|
1430
|
+
if (oExpressionLanguage._hasValueSource && this.valueListAttrInfo) {
|
|
1431
|
+
this.newExpression = this.valueListAttrInfo.navPath + " " + Constants.IS_EQUAL_TO + " " + this._liveValue;
|
|
1432
|
+
exprssionMetadata = oExpressionLanguage.getExpressionMetadata(this.newExpression);
|
|
1433
|
+
if (exprssionMetadata) {
|
|
1434
|
+
var tokensWithPath = exprssionMetadata.tokens;
|
|
1435
|
+
for (var tokenPos = 0; tokenPos < tokensWithPath.length; tokenPos++) {
|
|
1436
|
+
for (var pos = 0; pos < this.tokens.length; pos++) {
|
|
1437
|
+
if (tokensWithPath[tokenPos].tokenType === "valueList" && tokensWithPath[tokenPos].token === this.tokens[pos].token) {
|
|
1438
|
+
this.tokens[pos].info = tokensWithPath[tokenPos].info;
|
|
1439
|
+
this.tokens[pos].tokenType = tokensWithPath[tokenPos].tokenType;
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
this.setExpressionTokens(this.tokens);
|
|
1447
|
+
};
|
|
1448
|
+
|
|
1449
|
+
ExpressionAdvanced.prototype._setEditorStyle = function() {
|
|
1450
|
+
//We added to the codeMirror code (see codeMirror.js) styles class derived from SAPUI5
|
|
1451
|
+
//Set CSS style to the new added codemirror control - according to SAPUI5 textField CSS
|
|
1452
|
+
//sapUiTf sapUiTfBack sapUiTfBrd sapUiTfStd sapUiTxtA
|
|
1453
|
+
|
|
1454
|
+
//We need to mimic the way input control is being used in sapui5 which means:
|
|
1455
|
+
//level 1: sapMInput sapMInputBase
|
|
1456
|
+
//level 2: sapMInputBaseInner
|
|
1457
|
+
if (this.getValueStateText() && this.getValueStateText() !== "") {
|
|
1458
|
+
jQuery(this.codeMirror.getWrapperElement()).addClass('CodeMirror-error');
|
|
1459
|
+
jQuery(this.codeMirror.getWrapperElement()).addClass('sapMInputBaseStateInner sapMInputBaseErrorInner sapMInputBaseContentWrapper sapMInputBaseContentWrapperState sapMInputBaseContentWrapperError');
|
|
1460
|
+
jQuery('#' + this.oTextArea.getId()).addClass('sapMInputBaseError');
|
|
1461
|
+
}
|
|
1462
|
+
jQuery('#' + this.oTextArea.getId()).removeClass().addClass('sapMInput'); //sapMInputBase
|
|
1463
|
+
jQuery(this.codeMirror.getWrapperElement()).addClass('sapMInputBaseInner CodeMirror-rules');
|
|
1464
|
+
if (!this.getEditable()) {
|
|
1465
|
+
jQuery(this.codeMirror.getWrapperElement()).addClass('CodeMirror-rules-Not-Editable');
|
|
1466
|
+
} else {
|
|
1467
|
+
jQuery(this.codeMirror.getWrapperElement()).removeClass('CodeMirror-rules-Not-Editable');
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
// bug fix - without it the height of codeMirror to big --> cause to wrong cursor positioning
|
|
1471
|
+
if (this.codeMirror) {
|
|
1472
|
+
this.codeMirror.refresh();
|
|
1473
|
+
}
|
|
1474
|
+
};
|
|
1475
|
+
|
|
1476
|
+
ExpressionAdvanced.prototype._handleOnLoadValidation = function() {
|
|
1477
|
+
if (this.getValidateOnLoad()) {
|
|
1478
|
+
this.validateExpression();
|
|
1479
|
+
this.setValidateOnLoad(false);
|
|
1480
|
+
}
|
|
1481
|
+
};
|
|
1482
|
+
|
|
1483
|
+
ExpressionAdvanced.prototype._handleEditableProperty = function() {
|
|
1484
|
+
if (this.getEditable() === false) {
|
|
1485
|
+
this.codeMirror.setOption("readOnly", "true");
|
|
1486
|
+
this.codeMirror.setOption("theme", "read-only");
|
|
1487
|
+
}
|
|
1488
|
+
};
|
|
1489
|
+
|
|
1490
|
+
ExpressionAdvanced.prototype._handleFocus = function() {
|
|
1491
|
+
var oCodeMirror = this.codeMirror;
|
|
1492
|
+
if (this.getFocusOnLoad()) {
|
|
1493
|
+
this.focus();
|
|
1494
|
+
}
|
|
1495
|
+
this.codeMirror.on("focus", function(cm, change) {
|
|
1496
|
+
var errorMessage = cm.options.expressionEditor.getProperty("valueStateText");
|
|
1497
|
+
if (errorMessage && errorMessage !== "") {
|
|
1498
|
+
cm.options.expressionEditor._showPopUp();
|
|
1499
|
+
}
|
|
1500
|
+
cm.options.stillNeedShowHint = true;
|
|
1501
|
+
jQuery('#' + cm.options.expressionEditor.oTextArea.getId()).addClass('sapMInputFocused');
|
|
1502
|
+
jQuery(cm.getWrapperElement()).removeClass('CodeMirror-errorBackground');
|
|
1503
|
+
});
|
|
1504
|
+
|
|
1505
|
+
if (this.dataModel.getProperty("/focus") === true) {
|
|
1506
|
+
window.setTimeout(function() {
|
|
1507
|
+
var lastLine = oCodeMirror.getLine(oCodeMirror.lastLine());
|
|
1508
|
+
var cursorPos = lastLine.length;
|
|
1509
|
+
oCodeMirror.setCursor({
|
|
1510
|
+
line: oCodeMirror.lastLine(),
|
|
1511
|
+
ch: cursorPos
|
|
1512
|
+
});
|
|
1513
|
+
//oCodeMirror.focus();
|
|
1514
|
+
}, 10);
|
|
1515
|
+
}
|
|
1516
|
+
};
|
|
1517
|
+
|
|
1518
|
+
ExpressionAdvanced.prototype._refreshOnNavigationEnd = function() {
|
|
1519
|
+
jQuery(".sapMNav").on('webkitTransitionEnd oTransitionEnd transitionend msTransitionEnd', jQuery.proxy(_refreshCodemirror, this));
|
|
1520
|
+
|
|
1521
|
+
function _refreshCodemirror() {
|
|
1522
|
+
if (this.codeMirror) {
|
|
1523
|
+
this.codeMirror.refresh();
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
};
|
|
1528
|
+
|
|
1529
|
+
ExpressionAdvanced.prototype._handleKeyPress = function() {
|
|
1530
|
+
this.codeMirror.on("keyHandled", function(cm, key, event) {
|
|
1531
|
+
if (event.keyCode === 27 && this && this.endCompletion === true) {
|
|
1532
|
+
event.stopPropagation();
|
|
1533
|
+
this.endCompletion = false;
|
|
1534
|
+
}
|
|
1535
|
+
if (event.ctrlKey === true && key === "Ctrl-A") {
|
|
1536
|
+
event.stopPropagation();
|
|
1537
|
+
}
|
|
1538
|
+
});
|
|
1539
|
+
};
|
|
1540
|
+
|
|
1541
|
+
ExpressionAdvanced.prototype._handleEndCodeCompletion = function() {
|
|
1542
|
+
this.codeMirror.on("endCompletion", function(cm) {
|
|
1543
|
+
cm.options.expressionEditor.needAutoComplete = false;
|
|
1544
|
+
cm.options.expressionEditor.endCompletion = !cm.options.expressionEditor.endCompletion;
|
|
1545
|
+
});
|
|
1546
|
+
};
|
|
1547
|
+
|
|
1548
|
+
ExpressionAdvanced.prototype._handleMousedown = function() {
|
|
1549
|
+
this.codeMirror.on("mousedown", function(cm, event) {
|
|
1550
|
+
|
|
1551
|
+
//Once user click on 'ValueList' token
|
|
1552
|
+
event.stopPropagation();
|
|
1553
|
+
|
|
1554
|
+
var target = event.target || event.srcElement;
|
|
1555
|
+
|
|
1556
|
+
if (target && event.button === 0) {
|
|
1557
|
+
var classList = target.className.split(/\s+/);
|
|
1558
|
+
|
|
1559
|
+
for (var i = 0; i < classList.length; i++) {
|
|
1560
|
+
if (classList[i] === 'cm-valuehelp') {
|
|
1561
|
+
var valueHelpId = classList[++i].split('-valuehelpid-')[1];
|
|
1562
|
+
//vlaueHelpPopUp
|
|
1563
|
+
cm.options.expressionEditor.onValueHelpLinkPress(target.textContent, valueHelpId);
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
});
|
|
1568
|
+
};
|
|
1569
|
+
|
|
1570
|
+
/*
|
|
1571
|
+
/!*
|
|
1572
|
+
* Get complete token string from tokens cached array
|
|
1573
|
+
* @param selectedValueList - selected html element outerHTML, contain only partaily token value
|
|
1574
|
+
* @param oControll expression editor instance
|
|
1575
|
+
* @returns complete token string
|
|
1576
|
+
*!/
|
|
1577
|
+
ExpressionAdvanced.prototype._getValueListToken = function (selectedValueList, oControll){
|
|
1578
|
+
var tokens = oControll.getExpressionTokens();
|
|
1579
|
+
var tokensLength = tokens.length;
|
|
1580
|
+
for (var index = 0; index < tokensLength; index++){
|
|
1581
|
+
if (tokens[index].token.indexOf(selectedValueList) > -1){
|
|
1582
|
+
return tokens[index].token;
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
return null;
|
|
1586
|
+
};*/
|
|
1587
|
+
|
|
1588
|
+
ExpressionAdvanced.prototype._handleChange = function() {
|
|
1589
|
+
this.codeMirror.on("change", function(cm, change) {
|
|
1590
|
+
var oAdvancedExpressionEditor = cm.options.expressionEditor;
|
|
1591
|
+
if (oAdvancedExpressionEditor.codeMirror.state.completionActive && oAdvancedExpressionEditor.keyMap["'" + change.text[0] + "'"] ===
|
|
1592
|
+
false) {
|
|
1593
|
+
oAdvancedExpressionEditor.codeMirror.state.completionActive.close();
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1596
|
+
jQuery(oAdvancedExpressionEditor.codeMirror.getWrapperElement()).removeClass('CodeMirror-error');
|
|
1597
|
+
jQuery(oAdvancedExpressionEditor.codeMirror.getWrapperElement()).removeClass('sapMInputBaseStateInner sapMInputBaseErrorInner sapMInputBaseContentWrapper sapMInputBaseContentWrapperState sapMInputBaseContentWrapperError');
|
|
1598
|
+
oAdvancedExpressionEditor._liveValue = cm.getValue();
|
|
1599
|
+
|
|
1600
|
+
var oEL = sap.ui.getCore().byId(oAdvancedExpressionEditor.getExpressionLanguage());
|
|
1601
|
+
if (oEL) {
|
|
1602
|
+
oAdvancedExpressionEditor.getFormattingTokens(oEL);
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
oAdvancedExpressionEditor.codeMirror.options.shouldValidate = true;
|
|
1606
|
+
oAdvancedExpressionEditor.fireLiveChange({
|
|
1607
|
+
newValue: cm.getValue()
|
|
1608
|
+
});
|
|
1609
|
+
// we dont indent on delete
|
|
1610
|
+
if (change.origin !== "+delete") {
|
|
1611
|
+
cm.operation(function() {
|
|
1612
|
+
for (var line = 0, end = cm.lineCount(); line < end; ++line) {
|
|
1613
|
+
cm.indentLine(line, "smart");
|
|
1614
|
+
}
|
|
1615
|
+
});
|
|
1616
|
+
}
|
|
1617
|
+
});
|
|
1618
|
+
};
|
|
1619
|
+
|
|
1620
|
+
ExpressionAdvanced.prototype._handleFocusLeave = function() {
|
|
1621
|
+
this.codeMirror.on("blur", function(cm) {
|
|
1622
|
+
var oAdvancedExpressionEditor = cm.options.expressionEditor;
|
|
1623
|
+
oAdvancedExpressionEditor._closePopUp();
|
|
1624
|
+
oAdvancedExpressionEditor.codeMirror.options.stillNeedShowHint = false;
|
|
1625
|
+
|
|
1626
|
+
// shouldValidate flag indicates:
|
|
1627
|
+
// - this is real focus leave, not because of click on Hint
|
|
1628
|
+
// - value was changed while the control was in focus
|
|
1629
|
+
// - oAdvancedExpressionEditor.bFlagForPreventBlurWhenPopOverOpen see bug 4810
|
|
1630
|
+
if (oAdvancedExpressionEditor.codeMirror.options.shouldValidate && !oAdvancedExpressionEditor.bFlagForPreventBlurWhenPopOverOpen) {
|
|
1631
|
+
oAdvancedExpressionEditor.setValue(oAdvancedExpressionEditor.codeMirror.getValue());
|
|
1632
|
+
//if (oAdvancedExpressionEditor.getProperty("automaticValidation")){
|
|
1633
|
+
if (!(oAdvancedExpressionEditor instanceof sap.rules.ui.DecisionTableCellExpressionAdvanced)) {
|
|
1634
|
+
oAdvancedExpressionEditor.validate();
|
|
1635
|
+
}
|
|
1636
|
+
oAdvancedExpressionEditor._closePopUp();
|
|
1637
|
+
//}
|
|
1638
|
+
oAdvancedExpressionEditor.fireChange({
|
|
1639
|
+
newValue: cm.getValue()
|
|
1640
|
+
});
|
|
1641
|
+
oAdvancedExpressionEditor.codeMirror.options.shouldValidate = false;
|
|
1642
|
+
}
|
|
1643
|
+
jQuery('#' + oAdvancedExpressionEditor.oTextArea.getId()).removeClass('sapMInputFocused');
|
|
1644
|
+
oAdvancedExpressionEditor.dataModel.setProperty("/focus", false);
|
|
1645
|
+
});
|
|
1646
|
+
};
|
|
1647
|
+
|
|
1648
|
+
ExpressionAdvanced.prototype._setExpressionErrorStyle = function() {
|
|
1649
|
+
var errorMsg = this.getProperty("valueStateText");
|
|
1650
|
+
if (errorMsg !== "" && errorMsg !== undefined && this.codeMirror) {
|
|
1651
|
+
jQuery(this.codeMirror.getWrapperElement()).addClass('CodeMirror-error');
|
|
1652
|
+
jQuery(this.codeMirror.getWrapperElement()).addClass('sapMInputBaseStateInner sapMInputBaseErrorInner sapMInputBaseContentWrapper sapMInputBaseContentWrapperState sapMInputBaseContentWrapperError');
|
|
1653
|
+
jQuery('#' + this.oTextArea.getId()).addClass('sapMInputBaseError');
|
|
1654
|
+
|
|
1655
|
+
// Position the cursor within the control
|
|
1656
|
+
var cursorPos;
|
|
1657
|
+
if (this.errorCursorPosition < 0) {
|
|
1658
|
+
var lastLine = this.codeMirror.getLine(this.codeMirror.lastLine());
|
|
1659
|
+
cursorPos = lastLine.length;
|
|
1660
|
+
//this.codeMirror.setCursor({line: lastLine, ch: cursorPos});
|
|
1661
|
+
jQuery(this.codeMirror.getWrapperElement()).addClass('CodeMirror-errorBackground');
|
|
1662
|
+
} else {
|
|
1663
|
+
var idx = errorMsg.lastIndexOf("'");
|
|
1664
|
+
if (idx > 0) {
|
|
1665
|
+
var offendingText = errorMsg.substring(0, idx);
|
|
1666
|
+
idx = offendingText.lastIndexOf("'");
|
|
1667
|
+
if (idx > 0) {
|
|
1668
|
+
offendingText = offendingText.substring(idx + 1);
|
|
1669
|
+
}
|
|
1670
|
+
var found = false;
|
|
1671
|
+
for (var lineNum = this.codeMirror.lastLine(); !found && lineNum >= 0; lineNum--) {
|
|
1672
|
+
var exp = this.codeMirror.getLine(lineNum);
|
|
1673
|
+
cursorPos = exp.lastIndexOf(offendingText);
|
|
1674
|
+
if (cursorPos >= 0) {
|
|
1675
|
+
found = true;
|
|
1676
|
+
this.codeMirror.setSelection({
|
|
1677
|
+
line: lineNum,
|
|
1678
|
+
ch: cursorPos
|
|
1679
|
+
}, {
|
|
1680
|
+
line: lineNum,
|
|
1681
|
+
ch: cursorPos + offendingText.length
|
|
1682
|
+
});
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
};
|
|
1689
|
+
|
|
1690
|
+
/* ExpressionAdvanced.prototype.createAliasFromTextMenu = function (e){
|
|
1691
|
+
|
|
1692
|
+
// build context menu
|
|
1693
|
+
this.oContextMenu = new sap.m.ActionSheet();
|
|
1694
|
+
|
|
1695
|
+
//Create the items and add them to the menu
|
|
1696
|
+
var oMenuItemSaveAsAlias = new Button({
|
|
1697
|
+
text: this.oBundle.getText("SAVE_AS_ALIAS")
|
|
1698
|
+
});
|
|
1699
|
+
oMenuItemSaveAsAlias.attachPress(function (){
|
|
1700
|
+
// concat text of all elements
|
|
1701
|
+
var text = this.getSelectedText();
|
|
1702
|
+
this.onCreateAliasLinkForText(text);
|
|
1703
|
+
});
|
|
1704
|
+
this.oContextMenu.addButton(oMenuItemSaveAsAlias);
|
|
1705
|
+
};*/
|
|
1706
|
+
|
|
1707
|
+
ExpressionAdvanced.prototype.getSelectedText = function() {
|
|
1708
|
+
return this.codeMirror.getSelection();
|
|
1709
|
+
};
|
|
1710
|
+
|
|
1711
|
+
/* ExpressionAdvanced.prototype.openAliasFromTextMenu = function (e){
|
|
1712
|
+
window.setTimeout(function (){
|
|
1713
|
+
if (this.codeMirror.getSelection() !== ""){
|
|
1714
|
+
if (!this.oContextMenu){
|
|
1715
|
+
this.createAliasFromTextMenu(e);
|
|
1716
|
+
}
|
|
1717
|
+
this.oContextMenu.openBy(jQuery('#' + this.getId() + " .CodeMirror .CodeMirror-selectedtext")[0]);
|
|
1718
|
+
} else if (this.oContextMenu && this.oContextMenu.isOpen()){
|
|
1719
|
+
this.oContextMenu.close();
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
}, 300);
|
|
1723
|
+
};*/
|
|
1724
|
+
ExpressionAdvanced.prototype.exit = function() {
|
|
1725
|
+
document.removeEventListener("mousedown", this.fnMouseDownListsner, true);
|
|
1726
|
+
};
|
|
1727
|
+
return ExpressionAdvanced;
|
|
1728
|
+
|
|
1729
|
+
}, /* bExport= */ true);
|