@taiga-ui/core 2.37.0 → 2.39.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 (168) hide show
  1. package/bundles/taiga-ui-core-components-button.umd.js +3 -3
  2. package/bundles/taiga-ui-core-components-button.umd.js.map +1 -1
  3. package/bundles/taiga-ui-core-components-button.umd.min.js +1 -1
  4. package/bundles/taiga-ui-core-components-button.umd.min.js.map +1 -1
  5. package/bundles/taiga-ui-core-components-dropdown-box.umd.js +6 -6
  6. package/bundles/taiga-ui-core-components-dropdown-box.umd.js.map +1 -1
  7. package/bundles/taiga-ui-core-components-dropdown-box.umd.min.js +2 -2
  8. package/bundles/taiga-ui-core-components-dropdown-box.umd.min.js.map +1 -1
  9. package/bundles/taiga-ui-core-components-link.umd.js +1 -1
  10. package/bundles/taiga-ui-core-components-link.umd.min.js +1 -1
  11. package/bundles/taiga-ui-core-components-link.umd.min.js.map +1 -1
  12. package/bundles/taiga-ui-core-components-primitive-checkbox.umd.js +4 -4
  13. package/bundles/taiga-ui-core-components-primitive-checkbox.umd.js.map +1 -1
  14. package/bundles/taiga-ui-core-components-primitive-checkbox.umd.min.js +2 -2
  15. package/bundles/taiga-ui-core-components-primitive-checkbox.umd.min.js.map +1 -1
  16. package/bundles/taiga-ui-core-components-primitive-textfield.umd.js +7 -7
  17. package/bundles/taiga-ui-core-components-primitive-textfield.umd.js.map +1 -1
  18. package/bundles/taiga-ui-core-components-primitive-textfield.umd.min.js +2 -2
  19. package/bundles/taiga-ui-core-components-primitive-textfield.umd.min.js.map +1 -1
  20. package/bundles/taiga-ui-core-components.umd.js +4 -12
  21. package/bundles/taiga-ui-core-components.umd.js.map +1 -1
  22. package/bundles/taiga-ui-core-components.umd.min.js +1 -1
  23. package/bundles/taiga-ui-core-constants.umd.js +1 -1
  24. package/bundles/taiga-ui-core-constants.umd.js.map +1 -1
  25. package/bundles/taiga-ui-core-constants.umd.min.js +1 -1
  26. package/bundles/taiga-ui-core-constants.umd.min.js.map +1 -1
  27. package/bundles/{taiga-ui-core-components-wrapper.umd.js → taiga-ui-core-directives-wrapper.umd.js} +56 -40
  28. package/bundles/taiga-ui-core-directives-wrapper.umd.js.map +1 -0
  29. package/bundles/taiga-ui-core-directives-wrapper.umd.min.js +16 -0
  30. package/bundles/taiga-ui-core-directives-wrapper.umd.min.js.map +1 -0
  31. package/bundles/taiga-ui-core-directives.umd.js +12 -4
  32. package/bundles/taiga-ui-core-directives.umd.js.map +1 -1
  33. package/bundles/taiga-ui-core-directives.umd.min.js +1 -1
  34. package/bundles/taiga-ui-core-enums.umd.js +2 -0
  35. package/bundles/taiga-ui-core-enums.umd.js.map +1 -1
  36. package/bundles/taiga-ui-core-enums.umd.min.js.map +1 -1
  37. package/bundles/taiga-ui-core-utils-format.umd.js +5 -0
  38. package/bundles/taiga-ui-core-utils-format.umd.js.map +1 -1
  39. package/bundles/taiga-ui-core-utils-format.umd.min.js +1 -1
  40. package/bundles/taiga-ui-core-utils-format.umd.min.js.map +1 -1
  41. package/components/button/taiga-ui-core-components-button.metadata.json +1 -1
  42. package/components/dropdown-box/taiga-ui-core-components-dropdown-box.metadata.json +1 -1
  43. package/components/index.d.ts +0 -1
  44. package/components/link/taiga-ui-core-components-link.metadata.json +1 -1
  45. package/components/primitive-checkbox/taiga-ui-core-components-primitive-checkbox.metadata.json +1 -1
  46. package/components/primitive-textfield/taiga-ui-core-components-primitive-textfield.metadata.json +1 -1
  47. package/components/taiga-ui-core-components.metadata.json +1 -1
  48. package/constants/taiga-ui-core-constants.metadata.json +1 -1
  49. package/constants/version.d.ts +1 -1
  50. package/directives/index.d.ts +1 -0
  51. package/directives/taiga-ui-core-directives.metadata.json +1 -1
  52. package/directives/wrapper/index.d.ts +2 -0
  53. package/directives/wrapper/package.json +13 -0
  54. package/{components/wrapper/taiga-ui-core-components-wrapper.d.ts → directives/wrapper/taiga-ui-core-directives-wrapper.d.ts} +0 -0
  55. package/directives/wrapper/taiga-ui-core-directives-wrapper.metadata.json +1 -0
  56. package/{components/wrapper/wrapper.component.d.ts → directives/wrapper/wrapper.directive.d.ts} +7 -6
  57. package/{components → directives}/wrapper/wrapper.module.d.ts +0 -0
  58. package/esm2015/components/button/button.module.js +2 -2
  59. package/esm2015/components/dropdown-box/dropdown-box.component.js +2 -3
  60. package/esm2015/components/index.js +1 -2
  61. package/esm2015/components/link/link.component.js +1 -1
  62. package/esm2015/components/primitive-checkbox/primitive-checkbox.component.js +2 -2
  63. package/esm2015/components/primitive-checkbox/primitive-checkbox.module.js +2 -2
  64. package/esm2015/components/primitive-textfield/primitive-textfield.component.js +3 -3
  65. package/esm2015/components/primitive-textfield/primitive-textfield.module.js +2 -2
  66. package/esm2015/components/primitive-textfield/value-decoration/value-decoration.component.js +1 -1
  67. package/esm2015/constants/version.js +2 -2
  68. package/esm2015/directives/index.js +2 -1
  69. package/esm2015/{components → directives}/wrapper/index.js +2 -2
  70. package/esm2015/{components/wrapper/taiga-ui-core-components-wrapper.js → directives/wrapper/taiga-ui-core-directives-wrapper.js} +1 -1
  71. package/esm2015/directives/wrapper/wrapper.directive.js +98 -0
  72. package/esm2015/{components → directives}/wrapper/wrapper.module.js +4 -4
  73. package/esm2015/enums/interactive-state.js +3 -1
  74. package/esm2015/utils/format/capitalize-first-letter.js +4 -0
  75. package/esm2015/utils/format/index.js +2 -1
  76. package/esm5/components/button/button.module.js +2 -2
  77. package/esm5/components/dropdown-box/dropdown-box.component.js +2 -3
  78. package/esm5/components/index.js +1 -2
  79. package/esm5/components/link/link.component.js +1 -1
  80. package/esm5/components/primitive-checkbox/primitive-checkbox.component.js +2 -2
  81. package/esm5/components/primitive-checkbox/primitive-checkbox.module.js +2 -2
  82. package/esm5/components/primitive-textfield/primitive-textfield.component.js +3 -3
  83. package/esm5/components/primitive-textfield/primitive-textfield.module.js +2 -2
  84. package/esm5/components/primitive-textfield/value-decoration/value-decoration.component.js +1 -1
  85. package/esm5/constants/version.js +2 -2
  86. package/esm5/directives/index.js +2 -1
  87. package/esm5/{components → directives}/wrapper/index.js +2 -2
  88. package/esm5/{components/wrapper/taiga-ui-core-components-wrapper.js → directives/wrapper/taiga-ui-core-directives-wrapper.js} +1 -1
  89. package/esm5/directives/wrapper/wrapper.directive.js +119 -0
  90. package/esm5/{components → directives}/wrapper/wrapper.module.js +4 -4
  91. package/esm5/enums/interactive-state.js +3 -1
  92. package/esm5/utils/format/capitalize-first-letter.js +4 -0
  93. package/esm5/utils/format/index.js +2 -1
  94. package/fesm2015/taiga-ui-core-components-button.js +1 -1
  95. package/fesm2015/taiga-ui-core-components-button.js.map +1 -1
  96. package/fesm2015/taiga-ui-core-components-dropdown-box.js +1 -2
  97. package/fesm2015/taiga-ui-core-components-dropdown-box.js.map +1 -1
  98. package/fesm2015/taiga-ui-core-components-link.js +1 -1
  99. package/fesm2015/taiga-ui-core-components-primitive-checkbox.js +2 -2
  100. package/fesm2015/taiga-ui-core-components-primitive-checkbox.js.map +1 -1
  101. package/fesm2015/taiga-ui-core-components-primitive-textfield.js +4 -4
  102. package/fesm2015/taiga-ui-core-components-primitive-textfield.js.map +1 -1
  103. package/fesm2015/taiga-ui-core-components.js +0 -1
  104. package/fesm2015/taiga-ui-core-components.js.map +1 -1
  105. package/fesm2015/taiga-ui-core-constants.js +1 -1
  106. package/fesm2015/taiga-ui-core-constants.js.map +1 -1
  107. package/fesm2015/taiga-ui-core-directives-wrapper.js +113 -0
  108. package/fesm2015/taiga-ui-core-directives-wrapper.js.map +1 -0
  109. package/fesm2015/taiga-ui-core-directives.js +1 -0
  110. package/fesm2015/taiga-ui-core-directives.js.map +1 -1
  111. package/fesm2015/taiga-ui-core-enums.js +2 -0
  112. package/fesm2015/taiga-ui-core-enums.js.map +1 -1
  113. package/fesm2015/taiga-ui-core-utils-format.js +5 -1
  114. package/fesm2015/taiga-ui-core-utils-format.js.map +1 -1
  115. package/fesm5/taiga-ui-core-components-button.js +1 -1
  116. package/fesm5/taiga-ui-core-components-button.js.map +1 -1
  117. package/fesm5/taiga-ui-core-components-dropdown-box.js +1 -2
  118. package/fesm5/taiga-ui-core-components-dropdown-box.js.map +1 -1
  119. package/fesm5/taiga-ui-core-components-link.js +1 -1
  120. package/fesm5/taiga-ui-core-components-primitive-checkbox.js +2 -2
  121. package/fesm5/taiga-ui-core-components-primitive-checkbox.js.map +1 -1
  122. package/fesm5/taiga-ui-core-components-primitive-textfield.js +4 -4
  123. package/fesm5/taiga-ui-core-components-primitive-textfield.js.map +1 -1
  124. package/fesm5/taiga-ui-core-components.js +0 -1
  125. package/fesm5/taiga-ui-core-components.js.map +1 -1
  126. package/fesm5/taiga-ui-core-constants.js +1 -1
  127. package/fesm5/taiga-ui-core-constants.js.map +1 -1
  128. package/fesm5/taiga-ui-core-directives-wrapper.js +137 -0
  129. package/fesm5/taiga-ui-core-directives-wrapper.js.map +1 -0
  130. package/fesm5/taiga-ui-core-directives.js +1 -0
  131. package/fesm5/taiga-ui-core-directives.js.map +1 -1
  132. package/fesm5/taiga-ui-core-enums.js +2 -0
  133. package/fesm5/taiga-ui-core-enums.js.map +1 -1
  134. package/fesm5/taiga-ui-core-utils-format.js +5 -1
  135. package/fesm5/taiga-ui-core-utils-format.js.map +1 -1
  136. package/package.json +4 -4
  137. package/styles/mixins/textfield.less +2 -2
  138. package/styles/mixins/textfield.scss +2 -2
  139. package/styles/mixins/wrapper.less +57 -0
  140. package/styles/mixins/wrapper.scss +57 -0
  141. package/styles/taiga-ui-local.less +1 -0
  142. package/styles/taiga-ui-local.scss +1 -0
  143. package/styles/theme/variables.less +1 -1
  144. package/styles/theme/wrapper/accent.less +16 -18
  145. package/styles/theme/wrapper/base.less +35 -0
  146. package/styles/theme/wrapper/icon.less +18 -28
  147. package/styles/theme/wrapper/outline.less +28 -29
  148. package/styles/theme/wrapper/primary.less +20 -18
  149. package/styles/theme/wrapper/secondary.less +35 -35
  150. package/styles/theme/wrapper/table.less +27 -33
  151. package/styles/theme/wrapper/textfield.less +45 -55
  152. package/styles/theme/wrapper/whiteblock.less +27 -16
  153. package/styles/theme/wrapper.less +2 -0
  154. package/utils/format/capitalize-first-letter.d.ts +1 -0
  155. package/utils/format/index.d.ts +1 -0
  156. package/utils/format/taiga-ui-core-utils-format.metadata.json +1 -1
  157. package/bundles/taiga-ui-core-components-wrapper.umd.js.map +0 -1
  158. package/bundles/taiga-ui-core-components-wrapper.umd.min.js +0 -16
  159. package/bundles/taiga-ui-core-components-wrapper.umd.min.js.map +0 -1
  160. package/components/wrapper/index.d.ts +0 -2
  161. package/components/wrapper/package.json +0 -13
  162. package/components/wrapper/taiga-ui-core-components-wrapper.metadata.json +0 -1
  163. package/esm2015/components/wrapper/wrapper.component.js +0 -91
  164. package/esm5/components/wrapper/wrapper.component.js +0 -104
  165. package/fesm2015/taiga-ui-core-components-wrapper.js +0 -106
  166. package/fesm2015/taiga-ui-core-components-wrapper.js.map +0 -1
  167. package/fesm5/taiga-ui-core-components-wrapper.js +0 -122
  168. package/fesm5/taiga-ui-core-components-wrapper.js.map +0 -1
