ud-components 0.6.0 → 0.6.2
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.
|
@@ -1260,6 +1260,18 @@ class AutocompleteComponent {
|
|
|
1260
1260
|
this.formControl.valueChanges
|
|
1261
1261
|
.pipe(takeUntil(this.destroy$))
|
|
1262
1262
|
.subscribe(value => {
|
|
1263
|
+
// Cleared is a value like any other, and it used to be the one case
|
|
1264
|
+
// this ignored: labelMap has no entry for null, so the guard below fell
|
|
1265
|
+
// through and left the previous selection's text sitting in the box.
|
|
1266
|
+
// A parent that resets the control — because the choice above it
|
|
1267
|
+
// changed and this one no longer applies — got a field that still named
|
|
1268
|
+
// the old answer while holding none.
|
|
1269
|
+
if (value === null || value === undefined || value === '') {
|
|
1270
|
+
if (this.searchControl.value) {
|
|
1271
|
+
this.searchControl.setValue('', { emitEvent: false });
|
|
1272
|
+
}
|
|
1273
|
+
return;
|
|
1274
|
+
}
|
|
1263
1275
|
const label = this.labelMap.get(value);
|
|
1264
1276
|
if (label !== undefined && this.searchControl.value !== label) {
|
|
1265
1277
|
this.searchControl.setValue(label, { emitEvent: false });
|
|
@@ -4823,6 +4835,237 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImpo
|
|
|
4823
4835
|
type: Output
|
|
4824
4836
|
}] } });
|
|
4825
4837
|
|
|
4838
|
+
const en = {
|
|
4839
|
+
actions: {
|
|
4840
|
+
save: 'Save',
|
|
4841
|
+
cancel: 'Cancel',
|
|
4842
|
+
},
|
|
4843
|
+
names: {
|
|
4844
|
+
// Singular | plural, split on the pipe by TranslateWrapperService.
|
|
4845
|
+
action: 'action | actions',
|
|
4846
|
+
of: 'of',
|
|
4847
|
+
phone: 'phone',
|
|
4848
|
+
},
|
|
4849
|
+
table: {
|
|
4850
|
+
filter: 'Filter',
|
|
4851
|
+
sortOnAnyField: 'Sort on any field',
|
|
4852
|
+
operationType: 'Operation type',
|
|
4853
|
+
matchMode: 'Match mode',
|
|
4854
|
+
dateRange: 'Date range',
|
|
4855
|
+
startDate: 'Start date',
|
|
4856
|
+
endDate: 'End date',
|
|
4857
|
+
columns: 'Columns',
|
|
4858
|
+
chooseColumns: 'Choose columns',
|
|
4859
|
+
chooseColumnsLede: "Turn off the columns you don't need. This only changes your view.",
|
|
4860
|
+
columnsShown: '{{shown}} of {{total}} shown',
|
|
4861
|
+
showAllColumns: 'Show all',
|
|
4862
|
+
atLeastOneColumn: 'Keep at least one column visible.',
|
|
4863
|
+
clearFilters: 'Clear filters',
|
|
4864
|
+
roomIsFull: 'This room is full.',
|
|
4865
|
+
},
|
|
4866
|
+
operators: {
|
|
4867
|
+
minimum: 'Minimum',
|
|
4868
|
+
maximum: 'Maximum',
|
|
4869
|
+
// Keyed by NumberOperator; the table builds the key from the enum value.
|
|
4870
|
+
numbers: {
|
|
4871
|
+
EQUAL: 'Equal',
|
|
4872
|
+
NOT_EQUAL: 'Not equal',
|
|
4873
|
+
GREATER_THAN: 'Greater than',
|
|
4874
|
+
GREATER_THAN_OR_EQUAL: 'Greater than or equal',
|
|
4875
|
+
LESS_THAN: 'Less than',
|
|
4876
|
+
LESS_THAN_OR_EQUAL: 'Less than or equal',
|
|
4877
|
+
BETWEEN: 'Between',
|
|
4878
|
+
},
|
|
4879
|
+
// Keyed by the lowercased MultiSelectMatchMode name, not its value.
|
|
4880
|
+
matchModes: {
|
|
4881
|
+
any: 'Any',
|
|
4882
|
+
all: 'All',
|
|
4883
|
+
exact: 'Exact',
|
|
4884
|
+
},
|
|
4885
|
+
},
|
|
4886
|
+
calendar: {
|
|
4887
|
+
today: 'Today',
|
|
4888
|
+
addSlot: 'Add slot',
|
|
4889
|
+
untitledSlot: 'Untitled slot',
|
|
4890
|
+
booked: 'Booked',
|
|
4891
|
+
available: 'Available',
|
|
4892
|
+
views: { day: 'Day', week: 'Week', month: 'Month' },
|
|
4893
|
+
days: {
|
|
4894
|
+
mon: 'Mon',
|
|
4895
|
+
tue: 'Tue',
|
|
4896
|
+
wed: 'Wed',
|
|
4897
|
+
thu: 'Thu',
|
|
4898
|
+
fri: 'Fri',
|
|
4899
|
+
sat: 'Sat',
|
|
4900
|
+
sun: 'Sun',
|
|
4901
|
+
},
|
|
4902
|
+
},
|
|
4903
|
+
fileInput: {
|
|
4904
|
+
orDropHere: 'or drop files here',
|
|
4905
|
+
},
|
|
4906
|
+
messages: {
|
|
4907
|
+
modifyFilter: 'No results match your filter',
|
|
4908
|
+
validation: {
|
|
4909
|
+
validPhoneNumber: 'Please enter a valid phone number.',
|
|
4910
|
+
},
|
|
4911
|
+
},
|
|
4912
|
+
};
|
|
4913
|
+
const fr = {
|
|
4914
|
+
actions: {
|
|
4915
|
+
save: 'enregistrer',
|
|
4916
|
+
cancel: 'annuler',
|
|
4917
|
+
},
|
|
4918
|
+
names: {
|
|
4919
|
+
action: 'action | actions',
|
|
4920
|
+
of: 'de',
|
|
4921
|
+
phone: 'téléphone',
|
|
4922
|
+
},
|
|
4923
|
+
table: {
|
|
4924
|
+
filter: 'Filtrer',
|
|
4925
|
+
sortOnAnyField: "Trier sur n'importe quel champ",
|
|
4926
|
+
operationType: "Type d'opération",
|
|
4927
|
+
matchMode: 'Mode de correspondance',
|
|
4928
|
+
dateRange: 'Plage de dates',
|
|
4929
|
+
startDate: 'Date de début',
|
|
4930
|
+
endDate: 'Date de fin',
|
|
4931
|
+
columns: 'Colonnes',
|
|
4932
|
+
chooseColumns: 'Choisir les colonnes',
|
|
4933
|
+
chooseColumnsLede: "Désactivez les colonnes dont vous n'avez pas besoin. Cela ne change que votre affichage.",
|
|
4934
|
+
columnsShown: '{{shown}} sur {{total}} affichées',
|
|
4935
|
+
showAllColumns: 'Tout afficher',
|
|
4936
|
+
atLeastOneColumn: 'Gardez au moins une colonne visible.',
|
|
4937
|
+
clearFilters: 'Effacer les filtres',
|
|
4938
|
+
roomIsFull: 'Cette chambre est complète.',
|
|
4939
|
+
},
|
|
4940
|
+
operators: {
|
|
4941
|
+
minimum: 'Minimum',
|
|
4942
|
+
maximum: 'Maximum',
|
|
4943
|
+
numbers: {
|
|
4944
|
+
EQUAL: 'Égal',
|
|
4945
|
+
NOT_EQUAL: 'Différent',
|
|
4946
|
+
GREATER_THAN: 'Supérieur à',
|
|
4947
|
+
GREATER_THAN_OR_EQUAL: 'Supérieur ou égal à',
|
|
4948
|
+
LESS_THAN: 'Inférieur à',
|
|
4949
|
+
LESS_THAN_OR_EQUAL: 'Inférieur ou égal à',
|
|
4950
|
+
BETWEEN: 'Entre',
|
|
4951
|
+
},
|
|
4952
|
+
matchModes: {
|
|
4953
|
+
any: 'Au moins un',
|
|
4954
|
+
all: 'Tous',
|
|
4955
|
+
exact: 'Exact',
|
|
4956
|
+
},
|
|
4957
|
+
},
|
|
4958
|
+
calendar: {
|
|
4959
|
+
today: "Aujourd'hui",
|
|
4960
|
+
addSlot: 'Ajouter un créneau',
|
|
4961
|
+
untitledSlot: 'Créneau sans titre',
|
|
4962
|
+
booked: 'Réservé',
|
|
4963
|
+
available: 'Disponible',
|
|
4964
|
+
views: { day: 'Jour', week: 'Semaine', month: 'Mois' },
|
|
4965
|
+
days: {
|
|
4966
|
+
mon: 'Lun',
|
|
4967
|
+
tue: 'Mar',
|
|
4968
|
+
wed: 'Mer',
|
|
4969
|
+
thu: 'Jeu',
|
|
4970
|
+
fri: 'Ven',
|
|
4971
|
+
sat: 'Sam',
|
|
4972
|
+
sun: 'Dim',
|
|
4973
|
+
},
|
|
4974
|
+
},
|
|
4975
|
+
fileInput: {
|
|
4976
|
+
orDropHere: 'ou déposez les fichiers ici',
|
|
4977
|
+
},
|
|
4978
|
+
messages: {
|
|
4979
|
+
modifyFilter: 'Aucun résultat ne correspond à votre filtre',
|
|
4980
|
+
validation: {
|
|
4981
|
+
validPhoneNumber: 'Veuillez entrer un numéro de téléphone valide.',
|
|
4982
|
+
},
|
|
4983
|
+
},
|
|
4984
|
+
};
|
|
4985
|
+
/** Languages the library ships strings for. */
|
|
4986
|
+
const UD_COMPONENTS_TRANSLATIONS = {
|
|
4987
|
+
en,
|
|
4988
|
+
fr,
|
|
4989
|
+
};
|
|
4990
|
+
/**
|
|
4991
|
+
* The library's strings for one language.
|
|
4992
|
+
*
|
|
4993
|
+
* Falls back to the base tag, so `fr-CA` gets the French strings rather than
|
|
4994
|
+
* none. An unknown language returns nothing at all: shipping English under a
|
|
4995
|
+
* label that says otherwise is worse than a visible missing key, because it
|
|
4996
|
+
* looks translated.
|
|
4997
|
+
*/
|
|
4998
|
+
function udComponentsTranslationsFor(lang) {
|
|
4999
|
+
return (UD_COMPONENTS_TRANSLATIONS[lang] ??
|
|
5000
|
+
UD_COMPONENTS_TRANSLATIONS[lang?.split('-')[0]] ??
|
|
5001
|
+
{});
|
|
5002
|
+
}
|
|
5003
|
+
|
|
5004
|
+
/**
|
|
5005
|
+
* Deep merge where the second argument wins.
|
|
5006
|
+
*
|
|
5007
|
+
* Per key, not per namespace: an app that defines `table.filter` must not lose
|
|
5008
|
+
* the other thirteen `table.*` strings the library provides, which is what a
|
|
5009
|
+
* shallow merge of namespaces would do.
|
|
5010
|
+
*/
|
|
5011
|
+
function mergeDeep(base, override) {
|
|
5012
|
+
if (override === null || override === undefined)
|
|
5013
|
+
return base;
|
|
5014
|
+
if (typeof base !== 'object' ||
|
|
5015
|
+
typeof override !== 'object' ||
|
|
5016
|
+
Array.isArray(base) ||
|
|
5017
|
+
Array.isArray(override)) {
|
|
5018
|
+
return override;
|
|
5019
|
+
}
|
|
5020
|
+
const out = { ...base };
|
|
5021
|
+
for (const key of Object.keys(override)) {
|
|
5022
|
+
out[key] = key in base ? mergeDeep(base[key], override[key]) : override[key];
|
|
5023
|
+
}
|
|
5024
|
+
return out;
|
|
5025
|
+
}
|
|
5026
|
+
/**
|
|
5027
|
+
* Wraps a consumer's TranslateLoader so the library's own strings are there
|
|
5028
|
+
* without every app copying them into its en.json.
|
|
5029
|
+
*
|
|
5030
|
+
* Layered rather than merged after the fact: the app's loader is asynchronous,
|
|
5031
|
+
* and racing setTranslation against an HTTP response is how precedence bugs are
|
|
5032
|
+
* born. Here the order is structural — the library is the base, the app's
|
|
5033
|
+
* translations are laid over it — so an app override wins by construction
|
|
5034
|
+
* whenever the app's file happens to arrive.
|
|
5035
|
+
*
|
|
5036
|
+
* The app always wins. `actions.save` and `names.phone` are generic enough that
|
|
5037
|
+
* an app may legitimately want its own wording, and a library that could not be
|
|
5038
|
+
* overridden would be reserving six namespaces across every consumer.
|
|
5039
|
+
*
|
|
5040
|
+
* ```ts
|
|
5041
|
+
* TranslateModule.forRoot({
|
|
5042
|
+
* loader: {
|
|
5043
|
+
* provide: TranslateLoader,
|
|
5044
|
+
* useFactory: (http: HttpClient) =>
|
|
5045
|
+
* withUdComponentsTranslations(new TranslateHttpLoader(http)),
|
|
5046
|
+
* deps: [HttpClient],
|
|
5047
|
+
* },
|
|
5048
|
+
* })
|
|
5049
|
+
* ```
|
|
5050
|
+
*/
|
|
5051
|
+
function withUdComponentsTranslations(appLoader) {
|
|
5052
|
+
return {
|
|
5053
|
+
getTranslation(lang) {
|
|
5054
|
+
const base = udComponentsTranslationsFor(lang);
|
|
5055
|
+
return appLoader.getTranslation(lang).pipe(map(appTranslations => mergeDeep(base, appTranslations ?? {})));
|
|
5056
|
+
},
|
|
5057
|
+
};
|
|
5058
|
+
}
|
|
5059
|
+
/**
|
|
5060
|
+
* For an app with no translation files of its own — the library's strings and
|
|
5061
|
+
* nothing else. Mostly useful in tests and in the explorer.
|
|
5062
|
+
*/
|
|
5063
|
+
function udComponentsOnlyTranslateLoader() {
|
|
5064
|
+
return {
|
|
5065
|
+
getTranslation: (lang) => of(udComponentsTranslationsFor(lang)),
|
|
5066
|
+
};
|
|
5067
|
+
}
|
|
5068
|
+
|
|
4826
5069
|
var FeatureFlagKey;
|
|
4827
5070
|
(function (FeatureFlagKey) {
|
|
4828
5071
|
FeatureFlagKey["ABSENCES"] = "ABSENCES";
|
|
@@ -4907,5 +5150,5 @@ const generateTimeOptions = (start, end, intervalMinutes = 5) => {
|
|
|
4907
5150
|
* Generated bundle index. Do not edit.
|
|
4908
5151
|
*/
|
|
4909
5152
|
|
|
4910
|
-
export { ApplicationStatus, AutocompleteComponent, CalendarComponent, CalendarSlotColor, CapitalizePipe, CarouselComponent, ChipInputComponent, ColumnVisibilityModalComponent, CustomInputComponent, CustomSnackbarComponent, CustomTableComponent, DateInputComponent, DateOperator, DateRangeInputComponent, DynamicComponentComponent, EditViewComponent, EditViewSectionDirective, FeatureFlagKey, FileInputComponent, FilterType, IconColor, KpiComponent, KpiDataType, KpiPillType, KpiProgressBarType, KpiVariant, LoadingStatus, ModalComponent, ModalInputType, MultiSelectComponent, MultiSelectMatchMode, NumberOperator, PhoneInputComponent, PillComponent, PillToggleComponent, PluralizePipe, ProgressBarComponent, SafePipe, SingularPipe, SnackbarType, StringOperator, SummaryViewComponent, TableDisplayColumnType, TabsComponent, TelInputComponent, TextInputComponent, TextareaComponent, TimePickerComponent, ToObservablePipe, ToggleComponent, ToggleOptionComponent, TranslateWrapperService, UdButtonComponent, UdButtonToggleComponent, UdPreviewContainerComponent, UdStepContentDirective, UdStepperComponent, capitalize, formatLocalDate, formatLocalDateTime, formatLocalDateTimeLongForm, formatLocalTime, formatLocalTimeWithMinutes, formatLocalTimeWithMinutesAmPm, formatMonthYear, formatPhoneNumber, formatStringDate, formatStringDateTime, generateTimeOptions, inListValidator, parseLocalDate, pluralize, spaceCase, updateArray, withLoadingState };
|
|
5153
|
+
export { ApplicationStatus, AutocompleteComponent, CalendarComponent, CalendarSlotColor, CapitalizePipe, CarouselComponent, ChipInputComponent, ColumnVisibilityModalComponent, CustomInputComponent, CustomSnackbarComponent, CustomTableComponent, DateInputComponent, DateOperator, DateRangeInputComponent, DynamicComponentComponent, EditViewComponent, EditViewSectionDirective, FeatureFlagKey, FileInputComponent, FilterType, IconColor, KpiComponent, KpiDataType, KpiPillType, KpiProgressBarType, KpiVariant, LoadingStatus, ModalComponent, ModalInputType, MultiSelectComponent, MultiSelectMatchMode, NumberOperator, PhoneInputComponent, PillComponent, PillToggleComponent, PluralizePipe, ProgressBarComponent, SafePipe, SingularPipe, SnackbarType, StringOperator, SummaryViewComponent, TableDisplayColumnType, TabsComponent, TelInputComponent, TextInputComponent, TextareaComponent, TimePickerComponent, ToObservablePipe, ToggleComponent, ToggleOptionComponent, TranslateWrapperService, UD_COMPONENTS_TRANSLATIONS, UdButtonComponent, UdButtonToggleComponent, UdPreviewContainerComponent, UdStepContentDirective, UdStepperComponent, capitalize, formatLocalDate, formatLocalDateTime, formatLocalDateTimeLongForm, formatLocalTime, formatLocalTimeWithMinutes, formatLocalTimeWithMinutesAmPm, formatMonthYear, formatPhoneNumber, formatStringDate, formatStringDateTime, generateTimeOptions, inListValidator, parseLocalDate, pluralize, spaceCase, udComponentsOnlyTranslateLoader, udComponentsTranslationsFor, updateArray, withLoadingState, withUdComponentsTranslations };
|
|
4911
5154
|
//# sourceMappingURL=ud-components.mjs.map
|