@theseam/ui-common 0.2.6 → 0.2.10

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 (99) hide show
  1. package/breadcrumbs/breadcrumb.d.ts +3 -1
  2. package/breadcrumbs/breadcrumbs/breadcrumbs.component.d.ts +2 -2
  3. package/breadcrumbs/breadcrumbs-resolver.d.ts +3 -1
  4. package/breadcrumbs/breadcrumbs.service.d.ts +15 -6
  5. package/breadcrumbs/theseam-ui-common-breadcrumbs.metadata.json +1 -1
  6. package/bundles/theseam-ui-common-breadcrumbs.umd.js +487 -16
  7. package/bundles/theseam-ui-common-breadcrumbs.umd.js.map +1 -1
  8. package/bundles/theseam-ui-common-data-exporter.umd.js.map +1 -1
  9. package/bundles/theseam-ui-common-datatable.umd.js +54 -4
  10. package/bundles/theseam-ui-common-datatable.umd.js.map +1 -1
  11. package/bundles/theseam-ui-common-framework.umd.js +2 -2
  12. package/bundles/theseam-ui-common-framework.umd.js.map +1 -1
  13. package/bundles/theseam-ui-common-shared.umd.js +20 -6
  14. package/bundles/theseam-ui-common-shared.umd.js.map +1 -1
  15. package/bundles/theseam-ui-common-unsaved-changes-dialog.umd.js +1 -0
  16. package/bundles/theseam-ui-common-unsaved-changes-dialog.umd.js.map +1 -1
  17. package/bundles/theseam-ui-common-utils.umd.js +82 -1
  18. package/bundles/theseam-ui-common-utils.umd.js.map +1 -1
  19. package/bundles/theseam-ui-common-validators.umd.js +54 -4
  20. package/bundles/theseam-ui-common-validators.umd.js.map +1 -1
  21. package/data-exporter/data-exporter.d.ts +4 -0
  22. package/data-exporter/theseam-ui-common-data-exporter.metadata.json +1 -1
  23. package/datatable/datatable/datatable.component.d.ts +2 -0
  24. package/datatable/datatable-footer/datatable-footer-tpl.directive.d.ts +5 -0
  25. package/datatable/datatable-footer/datatable-footer.directive.d.ts +6 -0
  26. package/datatable/public-api.d.ts +2 -0
  27. package/datatable/theseam-ui-common-datatable.metadata.json +1 -1
  28. package/esm2015/breadcrumbs/breadcrumb.js +1 -1
  29. package/esm2015/breadcrumbs/breadcrumbs/breadcrumbs.component.js +1 -1
  30. package/esm2015/breadcrumbs/breadcrumbs-resolver.js +1 -1
  31. package/esm2015/breadcrumbs/breadcrumbs.service.js +133 -15
  32. package/esm2015/data-exporter/data-exporter.js +1 -1
  33. package/esm2015/datatable/datatable/datatable.component.js +5 -3
  34. package/esm2015/datatable/datatable-export-button/datatable-export-button.component.js +8 -3
  35. package/esm2015/datatable/datatable-footer/datatable-footer-tpl.directive.js +15 -0
  36. package/esm2015/datatable/datatable-footer/datatable-footer.directive.js +18 -0
  37. package/esm2015/datatable/datatable.module.js +7 -1
  38. package/esm2015/datatable/public-api.js +3 -1
  39. package/esm2015/framework/side-nav/side-nav-item/side-nav-item.component.js +3 -3
  40. package/esm2015/shared/directives/ng-select-extra.directive.js +16 -3
  41. package/esm2015/shared/pipes/mask-chars.pipe.js +2 -2
  42. package/esm2015/unsaved-changes-dialog/unsaved-changes-can-deactivate.js +3 -2
  43. package/esm2015/utils/create-padding.js +17 -0
  44. package/esm2015/utils/form/is-empty-input-value.js +6 -0
  45. package/esm2015/utils/fractional-digits-count.js +19 -0
  46. package/esm2015/utils/is-numeric.js +4 -0
  47. package/esm2015/utils/pad-end.js +9 -0
  48. package/esm2015/utils/pad-start.js +9 -0
  49. package/esm2015/utils/public-api.js +7 -1
  50. package/esm2015/utils/router/index.js +3 -1
  51. package/esm2015/utils/router/is-empty-url-route.js +4 -0
  52. package/esm2015/utils/router/leaf-child-route.js +1 -1
  53. package/esm2015/utils/router/operators/activated-routes-with-data-property.js +3 -8
  54. package/esm2015/utils/router/will-have-data-prop.js +10 -0
  55. package/esm2015/validators/decimal.validator.js +25 -0
  56. package/esm2015/validators/integer.validator.js +25 -0
  57. package/esm2015/validators/public-api.js +3 -1
  58. package/fesm2015/theseam-ui-common-breadcrumbs.js +132 -14
  59. package/fesm2015/theseam-ui-common-breadcrumbs.js.map +1 -1
  60. package/fesm2015/theseam-ui-common-data-exporter.js.map +1 -1
  61. package/fesm2015/theseam-ui-common-datatable.js +45 -5
  62. package/fesm2015/theseam-ui-common-datatable.js.map +1 -1
  63. package/fesm2015/theseam-ui-common-framework.js +2 -2
  64. package/fesm2015/theseam-ui-common-framework.js.map +1 -1
  65. package/fesm2015/theseam-ui-common-shared.js +15 -2
  66. package/fesm2015/theseam-ui-common-shared.js.map +1 -1
  67. package/fesm2015/theseam-ui-common-unsaved-changes-dialog.js +1 -0
  68. package/fesm2015/theseam-ui-common-unsaved-changes-dialog.js.map +1 -1
  69. package/fesm2015/theseam-ui-common-utils.js +71 -2
  70. package/fesm2015/theseam-ui-common-utils.js.map +1 -1
  71. package/fesm2015/theseam-ui-common-validators.js +49 -1
  72. package/fesm2015/theseam-ui-common-validators.js.map +1 -1
  73. package/framework/side-nav/side-nav-item/side-nav-item.component.scss +36 -9
  74. package/framework/theseam-ui-common-framework.metadata.json +1 -1
  75. package/package.json +1 -1
  76. package/shared/directives/ng-select-extra.directive.d.ts +1 -0
  77. package/shared/theseam-ui-common-shared.metadata.json +1 -1
  78. package/styles/common/_table.scss +0 -5
  79. package/styles/vendor/ngx-datatable/_ngx-datatable.scss +475 -87
  80. package/styles/vendor/ngx-datatable/_themes/bootstrap/_variables.scss +173 -0
  81. package/styles/vendor/ngx-datatable/_themes/dark/_variables.scss +166 -0
  82. package/styles/vendor/ngx-datatable/_themes/material/_variables.scss +165 -0
  83. package/styles/vendor/ngx-datatable/_variables.scss +3 -0
  84. package/unsaved-changes-dialog/theseam-ui-common-unsaved-changes-dialog.metadata.json +1 -1
  85. package/utils/create-padding.d.ts +1 -0
  86. package/utils/form/is-empty-input-value.d.ts +1 -0
  87. package/utils/fractional-digits-count.d.ts +8 -0
  88. package/utils/is-numeric.d.ts +1 -0
  89. package/utils/pad-end.d.ts +1 -0
  90. package/utils/pad-start.d.ts +1 -0
  91. package/utils/public-api.d.ts +6 -0
  92. package/utils/router/index.d.ts +2 -0
  93. package/utils/router/is-empty-url-route.d.ts +2 -0
  94. package/utils/router/will-have-data-prop.d.ts +2 -0
  95. package/utils/theseam-ui-common-utils.metadata.json +1 -1
  96. package/validators/decimal.validator.d.ts +9 -0
  97. package/validators/integer.validator.d.ts +9 -0
  98. package/validators/public-api.d.ts +2 -0
  99. package/validators/theseam-ui-common-validators.metadata.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"theseam-ui-common-utils.js","sources":["../../../projects/ui-common/utils/get-attribute.ts","../../../projects/ui-common/utils/has-attribute.ts","../../../projects/ui-common/utils/cdk/get-closest-widget-cdk-drag.ts","../../../projects/ui-common/utils/form/get-control-name.ts","../../../projects/ui-common/utils/form/get-control-path.ts","../../../projects/ui-common/utils/form/observe-control-value.ts","../../../projects/ui-common/utils/form/observe-control-is-different.ts","../../../projects/ui-common/utils/form/wait-on-non-pending-status.ts","../../../projects/ui-common/utils/form/observe-control-status.ts","../../../projects/ui-common/utils/form/observe-control-valid.ts","../../../projects/ui-common/utils/form/observe-control-value-change.ts","../../../projects/ui-common/utils/has-property.ts","../../../projects/ui-common/utils/form/has-required-control.ts","../../../projects/ui-common/utils/operators/map-each.ts","../../../projects/ui-common/utils/operators/tap-first.ts","../../../projects/ui-common/utils/router/leaf-child-route.ts","../../../projects/ui-common/utils/router/operators/activated-routes-with-data-property.ts","../../../projects/ui-common/utils/router/route-snapshot-path-relative.ts","../../../projects/ui-common/utils/router/route-snapshot-path-full.ts","../../../projects/ui-common/utils/calc-percentage.ts","../../../projects/ui-common/utils/toggle-attribute.ts","../../../projects/ui-common/utils/input-masks.ts","../../../projects/ui-common/utils/is-null-or-undefined.ts","../../../projects/ui-common/utils/load-style.ts","../../../projects/ui-common/utils/load-style-sheet.ts","../../../projects/ui-common/utils/obj-utils.ts","../../../projects/ui-common/utils/file-utils.ts","../../../projects/ui-common/utils/not-null-or-undefined.ts","../../../projects/ui-common/utils/wait-on-condition-async.ts","../../../projects/ui-common/utils/polling-ticker.ts","../../../projects/ui-common/utils/refreshable.ts","../../../projects/ui-common/utils/wrap-into-observable.ts","../../../projects/ui-common/utils/is-absolute-url.ts","../../../projects/ui-common/utils/subscriber-count.ts","../../../projects/ui-common/utils/observe-query-list.ts","../../../projects/ui-common/utils/theseam-ui-common-utils.ts"],"sourcesContent":["/**\n *\n */\nexport function getAttribute<E extends HTMLElement>(element: E, name: string): string | null {\n return element.getAttribute(name)\n}\n","/**\n *\n */\nexport function hasAttribute<E extends HTMLElement>(element: E, name: string): boolean {\n return element.hasAttribute(name)\n}\n","import { CdkDrag } from '@angular/cdk/drag-drop'\nimport { ElementRef } from '@angular/core'\n\nimport { getAttribute } from '../get-attribute'\nimport { hasAttribute } from '../has-attribute'\n\n/**\n * Finds the closest CdkDrag to an element by looking at the DOM.\n * @param element Element relative to which to look for a cdkDrag.\n * @param openDialogs References to the currently available cdkDrag.\n */\nexport function getClosestWidgetCdkDrag(element: ElementRef<HTMLElement>, dragDirectives: CdkDrag<any>[]) {\n let parent: HTMLElement | null = element.nativeElement.parentElement\n\n while (parent && !(parent.classList.contains('cdk-drag') && hasAttribute(parent, 'data-widget-id'))) {\n parent = parent.parentElement\n }\n\n const parentId = parent ? getAttribute(parent, 'data-widget-id') : null\n return parentId ?\n dragDirectives.find(drag => getAttribute(drag.getRootElement(), 'data-widget-id') === parentId)\n : null\n}\n","import { AbstractControl } from '@angular/forms'\n\n/**\n * Get the name of the control.\n *\n * Example:\n *\n * ```js\n * const group = new FormGroup({\n * name: new Control(),\n * age: new Control()\n * })\n *\n * for (const c of group.controls) {\n * console.log(getControlName(c))\n * }\n *\n * // Output:\n * // >> 'name'\n * // >> 'age'\n * ```\n */\nexport function getControlName(c: AbstractControl): string | null {\n if (!c.parent) { return null }\n // NOTE: Typed as 'any' because using string for array index is not valid for\n // array index type, but it works and we actually want the index as a string\n // anyway.\n const controls: any = c.parent.controls\n return Object.keys(controls).find(name => c === controls[name]) || null\n}\n","import { AbstractControl } from '@angular/forms'\n\nimport { getControlName } from './get-control-name'\n\n/**\n * Get the path to a control.\n *\n * The path is built by walking back the `parent` properties until `parent` is\n * `null`.\n *\n * Example:\n *\n * ```js\n * const group = new FormGroup({\n * name: new FormControl(),\n * address: new FormGroup({\n * city: new FormControl(),\n * state: new FormControl()\n * })\n * })\n *\n * const control = group.get('address.city')\n * console.log(getControlPath(control))\n *\n * // Output:\n * >> 'address.city'\n * ```\n *\n */\nexport function getControlPath(c: AbstractControl, path: string = ''): string | null {\n path = getControlName(c) + path\n\n if (c.parent && getControlName(c.parent)) {\n path = '.' + path\n return getControlPath(c.parent, path)\n } else {\n return path\n }\n}\n","import { AbstractControl } from '@angular/forms'\nimport { Observable, of } from 'rxjs'\nimport { startWith, switchMap } from 'rxjs/operators'\n\n/**\n * Observe the value of a control.\n */\nexport function observeControlValue<T = any>(control: AbstractControl): Observable<T> {\n return of(control)\n .pipe(switchMap(_control => _control.valueChanges\n .pipe(startWith(_control.value))\n ))\n}\n","import { AbstractControl } from '@angular/forms'\nimport { Observable } from 'rxjs'\nimport { distinctUntilChanged, map } from 'rxjs/operators'\n\nimport { observeControlValue } from './observe-control-value'\n\n/**\n * Observe the changed state of the input value from the time this function is\n * called.\n *\n * When this function is called the value is stored. Each time the control's\n * value changes the value is compared with the initial value. Currenly the\n * values are compared as stringified objects using `JSON.stringify`.\n *\n * TODO: Allow the value compare implementation to be optionally changed.\n */\nexport function observeControlIsDifferent(control: AbstractControl): Observable<boolean> {\n const _initial = JSON.stringify(control.value)\n return observeControlValue(control)\n .pipe(\n map(value => JSON.stringify(value) !== _initial),\n distinctUntilChanged(),\n )\n}\n","import { AbstractControl } from '@angular/forms'\nimport { interval, merge, Observable } from 'rxjs'\nimport { filter, map, mapTo, startWith, take } from 'rxjs/operators'\n\n/**\n * Wait on the status of a form control to not be `'PENDING'`.\n *\n * NOTE: This function is mainly just a work around for an issue where\n * `statusChanges` sometimes emits `'Pending'` without emitting another state\n * when complete. Seems to happen with async validators if the value changes\n * before completing, even if the validator completes(subscription `complete`\n * if observable).\n */\nexport function waitOnNonPendingStatus(control: AbstractControl): Observable<string> {\n return merge(\n control.statusChanges,\n interval(30).pipe(mapTo(control), map(c => c.status))\n )\n .pipe(startWith(control.status))\n .pipe(filter(v => v !== 'PENDING'))\n .pipe(take(1))\n}\n","import { AbstractControl } from '@angular/forms'\nimport { Observable, of } from 'rxjs'\nimport { startWith, switchMap } from 'rxjs/operators'\n\nimport { waitOnNonPendingStatus } from './wait-on-non-pending-status'\n\n/**\n * Observe the status of a control using a work around for status not changing\n * after pending.\n */\nexport function observeControlStatus(control: AbstractControl): Observable<string> {\n return of(control)\n .pipe(switchMap(_control => _control.statusChanges\n .pipe(startWith(_control.status))\n .pipe(switchMap(status => status === 'PENDING'\n ? waitOnNonPendingStatus(control)\n .pipe(startWith(status))\n : of(status)\n ))\n ))\n}\n","import { AbstractControl } from '@angular/forms'\nimport { Observable } from 'rxjs'\nimport { distinctUntilChanged, map, pairwise, startWith } from 'rxjs/operators'\n\nimport { observeControlStatus } from './observe-control-status'\n\n/**\n * Observe the valid state of a control.\n *\n * By default `waitOnPending` is false and the control states map to:\n * 'VALID' => true\n * 'INVALID' => false\n * 'PENDING' => false\n *\n * If `waitOnPending` is true the valid result when 'PENDING' remains the same\n * as it was before 'PENDING' until it is no longer 'PENDING'.\n */\nexport function observeControlValid(control: AbstractControl, waitOnPending: boolean = false): Observable<boolean> {\n if (waitOnPending) {\n return observeControlStatus(control)\n .pipe(distinctUntilChanged())\n .pipe(startWith(undefined))\n .pipe(pairwise())\n .pipe(map(v => ({ previous: v[0], current: v[1] })))\n .pipe(map(v => v.current === 'PENDING' ? v.previous : v.current))\n .pipe(map(status => status === 'VALID'))\n } else {\n return observeControlStatus(control)\n .pipe(distinctUntilChanged())\n .pipe(map(status => status === 'VALID'))\n }\n}\n","import { AbstractControl } from '@angular/forms'\nimport { Observable } from 'rxjs'\nimport { map, pairwise, startWith } from 'rxjs/operators'\n\nimport { observeControlValue } from './observe-control-value'\n\n/**\n * Observe the value of a control with the previous.\n */\nexport function observeControlValueChange(control: AbstractControl): Observable<{ previous: any, current: any }> {\n return observeControlValue(control)\n .pipe(\n startWith(undefined),\n pairwise(),\n map(v => ({ previous: v[0], current: v[1] }))\n )\n}\n","// Source: https://stackoverflow.com/a/59361497/7926298\nexport function hasProperty<T extends object, K extends keyof T>(\n style: T,\n prop: K\n// ): style is T & { [P in K]-?: Exclude<T[K], undefined> } {\n): style is T & Required<Record<K, Exclude<T[K], undefined>>> {\n return style.hasOwnProperty(prop) && style[prop] !== undefined\n}\n","import { AbstractControl } from '@angular/forms'\n\nimport { hasProperty } from '../has-property'\n\n/**\n * Check if control has a required control.\n *\n * ----------------------------------------------------------------------------\n * NOTE: I am not sure about if this should be used or not.\n *\n * From my understanding this assumes that all the validators do not have some\n * unexpected side-effect from being called like this. It could be argued that\n * the validator is flawed and should be fixed if that is the case, but I am not\n * convinced that is correct yet.\n *\n * An example that I think is valid for this argument: A FormControl configured\n * to only check validators when a specific condition happens, because of a\n * reason that it has to do a long process. In that situation should this\n * function be smart enough to consider that or is it up to the validator to\n * consider this function possibly being used.\n *\n * This seems to assume the required validator will always be a synchronous\n * validator. That is a valid assumption if thinking about showing a required\n * state in the UI, but a FormControl does not neccessarily have to be used in\n * UI. So, I think it could be valid to have an async validator that uses the\n * name `required` for it error, but I do not have a good example, so I could be\n * wrong.\n * ----------------------------------------------------------------------------\n *\n * Source: https://gist.github.com/jsdevtom/5589af349a395b37e699b67417ef025b\n * @experimental\n * @ignore\n */\nexport function hasRequiredControl(abstractControl: AbstractControl): boolean {\n if (abstractControl.validator) {\n const validator = abstractControl.validator({}as AbstractControl)\n if (validator && validator.required) {\n return true\n }\n }\n\n const _abstractControl: any = abstractControl\n if (hasProperty(_abstractControl, 'controls')) {\n for (const controlName in _abstractControl.controls) {\n if (_abstractControl.controls[controlName]) {\n if (hasRequiredControl(_abstractControl.controls[controlName])) {\n return true\n }\n }\n }\n }\n\n return false\n}\n","import { from, Observable } from 'rxjs'\nimport { map, switchMap, toArray } from 'rxjs/operators'\n\nexport function mapEach<T, R>(predicate: (value: T) => R) {\n return (source$: Observable<T[]>): Observable<R[]> =>\n source$.pipe(switchMap(v => from(v).pipe(map(m => predicate(m)), toArray())))\n}\n","import { Observable } from 'rxjs'\nimport { tap } from 'rxjs/operators'\n\n/**\n * Like tap, but only calls predicate on first emission.\n */\nexport function tapFirst<T>(predicate: (value: T) => void) {\n let _initialized = false\n return (source$: Observable<T>): Observable<T> =>\n source$.pipe(\n tap(v => {\n if (!_initialized) {\n predicate(v)\n _initialized = true\n }\n })\n )\n}\n","import { ActivatedRoute } from '@angular/router'\n\nexport function leafChildRoute(activatedRoute: ActivatedRoute) {\n let route = activatedRoute\n while (route.firstChild) { route = route.firstChild }\n return route\n}\n","import { ActivatedRoute, Data } from '@angular/router'\nimport { combineLatest, Observable } from 'rxjs'\nimport { map, switchMap } from 'rxjs/operators'\n\nimport { leafChildRoute } from '../leaf-child-route'\n\nexport interface IActivatedRouteWithData {\n route: ActivatedRoute\n data: Data\n}\n\nfunction hasRouteConfigDataProp(route: ActivatedRoute, prop: string) {\n return !!(route && route.routeConfig && route.routeConfig.data && route.routeConfig.data.hasOwnProperty(prop))\n}\n\nfunction hasRouteConfigResolveProp(route: ActivatedRoute, prop: string) {\n return !!(route && route.routeConfig && route.routeConfig.resolve && route.routeConfig.resolve.hasOwnProperty(prop))\n}\n\nexport function activatedRoutesWithDataProperty(prop: string, mustHaveDefined: boolean = false) {\n const _data = (r: ActivatedRoute) => r.data.pipe(map(_d => ({ route: r, data: _d })))\n return (source$: Observable<ActivatedRoute>): Observable<IActivatedRouteWithData[]> =>\n source$.pipe(\n map(route => leafChildRoute(route)),\n map(route => route.pathFromRoot),\n switchMap(routes => combineLatest(routes.map(r => _data(r)))),\n map(v => v.filter(_v => _v.data.hasOwnProperty(prop))),\n map(v => mustHaveDefined\n ? v.filter(_v => hasRouteConfigDataProp(_v.route, prop) || hasRouteConfigResolveProp(_v.route, prop))\n : v\n )\n )\n}\n","import { ActivatedRouteSnapshot } from '@angular/router'\n\nexport function routeSnapshotPathRelative(route: ActivatedRouteSnapshot) {\n return route.url.reduce((path, urlSegment) => path += '/' + urlSegment.path, '')\n}\n","import { ActivatedRouteSnapshot } from '@angular/router'\n\nimport { routeSnapshotPathRelative } from './route-snapshot-path-relative'\n\nexport function routeSnapshotPathFull(route: ActivatedRouteSnapshot) {\n return route.pathFromRoot.reduce((path, _route) => path += routeSnapshotPathRelative(_route), '')\n}\n","export function calcPercentage(total: number, n: number) {\n return total && total > 0 ? (n / total) * 100 : 0\n}\n","/**\n * Polyfil for `Element.toggleAttribute`\n *\n * Toggles a value without a value. Useful for attributes, such as `disabled`,\n * `readonly`, and `hidden`, that only needs to exist on the `Element` without\n * requiring a value.\n *\n * Most browsers natively support this feature, but IE, which we still try to\n * support for at least the main parts of the app, has \"Unknown\" support of this\n * feature. Until IE support is dropped this polyfil should be used to toggle an\n * attribute.\n *\n * Source:\n * https://developer.mozilla.org/en-US/docs/Web/API/Element/toggleAttribute#Polyfill\n */\nexport function toggleAttribute(element: HTMLElement, name: string, force: boolean): boolean {\n if (force !== void 0) { force = !!force }\n\n if (element.getAttribute(name) !== null) {\n if (force) { return true }\n\n element.removeAttribute(name)\n return false\n } else {\n if (force === false) { return false }\n\n element.setAttribute(name, '')\n return true\n }\n}\n","export const phoneNumberMask = ['(', /[1-9]/, /\\d/, /\\d/, ')', ' ', /\\d/, /\\d/, /\\d/, '-', /\\d/, /\\d/, /\\d/, /\\d/]\n","export function isNullOrUndefined(value: any) {\n return value === undefined || value === null\n}\n","export function loadStyle(content: string): Promise<HTMLStyleElement> {\n return new Promise((resolve, reject) => {\n const s = document.createElement('style')\n s.onload = () => resolve(s)\n s.onerror = (e) => {\n document.head.removeChild(s)\n reject(e)\n }\n s.innerHTML = content\n document.head.appendChild(s)\n })\n}\n","export function loadStyleSheet(path: string): Promise<HTMLLinkElement> {\n return new Promise((resolve, reject) => {\n const s = document.createElement('link')\n s.onload = () => resolve(s)\n s.onerror = (e) => {\n document.head.removeChild(s)\n reject(e)\n }\n s.rel = 'stylesheet'\n s.href = path\n document.head.appendChild(s)\n })\n}\n","/** Returns object without property */\nexport function withoutProperty<T, K extends keyof T>(obj: T, propName: K): Pick<T, Exclude<keyof T, K>> {\n const { [propName]: _, ...without } = obj\n return without\n}\n\n/** Returns object without properties */\nexport function withoutProperties<T, K extends keyof T>(obj: T, propNames: K[]): Pick<T, Exclude<keyof T, K>> {\n let without: any = obj\n for (const propName of propNames) {\n without = withoutProperty(without, propName)\n }\n return without\n}\n\n/** Delete property of object */\nexport function deleteProperty<T extends {}, K extends keyof T>(obj: T, propName: K): void {\n if (obj.hasOwnProperty(propName)) {\n delete obj[propName]\n }\n}\n\n/** Delete properties of object */\nexport function deleteProperties<T, K extends keyof T>(obj: T, propNames: K[]): void {\n for (const propName of propNames) {\n deleteProperty(obj, propName)\n }\n}\n","import fileType from '@marklb/file-type'\n// import { Buffer } from 'buffer/'\nconst Buffer = require('buffer/').Buffer\n\nexport function readFileAsync(file: any): Promise<ArrayBuffer | null> {\n return new Promise<ArrayBuffer | null>((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = () => {\n resolve(reader.result as ArrayBuffer | null)\n }\n reader.readAsArrayBuffer(file)\n })\n}\n\nexport async function readFileAsDataUrlAsync(file: Blob): Promise<string | null> {\n return new Promise<string | null>((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = () => {\n resolve(reader.result as string | null)\n }\n reader.readAsDataURL(file)\n })\n}\n\nexport async function fileBufferToBlob(\n fileBuffer: Buffer,\n defaultMime: string = 'application/octet-stream'\n): Promise<Blob> {\n const fType = fileType(fileBuffer)\n const mime = (fType) ? fType.mime : defaultMime\n const blob = new Blob([fileBuffer as any], { type: mime })\n return blob\n}\n\nexport async function fileBufferToObjectUrl(\n fileBuffer: Buffer,\n defaultMime: string = 'application/octet-stream'\n): Promise<string> {\n const file = await fileBufferToBlob(fileBuffer, defaultMime)\n const fileURL = URL.createObjectURL(file)\n return fileURL\n}\n\nexport interface IFileData {\n ext?: string\n mime?: string\n blob: Blob\n}\n\nexport async function fileDataFromBuffer(\n fileBuffer: Buffer | Uint8Array | ArrayBuffer,\n defaultMime: string = 'application/octet-stream'\n): Promise<IFileData> {\n const _fileBuffer = Buffer.from(fileBuffer)\n const fType = fileType(_fileBuffer as any)\n const ext = fType && fType.ext || undefined\n const mime = fType ? fType.mime : defaultMime\n const blob = new Blob([_fileBuffer as any], { type: mime })\n const fileData: IFileData = { ext, mime, blob }\n return fileData\n}\n\nexport function openBlob(blob: Blob, target?: string, filename?: string) {\n // NOTE: IE and MSEdge do not allow Blob resources as a source for\n // tabs or iframes. msSaveOrOpenBlob is used as a workaround. I\n // haven't been able to find a way to just open the Blob file in\n // another tab yet for IE or MSEdge.\n if (window.navigator.msSaveOrOpenBlob) {\n window.navigator.msSaveOrOpenBlob(blob, filename)\n } else {\n const url = URL.createObjectURL(blob)\n const win = window.open(url, target)\n // TODO: Consider if always setting opener to null is to restrictive\n // if (win && target && target.toLowerCase() === '_blank') {\n // win.opener = null\n // }\n\n }\n}\n","export function notNullOrUndefined<T>(value: T | null | undefined): value is T {\n return value !== null && value !== undefined\n}\n","export async function waitOnConditionAsync(\n condition: () => boolean,\n timeoutDuration: number = -1,\n throwOnTimeout: boolean = true\n): Promise<any> {\n const timeStart: any = new Date()\n\n const _waitFunc = (callback: (boolean: boolean) => any) => {\n let conditionSuccess = false\n\n if (condition()) {\n callback(true)\n conditionSuccess = true\n }\n\n if (!conditionSuccess) {\n const timeNow: any = new Date()\n const duration = timeNow - timeStart\n if (timeoutDuration > -1 && duration > timeoutDuration) {\n if (throwOnTimeout) {\n throw new Error('Timed out waiting on condition.')\n } else {\n callback(false)\n }\n }\n\n setTimeout(() => { _waitFunc(callback) }, 30)\n }\n }\n\n return new Promise((resolve, reject) => {\n const fn = (b: boolean) => {\n resolve(b)\n }\n _waitFunc(fn)\n })\n}\n","import { isObservable, Observable, Subscriber, Subscription } from 'rxjs'\n\nclass IntervalTimer {\n\n private _intervalTime: number\n private _intervalId: number | null = null\n\n constructor(\n private _callback: () => void,\n intervalTime: number,\n startOnInit: boolean = true\n ) {\n this._intervalTime = intervalTime\n if (startOnInit) {\n this.start()\n }\n }\n\n set intervalTime(time: number) {\n this._intervalTime = time\n }\n\n public start(): void {\n if (this._intervalId === null) {\n this._intervalId = window.setInterval(() => {\n this._callback()\n }, this._intervalTime)\n }\n }\n\n public stop(): void {\n if (this._intervalId !== null) {\n clearInterval(this._intervalId)\n this._intervalId = null\n }\n }\n\n public reset(newIntervalTime?: number): void {\n if (newIntervalTime) {\n this.intervalTime = newIntervalTime\n }\n this.stop()\n this.start()\n }\n\n}\n\nexport type PollingActionFn<R> = () => R | Observable<R>\n\n// tslint:disable:no-inferrable-types\nexport class PollingTickerOptions {\n emitOnInit?: boolean = true\n}\n// tslint:enable:no-inferrable-types\n\n// TODO: Simplify complexity.\n\n/**\n * Call an action and emits the result to its subscriber on an interval or when\n * ticker emits. When the ticker emits, the interval time will reset.\n *\n * When subscribed to, the action will be called and emitted right away unless\n * the `emitOnInit` option is set to false.\n */\nexport function pollingTicker<R>(\n action: PollingActionFn<R>,\n pollingInterval?: number,\n ticker?: Observable<number | void>,\n options?: PollingTickerOptions\n): Observable<R> {\n return new Observable((subscriber: Subscriber<R>) => {\n const _opts = { ...(new PollingTickerOptions()), ...(options || {}) }\n\n let timer: IntervalTimer | null = null\n let actionSub: Subscription | null = null\n let tickerSub: Subscription | null = null\n\n try {\n const handleAction = () => {\n if (timer) { timer.stop() }\n\n const actionResult = action()\n\n if (isObservable(actionResult)) {\n if (actionSub) {\n actionSub.unsubscribe()\n }\n actionSub = actionResult.subscribe(\n (v: R) => { subscriber.next(v); if (timer) { timer.reset() } },\n (err) => { subscriber.error(err) },\n () => {\n actionSub = null\n if (timer) { timer.start() }\n }\n )\n } else {\n subscriber.next(actionResult)\n }\n if (timer) { timer.start() }\n }\n\n if (_opts.emitOnInit) {\n handleAction()\n }\n\n if (pollingInterval) {\n timer = new IntervalTimer(() => {\n handleAction()\n }, pollingInterval)\n }\n\n if (ticker) {\n tickerSub = ticker.subscribe(newPollingInterval => {\n if (newPollingInterval && timer) {\n timer.stop()\n if (newPollingInterval) {\n timer.intervalTime = newPollingInterval\n }\n }\n handleAction()\n if (timer) { timer.reset() }\n })\n }\n } catch (err) {\n subscriber.error(err)\n }\n\n return () => {\n if (timer) {\n timer.stop()\n }\n if (actionSub) {\n actionSub.unsubscribe()\n }\n if (tickerSub) {\n tickerSub.unsubscribe()\n }\n }\n })\n}\n","import { BehaviorSubject, isObservable, Observable, Subject } from 'rxjs'\nimport { distinctUntilChanged, mapTo, publishReplay, refCount, shareReplay, skip, take, tap } from 'rxjs/operators'\n\nimport { tapFirst } from './operators/tap-first'\nimport { pollingTicker } from './polling-ticker'\n\nexport class Refreshable<T> {\n\n private _initialized = false\n private _pollingInterval = new BehaviorSubject<number>(0)\n private _ticker = new Subject<void>()\n private _pending = new BehaviorSubject<boolean>(false)\n\n public data$: Observable<T>\n public pending$: Observable<boolean>\n\n constructor(\n action: () => (T | Observable<T>),\n pollingInterval?: number\n ) {\n if (pollingInterval !== null && pollingInterval !== undefined) {\n this._pollingInterval.next(pollingInterval)\n }\n\n this.pending$ = this._pending.asObservable()\n .pipe(\n distinctUntilChanged(),\n shareReplay(1)\n )\n\n this.data$ = pollingTicker(this._actionHandler(action), pollingInterval, this._ticker)\n .pipe(\n tapFirst(() => this._initialized = true),\n publishReplay(),\n refCount()\n )\n }\n\n get initialized(): boolean { return this._initialized }\n\n /**\n * Intercepts the action call to monitor pending state\n */\n private _actionHandler = (action: () => (T | Observable<T>)) => {\n return () => {\n this._pending.next(true)\n\n const actionResult = action()\n if (isObservable(actionResult)) {\n return actionResult.pipe(tap(() => { this._pending.next(false) }))\n } else {\n this._pending.next(true)\n return actionResult\n }\n }\n }\n\n /**\n * Selects the data observable\n */\n public select(refresh?: boolean): Observable<T> {\n if (refresh && this._initialized && !this._pending.value) { this._ticker.next() }\n return this.data$\n }\n\n public refresh(): Observable<void> {\n let result$: Observable<any>\n\n if (this._initialized) {\n // TODO: Add a test and maybe refactor this to be more clear. It worked in\n // my manual tests, but there may be some situations where this doesn't\n // work, since the ticker isn't the only way to trigger a refresh. Right\n // now it should be fine, but if an async operator is added to be run\n // each time `data$` is subscribed to, then this could fail if the data\n // emits one extra time before the ticker is triggered.\n let _polled = false\n result$ = this.data$\n .pipe(\n tap(_ => !_polled && (_polled = true) && this._ticker.next()),\n skip(1)\n )\n } else {\n result$ = this.data$\n }\n\n return result$\n .pipe(\n take(1),\n mapTo(undefined)\n )\n }\n\n}\n","import { from, isObservable, Observable } from 'rxjs'\n\nexport function wrapIntoObservable<T>(value: T | Promise<T>| Observable<T>): Observable<T> {\n if (isObservable(value)) {\n return value\n }\n\n return from(Promise.resolve(value))\n}\n","\n/**\n * Explaination:\n * ^ - beginning of the string\n * (?: - beginning of a non-captured group\n * [a-z]+ - any character of 'a' to 'z' 1 or more times\n * : - string (colon character)\n * )? - end of the non-captured group. Group appearing 0 or 1 times\n * // - string (two forward slash characters)\n * 'i' - non case-sensitive flag\n *\n * source: https://stackoverflow.com/a/19709846\n */\nconst IS_ABSOLUTE_URL_REGEX = new RegExp('^(?:[a-z]+:)?//', 'i')\n\nexport function isAbsoluteUrl(url: string): boolean {\n return IS_ABSOLUTE_URL_REGEX.test(url)\n}\n","import { Observable, Subscriber } from 'rxjs'\n\n/**\n * This is just for helping debug observables that aren't being unsubscribed\n * from correctly.\n */\nfunction subscriberCount<T>(sourceObservable: Observable<T>, description: string) {\n let counter = 0\n return new Observable((subscriber: Subscriber<T>) => {\n const subscription = sourceObservable.subscribe(subscriber)\n counter++\n console.log(`${description} subscriptions: ${counter}`)\n\n return () => {\n subscription.unsubscribe()\n counter--\n console.log(`${description} subscriptions: ${counter}`)\n }\n })\n}\n","import { QueryList } from '@angular/core'\nimport { Observable } from 'rxjs'\nimport { map, startWith } from 'rxjs/operators'\n\nexport function observeQueryList<T>(queryList: QueryList<T>, emitCurrentValue = true): Observable<T[]> {\n return queryList.changes.pipe(\n startWith(queryList),\n map(v => v.toArray() as T[])\n )\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;SAGgB,YAAY,CAAwB,OAAU,EAAE,IAAY;IAC1E,OAAO,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;AACnC;;ACLA;;;SAGgB,YAAY,CAAwB,OAAU,EAAE,IAAY;IAC1E,OAAO,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;AACnC;;ACCA;;;;;SAKgB,uBAAuB,CAAC,OAAgC,EAAE,cAA8B;IACtG,IAAI,MAAM,GAAuB,OAAO,CAAC,aAAa,CAAC,aAAa,CAAA;IAEpE,OAAO,MAAM,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,YAAY,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,EAAE;QACnG,MAAM,GAAG,MAAM,CAAC,aAAa,CAAA;KAC9B;IAED,MAAM,QAAQ,GAAG,MAAM,GAAG,YAAY,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAAG,IAAI,CAAA;IACvE,OAAO,QAAQ;QACb,cAAc,CAAC,IAAI,CAAC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,gBAAgB,CAAC,KAAK,QAAQ,CAAC;UAC7F,IAAI,CAAA;AACV;;ACpBA;;;;;;;;;;;;;;;;;;;;SAoBgB,cAAc,CAAC,CAAkB;IAC/C,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE;QAAE,OAAO,IAAI,CAAA;KAAE;;;;IAI9B,MAAM,QAAQ,GAAQ,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAA;IACvC,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,QAAQ,CAAC,IA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e,CAAI,gBAA+B,EAAE,WAAmB;IAC9E,IAAI,OAAO,GAAG,CAAC,CAAA;IACf,OAAO,IAAI,UAAU,CAAC,CAAC,UAAyB;QAC9C,MAAM,YAAY,GAAG,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;QAC3D,OAAO,EAAE,CAAA;QACT,OAAO,CAAC,GAAG,CAAC,GAAG,WAAW,mBAAmB,OAAO,EAAE,CAAC,CAAA;QAEvD,OAAO;YACL,YAAY,CAAC,WAAW,EAAE,CAAA;YAC1B,OAAO,EAAE,CAAA;YACT,OAAO,CAAC,GAAG,CAAC,GAAG,WAAW,mBAAmB,OAAO,EAAE,CAAC,CAAA;SACxD,CAAA;KACF,CAAC,CAAA;AACJ;;SCfgB,gBAAgB,CAAI,SAAuB,EAAE,gBAAgB,GAAG,IAAI;IAClF,OAAO,SAAS,CAAC,OAAO,CAAC,IAAI,CAC3B,SAAS,CAAC,SAAS,CAAC,EACpB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAS,CAAC,CAC7B,CAAA;AACH;;ACTA;;;;;;"}
