mirror of https://github.com/halo-dev/halo
chore: bump formkit version to 0.17.3 (#4103)
#### What type of PR is this? /area console /kind improvement /milestone 2.7.x #### What this PR does / why we need it: 升级 FormKit 的版本至 0.17.3 - https://formkit.com/changelog - https://github.com/formkit/formkit/releases/tag/0.17.0 - https://github.com/formkit/formkit/releases/tag/0.17.3 #### Which issue(s) this PR fixes: Fixes #3951 #### Special notes for your reviewer: 测试 Console 端各个表单功能是否正常即可。 #### Does this PR introduce a user-facing change? ```release-note 升级 Console 端 FormKit 的依赖版本至 0.17.3 ```pull/4105/head
parent
5e9e87582e
commit
f6a6b25dd6
|
@ -45,13 +45,13 @@
|
||||||
"@codemirror/view": "^6.5.1",
|
"@codemirror/view": "^6.5.1",
|
||||||
"codemirror": "^6.0.1",
|
"codemirror": "^6.0.1",
|
||||||
"@emoji-mart/data": "^1.0.8",
|
"@emoji-mart/data": "^1.0.8",
|
||||||
"@formkit/core": "^0.16.4",
|
"@formkit/core": "^0.17.3",
|
||||||
"@formkit/i18n": "^0.16.4",
|
"@formkit/i18n": "^0.17.3",
|
||||||
"@formkit/inputs": "^0.16.4",
|
"@formkit/inputs": "^0.17.3",
|
||||||
"@formkit/themes": "^0.16.4",
|
"@formkit/themes": "^0.17.3",
|
||||||
"@formkit/utils": "^0.16.4",
|
"@formkit/utils": "^0.17.3",
|
||||||
"@formkit/validation": "0.16.4",
|
"@formkit/validation": "0.17.3",
|
||||||
"@formkit/vue": "^0.16.4",
|
"@formkit/vue": "^0.17.3",
|
||||||
"@halo-dev/api-client": "workspace:*",
|
"@halo-dev/api-client": "workspace:*",
|
||||||
"@halo-dev/components": "workspace:*",
|
"@halo-dev/components": "workspace:*",
|
||||||
"@halo-dev/console-shared": "workspace:*",
|
"@halo-dev/console-shared": "workspace:*",
|
||||||
|
|
|
@ -35,26 +35,26 @@ importers:
|
||||||
specifier: ^1.0.8
|
specifier: ^1.0.8
|
||||||
version: 1.0.8
|
version: 1.0.8
|
||||||
'@formkit/core':
|
'@formkit/core':
|
||||||
specifier: ^0.16.4
|
specifier: ^0.17.3
|
||||||
version: 0.16.4
|
version: 0.17.3
|
||||||
'@formkit/i18n':
|
'@formkit/i18n':
|
||||||
specifier: ^0.16.4
|
specifier: ^0.17.3
|
||||||
version: 0.16.4
|
version: 0.17.3
|
||||||
'@formkit/inputs':
|
'@formkit/inputs':
|
||||||
specifier: ^0.16.4
|
specifier: ^0.17.3
|
||||||
version: 0.16.4
|
version: 0.17.3
|
||||||
'@formkit/themes':
|
'@formkit/themes':
|
||||||
specifier: ^0.16.4
|
specifier: ^0.17.3
|
||||||
version: 0.16.4(tailwindcss@3.3.0)
|
version: 0.17.3(tailwindcss@3.3.0)
|
||||||
'@formkit/utils':
|
'@formkit/utils':
|
||||||
specifier: ^0.16.4
|
specifier: ^0.17.3
|
||||||
version: 0.16.4
|
version: 0.17.3
|
||||||
'@formkit/validation':
|
'@formkit/validation':
|
||||||
specifier: 0.16.4
|
specifier: 0.17.3
|
||||||
version: 0.16.4
|
version: 0.17.3
|
||||||
'@formkit/vue':
|
'@formkit/vue':
|
||||||
specifier: ^0.16.4
|
specifier: ^0.17.3
|
||||||
version: 0.16.4(tailwindcss@3.3.0)(vue@3.2.45)
|
version: 0.17.3(tailwindcss@3.3.0)(vue@3.2.45)
|
||||||
'@halo-dev/api-client':
|
'@halo-dev/api-client':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:packages/api-client
|
version: link:packages/api-client
|
||||||
|
@ -2351,50 +2351,51 @@ packages:
|
||||||
'@floating-ui/core': 0.3.1
|
'@floating-ui/core': 0.3.1
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@formkit/core@0.16.4:
|
/@formkit/core@0.17.3:
|
||||||
resolution: {integrity: sha512-SJGadBfRx3L8VxbgIxV1tiDk8u8eisG1vaKUkFWxBRBfiDGYD25CVKz/k6JrxiPsxz96DgeycnRYSzLvZEeORQ==}
|
resolution: {integrity: sha512-gJG1LFWB3WwGkoD1ElDBqdroiOvfj5kteES6caXcoSUPkHpHwOvvzug1x1TLdN811fIO68z6ZAuIN5YY84+SUw==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@formkit/utils': 0.16.4
|
'@formkit/utils': 0.17.3
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@formkit/dev@0.16.4:
|
/@formkit/dev@0.17.3:
|
||||||
resolution: {integrity: sha512-Caj2bsArHWQpXZXizTKFyYNk95yN5Ma8MUa6U+Ga/x5sEsPpdyAu7TgbU9UGakXKuYFlv/qn19RUnJcsqbQlPQ==}
|
resolution: {integrity: sha512-hPw8AB+PPJL3faN974sLTFaaR8/D1FEPD5ShNiooyGnCRdqb0wrhlnKejXF7NmG84+kAorr1sNrpLnjFBJL9xA==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@formkit/core': 0.16.4
|
'@formkit/core': 0.17.3
|
||||||
'@formkit/utils': 0.16.4
|
'@formkit/utils': 0.17.3
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@formkit/i18n@0.16.4:
|
/@formkit/i18n@0.17.3:
|
||||||
resolution: {integrity: sha512-Hp1Goohrzh4PNsDHrQwx7giF7l7mOddN5TJmtLUPUipUhyJIdWMp41sOIgNA5q4rPaRiRGW7knYACFqM8v85mg==}
|
resolution: {integrity: sha512-XXW624JNT1nRoNUrvIRu2EAE50BdOvACkZHfNZp9oXc1gk+lvlwrHcz/YlMWNIRZRMdE+hGqWOvue9G5QKjAew==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@formkit/core': 0.16.4
|
'@formkit/core': 0.17.3
|
||||||
'@formkit/utils': 0.16.4
|
'@formkit/utils': 0.17.3
|
||||||
'@formkit/validation': 0.16.4
|
'@formkit/validation': 0.17.3
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@formkit/inputs@0.16.4:
|
/@formkit/inputs@0.17.3:
|
||||||
resolution: {integrity: sha512-Cqc1a0R9XSlvX1VuCH/w80p/wNoIWvKnE0g8q9aHdj2I7iuSCUKIkIcbkAPBJCRZGKNjZO/Wne7KslsIwHj2rQ==}
|
resolution: {integrity: sha512-yWOwNpKwBoDx6CNUyF01ZVrAquePcNTyBl1XhH1+f9YIvCfMGCqLwwAKAdguv3Lsnj4uoPZywRyWzvH7vrhO8w==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@formkit/core': 0.16.4
|
'@formkit/core': 0.17.3
|
||||||
|
'@formkit/utils': 0.17.3
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@formkit/observer@0.16.4:
|
/@formkit/observer@0.17.3:
|
||||||
resolution: {integrity: sha512-75qhc+So88k1n9JpOspJPiIm3by7vFEjnsr4fCF8nw4NfMgqdVnhqkCc8hbiuDYtyOL3Np7xqhjqS9ElS0xDew==}
|
resolution: {integrity: sha512-XN0UyloP4khAqbCOMpG7CDJHFuDCo7zzLnHwpdLwMg+R9jVd3nOfauuQTl9J081r1i2Cz6622eSRyUx4crlfBQ==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@formkit/core': 0.16.4
|
'@formkit/core': 0.17.3
|
||||||
'@formkit/utils': 0.16.4
|
'@formkit/utils': 0.17.3
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@formkit/rules@0.16.4:
|
/@formkit/rules@0.17.3:
|
||||||
resolution: {integrity: sha512-l02P2ysDUM8fnwAHzzba0Xo4CmM1gmakkR3Gbpr5AsupWrxboiwEogUSNCn3hjod2yDyeWtSuDhD/ORJ8z3Nzw==}
|
resolution: {integrity: sha512-4AHrVkwxSK28LCukSM6QHQEBAEfQ6qKyzkPxxfP6mYceDug64lkb/l50yMtKHOLtuOqnd9brSoD02Y5Pa7HVwA==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@formkit/core': 0.16.4
|
'@formkit/core': 0.17.3
|
||||||
'@formkit/utils': 0.16.4
|
'@formkit/utils': 0.17.3
|
||||||
'@formkit/validation': 0.16.4
|
'@formkit/validation': 0.17.3
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@formkit/themes@0.16.4(tailwindcss@3.3.0):
|
/@formkit/themes@0.17.3(tailwindcss@3.3.0):
|
||||||
resolution: {integrity: sha512-EZxaD0G9qxM3m5e6ytuW2g/kOQvpIhRJCK0SVIdx0cFuIZv8KyZGQhqSuYIcAc+5M2MCg7eytdalzg0al+fzSg==}
|
resolution: {integrity: sha512-C8a6vLYC8XbN8K7QkUmQwsSGz/EjqcYhCYranccScmfeJzHP7dV8kxQCn2vCh633qSar9gi/lxNzbUZoCNYt7g==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
tailwindcss: ^3.2.0
|
tailwindcss: ^3.2.0
|
||||||
unocss: ^0.31.0
|
unocss: ^0.31.0
|
||||||
|
@ -2407,35 +2408,36 @@ packages:
|
||||||
windicss:
|
windicss:
|
||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
'@formkit/core': 0.16.4
|
'@formkit/core': 0.17.3
|
||||||
tailwindcss: 3.3.0(postcss@8.4.21)
|
tailwindcss: 3.3.0(postcss@8.4.21)
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@formkit/utils@0.16.4:
|
/@formkit/utils@0.17.3:
|
||||||
resolution: {integrity: sha512-H36dF9r9oMUH719xn2pxMhV83YRmmZpxCYFz9tLDQWzFiqpOAZXDLjIRhG4w0s7/cy4eF+FgJp8EyGF1SFFJ5g==}
|
resolution: {integrity: sha512-0FIjlsy7dSbiiNFrlugWque1bCJkS8a3ySscHnhnWE2mu7hZzmqko0n5VMTUgDek27WERAaurIkyJzZL6gpA+Q==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@formkit/validation@0.16.4:
|
/@formkit/validation@0.17.3:
|
||||||
resolution: {integrity: sha512-4ONVhT6NIUsfabcZLBvbUghRSmnf/zk4eabStxywpEuMENZTXWuZxGjIR7mkI9Zl2WC58l7rJoj/WfxlL0migg==}
|
resolution: {integrity: sha512-yBE1QAm+Qcrs51SK8QpLd5kW2C038aXvqTADXcAcAFtD1equNx//sA4P42FLtOw0eMUMbbAYT0hwCGQXkrxW1g==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@formkit/core': 0.16.4
|
'@formkit/core': 0.17.3
|
||||||
'@formkit/observer': 0.16.4
|
'@formkit/observer': 0.17.3
|
||||||
|
'@formkit/utils': 0.17.3
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@formkit/vue@0.16.4(tailwindcss@3.3.0)(vue@3.2.45):
|
/@formkit/vue@0.17.3(tailwindcss@3.3.0)(vue@3.2.45):
|
||||||
resolution: {integrity: sha512-RUOHep+BYSwcYZkFia0vEjBdHkWKnjoOSMBhzUi/IepqvF5G1PWYzRnuMAQcfLh+iXcwClVMjr9D9SOhSMe1MQ==}
|
resolution: {integrity: sha512-m887TiTZYJbRAf/fG3rbNnln0ThMsEAc1z5ZylnlW+Q7oR2qVp7WmZ+GUJOzjWqj9aPrtw+WE6juxeaxzBTPvQ==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
vue: ^3.2.1
|
vue: ^3.2.1
|
||||||
dependencies:
|
dependencies:
|
||||||
'@formkit/core': 0.16.4
|
'@formkit/core': 0.17.3
|
||||||
'@formkit/dev': 0.16.4
|
'@formkit/dev': 0.17.3
|
||||||
'@formkit/i18n': 0.16.4
|
'@formkit/i18n': 0.17.3
|
||||||
'@formkit/inputs': 0.16.4
|
'@formkit/inputs': 0.17.3
|
||||||
'@formkit/observer': 0.16.4
|
'@formkit/observer': 0.17.3
|
||||||
'@formkit/rules': 0.16.4
|
'@formkit/rules': 0.17.3
|
||||||
'@formkit/themes': 0.16.4(tailwindcss@3.3.0)
|
'@formkit/themes': 0.17.3(tailwindcss@3.3.0)
|
||||||
'@formkit/utils': 0.16.4
|
'@formkit/utils': 0.17.3
|
||||||
'@formkit/validation': 0.16.4
|
'@formkit/validation': 0.17.3
|
||||||
vue: 3.2.45
|
vue: 3.2.45
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- tailwindcss
|
- tailwindcss
|
||||||
|
@ -2855,6 +2857,11 @@ packages:
|
||||||
engines: {node: '>= 14'}
|
engines: {node: '>= 14'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/@intlify/shared@9.3.0-beta.19:
|
||||||
|
resolution: {integrity: sha512-+lhQggrLvlQ/O5OmIYAc9gadcYXMoaDi0Doef+X/f6TLZFr9PTMjOpBWmpwNNHi026e54jckntUn6GzqDtIN4w==}
|
||||||
|
engines: {node: '>= 16'}
|
||||||
|
dev: true
|
||||||
|
|
||||||
/@intlify/unplugin-vue-i18n@0.9.3(rollup@2.79.1)(vue-i18n@9.2.2):
|
/@intlify/unplugin-vue-i18n@0.9.3(rollup@2.79.1)(vue-i18n@9.2.2):
|
||||||
resolution: {integrity: sha512-23DMh2r0qA7UZfaQhF09ZHhifgTyKcbmVsCo+qHvu9q1EU8OF18VlhxMHMksDR5NBDvRXj3Lmu8lT84XDrUlSw==}
|
resolution: {integrity: sha512-23DMh2r0qA7UZfaQhF09ZHhifgTyKcbmVsCo+qHvu9q1EU8OF18VlhxMHMksDR5NBDvRXj3Lmu8lT84XDrUlSw==}
|
||||||
engines: {node: '>= 14.16'}
|
engines: {node: '>= 14.16'}
|
||||||
|
@ -2871,7 +2878,7 @@ packages:
|
||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
'@intlify/bundle-utils': 5.5.0(vue-i18n@9.2.2)
|
'@intlify/bundle-utils': 5.5.0(vue-i18n@9.2.2)
|
||||||
'@intlify/shared': 9.3.0-beta.17
|
'@intlify/shared': 9.3.0-beta.19
|
||||||
'@rollup/pluginutils': 5.0.2(rollup@2.79.1)
|
'@rollup/pluginutils': 5.0.2(rollup@2.79.1)
|
||||||
'@vue/compiler-sfc': 3.2.47
|
'@vue/compiler-sfc': 3.2.47
|
||||||
debug: 4.3.4(supports-color@8.1.1)
|
debug: 4.3.4(supports-color@8.1.1)
|
||||||
|
|
|
@ -5,18 +5,23 @@ const hasLegendNode = (node) =>
|
||||||
|
|
||||||
export default function requiredAsterisk(node: FormKitNode) {
|
export default function requiredAsterisk(node: FormKitNode) {
|
||||||
node.on("created", () => {
|
node.on("created", () => {
|
||||||
|
const isRequired = node.props.parsedRules.some(
|
||||||
|
(rule) => rule.name === "required"
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!isRequired) return;
|
||||||
|
|
||||||
if (!node.props.definition) return;
|
if (!node.props.definition) return;
|
||||||
|
|
||||||
|
node.props.definition.schemaMemoKey = `required_${
|
||||||
|
hasLegendNode(node) ? "multi_" : ""
|
||||||
|
}${node.props.definition.schemaMemoKey}`;
|
||||||
|
|
||||||
const schemaFn = node.props.definition?.schema;
|
const schemaFn = node.props.definition?.schema;
|
||||||
|
|
||||||
if (typeof schemaFn !== "function") return;
|
if (typeof schemaFn !== "function") return;
|
||||||
|
|
||||||
node.props.definition.schema = (sectionsSchema = {}) => {
|
node.props.definition.schema = (sectionsSchema = {}) => {
|
||||||
const isRequired = node.props.parsedRules.some(
|
|
||||||
(rule) => rule.name === "required"
|
|
||||||
);
|
|
||||||
|
|
||||||
if (isRequired) {
|
|
||||||
if (hasLegendNode(node)) {
|
if (hasLegendNode(node)) {
|
||||||
sectionsSchema.legend = {
|
sectionsSchema.legend = {
|
||||||
children: ["$label", " *"],
|
children: ["$label", " *"],
|
||||||
|
@ -26,7 +31,6 @@ export default function requiredAsterisk(node: FormKitNode) {
|
||||||
children: ["$label", " *"],
|
children: ["$label", " *"],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return schemaFn(sectionsSchema);
|
return schemaFn(sectionsSchema);
|
||||||
};
|
};
|
||||||
|
|
|
@ -55,6 +55,7 @@ const inputPreventFn = (node: FormKitNode) => {
|
||||||
if (
|
if (
|
||||||
node.children.length == 1 &&
|
node.children.length == 1 &&
|
||||||
node.props.type == "form" &&
|
node.props.type == "form" &&
|
||||||
|
"props" in node.children[0] &&
|
||||||
implicitSubmissionType.includes(node.children[0].props.type)
|
implicitSubmissionType.includes(node.children[0].props.type)
|
||||||
) {
|
) {
|
||||||
if (!controller) {
|
if (!controller) {
|
||||||
|
|
Loading…
Reference in New Issue