@@ -0,0 +1,137 @@
1
+ import { __decorate, __param } from 'tslib';
2
+ import { Inject, Input, HostBinding, Directive, NgModule } from '@angular/core';
3
+ import { MODE_PROVIDER } from '@taiga-ui/core/providers';
4
+ import { TUI_MODE } from '@taiga-ui/core/tokens';
5
+ import { Observable } from 'rxjs';
6
+
7
+ var TuiWrapperDirective = /** @class */ (function () {
8
+ function TuiWrapperDirective(mode$) {
9
+ this.mode$ = mode$;
10
+ this.disabled = false;
11
+ this.readOnly = false;
12
+ // TODO: Rename to `hover` in 3.0
13
+ this.hovered = null;
14
+ // TODO: Rename to `active` in 3.0
15
+ this.pressed = null;
16
+ this.focused = false;
17
+ this.invalid = false;
18
+ this.appearance = '';
19
+ }
20
+ Object.defineProperty(TuiWrapperDirective.prototype, "computedInvalid", {
21
+ get: function () {
22
+ return !this.disabled && !this.readOnly && this.invalid;
23
+ },
24
+ enumerable: true,
25
+ configurable: true
26
+ });
27
+ Object.defineProperty(TuiWrapperDirective.prototype, "computedFocused", {
28
+ get: function () {
29
+ return this.focused && !this.disabled;
30
+ },
31
+ enumerable: true,
32
+ configurable: true
33
+ });
34
+ Object.defineProperty(TuiWrapperDirective.prototype, "interactiveState", {
35
+ get: function () {
36
+ if (this.disabled) {
37
+ return "disabled" /* Disabled */;
38
+ }
39
+ if (this.readOnly) {
40
+ return "readonly" /* Readonly */;
41
+ }
42
+ if (this.pressed) {
43
+ return "pressed" /* Pressed */;
44
+ }
45
+ if (this.hovered) {
46
+ return "hovered" /* Hovered */;
47
+ }
48
+ return null;
49
+ },
50
+ enumerable: true,
51
+ configurable: true
52
+ });
53
+ Object.defineProperty(TuiWrapperDirective.prototype, "noHover", {
54
+ get: function () {
55
+ return this.readOnly || this.hovered === false;
56
+ },
57
+ enumerable: true,
58
+ configurable: true
59
+ });
60
+ Object.defineProperty(TuiWrapperDirective.prototype, "noActive", {
61
+ get: function () {
62
+ return this.readOnly || this.pressed === false;
63
+ },
64
+ enumerable: true,
65
+ configurable: true
66
+ });
67
+ TuiWrapperDirective.ctorParameters = function () { return [
68
+ { type: Observable, decorators: [{ type: Inject, args: [TUI_MODE,] }] }
69
+ ]; };
70
+ __decorate([
71
+ Input()
72
+ ], TuiWrapperDirective.prototype, "disabled", void 0);
73
+ __decorate([
74
+ Input()
75
+ ], TuiWrapperDirective.prototype, "readOnly", void 0);
76
+ __decorate([
77
+ Input()
78
+ ], TuiWrapperDirective.prototype, "hovered", void 0);
79
+ __decorate([
80
+ Input()
81
+ ], TuiWrapperDirective.prototype, "pressed", void 0);
82
+ __decorate([
83
+ Input()
84
+ ], TuiWrapperDirective.prototype, "focused", void 0);
85
+ __decorate([
86
+ Input()
87
+ ], TuiWrapperDirective.prototype, "invalid", void 0);
88
+ __decorate([
89
+ Input(),
90
+ HostBinding('attr.data-appearance')
91
+ ], TuiWrapperDirective.prototype, "appearance", void 0);
92
+ __decorate([
93
+ HostBinding('class._invalid')
94
+ ], TuiWrapperDirective.prototype, "computedInvalid", null);
95
+ __decorate([
96
+ HostBinding('class._focused')
97
+ ], TuiWrapperDirective.prototype, "computedFocused", null);
98
+ __decorate([
99
+ HostBinding('attr.data-state')
100
+ ], TuiWrapperDirective.prototype, "interactiveState", null);
101
+ __decorate([
102
+ HostBinding('class._no-hover')
103
+ ], TuiWrapperDirective.prototype, "noHover", null);
104
+ __decorate([
105
+ HostBinding('class._no-active')
106
+ ], TuiWrapperDirective.prototype, "noActive", null);
107
+ TuiWrapperDirective = __decorate([
108
+ Directive({
109
+ selector: 'tui-wrapper, [tuiWrapper]',
110
+ providers: [MODE_PROVIDER],
111
+ host: {
112
+ '($.data-mode.attr)': 'mode$',
113
+ },
114
+ }),
115
+ __param(0, Inject(TUI_MODE))
116
+ ], TuiWrapperDirective);
117
+ return TuiWrapperDirective;
118
+ }());
119
+
120
+ var TuiWrapperModule = /** @class */ (function () {
121
+ function TuiWrapperModule() {
122
+ }
123
+ TuiWrapperModule = __decorate([
124
+ NgModule({
125
+ declarations: [TuiWrapperDirective],
126
+ exports: [TuiWrapperDirective],
127
+ })
128
+ ], TuiWrapperModule);
129
+ return TuiWrapperModule;
130
+ }());
131
+
132
+ /**
133
+ * Generated bundle index. Do not edit.
134
+ */
135
+
136
+ export { TuiWrapperDirective, TuiWrapperModule };
137
+ //# sourceMappingURL=taiga-ui-core-directives-wrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taiga-ui-core-directives-wrapper.js","sources":["ng://@taiga-ui/core/directives/wrapper/wrapper.directive.ts","ng://@taiga-ui/core/directives/wrapper/wrapper.module.ts","ng://@taiga-ui/core/directives/wrapper/taiga-ui-core-directives-wrapper.ts"],"sourcesContent":["import {Directive, HostBinding, Inject, Input} from '@angular/core';\nimport {TuiInteractiveState} from '@taiga-ui/core/enums';\nimport {MODE_PROVIDER} from '@taiga-ui/core/providers';\nimport {TUI_MODE} from '@taiga-ui/core/tokens';\nimport {TuiBrightness} from '@taiga-ui/core/types';\nimport {Observable} from 'rxjs';\n\n@Directive({\n selector: 'tui-wrapper, [tuiWrapper]',\n providers: [MODE_PROVIDER],\n host: {\n '($.data-mode.attr)': 'mode$',\n },\n})\nexport class TuiWrapperDirective {\n @Input()\n disabled = false;\n\n @Input()\n readOnly = false;\n\n // TODO: Rename to `hover` in 3.0\n @Input()\n hovered: boolean | null = null;\n\n // TODO: Rename to `active` in 3.0\n @Input()\n pressed: boolean | null = null;\n\n @Input()\n focused = false;\n\n @Input()\n invalid = false;\n\n @Input()\n @HostBinding('attr.data-appearance')\n appearance = '';\n\n constructor(@Inject(TUI_MODE) readonly mode$: Observable<TuiBrightness | null>) {}\n\n @HostBinding('class._invalid')\n get computedInvalid(): boolean {\n return !this.disabled && !this.readOnly && this.invalid;\n }\n\n @HostBinding('class._focused')\n get computedFocused(): boolean {\n return this.focused && !this.disabled;\n }\n\n @HostBinding('attr.data-state')\n get interactiveState(): TuiInteractiveState | string | null {\n if (this.disabled) {\n return TuiInteractiveState.Disabled;\n }\n\n if (this.readOnly) {\n return TuiInteractiveState.Readonly;\n }\n\n if (this.pressed) {\n return TuiInteractiveState.Pressed;\n }\n\n if (this.hovered) {\n return TuiInteractiveState.Hovered;\n }\n\n return null;\n }\n\n @HostBinding('class._no-hover')\n get noHover(): boolean {\n return this.readOnly || this.hovered === false;\n }\n\n @HostBinding('class._no-active')\n get noActive(): boolean {\n return this.readOnly || this.pressed === false;\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiWrapperDirective} from './wrapper.directive';\n\n@NgModule({\n declarations: [TuiWrapperDirective],\n exports: [TuiWrapperDirective],\n})\nexport class TuiWrapperModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;IAuCI,6BAAuC,KAAuC;QAAvC,UAAK,GAAL,KAAK,CAAkC;QAvB9E,aAAQ,GAAG,KAAK,CAAC;QAGjB,aAAQ,GAAG,KAAK,CAAC;;QAIjB,YAAO,GAAmB,IAAI,CAAC;;QAI/B,YAAO,GAAmB,IAA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AW,CAAC,gBAAgB,CAAC;8DAG7B;IAGD;QADC,WAAW,CAAC,iBAAiB,CAAC;+DAmB9B;IAGD;QADC,WAAW,CAAC,iBAAiB,CAAC;sDAG9B;IAGD;QADC,WAAW,CAAC,kBAAkB,CAAC;uDAG/B;IAlEQ,mBAAmB;QAP/B,SAAS,CAAC;YACP,QAAQ,EAAE,2BAA2B;YACrC,SAAS,EAAE,CAAC,aAAa,CAAC;YAC1B,IAAI,EAAE;gBACF,oBAAoB,EAAE,OAAO;aAChC;SACJ,CAAC;QA0Be,WAAA,MAAM,CAAC,QAAQ,CAAC,CAAA;OAzBpB,mBAAmB,CAmE/B;IAAD,0BAAC;CAnED;;;ICNA;KAAgC;IAAnB,gBAAgB;QAJ5B,QAAQ,CAAC;YACN,YAAY,EAAE,CAAC,mBAAmB,CAAC;YACnC,OAAO,EAAE,CAAC,mBAAmB,CAAC;SACjC,CAAC;OACW,gBAAgB,CAAG;IAAD,uBAAC;CAAhC;;ACRA;;;;;;"}
@@ -11,6 +11,7 @@ export * from '@taiga-ui/core/directives/pointer-hint';
11
11
  export * from '@taiga-ui/core/directives/scroll-into-view';
