@smart-webcomponents-angular/combobox 16.0.2 → 22.0.2

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.
@@ -44,6 +44,13 @@ class BaseElement {
44
44
  focus(options) {
45
45
  this.nativeElement.focus(options);
46
46
  }
47
+ /** @description Sets or gets the license. */
48
+ get license() {
49
+ return this.nativeElement ? this.nativeElement.license : undefined;
50
+ }
51
+ set license(value) {
52
+ this.nativeElement ? this.nativeElement.license = value : undefined;
53
+ }
47
54
  /** @description Sets or gets the language. Used in conjunction with the property messages. */
48
55
  get locale() {
49
56
  return this.nativeElement ? this.nativeElement.locale : undefined;
@@ -81,7 +88,7 @@ class BaseElement {
81
88
  }
82
89
  }
83
90
  BaseElement.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: BaseElement, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
84
- BaseElement.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.6", type: BaseElement, inputs: { locale: "locale", localizeFormatFunction: "localizeFormatFunction", messages: "messages", rightToLeft: "rightToLeft", theme: "theme" }, outputs: { onCreate: "onCreate", onReady: "onReady", onAttach: "onAttach", onDetach: "onDetach" }, ngImport: i0 });
91
+ BaseElement.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.6", type: BaseElement, inputs: { license: "license", locale: "locale", localizeFormatFunction: "localizeFormatFunction", messages: "messages", rightToLeft: "rightToLeft", theme: "theme" }, outputs: { onCreate: "onCreate", onReady: "onReady", onAttach: "onAttach", onDetach: "onDetach" }, ngImport: i0 });
85
92
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: BaseElement, decorators: [{
86
93
  type: Directive
87
94
  }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { onCreate: [{
@@ -92,6 +99,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImpor
92
99
  type: Output
93
100
  }], onDetach: [{
94
101
  type: Output
102
+ }], license: [{
103
+ type: Input
95
104
  }], locale: [{
96
105
  type: Input
97
106
  }], localizeFormatFunction: [{
@@ -103,7 +112,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImpor
103
112
  }], theme: [{
104
113
  type: Input
105
114
  }] } });
106
- const Smart = window.Smart;
115
+ let Smart;
116
+ if (typeof window !== "undefined") {
117
+ Smart = window.Smart;
118
+ }
107
119
 
