Skip to content

Commit

Permalink
Refreshed project
Browse files Browse the repository at this point in the history
  • Loading branch information
jagomf committed May 17, 2024
1 parent 4bfb904 commit 616daf6
Show file tree
Hide file tree
Showing 31 changed files with 4,320 additions and 1,468 deletions.
35 changes: 35 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": "off",
"@angular-eslint/component-selector": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-import-type-side-effects": "warn"
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended",
"plugin:@angular-eslint/template/accessibility"
],
"rules": {}
}
]
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ testem.log
# System Files
.DS_Store
Thumbs.db

.nx/cache
.nx/workspace-data
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Jago MF
Copyright (c) 2024 Jago MF

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## This package does not depend on 3rd parties' maps

Starting with v4, this package **does NOT depend on Google GeoCharts** but uses its own embedded map.
Version v4 of this package **does NOT depend on Google GeoCharts** but uses its own embedded map.

If you want to use v3 (which depends on Google GeoCharts), please check [ReadMe v3](https://github.com/jagomf/countries-map/blob/v3/README.md).

Expand Down
20 changes: 14 additions & 6 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "tsconfig.app.json",
"polyfills": "src/polyfills.ts",
"polyfills": [
"zone.js"
],
"assets": [
"src/assets"
],
Expand Down Expand Up @@ -78,15 +80,21 @@
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"main": "projects/lib/src/test.ts",
"tsConfig": "projects/lib/tsconfig.spec.json",
"karmaConfig": "projects/lib/karma.conf.js"
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
}
},
"cli": {
"schematicCollections": [
"@angular-eslint/schematics"
]
}
}
2 changes: 1 addition & 1 deletion dist/countries-map/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Jago MF
Copyright (c) 2024 Jago MF

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion dist/countries-map/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## This package does not depend on 3rd parties' maps

Starting with v4, this package **does NOT depend on Google GeoCharts** but uses its own embedded map.
Version v4 of this package **does NOT depend on Google GeoCharts** but uses its own embedded map.

