@ptsecurity/mosaic 17.2.13 → 17.2.15

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 (48) hide show
  1. package/core/forms/index.d.ts +1 -0
  2. package/core/forms/validators.d.ts +22 -0
  3. package/core/locales/index.d.ts +1 -0
  4. package/core/locales/locale-service.d.ts +62 -0
  5. package/core/locales/tk-TM.d.ts +64 -0
  6. package/core/pop-up/constants.d.ts +13 -0
  7. package/core/pop-up/pop-up-trigger.d.ts +13 -1
  8. package/core/styles/theming/_theming.scss +1 -0
  9. package/esm2022/core/forms/index.mjs +2 -1
  10. package/esm2022/core/forms/validators.mjs +33 -0
  11. package/esm2022/core/locales/index.mjs +2 -1
  12. package/esm2022/core/locales/locale-service.mjs +6 -3
  13. package/esm2022/core/locales/tk-TM.mjs +63 -0
  14. package/esm2022/core/pop-up/constants.mjs +10 -1
  15. package/esm2022/core/pop-up/pop-up-trigger.mjs +44 -3
  16. package/esm2022/core/version.mjs +2 -2
  17. package/esm2022/file-upload/file-upload.mjs +39 -2
  18. package/esm2022/file-upload/file-upload.module.mjs +8 -1
  19. package/esm2022/file-upload/multiple-file-upload.component.mjs +129 -37
  20. package/esm2022/file-upload/single-file-upload.component.mjs +124 -46
  21. package/esm2022/popover/popover.component.mjs +2 -2
  22. package/esm2022/select/select.component.mjs +7 -5
  23. package/esm2022/tooltip/tooltip.component.mjs +5 -2
  24. package/esm2022/tree-select/tree-select.component.mjs +7 -5
  25. package/fesm2022/ptsecurity-mosaic-core.mjs +152 -5
  26. package/fesm2022/ptsecurity-mosaic-core.mjs.map +1 -1
  27. package/fesm2022/ptsecurity-mosaic-file-upload.mjs +282 -72
  28. package/fesm2022/ptsecurity-mosaic-file-upload.mjs.map +1 -1
  29. package/fesm2022/ptsecurity-mosaic-popover.mjs +1 -1
  30. package/fesm2022/ptsecurity-mosaic-popover.mjs.map +1 -1
  31. package/fesm2022/ptsecurity-mosaic-select.mjs +6 -4
  32. package/fesm2022/ptsecurity-mosaic-select.mjs.map +1 -1
  33. package/fesm2022/ptsecurity-mosaic-tooltip.mjs +5 -2
  34. package/fesm2022/ptsecurity-mosaic-tooltip.mjs.map +1 -1
  35. package/fesm2022/ptsecurity-mosaic-tree-select.mjs +6 -4
  36. package/fesm2022/ptsecurity-mosaic-tree-select.mjs.map +1 -1
  37. package/file-upload/_file-upload-theme.scss +21 -11
  38. package/file-upload/file-upload.d.ts +31 -3
  39. package/file-upload/file-upload.module.d.ts +11 -10
  40. package/file-upload/file-upload.scss +8 -1
  41. package/file-upload/multiple-file-upload.component.d.ts +54 -13
  42. package/file-upload/multiple-file-upload.component.scss +0 -8
  43. package/file-upload/single-file-upload.component.d.ts +49 -14
  44. package/file-upload/single-file-upload.component.scss +0 -8
  45. package/package.json +46 -46
  46. package/prebuilt-themes/dark-theme.css +1 -1
  47. package/prebuilt-themes/default-theme.css +1 -1
  48. package/tooltip/tooltip.component.d.ts +2 -1
@@ -758,6 +758,69 @@ const ruRULocaleData = {
758
758
  }
759
759
  };
760
760
 
