@taiga-ui/addon-commerce 2.31.0 → 2.35.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 (71) hide show
  1. package/bundles/taiga-ui-addon-commerce-components-card.umd.js +2 -2
  2. package/bundles/taiga-ui-addon-commerce-components-card.umd.js.map +1 -1
  3. package/bundles/taiga-ui-addon-commerce-components-card.umd.min.js +1 -1
  4. package/bundles/taiga-ui-addon-commerce-components-card.umd.min.js.map +1 -1
  5. package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.js +18 -7
  6. package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.js.map +1 -1
  7. package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.min.js +2 -2
  8. package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.min.js.map +1 -1
  9. package/bundles/taiga-ui-addon-commerce-components-money.umd.js +33 -11
  10. package/bundles/taiga-ui-addon-commerce-components-money.umd.js.map +1 -1
  11. package/bundles/taiga-ui-addon-commerce-components-money.umd.min.js +1 -1
  12. package/bundles/taiga-ui-addon-commerce-components-money.umd.min.js.map +1 -1
  13. package/bundles/taiga-ui-addon-commerce-enums.umd.js +2 -0
  14. package/bundles/taiga-ui-addon-commerce-enums.umd.js.map +1 -1
  15. package/bundles/taiga-ui-addon-commerce-enums.umd.min.js +1 -1
  16. package/bundles/taiga-ui-addon-commerce-enums.umd.min.js.map +1 -1
  17. package/bundles/taiga-ui-addon-commerce-utils.umd.js +2 -0
  18. package/bundles/taiga-ui-addon-commerce-utils.umd.js.map +1 -1
  19. package/bundles/taiga-ui-addon-commerce-utils.umd.min.js +1 -1
  20. package/bundles/taiga-ui-addon-commerce-utils.umd.min.js.map +1 -1
  21. package/components/card/taiga-ui-addon-commerce-components-card.metadata.json +1 -1
  22. package/components/input-card-grouped/input-card-grouped.component.d.ts +3 -1
  23. package/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.metadata.json +1 -1
  24. package/components/money/index.d.ts +1 -0
  25. package/components/money/money-options.d.ts +14 -0
  26. package/components/money/money.component.d.ts +3 -1
  27. package/components/money/taiga-ui-addon-commerce-components-money.metadata.json +1 -1
  28. package/enums/currency-code.d.ts +2 -1
  29. package/enums/currency.d.ts +2 -1
  30. package/enums/taiga-ui-addon-commerce-enums.metadata.json +1 -1
  31. package/esm2015/components/card/card.component.js +3 -3
  32. package/esm2015/components/input-card-grouped/input-card-grouped.component.js +16 -9
  33. package/esm2015/components/money/index.js +2 -1
  34. package/esm2015/components/money/money-options.js +17 -0
  35. package/esm2015/components/money/money.component.js +16 -12
  36. package/esm2015/enums/currency-code.js +2 -1
  37. package/esm2015/enums/currency.js +2 -1
  38. package/esm2015/types/currency-variants.js +1 -1
  39. package/esm2015/utils/get-currency-symbol.js +3 -1
  40. package/esm5/components/card/card.component.js +3 -3
  41. package/esm5/components/input-card-grouped/input-card-grouped.component.js +20 -9
  42. package/esm5/components/money/index.js +2 -1
  43. package/esm5/components/money/money-options.js +18 -0
  44. package/esm5/components/money/money.component.js +16 -12
  45. package/esm5/enums/currency-code.js +2 -1
  46. package/esm5/enums/currency.js +2 -1
  47. package/esm5/types/currency-variants.js +1 -1
  48. package/esm5/utils/get-currency-symbol.js +3 -1
  49. package/fesm2015/taiga-ui-addon-commerce-components-card.js +2 -2
  50. package/fesm2015/taiga-ui-addon-commerce-components-card.js.map +1 -1
  51. package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js +15 -8
  52. package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js.map +1 -1
  53. package/fesm2015/taiga-ui-addon-commerce-components-money.js +32 -13
  54. package/fesm2015/taiga-ui-addon-commerce-components-money.js.map +1 -1
  55. package/fesm2015/taiga-ui-addon-commerce-enums.js +2 -0
  56. package/fesm2015/taiga-ui-addon-commerce-enums.js.map +1 -1
  57. package/fesm2015/taiga-ui-addon-commerce-utils.js +2 -0
  58. package/fesm2015/taiga-ui-addon-commerce-utils.js.map +1 -1
  59. package/fesm5/taiga-ui-addon-commerce-components-card.js +2 -2
  60. package/fesm5/taiga-ui-addon-commerce-components-card.js.map +1 -1
  61. package/fesm5/taiga-ui-addon-commerce-components-input-card-grouped.js +19 -8
  62. package/fesm5/taiga-ui-addon-commerce-components-input-card-grouped.js.map +1 -1
  63. package/fesm5/taiga-ui-addon-commerce-components-money.js +33 -14
  64. package/fesm5/taiga-ui-addon-commerce-components-money.js.map +1 -1
  65. package/fesm5/taiga-ui-addon-commerce-enums.js +2 -0
  66. package/fesm5/taiga-ui-addon-commerce-enums.js.map +1 -1
  67. package/fesm5/taiga-ui-addon-commerce-utils.js +2 -0
  68. package/fesm5/taiga-ui-addon-commerce-utils.js.map +1 -1
  69. package/package.json +7 -7
  70. package/types/currency-variants.d.ts +2 -1
  71. package/types/taiga-ui-addon-commerce-types.metadata.json +1 -1
@@ -1,20 +1,37 @@
1
1
  import { __decorate, __param } from 'tslib';