If you want to use v3 (which depends on Google GeoCharts), please check [ReadMe v3](https://github.com/jagomf/countries-map/blob/v3/README.md).

Expand Down
12 changes: 6 additions & 6 deletions dist/countries-map/esm2022/lib/countries-map.component.mjs

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions dist/countries-map/fesm2022/countries-map.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,18 @@ class CountriesMapComponent {
onCharterror(error) {
this.chartError.emit(error);
}
onMapSelect({ target }) {
onMapSelect(ev) {
const event = {
selected: false,
value: null,
country: null
};
let newItem;
if (target.id === oceanId) {
if (ev.target?.id === oceanId) {
this.selectCountry(null);
}
else {
newItem = target;
newItem = ev.target;
while (!newItem.classList.contains(countryClass)) {
newItem = newItem.parentNode;
}
Expand All @@ -168,11 +168,11 @@ class CountriesMapComponent {
this.chartSelect.emit(event);
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: CountriesMapComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.6", type: CountriesMapComponent, selector: "countries-map", inputs: { data: "data", countryLabel: "countryLabel", valueLabel: "valueLabel", showCaption: "showCaption", captionBelow: "captionBelow", minValue: "minValue", maxValue: "maxValue", minColor: "minColor", maxColor: "maxColor", backgroundColor: "backgroundColor", noDataColor: "noDataColor", exceptionColor: "exceptionColor" }, outputs: { chartReady: "chartReady", chartError: "chartError", chartSelect: "chartSelect" }, viewQueries: [{ propertyName: "mapContent", first: true, predicate: ["mapContent"], descendants: true, read: ElementRef }], usesOnChanges: true, ngImport: i0, template: "<div class=\"major-block loading\" *ngIf=\"loading\"><span class=\"text\">Loading map...</span></div>\n\n<countries-map-base class=\"major-block cm-map-content\" #mapContent (click)=\"onMapSelect($event)\" [ngClass]=\"{'goes-first': captionBelow}\">\n</countries-map-base>\n\n<div class=\"major-block cm-caption-container\" [ngClass]=\"{'goes-first': !captionBelow}\"\n *ngIf=\"!loading && showCaption\">\n <div class=\"cm-simple-caption\">\n <div class=\"cm-country-label\">\n <span class=\"cm-default-label\" *ngIf=\"!selection\">{{countryLabel}}</span>\n <span class=\"cm-country-name\" *ngIf=\"selection\">{{selection?.countryName}}</span>\n </div>\n <div class=\"cm-value-label\">\n <span class=\"cm-value-text\"\n [ngClass]=\"{'has-value': selection}\">{{valueLabel}}<span *ngIf=\"selection\">: </span></span>\n <span class=\"cm-value-content\" *ngIf=\"selection\">{{selectionValue}}</span>\n </div>\n </div>\n <div class=\"cm-extended-caption\" *ngIf=\"selection?.extra && selection?.extra.length > 0\">\n <div *ngFor=\"let item of selection?.extra\" class=\"cm-extended-item\">\n <span class=\"cm-extended-label\">{{item.key}}</span>:\n <span class=\"cm-extended-value\">{{item.val}}</span>\n </div>\n </div>\n</div>\n", styles: [":host{display:flex;flex-flow:column nowrap;justify-content:space-between;align-items:stretch;align-content:stretch}.major-block.loading{flex:0 1 auto;align-self:center}.major-block.loading .text{font-style:italic;font-family:sans-serif;color:gray}.major-block.cm-map-content{flex:0 1 auto}.major-block.goes-first{order:0}.major-block:not(.goes-first){order:1}.major-block.cm-caption-container{flex:0 1 auto;display:flex;flex-flow:column nowrap;justify-content:space-between}.cm-simple-caption{display:flex;flex-flow:row nowrap;justify-content:space-between}.cm-country-label{flex:0 1 auto;align-self:flex-start}.cm-value-label{flex:0 1 auto;align-self:flex-end}.cm-country-label,.cm-value-label{flex:0 1 auto}.cm-country-label .cm-country-name{font-weight:700}.cm-country-label .cm-country-name,.cm-value-label .cm-value-text{color:#333}.cm-country-label .cm-default-label,.cm-value-label .cm-value-text:not(.has-value){font-style:italic;color:#777}.cm-extended-caption{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));grid-gap:5px}.cm-extended-item{margin:5px auto}.cm-extended-item .cm-extended-label{font-weight:700}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CountriesMapBaseComponent, selector: "countries-map-base" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.6", type: CountriesMapComponent, selector: "countries-map", inputs: { data: "data", countryLabel: "countryLabel", valueLabel: "valueLabel", showCaption: "showCaption", captionBelow: "captionBelow", minValue: "minValue", maxValue: "maxValue", minColor: "minColor", maxColor: "maxColor", backgroundColor: "backgroundColor", noDataColor: "noDataColor", exceptionColor: "exceptionColor" }, outputs: { chartReady: "chartReady", chartError: "chartError", chartSelect: "chartSelect" }, viewQueries: [{ propertyName: "mapContent", first: true, predicate: ["mapContent"], descendants: true, read: ElementRef }], usesOnChanges: true, ngImport: i0, template: "@if (loading) {\n<div class=\"major-block loading\"><span class=\"text\">Loading map...</span></div>\n}\n\n<countries-map-base class=\"major-block cm-map-content\" #mapContent (click)=\"onMapSelect($event)\" [ngClass]=\"{'goes-first': captionBelow}\"/>\n\n@if (!loading && showCaption) {\n<div class=\"major-block cm-caption-container\" [ngClass]=\"{'goes-first': !captionBelow}\">\n <div class=\"cm-simple-caption\">\n <div class=\"cm-country-label\">\n @if (selection) {\n <span class=\"cm-country-name\">{{selection?.countryName}}</span>\n } @else {\n <span class=\"cm-default-label\">{{countryLabel}}</span>\n }\n </div>\n <div class=\"cm-value-label\">\n <span class=\"cm-value-text\"\n [ngClass]=\"{'has-value': selection}\">{{valueLabel}}@if (selection) {<span>: </span>}</span>\n @if (selection) {\n <span class=\"cm-value-content\">{{selectionValue}}</span>\n }\n </div>\n </div>\n @if (selection?.extra?.length > 0) {\n <div class=\"cm-extended-caption\">\n @for (item of selection?.extra; track item.key) {\n <div class=\"cm-extended-item\">\n <span class=\"cm-extended-label\">{{item.key}}</span>:\n <span class=\"cm-extended-value\">{{item.val}}</span>\n </div>\n }\n </div>\n }\n</div>\n}\n", styles: [":host{display:flex;flex-flow:column nowrap;justify-content:space-between;align-items:stretch;align-content:stretch}.major-block.loading{flex:0 1 auto;align-self:center}.major-block.loading .text{font-style:italic;font-family:sans-serif;color:gray}.major-block.cm-map-content{flex:0 1 auto}.major-block.goes-first{order:0}.major-block:not(.goes-first){order:1}.major-block.cm-caption-container{flex:0 1 auto;display:flex;flex-flow:column nowrap;justify-content:space-between}.cm-simple-caption{display:flex;flex-flow:row nowrap;justify-content:space-between}.cm-country-label{flex:0 1 auto;align-self:flex-start}.cm-value-label{flex:0 1 auto;align-self:flex-end}.cm-country-label,.cm-value-label{flex:0 1 auto}.cm-country-label .cm-country-name{font-weight:700}.cm-country-label .cm-country-name,.cm-value-label .cm-value-text{color:#333}.cm-country-label .cm-default-label,.cm-value-label .cm-value-text:not(.has-value){font-style:italic;color:#777}.cm-extended-caption{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));grid-gap:5px}.cm-extended-item{margin:5px auto}.cm-extended-item .cm-extended-label{font-weight:700}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: CountriesMapBaseComponent, selector: "countries-map-base" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: CountriesMapComponent, decorators: [{
type: Component,
args: [{ selector: 'countries-map', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"major-block loading\" *ngIf=\"loading\"><span class=\"text\">Loading map...</span></div>\n\n<countries-map-base class=\"major-block cm-map-content\" #mapContent (click)=\"onMapSelect($event)\" [ngClass]=\"{'goes-first': captionBelow}\">\n</countries-map-base>\n\n<div class=\"major-block cm-caption-container\" [ngClass]=\"{'goes-first': !captionBelow}\"\n *ngIf=\"!loading && showCaption\">\n <div class=\"cm-simple-caption\">\n <div class=\"cm-country-label\">\n <span class=\"cm-default-label\" *ngIf=\"!selection\">{{countryLabel}}</span>\n <span class=\"cm-country-name\" *ngIf=\"selection\">{{selection?.countryName}}</span>\n </div>\n <div class=\"cm-value-label\">\n <span class=\"cm-value-text\"\n [ngClass]=\"{'has-value': selection}\">{{valueLabel}}<span *ngIf=\"selection\">: </span></span>\n <span class=\"cm-value-content\" *ngIf=\"selection\">{{selectionValue}}</span>\n </div>\n </div>\n <div class=\"cm-extended-caption\" *ngIf=\"selection?.extra && selection?.extra.length > 0\">\n <div *ngFor=\"let item of selection?.extra\" class=\"cm-extended-item\">\n <span class=\"cm-extended-label\">{{item.key}}</span>:\n <span class=\"cm-extended-value\">{{item.val}}</span>\n </div>\n </div>\n</div>\n", styles: [":host{display:flex;flex-flow:column nowrap;justify-content:space-between;align-items:stretch;align-content:stretch}.major-block.loading{flex:0 1 auto;align-self:center}.major-block.loading .text{font-style:italic;font-family:sans-serif;color:gray}.major-block.cm-map-content{flex:0 1 auto}.major-block.goes-first{order:0}.major-block:not(.goes-first){order:1}.major-block.cm-caption-container{flex:0 1 auto;display:flex;flex-flow:column nowrap;justify-content:space-between}.cm-simple-caption{display:flex;flex-flow:row nowrap;justify-content:space-between}.cm-country-label{flex:0 1 auto;align-self:flex-start}.cm-value-label{flex:0 1 auto;align-self:flex-end}.cm-country-label,.cm-value-label{flex:0 1 auto}.cm-country-label .cm-country-name{font-weight:700}.cm-country-label .cm-country-name,.cm-value-label .cm-value-text{color:#333}.cm-country-label .cm-default-label,.cm-value-label .cm-value-text:not(.has-value){font-style:italic;color:#777}.cm-extended-caption{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));grid-gap:5px}.cm-extended-item{margin:5px auto}.cm-extended-item .cm-extended-label{font-weight:700}\n"] }]
args: [{ selector: 'countries-map', changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (loading) {\n<div class=\"major-block loading\"><span class=\"text\">Loading map...</span></div>\n}\n\n<countries-map-base class=\"major-block cm-map-content\" #mapContent (click)=\"onMapSelect($event)\" [ngClass]=\"{'goes-first': captionBelow}\"/>\n\n@if (!loading && showCaption) {\n<div class=\"major-block cm-caption-container\" [ngClass]=\"{'goes-first': !captionBelow}\">\n <div class=\"cm-simple-caption\">\n <div class=\"cm-country-label\">\n @if (selection) {\n <span class=\"cm-country-name\">{{selection?.countryName}}</span>\n } @else {\n <span class=\"cm-default-label\">{{countryLabel}}</span>\n }\n </div>\n <div class=\"cm-value-label\">\n <span class=\"cm-value-text\"\n [ngClass]=\"{'has-value': selection}\">{{valueLabel}}@if (selection) {<span>: </span>}</span>\n @if (selection) {\n <span class=\"cm-value-content\">{{selectionValue}}</span>\n }\n </div>\n </div>\n @if (selection?.extra?.length > 0) {\n <div class=\"cm-extended-caption\">\n @for (item of selection?.extra; track item.key) {\n <div class=\"cm-extended-item\">\n <span class=\"cm-extended-label\">{{item.key}}</span>:\n <span class=\"cm-extended-value\">{{item.val}}</span>\n </div>\n }\n </div>\n }\n</div>\n}\n", styles: [":host{display:flex;flex-flow:column nowrap;justify-content:space-between;align-items:stretch;align-content:stretch}.major-block.loading{flex:0 1 auto;align-self:center}.major-block.loading .text{font-style:italic;font-family:sans-serif;color:gray}.major-block.cm-map-content{flex:0 1 auto}.major-block.goes-first{order:0}.major-block:not(.goes-first){order:1}.major-block.cm-caption-container{flex:0 1 auto;display:flex;flex-flow:column nowrap;justify-content:space-between}.cm-simple-caption{display:flex;flex-flow:row nowrap;justify-content:space-between}.cm-country-label{flex:0 1 auto;align-self:flex-start}.cm-value-label{flex:0 1 auto;align-self:flex-end}.cm-country-label,.cm-value-label{flex:0 1 auto}.cm-country-label .cm-country-name{font-weight:700}.cm-country-label .cm-country-name,.cm-value-label .cm-value-text{color:#333}.cm-country-label .cm-default-label,.cm-value-label .cm-value-text:not(.has-value){font-style:italic;color:#777}.cm-extended-caption{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));grid-gap:5px}.cm-extended-item{margin:5px auto}.cm-extended-item .cm-extended-label{font-weight:700}\n"] }]
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { data: [{
type: Input,
args: [{ required: true }]
Expand Down
2 changes: 1 addition & 1 deletion dist/countries-map/fesm2022/countries-map.mjs.map

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions dist/countries-map/lib/countries-map.component.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ export declare class CountriesMapComponent implements AfterViewInit, OnChanges {
private countryHover;
private onChartReady;
private onCharterror;
onMapSelect({ target }: {
target?: SVGElement;
}): void;
onMapSelect(ev: MouseEvent): void;
static ɵfac: i0.ɵɵFactoryDeclaration<CountriesMapComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<CountriesMapComponent, "countries-map", never, { "data": { "alias": "data"; "required": true; }; "countryLabel": { "alias": "countryLabel"; "required": false; }; "valueLabel": { "alias": "valueLabel"; "required": false; }; "showCaption": { "alias": "showCaption"; "required": false; }; "captionBelow": { "alias": "captionBelow"; "required": false; }; "minValue": { "alias": "minValue"; "required": false; }; "maxValue": { "alias": "maxValue"; "required": false; }; "minColor": { "alias": "minColor"; "required": false; }; "maxColor": { "alias": "maxColor"; "required": false; }; "backgroundColor": { "alias": "backgroundColor"; "required": false; }; "noDataColor": { "alias": "noDataColor"; "required": false; }; "exceptionColor": { "alias": "exceptionColor"; "required": false; }; }, { "chartReady": "chartReady"; "chartError": "chartError"; "chartSelect": "chartSelect"; }, never, never, false, never>;
}
6 changes: 3 additions & 3 deletions dist/countries-map/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "countries-map",
"version": "4.9.0",
"version": "4.10.0",
"description": "World countries datamaps component for Angular",
"license": "MIT",
"author": "Jago MF <[email protected]>",
Expand All @@ -16,8 +16,8 @@
"Charts"
],
"peerDependencies": {
"@angular/common": "^17.0.0",
"@angular/core": "^17.0.0"
"@angular/common": ">=17.0.0",
"@angular/core": ">=17.0.0"
},
"dependencies": {
"@jagomf/countrieslist": "^3.0.1",
Expand Down
32 changes: 0 additions & 32 deletions karma.conf.js

This file was deleted.

Loading

0 comments on commit 616daf6

Please sign in to comment.