1
+ {"version":3,"file":"theseam-ui-common-utils.js","sources":["../../../projects/ui-common/utils/get-attribute.ts","../../../projects/ui-common/utils/has-attribute.ts","../../../projects/ui-common/utils/cdk/get-closest-widget-cdk-drag.ts","../../../projects/ui-common/utils/form/get-control-name.ts","../../../projects/ui-common/utils/form/get-control-path.ts","../../../projects/ui-common/utils/form/observe-control-value.ts","../../../projects/ui-common/utils/form/observe-control-is-different.ts","../../../projects/ui-common/utils/form/wait-on-non-pending-status.ts","../../../projects/ui-common/utils/form/observe-control-status.ts","../../../projects/ui-common/utils/form/observe-control-valid.ts","../../../projects/ui-common/utils/form/observe-control-value-change.ts","../../../projects/ui-common/utils/has-property.ts","../../../projects/ui-common/utils/form/has-required-control.ts","../../../projects/ui-common/utils/form/is-empty-input-value.ts","../../../projects/ui-common/utils/operators/map-each.ts","../../../projects/ui-common/utils/operators/tap-first.ts","../../../projects/ui-common/utils/router/leaf-child-route.ts","../../../projects/ui-common/utils/router/will-have-data-prop.ts","../../../projects/ui-common/utils/router/operators/activated-routes-with-data-property.ts","../../../projects/ui-common/utils/router/route-snapshot-path-relative.ts","../../../projects/ui-common/utils/router/route-snapshot-path-full.ts","../../../projects/ui-common/utils/router/is-empty-url-route.ts","../../../projects/ui-common/utils/calc-percentage.ts","../../../projects/ui-common/utils/toggle-attribute.ts","../../../projects/ui-common/utils/input-masks.ts","../../../projects/ui-common/utils/is-null-or-undefined.ts","../../../projects/ui-common/utils/load-style.ts","../../../projects/ui-common/utils/load-style-sheet.ts","../../../projects/ui-common/utils/obj-utils.ts","../../../projects/ui-common/utils/file-utils.ts","../../../projects/ui-common/utils/not-null-or-undefined.ts","../../../projects/ui-common/utils/wait-on-condition-async.ts","../../../projects/ui-common/utils/polling-ticker.ts","../../../projects/ui-common/utils/refreshable.ts","../../../projects/ui-common/utils/wrap-into-observable.ts","../../../projects/ui-common/utils/is-absolute-url.ts","../../../projects/ui-common/utils/subscriber-count.ts","../../../projects/ui-common/utils/observe-query-list.ts","../../../projects/ui-common/utils/create-padding.ts","../../../projects/ui-common/utils/pad-end.ts","../../../projects/ui-common/utils/pad-start.ts","../../../projects/ui-common/utils/is-numeric.ts","../../../projects/ui-common/utils/fractional-digits-count.ts","../../../projects/ui-common/utils/theseam-ui-common-utils.ts"],"sourcesContent":["/**\n *\n */\nexport function getAttribute<E extends HTMLElement>(element: E, name: string): string | null {\n return element.getAttribute(name)\n}\n","/**\n *\n */\nexport function hasAttribute<E extends HTMLElement>(element: E, name: string): boolean {\n return element.hasAttribute(name)\n}\n","import { CdkDrag } from '@angular/cdk/drag-drop'\nimport { ElementRef } from '@angular/core'\n\nimport { getAttribute } from '../get-attribute'\nimport { hasAttribute } from '../has-attribute'\n\n/**\n * Finds the closest CdkDrag to an element by looking at the DOM.\n * @param element Element relative to which to look for a cdkDrag.\n * @param openDialogs References to the currently available cdkDrag.\n */\nexport function getClosestWidgetCdkDrag(element: ElementRef<HTMLElement>, dragDirectives: CdkDrag<any>[]) {\n let parent: HTMLElement | null = element.nativeElement.parentElement\n\n while (parent && !(parent.classList.contains('cdk-drag') && hasAttribute(parent, 'data-widget-id'))) {\n parent = parent.parentElement\n }\n\n const parentId = parent ? getAttribute(parent, 'data-widget-id') : null\n return parentId ?\n dragDirectives.find(drag => getAttribute(drag.getRootElement(), 'data-widget-id') === parentId)\n : null\n}\n","import { AbstractControl } from '@angular/forms'\n\n/**\n * Get the name of the control.\n *\n * Example:\n *\n * ```js\n * const group = new FormGroup({\n * name: new Control(),\n * age: new Control()\n * })\n *\n * for (const c of group.controls) {\n * console.log(getControlName(c))\n * }\n *\n * // Output:\n * // >> 'name'\n * // >> 'age'\n * ```\n */\nexport function getControlName(c: AbstractControl): string | null {\n if (!c.parent) { return null }\n // NOTE: Typed as 'any' because using string for array index is not valid for\n // array index type, but it works and we actually want the index as a string\n // anyway.\n const controls: any = c.parent.controls\n return Object.keys(controls).find(name => c === controls[name]) || null\n}\n","import { AbstractControl } from '@angular/forms'\n\nimport { getControlName } from './get-control-name'\n\n/**\n * Get the path to a control.\n *\n * The path is built by walking back the `parent` properties until `parent` is\n * `null`.\n *\n * Example:\n *\n * ```js\n * const group = new FormGroup({\n * name: new FormControl(),\n * address: new FormGroup({\n * city: new FormControl(),\n * state: new FormControl()\n * })\n * })\n *\n * const control = group.get('address.city')\n * console.log(getControlPath(control))\n *\n * // Output:\n * >> 'address.city'\n * ```\n *\n */\nexport function getControlPath(c: AbstractControl, path: string = ''): string | null {\n path = getControlName(c) + path\n\n if (c.parent && getControlName(c.parent)) {\n path = '.' + path\n return getControlPath(c.parent, path)\n } else {\n return path\n }\n}\n","import { AbstractControl } from '@angular/forms'\nimport { Observable, of } from 'rxjs'\nimport { startWith, switchMap } from 'rxjs/operators'\n\n/**\n * Observe the value of a control.\n */\nexport function observeControlValue<T = any>(control: AbstractControl): Observable<T> {\n return of(control)\n .pipe(switchMap(_control => _control.valueChanges\n .pipe(startWith(_control.value))\n ))\n}\n","import { AbstractControl } from '@angular/forms'\nimport { Observable } from 'rxjs'\nimport { distinctUntilChanged, map } from 'rxjs/operators'\n\nimport { observeControlValue } from './observe-control-value'\n\n/**\n * Observe the changed state of the input value from the time this function is\n * called.\n *\n * When this function is called the value is stored. Each time the control's\n * value changes the value is compared with the initial value. Currenly the\n * values are compared as stringified objects using `JSON.stringify`.\n *\n * TODO: Allow the value compare implementation to be optionally changed.\n */\nexport function observeControlIsDifferent(control: AbstractControl): Observable<boolean> {\n const _initial = JSON.stringify(control.value)\n return observeControlValue(control)\n .pipe(\n map(value => JSON.stringify(value) !== _initial),\n distinctUntilChanged(),\n )\n}\n","import { AbstractControl } from '@angular/forms'\nimport { interval, merge, Observable } from 'rxjs'\nimport { filter, map, mapTo, startWith, take } from 'rxjs/operators'\n\n/**\n * Wait on the status of a form control to not be `'PENDING'`.\n *\n * NOTE: This function is mainly just a work around for an issue where\n * `statusChanges` sometimes emits `'Pending'` without emitting another state\n * when complete. Seems to happen with async validators if the value changes\n * before completing, even if the validator completes(subscription `complete`\n * if observable).\n */\nexport function waitOnNonPendingStatus(control: AbstractControl): Observable<string> {\n return merge(\n control.statusChanges,\n interval(30).pipe(mapTo(control), map(c => c.status))\n )\n .pipe(startWith(control.status))\n .pipe(filter(v => v !== 'PENDING'))\n .pipe(take(1))\n}\n","import { AbstractControl } from '@angular/forms'\nimport { Observable, of } from 'rxjs'\nimport { startWith, switchMap } from 'rxjs/operators'\n\nimport { waitOnNonPendingStatus } from './wait-on-non-pending-status'\n\n/**\n * Observe the status of a control using a work around for status not changing\n * after pending.\n */\nexport function observeControlStatus(control: AbstractControl): Observable<string> {\n return of(control)\n .pipe(switchMap(_control => _control.statusChanges\n .pipe(startWith(_control.status))\n .pipe(switchMap(status => status === 'PENDING'\n ? waitOnNonPendingStatus(control)\n .pipe(startWith(status))\n : of(status)\n ))\n ))\n}\n","import { AbstractControl } from '@angular/forms'\nimport { Observable } from 'rxjs'\nimport { distinctUntilChanged, map, pairwise, startWith } from 'rxjs/operators'\n\nimport { observeControlStatus } from './observe-control-status'\n\n/**\n * Observe the valid state of a control.\n *\n * By default `waitOnPending` is false and the control states map to:\n * 'VALID' => true\n * 'INVALID' => false\n * 'PENDING' => false\n *\n * If `waitOnPending` is true the valid result when 'PENDING' remains the same\n * as it was before 'PENDING' until it is no longer 'PENDING'.\n */\nexport function observeControlValid(control: AbstractControl, waitOnPending: boolean = false): Observable<boolean> {\n if (waitOnPending) {\n return observeControlStatus(control)\n .pipe(distinctUntilChanged())\n .pipe(startWith(undefined))\n .pipe(pairwise())\n .pipe(map(v => ({ previous: v[0], current: v[1] })))\n .pipe(map(v => v.current === 'PENDING' ? v.previous : v.current))\n .pipe(map(status => status === 'VALID'))\n } else {\n return observeControlStatus(control)\n .pipe(distinctUntilChanged())\n .pipe(map(status => status === 'VALID'))\n }\n}\n","import { AbstractControl } from '@angular/forms'\nimport { Observable } from 'rxjs'\nimport { map, pairwise, startWith } from 'rxjs/operators'\n\nimport { observeControlValue } from './observe-control-value'\n\n/**\n * Observe the value of a control with the previous.\n */\nexport function observeControlValueChange(control: AbstractControl): Observable<{ previous: any, current: any }> {\n return observeControlValue(control)\n .pipe(\n startWith(undefined),\n pairwise(),\n map(v => ({ previous: v[0], current: v[1] }))\n )\n}\n","// Source: https://stackoverflow.com/a/59361497/7926298\nexport function hasProperty<T extends object, K extends keyof T>(\n style: T,\n prop: K\n// ): style is T & { [P in K]-?: Exclude<T[K], undefined> } {\n): style is T & Required<Record<K, Exclude<T[K], undefined>>> {\n return style.hasOwnProperty(prop) && style[prop] !== undefined\n}\n","import { AbstractControl } from '@angular/forms'\n\nimport { hasProperty } from '../has-property'\n\n/**\n * Check if control has a required control.\n *\n * ----------------------------------------------------------------------------\n * NOTE: I am not sure about if this should be used or not.\n *\n * From my understanding this assumes that all the validators do not have some\n * unexpected side-effect from being called like this. It could be argued that\n * the validator is flawed and should be fixed if that is the case, but I am not\n * convinced that is correct yet.\n *\n * An example that I think is valid for this argument: A FormControl configured\n * to only check validators when a specific condition happens, because of a\n * reason that it has to do a long process. In that situation should this\n * function be smart enough to consider that or is it up to the validator to\n * consider this function possibly being used.\n *\n * This seems to assume the required validator will always be a synchronous\n * validator. That is a valid assumption if thinking about showing a required\n * state in the UI, but a FormControl does not neccessarily have to be used in\n * UI. So, I think it could be valid to have an async validator that uses the\n * name `required` for it error, but I do not have a good example, so I could be\n * wrong.\n * ----------------------------------------------------------------------------\n *\n * Source: https://gist.github.com/jsdevtom/5589af349a395b37e699b67417ef025b\n * @experimental\n * @ignore\n */\nexport function hasRequiredControl(abstractControl: AbstractControl): boolean {\n if (abstractControl.validator) {\n const validator = abstractControl.validator({}as AbstractControl)\n if (validator && validator.required) {\n return true\n }\n }\n\n const _abstractControl: any = abstractControl\n if (hasProperty(_abstractControl, 'controls')) {\n for (const controlName in _abstractControl.controls) {\n if (_abstractControl.controls[controlName]) {\n if (hasRequiredControl(_abstractControl.controls[controlName])) {\n return true\n }\n }\n }\n }\n\n return false\n}\n","// Source: https://github.com/angular/angular/blob/master/packages/forms/src/validators.ts#L16\nexport function isEmptyInputValue(value: any): boolean {\n // we don't check for string here so it also works with arrays\n return value == null || value.length === 0\n}\n","import { from, Observable } from 'rxjs'\nimport { map, switchMap, toArray } from 'rxjs/operators'\n\nexport function mapEach<T, R>(predicate: (value: T) => R) {\n return (source$: Observable<T[]>): Observable<R[]> =>\n source$.pipe(switchMap(v => from(v).pipe(map(m => predicate(m)), toArray())))\n}\n","import { Observable } from 'rxjs'\nimport { tap } from 'rxjs/operators'\n\n/**\n * Like tap, but only calls predicate on first emission.\n */\nexport function tapFirst<T>(predicate: (value: T) => void) {\n let _initialized = false\n return (source$: Observable<T>): Observable<T> =>\n source$.pipe(\n tap(v => {\n if (!_initialized) {\n predicate(v)\n _initialized = true\n }\n })\n )\n}\n","import { ActivatedRoute } from '@angular/router'\n\nexport function leafChildRoute(activatedRoute: ActivatedRoute): ActivatedRoute {\n let route = activatedRoute\n while (route.firstChild) { route = route.firstChild }\n return route\n}\n","import { ActivatedRoute } from '@angular/router'\n\nfunction hasRouteConfigDataProp(route: ActivatedRoute, prop: string): boolean {\n return !!(route && route.routeConfig && route.routeConfig.data && route.routeConfig.data.hasOwnProperty(prop))\n}\n\nfunction hasRouteConfigResolveProp(route: ActivatedRoute, prop: string): boolean {\n return !!(route && route.routeConfig && route.routeConfig.resolve && route.routeConfig.resolve.hasOwnProperty(prop))\n}\n\nexport function willHaveDataProp(route: ActivatedRoute, prop: string): boolean {\n return hasRouteConfigDataProp(route, prop) || hasRouteConfigResolveProp(route, prop)\n}\n","import { ActivatedRoute, Data } from '@angular/router'\nimport { combineLatest, Observable } from 'rxjs'\nimport { map, switchMap } from 'rxjs/operators'\n\nimport { leafChildRoute } from '../leaf-child-route'\nimport { willHaveDataProp } from '../will-have-data-prop'\n\nexport interface IActivatedRouteWithData {\n route: ActivatedRoute\n data: Data\n}\n\nexport function activatedRoutesWithDataProperty(prop: string, mustHaveDefined: boolean = false) {\n const _data = (r: ActivatedRoute) => r.data.pipe(map(_d => ({ route: r, data: _d })))\n return (source$: Observable<ActivatedRoute>): Observable<IActivatedRouteWithData[]> =>\n source$.pipe(\n map(route => leafChildRoute(route)),\n map(route => route.pathFromRoot),\n switchMap(routes => combineLatest(routes.map(r => _data(r)))),\n map(v => v.filter(_v => _v.data.hasOwnProperty(prop))),\n map(v => mustHaveDefined\n ? v.filter(_v => willHaveDataProp(_v.route, prop))\n : v\n )\n )\n}\n","import { ActivatedRouteSnapshot } from '@angular/router'\n\nexport function routeSnapshotPathRelative(route: ActivatedRouteSnapshot) {\n return route.url.reduce((path, urlSegment) => path += '/' + urlSegment.path, '')\n}\n","import { ActivatedRouteSnapshot } from '@angular/router'\n\nimport { routeSnapshotPathRelative } from './route-snapshot-path-relative'\n\nexport function routeSnapshotPathFull(route: ActivatedRouteSnapshot) {\n return route.pathFromRoot.reduce((path, _route) => path += routeSnapshotPathRelative(_route), '')\n}\n","import { ActivatedRoute } from '@angular/router'\n\nexport function isEmptyUrlRoute(activatedRoute: ActivatedRoute): boolean {\n return activatedRoute.snapshot.url.length === 0\n}\n","export function calcPercentage(total: number, n: number) {\n return total && total > 0 ? (n / total) * 100 : 0\n}\n","/**\n * Polyfil for `Element.toggleAttribute`\n *\n * Toggles a value without a value. Useful for attributes, such as `disabled`,\n * `readonly`, and `hidden`, that only needs to exist on the `Element` without\n * requiring a value.\n *\n * Most browsers natively support this feature, but IE, which we still try to\n * support for at least the main parts of the app, has \"Unknown\" support of this\n * feature. Until IE support is dropped this polyfil should be used to toggle an\n * attribute.\n *\n * Source:\n * https://developer.mozilla.org/en-US/docs/Web/API/Element/toggleAttribute#Polyfill\n */\nexport function toggleAttribute(element: HTMLElement, name: string, force: boolean): boolean {\n if (force !== void 0) { force = !!force }\n\n if (element.getAttribute(name) !== null) {\n if (force) { return true }\n\n element.removeAttribute(name)\n return false\n } else {\n if (force === false) { return false }\n\n element.setAttribute(name, '')\n return true\n }\n}\n","export const phoneNumberMask = ['(', /[1-9]/, /\\d/, /\\d/, ')', ' ', /\\d/, /\\d/, /\\d/, '-', /\\d/, /\\d/, /\\d/, /\\d/]\n","export function isNullOrUndefined(value: any) {\n return value === undefined || value === null\n}\n","export function loadStyle(content: string): Promise<HTMLStyleElement> {\n return new Promise((resolve, reject) => {\n const s = document.createElement('style')\n s.onload = () => resolve(s)\n s.onerror = (e) => {\n document.head.removeChild(s)\n reject(e)\n }\n s.innerHTML = content\n document.head.appendChild(s)\n })\n}\n","export function loadStyleSheet(path: string): Promise<HTMLLinkElement> {\n return new Promise((resolve, reject) => {\n const s = document.createElement('link')\n s.onload = () => resolve(s)\n s.onerror = (e) => {\n document.head.removeChild(s)\n reject(e)\n }\n s.rel = 'stylesheet'\n s.href = path\n document.head.appendChild(s)\n })\n}\n","/** Returns object without property */\nexport function withoutProperty<T, K extends keyof T>(obj: T, propName: K): Pick<T, Exclude<keyof T, K>> {\n const { [propName]: _, ...without } = obj\n return without\n}\n\n/** Returns object without properties */\nexport function withoutProperties<T, K extends keyof T>(obj: T, propNames: K[]): Pick<T, Exclude<keyof T, K>> {\n let without: any = obj\n for (const propName of propNames) {\n without = withoutProperty(without, propName)\n }\n return without\n}\n\n/** Delete property of object */\nexport function deleteProperty<T extends {}, K extends keyof T>(obj: T, propName: K): void {\n if (obj.hasOwnProperty(propName)) {\n delete obj[propName]\n }\n}\n\n/** Delete properties of object */\nexport function deleteProperties<T, K extends keyof T>(obj: T, propNames: K[]): void {\n for (const propName of propNames) {\n deleteProperty(obj, propName)\n }\n}\n","import fileType from '@marklb/file-type'\n// import { Buffer } from 'buffer/'\nconst Buffer = require('buffer/').Buffer\n\nexport function readFileAsync(file: any): Promise<ArrayBuffer | null> {\n return new Promise<ArrayBuffer | null>((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = () => {\n resolve(reader.result as ArrayBuffer | null)\n }\n reader.readAsArrayBuffer(file)\n })\n}\n\nexport async function readFileAsDataUrlAsync(file: Blob): Promise<string | null> {\n return new Promise<string | null>((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = () => {\n resolve(reader.result as string | null)\n }\n reader.readAsDataURL(file)\n })\n}\n\nexport async function fileBufferToBlob(\n fileBuffer: Buffer,\n defaultMime: string = 'application/octet-stream'\n): Promise<Blob> {\n const fType = fileType(fileBuffer)\n const mime = (fType) ? fType.mime : defaultMime\n const blob = new Blob([fileBuffer as any], { type: mime })\n return blob\n}\n\nexport async function fileBufferToObjectUrl(\n fileBuffer: Buffer,\n defaultMime: string = 'application/octet-stream'\n): Promise<string> {\n const file = await fileBufferToBlob(fileBuffer, defaultMime)\n const fileURL = URL.createObjectURL(file)\n return fileURL\n}\n\nexport interface IFileData {\n ext?: string\n mime?: string\n blob: Blob\n}\n\nexport async function fileDataFromBuffer(\n fileBuffer: Buffer | Uint8Array | ArrayBuffer,\n defaultMime: string = 'application/octet-stream'\n): Promise<IFileData> {\n const _fileBuffer = Buffer.from(fileBuffer)\n const fType = fileType(_fileBuffer as any)\n const ext = fType && fType.ext || undefined\n const mime = fType ? fType.mime : defaultMime\n const blob = new Blob([_fileBuffer as any], { type: mime })\n const fileData: IFileData = { ext, mime, blob }\n return fileData\n}\n\nexport function openBlob(blob: Blob, target?: string, filename?: string) {\n // NOTE: IE and MSEdge do not allow Blob resources as a source for\n // tabs or iframes. msSaveOrOpenBlob is used as a workaround. I\n // haven't been able to find a way to just open the Blob file in\n // another tab yet for IE or MSEdge.\n if (window.navigator.msSaveOrOpenBlob) {\n window.navigator.msSaveOrOpenBlob(blob, filename)\n } else {\n const url = URL.createObjectURL(blob)\n const win = window.open(url, target)\n // TODO: Consider if always setting opener to null is to restrictive\n // if (win && target && target.toLowerCase() === '_blank') {\n // win.opener = null\n // }\n\n }\n}\n","export function notNullOrUndefined<T>(value: T | null | undefined): value is T {\n return value !== null && value !== undefined\n}\n","export async function waitOnConditionAsync(\n condition: () => boolean,\n timeoutDuration: number = -1,\n throwOnTimeout: boolean = true\n): Promise<any> {\n const timeStart: any = new Date()\n\n const _waitFunc = (callback: (boolean: boolean) => any) => {\n let conditionSuccess = false\n\n if (condition()) {\n callback(true)\n conditionSuccess = true\n }\n\n if (!conditionSuccess) {\n const timeNow: any = new Date()\n const duration = timeNow - timeStart\n if (timeoutDuration > -1 && duration > timeoutDuration) {\n if (throwOnTimeout) {\n throw new Error('Timed out waiting on condition.')\n } else {\n callback(false)\n }\n }\n\n setTimeout(() => { _waitFunc(callback) }, 30)\n }\n }\n\n return new Promise((resolve, reject) => {\n const fn = (b: boolean) => {\n resolve(b)\n }\n _waitFunc(fn)\n })\n}\n","import { isObservable, Observable, Subscriber, Subscription } from 'rxjs'\n\nclass IntervalTimer {\n\n private _intervalTime: number\n private _intervalId: number | null = null\n\n constructor(\n private _callback: () => void,\n intervalTime: number,\n startOnInit: boolean = true\n ) {\n this._intervalTime = intervalTime\n if (startOnInit) {\n this.start()\n }\n }\n\n set intervalTime(time: number) {\n this._intervalTime = time\n }\n\n public start(): void {\n if (this._intervalId === null) {\n this._intervalId = window.setInterval(() => {\n this._callback()\n }, this._intervalTime)\n }\n }\n\n public stop(): void {\n if (this._intervalId !== null) {\n clearInterval(this._intervalId)\n this._intervalId = null\n }\n }\n\n public reset(newIntervalTime?: number): void {\n if (newIntervalTime) {\n this.intervalTime = newIntervalTime\n }\n this.stop()\n this.start()\n }\n\n}\n\nexport type PollingActionFn<R> = () => R | Observable<R>\n\n// tslint:disable:no-inferrable-types\nexport class PollingTickerOptions {\n emitOnInit?: boolean = true\n}\n// tslint:enable:no-inferrable-types\n\n// TODO: Simplify complexity.\n\n/**\n * Call an action and emits the result to its subscriber on an interval or when\n * ticker emits. When the ticker emits, the interval time will reset.\n *\n * When subscribed to, the action will be called and emitted right away unless\n * the `emitOnInit` option is set to false.\n */\nexport function pollingTicker<R>(\n action: PollingActionFn<R>,\n pollingInterval?: number,\n ticker?: Observable<number | void>,\n options?: PollingTickerOptions\n): Observable<R> {\n return new Observable((subscriber: Subscriber<R>) => {\n const _opts = { ...(new PollingTickerOptions()), ...(options || {}) }\n\n let timer: IntervalTimer | null = null\n let actionSub: Subscription | null = null\n let tickerSub: Subscription | null = null\n\n try {\n const handleAction = () => {\n if (timer) { timer.stop() }\n\n const actionResult = action()\n\n if (isObservable(actionResult)) {\n if (actionSub) {\n actionSub.unsubscribe()\n }\n actionSub = actionResult.subscribe(\n (v: R) => { subscriber.next(v); if (timer) { timer.reset() } },\n (err) => { subscriber.error(err) },\n () => {\n actionSub = null\n if (timer) { timer.start() }\n }\n )\n } else {\n subscriber.next(actionResult)\n }\n if (timer) { timer.start() }\n }\n\n if (_opts.emitOnInit) {\n handleAction()\n }\n\n if (pollingInterval) {\n timer = new IntervalTimer(() => {\n handleAction()\n }, pollingInterval)\n }\n\n if (ticker) {\n tickerSub = ticker.subscribe(newPollingInterval => {\n if (newPollingInterval && timer) {\n timer.stop()\n if (newPollingInterval) {\n timer.intervalTime = newPollingInterval\n }\n }\n handleAction()\n if (timer) { timer.reset() }\n })\n }\n } catch (err) {\n subscriber.error(err)\n }\n\n return () => {\n if (timer) {\n timer.stop()\n }\n if (actionSub) {\n actionSub.unsubscribe()\n }\n if (tickerSub) {\n tickerSub.unsubscribe()\n }\n }\n })\n}\n","import { BehaviorSubject, isObservable, Observable, Subject } from 'rxjs'\nimport { distinctUntilChanged, mapTo, publishReplay, refCount, shareReplay, skip, take, tap } from 'rxjs/operators'\n\nimport { tapFirst } from './operators/tap-first'\nimport { pollingTicker } from './polling-ticker'\n\nexport class Refreshable<T> {\n\n private _initialized = false\n private _pollingInterval = new BehaviorSubject<number>(0)\n private _ticker = new Subject<void>()\n private _pending = new BehaviorSubject<boolean>(false)\n\n public data$: Observable<T>\n public pending$: Observable<boolean>\n\n constructor(\n action: () => (T | Observable<T>),\n pollingInterval?: number\n ) {\n if (pollingInterval !== null && pollingInterval !== undefined) {\n this._pollingInterval.next(pollingInterval)\n }\n\n this.pending$ = this._pending.asObservable()\n .pipe(\n distinctUntilChanged(),\n shareReplay(1)\n )\n\n this.data$ = pollingTicker(this._actionHandler(action), pollingInterval, this._ticker)\n .pipe(\n tapFirst(() => this._initialized = true),\n publishReplay(),\n refCount()\n )\n }\n\n get initialized(): boolean { return this._initialized }\n\n /**\n * Intercepts the action call to monitor pending state\n */\n private _actionHandler = (action: () => (T | Observable<T>)) => {\n return () => {\n this._pending.next(true)\n\n const actionResult = action()\n if (isObservable(actionResult)) {\n return actionResult.pipe(tap(() => { this._pending.next(false) }))\n } else {\n this._pending.next(true)\n return actionResult\n }\n }\n }\n\n /**\n * Selects the data observable\n */\n public select(refresh?: boolean): Observable<T> {\n if (refresh && this._initialized && !this._pending.value) { this._ticker.next() }\n return this.data$\n }\n\n public refresh(): Observable<void> {\n let result$: Observable<any>\n\n if (this._initialized) {\n // TODO: Add a test and maybe refactor this to be more clear. It worked in\n // my manual tests, but there may be some situations where this doesn't\n // work, since the ticker isn't the only way to trigger a refresh. Right\n // now it should be fine, but if an async operator is added to be run\n // each time `data$` is subscribed to, then this could fail if the data\n // emits one extra time before the ticker is triggered.\n let _polled = false\n result$ = this.data$\n .pipe(\n tap(_ => !_polled && (_polled = true) && this._ticker.next()),\n skip(1)\n )\n } else {\n result$ = this.data$\n }\n\n return result$\n .pipe(\n take(1),\n mapTo(undefined)\n )\n }\n\n}\n","import { from, isObservable, Observable } from 'rxjs'\n\nexport function wrapIntoObservable<T>(value: T | Promise<T>| Observable<T>): Observable<T> {\n if (isObservable(value)) {\n return value\n }\n\n return from(Promise.resolve(value))\n}\n","\n/**\n * Explaination:\n * ^ - beginning of the string\n * (?: - beginning of a non-captured group\n * [a-z]+ - any character of 'a' to 'z' 1 or more times\n * : - string (colon character)\n * )? - end of the non-captured group. Group appearing 0 or 1 times\n * // - string (two forward slash characters)\n * 'i' - non case-sensitive flag\n *\n * source: https://stackoverflow.com/a/19709846\n */\nconst IS_ABSOLUTE_URL_REGEX = new RegExp('^(?:[a-z]+:)?//', 'i')\n\nexport function isAbsoluteUrl(url: string): boolean {\n return IS_ABSOLUTE_URL_REGEX.test(url)\n}\n","import { Observable, Subscriber } from 'rxjs'\n\n/**\n * This is just for helping debug observables that aren't being unsubscribed\n * from correctly.\n */\nfunction subscriberCount<T>(sourceObservable: Observable<T>, description: string) {\n let counter = 0\n return new Observable((subscriber: Subscriber<T>) => {\n const subscription = sourceObservable.subscribe(subscriber)\n counter++\n console.log(`${description} subscriptions: ${counter}`)\n\n return () => {\n subscription.unsubscribe()\n counter--\n console.log(`${description} subscriptions: ${counter}`)\n }\n })\n}\n","import { QueryList } from '@angular/core'\nimport { Observable } from 'rxjs'\nimport { map, startWith } from 'rxjs/operators'\n\nexport function observeQueryList<T>(queryList: QueryList<T>, emitCurrentValue = true): Observable<T[]> {\n return queryList.changes.pipe(\n startWith(queryList),\n map(v => v.toArray() as T[])\n )\n}\n","\nexport function createPadding(len: number, chars: string): string {\n // if (chars.length <= len) {\n // return chars\n // }\n\n if (chars.length === 0) {\n throw Error(`Padding characters must be at least 1 char length.`)\n }\n\n let str = chars\n while (str.length < len) {\n str += chars\n }\n\n if (str.length > len) {\n str = str.slice(0, len)\n }\n\n return str\n}\n","import { createPadding } from './create-padding'\n\nexport function padEnd(\n stringToPad: string,\n paddingLength: number | undefined = 0,\n paddingChars: string | undefined = ' '\n): string {\n const strLength = paddingLength ? stringToPad.length : 0\n\n if (!paddingLength || strLength >= paddingLength) {\n return stringToPad\n }\n\n return stringToPad + createPadding(paddingLength - strLength, paddingChars)\n}\n","import { createPadding } from './create-padding'\n\nexport function padStart(\n stringToPad: string,\n paddingLength: number | undefined = 0,\n paddingChars: string | undefined = ' '\n): string {\n const strLength = paddingLength ? stringToPad.length : 0\n\n if (!paddingLength || strLength >= paddingLength) {\n return stringToPad\n }\n\n return createPadding(paddingLength - strLength, paddingChars) + stringToPad\n}\n","export function isNumeric(value: any): boolean {\n return !isNaN(Number(value) - parseFloat(value))\n}\n","import { isNumeric } from './is-numeric'\n\n/**\n * Returns the number of fractional digits.\n *\n * NOTE: This is intended for input validation, so trailing 0's will be included\n * in the total. Also, localization is not considered, so '.' is assumed to be\n * the fractional separator.\n */\nexport function fractionalDigitsCount(value: string): number | null {\n if (!isNumeric(value)) {\n return null\n }\n\n const a = value.split('.')\n if (a.length !== 2) {\n return null\n }\n\n return a[1].length\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;SAGgB,YAAY,CAAwB,OAAU,EAAE,IAAY;IAC1E,OAAO,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;AACnC;;ACLA;;;SAGgB,YAAY,CAAwB,OAAU,EAAE,IAAY;IAC1E,OAAO,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;AACnC;;ACCA;;;;;SAKgB,uBAAuB,CAAC,OAAgC,EAAE,cAA8B;IACtG,IAAI,MAAM,GAAuB,OAAO,CAAC,aAAa,CAAC,aAAa,CAAA;IAEpE,OAAO,MAAM,IAAI,EAA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AoC,CAAC,EACrC,eAAmC,GAAG;IAEtC,MAAM,SAAS,GAAG,aAAa,GAAG,WAAW,CAAC,MAAM,GAAG,CAAC,CAAA;IAExD,IAAI,CAAC,aAAa,IAAI,SAAS,IAAI,aAAa,EAAE;QAChD,OAAO,WAAW,CAAA;KACnB;IAED,OAAO,aAAa,CAAC,aAAa,GAAG,SAAS,EAAE,YAAY,CAAC,GAAG,WAAW,CAAA;AAC7E;;SCdgB,SAAS,CAAC,KAAU;IAClC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAA;AAClD;;ACAA;;;;;;;SAOgB,qBAAqB,CAAC,KAAa;IACjD,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;QACrB,OAAO,IAAI,CAAA;KACZ;IAED,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC1B,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QAClB,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;AACpB;;ACpBA;;;;;;"}
@@ -1,5 +1,7 @@
1
1
  import { isObservable } from 'rxjs';
2
2
  import { map } from 'rxjs/operators';
3
+ import { Validators } from '@angular/forms';
4
+ import { isEmptyInputValue, isNumeric } from '@theseam/ui-common/utils';
3
5
 
4
6
  /**
5
7
  * Validates that value matches on of the following:
@@ -38,9 +40,55 @@ function phoneLengthValidator(control) {
38
40
  ? null : { 'phoneLength': {} };
39
41
  }
40
42
 
43
+ const DECIMAL_REGEX = /^([-+]{1})?\d*(\.\d*)?$/;
44
+ function _decimalValidator() {
45
+ return (control) => {
46
+ if (isEmptyInputValue(control.value)) {
47
+ return null; // don't validate empty values to allow optional controls
48
+ }
49
+ const isDecimal = !Array.isArray(control.value) &&
50
+ isNumeric(control.value) &&
51
+ (Validators.pattern(DECIMAL_REGEX)(control) === null);
52
+ if (!isDecimal) {
53
+ return { 'decimal': { 'reason': 'Must be valid decimal number.' } };
54
+ }
55
+ return null;
56
+ };
57
+ }
58
+ /**
59
+ * Validates control value is a valid decimal number.
60
+ *
61
+ * NOTE: This does not allow any js valid decimal number. It only accepts them
62
+ * in a format expected by our backend.
63
+ */
64
+ const decimalValidator = _decimalValidator();
65
+
66
+ const INTEGER_REGEX = /^([-+]{1})?[0-9]*$/;
67
+ function _integerValidator() {
68
+ return (control) => {
69
+ if (isEmptyInputValue(control.value)) {
70
+ return null; // don't validate empty values to allow optional controls
71
+ }
72
+ const isInteger = !Array.isArray(control.value) &&
73
+ isNumeric(control.value) &&
74
+ (Validators.pattern(INTEGER_REGEX)(control) === null);
75
+ if (!isInteger) {
76
+ return { 'integer': { 'reason': 'Must be valid integer.' } };
77
+ }
78
+ return null;
79
+ };
80
+ }
81
+ /**
82
+ * Validates control value is a valid integer number.
83
+ *
84
+ * NOTE: This does not allow any js valid integer number. It only accepts them
85
+ * in a format expected by our backend.
86
+ */
87
+ const integerValidator = _integerValidator();
88
+
41
89
  /**
42
90
  * Generated bundle index. Do not edit.
43
91
  */
44
92
 
45
- export { emailExistsValidator, phoneLengthValidator, taxIdValidator };
93
+ export { DECIMAL_REGEX, INTEGER_REGEX, decimalValidator, emailExistsValidator, integerValidator, phoneLengthValidator, taxIdValidator };
46
94
  //# sourceMappingURL=theseam-ui-common-validators.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"theseam-ui-common-validators.js","sources":["../../../projects/ui-common/validators/tax-id.validator.ts","../../../projects/ui-common/validators/email-exists.validator.ts","../../../projects/ui-common/validators/phone-length.validator.ts","../../../projects/ui-common/validators/theseam-ui-common-validators.ts"],"sourcesContent":["import { FormControl } from '@angular/forms'\n\n/**\n * Validates that value matches on of the following:\n * '' // empty string\n * 'xxxxxxxxx' // 'x' is a number\n * 'xx-xxxxxxx' // 'x' is a number\n * 'xxx-xx-xxxx' // 'x' is a number\n */\nexport function taxIdValidator(control: FormControl) {\n const isValid = /^$|^\\d{9}$|^\\d{2}-\\d{7}$|^\\d{3}-\\d{2}-\\d{4}$/.test(control.value)\n return isValid\n ? null : { taxId: {} }\n}\n","import { FormControl } from '@angular/forms'\nimport { isObservable, Observable } from 'rxjs'\nimport { map } from 'rxjs/operators'\n\n/**\n * Validates that an email already exists.\n */\nexport function emailExistsValidator(\n emailExists: (email: string) => Promise<boolean> | Observable<boolean> | boolean\n) {\n return (control: FormControl) => {\n const validationResult = (exists: boolean) => {\n return exists === false ? null : { 'emailExists': {} }\n }\n\n const fnRes = emailExists(control.value)\n if (isObservable(fnRes)) {\n return fnRes.pipe(map(validationResult))\n }\n return Promise.resolve(fnRes).then(validationResult)\n }\n}\n","import { FormControl } from '@angular/forms'\n\n/**\n * Validates that a value is a valid phone number length.\n */\nexport function phoneLengthValidator(control: FormControl) {\n return control.value.length === 0 || (control.value.length <= 18 && control.value.length >= 7)\n ? null : { 'phoneLength': {} }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAEA;;;;;;;SAOgB,cAAc,CAAC,OAAoB;IACjD,MAAM,OAAO,GAAG,8CAA8C,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAClF,OAAO,OAAO;UACV,IAAI,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAAA;AAC1B;;ACTA;;;SAGgB,oBAAoB,CAClC,WAAgF;IAEhF,OAAO,CAAC,OAAoB;QAC1B,MAAM,gBAAgB,GAAG,CAAC,MAAe;YACvC,OAAO,MAAM,KAAK,KAAK,GAAG,IAAI,GAAG,EAAE,aAAa,EAAE,EAAE,EAAE,CAAA;SACvD,CAAA;QAED,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QACxC,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE;YACvB,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAA;SACzC;QACD,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;KACrD,CAAA;AACH;;ACnBA;;;SAGgB,oBAAoB,CAAC,OAAoB;IACvD,OAAO,OAAO,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,KAAK,OAAO,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;UAC1F,IAAI,GAAG,EAAE,aAAa,EAAE,EAAE,EAAE,CAAA;AAClC;;ACRA;;;;;;"}
1
+ {"version":3,"file":"theseam-ui-common-validators.js","sources":["../../../projects/ui-common/validators/tax-id.validator.ts","../../../projects/ui-common/validators/email-exists.validator.ts","../../../projects/ui-common/validators/phone-length.validator.ts","../../../projects/ui-common/validators/decimal.validator.ts","../../../projects/ui-common/validators/integer.validator.ts","../../../projects/ui-common/validators/theseam-ui-common-validators.ts"],"sourcesContent":["import { FormControl } from '@angular/forms'\n\n/**\n * Validates that value matches on of the following:\n * '' // empty string\n * 'xxxxxxxxx' // 'x' is a number\n * 'xx-xxxxxxx' // 'x' is a number\n * 'xxx-xx-xxxx' // 'x' is a number\n */\nexport function taxIdValidator(control: FormControl) {\n const isValid = /^$|^\\d{9}$|^\\d{2}-\\d{7}$|^\\d{3}-\\d{2}-\\d{4}$/.test(control.value)\n return isValid\n ? null : { taxId: {} }\n}\n","import { FormControl } from '@angular/forms'\nimport { isObservable, Observable } from 'rxjs'\nimport { map } from 'rxjs/operators'\n\n/**\n * Validates that an email already exists.\n */\nexport function emailExistsValidator(\n emailExists: (email: string) => Promise<boolean> | Observable<boolean> | boolean\n) {\n return (control: FormControl) => {\n const validationResult = (exists: boolean) => {\n return exists === false ? null : { 'emailExists': {} }\n }\n\n const fnRes = emailExists(control.value)\n if (isObservable(fnRes)) {\n return fnRes.pipe(map(validationResult))\n }\n return Promise.resolve(fnRes).then(validationResult)\n }\n}\n","import { FormControl } from '@angular/forms'\n\n/**\n * Validates that a value is a valid phone number length.\n */\nexport function phoneLengthValidator(control: FormControl) {\n return control.value.length === 0 || (control.value.length <= 18 && control.value.length >= 7)\n ? null : { 'phoneLength': {} }\n}\n","import { AbstractControl, ValidatorFn, Validators } from '@angular/forms'\n\nimport { isEmptyInputValue, isNumeric } from '@theseam/ui-common/utils'\n\nexport const DECIMAL_REGEX = /^([-+]{1})?\\d*(\\.\\d*)?$/\n\nfunction _decimalValidator(): ValidatorFn {\n return (control: AbstractControl) => {\n if (isEmptyInputValue(control.value)) {\n return null // don't validate empty values to allow optional controls\n }\n\n const isDecimal =\n !Array.isArray(control.value) &&\n isNumeric(control.value) &&\n (Validators.pattern(DECIMAL_REGEX)(control) === null)\n\n if (!isDecimal) {\n return { 'decimal': { 'reason': 'Must be valid decimal number.' } }\n }\n\n return null\n }\n}\n\n/**\n * Validates control value is a valid decimal number.\n *\n * NOTE: This does not allow any js valid decimal number. It only accepts them\n * in a format expected by our backend.\n */\nexport const decimalValidator: ValidatorFn = _decimalValidator()\n","import { AbstractControl, ValidatorFn, Validators } from '@angular/forms'\n\nimport { isEmptyInputValue, isNumeric } from '@theseam/ui-common/utils'\n\nexport const INTEGER_REGEX = /^([-+]{1})?[0-9]*$/\n\nfunction _integerValidator(): ValidatorFn {\n return (control: AbstractControl) => {\n if (isEmptyInputValue(control.value)) {\n return null // don't validate empty values to allow optional controls\n }\n\n const isInteger =\n !Array.isArray(control.value) &&\n isNumeric(control.value) &&\n (Validators.pattern(INTEGER_REGEX)(control) === null)\n\n if (!isInteger) {\n return { 'integer': { 'reason': 'Must be valid integer.' } }\n }\n return null\n }\n}\n\n/**\n * Validates control value is a valid integer number.\n *\n * NOTE: This does not allow any js valid integer number. It only accepts them\n * in a format expected by our backend.\n */\nexport const integerValidator: ValidatorFn = _integerValidator()\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAEA;;;;;;;SA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AAO,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,CAAA;QAEvD,IAAI,CAAC,SAAS,EAAE;YACd,OAAO,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,+BAA+B,EAAE,EAAE,CAAA;SACpE;QAED,OAAO,IAAI,CAAA;KACZ,CAAA;AACH,CAAC;AAED;;;;;;MAMa,gBAAgB,GAAgB,iBAAiB;;MC3BjD,aAAa,GAAG,qBAAoB;AAEjD,SAAS,iBAAiB;IACxB,OAAO,CAAC,OAAwB;QAC9B,IAAI,iBAAiB,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACpC,OAAO,IAAI,CAAA;SACZ;QAED,MAAM,SAAS,GACb,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC;YAC7B,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;aACvB,UAAU,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,CAAA;QAEvD,IAAI,CAAC,SAAS,EAAE;YACd,OAAO,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,wBAAwB,EAAE,EAAE,CAAA;SAC7D;QACD,OAAO,IAAI,CAAA;KACZ,CAAA;AACH,CAAC;AAED;;;;;;MAMa,gBAAgB,GAAgB,iBAAiB;;AC9B9D;;;;;;"}
@@ -2,13 +2,14 @@
2
2
 
3
3
  seam-side-nav-item {
4
4
  display: block;
5
-
6
5
  transition: 250ms ease-in-out background-color;
6
+
7
7
  &.seam-side-nav-item--active {
8
8
  background-color: $seam-side-nav-item-bg-color-active;
9
9
 
10
10
  .active,
11
- &:active {
11
+ &:active,
12
+ .side-nav-item.active:hover {
12
13
  background-color: $seam-side-nav-item-bg-color-active;
13
14
  }
14
15
 
@@ -23,16 +24,20 @@ seam-side-nav-item {
23
24
  }
24
25
  }
25
26
 
27
+ .badge {
28
+ vertical-align: middle;
29
+ }
30
+
26
31
  &:not(.side-nav-item--icon) {
27
32
  .side-nav-item--badge {
28
- top: -10px;
29
- position: relative;
33
+ pointer-events: all;
30
34
  margin-left: 5px;
35
+ margin-right: 3px;
31
36
  }
32
37
  }
33
38
 
34
- //
35
39
  .side-nav-item--icon {
40
+ position: relative;
36
41
  width: 24px;
37
42
  max-width: 24px;
38
43
  min-width: 24px;
@@ -42,12 +47,20 @@ seam-side-nav-item {
42
47
  text-align: center;
43
48
 
44
49
  .side-nav-item--badge {
45
- top: -35px;
46
- right: -12px;
47
- position: relative;
50
+ top: -4px;
51
+ right: -4px;
52
+ position: absolute;
53
+
54
+ .badge:empty {
55
+ display: block;
56
+ width: 8px;
57
+ height: 8px;
58
+ padding: 0;
59
+ }
48
60
 
49
61
  &.side-nav-item--badge-no-icon {
50
- top: -13px;
62
+ top: 0px;
63
+ right: 0px;
51
64
  }
52
65
  }
53
66
  }
@@ -76,6 +89,14 @@ seam-side-nav-item {
76
89
 
77
90
  .nav-link {
78
91
  color: $seam-side-nav-item-color;
92
+ padding-right: 2px;
93
+ &__compact {
94
+ padding-right: 0;
95
+ padding-left: 12px;
96
+ }
97
+ &:last-child {
98
+ padding-right: 8px;
99
+ }
79
100
  }
80
101
 
81
102
  .side-nav-btn {
@@ -154,5 +175,11 @@ seam-side-nav-item {
154
175
  font-size: $seam-side-nav-title-font-size;
155
176
  padding-left: $seam-side-nav-title-padding-left;
156
177
  }
178
+
179
+ // without a set position, these labels can cause unnecessary scrollbars
180
+ .sr-only {
181
+ top: 0;
182
+ left: 0;
183
+ }
157
184
  }
158
185