@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.
- package/breadcrumbs/breadcrumb.d.ts +3 -1
- package/breadcrumbs/breadcrumbs/breadcrumbs.component.d.ts +2 -2
- package/breadcrumbs/breadcrumbs-resolver.d.ts +3 -1
- package/breadcrumbs/breadcrumbs.service.d.ts +15 -6
- package/breadcrumbs/theseam-ui-common-breadcrumbs.metadata.json +1 -1
- package/bundles/theseam-ui-common-breadcrumbs.umd.js +487 -16
- package/bundles/theseam-ui-common-breadcrumbs.umd.js.map +1 -1
- package/bundles/theseam-ui-common-data-exporter.umd.js.map +1 -1
- package/bundles/theseam-ui-common-datatable.umd.js +54 -4
- package/bundles/theseam-ui-common-datatable.umd.js.map +1 -1
- package/bundles/theseam-ui-common-framework.umd.js +2 -2
- package/bundles/theseam-ui-common-framework.umd.js.map +1 -1
- package/bundles/theseam-ui-common-shared.umd.js +20 -6
- package/bundles/theseam-ui-common-shared.umd.js.map +1 -1
- package/bundles/theseam-ui-common-unsaved-changes-dialog.umd.js +1 -0
- package/bundles/theseam-ui-common-unsaved-changes-dialog.umd.js.map +1 -1
- package/bundles/theseam-ui-common-utils.umd.js +82 -1
- package/bundles/theseam-ui-common-utils.umd.js.map +1 -1
- package/bundles/theseam-ui-common-validators.umd.js +54 -4
- package/bundles/theseam-ui-common-validators.umd.js.map +1 -1
- package/data-exporter/data-exporter.d.ts +4 -0
- package/data-exporter/theseam-ui-common-data-exporter.metadata.json +1 -1
- package/datatable/datatable/datatable.component.d.ts +2 -0
- package/datatable/datatable-footer/datatable-footer-tpl.directive.d.ts +5 -0
- package/datatable/datatable-footer/datatable-footer.directive.d.ts +6 -0
- package/datatable/public-api.d.ts +2 -0
- package/datatable/theseam-ui-common-datatable.metadata.json +1 -1
- package/esm2015/breadcrumbs/breadcrumb.js +1 -1
- package/esm2015/breadcrumbs/breadcrumbs/breadcrumbs.component.js +1 -1
- package/esm2015/breadcrumbs/breadcrumbs-resolver.js +1 -1
- package/esm2015/breadcrumbs/breadcrumbs.service.js +133 -15
- package/esm2015/data-exporter/data-exporter.js +1 -1
- package/esm2015/datatable/datatable/datatable.component.js +5 -3
- package/esm2015/datatable/datatable-export-button/datatable-export-button.component.js +8 -3
- package/esm2015/datatable/datatable-footer/datatable-footer-tpl.directive.js +15 -0
- package/esm2015/datatable/datatable-footer/datatable-footer.directive.js +18 -0
- package/esm2015/datatable/datatable.module.js +7 -1
- package/esm2015/datatable/public-api.js +3 -1
- package/esm2015/framework/side-nav/side-nav-item/side-nav-item.component.js +3 -3
- package/esm2015/shared/directives/ng-select-extra.directive.js +16 -3
- package/esm2015/shared/pipes/mask-chars.pipe.js +2 -2
- package/esm2015/unsaved-changes-dialog/unsaved-changes-can-deactivate.js +3 -2
- package/esm2015/utils/create-padding.js +17 -0
- package/esm2015/utils/form/is-empty-input-value.js +6 -0
- package/esm2015/utils/fractional-digits-count.js +19 -0
- package/esm2015/utils/is-numeric.js +4 -0
- package/esm2015/utils/pad-end.js +9 -0
- package/esm2015/utils/pad-start.js +9 -0
- package/esm2015/utils/public-api.js +7 -1
- package/esm2015/utils/router/index.js +3 -1
- package/esm2015/utils/router/is-empty-url-route.js +4 -0
- package/esm2015/utils/router/leaf-child-route.js +1 -1
- package/esm2015/utils/router/operators/activated-routes-with-data-property.js +3 -8
- package/esm2015/utils/router/will-have-data-prop.js +10 -0
- package/esm2015/validators/decimal.validator.js +25 -0
- package/esm2015/validators/integer.validator.js +25 -0
- package/esm2015/validators/public-api.js +3 -1
- package/fesm2015/theseam-ui-common-breadcrumbs.js +132 -14
- package/fesm2015/theseam-ui-common-breadcrumbs.js.map +1 -1
- package/fesm2015/theseam-ui-common-data-exporter.js.map +1 -1
- package/fesm2015/theseam-ui-common-datatable.js +45 -5
- package/fesm2015/theseam-ui-common-datatable.js.map +1 -1
- package/fesm2015/theseam-ui-common-framework.js +2 -2
- package/fesm2015/theseam-ui-common-framework.js.map +1 -1
- package/fesm2015/theseam-ui-common-shared.js +15 -2
- package/fesm2015/theseam-ui-common-shared.js.map +1 -1
- package/fesm2015/theseam-ui-common-unsaved-changes-dialog.js +1 -0
- package/fesm2015/theseam-ui-common-unsaved-changes-dialog.js.map +1 -1
- package/fesm2015/theseam-ui-common-utils.js +71 -2
- package/fesm2015/theseam-ui-common-utils.js.map +1 -1
- package/fesm2015/theseam-ui-common-validators.js +49 -1
- package/fesm2015/theseam-ui-common-validators.js.map +1 -1
- package/framework/side-nav/side-nav-item/side-nav-item.component.scss +36 -9
- package/framework/theseam-ui-common-framework.metadata.json +1 -1
- package/package.json +1 -1
- package/shared/directives/ng-select-extra.directive.d.ts +1 -0
- package/shared/theseam-ui-common-shared.metadata.json +1 -1
- package/styles/common/_table.scss +0 -5
- package/styles/vendor/ngx-datatable/_ngx-datatable.scss +475 -87
- package/styles/vendor/ngx-datatable/_themes/bootstrap/_variables.scss +173 -0
- package/styles/vendor/ngx-datatable/_themes/dark/_variables.scss +166 -0
- package/styles/vendor/ngx-datatable/_themes/material/_variables.scss +165 -0
- package/styles/vendor/ngx-datatable/_variables.scss +3 -0
- package/unsaved-changes-dialog/theseam-ui-common-unsaved-changes-dialog.metadata.json +1 -1
- package/utils/create-padding.d.ts +1 -0
- package/utils/form/is-empty-input-value.d.ts +1 -0
- package/utils/fractional-digits-count.d.ts +8 -0
- package/utils/is-numeric.d.ts +1 -0
- package/utils/pad-end.d.ts +1 -0
- package/utils/pad-start.d.ts +1 -0
- package/utils/public-api.d.ts +6 -0
- package/utils/router/index.d.ts +2 -0
- package/utils/router/is-empty-url-route.d.ts +2 -0
- package/utils/router/will-have-data-prop.d.ts +2 -0
- package/utils/theseam-ui-common-utils.metadata.json +1 -1
- package/validators/decimal.validator.d.ts +9 -0
- package/validators/integer.validator.d.ts +9 -0
- package/validators/public-api.d.ts +2 -0
- package/validators/theseam-ui-common-validators.metadata.json +1 -1
|
@@ -4,11 +4,11 @@ import { faEye, faEyeSlash } from '@fortawesome/free-regular-svg-icons';
|
|
|
4
4
|
import { getClosestModal, Modal, ModalRef, TheSeamModalModule } from '@theseam/ui-common/modal';
|
|
5
5
|
import { NgControl } from '@angular/forms';
|
|
6
6
|
import { ResizeSensor } from 'css-element-queries';
|
|
7
|
-
import { NgSelectComponent } from '@ng-select/ng-select';
|
|
8
7
|
import { Subject, fromEvent } from 'rxjs';
|
|
9
8
|
import { takeUntil, filter, tap } from 'rxjs/operators';
|
|
9
|
+
import { NgSelectComponent } from '@ng-select/ng-select';
|
|
10
10
|
import { QuillEditorComponent } from 'ngx-quill';
|
|
11
|
-
import { padStart, padEnd } from '
|
|
11
|
+
import { padStart, padEnd } from '@theseam/ui-common/utils';
|
|
12
12
|
import { CommonModule } from '@angular/common';
|
|
13
13
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
14
14
|
import { TheSeamLoadingModule } from '@theseam/ui-common/loading';
|
|
@@ -395,6 +395,17 @@ class NgSelectExtraDirective {
|
|
|
395
395
|
this._checkMarked = false;
|
|
396
396
|
this._keyPressWorkaroundSub = null;
|
|
397
397
|
this._resizedEvent = new EventEmitter();
|
|
398
|
+
this._onScroll = (event) => {
|
|
399
|
+
if (this.ngSelect && this.ngSelect.isOpen) {
|
|
400
|
+
const isScrollingInScrollHost = event.target.className.indexOf('ng-dropdown-panel-items') !== -1;
|
|
401
|
+
const isInSensor = event.target.className.indexOf('resize-sensor-shrink') !== -1 ||
|
|
402
|
+
event.target.className.indexOf('os-resize-observer-host') !== -1;
|
|
403
|
+
if (isScrollingInScrollHost || isInSensor) {
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
this.ngSelect.close();
|
|
407
|
+
}
|
|
408
|
+
};
|
|
398
409
|
}
|
|
399
410
|
/**
|
|
400
411
|
* Set the tab index to `-1` to allow the root element of the ng-select
|
|
@@ -430,6 +441,7 @@ class NgSelectExtraDirective {
|
|
|
430
441
|
.subscribe(v => this._enableKeyPressWorkaround());
|
|
431
442
|
this.ngSelect.blurEvent
|
|
432
443
|
.subscribe(v => this._disableKeyPressWorkaround());
|
|
444
|
+
window.addEventListener('scroll', this._onScroll, true);
|
|
433
445
|
// When the input is allowed to change its height the position doesn't update itself.
|
|
434
446
|
// this._resizedEvent.pipe(
|
|
435
447
|
// auditTime(30)
|
|
@@ -449,6 +461,7 @@ class NgSelectExtraDirective {
|
|
|
449
461
|
ngOnDestroy() {
|
|
450
462
|
var _a;
|
|
451
463
|
(_a = this._resizeSensor) === null || _a === void 0 ? void 0 : _a.detach();
|
|
464
|
+
window.removeEventListener('scroll', this._onScroll, true);
|
|
452
465
|
this._ngUnsubscribe.next();
|
|
453
466
|
this._ngUnsubscribe.complete();
|
|
454
467
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theseam-ui-common-shared.js","sources":["../../../projects/ui-common/shared/components/password-input-reveal/password-input-reveal.component.ts","../../../projects/ui-common/shared/directives/auto-focus.directive.ts","../../../projects/ui-common/shared/directives/click-outside.directive.ts","../../../projects/ui-common/shared/directives/disable-control.directive.ts","../../../projects/ui-common/shared/directives/elem-resized.directive.ts","../../../projects/ui-common/shared/directives/hover-class-toggle.directive.ts","../../../projects/ui-common/shared/directives/hover-class.directive.ts","../../../projects/ui-common/shared/directives/ng-select-extra.directive.ts","../../../projects/ui-common/shared/directives/ngx-quill-extra.directive.ts","../../../projects/ui-common/shared/pipes/mask-chars.pipe.ts","../../../projects/ui-common/shared/pipes/truncate.pipe.ts","../../../projects/ui-common/shared/shared.module.ts","../../../projects/ui-common/shared/theseam-ui-common-shared.ts"],"sourcesContent":["import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion'\nimport { Component, Input } from '@angular/core'\n\nimport { faEye, faEyeSlash } from '@fortawesome/free-regular-svg-icons'\n\n@Component({\n selector: 'seam-password-input-reveal',\n template: `\n <fa-icon [icon]=\"passwordVisible ? faEyeSlash : faEye\" class=\"password-reveal-icon\" (click)=\"revealPassword()\"></fa-icon>\n `,\n styles: [\n `\n :host {\n display: flex;\n align-items: center;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n width: 30px;\n transform: translateZ(0);\n z-index: 50;\n }\n\n :host fa-icon {\n opacity: 1;\n color: #bababa;\n margin-top: 3px;\n cursor: pointer;\n }\n\n :host fa-icon ::ng-deep {\n .svg-inline--fa {\n vertical-align: middle;\n }\n }\n `\n ]\n})\nexport class PasswordInputRevealComponent {\n static ngAcceptInputType_passwordVisible: BooleanInput\n\n faEye = faEye\n faEyeSlash = faEyeSlash\n\n @Input()\n get inputRef(): HTMLInputElement | undefined | null { return this._passwordInput }\n set inputRef(value: HTMLInputElement | undefined | null) {\n this._passwordInput = value\n this.updateRevealState()\n if (this._passwordInput) {\n this._passwordInput.style.paddingRight = '40px'\n this._passwordInput.classList.add('no-native-eye')\n }\n }\n private _passwordInput: HTMLInputElement | undefined | null\n\n @Input()\n get passwordVisible() { return this._passwordVisible }\n set passwordVisible(value: boolean) {\n this._passwordVisible = coerceBooleanProperty(value)\n this.updateRevealState()\n }\n public _passwordVisible = false\n\n public updateRevealState(): void {\n if (this._passwordInput) {\n this._passwordInput.type = this.passwordVisible ? 'text' : 'password'\n }\n }\n\n public revealPassword(): void {\n this.passwordVisible = !this.passwordVisible\n }\n\n}\n","import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion'\nimport { Directive, ElementRef, Input, OnInit, Optional } from '@angular/core'\n\nimport { getClosestModal, Modal, ModalRef } from '@theseam/ui-common/modal'\n\n@Directive({\n selector: '[seamAutoFocus]',\n exportAs: 'seamAutoFocus'\n})\nexport class AutoFocusDirective implements OnInit {\n static ngAcceptInputType_seamAutoFocus: BooleanInput\n\n private _focus = true\n\n public modalRef: ModalRef<any> | undefined | null\n\n constructor(\n private _elementRef: ElementRef<HTMLElement>,\n private _modal: Modal,\n @Optional() private _modalRef: ModalRef<any>\n ) {\n this.modalRef = _modalRef\n }\n\n ngOnInit() {\n if (!this.modalRef) {\n // When this directive is included in a dialog via TemplateRef (rather than being\n // in a Component), the DialogRef isn't available via injection because embedded\n // views cannot be given a custom injector. Instead, we look up the DialogRef by\n // ID. This must occur in `onInit`, as the ID binding for the dialog container won't\n // be resolved at constructor time.\n this.modalRef = getClosestModal(this._elementRef, this._modal.openDialogs)\n }\n\n if (!this.modalRef) {\n if (this._focus) {\n setTimeout(() => { this.focus() })\n }\n } else {\n this.modalRef.afterOpened().subscribe(() => {\n setTimeout(() => { this.focus() })\n })\n }\n }\n\n @Input()\n set seamAutoFocus(condition: boolean) {\n this._focus = coerceBooleanProperty(condition) !== false\n }\n\n public focus() {\n this._elementRef.nativeElement.focus()\n }\n}\n","import { Directive, ElementRef, EventEmitter, HostListener, Input, Output } from '@angular/core'\n\n@Directive({\n selector: '[seamClickOutside]'\n})\nexport class ClickOutsideDirective {\n\n @Input()\n get seamClickOutsideActive(): boolean {\n return this._active\n }\n set seamClickOutsideActive(value: boolean) {\n if (this._active === value) { return }\n\n if (value) {\n // `setTimeout` is used to avoid the click event triggering when the value\n // changes if the value was changed with a click.\n setTimeout(() => { this._active = value })\n } else {\n this._active = value\n }\n }\n private _active = true\n\n @Output() seamClickOutside = new EventEmitter<MouseEvent>()\n\n // NOTE: This should probably be changed from a `HostListener` to allow the\n // subscription to be unsubscribed.\n @HostListener('document:click', ['$event'])\n public onDocumentClick(event: MouseEvent): void {\n if (this._active) {\n const targetElement = event.target as HTMLElement\n // Check if the click was outside the element\n if (targetElement && !this.elementRef.nativeElement.contains(targetElement)) {\n this.seamClickOutside.emit(event)\n }\n }\n }\n\n constructor(private elementRef: ElementRef) { }\n\n}\n","import { Directive, Input } from '@angular/core'\nimport { NgControl } from '@angular/forms'\n\n// Source: https://netbasal.com/disabling-form-controls-when-working-with-reactive-forms-in-angular-549dd7b42110\n\n@Directive({\n selector: '[seamDisableControl]'\n})\nexport class DisableControlDirective {\n\n @Input() set seamDisableControl(condition: boolean) {\n const action = condition ? 'disable' : 'enable'\n const control = this.ngControl.control\n if (control) {\n control[action]()\n }\n }\n\n constructor(private ngControl: NgControl) { }\n\n}\n","import { AfterViewInit, Directive, ElementRef, EventEmitter, OnDestroy, Output } from '@angular/core'\n\nimport { ResizeSensor } from 'css-element-queries'\n\nexport interface IElementResizedEvent {\n element: HTMLElement\n size: { width: number, height: number }\n}\n\n@Directive({\n selector: '[seamElemResized]'\n})\nexport class ElemResizedDirective implements OnDestroy, AfterViewInit {\n\n @Output() seamElemResized = new EventEmitter<IElementResizedEvent>()\n\n sensor?: ResizeSensor\n\n constructor(private elementRef: ElementRef) { }\n\n ngAfterViewInit() {\n this.sensor = new ResizeSensor(this.elementRef.nativeElement, (event) => {\n this.seamElemResized.emit({ element: this.elementRef.nativeElement, size: event })\n })\n }\n\n ngOnDestroy() {\n this.sensor?.detach()\n }\n\n}\n","import { Directive, ElementRef, HostListener, Input } from '@angular/core'\n\ndeclare type _PointerEvent = PointerEvent | PointerEvent\n\nexport interface IHoverClassToggleRecord {\n default: string\n hover: string\n}\n\n/**\n * Don't use this directive unless there is a reason not to use css `:hover`,\n * because the accuracy of detecting the hover is not as good. If an element is\n * moved while the mouse is idle the hover class will remain until the mouse\n * enters and leaves again.\n *\n * I have tried multiple ways of detecting the mouse no longer hovering, but all\n * have introduced a slight performance issue that just builds for each element\n * containing this directive.\n */\n@Directive({\n selector: '[seamHoverClassToggle]'\n})\nexport class HoverClassToggleDirective {\n\n private _hovered = false\n private _defaultClasses: string[] = []\n private _hoverClasses: string[] = []\n\n @HostListener('mouseover', ['$event']) onMouseOver($event: MouseEvent) {\n this._setHovered(true)\n }\n\n @HostListener('mouseout', ['$event']) onMouseOut($event: MouseEvent) {\n this._setHovered(false)\n }\n\n @HostListener('pointerover', ['$event']) onPointerOver($event: _PointerEvent) {\n this._setHovered(true)\n }\n\n @HostListener('pointerout', ['$event']) onPointerOut($event: _PointerEvent) {\n this._setHovered(false)\n }\n\n @Input()\n set seamHoverClassToggle(value: IHoverClassToggleRecord) {\n if (value) {\n if (value.default) {\n this._defaultClasses = value.default.split(' ').filter(c => c.length > 0)\n }\n if (value.hover) {\n this._hoverClasses = value.hover.split(' ').filter(c => c.length > 0)\n }\n }\n\n this._hoverClasses = this._hoverClasses.filter(v => !this._defaultClasses.find(_v => _v === v))\n\n this._update()\n }\n\n constructor(\n private readonly _element: ElementRef\n ) { }\n\n private _update(): void {\n for (const c of this._defaultClasses) {\n this._hovered ? this._removeClass(c) : this._addClass(c)\n }\n for (const c of this._hoverClasses) {\n this._hovered ? this._addClass(c) : this._removeClass(c)\n }\n }\n\n private _setHovered(hovered: boolean) {\n const doUpdate = this._hovered !== hovered\n this._hovered = hovered\n if (doUpdate) {\n this._update()\n }\n }\n\n private _addClass(c: string): void {\n this._element.nativeElement.classList.add(c)\n }\n\n public _removeClass(c: string): void {\n this._element.nativeElement.classList.remove(c)\n }\n\n}\n","import { Directive, ElementRef, HostListener, Input } from '@angular/core'\n\ndeclare type _PointerEvent = PointerEvent | PointerEvent\n\n/**\n * Don't use this directive unless there is a reason not to use css `:hover`,\n * because the accuracy of detecting the hover is not as good. If an element is\n * moved while the mouse is idle the hover class will remain until the mouse\n * enters and leaves again.\n *\n * I have tried multiple ways of detecting the mouse no longer hovering, but all\n * have introduced a slight performance issue that just builds for each element\n * containing this directive.\n */\n@Directive({\n selector: '[seamHoverClass]'\n})\nexport class HoverClassDirective {\n\n private _hovered = false\n private _classes: string[] = []\n\n @HostListener('mouseover', ['$event']) onMouseOver($event: MouseEvent) {\n this._setHovered(true)\n }\n\n @HostListener('mouseout', ['$event']) onMouseOut($event: MouseEvent) {\n this._setHovered(false)\n }\n\n @HostListener('pointerover', ['$event']) onPointerOver($event: _PointerEvent) {\n this._setHovered(true)\n }\n\n @HostListener('pointerout', ['$event']) onPointerOut($event: _PointerEvent) {\n this._setHovered(false)\n }\n\n @Input()\n set seamHoverClass(classList: string) {\n const newClasses = classList.split(' ').filter(c => c.length > 0)\n for (const c of this._classes) {\n if (newClasses.indexOf(c) !== 0) {\n this._removeClass(c)\n }\n }\n this._classes = newClasses\n this._update()\n }\n\n constructor(\n private readonly _element: ElementRef\n ) { }\n\n private _update(): void {\n for (const c of this._classes) {\n this._hovered ? this._addClass(c) : this._removeClass(c)\n }\n }\n\n private _setHovered(hovered: boolean) {\n const doUpdate = this._hovered !== hovered\n this._hovered = hovered\n if (doUpdate) {\n this._update()\n }\n }\n\n private _addClass(c: string): void {\n this._element.nativeElement.classList.add(c)\n }\n\n public _removeClass(c: string): void {\n this._element.nativeElement.classList.remove(c)\n }\n\n}\n","import { AfterViewChecked, Directive, ElementRef, EventEmitter, HostBinding,\n HostListener, NgZone, OnDestroy, OnInit, Optional, Self } from '@angular/core'\nimport { NgControl } from '@angular/forms'\nimport { NgOption, NgSelectComponent } from '@ng-select/ng-select'\nimport { ResizeSensor } from 'css-element-queries'\nimport { Subject, Subscription } from 'rxjs'\nimport { auditTime, filter, takeUntil } from 'rxjs/operators'\nimport { IElementResizedEvent } from './elem-resized.directive'\n\n@Directive({\n // tslint:disable-next-line:directive-selector\n selector: 'ng-select'\n})\nexport class NgSelectExtraDirective implements OnInit, AfterViewChecked, OnDestroy {\n\n private readonly _ngUnsubscribe = new Subject()\n\n private _markedItem: NgOption | null = null\n private _checkMarked = false\n private _keyPressWorkaroundSub: Subscription | null = null\n\n private _resizedEvent = new EventEmitter<IElementResizedEvent>()\n private _resizeSensor?: ResizeSensor\n\n /**\n * Set the tab index to `-1` to allow the root element of the ng-select\n * component to receive `focus` event from javascript, but not get focused by\n * keyboard navigation.\n */\n @HostBinding('attr.tabIndex')\n get _tabIndex() { return this.ngSelect.disabled ? undefined : -1 }\n\n /**\n * Listening for focus event on root of component to allow javascript\n * `focus()` function to trigger the components focus.\n */\n @HostListener('focus', ['$event']) onFocus($event: FocusEvent) {\n const target = $event.target as HTMLElement\n if (target === this.elementRef.nativeElement && !this.ngSelect.disabled) {\n this.ngSelect.focus()\n }\n\n // ng-select has an input `labelForId` that sets the autocomplete attribute\n // in ngOnInit. I am not positive that it is wrong by doing that, but this\n // hack makes it set the attributes again on focus, because that gives the\n // result I was expecting, since we don't manually set the `labelForId`\n // input.\n const _ngSelect = this.ngSelect as any\n _ngSelect._setInputAttributes()\n }\n\n @HostBinding('class.is-invalid') get _isInvalid() {\n return this.ngControl ? this.ngControl.invalid && (this.ngControl.dirty || this.ngControl.touched) : false\n }\n\n @HostBinding('class.ng-empty-string-value') get _isEmptyStringValue() {\n return this.ngControl ? this.ngControl.value === '' ? true : false : false\n }\n\n constructor(\n private readonly elementRef: ElementRef,\n private readonly _ngZone: NgZone,\n private readonly ngSelect: NgSelectComponent,\n @Optional() @Self() public readonly ngControl: NgControl\n ) { }\n\n ngOnInit() {\n this.ngSelect.focusEvent\n .subscribe(v => this._enableKeyPressWorkaround())\n\n this.ngSelect.blurEvent\n .subscribe(v => this._disableKeyPressWorkaround())\n\n // When the input is allowed to change its height the position doesn't update itself.\n // this._resizedEvent.pipe(\n // auditTime(30)\n // ).subscribe(event => {\n // if (this.elementRef && this.elementRef.nativeElement) {\n // if (this.elementRef.nativeElement.classList.contains('ng-select-value-grow-h')) {\n // if (this.ngSelect.isOpen && this.ngSelect.dropdownPanel) {\n // this.ngSelect.dropdownPanel.updateDropdownPosition()\n // }\n // } else {\n // this.elementRef.nativeElement.classList.remove('ng-select-value-grow-h')\n // }\n // }\n // })\n\n // this._patch_ngSelect_open()\n }\n\n ngOnDestroy() {\n this._resizeSensor?.detach()\n\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n ngAfterViewChecked() {\n if (this.ngSelect.dropdownPanel) {\n if (this._checkMarked) {\n if (this.ngSelect.dropdownPanel && this._markedItem !== null) {\n if (this._markedItem.index !== this.ngSelect.dropdownPanel.markedItem.index) {\n this.ngSelect.dropdownPanel.scrollTo(this.ngSelect.dropdownPanel.markedItem)\n }\n }\n }\n }\n this._checkMarked = false\n\n this._resizeSensor = new ResizeSensor(this.elementRef.nativeElement, (event) => {\n this._resizedEvent.emit({ element: this.elementRef.nativeElement, size: event })\n })\n }\n\n /**\n * Temp fix for: https://github.com/ng-select/ng-select/issues/1122\n */\n // private _patch_ngSelect_open() {\n // const original = this.ngSelect.open\n // const _self = this\n // this.ngSelect.open = function() {\n // original.apply(this, arguments)\n // _self._patch_ngSelectDropdownPanel_updateDropdownPosition()\n // }\n // }\n\n /** Should ONLY be called by `_patch_ngSelect_open`. */\n // private _patch_ngSelectDropdownPanel_updateDropdownPosition() {\n // if (!this.ngSelect.dropdownPanel) { return }\n // const drop: any = this.ngSelect.dropdownPanel\n // // Only needed once, to update the position before the timeout in\n // // `updateDropdownPosition()`. So, using this variable to check if I already called\n // // `_updateAppendedDropdownPosition()`.\n // if (!drop.__libPatched) {\n // drop.__libPatched = 'patched'\n // const original = drop.updateDropdownPosition\n // const _self = this\n // drop.updateDropdownPosition = function() {\n // original.apply(this, arguments)\n // if (!!_self.ngSelect.appendTo) {\n // drop._updateAppendedDropdownPosition()\n // }\n // }\n // }\n // }\n\n private _enableKeyPressWorkaround() {\n if (this._keyPressWorkaroundSub) { return }\n const _ngSelect = <any>this.ngSelect\n\n this._keyPressWorkaroundSub = _ngSelect._keyPress$\n .pipe(takeUntil(this._ngUnsubscribe))\n .pipe(filter(() => !this.ngSelect.searchable))\n .subscribe(() => {\n this._ngZone.runOutsideAngular(() => {\n window.requestAnimationFrame(() => {\n if (this.ngSelect.dropdownPanel) {\n this._markedItem = this.ngSelect.dropdownPanel.markedItem\n }\n this._checkMarked = true\n })\n })\n })\n }\n\n private _disableKeyPressWorkaround() {\n if (this._keyPressWorkaroundSub) {\n this._keyPressWorkaroundSub.unsubscribe()\n this._keyPressWorkaroundSub = null\n }\n }\n\n}\n","import { coerceNumberProperty } from '@angular/cdk/coercion'\nimport { AfterViewInit, Directive, ElementRef, HostBinding, Input, OnDestroy } from '@angular/core'\nimport { fromEvent, Subject } from 'rxjs'\nimport { filter, takeUntil, tap } from 'rxjs/operators'\n\nimport { QuillEditorComponent } from 'ngx-quill'\n\n@Directive({\n // tslint:disable-next-line:directive-selector\n selector: 'quill-editor'\n})\nexport class NgxQuillExtraDirective implements OnDestroy, AfterViewInit {\n\n private readonly _ngUnsubscribe = new Subject()\n\n private _tabIndex = -1\n\n /**\n * Set the tab index to `-1` to allow the root element of the\n * component to receive `focus` event from javascript, but not get focused by\n * keyboard navigation.\n */\n @Input()\n set tabIndex(value: number) { this._tabIndex = coerceNumberProperty(value) }\n get tabIndex(): number { return this._tabIndex }\n\n @HostBinding('attr.tabindex')\n get _attrTabIndex() { return this._quillEditor.disabled ? -1 : (this.tabIndex || 0) }\n\n constructor(\n private readonly _elementRef: ElementRef,\n private readonly _quillEditor: QuillEditorComponent\n ) { }\n\n ngOnDestroy() {\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n ngAfterViewInit() {\n const parent = this._getParentElementForLabelFocusIssue()\n if (parent) {\n // NOTE: This is a hack to avoid an issue letting a label with \"for\"\n // attribute focus the control.\n fromEvent(parent, 'click').pipe(\n takeUntil(this._ngUnsubscribe),\n filter(e => (e.target as HTMLElement)?.getAttribute('for') === this._elementRef.nativeElement.id),\n tap(() => this._quillEditor.quillEditor.focus())\n ).subscribe()\n }\n }\n\n private _getParentElementForLabelFocusIssue(): HTMLElement | undefined {\n const findElem = (elem: HTMLElement): any => {\n if (elem.nodeName.toLowerCase() === 'seam-form-field') {\n return elem\n }\n\n if (elem.parentElement) {\n return findElem(elem.parentElement)\n }\n\n return elem\n }\n\n return findElem(this._elementRef.nativeElement)\n }\n\n\n}\n","import { Pipe, PipeTransform } from '@angular/core'\n\nimport { padEnd, padStart } from 'lodash-es'\n\n@Pipe({\n name: 'maskChars'\n})\nexport class MaskCharsPipe implements PipeTransform {\n\n transform(value: string, replacementChar: string = '*', ignoreCount: number = 0, ignoreFrom: 'left' | 'right' = 'right'): string {\n if (ignoreFrom === 'right') {\n const s = value || ''\n return padStart(s.substring(s.length - ignoreCount, s.length), s.length, replacementChar)\n } else if (ignoreFrom === 'left') {\n const s = value || ''\n return padEnd(s.substring(0, ignoreCount), s.length, replacementChar)\n }\n\n return value\n }\n\n}\n","import { Pipe, PipeTransform } from '@angular/core'\n\n@Pipe({\n name: 'truncate'\n})\nexport class TruncatePipe implements PipeTransform {\n\n transform(value: string, length: number = 30, appendEllipsis: boolean = true): string {\n let val = value\n\n if (value && typeof value === 'string' && value.length > length) {\n val = value.substr(0, length)\n if (appendEllipsis) {\n val += '...'\n }\n }\n\n return val\n }\n\n}\n","import { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\n\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome'\n\nimport { TheSeamLoadingModule } from '@theseam/ui-common/loading'\nimport { TheSeamModalModule } from '@theseam/ui-common/modal'\nimport { TheSeamScrollbarModule } from '@theseam/ui-common/scrollbar'\n\nimport { AutoFocusDirective } from './directives/auto-focus.directive'\nimport { ClickOutsideDirective } from './directives/click-outside.directive'\nimport { DisableControlDirective } from './directives/disable-control.directive'\nimport { ElemResizedDirective } from './directives/elem-resized.directive'\nimport { HoverClassToggleDirective } from './directives/hover-class-toggle.directive'\nimport { HoverClassDirective } from './directives/hover-class.directive'\nimport { NgSelectExtraDirective } from './directives/ng-select-extra.directive'\nimport { NgxQuillExtraDirective } from './directives/ngx-quill-extra.directive'\n\nimport { MaskCharsPipe } from './pipes/mask-chars.pipe'\nimport { TruncatePipe } from './pipes/truncate.pipe'\n\nimport { PasswordInputRevealComponent } from './components/password-input-reveal/password-input-reveal.component'\n\n@NgModule({\n imports: [\n CommonModule,\n FontAwesomeModule,\n TheSeamModalModule,\n TheSeamLoadingModule\n ],\n declarations: [\n AutoFocusDirective,\n ElemResizedDirective,\n PasswordInputRevealComponent,\n NgSelectExtraDirective,\n HoverClassDirective,\n HoverClassToggleDirective,\n ClickOutsideDirective,\n DisableControlDirective,\n MaskCharsPipe,\n TruncatePipe,\n NgxQuillExtraDirective\n ],\n exports: [\n AutoFocusDirective,\n ElemResizedDirective,\n PasswordInputRevealComponent,\n NgSelectExtraDirective,\n HoverClassDirective,\n HoverClassToggleDirective,\n ClickOutsideDirective,\n DisableControlDirective,\n MaskCharsPipe,\n TruncatePipe,\n NgxQuillExtraDirective,\n\n // Exporting scrollbars here for backwards compatibility for now.\n TheSeamScrollbarModule\n ]\n})\nexport class TheSeamSharedModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;MAuCa,4BAA4B;IAlCzC;QAqCE,UAAK,GAAG,KAAK,CAAA;QACb,eAAU,GAAG,UAAU,CAAA;QAoBhB,qBAAgB,GAAG,KAAK,CAAA;KAYhC;IA9BC,IACI,QAAQ,KAA0C,OAAO,IAAI,CAAC,cAAc,CAAA,EAAE;IAClF,IAAI,QAAQ,CAAC,KAA0C;QACrD,IAAI,CAAC,cAAc,GAAG,KAAK,CAAA;QAC3B,IAAI,CAAC,iBAAiB,EAAE,CAAA;QACxB,IAAI,IAAI,CAAC,cAAc,EAAE;YACvB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,YAAY,GAAG,MAAM,CAAA;YAC/C,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;SACnD;KACF;IAGD,IACI,eAAe,KAAK,OAAO,IAAI,CAAC,gBAAgB,CAAA,EAAE;IACtD,IAAI,eAAe,CAAC,KAAc;QAChC,IAAI,CAAC,gBAAgB,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAA;QACpD,IAAI,CAAC,iBAAiB,EAAE,CAAA;KACzB;IAGM,iBAAiB;QACtB,IAAI,IAAI,CAAC,cAAc,EAAE;YACvB,IAAI,CAAC,cAAc,CAAC,IAAI,GAAG,IAAI,CAAC,eAAe,GAAG,MAAM,GAAG,UAAU,CAAA;SACtE;KACF;IAEM,cAAc;QACnB,IAAI,CAAC,eAAe,GAAG,CAAC,IAAI,CAAC,eAAe,CAAA;KAC7C;;;YApEF,SAAS,SAAC;gBACT,QAAQ,EAAE,4BAA4B;gBACtC,QA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B;oBACzB,qBAAqB;oBACrB,uBAAuB;oBACvB,aAAa;oBACb,YAAY;oBACZ,sBAAsB;iBACvB;gBACD,OAAO,EAAE;oBACP,kBAAkB;oBAClB,oBAAoB;oBACpB,4BAA4B;oBAC5B,sBAAsB;oBACtB,mBAAmB;oBACnB,yBAAyB;oBACzB,qBAAqB;oBACrB,uBAAuB;oBACvB,aAAa;oBACb,YAAY;oBACZ,sBAAsB;;oBAGtB,sBAAsB;iBACvB;aACF;;;AC3DD;;;;;;"}
|
|
1
|
+
{"version":3,"file":"theseam-ui-common-shared.js","sources":["../../../projects/ui-common/shared/components/password-input-reveal/password-input-reveal.component.ts","../../../projects/ui-common/shared/directives/auto-focus.directive.ts","../../../projects/ui-common/shared/directives/click-outside.directive.ts","../../../projects/ui-common/shared/directives/disable-control.directive.ts","../../../projects/ui-common/shared/directives/elem-resized.directive.ts","../../../projects/ui-common/shared/directives/hover-class-toggle.directive.ts","../../../projects/ui-common/shared/directives/hover-class.directive.ts","../../../projects/ui-common/shared/directives/ng-select-extra.directive.ts","../../../projects/ui-common/shared/directives/ngx-quill-extra.directive.ts","../../../projects/ui-common/shared/pipes/mask-chars.pipe.ts","../../../projects/ui-common/shared/pipes/truncate.pipe.ts","../../../projects/ui-common/shared/shared.module.ts","../../../projects/ui-common/shared/theseam-ui-common-shared.ts"],"sourcesContent":["import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion'\nimport { Component, Input } from '@angular/core'\n\nimport { faEye, faEyeSlash } from '@fortawesome/free-regular-svg-icons'\n\n@Component({\n selector: 'seam-password-input-reveal',\n template: `\n <fa-icon [icon]=\"passwordVisible ? faEyeSlash : faEye\" class=\"password-reveal-icon\" (click)=\"revealPassword()\"></fa-icon>\n `,\n styles: [\n `\n :host {\n display: flex;\n align-items: center;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n width: 30px;\n transform: translateZ(0);\n z-index: 50;\n }\n\n :host fa-icon {\n opacity: 1;\n color: #bababa;\n margin-top: 3px;\n cursor: pointer;\n }\n\n :host fa-icon ::ng-deep {\n .svg-inline--fa {\n vertical-align: middle;\n }\n }\n `\n ]\n})\nexport class PasswordInputRevealComponent {\n static ngAcceptInputType_passwordVisible: BooleanInput\n\n faEye = faEye\n faEyeSlash = faEyeSlash\n\n @Input()\n get inputRef(): HTMLInputElement | undefined | null { return this._passwordInput }\n set inputRef(value: HTMLInputElement | undefined | null) {\n this._passwordInput = value\n this.updateRevealState()\n if (this._passwordInput) {\n this._passwordInput.style.paddingRight = '40px'\n this._passwordInput.classList.add('no-native-eye')\n }\n }\n private _passwordInput: HTMLInputElement | undefined | null\n\n @Input()\n get passwordVisible() { return this._passwordVisible }\n set passwordVisible(value: boolean) {\n this._passwordVisible = coerceBooleanProperty(value)\n this.updateRevealState()\n }\n public _passwordVisible = false\n\n public updateRevealState(): void {\n if (this._passwordInput) {\n this._passwordInput.type = this.passwordVisible ? 'text' : 'password'\n }\n }\n\n public revealPassword(): void {\n this.passwordVisible = !this.passwordVisible\n }\n\n}\n","import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion'\nimport { Directive, ElementRef, Input, OnInit, Optional } from '@angular/core'\n\nimport { getClosestModal, Modal, ModalRef } from '@theseam/ui-common/modal'\n\n@Directive({\n selector: '[seamAutoFocus]',\n exportAs: 'seamAutoFocus'\n})\nexport class AutoFocusDirective implements OnInit {\n static ngAcceptInputType_seamAutoFocus: BooleanInput\n\n private _focus = true\n\n public modalRef: ModalRef<any> | undefined | null\n\n constructor(\n private _elementRef: ElementRef<HTMLElement>,\n private _modal: Modal,\n @Optional() private _modalRef: ModalRef<any>\n ) {\n this.modalRef = _modalRef\n }\n\n ngOnInit() {\n if (!this.modalRef) {\n // When this directive is included in a dialog via TemplateRef (rather than being\n // in a Component), the DialogRef isn't available via injection because embedded\n // views cannot be given a custom injector. Instead, we look up the DialogRef by\n // ID. This must occur in `onInit`, as the ID binding for the dialog container won't\n // be resolved at constructor time.\n this.modalRef = getClosestModal(this._elementRef, this._modal.openDialogs)\n }\n\n if (!this.modalRef) {\n if (this._focus) {\n setTimeout(() => { this.focus() })\n }\n } else {\n this.modalRef.afterOpened().subscribe(() => {\n setTimeout(() => { this.focus() })\n })\n }\n }\n\n @Input()\n set seamAutoFocus(condition: boolean) {\n this._focus = coerceBooleanProperty(condition) !== false\n }\n\n public focus() {\n this._elementRef.nativeElement.focus()\n }\n}\n","import { Directive, ElementRef, EventEmitter, HostListener, Input, Output } from '@angular/core'\n\n@Directive({\n selector: '[seamClickOutside]'\n})\nexport class ClickOutsideDirective {\n\n @Input()\n get seamClickOutsideActive(): boolean {\n return this._active\n }\n set seamClickOutsideActive(value: boolean) {\n if (this._active === value) { return }\n\n if (value) {\n // `setTimeout` is used to avoid the click event triggering when the value\n // changes if the value was changed with a click.\n setTimeout(() => { this._active = value })\n } else {\n this._active = value\n }\n }\n private _active = true\n\n @Output() seamClickOutside = new EventEmitter<MouseEvent>()\n\n // NOTE: This should probably be changed from a `HostListener` to allow the\n // subscription to be unsubscribed.\n @HostListener('document:click', ['$event'])\n public onDocumentClick(event: MouseEvent): void {\n if (this._active) {\n const targetElement = event.target as HTMLElement\n // Check if the click was outside the element\n if (targetElement && !this.elementRef.nativeElement.contains(targetElement)) {\n this.seamClickOutside.emit(event)\n }\n }\n }\n\n constructor(private elementRef: ElementRef) { }\n\n}\n","import { Directive, Input } from '@angular/core'\nimport { NgControl } from '@angular/forms'\n\n// Source: https://netbasal.com/disabling-form-controls-when-working-with-reactive-forms-in-angular-549dd7b42110\n\n@Directive({\n selector: '[seamDisableControl]'\n})\nexport class DisableControlDirective {\n\n @Input() set seamDisableControl(condition: boolean) {\n const action = condition ? 'disable' : 'enable'\n const control = this.ngControl.control\n if (control) {\n control[action]()\n }\n }\n\n constructor(private ngControl: NgControl) { }\n\n}\n","import { AfterViewInit, Directive, ElementRef, EventEmitter, OnDestroy, Output } from '@angular/core'\n\nimport { ResizeSensor } from 'css-element-queries'\n\nexport interface IElementResizedEvent {\n element: HTMLElement\n size: { width: number, height: number }\n}\n\n@Directive({\n selector: '[seamElemResized]'\n})\nexport class ElemResizedDirective implements OnDestroy, AfterViewInit {\n\n @Output() seamElemResized = new EventEmitter<IElementResizedEvent>()\n\n sensor?: ResizeSensor\n\n constructor(private elementRef: ElementRef) { }\n\n ngAfterViewInit() {\n this.sensor = new ResizeSensor(this.elementRef.nativeElement, (event) => {\n this.seamElemResized.emit({ element: this.elementRef.nativeElement, size: event })\n })\n }\n\n ngOnDestroy() {\n this.sensor?.detach()\n }\n\n}\n","import { Directive, ElementRef, HostListener, Input } from '@angular/core'\n\ndeclare type _PointerEvent = PointerEvent | PointerEvent\n\nexport interface IHoverClassToggleRecord {\n default: string\n hover: string\n}\n\n/**\n * Don't use this directive unless there is a reason not to use css `:hover`,\n * because the accuracy of detecting the hover is not as good. If an element is\n * moved while the mouse is idle the hover class will remain until the mouse\n * enters and leaves again.\n *\n * I have tried multiple ways of detecting the mouse no longer hovering, but all\n * have introduced a slight performance issue that just builds for each element\n * containing this directive.\n */\n@Directive({\n selector: '[seamHoverClassToggle]'\n})\nexport class HoverClassToggleDirective {\n\n private _hovered = false\n private _defaultClasses: string[] = []\n private _hoverClasses: string[] = []\n\n @HostListener('mouseover', ['$event']) onMouseOver($event: MouseEvent) {\n this._setHovered(true)\n }\n\n @HostListener('mouseout', ['$event']) onMouseOut($event: MouseEvent) {\n this._setHovered(false)\n }\n\n @HostListener('pointerover', ['$event']) onPointerOver($event: _PointerEvent) {\n this._setHovered(true)\n }\n\n @HostListener('pointerout', ['$event']) onPointerOut($event: _PointerEvent) {\n this._setHovered(false)\n }\n\n @Input()\n set seamHoverClassToggle(value: IHoverClassToggleRecord) {\n if (value) {\n if (value.default) {\n this._defaultClasses = value.default.split(' ').filter(c => c.length > 0)\n }\n if (value.hover) {\n this._hoverClasses = value.hover.split(' ').filter(c => c.length > 0)\n }\n }\n\n this._hoverClasses = this._hoverClasses.filter(v => !this._defaultClasses.find(_v => _v === v))\n\n this._update()\n }\n\n constructor(\n private readonly _element: ElementRef\n ) { }\n\n private _update(): void {\n for (const c of this._defaultClasses) {\n this._hovered ? this._removeClass(c) : this._addClass(c)\n }\n for (const c of this._hoverClasses) {\n this._hovered ? this._addClass(c) : this._removeClass(c)\n }\n }\n\n private _setHovered(hovered: boolean) {\n const doUpdate = this._hovered !== hovered\n this._hovered = hovered\n if (doUpdate) {\n this._update()\n }\n }\n\n private _addClass(c: string): void {\n this._element.nativeElement.classList.add(c)\n }\n\n public _removeClass(c: string): void {\n this._element.nativeElement.classList.remove(c)\n }\n\n}\n","import { Directive, ElementRef, HostListener, Input } from '@angular/core'\n\ndeclare type _PointerEvent = PointerEvent | PointerEvent\n\n/**\n * Don't use this directive unless there is a reason not to use css `:hover`,\n * because the accuracy of detecting the hover is not as good. If an element is\n * moved while the mouse is idle the hover class will remain until the mouse\n * enters and leaves again.\n *\n * I have tried multiple ways of detecting the mouse no longer hovering, but all\n * have introduced a slight performance issue that just builds for each element\n * containing this directive.\n */\n@Directive({\n selector: '[seamHoverClass]'\n})\nexport class HoverClassDirective {\n\n private _hovered = false\n private _classes: string[] = []\n\n @HostListener('mouseover', ['$event']) onMouseOver($event: MouseEvent) {\n this._setHovered(true)\n }\n\n @HostListener('mouseout', ['$event']) onMouseOut($event: MouseEvent) {\n this._setHovered(false)\n }\n\n @HostListener('pointerover', ['$event']) onPointerOver($event: _PointerEvent) {\n this._setHovered(true)\n }\n\n @HostListener('pointerout', ['$event']) onPointerOut($event: _PointerEvent) {\n this._setHovered(false)\n }\n\n @Input()\n set seamHoverClass(classList: string) {\n const newClasses = classList.split(' ').filter(c => c.length > 0)\n for (const c of this._classes) {\n if (newClasses.indexOf(c) !== 0) {\n this._removeClass(c)\n }\n }\n this._classes = newClasses\n this._update()\n }\n\n constructor(\n private readonly _element: ElementRef\n ) { }\n\n private _update(): void {\n for (const c of this._classes) {\n this._hovered ? this._addClass(c) : this._removeClass(c)\n }\n }\n\n private _setHovered(hovered: boolean) {\n const doUpdate = this._hovered !== hovered\n this._hovered = hovered\n if (doUpdate) {\n this._update()\n }\n }\n\n private _addClass(c: string): void {\n this._element.nativeElement.classList.add(c)\n }\n\n public _removeClass(c: string): void {\n this._element.nativeElement.classList.remove(c)\n }\n\n}\n","import { AfterViewChecked, Directive, ElementRef, EventEmitter, HostBinding,\n HostListener, NgZone, OnDestroy, OnInit, Optional, Self } from '@angular/core'\nimport { NgControl } from '@angular/forms'\nimport { Subject, Subscription } from 'rxjs'\nimport { filter, takeUntil } from 'rxjs/operators'\n\nimport { NgOption, NgSelectComponent } from '@ng-select/ng-select'\nimport { ResizeSensor } from 'css-element-queries'\n\nimport { IElementResizedEvent } from './elem-resized.directive'\n\n@Directive({\n // tslint:disable-next-line:directive-selector\n selector: 'ng-select'\n})\nexport class NgSelectExtraDirective implements OnInit, AfterViewChecked, OnDestroy {\n\n private readonly _ngUnsubscribe = new Subject()\n\n private _markedItem: NgOption | null = null\n private _checkMarked = false\n private _keyPressWorkaroundSub: Subscription | null = null\n\n private _resizedEvent = new EventEmitter<IElementResizedEvent>()\n private _resizeSensor?: ResizeSensor\n\n /**\n * Set the tab index to `-1` to allow the root element of the ng-select\n * component to receive `focus` event from javascript, but not get focused by\n * keyboard navigation.\n */\n @HostBinding('attr.tabIndex')\n get _tabIndex() { return this.ngSelect.disabled ? undefined : -1 }\n\n /**\n * Listening for focus event on root of component to allow javascript\n * `focus()` function to trigger the components focus.\n */\n @HostListener('focus', ['$event']) onFocus($event: FocusEvent) {\n const target = $event.target as HTMLElement\n if (target === this.elementRef.nativeElement && !this.ngSelect.disabled) {\n this.ngSelect.focus()\n }\n\n // ng-select has an input `labelForId` that sets the autocomplete attribute\n // in ngOnInit. I am not positive that it is wrong by doing that, but this\n // hack makes it set the attributes again on focus, because that gives the\n // result I was expecting, since we don't manually set the `labelForId`\n // input.\n const _ngSelect = this.ngSelect as any\n _ngSelect._setInputAttributes()\n }\n\n @HostBinding('class.is-invalid') get _isInvalid() {\n return this.ngControl ? this.ngControl.invalid && (this.ngControl.dirty || this.ngControl.touched) : false\n }\n\n @HostBinding('class.ng-empty-string-value') get _isEmptyStringValue() {\n return this.ngControl ? this.ngControl.value === '' ? true : false : false\n }\n\n constructor(\n private readonly elementRef: ElementRef,\n private readonly _ngZone: NgZone,\n private readonly ngSelect: NgSelectComponent,\n @Optional() @Self() public readonly ngControl: NgControl\n ) { }\n\n ngOnInit() {\n this.ngSelect.focusEvent\n .subscribe(v => this._enableKeyPressWorkaround())\n\n this.ngSelect.blurEvent\n .subscribe(v => this._disableKeyPressWorkaround())\n\n window.addEventListener('scroll', this._onScroll, true)\n\n // When the input is allowed to change its height the position doesn't update itself.\n // this._resizedEvent.pipe(\n // auditTime(30)\n // ).subscribe(event => {\n // if (this.elementRef && this.elementRef.nativeElement) {\n // if (this.elementRef.nativeElement.classList.contains('ng-select-value-grow-h')) {\n // if (this.ngSelect.isOpen && this.ngSelect.dropdownPanel) {\n // this.ngSelect.dropdownPanel.updateDropdownPosition()\n // }\n // } else {\n // this.elementRef.nativeElement.classList.remove('ng-select-value-grow-h')\n // }\n // }\n // })\n\n // this._patch_ngSelect_open()\n }\n\n ngOnDestroy() {\n this._resizeSensor?.detach()\n\n window.removeEventListener('scroll', this._onScroll, true)\n\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n ngAfterViewChecked() {\n if (this.ngSelect.dropdownPanel) {\n if (this._checkMarked) {\n if (this.ngSelect.dropdownPanel && this._markedItem !== null) {\n if (this._markedItem.index !== this.ngSelect.dropdownPanel.markedItem.index) {\n this.ngSelect.dropdownPanel.scrollTo(this.ngSelect.dropdownPanel.markedItem)\n }\n }\n }\n }\n this._checkMarked = false\n\n this._resizeSensor = new ResizeSensor(this.elementRef.nativeElement, (event) => {\n this._resizedEvent.emit({ element: this.elementRef.nativeElement, size: event })\n })\n }\n\n private _onScroll = (event: any) => {\n if (this.ngSelect && this.ngSelect.isOpen) {\n const isScrollingInScrollHost = (event.target.className as string).indexOf('ng-dropdown-panel-items') !== -1\n const isInSensor = (event.target.className as string).indexOf('resize-sensor-shrink') !== -1 ||\n (event.target.className as string).indexOf('os-resize-observer-host') !== -1\n if (isScrollingInScrollHost || isInSensor) { return }\n this.ngSelect.close()\n }\n}\n\n /**\n * Temp fix for: https://github.com/ng-select/ng-select/issues/1122\n */\n // private _patch_ngSelect_open() {\n // const original = this.ngSelect.open\n // const _self = this\n // this.ngSelect.open = function() {\n // original.apply(this, arguments)\n // _self._patch_ngSelectDropdownPanel_updateDropdownPosition()\n // }\n // }\n\n /** Should ONLY be called by `_patch_ngSelect_open`. */\n // private _patch_ngSelectDropdownPanel_updateDropdownPosition() {\n // if (!this.ngSelect.dropdownPanel) { return }\n // const drop: any = this.ngSelect.dropdownPanel\n // // Only needed once, to update the position before the timeout in\n // // `updateDropdownPosition()`. So, using this variable to check if I already called\n // // `_updateAppendedDropdownPosition()`.\n // if (!drop.__libPatched) {\n // drop.__libPatched = 'patched'\n // const original = drop.updateDropdownPosition\n // const _self = this\n // drop.updateDropdownPosition = function() {\n // original.apply(this, arguments)\n // if (!!_self.ngSelect.appendTo) {\n // drop._updateAppendedDropdownPosition()\n // }\n // }\n // }\n // }\n\n private _enableKeyPressWorkaround() {\n if (this._keyPressWorkaroundSub) { return }\n const _ngSelect = <any>this.ngSelect\n\n this._keyPressWorkaroundSub = _ngSelect._keyPress$\n .pipe(takeUntil(this._ngUnsubscribe))\n .pipe(filter(() => !this.ngSelect.searchable))\n .subscribe(() => {\n this._ngZone.runOutsideAngular(() => {\n window.requestAnimationFrame(() => {\n if (this.ngSelect.dropdownPanel) {\n this._markedItem = this.ngSelect.dropdownPanel.markedItem\n }\n this._checkMarked = true\n })\n })\n })\n }\n\n private _disableKeyPressWorkaround() {\n if (this._keyPressWorkaroundSub) {\n this._keyPressWorkaroundSub.unsubscribe()\n this._keyPressWorkaroundSub = null\n }\n }\n\n}\n","import { coerceNumberProperty } from '@angular/cdk/coercion'\nimport { AfterViewInit, Directive, ElementRef, HostBinding, Input, OnDestroy } from '@angular/core'\nimport { fromEvent, Subject } from 'rxjs'\nimport { filter, takeUntil, tap } from 'rxjs/operators'\n\nimport { QuillEditorComponent } from 'ngx-quill'\n\n@Directive({\n // tslint:disable-next-line:directive-selector\n selector: 'quill-editor'\n})\nexport class NgxQuillExtraDirective implements OnDestroy, AfterViewInit {\n\n private readonly _ngUnsubscribe = new Subject()\n\n private _tabIndex = -1\n\n /**\n * Set the tab index to `-1` to allow the root element of the\n * component to receive `focus` event from javascript, but not get focused by\n * keyboard navigation.\n */\n @Input()\n set tabIndex(value: number) { this._tabIndex = coerceNumberProperty(value) }\n get tabIndex(): number { return this._tabIndex }\n\n @HostBinding('attr.tabindex')\n get _attrTabIndex() { return this._quillEditor.disabled ? -1 : (this.tabIndex || 0) }\n\n constructor(\n private readonly _elementRef: ElementRef,\n private readonly _quillEditor: QuillEditorComponent\n ) { }\n\n ngOnDestroy() {\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n ngAfterViewInit() {\n const parent = this._getParentElementForLabelFocusIssue()\n if (parent) {\n // NOTE: This is a hack to avoid an issue letting a label with \"for\"\n // attribute focus the control.\n fromEvent(parent, 'click').pipe(\n takeUntil(this._ngUnsubscribe),\n filter(e => (e.target as HTMLElement)?.getAttribute('for') === this._elementRef.nativeElement.id),\n tap(() => this._quillEditor.quillEditor.focus())\n ).subscribe()\n }\n }\n\n private _getParentElementForLabelFocusIssue(): HTMLElement | undefined {\n const findElem = (elem: HTMLElement): any => {\n if (elem.nodeName.toLowerCase() === 'seam-form-field') {\n return elem\n }\n\n if (elem.parentElement) {\n return findElem(elem.parentElement)\n }\n\n return elem\n }\n\n return findElem(this._elementRef.nativeElement)\n }\n\n\n}\n","import { Pipe, PipeTransform } from '@angular/core'\n\nimport { padEnd, padStart } from '@theseam/ui-common/utils'\n\n@Pipe({\n name: 'maskChars'\n})\nexport class MaskCharsPipe implements PipeTransform {\n\n transform(value: string, replacementChar: string = '*', ignoreCount: number = 0, ignoreFrom: 'left' | 'right' = 'right'): string {\n if (ignoreFrom === 'right') {\n const s = value || ''\n return padStart(s.substring(s.length - ignoreCount, s.length), s.length, replacementChar)\n } else if (ignoreFrom === 'left') {\n const s = value || ''\n return padEnd(s.substring(0, ignoreCount), s.length, replacementChar)\n }\n\n return value\n }\n\n}\n","import { Pipe, PipeTransform } from '@angular/core'\n\n@Pipe({\n name: 'truncate'\n})\nexport class TruncatePipe implements PipeTransform {\n\n transform(value: string, length: number = 30, appendEllipsis: boolean = true): string {\n let val = value\n\n if (value && typeof value === 'string' && value.length > length) {\n val = value.substr(0, length)\n if (appendEllipsis) {\n val += '...'\n }\n }\n\n return val\n }\n\n}\n","import { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\n\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome'\n\nimport { TheSeamLoadingModule } from '@theseam/ui-common/loading'\nimport { TheSeamModalModule } from '@theseam/ui-common/modal'\nimport { TheSeamScrollbarModule } from '@theseam/ui-common/scrollbar'\n\nimport { AutoFocusDirective } from './directives/auto-focus.directive'\nimport { ClickOutsideDirective } from './directives/click-outside.directive'\nimport { DisableControlDirective } from './directives/disable-control.directive'\nimport { ElemResizedDirective } from './directives/elem-resized.directive'\nimport { HoverClassToggleDirective } from './directives/hover-class-toggle.directive'\nimport { HoverClassDirective } from './directives/hover-class.directive'\nimport { NgSelectExtraDirective } from './directives/ng-select-extra.directive'\nimport { NgxQuillExtraDirective } from './directives/ngx-quill-extra.directive'\n\nimport { MaskCharsPipe } from './pipes/mask-chars.pipe'\nimport { TruncatePipe } from './pipes/truncate.pipe'\n\nimport { PasswordInputRevealComponent } from './components/password-input-reveal/password-input-reveal.component'\n\n@NgModule({\n imports: [\n CommonModule,\n FontAwesomeModule,\n TheSeamModalModule,\n TheSeamLoadingModule\n ],\n declarations: [\n AutoFocusDirective,\n ElemResizedDirective,\n PasswordInputRevealComponent,\n NgSelectExtraDirective,\n HoverClassDirective,\n HoverClassToggleDirective,\n ClickOutsideDirective,\n DisableControlDirective,\n MaskCharsPipe,\n TruncatePipe,\n NgxQuillExtraDirective\n ],\n exports: [\n AutoFocusDirective,\n ElemResizedDirective,\n PasswordInputRevealComponent,\n NgSelectExtraDirective,\n HoverClassDirective,\n HoverClassToggleDirective,\n ClickOutsideDirective,\n DisableControlDirective,\n MaskCharsPipe,\n TruncatePipe,\n NgxQuillExtraDirective,\n\n // Exporting scrollbars here for backwards compatibility for now.\n TheSeamScrollbarModule\n ]\n})\nexport class TheSeamSharedModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;MAuCa,4BAA4B;IAlCzC;QAqCE,UAAK,GAAG,KAAK,CAAA;QACb,eAAU,GAAG,UAAU,CAAA;QAoBhB,qBAAgB,GAAG,KAAK,CAAA;KAYhC;IA9BC,IACI,QAAQ,KAA0C,OAAO,IAAI,CAAC,cAAc,CAAA,EAAE;IAClF,IAAI,QAAQ,CAAC,KAA0C;QACrD,IAAI,CAAC,cAAc,GAAG,KAAK,CAAA;QAC3B,IAAI,CAAC,iBAAiB,EAAE,CAAA;QACxB,IAAI,IAAI,CAAC,cAAc,EAAE;YACvB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,YAAY,GAAG,MAAM,CAAA;YAC/C,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;SACnD;KACF;IAGD,IACI,eAAe,KAAK,OAAO,IAAI,CAAC,gBAAgB,CAAA,EAAE;IACtD,IAAI,eAAe,CAAC,KAAc;QAChC,IAAI,CAAC,gBAAgB,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAA;QACpD,IAAI,CAAC,iBAAiB,EAAE,CAAA;KACzB;IAGM,iBAAiB;QACtB,IAAI,IAAI,CAAC,cAAc,EAAE;YACvB,IAAI,CAAC,cAAc,CAAC,IAAI,GAAG,IAAI,CAAC,eAAe,GAAG,MAAM,GAAG,UAAU,CAA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-
{"version":3,"file":"theseam-ui-common-unsaved-changes-dialog.js","sources":["../../../projects/ui-common/unsaved-changes-dialog/unsaved-changes-dialog.component.ts","../../../projects/ui-common/unsaved-changes-dialog/unsaved-changes-dialog.module.ts","../../../projects/ui-common/unsaved-changes-dialog/unsaved-changes-dialog.guard.ts","../../../projects/ui-common/unsaved-changes-dialog/unsaved-changes-can-deactivate.ts","../../../projects/ui-common/unsaved-changes-dialog/theseam-ui-common-unsaved-changes-dialog.ts"],"sourcesContent":["import { Component, OnInit } from '@angular/core'\n\n// TODO: Decide if this component should be implemented or just use the native\n// browser dialog for in-app routing also.\n\n@Component({\n selector: 'seam-unsaved-changes-dialog',\n template: `\n <p>\n unsaved-changes-dialog works!\n </p>\n `,\n styles: []\n})\nexport class UnsavedChangesDialogComponent implements OnInit {\n\n constructor() { }\n\n ngOnInit() {\n }\n\n}\n","import { NgModule } from '@angular/core'\n\nimport { UnsavedChangesDialogComponent } from './unsaved-changes-dialog.component'\n\n@NgModule({\n declarations: [UnsavedChangesDialogComponent],\n imports: [],\n exports: [UnsavedChangesDialogComponent]\n})\nexport class TheSeamUnsavedChangesDialogModule { }\n","import { Injectable, isDevMode } from '@angular/core'\nimport { CanDeactivate } from '@angular/router'\n\nimport { UnsavedChangesCanDeactivate } from './unsaved-changes-can-deactivate'\n\n@Injectable({\n providedIn: 'root'\n})\nexport class UnsavedChangesDialogGuard implements CanDeactivate<UnsavedChangesCanDeactivate> {\n\n /**\n * NOTE: Must be synchronous for now to allow `window:beforeunload` event support.\n */\n canDeactivate(component: UnsavedChangesCanDeactivate): boolean {\n if (isDevMode()) {\n if (!component.unsavedChangesCanDeactivate) {\n console.warn('Route Component with [UnsavedChangesDialogGuard] guard must extend [UnsavedChangesCanDeactivate] class.')\n }\n\n const w = window as any\n // Avoid redirect prevention in Storybook\n if (w && w.__STORYBOOK_CLIENT_API__) {\n return true\n }\n }\n\n if (!component.unsavedChangesCanDeactivate()) {\n if (confirm('You have unsaved changes! If you leave, your changes will be lost.')) {\n return true\n } else {\n return false\n }\n }\n return true\n }\n\n}\n","import { HostListener, isDevMode
|
|
1
|
+
{"version":3,"file":"theseam-ui-common-unsaved-changes-dialog.js","sources":["../../../projects/ui-common/unsaved-changes-dialog/unsaved-changes-dialog.component.ts","../../../projects/ui-common/unsaved-changes-dialog/unsaved-changes-dialog.module.ts","../../../projects/ui-common/unsaved-changes-dialog/unsaved-changes-dialog.guard.ts","../../../projects/ui-common/unsaved-changes-dialog/unsaved-changes-can-deactivate.ts","../../../projects/ui-common/unsaved-changes-dialog/theseam-ui-common-unsaved-changes-dialog.ts"],"sourcesContent":["import { Component, OnInit } from '@angular/core'\n\n// TODO: Decide if this component should be implemented or just use the native\n// browser dialog for in-app routing also.\n\n@Component({\n selector: 'seam-unsaved-changes-dialog',\n template: `\n <p>\n unsaved-changes-dialog works!\n </p>\n `,\n styles: []\n})\nexport class UnsavedChangesDialogComponent implements OnInit {\n\n constructor() { }\n\n ngOnInit() {\n }\n\n}\n","import { NgModule } from '@angular/core'\n\nimport { UnsavedChangesDialogComponent } from './unsaved-changes-dialog.component'\n\n@NgModule({\n declarations: [UnsavedChangesDialogComponent],\n imports: [],\n exports: [UnsavedChangesDialogComponent]\n})\nexport class TheSeamUnsavedChangesDialogModule { }\n","import { Injectable, isDevMode } from '@angular/core'\nimport { CanDeactivate } from '@angular/router'\n\nimport { UnsavedChangesCanDeactivate } from './unsaved-changes-can-deactivate'\n\n@Injectable({\n providedIn: 'root'\n})\nexport class UnsavedChangesDialogGuard implements CanDeactivate<UnsavedChangesCanDeactivate> {\n\n /**\n * NOTE: Must be synchronous for now to allow `window:beforeunload` event support.\n */\n canDeactivate(component: UnsavedChangesCanDeactivate): boolean {\n if (isDevMode()) {\n if (!component.unsavedChangesCanDeactivate) {\n console.warn('Route Component with [UnsavedChangesDialogGuard] guard must extend [UnsavedChangesCanDeactivate] class.')\n }\n\n const w = window as any\n // Avoid redirect prevention in Storybook\n if (w && w.__STORYBOOK_CLIENT_API__) {\n return true\n }\n }\n\n if (!component.unsavedChangesCanDeactivate()) {\n if (confirm('You have unsaved changes! If you leave, your changes will be lost.')) {\n return true\n } else {\n return false\n }\n }\n return true\n }\n\n}\n","import { Directive, HostListener, isDevMode } from '@angular/core'\n\n@Directive()\n// tslint:disable-next-line: directive-class-suffix\nexport abstract class UnsavedChangesCanDeactivate {\n\n abstract unsavedChangesCanDeactivate(): boolean\n\n @HostListener('window:beforeunload', ['$event'])\n __unloadNotification($event: any) {\n if (isDevMode()) {\n if (!this.unsavedChangesCanDeactivate) {\n console.warn('Route Component with [UnsavedChangesDialogGuard] guard must extend [UnsavedChangesCanDeactivate] class.')\n }\n\n const w = window as any\n // Avoid redirect prevention in Storybook\n if (w && w.__STORYBOOK_CLIENT_API__) {\n return true\n }\n }\n\n if (!this.unsavedChangesCanDeactivate()) {\n // $event.returnValue = true\n $event.returnValue = 'You have unsaved changes! If you leave, your changes will be lost.'\n }\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAEA;AACA;MAWa,6BAA6B;IAExC,iBAAiB;IAEjB,QAAQ;KACP;;;YAdF,SAAS,SAAC;gBACT,QAAQ,EAAE,6BAA6B;gBACvC,QAAQ,EAAE;;;;GAIT;aAEF;;;;MCJY,iCAAiC;;;YAL7C,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,6BAA6B,CAAC;gBAC7C,OAAO,EAAE,EAAE;gBACX,OAAO,EAAE,CAAC,6BAA6B,CAAC;aACzC;;;MCAY,yBAAyB;;;;IAKpC,aAAa,CAAC,SAAsC;QAClD,IAAI,SAAS,EAAE,EAAE;YACf,IAAI,CAAC,SAAS,CAAC,2BAA2B,EAAE;gBAC1C,OAAO,CAAC,IAAI,CAAC,yGAAyG,CAAC,CAAA;aACxH;YAED,MAAM,CAAC,GAAG,MAAa,CAAA;;YAEvB,IAAI,CAAC,IAAI,CAAC,CAAC,wBAAwB,EAAE;gBACnC,OAAO,IAAI,CAAA;aACZ;SACF;QAED,IAAI,CAAC,SAAS,CAAC,2BAA2B,EAAE,EAAE;YAC5C,IAAI,OAAO,CAAC,oEAAoE,CAAC,EAAE;gBACjF,OAAO,IAAI,CAAA;aACZ;iBAAM;gBACL,OAAO,KAAK,CAAA;aACb;SACF;QACD,OAAO,IAAI,CAAA;KACZ;;;;YA7BF,UAAU,SAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;;ACJD;MACsB,2BAA2B;IAK7C,oBAAoB,CAAC,MAAW;QAC9B,IAAI,SAAS,EAAE,EAAE;YACf,IAAI,CAAC,IAAI,CAAC,2BAA2B,EAAE;gBACrC,OAAO,CAAC,IAAI,CAAC,yGAAyG,CAAC,CAAA;aACxH;YAED,MAAM,CAAC,GAAG,MAAa,CAAA;;YAEvB,IAAI,CAAC,IAAI,CAAC,CAAC,wBAAwB,EAAE;gBACnC,OAAO,IAAI,CAAA;aACZ;SACF;QAED,IAAI,CAAC,IAAI,CAAC,2BAA2B,EAAE,EAAE;;YAEvC,MAAM,CAAC,WAAW,GAAG,oEAAoE,CAAA;SAC1F;KACF;;;YAxBJ,SAAS;;;mCAML,YAAY,SAAC,qBAAqB,EAAE,CAAC,QAAQ,CAAC;;;ACRnD;;;;;;"}
|
|
@@ -247,6 +247,12 @@ function hasRequiredControl(abstractControl) {
|
|
|
247
247
|
return false;
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
+
// Source: https://github.com/angular/angular/blob/master/packages/forms/src/validators.ts#L16
|
|
251
|
+
function isEmptyInputValue(value) {
|
|
252
|
+
// we don't check for string here so it also works with arrays
|
|
253
|
+
return value == null || value.length === 0;
|
|
254
|
+
}
|
|
255
|
+
|
|
250
256
|
function mapEach(predicate) {
|
|
251
257
|
return (source$) => source$.pipe(switchMap(v => from(v).pipe(map(m => predicate(m)), toArray())));
|
|
252
258
|
}
|
|
@@ -278,10 +284,14 @@ function hasRouteConfigDataProp(route, prop) {
|
|
|
278
284
|
function hasRouteConfigResolveProp(route, prop) {
|
|
279
285
|
return !!(route && route.routeConfig && route.routeConfig.resolve && route.routeConfig.resolve.hasOwnProperty(prop));
|
|
280
286
|
}
|
|
287
|
+
function willHaveDataProp(route, prop) {
|
|
288
|
+
return hasRouteConfigDataProp(route, prop) || hasRouteConfigResolveProp(route, prop);
|
|
289
|
+
}
|
|
290
|
+
|
|
281
291
|
function activatedRoutesWithDataProperty(prop, mustHaveDefined = false) {
|
|
282
292
|
const _data = (r) => r.data.pipe(map(_d => ({ route: r, data: _d })));
|
|
283
293
|
return (source$) => source$.pipe(map(route => leafChildRoute(route)), map(route => route.pathFromRoot), switchMap(routes => combineLatest(routes.map(r => _data(r)))), map(v => v.filter(_v => _v.data.hasOwnProperty(prop))), map(v => mustHaveDefined
|
|
284
|
-
? v.filter(_v =>
|
|
294
|
+
? v.filter(_v => willHaveDataProp(_v.route, prop))
|
|
285
295
|
: v));
|
|
286
296
|
}
|
|
287
297
|
|
|
@@ -293,6 +303,10 @@ function routeSnapshotPathFull(route) {
|
|
|
293
303
|
return route.pathFromRoot.reduce((path, _route) => path += routeSnapshotPathRelative(_route), '');
|
|
294
304
|
}
|
|
295
305
|
|
|
306
|
+
function isEmptyUrlRoute(activatedRoute) {
|
|
307
|
+
return activatedRoute.snapshot.url.length === 0;
|
|
308
|
+
}
|
|
309
|
+
|
|
296
310
|
function calcPercentage(total, n) {
|
|
297
311
|
return total && total > 0 ? (n / total) * 100 : 0;
|
|
298
312
|
}
|
|
@@ -720,9 +734,64 @@ function observeQueryList(queryList, emitCurrentValue = true) {
|
|
|
720
734
|
return queryList.changes.pipe(startWith(queryList), map(v => v.toArray()));
|
|
721
735
|
}
|
|
722
736
|
|
|
737
|
+
function createPadding(len, chars) {
|
|
738
|
+
// if (chars.length <= len) {
|
|
739
|
+
// return chars
|
|
740
|
+
// }
|
|
741
|
+
if (chars.length === 0) {
|
|
742
|
+
throw Error(`Padding characters must be at least 1 char length.`);
|
|
743
|
+
}
|
|
744
|
+
let str = chars;
|
|
745
|
+
while (str.length < len) {
|
|
746
|
+
str += chars;
|
|
747
|
+
}
|
|
748
|
+
if (str.length > len) {
|
|
749
|
+
str = str.slice(0, len);
|
|
750
|
+
}
|
|
751
|
+
return str;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
function padEnd(stringToPad, paddingLength = 0, paddingChars = ' ') {
|
|
755
|
+
const strLength = paddingLength ? stringToPad.length : 0;
|
|
756
|
+
if (!paddingLength || strLength >= paddingLength) {
|
|
757
|
+
return stringToPad;
|
|
758
|
+
}
|
|
759
|
+
return stringToPad + createPadding(paddingLength - strLength, paddingChars);
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
function padStart(stringToPad, paddingLength = 0, paddingChars = ' ') {
|
|
763
|
+
const strLength = paddingLength ? stringToPad.length : 0;
|
|
764
|
+
if (!paddingLength || strLength >= paddingLength) {
|
|
765
|
+
return stringToPad;
|
|
766
|
+
}
|
|
767
|
+
return createPadding(paddingLength - strLength, paddingChars) + stringToPad;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
function isNumeric(value) {
|
|
771
|
+
return !isNaN(Number(value) - parseFloat(value));
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* Returns the number of fractional digits.
|
|
776
|
+
*
|
|
777
|
+
* NOTE: This is intended for input validation, so trailing 0's will be included
|
|
778
|
+
* in the total. Also, localization is not considered, so '.' is assumed to be
|
|
779
|
+
* the fractional separator.
|
|
780
|
+
*/
|
|
781
|
+
function fractionalDigitsCount(value) {
|
|
782
|
+
if (!isNumeric(value)) {
|
|
783
|
+
return null;
|
|
784
|
+
}
|
|
785
|
+
const a = value.split('.');
|
|
786
|
+
if (a.length !== 2) {
|
|
787
|
+
return null;
|
|
788
|
+
}
|
|
789
|
+
return a[1].length;
|
|
790
|
+
}
|
|
791
|
+
|
|
723
792
|
/**
|
|
724
793
|
* Generated bundle index. Do not edit.
|
|
725
794
|
*/
|
|
726
795
|
|
|
727
|
-
export { PollingTickerOptions, Refreshable, activatedRoutesWithDataProperty, calcPercentage, deleteProperties, deleteProperty, fileBufferToBlob, fileBufferToObjectUrl, fileDataFromBuffer, getAttribute, getClosestWidgetCdkDrag, getControlName, getControlPath, hasAttribute, hasProperty, hasRequiredControl, isAbsoluteUrl, isNullOrUndefined, leafChildRoute, loadStyle, loadStyleSheet, mapEach, notNullOrUndefined, observeControlIsDifferent, observeControlStatus, observeControlValid, observeControlValue, observeControlValueChange, observeQueryList, openBlob, phoneNumberMask, pollingTicker, readFileAsDataUrlAsync, readFileAsync, routeSnapshotPathFull, routeSnapshotPathRelative, tapFirst, toggleAttribute, waitOnConditionAsync, waitOnNonPendingStatus, withoutProperties, withoutProperty, wrapIntoObservable };
|
|
796
|
+
export { PollingTickerOptions, Refreshable, activatedRoutesWithDataProperty, calcPercentage, createPadding, deleteProperties, deleteProperty, fileBufferToBlob, fileBufferToObjectUrl, fileDataFromBuffer, fractionalDigitsCount, getAttribute, getClosestWidgetCdkDrag, getControlName, getControlPath, hasAttribute, hasProperty, hasRequiredControl, isAbsoluteUrl, isEmptyInputValue, isEmptyUrlRoute, isNullOrUndefined, isNumeric, leafChildRoute, loadStyle, loadStyleSheet, mapEach, notNullOrUndefined, observeControlIsDifferent, observeControlStatus, observeControlValid, observeControlValue, observeControlValueChange, observeQueryList, openBlob, padEnd, padStart, phoneNumberMask, pollingTicker, readFileAsDataUrlAsync, readFileAsync, routeSnapshotPathFull, routeSnapshotPathRelative, tapFirst, toggleAttribute, waitOnConditionAsync, waitOnNonPendingStatus, willHaveDataProp, withoutProperties, withoutProperty, wrapIntoObservable };
|
|
728
797
|
//# sourceMappingURL=theseam-ui-common-utils.js.map
|