2
- import { Inject, Input, HostBinding, Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
2
+ import { InjectionToken, Inject, Input, HostBinding, Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
3
3
  import { CHAR_EN_DASH, tuiDefaultProp } from '@taiga-ui/cdk';
4
4
  import { formatNumber, TUI_NUMBER_FORMAT } from '@taiga-ui/core';
5
5
  import { CommonModule } from '@angular/common';
6
6
  import { TuiCurrencyPipeModule } from '@taiga-ui/addon-commerce/pipes';
7
7
 
8
+ const TUI_MONEY_DEFAULT_DEFAULT_OPTIONS = {
9
+ decimal: 'not-zero',
10
+ currency: "RUB" /* Ruble */,
11
+ sign: 'negative-only',
12
+ colored: false,
13
+ precision: 2,
14
+ singleColor: false,
15
+ };
16
+ const TUI_MONEY_OPTIONS = new InjectionToken('Default parameters for money component', {
17
+ factory: () => TUI_MONEY_DEFAULT_DEFAULT_OPTIONS,
18
+ });
19
+ const tuiMoneyOptionsProvider = (options) => ({
20
+ provide: TUI_MONEY_OPTIONS,
21
+ useValue: Object.assign(Object.assign({}, TUI_MONEY_DEFAULT_DEFAULT_OPTIONS), options),
22
+ });
23
+
8
24
  let TuiMoneyComponent = class TuiMoneyComponent {
9
- constructor(numberFormat) {
25
+ constructor(numberFormat, options) {
10
26
  this.numberFormat = numberFormat;
27
+ this.options = options;
11
28
  this.value = NaN;
12
- this.decimal = 'not-zero';
13
- this.currency = "RUB" /* Ruble */;
14
- this.sign = 'negative-only';
15
- this.colored = false;
16
- this.precision = 2;
17
- this.singleColor = false;
29
+ this.decimal = this.options.decimal;
30
+ this.currency = this.options.currency;
31
+ this.sign = this.options.sign;
32
+ this.colored = this.options.colored;
33
+ this.precision = this.options.precision;
34
+ this.singleColor = this.options.singleColor;
18
35
  }
19
36
  get integerPart() {
20
37
  return formatNumber(Math.floor(Math.abs(this.value)), null, this.numberFormat.decimalSeparator, this.numberFormat.thousandSeparator);
@@ -52,7 +69,8 @@ let TuiMoneyComponent = class TuiMoneyComponent {
52
69
  }
53
70
  };
54
71
  TuiMoneyComponent.ctorParameters = () => [
55
- { type: undefined, decorators: [{ type: Inject, args: [TUI_NUMBER_FORMAT,] }] }
72
+ { type: undefined, decorators: [{ type: Inject, args: [TUI_NUMBER_FORMAT,] }] },
73
+ { type: undefined, decorators: [{ type: Inject, args: [TUI_MONEY_OPTIONS,] }] }
56
74
  ];
57
75
  __decorate([
58
76
  Input(),
@@ -95,10 +113,11 @@ TuiMoneyComponent = __decorate([
95
113
  Component({
96
114
  selector: 'tui-money',
97
115
  changeDetection: ChangeDetectionStrategy.OnPush,
98
- template: "<span automation-id=\"tui-money__sign\">{{ signSymbol }}</span>\n<span automation-id=\"tui-money__integer-part\">{{ integerPart }}</span>\n<span class=\"t-lighter\">\n <span automation-id=\"tui-money__fraction-part\">{{ fractionPart }}</span>\n <span automation-id=\"tui-money__currency\" class=\"t-currency\">\n {{ currency | tuiCurrency }}\n </span>\n</span>\n",
99
- styles: [":host{white-space:nowrap}:host._red{color:var(--tui-negative)}:host._green{color:var(--tui-positive)}:host:not(._inherit-color) .t-lighter{opacity:var(--tui-disabled-opacity)}"]
116
+ template: "<span automation-id=\"tui-money__sign\">{{ signSymbol }}</span>\n<span automation-id=\"tui-money__integer-part\">{{ integerPart }}</span>\n<span class=\"t-lighter\">\n <span automation-id=\"tui-money__fraction-part\">{{ fractionPart }}</span>\n <span\n automation-id=\"tui-money__currency\"\n class=\"t-currency\"\n [textContent]=\"currency | tuiCurrency\"\n ></span>\n</span>\n",
117
+ styles: [":host{white-space:nowrap}:host._red{color:var(--tui-negative)}:host._green{color:var(--tui-positive)}:host:not(._inherit-color) .t-lighter{opacity:var(--tui-disabled-opacity)}.t-currency:not(:empty){padding-left:.2rem}"]
100
118
  }),
101
- __param(0, Inject(TUI_NUMBER_FORMAT))
119
+ __param(0, Inject(TUI_NUMBER_FORMAT)),
120
+ __param(1, Inject(TUI_MONEY_OPTIONS))
102
121
  ], TuiMoneyComponent);
103
122
 
104
123
  let TuiMoneyModule = class TuiMoneyModule {
@@ -115,5 +134,5 @@ TuiMoneyModule = __decorate([
115
134
  * Generated bundle index. Do not edit.
116
135
  */
117
136
 
118
- export { TuiMoneyComponent, TuiMoneyModule };
137
+ export { TUI_MONEY_DEFAULT_DEFAULT_OPTIONS, TUI_MONEY_OPTIONS, TuiMoneyComponent, TuiMoneyModule, tuiMoneyOptionsProvider };
119
138
  //# sourceMappingURL=taiga-ui-addon-commerce-components-money.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-addon-commerce-components-money.js","sources":["ng://@taiga-ui/addon-commerce/components/money/money.component.ts","ng://@taiga-ui/addon-commerce/components/money/money.module.ts","ng://@taiga-ui/addon-commerce/components/money/taiga-ui-addon-commerce-components-money.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n Inject,\n Input,\n} from '@angular/core';\nimport {TuiCurrency} from '@taiga-ui/addon-commerce/enums';\nimport {TuiCurrencyVariants, TuiMoneySignT} from '@taiga-ui/addon-commerce/types';\nimport {CHAR_EN_DASH, tuiDefaultProp} from '@taiga-ui/cdk';\nimport {\n formatNumber,\n NumberFormatSettings,\n TUI_NUMBER_FORMAT,\n TuiDecimalT,\n} from '@taiga-ui/core';\n\n@Component({\n selector: 'tui-money',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './money.template.html',\n styleUrls: ['./money.style.less'],\n})\nexport class TuiMoneyComponent {\n @Input()\n @tuiDefaultProp()\n value = NaN;\n\n @Input()\n @tuiDefaultProp()\n decimal: TuiDecimalT = 'not-zero';\n\n @Input()\n @tuiDefaultProp()\n currency: TuiCurrencyVariants = TuiCurrency.Ruble;\n\n @Input()\n @tuiDefaultProp()\n sign: TuiMoneySignT = 'negative-only';\n\n @Input()\n @tuiDefaultProp()\n colored = false;\n\n @Input()\n @tuiDefaultProp()\n precision = 2;\n\n @Input()\n @tuiDefaultProp()\n singleColor = false;\n\n get integerPart(): string {\n return formatNumber(\n Math.floor(Math.abs(this.value)),\n null,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n }\n\n get fractionPart(): string {\n const {decimal, value} = this;\n const fraction = value.toFixed(this.precision).split('.')[1];\n\n return decimal === 'never' ||\n (parseInt(fraction, 10) === 0 && decimal !== 'always')\n ? ''\n : this.numberFormat.decimalSeparator + fraction;\n }\n\n get signSymbol(): '' | typeof CHAR_EN_DASH | '+' {\n const {sign, value} = this;\n\n if (sign === 'never' || !value || (sign === 'negative-only' && value > 0)) {\n return '';\n }\n\n if (sign === 'force-negative' || (value < 0 && sign !== 'force-positive')) {\n return CHAR_EN_DASH;\n }\n\n return '+';\n }\n\n @HostBinding('class._red')\n get red(): boolean {\n return (\n this.colored &&\n (this.signSymbol === CHAR_EN_DASH ||\n (this.value < 0 && this.sign !== 'force-positive'))\n );\n }\n\n @HostBinding('class._green')\n get green(): boolean {\n return (\n this.colored &&\n (this.signSymbol === '+' ||\n (this.value > 0 && this.sign !== 'force-negative'))\n );\n }\n\n @HostBinding('class._inherit-color')\n get inheritColor(): boolean {\n return this.singleColor || (this.value === 0 && this.colored);\n }\n\n constructor(\n @Inject(TUI_NUMBER_FORMAT)\n private readonly numberFormat: NumberFormatSettings,\n ) {}\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiCurrencyPipeModule} from '@taiga-ui/addon-commerce/pipes';\n\nimport {TuiMoneyComponent} from './money.component';\n\n@NgModule({\n imports: [CommonModule, TuiCurrencyPipeModule],\n declarations: [TuiMoneyComponent],\n exports: [TuiMoneyComponent],\n})\nexport class TuiMoneyModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;IAuBa,iBAAiB,GAA9B,MAAa,iBAAiB;IAqF1B,YAEqB,YAAkC;QAAlC,iBAAY,GAAZ,YAAY,CAAsB;QApFvD,UAAK,GAAG,GAAG,CAAC;QAIZ,YAAO,GAAgB,UAAU,CAAC;QAIlC,aAAQ,qBAA0C;QAIlD,SAAI,GAAkB,eAAe,CAAC;QAItC,YAAO,GAAG,KAAK,CAAC;QAIhB,cAAS,GAAG,CAAC,CAAC;QAId,gBAAW,GAAG,KAAK,CAAC;KA6DhB;IA3DJ,IAAI,WAAW;QACX,OAAO,YAAY,CACf,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAChC,IAAI,EACJ,IAAI,CAAC,YAAY,CAAC,gBAAgB,EAClC,IAAI,CAAC,YAAY,CAAC,iBAAiB,CACtC,CAAC;KACL;IAED,IAAI,YAAY;QACZ,MAAM,EAAC,OAAO,EAAE,KAAK,EAAC,GAAG,IAAI,CAAC;QAC9B,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAE7D,OAAO,OAAO,KAAK,OAAO;aACrB,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,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P,cAAc,EAAE;kDACD;AAIhB;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;oDACH;AAId;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;sDACG;AAoCpB;IADC,WAAW,CAAC,YAAY,CAAC;4CAOzB;AAGD;IADC,WAAW,CAAC,cAAc,CAAC;8CAO3B;AAGD;IADC,WAAW,CAAC,sBAAsB,CAAC;qDAGnC;AAnFQ,iBAAiB;IAN7B,SAAS,CAAC;QACP,QAAQ,EAAE,WAAW;QACrB,eAAe,EAAE,uBAAuB,CAAC,MAAM;QAC/C,sYAAoC;;KAEvC,CAAC;IAuFO,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;GAtFrB,iBAAiB,CAyF7B;;ICrGY,cAAc,GAA3B,MAAa,cAAc;EAAG;AAAjB,cAAc;IAL1B,QAAQ,CAAC;QACN,OAAO,EAAE,CAAC,YAAY,EAAE,qBAAqB,CAAC;QAC9C,YAAY,EAAE,CAAC,iBAAiB,CAAC;QACjC,OAAO,EAAE,CAAC,iBAAiB,CAAC;KAC/B,CAAC;GACW,cAAc,CAAG;;ACX9B;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-addon-commerce-components-money.js","sources":["ng://@taiga-ui/addon-commerce/components/money/money-options.ts","ng://@taiga-ui/addon-commerce/components/money/money.component.ts","ng://@taiga-ui/addon-commerce/components/money/money.module.ts","ng://@taiga-ui/addon-commerce/components/money/taiga-ui-addon-commerce-components-money.ts"],"sourcesContent":["import {InjectionToken, ValueProvider} from '@angular/core';\nimport {TuiCurrency} from '@taiga-ui/addon-commerce/enums';\nimport {TuiCurrencyVariants, TuiMoneySignT} from '@taiga-ui/addon-commerce/types';\nimport {TuiDecimalT} from '@taiga-ui/core';\n\nexport interface TuiMoneyOptions {\n readonly decimal: TuiDecimalT;\n readonly currency: TuiCurrencyVariants;\n readonly sign: TuiMoneySignT;\n readonly colored: boolean;\n readonly precision: number;\n readonly singleColor: boolean;\n}\n\nexport const TUI_MONEY_DEFAULT_DEFAULT_OPTIONS: TuiMoneyOptions = {\n decimal: 'not-zero',\n currency: TuiCurrency.Ruble,\n sign: 'negative-only',\n colored: false,\n precision: 2,\n singleColor: false,\n};\n\nexport const TUI_MONEY_OPTIONS = new InjectionToken<TuiMoneyOptions>(\n 'Default parameters for money component',\n {\n factory: () => TUI_MONEY_DEFAULT_DEFAULT_OPTIONS,\n },\n);\n\nexport const tuiMoneyOptionsProvider: (\n options: Partial<TuiMoneyOptions>,\n) => ValueProvider = (options: Partial<TuiMoneyOptions>) => ({\n provide: TUI_MONEY_OPTIONS,\n useValue: {...TUI_MONEY_DEFAULT_DEFAULT_OPTIONS, ...options},\n});\n","import {\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n Inject,\n Input,\n} from '@angular/core';\nimport {TuiCurrencyVariants, TuiMoneySignT} from '@taiga-ui/addon-commerce/types';\nimport {CHAR_EN_DASH, tuiDefaultProp} from '@taiga-ui/cdk';\nimport {\n formatNumber,\n NumberFormatSettings,\n TUI_NUMBER_FORMAT,\n TuiDecimalT,\n} from '@taiga-ui/core';\n\nimport {TUI_MONEY_OPTIONS, TuiMoneyOptions} from './money-options';\n\n@Component({\n selector: 'tui-money',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './money.template.html',\n styleUrls: ['./money.style.less'],\n})\nexport class TuiMoneyComponent {\n @Input()\n @tuiDefaultProp()\n value = NaN;\n\n @Input()\n @tuiDefaultProp()\n decimal: TuiDecimalT = this.options.decimal;\n\n @Input()\n @tuiDefaultProp()\n currency: TuiCurrencyVariants = this.options.currency;\n\n @Input()\n @tuiDefaultProp()\n sign: TuiMoneySignT = this.options.sign;\n\n @Input()\n @tuiDefaultProp()\n colored = this.options.colored;\n\n @Input()\n @tuiDefaultProp()\n precision = this.options.precision;\n\n @Input()\n @tuiDefaultProp()\n singleColor = this.options.singleColor;\n\n get integerPart(): string {\n return formatNumber(\n Math.floor(Math.abs(this.value)),\n null,\n this.numberFormat.decimalSeparator,\n this.numberFormat.thousandSeparator,\n );\n }\n\n get fractionPart(): string {\n const {decimal, value} = this;\n const fraction = value.toFixed(this.precision).split('.')[1];\n\n return decimal === 'never' ||\n (parseInt(fraction, 10) === 0 && decimal !== 'always')\n ? ''\n : this.numberFormat.decimalSeparator + fraction;\n }\n\n get signSymbol(): '' | typeof CHAR_EN_DASH | '+' {\n const {sign, value} = this;\n\n if (sign === 'never' || !value || (sign === 'negative-only' && value > 0)) {\n return '';\n }\n\n if (sign === 'force-negative' || (value < 0 && sign !== 'force-positive')) {\n return CHAR_EN_DASH;\n }\n\n return '+';\n }\n\n @HostBinding('class._red')\n get red(): boolean {\n return (\n this.colored &&\n (this.signSymbol === CHAR_EN_DASH ||\n (this.value < 0 && this.sign !== 'force-positive'))\n );\n }\n\n @HostBinding('class._green')\n get green(): boolean {\n return (\n this.colored &&\n (this.signSymbol === '+' ||\n (this.value > 0 && this.sign !== 'force-negative'))\n );\n }\n\n @HostBinding('class._inherit-color')\n get inheritColor(): boolean {\n return this.singleColor || (this.value === 0 && this.colored);\n }\n\n constructor(\n @Inject(TUI_NUMBER_FORMAT)\n private readonly numberFormat: NumberFormatSettings,\n @Inject(TUI_MONEY_OPTIONS)\n private readonly options: TuiMoneyOptions,\n ) {}\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiCurrencyPipeModule} from '@taiga-ui/addon-commerce/pipes';\n\nimport {TuiMoneyComponent} from './money.component';\n\n@NgModule({\n imports: [CommonModule, TuiCurrencyPipeModule],\n declarations: [TuiMoneyComponent],\n exports: [TuiMoneyComponent],\n})\nexport class TuiMoneyModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAca,iCAAiC,GAAoB;IAC9D,OAAO,EAAE,UAAU;IACnB,QAAQ;IACR,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,CAAC;IACZ,WAAW,EAAE,KAAK;EACpB;MAEW,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uB;AAIxC;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;kDACc;AAI/B;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;oDACkB;AAInC;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;sDACsB;AAoCvC;IADC,WAAW,CAAC,YAAY,CAAC;4CAOzB;AAGD;IADC,WAAW,CAAC,cAAc,CAAC;8CAO3B;AAGD;IADC,WAAW,CAAC,sBAAsB,CAAC;qDAGnC;AAnFQ,iBAAiB;IAN7B,SAAS,CAAC;QACP,QAAQ,EAAE,WAAW;QACrB,eAAe,EAAE,uBAAuB,CAAC,MAAM;QAC/C,oaAAoC;;KAEvC,CAAC;IAuFO,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;IAEzB,WAAA,MAAM,CAAC,iBAAiB,CAAC,CAAA;GAxFrB,iBAAiB,CA2F7B;;ICxGY,cAAc,GAA3B,MAAa,cAAc;EAAG;AAAjB,cAAc;IAL1B,QAAQ,CAAC;QACN,OAAO,EAAE,CAAC,YAAY,EAAE,qBAAqB,CAAC;QAC9C,YAAY,EAAE,CAAC,iBAAiB,CAAC;QACjC,OAAO,EAAE,CAAC,iBAAiB,CAAC;KAC/B,CAAC;GACW,cAAc,CAAG;;ACX9B;;;;;;"}
@@ -160,6 +160,7 @@ var TuiCurrency;
160
160
  * @description Countries and territories: Ukraine
161
161
  */
162
162
  TuiCurrency["Hryvnia"] = "UAH";
163
+ TuiCurrency["MexicanPeso"] = "MXN";
163
164
  })(TuiCurrency || (TuiCurrency = {}));
164
165
 
165
166
  /**
@@ -324,6 +325,7 @@ var TuiCurrencyCode;
324
325
  * @description Countries and territories: Ukraine
325
326
  */
326
327
  TuiCurrencyCode["Hryvnia"] = "980";
328
+ TuiCurrencyCode["MexicanPeso"] = "484";
327
329
  })(TuiCurrencyCode || (TuiCurrencyCode = {}));
328
330
 
329
331
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-addon-commerce-enums.js","sources":["ng://@taiga-ui/addon-commerce/enums/currency.ts","ng://@taiga-ui/addon-commerce/enums/currency-code.ts","ng://@taiga-ui/addon-commerce/enums/money-sign.ts","ng://@taiga-ui/addon-commerce/enums/payment-system.ts","ng://@taiga-ui/addon-commerce/enums/taiga-ui-addon-commerce-enums.ts"],"sourcesContent":["/**\n * **Active ISO 4217 alphabetic currency codes**\n *\n * @description The ISO 4217 classification is used to describe alphabetic and numeric currency codes.\n * @description Alphabetic code is also called \"alfa-3\".\n *\n * @link https://en.wikipedia.org/wiki/ISO_4217\n */\nexport const enum TuiCurrency {\n /**\n * Russian ruble\n *\n * @description Numeric code: 643\n * @description Alphabetic code: RUB\n * @description Countries and territories: Russia\n */\n Ruble = 'RUB',\n\n /**\n * Euro\n *\n * @description Numeric code: 978\n * @description Alphabetic code: EUR\n * @description Countries and territories: Åland Islands (AX), European Union (EU), Andorra (AD), Austria (AT), Belgium (BE), Cyprus (CY), Estonia (EE), Finland (FI), France (FR), French Southern and Antarctic Lands (TF), Germany (DE), Greece (GR), Guadeloupe (GP), Ireland (IE), Italy (IT), Latvia (LV), Lithuania (LT), Luxembourg (LU), Malta (MT), French Guiana (GF), Martinique (MQ), Mayotte (YT), Monaco (MC), Montenegro (ME), Netherlands (NL), Portugal (PT), Réunion (RE), Saint Barthélemy (BL), Saint Martin (MF), Saint Pierre and Miquelon (PM), San Marino (SM), Slovakia (SK), Slovenia (SI), Spain (ES), Vatican City (VA)\n */\n Euro = 'EUR',\n\n /**\n * United States dollar\n *\n * @description Numeric code: 840\n * @description Alphabetic code: USD\n * @description Countries and territories: United States, American Samoa (AS), British Indian Ocean Territory (IO) (also uses GBP), British Virgin Islands (VG), Caribbean Netherlands (BQ – Bonaire, Sint Eustatius and Saba), Ecuador (EC), El Salvador (SV), Guam (GU), Marshall Islands (MH), Federated States of Micronesia (FM), Northern Mariana Islands (MP), Palau (PW), Panama (PA) (as well as Panamanian Balboa), Puerto Rico (PR), Timor-Leste (TL), Turks and Caicos Islands (TC), U.S. Virgin Islands (VI), United States Minor Outlying Islands (UM)\n */\n Dollar = 'USD',\n\n /**\n * Pound sterling\n *\n * @description Numeric code: 826\n * @description Alphabetic code: GBP\n * @description Countries and territories: United Kingdom, Isle of Man (IM, see Manx pound), Jersey (JE, see Jersey pound), Guernsey (GG, see Guernsey pound), Tristan da Cunha (SH-TA)\n */\n Pound = 'GBP',\n\n /**\n * Thai baht\n *\n * @description Numeric code: 764\n * @description Alphabetic code: THB\n * @description Countries and territories: Thailand\n */\n Baht = 'THB',\n\n /**\n * Turkish lira\n *\n * @description Numeric code: 949\n * @description Alphabetic code: TRY\n * @description Countries and territories: Turkey\n */\n TurkishLira = 'TRY',\n\n /**\n * Chinese yuan\n *\n * @description Numeric code: 156\n * @description Alphabetic code: CNY\n * @description Countries and territories: China\n */\n YuanRenminbi = 'CNY',\n\n /**\n * Kazakhstani tenge\n *\n * @description Numeric code: 398\n * @description Alphabetic code: KZT\n * @description Countries and territories: Kazakhstan\n */\n Tenge = 'KZT',\n\n /**\n * Israeli new shekel\n *\n * @description Numeric code: 376\n * @description Alphabetic code: ILS\n * @description Countries and territories: Israel\n */\n IsraeliShekel = 'ILS',\n\n /**\n * Indian rupee\n *\n * @description Numeric code: 356\n * @description Alphabetic code: INR\n * @description Countries and territories: India, Bhutan\n */\n IndianRupee = 'INR',\n\n /**\n * Japanese yen\n *\n * @description Numeric code: 392\n * @description Alphabetic code: JPY\n * @description Countries and territories: Japan\n */\n Yen = 'JPY',\n\n /**\n * South Korean won\n *\n * @description Numeric code: 410\n * @description Alphabetic code: KRW\n * @description Countries and territories: South Korea\n */\n Won = 'KRW',\n\n /**\n * Swiss franc\n *\n * @description Numeric code: 756\n * @description Alphabetic code: CHF\n * @description Countries and territories: Switzerland, Liechtenstein (LI)\n */\n SwissFranc = 'CHF',\n\n /**\n * Singapore dollar\n *\n * @description Numeric code: 702\n * @description Alphabetic code: SGD\n * @description Countries and territories: Singapore\n */\n SingaporeDollar = 'SGD',\n\n /**\n * Australian dollar\n *\n * @description Numeric code: 036\n * @description Alphabetic code: AUD\n * @description Countries and territories: Australia, Christmas Island (CX), Cocos (Keeling) Islands (CC), Heard Island and McDonald Islands (HM), Kiribati (KI), Nauru (NR), Norfolk Island (NF), Tuvalu (TV)\n */\n AustralianDollar = 'AUD',\n\n /**\n * Hong Kong dollar\n *\n * @description Numeric code: 344\n * @description Alphabetic code: HKD\n * @description Countries and territories: Hong Kong\n */\n HongKong_dollar = 'HKD',\n\n /**\n * Canadian dollar\n *\n * @description Numeric code: 124\n * @description Alphabetic code: CAD\n * @description Countries and territories: Canada\n */\n CanadianDollar = 'CAD',\n\n /**\n * Armenian dram\n *\n * @description Numeric code: 051\n * @description Alphabetic code: AMD\n * @description Countries and territories: Armenia\n */\n ArmenianDram = 'AMD',\n\n /**\n * Ukrainian hryvnia\n *\n * @description Numeric code: 980\n * @description Alphabetic code: UAH\n * @description Countries and territories: Ukraine\n */\n Hryvnia = 'UAH',\n}\n","/**\n * **Active ISO 4217 numeric currency codes**\n *\n * @description The ISO 4217 classification is used to describe alphabetic and numeric currency codes.\n * @description Numeric code is also called \"number-3\".\n *\n * @link https://en.wikipedia.org/wiki/ISO_4217\n */\nexport const enum TuiCurrencyCode {\n /**\n * Russian ruble\n *\n * @description Numeric code: 643\n * @description Alphabetic code: RUB\n * @description Countries and territories: Russia\n */\n Ruble = '643',\n\n /**\n * Euro\n *\n * @description Numeric code: 978\n * @description Alphabetic code: EUR\n * @description Countries and territories: Åland Islands (AX), European Union (EU), Andorra (AD), Austria (AT), Belgium (BE), Cyprus (CY), Estonia (EE), Finland (FI), France (FR), French Southern and Antarctic Lands (TF), Germany (DE), Greece (GR), Guadeloupe (GP), Ireland (IE), Italy (IT), Latvia (LV), Lithuania (LT), Luxembourg (LU), Malta (MT), French Guiana (GF), Martinique (MQ), Mayotte (YT), Monaco (MC), Montenegro (ME), Netherlands (NL), Portugal (PT), Réunion (RE), Saint Barthélemy (BL), Saint Martin (MF), Saint Pierre and Miquelon (PM), San Marino (SM), Slovakia (SK), Slovenia (SI), Spain (ES), Vatican City (VA)\n */\n Euro = '978',\n\n /**\n * United States dollar\n *\n * @description Numeric code: 840\n * @description Alphabetic code: USD\n * @description Countries and territories: United States, American Samoa (AS), British Indian Ocean Territory (IO) (also uses GBP), British Virgin Islands (VG), Caribbean Netherlands (BQ – Bonaire, Sint Eustatius and Saba), Ecuador (EC), El Salvador (SV), Guam (GU), Marshall Islands (MH), Federated States of Micronesia (FM), Northern Mariana Islands (MP), Palau (PW), Panama (PA) (as well as Panamanian Balboa), Puerto Rico (PR), Timor-Leste (TL), Turks and Caicos Islands (TC), U.S. Virgin Islands (VI), United States Minor Outlying Islands (UM)\n */\n Dollar = '840',\n\n /**\n * Pound sterling\n *\n * @description Numeric code: 826\n * @description Alphabetic code: GBP\n * @description Countries and territories: United Kingdom, Isle of Man (IM, see Manx pound), Jersey (JE, see Jersey pound), Guernsey (GG, see Guernsey pound), Tristan da Cunha (SH-TA)\n */\n Pound = '826',\n\n /**\n * Thai baht\n *\n * @description Numeric code: 764\n * @description Alphabetic code: THB\n * @description Countries and territories: Thailand\n */\n Baht = '764',\n\n /**\n * Turkish lira\n *\n * @description Numeric code: 949\n * @description Alphabetic code: TRY\n * @description Countries and territories: Turkey\n */\n TurkishLira = '949',\n\n /**\n * Chinese yuan\n *\n * @description Numeric code: 156\n * @description Alphabetic code: CNY\n * @description Countries and territories: China\n */\n YuanRenminbi = '156',\n\n /**\n * Kazakhstani tenge\n *\n * @description Numeric code: 398\n * @description Alphabetic code: KZT\n * @description Countries and territories: Kazakhstan\n */\n Tenge = '398',\n\n /**\n * Israeli new shekel\n *\n * @description Numeric code: 376\n * @description Alphabetic code: ILS\n * @description Countries and territories: Israel\n */\n IsraeliShekel = '376',\n\n /**\n * Indian rupee\n *\n * @description Numeric code: 356\n * @description Alphabetic code: INR\n * @description Countries and territories: India, Bhutan\n */\n IndianRupee = '356',\n\n /**\n * Japanese yen\n *\n * @description Numeric code: 392\n * @description Alphabetic code: JPY\n * @description Countries and territories: Japan\n */\n Yen = '392',\n\n /**\n * South Korean won\n *\n * @description Numeric code: 410\n * @description Alphabetic code: KRW\n * @description Countries and territories: South Korea\n */\n Won = '410',\n\n /**\n * Swiss franc\n *\n * @description Numeric code: 756\n * @description Alphabetic code: CHF\n * @description Countries and territories: Switzerland, Liechtenstein (LI)\n */\n SwissFranc = '756',\n\n /**\n * Singapore dollar\n *\n * @description Numeric code: 702\n * @description Alphabetic code: SGD\n * @description Countries and territories: Singapore\n */\n SingaporeDollar = '702',\n\n /**\n * Australian dollar\n *\n * @description Numeric code: 036\n * @description Alphabetic code: AUD\n * @description Countries and territories: Australia, Christmas Island (CX), Cocos (Keeling) Islands (CC), Heard Island and McDonald Islands (HM), Kiribati (KI), Nauru (NR), Norfolk Island (NF), Tuvalu (TV)\n */\n AustralianDollar = '036',\n\n /**\n * Hong Kong dollar\n *\n * @description Numeric code: 344\n * @description Alphabetic code: HKD\n * @description Countries and territories: Hong Kong\n */\n HongKong_dollar = '344',\n\n /**\n * Canadian dollar\n *\n * @description Numeric code: 124\n * @description Alphabetic code: CAD\n * @description Countries and territories: Canada\n */\n CanadianDollar = '124',\n\n /**\n * Armenian dram\n *\n * @description Numeric code: 051\n * @description Alphabetic code: AMD\n * @description Countries and territories: Armenia\n */\n ArmenianDram = '051',\n\n /**\n * Ukrainian hryvnia\n *\n * @description Numeric code: 980\n * @description Alphabetic code: UAH\n * @description Countries and territories: Ukraine\n */\n Hryvnia = '980',\n}\n","/**\n * negative-only — show sign only for negative numbers\n * always — always show sign, except for zero\n * never — never show sign\n * force-negative — show minus no matter the number, except for zero\n * force-positive — show plus no matter the number, except for zero\n * @deprecated use join type {@link TuiMoneySignT}\n */\nexport const enum TuiMoneySign {\n NegativeOnly = 'negative-only',\n Always = 'always',\n Never = 'never',\n ForceNegative = 'force-negative',\n ForcePositive = 'force-positive',\n}\n","export const enum TuiPaymentSystem {\n Visa = 'visa',\n Electron = 'electron',\n Mastercard = 'mastercard',\n Maestro = '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CAAoB,CAAA;;;;;;;;IASpB,kCAAe,CAAA;AACnB,CAAC,EA3KiB,eAAe,KAAf,eAAe;;ACRjC;;;;;;;;IAQkB;AAAlB,WAAkB,YAAY;IAC1B,8CAA8B,CAAA;IAC9B,iCAAiB,CAAA;IACjB,+BAAe,CAAA;IACf,gDAAgC,CAAA;IAChC,gDAAgC,CAAA;AACpC,CAAC,EANiB,YAAY,KAAZ,YAAY;;ICRZ;AAAlB,WAAkB,gBAAgB;IAC9B,iCAAa,CAAA;IACb,yCAAqB,CAAA;IACrB,6CAAyB,CAAA;IACzB,uCAAmB,CAAA;IACnB,+BAAW,CAAA;AACf,CAAC,EANiB,gBAAgB,KAAhB,gBAAgB;;ACAlC;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-addon-commerce-enums.js","sources":["ng://@taiga-ui/addon-commerce/enums/currency.ts","ng://@taiga-ui/addon-commerce/enums/currency-code.ts","ng://@taiga-ui/addon-commerce/enums/money-sign.ts","ng://@taiga-ui/addon-commerce/enums/payment-system.ts","ng://@taiga-ui/addon-commerce/enums/taiga-ui-addon-commerce-enums.ts"],"sourcesContent":["/**\n * **Active ISO 4217 alphabetic currency codes**\n *\n * @description The ISO 4217 classification is used to describe alphabetic and numeric currency codes.\n * @description Alphabetic code is also called \"alfa-3\".\n *\n * @link https://en.wikipedia.org/wiki/ISO_4217\n */\nexport const enum TuiCurrency {\n /**\n * Russian ruble\n *\n * @description Numeric code: 643\n * @description Alphabetic code: RUB\n * @description Countries and territories: Russia\n */\n Ruble = 'RUB',\n\n /**\n * Euro\n *\n * @description Numeric code: 978\n * @description Alphabetic code: EUR\n * @description Countries and territories: Åland Islands (AX), European Union (EU), Andorra (AD), Austria (AT), Belgium (BE), Cyprus (CY), Estonia (EE), Finland (FI), France (FR), French Southern and Antarctic Lands (TF), Germany (DE), Greece (GR), Guadeloupe (GP), Ireland (IE), Italy (IT), Latvia (LV), Lithuania (LT), Luxembourg (LU), Malta (MT), French Guiana (GF), Martinique (MQ), Mayotte (YT), Monaco (MC), Montenegro (ME), Netherlands (NL), Portugal (PT), Réunion (RE), Saint Barthélemy (BL), Saint Martin (MF), Saint Pierre and Miquelon (PM), San Marino (SM), Slovakia (SK), Slovenia (SI), Spain (ES), Vatican City (VA)\n */\n Euro = 'EUR',\n\n /**\n * United States dollar\n *\n * @description Numeric code: 840\n * @description Alphabetic code: USD\n * @description Countries and territories: United States, American Samoa (AS), British Indian Ocean Territory (IO) (also uses GBP), British Virgin Islands (VG), Caribbean Netherlands (BQ – Bonaire, Sint Eustatius and Saba), Ecuador (EC), El Salvador (SV), Guam (GU), Marshall Islands (MH), Federated States of Micronesia (FM), Northern Mariana Islands (MP), Palau (PW), Panama (PA) (as well as Panamanian Balboa), Puerto Rico (PR), Timor-Leste (TL), Turks and Caicos Islands (TC), U.S. Virgin Islands (VI), United States Minor Outlying Islands (UM)\n */\n Dollar = 'USD',\n\n /**\n * Pound sterling\n *\n * @description Numeric code: 826\n * @description Alphabetic code: GBP\n * @description Countries and territories: United Kingdom, Isle of Man (IM, see Manx pound), Jersey (JE, see Jersey pound), Guernsey (GG, see Guernsey pound), Tristan da Cunha (SH-TA)\n */\n Pound = 'GBP',\n\n /**\n * Thai baht\n *\n * @description Numeric code: 764\n * @description Alphabetic code: THB\n * @description Countries and territories: Thailand\n */\n Baht = 'THB',\n\n /**\n * Turkish lira\n *\n * @description Numeric code: 949\n * @description Alphabetic code: TRY\n * @description Countries and territories: Turkey\n */\n TurkishLira = 'TRY',\n\n /**\n * Chinese yuan\n *\n * @description Numeric code: 156\n * @description Alphabetic code: CNY\n * @description Countries and territories: China\n */\n YuanRenminbi = 'CNY',\n\n /**\n * Kazakhstani tenge\n *\n * @description Numeric code: 398\n * @description Alphabetic code: KZT\n * @description Countries and territories: Kazakhstan\n */\n Tenge = 'KZT',\n\n /**\n * Israeli new shekel\n *\n * @description Numeric code: 376\n * @description Alphabetic code: ILS\n * @description Countries and territories: Israel\n */\n IsraeliShekel = 'ILS',\n\n /**\n * Indian rupee\n *\n * @description Numeric code: 356\n * @description Alphabetic code: INR\n * @description Countries and territories: India, Bhutan\n */\n IndianRupee = 'INR',\n\n /**\n * Japanese yen\n *\n * @description Numeric code: 392\n * @description Alphabetic code: JPY\n * @description Countries and territories: Japan\n */\n Yen = 'JPY',\n\n /**\n * South Korean won\n *\n * @description Numeric code: 410\n * @description Alphabetic code: KRW\n * @description Countries and territories: South Korea\n */\n Won = 'KRW',\n\n /**\n * Swiss franc\n *\n * @description Numeric code: 756\n * @description Alphabetic code: CHF\n * @description Countries and territories: Switzerland, Liechtenstein (LI)\n */\n SwissFranc = 'CHF',\n\n /**\n * Singapore dollar\n *\n * @description Numeric code: 702\n * @description Alphabetic code: SGD\n * @description Countries and territories: Singapore\n */\n SingaporeDollar = 'SGD',\n\n /**\n * Australian dollar\n *\n * @description Numeric code: 036\n * @description Alphabetic code: AUD\n * @description Countries and territories: Australia, Christmas Island (CX), Cocos (Keeling) Islands (CC), Heard Island and McDonald Islands (HM), Kiribati (KI), Nauru (NR), Norfolk Island (NF), Tuvalu (TV)\n */\n AustralianDollar = 'AUD',\n\n /**\n * Hong Kong dollar\n *\n * @description Numeric code: 344\n * @description Alphabetic code: HKD\n * @description Countries and territories: Hong Kong\n */\n HongKong_dollar = 'HKD',\n\n /**\n * Canadian dollar\n *\n * @description Numeric code: 124\n * @description Alphabetic code: CAD\n * @description Countries and territories: Canada\n */\n CanadianDollar = 'CAD',\n\n /**\n * Armenian dram\n *\n * @description Numeric code: 051\n * @description Alphabetic code: AMD\n * @description Countries and territories: Armenia\n */\n ArmenianDram = 'AMD',\n\n /**\n * Ukrainian hryvnia\n *\n * @description Numeric code: 980\n * @description Alphabetic code: UAH\n * @description Countries and territories: Ukraine\n */\n Hryvnia = 'UAH',\n MexicanPeso = 'MXN',\n}\n","/**\n * **Active ISO 4217 numeric currency codes**\n *\n * @description The ISO 4217 classification is used to describe alphabetic and numeric currency codes.\n * @description Numeric code is also called \"number-3\".\n *\n * @link https://en.wikipedia.org/wiki/ISO_4217\n */\nexport const enum TuiCurrencyCode {\n /**\n * Russian ruble\n *\n * @description Numeric code: 643\n * @description Alphabetic code: RUB\n * @description Countries and territories: Russia\n */\n Ruble = '643',\n\n /**\n * Euro\n *\n * @description Numeric code: 978\n * @description Alphabetic code: EUR\n * @description Countries and territories: Åland Islands (AX), European Union (EU), Andorra (AD), Austria (AT), Belgium (BE), Cyprus (CY), Estonia (EE), Finland (FI), France (FR), French Southern and Antarctic Lands (TF), Germany (DE), Greece (GR), Guadeloupe (GP), Ireland (IE), Italy (IT), Latvia (LV), Lithuania (LT), Luxembourg (LU), Malta (MT), French Guiana (GF), Martinique (MQ), Mayotte (YT), Monaco (MC), Montenegro (ME), Netherlands (NL), Portugal (PT), Réunion (RE), Saint Barthélemy (BL), Saint Martin (MF), Saint Pierre and Miquelon (PM), San Marino (SM), Slovakia (SK), Slovenia (SI), Spain (ES), Vatican City (VA)\n */\n Euro = '978',\n\n /**\n * United States dollar\n *\n * @description Numeric code: 840\n * @description Alphabetic code: USD\n * @description Countries and territories: United States, American Samoa (AS), British Indian Ocean Territory (IO) (also uses GBP), British Virgin Islands (VG), Caribbean Netherlands (BQ – Bonaire, Sint Eustatius and Saba), Ecuador (EC), El Salvador (SV), Guam (GU), Marshall Islands (MH), Federated States of Micronesia (FM), Northern Mariana Islands (MP), Palau (PW), Panama (PA) (as well as Panamanian Balboa), Puerto Rico (PR), Timor-Leste (TL), Turks and Caicos Islands (TC), U.S. Virgin Islands (VI), United States Minor Outlying Islands (UM)\n */\n Dollar = '840',\n\n /**\n * Pound sterling\n *\n * @description Numeric code: 826\n * @description Alphabetic code: GBP\n * @description Countries and territories: United Kingdom, Isle of Man (IM, see Manx pound), Jersey (JE, see Jersey pound), Guernsey (GG, see Guernsey pound), Tristan da Cunha (SH-TA)\n */\n Pound = '826',\n\n /**\n * Thai baht\n *\n * @description Numeric code: 764\n * @description Alphabetic code: THB\n * @description Countries and territories: Thailand\n */\n Baht = '764',\n\n /**\n * Turkish lira\n *\n * @description Numeric code: 949\n * @description Alphabetic code: TRY\n * @description Countries and territories: Turkey\n */\n TurkishLira = '949',\n\n /**\n * Chinese yuan\n *\n * @description Numeric code: 156\n * @description Alphabetic code: CNY\n * @description Countries and territories: China\n */\n YuanRenminbi = '156',\n\n /**\n * Kazakhstani tenge\n *\n * @description Numeric code: 398\n * @description Alphabetic code: KZT\n * @description Countries and territories: Kazakhstan\n */\n Tenge = '398',\n\n /**\n * Israeli new shekel\n *\n * @description Numeric code: 376\n * @description Alphabetic code: ILS\n * @description Countries and territories: Israel\n */\n IsraeliShekel = '376',\n\n /**\n * Indian rupee\n *\n * @description Numeric code: 356\n * @description Alphabetic code: INR\n * @description Countries and territories: India, Bhutan\n */\n IndianRupee = '356',\n\n /**\n * Japanese yen\n *\n * @description Numeric code: 392\n * @description Alphabetic code: JPY\n * @description Countries and territories: Japan\n */\n Yen = '392',\n\n /**\n * South Korean won\n *\n * @description Numeric code: 410\n * @description Alphabetic code: KRW\n * @description Countries and territories: South Korea\n */\n Won = '410',\n\n /**\n * Swiss franc\n *\n * @description Numeric code: 756\n * @description Alphabetic code: CHF\n * @description Countries and territories: Switzerland, Liechtenstein (LI)\n */\n SwissFranc = '756',\n\n /**\n * Singapore dollar\n *\n * @description Numeric code: 702\n * @description Alphabetic code: SGD\n * @description Countries and territories: Singapore\n */\n SingaporeDollar = '702',\n\n /**\n * Australian dollar\n *\n * @description Numeric code: 036\n * @description Alphabetic code: AUD\n * @description Countries and territories: Australia, Christmas Island (CX), Cocos (Keeling) Islands (CC), Heard Island and McDonald Islands (HM), Kiribati (KI), Nauru (NR), Norfolk Island (NF), Tuvalu (TV)\n */\n AustralianDollar = '036',\n\n /**\n * Hong Kong dollar\n *\n * @description Numeric code: 344\n * @description Alphabetic code: HKD\n * @description Countries and territories: Hong Kong\n */\n HongKong_dollar = '344',\n\n /**\n * Canadian dollar\n *\n * @description Numeric code: 124\n * @description Alphabetic code: CAD\n * @description Countries and territories: Canada\n */\n CanadianDollar = '124',\n\n /**\n * Armenian dram\n *\n * @description Numeric code: 051\n * @description Alphabetic code: AMD\n * @description Countries and territories: Armenia\n */\n ArmenianDram = '051',\n\n /**\n * Ukrainian hryvnia\n *\n * @description Numeric code: 980\n * @description Alphabetic code: UAH\n * @description Countries and territories: Ukraine\n */\n Hryvnia = '980',\n MexicanPeso = '484',\n}\n","/**\n * negative-only — show sign only for negative numbers\n * always — always show sign, except for zero\n * never — never show sign\n * force-negative — show minus no matter the number, except for zero\n * force-positive — show plus no matter the number, except for zero\n * @deprecated use join type {@link TuiMoneySignT}\n */\nexport const enum TuiMoneySign {\n NegativeOnly = 'negative-only',\n Always = 'always',\n Never = 'never',\n ForceNegative = 'force-negative',\n ForcePositive = 'force-positive',\n}\n","export const enum TuiPaymentSystem {\n Visa = 'visa',\n Electron = 'electron',\n Mastercard = 'mastercard',\n Maestro = 'maestro',\n Mir = 'mir',\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAA;;;;;;;;IAQkB;AAAlB,WAAkB,WAAW;;;;;;;;IAQzB,4BAAa,CAAA;;;;;;;;IASb,2BAAY,CAAA;;;;;;;;IASZ,6BAAc,CAAA;;;;;;;;IASd,4BAAa,CAAA;;;;;;;;IASb,2BAAY,CAAA;;;;;;;;IASZ,kCAAmB,CAAA;;;;;;;;IASnB,mCAAoB,CAAA;;;;;;;;IASpB,4BAAa,CAAA;;;;;;;;IASb,oCAAqB,CAAA;;;;;;;;IASrB,kCAAmB,CAAA;;;;;;;;IASnB,0BAAW,CAAA;;;;;;;;IASX,0BAAW,CAAA;;;;;;;;IASX,iCAAkB,CAAA;;;;;;;;IASlB,sCAAuB,CAAA;;;;;;;;IASvB,uCAAwB,CAAA;;;;;;;;IASxB,sCAAuB,CAAA;;;;;;;;IASvB,qCAAsB,CAAA;;;;;;;;IAStB,mCAAoB,CAAA;;;;;;;;IASpB,8BAAe,CAAA;IACf,kCAAmB,CAAA;AACvB,CAAC,EA5KiB,WAAW,KAAX,WAAW;;ACR7B;;;;;;;;IAQkB;AAAlB,WAAkB,eAAe;;;;;;;;IAQ7B,gCAAa,CAAA;;;;;;;;IASb,+BAAY,CAAA;;;;;;;;IASZ,iCAAc,CAAA;;;;;;;;IASd,gCAAa,CAAA;;;;;;;;IASb,+BAAY,CAAA;;;;;;;;IASZ,sCAAmB,CAAA;;;;;;;;IASnB,uCAAoB,CAAA;;;;;;;;IASpB,gCAAa,CAAA;;;;;;;;IASb,wCAAqB,CAAA;;;;;;;;IASrB,sCAAmB,CAAA;;;;;;;;IASnB,8BAAW,CAAA;;;;;;;;IASX,8BAAW,CAAA;;;;;;;;IASX,qCAAkB,CAAA;;;;;;;;IASlB,0CAAuB,CAAA;;;;;;;;IASvB,2CAAwB,CAAA;;;;;;;;IASxB,0CAAuB,CAAA;;;;;;;;IASvB,yCAAsB,CAAA;;;;;;;;IAStB,uCAAoB,CAAA;;;;;;;;IASpB,kCAAe,CAAA;IACf,sCAAmB,CAAA;AACvB,CAAC,EA5KiB,eAAe,KAAf,eAAe;;ACRjC;;;;;;;;IAQkB;AAAlB,WAAkB,YAAY;IAC1B,8CAA8B,CAAA;IAC9B,iCAAiB,CAAA;IACjB,+BAAe,CAAA;IACf,gDAAgC,CAAA;IAChC,gDAAgC,CAAA;AACpC,CAAC,EANiB,YAAY,KAAZ,YAAY;;ICRZ;AAAlB,WAAkB,gBAAgB;IAC9B,iCAAa,CAAA;IACb,yCAAqB,CAAA;IACrB,6CAAyB,CAAA;IACzB,uCAAmB,CAAA;IACnB,+BAAW,CAAA;AACf,CAAC,EANiB,gBAAgB,KAAhB,gBAAgB;;ACAlC;;;;;;"}
@@ -46,6 +46,8 @@ function getCurrencySymbol(currency) {
46
46
  return '₽';
47
47
  case "USD" /* Dollar */:
48
48
  case "840" /* Dollar */:
49
+ case "MXN" /* MexicanPeso */:
50
+ case "484" /* MexicanPeso */:
49
51
  return '$';
50
52
  case "SGD" /* SingaporeDollar */:
51
53
  case "702" /* SingaporeDollar */:
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-addon-commerce-utils.js","sources":["ng://@taiga-ui/addon-commerce/utils/create-auto-corrected-expire-pipe.ts","ng://@taiga-ui/addon-commerce/utils/get-currency-symbol.ts","ng://@taiga-ui/addon-commerce/utils/format-currency.ts","ng://@taiga-ui/addon-commerce/utils/get-payment-system.ts","ng://@taiga-ui/addon-commerce/utils/is-card-length-valid.ts","ng://@taiga-ui/addon-commerce/utils/is-card-number-valid.ts","ng://@taiga-ui/addon-commerce/utils/is-expire-valid.ts","ng://@taiga-ui/addon-commerce/utils/taiga-ui-addon-commerce-utils.ts"],"sourcesContent":["import {TUI_NON_DIGIT_REGEXP, TuiTextMaskPipeHandler} from '@taiga-ui/core';\n\nconst TUI_EXP_YEAR_MONTH = /^\\d{2}[/|.]\\d{4}$/;\nconst TUI_EXP_SAFARI = /^\\d{1,4}.\\d{1,2}.\\d{1,4}$/;\n\n/**\n * Correct expiration date text allowing only valid months\n * @internal\n *\n * @returns MM/YY\n */\nexport function tuiCreateAutoCorrectedExpirePipe(): TuiTextMaskPipeHandler {\n return (conformedValue, {rawValue}) => {\n // Autofilled with MM/YYYY format\n if (TUI_EXP_YEAR_MONTH.test(rawValue)) {\n conformedValue = rawValue.substr(0, 2) + '/' + rawValue.substr(5);\n }\n\n // Autofilled with Safari crazy format\n if (\n rawValue.length > 7 &&\n rawValue.length < 11 &&\n TUI_EXP_SAFARI.test(rawValue)\n ) {\n const array = rawValue.split(TUI_NON_DIGIT_REGEXP);\n const month = array[1];\n const year = array.find(({length}) => length === 4);\n\n conformedValue = `${'0'.repeat(2 - month.length)}${month}/${\n year ? year.substr(2) : ''\n }`;\n }\n\n const indexesOfPipedChars: number[] = [];\n const conformedValueArr = conformedValue.split('');\n\n if (parseInt(conformedValueArr[0], 10) > 1) {\n conformedValueArr[2] = '/';\n conformedValueArr[1] = conformedValueArr[0];\n conformedValueArr[0] = '0';\n indexesOfPipedChars.push(0);\n }\n\n return {\n value: conformedValueArr.join(''),\n indexesOfPipedChars,\n };\n };\n}\n","import {TuiCurrency, TuiCurrencyCode} from '@taiga-ui/addon-commerce/enums';\nimport {TuiCurrencyVariants} from '@taiga-ui/addon-commerce/types';\n\nexport function getCurrencySymbol(currency: TuiCurrencyVariants): string | null {\n switch (currency) {\n case TuiCurrency.Ruble:\n case TuiCurrencyCode.Ruble:\n return '₽';\n case TuiCurrency.Dollar:\n case TuiCurrencyCode.Dollar:\n return '$';\n case TuiCurrency.SingaporeDollar:\n case TuiCurrencyCode.SingaporeDollar:\n return 'S$';\n case TuiCurrency.AustralianDollar:\n case TuiCurrencyCode.AustralianDollar:\n return 'A$';\n case TuiCurrency.HongKong_dollar:\n case TuiCurrencyCode.HongKong_dollar:\n return 'HK$';\n case TuiCurrency.CanadianDollar:\n case TuiCurrencyCode.CanadianDollar:\n return 'C$';\n case TuiCurrency.Euro:\n case TuiCurrencyCode.Euro:\n return '€';\n case TuiCurrency.Pound:\n case TuiCurrencyCode.Pound:\n return '£';\n case TuiCurrency.Baht:\n case TuiCurrencyCode.Baht:\n return '฿';\n case TuiCurrency.TurkishLira:\n case TuiCurrencyCode.TurkishLira:\n return '₺';\n case TuiCurrency.YuanRenminbi:\n case TuiCurrencyCode.YuanRenminbi:\n return 'CN¥';\n case TuiCurrency.Yen:\n case TuiCurrencyCode.Yen:\n return '¥';\n case TuiCurrency.IsraeliShekel:\n case TuiCurrencyCode.IsraeliShekel:\n return '₪';\n case TuiCurrency.IndianRupee:\n case TuiCurrencyCode.IndianRupee:\n return '₹';\n case TuiCurrency.SwissFranc:\n case TuiCurrencyCode.SwissFranc:\n return '₣';\n case TuiCurrency.ArmenianDram:\n case TuiCurrencyCode.ArmenianDram:\n return '֏';\n case TuiCurrency.Won:\n case TuiCurrencyCode.Won:\n return '₩';\n case TuiCurrency.Tenge:\n case TuiCurrencyCode.Tenge:\n return '₸';\n case TuiCurrency.Hryvnia:\n case TuiCurrencyCode.Hryvnia:\n return '₴';\n default:\n return null;\n }\n}\n","import {TuiCurrencyVariants} from '@taiga-ui/addon-commerce/types';\nimport {padStart} from '@taiga-ui/cdk';\n\nimport {getCurrencySymbol} from './get-currency-symbol';\n\nexport function formatCurrency(currency: TuiCurrencyVariants): string {\n const stringifiedCurrency = stringifyCurrency(currency);\n\n return getCurrencySymbol(stringifiedCurrency) || stringifiedCurrency;\n}\n\nfunction stringifyCurrency(currency: TuiCurrencyVariants): string {\n return currency === null || typeof currency === 'string'\n ? currency || ''\n : padStart(String(currency), 3, '0');\n}\n","import {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\n\nexport function getPaymentSystem(cardNumber: string): TuiPaymentSystem | null {\n if (cardNumber === '') {\n return null;\n }\n\n const one = Number.parseInt(cardNumber[0], 10);\n const two = Number.parseInt(cardNumber.substr(0, 2), 10);\n const three = Number.parseInt(cardNumber.substr(0, 3), 10);\n const four = Number.parseInt(cardNumber.substr(0, 4), 10);\n\n if (isMaestro(three, two, one)) {\n return TuiPaymentSystem.Maestro;\n }\n\n if (isMastercard(four, two, one)) {\n return TuiPaymentSystem.Mastercard;\n }\n\n if (isMir(four)) {\n return TuiPaymentSystem.Mir;\n }\n\n if (isElectron(four)) {\n return TuiPaymentSystem.Electron;\n }\n\n if (isVisa(one)) {\n return TuiPaymentSystem.Visa;\n }\n\n return null;\n}\n\nexport function isMaestro(three: number, two: number, one: number): boolean {\n if (one === 6) {\n return true;\n }\n\n if (two === 50 || (two > 55 && two < 59)) {\n return true;\n }\n\n if (three < 500) {\n return false;\n }\n\n return three < 510;\n}\n\nexport function isMastercard(four: number, two: number, one: number): boolean {\n if (one === 5) {\n return true;\n }\n\n if (two < 10) {\n return false;\n }\n\n if (two > 50 && two < 56) {\n return true;\n }\n\n if (four < 1000) {\n return false;\n }\n\n return four > 2220 && four < 2721;\n}\n\nexport function isMir(four: number): boolean {\n return four > 2199 && four < 2205;\n}\n\nexport function isElectron(four: number): boolean {\n switch (four) {\n case 4026:\n case 4175:\n case 4405:\n case 4508:\n case 4844:\n case 4913:\n case 4917:\n return true;\n default:\n return false;\n }\n}\n\nexport function isVisa(one: number): boolean {\n return one === 4;\n}\n","import {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\n\nimport {getPaymentSystem} from './get-payment-system';\n\n/**\n * Validates card number length using payment system dictionary\n */\nexport function isCardLengthValid(cardNumber: string): boolean {\n const {length} = cardNumber;\n const paymentSystem = getPaymentSystem(cardNumber);\n\n switch (paymentSystem) {\n case TuiPaymentSystem.Electron:\n return length === 16;\n case TuiPaymentSystem.Maestro:\n return length > 11 && length < 20;\n case TuiPaymentSystem.Mastercard:\n case TuiPaymentSystem.Mir:\n return length > 15 && length < 20;\n case TuiPaymentSystem.Visa:\n return length > 12 && length < 20;\n default:\n return length > 8 && length < 20;\n }\n}\n","import {TUI_NON_DIGITS_REGEXP} from '@taiga-ui/core';\n\n/**\n * Validates card number using Luhn algorithm\n */\nexport function isCardNumberValid(value: string | number): boolean {\n const cardNumber = String(value).replace(TUI_NON_DIGITS_REGEXP, '');\n\n const {length} = cardNumber;\n const arr = cardNumber.split('').map((char, index) => {\n const digit = parseInt(char, 10);\n\n if ((index + length) % 2 === 0) {\n const digitX2 = digit * 2;\n\n return digitX2 > 9 ? digitX2 - 9 : digitX2;\n }\n\n return digit;\n });\n\n return !(arr.reduce((a, b) => a + b, 0) % 10);\n}\n","export function isExpireValid(expire: string): boolean {\n const today = new Date();\n const currentMonth = today.getMonth();\n const currentYear = today.getFullYear() - 2000;\n const month = parseInt(expire.slice(0, 2), 0);\n const year = parseInt(expire.slice(-2), 0);\n\n return year > currentYear || (year === currentYear && month >= currentMonth);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAC/C,MAAM,cAAc,GAAG,2BAA2B,CAAC;AAEnD;;;;;;SAMgB,gCAAgC;IAC5C,OAAO,CAAC,cAAc,EAAE,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MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9C,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAE3C,OAAO,IAAI,GAAG,WAAW,KAAK,IAAI,KAAK,WAAW,IAAI,KAAK,IAAI,YAAY,CAAC,CAAC;AACjF;;ACRA;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-addon-commerce-utils.js","sources":["ng://@taiga-ui/addon-commerce/utils/create-auto-corrected-expire-pipe.ts","ng://@taiga-ui/addon-commerce/utils/get-currency-symbol.ts","ng://@taiga-ui/addon-commerce/utils/format-currency.ts","ng://@taiga-ui/addon-commerce/utils/get-payment-system.ts","ng://@taiga-ui/addon-commerce/utils/is-card-length-valid.ts","ng://@taiga-ui/addon-commerce/utils/is-card-number-valid.ts","ng://@taiga-ui/addon-commerce/utils/is-expire-valid.ts","ng://@taiga-ui/addon-commerce/utils/taiga-ui-addon-commerce-utils.ts"],"sourcesContent":["import {TUI_NON_DIGIT_REGEXP, TuiTextMaskPipeHandler} from '@taiga-ui/core';\n\nconst TUI_EXP_YEAR_MONTH = /^\\d{2}[/|.]\\d{4}$/;\nconst TUI_EXP_SAFARI = /^\\d{1,4}.\\d{1,2}.\\d{1,4}$/;\n\n/**\n * Correct expiration date text allowing only valid months\n * @internal\n *\n * @returns MM/YY\n */\nexport function tuiCreateAutoCorrectedExpirePipe(): TuiTextMaskPipeHandler {\n return (conformedValue, {rawValue}) => {\n // Autofilled with MM/YYYY format\n if (TUI_EXP_YEAR_MONTH.test(rawValue)) {\n conformedValue = rawValue.substr(0, 2) + '/' + rawValue.substr(5);\n }\n\n // Autofilled with Safari crazy format\n if (\n rawValue.length > 7 &&\n rawValue.length < 11 &&\n TUI_EXP_SAFARI.test(rawValue)\n ) {\n const array = rawValue.split(TUI_NON_DIGIT_REGEXP);\n const month = array[1];\n const year = array.find(({length}) => length === 4);\n\n conformedValue = `${'0'.repeat(2 - month.length)}${month}/${\n year ? year.substr(2) : ''\n }`;\n }\n\n const indexesOfPipedChars: number[] = [];\n const conformedValueArr = conformedValue.split('');\n\n if (parseInt(conformedValueArr[0], 10) > 1) {\n conformedValueArr[2] = '/';\n conformedValueArr[1] = conformedValueArr[0];\n conformedValueArr[0] = '0';\n indexesOfPipedChars.push(0);\n }\n\n return {\n value: conformedValueArr.join(''),\n indexesOfPipedChars,\n };\n };\n}\n","import {TuiCurrency, TuiCurrencyCode} from '@taiga-ui/addon-commerce/enums';\nimport {TuiCurrencyVariants} from '@taiga-ui/addon-commerce/types';\n\nexport function getCurrencySymbol(currency: TuiCurrencyVariants): string | null {\n switch (currency) {\n case TuiCurrency.Ruble:\n case TuiCurrencyCode.Ruble:\n return '₽';\n case TuiCurrency.Dollar:\n case TuiCurrencyCode.Dollar:\n case TuiCurrency.MexicanPeso:\n case TuiCurrencyCode.MexicanPeso:\n return '$';\n case TuiCurrency.SingaporeDollar:\n case TuiCurrencyCode.SingaporeDollar:\n return 'S$';\n case TuiCurrency.AustralianDollar:\n case TuiCurrencyCode.AustralianDollar:\n return 'A$';\n case TuiCurrency.HongKong_dollar:\n case TuiCurrencyCode.HongKong_dollar:\n return 'HK$';\n case TuiCurrency.CanadianDollar:\n case TuiCurrencyCode.CanadianDollar:\n return 'C$';\n case TuiCurrency.Euro:\n case TuiCurrencyCode.Euro:\n return '€';\n case TuiCurrency.Pound:\n case TuiCurrencyCode.Pound:\n return '£';\n case TuiCurrency.Baht:\n case TuiCurrencyCode.Baht:\n return '฿';\n case TuiCurrency.TurkishLira:\n case TuiCurrencyCode.TurkishLira:\n return '₺';\n case TuiCurrency.YuanRenminbi:\n case TuiCurrencyCode.YuanRenminbi:\n return 'CN¥';\n case TuiCurrency.Yen:\n case TuiCurrencyCode.Yen:\n return '¥';\n case TuiCurrency.IsraeliShekel:\n case TuiCurrencyCode.IsraeliShekel:\n return '₪';\n case TuiCurrency.IndianRupee:\n case TuiCurrencyCode.IndianRupee:\n return '₹';\n case TuiCurrency.SwissFranc:\n case TuiCurrencyCode.SwissFranc:\n return '₣';\n case TuiCurrency.ArmenianDram:\n case TuiCurrencyCode.ArmenianDram:\n return '֏';\n case TuiCurrency.Won:\n case TuiCurrencyCode.Won:\n return '₩';\n case TuiCurrency.Tenge:\n case TuiCurrencyCode.Tenge:\n return '₸';\n case TuiCurrency.Hryvnia:\n case TuiCurrencyCode.Hryvnia:\n return '₴';\n default:\n return null;\n }\n}\n","import {TuiCurrencyVariants} from '@taiga-ui/addon-commerce/types';\nimport {padStart} from '@taiga-ui/cdk';\n\nimport {getCurrencySymbol} from './get-currency-symbol';\n\nexport function formatCurrency(currency: TuiCurrencyVariants): string {\n const stringifiedCurrency = stringifyCurrency(currency);\n\n return getCurrencySymbol(stringifiedCurrency) || stringifiedCurrency;\n}\n\nfunction stringifyCurrency(currency: TuiCurrencyVariants): string {\n return currency === null || typeof currency === 'string'\n ? currency || ''\n : padStart(String(currency), 3, '0');\n}\n","import {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\n\nexport function getPaymentSystem(cardNumber: string): TuiPaymentSystem | null {\n if (cardNumber === '') {\n return null;\n }\n\n const one = Number.parseInt(cardNumber[0], 10);\n const two = Number.parseInt(cardNumber.substr(0, 2), 10);\n const three = Number.parseInt(cardNumber.substr(0, 3), 10);\n const four = Number.parseInt(cardNumber.substr(0, 4), 10);\n\n if (isMaestro(three, two, one)) {\n return TuiPaymentSystem.Maestro;\n }\n\n if (isMastercard(four, two, one)) {\n return TuiPaymentSystem.Mastercard;\n }\n\n if (isMir(four)) {\n return TuiPaymentSystem.Mir;\n }\n\n if (isElectron(four)) {\n return TuiPaymentSystem.Electron;\n }\n\n if (isVisa(one)) {\n return TuiPaymentSystem.Visa;\n }\n\n return null;\n}\n\nexport function isMaestro(three: number, two: number, one: number): boolean {\n if (one === 6) {\n return true;\n }\n\n if (two === 50 || (two > 55 && two < 59)) {\n return true;\n }\n\n if (three < 500) {\n return false;\n }\n\n return three < 510;\n}\n\nexport function isMastercard(four: number, two: number, one: number): boolean {\n if (one === 5) {\n return true;\n }\n\n if (two < 10) {\n return false;\n }\n\n if (two > 50 && two < 56) {\n return true;\n }\n\n if (four < 1000) {\n return false;\n }\n\n return four > 2220 && four < 2721;\n}\n\nexport function isMir(four: number): boolean {\n return four > 2199 && four < 2205;\n}\n\nexport function isElectron(four: number): boolean {\n switch (four) {\n case 4026:\n case 4175:\n case 4405:\n case 4508:\n case 4844:\n case 4913:\n case 4917:\n return true;\n default:\n return false;\n }\n}\n\nexport function isVisa(one: number): boolean {\n return one === 4;\n}\n","import {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\n\nimport {getPaymentSystem} from './get-payment-system';\n\n/**\n * Validates card number length using payment system dictionary\n */\nexport function isCardLengthValid(cardNumber: string): boolean {\n const {length} = cardNumber;\n const paymentSystem = getPaymentSystem(cardNumber);\n\n switch (paymentSystem) {\n case TuiPaymentSystem.Electron:\n return length === 16;\n case TuiPaymentSystem.Maestro:\n return length > 11 && length < 20;\n case TuiPaymentSystem.Mastercard:\n case TuiPaymentSystem.Mir:\n return length > 15 && length < 20;\n case TuiPaymentSystem.Visa:\n return length > 12 && length < 20;\n default:\n return length > 8 && length < 20;\n }\n}\n","import {TUI_NON_DIGITS_REGEXP} from '@taiga-ui/core';\n\n/**\n * Validates card number using Luhn algorithm\n */\nexport function isCardNumberValid(value: string | number): boolean {\n const cardNumber = String(value).replace(TUI_NON_DIGITS_REGEXP, '');\n\n const {length} = cardNumber;\n const arr = cardNumber.split('').map((char, index) => {\n const digit = parseInt(char, 10);\n\n if ((index + length) % 2 === 0) {\n const digitX2 = digit * 2;\n\n return digitX2 > 9 ? digitX2 - 9 : digitX2;\n }\n\n return digit;\n });\n\n return !(arr.reduce((a, b) => a + b, 0) % 10);\n}\n","export function isExpireValid(expire: string): boolean {\n const today = new Date();\n const currentMonth = today.getMonth();\n const currentYear = today.getFullYear() - 2000;\n const month = parseInt(expire.slice(0, 2), 0);\n const year = parseInt(expire.slice(-2), 0);\n\n return year > currentYear || (year === currentYear && month >= currentMonth);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAC/C,MAAM,cAAc,GAAG,2BAA2B,CAAC;AAEnD;;;;;;SAMgB,gCAAgC;IAC5C,OAAO,CAAC,cAAc,EAAE,EAAC,QAAQ,EAAC;;QAE9B,IAAI,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YACnC,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;SACrE;;QAGD,IACI,QAAQ,CAAC,MAAM,GAAG,CAAC;YACnB,QAAQ,CAAC,MAAM,GAAG,EAAE;YACpB,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,EAC/B;YACE,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;YACnD,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACvB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,EAAC,MAAM,EAAC,KAAK,MAAM,KAAK,CAAC,CAAC,CAAC;YAEpD,cAAc,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,IACpD,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAC5B,EAAE,CAAC;SACN;QAED,MAAM,mBAAmB,GAAa,EAAE,CAAC;QACzC,MAAM,iBAAiB,GAAG,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAEnD,IAAI,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,EAAE,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C,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;AAClD;;SCtBgB,aAAa,CAAC,MAAc;IACxC,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;IACzB,MAAM,YAAY,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;IACtC,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC;IAC/C,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9C,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAE3C,OAAO,IAAI,GAAG,WAAW,KAAK,IAAI,KAAK,WAAW,IAAI,KAAK,IAAI,YAAY,CAAC,CAAC;AACjF;;ACRA;;;;;;"}
@@ -58,7 +58,7 @@ var TuiCardComponent = /** @class */ (function () {
58
58
  ], TuiCardComponent.prototype, "paymentSystem", void 0);
59
59
  __decorate([
60
60
  Input(),
61
- HostBinding('attr.data-tui-host-size'),
61
+ HostBinding('attr.data-size'),
62
62
  tuiDefaultProp()
63
63
  ], TuiCardComponent.prototype, "size", void 0);
64
64
  TuiCardComponent = __decorate([
@@ -66,7 +66,7 @@ var TuiCardComponent = /** @class */ (function () {
66
66
  selector: 'tui-card',
67
67
  template: "<div class=\"t-front\">\n <tui-svg\n *ngIf=\"hasBrandLogo\"\n class=\"t-brand-logo\"\n [src]=\"brandLogo\"\n ></tui-svg>\n <span class=\"t-number\">{{ cardNumber }}</span>\n <tui-svg\n *ngIf=\"!!paymentSystem\"\n class=\"t-payment-system-logo\"\n [src]=\"paymentSystemLogo\"\n ></tui-svg>\n</div>\n<div class=\"t-back\"></div>\n",
68
68
  changeDetection: ChangeDetectionStrategy.OnPush,
69
- styles: [":host{position:relative;display:block;color:var(--tui-base-01);transform-style:preserve-3d;cursor:default;border-radius:var(--tui-radius-xs);background-size:100%}:host[data-tui-host-size='s']{width:2rem;height:1.5rem}:host[data-tui-host-size='m']{width:3rem;height:2rem}:host._active{box-shadow:0 0 0 1px var(--tui-base-01)}.t-front{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-backface-visibility:hidden;backface-visibility:hidden}.t-brand-logo{position:absolute;top:.1875rem;left:.125rem;height:.875rem;width:.875rem}.t-number{position:absolute;right:.25rem;display:flex;justify-content:center;align-items:center}:host[data-tui-host-size='s'] .t-number{top:.125rem;height:.625rem;width:1.1875rem;font-size:.5rem}:host[data-tui-host-size='m'] .t-number{top:.1875rem;height:.875rem;width:1.5rem;font-size:.625rem}.t-payment-system-logo{position:absolute;right:.25rem;bottom:-.5rem;width:2rem;height:2rem;transform:scale(.5);transform-origin:right}.t-back{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-backface-visibility:hidden;backface-visibility:hidden;transform:rotateY(180deg) translate3d(0,0,1px);background-color:var(--tui-base-05);border-radius:var(--tui-radius-xs)}.t-back:after{content:'';position:absolute;top:20%;left:0;right:0;height:20%;background-color:var(--tui-base-06)}"]
69
+ styles: [":host{position:relative;display:block;color:var(--tui-base-01);transform-style:preserve-3d;cursor:default;border-radius:var(--tui-radius-xs);background-size:100%}:host[data-size='s']{width:2rem;height:1.5rem}:host[data-size='m']{width:3rem;height:2rem}:host._active{box-shadow:0 0 0 1px var(--tui-base-01)}.t-front{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-backface-visibility:hidden;backface-visibility:hidden}.t-brand-logo{position:absolute;top:.1875rem;left:.125rem;height:.875rem;width:.875rem}.t-number{position:absolute;right:.25rem;display:flex;justify-content:center;align-items:center}:host[data-size='s'] .t-number{top:.125rem;height:.625rem;width:1.1875rem;font-size:.5rem}:host[data-size='m'] .t-number{top:.1875rem;height:.875rem;width:1.5rem;font-size:.625rem}.t-payment-system-logo{position:absolute;right:.25rem;bottom:-.5rem;width:2rem;height:2rem;transform:scale(.5);transform-origin:right}.t-back{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-backface-visibility:hidden;backface-visibility:hidden;transform:rotateY(180deg) translate3d(0,0,1px);background-color:var(--tui-base-05);border-radius:var(--tui-radius-xs)}.t-back:after{content:'';position:absolute;top:20%;left:0;right:0;height:20%;background-color:var(--tui-base-06)}"]
70
70
  })
71
71
  ], TuiCardComponent);
72
72
  return TuiCardComponent;
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-addon-commerce-components-card.js","sources":["ng://@taiga-ui/addon-commerce/components/card/card.component.ts","ng://@taiga-ui/addon-commerce/components/card/card.module.ts","ng://@taiga-ui/addon-commerce/components/card/taiga-ui-addon-commerce-components-card.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, HostBinding, Input} from '@angular/core';\nimport {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\nimport {tuiDefaultProp} from '@taiga-ui/cdk';\nimport {TuiSizeS} from '@taiga-ui/core';\n\nexport function cardNumberAssertion({length}: string): boolean {\n return !length || length === 4;\n}\n\nexport const cardNumberAssertionMessage = 'cardNumber should contain 4 symbols';\n\nconst icons = {\n [TuiPaymentSystem.Mir]: 'tuiIconMirMono',\n [TuiPaymentSystem.Visa]: 'tuiIconVisaMono',\n [TuiPaymentSystem.Electron]: 'tuiIconElectronMono',\n [TuiPaymentSystem.Mastercard]: 'tuiIconMastercard',\n [TuiPaymentSystem.Maestro]: 'tuiIconMaestro',\n};\n\n@Component({\n selector: 'tui-card',\n templateUrl: 'card.template.html',\n styleUrls: ['./card.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiCardComponent {\n @Input()\n @HostBinding('class._active')\n @tuiDefaultProp()\n active = false;\n\n @Input()\n @tuiDefaultProp()\n brandLogo = '';\n\n @Input()\n @tuiDefaultProp(cardNumberAssertion, cardNumberAssertionMessage)\n cardNumber = '';\n\n @Input()\n @tuiDefaultProp()\n paymentSystem: TuiPaymentSystem | null = null;\n\n @Input()\n @HostBinding('attr.data-tui-host-size')\n @tuiDefaultProp()\n size: TuiSizeS = 'm';\n\n get hasBrandLogo(): boolean {\n return !!this.brandLogo && this.size === 'm';\n }\n\n get paymentSystemLogo(): string {\n return this.paymentSystem ? icons[this.paymentSystem] : '';\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiSvgModule} from '@taiga-ui/core';\n\nimport {TuiCardComponent} from './card.component';\n\n@NgModule({\n imports: [CommonModule, TuiSvgModule],\n declarations: [TuiCardComponent],\n exports: [TuiCardComponent],\n})\nexport class TuiCardModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;SAKgB,mBAAmB,CAAC,EAAgB;QAAf,kBAAM;IACvC,OAAO,CAAC,MAAM,IAAI,MAAM,KAAK,CAAC,CAAC;AACnC,CAAC;IAEY,0BAA0B,GAAG,sCAAsC;AAEhF,IAAM,KAAK;IACP,sBAAwB,gBAAgB;IACxC,wBAAyB,iBAAiB;IAC1C,gCAA6B,qBAAqB;IAClD,oCAA+B,mBAAmB;IAClD,8BAA4B,gBAAgB;OAC/C,CAAC;;IAQF;QAII,WAAM,GAAG,KAAK,CAAC;QAIf,cAAS,GAAG,EAAE,CAAC;QAIf,eAAU,GAAG,EAAE,CAAC;QAIhB,kBAAa,GAA4B,IAAI,CAAC;QAK9C,SAAI,GAAa,GAAG,CAAC;KASxB;IAPG,sBAAI,0CAAY;aAAhB;YACI,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC;SAChD;;;OAAA;IAED,sBAAI,+CAAiB;aAArB;YACI,OAAO,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC;SAC9D;;;OAAA;IAzBD;QAHC,KAAK,EAAE;QACP,WAAW,CAAC,eAAe,CAAC;QAC5B,cAAc,EAAE;oDACF;IAIf;QAFC,KAAK,EAAE;QACP,cAAc,EAAE;uDACF;IAIf;QAFC,KAAK,EAAE;QACP,cAAc,CAAC,mBAAmB,EAAE,0BAA0B,CAAC;wDAChD;IAIhB;QAFC,KAAK,EAAE;QACP,cAAc,EAAE;2DAC6B;IAK9C;QAHC,KAAK,EAAE;QACP,WAAW,CAAC,yBAAyB,CAAC;QACtC,cAAc,EAAE;kDACI;IArBZ,gBAAgB;QAN5B,SAAS,CAAC;YACP,QAAQ,EAAE,UAAU;YACpB,6YAAiC;YAEjC,eAAe,EAAE,uBAAuB,CAAC,MAAM;;SAClD,CAAC;OACW,gBAAgB,CA8B5B;IAAD,uBAAC;CA9BD;;;ICdA;KAA6B;IAAhB,aAAa;QALzB,QAAQ,CAAC;YACN,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;YACrC,YAAY,EAAE,CAAC,gBAAgB,CAAC;YAChC,OAAO,EAAE,CAAC,gBAAgB,CAAC;SAC9B,CAAC;OACW,aAAa,CAAG;IAAD,oBAAC;CAA7B;;ACXA;;;;;;"}
1
+ {"version":3,"file":"taiga-ui-addon-commerce-components-card.js","sources":["ng://@taiga-ui/addon-commerce/components/card/card.component.ts","ng://@taiga-ui/addon-commerce/components/card/card.module.ts","ng://@taiga-ui/addon-commerce/components/card/taiga-ui-addon-commerce-components-card.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, HostBinding, Input} from '@angular/core';\nimport {TuiPaymentSystem} from '@taiga-ui/addon-commerce/enums';\nimport {tuiDefaultProp} from '@taiga-ui/cdk';\nimport {TuiSizeS} from '@taiga-ui/core';\n\nexport function cardNumberAssertion({length}: string): boolean {\n return !length || length === 4;\n}\n\nexport const cardNumberAssertionMessage = 'cardNumber should contain 4 symbols';\n\nconst icons = {\n [TuiPaymentSystem.Mir]: 'tuiIconMirMono',\n [TuiPaymentSystem.Visa]: 'tuiIconVisaMono',\n [TuiPaymentSystem.Electron]: 'tuiIconElectronMono',\n [TuiPaymentSystem.Mastercard]: 'tuiIconMastercard',\n [TuiPaymentSystem.Maestro]: 'tuiIconMaestro',\n};\n\n@Component({\n selector: 'tui-card',\n templateUrl: 'card.template.html',\n styleUrls: ['./card.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiCardComponent {\n @Input()\n @HostBinding('class._active')\n @tuiDefaultProp()\n active = false;\n\n @Input()\n @tuiDefaultProp()\n brandLogo = '';\n\n @Input()\n @tuiDefaultProp(cardNumberAssertion, cardNumberAssertionMessage)\n cardNumber = '';\n\n @Input()\n @tuiDefaultProp()\n paymentSystem: TuiPaymentSystem | null = null;\n\n @Input()\n @HostBinding('attr.data-size')\n @tuiDefaultProp()\n size: TuiSizeS = 'm';\n\n get hasBrandLogo(): boolean {\n return !!this.brandLogo && this.size === 'm';\n }\n\n get paymentSystemLogo(): string {\n return this.paymentSystem ? icons[this.paymentSystem] : '';\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiSvgModule} from '@taiga-ui/core';\n\nimport {TuiCardComponent} from './card.component';\n\n@NgModule({\n imports: [CommonModule, TuiSvgModule],\n declarations: [TuiCardComponent],\n exports: [TuiCardComponent],\n})\nexport class TuiCardModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;SAKgB,mBAAmB,CAAC,EAAgB;QAAf,kBAAM;IACvC,OAAO,CAAC,MAAM,IAAI,MAAM,KAAK,CAAC,CAAC;AACnC,CAAC;IAEY,0BAA0B,GAAG,sCAAsC;AAEhF,IAAM,KAAK;IACP,sBAAwB,gBAAgB;IACxC,wBAAyB,iBAAiB;IAC1C,gCAA6B,qBAAqB;IAClD,oCAA+B,mBAAmB;IAClD,8BAA4B,gBAAgB;OAC/C,CAAC;;IAQF;QAII,WAAM,GAAG,KAAK,CAAC;QAIf,cAAS,GAAG,EAAE,CAAC;QAIf,eAAU,GAAG,EAAE,CAAC;QAIhB,kBAAa,GAA4B,IAAI,CAAC;QAK9C,SAAI,GAAa,GAAG,CAAC;KASxB;IAPG,sBAAI,0CAAY;aAAhB;YACI,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC;SAChD;;;OAAA;IAED,sBAAI,+CAAiB;aAArB;YACI,OAAO,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC;SAC9D;;;OAAA;IAzBD;QAHC,KAAK,EAAE;QACP,WAAW,CAAC,eAAe,CAAC;QAC5B,cAAc,EAAE;oDACF;IAIf;QAFC,KAAK,EAAE;QACP,cAAc,EAAE;uDACF;IAIf;QAFC,KAAK,EAAE;QACP,cAAc,CAAC,mBAAmB,EAAE,0BAA0B,CAAC;wDAChD;IAIhB;QAFC,KAAK,EAAE;QACP,cAAc,EAAE;2DAC6B;IAK9C;QAHC,KAAK,EAAE;QACP,WAAW,CAAC,gBAAgB,CAAC;QAC7B,cAAc,EAAE;kDACI;IArBZ,gBAAgB;QAN5B,SAAS,CAAC;YACP,QAAQ,EAAE,UAAU;YACpB,6YAAiC;YAEjC,eAAe,EAAE,uBAAuB,CAAC,MAAM;;SAClD,CAAC;OACW,gBAAgB,CA8B5B;IAAD,uBAAC;CA9BD;;;ICdA;KAA6B;IAAhB,aAAa;QALzB,QAAQ,CAAC;YACN,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;YACrC,YAAY,EAAE,CAAC,gBAAgB,CAAC;YAChC,OAAO,EAAE,CAAC,gBAAgB,CAAC;SAC9B,CAAC;OACW,aAAa,CAAG;IAAD,oBAAC;CAA7B;;ACXA;;;;;;"}
@@ -4,7 +4,7 @@ import { NgControl, FormsModule } from '@angular/forms';
4
4
  import { tuiDefaultCardValidator, TUI_CARD_MASK } from '@taiga-ui/addon-commerce/constants';
5
5
  import { tuiCreateAutoCorrectedExpirePipe, getPaymentSystem } from '@taiga-ui/addon-commerce/utils';
6
6
  import { typedFromEvent, isNativeFocusedIn, setNativeFocused, isNativeFocused, tuiDefaultProp, tuiRequiredSetter, tuiPure, TUI_FOCUSABLE_ITEM_ACCESSOR, AbstractTuiNullableControl, TuiFocusableModule, TuiHoveredModule, TuiActiveZoneModule, TuiInputModeModule, TuiMapperPipeModule, TuiPreventDefaultModule } from '@taiga-ui/cdk';
7
- import { TUI_DIGIT_REGEXP, TUI_NON_DIGIT_REGEXP, TUI_MODE, TuiDataListDirective, TuiDataListComponent, MODE_PROVIDER, TUI_DATA_LIST_HOST, TuiSvgModule, TuiWrapperModule, TuiDropdownModule } from '@taiga-ui/core';
7
+ import { TUI_DIGIT_REGEXP, TUI_NON_DIGIT_REGEXP, TUI_MODE, TUI_TEXTFIELD_APPEARANCE, TuiDataListDirective, TuiDataListComponent, MODE_PROVIDER, TUI_DATA_LIST_HOST, TuiSvgModule, TuiWrapperModule, TuiDropdownModule } from '@taiga-ui/core';
8
8
  import { combineLatest, of, Observable } from 'rxjs';
9
9
  import { WINDOW } from '@ng-web-apis/common';
10
10
  import { TUI_CARD_NUMBER_TEXTS, TUI_CARD_EXPIRY_TEXTS, TUI_CARD_CVC_TEXTS } from '@taiga-ui/addon-commerce/tokens';
@@ -55,11 +55,12 @@ var ICONS = (_a = {},
55
55
  // @dynamic
56
56
  var TuiInputCardGroupedComponent = /** @class */ (function (_super) {
57
57
  __extends(TuiInputCardGroupedComponent, _super);
58
- function TuiInputCardGroupedComponent(control, changeDetectorRef, elementRef, mode$, cardGroupedTexts$) {
58
+ function TuiInputCardGroupedComponent(control, changeDetectorRef, elementRef, mode$, cardGroupedTexts$, appearance) {
59
59
  var _this = _super.call(this, control, changeDetectorRef) || this;
60
60
  _this.elementRef = elementRef;
61
61
  _this.mode$ = mode$;
62
62
  _this.cardGroupedTexts$ = cardGroupedTexts$;
63
+ _this.appearance = appearance;
63
64
  _this.expireInert = false;
64
65
  _this.autocompleteEnabled = false;
65
66
  _this.cardSrc = null; // TODO(splincode): will be deleted `null` in v3.0
@@ -183,7 +184,15 @@ var TuiInputCardGroupedComponent = /** @class */ (function (_super) {
183
184
  });
184
185
  Object.defineProperty(TuiInputCardGroupedComponent.prototype, "placeholderRaised", {
185
186
  get: function () {
186
- return (this.computedFocused && !this.readOnly) || !!this.value;
187
+ return (this.computedFocused && !this.readOnly) || this.hasCardNumber;
188
+ },
189
+ enumerable: true,
190
+ configurable: true
191
+ });
192
+ Object.defineProperty(TuiInputCardGroupedComponent.prototype, "hasCardNumber", {
193
+ get: function () {
194
+ var _a, _b;
195
+ return !!((_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.card) === null || _b === void 0 ? void 0 : _b.trim());
187
196
  },
188
197
  enumerable: true,
189
198
  configurable: true
@@ -444,7 +453,8 @@ var TuiInputCardGroupedComponent = /** @class */ (function (_super) {
444
453
  { type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] },
445
454
  { type: ElementRef, decorators: [{ type: Inject, args: [ElementRef,] }] },
446
455
  { type: Observable, decorators: [{ type: Inject, args: [TUI_MODE,] }] },
447
- { type: Observable, decorators: [{ type: Inject, args: [TUI_INPUT_CARD_GROUPED_TEXTS,] }] }
456
+ { type: Observable, decorators: [{ type: Inject, args: [TUI_INPUT_CARD_GROUPED_TEXTS,] }] },
457
+ { type: String, decorators: [{ type: Inject, args: [TUI_TEXTFIELD_APPEARANCE,] }] }
448
458
  ]; };
449
459
  __decorate([
450
460
  ViewChild('inputCard')
@@ -500,7 +510,7 @@ var TuiInputCardGroupedComponent = /** @class */ (function (_super) {
500
510
  TuiInputCardGroupedComponent = TuiInputCardGroupedComponent_1 = __decorate([
501
511
  Component({
502
512
  selector: 'tui-input-card-grouped',
503
- template: "<tui-wrapper\n *ngIf=\"cardGroupedTexts$ | async as texts\"\n appearance=\"textfield\"\n class=\"t-common-wrapper\"\n [readOnly]=\"readOnly\"\n [disabled]=\"computedDisabled\"\n [focused]=\"computedFocused\"\n [hovered]=\"computedHovered\"\n [invalid]=\"computedInvalid\"\n [tuiDropdown]=\"open\"\n [tuiDropdownContent]=\"dropdown || ''\"\n (tuiHoveredChange)=\"onHovered($event)\"\n (tuiActiveZoneChange)=\"onActiveZoneChange($event)\"\n (scroll)=\"onScroll($event.currentTarget)\"\n (mousedown)=\"onMouseDown($event)\"\n>\n <div class=\"t-wrapper\">\n <label tuiPreventDefault=\"click\">\n <input\n #inputCard\n type=\"text\"\n automation-id=\"tui-input-card-grouped__card\"\n tuiInputMode=\"numeric\"\n class=\"t-input t-input_card\"\n [class.t-input_inert]=\"cardPrefilled\"\n [class.t-input_hidden]=\"isCardCollapsed\"\n [attr.id]=\"idCard\"\n [attr.aria-invalid]=\"!cardPrefilled && !(this.card | tuiMapper: cardValidator)\"\n [placeholder]=\"cardPrefilled ? '' : exampleText\"\n [autocomplete]=\"autocompleteCard\"\n [disabled]=\"computedDisabled\"\n [readOnly]=\"readOnly\"\n [textMask]=\"maskCard\"\n [tuiFocusable]=\"cardFocusable\"\n [ngModel]=\"formattedCard\"\n (ngModelChange)=\"onCardChange($event)\"\n (focus)=\"(0)\"\n />\n <span\n aria-hidden=\"true\"\n class=\"t-collapsed\"\n [class.t-collapsed_inactive]=\"!isCardCollapsed\"\n [attr.data-before]=\"masked\"\n >\n <span class=\"t-collapsed-wrapper\">\n <span\n class=\"t-value\"\n [class.t-value_collapsed]=\"isCardCollapsed\"\n >\n {{ formattedCard }}\n </span>\n </span>\n </span>\n <span\n class=\"t-placeholder\"\n [class.t-placeholder_raised]=\"placeholderRaised\"\n >\n {{ texts.cardNumberText }}\n </span>\n </label>\n </div>\n <div\n class=\"t-wrapper t-wrapper_expire\"\n [class.t-wrapper_active]=\"isCardCollapsed\"\n >\n <label tuiPreventDefault=\"click\">\n <input\n #inputExpire\n type=\"text\"\n placeholder=\"00/00\"\n automation-id=\"tui-input-card-grouped__expire\"\n tuiInputMode=\"numeric\"\n class=\"t-input\"\n [class.t-input_inert]=\"!expireFocusable\"\n [attr.id]=\"idExpire\"\n [attr.name]=\"name\"\n [autocomplete]=\"autocompleteExpire\"\n [disabled]=\"computedDisabled\"\n [readOnly]=\"readOnly\"\n [tuiFocusable]=\"expireFocusable\"\n [textMask]=\"maskExpire\"\n [ngModel]=\"expire\"\n (ngModelChange)=\"onExpireChange($event)\"\n (focus)=\"(0)\"\n />\n <span\n class=\"t-placeholder\"\n [class.t-placeholder_raised]=\"placeholderRaised\"\n >\n {{ texts.expiryText }}\n </span>\n </label>\n </div>\n <div\n class=\"t-wrapper t-wrapper_cvc\"\n [class.t-wrapper_active]=\"isCardCollapsed\"\n >\n <label tuiPreventDefault=\"click\">\n <input\n #inputCVC\n type=\"text\"\n automation-id=\"tui-input-card-grouped__cvc\"\n tuiInputMode=\"numeric\"\n class=\"t-input\"\n [class.t-input_prefilled]=\"cvcPrefilled\"\n [placeholder]=\"cvcPrefilled ? '\u2022\u2022\u2022' : exampleTextCVC\"\n [attr.id]=\"idCVC\"\n [disabled]=\"computedDisabled\"\n [readOnly]=\"readOnly || cvcPrefilled\"\n [autocomplete]=\"autocompleteCVC\"\n [textMask]=\"maskCVC\"\n [tuiFocusable]=\"cvcFocusable\"\n [ngModel]=\"cvc\"\n (ngModelChange)=\"onCVCChange($event)\"\n (focus)=\"(0)\"\n />\n <span\n class=\"t-placeholder\"\n [class.t-placeholder_raised]=\"placeholderRaised\"\n >\n {{ texts.cvcText }}\n </span>\n </label>\n </div>\n <div class=\"t-icons\">\n <div\n *ngIf=\"icon\"\n polymorpheus-outlet\n class=\"t-icon-outlet\"\n [content]=\"icon\"\n >\n <ng-template let-icon>\n <tui-svg\n automation-id=\"tui-input-card-grouped__icon\"\n class=\"t-card\"\n [src]=\"icon\"\n ></tui-svg>\n </ng-template>\n </div>\n <tui-svg\n *ngIf=\"hasCleaner\"\n src=\"tuiIconCloseLarge\"\n class=\"t-icon\"\n (click)=\"clear()\"\n ></tui-svg>\n <tui-svg\n *ngIf=\"hasDropdown\"\n src=\"tuiIconChevronDownLarge\"\n class=\"t-icon\"\n [class.t-icon_rotated]=\"open\"\n (click)=\"toggle()\"\n ></tui-svg>\n </div>\n</tui-wrapper>\n",
513
+ template: "<tui-wrapper\n *ngIf=\"cardGroupedTexts$ | async as texts\"\n class=\"t-common-wrapper\"\n [appearance]=\"appearance\"\n [readOnly]=\"readOnly\"\n [disabled]=\"computedDisabled\"\n [focused]=\"computedFocused\"\n [hovered]=\"computedHovered\"\n [invalid]=\"computedInvalid\"\n [tuiDropdown]=\"open\"\n [tuiDropdownContent]=\"dropdown || ''\"\n (tuiHoveredChange)=\"onHovered($event)\"\n (tuiActiveZoneChange)=\"onActiveZoneChange($event)\"\n (scroll)=\"onScroll($event.currentTarget)\"\n (mousedown)=\"onMouseDown($event)\"\n>\n <div class=\"t-wrapper\">\n <label tuiPreventDefault=\"click\">\n <input\n #inputCard\n type=\"text\"\n automation-id=\"tui-input-card-grouped__card\"\n tuiInputMode=\"numeric\"\n class=\"t-input t-input_card\"\n [class.t-input_inert]=\"cardPrefilled\"\n [class.t-input_hidden]=\"isCardCollapsed\"\n [attr.id]=\"idCard\"\n [attr.aria-invalid]=\"!cardPrefilled && !(this.card | tuiMapper: cardValidator)\"\n [placeholder]=\"cardPrefilled ? '' : exampleText\"\n [autocomplete]=\"autocompleteCard\"\n [disabled]=\"computedDisabled\"\n [readOnly]=\"readOnly\"\n [textMask]=\"maskCard\"\n [tuiFocusable]=\"cardFocusable\"\n [ngModel]=\"formattedCard\"\n (ngModelChange)=\"onCardChange($event)\"\n (focus)=\"(0)\"\n />\n <span\n aria-hidden=\"true\"\n class=\"t-collapsed\"\n [class.t-collapsed_inactive]=\"!isCardCollapsed\"\n [attr.data-before]=\"masked\"\n >\n <span class=\"t-collapsed-wrapper\">\n <span\n class=\"t-value\"\n [class.t-value_collapsed]=\"isCardCollapsed\"\n >\n {{ formattedCard }}\n </span>\n </span>\n </span>\n <span\n class=\"t-placeholder\"\n [class.t-placeholder_raised]=\"placeholderRaised\"\n >\n {{ texts.cardNumberText }}\n </span>\n </label>\n </div>\n <div\n class=\"t-wrapper t-wrapper_expire\"\n [class.t-wrapper_active]=\"isCardCollapsed\"\n >\n <label tuiPreventDefault=\"click\">\n <input\n #inputExpire\n type=\"text\"\n placeholder=\"00/00\"\n automation-id=\"tui-input-card-grouped__expire\"\n tuiInputMode=\"numeric\"\n class=\"t-input\"\n [class.t-input_inert]=\"!expireFocusable\"\n [attr.id]=\"idExpire\"\n [attr.name]=\"name\"\n [autocomplete]=\"autocompleteExpire\"\n [disabled]=\"computedDisabled\"\n [readOnly]=\"readOnly\"\n [tuiFocusable]=\"expireFocusable\"\n [textMask]=\"maskExpire\"\n [ngModel]=\"expire\"\n (ngModelChange)=\"onExpireChange($event)\"\n (focus)=\"(0)\"\n />\n <span\n class=\"t-placeholder\"\n [class.t-placeholder_raised]=\"placeholderRaised\"\n >\n {{ texts.expiryText }}\n </span>\n </label>\n </div>\n <div\n class=\"t-wrapper t-wrapper_cvc\"\n [class.t-wrapper_active]=\"isCardCollapsed\"\n >\n <label tuiPreventDefault=\"click\">\n <input\n #inputCVC\n type=\"text\"\n automation-id=\"tui-input-card-grouped__cvc\"\n tuiInputMode=\"numeric\"\n class=\"t-input\"\n [class.t-input_prefilled]=\"cvcPrefilled\"\n [placeholder]=\"cvcPrefilled ? '\u2022\u2022\u2022' : exampleTextCVC\"\n [attr.id]=\"idCVC\"\n [disabled]=\"computedDisabled\"\n [readOnly]=\"readOnly || cvcPrefilled\"\n [autocomplete]=\"autocompleteCVC\"\n [textMask]=\"maskCVC\"\n [tuiFocusable]=\"cvcFocusable\"\n [ngModel]=\"cvc\"\n (ngModelChange)=\"onCVCChange($event)\"\n (focus)=\"(0)\"\n />\n <span\n class=\"t-placeholder\"\n [class.t-placeholder_raised]=\"placeholderRaised\"\n >\n {{ texts.cvcText }}\n </span>\n </label>\n </div>\n <div class=\"t-icons\">\n <div\n *ngIf=\"icon\"\n polymorpheus-outlet\n class=\"t-icon-outlet\"\n [content]=\"icon\"\n >\n <ng-template let-icon>\n <tui-svg\n automation-id=\"tui-input-card-grouped__icon\"\n class=\"t-card\"\n [src]=\"icon\"\n ></tui-svg>\n </ng-template>\n </div>\n <tui-svg\n *ngIf=\"hasCleaner\"\n src=\"tuiIconCloseLarge\"\n class=\"t-icon\"\n (click)=\"clear()\"\n ></tui-svg>\n <tui-svg\n *ngIf=\"hasDropdown\"\n src=\"tuiIconChevronDownLarge\"\n class=\"t-icon\"\n [class.t-icon_rotated]=\"open\"\n (click)=\"toggle()\"\n ></tui-svg>\n </div>\n</tui-wrapper>\n",
504
514
  changeDetection: ChangeDetectionStrategy.OnPush,
505
515
  providers: [
506
516
  MODE_PROVIDER,
@@ -515,9 +525,9 @@ var TuiInputCardGroupedComponent = /** @class */ (function (_super) {
515
525
  ],
516
526
  host: {
517
527
  '($.data-mode.attr)': 'mode$',
518
- 'data-tui-host-size': 'l',
528
+ 'data-size': 'l',
519
529
  },
520
- styles: [":host{display:block;height:var(--tui-height-l);width:29.5rem;border-radius:var(--tui-radius-m)}:host[data-mode=onDark]{--tui-autofill:var(--tui-autofill-night)}:host :host-context(tui-root._mobile){width:18rem}.t-outline{height:100%;width:100%}.t-common-wrapper{position:relative;z-index:2;height:100%;width:100%;overflow:hidden}.t-common-wrapper .t-icons,.t-common-wrapper .t-wrapper{z-index:1}.t-wrapper{transition-property:transform;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;position:absolute;width:100%;height:100%}.t-wrapper_cvc{margin-left:7.1875rem;transform:translate3d(100%,0,0)}:host-context(tui-root._mobile) .t-wrapper_cvc{margin-left:4.0625rem}.t-wrapper_expire{transform:translate3d(100%,0,0)}.t-wrapper_active{transform:translate3d(6.5625rem,0,0)}:host-context(tui-root._mobile) .t-wrapper_active{transform:translate3d(4.125rem,0,0)}.t-card{width:2rem;height:2rem;margin-right:.625rem}.t-collapsed{font:var(--tui-font-text-s);color:var(--tui-text-01);padding:0 0 0 1rem;border-radius:inherit;background:0 0;font-size:inherit;font-weight:inherit;color:inherit;caret-color:currentColor;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;word-break:keep-all;-webkit-text-fill-color:currentColor;position:absolute;top:0;left:0;width:100%;height:100%;padding:0 var(--tui-padding-m);border:0;text-align:inherit;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-transform:inherit;line-height:2.25rem;pointer-events:none}.t-collapsed:-webkit-autofill,.t-collapsed:-webkit-autofill:focus,.t-collapsed:-webkit-autofill:hover{border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01)!important;border-color:var(--tui-autofill);-webkit-box-shadow:0 0 0 1000px var(--tui-autofill) inset!important}:host[data-mode=onDark] .t-collapsed:-webkit-autofill,:host[data-mode=onDark] .t-collapsed:-webkit-autofill:focus,:host[data-mode=onDark] .t-collapsed:-webkit-autofill:hover{border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01-night)!important;border-color:var(--tui-autofill-night);-webkit-box-shadow:0 0 0 1000px var(--tui-autofill-night) inset!important}:host[data-tui-host-size='s'] .t-collapsed{padding:0 var(--tui-padding-s)}:host[data-tui-host-size='l'] .t-collapsed{padding:0 var(--tui-padding-l)}:host._disabled .t-collapsed{pointer-events:none}:host._right-aligned .t-collapsed{text-align:right}:host[data-tui-host-size='l']:not(._label-outside) .t-collapsed{padding-top:1.25rem}:host[data-tui-host-size='l']:not(._label-outside) .t-collapsed:-webkit-autofill+.content .placeholder{font-size:.8156rem;transform:translateY(-.625rem)}:host[data-tui-host-size='m']:not(._label-outside) .t-collapsed{padding-top:1.125rem}:host[data-tui-host-size='m']:not(._label-outside) .t-collapsed:-webkit-autofill+.content .placeholder{font-size:.69rem;transform:translateY(-.5rem)}.t-collapsed:before{content:attr(data-before)}:-webkit-autofill~.t-collapsed{background:var(--tui-autofill)}.t-collapsed_inactive,:-webkit-autofill~.t-collapsed_inactive,:host._disabled .t-collapsed_inactive{color:transparent;background:0 0;-webkit-transition:color 0s var(--tui-duration),background 0s var(--tui-duration);transition:color 0s var(--tui-duration),background 0s var(--tui-duration)}.t-collapsed_inactive:before,:-webkit-autofill~.t-collapsed_inactive:before,:host._disabled .t-collapsed_inactive:before{color:transparent;-webkit-transition:color 0s var(--tui-duration);transition:color 0s var(--tui-duration)}.t-collapsed-wrapper{position:absolute;left:1.375rem;top:0;display:block;width:100%;height:100%;overflow:hidden}.t-value{transition-property:transform;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;position:absolute;bottom:0;right:100%;display:block;text-indent:-.375rem;transform:translate3d(100%,0,0)}.t-value_collapsed{transform:translate3d(4ch,0,0)}.t-input{font:var(--tui-font-text-s);color:var(--tui-text-01);padding:0 1rem;border-radius:inherit;background:0 0;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit;caret-color:currentColor;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;word-break:keep-all;-webkit-text-fill-color:currentColor;position:absolute;top:0;left:0;width:100%;height:100%;padding:0 var(--tui-padding-m);border:0;text-align:inherit;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-transform:inherit;transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out}.t-input:-webkit-autofill,.t-input:-webkit-autofill:focus,.t-input:-webkit-autofill:hover{border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01)!important;border-color:var(--tui-autofill);-webkit-box-shadow:0 0 0 1000px var(--tui-autofill) inset!important}:host[data-mode=onDark] .t-input:-webkit-autofill,:host[data-mode=onDark] .t-input:-webkit-autofill:focus,:host[data-mode=onDark] .t-input:-webkit-autofill:hover{border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01-night)!important;border-color:var(--tui-autofill-night);-webkit-box-shadow:0 0 0 1000px var(--tui-autofill-night) inset!important}:host[data-tui-host-size='s'] .t-input{padding:0 var(--tui-padding-s)}:host[data-tui-host-size='l'] .t-input{padding:0 var(--tui-padding-l)}:host._disabled .t-input{pointer-events:none}:host._right-aligned .t-input{text-align:right}:host[data-tui-host-size='l']:not(._label-outside) .t-input{padding-top:1.25rem}:host[data-tui-host-size='l']:not(._label-outside) .t-input:-webkit-autofill+.content .placeholder{font-size:.8156rem;transform:translateY(-.625rem)}:host[data-tui-host-size='m']:not(._label-outside) .t-input{padding-top:1.125rem}:host[data-tui-host-size='m']:not(._label-outside) .t-input:-webkit-autofill+.content .placeholder{font-size:.69rem;transform:translateY(-.5rem)}.t-input:not(.t-input_prefilled)::-moz-placeholder{color:var(--tui-text-03);opacity:0}.t-input:not(.t-input_prefilled):-ms-input-placeholder{color:var(--tui-text-03);opacity:0}.t-input:not(.t-input_prefilled)::placeholder{color:var(--tui-text-03);opacity:0}:host[data-mode=onDark] .t-input::-moz-placeholder{color:var(--tui-text-03-night)}:host[data-mode=onDark] .t-input:-ms-input-placeholder{color:var(--tui-text-03-night)}:host[data-mode=onDark] .t-input::placeholder{color:var(--tui-text-03-night)}:host._focused .t-input:not(:read-only)::-moz-placeholder{opacity:1}:host._focused .t-input:not(:read-only):-ms-input-placeholder{opacity:1}:host._focused .t-input:not(:-moz-read-only)::placeholder{opacity:1}:host._focused .t-input:not(:read-only)::placeholder{opacity:1}.t-input_card{transition:color 0s var(--tui-duration)}.t-input_card::-webkit-textfield-decoration-container{display:none}:host._disabled .t-input_card{transition:color}.t-input_inert{pointer-events:none}.t-input_hidden,:host._disabled .t-input_hidden{color:transparent;transition:color}.t-input_hidden:-webkit-autofill,.t-input_hidden:-webkit-autofill:focus,.t-input_hidden:-webkit-autofill:hover,:host._disabled .t-input_hidden:-webkit-autofill,:host._disabled .t-input_hidden:-webkit-autofill:focus,:host._disabled .t-input_hidden:-webkit-autofill:hover{color:transparent!important;-webkit-text-fill-color:transparent!important}.t-icons{position:absolute;right:.75rem;display:flex;align-items:center;height:100%}.t-icon-outlet{display:inherit}.t-icon{transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;display:flex;width:1.5rem;height:1.5rem;align-items:center;justify-content:center;color:var(--tui-text-03);position:relative;box-sizing:border-box;cursor:pointer;transition-property:color,transform}.t-icon:hover{color:var(--tui-text-02)}:host._disabled .t-icon,:host._readonly .t-icon{pointer-events:none}:host[data-mode=onDark] .t-icon{color:var(--tui-text-03-night)}:host[data-mode=onDark] .t-icon:hover{color:var(--tui-text-01-night)}.t-icon_rotated{transform:rotate(180deg)}.t-placeholder{transition-property:transform,font-size,color,letter-spacing;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;font:var(--tui-font-text-s);color:var(--tui-text-01);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;width:100%;font-size:.8125rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:var(--tui-text-02);pointer-events:none;margin:1.125rem 1rem;line-height:1.25rem}.t-placeholder_raised{transform:translateY(-.625rem)}:host[data-tui-host-size='m'] .t-placeholder_raised{font-size:.69rem;transform:translateY(-.5rem);letter-spacing:.025rem}:host._invalid:not(._focused) .t-placeholder_raised,:host._invalid:not(._focused)._hovered .t-placeholder_raised{color:var(--tui-error-fill)}:host[data-mode=onDark]._invalid:not(._focused) .t-placeholder_raised,:host[data-mode=onDark]._invalid:not(._focused)._hovered .t-placeholder_raised{color:var(--tui-error-fill-night)}:host._focused .t-placeholder,:host[data-tui-host-size='l']._focused._label-outside .t-placeholder,:host[data-tui-host-size='m']._focused._label-outside .t-placeholder{color:var(--tui-text-03)}:host[data-tui-host-size='l'] .t-placeholder{font-size:.9375rem}:host[data-tui-host-size='l'] .t-placeholder_raised{font-size:.8156rem}:host[data-tui-host-size='l']._focused:not(._label-outside) .t-placeholder,:host[data-tui-host-size='m']._focused:not(._label-outside) .t-placeholder{color:var(--tui-text-01)}:host[data-mode=onDark] .t-placeholder{color:var(--tui-text-02-night)}:host[data-tui-host-size='l'][data-mode=onDark]._focused:not(._label-outside) .t-placeholder,:host[data-tui-host-size='m'][data-mode=onDark]._focused:not(._label-outside) .t-placeholder{color:var(--tui-text-01-night)}:host[data-mode=onDark]._focused .t-placeholder,:host[data-tui-host-size='l'][data-mode=onDark]._focused._label-outside .t-placeholder,:host[data-tui-host-size='m'][data-mode=onDark]._focused._label-outside .t-placeholder{color:var(--tui-text-02-night)}"]
530
+ styles: [":host{display:block;height:var(--tui-height-l);width:29.5rem;border-radius:var(--tui-radius-m)}:host[data-mode=onDark]{--tui-autofill:var(--tui-autofill-night)}:host :host-context(tui-root._mobile){width:18rem}.t-outline{height:100%;width:100%}.t-common-wrapper{position:relative;z-index:2;height:100%;width:100%;overflow:hidden}.t-common-wrapper .t-icons,.t-common-wrapper .t-wrapper{z-index:1}.t-wrapper{transition-property:transform;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;position:absolute;width:100%;height:100%}.t-wrapper_cvc{margin-left:7.1875rem;transform:translate3d(100%,0,0)}:host-context(tui-root._mobile) .t-wrapper_cvc{margin-left:4.0625rem}.t-wrapper_expire{transform:translate3d(100%,0,0)}.t-wrapper_active{transform:translate3d(6.5625rem,0,0)}:host-context(tui-root._mobile) .t-wrapper_active{transform:translate3d(4.125rem,0,0)}.t-card{width:2rem;height:2rem;margin-right:.625rem}.t-collapsed{font:var(--tui-font-text-s);color:var(--tui-text-01);padding:0 0 0 1rem;border-radius:inherit;background:0 0;font-size:inherit;font-weight:inherit;color:inherit;caret-color:currentColor;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;word-break:keep-all;-webkit-text-fill-color:currentColor;position:absolute;top:0;left:0;width:100%;height:100%;padding:0 var(--tui-padding-m);border:0;border-width:0 var(--border-end,0) 0 var(--border-start,0);border-inline-start-width:var(--border-start,0);border-inline-end-width:var(--border-end,0);text-indent:var(--text-indent);text-align:inherit;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-transform:inherit;line-height:2.25rem;pointer-events:none}.t-collapsed:-webkit-autofill,.t-collapsed:-webkit-autofill:focus,.t-collapsed:-webkit-autofill:hover{border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01)!important;border-color:var(--tui-autofill);-webkit-box-shadow:0 0 0 1000px var(--tui-autofill) inset!important}.t-collapsed :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill,.t-collapsed :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill:focus,.t-collapsed :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill:hover,:host[data-mode=onDark] .t-collapsed:-webkit-autofill,:host[data-mode=onDark] .t-collapsed:-webkit-autofill:focus,:host[data-mode=onDark] .t-collapsed:-webkit-autofill:hover{border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01-night)!important;border-color:var(--tui-autofill-night);-webkit-box-shadow:0 0 0 1000px var(--tui-autofill-night) inset!important}.t-collapsed :host-context(tui-primitive-textfield[data-size='s']):not(tui-primitive-textfield),:host[data-size='s'] .t-collapsed{padding:0 var(--tui-padding-s)}.t-collapsed :host-context(tui-primitive-textfield[data-size='l']):not(tui-primitive-textfield),:host[data-size='l'] .t-collapsed{padding:0 var(--tui-padding-l)}.t-collapsed :host-context(tui-primitive-textfield._disabled),:host._disabled .t-collapsed{pointer-events:none}.t-collapsed :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield),:host[data-size='l']:not(._label-outside) .t-collapsed{padding-top:1.25rem}.t-collapsed :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield):-webkit-autofill+.content .placeholder,:host[data-size='l']:not(._label-outside) .t-collapsed:-webkit-autofill+.content .placeholder{font-size:.8156rem;transform:translateY(-.625rem)}.t-collapsed :host-context(tui-primitive-textfield[data-size='m']:not(._label-outside)):not(tui-primitive-textfield),:host[data-size='m']:not(._label-outside) .t-collapsed{padding-top:1.125rem}.t-collapsed :host-context(tui-primitive-textfield[data-size='m']:not(._label-outside)):not(tui-primitive-textfield):-webkit-autofill+.content .placeholder,:host[data-size='m']:not(._label-outside) .t-collapsed:-webkit-autofill+.content .placeholder{font-size:.69rem;transform:translateY(-.5rem)}.t-collapsed :host-context(tui-primitive-textfield._hidden),:host._hidden input.t-collapsed{opacity:0;text-indent:-10em;-webkit-user-select:none}.t-collapsed:before{content:attr(data-before)}:-webkit-autofill~.t-collapsed{background:var(--tui-autofill)}.t-collapsed_inactive,:-webkit-autofill~.t-collapsed_inactive,:host._disabled .t-collapsed_inactive{color:transparent;background:0 0;-webkit-transition:color 0s var(--tui-duration),background 0s var(--tui-duration);transition:color 0s var(--tui-duration),background 0s var(--tui-duration)}.t-collapsed_inactive:before,:-webkit-autofill~.t-collapsed_inactive:before,:host._disabled .t-collapsed_inactive:before{color:transparent;-webkit-transition:color 0s var(--tui-duration);transition:color 0s var(--tui-duration)}.t-collapsed-wrapper{position:absolute;left:1.375rem;top:0;display:block;width:100%;height:100%;overflow:hidden}.t-value{transition-property:transform;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;position:absolute;bottom:0;right:100%;display:block;text-indent:-.375rem;transform:translate3d(100%,0,0)}.t-value_collapsed{transform:translate3d(4ch,0,0)}.t-input{font:var(--tui-font-text-s);color:var(--tui-text-01);padding:0 1rem;border-radius:inherit;background:0 0;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit;caret-color:currentColor;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;word-break:keep-all;-webkit-text-fill-color:currentColor;position:absolute;top:0;left:0;width:100%;height:100%;padding:0 var(--tui-padding-m);border:0;border-width:0 var(--border-end,0) 0 var(--border-start,0);border-inline-start-width:var(--border-start,0);border-inline-end-width:var(--border-end,0);text-indent:var(--text-indent);text-align:inherit;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-transform:inherit;transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out}.t-input:-webkit-autofill,.t-input:-webkit-autofill:focus,.t-input:-webkit-autofill:hover{border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01)!important;border-color:var(--tui-autofill);-webkit-box-shadow:0 0 0 1000px var(--tui-autofill) inset!important}.t-input :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill,.t-input :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill:focus,.t-input :host-context(tui-primitive-textfield[data-mode=onDark]):-webkit-autofill:hover,:host[data-mode=onDark] .t-input:-webkit-autofill,:host[data-mode=onDark] .t-input:-webkit-autofill:focus,:host[data-mode=onDark] .t-input:-webkit-autofill:hover{border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01-night)!important;border-color:var(--tui-autofill-night);-webkit-box-shadow:0 0 0 1000px var(--tui-autofill-night) inset!important}.t-input :host-context(tui-primitive-textfield[data-size='s']):not(tui-primitive-textfield),:host[data-size='s'] .t-input{padding:0 var(--tui-padding-s)}.t-input :host-context(tui-primitive-textfield[data-size='l']):not(tui-primitive-textfield),:host[data-size='l'] .t-input{padding:0 var(--tui-padding-l)}.t-input :host-context(tui-primitive-textfield._disabled),:host._disabled .t-input{pointer-events:none}.t-input :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield),:host[data-size='l']:not(._label-outside) .t-input{padding-top:1.25rem}.t-input :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield):-webkit-autofill+.content .placeholder,:host[data-size='l']:not(._label-outside) .t-input:-webkit-autofill+.content .placeholder{font-size:.8156rem;transform:translateY(-.625rem)}.t-input :host-context(tui-primitive-textfield[data-size='m']:not(._label-outside)):not(tui-primitive-textfield),:host[data-size='m']:not(._label-outside) .t-input{padding-top:1.125rem}.t-input :host-context(tui-primitive-textfield[data-size='m']:not(._label-outside)):not(tui-primitive-textfield):-webkit-autofill+.content .placeholder,:host[data-size='m']:not(._label-outside) .t-input:-webkit-autofill+.content .placeholder{font-size:.69rem;transform:translateY(-.5rem)}.t-input :host-context(tui-primitive-textfield._hidden),:host._hidden input.t-input{opacity:0;text-indent:-10em;-webkit-user-select:none}.t-input:not(.t-input_prefilled)::-ms-input-placeholder{color:var(--tui-text-03);opacity:0}.t-input:not(.t-input_prefilled)::placeholder{color:var(--tui-text-03);opacity:0}:host[data-mode=onDark] .t-input::-ms-input-placeholder{color:var(--tui-text-03-night)}:host[data-mode=onDark] .t-input::placeholder{color:var(--tui-text-03-night)}:host._focused .t-input:not(:read-only)::-ms-input-placeholder{opacity:1}:host._focused .t-input:not(:-moz-read-only)::placeholder{opacity:1}:host._focused .t-input:not(:read-only)::placeholder{opacity:1}.t-input_card{transition:color 0s var(--tui-duration)}.t-input_card::-webkit-textfield-decoration-container{display:none}:host._disabled .t-input_card{transition:color}.t-input_inert{pointer-events:none}.t-input_hidden,:host._disabled .t-input_hidden{color:transparent;transition:color}.t-input_hidden:-webkit-autofill,.t-input_hidden:-webkit-autofill:focus,.t-input_hidden:-webkit-autofill:hover,:host._disabled .t-input_hidden:-webkit-autofill,:host._disabled .t-input_hidden:-webkit-autofill:focus,:host._disabled .t-input_hidden:-webkit-autofill:hover{color:transparent!important;-webkit-text-fill-color:transparent!important}.t-icons{position:absolute;right:.75rem;display:flex;align-items:center;height:100%}.t-icon-outlet{display:inherit}.t-icon{transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;display:flex;width:1.5rem;height:1.5rem;align-items:center;justify-content:center;color:var(--tui-text-03);position:relative;box-sizing:border-box;cursor:pointer;transition-property:color,transform}.t-icon:hover{color:var(--tui-text-02)}:host._disabled .t-icon,:host._readonly .t-icon{pointer-events:none}:host[data-mode=onDark] .t-icon{color:var(--tui-text-03-night)}:host[data-mode=onDark] .t-icon:hover{color:var(--tui-text-01-night)}.t-icon_rotated{transform:rotate(180deg)}.t-placeholder{transition-property:transform,font-size,color,letter-spacing;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;font:var(--tui-font-text-s);color:var(--tui-text-01);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;width:100%;font-size:.8125rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:var(--tui-text-02);pointer-events:none;margin:1.125rem 1rem;line-height:1.25rem}.t-placeholder_raised{transform:translateY(-.625rem)}:host[data-size='m'] .t-placeholder_raised{font-size:.69rem;transform:translateY(-.5rem);letter-spacing:.025rem}:host._invalid:not(._focused) .t-placeholder_raised,:host._invalid:not(._focused)._hovered .t-placeholder_raised{color:var(--tui-error-fill)}:host[data-mode=onDark]._invalid:not(._focused) .t-placeholder_raised,:host[data-mode=onDark]._invalid:not(._focused)._hovered .t-placeholder_raised{color:var(--tui-error-fill-night)}:host._focused .t-placeholder,:host[data-size='l']._focused._label-outside .t-placeholder,:host[data-size='m']._focused._label-outside .t-placeholder{color:var(--tui-text-03)}:host[data-size='l'] .t-placeholder{font-size:.9375rem}:host[data-size='l'] .t-placeholder_raised{font-size:.8156rem}:host[data-size='l']._focused:not(._label-outside) .t-placeholder,:host[data-size='m']._focused:not(._label-outside) .t-placeholder{color:var(--tui-text-01)}:host[data-mode=onDark] .t-placeholder{color:var(--tui-text-02-night)}:host[data-size='l'][data-mode=onDark]._focused:not(._label-outside) .t-placeholder,:host[data-size='m'][data-mode=onDark]._focused:not(._label-outside) .t-placeholder{color:var(--tui-text-01-night)}:host[data-mode=onDark]._focused .t-placeholder,:host[data-size='l'][data-mode=onDark]._focused._label-outside .t-placeholder,:host[data-size='m'][data-mode=onDark]._focused._label-outside .t-placeholder{color:var(--tui-text-02-night)}"]
521
531
  }),
522
532
  __param(0, Optional()),
523
533
  __param(0, Self()),
@@ -525,7 +535,8 @@ var TuiInputCardGroupedComponent = /** @class */ (function (_super) {
525
535
  __param(1, Inject(ChangeDetectorRef)),
526
536
  __param(2, Inject(ElementRef)),
527
537
  __param(3, Inject(TUI_MODE)),
528
- __param(4, Inject(TUI_INPUT_CARD_GROUPED_TEXTS))
538
+ __param(4, Inject(TUI_INPUT_CARD_GROUPED_TEXTS)),
539
+ __param(5, Inject(TUI_TEXTFIELD_APPEARANCE))
529
540
  ], TuiInputCardGroupedComponent);
530
541
  return TuiInputCardGroupedComponent;
531
542
  }(AbstractTuiNullableControl));