From b7f4e21c06ad7fb72bfddbc07e77141bb10f0fa2 Mon Sep 17 00:00:00 2001 From: Quentin Deroubaix Date: Wed, 15 Nov 2023 13:56:27 +0100 Subject: [PATCH] feat: support and enforce number and boolean transform functions in angular --- .../app/samples/accordion/default.route.ts | 4 +- .../app/samples/pagination/custom.route.ts | 4 +- .../app/samples/pagination/default.route.ts | 8 +- .../app/samples/progressbar/default.route.ts | 10 +- .../samples/progressbar/simpleCustom.route.ts | 6 +- .../samples/rating/customTemplate.route.ts | 2 +- .../src/app/samples/rating/readonly.route.ts | 2 +- .../src/app/samples/slider/default.route.ts | 6 +- .../src/app/samples/slider/range.route.ts | 4 +- .../src/app/samples/slider/vertical.route.ts | 4 +- angular/headless/src/lib/coercion.spec.ts | 112 ++++++++++++++++++ angular/headless/src/lib/coercion.ts | 35 ++++++ angular/headless/src/public-api.ts | 1 + .../src/lib/accordion/accordion.component.ts | 19 +-- angular/lib/src/lib/alert/alert.component.ts | 9 +- angular/lib/src/lib/modal/modal.component.ts | 11 +- .../lib/pagination/pagination.component.ts | 14 ++- .../lib/progressbar/progressbar.component.ts | 12 +- .../lib/src/lib/rating/rating.component.ts | 22 ++-- .../lib/src/lib/select/select.component.ts | 8 +- .../lib/src/lib/slider/slider.component.ts | 14 ++- eslint-plugin/src/angular-check-props.ts | 92 ++++++++++++-- .../test/angular-check-props.spec.ts | 29 +++-- 23 files changed, 341 insertions(+), 87 deletions(-) create mode 100644 angular/headless/src/lib/coercion.spec.ts create mode 100644 angular/headless/src/lib/coercion.ts diff --git a/angular/demo/src/app/samples/accordion/default.route.ts b/angular/demo/src/app/samples/accordion/default.route.ts index 5a70b3cb1b..8349f1929b 100644 --- a/angular/demo/src/app/samples/accordion/default.route.ts +++ b/angular/demo/src/app/samples/accordion/default.route.ts @@ -7,7 +7,7 @@ import BODY from '!raw-loader!@agnos-ui/common/samples/accordion/body.txt'; imports: [AgnosUIAngularModule], template: `
-
+
Simple {{ BODY }}
@@ -17,7 +17,7 @@ import BODY from '!raw-loader!@agnos-ui/common/samples/accordion/body.txt'; > {{ BODY }}
-
+
Disabled {{ BODY }}
diff --git a/angular/demo/src/app/samples/pagination/custom.route.ts b/angular/demo/src/app/samples/pagination/custom.route.ts index 13cac688a7..ab378c1d82 100644 --- a/angular/demo/src/app/samples/pagination/custom.route.ts +++ b/angular/demo/src/app/samples/pagination/custom.route.ts @@ -9,7 +9,7 @@ const FILTER_PAG_REGEX = /[^0-9]/g; imports: [AgnosUIAngularModule], template: `

A pagination with customized links:

-