@optionfactory/ful 0.61.0 → 0.63.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/dist/ful.iife.js +39 -34
- package/dist/ful.iife.js.map +1 -1
- package/dist/ful.iife.min.js +1 -1
- package/dist/ful.iife.min.js.map +1 -1
- package/dist/ful.min.mjs +1 -1
- package/dist/ful.min.mjs.map +1 -1
- package/dist/ful.mjs +39 -34
- package/dist/ful.mjs.map +1 -1
- package/package.json +1 -1
package/dist/ful.iife.js
CHANGED
|
@@ -710,6 +710,19 @@ var ful = (function (exports) {
|
|
|
710
710
|
}
|
|
711
711
|
}
|
|
712
712
|
|
|
713
|
+
class Events$1 {
|
|
714
|
+
static dispatchChange(el, value){
|
|
715
|
+
return el.dispatchEvent(new CustomEvent("change", {
|
|
716
|
+
bubbles: true,
|
|
717
|
+
cancelable: true,
|
|
718
|
+
detail: {
|
|
719
|
+
target: el,
|
|
720
|
+
value: value
|
|
721
|
+
}
|
|
722
|
+
}));
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
|
|
713
726
|
class TemplatesRegistry {
|
|
714
727
|
#idToFragment = {};
|
|
715
728
|
#idToTemplate = {};
|
|
@@ -1107,7 +1120,12 @@ var ful = (function (exports) {
|
|
|
1107
1120
|
return el;
|
|
1108
1121
|
})();
|
|
1109
1122
|
input.setAttribute('ful-validation-target', '');
|
|
1110
|
-
input.addEventListener('change', (evt) =>
|
|
1123
|
+
input.addEventListener('change', (evt) => {
|
|
1124
|
+
evt.stopPropagation();
|
|
1125
|
+
if(!Events$1.dispatchChange(el, el.value)){
|
|
1126
|
+
evt.preventDefault();
|
|
1127
|
+
}
|
|
1128
|
+
});
|
|
1111
1129
|
const id = input.getAttribute('id') || el.getAttribute('input-id') || Attributes.uid('ful-input');
|
|
1112
1130
|
Attributes.forward('input-', el, slots.input);
|
|
1113
1131
|
Attributes.defaultValue(slots.input, "id", id);
|
|
@@ -1130,15 +1148,7 @@ var ful = (function (exports) {
|
|
|
1130
1148
|
return this.input.value;
|
|
1131
1149
|
}
|
|
1132
1150
|
set value(value) {
|
|
1133
|
-
|
|
1134
|
-
bubbles: true,
|
|
1135
|
-
cancelable: true,
|
|
1136
|
-
detail: {
|
|
1137
|
-
target: this,
|
|
1138
|
-
value: value
|
|
1139
|
-
}
|
|
1140
|
-
}));
|
|
1141
|
-
if(!success){
|
|
1151
|
+
if(!Events$1.dispatchChange(el, value)){
|
|
1142
1152
|
return;
|
|
1143
1153
|
}
|
|
1144
1154
|
this.input.value = value;
|
|
@@ -1227,7 +1237,9 @@ var ful = (function (exports) {
|
|
|
1227
1237
|
shouldLoad: (query) => this.shouldLoad ? this.shouldLoad(query) : true
|
|
1228
1238
|
} : {}, tsDefaultConfig, this.tsConfig));
|
|
1229
1239
|
//we remove the input to move it
|
|
1230
|
-
input.addEventListener('change', (evt) =>
|
|
1240
|
+
input.addEventListener('change', (evt) => {
|
|
1241
|
+
evt.stopPropagation();
|
|
1242
|
+
});
|
|
1231
1243
|
input.remove();
|
|
1232
1244
|
template.renderTo(this, { id, tsId, name, input, slots });
|
|
1233
1245
|
}
|
|
@@ -1239,16 +1251,12 @@ var ful = (function (exports) {
|
|
|
1239
1251
|
this.value = this.getAttribute("value");
|
|
1240
1252
|
}
|
|
1241
1253
|
}
|
|
1254
|
+
get value() {
|
|
1255
|
+
const v = this.ts.getValue();
|
|
1256
|
+
return v === '' ? null : v;
|
|
1257
|
+
}
|
|
1242
1258
|
set value(value) {
|
|
1243
|
-
|
|
1244
|
-
bubbles: true,
|
|
1245
|
-
cancelable: true,
|
|
1246
|
-
detail: {
|
|
1247
|
-
target: this,
|
|
1248
|
-
value: value
|
|
1249
|
-
}
|
|
1250
|
-
}));
|
|
1251
|
-
if(!success){
|
|
1259
|
+
if(!Events.dispatchChange(this, value)){
|
|
1252
1260
|
return;
|
|
1253
1261
|
}
|
|
1254
1262
|
(async () => {
|
|
@@ -1258,10 +1266,6 @@ var ful = (function (exports) {
|
|
|
1258
1266
|
this.ts.setValue(value);
|
|
1259
1267
|
})();
|
|
1260
1268
|
}
|
|
1261
|
-
get value() {
|
|
1262
|
-
const v = this.ts.getValue();
|
|
1263
|
-
return v === '' ? null : v;
|
|
1264
|
-
}
|
|
1265
1269
|
}
|
|
1266
1270
|
|
|
1267
1271
|
class RadioGroup extends ParsedElement({
|
|
@@ -1301,10 +1305,19 @@ var ful = (function (exports) {
|
|
|
1301
1305
|
input.setAttribute('name', `${name}-ignore`);
|
|
1302
1306
|
input.setAttribute('ful-validation-target', '');
|
|
1303
1307
|
input.dataset['fulBindInclude'] = 'never';
|
|
1308
|
+
input.addEventListener('change', (evt) => {
|
|
1309
|
+
evt.stopPropagation();
|
|
1310
|
+
console.log("stopped");
|
|
1311
|
+
});
|
|
1312
|
+
input.addEventListener('click', (evt) => {
|
|
1313
|
+
if(!Events.dispatchChange(this, this.value)){
|
|
1314
|
+
evt.preventDefault();
|
|
1315
|
+
}
|
|
1316
|
+
});
|
|
1304
1317
|
const label = Fragments.fromChildNodes(el);
|
|
1305
1318
|
return [input, label];
|
|
1306
1319
|
});
|
|
1307
|
-
|
|
1320
|
+
|
|
1308
1321
|
radioEls.forEach(el => el.remove());
|
|
1309
1322
|
template.renderTo(this, {name, slots, inputsAndLabels});
|
|
1310
1323
|
}
|
|
@@ -1313,15 +1326,7 @@ var ful = (function (exports) {
|
|
|
1313
1326
|
return checked ? checked.value : null;
|
|
1314
1327
|
}
|
|
1315
1328
|
set value(value) {
|
|
1316
|
-
|
|
1317
|
-
bubbles: true,
|
|
1318
|
-
cancelable: true,
|
|
1319
|
-
detail: {
|
|
1320
|
-
target: this,
|
|
1321
|
-
value: value
|
|
1322
|
-
}
|
|
1323
|
-
}));
|
|
1324
|
-
if(!success){
|
|
1329
|
+
if(!Events.dispatchChange(this, value)){
|
|
1325
1330
|
return;
|
|
1326
1331
|
}
|
|
1327
1332
|
this.querySelector(`input[type=radio][value=${CSS.escape(value)}]`).checked = true;
|