@sapui5/sap.rules.ui 1.106.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,838 +1,840 @@
|
|
|
1
|
-
sap.ui.define([
|
|
2
|
-
"sap/ui/thirdparty/jquery",
|
|
3
|
-
"../../library",
|
|
4
|
-
"sap/ui/core/Control",
|
|
5
|
-
"sap/m/List",
|
|
6
|
-
"sap/ui/model/json/JSONModel",
|
|
7
|
-
"sap/m/ListMode",
|
|
8
|
-
"sap/ui/core/CustomData",
|
|
9
|
-
"sap/ui/model/Sorter",
|
|
10
|
-
"sap/rules/ui/parser/infrastructure/util/utilsBase",
|
|
11
|
-
"sap/ui/core/LocaleData",
|
|
12
|
-
"sap/rules/ui/Constants",
|
|
13
|
-
"sap/m/DatePicker",
|
|
14
|
-
"sap/m/DateTimePicker",
|
|
15
|
-
"sap/m/TimePicker",
|
|
16
|
-
"sap/m/Dialog",
|
|
17
|
-
"sap/m/Button"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
this.
|
|
60
|
-
this.
|
|
61
|
-
this.
|
|
62
|
-
this.
|
|
63
|
-
this.
|
|
64
|
-
this.
|
|
65
|
-
this.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
this.
|
|
81
|
-
this.
|
|
82
|
-
this.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
this.
|
|
86
|
-
this.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
var
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
that.
|
|
123
|
-
that.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
oEvent
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
this.
|
|
145
|
-
this.
|
|
146
|
-
this.
|
|
147
|
-
|
|
148
|
-
fixedValuePanel.addContent(this.
|
|
149
|
-
fixedValuePanel.addContent(this.
|
|
150
|
-
fixedValuePanel.addContent(this.
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
var
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
valueHelpInfo.
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
valueHelpInfo.
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
valueHelpInfo.
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
this.
|
|
185
|
-
this.
|
|
186
|
-
this.
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
this.oValueHelpDialog.
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
var
|
|
202
|
-
var
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
var
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
oEvt.
|
|
230
|
-
|
|
231
|
-
that.
|
|
232
|
-
that.
|
|
233
|
-
that.
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
that.
|
|
240
|
-
that.
|
|
241
|
-
that.oValueHelpDialog.
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
that.
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
var
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
if
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
var
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
var
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
this.
|
|
436
|
-
this.
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
var
|
|
445
|
-
var
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
oTable.
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
oTable.
|
|
468
|
-
oTable.
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
var
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
oTable.
|
|
500
|
-
oTable.
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
var
|
|
510
|
-
var
|
|
511
|
-
|
|
512
|
-
new sap.ui.model.Filter("
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
var
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
aFilters
|
|
549
|
-
aFilters = that._formatMultiFilter(aFilters,
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
aFilters = that._formatMultiFilter(aFilters,
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
aFilters = that._formatMultiFilter(aFilters,
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
aFilters = that._formatMultiFilter(aFilters,
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
var
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
_valueField.
|
|
581
|
-
_valueField.
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
aFilters[0].aFilters[iterator]
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
_valueField.
|
|
591
|
-
_valueField.
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
_valueField.
|
|
595
|
-
_valueField.
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
var
|
|
606
|
-
var
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
_valueField.
|
|
618
|
-
_valueField.
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
aComputeFilterParma[iterator]
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
_valueField.
|
|
629
|
-
_valueField.
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
_valueField.
|
|
633
|
-
_valueField.
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
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
|
-
this._valueFieldValue.
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
this._valueFieldDescription.
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
var
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
oEvent.getSource().
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
that.
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
that.
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
var
|
|
723
|
-
var
|
|
724
|
-
var
|
|
725
|
-
var
|
|
726
|
-
var
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
oEvt.oSource.mProperties.
|
|
762
|
-
oEvt.oSource.mProperties.
|
|
763
|
-
|
|
764
|
-
that.
|
|
765
|
-
that.
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
that.
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
this.
|
|
778
|
-
this.
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
var
|
|
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
|
-
var
|
|
819
|
-
var
|
|
820
|
-
var
|
|
821
|
-
var
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
1
|
+
sap.ui.define([
|
|
2
|
+
"sap/ui/thirdparty/jquery",
|
|
3
|
+
"../../library",
|
|
4
|
+
"sap/ui/core/Control",
|
|
5
|
+
"sap/m/List",
|
|
6
|
+
"sap/ui/model/json/JSONModel",
|
|
7
|
+
"sap/m/ListMode",
|
|
8
|
+
"sap/ui/core/CustomData",
|
|
9
|
+
"sap/ui/model/Sorter",
|
|
10
|
+
"sap/rules/ui/parser/infrastructure/util/utilsBase",
|
|
11
|
+
"sap/ui/core/LocaleData",
|
|
12
|
+
"sap/rules/ui/Constants",
|
|
13
|
+
"sap/m/DatePicker",
|
|
14
|
+
"sap/m/DateTimePicker",
|
|
15
|
+
"sap/m/TimePicker",
|
|
16
|
+
"sap/m/Dialog",
|
|
17
|
+
"sap/m/Button",
|
|
18
|
+
"./AutoSuggestionFixedValuePanelRenderer"
|
|
19
|
+
], function (jQuery, library, Control, List, JSONModel, ListMode, CustomData, Sorter, infraUtils,
|
|
20
|
+
LocaleData, Constants, DatePicker , DateTimePicker , TimePicker, Dialog, Button, AutoSuggestionFixedValuePanelRenderer) {
|
|
21
|
+
"use strict";
|
|
22
|
+
|
|
23
|
+
var autoSuggestionFixedValuePanel = Control.extend("sap.rules.ui.ast.autoCompleteContent.AutoSuggestionFixedValuePanel", {
|
|
24
|
+
metadata: {
|
|
25
|
+
library: "sap.rules.ui",
|
|
26
|
+
properties: {
|
|
27
|
+
reference: {
|
|
28
|
+
type: "object",
|
|
29
|
+
defaultValue: null,
|
|
30
|
+
},
|
|
31
|
+
vocabularyInfo: {
|
|
32
|
+
type: "object",
|
|
33
|
+
defaultValue: null
|
|
34
|
+
},
|
|
35
|
+
data: {
|
|
36
|
+
type: "object",
|
|
37
|
+
defaultValue: null
|
|
38
|
+
},
|
|
39
|
+
dialogOpenedCallbackReference: {
|
|
40
|
+
type: "object",
|
|
41
|
+
defaultValue: null,
|
|
42
|
+
},
|
|
43
|
+
inputValue: {
|
|
44
|
+
type: "string",
|
|
45
|
+
defaultValue: ""
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
},
|
|
49
|
+
aggregations: {
|
|
50
|
+
PanelLayout: {
|
|
51
|
+
type: "sap.m.Panel",
|
|
52
|
+
multiple: false
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
events: {}
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
init: function () {
|
|
59
|
+
this.infraUtils = new sap.rules.ui.parser.infrastructure.util.utilsBase.utilsBaseLib();
|
|
60
|
+
this.needCreateLayout = true;
|
|
61
|
+
this.businessDataType = "S";
|
|
62
|
+
this._propertyValue = "Value";
|
|
63
|
+
this._propertyDescription = "Description";
|
|
64
|
+
this.oBundle = sap.ui.getCore().getLibraryResourceBundle("sap.rules.ui.i18n");
|
|
65
|
+
this.vocabularyInfo = this.getVocabularyInfo();
|
|
66
|
+
this.autoSuggestionData = this.getData();
|
|
67
|
+
|
|
68
|
+
// Date instance which is used to convert the selected date from calendar control to short format
|
|
69
|
+
var oLocale = sap.ui.getCore().getConfiguration().getFormatSettings().getFormatLocale();
|
|
70
|
+
var oLocaleData = LocaleData.getInstance(oLocale);
|
|
71
|
+
|
|
72
|
+
this.oFormatDate = sap.ui.core.format.DateFormat.getInstance({
|
|
73
|
+
pattern: oLocaleData.getDatePattern('short'),
|
|
74
|
+
calendarType: sap.ui.core.CalendarType.Gregorian
|
|
75
|
+
},
|
|
76
|
+
oLocale
|
|
77
|
+
);
|
|
78
|
+
},
|
|
79
|
+
onBeforeRendering: function () {
|
|
80
|
+
this._reference = this.getReference();
|
|
81
|
+
this._dialogOpenedCallbackReference = this.getDialogOpenedCallbackReference();
|
|
82
|
+
this.vocabularyInfo = this.getVocabularyInfo();
|
|
83
|
+
this.valueHelpData = this.getData();
|
|
84
|
+
if (this.needCreateLayout) {
|
|
85
|
+
var layout = this._createLayout(this.vocabularyInfo);
|
|
86
|
+
this.setAggregation("PanelLayout", layout, true);
|
|
87
|
+
this.needCreateLayout = false;
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
onAfterRendering: function () {
|
|
92
|
+
var sId = "#" + this.fixedValueTextArea.getId();
|
|
93
|
+
$(sId).on('keydown', function (event) {
|
|
94
|
+
if (event.key == 'Enter') {
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
initializeVariables: function () {
|
|
101
|
+
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
_createLayout: function (vocabularyInfo) {
|
|
105
|
+
var that = this;
|
|
106
|
+
var hasValueSource = false;
|
|
107
|
+
if (this.getData().valuehelp) {
|
|
108
|
+
hasValueSource = true;
|
|
109
|
+
} else {
|
|
110
|
+
hasValueSource = false;
|
|
111
|
+
}
|
|
112
|
+
//The invisible text is introduced to identify the input field by screen reader.
|
|
113
|
+
this._invisibleText = new sap.ui.core.InvisibleText({
|
|
114
|
+
text:this.oBundle.getText("fixedValueInvisibleText")
|
|
115
|
+
});
|
|
116
|
+
this.fixedValueTextArea = new sap.m.Input({
|
|
117
|
+
showValueHelp: hasValueSource,
|
|
118
|
+
showSuggestion: true,
|
|
119
|
+
autocomplete: false,
|
|
120
|
+
ariaLabelledBy: this._invisibleText.getId(),
|
|
121
|
+
valueHelpRequest: function () {
|
|
122
|
+
that._dialogOpenedCallbackReference(true);
|
|
123
|
+
that._setModal(true);
|
|
124
|
+
that._generateValueHelpInfoAndCreateDialog(vocabularyInfo)
|
|
125
|
+
},
|
|
126
|
+
value: this.getInputValue(),
|
|
127
|
+
change: function (event) {
|
|
128
|
+
that._setModal(false);
|
|
129
|
+
var oEvent = that._formatText(event);
|
|
130
|
+
oEvent.oSource.mProperties.forceFireChange = true;
|
|
131
|
+
that._reference(oEvent);
|
|
132
|
+
}.bind(this),
|
|
133
|
+
width: "auto"
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
var fixedValuePanel = new sap.m.Panel({
|
|
137
|
+
headerText: this.oBundle.getText("fixedValuePanelTitle"),
|
|
138
|
+
expandable: true,
|
|
139
|
+
expanded: false,
|
|
140
|
+
content: [this._invisibleText, this.fixedValueTextArea],
|
|
141
|
+
width: "auto"
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
this.toolBarSpacerAfterInput = new sap.m.ToolbarSpacer({width: "1em"});
|
|
145
|
+
this.toolBarSpacerAfterDateLink = new sap.m.ToolbarSpacer({width: "1em"});
|
|
146
|
+
this.dateContent = this._createDateLink();
|
|
147
|
+
this.timeContent = this._createTimeStampLink();
|
|
148
|
+
fixedValuePanel.addContent(this.toolBarSpacerAfterInput);
|
|
149
|
+
fixedValuePanel.addContent(this.dateContent);
|
|
150
|
+
fixedValuePanel.addContent(this.toolBarSpacerAfterDateLink);
|
|
151
|
+
fixedValuePanel.addContent(this.timeContent);
|
|
152
|
+
|
|
153
|
+
return fixedValuePanel;
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
_setModal: function (value) {
|
|
157
|
+
var pop = sap.ui.getCore().byId("popover");
|
|
158
|
+
if (pop) {
|
|
159
|
+
pop.setModal(value);
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
/* ------------------ Value Help related functions ---------------------------*/
|
|
164
|
+
_generateValueHelpInfoAndCreateDialog: function (vocabularyInfo) {
|
|
165
|
+
var that = this;
|
|
166
|
+
var valueHelpInfo = this.getData().valuehelp;
|
|
167
|
+
if (valueHelpInfo) {
|
|
168
|
+
valueHelpInfo.expressionLanguage = vocabularyInfo;
|
|
169
|
+
valueHelpInfo.HasValueSource = true;
|
|
170
|
+
if (valueHelpInfo.sourceType === "U") {
|
|
171
|
+
valueHelpInfo.entitySet = "Enumerations";
|
|
172
|
+
valueHelpInfo.serviceURL = "/Enumerations";
|
|
173
|
+
} else {
|
|
174
|
+
valueHelpInfo.entitySet = "ExternalValues";
|
|
175
|
+
valueHelpInfo.serviceURL = "/ExternalValues";
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
var basePath = vocabularyInfo.getModel().sServiceUrl;
|
|
179
|
+
that._createDialog(basePath, valueHelpInfo);
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
|
|
183
|
+
_createDialog: function (basePath, valueHelpInfo, businessDataType) {
|
|
184
|
+
this._createValueHelpDialog(basePath, valueHelpInfo);
|
|
185
|
+
this._createSmartFilterBar(basePath, valueHelpInfo);
|
|
186
|
+
this.oValueHelpDialog.setFilterBar(this.oFilterBar);
|
|
187
|
+
this._openValueHelpDialog();
|
|
188
|
+
|
|
189
|
+
},
|
|
190
|
+
|
|
191
|
+
_openValueHelpDialog: function () {
|
|
192
|
+
this.oValueHelpDialog.open();
|
|
193
|
+
this.oValueHelpDialog.getTable().setBusy(true);
|
|
194
|
+
},
|
|
195
|
+
|
|
196
|
+
/*
|
|
197
|
+
* Creates the Value Help Dialog.
|
|
198
|
+
*/
|
|
199
|
+
|
|
200
|
+
_createValueHelpDialog: function (basePath, valueHelpInfo) {
|
|
201
|
+
var that = this;
|
|
202
|
+
var expressionData = valueHelpInfo.expressionLanguage.getModel();
|
|
203
|
+
var attributePath = "Attributes(Id='" + valueHelpInfo.attributeId + "',VocabularyId='" + valueHelpInfo.vocabularyId +
|
|
204
|
+
"',DataObjectId='" + valueHelpInfo.dataObjectId + "')";
|
|
205
|
+
if(attributePath.includes(":")) {
|
|
206
|
+
attributePath = attributePath = attributePath.replace(":","%3A");
|
|
207
|
+
}
|
|
208
|
+
this.attributeName = valueHelpInfo.attributeName;
|
|
209
|
+
if(!expressionData.oData[attributePath]){
|
|
210
|
+
valueHelpInfo.dataObjectId = this._getStructureObjectForTableType(valueHelpInfo.attributeId, valueHelpInfo);
|
|
211
|
+
}
|
|
212
|
+
sap.ui.core.BusyIndicator.show(0);
|
|
213
|
+
this.oValueHelpDialog = new sap.ui.comp.valuehelpdialog.ValueHelpDialog({
|
|
214
|
+
supportMultiselect: false,
|
|
215
|
+
supportRanges: false,
|
|
216
|
+
horizontalScrolling: false,
|
|
217
|
+
title: that.attributeName,
|
|
218
|
+
resizable: false,
|
|
219
|
+
beforeOpen: function () {
|
|
220
|
+
that._bindTable(basePath, valueHelpInfo);
|
|
221
|
+
},
|
|
222
|
+
ok: function (oEvt) {
|
|
223
|
+
var oSelRow = oEvt.getParameter("tokens")[0].data("row");
|
|
224
|
+
var value = oSelRow.Value;
|
|
225
|
+
if (that.businessDataType === "D" || that.businessDataType === "U") {
|
|
226
|
+
value = that._getValidValue(value);
|
|
227
|
+
}
|
|
228
|
+
var updatedToken = this._syncToken(value, that.businessDataType);
|
|
229
|
+
oEvt.getParameter("tokens")[0].data("row").Value = updatedToken;
|
|
230
|
+
oEvt.oSource.mProperties.forceFireChange = true;
|
|
231
|
+
that._dialogOpenedCallbackReference(false);
|
|
232
|
+
that.oValueHelpDialog.close();
|
|
233
|
+
that._setModal(false);
|
|
234
|
+
that.oValueHelpDialog.destroy();
|
|
235
|
+
sap.ui.core.BusyIndicator.hide();
|
|
236
|
+
that._reference(oEvt);
|
|
237
|
+
}.bind(this),
|
|
238
|
+
cancel: function () {
|
|
239
|
+
that.oFilterBar.destroy();
|
|
240
|
+
that._setModal(false);
|
|
241
|
+
that.oValueHelpDialog.close();
|
|
242
|
+
that.oValueHelpDialog.destroy();
|
|
243
|
+
sap.ui.core.BusyIndicator.hide();
|
|
244
|
+
},
|
|
245
|
+
afterClose: function () {
|
|
246
|
+
that._dialogOpenedCallbackReference(false);
|
|
247
|
+
that.oFilterBar.destroy();
|
|
248
|
+
sap.ui.core.BusyIndicator.hide();
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
},
|
|
252
|
+
|
|
253
|
+
_getStructureObjectForTableType: function(attributeId, valueHelpInfo){
|
|
254
|
+
var valueSources = valueHelpInfo.expressionLanguage.getData().ValueSources;
|
|
255
|
+
for(var entry in valueSources){
|
|
256
|
+
if(attributeId === valueSources[entry].AttributeId){
|
|
257
|
+
return valueSources[entry].DataObjectId;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return valueHelpInfo.dataObjectId;
|
|
261
|
+
},
|
|
262
|
+
|
|
263
|
+
_syncToken: function (textEntered, businessDataType) {
|
|
264
|
+
var addStartQuote = false;
|
|
265
|
+
var addEndQuote = false;
|
|
266
|
+
businessDataType = this.getData().valuehelp.attributeDataType;
|
|
267
|
+
//truncate single and double quotes if the user has entered it
|
|
268
|
+
if (businessDataType != "G") {
|
|
269
|
+
var newValue = textEntered.replace(/'/g, "").replace(/"/g, "");
|
|
270
|
+
} else {
|
|
271
|
+
newValue = "'" + textEntered + "'";
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
//Handling for passing number when no context is available
|
|
275
|
+
if (businessDataType === "N") {
|
|
276
|
+
var newIntValue = parseFloat(newValue);
|
|
277
|
+
var stringFormOfIntValue = newIntValue.toString();
|
|
278
|
+
// Some text is truncated by parse int
|
|
279
|
+
if (stringFormOfIntValue != newValue) {
|
|
280
|
+
businessDataType = "Operations"
|
|
281
|
+
} else if (stringFormOfIntValue === "NaN") {
|
|
282
|
+
businessDataType = "S"
|
|
283
|
+
} else {
|
|
284
|
+
newValue = newIntValue;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
if (businessDataType === "S" || businessDataType === "D" || businessDataType === "U") {
|
|
290
|
+
if (!(businessDataType === "S")) {
|
|
291
|
+
if (businessDataType === "D") {
|
|
292
|
+
this._dateBusinessDataType = "D";
|
|
293
|
+
} else if (businessDataType === "U") {
|
|
294
|
+
this._dateBusinessDataType = "U";
|
|
295
|
+
}
|
|
296
|
+
newValue = this._getValidDateValue(newValue);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
newValue = newValue.toString();
|
|
300
|
+
if (newValue === "'") {
|
|
301
|
+
addStartQuote = true;
|
|
302
|
+
} // add only quote for this special case
|
|
303
|
+
if (newValue.substr(0, "'") !== "'") {
|
|
304
|
+
addStartQuote = true;
|
|
305
|
+
}
|
|
306
|
+
if (newValue.substr(newValue.length - 1, "'") !== "'") {
|
|
307
|
+
addEndQuote = true;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
if (addStartQuote) {
|
|
311
|
+
newValue = "'" + newValue;
|
|
312
|
+
}
|
|
313
|
+
if (addEndQuote) {
|
|
314
|
+
newValue = newValue + "'";
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
if (businessDataType === "B") {
|
|
320
|
+
newValue = (newValue === "true");
|
|
321
|
+
}
|
|
322
|
+
return newValue;
|
|
323
|
+
},
|
|
324
|
+
|
|
325
|
+
_getValidDateValue: function (sValue) {
|
|
326
|
+
var date, formatter;
|
|
327
|
+
var sDateFormatted = "";
|
|
328
|
+
var formatterParsing = this._getDateTimeFormatterForParsing();
|
|
329
|
+
if (formatterParsing) {
|
|
330
|
+
date = formatterParsing.parse(sValue);
|
|
331
|
+
}
|
|
332
|
+
if (this._dateBusinessDataType === "D") {
|
|
333
|
+
formatter = sap.ui.core.format.DateFormat.getDateInstance({
|
|
334
|
+
pattern: "yyyy-MM-dd"
|
|
335
|
+
});
|
|
336
|
+
sDateFormatted = formatter.format(date);
|
|
337
|
+
} else if (this._dateBusinessDataType === "U") {
|
|
338
|
+
formatter = sap.ui.core.format.DateFormat.getDateTimeInstance({
|
|
339
|
+
pattern: "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
|
|
340
|
+
});
|
|
341
|
+
sDateFormatted = formatter.format(date);
|
|
342
|
+
}
|
|
343
|
+
if (sDateFormatted !== "") {
|
|
344
|
+
sDateFormatted;
|
|
345
|
+
}
|
|
346
|
+
return sValue;
|
|
347
|
+
},
|
|
348
|
+
|
|
349
|
+
/*
|
|
350
|
+
* Creates the necessary control os SmartFilterBar for the ValueHelp Dialog.
|
|
351
|
+
*/
|
|
352
|
+
_createSmartFilterBar: function (basePath, valueHelpInfo) {
|
|
353
|
+
var that = this;
|
|
354
|
+
this.oFilterBar = new sap.ui.comp.smartfilterbar.SmartFilterBar({
|
|
355
|
+
entitySet: valueHelpInfo.entitySet,
|
|
356
|
+
enableBasicSearch: true,
|
|
357
|
+
advancedMode: true,
|
|
358
|
+
filterBarExpanded: true,
|
|
359
|
+
search: function () {
|
|
360
|
+
that.onSearch(basePath, valueHelpInfo);
|
|
361
|
+
|
|
362
|
+
},
|
|
363
|
+
filterChange: function (oEvent) {
|
|
364
|
+
that.setValueStateFilter(oEvent);
|
|
365
|
+
},
|
|
366
|
+
controlConfiguration: [that._createControlConfiguration()]
|
|
367
|
+
});
|
|
368
|
+
var oModel = new sap.ui.model.odata.v2.ODataModel(basePath);
|
|
369
|
+
this.oFilterBar.setModel(oModel);
|
|
370
|
+
},
|
|
371
|
+
|
|
372
|
+
/*
|
|
373
|
+
* Creating the Control Configuration for the smartFilter of the valueHelp Dialog.
|
|
374
|
+
*/
|
|
375
|
+
_createControlConfiguration: function () {
|
|
376
|
+
var aControlConfiguration = [new sap.ui.comp.smartfilterbar.ControlConfiguration({
|
|
377
|
+
hasValueHelpDialog: true,
|
|
378
|
+
key: "Value",
|
|
379
|
+
label: this.oBundle.getText("value"),
|
|
380
|
+
visibleInAdvancedArea: true,
|
|
381
|
+
width: "100px",
|
|
382
|
+
index: 1
|
|
383
|
+
|
|
384
|
+
}), new sap.ui.comp.smartfilterbar.ControlConfiguration({
|
|
385
|
+
hasValueHelpDialog: true,
|
|
386
|
+
key: "Description",
|
|
387
|
+
label: this.oBundle.getText("description"),
|
|
388
|
+
visibleInAdvancedArea: true,
|
|
389
|
+
width: "100px",
|
|
390
|
+
index: 2
|
|
391
|
+
|
|
392
|
+
}), new sap.ui.comp.smartfilterbar.ControlConfiguration({
|
|
393
|
+
hasValueHelpDialog: true,
|
|
394
|
+
key: "VocabularyId",
|
|
395
|
+
label: "VocabularyId",
|
|
396
|
+
width: "100px",
|
|
397
|
+
visible: false,
|
|
398
|
+
index: 3
|
|
399
|
+
|
|
400
|
+
}), new sap.ui.comp.smartfilterbar.ControlConfiguration({
|
|
401
|
+
hasValueHelpDialog: true,
|
|
402
|
+
key: "DataObjectId",
|
|
403
|
+
label: "DataObjectId",
|
|
404
|
+
visible: false,
|
|
405
|
+
width: "100px",
|
|
406
|
+
groupId: "abc",
|
|
407
|
+
index: 4
|
|
408
|
+
|
|
409
|
+
}), new sap.ui.comp.smartfilterbar.ControlConfiguration({
|
|
410
|
+
hasValueHelpDialog: true,
|
|
411
|
+
key: "AttributeId",
|
|
412
|
+
label: "AttributeId",
|
|
413
|
+
visible: false,
|
|
414
|
+
width: "100px",
|
|
415
|
+
index: 5
|
|
416
|
+
|
|
417
|
+
}),
|
|
418
|
+
new sap.ui.comp.smartfilterbar.ControlConfiguration({
|
|
419
|
+
hasValueHelpDialog: true,
|
|
420
|
+
key: "Version",
|
|
421
|
+
label: "Version",
|
|
422
|
+
visible: false,
|
|
423
|
+
width: "100px",
|
|
424
|
+
index: 6
|
|
425
|
+
|
|
426
|
+
})
|
|
427
|
+
];
|
|
428
|
+
return aControlConfiguration;
|
|
429
|
+
},
|
|
430
|
+
|
|
431
|
+
/*
|
|
432
|
+
* Called when the search is triggered in SmartFilter.
|
|
433
|
+
*/
|
|
434
|
+
onSearch: function (basePath, valueHelpInfo) {
|
|
435
|
+
this.oValueHelpDialog.getTable().setBusy(true);
|
|
436
|
+
this._unBindTable();
|
|
437
|
+
this._bindTable(basePath, valueHelpInfo);
|
|
438
|
+
},
|
|
439
|
+
|
|
440
|
+
/*
|
|
441
|
+
* Binds the table taking current filters parameters into account.
|
|
442
|
+
*/
|
|
443
|
+
_bindTable: function (basePath, valueHelpInfo) {
|
|
444
|
+
var serviceUrl = valueHelpInfo.serviceURL;
|
|
445
|
+
var aFilterParams = this._fetchFilterParams(valueHelpInfo);
|
|
446
|
+
var mEntities = {
|
|
447
|
+
valueHelp: {
|
|
448
|
+
collection: serviceUrl,
|
|
449
|
+
properties: [this._propertyValue, this._propertyDescription]
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
var oTable = this.oValueHelpDialog.getTable();
|
|
454
|
+
oTable.setThreshold(10);
|
|
455
|
+
|
|
456
|
+
for (var i = 0; i < mEntities.valueHelp.properties.length; i++) {
|
|
457
|
+
var sColumnName = "";
|
|
458
|
+
if (mEntities.valueHelp.properties[i] === "Value") {
|
|
459
|
+
sColumnName = this.oBundle.getText("value");
|
|
460
|
+
} else if(mEntities.valueHelp.properties[i] === "Description") {
|
|
461
|
+
sColumnName = this.oBundle.getText("description");
|
|
462
|
+
}
|
|
463
|
+
this._addValueHelpColumn(mEntities.valueHelp.properties[i], oTable, sColumnName);
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
var oModel = new sap.ui.model.odata.v2.ODataModel(basePath);
|
|
467
|
+
oTable.setModel(oModel);
|
|
468
|
+
oTable.bindRows(mEntities.valueHelp.collection, null, aFilterParams);
|
|
469
|
+
oTable.getBinding("rows").attachDataReceived(this._handleRowsDataReceived, this);
|
|
470
|
+
},
|
|
471
|
+
|
|
472
|
+
//handles the Busy State of the busy state for the data recieved.
|
|
473
|
+
_handleRowsDataReceived: function (oEvent) {
|
|
474
|
+
var that = this;
|
|
475
|
+
var data = oEvent.getParameter("data");
|
|
476
|
+
if (jQuery.isEmptyObject(data) || (data && data.results && data.results.length === 0)) {
|
|
477
|
+
this.oValueHelpDialog.getTable().setNoData(that.oBundle.getText("no_data"));
|
|
478
|
+
} else {
|
|
479
|
+
this.oValueHelpDialog.getTable().setNoData(that.oBundle.getText("searching"));
|
|
480
|
+
}
|
|
481
|
+
this.oValueHelpDialog.getTable().setBusy(false);
|
|
482
|
+
},
|
|
483
|
+
|
|
484
|
+
// Utility function to create columns for the table.
|
|
485
|
+
_addValueHelpColumn: function (oColumName, oTable, sColumnName) {
|
|
486
|
+
var oColumn = new sap.ui.table.Column().setLabel(new sap.m.Label({
|
|
487
|
+
text: sColumnName
|
|
488
|
+
}));
|
|
489
|
+
if (oColumName === this._propertyValue) {
|
|
490
|
+
oColumn.setSortProperty(sColumnName);
|
|
491
|
+
}
|
|
492
|
+
oTable.addColumn(oColumn.setTemplate(new sap.m.Text().bindProperty("text", oColumName)));
|
|
493
|
+
},
|
|
494
|
+
|
|
495
|
+
/*
|
|
496
|
+
* unBind the table Rows.
|
|
497
|
+
*/
|
|
498
|
+
_unBindTable: function () {
|
|
499
|
+
var oTable = this.oValueHelpDialog.getTable();
|
|
500
|
+
oTable.destroyColumns();
|
|
501
|
+
oTable.unbindRows();
|
|
502
|
+
|
|
503
|
+
},
|
|
504
|
+
|
|
505
|
+
/*
|
|
506
|
+
* fetch the latest filter parmas depending on the filter or the search param set.
|
|
507
|
+
*/
|
|
508
|
+
_fetchFilterParams: function (valueHelpInfo) {
|
|
509
|
+
var that = this;
|
|
510
|
+
var aSearchParams = [];
|
|
511
|
+
var aFilterParams = [new sap.ui.model.Filter("AttributeId", sap.ui.model.FilterOperator.EQ, valueHelpInfo.attributeId),
|
|
512
|
+
new sap.ui.model.Filter("DataObjectId", sap.ui.model.FilterOperator.EQ, valueHelpInfo.dataObjectId),
|
|
513
|
+
new sap.ui.model.Filter("VocabularyId", sap.ui.model.FilterOperator.EQ, valueHelpInfo.vocabularyId)
|
|
514
|
+
];
|
|
515
|
+
|
|
516
|
+
var aFilters = this.oFilterBar.getFilters();
|
|
517
|
+
var searchParam = this.oFilterBar.getParameters();
|
|
518
|
+
//When both search and filter is selected
|
|
519
|
+
if (!jQuery.isEmptyObject(searchParam) && aFilters && aFilters.length > 0) {
|
|
520
|
+
searchParam = this.oFilterBar.getParameters().custom.search;
|
|
521
|
+
aSearchParams = this._getSearchFilters(searchParam);
|
|
522
|
+
aFilters = that._formatFilterParams(aFilters, valueHelpInfo.sourceType);
|
|
523
|
+
aFilterParams.push(new sap.ui.model.Filter({
|
|
524
|
+
filters: [new sap.ui.model.Filter(aFilters), new sap.ui.model.Filter(aSearchParams)],
|
|
525
|
+
and: true
|
|
526
|
+
}));
|
|
527
|
+
} else if (!jQuery.isEmptyObject(searchParam)) {
|
|
528
|
+
//when only Search is selected.
|
|
529
|
+
searchParam = this.oFilterBar.getParameters().custom.search;
|
|
530
|
+
aSearchParams = this._getSearchFilters(searchParam);
|
|
531
|
+
aFilterParams.push(aSearchParams);
|
|
532
|
+
} else if (aFilters && aFilters.length > 0) {
|
|
533
|
+
//When only filters is selected.
|
|
534
|
+
aFilters = that._formatFilterParams(aFilters, valueHelpInfo.sourceType);
|
|
535
|
+
aFilterParams.push(aFilters[0]);
|
|
536
|
+
}
|
|
537
|
+
return aFilterParams;
|
|
538
|
+
},
|
|
539
|
+
|
|
540
|
+
/*
|
|
541
|
+
* format the filterParams to support Contains and Between.
|
|
542
|
+
*/
|
|
543
|
+
_formatFilterParams: function (aFilters, valuehelpSourceType) {
|
|
544
|
+
var that = this;
|
|
545
|
+
if (aFilters[0] && aFilters.length === 1 && aFilters[0].aFilters[0] && aFilters[0].aFilters[0].sOperator) {
|
|
546
|
+
aFilters = that._formatSingleFilter(aFilters, valuehelpSourceType);
|
|
547
|
+
} else if (aFilters[0] && aFilters[0].aFilters[0] && aFilters[0].aFilters[0].aFilters[0] && aFilters[0].aFilters[0].aFilters[0].aFilters &&
|
|
548
|
+
aFilters[0].aFilters[1].aFilters[0].aFilters) {
|
|
549
|
+
aFilters = that._formatMultiFilter(aFilters, 0, true, valuehelpSourceType);
|
|
550
|
+
aFilters = that._formatMultiFilter(aFilters, 1, true, valuehelpSourceType);
|
|
551
|
+
|
|
552
|
+
} else if (aFilters[0] && aFilters[0].aFilters[0] && aFilters[0].aFilters[1] && aFilters[0].aFilters[0].aFilters[0] && aFilters[0].aFilters[
|
|
553
|
+
0].aFilters[0].aFilters && aFilters[0].aFilters[1].aFilters) {
|
|
554
|
+
aFilters = that._formatMultiFilter(aFilters, 0, true, valuehelpSourceType);
|
|
555
|
+
aFilters = that._formatMultiFilter(aFilters, 1, false, valuehelpSourceType);
|
|
556
|
+
|
|
557
|
+
} else if (aFilters[0] && aFilters[0].aFilters[0] && aFilters[0].aFilters[1] && aFilters[0].aFilters[1].aFilters[0] && aFilters[0].aFilters[
|
|
558
|
+
0].aFilters && aFilters[0].aFilters[1].aFilters[0].aFilters) {
|
|
559
|
+
aFilters = that._formatMultiFilter(aFilters, 0, false, valuehelpSourceType);
|
|
560
|
+
aFilters = that._formatMultiFilter(aFilters, 1, true, valuehelpSourceType);
|
|
561
|
+
|
|
562
|
+
} else if (aFilters[0] && aFilters[0].aFilters[0] && aFilters[0].aFilters[1] && aFilters[0].aFilters[0].aFilters && aFilters[0].aFilters[
|
|
563
|
+
1].aFilters) {
|
|
564
|
+
aFilters = that._formatMultiFilter(aFilters, 0, false, valuehelpSourceType);
|
|
565
|
+
aFilters = that._formatMultiFilter(aFilters, 1, false, valuehelpSourceType);
|
|
566
|
+
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
return aFilters;
|
|
570
|
+
},
|
|
571
|
+
|
|
572
|
+
_formatSingleFilter: function (aFilters, valuehelpSourceType) {
|
|
573
|
+
var that = this;
|
|
574
|
+
var _valueField = null;
|
|
575
|
+
|
|
576
|
+
for (var iterator = 0; iterator < aFilters[0].aFilters.length; iterator++) {
|
|
577
|
+
if (aFilters[0].aFilters[iterator].sOperator === "Contains" && valuehelpSourceType === "U") {
|
|
578
|
+
aFilters[0].aFilters[iterator].sOperator = "EQ";
|
|
579
|
+
} else if (aFilters[0].aFilters[iterator].sOperator === "Contains") {
|
|
580
|
+
_valueField = (aFilters[0].aFilters[iterator].sPath === this._propertyValue) ? this._valueFieldValue : this._valueFieldDescription;
|
|
581
|
+
_valueField.setValueState("Error");
|
|
582
|
+
_valueField.setValueStateText(aFilters[0].aFilters[iterator].sOperator + " operator not supported");
|
|
583
|
+
} else if (aFilters[0].aFilters[iterator].sOperator === "BT") {
|
|
584
|
+
|
|
585
|
+
var convertedFilterParam = that._manageParam(aFilters[0].aFilters[iterator].sPath, aFilters[0].aFilters[iterator].sOperator,
|
|
586
|
+
aFilters[0].aFilters[iterator].oValue1, aFilters[0].aFilters[iterator].oValue2);
|
|
587
|
+
delete aFilters[0].aFilters[iterator];
|
|
588
|
+
aFilters[0].aFilters[iterator] = convertedFilterParam;
|
|
589
|
+
} else if (aFilters[0].aFilters[iterator].sOperator === "StartsWith") {
|
|
590
|
+
_valueField = (aFilters[0].aFilters[iterator].sPath === this._propertyValue) ? this._valueFieldValue : this._valueFieldDescription;
|
|
591
|
+
_valueField.setValueState("Error");
|
|
592
|
+
_valueField.setValueStateText(aFilters[0].aFilters[iterator].sOperator + " operator not supported");
|
|
593
|
+
} else if (aFilters[0].aFilters[iterator].sOperator === "EndsWith") {
|
|
594
|
+
_valueField = (aFilters[0].aFilters[iterator].sPath === this._propertyValue) ? this._valueFieldValue : this._valueFieldDescription;
|
|
595
|
+
_valueField.setValueState("Error");
|
|
596
|
+
_valueField.setValueStateText(aFilters[0].aFilters[iterator].sOperator + " operator not supported");
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
}
|
|
600
|
+
return aFilters;
|
|
601
|
+
|
|
602
|
+
},
|
|
603
|
+
|
|
604
|
+
_formatMultiFilter: function (aFilters, index, bMultifilter, valuehelpSourceType) {
|
|
605
|
+
var that = this;
|
|
606
|
+
var _valueField = null;
|
|
607
|
+
var aComputeFilterParma = [];
|
|
608
|
+
if (bMultifilter) {
|
|
609
|
+
aComputeFilterParma = aFilters[0].aFilters[index].aFilters[0].aFilters;
|
|
610
|
+
} else {
|
|
611
|
+
aComputeFilterParma = aFilters[0].aFilters[index].aFilters;
|
|
612
|
+
}
|
|
613
|
+
for (var iterator = 0; iterator < aComputeFilterParma.length; iterator++) {
|
|
614
|
+
if (aComputeFilterParma[iterator].sOperator === "Contains" && valuehelpSourceType === "U") {
|
|
615
|
+
aComputeFilterParma[iterator].sOperator = "EQ";
|
|
616
|
+
} else if (aComputeFilterParma[iterator].sOperator === "Contains") {
|
|
617
|
+
_valueField = (aComputeFilterParma[iterator].sPath === this._propertyValue) ? this._valueFieldValue : this._valueFieldDescription;
|
|
618
|
+
_valueField.setValueState("Error");
|
|
619
|
+
_valueField.setValueStateText(aComputeFilterParma[iterator].sOperator + " operator not supported");
|
|
620
|
+
} else if (aComputeFilterParma[iterator].sOperator === "BT") {
|
|
621
|
+
|
|
622
|
+
var convertedFilterParam = that._manageParam(aComputeFilterParma[iterator].sPath, aComputeFilterParma[iterator].sOperator,
|
|
623
|
+
aComputeFilterParma[iterator].oValue1, aComputeFilterParma[iterator].oValue2);
|
|
624
|
+
delete aComputeFilterParma[iterator];
|
|
625
|
+
aComputeFilterParma[iterator] = convertedFilterParam;
|
|
626
|
+
|
|
627
|
+
} else if (aComputeFilterParma[iterator].sOperator === "StartsWith") {
|
|
628
|
+
_valueField = (aComputeFilterParma[iterator].sPath === this._propertyValue) ? this._valueFieldValue : this._valueFieldDescription;
|
|
629
|
+
_valueField.setValueState("Error");
|
|
630
|
+
_valueField.setValueStateText(aComputeFilterParma[iterator].sOperator + " operator not supported");
|
|
631
|
+
} else if (aComputeFilterParma[iterator].sOperator === "EndsWith") {
|
|
632
|
+
_valueField = (aComputeFilterParma[iterator].sPath === this._propertyValue) ? this._valueFieldValue : this._valueFieldDescription;
|
|
633
|
+
_valueField.setValueState("Error");
|
|
634
|
+
_valueField.setValueStateText(aComputeFilterParma[iterator].sOperator + " operator not supported");
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
return aFilters;
|
|
638
|
+
},
|
|
639
|
+
|
|
640
|
+
/*
|
|
641
|
+
* Converts the Between Operator to Less than and Equal to Operator.
|
|
642
|
+
*/
|
|
643
|
+
_manageParam: function (sPath, operator, value1, value2) {
|
|
644
|
+
var filterParam = [];
|
|
645
|
+
if (value1 && value2) {
|
|
646
|
+
filterParam = new sap.ui.model.Filter({
|
|
647
|
+
filters: [new sap.ui.model.Filter(sPath, sap.ui.model.FilterOperator.GT, value1),
|
|
648
|
+
new sap.ui.model.Filter(sPath, sap.ui.model.FilterOperator.LT, value2)
|
|
649
|
+
],
|
|
650
|
+
and: true
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
return filterParam;
|
|
654
|
+
},
|
|
655
|
+
|
|
656
|
+
// Utility function to form the search filter params.
|
|
657
|
+
_getSearchFilters: function (searchParam) {
|
|
658
|
+
return new sap.ui.model.Filter({
|
|
659
|
+
filters: [new sap.ui.model.Filter(this._propertyValue, sap.ui.model.FilterOperator.EQ, searchParam),
|
|
660
|
+
new sap.ui.model.Filter(this._propertyDescription, sap.ui.model.FilterOperator.EQ, searchParam)
|
|
661
|
+
],
|
|
662
|
+
and: false
|
|
663
|
+
});
|
|
664
|
+
},
|
|
665
|
+
|
|
666
|
+
setValueStateFilter: function (oEvent) {
|
|
667
|
+
var sId = oEvent.getSource().sId;
|
|
668
|
+
this._valueFieldValue = sap.ui.getCore().byId(sId + "-filterItemControlA_-Value");
|
|
669
|
+
if (this._valueFieldValue) {
|
|
670
|
+
this._valueFieldValue.setValueState("None");
|
|
671
|
+
this._valueFieldValue.setValueStateText("");
|
|
672
|
+
}
|
|
673
|
+
this._valueFieldDescription = sap.ui.getCore().byId(sId + "-filterItemControlA_-Description");
|
|
674
|
+
if (this._valueFieldDescription) {
|
|
675
|
+
this._valueFieldDescription.setValueState("None");
|
|
676
|
+
this._valueFieldDescription.setValueStateText("");
|
|
677
|
+
}
|
|
678
|
+
},
|
|
679
|
+
|
|
680
|
+
_formatText: function (oEvent) {
|
|
681
|
+
var that = this;
|
|
682
|
+
var businessDataTypeList = this.getData().businessDataTypeList;
|
|
683
|
+
if (businessDataTypeList && businessDataTypeList.length > 0) {
|
|
684
|
+
this.businessDataType = this.getData().businessDataTypeList[0];
|
|
685
|
+
} else {
|
|
686
|
+
this.businessDataType = "N"
|
|
687
|
+
}
|
|
688
|
+
var token = oEvent.getSource().getValue();
|
|
689
|
+
oEvent.getSource().setValue(token);
|
|
690
|
+
return oEvent;
|
|
691
|
+
},
|
|
692
|
+
|
|
693
|
+
/* ------------------------------- Date and Time related functions -------------------------- */
|
|
694
|
+
_createDateLink : function(){
|
|
695
|
+
var that = this;
|
|
696
|
+
this.dateContent = new sap.m.Link({
|
|
697
|
+
wrapping: true,
|
|
698
|
+
text: this.oBundle.getText("select_date"),
|
|
699
|
+
press: function (oEvent) {
|
|
700
|
+
that.dateContext = "D";
|
|
701
|
+
that._createDateTimeDialog();
|
|
702
|
+
}
|
|
703
|
+
});
|
|
704
|
+
return this.dateContent;
|
|
705
|
+
},
|
|
706
|
+
|
|
707
|
+
_createTimeStampLink : function() {
|
|
708
|
+
var that = this;
|
|
709
|
+
this.timeContent = new sap.m.Link({
|
|
710
|
+
wrapping: true,
|
|
711
|
+
text: this.oBundle.getText("select_date_time"),
|
|
712
|
+
press: function (oEvent) {
|
|
713
|
+
that.dateContext = "U";
|
|
714
|
+
that._createDateTimeDialog();
|
|
715
|
+
}
|
|
716
|
+
});
|
|
717
|
+
return this.timeContent;
|
|
718
|
+
},
|
|
719
|
+
|
|
720
|
+
//creates calender control
|
|
721
|
+
_createDateTimeDialog: function () {
|
|
722
|
+
var that = this;
|
|
723
|
+
var oLocale = sap.ui.getCore().getConfiguration().getFormatSettings().getFormatLocale();
|
|
724
|
+
var oLocaleData = LocaleData.getInstance(oLocale);
|
|
725
|
+
var dateFormatted = oLocaleData.getDatePattern('medium');
|
|
726
|
+
var timeFormat = oLocaleData.getTimePattern('medium');
|
|
727
|
+
var sValueFormat = dateFormatted + " " + timeFormat;
|
|
728
|
+
|
|
729
|
+
if(this.dateContext){
|
|
730
|
+
this._dateBusinessDataType = this.dateContext;
|
|
731
|
+
}
|
|
732
|
+
if (this._dateBusinessDataType === "D") {
|
|
733
|
+
this.control = new DatePicker({
|
|
734
|
+
width: "auto",
|
|
735
|
+
valueFormat: dateFormatted
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
if (this._dateBusinessDataType === "U") {
|
|
740
|
+
var that = this;
|
|
741
|
+
this.control = new DateTimePicker({
|
|
742
|
+
width: "auto",
|
|
743
|
+
valueFormat: sValueFormat
|
|
744
|
+
});
|
|
745
|
+
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
this._oSelectNewDateDialog = new Dialog({
|
|
749
|
+
title: this.oBundle.getText("calendarTitle"),
|
|
750
|
+
afterClose: function () {
|
|
751
|
+
that._dialogOpenedCallbackReference(false);
|
|
752
|
+
},
|
|
753
|
+
content: [
|
|
754
|
+
this.control
|
|
755
|
+
],
|
|
756
|
+
beginButton: new Button({
|
|
757
|
+
text: this.oBundle.getText("okBtn"),
|
|
758
|
+
enabled: true,
|
|
759
|
+
press: function (oEvt) {
|
|
760
|
+
var date = this._updateText(this.control);
|
|
761
|
+
oEvt.oSource.mProperties.value = "'" + date + "'";
|
|
762
|
+
oEvt.oSource.mProperties.dateSelected = this._dateBusinessDataType;
|
|
763
|
+
oEvt.oSource.mProperties.forceFireChange = true;
|
|
764
|
+
that._reference(oEvt);
|
|
765
|
+
that._setModal(false);
|
|
766
|
+
that._oSelectNewDateDialog.close();
|
|
767
|
+
}.bind(this)
|
|
768
|
+
}),
|
|
769
|
+
endButton: new Button({
|
|
770
|
+
text: this.oBundle.getText("clsBtn"),
|
|
771
|
+
press: function () {
|
|
772
|
+
that._setModal(false);
|
|
773
|
+
that._oSelectNewDateDialog.close();
|
|
774
|
+
}.bind(this)
|
|
775
|
+
})
|
|
776
|
+
});
|
|
777
|
+
this._dialogOpenedCallbackReference(true);
|
|
778
|
+
this._setModal(true);
|
|
779
|
+
this._oSelectNewDateDialog.open();
|
|
780
|
+
|
|
781
|
+
},
|
|
782
|
+
|
|
783
|
+
// Utility function to format date and timestamp
|
|
784
|
+
_updateText: function (oCalendar) {
|
|
785
|
+
var aSelectedDates = oCalendar._getInputValue();
|
|
786
|
+
var formattedDate = this._getValidValue(aSelectedDates);
|
|
787
|
+
return formattedDate; //aSelectedDates;//formattedDate;
|
|
788
|
+
},
|
|
789
|
+
|
|
790
|
+
_getValidValue: function (sValue) {
|
|
791
|
+
var date, formatter;
|
|
792
|
+
var sDateFormatted = "";
|
|
793
|
+
if (this.dateContext) {
|
|
794
|
+
this._dateBusinessDataType = this.dateContext;
|
|
795
|
+
}
|
|
796
|
+
var formatterParsing = this._getDateTimeFormatterForParsing();
|
|
797
|
+
if (formatterParsing) {
|
|
798
|
+
date = formatterParsing.parse(sValue);
|
|
799
|
+
}
|
|
800
|
+
if (this._dateBusinessDataType === "D") {
|
|
801
|
+
formatter = sap.ui.core.format.DateFormat.getDateInstance({
|
|
802
|
+
pattern: "yyyy-MM-dd"
|
|
803
|
+
});
|
|
804
|
+
sDateFormatted = formatter.format(date);
|
|
805
|
+
} else if (this._dateBusinessDataType === "U") {
|
|
806
|
+
formatter = sap.ui.core.format.DateFormat.getDateTimeInstance({
|
|
807
|
+
pattern: "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
|
|
808
|
+
});
|
|
809
|
+
sDateFormatted = formatter.format(date);
|
|
810
|
+
}
|
|
811
|
+
if (sDateFormatted !== "") {
|
|
812
|
+
return sDateFormatted;
|
|
813
|
+
}
|
|
814
|
+
return sValue;
|
|
815
|
+
},
|
|
816
|
+
|
|
817
|
+
_getDateTimeFormatterForParsing: function () {
|
|
818
|
+
var formatter;
|
|
819
|
+
var oLocale = sap.ui.getCore().getConfiguration().getFormatSettings().getFormatLocale();
|
|
820
|
+
var oLocaleData = LocaleData.getInstance(oLocale);
|
|
821
|
+
var datePattern = oLocaleData.getDatePattern('medium');
|
|
822
|
+
var timePattern = oLocaleData.getTimePattern('medium');
|
|
823
|
+
if (this.dateContext === "D") {
|
|
824
|
+
formatter = sap.ui.core.format.DateFormat.getDateInstance({
|
|
825
|
+
pattern: datePattern
|
|
826
|
+
});
|
|
827
|
+
} else if (this.dateContext === "U") {
|
|
828
|
+
formatter = sap.ui.core.format.DateFormat.getDateTimeInstance({
|
|
829
|
+
pattern: datePattern + " " + timePattern
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
return formatter;
|
|
833
|
+
},
|
|
834
|
+
renderer: AutoSuggestionFixedValuePanelRenderer
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
});
|
|
838
|
+
|
|
839
|
+
return autoSuggestionFixedValuePanel;
|
|
840
|
+
}, /* bExport= */ true);
|