@datarailsshared/datarailsshared 1.4.187 → 1.4.188

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.
Files changed (34) hide show
  1. package/bundles/datarailsshared-datarailsshared.umd.js +884 -0
  2. package/bundles/datarailsshared-datarailsshared.umd.js.map +1 -1
  3. package/datarailsshared-datarailsshared-1.4.188.tgz +0 -0
  4. package/datarailsshared-datarailsshared.d.ts +1 -0
  5. package/datarailsshared-datarailsshared.metadata.json +1 -1
  6. package/esm2015/datarailsshared-datarailsshared.js +2 -1
  7. package/esm2015/lib/dr-treeview/components/treeview/treeview.component.js +210 -0
  8. package/esm2015/lib/dr-treeview/components/treeview-item/treeview-item.component.js +58 -0
  9. package/esm2015/lib/dr-treeview/dr-tree-view.module.js +38 -0
  10. package/esm2015/lib/dr-treeview/helpers/treeview-event-parser.js +97 -0
  11. package/esm2015/lib/dr-treeview/helpers/treeview-helper.js +82 -0
  12. package/esm2015/lib/dr-treeview/models/treeview-config.js +22 -0
  13. package/esm2015/lib/dr-treeview/models/treeview-header-template-context.js +2 -0
  14. package/esm2015/lib/dr-treeview/models/treeview-i18n.js +42 -0
  15. package/esm2015/lib/dr-treeview/models/treeview-item-template-context.js +2 -0
  16. package/esm2015/lib/dr-treeview/models/treeview-item.js +155 -0
  17. package/esm2015/lib/dr-treeview/pipes/treeview.pipe.js +17 -0
  18. package/esm2015/public-api.js +10 -1
  19. package/fesm2015/datarailsshared-datarailsshared.js +695 -2
  20. package/fesm2015/datarailsshared-datarailsshared.js.map +1 -1
  21. package/lib/dr-treeview/components/treeview/treeview.component.d.ts +39 -0
  22. package/lib/dr-treeview/components/treeview-item/treeview-item.component.d.ts +15 -0
  23. package/lib/dr-treeview/dr-tree-view.module.d.ts +4 -0
  24. package/lib/dr-treeview/helpers/treeview-event-parser.d.ts +21 -0
  25. package/lib/dr-treeview/helpers/treeview-helper.d.ts +16 -0
  26. package/lib/dr-treeview/models/treeview-config.d.ts +15 -0
  27. package/lib/dr-treeview/models/treeview-header-template-context.d.ts +9 -0
  28. package/lib/dr-treeview/models/treeview-i18n.d.ts +15 -0
  29. package/lib/dr-treeview/models/treeview-item-template-context.d.ts +6 -0
  30. package/lib/dr-treeview/models/treeview-item.d.ts +35 -0
  31. package/lib/dr-treeview/pipes/treeview.pipe.d.ts +5 -0
  32. package/package.json +1 -1
  33. package/public-api.d.ts +9 -0
  34. package/datarailsshared-datarailsshared-1.4.187.tgz +0 -0
