add-to-calendar-button 2.13.3 → 2.13.4

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.
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Style: 3D
7
7
  *
8
- * Version: 2.13.3
8
+ * Version: 2.13.4
9
9
  * Creator: Jens Kuerschner (https://jekuer.com)
10
10
  * Project: https://github.com/add2cal/add-to-calendar-button
11
11
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Style: Date
7
7
  *
8
- * Version: 2.13.3
8
+ * Version: 2.13.4
9
9
  * Creator: Jens Kuerschner (https://jekuer.com)
10
10
  * Project: https://github.com/add2cal/add-to-calendar-button
11
11
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Style: Flat
7
7
  *
8
- * Version: 2.13.3
8
+ * Version: 2.13.4
9
9
  * Creator: Jens Kuerschner (https://jekuer.com)
10
10
  * Project: https://github.com/add2cal/add-to-calendar-button
11
11
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Style: Neumorphism
7
7
  *
8
- * Version: 2.13.3
8
+ * Version: 2.13.4
9
9
  * Creator: Jens Kuerschner (https://jekuer.com)
10
10
  * Project: https://github.com/add2cal/add-to-calendar-button
11
11
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Style: Round
7
7
  *
8
- * Version: 2.13.3
8
+ * Version: 2.13.4
9
9
  * Creator: Jens Kuerschner (https://jekuer.com)
10
10
  * Project: https://github.com/add2cal/add-to-calendar-button
11
11
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Style: Simple
7
7
  *
8
- * Version: 2.13.3
8
+ * Version: 2.13.4
9
9
  * Creator: Jens Kuerschner (https://jekuer.com)
10
10
  * Project: https://github.com/add2cal/add-to-calendar-button
11
11
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Style: Text
7
7
  *
8
- * Version: 2.13.3
8
+ * Version: 2.13.4
9
9
  * Creator: Jens Kuerschner (https://jekuer.com)
10
10
  * Project: https://github.com/add2cal/add-to-calendar-button
11
11
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Style: Default
7
7
  *
8
- * Version: 2.13.3
8
+ * Version: 2.13.4
9
9
  * Creator: Jens Kuerschner (https://jekuer.com)
10
10
  * Project: https://github.com/add2cal/add-to-calendar-button
11
11
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -223,14 +223,14 @@ function tzlib_get_timezones(jsonType = false) {
223
223
  * Add to Calendar Button
224
224
  * ++++++++++++++++++++++
225
225
  *
226
- * Version: 2.13.3
226
+ * Version: 2.13.4
227
227
  * Creator: Jens Kuerschner (https://jekuer.com)
228
228
  * Project: https://github.com/add2cal/add-to-calendar-button
229
229
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
230
230
  * Note: DO NOT REMOVE THE COPYRIGHT NOTICE ABOVE!
231
231
  *
232
232
  */
233
- const atcbVersion = '2.13.3';
233
+ const atcbVersion = '2.13.4';
234
234
  const atcbCssTemplate = {};
235
235
  const atcbIsBrowser = () => {
236
236
  if (typeof window === 'undefined') {
@@ -223,14 +223,14 @@ function tzlib_get_timezones(jsonType = false) {
223
223
  * Add to Calendar Button
224
224
  * ++++++++++++++++++++++
225
225
  *
226
- * Version: 2.13.3
226
+ * Version: 2.13.4
227
227
  * Creator: Jens Kuerschner (https://jekuer.com)
228
228
  * Project: https://github.com/add2cal/add-to-calendar-button
229
229
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
230
230
  * Note: DO NOT REMOVE THE COPYRIGHT NOTICE ABOVE!
231
231
  *
232
232
  */
233
- const atcbVersion = '2.13.3';
233
+ const atcbVersion = '2.13.4';
234
234
  const atcbCssTemplate = {
235
235
  if (typeof window === 'undefined') {
236
236
  return false;
@@ -223,14 +223,14 @@ function tzlib_get_timezones(jsonType = false) {
223
223
  * Add to Calendar Button
224
224
  * ++++++++++++++++++++++
225
225
  *
226
- * Version: 2.13.3
226
+ * Version: 2.13.4
227
227
  * Creator: Jens Kuerschner (https://jekuer.com)
228
228
  * Project: https://github.com/add2cal/add-to-calendar-button
229
229
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
230
230
  * Note: DO NOT REMOVE THE COPYRIGHT NOTICE ABOVE!
231
231
  *
232
232
  */
233
- const atcbVersion = '2.13.3';
233
+ const atcbVersion = '2.13.4';
234
234
  const atcbCssTemplate = {};
235
235
  const atcbIsBrowser = () => {
236
236
  if (typeof window === 'undefined') {
@@ -1937,7 +1937,8 @@ async function atcb_generate_rsvp_form(host, data, hostEl, keyboardTrigger = fal
1937
1937
  rsvpFormSubmit.style.display = 'none';
1938
1938
  const staticFields = [{ type: 'number', name: data.proKey + '-amount', fieldId: data.identifier + '-rsvp-amount', required: true }];
1939
1939
  if (!customEmailField) staticFields.push({ type: 'email', name: 'email', fieldId: data.identifier + '-rsvp-email', required: true });
1940
- let valid = atcb_validate_form(rsvpHost, [...staticFields, ...rsvpData.fields]);
1940
+ const dynamicFields = Array.isArray(rsvpData.fields) ? rsvpData.fields : [];
1941
+ let valid = atcb_validate_form(rsvpHost, [...staticFields, ...dynamicFields]);
1941
1942
  const amountEl = rsvpHost.getElementById(data.identifier + '-rsvp-amount');
1942
1943
  const amount = parseInt(amountEl.value) || 1;
1943
1944
  if (rsvpData.maxpp && rsvpData.maxpp > 0 && amount > rsvpData.maxpp) {
@@ -1956,7 +1957,7 @@ async function atcb_generate_rsvp_form(host, data, hostEl, keyboardTrigger = fal
1956
1957
  if (closeBtn) closeBtn.style.display = 'block';
1957
1958
  return;
1958
1959
  }
1959
- let fieldsCopy = JSON.parse(JSON.stringify(rsvpData.fields));
1960
+ let fieldsCopy = rsvpData.fields ? JSON.parse(JSON.stringify(rsvpData.fields)) : [];
1960
1961
  const bodyData = [];
1961
1962
  bodyData.push({ name: 'prokey', value: data.proKey });
1962
1963
  bodyData.push({ name: 'language', value: data.language });
package/dist/atcb.js CHANGED
@@ -223,14 +223,14 @@ function tzlib_get_timezones(jsonType = false) {
223
223
  * Add to Calendar Button
224
224
  * ++++++++++++++++++++++
225
225
  *
226
- * Version: 2.13.3
226
+ * Version: 2.13.4
227
227
  * Creator: Jens Kuerschner (https://jekuer.com)
228
228
  * Project: https://github.com/add2cal/add-to-calendar-button
229
229
  * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
230
230
  * Note: DO NOT REMOVE THE COPYRIGHT NOTICE ABOVE!
231
231
  *
232
232
  */
233
- const atcbVersion = '2.13.3';
233
+ const atcbVersion = '2.13.4';
234
234
  const atcbCssTemplate = {
235
235
  if (typeof window === 'undefined') {
236
236
  return false;
@@ -1936,7 +1936,8 @@ async function atcb_generate_rsvp_form(host, data, hostEl, keyboardTrigger = fal
1936
1936
  rsvpFormSubmit.style.display = 'none';
1937
1937
  const staticFields = [{ type: 'number', name: data.proKey + '-amount', fieldId: data.identifier + '-rsvp-amount', required: true }];
1938
1938
  if (!customEmailField) staticFields.push({ type: 'email', name: 'email', fieldId: data.identifier + '-rsvp-email', required: true });
1939
- let valid = atcb_validate_form(rsvpHost, [...staticFields, ...rsvpData.fields]);
1939
+ const dynamicFields = Array.isArray(rsvpData.fields) ? rsvpData.fields : [];
1940
+ let valid = atcb_validate_form(rsvpHost, [...staticFields, ...dynamicFields]);
1940
1941
  const amountEl = rsvpHost.getElementById(data.identifier + '-rsvp-amount');
1941
1942
  const amount = parseInt(amountEl.value) || 1;
1942
1943
  if (rsvpData.maxpp && rsvpData.maxpp > 0 && amount > rsvpData.maxpp) {
@@ -1955,7 +1956,7 @@ async function atcb_generate_rsvp_form(host, data, hostEl, keyboardTrigger = fal
1955
1956
  if (closeBtn) closeBtn.style.display = 'block';
1956
1957
  return;
1957
1958
  }
1958
- let fieldsCopy = JSON.parse(JSON.stringify(rsvpData.fields));
1959
+ let fieldsCopy = rsvpData.fields ? JSON.parse(JSON.stringify(rsvpData.fields)) : [];
1959
1960
  const bodyData = [];
1960
1961
  bodyData.push({ name: 'prokey', value: data.proKey });
1961
1962
  bodyData.push({ name: 'language', value: data.language });