@forgeroute/ui 0.0.0-stage → 0.2.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/fesm2022/forgeroute-ui.mjs +195 -0
- package/fesm2022/forgeroute-ui.mjs.map +1 -0
- package/package.json +37 -3
- package/types/forgeroute-ui.d.ts +38 -0
- package/README.md +0 -3
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, inject, input, model, output } from "@angular/core";
|
|
3
|
+
import { Subject } from "rxjs";
|
|
4
|
+
import { debounceTime, distinctUntilChanged } from "rxjs/operators";
|
|
5
|
+
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
6
|
+
var SearchInputComponent = class SearchInputComponent {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.placeholder = input("Search...", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
|
|
9
|
+
this.ariaLabel = input("", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
10
|
+
this.value = model("", ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
11
|
+
this.maxlength = input(200, ...ngDevMode ? [{ debugName: "maxlength" }] : /* istanbul ignore next */ []);
|
|
12
|
+
this.searchChange = output();
|
|
13
|
+
this.input$ = new Subject();
|
|
14
|
+
this.input$.pipe(debounceTime(300), distinctUntilChanged(), takeUntilDestroyed(inject(DestroyRef))).subscribe((val) => this.searchChange.emit(val));
|
|
15
|
+
}
|
|
16
|
+
onInput(val) {
|
|
17
|
+
this.value.set(val);
|
|
18
|
+
this.input$.next(val);
|
|
19
|
+
}
|
|
20
|
+
static {
|
|
21
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
22
|
+
minVersion: "12.0.0",
|
|
23
|
+
version: "22.2.2",
|
|
24
|
+
ngImport: i0,
|
|
25
|
+
type: SearchInputComponent,
|
|
26
|
+
deps: [],
|
|
27
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
static {
|
|
31
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
32
|
+
minVersion: "17.1.0",
|
|
33
|
+
version: "22.2.2",
|
|
34
|
+
type: SearchInputComponent,
|
|
35
|
+
isStandalone: true,
|
|
36
|
+
selector: "ui-search-input",
|
|
37
|
+
inputs: {
|
|
38
|
+
placeholder: {
|
|
39
|
+
classPropertyName: "placeholder",
|
|
40
|
+
publicName: "placeholder",
|
|
41
|
+
isSignal: true,
|
|
42
|
+
isRequired: false,
|
|
43
|
+
transformFunction: null
|
|
44
|
+
},
|
|
45
|
+
ariaLabel: {
|
|
46
|
+
classPropertyName: "ariaLabel",
|
|
47
|
+
publicName: "ariaLabel",
|
|
48
|
+
isSignal: true,
|
|
49
|
+
isRequired: false,
|
|
50
|
+
transformFunction: null
|
|
51
|
+
},
|
|
52
|
+
value: {
|
|
53
|
+
classPropertyName: "value",
|
|
54
|
+
publicName: "value",
|
|
55
|
+
isSignal: true,
|
|
56
|
+
isRequired: false,
|
|
57
|
+
transformFunction: null
|
|
58
|
+
},
|
|
59
|
+
maxlength: {
|
|
60
|
+
classPropertyName: "maxlength",
|
|
61
|
+
publicName: "maxlength",
|
|
62
|
+
isSignal: true,
|
|
63
|
+
isRequired: false,
|
|
64
|
+
transformFunction: null
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
outputs: {
|
|
68
|
+
value: "valueChange",
|
|
69
|
+
searchChange: "searchChange"
|
|
70
|
+
},
|
|
71
|
+
ngImport: i0,
|
|
72
|
+
template: `
|
|
73
|
+
<div class="search-bar" role="search">
|
|
74
|
+
<svg
|
|
75
|
+
class="search-icon"
|
|
76
|
+
aria-hidden="true"
|
|
77
|
+
width="16"
|
|
78
|
+
height="16"
|
|
79
|
+
viewBox="0 0 24 24"
|
|
80
|
+
fill="none"
|
|
81
|
+
stroke="currentColor"
|
|
82
|
+
stroke-width="2"
|
|
83
|
+
stroke-linecap="round"
|
|
84
|
+
stroke-linejoin="round">
|
|
85
|
+
<circle cx="11" cy="11" r="8"/>
|
|
86
|
+
<line x1="21" y1="21" x2="16.65" y2="16.65"/>
|
|
87
|
+
</svg>
|
|
88
|
+
<input
|
|
89
|
+
class="search-input"
|
|
90
|
+
type="search"
|
|
91
|
+
[placeholder]="placeholder()"
|
|
92
|
+
[attr.aria-label]="ariaLabel() || placeholder()"
|
|
93
|
+
[value]="value()"
|
|
94
|
+
(input)="onInput($any($event.target).value)"
|
|
95
|
+
autocomplete="off"
|
|
96
|
+
inputmode="search"
|
|
97
|
+
[attr.maxlength]="maxlength()"
|
|
98
|
+
data-testid="search-input" />
|
|
99
|
+
</div>
|
|
100
|
+
`,
|
|
101
|
+
isInline: true,
|
|
102
|
+
styles: [":host{display:block}.search-bar{position:relative;display:flex;align-items:center}.search-icon{position:absolute;left:10px;color:#94a3b8;pointer-events:none}.search-input{width:100%;padding:8px 10px 8px 34px;border:1px solid #e2e8f0;border-radius:6px;font-size:.875rem;background:#fff;color:#1e293b;outline:none;min-width:380px;font-family:inherit;transition:border-color .15s}.search-input:focus{border-color:#1e293b;box-shadow:0 0 0 3px #1e293b14}.search-input::placeholder{color:#94a3b8}@media(max-width:768px){.search-input{min-width:180px}}@media(max-width:480px){.search-input{min-width:0;width:100%;font-size:16px}}\n"],
|
|
103
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
108
|
+
minVersion: "12.0.0",
|
|
109
|
+
version: "22.2.2",
|
|
110
|
+
ngImport: i0,
|
|
111
|
+
type: SearchInputComponent,
|
|
112
|
+
decorators: [{
|
|
113
|
+
type: Component,
|
|
114
|
+
args: [{
|
|
115
|
+
selector: "ui-search-input",
|
|
116
|
+
standalone: true,
|
|
117
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
118
|
+
template: `
|
|
119
|
+
<div class="search-bar" role="search">
|
|
120
|
+
<svg
|
|
121
|
+
class="search-icon"
|
|
122
|
+
aria-hidden="true"
|
|
123
|
+
width="16"
|
|
124
|
+
height="16"
|
|
125
|
+
viewBox="0 0 24 24"
|
|
126
|
+
fill="none"
|
|
127
|
+
stroke="currentColor"
|
|
128
|
+
stroke-width="2"
|
|
129
|
+
stroke-linecap="round"
|
|
130
|
+
stroke-linejoin="round">
|
|
131
|
+
<circle cx="11" cy="11" r="8"/>
|
|
132
|
+
<line x1="21" y1="21" x2="16.65" y2="16.65"/>
|
|
133
|
+
</svg>
|
|
134
|
+
<input
|
|
135
|
+
class="search-input"
|
|
136
|
+
type="search"
|
|
137
|
+
[placeholder]="placeholder()"
|
|
138
|
+
[attr.aria-label]="ariaLabel() || placeholder()"
|
|
139
|
+
[value]="value()"
|
|
140
|
+
(input)="onInput($any($event.target).value)"
|
|
141
|
+
autocomplete="off"
|
|
142
|
+
inputmode="search"
|
|
143
|
+
[attr.maxlength]="maxlength()"
|
|
144
|
+
data-testid="search-input" />
|
|
145
|
+
</div>
|
|
146
|
+
`,
|
|
147
|
+
styles: [":host{display:block}.search-bar{position:relative;display:flex;align-items:center}.search-icon{position:absolute;left:10px;color:#94a3b8;pointer-events:none}.search-input{width:100%;padding:8px 10px 8px 34px;border:1px solid #e2e8f0;border-radius:6px;font-size:.875rem;background:#fff;color:#1e293b;outline:none;min-width:380px;font-family:inherit;transition:border-color .15s}.search-input:focus{border-color:#1e293b;box-shadow:0 0 0 3px #1e293b14}.search-input::placeholder{color:#94a3b8}@media(max-width:768px){.search-input{min-width:180px}}@media(max-width:480px){.search-input{min-width:0;width:100%;font-size:16px}}\n"]
|
|
148
|
+
}]
|
|
149
|
+
}],
|
|
150
|
+
ctorParameters: () => [],
|
|
151
|
+
propDecorators: {
|
|
152
|
+
placeholder: [{
|
|
153
|
+
type: i0.Input,
|
|
154
|
+
args: [{
|
|
155
|
+
isSignal: true,
|
|
156
|
+
alias: "placeholder",
|
|
157
|
+
required: false
|
|
158
|
+
}]
|
|
159
|
+
}],
|
|
160
|
+
ariaLabel: [{
|
|
161
|
+
type: i0.Input,
|
|
162
|
+
args: [{
|
|
163
|
+
isSignal: true,
|
|
164
|
+
alias: "ariaLabel",
|
|
165
|
+
required: false
|
|
166
|
+
}]
|
|
167
|
+
}],
|
|
168
|
+
value: [{
|
|
169
|
+
type: i0.Input,
|
|
170
|
+
args: [{
|
|
171
|
+
isSignal: true,
|
|
172
|
+
alias: "value",
|
|
173
|
+
required: false
|
|
174
|
+
}]
|
|
175
|
+
}, {
|
|
176
|
+
type: i0.Output,
|
|
177
|
+
args: ["valueChange"]
|
|
178
|
+
}],
|
|
179
|
+
maxlength: [{
|
|
180
|
+
type: i0.Input,
|
|
181
|
+
args: [{
|
|
182
|
+
isSignal: true,
|
|
183
|
+
alias: "maxlength",
|
|
184
|
+
required: false
|
|
185
|
+
}]
|
|
186
|
+
}],
|
|
187
|
+
searchChange: [{
|
|
188
|
+
type: i0.Output,
|
|
189
|
+
args: ["searchChange"]
|
|
190
|
+
}]
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
export { SearchInputComponent };
|
|
194
|
+
|
|
195
|
+
//# sourceMappingURL=forgeroute-ui.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forgeroute-ui.mjs","names":[],"sources":["../../../projects/forgeroute-ui/src/lib/search-input/search-input.component.ts"],"sourcesContent":["import {\n Component, input, output, model,\n ChangeDetectionStrategy, inject, DestroyRef,\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { debounceTime, distinctUntilChanged } from 'rxjs/operators';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\n@Component({\n selector: 'ui-search-input',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div class=\"search-bar\" role=\"search\">\n <svg\n class=\"search-icon\"\n aria-hidden=\"true\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\">\n <circle cx=\"11\" cy=\"11\" r=\"8\"/>\n <line x1=\"21\" y1=\"21\" x2=\"16.65\" y2=\"16.65\"/>\n </svg>\n <input\n class=\"search-input\"\n type=\"search\"\n [placeholder]=\"placeholder()\"\n [attr.aria-label]=\"ariaLabel() || placeholder()\"\n [value]=\"value()\"\n (input)=\"onInput($any($event.target).value)\"\n autocomplete=\"off\"\n inputmode=\"search\"\n [attr.maxlength]=\"maxlength()\"\n data-testid=\"search-input\" />\n </div>\n `,\n styles: [`\n :host { display: block; }\n\n .search-bar {\n position: relative;\n display: flex;\n align-items: center;\n }\n\n .search-icon {\n position: absolute;\n left: 10px;\n color: #94a3b8;\n pointer-events: none;\n }\n\n .search-input {\n width: 100%;\n padding: 8px 10px 8px 34px;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n font-size: 0.875rem;\n background: #fff;\n color: #1e293b;\n outline: none;\n min-width: 380px;\n font-family: inherit;\n transition: border-color 0.15s;\n }\n\n .search-input:focus {\n border-color: #1e293b;\n box-shadow: 0 0 0 3px rgba(30, 41, 59, 0.08);\n }\n\n .search-input::placeholder { color: #94a3b8; }\n\n @media (max-width: 768px) {\n .search-input { min-width: 180px; }\n }\n\n @media (max-width: 480px) {\n .search-input { min-width: 0; width: 100%; font-size: 16px; }\n }\n `],\n})\nexport class SearchInputComponent {\n readonly placeholder = input('Search...');\n readonly ariaLabel = input('');\n readonly value = model('');\n readonly maxlength = input(200);\n\n /** Emits the debounced search value after 300ms of inactivity. Use this to trigger API calls. */\n readonly searchChange = output<string>();\n\n private readonly input$ = new Subject<string>();\n\n constructor() {\n this.input$.pipe(\n debounceTime(300),\n distinctUntilChanged(),\n takeUntilDestroyed(inject(DestroyRef)),\n ).subscribe(val => this.searchChange.emit(val));\n }\n\n onInput(val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AAA,YAAA;KAAA,mBAAA;IAAA;IAAA,WAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;GAAA;GAAA,SAAA;IAAA,OAAA;IAAA,cAAA;GAAA;GAAA,UAAA;GAAA,UA3ErB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BT,UAAA;GAAA,QAAA,CAAA,knBAAA;GAAA,iBAAA,GAAA,wBAAA;EAAA,CAAA;CAAA;;AA+CU,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAoB,YAAA,CAAA;EA/EhC,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAiB,YACf;GAAI,iBACC,wBAAwB;GAAM,UACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BT,QAAA,CAAA,knBAAA;EAAA,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forgeroute/ui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": ">=22.0.0",
|
|
6
|
+
"@angular/core": ">=22.0.0",
|
|
7
|
+
"@angular/forms": ">=22.0.0"
|
|
8
|
+
},
|
|
9
|
+
"peerDependenciesMeta": {
|
|
10
|
+
"@angular/forms": {
|
|
11
|
+
"optional": false
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"angular",
|
|
19
|
+
"ui",
|
|
20
|
+
"components",
|
|
21
|
+
"forgeroute"
|
|
22
|
+
],
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"module": "fesm2022/forgeroute-ui.mjs",
|
|
25
|
+
"typings": "types/forgeroute-ui.d.ts",
|
|
26
|
+
"exports": {
|
|
27
|
+
"./package.json": {
|
|
28
|
+
"default": "./package.json"
|
|
29
|
+
},
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./types/forgeroute-ui.d.ts",
|
|
32
|
+
"default": "./fesm2022/forgeroute-ui.mjs"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"sideEffects": false,
|
|
36
|
+
"type": "module",
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"tslib": "^2.3.0"
|
|
39
|
+
}
|
|
6
40
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class SearchInputComponent {
|
|
3
|
+
readonly placeholder: import("@angular/core").InputSignal<string>;
|
|
4
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string>;
|
|
5
|
+
readonly value: import("@angular/core").ModelSignal<string>;
|
|
6
|
+
readonly maxlength: import("@angular/core").InputSignal<number>;
|
|
7
|
+
/** Emits the debounced search value after 300ms of inactivity. Use this to trigger API calls. */
|
|
8
|
+
readonly searchChange: import("@angular/core").OutputEmitterRef<string>;
|
|
9
|
+
private readonly input$;
|
|
10
|
+
constructor();
|
|
11
|
+
onInput(val: string): void;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SearchInputComponent, never>;
|
|
13
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SearchInputComponent, "ui-search-input", never, {
|
|
14
|
+
"placeholder": {
|
|
15
|
+
"alias": "placeholder";
|
|
16
|
+
"required": false;
|
|
17
|
+
"isSignal": true;
|
|
18
|
+
};
|
|
19
|
+
"ariaLabel": {
|
|
20
|
+
"alias": "ariaLabel";
|
|
21
|
+
"required": false;
|
|
22
|
+
"isSignal": true;
|
|
23
|
+
};
|
|
24
|
+
"value": {
|
|
25
|
+
"alias": "value";
|
|
26
|
+
"required": false;
|
|
27
|
+
"isSignal": true;
|
|
28
|
+
};
|
|
29
|
+
"maxlength": {
|
|
30
|
+
"alias": "maxlength";
|
|
31
|
+
"required": false;
|
|
32
|
+
"isSignal": true;
|
|
33
|
+
};
|
|
34
|
+
}, {
|
|
35
|
+
"value": "valueChange";
|
|
36
|
+
"searchChange": "searchChange";
|
|
37
|
+
}, never, never, true, never>;
|
|
38
|
+
}
|
package/README.md
DELETED