@main-class/componentes 1.19.8 → 1.19.11

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.
@@ -535,6 +535,14 @@
535
535
  }
536
536
  this.stateChanges.next();
537
537
  };
538
+ InputDatetimeComponent.prototype.validate = function (control) {
539
+ if (!!control.value) {
540
+ if (isNaN(control.value)) {
541
+ return { date: true };
542
+ }
543
+ }
544
+ return null;
545
+ };
538
546
  return InputDatetimeComponent;
539
547
  }(AbstractMatFormFieldControl));
540
548
  InputDatetimeComponent.decorators = [
@@ -545,6 +553,11 @@
545
553
  {
546
554
  provide: formField.MatFormFieldControl,
547
555
  useExisting: InputDatetimeComponent
556
+ },
557
+ {
558
+ provide: forms.NG_VALIDATORS,
559
+ useExisting: InputDatetimeComponent,
560
+ multi: true
548
561
  }
549
562
  ],
550
563
  styles: [".dateinput{display:flex}.dateinput input{flex:1 1 auto}.dateinput mat-datetimepicker-toggle{margin:-16px 0 -6px}.hidden{display:none}"]
@@ -1707,6 +1720,231 @@
1707
1720
  },] }
1708
1721
  ];
1709
1722
 
1723
+ var SelectChipsAutocompleteComponent = /** @class */ (function () {
1724
+ function SelectChipsAutocompleteComponent(errorStateMatcher, ngControl, parentForm, parentFormGroup) {
1725
+ var _this = this;
1726
+ this.errorStateMatcher = errorStateMatcher;
1727
+ this.ngControl = ngControl;
1728
+ this.parentForm = parentForm;
1729
+ this.parentFormGroup = parentFormGroup;
1730
+ this.$disabled = false;
1731
+ this.$required = false;
1732
+ this.focused = false;
1733
+ this.filterCtrl = new forms.FormControl();
1734
+ this.stateChanges = new rxjs.Subject();
1735
+ this.id = "select-chips-autocomplete-" + SelectChipsAutocompleteComponent.nextId++;
1736
+ this.describedBy = '';
1737
+ this.search = new core.EventEmitter();
1738
+ this.onChange = function (val) {
1739
+ };
1740
+ this.onTouched = function () {
1741
+ };
1742
+ if (this.ngControl != null) {
1743
+ this.ngControl.valueAccessor = this;
1744
+ }
1745
+ this.filterCtrl.valueChanges.pipe(operators.startWith(null), operators.map(function (filtro) { return _this._filter(filtro); }));
1746
+ }
1747
+ SelectChipsAutocompleteComponent.prototype.ngAfterViewInit = function () {
1748
+ var _this = this;
1749
+ this.opcoesFiltradas = this.opcoes.changes
1750
+ .pipe(operators.map(function () { return _this.opcoes.toArray(); }));
1751
+ };
1752
+ Object.defineProperty(SelectChipsAutocompleteComponent.prototype, "value", {
1753
+ get: function () {
1754
+ return this.$value;
1755
+ },
1756
+ set: function (value) {
1757
+ this.$value = value;
1758
+ this.stateChanges.next();
1759
+ },
1760
+ enumerable: false,
1761
+ configurable: true
1762
+ });
1763
+ Object.defineProperty(SelectChipsAutocompleteComponent.prototype, "empty", {
1764
+ get: function () {
1765
+ return !this.value;
1766
+ },
1767
+ enumerable: false,
1768
+ configurable: true
1769
+ });
1770
+ SelectChipsAutocompleteComponent.prototype.onContainerClick = function (event) {
1771
+ };
1772
+ Object.defineProperty(SelectChipsAutocompleteComponent.prototype, "shouldLabelFloat", {
1773
+ get: function () {
1774
+ return !this.empty || (this.input && this.input.nativeElement.value) || this.focused;
1775
+ },
1776
+ enumerable: false,
1777
+ configurable: true
1778
+ });
1779
+ Object.defineProperty(SelectChipsAutocompleteComponent.prototype, "placeholder", {
1780
+ get: function () {
1781
+ return this.$placeholder;
1782
+ },
1783
+ set: function (plh) {
1784
+ this.$placeholder = plh;
1785
+ this.stateChanges.next();
1786
+ },
1787
+ enumerable: false,
1788
+ configurable: true
1789
+ });
1790
+ Object.defineProperty(SelectChipsAutocompleteComponent.prototype, "required", {
1791
+ get: function () {
1792
+ return this.$required;
1793
+ },
1794
+ set: function (value) {
1795
+ this.$required = coercion.coerceBooleanProperty(value);
1796
+ this.stateChanges.next();
1797
+ },
1798
+ enumerable: false,
1799
+ configurable: true
1800
+ });
1801
+ Object.defineProperty(SelectChipsAutocompleteComponent.prototype, "disabled", {
1802
+ get: function () {
1803
+ return this.$disabled;
1804
+ },
1805
+ set: function (value) {
1806
+ this.$disabled = coercion.coerceBooleanProperty(value);
1807
+ this.stateChanges.next();
1808
+ },
1809
+ enumerable: false,
1810
+ configurable: true
1811
+ });
1812
+ Object.defineProperty(SelectChipsAutocompleteComponent.prototype, "errorState", {
1813
+ get: function () {
1814
+ return this.errorStateMatcher.isErrorState(this.ngControl.control, this.parentFormGroup || this.parentForm);
1815
+ },
1816
+ enumerable: false,
1817
+ configurable: true
1818
+ });
1819
+ Object.defineProperty(SelectChipsAutocompleteComponent.prototype, "controlType", {
1820
+ get: function () {
1821
+ return 'select-chips-autocomplete';
1822
+ },
1823
+ enumerable: false,
1824
+ configurable: true
1825
+ });
1826
+ SelectChipsAutocompleteComponent.prototype.setDescribedByIds = function (ids) {
1827
+ this.describedBy = ids.join(' ');
1828
+ };
1829
+ SelectChipsAutocompleteComponent.prototype.ngOnDestroy = function () {
1830
+ this.stateChanges.complete();
1831
+ };
1832
+ SelectChipsAutocompleteComponent.prototype.registerOnTouched = function (fn) {
1833
+ this.onTouched = fn;
1834
+ };
1835
+ SelectChipsAutocompleteComponent.prototype.registerOnChange = function (fn) {
1836
+ this.onChange = fn;
1837
+ };
1838
+ SelectChipsAutocompleteComponent.prototype.setDisabledState = function (isDisabled) {
1839
+ this.disabled = isDisabled;
1840
+ };
1841
+ SelectChipsAutocompleteComponent.prototype.writeValue = function (value) {
1842
+ this.value = value;
1843
+ this.filterCtrl.setValue(this.filterCtrl.value);
1844
+ };
1845
+ SelectChipsAutocompleteComponent.prototype.add = function (event) {
1846
+ this.onTouched();
1847
+ var input = event.input;
1848
+ var value = event.value;
1849
+ var selected = util.StringUtil.normalize((value || ''));
1850
+ var opcao = this.opcoes.toArray()
1851
+ .find(function (op) { return util.StringUtil.normalize(op.label) === selected; });
1852
+ if (opcao) {
1853
+ if (!this.value || !this.value.find(function (v) { return v === opcao.value; })) {
1854
+ this.value = __spread((this.value || []), [
1855
+ opcao.value
1856
+ ]);
1857
+ this.onChange(this.value);
1858
+ }
1859
+ if (input) {
1860
+ input.value = '';
1861
+ }
1862
+ this.filterCtrl.setValue(null);
1863
+ }
1864
+ };
1865
+ SelectChipsAutocompleteComponent.prototype.remove = function (item) {
1866
+ this.onTouched();
1867
+ if (this.value) {
1868
+ var index = this.value.indexOf(item);
1869
+ if (index >= 0) {
1870
+ this.value.splice(index, 1);
1871
+ }
1872
+ if (!this.value.length) {
1873
+ this.value = undefined;
1874
+ }
1875
+ this.onChange(this.value);
1876
+ }
1877
+ };
1878
+ SelectChipsAutocompleteComponent.prototype.selected = function (event) {
1879
+ this.onTouched();
1880
+ if (!this.value || !this.value.find(function (v) { return v === event.option.value; })) {
1881
+ this.value = __spread((this.value || []), [
1882
+ event.option.value
1883
+ ]);
1884
+ this.onChange(this.value);
1885
+ }
1886
+ this.filterInput.nativeElement.value = '';
1887
+ this.filterCtrl.setValue(null);
1888
+ };
1889
+ SelectChipsAutocompleteComponent.prototype._filter = function (filtro) {
1890
+ this.search.emit(filtro);
1891
+ };
1892
+ return SelectChipsAutocompleteComponent;
1893
+ }());
1894
+ SelectChipsAutocompleteComponent.nextId = 0;
1895
+ SelectChipsAutocompleteComponent.decorators = [
1896
+ { type: core.Component, args: [{
1897
+ selector: 'mcl-select-chips-autocomplete',
1898
+ template: "<mat-chip-list #chipList >\n <mat-chip\n *ngFor=\"let item of value\"\n [removable]=\"!disabled\"\n (removed)=\"remove(item)\">\n {{item}}\n <mat-icon matChipRemove *ngIf=\"!disabled\" >cancel</mat-icon>\n </mat-chip>\n <input\n [placeholder]=\"placeholder\"\n #filterInput required\n (focusin)=\"focused = true\"\n (focusout)=\"focused = false\"\n [formControl]=\"filterCtrl\"\n [matAutocomplete]=\"filterAutocomplete\"\n [matChipInputFor]=\"chipList\"\n (matChipInputTokenEnd)=\"add($event)\">\n</mat-chip-list>\n<mat-autocomplete #filterAutocomplete=\"matAutocomplete\" (optionSelected)=\"selected($event)\">\n <mat-option *ngFor=\"let opcao of opcoesFiltradas | async\" [value]=\"opcao.value\">\n {{opcao.label}}\n </mat-option>\n</mat-autocomplete>\n",
1899
+ providers: [
1900
+ {
1901
+ provide: formField.MatFormFieldControl,
1902
+ useExisting: SelectChipsAutocompleteComponent
1903
+ }
1904
+ ],
1905
+ styles: [""]
1906
+ },] }
1907
+ ];
1908
+ SelectChipsAutocompleteComponent.ctorParameters = function () { return [
1909
+ { type: core$1.ErrorStateMatcher },
1910
+ { type: forms.NgControl, decorators: [{ type: core.Optional }, { type: core.Self }] },
1911
+ { type: forms.NgForm, decorators: [{ type: core.Optional }] },
1912
+ { type: forms.FormGroupDirective, decorators: [{ type: core.Optional }] }
1913
+ ]; };
1914
+ SelectChipsAutocompleteComponent.propDecorators = {
1915
+ input: [{ type: core.ViewChild, args: ['input',] }],
1916
+ id: [{ type: core.HostBinding }],
1917
+ describedBy: [{ type: core.HostBinding, args: ['attr.aria-describedby',] }],
1918
+ opcoes: [{ type: core.ContentChildren, args: [SelectItemComponent,] }],
1919
+ filterInput: [{ type: core.ViewChild, args: ['filterInput',] }],
1920
+ filterAutocomplete: [{ type: core.ViewChild, args: ['filterAutocomplete',] }],
1921
+ search: [{ type: core.Output }],
1922
+ shouldLabelFloat: [{ type: core.HostBinding, args: ['class.floating',] }],
1923
+ placeholder: [{ type: core.Input }],
1924
+ required: [{ type: core.Input }],
1925
+ disabled: [{ type: core.Input }]
1926
+ };
1927
+
1928
+ var SelectChipsAutocompleteModule = /** @class */ (function () {
1929
+ function SelectChipsAutocompleteModule() {
1930
+ }
1931
+ return SelectChipsAutocompleteModule;
1932
+ }());
1933
+ SelectChipsAutocompleteModule.decorators = [
1934
+ { type: core.NgModule, args: [{
1935
+ declarations: [SelectChipsAutocompleteComponent],
1936
+ exports: [SelectChipsAutocompleteComponent, SelectItemModule],
1937
+ imports: [
1938
+ common.CommonModule,
1939
+ icon.MatIconModule,
1940
+ forms.ReactiveFormsModule,
1941
+ autocomplete.MatAutocompleteModule,
1942
+ SelectItemModule,
1943
+ chips.MatChipsModule,
1944
+ ],
1945
+ },] }
1946
+ ];
1947
+
1710
1948
  var SelectManyCheckboxComponent = /** @class */ (function () {
1711
1949
  function SelectManyCheckboxComponent(errorStateMatcher, ngControl, parentForm, parentFormGroup) {
1712
1950
  this.errorStateMatcher = errorStateMatcher;
@@ -2234,6 +2472,8 @@
2234
2472
  exports.OptionCheckboxComponent = OptionCheckboxComponent;
2235
2473
  exports.OptionCheckboxGroupComponent = OptionCheckboxGroupComponent;
2236
2474
  exports.OptionCheckboxModule = OptionCheckboxModule;
2475
+ exports.SelectChipsAutocompleteComponent = SelectChipsAutocompleteComponent;
2476
+ exports.SelectChipsAutocompleteModule = SelectChipsAutocompleteModule;
2237
2477
  exports.SelectChipsComponent = SelectChipsComponent;
2238
2478
  exports.SelectChipsModule = SelectChipsModule;
2239
2479
  exports.SelectItemComponent = SelectItemComponent;