@anglr/common 19.1.0-beta.20231204194607 → 19.1.0-beta.20231205075912

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 (52) hide show
  1. package/changelog.md +14 -1
  2. package/es2022/floating-ui/src/services/floatingUiDomPosition.service.js +3 -2
  3. package/es2022/floating-ui/src/services/floatingUiDomPosition.service.js.map +1 -1
  4. package/es2022/src/decorators/asSignal/asSignal.decorator.js +28 -0
  5. package/es2022/src/decorators/asSignal/asSignal.decorator.js.map +1 -0
  6. package/es2022/src/decorators/{componentDisplay.decorator.js → componentDisplay/componentDisplay.decorator.js} +1 -1
  7. package/es2022/src/decorators/componentDisplay/componentDisplay.decorator.js.map +1 -0
  8. package/es2022/src/decorators/{componentDisplayBlock.decorator.js → componentDisplayBlock/componentDisplayBlock.decorator.js} +1 -1
  9. package/es2022/src/decorators/componentDisplayBlock/componentDisplayBlock.decorator.js.map +1 -0
  10. package/es2022/src/decorators/{componentDisplayFlex.decorator.js → componentDisplayFlex/componentDisplayFlex.decorator.js} +1 -1
  11. package/es2022/src/decorators/componentDisplayFlex/componentDisplayFlex.decorator.js.map +1 -0
  12. package/es2022/src/decorators/componentHostStyle/componentHostStyle.decorator.js.map +1 -0
  13. package/es2022/src/decorators/index.js +7 -6
  14. package/es2022/src/decorators/index.js.map +1 -1
  15. package/es2022/src/decorators/{scrollableContent.decorator.js → scrollableContent/scrollableContent.decorator.js} +1 -1
  16. package/es2022/src/decorators/scrollableContent/scrollableContent.decorator.js.map +1 -0
  17. package/es2022/src/decorators/typeProvider/typeProvider.decorator.js.map +1 -0
  18. package/es2022/src/directives/ellipsisTooltip/ellipsisTooltip.directive.js +111 -0
  19. package/es2022/src/directives/ellipsisTooltip/ellipsisTooltip.directive.js.map +1 -0
  20. package/es2022/src/index.js +1 -0
  21. package/es2022/src/index.js.map +1 -1
  22. package/floating-ui/src/services/floatingUiDomPosition.service.d.ts.map +1 -1
  23. package/package.json +1 -1
  24. package/src/decorators/asSignal/asSignal.decorator.d.ts +5 -0
  25. package/src/decorators/asSignal/asSignal.decorator.d.ts.map +1 -0
  26. package/src/decorators/index.d.ts +7 -6
  27. package/src/decorators/index.d.ts.map +1 -1
  28. package/src/directives/ellipsisTooltip/ellipsisTooltip.directive.d.ts +58 -0
  29. package/src/directives/ellipsisTooltip/ellipsisTooltip.directive.d.ts.map +1 -0
  30. package/src/index.d.ts +1 -0
  31. package/src/index.d.ts.map +1 -1
  32. package/version.bak +1 -1
  33. package/es2022/src/decorators/componentDisplay.decorator.js.map +0 -1
  34. package/es2022/src/decorators/componentDisplayBlock.decorator.js.map +0 -1
  35. package/es2022/src/decorators/componentDisplayFlex.decorator.js.map +0 -1
  36. package/es2022/src/decorators/componentHostStyle.decorator.js.map +0 -1
  37. package/es2022/src/decorators/scrollableContent.decorator.js.map +0 -1
  38. package/es2022/src/decorators/typeProvider.decorator.js.map +0 -1
  39. /package/es2022/src/decorators/{componentHostStyle.decorator.js → componentHostStyle/componentHostStyle.decorator.js} +0 -0
  40. /package/es2022/src/decorators/{typeProvider.decorator.js → typeProvider/typeProvider.decorator.js} +0 -0
  41. /package/src/decorators/{componentDisplay.decorator.d.ts → componentDisplay/componentDisplay.decorator.d.ts} +0 -0
  42. /package/src/decorators/{componentDisplay.decorator.d.ts.map → componentDisplay/componentDisplay.decorator.d.ts.map} +0 -0
  43. /package/src/decorators/{componentDisplayBlock.decorator.d.ts → componentDisplayBlock/componentDisplayBlock.decorator.d.ts} +0 -0
  44. /package/src/decorators/{componentDisplayBlock.decorator.d.ts.map → componentDisplayBlock/componentDisplayBlock.decorator.d.ts.map} +0 -0
  45. /package/src/decorators/{componentDisplayFlex.decorator.d.ts → componentDisplayFlex/componentDisplayFlex.decorator.d.ts} +0 -0
  46. /package/src/decorators/{componentDisplayFlex.decorator.d.ts.map → componentDisplayFlex/componentDisplayFlex.decorator.d.ts.map} +0 -0
  47. /package/src/decorators/{componentHostStyle.decorator.d.ts → componentHostStyle/componentHostStyle.decorator.d.ts} +0 -0
  48. /package/src/decorators/{componentHostStyle.decorator.d.ts.map → componentHostStyle/componentHostStyle.decorator.d.ts.map} +0 -0
  49. /package/src/decorators/{scrollableContent.decorator.d.ts → scrollableContent/scrollableContent.decorator.d.ts} +0 -0
  50. /package/src/decorators/{scrollableContent.decorator.d.ts.map → scrollableContent/scrollableContent.decorator.d.ts.map} +0 -0
  51. /package/src/decorators/{typeProvider.decorator.d.ts → typeProvider/typeProvider.decorator.d.ts} +0 -0
  52. /package/src/decorators/{typeProvider.decorator.d.ts.map → typeProvider/typeProvider.decorator.d.ts.map} +0 -0
package/changelog.md CHANGED
@@ -1,9 +1,22 @@
1
1
  # Changelog
2
2
 
3
- ## Version 19.1.0 (2023-12-01)
3
+ ## Version 19.1.0 (2023-12-05)
4
+
5
+ ### Bug Fixes
6
+
7
+ - `fixed` overflowing 'MouseEnter' tooltip on right side of screen
4
8
 
5
9
  ### Feature
6
10
 
11
+ - new `AsSignal` property decorator, that creates backing field for this property as WritableSignal, reads and write to it
12
+ - new `EllipsisTooltipSADirective` directive, that is used for displaying text from attached element in tooltip
13
+ - **implements**
14
+ - `OnChanges`
15
+ - `OnDestroy`
16
+ - **inputs**
17
+ - `ellipsisClass` css class appliet to element
18
+ - `allowHtml` indication whether are html tags allowed in tooltip text
19
+ - `ellipsisTooltip` gets or sets HTML element from which is text taken for tooltip
7
20
  - updated `TooltipDirective` directive
8
21
  - is now `standalone`
9
22
 
@@ -120,9 +120,10 @@ let FloatingUiDomPosition = class FloatingUiDomPosition {
120
120
  }
