@nova-ui/bits 12.0.3 → 12.0.4-3486
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/bundles/nova-ui-bits.umd.js +63 -33
- package/bundles/nova-ui-bits.umd.js.map +1 -1
- package/esm2015/lib/docs/example-code/example-code.component.js +2 -1
- package/esm2015/lib/repeat/repeat-item/repeat-item.component.js +6 -4
- package/esm2015/lib/repeat/repeat.component.js +56 -32
- package/esm2015/lib/repeat/types.js +1 -1
- package/fesm2015/nova-ui-bits.js +59 -33
- package/fesm2015/nova-ui-bits.js.map +1 -1
- package/lib/docs/example-code/example-code.component.d.ts +1 -0
- package/lib/repeat/repeat-item/repeat-item.component.d.ts +2 -0
- package/lib/repeat/repeat.component.d.ts +11 -3
- package/nova-ui-bits.metadata.json +1 -1
- package/package.json +1 -1
- package/sdk/atoms/components/repeat/repeat.atom.d.ts +3 -0
- package/sdk/atoms/components/repeat/repeat.atom.js +20 -7
- package/sdk/atoms/components/repeat/repeat.atom.js.map +1 -1
|
@@ -13616,6 +13616,7 @@
|
|
|
13616
13616
|
this.nowrap = false;
|
|
13617
13617
|
this.selected = false;
|
|
13618
13618
|
this.selectable = false;
|
|
13619
|
+
this.rowClicked = new i0.EventEmitter();
|
|
13619
13620
|
}
|
|
13620
13621
|
Object.defineProperty(RepeatItemComponent.prototype, "role", {
|
|
13621
13622
|
get: function () { return this.selectable ? "option" : "listitem"; },
|
|
@@ -13627,7 +13628,7 @@
|
|
|
13627
13628
|
RepeatItemComponent.decorators = [
|
|
13628
13629
|
{ type: i0.Component, args: [{
|
|
13629
13630
|
selector: "nui-repeat-item",
|
|
13630
|
-
template: "<li class=\"nui-repeat-item\"\n [
|
|
13631
|
+
template: "<li class=\"nui-repeat-item\"\n [class.nui-repeat-item--selected]=\"selected\"\n [class.text-nowrap]=\"nowrap\"\n [class.nui-repeat-item--clickable]=\"clickable\"\n (click)=\"clickable ? rowClicked.emit($event) : null\"\n tabindex=\"-1\">\n <div class=\"nui-repeat-item__content\">\n <ng-content></ng-content>\n </div>\n</li>\n",
|
|
13631
13632
|
encapsulation: i0.ViewEncapsulation.None,
|
|
13632
13633
|
host: { "[attr.role]": "role" },
|
|
13633
13634
|
styles: ["body>nui-repeat-item.cdk-drag-preview .nui-repeat-item{list-style-type:none}body>nui-repeat-item.cdk-drag-preview .nui-repeat-item__controls-drag-handle{display:none}.nui .nui-repeat-item:active,.nui .nui-repeat-item:focus{outline:none}.nui .nui-repeat-item:hover{background-color:var(--nui-color-bg-secondary,#fafafa)}.nui .nui-repeat-item__content{display:flex}.nui .nui-repeat-item__controls-drag-handle{height:16px}.nui .nui-repeat-item__controls-drag-handle .nui-dnd-handle:hover{cursor:move}.nui .nui-repeat-item__controls-container{padding-left:3px}.nui .nui-repeat-item__controls-container .nui-repeat-item__checkbox .nui-checkbox{display:flex;justify-content:center;width:30px;height:30px}.nui .nui-repeat-item__controls-container .nui-repeat-item__checkbox .nui-checkbox__label:hover{background-color:transparent}.nui .nui-repeat-item__controls-container .nui-repeat-item__checkbox .nui-checkbox__transclude{margin-left:0}.nui .nui-repeat-item__content-container{min-height:30px;flex-grow:1;display:flex;align-items:center;margin-left:5px;margin-right:10px;min-width:0}.nui .nui-repeat-item__actions-container{margin-left:5px;display:flex;align-items:flex-start}.nui .nui-repeat-item__actions-container .btn-action:focus{background-color:transparent}.nui .nui-repeat-item.nui-repeat-item--clickable:not(.nui-repeat-item--selected):hover{background-color:var(--nui-color-bg-secondary,#fafafa)}.nui .nui-repeat-item.nui-repeat-item--selected{background-color:var(--nui-color-selected,rgba(0, 196, 210, .1));color:var(--nui-color-text-default,#111)}.nui .nui-repeat-item.nui-repeat-item--selected.nui-repeat-item--clickable:hover{background-color:var(--nui-color-selected-hover,rgba(0, 196, 210, .2))}\n"]
|
|
@@ -13637,7 +13638,8 @@
|
|
|
13637
13638
|
clickable: [{ type: i0.Input }],
|
|
13638
13639
|
nowrap: [{ type: i0.Input }],
|
|
13639
13640
|
selected: [{ type: i0.Input }],
|
|
13640
|
-
selectable: [{ type: i0.Input }]
|
|
13641
|
+
selectable: [{ type: i0.Input }],
|
|
13642
|
+
rowClicked: [{ type: i0.Output }]
|
|
13641
13643
|
};
|
|
13642
13644
|
|
|
13643
13645
|
/**
|
|
@@ -13660,6 +13662,10 @@
|
|
|
13660
13662
|
* This will stretch repeat items full width
|
|
13661
13663
|
*/
|
|
13662
13664
|
this.width = "100%";
|
|
13665
|
+
/**
|
|
13666
|
+
* Prevent item bodies from capturing clicks
|
|
13667
|
+
*/
|
|
13668
|
+
this.preventRowClick = false;
|
|
13663
13669
|
/**
|
|
13664
13670
|
* Drag preview class that is applied on the previewed item
|
|
13665
13671
|
*
|
|
@@ -13692,8 +13698,6 @@
|
|
|
13692
13698
|
*/
|
|
13693
13699
|
this.selectionChange = new i0.EventEmitter();
|
|
13694
13700
|
this.mousedOver = [];
|
|
13695
|
-
// Note: workaround to be able to use enum values in template
|
|
13696
|
-
this.repeatSelectionMode = exports.RepeatSelectionMode;
|
|
13697
13701
|
this.selectionHasChanged = false;
|
|
13698
13702
|
/** Emits when the drop list has been destroyed. */
|
|
13699
13703
|
this.dropListDestroyed = new rxjs.Subject();
|
|
@@ -13763,14 +13767,25 @@
|
|
|
13763
13767
|
});
|
|
13764
13768
|
Object.defineProperty(RepeatComponent.prototype, "role", {
|
|
13765
13769
|
get: function () {
|
|
13766
|
-
return this.selectionMode !==
|
|
13770
|
+
return this.selectionMode !== exports.RepeatSelectionMode.none
|
|
13771
|
+
? "listbox"
|
|
13772
|
+
: "list";
|
|
13773
|
+
},
|
|
13774
|
+
enumerable: false,
|
|
13775
|
+
configurable: true
|
|
13776
|
+
});
|
|
13777
|
+
Object.defineProperty(RepeatComponent.prototype, "ariaMultiselectable", {
|
|
13778
|
+
get: function () {
|
|
13779
|
+
return this.isModeMulti() || null;
|
|
13767
13780
|
},
|
|
13768
13781
|
enumerable: false,
|
|
13769
13782
|
configurable: true
|
|
13770
13783
|
});
|
|
13771
13784
|
RepeatComponent.prototype.ngOnInit = function () {
|
|
13772
13785
|
this.intersectionObserver = new IntersectionObserver(this.intersectionObserverCallback);
|
|
13773
|
-
|
|
13786
|
+
if (this.elRef.nativeElement instanceof Element) {
|
|
13787
|
+
this.intersectionObserver.observe(this.elRef.nativeElement);
|
|
13788
|
+
}
|
|
13774
13789
|
if (this.dragPreviewTemplateRef ||
|
|
13775
13790
|
this.dragHandleTemplateRef ||
|
|
13776
13791
|
this._reorderable === true) {
|
|
@@ -13858,32 +13873,33 @@
|
|
|
13858
13873
|
this.isItemDisabled(item)) {
|
|
13859
13874
|
return;
|
|
13860
13875
|
}
|
|
13861
|
-
|
|
13862
|
-
|
|
13876
|
+
// prevent handling both from row and input
|
|
13877
|
+
event.stopImmediatePropagation();
|
|
13878
|
+
event.stopPropagation();
|
|
13879
|
+
event.preventDefault();
|
|
13880
|
+
if (this.isModeMulti()) {
|
|
13863
13881
|
this.selectionHasChanged = true;
|
|
13864
13882
|
this.multiSelectionChanged(item);
|
|
13883
|
+
return;
|
|
13865
13884
|
}
|
|
13866
|
-
|
|
13867
|
-
|
|
13868
|
-
|
|
13869
|
-
|
|
13870
|
-
|
|
13885
|
+
if (this.selectionMode ===
|
|
13886
|
+
exports.RepeatSelectionMode.singleWithRequiredSelection ||
|
|
13887
|
+
this.selectionMode === exports.RepeatSelectionMode.radio) {
|
|
13888
|
+
this.selection = [item];
|
|
13889
|
+
}
|
|
13890
|
+
if (this.selectionMode === exports.RepeatSelectionMode.single ||
|
|
13891
|
+
this.selectionMode ===
|
|
13892
|
+
exports.RepeatSelectionMode.radioWithNonRequiredSelection) {
|
|
13893
|
+
if (this.selection.indexOf(item) !== -1) {
|
|
13894
|
+
this.selection = [];
|
|
13871
13895
|
}
|
|
13872
|
-
|
|
13873
|
-
this.
|
|
13874
|
-
exports.RepeatSelectionMode.radioWithNonRequiredSelection) {
|
|
13875
|
-
if (this.selection.indexOf(item) !== -1) {
|
|
13876
|
-
this.selection = [];
|
|
13877
|
-
}
|
|
13878
|
-
else {
|
|
13879
|
-
this.selection = [item];
|
|
13880
|
-
}
|
|
13896
|
+
else {
|
|
13897
|
+
this.selection = [item];
|
|
13881
13898
|
}
|
|
13882
|
-
this.changeDetector.markForCheck();
|
|
13883
|
-
this.selectionHasChanged = true;
|
|
13884
|
-
this.selectionChange.emit(this.selection);
|
|
13885
|
-
return;
|
|
13886
13899
|
}
|
|
13900
|
+
this.changeDetector.markForCheck();
|
|
13901
|
+
this.selectionHasChanged = true;
|
|
13902
|
+
this.selectionChange.emit(this.selection);
|
|
13887
13903
|
};
|
|
13888
13904
|
/**
|
|
13889
13905
|
* nui-repeat-item selection change handler
|
|
@@ -13898,12 +13914,25 @@
|
|
|
13898
13914
|
}
|
|
13899
13915
|
this.selectionChange.emit(this.selection);
|
|
13900
13916
|
};
|
|
13917
|
+
RepeatComponent.prototype.isModeMulti = function () {
|
|
13918
|
+
return this.selectionMode === exports.RepeatSelectionMode.multi;
|
|
13919
|
+
};
|
|
13920
|
+
RepeatComponent.prototype.isModeRadio = function () {
|
|
13921
|
+
return [
|
|
13922
|
+
exports.RepeatSelectionMode.radio,
|
|
13923
|
+
exports.RepeatSelectionMode.radioWithNonRequiredSelection,
|
|
13924
|
+
].includes(this.selectionMode);
|
|
13925
|
+
};
|
|
13901
13926
|
/* START - ITEM BEHAVIOUR DECIDERS */
|
|
13927
|
+
RepeatComponent.prototype.isItemClickable = function (item) {
|
|
13928
|
+
return !this.preventRowClick && !this.isItemDisabled(item);
|
|
13929
|
+
};
|
|
13930
|
+
RepeatComponent.prototype.isItemSelectable = function (item) {
|
|
13931
|
+
return !this.isItemDisabled(item);
|
|
13932
|
+
};
|
|
13902
13933
|
RepeatComponent.prototype.isItemDisabled = function (item) {
|
|
13903
|
-
var _a, _b;
|
|
13904
|
-
return item.
|
|
13905
|
-
? item.disabled
|
|
13906
|
-
: !!((_b = (_a = this.itemConfig) === null || _a === void 0 ? void 0 : _a.isDisabled) === null || _b === void 0 ? void 0 : _b.call(_a, item));
|
|
13934
|
+
var _a, _b, _c;
|
|
13935
|
+
return ((_a = item.disabled) !== null && _a !== void 0 ? _a : !!((_c = (_b = this.itemConfig) === null || _b === void 0 ? void 0 : _b.isDisabled) === null || _c === void 0 ? void 0 : _c.call(_b, item)));
|
|
13907
13936
|
};
|
|
13908
13937
|
RepeatComponent.prototype.isItemDraggable = function (item) {
|
|
13909
13938
|
var _a, _b, _c;
|
|
@@ -13974,15 +14003,15 @@
|
|
|
13974
14003
|
RepeatComponent.decorators = [
|
|
13975
14004
|
{ type: i0.Component, args: [{
|
|
13976
14005
|
selector: "nui-repeat",
|
|
13977
|
-
template: "<ng-template #repeatItems let-item=\"item\" let-itemIndex=\"itemIndex\">\n <nui-repeat-item
|
|
14006
|
+
template: "<ng-template #repeatItems let-item=\"item\" let-itemIndex=\"itemIndex\">\n <nui-repeat-item\n class=\"repeat-group-item\"\n #drag=\"cdkDrag\"\n cdkDrag\n [cdkDragData]=\"item\"\n [cdkDragPreviewClass]=\"dragPreviewClass\"\n [cdkDragDisabled]=\"!isItemDraggable(item)\"\n (rowClicked)=\"itemClicked($event, item)\"\n [clickable]=\"isItemClickable(item)\"\n [selectable]=\"isItemSelectable(item)\"\n [selected]=\"isItemSelected(item) && !isItemDisabled(item)\"\n [class.repeat-group-item--disabled]=\"isItemDisabled(item)\"\n [class.nui-dnd-without-drag-handle]=\"\n isItemDraggable(item) && !dragHandleTemplateRef\n \"\n [class.nui-dnd-raised-state]=\"\n isItemDraggable(item) && mousedOver[itemIndex]\n \"\n >\n <div\n *ngIf=\"dragHandleTemplateRef && !virtualScroll\"\n [class.hide]=\"!draggable\"\n [class.invisible]=\"!isItemDraggable(item)\"\n class=\"nui-repeat-item__controls-drag-handle align-self-center\"\n >\n <div\n cdkDragHandle\n (mouseover)=\"mousedOver[itemIndex] = true\"\n (mouseout)=\"mousedOver[itemIndex] = false\"\n [class.nui-dnd-handle]=\"!drag.disabled\"\n >\n <ng-container\n [ngTemplateOutlet]=\"dragHandleTemplateRef\"\n [ngTemplateOutletContext]=\"{ item: item }\"\n ></ng-container>\n </div>\n </div>\n <div\n *ngIf=\"dragPreviewTemplateRef && !virtualScroll\"\n class=\"nui-repeat-item__controls-drag-handle\"\n >\n <div\n *cdkDragPreview\n [class.nui-dnd-preview]=\"!isItemDisabled(item)\"\n >\n <ng-container\n [ngTemplateOutlet]=\"dragPreviewTemplateRef\"\n [ngTemplateOutletContext]=\"{ item: item }\"\n ></ng-container>\n </div>\n </div>\n <div class=\"nui-repeat-item__controls-container\">\n <nui-checkbox\n *ngIf=\"isModeMulti()\"\n class=\"nui-repeat-item__checkbox\"\n [value]=\"item\"\n [checked]=\"isItemSelected(item)\"\n [disabled]=\"isItemDisabled(item)\"\n (valueChange)=\"itemClicked($event, item)\"\n >\n </nui-checkbox>\n <nui-radio\n *ngIf=\"isModeRadio()\"\n class=\"nui-repeat-item__radio\"\n [value]=\"item\"\n [checked]=\"isItemSelected(item)\"\n [disabled]=\"isItemDisabled(item)\"\n (click)=\"itemClicked($event, item)\"\n >\n </nui-radio>\n </div>\n <div class=\"nui-repeat-item__content-container\">\n <ng-container\n [ngTemplateOutlet]=\"repeatItemTemplateRef\"\n [ngTemplateOutletContext]=\"{ item: item }\"\n ></ng-container>\n </div>\n <div\n class=\"nui-repeat-item__actions-container\"\n *ngIf=\"actionsTemplateRef\"\n >\n <ng-container\n [ngTemplateOutlet]=\"actionsTemplateRef\"\n [ngTemplateOutletContext]=\"{ item: item }\"\n >\n </ng-container>\n </div>\n </nui-repeat-item>\n</ng-template>\n\n<div class=\"nui-repeat nui-repeat__{{ paddingSize }}\">\n <div class=\"nui-repeat-header\">\n <ng-content select=\"[repeatHeaderTemplate]\"></ng-content>\n </div>\n <ul #dropListArea class=\"repeat-group\" aria-dropeffect=\"move\">\n <div *ngIf=\"!virtualScroll\">\n <ng-container\n *ngFor=\"\n let sourceItem of itemsSource;\n trackBy: itemConfig?.trackBy;\n let itemIndex = index\n \"\n [ngTemplateOutlet]=\"repeatItems\"\n [ngTemplateOutletContext]=\"{\n item: sourceItem,\n itemIndex: itemIndex\n }\"\n ></ng-container>\n </div>\n <cdk-virtual-scroll-viewport\n [itemSize]=\"itemSize\"\n *ngIf=\"virtualScroll && itemSize\"\n >\n <ng-container\n *cdkVirtualFor=\"\n let sourceItem of itemsSource;\n templateCacheSize: 0\n \"\n >\n <ng-container\n [ngTemplateOutlet]=\"repeatItems\"\n [ngTemplateOutletContext]=\"{ item: sourceItem }\"\n ></ng-container>\n </ng-container>\n </cdk-virtual-scroll-viewport>\n </ul>\n</div>\n",
|
|
13978
14007
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
13979
14008
|
encapsulation: i0.ViewEncapsulation.None,
|
|
13980
14009
|
host: {
|
|
13981
14010
|
"[class.virtual-scroll-viewport]": "virtualScroll",
|
|
13982
14011
|
"[attr.role]": "role",
|
|
13983
|
-
"[attr.aria-multiselectable]": "
|
|
14012
|
+
"[attr.aria-multiselectable]": "ariaMultiselectable",
|
|
13984
14013
|
},
|
|
13985
|
-
styles: [".nui .nui-repeat{height:inherit}.nui .nui-repeat__normal .nui-repeat-item{padding-top:5px;padding-bottom:5px}.nui .nui-repeat__compact .nui-repeat-item{padding-top:0;padding-bottom:0}.nui .nui-repeat-header{color:var(--nui-color-text-default,#111);background-color:var(--nui-color-bg-light,#fff)}.nui .nui-repeat .repeat-group .nui-
|
|
14014
|
+
styles: [".nui .nui-repeat{height:inherit}.nui .nui-repeat__normal .nui-repeat-item{padding-top:5px;padding-bottom:5px}.nui .nui-repeat>ul>cdk-virtual-scroll-viewport{height:100%}.nui .nui-repeat__compact .nui-repeat-item{padding-top:0;padding-bottom:0}.nui .nui-repeat-header{color:var(--nui-color-text-default,#111);background-color:var(--nui-color-bg-light,#fff)}.nui .nui-repeat .repeat-group .nui-repeat-item{cursor:auto}.nui .nui-repeat .repeat-group .nui-repeat-item.nui-repeat-item--clickable{cursor:pointer}.nui .nui-repeat .repeat-group .nui-repeat-item.nui-repeat-item--clickable:hover:not(.nui-repeat-item--selected){border-color:var(--nui-color-line-default,#d9d9d9)}.nui .nui-repeat .repeat-group-item:first-child .nui-repeat-item{border-top:solid 1px;border-top-color:var(--nui-color-line-default,#d9d9d9)}.nui .nui-repeat .repeat-group{margin-bottom:0;padding-left:0;margin-left:0;height:inherit}.nui .nui-repeat .repeat-group-item{position:relative;display:block;color:var(--nui-color-text-default,#111);background-color:var(--nui-color-bg-light,#fff);transition:box-shadow .4s}.nui .nui-repeat .repeat-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.nui .nui-repeat .repeat-group-item:last-child{margin-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.nui .nui-repeat .repeat-group-item:hover{cursor:pointer}.nui .nui-repeat .repeat-group-item:hover.nui-dnd-without-drag-handle:not(.cdk-drag-disabled){cursor:move;z-index:1;box-sizing:border-box;box-shadow:0 2px 10px 0 var(--nui-shadow-color, rgba(17, 17, 17, .3))}.nui .nui-repeat .repeat-group-item--disabled{color:var(--nui-color-text-disabled,rgba(17, 17, 17, .3))}.nui .nui-repeat .repeat-group-item--disabled:hover{cursor:not-allowed}.nui .nui-repeat .nui-repeat-item{border-bottom:solid 1px;border-bottom-color:var(--nui-color-line-default,#d9d9d9)}@supports (-ms-ime-align: auto){.nui .nui-repeat .nui-repeat-item{margin-bottom:.5px}}\n"]
|
|
13986
14015
|
},] }
|
|
13987
14016
|
];
|
|
13988
14017
|
RepeatComponent.ctorParameters = function () { return [
|
|
@@ -13998,6 +14027,7 @@
|
|
|
13998
14027
|
draggableChange: [{ type: i0.Output }],
|
|
13999
14028
|
reorderableChange: [{ type: i0.Output }],
|
|
14000
14029
|
width: [{ type: i0.HostBinding, args: ["style.width",] }],
|
|
14030
|
+
preventRowClick: [{ type: i0.Input }],
|
|
14001
14031
|
repeatItemTemplateRef: [{ type: i0.Input }],
|
|
14002
14032
|
dragHandleTemplateRef: [{ type: i0.Input }],
|
|
14003
14033
|
dragPreviewClass: [{ type: i0.Input }],
|