@ecodev/natural 69.0.10 → 69.0.12

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -10,15 +10,15 @@ This project is a collection of Angular Material components and various utilitie
10
10
  ## Install
11
11
 
12
12
  ```bash
13
- yarn add @ecodev/natural
13
+ pnpm add @ecodev/natural
14
14
  ```
15
15
 
16
16
  ## Development
17
17
 
18
18
  The most useful commands for development are:
19
19
 
20
- - `yarn dev` to start a development server
21
- - `yarn build-demo` to build the docs locally (it will be published automatically by GitHub Actions)
20
+ - `pnpm dev` to start a development server
21
+ - `pnpm build-demo` to build the docs locally (it will be published automatically by GitHub Actions)
22
22
  - `git tag -am 1.2.3 1.2.3 && git push` to publish the lib to npm (via GitHub Actions `release` job)
23
23
 
24
24
  ### i18n
@@ -33,7 +33,7 @@ application to extract and translate strings.
33
33
  This is an Angular component to search for things via configurable facets. Facets may be
34
34
  configured to use one of the built-in component, or a custom component to input values.
35
35
 
36
- See the component in action on [the demo page](https://ecodev.github.io/natural).
36
+ See the component in action on [the demo page](https://ecodev.github.io/natural-demo).
37
37
 
38
38
  #### Prior work
39
39
 
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { extname, join, resolve } from "node:path";
5
- import { readdirSync, readFileSync, statSync, realpathSync } from "node:fs";
5
+ import { readdirSync, readFileSync, realpathSync, statSync } from "node:fs";
6
6
  import { parse, serializeOuter } from "parse5";
7
7
  const currentFilePath = fileURLToPath(import.meta.url);
8
8
  if (currentFilePath === realpathSync(process.argv[1])) {
@@ -110,7 +110,7 @@ export function checkXlf(file, content) {
110
110
  "XLF ICU must not have quotes that break syntax": /^\s*(?<line>.*\{\{[^}]*(‘|’)[^}]*}}.*)$/gm
111
111
  };
112
112
  for (const [message, r] of Object.entries(patterns)) {
113
- let result = null;
113
+ let result;
114
114
  while (result = r.exec(content)) {
115
115
  const line = result.groups?.line ?? "";
116
116
  printError(file, message, line);
@@ -3766,7 +3766,7 @@ class NaturalAbstractList extends NaturalAbstractPanel {
3766
3766
  /**
3767
3767
  * Selection for bulk actions
3768
3768
  */
3769
- selection = new SelectionModel(true, []);
3769
+ selection = new SelectionModel(true, [], true, (a, b) => a.id === b.id);
3770
3770
  /**
3771
3771
  * Next executed action from bulk menu
3772
3772
  */
@@ -3790,7 +3790,7 @@ class NaturalAbstractList extends NaturalAbstractPanel {
3790
3790
  /**
3791
3791
  * List of page sizes
3792
3792
  */
3793
- pageSizeOptions = [5, 25, 50, 100, 200];
3793
+ pageSizeOptions = [5, 10, 25, 50, 100, 200];
3794
3794
  /**
3795
3795
  * Initial pagination setup
3796
3796
  */
@@ -4174,7 +4174,7 @@ class NaturalAbstractNavigableList extends NaturalAbstractList {
4174
4174
  if (params.ns) {
4175
4175
  return;
4176
4176
  }
4177
- let navigationConditionValue = null;
4177
+ let navigationConditionValue;
4178
4178
  // "na" stands for "navigation" (relation) in url
4179
4179
  if (params.na) {
4180
4180
  navigationConditionValue = { have: { values: [params.na] } };
@@ -5531,6 +5531,8 @@ class NaturalIconDirective {
5531
5531
  });
5532
5532
  }
5533
5533
  registerIcons(config) {
5534
+ // Ensure that this specific instance of registry has our our icons
5535
+ // exactly once, not less and not more
5534
5536
  const registry = this.matIconRegistry;
5535
5537
  if (registry[naturalRegistered]) {
5536
5538
  return;
@@ -6568,11 +6570,11 @@ class NaturalDetailHeaderComponent {
6568
6570
  return this.getRootLink().concat([id]);
6569
6571
  }
6570
6572
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NaturalDetailHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
6571
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: NaturalDetailHeaderComponent, isStandalone: true, selector: "natural-detail-header", inputs: { currentBaseUrl: { classPropertyName: "currentBaseUrl", publicName: "currentBaseUrl", isSignal: true, isRequired: false, transformFunction: null }, isPanel: { classPropertyName: "isPanel", publicName: "isPanel", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, rootLabel: { classPropertyName: "rootLabel", publicName: "rootLabel", isSignal: false, isRequired: false, transformFunction: null }, newLabel: { classPropertyName: "newLabel", publicName: "newLabel", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: true, transformFunction: null }, breadcrumbs: { classPropertyName: "breadcrumbs", publicName: "breadcrumbs", isSignal: true, isRequired: false, transformFunction: null }, listRoute: { classPropertyName: "listRoute", publicName: "listRoute", isSignal: true, isRequired: false, transformFunction: null }, listFragment: { classPropertyName: "listFragment", publicName: "listFragment", isSignal: true, isRequired: false, transformFunction: null }, link: { classPropertyName: "link", publicName: "link", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"breadcrumb\">\n @if (rootLabel || label) {\n <a color=\"primary\" matButton [routerLink]=\"isPanel() ? [] : getRootLink()\" [fragment]=\"listFragment()\">{{\n rootLabel || label\n }}</a>\n }\n @for (parent of breadcrumbs(); track parent.id) {\n /\n <a color=\"primary\" matButton [routerLink]=\"isPanel() ? [] : getLink(parent.id)\">\n {{ parent?.fullName || parent?.name }}</a\n >\n }\n</div>\n\n<div class=\"body\">\n @if (icon) {\n <div style=\"width: 30px\">\n <mat-icon [naturalIcon]=\"icon\" />\n </div>\n }\n @if (!model().id) {\n <h1 class=\"mat-font-headline-sm newLabel\">{{ newLabel() }}</h1>\n } @else {\n <h1 class=\"mat-font-headline-sm label\">{{ model().name || model().fullName || label }}</h1>\n }\n <div>\n <ng-content />\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:column}:host .breadcrumb,:host .body{display:flex;flex-direction:row;align-items:center}:host .breadcrumb{position:relative;top:5px}:host .body{min-height:40px}:host .body>*:not(:last-child){margin-right:5px}:host .body .label,:host .body .newLabel{flex:1}@media screen and (max-width:600px){:host .body{flex-direction:column;align-items:flex-start}:host .body>*:not(:last-child){margin-bottom:10px!important}:host .body mat-icon{display:none}}\n"], dependencies: [{ kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NaturalIconDirective, selector: "mat-icon[naturalIcon]", inputs: ["naturalIcon", "size"] }] });
6573
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: NaturalDetailHeaderComponent, isStandalone: true, selector: "natural-detail-header", inputs: { currentBaseUrl: { classPropertyName: "currentBaseUrl", publicName: "currentBaseUrl", isSignal: true, isRequired: false, transformFunction: null }, isPanel: { classPropertyName: "isPanel", publicName: "isPanel", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, rootLabel: { classPropertyName: "rootLabel", publicName: "rootLabel", isSignal: false, isRequired: false, transformFunction: null }, newLabel: { classPropertyName: "newLabel", publicName: "newLabel", isSignal: true, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: true, transformFunction: null }, breadcrumbs: { classPropertyName: "breadcrumbs", publicName: "breadcrumbs", isSignal: true, isRequired: false, transformFunction: null }, listRoute: { classPropertyName: "listRoute", publicName: "listRoute", isSignal: true, isRequired: false, transformFunction: null }, listFragment: { classPropertyName: "listFragment", publicName: "listFragment", isSignal: true, isRequired: false, transformFunction: null }, link: { classPropertyName: "link", publicName: "link", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"breadcrumb\">\n @if (rootLabel || label) {\n <a color=\"primary\" matButton [routerLink]=\"isPanel() ? [] : getRootLink()\" [fragment]=\"listFragment()\">{{\n rootLabel || label\n }}</a>\n }\n @for (parent of breadcrumbs(); track parent.id) {\n /\n <a color=\"primary\" matButton [routerLink]=\"isPanel() ? [] : getLink(parent.id)\">\n {{ parent?.fullName || parent?.name }}</a\n >\n }\n</div>\n\n<div class=\"body\">\n @if (icon) {\n <div style=\"width: 30px\">\n <mat-icon [naturalIcon]=\"icon\" />\n </div>\n }\n @if (!model().id) {\n <h1 class=\"newLabel\">{{ newLabel() }}</h1>\n } @else {\n <h1 class=\"label\">{{ model().name || model().fullName || label }}</h1>\n }\n <div>\n <ng-content />\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:column}:host .breadcrumb,:host .body{display:flex;flex-direction:row;align-items:center}:host .breadcrumb{position:relative;top:5px}:host .body{min-height:40px}:host .body>*:not(:last-child){margin-right:5px}:host .body .label,:host .body .newLabel{flex:1}@media screen and (max-width:600px){:host .body{flex-direction:column;align-items:flex-start}:host .body>*:not(:last-child){margin-bottom:10px!important}:host .body mat-icon{display:none}}\n"], dependencies: [{ kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NaturalIconDirective, selector: "mat-icon[naturalIcon]", inputs: ["naturalIcon", "size"] }] });
6572
6574
  }
6573
6575
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NaturalDetailHeaderComponent, decorators: [{
6574
6576
  type: Component,
6575
- args: [{ selector: 'natural-detail-header', imports: [MatButton, RouterLink, MatIcon, NaturalIconDirective], template: "<div class=\"breadcrumb\">\n @if (rootLabel || label) {\n <a color=\"primary\" matButton [routerLink]=\"isPanel() ? [] : getRootLink()\" [fragment]=\"listFragment()\">{{\n rootLabel || label\n }}</a>\n }\n @for (parent of breadcrumbs(); track parent.id) {\n /\n <a color=\"primary\" matButton [routerLink]=\"isPanel() ? [] : getLink(parent.id)\">\n {{ parent?.fullName || parent?.name }}</a\n >\n }\n</div>\n\n<div class=\"body\">\n @if (icon) {\n <div style=\"width: 30px\">\n <mat-icon [naturalIcon]=\"icon\" />\n </div>\n }\n @if (!model().id) {\n <h1 class=\"mat-font-headline-sm newLabel\">{{ newLabel() }}</h1>\n } @else {\n <h1 class=\"mat-font-headline-sm label\">{{ model().name || model().fullName || label }}</h1>\n }\n <div>\n <ng-content />\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:column}:host .breadcrumb,:host .body{display:flex;flex-direction:row;align-items:center}:host .breadcrumb{position:relative;top:5px}:host .body{min-height:40px}:host .body>*:not(:last-child){margin-right:5px}:host .body .label,:host .body .newLabel{flex:1}@media screen and (max-width:600px){:host .body{flex-direction:column;align-items:flex-start}:host .body>*:not(:last-child){margin-bottom:10px!important}:host .body mat-icon{display:none}}\n"] }]
6577
+ args: [{ selector: 'natural-detail-header', imports: [MatButton, RouterLink, MatIcon, NaturalIconDirective], template: "<div class=\"breadcrumb\">\n @if (rootLabel || label) {\n <a color=\"primary\" matButton [routerLink]=\"isPanel() ? [] : getRootLink()\" [fragment]=\"listFragment()\">{{\n rootLabel || label\n }}</a>\n }\n @for (parent of breadcrumbs(); track parent.id) {\n /\n <a color=\"primary\" matButton [routerLink]=\"isPanel() ? [] : getLink(parent.id)\">\n {{ parent?.fullName || parent?.name }}</a\n >\n }\n</div>\n\n<div class=\"body\">\n @if (icon) {\n <div style=\"width: 30px\">\n <mat-icon [naturalIcon]=\"icon\" />\n </div>\n }\n @if (!model().id) {\n <h1 class=\"newLabel\">{{ newLabel() }}</h1>\n } @else {\n <h1 class=\"label\">{{ model().name || model().fullName || label }}</h1>\n }\n <div>\n <ng-content />\n </div>\n</div>\n", styles: [":host{display:flex;flex-direction:column}:host .breadcrumb,:host .body{display:flex;flex-direction:row;align-items:center}:host .breadcrumb{position:relative;top:5px}:host .body{min-height:40px}:host .body>*:not(:last-child){margin-right:5px}:host .body .label,:host .body .newLabel{flex:1}@media screen and (max-width:600px){:host .body{flex-direction:column;align-items:flex-start}:host .body>*:not(:last-child){margin-bottom:10px!important}:host .body mat-icon{display:none}}\n"] }]
6576
6578
  }], propDecorators: { currentBaseUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentBaseUrl", required: false }] }], isPanel: [{ type: i0.Input, args: [{ isSignal: true, alias: "isPanel", required: false }] }], icon: [{
6577
6579
  type: Input
6578
6580
  }], label: [{