@anglr/common 19.2.0-beta.20240125052632 → 20.0.0-beta.20240529082303

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 (51) hide show
  1. package/changelog.md +19 -1
  2. package/es2022/floating-ui/src/services/floatingUiDomPosition.service.js +2 -1
  3. package/es2022/floating-ui/src/services/floatingUiDomPosition.service.js.map +1 -1
  4. package/es2022/material/src/directives/debugDataCopyClick/debugDataCopyClick.directive.js +3 -2
  5. package/es2022/material/src/directives/debugDataCopyClick/debugDataCopyClick.directive.js.map +1 -1
  6. package/es2022/material/src/modules/debugDataCopyClick.module.js +9 -8
  7. package/es2022/material/src/modules/debugDataCopyClick.module.js.map +1 -1
  8. package/es2022/src/directives/ellipsisTooltip/ellipsisTooltip.directive.js +38 -4
  9. package/es2022/src/directives/ellipsisTooltip/ellipsisTooltip.directive.js.map +1 -1
  10. package/es2022/src/modules/commonUtils.module.js +7 -3
  11. package/es2022/src/modules/commonUtils.module.js.map +1 -1
  12. package/es2022/src/modules/debugData/components/debugData/debugData.component.js +8 -43
  13. package/es2022/src/modules/debugData/components/debugData/debugData.component.js.map +1 -1
  14. package/es2022/src/modules/debugData/modules/debugData.module.js +4 -8
  15. package/es2022/src/modules/debugData/modules/debugData.module.js.map +1 -1
  16. package/es2022/src/modules/debugData/services/debugDataEnabled/debugDataEnabled.service.js +4 -19
  17. package/es2022/src/modules/debugData/services/debugDataEnabled/debugDataEnabled.service.js.map +1 -1
  18. package/es2022/src/modules/tooltip/directives/tooltip/tooltip.directive.js +11 -6
  19. package/es2022/src/modules/tooltip/directives/tooltip/tooltip.directive.js.map +1 -1
  20. package/es2022/src/pipes/index.js +1 -0
  21. package/es2022/src/pipes/index.js.map +1 -1
  22. package/es2022/src/pipes/trimText/trimText.pipe.js +29 -0
  23. package/es2022/src/pipes/trimText/trimText.pipe.js.map +1 -0
  24. package/floating-ui/src/services/floatingUiDomPosition.service.d.ts.map +1 -1
  25. package/material/src/directives/debugDataCopyClick/debugDataCopyClick.directive.d.ts +2 -2
  26. package/material/src/directives/debugDataCopyClick/debugDataCopyClick.directive.d.ts.map +1 -1
  27. package/material/src/modules/debugDataCopyClick.module.d.ts +3 -3
  28. package/material/src/modules/debugDataCopyClick.module.d.ts.map +1 -1
  29. package/package.json +1 -1
  30. package/src/directives/ellipsisTooltip/ellipsisTooltip.directive.d.ts +13 -1
  31. package/src/directives/ellipsisTooltip/ellipsisTooltip.directive.d.ts.map +1 -1
  32. package/src/modules/commonUtils.module.d.ts +2 -1
  33. package/src/modules/commonUtils.module.d.ts.map +1 -1
  34. package/src/modules/debugData/components/debugData/debugData.component.css +1 -0
  35. package/src/modules/debugData/components/debugData/debugData.component.d.ts +4 -24
  36. package/src/modules/debugData/components/debugData/debugData.component.d.ts.map +1 -1
  37. package/src/modules/debugData/components/debugData/debugData.component.html +4 -3
  38. package/src/modules/debugData/modules/debugData.module.d.ts +1 -2
  39. package/src/modules/debugData/modules/debugData.module.d.ts.map +1 -1
  40. package/src/modules/debugData/services/debugDataEnabled/debugDataEnabled.service.d.ts +2 -10
  41. package/src/modules/debugData/services/debugDataEnabled/debugDataEnabled.service.d.ts.map +1 -1
  42. package/src/modules/tooltip/directives/tooltip/tooltip.directive.d.ts +5 -6
  43. package/src/modules/tooltip/directives/tooltip/tooltip.directive.d.ts.map +1 -1
  44. package/src/pipes/index.d.ts +1 -0
  45. package/src/pipes/index.d.ts.map +1 -1
  46. package/src/pipes/trimText/trimText.pipe.d.ts +17 -0
  47. package/src/pipes/trimText/trimText.pipe.d.ts.map +1 -0
  48. package/styles/core/_mixins.scss +14 -0
  49. package/styles/core/_theme.scss +4 -0
  50. package/version.bak +1 -1
  51. package/src/style.scss +0 -87
package/changelog.md CHANGED
@@ -1,9 +1,11 @@
1
1
  # Changelog
2
2
 
3
- ## Version 19.1.0 (2023-12-14)
3
+ ## Version 19.1.0 (2024-05-13)
4
4
 
5
5
  ### Bug Fixes
6
6
 
7
+ - fixed `DebugDataComponent` now color styles can be imported
8
+ - fixed `TooltipDirective` dual tooltip when nested elements are marked with tooltip
7
9
  - fixed `TooltipDirective` overflowing 'MouseEnter' tooltip on right side of screen
8
10
  - fixed `TooltipDirective` rendering tooltip only for non empty content
9
11
  - *subpackage* `@anglr/common/material`
@@ -12,23 +14,33 @@
12
14
  ### Feature
13
15
 
14
16
  - new `AsSignal` property decorator, that creates backing field for this property as WritableSignal, reads and write to it
17
+ - new `TrimTextPipe` pipe, that trims long text and adds 'suffix' indication of longer text
15
18
  - new `EllipsisTooltipSADirective` directive, that is used for displaying text from attached element in tooltip
16
19
  - **implements**
17
20
  - `OnChanges`
18
21
  - `OnDestroy`
19
22
  - **inputs**
23
+ - `tooltipPrefix` tooltip prefix text to be prepended to tooltip read from content
24
+ - `tooltipSuffix` tooltip suffix text to be appended to tooltip read from content
20
25
  - `ellipsisClass` css class appliet to element
21
26
  - `allowHtml` indication whether are html tags allowed in tooltip text
22
27
  - `ellipsisTooltip` gets or sets HTML element from which is text taken for tooltip
23
28
  - new `getHostElement` function, that gets host html element for component
24
29
  - updated `TooltipDirective` directive
25
30
  - is now `standalone`
31
+ - updated `DebugDataComponent` component
32
+ - is now `standalone`
33
+ - **styles**
34
+ - new `buildThemeColorsDebugData` mixin, that builds theme colors for debug data component
35
+ - new `buildThemeDebugData` mixin, that builds theme for debug data component
26
36
  - *subpackage* `@anglr/common/material`
27
37
  - new `provideConfirmationDialogOptions` function, that provides global options for confirmation dialog
28
38
  - updated `CONFIRMATION_DIALOG_OPTIONS` injection token
29
39
  - now provides `RecursivePartial` type as it should
30
40
  - updated `ConfirmationDialogDirective` directive
31
41
  - is now `standalone`
42
+ - updated `DebugDataCopyClickDirective` directive
43
+ - is now `standalone`
32
44
 
33
45
  ## Version 19.0.0 (2023-11-09)
34
46
 
@@ -48,6 +60,12 @@
48
60
  - minimal supported version of `tslib` is `2.6.2`
49
61
  - tooltip themes changed, previous *dark* is not *light* and vice versa, dark background should be identified as light theme since it is normally used within light app theme
50
62
 
63
+ ## Version 18.2.1 (2023-11-20)
64
+
65
+ ### Bug Fixes
66
+
67
+ - fixed `ProgressIndicatorService` isBrowser indicator initialization
68
+
51
69
  ## Version 18.2.0 (2023-11-09)
52
70
 
53
71
  ### Features
@@ -2,7 +2,7 @@ import { __decorate } from "tslib";
2
2
  import { Injectable, forwardRef } from '@angular/core';
3
3
  import { PositionOffset, PositionPlacement, POSITION, TypeProvider } from '@anglr/common';
4
4
  import { extend, isEmptyObject, isFunction, isJsObject, isNumber, nameof } from '@jscrpt/common';
5
- import { computePosition, autoUpdate, offset, flip } from '@floating-ui/dom';
5
+ import { computePosition, autoUpdate, offset, flip, shift } from '@floating-ui/dom';
6
6
  import { Observable } from 'rxjs';
7
7
  import * as i0 from "@angular/core";
