commons-shared-web-ui 0.0.16 → 0.0.17
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.
|
@@ -3687,6 +3687,9 @@ class SmartFormTranslationUtils {
|
|
|
3687
3687
|
field.placeholder = translate(field.placeholder);
|
|
3688
3688
|
if (field.hint)
|
|
3689
3689
|
field.hint = translate(field.hint);
|
|
3690
|
+
if (field.richTextConfig?.placeholder) {
|
|
3691
|
+
field.richTextConfig.placeholder = translate(field.richTextConfig.placeholder);
|
|
3692
|
+
}
|
|
3690
3693
|
if (field.textConfig?.patternMessage) {
|
|
3691
3694
|
field.textConfig.patternMessage = translate(field.textConfig.patternMessage);
|
|
3692
3695
|
}
|
|
@@ -4376,9 +4379,13 @@ class FormFieldComponent {
|
|
|
4376
4379
|
next: responses => {
|
|
4377
4380
|
let mergedData = [];
|
|
4378
4381
|
responses.forEach(response => {
|
|
4379
|
-
|
|
4382
|
+
let data = optionConfig?.dataPath
|
|
4380
4383
|
? this.getValueByPath(response, optionConfig.dataPath)
|
|
4381
|
-
: (Array.isArray(response) ? response : response.data || response.items || []);
|
|
4384
|
+
: (Array.isArray(response) ? response : response.data || response.items || response || []);
|
|
4385
|
+
// Handle Dictionary Objects by converting them to Arrays
|
|
4386
|
+
if (data !== null && typeof data === 'object' && !Array.isArray(data)) {
|
|
4387
|
+
data = Object.values(data);
|
|
4388
|
+
}
|
|
4382
4389
|
if (Array.isArray(data))
|
|
4383
4390
|
mergedData = [...mergedData, ...data];
|
|
4384
4391
|
});
|
|
@@ -7227,7 +7234,14 @@ class SmartTableComponent {
|
|
|
7227
7234
|
this.config.filters.forEach(filter => {
|
|
7228
7235
|
if (filter.apiUrl && !filter.options) {
|
|
7229
7236
|
const headers = this.getHeaders();
|
|
7230
|
-
|
|
7237
|
+
let params = new HttpParams();
|
|
7238
|
+
if (filter.handling === 'nested_string' && filter.nestedStringConfig) {
|
|
7239
|
+
const { paramName, baseValue } = filter.nestedStringConfig;
|
|
7240
|
+
if (baseValue) {
|
|
7241
|
+
params = params.set(paramName, baseValue);
|
|
7242
|
+
}
|
|
7243
|
+
}
|
|
7244
|
+
this.http.get(filter.apiUrl, { headers, params }).subscribe({
|
|
7231
7245
|
next: (response) => {
|
|
7232
7246
|
const data = filter.dataPath ? this.getValueByPath(response, filter.dataPath) : response;
|
|
7233
7247
|
if (!Array.isArray(data)) {
|
|
@@ -7399,6 +7413,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
7399
7413
|
}]
|
|
7400
7414
|
}] });
|
|
7401
7415
|
|
|
7416
|
+
function appendBaseUrlRecursively(obj, baseURL) {
|
|
7417
|
+
if (obj && typeof obj === 'object') {
|
|
7418
|
+
if (obj.apiUrl && typeof obj.apiUrl === 'string' && !obj.apiUrl.startsWith('http://') && !obj.apiUrl.startsWith('https://')) {
|
|
7419
|
+
let finalApiUrl = obj.apiUrl;
|
|
7420
|
+
if (baseURL.endsWith('/') && finalApiUrl.startsWith('/')) {
|
|
7421
|
+
finalApiUrl = finalApiUrl.substring(1);
|
|
7422
|
+
}
|
|
7423
|
+
else if (!baseURL.endsWith('/') && !finalApiUrl.startsWith('/')) {
|
|
7424
|
+
finalApiUrl = '/' + finalApiUrl;
|
|
7425
|
+
}
|
|
7426
|
+
obj.apiUrl = baseURL + finalApiUrl;
|
|
7427
|
+
}
|
|
7428
|
+
for (const key in obj) {
|
|
7429
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
7430
|
+
appendBaseUrlRecursively(obj[key], baseURL);
|
|
7431
|
+
}
|
|
7432
|
+
}
|
|
7433
|
+
}
|
|
7434
|
+
}
|
|
7435
|
+
|
|
7402
7436
|
class ValidationUtils {
|
|
7403
7437
|
static email() {
|
|
7404
7438
|
return (control) => {
|
|
@@ -8839,5 +8873,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
8839
8873
|
* Generated bundle index. Do not edit.
|
|
8840
8874
|
*/
|
|
8841
8875
|
|
|
8842
|
-
export { AlertComponent, AlertModule, ButtonComponent, ButtonModule, CheckboxComponent, ConfigurableFormComponent, configurableForm_examples as ConfigurableFormExamples, ConfigurableFormModule, ConfirmationModalComponent, ConfirmationModalModule, DEFAULT_ITEMS_PER_PAGE, DEFAULT_PAGE_SIZE_OPTIONS, DEFAULT_SIDE_NAV_TOOLTIP_POSITION, DatepickerComponent, DropdownComponent, ExpressionService, FilterComponent, FilterModule, FilterSidebarComponent, FilterSidebarModule, FormComponentsModule, InputComponent, MaterialModule, NAV_ORIENTATION_DEFAULT, NAV_VARIANT_DEFAULT, NavComponent, NavModule, PAGINATION_THEME_DARK, PAGINATION_THEME_DEFAULT, PaginationComponent, PaginationModule, RadioComponent, SearchComponent, SharedUiModule, SideNavComponent, SideNavModule, SmartFormComponent, SmartFormController, smartForm_examples as SmartFormExamples, SmartFormModule, SmartTableComponent, SmartTableModule, SnackbarComponent, SnackbarModule, SnackbarService, StringUtils, SummaryCardComponent, SummaryCardModule, ToggleComponent, ValidationUtils, clearLocalStorage, clearSessionStorage, getLocalStorageItem, getSessionStorageItem, removeLocalStorageItem, removeSessionStorageItem, setLocalStorageItem, setSessionStorageItem, translateConfig };
|
|
8876
|
+
export { AlertComponent, AlertModule, ButtonComponent, ButtonModule, CheckboxComponent, ConfigurableFormComponent, configurableForm_examples as ConfigurableFormExamples, ConfigurableFormModule, ConfirmationModalComponent, ConfirmationModalModule, DEFAULT_ITEMS_PER_PAGE, DEFAULT_PAGE_SIZE_OPTIONS, DEFAULT_SIDE_NAV_TOOLTIP_POSITION, DatepickerComponent, DropdownComponent, ExpressionService, FilterComponent, FilterModule, FilterSidebarComponent, FilterSidebarModule, FormComponentsModule, InputComponent, MaterialModule, NAV_ORIENTATION_DEFAULT, NAV_VARIANT_DEFAULT, NavComponent, NavModule, PAGINATION_THEME_DARK, PAGINATION_THEME_DEFAULT, PaginationComponent, PaginationModule, RadioComponent, SearchComponent, SharedUiModule, SideNavComponent, SideNavModule, SmartFormComponent, SmartFormController, smartForm_examples as SmartFormExamples, SmartFormModule, SmartTableComponent, SmartTableModule, SnackbarComponent, SnackbarModule, SnackbarService, StringUtils, SummaryCardComponent, SummaryCardModule, ToggleComponent, ValidationUtils, appendBaseUrlRecursively, clearLocalStorage, clearSessionStorage, getLocalStorageItem, getSessionStorageItem, removeLocalStorageItem, removeSessionStorageItem, setLocalStorageItem, setSessionStorageItem, translateConfig };
|
|
8843
8877
|
//# sourceMappingURL=commons-shared-web-ui.mjs.map
|