@mediusinc/mng-commons 7.4.0-rc.0 → 7.4.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.
Files changed (28) hide show
  1. package/dev-scripts/version-info.js +18 -19
  2. package/fesm2022/mediusinc-mng-commons-core.mjs +69 -6
  3. package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
  4. package/fesm2022/mediusinc-mng-commons-filter.mjs +9 -3
  5. package/fesm2022/mediusinc-mng-commons-filter.mjs.map +1 -1
  6. package/fesm2022/mediusinc-mng-commons-form.mjs +287 -230
  7. package/fesm2022/mediusinc-mng-commons-form.mjs.map +1 -1
  8. package/fesm2022/{mediusinc-mng-commons-table-column-toggle.component-D7fm83ug.mjs → mediusinc-mng-commons-table-column-toggle.component-BS5xvoDR.mjs} +2 -2
  9. package/fesm2022/{mediusinc-mng-commons-table-column-toggle.component-D7fm83ug.mjs.map → mediusinc-mng-commons-table-column-toggle.component-BS5xvoDR.mjs.map} +1 -1
  10. package/fesm2022/{mediusinc-mng-commons-table-mediusinc-mng-commons-table-Czmm5fLT.mjs → mediusinc-mng-commons-table-mediusinc-mng-commons-table-BfEYZG7s.mjs} +279 -117
  11. package/fesm2022/mediusinc-mng-commons-table-mediusinc-mng-commons-table-BfEYZG7s.mjs.map +1 -0
  12. package/fesm2022/mediusinc-mng-commons-table.mjs +1 -1
  13. package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +42 -13
  14. package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
  15. package/fesm2022/mediusinc-mng-commons-tableview.mjs +40 -19
  16. package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
  17. package/i18n/en.json +5 -2
  18. package/i18n/sl.json +5 -1
  19. package/package.json +1 -1
  20. package/types/mediusinc-mng-commons-core.d.ts +2 -1
  21. package/types/mediusinc-mng-commons-filter.d.ts +6 -3
  22. package/types/mediusinc-mng-commons-form.d.ts +49 -77
  23. package/types/mediusinc-mng-commons-table-api.d.ts +12 -2
  24. package/types/mediusinc-mng-commons-table.d.ts +13 -5
  25. package/types/mediusinc-mng-commons-tableview-api.d.ts +47 -8
  26. package/types/mediusinc-mng-commons-tableview.d.ts +8 -2
  27. package/fesm2022/mediusinc-mng-commons-table-mediusinc-mng-commons-table-Czmm5fLT.mjs.map +0 -1
  28. package/version-info.json +0 -11
@@ -1,5 +1,5 @@
1
1
  const {gitDescribeSync} = require('git-describe');
2
- const {resolve, relative} = require('path');
2
+ const {resolve} = require('path');
3
3
  const {writeFileSync, readFileSync, existsSync} = require('fs');
4
4
 