8
8
  /**
@@ -29,6 +29,7 @@ let FloatingUiDomPosition = class FloatingUiDomPosition {
29
29
  const middlewares = [];
30
30
  this._setOffset(middlewares, computedOptions);
31
31
  this._setFlip(middlewares, computedOptions);
32
+ middlewares.push(shift());
32
33
  const runComputation = async () => {
33
34
  const result = await computePosition(source, target, {
34
35
  placement: this._getPlacement(computedOptions),
@@ -1 +1 @@
1
- {"version":3,"file":"floatingUiDomPosition.service.js","sourceRoot":"","sources":["../../../../floating-ui/src/services/floatingUiDomPosition.service.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,UAAU,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAA4C,cAAc,EAAE,iBAAiB,EAAqB,QAAQ,EAAyC,YAAY,EAAC,MAAM,eAAe,CAAC;AAC7L,OAAO,EAAC,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAC/F,OAAO,EAAC,eAAe,EAAa,UAAU,EAAc,MAAM,EAAE,IAAI,EAAC,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAAC,UAAU,EAAC,MAAM,MAAM,CAAC;;AAEhC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":["import {Injectable, forwardRef} from '@angular/core';\nimport {Position, PositionResult, PositionOptions, PositionOffset, PositionPlacement, AutoUpdateOptions, POSITION, PositionOffsetString, PositionOffsets, TypeProvider} from '@anglr/common';\nimport {extend, isEmptyObject, isFunction, isJsObject, isNumber, nameof} from '@jscrpt/common';\nimport {computePosition, Placement, autoUpdate, Middleware, offset, flip} from '@floating-ui/dom';\nimport {Observable} from 'rxjs';\n\n/**\n * Default options for `FloatingUiDomPosition` implementation\n */\nconst defaultOptions: PositionOptions =\n{\n autoUpdate: false,\n flip: false,\n offset: nameof<typeof PositionOffset>('None') as PositionOffsetString,\n placement: PositionPlacement.TopStart,\n};\n\n/**\n * Service that is used for positioning two elements against each other, using floating-ui dom implementation\n */\n@Injectable()\n@TypeProvider({provide: POSITION, useClass: forwardRef(() => FloatingUiDomPosition)})\nexport class FloatingUiDomPosition implements Position\n{\n //######################### public methods - implementation of Position #########################\n\n /**\n * @inheritdoc\n */\n public placeElement(target: Element, source: Element, options?: Partial<PositionOptions>): Observable<PositionResult>\n {\n return new Observable(subscriber =>\n {\n (async () =>\n {\n const computedOptions = extend({}, defaultOptions, options);\n const middlewares: Middleware[] = [];\n\n this._setOffset(middlewares, computedOptions);\n this._setFlip(middlewares, computedOptions);\n\n const runComputation = async () =>\n {\n const result = await computePosition(source,\n target as HTMLElement,\n {\n placement: this._getPlacement(computedOptions),\n middleware: middlewares,\n });\n\n if(computedOptions.autoUpdate)\n {\n subscriber.next(\n {\n target,\n dispose,\n flip: !!result.middlewareData.flip && !isEmptyObject(result.middlewareData.flip),\n x: result.x,\n y: result.y\n });\n }\n\n return result;\n };\n\n let dispose = () => {};\n\n if(computedOptions.autoUpdate)\n {\n let options: AutoUpdateOptions;\n\n if(computedOptions.autoUpdate === true)\n {\n options =\n {\n ancestorResize: true,\n ancestorScroll: true,\n elementResize: true\n };\n }\n else\n {\n options = computedOptions.autoUpdate;\n }\n\n dispose = autoUpdate(source,\n target as HTMLElement,\n runComputation,\n options);\n }\n\n const result = await runComputation();\n\n subscriber.next(\n {\n target,\n dispose,\n flip: !!result.middlewareData.flip && !isEmptyObject(result.middlewareData.flip),\n x: result.x,\n y: result.y\n });\n\n if(!computedOptions.autoUpdate)\n {\n subscriber.complete();\n }\n })();\n });\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets flip middleware\n * @param middlewares - Array of middlewares that will set\n * @param options - Options that contains definition of flip\n */\n protected _setFlip(middlewares: Middleware[], options: PositionOptions): void\n {\n if(options.flip)\n {\n middlewares.push(flip());\n }\n }\n\n /**\n * Sets offset middleware\n * @param middlewares - Array of middlewares that will set\n * @param options - Options that contains definition of offset\n */\n protected _setOffset(middlewares: Middleware[], options: PositionOptions): void\n {\n //no offset\n if(options.offset === PositionOffset[PositionOffset.None])\n {\n return;\n }\n\n if(options.offset === PositionOffset[PositionOffset.MouseEnter])\n {\n //fallback if not supported placement used\n if(options.placement == PositionPlacement.Left ||\n options.placement == PositionPlacement.LeftStart ||\n options.placement == PositionPlacement.LeftEnd ||\n options.placement == PositionPlacement.Right ||\n options.placement == PositionPlacement.RightStart ||\n options.placement == PositionPlacement.RightEnd ||\n options.placement == PositionPlacement.Bottom ||\n options.placement == PositionPlacement.BottomEnd ||\n options.placement == PositionPlacement.Top ||\n options.placement == PositionPlacement.TopEnd)\n {\n options.placement = PositionPlacement.TopEnd;\n }\n }\n\n middlewares.push(offset(({elements, placement, x, y}) =>\n {\n //offset is function\n if(isFunction(options.offset))\n {\n return options.offset({elements, x, y});\n }\n\n const floating = elements.floating as Element;\n\n if(options.offset === PositionOffset[PositionOffset.MouseEnter] && options.mouseEvent)\n {\n const targetBoundingRect = (options.mouseEvent.target as HTMLElement).getBoundingClientRect();\n const floatingBoundingRect = (elements.floating as HTMLElement).getBoundingClientRect();\n\n return {\n crossAxis: options.mouseEvent.x - targetBoundingRect.right + floatingBoundingRect.width\n };\n }\n\n const stringOffset = options.offset as PositionOffsetString|number;\n\n //offset is object\n if(isJsObject(options.offset))\n {\n return options.offset as PositionOffsets;\n }\n\n //offset is skidding number\n if(isNumber(stringOffset))\n {\n return {\n crossAxis: stringOffset,\n };\n }\n\n let dimension: number;\n\n if(placement == 'bottom' || placement == 'bottom-start' || placement == 'bottom-end' ||\n placement == 'top' || placement == 'top-start' || placement == 'top-end')\n {\n dimension = floating.clientWidth;\n }\n else\n {\n dimension = floating.clientHeight;\n }\n\n switch(stringOffset)\n {\n default:\n {\n dimension = 0;\n\n break;\n }\n case PositionOffset[PositionOffset.Full]:\n {\n break;\n }\n case PositionOffset[PositionOffset.Half]:\n {\n dimension /= 2;\n\n break;\n }\n case PositionOffset[PositionOffset.NegativeFull]:\n {\n dimension *= -1;\n\n break;\n }\n case PositionOffset[PositionOffset.NegativeHalf]:\n {\n dimension *= -.5;\n\n break;\n }\n }\n\n return {\n crossAxis: dimension\n };\n }));\n }\n\n /**\n * Gets floating ui placement from position placement\n * @param options - Options containing position placement\n */\n protected _getPlacement(options: PositionOptions): Placement\n {\n switch(options.placement)\n {\n default:\n // case PositionPlacement.Top:\n {\n return 'top';\n }\n case PositionPlacement.TopStart:\n {\n return 'top-start';\n }\n case PositionPlacement.TopEnd:\n {\n return 'top-end';\n }\n case PositionPlacement.Bottom:\n {\n return 'bottom';\n }\n case PositionPlacement.BottomStart:\n {\n return 'bottom-start';\n }\n case PositionPlacement.BottomEnd:\n {\n return 'bottom-end';\n }\n case PositionPlacement.Left:\n {\n return 'left';\n }\n case PositionPlacement.LeftStart:\n {\n return 'left-start';\n }\n case PositionPlacement.LeftEnd:\n {\n return 'left-end';\n }\n case PositionPlacement.Right:\n {\n return 'right';\n }\n case PositionPlacement.RightStart:\n {\n return 'right-start';\n }\n case PositionPlacement.RightEnd:\n {\n return 'right-end';\n }\n }\n }\n}\n"]}
1
+ {"version":3,"file":"floatingUiDomPosition.service.js","sourceRoot":"","sources":["../../../../floating-ui/src/services/floatingUiDomPosition.service.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,UAAU,EAAE,UAAU,EAAC,MAA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;gBAC5B;oBACI,OAAO,OAAO,CAAC;iBAClB;YACD,KAAK,iBAAiB,CAAC,UAAU;gBACjC;oBACI,OAAO,aAAa,CAAC;iBACxB;YACD,KAAK,iBAAiB,CAAC,QAAQ;gBAC/B;oBACI,OAAO,WAAW,CAAC;iBACtB;SACJ;IACL,CAAC;uGAvRQ,qBAAqB;2GAArB,qBAAqB;;AAArB,qBAAqB;IADjC,YAAY,CAAC,EAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,qBAAqB,CAAC,EAAC,CAAC;GACxE,qBAAqB,CAwRjC;;2FAxRY,qBAAqB;kBAFjC,UAAU","sourcesContent":["import {Injectable, forwardRef} from '@angular/core';\nimport {Position, PositionResult, PositionOptions, PositionOffset, PositionPlacement, AutoUpdateOptions, POSITION, PositionOffsetString, PositionOffsets, TypeProvider} from '@anglr/common';\nimport {extend, isEmptyObject, isFunction, isJsObject, isNumber, nameof} from '@jscrpt/common';\nimport {computePosition, Placement, autoUpdate, Middleware, offset, flip, shift} from '@floating-ui/dom';\nimport {Observable} from 'rxjs';\n\n/**\n * Default options for `FloatingUiDomPosition` implementation\n */\nconst defaultOptions: PositionOptions =\n{\n autoUpdate: false,\n flip: false,\n offset: nameof<typeof PositionOffset>('None') as PositionOffsetString,\n placement: PositionPlacement.TopStart,\n};\n\n/**\n * Service that is used for positioning two elements against each other, using floating-ui dom implementation\n */\n@Injectable()\n@TypeProvider({provide: POSITION, useClass: forwardRef(() => FloatingUiDomPosition)})\nexport class FloatingUiDomPosition implements Position\n{\n //######################### public methods - implementation of Position #########################\n\n /**\n * @inheritdoc\n */\n public placeElement(target: Element, source: Element, options?: Partial<PositionOptions>): Observable<PositionResult>\n {\n return new Observable(subscriber =>\n {\n (async () =>\n {\n const computedOptions = extend({}, defaultOptions, options);\n const middlewares: Middleware[] = [];\n\n this._setOffset(middlewares, computedOptions);\n this._setFlip(middlewares, computedOptions);\n middlewares.push(shift());\n\n const runComputation = async () =>\n {\n const result = await computePosition(source,\n target as HTMLElement,\n {\n placement: this._getPlacement(computedOptions),\n middleware: middlewares,\n });\n\n if(computedOptions.autoUpdate)\n {\n subscriber.next(\n {\n target,\n dispose,\n flip: !!result.middlewareData.flip && !isEmptyObject(result.middlewareData.flip),\n x: result.x,\n y: result.y\n });\n }\n\n return result;\n };\n\n let dispose = () => {};\n\n if(computedOptions.autoUpdate)\n {\n let options: AutoUpdateOptions;\n\n if(computedOptions.autoUpdate === true)\n {\n options =\n {\n ancestorResize: true,\n ancestorScroll: true,\n elementResize: true\n };\n }\n else\n {\n options = computedOptions.autoUpdate;\n }\n\n dispose = autoUpdate(source,\n target as HTMLElement,\n runComputation,\n options);\n }\n\n const result = await runComputation();\n\n subscriber.next(\n {\n target,\n dispose,\n flip: !!result.middlewareData.flip && !isEmptyObject(result.middlewareData.flip),\n x: result.x,\n y: result.y\n });\n\n if(!computedOptions.autoUpdate)\n {\n subscriber.complete();\n }\n })();\n });\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets flip middleware\n * @param middlewares - Array of middlewares that will set\n * @param options - Options that contains definition of flip\n */\n protected _setFlip(middlewares: Middleware[], options: PositionOptions): void\n {\n if(options.flip)\n {\n middlewares.push(flip());\n }\n }\n\n /**\n * Sets offset middleware\n * @param middlewares - Array of middlewares that will set\n * @param options - Options that contains definition of offset\n */\n protected _setOffset(middlewares: Middleware[], options: PositionOptions): void\n {\n //no offset\n if(options.offset === PositionOffset[PositionOffset.None])\n {\n return;\n }\n\n if(options.offset === PositionOffset[PositionOffset.MouseEnter])\n {\n //fallback if not supported placement used\n if(options.placement == PositionPlacement.Left ||\n options.placement == PositionPlacement.LeftStart ||\n options.placement == PositionPlacement.LeftEnd ||\n options.placement == PositionPlacement.Right ||\n options.placement == PositionPlacement.RightStart ||\n options.placement == PositionPlacement.RightEnd ||\n options.placement == PositionPlacement.Bottom ||\n options.placement == PositionPlacement.BottomEnd ||\n options.placement == PositionPlacement.Top ||\n options.placement == PositionPlacement.TopEnd)\n {\n options.placement = PositionPlacement.TopEnd;\n }\n }\n\n middlewares.push(offset(({elements, placement, x, y}) =>\n {\n //offset is function\n if(isFunction(options.offset))\n {\n return options.offset({elements, x, y});\n }\n\n const floating = elements.floating as Element;\n\n if(options.offset === PositionOffset[PositionOffset.MouseEnter] && options.mouseEvent)\n {\n const targetBoundingRect = (options.mouseEvent.target as HTMLElement).getBoundingClientRect();\n const floatingBoundingRect = (elements.floating as HTMLElement).getBoundingClientRect();\n\n return {\n crossAxis: options.mouseEvent.x - targetBoundingRect.right + floatingBoundingRect.width\n };\n }\n\n const stringOffset = options.offset as PositionOffsetString|number;\n\n //offset is object\n if(isJsObject(options.offset))\n {\n return options.offset as PositionOffsets;\n }\n\n //offset is skidding number\n if(isNumber(stringOffset))\n {\n return {\n crossAxis: stringOffset,\n };\n }\n\n let dimension: number;\n\n if(placement == 'bottom' || placement == 'bottom-start' || placement == 'bottom-end' ||\n placement == 'top' || placement == 'top-start' || placement == 'top-end')\n {\n dimension = floating.clientWidth;\n }\n else\n {\n dimension = floating.clientHeight;\n }\n\n switch(stringOffset)\n {\n default:\n {\n dimension = 0;\n\n break;\n }\n case PositionOffset[PositionOffset.Full]:\n {\n break;\n }\n case PositionOffset[PositionOffset.Half]:\n {\n dimension /= 2;\n\n break;\n }\n case PositionOffset[PositionOffset.NegativeFull]:\n {\n dimension *= -1;\n\n break;\n }\n case PositionOffset[PositionOffset.NegativeHalf]:\n {\n dimension *= -.5;\n\n break;\n }\n }\n\n return {\n crossAxis: dimension\n };\n }));\n }\n\n /**\n * Gets floating ui placement from position placement\n * @param options - Options containing position placement\n */\n protected _getPlacement(options: PositionOptions): Placement\n {\n switch(options.placement)\n {\n default:\n // case PositionPlacement.Top:\n {\n return 'top';\n }\n case PositionPlacement.TopStart:\n {\n return 'top-start';\n }\n case PositionPlacement.TopEnd:\n {\n return 'top-end';\n }\n case PositionPlacement.Bottom:\n {\n return 'bottom';\n }\n case PositionPlacement.BottomStart:\n {\n return 'bottom-start';\n }\n case PositionPlacement.BottomEnd:\n {\n return 'bottom-end';\n }\n case PositionPlacement.Left:\n {\n return 'left';\n }\n case PositionPlacement.LeftStart:\n {\n return 'left-start';\n }\n case PositionPlacement.LeftEnd:\n {\n return 'left-end';\n }\n case PositionPlacement.Right:\n {\n return 'right';\n }\n case PositionPlacement.RightStart:\n {\n return 'right-start';\n }\n case PositionPlacement.RightEnd:\n {\n return 'right-end';\n }\n }\n }\n}\n"]}
@@ -33,12 +33,13 @@ export class DebugDataCopyClickDirective {
33
33
  this._clipboard.copy(JSON.stringify(this.data, null, 4));
34
34
  }
35
35
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: DebugDataCopyClickDirective, deps: [{ token: i1.Clipboard }], target: i0.ɵɵFactoryTarget.Directive });
36
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.5", type: DebugDataCopyClickDirective, selector: "debug-data[copyClick]", inputs: { data: ["copyClick", "data"] }, host: { listeners: { "click": "copyData()" }, properties: { "class.clickable": "this.clickable" } }, ngImport: i0 });
36
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.5", type: DebugDataCopyClickDirective, isStandalone: true, selector: "debug-data[copyClick]", inputs: { data: ["copyClick", "data"] }, host: { listeners: { "click": "copyData()" }, properties: { "class.clickable": "this.clickable" } }, ngImport: i0 });
37
37
  }
