ng-tailwind 4.0.0 → 4.0.1
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/ng-tailwind.umd.js +60 -90
- package/bundles/ng-tailwind.umd.js.map +1 -1
- package/components/ngt-checkbox/ngt-checkbox.component.d.ts +2 -0
- package/components/ngt-datatable/ngt-datatable.component.d.ts +1 -1
- package/components/ngt-dropzone/ngt-dropzone.component.d.ts +1 -0
- package/esm2015/components/ngt-checkbox/ngt-checkbox.component.js +8 -4
- package/esm2015/components/ngt-datatable/ngt-datatable.component.js +31 -22
- package/esm2015/components/ngt-dropzone/ngt-dropzone.component.js +17 -4
- package/esm2015/components/ngt-svg/ngt-svg.module.js +4 -4
- package/fesm2015/ng-tailwind.js +55 -29
- package/fesm2015/ng-tailwind.js.map +1 -1
- package/ng-tailwind.metadata.json +1 -1
- package/package.json +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@angular/animations'), require('@angular/router'), require('rxjs'), require('angular
|
|
3
|
-
typeof define === 'function' && define.amd ? define('ng-tailwind', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@angular/animations', '@angular/router', 'rxjs', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["ng-tailwind"] = {}, global.ng.common, global.ng.core, global.ng.forms, global.ng.animations, global.ng.router, global.rxjs, global["angular-svg-icon"], global
|
|
5
|
-
})(this, (function (exports, common, core, forms, animations, router, rxjs,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@angular/animations'), require('@angular/router'), require('rxjs'), require('@angular/common/http'), require('angular-svg-icon'), require('@ng-select/ng-select'), require('ng2-flatpickr'), require('eloverde-doc-viewer'), require('ngx-dropzone'), require('ngx-viewer'), require('@angular/platform-browser'), require('rxjs/operators'), require('viewerjs')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('ng-tailwind', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@angular/animations', '@angular/router', 'rxjs', '@angular/common/http', 'angular-svg-icon', '@ng-select/ng-select', 'ng2-flatpickr', 'eloverde-doc-viewer', 'ngx-dropzone', 'ngx-viewer', '@angular/platform-browser', 'rxjs/operators', 'viewerjs'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["ng-tailwind"] = {}, global.ng.common, global.ng.core, global.ng.forms, global.ng.animations, global.ng.router, global.rxjs, global.ng.common.http, global["angular-svg-icon"], global["@ng-select/ng-select"], global["ng2-flatpickr"], global["eloverde-doc-viewer"], global["ngx-dropzone"], global["ngx-viewer"], global.ng.platformBrowser, global.rxjs.operators, global.viewerjs));
|
|
5
|
+
})(this, (function (exports, common, core, forms, animations, router, rxjs, http, angularSvgIcon, ngSelect, ng2Flatpickr, eloverdeDocViewer, ngxDropzone, ngxViewer, platformBrowser, operators, Viewer) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -923,64 +923,6 @@
|
|
|
923
923
|
function __param(paramIndex, decorator) {
|
|
924
924
|
return function (target, key) { decorator(target, key, paramIndex); };
|
|
925
925
|
}
|
|
926
|
-
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
927
|
-
function accept(f) { if (f !== void 0 && typeof f !== "function")
|
|
928
|
-
throw new TypeError("Function expected"); return f; }
|
|
929
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
930
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
931
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
932
|
-
var _, done = false;
|
|
933
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
934
|
-
var context = {};
|
|
935
|
-
for (var p in contextIn)
|
|
936
|
-
context[p] = p === "access" ? {} : contextIn[p];
|
|
937
|
-
for (var p in contextIn.access)
|
|
938
|
-
context.access[p] = contextIn.access[p];
|
|
939
|
-
context.addInitializer = function (f) { if (done)
|
|
940
|
-
throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
941
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
942
|
-
if (kind === "accessor") {
|
|
943
|
-
if (result === void 0)
|
|
944
|
-
continue;
|
|
945
|
-
if (result === null || typeof result !== "object")
|
|
946
|
-
throw new TypeError("Object expected");
|
|
947
|
-
if (_ = accept(result.get))
|
|
948
|
-
descriptor.get = _;
|
|
949
|
-
if (_ = accept(result.set))
|
|
950
|
-
descriptor.set = _;
|
|
951
|
-
if (_ = accept(result.init))
|
|
952
|
-
initializers.push(_);
|
|
953
|
-
}
|
|
954
|
-
else if (_ = accept(result)) {
|
|
955
|
-
if (kind === "field")
|
|
956
|
-
initializers.push(_);
|
|
957
|
-
else
|
|
958
|
-
descriptor[key] = _;
|
|
959
|
-
}
|
|
960
|
-
}
|
|
961
|
-
if (target)
|
|
962
|
-
Object.defineProperty(target, contextIn.name, descriptor);
|
|
963
|
-
done = true;
|
|
964
|
-
}
|
|
965
|
-
;
|
|
966
|
-
function __runInitializers(thisArg, initializers, value) {
|
|
967
|
-
var useValue = arguments.length > 2;
|
|
968
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
969
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
970
|
-
}
|
|
971
|
-
return useValue ? value : void 0;
|
|
972
|
-
}
|
|
973
|
-
;
|
|
974
|
-
function __propKey(x) {
|
|
975
|
-
return typeof x === "symbol" ? x : "".concat(x);
|
|
976
|
-
}
|
|
977
|
-
;
|
|
978
|
-
function __setFunctionName(f, name, prefix) {
|
|
979
|
-
if (typeof name === "symbol")
|
|
980
|
-
name = name.description ? "[".concat(name.description, "]") : "";
|
|
981
|
-
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
982
|
-
}
|
|
983
|
-
;
|
|
984
926
|
function __metadata(metadataKey, metadataValue) {
|
|
985
927
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
986
928
|
return Reflect.metadata(metadataKey, metadataValue);
|
|
@@ -1180,7 +1122,7 @@
|
|
|
1180
1122
|
function __asyncDelegator(o) {
|
|
1181
1123
|
var i, p;
|
|
1182
1124
|
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
1183
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done:
|
|
1125
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
1184
1126
|
}
|
|
1185
1127
|
function __asyncValues(o) {
|
|
1186
1128
|
if (!Symbol.asyncIterator)
|
|
@@ -1617,6 +1559,9 @@
|
|
|
1617
1559
|
NgtCheckboxComponent.prototype.isToggleMode = function () {
|
|
1618
1560
|
return this.mode === exports.NgtCheckboxMode.TOGGLE;
|
|
1619
1561
|
};
|
|
1562
|
+
NgtCheckboxComponent.prototype.isSideToggleMode = function () {
|
|
1563
|
+
return this.mode === exports.NgtCheckboxMode.SIDE_TOGGLE;
|
|
1564
|
+
};
|
|
1620
1565
|
NgtCheckboxComponent.prototype.isDefaultMode = function () {
|
|
1621
1566
|
return this.mode === exports.NgtCheckboxMode.DEFAULT;
|
|
1622
1567
|
};
|
|
@@ -1637,9 +1582,9 @@
|
|
|
1637
1582
|
NgtCheckboxComponent.decorators = [
|
|
1638
1583
|
{ type: core.Component, args: [{
|
|
1639
1584
|
selector: 'ngt-checkbox',
|
|
1640
|
-
template: "<
|
|
1585
|
+
template: "<label class=\"flex items-center {{ isDisabled ? 'cursor-not-allowed' : 'cursor-pointer' }}\"\n [class.flex-col]='isToggleMode()' style=\"max-width: max-content;\">\n <input type=\"checkbox\" [name]='name' class=\"hidden\" ([ngModel])='value' [disabled]=\"isDisabled || isClickDisabled\"\n #element>\n\n <span *ngIf=\"isToggleMode() && label\" class=\"flex\">\n <span class=\"{{ ngtStyle.compile(['text', 'fontCase']) }} mb-2\">{{ label }}</span>\n\n <ngt-helper *ngIf=\"helpText\" [helpTitle]=\"helpTitle\" [iconColor]=\"helpTextColor\" class=\"ml-1\">\n {{ helpText }}\n </ngt-helper>\n </span>\n\n <ng-container *ngIf=\"isDefaultMode()\">\n <div style=\"transition: background-color .2s ease-out\"\n class=\"{{ value ? ngtStyle.compile(['color.bg']) : 'bg-white' }} {{ ngtStyle.compile(['h', 'w']) }}\n shadow rounded border border-gray-400 {{ isDisabled ? 'opacity-50' : '' }} {{ !shining ? 'flex justify-center' : 'hidden' }}\">\n <svg class=\"fill-current self-center text-white pointer-events-none\" xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 20 20\">\n <path d=\"M0 11l2-2 5 5L18 3l2 2L7 18z\" />\n </svg>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"isRadioMode()\">\n <div style=\"transition: background-color .2s ease-out\"\n class=\"{{ value ? ngtStyle.compile(['color.border', 'color.text']) : 'border-gray-500' }} {{ isDisabled ? 'opacity-50' : '' }}\n shadow w-6 h-6 rounded-full border-2 border-gray-400 {{ !shining ? 'flex justify-center' : 'hidden' }}\">\n <svg *ngIf=\"value\" class=\"fill-current self-center h-3\" xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 29.107 29.107\">\n <path\n d=\"M14.554 0C6.561 0 0 6.562 0 14.552c0 7.996 6.561 14.555 14.554 14.555 7.996 0 14.553-6.559 14.553-14.555C29.106 6.562 22.55 0 14.554 0z\" />\n </svg>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"isToggleMode() || isSideToggleMode()\">\n <div class=\"shadow w-16 h-8 rounded-full border border-gray-400 {{ shining ? 'hidden' : 'flex' }}\"\n [class.justify-end]=\"value\" [class.opacity-50]=\"isDisabled\" style=\"padding: 1px;\">\n <div *ngIf=\"value\"\n class=\"flex text-xs text-white {{ ngtStyle.compile(['color.bg']) }} pointer-events-none rounded-full px-2 py-3\"\n @slideLeftToRight>\n <svg class=\"fill-current self-center\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\">\n <path d=\"M0 11l2-2 5 5L18 3l2 2L7 18z\" />\n </svg>\n </div>\n\n <div *ngIf=\"!value\" class=\"flex text-xl text-white bg-gray-300 pointer-events-none rounded-full px-1 py-3\"\n @slideRightToLeft>\n <svg class=\"fill-current self-center\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path class=\"heroicon-ui\"\n d=\"M16.24 14.83a1 1 0 0 1-1.41 1.41L12 13.41l-2.83 2.83a1 1 0 0 1-1.41-1.41L10.59 12 7.76 9.17a1 1 0 0 1 1.41-1.41L12 10.59l2.83-2.83a1 1 0 0 1 1.41 1.41L13.41 12l2.83 2.83z\" />\n </svg>\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf='label && !shining && !isToggleMode()'>\n <span class=\"{{ ngtStyle.compile(['text', 'fontCase']) }} ml-2\">{{ label }}</span>\n\n <ngt-helper *ngIf=\"helpText\" [helpTitle]=\"helpTitle\" [iconColor]=\"helpTextColor\" class=\"ml-1\">\n {{ helpText }}\n </ngt-helper>\n </ng-container>\n</label>\n\n<ng-container *ngIf='shining'>\n <div class=\"flex\">\n <ngt-shining class=\"w-16 h-12\"></ngt-shining>\n </div>\n</ng-container>",
|
|
1641
1586
|
providers: [
|
|
1642
|
-
NgtMakeProvider(NgtCheckboxComponent)
|
|
1587
|
+
NgtMakeProvider(NgtCheckboxComponent)
|
|
1643
1588
|
],
|
|
1644
1589
|
viewProviders: [
|
|
1645
1590
|
{ provide: forms.ControlContainer, useExisting: forms.NgForm }
|
|
@@ -1656,7 +1601,7 @@
|
|
|
1656
1601
|
animations.transition(':enter', [
|
|
1657
1602
|
animations.animate(200)
|
|
1658
1603
|
])
|
|
1659
|
-
])
|
|
1604
|
+
])
|
|
1660
1605
|
],
|
|
1661
1606
|
styles: [""]
|
|
1662
1607
|
},] }
|
|
@@ -1684,6 +1629,7 @@
|
|
|
1684
1629
|
(function (NgtCheckboxMode) {
|
|
1685
1630
|
NgtCheckboxMode["DEFAULT"] = "DEFAULT";
|
|
1686
1631
|
NgtCheckboxMode["TOGGLE"] = "TOGGLE";
|
|
1632
|
+
NgtCheckboxMode["SIDE_TOGGLE"] = "SIDE_TOGGLE";
|
|
1687
1633
|
NgtCheckboxMode["RADIO"] = "RADIO";
|
|
1688
1634
|
})(exports.NgtCheckboxMode || (exports.NgtCheckboxMode = {}));
|
|
1689
1635
|
|
|
@@ -1750,7 +1696,7 @@
|
|
|
1750
1696
|
imports: [
|
|
1751
1697
|
common.CommonModule,
|
|
1752
1698
|
http.HttpClientModule,
|
|
1753
|
-
angularSvgIcon.AngularSvgIconModule
|
|
1699
|
+
angularSvgIcon.AngularSvgIconModule.forRoot()
|
|
1754
1700
|
]
|
|
1755
1701
|
},] }
|
|
1756
1702
|
];
|
|
@@ -4065,29 +4011,40 @@
|
|
|
4065
4011
|
this.filtersDescription[reference] = description;
|
|
4066
4012
|
};
|
|
4067
4013
|
NgtDatatableComponent.prototype.removeFilter = function (reference, refresh) {
|
|
4068
|
-
var _this = this;
|
|
4069
4014
|
if (refresh === void 0) { refresh = true; }
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4015
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4016
|
+
var _this = this;
|
|
4017
|
+
return __generator(this, function (_b) {
|
|
4018
|
+
return [2 /*return*/, new Promise(function (resolve) {
|
|
4019
|
+
if (reference && !_this.hasAppliedFilter(reference)) {
|
|
4020
|
+
return resolve();
|
|
4021
|
+
}
|
|
4022
|
+
_this.cleaningFilter = true;
|
|
4023
|
+
if (!reference) {
|
|
4024
|
+
_this.currentState.filters.defaultFilters = {};
|
|
4025
|
+
_this.currentState.filters.silentFilters = {};
|
|
4026
|
+
_this.filtersTranslated = [];
|
|
4027
|
+
}
|
|
4028
|
+
else {
|
|
4029
|
+
delete _this.currentState.filters.defaultFilters[reference];
|
|
4030
|
+
delete _this.currentState.filters.silentFilters[reference];
|
|
4031
|
+
_this.filtersTranslated = _this.filtersTranslated.filter(function (element) { return element && element.reference !== reference; });
|
|
4032
|
+
}
|
|
4033
|
+
_this.onClearFilter.emit(reference);
|
|
4034
|
+
if (_this.inputSearch && (reference === 'term' || !reference)) {
|
|
4035
|
+
_this.inputSearch.clearInput();
|
|
4036
|
+
}
|
|
4037
|
+
if (refresh) {
|
|
4038
|
+
return _this.apply(_this.ngtPagination.getCurrentPage(), false)
|
|
4039
|
+
.then(function () {
|
|
4040
|
+
_this.cleaningFilter = false;
|
|
4041
|
+
resolve();
|
|
4042
|
+
});
|
|
4043
|
+
}
|
|
4044
|
+
resolve();
|
|
4045
|
+
})];
|
|
4046
|
+
});
|
|
4047
|
+
});
|
|
4091
4048
|
};
|
|
4092
4049
|
NgtDatatableComponent.prototype.hasAppliedFilter = function (filter) {
|
|
4093
4050
|
var reference = typeof filter === 'string' ? filter : Object.keys(filter !== null && filter !== void 0 ? filter : {})[0];
|
|
@@ -7278,6 +7235,7 @@
|
|
|
7278
7235
|
});
|
|
7279
7236
|
return _this;
|
|
7280
7237
|
}
|
|
7238
|
+
;
|
|
7281
7239
|
NgtDropzoneComponent.prototype.ngOnChanges = function (changes) {
|
|
7282
7240
|
if (changes.previewType) {
|
|
7283
7241
|
this.previewType = getEnumFromString(changes.previewType.currentValue, exports.NgtDropzonePreviewType);
|
|
@@ -7400,16 +7358,20 @@
|
|
|
7400
7358
|
};
|
|
7401
7359
|
NgtDropzoneComponent.prototype.uploadFiles = function (files) {
|
|
7402
7360
|
return __awaiter(this, void 0, void 0, function () {
|
|
7403
|
-
var temporaryFiles_1, temporaryAttachments_1, observables_1;
|
|
7361
|
+
var temporaryFiles_1, temporaryAttachments_1, observables_1, unacceptedFiles_1;
|
|
7404
7362
|
var _this = this;
|
|
7405
7363
|
return __generator(this, function (_a) {
|
|
7406
7364
|
if (files && files.length) {
|
|
7407
7365
|
temporaryFiles_1 = [];
|
|
7408
7366
|
temporaryAttachments_1 = [];
|
|
7409
7367
|
observables_1 = [];
|
|
7368
|
+
unacceptedFiles_1 = [];
|
|
7410
7369
|
this.loading = true;
|
|
7411
7370
|
this.onFileUploadInit.emit();
|
|
7412
7371
|
files.forEach(function (file) {
|
|
7372
|
+
if (file.type.includes(_this.unacceptedFiles)) {
|
|
7373
|
+
return unacceptedFiles_1.push(file);
|
|
7374
|
+
}
|
|
7413
7375
|
observables_1.push(_this.ngtAttachmentHttpService.upload(_this.remoteResource, file).pipe(operators.map(function (response) {
|
|
7414
7376
|
if (response && response.data) {
|
|
7415
7377
|
if (response.data.attributes && response.data.attributes.data) {
|
|
@@ -7425,6 +7387,10 @@
|
|
|
7425
7387
|
}
|
|
7426
7388
|
})));
|
|
7427
7389
|
});
|
|
7390
|
+
if (!observables_1.length && unacceptedFiles_1.length) {
|
|
7391
|
+
this.loading = false;
|
|
7392
|
+
return [2 /*return*/, this.onFileSelectError.emit(exports.NgtDropzoneErrorType.TYPE)];
|
|
7393
|
+
}
|
|
7428
7394
|
this.subscriptions.push(rxjs.forkJoin(observables_1).subscribe(function (response) {
|
|
7429
7395
|
var _a;
|
|
7430
7396
|
(_a = _this.uploadedResources).push.apply(_a, __spreadArray([], __read(temporaryFiles_1)));
|
|
@@ -7436,6 +7402,9 @@
|
|
|
7436
7402
|
}
|
|
7437
7403
|
_this.onFileUploaded.emit();
|
|
7438
7404
|
_this.loading = false;
|
|
7405
|
+
if (unacceptedFiles_1.length) {
|
|
7406
|
+
_this.onFileSelectError.emit(exports.NgtDropzoneErrorType.TYPE);
|
|
7407
|
+
}
|
|
7439
7408
|
}, function (error) {
|
|
7440
7409
|
_this.onFileUploadFail.emit(error);
|
|
7441
7410
|
_this.loading = false;
|
|
@@ -7637,6 +7606,7 @@
|
|
|
7637
7606
|
canDownloadFile: [{ type: core.Input }],
|
|
7638
7607
|
verticalExpandable: [{ type: core.Input }],
|
|
7639
7608
|
acceptedFiles: [{ type: core.Input }],
|
|
7609
|
+
unacceptedFiles: [{ type: core.Input }],
|
|
7640
7610
|
maxFileSize: [{ type: core.Input }],
|
|
7641
7611
|
previewType: [{ type: core.Input }],
|
|
7642
7612
|
isRequired: [{ type: core.Input }],
|