@indigina/ui-kit 1.0.77 → 1.0.78
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/indigina-ui-kit.umd.js +83 -4
- package/bundles/indigina-ui-kit.umd.js.map +1 -1
- package/esm2015/lib/components/kit-toastr/kit-toastr.module.js +12 -0
- package/esm2015/lib/components/kit-toastr/kit-toastr.service.js +64 -0
- package/esm2015/public-api.js +4 -1
- package/fesm2015/indigina-ui-kit.js +75 -2
- package/fesm2015/indigina-ui-kit.js.map +1 -1
- package/indigina-ui-kit.metadata.json +1 -1
- package/lib/components/kit-toastr/kit-toastr.module.d.ts +2 -0
- package/lib/components/kit-toastr/kit-toastr.service.d.ts +26 -0
- package/package.json +3 -2
- package/public-api.d.ts +2 -0
- package/styles/components/toastr.scss +33 -0
- package/styles/styles.scss +2 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@progress/kendo-angular-buttons'), require('@angular/forms'), require('@progress/kendo-angular-inputs'), require('@progress/kendo-angular-label'), require('rxjs/operators'), require('@progress/kendo-angular-dropdowns'), require('@progress/kendo-angular-dateinputs'), require('@progress/kendo-angular-popup'), require('@progress/kendo-angular-tooltip')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@indigina/ui-kit', ['exports', '@angular/core', '@angular/common', '@progress/kendo-angular-buttons', '@angular/forms', '@progress/kendo-angular-inputs', '@progress/kendo-angular-label', 'rxjs/operators', '@progress/kendo-angular-dropdowns', '@progress/kendo-angular-dateinputs', '@progress/kendo-angular-popup', '@progress/kendo-angular-tooltip'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.indigina = global.indigina || {}, global.indigina["ui-kit"] = {}), global.ng.core, global.ng.common, global["@progress/kendo-angular-buttons"], global.ng.forms, global["@progress/kendo-angular-inputs"], global["@progress/kendo-angular-label"], global.rxjs.operators, global["@progress/kendo-angular-dropdowns"], global["@progress/kendo-angular-dateinputs"], global["@progress/kendo-angular-popup"], global["@progress/kendo-angular-tooltip"]));
|
|
5
|
-
})(this, (function (exports, core, common, kendoAngularButtons, forms, kendoAngularInputs, kendoAngularLabel, operators, kendoAngularDropdowns, kendoAngularDateinputs, kendoAngularPopup, kendoAngularTooltip) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@progress/kendo-angular-buttons'), require('@angular/forms'), require('@progress/kendo-angular-inputs'), require('@progress/kendo-angular-label'), require('rxjs/operators'), require('@progress/kendo-angular-dropdowns'), require('@progress/kendo-angular-dateinputs'), require('@progress/kendo-angular-popup'), require('@progress/kendo-angular-tooltip'), require('ngx-toastr')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@indigina/ui-kit', ['exports', '@angular/core', '@angular/common', '@progress/kendo-angular-buttons', '@angular/forms', '@progress/kendo-angular-inputs', '@progress/kendo-angular-label', 'rxjs/operators', '@progress/kendo-angular-dropdowns', '@progress/kendo-angular-dateinputs', '@progress/kendo-angular-popup', '@progress/kendo-angular-tooltip', 'ngx-toastr'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.indigina = global.indigina || {}, global.indigina["ui-kit"] = {}), global.ng.core, global.ng.common, global["@progress/kendo-angular-buttons"], global.ng.forms, global["@progress/kendo-angular-inputs"], global["@progress/kendo-angular-label"], global.rxjs.operators, global["@progress/kendo-angular-dropdowns"], global["@progress/kendo-angular-dateinputs"], global["@progress/kendo-angular-popup"], global["@progress/kendo-angular-tooltip"], global["ngx-toastr"]));
|
|
5
|
+
})(this, (function (exports, core, common, kendoAngularButtons, forms, kendoAngularInputs, kendoAngularLabel, operators, kendoAngularDropdowns, kendoAngularDateinputs, kendoAngularPopup, kendoAngularTooltip, ngxToastr) { 'use strict';
|
|
6
6
|
|
|
7
7
|
exports.KitButtonType = void 0;
|
|
8
8
|
(function (KitButtonType) {
|
|
@@ -2199,6 +2199,83 @@
|
|
|
2199
2199
|
},] }
|
|
2200
2200
|
];
|
|
2201
2201
|
|
|
2202
|
+
var KitToastrModule = /** @class */ (function () {
|
|
2203
|
+
function KitToastrModule() {
|
|
2204
|
+
}
|
|
2205
|
+
return KitToastrModule;
|
|
2206
|
+
}());
|
|
2207
|
+
KitToastrModule.decorators = [
|
|
2208
|
+
{ type: core.NgModule, args: [{
|
|
2209
|
+
imports: [
|
|
2210
|
+
ngxToastr.ToastrModule.forRoot(),
|
|
2211
|
+
],
|
|
2212
|
+
},] }
|
|
2213
|
+
];
|
|
2214
|
+
|
|
2215
|
+
var DEFAULT_TOASTR_CLASS = 'ngx-toastr display-block kit-toastr';
|
|
2216
|
+
var ACTIVE_OVERLAY_CLASS = 'kit-overlay-container';
|
|
2217
|
+
exports.KitToastrType = void 0;
|
|
2218
|
+
(function (KitToastrType) {
|
|
2219
|
+
KitToastrType["ERROR"] = "toast-error";
|
|
2220
|
+
KitToastrType["INFO"] = "toast-info";
|
|
2221
|
+
KitToastrType["SUCCESS"] = "toast-success";
|
|
2222
|
+
KitToastrType["WARNING"] = "toast-warning";
|
|
2223
|
+
})(exports.KitToastrType || (exports.KitToastrType = {}));
|
|
2224
|
+
var KitToastrService = /** @class */ (function () {
|
|
2225
|
+
function KitToastrService(toastrService, renderer2) {
|
|
2226
|
+
this.toastrService = toastrService;
|
|
2227
|
+
this.renderer2 = renderer2;
|
|
2228
|
+
}
|
|
2229
|
+
KitToastrService.prototype.show = function (config) {
|
|
2230
|
+
var _this = this;
|
|
2231
|
+
var toastr = this.toastrService.show(config.message, config.title, this.getConfig(config));
|
|
2232
|
+
this.addOverlayContainerClass();
|
|
2233
|
+
// "onTap" occurs whenever toastr has been clicked up
|
|
2234
|
+
// so we need to remove them only if "dismissible" is set
|
|
2235
|
+
if (config.dismissible) {
|
|
2236
|
+
// we need this because "toast-container" has styles for modal appearance
|
|
2237
|
+
// otherwise, we have an empty black container which prevents any actions
|
|
2238
|
+
toastr.onTap.subscribe(function () { return _this.removeOverlayContainerClassIfToastsEmpty(toastr); });
|
|
2239
|
+
}
|
|
2240
|
+
return toastr;
|
|
2241
|
+
};
|
|
2242
|
+
KitToastrService.prototype.getConfig = function (baseConfig) {
|
|
2243
|
+
var tapToDismissClass = baseConfig.dismissible && 'kit-toastr-dismissible' || '';
|
|
2244
|
+
return {
|
|
2245
|
+
positionClass: 'toast-top-center',
|
|
2246
|
+
disableTimeOut: true,
|
|
2247
|
+
tapToDismiss: baseConfig.dismissible,
|
|
2248
|
+
toastClass: DEFAULT_TOASTR_CLASS + " " + baseConfig.type + " " + tapToDismissClass,
|
|
2249
|
+
};
|
|
2250
|
+
};
|
|
2251
|
+
KitToastrService.prototype.removeOverlayContainerClassIfToastsEmpty = function (toastr) {
|
|
2252
|
+
// this prevents removing "toast-container" if toast are still on display
|
|
2253
|
+
// that's why we need to "remove" toasts one by one
|
|
2254
|
+
this.toastrService.remove(toastr.toastId);
|
|
2255
|
+
var toasts = this.toastrService.toasts;
|
|
2256
|
+
if (!toasts.length) {
|
|
2257
|
+
this.removeOverlayContainerClass();
|
|
2258
|
+
}
|
|
2259
|
+
};
|
|
2260
|
+
KitToastrService.prototype.addOverlayContainerClass = function () {
|
|
2261
|
+
this.renderer2.addClass(this.getOverlayContainer(), ACTIVE_OVERLAY_CLASS);
|
|
2262
|
+
};
|
|
2263
|
+
KitToastrService.prototype.removeOverlayContainerClass = function () {
|
|
2264
|
+
this.renderer2.removeClass(this.getOverlayContainer(), ACTIVE_OVERLAY_CLASS);
|
|
2265
|
+
};
|
|
2266
|
+
KitToastrService.prototype.getOverlayContainer = function () {
|
|
2267
|
+
return this.renderer2.selectRootElement('.overlay-container', true);
|
|
2268
|
+
};
|
|
2269
|
+
return KitToastrService;
|
|
2270
|
+
}());
|
|
2271
|
+
KitToastrService.decorators = [
|
|
2272
|
+
{ type: core.Injectable }
|
|
2273
|
+
];
|
|
2274
|
+
KitToastrService.ctorParameters = function () { return [
|
|
2275
|
+
{ type: ngxToastr.ToastrService },
|
|
2276
|
+
{ type: core.Renderer2 }
|
|
2277
|
+
]; };
|
|
2278
|
+
|
|
2202
2279
|
// KitButton
|
|
2203
2280
|
|
|
2204
2281
|
/**
|
|
@@ -2240,6 +2317,8 @@
|
|
|
2240
2317
|
exports.KitTextareaModule = KitTextareaModule;
|
|
2241
2318
|
exports.KitTextboxComponent = KitTextboxComponent;
|
|
2242
2319
|
exports.KitTextboxModule = KitTextboxModule;
|
|
2320
|
+
exports.KitToastrModule = KitToastrModule;
|
|
2321
|
+
exports.KitToastrService = KitToastrService;
|
|
2243
2322
|
exports.KitToggleComponent = KitToggleComponent;
|
|
2244
2323
|
exports.KitToggleModule = KitToggleModule;
|
|
2245
2324
|
exports.KitTooltipDirective = KitTooltipDirective;
|