121
121
  const floating = elements.floating;
122
122
  if (options.offset === PositionOffset[PositionOffset.MouseEnter] && options.mouseEvent) {
123
- const boundingRect = options.mouseEvent.target.getBoundingClientRect();
123
+ const targetBoundingRect = options.mouseEvent.target.getBoundingClientRect();
124
+ const floatingBoundingRect = elements.floating.getBoundingClientRect();
124
125
  return {
125
- crossAxis: options.mouseEvent.x - boundingRect.right
126
+ crossAxis: options.mouseEvent.x - targetBoundingRect.right + floatingBoundingRect.width
126
127
  };
127
128
  }
128
129
  const stringOffset = options.offset;
@@ -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;;GAEG;AACH,MAAM,cAAc,GACpB;IACI,UAAU,EAAE,KAAK;IACjB,IAAI,EAAE,KAAK;IACX,MAAM,EAAE,MAAM,CAAwB,MAAM,CAAyB;IACrE,SAAS,EAAE,iBAAiB,CAAC,QAAQ;CACxC,CAAC;AAEF;;GAEG;AAGI,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAE9B,iGAAiG;IAEjG;;OAEG;IACI,YAAY,CAAC,MAAe,EAAE,MAAe,EAAE,OAAkC;QAEpF,OAAO,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE;YAE/B,CAAC,KAAK,IAAI,EAAE;gBAER,MAAM,eAAe,GAAG,MAAM,CAAC,EAAE,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;gBAC5D,MAAM,WAAW,GAAiB,EAAE,CAAC;gBAErC,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;gBAC9C,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;gBAE5C,M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BAAiB,CAAC,OAAO;gBAC9B;oBACI,OAAO,UAAU,CAAC;iBACrB;YACD,KAAK,iBAAiB,CAAC,KAAK;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;uGAxRQ,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,CAyRjC;;2FAzRY,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} 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 fallbackAxisSideDirection: 'start',\n }));\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 boundingRect = (options.mouseEvent.target as HTMLElement).getBoundingClientRect();\n\n return {\n crossAxis: options.mouseEvent.x - boundingRect.right \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,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;;GAEG;AACH,MAAM,cAAc,GACpB;IACI,UAAU,EAAE,KAAK;IACjB,IAAI,EAAE,KAAK;IACX,MAAM,EAAE,MAAM,CAAwB,MAAM,CAAyB;IACrE,SAAS,EAAE,iBAAiB,CAAC,QAAQ;CACxC,CAAC;AAEF;;GAEG;AAGI,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAE9B,iGAAiG;IAEjG;;OAEG;IACI,YAAY,CAAC,MAAe,EAAE,MAAe,EAAE,OAAkC;QAEpF,OAAO,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE;YAE/B,CAAC,KAAK,IAAI,EAA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ACD,KAAK,iBAAiB,CAAC,MAAM;gBAC7B;oBACI,OAAO,QAAQ,CAAC;iBACnB;YACD,KAAK,iBAAiB,CAAC,WAAW;gBAClC;oBACI,OAAO,cAAc,CAAC;iBACzB;YACD,KAAK,iBAAiB,CAAC,SAAS;gBAChC;oBACI,OAAO,YAAY,CAAC;iBACvB;YACD,KAAK,iBAAiB,CAAC,IAAI;gBAC3B;oBACI,OAAO,MAAM,CAAC;iBACjB;YACD,KAAK,iBAAiB,CAAC,SAAS;gBAChC;oBACI,OAAO,YAAY,CAAC;iBACvB;YACD,KAAK,iBAAiB,CAAC,OAAO;gBAC9B;oBACI,OAAO,UAAU,CAAC;iBACrB;YACD,KAAK,iBAAiB,CAAC,KAAK;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;uGAzRQ,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,CA0RjC;;2FA1RY,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} 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 fallbackAxisSideDirection: 'start',\n }));\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"]}
@@ -0,0 +1,28 @@
1
+ import { signal } from '@angular/core';
2
+ /**
3
+ * Creates backing field for this property as WritableSignal, reads and write to it
4
+ */
5
+ export function AsSignal() {
6
+ return function (target, propertyKey) {
7
+ const backingField = Symbol(propertyKey.toString());
8
+ Object.defineProperty(target, propertyKey, {
9
+ configurable: false,
10
+ enumerable: true,
11
+ get: function () {
12
+ return this[backingField]?.();
13
+ },
14
+ set: function (value) {
15
+ if (!Object.getOwnPropertyDescriptor(this, backingField)) {
16
+ Object.defineProperty(this, backingField, {
17
+ configurable: false,
18
+ enumerable: false,
19
+ writable: true,
20
+ value: signal(undefined),
21
+ });
22
+ }
23
+ this[backingField].set(value);
24
+ }
25
+ });
26
+ };
27
+ }
28
+ //# sourceMappingURL=asSignal.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asSignal.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/asSignal/asSignal.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,MAAM,EAAC,MAAM,eAAe,CAAC;AAErD;;GAEG;AACH,MAAM,UAAU,QAAQ;IAEpB,OAAO,UAAU,MAAc,EAAE,WAA0B;QAEvD,MAAM,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEpD,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,WAAW,EACzC;YACI,YAAY,EAAE,KAAK;YACnB,UAAU,EAAE,IAAI;YAChB,GAAG,EAAE;gBAED,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC;YAClC,CAAC;YACD,GAAG,EAAE,UAAyD,KAAc;gBAExE,IAAG,CAAC,MAAM,CAAC,wBAAwB,CAAC,IAAI,EAAE,YAAY,CAAC,EACvD;oBACI,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,YAAY,EACxC;wBACI,YAAY,EAAE,KAAK;wBACnB,UAAU,EAAE,KAAK;wBACjB,QAAQ,EAAE,IAAI;wBACd,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC;qBAC3B,CAAC,CAAC;iBACN;gBAED,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YAClC,CAAC;SACJ,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC","sourcesContent":["import {WritableSignal, signal} from '@angular/core';\n\n/**\n * Creates backing field for this property as WritableSignal, reads and write to it\n */\nexport function AsSignal(): PropertyDecorator\n{\n return function (target: Object, propertyKey: string|symbol): void\n {\n const backingField = Symbol(propertyKey.toString());\n\n Object.defineProperty(target, propertyKey,\n {\n configurable: false,\n enumerable: true,\n get: function(this: {[key: symbol]: WritableSignal<unknown>})\n {\n return this[backingField]?.();\n },\n set: function(this: {[key: symbol]: WritableSignal<unknown>}, value: unknown)\n {\n if(!Object.getOwnPropertyDescriptor(this, backingField))\n {\n Object.defineProperty(this, backingField,\n {\n configurable: false,\n enumerable: false,\n writable: true,\n value: signal(undefined),\n });\n }\n\n this[backingField].set(value);\n }\n });\n };\n}"]}
@@ -1,4 +1,4 @@
1
- import { ComponentHostStyle } from './componentHostStyle.decorator';
1
+ import { ComponentHostStyle } from '../componentHostStyle/componentHostStyle.decorator';
2
2
  /**
3
3
  * Applies css display style to host of component, requires at least empty style on Component
4
4
  * @param display - Css display value
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentDisplay.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/componentDisplay/componentDisplay.decorator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,kBAAkB,EAAC,MAAM,oDAAoD,CAAC;AAEtF;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAmB;IAEhD,OAAO,kBAAkB,CAAC,YAAY,OAAO,EAAE,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import {CssDisplay} from '@jscrpt/common';\n\nimport {ComponentHostStyle} from '../componentHostStyle/componentHostStyle.decorator';\n\n/**\n * Applies css display style to host of component, requires at least empty style on Component\n * @param display - Css display value\n * \n * @experimental\n */\nexport function ComponentDisplay(display: CssDisplay): ClassDecorator\n{\n return ComponentHostStyle(`display: ${display}`);\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { ComponentDisplay } from './componentDisplay.decorator';
1
+ import { ComponentDisplay } from '../componentDisplay/componentDisplay.decorator';
2
2
  /**
3
3
  * Applies css display block style to host of component, requires at least empty style on Component
4
4
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentDisplayBlock.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/componentDisplayBlock/componentDisplayBlock.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,gDAAgD,CAAC;AAEhF;;;;GAIG;AACH,MAAM,UAAU,qBAAqB;IAEjC,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import {ComponentDisplay} from '../componentDisplay/componentDisplay.decorator';\n\n/**\n * Applies css display block style to host of component, requires at least empty style on Component\n * \n * @experimental\n */\nexport function ComponentDisplayBlock(): ClassDecorator\n{\n return ComponentDisplay('block');\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { ComponentDisplay } from './componentDisplay.decorator';
1
+ import { ComponentDisplay } from '../componentDisplay/componentDisplay.decorator';
2
2
  /**
3
3
  * Applies css display flex style to host of component, requires at least empty style on Component
4
4
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentDisplayFlex.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/componentDisplayFlex/componentDisplayFlex.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,gDAAgD,CAAC;AAEhF;;;;GAIG;AACH,MAAM,UAAU,oBAAoB;IAEhC,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC","sourcesContent":["import {ComponentDisplay} from '../componentDisplay/componentDisplay.decorator';\n\n/**\n * Applies css display flex style to host of component, requires at least empty style on Component\n * \n * @experimental\n */\nexport function ComponentDisplayFlex(): ClassDecorator\n{\n return ComponentDisplay('flex');\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentHostStyle.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/componentHostStyle/componentHostStyle.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAgC,MAAM,eAAe,CAAC;AAE/E;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IAE/C,OAAO,UAAsC,MAAiB;QAE1D,MAAM,eAAe,GAA8B,MAAa,CAAC;QAEjE,IAAG,CAAC,eAAe,CAAC,IAAI,EACxB;YACI,MAAM,IAAI,KAAK,CAAC,4CAA4C,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC;SAC/E;QAED,MAAM,MAAM,GAA6B,eAAe,CAAC,IAAgC,CAAC;QAE1F,IAAG,CAAC,MAAM,CAAC,MAAM,EACjB;YACI,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;SAClD;QAED,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,aAAa,IAAI,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,OAAO,IAAI,QAAQ,GAAG,CAAC,CAAC;QAExH,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC;AACN,CAAC","sourcesContent":["import {ViewEncapsulation, ɵComponentDef, ɵComponentType} from '@angular/core';\n\n/**\n * Applies css styles to host of component, requires at least empty style on Component\n * @param cssStyle - Css style properties to be applied\n * \n * @experimental\n */\nexport function ComponentHostStyle(cssStyle: string): ClassDecorator\n{\n return function<TFunction extends Function> (target: TFunction): TFunction|void\n {\n const targetComponent: ɵComponentType<TFunction> = target as any;\n\n if(!targetComponent.ɵcmp)\n {\n throw new Error(`Unable to apply 'ComponentHostStyle' to '${target.name}'`);\n }\n\n const cmpDef: ɵComponentDef<TFunction> = targetComponent.ɵcmp as ɵComponentDef<TFunction>;\n\n if(!cmpDef.styles)\n {\n throw new Error('Missing styles on component');\n }\n\n cmpDef.styles.push(`${cmpDef.encapsulation == ViewEncapsulation.Emulated ? '[_nghost-%COMP%]' : ':host'}{${cssStyle}}`);\n \n return target;\n };\n}\n"]}
@@ -1,7 +1,8 @@
1
- export * from './componentDisplay.decorator';
2
- export * from './componentDisplayBlock.decorator';
3
- export * from './componentDisplayFlex.decorator';
4
- export * from './componentHostStyle.decorator';
5
- export * from './scrollableContent.decorator';
6
- export * from './typeProvider.decorator';
1
+ export * from './asSignal/asSignal.decorator';
2
+ export * from './componentDisplay/componentDisplay.decorator';
3
+ export * from './componentDisplayBlock/componentDisplayBlock.decorator';
4
+ export * from './componentDisplayFlex/componentDisplayFlex.decorator';
5
+ export * from './componentHostStyle/componentHostStyle.decorator';
6
+ export * from './scrollableContent/scrollableContent.decorator';
7
+ export * from './typeProvider/typeProvider.decorator';
7
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC","sourcesContent":["export * from './componentDisplay.decorator';\nexport * from './componentDisplayBlock.decorator';\nexport * from './componentDisplayFlex.decorator';\nexport * from './componentHostStyle.decorator';\nexport * from './scrollableContent.decorator';\nexport * from './typeProvider.decorator';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,yDAAyD,CAAC;AACxE,cAAc,uDAAuD,CAAC;AACtE,cAAc,mDAAmD,CAAC;AAClE,cAAc,iDAAiD,CAAC;AAChE,cAAc,uCAAuC,CAAC","sourcesContent":["export * from './asSignal/asSignal.decorator';\nexport * from './componentDisplay/componentDisplay.decorator';\nexport * from './componentDisplayBlock/componentDisplayBlock.decorator';\nexport * from './componentDisplayFlex/componentDisplayFlex.decorator';\nexport * from './componentHostStyle/componentHostStyle.decorator';\nexport * from './scrollableContent/scrollableContent.decorator';\nexport * from './typeProvider/typeProvider.decorator';\n"]}
@@ -1,4 +1,4 @@
1
- import { ComponentHostStyle } from './componentHostStyle.decorator';
1
+ import { ComponentHostStyle } from '../componentHostStyle/componentHostStyle.decorator';
2
2
  /**
3
3
  * Applies css overflow-y scroll style to host of component, requires at least empty style on Component
4
4
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scrollableContent.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/scrollableContent/scrollableContent.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAC,MAAM,oDAAoD,CAAC;AAEtF;;;;GAIG;AACH,MAAM,UAAU,iBAAiB;IAE7B,OAAO,kBAAkB,CAAC,qBAAqB,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import {ComponentHostStyle} from '../componentHostStyle/componentHostStyle.decorator';\n\n/**\n * Applies css overflow-y scroll style to host of component, requires at least empty style on Component\n * \n * @experimental\n */\nexport function ScrollableContent(): ClassDecorator\n{\n return ComponentHostStyle('overflow-y: scroll;');\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeProvider.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/typeProvider/typeProvider.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAatC;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAmB;IAElD,MAAM,gBAAgB,GAAG,IAA6B,CAAC;IAEvD,IAAG,CAAC,gBAAgB,CAAC,UAAU,EAC/B;QACI,MAAM,IAAI,KAAK,CAAC,QAAQ,IAAI,uBAAuB,CAAC,CAAC;KACxD;IAED,OAAO,gBAAgB,CAAC,UAAU,CAAC;AACvC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,QAAkB;IAE3C,wDAAwD;IACxD,OAAO,UAAsC,MAAiB;QAE1D,MAAM,gBAAgB,GAAG,MAA+B,CAAC;QAEzD,IAAG,CAAC,gBAAgB,CAAC,UAAU,EAC/B;YACI,MAAM,CAAC,cAAc,CAAC,gBAAgB,EAAE,MAAM,CAAwB,YAAY,CAAC,EACnF;gBACI,KAAK,EAAE,QAAQ;gBACf,QAAQ,EAAE,KAAK;gBACf,UAAU,EAAE,KAAK;gBACjB,YAAY,EAAE,KAAK;aACtB,CAAC,CAAC;SACN;QAED,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC;AACN,CAAC","sourcesContent":["import {Provider, Type} from '@angular/core';\nimport {nameof} from '@jscrpt/common';\n\n/**\n * Type that contains provider\n */\ninterface ProviderDecoratedType\n{\n /**\n * Provider that is attached to type\n */\n ɵɵprovider?: Provider;\n}\n\n/**\n * Gets provider from type\n * @param type - Type that should contain provider\n */\nexport function getProviderForType(type: Type<unknown>): Provider\n{\n const typeWithProvider = type as ProviderDecoratedType;\n\n if(!typeWithProvider.ɵɵprovider)\n {\n throw new Error(`Type ${type} is without provider!`);\n }\n\n return typeWithProvider.ɵɵprovider;\n}\n\n/**\n * Attach provider to type\n * @param provider - Provider to be attached\n */\nexport function TypeProvider(provider: Provider): ClassDecorator\n{\n // eslint-disable-next-line @typescript-eslint/ban-types\n return function<TFunction extends Function> (target: TFunction): TFunction\n {\n const typeWithProvider = target as ProviderDecoratedType;\n \n if(!typeWithProvider.ɵɵprovider)\n {\n Object.defineProperty(typeWithProvider, nameof<ProviderDecoratedType>('ɵɵprovider'),\n {\n value: provider,\n writable: false,\n enumerable: false,\n configurable: false,\n });\n }\n\n return target;\n };\n}"]}
@@ -0,0 +1,111 @@
1
+ import { Directive, ElementRef, Input, Renderer2, booleanAttribute, inject } from '@angular/core';
2
+ import { nameof } from '@jscrpt/common';
3
+ import { TooltipDirective } from '../../modules/tooltip';
4
+ import * as i0 from "@angular/core";
5
+ import * as i1 from "../../modules/tooltip/directives/tooltip/tooltip.directive";
6
+ /**
7
+ * Directive that is used for displaying text from attached element in tooltip
8
+ */
9
+ export class EllipsisTooltipSADirective {
10
+ //######################### protected fields #########################
11
+ /**
12
+ * Instance of renderer
13
+ */
14
+ renderer = inject(Renderer2);
15
+ /**
16
+ * Instance of tooltip directive
17
+ */
18
+ tooltip = inject(TooltipDirective);
19
+ /**
20
+ * HTML element from which is text taken for tooltip
21
+ */
22
+ elementValue = inject(ElementRef).nativeElement;
23
+ /**
24
+ * Instance of mutation observer used for watching
25
+ */
26
+ textObserver = new MutationObserver(() => this.tooltip.tooltip = this.allowHtml ? this.element.innerHTML : this.element.innerText);
27
+ /**
28
+ * Original css class
29
+ */
30
+ originalCssClass;
31
+ //######################### public properties - inputs #########################
32
+ /**
33
+ * Css class appliet to element
34
+ */
35
+ ellipsisClass = 'text-ellipsis';
36
+ /**
37
+ * Indication whether are html tags allowed in tooltip text
38
+ */
39
+ allowHtml = false;
40
+ /**
41
+ * Gets or sets HTML element from which is text taken for tooltip
42
+ */
43
+ get element() {
44
+ return this.elementValue;
45
+ }
46
+ set element(value) {
47
+ if (!value) {
48
+ return;
49
+ }
50
+ if (value instanceof ElementRef) {
51
+ this.elementValue = value.nativeElement;
52
+ return;
53
+ }
54
+ this.elementValue = value;
55
+ }
56
+ //######################### public methods - implementation of OnChanges #########################
57
+ /**
58
+ * Called when input value changes
59
+ */
60
+ ngOnChanges(changes) {
61
+ if (nameof('allowHtml') in changes) {
62
+ this.tooltip.allowHtml = this.allowHtml;
63
+ }
64
+ if (nameof('element') in changes ||
65
+ nameof('ellipsisClass') in changes) {
66
+ if (this.originalCssClass != this.ellipsisClass) {
67
+ if (this.originalCssClass) {
68
+ this.renderer.removeClass(this.element, this.originalCssClass);
69
+ }
70
+ this.renderer.addClass(this.element, this.ellipsisClass);
71
+ this.originalCssClass = this.ellipsisClass;
72
+ }
73
+ this.textObserver?.disconnect();
74
+ this.textObserver?.observe(this.element, { characterData: true, subtree: true, childList: true });
75
+ }
76
+ }
77
+ //######################### public methods - implementation of OnDestroy #########################
78
+ /**
79
+ * Called when component is destroyed
80
+ */
81
+ ngOnDestroy() {
82
+ this.textObserver?.disconnect();
83
+ this.textObserver = null;
84
+ }
85
+ //######################### ng language server #########################
86
+ /**
87
+ * Custom input type for `element` input
88
+ */
89
+ static ngAcceptInputType_element;
90
+ 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 });
92
+ }
93
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.5", ngImport: i0, type: EllipsisTooltipSADirective, decorators: [{
94
+ type: Directive,
95
+ args: [{
96
+ selector: '[ellipsisTooltip]',
97
+ standalone: true,
98
+ hostDirectives: [
99
+ TooltipDirective,
100
+ ],
101
+ }]
102
+ }], propDecorators: { ellipsisClass: [{
103
+ type: Input
104
+ }], allowHtml: [{
105
+ type: Input,
106
+ args: [{ transform: booleanAttribute }]
107
+ }], element: [{
108
+ type: Input,
109
+ args: ['ellipsisTooltip']
110
+ }] } });
111
+ //# sourceMappingURL=ellipsisTooltip.directive.js.map
@@ -0,0 +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,SAAS,EAAiB,gBAAgB,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AACrI,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAEtC,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,GAAo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,CAAC;gBACzD,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC;aAC9C;YAED,IAAI,CAAC,YAAY,EAAE,UAAU,EAAE,CAAC;YAChC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,EAAC,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAC,CAAC,CAAC;SACnG;IACL,CAAC;IAED,kGAAkG;IAElG;;OAEG;IACI,WAAW;QAEd,IAAI,CAAC,YAAY,EAAE,UAAU,EAAE,CAAC;QAChC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC7B,CAAC;IAED,wEAAwE;IAExE;;OAEG;IACI,MAAM,CAAC,yBAAyB,CAA4B;uGAnH1D,0BAA0B;2FAA1B,0BAA0B,qIAwChB,gBAAgB;;2FAxC1B,0BAA0B;kBATtC,SAAS;mBACV;oBACI,QAAQ,EAAE,mBAAmB;oBAC7B,UAAU,EAAE,IAAI;oBAChB,cAAc,EACd;wBACI,gBAAgB;qBACnB;iBACJ;8BAoCU,aAAa;sBADnB,KAAK;gBAOC,SAAS;sBADf,KAAK;uBAAC,EAAC,SAAS,EAAE,gBAAgB,EAAC;gBAOzB,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}"]}
@@ -27,6 +27,7 @@ export { MemoryTemporaryStorage } from './services/temporaryStorage';
27
27
  export { NoStringLocalization } from './services/stringLocalization';
