@optionfactory/ful 0.60.0 → 0.62.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 -32
- 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 -32
- 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
|
-
|
|
1123
|
+
input.addEventListener('change', (evt) => {
|
|
1124
|
+
evt.stopPropagation();
|
|
1125
|
+
if(!Events$1.dispatchChange(el, undefined.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,6 +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
|
|
1240
|
+
input.addEventListener('change', (evt) => {
|
|
1241
|
+
evt.stopPropagation();
|
|
1242
|
+
});
|
|
1230
1243
|
input.remove();
|
|
1231
1244
|
template.renderTo(this, { id, tsId, name, input, slots });
|
|
1232
1245
|
}
|
|
@@ -1238,16 +1251,12 @@ var ful = (function (exports) {
|
|
|
1238
1251
|
this.value = this.getAttribute("value");
|
|
1239
1252
|
}
|
|
1240
1253
|
}
|
|
1254
|
+
get value() {
|
|
1255
|
+
const v = this.ts.getValue();
|
|
1256
|
+
return v === '' ? null : v;
|
|
1257
|
+
}
|
|
1241
1258
|
set value(value) {
|
|
1242
|
-
|
|
1243
|
-
bubbles: true,
|
|
1244
|
-
cancelable: true,
|
|
1245
|
-
detail: {
|
|
1246
|
-
target: this,
|
|
1247
|
-
value: value
|
|
1248
|
-
}
|
|
1249
|
-
}));
|
|
1250
|
-
if(!success){
|
|
1259
|
+
if(!Events.dispatchChange(this, value)){
|
|
1251
1260
|
return;
|
|
1252
1261
|
}
|
|
1253
1262
|
(async () => {
|
|
@@ -1257,10 +1266,6 @@ var ful = (function (exports) {
|
|
|
1257
1266
|
this.ts.setValue(value);
|
|
1258
1267
|
})();
|
|
1259
1268
|
}
|
|
1260
|
-
get value() {
|
|
1261
|
-
const v = this.ts.getValue();
|
|
1262
|
-
return v === '' ? null : v;
|
|
1263
|
-
}
|
|
1264
1269
|
}
|
|
1265
1270
|
|
|
1266
1271
|
class RadioGroup extends ParsedElement({
|
|
@@ -1300,9 +1305,19 @@ var ful = (function (exports) {
|
|
|
1300
1305
|
input.setAttribute('name', `${name}-ignore`);
|
|
1301
1306
|
input.setAttribute('ful-validation-target', '');
|
|
1302
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
|
+
});
|
|
1303
1317
|
const label = Fragments.fromChildNodes(el);
|
|
1304
1318
|
return [input, label];
|
|
1305
1319
|
});
|
|
1320
|
+
|
|
1306
1321
|
radioEls.forEach(el => el.remove());
|
|
1307
1322
|
template.renderTo(this, {name, slots, inputsAndLabels});
|
|
1308
1323
|
}
|
|
@@ -1311,15 +1326,7 @@ var ful = (function (exports) {
|
|
|
1311
1326
|
return checked ? checked.value : null;
|
|
1312
1327
|
}
|
|
1313
1328
|
set value(value) {
|
|
1314
|
-
|
|
1315
|
-
bubbles: true,
|
|
1316
|
-
cancelable: true,
|
|
1317
|
-
detail: {
|
|
1318
|
-
target: this,
|
|
1319
|
-
value: value
|
|
1320
|
-
}
|
|
1321
|
-
}));
|
|
1322
|
-
if(!success){
|
|
1329
|
+
if(!Events.dispatchChange(this, value)){
|
|
1323
1330
|
return;
|
|
1324
1331
|
}
|
|
1325
1332
|
this.querySelector(`input[type=radio][value=${CSS.escape(value)}]`).checked = true;
|