38
38
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: DebugDataCopyClickDirective, decorators: [{
39
39
  type: Directive,
40
40
  args: [{
41
- selector: 'debug-data[copyClick]'
41
+ selector: 'debug-data[copyClick]',
42
+ standalone: true,
42
43
  }]
43
44
  }], ctorParameters: () => [{ type: i1.Clipboard }], propDecorators: { data: [{
44
45
  type: Input,
@@ -1 +1 @@
1
- {"version":3,"file":"debugDataCopyClick.directive.js","sourceRoot":"","sources":["../../../../../material/src/directives/debugDataCopyClick/debugDataCopyClick.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;;;AAEjD;;GAEG;AAKH,MAAM,OAAO,2BAA2B;IAqBd;IAnBtB,gFAAgF;IAEhF;;OAEG;IAEI,IAAI,CAAM;IAEjB,8EAA8E;IAE9E;;;;OAIG;IAEI,SAAS,GAAY,IAAI,CAAC;IAEjC,iEAAiE;IACjE,YAAsB,UAAqB;QAArB,eAAU,GAAV,UAAU,CAAW;IAE3C,CAAC;IAED,2EAA2E;IAE3E;;;;OAIG;IAEI,QAAQ;QAEX,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7D,CAAC;uGApCQ,2BAA2B;2FAA3B,2BAA2B;;2FAA3B,2BAA2B;kBAJvC,SAAS;mBACV;oBACI,QAAQ,EAAE,uBAAuB;iBACpC;8EASU,IAAI;sBADV,KAAK;uBAAC,WAAW;gBAWX,SAAS;sBADf,WAAW;uBAAC,iBAAiB;gBAgBvB,QAAQ;sBADd,YAAY;uBAAC,OAAO","sourcesContent":["import {Directive, HostBinding, HostListener, Input} from '@angular/core';\nimport {Clipboard} from '@angular/cdk/clipboard';\n\n/**\n * Directive that allows to copy data to clipboard on click on debug-data\n */\n@Directive(\n{\n selector: 'debug-data[copyClick]'\n})\nexport class DebugDataCopyClickDirective\n{\n //######################### public properties - inputs #########################\n\n /**\n * Data to be copied as serialized json\n */\n @Input('copyClick')\n public data: any;\n\n //######################### public properties - host #########################\n\n /**\n * Adds css class clickable to this element\n * \n * @internal\n */\n @HostBinding('class.clickable')\n public clickable: boolean = true;\n\n //######################### constructor #########################\n constructor(protected _clipboard: Clipboard)\n {\n }\n\n //######################### public methods - host #########################\n\n /**\n * Copies data to clipboard on click\n * \n * @internal\n */\n @HostListener('click')\n public copyData(): void\n {\n this._clipboard.copy(JSON.stringify(this.data, null, 4));\n }\n}"]}
1
+ {"version":3,"file":"debugDataCopyClick.directive.js","sourceRoot":"","sources":["../../../../../material/src/directives/debugDataCopyClick/debugDataCopyClick.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;;;AAEjD;;GAEG;AAMH,MAAM,OAAO,2BAA2B;IAqBd;IAnBtB,gFAAgF;IAEhF;;OAEG;IAEI,IAAI,CAAU;IAErB,8EAA8E;IAE9E;;;;OAIG;IAEI,SAAS,GAAY,IAAI,CAAC;IAEjC,iEAAiE;IACjE,YAAsB,UAAqB;QAArB,eAAU,GAAV,UAAU,CAAW;IAE3C,CAAC;IAED,2EAA2E;IAE3E;;;;OAIG;IAEI,QAAQ;QAEX,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7D,CAAC;uGApCQ,2BAA2B;2FAA3B,2BAA2B;;2FAA3B,2BAA2B;kBALvC,SAAS;mBACV;oBACI,QAAQ,EAAE,uBAAuB;oBACjC,UAAU,EAAE,IAAI;iBACnB;8EASU,IAAI;sBADV,KAAK;uBAAC,WAAW;gBAWX,SAAS;sBADf,WAAW;uBAAC,iBAAiB;gBAgBvB,QAAQ;sBADd,YAAY;uBAAC,OAAO","sourcesContent":["import {Directive, HostBinding, HostListener, Input} from '@angular/core';\nimport {Clipboard} from '@angular/cdk/clipboard';\n\n/**\n * Directive that allows to copy data to clipboard on click on debug-data\n */\n@Directive(\n{\n selector: 'debug-data[copyClick]',\n standalone: true,\n})\nexport class DebugDataCopyClickDirective\n{\n //######################### public properties - inputs #########################\n\n /**\n * Data to be copied as serialized json\n */\n @Input('copyClick')\n public data: unknown;\n\n //######################### public properties - host #########################\n\n /**\n * Adds css class clickable to this element\n * \n * @internal\n */\n @HostBinding('class.clickable')\n public clickable: boolean = true;\n\n //######################### constructor #########################\n constructor(protected _clipboard: Clipboard)\n {\n }\n\n //######################### public methods - host #########################\n\n /**\n * Copies data to clipboard on click\n * \n * @internal\n */\n @HostListener('click')\n public copyData(): void\n {\n this._clipboard.copy(JSON.stringify(this.data, null, 4));\n }\n}"]}
@@ -1,5 +1,5 @@
1
1
  import { NgModule } from '@angular/core';
2
- import { DebugDataModule } from '@anglr/common';
2
+ import { DebugDataComponent } from '@anglr/common';
3
3
  import { DebugDataCopyClickDirective } from '../directives/debugDataCopyClick/debugDataCopyClick.directive';
4
4
  import * as i0 from "@angular/core";
5
5
  /**
@@ -7,20 +7,21 @@ import * as i0 from "@angular/core";
7
7
  */
8
8
  export class DebugDataCopyClickModule {
9
9
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: DebugDataCopyClickModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
10
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.5", ngImport: i0, type: DebugDataCopyClickModule, declarations: [DebugDataCopyClickDirective], exports: [DebugDataCopyClickDirective,
11
- DebugDataModule] });
12
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: DebugDataCopyClickModule, imports: [DebugDataModule] });
10
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.5", ngImport: i0, type: DebugDataCopyClickModule, imports: [DebugDataComponent,
11
+ DebugDataCopyClickDirective], exports: [DebugDataCopyClickDirective,
12
+ DebugDataComponent] });
13
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: DebugDataCopyClickModule });
13
14
  }
