@kirbydesign/designsystem 4.0.13 → 4.0.17

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.
@@ -7901,7 +7901,8 @@
7901
7901
  }());
7902
7902
 
7903
7903
  var ReorderListComponent = /** @class */ (function () {
7904
- function ReorderListComponent() {
7904
+ function ReorderListComponent(cdr) {
7905
+ this.cdr = cdr;
7905
7906
  this.itemReorder = new i0.EventEmitter();
7906
7907
  this.subItemReorder = new i0.EventEmitter();
7907
7908
  this.reorderActive = false;
@@ -7933,6 +7934,7 @@
7933
7934
  }
7934
7935
  finally { if (e_1) throw e_1.error; }
7935
7936
  }
7937
+ _this.cdr.detectChanges();
7936
7938
  };
7937
7939
  this.observer = new MutationObserver(callback);
7938
7940
  this.reorderGroupContainer.forEach(function (div) {
@@ -7965,6 +7967,10 @@
7965
7967
  styles: ["ion-backdrop{opacity:.3;z-index:101;position:fixed}.reorder-selected{box-shadow:none;opacity:1;z-index:104}.reorder-selected kirby-card{transform:scale(1.05)}.reorder-selected kirby-card div:first-child{border-top:1px solid var(--kirby-background-color)}.reorder-selected ::ng-deep>kirby-item{box-shadow:0 0 10px rgba(0,0,0,.4);transform:scale(1.05);border-radius:16px;overflow:hidden}.reorder-list-active>*{position:relative;z-index:103}.reorder-list-active>.reorder-selected{z-index:104}.reorder-list-active div:first-child{border-top:none}.reorder-list-active ::ng-deep>div:last-child kirby-item{border-bottom-left-radius:16px;border-bottom-right-radius:16px;overflow:hidden}.reorder-list-active .reorder-selected ::ng-deep>kirby-item{box-shadow:0 0 10px rgba(0,0,0,.4);transform:scale(1.05);border-radius:16px;overflow:hidden}.outerGroup{border-bottom:20px solid transparent}kirby-card{overflow:inherit;z-index:auto}kirby-card ::ng-deep>div:last-child ion-reorder-group div:last-child>kirby-item{border-bottom-left-radius:16px;border-bottom-right-radius:16px;overflow:hidden}kirby-card ::ng-deep>div kirby-item{z-index:1}kirby-card ::ng-deep>div:first-child>kirby-item{border-radius:16px;overflow:hidden}kirby-card ::ng-deep>div .reorder-list-active kirby-item{z-index:103}kirby-card div:first-child{border-top:1px solid var(--kirby-background-color)}"]
7966
7968
  },] }
7967
7969
  ];
7970
+ /** @nocollapse */
7971
+ ReorderListComponent.ctorParameters = function () { return [
7972
+ { type: i0.ChangeDetectorRef }
7973
+ ]; };
7968
7974
  ReorderListComponent.propDecorators = {
7969
7975
  items: [{ type: i0.Input }],
7970
7976
  subItemsName: [{ type: i0.Input }],
@@ -8653,7 +8659,8 @@
8653
8659
  SegmentedControlMode["default"] = "default";
8654
8660
  })(exports.SegmentedControlMode || (exports.SegmentedControlMode = {}));
