Skip to content

Commit bdb5aef

Browse files
committed
fixes and upgrade
1 parent f700b62 commit bdb5aef

31 files changed

+93
-50
lines changed

.eslintrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
]
2323
},
2424

25-
"extends": ["plugin:@typescript-eslint/recommended", "eslint:recommended", "plugin:security/recommended-legacy", "plugin:prettier/recommended"],
25+
"extends": ["plugin:@typescript-eslint/recommended", "eslint:recommended", "plugin:security/recommended-legacy", "plugin:prettier/recommended", "plugin:wc/recommended"],
2626

2727
"plugins": ["@typescript-eslint", "prettier"],
2828

assets/css/atcb-3d.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Style: 3D
77
*
8-
* Version: 2.6.18
8+
* Version: 2.6.19
99
* Creator: Jens Kuerschner (https://jekuer.com)
1010
* Project: https://github.com/add2cal/add-to-calendar-button
1111
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)

assets/css/atcb-date.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Style: Date
77
*
8-
* Version: 2.6.18
8+
* Version: 2.6.19
99
* Creator: Jens Kuerschner (https://jekuer.com)
1010
* Project: https://github.com/add2cal/add-to-calendar-button
1111
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)

assets/css/atcb-flat.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Style: Flat
77
*
8-
* Version: 2.6.18
8+
* Version: 2.6.19
99
* Creator: Jens Kuerschner (https://jekuer.com)
1010
* Project: https://github.com/add2cal/add-to-calendar-button
1111
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)

assets/css/atcb-neumorphism.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Style: Neumorphism
77
*
8-
* Version: 2.6.18
8+
* Version: 2.6.19
99
* Creator: Jens Kuerschner (https://jekuer.com)
1010
* Project: https://github.com/add2cal/add-to-calendar-button
1111
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)

assets/css/atcb-round.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Style: Round
77
*
8-
* Version: 2.6.18
8+
* Version: 2.6.19
99
* Creator: Jens Kuerschner (https://jekuer.com)
1010
* Project: https://github.com/add2cal/add-to-calendar-button
1111
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)

assets/css/atcb-text.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Style: Text
77
*
8-
* Version: 2.6.18
8+
* Version: 2.6.19
99
* Creator: Jens Kuerschner (https://jekuer.com)
1010
* Project: https://github.com/add2cal/add-to-calendar-button
1111
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)

assets/css/atcb.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Style: Default
77
*
8-
* Version: 2.6.18
8+
* Version: 2.6.19
99
* Creator: Jens Kuerschner (https://jekuer.com)
1010
* Project: https://github.com/add2cal/add-to-calendar-button
1111
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)