14
15
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: DebugDataCopyClickModule, decorators: [{
15
16
  type: NgModule,
16
17
  args: [{
17
- imports: [],
18
- declarations: [
19
- DebugDataCopyClickDirective
18
+ imports: [
19
+ DebugDataComponent,
20
+ DebugDataCopyClickDirective,
20
21
  ],
21
22
  exports: [
22
23
  DebugDataCopyClickDirective,
23
- DebugDataModule,
24
+ DebugDataComponent,
24
25
  ]
25
26
  }]
26
27
  }] });
@@ -1 +1 @@
1
- {"version":3,"file":"debugDataCopyClick.module.js","sourceRoot":"","sources":["../../../../material/src/modules/debugDataCopyClick.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AACvC,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAC,2BAA2B,EAAC,MAAM,+DAA+D,CAAC;;AAE1G;;GAEG;AAgBH,MAAM,OAAO,wBAAwB;uGAAxB,wBAAwB;wGAAxB,wBAAwB,iBAR7B,2BAA2B,aAI3B,2BAA2B;YAC3B,eAAe;wGAGV,wBAAwB,YAH7B,eAAe;;2FAGV,wBAAwB;kBAfpC,QAAQ;mBACT;oBACI,OAAO,EACP,EACC;oBACD,YAAY,EACZ;wBACI,2BAA2B;qBAC9B;oBACD,OAAO,EACP;wBACI,2BAA2B;wBAC3B,eAAe;qBAClB;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\nimport {DebugDataModule} from '@anglr/common';\n\nimport {DebugDataCopyClickDirective} from '../directives/debugDataCopyClick/debugDataCopyClick.directive';\n\n/**\n * Module for debug data copy click directive\n */\n@NgModule(\n{\n imports:\n [\n ],\n declarations:\n [\n DebugDataCopyClickDirective\n ],\n exports:\n [\n DebugDataCopyClickDirective,\n DebugDataModule,\n ]\n})\nexport class DebugDataCopyClickModule\n{\n}\n"]}
1
+ {"version":3,"file":"debugDataCopyClick.module.js","sourceRoot":"","sources":["../../../../material/src/modules/debugDataCopyClick.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AACvC,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAC,2BAA2B,EAAC,MAAM,+DAA+D,CAAC;;AAE1G;;GAEG;AAcH,MAAM,OAAO,wBAAwB;uGAAxB,wBAAwB;wGAAxB,wBAAwB,YAT7B,kBAAkB;YAClB,2BAA2B,aAI3B,2BAA2B;YAC3B,kBAAkB;wGAGb,wBAAwB;;2FAAxB,wBAAwB;kBAbpC,QAAQ;mBACT;oBACI,OAAO,EACP;wBACI,kBAAkB;wBAClB,2BAA2B;qBAC9B;oBACD,OAAO,EACP;wBACI,2BAA2B;wBAC3B,kBAAkB;qBACrB;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\nimport {DebugDataComponent} from '@anglr/common';\n\nimport {DebugDataCopyClickDirective} from '../directives/debugDataCopyClick/debugDataCopyClick.directive';\n\n/**\n * Module for debug data copy click directive\n */\n@NgModule(\n{\n imports:\n [\n DebugDataComponent,\n DebugDataCopyClickDirective,\n ],\n exports:\n [\n DebugDataCopyClickDirective,\n DebugDataComponent,\n ]\n})\nexport class DebugDataCopyClickModule\n{\n}\n"]}
@@ -1,5 +1,6 @@
1
+ import { __decorate, __metadata } from "tslib";
1
2
  import { Directive, ElementRef, Input, Renderer2, booleanAttribute, inject } from '@angular/core';
2
- import { nameof } from '@jscrpt/common';
3
+ import { BindThis, nameof } from '@jscrpt/common';
3
4
  import { TooltipDirective } from '../../modules/tooltip';
4
5
  import * as i0 from "@angular/core";
5
6
  import * as i1 from "../../modules/tooltip/directives/tooltip/tooltip.directive";