761
+ const tkTMLocaleData = {
762
+ 'tk-TM': {
763
+ select: { hiddenItemsText: 'ýene {{ number }}' },
764
+ datepicker: {
765
+ placeholder: 'gg.aa.ýý.'
766
+ },
767
+ timepicker: {
768
+ placeholder: {
769
+ full: 'ss:mm:seksek',
770
+ short: 'ss:mm'
771
+ }
772
+ },
773
+ formatters: {
774
+ number: {
775
+ rounding: {
776
+ separator: ' ',
777
+ groupSeparator: '',
778
+ thousand: 'M',
779
+ million: 'Mn',
780
+ billion: 'Mr',
781
+ trillion: 'Tn'
782
+ }
783
+ }
784
+ },
785
+ input: {
786
+ number: {
787
+ groupSeparator: [' '],
788
+ fractionSeparator: ','
789
+ }
790
+ },
791
+ codeBlock: {
792
+ softWrapOnTooltip: 'Sözler boýunça geçirmäni işjeňleşdirmek',
793
+ softWrapOffTooltip: 'Sözler boýunça geçirmäni öçürmek',
794
+ downloadTooltip: 'Ýüklemek',
795
+ copiedTooltip: '✓ Göçürildi',
796
+ copyTooltip: 'Göçürmek',
797
+ viewAllText: 'Hemmesini görkezmek',
798
+ viewLessText: 'Ýygyrmak',
799
+ openExternalSystemTooltip: 'Daşarky ulgamda açmak'
800
+ },
801
+ timezone: {
802
+ searchPlaceholder: 'Şäher ýa-da sagat guşagy'
803
+ },
804
+ fileUpload: {
805
+ single: {
806
+ captionText: 'Faýly geçiriň ýa-da {{ browseLink }} ',
807
+ browseLink: 'saýlaň'
808
+ },
809
+ multiple: {
810
+ captionText: 'Şu ýere geçiriň ýa-da {{ browseLink }}',
811
+ captionTextWhenSelected: 'Ýene geçiriň ýa-da {{ browseLink }}',
812
+ captionTextForCompactSize: 'Faýllary geçiriň ýa-da {{ browseLink }}',
813
+ browseLink: 'saýlaň',
814
+ title: 'Faýl ýükläň',
815
+ gridHeaders: {
816
+ file: 'Faýl',
817
+ size: 'Ölçegi'
818
+ }
819
+ }
820
+ }
821
+ }
822
+ };
823
+
761
824
  const znCNLocaleData = {
762
825
  'zh-CN': {
763
826
  select: { hiddenItemsText: '更多的' },
@@ -817,14 +880,16 @@ function MC_DEFAULT_LOCALE_DATA_FACTORY() {
817
880
  { id: 'es-LA', name: 'Español' },
818
881
  { id: 'pt-BR', name: 'Português' },
819
882
  { id: 'ru-RU', name: 'Русский' },
820
- { id: 'fa-IR', name: 'فارسی' }
883
+ { id: 'fa-IR', name: 'فارسی' },
884
+ { id: 'tk-TM', name: 'Türkmen' }
821
885
  ],
822
886
  ...ruRULocaleData,
823
887
  ...enUSLocaleData,
824
888
  ...esLALocaleData,
825
889
  ...faIRLocaleData,
826
890
  ...ptBRLocaleData,
827
- ...znCNLocaleData
891
+ ...znCNLocaleData,
892
+ ...tkTMLocaleData
828
893
  };
829
894
  }
830
895
  const MC_LOCALE_DATA = new InjectionToken('MC_LOCALE_DATA', { providedIn: 'root', factory: MC_DEFAULT_LOCALE_DATA_FACTORY });
@@ -1426,6 +1491,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImpor
1426
1491
  }]
1427
1492
  }] });
1428
1493
 
