@morozeckiy/dd-lib 0.9.1 → 0.9.3

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.
@@ -265,11 +265,11 @@ html {
265
265
 
266
266
  .cdk-overlay-pane {
267
267
  &.right {
268
- margin-left: 35px;
268
+ margin-left: 8px;
269
269
  }
270
270
 
271
271
  &.left {
272
- margin-right: 35px;
272
+ margin-right: 8px;
273
273
  }
274
274
 
275
275
  &.top {
@@ -933,32 +933,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
933
933
  }] }] });
934
934
 
935
935
  const TOOLTIP_RIGHT = {
936
- originX: 'start',
937
- originY: 'center',
938
- overlayX: 'start',
936
+ originX: 'end', // привязываемся к правому краю элемента
937
+ originY: 'center', // по центру по вертикали
938
+ overlayX: 'start', // overlay начинается с левого края
939
939
  overlayY: 'center',
940
940
  panelClass: 'right',
941
+ offsetX: 8, // небольшой отступ
941
942
  };
942
943
  const TOOLTIP_BOTTOM = {
943
944
  originX: 'center',
944
- originY: 'bottom',
945
+ originY: 'bottom', // привязываемся к нижнему краю элемента
945
946
  overlayX: 'center',
946
- overlayY: 'top',
947
+ overlayY: 'top', // overlay привязывается сверху
947
948
  panelClass: 'bottom',
949
+ offsetY: 8,
948
950
  };
949
951
  const TOOLTIP_TOP = {
950
952
  originX: 'center',
951
- originY: 'top',
953
+ originY: 'top', // привязываемся к верхнему краю элемента
952
954
  overlayX: 'center',
953
- overlayY: 'bottom',
955
+ overlayY: 'bottom', // overlay привязывается снизу
954
956
  panelClass: 'top',
957
+ offsetY: -8,
955
958
  };
956
959
  const TOOLTIP_LEFT = {
957
- originX: 'end',
960
+ originX: 'start', // привязываемся к левому краю элемента
958
961
  originY: 'center',
959
- overlayX: 'end',
962
+ overlayX: 'end', // overlay привязывается справа
960
963
  overlayY: 'center',
961
964
  panelClass: 'left',
965
+ offsetX: -8,
962
966
  };