@@ -23,7 +24,7 @@ export class EllipsisTooltipSADirective {
23
24
  /**
24
25
  * Instance of mutation observer used for watching
25
26
  */
26
- textObserver = new MutationObserver(() => this.tooltip.tooltip = this.allowHtml ? this.element.innerHTML : this.element.innerText);
27
+ textObserver = new MutationObserver(this.updateTooltip);
27
28
  /**
28
29
  * Original css class
29
30
  */
@@ -33,6 +34,14 @@ export class EllipsisTooltipSADirective {
33
34
  * Css class appliet to element
34
35
  */
35
36
  ellipsisClass = 'text-ellipsis';
37
+ /**
38
+ * Tooltip prefix text to be prepended to tooltip read from content
39
+ */
40
+ tooltipPrefix;
41
+ /**
42
+ * Tooltip suffix text to be appended to tooltip read from content
43
+ */
44
+ tooltipSuffix;
36
45
  /**
37
46
  * Indication whether are html tags allowed in tooltip text
38
47
  */
@@ -73,6 +82,10 @@ export class EllipsisTooltipSADirective {
73
82
  this.textObserver?.disconnect();
74
83
  this.textObserver?.observe(this.element, { characterData: true, subtree: true, childList: true });
75
84
  }
85
+ if (nameof('tooltipPrefix') in changes ||
86
+ nameof('tooltipSuffix') in changes) {
87
+ this.updateTooltip();
88
+ }
76
89
  }
77
90
  //######################### public methods - implementation of OnDestroy #########################
78
91
  /**
@@ -82,14 +95,31 @@ export class EllipsisTooltipSADirective {
82
95
  this.textObserver?.disconnect();
83
96
  this.textObserver = null;
84
97
  }
98
+ //######################### protected methods #########################
99
+ /**
100
+ * Updates tooltip value
101
+ */
102
+ updateTooltip() {
103
+ let text = this.allowHtml ? this.element.innerHTML : this.element.innerText;
104
+ if (text) {
105
+ text = (this.tooltipPrefix ?? '') + text + (this.tooltipSuffix ?? '');
106
+ }
107
+ this.tooltip.tooltip = text;
108
+ }
85
109
  //######################### ng language server #########################
86
110
  /**
87
111
  * Custom input type for `element` input
88
112
  */
89
113
  static ngAcceptInputType_element;
90
114
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: EllipsisTooltipSADirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
91
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.0.5", type: EllipsisTooltipSADirective, isStandalone: true, selector: "[ellipsisTooltip]", inputs: { ellipsisClass: "ellipsisClass", allowHtml: ["allowHtml", "allowHtml", booleanAttribute], element: ["ellipsisTooltip", "element"] }, usesOnChanges: true, hostDirectives: [{ directive: i1.TooltipDirective }], ngImport: i0 });
115
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.0.5", type: EllipsisTooltipSADirective, isStandalone: true, selector: "[ellipsisTooltip]", inputs: { ellipsisClass: "ellipsisClass", tooltipPrefix: "tooltipPrefix", tooltipSuffix: "tooltipSuffix", allowHtml: ["allowHtml", "allowHtml", booleanAttribute], element: ["ellipsisTooltip", "element"] }, usesOnChanges: true, hostDirectives: [{ directive: i1.TooltipDirective }], ngImport: i0 });
92
116
  }
117
+ __decorate([
118
+ BindThis,
119
+ __metadata("design:type", Function),
120
+ __metadata("design:paramtypes", []),
121
+ __metadata("design:returntype", void 0)
122
+ ], EllipsisTooltipSADirective.prototype, "updateTooltip", null);
93
123
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: EllipsisTooltipSADirective, decorators: [{
94
124
  type: Directive,
95
125
  args: [{
@@ -101,11 +131,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImpor
101
131
  }]
102
132
  }], propDecorators: { ellipsisClass: [{
103
133
  type: Input
134
+ }], tooltipPrefix: [{
135
+ type: Input
136
+ }], tooltipSuffix: [{
137
+ type: Input
104
138
  }], allowHtml: [{
105
139
  type: Input,
106
140
  args: [{ transform: booleanAttribute }]
107
141
  }], element: [{
108
142
  type: Input,
109
143
  args: ['ellipsisTooltip']
110
- }] } });
144
+ }], updateTooltip: [] } });
111
145
  //# sourceMappingURL=ellipsisTooltip.directive.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ellipsisTooltip.directive.js","sourceRoot":"","sources":["../../../../src/directives/ellipsisTooltip/ellipsisTooltip.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,KAAK,EAAwB,SAA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,OAAO;sBADjB,KAAK;uBAAC,iBAAiB","sourcesContent":["import {Directive, ElementRef, Input, OnChanges, OnDestroy, Renderer2, SimpleChanges, booleanAttribute, inject} from '@angular/core';\nimport {nameof} from '@jscrpt/common';\n\nimport {TooltipDirective} from '../../modules/tooltip';\n\n/**\n * Directive that is used for displaying text from attached element in tooltip\n */\n@Directive(\n{\n selector: '[ellipsisTooltip]',\n standalone: true,\n hostDirectives:\n [\n TooltipDirective,\n ],\n})\nexport class EllipsisTooltipSADirective implements OnChanges, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Instance of renderer\n */\n protected renderer: Renderer2 = inject(Renderer2);\n\n /**\n * Instance of tooltip directive\n */\n protected tooltip: TooltipDirective = inject(TooltipDirective);\n\n /**\n * HTML element from which is text taken for tooltip\n */\n protected elementValue: HTMLElement = inject(ElementRef).nativeElement;\n\n /**\n * Instance of mutation observer used for watching \n */\n protected textObserver: MutationObserver|undefined|null = new MutationObserver(() => this.tooltip.tooltip = this.allowHtml ? this.element.innerHTML : this.element.innerText);\n\n /**\n * Original css class\n */\n protected originalCssClass: string|undefined|null;\n\n //######################### public properties - inputs #########################\n\n /**\n * Css class appliet to element\n */\n @Input()\n public ellipsisClass: string = 'text-ellipsis';\n\n /**\n * Indication whether are html tags allowed in tooltip text\n */\n @Input({transform: booleanAttribute})\n public allowHtml: boolean = false;\n\n /**\n * Gets or sets HTML element from which is text taken for tooltip\n */\n @Input('ellipsisTooltip')\n public get element(): HTMLElement\n {\n return this.elementValue;\n }\n public set element(value: HTMLElement|ElementRef<HTMLElement>)\n {\n if(!value)\n {\n return;\n }\n\n if(value instanceof ElementRef)\n {\n this.elementValue = value.nativeElement;\n\n return;\n }\n\n this.elementValue = value;\n }\n\n //######################### public methods - implementation of OnChanges #########################\n \n /**\n * Called when input value changes\n */\n public ngOnChanges(changes: SimpleChanges): void\n {\n if(nameof<EllipsisTooltipSADirective>('allowHtml') in changes)\n {\n this.tooltip.allowHtml = this.allowHtml;\n }\n\n if(nameof<EllipsisTooltipSADirective>('element') in changes ||\n nameof<EllipsisTooltipSADirective>('ellipsisClass') in changes)\n {\n if(this.originalCssClass != this.ellipsisClass)\n {\n if(this.originalCssClass)\n {\n this.renderer.removeClass(this.element, this.originalCssClass);\n }\n \n this.renderer.addClass(this.element, this.ellipsisClass);\n this.originalCssClass = this.ellipsisClass;\n }\n\n this.textObserver?.disconnect();\n this.textObserver?.observe(this.element, {characterData: true, subtree: true, childList: true});\n }\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.textObserver?.disconnect();\n this.textObserver = null;\n }\n\n //######################### ng language server #########################\n \n /**\n * Custom input type for `element` input\n */\n public static ngAcceptInputType_element: HTMLElement|ElementRef|'';\n}"]}
