@apipass/inputs 0.2.5-alpha.23 → 0.2.5-alpha.25

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.
@@ -1185,6 +1185,8 @@
1185
1185
  _this.addNewItemIcon = '';
1186
1186
  _this.addNewItemClickCloseSelect = false;
1187
1187
  _this.closeOnBodyScroll = false;
1188
+ _this.initializing = false;
1189
+ _this.loadingText = 'Loading...';
1188
1190
  _this.onOpenSelectBox = new i0.EventEmitter();
1189
1191
  _this.onCloseSelectBox = new i0.EventEmitter();
1190
1192
  _this.onSelectChange = new i0.EventEmitter();
@@ -1307,9 +1309,12 @@
1307
1309
  if (this.selectProperty) {
1308
1310
  this.selectedItem = (_a = this.data) === null || _a === void 0 ? void 0 : _a.find(function (el) { return el[_this.bindKey] === value; });
1309
1311
  }
1310
- else {
1312
+ else if (value) {
1311
1313
  this.selectedItem = (_b = this.data) === null || _b === void 0 ? void 0 : _b.find(function (el) { return el[_this.bindKey] === value[_this.bindKey]; });
1312
1314
  }
1315
+ else {
1316
+ this.selectedItem = null;
1317
+ }
1313
1318
  };
1314
1319
  return SelectBoxComponent;
1315
1320
  }(ValueAccessorBase));
@@ -1322,11 +1327,11 @@
1322
1327
  var _t;
1323
1328
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.ngSelectComponent = _t.first);
1324
1329
  }
