@rivinia/i18n 0.7.2 → 1.0.0-rc.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/CHANGELOG.md +130 -1
- package/README.md +121 -1191
- package/fesm2022/rivinia-i18n-select.mjs +391 -0
- package/fesm2022/rivinia-i18n-select.mjs.map +1 -0
- package/fesm2022/rivinia-i18n-ui.mjs +2 -2
- package/fesm2022/rivinia-i18n-ui.mjs.map +1 -1
- package/package.json +10 -2
- package/types/rivinia-i18n-select.d.ts +149 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { LanguageLike, LanguageLike as LanguageLike$1, RiviniaLanguageManager, RiviniaLanguageManager as RiviniaLanguageManager$1 } from "@rivinia/i18n/ui";
|
|
2
|
+
import { RiviniaSelectVariant, SelectChange } from "@rivinia/select/ui";
|
|
3
|
+
import { RiviniaSelectOption } from "@rivinia/select";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* A select option for one language. `RiviniaSelectOption` already carries the
|
|
7
|
+
* `id` (the language id) and the visible `label`; the extra fields exist so a
|
|
8
|
+
* custom row can put `lang`/`dir` on the name instead of inheriting the page's.
|
|
9
|
+
*/
|
|
10
|
+
interface LanguageSelectOption extends RiviniaSelectOption {
|
|
11
|
+
/** The language id, repeated as the row's `lang`. */
|
|
12
|
+
readonly lang: string;
|
|
13
|
+
/** The language direction, when the source entry declares one. */
|
|
14
|
+
readonly dir?: LanguageLike$1['dir'];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Multi-language picker: `rv-select` with every language as one row.
|
|
18
|
+
*
|
|
19
|
+
* The i18n core and `/ui` entry point do not know this component exists. It is
|
|
20
|
+
* the only chunk that imports `@rivinia/select/ui`, which is why the peer stays
|
|
21
|
+
* optional for consumers that never import `@rivinia/i18n/select`.
|
|
22
|
+
*
|
|
23
|
+
* ```html
|
|
24
|
+
* <rv-language-select [manager]="i18n" label="Language" />
|
|
25
|
+
* <rv-language-select [languages]="languages" [current]="current()" (languageChange)="set($event)" />
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* Managed mode wins over `[languages]` / `[current]` / `[busy]`. The event is
|
|
29
|
+
* emitted only after `setLanguageAsync` confirms the id, matching the toggle's
|
|
30
|
+
* contract; a manager that leaves the language unchanged emits nothing and the
|
|
31
|
+
* trigger returns to the real current language.
|
|
32
|
+
*/
|
|
33
|
+
export declare class RiviniaLanguageSelect {
|
|
34
|
+
readonly manager: import("@angular/core").InputSignal<RiviniaLanguageManager$1 | undefined>;
|
|
35
|
+
readonly languages: import("@angular/core").InputSignal<readonly LanguageLike$1[]>;
|
|
36
|
+
readonly current: import("@angular/core").InputSignal<string | undefined>;
|
|
37
|
+
readonly label: import("@angular/core").InputSignal<string | null>;
|
|
38
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string | null>;
|
|
39
|
+
readonly popupLabel: import("@angular/core").InputSignal<string | null>;
|
|
40
|
+
readonly placeholder: import("@angular/core").InputSignal<string>;
|
|
41
|
+
readonly searchable: import("@angular/core").InputSignal<boolean>;
|
|
42
|
+
readonly searchLabel: import("@angular/core").InputSignal<string>;
|
|
43
|
+
readonly searchPlaceholder: import("@angular/core").InputSignal<string>;
|
|
44
|
+
readonly emptyLabel: import("@angular/core").InputSignal<string>;
|
|
45
|
+
readonly variant: import("@angular/core").InputSignal<RiviniaSelectVariant>;
|
|
46
|
+
readonly disabled: import("@angular/core").InputSignal<boolean>;
|
|
47
|
+
readonly busy: import("@angular/core").InputSignal<boolean>;
|
|
48
|
+
readonly languageChange: import("@angular/core").OutputEmitterRef<string>;
|
|
49
|
+
protected readonly sourceLanguages: import("@angular/core").Signal<readonly LanguageLike$1[]>;
|
|
50
|
+
protected readonly options: import("@angular/core").Signal<readonly LanguageSelectOption[]>;
|
|
51
|
+
protected readonly currentId: import("@angular/core").Signal<string>;
|
|
52
|
+
protected readonly isBusy: import("@angular/core").Signal<boolean>;
|
|
53
|
+
protected readonly isDisabled: import("@angular/core").Signal<boolean>;
|
|
54
|
+
protected readonly panelLabel: import("@angular/core").Signal<string | null>;
|
|
55
|
+
/**
|
|
56
|
+
* The select's single value. Linked to the current language, but writable so
|
|
57
|
+
* a pick paints immediately while a managed switch is in flight. When the
|
|
58
|
+
* manager confirms (or refuses), the linked computation re-syncs it.
|
|
59
|
+
*/
|
|
60
|
+
protected readonly selected: import("@angular/core").WritableSignal<SelectChange>;
|
|
61
|
+
/** Discards the confirmation of a switch that a later pick superseded. */
|
|
62
|
+
private request;
|
|
63
|
+
protected onSelectionChange(value: SelectChange): void;
|
|
64
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RiviniaLanguageSelect, never>;
|
|
65
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RiviniaLanguageSelect, "rv-language-select", never, {
|
|
66
|
+
"manager": {
|
|
67
|
+
"alias": "manager";
|
|
68
|
+
"required": false;
|
|
69
|
+
"isSignal": true;
|
|
70
|
+
};
|
|
71
|
+
"languages": {
|
|
72
|
+
"alias": "languages";
|
|
73
|
+
"required": false;
|
|
74
|
+
"isSignal": true;
|
|
75
|
+
};
|
|
76
|
+
"current": {
|
|
77
|
+
"alias": "current";
|
|
78
|
+
"required": false;
|
|
79
|
+
"isSignal": true;
|
|
80
|
+
};
|
|
81
|
+
"label": {
|
|
82
|
+
"alias": "label";
|
|
83
|
+
"required": false;
|
|
84
|
+
"isSignal": true;
|
|
85
|
+
};
|
|
86
|
+
"ariaLabel": {
|
|
87
|
+
"alias": "ariaLabel";
|
|
88
|
+
"required": false;
|
|
89
|
+
"isSignal": true;
|
|
90
|
+
};
|
|
91
|
+
"popupLabel": {
|
|
92
|
+
"alias": "popupLabel";
|
|
93
|
+
"required": false;
|
|
94
|
+
"isSignal": true;
|
|
95
|
+
};
|
|
96
|
+
"placeholder": {
|
|
97
|
+
"alias": "placeholder";
|
|
98
|
+
"required": false;
|
|
99
|
+
"isSignal": true;
|
|
100
|
+
};
|
|
101
|
+
"searchable": {
|
|
102
|
+
"alias": "searchable";
|
|
103
|
+
"required": false;
|
|
104
|
+
"isSignal": true;
|
|
105
|
+
};
|
|
106
|
+
"searchLabel": {
|
|
107
|
+
"alias": "searchLabel";
|
|
108
|
+
"required": false;
|
|
109
|
+
"isSignal": true;
|
|
110
|
+
};
|
|
111
|
+
"searchPlaceholder": {
|
|
112
|
+
"alias": "searchPlaceholder";
|
|
113
|
+
"required": false;
|
|
114
|
+
"isSignal": true;
|
|
115
|
+
};
|
|
116
|
+
"emptyLabel": {
|
|
117
|
+
"alias": "emptyLabel";
|
|
118
|
+
"required": false;
|
|
119
|
+
"isSignal": true;
|
|
120
|
+
};
|
|
121
|
+
"variant": {
|
|
122
|
+
"alias": "variant";
|
|
123
|
+
"required": false;
|
|
124
|
+
"isSignal": true;
|
|
125
|
+
};
|
|
126
|
+
"disabled": {
|
|
127
|
+
"alias": "disabled";
|
|
128
|
+
"required": false;
|
|
129
|
+
"isSignal": true;
|
|
130
|
+
};
|
|
131
|
+
"busy": {
|
|
132
|
+
"alias": "busy";
|
|
133
|
+
"required": false;
|
|
134
|
+
"isSignal": true;
|
|
135
|
+
};
|
|
136
|
+
}, {
|
|
137
|
+
"languageChange": "languageChange";
|
|
138
|
+
}, never, never, true, never>;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Map languages to `rv-select` options, in the order given.
|
|
142
|
+
*
|
|
143
|
+
* The visible name follows the same rule as the `/ui` toggle
|
|
144
|
+
* (`nativeName` → `Intl.DisplayNames` → id). The id is repeated as `lang`, and
|
|
145
|
+
* as a `hint` only when it adds information — a row whose label already is
|
|
146
|
+
* the id would otherwise print the same text twice.
|
|
147
|
+
*/
|
|
148
|
+
export declare function languageSelectOptions(languages: readonly LanguageLike$1[]): readonly LanguageSelectOption[];
|
|
149
|
+
export type { LanguageLike, LanguageSelectOption, RiviniaLanguageManager };
|