@ptsecurity/mosaic 15.8.10 → 15.9.0

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 (62) hide show
  1. package/checkbox/checkbox.d.ts +6 -6
  2. package/core/animation/animation.d.ts +2 -1
  3. package/core/common-behaviors/checkbox.d.ts +1 -0
  4. package/core/common-behaviors/index.d.ts +1 -0
  5. package/core/pop-up/pop-up-trigger.d.ts +13 -0
  6. package/dropdown/dropdown-trigger.directive.d.ts +1 -1
  7. package/esm2020/checkbox/checkbox.mjs +5 -5
  8. package/esm2020/core/animation/animation.mjs +2 -1
  9. package/esm2020/core/common-behaviors/checkbox.mjs +2 -0
  10. package/esm2020/core/common-behaviors/index.mjs +2 -1
  11. package/esm2020/core/locales/en-US.mjs +2 -2
  12. package/esm2020/core/locales/es-LA.mjs +2 -2
  13. package/esm2020/core/locales/fa-IR.mjs +2 -2
  14. package/esm2020/core/locales/pt-BR.mjs +2 -2
  15. package/esm2020/core/locales/ru-RU.mjs +2 -2
  16. package/esm2020/core/locales/zh-CN.mjs +2 -2
  17. package/esm2020/core/pop-up/pop-up-trigger.mjs +43 -2
  18. package/esm2020/core/version.mjs +2 -2
  19. package/esm2020/dropdown/dropdown-trigger.directive.mjs +2 -2
  20. package/esm2020/popover/popover.component.mjs +7 -2
  21. package/esm2020/select/select.component.mjs +5 -4
  22. package/esm2020/toggle/toggle.component.mjs +102 -18
  23. package/esm2020/tooltip/tooltip.component.mjs +7 -1
  24. package/esm2020/tree-select/tree-select.component.mjs +2 -2
  25. package/fesm2015/ptsecurity-mosaic-checkbox.mjs +4 -4
  26. package/fesm2015/ptsecurity-mosaic-checkbox.mjs.map +1 -1
  27. package/fesm2015/ptsecurity-mosaic-core.mjs +47 -8
  28. package/fesm2015/ptsecurity-mosaic-core.mjs.map +1 -1
  29. package/fesm2015/ptsecurity-mosaic-dropdown.mjs +1 -1
  30. package/fesm2015/ptsecurity-mosaic-dropdown.mjs.map +1 -1
  31. package/fesm2015/ptsecurity-mosaic-popover.mjs +6 -1
  32. package/fesm2015/ptsecurity-mosaic-popover.mjs.map +1 -1
  33. package/fesm2015/ptsecurity-mosaic-select.mjs +4 -3
  34. package/fesm2015/ptsecurity-mosaic-select.mjs.map +1 -1
  35. package/fesm2015/ptsecurity-mosaic-toggle.mjs +103 -17
  36. package/fesm2015/ptsecurity-mosaic-toggle.mjs.map +1 -1
  37. package/fesm2015/ptsecurity-mosaic-tooltip.mjs +6 -0
  38. package/fesm2015/ptsecurity-mosaic-tooltip.mjs.map +1 -1
  39. package/fesm2015/ptsecurity-mosaic-tree-select.mjs +1 -1
  40. package/fesm2015/ptsecurity-mosaic-tree-select.mjs.map +1 -1
  41. package/fesm2020/ptsecurity-mosaic-checkbox.mjs +4 -4
  42. package/fesm2020/ptsecurity-mosaic-checkbox.mjs.map +1 -1
  43. package/fesm2020/ptsecurity-mosaic-core.mjs +50 -8
  44. package/fesm2020/ptsecurity-mosaic-core.mjs.map +1 -1
  45. package/fesm2020/ptsecurity-mosaic-dropdown.mjs +1 -1
  46. package/fesm2020/ptsecurity-mosaic-dropdown.mjs.map +1 -1
  47. package/fesm2020/ptsecurity-mosaic-popover.mjs +6 -1
  48. package/fesm2020/ptsecurity-mosaic-popover.mjs.map +1 -1
  49. package/fesm2020/ptsecurity-mosaic-select.mjs +4 -3
  50. package/fesm2020/ptsecurity-mosaic-select.mjs.map +1 -1
  51. package/fesm2020/ptsecurity-mosaic-toggle.mjs +101 -17
  52. package/fesm2020/ptsecurity-mosaic-toggle.mjs.map +1 -1
  53. package/fesm2020/ptsecurity-mosaic-tooltip.mjs +6 -0
  54. package/fesm2020/ptsecurity-mosaic-tooltip.mjs.map +1 -1
  55. package/fesm2020/ptsecurity-mosaic-tree-select.mjs +1 -1
  56. package/fesm2020/ptsecurity-mosaic-tree-select.mjs.map +1 -1
  57. package/package.json +4 -4
  58. package/popover/popover.component.d.ts +5 -0
  59. package/toggle/_toggle-theme.scss +7 -1
  60. package/toggle/toggle.component.d.ts +22 -6
  61. package/toggle/toggle.scss +23 -0
  62. package/tooltip/tooltip.component.d.ts +5 -0
@@ -31,6 +31,7 @@ var AnimationCurves;
31
31
  AnimationCurves["DecelerationCurve"] = "cubic-bezier(0.0,0.0,0.2,1)";
32
32
  AnimationCurves["AccelerationCurve"] = "cubic-bezier(0.4,0.0,1,1)";
33
33
  AnimationCurves["SharpCurve"] = "cubic-bezier(0.4,0.0,0.6,1)";
34
+ AnimationCurves["EaseInOut"] = "ease-in-out";
34
35
  })(AnimationCurves || (AnimationCurves = {}));
35
36
 
