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.
- package/bundles/ngx-ode-ui.umd.js +57 -4
- package/bundles/ngx-ode-ui.umd.js.map +1 -1
- package/bundles/ngx-ode-ui.umd.min.js +1 -1
- package/bundles/ngx-ode-ui.umd.min.js.map +1 -1
- package/esm2015/lib/components/datepicker/datepicker.component.js +42 -4
- package/esm2015/lib/components/search-input/search-input.component.js +9 -2
- package/esm5/lib/components/datepicker/datepicker.component.js +47 -4
- package/esm5/lib/components/search-input/search-input.component.js +12 -2
- package/fesm2015/ngx-ode-ui.js +49 -4
- package/fesm2015/ngx-ode-ui.js.map +1 -1
- package/fesm5/ngx-ode-ui.js +57 -4
- package/fesm5/ngx-ode-ui.js.map +1 -1
- package/lib/components/datepicker/datepicker.component.d.ts +2 -0
- package/lib/components/search-input/search-input.component.d.ts +1 -0
- package/ngx-ode-ui.metadata.json +1 -1
- package/package.json +1 -1
package/fesm5/ngx-ode-ui.js
CHANGED
|
@@ -411,6 +411,7 @@ var DatepickerComponent = /** @class */ (function (_super) {
|
|
|
411
411
|
_this.labelsService = labelsService;
|
|
412
412
|
_this.innerValue = '';
|
|
413
413
|
_this.disabled = false;
|
|
414
|
+
_this._readonly = false;
|
|
414
415
|
_this.enableTime = false;
|
|
415
416
|
_this.placeholder = '';
|
|
416
417
|
_this.changeDate = new EventEmitter();
|
|
@@ -446,6 +447,30 @@ var DatepickerComponent = /** @class */ (function (_super) {
|
|
|
446
447
|
enumerable: true,
|
|
447
448
|
configurable: true
|
|
448
449
|
});
|
|
450
|
+
Object.defineProperty(DatepickerComponent.prototype, "readonly", {
|
|
451
|
+
get: /**
|
|
452
|
+
* @return {?}
|
|
453
|
+
*/
|
|
454
|
+
function () {
|
|
455
|
+
return this._readonly;
|
|
456
|
+
},
|
|
457
|
+
set: /**
|
|
458
|
+
* @param {?} val
|
|
459
|
+
* @return {?}
|
|
460
|
+
*/
|
|
461
|
+
function (val) {
|
|
462
|
+
this._readonly = val;
|
|
463
|
+
if (this.datePickerInst && this.datePickerInst.altInput) {
|
|
464
|
+
// Apply the readonly attribute addition/removal to the visible input (wrapped)
|
|
465
|
+
if (val)
|
|
466
|
+
this.datePickerInst.altInput.setAttribute('readonly', "");
|
|
467
|
+
else
|
|
468
|
+
this.datePickerInst.altInput.removeAttribute('readonly');
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
enumerable: true,
|
|
472
|
+
configurable: true
|
|
473
|
+
});
|
|
449
474
|
/**
|
|
450
475
|
* @return {?}
|
|
451
476
|
*/
|
|
@@ -453,6 +478,7 @@ var DatepickerComponent = /** @class */ (function (_super) {
|
|
|
453
478
|
* @return {?}
|
|
454
479
|
*/
|
|
455
480
|
function () {
|
|
481
|
+
var _this = this;
|
|
456
482
|
_super.prototype.ngAfterViewInit.call(this);
|
|
457
483
|
// add attr data-input, mandatory for the picker to work in wrap mode
|
|
458
484
|
this.renderer.setAttribute(this.inputElement.nativeElement, 'data-input', '');
|
|
@@ -479,12 +505,25 @@ var DatepickerComponent = /** @class */ (function (_super) {
|
|
|
479
505
|
enableTime: this.enableTime,
|
|
480
506
|
minDate: this.minDate,
|
|
481
507
|
maxDate: this.maxDate,
|
|
482
|
-
clickOpens:
|
|
508
|
+
clickOpens: false,
|
|
483
509
|
wrap: true,
|
|
484
510
|
// to add input decoration (calendar icon and delete icon)
|
|
485
511
|
locale: datePickerLocale
|
|
486
512
|
};
|
|
487
513
|
this.datePickerInst = new Flatpickr(this.datePickerElement.nativeElement, options);
|
|
514
|
+
if (!this.disabled) {
|
|
515
|
+
this.datePickerInst.altInput.addEventListener('click', (/**
|
|
516
|
+
* @param {?} e
|
|
517
|
+
* @return {?}
|
|
518
|
+
*/
|
|
519
|
+
function (e) {
|
|
520
|
+
if (!_this.readonly) {
|
|
521
|
+
_this.datePickerInst.toggle();
|
|
522
|
+
}
|
|
523
|
+
}));
|
|
524
|
+
}
|
|
525
|
+
// Force updating the date input readonly attribute :
|
|
526
|
+
this.readonly = this._readonly;
|
|
488
527
|
};
|
|
489
528
|
/**
|
|
490
529
|
* @return {?}
|
|
@@ -547,8 +586,9 @@ var DatepickerComponent = /** @class */ (function (_super) {
|
|
|
547
586
|
DatepickerComponent.decorators = [
|
|
548
587
|
{ type: Component, args: [{
|
|
549
588
|
selector: 'ode-date-picker',
|
|
550
|
-
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",
|
|
551
|
-
providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR]
|
|
589
|
+
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",
|
|
590
|
+
providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR],
|
|
591
|
+
styles: [".hidden{visibility:hidden}"]
|
|
552
592
|
}] }
|
|
553
593
|
];
|
|
554
594
|
/** @nocollapse */
|
|
@@ -562,6 +602,7 @@ var DatepickerComponent = /** @class */ (function (_super) {
|
|
|
562
602
|
inputElement: [{ type: ViewChild, args: ['inputRef', { static: false },] }],
|
|
563
603
|
model: [{ type: ViewChild, args: [NgModel, { static: false },] }],
|
|
564
604
|
disabled: [{ type: Input }],
|
|
605
|
+
readonly: [{ type: Input }],
|
|
565
606
|
enableTime: [{ type: Input }],
|
|
566
607
|
placeholder: [{ type: Input }],
|
|
567
608
|
minDate: [{ type: Input }],
|
|
@@ -590,6 +631,8 @@ if (false) {
|
|
|
590
631
|
/** @type {?} */
|
|
591
632
|
DatepickerComponent.prototype.disabled;
|
|
592
633
|
/** @type {?} */
|
|
634
|
+
DatepickerComponent.prototype._readonly;
|
|
635
|
+
/** @type {?} */
|
|
593
636
|
DatepickerComponent.prototype.enableTime;
|
|
594
637
|
/** @type {?} */
|
|
595
638
|
DatepickerComponent.prototype.placeholder;
|
|
@@ -3060,10 +3103,20 @@ var SearchInputComponent = /** @class */ (function (_super) {
|
|
|
3060
3103
|
function (str) {
|
|
3061
3104
|
this.$searchTerms.next(str);
|
|
3062
3105
|
};
|
|
3106
|
+
/**
|
|
3107
|
+
* @return {?}
|
|
3108
|
+
*/
|
|
3109
|
+
SearchInputComponent.prototype.handleSubmit = /**
|
|
3110
|
+
* @return {?}
|
|
3111
|
+
*/
|
|
3112
|
+
function () {
|
|
3113
|
+
this.searchSubmit();
|
|
3114
|
+
this.searchBox.nativeElement.value = '';
|
|
3115
|
+
};
|
|
3063
3116
|
SearchInputComponent.decorators = [
|
|
3064
3117
|
{ type: Component, args: [{
|
|
3065
3118
|
selector: 'ode-search-input',
|
|
3066
|
-
template: "<form\n class=\"search-container\"\n (ngSubmit)=\"searchInput &&
|
|
3119
|
+
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)\"/> -->",
|
|
3067
3120
|
styles: [":host .search-container{margin:0;display:flex}:host .search-icon{padding-left:0}:host .search-button{margin:0;background:#ff8352;color:#fff}"]
|
|
3068
3121
|
}] }
|
|
3069
3122
|
];
|