@wizishop/angular-components 0.0.117 → 0.0.120
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/angular-components.scss +4767 -4753
- package/bundles/wizishop-angular-components.umd.js +275 -158
- package/bundles/wizishop-angular-components.umd.js.map +1 -1
- package/bundles/wizishop-angular-components.umd.min.js +2 -2
- package/bundles/wizishop-angular-components.umd.min.js.map +1 -1
- package/esm2015/lib/components/button/button.component.js +3 -2
- package/esm2015/lib/components/checkbox/checkbox.component.js +1 -1
- package/esm2015/lib/components/edit-in-place/edit-in-place.component.js +1 -1
- package/esm2015/lib/components/inputs/input-with-select/input-with-select.component.js +3 -3
- package/esm2015/lib/components/inputs/input-with-select/option-item.dto.js +1 -1
- package/esm2015/lib/components/selected-list/selected-list.component.js +2 -2
- package/esm2015/lib/components/table/directives/checkBoxRow.directive.js +21 -11
- package/esm2015/lib/components/table/shared/table-checkbox-id.service.js +18 -0
- package/esm2015/lib/components/table/table.component.js +36 -11
- package/esm2015/lib/components/text-area/text-area.component.js +2 -1
- package/esm2015/lib/components/tooltip/tooltip.component.js +1 -1
- package/esm2015/lib/services/multiple-selection.service.js +61 -0
- package/esm2015/lib/utils/html-container.class.js +30 -0
- package/esm2015/lib/utils/slection-item.interface.js +2 -0
- package/esm2015/public-api.js +2 -2
- package/esm2015/wizishop-angular-components.js +4 -2
- package/fesm2015/wizishop-angular-components.js +257 -149
- package/fesm2015/wizishop-angular-components.js.map +1 -1
- package/lib/components/inputs/input-with-select/input-with-select.component.d.ts +1 -1
- package/lib/components/inputs/input-with-select/option-item.dto.d.ts +0 -1
- package/lib/components/table/directives/checkBoxRow.directive.d.ts +7 -1
- package/lib/components/table/shared/table-checkbox-id.service.d.ts +7 -0
- package/lib/components/table/table.component.d.ts +13 -4
- package/lib/services/multiple-selection.service.d.ts +14 -0
- package/lib/{models/html-container.model.d.ts → utils/html-container.class.d.ts} +0 -0
- package/lib/utils/slection-item.interface.d.ts +5 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -1
- package/wizishop-angular-components-0.0.120.tgz +0 -0
- package/wizishop-angular-components.d.ts +3 -1
- package/wizishop-angular-components.metadata.json +1 -1
- package/esm2015/lib/models/html-container.model.js +0 -30
- package/wizishop-angular-components-0.0.117.tgz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@wizishop/ng-wizi-bulma'), require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('ngx-perfect-scrollbar'), require('rxjs'), require('rxjs/operators'), require('@angular/cdk/overlay'), require('@angular/cdk/table'), require('@angular/animations'), require('ngx-chips'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@wizishop/angular-components', ['exports', '@wizishop/ng-wizi-bulma', '@angular/core', '@angular/common', '@angular/forms', 'ngx-perfect-scrollbar', 'rxjs', 'rxjs/operators', '@angular/cdk/overlay', '@angular/cdk/table', '@angular/animations', 'ngx-chips', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.wizishop = global.wizishop || {}, global.wizishop['angular-components'] = {}), global['ng-wizi-bulma'], global.ng.core, global.ng.common, global.ng.forms, global['ngx-perfect-scrollbar'], global.rxjs, global.rxjs.operators, global.ng.cdk.overlay, global.ng.cdk.table, global.ng.animations, global['ngx-chips'], global
|
|
5
|
-
}(this, (function (exports, i1$1, i0, common, forms, ngxPerfectScrollbar, rxjs, operators, i1, table, animations, ngxChips,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@wizishop/ng-wizi-bulma'), require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('ngx-perfect-scrollbar'), require('rxjs'), require('rxjs/operators'), require('@angular/cdk/overlay'), require('@angular/cdk/table'), require('@angular/animations'), require('ngx-chips'), require('@ngx-translate/core'), require('@angular/router')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@wizishop/angular-components', ['exports', '@wizishop/ng-wizi-bulma', '@angular/core', '@angular/common', '@angular/forms', 'ngx-perfect-scrollbar', 'rxjs', 'rxjs/operators', '@angular/cdk/overlay', '@angular/cdk/table', '@angular/animations', 'ngx-chips', '@ngx-translate/core', '@angular/router'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.wizishop = global.wizishop || {}, global.wizishop['angular-components'] = {}), global['ng-wizi-bulma'], global.ng.core, global.ng.common, global.ng.forms, global['ngx-perfect-scrollbar'], global.rxjs, global.rxjs.operators, global.ng.cdk.overlay, global.ng.cdk.table, global.ng.animations, global['ngx-chips'], global['@ngx-translate/core'], global.ng.router));
|
|
5
|
+
}(this, (function (exports, i1$1, i0, common, forms, ngxPerfectScrollbar, rxjs, operators, i1, table, animations, ngxChips, core, router) { 'use strict';
|
|
6
6
|
|
|
7
7
|
/*! *****************************************************************************
|
|
8
8
|
Copyright (c) Microsoft Corporation.
|
|
@@ -781,16 +781,249 @@
|
|
|
781
781
|
{ type: i1$1.NwbFilterRoutingBuilder }
|
|
782
782
|
]; };
|
|
783
783
|
|
|
784
|
+
var HtmlContainer = /** @class */ (function () {
|
|
785
|
+
function HtmlContainer(hostElement, appRef, componentFactoryResolver, injector) {
|
|
786
|
+
this.hostElement = hostElement;
|
|
787
|
+
this.appRef = appRef;
|
|
788
|
+
this.componentFactoryResolver = componentFactoryResolver;
|
|
789
|
+
this.injector = injector;
|
|
790
|
+
this.attached = false;
|
|
791
|
+
}
|
|
792
|
+
HtmlContainer.prototype.attach = function (component) {
|
|
793
|
+
var _this = this;
|
|
794
|
+
if (this.attached) {
|
|
795
|
+
throw new Error('component has already been attached');
|
|
796
|
+
}
|
|
797
|
+
this.attached = true;
|
|
798
|
+
var childComponentFactory = this.componentFactoryResolver.resolveComponentFactory(component);
|
|
799
|
+
var componentRef = childComponentFactory.create(this.injector);
|
|
800
|
+
this.appRef.attachView(componentRef.hostView);
|
|
801
|
+
this.disposeFn = function () {
|
|
802
|
+
_this.appRef.detachView(componentRef.hostView);
|
|
803
|
+
componentRef.destroy();
|
|
804
|
+
};
|
|
805
|
+
this.hostElement.appendChild(componentRef.hostView.rootNodes[0]);
|
|
806
|
+
return componentRef;
|
|
807
|
+
};
|
|
808
|
+
HtmlContainer.prototype.dispose = function () {
|
|
809
|
+
if (this.attached) {
|
|
810
|
+
this.disposeFn();
|
|
811
|
+
}
|
|
812
|
+
};
|
|
813
|
+
return HtmlContainer;
|
|
814
|
+
}());
|
|
815
|
+
|
|
816
|
+
var TableCheckboxIdService = /** @class */ (function () {
|
|
817
|
+
function TableCheckboxIdService() {
|
|
818
|
+
this.nbCheckboxInstances = 0;
|
|
819
|
+
TableCheckboxIdService.tableInstance++;
|
|
820
|
+
this.currentTableInstance = TableCheckboxIdService.tableInstance;
|
|
821
|
+
}
|
|
822
|
+
TableCheckboxIdService.prototype.getUniqueId = function () {
|
|
823
|
+
this.nbCheckboxInstances++;
|
|
824
|
+
return "wac-table-" + this.currentTableInstance + "-" + this.nbCheckboxInstances;
|
|
825
|
+
};
|
|
826
|
+
return TableCheckboxIdService;
|
|
827
|
+
}());
|
|
828
|
+
TableCheckboxIdService.tableInstance = 0;
|
|
829
|
+
TableCheckboxIdService.decorators = [
|
|
830
|
+
{ type: i0.Injectable }
|
|
831
|
+
];
|
|
832
|
+
TableCheckboxIdService.ctorParameters = function () { return []; };
|
|
833
|
+
|
|
834
|
+
var CheckBoxRow = /** @class */ (function () {
|
|
835
|
+
function CheckBoxRow(currentRow, appRef, renderer, document, resolver, injector, tableCheckboxIdService) {
|
|
836
|
+
this.currentRow = currentRow;
|
|
837
|
+
this.appRef = appRef;
|
|
838
|
+
this.renderer = renderer;
|
|
839
|
+
this.document = document;
|
|
840
|
+
this.resolver = resolver;
|
|
841
|
+
this.injector = injector;
|
|
842
|
+
this.tableCheckboxIdService = tableCheckboxIdService;
|
|
843
|
+
this.checkBoxValueChange = new i0.EventEmitter();
|
|
844
|
+
}
|
|
845
|
+
Object.defineProperty(CheckBoxRow.prototype, "checkBoxValue", {
|
|
846
|
+
get: function () {
|
|
847
|
+
return this._value;
|
|
848
|
+
},
|
|
849
|
+
set: function (value) {
|
|
850
|
+
this._value = value;
|
|
851
|
+
if (this.checkboxComponentRef) {
|
|
852
|
+
this.setCheckBoxValue();
|
|
853
|
+
}
|
|
854
|
+
},
|
|
855
|
+
enumerable: false,
|
|
856
|
+
configurable: true
|
|
857
|
+
});
|
|
858
|
+
CheckBoxRow.prototype.ngOnInit = function () {
|
|
859
|
+
this.createCheckBoxComponent();
|
|
860
|
+
this.handleChecboxInputs();
|
|
861
|
+
this.handleCheckboxOutputs();
|
|
862
|
+
};
|
|
863
|
+
CheckBoxRow.prototype.createCheckBoxComponent = function () {
|
|
864
|
+
// Create the container
|
|
865
|
+
this.checkBoxElement = document.createElement('div');
|
|
866
|
+
this.checkBoxElement.className = 'wac-table__body__line__cell wac-table__body__line__cell--checkbox';
|
|
867
|
+
// Insert divCheckBox in the DOM as the first child of the row
|
|
868
|
+
this.renderer.insertBefore(this.currentRow.nativeElement, this.checkBoxElement, this.currentRow.nativeElement.firstChild);
|
|
869
|
+
// Insert the CheckBoxComponent inside the container (DOM and Angular DOM)
|
|
870
|
+
this.htmlContainer = new HtmlContainer(this.checkBoxElement, this.appRef, this.resolver, this.injector);
|
|
871
|
+
this.checkboxComponentRef = this.htmlContainer.attach(CheckboxComponent);
|
|
872
|
+
};
|
|
873
|
+
CheckBoxRow.prototype.handleChecboxInputs = function () {
|
|
874
|
+
this.checkboxComponentRef.instance.id = this.checkBoxId ? '' + this.checkBoxId : this.tableCheckboxIdService.getUniqueId();
|
|
875
|
+
this.checkboxComponentRef.instance.name = this.checkBoxName ? this.checkBoxName : undefined;
|
|
876
|
+
this.checkboxComponentRef.instance.alone = true;
|
|
877
|
+
this.setCheckBoxValue();
|
|
878
|
+
};
|
|
879
|
+
CheckBoxRow.prototype.setCheckBoxValue = function () {
|
|
880
|
+
this.checkboxComponentRef.instance.value = this.checkBoxValue;
|
|
881
|
+
};
|
|
882
|
+
CheckBoxRow.prototype.handleCheckboxOutputs = function () {
|
|
883
|
+
var _this = this;
|
|
884
|
+
// Detect checkbox changes
|
|
885
|
+
this.checkboxComponentRef.instance.registerOnChange(function () {
|
|
886
|
+
_this._toggleCheckbox();
|
|
887
|
+
});
|
|
888
|
+
};
|
|
889
|
+
CheckBoxRow.prototype._toggleCheckbox = function () {
|
|
890
|
+
this.checkBoxValueChange.emit(this.checkBoxValue);
|
|
891
|
+
};
|
|
892
|
+
CheckBoxRow.prototype.getElement = function () {
|
|
893
|
+
return this.checkBoxElement.querySelector('.wac-field-checkbox');
|
|
894
|
+
};
|
|
895
|
+
CheckBoxRow.prototype.isActive = function () {
|
|
896
|
+
return !!this.checkboxComponentRef.instance.value;
|
|
897
|
+
};
|
|
898
|
+
CheckBoxRow.prototype.setActive = function (isActive) {
|
|
899
|
+
this.checkboxComponentRef.instance.value = isActive; //? does not trigger output
|
|
900
|
+
};
|
|
901
|
+
CheckBoxRow.prototype.ngOnDestroy = function () {
|
|
902
|
+
this.htmlContainer.dispose();
|
|
903
|
+
};
|
|
904
|
+
return CheckBoxRow;
|
|
905
|
+
}());
|
|
906
|
+
CheckBoxRow.decorators = [
|
|
907
|
+
{ type: i0.Directive, args: [{
|
|
908
|
+
selector: '[checkBoxRow]'
|
|
909
|
+
},] }
|
|
910
|
+
];
|
|
911
|
+
CheckBoxRow.ctorParameters = function () { return [
|
|
912
|
+
{ type: i0.ElementRef },
|
|
913
|
+
{ type: i0.ApplicationRef },
|
|
914
|
+
{ type: i0.Renderer2 },
|
|
915
|
+
{ type: undefined, decorators: [{ type: i0.Inject, args: [common.DOCUMENT,] }] },
|
|
916
|
+
{ type: i0.ComponentFactoryResolver },
|
|
917
|
+
{ type: i0.Injector },
|
|
918
|
+
{ type: TableCheckboxIdService }
|
|
919
|
+
]; };
|
|
920
|
+
CheckBoxRow.propDecorators = {
|
|
921
|
+
checkBoxId: [{ type: i0.Input, args: ['checkBoxId',] }],
|
|
922
|
+
checkBoxName: [{ type: i0.Input, args: ['checkBoxName',] }],
|
|
923
|
+
checkBoxValue: [{ type: i0.Input, args: ['checkBoxValue',] }],
|
|
924
|
+
checkBoxValueChange: [{ type: i0.Output }]
|
|
925
|
+
};
|
|
926
|
+
|
|
927
|
+
var MultiSelectionService = /** @class */ (function () {
|
|
928
|
+
function MultiSelectionService() {
|
|
929
|
+
this.activeChanges = new rxjs.Subject();
|
|
930
|
+
this.activeChanges$ = this.activeChanges.asObservable();
|
|
931
|
+
}
|
|
932
|
+
MultiSelectionService.prototype.handle = function (items, toggleSingleItem) {
|
|
933
|
+
var _this = this;
|
|
934
|
+
if (toggleSingleItem === void 0) { toggleSingleItem = false; }
|
|
935
|
+
if (!items || !items.first) {
|
|
936
|
+
this.destroy();
|
|
937
|
+
return;
|
|
938
|
+
}
|
|
939
|
+
this.destroy(); // close previous subsciption
|
|
940
|
+
this.items = items;
|
|
941
|
+
var clicks$ = this.getListeners();
|
|
942
|
+
this.subscription = rxjs.merge.apply(void 0, __spread(clicks$)).subscribe(function (_b) {
|
|
943
|
+
var component = _b.component, isShiftKeyPressed = _b.isShift, index = _b.index;
|
|
944
|
+
if (!isShiftKeyPressed) {
|
|
945
|
+
if (toggleSingleItem) {
|
|
946
|
+
component.setActive(!component.isActive());
|
|
947
|
+
}
|
|
948
|
+
_this.activeChanges.next([index]);
|
|
949
|
+
_this.lastIndex = index;
|
|
950
|
+
return;
|
|
951
|
+
}
|
|
952
|
+
var start = index;
|
|
953
|
+
var end = _this.lastIndex;
|
|
954
|
+
var _c = __read([Math.min(start, end), Math.max(start, end) + 1], 2), first = _c[0], last = _c[1];
|
|
955
|
+
var itemsSelection = _this.items.toArray().slice(first, last);
|
|
956
|
+
var isBeginnerItemActive = _this.items.get(end).isActive();
|
|
957
|
+
itemsSelection.forEach(function (current) { return current.setActive(isBeginnerItemActive); });
|
|
958
|
+
window.getSelection().removeAllRanges(); // remove text selection
|
|
959
|
+
var indexInRange = Array.from({ length: last - first }, function (x, i) { return i + first; });
|
|
960
|
+
_this.activeChanges.next(indexInRange);
|
|
961
|
+
});
|
|
962
|
+
};
|
|
963
|
+
MultiSelectionService.prototype.getListeners = function () {
|
|
964
|
+
return this.items.map(function (item, index) {
|
|
965
|
+
return rxjs.fromEvent(item.getElement(), 'click').pipe(operators.map(function (event) {
|
|
966
|
+
return {
|
|
967
|
+
index: index,
|
|
968
|
+
isShift: event.shiftKey,
|
|
969
|
+
component: item
|
|
970
|
+
};
|
|
971
|
+
}))
|
|
972
|
+
.pipe(operators.debounceTime(100)); // debounced, because when clicking on a wac-checkbox it is emitted twice and can not find why
|
|
973
|
+
});
|
|
974
|
+
};
|
|
975
|
+
MultiSelectionService.prototype.getActives = function () {
|
|
976
|
+
return this.items.filter(function (item) { return item.isActive(); });
|
|
977
|
+
};
|
|
978
|
+
MultiSelectionService.prototype.destroy = function () {
|
|
979
|
+
var _a;
|
|
980
|
+
(_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
981
|
+
};
|
|
982
|
+
return MultiSelectionService;
|
|
983
|
+
}());
|
|
984
|
+
MultiSelectionService.decorators = [
|
|
985
|
+
{ type: i0.Injectable }
|
|
986
|
+
];
|
|
987
|
+
MultiSelectionService.ctorParameters = function () { return []; };
|
|
988
|
+
|
|
989
|
+
var TableRow = /** @class */ (function () {
|
|
990
|
+
function TableRow(currentCell, renderer, document) {
|
|
991
|
+
this.currentCell = currentCell;
|
|
992
|
+
this.renderer = renderer;
|
|
993
|
+
this.document = document;
|
|
994
|
+
}
|
|
995
|
+
TableRow.prototype.ngAfterViewInit = function () {
|
|
996
|
+
this.applyCustomStylesOnCell();
|
|
997
|
+
};
|
|
998
|
+
TableRow.prototype.applyCustomStylesOnCell = function () {
|
|
999
|
+
this.renderer.addClass(this.currentCell.nativeElement, 'wac-table__body__line');
|
|
1000
|
+
};
|
|
1001
|
+
return TableRow;
|
|
1002
|
+
}());
|
|
1003
|
+
TableRow.decorators = [
|
|
1004
|
+
{ type: i0.Directive, args: [{
|
|
1005
|
+
// The selector has the same name as the tableRaw selector in table.component.html
|
|
1006
|
+
selector: '[tableRow]'
|
|
1007
|
+
},] }
|
|
1008
|
+
];
|
|
1009
|
+
TableRow.ctorParameters = function () { return [
|
|
1010
|
+
{ type: i0.ElementRef },
|
|
1011
|
+
{ type: i0.Renderer2 },
|
|
1012
|
+
{ type: undefined, decorators: [{ type: i0.Inject, args: [common.DOCUMENT,] }] }
|
|
1013
|
+
]; };
|
|
1014
|
+
|
|
784
1015
|
var TableComponent = /** @class */ (function () {
|
|
785
|
-
function TableComponent(filtersTableService) {
|
|
1016
|
+
function TableComponent(filtersTableService, tableCheckboxIdService, multiSelectionService) {
|
|
786
1017
|
this.filtersTableService = filtersTableService;
|
|
1018
|
+
this.tableCheckboxIdService = tableCheckboxIdService;
|
|
1019
|
+
this.multiSelectionService = multiSelectionService;
|
|
787
1020
|
this.tableFiltersChange = new i0.EventEmitter();
|
|
788
1021
|
this.placeholder = '';
|
|
789
1022
|
/// Input/Output of checkbox ///
|
|
790
1023
|
/** Pass to true to display checkbox in the header table */
|
|
791
1024
|
this.checkbox = false;
|
|
792
|
-
|
|
793
|
-
this.
|
|
1025
|
+
this.toggleAllCheckBox = new i0.EventEmitter(); // todo replace by checkBoxSelectionChange
|
|
1026
|
+
this.checkBoxSelectionChange = new i0.EventEmitter(); // todo add to doc
|
|
794
1027
|
/// Input to disable section ///
|
|
795
1028
|
/** Pass to true to hide search input */
|
|
796
1029
|
this.disableSearch = false;
|
|
@@ -801,17 +1034,28 @@
|
|
|
801
1034
|
}
|
|
802
1035
|
TableComponent.prototype.ngOnInit = function () {
|
|
803
1036
|
var _this = this;
|
|
804
|
-
this.headerCheckBoxId =
|
|
1037
|
+
this.headerCheckBoxId = this.tableCheckboxIdService.getUniqueId(); // Create checkbox unique id
|
|
805
1038
|
/* Handle routing filters */
|
|
806
1039
|
if (this.tableRoutingName) {
|
|
807
1040
|
this.filtersTableService.setInitialPaginationFiltersIfNotExist(this.tableRoutingName, this.tableFilters.itemsPerPage, this.tableFilters.currentPage);
|
|
808
1041
|
this._tableFiltersGroup = this.filtersTableService.getTableFilterGroup(this.tableRoutingName);
|
|
809
1042
|
this.setTablesFilters();
|
|
810
1043
|
// Listen to filters changes with debounced time to limit multiple api calls
|
|
811
|
-
this.filterGroupChangeSub = this._tableFiltersGroup.valuesChange$.subscribe(function (
|
|
1044
|
+
this.filterGroupChangeSub = this._tableFiltersGroup.valuesChange$.subscribe(function () {
|
|
812
1045
|
_this.setTablesFilters();
|
|
813
1046
|
});
|
|
814
1047
|
}
|
|
1048
|
+
this.multiSelectionService.activeChanges$.subscribe(function (selectionIndexRawCheckChange) {
|
|
1049
|
+
_this.checkBoxSelectionChange.emit(selectionIndexRawCheckChange);
|
|
1050
|
+
});
|
|
1051
|
+
};
|
|
1052
|
+
TableComponent.prototype.ngAfterViewInit = function () {
|
|
1053
|
+
var _this = this;
|
|
1054
|
+
this.multiSelectionService.handle(this.checkBoxRows);
|
|
1055
|
+
this.checkBoxRows.changes.subscribe(function () {
|
|
1056
|
+
_this.multiSelectionService.handle(_this.checkBoxRows);
|
|
1057
|
+
});
|
|
1058
|
+
console.log('this.tableRows', this.tableRows);
|
|
815
1059
|
};
|
|
816
1060
|
TableComponent.prototype.onToggleAllCheckBox = function (event) {
|
|
817
1061
|
this.toggleAllCheckBox.emit(event.target.checked);
|
|
@@ -856,10 +1100,11 @@
|
|
|
856
1100
|
this.tableFiltersChange.emit(this.tableFilters);
|
|
857
1101
|
this._tableFiltersGroup.tableFiltersValuesChange$.next(this.tableFilters);
|
|
858
1102
|
};
|
|
859
|
-
TableComponent.prototype.
|
|
1103
|
+
TableComponent.prototype.ngOnDestroy = function () {
|
|
860
1104
|
if (this.filterGroupChangeSub) {
|
|
861
1105
|
this.filterGroupChangeSub.unsubscribe();
|
|
862
1106
|
}
|
|
1107
|
+
this.multiSelectionService.destroy();
|
|
863
1108
|
};
|
|
864
1109
|
return TableComponent;
|
|
865
1110
|
}());
|
|
@@ -867,19 +1112,28 @@
|
|
|
867
1112
|
{ type: i0.Component, args: [{
|
|
868
1113
|
selector: 'wac-table',
|
|
869
1114
|
template: "<div class=\"wac-table\">\n <!-- Header section -->\n <div class=\"wac-table__head\" id=\"headerTable\">\n <div *ngIf=\"checkbox\" class=\"wac-table__head__cell wac-table__head__cell--checkbox\">\n <wac-checkbox [id]=\"headerCheckBoxId\" (change)=\"onToggleAllCheckBox($event)\" [alone]=\"true\"></wac-checkbox>\n </div>\n\n <!-- Header contents are added with the headerCell directive -->\n <ng-content select=\"[headerCell]\"></ng-content>\n </div>\n\n <!-- Search section -->\n <div *ngIf=\"!disableSearch\" class=\"wac-table__search\">\n <wac-input-search\n [(ngModel)]=\"tableFilters.searchValue\"\n (changeDebounced)=\"searchChange()\"\n [placeholder]=\"placeholder\"\n [smallPadding]=\"true\"\n ></wac-input-search>\n </div>\n\n <!-- Body section -->\n <div class=\"wac-table__body\">\n <!-- Loader on body -->\n <div class=\"wac-table__body__loader\" *ngIf=\"isLoading\">\n <wac-loader [small]=\"true\"></wac-loader>\n </div>\n <!-- Body contents are added with the tableRow directive -->\n <ng-content select=\".complex-table\" *ngIf=\"!isLoading\"></ng-content>\n <ng-content select=\"[tableRow]\" *ngIf=\"!isLoading\"></ng-content>\n </div>\n\n <!-- Pagination section -->\n <wac-pagination *ngIf=\"!disablePagniation\" [pagination]=\"tableFilters\" (pageChange)=\"pageChange()\"></wac-pagination>\n</div>\n",
|
|
870
|
-
encapsulation: i0.ViewEncapsulation.None
|
|
1115
|
+
encapsulation: i0.ViewEncapsulation.None,
|
|
1116
|
+
providers: [
|
|
1117
|
+
TableCheckboxIdService,
|
|
1118
|
+
MultiSelectionService
|
|
1119
|
+
]
|
|
871
1120
|
},] }
|
|
872
1121
|
];
|
|
873
1122
|
TableComponent.ctorParameters = function () { return [
|
|
874
|
-
{ type: FiltersTableService }
|
|
1123
|
+
{ type: FiltersTableService },
|
|
1124
|
+
{ type: TableCheckboxIdService },
|
|
1125
|
+
{ type: MultiSelectionService }
|
|
875
1126
|
]; };
|
|
876
1127
|
TableComponent.propDecorators = {
|
|
1128
|
+
checkBoxRows: [{ type: i0.ContentChildren, args: [CheckBoxRow,] }],
|
|
1129
|
+
tableRows: [{ type: i0.ContentChildren, args: [TableRow,] }],
|
|
877
1130
|
tableFilters: [{ type: i0.Input }],
|
|
878
1131
|
tableFiltersChange: [{ type: i0.Output }],
|
|
879
1132
|
tableRoutingName: [{ type: i0.Input }],
|
|
880
1133
|
placeholder: [{ type: i0.Input }],
|
|
881
1134
|
checkbox: [{ type: i0.Input }],
|
|
882
1135
|
toggleAllCheckBox: [{ type: i0.Output }],
|
|
1136
|
+
checkBoxSelectionChange: [{ type: i0.Output }],
|
|
883
1137
|
disableSearch: [{ type: i0.Input }],
|
|
884
1138
|
disablePagniation: [{ type: i0.Input }],
|
|
885
1139
|
isLoading: [{ type: i0.Input }]
|
|
@@ -947,7 +1201,7 @@
|
|
|
947
1201
|
|
|
948
1202
|
var ButtonComponent = /** @class */ (function () {
|
|
949
1203
|
function ButtonComponent() {
|
|
950
|
-
this.extraClasses = 'is-info';
|
|
1204
|
+
this.extraClasses = 'is-info'; // todo make a list of existing class
|
|
951
1205
|
this.label = '';
|
|
952
1206
|
this.icon = '';
|
|
953
1207
|
this.widthAuto = false;
|
|
@@ -957,6 +1211,7 @@
|
|
|
957
1211
|
this.disabled = false;
|
|
958
1212
|
this.whiteSpaceNowrap = false;
|
|
959
1213
|
this.opacity = false;
|
|
1214
|
+
// TODO MAKE ANNIMATION AVAILABLE FOR MOBILE as CONFIRM DELETE DO (because, its doeant show the text and trigger click)
|
|
960
1215
|
this.animation = false;
|
|
961
1216
|
this.animationRight = false;
|
|
962
1217
|
this.animationText = '';
|
|
@@ -1702,6 +1957,7 @@
|
|
|
1702
1957
|
|
|
1703
1958
|
var TextAreaComponent = /** @class */ (function () {
|
|
1704
1959
|
function TextAreaComponent() {
|
|
1960
|
+
// todo simplify and improve progress bar
|
|
1705
1961
|
this.label = '';
|
|
1706
1962
|
this.value = '';
|
|
1707
1963
|
this.placeholder = '';
|
|
@@ -2444,121 +2700,6 @@
|
|
|
2444
2700
|
},] }
|
|
2445
2701
|
];
|
|
2446
2702
|
|
|
2447
|
-
var HtmlContainer = /** @class */ (function () {
|
|
2448
|
-
function HtmlContainer(hostElement, appRef, componentFactoryResolver, injector) {
|
|
2449
|
-
this.hostElement = hostElement;
|
|
2450
|
-
this.appRef = appRef;
|
|
2451
|
-
this.componentFactoryResolver = componentFactoryResolver;
|
|
2452
|
-
this.injector = injector;
|
|
2453
|
-
this.attached = false;
|
|
2454
|
-
}
|
|
2455
|
-
HtmlContainer.prototype.attach = function (component) {
|
|
2456
|
-
var _this = this;
|
|
2457
|
-
if (this.attached) {
|
|
2458
|
-
throw new Error('component has already been attached');
|
|
2459
|
-
}
|
|
2460
|
-
this.attached = true;
|
|
2461
|
-
var childComponentFactory = this.componentFactoryResolver.resolveComponentFactory(component);
|
|
2462
|
-
var componentRef = childComponentFactory.create(this.injector);
|
|
2463
|
-
this.appRef.attachView(componentRef.hostView);
|
|
2464
|
-
this.disposeFn = function () {
|
|
2465
|
-
_this.appRef.detachView(componentRef.hostView);
|
|
2466
|
-
componentRef.destroy();
|
|
2467
|
-
};
|
|
2468
|
-
this.hostElement.appendChild(componentRef.hostView.rootNodes[0]);
|
|
2469
|
-
return componentRef;
|
|
2470
|
-
};
|
|
2471
|
-
HtmlContainer.prototype.dispose = function () {
|
|
2472
|
-
if (this.attached) {
|
|
2473
|
-
this.disposeFn();
|
|
2474
|
-
}
|
|
2475
|
-
};
|
|
2476
|
-
return HtmlContainer;
|
|
2477
|
-
}());
|
|
2478
|
-
|
|
2479
|
-
var CheckBoxRow = /** @class */ (function () {
|
|
2480
|
-
function CheckBoxRow(currentRow, appRef, renderer, document, resolver, injector) {
|
|
2481
|
-
this.currentRow = currentRow;
|
|
2482
|
-
this.appRef = appRef;
|
|
2483
|
-
this.renderer = renderer;
|
|
2484
|
-
this.document = document;
|
|
2485
|
-
this.resolver = resolver;
|
|
2486
|
-
this.injector = injector;
|
|
2487
|
-
this.checkBoxValueChange = new i0.EventEmitter();
|
|
2488
|
-
}
|
|
2489
|
-
Object.defineProperty(CheckBoxRow.prototype, "checkBoxValue", {
|
|
2490
|
-
get: function () {
|
|
2491
|
-
return this._value;
|
|
2492
|
-
},
|
|
2493
|
-
set: function (value) {
|
|
2494
|
-
this._value = value;
|
|
2495
|
-
if (this.checkboxComponentRef) {
|
|
2496
|
-
this.setCheckBoxValue();
|
|
2497
|
-
}
|
|
2498
|
-
},
|
|
2499
|
-
enumerable: false,
|
|
2500
|
-
configurable: true
|
|
2501
|
-
});
|
|
2502
|
-
CheckBoxRow.prototype.ngOnInit = function () {
|
|
2503
|
-
this.createCheckBoxComponent();
|
|
2504
|
-
this.handleChecboxInputs();
|
|
2505
|
-
this.handleCheckboxOutputs();
|
|
2506
|
-
};
|
|
2507
|
-
CheckBoxRow.prototype.createCheckBoxComponent = function () {
|
|
2508
|
-
// Create the container
|
|
2509
|
-
var checkBoxContainer = document.createElement('div');
|
|
2510
|
-
checkBoxContainer.className = 'wac-table__body__line__cell wac-table__body__line__cell--checkbox';
|
|
2511
|
-
// Insert divCheckBox in the DOM as the first child of the row
|
|
2512
|
-
this.renderer.insertBefore(this.currentRow.nativeElement, checkBoxContainer, this.currentRow.nativeElement.firstChild);
|
|
2513
|
-
// Insert the CheckBoxComponent inside the container (DOM and Angular DOM)
|
|
2514
|
-
this.htmlContainer = new HtmlContainer(checkBoxContainer, this.appRef, this.resolver, this.injector);
|
|
2515
|
-
this.checkboxComponentRef = this.htmlContainer.attach(CheckboxComponent);
|
|
2516
|
-
};
|
|
2517
|
-
CheckBoxRow.prototype.handleChecboxInputs = function () {
|
|
2518
|
-
this.checkboxComponentRef.instance.id = this.checkBoxId ? this.checkBoxId : uuid.v4();
|
|
2519
|
-
this.checkboxComponentRef.instance.name = this.checkBoxName ? this.checkBoxName : undefined;
|
|
2520
|
-
this.checkboxComponentRef.instance.alone = true;
|
|
2521
|
-
this.setCheckBoxValue();
|
|
2522
|
-
};
|
|
2523
|
-
CheckBoxRow.prototype.setCheckBoxValue = function () {
|
|
2524
|
-
this.checkboxComponentRef.instance.value = this.checkBoxValue;
|
|
2525
|
-
};
|
|
2526
|
-
CheckBoxRow.prototype.handleCheckboxOutputs = function () {
|
|
2527
|
-
var _this = this;
|
|
2528
|
-
// Detect checkbox changes
|
|
2529
|
-
this.checkboxComponentRef.instance.registerOnChange(function () {
|
|
2530
|
-
_this._toggleCheckbox();
|
|
2531
|
-
});
|
|
2532
|
-
};
|
|
2533
|
-
CheckBoxRow.prototype._toggleCheckbox = function () {
|
|
2534
|
-
this.checkBoxValue = !this.checkBoxValue;
|
|
2535
|
-
this.checkBoxValueChange.emit(this.checkBoxValue);
|
|
2536
|
-
};
|
|
2537
|
-
CheckBoxRow.prototype.ngOnDestroy = function () {
|
|
2538
|
-
this.htmlContainer.dispose();
|
|
2539
|
-
};
|
|
2540
|
-
return CheckBoxRow;
|
|
2541
|
-
}());
|
|
2542
|
-
CheckBoxRow.decorators = [
|
|
2543
|
-
{ type: i0.Directive, args: [{
|
|
2544
|
-
selector: '[checkBoxRow]'
|
|
2545
|
-
},] }
|
|
2546
|
-
];
|
|
2547
|
-
CheckBoxRow.ctorParameters = function () { return [
|
|
2548
|
-
{ type: i0.ElementRef },
|
|
2549
|
-
{ type: i0.ApplicationRef },
|
|
2550
|
-
{ type: i0.Renderer2 },
|
|
2551
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [common.DOCUMENT,] }] },
|
|
2552
|
-
{ type: i0.ComponentFactoryResolver },
|
|
2553
|
-
{ type: i0.Injector }
|
|
2554
|
-
]; };
|
|
2555
|
-
CheckBoxRow.propDecorators = {
|
|
2556
|
-
checkBoxId: [{ type: i0.Input, args: ['checkBoxId',] }],
|
|
2557
|
-
checkBoxName: [{ type: i0.Input, args: ['checkBoxName',] }],
|
|
2558
|
-
checkBoxValue: [{ type: i0.Input, args: ['checkBoxValue',] }],
|
|
2559
|
-
checkBoxValueChange: [{ type: i0.Output }]
|
|
2560
|
-
};
|
|
2561
|
-
|
|
2562
2703
|
var TableColumn = /** @class */ (function () {
|
|
2563
2704
|
function TableColumn(currentCell, renderer, document) {
|
|
2564
2705
|
this.currentCell = currentCell;
|
|
@@ -2792,32 +2933,6 @@
|
|
|
2792
2933
|
tableFiltersChange: [{ type: i0.Output }]
|
|
2793
2934
|
};
|
|
2794
2935
|
|
|
2795
|
-
var TableRow = /** @class */ (function () {
|
|
2796
|
-
function TableRow(currentCell, renderer, document) {
|
|
2797
|
-
this.currentCell = currentCell;
|
|
2798
|
-
this.renderer = renderer;
|
|
2799
|
-
this.document = document;
|
|
2800
|
-
}
|
|
2801
|
-
TableRow.prototype.ngAfterViewInit = function () {
|
|
2802
|
-
this.applyCustomStylesOnCell();
|
|
2803
|
-
};
|
|
2804
|
-
TableRow.prototype.applyCustomStylesOnCell = function () {
|
|
2805
|
-
this.renderer.addClass(this.currentCell.nativeElement, 'wac-table__body__line');
|
|
2806
|
-
};
|
|
2807
|
-
return TableRow;
|
|
2808
|
-
}());
|
|
2809
|
-
TableRow.decorators = [
|
|
2810
|
-
{ type: i0.Directive, args: [{
|
|
2811
|
-
// The selector has the same name as the tableRaw selector in table.component.html
|
|
2812
|
-
selector: '[tableRow]'
|
|
2813
|
-
},] }
|
|
2814
|
-
];
|
|
2815
|
-
TableRow.ctorParameters = function () { return [
|
|
2816
|
-
{ type: i0.ElementRef },
|
|
2817
|
-
{ type: i0.Renderer2 },
|
|
2818
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [common.DOCUMENT,] }] }
|
|
2819
|
-
]; };
|
|
2820
|
-
|
|
2821
2936
|
var directives$1 = [TableColumn, CheckBoxRow, TableColumnHeader, TableRow,];
|
|
2822
2937
|
var TableModule = /** @class */ (function () {
|
|
2823
2938
|
function TableModule() {
|
|
@@ -3287,7 +3402,7 @@
|
|
|
3287
3402
|
}
|
|
3288
3403
|
});
|
|
3289
3404
|
};
|
|
3290
|
-
InputWithSelectComponent.prototype.
|
|
3405
|
+
InputWithSelectComponent.prototype.onClickItem = function (index) {
|
|
3291
3406
|
this.unActiveAll();
|
|
3292
3407
|
var optionSelected = this.options[index];
|
|
3293
3408
|
optionSelected.active = true;
|
|
@@ -3314,7 +3429,7 @@
|
|
|
3314
3429
|
InputWithSelectComponent.decorators = [
|
|
3315
3430
|
{ type: i0.Component, args: [{
|
|
3316
3431
|
selector: 'wac-input-with-select',
|
|
3317
|
-
template: "<div class=\"wac-input-with-select\" [zIndexToggle]=\"showSelect\">\n <label class=\"wac-input-with-select__label\" [for]=\"id\" [innerHTML]=\"label\"></label>\n <div class=\"wac-input-with-select__wrapper\">\n <div class=\"wac-input-with-select__wrapper__left\" wzAutoHide (clickOutside)=\"onCloseSelect()\">\n <input [id]=\"id\" type=\"text\" [placeholder]=\"placeholder\" (change)=\"onChangeInputValue($event)\" />\n <div class=\"wac-input-with-select__wrapper__left__current\">\n <span (click)=\"onToggleSelect()\">{{ currentLabel }}</span>\n </div>\n <div class=\"wac-input-with-select__wrapper__left__select\" *ngIf=\"showSelect\">\n <div class=\"wac-input-with-select__wrapper__left__select__item\" *ngFor=\"let option of options; let index = index\">\n <div (click)=\"
|
|
3432
|
+
template: "<div class=\"wac-input-with-select\" [zIndexToggle]=\"showSelect\">\n <label class=\"wac-input-with-select__label\" [for]=\"id\" [innerHTML]=\"label\"></label>\n <div class=\"wac-input-with-select__wrapper\">\n <div class=\"wac-input-with-select__wrapper__left\" wzAutoHide (clickOutside)=\"onCloseSelect()\">\n <input [id]=\"id\" type=\"text\" [placeholder]=\"placeholder\" (change)=\"onChangeInputValue($event)\" />\n <div class=\"wac-input-with-select__wrapper__left__current\">\n <span (click)=\"onToggleSelect()\">{{ currentLabel }}</span>\n </div>\n <div class=\"wac-input-with-select__wrapper__left__select\" *ngIf=\"showSelect\">\n <div class=\"wac-input-with-select__wrapper__left__select__item\" *ngFor=\"let option of options; let index = index\">\n <div (click)=\"onClickItem(index)\">{{ option.label }}</div>\n </div>\n </div>\n </div>\n <div class=\"wac-input-with-select__wrapper__right\">\n <p [innerHTML]=\"text\"></p>\n </div>\n </div>\n</div>\n"
|
|
3318
3433
|
},] }
|
|
3319
3434
|
];
|
|
3320
3435
|
InputWithSelectComponent.ctorParameters = function () { return []; };
|
|
@@ -3810,7 +3925,7 @@
|
|
|
3810
3925
|
SelectedListComponent.decorators = [
|
|
3811
3926
|
{ type: i0.Component, args: [{
|
|
3812
3927
|
selector: 'wac-selected-list',
|
|
3813
|
-
template: "<div class=\"selected-list\">\n <div class=\"selected-list__wrapper\">\n <div class=\"selected-list__wrapper__head\">\n <p *ngIf=\"label\" [innerHTML]=\"label\"></p>\n <ng-container *ngVar=\"(options | areAllOptionsSelected) as areAllOptionsSelected\">\n <
|
|
3928
|
+
template: "<div class=\"selected-list\">\n <div class=\"selected-list__wrapper\">\n <div class=\"selected-list__wrapper__head\">\n <p *ngIf=\"label\" [innerHTML]=\"label\"></p>\n <ng-container *ngVar=\"(options | areAllOptionsSelected) as areAllOptionsSelected\">\n <ng-container *ngIf=\"textSelectAll && !areAllOptionsSelected\">\n\n <span [innerHTML]=\"textSelectAll\" (click)=\"onSelectAll()\"></span>\n <div class=\"selected-list__wrapper__head__button\">\n <wac-button\n [extraClasses]=\"'is-grey'\"\n [icon]=\"'fa-duotone fa-check-double'\"\n (click)=\"onSelectAll()\"\n >\n </wac-button>\n </div>\n\n </ng-container>\n\n <ng-container *ngIf=\"textUnSelectAll && areAllOptionsSelected\">\n <span [innerHTML]=\"textUnSelectAll\" (click)=\"onUnSelectAll()\"></span>\n <div class=\"selected-list__wrapper__head__button\">\n <wac-button\n [extraClasses]=\"'is-grey'\"\n [icon]=\"'fa-duotone fa-check-double'\"\n (click)=\"onUnSelectAll()\"\n >\n </wac-button>\n </div>\n </ng-container>\n\n </ng-container>\n\n </div>\n <div class=\"selected-list__wrapper__content\">\n <div class=\"selected-list__wrapper__content__item\" *ngFor=\"let item of options;let i = index;\" [ngClass]=\"{'active': item.checked}\" (click)=\"onSelectItem(i)\">\n <span [innerHTML]=\"item.label\"></span>\n <i class=\"fas fa-check\"></i>\n </div>\n </div>\n </div>\n</div>\n"
|
|
3814
3929
|
},] }
|
|
3815
3930
|
];
|
|
3816
3931
|
SelectedListComponent.propDecorators = {
|
|
@@ -4227,7 +4342,9 @@
|
|
|
4227
4342
|
exports.ɵk = LoaderModule;
|
|
4228
4343
|
exports.ɵl = CheckboxModule;
|
|
4229
4344
|
exports.ɵm = inOutY;
|
|
4230
|
-
exports.ɵn =
|
|
4345
|
+
exports.ɵn = TableCheckboxIdService;
|
|
4346
|
+
exports.ɵo = MultiSelectionService;
|
|
4347
|
+
exports.ɵp = inOutX;
|
|
4231
4348
|
|
|
4232
4349
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4233
4350
|
|