@musti007/my-lib 0.0.2 → 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.
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
class MyLib {
|
|
5
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: MyLib, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.7", type: MyLib, isStandalone: true, selector: "lib-my-lib", ngImport: i0, template: ` <p>my-lib works!</p> `, isInline: true, styles: [""] });
|
|
7
|
-
}
|
|
8
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: MyLib, decorators: [{
|
|
9
|
-
type: Component,
|
|
10
|
-
args: [{ selector: 'lib-my-lib', imports: [], template: ` <p>my-lib works!</p> ` }]
|
|
11
|
-
}] });
|
|
2
|
+
import { signal, Injectable, Pipe, Component } from '@angular/core';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
12
4
|
|
|
13
5
|
class ApiService {
|
|
14
6
|
messageSignal = signal('Please write something in the input field to see the difference.', ...(ngDevMode ? [{ debugName: "messageSignal" }] : /* istanbul ignore next */ []));
|
|
@@ -65,13 +57,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImpor
|
|
|
65
57
|
}]
|
|
66
58
|
}] });
|
|
67
59
|
|
|
68
|
-
class
|
|
69
|
-
|
|
70
|
-
|
|
60
|
+
class InputButtonComponent {
|
|
61
|
+
text = signal('', ...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
62
|
+
setText(value) {
|
|
63
|
+
this.text.set(value);
|
|
64
|
+
}
|
|
65
|
+
submit() {
|
|
66
|
+
console.log('User typed:', this.text());
|
|
67
|
+
}
|
|
68
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: InputButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
69
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.7", type: InputButtonComponent, isStandalone: true, selector: "lib-input-button", ngImport: i0, template: "<input\n type=\"text\"\n [value]=\"text()\"\n (input)=\"setText($any($event.target).value)\"\n placeholder=\"Type something...\"\n/>\n\n<button (click)=\"submit()\">Submit</button>\n\n<p>You typed: {{ text() }}</p>", dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
71
70
|
}
|
|
72
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type:
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: InputButtonComponent, decorators: [{
|
|
73
72
|
type: Component,
|
|
74
|
-
args: [{ selector: '
|
|
73
|
+
args: [{ selector: 'lib-input-button', standalone: true, imports: [CommonModule], template: "<input\n type=\"text\"\n [value]=\"text()\"\n (input)=\"setText($any($event.target).value)\"\n placeholder=\"Type something...\"\n/>\n\n<button (click)=\"submit()\">Submit</button>\n\n<p>You typed: {{ text() }}</p>" }]
|
|
75
74
|
}] });
|
|
76
75
|
|
|
77
76
|
/*
|
|
@@ -82,5 +81,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImpor
|
|
|
82
81
|
* Generated bundle index. Do not edit.
|
|
83
82
|
*/
|
|
84
83
|
|
|
85
|
-
export { ApiService, CapitalizePipe,
|
|
84
|
+
export { ApiService, CapitalizePipe, InputButtonComponent };
|
|
86
85
|
//# sourceMappingURL=musti007-my-lib.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"musti007-my-lib.mjs","sources":["../../../projects/my-lib/src/lib/
|
|
1
|
+
{"version":3,"file":"musti007-my-lib.mjs","sources":["../../../projects/my-lib/src/lib/services/api.service.ts","../../../projects/my-lib/src/lib/pipes/capitalize-pipe.ts","../../../projects/my-lib/src/lib/components/input-button/input-button.ts","../../../projects/my-lib/src/lib/components/input-button/input-button.html","../../../projects/my-lib/src/public-api.ts","../../../projects/my-lib/src/musti007-my-lib.ts"],"sourcesContent":["import { Injectable, signal } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ApiService {\n private messageSignal = signal(\n 'Please write something in the input field to see the difference.',\n );\n\n // getter\n message = this.messageSignal.asReadonly();\n\n // update method\n setMessage(newMessage: string) {\n this.messageSignal.set(newMessage);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'capitalize',\n standalone: true,\n})\nexport class CapitalizePipe implements PipeTransform {\n transform(value: string, mode: 'title' | 'sentence' | 'upper' | 'lower' = 'title'): string {\n if (!value) return '';\n\n switch (mode) {\n // Each word capitalized\n case 'title':\n return value\n .trim()\n .split(/\\s+/)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n\n // Only first letter of sentence\n case 'sentence':\n return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();\n\n // ALL CAPS\n case 'upper':\n return value.toUpperCase();\n\n // all lowercase\n case 'lower':\n return value.toLowerCase();\n\n default:\n console.warn(`CapitalizePipe: unknown mode \"${mode}\"`);\n return value;\n }\n }\n}\n","import { Component, signal } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@Component({\n selector: 'lib-input-button',\n standalone: true,\n imports: [CommonModule],\n templateUrl: './input-button.html',\n})\nexport class InputButtonComponent {\n text = signal('');\n\n setText(value: string) {\n this.text.set(value);\n }\n\n submit() {\n console.log('User typed:', this.text());\n }\n}","<input\n type=\"text\"\n [value]=\"text()\"\n (input)=\"setText($any($event.target).value)\"\n placeholder=\"Type something...\"\n/>\n\n<button (click)=\"submit()\">Submit</button>\n\n<p>You typed: {{ text() }}</p>","/*\n * Public API Surface of my-lib\n */\n\nexport * from './lib/services/api.service';\nexport * from './lib/pipes/capitalize-pipe';\nexport * from './lib/components/input-button/input-button';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAKa,UAAU,CAAA;AACb,IAAA,aAAa,GAAG,MAAM,CAC5B,kEAAkE,oFACnE;;AAGD,IAAA,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE;;AAGzC,IAAA,UAAU,CAAC,UAAkB,EAAA;AAC3B,QAAA,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC;IACpC;uGAXW,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAV,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAU,cAFT,MAAM,EAAA,CAAA;;2FAEP,UAAU,EAAA,UAAA,EAAA,CAAA;kBAHtB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;MCEY,cAAc,CAAA;AACzB,IAAA,SAAS,CAAC,KAAa,EAAE,IAAA,GAAiD,OAAO,EAAA;AAC/E,QAAA,IAAI,CAAC,KAAK;AAAE,YAAA,OAAO,EAAE;QAErB,QAAQ,IAAI;;AAEV,YAAA,KAAK,OAAO;AACV,gBAAA,OAAO;AACJ,qBAAA,IAAI;qBACJ,KAAK,CAAC,KAAK;qBACX,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EA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AAA,EAAA,EAAA,QAAA,ECTjC,4NAS8B,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDHlB,YAAY,EAAA,CAAA,EAAA,CAAA;;2FAGX,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBANhC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,EAAA,UAAA,EAChB,IAAI,EAAA,OAAA,EACP,CAAC,YAAY,CAAC,EAAA,QAAA,EAAA,4NAAA,EAAA;;;AENzB;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { PipeTransform } from '@angular/core';
|
|
3
3
|
|
|
4
|
-
declare class MyLib {
|
|
5
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MyLib, never>;
|
|
6
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MyLib, "lib-my-lib", never, {}, {}, never, never, true, never>;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
4
|
declare class ApiService {
|
|
10
5
|
private messageSignal;
|
|
11
6
|
message: i0.Signal<string>;
|
|
@@ -20,9 +15,12 @@ declare class CapitalizePipe implements PipeTransform {
|
|
|
20
15
|
static ɵpipe: i0.ɵɵPipeDeclaration<CapitalizePipe, "capitalize", true>;
|
|
21
16
|
}
|
|
22
17
|
|
|
23
|
-
declare class
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
declare class InputButtonComponent {
|
|
19
|
+
text: i0.WritableSignal<string>;
|
|
20
|
+
setText(value: string): void;
|
|
21
|
+
submit(): void;
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InputButtonComponent, never>;
|
|
23
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InputButtonComponent, "lib-input-button", never, {}, {}, never, never, true, never>;
|
|
26
24
|
}
|
|
27
25
|
|
|
28
|
-
export { ApiService, CapitalizePipe,
|
|
26
|
+
export { ApiService, CapitalizePipe, InputButtonComponent };
|