28
28
  export * from './directives/bodyRender/bodyRender.directive';
29
29
  export * from './directives/clickOutside/clickOutside.directive';
30
+ export * from './directives/ellipsisTooltip/ellipsisTooltip.directive';
30
31
  export * from './directives/goBack/goBack.directive';
31
32
  export * from './directives/positionTo/positionTo.directive';
32
33
  export { NgComponentOutletEx } from './directives/ngComponentOutletEx/ngComponentOutletEx.directive';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAC,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAC,iBAAiB,EAAC,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAC,eAAe,EAAC,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAC,kBAAkB,EAAC,MAAM,8DAA8D,CAAC;AAChG,OAAO,EAAC,uBAAuB,EAAC,MAAM,wEAAwE,CAAC;AAC/G,OAAO,EAAC,oBAAoB,EAAC,MAAM,oEAAoE,CAAC;AAExG,OAAO,EAAC,wBAAwB,EAAC,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAC,iBAAiB,EAAC,MAAM,kDAAkD,CAAC;AACnF,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,OAAO,EAAC,aAAa,EAAC,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAC,iBAAiB,EAAC,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAmB,sBAAsB,EAAC,MAAM,6BAA6B,CAAC;AACrF,OAAO,EAAC,sBAAsB,EAAmB,MAAM,6BAA6B,CAAC;AACrF,OAAO,EAAC,oBAAoB,EAAqB,MAAM,+BAA+B,CAAC;AACvF,cAAc,8CAA8C,CAAC;AAC7D,cAAc,kDAAkD,CAAC;AACjE,cAAc,sCAAsC,CAAC;AACrD,cAAc,8CAA8C,CAAC;AAC7D,OAAO,EAAC,mBAAmB,EAAC,MAAM,gEAAgE,CAAC;AACnG,OAAO,EAAC,UAAU,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,gBAAgB,EAAC,MAAM,SAAS,CAAC;AACnG,OAAO,EAAC,qBAAqB,EAAE,2BAA2B,EAAE,YAAY,EAAE,oBAAoB,EAAiB,oBAAoB,EAAuF,MAAM,0BAA0B,CAAC;AAC3P,cAAc,qBAAqB,CAAC;AAEpC,sBAAsB;AACtB,0BAA0B","sourcesContent":["export {GlobalizationService} from './services/globalization/globalization.service';\nexport {CommonDynamicModule} from './modules/commonDynamic.module';\nexport {CommonLocalizeModule} from './modules/commonLocalize.module';\nexport {CommonUtilsModule} from './modules/commonUtils.module';\nexport {DebugDataModule} from './modules/debugData/modules/debugData.module';\nexport {DebugDataComponent} from './modules/debugData/components/debugData/debugData.component';\nexport {DebugDataEnabledService} from './modules/debugData/services/debugDataEnabled/debugDataEnabled.service';\nexport {MultiButtonComponent} from './modules/multiButton/components/multiButton/multiButton.component';\nexport {MultiButtonCssClasses} from './modules/multiButton/components/multiButton/multiButton.interface';\nexport {MULTI_BUTTON_CSS_CLASSES} from './modules/multiButton/misc/tokens';\nexport {MultiButtonModule} from './modules/multiButton/modules/multiButton.module';\nexport * from './components';\nexport * from './decorators';\nexport * from './modules/castPipes';\nexport * from './modules/progressIndicator';\nexport * from './modules/logger';\nexport * from './modules/tooltip';\nexport * from './pipes';\nexport * from './types/host';\nexport * from './types/styles';\nexport * from './types/tokens';\nexport * from './types/providers';\nexport * from './utils';\nexport {CookieService} from './services/cookies/cookies.service';\nexport {StatusCodeService} from './services/statusCode/statusCode.service';\nexport {PermanentStorage, CookiePermanentStorage} from './services/permanentStorage';\nexport {MemoryTemporaryStorage, TemporaryStorage} from './services/temporaryStorage';\nexport {NoStringLocalization, StringLocalization} from './services/stringLocalization';\nexport * from './directives/bodyRender/bodyRender.directive';\nexport * from './directives/clickOutside/clickOutside.directive';\nexport * from './directives/goBack/goBack.directive';\nexport * from './directives/positionTo/positionTo.directive';\nexport {NgComponentOutletEx} from './directives/ngComponentOutletEx/ngComponentOutletEx.directive';\nexport {APP_STABLE, extractAppStableResolve, runWhenModuleStable, runWhenAppStable} from './utils';\nexport {DEFAULT_NOTIFICATIONS, DefaultNotificationsService, Notification, NotificationSeverity, Notifications, NotificationsOptions, NotificationsProvider, NotificationsScopeProvider, NotificationsScopeProviderFactory} from './services/notifications';\nexport * from './services/position';\n\n//TODO: any to unknown\n//TODO: strict null checks"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAC,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAC,iBAAiB,EAAC,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAC,eAAe,EAAC,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAC,kBAAkB,EAAC,MAAM,8DAA8D,CAAC;AAChG,OAAO,EAAC,uBAAuB,EAAC,MAAM,wEAAwE,CAAC;AAC/G,OAAO,EAAC,oBAAoB,EAAC,MAAM,oEAAoE,CAAC;AAExG,OAAO,EAAC,wBAAwB,EAAC,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAC,iBAAiB,EAAC,MAAM,kDAAkD,CAAC;AACnF,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,OAAO,EAAC,aAAa,EAAC,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAC,iBAAiB,EAAC,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAmB,sBAAsB,EAAC,MAAM,6BAA6B,CAAC;AACrF,OAAO,EAAC,sBAAsB,EAAmB,MAAM,6BAA6B,CAAC;AACrF,OAAO,EAAC,oBAAoB,EAAqB,MAAM,+BAA+B,CAAC;AACvF,cAAc,8CAA8C,CAAC;AAC7D,cAAc,kDAAkD,CAAC;AACjE,cAAc,wDAAwD,CAAC;AACvE,cAAc,sCAAsC,CAAC;AACrD,cAAc,8CAA8C,CAAC;AAC7D,OAAO,EAAC,mBAAmB,EAAC,MAAM,gEAAgE,CAAC;AACnG,OAAO,EAAC,UAAU,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,gBAAgB,EAAC,MAAM,SAAS,CAAC;AACnG,OAAO,EAAC,qBAAqB,EAAE,2BAA2B,EAAE,YAAY,EAAE,oBAAoB,EAAiB,oBAAoB,EAAuF,MAAM,0BAA0B,CAAC;AAC3P,cAAc,qBAAqB,CAAC;AAEpC,sBAAsB;AACtB,0BAA0B","sourcesContent":["export {GlobalizationService} from './services/globalization/globalization.service';\nexport {CommonDynamicModule} from './modules/commonDynamic.module';\nexport {CommonLocalizeModule} from './modules/commonLocalize.module';\nexport {CommonUtilsModule} from './modules/commonUtils.module';\nexport {DebugDataModule} from './modules/debugData/modules/debugData.module';\nexport {DebugDataComponent} from './modules/debugData/components/debugData/debugData.component';\nexport {DebugDataEnabledService} from './modules/debugData/services/debugDataEnabled/debugDataEnabled.service';\nexport {MultiButtonComponent} from './modules/multiButton/components/multiButton/multiButton.component';\nexport {MultiButtonCssClasses} from './modules/multiButton/components/multiButton/multiButton.interface';\nexport {MULTI_BUTTON_CSS_CLASSES} from './modules/multiButton/misc/tokens';\nexport {MultiButtonModule} from './modules/multiButton/modules/multiButton.module';\nexport * from './components';\nexport * from './decorators';\nexport * from './modules/castPipes';\nexport * from './modules/progressIndicator';\nexport * from './modules/logger';\nexport * from './modules/tooltip';\nexport * from './pipes';\nexport * from './types/host';\nexport * from './types/styles';\nexport * from './types/tokens';\nexport * from './types/providers';\nexport * from './utils';\nexport {CookieService} from './services/cookies/cookies.service';\nexport {StatusCodeService} from './services/statusCode/statusCode.service';\nexport {PermanentStorage, CookiePermanentStorage} from './services/permanentStorage';\nexport {MemoryTemporaryStorage, TemporaryStorage} from './services/temporaryStorage';\nexport {NoStringLocalization, StringLocalization} from './services/stringLocalization';\nexport * from './directives/bodyRender/bodyRender.directive';\nexport * from './directives/clickOutside/clickOutside.directive';\nexport * from './directives/ellipsisTooltip/ellipsisTooltip.directive';\nexport * from './directives/goBack/goBack.directive';\nexport * from './directives/positionTo/positionTo.directive';\nexport {NgComponentOutletEx} from './directives/ngComponentOutletEx/ngComponentOutletEx.directive';\nexport {APP_STABLE, extractAppStableResolve, runWhenModuleStable, runWhenAppStable} from './utils';\nexport {DEFAULT_NOTIFICATIONS, DefaultNotificationsService, Notification, NotificationSeverity, Notifications, NotificationsOptions, NotificationsProvider, NotificationsScopeProvider, NotificationsScopeProviderFactory} from './services/notifications';\nexport * from './services/position';\n\n//TODO: any to unknown\n//TODO: strict null checks"]}
