@taiga-ui/addon-commerce 2.27.0 → 2.30.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.
- package/README.md +4 -5
- package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.js +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.min.js +1 -1
- package/bundles/taiga-ui-addon-commerce-components-input-card-grouped.umd.min.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-utils.umd.js +1 -1
- package/bundles/taiga-ui-addon-commerce-utils.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-commerce-utils.umd.min.js +1 -1
- package/bundles/taiga-ui-addon-commerce-utils.umd.min.js.map +1 -1
- package/components/input-card-grouped/taiga-ui-addon-commerce-components-input-card-grouped.metadata.json +1 -1
- package/esm2015/components/input-card-grouped/input-card-grouped.component.js +1 -1
- package/esm2015/utils/create-auto-corrected-expire-pipe.js +2 -2
- package/esm5/components/input-card-grouped/input-card-grouped.component.js +1 -1
- package/esm5/utils/create-auto-corrected-expire-pipe.js +2 -2
- package/fesm2015/taiga-ui-addon-commerce-components-input-card-grouped.js +1 -1
- package/fesm2015/taiga-ui-addon-commerce-utils.js +1 -1
- package/fesm2015/taiga-ui-addon-commerce-utils.js.map +1 -1
- package/fesm5/taiga-ui-addon-commerce-components-input-card-grouped.js +1 -1
- package/fesm5/taiga-ui-addon-commerce-utils.js +1 -1
- package/fesm5/taiga-ui-addon-commerce-utils.js.map +1 -1
- package/package.json +6 -6
|
@@ -517,7 +517,7 @@ var TuiInputCardGroupedComponent = /** @class */ (function (_super) {
|
|
|
517
517
|
'($.data-mode.attr)': 'mode$',
|
|
518
518
|
'data-tui-host-size': 'l',
|
|
519
519
|
},
|
|
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)}@media screen and (max-width:47.9375em){:host{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)}.t-wrapper_expire{transform:translate3d(100%,0,0)}.t-wrapper_active{transform:translate3d(6.5625rem,0,0)}@media screen and (max-width:47.9375em){.t-wrapper_cvc{margin-left:4.0625rem}.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)}"]
|
|
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)}"]
|
|
521
521
|
}),
|
|
522
522
|
__param(0, Optional()),
|
|
523
523
|
__param(0, Self()),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TUI_NON_DIGIT_REGEXP, TUI_NON_DIGITS_REGEXP } from '@taiga-ui/core';
|
|
2
2
|
import { padStart } from '@taiga-ui/cdk';
|
|
3
3
|
|
|
4
|
-
var TUI_EXP_YEAR_MONTH = /^\d{2}[
|
|
4
|
+
var TUI_EXP_YEAR_MONTH = /^\d{2}[/|.]\d{4}$/;
|
|
5
5
|
var TUI_EXP_SAFARI = /^\d{1,4}.\d{1,2}.\d{1,4}$/;
|
|
6
6
|
/**
|
|
7
7
|
* Correct expiration date text allowing only valid months
|
|
@@ -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,IAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAChD,IAAM,cAAc,GAAG,2BAA2B,CAAC;AAEnD;;;;;;SAMgB,gCAAgC;IAC5C,OAAO,UAAC,cAAc,EAAE,EAAU;YAAT,sBAAQ;;QAE7B,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,IAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;YACnD,IAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACvB,IAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,UAAC,EAAQ;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QAC7C,IAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAEjC,IAAI,CAAC,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,EAAE;YAC5B,IAAM,OAAO,GAAG,KAAK,GAAG,CAAC,CAAC;YAE1B,OAAO,OAAO,GAAG,CAAC,GAAG,OAAO,GAAG,CAAC,GAAG,OAAO,CAAC;SAC9C;QAED,OAAO,KAAK,CAAC;KAChB,CAAC,CAAC;IAEH,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,CAAC,GAAG,CAAC,GAAA,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;AAClD;;SCtBgB,aAAa,CAAC,MAAc;IACxC,IAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;IACzB,IAAM,YAAY,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;IACtC,IAAM,WAAW,GAAG,KAAK,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC;IAC/C,IAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9C,IAAM,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 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,IAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAC/C,IAAM,cAAc,GAAG,2BAA2B,CAAC;AAEnD;;;;;;SAMgB,gCAAgC;IAC5C,OAAO,UAAC,cAAc,EAAE,EAAU;YAAT,sBAAQ;;QAE7B,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,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;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ui/addon-commerce",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.30.0",
|
|
4
4
|
"description": "Extension package for Taiga UI related to commerce, payment systems, currencies etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -11,17 +11,17 @@
|
|
|
11
11
|
"payment"
|
|
12
12
|
],
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
|
-
"repository": "https://github.com/
|
|
15
|
-
"homepage": "https://github.com/
|
|
14
|
+
"repository": "https://github.com/tinkoff/taiga-ui",
|
|
15
|
+
"homepage": "https://github.com/tinkoff/taiga-ui",
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@angular/common": ">=9.0.0",
|
|
18
18
|
"@angular/core": ">=9.0.0",
|
|
19
19
|
"@angular/forms": ">=9.0.0",
|
|
20
20
|
"@ng-web-apis/common": "1.12.1",
|
|
21
21
|
"@tinkoff/ng-polymorpheus": "3.1.12",
|
|
22
|
-
"@taiga-ui/cdk": "2.
|
|
23
|
-
"@taiga-ui/core": "2.
|
|
24
|
-
"@taiga-ui/i18n": "2.
|
|
22
|
+
"@taiga-ui/cdk": "2.30.0",
|
|
23
|
+
"@taiga-ui/core": "2.30.0",
|
|
24
|
+
"@taiga-ui/i18n": "2.30.0",
|
|
25
25
|
"angular2-text-mask": "9.0.0",
|
|
26
26
|
"rxjs": ">=6.0.0"
|
|
27
27
|
},
|