@ptsecurity/mosaic 14.6.1 → 14.7.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 (212) hide show
  1. package/_theming.scss +3790 -2072
  2. package/_visual.scss +341 -0
  3. package/button/button.component.d.ts +2 -0
  4. package/card/card.component.d.ts +2 -0
  5. package/checkbox/checkbox.d.ts +1 -0
  6. package/code-block/README.md +32 -0
  7. package/code-block/actionbar.component.d.ts +22 -0
  8. package/code-block/code-block.component.d.ts +74 -0
  9. package/code-block/code-block.module.d.ts +14 -0
  10. package/code-block/code-block.types.d.ts +17 -0
  11. package/code-block/index.d.ts +1 -0
  12. package/code-block/public-api.d.ts +3 -0
  13. package/core/formatters/date/formatter.d.ts +55 -1
  14. package/core/option/action.d.ts +2 -0
  15. package/core/selection/pseudo-checkbox/pseudo-checkbox.d.ts +1 -0
  16. package/datepicker/calendar-body.component.d.ts +3 -11
  17. package/datepicker/calendar-header.component.d.ts +45 -0
  18. package/datepicker/calendar.component.d.ts +10 -81
  19. package/datepicker/datepicker-input.directive.d.ts +3 -3
  20. package/datepicker/datepicker-module.d.ts +8 -8
  21. package/datepicker/datepicker.component.d.ts +2 -12
  22. package/datepicker/month-view.component.d.ts +7 -26
  23. package/datepicker/public-api.d.ts +1 -2
  24. package/design-tokens/legacy-2017/tokens/components/code-block.json5 +704 -0
  25. package/design-tokens/legacy-2017/tokens.d.ts +341 -0
  26. package/design-tokens/pt-2022/tokens/components/code-block.json5 +697 -0
  27. package/design-tokens/pt-2022/tokens.d.ts +341 -0
  28. package/design-tokens/style-dictionary/configs/index.js +6 -8
  29. package/dropdown/dropdown-item.component.d.ts +1 -0
  30. package/esm2020/button/button.component.mjs +3 -3
  31. package/esm2020/card/card.component.mjs +3 -3
  32. package/esm2020/checkbox/checkbox.mjs +2 -2
  33. package/esm2020/code-block/actionbar.component.mjs +67 -0
  34. package/esm2020/code-block/code-block.component.mjs +157 -0
  35. package/esm2020/code-block/code-block.module.mjs +60 -0
  36. package/esm2020/code-block/code-block.types.mjs +2 -0
  37. package/esm2020/code-block/index.mjs +2 -0
  38. package/esm2020/code-block/ptsecurity-mosaic-code-block.mjs +5 -0
  39. package/esm2020/code-block/public-api.mjs +4 -0
  40. package/esm2020/core/formatters/date/formatter.mjs +77 -1
  41. package/esm2020/core/formatters/date/templates/en-US.mjs +56 -1
  42. package/esm2020/core/formatters/date/templates/ru-RU.mjs +92 -1
  43. package/esm2020/core/option/action.mjs +3 -2
  44. package/esm2020/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +2 -2
  45. package/esm2020/core/version.mjs +2 -2
  46. package/esm2020/datepicker/calendar-body.component.mjs +9 -28
  47. package/esm2020/datepicker/calendar-header.component.mjs +135 -0
  48. package/esm2020/datepicker/calendar.component.mjs +25 -212
  49. package/esm2020/datepicker/datepicker-input.directive.mjs +54 -54
  50. package/esm2020/datepicker/datepicker-module.mjs +13 -17
  51. package/esm2020/datepicker/datepicker.component.mjs +10 -21
  52. package/esm2020/datepicker/month-view.component.mjs +32 -131
  53. package/esm2020/datepicker/public-api.mjs +2 -3
  54. package/esm2020/design-tokens/legacy-2017/tokens.mjs +342 -1
  55. package/esm2020/design-tokens/pt-2022/tokens.mjs +342 -1
  56. package/esm2020/dropdown/dropdown-item.component.mjs +2 -2
  57. package/esm2020/form-field/form-field.mjs +3 -2
  58. package/esm2020/form-field/hint.mjs +3 -2
  59. package/esm2020/icon/icon.component.mjs +3 -2
  60. package/esm2020/input/input-number-validators.mjs +3 -7
  61. package/esm2020/input/input.mjs +3 -2
  62. package/esm2020/link/link.component.mjs +3 -2
  63. package/esm2020/list/list-selection.component.mjs +3 -2
  64. package/esm2020/modal/modal.component.mjs +4 -3
  65. package/esm2020/progress-bar/progress-bar.component.mjs +3 -2
  66. package/esm2020/progress-spinner/progress-spinner.component.mjs +3 -2
  67. package/esm2020/radio/radio.component.mjs +3 -4
  68. package/esm2020/select/select.component.mjs +18 -6
  69. package/esm2020/select/select.module.mjs +6 -2
  70. package/esm2020/tabs/tab-group.component.mjs +2 -2
  71. package/esm2020/tabs/tab-label-wrapper.directive.mjs +2 -2
  72. package/esm2020/tabs/tab-nav-bar/tab-nav-bar.mjs +3 -2
  73. package/esm2020/tabs/tab.component.mjs +3 -2
  74. package/esm2020/tags/tag-list.component.mjs +3 -2
  75. package/esm2020/tags/tag.component.mjs +3 -2
  76. package/esm2020/textarea/textarea.component.mjs +3 -2
  77. package/esm2020/timezone/timezone-select.component.mjs +2 -2
  78. package/esm2020/toggle/toggle.component.mjs +3 -2
  79. package/esm2020/tree/control/flat-tree-control.mjs +1 -1
  80. package/esm2020/tree/toggle.mjs +3 -2
  81. package/esm2020/tree/tree-base.mjs +1 -1
  82. package/esm2020/tree-select/tree-select.component.mjs +3 -2
  83. package/fesm2015/ptsecurity-mosaic-button.mjs +2 -2
  84. package/fesm2015/ptsecurity-mosaic-button.mjs.map +1 -1
  85. package/fesm2015/ptsecurity-mosaic-card.mjs +2 -2
  86. package/fesm2015/ptsecurity-mosaic-card.mjs.map +1 -1
  87. package/fesm2015/ptsecurity-mosaic-checkbox.mjs +1 -1
  88. package/fesm2015/ptsecurity-mosaic-checkbox.mjs.map +1 -1
  89. package/fesm2015/ptsecurity-mosaic-code-block.mjs +280 -0
  90. package/fesm2015/ptsecurity-mosaic-code-block.mjs.map +1 -0
  91. package/fesm2015/ptsecurity-mosaic-core.mjs +226 -3
  92. package/fesm2015/ptsecurity-mosaic-core.mjs.map +1 -1
  93. package/fesm2015/ptsecurity-mosaic-datepicker.mjs +272 -906
  94. package/fesm2015/ptsecurity-mosaic-datepicker.mjs.map +1 -1
  95. package/fesm2015/ptsecurity-mosaic-design-tokens.mjs +1024 -1
  96. package/fesm2015/ptsecurity-mosaic-design-tokens.mjs.map +1 -1
  97. package/fesm2015/ptsecurity-mosaic-dropdown.mjs +1 -1
  98. package/fesm2015/ptsecurity-mosaic-dropdown.mjs.map +1 -1
  99. package/fesm2015/ptsecurity-mosaic-form-field.mjs +4 -2
  100. package/fesm2015/ptsecurity-mosaic-form-field.mjs.map +1 -1
  101. package/fesm2015/ptsecurity-mosaic-icon.mjs +2 -1
  102. package/fesm2015/ptsecurity-mosaic-icon.mjs.map +1 -1
  103. package/fesm2015/ptsecurity-mosaic-input.mjs +4 -7
  104. package/fesm2015/ptsecurity-mosaic-input.mjs.map +1 -1
  105. package/fesm2015/ptsecurity-mosaic-link.mjs +2 -1
  106. package/fesm2015/ptsecurity-mosaic-link.mjs.map +1 -1
  107. package/fesm2015/ptsecurity-mosaic-list.mjs +2 -1
  108. package/fesm2015/ptsecurity-mosaic-list.mjs.map +1 -1
  109. package/fesm2015/ptsecurity-mosaic-modal.mjs +3 -2
  110. package/fesm2015/ptsecurity-mosaic-modal.mjs.map +1 -1
  111. package/fesm2015/ptsecurity-mosaic-progress-bar.mjs +2 -1
  112. package/fesm2015/ptsecurity-mosaic-progress-bar.mjs.map +1 -1
  113. package/fesm2015/ptsecurity-mosaic-progress-spinner.mjs +2 -1
  114. package/fesm2015/ptsecurity-mosaic-progress-spinner.mjs.map +1 -1
  115. package/fesm2015/ptsecurity-mosaic-radio.mjs +2 -3
  116. package/fesm2015/ptsecurity-mosaic-radio.mjs.map +1 -1
  117. package/fesm2015/ptsecurity-mosaic-select.mjs +22 -6
  118. package/fesm2015/ptsecurity-mosaic-select.mjs.map +1 -1
  119. package/fesm2015/ptsecurity-mosaic-tabs.mjs +6 -4
  120. package/fesm2015/ptsecurity-mosaic-tabs.mjs.map +1 -1
  121. package/fesm2015/ptsecurity-mosaic-tags.mjs +4 -2
  122. package/fesm2015/ptsecurity-mosaic-tags.mjs.map +1 -1
  123. package/fesm2015/ptsecurity-mosaic-textarea.mjs +2 -1
  124. package/fesm2015/ptsecurity-mosaic-textarea.mjs.map +1 -1
  125. package/fesm2015/ptsecurity-mosaic-timezone.mjs +2 -2
  126. package/fesm2015/ptsecurity-mosaic-timezone.mjs.map +1 -1
  127. package/fesm2015/ptsecurity-mosaic-toggle.mjs +2 -1
  128. package/fesm2015/ptsecurity-mosaic-toggle.mjs.map +1 -1
  129. package/fesm2015/ptsecurity-mosaic-tree-select.mjs +2 -1
  130. package/fesm2015/ptsecurity-mosaic-tree-select.mjs.map +1 -1
  131. package/fesm2015/ptsecurity-mosaic-tree.mjs +2 -1
  132. package/fesm2015/ptsecurity-mosaic-tree.mjs.map +1 -1
  133. package/fesm2020/ptsecurity-mosaic-button.mjs +2 -2
  134. package/fesm2020/ptsecurity-mosaic-button.mjs.map +1 -1
  135. package/fesm2020/ptsecurity-mosaic-card.mjs +2 -2
  136. package/fesm2020/ptsecurity-mosaic-card.mjs.map +1 -1
  137. package/fesm2020/ptsecurity-mosaic-checkbox.mjs +1 -1
  138. package/fesm2020/ptsecurity-mosaic-checkbox.mjs.map +1 -1
  139. package/fesm2020/ptsecurity-mosaic-code-block.mjs +278 -0
  140. package/fesm2020/ptsecurity-mosaic-code-block.mjs.map +1 -0
  141. package/fesm2020/ptsecurity-mosaic-core.mjs +226 -3
  142. package/fesm2020/ptsecurity-mosaic-core.mjs.map +1 -1
  143. package/fesm2020/ptsecurity-mosaic-datepicker.mjs +270 -901
  144. package/fesm2020/ptsecurity-mosaic-datepicker.mjs.map +1 -1
  145. package/fesm2020/ptsecurity-mosaic-design-tokens.mjs +1024 -1
  146. package/fesm2020/ptsecurity-mosaic-design-tokens.mjs.map +1 -1
  147. package/fesm2020/ptsecurity-mosaic-dropdown.mjs +1 -1
  148. package/fesm2020/ptsecurity-mosaic-dropdown.mjs.map +1 -1
  149. package/fesm2020/ptsecurity-mosaic-form-field.mjs +4 -2
  150. package/fesm2020/ptsecurity-mosaic-form-field.mjs.map +1 -1
  151. package/fesm2020/ptsecurity-mosaic-icon.mjs +2 -1
  152. package/fesm2020/ptsecurity-mosaic-icon.mjs.map +1 -1
  153. package/fesm2020/ptsecurity-mosaic-input.mjs +4 -7
  154. package/fesm2020/ptsecurity-mosaic-input.mjs.map +1 -1
  155. package/fesm2020/ptsecurity-mosaic-link.mjs +2 -1
  156. package/fesm2020/ptsecurity-mosaic-link.mjs.map +1 -1
  157. package/fesm2020/ptsecurity-mosaic-list.mjs +2 -1
  158. package/fesm2020/ptsecurity-mosaic-list.mjs.map +1 -1
  159. package/fesm2020/ptsecurity-mosaic-modal.mjs +3 -2
  160. package/fesm2020/ptsecurity-mosaic-modal.mjs.map +1 -1
  161. package/fesm2020/ptsecurity-mosaic-progress-bar.mjs +2 -1
  162. package/fesm2020/ptsecurity-mosaic-progress-bar.mjs.map +1 -1
  163. package/fesm2020/ptsecurity-mosaic-progress-spinner.mjs +2 -1
  164. package/fesm2020/ptsecurity-mosaic-progress-spinner.mjs.map +1 -1
  165. package/fesm2020/ptsecurity-mosaic-radio.mjs +2 -3
  166. package/fesm2020/ptsecurity-mosaic-radio.mjs.map +1 -1
  167. package/fesm2020/ptsecurity-mosaic-select.mjs +22 -6
  168. package/fesm2020/ptsecurity-mosaic-select.mjs.map +1 -1
  169. package/fesm2020/ptsecurity-mosaic-tabs.mjs +6 -4
  170. package/fesm2020/ptsecurity-mosaic-tabs.mjs.map +1 -1
  171. package/fesm2020/ptsecurity-mosaic-tags.mjs +4 -2
  172. package/fesm2020/ptsecurity-mosaic-tags.mjs.map +1 -1
  173. package/fesm2020/ptsecurity-mosaic-textarea.mjs +2 -1
  174. package/fesm2020/ptsecurity-mosaic-textarea.mjs.map +1 -1
  175. package/fesm2020/ptsecurity-mosaic-timezone.mjs +2 -2
  176. package/fesm2020/ptsecurity-mosaic-timezone.mjs.map +1 -1
  177. package/fesm2020/ptsecurity-mosaic-toggle.mjs +2 -1
  178. package/fesm2020/ptsecurity-mosaic-toggle.mjs.map +1 -1
  179. package/fesm2020/ptsecurity-mosaic-tree-select.mjs +2 -1
  180. package/fesm2020/ptsecurity-mosaic-tree-select.mjs.map +1 -1
  181. package/fesm2020/ptsecurity-mosaic-tree.mjs +2 -1
  182. package/fesm2020/ptsecurity-mosaic-tree.mjs.map +1 -1
  183. package/form-field/form-field.d.ts +2 -0
  184. package/form-field/hint.d.ts +2 -0
  185. package/icon/icon.component.d.ts +2 -0
  186. package/input/input-number-validators.d.ts +2 -6
  187. package/input/input.d.ts +2 -0
  188. package/link/link.component.d.ts +2 -0
  189. package/list/list-selection.component.d.ts +2 -0
  190. package/package.json +12 -4
  191. package/prebuilt-themes/dark-theme.css +1 -1
  192. package/prebuilt-themes/default-theme.css +1 -1
  193. package/progress-bar/progress-bar.component.d.ts +2 -0
  194. package/progress-spinner/progress-spinner.component.d.ts +2 -0
  195. package/radio/radio.component.d.ts +2 -0
  196. package/select/select.component.d.ts +9 -2
  197. package/select/select.module.d.ts +1 -1
  198. package/tabs/tab-group.component.d.ts +1 -0
  199. package/tabs/tab-label-wrapper.directive.d.ts +1 -0
  200. package/tabs/tab-nav-bar/tab-nav-bar.d.ts +2 -0
  201. package/tabs/tab.component.d.ts +2 -0
  202. package/tags/tag-list.component.d.ts +2 -0
  203. package/tags/tag.component.d.ts +2 -0
  204. package/textarea/textarea.component.d.ts +2 -0
  205. package/toggle/toggle.component.d.ts +2 -0
  206. package/tree/control/flat-tree-control.d.ts +4 -4
  207. package/tree/toggle.d.ts +2 -0
  208. package/tree-select/tree-select.component.d.ts +2 -0
  209. package/datepicker/multi-year-view.component.d.ts +0 -72
  210. package/datepicker/year-view.component.d.ts +0 -90
  211. package/esm2020/datepicker/multi-year-view.component.mjs +0 -218
  212. package/esm2020/datepicker/year-view.component.mjs +0 -253
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ptsecurity-mosaic-code-block.mjs","sources":["../../../packages/mosaic/code-block/actionbar.component.ts","../../../packages/mosaic/code-block/actionbar.component.html","../../../packages/mosaic/code-block/code-block.component.ts","../../../packages/mosaic/code-block/code-block.component.html","../../../packages/mosaic/code-block/code-block.module.ts","../../../packages/mosaic/code-block/ptsecurity-mosaic-code-block.ts"],"sourcesContent":["import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport { McTooltipTrigger } from '@ptsecurity/mosaic/tooltip';\nimport { filter } from 'rxjs/operators';\n\nimport {\n McCodeBlockConfiguration,\n McCodeFile\n} from './code-block.types';\n\n\n@Component({\n selector: 'mc-actionbar-block',\n templateUrl: './actionbar.component.html',\n styleUrls: ['./actionbar.component.scss'],\n host: {\n class: 'mc-code-block-actionbar',\n '[class.mc-code-block-actionbar_less-contrast]': 'lessContrast'\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class McActionBarComponent implements AfterViewInit {\n @ViewChild('copyTooltip') copyTooltip: McTooltipTrigger;\n\n @Input() config: McCodeBlockConfiguration;\n @Input() codeFiles: McCodeFile[];\n @Input() lessContrast: boolean;\n @Input() selectedTabIndex = 0;\n @Input() multiLine: boolean;\n @Input() softWrap: boolean;\n\n @Output() toggleSoftWrap = new EventEmitter<void>();\n @Output() downloadCode = new EventEmitter<void>();\n @Output() copyCode = new EventEmitter<void>();\n @Output() openExternalSystem = new EventEmitter<void>();\n\n copyTooltipText: string;\n\n ngAfterViewInit(): void {\n this.copyTooltipText = this.config.copyTooltip;\n\n this.copyTooltip.visibleChange\n .pipe(filter((state) => !state))\n .subscribe(() => {\n if (this.copyTooltipText === this.config.copiedTooltip) {\n this.copyTooltipText = this.config.copyTooltip;\n }\n });\n }\n\n onCopy() {\n this.copyCode.emit();\n\n setTimeout(() => {\n this.copyTooltipText = this.config.copiedTooltip;\n this.copyTooltip.show();\n });\n }\n}\n","<button mc-button\n class=\"mc-icon-button mc-button_transparent\"\n *ngIf=\"multiLine\"\n [mcTooltip]=\"softWrap ? config.softWrapOffTooltip : config.softWrapOnTooltip\"\n (click)=\"toggleSoftWrap.emit()\">\n <i *ngIf=\"!softWrap\" mc-icon=\"mc-word-wrap_16\"></i>\n <i *ngIf=\"softWrap\" mc-icon=\"mc-word-wrap-slash_16\"></i>\n</button>\n\n<button mc-button\n class=\"mc-button_transparent\"\n [mcTooltip]=\"config.downloadTooltip\"\n (click)=\"downloadCode.emit()\">\n <i mc-icon=\"mc-download_16\"></i>\n</button>\n\n<button mc-button\n class=\"mc-button_transparent\"\n #copyTooltip=\"mcTooltip\"\n [mcTooltip]=\"copyTooltipText\"\n (click)=\"onCopy()\">\n <i mc-icon=\"mc-copy-o_16\"></i>\n</button>\n\n<button mc-button\n class=\"mc-button_transparent\"\n *ngIf=\"codeFiles[selectedTabIndex].link\"\n [mcTooltip]=\"config.openExternalSystemTooltip\"\n (click)=\"openExternalSystem.emit()\">\n <i mc-icon=\"mc-external-link_16\"></i>\n</button>\n","import { Clipboard } from '@angular/cdk/clipboard';\nimport {\n Component,\n ViewEncapsulation,\n Input,\n Inject,\n InjectionToken,\n ChangeDetectionStrategy,\n Optional,\n ElementRef,\n ChangeDetectorRef,\n OnDestroy,\n ViewChild,\n Renderer2\n} from '@angular/core';\nimport { McTabChangeEvent, McTabGroup } from '@ptsecurity/mosaic/tabs';\nimport { Subject, Subscription } from 'rxjs';\nimport { debounceTime } from 'rxjs/operators';\n\nimport {\n McCodeBlockConfiguration,\n McCodeFile\n} from './code-block.types';\n\n\nexport const COPIED_MESSAGE_TOOLTIP_TIMEOUT = 100;\nexport const DEFAULT_EXTENSION = 'txt';\nexport const LANGUAGES_EXTENSIONS = {\n html: 'html',\n css: 'css',\n php: 'php',\n java: 'java',\n bash: 'sh',\n javascript: 'js',\n typescript: 'ts',\n python: 'py',\n ruby: 'rb',\n c: 'c',\n 'c++': 'cpp',\n 'c#': 'cs',\n csharp: 'cs',\n lua: 'lua',\n xml: 'xml',\n json: 'json'\n};\n\nexport const MC_CODE_BLOCK_CONFIGURATION = new InjectionToken<any>('McCodeBlockConfiguration');\n\nexport const MC_CODE_BLOCK_DEFAULT_CONFIGURATION = {\n softWrapOnTooltip: 'Включить перенос по словам',\n softWrapOffTooltip: 'Выключить перенос по словам',\n downloadTooltip: 'Скачать',\n copiedTooltip: '✓ Скопировано',\n copyTooltip: 'Скопировать',\n viewAllText: 'Показать все',\n viewLessText: 'Свернуть',\n openExternalSystemTooltip: 'Открыть во внешней системе'\n};\n\n\nconst actionBarBlockLeftMargin = 24;\n\n@Component({\n selector: 'mc-code-block',\n exportAs: 'mcCodeBlock',\n templateUrl: './code-block.component.html',\n styleUrls: ['./code-block.scss'],\n host: {\n class: 'mc-code-block',\n '[class.mc-code-block_less-contrast]': 'lessContrast',\n '[class.mc-code-block_hide-line-numbers]': '!lineNumbers',\n '[class.mc-code-block_single-file]': 'singleFile',\n '[class.mc-code-block_no-header]': 'noHeader',\n '(window:resize)': 'resizeStream.next($event)'\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class McCodeBlockComponent implements OnDestroy {\n\n @ViewChild(McTabGroup) tabGroup: McTabGroup;\n\n @Input() lineNumbers = true;\n @Input() codeFiles: McCodeFile[];\n @Input() lessContrast: boolean;\n @Input() maxHeight: number;\n @Input() softWrap: boolean = false;\n\n get noHeader(): any {\n return this.codeFiles.length === 1 && !this.codeFiles[0].filename;\n }\n\n get singleFile(): boolean {\n return this.codeFiles.length === 1;\n }\n\n selectedTabIndex = 0;\n copied: boolean = false;\n viewAll: boolean = false;\n multiLine: boolean = false;\n\n readonly resizeStream = new Subject<Event>();\n\n private readonly resizeDebounceInterval: number = 100;\n private resizeSubscription = Subscription.EMPTY;\n\n constructor(\n private elementRef: ElementRef,\n private changeDetectorRef: ChangeDetectorRef,\n private clipboard: Clipboard,\n private renderer: Renderer2,\n @Optional() @Inject(MC_CODE_BLOCK_CONFIGURATION) public config: McCodeBlockConfiguration\n ) {\n this.config = config || MC_CODE_BLOCK_DEFAULT_CONFIGURATION;\n\n this.resizeSubscription = this.resizeStream\n .pipe(debounceTime(this.resizeDebounceInterval))\n .subscribe(this.updateHeader);\n }\n\n ngOnDestroy(): void {\n this.resizeSubscription.unsubscribe();\n }\n\n updateHeader = () => {\n const clientWidth: number = this.elementRef.nativeElement.querySelector('mc-actionbar-block').clientWidth;\n\n this.renderer.setStyle(\n this.tabGroup.tabHeader.elementRef.nativeElement,\n 'margin-right',\n `${actionBarBlockLeftMargin + clientWidth}px`\n );\n\n this.changeDetectorRef.markForCheck();\n }\n\n toggleSoftWrap() {\n this.softWrap = !this.softWrap;\n }\n\n toggleViewAll() {\n this.viewAll = !this.viewAll;\n }\n\n downloadCode() {\n const codeFile = this.codeFiles[this.selectedTabIndex];\n const blob = new Blob([codeFile.content], { type: 'text/plain' });\n const url = window.URL.createObjectURL(blob);\n const link = document.createElement('a');\n\n link.setAttribute('href', url);\n link.setAttribute('download', `${this.getFullFileName(codeFile)}`);\n link.click();\n }\n\n copyCode() {\n this.clipboard.copy(this.codeFiles[this.selectedTabIndex].content);\n this.copied = true;\n }\n\n openExternalSystem() {\n const externalLink = this.codeFiles[this.selectedTabIndex].link;\n window.open(externalLink, '_blank');\n }\n\n onHighlighted() {\n setTimeout(this.updateMultiline, 1);\n }\n\n getMaxHeight(): string {\n return this.maxHeight > 0 && !this.viewAll ? `${this.maxHeight}px` : 'none';\n }\n\n onSelectTab($event: McTabChangeEvent) {\n this.selectedTabIndex = $event.index;\n this.updateMultiline();\n\n setTimeout(this.updateHeader);\n }\n\n private updateMultiline = () => {\n this.multiLine = this.elementRef.nativeElement\n .querySelectorAll('.hljs-ln-numbers').length > 1;\n\n this.updateHeader();\n\n this.changeDetectorRef.markForCheck();\n }\n\n private getFullFileName(codeFile: McCodeFile): string {\n const fileName = codeFile.filename || 'code';\n const extension = LANGUAGES_EXTENSIONS[codeFile.language] || DEFAULT_EXTENSION;\n\n return `${fileName}.${extension}`;\n }\n}\n","<mc-tab-group (selectedTabChange)=\"onSelectTab($event)\">\n <mc-tab\n *ngFor=\"let codeFile of codeFiles; let i = index\"\n [disabled]=\"singleFile\">\n\n <ng-template mc-tab-label>{{ codeFile.filename }}</ng-template>\n\n <pre class=\"mc-code-block__code mc-scrollbar\"\n #codeContent\n [style.max-height]=\"getMaxHeight()\"\n [class.mc-code-block__code_soft-wrap]=\"softWrap\"\n [class.mc-code-block__code_view-all]=\"viewAll\"\n ><code class=\"hljs\"\n [id]=\"codeFile.filename + '_' + i\"\n [class.hljs-line-numbers]=\"lineNumbers\"\n [highlight]=\"codeFiles[i].content\"\n [lineNumbers]=\"true\"\n (highlighted)=\"onHighlighted()\">\n </code><mc-actionbar-block\n [class.mc-actionbar-block_floating]=\"noHeader\"\n [config]=\"config\"\n [codeFiles]=\"codeFiles\"\n [selectedTabIndex]=\"selectedTabIndex\"\n [lessContrast]=\"lessContrast\"\n [multiLine]=\"multiLine\"\n [softWrap]=\"softWrap\"\n (toggleSoftWrap)=\"toggleSoftWrap()\"\n (downloadCode)=\"downloadCode()\"\n (copyCode)=\"copyCode()\"\n (openExternalSystem)=\"openExternalSystem()\">\n </mc-actionbar-block></pre>\n\n <button\n class=\"mc-button_transparent mc-code-block__show-more\"\n mc-button\n *ngIf=\"viewAll || codeContent.offsetHeight < codeContent.scrollHeight\"\n (click)=\"toggleViewAll()\">\n\n {{ viewAll ? config.viewLessText : config.viewAllText}}\n <i class=\"mc mc-angle-down-S_16\" *ngIf=\"!viewAll\"></i>\n <i class=\"mc mc-angle-up-S_16\" *ngIf=\"viewAll\"></i>\n </button>\n </mc-tab>\n</mc-tab-group>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { McButtonModule } from '@ptsecurity/mosaic/button';\nimport { McIconModule } from '@ptsecurity/mosaic/icon';\nimport { McTabsModule } from '@ptsecurity/mosaic/tabs';\nimport { McToolTipModule } from '@ptsecurity/mosaic/tooltip';\nimport { HIGHLIGHT_OPTIONS, HighlightModule } from 'ngx-highlightjs';\n\nimport { McActionBarComponent } from './actionbar.component';\nimport { McCodeBlockComponent } from './code-block.component';\n\n\n@NgModule({\n imports: [\n CommonModule,\n McButtonModule,\n McToolTipModule,\n McIconModule,\n HighlightModule,\n McTabsModule\n ], // , I18nModule\n declarations: [\n McCodeBlockComponent,\n McActionBarComponent\n ],\n providers: [{\n provide: HIGHLIGHT_OPTIONS,\n useValue: {\n fullLibraryLoader: () => import('highlight.js'),\n lineNumbersLoader: () => import('highlightjs-line-numbers.js'),\n lineNumbers: true\n }\n }],\n exports: [McCodeBlockComponent]\n})\nexport class McCodeBlockModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2","i3","i4","i6.McActionBarComponent"],"mappings":";;;;;;;;;;;;;;;;;;MA8Ba,oBAAoB,CAAA;AAXjC,IAAA,WAAA,GAAA;QAiBa,IAAgB,CAAA,gBAAA,GAAG,CAAC,CAAC;AAIpB,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,YAAY,EAAQ,CAAC;AAC1C,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,YAAY,EAAQ,CAAC;AACxC,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,YAAY,EAAQ,CAAC;AACpC,QAAA,IAAA,CAAA,kBAAkB,GAAG,IAAI,YAAY,EAAQ,CAAC;AAwB3D,KAAA;IApBG,eAAe,GAAA;QACX,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QAE/C,IAAI,CAAC,WAAW,CAAC,aAAa;aACzB,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,CAAC,KAAK,CAAC,CAAC;aAC/B,SAAS,CAAC,MAAK;YACZ,IAAI,IAAI,CAAC,eAAe,KAAK,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE;gBACpD,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;AAClD,aAAA;AACL,SAAC,CAAC,CAAC;KACV;IAED,MAAM,GAAA;AACF,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QAErB,UAAU,CAAC,MAAK;YACZ,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;AACjD,YAAA,IAAI,CAAC,WAAW,CAAC,IAAI,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
18
  import { ComponentPortal } from '@angular/cdk/portal';
19
19
 
20
- const VERSION = new Version('14.6.1+sha-e1042d9');
20
+ const VERSION = new Version('14.7.0+sha-3a206be');
21
21
 
22
22
  function isBoolean(val) { return typeof val === 'boolean'; }
23
23
  function toBoolean(value) {
@@ -561,6 +561,61 @@ const enUS = {
561
561
  }`
562
562
  }
563
563
  }
564
+ },
565
+ durationTemplates: {
566
+ shortest: {
567
+ FULL: '{D, duration}{SHOW_MILLISECONDS, select, yes{,{MILLISECONDS}} other {}}',
568
+ ONLY_MINUTES: '{HOURS}:{MINUTES, number, ::integer-width/00}'
569
+ },
570
+ long: {
571
+ SEPARATOR: '',
572
+ YEARS: `{years, plural,
573
+ =1 {# year}
574
+ other {# years}
575
+ }`,
576
+ MONTHS: `{months, plural,
577
+ =1 {# month}
578
+ other {# months}
579
+ }`,
580
+ WEEKS: `{weeks, plural,
581
+ =1 {# week}
582
+ other {# weeks}
583
+ }`,
584
+ DAYS: `{days, plural,
585
+ =1 {# day}
586
+ other {# days}
587
+ }`,
588
+ HOURS: `{hours, plural,
589
+ =1 {# hour}
590
+ other {# hours}
591
+ }`,
592
+ MINUTES: `{minutes, plural,
593
+ =1 {# minute}
594
+ other {# minutes}
595
+ }`,
596
+ SECONDS: `{seconds, plural,
597
+ =1 {# second}
598
+ other {# seconds}
599
+ }`,
600
+ YEARS_FRACTION: `{years} years`,
601
+ MONTHS_FRACTION: `{months} months`
602
+ },
603
+ short: {
604
+ SEPARATOR: '',
605
+ YEARS: `{years} y`,
606
+ MONTHS: `{months} mo`,
607
+ WEEKS: `{weeks} w`,
608
+ DAYS: `{days} d`,
609
+ HOURS: `{hours} h`,
610
+ MINUTES: `{minutes} min`,
611
+ SECONDS: `{SHOW_MILLISECONDS, select, yes
612
+ {{seconds}.{milliseconds} s}
613
+ other
614
+ {{seconds} s}
615
+ }`,
616
+ YEARS_FRACTION: '{years} y',
617
+ MONTHS_FRACTION: '{months} mo'
618
+ }
564
619
  }
565
620
  };
566
621
 
@@ -842,6 +897,97 @@ const ruRU = {
842
897
  }`
843
898
  }
844
899
  }
900
+ },
901
+ durationTemplates: {
902
+ shortest: {
903
+ FULL: '{D, duration}{SHOW_MILLISECONDS, select, yes{,{MILLISECONDS}} other {}}',
904
+ ONLY_MINUTES: '{HOURS}:{MINUTES, number, ::integer-width/00}'
905
+ },
906
+ long: {
907
+ SEPARATOR: 'и',
908
+ YEARS: `{years, plural,
909
+ one {# год}
910
+ few {# года}
911
+ many {# лет}
912
+ other {}
913
+ }`,
914
+ MONTHS: `{months, plural,
915
+ one {# месяц}
916
+ few {# месяца}
917
+ many {# месяцев}
918
+ other {}
919
+ }`,
920
+ WEEKS: `{weeks, plural,
921
+ one {# неделя}
922
+ few {# недели}
923
+ many {# недель}
924
+ other {}
925
+ }`,
926
+ DAYS: `{days, plural,
927
+ one {# день}
928
+ few {# дня}
929
+ many {# дней}
930
+ other {}
931
+ }`,
932
+ HOURS: `{hours, plural,
933
+ one {# час}
934
+ few {# часа}
935
+ many {# часов}
936
+ other {}
937
+ }`,
938
+ MINUTES: `{minutes, plural,
939
+ one {# минута}
940
+ few {# минуты}
941
+ many {# минут}
942
+ other {}
943
+ }`,
944
+ SECONDS: `{seconds, plural,
945
+ one {# секунда}
946
+ few {# секунды}
947
+ many {# секунд}
948
+ other {}
949
+ }`,
950
+ YEARS_FRACTION: `{floorValue, plural,
951
+ =1 {{years, number, ::#,#} года}
952
+ one {{years, number, ::#,#} год}
953
+ few {{years, number, ::#,#} года}
954
+ other {{years, number, ::#,#} лет}
955
+ }`,
956
+ MONTHS_FRACTION: `{floorValue, plural,
957
+ =1 {{months, number, ::#,#} месяца}
958
+ one {{months, number, ::#,#} месяц}
959
+ few {{months, number, ::#,#} месяца}
960
+ other {{months, number, ::#,#} месяцев}
961
+ }`
962
+ },
963
+ short: {
964
+ SEPARATOR: '',
965
+ YEARS: `{years, plural,
966
+ one {# г}
967
+ few {# г}
968
+ many {# л}
969
+ other {}
970
+ }`,
971
+ MONTHS: `{months} мес`,
972
+ WEEKS: `{weeks} нед`,
973
+ DAYS: `{days} д`,
974
+ HOURS: `{hours} ч`,
975
+ MINUTES: `{minutes} мин`,
976
+ SECONDS: `{SHOW_MILLISECONDS, select, yes
977
+ {{seconds},{milliseconds} с}
978
+ other
979
+ {{seconds} с}
980
+ }`,
981
+ YEARS_FRACTION: `{floorValue, plural,
982
+ one {{years, number, ::#,#} г}
983
+ few {{years, number, ::#,#} г}
984
+ other {{years, number, ::#,#} л}
985
+ }`,
986
+ MONTHS_FRACTION: `{floorValue, plural,
987
+ =1 {{months, number, ::#,#} мес}
988
+ other {{months, number, ::#,#} мес}
989
+ }`
990
+ }
845
991
  }
846
992
  };
847
993
 
@@ -1159,6 +1305,82 @@ class DateFormatter {
1159
1305
  rangeMiddleDateTime(startDate, endDate, options) {
1160
1306
  return this.rangeDateTime(startDate, endDate, this.config.rangeTemplates.closedRange.middle, options?.seconds, options?.milliseconds);
1161
1307
  }
1308
+ /**
1309
+ * @param startDate - start date
1310
+ * @param endDate - end date
1311
+ * @param seconds - add seconds to formatted value
1312
+ * @param milliseconds - add milliseconds to formatted value
1313
+ * @returns formatted duration as string like 48:02:25
1314
+ */
1315
+ durationShortest(startDate, endDate, seconds = true, milliseconds = false) {
1316
+ this.checkDates(startDate, endDate);
1317
+ if (startDate > endDate) {
1318
+ throw new Error(this.invalidDateErrorText);
1319
+ }
1320
+ const durationObject = this.adapter.durationObjectFromDates(startDate, endDate, ['hours', 'minutes', 'seconds', 'milliseconds']);
1321
+ const roundedSeconds = Math.floor(this.adapter.durationAs(durationObject, 'seconds'));
1322
+ if (seconds) {
1323
+ return this.compileMessage(this.config.durationTemplates.shortest.FULL, {
1324
+ D: roundedSeconds,
1325
+ SHOW_MILLISECONDS: milliseconds ? 'yes' : 'no',
1326
+ MILLISECONDS: durationObject.milliseconds
1327
+ });
1328
+ }
1329
+ return roundedSeconds - (roundedSeconds % 60) ? this.compileMessage(this.config.durationTemplates.shortest.ONLY_MINUTES, {
1330
+ HOURS: durationObject.hours,
1331
+ MINUTES: durationObject.minutes
1332
+ }) : '';
1333
+ }
1334
+ /**
1335
+ * @param startDate - start date
1336
+ * @param endDate - end date
1337
+ * @param units - if defined, units to show will be specified
1338
+ * @param fraction - shows fraction part for years and months
1339
+ * @param template - specify template
1340
+ * @returns formatted duration as string
1341
+ */
1342
+ duration(startDate, endDate, units, fraction, template) {
1343
+ this.checkDates(startDate, endDate);
1344
+ if (startDate > endDate) {
1345
+ throw new Error(this.invalidDateErrorText);
1346
+ }
1347
+ const values = this.adapter.durationObjectFromDates(startDate, endDate, units, fraction);
1348
+ const variables = { ...values };
1349
+ variables.SHOW_MILLISECONDS = values.milliseconds ? 'yes' : 'no';
1350
+ return Object
1351
+ .keys(values)
1352
+ .reduce((acc, unit, index, arr) => {
1353
+ if (fraction) {
1354
+ variables.floorValue = Math.floor(values[unit]);
1355
+ acc.push(this.compileMessage(template[`${unit.toUpperCase()}_FRACTION`], variables));
1356
+ }
1357
+ else {
1358
+ if (arr.length > 1 && index === arr.length - 1) {
1359
+ acc.push(this.compileMessage(template.SEPARATOR, variables));
1360
+ }
1361
+ acc.push(this.compileMessage(template[unit.toUpperCase()], variables));
1362
+ }
1363
+ return acc;
1364
+ }, [])
1365
+ .filter((text) => !!text)
1366
+ .join(' ');
1367
+ }
1368
+ durationLong(startDate, endDate, units = [], fraction = false) {
1369
+ return this.duration(startDate, endDate, units, fraction, this.config.durationTemplates.long);
1370
+ }
1371
+ durationShort(startDate, endDate, units = [], fraction = false) {
1372
+ return this.duration(startDate, endDate, units, fraction, this.config.durationTemplates.short);
1373
+ }
1374
+ checkDates(...args) {
1375
+ args.forEach((date) => {
1376
+ if (!this.adapter.isDateInstance(date) || !this.adapter.isValid(date)) {
1377
+ throw new Error(this.invalidDateErrorText);
1378
+ }
1379
+ });
1380
+ }
1381
+ compileMessage(message, variables) {
1382
+ return this.messageFormat.compile(message)(variables);
1383
+ }
1162
1384
  /**
1163
1385
  * @param date - date for compile
1164
1386
  * @param variables - date template variables
@@ -2021,7 +2243,7 @@ class McPseudoCheckboxBase {
2021
2243
  this.elementRef = elementRef;
2022
2244
  }
2023
2245
  }
2024
- // tslint:disable-next-line:naming-convention
2246
+ /** @docs-private */
2025
2247
  const McPseudoCheckboxMixinBase = mixinColor(mixinDisabled(McPseudoCheckboxBase), ThemePalette.Primary);
2026
2248
  /**
2027
2249
  * Component that shows a simplified checkbox without including any kind of "real" checkbox.
@@ -2395,9 +2617,10 @@ function getOptionScrollPosition(optionIndex, optionHeight, currentScrollPositio
2395
2617
  }
2396
2618
 
2397
2619
  const MC_OPTION_ACTION_PARENT = new InjectionToken('MC_OPTION_ACTION_PARENT');
2620
+ /** @docs-private */
2398
2621
  class McOptionActionBase {
2399
2622
  }
2400
- // tslint:disable-next-line:naming-convention
2623
+ /** @docs-private */
2401
2624
  const McOptionActionMixinBase = mixinTabIndex(mixinDisabled(McOptionActionBase));
2402
2625
  class McOptionActionComponent extends McOptionActionMixinBase {
2403
2626
  constructor(elementRef, focusMonitor, option) {