@ecodev/natural 41.1.1 → 41.2.1
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/ecodev-natural.umd.js +20 -3
- package/bundles/ecodev-natural.umd.js.map +1 -1
- package/ecodev-natural.metadata.json +1 -1
- package/esm2015/lib/classes/query-variable-manager.js +7 -3
- package/esm2015/lib/classes/utility.js +13 -1
- package/esm2015/lib/modules/relations/relations.component.js +2 -2
- package/fesm2015/ecodev-natural.js +20 -4
- package/fesm2015/ecodev-natural.js.map +1 -1
- package/lib/classes/query-variable-manager.d.ts +7 -1
- package/lib/classes/utility.d.ts +5 -0
- package/package.json +1 -1
|
@@ -654,6 +654,18 @@
|
|
|
654
654
|
return source;
|
|
655
655
|
}
|
|
656
656
|
}
|
|
657
|
+
/**
|
|
658
|
+
* Copy text to clipboard.
|
|
659
|
+
* Accepts line breaks `\n` as textarea do.
|
|
660
|
+
*/
|
|
661
|
+
function copyToClipboard(document, text) {
|
|
662
|
+
var input = document.createElement('textarea');
|
|
663
|
+
document.body.append(input);
|
|
664
|
+
input.value = text;
|
|
665
|
+
input.select();
|
|
666
|
+
document.execCommand('copy');
|
|
667
|
+
document.body.removeChild(input);
|
|
668
|
+
}
|
|
657
669
|
|
|
658
670
|
// Basic; loosely typed structure for graphql-doctrine filters
|
|
659
671
|
// Logical operator to be used in conditions
|
|
@@ -742,9 +754,13 @@
|
|
|
742
754
|
}
|
|
743
755
|
this.updateVariables();
|
|
744
756
|
};
|
|
757
|
+
/**
|
|
758
|
+
* Return a deep clone of the variables for the given channel name.
|
|
759
|
+
*
|
|
760
|
+
* Avoid returning the same reference to prevent an attribute change, then another channel update that would
|
|
761
|
+
* used this changed attribute without having explicitly asked QueryVariablesManager to update it.
|
|
762
|
+
*/
|
|
745
763
|
NaturalQueryVariablesManager.prototype.get = function (channelName) {
|
|
746
|
-
// Avoid to return the same reference to prevent an attribute change, then another channel update that would used this changed
|
|
747
|
-
// attribute without having explicitly asked QueryVariablesManager to update it.
|
|
748
764
|
return lodashEs.cloneDeep(this.channels.get(channelName));
|
|
749
765
|
};
|
|
750
766
|
/**
|
|
@@ -10039,7 +10055,7 @@
|
|
|
10039
10055
|
NaturalRelationsComponent.decorators = [
|
|
10040
10056
|
{ type: i0.Component, args: [{
|
|
10041
10057
|
selector: 'natural-relations',
|
|
10042
|
-
template: "<div class=\"body\">\n <ng-template #defaultNameCell let-item=\"item\">\n {{ getDisplayFn()(item) }}\n </ng-template>\n\n <table *ngIf=\"dataSource\" [dataSource]=\"dataSource\" class=\"natural-row-click\" mat-table>\n <tr *matHeaderRowDef=\"displayedColumns\" mat-header-row style=\"display: none\"></tr>\n <tr *matRowDef=\"let row; columns: displayedColumns\" mat-row></tr>\n\n <ng-container matColumnDef=\"name\">\n <th *matHeaderCellDef i18n mat-header-cell>Titre</th>\n <td *matCellDef=\"let item\" mat-cell>\n <ng-template\n [ngTemplateOutletContext]=\"{item: item}\"\n [ngTemplateOutlet]=\"itemTemplate ? itemTemplate : defaultNameCell\"\n ></ng-template>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"unlink\">\n <th *matHeaderCellDef mat-header-cell></th>\n <td *matCellDef=\"let element\" mat-cell>\n <button\n (click)=\"removeRelation(element)\"\n color=\"warn\"\n mat-icon-button\n i18n-matTooltip\n matTooltip=\"Dissocier\"\n >\n <natural-icon name=\"link_off\"></natural-icon>\n </button>\n </td>\n </ng-container>\n </table>\n\n <mat-paginator\n (page)=\"pagination($event)\"\n *ngIf=\"dataSource?.data && (dataSource?.data?.length || 0) > (dataSource?.data?.pageSize || 0)\"\n [length]=\"dataSource?.data?.length || 0\"\n [pageIndex]=\"dataSource?.data?.pageIndex || 0\"\n [pageSizeOptions]=\"pageSizeOptions\"\n [pageSize]=\"dataSource?.data?.pageSize || 0\"\n ></mat-paginator>\n\n <div *ngIf=\"!loading && dataSource?.data?.length === 0\" class=\"margin-v mat-body\">\n <span i18n>Aucun r\u00E9sultat</span>\n </div>\n\n <mat-progress-spinner *ngIf=\"loading\" [diameter]=\"40\" class=\"loading\" mode=\"indeterminate\"></mat-progress-spinner>\n</div>\n\n<natural-select\n #select\n (selectionChange)=\"addRelations([$any($event)])\"\n *ngIf=\"!hierarchicSelectorConfig && service && !disabled\"\n [displayWith]=\"getDisplayFn()\"\n [filter]=\"autocompleteSelectorFilter\"\n [placeholder]=\"placeholder\"\n [service]=\"service\"\n [showIcon]=\"false\"\n></natural-select>\n\n<div *ngIf=\"hierarchicSelectorConfig && !disabled\">\n <button (click)=\"openNaturalHierarchicSelector()\" color=\"primary\" mat-flat-button>{{ placeholder }}</button>\n</div>\n",
|
|
10058
|
+
template: "<div class=\"body\">\n <ng-template #defaultNameCell let-item=\"item\">\n {{ getDisplayFn()(item) }}\n </ng-template>\n\n <table *ngIf=\"dataSource\" [dataSource]=\"dataSource\" class=\"natural-row-click\" mat-table>\n <tr *matHeaderRowDef=\"displayedColumns\" mat-header-row style=\"display: none\"></tr>\n <tr *matRowDef=\"let row; columns: displayedColumns\" mat-row></tr>\n\n <ng-container matColumnDef=\"name\">\n <th *matHeaderCellDef i18n mat-header-cell>Titre</th>\n <td *matCellDef=\"let item\" mat-cell>\n <ng-template\n [ngTemplateOutletContext]=\"{item: item}\"\n [ngTemplateOutlet]=\"itemTemplate ? itemTemplate : defaultNameCell\"\n ></ng-template>\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"unlink\">\n <th *matHeaderCellDef mat-header-cell></th>\n <td *matCellDef=\"let element\" mat-cell>\n <button\n *ngIf=\"!disabled\"\n (click)=\"removeRelation(element)\"\n color=\"warn\"\n mat-icon-button\n i18n-matTooltip\n matTooltip=\"Dissocier\"\n >\n <natural-icon name=\"link_off\"></natural-icon>\n </button>\n </td>\n </ng-container>\n </table>\n\n <mat-paginator\n (page)=\"pagination($event)\"\n *ngIf=\"dataSource?.data && (dataSource?.data?.length || 0) > (dataSource?.data?.pageSize || 0)\"\n [length]=\"dataSource?.data?.length || 0\"\n [pageIndex]=\"dataSource?.data?.pageIndex || 0\"\n [pageSizeOptions]=\"pageSizeOptions\"\n [pageSize]=\"dataSource?.data?.pageSize || 0\"\n ></mat-paginator>\n\n <div *ngIf=\"!loading && dataSource?.data?.length === 0\" class=\"margin-v mat-body\">\n <span i18n>Aucun r\u00E9sultat</span>\n </div>\n\n <mat-progress-spinner *ngIf=\"loading\" [diameter]=\"40\" class=\"loading\" mode=\"indeterminate\"></mat-progress-spinner>\n</div>\n\n<natural-select\n #select\n (selectionChange)=\"addRelations([$any($event)])\"\n *ngIf=\"!hierarchicSelectorConfig && service && !disabled\"\n [displayWith]=\"getDisplayFn()\"\n [filter]=\"autocompleteSelectorFilter\"\n [placeholder]=\"placeholder\"\n [service]=\"service\"\n [showIcon]=\"false\"\n></natural-select>\n\n<div *ngIf=\"hierarchicSelectorConfig && !disabled\">\n <button (click)=\"openNaturalHierarchicSelector()\" color=\"primary\" mat-flat-button>{{ placeholder }}</button>\n</div>\n",
|
|
10043
10059
|
styles: [":host{display:flex;flex-direction:column}:host>*:not(:last-child){margin-bottom:20px}:host .body{display:flex;flex-direction:column}:host .loading{margin:20px auto}:host .mat-column-unlink{width:2.5em}\n"]
|
|
10044
10060
|
},] }
|
|
10045
10061
|
];
|
|
@@ -11248,6 +11264,7 @@
|
|
|
11248
11264
|
exports.cancellableTimeout = cancellableTimeout;
|
|
11249
11265
|
exports.cleanSameValues = cleanSameValues;
|
|
11250
11266
|
exports.collectErrors = collectErrors;
|
|
11267
|
+
exports.copyToClipboard = copyToClipboard;
|
|
11251
11268
|
exports.debug = debug;
|
|
11252
11269
|
exports.decimal = decimal;
|
|
11253
11270
|
exports.deliverableEmail = deliverableEmail;
|