@neural-ui/native 0.1.0-beta.6 → 0.1.0-beta.7
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 +5 -5
- package/dist/input-mask/input-mask.d.ts +2 -0
- package/dist/input-mask/input-mask.js +7 -1
- package/dist/input-mask/input-mask.js.map +1 -1
- package/dist/input-tags/input-tags.d.ts +2 -0
- package/dist/input-tags/input-tags.js +7 -2
- package/dist/input-tags/input-tags.js.map +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Neural Native brings the Neural visual language to [Angular Native](https://ng-native.com): 64 mobile component entries, Angular signals, typed APIs, shared themes and modular imports.
|
|
6
6
|
|
|
7
|
-
**Public beta: `0.1.0-beta.
|
|
7
|
+
**Public beta: `0.1.0-beta.7`.** APIs and framework compatibility may change before 1.0. Pin the version in your application lockfile and check compatibility before updating Angular Native.
|
|
8
8
|
|
|
9
9
|
## Documentation
|
|
10
10
|
|
|
@@ -18,18 +18,18 @@ Neural Native brings the Neural visual language to [Angular Native](https://ng-n
|
|
|
18
18
|
Start with the compatible Angular Native template:
|
|
19
19
|
|
|
20
20
|
```sh
|
|
21
|
-
npx create-expo-app@latest my-neural-app --template @ng-native/template@0.
|
|
21
|
+
npx create-expo-app@latest my-neural-app --template @ng-native/template@0.22.2
|
|
22
22
|
cd my-neural-app
|
|
23
23
|
npm install @neural-ui/native@beta
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
In an existing Angular Native 0.
|
|
26
|
+
In an existing Angular Native 0.22.2 application, run only the last command. The beta is published under the npm `beta` tag; `@beta` is intentional. Applications on Angular Native 0.21.0 should keep Neural Native 0.1.0-beta.6. Applications on Angular Native 0.19.2 should keep Neural Native 0.1.0-beta.5. Applications on Angular Native 0.18.2 should keep Neural Native 0.1.0-beta.2 until they update the framework.
|
|
27
27
|
|
|
28
28
|
### Compatibility
|
|
29
29
|
|
|
30
30
|
| Dependency | This beta |
|
|
31
31
|
| --- | --- |
|
|
32
|
-
| Angular Native packages | 0.
|
|
32
|
+
| Angular Native packages | 0.22.2 |
|
|
33
33
|
| Angular | 22.2.2 tested; peers >=22.2.0 <23 |
|
|
34
34
|
| Expo / React Native | 57.0.27 / 0.86.3 tested application baseline |
|
|
35
35
|
| Current framework template | Expo 58.0.16 / React Native 0.88.0: consumer tests and iOS/Android bundles verified |
|
|
@@ -180,7 +180,7 @@ Neural Native is maintained by Pedro Moreno Trujillo and shares its visual ident
|
|
|
180
180
|
|
|
181
181
|
## Español
|
|
182
182
|
|
|
183
|
-
Neural Native ofrece componentes Angular nativos para iOS y Android. Esta beta.
|
|
183
|
+
Neural Native ofrece componentes Angular nativos para iOS y Android. Esta beta.7 se instala con `npm install @neural-ui/native@beta` sobre una aplicación Angular Native 0.22.2. Para Angular Native 0.21.0, conserva beta.6. Si tu aplicación utiliza Angular Native 0.19.2, conserva beta.5; para Angular Native 0.18.2, conserva Neural Native 0.1.0-beta.2 hasta actualizar el framework. Los controles utilizan signals, un tema compartido e imports modulares; tu aplicación conserva el estado y decide cómo guardar los datos. Desde beta.5 puedes activar la respuesta háptica opcional, silenciar controles concretos y cambiar esa preferencia durante la ejecución.
|
|
184
184
|
|
|
185
185
|
## License
|
|
186
186
|
|
|
@@ -5,6 +5,8 @@ export declare function formatMask(value: string, mask: string): {
|
|
|
5
5
|
display: string;
|
|
6
6
|
};
|
|
7
7
|
export declare class NeuInputMaskComponent extends NeuTextControl {
|
|
8
|
+
private readonly theme;
|
|
9
|
+
protected readonly mutedColor: import("@angular/core").Signal<string>;
|
|
8
10
|
readonly mask: import("@angular/core").InputSignal<string>;
|
|
9
11
|
readonly keyboardType: import("@angular/core").InputSignal<"default" | "numeric" | "phone-pad">;
|
|
10
12
|
protected readonly maskGuide: import("@angular/core").Signal<string>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Component, input, computed, } from '@angular/core';
|
|
1
|
+
import { Component, input, computed, inject, } from '@angular/core';
|
|
2
2
|
import { View, Text } from '@ng-native/components';
|
|
3
3
|
import { NeuNativeTextInput as TextInput } from '../foundation/native-text-input.js';
|
|
4
4
|
import { NeuTextControl } from '../foundation/mobile.js';
|
|
5
|
+
import { NEU_LIGHT_TOKENS, NEU_THEME } from '../foundation/index.js';
|
|
5
6
|
import { NeuNativeTextSyncDirective } from '../foundation/native-text-sync.js';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
8
|
export function formatMask(value, mask) {
|
|
@@ -33,6 +34,9 @@ export function formatMask(value, mask) {
|
|
|
33
34
|
return { raw, display };
|
|
34
35
|
}
|
|
35
36
|
export class NeuInputMaskComponent extends NeuTextControl {
|
|
37
|
+
theme = inject(NEU_THEME, { optional: true });
|
|
38
|
+
mutedColor = computed(() => (this.theme?.() ?? NEU_LIGHT_TOKENS).muted, /* @ts-ignore */
|
|
39
|
+
...(ngDevMode ? [{ debugName: "mutedColor" }] : /* istanbul ignore next */ []));
|
|
36
40
|
mask = input.required(/* @ts-ignore */
|
|
37
41
|
...(ngDevMode ? [{ debugName: "mask" }] : /* istanbul ignore next */ []));
|
|
38
42
|
keyboardType = input('default', /* @ts-ignore */
|
|
@@ -54,6 +58,7 @@ export class NeuInputMaskComponent extends NeuTextControl {
|
|
|
54
58
|
class="control"
|
|
55
59
|
[neuralValue]="formatted()"
|
|
56
60
|
[placeholder]="maskGuide()"
|
|
61
|
+
[placeholderTextColor]="mutedColor()"
|
|
57
62
|
[accessibilityLabel]="label()"
|
|
58
63
|
[accessibilityLabelledBy]="label() ? labelNativeId : undefined"
|
|
59
64
|
[accessibilityHint]="fieldHint()"
|
|
@@ -84,6 +89,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImpor
|
|
|
84
89
|
class="control"
|
|
85
90
|
[neuralValue]="formatted()"
|
|
86
91
|
[placeholder]="maskGuide()"
|
|
92
|
+
[placeholderTextColor]="mutedColor()"
|
|
87
93
|
[accessibilityLabel]="label()"
|
|
88
94
|
[accessibilityLabelledBy]="label() ? labelNativeId : undefined"
|
|
89
95
|
[accessibilityHint]="fieldHint()"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-mask.js","sourceRoot":"","sources":["../../src/input-mask/input-mask.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"input-mask.js","sourceRoot":"","sources":["../../src/input-mask/input-mask.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,QAAQ,EACR,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AA+BrE,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;;AA7B/E,MAAM,UAAU,UAAU,CACxB,KAAa,EACb,IAAY;IAEZ,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/B,IAAI,GAAG,GAAG,EAAE,EACV,OAAO,GAAG,EAAE,CAAC;IACf,KAAK,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC;QACzB,MAAM,OAAO,GACX,KAAK,KAAK,GAAG;YACX,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,KAAK,KAAK,GAAG;gBACb,CAAC,CAAC,UAAU;gBACZ,CAAC,CAAC,KAAK,KAAK,GAAG;oBACb,CAAC,CAAC,aAAa;oBACf,CAAC,CAAC,IAAI,CAAC;QACf,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,K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C,GAAG,CAAC,CAAC;IAClD,CAAC;uGAbU,qBAAqB;2FAArB,qBAAqB,8WA9BtB;;;;;;;;;;;;;;;;;;;;;;;;;;;UA2BF,gqIA5BE,0BAA0B,+FAAE,IAAI,iDAAE,IAAI,mYAAE,SAAS;;2FA+BhD,qBAAqB;kBAjCjC,SAAS;+BACE,gBAAgB,WACjB,CAAC,0BAA0B,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,YAClD;;;;;;;;;;;;;;;;;;;;;;;;;;;UA2BF","sourcesContent":["import {\n Component,\n input,\n computed,\n inject,\n} from '@angular/core';\nimport { View, Text } from '@ng-native/components';\nimport { NeuNativeTextInput as TextInput } from '../foundation/native-text-input.js';\nimport { NeuTextControl } from '../foundation/mobile.js';\nimport { NEU_LIGHT_TOKENS, NEU_THEME } from '../foundation/index.js';\n\nexport function formatMask(\n value: string,\n mask: string,\n): { raw: string; display: string } {\n const rest = Array.from(value);\n let raw = '',\n display = '';\n for (const token of mask) {\n const pattern =\n token === '#'\n ? /[0-9]/\n : token === 'A'\n ? /[a-zA-Z]/\n : token === '*'\n ? /[a-zA-Z0-9]/\n : null;\n if (!pattern) {\n if (rest[0] === token) rest.shift();\n if (rest.length) display += token;\n continue;\n }\n let char = rest.shift();\n while (char !== undefined && !pattern.test(char)) char = rest.shift();\n if (char === undefined) break;\n raw += char;\n display += char;\n }\n return { raw, display };\n}\nimport { NeuNativeTextSyncDirective } from '../foundation/native-text-sync.js';\n\n@Component({\n selector: 'neu-input-mask',\n imports: [NeuNativeTextSyncDirective, View, Text, TextInput],\n template: `<view class=\"stack\"\n ><text class=\"label\" [nativeID]=\"labelNativeId\">{{ label() }}</text\n ><text-input\n neuSyncText\n #textSync=\"neuSyncText\"\n (changeText)=\"textSync.synchronize()\"\n class=\"control\"\n [neuralValue]=\"formatted()\"\n [placeholder]=\"maskGuide()\"\n [placeholderTextColor]=\"mutedColor()\"\n [accessibilityLabel]=\"label()\"\n [accessibilityLabelledBy]=\"label() ? labelNativeId : undefined\"\n [accessibilityHint]=\"fieldHint()\"\n [attr.aria-required]=\"required() ? 'true' : null\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [invalid]=\"invalid()\"\n [touched]=\"touched()\"\n [keyboardType]=\"keyboardType()\"\n (neuralValueChange)=\"edit($event)\"\n (touch)=\"touch.emit()\"\n />\n @if (invalid() && error()) {\n <text class=\"error\" accessibilityRole=\"alert\">{{ error() }}</text>\n } @else {\n <text class=\"muted\">{{ hint() }}</text>\n }\n </view>`,\n styleUrl: '../foundation/mobile.css',\n})\nexport class NeuInputMaskComponent extends NeuTextControl {\n private readonly theme = inject(NEU_THEME, { optional: true });\n protected readonly mutedColor = computed(\n () => (this.theme?.() ?? NEU_LIGHT_TOKENS).muted,\n );\n readonly mask = input.required<string>();\n readonly keyboardType = input<'default' | 'numeric' | 'phone-pad'>('default');\n protected readonly maskGuide = computed(() => this.mask().replace(/[#A*]/g, '_'));\n protected readonly formatted = computed(\n () => formatMask(this.value(), this.mask()).display,\n );\n protected edit(value: string): void {\n this.accept(formatMask(value, this.mask()).raw);\n }\n}\n"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
export declare class NeuInputTagsComponent {
|
|
3
|
+
private readonly theme;
|
|
4
|
+
protected readonly mutedColor: import("@angular/core").Signal<string>;
|
|
3
5
|
protected readonly plus = "<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"><path d=\"M12 5v14M5 12h14\"/></svg>";
|
|
4
6
|
readonly label: import("@angular/core").InputSignal<string>;
|
|
5
7
|
readonly value: import("@angular/core").ModelSignal<readonly string[]>;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { booleanAttribute, Component, input, model, output, signal, } from '@angular/core';
|
|
1
|
+
import { booleanAttribute, Component, computed, inject, input, model, output, signal, } from '@angular/core';
|
|
2
2
|
import { View, Text } from '@ng-native/components';
|
|
3
3
|
import { NeuNativeTextInput as TextInput } from '../foundation/native-text-input.js';
|
|
4
4
|
import { NeuIconButtonComponent } from '../icon-button/icon-button.js';
|
|
5
5
|
import { NeuChipComponent } from '../chip/chip.js';
|
|
6
|
-
import { NEU_PLUS_ICON } from '../foundation/index.js';
|
|
6
|
+
import { NEU_LIGHT_TOKENS, NEU_PLUS_ICON, NEU_THEME } from '../foundation/index.js';
|
|
7
7
|
import { NeuNativeTextSyncDirective } from '../foundation/native-text-sync.js';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
export class NeuInputTagsComponent {
|
|
10
|
+
theme = inject(NEU_THEME, { optional: true });
|
|
11
|
+
mutedColor = computed(() => (this.theme?.() ?? NEU_LIGHT_TOKENS).muted, /* @ts-ignore */
|
|
12
|
+
...(ngDevMode ? [{ debugName: "mutedColor" }] : /* istanbul ignore next */ []));
|
|
10
13
|
plus = NEU_PLUS_ICON;
|
|
11
14
|
label = input.required(/* @ts-ignore */
|
|
12
15
|
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
@@ -61,6 +64,7 @@ export class NeuInputTagsComponent {
|
|
|
61
64
|
(neuralValueChange)="draft.set($event)"
|
|
62
65
|
[accessibilityLabel]="label()"
|
|
63
66
|
[placeholder]="placeholder()"
|
|
67
|
+
[placeholderTextColor]="mutedColor()"
|
|
64
68
|
[disabled]="disabled()"
|
|
65
69
|
[readonly]="readonly()"
|
|
66
70
|
(submitEditing)="add()" /><neu-icon-button
|
|
@@ -112,6 +116,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.2", ngImpor
|
|
|
112
116
|
(neuralValueChange)="draft.set($event)"
|
|
113
117
|
[accessibilityLabel]="label()"
|
|
114
118
|
[placeholder]="placeholder()"
|
|
119
|
+
[placeholderTextColor]="mutedColor()"
|
|
115
120
|
[disabled]="disabled()"
|
|
116
121
|
[readonly]="readonly()"
|
|
117
122
|
(submitEditing)="add()" /><neu-icon-button
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-tags.js","sourceRoot":"","sources":["../../src/input-tags/input-tags.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"input-tags.js","sourceRoot":"","sources":["../../src/input-tags/input-tags.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,MAAM,EACN,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEpF,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;;AA8D/E,MAAM,OAAO,qBAAqB;IACf,KAAK,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C,UAAU,GAAG,QAAQ,CACtC,GAAG,EAAE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AAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;QACvC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACnB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACrB,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC;IACS,MAAM,CAAC,GAAW;QAC1B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;YACzC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YACrD,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;uGAnCU,qBAAqB;2FAArB,qBAAqB,ioCAlDtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAyCF,04IAhDN,0BAA0B,+FAC1B,IAAI,iDACJ,IAAI,mYACJ,SAAS,mIACT,gBAAgB,0LAChB,sBAAsB;;2FAoDb,qBAAqB;kBA5DjC,SAAS;+BACE,gBAAgB,WACjB;wBACP,0BAA0B;wBAC1B,IAAI;wBACJ,IAAI;wBACJ,SAAS;wBACT,gBAAgB;wBAChB,sBAAsB;qBACvB,YACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAyCF","sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { View, Text } from '@ng-native/components';\nimport { NeuNativeTextInput as TextInput } from '../foundation/native-text-input.js';\nimport { NeuIconButtonComponent } from '../icon-button/icon-button.js';\nimport { NeuChipComponent } from '../chip/chip.js';\nimport { NEU_LIGHT_TOKENS, NEU_PLUS_ICON, NEU_THEME } from '../foundation/index.js';\n\nimport { NeuNativeTextSyncDirective } from '../foundation/native-text-sync.js';\n\n@Component({\n selector: 'neu-input-tags',\n imports: [\n NeuNativeTextSyncDirective,\n View,\n Text,\n TextInput,\n NeuChipComponent,\n NeuIconButtonComponent,\n ],\n template: `<view class=\"stack\"\n ><text class=\"label\">{{ label() }}</text\n >@if (!readonly()) { <view class=\"tag-editor\"\n ><text-input\n neuSyncText\n #textSync=\"neuSyncText\"\n (changeText)=\"textSync.synchronize()\"\n class=\"control grow tag-entry\"\n [neuralValue]=\"draft()\"\n (neuralValueChange)=\"draft.set($event)\"\n [accessibilityLabel]=\"label()\"\n [placeholder]=\"placeholder()\"\n [placeholderTextColor]=\"mutedColor()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (submitEditing)=\"add()\" /><neu-icon-button\n [svg]=\"plus\"\n variant=\"tonal\"\n [label]=\"addLabel()\"\n [disabled]=\"\n disabled() || readonly() || !draft().trim() || value().length >= max()\n \"\n (pressed)=\"add()\"\n /></view> }\n @if (message()) {\n <text class=\"error\" accessibilityRole=\"alert\">{{ message() }}</text>\n }\n @if (value().length) {\n <view class=\"tag-list\">\n @for (tag of value(); track tag) {\n <neu-chip\n [label]=\"tag\"\n [selectable]=\"false\"\n [removable]=\"!readonly()\"\n [disabled]=\"disabled()\"\n [removeLabel]=\"removeLabel()\"\n (removed)=\"remove(tag)\"\n />\n }\n </view>\n }\n </view>`,\n styleUrl: '../foundation/mobile.css',\n styles: `\n .label { font-weight: 500; }\n .tag-editor { flex-direction: row; align-items: center; gap: 8px; }\n .tag-entry { min-height: 48px; min-width: 0; }\n .tag-list { flex-direction: row; flex-wrap: wrap; gap: 8px; }\n `,\n})\nexport class NeuInputTagsComponent {\n private readonly theme = inject(NEU_THEME, { optional: true });\n protected readonly mutedColor = computed(\n () => (this.theme?.() ?? NEU_LIGHT_TOKENS).muted,\n );\n protected readonly plus = NEU_PLUS_ICON;\n readonly label = input.required<string>();\n readonly value = model<readonly string[]>([]);\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly readonly = input(false, { transform: booleanAttribute });\n readonly max = input(20);\n readonly addLabel = input('Add');\n readonly placeholder = input('');\n readonly removeLabel = input('Remove');\n readonly touch = output<void>();\n protected readonly draft = signal('');\n protected readonly message = signal('');\n protected add(): void {\n if (this.disabled() || this.readonly()) return;\n const text = this.draft().trim();\n if (!text || this.value().length >= this.max()) return;\n if (this.value().includes(text)) {\n this.message.set('Duplicate: ' + text);\n return;\n }\n this.value.update((x) => [...x, text]);\n this.draft.set('');\n this.message.set('');\n this.touch.emit();\n }\n protected remove(tag: string): void {\n if (!this.disabled() && !this.readonly()) {\n this.value.update((x) => x.filter((t) => t !== tag));\n this.touch.emit();\n }\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neural-ui/native",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Signals-first native Angular components for iOS and Android.",
|
|
@@ -291,10 +291,10 @@
|
|
|
291
291
|
"peerDependencies": {
|
|
292
292
|
"@angular/common": ">=22.2.0 <23",
|
|
293
293
|
"@angular/core": ">=22.2.0 <23",
|
|
294
|
-
"@ng-native/components": "0.
|
|
295
|
-
"@ng-native/device": "0.
|
|
296
|
-
"@ng-native/fabric": "0.
|
|
297
|
-
"@ng-native/icons": "0.
|
|
294
|
+
"@ng-native/components": "0.22.2",
|
|
295
|
+
"@ng-native/device": "0.22.2",
|
|
296
|
+
"@ng-native/fabric": "0.22.2",
|
|
297
|
+
"@ng-native/icons": "0.22.2",
|
|
298
298
|
"expo-haptics": "^57.0.0 || ^58.0.0",
|
|
299
299
|
"expo-modules-core": "^57.0.0 || ^58.0.0",
|
|
300
300
|
"react-native-svg": "15.15.4"
|
|
@@ -314,7 +314,7 @@
|
|
|
314
314
|
"devDependencies": {
|
|
315
315
|
"@angular/compiler-cli": "22.2.2",
|
|
316
316
|
"@babel/core": "7.29.7",
|
|
317
|
-
"@ng-native/testing": "0.
|
|
317
|
+
"@ng-native/testing": "0.22.2",
|
|
318
318
|
"@vitest/coverage-v8": "5.0.3",
|
|
319
319
|
"expo-haptics": "57.0.3",
|
|
320
320
|
"vitest": "5.0.3"
|