@mediusinc/mng-commons 5.3.0-rc.1 → 5.3.0-rc.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.
Files changed (86) hide show
  1. package/core/data-list/filter-metadata.model.d.ts +20 -0
  2. package/core/helpers/number.d.ts +5 -0
  3. package/core/helpers/type-helpers.d.ts +1 -0
  4. package/core/index.d.ts +2 -0
  5. package/core/provide.d.ts +3 -2
  6. package/core/services/tokens/module-config.token.d.ts +7 -6
  7. package/esm2022/core/data-list/data-list-params-helpers.mjs +3 -1
  8. package/esm2022/core/data-list/filter-metadata.model.mjs +2 -0
  9. package/esm2022/core/helpers/date.mjs +2 -2
  10. package/esm2022/core/helpers/number.mjs +19 -0
  11. package/esm2022/core/helpers/type-helpers.mjs +1 -1
  12. package/esm2022/core/index.mjs +3 -1
  13. package/esm2022/core/pipes/boolean.pipe.mjs +7 -1
  14. package/esm2022/core/provide.mjs +4 -3
  15. package/esm2022/core/services/tokens/module-config.token.mjs +1 -1
  16. package/esm2022/filter/descriptors/filter-lookup.descriptor.mjs +2 -3
  17. package/esm2022/filter/descriptors/filter.descriptor.mjs +76 -31
  18. package/esm2022/filter/models/filter.model.mjs +6 -1
  19. package/esm2022/form/components/date-range/date-range.component.mjs +45 -14
  20. package/esm2022/form/components/dropdown/dropdown.component.mjs +77 -93
  21. package/esm2022/form/components/number-range/number-range.component.mjs +29 -12
  22. package/esm2022/table/api/descriptors/column.descriptor.mjs +2 -1
  23. package/esm2022/table/api/descriptors/table.descriptor.mjs +11 -20
  24. package/esm2022/table/api/models/table-columns.model.mjs +1 -1
  25. package/esm2022/table/api/models/table.model.mjs +1 -1
  26. package/esm2022/table/components/column-filter/column-filter.component.mjs +396 -0
  27. package/esm2022/table/components/filter/filter-active-tag/filter-active-tag.component.mjs +52 -0
  28. package/esm2022/table/components/filter/filter-form/filter-form.component.mjs +197 -0
  29. package/esm2022/table/components/filter/filter-overlay-with-tag/filter-overlay-with-tag.component.mjs +135 -0
  30. package/esm2022/table/components/table/table.component.mjs +34 -25
  31. package/esm2022/table/helpers/filters.mjs +297 -0
  32. package/esm2022/table/index.mjs +13 -2
  33. package/esm2022/table/models/filter.model.mjs +2 -0
  34. package/esm2022/table/pipes/filter-value.pipe.mjs +77 -0
  35. package/esm2022/table/provide.mjs +19 -0
  36. package/esm2022/table/services/data-list.service.mjs +1 -1
  37. package/esm2022/table/services/table-feature-config.token.mjs +3 -0
  38. package/esm2022/tableview/action/components/editor/injector-context/action-editor-injector-context.component.mjs +2 -2
  39. package/esm2022/tableview/action/components/localization/data-language-dropdown.component.mjs +2 -2
  40. package/esm2022/tableview/api/editor/descriptors/field.descriptor.mjs +1 -1
  41. package/esm2022/tableview/api/editor/models/editor-fields.model.mjs +1 -1
  42. package/esm2022/tableview/api/tableview/descriptors/tableview.descriptor.mjs +11 -13
  43. package/esm2022/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +2 -2
  44. package/esm2022/tableview/tableview/components/tableview/tableview.component.mjs +3 -4
  45. package/fesm2022/mediusinc-mng-commons-core.mjs +32 -4
  46. package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
  47. package/fesm2022/mediusinc-mng-commons-filter.mjs +81 -32
  48. package/fesm2022/mediusinc-mng-commons-filter.mjs.map +1 -1
  49. package/fesm2022/mediusinc-mng-commons-form.mjs +149 -117
  50. package/fesm2022/mediusinc-mng-commons-form.mjs.map +1 -1
  51. package/fesm2022/mediusinc-mng-commons-table-api.mjs +11 -19
  52. package/fesm2022/mediusinc-mng-commons-table-api.mjs.map +1 -1
  53. package/fesm2022/mediusinc-mng-commons-table.mjs +832 -359
  54. package/fesm2022/mediusinc-mng-commons-table.mjs.map +1 -1
  55. package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +10 -12
  56. package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
  57. package/fesm2022/mediusinc-mng-commons-tableview.mjs +5 -5
  58. package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
  59. package/filter/descriptors/filter.descriptor.d.ts +60 -16
  60. package/filter/models/filter.model.d.ts +4 -0
  61. package/form/components/date-range/date-range.component.d.ts +9 -3
  62. package/form/components/dropdown/dropdown.component.d.ts +6 -7
  63. package/form/components/number-range/number-range.component.d.ts +8 -4
  64. package/i18n/en.json +32 -0
  65. package/i18n/sl.json +32 -0
  66. package/package.json +7 -7
  67. package/table/api/descriptors/table.descriptor.d.ts +7 -7
  68. package/table/api/models/table-columns.model.d.ts +3 -3
  69. package/table/api/models/table.model.d.ts +0 -12
  70. package/table/components/{column-filter-full/column-filter-full.component.d.ts → column-filter/column-filter.component.d.ts} +23 -38
  71. package/table/components/filter/filter-active-tag/filter-active-tag.component.d.ts +20 -0
  72. package/table/components/filter/filter-form/filter-form.component.d.ts +53 -0
  73. package/table/components/filter/filter-overlay-with-tag/filter-overlay-with-tag.component.d.ts +35 -0
  74. package/table/components/table/table.component.d.ts +10 -7
  75. package/table/helpers/filters.d.ts +31 -0
  76. package/table/index.d.ts +10 -1
  77. package/table/models/filter.model.d.ts +24 -0
  78. package/table/pipes/filter-value.pipe.d.ts +19 -0
  79. package/table/provide.d.ts +8 -0
  80. package/table/services/data-list.service.d.ts +3 -2
  81. package/table/services/table-feature-config.token.d.ts +6 -0
  82. package/tableview/api/editor/descriptors/field.descriptor.d.ts +3 -3
  83. package/tableview/api/editor/models/editor-fields.model.d.ts +4 -4
  84. package/tableview/api/tableview/descriptors/tableview.descriptor.d.ts +8 -6
  85. package/version-info.json +5 -5
  86. package/esm2022/table/components/column-filter-full/column-filter-full.component.mjs +0 -655
