@datarailsshared/datarailsshared 1.3.31 → 1.3.32

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.
@@ -1271,7 +1271,7 @@
1271
1271
  });
1272
1272
  RadioGroupComponent.prototype.ngAfterContentInit = function () {
1273
1273
  var _this = this;
1274
- // In case option 'name' isn't set on nb-radio component,
1274
+ // In case option 'name' isn't set on dr-radio component,
1275
1275
  // we need to set it's name right away, so it won't overlap with options
1276
1276
  // without names from other radio groups. Otherwise they all would have
1277
1277
  // same name and will be considered as options from one group so only the
@@ -3241,6 +3241,322 @@
3241
3241
  tabsContentList: [{ type: i0.ContentChildren, args: [DrTabComponent,] }]
3242
3242
  };
3243
3243
 
3244
+ var DrAccordionComponent = /** @class */ (function () {
3245
+ function DrAccordionComponent() {
3246
+ this.openCloseItems = new rxjs.Subject();
3247
+ this.multiValue = false;
3248
+ }
3249
+ Object.defineProperty(DrAccordionComponent.prototype, "multi", {
3250
+ /**
3251
+ * Allow multiple items to be expanded at the same time.
3252
+ */
3253
+ get: function () {
3254
+ return this.multiValue;
3255
+ },
3256
+ set: function (val) {
3257
+ this.multiValue = !!val;
3258
+ },
3259
+ enumerable: false,
3260
+ configurable: true
3261
+ });
3262
+ /**
3263
+ * Opens all enabled accordion items.
3264
+ */
3265
+ DrAccordionComponent.prototype.openAll = function () {
3266
+ if (this.multi) {
3267
+ this.openCloseItems.next(false);
3268
+ }
3269
+ };
3270
+ /**
3271
+ * Closes all enabled accordion items.
3272
+ */
3273
+ DrAccordionComponent.prototype.closeAll = function () {
3274
+ this.openCloseItems.next(true);
3275
+ };
3276
+ return DrAccordionComponent;
3277
+ }());
3278
+ DrAccordionComponent.decorators = [
3279
+ { type: i0.Component, args: [{
3280
+ selector: 'dr-accordion',
3281
+ template: '<ng-content select="dr-accordion-item"></ng-content>',
3282
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
3283
+ styles: [":host{display:block;box-shadow:#2c33491a 0 5px 10px}\n"]
3284
+ },] }
3285
+ ];
3286
+ DrAccordionComponent.propDecorators = {
3287
+ multi: [{ type: i0.Input, args: ['multi',] }]
3288
+ };
3289
+
3290
+ var DrAccordionItemComponent = /** @class */ (function () {
3291
+ function DrAccordionItemComponent(accordion, cd) {
3292
+ this.accordion = accordion;
3293
+ this.cd = cd;
3294
+ /**
3295
+ * Emits whenever the expanded state of the accordion changes.
3296
+ * Primarily used to facilitate two-way binding.
3297
+ */
3298
+ this.collapsedChange = new i0.EventEmitter();
3299
+ this.accordionItemInvalidate = new rxjs.Subject();
3300
+ this.collapsedValue = true;
3301
+ this.disabledValue = false;
3302
+ this.destroy$ = new rxjs.Subject();
3303
+ }
3304
+ Object.defineProperty(DrAccordionItemComponent.prototype, "collapsed", {
3305
+ /**
3306
+ * Item is collapse (`true` by default)
3307
+ * @type {boolean}
3308
+ */
3309
+ get: function () {
3310
+ return this.collapsedValue;
3311
+ },
3312
+ set: function (val) {
3313
+ this.collapsedValue = !!val;
3314
+ this.collapsedChange.emit(this.collapsedValue);
3315
+ this.invalidate();
3316
+ },
3317
+ enumerable: false,
3318
+ configurable: true
3319
+ });
3320
+ Object.defineProperty(DrAccordionItemComponent.prototype, "expanded", {
3321
+ /**
3322
+ * Item is expanded (`false` by default)
3323
+ */
3324
+ get: function () {
3325
+ return !this.collapsed;
3326
+ },
3327
+ set: function (val) {
3328
+ this.collapsedValue = !val;
3329
+ },
3330
+ enumerable: false,
3331
+ configurable: true
3332
+ });
3333
+ Object.defineProperty(DrAccordionItemComponent.prototype, "disabled", {
3334
+ /**
3335
+ * Item is disabled and cannot be opened.
3336
+ * @type {boolean}
3337
+ */
3338
+ get: function () {
3339
+ return this.disabledValue;
3340
+ },
3341
+ set: function (val) {
3342
+ this.disabledValue = !!val;
3343
+ this.invalidate();
3344
+ },
3345
+ enumerable: false,
3346
+ configurable: true
3347
+ });
3348
+ /**
3349
+ * Open/close the item
3350
+ */
3351
+ DrAccordionItemComponent.prototype.toggle = function () {
3352
+ if (!this.disabled) {
3353
+ // we need this temporary variable as `openCloseItems.next` will change current value we need to save
3354
+ var willSet = !this.collapsed;
3355
+ if (!this.accordion.multi) {
3356
+ this.accordion.openCloseItems.next(true);
3357
+ }
3358
+ this.collapsed = willSet;
3359
+ }
3360
+ };
3361
+ /**
3362
+ * Open the item.
3363
+ */
3364
+ DrAccordionItemComponent.prototype.open = function () {
3365
+ if (!this.disabled) {
3366
+ this.collapsed = false;
3367
+ }
3368
+ };
3369
+ /**
3370
+ * Collapse the item.
3371
+ */
3372
+ DrAccordionItemComponent.prototype.close = function () {
3373
+ if (!this.disabled) {
3374
+ this.collapsed = true;
3375
+ }
3376
+ };
3377
+ DrAccordionItemComponent.prototype.ngOnInit = function () {
3378
+ var _this = this;
3379
+ this.accordion.openCloseItems
3380
+ .pipe(operators.takeUntil(this.destroy$))
3381
+ .subscribe(function (collapsed) {
3382
+ if (!_this.disabled) {
3383
+ _this.collapsed = collapsed;
3384
+ }
3385
+ });
3386
+ };
3387
+ DrAccordionItemComponent.prototype.ngOnChanges = function (changes) {
3388
+ this.accordionItemInvalidate.next(true);
3389
+ };
3390
+ DrAccordionItemComponent.prototype.ngOnDestroy = function () {
3391
+ this.destroy$.next();
3392
+ this.destroy$.complete();
3393
+ this.accordionItemInvalidate.complete();
3394
+ };
3395
+ DrAccordionItemComponent.prototype.invalidate = function () {
3396
+ this.accordionItemInvalidate.next(true);
3397
+ this.cd.markForCheck();
3398
+ };
3399
+ return DrAccordionItemComponent;
3400
+ }());
3401
+ DrAccordionItemComponent.decorators = [
3402
+ { type: i0.Component, args: [{
3403
+ selector: 'dr-accordion-item',
3404
+ template: "\n <ng-content select=\"dr-accordion-item-header\"></ng-content>\n <ng-content select=\"dr-accordion-item-body\"></ng-content>\n ",
3405
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
3406
+ styles: [":host{background-color:#fff;color:#222b45;font-family:\"Poppins\",sans-serif;font-size:16px;font-weight:400;line-height:1.25rem;display:flex;flex-direction:column}\n"]
3407
+ },] }
3408
+ ];
3409
+ DrAccordionItemComponent.ctorParameters = function () { return [
3410
+ { type: DrAccordionComponent, decorators: [{ type: i0.Host }] },
3411
+ { type: i0.ChangeDetectorRef }
3412
+ ]; };
3413
+ DrAccordionItemComponent.propDecorators = {
3414
+ collapsed: [{ type: i0.Input, args: ['collapsed',] }, { type: i0.HostBinding, args: ['class.collapsed',] }],
3415
+ expanded: [{ type: i0.Input, args: ['expanded',] }, { type: i0.HostBinding, args: ['class.expanded',] }],
3416
+ disabled: [{ type: i0.Input, args: ['disabled',] }, { type: i0.HostBinding, args: ['class.disabled',] }],
3417
+ collapsedChange: [{ type: i0.Output }]
3418
+ };
3419
+
3420
+ var DrAccordionItemHeaderComponent = /** @class */ (function () {
3421
+ function DrAccordionItemHeaderComponent(accordionItem, cd) {
3422
+ this.accordionItem = accordionItem;
3423
+ this.cd = cd;
3424
+ this.destroy$ = new rxjs.Subject();
3425
+ }
3426
+ Object.defineProperty(DrAccordionItemHeaderComponent.prototype, "isCollapsed", {
3427
+ get: function () {
3428
+ return this.accordionItem.collapsed;
3429
+ },
3430
+ enumerable: false,
3431
+ configurable: true
3432
+ });
3433
+ Object.defineProperty(DrAccordionItemHeaderComponent.prototype, "expanded", {
3434
+ get: function () {
3435
+ return !this.accordionItem.collapsed;
3436
+ },
3437
+ enumerable: false,
3438
+ configurable: true
3439
+ });
3440
+ Object.defineProperty(DrAccordionItemHeaderComponent.prototype, "tabbable", {
3441
+ get: function () {
3442
+ return this.accordionItem.disabled ? '-1' : '0';
3443
+ },
3444
+ enumerable: false,
3445
+ configurable: true
3446
+ });
3447
+ Object.defineProperty(DrAccordionItemHeaderComponent.prototype, "disabled", {
3448
+ get: function () {
3449
+ return this.accordionItem.disabled;
3450
+ },
3451
+ enumerable: false,
3452
+ configurable: true
3453
+ });
3454
+ DrAccordionItemHeaderComponent.prototype.toggle = function () {
3455
+ this.accordionItem.toggle();
3456
+ };
3457
+ Object.defineProperty(DrAccordionItemHeaderComponent.prototype, "state", {
3458
+ get: function () {
3459
+ if (this.isCollapsed) {
3460
+ return 'collapsed';
3461
+ }
3462
+ return 'expanded';
3463
+ },
3464
+ enumerable: false,
3465
+ configurable: true
3466
+ });
3467
+ DrAccordionItemHeaderComponent.prototype.ngOnInit = function () {
3468
+ var _this = this;
3469
+ this.accordionItem.accordionItemInvalidate
3470
+ .pipe(operators.takeUntil(this.destroy$))
3471
+ .subscribe(function () { return _this.cd.markForCheck(); });
3472
+ };
3473
+ DrAccordionItemHeaderComponent.prototype.ngOnDestroy = function () {
3474
+ this.destroy$.next();
3475
+ this.destroy$.complete();
3476
+ };
3477
+ return DrAccordionItemHeaderComponent;
3478
+ }());
3479
+ DrAccordionItemHeaderComponent.decorators = [
3480
+ { type: i0.Component, args: [{
3481
+ selector: 'dr-accordion-item-header',
3482
+ template: "\n <ng-content select=\"dr-accordion-item-title\"></ng-content>\n <ng-content select=\"dr-accordion-item-description\"></ng-content>\n <ng-content></ng-content>\n <i class=\"dr-icon-arrow-down expansion-indicator\"\n [@expansionIndicator]=\"state\"\n *ngIf=\"!disabled\">\n </i>\n ",
3483
+ animations: [
3484
+ animations.trigger('expansionIndicator', [
3485
+ animations.state('expanded', animations.style({
3486
+ transform: 'rotate(180deg)',
3487
+ })),
3488
+ animations.transition('collapsed => expanded', animations.animate('100ms ease-in')),
3489
+ animations.transition('expanded => collapsed', animations.animate('100ms ease-out')),
3490
+ ]),
3491
+ ],
3492
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
3493
+ styles: [":host{display:flex;align-items:center;cursor:pointer;position:relative;border-bottom:1px solid #edf1f7;color:#222b45;font-family:\"Poppins\",sans-serif;font-size:13px;font-weight:600;line-height:1.5rem;padding:1.25rem;text-transform:capitalize}:host:focus{outline:0}:host .expansion-indicator{font-size:24px;position:absolute;right:10px;font-weight:700}\n"]
3494
+ },] }
3495
+ ];
3496
+ DrAccordionItemHeaderComponent.ctorParameters = function () { return [
3497
+ { type: DrAccordionItemComponent, decorators: [{ type: i0.Host }] },
3498
+ { type: i0.ChangeDetectorRef }
3499
+ ]; };
3500
+ DrAccordionItemHeaderComponent.propDecorators = {
3501
+ isCollapsed: [{ type: i0.HostBinding, args: ['class.accordion-item-header-collapsed',] }],
3502
+ expanded: [{ type: i0.HostBinding, args: ['class.accordion-item-header-expanded',] }, { type: i0.HostBinding, args: ['attr.aria-expanded',] }],
3503
+ tabbable: [{ type: i0.HostBinding, args: ['attr.tabindex',] }],
3504
+ disabled: [{ type: i0.HostBinding, args: ['attr.aria-disabled',] }],
3505
+ toggle: [{ type: i0.HostListener, args: ['click',] }, { type: i0.HostListener, args: ['keydown.space',] }, { type: i0.HostListener, args: ['keydown.enter',] }]
3506
+ };
3507
+
3508
+ var accordionItemBodyTrigger = animations.trigger('accordionItemBody', [
3509
+ animations.state('collapsed', animations.style({
3510
+ overflow: 'hidden',
3511
+ visibility: 'hidden',
3512
+ height: 0,
3513
+ })),
3514
+ animations.state('expanded', animations.style({
3515
+ overflow: 'hidden',
3516
+ visibility: 'visible',
3517
+ })),
3518
+ animations.transition('collapsed => expanded', animations.animate('100ms ease-in')),
3519
+ animations.transition('expanded => collapsed', animations.animate('100ms ease-out')),
3520
+ ]);
3521
+ var DrAccordionItemBodyComponent = /** @class */ (function () {
3522
+ function DrAccordionItemBodyComponent(accordionItem, cd) {
3523
+ this.accordionItem = accordionItem;
3524
+ this.cd = cd;
3525
+ this.destroy$ = new rxjs.Subject();
3526
+ }
3527
+ Object.defineProperty(DrAccordionItemBodyComponent.prototype, "state", {
3528
+ get: function () {
3529
+ return this.accordionItem.collapsed ? 'collapsed' : 'expanded';
3530
+ },
3531
+ enumerable: false,
3532
+ configurable: true
3533
+ });
3534
+ DrAccordionItemBodyComponent.prototype.ngOnInit = function () {
3535
+ var _this = this;
3536
+ this.accordionItem.accordionItemInvalidate
3537
+ .pipe(operators.takeUntil(this.destroy$))
3538
+ .subscribe(function () { return _this.cd.markForCheck(); });
3539
+ };
3540
+ DrAccordionItemBodyComponent.prototype.ngOnDestroy = function () {
3541
+ this.destroy$.next();
3542
+ this.destroy$.complete();
3543
+ };
3544
+ return DrAccordionItemBodyComponent;
3545
+ }());
3546
+ DrAccordionItemBodyComponent.decorators = [
3547
+ { type: i0.Component, args: [{
3548
+ selector: 'dr-accordion-item-body',
3549
+ template: "\n <div [@accordionItemBody]=\"{ value: state }\">\n <div class=\"item-body\">\n <ng-content></ng-content>\n </div>\n </div>\n ",
3550
+ animations: [accordionItemBodyTrigger],
3551
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
3552
+ styles: [".item-body{flex:1;-ms-flex:1 1 auto;overflow:auto;position:relative}\n"]
3553
+ },] }
3554
+ ];
3555
+ DrAccordionItemBodyComponent.ctorParameters = function () { return [
3556
+ { type: DrAccordionItemComponent, decorators: [{ type: i0.Host }] },
3557
+ { type: i0.ChangeDetectorRef }
3558
+ ]; };
3559
+
3244
3560
  var components$2 = [DateTagComponent,
3245
3561
  DayTagComponent,
3246
3562
  WeekTagComponent,
@@ -3491,6 +3807,26 @@
3491
3807
  },] }
