@codebards/ik-embeddable-form 0.0.2677686331-qa → 0.0.2677938746-qa
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/dist/embed.js +19 -24
- package/dist/embed.js.map +1 -1
- package/package.json +1 -1
package/dist/embed.js
CHANGED
|
@@ -1098,15 +1098,15 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
1098
1098
|
const ga = getCookie("_ga") ?? "";
|
|
1099
1099
|
return `${visitorId}${ga}:${vCountry}`;
|
|
1100
1100
|
}
|
|
1101
|
-
function persistContactCookies(data) {
|
|
1102
|
-
setCookie("ik_email", data.email, 30, "functional");
|
|
1103
|
-
setCookie("ik_phone", data.phone, 30, "functional");
|
|
1104
|
-
setCookie("ik_phone_code", data.phoneCode, 30, "functional");
|
|
1105
|
-
}
|
|
1106
1101
|
function persistProfileCookies(data) {
|
|
1107
1102
|
setCookie("ik_experience", data.experience, 30, "functional");
|
|
1108
1103
|
setCookie("ik_domain", data.domain, 30, "functional");
|
|
1109
1104
|
}
|
|
1105
|
+
function clearContactPrefillCookies() {
|
|
1106
|
+
deleteCookie("ik_email");
|
|
1107
|
+
deleteCookie("ik_phone");
|
|
1108
|
+
deleteCookie("ik_phone_code");
|
|
1109
|
+
}
|
|
1110
1110
|
function markRegistered() {
|
|
1111
1111
|
setCookie("ik_registered", "1", 30, "functional");
|
|
1112
1112
|
}
|
|
@@ -1138,22 +1138,14 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
1138
1138
|
);
|
|
1139
1139
|
}
|
|
1140
1140
|
function clearPrefillCookies() {
|
|
1141
|
-
|
|
1142
|
-
deleteCookie("ik_phone");
|
|
1143
|
-
deleteCookie("ik_phone_code");
|
|
1141
|
+
clearContactPrefillCookies();
|
|
1144
1142
|
deleteCookie("ik_experience");
|
|
1145
1143
|
deleteCookie("ik_domain");
|
|
1146
1144
|
}
|
|
1147
1145
|
function getPrefillFromCookies() {
|
|
1148
1146
|
const prefill = {};
|
|
1149
|
-
const email = getCookie("ik_email");
|
|
1150
|
-
const phone = getCookie("ik_phone");
|
|
1151
|
-
const phoneCode = getCookie("ik_phone_code");
|
|
1152
1147
|
const experience = getCookie("ik_experience");
|
|
1153
1148
|
const domain = getCookie("ik_domain");
|
|
1154
|
-
if (email) prefill.email = email;
|
|
1155
|
-
if (phone) prefill.phone = phone;
|
|
1156
|
-
if (phoneCode) prefill.phoneCode = phoneCode;
|
|
1157
1149
|
if (experience) prefill.experience = experience;
|
|
1158
1150
|
if (domain) prefill.domain = domain;
|
|
1159
1151
|
return prefill;
|
|
@@ -1266,6 +1258,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
1266
1258
|
const vCountry = vCountryFromCookie ?? geo.countryName;
|
|
1267
1259
|
const vCountryCode = geo.countryCode || vCountryFromCookie && countryNameToCode(vCountryFromCookie) || "";
|
|
1268
1260
|
persistVisitorCountryCookieIfAbsent(geo.countryName);
|
|
1261
|
+
clearContactPrefillCookies();
|
|
1269
1262
|
const cookiePrefill = getPrefillFromCookies();
|
|
1270
1263
|
openConfig.prefilledValues = {
|
|
1271
1264
|
...cookiePrefill,
|
|
@@ -2140,12 +2133,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
2140
2133
|
}
|
|
2141
2134
|
async runBeforeNext(step) {
|
|
2142
2135
|
if (step.beforeNext !== "fetch-slots") return;
|
|
2143
|
-
const {
|
|
2144
|
-
persistContactCookies({
|
|
2145
|
-
email: String(email ?? ""),
|
|
2146
|
-
phone: String(phone ?? ""),
|
|
2147
|
-
phoneCode: String(phoneCode ?? "+1")
|
|
2148
|
-
});
|
|
2136
|
+
const { phone } = this.state.formData;
|
|
2149
2137
|
const phoneNumberFull = String(this.state.formData.phoneNumberFull ?? phone ?? "");
|
|
2150
2138
|
this.mergeFormData({ phoneNumberFull });
|
|
2151
2139
|
await this.ensureSlotsReady(step);
|
|
@@ -7382,6 +7370,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
7382
7370
|
required,
|
|
7383
7371
|
leftIcon,
|
|
7384
7372
|
variant = "default",
|
|
7373
|
+
autocomplete,
|
|
7385
7374
|
id,
|
|
7386
7375
|
class: className,
|
|
7387
7376
|
"data-testid": dataTestId,
|
|
@@ -7450,6 +7439,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
7450
7439
|
...props,
|
|
7451
7440
|
id: inputId,
|
|
7452
7441
|
ref,
|
|
7442
|
+
autocomplete,
|
|
7453
7443
|
"data-testid": dataTestId,
|
|
7454
7444
|
class: [
|
|
7455
7445
|
"w-full transition-colors duration-150",
|
|
@@ -14855,6 +14845,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
14855
14845
|
onFocus,
|
|
14856
14846
|
placeholder,
|
|
14857
14847
|
name,
|
|
14848
|
+
autocomplete = "off",
|
|
14858
14849
|
variant = "default",
|
|
14859
14850
|
"data-testid": dataTestId
|
|
14860
14851
|
}, ref) => {
|
|
@@ -14904,6 +14895,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
14904
14895
|
const input = document.createElement("input");
|
|
14905
14896
|
input.type = "tel";
|
|
14906
14897
|
input.id = String(inputId);
|
|
14898
|
+
input.setAttribute("autocomplete", String(autocomplete));
|
|
14907
14899
|
if (placeholder) input.placeholder = String(placeholder);
|
|
14908
14900
|
if (name) input.name = String(name);
|
|
14909
14901
|
if (disabled) input.disabled = true;
|
|
@@ -18139,7 +18131,8 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
18139
18131
|
...withFieldInteract({ ...commonProps, ...rhfField }),
|
|
18140
18132
|
type: field.type,
|
|
18141
18133
|
value: String(rhfField.value ?? ""),
|
|
18142
|
-
variant: inputVariant
|
|
18134
|
+
variant: inputVariant,
|
|
18135
|
+
autocomplete: field.type === "email" ? "off" : void 0
|
|
18143
18136
|
}
|
|
18144
18137
|
);
|
|
18145
18138
|
case "tel":
|
|
@@ -18153,7 +18146,8 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
18153
18146
|
value: String(rhfField.value ?? ""),
|
|
18154
18147
|
variant: inputVariant,
|
|
18155
18148
|
initialCountryIso: phoneFieldProps == null ? void 0 : phoneFieldProps.initialCountryIso,
|
|
18156
|
-
onCountryChange: phoneFieldProps == null ? void 0 : phoneFieldProps.onCountryChange
|
|
18149
|
+
onCountryChange: phoneFieldProps == null ? void 0 : phoneFieldProps.onCountryChange,
|
|
18150
|
+
autocomplete: "off"
|
|
18157
18151
|
}
|
|
18158
18152
|
);
|
|
18159
18153
|
}
|
|
@@ -18163,7 +18157,8 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
18163
18157
|
...withFieldInteract({ ...commonProps, ...rhfField }),
|
|
18164
18158
|
type: "tel",
|
|
18165
18159
|
value: String(rhfField.value ?? ""),
|
|
18166
|
-
variant: inputVariant
|
|
18160
|
+
variant: inputVariant,
|
|
18161
|
+
autocomplete: "off"
|
|
18167
18162
|
}
|
|
18168
18163
|
);
|
|
18169
18164
|
case "textarea":
|
|
@@ -20643,7 +20638,7 @@ ${intlTelStyles}`;
|
|
|
20643
20638
|
destroy();
|
|
20644
20639
|
},
|
|
20645
20640
|
getVersion() {
|
|
20646
|
-
return "1.0.
|
|
20641
|
+
return "1.0.22";
|
|
20647
20642
|
}
|
|
20648
20643
|
};
|
|
20649
20644
|
if (typeof window !== "undefined") {
|