bhl-forms 0.2.0 → 0.2.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/bhl-forms.es.js +322 -142
- package/dist/bhl-forms.iife.js +7 -7
- package/dist/bhl-forms.modern.es.js +382 -278
- package/dist/bhl-forms.modern.iife.js +10 -10
- package/dist/bhl-forms.modern.umd.js +10 -10
- package/dist/bhl-forms.umd.js +7 -7
- package/dist/forms/accidentsAndInjuries.es.js +33 -21
- package/dist/forms/accidentsAndInjuries.iife.js +1 -1
- package/dist/forms/accidentsAndInjuries.json +1 -1
- package/dist/forms/appraisals.es.js +27 -17
- package/dist/forms/appraisals.iife.js +1 -1
- package/dist/forms/appraisals.json +1 -1
- package/dist/forms/childAndFamily.es.js +33 -21
- package/dist/forms/childAndFamily.iife.js +1 -1
- package/dist/forms/childAndFamily.json +1 -1
- package/dist/forms/civilLawsuit.es.js +33 -21
- package/dist/forms/civilLawsuit.iife.js +1 -1
- package/dist/forms/civilLawsuit.json +1 -1
- package/dist/forms/coins.es.js +27 -17
- package/dist/forms/coins.iife.js +1 -1
- package/dist/forms/coins.json +1 -1
- package/dist/forms/contracts.es.js +94 -32
- package/dist/forms/contracts.iife.js +1 -1
- package/dist/forms/contracts.json +1 -1
- package/dist/forms/criminal.es.js +33 -21
- package/dist/forms/criminal.iife.js +1 -1
- package/dist/forms/criminal.json +1 -1
- package/dist/forms/employmentAndWorkplace.es.js +33 -21
- package/dist/forms/employmentAndWorkplace.iife.js +1 -1
- package/dist/forms/employmentAndWorkplace.json +1 -1
- package/dist/forms/generalLegal.es.js +33 -21
- package/dist/forms/generalLegal.iife.js +1 -1
- package/dist/forms/generalLegal.json +1 -1
- package/dist/forms/generalLegalPopUnder.es.js +33 -21
- package/dist/forms/generalLegalPopUnder.iife.js +1 -1
- package/dist/forms/generalLegalPopUnder.json +1 -1
- package/dist/forms/generalLegalPopUnderTF.es.js +33 -21
- package/dist/forms/generalLegalPopUnderTF.iife.js +1 -1
- package/dist/forms/generalLegalPopUnderTF.json +1 -1
- package/dist/forms/generalLegalThankYou.es.js +33 -21
- package/dist/forms/generalLegalThankYou.iife.js +1 -1
- package/dist/forms/generalLegalThankYou.json +1 -1
- package/dist/forms/harassmentAndDiscrimination.es.js +33 -21
- package/dist/forms/harassmentAndDiscrimination.iife.js +1 -1
- package/dist/forms/harassmentAndDiscrimination.json +1 -1
- package/dist/forms/malpractice.es.js +94 -32
- package/dist/forms/malpractice.iife.js +1 -1
- package/dist/forms/malpractice.json +1 -1
- package/dist/forms/mechanics.es.js +27 -17
- package/dist/forms/mechanics.iife.js +1 -1
- package/dist/forms/mechanics.json +1 -1
- package/dist/forms/realEstate.es.js +33 -21
- package/dist/forms/realEstate.iife.js +1 -1
- package/dist/forms/realEstate.json +1 -1
- package/dist/forms/repossession.es.js +94 -32
- package/dist/forms/repossession.iife.js +1 -1
- package/dist/forms/repossession.json +1 -1
- package/dist/forms/ssdi.es.js +183 -81
- package/dist/forms/ssdi.iife.js +1 -1
- package/dist/forms/ssdi.json +1 -1
- package/dist/forms/testForm.es.js +90 -29
- package/dist/forms/testForm.iife.js +1 -1
- package/dist/forms/testForm.json +1 -1
- package/dist/forms/testRedirects.es.js +19 -10
- package/dist/forms/testRedirects.iife.js +1 -1
- package/dist/forms/testRedirects.json +1 -1
- package/dist/forms/vets.es.js +27 -17
- package/dist/forms/vets.iife.js +1 -1
- package/dist/forms/vets.json +1 -1
- package/dist/forms/willsAndTrusts.es.js +33 -21
- package/dist/forms/willsAndTrusts.iife.js +1 -1
- package/dist/forms/willsAndTrusts.json +1 -1
- package/dist/main.css +1 -1
- package/package.json +4 -4
package/dist/bhl-forms.es.js
CHANGED
|
@@ -4976,10 +4976,6 @@ function init$2(obj) {
|
|
|
4976
4976
|
function slugify$1(str) {
|
|
4977
4977
|
return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]/g, " ").trim().replace(/\s+/g, "-");
|
|
4978
4978
|
}
|
|
4979
|
-
function isScalar$1(value) {
|
|
4980
|
-
const t2 = typeof value;
|
|
4981
|
-
return value === null || t2 !== "function" && t2 !== "object";
|
|
4982
|
-
}
|
|
4983
4979
|
function createDispatcher$2() {
|
|
4984
4980
|
const middleware = [];
|
|
4985
4981
|
let currentIndex = 0;
|
|
@@ -5344,9 +5340,7 @@ function hydrate$1(node, context) {
|
|
|
5344
5340
|
return;
|
|
5345
5341
|
if (child.name in _value) {
|
|
5346
5342
|
const childValue = child.type !== "input" || _value[child.name] && typeof _value[child.name] === "object" ? init$2(_value[child.name]) : _value[child.name];
|
|
5347
|
-
|
|
5348
|
-
child.input(childValue, false);
|
|
5349
|
-
}
|
|
5343
|
+
child.input(childValue, false);
|
|
5350
5344
|
} else {
|
|
5351
5345
|
if (node.type !== "list" || typeof child.name === "number") {
|
|
5352
5346
|
partial$1(context, { name: child.name, value: child.value });
|
|
@@ -5398,34 +5392,35 @@ function destroy$1(node, context) {
|
|
|
5398
5392
|
node.emit("destroying", node);
|
|
5399
5393
|
node.store.filter(() => false);
|
|
5400
5394
|
if (node.parent) {
|
|
5395
|
+
node.parent.emit("childRemoved", node);
|
|
5401
5396
|
node.parent.remove(node);
|
|
5402
5397
|
}
|
|
5403
5398
|
deregister$1(node);
|
|
5404
5399
|
context._value = context.value = void 0;
|
|
5405
5400
|
node.emit("destroyed", node);
|
|
5406
5401
|
}
|
|
5407
|
-
function define$1(node, context,
|
|
5408
|
-
context.type =
|
|
5409
|
-
context.props.definition = clone$1(
|
|
5402
|
+
function define$1(node, context, definition2) {
|
|
5403
|
+
context.type = definition2.type;
|
|
5404
|
+
context.props.definition = clone$1(definition2);
|
|
5410
5405
|
context.value = context._value = createValue$1({
|
|
5411
5406
|
type: node.type,
|
|
5412
5407
|
value: context.value
|
|
5413
5408
|
});
|
|
5414
|
-
if (
|
|
5409
|
+
if (definition2.forceTypeProp) {
|
|
5415
5410
|
if (node.props.type)
|
|
5416
5411
|
node.props.originalType = node.props.type;
|
|
5417
|
-
context.props.type =
|
|
5412
|
+
context.props.type = definition2.forceTypeProp;
|
|
5418
5413
|
}
|
|
5419
|
-
if (
|
|
5420
|
-
context.props.family =
|
|
5414
|
+
if (definition2.family) {
|
|
5415
|
+
context.props.family = definition2.family;
|
|
5421
5416
|
}
|
|
5422
|
-
if (
|
|
5423
|
-
|
|
5417
|
+
if (definition2.features) {
|
|
5418
|
+
definition2.features.forEach((feature) => feature(node));
|
|
5424
5419
|
}
|
|
5425
|
-
if (
|
|
5426
|
-
node.addProps(
|
|
5420
|
+
if (definition2.props) {
|
|
5421
|
+
node.addProps(definition2.props);
|
|
5427
5422
|
}
|
|
5428
|
-
node.emit("defined",
|
|
5423
|
+
node.emit("defined", definition2);
|
|
5429
5424
|
}
|
|
5430
5425
|
function addProps$1(node, context, props2) {
|
|
5431
5426
|
var _a;
|
|
@@ -6383,10 +6378,6 @@ function applyExplicit(original, obj, explicit) {
|
|
|
6383
6378
|
}
|
|
6384
6379
|
return obj;
|
|
6385
6380
|
}
|
|
6386
|
-
function isScalar(value) {
|
|
6387
|
-
const t2 = typeof value;
|
|
6388
|
-
return value === null || t2 !== "function" && t2 !== "object";
|
|
6389
|
-
}
|
|
6390
6381
|
function createDispatcher$1() {
|
|
6391
6382
|
const middleware = [];
|
|
6392
6383
|
let currentIndex = 0;
|
|
@@ -7054,9 +7045,7 @@ function hydrate(node, context) {
|
|
|
7054
7045
|
return;
|
|
7055
7046
|
if (child.name in _value) {
|
|
7056
7047
|
const childValue = child.type !== "input" || _value[child.name] && typeof _value[child.name] === "object" ? init$1(_value[child.name]) : _value[child.name];
|
|
7057
|
-
|
|
7058
|
-
child.input(childValue, false);
|
|
7059
|
-
}
|
|
7048
|
+
child.input(childValue, false);
|
|
7060
7049
|
} else {
|
|
7061
7050
|
if (node.type !== "list" || typeof child.name === "number") {
|
|
7062
7051
|
partial(context, { name: child.name, value: child.value });
|
|
@@ -7108,34 +7097,35 @@ function destroy(node, context) {
|
|
|
7108
7097
|
node.emit("destroying", node);
|
|
7109
7098
|
node.store.filter(() => false);
|
|
7110
7099
|
if (node.parent) {
|
|
7100
|
+
node.parent.emit("childRemoved", node);
|
|
7111
7101
|
node.parent.remove(node);
|
|
7112
7102
|
}
|
|
7113
7103
|
deregister(node);
|
|
7114
7104
|
context._value = context.value = void 0;
|
|
7115
7105
|
node.emit("destroyed", node);
|
|
7116
7106
|
}
|
|
7117
|
-
function define(node, context,
|
|
7118
|
-
context.type =
|
|
7119
|
-
context.props.definition = clone(
|
|
7107
|
+
function define(node, context, definition2) {
|
|
7108
|
+
context.type = definition2.type;
|
|
7109
|
+
context.props.definition = clone(definition2);
|
|
7120
7110
|
context.value = context._value = createValue({
|
|
7121
7111
|
type: node.type,
|
|
7122
7112
|
value: context.value
|
|
7123
7113
|
});
|
|
7124
|
-
if (
|
|
7114
|
+
if (definition2.forceTypeProp) {
|
|
7125
7115
|
if (node.props.type)
|
|
7126
7116
|
node.props.originalType = node.props.type;
|
|
7127
|
-
context.props.type =
|
|
7117
|
+
context.props.type = definition2.forceTypeProp;
|
|
7128
7118
|
}
|
|
7129
|
-
if (
|
|
7130
|
-
context.props.family =
|
|
7119
|
+
if (definition2.family) {
|
|
7120
|
+
context.props.family = definition2.family;
|
|
7131
7121
|
}
|
|
7132
|
-
if (
|
|
7133
|
-
|
|
7122
|
+
if (definition2.features) {
|
|
7123
|
+
definition2.features.forEach((feature) => feature(node));
|
|
7134
7124
|
}
|
|
7135
|
-
if (
|
|
7136
|
-
node.addProps(
|
|
7125
|
+
if (definition2.props) {
|
|
7126
|
+
node.addProps(definition2.props);
|
|
7137
7127
|
}
|
|
7138
|
-
node.emit("defined",
|
|
7128
|
+
node.emit("defined", definition2);
|
|
7139
7129
|
}
|
|
7140
7130
|
function addProps(node, context, props2) {
|
|
7141
7131
|
var _a;
|
|
@@ -7918,15 +7908,34 @@ function createClasses(propertyKey, node, sectionClassList) {
|
|
|
7918
7908
|
function generateClassList(node, property, ...args) {
|
|
7919
7909
|
const combinedClassList = args.reduce((finalClassList, currentClassList) => {
|
|
7920
7910
|
if (!currentClassList)
|
|
7921
|
-
return finalClassList;
|
|
7911
|
+
return handleNegativeClasses(finalClassList);
|
|
7922
7912
|
const _a = currentClassList, { $reset } = _a, classList = __objRest(_a, ["$reset"]);
|
|
7923
7913
|
if ($reset) {
|
|
7924
|
-
return classList;
|
|
7914
|
+
return handleNegativeClasses(classList);
|
|
7925
7915
|
}
|
|
7926
|
-
return Object.assign(finalClassList, classList);
|
|
7916
|
+
return handleNegativeClasses(Object.assign(finalClassList, classList));
|
|
7927
7917
|
}, {});
|
|
7928
7918
|
return Object.keys(node.hook.classes.dispatch({ property, classes: combinedClassList }).classes).filter((key) => combinedClassList[key]).join(" ") || null;
|
|
7929
7919
|
}
|
|
7920
|
+
function handleNegativeClasses(classList) {
|
|
7921
|
+
const removalToken = "$remove:";
|
|
7922
|
+
let hasNegativeClassValue = false;
|
|
7923
|
+
const applicableClasses = Object.keys(classList).filter((className) => {
|
|
7924
|
+
if (classList[className] && className.startsWith(removalToken)) {
|
|
7925
|
+
hasNegativeClassValue = true;
|
|
7926
|
+
}
|
|
7927
|
+
return classList[className];
|
|
7928
|
+
});
|
|
7929
|
+
if (applicableClasses.length > 1 && hasNegativeClassValue) {
|
|
7930
|
+
const negativeClasses = applicableClasses.filter((className) => className.startsWith(removalToken));
|
|
7931
|
+
negativeClasses.map((negativeClass) => {
|
|
7932
|
+
const targetClass = negativeClass.substring(removalToken.length);
|
|
7933
|
+
classList[targetClass] = false;
|
|
7934
|
+
classList[negativeClass] = false;
|
|
7935
|
+
});
|
|
7936
|
+
}
|
|
7937
|
+
return classList;
|
|
7938
|
+
}
|
|
7930
7939
|
function setErrors(id, localErrors, childErrors) {
|
|
7931
7940
|
const node = getNode$1(id);
|
|
7932
7941
|
if (node) {
|
|
@@ -7943,7 +7952,7 @@ function clearErrors(id, clearChildren = true) {
|
|
|
7943
7952
|
warn(652, id);
|
|
7944
7953
|
}
|
|
7945
7954
|
}
|
|
7946
|
-
const FORMKIT_VERSION = "
|
|
7955
|
+
const FORMKIT_VERSION = "0.16.4";
|
|
7947
7956
|
function createLibraryPlugin(...libraries) {
|
|
7948
7957
|
const library = libraries.reduce((merged, lib) => extend(merged, lib), {});
|
|
7949
7958
|
const plugin2 = () => {
|
|
@@ -7995,6 +8004,8 @@ function optionValue(options2, value) {
|
|
|
7995
8004
|
return value;
|
|
7996
8005
|
}
|
|
7997
8006
|
function shouldSelect(valueA, valueB) {
|
|
8007
|
+
if (valueA === null && valueB === void 0 || valueA === void 0 && valueB === null)
|
|
8008
|
+
return false;
|
|
7998
8009
|
if (valueA == valueB)
|
|
7999
8010
|
return true;
|
|
8000
8011
|
if (isPojo(valueA) && isPojo(valueB))
|
|
@@ -8041,11 +8052,11 @@ const label = createSection("label", () => ({
|
|
|
8041
8052
|
for: "$id"
|
|
8042
8053
|
}
|
|
8043
8054
|
}));
|
|
8044
|
-
const messages = createSection("messages", () => ({
|
|
8055
|
+
const messages$1 = createSection("messages", () => ({
|
|
8045
8056
|
$el: "ul",
|
|
8046
|
-
if: "$fns.length($messages)"
|
|
8057
|
+
if: "$defaultMessagePlacement && $fns.length($messages)"
|
|
8047
8058
|
}));
|
|
8048
|
-
const message = createSection("message", () => ({
|
|
8059
|
+
const message$1 = createSection("message", () => ({
|
|
8049
8060
|
$el: "li",
|
|
8050
8061
|
for: ["message", "$messages"],
|
|
8051
8062
|
attrs: {
|
|
@@ -8126,6 +8137,11 @@ const boxWrapper = createSection("wrapper", () => ({
|
|
|
8126
8137
|
if: "$options.length",
|
|
8127
8138
|
then: void 0,
|
|
8128
8139
|
else: "$disabled || undefined"
|
|
8140
|
+
},
|
|
8141
|
+
"data-checked": {
|
|
8142
|
+
if: "$options == undefined",
|
|
8143
|
+
then: "$fns.eq($_value, $onValue) || undefined",
|
|
8144
|
+
else: "$fns.isChecked($option.value) || undefined"
|
|
8129
8145
|
}
|
|
8130
8146
|
}
|
|
8131
8147
|
}));
|
|
@@ -8209,7 +8225,6 @@ const submitInput = createSection("submit", () => ({
|
|
|
8209
8225
|
$cmp: "FormKit",
|
|
8210
8226
|
bind: "$submitAttrs",
|
|
8211
8227
|
props: {
|
|
8212
|
-
ignore: true,
|
|
8213
8228
|
type: "submit",
|
|
8214
8229
|
disabled: "$disabled",
|
|
8215
8230
|
label: "$submitLabel"
|
|
@@ -8300,7 +8315,9 @@ function normalizeBoxes(node) {
|
|
|
8300
8315
|
var _a;
|
|
8301
8316
|
if (!((_a = option2.attrs) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
8302
8317
|
return extend(option2, {
|
|
8303
|
-
attrs: {
|
|
8318
|
+
attrs: {
|
|
8319
|
+
id: `${node.name}-option-${slugify(String(option2.value))}`
|
|
8320
|
+
}
|
|
8304
8321
|
});
|
|
8305
8322
|
}
|
|
8306
8323
|
return option2;
|
|
@@ -8461,13 +8478,13 @@ function handleSubmit(node, submitEvent) {
|
|
|
8461
8478
|
return __async(this, null, function* () {
|
|
8462
8479
|
submitEvent.preventDefault();
|
|
8463
8480
|
yield node.settled;
|
|
8464
|
-
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
|
|
8470
|
-
|
|
8481
|
+
const setSubmitted = (n) => n.store.set(createMessage({
|
|
8482
|
+
key: "submitted",
|
|
8483
|
+
value: true,
|
|
8484
|
+
visible: false
|
|
8485
|
+
}));
|
|
8486
|
+
node.walk(setSubmitted);
|
|
8487
|
+
setSubmitted(node);
|
|
8471
8488
|
if (typeof node.props.onSubmitRaw === "function") {
|
|
8472
8489
|
node.props.onSubmitRaw(submitEvent, node);
|
|
8473
8490
|
}
|
|
@@ -8684,7 +8701,7 @@ function extendSchema(schema, extension = {}) {
|
|
|
8684
8701
|
return extend(schema, extension);
|
|
8685
8702
|
}
|
|
8686
8703
|
function useSchema(inputSection) {
|
|
8687
|
-
return outer(wrapper(label("$label"), inner(prefix(), inputSection(), suffix())), help("$help"), messages(message("$message.value")));
|
|
8704
|
+
return outer(wrapper(label("$label"), inner(prefix(), inputSection(), suffix())), help("$help"), messages$1(message$1("$message.value")));
|
|
8688
8705
|
}
|
|
8689
8706
|
function createSection(section, el, root = false) {
|
|
8690
8707
|
return (...children) => {
|
|
@@ -8711,6 +8728,7 @@ function createSection(section, el, root = false) {
|
|
|
8711
8728
|
else: section in extensions ? extendSchema(node, extensions[section]) : node
|
|
8712
8729
|
};
|
|
8713
8730
|
};
|
|
8731
|
+
extendable._s = section;
|
|
8714
8732
|
return root ? createRoot(extendable) : extendable;
|
|
8715
8733
|
};
|
|
8716
8734
|
}
|
|
@@ -8720,7 +8738,7 @@ function createRoot(rootSection) {
|
|
|
8720
8738
|
};
|
|
8721
8739
|
}
|
|
8722
8740
|
function $if(condition, then, otherwise) {
|
|
8723
|
-
|
|
8741
|
+
const extendable = (extensions) => {
|
|
8724
8742
|
const node = then(extensions);
|
|
8725
8743
|
if (otherwise || isSchemaObject(node) && "if" in node || isSlotCondition(node)) {
|
|
8726
8744
|
const conditionalNode = {
|
|
@@ -8738,24 +8756,28 @@ function $if(condition, then, otherwise) {
|
|
|
8738
8756
|
}
|
|
8739
8757
|
return node;
|
|
8740
8758
|
};
|
|
8759
|
+
extendable._s = token();
|
|
8760
|
+
return extendable;
|
|
8741
8761
|
}
|
|
8742
8762
|
function $extend(section, extendWith) {
|
|
8743
|
-
|
|
8763
|
+
const extendable = (extensions) => {
|
|
8744
8764
|
const node = section({});
|
|
8745
8765
|
if (isSlotCondition(node)) {
|
|
8746
8766
|
if (Array.isArray(node.else))
|
|
8747
8767
|
return node;
|
|
8748
|
-
node.else = extendSchema(extendSchema(node.else, extendWith), extensions);
|
|
8768
|
+
node.else = extendSchema(extendSchema(node.else, extendWith), section._s ? extensions[section._s] : {});
|
|
8749
8769
|
return node;
|
|
8750
8770
|
}
|
|
8751
|
-
return extendSchema(extendSchema(node, extendWith), extensions);
|
|
8771
|
+
return extendSchema(extendSchema(node, extendWith), section._s ? extensions[section._s] : {});
|
|
8752
8772
|
};
|
|
8773
|
+
extendable._s = section._s;
|
|
8774
|
+
return extendable;
|
|
8753
8775
|
}
|
|
8754
8776
|
function $root(section) {
|
|
8755
8777
|
return createRoot(section);
|
|
8756
8778
|
}
|
|
8757
8779
|
const button = {
|
|
8758
|
-
schema: outer(messages(message("$message.value")), wrapper(buttonInput(icon("prefix"), prefix(), buttonLabel("$label || $ui.submit.value"), suffix(), icon("suffix"))), help("$help")),
|
|
8780
|
+
schema: outer(messages$1(message$1("$message.value")), wrapper(buttonInput(icon("prefix"), prefix(), buttonLabel("$label || $ui.submit.value"), suffix(), icon("suffix"))), help("$help")),
|
|
8759
8781
|
type: "input",
|
|
8760
8782
|
family: "button",
|
|
8761
8783
|
props: [],
|
|
@@ -8780,7 +8802,7 @@ const checkbox = {
|
|
|
8780
8802
|
})), boxHelp("$option.help"))))
|
|
8781
8803
|
),
|
|
8782
8804
|
$if("$options == undefined && $help", help("$help")),
|
|
8783
|
-
messages(message("$message.value"))
|
|
8805
|
+
messages$1(message$1("$message.value"))
|
|
8784
8806
|
),
|
|
8785
8807
|
type: "input",
|
|
8786
8808
|
family: "box",
|
|
@@ -8792,7 +8814,7 @@ const checkbox = {
|
|
|
8792
8814
|
]
|
|
8793
8815
|
};
|
|
8794
8816
|
const file = {
|
|
8795
|
-
schema: outer(wrapper(label("$label"), inner(icon("prefix", "label"), prefix(), fileInput(), fileList(fileItem(icon("fileItem"), fileName("$file.name"), $if("$value.length === 1", fileRemove(icon("fileRemove"), "$ui.remove.value")))), $if("$value.length > 1", fileRemove("$ui.removeAll.value")), noFiles(icon("noFiles"), "$ui.noFiles.value"), suffix(), icon("suffix"))), help("$help"), messages(message("$message.value"))),
|
|
8817
|
+
schema: outer(wrapper(label("$label"), inner(icon("prefix", "label"), prefix(), fileInput(), fileList(fileItem(icon("fileItem"), fileName("$file.name"), $if("$value.length === 1", fileRemove(icon("fileRemove"), "$ui.remove.value")))), $if("$value.length > 1", fileRemove("$ui.removeAll.value")), noFiles(icon("noFiles"), "$ui.noFiles.value"), suffix(), icon("suffix"))), help("$help"), messages$1(message$1("$message.value"))),
|
|
8796
8818
|
type: "input",
|
|
8797
8819
|
family: "text",
|
|
8798
8820
|
props: [],
|
|
@@ -8804,7 +8826,7 @@ const file = {
|
|
|
8804
8826
|
]
|
|
8805
8827
|
};
|
|
8806
8828
|
const form = {
|
|
8807
|
-
schema: formInput("$slots.default", messages(message("$message.value")), actions(submitInput())),
|
|
8829
|
+
schema: formInput("$slots.default", messages$1(message$1("$message.value")), actions(submitInput())),
|
|
8808
8830
|
type: "group",
|
|
8809
8831
|
props: [
|
|
8810
8832
|
"actions",
|
|
@@ -8849,27 +8871,32 @@ const radio = {
|
|
|
8849
8871
|
}), decorator(icon("decorator")), suffix()), $if("$option.label", boxLabel("$option.label"))), boxHelp("$option.help"))))
|
|
8850
8872
|
),
|
|
8851
8873
|
$if("$options === undefined && $help", help("$help")),
|
|
8852
|
-
messages(message("$message.value"))
|
|
8874
|
+
messages$1(message$1("$message.value"))
|
|
8853
8875
|
),
|
|
8854
8876
|
type: "input",
|
|
8855
8877
|
family: "box",
|
|
8856
8878
|
props: ["options", "onValue", "offValue", "optionsLoader"],
|
|
8857
|
-
features: [
|
|
8879
|
+
features: [
|
|
8880
|
+
disables,
|
|
8881
|
+
options,
|
|
8882
|
+
radios,
|
|
8883
|
+
defaultIcon("decorator", "radioDecorator")
|
|
8884
|
+
]
|
|
8858
8885
|
};
|
|
8859
8886
|
const select = {
|
|
8860
|
-
schema: outer(wrapper(label("$label"), inner(icon("prefix"), prefix(), selectInput$1($if("$slots.default", () => "$slots.default", $if("$slots.option", optionSlot, option("$option.label")))), $if("$attrs.multiple !== undefined", () => "", icon("select")), suffix(), icon("suffix"))), help("$help"), messages(message("$message.value"))),
|
|
8887
|
+
schema: outer(wrapper(label("$label"), inner(icon("prefix"), prefix(), selectInput$1($if("$slots.default", () => "$slots.default", $if("$slots.option", optionSlot, option("$option.label")))), $if("$attrs.multiple !== undefined", () => "", icon("select")), suffix(), icon("suffix"))), help("$help"), messages$1(message$1("$message.value"))),
|
|
8861
8888
|
type: "input",
|
|
8862
8889
|
props: ["options", "placeholder", "optionsLoader"],
|
|
8863
8890
|
features: [options, select$1, defaultIcon("select", "select")]
|
|
8864
8891
|
};
|
|
8865
8892
|
const textarea = {
|
|
8866
|
-
schema: outer(wrapper(label("$label"), inner(icon("prefix", "label"), prefix(), textareaInput(), suffix(), icon("suffix"))), help("$help"), messages(message("$message.value"))),
|
|
8893
|
+
schema: outer(wrapper(label("$label"), inner(icon("prefix", "label"), prefix(), textareaInput(), suffix(), icon("suffix"))), help("$help"), messages$1(message$1("$message.value"))),
|
|
8867
8894
|
type: "input",
|
|
8868
8895
|
props: [],
|
|
8869
8896
|
features: [initialValue]
|
|
8870
8897
|
};
|
|
8871
8898
|
const text = {
|
|
8872
|
-
schema: outer(wrapper(label("$label"), inner(icon("prefix", "label"), prefix(), textInput(), suffix(), icon("suffix"))), help("$help"), messages(message("$message.value"))),
|
|
8899
|
+
schema: outer(wrapper(label("$label"), inner(icon("prefix", "label"), prefix(), textInput(), suffix(), icon("suffix"))), help("$help"), messages$1(message$1("$message.value"))),
|
|
8873
8900
|
type: "input",
|
|
8874
8901
|
family: "text",
|
|
8875
8902
|
props: [],
|
|
@@ -9143,10 +9170,12 @@ function createObserver(node, dependencies) {
|
|
|
9143
9170
|
const { proxy: observed, revoke } = Proxy.revocable(node, {
|
|
9144
9171
|
get(...args) {
|
|
9145
9172
|
switch (args[1]) {
|
|
9173
|
+
case "_node":
|
|
9174
|
+
return node;
|
|
9146
9175
|
case "deps":
|
|
9147
9176
|
return deps;
|
|
9148
9177
|
case "watch":
|
|
9149
|
-
return (block) => watch(observed, block);
|
|
9178
|
+
return (block, after) => watch(observed, block, after);
|
|
9150
9179
|
case "observe":
|
|
9151
9180
|
return () => {
|
|
9152
9181
|
const old = new Map(deps);
|
|
@@ -9167,6 +9196,7 @@ function createObserver(node, dependencies) {
|
|
|
9167
9196
|
removeListeners(receipts2);
|
|
9168
9197
|
revokedObservers.add(args[2]);
|
|
9169
9198
|
revoke();
|
|
9199
|
+
return void 0;
|
|
9170
9200
|
};
|
|
9171
9201
|
}
|
|
9172
9202
|
const value = Reflect.get(...args);
|
|
@@ -9184,8 +9214,9 @@ function createObserver(node, dependencies) {
|
|
|
9184
9214
|
function applyListeners(node, [toAdd, toRemove], callback) {
|
|
9185
9215
|
toAdd.forEach((events, depNode) => {
|
|
9186
9216
|
events.forEach((event) => {
|
|
9217
|
+
var _a;
|
|
9187
9218
|
node.receipts.has(depNode) || node.receipts.set(depNode, {});
|
|
9188
|
-
node.receipts.set(depNode, Object.assign(node.receipts.get(depNode), {
|
|
9219
|
+
node.receipts.set(depNode, Object.assign((_a = node.receipts.get(depNode)) !== null && _a !== void 0 ? _a : {}, {
|
|
9189
9220
|
[event]: depNode.on(event, callback)
|
|
9190
9221
|
}));
|
|
9191
9222
|
});
|
|
@@ -9210,16 +9241,20 @@ function removeListeners(receipts2) {
|
|
|
9210
9241
|
}
|
|
9211
9242
|
});
|
|
9212
9243
|
}
|
|
9213
|
-
function watch(node, block) {
|
|
9214
|
-
|
|
9215
|
-
const oldDeps = new Map(node.deps);
|
|
9216
|
-
node.observe();
|
|
9217
|
-
const res = block(node);
|
|
9218
|
-
if (res instanceof Promise)
|
|
9219
|
-
yield res;
|
|
9244
|
+
function watch(node, block, after) {
|
|
9245
|
+
const doAfterObservation = (res2) => {
|
|
9220
9246
|
const newDeps = node.stopObserve();
|
|
9221
|
-
applyListeners(node, diffDeps(oldDeps, newDeps), () => watch(node, block));
|
|
9222
|
-
|
|
9247
|
+
applyListeners(node, diffDeps(oldDeps, newDeps), () => watch(node, block, after));
|
|
9248
|
+
if (after)
|
|
9249
|
+
after(res2);
|
|
9250
|
+
};
|
|
9251
|
+
const oldDeps = new Map(node.deps);
|
|
9252
|
+
node.observe();
|
|
9253
|
+
const res = block(node);
|
|
9254
|
+
if (res instanceof Promise)
|
|
9255
|
+
res.then((val) => doAfterObservation(val));
|
|
9256
|
+
else
|
|
9257
|
+
doAfterObservation(res);
|
|
9223
9258
|
}
|
|
9224
9259
|
function diffDeps(previous, current) {
|
|
9225
9260
|
const toAdd = /* @__PURE__ */ new Map();
|
|
@@ -9258,18 +9293,25 @@ const validatingMessage = createMessage({
|
|
|
9258
9293
|
});
|
|
9259
9294
|
function createValidationPlugin(baseRules = {}) {
|
|
9260
9295
|
return function validationPlugin(node) {
|
|
9261
|
-
let
|
|
9296
|
+
let propRules = cloneAny(node.props.validationRules || {});
|
|
9297
|
+
let availableRules = __spreadValues(__spreadValues({}, baseRules), propRules);
|
|
9262
9298
|
let observedNode = createObserver(node);
|
|
9263
9299
|
const state = { input: token(), rerun: null, isPassing: true };
|
|
9264
9300
|
let validation = cloneAny(node.props.validation);
|
|
9265
9301
|
node.on("prop:validation", ({ payload }) => reboot(payload, availableRules));
|
|
9266
9302
|
node.on("prop:validationRules", ({ payload }) => reboot(validation, payload));
|
|
9267
9303
|
function reboot(newValidation, newRules) {
|
|
9268
|
-
|
|
9304
|
+
var _a;
|
|
9305
|
+
if (eq(Object.keys(propRules || {}), Object.keys(newRules || {})) && eq(validation, newValidation))
|
|
9269
9306
|
return;
|
|
9307
|
+
propRules = cloneAny(newRules);
|
|
9270
9308
|
validation = cloneAny(newValidation);
|
|
9271
|
-
availableRules = __spreadValues(__spreadValues({}, baseRules),
|
|
9309
|
+
availableRules = __spreadValues(__spreadValues({}, baseRules), propRules);
|
|
9272
9310
|
removeListeners(observedNode.receipts);
|
|
9311
|
+
(_a = node.props.parsedRules) === null || _a === void 0 ? void 0 : _a.forEach((validation2) => {
|
|
9312
|
+
var _a2;
|
|
9313
|
+
validation2.messageObserver = (_a2 = validation2.messageObserver) === null || _a2 === void 0 ? void 0 : _a2.kill();
|
|
9314
|
+
});
|
|
9273
9315
|
node.store.filter(() => false, "validation");
|
|
9274
9316
|
node.props.parsedRules = parseRules(newValidation, availableRules);
|
|
9275
9317
|
observedNode.kill();
|
|
@@ -9356,27 +9398,38 @@ function runRule(validation, node, after) {
|
|
|
9356
9398
|
}
|
|
9357
9399
|
function removeMessage(node, validation) {
|
|
9358
9400
|
const key = `rule_${validation.name}`;
|
|
9401
|
+
if (validation.messageObserver) {
|
|
9402
|
+
validation.messageObserver = validation.messageObserver.kill();
|
|
9403
|
+
}
|
|
9359
9404
|
if (has(node.store, key)) {
|
|
9360
9405
|
node.store.remove(key);
|
|
9361
9406
|
}
|
|
9362
9407
|
}
|
|
9363
9408
|
function createFailedMessage(node, validation, removeImmediately) {
|
|
9364
|
-
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
|
|
9368
|
-
|
|
9369
|
-
|
|
9370
|
-
|
|
9371
|
-
|
|
9372
|
-
|
|
9373
|
-
|
|
9374
|
-
|
|
9375
|
-
|
|
9376
|
-
|
|
9409
|
+
if (isKilled(node))
|
|
9410
|
+
return;
|
|
9411
|
+
if (!validation.messageObserver) {
|
|
9412
|
+
validation.messageObserver = createObserver(node._node);
|
|
9413
|
+
}
|
|
9414
|
+
validation.messageObserver.watch((node2) => {
|
|
9415
|
+
const i18nArgs = createI18nArgs(node2, validation);
|
|
9416
|
+
return i18nArgs;
|
|
9417
|
+
}, (i18nArgs) => {
|
|
9418
|
+
const customMessage = createCustomMessage(node, validation, i18nArgs);
|
|
9419
|
+
const message2 = createMessage({
|
|
9420
|
+
blocking: validation.blocking,
|
|
9421
|
+
key: `rule_${validation.name}`,
|
|
9422
|
+
meta: {
|
|
9423
|
+
messageKey: validation.name,
|
|
9424
|
+
removeImmediately,
|
|
9425
|
+
localize: !customMessage,
|
|
9426
|
+
i18nArgs
|
|
9427
|
+
},
|
|
9428
|
+
type: "validation",
|
|
9429
|
+
value: customMessage || "This field is not valid."
|
|
9430
|
+
});
|
|
9431
|
+
node.store.set(message2);
|
|
9377
9432
|
});
|
|
9378
|
-
node.store.set(message2);
|
|
9379
|
-
return message2;
|
|
9380
9433
|
}
|
|
9381
9434
|
function createCustomMessage(node, validation, i18nArgs) {
|
|
9382
9435
|
const customMessage = node.props.validationMessages && has(node.props.validationMessages, validation.name) ? node.props.validationMessages[validation.name] : void 0;
|
|
@@ -9521,7 +9574,8 @@ function date2(date3) {
|
|
|
9521
9574
|
return "(unknown)";
|
|
9522
9575
|
}
|
|
9523
9576
|
return new Intl.DateTimeFormat(void 0, {
|
|
9524
|
-
dateStyle: "medium"
|
|
9577
|
+
dateStyle: "medium",
|
|
9578
|
+
timeZone: "UTC"
|
|
9525
9579
|
}).format(dateTime);
|
|
9526
9580
|
}
|
|
9527
9581
|
function order(first, second) {
|
|
@@ -9537,7 +9591,16 @@ const ui$u = {
|
|
|
9537
9591
|
moveUp: "Move up",
|
|
9538
9592
|
moveDown: "Move down",
|
|
9539
9593
|
isLoading: "Loading...",
|
|
9540
|
-
loadMore: "Load more"
|
|
9594
|
+
loadMore: "Load more",
|
|
9595
|
+
next: "Next",
|
|
9596
|
+
prev: "Previous",
|
|
9597
|
+
addAllValues: "Add all values",
|
|
9598
|
+
addSelectedValues: "Add selected values",
|
|
9599
|
+
removeAllValues: "Remove all values",
|
|
9600
|
+
removeSelectedValues: "Remove selected values",
|
|
9601
|
+
chooseDate: "Choose date",
|
|
9602
|
+
changeDate: "Change date",
|
|
9603
|
+
invalidDate: "The selected date is invalid."
|
|
9541
9604
|
};
|
|
9542
9605
|
const validation$u = {
|
|
9543
9606
|
accepted({ name }) {
|
|
@@ -9624,9 +9687,9 @@ const validation$u = {
|
|
|
9624
9687
|
},
|
|
9625
9688
|
min({ name, node: { value }, args }) {
|
|
9626
9689
|
if (Array.isArray(value)) {
|
|
9627
|
-
return `Cannot have
|
|
9690
|
+
return `Cannot have fewer than ${args[0]} ${name}.`;
|
|
9628
9691
|
}
|
|
9629
|
-
return
|
|
9692
|
+
return `Must be at least ${args[0]} ${name} .`;
|
|
9630
9693
|
},
|
|
9631
9694
|
not({ name, node: { value } }) {
|
|
9632
9695
|
return `\u201C${value}\u201D is not an allowed ${name}.`;
|
|
@@ -9641,7 +9704,7 @@ const validation$u = {
|
|
|
9641
9704
|
return `${sentence(name)} doesn\u2019t start with ${list(args)}.`;
|
|
9642
9705
|
},
|
|
9643
9706
|
url() {
|
|
9644
|
-
return `Please
|
|
9707
|
+
return `Please enter a valid URL.`;
|
|
9645
9708
|
}
|
|
9646
9709
|
};
|
|
9647
9710
|
var en = /* @__PURE__ */ Object.freeze({
|
|
@@ -9814,11 +9877,11 @@ function createIconHandler(iconLoader, iconLoaderUrl) {
|
|
|
9814
9877
|
}
|
|
9815
9878
|
if (typeof iconName !== "string")
|
|
9816
9879
|
return;
|
|
9817
|
-
const icon2 = iconRegistry[iconName];
|
|
9818
9880
|
const isDefault = iconName.startsWith("default:");
|
|
9819
9881
|
iconName = isDefault ? iconName.split(":")[1] : iconName;
|
|
9882
|
+
const iconWasAlreadyLoaded = iconName in iconRegistry;
|
|
9820
9883
|
let loadedIcon = void 0;
|
|
9821
|
-
if (
|
|
9884
|
+
if (iconWasAlreadyLoaded) {
|
|
9822
9885
|
return iconRegistry[iconName];
|
|
9823
9886
|
} else if (!iconRequests[iconName]) {
|
|
9824
9887
|
loadedIcon = getIconFromStylesheet(iconName);
|
|
@@ -9981,7 +10044,9 @@ function getRef(token2, data) {
|
|
|
9981
10044
|
return value;
|
|
9982
10045
|
}
|
|
9983
10046
|
const path = token2.split(".");
|
|
9984
|
-
watchEffect(() =>
|
|
10047
|
+
watchEffect(() => {
|
|
10048
|
+
value.value = getValue(isRef(data) ? data.value : data, path);
|
|
10049
|
+
});
|
|
9985
10050
|
return value;
|
|
9986
10051
|
}
|
|
9987
10052
|
function getValue(set2, path) {
|
|
@@ -10308,17 +10373,17 @@ function createRenderFn(instanceCreator, data, instanceKey2) {
|
|
|
10308
10373
|
return requirements.reduce((tokens, token2) => {
|
|
10309
10374
|
if (token2.startsWith("slots.")) {
|
|
10310
10375
|
const slot = token2.substring(6);
|
|
10311
|
-
const hasSlot = data.slots && has(data.slots, slot);
|
|
10376
|
+
const hasSlot = () => data.slots && has(data.slots, slot) && typeof data.slots[slot] === "function";
|
|
10312
10377
|
if (hints.if) {
|
|
10313
|
-
tokens[token2] =
|
|
10314
|
-
} else if (data.slots
|
|
10378
|
+
tokens[token2] = hasSlot;
|
|
10379
|
+
} else if (data.slots) {
|
|
10315
10380
|
const scopedData = slotData(data, instanceKey2);
|
|
10316
|
-
tokens[token2] = () => data.slots[slot](scopedData);
|
|
10317
|
-
return tokens;
|
|
10381
|
+
tokens[token2] = () => hasSlot() ? data.slots[slot](scopedData) : null;
|
|
10318
10382
|
}
|
|
10383
|
+
} else {
|
|
10384
|
+
const value = getRef(token2, data);
|
|
10385
|
+
tokens[token2] = () => useScope(token2, value.value);
|
|
10319
10386
|
}
|
|
10320
|
-
const value = getRef(token2, data);
|
|
10321
|
-
tokens[token2] = () => useScope(token2, value.value);
|
|
10322
10387
|
return tokens;
|
|
10323
10388
|
}, {});
|
|
10324
10389
|
}, instanceKey2);
|
|
@@ -10608,7 +10673,7 @@ const pseudoProps = [
|
|
|
10608
10673
|
"disabled",
|
|
10609
10674
|
"preserve",
|
|
10610
10675
|
/^preserve(-e|E)rrors/,
|
|
10611
|
-
/^[a-z]+(?:-visibility|Visibility)$/,
|
|
10676
|
+
/^[a-z]+(?:-visibility|Visibility|-behavior|Behavior)$/,
|
|
10612
10677
|
/^[a-zA-Z-]+(?:-class|Class)$/,
|
|
10613
10678
|
"prefixIcon",
|
|
10614
10679
|
"suffixIcon",
|
|
@@ -10640,10 +10705,11 @@ function onlyListeners(props2) {
|
|
|
10640
10705
|
return knownListeners;
|
|
10641
10706
|
}
|
|
10642
10707
|
function useInput(props2, context, options2 = {}) {
|
|
10708
|
+
var _a;
|
|
10643
10709
|
const config = Object.assign({}, inject(optionsSymbol) || {}, options2);
|
|
10644
10710
|
const instance = getCurrentInstance();
|
|
10645
10711
|
const listeners = onlyListeners(instance === null || instance === void 0 ? void 0 : instance.vnode.props);
|
|
10646
|
-
const isVModeled =
|
|
10712
|
+
const isVModeled = "modelValue" in ((_a = instance === null || instance === void 0 ? void 0 : instance.vnode.props) !== null && _a !== void 0 ? _a : {});
|
|
10647
10713
|
const value = props2.modelValue !== void 0 ? props2.modelValue : cloneAny(context.attrs.value);
|
|
10648
10714
|
function createInitialProps() {
|
|
10649
10715
|
const initialProps2 = __spreadValues(__spreadValues({}, nodeProps(props2)), listeners);
|
|
@@ -10719,6 +10785,8 @@ function useInput(props2, context, options2 = {}) {
|
|
|
10719
10785
|
}
|
|
10720
10786
|
watchEffect(() => {
|
|
10721
10787
|
const attrs = except(nodeProps(context.attrs), pseudoPropNames.value);
|
|
10788
|
+
if ("multiple" in attrs)
|
|
10789
|
+
attrs.multiple = undefine(attrs.multiple);
|
|
10722
10790
|
node.props.attrs = Object.assign({}, node.props.attrs || {}, attrs);
|
|
10723
10791
|
});
|
|
10724
10792
|
watchEffect(() => {
|
|
@@ -10760,8 +10828,8 @@ function useInput(props2, context, options2 = {}) {
|
|
|
10760
10828
|
let inputTimeout;
|
|
10761
10829
|
const mutex = /* @__PURE__ */ new WeakSet();
|
|
10762
10830
|
node.on("modelUpdated", () => {
|
|
10763
|
-
var
|
|
10764
|
-
context.emit("inputRaw", (
|
|
10831
|
+
var _a2, _b;
|
|
10832
|
+
context.emit("inputRaw", (_a2 = node.context) === null || _a2 === void 0 ? void 0 : _a2.value, node);
|
|
10765
10833
|
clearTimeout(inputTimeout);
|
|
10766
10834
|
inputTimeout = setTimeout(context.emit, 20, "input", (_b = node.context) === null || _b === void 0 ? void 0 : _b.value, node);
|
|
10767
10835
|
if (isVModeled && node.context) {
|
|
@@ -10774,7 +10842,7 @@ function useInput(props2, context, options2 = {}) {
|
|
|
10774
10842
|
});
|
|
10775
10843
|
if (isVModeled) {
|
|
10776
10844
|
watchVerbose(toRef(props2, "modelValue"), (path, value2) => {
|
|
10777
|
-
var
|
|
10845
|
+
var _a2;
|
|
10778
10846
|
const rawValue = useRaw(value2);
|
|
10779
10847
|
if (isObject(rawValue) && mutex.has(rawValue)) {
|
|
10780
10848
|
return mutex.delete(rawValue);
|
|
@@ -10782,7 +10850,7 @@ function useInput(props2, context, options2 = {}) {
|
|
|
10782
10850
|
if (!path.length)
|
|
10783
10851
|
node.input(value2, false);
|
|
10784
10852
|
else
|
|
10785
|
-
(
|
|
10853
|
+
(_a2 = node.at(path)) === null || _a2 === void 0 ? void 0 : _a2.input(value2, false);
|
|
10786
10854
|
});
|
|
10787
10855
|
if (node.value !== value) {
|
|
10788
10856
|
node.emit("modelUpdated");
|
|
@@ -10796,7 +10864,7 @@ function isComponent(obj) {
|
|
|
10796
10864
|
return typeof obj === "function" && obj.length === 2 || typeof obj === "object" && !Array.isArray(obj) && !("$el" in obj) && !("$cmp" in obj) && !("if" in obj);
|
|
10797
10865
|
}
|
|
10798
10866
|
function createInput(schemaOrComponent, definitionOptions = {}) {
|
|
10799
|
-
const
|
|
10867
|
+
const definition2 = __spreadValues({
|
|
10800
10868
|
type: "input"
|
|
10801
10869
|
}, definitionOptions);
|
|
10802
10870
|
let schema;
|
|
@@ -10808,15 +10876,69 @@ function createInput(schemaOrComponent, definitionOptions = {}) {
|
|
|
10808
10876
|
context: "$node.context"
|
|
10809
10877
|
}
|
|
10810
10878
|
}));
|
|
10811
|
-
|
|
10879
|
+
definition2.library = { [cmpName]: markRaw(schemaOrComponent) };
|
|
10812
10880
|
} else if (typeof schemaOrComponent === "function") {
|
|
10813
10881
|
schema = schemaOrComponent;
|
|
10814
10882
|
} else {
|
|
10815
10883
|
schema = createSection("input", () => cloneAny(schemaOrComponent));
|
|
10816
10884
|
}
|
|
10817
|
-
|
|
10818
|
-
return
|
|
10885
|
+
definition2.schema = useSchema(schema || "Schema undefined");
|
|
10886
|
+
return definition2;
|
|
10819
10887
|
}
|
|
10888
|
+
const messages = createSection("messages", () => ({
|
|
10889
|
+
$el: "ul",
|
|
10890
|
+
if: "$fns.length($messages)"
|
|
10891
|
+
}), true);
|
|
10892
|
+
const message = createSection("message", () => ({
|
|
10893
|
+
$el: "li",
|
|
10894
|
+
for: ["message", "$messages"],
|
|
10895
|
+
attrs: {
|
|
10896
|
+
key: "$message.key",
|
|
10897
|
+
id: `$id + '-' + $message.key`,
|
|
10898
|
+
"data-message-type": "$message.type"
|
|
10899
|
+
}
|
|
10900
|
+
}));
|
|
10901
|
+
const definition = messages(message("$message.value"));
|
|
10902
|
+
defineComponent({
|
|
10903
|
+
props: {
|
|
10904
|
+
node: {
|
|
10905
|
+
type: Object,
|
|
10906
|
+
required: false
|
|
10907
|
+
},
|
|
10908
|
+
sectionsSchema: {
|
|
10909
|
+
type: Object,
|
|
10910
|
+
default: {}
|
|
10911
|
+
},
|
|
10912
|
+
defaultPosition: {
|
|
10913
|
+
type: [String, Boolean],
|
|
10914
|
+
default: false
|
|
10915
|
+
}
|
|
10916
|
+
},
|
|
10917
|
+
setup(props2, context) {
|
|
10918
|
+
const node = computed(() => {
|
|
10919
|
+
return props2.node || inject(parentSymbol, void 0);
|
|
10920
|
+
});
|
|
10921
|
+
watch$1(node, () => {
|
|
10922
|
+
var _a;
|
|
10923
|
+
if (((_a = node.value) === null || _a === void 0 ? void 0 : _a.context) && !undefine(props2.defaultPosition)) {
|
|
10924
|
+
node.value.context.defaultMessagePlacement = false;
|
|
10925
|
+
}
|
|
10926
|
+
}, { immediate: true });
|
|
10927
|
+
const schema = definition(props2.sectionsSchema || {});
|
|
10928
|
+
const data = computed(() => {
|
|
10929
|
+
var _a, _b, _c, _d, _e, _f;
|
|
10930
|
+
return {
|
|
10931
|
+
messages: ((_b = (_a = node.value) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.messages) || {},
|
|
10932
|
+
fns: ((_d = (_c = node.value) === null || _c === void 0 ? void 0 : _c.context) === null || _d === void 0 ? void 0 : _d.fns) || {},
|
|
10933
|
+
classes: ((_f = (_e = node.value) === null || _e === void 0 ? void 0 : _e.context) === null || _f === void 0 ? void 0 : _f.classes) || {}
|
|
10934
|
+
};
|
|
10935
|
+
});
|
|
10936
|
+
return () => {
|
|
10937
|
+
var _a;
|
|
10938
|
+
return ((_a = node.value) === null || _a === void 0 ? void 0 : _a.context) ? h(FormKitSchema, { schema, data: data.value }, __spreadValues({}, context.slots)) : null;
|
|
10939
|
+
};
|
|
10940
|
+
}
|
|
10941
|
+
});
|
|
10820
10942
|
const vueBindings = function vueBindings2(node) {
|
|
10821
10943
|
node.ledger.count("blocking", (m3) => m3.blocking);
|
|
10822
10944
|
const isValid2 = ref(!node.ledger.value("blocking"));
|
|
@@ -10890,7 +11012,7 @@ const vueBindings = function vueBindings2(node) {
|
|
|
10890
11012
|
const classesPropClasses = createClasses(property, node2, node2.props[`_${property}Class`]);
|
|
10891
11013
|
const sectionPropClasses = createClasses(property, node2, node2.props[`${property}Class`]);
|
|
10892
11014
|
className = generateClassList(node2, property, rootClasses, globalConfigClasses, classesPropClasses, sectionPropClasses);
|
|
10893
|
-
target[property] = className;
|
|
11015
|
+
target[property] = className !== null && className !== void 0 ? className : "";
|
|
10894
11016
|
});
|
|
10895
11017
|
}
|
|
10896
11018
|
}
|
|
@@ -10929,7 +11051,14 @@ const vueBindings = function vueBindings2(node) {
|
|
|
10929
11051
|
}
|
|
10930
11052
|
},
|
|
10931
11053
|
touch: () => {
|
|
10932
|
-
|
|
11054
|
+
var _a;
|
|
11055
|
+
const doCompare = context.dirtyBehavior === "compare";
|
|
11056
|
+
if (((_a = node.store.dirty) === null || _a === void 0 ? void 0 : _a.value) && !doCompare)
|
|
11057
|
+
return;
|
|
11058
|
+
const isDirty = !eq(node.props._init, node._value);
|
|
11059
|
+
if (!isDirty && !doCompare)
|
|
11060
|
+
return;
|
|
11061
|
+
node.store.set(createMessage({ key: "dirty", visible: false, value: isDirty }));
|
|
10933
11062
|
},
|
|
10934
11063
|
DOMInput: (e2) => {
|
|
10935
11064
|
node.input(e2.target.value);
|
|
@@ -10942,6 +11071,7 @@ const vueBindings = function vueBindings2(node) {
|
|
|
10942
11071
|
messages: messages2,
|
|
10943
11072
|
node: markRaw(node),
|
|
10944
11073
|
options: node.props.options,
|
|
11074
|
+
defaultMessagePlacement: true,
|
|
10945
11075
|
state: {
|
|
10946
11076
|
blurred: false,
|
|
10947
11077
|
complete: isComplete,
|
|
@@ -10966,7 +11096,10 @@ const vueBindings = function vueBindings2(node) {
|
|
|
10966
11096
|
triggerRef(value);
|
|
10967
11097
|
triggerRef(_value);
|
|
10968
11098
|
}
|
|
10969
|
-
|
|
11099
|
+
(() => __async(this, null, function* () {
|
|
11100
|
+
yield node.settled;
|
|
11101
|
+
node.props._init = cloneAny(node.value);
|
|
11102
|
+
}))();
|
|
10970
11103
|
});
|
|
10971
11104
|
node.on("settled", ({ payload: isSettled }) => {
|
|
10972
11105
|
context.state.settled = isSettled;
|
|
@@ -10992,7 +11125,8 @@ const vueBindings = function vueBindings2(node) {
|
|
|
10992
11125
|
"attrs",
|
|
10993
11126
|
"preserve",
|
|
10994
11127
|
"preserveErrors",
|
|
10995
|
-
"id"
|
|
11128
|
+
"id",
|
|
11129
|
+
"dirtyBehavior"
|
|
10996
11130
|
];
|
|
10997
11131
|
const iconPattern = /^[a-zA-Z-]+(?:-icon|Icon)$/;
|
|
10998
11132
|
const matchingProps = Object.keys(node.props).filter((prop) => {
|
|
@@ -11001,9 +11135,9 @@ const vueBindings = function vueBindings2(node) {
|
|
|
11001
11135
|
return props2.concat(matchingProps);
|
|
11002
11136
|
};
|
|
11003
11137
|
observeProps(rootProps());
|
|
11004
|
-
function definedAs(
|
|
11005
|
-
if (
|
|
11006
|
-
observeProps(
|
|
11138
|
+
function definedAs(definition2) {
|
|
11139
|
+
if (definition2.props)
|
|
11140
|
+
observeProps(definition2.props);
|
|
11007
11141
|
}
|
|
11008
11142
|
node.props.definition && definedAs(node.props.definition);
|
|
11009
11143
|
node.on("added-props", ({ payload }) => observeProps(payload));
|
|
@@ -11023,8 +11157,9 @@ const vueBindings = function vueBindings2(node) {
|
|
|
11023
11157
|
triggerRef(value);
|
|
11024
11158
|
}
|
|
11025
11159
|
node.emit("modelUpdated");
|
|
11026
|
-
if (!context.state.dirty && node.isCreated && hasTicked
|
|
11160
|
+
if ((!context.state.dirty || context.dirtyBehavior === "compare") && node.isCreated && hasTicked) {
|
|
11027
11161
|
context.handlers.touch();
|
|
11162
|
+
}
|
|
11028
11163
|
if (isComplete && node.type === "input" && hasErrors.value && !undefine(node.props.preserveErrors)) {
|
|
11029
11164
|
node.store.filter((message2) => {
|
|
11030
11165
|
var _a;
|
|
@@ -11100,6 +11235,18 @@ defineComponent({
|
|
|
11100
11235
|
const config = inject(optionsSymbol, {});
|
|
11101
11236
|
const parent = inject(parentSymbol, null);
|
|
11102
11237
|
let iconHandler = void 0;
|
|
11238
|
+
function loadIcon() {
|
|
11239
|
+
if (!iconHandler || typeof iconHandler !== "function")
|
|
11240
|
+
return;
|
|
11241
|
+
const iconOrPromise = iconHandler(props2.icon);
|
|
11242
|
+
if (iconOrPromise instanceof Promise) {
|
|
11243
|
+
iconOrPromise.then((iconValue) => {
|
|
11244
|
+
icon2.value = iconValue;
|
|
11245
|
+
});
|
|
11246
|
+
} else {
|
|
11247
|
+
icon2.value = iconOrPromise;
|
|
11248
|
+
}
|
|
11249
|
+
}
|
|
11103
11250
|
if (props2.iconLoader && typeof props2.iconLoader === "function") {
|
|
11104
11251
|
iconHandler = createIconHandler(props2.iconLoader);
|
|
11105
11252
|
} else if (parent && ((_a = parent.props) === null || _a === void 0 ? void 0 : _a.iconLoader)) {
|
|
@@ -11114,18 +11261,11 @@ defineComponent({
|
|
|
11114
11261
|
iconHandler = iconPlugin.iconHandler;
|
|
11115
11262
|
}
|
|
11116
11263
|
}
|
|
11117
|
-
|
|
11118
|
-
|
|
11119
|
-
|
|
11120
|
-
iconOrPromise.then((iconValue) => {
|
|
11121
|
-
icon2.value = iconValue;
|
|
11122
|
-
});
|
|
11123
|
-
} else {
|
|
11124
|
-
icon2.value = iconOrPromise;
|
|
11125
|
-
}
|
|
11126
|
-
}
|
|
11264
|
+
watch$1(() => props2.icon, () => {
|
|
11265
|
+
loadIcon();
|
|
11266
|
+
}, { immediate: true });
|
|
11127
11267
|
return () => {
|
|
11128
|
-
if (icon2.value) {
|
|
11268
|
+
if (props2.icon && icon2.value) {
|
|
11129
11269
|
return h("span", {
|
|
11130
11270
|
class: "formkit-icon",
|
|
11131
11271
|
innerHTML: icon2.value
|
|
@@ -11346,7 +11486,7 @@ function prepData(formData) {
|
|
|
11346
11486
|
props2.vid = window.zar.getVID();
|
|
11347
11487
|
}
|
|
11348
11488
|
var tf = document.getElementsByName("xxTrustedFormCertUrl");
|
|
11349
|
-
if (tf.length > 0) {
|
|
11489
|
+
if (tf && tf.length > 0) {
|
|
11350
11490
|
props2.Trusted_Form_URL = tf[0].value;
|
|
11351
11491
|
dbg("TrustedFormCertUrl", props2.TrustedFormCertUrl);
|
|
11352
11492
|
}
|
|
@@ -11428,6 +11568,30 @@ const scrollAnchor = (formNode) => () => {
|
|
|
11428
11568
|
}
|
|
11429
11569
|
}
|
|
11430
11570
|
};
|
|
11571
|
+
const updateProgressBar = (formNode, stepHistory2, stepQueue2) => {
|
|
11572
|
+
try {
|
|
11573
|
+
const barId = formNode.attrs.progressBarId || "progress-bar";
|
|
11574
|
+
const textId = formNode.attrs.progressBarTextId || "progress-bar-text";
|
|
11575
|
+
var progress = document.getElementById(barId);
|
|
11576
|
+
if (progress) {
|
|
11577
|
+
const steps2 = stepHistory2.value.length + stepQueue2.value.length;
|
|
11578
|
+
const percent = stepHistory2.value.length / (steps2 - 1) * 100;
|
|
11579
|
+
progress.style.width = percent + "%";
|
|
11580
|
+
var progressText = document.getElementById(textId);
|
|
11581
|
+
if (progressText) {
|
|
11582
|
+
progressText.innerHTML = Math.round(percent) + "% Complete";
|
|
11583
|
+
}
|
|
11584
|
+
}
|
|
11585
|
+
} catch (err) {
|
|
11586
|
+
const msg = "failed to updateProgressBar: " + err.toString();
|
|
11587
|
+
console.warn(msg);
|
|
11588
|
+
rollbar("warning", msg);
|
|
11589
|
+
}
|
|
11590
|
+
};
|
|
11591
|
+
const prevStepFunc = (formNode) => (stepResult, stepHistory2, stepQueue2) => {
|
|
11592
|
+
scrollAnchor(formNode)();
|
|
11593
|
+
updateProgressBar(formNode, stepHistory2, stepQueue2);
|
|
11594
|
+
};
|
|
11431
11595
|
const preStepFunc = (formNode) => (stepNode) => {
|
|
11432
11596
|
try {
|
|
11433
11597
|
if (formNode.attrs.valueOverrideMap) {
|
|
@@ -11443,6 +11607,7 @@ const fireStepEvent = (formNode) => (stepResult, stepHistory2, stepQueue2) => {
|
|
|
11443
11607
|
if (!stepResult) {
|
|
11444
11608
|
return;
|
|
11445
11609
|
}
|
|
11610
|
+
updateProgressBar(formNode, stepHistory2, stepQueue2);
|
|
11446
11611
|
var step_values = null;
|
|
11447
11612
|
try {
|
|
11448
11613
|
setTimeout(scrollAnchor(formNode), 100);
|
|
@@ -20064,6 +20229,7 @@ const init = () => {
|
|
|
20064
20229
|
data.submitUrl = data.submitUrl || defaultSubmitUrl;
|
|
20065
20230
|
data.prepData = data.prepData || prepData;
|
|
20066
20231
|
data.preStepFunc = data.preStepFunc || preStepFunc;
|
|
20232
|
+
data.prevStepFunc = data.prevStepFunc || prevStepFunc;
|
|
20067
20233
|
data.fireStepEvent = data.fireStepEvent || fireStepEvent;
|
|
20068
20234
|
data.handleRedirect = data.handleRedirect || handleRedirect;
|
|
20069
20235
|
data.scrollAnchor = data.scrollAnchor || scrollAnchor;
|
|
@@ -20086,6 +20252,20 @@ const init = () => {
|
|
|
20086
20252
|
}
|
|
20087
20253
|
}
|
|
20088
20254
|
};
|
|
20255
|
+
data.onInput = (callback) => (e2, node) => {
|
|
20256
|
+
const elem = document.getElementById(node.props.id);
|
|
20257
|
+
if (elem && elem.offsetParent === null) {
|
|
20258
|
+
return;
|
|
20259
|
+
}
|
|
20260
|
+
try {
|
|
20261
|
+
callback();
|
|
20262
|
+
e2.preventDefault();
|
|
20263
|
+
} catch (err) {
|
|
20264
|
+
const msg = "onInput failed: " + err.toString();
|
|
20265
|
+
console.warn(msg);
|
|
20266
|
+
rollbar("warning", msg);
|
|
20267
|
+
}
|
|
20268
|
+
};
|
|
20089
20269
|
const app = createApp(_sfc_main$1, { schema: schemaObj, data }).use(
|
|
20090
20270
|
plugin$1,
|
|
20091
20271
|
defaultConfig({
|