5
5
  const gitInfo = gitDescribeSync({
@@ -16,30 +16,29 @@ let importFrom = '@mediusinc/mng-commons/core';
16
16
  let skipBuildTimestamp = false;
17
17
 
18
18
  for (let i = 0; i < args.length; i++) {
19
- if (args[i] === '-d' && i + 1 < args.length) { // directory with package.json
19
+ if (args[i] === '-d' && i + 1 < args.length) {
20
+ // directory with package.json
20
21
  baseDir.push(...args[i + 1].split('/'));
21
22
  i++;
22
- }
23
- else if (args[i] === '-o' && i + 1 < args.length) { // output directory
23
+ } else if (args[i] === '-o' && i + 1 < args.length) {
24
+ // output directory
24
25
  outputDir.push(...args[i + 1].split('/'));
25
26
  i++;
26
- }
27
- else if (args[i] === '-n' && i + 1 < args.length) { // name
27
+ } else if (args[i] === '-n' && i + 1 < args.length) {
28
+ // name
28
29
  name = args[i + 1];
29
30
  i++;
30
- }
31
- else if (args[i] === '-f' && i + 1 < args.length) { // format
31
+ } else if (args[i] === '-f' && i + 1 < args.length) {
32
+ // format
32
33
  format = args[i + 1];
33
34
  i++;
34
- }
35
- else if (args[i] === '--import-from' && i + 1 < args.length) {
35
+ } else if (args[i] === '--import-from' && i + 1 < args.length) {
36
36
  importFrom = args[i + 1];
37
- i++
38
- }
39
- else if (args[i] === '--skip-build-timestamp') {
37
+ i++;
38
+ } else if (args[i] === '--skip-build-timestamp') {
40
39
  if (i + 1 < args.length && !args[i + 1].startsWith('-')) {
41
- skipBuildTimestamp = args[i+1] === 'true';
42
- i++
40
+ skipBuildTimestamp = args[i + 1] === 'true';
41
+ i++;
43
42
  } else {
44
43
  skipBuildTimestamp = true;
45
44
  }
@@ -57,13 +56,13 @@ const baseDirPath = resolve(...baseDir);
57
56
 
58
57
  if (!existsSync(baseDirPath)) {
59
58
  console.warn(`Directory "${baseDirPath}" does not exist`);
60
- // eslint-disable-next-line prettier/prettier
59
+
61
60
  return;
62
61
  }
63
62
 
64
63
  let packageInfo = null;
65
64
  if (existsSync(resolve(baseDirPath, 'package.json'))) {
66
- packageInfo = JSON.parse(readFileSync(resolve(baseDirPath, 'package.json'), 'utf-8'))
65
+ packageInfo = JSON.parse(readFileSync(resolve(baseDirPath, 'package.json'), 'utf-8'));
67
66
  }
68
67
 
69
68
  const versionInfo = {
@@ -96,11 +95,11 @@ switch (format) {
96
95
  case 'ts':
97
96
  fileContent = `import {VersionInfo} from '${importFrom}';
98
97
 
99
- export const versionInfo: VersionInfo = ${versionInfoContentJson};`
98
+ export const versionInfo: VersionInfo = ${versionInfoContentJson};`;
100
99
  fileExtension = 'ts';
101
100
  break;
102
101
  case 'js':
103
- fileContent = `export const versionInfo = ${versionInfoContentJson};`
102
+ fileContent = `export const versionInfo = ${versionInfoContentJson};`;
104
103
  fileExtension = 'js';
105
104
  break;
106
105
  case 'json':
@@ -381,8 +381,13 @@ function fromTableLoadToDataListParams(event) {
381
381
  filter.disabled = eventFilter.disabled;
382
382
  }
383
383
  // handle search case sensitivity to be also written on searchCaseSensitive
384
- if (key === 'global' && typeof params.search === 'string' && filter.caseSensitive !== undefined) {
385
- params.searchCaseSensitive = filter.caseSensitive;
384
+ if (key === 'global') {
385
+ if (params.search == null && typeof filter.value === 'string') {
386
+ params.search = filter.value;
387
+ }
388
+ if (typeof params.search === 'string' && filter.caseSensitive !== undefined) {
389
+ params.searchCaseSensitive = filter.caseSensitive;
390
+ }
386
391
  return acc;
387
392
  }
388
393
  return { ...acc, [key]: filter };
@@ -498,6 +503,7 @@ function mergeDataListParamsWithDefaults(params, defaults = {
498
503
  limit: params.limit ?? defaults.limit,
499
504
  offset: params.offset ?? defaults.offset,
500
505
  search: params.search ?? defaults.search,
506
+ searchCaseSensitive: params.searchCaseSensitive ?? defaults.searchCaseSensitive,
501
507
  sort: (params.sort ?? defaults.sort)?.map(s => ({ ...s }))
502
508
  };
503
509
  if (params.filters) {
@@ -624,8 +630,17 @@ function fromUrlQueryToDataListParams(urlParams, opts) {
624
630
  else if (urlParamKey === sortQpKey) {
625
631
  if (typeof urlParamValue === 'string') {
626
632
  params.sort = urlParamValue.split(',').map(s => {
627
- const [direction, property] = s.split(':');
628
- return { property: (property ?? direction), ascending: direction !== 'desc' };
633
+ const colonIndex = s.indexOf(':');
634
+ let property = s;
635
+ let direction = undefined;
636
+ if (colonIndex !== -1) {
637
+ property = s.substring(colonIndex + 1);
638
+ direction = s.substring(0, colonIndex);
639
+ }
640
+ return {
641
+ property: property,
642
+ ascending: direction !== 'desc'
643
+ };
629
644
  });
630
645
  }
631
646
  else {
@@ -776,7 +791,8 @@ function copyDataListParams(params) {
776
791
  const copy = {
777
792
  offset: params.offset,
778
793
  limit: params.limit,
779
- search: params.search
794
+ search: params.search,
795
+ searchCaseSensitive: params.searchCaseSensitive
780
796
  };
781
797
  if (params.sort) {
782
798
  copy.sort = params.sort?.map(s => ({ ...s }));
@@ -1220,6 +1236,53 @@ function objectDeepCopy(obj, options) {
1220
1236
  }
1221
1237
  return copy;
1222
1238
  }
1239
+ function objectDeepEquals(obj1, obj2) {
1240
+ if (obj1 === obj2) {
1241
+ return true;
1242
+ }
1243
+ if (Array.isArray(obj1) || Array.isArray(obj2)) {
1244
+ return Array.isArray(obj1) && Array.isArray(obj2) && obj1.length === obj2.length && obj1.every((value, index) => objectDeepEquals(value, obj2[index]));
1245
+ }
1246
+ if (!isObject(obj1) || !isObject(obj2)) {
1247
+ return false;
1248
+ }
1249
+ if (obj1 instanceof Date || obj2 instanceof Date) {
1250
+ return obj1 instanceof Date && obj2 instanceof Date && obj1.getTime() === obj2.getTime();
1251
+ }
1252
+ const keys1 = getObjectProperties(obj1);
1253
+ const keys2 = getObjectProperties(obj2);
1254
+ if (keys1.length !== keys2.length) {
1255
+ return false;
1256
+ }
1257
+ for (const key of keys1) {
1258
+ const value1 = obj1[key];
1259
+ const value2 = obj2[key];
1260
+ if (Array.isArray(value1) && Array.isArray(value2)) {
1261
+ if (value1.length !== value2.length) {
1262
+ return false;
1263
+ }
1264
+ for (let i = 0; i < value1.length; i++) {
1265
+ if (isObject(value1[i]) && isObject(value2[i])) {
1266
+ if (!objectDeepEquals(value1[i], value2[i])) {
1267
+ return false;
1268
+ }
1269
+ }
1270
+ else if (value1[i] !== value2[i]) {
1271
+ return false;
1272
+ }
1273
+ }
1274
+ }
1275
+ else if (isObject(value1) && isObject(value2)) {
1276
+ if (!objectDeepEquals(value1, value2)) {
1277
+ return false;
1278
+ }
1279
+ }
1280
+ else if (value1 !== value2) {
1281
+ return false;
1282
+ }
1283
+ }
1284
+ return true;
1285
+ }
1223
1286
  function objectDeepMerge(target, source) {
1224
1287
  if (!isObject(source)) {
1225
1288
  return target;
@@ -4126,5 +4189,5 @@ function provideCommons(config, ...features) {
4126
4189
  * Generated bundle index. Do not edit.
4127
4190
  */
4128
4191
 
4129
- export { ACommonsErrorBase, APermissions, BROWSER_STORAGE_IT, BooleanPipe, COMMONS_INITIALIZER_IT, COMMONS_MODULE_CONFIG_IT, ClassMapPipe, CommonsConfigurationService, CommonsErrorHandler, CommonsFeatureTypeEnum, CommonsHttpError, CommonsInitEventEnum, CommonsInitService, CommonsInternalError, CommonsRouterService, CommonsService, CommonsStorageService, ComponentDirective, DataProviderInst, EnumName, EnumPipe, EnumerateAsyncPipe, EnumeratePipe, FilterMatchMode, GetterPipe, I18nPropertyPipe, JsonPathPipe, LOG_PUBLISHERS, LogLevelEnum, LogPublisherConsoleService, LoggerService, NotificationWrapperComponent, ParametrizePipe, PermissionService, PermissionTypeEnum, Permissions, RerenderDirective, RouteBuilder, RoutesBuilder, StyleSizeEnum, Styles, TemplateDirective, TemplatePipe, TypeName, TypeRegistry, adjustRouteMenuLazyChildrenRouterLinks, angularDateFormatHasSeconds, angularDateFormatHasTime, appendRoutePathToBasePath, booleanOrUndefinedAttribute, booleanWithDefaultAttribute, commonsActionErrorContextToString, commonsErrorToString, commonsInitializerProvider, copyDataListParams, createChildrenLazyRoute, createLazyRoute, createRoute, createRouteRedirect, createRoutes, dataListParamsFilterToUrlQuery, dataListParamsFilterValueToUrlString, dataListParamsFiltersToUrlQuery, dataListParamsSortToUrlQuery, dataListParamsToUrlQuery, dateToIsoString, defineReflectEnumName, defineReflectTypeName, doesUrlMatchRouterLink, effectWithDeps, errorCauseToString, errorToString, escapeHtml, escapeHtmlAny, findReflectEnumName, findReflectTypeName, findTemplateByName, flattenObjectKeys, fromAngularDateFormatToPrime, fromAngularNumberFormatToFractions, fromEnumConstantsAsValueArray, fromEnumValuesAsValueArray, fromSubscribeError, fromTableLoadToDataListParams, fromUrlQueryToDataListParams, getEnumConstantName, getEnumConstantNameFromObject, getEnumConstantNames, getEnumConstantNamesFromObject, getEnumConstantValues, getEnumConstantValuesAsNumber, getEnumConstantValuesAsString, getEnumerationI18nBaseKey, getErrorLogLevel, getErrorName, getHttpErrorResponse, getHttpErrorResponseStatus, getHttpErrorResponseStatusText, getI18n, getI18nAsync, getI18nErrorParams, getI18nForError, getI18nTypeGroupKey, getI18nTypeKeyBasePath, getI18nTypeName, getI18nTypeNameAsync, getI18nTypeParams, getI18nTypeParamsAsync, getI18nTypePropertyKey, getI18nTypeTabKey, getObjectGetters, getObjectProperties, getObjectPropertyByPath, httpErrorResponseToString, isHttpErrorResponse, isMac, isPermitted, isRbacPermitted, itemIdToDefined, itemIdToNumber, itemIdToString, mapToDataList, mergeDataListParamsWithDefaults, narrowI18nToTranslation, narrowPrimeMessageSeverity, objectDeepCopy, objectDeepMerge, permissionGuard, populateI18nParams, populateI18nTypeParams, provideCommons, reflectEnumNameKey, reflectTypeNameExists, reflectTypeNameKey, removeRouteEmptyPathSegments, selectEnumerationI18n, selectI18n, stringify, throwError, toEnumerationI18nEnumerate, toObservable, toastMessage, valueToDefined };
4192
+ export { ACommonsErrorBase, APermissions, BROWSER_STORAGE_IT, BooleanPipe, COMMONS_INITIALIZER_IT, COMMONS_MODULE_CONFIG_IT, ClassMapPipe, CommonsConfigurationService, CommonsErrorHandler, CommonsFeatureTypeEnum, CommonsHttpError, CommonsInitEventEnum, CommonsInitService, CommonsInternalError, CommonsRouterService, CommonsService, CommonsStorageService, ComponentDirective, DataProviderInst, EnumName, EnumPipe, EnumerateAsyncPipe, EnumeratePipe, FilterMatchMode, GetterPipe, I18nPropertyPipe, JsonPathPipe, LOG_PUBLISHERS, LogLevelEnum, LogPublisherConsoleService, LoggerService, NotificationWrapperComponent, ParametrizePipe, PermissionService, PermissionTypeEnum, Permissions, RerenderDirective, RouteBuilder, RoutesBuilder, StyleSizeEnum, Styles, TemplateDirective, TemplatePipe, TypeName, TypeRegistry, adjustRouteMenuLazyChildrenRouterLinks, angularDateFormatHasSeconds, angularDateFormatHasTime, appendRoutePathToBasePath, booleanOrUndefinedAttribute, booleanWithDefaultAttribute, commonsActionErrorContextToString, commonsErrorToString, commonsInitializerProvider, copyDataListParams, createChildrenLazyRoute, createLazyRoute, createRoute, createRouteRedirect, createRoutes, dataListParamsFilterToUrlQuery, dataListParamsFilterValueToUrlString, dataListParamsFiltersToUrlQuery, dataListParamsSortToUrlQuery, dataListParamsToUrlQuery, dateToIsoString, defineReflectEnumName, defineReflectTypeName, doesUrlMatchRouterLink, effectWithDeps, errorCauseToString, errorToString, escapeHtml, escapeHtmlAny, findReflectEnumName, findReflectTypeName, findTemplateByName, flattenObjectKeys, fromAngularDateFormatToPrime, fromAngularNumberFormatToFractions, fromEnumConstantsAsValueArray, fromEnumValuesAsValueArray, fromSubscribeError, fromTableLoadToDataListParams, fromUrlQueryToDataListParams, getEnumConstantName, getEnumConstantNameFromObject, getEnumConstantNames, getEnumConstantNamesFromObject, getEnumConstantValues, getEnumConstantValuesAsNumber, getEnumConstantValuesAsString, getEnumerationI18nBaseKey, getErrorLogLevel, getErrorName, getHttpErrorResponse, getHttpErrorResponseStatus, getHttpErrorResponseStatusText, getI18n, getI18nAsync, getI18nErrorParams, getI18nForError, getI18nTypeGroupKey, getI18nTypeKeyBasePath, getI18nTypeName, getI18nTypeNameAsync, getI18nTypeParams, getI18nTypeParamsAsync, getI18nTypePropertyKey, getI18nTypeTabKey, getObjectGetters, getObjectProperties, getObjectPropertyByPath, httpErrorResponseToString, isHttpErrorResponse, isMac, isPermitted, isRbacPermitted, itemIdToDefined, itemIdToNumber, itemIdToString, mapToDataList, mergeDataListParamsWithDefaults, narrowI18nToTranslation, narrowPrimeMessageSeverity, objectDeepCopy, objectDeepEquals, objectDeepMerge, permissionGuard, populateI18nParams, populateI18nTypeParams, provideCommons, reflectEnumNameKey, reflectTypeNameExists, reflectTypeNameKey, removeRouteEmptyPathSegments, selectEnumerationI18n, selectI18n, stringify, throwError, toEnumerationI18nEnumerate, toObservable, toastMessage, valueToDefined };
4130
4193
  //# sourceMappingURL=mediusinc-mng-commons-core.mjs.map