wonder-image 1.2.7 → 1.4.2
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/backend/head.js +1 -1
- package/dist/backend/head.js.map +1 -1
- package/dist/frontend/body-end.js +1 -1
- package/dist/frontend/body-end.js.map +1 -1
- package/dist/frontend/head.js +1 -1
- package/dist/frontend/head.js.map +1 -1
- package/dist/lib/fullcalendar/fullcalendar.js +1 -1
- package/dist/lib/fullcalendar/fullcalendar.js.LICENSE.txt +2 -0
- package/dist/lib/fullcalendar/fullcalendar.js.map +1 -1
- package/dist/lib/videojs/video.js +1 -1
- package/dist/lib/videojs/video.js.map +1 -1
- package/package.json +1 -1
- package/src/build/frontend/js/form/input.js +1 -0
- package/src/build/frontend/js/form/list.js +81 -12
- package/src/build/frontend/js/form/place.js +76 -0
- package/src/build/global/js/utility.js +6 -0
package/package.json
CHANGED
|
@@ -40,7 +40,6 @@ function controlList(event) {
|
|
|
40
40
|
|
|
41
41
|
var element = event.target;
|
|
42
42
|
var container = event.target.parentElement;
|
|
43
|
-
var spanAlert = container.querySelector('.alert-error');
|
|
44
43
|
|
|
45
44
|
var l = element.dataset.wiListArray.split('|');
|
|
46
45
|
var v = element.value.toLowerCase();
|
|
@@ -48,34 +47,33 @@ function controlList(event) {
|
|
|
48
47
|
if (v != '') {
|
|
49
48
|
if (l.includes(v)) {
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
container.classList.remove('input-error');
|
|
53
|
-
element.setCustomValidity('');
|
|
50
|
+
removeInputError(element);
|
|
54
51
|
|
|
55
52
|
container.querySelectorAll('input[type=radio]').forEach(e => {
|
|
53
|
+
|
|
56
54
|
var name = e.dataset.wiName;
|
|
55
|
+
|
|
57
56
|
if (name.toLowerCase() == v) {
|
|
58
57
|
e.checked = true;
|
|
59
|
-
}else{
|
|
58
|
+
} else {
|
|
60
59
|
e.checked = false;
|
|
61
60
|
}
|
|
61
|
+
|
|
62
62
|
});
|
|
63
63
|
|
|
64
64
|
} else {
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
container.classList.add('input-error');
|
|
69
|
-
|
|
70
|
-
container.querySelectorAll('input[type=radio]:checked').forEach(e => {
|
|
71
|
-
e.checked = false;
|
|
72
|
-
});
|
|
66
|
+
inputError(element, 'Campo non corretto!')
|
|
67
|
+
container.querySelectorAll('input[type=radio]:checked').forEach(e => { e.checked = false; });
|
|
73
68
|
|
|
74
69
|
}
|
|
75
70
|
}
|
|
76
71
|
|
|
72
|
+
check();
|
|
73
|
+
|
|
77
74
|
}
|
|
78
75
|
|
|
76
|
+
|
|
79
77
|
function showList(event) { event.target.parentElement.classList.add('wi-list-active'); }
|
|
80
78
|
|
|
81
79
|
function hideList(event) { event.target.parentElement.classList.remove('wi-list-active'); }
|
|
@@ -152,4 +150,75 @@ function searchResults(event, result) {
|
|
|
152
150
|
}
|
|
153
151
|
});
|
|
154
152
|
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function textListValue (input, value) {
|
|
156
|
+
|
|
157
|
+
var form = input.form;
|
|
158
|
+
var inputName = input.dataset.wiName.replace('-text', '');
|
|
159
|
+
|
|
160
|
+
if (form.querySelector('input[name="'+inputName+'"][value="'+value+'"]')) {
|
|
161
|
+
form.querySelector('input[name="'+inputName+'"][value="'+value+'"]').click();
|
|
162
|
+
checkLabel();
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function textListOptions(input, options) {
|
|
168
|
+
|
|
169
|
+
var listHTML = "";
|
|
170
|
+
var listArray = [];
|
|
171
|
+
|
|
172
|
+
var form = input.form;
|
|
173
|
+
var inputId = input.id;
|
|
174
|
+
var inputAttribute = input.dataset.wiInputAttribute;
|
|
175
|
+
var inputLabel = input.labels[0];
|
|
176
|
+
var inputName = input.dataset.wiName.replace('-text', '');;
|
|
177
|
+
|
|
178
|
+
var listContainer = form.querySelector('#list_'+inputId);
|
|
179
|
+
|
|
180
|
+
input.dataset.wiListArray = "";
|
|
181
|
+
listContainer.innerHTML = "";
|
|
182
|
+
|
|
183
|
+
for (var optionValue in options) {
|
|
184
|
+
|
|
185
|
+
var optionId = "value_"+code();
|
|
186
|
+
var optionLabel = options[optionValue];
|
|
187
|
+
|
|
188
|
+
listArray.push(optionLabel);
|
|
189
|
+
|
|
190
|
+
listHTML += "<div class='wi-input-list-value' data-wi-list-value='true'><input id='"+optionId+"' data-wi-keyword='"+optionValue+" "+optionLabel+"' data-wi-input='"+inputId+"' data-wi-name='"+optionLabel+"' type='radio' name='"+inputName+"' value='"+optionValue+"'>"+optionLabel+"</div>";
|
|
191
|
+
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (listHTML == "") {
|
|
195
|
+
|
|
196
|
+
input.required = false;
|
|
197
|
+
input.disabled = true;
|
|
198
|
+
inputLabel.innerHTML = inputLabel.innerHTML.replace('*', '');
|
|
199
|
+
|
|
200
|
+
} else {
|
|
201
|
+
|
|
202
|
+
if (inputAttribute.indexOf('required') != '-1') {
|
|
203
|
+
|
|
204
|
+
input.required = true;
|
|
205
|
+
|
|
206
|
+
if (inputLabel.innerHTML.indexOf('*') == '-1') {
|
|
207
|
+
inputLabel.innerHTML = inputLabel.innerHTML+'*'
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
input.dataset.wiListArray = listArray.join('|').toLowerCase();
|
|
213
|
+
listContainer.innerHTML = listHTML;
|
|
214
|
+
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
listContainer.querySelectorAll("[data-wi-list-value='true']").forEach(element => {
|
|
218
|
+
element.addEventListener("click", checkInput);
|
|
219
|
+
element.addEventListener("mousedown", checkInput);
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
checkLabel();
|
|
223
|
+
|
|
155
224
|
}
|
|
@@ -173,4 +173,80 @@ function setGoogleMapsApi() {
|
|
|
173
173
|
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
function setInputCountry() {
|
|
180
|
+
|
|
181
|
+
document.querySelectorAll("[data-wi-input-country='true']").forEach(element => {
|
|
182
|
+
element.addEventListener("change", searchStates);
|
|
183
|
+
element.addEventListener("focusout", searchStates);
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function setCountryState(input, country, state) {
|
|
189
|
+
|
|
190
|
+
textListValue(input, country);
|
|
191
|
+
searchStates(input, state);
|
|
192
|
+
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function searchStates(event, stateValue = null) {
|
|
196
|
+
|
|
197
|
+
if (typeof event.target !== "undefined") {
|
|
198
|
+
var inputCountry = event.target;
|
|
199
|
+
} else {
|
|
200
|
+
var inputCountry = event;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
var form = inputCountry.form;
|
|
204
|
+
var inputCountryName = inputCountry.dataset.wiName.replace('-text', '');
|
|
205
|
+
var inputStateName = inputCountry.dataset.wiInputState;
|
|
206
|
+
|
|
207
|
+
var inputState = form.querySelector('input[data-wi-name="'+inputStateName+'-text"]');
|
|
208
|
+
|
|
209
|
+
inputState.disabled = true;
|
|
210
|
+
inputState.value = "";
|
|
211
|
+
|
|
212
|
+
delay(100).then(() => {
|
|
213
|
+
|
|
214
|
+
if (form.querySelector('input[name="'+inputCountryName+'"]:checked') != null) {
|
|
215
|
+
|
|
216
|
+
loadingSpinner();
|
|
217
|
+
|
|
218
|
+
var country = form.querySelector('input[name="'+inputCountryName+'"]:checked');
|
|
219
|
+
|
|
220
|
+
$.ajax({
|
|
221
|
+
type: "POST",
|
|
222
|
+
url: pathApp+'/api/states.php',
|
|
223
|
+
data: {
|
|
224
|
+
post: 'true',
|
|
225
|
+
country: country.value
|
|
226
|
+
},
|
|
227
|
+
success: function (data) {
|
|
228
|
+
|
|
229
|
+
const response = JSON.parse(data);
|
|
230
|
+
|
|
231
|
+
textListOptions( inputState, response );
|
|
232
|
+
|
|
233
|
+
inputState.disabled = false;
|
|
234
|
+
|
|
235
|
+
if (stateValue != null && stateValue != "") { textListValue(inputState, stateValue); }
|
|
236
|
+
|
|
237
|
+
loadingSpinner();
|
|
238
|
+
|
|
239
|
+
},
|
|
240
|
+
error: function (XMLHttpRequest) {
|
|
241
|
+
|
|
242
|
+
ajaxRequestError(XMLHttpRequest);
|
|
243
|
+
loadingSpinner();
|
|
244
|
+
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
});
|
|
251
|
+
|
|
176
252
|
}
|