@@ -3,7 +3,7 @@ import { EventEmitter, Component, ViewEncapsulation, Input, Output, HostBinding,
3
3
  import { DateAdapter, MAT_DATE_LOCALE, MAT_DATE_FORMATS, MatNativeDateModule } from '@angular/material/core';
4
4
  import { MomentDateAdapter, MAT_MOMENT_DATE_ADAPTER_OPTIONS } from '@angular/material-moment-adapter';
5
5
  import * as _ from 'lodash';
6
- import { find, map, merge, forEach, some, orderBy, cloneDeep, filter as filter$1, indexOf, reduce, isObject, isNil, isNumber, includes } from 'lodash';
6
+ import { find, map, merge, forEach, some, isNil, pull, concat, isString, isBoolean, includes, orderBy, cloneDeep, filter as filter$1, indexOf, reduce, isObject, isNumber } from 'lodash';
7
7
  import { NG_VALUE_ACCESSOR, FormGroupDirective, FormGroup, FormControl, NgModel, NgControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
8
8
  import { isPlatformBrowser, DOCUMENT, CommonModule } from '@angular/common';
9
9
  import { Subject, from, merge as merge$1, fromEvent, noop as noop$1, BehaviorSubject } from 'rxjs';
@@ -4017,6 +4017,614 @@ DrChatComponent.propDecorators = {
4017
4017
  _chatSuggestions: [{ type: ViewChild, args: [DrChatSuggestionsComponent,] }]
4018
4018
  };
4019
4019
 
4020
+ class TreeviewI18n {
4021
+ }
4022
+ TreeviewI18n.decorators = [
4023
+ { type: Injectable }
4024
+ ];
4025
+ class DefaultTreeviewI18n extends TreeviewI18n {
4026
+ getText(selection) {
4027
+ if (selection.uncheckedItems.length === 0) {
4028
+ if (selection.checkedItems.length > 0) {
4029
+ return this.getAllCheckboxText();
4030
+ }
4031
+ else {
4032
+ return '';
4033
+ }
4034
+ }
4035
+ switch (selection.checkedItems.length) {
4036
+ case 0:
4037
+ return 'Select options';
4038
+ case 1:
4039
+ return selection.checkedItems[0].text;
4040
+ default:
4041
+ return `${selection.checkedItems.length} options selected`;
4042
+ }
4043
+ }
4044
+ getAllCheckboxText() {
4045
+ return 'All';
4046
+ }
4047
+ getFilterPlaceholder() {
4048
+ return 'Filter';
4049
+ }
4050
+ getFilterNoItemsFoundText() {
4051
+ return 'No items found';
4052
+ }
4053
+ getTooltipCollapseExpandText(isCollapse) {
4054
+ return isCollapse ? 'Expand' : 'Collapse';
4055
+ }
4056
+ }
4057
+ DefaultTreeviewI18n.decorators = [
4058
+ { type: Injectable }
4059
+ ];
4060
+
4061
+ const TreeviewHelper = {
4062
+ findItem,
4063
+ findItemInList,
4064
+ findParent,
4065
+ removeItem,
4066
+ concatSelection
4067
+ };
4068
+ function findItem(root, value) {
4069
+ if (isNil(root)) {
4070
+ return undefined;
4071
+ }
4072
+ if (root.value === value) {
4073
+ return root;
4074
+ }
4075
+ if (root.children) {
4076
+ for (const child of root.children) {
4077
+ const foundItem = findItem(child, value);
4078
+ if (foundItem) {
4079
+ return foundItem;
4080
+ }
4081
+ }
4082
+ }
4083
+ return undefined;
4084
+ }
4085
+ function findItemInList(list, value) {
4086
+ if (isNil(list)) {
4087
+ return undefined;
4088
+ }
4089
+ for (const item of list) {
4090
+ const foundItem = findItem(item, value);
4091
+ if (foundItem) {
4092
+ return foundItem;
4093
+ }
4094
+ }
4095
+ return undefined;
4096
+ }
4097
+ function findParent(root, item) {
4098
+ if (isNil(root) || isNil(root.children)) {
4099
+ return undefined;
4100
+ }
4101
+ for (const child of root.children) {
4102
+ if (child === item) {
4103
+ return root;
4104
+ }
4105
+ else {
4106
+ const parent = findParent(child, item);
4107
+ if (parent) {
4108
+ return parent;
4109
+ }
4110
+ }
4111
+ }
4112
+ return undefined;
4113
+ }
4114
+ function removeItem(root, item) {
4115
+ const parent = findParent(root, item);
4116
+ if (parent) {
4117
+ pull(parent.children, item);
4118
+ if (parent.children.length === 0) {
4119
+ parent.children = undefined;
4120
+ }
4121
+ else {
4122
+ parent.correctChecked();
4123
+ }
4124
+ return true;
4125
+ }
4126
+ return false;
4127
+ }
4128
+ function concatSelection(items, checked, unchecked) {
4129
+ let checkedItems = [...checked];
4130
+ let uncheckedItems = [...unchecked];
4131
+ for (const item of items) {
4132
+ const selection = item.getSelection();
4133
+ checkedItems = concat(checkedItems, selection.checkedItems);
4134
+ uncheckedItems = concat(uncheckedItems, selection.uncheckedItems);
4135
+ }
4136
+ return {
4137
+ checked: checkedItems,
4138
+ unchecked: uncheckedItems
4139
+ };
4140
+ }
4141
+
4142
+ class TreeviewItem {
4143
+ constructor(item, autoCorrectChecked = false) {
4144
+ this.internalDisabled = false;
4145
+ this.internalChecked = true;
4146
+ this.internalCollapsed = false;
4147
+ if (isNil(item)) {
4148
+ throw new Error('Item must be defined');
4149
+ }
4150
+ if (isString(item.text)) {
4151
+ this.text = item.text;
4152
+ }
4153
+ else {
4154
+ throw new Error('A text of item must be string object');
4155
+ }
4156
+ this.value = item.value;
4157
+ if (isBoolean(item.checked)) {
4158
+ this.checked = item.checked;
4159
+ }
4160
+ if (isBoolean(item.collapsed)) {
4161
+ this.collapsed = item.collapsed;
4162
+ }
4163
+ if (isBoolean(item.disabled)) {
4164
+ this.disabled = item.disabled;
4165
+ }
4166
+ if (!isNil(item.children) && item.children.length > 0) {
4167
+ this.children = item.children.map(child => {
4168
+ if (this.disabled === true) {
4169
+ child.disabled = true;
4170
+ }
4171
+ return new TreeviewItem(child);
4172
+ });
4173
+ }
4174
+ if (autoCorrectChecked) {
4175
+ this.correctChecked();
4176
+ }
4177
+ }
4178
+ get checked() {
4179
+ return this.internalChecked;
4180
+ }
4181
+ set checked(value) {
4182
+ if (!this.internalDisabled) {
4183
+ if (this.internalChecked !== value) {
4184
+ this.internalChecked = value;
4185
+ }
4186
+ }
4187
+ }
4188
+ get indeterminate() {
4189
+ return this.checked === undefined;
4190
+ }
4191
+ setCheckedRecursive(value) {
4192
+ if (!this.internalDisabled) {
4193
+ this.internalChecked = value;
4194
+ if (!isNil(this.internalChildren)) {
4195
+ this.internalChildren.forEach(child => child.setCheckedRecursive(value));
4196
+ }
4197
+ }
4198
+ }
4199
+ get disabled() {
4200
+ return this.internalDisabled;
4201
+ }
4202
+ set disabled(value) {
4203
+ if (this.internalDisabled !== value) {
4204
+ this.internalDisabled = value;
4205
+ if (!isNil(this.internalChildren)) {
4206
+ this.internalChildren.forEach(child => child.disabled = value);
4207
+ }
4208
+ }
4209
+ }
4210
+ get collapsed() {
4211
+ return this.internalCollapsed;
4212
+ }
4213
+ set collapsed(value) {
4214
+ if (this.internalCollapsed !== value) {
4215
+ this.internalCollapsed = value;
4216
+ }
4217
+ }
4218
+ setCollapsedRecursive(value) {
4219
+ this.internalCollapsed = value;
4220
+ if (!isNil(this.internalChildren)) {
4221
+ this.internalChildren.forEach(child => child.setCollapsedRecursive(value));
4222
+ }
4223
+ }
4224
+ get children() {
4225
+ return this.internalChildren;
4226
+ }
4227
+ set children(value) {
4228
+ if (this.internalChildren !== value) {
4229
+ if (!isNil(value) && value.length === 0) {
4230
+ throw new Error('Children must be not an empty array');
4231
+ }
4232
+ this.internalChildren = value;
4233
+ if (!isNil(this.internalChildren)) {
4234
+ let checked = null;
4235
+ this.internalChildren.forEach(child => {
4236
+ if (checked === null) {
4237
+ checked = child.checked;
4238
+ }
4239
+ else {
4240
+ if (child.checked !== checked) {
4241
+ checked = undefined;
4242
+ return;
4243
+ }
4244
+ }
4245
+ });
4246
+ this.internalChecked = checked;
4247
+ }
4248
+ }
4249
+ }
4250
+ getSelection() {
4251
+ let checkedItems = [];
4252
+ let uncheckedItems = [];
4253
+ if (isNil(this.internalChildren)) {
4254
+ if (this.internalChecked) {
4255
+ checkedItems.push(this);
4256
+ }
4257
+ else {
4258
+ uncheckedItems.push(this);
4259
+ }
4260
+ }
4261
+ else {
4262
+ const selection = TreeviewHelper.concatSelection(this.internalChildren, checkedItems, uncheckedItems);
4263
+ checkedItems = selection.checked;
4264
+ uncheckedItems = selection.unchecked;
4265
+ }
4266
+ return {
4267
+ checkedItems,
4268
+ uncheckedItems
4269
+ };
4270
+ }
4271
+ correctChecked() {
4272
+ this.internalChecked = this.getCorrectChecked();
4273
+ }
4274
+ getCorrectChecked() {
4275
+ let checked = null;
4276
+ if (!isNil(this.internalChildren)) {
4277
+ for (const child of this.internalChildren) {
4278
+ child.internalChecked = child.getCorrectChecked();
4279
+ if (checked === null) {
4280
+ checked = child.internalChecked;
4281
+ }
4282
+ else if (checked !== child.internalChecked) {
4283
+ checked = undefined;
4284
+ break;
4285
+ }
4286
+ }
4287
+ }
4288
+ else {
4289
+ checked = this.checked;
4290
+ }
4291
+ return checked;
4292
+ }
4293
+ }
4294
+
4295
+ class TreeviewConfig {
4296
+ constructor() {
4297
+ this.hasAllCheckBox = true;
4298
+ this.hasFilter = false;
4299
+ this.hasCollapseExpand = false;
4300
+ this.decoupleChildFromParent = false;
4301
+ this.maxHeight = 500;
4302
+ }
4303
+ get hasDivider() {
4304
+ return this.hasFilter || this.hasAllCheckBox || this.hasCollapseExpand;
4305
+ }
4306
+ static create(fields) {
4307
+ const config = new TreeviewConfig();
4308
+ Object.assign(config, fields);
4309
+ return config;
4310
+ }
4311
+ }
4312
+ TreeviewConfig.decorators = [
4313
+ { type: Injectable }
4314
+ ];
4315
+
4316
+ class TreeviewEventParser {
4317
+ }
4318
+ TreeviewEventParser.decorators = [
4319
+ { type: Injectable }
4320
+ ];
4321
+ class DefaultTreeviewEventParser extends TreeviewEventParser {
4322
+ getSelectedChange(component) {
4323
+ const checkedItems = component.selection.checkedItems;
4324
+ if (!isNil(checkedItems)) {
4325
+ return checkedItems.map(item => item.value);
4326
+ }
4327
+ return [];
4328
+ }
4329
+ }
4330
+ DefaultTreeviewEventParser.decorators = [
4331
+ { type: Injectable }
4332
+ ];
4333
+ class DownlineTreeviewEventParser extends TreeviewEventParser {
4334
+ getSelectedChange(component) {
4335
+ const items = component.items;
4336
+ if (!isNil(items)) {
4337
+ let result = [];
4338
+ items.forEach(item => {
4339
+ const links = this.getLinks(item, null);
4340
+ if (!isNil(links)) {
4341
+ result = result.concat(links);
4342
+ }
4343
+ });
4344
+ return result;
4345
+ }
4346
+ return [];
4347
+ }
4348
+ getLinks(item, parent) {
4349
+ if (!isNil(item.children)) {
4350
+ const link = {
4351
+ item,
4352
+ parent
4353
+ };
4354
+ let result = [];
4355
+ item.children.forEach(child => {
4356
+ const links = this.getLinks(child, link);
4357
+ if (!isNil(links)) {
4358
+ result = result.concat(links);
4359
+ }
4360
+ });
4361
+ return result;
4362
+ }
4363
+ if (item.checked) {
4364
+ return [{
4365
+ item,
4366
+ parent
4367
+ }];
4368
+ }
4369
+ return null;
4370
+ }
4371
+ }
4372
+ DownlineTreeviewEventParser.decorators = [
4373
+ { type: Injectable }
4374
+ ];
4375
+ class OrderDownlineTreeviewEventParser extends TreeviewEventParser {
4376
+ constructor() {
4377
+ super(...arguments);
4378
+ this.currentDownlines = [];
4379
+ this.parser = new DownlineTreeviewEventParser();
4380
+ }
4381
+ getSelectedChange(component) {
4382
+ const newDownlines = this.parser.getSelectedChange(component);
4383
+ if (this.currentDownlines.length === 0) {
4384
+ this.currentDownlines = newDownlines;
4385
+ }
4386
+ else {
4387
+ const intersectDownlines = [];
4388
+ this.currentDownlines.forEach(downline => {
4389
+ let foundIndex = -1;
4390
+ const length = newDownlines.length;
4391
+ for (let i = 0; i < length; i++) {
4392
+ if (downline.item.value === newDownlines[i].item.value) {
4393
+ foundIndex = i;
4394
+ break;
4395
+ }
4396
+ }
4397
+ if (foundIndex !== -1) {
4398
+ intersectDownlines.push(newDownlines[foundIndex]);
4399
+ newDownlines.splice(foundIndex, 1);
4400
+ }
4401
+ });
4402
+ this.currentDownlines = intersectDownlines.concat(newDownlines);
4403
+ }
4404
+ return this.currentDownlines;
4405
+ }
4406
+ }
4407
+ OrderDownlineTreeviewEventParser.decorators = [
4408
+ { type: Injectable }
4409
+ ];
4410
+
4411
+ class FilterTreeviewItem extends TreeviewItem {
4412
+ constructor(item) {
4413
+ super({
4414
+ text: item.text,
4415
+ value: item.value,
4416
+ disabled: item.disabled,
4417
+ checked: item.checked,
4418
+ collapsed: item.collapsed,
4419
+ children: item.children
4420
+ });
4421
+ this.refItem = item;
4422
+ }
4423
+ updateRefChecked() {
4424
+ this.children.forEach(child => {
4425
+ if (child instanceof FilterTreeviewItem) {
4426
+ child.updateRefChecked();
4427
+ }
4428
+ });
4429
+ let refChecked = this.checked;
4430
+ if (refChecked) {
4431
+ for (const refChild of this.refItem.children) {
4432
+ if (!refChild.checked) {
4433
+ refChecked = false;
4434
+ break;
4435
+ }
4436
+ }
4437
+ }
4438
+ this.refItem.checked = refChecked;
4439
+ }
4440
+ }
4441
+ class TreeviewComponent {
4442
+ constructor(i18n, defaultConfig, eventParser) {
4443
+ this.i18n = i18n;
4444
+ this.defaultConfig = defaultConfig;
4445
+ this.eventParser = eventParser;
4446
+ this.selectedChange = new EventEmitter();
4447
+ this.filterChange = new EventEmitter();
4448
+ this.filterText = '';
4449
+ this.config = this.defaultConfig;
4450
+ this.allItem = new TreeviewItem({ text: 'All', value: undefined });
4451
+ }
4452
+ get hasFilterItems() {
4453
+ return !isNil(this.filterItems) && this.filterItems.length > 0;
4454
+ }
4455
+ get maxHeight() {
4456
+ return `${this.config.maxHeight}`;
4457
+ }
4458
+ ngOnInit() {
4459
+ this.createHeaderTemplateContext();
4460
+ this.generateSelection();
4461
+ }
4462
+ ngOnChanges(changes) {
4463
+ const itemsSimpleChange = changes.items;
4464
+ if (!isNil(itemsSimpleChange) && !isNil(this.items)) {
4465
+ this.updateFilterItems();
4466
+ this.updateCollapsedOfAll();
4467
+ this.raiseSelectedChange();
4468
+ }
4469
+ }
4470
+ onAllCollapseExpand() {
4471
+ this.allItem.collapsed = !this.allItem.collapsed;
4472
+ this.filterItems.forEach(item => item.setCollapsedRecursive(this.allItem.collapsed));
4473
+ }
4474
+ onFilterTextChange(text) {
4475
+ this.filterText = text;
4476
+ this.filterChange.emit(text);
4477
+ this.updateFilterItems();
4478
+ }
4479
+ onAllCheckedChange() {
4480
+ const checked = this.allItem.checked;
4481
+ this.filterItems.forEach(item => {
4482
+ item.setCheckedRecursive(checked);
4483
+ if (item instanceof FilterTreeviewItem) {
4484
+ item.updateRefChecked();
4485
+ }
4486
+ });
4487
+ this.raiseSelectedChange();
4488
+ }
4489
+ onItemCheckedChange(item, checked) {
4490
+ if (item instanceof FilterTreeviewItem) {
4491
+ item.updateRefChecked();
4492
+ }
4493
+ this.updateCheckedOfAll();
4494
+ this.raiseSelectedChange();
4495
+ }
4496
+ raiseSelectedChange() {
4497
+ this.generateSelection();
4498
+ const values = this.eventParser.getSelectedChange(this);
4499
+ setTimeout(() => {
4500
+ this.selectedChange.emit(values);
4501
+ });
4502
+ }
4503
+ createHeaderTemplateContext() {
4504
+ this.headerTemplateContext = {
4505
+ config: this.config,
4506
+ item: this.allItem,
4507
+ onCheckedChange: () => this.onAllCheckedChange(),
4508
+ onCollapseExpand: () => this.onAllCollapseExpand(),
4509
+ onFilterTextChange: (text) => this.onFilterTextChange(text)
4510
+ };
4511
+ }
4512
+ generateSelection() {
4513
+ let checkedItems = [];
4514
+ let uncheckedItems = [];
4515
+ if (!isNil(this.items)) {
4516
+ const selection = TreeviewHelper.concatSelection(this.items, checkedItems, uncheckedItems);
4517
+ checkedItems = selection.checked;
4518
+ uncheckedItems = selection.unchecked;
4519
+ }
4520
+ this.selection = {
4521
+ checkedItems,
4522
+ uncheckedItems
4523
+ };
4524
+ }
4525
+ updateFilterItems() {
4526
+ if (this.filterText !== '') {
4527
+ const filterItems = [];
4528
+ const filterText = this.filterText.toLowerCase();
4529
+ this.items.forEach(item => {
4530
+ const newItem = this.filterItem(item, filterText);
4531
+ if (!isNil(newItem)) {
4532
+ filterItems.push(newItem);
4533
+ }
4534
+ });
4535
+ this.filterItems = filterItems;
4536
+ }
4537
+ else {
4538
+ this.filterItems = this.items;
4539
+ }
4540
+ this.updateCheckedOfAll();
4541
+ }
4542
+ filterItem(item, filterText) {
4543
+ const isMatch = includes(item.text.toLowerCase(), filterText);
4544
+ if (isMatch) {
4545
+ return item;
4546
+ }
4547
+ else {
4548
+ if (!isNil(item.children)) {
4549
+ const children = [];
4550
+ item.children.forEach(child => {
4551
+ const newChild = this.filterItem(child, filterText);
4552
+ if (!isNil(newChild)) {
4553
+ children.push(newChild);
4554
+ }
4555
+ });
4556
+ if (children.length > 0) {
4557
+ const newItem = new FilterTreeviewItem(item);
4558
+ newItem.collapsed = false;
4559
+ newItem.children = children;
4560
+ return newItem;
4561
+ }
4562
+ }
4563
+ }
4564
+ return undefined;
4565
+ }
4566
+ updateCheckedOfAll() {
4567
+ let itemChecked = null;
4568
+ for (const filterItem of this.filterItems) {
4569
+ if (itemChecked === null) {
4570
+ itemChecked = filterItem.checked;
4571
+ }
4572
+ else if (itemChecked !== filterItem.checked) {
4573
+ itemChecked = undefined;
4574
+ break;
4575
+ }
4576
+ }
4577
+ if (itemChecked === null) {
4578
+ itemChecked = false;
4579
+ }
4580
+ this.allItem.checked = itemChecked;
4581
+ }
4582
+ updateCollapsedOfAll() {
4583
+ let hasItemExpanded = false;
4584
+ for (const filterItem of this.filterItems) {
4585
+ if (!filterItem.collapsed) {
4586
+ hasItemExpanded = true;
4587
+ break;
4588
+ }
4589
+ }
4590
+ this.allItem.collapsed = !hasItemExpanded;
4591
+ }
4592
+ }
4593
+ TreeviewComponent.decorators = [
4594
+ { type: Component, args: [{
4595
+ selector: 'ngx-treeview',
4596
+ template: "<ng-template #defaultItemTemplate let-item=\"item\" let-onCollapseExpand=\"onCollapseExpand\"\n let-onCheckedChange=\"onCheckedChange\">\n <div class=\"form-inline row-item\">\n <i *ngIf=\"item.children\" (click)=\"onCollapseExpand()\" aria-hidden=\"true\" [ngSwitch]=\"item.collapsed\">\n <svg *ngSwitchCase=\"true\" width=\"0.8rem\" height=\"0.8rem\" viewBox=\"0 0 16 16\" class=\"bi bi-caret-right-fill\"\n fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M12.14 8.753l-5.482 4.796c-.646.566-1.658.106-1.658-.753V3.204a1 1 0 0 1 1.659-.753l5.48 4.796a1 1 0 0 1 0 1.506z\" />\n </svg>\n <svg *ngSwitchCase=\"false\" width=\"0.8rem\" height=\"0.8rem\" viewBox=\"0 0 16 16\" class=\"bi bi-caret-down-fill\"\n fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z\" />\n </svg>\n </i>\n <div class=\"form-check\">\n <input type=\"checkbox\" class=\"form-check-input\" [(ngModel)]=\"item.checked\" (ngModelChange)=\"onCheckedChange()\"\n [disabled]=\"item.disabled\" [indeterminate]=\"item.indeterminate\" />\n <label class=\"form-check-label\" (click)=\"item.checked = !item.checked; onCheckedChange()\">\n {{item.text}}\n </label>\n </div>\n </div>\n</ng-template>\n<ng-template #defaultHeaderTemplate let-config=\"config\" let-item=\"item\" let-onCollapseExpand=\"onCollapseExpand\"\n let-onCheckedChange=\"onCheckedChange\" let-onFilterTextChange=\"onFilterTextChange\">\n <div *ngIf=\"config.hasFilter\" class=\"row row-filter\">\n <div class=\"col-12\">\n <input class=\"form-control\" type=\"text\" [placeholder]=\"i18n.getFilterPlaceholder()\" [(ngModel)]=\"filterText\"\n (ngModelChange)=\"onFilterTextChange($event)\" />\n </div>\n </div>\n <div *ngIf=\"hasFilterItems\">\n <div *ngIf=\"config.hasAllCheckBox || config.hasCollapseExpand\" class=\"row row-all\">\n <div class=\"col-12\">\n <div class=\"form-check form-check-inline\" *ngIf=\"config.hasAllCheckBox\">\n <input type=\"checkbox\" class=\"form-check-input\" [(ngModel)]=\"item.checked\" (ngModelChange)=\"onCheckedChange()\"\n [indeterminate]=\"item.indeterminate\" />\n <label class=\"form-check-label\" (click)=\"item.checked = !item.checked; onCheckedChange()\">\n {{i18n.getAllCheckboxText()}}\n </label>\n </div>\n <label *ngIf=\"config.hasCollapseExpand\" class=\"float-right form-check-label\" (click)=\"onCollapseExpand()\">\n <i [title]=\"i18n.getTooltipCollapseExpandText(item.collapsed)\" aria-hidden=\"true\" [ngSwitch]=\"item.collapsed\">\n <svg *ngSwitchCase=\"true\" width=\"1em\" height=\"1em\" viewBox=\"0 0 16 16\" class=\"bi bi-arrows-angle-expand\"\n fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\"\n d=\"M1.5 10.036a.5.5 0 0 1 .5.5v3.5h3.5a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5z\" />\n <path fill-rule=\"evenodd\"\n d=\"M6.354 9.646a.5.5 0 0 1 0 .708l-4.5 4.5a.5.5 0 0 1-.708-.708l4.5-4.5a.5.5 0 0 1 .708 0zm8.5-8.5a.5.5 0 0 1 0 .708l-4.5 4.5a.5.5 0 0 1-.708-.708l4.5-4.5a.5.5 0 0 1 .708 0z\" />\n <path fill-rule=\"evenodd\"\n d=\"M10.036 1.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 .5.5v4a.5.5 0 1 1-1 0V2h-3.5a.5.5 0 0 1-.5-.5z\" />\n </svg>\n <svg *ngSwitchCase=\"false\" width=\"1em\" height=\"1em\" viewBox=\"0 0 16 16\" class=\"bi bi-arrows-angle-contract\"\n fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\"\n d=\"M9.5 2.036a.5.5 0 0 1 .5.5v3.5h3.5a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5z\" />\n <path fill-rule=\"evenodd\"\n d=\"M14.354 1.646a.5.5 0 0 1 0 .708l-4.5 4.5a.5.5 0 1 1-.708-.708l4.5-4.5a.5.5 0 0 1 .708 0zm-7.5 7.5a.5.5 0 0 1 0 .708l-4.5 4.5a.5.5 0 0 1-.708-.708l4.5-4.5a.5.5 0 0 1 .708 0z\" />\n <path fill-rule=\"evenodd\"\n d=\"M2.036 9.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-1 0V10h-3.5a.5.5 0 0 1-.5-.5z\" />\n </svg>\n </i>\n </label>\n </div>\n </div>\n <div *ngIf=\"config.hasDivider\" class=\"dropdown-divider\"></div>\n </div>\n</ng-template>\n<div class=\"treeview-header\">\n <ng-template [ngTemplateOutlet]=\"headerTemplate || defaultHeaderTemplate\"\n [ngTemplateOutletContext]=\"headerTemplateContext\">\n </ng-template>\n</div>\n<div [ngSwitch]=\"hasFilterItems\">\n <div *ngSwitchCase=\"true\" class=\"treeview-container\" [style.max-height.px]=\"maxHeight\">\n <ngx-treeview-item *ngFor=\"let item of filterItems\" [config]=\"config\" [item]=\"item\"\n [template]=\"itemTemplate || defaultItemTemplate\" (checkedChange)=\"onItemCheckedChange(item, $event)\">\n </ngx-treeview-item>\n </div>\n <div *ngSwitchCase=\"false\" class=\"treeview-text\">\n {{i18n.getFilterNoItemsFoundText()}}\n </div>\n</div>\n",
4597
+ styles: [":host .treeview-header .row-filter{margin-bottom:.5rem}:host .treeview-header .row-all .bi{cursor:pointer}:host .treeview-container .row-item{margin-bottom:.3rem;flex-wrap:nowrap}:host .treeview-container .row-item .bi{cursor:pointer;margin-right:.3rem}.treeview-container{overflow-y:auto;padding-right:.3rem}.treeview-text{padding:.3rem 0;white-space:nowrap}\n"]
4598
+ },] }
4599
+ ];
4600
+ TreeviewComponent.ctorParameters = () => [
4601
+ { type: TreeviewI18n },
4602
+ { type: TreeviewConfig },
4603
+ { type: TreeviewEventParser }
4604
+ ];
4605
+ TreeviewComponent.propDecorators = {
4606
+ headerTemplate: [{ type: Input }],
4607
+ itemTemplate: [{ type: Input }],
4608
+ items: [{ type: Input }],
4609
+ config: [{ type: Input }],
4610
+ selectedChange: [{ type: Output }],
4611
+ filterChange: [{ type: Output }]
4612
+ };
4613
+
4614
+ class TreeviewPipe {
4615
+ transform(objects, textField) {
4616
+ if (isNil(objects)) {
4617
+ return undefined;
4618
+ }
4619
+ return objects.map(object => new TreeviewItem({ text: object[textField], value: object }));
4620
+ }
4621
+ }
4622
+ TreeviewPipe.decorators = [
4623
+ { type: Pipe, args: [{
4624
+ name: 'ngxTreeview'
4625
+ },] }
4626
+ ];
4627
+
4020
4628
  var TooltipPosition;
4021
4629
  (function (TooltipPosition) {
4022
4630
  TooltipPosition["TOP"] = "top";
@@ -6182,11 +6790,96 @@ DrBadgeStatusModule.decorators = [
6182
6790
  },] }
6183
6791
  ];
6184
6792
 
6793
+ class TreeviewItemComponent {
6794
+ constructor(defaultConfig) {
6795
+ this.defaultConfig = defaultConfig;
6796
+ this.checkedChange = new EventEmitter();
6797
+ this.onCollapseExpand = () => {
6798
+ this.item.collapsed = !this.item.collapsed;
6799
+ };
6800
+ this.onCheckedChange = () => {
6801
+ const checked = this.item.checked;
6802
+ if (!isNil(this.item.children) && !this.config.decoupleChildFromParent) {
6803
+ this.item.children.forEach(child => child.setCheckedRecursive(checked));
6804
+ }
6805
+ this.checkedChange.emit(checked);
6806
+ };
6807
+ this.config = this.defaultConfig;
6808
+ }
6809
+ onChildCheckedChange(child, checked) {
6810
+ if (!this.config.decoupleChildFromParent) {
6811
+ let itemChecked = null;
6812
+ for (const childItem of this.item.children) {
6813
+ if (itemChecked === null) {
6814
+ itemChecked = childItem.checked;
6815
+ }
6816
+ else if (itemChecked !== childItem.checked) {
6817
+ itemChecked = undefined;
6818
+ break;
6819
+ }
6820
+ }
6821
+ if (itemChecked === null) {
6822
+ itemChecked = false;
6823
+ }
6824
+ if (this.item.checked !== itemChecked) {
6825
+ this.item.checked = itemChecked;
6826
+ }
6827
+ }
6828
+ this.checkedChange.emit(checked);
6829
+ }
6830
+ }
6831
+ TreeviewItemComponent.decorators = [
6832
+ { type: Component, args: [{
6833
+ selector: 'ngx-treeview-item',
6834
+ template: "<div *ngIf=\"item\" class=\"treeview-item\">\n <ng-template [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{item: item, onCollapseExpand: onCollapseExpand, onCheckedChange: onCheckedChange}\">\n </ng-template>\n <div *ngIf=\"!item.collapsed\">\n <ngx-treeview-item [config]=\"config\" *ngFor=\"let child of item.children\" [item]=\"child\" [template]=\"template\"\n (checkedChange)=\"onChildCheckedChange(child, $event)\">\n </ngx-treeview-item>\n </div>\n</div>\n",
6835
+ styles: [":host{display:block}:host .treeview-item{white-space:nowrap}:host .treeview-item .treeview-item{margin-left:2rem}\n"]
6836
+ },] }
6837
+ ];
6838
+ TreeviewItemComponent.ctorParameters = () => [
6839
+ { type: TreeviewConfig }
6840
+ ];
6841
+ TreeviewItemComponent.propDecorators = {
6842
+ config: [{ type: Input }],
6843
+ template: [{ type: Input }],
6844
+ item: [{ type: Input }],
6845
+ checkedChange: [{ type: Output }]
6846
+ };
6847
+
6848
+ class TreeviewModule {
6849
+ static forRoot() {
6850
+ return {
6851
+ ngModule: TreeviewModule,
6852
+ providers: [
6853
+ TreeviewConfig,
6854
+ { provide: TreeviewEventParser, useClass: DefaultTreeviewEventParser }
6855
+ ]
6856
+ };
6857
+ }
6858
+ }
6859
+ TreeviewModule.decorators = [
6860
+ { type: NgModule, args: [{
6861
+ imports: [
6862
+ FormsModule,
6863
+ CommonModule
6864
+ ],
6865
+ declarations: [
6866
+ TreeviewComponent,
6867
+ TreeviewItemComponent,
6868
+ TreeviewPipe
6869
+ ],
6870
+ exports: [
6871
+ TreeviewComponent,
6872
+ TreeviewPipe,
6873
+ ],
6874
+ providers: [],
6875
+ },] }
6876
+ ];
6877
+
6185
6878
  /* components */
6186
6879
 
6187
6880
  /**
6188
6881
  * Generated bundle index. Do not edit.
6189
6882
  */
6190
6883
 
6191
- export { AnyTagComponent, BadgeStatus, CHAT_MESSAGE_TYPE, CalendarView, ChatMessage, ChatRole, CheckboxComponent, CustomDateFormat, DIALOG_BUTTON_LABEL, DIALOG_FIELD_TYPE, DIALOG_SIZE, DateFromats, DatePickerPeriodPosition, DateTagComponent, DateTagModule, DateTags, DayTagComponent, DialogService, DrAccordionComponent, DrAccordionItemBodyComponent, DrAccordionItemComponent, DrAccordionItemHeaderComponent, DrAccordionModule, DrAvatarComponent, DrAvatarModule, DrAvatarPipe, DrBadgeStatusModule, DrButtonComponent, DrChatComponent, DrChatModule, DrDetailsListComponent, DrDetailsListModule, DrDialogModule, DrDropdownComponent, DrDropdownDirective, DrDropdownItemShowPipe, DrDropdownModule, DrDropdownPositionDirective, DrDropdownService, DrErrorComponent, DrErrorModule, DrInputComponent, DrInputsModule, DrLayoutBodyComponent, DrLayoutComponent, DrLayoutHeaderComponent, DrLayoutModule, DrModelDebounceChangeDirective, DrPopoverAlignmentDimension, DrPopoverComponent, DrPopoverDirective, DrPopoverModule, DrPopoverRef, DrPopoverService, DrScenarioModule, DrSelectComponent, DrSharedUtils, DrSpinnerComponent, DrSpinnerDirective, DrSpinnerModule, DrStepperModule, DrTabComponent, DrTabsComponent, DrTabsModule, DrTagComponent, DrTagModule, DrToggleButtonComponent, DrToggleComponent, DrTooltipDirective, DrTooltipModule, ForecastTagComponent, IMAGE_TYPES, ListTagComponent, ListTagModule, MonthTagComponent, QuarterTagComponent, RadioButtonComponent, RadioGroupComponent, Scenario, ScenarioService, SpinnerSize, SpinnerType, TagTypes, TimeframeOption, ToggleButtonMode, TooltipComponent, TooltipPosition, WeekTagComponent, YearTagComponent, components$2 as ɵa, POPUP_ANIMATION as ɵb, DrScenarioConfigurationComponent as ɵba, DrScenarioTagConfigurationComponent as ɵbb, DrBadgeStatusComponent as ɵbc, DrChatCustomMessageService as ɵc, DrChatMessageComponent as ɵd, DrChatFormComponent as ɵe, DrChatSuggestionsComponent as ɵf, DrDatePickerComponent as ɵg, DrDatePickerService as ɵh, DrDatePickerWithTimeframeComponent as ɵi, DrDatePickerFormatDirective as ɵj, DrDatePickerCustomHeaderComponent as ɵk, DrShowTimeframePipe as ɵl, DrSelectAddItemComponent as ɵm, TooltipInfoComponent as ɵn, TooltipInfoSimpleComponent as ɵo, TooltipNoBodyComponent as ɵp, TooltipProcessDefaultComponent as ɵq, DrDynamicTagModule as ɵr, DrDynamicTagComponent as ɵs, StepperComponent as ɵt, DialogWrapperComponent as ɵu, DialogModalWrapperComponent as ɵv, DrChatMessageTextComponent as ɵw, DrChatMessageFileComponent as ɵx, DrDotFlashingComponent as ɵy, DrChatCustomMessageDirective as ɵz };
6884
+ export { AnyTagComponent, BadgeStatus, CHAT_MESSAGE_TYPE, CalendarView, ChatMessage, ChatRole, CheckboxComponent, CustomDateFormat, DIALOG_BUTTON_LABEL, DIALOG_FIELD_TYPE, DIALOG_SIZE, DateFromats, DatePickerPeriodPosition, DateTagComponent, DateTagModule, DateTags, DayTagComponent, DefaultTreeviewEventParser, DefaultTreeviewI18n, DialogService, DownlineTreeviewEventParser, DrAccordionComponent, DrAccordionItemBodyComponent, DrAccordionItemComponent, DrAccordionItemHeaderComponent, DrAccordionModule, DrAvatarComponent, DrAvatarModule, DrAvatarPipe, DrBadgeStatusModule, DrButtonComponent, DrChatComponent, DrChatModule, DrDetailsListComponent, DrDetailsListModule, DrDialogModule, DrDropdownComponent, DrDropdownDirective, DrDropdownItemShowPipe, DrDropdownModule, DrDropdownPositionDirective, DrDropdownService, DrErrorComponent, DrErrorModule, DrInputComponent, DrInputsModule, DrLayoutBodyComponent, DrLayoutComponent, DrLayoutHeaderComponent, DrLayoutModule, DrModelDebounceChangeDirective, DrPopoverAlignmentDimension, DrPopoverComponent, DrPopoverDirective, DrPopoverModule, DrPopoverRef, DrPopoverService, DrScenarioModule, DrSelectComponent, DrSharedUtils, DrSpinnerComponent, DrSpinnerDirective, DrSpinnerModule, DrStepperModule, DrTabComponent, DrTabsComponent, DrTabsModule, DrTagComponent, DrTagModule, DrToggleButtonComponent, DrToggleComponent, DrTooltipDirective, DrTooltipModule, ForecastTagComponent, IMAGE_TYPES, ListTagComponent, ListTagModule, MonthTagComponent, OrderDownlineTreeviewEventParser, QuarterTagComponent, RadioButtonComponent, RadioGroupComponent, Scenario, ScenarioService, SpinnerSize, SpinnerType, TagTypes, TimeframeOption, ToggleButtonMode, TooltipComponent, TooltipPosition, TreeviewComponent, TreeviewConfig, TreeviewEventParser, TreeviewHelper, TreeviewI18n, TreeviewItem, TreeviewModule, TreeviewPipe, WeekTagComponent, YearTagComponent, components$2 as ɵa, POPUP_ANIMATION as ɵb, DrScenarioConfigurationComponent as ɵba, DrScenarioTagConfigurationComponent as ɵbb, DrBadgeStatusComponent as ɵbc, TreeviewItemComponent as ɵbd, DrChatCustomMessageService as ɵc, DrChatMessageComponent as ɵd, DrChatFormComponent as ɵe, DrChatSuggestionsComponent as ɵf, DrDatePickerComponent as ɵg, DrDatePickerService as ɵh, DrDatePickerWithTimeframeComponent as ɵi, DrDatePickerFormatDirective as ɵj, DrDatePickerCustomHeaderComponent as ɵk, DrShowTimeframePipe as ɵl, DrSelectAddItemComponent as ɵm, TooltipInfoComponent as ɵn, TooltipInfoSimpleComponent as ɵo, TooltipNoBodyComponent as ɵp, TooltipProcessDefaultComponent as ɵq, DrDynamicTagModule as ɵr, DrDynamicTagComponent as ɵs, StepperComponent as ɵt, DialogWrapperComponent as ɵu, DialogModalWrapperComponent as ɵv, DrChatMessageTextComponent as ɵw, DrChatMessageFileComponent as ɵx, DrDotFlashingComponent as ɵy, DrChatCustomMessageDirective as ɵz };
6192
6885
  //# sourceMappingURL=datarailsshared-datarailsshared.js.map