108
120
  const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR = {
109
121
  provide: NG_VALUE_ACCESSOR,
@@ -461,6 +473,13 @@ class ComboBoxComponent extends BaseElement {
461
473
  set loadingIndicatorPosition(value) {
462
474
  this.nativeElement ? this.nativeElement.loadingIndicatorPosition = value : undefined;
463
475
  }
476
+ /** @description Sets or gets the unlockKey which unlocks the product. */
477
+ get unlockKey() {
478
+ return this.nativeElement ? this.nativeElement.unlockKey : undefined;
479
+ }
480
+ set unlockKey(value) {
481
+ this.nativeElement ? this.nativeElement.unlockKey = value : undefined;
482
+ }
464
483
  /** @description Sets or gets the language. Used in conjunction with the property messages. */
465
484
  get locale() {
466
485
  return this.nativeElement ? this.nativeElement.locale : undefined;
@@ -652,6 +671,19 @@ class ComboBoxComponent extends BaseElement {
652
671
  const result = await getResultOnRender();
653
672
  return result;
654
673
  }
674
+ /** @description Adds a new item(s).
675
+ * @param {any} item. Describes the properties of the item that will be inserted. You can also pass an array of items.
676
+ */
677
+ add(item) {
678
+ if (this.nativeElement.isRendered) {
679
+ this.nativeElement.add(item);
680
+ }
681
+ else {
682
+ this.nativeElement.whenRendered(() => {
683
+ this.nativeElement.add(item);
684
+ });
685
+ }
686
+ }
655
687
  /** @description Removes all items from the drop down list.
656
688
  */
657
689
  clearItems() {
@@ -688,6 +720,18 @@ class ComboBoxComponent extends BaseElement {
688
720
  });
689
721
  }
690
722
  }
723
+ /** @description Performs a data bind. This can be used to refresh the data source.
724
+ */
725
+ dataBind() {
726
+ if (this.nativeElement.isRendered) {
727
+ this.nativeElement.dataBind();
728
+ }
729
+ else {
730
+ this.nativeElement.whenRendered(() => {
731
+ this.nativeElement.dataBind();
732
+ });
733
+ }
734
+ }
691
735
  /** @description Ensures the desired item is visible by scrolling to it.
692
736
  * @param {HTMLElement | string} item. A list item or value of the desired item to be visible.
693
737
  */
@@ -719,7 +763,7 @@ class ComboBoxComponent extends BaseElement {
719
763
  }
720
764
  /** @description Inserts a new item at a specified position.
721
765
  * @param {number} position. The position where the item must be inserted.
722
- * @param {any} item. Describes the properties of the item that will be inserted.
766
+ * @param {any} item. Describes the properties of the item that will be inserted. You can also pass an array of items.
723
767
  */
724
768
  insert(position, item) {
725
769
  if (this.nativeElement.isRendered) {
@@ -837,9 +881,11 @@ class ComboBoxComponent extends BaseElement {
837
881
  ngAfterViewInit() {
838
882
  const that = this;
839
883
  that.onCreate.emit(that.nativeElement);
840
- Smart.Render();
884
+ if (Smart)
885
+ Smart.Render();
841
886
  this.nativeElement.classList.add('smart-angular');
842
- this.nativeElement.whenRendered(() => { that.onReady.emit(that.nativeElement); });
887
+ if (this.nativeElement.whenRendered)
888
+ this.nativeElement.whenRendered(() => { that.onReady.emit(that.nativeElement); });
843
889
  this.listen();
844
890
  }
845
891
  ngOnDestroy() {
@@ -881,7 +927,11 @@ class ComboBoxComponent extends BaseElement {
881
927
  }
882
928
  else {
883
929
  const input = that.nativeElement.querySelector('input');
884
- that._onChange((that.selectedValues && that.selectedValues.length > 0) ? that.selectedValues[0] : (input ? input.value : null));
930
+ let inputValue = input.value;
931
+ if (value && value.length && Array.isArray(value)) {
932
+ inputValue = value;
933
+ }
934
+ that._onChange((that.selectedValues && that.selectedValues.length > 0) ? that.selectedValues[0] : (input ? inputValue : null));
885
935
  }
886
936
  }
887
937
  });
@@ -992,7 +1042,7 @@ class ComboBoxComponent extends BaseElement {
992
1042
  }
993
1043
  }
994
1044
  ComboBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ComboBoxComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
995
- ComboBoxComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.6", type: ComboBoxComponent, selector: "smart-combo-box, [smart-combo-box]", inputs: { autoCloseDelay: "autoCloseDelay", autoComplete: "autoComplete", autoCompleteDelay: "autoCompleteDelay", autoOpenShortcutKey: "autoOpenShortcutKey", dataSource: "dataSource", disabled: "disabled", displayLoadingIndicator: "displayLoadingIndicator", displayMember: "displayMember", dropDownAppendTo: "dropDownAppendTo", dropDownButtonPosition: "dropDownButtonPosition", dropDownHeight: "dropDownHeight", dropDownMaxHeight: "dropDownMaxHeight", dropDownMaxWidth: "dropDownMaxWidth", dropDownMinHeight: "dropDownMinHeight", dropDownMinWidth: "dropDownMinWidth", dropDownOpenMode: "dropDownOpenMode", dropDownOverlay: "dropDownOverlay", dropDownPlaceholder: "dropDownPlaceholder", dropDownPosition: "dropDownPosition", dropDownWidth: "dropDownWidth", escKeyMode: "escKeyMode", filterable: "filterable", filterInputPlaceholder: "filterInputPlaceholder", filterMode: "filterMode", grouped: "grouped", groupMember: "groupMember", hint: "hint", horizontalScrollBarVisibility: "horizontalScrollBarVisibility", inputMember: "inputMember", inputPurpose: "inputPurpose", incrementalSearchDelay: "incrementalSearchDelay", incrementalSearchMode: "incrementalSearchMode", itemHeight: "itemHeight", itemMeasureMode: "itemMeasureMode", items: "items", itemTemplate: "itemTemplate", label: "label", loadingIndicatorPlaceholder: "loadingIndicatorPlaceholder", loadingIndicatorPosition: "loadingIndicatorPosition", locale: "locale", localizeFormatFunction: "localizeFormatFunction", messages: "messages", minLength: "minLength", maxLength: "maxLength", name: "name", opened: "opened", placeholder: "placeholder", readonly: "readonly", rightToLeft: "rightToLeft", resizeIndicator: "resizeIndicator", resizeMode: "resizeMode", selectionDisplayMode: "selectionDisplayMode", selectedIndexes: "selectedIndexes", selectedValues: "selectedValues", selectionMode: "selectionMode", sorted: "sorted", sortDirection: "sortDirection", theme: "theme", tokenTemplate: "tokenTemplate", unfocusable: "unfocusable", value: "value", valueMember: "valueMember", verticalScrollBarVisibility: "verticalScrollBarVisibility", virtualized: "virtualized" }, outputs: { onChange: "onChange", onClose: "onClose", onClosing: "onClosing", onItemClick: "onItemClick", onOpen: "onOpen", onOpening: "onOpening", onResizeStart: "onResizeStart", onResizeEnd: "onResizeEnd", onScrollBottomReached: "onScrollBottomReached", onScrollTopReached: "onScrollTopReached", onTokenClick: "onTokenClick" }, providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR], exportAs: ["smart-combo-box"], usesInheritance: true, usesOnChanges: true, ngImport: i0 });
1045
+ ComboBoxComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.6", type: ComboBoxComponent, selector: "smart-combo-box, [smart-combo-box]", inputs: { autoCloseDelay: "autoCloseDelay", autoComplete: "autoComplete", autoCompleteDelay: "autoCompleteDelay", autoOpenShortcutKey: "autoOpenShortcutKey", dataSource: "dataSource", disabled: "disabled", displayLoadingIndicator: "displayLoadingIndicator", displayMember: "displayMember", dropDownAppendTo: "dropDownAppendTo", dropDownButtonPosition: "dropDownButtonPosition", dropDownHeight: "dropDownHeight", dropDownMaxHeight: "dropDownMaxHeight", dropDownMaxWidth: "dropDownMaxWidth", dropDownMinHeight: "dropDownMinHeight", dropDownMinWidth: "dropDownMinWidth", dropDownOpenMode: "dropDownOpenMode", dropDownOverlay: "dropDownOverlay", dropDownPlaceholder: "dropDownPlaceholder", dropDownPosition: "dropDownPosition", dropDownWidth: "dropDownWidth", escKeyMode: "escKeyMode", filterable: "filterable", filterInputPlaceholder: "filterInputPlaceholder", filterMode: "filterMode", grouped: "grouped", groupMember: "groupMember", hint: "hint", horizontalScrollBarVisibility: "horizontalScrollBarVisibility", inputMember: "inputMember", inputPurpose: "inputPurpose", incrementalSearchDelay: "incrementalSearchDelay", incrementalSearchMode: "incrementalSearchMode", itemHeight: "itemHeight", itemMeasureMode: "itemMeasureMode", items: "items", itemTemplate: "itemTemplate", label: "label", loadingIndicatorPlaceholder: "loadingIndicatorPlaceholder", loadingIndicatorPosition: "loadingIndicatorPosition", unlockKey: "unlockKey", locale: "locale", localizeFormatFunction: "localizeFormatFunction", messages: "messages", minLength: "minLength", maxLength: "maxLength", name: "name", opened: "opened", placeholder: "placeholder", readonly: "readonly", rightToLeft: "rightToLeft", resizeIndicator: "resizeIndicator", resizeMode: "resizeMode", selectionDisplayMode: "selectionDisplayMode", selectedIndexes: "selectedIndexes", selectedValues: "selectedValues", selectionMode: "selectionMode", sorted: "sorted", sortDirection: "sortDirection", theme: "theme", tokenTemplate: "tokenTemplate", unfocusable: "unfocusable", value: "value", valueMember: "valueMember", verticalScrollBarVisibility: "verticalScrollBarVisibility", virtualized: "virtualized" }, outputs: { onChange: "onChange", onClose: "onClose", onClosing: "onClosing", onItemClick: "onItemClick", onOpen: "onOpen", onOpening: "onOpening", onResizeStart: "onResizeStart", onResizeEnd: "onResizeEnd", onScrollBottomReached: "onScrollBottomReached", onScrollTopReached: "onScrollTopReached", onTokenClick: "onTokenClick" }, providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR], exportAs: ["smart-combo-box"], usesInheritance: true, usesOnChanges: true, ngImport: i0 });
996
1046
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ComboBoxComponent, decorators: [{
997
1047
  type: Directive,
998
1048
  args: [{
@@ -1077,6 +1127,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImpor
1077
1127
  type: Input
1078
1128
  }], loadingIndicatorPosition: [{
1079
1129
  type: Input
1130
+ }], unlockKey: [{
1131
+ type: Input
1080
1132
  }], locale: [{
1081
1133
  type: Input
1082
1134
  }], localizeFormatFunction: [{
@@ -1253,7 +1305,8 @@ class ListItemComponent extends BaseElement {
1253
1305
  const that = this;
1254
1306
  that.onCreate.emit(that.nativeElement);
1255
1307
  this.nativeElement.classList.add('smart-angular');
1256
- this.nativeElement.whenRendered(() => { that.onReady.emit(that.nativeElement); });
1308
+ if (this.nativeElement.whenRendered)
1309
+ this.nativeElement.whenRendered(() => { that.onReady.emit(that.nativeElement); });
1257
1310
  }
1258
1311
  ngOnDestroy() { }
1259
1312
  ngOnChanges(changes) {
@@ -1329,7 +1382,8 @@ class ListItemsGroupComponent extends BaseElement {
1329
1382
  const that = this;
1330
1383
  that.onCreate.emit(that.nativeElement);
1331
1384
  this.nativeElement.classList.add('smart-angular');
1332
- this.nativeElement.whenRendered(() => { that.onReady.emit(that.nativeElement); });
1385
+ if (this.nativeElement.whenRendered)
1386
+ this.nativeElement.whenRendered(() => { that.onReady.emit(that.nativeElement); });
1333
1387
  }
1334
1388
  ngOnDestroy() { }
1335
1389
  ngOnChanges(changes) {