@provoly/dashboard 1.3.17 → 1.3.19
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/components/data-format/data-format.pipe.d.ts +0 -1
- package/esm2022/components/data-format/data-format.pipe.mjs +1 -21
- package/esm2022/filters/autocomplete/autocomplete.component.mjs +3 -3
- package/esm2022/import/components/list/import-list.component.mjs +2 -1
- package/esm2022/lib/core/components/select/select.component.mjs +4 -4
- package/esm2022/lib/core/i18n/en.translations.mjs +3 -2
- package/esm2022/lib/core/i18n/fr.translations.mjs +3 -2
- package/esm2022/lib/dashboard/components/widgets/datasource-selector/datasource-card/datasource-card.component.mjs +3 -3
- package/esm2022/widgets/widget-aggregated-chart/component/widget-aggregated-chart.component.mjs +7 -4
- package/esm2022/widgets/widget-aggregated-chart/i18n/en.translations.mjs +11 -1
- package/esm2022/widgets/widget-aggregated-chart/i18n/fr.translations.mjs +12 -2
- package/esm2022/widgets/widget-tile/component/widget-tile.component.mjs +7 -5
- package/esm2022/widgets/widget-tile/style/css.component.mjs +2 -2
- package/esm2022/widgets/widget-vega/component/widget-vega.component.mjs +3 -8
- package/fesm2022/provoly-dashboard-components-data-format.mjs +1 -21
- package/fesm2022/provoly-dashboard-components-data-format.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-filters-autocomplete.mjs +2 -2
- package/fesm2022/provoly-dashboard-filters-autocomplete.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-import.mjs +1 -0
- package/fesm2022/provoly-dashboard-import.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-aggregated-chart.mjs +27 -4
- package/fesm2022/provoly-dashboard-widgets-widget-aggregated-chart.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-tile.mjs +8 -6
- package/fesm2022/provoly-dashboard-widgets-widget-tile.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-vega.mjs +2 -7
- package/fesm2022/provoly-dashboard-widgets-widget-vega.mjs.map +1 -1
- package/fesm2022/provoly-dashboard.mjs +9 -7
- package/fesm2022/provoly-dashboard.mjs.map +1 -1
- package/import/components/list/import-list.component.d.ts +2 -2
- package/lib/core/i18n/en.translations.d.ts +1 -0
- package/lib/core/i18n/fr.translations.d.ts +1 -0
- package/package.json +13 -13
- package/widgets/widget-aggregated-chart/component/widget-aggregated-chart.component.d.ts +2 -1
- package/widgets/widget-aggregated-chart/i18n/en.translations.d.ts +10 -0
- package/widgets/widget-aggregated-chart/i18n/fr.translations.d.ts +10 -0
- package/widgets/widget-tile/component/widget-tile.component.d.ts +2 -2
- package/widgets/widget-tile/style/_o-widget-tile.scss +4 -0
|
@@ -20,11 +20,11 @@ import { WidgetDetailModule } from '@provoly/dashboard/widgets/widget-detail';
|
|
|
20
20
|
|
|
21
21
|
class PryWidgetTileCssComponent {
|
|
22
22
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PryWidgetTileCssComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
23
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: PryWidgetTileCssComponent, selector: "pry-widget-tile-css", ngImport: i0, template: '', isInline: true, styles: [".o-widget--tile__list{margin:0;padding:0}.o-widget--tile__list li{list-style:none}.o-widget--tile-wrapper{flex:1;overflow:auto;height:100%;padding-bottom:3.75rem}.o-widget--tile__list{display:flex;flex-wrap:wrap;justify-content:space-between;gap:1.25rem;padding:1.25rem}.o-widget--tile__list__item{display:flex;flex-direction:column;flex-basis:32%;overflow:hidden;padding:0}.o-widget--tile__list__item .o-widget.o-widget--detail{height:auto;padding-top:15px}.o-widget--tile__list__item__header{display:flex;align-items:center;justify-content:space-between;padding:.625rem}.o-widget--tile__list__item__header__title{margin-bottom:0;padding-bottom:0;font-size:.9375rem}.o-widget--tile__list__item__header .a-checkbox{margin-bottom:0}.o-widget--tile__list__item__header__id{padding:.625rem;margin-bottom:0;font-size:.75rem}.o-widget--tile__list__item__footer{margin-top:auto;padding:.625rem}.o-widget--tile__list__item__footer .a-btn.a-btn--icon-text{display:inline-flex;margin:.3125rem 0 .1875rem;padding:.75rem 0;font-weight:400}.o-widget--tile__list__item__footer .a-btn.a-btn--icon-text:after{content:\"\";position:relative;left:.25rem;display:inline-flex;align-items:center;justify-content:center;width:.5rem;height:.5rem;border-style:solid;border-width:.09375rem .09375rem 0 0;top:-.25rem;transform:rotate(135deg);top:-.125rem;margin-right:.3125rem}.o-widget--tile__list__item__footer .a-btn.a-btn--icon-text[aria-expanded=true]:after{content:\"\";position:relative;left:.25rem;display:inline-flex;align-items:center;justify-content:center;width:.5rem;height:.5rem;border-style:solid;border-width:.09375rem .09375rem 0 0;top:.09375rem;transform:rotate(-45deg);top:.125rem}\n"], encapsulation: i0.ViewEncapsulation.None }); }
|
|
23
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: PryWidgetTileCssComponent, selector: "pry-widget-tile-css", ngImport: i0, template: '', isInline: true, styles: [".o-widget--tile__list{margin:0;padding:0}.o-widget--tile__list li{list-style:none}.o-widget--tile-wrapper{flex:1;overflow:auto;height:100%;padding-bottom:3.75rem}.o-widget--tile__list{display:flex;flex-wrap:wrap;justify-content:space-between;gap:1.25rem;padding:1.25rem}.o-widget--tile__list__item{display:flex;flex-direction:column;flex-basis:32%;overflow:hidden;padding:0}.o-widget--tile__list__item .o-widget.o-widget--detail{height:auto;padding-top:15px}.o-widget--tile__list__item__header{display:flex;align-items:center;justify-content:space-between;padding:.625rem}.o-widget--tile__list__item__header__title{margin-bottom:0;padding-bottom:0;font-size:.9375rem}.o-widget--tile__list__item__header .a-checkbox{margin-bottom:0}.o-widget--tile__list__item__header__id{padding:.625rem;margin-bottom:0;font-size:.75rem}.o-widget--tile__list__item__footer{margin-top:auto;padding:.625rem}.o-widget--tile__list__item__footer .a-btn.a-btn--icon-text{display:inline-flex;margin:.3125rem 0 .1875rem;padding:.75rem 0;font-weight:400}.o-widget--tile__list__item__footer .a-btn.a-btn--icon-text:after{content:\"\";position:relative;left:.25rem;display:inline-flex;align-items:center;justify-content:center;width:.5rem;height:.5rem;border-style:solid;border-width:.09375rem .09375rem 0 0;top:-.25rem;transform:rotate(135deg);top:-.125rem;margin-right:.3125rem}.o-widget--tile__list__item__footer .a-btn.a-btn--icon-text[aria-expanded=true]:after{content:\"\";position:relative;left:.25rem;display:inline-flex;align-items:center;justify-content:center;width:.5rem;height:.5rem;border-style:solid;border-width:.09375rem .09375rem 0 0;top:.09375rem;transform:rotate(-45deg);top:.125rem}.o-widget--tile__list__item__map{height:31.25rem}\n"], encapsulation: i0.ViewEncapsulation.None }); }
|
|
24
24
|
}
|
|
25
25
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PryWidgetTileCssComponent, decorators: [{
|
|
26
26
|
type: Component,
|
|
27
|
-
args: [{ selector: 'pry-widget-tile-css', template: '', encapsulation: ViewEncapsulation.None, styles: [".o-widget--tile__list{margin:0;padding:0}.o-widget--tile__list li{list-style:none}.o-widget--tile-wrapper{flex:1;overflow:auto;height:100%;padding-bottom:3.75rem}.o-widget--tile__list{display:flex;flex-wrap:wrap;justify-content:space-between;gap:1.25rem;padding:1.25rem}.o-widget--tile__list__item{display:flex;flex-direction:column;flex-basis:32%;overflow:hidden;padding:0}.o-widget--tile__list__item .o-widget.o-widget--detail{height:auto;padding-top:15px}.o-widget--tile__list__item__header{display:flex;align-items:center;justify-content:space-between;padding:.625rem}.o-widget--tile__list__item__header__title{margin-bottom:0;padding-bottom:0;font-size:.9375rem}.o-widget--tile__list__item__header .a-checkbox{margin-bottom:0}.o-widget--tile__list__item__header__id{padding:.625rem;margin-bottom:0;font-size:.75rem}.o-widget--tile__list__item__footer{margin-top:auto;padding:.625rem}.o-widget--tile__list__item__footer .a-btn.a-btn--icon-text{display:inline-flex;margin:.3125rem 0 .1875rem;padding:.75rem 0;font-weight:400}.o-widget--tile__list__item__footer .a-btn.a-btn--icon-text:after{content:\"\";position:relative;left:.25rem;display:inline-flex;align-items:center;justify-content:center;width:.5rem;height:.5rem;border-style:solid;border-width:.09375rem .09375rem 0 0;top:-.25rem;transform:rotate(135deg);top:-.125rem;margin-right:.3125rem}.o-widget--tile__list__item__footer .a-btn.a-btn--icon-text[aria-expanded=true]:after{content:\"\";position:relative;left:.25rem;display:inline-flex;align-items:center;justify-content:center;width:.5rem;height:.5rem;border-style:solid;border-width:.09375rem .09375rem 0 0;top:.09375rem;transform:rotate(-45deg);top:.125rem}\n"] }]
|
|
27
|
+
args: [{ selector: 'pry-widget-tile-css', template: '', encapsulation: ViewEncapsulation.None, styles: [".o-widget--tile__list{margin:0;padding:0}.o-widget--tile__list li{list-style:none}.o-widget--tile-wrapper{flex:1;overflow:auto;height:100%;padding-bottom:3.75rem}.o-widget--tile__list{display:flex;flex-wrap:wrap;justify-content:space-between;gap:1.25rem;padding:1.25rem}.o-widget--tile__list__item{display:flex;flex-direction:column;flex-basis:32%;overflow:hidden;padding:0}.o-widget--tile__list__item .o-widget.o-widget--detail{height:auto;padding-top:15px}.o-widget--tile__list__item__header{display:flex;align-items:center;justify-content:space-between;padding:.625rem}.o-widget--tile__list__item__header__title{margin-bottom:0;padding-bottom:0;font-size:.9375rem}.o-widget--tile__list__item__header .a-checkbox{margin-bottom:0}.o-widget--tile__list__item__header__id{padding:.625rem;margin-bottom:0;font-size:.75rem}.o-widget--tile__list__item__footer{margin-top:auto;padding:.625rem}.o-widget--tile__list__item__footer .a-btn.a-btn--icon-text{display:inline-flex;margin:.3125rem 0 .1875rem;padding:.75rem 0;font-weight:400}.o-widget--tile__list__item__footer .a-btn.a-btn--icon-text:after{content:\"\";position:relative;left:.25rem;display:inline-flex;align-items:center;justify-content:center;width:.5rem;height:.5rem;border-style:solid;border-width:.09375rem .09375rem 0 0;top:-.25rem;transform:rotate(135deg);top:-.125rem;margin-right:.3125rem}.o-widget--tile__list__item__footer .a-btn.a-btn--icon-text[aria-expanded=true]:after{content:\"\";position:relative;left:.25rem;display:inline-flex;align-items:center;justify-content:center;width:.5rem;height:.5rem;border-style:solid;border-width:.09375rem .09375rem 0 0;top:.09375rem;transform:rotate(-45deg);top:.125rem}.o-widget--tile__list__item__map{height:31.25rem}\n"] }]
|
|
28
28
|
}] });
|
|
29
29
|
|
|
30
30
|
class WidgetTileComponent extends DataWidgetComponent {
|
|
@@ -105,8 +105,10 @@ class WidgetTileComponent extends DataWidgetComponent {
|
|
|
105
105
|
$event.preventDefault();
|
|
106
106
|
this.store.dispatch(DashboardActions.select({ id: item.id, cumulative: !$event.shiftKey }));
|
|
107
107
|
}
|
|
108
|
-
toggleMap(index) {
|
|
109
|
-
this.maps[index] = !this.maps[index]
|
|
108
|
+
toggleMap(index, item) {
|
|
109
|
+
this.maps[index] = !this.maps[index]
|
|
110
|
+
? { items: { [item.oClass]: [item] }, relations: [] }
|
|
111
|
+
: undefined;
|
|
110
112
|
}
|
|
111
113
|
resultSetWithItem(item) {
|
|
112
114
|
return { items: { [item.oClass]: [item] }, relations: [] };
|
|
@@ -136,11 +138,11 @@ class WidgetTileComponent extends DataWidgetComponent {
|
|
|
136
138
|
return Object.keys(value?.metadata ?? {}).length > 0;
|
|
137
139
|
}
|
|
138
140
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: WidgetTileComponent, deps: [{ token: i1.Store }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
139
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
141
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: WidgetTileComponent, selector: "pry-widget-tile", usesInheritance: true, ngImport: i0, template: "<pry-widget-tile-css></pry-widget-tile-css>\n<div class=\"o-widget o-widget--tile\">\n <pry-widget-header\n [datasourceIds]=\"(datasourceIds$ | async) ?? []\"\n *ngIf=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [manifest]=\"manifest\"\n (manifestModified)=\"manifestModified.emit($event)\"\n [headerOptions]=\"(displayHeader$ | async) ?? {}\"\n #header\n >\n <pry-settings\n (saveTriggered)=\"emitManifest()\"\n (changeTitle)=\"changeWidgetTitle($event)\"\n [headerPresent]=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [header]=\"header\"\n [open$]=\"open$\"\n class=\"o-settings\"\n >\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"tile_classes\">{{ '@pry.widget.tile.classes' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeClasses($event)\"\n [items]=\"classes$ | async\"\n [multiple]=\"true\"\n [closeOnSelect]=\"false\"\n [ngModel]=\"optionsCopy.classes\"\n bindLabel=\"name\"\n bindValue=\"id\"\n id=\"tile_classes\"\n ></pry-select>\n </div>\n </pry-settings>\n </pry-widget-header>\n <div class=\"o-widget--tile-wrapper\" [style.top]=\"(displayHeader$ | async) ? WIDGET_HEADER_HEIGHT + 'px' : 0\">\n @if ((items$ | async)?.length === 0) {\n <div class=\"no-result\">\n <img\n class=\"no-result__search\"\n src=\"../../../assets/svgs/pry_recherche_pas_de_resultat.svg\"\n alt=\"{{ '@pry.widget.tile.empty' | i18n }}\"\n aria-hidden=\"true\"\n />\n <span class=\"no-result__text\">{{ '@pry.widget.tile.empty' | i18n }}</span>\n </div>\n }\n <ul class=\"o-widget--tile__list\">\n @for (item of items$ | async; track item.id; let index = $index) {\n <li class=\"o-widget--tile__list__item\" (contextmenu)=\"contextMenu($event, item)\">\n <div class=\"o-widget--tile__list__item__header\">\n <img\n [height]=\"25\"\n [width]=\"25\"\n [src]=\"item | translateItemToSymbol | async\"\n [alt]=\"item.oClass | translateId: { type: 'class', output: 'name' } | async\"\n />\n <h3 class=\"o-widget--tile__list__item__header__title\">\n {{\n item.oClass\n | translateId\n : {\n type: 'class',\n output: 'name'\n }\n | async\n }}\n </h3>\n <pry-checkbox\n [ngModel]=\"(selectedIds$ | async).includes(item.id)\"\n (click)=\"select($event, item)\"\n ></pry-checkbox>\n </div>\n <div class=\"o-properties\">\n <ul class=\"o-properties__list\">\n @for (property of (propertiesToDisplay$ | async)![item.oClass]; track property.prop) {\n <li\n *ngFor=\"let value of getValue(item, property.prop); let i = index; let c = count\"\n class=\"o-properties__list__item\"\n >\n @if (i === 0) {\n <p class=\"o-properties__list__item__label\">{{ property.label }}:</p>\n }\n @if (!isRaw(property.label, item.oClass)) {\n <p class=\"o-properties__list__item__value\">\n {{ value?.value | dataFormat: property.field }}\n </p>\n } @else {\n <p class=\"o-properties__list__item__raw\">\n <pry-vizualize-raw [item]=\"item\" [propertyName]=\"property.label\"></pry-vizualize-raw>\n </p>\n }\n @if (hasMetadata(value)) {\n <pry-metadata [item]=\"value\"></pry-metadata>\n }\n </li>\n }\n </ul>\n </div>\n <div (click)=\"toggleMap(index, item)\" class=\"o-widget--tile__list__item__footer\">\n <button\n type=\"button\"\n class=\"a-btn a-btn--icon-text -link-like\"\n aria-controls=\"tile-map-xxx\"\n aria-expanded=\"false\"\n >\n {{ '@pry.widget.tile.map' | i18n }}\n </button>\n </div>\n @if (maps[index]) {\n <div class=\"o-widget--tile__list__item__map\" id=\"tile-map-xxx\">\n <pry-widget-map [staticManifest]=\"mapManifest\" [staticResultSet]=\"maps[index]!\"></pry-widget-map>\n </div>\n }\n </li>\n }\n </ul>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.SettingsComponent, selector: "pry-settings", inputs: ["widgetIndex", "isDisable", "headerPresent", "open$", "header"], outputs: ["triggerClick", "saveTriggered", "changeTitle"] }, { kind: "component", type: i4.MetadataComponent, selector: "pry-metadata", inputs: ["item"] }, { kind: "component", type: i4.PryWidgetHeaderComponent, selector: "pry-widget-header", inputs: ["manifest", "openData$", "additionalOptions", "headerOptions", "displayCount", "datasourceIds", "widgetIndex"], outputs: ["manifestModified"] }, { kind: "component", type: i4.VizualizeRawComponent, selector: "pry-vizualize-raw", inputs: ["item", "propertyName", "alt"] }, { kind: "component", type: i4.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "readonly", "autocomplete", "alwaysShowAutosuggestedValues", "externalAutocompleteService", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared", "clicked"] }, { kind: "component", type: i5.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle", "name", "inputId", "inhibit"] }, { kind: "component", type: i6.WidgetMapComponent, selector: "pry-widget-map" }, { kind: "component", type: PryWidgetTileCssComponent, selector: "pry-widget-tile-css" }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.TranslateIdPipe, name: "translateId" }, { kind: "pipe", type: i4.TranslateItemToSymbolPipe, name: "translateItemToSymbol" }, { kind: "pipe", type: i4.I18nPipe, name: "i18n" }, { kind: "pipe", type: i8.DataFormatPipe, name: "dataFormat" }] }); }
|
|
140
142
|
}
|
|
141
143
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: WidgetTileComponent, decorators: [{
|
|
142
144
|
type: Component,
|
|
143
|
-
args: [{ selector: 'pry-widget-tile', template: "<pry-widget-tile-css></pry-widget-tile-css>\n<div class=\"o-widget o-widget--tile\">\n <pry-widget-header\n [datasourceIds]=\"(datasourceIds$ | async) ?? []\"\n *ngIf=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [manifest]=\"manifest\"\n (manifestModified)=\"manifestModified.emit($event)\"\n [headerOptions]=\"(displayHeader$ | async) ?? {}\"\n #header\n >\n <pry-settings\n (saveTriggered)=\"emitManifest()\"\n (changeTitle)=\"changeWidgetTitle($event)\"\n [headerPresent]=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [header]=\"header\"\n [open$]=\"open$\"\n class=\"o-settings\"\n >\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"tile_classes\">{{ '@pry.widget.tile.classes' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeClasses($event)\"\n [items]=\"classes$ | async\"\n [multiple]=\"true\"\n [closeOnSelect]=\"false\"\n [ngModel]=\"optionsCopy.classes\"\n bindLabel=\"name\"\n bindValue=\"id\"\n id=\"tile_classes\"\n ></pry-select>\n </div>\n </pry-settings>\n </pry-widget-header>\n <div class=\"o-widget--tile-wrapper\" [style.top]=\"(displayHeader$ | async) ? WIDGET_HEADER_HEIGHT + 'px' : 0\">\n
|
|
145
|
+
args: [{ selector: 'pry-widget-tile', template: "<pry-widget-tile-css></pry-widget-tile-css>\n<div class=\"o-widget o-widget--tile\">\n <pry-widget-header\n [datasourceIds]=\"(datasourceIds$ | async) ?? []\"\n *ngIf=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [manifest]=\"manifest\"\n (manifestModified)=\"manifestModified.emit($event)\"\n [headerOptions]=\"(displayHeader$ | async) ?? {}\"\n #header\n >\n <pry-settings\n (saveTriggered)=\"emitManifest()\"\n (changeTitle)=\"changeWidgetTitle($event)\"\n [headerPresent]=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [header]=\"header\"\n [open$]=\"open$\"\n class=\"o-settings\"\n >\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"tile_classes\">{{ '@pry.widget.tile.classes' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeClasses($event)\"\n [items]=\"classes$ | async\"\n [multiple]=\"true\"\n [closeOnSelect]=\"false\"\n [ngModel]=\"optionsCopy.classes\"\n bindLabel=\"name\"\n bindValue=\"id\"\n id=\"tile_classes\"\n ></pry-select>\n </div>\n </pry-settings>\n </pry-widget-header>\n <div class=\"o-widget--tile-wrapper\" [style.top]=\"(displayHeader$ | async) ? WIDGET_HEADER_HEIGHT + 'px' : 0\">\n @if ((items$ | async)?.length === 0) {\n <div class=\"no-result\">\n <img\n class=\"no-result__search\"\n src=\"../../../assets/svgs/pry_recherche_pas_de_resultat.svg\"\n alt=\"{{ '@pry.widget.tile.empty' | i18n }}\"\n aria-hidden=\"true\"\n />\n <span class=\"no-result__text\">{{ '@pry.widget.tile.empty' | i18n }}</span>\n </div>\n }\n <ul class=\"o-widget--tile__list\">\n @for (item of items$ | async; track item.id; let index = $index) {\n <li class=\"o-widget--tile__list__item\" (contextmenu)=\"contextMenu($event, item)\">\n <div class=\"o-widget--tile__list__item__header\">\n <img\n [height]=\"25\"\n [width]=\"25\"\n [src]=\"item | translateItemToSymbol | async\"\n [alt]=\"item.oClass | translateId: { type: 'class', output: 'name' } | async\"\n />\n <h3 class=\"o-widget--tile__list__item__header__title\">\n {{\n item.oClass\n | translateId\n : {\n type: 'class',\n output: 'name'\n }\n | async\n }}\n </h3>\n <pry-checkbox\n [ngModel]=\"(selectedIds$ | async).includes(item.id)\"\n (click)=\"select($event, item)\"\n ></pry-checkbox>\n </div>\n <div class=\"o-properties\">\n <ul class=\"o-properties__list\">\n @for (property of (propertiesToDisplay$ | async)![item.oClass]; track property.prop) {\n <li\n *ngFor=\"let value of getValue(item, property.prop); let i = index; let c = count\"\n class=\"o-properties__list__item\"\n >\n @if (i === 0) {\n <p class=\"o-properties__list__item__label\">{{ property.label }}:</p>\n }\n @if (!isRaw(property.label, item.oClass)) {\n <p class=\"o-properties__list__item__value\">\n {{ value?.value | dataFormat: property.field }}\n </p>\n } @else {\n <p class=\"o-properties__list__item__raw\">\n <pry-vizualize-raw [item]=\"item\" [propertyName]=\"property.label\"></pry-vizualize-raw>\n </p>\n }\n @if (hasMetadata(value)) {\n <pry-metadata [item]=\"value\"></pry-metadata>\n }\n </li>\n }\n </ul>\n </div>\n <div (click)=\"toggleMap(index, item)\" class=\"o-widget--tile__list__item__footer\">\n <button\n type=\"button\"\n class=\"a-btn a-btn--icon-text -link-like\"\n aria-controls=\"tile-map-xxx\"\n aria-expanded=\"false\"\n >\n {{ '@pry.widget.tile.map' | i18n }}\n </button>\n </div>\n @if (maps[index]) {\n <div class=\"o-widget--tile__list__item__map\" id=\"tile-map-xxx\">\n <pry-widget-map [staticManifest]=\"mapManifest\" [staticResultSet]=\"maps[index]!\"></pry-widget-map>\n </div>\n }\n </li>\n }\n </ul>\n </div>\n</div>\n" }]
|
|
144
146
|
}], ctorParameters: () => [{ type: i1.Store }, { type: i0.ElementRef }] });
|
|
145
147
|
|
|
146
148
|
const enTranslations = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provoly-dashboard-widgets-widget-tile.mjs","sources":["../../../../projects/provoly/dashboard/widgets/widget-tile/style/css.component.ts","../../../../projects/provoly/dashboard/widgets/widget-tile/component/widget-tile.component.ts","../../../../projects/provoly/dashboard/widgets/widget-tile/component/widget-tile.component.html","../../../../projects/provoly/dashboard/widgets/widget-tile/i18n/en.translations.ts","../../../../projects/provoly/dashboard/widgets/widget-tile/i18n/fr.translations.ts","../../../../projects/provoly/dashboard/widgets/widget-tile/widget-tile.module.ts","../../../../projects/provoly/dashboard/widgets/widget-tile/provoly-dashboard-widgets-widget-tile.ts"],"sourcesContent":["import { Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'pry-widget-tile-css',\n template: '',\n styleUrls: ['./_o-widget-tile.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class PryWidgetTileCssComponent {}\n","import { Component, ElementRef } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport {\n AttributeSimpleValue,\n Class,\n ClassSelectors,\n ConfigSelectors,\n ContextMenuActions,\n DashboardActions,\n DashboardSelectors,\n DataWidgetComponent,\n Field,\n FieldSelectors,\n FieldType,\n Item,\n ItemUtils,\n ResultSet,\n TileWidgetOptions,\n WIDGET_HEADER_HEIGHT\n} from '@provoly/dashboard';\nimport { combineLatest, Observable } from 'rxjs';\nimport { filter, map } from 'rxjs/operators';\n\n@Component({\n selector: 'pry-widget-tile',\n templateUrl: './widget-tile.component.html'\n})\nexport class WidgetTileComponent extends DataWidgetComponent {\n options$: Observable<TileWidgetOptions>;\n items$: Observable<Item[]>;\n selectedIds$: Observable<any>;\n maps: boolean[] = [];\n mapManifest = {\n type: 'map',\n header: false,\n layout: { x: 1, y: 1, width: 1, height: 1 },\n options: { layers: [{ type: 'marker' }], fit: true }\n };\n classes$: Observable<Class[]>;\n optionsCopy: TileWidgetOptions = {};\n WIDGET_HEADER_HEIGHT = WIDGET_HEADER_HEIGHT;\n propertiesToDisplay$: Observable<{ [p: string]: { label: string; prop: string; field: Field }[] } | undefined>;\n fields: Field[] = [];\n classes: Class[] = [];\n\n constructor(store: Store<any>, el: ElementRef) {\n super(store, el);\n this.options$ = this.manifest$.pipe(map((manifest) => manifest.options as TileWidgetOptions));\n this.subscriptions.add(\n this.options$.pipe(filter((opt) => !!opt)).subscribe((options) => {\n this.optionsCopy = { ...(JSON.parse(JSON.stringify(options)) as TileWidgetOptions) };\n })\n );\n this.items$ = combineLatest([\n this.resultSet$.pipe(map((rs) => Object.values(rs.items).reduce((p, c) => [...p, ...c], []))),\n this.options$\n ]).pipe(\n map(([items, options]) =>\n items.filter(\n (item) => !options.classes || options.classes.length === 0 || options.classes.includes(item.oClass)\n )\n )\n );\n this.selectedIds$ = this.store.select(DashboardSelectors.selectedItemIds);\n this.classes$ = this.store.select(ClassSelectors.classes);\n this.propertiesToDisplay$ = combineLatest([\n this.classes$,\n this.store.select(ConfigSelectors.tileAttributesDefinitions),\n this.store.select(ConfigSelectors.maxAttributesInTiles)\n ]).pipe(\n map(([classes, tileDefs, maxTilesAttributes]) => ({\n ...classes\n .map((clazz) => ({\n [clazz.id]: [\n ...clazz.attributes\n .map((attr) => ({\n label: attr.name,\n prop: attr.technicalName,\n field: attr.field\n }))\n .filter((_, i) => i < maxTilesAttributes)\n ]\n }))\n .reduce((p, c) => ({ ...p, ...c }), {}),\n ...classes\n .filter((clazz) => !!tileDefs[clazz.id])\n .map((clazz) => ({\n [clazz.id]: [\n ...clazz.attributes\n .filter((attr) => tileDefs[clazz.id].includes(attr.name))\n .map((attr) => ({\n label: attr.name,\n prop: attr.technicalName,\n field: attr.field\n }))\n ]\n }))\n .reduce((p, c) => ({ ...p, ...c }), {})\n }))\n );\n this.subscriptions.add(this.store.select(FieldSelectors.fields).subscribe((fields) => (this.fields = fields)));\n this.subscriptions.add(this.classes$.subscribe((classes) => (this.classes = classes)));\n }\n\n contextMenu($event: MouseEvent, item: Item) {\n if (this.manifest.contextMenu !== false) {\n $event.stopPropagation();\n $event.preventDefault();\n this.store.dispatch(\n ContextMenuActions.open({\n itemId: item.id,\n clientX: $event.clientX,\n clientY: $event.clientY,\n from: 'tile',\n allowObjectCreation: false\n })\n );\n }\n }\n\n select($event: MouseEvent, item: Item) {\n $event.stopPropagation();\n $event.preventDefault();\n this.store.dispatch(DashboardActions.select({ id: item.id, cumulative: !$event.shiftKey }));\n }\n\n toggleMap(index: number) {\n this.maps[index] = !this.maps[index];\n }\n\n resultSetWithItem(item: Item): ResultSet {\n return { items: { [item.oClass]: [item] }, relations: [] };\n }\n\n emitManifest() {\n this.manifestModified.emit({\n widgetIndex: this.widgetIndex,\n manifest: {\n ...this.manifest,\n options: this.optionsCopy\n }\n });\n }\n\n changeClasses($event: any) {\n this.optionsCopy.classes = $event;\n }\n\n getValue(item: Item, property: string): AttributeSimpleValue[] {\n const value = ItemUtils.getAttributeValue(item, property);\n return Array.isArray(value) ? value : [value];\n }\n\n isRaw(property: string, classId: string): boolean {\n const clazz = this.classes.find((clazz) => clazz.id === classId);\n const prop = clazz?.attributes.find((attr) => attr.name === property);\n return prop?.field.type === FieldType.RAW ?? false;\n }\n\n hasMetadata(value: AttributeSimpleValue | Item) {\n return Object.keys(value?.metadata ?? {}).length > 0;\n }\n}\n","<pry-widget-tile-css></pry-widget-tile-css>\n<div class=\"o-widget o-widget--tile\">\n <pry-widget-header\n [datasourceIds]=\"(datasourceIds$ | async) ?? []\"\n *ngIf=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [manifest]=\"manifest\"\n (manifestModified)=\"manifestModified.emit($event)\"\n [headerOptions]=\"(displayHeader$ | async) ?? {}\"\n #header\n >\n <pry-settings\n (saveTriggered)=\"emitManifest()\"\n (changeTitle)=\"changeWidgetTitle($event)\"\n [headerPresent]=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [header]=\"header\"\n [open$]=\"open$\"\n class=\"o-settings\"\n >\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"tile_classes\">{{ '@pry.widget.tile.classes' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeClasses($event)\"\n [items]=\"classes$ | async\"\n [multiple]=\"true\"\n [closeOnSelect]=\"false\"\n [ngModel]=\"optionsCopy.classes\"\n bindLabel=\"name\"\n bindValue=\"id\"\n id=\"tile_classes\"\n ></pry-select>\n </div>\n </pry-settings>\n </pry-widget-header>\n <div class=\"o-widget--tile-wrapper\" [style.top]=\"(displayHeader$ | async) ? WIDGET_HEADER_HEIGHT + 'px' : 0\">\n <div class=\"no-result\" *ngIf=\"(items$ | async)?.length === 0\">\n <img\n class=\"no-result__search\"\n src=\"../../../assets/svgs/pry_recherche_pas_de_resultat.svg\"\n alt=\"{{ '@pry.widget.tile.empty' | i18n }}\"\n aria-hidden=\"true\"\n />\n <span class=\"no-result__text\">{{ '@pry.widget.tile.empty' | i18n }}</span>\n </div>\n <ul class=\"o-widget--tile__list\">\n <li\n class=\"o-widget--tile__list__item\"\n *ngFor=\"let item of items$ | async; let index = index\"\n (contextmenu)=\"contextMenu($event, item)\"\n >\n <div class=\"o-widget--tile__list__item__header\">\n <img\n [height]=\"25\"\n [width]=\"25\"\n [src]=\"item | translateItemToSymbol | async\"\n [alt]=\"item.oClass | translateId: { type: 'class', output: 'name' } | async\"\n />\n <h3 class=\"o-widget--tile__list__item__header__title\">\n {{\n item.oClass\n | translateId\n : {\n type: 'class',\n output: 'name'\n }\n | async\n }}\n </h3>\n <pry-checkbox\n [ngModel]=\"(selectedIds$ | async).includes(item.id)\"\n (click)=\"select($event, item)\"\n ></pry-checkbox>\n </div>\n <div class=\"o-properties\">\n <ul class=\"o-properties__list\">\n <ng-container *ngFor=\"let property of (propertiesToDisplay$ | async)![item.oClass]\">\n <li\n *ngFor=\"let value of getValue(item, property.prop); let i = index; let c = count\"\n class=\"o-properties__list__item\"\n >\n <p class=\"o-properties__list__item__label\" *ngIf=\"i === 0\">{{ property.label }}:</p>\n <p class=\"o-properties__list__item__value\" *ngIf=\"!isRaw(property.label, item.oClass)\">\n {{ value?.value | dataFormat: property.field }}\n </p>\n <p class=\"o-properties__list__item__raw\" *ngIf=\"isRaw(property.label, item.oClass)\">\n <pry-vizualize-raw [item]=\"item\" [propertyName]=\"property.label\"></pry-vizualize-raw>\n </p>\n <ng-container *ngIf=\"hasMetadata(value)\">\n <pry-metadata [item]=\"value\"></pry-metadata>\n </ng-container>\n </li>\n </ng-container>\n </ul>\n </div>\n <div (click)=\"toggleMap(index)\" class=\"o-widget--tile__list__item__footer\">\n <button\n type=\"button\"\n class=\"a-btn a-btn--icon-text -link-like\"\n aria-controls=\"tile-map-xxx\"\n aria-expanded=\"false\"\n >\n {{ '@pry.widget.tile.map' | i18n }}\n </button>\n </div>\n <div class=\"o-widget--tile__list__item__map\" *ngIf=\"maps[index]\" id=\"tile-map-xxx\">\n <pry-widget-map [staticManifest]=\"mapManifest\" [staticResultSet]=\"resultSetWithItem(item)\"></pry-widget-map>\n </div>\n </li>\n </ul>\n </div>\n</div>\n","export const enTranslations = {\n '@pry': {\n widget: {\n tile: {\n map: 'Display map',\n classes: 'Classes to display',\n metadata: 'Metadata',\n empty: 'No data to display'\n }\n }\n }\n};\n","export const frTranslations = {\n '@pry': {\n widget: {\n tile: {\n map: 'Afficher la carte',\n classes: 'Classes à afficher',\n metadata: 'Metadonnée',\n empty: 'Aucune donnée à afficher'\n }\n }\n }\n};\n","import { OverlayModule } from '@angular/cdk/overlay';\nimport { CommonModule } from '@angular/common';\nimport { NgModule, Type } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport {\n BaseWidgetComponent,\n BaseWidgetModule,\n PryCoreModule,\n PryDashboardModule,\n PryI18nModule,\n PryI18nService,\n PryIconModule,\n PrySelectModule,\n PryToggleModule\n} from '@provoly/dashboard';\nimport { PryCheckboxModule } from '@provoly/dashboard/components/checkbox';\nimport { WidgetDetailModule } from '@provoly/dashboard/widgets/widget-detail';\nimport { WidgetMapModule } from '@provoly/dashboard/widgets/widget-map';\nimport { WidgetTileComponent } from './component/widget-tile.component';\nimport { enTranslations } from './i18n/en.translations';\nimport { frTranslations } from './i18n/fr.translations';\nimport { PryWidgetTileCssComponent } from './style/css.component';\nimport { PryDataFormatModule } from '@provoly/dashboard/components/data-format';\n\n@NgModule({\n declarations: [WidgetTileComponent, PryWidgetTileCssComponent],\n imports: [\n CommonModule,\n FormsModule,\n OverlayModule,\n PryCoreModule,\n PryDashboardModule,\n PrySelectModule,\n PryIconModule,\n PryCheckboxModule,\n PryToggleModule,\n WidgetDetailModule,\n WidgetMapModule,\n PryI18nModule,\n PryDataFormatModule\n ],\n exports: [WidgetTileComponent]\n})\nexport class WidgetTileModule extends BaseWidgetModule {\n constructor(private pryTranslateService: PryI18nService) {\n super();\n this.pryTranslateService.addLangObject('fr', 'widget-tile', frTranslations);\n this.pryTranslateService.addLangObject('en', 'widget-tile', enTranslations);\n }\n\n override getComponent() {\n return WidgetTileComponent as Type<BaseWidg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,iBAAiB;wBACjB,eAAe;wBACf,kBAAkB;wBAClB,eAAe;wBACf,aAAa;wBACb,mBAAmB;AACpB,qBAAA;oBACD,OAAO,EAAE,CAAC,mBAAmB,CAAC;AAC/B,iBAAA,CAAA;;;AC1CD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"provoly-dashboard-widgets-widget-tile.mjs","sources":["../../../../projects/provoly/dashboard/widgets/widget-tile/style/css.component.ts","../../../../projects/provoly/dashboard/widgets/widget-tile/component/widget-tile.component.ts","../../../../projects/provoly/dashboard/widgets/widget-tile/component/widget-tile.component.html","../../../../projects/provoly/dashboard/widgets/widget-tile/i18n/en.translations.ts","../../../../projects/provoly/dashboard/widgets/widget-tile/i18n/fr.translations.ts","../../../../projects/provoly/dashboard/widgets/widget-tile/widget-tile.module.ts","../../../../projects/provoly/dashboard/widgets/widget-tile/provoly-dashboard-widgets-widget-tile.ts"],"sourcesContent":["import { Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'pry-widget-tile-css',\n template: '',\n styleUrls: ['./_o-widget-tile.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class PryWidgetTileCssComponent {}\n","import { Component, ElementRef } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport {\n AttributeSimpleValue,\n Class,\n ClassSelectors,\n ConfigSelectors,\n ContextMenuActions,\n DashboardActions,\n DashboardSelectors,\n DataWidgetComponent,\n Field,\n FieldSelectors,\n FieldType,\n Item,\n ItemUtils,\n ResultSet,\n TileWidgetOptions,\n WIDGET_HEADER_HEIGHT\n} from '@provoly/dashboard';\nimport { combineLatest, Observable } from 'rxjs';\nimport { filter, map } from 'rxjs/operators';\n\n@Component({\n selector: 'pry-widget-tile',\n templateUrl: './widget-tile.component.html'\n})\nexport class WidgetTileComponent extends DataWidgetComponent {\n options$: Observable<TileWidgetOptions>;\n items$: Observable<Item[]>;\n selectedIds$: Observable<any>;\n maps: (undefined | ResultSet)[] = [];\n mapManifest = {\n type: 'map',\n header: false,\n layout: { x: 1, y: 1, width: 1, height: 1 },\n options: { layers: [{ type: 'marker' }], fit: true }\n };\n classes$: Observable<Class[]>;\n optionsCopy: TileWidgetOptions = {};\n WIDGET_HEADER_HEIGHT = WIDGET_HEADER_HEIGHT;\n propertiesToDisplay$: Observable<{ [p: string]: { label: string; prop: string; field: Field }[] } | undefined>;\n fields: Field[] = [];\n classes: Class[] = [];\n\n constructor(store: Store<any>, el: ElementRef) {\n super(store, el);\n this.options$ = this.manifest$.pipe(map((manifest) => manifest.options as TileWidgetOptions));\n this.subscriptions.add(\n this.options$.pipe(filter((opt) => !!opt)).subscribe((options) => {\n this.optionsCopy = { ...(JSON.parse(JSON.stringify(options)) as TileWidgetOptions) };\n })\n );\n this.items$ = combineLatest([\n this.resultSet$.pipe(map((rs) => Object.values(rs.items).reduce((p, c) => [...p, ...c], []))),\n this.options$\n ]).pipe(\n map(([items, options]) =>\n items.filter(\n (item) => !options.classes || options.classes.length === 0 || options.classes.includes(item.oClass)\n )\n )\n );\n this.selectedIds$ = this.store.select(DashboardSelectors.selectedItemIds);\n this.classes$ = this.store.select(ClassSelectors.classes);\n this.propertiesToDisplay$ = combineLatest([\n this.classes$,\n this.store.select(ConfigSelectors.tileAttributesDefinitions),\n this.store.select(ConfigSelectors.maxAttributesInTiles)\n ]).pipe(\n map(([classes, tileDefs, maxTilesAttributes]) => ({\n ...classes\n .map((clazz) => ({\n [clazz.id]: [\n ...clazz.attributes\n .map((attr) => ({\n label: attr.name,\n prop: attr.technicalName,\n field: attr.field\n }))\n .filter((_, i) => i < maxTilesAttributes)\n ]\n }))\n .reduce((p, c) => ({ ...p, ...c }), {}),\n ...classes\n .filter((clazz) => !!tileDefs[clazz.id])\n .map((clazz) => ({\n [clazz.id]: [\n ...clazz.attributes\n .filter((attr) => tileDefs[clazz.id].includes(attr.name))\n .map((attr) => ({\n label: attr.name,\n prop: attr.technicalName,\n field: attr.field\n }))\n ]\n }))\n .reduce((p, c) => ({ ...p, ...c }), {})\n }))\n );\n this.subscriptions.add(this.store.select(FieldSelectors.fields).subscribe((fields) => (this.fields = fields)));\n this.subscriptions.add(this.classes$.subscribe((classes) => (this.classes = classes)));\n }\n\n contextMenu($event: MouseEvent, item: Item) {\n if (this.manifest.contextMenu !== false) {\n $event.stopPropagation();\n $event.preventDefault();\n this.store.dispatch(\n ContextMenuActions.open({\n itemId: item.id,\n clientX: $event.clientX,\n clientY: $event.clientY,\n from: 'tile',\n allowObjectCreation: false\n })\n );\n }\n }\n\n select($event: MouseEvent, item: Item) {\n $event.stopPropagation();\n $event.preventDefault();\n this.store.dispatch(DashboardActions.select({ id: item.id, cumulative: !$event.shiftKey }));\n }\n\n toggleMap(index: number, item: Item) {\n this.maps[index] = !this.maps[index]\n ? ({ items: { [item.oClass]: [item] }, relations: [] } as ResultSet)\n : undefined;\n }\n\n resultSetWithItem(item: Item): ResultSet {\n return { items: { [item.oClass]: [item] }, relations: [] };\n }\n\n emitManifest() {\n this.manifestModified.emit({\n widgetIndex: this.widgetIndex,\n manifest: {\n ...this.manifest,\n options: this.optionsCopy\n }\n });\n }\n\n changeClasses($event: any) {\n this.optionsCopy.classes = $event;\n }\n\n getValue(item: Item, property: string): AttributeSimpleValue[] {\n const value = ItemUtils.getAttributeValue(item, property);\n return Array.isArray(value) ? value : [value];\n }\n\n isRaw(property: string, classId: string): boolean {\n const clazz = this.classes.find((clazz) => clazz.id === classId);\n const prop = clazz?.attributes.find((attr) => attr.name === property);\n return prop?.field.type === FieldType.RAW ?? false;\n }\n\n hasMetadata(value: AttributeSimpleValue | Item) {\n return Object.keys(value?.metadata ?? {}).length > 0;\n }\n}\n","<pry-widget-tile-css></pry-widget-tile-css>\n<div class=\"o-widget o-widget--tile\">\n <pry-widget-header\n [datasourceIds]=\"(datasourceIds$ | async) ?? []\"\n *ngIf=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [manifest]=\"manifest\"\n (manifestModified)=\"manifestModified.emit($event)\"\n [headerOptions]=\"(displayHeader$ | async) ?? {}\"\n #header\n >\n <pry-settings\n (saveTriggered)=\"emitManifest()\"\n (changeTitle)=\"changeWidgetTitle($event)\"\n [headerPresent]=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [header]=\"header\"\n [open$]=\"open$\"\n class=\"o-settings\"\n >\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"tile_classes\">{{ '@pry.widget.tile.classes' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeClasses($event)\"\n [items]=\"classes$ | async\"\n [multiple]=\"true\"\n [closeOnSelect]=\"false\"\n [ngModel]=\"optionsCopy.classes\"\n bindLabel=\"name\"\n bindValue=\"id\"\n id=\"tile_classes\"\n ></pry-select>\n </div>\n </pry-settings>\n </pry-widget-header>\n <div class=\"o-widget--tile-wrapper\" [style.top]=\"(displayHeader$ | async) ? WIDGET_HEADER_HEIGHT + 'px' : 0\">\n @if ((items$ | async)?.length === 0) {\n <div class=\"no-result\">\n <img\n class=\"no-result__search\"\n src=\"../../../assets/svgs/pry_recherche_pas_de_resultat.svg\"\n alt=\"{{ '@pry.widget.tile.empty' | i18n }}\"\n aria-hidden=\"true\"\n />\n <span class=\"no-result__text\">{{ '@pry.widget.tile.empty' | i18n }}</span>\n </div>\n }\n <ul class=\"o-widget--tile__list\">\n @for (item of items$ | async; track item.id; let index = $index) {\n <li class=\"o-widget--tile__list__item\" (contextmenu)=\"contextMenu($event, item)\">\n <div class=\"o-widget--tile__list__item__header\">\n <img\n [height]=\"25\"\n [width]=\"25\"\n [src]=\"item | translateItemToSymbol | async\"\n [alt]=\"item.oClass | translateId: { type: 'class', output: 'name' } | async\"\n />\n <h3 class=\"o-widget--tile__list__item__header__title\">\n {{\n item.oClass\n | translateId\n : {\n type: 'class',\n output: 'name'\n }\n | async\n }}\n </h3>\n <pry-checkbox\n [ngModel]=\"(selectedIds$ | async).includes(item.id)\"\n (click)=\"select($event, item)\"\n ></pry-checkbox>\n </div>\n <div class=\"o-properties\">\n <ul class=\"o-properties__list\">\n @for (property of (propertiesToDisplay$ | async)![item.oClass]; track property.prop) {\n <li\n *ngFor=\"let value of getValue(item, property.prop); let i = index; let c = count\"\n class=\"o-properties__list__item\"\n >\n @if (i === 0) {\n <p class=\"o-properties__list__item__label\">{{ property.label }}:</p>\n }\n @if (!isRaw(property.label, item.oClass)) {\n <p class=\"o-properties__list__item__value\">\n {{ value?.value | dataFormat: property.field }}\n </p>\n } @else {\n <p class=\"o-properties__list__item__raw\">\n <pry-vizualize-raw [item]=\"item\" [propertyName]=\"property.label\"></pry-vizualize-raw>\n </p>\n }\n @if (hasMetadata(value)) {\n <pry-metadata [item]=\"value\"></pry-metadata>\n }\n </li>\n }\n </ul>\n </div>\n <div (click)=\"toggleMap(index, item)\" class=\"o-widget--tile__list__item__footer\">\n <button\n type=\"button\"\n class=\"a-btn a-btn--icon-text -link-like\"\n aria-controls=\"tile-map-xxx\"\n aria-expanded=\"false\"\n >\n {{ '@pry.widget.tile.map' | i18n }}\n </button>\n </div>\n @if (maps[index]) {\n <div class=\"o-widget--tile__list__item__map\" id=\"tile-map-xxx\">\n <pry-widget-map [staticManifest]=\"mapManifest\" [staticResultSet]=\"maps[index]!\"></pry-widget-map>\n </div>\n }\n </li>\n }\n </ul>\n </div>\n</div>\n","export const enTranslations = {\n '@pry': {\n widget: {\n tile: {\n map: 'Display map',\n classes: 'Classes to display',\n metadata: 'Metadata',\n empty: 'No data to display'\n }\n }\n }\n};\n","export const frTranslations = {\n '@pry': {\n widget: {\n tile: {\n map: 'Afficher la carte',\n classes: 'Classes à afficher',\n metadata: 'Metadonnée',\n empty: 'Aucune donnée à afficher'\n }\n }\n }\n};\n","import { OverlayModule } from '@angular/cdk/overlay';\nimport { CommonModule } from '@angular/common';\nimport { NgModule, Type } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport {\n BaseWidgetComponent,\n BaseWidgetModule,\n PryCoreModule,\n PryDashboardModule,\n PryI18nModule,\n PryI18nService,\n PryIconModule,\n PrySelectModule,\n PryToggleModule\n} from '@provoly/dashboard';\nimport { PryCheckboxModule } from '@provoly/dashboard/components/checkbox';\nimport { WidgetDetailModule } from '@provoly/dashboard/widgets/widget-detail';\nimport { WidgetMapModule } from '@provoly/dashboard/widgets/widget-map';\nimport { WidgetTileComponent } from './component/widget-tile.component';\nimport { enTranslations } from './i18n/en.translations';\nimport { frTranslations } from './i18n/fr.translations';\nimport { PryWidgetTileCssComponent } from './style/css.component';\nimport { PryDataFormatModule } from '@provoly/dashboard/components/data-format';\n\n@NgModule({\n declarations: [WidgetTileComponent, PryWidgetTileCssComponent],\n imports: [\n CommonModule,\n FormsModule,\n OverlayModule,\n PryCoreModule,\n PryDashboardModule,\n PrySelectModule,\n PryIconModule,\n PryCheckboxModule,\n PryToggleModule,\n WidgetDetailModule,\n WidgetMapModule,\n PryI18nModule,\n PryDataFormatModule\n ],\n exports: [WidgetTileComponent]\n})\nexport class WidgetTileModule extends BaseWidgetModule {\n constructor(private pryTranslateService: PryI18nService) {\n super();\n this.pryTranslateService.addLangObject('fr', 'widget-tile', frTranslations);\n this.pryTranslateService.addLangObject('en', 'widget-tile', enTranslations);\n }\n\n override getComponent() {\n return WidgetTileComponent as Type<BaseWidgetComponent>;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i7.PryWidgetTileCssComponent","i1"],"mappings":";;;;;;;;;;;;;;;;;;;;MAQa,yBAAyB,CAAA;8GAAzB,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAAzB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,yBAAyB,2DAJ1B,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,gsDAAA,CAAA,EA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AAA,gBAAgB,EAlBZ,YAAA,EAAA,CAAA,mBAAmB,EAAE,yBAAyB,aAE3D,YAAY;YACZ,WAAW;YACX,aAAa;YACb,aAAa;YACb,kBAAkB;YAClB,eAAe;YACf,aAAa;YACb,iBAAiB;YACjB,eAAe;YACf,kBAAkB;YAClB,eAAe;YACf,aAAa;AACb,YAAA,mBAAmB,aAEX,mBAAmB,CAAA,EAAA,CAAA,CAAA,EAAA;AAElB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAhBzB,YAAY;YACZ,WAAW;YACX,aAAa;YACb,aAAa;YACb,kBAAkB;YAClB,eAAe;YACf,aAAa;YACb,iBAAiB;YACjB,eAAe;YACf,kBAAkB;YAClB,eAAe;YACf,aAAa;YACb,mBAAmB,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAIV,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAnB5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,mBAAmB,EAAE,yBAAyB,CAAC;AAC9D,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBACX,aAAa;wBACb,aAAa;wBACb,kBAAkB;wBAClB,eAAe;wBACf,aAAa;wBACb,iBAAiB;wBACjB,eAAe;wBACf,kBAAkB;wBAClB,eAAe;wBACf,aAAa;wBACb,mBAAmB;AACpB,qBAAA;oBACD,OAAO,EAAE,CAAC,mBAAmB,CAAC;AAC/B,iBAAA,CAAA;;;AC1CD;;AAEG;;;;"}
|
|
@@ -90,13 +90,8 @@ class WidgetVegaComponent extends DataWidgetComponent {
|
|
|
90
90
|
embed(this.vega.nativeElement, JSON.parse(JSON.stringify(spec)), {
|
|
91
91
|
actions: false,
|
|
92
92
|
renderer: 'canvas',
|
|
93
|
-
formatLocale:
|
|
94
|
-
|
|
95
|
-
thousands: this.translateService.instant('@pry.format.thousands'),
|
|
96
|
-
grouping: this.translateService.instant('@pry.format.grouping'),
|
|
97
|
-
currency: this.translateService.instant('@pry.format.currency'),
|
|
98
|
-
percent: '\u202f%'
|
|
99
|
-
}
|
|
93
|
+
formatLocale: this.translateService.instantObject('@pry.widget.chart.numberLocale'),
|
|
94
|
+
timeFormatLocale: this.translateService.instantObject('@pry.widget.chart.timeFormatLocale')
|
|
100
95
|
}).then((result) => (this.view = result.view));
|
|
101
96
|
}
|
|
102
97
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provoly-dashboard-widgets-widget-vega.mjs","sources":["../../../../projects/provoly/dashboard/widgets/widget-vega/style/css.component.ts","../../../../projects/provoly/dashboard/widgets/widget-vega/component/widget-vega.component.ts","../../../../projects/provoly/dashboard/widgets/widget-vega/component/widget-vega.component.html","../../../../projects/provoly/dashboard/widgets/widget-vega/i18n/en.translations.ts","../../../../projects/provoly/dashboard/widgets/widget-vega/i18n/fr.translations.ts","../../../../projects/provoly/dashboard/widgets/widget-vega/widget-vega.module.ts","../../../../projects/provoly/dashboard/widgets/widget-vega/provoly-dashboard-widgets-widget-vega.ts"],"sourcesContent":["import { Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'pry-widget-vega-css',\n template: '',\n styleUrls: ['./_o-widget-vega.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class PryWidgetVegaCssComponent {}\n","import { DOCUMENT } from '@angular/common';\nimport { AfterViewInit, Component, ElementRef, Inject, ViewChild } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport {\n AttributeSimpleValue,\n DataWidgetComponent,\n Item,\n PryI18nService,\n PrySnackbarService,\n ResultSet,\n ValueType,\n VegaWidgetOptions,\n WIDGET_HEADER_HEIGHT\n} from '@provoly/dashboard';\nimport { combineLatest, filter, Observable, Subject } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { View } from 'vega';\nimport embed, { VisualizationSpec } from 'vega-embed';\n\n@Component({\n selector: 'pry-widget-vega',\n templateUrl: './widget-vega.component.html'\n})\nexport class WidgetVegaComponent extends DataWidgetComponent implements AfterViewInit {\n @ViewChild('vega') vega!: ElementRef;\n view?: View;\n vegaSpec$: Observable<VisualizationSpec>;\n trigger$ = new Subject<void>();\n options$: Observable<any>;\n optionsCopy: VegaWidgetOptions = { baseSpec: {}, placeData: [] };\n formattedBaseSpec: string = '{}';\n initialFormattedBaseSpec: string = '{}';\n\n constructor(\n store: Store<any>,\n private translateService: PryI18nService,\n el: ElementRef,\n @Inject(DOCUMENT) private document: Document,\n private snackService: PrySnackbarService\n ) {\n super(store, el);\n\n this.options$ = this.manifest$.pipe(map((manifest) => (manifest.options ?? {}) as any));\n this.subscriptions.add(\n this.options$.subscribe((options) => {\n this.optionsCopy = JSON.parse(JSON.stringify(options));\n this.formattedBaseSpec = JSON.stringify(this.optionsCopy.baseSpec, undefined, 4);\n this.initialFormattedBaseSpec = JSON.stringify(this.optionsCopy.baseSpec, undefined, 4);\n })\n );\n\n this.vegaSpec$ = combineLatest([this.options$, this.resultSet$, this.widgetSize$, this.displayHeader$]).pipe(\n filter(([options, rs, size, header]) => !!rs),\n map(([options, rs, size, header]) => {\n const data = WidgetVegaComponent.getValues(rs);\n\n const vegaSpec = WidgetVegaComponent.placeData(options, JSON.parse(JSON.stringify(options.baseSpec)), data);\n\n vegaSpec.width = vegaSpec.width ?? size.width - 5;\n vegaSpec.height = vegaSpec.height ?? size.height - 5 - (header ? WIDGET_HEADER_HEIGHT.value : 0);\n vegaSpec.autosize = vegaSpec.autosize ?? { type: 'fit', contains: 'padding' };\n vegaSpec.padding = vegaSpec.padding ?? 15;\n\n // @ts-ignore\n if (window.widgetVegaLogging === true) {\n console.log(JSON.stringify(vegaSpec, undefined, 4));\n }\n\n return vegaSpec;\n })\n );\n }\n\n static getValues(data: ResultSet) {\n return Object.keys(data.items)\n .map((clazz) => data.items[clazz].map((item) => WidgetVegaComponent.transformProvolyModelToClassic(item)))\n .flat();\n }\n\n static transformProvolyModelToClassic(values: Item) {\n const result = {} as { [key: string]: ValueType };\n Object.keys(values.attributes).forEach((key) => {\n result[key] = (values.attributes[key] as AttributeSimpleValue).value;\n });\n\n return result;\n }\n\n static placeData(options: VegaWidgetOptions, baseSpec: any, data: { [key: string]: ValueType }[]) {\n const clone = JSON.parse(JSON.stringify(baseSpec));\n let ref = clone;\n (options.placeData ?? []).forEach((prop, idx, arr) => {\n if (ref) {\n if (idx < arr.length - 1) {\n ref = ref[prop];\n } else {\n ref[prop] = data;\n }\n }\n });\n return clone;\n }\n\n ngAfterViewInit() {\n this.subscriptions.add(\n combineLatest([this.vegaSpec$, this.trigger$, this.widgetSize$]).subscribe(([spec, _, size]) => {\n if (this.vega) {\n this.view?.finalize();\n\n // @ts-ignore\n if (this.document.logVegaSpec !== undefined) {\n console.log(JSON.stringify(spec, undefined, 4));\n }\n\n embed(this.vega.nativeElement, JSON.parse(JSON.stringify(spec)), {\n actions: false,\n renderer: 'canvas',\n formatLocale: {\n decimal: this.translateService.instant('@pry.format.decimal'),\n thousands: this.translateService.instant('@pry.format.thousands'),\n grouping: this.translateService.instant('@pry.format.grouping'),\n currency: this.translateService.instant('@pry.format.currency'),\n percent: '\\u202f%'\n }\n }).then((result) => (this.view = result.view));\n } else {\n setTimeout(() => this.trigger$.next(), 100);\n }\n })\n );\n this.trigger$.next();\n }\n\n override toImage(): Promise<string> {\n return new Promise((resolve, reject) => {\n resolve(this.vega.nativeElement.querySelectorAll('canvas')[0].toDataURL('image/png'));\n });\n }\n\n emitManifest() {\n this.manifestModified.emit({\n widgetIndex: this.widgetIndex,\n manifest: { ...this.manifest, options: this.optionsCopy }\n });\n }\n\n changePlaceData($event: Event) {\n // @ts-ignore\n const expr = $event.currentTarget.value;\n this.optionsCopy.placeData = expr\n .split('.')\n .map((val: string) => (parseInt(val) + '' === `${val}` ? parseInt(val) : val));\n }\n\n changeSpec($event: Event) {\n try {\n // @ts-ignore\n this.optionsCopy.baseSpec = JSON.parse($event.currentTarget.value);\n } catch (e) {\n const message = this.snackService.notMitigatedOpen({\n type: 'error',\n message: this.translateService.instant('@pry.widget.vega.notParseableSpec'),\n action: this.translateService.instant('@pry.widget.vega.specReinit')\n });\n message?.subscribe(() => {\n this.optionsCopy.baseSpec = this.initialFormattedBaseSpec;\n });\n }\n }\n}\n","<pry-widget-vega-css></pry-widget-vega-css>\n<div class=\"o-widget o-widget--chart\">\n <pry-widget-header\n *ngIf=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [manifest]=\"manifest\"\n (manifestModified)=\"manifestModified.emit($event)\"\n #header\n [headerOptions]=\"(displayHeader$ | async) ?? {}\"\n [datasourceIds]=\"(datasourceIds$ | async) ?? []\"\n >\n <pry-settings\n (saveTriggered)=\"emitManifest()\"\n (changeTitle)=\"changeWidgetTitle($event)\"\n [headerPresent]=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [header]=\"header\"\n [open$]=\"open$\"\n class=\"o-settings\"\n >\n <div class=\"o-settings__fields\">\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"placeData_src\">{{ '@pry.widget.vega.placeData' | i18n }}</label>\n <input\n class=\"a-form-field\"\n id=\"placeData_src\"\n type=\"text\"\n [value]=\"(optionsCopy.placeData ?? []).join('.')\"\n (input)=\"changePlaceData($event)\"\n />\n </div>\n\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"spec_src\">{{ '@pry.widget.vega.spec' | i18n }}</label>\n <textarea\n class=\"a-form-field a-text-area\"\n id=\"spec_src\"\n [value]=\"formattedBaseSpec\"\n (input)=\"changeSpec($event)\"\n ></textarea>\n </div>\n </div>\n </pry-settings>\n </pry-widget-header>\n <div class=\"o-widget--chart--chart\" #vega></div>\n</div>\n","export const enTranslations = {\n '@pry': {\n widget: {\n vega: {\n placeData: 'Expression leading to data in Vega config',\n spec: 'Vega configuration',\n notParseableSpec: 'Configuration is not a valid JSON',\n specReinit: 'Reinitialize'\n }\n }\n }\n};\n","export const frTranslations = {\n '@pry': {\n widget: {\n vega: {\n placeData: 'Expression menant à la place des données dans la configuration Vega',\n spec: 'Configuration Vega',\n notParseableSpec: \"La configuration n'est pas un JSON valide\",\n specReinit: 'Réinitialiser'\n }\n }\n }\n};\n","import { OverlayModule } from '@angular/cdk/overlay';\nimport { CommonModule } from '@angular/common';\nimport { NgModule, Type } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport {\n BaseWidgetComponent,\n BaseWidgetModule,\n PryCoreModule,\n PryDashboardModule,\n PryI18nModule,\n PryI18nService,\n PryIconModule,\n PrySelectModule,\n PryToggleModule\n} from '@provoly/dashboard';\nimport { PryCheckboxModule } from '@provoly/dashboard/components/checkbox';\nimport { WidgetMapModule } from '@provoly/dashboard/widgets/widget-map';\nimport { WidgetVegaComponent } from './component/widget-vega.component';\nimport { enTranslations } from './i18n/en.translations';\nimport { frTranslations } from './i18n/fr.translations';\nimport { PryWidgetVegaCssComponent } from './style/css.component';\n\n@NgModule({\n declarations: [WidgetVegaComponent, PryWidgetVegaCssComponent],\n imports: [\n CommonModule,\n FormsModule,\n OverlayModule,\n PryCoreModule,\n PryDashboardModule,\n PrySelectModule,\n PryIconModule,\n PryCheckboxModule,\n PryToggleModule,\n WidgetMapModule,\n PryI18nModule\n ],\n exports: [WidgetVegaComponent]\n})\nexport class WidgetVegaModule extends BaseWidgetModule {\n constructor(private pryTranslateService: PryI18nService) {\n super();\n this.pryTranslateService.addLangObject('fr', 'widget-vega', frTranslations);\n this.pryTranslateService.addLangObject('en', 'widget-vega', enTranslations);\n }\n\n override getComponent() {\n return WidgetVegaComponent as Type<BaseWidgetComponent>;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i4.PryWidgetVegaCssComponent","i1"],"mappings":";;;;;;;;;;;;;;;MAQa,yBAAyB,CAAA;8GAAzB,yBAAyB,EAAA,IAAA,EAAA,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ashboard-widgets-widget-vega.mjs","sources":["../../../../projects/provoly/dashboard/widgets/widget-vega/style/css.component.ts","../../../../projects/provoly/dashboard/widgets/widget-vega/component/widget-vega.component.ts","../../../../projects/provoly/dashboard/widgets/widget-vega/component/widget-vega.component.html","../../../../projects/provoly/dashboard/widgets/widget-vega/i18n/en.translations.ts","../../../../projects/provoly/dashboard/widgets/widget-vega/i18n/fr.translations.ts","../../../../projects/provoly/dashboard/widgets/widget-vega/widget-vega.module.ts","../../../../projects/provoly/dashboard/widgets/widget-vega/provoly-dashboard-widgets-widget-vega.ts"],"sourcesContent":["import { Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'pry-widget-vega-css',\n template: '',\n styleUrls: ['./_o-widget-vega.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class PryWidgetVegaCssComponent {}\n","import { DOCUMENT } from '@angular/common';\nimport { AfterViewInit, Component, ElementRef, Inject, ViewChild } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport {\n AttributeSimpleValue,\n DataWidgetComponent,\n Item,\n PryI18nService,\n PrySnackbarService,\n ResultSet,\n ValueType,\n VegaWidgetOptions,\n WIDGET_HEADER_HEIGHT\n} from '@provoly/dashboard';\nimport { combineLatest, filter, Observable, Subject } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { View } from 'vega';\nimport embed, { VisualizationSpec } from 'vega-embed';\n\n@Component({\n selector: 'pry-widget-vega',\n templateUrl: './widget-vega.component.html'\n})\nexport class WidgetVegaComponent extends DataWidgetComponent implements AfterViewInit {\n @ViewChild('vega') vega!: ElementRef;\n view?: View;\n vegaSpec$: Observable<VisualizationSpec>;\n trigger$ = new Subject<void>();\n options$: Observable<any>;\n optionsCopy: VegaWidgetOptions = { baseSpec: {}, placeData: [] };\n formattedBaseSpec: string = '{}';\n initialFormattedBaseSpec: string = '{}';\n\n constructor(\n store: Store<any>,\n private translateService: PryI18nService,\n el: ElementRef,\n @Inject(DOCUMENT) private document: Document,\n private snackService: PrySnackbarService\n ) {\n super(store, el);\n\n this.options$ = this.manifest$.pipe(map((manifest) => (manifest.options ?? {}) as any));\n this.subscriptions.add(\n this.options$.subscribe((options) => {\n this.optionsCopy = JSON.parse(JSON.stringify(options));\n this.formattedBaseSpec = JSON.stringify(this.optionsCopy.baseSpec, undefined, 4);\n this.initialFormattedBaseSpec = JSON.stringify(this.optionsCopy.baseSpec, undefined, 4);\n })\n );\n\n this.vegaSpec$ = combineLatest([this.options$, this.resultSet$, this.widgetSize$, this.displayHeader$]).pipe(\n filter(([options, rs, size, header]) => !!rs),\n map(([options, rs, size, header]) => {\n const data = WidgetVegaComponent.getValues(rs);\n\n const vegaSpec = WidgetVegaComponent.placeData(options, JSON.parse(JSON.stringify(options.baseSpec)), data);\n\n vegaSpec.width = vegaSpec.width ?? size.width - 5;\n vegaSpec.height = vegaSpec.height ?? size.height - 5 - (header ? WIDGET_HEADER_HEIGHT.value : 0);\n vegaSpec.autosize = vegaSpec.autosize ?? { type: 'fit', contains: 'padding' };\n vegaSpec.padding = vegaSpec.padding ?? 15;\n\n // @ts-ignore\n if (window.widgetVegaLogging === true) {\n console.log(JSON.stringify(vegaSpec, undefined, 4));\n }\n\n return vegaSpec;\n })\n );\n }\n\n static getValues(data: ResultSet) {\n return Object.keys(data.items)\n .map((clazz) => data.items[clazz].map((item) => WidgetVegaComponent.transformProvolyModelToClassic(item)))\n .flat();\n }\n\n static transformProvolyModelToClassic(values: Item) {\n const result = {} as { [key: string]: ValueType };\n Object.keys(values.attributes).forEach((key) => {\n result[key] = (values.attributes[key] as AttributeSimpleValue).value;\n });\n\n return result;\n }\n\n static placeData(options: VegaWidgetOptions, baseSpec: any, data: { [key: string]: ValueType }[]) {\n const clone = JSON.parse(JSON.stringify(baseSpec));\n let ref = clone;\n (options.placeData ?? []).forEach((prop, idx, arr) => {\n if (ref) {\n if (idx < arr.length - 1) {\n ref = ref[prop];\n } else {\n ref[prop] = data;\n }\n }\n });\n return clone;\n }\n\n ngAfterViewInit() {\n this.subscriptions.add(\n combineLatest([this.vegaSpec$, this.trigger$, this.widgetSize$]).subscribe(([spec, _, size]) => {\n if (this.vega) {\n this.view?.finalize();\n\n // @ts-ignore\n if (this.document.logVegaSpec !== undefined) {\n console.log(JSON.stringify(spec, undefined, 4));\n }\n\n embed(this.vega.nativeElement, JSON.parse(JSON.stringify(spec)), {\n actions: false,\n renderer: 'canvas',\n formatLocale: this.translateService.instantObject('@pry.widget.chart.numberLocale'),\n timeFormatLocale: this.translateService.instantObject('@pry.widget.chart.timeFormatLocale')\n }).then((result) => (this.view = result.view));\n } else {\n setTimeout(() => this.trigger$.next(), 100);\n }\n })\n );\n this.trigger$.next();\n }\n\n override toImage(): Promise<string> {\n return new Promise((resolve, reject) => {\n resolve(this.vega.nativeElement.querySelectorAll('canvas')[0].toDataURL('image/png'));\n });\n }\n\n emitManifest() {\n this.manifestModified.emit({\n widgetIndex: this.widgetIndex,\n manifest: { ...this.manifest, options: this.optionsCopy }\n });\n }\n\n changePlaceData($event: Event) {\n // @ts-ignore\n const expr = $event.currentTarget.value;\n this.optionsCopy.placeData = expr\n .split('.')\n .map((val: string) => (parseInt(val) + '' === `${val}` ? parseInt(val) : val));\n }\n\n changeSpec($event: Event) {\n try {\n // @ts-ignore\n this.optionsCopy.baseSpec = JSON.parse($event.currentTarget.value);\n } catch (e) {\n const message = this.snackService.notMitigatedOpen({\n type: 'error',\n message: this.translateService.instant('@pry.widget.vega.notParseableSpec'),\n action: this.translateService.instant('@pry.widget.vega.specReinit')\n });\n message?.subscribe(() => {\n this.optionsCopy.baseSpec = this.initialFormattedBaseSpec;\n });\n }\n }\n}\n","<pry-widget-vega-css></pry-widget-vega-css>\n<div class=\"o-widget o-widget--chart\">\n <pry-widget-header\n *ngIf=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [manifest]=\"manifest\"\n (manifestModified)=\"manifestModified.emit($event)\"\n #header\n [headerOptions]=\"(displayHeader$ | async) ?? {}\"\n [datasourceIds]=\"(datasourceIds$ | async) ?? []\"\n >\n <pry-settings\n (saveTriggered)=\"emitManifest()\"\n (changeTitle)=\"changeWidgetTitle($event)\"\n [headerPresent]=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [header]=\"header\"\n [open$]=\"open$\"\n class=\"o-settings\"\n >\n <div class=\"o-settings__fields\">\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"placeData_src\">{{ '@pry.widget.vega.placeData' | i18n }}</label>\n <input\n class=\"a-form-field\"\n id=\"placeData_src\"\n type=\"text\"\n [value]=\"(optionsCopy.placeData ?? []).join('.')\"\n (input)=\"changePlaceData($event)\"\n />\n </div>\n\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"spec_src\">{{ '@pry.widget.vega.spec' | i18n }}</label>\n <textarea\n class=\"a-form-field a-text-area\"\n id=\"spec_src\"\n [value]=\"formattedBaseSpec\"\n (input)=\"changeSpec($event)\"\n ></textarea>\n </div>\n </div>\n </pry-settings>\n </pry-widget-header>\n <div class=\"o-widget--chart--chart\" #vega></div>\n</div>\n","export const enTranslations = {\n '@pry': {\n widget: {\n vega: {\n placeData: 'Expression leading to data in Vega config',\n spec: 'Vega configuration',\n notParseableSpec: 'Configuration is not a valid JSON',\n specReinit: 'Reinitialize'\n }\n }\n }\n};\n","export const frTranslations = {\n '@pry': {\n widget: {\n vega: {\n placeData: 'Expression menant à la place des données dans la configuration Vega',\n spec: 'Configuration Vega',\n notParseableSpec: \"La configuration n'est pas un JSON valide\",\n specReinit: 'Réinitialiser'\n }\n }\n }\n};\n","import { OverlayModule } from '@angular/cdk/overlay';\nimport { CommonModule } from '@angular/common';\nimport { NgModule, Type } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport {\n BaseWidgetComponent,\n BaseWidgetModule,\n PryCoreModule,\n PryDashboardModule,\n PryI18nModule,\n PryI18nService,\n PryIconModule,\n PrySelectModule,\n PryToggleModule\n} from '@provoly/dashboard';\nimport { PryCheckboxModule } from '@provoly/dashboard/components/checkbox';\nimport { WidgetMapModule } from '@provoly/dashboard/widgets/widget-map';\nimport { WidgetVegaComponent } from './component/widget-vega.component';\nimport { enTranslations } from './i18n/en.translations';\nimport { frTranslations } from './i18n/fr.translations';\nimport { PryWidgetVegaCssComponent } from './style/css.component';\n\n@NgModule({\n declarations: [WidgetVegaComponent, PryWidgetVegaCssComponent],\n imports: [\n CommonModule,\n FormsModule,\n OverlayModule,\n PryCoreModule,\n PryDashboardModule,\n PrySelectModule,\n PryIconModule,\n PryCheckboxModule,\n PryToggleModule,\n WidgetMapModule,\n PryI18nModule\n ],\n exports: [WidgetVegaComponent]\n})\nexport class WidgetVegaModule extends BaseWidgetModule {\n constructor(private pryTranslateService: PryI18nService) {\n super();\n this.pryTranslateService.addLangObject('fr', 'widget-vega', frTranslations);\n this.pryTranslateService.addLangObject('en', 'widget-vega', enTranslations);\n }\n\n override getComponent() {\n return WidgetVegaComponent as Type<BaseWidgetComponent>;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i4.PryWidgetVegaCssComponent","i1"],"mappings":";;;;;;;;;;;;;;;MAQa,yBAAyB,CAAA;8GAAzB,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAAzB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,yBAAyB,2DAJ1B,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,4JAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA,EAAA;;2FAID,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBANrC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,q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kB;YAClB,eAAe;YACf,aAAa;YACb,iBAAiB;YACjB,eAAe;YACf,eAAe;YACf,aAAa,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAIJ,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAjB5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,mBAAmB,EAAE,yBAAyB,CAAC;AAC9D,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBACX,aAAa;wBACb,aAAa;wBACb,kBAAkB;wBAClB,eAAe;wBACf,aAAa;wBACb,iBAAiB;wBACjB,eAAe;wBACf,eAAe;wBACf,aAAa;AACd,qBAAA;oBACD,OAAO,EAAE,CAAC,mBAAmB,CAAC;AAC/B,iBAAA,CAAA;;;ACtCD;;AAEG;;;;"}
|
|
@@ -196,7 +196,8 @@ const enTranslations$1 = {
|
|
|
196
196
|
'@pry': {
|
|
197
197
|
select: {
|
|
198
198
|
label: 'Options list',
|
|
199
|
-
loading: 'Loading'
|
|
199
|
+
loading: 'Loading',
|
|
200
|
+
empty: 'No result found'
|
|
200
201
|
},
|
|
201
202
|
about: {
|
|
202
203
|
front: 'Front library version',
|
|
@@ -651,7 +652,8 @@ const frTranslations$1 = {
|
|
|
651
652
|
'@pry': {
|
|
652
653
|
select: {
|
|
653
654
|
label: 'Liste des choix',
|
|
654
|
-
loading: 'Chargement en cours'
|
|
655
|
+
loading: 'Chargement en cours',
|
|
656
|
+
empty: 'Aucun résultat trouvé'
|
|
655
657
|
},
|
|
656
658
|
about: {
|
|
657
659
|
front: 'Librairie front',
|
|
@@ -7291,14 +7293,14 @@ class PrySelectComponent extends SubscriptionnerDirective {
|
|
|
7291
7293
|
return this.elementRef ?? this.selectElement.nativeElement;
|
|
7292
7294
|
}
|
|
7293
7295
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PrySelectComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i2.Overlay }, { token: i0.ViewContainerRef }, { token: SelectA11yService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7294
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
7296
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: PrySelectComponent, selector: "pry-select", inputs: { items: "items", clearable: "clearable", multiple: "multiple", closeOnSelect: "closeOnSelect", placeholder: "placeholder", isForm: "isForm", required: "required", name: "name", readonly: "readonly", autocomplete: "autocomplete", alwaysShowAutosuggestedValues: "alwaysShowAutosuggestedValues", externalAutocompleteService: "externalAutocompleteService", bindValue: "bindValue", bindLabel: "bindLabel", iconSize: "iconSize", bindIcon: "bindIcon", template: "template", i18nPrefix: "i18nPrefix", bindClasses: "bindClasses", loading: "loading", elementRef: "elementRef" }, outputs: { searched: "searched", cleared: "cleared", clicked: "clicked" }, providers: [
|
|
7295
7297
|
{
|
|
7296
7298
|
provide: NG_VALUE_ACCESSOR,
|
|
7297
7299
|
useExisting: forwardRef(() => PrySelectComponent),
|
|
7298
7300
|
multi: true
|
|
7299
7301
|
},
|
|
7300
7302
|
SelectA11yService
|
|
7301
|
-
], viewQueries: [{ propertyName: "optionsModal", first: true, predicate: ["optionsModal"], descendants: true, read: TemplateRef }, { propertyName: "selectElement", first: true, predicate: ["selectElement"], descendants: true }, { propertyName: "input", first: true, predicate: ["input"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div\n class=\"a-pry-select\"\n [attr.aria-disabled]=\"disabled\"\n #selectElement\n [class.-focused]=\"focused\"\n (click)=\"handleClick()\"\n role=\"combobox\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-owns]=\"open ? modalId : null\"\n aria-haspopup=\"listbox\"\n tabindex=\"0\"\n cdkMonitorElementFocus\n (cdkFocusChange)=\"onFocusChange($event)\"\n (keydown)=\"onKeydownSelect($event)\"\n>\n <div class=\"a-pry-select__content\">\n
|
|
7303
|
+
], viewQueries: [{ propertyName: "optionsModal", first: true, predicate: ["optionsModal"], descendants: true, read: TemplateRef }, { propertyName: "selectElement", first: true, predicate: ["selectElement"], descendants: true }, { propertyName: "input", first: true, predicate: ["input"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div\n class=\"a-pry-select\"\n [attr.aria-disabled]=\"disabled\"\n #selectElement\n [class.-focused]=\"focused\"\n (click)=\"handleClick()\"\n role=\"combobox\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-owns]=\"open ? modalId : null\"\n aria-haspopup=\"listbox\"\n tabindex=\"0\"\n cdkMonitorElementFocus\n (cdkFocusChange)=\"onFocusChange($event)\"\n (keydown)=\"onKeydownSelect($event)\"\n>\n <div class=\"a-pry-select__content\">\n @if (autocomplete) {\n <input\n type=\"text\"\n class=\"a-pry-select__search\"\n [ngModel]=\"search$.getValue()\"\n (ngModelChange)=\"search($event, true)\"\n aria-autocomplete=\"list\"\n [attr.aria-controls]=\"open ? modalId : null\"\n [attr.aria-disabled]=\"disabled\"\n [disabled]=\"disabled\"\n (keydown)=\"onKeydownAutocompleteInput($event)\"\n [placeholder]=\"placeholder ?? ''\"\n #input\n />\n } @else if ((valueItems$ | async).length === 0) {\n <span class=\"a-pry-select__placeholder\">{{ placeholder }}</span>\n <div class=\"a-pry-select__filler\"></div>\n } @else {\n <ng-container *ngFor=\"let item of valueItems$ | async\">\n <div\n class=\"a-pry-select__value\"\n [class.pry-select-form]=\"isForm\"\n [class.-multiple]=\"multiple\"\n [ngClass]=\"item ? item[bindClasses ?? ''] ?? {} : {}\"\n >\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item, clear }\"></ng-container>\n } @else {\n <pry-icon\n *ngIf=\"bindIcon\"\n [iconSvg]=\"item[bindIcon]\"\n [width]=\"iconSize[0]\"\n [height]=\"iconSize[1]\"\n ></pry-icon>\n @if (bindLabel ? item?.[bindLabel] : item; as value) {\n {{ (i18nPrefix ?? '') + value | i18n: { warn: false } }}\n <span\n *ngIf=\"multiple && clearable\"\n class=\"a-pry-select__clear\"\n (click)=\"clear($event, item)\"\n aria-hidden=\"true\"\n >\u00D7</span\n >\n }\n }\n </div>\n </ng-container>\n <div class=\"a-pry-select__filler\"></div>\n }\n </div>\n <div class=\"a-pry-select__actions\">\n @if (clearable) {\n <span class=\"a-pry-select__clear\" (click)=\"clearAll($event)\" aria-hidden=\"true\">\u00D7</span>\n }\n <pry-icon\n class=\"a-pry-select__toggle\"\n [iconSvg]=\"open ? 'chevron_top' : 'chevron_bottom'\"\n [width]=\"iconSize[0]\"\n [height]=\"iconSize[1]\"\n ></pry-icon>\n </div>\n</div>\n<ng-template #optionsModal>\n <div\n role=\"listbox\"\n [attr.aria-label]=\"'@pry.select.label' | i18n\"\n [id]=\"modalId\"\n [attr.aria-activedescendant]=\"'select-option-' + activeDescendant\"\n [attr.aria-multiselectable]=\"multiple\"\n [attr.required]=\"required\"\n [attr.aria-readonly]=\"readonly\"\n cdkTrapFocus=\"!autocomplete\"\n [cdkTrapFocusAutoCapture]=\"!autocomplete\"\n >\n @if (loading) {\n <div class=\"a-pry-select__options__option -hint\" [style.width.px]=\"modalWidth\">\n <div class=\"no-widget no-widget__loader\">\n <pry-page-loader></pry-page-loader>\n </div>\n <p>{{ '@pry.select.loading' | i18n }}...</p>\n </div>\n } @else {\n @for (item of matchingItems$ | async; track item.id; let index = $index; let first = $first; let last = $last) {\n <div\n class=\"a-pry-select__options__option\"\n [attr.aria-selected]=\"(valueItems$ | async).includes(item)\"\n [attr.aria-checked]=\"(valueItems$ | async).includes(item)\"\n [attr.aria-disabled]=\"disabled\"\n (click)=\"select($event, item, index)\"\n (keydown)=\"onKeydownOption($event, item, index, optionDivRef, first, last)\"\n [style.width.px]=\"modalWidth\"\n role=\"option\"\n [id]=\"'select-option-' + index\"\n tabindex=\"0\"\n #optionDivRef\n >\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item, clear }\"></ng-container>\n } @else {\n @if (multiple) {\n <pry-checkbox\n (click)=\"$event.preventDefault()\"\n [ngModel]=\"(valueItems$ | async).includes(item)\"\n ></pry-checkbox>\n }\n @if (bindIcon) {\n <pry-icon [iconSvg]=\"item[bindIcon]\" [width]=\"iconSize[0]\" [height]=\"iconSize[1]\"></pry-icon>\n }\n @if (bindLabel ? item?.[bindLabel] : item; as value) {\n {{ (i18nPrefix ? i18nPrefix : '') + value | i18n: { warn: false } }}\n }\n }\n </div>\n } @empty {\n <div class=\"a-pry-select__options__option -hint\" [style.width.px]=\"modalWidth\">\n <p>{{ '@pry.select.empty' | i18n }}</p>\n </div>\n }\n }\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i3$2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: i3$2.CdkMonitorFocus, selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]", outputs: ["cdkFocusChange"], exportAs: ["cdkMonitorFocus"] }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: i7.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle", "name", "inputId", "inhibit"] }, { kind: "component", type: i8.PryPageLoaderComponent, selector: "pry-page-loader", inputs: ["image", "imageAltText"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: I18nPipe, name: "i18n" }] }); }
|
|
7302
7304
|
}
|
|
7303
7305
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PrySelectComponent, decorators: [{
|
|
7304
7306
|
type: Component,
|
|
@@ -7309,7 +7311,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImpor
|
|
|
7309
7311
|
multi: true
|
|
7310
7312
|
},
|
|
7311
7313
|
SelectA11yService
|
|
7312
|
-
], template: "<div\n class=\"a-pry-select\"\n [attr.aria-disabled]=\"disabled\"\n #selectElement\n [class.-focused]=\"focused\"\n (click)=\"handleClick()\"\n role=\"combobox\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-owns]=\"open ? modalId : null\"\n aria-haspopup=\"listbox\"\n tabindex=\"0\"\n cdkMonitorElementFocus\n (cdkFocusChange)=\"onFocusChange($event)\"\n (keydown)=\"onKeydownSelect($event)\"\n>\n <div class=\"a-pry-select__content\">\n
|
|
7314
|
+
], template: "<div\n class=\"a-pry-select\"\n [attr.aria-disabled]=\"disabled\"\n #selectElement\n [class.-focused]=\"focused\"\n (click)=\"handleClick()\"\n role=\"combobox\"\n [attr.aria-expanded]=\"open\"\n [attr.aria-owns]=\"open ? modalId : null\"\n aria-haspopup=\"listbox\"\n tabindex=\"0\"\n cdkMonitorElementFocus\n (cdkFocusChange)=\"onFocusChange($event)\"\n (keydown)=\"onKeydownSelect($event)\"\n>\n <div class=\"a-pry-select__content\">\n @if (autocomplete) {\n <input\n type=\"text\"\n class=\"a-pry-select__search\"\n [ngModel]=\"search$.getValue()\"\n (ngModelChange)=\"search($event, true)\"\n aria-autocomplete=\"list\"\n [attr.aria-controls]=\"open ? modalId : null\"\n [attr.aria-disabled]=\"disabled\"\n [disabled]=\"disabled\"\n (keydown)=\"onKeydownAutocompleteInput($event)\"\n [placeholder]=\"placeholder ?? ''\"\n #input\n />\n } @else if ((valueItems$ | async).length === 0) {\n <span class=\"a-pry-select__placeholder\">{{ placeholder }}</span>\n <div class=\"a-pry-select__filler\"></div>\n } @else {\n <ng-container *ngFor=\"let item of valueItems$ | async\">\n <div\n class=\"a-pry-select__value\"\n [class.pry-select-form]=\"isForm\"\n [class.-multiple]=\"multiple\"\n [ngClass]=\"item ? item[bindClasses ?? ''] ?? {} : {}\"\n >\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item, clear }\"></ng-container>\n } @else {\n <pry-icon\n *ngIf=\"bindIcon\"\n [iconSvg]=\"item[bindIcon]\"\n [width]=\"iconSize[0]\"\n [height]=\"iconSize[1]\"\n ></pry-icon>\n @if (bindLabel ? item?.[bindLabel] : item; as value) {\n {{ (i18nPrefix ?? '') + value | i18n: { warn: false } }}\n <span\n *ngIf=\"multiple && clearable\"\n class=\"a-pry-select__clear\"\n (click)=\"clear($event, item)\"\n aria-hidden=\"true\"\n >\u00D7</span\n >\n }\n }\n </div>\n </ng-container>\n <div class=\"a-pry-select__filler\"></div>\n }\n </div>\n <div class=\"a-pry-select__actions\">\n @if (clearable) {\n <span class=\"a-pry-select__clear\" (click)=\"clearAll($event)\" aria-hidden=\"true\">\u00D7</span>\n }\n <pry-icon\n class=\"a-pry-select__toggle\"\n [iconSvg]=\"open ? 'chevron_top' : 'chevron_bottom'\"\n [width]=\"iconSize[0]\"\n [height]=\"iconSize[1]\"\n ></pry-icon>\n </div>\n</div>\n<ng-template #optionsModal>\n <div\n role=\"listbox\"\n [attr.aria-label]=\"'@pry.select.label' | i18n\"\n [id]=\"modalId\"\n [attr.aria-activedescendant]=\"'select-option-' + activeDescendant\"\n [attr.aria-multiselectable]=\"multiple\"\n [attr.required]=\"required\"\n [attr.aria-readonly]=\"readonly\"\n cdkTrapFocus=\"!autocomplete\"\n [cdkTrapFocusAutoCapture]=\"!autocomplete\"\n >\n @if (loading) {\n <div class=\"a-pry-select__options__option -hint\" [style.width.px]=\"modalWidth\">\n <div class=\"no-widget no-widget__loader\">\n <pry-page-loader></pry-page-loader>\n </div>\n <p>{{ '@pry.select.loading' | i18n }}...</p>\n </div>\n } @else {\n @for (item of matchingItems$ | async; track item.id; let index = $index; let first = $first; let last = $last) {\n <div\n class=\"a-pry-select__options__option\"\n [attr.aria-selected]=\"(valueItems$ | async).includes(item)\"\n [attr.aria-checked]=\"(valueItems$ | async).includes(item)\"\n [attr.aria-disabled]=\"disabled\"\n (click)=\"select($event, item, index)\"\n (keydown)=\"onKeydownOption($event, item, index, optionDivRef, first, last)\"\n [style.width.px]=\"modalWidth\"\n role=\"option\"\n [id]=\"'select-option-' + index\"\n tabindex=\"0\"\n #optionDivRef\n >\n @if (template) {\n <ng-container [ngTemplateOutlet]=\"template\" [ngTemplateOutletContext]=\"{ item, clear }\"></ng-container>\n } @else {\n @if (multiple) {\n <pry-checkbox\n (click)=\"$event.preventDefault()\"\n [ngModel]=\"(valueItems$ | async).includes(item)\"\n ></pry-checkbox>\n }\n @if (bindIcon) {\n <pry-icon [iconSvg]=\"item[bindIcon]\" [width]=\"iconSize[0]\" [height]=\"iconSize[1]\"></pry-icon>\n }\n @if (bindLabel ? item?.[bindLabel] : item; as value) {\n {{ (i18nPrefix ? i18nPrefix : '') + value | i18n: { warn: false } }}\n }\n }\n </div>\n } @empty {\n <div class=\"a-pry-select__options__option -hint\" [style.width.px]=\"modalWidth\">\n <p>{{ '@pry.select.empty' | i18n }}</p>\n </div>\n }\n }\n </div>\n</ng-template>\n" }]
|
|
7313
7315
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i2.Overlay }, { type: i0.ViewContainerRef }, { type: SelectA11yService }], propDecorators: { items: [{
|
|
7314
7316
|
type: Input
|
|
7315
7317
|
}], clearable: [{
|
|
@@ -10687,11 +10689,11 @@ class PryDatasourceCardComponent {
|
|
|
10687
10689
|
}
|
|
10688
10690
|
}
|
|
10689
10691
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PryDatasourceCardComponent, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10690
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: PryDatasourceCardComponent, selector: "pry-datasource-card", inputs: { datasource: "datasource", showFooter: "showFooter", isSelectable: "isSelectable", isSelected: "isSelected" }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<div\n class=\"o-datasource-card\"\n [class.-no-footer]=\"!showFooter\"\n [class.-is-selectable]=\"isSelectable\"\n (click)=\"onClick()\"\n>\n <div class=\"o-datasource-card__header\">\n <img\n alt=\"\"\n [height]=\"25\"\n [width]=\"25\"\n [src]=\"datasource.id | translateId: { type: 'datasource', output: 'icon' } | async\"\n />\n <div class=\"o-datasource-card__title\" ellipsis textElementSelector=\".a-h4\">\n <h4 class=\"a-h4\">{{ datasource.name }}</h4>\n </div>\n @if (isSelectable) {\n <pry-checkbox\n (click)=\"$event.preventDefault()\"\n class=\"o-datasource-card__checkbox\"\n [ngModel]=\"isSelected\"\n ></pry-checkbox>\n }\n </div>\n <div class=\"o-datasource-card__content u-display-flex -column -gap-10\">\n @if (datasource.description) {\n <div class=\"o-datasource-card__description\" ellipsis textElementSelector=\".description\">\n <div class=\"description\">{{ truncateDescription(datasource.description, 100) }}</div>\n </div>\n } @else {\n <div class=\"o-datasource-card__description -italic\">{{ '@pry.dataset.noDescription' | i18n }}</div>\n }\n\n <span class=\"o-datasource-card__date\">\n @if (datasource.sourceType === 'dataset') {\n @if (datasource.activeVersion) {\n {{ '@pry.dataset.since_day' | i18n }} {{ datasource.activeVersion.
|
|
10692
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.3", type: PryDatasourceCardComponent, selector: "pry-datasource-card", inputs: { datasource: "datasource", showFooter: "showFooter", isSelectable: "isSelectable", isSelected: "isSelected" }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<div\n class=\"o-datasource-card\"\n [class.-no-footer]=\"!showFooter\"\n [class.-is-selectable]=\"isSelectable\"\n (click)=\"onClick()\"\n>\n <div class=\"o-datasource-card__header\">\n <img\n alt=\"\"\n [height]=\"25\"\n [width]=\"25\"\n [src]=\"datasource.id | translateId: { type: 'datasource', output: 'icon' } | async\"\n />\n <div class=\"o-datasource-card__title\" ellipsis textElementSelector=\".a-h4\">\n <h4 class=\"a-h4\">{{ datasource.name }}</h4>\n </div>\n @if (isSelectable) {\n <pry-checkbox\n (click)=\"$event.preventDefault()\"\n class=\"o-datasource-card__checkbox\"\n [ngModel]=\"isSelected\"\n ></pry-checkbox>\n }\n </div>\n <div class=\"o-datasource-card__content u-display-flex -column -gap-10\">\n @if (datasource.description) {\n <div class=\"o-datasource-card__description\" ellipsis textElementSelector=\".description\">\n <div class=\"description\">{{ truncateDescription(datasource.description, 100) }}</div>\n </div>\n } @else {\n <div class=\"o-datasource-card__description -italic\">{{ '@pry.dataset.noDescription' | i18n }}</div>\n }\n\n <span class=\"o-datasource-card__date\">\n @if (datasource.sourceType === 'dataset') {\n @if (datasource.activeVersion) {\n {{ '@pry.dataset.since_day' | i18n }} {{ datasource.activeVersion.lastModified! | sinceDate }}\n } @else {\n <span class=\"-italic\">{{ '@pry.dataset.noActiveVersion' | i18n }}</span>\n }\n }\n </span>\n @if (datasource.sourceType === 'dataset' && datasource.categories && datasource.categories.length > 0) {\n <div class=\"o-datasource-card__categories u-display-flex -wrap\">\n @for (category of datasource.categories; track category.id) {\n <span class=\"a-chip -md\">{{ category.name }}</span>\n }\n </div>\n }\n </div>\n\n @if (showFooter) {\n <div class=\"o-datasource-card__footer\">\n <button class=\"a-btn\">\n {{ '@pry.dataset.consult' | i18n }}\n <pry-icon [width]=\"20\" [height]=\"20\" iconSvg=\"arrow_right\"></pry-icon>\n </button>\n </div>\n }\n</div>\n", dependencies: [{ kind: "directive", type: i3$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "directive", type: EllipsisDirective, selector: "[ellipsis]", inputs: ["textElementSelector"] }, { kind: "component", type: i7.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle", "name", "inputId", "inhibit"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: TranslateIdPipe, name: "translateId" }, { kind: "pipe", type: I18nPipe, name: "i18n" }, { kind: "pipe", type: SinceDatePipe, name: "sinceDate" }] }); }
|
|
10691
10693
|
}
|
|
10692
10694
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PryDatasourceCardComponent, decorators: [{
|
|
10693
10695
|
type: Component,
|
|
10694
|
-
args: [{ selector: 'pry-datasource-card', template: "<div\n class=\"o-datasource-card\"\n [class.-no-footer]=\"!showFooter\"\n [class.-is-selectable]=\"isSelectable\"\n (click)=\"onClick()\"\n>\n <div class=\"o-datasource-card__header\">\n <img\n alt=\"\"\n [height]=\"25\"\n [width]=\"25\"\n [src]=\"datasource.id | translateId: { type: 'datasource', output: 'icon' } | async\"\n />\n <div class=\"o-datasource-card__title\" ellipsis textElementSelector=\".a-h4\">\n <h4 class=\"a-h4\">{{ datasource.name }}</h4>\n </div>\n @if (isSelectable) {\n <pry-checkbox\n (click)=\"$event.preventDefault()\"\n class=\"o-datasource-card__checkbox\"\n [ngModel]=\"isSelected\"\n ></pry-checkbox>\n }\n </div>\n <div class=\"o-datasource-card__content u-display-flex -column -gap-10\">\n @if (datasource.description) {\n <div class=\"o-datasource-card__description\" ellipsis textElementSelector=\".description\">\n <div class=\"description\">{{ truncateDescription(datasource.description, 100) }}</div>\n </div>\n } @else {\n <div class=\"o-datasource-card__description -italic\">{{ '@pry.dataset.noDescription' | i18n }}</div>\n }\n\n <span class=\"o-datasource-card__date\">\n @if (datasource.sourceType === 'dataset') {\n @if (datasource.activeVersion) {\n {{ '@pry.dataset.since_day' | i18n }} {{ datasource.activeVersion.
|
|
10696
|
+
args: [{ selector: 'pry-datasource-card', template: "<div\n class=\"o-datasource-card\"\n [class.-no-footer]=\"!showFooter\"\n [class.-is-selectable]=\"isSelectable\"\n (click)=\"onClick()\"\n>\n <div class=\"o-datasource-card__header\">\n <img\n alt=\"\"\n [height]=\"25\"\n [width]=\"25\"\n [src]=\"datasource.id | translateId: { type: 'datasource', output: 'icon' } | async\"\n />\n <div class=\"o-datasource-card__title\" ellipsis textElementSelector=\".a-h4\">\n <h4 class=\"a-h4\">{{ datasource.name }}</h4>\n </div>\n @if (isSelectable) {\n <pry-checkbox\n (click)=\"$event.preventDefault()\"\n class=\"o-datasource-card__checkbox\"\n [ngModel]=\"isSelected\"\n ></pry-checkbox>\n }\n </div>\n <div class=\"o-datasource-card__content u-display-flex -column -gap-10\">\n @if (datasource.description) {\n <div class=\"o-datasource-card__description\" ellipsis textElementSelector=\".description\">\n <div class=\"description\">{{ truncateDescription(datasource.description, 100) }}</div>\n </div>\n } @else {\n <div class=\"o-datasource-card__description -italic\">{{ '@pry.dataset.noDescription' | i18n }}</div>\n }\n\n <span class=\"o-datasource-card__date\">\n @if (datasource.sourceType === 'dataset') {\n @if (datasource.activeVersion) {\n {{ '@pry.dataset.since_day' | i18n }} {{ datasource.activeVersion.lastModified! | sinceDate }}\n } @else {\n <span class=\"-italic\">{{ '@pry.dataset.noActiveVersion' | i18n }}</span>\n }\n }\n </span>\n @if (datasource.sourceType === 'dataset' && datasource.categories && datasource.categories.length > 0) {\n <div class=\"o-datasource-card__categories u-display-flex -wrap\">\n @for (category of datasource.categories; track category.id) {\n <span class=\"a-chip -md\">{{ category.name }}</span>\n }\n </div>\n }\n </div>\n\n @if (showFooter) {\n <div class=\"o-datasource-card__footer\">\n <button class=\"a-btn\">\n {{ '@pry.dataset.consult' | i18n }}\n <pry-icon [width]=\"20\" [height]=\"20\" iconSvg=\"arrow_right\"></pry-icon>\n </button>\n </div>\n }\n</div>\n" }]
|
|
10695
10697
|
}], ctorParameters: () => [{ type: i1.Store }], propDecorators: { datasource: [{
|
|
10696
10698
|
type: Input
|
|
10697
10699
|
}], showFooter: [{
|