1325
- }, inputs: { placeholder: "placeholder", searchPlaceHolder: "searchPlaceHolder", clearText: "clearText", notFoundText: "notFoundText", enabledSearch: "enabledSearch", data: "data", disabled: "disabled", selectedItem: "selectedItem", selectProperty: "selectProperty", bindImageUrl: "bindImageUrl", bindKey: "bindKey", bindValue: "bindValue", limitItens: "limitItens", showAddNewItem: "showAddNewItem", addNewItemText: "addNewItemText", addNewItemIcon: "addNewItemIcon", addNewItemClickCloseSelect: "addNewItemClickCloseSelect", closeOnBodyScroll: "closeOnBodyScroll" }, outputs: { onOpenSelectBox: "onOpenSelectBox", onCloseSelectBox: "onCloseSelectBox", onSelectChange: "onSelectChange", onSelectClear: "onSelectClear", onAddNewItemClick: "onAddNewItemClick" }, features: [i0.ɵɵProvidersFeature([{
1330
+ }, inputs: { placeholder: "placeholder", searchPlaceHolder: "searchPlaceHolder", clearText: "clearText", notFoundText: "notFoundText", enabledSearch: "enabledSearch", data: "data", disabled: "disabled", selectedItem: "selectedItem", selectProperty: "selectProperty", bindImageUrl: "bindImageUrl", bindKey: "bindKey", bindValue: "bindValue", limitItens: "limitItens", showAddNewItem: "showAddNewItem", addNewItemText: "addNewItemText", addNewItemIcon: "addNewItemIcon", addNewItemClickCloseSelect: "addNewItemClickCloseSelect", closeOnBodyScroll: "closeOnBodyScroll", initializing: "initializing", loadingText: "loadingText" }, outputs: { onOpenSelectBox: "onOpenSelectBox", onCloseSelectBox: "onCloseSelectBox", onSelectChange: "onSelectChange", onSelectClear: "onSelectClear", onAddNewItemClick: "onAddNewItemClick" }, features: [i0.ɵɵProvidersFeature([{
1326
1331
  provide: i4.NG_VALUE_ACCESSOR,
1327
1332
  useExisting: i0.forwardRef(function () { return SelectBoxComponent; }),
1328
1333
  multi: true
1329
- }]), i0.ɵɵInheritDefinitionFeature], decls: 6, vars: 20, consts: [["appendTo", "body", 3, "ngModel", "items", "virtualScroll", "loading", "placeholder", "clearAllText", "searchable", "typeToSearchText", "notFoundText", "disabled", "typeahead", "ngClass", "compareWith", "bindValue", "ngModelChange", "open", "close", "clear", "scroll", "scrollToEnd", "change"], ["ngSelectComponent", ""], [4, "ngIf"], ["ng-option-tmp", ""], ["ng-label-tmp", ""], ["class", "image", "style", "width: 40px;height: 40px; margin-right: 10px;", 4, "ngIf"], ["class", "select-text-element", 4, "ngIf"], [1, "image", 2, "width", "40px", "height", "40px", "margin-right", "10px"], ["loading", "lazy", 2, "width", "auto", "max-width", "40px", "height", "40px", 3, "src", "alt", "matTooltip"], [1, "select-text-element"], ["ng-header-tmp", ""], [1, "add-new-item-option", 2, "display", "flex", "align-items", "center", "cursor", "pointer", 3, "click"], ["style", "margin-right: 5px", 3, "title", "name", "size", 4, "ngIf"], ["class", "add-new-item-text", "style", "white-space: nowrap;overflow: hidden;text-overflow: ellipsis;", 4, "ngIf"], [2, "margin-right", "5px", 3, "title", "name", "size"], [1, "add-new-item-text", 2, "white-space", "nowrap", "overflow", "hidden", "text-overflow", "ellipsis"], [1, "select-text-element", 2, "white-space", "nowrap", "overflow", "hidden", "text-overflow", "ellipsis"]], template: function SelectBoxComponent_Template(rf, ctx) {
1334
+ }]), i0.ɵɵInheritDefinitionFeature], decls: 6, vars: 21, consts: [["appendTo", "body", 3, "ngModel", "items", "virtualScroll", "loading", "loadingText", "placeholder", "clearAllText", "searchable", "typeToSearchText", "notFoundText", "disabled", "typeahead", "ngClass", "compareWith", "bindValue", "ngModelChange", "open", "close", "clear", "scroll", "scrollToEnd", "change"], ["ngSelectComponent", ""], [4, "ngIf"], ["ng-option-tmp", ""], ["ng-label-tmp", ""], ["class", "image", "style", "width: 40px;height: 40px; margin-right: 10px;", 4, "ngIf"], ["class", "select-text-element", 4, "ngIf"], [1, "image", 2, "width", "40px", "height", "40px", "margin-right", "10px"], ["loading", "lazy", 2, "width", "auto", "max-width", "40px", "height", "40px", 3, "src", "alt", "matTooltip"], [1, "select-text-element"], ["ng-header-tmp", ""], [1, "add-new-item-option", 2, "display", "flex", "align-items", "center", "cursor", "pointer", 3, "click"], ["style", "margin-right: 5px", 3, "title", "name", "size", 4, "ngIf"], ["class", "add-new-item-text", "style", "white-space: nowrap;overflow: hidden;text-overflow: ellipsis;", 4, "ngIf"], [2, "margin-right", "5px", 3, "title", "name", "size"], [1, "add-new-item-text", 2, "white-space", "nowrap", "overflow", "hidden", "text-overflow", "ellipsis"], [1, "select-text-element", 2, "white-space", "nowrap", "overflow", "hidden", "text-overflow", "ellipsis"]], template: function SelectBoxComponent_Template(rf, ctx) {
1330
1335
  if (rf & 1) {
1331
1336
  i0.ɵɵelementStart(0, "ng-select", 0, 1);
1332
1337
  i0.ɵɵlistener("ngModelChange", function SelectBoxComponent_Template_ng_select_ngModelChange_0_listener($event) { return ctx.value = $event; })("open", function SelectBoxComponent_Template_ng_select_open_0_listener($event) { return ctx.openSelectBox($event); })("close", function SelectBoxComponent_Template_ng_select_close_0_listener($event) { return ctx.onClose($event); })("clear", function SelectBoxComponent_Template_ng_select_clear_0_listener() { return ctx.onClear(); })("scroll", function SelectBoxComponent_Template_ng_select_scroll_0_listener($event) { return ctx.onScroll($event); })("scrollToEnd", function SelectBoxComponent_Template_ng_select_scrollToEnd_0_listener() { return ctx.onScrollToEnd(); })("change", function SelectBoxComponent_Template_ng_select_change_0_listener($event) { return ctx.onSelectionChange($event); });
@@ -1337,7 +1342,7 @@
1337
1342
  i0.ɵɵelementEnd();
1338
1343
  }
1339
1344
  if (rf & 2) {
1340
- i0.ɵɵproperty("ngModel", ctx.value)("items", ctx.visibleItens)("virtualScroll", true)("loading", ctx.loading)("placeholder", ctx.placeholder)("clearAllText", ctx.clearText)("searchable", ctx.enabledSearch)("typeToSearchText", ctx.searchPlaceHolder)("notFoundText", ctx.notFoundText)("disabled", ctx.disabled)("typeahead", ctx.inputFilter)("ngClass", i0.ɵɵpureFunction2(17, _c1$2, ctx.bindImageUrl, !ctx.bindImageUrl))("compareWith", ctx.compareFn)("bindValue", ctx.selectProperty);
1345
+ i0.ɵɵproperty("ngModel", ctx.value)("items", ctx.visibleItens)("virtualScroll", true)("loading", ctx.loading || ctx.initializing)("loadingText", ctx.loadingText)("placeholder", ctx.placeholder)("clearAllText", ctx.clearText)("searchable", ctx.enabledSearch)("typeToSearchText", ctx.searchPlaceHolder)("notFoundText", ctx.notFoundText)("disabled", ctx.disabled)("typeahead", ctx.inputFilter)("ngClass", i0.ɵɵpureFunction2(18, _c1$2, ctx.bindImageUrl, !ctx.bindImageUrl))("compareWith", ctx.compareFn)("bindValue", ctx.selectProperty);
1341
1346
  i0.ɵɵadvance(2);
1342
1347
  i0.ɵɵproperty("ngIf", ctx.selectProperty && ctx.selectedItem && ctx.selectedItem[ctx.bindKey] && ctx.selectedItem[ctx.bindValue]);
1343
1348
  i0.ɵɵadvance(1);
@@ -1397,6 +1402,10 @@
1397
1402
  type: i0.Input
1398
1403
  }], closeOnBodyScroll: [{
1399
1404
  type: i0.Input
1405
+ }], initializing: [{
1406
+ type: i0.Input
1407
+ }], loadingText: [{
1408
+ type: i0.Input
1400
1409
  }], onOpenSelectBox: [{
1401
1410
  type: i0.Output
1402
1411
  }], onCloseSelectBox: [{