ngx-ode-ui 4.3.0 → 4.5.0-dev.0

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.
@@ -605,6 +605,7 @@
605
605
  _this.labelsService = labelsService;
606
606
  _this.innerValue = '';
607
607
  _this.disabled = false;
608
+ _this._readonly = false;
608
609
  _this.enableTime = false;
609
610
  _this.placeholder = '';
610
611
  _this.changeDate = new core.EventEmitter();
@@ -640,6 +641,30 @@
640
641
  enumerable: true,
641
642
  configurable: true
642
643
  });
644
+ Object.defineProperty(DatepickerComponent.prototype, "readonly", {
645
+ get: /**
646
+ * @return {?}
647
+ */
648
+ function () {
649
+ return this._readonly;
650
+ },
651
+ set: /**
652
+ * @param {?} val
653
+ * @return {?}
654
+ */
655
+ function (val) {
656
+ this._readonly = val;
657
+ if (this.datePickerInst && this.datePickerInst.altInput) {
658
+ // Apply the readonly attribute addition/removal to the visible input (wrapped)
659
+ if (val)
660
+ this.datePickerInst.altInput.setAttribute('readonly', "");
661
+ else
662
+ this.datePickerInst.altInput.removeAttribute('readonly');
663
+ }
664
+ },
665
+ enumerable: true,
666
+ configurable: true
667
+ });
643
668
  /**
644
669
  * @return {?}
645
670
  */
@@ -647,6 +672,7 @@
647
672
  * @return {?}
648
673
  */
649
674
  function () {
675
+ var _this = this;
650
676
  _super.prototype.ngAfterViewInit.call(this);
651
677
  // add attr data-input, mandatory for the picker to work in wrap mode
652
678
  this.renderer.setAttribute(this.inputElement.nativeElement, 'data-input', '');
@@ -673,12 +699,25 @@
673
699
  enableTime: this.enableTime,
674
700
  minDate: this.minDate,
675
701
  maxDate: this.maxDate,
676
- clickOpens: !this.disabled,
702
+ clickOpens: false,
677
703
  wrap: true,
678
704
  // to add input decoration (calendar icon and delete icon)
679
705
  locale: datePickerLocale
680
706
  };
681
707
  this.datePickerInst = new Flatpickr(this.datePickerElement.nativeElement, options);
708
+ if (!this.disabled) {
709
+ this.datePickerInst.altInput.addEventListener('click', (/**
710
+ * @param {?} e
711
+ * @return {?}
712
+ */
713
+ function (e) {
714
+ if (!_this.readonly) {
715
+ _this.datePickerInst.toggle();
716
+ }
717
+ }));
718
+ }
719
+ // Force updating the date input readonly attribute :
720
+ this.readonly = this._readonly;
682
721
  };
683
722
  /**
684
723
  * @return {?}
@@ -741,8 +780,9 @@
741
780
  DatepickerComponent.decorators = [
742
781
  { type: core.Component, args: [{
743
782
  selector: 'ode-date-picker',
744
- template: "<div class=\"flatpickr\" #datePickerElement>\n <input type=\"date\" [(ngModel)]=\"value\" [ngClass]=\"{ 'cursor-default': disabled }\" placeholder=\"{{ placeholder }}\" #inputRef>\n <a *ngIf=\"!disabled\" data-toggle [title]=\"labels('datepicker.open')\"><i class=\"fa fa-calendar open\" aria-hidden=\"true\"></i></a>\n <a *ngIf=\"!disabled\" data-clear [title]=\"labels('datepicker.delete')\"><i class=\"fa fa-times delete\" aria-hidden=\"true\"></i></a>\n</div>\n",
745
- providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR]
783
+ template: "<div class=\"flatpickr\" #datePickerElement>\n <input type=\"date\" [(ngModel)]=\"value\" [disabled]=\"disabled\" [ngClass]=\"{ 'cursor-default': disabled }\" placeholder=\"{{ placeholder }}\" #inputRef>\n <a *ngIf=\"!disabled\" [class.hidden]=\"readonly\" data-toggle [title]=\"labels('datepicker.open')\"><i class=\"fa fa-calendar open\" aria-hidden=\"true\"></i></a>\n <a *ngIf=\"!disabled\" [class.hidden]=\"readonly\" data-clear [title]=\"labels('datepicker.delete')\"><i class=\"fa fa-times delete\" aria-hidden=\"true\"></i></a>\n</div>\n",
784
+ providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR],
785
+ styles: [".hidden{visibility:hidden}"]
746
786
  }] }
747
787
  ];
748
788
  /** @nocollapse */
@@ -756,6 +796,7 @@
756
796
  inputElement: [{ type: core.ViewChild, args: ['inputRef', { static: false },] }],
757
797
  model: [{ type: core.ViewChild, args: [forms.NgModel, { static: false },] }],
758
798
  disabled: [{ type: core.Input }],
799
+ readonly: [{ type: core.Input }],
759
800
  enableTime: [{ type: core.Input }],
760
801
  placeholder: [{ type: core.Input }],
761
802
  minDate: [{ type: core.Input }],
@@ -784,6 +825,8 @@
784
825
  /** @type {?} */
785
826
  DatepickerComponent.prototype.disabled;
786
827
  /** @type {?} */
828
+ DatepickerComponent.prototype._readonly;
829
+ /** @type {?} */
787
830
  DatepickerComponent.prototype.enableTime;
788
831
  /** @type {?} */
789
832
  DatepickerComponent.prototype.placeholder;
@@ -3254,10 +3297,20 @@
3254
3297
  function (str) {
3255
3298
  this.$searchTerms.next(str);
3256
3299
  };
3300
+ /**
3301
+ * @return {?}
3302
+ */
3303
+ SearchInputComponent.prototype.handleSubmit = /**
3304
+ * @return {?}
3305
+ */
3306
+ function () {
3307
+ this.searchSubmit();
3308
+ this.searchBox.nativeElement.value = '';
3309
+ };
3257
3310
  SearchInputComponent.decorators = [
3258
3311
  { type: core.Component, args: [{
3259
3312
  selector: 'ode-search-input',
3260
- template: "<form\n class=\"search-container\"\n (ngSubmit)=\"searchInput && searchSubmit()\">\n <input\n #searchBox\n class=\"search-input\"\n name=\"searchTerm\"\n type=\"search\"\n (input)=\"search(searchBox.value)\" />\n <button class=\"search-button\" *ngIf=\"searchInput\" [attr.disabled]=\"isSearchButtonDisabled ? true : null\">\n <i class=\"fa fa-search is-size-4 search-icon\"></i>\n </button>\n</form>\n\n<!-- <input *ngIf=\"!searchInput\" type=\"search\" #searchBox (input)=\"search(searchBox.value)\"/> -->",
3313
+ template: "<form\n class=\"search-container\"\n (ngSubmit)=\"searchInput && handleSubmit()\">\n <input\n #searchBox\n class=\"search-input\"\n name=\"searchTerm\"\n type=\"search\"\n (input)=\"search(searchBox.value)\" />\n <button class=\"search-button\" *ngIf=\"searchInput\" [attr.disabled]=\"isSearchButtonDisabled ? true : null\">\n <i class=\"fa fa-search is-size-4 search-icon\"></i>\n </button>\n</form>\n\n<!-- <input *ngIf=\"!searchInput\" type=\"search\" #searchBox (input)=\"search(searchBox.value)\"/> -->",
3261
3314
  styles: [":host .search-container{margin:0;display:flex}:host .search-icon{padding-left:0}:host .search-button{margin:0;background:#ff8352;color:#fff}"]
3262
3315
  }] }
3263
3316
  ];