12
12
  export * from '@taiga-ui/core/directives/table-mode';
13
13
  export * from '@taiga-ui/core/directives/textfield-controller';
14
+ export * from '@taiga-ui/core/directives/wrapper';
14
15
 
15
16
  /**
16
17
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-directives.js","sources":["ng://@taiga-ui/core/directives/taiga-ui-core-directives.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;;"}
1
+ {"version":3,"file":"taiga-ui-core-directives.js","sources":["ng://@taiga-ui/core/directives/taiga-ui-core-directives.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;"}
@@ -75,7 +75,9 @@ var TuiInteractiveState;
75
75
  (function (TuiInteractiveState) {
76
76
  TuiInteractiveState["Disabled"] = "disabled";
77
77
  TuiInteractiveState["Readonly"] = "readonly";
78
+ // TODO: Rename to `active` in 3.0
78
79
  TuiInteractiveState["Pressed"] = "pressed";
80
+ // TODO: Rename to `hover` in 3.0
79
81
  TuiInteractiveState["Hovered"] = "hovered";
80
82
  })(TuiInteractiveState || (TuiInteractiveState = {}));
81
83
 
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-enums.js","sources":["ng://@taiga-ui/core/enums/appearance.ts","ng://@taiga-ui/core/enums/base-color.ts","ng://@taiga-ui/core/enums/button-shape.ts","ng://@taiga-ui/core/enums/decimal.ts","ng://@taiga-ui/core/enums/dropdown-animation.ts","ng://@taiga-ui/core/enums/dropdown-width.ts","ng://@taiga-ui/core/enums/hint-mode.ts","ng://@taiga-ui/core/enums/interactive-state.ts","ng://@taiga-ui/core/enums/link-mode.ts","ng://@taiga-ui/core/enums/notification.ts","ng://@taiga-ui/core/enums/orientation.ts","ng://@taiga-ui/core/enums/range-state.ts","ng://@taiga-ui/core/enums/support-color.ts","ng://@taiga-ui/core/enums/taiga-ui-core-enums.ts"],"sourcesContent":["export const enum TuiAppearance {\n Icon = 'icon',\n Primary = 'primary',\n Accent = 'accent',\n Secondary = 'secondary',\n Table = 'table',\n Textfield = 'textfield',\n Flat = 'flat',\n Outline = 'outline',\n Whiteblock = 'whiteblock',\n WhiteblockActive = 'whiteblock-active',\n}\n","/**\n * @deprecated\n */\nexport const enum TuiBaseColor {\n Primary = 'primary',\n Secondary = 'secondary',\n Success = 'success',\n Error = 'error',\n}\n","/**\n * @deprecated use string values\n */\nexport const enum TuiButtonShape {\n Square = 'square',\n Rounded = 'rounded',\n}\n","/**\n * @deprecated use join type {@link TuiDecimalT}\n */\nexport const enum TuiDecimal {\n NotZero = 'not-zero',\n Always = 'always',\n Never = 'never',\n}\n","export const enum TuiDropdownAnimation {\n FadeInBottom = 'fadeInBottom',\n FadeInTop = 'fadeInTop',\n}\n","/**\n * @deprecated use join type {@link TuiDropdownWidthT}\n */\nexport const enum TuiDropdownWidth {\n Fixed = 'fixed',\n Min = 'min',\n Auto = 'auto',\n}\n","/**\n * @deprecated use join type {@link TuiHintModeT}\n */\nexport const enum TuiHintMode {\n Error = 'error',\n OnDark = 'onDark',\n Overflow = 'overflow',\n}\n","/**\n * @internal used in calendar, year picker and wrapper\n */\nexport const enum TuiInteractiveState {\n Disabled = 'disabled',\n Readonly = 'readonly',\n Pressed = 'pressed',\n Hovered = 'hovered',\n}\n","/**\n * @deprecated use string values\n */\nexport const enum TuiLinkMode {\n Positive = 'positive',\n Negative = 'negative',\n}\n","export const enum TuiNotification {\n Info = 'info',\n Warning = 'warning',\n Success = 'success',\n Error = 'error',\n}\n","/**\n * @deprecated use join type {@link TuiOrientationT}\n */\nexport const enum TuiOrientation {\n Vertical = 'vertical',\n Horizontal = 'horizontal',\n}\n","/**\n * @internal used in calendar and year picker\n */\nexport const enum TuiRangeState {\n Start = 'start',\n End = 'end',\n Single = 'single',\n}\n","/**\n * @deprecated\n */\nexport const enum TuiSupportColor {\n Mustard = 'support-01',\n Texas = 'support-02',\n Tan = 'support-03',\n Salmon = 'support-04',\n Sienna = 'support-05',\n Bittersweet = 'support-06',\n Pinkie = 'support-07',\n Charm = 'support-08',\n Amethist = 'support-09',\n Helio = 'support-10',\n Lilac = 'support-11',\n Malibu = 'support-12',\n Havelock = 'support-13',\n Picton = 'support-14',\n Mint = 'support-15',\n Fountain = 'support-16',\n Puertorico = 'support-17',\n Bay = 'support-18',\n Forest = 'support-19',\n York = 'support-20',\n Feijoa = 'support-21',\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"IAAkB;AAAlB,WAAkB,aAAa;IAC3B,8BAAa,CAAA;IACb,oCAAmB,CAAA;IACnB,kCAAiB,CAAA;IACjB,wCAAuB,CAAA;IACvB,gCAAe,CAAA;IACf,wCAAuB,CAAA;IAC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B,gCAAa,CAAA;IACb,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;IACnB,kCAAe,CAAA;AACnB,CAAC,EALiB,eAAe,KAAf,eAAe;;ACAjC;;;IAGkB;AAAlB,WAAkB,cAAc;IAC5B,uCAAqB,CAAA;IACrB,2CAAyB,CAAA;AAC7B,CAAC,EAHiB,cAAc,KAAd,cAAc;;ACHhC;;;IAGkB;AAAlB,WAAkB,aAAa;IAC3B,gCAAe,CAAA;IACf,4BAAW,CAAA;IACX,kCAAiB,CAAA;AACrB,CAAC,EAJiB,aAAa,KAAb,aAAa;;ACH/B;;;IAGkB;AAAlB,WAAkB,eAAe;IAC7B,yCAAsB,CAAA;IACtB,uCAAoB,CAAA;IACpB,qCAAkB,CAAA;IAClB,wCAAqB,CAAA;IACrB,wCAAqB,CAAA;IACrB,6CAA0B,CAAA;IAC1B,wCAAqB,CAAA;IACrB,uCAAoB,CAAA;IACpB,0CAAuB,CAAA;IACvB,uCAAoB,CAAA;IACpB,uCAAoB,CAAA;IACpB,wCAAqB,CAAA;IACrB,0CAAuB,CAAA;IACvB,wCAAqB,CAAA;IACrB,sCAAmB,CAAA;IACnB,0CAAuB,CAAA;IACvB,4CAAyB,CAAA;IACzB,qCAAkB,CAAA;IAClB,wCAAqB,CAAA;IACrB,sCAAmB,CAAA;IACnB,wCAAqB,CAAA;AACzB,CAAC,EAtBiB,eAAe,KAAf,eAAe;;ACHjC;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-enums.js","sources":["ng://@taiga-ui/core/enums/appearance.ts","ng://@taiga-ui/core/enums/base-color.ts","ng://@taiga-ui/core/enums/button-shape.ts","ng://@taiga-ui/core/enums/decimal.ts","ng://@taiga-ui/core/enums/dropdown-animation.ts","ng://@taiga-ui/core/enums/dropdown-width.ts","ng://@taiga-ui/core/enums/hint-mode.ts","ng://@taiga-ui/core/enums/interactive-state.ts","ng://@taiga-ui/core/enums/link-mode.ts","ng://@taiga-ui/core/enums/notification.ts","ng://@taiga-ui/core/enums/orientation.ts","ng://@taiga-ui/core/enums/range-state.ts","ng://@taiga-ui/core/enums/support-color.ts","ng://@taiga-ui/core/enums/taiga-ui-core-enums.ts"],"sourcesContent":["export const enum TuiAppearance {\n Icon = 'icon',\n Primary = 'primary',\n Accent = 'accent',\n Secondary = 'secondary',\n Table = 'table',\n Textfield = 'textfield',\n Flat = 'flat',\n Outline = 'outline',\n Whiteblock = 'whiteblock',\n WhiteblockActive = 'whiteblock-active',\n}\n","/**\n * @deprecated\n */\nexport const enum TuiBaseColor {\n Primary = 'primary',\n Secondary = 'secondary',\n Success = 'success',\n Error = 'error',\n}\n","/**\n * @deprecated use string values\n */\nexport const enum TuiButtonShape {\n Square = 'square',\n Rounded = 'rounded',\n}\n","/**\n * @deprecated use join type {@link TuiDecimalT}\n */\nexport const enum TuiDecimal {\n NotZero = 'not-zero',\n Always = 'always',\n Never = 'never',\n}\n","export const enum TuiDropdownAnimation {\n FadeInBottom = 'fadeInBottom',\n FadeInTop = 'fadeInTop',\n}\n","/**\n * @deprecated use join type {@link TuiDropdownWidthT}\n */\nexport const enum TuiDropdownWidth {\n Fixed = 'fixed',\n Min = 'min',\n Auto = 'auto',\n}\n","/**\n * @deprecated use join type {@link TuiHintModeT}\n */\nexport const enum TuiHintMode {\n Error = 'error',\n OnDark = 'onDark',\n Overflow = 'overflow',\n}\n","/**\n * @internal used in calendar, year picker and wrapper\n */\nexport const enum TuiInteractiveState {\n Disabled = 'disabled',\n Readonly = 'readonly',\n // TODO: Rename to `active` in 3.0\n Pressed = 'pressed',\n // TODO: Rename to `hover` in 3.0\n Hovered = 'hovered',\n}\n","/**\n * @deprecated use string values\n */\nexport const enum TuiLinkMode {\n Positive = 'positive',\n Negative = 'negative',\n}\n","export const enum TuiNotification {\n Info = 'info',\n Warning = 'warning',\n Success = 'success',\n Error = 'error',\n}\n","/**\n * @deprecated use join type {@link TuiOrientationT}\n */\nexport const enum TuiOrientation {\n Vertical = 'vertical',\n Horizontal = 'horizontal',\n}\n","/**\n * @internal used in calendar and year picker\n */\nexport const enum TuiRangeState {\n Start = 'start',\n End = 'end',\n Single = 'single',\n}\n","/**\n * @deprecated\n */\nexport const enum TuiSupportColor {\n Mustard = 'support-01',\n Texas = 'support-02',\n Tan = 'support-03',\n Salmon = 'support-04',\n Sienna = 'support-05',\n Bittersweet = 'support-06',\n Pinkie = 'support-07',\n Charm = 'support-08',\n Amethist = 'support-09',\n Helio = 'support-10',\n Lilac = 'support-11',\n Malibu = 'support-12',\n Havelock = 'support-13',\n Picton = 'support-14',\n Mint = 'support-15',\n Fountain = 'support-16',\n Puertorico = 'support-17',\n Bay = 'support-18',\n Forest = 'support-19',\n York = 'support-20',\n Feijoa = 'support-21',\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"IAAkB;AAAlB,WAAkB,aAAa;IAC3B,8BAAa,CAAA;IACb,oCAAmB,CAAA;IACnB,kCAAiB,CAAA;IACjB,wCAAuB,CAAA;IACvB,gCAAe,CAAA;IACf,wCAAuB,CAAA;IACvB,8BAAa,CAAA;IACb,oCAAmB,CAAA;IACnB,0CAAyB,CAAA;IACzB,uDAAsC,CAAA;AAC1C,CAAC,EAXiB,aAAa,KAAb,aAAa;;ACA/B;;;IAGkB;AAAlB,WAAkB,YAAY;IAC1B,mCAAmB,CAAA;IACnB,uCAAuB,CAAA;IACvB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;AACnB,CAAC,EALiB,YAAY,KAAZ,YAAY;;ACH9B;;;IAGkB;AAAlB,WAAkB,cAAc;IAC5B,mCAAiB,CAAA;IACjB,qCAAmB,CAAA;AACvB,CAAC,EAHiB,cAAc,KAAd,cAAc;;ACHhC;;;IAGkB;AAAlB,WAAkB,UAAU;IACxB,kCAAoB,CAAA;IACpB,+BAAiB,CAAA;IACjB,6BAAe,CAAA;AACnB,CAAC,EAJiB,UAAU,KAAV,UAAU;;ICHV;AAAlB,WAAkB,oBAAoB;IAClC,qDAA6B,CAAA;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,0CAAuB,CAAA;IACvB,uCAAoB,CAAA;IACpB,uCAAoB,CAAA;IACpB,wCAAqB,CAAA;IACrB,0CAAuB,CAAA;IACvB,wCAAqB,CAAA;IACrB,sCAAmB,CAAA;IACnB,0CAAuB,CAAA;IACvB,4CAAyB,CAAA;IACzB,qCAAkB,CAAA;IAClB,wCAAqB,CAAA;IACrB,sCAAmB,CAAA;IACnB,wCAAqB,CAAA;AACzB,CAAC,EAtBiB,eAAe,KAAf,eAAe;;ACHjC;;;;;;"}
@@ -12,6 +12,10 @@ function capitalize(value) {
12
12
  return value.toLowerCase().replace(/(?:^|\s)\S/g, function (char) { return char.toUpperCase(); });
13
13
  }
14
14
 
15
+ function capitalizeFirstLetter(value) {
16
+ return "" + value.charAt(0).toUpperCase() + value.slice(1);
17
+ }
18
+
15
19
  /**
16
20
  * Convert number to string with replacing exponent part on decimals
17
21
  *
@@ -166,5 +170,5 @@ function tuiPluralizeToICU(pluralize) {
166
170
  * Generated bundle index. Do not edit.
167
171
  */
168
172
 
169
- export { capitalize, formatNumber, formatPhone, getFractionPartPadded, numberToStringWithoutExp, otherDecimalSymbol, pluralize, tuiPluralizeToICU };
173
+ export { capitalize, capitalizeFirstLetter, formatNumber, formatPhone, getFractionPartPadded, numberToStringWithoutExp, otherDecimalSymbol, pluralize, tuiPluralizeToICU };
170
174
  //# sourceMappingURL=taiga-ui-core-utils-format.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-core-utils-format.js","sources":["ng://@taiga-ui/core/utils/format/capitalize.ts","ng://@taiga-ui/core/utils/format/number-to-string-without-exp.ts","ng://@taiga-ui/core/utils/format/get-fractional-part-padded.ts","ng://@taiga-ui/core/utils/format/format-number.ts","ng://@taiga-ui/core/utils/format/format-phone.ts","ng://@taiga-ui/core/utils/format/other-decimal-symbol.ts","ng://@taiga-ui/core/utils/format/pluralize.ts","ng://@taiga-ui/core/utils/format/pluralize-to-icu.ts","ng://@taiga-ui/core/utils/format/taiga-ui-core-utils-format.ts"],"sourcesContent":["/**\n * Capitalizes a given string, replacing it with a lowercase string and making\n * the first letter of each word uppercase.\n *\n * @param value the input string\n * @return the capitalized string\n */\nexport function capitalize(value: string): string {\n return value.toLowerCase().replace(/(?:^|\\s)\\S/g, char => char.toUpperCase());\n}\n","/**\n * Convert number to string with replacing exponent part on decimals\n *\n * @param value the number\n * @return string representation of a number\n */\nexport function numberToStringWithoutExp(value: number): string {\n const valueAsString = String(value);\n const [numberPart, expPart] = valueAsString.split('e-');\n\n let valueWithoutExp = valueAsString;\n\n if (expPart) {\n const [, fractionalPart] = numberPart.split('.');\n const decimalDigits = Number(expPart) + (fractionalPart?.length || 0);\n\n valueWithoutExp = value.toFixed(decimalDigits);\n }\n\n return valueWithoutExp;\n}\n","import {numberToStringWithoutExp} from './number-to-string-without-exp';\n\n/**\n * Return fractional part of number\n *\n * @param value the number\n * @param precision number of digits of decimal part, null to keep untouched\n * @return the fractional part of number\n */\nexport function getFractionPartPadded(value: number, precision?: number | null): string {\n const [, fractionPartPadded = ''] = numberToStringWithoutExp(value).split('.');\n\n return typeof precision === 'number'\n ? fractionPartPadded.substr(0, precision)\n : fractionPartPadded;\n}\n","import {CHAR_NO_BREAK_SPACE} from '@taiga-ui/cdk';\n\nimport {getFractionPartPadded} from './get-fractional-part-padded';\n\n/**\n * Formats number adding a thousand separators and correct decimal separator\n * padding decimal part with zeroes to given length\n *\n * @param value the input number\n * @param decimalLimit number of digits of decimal part, null to keep untouched\n * @param decimalSeparator separator between the integer and the decimal part\n * @param thousandSeparator separator between thousands\n * @param zeroPadding enable zeros at the end of decimal part\n * @return the formatted string\n */\nexport function formatNumber(\n value: number,\n decimalLimit: number | null = null,\n decimalSeparator: string = ',',\n thousandSeparator: string = CHAR_NO_BREAK_SPACE,\n zeroPadding: boolean = true,\n): string {\n const integerPartString = String(Math.floor(Math.abs(value)));\n\n let fractionPartPadded = getFractionPartPadded(value, decimalLimit);\n\n if (decimalLimit !== null) {\n const zeroPaddingSize: number = zeroPadding\n ? Math.max(decimalLimit - fractionPartPadded.length, 0)\n : 0;\n const zeroPartString = '0'.repeat(zeroPaddingSize);\n\n fractionPartPadded = `${fractionPartPadded}${zeroPartString}`;\n }\n\n const remainder = integerPartString.length % 3;\n const sign = value < 0 ? '-' : '';\n let result = sign + integerPartString.charAt(0);\n\n for (let i = 1; i < integerPartString.length; i++) {\n if (i % 3 === remainder && integerPartString.length > 3) {\n result += thousandSeparator;\n }\n\n result += integerPartString.charAt(i);\n }\n\n return !!fractionPartPadded || decimalLimit\n ? result + decimalSeparator + fractionPartPadded\n : result;\n}\n","/**\n * Formats a string with the phone format +7XXXXXXXXXXXX or XXXXXXXXXXXX,\n * adding parentheses and hyphens.\n *\n * @param value the input string\n * @param countryCode a country code\n * @param phoneMask a phone number mask\n * @return the formatted phone string of the form +7 XXX XXX-XX-XX\n */\nexport function formatPhone(\n value: string,\n countryCode: string,\n phoneMask: string,\n): string {\n if (!value) {\n return '';\n }\n\n let result = countryCode;\n\n countryCode = countryCode.replace(/[()]/g, '');\n\n if (!value.startsWith(countryCode)) {\n value = countryCode + value.replace('+', '');\n }\n\n const splitPhoneMask = phoneMask.split('');\n const splitValue = value.slice(countryCode.length).split('');\n\n result += ' ';\n\n if (splitValue.length === 0) {\n return result;\n }\n\n for (let i = 0; i < splitPhoneMask.length; i++) {\n if (splitValue.length === 0) {\n break;\n }\n\n if (splitPhoneMask[i] === '#') {\n result += splitValue[0] || '';\n splitValue.splice(0, 1);\n } else {\n result += splitPhoneMask[i];\n }\n }\n\n return result;\n}\n","import {TuiDecimalSymbol} from '@taiga-ui/core/types';\n\nexport function otherDecimalSymbol(symbol: TuiDecimalSymbol): TuiDecimalSymbol {\n return symbol === '.' ? ',' : '.';\n}\n","import {TuiPluralize} from '@taiga-ui/core/types';\n\n/**\n * Selects the correct plural form to display.\n *\n * @param value the input number\n * @param args an array of three plural forms, e.g. ['год', 'года', 'лет']\n * @deprecated This implementation targets Russian.\n * Use https://angular.io/api/common/NgPlural for your implementations.\n */\nexport function pluralize(value: number, [one, few, many]: TuiPluralize): string {\n const ten = value % 10;\n const hundred = value % 100;\n\n // 1, 21, 101, 121, но не 11, 111, 211...\n if (ten === 1 && hundred !== 11) {\n return one;\n }\n\n // 2, 3, 4, 22, 33, 44, 152, 163, 174, но не 12, 13, 14, 112, 213, 314...\n if (ten >= 2 && ten <= 4 && (hundred < 10 || hundred >= 20)) {\n return few;\n }\n\n return many;\n}\n","import {TuiPluralize} from '@taiga-ui/core/types';\n\n// TODO: remove in 3.0\n\n/**\n * Temporary util for mapping TuiPluralize array to ICU format\n */\nexport function tuiPluralizeToICU(pluralize: TuiPluralize): Record<string, string> {\n return {\n one: pluralize[0],\n few: pluralize[1],\n many: pluralize[2],\n other: pluralize[2],\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;;;;;;;SAOgB,UAAU,CAAC,KAAa;IACpC,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,UAAA,IAAI,IAAI,OAAA,IAAI,CAAC,WAAW,EAAE,GAAA,CAAC,CAAC;AAClF;;ACTA;;;;;;SAMgB,wBAAwB,CAAC,KAAa;IAClD,IAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,IAAA,yCAAiD,EAAhD,kBAAU,EAAE,eAAoC,CAAC;IAExD,IAAI,eAAe,GAAG,aAAa,CAAC;IAEpC,IAAI,OAAO,EAAE;QACH,IAAA,qCAA0C,EAAvC,sBAAuC,CAAC;QACjD,IAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,MAAM,KAAI,CAAC,CAAC,CAAC;QAEtE,eAAe,GAAG,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;KAClD;IAED,OAAO,eAAe,CAAC;AAC3B;;AClBA;;;;;;;SAOgB,qBAAqB,CAAC,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9B,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SAC3B;aAAM;YACH,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC;SAC/B;KACJ;IAED,OAAO,MAAM,CAAC;AAClB;;SC/CgB,kBAAkB,CAAC,MAAwB;IACvD,OAAO,MAAM,KAAK,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AACtC;;ACFA;;;;;;;;SAQgB,SAAS,CAAC,KAAa,EAAE,EAA8B;QAA9B,kBAA8B,EAA7B,WAAG,EAAE,WAAG,EAAE,YAAI;IACpD,IAAM,GAAG,GAAG,KAAK,GAAG,EAAE,CAAC;IACvB,IAAM,OAAO,GAAG,KAAK,GAAG,GAAG,CAAC;;IAG5B,IAAI,GAAG,KAAK,CAAC,IAAI,OAAO,KAAK,EAAE,EAAE;QAC7B,OAAO,GAAG,CAAC;KACd;;IAGD,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,OAAO,GAAG,EAAE,IAAI,OAAO,IAAI,EAAE,CAAC,EAAE;QACzD,OAAO,GAAG,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AAChB;;ACvBA;AAEA;;;SAGgB,iBAAiB,CAAC,SAAuB;IACrD,OAAO;QACH,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;QACjB,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;QACjB,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;QAClB,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;KACtB,CAAC;AACN;;ACdA;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-core-utils-format.js","sources":["ng://@taiga-ui/core/utils/format/capitalize.ts","ng://@taiga-ui/core/utils/format/capitalize-first-letter.ts","ng://@taiga-ui/core/utils/format/number-to-string-without-exp.ts","ng://@taiga-ui/core/utils/format/get-fractional-part-padded.ts","ng://@taiga-ui/core/utils/format/format-number.ts","ng://@taiga-ui/core/utils/format/format-phone.ts","ng://@taiga-ui/core/utils/format/other-decimal-symbol.ts","ng://@taiga-ui/core/utils/format/pluralize.ts","ng://@taiga-ui/core/utils/format/pluralize-to-icu.ts","ng://@taiga-ui/core/utils/format/taiga-ui-core-utils-format.ts"],"sourcesContent":["/**\n * Capitalizes a given string, replacing it with a lowercase string and making\n * the first letter of each word uppercase.\n *\n * @param value the input string\n * @return the capitalized string\n */\nexport function capitalize(value: string): string {\n return value.toLowerCase().replace(/(?:^|\\s)\\S/g, char => char.toUpperCase());\n}\n","export function capitalizeFirstLetter(value: string): string {\n return `${value.charAt(0).toUpperCase()}${value.slice(1)}`;\n}\n","/**\n * Convert number to string with replacing exponent part on decimals\n *\n * @param value the number\n * @return string representation of a number\n */\nexport function numberToStringWithoutExp(value: number): string {\n const valueAsString = String(value);\n const [numberPart, expPart] = valueAsString.split('e-');\n\n let valueWithoutExp = valueAsString;\n\n if (expPart) {\n const [, fractionalPart] = numberPart.split('.');\n const decimalDigits = Number(expPart) + (fractionalPart?.length || 0);\n\n valueWithoutExp = value.toFixed(decimalDigits);\n }\n\n return valueWithoutExp;\n}\n","import {numberToStringWithoutExp} from './number-to-string-without-exp';\n\n/**\n * Return fractional part of number\n *\n * @param value the number\n * @param precision number of digits of decimal part, null to keep untouched\n * @return the fractional part of number\n */\nexport function getFractionPartPadded(value: number, precision?: number | null): string {\n const [, fractionPartPadded = ''] = numberToStringWithoutExp(value).split('.');\n\n return typeof precision === 'number'\n ? fractionPartPadded.substr(0, precision)\n : fractionPartPadded;\n}\n","import {CHAR_NO_BREAK_SPACE} from '@taiga-ui/cdk';\n\nimport {getFractionPartPadded} from './get-fractional-part-padded';\n\n/**\n * Formats number adding a thousand separators and correct decimal separator\n * padding decimal part with zeroes to given length\n *\n * @param value the input number\n * @param decimalLimit number of digits of decimal part, null to keep untouched\n * @param decimalSeparator separator between the integer and the decimal part\n * @param thousandSeparator separator between thousands\n * @param zeroPadding enable zeros at the end of decimal part\n * @return the formatted string\n */\nexport function formatNumber(\n value: number,\n decimalLimit: number | null = null,\n decimalSeparator: string = ',',\n thousandSeparator: string = CHAR_NO_BREAK_SPACE,\n zeroPadding: boolean = true,\n): string {\n const integerPartString = String(Math.floor(Math.abs(value)));\n\n let fractionPartPadded = getFractionPartPadded(value, decimalLimit);\n\n if (decimalLimit !== null) {\n const zeroPaddingSize: number = zeroPadding\n ? Math.max(decimalLimit - fractionPartPadded.length, 0)\n : 0;\n const zeroPartString = '0'.repeat(zeroPaddingSize);\n\n fractionPartPadded = `${fractionPartPadded}${zeroPartString}`;\n }\n\n const remainder = integerPartString.length % 3;\n const sign = value < 0 ? '-' : '';\n let result = sign + integerPartString.charAt(0);\n\n for (let i = 1; i < integerPartString.length; i++) {\n if (i % 3 === remainder && integerPartString.length > 3) {\n result += thousandSeparator;\n }\n\n result += integerPartString.charAt(i);\n }\n\n return !!fractionPartPadded || decimalLimit\n ? result + decimalSeparator + fractionPartPadded\n : result;\n}\n","/**\n * Formats a string with the phone format +7XXXXXXXXXXXX or XXXXXXXXXXXX,\n * adding parentheses and hyphens.\n *\n * @param value the input string\n * @param countryCode a country code\n * @param phoneMask a phone number mask\n * @return the formatted phone string of the form +7 XXX XXX-XX-XX\n */\nexport function formatPhone(\n value: string,\n countryCode: string,\n phoneMask: string,\n): string {\n if (!value) {\n return '';\n }\n\n let result = countryCode;\n\n countryCode = countryCode.replace(/[()]/g, '');\n\n if (!value.startsWith(countryCode)) {\n value = countryCode + value.replace('+', '');\n }\n\n const splitPhoneMask = phoneMask.split('');\n const splitValue = value.slice(countryCode.length).split('');\n\n result += ' ';\n\n if (splitValue.length === 0) {\n return result;\n }\n\n for (let i = 0; i < splitPhoneMask.length; i++) {\n if (splitValue.length === 0) {\n break;\n }\n\n if (splitPhoneMask[i] === '#') {\n result += splitValue[0] || '';\n splitValue.splice(0, 1);\n } else {\n result += splitPhoneMask[i];\n }\n }\n\n return result;\n}\n","import {TuiDecimalSymbol} from '@taiga-ui/core/types';\n\nexport function otherDecimalSymbol(symbol: TuiDecimalSymbol): TuiDecimalSymbol {\n return symbol === '.' ? ',' : '.';\n}\n","import {TuiPluralize} from '@taiga-ui/core/types';\n\n/**\n * Selects the correct plural form to display.\n *\n * @param value the input number\n * @param args an array of three plural forms, e.g. ['год', 'года', 'лет']\n * @deprecated This implementation targets Russian.\n * Use https://angular.io/api/common/NgPlural for your implementations.\n */\nexport function pluralize(value: number, [one, few, many]: TuiPluralize): string {\n const ten = value % 10;\n const hundred = value % 100;\n\n // 1, 21, 101, 121, но не 11, 111, 211...\n if (ten === 1 && hundred !== 11) {\n return one;\n }\n\n // 2, 3, 4, 22, 33, 44, 152, 163, 174, но не 12, 13, 14, 112, 213, 314...\n if (ten >= 2 && ten <= 4 && (hundred < 10 || hundred >= 20)) {\n return few;\n }\n\n return many;\n}\n","import {TuiPluralize} from '@taiga-ui/core/types';\n\n// TODO: remove in 3.0\n\n/**\n * Temporary util for mapping TuiPluralize array to ICU format\n */\nexport function tuiPluralizeToICU(pluralize: TuiPluralize): Record<string, string> {\n return {\n one: pluralize[0],\n few: pluralize[1],\n many: pluralize[2],\n other: pluralize[2],\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;;;;;;;SAOgB,UAAU,CAAC,KAAa;IACpC,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,UAAA,IAAI,IAAI,OAAA,IAAI,CAAC,WAAW,EAAE,GAAA,CAAC,CAAC;AAClF;;SCTgB,qBAAqB,CAAC,KAAa;IAC/C,OAAO,KAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAG,CAAC;AAC/D;;ACFA;;;;;;SAMgB,wBAAwB,CAAC,KAAa;IAClD,IAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,IAAA,yCAAiD,EAAhD,kBAAU,EAAE,eAAo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,CAAC;QACjB,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;QAClB,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;KACtB,CAAC;AACN;;ACdA;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ui/core",
3
- "version": "2.37.0",
3
+ "version": "2.39.0",
4
4
  "description": "Core library for creating Angular components and applications using Taiga UI",
5
5
  "keywords": [
6
6
  "angular",
@@ -16,12 +16,12 @@
16
16
  "homepage": "https://github.com/tinkoff/taiga-ui",
17
17
  "schematics": "./schematics/collection.json",
18
18
  "dependencies": {
19
- "@taiga-ui/i18n": "^2.37.0",
19
+ "@taiga-ui/i18n": "^2.39.0",
20
20
  "tslib": "^1.10.0"
21
21
  },
22
22
  "peerDependencies": {
23
- "@taiga-ui/i18n": ">=2.37.0",
24
- "@taiga-ui/cdk": ">=2.37.0",
23
+ "@taiga-ui/i18n": ">=2.39.0",
24
+ "@taiga-ui/cdk": ">=2.39.0",
25
25
  "@angular/animations": ">=9.0.0",
26
26
  "@angular/common": ">=9.0.0",
27
27
  "@angular/core": ">=9.0.0",
@@ -155,12 +155,12 @@
155
155
  }
156
156
 
157
157
  :host._invalid:not(._focused) &,
158
- :host._invalid:not(._focused)._hovered & {
158
+ :host._invalid:not(._focused):hover & {
159
159
  color: var(--tui-error-fill);
160
160
  }
161
161
 
162
162
  :host[data-mode='onDark']._invalid:not(._focused) &,
163
- :host[data-mode='onDark']._invalid:not(._focused)._hovered & {
163
+ :host[data-mode='onDark']._invalid:not(._focused):hover & {
164
164
  color: var(--tui-error-fill-night);
165
165
  }
166
166
  }
@@ -119,12 +119,12 @@
119
119
  }
120
120
 
121
121
  :host._invalid:not(._focused) &,
122
- :host._invalid:not(._focused)._hovered & {
122
+ :host._invalid:not(._focused):hover & {
123
123
  color: var(--tui-error-fill);
124
124
  }
125
125
 
126
126
  :host[data-mode='onDark']._invalid:not(._focused) &,
127
- :host[data-mode='onDark']._invalid:not(._focused)._hovered & {
127
+ :host[data-mode='onDark']._invalid:not(._focused):hover & {
128
128
  color: var(--tui-error-fill-night);
129
129
  }
130
130
  }
@@ -0,0 +1,57 @@
1
+ .wrapper-hover(@ruleset) {
2
+ &:hover:not(._no-hover),
3
+ &[data-state='hovered'] {
4
+ @ruleset();
5
+ }
6
+ }
7
+
8
+ .wrapper-active(@ruleset) {
9
+ &:active:not(._no-active),
10
+ &[data-state='pressed'],
11
+ &[data-state='pressed']:hover {
12
+ @ruleset();
13
+ }
14
+ }
15
+
16
+ .wrapper-readonly(@ruleset, @native: false) {
17
+ // Specificity artificially increased to match `:hover:not()` level
18
+ & when (@native = true) {
19
+ &:read-only:read-only,
20
+ &[data-state='readonly'][data-state='readonly'] {
21
+ @ruleset();
22
+ }
23
+ }
24
+
25
+ & when (@native = false) {
26
+ &[data-state='readonly'][data-state='readonly'] {
27
+ @ruleset();
28
+ }
29
+ }
30
+ }
31
+
32
+ .wrapper-disabled(@ruleset) {
33
+ // Specificity artificially increased to match `:hover:not()` level
34
+ &:disabled:disabled,
35
+ &[data-state='disabled'][data-state='disabled'] {
36
+ @ruleset();
37
+ }
38
+ }
39
+
40
+ .wrapper-focus(@ruleset) {
41
+ // TODO: Join rules together once all browsers support focus-visible
42
+ // Specificity artificially increased to match `:hover:not()` level
43
+ &:focus-visible:focus-visible {
44
+ @ruleset();
45
+ }
46
+
47
+ &._focused._focused {
48
+ @ruleset();
49
+ }
50
+ }
51
+
52
+ .wrapper-invalid(@ruleset) {
53
+ &:invalid:invalid,
54
+ &._invalid._invalid {
55
+ @ruleset();
56
+ }
57
+ }
@@ -0,0 +1,57 @@
1
+ @mixin wrapper-hover {
2
+ &:hover:not(._no-hover),
3
+ &[data-state='hovered'] {
4
+ @content;
5
+ }
6
+ }
7
+
8
+ @mixin wrapper-active {
9
+ &:active:not(._no-active),
10
+ &[data-state='pressed'],
11
+ &[data-state='pressed']:hover {
12
+ @content;
13
+ }
14
+ }
15
+
16
+ @mixin wrapper-readonly($native: false) {
17
+ // Specificity artificially increased to match `:hover:not()` level
18
+ @if $native == true {
19
+ &:read-only:read-only,
20
+ &[data-state='readonly'][data-state='readonly'] {
21
+ @content;
22
+ }
23
+ }
24
+
25
+ @if $native == false {
26
+ &[data-state='readonly'][data-state='readonly'] {
27
+ @content;
28
+ }
29
+ }
30
+ }
31
+
32
+ @mixin wrapper-disabled {
33
+ // Specificity artificially increased to match `:hover:not()` level
34
+ &:disabled:disabled,
35
+ &[data-state='disabled'][data-state='disabled'] {
36
+ @content;
37
+ }
38
+ }
39
+
40
+ @mixin wrapper-focus {
41
+ // TODO: Join rules together once all browsers support focus-visible
42
+ // Specificity artificially increased to match `:hover:not()` level
43
+ &:focus-visible:focus-visible {
44
+ @content;
45
+ }
46
+
47
+ &._focused._focused {
48
+ @content;
49
+ }
50
+ }
51
+
52
+ @mixin wrapper-invalid {
53
+ &:invalid:invalid,
54
+ &._invalid._invalid {
55
+ @content;
56
+ }
57
+ }
@@ -5,4 +5,5 @@
5
5
  @import 'mixins/slider.less';
6
6
  @import 'mixins/text.less';
7
7
  @import 'mixins/textfield.less';
8
+ @import 'mixins/wrapper.less';
8
9
  @import 'variables/media.less';
@@ -5,4 +5,5 @@ $space: 4px;
5
5
  @import 'mixins/slider.scss';
6
6
  @import 'mixins/text.scss';
7
7
  @import 'mixins/textfield.scss';
8
+ @import 'mixins/wrapper.scss';
8
9
  @import 'variables/media.scss';
@@ -48,7 +48,7 @@
48
48
  --tui-base-09: #000; // icons on inverted background
49
49
  --tui-primary: #526ed3; // primary buttons, background
50
50
  --tui-primary-hover: #6c86e2; // primary buttons hover
51
- --tui-primary-active: #314692; // primary buttons hover
51
+ --tui-primary-active: #314692; // primary buttons pressed
52
52
  --tui-primary-text: #fff; // text on primary background
53
53
  --tui-secondary: #ebefff; // inputs and secondary buttons
54
54
  --tui-secondary-hover: #dfe3f3; // inputs and secondary buttons hover
@@ -1,31 +1,29 @@
1
- tui-wrapper[data-appearance='accent'] {
1
+ @import '../../taiga-ui-local.less';
2
+
3
+ /* stylelint-disable order/order */
4
+ tui-wrapper[data-appearance='accent'],
5
+ [tuiWrapper][data-appearance='accent'] {
2
6
  background: var(--tui-accent);
3
7
  color: var(--tui-accent-text);
4
8
 
5
- &[data-state='hovered'] {
9
+ .wrapper-hover({
6
10
  background: var(--tui-accent-hover);
7
- }
11
+ });
8
12
 
9
- &:active,
10
- &[data-state='pressed'] {
13
+ .wrapper-active({
11
14
  background: var(--tui-accent-active);
12
- }
13
-
14
- &[data-state='disabled'] {
15
- opacity: var(--tui-disabled-opacity);
16
- }
15
+ });
17
16
 
18
- &._invalid {
17
+ .wrapper-invalid({
19
18
  color: var(--tui-negative-night);
20
19
  background: var(--tui-error-bg);
21
20
 
22
- &[data-state='hovered'],
23
- &[data-state='pressed'] {
21
+ .wrapper-hover({
24
22
  background: var(--tui-error-bg-hover);
25
- }
23
+ });
26
24
 
27
- &._focused:after {
28
- color: var(--tui-error-fill);
29
- }
30
- }
25
+ .wrapper-focus({
26
+ --tui-focus: var(--tui-error-fill);
27
+ });
28
+ });
31
29
  }
@@ -0,0 +1,35 @@
1
+ @import '../../taiga-ui-local.less';
2
+
3
+ /* stylelint-disable order/order */
4
+ tui-wrapper,
5
+ [tuiWrapper] {
6
+ .transition(~'color, background');
7
+ position: relative;
8
+ display: block;
9
+ height: 100%;
10
+ width: 100%;
11
+ appearance: none;
12
+ border-radius: inherit;
13
+
14
+ &:after {
15
+ .transition(box-shadow);
16
+ .fullsize(absolute, inset);
17
+ content: '';
18
+ border-radius: inherit;
19
+ border: 1px solid currentColor;
20
+ pointer-events: none;
21
+ color: transparent;
22
+ }
23
+
24
+ .wrapper-focus({
25
+ &:after {
26
+ border-width: 2px;
27
+ color: var(--tui-focus);
28
+ }
29
+ });
30
+
31
+ .wrapper-disabled({
32
+ pointer-events: none;
33
+ opacity: var(--tui-disabled-opacity);
34
+ });
35
+ }
@@ -1,42 +1,32 @@
1
- // TODO: Variables names should not rely on textfield
2
- tui-wrapper[data-appearance='icon'] {
1
+ @import '../../taiga-ui-local.less';
2
+
3
+ /* stylelint-disable order/order */
4
+ tui-wrapper[data-appearance='icon'],
5
+ [tuiWrapper][data-appearance='icon'] {
3
6
  background: transparent;
4
7
  color: var(--tui-base-06);
5
8
 
6
- &[data-state='hovered'] {
7
- color: var(--tui-base-07);
8
- }
9
-
10
- &:active,
11
- &[data-state='pressed'] {
12
- color: var(--tui-base-08);
13
- }
14
-
15
- &[data-state='disabled'] {
16
- opacity: var(--tui-disabled-opacity);
17
- }
18
-
19
9
  &[data-mode='onDark'] {
20
10
  color: var(--tui-text-01-night);
21
11
  opacity: var(--tui-disabled-opacity);
22
12
 
23
- &[data-state='hovered'],
24
- &[data-state='pressed'] {
25
- opacity: 1;
26
- }
27
-
28
- &._focused:after {
29
- color: var(--tui-base-01);
30
- }
13
+ .wrapper-focus({
14
+ --tui-focus: var(--tui-base-01);
15
+ });
31
16
  }
32
17
 
33
18
  &[data-mode='onLight'] {
34
19
  color: var(--tui-text-01);
35
20
  opacity: var(--tui-disabled-opacity);
36
-
37
- &[data-state='hovered'],
38
- &[data-state='pressed'] {
39
- opacity: 1;
40
- }
41
21
  }
22
+
23
+ .wrapper-hover({
24
+ color: var(--tui-base-07);
25
+ opacity: 1;
26
+ });
27
+
28
+ .wrapper-active({
29
+ color: var(--tui-base-08);
30
+ opacity: 1;
31
+ });
42
32
  }