8655
8661
  var SegmentedControlComponent = /** @class */ (function () {
8656
- function SegmentedControlComponent() {
8662
+ function SegmentedControlComponent(iconRegistryService) {
8663
+ this.iconRegistryService = iconRegistryService;
8657
8664
  this.mode = exports.SegmentedControlMode.default;
8658
8665
  this._items = [];
8659
8666
  this._selectedIndex = -1;
@@ -8683,7 +8690,16 @@
8683
8690
  return this._items;
8684
8691
  },
8685
8692
  set: function (value) {
8693
+ var _this = this;
8686
8694
  this._items = value || [];
8695
+ this._items.forEach(function (item) {
8696
+ if (!item.badge)
8697
+ return;
8698
+ // We need to verify whether badges icon is custom or default, so we can check for it in the template
8699
+ item.badge.isCustomIcon =
8700
+ item.badge.icon !== undefined &&
8701
+ _this.iconRegistryService.getIcon(item.badge.icon) !== undefined;
8702
+ });
8687
8703
  var checkedItemIndex = this.items.findIndex(function (item) { return item.checked; });
8688
8704
  if (checkedItemIndex > -1) {
8689
8705
  console.warn('SegmentItem.checked is deprecated - please remove from your `items` configuration. Use `selectedIndex` or `value` on `<kirby-segmented-control>` instead ');
@@ -8736,12 +8752,16 @@
8736
8752
  SegmentedControlComponent.decorators = [
8737
8753
  { type: i0.Component, args: [{
8738
8754
  selector: 'kirby-segmented-control',
8739
- template: "<ion-segment\n *ngIf=\"mode === 'default'\"\n [value]=\"value?.id\"\n (ionChange)=\"onSegmentSelect($event.detail.value)\"\n (click)=\"preventWrapperClick($event)\"\n>\n <div *ngFor=\"let item of items\" class=\"segment-btn-wrapper\">\n <ion-segment-button [value]=\"item.id\">{{ item.text }}</ion-segment-button>\n <kirby-badge\n *ngIf=\"item.badge\"\n role=\"text\"\n [attr.aria-label]=\"item.badge.description\"\n [themeColor]=\"item.badge.themeColor\"\n >\n <kirby-icon\n *ngIf=\"item.badge.icon; else badgeContent\"\n [customName]=\"item.badge.icon\"\n [name]=\"item.badge.icon\"\n ></kirby-icon>\n <ng-template #badgeContent>\n {{ item.badge.content }}\n </ng-template>\n </kirby-badge>\n </div>\n</ion-segment>\n\n<ng-container *ngIf=\"mode === 'chip' || mode === 'compactChip'\">\n <kirby-chip\n *ngFor=\"let item of items; let index = index\"\n [text]=\"item.text\"\n [isSelected]=\"index === selectedIndex\"\n (click)=\"onSegmentSelect(item.id)\"\n role=\"button\"\n ></kirby-chip>\n</ng-container>\n",
8755
+ template: "<ion-segment\n *ngIf=\"mode === 'default'\"\n [value]=\"value?.id\"\n (ionChange)=\"onSegmentSelect($event.detail.value)\"\n (click)=\"preventWrapperClick($event)\"\n>\n <div *ngFor=\"let item of items\" class=\"segment-btn-wrapper\">\n <ion-segment-button [value]=\"item.id\">{{ item.text }}</ion-segment-button>\n <kirby-badge\n *ngIf=\"item.badge\"\n role=\"text\"\n [attr.aria-label]=\"item.badge.description\"\n [themeColor]=\"item.badge.themeColor\"\n >\n <ng-container *ngIf=\"item.badge.icon; else badgeContent\">\n <kirby-icon\n *ngIf=\"item.badge.isCustomIcon; else defaultIconName\"\n [customName]=\"item.badge.icon\"\n ></kirby-icon>\n <ng-template #defaultIconName>\n <kirby-icon [name]=\"item.badge.icon\"></kirby-icon>\n </ng-template>\n </ng-container>\n <ng-template #badgeContent>\n {{ item.badge.content }}\n </ng-template>\n </kirby-badge>\n </div>\n</ion-segment>\n\n<ng-container *ngIf=\"mode === 'chip' || mode === 'compactChip'\">\n <kirby-chip\n *ngFor=\"let item of items; let index = index\"\n [text]=\"item.text\"\n [isSelected]=\"index === selectedIndex\"\n (click)=\"onSegmentSelect(item.id)\"\n role=\"button\"\n ></kirby-chip>\n</ng-container>\n",
8740
8756
  // tslint:disable-next-line: no-host-metadata-property
8741
8757
  host: { role: 'group' },
8742
8758
  styles: [":host{display:block;-webkit-user-select:none;user-select:none;--kirby-badge-elevation:0 5px 10px -10px rgba(28,28,28,0.3),0 0 5px 0 rgba(28,28,28,0.08);--kirby-badge-position:absolute;--kirby-badge-top:-8px;--kirby-badge-right:8px;--kirby-badge-z-index:2}:host.sm ion-segment-button{min-height:32px;font-size:12px;--padding-start:16px;--padding-end:16px}:host.chip-mode{display:flex;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden}@media (pointer:coarse){:host.chip-mode{scrollbar-width:none}:host.chip-mode::-webkit-scrollbar{display:none}}ion-segment{display:inline-flex;width:auto;overflow:visible;contain:unset;--background:var(--kirby-white);border-radius:999px}ion-segment-button{position:relative;min-height:40px;font-weight:400;font-size:14px;text-transform:none;--border-radius:999px;--border-style:none;--background:none;--color:var(--kirby-white-contrast);--indicator-color:var(--kirby-black);--color-checked:var(--kirby-black-contrast);--color-hover:var(--kirby-black-tint);--indicator-box-shadow:none;--padding-start:24px;--padding-end:24px;--margin-bottom:0;--margin-end:0;--margin-start:0;--margin-top:0;margin:0}ion-segment-button:after{content:\"\";position:absolute;min-height:44px;min-width:44px;width:100%;height:100%;transform:translate(-50%,-50%);left:50%;top:50%}.segment-btn-wrapper{position:relative}:host-context(.plt-desktop) ion-segment-button:focus-within{outline-color:-webkit-focus-ring-color;outline-style:auto}"]
8743
8759
  },] }
8744
8760
  ];
8761
+ /** @nocollapse */
8762
+ SegmentedControlComponent.ctorParameters = function () { return [
8763
+ { type: IconRegistryService }
8764
+ ]; };
8745
8765
  SegmentedControlComponent.propDecorators = {
8746
8766
  mode: [{ type: i0.Input }],
8747
8767
  _modeCssClass: [{ type: i0.HostBinding, args: ['class',] }],
@@ -8861,7 +8881,7 @@
8861
8881
  { type: i0.Component, args: [{
8862
8882
  selector: 'kirby-tab-button',
8863
8883
  template: "<ion-tab-button #ionTabButton [tab]=\"routerLink\" (click)=\"onClick($event, ionTabButton.selected)\">\n <div class=\"icon-container\" *ngIf=\"icons.length\">\n <ng-content\n *ngIf=\"icons.length === 1 || !ionTabButton.selected\"\n select=\"kirby-icon[:not([selected-tab])]\"\n ></ng-content>\n <ng-content *ngIf=\"ionTabButton.selected\" select=\"kirby-icon[selected-tab]\"></ng-content>\n <ng-content select=\"kirby-badge\"></ng-content>\n </div>\n <ion-label>\n <ng-content></ng-content>\n </ion-label>\n</ion-tab-button>\n",
8864
- styles: ["ion-tab-button{height:100%;flex:1 1 0%;max-width:168px;font-size:10px;--color-selected:get-color(\"black\");--kirby-badge-position:absolute;--kirby-badge-left:calc(50% + 5px);--kirby-badge-top:0}@media (min-width:721px){ion-tab-button{flex:none;padding:0 24px;margin-right:24px;font-size:14px;flex-direction:row;--kirby-badge-top:-5px;--kirby-badge-left:auto;--kirby-badge-right:-5px}ion-tab-button:last-child{margin-right:0}ion-tab-button .icon-container{position:relative;margin-right:8px}}@media (min-width:1025px) and (hover:hover) and (pointer:fine){ion-tab-button{padding:0 12px;margin-right:0}}"]
8884
+ styles: ["ion-tab-button{height:100%;flex:1 1 0%;max-width:168px;font-size:10px;--color-selected:get-color(\"black\");--kirby-badge-position:absolute;--kirby-badge-top:0;--kirby-badge-right:0}ion-tab-button ::ng-deep>div kirby-badge.md{--kirby-badge-top:-5px;--kirby-badge-right:-5px}ion-tab-button .icon-container{position:relative}@media (min-width:721px){ion-tab-button{flex:none;padding:0 24px;margin-right:24px;font-size:14px;flex-direction:row}ion-tab-button:last-child{margin-right:0}ion-tab-button .icon-container{margin-right:8px}}@media (min-width:1025px) and (hover:hover) and (pointer:fine){ion-tab-button{padding:0 12px;margin-right:0}}"]
8865
8885
  },] }
8866
8886
  ];
8867
8887
  /** @nocollapse */