@seniorsistemas/angular-components 16.10.4 → 16.10.6
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/bundles/seniorsistemas-angular-components.umd.js +50 -24
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/country-phone-picker/country-phone-picker.component.d.ts +9 -6
- package/esm2015/components/country-phone-picker/country-phone-picker.component.js +40 -21
- package/esm2015/components/file-upload/file-upload.component.js +6 -6
- package/esm5/components/country-phone-picker/country-phone-picker.component.js +47 -21
- package/esm5/components/file-upload/file-upload.component.js +6 -6
- package/fesm2015/seniorsistemas-angular-components.js +44 -25
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +51 -25
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -1548,10 +1548,10 @@
|
|
|
1548
1548
|
this.tabindex = 0;
|
|
1549
1549
|
this._filterCountries = function (value) {
|
|
1550
1550
|
if (!value) {
|
|
1551
|
-
_this.filteredCountriesList = _this.
|
|
1551
|
+
_this.filteredCountriesList = _this._countriesList;
|
|
1552
1552
|
}
|
|
1553
1553
|
else {
|
|
1554
|
-
_this.filteredCountriesList = _this.
|
|
1554
|
+
_this.filteredCountriesList = _this._countriesList.filter(function (country) {
|
|
1555
1555
|
var countryName = _this.translate.instant("platform.angular_components.country_name_" + country.id);
|
|
1556
1556
|
return countryName.toLowerCase().includes(value.toLowerCase());
|
|
1557
1557
|
});
|
|
@@ -1559,8 +1559,31 @@
|
|
|
1559
1559
|
};
|
|
1560
1560
|
}
|
|
1561
1561
|
CountryPhonePickerComponent_1 = CountryPhonePickerComponent;
|
|
1562
|
+
Object.defineProperty(CountryPhonePickerComponent.prototype, "value", {
|
|
1563
|
+
get: function () {
|
|
1564
|
+
return this._value;
|
|
1565
|
+
},
|
|
1566
|
+
set: function (value) {
|
|
1567
|
+
this._value = value;
|
|
1568
|
+
this.mask = this.getMask();
|
|
1569
|
+
},
|
|
1570
|
+
enumerable: true,
|
|
1571
|
+
configurable: true
|
|
1572
|
+
});
|
|
1562
1573
|
CountryPhonePickerComponent.prototype.writeValue = function (value) {
|
|
1563
1574
|
this.value = value;
|
|
1575
|
+
if (value === null || value === void 0 ? void 0 : value.id) {
|
|
1576
|
+
var country = this._countriesList.filter(function (_a) {
|
|
1577
|
+
var id = _a.id;
|
|
1578
|
+
return id == value.id;
|
|
1579
|
+
});
|
|
1580
|
+
if (country.length) {
|
|
1581
|
+
this.onSelectItem(country[0]);
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1584
|
+
if (value === null || value === void 0 ? void 0 : value.rawValue) {
|
|
1585
|
+
this.phone.setValue(value.rawValue);
|
|
1586
|
+
}
|
|
1564
1587
|
};
|
|
1565
1588
|
CountryPhonePickerComponent.prototype.registerOnChange = function (onChange) {
|
|
1566
1589
|
this._onChange = onChange;
|
|
@@ -1581,28 +1604,30 @@
|
|
|
1581
1604
|
var countries = this.countryPhonePickerService.getCountries(this.ordination);
|
|
1582
1605
|
this.filter.valueChanges.subscribe(this._filterCountries);
|
|
1583
1606
|
if ((_a = this.countries) === null || _a === void 0 ? void 0 : _a.length) {
|
|
1584
|
-
this.
|
|
1607
|
+
this._countriesList = countries.filter(function (country) { return _this.countries.includes(country.id); });
|
|
1585
1608
|
}
|
|
1586
1609
|
else {
|
|
1587
|
-
this.
|
|
1610
|
+
this._countriesList = countries;
|
|
1588
1611
|
}
|
|
1589
|
-
this.filteredCountriesList = this.
|
|
1612
|
+
this.filteredCountriesList = this._countriesList;
|
|
1590
1613
|
this.selectedItem = this._getSelectedCountryDefault();
|
|
1614
|
+
this.mask = this.getMask();
|
|
1591
1615
|
this.phone.valueChanges.subscribe(function (value) {
|
|
1592
|
-
var _a;
|
|
1593
1616
|
_this.value = {
|
|
1594
1617
|
id: _this.selectedItem.id,
|
|
1595
1618
|
ddi: _this.selectedItem.ddi,
|
|
1596
1619
|
rawValue: value !== null && value !== void 0 ? value : "",
|
|
1597
1620
|
value: value ? "" + _this._applyMask(value) : "",
|
|
1598
1621
|
};
|
|
1599
|
-
(
|
|
1622
|
+
if (_this._onChange) {
|
|
1623
|
+
_this._onChange(_this.value);
|
|
1624
|
+
}
|
|
1600
1625
|
});
|
|
1601
1626
|
};
|
|
1602
1627
|
CountryPhonePickerComponent.prototype.onKeydown = function (event) {
|
|
1603
1628
|
if (event.key === "Enter" || event.key === " ") {
|
|
1604
1629
|
if (this.open) {
|
|
1605
|
-
this.selectedItem = this.
|
|
1630
|
+
this.selectedItem = this._countriesList[this.currentItemIndex];
|
|
1606
1631
|
this.selected.emit(this.selectedItem);
|
|
1607
1632
|
}
|
|
1608
1633
|
this.open = !this.open;
|
|
@@ -1632,13 +1657,13 @@
|
|
|
1632
1657
|
});
|
|
1633
1658
|
CountryPhonePickerComponent.prototype.onBlur = function () {
|
|
1634
1659
|
this.open = false;
|
|
1635
|
-
this.currentItemIndex = this.
|
|
1660
|
+
this.currentItemIndex = this._countriesList.indexOf(this.selectedItem);
|
|
1636
1661
|
};
|
|
1637
1662
|
CountryPhonePickerComponent.prototype.onSelectItem = function (country) {
|
|
1638
1663
|
this.open = false;
|
|
1639
1664
|
this.selectedItem = country;
|
|
1640
1665
|
this.phone.setValue("");
|
|
1641
|
-
this.currentItemIndex = this.
|
|
1666
|
+
this.currentItemIndex = this._countriesList.indexOf(this.selectedItem);
|
|
1642
1667
|
this.selected.emit(this.selectedItem);
|
|
1643
1668
|
};
|
|
1644
1669
|
CountryPhonePickerComponent.prototype.onCleanFilter = function () {
|
|
@@ -1648,9 +1673,10 @@
|
|
|
1648
1673
|
this.open = false;
|
|
1649
1674
|
};
|
|
1650
1675
|
CountryPhonePickerComponent.prototype.getMask = function () {
|
|
1676
|
+
var _a;
|
|
1651
1677
|
var mask = this.selectedItem.mask;
|
|
1652
1678
|
if (Array.isArray(mask)) {
|
|
1653
|
-
return !this.value || this.value.
|
|
1679
|
+
return !((_a = this.value) === null || _a === void 0 ? void 0 : _a.rawValue) || this.value.rawValue.length <= mask[0].replace(/[^0]/g, "").length
|
|
1654
1680
|
? mask[0] // fixo
|
|
1655
1681
|
: mask[1]; // celular
|
|
1656
1682
|
}
|
|
@@ -1659,14 +1685,14 @@
|
|
|
1659
1685
|
}
|
|
1660
1686
|
};
|
|
1661
1687
|
CountryPhonePickerComponent.prototype.getPlaceholder = function () {
|
|
1662
|
-
return this.
|
|
1688
|
+
return this.mask.replace(/9/g, "");
|
|
1663
1689
|
};
|
|
1664
1690
|
CountryPhonePickerComponent.prototype._getSelectedCountryDefault = function () {
|
|
1665
|
-
if (!this.
|
|
1691
|
+
if (!this._countriesList.length) {
|
|
1666
1692
|
throw new Error("No country loaded");
|
|
1667
1693
|
}
|
|
1668
|
-
var filteredByBr = this.
|
|
1669
|
-
return filteredByBr.length ? filteredByBr[0] : this.
|
|
1694
|
+
var filteredByBr = this._countriesList.filter(function (country) { return country.id === "br"; });
|
|
1695
|
+
return filteredByBr.length ? filteredByBr[0] : this._countriesList[0];
|
|
1670
1696
|
};
|
|
1671
1697
|
CountryPhonePickerComponent.prototype._moveToUp = function () {
|
|
1672
1698
|
if (this.currentItemIndex == 0) {
|
|
@@ -1681,7 +1707,7 @@
|
|
|
1681
1707
|
}
|
|
1682
1708
|
};
|
|
1683
1709
|
CountryPhonePickerComponent.prototype._moveToDown = function () {
|
|
1684
|
-
if (this.currentItemIndex >= this.
|
|
1710
|
+
if (this.currentItemIndex >= this._countriesList.length - 1) {
|
|
1685
1711
|
return;
|
|
1686
1712
|
}
|
|
1687
1713
|
this.currentItemIndex++;
|
|
@@ -1702,7 +1728,7 @@
|
|
|
1702
1728
|
: this.selectedItem.mask[1] + "\0";
|
|
1703
1729
|
}
|
|
1704
1730
|
else {
|
|
1705
|
-
mask = this.selectedItem.mask;
|
|
1731
|
+
mask = this.selectedItem.mask + "\0";
|
|
1706
1732
|
}
|
|
1707
1733
|
var tokens = "";
|
|
1708
1734
|
var replace = "";
|
|
@@ -1766,10 +1792,10 @@
|
|
|
1766
1792
|
CountryPhonePickerComponent = CountryPhonePickerComponent_1 = __decorate([
|
|
1767
1793
|
core.Component({
|
|
1768
1794
|
selector: "s-country-phone-picker",
|
|
1769
|
-
template: "<div class=\"country-phone-picker\">\n <div class=\"phone-input\">\n <div class=\"drop\" (click)=\"open = !open\">\n <span class=\"drop-flag\" [ngClass]=\"'fi fi-' + selectedItem.id\">\n </span>\n <span class=\"drop-icon fas fa-caret-down\"></span>\n </div>\n <p class=\"phone-ddi\">{{ selectedItem.ddi }}</p>\n <input\n #phoneInput\n type=\"tel\"\n autofocus\n [mask]=\"
|
|
1795
|
+
template: "<div class=\"country-phone-picker\">\n <div class=\"phone-input\">\n <div class=\"drop\" (click)=\"open = !open\">\n <span class=\"drop-flag\" [ngClass]=\"'fi fi-' + selectedItem.id\">\n </span>\n <span class=\"drop-icon fas fa-caret-down\"></span>\n </div>\n <p class=\"phone-ddi\">{{ selectedItem.ddi }}</p>\n <input\n #phoneInput\n type=\"tel\"\n autofocus\n [mask]=\"mask\" \n [placeholder]=\"getPlaceholder()\"\n [formControl]=\"phone\"\n (focus)=\"onPhoneInputFocus()\" />\n </div>\n <div *ngIf=\"open\" class=\"dropdown\">\n <div class=\"search\">\n <input\n class=\"search-field\"\n type=\"text\"\n [formControl]=\"filter\">\n <span class=\"search-icon fas fa-search\"></span>\n <span\n class=\"search-clear fa fa-times\"\n (click)=\"onCleanFilter()\"></span>\n </div>\n <ul class=\"select-list\">\n <li\n *ngFor=\"let country of filteredCountriesList; let i = index;\"\n class=\"select-option\"\n [ngClass]=\"{ 'select-option--focused': i == currentItemIndex }\"\n (click)=\"onSelectItem(country)\">\n <span\n class=\"select-option__flag\"\n [ngClass]=\"'fi fi-' + country.id\">\n </span>\n <span class=\"select-option__name\">\n {{ \"platform.angular_components.country_name_\" + country.id | translate }}\n </span>\n <span class=\"select-option__ddi\">\n {{ country.ddi }}\n </span>\n </li>\n </ul>\n </div>\n</div>",
|
|
1770
1796
|
providers: [{
|
|
1771
1797
|
provide: forms.NG_VALUE_ACCESSOR,
|
|
1772
|
-
useExisting: CountryPhonePickerComponent_1,
|
|
1798
|
+
useExisting: core.forwardRef(function () { return CountryPhonePickerComponent_1; }),
|
|
1773
1799
|
multi: true,
|
|
1774
1800
|
}],
|
|
1775
1801
|
styles: [".country-phone-picker .phone-input{background-color:#fff;border:1px solid #d8d8d8;border-radius:4px;display:-ms-flexbox;display:flex;line-height:normal}.country-phone-picker .phone-input .drop{-ms-flex-align:center;align-items:center;cursor:pointer;display:-ms-flexbox;display:flex}.country-phone-picker .phone-input .drop .drop-flag{margin-left:12px}.country-phone-picker .phone-input .drop .drop-icon{font-size:12px;margin:0 8px}.country-phone-picker .phone-input .phone-ddi{margin:8px 0}.country-phone-picker .phone-input input{border:none;-ms-flex-positive:1;flex-grow:1;font-family:\"Open Sans\",sans-serif;font-size:14px;font-weight:400;line-height:150%;margin-left:8px}.country-phone-picker .phone-input input:focus{color:#697882;outline:0}.country-phone-picker .dropdown{background-color:#fff;border-radius:4px;box-shadow:0 4px 5px #00000033;padding:4px 0;position:absolute;margin:2px 0;z-index:999999}.country-phone-picker .dropdown .search{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;padding:8px 12px}.country-phone-picker .dropdown .search .search-field{border:1px solid #d8d8d8;border-radius:4px;-ms-flex-positive:1;flex-grow:1;font-family:\"Open Sans\",sans-serif;font-size:14px;font-weight:400;height:36px;line-height:150%;padding:0 32px 0 8px}.country-phone-picker .dropdown .search .search-icon{color:#333;font-size:12px;position:relative;right:24px}.country-phone-picker .dropdown .search .search-clear{color:#333;cursor:pointer;font-size:1rem}.country-phone-picker .dropdown .select-list{list-style:none;max-height:234px;min-width:360px;max-width:100vw;overflow:scroll;padding:0}.country-phone-picker .dropdown .select-list .select-option{cursor:pointer;display:-ms-flexbox;display:flex;padding:12px;-webkit-user-select:none;-ms-user-select:none;user-select:none}.country-phone-picker .dropdown .select-list .select-option .select-option__flag{margin-right:12px}.country-phone-picker .dropdown .select-list .select-option .select-option__name{margin-right:.5rem;max-width:100%;overflow:hidden;text-overflow:ellipsis}.country-phone-picker .dropdown .select-list .select-option .select-option__ddi{color:#697882;font-size:14px;font-family:\"Open Sans\",sans-serif;font-weight:400;line-height:150%}.country-phone-picker .dropdown .select-list .select-option--focused,.country-phone-picker .dropdown .select-list .select-option:hover{background-color:#e5eaea}"]
|
|
@@ -4203,11 +4229,11 @@
|
|
|
4203
4229
|
.then(function (metadata) { return _this.setModifiedDate(metadata); });
|
|
4204
4230
|
};
|
|
4205
4231
|
FileUploadComponent.prototype.setModifiedDate = function (metadata) {
|
|
4206
|
-
var hour = moment$4(metadata.modified).
|
|
4207
|
-
var minutes = moment$4(metadata.modified).
|
|
4208
|
-
var day = moment$4(metadata.modified).
|
|
4209
|
-
var month = moment$4(metadata.modified).
|
|
4210
|
-
var fullYear = moment$4(metadata.modified).
|
|
4232
|
+
var hour = moment$4(metadata.modified).format("HH");
|
|
4233
|
+
var minutes = moment$4(metadata.modified).format("mm");
|
|
4234
|
+
var day = moment$4(metadata.modified).format("DD");
|
|
4235
|
+
var month = moment$4(metadata.modified).format("MM");
|
|
4236
|
+
var fullYear = moment$4(metadata.modified).format("YYYY");
|
|
4211
4237
|
this.modifiedDate = this.translate.instant("platform.angular_components.date_modified_custom_blob", { hour: hour, minutes: minutes, day: day, month: month, fullYear: fullYear });
|
|
4212
4238
|
};
|
|
4213
4239
|
var FileUploadComponent_1;
|