1494
+ /** Provides a set of validators for file-related form controls. */
1495
+ class FileValidators {
1496
+ /**
1497
+ * Validator that checks if the file size is less than or equal to the provided `maxSize`.
1498
+ *
1499
+ * @param maxSize - The maximum allowed file size in bytes.
1500
+ *
1501
+ * @returns A ValidatorFn function that checks the file size.
1502
+ *
1503
+ * ## Usage:
1504
+ *
1505
+ * ```typescript
1506
+ * const control = new FormControl(null, [FileValidators.maxFileSize(1024 * 1024)]); // 1MB
1507
+ * control.setValue(FILE_LESS_OR_EQUAL_THAN_1MB);
1508
+ * console.log(control.errors); // null
1509
+ * control.setValue(FILE_MORE_THAN_1MB);
1510
+ * console.log(control.errors); // {maxFileSize: { max: 1048576, actual: FILE_MORE_THAN_1MB.size }}
1511
+ * ```
1512
+ */
1513
+ static maxFileSize(maxSize) {
1514
+ return ({ value }) => {
1515
+ if (!value) {
1516
+ return null;
1517
+ }
1518
+ const size = value instanceof File ? value.size : value.file.size;
1519
+ if (size > maxSize) {
1520
+ return { maxFileSize: { max: maxSize, actual: size } };
1521
+ }
1522
+ return null;
1523
+ };
1524
+ }
1525
+ }
1526
+
1429
1527
  /**
1430
1528
  * Injection token that can be used to inject an instances of `McFormField`. It serves
1431
1529
  * as alternative token to the actual `McFormField` class which would cause unnecessary
@@ -2300,6 +2398,10 @@ function objectValues(object) {
2300
2398
  return object === null ? [] : baseValues(object, Object.keys(object));
2301
2399
  }
2302
2400
 
2401
+ /**
2402
+ * InjectionToken for providing component with popup. Used in select and tree-select for tooltip.
2403
+ */
2404
+ const MC_PARENT_POPUP = new InjectionToken('mc-parent-popup');
2303
2405
  var PopUpPlacements;
2304
2406
  (function (PopUpPlacements) {
2305
2407
  PopUpPlacements["Top"] = "top";
@@ -2336,6 +2438,10 @@ var PopUpSizes;
2336
2438
  PopUpSizes["Normal"] = "medium";
2337
2439
  PopUpSizes["Large"] = "large";
2338
2440
  })(PopUpSizes || (PopUpSizes = {}));
2441
+ /**
2442
+ * Variable used for offsetY(X) calculations when applying Angular Overlay
2443
+ */
2444
+ const arrowBottomMarginAndHalfHeight = 18;
2339
2445
 
2340
2446
  // tslint:disable-next-line:naming-convention
2341
2447
  class McPopUp {
@@ -2436,6 +2542,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImpor
2436
2542
  }] });
2437
2543
 
2438
2544
  // tslint:disable: no-unbound-method
2545
+ const getOffset = ({ originX, overlayX, originY, overlayY }, { width, height }) => {
2546
+ const offset = {};
2547
+ // tslint:disable-next-line:no-magic-numbers
2548
+ const elementWidthHalf = width / 2;
2549
+ // tslint:disable-next-line:no-magic-numbers
2550
+ const elementHeightHalf = height / 2;
2551
+ // alignment should be applied only if the element is small
2552
+ if (arrowBottomMarginAndHalfHeight > elementWidthHalf) {
2553
+ const PADDING = arrowBottomMarginAndHalfHeight - elementWidthHalf;
2554
+ if (originX === overlayX) {
2555
+ if (originX === 'start') {
2556
+ offset.offsetX = -PADDING;
2557
+ }
2558
+ if (originX === 'end') {
2559
+ offset.offsetX = PADDING;
2560
+ }
2561
+ }
2562
+ }
2563
+ // alignment should be applied only if the element is small
2564
+ if (arrowBottomMarginAndHalfHeight > elementHeightHalf) {
2565
+ const PADDING = arrowBottomMarginAndHalfHeight - elementHeightHalf;
2566
+ if (originY === overlayY) {
2567
+ if (originY === 'top') {
2568
+ offset.offsetY = -PADDING;
2569
+ }
2570
+ if (originY === 'bottom') {
2571
+ offset.offsetY = PADDING;
2572
+ }
2573
+ }
2574
+ }
2575
+ return offset;
2576
+ };
2439
2577
  // tslint:disable-next-line:naming-convention