36
37
  /**
@@ -514,7 +515,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
514
515
 
515
516
  const enUSLocaleData = {
516
517
  'en-US': {
517
- select: { hiddenItemsText: 'one more' },
518
+ select: { hiddenItemsText: '{{ number }} more' },
518
519
  datepicker: {
519
520
  placeholder: 'dd/mm/yyyy'
520
521
  },
@@ -535,7 +536,7 @@ const enUSLocaleData = {
535
536
 
536
537
  const esLALocaleData = {
537
538
  'es-LA': {
538
- select: { hiddenItemsText: 'más' },
539
+ select: { hiddenItemsText: '{{ number }} más' },
539
540
  datepicker: {
540
541
  placeholder: 'dd/mm/aaaa'
541
542
  },
@@ -562,7 +563,7 @@ const esLALocaleData = {
562
563
 
563
564
  const faIRLocaleData = {
564
565
  'fa-IR': {
565
- select: { hiddenItemsText: 'أكثر' },
566
+ select: { hiddenItemsText: '{{ number }} بیشتر' },
566
567
  datepicker: {
567
568
  placeholder: 'روز/ ماه/سال'
568
569
  },
@@ -590,7 +591,7 @@ const faIRLocaleData = {
590
591
 
591
592
  const ptBRLocaleData = {
592
593
  'pt-BR': {
593
- select: { hiddenItemsText: 'mais' },
594
+ select: { hiddenItemsText: '{{ number }} mais' },
594
595
  datepicker: {
595
596
  placeholder: 'dd/mm/yyyy'
596
597
  },
@@ -617,7 +618,7 @@ const ptBRLocaleData = {
617
618
 
618
619
  const ruRULocaleData = {
619
620
  'ru-RU': {
620
- select: { hiddenItemsText: 'еще' },
621
+ select: { hiddenItemsText: 'еще {{ number }}' },
621
622
  datepicker: {
622
623
  placeholder: 'дд.мм.гггг'
623
624
  },
@@ -701,7 +702,7 @@ const tkTMLocaleData = {
701
702
 
702
703
  const znCNLocaleData = {
703
704
  'zh-CN': {
704
- select: { hiddenItemsText: '更多的' },
705
+ select: { hiddenItemsText: '另外 {{ number }} 个' },
705
706
  datepicker: {
706
707
  placeholder: '年/月/日'
707
708
  },
@@ -2315,6 +2316,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2315
2316
  type: Directive
2316
2317
  }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
2317
2318
 
2319
+ const getOffset = ({ originX, overlayX, originY, overlayY }, { width, height }, arrowOffset) => {
2320
+ const offset = {};
2321
+ // tslint:disable-next-line:no-magic-numbers
2322
+ const elementWidthHalf = width / 2;
2323
+ // tslint:disable-next-line:no-magic-numbers
2324
+ const elementHeightHalf = height / 2;
2325
+ // alignment should be applied only if the element is small
2326
+ if (arrowOffset > elementWidthHalf) {
2327
+ const PADDING = arrowOffset - elementWidthHalf;
2328
+ if (originX === overlayX) {
2329
+ if (originX === 'start') {
2330
+ offset.offsetX = -PADDING;
2331
+ }
2332
+ if (originX === 'end') {
2333
+ offset.offsetX = PADDING;
2334
+ }
2335
+ }
2336
+ }
2337
+ // alignment should be applied only if the element is small
2338
+ if (arrowOffset > elementHeightHalf) {
2339
+ const PADDING = arrowOffset - elementHeightHalf;
2340
+ if (originY === overlayY) {
2341
+ if (originY === 'top') {
2342
+ offset.offsetY = -PADDING;
2343
+ }
2344
+ if (originY === 'bottom') {
2345
+ offset.offsetY = PADDING;
2346
+ }
2347
+ }
2348
+ }
2349
+ return offset;
2350
+ };
2318
2351
  // tslint:disable-next-line:naming-convention
2319
2352
  class McPopUpTrigger {
2320
2353
  constructor(overlay, elementRef, ngZone, scrollDispatcher, hostView, scrollStrategy, direction) {
@@ -2499,12 +2532,21 @@ class McPopUpTrigger {
2499
2532
  this.overlayRef = this.createOverlay();
2500
2533
  this.subscribeOnClosingActions();
2501
2534
  const position = this.overlayRef.getConfig().positionStrategy
2502
- .withPositions(this.getPrioritizedPositions())
2535
+ .withPositions(this.getAdjustedPositions())
2503
2536
  .withPush(true);
2504
2537
  if (reapplyPosition) {
2505
2538
  setTimeout(() => position.reapplyLastPosition());
2506
2539
  }
2507
2540
  }
2541
+ /**
2542
+ * Returns a list of positions that are aligned with the element's dimensions and offsets.
2543
+ */
2544
+ getAdjustedPositions() {
2545
+ return this.getPrioritizedPositions().map((pos) => ({
2546
+ ...pos,
2547
+ ...getOffset(pos, this.elementRef.nativeElement.getBoundingClientRect(), this.arrowOffset)
2548
+ }));
2549
+ }
2508
2550
  getPriorityPlacementStrategy(value) {
2509
2551
  const result = [];
2510
2552
  const possiblePositions = Object.keys(this.availablePositions);
@@ -2755,7 +2797,7 @@ const validationTooltipShowDelay = 10;
2755
2797
  const validationTooltipHideDelay = 3000;
2756
2798
  const MC_VALIDATION = new InjectionToken('McUseValidation', { factory: () => ({ useValidation: true }) });
2757
2799
 
2758
- const VERSION = new Version('15.8.10+sha-e38d354');
2800
+ const VERSION = new Version('15.9.0+sha-463b2be');
2759
2801
 
2760
2802
  /**
2761
2803
  * Generated bundle index. Do not edit.