963
967
  class TooltipDirective {
964
968
  set position(p) {
@@ -994,8 +998,9 @@ class TooltipDirective {
994
998
  }
995
999
  const clickedInside = this.element.nativeElement.contains(targetElement.target);
996
1000
  if (!clickedInside) {
997
- if (this.overlayRef?.hasAttached() === true) {
998
- this.overlayRef?.detach();
1001
+ if (this.overlayRef?.hasAttached()) {
1002
+ this.overlayRef.dispose();
1003
+ this.overlayRef = null;
999
1004
  }
1000
1005
  }
1001
1006
  }
@@ -1003,12 +1008,9 @@ class TooltipDirective {
1003
1008
  if (!this.ddTooltip) {
1004
1009
  return;
1005
1010
  }
1006
- const overlay = document.getElementsByClassName('cdk-overlay-container')?.[0];
1007
- if (overlay && overlay.firstChild) {
1008
- overlay.removeChild(overlay.firstChild);
1009
- }
1010
- if (this.overlayRef?.hasAttached() === true) {
1011
- this.overlayRef?.detach();
1011
+ if (this.overlayRef?.hasAttached()) {
1012
+ this.overlayRef.dispose();
1013
+ this.overlayRef = null;
1012
1014
  return;
1013
1015
  }
1014
1016
  this.attachTooltip();
@@ -1029,18 +1031,23 @@ class TooltipDirective {
1029
1031
  if (this.withClick) {
1030
1032
  return;
1031
1033
  }
1032
- if (this.overlayRef?.hasAttached() === true) {
1033
- this.overlayRef?.detach();
1034
+ this.detachOverlay();
1035
+ }
1036
+ detachOverlay() {
1037
+ if (this.overlayRef?.hasAttached()) {
1038
+ this.overlayRef.detach();
1034
1039
  }
1035
1040
  }
1036
1041
  ngOnDestroy() {
1037
1042
  this.overlayRef?.dispose();
1038
1043
  }
1039
1044
  attachTooltip() {
1040
- if (this.overlayRef === null) {
1041
- const positionStrategy = this.getPositionStrategy();
1042
- this.overlayRef = this.overlay.create({ positionStrategy });
1045
+ if (this.overlayRef) {
1046
+ this.overlayRef.dispose();
1047
+ this.overlayRef = null;
1043
1048
  }
1049
+ const positionStrategy = this.getPositionStrategy();
1050
+ this.overlayRef = this.overlay.create({ positionStrategy });
1044
1051
  const injector = Injector.create({
1045
1052
  providers: [
1046
1053
  {
@@ -2010,36 +2017,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
2010
2017
  type: Input
2011
2018
  }] } });
2012
2019
 
2013
- class ModalQuestionComponent {
2014
- constructor() {
2015
- this.borderMobile = false;
2016
- this.showLoader = false;
2017
- this.btnAccept = 'Подтвердить';
2018
- this.btnCancel = 'Отменить';
2019
- this.dialog = inject((DDDialogRef));
2020
- }
2021
- onKeydownComponent(event) {
2022
- if (event.key === 'Escape' || event.key === 'Esc') {
2023
- this.destroy();
2024
- }
2025
- }
2026
- close(accept) {
2027
- this.dialog.close(accept);
2028
- }
2029
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ModalQuestionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2030
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: ModalQuestionComponent, isStandalone: true, selector: "dd-modal-question", host: { listeners: { "document:keydown": "onKeydownComponent($event)" } }, ngImport: i0, template: "<div class=\"popup\" [class.border-mobile]=\"borderMobile\">\r\n\r\n <div (click)=\"close()\" class=\"popup__close\"></div>\r\n <div class=\"popup__content\">\r\n <div class=\"flex-column gap-16\">\r\n <div class=\"h5-title\" [innerHTML]=\"modalTitle\"></div>\r\n <div class=\"text-plain\" [innerHTML]=\"modalText\"></div>\r\n </div>\r\n <div class=\"d-flex justify-between full-width\">\r\n <dd-lib-button>{{btnAccept}}</dd-lib-button>\r\n <dd-lib-button btnColor=\"white\">{{btnCancel}}</dd-lib-button>\r\n </div>\r\n </div>\r\n\r\n @if (showLoader) {\r\n <div class=\"loader-modal\">\r\n <dd-lib-loader size=\"giant\"></dd-lib-loader>\r\n </div>\r\n }\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "component", type: LibLoaderComponent, selector: "dd-lib-loader", inputs: ["color", "size"] }, { kind: "component", type: LibButtonComponent, selector: "dd-lib-button", inputs: ["noPadding", "loaderColor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2031
- }
2032
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ModalQuestionComponent, decorators: [{
2033
- type: Component,
2034
- args: [{ selector: 'dd-modal-question', imports: [
2035
- LibLoaderComponent,
2036
- LibButtonComponent
2037
- ], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"popup\" [class.border-mobile]=\"borderMobile\">\r\n\r\n <div (click)=\"close()\" class=\"popup__close\"></div>\r\n <div class=\"popup__content\">\r\n <div class=\"flex-column gap-16\">\r\n <div class=\"h5-title\" [innerHTML]=\"modalTitle\"></div>\r\n <div class=\"text-plain\" [innerHTML]=\"modalText\"></div>\r\n </div>\r\n <div class=\"d-flex justify-between full-width\">\r\n <dd-lib-button>{{btnAccept}}</dd-lib-button>\r\n <dd-lib-button btnColor=\"white\">{{btnCancel}}</dd-lib-button>\r\n </div>\r\n </div>\r\n\r\n @if (showLoader) {\r\n <div class=\"loader-modal\">\r\n <dd-lib-loader size=\"giant\"></dd-lib-loader>\r\n </div>\r\n }\r\n</div>\r\n" }]
2038
- }], propDecorators: { onKeydownComponent: [{
2039
- type: HostListener,
2040
- args: ['document:keydown', ['$event']]
2041
- }] } });
2042
-
2043
2020
  class ModalBaseComponent {
2044
2021
  constructor(route, router, dialog) {
2045
2022
  this.route = route;
@@ -2086,8 +2063,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
2086
2063
  args: ['document:keydown', ['$event']]
2087
2064
  }] } });
2088
2065
 
2066
+ class ModalQuestionComponent {
2067
+ constructor() {
2068
+ this.borderMobile = false;
2069
+ this.showLoader = false;
2070
+ this.btnAccept = 'Подтвердить';
2071
+ this.btnCancel = 'Отменить';
2072
+ this.dialog = inject((DDDialogRef));
2073
+ }
2074
+ onKeydownComponent(event) {
2075
+ if (event.key === 'Escape' || event.key === 'Esc') {
2076
+ this.destroy();
2077
+ }
2078
+ }
2079
+ close(accept) {
2080
+ this.dialog.close(accept);
2081
+ }
2082
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ModalQuestionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2083
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: ModalQuestionComponent, isStandalone: true, selector: "dd-modal-question", host: { listeners: { "document:keydown": "onKeydownComponent($event)" } }, ngImport: i0, template: "<dd-modal-base>\r\n <div class=\"p-40 t-p-24\" [class.border-mobile]=\"borderMobile\">\r\n\r\n <div (click)=\"close()\" class=\"popup__close\"></div>\r\n <div class=\"popup__content\">\r\n <div class=\"flex-column gap-16\">\r\n <div class=\"h5-title\" [innerHTML]=\"modalTitle\"></div>\r\n <div class=\"text-plain\" [innerHTML]=\"modalText\"></div>\r\n </div>\r\n <div class=\"mt-24 d-flex justify-between full-width\">\r\n <dd-lib-button (click)=\"close(true)\">{{btnAccept}}</dd-lib-button>\r\n <dd-lib-button (click)=\"close(false)\" btnColor=\"white\">{{btnCancel}}</dd-lib-button>\r\n </div>\r\n </div>\r\n\r\n @if (showLoader) {\r\n <div class=\"loader-modal\">\r\n <dd-lib-loader size=\"giant\"></dd-lib-loader>\r\n </div>\r\n }\r\n </div>\r\n\r\n</dd-modal-base>\r\n", styles: [""], dependencies: [{ kind: "component", type: LibLoaderComponent, selector: "dd-lib-loader", inputs: ["color", "size"] }, { kind: "component", type: LibButtonComponent, selector: "dd-lib-button", inputs: ["noPadding", "loaderColor"] }, { kind: "component", type: ModalBaseComponent, selector: "dd-modal-base", inputs: ["content", "component", "clearFragment", "borderMobile", "showLoader", "showContentLoader"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2084
+ }
2085
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ModalQuestionComponent, decorators: [{
2086
+ type: Component,
2087
+ args: [{ selector: 'dd-modal-question', imports: [
2088
+ LibLoaderComponent,
2089
+ LibButtonComponent,
2090
+ ModalBaseComponent
2091
+ ], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<dd-modal-base>\r\n <div class=\"p-40 t-p-24\" [class.border-mobile]=\"borderMobile\">\r\n\r\n <div (click)=\"close()\" class=\"popup__close\"></div>\r\n <div class=\"popup__content\">\r\n <div class=\"flex-column gap-16\">\r\n <div class=\"h5-title\" [innerHTML]=\"modalTitle\"></div>\r\n <div class=\"text-plain\" [innerHTML]=\"modalText\"></div>\r\n </div>\r\n <div class=\"mt-24 d-flex justify-between full-width\">\r\n <dd-lib-button (click)=\"close(true)\">{{btnAccept}}</dd-lib-button>\r\n <dd-lib-button (click)=\"close(false)\" btnColor=\"white\">{{btnCancel}}</dd-lib-button>\r\n </div>\r\n </div>\r\n\r\n @if (showLoader) {\r\n <div class=\"loader-modal\">\r\n <dd-lib-loader size=\"giant\"></dd-lib-loader>\r\n </div>\r\n }\r\n </div>\r\n\r\n</dd-modal-base>\r\n" }]
2092
+ }], propDecorators: { onKeydownComponent: [{
2093
+ type: HostListener,
2094
+ args: ['document:keydown', ['$event']]
2095
+ }] } });
2096
+
2097
+ function errorResponse() {
2098
+ return (source) => source.pipe(map(res => {
2099
+ if (res.result === 'ERROR') {
2100
+ throw res.message;
2101
+ }
2102
+ return res;
2103
+ }));
2104
+ }
2105
+
2089
2106
  // services
2090
- // map
2091
2107
 
2092
2108
  class LibCommonInputTextComponent {
2093
2109
  get id() {
@@ -5990,5 +6006,5 @@ const t = true;
5990
6006
  * Generated bundle index. Do not edit.
5991
6007
  */
5992
6008
 
5993
- export { API_URL, AutoHeightDirective, BusNumberPatternDirective, ClickOutsideDirective, CounterDirective, DDDialogRef, DEFAULT_FORMAT, DIALOG_CONFIG, DataEmptyComponent, DateService, Debounce, DeclensionDirective, DestroyService, DialogConfig, DialogService, DisableAfterNCall, Disabled, DropDownPositionDirective, ErrorPageComponent, FetcherService, FilterByKeyPipe, FilterPipe, FixedPositionDirective, FooterComponent, FooterLinkComponent, FooterLinksBlockComponent, HighlightPipe, IDatePeriod, ITab, InterceptorsService, LibAccordionComponent, LibBackButtonComponent, LibButtonComponent, LibCalendarComponent, LibCardComponent, LibCheckboxComponent, LibCommentInputComponent, LibCommonButtonComponent, LibCommonInputTextComponent, LibDateInputComponent, LibDateRangeComponent, LibDisclaimerComponent, LibFileLoaderComponent, LibFileUploadComponent, LibFilterButtonComponent, LibFilterComponent, LibHorizontalScrollComponent, LibImageLoaderComponent, LibInfoCardComponent, LibInputComponent, LibLoaderComponent, LibRadioComponent, LibSearchInputComponent, LibSelectComponent, LibSkeletonComponent, LibSortComponent, LibStepComponent, LibSvgComponent, LibSvgIconComponent, LibSvgViewerComponent, LibTabsFragmentComponent, LibTextareaComponent, ListKeyboardNavigationDirective, MainSharedComponent, ModalBaseComponent, ModalCommonComponent, ModalQuestionComponent, NotFoundComponent, PhoneMaskDirective, ResizeTextareaDirective, ReversePipe, SafePipe, SelectableItemDirective, SortByValPipe, SvgIconsService, TOAST_CONFIG_TOKEN, TOOLTIP_DATA, TechWorksComponent, ThemeConfigurator, ThemeConstructorService, Throttle, ToUpperCaseDirective, ToastComponent, ToastConfig, ToastData, ToastRef, ToastService, ToastTypeData, TooltipComponent, TooltipDirective, TriangleDirective, ValidatorsService, VhHeightDirective, completeIconSet, defaultToastConfig, provideToast, svgIconActogoneAccept, svgIconAll, svgIconAppgalery, svgIconAppstore, svgIconArrowDownRed, svgIconArrowUpGreen, svgIconBackArrow, svgIconBurger, svgIconCalendar, svgIconCheckGreen, svgIconCheckWhite, svgIconCircleNo, svgIconClear, svgIconClose, svgIconDangerT, svgIconDd, svgIconDdM, svgIconDobrodel, svgIconDownChevron, svgIconDownload, svgIconEds, svgIconEds2, svgIconEds2M, svgIconEdsM, svgIconEntry, svgIconErrorHint, svgIconEsia, svgIconEye, svgIconEyeOff, svgIconFile, svgIconFilter, svgIconGoogleapp, svgIconGrid, svgIconHealth, svgIconHealthM, svgIconInfoCircle, svgIconInfoT, svgIconLeftChevron, svgIconListSearch, svgIconLogout, svgIconMailExclamation, svgIconMaxFilter, svgIconMoon, svgIconMy, svgIconMyM, svgIconNews, svgIconNext, svgIconPaperclip, svgIconPenEdit, svgIconPguMo, svgIconPguMoM, svgIconPlug, svgIconPlugD, svgIconPlus, svgIconPreset, svgIconPrev, svgIconPrint, svgIconPrinter, svgIconQuestion, svgIconQuestionWhiteG, svgIconRedClose, svgIconReload, svgIconRightChevron, svgIconRustore, svgIconSearch, svgIconSend, svgIconSetAvatar, svgIconSharedLogo, svgIconSmallRoundLoader, svgIconSort, svgIconStar, svgIconSuccessT, svgIconSun, svgIconTg, svgIconToggleArrowLeft, svgIconToggleArrowRight, svgIconTrash, svgIconTrophy, svgIconUser, svgIconUserEmpty, svgIconUserEmptyD, svgIconVk, svgIconWarningT, t };
6009
+ export { API_URL, AutoHeightDirective, BusNumberPatternDirective, ClickOutsideDirective, CounterDirective, DDDialogRef, DEFAULT_FORMAT, DIALOG_CONFIG, DataEmptyComponent, DateService, Debounce, DeclensionDirective, DestroyService, DialogConfig, DialogService, DisableAfterNCall, Disabled, DropDownPositionDirective, ErrorPageComponent, FetcherService, FilterByKeyPipe, FilterPipe, FixedPositionDirective, FooterComponent, FooterLinkComponent, FooterLinksBlockComponent, HighlightPipe, IDatePeriod, ITab, InterceptorsService, LibAccordionComponent, LibBackButtonComponent, LibButtonComponent, LibCalendarComponent, LibCardComponent, LibCheckboxComponent, LibCommentInputComponent, LibCommonButtonComponent, LibCommonInputTextComponent, LibDateInputComponent, LibDateRangeComponent, LibDisclaimerComponent, LibFileLoaderComponent, LibFileUploadComponent, LibFilterButtonComponent, LibFilterComponent, LibHorizontalScrollComponent, LibImageLoaderComponent, LibInfoCardComponent, LibInputComponent, LibLoaderComponent, LibRadioComponent, LibSearchInputComponent, LibSelectComponent, LibSkeletonComponent, LibSortComponent, LibStepComponent, LibSvgComponent, LibSvgIconComponent, LibSvgViewerComponent, LibTabsFragmentComponent, LibTextareaComponent, ListKeyboardNavigationDirective, MainSharedComponent, ModalBaseComponent, ModalCommonComponent, ModalQuestionComponent, NotFoundComponent, PhoneMaskDirective, ResizeTextareaDirective, ReversePipe, SafePipe, SelectableItemDirective, SortByValPipe, SvgIconsService, TOAST_CONFIG_TOKEN, TOOLTIP_DATA, TechWorksComponent, ThemeConfigurator, ThemeConstructorService, Throttle, ToUpperCaseDirective, ToastComponent, ToastConfig, ToastData, ToastRef, ToastService, ToastTypeData, TooltipComponent, TooltipDirective, TriangleDirective, ValidatorsService, VhHeightDirective, completeIconSet, defaultToastConfig, errorResponse, provideToast, svgIconActogoneAccept, svgIconAll, svgIconAppgalery, svgIconAppstore, svgIconArrowDownRed, svgIconArrowUpGreen, svgIconBackArrow, svgIconBurger, svgIconCalendar, svgIconCheckGreen, svgIconCheckWhite, svgIconCircleNo, svgIconClear, svgIconClose, svgIconDangerT, svgIconDd, svgIconDdM, svgIconDobrodel, svgIconDownChevron, svgIconDownload, svgIconEds, svgIconEds2, svgIconEds2M, svgIconEdsM, svgIconEntry, svgIconErrorHint, svgIconEsia, svgIconEye, svgIconEyeOff, svgIconFile, svgIconFilter, svgIconGoogleapp, svgIconGrid, svgIconHealth, svgIconHealthM, svgIconInfoCircle, svgIconInfoT, svgIconLeftChevron, svgIconListSearch, svgIconLogout, svgIconMailExclamation, svgIconMaxFilter, svgIconMoon, svgIconMy, svgIconMyM, svgIconNews, svgIconNext, svgIconPaperclip, svgIconPenEdit, svgIconPguMo, svgIconPguMoM, svgIconPlug, svgIconPlugD, svgIconPlus, svgIconPreset, svgIconPrev, svgIconPrint, svgIconPrinter, svgIconQuestion, svgIconQuestionWhiteG, svgIconRedClose, svgIconReload, svgIconRightChevron, svgIconRustore, svgIconSearch, svgIconSend, svgIconSetAvatar, svgIconSharedLogo, svgIconSmallRoundLoader, svgIconSort, svgIconStar, svgIconSuccessT, svgIconSun, svgIconTg, svgIconToggleArrowLeft, svgIconToggleArrowRight, svgIconTrash, svgIconTrophy, svgIconUser, svgIconUserEmpty, svgIconUserEmptyD, svgIconVk, svgIconWarningT, t };
5994
6010
  //# sourceMappingURL=morozeckiy-dd-lib.mjs.map