1
+ {"version":3,"file":"ellipsisTooltip.directive.js","sourceRoot":"","sources":["../../../../src/directives/ellipsisTooltip/ellipsisTooltip.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,KAAK,EAAwB,SAAS,EAAiB,gBAAgB,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AACrI,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;;;AAEvD;;GAEG;AAUH,MAAM,OAAO,0BAA0B;IAEnC,sEAAsE;IAEtE;;OAEG;IACO,QAAQ,GAAc,MAAM,CAAC,SAAS,CAAC,CAAC;IAElD;;OAEG;IACO,OAAO,GAAqB,MAAM,CAAC,gBAAgB,CAAC,CAAC;IAE/D;;OAEG;IACO,YAAY,GAAgB,MAAM,CAAC,UAAU,CAAC,CAAC,aAAa,CAAC;IAEvE;;OAEG;IACO,YAAY,GAAoC,IAAI,gBAAgB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAEnG;;OAEG;IACO,gBAAgB,CAAwB;IAElD,gFAAgF;IAE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;sBADjB,KAAK;uBAAC,iBAAiB;gBA4Ed,aAAa","sourcesContent":["import {Directive, ElementRef, Input, OnChanges, OnDestroy, Renderer2, SimpleChanges, booleanAttribute, inject} from '@angular/core';\nimport {BindThis, nameof} from '@jscrpt/common';\n\nimport {TooltipDirective} from '../../modules/tooltip';\n\n/**\n * Directive that is used for displaying text from attached element in tooltip\n */\n@Directive(\n{\n selector: '[ellipsisTooltip]',\n standalone: true,\n hostDirectives:\n [\n TooltipDirective,\n ],\n})\nexport class EllipsisTooltipSADirective implements OnChanges, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Instance of renderer\n */\n protected renderer: Renderer2 = inject(Renderer2);\n\n /**\n * Instance of tooltip directive\n */\n protected tooltip: TooltipDirective = inject(TooltipDirective);\n\n /**\n * HTML element from which is text taken for tooltip\n */\n protected elementValue: HTMLElement = inject(ElementRef).nativeElement;\n\n /**\n * Instance of mutation observer used for watching \n */\n protected textObserver: MutationObserver|undefined|null = new MutationObserver(this.updateTooltip);\n\n /**\n * Original css class\n */\n protected originalCssClass: string|undefined|null;\n\n //######################### public properties - inputs #########################\n\n /**\n * Css class appliet to element\n */\n @Input()\n public ellipsisClass: string = 'text-ellipsis';\n\n /**\n * Tooltip prefix text to be prepended to tooltip read from content\n */\n @Input()\n public tooltipPrefix: string|undefined|null;\n\n /**\n * Tooltip suffix text to be appended to tooltip read from content\n */\n @Input()\n public tooltipSuffix: string|undefined|null;\n\n /**\n * Indication whether are html tags allowed in tooltip text\n */\n @Input({transform: booleanAttribute})\n public allowHtml: boolean = false;\n\n /**\n * Gets or sets HTML element from which is text taken for tooltip\n */\n @Input('ellipsisTooltip')\n public get element(): HTMLElement\n {\n return this.elementValue;\n }\n public set element(value: HTMLElement|ElementRef<HTMLElement>)\n {\n if(!value)\n {\n return;\n }\n\n if(value instanceof ElementRef)\n {\n this.elementValue = value.nativeElement;\n\n return;\n }\n\n this.elementValue = value;\n }\n\n //######################### public methods - implementation of OnChanges #########################\n \n /**\n * Called when input value changes\n */\n public ngOnChanges(changes: SimpleChanges): void\n {\n if(nameof<EllipsisTooltipSADirective>('allowHtml') in changes)\n {\n this.tooltip.allowHtml = this.allowHtml;\n }\n\n if(nameof<EllipsisTooltipSADirective>('element') in changes ||\n nameof<EllipsisTooltipSADirective>('ellipsisClass') in changes)\n {\n if(this.originalCssClass != this.ellipsisClass)\n {\n if(this.originalCssClass)\n {\n this.renderer.removeClass(this.element, this.originalCssClass);\n }\n \n this.renderer.addClass(this.element, this.ellipsisClass);\n this.originalCssClass = this.ellipsisClass;\n }\n\n this.textObserver?.disconnect();\n this.textObserver?.observe(this.element, {characterData: true, subtree: true, childList: true});\n }\n\n if(nameof<EllipsisTooltipSADirective>('tooltipPrefix') in changes ||\n nameof<EllipsisTooltipSADirective>('tooltipSuffix') in changes)\n {\n this.updateTooltip();\n }\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.textObserver?.disconnect();\n this.textObserver = null;\n }\n\n //######################### protected methods #########################\n\n /**\n * Updates tooltip value\n */\n @BindThis\n protected updateTooltip(): void\n {\n let text = this.allowHtml ? this.element.innerHTML : this.element.innerText;\n\n if(text)\n {\n text = (this.tooltipPrefix ?? '') + text + (this.tooltipSuffix ?? '');\n }\n\n this.tooltip.tooltip = text;\n }\n\n //######################### ng language server #########################\n \n /**\n * Custom input type for `element` input\n */\n public static ngAcceptInputType_element: HTMLElement|ElementRef|'';\n}"]}
@@ -1,5 +1,5 @@
1
1
  import { NgModule } from '@angular/core';
2
- import { IsNaNSAPipe, IsPresentSAPipe, UrlEncodeSAPipe, MergeCssClassesSAPipe, KeysSAPipe } from '../pipes';
2
+ import { IsNaNSAPipe, IsPresentSAPipe, UrlEncodeSAPipe, MergeCssClassesSAPipe, KeysSAPipe, TrimTextPipe } from '../pipes';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
5
  * Module for common utility stuff
@@ -10,11 +10,13 @@ export class CommonUtilsModule {
10
10
  IsPresentSAPipe,
11
11
  UrlEncodeSAPipe,
12
12
  MergeCssClassesSAPipe,
13
- KeysSAPipe], exports: [IsNaNSAPipe,
13
+ KeysSAPipe,
14
+ TrimTextPipe], exports: [IsNaNSAPipe,
14
15
  IsPresentSAPipe,
15
16
  UrlEncodeSAPipe,
16
17
  MergeCssClassesSAPipe,
17
- KeysSAPipe] });
18
+ KeysSAPipe,
19
+ TrimTextPipe] });
18
20
  static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: CommonUtilsModule });
19
21
  }
20
22
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: CommonUtilsModule, decorators: [{
@@ -26,6 +28,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImpor
26
28
  UrlEncodeSAPipe,
27
29
  MergeCssClassesSAPipe,
28
30
  KeysSAPipe,
31
+ TrimTextPipe,
29
32
  ],
30
33
  exports: [
31
34
  IsNaNSAPipe,
@@ -33,6 +36,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImpor
33
36
  UrlEncodeSAPipe,
34
37
  MergeCssClassesSAPipe,
35
38
  KeysSAPipe,
39
+ TrimTextPipe,
36
40
  ]
37
41
  }]
38
42
  }] });
@@ -1 +1 @@
1
- {"version":3,"file":"commonUtils.module.js","sourceRoot":"","sources":["../../../src/modules/commonUtils.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAC,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,qBAAqB,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;;AAE1G;;GAEG;AAoBH,MAAM,OAAO,iBAAiB;uGAAjB,iBAAiB;wGAAjB,iBAAiB,YAftB,WAAW;YACX,eAAe;YACf,eAAe;YACf,qBAAqB;YACrB,UAAU,aAIV,WAAW;YACX,eAAe;YACf,eAAe;YACf,qBAAqB;YACrB,UAAU;wGAGL,iBAAiB;;2FAAjB,iBAAiB;kBAnB7B,QAAQ;mBACT;oBACI,OAAO,EACP;wBACI,WAAW;wBACX,eAAe;wBACf,eAAe;wBACf,qBAAqB;wBACrB,UAAU;qBACb;oBACD,OAAO,EACP;wBACI,WAAW;wBACX,eAAe;wBACf,eAAe;wBACf,qBAAqB;wBACrB,UAAU;qBACb;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\n\nimport {IsNaNSAPipe, IsPresentSAPipe, UrlEncodeSAPipe, MergeCssClassesSAPipe, KeysSAPipe} from '../pipes';\n\n/**\n * Module for common utility stuff\n */\n@NgModule(\n{\n imports:\n [\n IsNaNSAPipe,\n IsPresentSAPipe,\n UrlEncodeSAPipe,\n MergeCssClassesSAPipe,\n KeysSAPipe,\n ],\n exports: \n [\n IsNaNSAPipe,\n IsPresentSAPipe,\n UrlEncodeSAPipe,\n MergeCssClassesSAPipe,\n KeysSAPipe,\n ]\n})\nexport class CommonUtilsModule\n{\n}"]}
1
+ {"version":3,"file":"commonUtils.module.js","sourceRoot":"","sources":["../../../src/modules/commonUtils.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAC,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,qBAAqB,EAAE,UAAU,EAAE,YAAY,EAAC,MAAM,UAAU,CAAC;;AAExH;;GAEG;AAsBH,MAAM,OAAO,iBAAiB;uGAAjB,iBAAiB;wGAAjB,iBAAiB,YAjBtB,WAAW;YACX,eAAe;YACf,eAAe;YACf,qBAAqB;YACrB,UAAU;YACV,YAAY,aAIZ,WAAW;YACX,eAAe;YACf,eAAe;YACf,qBAAqB;YACrB,UAAU;YACV,YAAY;wGAGP,iBAAiB;;2FAAjB,iBAAiB;kBArB7B,QAAQ;mBACT;oBACI,OAAO,EACP;wBACI,WAAW;wBACX,eAAe;wBACf,eAAe;wBACf,qBAAqB;wBACrB,UAAU;wBACV,YAAY;qBACf;oBACD,OAAO,EACP;wBACI,WAAW;wBACX,eAAe;wBACf,eAAe;wBACf,qBAAqB;wBACrB,UAAU;wBACV,YAAY;qBACf;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\n\nimport {IsNaNSAPipe, IsPresentSAPipe, UrlEncodeSAPipe, MergeCssClassesSAPipe, KeysSAPipe, TrimTextPipe} from '../pipes';\n\n/**\n * Module for common utility stuff\n */\n@NgModule(\n{\n imports:\n [\n IsNaNSAPipe,\n IsPresentSAPipe,\n UrlEncodeSAPipe,\n MergeCssClassesSAPipe,\n KeysSAPipe,\n TrimTextPipe,\n ],\n exports: \n [\n IsNaNSAPipe,\n IsPresentSAPipe,\n UrlEncodeSAPipe,\n MergeCssClassesSAPipe,\n KeysSAPipe,\n TrimTextPipe,\n ]\n})\nexport class CommonUtilsModule\n{\n}"]}
@@ -1,8 +1,7 @@
1
- import { Component, ChangeDetectionStrategy, ChangeDetectorRef, ElementRef, signal } from '@angular/core';
1
+ import { Component, ChangeDetectionStrategy, ElementRef, effect } from '@angular/core';
2
2
  import { DebugDataEnabledService } from '../../services/debugDataEnabled/debugDataEnabled.service';
