-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsmart-webcomponents-angular-listmenu.js
981 lines (972 loc) · 38 KB
/
smart-webcomponents-angular-listmenu.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
60
61
62
63
64
65
66
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
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
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
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
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
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
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
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
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
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
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
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
762
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
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
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
968
969
970
971
972
973
974
975
976
977
978
979
980
981
if (!window['Smart']) {
window['Smart'] = { RenderMode: 'manual' };
}
else {
window['Smart'].RenderMode = 'manual';
}
import './../source/modules/smart.listmenu';
import { __decorate, __awaiter } from 'tslib';
import { EventEmitter, Output, Input, ElementRef, Directive, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
class BaseElement {
constructor(ref) {
this.onCreate = new EventEmitter();
this.onReady = new EventEmitter();
this.onAttach = new EventEmitter();
this.onDetach = new EventEmitter();
const that = this;
this.nativeElement = ref.nativeElement;
that.nativeElement.onAttached = () => {
that.onAttach.emit(that.nativeElement);
};
that.nativeElement.onDetached = () => {
that.onDetach.emit(that.nativeElement);
};
}
addEventListener(type, listener, options = false) {
this.nativeElement.addEventListener(type, listener, options);
}
removeEventListener(type, listener, options = false) {
this.nativeElement.removeEventListener(type, listener, options);
}
dispatchEvent(event) {
return this.nativeElement.dispatchEvent(event);
}
blur() {
this.nativeElement.blur();
}
click() {
this.nativeElement.click();
}
focus(options) {
this.nativeElement.focus(options);
}
/** @description Sets or gets the language. Used in conjunction with the property messages. */
get locale() {
return this.nativeElement ? this.nativeElement.locale : undefined;
}
set locale(value) {
this.nativeElement ? this.nativeElement.locale = value : undefined;
}
/** @description Callback used to customize the format of the messages that are returned from the Localization Module. */
get localizeFormatFunction() {
return this.nativeElement ? this.nativeElement.localizeFormatFunction : undefined;
}
set localizeFormatFunction(value) {
this.nativeElement ? this.nativeElement.localizeFormatFunction = value : undefined;
}
/** @description Sets or gets an object specifying strings used in the widget that can be localized. Used in conjunction with the property locale. */
get messages() {
return this.nativeElement ? this.nativeElement.messages : undefined;
}
set messages(value) {
this.nativeElement ? this.nativeElement.messages = value : undefined;
}
/** @description Sets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts. */
get rightToLeft() {
return this.nativeElement ? this.nativeElement.rightToLeft : undefined;
}
set rightToLeft(value) {
this.nativeElement ? this.nativeElement.rightToLeft = value : undefined;
}
/** @description Determines the theme. Theme defines the look of the element */
get theme() {
return this.nativeElement ? this.nativeElement.theme : undefined;
}
set theme(value) {
this.nativeElement ? this.nativeElement.theme = value : undefined;
}
}
__decorate([
Output()
], BaseElement.prototype, "onCreate", void 0);
__decorate([
Output()
], BaseElement.prototype, "onReady", void 0);
__decorate([
Output()
], BaseElement.prototype, "onAttach", void 0);
__decorate([
Output()
], BaseElement.prototype, "onDetach", void 0);
__decorate([
Input()
], BaseElement.prototype, "locale", null);
__decorate([
Input()
], BaseElement.prototype, "localizeFormatFunction", null);
__decorate([
Input()
], BaseElement.prototype, "messages", null);
__decorate([
Input()
], BaseElement.prototype, "rightToLeft", null);
__decorate([
Input()
], BaseElement.prototype, "theme", null);
const Smart = window.Smart;
let ListMenuComponent = class ListMenuComponent extends BaseElement {
constructor(ref) {
super(ref);
this.eventHandlers = [];
/** @description This event is triggered when a smart-menu-items-group is expanded.
* @param event. The custom event. Custom event was created with: event.detail( item, label, value, path, children)
* item - The menu item that was expanded.
* label - The label of the item that was expanded.
* value - The value of the item that was expanded.
* path - The path of the item that was expanded, e.g. '0.1', '1.1.2'.
* children - The children of the item that was expanded.
*/
this.onExpand = new EventEmitter();
/** @description This event is triggered when a menu item check state is changed.
* @param event. The custom event. Custom event was created with: event.detail( item, label, value, checked)
* item - The menu item which state was changed.
* label - The label of the item which state was changed.
* value - The value of the item which state was changed.
* checked - The checked state of the toggled item. If false the item is not toggled.
*/
this.onItemCheckChange = new EventEmitter();
/** @description This event is triggered when a list menu item is clicked.
* @param event. The custom event. Custom event was created with: event.detail( item, label, value)
* item - The menu item that was clicked.
* label - The label of the clicked item.
* value - The value of the clicked item.
*/
this.onItemClick = new EventEmitter();
/** @description This event is triggered when the user scrolls to the bottom of the ListMenu.
* @param event. The custom event. */
this.onScrollBottomReached = new EventEmitter();
/** @description This event is triggered when the user swipes to the left inside the ListMenu.
* @param event. The custom event. */
this.onSwipeleft = new EventEmitter();
/** @description This event is triggered when the user swipes to the right inside the ListMenu.
* @param event. The custom event. */
this.onSwiperight = new EventEmitter();
this.nativeElement = ref.nativeElement;
}
/** @description Creates the component on demand.
* @param properties An optional object of properties, which will be added to the template binded ones.
*/
createComponent(properties = {}) {
this.nativeElement = document.createElement('smart-list-menu');
for (let propertyName in properties) {
this.nativeElement[propertyName] = properties[propertyName];
}
return this.nativeElement;
}
/** @description Sets or gets the animation mode. Animation is disabled when the property is set to 'none' */
get animation() {
return this.nativeElement ? this.nativeElement.animation : undefined;
}
set animation(value) {
this.nativeElement ? this.nativeElement.animation = value : undefined;
}
/** @description Determines whether the element becomes focused on hover or not. */
get autoFocusOnMouseenter() {
return this.nativeElement ? this.nativeElement.autoFocusOnMouseenter : undefined;
}
set autoFocusOnMouseenter(value) {
this.nativeElement ? this.nativeElement.autoFocusOnMouseenter = value : undefined;
}
/** @description Allows top-level ListMenu items to be checkable. */
get checkable() {
return this.nativeElement ? this.nativeElement.checkable : undefined;
}
set checkable(value) {
this.nativeElement ? this.nativeElement.checkable = value : undefined;
}
/** @description Sets or gets whether checkboxes and radio buttons can be displayed in the top level menu groups. This property is applicable only to the ListMenu itself, and not its smart-menu-item/smart-menu-items-group subitems. See also the property checkable. */
get checkboxes() {
return this.nativeElement ? this.nativeElement.checkboxes : undefined;
}
set checkboxes(value) {
this.nativeElement ? this.nativeElement.checkboxes = value : undefined;
}
/** @description Sets the check mode of top-level ListMenu items(groups). */
get checkMode() {
return this.nativeElement ? this.nativeElement.checkMode : undefined;
}
set checkMode(value) {
this.nativeElement ? this.nativeElement.checkMode = value : undefined;
}
/** @description Determines the data source that will be loaded to the ListMenu. The data source represents an array of objects with the following properties: label - a string representing the text content of the item.value - the value of the item.shortcut - a string representing a shortuct for the item. It will be displayed inside the item.items - allows to define an array of sub menu items. */
get dataSource() {
return this.nativeElement ? this.nativeElement.dataSource : undefined;
}
set dataSource(value) {
this.nativeElement ? this.nativeElement.dataSource = value : undefined;
}
/** @description Enables or disables the element. */
get disabled() {
return this.nativeElement ? this.nativeElement.disabled : undefined;
}
set disabled(value) {
this.nativeElement ? this.nativeElement.disabled = value : undefined;
}
/** @description Displays or hides the loading indicator. Loading indicator is hidden by default. */
get displayLoadingIndicator() {
return this.nativeElement ? this.nativeElement.displayLoadingIndicator : undefined;
}
set displayLoadingIndicator(value) {
this.nativeElement ? this.nativeElement.displayLoadingIndicator = value : undefined;
}
/** @description Determines the field in the data source that corresponds to an item's label. */
get displayMember() {
return this.nativeElement ? this.nativeElement.displayMember : undefined;
}
set displayMember(value) {
this.nativeElement ? this.nativeElement.displayMember = value : undefined;
}
/** @description Sets custom outer container where the minimized dropdown will be appednded. By default it is in the ListMenu. The value of the property can be an HTML element or the id of an HTML element. */
get dropDownAppendTo() {
return this.nativeElement ? this.nativeElement.dropDownAppendTo : undefined;
}
set dropDownAppendTo(value) {
this.nativeElement ? this.nativeElement.dropDownAppendTo = value : undefined;
}
/** @description If this property is enabled, when the element's minimized dropdown is opened, a transparent overlay is positioned between the dropdown and the rest of the document. */
get dropDownOverlay() {
return this.nativeElement ? this.nativeElement.dropDownOverlay : undefined;
}
set dropDownOverlay(value) {
this.nativeElement ? this.nativeElement.dropDownOverlay = value : undefined;
}
/** @description Sets or gets the opening direction of the ListMenu minimized dropdown. */
get dropDownPosition() {
return this.nativeElement ? this.nativeElement.dropDownPosition : undefined;
}
set dropDownPosition(value) {
this.nativeElement ? this.nativeElement.dropDownPosition = value : undefined;
}
/** @description Enables or disables scrolling using the mouse wheel through overflowing menu items. */
get enableMouseWheelAction() {
return this.nativeElement ? this.nativeElement.enableMouseWheelAction : undefined;
}
set enableMouseWheelAction(value) {
this.nativeElement ? this.nativeElement.enableMouseWheelAction = value : undefined;
}
/** @description Determines whether menu item filtering is enabled. When enabled a filter input is shown at the top of the element. Only items in the current view can be filtered. */
get filterable() {
return this.nativeElement ? this.nativeElement.filterable : undefined;
}
set filterable(value) {
this.nativeElement ? this.nativeElement.filterable = value : undefined;
}
/** @description Determines the placeholder for the filter input. */
get filterInputPlaceholder() {
return this.nativeElement ? this.nativeElement.filterInputPlaceholder : undefined;
}
set filterInputPlaceholder(value) {
this.nativeElement ? this.nativeElement.filterInputPlaceholder = value : undefined;
}
/** @description Determines the MenuItem property that will be used as a filtering criteria. By default the label property is used. It can be set to 'value' if the user wants to filter by the 'value' property or 'textContent' if the user wants to filter by text inside the MenuItem's content or any other property. */
get filterMember() {
return this.nativeElement ? this.nativeElement.filterMember : undefined;
}
set filterMember(value) {
this.nativeElement ? this.nativeElement.filterMember = value : undefined;
}
/** @description Determines the filtering mode. */
get filterMode() {
return this.nativeElement ? this.nativeElement.filterMode : undefined;
}
set filterMode(value) {
this.nativeElement ? this.nativeElement.filterMode = value : undefined;
}
/** @description If enabled, the items will be grouped by their first letter and sorted. */
get grouped() {
return this.nativeElement ? this.nativeElement.grouped : undefined;
}
set grouped(value) {
this.nativeElement ? this.nativeElement.grouped = value : undefined;
}
/** @description Determines the field in the data source that corresponds to an item group's subitems collection. */
get itemsMember() {
return this.nativeElement ? this.nativeElement.itemsMember : undefined;
}
set itemsMember(value) {
this.nativeElement ? this.nativeElement.itemsMember = value : undefined;
}
/** @description Determines the text that will be displayed next to the loading indicator when the loader is visible and it's position is top or bottom. */
get loadingIndicatorPlaceholder() {
return this.nativeElement ? this.nativeElement.loadingIndicatorPlaceholder : undefined;
}
set loadingIndicatorPlaceholder(value) {
this.nativeElement ? this.nativeElement.loadingIndicatorPlaceholder = value : undefined;
}
/** @description Determines the position of the loading indicator inside the element. */
get loadingIndicatorPosition() {
return this.nativeElement ? this.nativeElement.loadingIndicatorPosition : undefined;
}
set loadingIndicatorPosition(value) {
this.nativeElement ? this.nativeElement.loadingIndicatorPosition = value : undefined;
}
/** @description Sets or gets the language. Used in conjunction with the property messages. */
get locale() {
return this.nativeElement ? this.nativeElement.locale : undefined;
}
set locale(value) {
this.nativeElement ? this.nativeElement.locale = value : undefined;
}
/** @description Callback used to customize the format of the messages that are returned from the Localization Module. */
get localizeFormatFunction() {
return this.nativeElement ? this.nativeElement.localizeFormatFunction : undefined;
}
set localizeFormatFunction(value) {
this.nativeElement ? this.nativeElement.localizeFormatFunction = value : undefined;
}
/** @description Sets or gets an object specifying strings used in the widget that can be localized. Used in conjunction with the property locale. */
get messages() {
return this.nativeElement ? this.nativeElement.messages : undefined;
}
set messages(value) {
this.nativeElement ? this.nativeElement.messages = value : undefined;
}
/** @description Allows to load a custom minimize icon from an HTMLTemplateElement.The property acceps the id of an HTMLTemplateElement or it's direct instance. */
get minimizeIconTemplate() {
return this.nativeElement ? this.nativeElement.minimizeIconTemplate : undefined;
}
set minimizeIconTemplate(value) {
this.nativeElement ? this.nativeElement.minimizeIconTemplate = value : undefined;
}
/** @description Determines the minimum width of the ListMenu at which it will switch from normal to minimized mode. If set to null, the ListMenu does not minimize automatically. */
get minimizeWidth() {
return this.nativeElement ? this.nativeElement.minimizeWidth : undefined;
}
set minimizeWidth(value) {
this.nativeElement ? this.nativeElement.minimizeWidth = value : undefined;
}
/** @description Sets or gets the ListMenu's scroll buttons behavior. */
get overflow() {
return this.nativeElement ? this.nativeElement.overflow : undefined;
}
set overflow(value) {
this.nativeElement ? this.nativeElement.overflow = value : undefined;
}
/** @description If the element is readonly, users cannot interact with it. */
get readonly() {
return this.nativeElement ? this.nativeElement.readonly : undefined;
}
set readonly(value) {
this.nativeElement ? this.nativeElement.readonly = value : undefined;
}
/** @description Sets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts. */
get rightToLeft() {
return this.nativeElement ? this.nativeElement.rightToLeft : undefined;
}
set rightToLeft(value) {
this.nativeElement ? this.nativeElement.rightToLeft = value : undefined;
}
/** @description Determines whether to use scrollbar or scrollButtons when content overflows an element's box. */
get scrollMode() {
return this.nativeElement ? this.nativeElement.scrollMode : undefined;
}
set scrollMode(value) {
this.nativeElement ? this.nativeElement.scrollMode = value : undefined;
}
/** @description Determines the theme. Theme defines the look of the element */
get theme() {
return this.nativeElement ? this.nativeElement.theme : undefined;
}
set theme(value) {
this.nativeElement ? this.nativeElement.theme = value : undefined;
}
/** @description If is set to true, the element cannot be focused. */
get unfocusable() {
return this.nativeElement ? this.nativeElement.unfocusable : undefined;
}
set unfocusable(value) {
this.nativeElement ? this.nativeElement.unfocusable = value : undefined;
}
/** @description Determines the field in the data source that corresponds to an item's value. */
get valueMember() {
return this.nativeElement ? this.nativeElement.valueMember : undefined;
}
set valueMember(value) {
this.nativeElement ? this.nativeElement.valueMember = value : undefined;
}
/** @description Adds an item to the list.
* @param {HTMLElement} Item. A smart-menu-item to add to the List Menu.
* @param {HTMLElement | string} Parent?. The smart-menu-items-group (or its id or numeric path) to add the item to.
*/
addItem(Item, Parent) {
if (this.nativeElement.isRendered) {
this.nativeElement.addItem(Item, Parent);
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.addItem(Item, Parent);
});
}
}
/** @description Navigates to the previous page (smart-menu-items-group).
* @param {boolean} animation?. If set to false, disables collapse animation even if animation is enabled for the element
*/
back(animation) {
if (this.nativeElement.isRendered) {
this.nativeElement.back(animation);
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.back(animation);
});
}
}
/** @description Navigates to a particular page (smart-menu-items-group).
* @param {string} id. The id or numeric path of a page (smart-menu-items-group).
*/
changePage(id) {
if (this.nativeElement.isRendered) {
this.nativeElement.changePage(id);
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.changePage(id);
});
}
}
/** @description Checks an item.
* @param {HTMLElement | string} item. smart-menu-item/smart-menu-items-group (or its id or numeric path).
*/
checkItem(item) {
if (this.nativeElement.isRendered) {
this.nativeElement.checkItem(item);
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.checkItem(item);
});
}
}
/** @description Gets an item by its id or numeric path.
* @param {string} id. The id or numeric path of an item
* @returns {HTMLElement}
*/
getItem(id) {
return __awaiter(this, void 0, void 0, function* () {
const getResultOnRender = () => {
return new Promise(resolve => {
this.nativeElement.whenRendered(() => {
const result = this.nativeElement.getItem(id);
resolve(result);
});
});
};
const result = yield getResultOnRender();
return result;
});
}
/** @description Maximizes the List Menu.
*/
maximize() {
if (this.nativeElement.isRendered) {
this.nativeElement.maximize();
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.maximize();
});
}
}
/** @description Minimizes the List Menu. An icon is displayed and the menu is hidden when minimized.
*/
minimize() {
if (this.nativeElement.isRendered) {
this.nativeElement.minimize();
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.minimize();
});
}
}
/** @description Removes an item.
* @param {HTMLElement | string} item. The smart-menu-item/smart-menu-items-group (or its id or numeric path) to remove.
*/
removeItem(item) {
if (this.nativeElement.isRendered) {
this.nativeElement.removeItem(item);
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.removeItem(item);
});
}
}
/** @description Unchecks an item.
* @param {HTMLElement | string} item. smart-menu-item/smart-menu-items-group (or its id or numeric path).
*/
uncheckItem(item) {
if (this.nativeElement.isRendered) {
this.nativeElement.uncheckItem(item);
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.uncheckItem(item);
});
}
}
get isRendered() {
return this.nativeElement ? this.nativeElement.isRendered : false;
}
ngOnInit() {
}
ngAfterViewInit() {
const that = this;
that.onCreate.emit(that.nativeElement);
Smart.Render();
this.nativeElement.classList.add('smart-angular');
this.nativeElement.whenRendered(() => { that.onReady.emit(that.nativeElement); });
this.listen();
}
ngOnDestroy() {
this.unlisten();
}
ngOnChanges(changes) {
if (this.nativeElement && this.nativeElement.isRendered) {
for (const propName in changes) {
if (changes.hasOwnProperty(propName)) {
this.nativeElement[propName] = changes[propName].currentValue;
}
}
}
}
/** @description Add event listeners. */
listen() {
const that = this;
that.eventHandlers['expandHandler'] = (event) => { that.onExpand.emit(event); };
that.nativeElement.addEventListener('expand', that.eventHandlers['expandHandler']);
that.eventHandlers['itemCheckChangeHandler'] = (event) => { that.onItemCheckChange.emit(event); };
that.nativeElement.addEventListener('itemCheckChange', that.eventHandlers['itemCheckChangeHandler']);
that.eventHandlers['itemClickHandler'] = (event) => { that.onItemClick.emit(event); };
that.nativeElement.addEventListener('itemClick', that.eventHandlers['itemClickHandler']);
that.eventHandlers['scrollBottomReachedHandler'] = (event) => { that.onScrollBottomReached.emit(event); };
that.nativeElement.addEventListener('scrollBottomReached', that.eventHandlers['scrollBottomReachedHandler']);
that.eventHandlers['swipeleftHandler'] = (event) => { that.onSwipeleft.emit(event); };
that.nativeElement.addEventListener('swipeleft', that.eventHandlers['swipeleftHandler']);
that.eventHandlers['swiperightHandler'] = (event) => { that.onSwiperight.emit(event); };
that.nativeElement.addEventListener('swiperight', that.eventHandlers['swiperightHandler']);
}
/** @description Remove event listeners. */
unlisten() {
const that = this;
if (that.eventHandlers['expandHandler']) {
that.nativeElement.removeEventListener('expand', that.eventHandlers['expandHandler']);
}
if (that.eventHandlers['itemCheckChangeHandler']) {
that.nativeElement.removeEventListener('itemCheckChange', that.eventHandlers['itemCheckChangeHandler']);
}
if (that.eventHandlers['itemClickHandler']) {
that.nativeElement.removeEventListener('itemClick', that.eventHandlers['itemClickHandler']);
}
if (that.eventHandlers['scrollBottomReachedHandler']) {
that.nativeElement.removeEventListener('scrollBottomReached', that.eventHandlers['scrollBottomReachedHandler']);
}
if (that.eventHandlers['swipeleftHandler']) {
that.nativeElement.removeEventListener('swipeleft', that.eventHandlers['swipeleftHandler']);
}
if (that.eventHandlers['swiperightHandler']) {
that.nativeElement.removeEventListener('swiperight', that.eventHandlers['swiperightHandler']);
}
}
};
ListMenuComponent.ctorParameters = () => [
{ type: ElementRef }
];
__decorate([
Input()
], ListMenuComponent.prototype, "animation", null);
__decorate([
Input()
], ListMenuComponent.prototype, "autoFocusOnMouseenter", null);
__decorate([
Input()
], ListMenuComponent.prototype, "checkable", null);
__decorate([
Input()
], ListMenuComponent.prototype, "checkboxes", null);
__decorate([
Input()
], ListMenuComponent.prototype, "checkMode", null);
__decorate([
Input()
], ListMenuComponent.prototype, "dataSource", null);
__decorate([
Input()
], ListMenuComponent.prototype, "disabled", null);
__decorate([
Input()
], ListMenuComponent.prototype, "displayLoadingIndicator", null);
__decorate([
Input()
], ListMenuComponent.prototype, "displayMember", null);
__decorate([
Input()
], ListMenuComponent.prototype, "dropDownAppendTo", null);
__decorate([
Input()
], ListMenuComponent.prototype, "dropDownOverlay", null);
__decorate([
Input()
], ListMenuComponent.prototype, "dropDownPosition", null);
__decorate([
Input()
], ListMenuComponent.prototype, "enableMouseWheelAction", null);
__decorate([
Input()
], ListMenuComponent.prototype, "filterable", null);
__decorate([
Input()
], ListMenuComponent.prototype, "filterInputPlaceholder", null);
__decorate([
Input()
], ListMenuComponent.prototype, "filterMember", null);
__decorate([
Input()
], ListMenuComponent.prototype, "filterMode", null);
__decorate([
Input()
], ListMenuComponent.prototype, "grouped", null);
__decorate([
Input()
], ListMenuComponent.prototype, "itemsMember", null);
__decorate([
Input()
], ListMenuComponent.prototype, "loadingIndicatorPlaceholder", null);
__decorate([
Input()
], ListMenuComponent.prototype, "loadingIndicatorPosition", null);
__decorate([
Input()
], ListMenuComponent.prototype, "locale", null);
__decorate([
Input()
], ListMenuComponent.prototype, "localizeFormatFunction", null);
__decorate([
Input()
], ListMenuComponent.prototype, "messages", null);
__decorate([
Input()
], ListMenuComponent.prototype, "minimizeIconTemplate", null);
__decorate([
Input()
], ListMenuComponent.prototype, "minimizeWidth", null);
__decorate([
Input()
], ListMenuComponent.prototype, "overflow", null);
__decorate([
Input()
], ListMenuComponent.prototype, "readonly", null);
__decorate([
Input()
], ListMenuComponent.prototype, "rightToLeft", null);
__decorate([
Input()
], ListMenuComponent.prototype, "scrollMode", null);
__decorate([
Input()
], ListMenuComponent.prototype, "theme", null);
__decorate([
Input()
], ListMenuComponent.prototype, "unfocusable", null);
__decorate([
Input()
], ListMenuComponent.prototype, "valueMember", null);
__decorate([
Output()
], ListMenuComponent.prototype, "onExpand", void 0);
__decorate([
Output()
], ListMenuComponent.prototype, "onItemCheckChange", void 0);
__decorate([
Output()
], ListMenuComponent.prototype, "onItemClick", void 0);
__decorate([
Output()
], ListMenuComponent.prototype, "onScrollBottomReached", void 0);
__decorate([
Output()
], ListMenuComponent.prototype, "onSwipeleft", void 0);
__decorate([
Output()
], ListMenuComponent.prototype, "onSwiperight", void 0);
ListMenuComponent = __decorate([
Directive({
exportAs: 'smart-list-menu', selector: 'smart-list-menu, [smart-list-menu]'
})
], ListMenuComponent);
let MenuItemComponent = class MenuItemComponent extends BaseElement {
constructor(ref) {
super(ref);
this.eventHandlers = [];
this.nativeElement = ref.nativeElement;
}
/** @description Creates the component on demand.
* @param properties An optional object of properties, which will be added to the template binded ones.
*/
createComponent(properties = {}) {
this.nativeElement = document.createElement('smart-menu-item');
for (let propertyName in properties) {
this.nativeElement[propertyName] = properties[propertyName];
}
return this.nativeElement;
}
/** @description */
get checked() {
return this.nativeElement ? this.nativeElement.checked : undefined;
}
set checked(value) {
this.nativeElement ? this.nativeElement.checked = value : undefined;
}
/** @description Enables or disables element. */
get disabled() {
return this.nativeElement ? this.nativeElement.disabled : undefined;
}
set disabled(value) {
this.nativeElement ? this.nativeElement.disabled = value : undefined;
}
/** @description */
get label() {
return this.nativeElement ? this.nativeElement.label : undefined;
}
set label(value) {
this.nativeElement ? this.nativeElement.label = value : undefined;
}
/** @description */
get level() {
return this.nativeElement ? this.nativeElement.level : undefined;
}
set level(value) {
this.nativeElement ? this.nativeElement.level = value : undefined;
}
/** @description */
get separator() {
return this.nativeElement ? this.nativeElement.separator : undefined;
}
set separator(value) {
this.nativeElement ? this.nativeElement.separator = value : undefined;
}
/** @description */
get shortcut() {
return this.nativeElement ? this.nativeElement.shortcut : undefined;
}
set shortcut(value) {
this.nativeElement ? this.nativeElement.shortcut = value : undefined;
}
/** @description */
get value() {
return this.nativeElement ? this.nativeElement.value : undefined;
}
set value(value) {
this.nativeElement ? this.nativeElement.value = value : undefined;
}
get isRendered() {
return this.nativeElement ? this.nativeElement.isRendered : false;
}
ngOnInit() {
}
ngAfterViewInit() {
const that = this;
that.onCreate.emit(that.nativeElement);
this.nativeElement.classList.add('smart-angular');
this.nativeElement.whenRendered(() => { that.onReady.emit(that.nativeElement); });
}
ngOnDestroy() { }
ngOnChanges(changes) {
if (this.nativeElement && this.nativeElement.isRendered) {
for (const propName in changes) {
if (changes.hasOwnProperty(propName)) {
this.nativeElement[propName] = changes[propName].currentValue;
}
}
}
}
};
MenuItemComponent.ctorParameters = () => [
{ type: ElementRef }
];
__decorate([
Input()
], MenuItemComponent.prototype, "checked", null);
__decorate([
Input()
], MenuItemComponent.prototype, "disabled", null);
__decorate([
Input()
], MenuItemComponent.prototype, "label", null);
__decorate([
Input()
], MenuItemComponent.prototype, "level", null);
__decorate([
Input()
], MenuItemComponent.prototype, "separator", null);
__decorate([
Input()
], MenuItemComponent.prototype, "shortcut", null);
__decorate([
Input()
], MenuItemComponent.prototype, "value", null);
MenuItemComponent = __decorate([
Directive({
exportAs: 'smart-menu-item', selector: 'smart-menu-item, [smart-menu-item]'
})
], MenuItemComponent);
let MenuItemsGroupComponent = class MenuItemsGroupComponent extends BaseElement {
constructor(ref) {
super(ref);
this.eventHandlers = [];
this.nativeElement = ref.nativeElement;
}
/** @description Creates the component on demand.
* @param properties An optional object of properties, which will be added to the template binded ones.
*/
createComponent(properties = {}) {
this.nativeElement = document.createElement('smart-menu-items-group');
for (let propertyName in properties) {
this.nativeElement[propertyName] = properties[propertyName];
}
return this.nativeElement;
}
/** @description */
get checkable() {
return this.nativeElement ? this.nativeElement.checkable : undefined;
}
set checkable(value) {
this.nativeElement ? this.nativeElement.checkable = value : undefined;
}
/** @description */
get checked() {
return this.nativeElement ? this.nativeElement.checked : undefined;
}
set checked(value) {
this.nativeElement ? this.nativeElement.checked = value : undefined;
}
/** @description */
get checkMode() {
return this.nativeElement ? this.nativeElement.checkMode : undefined;
}
set checkMode(value) {
this.nativeElement ? this.nativeElement.checkMode = value : undefined;
}
/** @description Enables or disables element. */
get disabled() {
return this.nativeElement ? this.nativeElement.disabled : undefined;
}
set disabled(value) {
this.nativeElement ? this.nativeElement.disabled = value : undefined;
}
/** @description */
get dropDownHeight() {
return this.nativeElement ? this.nativeElement.dropDownHeight : undefined;
}
set dropDownHeight(value) {
this.nativeElement ? this.nativeElement.dropDownHeight = value : undefined;
}
/** @description */
get expanded() {
return this.nativeElement ? this.nativeElement.expanded : undefined;
}
set expanded(value) {
this.nativeElement ? this.nativeElement.expanded = value : undefined;
}
/** @description */
get label() {
return this.nativeElement ? this.nativeElement.label : undefined;
}
set label(value) {
this.nativeElement ? this.nativeElement.label = value : undefined;
}
/** @description */
get level() {
return this.nativeElement ? this.nativeElement.level : undefined;
}
set level(value) {
this.nativeElement ? this.nativeElement.level = value : undefined;
}
/** @description */
get separator() {
return this.nativeElement ? this.nativeElement.separator : undefined;
}
set separator(value) {
this.nativeElement ? this.nativeElement.separator = value : undefined;
}
/** @description */
get value() {
return this.nativeElement ? this.nativeElement.value : undefined;
}
set value(value) {
this.nativeElement ? this.nativeElement.value = value : undefined;
}
get isRendered() {
return this.nativeElement ? this.nativeElement.isRendered : false;
}
ngOnInit() {
}
ngAfterViewInit() {
const that = this;
that.onCreate.emit(that.nativeElement);
this.nativeElement.classList.add('smart-angular');
this.nativeElement.whenRendered(() => { that.onReady.emit(that.nativeElement); });
}
ngOnDestroy() { }
ngOnChanges(changes) {
if (this.nativeElement && this.nativeElement.isRendered) {
for (const propName in changes) {
if (changes.hasOwnProperty(propName)) {
this.nativeElement[propName] = changes[propName].currentValue;
}
}
}
}
};
MenuItemsGroupComponent.ctorParameters = () => [
{ type: ElementRef }
];
__decorate([
Input()
], MenuItemsGroupComponent.prototype, "checkable", null);
__decorate([
Input()
], MenuItemsGroupComponent.prototype, "checked", null);
__decorate([
Input()
], MenuItemsGroupComponent.prototype, "checkMode", null);
__decorate([
Input()
], MenuItemsGroupComponent.prototype, "disabled", null);
__decorate([
Input()
], MenuItemsGroupComponent.prototype, "dropDownHeight", null);
__decorate([
Input()
], MenuItemsGroupComponent.prototype, "expanded", null);
__decorate([
Input()
], MenuItemsGroupComponent.prototype, "label", null);
__decorate([
Input()
], MenuItemsGroupComponent.prototype, "level", null);
__decorate([
Input()
], MenuItemsGroupComponent.prototype, "separator", null);
__decorate([
Input()
], MenuItemsGroupComponent.prototype, "value", null);
MenuItemsGroupComponent = __decorate([
Directive({
exportAs: 'smart-menu-items-group', selector: 'smart-menu-items-group, [smart-menu-items-group]'
})
], MenuItemsGroupComponent);
let ListMenuModule = class ListMenuModule {
};
ListMenuModule = __decorate([
NgModule({
declarations: [ListMenuComponent, MenuItemComponent, MenuItemsGroupComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
exports: [ListMenuComponent, MenuItemComponent, MenuItemsGroupComponent]
})
], ListMenuModule);
/**
* Generated bundle index. Do not edit.
*/
export { ListMenuComponent, ListMenuModule, MenuItemComponent, MenuItemsGroupComponent, Smart, BaseElement as ɵa };
//# sourceMappingURL=smart-webcomponents-angular-listmenu.js.map