Skip to content

Commit 286cdbe

Browse files
committed
Commit build for 4b57906
1 parent 4b57906 commit 286cdbe

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

packages/scripts/dist/interfaces/options.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ export interface Options {
109109
};
110110
ariaLabel?: string;
111111
placeholder?: string;
112+
validCardBrands?: {
113+
type: string;
114+
}[] | null;
112115
};
113116
"transaction.ccvv"?: {
114117
showCardIcon?: boolean | object;

packages/scripts/dist/vgs.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ export class VGS {
141141
// Autocomplete is not customizable
142142
autoComplete: "cc-number",
143143
validations: ["required", "validCardNumber"],
144+
validCardBrands: null
144145
},
145146
"transaction.ccvv": {
146147
showCardIcon: false,
@@ -158,6 +159,12 @@ export class VGS {
158159
css: styles,
159160
},
160161
};
162+
// Override the validCardBrands if set in the theme options, as this should not be deep merged.
163+
if (options &&
164+
options["transaction.ccnumber"] &&
165+
options["transaction.ccnumber"].validCardBrands) {
166+
defaultOptions["transaction.ccnumber"].validCardBrands = options["transaction.ccnumber"].validCardBrands;
167+
}
161168
// Deep merge the default options with the options set in the theme
162169
this.options = ENGrid.deepMerge(defaultOptions, options);
163170
this.logger.log("Options", this.options);

0 commit comments

Comments
 (0)