2440
2578
  class McPopUpTrigger {
2441
2579
  constructor() {
@@ -2629,12 +2767,21 @@ class McPopUpTrigger {
2629
2767
  this.overlayRef = this.createOverlay();
2630
2768
  this.subscribeOnClosingActions();
2631
2769
  const position = this.overlayRef.getConfig().positionStrategy
2632
- .withPositions(this.getPrioritizedPositions())
2770
+ .withPositions(this.getAdjustedPositions())
2633
2771
  .withPush(true);
2634
2772
  if (reapplyPosition) {
2635
2773
  setTimeout(() => position.reapplyLastPosition());
2636
2774
  }
2637
2775
  }
2776
+ /**
2777
+ * Returns a list of positions that are aligned with the element's dimensions and offsets.
2778
+ */
2779
+ getAdjustedPositions() {
2780
+ return this.getPrioritizedPositions().map((pos) => ({
2781
+ ...pos,
2782
+ ...getOffset(pos, this.elementRef.nativeElement.getBoundingClientRect())
2783
+ }));
2784
+ }
2638
2785
  getPriorityPlacementStrategy(value) {
2639
2786
  const result = [];
2640
2787
  const possiblePositions = Object.keys(this.availablePositions);
@@ -3014,11 +3161,11 @@ const validationTooltipShowDelay = 10;
3014
3161
  const validationTooltipHideDelay = 3000;
3015
3162
  const MC_VALIDATION = new InjectionToken('McUseValidation', { factory: () => ({ useValidation: true }) });
3016
3163
 
3017
- const VERSION = new Version('17.2.13+sha-0003505');
3164
+ const VERSION = new Version('17.2.15+sha-cd26a05');
3018
3165
 
3019
3166
  /**
3020
3167
  * Generated bundle index. Do not edit.
3021
3168
  */
3022
3169
 
3023
- export { AbsoluteDateFormatterPipe, AbsoluteDateShortFormatterPipe, AbsoluteDateTimeFormatterPipe, AbsoluteShortDateTimeFormatterPipe, AnimationCurves, BOTTOM_LEFT_POSITION_PRIORITY, BOTTOM_POSITION_PRIORITY, BOTTOM_RIGHT_POSITION_PRIORITY, DateAdapter, DateFormatter, EXTENDED_OVERLAY_POSITIONS, ErrorStateMatcher, LEFT_BOTTOM_POSITION_PRIORITY, LEFT_POSITION_PRIORITY, LEFT_TOP_POSITION_PRIORITY, MC_CUSTOM_SCROLL_STRATEGY_PROVIDER, MC_DATE_FORMATS, MC_DATE_LOCALE, MC_DATE_LOCALE_FACTORY, MC_DEFAULT_LOCALE_DATA_FACTORY, MC_DEFAULT_LOCALE_ID, MC_FORM_FIELD_REF, MC_LABEL_GLOBAL_OPTIONS, MC_LOCALE_DATA, MC_LOCALE_ID, MC_LOCALE_SERVICE, MC_NUMBER_FORMATTER_DEFAULT_OPTIONS, MC_NUMBER_FORMATTER_OPTIONS, MC_OPTION_ACTION_PARENT, MC_OPTION_PARENT_COMPONENT, MC_PARENT_ANIMATION_COMPONENT, MC_SANITY_CHECKS, MC_SELECT_SCROLL_STRATEGY, MC_SELECT_SCROLL_STRATEGY_PROVIDER, MC_TITLE_TEXT_REF, MC_VALIDATION, McCommonModule, McDataSizeModule, McDataSizePipe, McDecimalPipe, McForm, McFormElement, McFormattersModule, McFormsModule, McHighlightModule, McHighlightPipe, McLine, McLineModule, McLineSetter, McLocaleService, McLocaleServiceModule, McMeasureScrollbarService, McOptgroup, McOptgroupBase, McOptgroupMixinBase, McOption, McOptionActionBase, McOptionActionComponent, McOptionActionMixinBase, McOptionBase, McOptionModule, McOptionSelectionChange, McPopUp, McPopUpTrigger, McPseudoCheckbox, McPseudoCheckboxBase, McPseudoCheckboxMixinBase, McPseudoCheckboxModule, McRoundDecimalPipe, McSelectFooter, McSelectMatcher, McSelectSearch, McSelectSearchEmptyResult, McSelectTrigger, McTableNumberPipe, McVirtualOption, MeasurementSystem, MultipleMode, NUMBER_FORMAT_REGEXP, POSITION_MAP, POSITION_PRIORITY_STRATEGY, POSITION_TO_CSS_MAP, PopUpPlacements, PopUpSizes, PopUpTriggers, PopUpVisibility, RIGHT_BOTTOM_POSITION_PRIORITY, RIGHT_POSITION_PRIORITY, RIGHT_TOP_POSITION_PRIORITY, RangeDateFormatterPipe, RangeDateTimeFormatterPipe, RangeMiddleDateTimeFormatterPipe, RangeShortDateFormatterPipe, RangeShortDateTimeFormatterPipe, RelativeDateFormatterPipe, RelativeDateTimeFormatterPipe, RelativeShortDateFormatterPipe, RelativeShortDateTimeFormatterPipe, SELECT_PANEL_INDENT_PADDING_X, SELECT_PANEL_MAX_HEIGHT, SELECT_PANEL_PADDING_X, SELECT_PANEL_VIEWPORT_PADDING, ShowOnDirtyErrorStateMatcher, TOP_LEFT_POSITION_PRIORITY, TOP_POSITION_PRIORITY, TOP_RIGHT_POSITION_PRIORITY, ThemePalette, VERSION, checkAndNormalizeLocalizedNumber, countGroupLabelsBeforeOption, enUSLocaleData, esLALocaleData, escapeRegExp, faIRLocaleData, fadeAnimation, formatDataSize, getHumanizedBytes, getMcSelectDynamicMultipleError, getMcSelectNonArrayValueError, getMcSelectNonFunctionValueError, getOptionScrollPosition, isBoolean, isWithin, mcSelectAnimations, mcSelectScrollStrategyProviderFactory, mixinColor, mixinDisabled, mixinErrorState, mixinTabIndex, normalizeNumber, ptBRLocaleData, ruRULocaleData, selectEvents, sizeUnitsConfig, toBoolean, validationTooltipHideDelay, validationTooltipShowDelay, znCNLocaleData };
3170
+ export { AbsoluteDateFormatterPipe, AbsoluteDateShortFormatterPipe, AbsoluteDateTimeFormatterPipe, AbsoluteShortDateTimeFormatterPipe, AnimationCurves, BOTTOM_LEFT_POSITION_PRIORITY, BOTTOM_POSITION_PRIORITY, BOTTOM_RIGHT_POSITION_PRIORITY, DateAdapter, DateFormatter, EXTENDED_OVERLAY_POSITIONS, ErrorStateMatcher, FileValidators, LEFT_BOTTOM_POSITION_PRIORITY, LEFT_POSITION_PRIORITY, LEFT_TOP_POSITION_PRIORITY, MC_CUSTOM_SCROLL_STRATEGY_PROVIDER, MC_DATE_FORMATS, MC_DATE_LOCALE, MC_DATE_LOCALE_FACTORY, MC_DEFAULT_LOCALE_DATA_FACTORY, MC_DEFAULT_LOCALE_ID, MC_FORM_FIELD_REF, MC_LABEL_GLOBAL_OPTIONS, MC_LOCALE_DATA, MC_LOCALE_ID, MC_LOCALE_SERVICE, MC_NUMBER_FORMATTER_DEFAULT_OPTIONS, MC_NUMBER_FORMATTER_OPTIONS, MC_OPTION_ACTION_PARENT, MC_OPTION_PARENT_COMPONENT, MC_PARENT_ANIMATION_COMPONENT, MC_PARENT_POPUP, MC_SANITY_CHECKS, MC_SELECT_SCROLL_STRATEGY, MC_SELECT_SCROLL_STRATEGY_PROVIDER, MC_TITLE_TEXT_REF, MC_VALIDATION, McCommonModule, McDataSizeModule, McDataSizePipe, McDecimalPipe, McForm, McFormElement, McFormattersModule, McFormsModule, McHighlightModule, McHighlightPipe, McLine, McLineModule, McLineSetter, McLocaleService, McLocaleServiceModule, McMeasureScrollbarService, McOptgroup, McOptgroupBase, McOptgroupMixinBase, McOption, McOptionActionBase, McOptionActionComponent, McOptionActionMixinBase, McOptionBase, McOptionModule, McOptionSelectionChange, McPopUp, McPopUpTrigger, McPseudoCheckbox, McPseudoCheckboxBase, McPseudoCheckboxMixinBase, McPseudoCheckboxModule, McRoundDecimalPipe, McSelectFooter, McSelectMatcher, McSelectSearch, McSelectSearchEmptyResult, McSelectTrigger, McTableNumberPipe, McVirtualOption, MeasurementSystem, MultipleMode, NUMBER_FORMAT_REGEXP, POSITION_MAP, POSITION_PRIORITY_STRATEGY, POSITION_TO_CSS_MAP, PopUpPlacements, PopUpSizes, PopUpTriggers, PopUpVisibility, RIGHT_BOTTOM_POSITION_PRIORITY, RIGHT_POSITION_PRIORITY, RIGHT_TOP_POSITION_PRIORITY, RangeDateFormatterPipe, RangeDateTimeFormatterPipe, RangeMiddleDateTimeFormatterPipe, RangeShortDateFormatterPipe, RangeShortDateTimeFormatterPipe, RelativeDateFormatterPipe, RelativeDateTimeFormatterPipe, RelativeShortDateFormatterPipe, RelativeShortDateTimeFormatterPipe, SELECT_PANEL_INDENT_PADDING_X, SELECT_PANEL_MAX_HEIGHT, SELECT_PANEL_PADDING_X, SELECT_PANEL_VIEWPORT_PADDING, ShowOnDirtyErrorStateMatcher, TOP_LEFT_POSITION_PRIORITY, TOP_POSITION_PRIORITY, TOP_RIGHT_POSITION_PRIORITY, ThemePalette, VERSION, arrowBottomMarginAndHalfHeight, checkAndNormalizeLocalizedNumber, countGroupLabelsBeforeOption, enUSLocaleData, esLALocaleData, escapeRegExp, faIRLocaleData, fadeAnimation, formatDataSize, getHumanizedBytes, getMcSelectDynamicMultipleError, getMcSelectNonArrayValueError, getMcSelectNonFunctionValueError, getOptionScrollPosition, isBoolean, isWithin, mcSelectAnimations, mcSelectScrollStrategyProviderFactory, mixinColor, mixinDisabled, mixinErrorState, mixinTabIndex, normalizeNumber, ptBRLocaleData, ruRULocaleData, selectEvents, sizeUnitsConfig, tkTMLocaleData, toBoolean, validationTooltipHideDelay, validationTooltipShowDelay, znCNLocaleData };
3024
3171
  //# sourceMappingURL=ptsecurity-mosaic-core.mjs.map