3
3
  import * as i0 from "@angular/core";
4
4
  import * as i1 from "../../services/debugDataEnabled/debugDataEnabled.service";
5
- import * as i2 from "@angular/common";
6
5
  /**
7
6
  * Name of css class for enabled debug data
8
7
  */
@@ -12,64 +11,30 @@ const ENABLED = 'enabled';
12
11
  */
13
12
  export class DebugDataComponent {
14
13
  debugDataEnabledSvc;
15
- changeDetector;
16
14
  element;
17
- //######################### protected fields #########################
18
- /**
19
- * Subscription for changes of debug data enabled
20
- */
21
- debugDataEnabledChangeSubscription;
22
- //######################### protected properties - template bindings #########################
23
- /**
24
- * Indication whether is debug data enabled
25
- *
26
- * @internal
27
- */
28
- enabled = signal(false);
29
15
  //######################### constructor #########################
30
- constructor(debugDataEnabledSvc, changeDetector, element) {
16
+ constructor(debugDataEnabledSvc, element) {
31
17
  this.debugDataEnabledSvc = debugDataEnabledSvc;
32
- this.changeDetector = changeDetector;
33
18
  this.element = element;
34
- }
35
- //######################### public methods - implementation of OnInit #########################
36
- /**
37
- * Initialize component
38
- */
39
- ngOnInit() {
40
- this.enabled.set(this.debugDataEnabledSvc.enabled);
41
- this.setEnabledCssClass();
42
- this.debugDataEnabledChangeSubscription = this.debugDataEnabledSvc.enabledChange.subscribe(() => {
43
- this.enabled.set(this.debugDataEnabledSvc.enabled);
44
- this.setEnabledCssClass();
45
- this.changeDetector.detectChanges();
46
- });
47
- }
48
- //######################### public methods - implementation of OnDestroy #########################
49
- /**
50
- * Called when component is destroyed
51
- */
52
- ngOnDestroy() {
53
- this.debugDataEnabledChangeSubscription?.unsubscribe();
54
- this.debugDataEnabledChangeSubscription = null;
19
+ effect(() => this.setEnabledCssClass());
55
20
  }
56
21
  //######################### protected methods #########################
57
22
  /**
58
23
  * Sets enabled css class according enabled state
59
24
  */
60
25
  setEnabledCssClass() {
61
- if (this.enabled()) {
26
+ if (this.debugDataEnabledSvc.enabled()) {
62
27
  this.element.nativeElement.classList.add(ENABLED);
63
28
  }
64
29
  else {
65
30
  this.element.nativeElement.classList.remove(ENABLED);
66
31
  }
67
32
  }
68
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: DebugDataComponent, deps: [{ token: i1.DebugDataEnabledService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
69
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.5", type: DebugDataComponent, selector: "debug-data", ngImport: i0, template: "<ng-template [ngIf]=\"enabled()\">\r\n <ng-content></ng-content>\r\n</ng-template>", styles: [":host\r\n{\r\n font-weight: normal;\r\n font-style: italic;\r\n text-shadow: 0 0 1px;\r\n display: none;\r\n}\r\n\r\n:host(.clickable)\r\n{\r\n cursor: pointer;\r\n}\r\n\r\n:host(.enabled)\r\n{\r\n display: block;\r\n}"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
33
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: DebugDataComponent, deps: [{ token: i1.DebugDataEnabledService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
34
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.0.5", type: DebugDataComponent, isStandalone: true, selector: "debug-data", ngImport: i0, template: "@if(debugDataEnabledSvc.enabled())\r\n{\r\n <ng-content/>\r\n}", styles: [":host\r\n{\r\n font-weight: normal;\r\n font-style: italic;\r\n text-shadow: 0 0 1px;\r\n display: none;\r\n color: var(--common-debugData-foreground);\r\n}\r\n\r\n:host(.clickable)\r\n{\r\n cursor: pointer;\r\n}\r\n\r\n:host(.enabled)\r\n{\r\n display: block;\r\n}"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
70
35
  }
71
36
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: DebugDataComponent, decorators: [{
72
37
  type: Component,
73
- args: [{ selector: 'debug-data', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template [ngIf]=\"enabled()\">\r\n <ng-content></ng-content>\r\n</ng-template>", styles: [":host\r\n{\r\n font-weight: normal;\r\n font-style: italic;\r\n text-shadow: 0 0 1px;\r\n display: none;\r\n}\r\n\r\n:host(.clickable)\r\n{\r\n cursor: pointer;\r\n}\r\n\r\n:host(.enabled)\r\n{\r\n display: block;\r\n}"] }]
74
- }], ctorParameters: () => [{ type: i1.DebugDataEnabledService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }] });
38
+ args: [{ selector: 'debug-data', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if(debugDataEnabledSvc.enabled())\r\n{\r\n <ng-content/>\r\n}", styles: [":host\r\n{\r\n font-weight: normal;\r\n font-style: italic;\r\n text-shadow: 0 0 1px;\r\n display: none;\r\n color: var(--common-debugData-foreground);\r\n}\r\n\r\n:host(.clickable)\r\n{\r\n cursor: pointer;\r\n}\r\n\r\n:host(.enabled)\r\n{\r\n display: block;\r\n}"] }]
39
+ }], ctorParameters: () => [{ type: i1.DebugDataEnabledService }, { type: i0.ElementRef }] });
75
40
  //# sourceMappingURL=debugData.component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"debugData.component.js","sourceRoot":"","sources":["../../../../../../src/modules/debugData/components/debugData/debugData.component.ts","../../../../../../src/modules/debugData/components/debugData/debugData.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAqB,iBAAiB,EAAE,UAAU,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAC;AAG3I,OAAO,EAAC,uBAAuB,EAAC,MAAM,0DAA0D,CAAC;;;;AAEjG;;GAEG;AACH,MAAM,OAAO,GAAG,SAAS,CAAC;AAE1B;;GAEG;AAQH,MAAM,OAAO,kBAAkB;IAmBL;IACA;IACA;IAnBtB,sEAAsE;IAEtE;;OAEG;IACO,kCAAkC,CAA8B;IAE1E,8FAA8F;IAE9F;;;;OAIG;IACO,OAAO,GAA4B,MAAM,CAAC,KAAK,CAAC,CAAC;IAE3D,iEAAiE;IACjE,YAAsB,mBAA4C,EAC5C,cAAiC,EACjC,OAAgC;QAFhC,wBAAmB,GAAnB,mBAAmB,CAAyB;QAC5C,mBAAc,GAAd,cAAc,CAAmB;QACjC,YAAO,GAAP,OAAO,CAAyB;IAEtD,CAAC;IAED,+FAA+F;IAE/F;;OAEG;IACI,QAAQ;QAEX,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QACnD,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAE1B,IAAI,CAAC,kCAAkC,GAAG,IAAI,CAAC,mBAAmB,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,EAAE;YAE5F,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;YACnD,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAE1B,IAAI,CAAC,cAAc,CAAC,aAAa,EAAE,CAAC;QACxC,CAAC,CAAC,CAAC;IACP,CAAC;IAED,kGAAkG;IAElG;;OAEG;IACI,WAAW;QAEd,IAAI,CAAC,kCAAkC,EAAE,WAAW,EAAE,CAAC;QACvD,IAAI,CAAC,kCAAkC,GAAG,IAAI,CAAC;IACnD,CAAC;IAED,uEAAuE;IAEvE;;OAEG;IACO,kBAAkB;QAExB,IAAG,IAAI,CAAC,OAAO,EAAE,EACjB;YACI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;SACrD;aAED;YACI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;SACxD;IACL,CAAC;uGAtEQ,kBAAkB;2FAAlB,kBAAkB,kDCpB/B,uFAEc;;2FDkBD,kBAAkB;kBAP9B,SAAS;+BAEI,YAAY,mBAGL,uBAAuB,CAAC,MAAM","sourcesContent":["import {Component, ChangeDetectionStrategy, OnDestroy, OnInit, ChangeDetectorRef, ElementRef, signal, WritableSignal} from '@angular/core';\nimport {Subscription} from 'rxjs';\n\nimport {DebugDataEnabledService} from '../../services/debugDataEnabled/debugDataEnabled.service';\n\n/**\n * Name of css class for enabled debug data\n */\nconst ENABLED = 'enabled';\n\n/**\n * Component used for displaying debug data\n */\n@Component(\n{\n selector: 'debug-data',\n templateUrl: 'debugData.component.html',\n styleUrls: ['debugData.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DebugDataComponent implements OnDestroy, OnInit\n{\n //######################### protected fields #########################\n\n /**\n * Subscription for changes of debug data enabled\n */\n protected debugDataEnabledChangeSubscription: Subscription|undefined|null;\n\n //######################### protected properties - template bindings #########################\n\n /**\n * Indication whether is debug data enabled\n *\n * @internal\n */\n protected enabled: WritableSignal<boolean> = signal(false);\n\n //######################### constructor #########################\n constructor(protected debugDataEnabledSvc: DebugDataEnabledService,\n protected changeDetector: ChangeDetectorRef,\n protected element: ElementRef<HTMLElement>)\n {\n }\n\n //######################### public methods - implementation of OnInit #########################\n\n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this.enabled.set(this.debugDataEnabledSvc.enabled);\n this.setEnabledCssClass();\n\n this.debugDataEnabledChangeSubscription = this.debugDataEnabledSvc.enabledChange.subscribe(() =>\n {\n this.enabled.set(this.debugDataEnabledSvc.enabled);\n this.setEnabledCssClass();\n\n this.changeDetector.detectChanges();\n });\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.debugDataEnabledChangeSubscription?.unsubscribe();\n this.debugDataEnabledChangeSubscription = null;\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets enabled css class according enabled state\n */\n protected setEnabledCssClass(): void\n {\n if(this.enabled())\n {\n this.element.nativeElement.classList.add(ENABLED);\n }\n else\n {\n this.element.nativeElement.classList.remove(ENABLED);\n }\n }\n}","<ng-template [ngIf]=\"enabled()\">\r\n <ng-content></ng-content>\r\n</ng-template>"]}
1
+ {"version":3,"file":"debugData.component.js","sourceRoot":"","sources":["../../../../../../src/modules/debugData/components/debugData/debugData.component.ts","../../../../../../src/modules/debugData/components/debugData/debugData.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,UAAU,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AAErF,OAAO,EAAC,uBAAuB,EAAC,MAAM,0DAA0D,CAAC;;;AAEjG;;GAEG;AACH,MAAM,OAAO,GAAG,SAAS,CAAC;AAE1B;;GAEG;AASH,MAAM,OAAO,kBAAkB;IAGL;IACA;IAFtB,iEAAiE;IACjE,YAAsB,mBAA4C,EAC5C,OAAgC;QADhC,wBAAmB,GAAnB,mBAAmB,CAAyB;QAC5C,YAAO,GAAP,OAAO,CAAyB;QAElD,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED,uEAAuE;IAEvE;;OAEG;IACO,kBAAkB;QAExB,IAAG,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,EACrC;YACI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;SACrD;aAED;YACI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;SACxD;IACL,CAAC;uGAxBQ,kBAAkB;2FAAlB,kBAAkB,sECpB/B,mEAGC;;2FDiBY,kBAAkB;kBAR9B,SAAS;+BAEI,YAAY,cAGV,IAAI,mBACC,uBAAuB,CAAC,MAAM","sourcesContent":["import {Component, ChangeDetectionStrategy, ElementRef, effect} from '@angular/core';\n\nimport {DebugDataEnabledService} from '../../services/debugDataEnabled/debugDataEnabled.service';\n\n/**\n * Name of css class for enabled debug data\n */\nconst ENABLED = 'enabled';\n\n/**\n * Component used for displaying debug data\n */\n@Component(\n{\n selector: 'debug-data',\n templateUrl: 'debugData.component.html',\n styleUrl: 'debugData.component.css',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DebugDataComponent\n{\n //######################### constructor #########################\n constructor(protected debugDataEnabledSvc: DebugDataEnabledService,\n protected element: ElementRef<HTMLElement>)\n {\n effect(() => this.setEnabledCssClass());\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets enabled css class according enabled state\n */\n protected setEnabledCssClass(): void\n {\n if(this.debugDataEnabledSvc.enabled())\n {\n this.element.nativeElement.classList.add(ENABLED);\n }\n else\n {\n this.element.nativeElement.classList.remove(ENABLED);\n }\n }\n}","@if(debugDataEnabledSvc.enabled())\r\n{\r\n <ng-content/>\r\n}"]}
@@ -1,5 +1,4 @@
1
1
  import { NgModule } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
2
  import { DebugDataComponent } from '../components/debugData/debugData.component';
4
3
  import * as i0 from "@angular/core";
5
4
  /**
@@ -7,20 +6,17 @@ import * as i0 from "@angular/core";
7
6
  */
8
7
  export class DebugDataModule {
9
8
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: DebugDataModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
10
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.5", ngImport: i0, type: DebugDataModule, declarations: [DebugDataComponent], imports: [CommonModule], exports: [DebugDataComponent] });
11
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: DebugDataModule, imports: [CommonModule] });
9
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.5", ngImport: i0, type: DebugDataModule, imports: [DebugDataComponent], exports: [DebugDataComponent] });
10
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: DebugDataModule });
12
11
  }
