@flexzap/misc 0.0.1

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 ADDED
@@ -0,0 +1,63 @@
1
+ # Misc
2
+
3
+ This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.3.0.
4
+
5
+ ## Code scaffolding
6
+
7
+ Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
8
+
9
+ ```bash
10
+ ng generate component component-name
11
+ ```
12
+
13
+ For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
14
+
15
+ ```bash
16
+ ng generate --help
17
+ ```
18
+
19
+ ## Building
20
+
21
+ To build the library, run:
22
+
23
+ ```bash
24
+ ng build misc
25
+ ```
26
+
27
+ This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
28
+
29
+ ### Publishing the Library
30
+
31
+ Once the project is built, you can publish your library by following these steps:
32
+
33
+ 1. Navigate to the `dist` directory:
34
+ ```bash
35
+ cd dist/misc
36
+ ```
37
+
38
+ 2. Run the `npm publish` command to publish your library to the npm registry:
39
+ ```bash
40
+ npm publish
41
+ ```
42
+
43
+ ## Running unit tests
44
+
45
+ To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
46
+
47
+ ```bash
48
+ ng test
49
+ ```
50
+
51
+ ## Running end-to-end tests
52
+
53
+ For end-to-end (e2e) testing, run:
54
+
55
+ ```bash
56
+ ng e2e
57
+ ```
58
+
59
+ Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
60
+
61
+ ## Additional Resources
62
+
63
+ For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
@@ -0,0 +1,47 @@
1
+ import * as i0 from '@angular/core';
2
+ import { ChangeDetectionStrategy, Component, input, computed } from '@angular/core';
3
+ import { ZapNumeric } from '@flexzap/pipes';
4
+
5
+ class Spinner {
6
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: Spinner, deps: [], target: i0.ɵɵFactoryTarget.Component });
7
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.2", type: Spinner, 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
+ }
9
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: Spinner, decorators: [{
10
+ type: Component,
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
+ }] });
13
+
14
+ class ProgressBar {
15
+ value = input(0, ...(ngDevMode ? [{ debugName: "value" }] : []));
16
+ min = input(0, ...(ngDevMode ? [{ debugName: "min" }] : []));
17
+ max = input(100, ...(ngDevMode ? [{ debugName: "max" }] : []));
18
+ format = input({}, ...(ngDevMode ? [{ debugName: "format" }] : []));
19
+ size = computed(() => {
20
+ const currentValue = this.value();
21
+ const minValue = this.min();
22
+ const maxValue = this.max();
23
+ if (maxValue <= minValue)
24
+ return 0;
25
+ return Math.trunc(((currentValue - minValue) / (maxValue - minValue)) * 100);
26
+ }, ...(ngDevMode ? [{ debugName: "size" }] : []));
27
+ style = computed(() => ({
28
+ width: `${this.size()}%`
29
+ }), ...(ngDevMode ? [{ debugName: "style" }] : []));
30
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: ProgressBar, deps: [], target: i0.ɵɵFactoryTarget.Component });
31
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.2", type: ProgressBar, 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]=\"style()\">\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 });
32
+ }
33
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: ProgressBar, decorators: [{
34
+ type: Component,
35
+ args: [{ selector: 'zap-progress-bar', imports: [ZapNumeric], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"zap-progress-bar\">\n <div [style]=\"style()\">\n <span>{{ value() | ZapNumeric: format() }}</span>\n </div>\n</div>\n", styles: [".zap-progress-bar div{max-width:100%}:host{display:block}\n"] }]
36
+ }] });
37
+
38
+ /*
39
+ * Public API Surface of misc
40
+ */
41
+
42
+ /**
43
+ * Generated bundle index. Do not edit.
44
+ */
45
+
46
+ export { ProgressBar, Spinner };
47
+ //# sourceMappingURL=flexzap-misc.mjs.map
@@ -0,0 +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 Spinner {}\n","<div class=\"zap-spinner\">\n <div>\n <ng-content></ng-content>\n </div>\n <div></div>\n</div>\n","import { ChangeDetectionStrategy, Component, computed, input } 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 ProgressBar {\n value = input<number>(0);\n min = input<number>(0);\n max = input<number>(100);\n format = input<Partial<ZapNumericInterface>>({});\n\n size = computed(() => {\n const currentValue = this.value();\n const minValue = this.min();\n const maxValue = this.max();\n\n if (maxValue <= minValue) return 0;\n\n return Math.trunc(((currentValue - minValue) / (maxValue - minValue)) * 100);\n });\n\n style = computed(() => ({\n width: `${this.size()}%`\n }));\n}\n","<div class=\"zap-progress-bar\">\n <div [style]=\"style()\">\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,OAAO,CAAA;uGAAP,OAAO,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAP,IAAA,OAAA,IAAA,GAAA,EAA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.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { ZapNumericInterface } from '@flexzap/pipes';
3
+
4
+ declare class Spinner {
5
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<Spinner, never>;
6
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<Spinner, "zap-spinner", never, {}, {}, never, ["*"], true, never>;
7
+ }
8
+
9
+ declare class ProgressBar {
10
+ value: _angular_core.InputSignal<number>;
11
+ min: _angular_core.InputSignal<number>;
12
+ max: _angular_core.InputSignal<number>;
13
+ format: _angular_core.InputSignal<Partial<ZapNumericInterface>>;
14
+ size: _angular_core.Signal<number>;
15
+ style: _angular_core.Signal<{
16
+ width: string;
17
+ }>;
18
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ProgressBar, never>;
19
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ProgressBar, "zap-progress-bar", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
20
+ }
21
+
22
+ export { ProgressBar, Spinner };
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@flexzap/misc",
3
+ "version": "0.0.1",
4
+ "description": "All the miscellaneous components that makes part of the flexzap library",
5
+ "keywords": [
6
+ "flexzap",
7
+ "library",
8
+ "components",
9
+ "miscellaneous",
10
+ "progress-bar",
11
+ "spinner"
12
+ ],
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/vitorazevedo/flexzap-library"
16
+ },
17
+ "author": "flexzap",
18
+ "license": "MIT",
19
+ "homepage": "https://www.flexzap.dev",
20
+ "peerDependencies": {
21
+ "@angular/common": "^20.3.0",
22
+ "@angular/core": "^20.3.0"
23
+ },
24
+ "dependencies": {
25
+ "tslib": "^2.3.0",
26
+ "@flexzap/pipes": "^0.0.3"
27
+ },
28
+ "sideEffects": false,
29
+ "module": "fesm2022/flexzap-misc.mjs",
30
+ "typings": "index.d.ts",
31
+ "exports": {
32
+ "./package.json": {
33
+ "default": "./package.json"
34
+ },
35
+ ".": {
36
+ "types": "./index.d.ts",
37
+ "default": "./fesm2022/flexzap-misc.mjs"
38
+ }
39
+ }
40
+ }