demo/components/controls/configSearch.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ onMounted(() => {
124124
onSubmit: (value: string) => {
125125
if (value !== undefined) {
126126
const goTo = value.toLowerCase();
127-
searchInput.value && searchInput.value.blur();
127+
if (searchInput.value) searchInput.value.blur();
128128
searchInput.value.value = '';
129129
// push the route, but add some delay to work around some android soft keyboard issues
130130
setTimeout( () => navigateTo({path: localePath('configuration'), hash: '#' + goTo}), 200);
@@ -138,7 +138,7 @@ onMounted(() => {
138138
139139
const onSearchInputFocus = () => {
140140
isInputFocused.value = true;
141-
searchInput.value && searchInput.value.select();
141+
if (searchInput.value) searchInput.value.select();
142142
}
143143
144144
const onSearchInputBlur = () => {

demo/components/controls/timezoneAutocomplete.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const elNoResultsID = (function() {
6464
6565
onMounted(() => {
6666
if (props.modelValue && getFilteredTimezoneOptions().includes(props.modelValue.toString())) {
67-
searchInput.value && (searchInput.value.value = props.modelValue)
67+
if (searchInput.value) searchInput.value.value = props.modelValue;
6868
}
6969
7070
if (import.meta.client) {
@@ -76,7 +76,7 @@ onMounted(() => {
7676
onSubmit: (value: string) => {
7777
if (value !== undefined) {
7878
emit('update:modelValue', value);
79-
searchInput.value && searchInput.value.blur();
79+
if (searchInput.value) searchInput.value.blur();
8080
}
8181
},
8282
autoSelect: true,
@@ -87,7 +87,7 @@ onMounted(() => {
8787
8888
const onSearchInputFocus = () => {
8989
isInputFocused.value = true;
90-
searchInput.value && searchInput.value.select();
90+
if (searchInput.value) searchInput.value.select();
9191
}
9292
9393
const onSearchInputBlur = () => {
@@ -107,7 +107,7 @@ const onSearchInputBlur = () => {
107107
// watch props changes to synch mobile and desktop field here
108108
if (import.meta.client) {
109109
watch(props, () => {
110-
searchInput.value && (searchInput.value.value = props.modelValue);
110+
if (searchInput.value) searchInput.value.value = props.modelValue;
111111
});
112112
}
113113
</script>

demo/components/footer.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function topFunction() {
7070
</span>
7171
<div class="mt-6 text-xs sm:mt-5 md:mt-3">
7272
<span class="font-semibold text-zinc-500 dark:text-zinc-400"> &copy; {{new Date().getFullYear()}} </span>
73-
<span class="lowercase text-zinc-400 dark:text-zinc-500"> , Current Version: 2.6.18 </span>
73+
<span class="lowercase text-zinc-400 dark:text-zinc-500"> , Current Version: 2.6.19 </span>
7474
</div>
7575
</div>
7676
<div class="hidden self-center sm:block">

demo/components/statsBar.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const loadGitHubRepoData = async () => {
7373
if (response.ok) {
7474
const json = await response.json();
7575
76-
json?.stargazers_count && (data.value.github.stars = json.stargazers_count);
76+
if (json?.stargazers_count) data.value.github.stars = json.stargazers_count;
7777
}
7878
}
7979
@@ -120,7 +120,7 @@ const loadJsdelivrStats = async () => {
120120
const response = await fetch(jsdelivrStatsUrl);
121121
if (response.ok) {
122122
const json = await response.json();
123-
json?.hits.total && (data.value.jsdelivr.montlyHits = json.hits.total);
123+
if (json?.hits.total) data.value.jsdelivr.montlyHits = json.hits.total;
124124
}
125125
};
126126
</script>

demo/public/atcb.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Style: Default
77
*
8-
* Version: 2.6.18
8+
* Version: 2.6.19
99
* Creator: Jens Kuerschner (https://jekuer.com)
1010
* Project: https://github.com/add2cal/add-to-calendar-button
1111
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)

demo/tailwind.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ module.exports = {
6767
},
6868
},
6969
},
70+
// eslint-disable @typescript-eslint/no-require-imports
7071
// eslint-disable-next-line @typescript-eslint/no-var-requires
7172
plugins: [require('@headlessui/tailwindcss')({ prefix: 'ui' })],
7273
};

package-lock.json

+41-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "add-to-calendar-button",
3-
"version": "2.6.18",
3+
"version": "2.6.19",
44
"engines": {
55
"node": ">=18.17.0",
66
"npm": ">=9.6.7"
@@ -108,6 +108,7 @@
108108
"eslint-plugin-commonjs": "^1.0.2",
109109
"eslint-plugin-prettier": "^5.2.1",
110110
"eslint-plugin-security": "^3.0.1",
111+
"eslint-plugin-wc": "^2.1.0",
111112
"grunt": ">=1.6.1",
112113
"grunt-contrib-clean": "^2.0.1",
113114
"grunt-contrib-concat": "^2.1.0",

src/atcb-control.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Add to Calendar Button
44
* ++++++++++++++++++++++
55
*
6-
* Version: 2.6.18
6+
* Version: 2.6.19
77
* Creator: Jens Kuerschner (https://jekuer.com)
88
* Project: https://github.com/add2cal/add-to-calendar-button
99
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)

src/atcb-decorate.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Add to Calendar Button
44
* ++++++++++++++++++++++
55
*
6-
* Version: 2.6.18
6+
* Version: 2.6.19
77
* Creator: Jens Kuerschner (https://jekuer.com)
88
* Project: https://github.com/add2cal/add-to-calendar-button
99
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -525,7 +525,7 @@ function atcb_date_specials_calculation(type, dateString, timeString = null, tim
525525
}
526526
const currentUtcDate = new Date().toISOString();
527527
return tmpDate.getTime() < new Date(currentUtcDate).getTime();
528-
} catch (e) {
528+
} catch {
529529
// we will catch the detailed problem on validation at the next step
530530
return false;
531531
}
@@ -551,7 +551,7 @@ function atcb_date_calculation(dateString) {
551551
}
552552
try {
553553
return newDate.toISOString().replace(/T(\d{2}:\d{2}:\d{2}\.\d{3})Z/g, '');
554-
} catch (e) {
554+
} catch {
555555
// we will catch the detailed problem on validation at the next step
556556
return false;
557557
}

src/atcb-event.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Add to Calendar Button
44
* ++++++++++++++++++++++
55
*
6-
* Version: 2.6.18
6+
* Version: 2.6.19
77
* Creator: Jens Kuerschner (https://jekuer.com)
88
* Project: https://github.com/add2cal/add-to-calendar-button
99
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)

src/atcb-generate-pro.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Add to Calendar Button
44
* ++++++++++++++++++++++
55
*
6-
* Version: 2.6.18
6+
* Version: 2.6.19
77
* Creator: Jens Kuerschner (https://jekuer.com)
88
* Project: https://github.com/add2cal/add-to-calendar-button
99
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)
@@ -291,19 +291,19 @@ async function atcb_generate_rsvp_form(host, data, hostEl, keyboardTrigger = fal
291291
rsvpContent += '<div class="pro-field"><label for="' + data.identifier + '-rsvp-amount">' + atcb_translate_hook('form.amount', data) + ' (' + atcb_translate_hook('form.max', data) + ' ' + maxAmount + ')<span>*</span></label>';
292292
rsvpContent += '<input type="number" name="' + staticID + '-amount" min="1" max="' + maxAmount + '" id="' + data.identifier + '-rsvp-amount" ' + (data.disabled && 'disabled') + ' aria-label="' + atcb_translate_hook('form.amount', data) + '" value="1" /></div>';
293293
}
294+
const attendee = (function () {
295+
if (data.attendee && data.attendee !== '') {
296+
const attendeeParts = data.attendee.split('|');
297+
if (attendeeParts.length > 1) {
298+
return attendeeParts[1];
299+
}
300+
return attendeeParts[0];
301+
}
302+
return null;
303+
})();
294304
const customEmailField = rsvpData.fields?.find((field) => field.name === 'email');
295305
if (!customEmailField) {
296-
const attendee = (function () {
297-
if (data.attendee && data.attendee !== '') {
298-
const attendeeParts = data.attendee.split('|');
299-
if (attendeeParts.length > 1) {
300-
return attendeeParts[1];
301-
}
302-
return attendeeParts[0];
303-
}
304-
return '';
305-
})();
306-
if (attendee !== '') {
306+
if (attendee) {
307307
hiddenContent += '<input type="hidden" name="email" id="' + data.identifier + '-rsvp-email" value="' + attendee + '" />';
308308
} else {
309309
rsvpContent += '<div class="pro-field"><label for="' + data.identifier + '-rsvp-email">' + atcb_translate_hook('form.email', data) + '<span>*</span></label>';
@@ -312,7 +312,7 @@ async function atcb_generate_rsvp_form(host, data, hostEl, keyboardTrigger = fal
312312
} else {
313313
rsvpData.fields = rsvpData.fields.map((field) => {
314314
if (field.name === 'email') {
315-
return { ...field, required: true };
315+
return { ...field, required: true, type: 'email', default: attendee !== '' && attendee || field.default };
316316
}
317317
return field;
318318
});
@@ -669,7 +669,7 @@ function atcb_build_form(fields, identifier = '', disabled = false) {
669669
function atcb_create_field_html(type, name, fieldLabel, fieldId, required = false, fieldValue, defaultVal = null, fieldPlaceholder = '', disabled = false) {
670670
let fieldHtml = '';
671671
// add label
672-
if ((type === 'text' || type === 'number') && fieldLabel !== '') {
672+
if ((type === 'text' || type === 'email' || type === 'number') && fieldLabel !== '') {
673673
fieldHtml += '<label for="' + fieldId + '">' + fieldLabel + (required ? '<span>*</span>' : '') + '</label>';
674674
}
675675
// add input

src/atcb-generate-rich-data.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Add to Calendar Button
44
* ++++++++++++++++++++++
55
*
6-
* Version: 2.6.18
6+
* Version: 2.6.19
77
* Creator: Jens Kuerschner (https://jekuer.com)
88
* Project: https://github.com/add2cal/add-to-calendar-button
99
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)

src/atcb-generate.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Add to Calendar Button
44
* ++++++++++++++++++++++
55
*
6-
* Version: 2.6.18
6+
* Version: 2.6.19
77
* Creator: Jens Kuerschner (https://jekuer.com)
88
* Project: https://github.com/add2cal/add-to-calendar-button
99
* License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt)

0 commit comments

Comments
 (0)