ngx-filters
Version:
This library was generated for all type of frameworks such as Angular Material, Prime Ng, etc. Providing Filters such as Number Box, TextBox, Date, Single Select, Multi Select And True/False Filters for grids or list.
2,481 lines • 160 kB
JavaScript
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('jalali-moment'), require('@angular/forms')) :
typeof define === 'function' && define.amd ? define('ngx-filters', ['exports', '@angular/core', '@angular/common', 'jalali-moment', '@angular/forms'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['ngx-filters'] = {}, global.ng.core, global.ng.common, global.moment, global.ng.forms));
}(this, (function (exports, i0, common, moment, forms) { 'use strict';
function _interopNamespace(e) {
if (e && e.__esModule) { return e; } else {
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () {
return e[k];
}
});
}
});
}
n['default'] = e;
return Object.freeze(n);
}
}
var moment__namespace = /*#__PURE__*/_interopNamespace(moment);
var NgxFilterConfig = /** @class */ (function () {
function NgxFilterConfig() {
}
return NgxFilterConfig;
}());
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b)
if (Object.prototype.hasOwnProperty.call(b, p))
d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function () {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s)
if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __rest(s, e) {
var t = {};
for (var p in s)
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}
function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
if (d = decorators[i])
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function __param(paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); };
}
function __metadata(metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
return Reflect.metadata(metadataKey, metadataValue);
}
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try {
step(generator.next(value));
}
catch (e) {
reject(e);
} }
function rejected(value) { try {
step(generator["throw"](value));
}
catch (e) {
reject(e);
} }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
var _ = { label: 0, sent: function () { if (t[0] & 1)
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f)
throw new TypeError("Generator is already executing.");
while (_)
try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
return t;
if (y = 0, t)
op = [op[0] & 2, t.value];
switch (op[0]) {
case 0:
case 1:
t = op;
break;
case 4:
_.label++;
return { value: op[1], done: false };
case 5:
_.label++;
y = op[1];
op = [0];
continue;
case 7:
op = _.ops.pop();
_.trys.pop();
continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
_ = 0;
continue;
}
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
_.label = op[1];
break;
}
if (op[0] === 6 && _.label < t[1]) {
_.label = t[1];
t = op;
break;
}
if (t && _.label < t[2]) {
_.label = t[2];
_.ops.push(op);
break;
}
if (t[2])
_.ops.pop();
_.trys.pop();
continue;
}
op = body.call(thisArg, _);
}
catch (e) {
op = [6, e];
y = 0;
}
finally {
f = t = 0;
}
if (op[0] & 5)
throw op[1];
return { value: op[0] ? op[1] : void 0, done: true };
}
}
var __createBinding = Object.create ? (function (o, m, k, k2) {
if (k2 === undefined)
k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
}) : (function (o, m, k, k2) {
if (k2 === undefined)
k2 = k;
o[k2] = m[k];
});
function __exportStar(m, o) {
for (var p in m)
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
__createBinding(o, m, p);
}
function __values(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m)
return m.call(o);
if (o && typeof o.length === "number")
return {
next: function () {
if (o && i >= o.length)
o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m)
return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
ar.push(r.value);
}
catch (error) {
e = { error: error };
}
finally {
try {
if (r && !r.done && (m = i["return"]))
m.call(i);
}
finally {
if (e)
throw e.error;
}
}
return ar;
}
function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
}
function __spreadArrays() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
}
;
function __await(v) {
return this instanceof __await ? (this.v = v, this) : new __await(v);
}
function __asyncGenerator(thisArg, _arguments, generator) {
if (!Symbol.asyncIterator)
throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
function verb(n) { if (g[n])
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
function resume(n, v) { try {
step(g[n](v));
}
catch (e) {
settle(q[0][3], e);
} }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length)
resume(q[0][0], q[0][1]); }
}
function __asyncDelegator(o) {
var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
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; }
}
function __asyncValues(o) {
if (!Symbol.asyncIterator)
throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
}
function __makeTemplateObject(cooked, raw) {
if (Object.defineProperty) {
Object.defineProperty(cooked, "raw", { value: raw });
}
else {
cooked.raw = raw;
}
return cooked;
}
;
var __setModuleDefault = Object.create ? (function (o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function (o, v) {
o["default"] = v;
};
function __importStar(mod) {
if (mod && mod.__esModule)
return mod;
var result = {};
if (mod != null)
for (var k in mod)
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
__createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
}
function __importDefault(mod) {
return (mod && mod.__esModule) ? mod : { default: mod };
}
function __classPrivateFieldGet(receiver, privateMap) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to get private field on non-instance");
}
return privateMap.get(receiver);
}
function __classPrivateFieldSet(receiver, privateMap, value) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to set private field on non-instance");
}
privateMap.set(receiver, value);
return value;
}
var NgxFilterBaseComponent = /** @class */ (function () {
function NgxFilterBaseComponent() {
}
return NgxFilterBaseComponent;
}());
var NgxDateFilter = /** @class */ (function (_super) {
__extends(NgxDateFilter, _super);
function NgxDateFilter() {
return _super !== null && _super.apply(this, arguments) || this;
}
return NgxDateFilter;
}(NgxFilterBaseComponent));
var DateComponent = /** @class */ (function (_super) {
__extends(DateComponent, _super);
function DateComponent() {
var _this = _super.apply(this, __spread(arguments)) || this;
_this.valueChange = new i0.EventEmitter();
return _this;
}
DateComponent.prototype.ngOnInit = function () {
};
return DateComponent;
}(NgxDateFilter));
DateComponent.decorators = [
{ type: i0.Component, args: [{
selector: 'ngx-date',
template: "<div>\n <label>{{label}}</label>\n <input class=\"form-control\" [(ngModel)]=\"value\" type=\"date\" (ngModelChange)=\"valueChange.emit($event)\">\n\n</div>\n",
styles: [""]
},] }
];
DateComponent.propDecorators = {
filter: [{ type: i0.Input }],
options: [{ type: i0.Input }],
label: [{ type: i0.Input }],
value: [{ type: i0.Input }],
valueChange: [{ type: i0.Output }]
};
var NgxNumberBoxFilter = /** @class */ (function (_super) {
__extends(NgxNumberBoxFilter, _super);
function NgxNumberBoxFilter() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(NgxNumberBoxFilter.prototype, "prefixTextForHint", {
get: function () {
var _a;
if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.prefixTextForHint) {
return this.options.prefixTextForHint;
}
return ' $';
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxNumberBoxFilter.prototype, "maxLabel", {
get: function () {
var _a;
if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.maxLabel) {
return this.options.maxLabel;
}
return this.filterService.translator.maxLabel;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxNumberBoxFilter.prototype, "minimumValue", {
get: function () {
var _a;
if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.minLabel) {
return this.options.minLabel;
}
return this.filterService.translator.minimumLabel;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxNumberBoxFilter.prototype, "isMoney", {
get: function () {
var _a;
return (_a = this.options) === null || _a === void 0 ? void 0 : _a.isMoney;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxNumberBoxFilter.prototype, "amount", {
get: function () {
var _a;
if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.amountLabel) {
return this.options.amountLabel;
}
return this.filterService.translator.amountLabel;
},
enumerable: false,
configurable: true
});
return NgxNumberBoxFilter;
}(NgxFilterBaseComponent));
var NumberBoxComponent = /** @class */ (function (_super) {
__extends(NumberBoxComponent, _super);
function NumberBoxComponent() {
var _this = _super.apply(this, __spread(arguments)) || this;
_this.valueChange = new i0.EventEmitter();
return _this;
}
NumberBoxComponent.prototype.ngOnInit = function () {
};
return NumberBoxComponent;
}(NgxNumberBoxFilter));
NumberBoxComponent.decorators = [
{ type: i0.Component, args: [{
selector: 'number-box',
template: "<div>\n <label>{{label}}</label>\n <input class=\"form-control\" type=\"number\" [(ngModel)]=\"value\" (ngModelChange)=\"valueChange.emit($event)\">\n <div\n *ngIf=\"isMoney\">{{filter.value | separateThreeComma}}\n {{prefixTextForHint}}</div>\n\n</div>\n",
styles: [""]
},] }
];
NumberBoxComponent.propDecorators = {
filter: [{ type: i0.Input }],
options: [{ type: i0.Input }],
value: [{ type: i0.Input }],
valueChange: [{ type: i0.Output }],
label: [{ type: i0.Input }]
};
var NgxTextBoxFilter = /** @class */ (function (_super) {
__extends(NgxTextBoxFilter, _super);
function NgxTextBoxFilter() {
return _super !== null && _super.apply(this, arguments) || this;
}
return NgxTextBoxFilter;
}(NgxFilterBaseComponent));
var TextBoxComponent = /** @class */ (function (_super) {
__extends(TextBoxComponent, _super);
function TextBoxComponent() {
var _this = _super.apply(this, __spread(arguments)) || this;
_this.valueChange = new i0.EventEmitter();
return _this;
}
TextBoxComponent.prototype.ngOnInit = function () {
};
return TextBoxComponent;
}(NgxTextBoxFilter));
TextBoxComponent.decorators = [
{ type: i0.Component, args: [{
selector: 'app-text-box',
template: "<div>\n <label>{{label}}</label>\n <input class=\"form-control\" type=\"text\" [(ngModel)]=\"value\" (ngModelChange)=\"valueChange.emit($event)\">\n</div>\n",
styles: [""]
},] }
];
TextBoxComponent.propDecorators = {
filter: [{ type: i0.Input }],
value: [{ type: i0.Input }],
valueChange: [{ type: i0.Output }],
label: [{ type: i0.Input }],
options: [{ type: i0.Input }]
};
var NgxTrueFalseFilter = /** @class */ (function (_super) {
__extends(NgxTrueFalseFilter, _super);
function NgxTrueFalseFilter() {
return _super !== null && _super.apply(this, arguments) || this;
}
return NgxTrueFalseFilter;
}(NgxFilterBaseComponent));
var TrueFalseComponent = /** @class */ (function (_super) {
__extends(TrueFalseComponent, _super);
function TrueFalseComponent() {
var _this = _super.apply(this, __spread(arguments)) || this;
_this.valueChange = new i0.EventEmitter();
return _this;
}
TrueFalseComponent.prototype.ngOnInit = function () {
};
return TrueFalseComponent;
}(NgxTrueFalseFilter));
TrueFalseComponent.decorators = [
{ type: i0.Component, args: [{
selector: 'app-true-false',
template: "<p>true-false works!</p>\n",
styles: [""]
},] }
];
TrueFalseComponent.propDecorators = {
label: [{ type: i0.Input }],
filter: [{ type: i0.Input }],
options: [{ type: i0.Input }],
value: [{ type: i0.Input }],
valueChange: [{ type: i0.Output }]
};
var NgxSelectBoxFilter = /** @class */ (function (_super) {
__extends(NgxSelectBoxFilter, _super);
function NgxSelectBoxFilter() {
return _super !== null && _super.apply(this, arguments) || this;
}
NgxSelectBoxFilter.prototype.filterSourceChange = function (src) {
// if (this.options.source)
// this.options? this.options.source = src: '';
};
Object.defineProperty(NgxSelectBoxFilter.prototype, "selectBoxOptions", {
get: function () {
var _a, _b;
return (_b = (_a = this.filter) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.selectBoxOptions;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxSelectBoxFilter.prototype, "placeholder", {
get: function () {
var _a;
return (_a = this.selectBoxOptions) === null || _a === void 0 ? void 0 : _a.searchBoxPlaceholder;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxSelectBoxFilter.prototype, "emptyText", {
get: function () {
var _a;
return (_a = this.selectBoxOptions) === null || _a === void 0 ? void 0 : _a.emptyText;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxSelectBoxFilter.prototype, "lazyLoad", {
get: function () {
var _a;
return (_a = this.selectBoxOptions) === null || _a === void 0 ? void 0 : _a.lazyLoad;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxSelectBoxFilter.prototype, "displayMember", {
get: function () {
var _a;
if (!((_a = this.selectBoxOptions) === null || _a === void 0 ? void 0 : _a.displayMember)) {
return 'name';
}
return this.selectBoxOptions.displayMember;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxSelectBoxFilter.prototype, "valueMember", {
get: function () {
var _a;
if (!((_a = this.selectBoxOptions) === null || _a === void 0 ? void 0 : _a.valueMember)) {
return 'id';
}
return this.selectBoxOptions.valueMember;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxSelectBoxFilter.prototype, "searcher", {
get: function () {
var _a, _b;
if ((_a = this.selectBoxOptions) === null || _a === void 0 ? void 0 : _a.searcher) {
return (_b = this.selectBoxOptions) === null || _b === void 0 ? void 0 : _b.searcher;
}
return null;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxSelectBoxFilter.prototype, "initSource", {
get: function () {
var _a;
if ((_a = this.selectBoxOptions) === null || _a === void 0 ? void 0 : _a.source) {
return this.selectBoxOptions.source;
}
return [];
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxSelectBoxFilter.prototype, "compareWidth", {
get: function () {
return this.selectBoxOptions['compareWith'];
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxSelectBoxFilter.prototype, "useMobileView", {
get: function () {
var _a;
return (_a = this.selectBoxOptions) === null || _a === void 0 ? void 0 : _a.useMobileView;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxSelectBoxFilter.prototype, "hasSearch", {
get: function () {
var _a;
return (_a = this.selectBoxOptions) === null || _a === void 0 ? void 0 : _a.hasSearch;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxSelectBoxFilter.prototype, "mobileViewType", {
get: function () {
var _a;
return (_a = this.selectBoxOptions) === null || _a === void 0 ? void 0 : _a.mobileViewType;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxSelectBoxFilter.prototype, "maximumResultForShow", {
get: function () {
var _a;
return (_a = this.selectBoxOptions) === null || _a === void 0 ? void 0 : _a.maximumResultForShow;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxSelectBoxFilter.prototype, "useInfiniteScroll", {
get: function () {
var _a;
return (_a = this.selectBoxOptions) === null || _a === void 0 ? void 0 : _a.useInfiniteScroll;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxSelectBoxFilter.prototype, "noMoreResultLabel", {
get: function () {
var _a;
return (_a = this.selectBoxOptions) === null || _a === void 0 ? void 0 : _a.noMoreResultLabel;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxSelectBoxFilter.prototype, "inFirstLoadCallSearcher", {
get: function () {
var _a;
return (_a = this.selectBoxOptions) === null || _a === void 0 ? void 0 : _a.afterViewInitCallSearcher;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxSelectBoxFilter.prototype, "inFirstLoadSearcherValue", {
get: function () {
var _a;
return (_a = this.selectBoxOptions) === null || _a === void 0 ? void 0 : _a.inFirstLoadSearcherValue;
},
enumerable: false,
configurable: true
});
NgxSelectBoxFilter.prototype.ngAfterViewInit = function () {
// if (this.selectBoxOptions?.afterViewInitCallSearcher) {
// if (this.searcher) {
// this.searcher('').subscribe(z => {
// this.selectBoxOptions.source = z;
// });
// }
// }
};
return NgxSelectBoxFilter;
}(NgxFilterBaseComponent));
NgxSelectBoxFilter.decorators = [
{ type: i0.Directive, args: [{},] }
];
var NgxMultiSelectFilter = /** @class */ (function (_super) {
__extends(NgxMultiSelectFilter, _super);
function NgxMultiSelectFilter() {
return _super !== null && _super.apply(this, arguments) || this;
}
return NgxMultiSelectFilter;
}(NgxSelectBoxFilter));
NgxMultiSelectFilter.decorators = [
{ type: i0.Directive, args: [{},] }
];
var MultiSelectBoxComponent = /** @class */ (function (_super) {
__extends(MultiSelectBoxComponent, _super);
function MultiSelectBoxComponent() {
var _this = _super.apply(this, __spread(arguments)) || this;
_this.valueChange = new i0.EventEmitter();
return _this;
}
MultiSelectBoxComponent.prototype.ngOnInit = function () {
};
return MultiSelectBoxComponent;
}(NgxMultiSelectFilter));
MultiSelectBoxComponent.decorators = [
{ type: i0.Component, args: [{
selector: 'app-multi-select-box',
template: "<label>\n <!-- {{label}}-->\n <select multiple=\"multiple\" class=\"form-control ngx-filter-select\" (change)=\"valueChange.emit($event)\">\n <option *ngFor=\"let op of initSource\">\n {{op[displayMember]}}\n </option>\n </select>\n</label>\n",
styles: [".ngx-filter-select{min-width:200px}"]
},] }
];
MultiSelectBoxComponent.propDecorators = {
label: [{ type: i0.Input }],
filter: [{ type: i0.Input }],
options: [{ type: i0.Input }],
value: [{ type: i0.Input }],
valueChange: [{ type: i0.Output }]
};
var SelectBoxComponent = /** @class */ (function (_super) {
__extends(SelectBoxComponent, _super);
function SelectBoxComponent() {
var _this = _super.apply(this, __spread(arguments)) || this;
_this.valueChange = new i0.EventEmitter();
return _this;
}
SelectBoxComponent.prototype.ngOnInit = function () {
};
return SelectBoxComponent;
}(NgxSelectBoxFilter));
SelectBoxComponent.decorators = [
{ type: i0.Component, args: [{
selector: 'app-select-box',
template: "<label>\n <!-- {{label}}-->\n <select class=\"form-control ngx-filter-select\" (change)=\"valueChange.emit($event)\">\n <option *ngFor=\"let op of initSource\">\n {{op[displayMember]}}\n </option>\n </select>\n</label>\n",
styles: [".ngx-filter-select{min-width:200px}"]
},] }
];
SelectBoxComponent.propDecorators = {
label: [{ type: i0.Input }],
filter: [{ type: i0.Input }],
options: [{ type: i0.Input }],
value: [{ type: i0.Input }],
valueChange: [{ type: i0.Output }]
};
var NgxConditionSelectorFilter = /** @class */ (function (_super) {
__extends(NgxConditionSelectorFilter, _super);
function NgxConditionSelectorFilter() {
return _super !== null && _super.apply(this, arguments) || this;
}
return NgxConditionSelectorFilter;
}(NgxFilterBaseComponent));
var ConditionsSelectorComponent = /** @class */ (function (_super) {
__extends(ConditionsSelectorComponent, _super);
function ConditionsSelectorComponent() {
var _this = _super.apply(this, __spread(arguments)) || this;
_this.conditions = [];
_this.valueChange = new i0.EventEmitter();
return _this;
}
ConditionsSelectorComponent.prototype.ngOnInit = function () {
};
ConditionsSelectorComponent.prototype.onChangeValue = function (ev) {
this.value = ev.target['value'];
this.valueChange.emit(this.value);
};
return ConditionsSelectorComponent;
}(NgxConditionSelectorFilter));
ConditionsSelectorComponent.decorators = [
{ type: i0.Component, args: [{
selector: 'ngx-filter-conditions-selector',
template: "<div *ngIf=\"filter\" style=\";margin-bottom: 6px;max-width: 200px;width: 100%\">\n <label>\n {{label}}\n </label>\n <select [disabled]=\"filter.disabledCondition\" (change)=\"onChangeValue($event)\" class=\"form-control\"\n style=\"width: 100%\">\n <option [selected]=\"condition.key==value\" *ngFor=\"let condition of conditions\" [value]=\"condition.key\">\n {{condition.label}}\n </option>\n </select>\n\n</div>\n",
styles: [""]
},] }
];
ConditionsSelectorComponent.propDecorators = {
conditions: [{ type: i0.Input }],
filter: [{ type: i0.Input }]
};
var PageFilter = /** @class */ (function () {
function PageFilter() {
this.filters = [];
}
return PageFilter;
}());
var Filter = /** @class */ (function () {
function Filter() {
this.options = new FilterOptions();
}
return Filter;
}());
var FilterOptions = /** @class */ (function () {
function FilterOptions() {
this.selectBoxOptions = new FilterSelectBoxOptions();
this.numberBoxOptions = new FilterNumberBoxOptions();
this.trueFalseOptions = new FilterTrueFalseOptions();
this.dateTimeOptions = new FilterDateTimeOptions();
}
return FilterOptions;
}());
var FilterTranslator = /** @class */ (function () {
function FilterTranslator(data) {
this.conditionLabel = 'condition';
this.betweenLabel = 'Between';
this.containsLabel = 'Contains';
this.notContainsLabel = 'NotContains';
this.endWithLabel = 'EndsWith';
this.equalLabel = 'Equal';
this.exactLabel = 'Exact';
this.greaterThanLabel = 'GreaterThan';
this.greaterThanOrEqualLabel = 'GreaterThanOrEqual';
this.lessThanLabel = 'LessThan';
this.lessThanOrEqualLabel = 'LessThanOrEqual';
this.notEqualLabel = 'NotEqual';
this.startWithLabel = 'StartsWith';
this.inRangeLabel = 'InRange';
this.lastMonthLabel = 'LastMonth';
this.lastWeekLabel = 'LastWeek';
this.currentMonthLabel = 'CurrentMonth';
this.currentWeekLabel = 'CurrentWeek';
this.currentYearLabel = 'CurrentYear';
this.toDayLabel = 'ToDay';
this.fromLabel = 'from';
this.toLabel = 'to';
this.applyLabel = 'apply';
this.amountLabel = 'Amount';
this.minimumLabel = 'Minimum Value';
this.maxLabel = 'Maximum Value';
this.clearAllLabel = 'Clear All';
if (data) {
if (data.conditionLabel)
this.conditionLabel = data.conditionLabel;
if (data.betweenLabel)
this.betweenLabel = data.betweenLabel;
if (data.containsLabel)
this.containsLabel = data.containsLabel;
if (data.endWithLabel)
this.endWithLabel = data.endWithLabel;
if (data.equalLabel)
this.equalLabel = data.equalLabel;
if (data.exactLabel)
this.exactLabel = data.exactLabel;
if (data.greaterThanLabel)
this.greaterThanLabel = data.greaterThanLabel;
if (data.greaterThanOrEqualLabel)
this.greaterThanOrEqualLabel = data.greaterThanOrEqualLabel;
if (data.lessThanLabel)
this.lessThanLabel = data.lessThanLabel;
if (data.lessThanOrEqualLabel)
this.lessThanOrEqualLabel = data.lessThanOrEqualLabel;
if (data.notEqualLabel)
this.notEqualLabel = data.notEqualLabel;
if (data.startWithLabel)
this.startWithLabel = data.startWithLabel;
if (data.inRangeLabel)
this.inRangeLabel = data.inRangeLabel;
if (data.lastMonthLabel)
this.lastMonthLabel = data.lastMonthLabel;
if (data.toDayLabel)
this.toDayLabel = data.toDayLabel;
if (data.lastWeekLabel)
this.lastWeekLabel = data.lastWeekLabel;
if (data.currentMonthLabel)
this.currentMonthLabel = data.currentMonthLabel;
if (data.currentWeekLabel)
this.currentWeekLabel = data.currentWeekLabel;
if (data.currentYearLabel)
this.currentYearLabel = data.currentYearLabel;
if (data.fromLabel)
this.fromLabel = data.fromLabel;
if (data.toLabel)
this.toLabel = data.toLabel;
if (data.applyLabel)
this.applyLabel = data.applyLabel;
if (data.maxLabel)
this.maxLabel = data.maxLabel;
if (data.minimumLabel)
this.minimumLabel = data.minimumLabel;
if (data.amountLabel)
this.amountLabel = data.amountLabel;
if (data.notContainsLabel)
this.notContainsLabel = data.notContainsLabel;
if (data.clearAllLabel)
this.clearAllLabel = data.clearAllLabel;
}
}
return FilterTranslator;
}());
var FilterDateTimeOptions = /** @class */ (function () {
function FilterDateTimeOptions() {
this.dateLabel = 'Date';
}
return FilterDateTimeOptions;
}());
var FilterTrueFalseOptions = /** @class */ (function () {
function FilterTrueFalseOptions() {
}
return FilterTrueFalseOptions;
}());
var FilterNumberBoxOptions = /** @class */ (function () {
function FilterNumberBoxOptions() {
}
return FilterNumberBoxOptions;
}());
var FilterSelectBoxOptions = /** @class */ (function () {
function FilterSelectBoxOptions() {
}
return FilterSelectBoxOptions;
}());
(function (LogicalOperator) {
LogicalOperator["And"] = "And";
LogicalOperator["Or"] = "Or";
})(exports.LogicalOperator || (exports.LogicalOperator = {}));
(function (ConditionOperator) {
ConditionOperator["None"] = "None";
ConditionOperator["Contains"] = "Contains";
ConditionOperator["StartWith"] = "StartWith";
ConditionOperator["EndWith"] = "EndWith";
ConditionOperator["Equal"] = "Equal";
ConditionOperator["NotEqual"] = "NotEqual";
ConditionOperator["GreaterThan"] = "GreaterThan";
ConditionOperator["GreaterThanOrEqual"] = "GreaterThanOrEqual";
ConditionOperator["LessThan"] = "LessThan";
ConditionOperator["LessThanOrEqual"] = "LessThanOrEqual";
ConditionOperator["Between"] = "Between";
ConditionOperator["Exact"] = "Exact";
ConditionOperator["LastWeek"] = "LastWeek";
ConditionOperator["LastMonth"] = "LastMonth";
ConditionOperator["CurrentWeek"] = "CurrentWeek";
ConditionOperator["CurrentMonth"] = "CurrentMonth";
ConditionOperator["CurrentYear"] = "CurrentYear";
ConditionOperator["InRange"] = "InRange";
ConditionOperator["NotIn"] = "NotIn";
ConditionOperator["NotContains"] = "NotContains";
ConditionOperator["ToDay"] = "ToDay";
})(exports.ConditionOperator || (exports.ConditionOperator = {}));
(function (FilterTypes) {
FilterTypes[FilterTypes["DateTime"] = 1] = "DateTime";
FilterTypes[FilterTypes["Number"] = 2] = "Number";
FilterTypes[FilterTypes["SingleSelect"] = 3] = "SingleSelect";
FilterTypes[FilterTypes["MultiSelect"] = 4] = "MultiSelect";
FilterTypes[FilterTypes["TextBox"] = 5] = "TextBox";
FilterTypes[FilterTypes["TrueFalse"] = 6] = "TrueFalse";
FilterTypes[FilterTypes["ListCheck"] = 7] = "ListCheck";
})(exports.FilterTypes || (exports.FilterTypes = {}));
var NgxApplyFilterResult = /** @class */ (function () {
function NgxApplyFilterResult() {
this.filters = [];
this.filtersQueryString = '';
this.filteredFilters = [];
}
return NgxApplyFilterResult;
}());
var NGX_FILTERS_CONFIGS = new i0.InjectionToken('NGX_FILTERS_CONFIGS');
var NgxFiltersService = /** @class */ (function () {
function NgxFiltersService(injector, configs, resolver) {
this.resolver = resolver;
this.translator = {};
this.filtersComponent = {};
this.conditionSource = [];
this.useJalaliDate = false;
var defaultConfigs = {
trueFalseComponent: TrueFalseComponent,
dateComponent: DateComponent,
multiSelectBoxComponent: MultiSelectBoxComponent,
selectBoxComponent: SelectBoxComponent,
numberBoxComponent: NumberBoxComponent,
textBoxComponent: TextBoxComponent,
conditionSelectorComponent: ConditionsSelectorComponent,
translator: new FilterTranslator(),
};
if (!configs) {
configs = defaultConfigs;
}
else {
configs = Object.assign(defaultConfigs, configs);
}
this._configs = configs;
this.filtersComponent.textBox = this.resolver.resolveComponentFactory(configs.textBoxComponent);
this.filtersComponent.numberBox = this.resolver
.resolveComponentFactory(configs.numberBoxComponent);
this.filtersComponent.date = this.resolver
.resolveComponentFactory(configs.dateComponent);
this.filtersComponent.selectBox = this.resolver.resolveComponentFactory(configs.selectBoxComponent);
this.filtersComponent.multiSelectBox = this.resolver.resolveComponentFactory(configs.multiSelectBoxComponent);
this.filtersComponent.trueFalse = this.resolver.resolveComponentFactory(configs.trueFalseComponent);
this.filtersComponent.conditionSelector = this.resolver.resolveComponentFactory(configs.conditionSelectorComponent);
this.translator = configs.translator;
}
NgxFiltersService.prototype.getComponentFactory = function (filterType) {
var component = null;
switch (filterType) {
case exports.FilterTypes.DateTime:
component = this._configs.dateComponent;
break;
//case FilterTypes.ListCheck:
case exports.FilterTypes.MultiSelect:
component = this._configs.multiSelectBoxComponent;
break;
case exports.FilterTypes.Number:
component = this._configs.numberBoxComponent;
break;
case exports.FilterTypes.SingleSelect:
component = this._configs.selectBoxComponent;
break;
case exports.FilterTypes.TextBox:
component = this._configs.textBoxComponent;
break;
case exports.FilterTypes.TrueFalse:
component = this._configs.trueFalseComponent;
break;
default: {
component = this._configs.conditionSelectorComponent;
}
}
if (component)
return this.resolver
.resolveComponentFactory(component);
return null;
};
NgxFiltersService.prototype.checkHasFilter = function (filter) {
var hasFilter = (this.noValueConditions.includes(filter.conditionOperator))
||
(filter.type == exports.FilterTypes.MultiSelect ? filter.values && filter.values.length > 0 : !!filter.value);
if (!hasFilter) {
if (filter.type === exports.FilterTypes.Number && filter.value == 0) {
hasFilter = true;
}
if (filter.type === exports.FilterTypes.Number && filter.conditionOperator === exports.ConditionOperator.Between && filter.valueTo) {
filter.value = 0;
hasFilter = true;
}
}
return (hasFilter);
};
NgxFiltersService.prototype.getConditionSource = function () {
var conditions = [];
for (var enumMember in exports.ConditionOperator) {
var condition = exports.ConditionOperator[enumMember];
var gcplat = this.getCondition(condition, null);
if (gcplat) {
conditions.push({
key: exports.ConditionOperator[enumMember],
label: gcplat.label,
types: gcplat.types
});
}
}
return conditions;
};
NgxFiltersService.prototype.getDefaultCondition = function (filterType) {
switch (filterType) {
case exports.FilterTypes.MultiSelect:
case exports.FilterTypes.ListCheck: {
return exports.ConditionOperator.InRange;
}
case exports.FilterTypes.TrueFalse:
case exports.FilterTypes.SingleSelect:
case exports.FilterTypes.Number: {
return exports.ConditionOperator.Equal;
}
case exports.FilterTypes.TextBox: {
return exports.ConditionOperator.Contains;
}
case exports.FilterTypes.DateTime: {
return exports.ConditionOperator.Between;
}
}
};
NgxFiltersService.prototype.getConditionLabel = function (condition) {
if (condition) {
var conditionKey = condition[0].toLowerCase() + condition.substring(1);
if (this.translator) {
return this.translator[conditionKey + 'Label'];
}
else {
return condition;
}
}
return "";
};
NgxFiltersService.prototype.getCondition = function (condition, filter) {
condition = condition || filter.conditionOperator;
var label = this.getConditionLabel(condition);
switch (condition) {
case exports.ConditionOperator.Between:
return { label: label, types: [exports.FilterTypes.Number, exports.FilterTypes.DateTime], hasValue: true };
case exports.ConditionOperator.Contains:
return { label: label, types: [exports.FilterTypes.TextBox], hasValue: true };
case exports.ConditionOperator.EndWith:
return { label: label, types: [exports.FilterTypes.TextBox], hasValue: true };
case exports.ConditionOperator.NotContains:
return { label: label, types: [exports.FilterTypes.TextBox], hasValue: true };
case exports.ConditionOperator.Equal:
return { label: label, types: [exports.FilterTypes.Number], hasValue: true };
case exports.ConditionOperator.Exact:
return { label: label, types: [exports.FilterTypes.DateTime, exports.FilterTypes.TextBox], hasValue: true };
case exports.ConditionOperator.GreaterThan:
return { label: label, types: [exports.FilterTypes.Number, exports.FilterTypes.DateTime], hasValue: true };
case exports.ConditionOperator.GreaterThanOrEqual:
return { label: label, types: [exports.FilterTypes.Number, exports.FilterTypes.DateTime], hasValue: true };
case exports.ConditionOperator.LessThan:
return { label: label, types: [exports.FilterTypes.Number, exports.FilterTypes.DateTime], hasValue: true };
case exports.ConditionOperator.LessThanOrEqual:
return { label: label, types: [exports.FilterTypes.Number, exports.FilterTypes.DateTime], hasValue: true };
case exports.ConditionOperator.NotEqual:
return { label: label, types: [exports.FilterTypes.Number], hasValue: true };
case exports.ConditionOperator.StartWith:
return { label: label, types: [exports.FilterTypes.TextBox], hasValue: true };
case exports.ConditionOperator.InRange:
return { label: label, types: [exports.FilterTypes.ListCheck], hasValue: true };
case exports.ConditionOperator.LastMonth:
return { label: label, types: [exports.FilterTypes.DateTime], hasValue: false };
case exports.ConditionOperator.LastWeek:
return { label: label, types: [exports.FilterTypes.DateTime], hasValue: false };
case exports.ConditionOperator.CurrentMonth:
return { label: label, types: [exports.FilterTypes.DateTime], hasValue: false };
case exports.ConditionOperator.CurrentWeek:
return { label: label, types: [exports.FilterTypes.DateTime], hasValue: false };
case exports.ConditionOperator.CurrentYear:
return { label: label, types: [exports.FilterTypes.DateTime], hasValue: false };
case exports.ConditionOperator.ToDay:
return { label: label, types: [exports.FilterTypes.DateTime], hasValue: false };
}
};
Object.defineProperty(NgxFiltersService.prototype, "noValueConditions", {
get: function () {
return [
exports.ConditionOperator.LastWeek,
exports.ConditionOperator.LastMonth,
exports.ConditionOperator.CurrentYear,
exports.ConditionOperator.CurrentWeek,
exports.ConditionOperator.CurrentMonth,
exports.ConditionOperator.ToDay
];
},
enumerable: false,
configurable: true
});
NgxFiltersService.prototype.getTime = function (dt) {
if (!dt) {
return '';
}
var date = new Date(dt);
var day = date.getDate(); // yields date
var month = date.getMonth() + 1; // yields month (add one as '.getMonth()' is zero indexed)
var year = date.getFullYear(); // yields year
var hour = date.getHours(); // yields hours
var minute = date.getMinutes(); // yields minutes
var second = date.getSeconds(); // yields seconds
// After this construct a string with the above results as below
return day + '/' + month + '/' + year + " " + hour + ':' + minute + ':' + second;
};
NgxFiltersService.prototype.setValueForDateHasNoValue = function (filter) {
if (filter.type === exports.FilterTypes.DateTime) {
var date = new Date();
var fromDate = filter.value;
var toDate = filter.valueTo;
switch (filter.conditionOperator) {
case exports.ConditionOperator.LastWeek:
{
fromDate = date.setTime(date.getTime() - 6 * 24 * 60 * 60 * 1000);
toDate = date.setTime(date.getTime() - (date.getDay() ? date.getDay() : 7) * 24 * 60 * 60 * 1000);
}
break;
case exports.ConditionOperator.LastMonth:
{
fromDate = new Date(date.getFullYear(), date.getMonth() - 1, 1);
toDate = new Date(date.getFullYear(), date.getMonth(), 0);
}
break;
case exports.ConditionOperator.CurrentWeek:
{
var first = date.getDate() - date.getDay(); // First day is the day of the month - the day of the week
var last = first + 6; // last day is the first day + 6
fromDate = new Date(date.setDate(first)).toUTCString();
toDate = new Date(date.setDate(last)).toUTCString();
}
break;
case exports.ConditionOperator.CurrentMonth:
{
var y = date.getFullYear(), m = date.getMonth();
fromDate = new Date(y, m, 1);
toDate = new Date(y, m + 1, 0);
}
break;
case exports.ConditionOperator.CurrentYear:
{
fromDate = new Date(date.getFullYear(), 0, 1);
toDate = new Date(date.getFullYear() + 1, 0, 0);
}
break;
case exports.ConditionOperator.ToDay:
{
fromDate = date.setHours(0, 0, 0, 0);
var end = new Date();
end.setHours(23, 59, 59, 999);
toDate = end;
}
break;
}
filter.value = fromDate;
filter.valueTo = toDate;
}
};
NgxFiltersService.prototype.clearFilter = function (filter) {
filter.hasFilter = false;
if (filter.type === exports.FilterTypes.DateTime) {
filter.conditionOperator = this.getDefaultCondition(filter.type);
}
switch (filter.type) {
case exports.FilterTypes.DateTime:
case exports.FilterTypes.Number:
case exports.FilterTypes.TextBox:
case exports.FilterTypes.SingleSelect:
case exports.FilterTypes.TrueFalse:
{
filter.value = null;
filter.valueTo = null;
}
break;
case exports.FilterTypes.MultiSelect:
case exports.FilterTypes.ListCheck: {
filter.values = null;
}
}
};
NgxFiltersService.prototype.getDisplayLabel = function (filter, hasConditionName) {
if (hasConditionName === void 0) { hasConditionName = true; }
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
var condition = this.getCondition(null, filter);
if (!condition) {
return ' ';
}
filter.conditionName = condition.label;
if (this.noValueConditions.includes(filter.conditionOperator)) {
return filter.conditionName;
}
var conditionName = hasConditionName ? filter.conditionName : '';
if (!condition.hasValue) {
return conditionName;
}
if (filter.type == exports.FilterTypes.MultiSelect) {
if (!filter.values) {
return '';
}
return filter.values.map(function (z) { var _a, _b; return z[(_b = (_a = filter.options) === null || _a === void 0 ? void 0 : _a.selectBoxOptions) === null || _b === void 0 ? void 0 : _b.displayMember]; }).join(' ,');
}
else if (filter.type == exports.FilterTypes.SingleSelect) {
if (!filter.value) {
return '';
}
return filter.value[(_b = (_a = filter.options) === null || _a === void 0 ? void 0 : _a.selectBoxOptions) === null || _b === void 0 ? void 0 : _b.displayMember];
}
else {
if (!filter.value) {
return '';
}
if (filter.type == exports.FilterTypes.TrueFalse) {
if (filter.value == true) {
filter.valueName = ((_d = (_c = filter === null || filter === void 0 ? void 0 : filter.options) === null || _c === void 0 ? void 0 : _c.trueFalseOptions) === null || _d === void 0 ? void 0 : _d.trueLabel) ? filter.options.trueFalseOptions.trueLabel : 'Yes';
}
else {
filter.valueName = ((_f = (_e = filter === null || filter === void 0 ? void 0 : filter.options) === null || _e === void 0 ? void 0 : _e.trueFalseOptions) === null || _f === void 0 ? void 0 : _f.falseLabel) ? filter.options.trueFalseOptions.falseLabel : 'No';
}
return "" + filter.valueName;
}
if (filter.type == exports.FilterTypes.DateTime) {
if (!this.useJalaliDate) {
filter.valueName = moment__namespace(filter.value).format('YYYY/MM/DD');
}
else {
filter.valueName = moment__namespace(filter.value).format('jYYYY/jMM/jDD');
}
if (filter.conditionOperator == exports.ConditionOperator.Between) {
conditionName = '';
var fromLabel = (this.translator.fromLabel) ? this.translator.fromLabel : 'from';
var toLabel = ((_g = this.translator) === null || _g === void 0 ? void 0 : _g.toLabel) ? this.translator.toLabel : 'to';
if (filter.valueTo) {
if (!this.useJalaliDate) {
filter.valueToName = moment__namespace(filter.valueTo).format('YYYY/MM/DD');
}
else {
filter.valueToName = moment__namespace(filter.valueTo).format('jYYYY/jMM/jDD');
}
}
else {
filter.valueToName = '...';
}
// filter.valueName = moment(filter.value).format('jYYYY/jMM/jDD');
return conditionName + " " + fromLabel + " " + filter.valueName + " " + toLabel + " " + filter.valueToName;
}
return conditionName + " " + filter.valueName;
}
else {
var prefix = (_j = (_h = filter.options) === null || _h === void 0 ? void 0 : _h.numberBoxOptions) === null || _j === void 0 ? void 0 : _j.prefixTextForHint;
prefix = prefix ? prefix : '';
if (!prefix && ((_l = (_k = filter.options) === null || _k === void 0 ? void 0 : _k.numberBoxOptions) === null || _l === void 0 ? void 0 : _l.isMoney)) {
prefix = '$';
}
if (((_o = (_m = filter.options) === null || _m === void 0 ? void 0 : _m.numberBoxOptions) === null || _o === void 0 ? void 0 : _o.isMoney) && filter.type == exports.FilterTypes.Number) {
filter.valueName = this._money(filter.value);
filter.valueTo ? filter.valueToName = this._money(filter.valueTo) : '...';
}
else {
filter.valueName = filter.value;
filter.valueToName = filter.valueTo;
}
if (filter.conditionOperator == exports.ConditionOperator.Between) {
conditionName = '';
var fromLabel = ((_p = this.translator) === null || _p === void 0 ? void 0 : _p.fromLabel) ? this.translator.fromLabel : 'from';
var toLabel = ((_q = this.translator) === null || _q === void 0 ? void 0 : _q.toLabel) ? this.translator.toLabel : 'to';
return conditionName + " " + fromLabel + " " + filter.valueName + prefix + " " + toLabel + " " + (filter.valueToName ? filter.valueToName : '...') + prefix;
}
else {
return conditionName + " " + filter.valueName + prefix;
}
}
}
};
NgxFiltersService.prototype.toQueryString = function (queryObject) {
var parts = [];
Object.keys(queryObject).forEach(function (property) {
var value = queryObject[property];
if (value !== undefined && value !== undefined) {
parts.push(encodeURIComponent(property) + '=' + encodeURIComponent(value));
}
});
return parts.join('&');
};
NgxFiltersService.prototype.getFiltersInQueryString = function (filterBy) {
var obj = '';
filterBy.forEach(function (f, i) {
Object.keys(f).forEach(function (prop) {
var value = filterBy[i][prop];
if (Array.isArray(value)) {
var values = value;
var bb_1 = 0;
values.forEach(function (b) {
if (b !== undefined && b !== null) {
obj =
obj +
'&' +
encodeURIComponent('filters') +
("[" + i + "]") +
'.' +
(encodeURIComponent(prop) + "[" + bb_1 + "]") +
'=' +
encodeURIComponent(b);
bb_1++;
}
});
}
else if (value !== undefined && value !== null) {
obj =
obj +
'&' +
encodeURIComponent('filters') +
("[" + i + "]") +
'.' +
encodeURIComponent(prop) +
'=' +
encodeURIComponent(value);
}
});
});
return obj;
};
NgxFiltersService.prototype.getPageFilterInQueryString = function (queryObject) {
var obj;
if (queryObject && queryObject.filters) {
var filterBy = queryObject.filters.slice();
var query_1 = new PageFilter();
Object.keys(queryObject).forEach(function (o) {
// copy(slice) from queryObject
query_1[o] = queryObject[o];
});
delete query_1.filters;
obj = this.toQueryString(query_1);
obj += this.getFiltersInQueryString(filterBy);
}
return obj;
};
NgxFiltersService.prototype._numberWithCommas = function (x) {
var _a;
return (_a = x === null || x === void 0 ? void 0 : x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')) !== null && _a !== void 0 ? _a : '';
};
NgxFiltersService.prototype._money = function (value) {
if (value != null) {
return this._numberWithCommas(value);
}
return '0';
};
return NgxFiltersService;
}());
NgxFiltersService.ɵprov = i0.ɵɵdefineInjectable({ factory: function NgxFiltersService_Factory() { return new NgxFiltersService(i0.ɵɵinject(i0.INJECTOR), i0.ɵɵinject(NGX_FILTERS_CONFIGS, 8), i0.ɵɵinject(i0.ComponentFactoryResolver)); }, token: NgxFiltersService, providedIn: "root" });
NgxFiltersService.decorators = [
{ type: i0.Injectable, args: [{
providedIn: 'root'
},] }
];
NgxFiltersService.ctorParameters = function () { return [
{ type: i0.Injector },
{ type: NgxFilterConfig, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [NGX_FILTERS_CONFIGS,] }] },
{ type: i0.ComponentFactoryResolver }
]; };
var NgxFiltersComponent = /** @class */ (function () {
function NgxFiltersComponent(injector, filtersService, el) {
this.filtersService = filtersService;
this.el = el;
this.filters = [];
this.loading = true;
this.filterCount = 0;
this.filterCountChange = new i0.EventEmitter();
this.clear = new i0.EventEmitter();
this.filtersService.conditionSource = this.filtersService.getConditionSource();
}
NgxFiltersComponent.prototype.ngOnInit = function () {
};
Object.defineProperty(NgxFiltersComponent.prototype, "filterTypes", {
get: function () {
return exports.FilterTypes;
},
enumerable: false,
configurable: true
});
NgxFiltersComponent.prototype.onClear = function (filter) {
this.filtersService.clearFilter(filter);
this.filterCount -= 1;
this.filterCountChange.emit(this.filterCount);
this.clear.emit();
};
NgxFiltersComponent.prototype.ngAfterViewInit = function () {
var _this = this;
this._setClassToDialogContainer(this.el, 'ngx-mat-cdk-no-border-radius', 'mat-dialog-container');
this._setClassToDialogContainer(this.el, 'ngx-mat-cdk-filters-max-height', 'mat-dialog-content');
setTimeout(function () {
_this.loading = false;
}, 500);
};
NgxFiltersComponent.prototype._setClassToDialogContainer = function (el, className, targetSelect) {
var _a, _b;
if ((_a = el === null || el === void 0 ? void 0 : el.nativeElement) === null || _a === void 0 ? void 0 : _a.parentElement) {
var cls = (_b = el.nativeElement.parentElement.closest(targetSelect)) === null || _b === void 0 ? void 0 : _b.classList;
if (cls && !cls.contains(className)) {
cls.add(className);
}
}
};
return NgxFiltersComponent;
}());
NgxFiltersComponent.decorators = [
{ type: i0.Component, args: [{
selector: 'ngx-filters',
template: "<ng-container *ngFor=\"let filter of filters\">\n <ng-container *ngIf=\"!filter.hidden\">\n <ngx-conditions-selector-filter\n *ngIf=\"\n (filtersService.conditionSource | conditionFilter:filter).length > 0\n \"\n [filter]=\"filter\"\n [conditions]=\"filtersService.conditionSource | conditionFilter:filter\">\n </ngx-conditions-selector-filter>\n\n <ng-container [ngSwitch]=\"filter.type\">\n <ng-container *ngSwitchCase=\"filterTypes.DateTime\">\n <ngx-date-filter [filter]=\"filter\"></ngx-date-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"filterTypes.TextBox\">\n <ngx-text-filter [filter]=\"filter\"></ngx-text-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"filterTypes.Number\">\n <ngx-number-filter [filter]=\"filter\"></ngx-number-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"filterTypes.SingleSelect\">\n <ngx-select-filter [filter]=\"filter\"></ngx-select-filter>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"filterTypes.MultiSelect\">\n <ngx-multi-select-filter [filter]=\"filter\"></ngx-multi-select-filter>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"filterTypes.TrueFalse\">\n <ngx-true-false-filter [filter]=\"filter\"></ngx-true-false-filter>\n </ng-container>\n </ng-container>\n </ng-container>\n</ng-container>\n\n<!--<ng-template #textBoxRef>-->\n\n<!--</ng-template>-->\n<!--<div class=\"ngx-mat-filters-wrapper\">-->\n<!-- <div [hidden]=\"loading\">-->\n<!-- <div class=\"ngx-mat-filter-items\" [class.xs]=\"isXs\">-->\n\n<!-- <ng-container *ngIf=\"filters && filters.length > 0\">-->\n<!--<!– <mat-accordion>–>-->\n<!-- <div *ngFor=\"let filter of filters\" class=\"ngx-mat-filter-item\">-->\n<!-- <ng-container *ngIf=\"!filter.hidden\">-->\n<!-- <ng-container *ngIf=\"filter.type == filterTypes.TrueFalse\">-->\n<!-- <div-->\n<!-- (click)=\"$event.stopPropagation();filter.value = !filter.value\"-->\n<!-- class=\"filter-true-false ngx-mat-filters-header mat-expansion-panel-header\"-->\n<!-- [style.padding]=\"isXs? 0: ''\">-->\n<!-- <div class=\"filter-header\">-->\n\n<!-- <button *ngIf=\"filter.hasFilter\" [color]=\"matColor\"-->\n<!-- (click)=\"$event.stopPropagation();filter.value=null;filter.hasFilter=false;clear.emit()\"-->\n<!-- type=\"button\"-->\n<!-- mat-icon-button>-->\n<!-- <!– <i class=\"fal fa-eraser\"></i>–>-->\n<!-- <ng-container [ngTemplateOutlet]=\"clearIconRef\">-->\n\n<!-- </ng-container>-->\n<!-- <!– <ng-container *ngIf=\"filter.hasFilter\" [ngTemplateOutlet]=\"filterIconRef\">–>-->\n\n<!-- <!– </ng-container>–>-->\n\n<!-- <!– <mat-icon>cleaning_services</mat-icon>–>-->\n<!-- </button>-->\n<!-- <!– <i class=\"fal fa-filter text-success\"–>-->\n<!-- <!– *ngIf=\"filter | hasFilter\"–>-->\n<!-- <!– ></i>–>-->\n<!-- <!– <mat-icon class=\"filter-text-success\" *ngIf=\"filter.hasFilter\">filter_alt</mat-icon>–>-->\n<!-- <div class=\"ngx-mat-filter-item-display-label\">-->\n<!-- {{filter?.label}}-->\n<!-- </div>-->\n<!-- </div>-->\n\n<!-- <div>-->\n<!-- <mat-true-false-filter-->\n<!-- [filter]=\"filter\"></mat-true-false-filter>-->\n<!-- </div>-->\n<!-- </div>-->\n<!-- </ng-container>-->\n<!-- <ng-container *ngIf=\"filter.type != filterTypes.TrueFalse\">-->\n\n<!--<!– <mat-expansion-panel [style.width]=\"'100%'\" [expanded]=\"false\">–>-->\n<!--<!– <mat-expansion-panel-header class=\"ngx-mat-filters-header\" [style.padding]=\"isXs? 0: ''\">–>-->\n<!-- <div class=\"filter-header\">-->\n<!-- <button *ngIf=\"filter.hasFilter\" [color]=\"matColor\"-->\n<!-- (click)=\"$event.stopPropagation();onClear(filter)\"-->\n<!-- type=\"button\"-->\n<!-- mat-icon-button>-->\n<!-- <!– <i class=\"fal fa-eraser\"></i>–>-->\n<!-- <ng-container [ngTemplateOutlet]=\"clearIconRef\">-->\n\n<!-- </ng-container>-->\n<!-- <!– <ng-container *ngIf=\"filter.hasFilter\" [ngTemplateOutlet]=\"filterIconRef\">–>-->\n\n<!-- <!– </ng-container>–>-->\n\n<!-- </button>-->\n<!-- <!– <i class=\"fal fa-filter text-success\"–>-->\n<!-- <!– *ngIf=\"filter | hasFilter\"></i>–>-->\n\n<!-- <!– <mat-icon class=\"filter-text-success\" *ngIf=\"filter.hasFilter\">filter_alt</mat-icon>–>-->\n\n<!-- <div class=\"ngx-mat-filter-item-display-label\">-->\n\n<!-- {{filter?.label}}-->\n<!-- <!– {{filtersService.getDisplayLabel(filter)}}–>-->\n<!-- </div>-->\n<!-- </div>-->\n<!--<!– </mat-expansion-panel-header>–>-->\n<!-- <ng-container-->\n<!-- *ngIf=\"!filter.hiddenCondition\"-->\n<!-- >-->\n<!-- <ngx-filter-mat-conditions-selector-->\n<!-- *ngIf=\"-->\n\n<!-- (filtersService.conditionSource | conditionFilter:filter.type).length > 0-->\n<!-- \"-->\n<!-- [filter]=\"filter\"-->\n<!-- [conditions]=\"filtersService.conditionSource | conditionFilter:filter.type\">-->\n<!-- </ngx-filter-mat-conditions-selector>-->\n\n<!-- </ng-container>-->\n<!-- <ng-container [ngSwitch]=\"filter.type\">-->\n<!-- <ng-container *ngSwitchCase=\"filterTypes.DateTime\">-->\n<!-- <ng-container *ngIf=\"filtersService.useJalaliDate\">-->\n<!--<!– <date-time-jalali-filter [filter]=\"filter\"></date-time-jalali-filter>–>-->\n<!-- </ng-container>-->\n<!-- <ng-container *ngIf=\"!filtersService.useJalaliDate\">-->\n<!--<!– <mat-date-time-filter [filter]=\"filter\"></mat-date-time-filter>–>-->\n<!-- </ng-container>-->\n\n<!-- </ng-container>-->\n<!-- <ng-container *ngSwitchCase=\"filterTypes.Number\">-->\n<!--<!– <mat-number-box-filter [filter]=\"filter\"></mat-number-box-filter>–>-->\n<!-- </ng-container>-->\n<!-- <ng-container *ngSwitchCase=\"filterTypes.MultiSelect\">-->\n<!--<!– <mat-select-box-filter [filter]=\"filter\"></mat-select-box-filter>–>-->\n<!-- </ng-container>-->\n<!-- <ng-container *ngSwitchCase=\"filterTypes.SingleSelect\">-->\n<!--<!– <mat-select-box-filter [filter]=\"filter\"></mat-select-box-filter>–>-->\n<!-- </ng-container>-->\n<!-- <ng-container *ngSwitchCase=\"filterTypes.TextBox\">-->\n<!--<!– <mat-text-box-filter [filter]=\"filter\"></mat-text-box-filter>–>-->\n<!-- </ng-container>-->\n<!-- </ng-container>-->\n\n<!--<!– </mat-expansion-panel>–>-->\n<!-- </ng-container>-->\n\n<!-- </ng-container>-->\n\n<!-- </div>-->\n<!--<!– </mat-accordion>–>-->\n\n\n<!-- </ng-container>-->\n\n<!-- </div>-->\n<!-- <div class=\"ngx-mat-filters-actions\"></div>-->\n<!-- </div>-->\n<!-- <div *ngIf=\"loading\" class=\"filter-spinner-container\">-->\n<!--<!– <mat-spinner [color]=\"matColor\" [strokeWidth]=\"4\" [diameter]=\"55\"></mat-spinner>–>-->\n<!-- </div>-->\n\n<!--</div>-->\n\n<!--<ng-template #clearIconRef>-->\n<!-- <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-eraser-fill\"-->\n<!-- viewBox=\"0 0 16 16\">-->\n<!-- <path-->\n<!-- d=\"M8.086 2.207a2 2 0 0 1 2.828 0l3.879 3.879a2 2 0 0 1 0 2.828l-5.5 5.5A2 2 0 0 1 7.879 15H5.12a2 2 0 0 1-1.414-.586l-2.5-2.5a2 2 0 0 1 0-2.828l6.879-6.879zm.66 11.34L3.453 8.254 1.914 9.793a1 1 0 0 0 0 1.414l2.5 2.5a1 1 0 0 0 .707.293H7.88a1 1 0 0 0 .707-.293l.16-.16z\"/>-->\n<!-- </svg>-->\n<!--</ng-template>-->\n<!--<ng-template #filterIconRef>-->\n<!-- <svg class=\"filter-text-success\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\"-->\n<!-- viewBox=\"0 0 16 16\">-->\n<!-- <path-->\n<!-- d=\"M1.5 1.5A.5.5 0 0 1 2 1h12a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.128.334L10 8.692V13.5a.5.5 0 0 1-.342.474l-3 1A.5.5 0 0 1 6 14.5V8.692L1.628 3.834A.5.5 0 0 1 1.5 3.5v-2z\"/>-->\n<!-- </svg>-->\n<!--</ng-template>-->\n\n\n<div class=\"ngx-filters\">\n\n</div>\n",
encapsulation: i0.ViewEncapsulation.None,
styles: [".ngx-filters-component-wrapper{display:flex;flex-wrap:wrap;grid-gap:8px;width:100%}.ngx-filters-component-wrapper>div{box-sizing:border-box;flex:1 1 50%}.form-control{background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;box-shadow:inset 0 1px 1px rgba(0,0,0,.075);color:#555;display:block;font-size:14px;height:34px;line-height:1.42857143;padding:6px 12px;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:100%}.form-control:focus{border-color:#66afe9;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);outline:0}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{background-color:initial;border:0}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=datetime-local].form-control,input[type=month].form-control,input[type=time].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],.input-group-sm input[type=time],input[type=date].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm,input[type=time].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],.input-group-lg input[type=time],input[type=date].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg,input[type=time].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{display:block;margin-bottom:10px;margin-top:10px;position:relative}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.checkbox label,.radio label{cursor:pointer;font-weight:400;margin-bottom:0;min-height:20px;padding-left:20px}.checkbox-inline input[type=checkbox],.checkbox input[type=checkbox],.radio-inline input[type=radio],.radio input[type=radio]{margin-left:-20px;margin-top:4px\\9;position:absolute}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{cursor:pointer;display:inline-block;font-weight:400;margin-bottom:0;padding-left:20px;position:relative;vertical-align:middle}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-left:10px;margin-top:0}.form-control-static{margin-bottom:0;min-height:34px;padding-bottom:7px;padding-top:7px}.form-control-static.input-lg,.form-control-static.input-sm{padding-left:0;padding-right:0}.input-sm{border-radius:3px;font-size:12px;height:30px;line-height:1.5;padding:5px 10px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{border-radius:3px;font-size:12px;height:30px;line-height:1.5;padding:5px 10px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{font-size:12px;height:30px;line-height:1.5;min-height:32px;padding:6px 10px}.input-lg{border-radius:6px;font-size:18px;height:46px;line-height:1.3333333;padding:10px 16px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{border-radius:6px;font-size:18px;height:46px;line-height:1.3333333;padding:10px 16px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{font-size:18px;height:46px;line-height:1.3333333;min-height:38px;padding:11px 16px}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{display:block;height:34px;line-height:34px;pointer-events:none;position:absolute;right:0;text-align:center;top:0;width:34px;z-index:2}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{height:46px;line-height:46px;width:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{height:30px;line-height:30px;width:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success.checkbox-inline label,.has-success.checkbox label,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.radio-inline label,.has-success.radio label{color:#3c763d}.has-success .form-control{border-color:#3c763d;box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{background-color:#dff0d8;border-color:#3c763d;color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning.checkbox-inline label,.has-warning.checkbox label,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.radio-inline label,.has-warning.radio label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{background-color:#fcf8e3;border-color:#8a6d3b;color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error.checkbox-inline label,.has-error.checkbox label,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.radio-inline label,.has-error.radio label{color:#a94442}.has-error .form-control{border-color:#a94442;box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{background-color:#f2dede;border-color:#a94442;color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{color:#737373;display:block;margin-bottom:10px;margin-top:5px}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;vertical-align:middle;width:auto}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-bottom:0;margin-top:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{margin-left:0;position:relative}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{margin-bottom:0;margin-top:0;padding-top:7px}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}@media (min-width:768px){.form-horizontal .control-label{margin-bottom:0;padding-top:7px;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{font-size:18px;padding-top:11px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{font-size:12px;padding-top:6px}}.caret{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px dashed;border-top:4px solid\\9;display:inline-block;height:0;margin-left:2px;vertical-align:middle;width:0}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{-webkit-background-clip:padding-box;background-clip:padding-box;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;box-shadow:0 6px 12px rgba(0,0,0,.175);display:none;float:left;font-size:14px;left:0;list-style:none;margin:2px 0 0;min-width:160px;padding:5px 0;position:absolute;text-align:left;top:100%;z-index:1000}.dropdown-menu.pull-right{left:auto;right:0}.dropdown-menu .divider{background-color:#e5e5e5;height:1px;margin:9px 0;overflow:hidden}.dropdown-menu>li>a{clear:both;color:#333;display:block;font-weight:400;line-height:1.42857143;padding:3px 20px;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{background-color:#f5f5f5;color:#262626;text-decoration:none}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{background-color:#337ab7;color:#fff;outline:0;text-decoration:none}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{background-color:initial;background-image:none;cursor:not-allowed;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);text-decoration:none}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{left:auto;right:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{color:#777;display:block;font-size:12px;line-height:1.42857143;padding:3px 20px;white-space:nowrap}.dropdown-backdrop{bottom:0;left:0;position:fixed;right:0;top:0;z-index:990}.pull-right>.dropdown-menu{left:auto;right:0}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-bottom:4px dashed;border-bottom:4px solid\\9;border-top:0;content:\"\"}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{bottom:100%;margin-bottom:2px;top:auto}@media (min-width:768px){.navbar-right .dropdown-menu{left:auto;right:0}.navbar-right .dropdown-menu-left{left:0;right:auto}}.clearfix:after,.clearfix:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before{content:\" \";display:table}.clearfix:after,.form-horizontal .form-group:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{background-color:initial;border:0;color:transparent;font:0/0 a;text-shadow:none}.hidden{display:none!important}.affix{position:fixed}.ngx-filter-icon{position:relative}.ngx-filter-icon>div{padding:0 30px 0 15px}html[dir=rtl] .ngx-filter-icon>div{padding:0 15px 0 30px}.ngx-filter-icon:after{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABmJLR0QA/wD/AP+gvaeTAAACJElEQVRoge3ZP4wMYRzG8c9yROSaa+RICAUJBQkNCadAIhoaKho6CjmVnEapozqVK0SnEoUoiESEgkZ1CQUhISTi/5/gVjHvmnGydzO7M7vvJvNNttrf+7zP8867s+9vhpq4uY3mgHzuZo03ZgVpdrsSPeav/6H5CiLlvwVf0KZwpGIj3ZDL2z1J2vsYrtROZwxLvDXxaK7CZZgOhbewpHJr+VmMGxJvT7B8vgEr8SwMuIZFVbrLyUJclXh6gdV5B67FqzDwiva/pV7QwFTw8gbriwpsxLsgMKU/d7IGLgYP77G5U6Gt+BSELpRirRjnwtxfsKNbsV34FgQnuhUrwJkw5w/sLUt0P34G4VNlic7BiTDXLxwsW/wwfmMGx8oWz3AkM8/RqiY5Ll2pQxXoH5Be+fEK9P9hQrp395Wouxvfg/bpEnXnpHU3+YqxEvS2Se+O50vQy00Dk2HiD9jShdYm6f/VZPfWitPApWDgLTZ0oLEOr0VwgsiegV5iTYGxq/BceqZr1xv1jOyp9ClW5BgT7Sl7qaSHLtp3PxBh3zOieJBoO9GWwbLqctPPPqNU6iCxUQeJjTpIbNRBYqMOEht1kNiog8RGVUG2V6TbM+5IGqYZXMZom7rSG6uyGcJJybOuJj7jrOQBRZbog7QYlVyRGYnhaezJfD8wQVqM4bHU+HXJO8qBC0Ky3cal2+2jAQ3SYvZ2G9ggLXbiIW7220hNlfwBBDfD337dOpoAAAAASUVORK5CYII=\");background-position:50%;background-size:contain;content:\"\";height:20px;position:absolute;right:0;top:50%;transform:translateY(-50%);width:20px}html[dir=rtl] .ngx-filter-icon:after{left:0;right:unset}"]
},] }
];
NgxFiltersComponent.ctorParameters = function () { return [
{ type: i0.Injector },
{ type: NgxFiltersService },
{ type: i0.ElementRef }
]; };
NgxFiltersComponent.propDecorators = {
filters: [{ type: i0.Input }],
filterCount: [{ type: i0.Input }],
filterCountChange: [{ type: i0.Output }],
clear: [{ type: i0.Output }]
};
var NgxFilterBase = /** @class */ (function () {
function NgxFilterBase(injector) {
this.conditionSource = [];
this._isFirst = true;
this._injector = injector;
this.filterService = injector.get(NgxFiltersService);
// this.ref = injector.get(ChangeDetectorRef);
}
Object.defineProperty(NgxFilterBase.prototype, "filterTypes", {
get: function () {
return exports.FilterTypes;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxFilterBase.prototype, "conditionOperators", {
get: function () {
return exports.ConditionOperator;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxFilterBase.prototype, "logicalOperators", {
get: function () {
return exports.LogicalOperator;
},
enumerable: false,
configurable: true
});
NgxFilterBase.prototype.ngOnInit = function () {
};
NgxFilterBase.prototype.generateComponents = function (factory, options, conditions) {
var _this = this;
if (conditions === void 0) { conditions = null; }
setTimeout(function () {
if (_this.containerRefDev1) {
_this.containerRefDev1.clear();
_this.componentRef1 = factory.create(_this._injector);
// setTimeout(() => {
_this.componentRef1.instance.label = _this.Label1;
if (_this.filter.type == exports.FilterTypes.MultiSelect) {
_this.componentRef1.instance.value = _this.filter.values;
}
else {
_this.componentRef1.instance.value = _this.filter.value;
}
_this.componentRef1.instance.filter = _this.filter;
_this.componentRef1.instance.filterService = _this.filterService;
_this.componentRef1.instance.options = options;
if (_this.componentRef1.instance.conditions) {
_this.componentRef1.instance.conditions = conditions;
}
_this.componentRef1.instance.valueChange.subscribe(function (ev) {
if (conditions) {
_this.filter.conditionOperator = ev;
}
else {
if (_this.filter.type == exports.FilterTypes.MultiSelect) {
_this.filter.values = ev;
}
else {
_this.filter.value = ev;
}
}
_this.changeValue.emit(ev);
});
_this.containerRefDev1.insert(_this.componentRef1.hostView);
// })
}
if (_this.containerRefDev2) {
_this.containerRefDev2.clear();
_this.componentRef2 = factory.create(_this._injector);
// setTimeout(() => {
_this.componentRef2.instance.label = _this.Label2;
_this.componentRef2.instance.value = _this.filter.valueTo;
_this.componentRef2.instance.filter = _this.filter;
_this.componentRef2.instance.options = options;
_this.componentRef2.instance.filterService = _this.filterService;
_this.componentRef2.instance.valueChange.subscribe(function (ev) {
_this.filter.valueTo = ev;
_this.changeValue.emit(ev);
});
_this.containerRefDev2.insert(_this.componentRef2.hostView);
// });
}
});
};
NgxFilterBase.prototype.refreshLabels = function () {
if (this.componentRef1)
this.componentRef1.instance.label = this.Label1;
if (this.componentRef2)
this.componentRef2.instance.label = this.Label2;
};
NgxFilterBase.prototype.ngOnDestroy = function () {
var _a, _b;
(_a = this.componentRef1) === null || _a === void 0 ? void 0 : _a.destroy();
(_b = this.componentRef2) === null || _b === void 0 ? void 0 : _b.destroy();
};
return NgxFilterBase;
}());
NgxFilterBase.decorators = [
{ type: i0.Directive, args: [{},] }
];
NgxFilterBase.ctorParameters = function () { return [
{ type: i0.Injector }
]; };
NgxFilterBase.propDecorators = {
containerRefDev1: [{ type: i0.ViewChild, args: ['containerRefDev1', { read: i0.ViewContainerRef },] }],
containerRefDev2: [{ type: i0.ViewChild, args: ['containerRefDev2', { read: i0.ViewContainerRef },] }]
};
var NgxNumberFilterComponent = /** @class */ (function (_super) {
__extends(NgxNumberFilterComponent, _super);
function NgxNumberFilterComponent(injector) {
var _this = _super.call(this, injector) || this;
_this.startDate = new Date();
_this.changeValue = new i0.EventEmitter();
return _this;
}
NgxNumberFilterComponent.prototype.ngOnInit = function () {
_super.prototype.ngOnInit.call(this);
};
Object.defineProperty(NgxNumberFilterComponent.prototype, "Label1", {
get: function () {
// console.dir(this.filter.conditionOperator)
if (this.filter.conditionOperator == this.conditionOperators.Between) {
return this.minimumValue;
}
else {
return this.amount;
}
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxNumberFilterComponent.prototype, "Label2", {
get: function () {
return this.maxLabel;
},
enumerable: false,
configurable: true
});
NgxNumberFilterComponent.prototype.ngOnDestroy = function () {
_super.prototype.ngOnDestroy.call(this);
};
NgxNumberFilterComponent.prototype.ngAfterViewInit = function () {
var _a;
this.generateComponents(this.filterService.filtersComponent.numberBox, (_a = this.filter.options) === null || _a === void 0 ? void 0 : _a.numberBoxOptions);
};
Object.defineProperty(NgxNumberFilterComponent.prototype, "maxLabel", {
get: function () {
var _a, _b, _c;
if ((_c = (_b = (_a = this.filter) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.numberBoxOptions) === null || _c === void 0 ? void 0 : _c.maxLabel) {
return this.filter.options.numberBoxOptions.maxLabel;
}
return this.filterService.translator.maxLabel;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxNumberFilterComponent.prototype, "minimumValue", {
get: function () {
var _a, _b, _c;
if ((_c = (_b = (_a = this.filter) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.numberBoxOptions) === null || _c === void 0 ? void 0 : _c.minLabel) {
return this.filter.options.numberBoxOptions.minLabel;
}
return this.filterService.translator.minimumLabel;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxNumberFilterComponent.prototype, "amount", {
get: function () {
var _a, _b, _c;
if ((_c = (_b = (_a = this.filter) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.numberBoxOptions) === null || _c === void 0 ? void 0 : _c.amountLabel) {
return this.filter.options.numberBoxOptions.amountLabel;
}
return this.filterService.translator.amountLabel;
},
enumerable: false,
configurable: true
});
return NgxNumberFilterComponent;
}(NgxFilterBase));
NgxNumberFilterComponent.decorators = [
{ type: i0.Component, args: [{
selector: 'ngx-number-filter',
template: "<div\r\n [style.display]=\"!filter.conditionOperator.includes('Current')\r\n && !filter.conditionOperator.includes('Last') && !filter.conditionOperator.includes('ToDay') ? 'flex': 'none'\"\r\n class=\"ngx-filters-component-wrapper\">\r\n <div>\r\n <ng-container #containerRefDev1></ng-container>\r\n </div>\r\n <div [style.display]=\"filter.conditionOperator.includes('Between')? 'block': 'none'\">\r\n <ng-container #containerRefDev2></ng-container>\r\n </div>\r\n\r\n</div>\r\n"
},] }
];
NgxNumberFilterComponent.ctorParameters = function () { return [
{ type: i0.Injector }
]; };
NgxNumberFilterComponent.propDecorators = {
changeValue: [{ type: i0.Output }],
filter: [{ type: i0.Input }]
};
var NgxTrueFalseFilterComponent = /** @class */ (function (_super) {
__extends(NgxTrueFalseFilterComponent, _super);
function NgxTrueFalseFilterComponent(injector) {
var _this = _super.call(this, injector) || this;
_this.changeValue = new i0.EventEmitter();
return _this;
}
NgxTrueFalseFilterComponent.prototype.ngOnInit = function () {
};
NgxTrueFalseFilterComponent.prototype.ngAfterViewInit = function () {
var _a;
this.generateComponents(this.filterService.filtersComponent.trueFalse, (_a = this.filter.options) === null || _a === void 0 ? void 0 : _a.trueFalseOptions);
};
return NgxTrueFalseFilterComponent;
}(NgxFilterBase));
NgxTrueFalseFilterComponent.decorators = [
{ type: i0.Component, args: [{
selector: 'ngx-true-false-filter',
template: "<div class=\"ngx-filters-component-wrapper\">\r\n <div>\r\n <ng-container #containerRefDev1></ng-container>\r\n </div>\r\n</div>\r\n"
},] }
];
NgxTrueFalseFilterComponent.ctorParameters = function () { return [
{ type: i0.Injector }
]; };
NgxTrueFalseFilterComponent.propDecorators = {
filter: [{ type: i0.Input }],
changeValue: [{ type: i0.Output }]
};
var NgxDateFilterComponent = /** @class */ (function (_super) {
__extends(NgxDateFilterComponent, _super);
function NgxDateFilterComponent(injector) {
var _this = _super.call(this, injector) || this;
_this.startDate = new Date();
_this.changeValue = new i0.EventEmitter();
return _this;
}
NgxDateFilterComponent.prototype.ngOnInit = function () {
_super.prototype.ngOnInit.call(this);
};
NgxDateFilterComponent.prototype.ngOnDestroy = function () {
_super.prototype.ngOnDestroy.call(this);
};
Object.defineProperty(NgxDateFilterComponent.prototype, "Label1", {
get: function () {
var _a, _b, _c, _d;
if (this.filter) {
if (this.filter.conditionOperator == this.conditionOperators.Between) {
return ((_a = this.filterService.translator) === null || _a === void 0 ? void 0 : _a.fromLabel) ? (this.filterService.translator.fromLabel) : 'from';
}
else {
return ((_d = (_c = (_b = this.filter) === null || _b === void 0 ? void 0 : _b.options) === null || _c === void 0 ? void 0 : _c.dateTimeOptions) === null || _d === void 0 ? void 0 : _d.dateLabel) ? (this.filter.options.dateTimeOptions.dateLabel) : 'Date';
}
}
return '';
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxDateFilterComponent.prototype, "Label2", {
get: function () {
var _a;
return ((_a = this.filterService.translator) === null || _a === void 0 ? void 0 : _a.toLabel) ? (this.filterService.translator.toLabel) : 'to';
},
enumerable: false,
configurable: true
});
NgxDateFilterComponent.prototype.ngAfterViewInit = function () {
var _a;
this.generateComponents(this.filterService.filtersComponent.date, (_a = this.filter.options) === null || _a === void 0 ? void 0 : _a.dateTimeOptions);
};
return NgxDateFilterComponent;
}(NgxFilterBase));
NgxDateFilterComponent.decorators = [
{ type: i0.Component, args: [{
selector: 'ngx-date-filter',
template: "<div\r\n [style.display]=\"!filter.conditionOperator.includes('Current')\r\n && !filter.conditionOperator.includes('Last') && !filter.conditionOperator.includes('ToDay') ? 'flex': 'none'\"\r\n class=\"ngx-filters-component-wrapper\">\r\n <div>\r\n <ng-container #containerRefDev1></ng-container>\r\n </div>\r\n <div [style.display]=\"filter.conditionOperator.includes('Between')? 'block': 'none'\">\r\n <ng-container #containerRefDev2></ng-container>\r\n </div>\r\n\r\n</div>\r\n"
},] }
];
NgxDateFilterComponent.ctorParameters = function () { return [
{ type: i0.Injector }
]; };
NgxDateFilterComponent.propDecorators = {
changeValue: [{ type: i0.Output }],
filter: [{ type: i0.Input }]
};
var NgxTextFilterComponent = /** @class */ (function (_super) {
__extends(NgxTextFilterComponent, _super);
function NgxTextFilterComponent(injector) {
var _this = _super.call(this, injector) || this;
_this.changeValue = new i0.EventEmitter();
return _this;
}
NgxTextFilterComponent.prototype.ngOnInit = function () {
_super.prototype.ngOnInit.call(this);
};
Object.defineProperty(NgxTextFilterComponent.prototype, "Label1", {
get: function () {
var _a;
return (_a = this.filter) === null || _a === void 0 ? void 0 : _a.label;
},
enumerable: false,
configurable: true
});
Object.defineProperty(NgxTextFilterComponent.prototype, "Label2", {
get: function () {
return '';
},
enumerable: false,
configurable: true
});
NgxTextFilterComponent.prototype.ngOnDestroy = function () {
_super.prototype.ngOnDestroy.call(this);
};
NgxTextFilterComponent.prototype.ngAfterViewInit = function () {
this.generateComponents(this.filterService.filtersComponent.textBox, null);
};
return NgxTextFilterComponent;
}(NgxFilterBase));
NgxTextFilterComponent.decorators = [
{ type: i0.Component, args: [{
selector: 'ngx-text-filter',
template: "<div class=\"ngx-filters-component-wrapper\">\r\n <div>\r\n <ng-container #containerRefDev1></ng-container>\r\n </div>\r\n</div>\r\n"
},] }
];
NgxTextFilterComponent.ctorParameters = function () { return [
{ type: i0.Injector }
]; };
NgxTextFilterComponent.propDecorators = {
filter: [{ type: i0.Input }],
changeValue: [{ type: i0.Output }]
};
var NgxMultiSelectFilterComponent = /** @class */ (function (_super) {
__extends(NgxMultiSelectFilterComponent, _super);
function NgxMultiSelectFilterComponent(injector) {
var _this = _super.call(this, injector) || this;
_this.changeValue = new i0.EventEmitter();
return _this;
}
NgxMultiSelectFilterComponent.prototype.ngOnInit = function () {
};
NgxMultiSelectFilterComponent.prototype.ngAfterViewInit = function () {
var _a;
this.generateComponents(this.filterService.filtersComponent.multiSelectBox, (_a = this.filter.options) === null || _a === void 0 ? void 0 : _a.selectBoxOptions);
};
return NgxMultiSelectFilterComponent;
}(NgxFilterBase));
NgxMultiSelectFilterComponent.decorators = [
{ type: i0.Component, args: [{
selector: 'ngx-multi-select-filter',
template: "<div class=\"ngx-filters-component-wrapper\">\r\n <div>\r\n <ng-container #containerRefDev1></ng-container>\r\n </div>\r\n</div>\r\n"
},] }
];
NgxMultiSelectFilterComponent.ctorParameters = function () { return [
{ type: i0.Injector }
]; };
NgxMultiSelectFilterComponent.propDecorators = {
filter: [{ type: i0.Input }],
changeValue: [{ type: i0.Output }]
};
var NgxSelectFilterComponent = /** @class */ (function (_super) {
__extends(NgxSelectFilterComponent, _super);
function NgxSelectFilterComponent(injector) {
var _this = _super.call(this, injector) || this;
_this.changeValue = new i0.EventEmitter();
return _this;
}
Object.defineProperty(NgxSelectFilterComponent.prototype, "Label1", {
get: function () {
var _a;
return (_a = this.filter) === null || _a === void 0 ? void 0 : _a.label;
},
enumerable: false,
configurable: true
});
NgxSelectFilterComponent.prototype.ngAfterViewInit = function () {
var _a;
this.generateComponents(this.filterService.filtersComponent.selectBox, (_a = this.filter.options) === null || _a === void 0 ? void 0 : _a.selectBoxOptions);
};
return NgxSelectFilterComponent;
}(NgxFilterBase));
NgxSelectFilterComponent.decorators = [
{ type: i0.Component, args: [{
selector: 'ngx-select-filter',
template: "<div class=\"ngx-filters-component-wrapper\">\r\n <div>\r\n <ng-container #containerRefDev1></ng-container>\r\n </div>\r\n</div>\r\n"
},] }
];
NgxSelectFilterComponent.ctorParameters = function () { return [
{ type: i0.Injector }
]; };
NgxSelectFilterComponent.propDecorators = {
filter: [{ type: i0.Input }],
changeValue: [{ type: i0.Output }]
};
var SeparateThreeCommaPipe = /** @class */ (function () {
function SeparateThreeCommaPipe() {
}
SeparateThreeCommaPipe.prototype.numberWithCommas = function (x) {
var _a;
return (_a = x === null || x === void 0 ? void 0 : x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')) !== null && _a !== void 0 ? _a : '';
};
SeparateThreeCommaPipe.prototype.transform = function (value) {
if (value != null) {
return this.numberWithCommas(value);
}
return '0';
};
return SeparateThreeCommaPipe;
}());
SeparateThreeCommaPipe.ɵprov = i0.ɵɵdefineInjectable({ factory: function SeparateThreeCommaPipe_Factory() { return new SeparateThreeCommaPipe(); }, token: SeparateThreeCommaPipe, providedIn: "root" });
SeparateThreeCommaPipe.decorators = [
{ type: i0.Injectable, args: [{ providedIn: 'root' },] },
{ type: i0.Pipe, args: [{
name: 'separateThreeComma'
},] }
];
var ConditionFilterPipe = /** @class */ (function () {
function ConditionFilterPipe(filterService) {
this.filterService = filterService;
}
ConditionFilterPipe.prototype.transform = function (value) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
if (value && args && args[0]) {
var filter_1 = args[0];
var conditions = this.filterService.conditionSource.filter(function (z) { return z.types.includes(filter_1.type); });
if (filter_1.conditionOperators) {
conditions = conditions.filter(function (w) { return filter_1.conditionOperators.includes(w.key); });
}
return conditions;
}
return [];
};
return ConditionFilterPipe;
}());
ConditionFilterPipe.decorators = [
{ type: i0.Pipe, args: [{
name: 'conditionFilter'
},] }
];
ConditionFilterPipe.ctorParameters = function () { return [
{ type: NgxFiltersService }
]; };
var DisplayLabelFilterPipe = /** @class */ (function () {
function DisplayLabelFilterPipe(filtersService) {
this.filtersService = filtersService;
}
DisplayLabelFilterPipe.prototype.transform = function (value) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
var hasConditionName = args[0];
if (value) {
return this.filtersService.getDisplayLabel(value, hasConditionName);
}
return null;
};
return DisplayLabelFilterPipe;
}());
DisplayLabelFilterPipe.decorators = [
{ type: i0.Pipe, args: [{
name: 'displayLabelFilter'
},] }
];
DisplayLabelFilterPipe.ctorParameters = function () { return [
{ type: NgxFiltersService }
]; };
var HasFilterPipe = /** @class */ (function () {
function HasFilterPipe(filterService) {
this.filterService = filterService;
}
HasFilterPipe.prototype.transform = function (value) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
var hasFilter = false;
if (value) {
hasFilter = this.filterService.checkHasFilter(value);
}
value.hasFilter = hasFilter;
return hasFilter;
};
return HasFilterPipe;
}());
HasFilterPipe.decorators = [
{ type: i0.Pipe, args: [{
name: 'hasFilter'
},] }
];
HasFilterPipe.ctorParameters = function () { return [
{ type: NgxFiltersService }
]; };
var NgxConditionsSelectorFilterComponent = /** @class */ (function (_super) {
__extends(NgxConditionsSelectorFilterComponent, _super);
function NgxConditionsSelectorFilterComponent(injector) {
var _this = _super.call(this, injector) || this;
_this.conditions = [];
_this.changeValue = new i0.EventEmitter();
return _this;
}
Object.defineProperty(NgxConditionsSelectorFilterComponent.prototype, "Label1", {
get: function () {
var _a;
return ((_a = this.filterService.translator) === null || _a === void 0 ? void 0 : _a.conditionLabel) ? this.filterService.translator.conditionLabel : 'condition';
},
enumerable: false,
configurable: true
});
NgxConditionsSelectorFilterComponent.prototype.ngAfterViewInit = function () {
this.generateComponents(this.filterService.filtersComponent.conditionSelector, this.filterService.translator, this.conditions);
};
return NgxConditionsSelectorFilterComponent;
}(NgxFilterBase));
NgxConditionsSelectorFilterComponent.decorators = [
{ type: i0.Component, args: [{
selector: 'ngx-conditions-selector-filter',
template: "<div class=\"ngx-filters-component-wrapper\">\r\n <div>\r\n <ng-container #containerRefDev1></ng-container>\r\n </div>\r\n</div>\r\n"
},] }
];
NgxConditionsSelectorFilterComponent.ctorParameters = function () { return [
{ type: i0.Injector }
]; };
NgxConditionsSelectorFilterComponent.propDecorators = {
filter: [{ type: i0.Input }],
conditions: [{ type: i0.Input }],
changeValue: [{ type: i0.Output }]
};
var NgxFiltersParentBase = /** @class */ (function () {
function NgxFiltersParentBase(injector) {
this.filters = [];
this.filterCount = 0;
this.innerFilters = [];
this.apply = new i0.EventEmitter();
this.filterChange = new i0.EventEmitter();
this._firstFilters = [];
this.filteredFilters = [];
this.filteredFiltersChange = new i0.EventEmitter();
this.filtersService = injector.get(NgxFiltersService);
this.filtersService.conditionSource = this.filtersService.getConditionSource();
}
NgxFiltersParentBase.prototype.ngOnChanges = function (changes) {
if (changes && changes.filters && changes.filters.currentValue) {
this.populateInnerFilter();
}
};
NgxFiltersParentBase.prototype.getClone = function (outerFilters) {
var filters = [];
outerFilters.forEach(function (filter) {
filters.push({
options: filter.options,
hidden: filter.hidden,
field: filter.field,
conditionOperator: filter.conditionOperator,
logicalOperator: filter.logicalOperator,
label: filter.label,
value: filter.value !== null && filter.value !== undefined ? typeof (filter.value) === 'object' && filter.type !== exports.FilterTypes.DateTime ? Object.assign({}, filter.value) : filter.value : null,
type: filter.type,
valueTo: filter.valueTo,
values: filter.values ? __spread(filter.values) : null,
valuesName: filter.valuesName,
valueName: filter.valueName,
valueToName: filter.valueToName,
conditionName: filter.conditionName,
hasFilter: filter.hasFilter,
hiddenCondition: filter.hiddenCondition,
disabledCondition: filter.disabledCondition,
conditionOperators: filter.conditionOperators,
hideRemove: filter.hideRemove,
displayLabel: filter.displayLabel
// creationTime: filter['created']
});
});
return filters;
};
Object.defineProperty(NgxFiltersParentBase.prototype, "filterTypes", {
get: function () {
return exports.FilterTypes;
},
enumerable: false,
configurable: true
});
NgxFiltersParentBase.prototype.applyFilter = function (filter) {
var _this = this;
if (this.filtersService.checkHasFilter(filter)) {
filter['created'] = (new Date()).getTime();
filter.hasFilter = true;
this.filtersService.setValueForDateHasNoValue(filter);
}
else {
filter['created'] = 0;
}
if (this.afterFilterChange) {
filter.displayLabel = this.filtersService.getDisplayLabel(filter);
this.afterFilterChange(filter).then(function (result) {
_this.filterChange.emit(filter);
_this.applyFilters();
filter.displayLabel = result;
});
}
else {
filter.displayLabel = this.filtersService.getDisplayLabel(filter);
this.filterChange.emit(filter);
this.applyFilters();
}
};
NgxFiltersParentBase.prototype.applyFilters = function () {
var _this = this;
// this.filters = [];
setTimeout(function () {
_this._setFilterCount();
_this._getAndSetFilteredFilters();
_this.innerFilters = _this._sort(_this.innerFilters);
_this.filters = _this.getClone(_this.innerFilters);
_this.apply.emit({
filters: _this.filters,
filteredFilters: _this.filteredFilters,
filtersQueryString: _this.filtersService.getFiltersInQueryString(_this.filteredFilters)
});
}, 10);
if (this.afterApply) {
this.afterApply();
}
};
NgxFiltersParentBase.prototype.mapFilters = function (filteredFilters) {
var _this = this;
return filteredFilters.map(function (filter) {
var _a, _b, _c, _d;
if (filter.type == exports.FilterTypes.TrueFalse &&
filter.value == false
&& ((_b = (_a = filter.options) === null || _a === void 0 ? void 0 : _a.trueFalseOptions) === null || _b === void 0 ? void 0 : _b.falseIsNull) == true) {
filter.value = null;
}
if (filter.type == exports.FilterTypes.SingleSelect || filter.type == exports.FilterTypes.MultiSelect) {
if (filter.type == exports.FilterTypes.SingleSelect && filter.value) {
filter.value = filter.value[(_d = (_c = filter === null || filter === void 0 ? void 0 : filter.options) === null || _c === void 0 ? void 0 : _c.selectBoxOptions) === null || _d === void 0 ? void 0 : _d.valueMember];
}
else if (filter.values) {
filter.values = filter.values.map(function (va) {
var _a, _b;
return va[(_b = (_a = filter === null || filter === void 0 ? void 0 : filter.options) === null || _a === void 0 ? void 0 : _a.selectBoxOptions) === null || _b === void 0 ? void 0 : _b.valueMember];
});
}
}
if (filter.type === exports.FilterTypes.DateTime) {
filter.value = _this.filtersService.getTime(filter.value);
filter.valueTo = _this.filtersService.getTime(filter.valueTo);
}
return filter;
});
};
NgxFiltersParentBase.prototype.mapFiltersForFilteredFilters = function (filteredFilters) {
var items = [];
filteredFilters.forEach(function (item) {
items.push({
value: item.value,
values: item.values,
type: item.type,
logicalOperator: item.logicalOperator,
conditionOperator: item.conditionOperator,
field: item.field,
valueTo: item.valueTo
});
});
return items;
};
NgxFiltersParentBase.prototype._getAndSetFilteredFilters = function () {
this.filteredFilters = this.mapFilters(this.getClone(this.innerFilters).filter(function (z) { return z.hasFilter; }));
this.filteredFilters = this.mapFiltersForFilteredFilters(this.filteredFilters);
this.filteredFiltersChange.emit(this.filteredFilters);
};
NgxFiltersParentBase.prototype.populateInnerFilter = function () {
var _this = this;
this.innerFilters = [];
this.filters.forEach(function (item) {
item.hasFilter = _this.filtersService.checkHasFilter(item);
_this.filtersService.setValueForDateHasNoValue((item));
});
this.filters = this._sort(this.filters);
this.innerFilters = this.getClone(this.filters);
this._getAndSetFilteredFilters();
this._firstFilters = this.getClone(this.filters);
this._firstFilters.forEach(function (w) {
w.values = null;
w.value = null;
w.valueToName = null;
w.valuesName = null;
w.hasFilter = false;
w.valueTo = null;
});
this._setFilterCount();
};
NgxFiltersParentBase.prototype._setFilterCount = function () {
var _a;
this.filterCount = (_a = this.innerFilters.filter(function (z) { return z.hasFilter && !z.hidden; })) === null || _a === void 0 ? void 0 : _a.length;
};
NgxFiltersParentBase.prototype.ngOnInit = function () {
// this.filtersService.useJalaliDate = this.useJalaliDate;
// if (!this.isMobile) {
// this.populateInnerFilter();
// }
};
NgxFiltersParentBase.prototype._sort = function (filter) {
return filter.sort(function (a, b) {
var aa = a.hasFilter ? 0 : 1;
if (a['created']) {
aa = aa - a['created'];
}
var bb = b.hasFilter ? 0 : 1;
if (b['created']) {
bb = bb - b['created'];
}
return aa - bb;
});
};
NgxFiltersParentBase.prototype.onClearAll = function () {
this.innerFilters = this.getClone(this._firstFilters);
this.filters = this.getClone(this._firstFilters);
this.apply.emit({
filters: this.filters,
filteredFilters: [],
filtersQueryString: null
});
};
return NgxFiltersParentBase;
}());
NgxFiltersParentBase.decorators = [
{ type: i0.Directive, args: [{},] }
];
NgxFiltersParentBase.ctorParameters = function () { return [
{ type: i0.Injector }
]; };
var NgxChipFilterComponent = /** @class */ (function (_super) {
__extends(NgxChipFilterComponent, _super);
function NgxChipFilterComponent(injector) {
var _this = _super.call(this, injector) || this;
_this.isOpen = false;
_this.hasClearAll = true;
_this.filterChange = new i0.EventEmitter();
_this.filters = [];
_this.showSelectedValue = false;
_this.afterClose = new i0.EventEmitter();
_this.afterOpen = new i0.EventEmitter();
_this.apply = new i0.EventEmitter();
_this.afterApply = function () {
_this.isOpen = false;
_this.selectedFilter = null;
_this.afterClose.emit();
};
_this.platformId = injector.get(i0.PLATFORM_ID);
return _this;
}
NgxChipFilterComponent.prototype.close = function () {
var _this = this;
var index = this.innerFilters.indexOf(this.selectedFilter);
if (index >= 0) {
var filter = this.filters.find(function (z) { return z.field == _this.selectedFilter.field; });
if (filter) {
this.innerFilters[index] = this.getClone([filter])[0];
}
}
this.isOpen = false;
this.selectedFilter = null;
this.afterClose.emit();
};
NgxChipFilterComponent.prototype.ngOnInit = function () {
_super.prototype.ngOnInit.call(this);
};
NgxChipFilterComponent.prototype.showFilter = function (filter) {
var _this = this;
this.selectedFilter = this.innerFilters.find(function (z) { return z.field == filter.field; });
setTimeout(function () {
if (common.isPlatformBrowser(_this.platformId)) {
document.documentElement.appendChild(_this.filterDialogRef.nativeElement);
}
});
this.afterOpen.emit(filter);
this.isOpen = true;
};
NgxChipFilterComponent.prototype.onClear = function (filter) {
this.filtersService.clearFilter(filter);
this.applyFilter(filter);
};
NgxChipFilterComponent.prototype.onConditionChange = function (filterType) {
if (filterType == exports.FilterTypes.DateTime && this.dateFilter) {
this.dateFilter.refreshLabels();
}
if (filterType == exports.FilterTypes.Number && this.numberBox)
this.numberBox.refreshLabels();
};
NgxChipFilterComponent.prototype.ngAfterViewInit = function () {
};
NgxChipFilterComponent.prototype.setTitle = function (title) {
setTimeout(function () {
var _a, _b;
title.title = (_b = (_a = title.textContent) === null || _a === void 0 ? void 0 : _a.replace(/\n/g, '')) !== null && _b !== void 0 ? _b : '';
});
};
return NgxChipFilterComponent;
}(NgxFiltersParentBase));
NgxChipFilterComponent.decorators = [
{ type: i0.Component, args: [{
selector: 'ngx-chip-filter',
template: "<div class=\"ngx-chip-filter-wrap\">\n <div *ngIf=\"hasClearAll\">\n <button class=\"ngx-filters-clearAll\" type=\"button\" (click)=\"onClearAll()\">Clear all</button>\n\n </div>\n <div class=\"ngx-chip-filter-item hasFilter\">\n <div class=\"ngx-filter-icon \">\n <div>\n {{this.filterCount}}\n </div>\n </div>\n </div>\n <div\n [class.hasFilter]=\"filter.hasFilter\" class=\"ngx-chip-filter-item\" (click)=\"showFilter(filter)\"\n *ngFor=\"let filter of innerFilters\">\n <div>\n {{filter.label }}\n </div>\n <div class=\"ngx-chip-filter-selected-value\"\n [style.display]=\"showSelectedValue && filter.hasFilter? 'flex': 'none'\"\n [innerHTML]=\"': '+(filter.displayLabel ? filter.displayLabel:(filter|displayLabelFilter))\">\n </div>\n <div *ngIf=\"filter.hasFilter && !filter.hideRemove\" (click)=\"$event.stopPropagation(); onClear(filter)\"\n class=\"ngx-chip-filter-item-remove-icon\">\n </div>\n </div>\n\n\n</div>\n<ng-container *ngIf=\"selectedFilter\">\n <div #filterDialogRef>\n <div (click)=\"close()\" class=\"ngx-chip-filter-bottom-sheet-back-drop\"></div>\n\n <div class=\"ngx-chip-filter-bottom-sheet-warp\">\n\n <div class=\"ngx-chip-filter-bottom-sheet-container\">\n <div class=\"ngx-chip-filter-bottom-sheet-title\">{{selectedFilter?.label}}</div>\n <ng-container *ngIf=\"!selectedFilter.hidden\">\n <div class=\"ngx-chip-filter-bottom-sheet-filters\">\n <ngx-conditions-selector-filter\n [style.display]=\"selectedFilter.hiddenCondition? 'none': 'block'\"\n (changeValue)=\"onConditionChange(selectedFilter.type)\"\n *ngIf=\"\n\n (filtersService.conditionSource | conditionFilter:selectedFilter).length > 0\n \"\n [filter]=\"selectedFilter\"\n [conditions]=\"filtersService.conditionSource | conditionFilter:selectedFilter\">\n </ngx-conditions-selector-filter>\n\n <ng-container [ngSwitch]=\"selectedFilter.type\">\n <ng-container *ngSwitchCase=\"filterTypes.DateTime\">\n <ngx-date-filter #dateFilter [filter]=\"selectedFilter\"></ngx-date-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"filterTypes.TextBox\">\n <ngx-text-filter [filter]=\"selectedFilter\"></ngx-text-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"filterTypes.Number\">\n <ngx-number-filter #numberBox [filter]=\"selectedFilter\"></ngx-number-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"filterTypes.SingleSelect\">\n <ngx-select-filter [filter]=\"selectedFilter\"></ngx-select-filter>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"filterTypes.MultiSelect\">\n <ngx-multi-select-filter [filter]=\"selectedFilter\"></ngx-multi-select-filter>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"filterTypes.TrueFalse\">\n <ngx-true-false-filter [filter]=\"selectedFilter\"></ngx-true-false-filter>\n </ng-container>\n </ng-container>\n </div>\n </ng-container>\n <button type=\"button\" (click)=\"applyFilter(selectedFilter)\"\n class=\"btn btn-success\">{{filtersService.translator.applyLabel}}</button>\n\n </div>\n <div (click)=\"$event.stopPropagation(); close()\" class=\"ngx-chip-filter-bottom-sheet-close-icon\"></div>\n </div>\n </div>\n\n\n</ng-container>\n\n",
encapsulation: i0.ViewEncapsulation.None,
styles: [".ngx-chip-filter-wrap{grid-gap:8px;height:100%;overflow:auto}.ngx-chip-filter-item,.ngx-chip-filter-wrap{align-items:center;display:flex;flex-wrap:nowrap;padding:8px}.ngx-chip-filter-item{align-content:center;background:#e0e0e0;border:1px solid #fff;border-radius:16px;box-sizing:border-box;cursor:pointer;grid-gap:5px;height:1px;min-height:32px;opacity:.95;text-align:center;white-space:nowrap}.ngx-chip-filter-selected-value{align-items:center;display:flex;grid-gap:4px}.ngx-chip-filter-item:hover{opacity:1}.ngx-chip-filter-item-remove-icon{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAABFUlEQVRIid2VTW7CQAyFP7UiZ+kCVrCDHqIpiDtBb0EERyoVZVsUtmFNWMyMVJk3kxDEon2SpZF/nh3P2IH/jgyYAxtgC5y8bIG1t2VdyafAHqgbZA/ktxA/Ax8tiK0sfWwjupD/TpLE+x3kQaLtyrju+RgYAaUgKoEhMDH6byIXPxckQ2/rmySl1+ELsHEzlWAjHI/AwNtfgB+hO4i4QiX4Eo622r45q9bVuDm5QhVxtl+SqjxIFRyfVKaWqBO2s1I+vEVr4aguVF28jVupBA9/pmrQJqQHbQS8Gv2OxIbNBdGt8hYjD7hn2S2ayMGt3GUH8tbrOiDHLa4m4h0t2hJDhnsRBfCJm9DKnwvcX6/Xlfxv4AK2lPndEfN11QAAAABJRU5ErkJggg==\");background-position:50%;background-repeat:no-repeat;background-size:contain;height:24px;opacity:.5;width:24px}.ngx-chip-filter-item-remove-icon:hover{opacity:.8}.ngx-chip-filter-bottom-sheet-warp{box-shadow:0 8px 10px -5px rgba(0,0,0,.2),0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12);left:50%;max-width:450px;min-height:90px;position:fixed;z-index:999}.ngx-chip-filter-bottom-sheet-container,.ngx-chip-filter-bottom-sheet-warp{background:#fff;border:1px solid #fff;border-top-left-radius:8px;border-top-right-radius:8px;color:rgba(0,0,0,.87);width:100%}.ngx-chip-filter-bottom-sheet-container{box-sizing:border-box;display:flex;flex-direction:column;grid-gap:20px;height:100%;outline:0;overflow:auto;padding:8px 16px 50px}.ngx-chip-filter-bottom-sheet-filters{display:flex;flex-wrap:wrap;grid-gap:10px}.ngx-chip-filter-bottom-sheet-close-icon{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABmJLR0QA/wD/AP+gvaeTAAAD/ElEQVRoge3ay29VVRQG8F+10ktQoa0tOJPoQEQrc6NOfBRBrcxQnEFwwiPoFHVsHJk08e8wUQKJmOILSsVnLMXHRCUqJCYaKwTNdbD3yT7o7e095+7bNoQvObnJXWt9e52z9l57nbUP17Gy0JeRawgP4QHcgzsxijVR/id+wff4Gh/gBH7L6ENtNPA8juEfNCtef+ModmFgiX0Hq/EizpecuoTjOIwJbMIgborXYPxvAi/jvWhT2P+EQ8LDWRJsw3clB05jN9bW4FqHPZgp8X2LrVk8XQANvFka8BM8lpF/HJ+W+Cf1IDobBMebwqLdhxtzDxI5D2Beivb6XOQbhXA3MYt7cxG3wRjm4pjfRB+6wkiJcBq3dUtYAYNCim4Ka3JDXaKGNJ0+kvaDpcQanJSmWa01UyzsWWGzWy4MS7NisqrxNmlhL8WaWAxjUgIY79RotbRP7OuNX7VwUFr8HU2xl6R9ohcpti768Zng28HFlAeEUqGJR3vrVy08Ifh23iJR2SVliE5xQigxRms4NipE/v0O9fukTPpsO8VjUWl3BWemo82Xqt3MaLRp4lQFu73R5shCCkNCWX1JtQKw7FCnN1PHpsAgLuPKQn4+E4nfrUBaYARfSPvO7RV06+zYU9H+yVbC16PwcA1iOnvK3USijFcjx2uthG9H4VM1yWkfmRyRKFDMnrdaCc9F4aYuBqD1U88ViQKbI9fZVsKLUTjc5SD83/GcN0Gowpu40Ep4OQpXZRiIq6dSjulUxoDUJwA3ZCLuFDnbTwvimpla18xiL9Lv010M0C7FVtk0F8MO/0m/5TUyG3/vr0k+KjTo7sNXeBg/l+QX8EiU3S3UdXUjMxZ/W0ZkQrjL4zWIq2x2OSJTlCjbWwkHpaJxXQXSpS4ah6Si8daFlI5G8j0ViE/XdKh8M9MV7F6INu+0U3ouKs1UIP5Ydy9WM5GjE/ThjODjznaKA/gxKj5ew7FeY7vg2w86OIY4FJXPWHnNh88F3/Z3YtCQer0HeudXZRQPeE6FQ6Gt0WheytnLiS34S/Cp8lHGpPQEctRfdTEiNOWaeKMOQUNKrSctTxP7ZqHDUnRaap8zjghlQJHrR3J41yGG8KF0HNf1gc9GKbRz6tdiVbClNOY53JGLeL00zeaF3mt/LvIS+oXsVCzsU/K8v1yFhpQAmkJDOdfpa59wlFHsE8XC7unZ+7gU9qJrv1coOqtiSKidirKjmEo5T4vboiFMr6KcaQoV6RReEfpOm4W0vSpew8Kh0Y6oMyU1PIqyY79l+gJiQOiKHxFeAap+wnFFeDPdqcsbyNnVWCt8VPOg8N5/l5Cub4nyP/CrkErPCkcJU/g9ow/XsWLwL5eGYaYJGYloAAAAAElFTkSuQmCC\");background-position:50%;background-repeat:no-repeat;background-size:contain;cursor:pointer;height:38px;opacity:.5;position:absolute;right:10px;top:10px;width:38px}html[dir=rtl] .ngx-chip-filter-bottom-sheet-close-icon{left:10px;right:unset}.ngx-chip-filter-bottom-sheet-close-icon:hover{opacity:1}.ngx-chip-filter-bottom-sheet-back-drop{background:#e0e0e0;bottom:0;left:0;opacity:.5;position:fixed;right:0;top:0;z-index:998}.ngx-chip-filter-bottom-sheet-title{font-size:large;font-weight:bolder;margin:8px 0;padding:8px 0}.hasFilter{background:#ffcdd2;border-color:#e57373}@keyframes bottomSheetMobile{0%{transform:translate(-50%,1000px)}to{transform:translate(-50%)}}@keyframes bottomSheet{0%{transform:translate(-50%,1000px)}to{transform:translate(-50%,-50%)}}@media (max-width:599.9px){.ngx-chip-filter-bottom-sheet-warp{animation:bottomSheetMobile .35s linear;bottom:0;transform:translate(-50%)}}@media (min-width:600px){.ngx-chip-filter-bottom-sheet-warp{animation:bottomSheet .35s linear;border-radius:8px;top:50%;transform:translate(-50%,-50%)}.ngx-chip-filter-wrap::-webkit-scrollbar{height:8px;width:3px}.ngx-chip-filter-wrap::-webkit-scrollbar-track{background:#f1f1f1}.ngx-chip-filter-wrap::-webkit-scrollbar-thumb{background:#888}.ngx-chip-filter-wrap::-webkit-scrollbar-thumb:hover{background:#555}.ngx-chip-filter-bottom-sheet-container{border-radius:8px}}.ngx-chip-filter-bottom-sheet-filters mat-form-field{max-width:350px;width:100%}.ngx-chip-filter-bottom-sheet-filters>*{width:100%}", ".ngx-filters-component-wrapper{display:flex;flex-wrap:wrap;grid-gap:8px;width:100%}.ngx-filters-component-wrapper>div{box-sizing:border-box;flex:1 1 50%}.form-control{background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;box-shadow:inset 0 1px 1px rgba(0,0,0,.075);color:#555;display:block;font-size:14px;height:34px;line-height:1.42857143;padding:6px 12px;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:100%}.form-control:focus{border-color:#66afe9;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);outline:0}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{background-color:initial;border:0}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=datetime-local].form-control,input[type=month].form-control,input[type=time].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],.input-group-sm input[type=time],input[type=date].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm,input[type=time].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],.input-group-lg input[type=time],input[type=date].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg,input[type=time].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{display:block;margin-bottom:10px;margin-top:10px;position:relative}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.checkbox label,.radio label{cursor:pointer;font-weight:400;margin-bottom:0;min-height:20px;padding-left:20px}.checkbox-inline input[type=checkbox],.checkbox input[type=checkbox],.radio-inline input[type=radio],.radio input[type=radio]{margin-left:-20px;margin-top:4px\\9;position:absolute}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{cursor:pointer;display:inline-block;font-weight:400;margin-bottom:0;padding-left:20px;position:relative;vertical-align:middle}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-left:10px;margin-top:0}.form-control-static{margin-bottom:0;min-height:34px;padding-bottom:7px;padding-top:7px}.form-control-static.input-lg,.form-control-static.input-sm{padding-left:0;padding-right:0}.input-sm{border-radius:3px;font-size:12px;height:30px;line-height:1.5;padding:5px 10px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{border-radius:3px;font-size:12px;height:30px;line-height:1.5;padding:5px 10px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{font-size:12px;height:30px;line-height:1.5;min-height:32px;padding:6px 10px}.input-lg{border-radius:6px;font-size:18px;height:46px;line-height:1.3333333;padding:10px 16px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{border-radius:6px;font-size:18px;height:46px;line-height:1.3333333;padding:10px 16px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{font-size:18px;height:46px;line-height:1.3333333;min-height:38px;padding:11px 16px}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{display:block;height:34px;line-height:34px;pointer-events:none;position:absolute;right:0;text-align:center;top:0;width:34px;z-index:2}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{height:46px;line-height:46px;width:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{height:30px;line-height:30px;width:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success.checkbox-inline label,.has-success.checkbox label,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.radio-inline label,.has-success.radio label{color:#3c763d}.has-success .form-control{border-color:#3c763d;box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{background-color:#dff0d8;border-color:#3c763d;color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning.checkbox-inline label,.has-warning.checkbox label,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.radio-inline label,.has-warning.radio label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{background-color:#fcf8e3;border-color:#8a6d3b;color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error.checkbox-inline label,.has-error.checkbox label,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.radio-inline label,.has-error.radio label{color:#a94442}.has-error .form-control{border-color:#a94442;box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{background-color:#f2dede;border-color:#a94442;color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{color:#737373;display:block;margin-bottom:10px;margin-top:5px}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;vertical-align:middle;width:auto}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-bottom:0;margin-top:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{margin-left:0;position:relative}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{margin-bottom:0;margin-top:0;padding-top:7px}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}@media (min-width:768px){.form-horizontal .control-label{margin-bottom:0;padding-top:7px;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{font-size:18px;padding-top:11px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{font-size:12px;padding-top:6px}}.caret{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px dashed;border-top:4px solid\\9;display:inline-block;height:0;margin-left:2px;vertical-align:middle;width:0}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{-webkit-background-clip:padding-box;background-clip:padding-box;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;box-shadow:0 6px 12px rgba(0,0,0,.175);display:none;float:left;font-size:14px;left:0;list-style:none;margin:2px 0 0;min-width:160px;padding:5px 0;position:absolute;text-align:left;top:100%;z-index:1000}.dropdown-menu.pull-right{left:auto;right:0}.dropdown-menu .divider{background-color:#e5e5e5;height:1px;margin:9px 0;overflow:hidden}.dropdown-menu>li>a{clear:both;color:#333;display:block;font-weight:400;line-height:1.42857143;padding:3px 20px;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{background-color:#f5f5f5;color:#262626;text-decoration:none}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{background-color:#337ab7;color:#fff;outline:0;text-decoration:none}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{background-color:initial;background-image:none;cursor:not-allowed;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);text-decoration:none}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{left:auto;right:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{color:#777;display:block;font-size:12px;line-height:1.42857143;padding:3px 20px;white-space:nowrap}.dropdown-backdrop{bottom:0;left:0;position:fixed;right:0;top:0;z-index:990}.pull-right>.dropdown-menu{left:auto;right:0}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-bottom:4px dashed;border-bottom:4px solid\\9;border-top:0;content:\"\"}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{bottom:100%;margin-bottom:2px;top:auto}@media (min-width:768px){.navbar-right .dropdown-menu{left:auto;right:0}.navbar-right .dropdown-menu-left{left:0;right:auto}}.clearfix:after,.clearfix:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before{content:\" \";display:table}.clearfix:after,.form-horizontal .form-group:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{background-color:initial;border:0;color:transparent;font:0/0 a;text-shadow:none}.hidden{display:none!important}.affix{position:fixed}.ngx-filter-icon{position:relative}.ngx-filter-icon>div{padding:0 30px 0 15px}html[dir=rtl] .ngx-filter-icon>div{padding:0 15px 0 30px}.ngx-filter-icon:after{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABmJLR0QA/wD/AP+gvaeTAAACJElEQVRoge3ZP4wMYRzG8c9yROSaa+RICAUJBQkNCadAIhoaKho6CjmVnEapozqVK0SnEoUoiESEgkZ1CQUhISTi/5/gVjHvmnGydzO7M7vvJvNNttrf+7zP8867s+9vhpq4uY3mgHzuZo03ZgVpdrsSPeav/6H5CiLlvwVf0KZwpGIj3ZDL2z1J2vsYrtROZwxLvDXxaK7CZZgOhbewpHJr+VmMGxJvT7B8vgEr8SwMuIZFVbrLyUJclXh6gdV5B67FqzDwiva/pV7QwFTw8gbriwpsxLsgMKU/d7IGLgYP77G5U6Gt+BSELpRirRjnwtxfsKNbsV34FgQnuhUrwJkw5w/sLUt0P34G4VNlic7BiTDXLxwsW/wwfmMGx8oWz3AkM8/RqiY5Ll2pQxXoH5Be+fEK9P9hQrp395Wouxvfg/bpEnXnpHU3+YqxEvS2Se+O50vQy00Dk2HiD9jShdYm6f/VZPfWitPApWDgLTZ0oLEOr0VwgsiegV5iTYGxq/BceqZr1xv1jOyp9ClW5BgT7Sl7qaSHLtp3PxBh3zOieJBoO9GWwbLqctPPPqNU6iCxUQeJjTpIbNRBYqMOEht1kNiog8RGVUG2V6TbM+5IGqYZXMZom7rSG6uyGcJJybOuJj7jrOQBRZbog7QYlVyRGYnhaezJfD8wQVqM4bHU+HXJO8qBC0Ky3cal2+2jAQ3SYvZ2G9ggLXbiIW7220hNlfwBBDfD337dOpoAAAAASUVORK5CYII=\");background-position:50%;background-size:contain;content:\"\";height:20px;position:absolute;right:0;top:50%;transform:translateY(-50%);width:20px}html[dir=rtl] .ngx-filter-icon:after{left:0;right:unset}"]
},] }
];
NgxChipFilterComponent.ctorParameters = function () { return [
{ type: i0.Injector }
]; };
NgxChipFilterComponent.propDecorators = {
filteredFilters: [{ type: i0.Input }],
filteredFiltersChange: [{ type: i0.Output }],
afterFilterChange: [{ type: i0.Input }],
hasClearAll: [{ type: i0.Input }],
filterChange: [{ type: i0.Output }],
filters: [{ type: i0.Input }],
showSelectedValue: [{ type: i0.Input }],
afterClose: [{ type: i0.Output }],
afterOpen: [{ type: i0.Output }],
apply: [{ type: i0.Output }],
filterDialogRef: [{ type: i0.ViewChild, args: ['filterDialogRef',] }],
dateFilter: [{ type: i0.ViewChild, args: ['dateFilter',] }],
numberBox: [{ type: i0.ViewChild, args: ['numberBox',] }]
};
var RemoveEnterPipe = /** @class */ (function () {
function RemoveEnterPipe() {
}
RemoveEnterPipe.prototype.transform = function (value) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
var _a, _b;
if (args[0] === true) {
return (_a = value === null || value === void 0 ? void 0 : value.replace(/\s/g, '')) !== null && _a !== void 0 ? _a : '';
}
else {
return (_b = value === null || value === void 0 ? void 0 : value.replace(/\n/g, '')) !== null && _b !== void 0 ? _b : '';
}
};
return RemoveEnterPipe;
}());
RemoveEnterPipe.decorators = [
{ type: i0.Pipe, args: [{
name: 'removeEnter'
},] }
];
var NgxFiltersModule = /** @class */ (function () {
function NgxFiltersModule() {
}
NgxFiltersModule.forRoot = function (configs) {
if (configs) {
return {
ngModule: NgxFiltersModule,
providers: [
{ provide: NGX_FILTERS_CONFIGS, useValue: configs },
NgxFiltersService,
]
};
}
};
return NgxFiltersModule;
}());
NgxFiltersModule.decorators = [
{ type: i0.NgModule, args: [{
declarations: [
NgxFiltersComponent,
ConditionsSelectorComponent,
TextBoxComponent,
NumberBoxComponent,
DateComponent,
SelectBoxComponent,
MultiSelectBoxComponent,
TrueFalseComponent,
NgxDateFilterComponent,
NgxTextFilterComponent,
NgxNumberFilterComponent,
SeparateThreeCommaPipe,
NgxSelectFilterComponent,
NgxMultiSelectFilterComponent,
NgxTrueFalseFilterComponent,
ConditionFilterPipe,
DisplayLabelFilterPipe,
HasFilterPipe,
NgxConditionsSelectorFilterComponent,
NgxChipFilterComponent,
RemoveEnterPipe
],
exports: [
NgxFiltersComponent,
ConditionsSelectorComponent,
TextBoxComponent,
NumberBoxComponent,
DateComponent,
SelectBoxComponent,
MultiSelectBoxComponent,
TrueFalseComponent,
NgxDateFilterComponent,
NgxTextFilterComponent,
NgxNumberFilterComponent,
SeparateThreeCommaPipe,
NgxConditionsSelectorFilterComponent,
NgxChipFilterComponent,
RemoveEnterPipe
],
imports: [
common.CommonModule,
forms.FormsModule,
],
providers: []
},] }
];
/*
* Public API Surface of ngx-filters
*/
/**
* Generated bundle index. Do not edit.
*/
exports.ConditionFilterPipe = ConditionFilterPipe;
exports.ConditionsSelectorComponent = ConditionsSelectorComponent;
exports.DateComponent = DateComponent;
exports.DisplayLabelFilterPipe = DisplayLabelFilterPipe;
exports.Filter = Filter;
exports.FilterDateTimeOptions = FilterDateTimeOptions;
exports.FilterNumberBoxOptions = FilterNumberBoxOptions;
exports.FilterOptions = FilterOptions;
exports.FilterSelectBoxOptions = FilterSelectBoxOptions;
exports.FilterTranslator = FilterTranslator;
exports.FilterTrueFalseOptions = FilterTrueFalseOptions;
exports.HasFilterPipe = HasFilterPipe;
exports.MultiSelectBoxComponent = MultiSelectBoxComponent;
exports.NGX_FILTERS_CONFIGS = NGX_FILTERS_CONFIGS;
exports.NgxApplyFilterResult = NgxApplyFilterResult;
exports.NgxChipFilterComponent = NgxChipFilterComponent;
exports.NgxConditionSelectorFilter = NgxConditionSelectorFilter;
exports.NgxDateFilter = NgxDateFilter;
exports.NgxDateFilterComponent = NgxDateFilterComponent;
exports.NgxFilterBase = NgxFilterBase;
exports.NgxFilterBaseComponent = NgxFilterBaseComponent;
exports.NgxFilterConfig = NgxFilterConfig;
exports.NgxFiltersComponent = NgxFiltersComponent;
exports.NgxFiltersModule = NgxFiltersModule;
exports.NgxFiltersService = NgxFiltersService;
exports.NgxMultiSelectFilter = NgxMultiSelectFilter;
exports.NgxMultiSelectFilterComponent = NgxMultiSelectFilterComponent;
exports.NgxNumberBoxFilter = NgxNumberBoxFilter;
exports.NgxNumberFilterComponent = NgxNumberFilterComponent;
exports.NgxSelectBoxFilter = NgxSelectBoxFilter;
exports.NgxSelectFilterComponent = NgxSelectFilterComponent;
exports.NgxTextBoxFilter = NgxTextBoxFilter;
exports.NgxTextFilterComponent = NgxTextFilterComponent;
exports.NgxTrueFalseFilter = NgxTrueFalseFilter;
exports.NgxTrueFalseFilterComponent = NgxTrueFalseFilterComponent;
exports.NumberBoxComponent = NumberBoxComponent;
exports.PageFilter = PageFilter;
exports.SelectBoxComponent = SelectBoxComponent;
exports.SeparateThreeCommaPipe = SeparateThreeCommaPipe;
exports.TextBoxComponent = TextBoxComponent;
exports.TrueFalseComponent = TrueFalseComponent;
exports.ɵa = NgxConditionsSelectorFilterComponent;
exports.ɵb = NgxFiltersParentBase;
exports.ɵc = RemoveEnterPipe;
Object.defineProperty(exports, '__esModule', { value: true });
})));
//# sourceMappingURL=ngx-filters.umd.js.map