@@ -178,7 +178,7 @@ function dateToIsoString(value, type = 'date-time', dateTimeOpts = {}) {
178
178
  ':' +
179
179
  padNumber(value.getSeconds());
180
180
  if (!dateTimeOpts.noMillis) {
181
- base += '.' + padNumber(value.getMilliseconds());
181
+ base += '.' + padNumber(value.getMilliseconds(), 3);
182
182
  }
183
183
  if (!dateTimeOpts.noTimezone) {
184
184
  const tzo = -value.getTimezoneOffset(), dif = tzo >= 0 ? '+' : '-';
@@ -865,10 +865,12 @@ function fromTableLoadToDataListParams(event) {
865
865
  if (Array.isArray(eventFilter)) {
866
866
  filter.value = eventFilter[0].value;
867
867
  filter.matchMode = eventFilter[0].matchMode;
868
+ filter.caseSensitive = eventFilter[0].caseSensitive;
868
869
  }
869
870
  else if (eventFilter !== undefined) {
870
871
  filter.value = eventFilter.value;
871
872
  filter.matchMode = eventFilter.matchMode;
873
+ filter.caseSensitive = eventFilter.caseSensitive;
872
874
  }
873
875
  return { ...acc, [key]: filter };
874
876
  }, {});
@@ -2027,6 +2029,25 @@ function toastMessage(messageService, title, message, severity = 'success', icon
2027
2029
  return notification;
2028
2030
  }
2029
2031
 
2032
+ function fromAngularNumberFormatToFractions(format) {
2033
+ const hasDot = format.indexOf('.') >= 0;
2034
+ const hasDash = format.indexOf('-') >= 0;
2035
+ const [intPart, decPart] = format.split('.');
2036
+ let int = hasDot || (!hasDot && !hasDash) ? +intPart : 1;
2037
+ if (!int || isNaN(int))
2038
+ int = 1;
2039
+ let [fractionsMin, fractionsMax] = !hasDot && !hasDash ? [0, 0] : (hasDot ? decPart : intPart).split('-').map(f => +f);
2040
+ if (isNaN(fractionsMin))
2041
+ fractionsMin = 0;
2042
+ if (fractionsMax == null || isNaN(fractionsMax))
2043
+ fractionsMax = fractionsMin;
2044
+ return {
2045
+ integer: int,
2046
+ fractionsMin: fractionsMin,
2047
+ fractionsMax: fractionsMax
2048
+ };
2049
+ }
2050
+
2030
2051
  function removeRouteEmptyPathSegments(path) {
2031
2052
  const filteredPath = path.filter(ps => typeof ps === 'string' && ps.length > 0);
2032
2053
  return filteredPath.length > 0 ? filteredPath : [''];
@@ -2219,6 +2240,12 @@ class LogPublisherConsoleService {
2219
2240
 
2220
2241
  class BooleanPipe {
2221
2242
  transform(value, yes, no, icon = false) {
2243
+ if (typeof value === 'string') {
2244
+ value = value.toLowerCase() === 'true';
2245
+ }
2246
+ else if (typeof value === 'number') {
2247
+ value = value === 1;
2248
+ }
2222
2249
  if (typeof value === 'boolean') {
2223
2250
  if (icon) {
2224
2251
  return value ? yes ?? 'pi pi-check' : no ?? 'pi pi-times';
@@ -3945,8 +3972,9 @@ class Styles {
3945
3972
  var CommonsFeatureTypeEnum;
3946
3973
  (function (CommonsFeatureTypeEnum) {
3947
3974
  CommonsFeatureTypeEnum[CommonsFeatureTypeEnum["Layout"] = 0] = "Layout";
3948
- CommonsFeatureTypeEnum[CommonsFeatureTypeEnum["Tableview"] = 1] = "Tableview";
3949
- CommonsFeatureTypeEnum[CommonsFeatureTypeEnum["DataApiAsClassV1"] = 2] = "DataApiAsClassV1";
3975
+ CommonsFeatureTypeEnum[CommonsFeatureTypeEnum["Table"] = 1] = "Table";
3976
+ CommonsFeatureTypeEnum[CommonsFeatureTypeEnum["Tableview"] = 2] = "Tableview";
3977
+ CommonsFeatureTypeEnum[CommonsFeatureTypeEnum["DataApiAsClassV1"] = 3] = "DataApiAsClassV1";
3950
3978
  })(CommonsFeatureTypeEnum || (CommonsFeatureTypeEnum = {}));
3951
3979
  function provideCommons(config, ...features) {
3952
3980
  const providers = [
@@ -4008,5 +4036,5 @@ function provideCommons(config, ...features) {
4008
4036
  * Generated bundle index. Do not edit.
4009
4037
  */
4010
4038
 
4011
- 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, DataProvider, DataProviderInst, EnumName, EnumPipe, EnumerateAsyncPipe, EnumeratePipe, ErrorPageComponent, FilterMatchMode, GetterPipe, I18nPropertyPipe, JsonPathPipe, LOG_PUBLISHERS, LogLevelEnum, LogPublisherConsoleService, LoggerService, NotFoundPageComponent, NotificationWrapperComponent, ParametrizePipe, PermissionService, PermissionTypeEnum, Permissions, RouteBuilder, RoutesBuilder, StyleLevelEnum, StyleSizeEnum, Styles, TemplateDirective, TemplatePipe, TypeName, TypeRegistry, adjustRouteMenuLazyChildrenRouterLinks, angularDateFormatHasSeconds, angularDateFormatHasTime, appendRoutePathToBasePath, boolean$Attribute, booleanOrUndefinedAttribute, commonsActionErrorContextToString, commonsErrorToString, commonsInitializerProvider, copyDataListParams, createLazyChildrenRoute, createLazyRoute, createRoute, createRouteRedirect, createRoutes, dataListParamsFilterToUrlQuery, dataListParamsFilterValueToUrlString, dataListParamsFiltersToUrlQuery, dataListParamsSortToUrlQuery, dataListParamsToUrlQuery, dataProviderBase, dataProviderFromClass, dataProviderWithService, dateToIsoString, defineReflectEnumName, defineReflectTypeName, doesUrlMatchRouterLink, errorCauseToString, errorToString, escapeHtml, escapeHtmlAny, findReflectEnumName, findReflectTypeName, findTemplateByName, flattenObjectKeys, fromAngularDateFormatToPrime, 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, isPermitted, isRbacPermitted, itemIdToDefined, itemIdToNumber, itemIdToString, mapToDataList, mergeDataListParamsWithDefaults, number$Attribute, objectDeepCopy, objectDeepMerge, permissionGuard, populateI18nParams, populateI18nTypeParams, provideCommons, reflectEnumNameKey, reflectTypeNameExists, reflectTypeNameKey, removeRouteEmptyPathSegments, selectEnumerationI18n, selectI18n, stringify, throwError, toEnumerationI18nEnumerate, toObservable, toastMessage, valueToDefined };
4039
+ 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, DataProvider, DataProviderInst, EnumName, EnumPipe, EnumerateAsyncPipe, EnumeratePipe, ErrorPageComponent, FilterMatchMode, GetterPipe, I18nPropertyPipe, JsonPathPipe, LOG_PUBLISHERS, LogLevelEnum, LogPublisherConsoleService, LoggerService, NotFoundPageComponent, NotificationWrapperComponent, ParametrizePipe, PermissionService, PermissionTypeEnum, Permissions, RouteBuilder, RoutesBuilder, StyleLevelEnum, StyleSizeEnum, Styles, TemplateDirective, TemplatePipe, TypeName, TypeRegistry, adjustRouteMenuLazyChildrenRouterLinks, angularDateFormatHasSeconds, angularDateFormatHasTime, appendRoutePathToBasePath, boolean$Attribute, booleanOrUndefinedAttribute, commonsActionErrorContextToString, commonsErrorToString, commonsInitializerProvider, copyDataListParams, createLazyChildrenRoute, createLazyRoute, createRoute, createRouteRedirect, createRoutes, dataListParamsFilterToUrlQuery, dataListParamsFilterValueToUrlString, dataListParamsFiltersToUrlQuery, dataListParamsSortToUrlQuery, dataListParamsToUrlQuery, dataProviderBase, dataProviderFromClass, dataProviderWithService, dateToIsoString, defineReflectEnumName, defineReflectTypeName, doesUrlMatchRouterLink, 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, isPermitted, isRbacPermitted, itemIdToDefined, itemIdToNumber, itemIdToString, mapToDataList, mergeDataListParamsWithDefaults, number$Attribute, objectDeepCopy, objectDeepMerge, permissionGuard, populateI18nParams, populateI18nTypeParams, provideCommons, reflectEnumNameKey, reflectTypeNameExists, reflectTypeNameKey, removeRouteEmptyPathSegments, selectEnumerationI18n, selectI18n, stringify, throwError, toEnumerationI18nEnumerate, toObservable, toastMessage, valueToDefined };
4012
4040
  //# sourceMappingURL=mediusinc-mng-commons-core.mjs.map