@wizishop/angular-components 0.0.200 → 0.0.204

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.
@@ -2373,90 +2373,140 @@ $wac-subtitle-color: #7A87A1!default;
2373
2373
  }
2374
2374
  }
2375
2375
  }
2376
- .wac-dropdown {
2377
- display: inline-block;
2378
- width: 40px;
2379
- height: 40px;
2380
-
2376
+ .wac-draganddrop-list {
2377
+ width: 100%;
2378
+ background-color: $wac-white;
2379
+ &--disabled {
2380
+ .wac-draganddrop-list {
2381
+ &__wrapper {
2382
+ &__item {
2383
+ margin: 0 0 10px;
2384
+ &__label {
2385
+ margin: 0;
2386
+ }
2387
+ > div {
2388
+ &:last-child {
2389
+ width: 100%;
2390
+ margin: 0;
2391
+ }
2392
+ }
2393
+ }
2394
+ }
2395
+ }
2396
+ }
2381
2397
  &__wrapper {
2382
- @include flexbox();
2383
- @include justify-content(center);
2384
- @include align-items(center);
2385
2398
  width: 100%;
2386
- height: 100%;
2387
- position: relative;
2388
-
2389
- &__icon {
2390
- font-size: 30px;
2391
- line-height: 18px;
2392
- color: $wac-second-color;
2393
- transition: color 0.3s ease, transform 0.3s ease;
2394
- }
2395
-
2396
- &__sublevel {
2397
- position: absolute;
2398
- min-width: 160px;
2399
- top: 100%;
2400
- right: 0;
2401
- z-index: -1;
2402
- opacity: 0;
2399
+ display: flex;
2400
+ flex-direction: column;
2401
+ align-items: flex-start;
2402
+ justify-content: flex-start;
2403
+ &__item {
2404
+ width: 100%;
2405
+ margin: 0 0 -4px;
2406
+ display: flex;
2403
2407
  background-color: $wac-white;
2404
- border-radius: rem(3);
2405
- box-shadow: 0px 2px 5px $wac-info-box-shadow;
2406
- visibility: hidden;
2407
- transition: opacity 0.15s ease, z-index 0.15s ease, visibility 0s linear .16s;
2408
-
2409
- &__container {
2410
- padding: 10px 10px;
2411
- border: 1px solid $wac-border-color;
2408
+ &--trigger {
2409
+ > div {
2410
+ margin: 0!important;
2411
+ width: 100% !important;
2412
+ }
2413
+ }
2414
+ &__icon {
2415
+ display: flex;
2416
+ align-items: center;
2417
+ span {
2418
+ display: block;
2419
+ width: 2px;
2420
+ height: 40px;
2421
+ margin: 0 2px 0 0;
2422
+ background-color: $wac-border-form;
2423
+ border-radius: 2px;
2424
+ }
2425
+ &:before, &:after {
2426
+ content: '';
2427
+ display: block;
2428
+ width: 2px;
2429
+ height: 40px;
2430
+ margin: 0 2px 0 0;
2431
+ background-color: $wac-border-form;
2432
+ border-radius: 2px;
2433
+ }
2434
+ }
2435
+ &__label {
2436
+ width: 100%;
2437
+ margin: 0 0 0 8px;
2438
+ min-height: 40px;
2439
+ display: flex;
2440
+ justify-content: flex-start;
2441
+ align-items: center;
2442
+ font-size: rem(14);
2443
+ line-height: 1.4;
2444
+ font-weight: 400;
2445
+ padding: 10px 20px;
2412
2446
  border-radius: 3px;
2413
-
2414
- &__item {
2415
- padding: 5.7px 10px;
2416
- font-size: 14px;
2417
- line-height: 24px;
2418
- color: $wac-second-color;
2419
- cursor: pointer;
2420
- transition: background-color 0.3s ease, color 0.3s ease;
2447
+ overflow: hidden;
2448
+ white-space: nowrap;
2449
+ text-overflow: ellipsis;
2450
+ border: 1px solid $wac-border-form;
2451
+ }
2452
+ &__input {
2453
+ width: 100%;
2454
+ margin: 0 0 0 8px;
2455
+ min-height: 40px;
2456
+ display: flex;
2457
+ justify-content: flex-start;
2458
+ align-items: center;
2459
+ overflow: hidden;
2460
+ > * {
2461
+ width: 100%;
2462
+ }
2463
+ }
2464
+ > div {
2465
+ &:first-child {
2466
+ width: 100%;
2467
+ display: flex;
2468
+ align-items: center;
2469
+ }
2470
+ &:last-child {
2471
+ width: auto;
2472
+ margin: 0 0 0 10px;
2421
2473
  display: flex;
2422
- justify-content: flex-start;
2423
2474
  align-items: center;
2424
- align-content: center;
2425
-
2426
- i {
2427
- min-width: 15px;
2428
- margin-right: 5px;
2429
- text-align: center;
2430
- }
2431
- span {
2432
- white-space: nowrap;
2433
- }
2434
-
2435
- &:hover {
2436
- background-color: $wac-gray-background;
2437
- transition: background-color 0.3s ease, color 0.3s ease;
2438
- color: $wac-input-active-color;
2439
- }
2440
2475
  }
2441
2476
  }
2442
2477
  }
2443
-
2444
- &:hover {
2445
- .wac-dropdown__wrapper__icon {
2446
- color: $wac-wizishop-blue;
2447
- transform: rotate(90deg);
2448
- transition: color 0.3s ease, transform 0.3s ease;
2449
- }
2450
-
2451
- .wac-dropdown__wrapper__sublevel {
2452
- visibility: visible;
2453
- opacity: 1;
2454
- z-index: 2;
2455
- transition: visibility 0s ease 0s, opacity 0.3s ease .1s;
2456
- }
2478
+ }
2479
+ &__add {
2480
+ width: 100%;
2481
+ margin: 20px 0 0;
2482
+ &__btn {
2483
+ width: 100%;
2484
+ display: flex;
2485
+ justify-content: flex-end;
2457
2486
  }
2458
2487
  }
2459
2488
  }
2489
+
2490
+
2491
+ .cdk-drag-preview {
2492
+ box-sizing: border-box;
2493
+ border-radius: 4px;
2494
+ box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2),
2495
+ 0 8px 10px 1px rgba(0, 0, 0, 0.14),
2496
+ 0 3px 14px 2px rgba(0, 0, 0, 0.12);
2497
+ }
2498
+
2499
+ .cdk-drag-placeholder {
2500
+ opacity: 0.2;
2501
+ }
2502
+
2503
+ .cdk-drag-animating {
2504
+ transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
2505
+ }
2506
+
2507
+ .wac-draganddrop-list__wrapper.cdk-drop-list-dragging .wac-draganddrop-list__wrapper__item:not(.cdk-drag-placeholder) {
2508
+ transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
2509
+ }
2460
2510
  .wac-tab {
2461
2511
  &__wrapper {
2462
2512
  position: relative;
@@ -3153,31 +3203,35 @@ $wac-subtitle-color: #7A87A1!default;
3153
3203
  margin: inherit;
3154
3204
  }
3155
3205
  }
3156
- a.wac-link {
3157
- position: relative;
3158
- color: $wac-link-color;
3159
- display: inline-block;
3160
- transition: 0.3s ease;
3161
- font-size: rem(14);
3162
- line-height: rem(16);
3163
- &:before {
3164
- content: '';
3165
- display: block;
3166
- position: absolute;
3167
- width: 100%;
3168
- max-width: 0;
3169
- height: 1px;
3170
- border-radius: 3px;
3171
- background-color: darken($wac-link-color, 15%);
3172
- left: 0;
3173
- bottom: -2px;
3174
- transition: 0.3s ease;
3206
+ .wac-label {
3207
+ @include flexbox();
3208
+ background-color: $wac-gray-background;
3209
+ border-radius: 3px;
3210
+ border: 1px solid $wac-gray-background;
3211
+ transition: border-color 0.3s ease-in-out;
3212
+
3213
+ &__wrapper {
3214
+ padding: 7.5px 13px;
3215
+ font-size: 14px;
3216
+ line-height: 16px;
3217
+ color: $wac-second-color;
3218
+
3219
+ i {
3220
+ margin-left: 10px;
3221
+ font-size: 12px;
3222
+ line-height: 23px;
3223
+ color: $wac-border-form;
3224
+ transition: color 0.3s ease-in-out;
3225
+ }
3175
3226
  }
3176
- &:hover,
3177
- &:focus {
3178
- color: darken($wac-link-color, 15%);
3179
- &:before {
3180
- max-width: 100%;
3227
+
3228
+ &:hover {
3229
+ border-color: $wac-input-border;
3230
+ transition: border-color 0.3s ease-in-out;
3231
+
3232
+ .wac-label__wrapper i {
3233
+ color: $wac-second-color;
3234
+ transition: color 0.3s ease-in-out;
3181
3235
  }
3182
3236
  }
3183
3237
  }
@@ -5379,90 +5433,89 @@ span.wac-tooltip {
5379
5433
  }
5380
5434
  }
5381
5435
  }
5382
- .wac-draganddrop-list {
5383
- width: 100%;
5436
+ .wac-dropdown {
5437
+ display: inline-block;
5438
+ width: 40px;
5439
+ height: 40px;
5440
+
5384
5441
  &__wrapper {
5442
+ @include flexbox();
5443
+ @include justify-content(center);
5444
+ @include align-items(center);
5385
5445
  width: 100%;
5386
- display: flex;
5387
- flex-direction: column;
5388
- align-items: flex-start;
5389
- justify-content: flex-start;
5390
- &__item {
5391
- width: 100%;
5392
- margin: 0 0 10px;
5393
- display: flex;
5394
- &__icon {
5395
- display: flex;
5396
- align-items: center;
5397
- span {
5398
- display: block;
5399
- width: 2px;
5400
- height: 40px;
5401
- margin: 0 2px 0 0;
5402
- background-color: $wac-border-form;
5403
- border-radius: 2px;
5404
- }
5405
- &:before, &:after {
5406
- content: '';
5407
- display: block;
5408
- width: 2px;
5409
- height: 40px;
5410
- margin: 0 2px 0 0;
5411
- background-color: $wac-border-form;
5412
- border-radius: 2px;
5413
- }
5414
- }
5415
- &__label {
5416
- width: 100%;
5417
- margin: 0 0 0 8px;
5418
- min-height: 40px;
5419
- display: flex;
5420
- justify-content: flex-start;
5421
- align-items: center;
5422
- font-size: rem(14);
5423
- line-height: 1.4;
5424
- font-weight: 400;
5425
- padding: 10px 20px;
5446
+ height: 100%;
5447
+ position: relative;
5448
+
5449
+ &__icon {
5450
+ font-size: 30px;
5451
+ line-height: 18px;
5452
+ color: $wac-second-color;
5453
+ transition: color 0.3s ease, transform 0.3s ease;
5454
+ }
5455
+
5456
+ &__sublevel {
5457
+ position: absolute;
5458
+ min-width: 160px;
5459
+ top: 100%;
5460
+ right: 0;
5461
+ z-index: -1;
5462
+ opacity: 0;
5463
+ background-color: $wac-white;
5464
+ border-radius: rem(3);
5465
+ box-shadow: 0px 2px 5px $wac-info-box-shadow;
5466
+ visibility: hidden;
5467
+ transition: opacity 0.15s ease, z-index 0.15s ease, visibility 0s linear .16s;
5468
+
5469
+ &__container {
5470
+ padding: 10px 10px;
5471
+ border: 1px solid $wac-border-color;
5426
5472
  border-radius: 3px;
5427
- overflow: hidden;
5428
- white-space: nowrap;
5429
- text-overflow: ellipsis;
5430
- border: 1px solid $wac-border-form;
5431
- }
5432
- > div {
5433
- &:first-child {
5434
- width: 100%;
5473
+
5474
+ &__item {
5475
+ padding: 5.7px 10px;
5476
+ font-size: 14px;
5477
+ line-height: 24px;
5478
+ color: $wac-second-color;
5479
+ cursor: pointer;
5480
+ transition: background-color 0.3s ease, color 0.3s ease;
5435
5481
  display: flex;
5482
+ justify-content: flex-start;
5436
5483
  align-items: center;
5437
- }
5438
- &:last-child {
5439
- width: auto;
5440
- margin: 0 0 0 10px;
5484
+ align-content: center;
5485
+
5486
+ i {
5487
+ min-width: 15px;
5488
+ margin-right: 5px;
5489
+ text-align: center;
5490
+ }
5491
+ span {
5492
+ white-space: nowrap;
5493
+ }
5494
+
5495
+ &:hover {
5496
+ background-color: $wac-gray-background;
5497
+ transition: background-color 0.3s ease, color 0.3s ease;
5498
+ color: $wac-input-active-color;
5499
+ }
5441
5500
  }
5442
5501
  }
5443
5502
  }
5444
- }
5445
- }
5446
-
5447
-
5448
- .cdk-drag-preview {
5449
- box-sizing: border-box;
5450
- border-radius: 4px;
5451
- box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2),
5452
- 0 8px 10px 1px rgba(0, 0, 0, 0.14),
5453
- 0 3px 14px 2px rgba(0, 0, 0, 0.12);
5454
- }
5455
5503
 
5456
- .cdk-drag-placeholder {
5457
- opacity: 0;
5458
- }
5459
-
5460
- .cdk-drag-animating {
5461
- transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
5462
- }
5504
+ &:hover {
5505
+ .wac-dropdown__wrapper__icon {
5506
+ color: $wac-wizishop-blue;
5507
+ transform: rotate(90deg);
5508
+ transition: color 0.3s ease, transform 0.3s ease;
5509
+ }
5463
5510
 
5464
- .wac-draganddrop-list__wrapper.cdk-drop-list-dragging .wac-draganddrop-list__wrapper__item:not(.cdk-drag-placeholder) {
5465
- transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
5511
+ .wac-dropdown__wrapper__sublevel {
5512
+ visibility: visible;
5513
+ opacity: 1;
5514
+ z-index: 2;
5515
+ transition: visibility 0s ease 0s, opacity 0.3s ease .1s;
5516
+ }
5517
+ }
5518
+ }
5466
5519
  }
5467
5520
  .wac-wrapper-sidebar {
5468
5521
  width: 100%;
@@ -5663,35 +5716,31 @@ h1.wac-h1 {
5663
5716
  font-weight: normal;
5664
5717
  }
5665
5718
  }
5666
- .wac-label {
5667
- @include flexbox();
5668
- background-color: $wac-gray-background;
5669
- border-radius: 3px;
5670
- border: 1px solid $wac-gray-background;
5671
- transition: border-color 0.3s ease-in-out;
5672
-
5673
- &__wrapper {
5674
- padding: 7.5px 13px;
5675
- font-size: 14px;
5676
- line-height: 16px;
5677
- color: $wac-second-color;
5678
-
5679
- i {
5680
- margin-left: 10px;
5681
- font-size: 12px;
5682
- line-height: 23px;
5683
- color: $wac-border-form;
5684
- transition: color 0.3s ease-in-out;
5685
- }
5719
+ a.wac-link {
5720
+ position: relative;
5721
+ color: $wac-link-color;
5722
+ display: inline-block;
5723
+ transition: 0.3s ease;
5724
+ font-size: rem(14);
5725
+ line-height: rem(16);
5726
+ &:before {
5727
+ content: '';
5728
+ display: block;
5729
+ position: absolute;
5730
+ width: 100%;
5731
+ max-width: 0;
5732
+ height: 1px;
5733
+ border-radius: 3px;
5734
+ background-color: darken($wac-link-color, 15%);
5735
+ left: 0;
5736
+ bottom: -2px;
5737
+ transition: 0.3s ease;
5686
5738
  }
5687
-
5688
- &:hover {
5689
- border-color: $wac-input-border;
5690
- transition: border-color 0.3s ease-in-out;
5691
-
5692
- .wac-label__wrapper i {
5693
- color: $wac-second-color;
5694
- transition: color 0.3s ease-in-out;
5739
+ &:hover,
5740
+ &:focus {
5741
+ color: darken($wac-link-color, 15%);
5742
+ &:before {
5743
+ max-width: 100%;
5695
5744
  }
5696
5745
  }
5697
5746
  }
@@ -6796,6 +6845,9 @@ div.wac-field-input-search {
6796
6845
  margin: 0 !important;
6797
6846
  font-size: rem(14) !important;
6798
6847
  color: $wac-placeholder-color;
6848
+ &.transparent {
6849
+ background-color: transparent;
6850
+ }
6799
6851
  }
6800
6852
  ::-webkit-input-placeholder {
6801
6853
  /* Chrome/Opera/Safari */
@@ -6860,6 +6912,10 @@ div.wac-field-input-search {
6860
6912
  margin-bottom: rem(8);
6861
6913
  height: rem(40);
6862
6914
 
6915
+ &.transparent {
6916
+ background-color: transparent;
6917
+ }
6918
+
6863
6919
  &::placeholder {
6864
6920
  color: $wac-placeholder-color;
6865
6921
  font-weight: 400;
@@ -4571,27 +4571,64 @@
4571
4571
 
4572
4572
  var DraganddropListComponent = /** @class */ (function () {
4573
4573
  function DraganddropListComponent() {
4574
+ this.disabled = false;
4575
+ this.backgroundColor = '#fff';
4576
+ this.showTriggerSave = false;
4574
4577
  this.itemsChange = new i0.EventEmitter();
4575
4578
  }
4579
+ DraganddropListComponent.prototype.ngOnInit = function () {
4580
+ this.setTempCopy();
4581
+ };
4576
4582
  DraganddropListComponent.prototype.drop = function (event) {
4577
- dragDrop.moveItemInArray(this.items, event.previousIndex, event.currentIndex);
4578
- this.itemsChange.emit(this.items);
4583
+ if (!this.disabled) {
4584
+ dragDrop.moveItemInArray(this.items, event.previousIndex, event.currentIndex);
4585
+ this.itemsChange.emit(this.items);
4586
+ this.setTempCopy();
4587
+ }
4579
4588
  };
4580
4589
  DraganddropListComponent.prototype.delete = function (index) {
4581
- this.items = this.items.filter(function (value, i) { return i !== index; });
4590
+ if (!this.disabled) {
4591
+ this.items = this.items.filter(function (value, i) { return i !== index; });
4592
+ this.itemsChange.emit(this.items);
4593
+ this.setTempCopy();
4594
+ }
4595
+ };
4596
+ DraganddropListComponent.prototype.saveField = function (index, event) {
4597
+ this.copyTemps[index] = event.target.value;
4598
+ this.itemsChange.emit(this.copyTemps);
4599
+ };
4600
+ DraganddropListComponent.prototype.saveFieldEnd = function (index, event) {
4601
+ this.items[index] = event.target.value;
4602
+ this.itemsChange.emit(this.items);
4603
+ this.setTempCopy();
4604
+ };
4605
+ DraganddropListComponent.prototype.addField = function () {
4606
+ this.showTriggerSave = true;
4607
+ };
4608
+ DraganddropListComponent.prototype.saveNewField = function (event) {
4609
+ this.items.push(event.target.value);
4582
4610
  this.itemsChange.emit(this.items);
4611
+ this.setTempCopy();
4612
+ this.showTriggerSave = false;
4613
+ };
4614
+ DraganddropListComponent.prototype.setTempCopy = function () {
4615
+ this.copyTemps = Object.assign({}, this.items);
4583
4616
  };
4584
4617
  return DraganddropListComponent;
4585
4618
  }());
4586
4619
  DraganddropListComponent.decorators = [
4587
4620
  { type: i0.Component, args: [{
4588
4621
  selector: 'wac-draganddrop-list',
4589
- template: "<div class=\"wac-draganddrop-list\">\n <div class=\"wac-draganddrop-list__wrapper\" cdkDropList (cdkDropListDropped)=\"drop($event)\">\n <div class=\"wac-draganddrop-list__wrapper__item\" *ngFor=\"let item of items;let i = index;\" cdkDrag>\n <div>\n <span class=\"wac-draganddrop-list__wrapper__item__icon\">\n <span></span>\n </span>\n <span class=\"wac-draganddrop-list__wrapper__item__label\" [innerHTML]=\"item\"></span>\n </div>\n <div>\n <wac-button [iconFontSize]=\"'14px'\" [opacity]=\"true\" [icon]=\"'fa-regular fa-trash-can'\" [extraClasses]=\"'is-danger'\" (click)=\"delete(i)\"></wac-button>\n </div>\n </div>\n </div>\n</div>\n",
4622
+ template: "<div class=\"wac-draganddrop-list\" *ngIf=\"!disabled\" [style.backgroundColor]=\"backgroundColor\">\n <div class=\"wac-draganddrop-list__wrapper\" [cdkDropListLockAxis]=\"'y'\" cdkDropList (cdkDropListDropped)=\"drop($event)\">\n <div class=\"wac-draganddrop-list__wrapper__item\" [style.backgroundColor]=\"backgroundColor\" *ngFor=\"let item of items;let i = index;\" cdkDrag>\n <div>\n <span class=\"wac-draganddrop-list__wrapper__item__icon\">\n <span></span>\n </span>\n <span (mousedown)=\"$event.stopPropagation()\" class=\"wac-draganddrop-list__wrapper__item__input\">\n <wac-input [value]=\"item\" [extraClasses]=\"'transparent'\" (keydown)=\"saveField(i, $event)\" (focusout)=\"saveFieldEnd(i, $event)\"></wac-input>\n </span>\n </div>\n <div (mousedown)=\"$event.stopPropagation()\">\n <wac-button [iconFontSize]=\"'14px'\" [opacity]=\"true\" [icon]=\"'fa-regular fa-trash-can'\" [extraClasses]=\"'is-danger'\" (click)=\"delete(i)\"></wac-button>\n </div>\n </div>\n <div class=\"wac-draganddrop-list__wrapper__item wac-draganddrop-list__wrapper__item--trigger\" *ngIf=\"showTriggerSave\">\n <div>\n <span class=\"wac-draganddrop-list__wrapper__item__icon\">\n <span></span>\n </span>\n <span class=\"wac-draganddrop-list__wrapper__item__input\">\n <wac-input [extraClasses]=\"'transparent'\" (keyup.enter)=\"saveNewField($event)\" (focusout)=\"saveNewField($event)\"></wac-input>\n </span>\n </div>\n </div>\n </div>\n <div class=\"wac-draganddrop-list__add\" *ngIf=\"max && !showTriggerSave\">\n <div class=\"wac-draganddrop-list__add__btn\" *ngIf=\"max > items.length\">\n <wac-button [extraClasses]=\"'is-success'\" [label]=\"labelBtnAdd\" (click)=\"addField()\"></wac-button>\n </div>\n </div>\n</div>\n\n<div class=\"wac-draganddrop-list wac-draganddrop-list--disabled\" *ngIf=\"disabled\">\n <div class=\"wac-draganddrop-list__wrapper\">\n <div class=\"wac-draganddrop-list__wrapper__item\" *ngFor=\"let item of items;let i = index;\">\n <div>\n <span class=\"wac-draganddrop-list__wrapper__item__label\" [innerHTML]=\"item\"></span>\n </div>\n </div>\n </div>\n</div>\n",
4590
4623
  changeDetection: i0.ChangeDetectionStrategy.OnPush
4591
4624
  },] }
4592
4625
  ];
4593
4626
  DraganddropListComponent.propDecorators = {
4594
4627
  items: [{ type: i0.Input }],
4628
+ disabled: [{ type: i0.Input }],
4629
+ max: [{ type: i0.Input }],
4630
+ labelBtnAdd: [{ type: i0.Input }],
4631
+ backgroundColor: [{ type: i0.Input }],
4595
4632
  itemsChange: [{ type: i0.Output }]
4596
4633
  };
4597
4634