@annalib/anna-core 4.2.21 → 4.2.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/anna-core.module.mjs +4 -9
- package/esm2020/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.mjs +2 -2
- package/esm2020/public-api.mjs +1 -2
- package/fesm2015/annalib-anna-core.mjs +5 -293
- package/fesm2015/annalib-anna-core.mjs.map +1 -1
- package/fesm2020/annalib-anna-core.mjs +5 -289
- package/fesm2020/annalib-anna-core.mjs.map +1 -1
- package/lib/anna-core.module.d.ts +11 -12
- package/package.json +1 -1
- package/public-api.d.ts +0 -1
- package/esm2020/lib/anna-core-shared-lib/directives/digits-only/digits-only.directive.mjs +0 -282
- package/lib/anna-core-shared-lib/directives/digits-only/digits-only.directive.d.ts +0 -34
package/esm2020/public-api.mjs
CHANGED
|
@@ -32,7 +32,6 @@ export * from "./lib/anna-core-shared-lib/pipes/annaTypeOfData.pipe";
|
|
|
32
32
|
export * from "./lib/anna-core-shared-lib/pipes/annaReplaceChar.pipe";
|
|
33
33
|
//directives
|
|
34
34
|
export * from "./lib/anna-core-shared-lib/directives/show-ellipsis-text/show-ellipsis-text.directive";
|
|
35
|
-
export * from './lib/anna-core-shared-lib/directives/digits-only/digits-only.directive';
|
|
36
35
|
//ANNA-DROPDOWN LIB
|
|
37
36
|
export * from "./lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component";
|
|
38
37
|
export * from "./lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component";
|
|
@@ -45,4 +44,4 @@ export * from "./lib/anna-generic-table-lib/components/anna-table-virtual-scroll
|
|
|
45
44
|
//Directives
|
|
46
45
|
export * from "./lib/anna-generic-table-lib/directives/anna-fixed-row-size-table-virtual-scroll-strategy";
|
|
47
46
|
export * from "./lib/anna-generic-table-lib/directives/anna-virtual-table";
|
|
48
|
-
//# sourceMapping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ubmEtZ2VuZXJpYy10YWJsZS1saWIvY29tcG9uZW50cy9hbm5hLXRhYmxlLXZpcnR1YWwtc2Nyb2xsLXZpZXdwb3J0L2FubmEtdGFibGUtdmlydHVhbC1zY3JvbGwtdmlld3BvcnQuY29tcG9uZW50XCI7XHJcblxyXG4vL0RpcmVjdGl2ZXNcclxuZXhwb3J0ICogZnJvbSBcIi4vbGliL2FubmEtZ2VuZXJpYy10YWJsZS1saWIvZGlyZWN0aXZlcy9hbm5hLWZpeGVkLXJvdy1zaXplLXRhYmxlLXZpcnR1YWwtc2Nyb2xsLXN0cmF0ZWd5XCI7XHJcbmV4cG9ydCAqIGZyb20gXCIuL2xpYi9hbm5hLWdlbmVyaWMtdGFibGUtbGliL2RpcmVjdGl2ZXMvYW5uYS12aXJ0dWFsLXRhYmxlXCI7XHJcbiJdfQ==
|
|
@@ -1895,7 +1895,7 @@ class AnnaNonEditableGenericTableComponent {
|
|
|
1895
1895
|
this.tooltipRadioTextMap.set("bookedCpmValue", "Booked CPM");
|
|
1896
1896
|
this.tooltipRadioTextMap.set("bookedEffectiveCpmValue", "Effective CPM");
|
|
1897
1897
|
this.tooltipRadioTextMap.set("orderSource", "Order Source");
|
|
1898
|
-
this.tooltipRadioTextMap.set("orderCategory", "
|
|
1898
|
+
this.tooltipRadioTextMap.set("orderCategory", "Category");
|
|
1899
1899
|
this.tooltipRadioTextMap.set("cashOrTrade", "C/T");
|
|
1900
1900
|
this.tooltipRadioTextMap.set("revisionStartDate", "Revision Start Date");
|
|
1901
1901
|
}
|
|
@@ -4157,290 +4157,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImpor
|
|
|
4157
4157
|
}]
|
|
4158
4158
|
}] });
|
|
4159
4159
|
|
|
4160
|
-
class DigitOnlyDirective {
|
|
4161
|
-
constructor(el) {
|
|
4162
|
-
this.el = el;
|
|
4163
|
-
this.hasDecimalPoint = false;
|
|
4164
|
-
this.hasNegativeSign = false;
|
|
4165
|
-
this.navigationKeys = [
|
|
4166
|
-
'Backspace',
|
|
4167
|
-
'Delete',
|
|
4168
|
-
'Tab',
|
|
4169
|
-
'Escape',
|
|
4170
|
-
'Enter',
|
|
4171
|
-
'Home',
|
|
4172
|
-
'End',
|
|
4173
|
-
'ArrowLeft',
|
|
4174
|
-
'ArrowRight',
|
|
4175
|
-
'Clear',
|
|
4176
|
-
'Copy',
|
|
4177
|
-
'Paste',
|
|
4178
|
-
];
|
|
4179
|
-
this.decimal = false;
|
|
4180
|
-
this.decimalSeparator = '.';
|
|
4181
|
-
this.allowNegatives = false;
|
|
4182
|
-
this.allowPaste = true;
|
|
4183
|
-
this.negativeSign = '-';
|
|
4184
|
-
this.min = -Infinity;
|
|
4185
|
-
this.max = Infinity;
|
|
4186
|
-
this.regex = null;
|
|
4187
|
-
this.inputElement = el.nativeElement;
|
|
4188
|
-
}
|
|
4189
|
-
ngOnChanges(changes) {
|
|
4190
|
-
if (changes['pattern']) {
|
|
4191
|
-
this.regex = this.pattern ? RegExp(this.pattern) : null;
|
|
4192
|
-
}
|
|
4193
|
-
if (changes['min']) {
|
|
4194
|
-
const maybeMin = Number(this.min);
|
|
4195
|
-
this.min = isNaN(maybeMin) ? -Infinity : maybeMin;
|
|
4196
|
-
}
|
|
4197
|
-
if (changes['max']) {
|
|
4198
|
-
const maybeMax = Number(this.max);
|
|
4199
|
-
this.max = isNaN(maybeMax) ? Infinity : maybeMax;
|
|
4200
|
-
}
|
|
4201
|
-
}
|
|
4202
|
-
onBeforeInput(e) {
|
|
4203
|
-
if (isNaN(Number(e.data))) {
|
|
4204
|
-
if (e.data === this.decimalSeparator ||
|
|
4205
|
-
(e.data === this.negativeSign && this.allowNegatives)) {
|
|
4206
|
-
return; // go on
|
|
4207
|
-
}
|
|
4208
|
-
e.preventDefault();
|
|
4209
|
-
e.stopPropagation();
|
|
4210
|
-
}
|
|
4211
|
-
}
|
|
4212
|
-
onKeyDown(e) {
|
|
4213
|
-
console.log("called");
|
|
4214
|
-
if (this.navigationKeys.indexOf(e.key) > -1 || // Allow: navigation keys: backspace, delete, arrows etc.
|
|
4215
|
-
((e.key === 'a' || e.code === 'KeyA') && e.ctrlKey === true) || // Allow: Ctrl+A
|
|
4216
|
-
((e.key === 'c' || e.code === 'KeyC') && e.ctrlKey === true) || // Allow: Ctrl+C
|
|
4217
|
-
((e.key === 'v' || e.code === 'KeyV') && e.ctrlKey === true) || // Allow: Ctrl+V
|
|
4218
|
-
((e.key === 'x' || e.code === 'KeyX') && e.ctrlKey === true) || // Allow: Ctrl+X
|
|
4219
|
-
((e.key === 'a' || e.code === 'KeyA') && e.metaKey === true) || // Allow: Cmd+A (Mac)
|
|
4220
|
-
((e.key === 'c' || e.code === 'KeyC') && e.metaKey === true) || // Allow: Cmd+C (Mac)
|
|
4221
|
-
((e.key === 'v' || e.code === 'KeyV') && e.metaKey === true) || // Allow: Cmd+V (Mac)
|
|
4222
|
-
((e.key === 'x' || e.code === 'KeyX') && e.metaKey === true) // Allow: Cmd+X (Mac)
|
|
4223
|
-
) {
|
|
4224
|
-
// let it happen, don't do anything
|
|
4225
|
-
return;
|
|
4226
|
-
}
|
|
4227
|
-
let newValue = '';
|
|
4228
|
-
if (this.decimal && e.key === this.decimalSeparator) {
|
|
4229
|
-
newValue = this.forecastValue(e.key);
|
|
4230
|
-
if (newValue.split(this.decimalSeparator).length > 2) {
|
|
4231
|
-
// has two or more decimal points
|
|
4232
|
-
e.preventDefault();
|
|
4233
|
-
return;
|
|
4234
|
-
}
|
|
4235
|
-
else {
|
|
4236
|
-
this.hasDecimalPoint = newValue.indexOf(this.decimalSeparator) > -1;
|
|
4237
|
-
return; // Allow: only one decimal point
|
|
4238
|
-
}
|
|
4239
|
-
}
|
|
4240
|
-
if (e.key === this.negativeSign && this.allowNegatives) {
|
|
4241
|
-
newValue = this.forecastValue(e.key);
|
|
4242
|
-
if (newValue.charAt(0) !== this.negativeSign ||
|
|
4243
|
-
newValue.split(this.negativeSign).length > 2) {
|
|
4244
|
-
e.preventDefault();
|
|
4245
|
-
return;
|
|
4246
|
-
}
|
|
4247
|
-
else {
|
|
4248
|
-
this.hasNegativeSign = newValue.split(this.negativeSign).length > -1;
|
|
4249
|
-
return;
|
|
4250
|
-
}
|
|
4251
|
-
}
|
|
4252
|
-
// Ensure that it is a number and stop the keypress
|
|
4253
|
-
if (e.key === ' ' || isNaN(Number(e.key))) {
|
|
4254
|
-
e.preventDefault();
|
|
4255
|
-
return;
|
|
4256
|
-
}
|
|
4257
|
-
newValue = newValue || this.forecastValue(e.key);
|
|
4258
|
-
// check the input pattern RegExp
|
|
4259
|
-
if (this.regex) {
|
|
4260
|
-
if (!this.regex.test(newValue)) {
|
|
4261
|
-
e.preventDefault();
|
|
4262
|
-
return;
|
|
4263
|
-
}
|
|
4264
|
-
}
|
|
4265
|
-
const newNumber = Number(newValue);
|
|
4266
|
-
if (newNumber > this.max || newNumber < this.min) {
|
|
4267
|
-
e.preventDefault();
|
|
4268
|
-
}
|
|
4269
|
-
}
|
|
4270
|
-
onPaste(event) {
|
|
4271
|
-
if (this.allowPaste === true) {
|
|
4272
|
-
let pastedInput = '';
|
|
4273
|
-
if (window['clipboardData']) {
|
|
4274
|
-
// Browser is IE
|
|
4275
|
-
pastedInput = window['clipboardData'].getData('text');
|
|
4276
|
-
}
|
|
4277
|
-
else if (event.clipboardData && event.clipboardData.getData) {
|
|
4278
|
-
// Other browsers
|
|
4279
|
-
pastedInput = event.clipboardData.getData('text/plain');
|
|
4280
|
-
}
|
|
4281
|
-
this.pasteData(pastedInput);
|
|
4282
|
-
event.preventDefault();
|
|
4283
|
-
}
|
|
4284
|
-
else {
|
|
4285
|
-
// this prevents the paste
|
|
4286
|
-
event.preventDefault();
|
|
4287
|
-
event.stopPropagation();
|
|
4288
|
-
}
|
|
4289
|
-
}
|
|
4290
|
-
onDrop(event) {
|
|
4291
|
-
var _a, _b;
|
|
4292
|
-
const textData = (_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.getData('text')) !== null && _b !== void 0 ? _b : '';
|
|
4293
|
-
this.inputElement.focus();
|
|
4294
|
-
this.pasteData(textData);
|
|
4295
|
-
event.preventDefault();
|
|
4296
|
-
}
|
|
4297
|
-
pasteData(pastedContent) {
|
|
4298
|
-
const sanitizedContent = this.sanitizeInput(pastedContent);
|
|
4299
|
-
if (sanitizedContent.includes(this.negativeSign) &&
|
|
4300
|
-
this.hasNegativeSign &&
|
|
4301
|
-
!this.getSelection().includes(this.negativeSign)) {
|
|
4302
|
-
return;
|
|
4303
|
-
}
|
|
4304
|
-
const pasted = document.execCommand('insertText', false, sanitizedContent);
|
|
4305
|
-
if (!pasted) {
|
|
4306
|
-
if (this.inputElement.setRangeText) {
|
|
4307
|
-
const { selectionStart: start, selectionEnd: end } = this.inputElement;
|
|
4308
|
-
this.inputElement.setRangeText(sanitizedContent, start !== null && start !== void 0 ? start : 0, end !== null && end !== void 0 ? end : 0, 'end');
|
|
4309
|
-
// Angular's Reactive Form relies on "input" event, but on Firefox, the setRangeText method doesn't trigger it
|
|
4310
|
-
// so we have to trigger it ourself.
|
|
4311
|
-
if (typeof window['InstallTrigger'] !==
|
|
4312
|
-
'undefined') {
|
|
4313
|
-
this.inputElement.dispatchEvent(new Event('input', { cancelable: true }));
|
|
4314
|
-
}
|
|
4315
|
-
}
|
|
4316
|
-
else {
|
|
4317
|
-
// Browser does not support setRangeText, e.g. IE
|
|
4318
|
-
this.insertAtCursor(this.inputElement, sanitizedContent);
|
|
4319
|
-
}
|
|
4320
|
-
}
|
|
4321
|
-
if (this.decimal) {
|
|
4322
|
-
this.hasDecimalPoint =
|
|
4323
|
-
this.inputElement.value.indexOf(this.decimalSeparator) > -1;
|
|
4324
|
-
}
|
|
4325
|
-
this.hasNegativeSign =
|
|
4326
|
-
this.inputElement.value.indexOf(this.negativeSign) > -1;
|
|
4327
|
-
}
|
|
4328
|
-
// The following 2 methods were added from the below article for browsers that do not support setRangeText
|
|
4329
|
-
// https://stackoverflow.com/questions/11076975/how-to-insert-text-into-the-textarea-at-the-current-cursor-position
|
|
4330
|
-
insertAtCursor(myField, myValue) {
|
|
4331
|
-
var _a, _b;
|
|
4332
|
-
const startPos = (_a = myField.selectionStart) !== null && _a !== void 0 ? _a : 0;
|
|
4333
|
-
const endPos = (_b = myField.selectionEnd) !== null && _b !== void 0 ? _b : 0;
|
|
4334
|
-
myField.value =
|
|
4335
|
-
myField.value.substring(0, startPos) +
|
|
4336
|
-
myValue +
|
|
4337
|
-
myField.value.substring(endPos, myField.value.length);
|
|
4338
|
-
const pos = startPos + myValue.length;
|
|
4339
|
-
myField.focus();
|
|
4340
|
-
myField.setSelectionRange(pos, pos);
|
|
4341
|
-
this.triggerEvent(myField, 'input');
|
|
4342
|
-
}
|
|
4343
|
-
triggerEvent(el, type) {
|
|
4344
|
-
if ('createEvent' in document) {
|
|
4345
|
-
// modern browsers, IE9+
|
|
4346
|
-
const e = document.createEvent('HTMLEvents');
|
|
4347
|
-
e.initEvent(type, false, true);
|
|
4348
|
-
el.dispatchEvent(e);
|
|
4349
|
-
}
|
|
4350
|
-
}
|
|
4351
|
-
// end stack overflow code
|
|
4352
|
-
sanitizeInput(input) {
|
|
4353
|
-
let result = '';
|
|
4354
|
-
let regex;
|
|
4355
|
-
if (this.decimal && this.isValidDecimal(input)) {
|
|
4356
|
-
regex = new RegExp(`${this.getNegativeSignRegExp()}[^0-9${this.decimalSeparator}]`, 'g');
|
|
4357
|
-
}
|
|
4358
|
-
else {
|
|
4359
|
-
regex = new RegExp(`${this.getNegativeSignRegExp()}[^0-9]`, 'g');
|
|
4360
|
-
}
|
|
4361
|
-
result = input.replace(regex, '');
|
|
4362
|
-
const maxLength = this.inputElement.maxLength;
|
|
4363
|
-
if (maxLength > 0) {
|
|
4364
|
-
// the input element has maxLength limit
|
|
4365
|
-
const allowedLength = maxLength -
|
|
4366
|
-
this.inputElement.value.length +
|
|
4367
|
-
(result.includes(`${this.negativeSign}`) ? 1 : 0);
|
|
4368
|
-
result = allowedLength > 0 ? result.substring(0, allowedLength) : '';
|
|
4369
|
-
}
|
|
4370
|
-
return result;
|
|
4371
|
-
}
|
|
4372
|
-
getNegativeSignRegExp() {
|
|
4373
|
-
return this.allowNegatives &&
|
|
4374
|
-
(!this.hasNegativeSign || this.getSelection().includes(this.negativeSign))
|
|
4375
|
-
? `(?!^${this.negativeSign})`
|
|
4376
|
-
: '';
|
|
4377
|
-
}
|
|
4378
|
-
isValidDecimal(string) {
|
|
4379
|
-
if (!this.hasDecimalPoint) {
|
|
4380
|
-
return string.split(this.decimalSeparator).length <= 2;
|
|
4381
|
-
}
|
|
4382
|
-
else {
|
|
4383
|
-
// the input element already has a decimal separator
|
|
4384
|
-
const selectedText = this.getSelection();
|
|
4385
|
-
if (selectedText && selectedText.indexOf(this.decimalSeparator) > -1) {
|
|
4386
|
-
return string.split(this.decimalSeparator).length <= 2;
|
|
4387
|
-
}
|
|
4388
|
-
else {
|
|
4389
|
-
return string.indexOf(this.decimalSeparator) < 0;
|
|
4390
|
-
}
|
|
4391
|
-
}
|
|
4392
|
-
}
|
|
4393
|
-
getSelection() {
|
|
4394
|
-
var _a, _b;
|
|
4395
|
-
return this.inputElement.value.substring((_a = this.inputElement.selectionStart) !== null && _a !== void 0 ? _a : 0, (_b = this.inputElement.selectionEnd) !== null && _b !== void 0 ? _b : 0);
|
|
4396
|
-
}
|
|
4397
|
-
forecastValue(key) {
|
|
4398
|
-
var _a, _b;
|
|
4399
|
-
const selectionStart = (_a = this.inputElement.selectionStart) !== null && _a !== void 0 ? _a : 0;
|
|
4400
|
-
const selectionEnd = (_b = this.inputElement.selectionEnd) !== null && _b !== void 0 ? _b : 0;
|
|
4401
|
-
const oldValue = this.inputElement.value;
|
|
4402
|
-
return (oldValue.substring(0, selectionStart) +
|
|
4403
|
-
key +
|
|
4404
|
-
oldValue.substring(selectionEnd));
|
|
4405
|
-
}
|
|
4406
|
-
}
|
|
4407
|
-
DigitOnlyDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DigitOnlyDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4408
|
-
DigitOnlyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.7", type: DigitOnlyDirective, selector: "[digitOnly]", inputs: { decimal: "decimal", decimalSeparator: "decimalSeparator", allowNegatives: "allowNegatives", allowPaste: "allowPaste", negativeSign: "negativeSign", min: "min", max: "max", pattern: "pattern" }, host: { listeners: { "beforeinput": "onBeforeInput($event)", "keydown": "onKeyDown($event)", "paste": "onPaste($event)", "drop": "onDrop($event)" } }, usesOnChanges: true, ngImport: i0 });
|
|
4409
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DigitOnlyDirective, decorators: [{
|
|
4410
|
-
type: Directive,
|
|
4411
|
-
args: [{
|
|
4412
|
-
selector: '[digitOnly]',
|
|
4413
|
-
}]
|
|
4414
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { decimal: [{
|
|
4415
|
-
type: Input
|
|
4416
|
-
}], decimalSeparator: [{
|
|
4417
|
-
type: Input
|
|
4418
|
-
}], allowNegatives: [{
|
|
4419
|
-
type: Input
|
|
4420
|
-
}], allowPaste: [{
|
|
4421
|
-
type: Input
|
|
4422
|
-
}], negativeSign: [{
|
|
4423
|
-
type: Input
|
|
4424
|
-
}], min: [{
|
|
4425
|
-
type: Input
|
|
4426
|
-
}], max: [{
|
|
4427
|
-
type: Input
|
|
4428
|
-
}], pattern: [{
|
|
4429
|
-
type: Input
|
|
4430
|
-
}], onBeforeInput: [{
|
|
4431
|
-
type: HostListener,
|
|
4432
|
-
args: ['beforeinput', ['$event']]
|
|
4433
|
-
}], onKeyDown: [{
|
|
4434
|
-
type: HostListener,
|
|
4435
|
-
args: ['keydown', ['$event']]
|
|
4436
|
-
}], onPaste: [{
|
|
4437
|
-
type: HostListener,
|
|
4438
|
-
args: ['paste', ['$event']]
|
|
4439
|
-
}], onDrop: [{
|
|
4440
|
-
type: HostListener,
|
|
4441
|
-
args: ['drop', ['$event']]
|
|
4442
|
-
}] } });
|
|
4443
|
-
|
|
4444
4160
|
// Angular import statements
|
|
4445
4161
|
class AnnaCoreModule {
|
|
4446
4162
|
}
|
|
@@ -4464,8 +4180,7 @@ AnnaCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version:
|
|
|
4464
4180
|
AnnaVirtualTableDirective,
|
|
4465
4181
|
AnnaNonEditableGenericTableComponent,
|
|
4466
4182
|
AnnaTableVirtualScrollViewportComponent,
|
|
4467
|
-
AnnaFixedRowSizeTableVirtualScrollStrategyDirective,
|
|
4468
|
-
DigitOnlyDirective], imports: [CommonModule,
|
|
4183
|
+
AnnaFixedRowSizeTableVirtualScrollStrategyDirective], imports: [CommonModule,
|
|
4469
4184
|
NgbModule,
|
|
4470
4185
|
FormsModule,
|
|
4471
4186
|
MatRadioModule,
|
|
@@ -4492,8 +4207,7 @@ AnnaCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version:
|
|
|
4492
4207
|
AnnaVirtualTableDirective,
|
|
4493
4208
|
AnnaNonEditableGenericTableComponent,
|
|
4494
4209
|
AnnaTableVirtualScrollViewportComponent,
|
|
4495
|
-
AnnaFixedRowSizeTableVirtualScrollStrategyDirective
|
|
4496
|
-
DigitOnlyDirective] });
|
|
4210
|
+
AnnaFixedRowSizeTableVirtualScrollStrategyDirective] });
|
|
4497
4211
|
AnnaCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: AnnaCoreModule, imports: [[
|
|
4498
4212
|
CommonModule,
|
|
4499
4213
|
NgbModule,
|
|
@@ -4537,7 +4251,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImpor
|
|
|
4537
4251
|
AnnaNonEditableGenericTableComponent,
|
|
4538
4252
|
AnnaTableVirtualScrollViewportComponent,
|
|
4539
4253
|
AnnaFixedRowSizeTableVirtualScrollStrategyDirective,
|
|
4540
|
-
DigitOnlyDirective
|
|
4541
4254
|
],
|
|
4542
4255
|
imports: [
|
|
4543
4256
|
CommonModule,
|
|
@@ -4578,8 +4291,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImpor
|
|
|
4578
4291
|
AnnaVirtualTableDirective,
|
|
4579
4292
|
AnnaNonEditableGenericTableComponent,
|
|
4580
4293
|
AnnaTableVirtualScrollViewportComponent,
|
|
4581
|
-
AnnaFixedRowSizeTableVirtualScrollStrategyDirective
|
|
4582
|
-
DigitOnlyDirective
|
|
4294
|
+
AnnaFixedRowSizeTableVirtualScrollStrategyDirective
|
|
4583
4295
|
]
|
|
4584
4296
|
}]
|
|
4585
4297
|
}] });
|
|
@@ -4628,5 +4340,5 @@ var Days;
|
|
|
4628
4340
|
* Generated bundle index. Do not edit.
|
|
4629
4341
|
*/
|
|
4630
4342
|
|
|
4631
|
-
export { AllSelectedStatus, AnnaBuyerApprovalIconTemplateComponent, AnnaCalendarFilterComponent, AnnaConvertZeroOrNullOrUndefinedPipe, AnnaCoreModule, AnnaDateTimeFormatService, AnnaFilterSearchedTextPipe, AnnaFilterService, AnnaFixedRowSizeTableVirtualScrollStrategy, AnnaFixedRowSizeTableVirtualScrollStrategyDirective, AnnaGenericTableService, AnnaGlobalConfigService, AnnaIconColumnComponent, AnnaLiveIconTemplateComponent, AnnaNoDataComponent, AnnaNonEditableGenericTableComponent, AnnaNotifyIconTemplateComponent, AnnaPayForPerformanceIconTemplateComponent, AnnaRejectedIconTemplateComponent, AnnaReplaceCharPipe, AnnaSortComponent, AnnaSortService, AnnaTableVirtualScrollViewportComponent, AnnaTypeofDataPipe, AnnaVirtualTableDirective, AnnaWeekCalendarComponent, Constants, Days,
|
|
4343
|
+
export { AllSelectedStatus, AnnaBuyerApprovalIconTemplateComponent, AnnaCalendarFilterComponent, AnnaConvertZeroOrNullOrUndefinedPipe, AnnaCoreModule, AnnaDateTimeFormatService, AnnaFilterSearchedTextPipe, AnnaFilterService, AnnaFixedRowSizeTableVirtualScrollStrategy, AnnaFixedRowSizeTableVirtualScrollStrategyDirective, AnnaGenericTableService, AnnaGlobalConfigService, AnnaIconColumnComponent, AnnaLiveIconTemplateComponent, AnnaNoDataComponent, AnnaNonEditableGenericTableComponent, AnnaNotifyIconTemplateComponent, AnnaPayForPerformanceIconTemplateComponent, AnnaRejectedIconTemplateComponent, AnnaReplaceCharPipe, AnnaSortComponent, AnnaSortService, AnnaTableVirtualScrollViewportComponent, AnnaTypeofDataPipe, AnnaVirtualTableDirective, AnnaWeekCalendarComponent, Constants, Days, ErrorCodes, TooltipModel, fixedSizeVirtualScrollStrategyFactory, radioButtonModel, showEllipsisTextOnHoverDirective, tooltipModelForColumnLevelFiltering };
|
|
4632
4344
|
//# sourceMappingURL=annalib-anna-core.mjs.map
|