@payrails/web-sdk 5.16.0-RC.1 → 5.16.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/index.js +4 -4
- package/package.json +1 -1
- package/payrails-styles.css +22 -7
- package/payrails.d.ts +45 -30
- package/payrails.js +4 -4
package/package.json
CHANGED
package/payrails-styles.css
CHANGED
|
@@ -130,19 +130,34 @@
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
.payrails-address-selector-wrapper > * {
|
|
133
|
-
width:
|
|
134
|
-
}
|
|
135
|
-
/* Styles for when there's only one child */
|
|
136
|
-
.payrails-address-selector-wrapper > *:first-child:last-child {
|
|
137
|
-
width: 100% !important;
|
|
133
|
+
width: 100% !important; /* Default width for all children */
|
|
138
134
|
}
|
|
139
135
|
|
|
140
136
|
.payrails-address-selector-wrapper > *.hidden {
|
|
141
137
|
display: none;
|
|
142
138
|
}
|
|
143
139
|
|
|
144
|
-
.payrails-address-selector-wrapper .
|
|
145
|
-
border
|
|
140
|
+
.payrails-address-selector-wrapper .error {
|
|
141
|
+
border: 1px solid;
|
|
142
|
+
border-color: #f25226;
|
|
143
|
+
background-color: #f9e1e1;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.payrails-country-selector-wrapper,
|
|
147
|
+
.payrails-postal-code-wrapper {
|
|
148
|
+
display: flex;
|
|
149
|
+
width: 100% !important;
|
|
150
|
+
gap: 8px;
|
|
151
|
+
margin-top: 8px;
|
|
152
|
+
position: relative;
|
|
153
|
+
}
|
|
154
|
+
.payrails-country-select-element {
|
|
155
|
+
appearance: none;
|
|
156
|
+
-webkit-appearance: none;
|
|
157
|
+
-moz-appearance: none;
|
|
158
|
+
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
|
|
159
|
+
background-repeat: no-repeat;
|
|
160
|
+
background-position: right 8px center;
|
|
146
161
|
}
|
|
147
162
|
|
|
148
163
|
.payrails-payment-installments-dropdown {
|
package/payrails.d.ts
CHANGED
|
@@ -531,6 +531,47 @@ declare class PayrailsElement implements Mountable {
|
|
|
531
531
|
unmount(): void;
|
|
532
532
|
}
|
|
533
533
|
|
|
534
|
+
interface IAddress {
|
|
535
|
+
country?: {
|
|
536
|
+
code?: string;
|
|
537
|
+
fullName?: string;
|
|
538
|
+
iso3?: string;
|
|
539
|
+
};
|
|
540
|
+
postalCode?: string;
|
|
541
|
+
}
|
|
542
|
+
interface IOnChange {
|
|
543
|
+
isValid: boolean;
|
|
544
|
+
billingAddress?: IAddress;
|
|
545
|
+
}
|
|
546
|
+
interface AddressSelectorElementOptions extends ElementOptions {
|
|
547
|
+
translations?: {
|
|
548
|
+
labels?: {
|
|
549
|
+
countrySelector?: string;
|
|
550
|
+
postalCodeInput?: string;
|
|
551
|
+
};
|
|
552
|
+
placeholders?: {
|
|
553
|
+
postalCodeInput?: string;
|
|
554
|
+
countrySelector?: string;
|
|
555
|
+
};
|
|
556
|
+
};
|
|
557
|
+
styles?: {
|
|
558
|
+
wrapper?: Partial<CSSStyleDeclaration>;
|
|
559
|
+
countrySelector?: {
|
|
560
|
+
wrapper?: Partial<CSSStyleDeclaration>;
|
|
561
|
+
element?: Partial<CSSStyleDeclaration>;
|
|
562
|
+
label?: Partial<CSSStyleDeclaration>;
|
|
563
|
+
};
|
|
564
|
+
postalCodeInput?: {
|
|
565
|
+
wrapper?: Partial<CSSStyleDeclaration>;
|
|
566
|
+
element?: Partial<CSSStyleDeclaration>;
|
|
567
|
+
label?: Partial<CSSStyleDeclaration>;
|
|
568
|
+
};
|
|
569
|
+
};
|
|
570
|
+
events?: {
|
|
571
|
+
onBillingAddressChanged?: (e: IOnChange) => void;
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
|
|
534
575
|
interface StoreInstrumentElementOptions extends ElementOptions {
|
|
535
576
|
showStoreInstrumentCheckbox?: boolean;
|
|
536
577
|
alwaysStoreInstrument?: boolean;
|
|
@@ -604,34 +645,6 @@ declare const regexes: {
|
|
|
604
645
|
};
|
|
605
646
|
type CardNetwork = keyof typeof regexes;
|
|
606
647
|
|
|
607
|
-
interface IAddress {
|
|
608
|
-
country?: {
|
|
609
|
-
code?: string;
|
|
610
|
-
fullName?: string;
|
|
611
|
-
iso3?: string;
|
|
612
|
-
};
|
|
613
|
-
postalCode?: string;
|
|
614
|
-
}
|
|
615
|
-
interface IOnChange {
|
|
616
|
-
isValid: boolean;
|
|
617
|
-
billingAddress?: IAddress;
|
|
618
|
-
}
|
|
619
|
-
interface AddressSelectorElementOptions extends ElementOptions {
|
|
620
|
-
translations?: {
|
|
621
|
-
COUNTRY_SELECTOR?: string;
|
|
622
|
-
POSTAL_CODE_INPUT?: string;
|
|
623
|
-
};
|
|
624
|
-
styles?: {
|
|
625
|
-
wrapper?: Partial<CSSStyleDeclaration>;
|
|
626
|
-
countrySelector?: Partial<CSSStyleDeclaration>;
|
|
627
|
-
postalCodeInput?: Partial<CSSStyleDeclaration>;
|
|
628
|
-
};
|
|
629
|
-
events?: {
|
|
630
|
-
onBillingAddressChanged?: (address: IAddress) => void;
|
|
631
|
-
onChange?: (e: IOnChange) => void;
|
|
632
|
-
};
|
|
633
|
-
}
|
|
634
|
-
|
|
635
648
|
interface PaymentInstallmentsElementOptions extends ElementOptions {
|
|
636
649
|
showPaymentInstallmentsDropdown?: boolean;
|
|
637
650
|
installmentOptions?: BaseInstallmentOption[] | null;
|
|
@@ -1198,7 +1211,10 @@ interface UIEvents {
|
|
|
1198
1211
|
onSaveInstrumentCheckboxChanged?: ({ checked }: {
|
|
1199
1212
|
checked: boolean;
|
|
1200
1213
|
}) => void;
|
|
1201
|
-
onBillingAddressChanged?: (e:
|
|
1214
|
+
onBillingAddressChanged?: (e: {
|
|
1215
|
+
isValid: boolean;
|
|
1216
|
+
billingAddress?: IAddress;
|
|
1217
|
+
}) => void;
|
|
1202
1218
|
}
|
|
1203
1219
|
type onPaymentMethodSelectedParams = {
|
|
1204
1220
|
paymentMethod?: StorablePaymentCompositionOption;
|
|
@@ -1206,7 +1222,6 @@ type onPaymentMethodSelectedParams = {
|
|
|
1206
1222
|
};
|
|
1207
1223
|
interface DropinEvents {
|
|
1208
1224
|
onPaymentOptionSelected?: (e: onPaymentMethodSelectedParams) => void;
|
|
1209
|
-
onBillingAddressChanged?: (e: any) => void;
|
|
1210
1225
|
}
|
|
1211
1226
|
type PayrailsSDKEvents = PaymentEvents & UIEvents & DropinEvents;
|
|
1212
1227
|
interface SdkConfiguration {
|