@@ -1 +1 @@
1
- {"version":3,"file":"floatingUiDomPosition.service.d.ts","sourceRoot":"","sources":["floatingUiDomPosition.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAsH,MAAM,eAAe,CAAC;AAE7L,OAAO,EAAkB,SAAS,EAAc,UAAU,EAAe,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAAC,UAAU,EAAC,MAAM,MAAM,CAAC;;AAahC;;GAEG;AACH,qBAEa,qBAAsB,YAAW,QAAQ;IAIlD;;OAEG;IACI,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC,cAAc,CAAC;IAmFrH;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IAW7E;;;;OAIG;IACH,SAAS,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IA+G/E;;;OAGG;IACH,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS;yCAlOnD,qBAAqB;6CAArB,qBAAqB;CAyRjC"}
1
+ {"version":3,"file":"floatingUiDomPosition.service.d.ts","sourceRoot":"","sources":["floatingUiDomPosition.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAsH,MAAM,eAAe,CAAC;AAE7L,OAAO,EAAkB,SAAS,EAAc,UAAU,EAAe,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAAC,UAAU,EAAC,MAAM,MAAM,CAAC;;AAahC;;GAEG;AACH,qBAEa,qBAAsB,YAAW,QAAQ;IAIlD;;OAEG;IACI,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC,cAAc,CAAC;IAmFrH;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IAW7E;;;;OAIG;IACH,SAAS,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IAgH/E;;;OAGG;IACH,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS;yCAnOnD,qBAAqB;6CAArB,qBAAqB;CA0RjC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anglr/common",
3
- "version": "19.1.0-beta.20231204194607",
3
+ "version": "19.1.0-beta.20231205075912",
4
4
  "description": "Angular module for common angular stuff",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Creates backing field for this property as WritableSignal, reads and write to it
3
+ */
4
+ export declare function AsSignal(): PropertyDecorator;
5
+ //# sourceMappingURL=asSignal.decorator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asSignal.decorator.d.ts","sourceRoot":"","sources":["asSignal.decorator.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,QAAQ,IAAI,iBAAiB,CA+B5C"}
@@ -1,7 +1,8 @@
1
- export * from './componentDisplay.decorator';
2
- export * from './componentDisplayBlock.decorator';
3
- export * from './componentDisplayFlex.decorator';
4
- export * from './componentHostStyle.decorator';
5
- export * from './scrollableContent.decorator';
6
- export * from './typeProvider.decorator';
1
+ export * from './asSignal/asSignal.decorator';
2
+ export * from './componentDisplay/componentDisplay.decorator';
3
+ export * from './componentDisplayBlock/componentDisplayBlock.decorator';
4
+ export * from './componentDisplayFlex/componentDisplayFlex.decorator';
5
+ export * from './componentHostStyle/componentHostStyle.decorator';
6
+ export * from './scrollableContent/scrollableContent.decorator';
7
+ export * from './typeProvider/typeProvider.decorator';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,yDAAyD,CAAC;AACxE,cAAc,uDAAuD,CAAC;AACtE,cAAc,mDAAmD,CAAC;AAClE,cAAc,iDAAiD,CAAC;AAChE,cAAc,uCAAuC,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { ElementRef, OnChanges, OnDestroy, Renderer2, SimpleChanges } from '@angular/core';
2
+ import { TooltipDirective } from '../../modules/tooltip';
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "../../modules/tooltip/directives/tooltip/tooltip.directive";
5
+ /**
6
+ * Directive that is used for displaying text from attached element in tooltip
7
+ */
8
+ export declare class EllipsisTooltipSADirective implements OnChanges, OnDestroy {
9
+ /**
10
+ * Instance of renderer
11
+ */
12
+ protected renderer: Renderer2;
13
+ /**
14
+ * Instance of tooltip directive
15
+ */
16
+ protected tooltip: TooltipDirective;
17
+ /**
18
+ * HTML element from which is text taken for tooltip
19
+ */
20
+ protected elementValue: HTMLElement;
21
+ /**
22
+ * Instance of mutation observer used for watching
23
+ */
24
+ protected textObserver: MutationObserver | undefined | null;
25
+ /**
26
+ * Original css class
27
+ */
28
+ protected originalCssClass: string | undefined | null;
29
+ /**
30
+ * Css class appliet to element
31
+ */
32
+ ellipsisClass: string;
33
+ /**
34
+ * Indication whether are html tags allowed in tooltip text
35
+ */
36
+ allowHtml: boolean;
37
+ /**
38
+ * Gets or sets HTML element from which is text taken for tooltip
39
+ */
40
+ get element(): HTMLElement;
41
+ set element(value: HTMLElement | ElementRef<HTMLElement>);
42
+ /**
43
+ * Called when input value changes
44
+ */
45
+ ngOnChanges(changes: SimpleChanges): void;
46
+ /**
47
+ * Called when component is destroyed
48
+ */
49
+ ngOnDestroy(): void;
50
+ /**
51
+ * Custom input type for `element` input
52
+ */
53
+ static ngAcceptInputType_element: HTMLElement | ElementRef | '';
54
+ static ɵfac: i0.ɵɵFactoryDeclaration<EllipsisTooltipSADirective, never>;
55
+ static ɵdir: i0.ɵɵDirectiveDeclaration<EllipsisTooltipSADirective, "[ellipsisTooltip]", never, { "ellipsisClass": { "alias": "ellipsisClass"; "required": false; }; "allowHtml": { "alias": "allowHtml"; "required": false; }; "element": { "alias": "ellipsisTooltip"; "required": false; }; }, {}, never, never, true, [{ directive: typeof i1.TooltipDirective; inputs: {}; outputs: {}; }]>;
56
+ static ngAcceptInputType_allowHtml: unknown;
57
+ }
58
+ //# sourceMappingURL=ellipsisTooltip.directive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ellipsisTooltip.directive.d.ts","sourceRoot":"","sources":["ellipsisTooltip.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,UAAU,EAAS,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAA2B,MAAM,eAAe,CAAC;AAGrI,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;;;AAEvD;;GAEG;AACH,qBASa,0BAA2B,YAAW,SAAS,EAAE,SAAS;IAInE;;OAEG;IACH,SAAS,CAAC,QAAQ,EAAE,SAAS,CAAqB;IAElD;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,gBAAgB,CAA4B;IAE/D;;OAEG;IACH,SAAS,CAAC,YAAY,EAAE,WAAW,CAAoC;IAEvE;;OAEG;IACH,SAAS,CAAC,YAAY,EAAE,gBAAgB,GAAC,SAAS,GAAC,IAAI,CAAuH;IAE9K;;OAEG;IACH,SAAS,CAAC,gBAAgB,EAAE,MAAM,GAAC,SAAS,GAAC,IAAI,CAAC;IAIlD;;OAEG;IAEI,aAAa,EAAE,MAAM,CAAmB;IAE/C;;OAEG;IAEI,SAAS,EAAE,OAAO,CAAS;IAElC;;OAEG;IACH,IACW,OAAO,IAAI,WAAW,CAGhC;IACD,IAAW,OAAO,CAAC,KAAK,EAAE,WAAW,GAAC,UAAU,CAAC,WAAW,CAAC,EAe5D;IAID;;OAEG;IACI,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IA4BhD;;OAEG;IACI,WAAW,IAAI,IAAI;IAQ1B;;OAEG;IACH,OAAc,yBAAyB,EAAE,WAAW,GAAC,UAAU,GAAC,EAAE,CAAC;yCAnH1D,0BAA0B;2CAA1B,0BAA0B;wCAoH04vB,OAAQ;CAAx7vB"}
package/src/index.d.ts CHANGED
@@ -28,6 +28,7 @@ export { MemoryTemporaryStorage, TemporaryStorage } from './services/temporarySt
28
28
  export { NoStringLocalization, StringLocalization } from './services/stringLocalization';
29
29
  export * from './directives/bodyRender/bodyRender.directive';
30
30
  export * from './directives/clickOutside/clickOutside.directive';
31
+ export * from './directives/ellipsisTooltip/ellipsisTooltip.directive';
31
32
  export * from './directives/goBack/goBack.directive';
32
33
  export * from './directives/positionTo/positionTo.directive';
33
34
  export { NgComponentOutletEx } from './directives/ngComponentOutletEx/ngComponentOutletEx.directive';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAC,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAC,iBAAiB,EAAC,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAC,eAAe,EAAC,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAC,kBAAkB,EAAC,MAAM,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6BAA6B,CAAC;AACrF,OAAO,EAAC,sBAAsB,EAAE,gBAAgB,EAAC,MAAM,6BAA6B,CAAC;AACrF,OAAO,EAAC,oBAAoB,EAAE,kBAAkB,EAAC,MAAM,+BAA+B,CAAC;AACvF,cAAc,8CAA8C,CAAC;AAC7D,cAAc,kDAAkD,CAAC;AACjE,cAAc,wDAAwD,CAAC;AACvE,cAAc,sCAAsC,CAAC;AACrD,cAAc,8CAA8C,CAAC;AAC7D,OAAO,EAAC,mBAAmB,EAAC,MAAM,gEAAgE,CAAC;AACnG,OAAO,EAAC,UAAU,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,gBAAgB,EAAC,MAAM,SAAS,CAAC;AACnG,OAAO,EAAC,qBAAqB,EAAE,2BAA2B,EAAE,YAAY,EAAE,oBAAoB,EAAE,aAAa,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,iCAAiC,EAAC,MAAM,0BAA0B,CAAC;AAC3P,cAAc,qBAAqB,CAAC"}
package/version.bak CHANGED
@@ -1 +1 @@
1
- 19.1.0-beta.20231204194607
1
+ 19.1.0-beta.20231205075912
@@ -1 +0,0 @@
1
- {"version":3,"file":"componentDisplay.decorator.js","sourceRoot":"","sources":["../../../src/decorators/componentDisplay.decorator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;AAElE;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAmB;IAEhD,OAAO,kBAAkB,CAAC,YAAY,OAAO,EAAE,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import {CssDisplay} from '@jscrpt/common';\n\nimport {ComponentHostStyle} from './componentHostStyle.decorator';\n\n/**\n * Applies css display style to host of component, requires at least empty style on Component\n * @param display - Css display value\n * \n * @experimental\n */\nexport function ComponentDisplay(display: CssDisplay): ClassDecorator\n{\n return ComponentHostStyle(`display: ${display}`);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"componentDisplayBlock.decorator.js","sourceRoot":"","sources":["../../../src/decorators/componentDisplayBlock.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAE9D;;;;GAIG;AACH,MAAM,UAAU,qBAAqB;IAEjC,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import {ComponentDisplay} from './componentDisplay.decorator';\n\n/**\n * Applies css display block style to host of component, requires at least empty style on Component\n * \n * @experimental\n */\nexport function ComponentDisplayBlock(): ClassDecorator\n{\n return ComponentDisplay('block');\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"componentDisplayFlex.decorator.js","sourceRoot":"","sources":["../../../src/decorators/componentDisplayFlex.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAE9D;;;;GAIG;AACH,MAAM,UAAU,oBAAoB;IAEhC,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC","sourcesContent":["import {ComponentDisplay} from './componentDisplay.decorator';\n\n/**\n * Applies css display flex style to host of component, requires at least empty style on Component\n * \n * @experimental\n */\nexport function ComponentDisplayFlex(): ClassDecorator\n{\n return ComponentDisplay('flex');\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"componentHostStyle.decorator.js","sourceRoot":"","sources":["../../../src/decorators/componentHostStyle.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAgC,MAAM,eAAe,CAAC;AAE/E;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IAE/C,OAAO,UAAsC,MAAiB;QAE1D,MAAM,eAAe,GAA8B,MAAa,CAAC;QAEjE,IAAG,CAAC,eAAe,CAAC,IAAI,EACxB;YACI,MAAM,IAAI,KAAK,CAAC,4CAA4C,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC;SAC/E;QAED,MAAM,MAAM,GAA6B,eAAe,CAAC,IAAgC,CAAC;QAE1F,IAAG,CAAC,MAAM,CAAC,MAAM,EACjB;YACI,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;SAClD;QAED,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,aAAa,IAAI,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,OAAO,IAAI,QAAQ,GAAG,CAAC,CAAC;QAExH,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC;AACN,CAAC","sourcesContent":["import {ViewEncapsulation, ɵComponentDef, ɵComponentType} from '@angular/core';\n\n/**\n * Applies css styles to host of component, requires at least empty style on Component\n * @param cssStyle - Css style properties to be applied\n * \n * @experimental\n */\nexport function ComponentHostStyle(cssStyle: string): ClassDecorator\n{\n return function<TFunction extends Function> (target: TFunction): TFunction|void\n {\n const targetComponent: ɵComponentType<TFunction> = target as any;\n\n if(!targetComponent.ɵcmp)\n {\n throw new Error(`Unable to apply 'ComponentHostStyle' to '${target.name}'`);\n }\n\n const cmpDef: ɵComponentDef<TFunction> = targetComponent.ɵcmp as ɵComponentDef<TFunction>;\n\n if(!cmpDef.styles)\n {\n throw new Error('Missing styles on component');\n }\n\n cmpDef.styles.push(`${cmpDef.encapsulation == ViewEncapsulation.Emulated ? '[_nghost-%COMP%]' : ':host'}{${cssStyle}}`);\n \n return target;\n };\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"scrollableContent.decorator.js","sourceRoot":"","sources":["../../../src/decorators/scrollableContent.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;AAElE;;;;GAIG;AACH,MAAM,UAAU,iBAAiB;IAE7B,OAAO,kBAAkB,CAAC,qBAAqB,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import {ComponentHostStyle} from './componentHostStyle.decorator';\n\n/**\n * Applies css overflow-y scroll style to host of component, requires at least empty style on Component\n * \n * @experimental\n */\nexport function ScrollableContent(): ClassDecorator\n{\n return ComponentHostStyle('overflow-y: scroll;');\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"typeProvider.decorator.js","sourceRoot":"","sources":["../../../src/decorators/typeProvider.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAatC;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAmB;IAElD,MAAM,gBAAgB,GAAG,IAA6B,CAAC;IAEvD,IAAG,CAAC,gBAAgB,CAAC,UAAU,EAC/B;QACI,MAAM,IAAI,KAAK,CAAC,QAAQ,IAAI,uBAAuB,CAAC,CAAC;KACxD;IAED,OAAO,gBAAgB,CAAC,UAAU,CAAC;AACvC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,QAAkB;IAE3C,wDAAwD;IACxD,OAAO,UAAsC,MAAiB;QAE1D,MAAM,gBAAgB,GAAG,MAA+B,CAAC;QAEzD,IAAG,CAAC,gBAAgB,CAAC,UAAU,EAC/B;YACI,MAAM,CAAC,cAAc,CAAC,gBAAgB,EAAE,MAAM,CAAwB,YAAY,CAAC,EACnF;gBACI,KAAK,EAAE,QAAQ;gBACf,QAAQ,EAAE,KAAK;gBACf,UAAU,EAAE,KAAK;gBACjB,YAAY,EAAE,KAAK;aACtB,CAAC,CAAC;SACN;QAED,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC;AACN,CAAC","sourcesContent":["import {Provider, Type} from '@angular/core';\nimport {nameof} from '@jscrpt/common';\n\n/**\n * Type that contains provider\n */\ninterface ProviderDecoratedType\n{\n /**\n * Provider that is attached to type\n */\n ɵɵprovider?: Provider;\n}\n\n/**\n * Gets provider from type\n * @param type - Type that should contain provider\n */\nexport function getProviderForType(type: Type<unknown>): Provider\n{\n const typeWithProvider = type as ProviderDecoratedType;\n\n if(!typeWithProvider.ɵɵprovider)\n {\n throw new Error(`Type ${type} is without provider!`);\n }\n\n return typeWithProvider.ɵɵprovider;\n}\n\n/**\n * Attach provider to type\n * @param provider - Provider to be attached\n */\nexport function TypeProvider(provider: Provider): ClassDecorator\n{\n // eslint-disable-next-line @typescript-eslint/ban-types\n return function<TFunction extends Function> (target: TFunction): TFunction\n {\n const typeWithProvider = target as ProviderDecoratedType;\n \n if(!typeWithProvider.ɵɵprovider)\n {\n Object.defineProperty(typeWithProvider, nameof<ProviderDecoratedType>('ɵɵprovider'),\n {\n value: provider,\n writable: false,\n enumerable: false,\n configurable: false,\n });\n }\n\n return target;\n };\n}"]}