3492
3808
  ];
3493
3809
 
3810
+ var DR_ACCORDION_COMPONENTS = [
3811
+ DrAccordionComponent,
3812
+ DrAccordionItemComponent,
3813
+ DrAccordionItemHeaderComponent,
3814
+ DrAccordionItemBodyComponent,
3815
+ ];
3816
+ var DrAccordionModule = /** @class */ (function () {
3817
+ function DrAccordionModule() {
3818
+ }
3819
+ return DrAccordionModule;
3820
+ }());
3821
+ DrAccordionModule.decorators = [
3822
+ { type: i0.NgModule, args: [{
3823
+ imports: [common.CommonModule],
3824
+ exports: __spreadArray([], __read(DR_ACCORDION_COMPONENTS)),
3825
+ declarations: __spreadArray([], __read(DR_ACCORDION_COMPONENTS)),
3826
+ providers: [],
3827
+ },] }
3828
+ ];
3829
+
3494
3830
  /* components */
3495
3831
 
3496
3832
  /**
@@ -3502,6 +3838,11 @@
3502
3838
  exports.DateTagComponent = DateTagComponent;
3503
3839
  exports.DateTagModule = DateTagModule;
3504
3840
  exports.DayTagComponent = DayTagComponent;
3841
+ exports.DrAccordionComponent = DrAccordionComponent;
3842
+ exports.DrAccordionItemBodyComponent = DrAccordionItemBodyComponent;
3843
+ exports.DrAccordionItemComponent = DrAccordionItemComponent;
3844
+ exports.DrAccordionItemHeaderComponent = DrAccordionItemHeaderComponent;
3845
+ exports.DrAccordionModule = DrAccordionModule;
3505
3846
  exports.DrAvatarComponent = DrAvatarComponent;
3506
3847
  exports.DrAvatarModule = DrAvatarModule;
3507
3848
  exports.DrAvatarPipe = DrAvatarPipe;