13
12
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: DebugDataModule, decorators: [{
14
13
  type: NgModule,
15
14
  args: [{
16
15
  imports: [
17
- CommonModule
18
- ],
19
- declarations: [
20
- DebugDataComponent
16
+ DebugDataComponent,
21
17
  ],
22
18
  exports: [
23
- DebugDataComponent
19
+ DebugDataComponent,
24
20
  ]
25
21
  }]
26
22
  }] });
@@ -1 +1 @@
1
- {"version":3,"file":"debugData.module.js","sourceRoot":"","sources":["../../../../../src/modules/debugData/modules/debugData.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AACvC,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAC,kBAAkB,EAAC,MAAM,6CAA6C,CAAC;;AAE/E;;GAEG;AAgBH,MAAM,OAAO,eAAe;uGAAf,eAAe;wGAAf,eAAe,iBAPpB,kBAAkB,aAJlB,YAAY,aAQZ,kBAAkB;wGAGb,eAAe,YAXpB,YAAY;;2FAWP,eAAe;kBAf3B,QAAQ;mBACT;oBACI,OAAO,EACP;wBACI,YAAY;qBACf;oBACD,YAAY,EACZ;wBACI,kBAAkB;qBACrB;oBACD,OAAO,EACP;wBACI,kBAAkB;qBACrB;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\n\nimport {DebugDataComponent} from '../components/debugData/debugData.component';\n\n/**\n * Module that contains debug data component\n */\n@NgModule(\n{\n imports:\n [\n CommonModule\n ],\n declarations:\n [\n DebugDataComponent\n ],\n exports:\n [\n DebugDataComponent\n ]\n})\nexport class DebugDataModule\n{\n}"]}
1
+ {"version":3,"file":"debugData.module.js","sourceRoot":"","sources":["../../../../../src/modules/debugData/modules/debugData.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAC,kBAAkB,EAAC,MAAM,6CAA6C,CAAC;;AAE/E;;GAEG;AAYH,MAAM,OAAO,eAAe;uGAAf,eAAe;wGAAf,eAAe,YAPpB,kBAAkB,aAIlB,kBAAkB;wGAGb,eAAe;;2FAAf,eAAe;kBAX3B,QAAQ;mBACT;oBACI,OAAO,EACP;wBACI,kBAAkB;qBACrB;oBACD,OAAO,EACP;wBACI,kBAAkB;qBACrB;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\n\nimport {DebugDataComponent} from '../components/debugData/debugData.component';\n\n/**\n * Module that contains debug data component\n */\n@NgModule(\n{\n imports:\n [\n DebugDataComponent,\n ],\n exports:\n [\n DebugDataComponent,\n ]\n})\nexport class DebugDataModule\n{\n}"]}
@@ -1,5 +1,4 @@
1
- import { Injectable } from '@angular/core';
2
- import { Subject } from 'rxjs';
1
+ import { Injectable, signal } from '@angular/core';
3
2
  import * as i0 from "@angular/core";
4
3
  /**
5
4
  * Service used for handling enabled state for debug data component
@@ -9,23 +8,13 @@ export class DebugDataEnabledService {
9
8
  /**
10
9
  * Indication whether debug data copmonent is enabled
11
10
  */
12
- _enabled = false;
13
- /**
14
- * Subject used for emitting changes of enabled state
15
- */
16
- _enabledChangeSubject = new Subject();
11
+ _enabled = signal(false);
17
12
  //######################### public properties #########################
18
13
  /**
19
14
  * Indication whether debug data copmonent is enabled
20
15
  */
21
16
  get enabled() {
22
- return this._enabled;
23
- }
24
- /**
25
- * Occurs when enabled state changed
26
- */
27
- get enabledChange() {
28
- return this._enabledChangeSubject.asObservable();
17
+ return this._enabled.asReadonly();
29
18
  }
30
19
  //######################### public methods #########################
31
20
  /**
@@ -33,11 +22,7 @@ export class DebugDataEnabledService {
33
22
  * @param enabled - Indication whether will be enabled state set to true, or false, defaults to true
34
23
  */
35
24
  setEnabled(enabled = true) {
36
- if (this._enabled === enabled) {
37
- return;
38
- }
39
- this._enabled = enabled;
40
- this._enabledChangeSubject.next();
25
+ this._enabled.set(enabled);
41
26
  }
42
27
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: DebugDataEnabledService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
43
28
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: DebugDataEnabledService, providedIn: 'root' });