@flexzap/misc 0.0.4 → 1.0.0
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/README.md
CHANGED
|
@@ -13,7 +13,7 @@ npm install @flexzap/misc
|
|
|
13
13
|
This library requires the following peer dependencies:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npm install @angular/common@^
|
|
16
|
+
npm install @angular/common@^21.0.0 @angular/core@^21.0.0 @flexzap/pipes@^0.0.1
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
@@ -114,9 +114,8 @@ This library uses Jest for unit testing with zoneless Angular configuration.
|
|
|
114
114
|
|
|
115
115
|
```bash
|
|
116
116
|
# From the monorepo root
|
|
117
|
-
npm run misc:test # Run all unit tests
|
|
118
|
-
npm run misc:test:watch # Run tests in watch mode
|
|
119
|
-
npm run misc:test:coverage # Generate a test coverage report
|
|
117
|
+
npm run misc:test # Run all unit tests with coverage
|
|
118
|
+
npm run misc:test:watch # Run tests in watch mode (no coverage)
|
|
120
119
|
```
|
|
121
120
|
|
|
122
121
|
### Test Configuration
|
|
@@ -124,7 +123,7 @@ npm run misc:test:coverage # Generate a test coverage report
|
|
|
124
123
|
- **Framework**: Jest with jest-preset-angular
|
|
125
124
|
- **Environment**: jsdom
|
|
126
125
|
- **Configuration**: Zoneless Angular (mandatory)
|
|
127
|
-
- **Coverage**: Reports generated at
|
|
126
|
+
- **Coverage**: Reports generated at `coverage/flexzap/misc/`
|
|
128
127
|
|
|
129
128
|
## Development
|
|
130
129
|
|
|
@@ -3,10 +3,10 @@ import { ChangeDetectionStrategy, Component, input, signal, computed, effect } f
|
|
|
3
3
|
import { ZapNumeric } from '@flexzap/pipes';
|
|
4
4
|
|
|
5
5
|
class ZapSpinner {
|
|
6
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
7
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
6
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ZapSpinner, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.3", type: ZapSpinner, isStandalone: true, selector: "zap-spinner", ngImport: i0, template: "<div class=\"zap-spinner\">\n <div>\n <ng-content></ng-content>\n </div>\n <div></div>\n</div>\n", styles: [".zap-spinner{display:flex;justify-content:center;align-items:center;flex:1}.zap-spinner div:nth-child(1){position:absolute;z-index:1}.zap-spinner div:nth-child(2){width:100%;height:100%}:host{width:100%;height:100%;display:flex;position:absolute;left:0;top:0;z-index:10}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8
8
|
}
|
|
9
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
9
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ZapSpinner, decorators: [{
|
|
10
10
|
type: Component,
|
|
11
11
|
args: [{ selector: 'zap-spinner', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"zap-spinner\">\n <div>\n <ng-content></ng-content>\n </div>\n <div></div>\n</div>\n", styles: [".zap-spinner{display:flex;justify-content:center;align-items:center;flex:1}.zap-spinner div:nth-child(1){position:absolute;z-index:1}.zap-spinner div:nth-child(2){width:100%;height:100%}:host{width:100%;height:100%;display:flex;position:absolute;left:0;top:0;z-index:10}\n"] }]
|
|
12
12
|
}] });
|
|
@@ -32,13 +32,13 @@ class ZapProgressBar {
|
|
|
32
32
|
return 0;
|
|
33
33
|
return Math.trunc(((this.value() - this.min()) / (this.max() - this.min())) * 100);
|
|
34
34
|
}
|
|
35
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
36
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
35
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ZapProgressBar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
36
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.3", type: ZapProgressBar, isStandalone: true, selector: "zap-progress-bar", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"zap-progress-bar\">\n <div [style]=\"width()\">\n <span>{{ value() | ZapNumeric: format() }}</span>\n </div>\n</div>\n", styles: [".zap-progress-bar div{max-width:100%}:host{display:block}\n"], dependencies: [{ kind: "pipe", type: ZapNumeric, name: "ZapNumeric" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
37
37
|
}
|
|
38
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ZapProgressBar, decorators: [{
|
|
39
39
|
type: Component,
|
|
40
40
|
args: [{ selector: 'zap-progress-bar', imports: [ZapNumeric], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"zap-progress-bar\">\n <div [style]=\"width()\">\n <span>{{ value() | ZapNumeric: format() }}</span>\n </div>\n</div>\n", styles: [".zap-progress-bar div{max-width:100%}:host{display:block}\n"] }]
|
|
41
|
-
}], ctorParameters: () => [] });
|
|
41
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }] } });
|
|
42
42
|
|
|
43
43
|
/*
|
|
44
44
|
* Public API Surface of misc
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flexzap-misc.mjs","sources":["../../../../projects/flexzap/misc/src/lib/spinner/spinner.ts","../../../../projects/flexzap/misc/src/lib/spinner/spinner.html","../../../../projects/flexzap/misc/src/lib/progress-bar/progress-bar.ts","../../../../projects/flexzap/misc/src/lib/progress-bar/progress-bar.html","../../../../projects/flexzap/misc/src/public-api.ts","../../../../projects/flexzap/misc/src/flexzap-misc.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\n\n@Component({\n selector: 'zap-spinner',\n templateUrl: './spinner.html',\n styleUrl: './spinner.scss',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class ZapSpinner {
|
|
1
|
+
{"version":3,"file":"flexzap-misc.mjs","sources":["../../../../projects/flexzap/misc/src/lib/spinner/spinner.ts","../../../../projects/flexzap/misc/src/lib/spinner/spinner.html","../../../../projects/flexzap/misc/src/lib/progress-bar/progress-bar.ts","../../../../projects/flexzap/misc/src/lib/progress-bar/progress-bar.html","../../../../projects/flexzap/misc/src/public-api.ts","../../../../projects/flexzap/misc/src/flexzap-misc.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\n\n@Component({\n selector: 'zap-spinner',\n templateUrl: './spinner.html',\n styleUrl: './spinner.scss',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class ZapSpinner {}\n","<div class=\"zap-spinner\">\n <div>\n <ng-content></ng-content>\n </div>\n <div></div>\n</div>\n","import { ChangeDetectionStrategy, Component, computed, effect, input, signal } from '@angular/core';\n\nimport { ZapNumeric, ZapNumericInterface } from '@flexzap/pipes';\n\n@Component({\n selector: 'zap-progress-bar',\n imports: [ZapNumeric],\n templateUrl: './progress-bar.html',\n styleUrl: './progress-bar.scss',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class ZapProgressBar {\n readonly value = input<number>(0);\n readonly min = input<number>(0);\n readonly max = input<number>(100);\n readonly format = input<Partial<ZapNumericInterface>>({});\n\n private size = signal<number>(0);\n\n width = computed(() => ({\n width: `${this.size()}%`\n }));\n\n constructor() {\n // Effect to animate progress bar with CSS transition delay\n effect(() => {\n const targetSize = this.calculatePercentage();\n setTimeout(() => this.size.set(targetSize), 100);\n });\n }\n\n private calculatePercentage(): number {\n if (this.max() <= this.min()) return 0;\n return Math.trunc(((this.value() - this.min()) / (this.max() - this.min())) * 100);\n }\n}\n","<div class=\"zap-progress-bar\">\n <div [style]=\"width()\">\n <span>{{ value() | ZapNumeric: format() }}</span>\n </div>\n</div>\n","/*\n * Public API Surface of misc\n */\n\nexport * from './lib/spinner/spinner';\nexport * from './lib/progress-bar/progress-bar';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAQa,UAAU,CAAA;uGAAV,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAV,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAU,uECRvB,wGAMA,EAAA,MAAA,EAAA,CAAA,kRAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FDEa,UAAU,EAAA,UAAA,EAAA,CAAA;kBANtB,SAAS;+BACE,aAAa,EAAA,eAAA,EAGN,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,wGAAA,EAAA,MAAA,EAAA,CAAA,kRAAA,CAAA,EAAA;;;MEKpC,cAAc,CAAA;AAChB,IAAA,KAAK,GAAG,KAAK,CAAS,CAAC,iDAAC;AACxB,IAAA,GAAG,G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A,EAAA,UAAA,EAAA,KAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,GAAA,EAAA,EAAA,iBAAA,EAAA,KAAA,EAAA,UAAA,EAAA,KAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,QAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECX3B,0IAKA,EAAA,MAAA,EAAA,CAAA,6DAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EDCY,UAAU,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAKT,cAAc,EAAA,UAAA,EAAA,CAAA;kBAP1B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,WACnB,CAAC,UAAU,CAAC,EAAA,eAAA,EAGJ,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,0IAAA,EAAA,MAAA,EAAA,CAAA,6DAAA,CAAA,EAAA;;;AETjD;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flexzap/misc",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "All the miscellaneous components that makes part of the flexzap library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"flexzap",
|
|
@@ -17,23 +17,26 @@
|
|
|
17
17
|
"author": "flexzap",
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"homepage": "https://www.flexzap.dev",
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
20
23
|
"peerDependencies": {
|
|
21
|
-
"@angular/common": "^
|
|
22
|
-
"@angular/core": "^
|
|
24
|
+
"@angular/common": "^21.0.0",
|
|
25
|
+
"@angular/core": "^21.0.0"
|
|
23
26
|
},
|
|
24
27
|
"dependencies": {
|
|
25
|
-
"tslib": "^2.
|
|
26
|
-
"@flexzap/pipes": "
|
|
28
|
+
"tslib": "^2.8.1",
|
|
29
|
+
"@flexzap/pipes": "latest"
|
|
27
30
|
},
|
|
28
31
|
"sideEffects": false,
|
|
29
32
|
"module": "fesm2022/flexzap-misc.mjs",
|
|
30
|
-
"typings": "
|
|
33
|
+
"typings": "types/flexzap-misc.d.ts",
|
|
31
34
|
"exports": {
|
|
32
35
|
"./package.json": {
|
|
33
36
|
"default": "./package.json"
|
|
34
37
|
},
|
|
35
38
|
".": {
|
|
36
|
-
"types": "./
|
|
39
|
+
"types": "./types/flexzap-misc.d.ts",
|
|
37
40
|
"default": "./fesm2022/flexzap-misc.mjs"
|
|
38
41
|
}
|
|
39
42
|
}
|
|
File without changes
|