@opentinyvue/vue-form-item 2.21.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/LICENSE +22 -0
- package/index.d.ts +13 -0
- package/lib/index.js +103 -0
- package/lib/label-wrap.js +107 -0
- package/lib/mobile-first.js +197 -0
- package/lib/pc.js +314 -0
- package/package.json +21 -0
- package/src/index.d.ts +69 -0
- package/src/label-wrap.d.ts +2 -0
- package/src/mobile-first.vue.d.ts +2 -0
- package/src/pc.vue.d.ts +2 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 - present TinyVue Authors.
|
|
4
|
+
Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 - present TinyVue Authors.
|
|
3
|
+
* Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license.
|
|
6
|
+
*
|
|
7
|
+
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
|
|
8
|
+
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
|
|
9
|
+
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
import FormItem from './src/index';
|
|
13
|
+
export default FormItem;
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
function _extends() {
|
|
2
|
+
return _extends = Object.assign ? Object.assign.bind() : function(n) {
|
|
3
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
4
|
+
var t = arguments[e];
|
|
5
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
6
|
+
}
|
|
7
|
+
return n;
|
|
8
|
+
}, _extends.apply(null, arguments);
|
|
9
|
+
}
|
|
10
|
+
import { defineComponent, $prefix, $setup, $props } from "@opentinyvue/vue-common";
|
|
11
|
+
import PcTemplate from "./pc.js";
|
|
12
|
+
import MobileFirstTemplate from "./mobile-first.js";
|
|
13
|
+
var template = function template2(mode) {
|
|
14
|
+
var _process$env;
|
|
15
|
+
var tinyMode = typeof process === "object" ? (_process$env = process.env) == null ? void 0 : _process$env.TINY_MODE : null;
|
|
16
|
+
if ("pc" === (tinyMode || mode)) {
|
|
17
|
+
return PcTemplate;
|
|
18
|
+
}
|
|
19
|
+
if ("mobile-first" === (tinyMode || mode)) {
|
|
20
|
+
return MobileFirstTemplate;
|
|
21
|
+
}
|
|
22
|
+
return PcTemplate;
|
|
23
|
+
};
|
|
24
|
+
var $constants = {
|
|
25
|
+
FORM_NAME: "Form",
|
|
26
|
+
FORM_ITEM_NAME: "FormItem"
|
|
27
|
+
};
|
|
28
|
+
var formItemProps = _extends({}, $props, {
|
|
29
|
+
_constants: {
|
|
30
|
+
type: Object,
|
|
31
|
+
default: function _default() {
|
|
32
|
+
return $constants;
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
appendToBody: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: void 0
|
|
38
|
+
},
|
|
39
|
+
error: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: ""
|
|
42
|
+
},
|
|
43
|
+
for: String,
|
|
44
|
+
inlineMessage: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: void 0
|
|
47
|
+
},
|
|
48
|
+
messageType: String,
|
|
49
|
+
label: String,
|
|
50
|
+
labelWidth: String,
|
|
51
|
+
manual: Boolean,
|
|
52
|
+
popperOptions: {
|
|
53
|
+
type: Object,
|
|
54
|
+
default: function _default2() {
|
|
55
|
+
return {};
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
prop: String,
|
|
59
|
+
required: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: void 0
|
|
62
|
+
},
|
|
63
|
+
rules: [Object, Array],
|
|
64
|
+
showMessage: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: true
|
|
67
|
+
},
|
|
68
|
+
size: String,
|
|
69
|
+
tipContent: String,
|
|
70
|
+
validateDisabled: Boolean,
|
|
71
|
+
validateDebounce: Boolean,
|
|
72
|
+
validatePosition: String,
|
|
73
|
+
validateStatus: String,
|
|
74
|
+
validateType: String,
|
|
75
|
+
validateIcon: Object,
|
|
76
|
+
ellipsis: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: false
|
|
79
|
+
},
|
|
80
|
+
vertical: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: false
|
|
83
|
+
},
|
|
84
|
+
extra: String
|
|
85
|
+
});
|
|
86
|
+
var FormItem = defineComponent({
|
|
87
|
+
name: $prefix + "FormItem",
|
|
88
|
+
componentName: "FormItem",
|
|
89
|
+
props: formItemProps,
|
|
90
|
+
setup: function setup(props, context) {
|
|
91
|
+
return $setup({
|
|
92
|
+
props,
|
|
93
|
+
context,
|
|
94
|
+
template
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
FormItem.install = function(Vue) {
|
|
99
|
+
Vue.component(FormItem.name, FormItem);
|
|
100
|
+
};
|
|
101
|
+
export {
|
|
102
|
+
FormItem as default
|
|
103
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
function _extends() {
|
|
2
|
+
return _extends = Object.assign ? Object.assign.bind() : function(n) {
|
|
3
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
4
|
+
var t = arguments[e];
|
|
5
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
6
|
+
}
|
|
7
|
+
return n;
|
|
8
|
+
}, _extends.apply(null, arguments);
|
|
9
|
+
}
|
|
10
|
+
import { defineComponent, $props, h, setup as _setup } from "@opentinyvue/vue-common";
|
|
11
|
+
var labelWrap = defineComponent({
|
|
12
|
+
props: _extends({}, $props, {
|
|
13
|
+
isAutoWidth: Boolean,
|
|
14
|
+
updateAll: Boolean,
|
|
15
|
+
isMobile: Boolean,
|
|
16
|
+
isMobileFirst: Boolean
|
|
17
|
+
}),
|
|
18
|
+
inject: ["form", "formItem"],
|
|
19
|
+
render: function render() {
|
|
20
|
+
var slotsDefault = this.slots.default && this.slots.default();
|
|
21
|
+
var classPrefix = this.isMobile ? "tiny-mobile-" : "tiny-";
|
|
22
|
+
if (!slotsDefault) return null;
|
|
23
|
+
if (this.isAutoWidth) {
|
|
24
|
+
var autoLabelWidth = this.form.autoLabelWidth;
|
|
25
|
+
var style = {};
|
|
26
|
+
if (autoLabelWidth && autoLabelWidth !== "auto") {
|
|
27
|
+
var marginLeft = parseInt(autoLabelWidth, 10) - this.computedWidth;
|
|
28
|
+
if (marginLeft) {
|
|
29
|
+
style.marginLeft = marginLeft + "px";
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return h("div", {
|
|
33
|
+
class: this.isMobileFirst ? "float-left" : classPrefix + "form-item_label-wrap",
|
|
34
|
+
style
|
|
35
|
+
}, slotsDefault);
|
|
36
|
+
} else {
|
|
37
|
+
return slotsDefault[0];
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
methods: {
|
|
41
|
+
getLabelWidth: function getLabelWidth() {
|
|
42
|
+
var computedStylWidth = function computedStylWidth2(elem) {
|
|
43
|
+
return window.getComputedStyle(elem).width;
|
|
44
|
+
};
|
|
45
|
+
var ceilFloat = function ceilFloat2(f) {
|
|
46
|
+
return Math.ceil(parseFloat(f));
|
|
47
|
+
};
|
|
48
|
+
return !this.$el || !this.$el.firstElementChild ? 0 : ceilFloat(computedStylWidth(this.$el.firstElementChild));
|
|
49
|
+
},
|
|
50
|
+
updateLabelWidth: function updateLabelWidth(action) {
|
|
51
|
+
var _this = this;
|
|
52
|
+
if (action === void 0) {
|
|
53
|
+
action = "update";
|
|
54
|
+
}
|
|
55
|
+
if (!this.$slots.default || !this.isAutoWidth || !this.$el.firstElementChild) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
var setComputedWidth = function setComputedWidth2() {
|
|
59
|
+
return _this.computedWidth = _this.getLabelWidth();
|
|
60
|
+
};
|
|
61
|
+
var deregisterFormLabelWidth = function deregisterFormLabelWidth2() {
|
|
62
|
+
return _this.form.deregisterLabelWidth(_this.computedWidth);
|
|
63
|
+
};
|
|
64
|
+
if (action === "update") {
|
|
65
|
+
setComputedWidth();
|
|
66
|
+
} else if (action === "remove") {
|
|
67
|
+
deregisterFormLabelWidth();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
watch: {
|
|
72
|
+
computedWidth: function computedWidth(val, oldVal) {
|
|
73
|
+
if (this.updateAll) {
|
|
74
|
+
this.form.registerLabelWidth(val, oldVal);
|
|
75
|
+
this.formItem.updateComputedLabelWidth(val);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
setup: function setup(props, context) {
|
|
80
|
+
var renderless = function renderless2(props2, _ref, _ref2) {
|
|
81
|
+
var onMounted = _ref.onMounted, onUpdated = _ref.onUpdated, onBeforeUnmount = _ref.onBeforeUnmount;
|
|
82
|
+
var vm = _ref2.vm;
|
|
83
|
+
onMounted(function() {
|
|
84
|
+
return vm.updateLabelWidth("update");
|
|
85
|
+
});
|
|
86
|
+
onUpdated(function() {
|
|
87
|
+
return vm.updateLabelWidth("update");
|
|
88
|
+
});
|
|
89
|
+
onBeforeUnmount(function() {
|
|
90
|
+
return vm.updateLabelWidth("remove");
|
|
91
|
+
});
|
|
92
|
+
return {
|
|
93
|
+
computedWidth: 0
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
var api = ["computedWidth"];
|
|
97
|
+
return _setup({
|
|
98
|
+
props,
|
|
99
|
+
context,
|
|
100
|
+
renderless,
|
|
101
|
+
api
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
export {
|
|
106
|
+
labelWrap as default
|
|
107
|
+
};
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { defineComponent, $prefix, setup, $props } from '@opentinyvue/vue-common';
|
|
2
|
+
import { renderless, api } from '@opentinyvue/vue-renderless/form-item/vue';
|
|
3
|
+
import LabelWrap from './label-wrap';
|
|
4
|
+
import Tooltip from '@opentinyvue/vue-tooltip';
|
|
5
|
+
import { IconHelpCircle } from '@opentinyvue/vue-icon';
|
|
6
|
+
|
|
7
|
+
function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
|
|
8
|
+
var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
|
|
9
|
+
if (render) {
|
|
10
|
+
options.render = render;
|
|
11
|
+
options.staticRenderFns = staticRenderFns;
|
|
12
|
+
options._compiled = true;
|
|
13
|
+
}
|
|
14
|
+
var hook;
|
|
15
|
+
if (injectStyles) {
|
|
16
|
+
hook = injectStyles;
|
|
17
|
+
}
|
|
18
|
+
if (hook) {
|
|
19
|
+
if (options.functional) {
|
|
20
|
+
options._injectStyles = hook;
|
|
21
|
+
var originalRender = options.render;
|
|
22
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
23
|
+
hook.call(context);
|
|
24
|
+
return originalRender(h, context);
|
|
25
|
+
};
|
|
26
|
+
} else {
|
|
27
|
+
var existing = options.beforeCreate;
|
|
28
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
exports: scriptExports,
|
|
33
|
+
options
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function _extends() {
|
|
38
|
+
return _extends = Object.assign ? Object.assign.bind() : function(n) {
|
|
39
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
40
|
+
var t = arguments[e];
|
|
41
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
42
|
+
}
|
|
43
|
+
return n;
|
|
44
|
+
}, _extends.apply(null, arguments);
|
|
45
|
+
}
|
|
46
|
+
var $constants = {
|
|
47
|
+
FORM_NAME: "Form",
|
|
48
|
+
FORM_ITEM_NAME: "FormItem"
|
|
49
|
+
};
|
|
50
|
+
var __vue2_script = defineComponent({
|
|
51
|
+
name: $prefix + "FormItem",
|
|
52
|
+
componentName: "FormItem",
|
|
53
|
+
components: {
|
|
54
|
+
LabelWrap,
|
|
55
|
+
TinyTooltip: Tooltip,
|
|
56
|
+
IconHelpCircle: IconHelpCircle()
|
|
57
|
+
},
|
|
58
|
+
props: _extends({}, $props, {
|
|
59
|
+
_constants: {
|
|
60
|
+
type: Object,
|
|
61
|
+
default: function _default() {
|
|
62
|
+
return $constants;
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
appendToBody: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: void 0
|
|
68
|
+
},
|
|
69
|
+
error: String,
|
|
70
|
+
for: String,
|
|
71
|
+
inlineMessage: {
|
|
72
|
+
type: [String, Boolean],
|
|
73
|
+
default: ""
|
|
74
|
+
},
|
|
75
|
+
label: String,
|
|
76
|
+
labelWidth: String,
|
|
77
|
+
manual: Boolean,
|
|
78
|
+
popperOptions: {
|
|
79
|
+
type: Object,
|
|
80
|
+
default: function _default2() {
|
|
81
|
+
return {};
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
prop: String,
|
|
85
|
+
required: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: void 0
|
|
88
|
+
},
|
|
89
|
+
rules: [Object, Array],
|
|
90
|
+
showMessage: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: true
|
|
93
|
+
},
|
|
94
|
+
size: String,
|
|
95
|
+
tipContent: String,
|
|
96
|
+
validateDisabled: Boolean,
|
|
97
|
+
validateDebounce: Boolean,
|
|
98
|
+
validatePosition: String,
|
|
99
|
+
validateStatus: String,
|
|
100
|
+
validateType: String
|
|
101
|
+
}),
|
|
102
|
+
setup: function setup$1(props, context) {
|
|
103
|
+
return setup({
|
|
104
|
+
props,
|
|
105
|
+
context,
|
|
106
|
+
renderless,
|
|
107
|
+
api
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
var render = function render2() {
|
|
112
|
+
var _vm = this;
|
|
113
|
+
var _h = _vm.$createElement;
|
|
114
|
+
var _c = _vm._self._c || _h;
|
|
115
|
+
return _c("div", {
|
|
116
|
+
class: _vm.m("flex min-h-[theme(spacing.12)] sm:min-h-[theme(spacing.7)] mb-0 p-0 sm:mb-4 box-border after:content-[''] after:table after:clear-both before:content-[''] before:table border-b-0.5 border-color-border-separator sm:border-none", _vm.state.validateState === "error" && _vm.state.validateType === "text" ? "mb-0 sm:mb-5" : "", _vm.state.formInline ? "align-sub" : "", _vm.state.labelPosition === "top" ? "block mb-4" : "", _vm.state.validateState === "error" ? "[&_.tiny-range-editor]:border-color-error [&_[data-tag~=tiny-range-editor]]:border-color-error [&_[data-tag=tiny-numeric-main]]:border-color-error [&_input]:border-color-error [&_textarea]:border-color-error [&_input:focus]:border-color-error [&_input:hover]:border-color-error [&_textarea:focus]:border-color-error [&_textarea:hover]:border-color-error" : "", _vm.state.labelPosition === "top" && !_vm.state.hideRequiredAsterisk ? "pl-0" : "", !_vm.slots.label && !_vm.label ? "border-none" : "", _vm.state.isDisplayOnly ? "border-none py-0.5" : ""),
|
|
117
|
+
attrs: {
|
|
118
|
+
"data-tag": "tiny-form-item"
|
|
119
|
+
}
|
|
120
|
+
}, [_c("label-wrap", {
|
|
121
|
+
attrs: {
|
|
122
|
+
"is-auto-width": _vm.state.labelStyle && _vm.state.labelStyle.width === "auto",
|
|
123
|
+
"update-all": _vm.state.labelWidth === "auto",
|
|
124
|
+
"is-mobile-first": true
|
|
125
|
+
}
|
|
126
|
+
}, [_vm.slots.label || _vm.label ? _c("label", {
|
|
127
|
+
class: _vm.m("py-3 sm:py-1.5 sm:min-h-[theme(spacing.7)] relative align-bottom float-left text-sm pr-3 sm:pr-4 box-border leading-5", "overflow-hidden text-ellipsis", _vm.state.labelPosition === "top" ? "float-none inline-block text-left sm:text-left leading-none px-0 pt-0 pb-1.5 h-auto min-h-0 sm:py-0 sm:pb-1 sm:min-h-[theme(spacing.0)]" : "min-h-[theme(spacing.9)]", _vm.state.labelPosition === "right" ? "text-right sm:text-right" : "", _vm.state.labelPosition === "left" ? "text-left sm:text-left" : "", _vm.state.formInline && _vm.state.labelPosition === "top" ? "block" : "", _vm.state.isDisplayOnly ? "leading-none h-auto align-[inherit] pr-4" : "", _vm.tipContent ? "pr-5 sm:pr-7" : "", _vm.state.labelPosition === "top" && !_vm.state.hideRequiredAsterisk ? "overflow-visible relative before:absolute before:-left-2.5" : "", _vm.state.disabled ? "text-color-icon-placeholder sm:text-color-text-secondary" : "text-color-text-secondary", _vm.state.formItemSize !== "mini" ? "sm:text-sm" : "sm:text-xs"),
|
|
128
|
+
style: _vm.state.labelStyle,
|
|
129
|
+
attrs: {
|
|
130
|
+
"data-tag": "tiny-item-label",
|
|
131
|
+
"for": _vm.state.labelFor
|
|
132
|
+
}
|
|
133
|
+
}, [_c("span", {
|
|
134
|
+
class: _vm.m("max-h-[theme(spacing.10)] line-clamp-2 inline-block relative top-px leading-normal", (_vm.state.isRequired || _vm.required) && !_vm.state.hideRequiredAsterisk ? "before:content-['*'] before:text-color-error before:relative before:mr-1" : "", _vm.state.isDisplayOnly ? "pl-0 before:hidden" : "")
|
|
135
|
+
}, [_vm._t("label", function() {
|
|
136
|
+
return [_vm._v(" " + _vm._s(_vm.label + _vm.state.labelSuffix) + " ")];
|
|
137
|
+
})], 2), _vm.tipContent ? _c("tiny-tooltip", {
|
|
138
|
+
attrs: {
|
|
139
|
+
"effect": "light",
|
|
140
|
+
"content": _vm.tipContent,
|
|
141
|
+
"placement": "top"
|
|
142
|
+
}
|
|
143
|
+
}, [_c("icon-help-circle", {
|
|
144
|
+
class: [_vm.state.labelPosition === "top" ? "top-0.5 sm:top-1.5" : "top-3.5 sm:top-1.5"],
|
|
145
|
+
attrs: {
|
|
146
|
+
"custom-class": "h-4 w-4 ml-0.5 absolute right-1 sm:right-2 align-text-bottom fill-color-text-secondary"
|
|
147
|
+
}
|
|
148
|
+
})], 1) : _vm._e()], 1) : _vm._e()]), _c("div", {
|
|
149
|
+
class: _vm.m("flex-1 m-0 sm:m-auto relative sm:pt-0 sm:top-auto text-sm after:content-[''] after:table after:clear-both before:content-[''] before:table [&_button:not(:last-child)]:mr-2", "[&_[data-tag=tiny-checkbox]]:py-0 [&_[data-tag=tiny-input]]:w-full", "[&_[data-tag=tiny-input]_textarea]:px-0 sm:[&_[data-tag=tiny-input]_textarea]:px-3 [&_[data-tag=tiny-input]_textarea]:w-full [&_[data-tag=tiny-input]_textarea]:pt-1 sm:[&_[data-tag=tiny-input]_textarea]:pt-2", _vm.state.formInline ? "align-sub leading-none" : "", _vm.state.labelPosition === "top" && !_vm.state.hideRequiredAsterisk ? _vm.state.isDisplayOnly ? "pl-0" : "pl-2 sm:pl-0" : "pt-2", _vm.state.formItemSize !== "mini" ? "sm:text-sm" : "sm:text-xs"),
|
|
150
|
+
attrs: {
|
|
151
|
+
"data-tag": "tiny-form-item-inline"
|
|
152
|
+
}
|
|
153
|
+
}, [_vm.state.isDisplayOnly && _vm.state.isBasicComp ? _c("div", {
|
|
154
|
+
class: ["break-all min-h-[28px] leading-7 text-color-text-primary", _vm.state.typeName === "textarea" ? "line-clamp-3" : "line-clamp-1"],
|
|
155
|
+
attrs: {
|
|
156
|
+
"data-tag": "tiny-form-item-display-only",
|
|
157
|
+
"type-name": _vm.state.typeName
|
|
158
|
+
},
|
|
159
|
+
on: {
|
|
160
|
+
"mouseenter": _vm.handleMouseenter,
|
|
161
|
+
"mouseleave": _vm.handleMouseleave
|
|
162
|
+
}
|
|
163
|
+
}, [_vm._v(" " + _vm._s(_vm.state.displayedValue || "-") + " ")]) : _vm._e(), _c("div", {
|
|
164
|
+
directives: [{
|
|
165
|
+
name: "show",
|
|
166
|
+
rawName: "v-show",
|
|
167
|
+
value: !(_vm.state.isDisplayOnly && _vm.state.isBasicComp),
|
|
168
|
+
expression: "!(state.isDisplayOnly && state.isBasicComp)"
|
|
169
|
+
}],
|
|
170
|
+
class: ["[&_[aria-label=checkbox-group]]:pl-0.5 sm:[&_[aria-label=checkbox-group]]:pl-0", "[&_>:first-child[data-tag=tiny-checkbox]]:pl-0.5 sm:[&_>:first-child[data-tag=tiny-checkbox]]:pl-0", "[&_[class^=tiny-autocomplete]]:w-full", "[&_[class^=tiny-cascader]]:w-full", _vm.state.isDisplayOnly ? "[&_>*:not([data-tag^=tiny-],[class^=tiny-])]:leading-8 [&_>*:not([data-tag^=tiny-],[class^=tiny-])]:sm:leading-normal" : ""],
|
|
171
|
+
attrs: {
|
|
172
|
+
"data-tag": "tiny-form-item-show"
|
|
173
|
+
}
|
|
174
|
+
}, [_vm._t("default")], 2), _vm.state.validateState === "error" && _vm.showMessage && _vm.state.showMessage ? _vm._t("error", function() {
|
|
175
|
+
return [_c("div", {
|
|
176
|
+
class: _vm.m("relative sm:absolute left-0 bottom-1 sm:-bottom-5 text-color-error text-xs leading-normal line-clamp-3 sm:line-clamp-1 break-all", typeof _vm.inlineMessage === "boolean" && _vm.inlineMessage || _vm.state.inlineMessage ? "relative top-auto left-auto inline-block" : "", _vm.state.formItemSize === "small" ? "pt-0.5" : "", _vm.state.formItemSize === "mini" ? "pt-px" : ""),
|
|
177
|
+
attrs: {
|
|
178
|
+
"title": _vm.state.validateMessage
|
|
179
|
+
}
|
|
180
|
+
}, [_vm._v(" " + _vm._s(_vm.state.validateMessage) + " ")])];
|
|
181
|
+
}, {
|
|
182
|
+
"dataTag": "tiny-form-item-error"
|
|
183
|
+
}) : _vm._e(), _vm.state.validateState !== "error" && _vm.showMessage && _vm.state.showMessage ? _vm._t("prompt") : _vm._e()], 2)], 1);
|
|
184
|
+
};
|
|
185
|
+
var staticRenderFns = [];
|
|
186
|
+
var __cssModules = {};
|
|
187
|
+
var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
|
|
188
|
+
function __vue2_injectStyles(context) {
|
|
189
|
+
for (var o in __cssModules) {
|
|
190
|
+
this[o] = __cssModules[o];
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
var mobileFirst = /* @__PURE__ */ function() {
|
|
194
|
+
return __component__.exports;
|
|
195
|
+
}();
|
|
196
|
+
|
|
197
|
+
export { mobileFirst as default };
|
package/lib/pc.js
ADDED
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import { defineComponent, $prefix, setup, isVue2, parseVnode, hooks, stringifyCssClass, deduplicateCssClass, $props } from '@opentinyvue/vue-common';
|
|
2
|
+
import { renderless, api } from '@opentinyvue/vue-renderless/form-item/vue';
|
|
3
|
+
import LabelWrap from './label-wrap';
|
|
4
|
+
import Tooltip from '@opentinyvue/vue-tooltip';
|
|
5
|
+
import { iconError } from '@opentinyvue/vue-icon';
|
|
6
|
+
|
|
7
|
+
function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
|
|
8
|
+
var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
|
|
9
|
+
if (render) {
|
|
10
|
+
options.render = render;
|
|
11
|
+
options.staticRenderFns = staticRenderFns;
|
|
12
|
+
options._compiled = true;
|
|
13
|
+
}
|
|
14
|
+
var hook;
|
|
15
|
+
if (injectStyles) {
|
|
16
|
+
hook = injectStyles;
|
|
17
|
+
}
|
|
18
|
+
if (hook) {
|
|
19
|
+
if (options.functional) {
|
|
20
|
+
options._injectStyles = hook;
|
|
21
|
+
var originalRender = options.render;
|
|
22
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
23
|
+
hook.call(context);
|
|
24
|
+
return originalRender(h, context);
|
|
25
|
+
};
|
|
26
|
+
} else {
|
|
27
|
+
var existing = options.beforeCreate;
|
|
28
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
exports: scriptExports,
|
|
33
|
+
options
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function _extends() {
|
|
38
|
+
return _extends = Object.assign ? Object.assign.bind() : function(n) {
|
|
39
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
40
|
+
var t = arguments[e];
|
|
41
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
42
|
+
}
|
|
43
|
+
return n;
|
|
44
|
+
}, _extends.apply(null, arguments);
|
|
45
|
+
}
|
|
46
|
+
var $constants = {
|
|
47
|
+
FORM_NAME: "Form",
|
|
48
|
+
FORM_ITEM_NAME: "FormItem"
|
|
49
|
+
};
|
|
50
|
+
var __vue2_script = defineComponent({
|
|
51
|
+
name: $prefix + "FormItem",
|
|
52
|
+
componentName: "FormItem",
|
|
53
|
+
components: {
|
|
54
|
+
LabelWrap,
|
|
55
|
+
Tooltip,
|
|
56
|
+
IconError: iconError()
|
|
57
|
+
},
|
|
58
|
+
props: _extends({}, $props, {
|
|
59
|
+
_constants: {
|
|
60
|
+
type: Object,
|
|
61
|
+
default: function _default() {
|
|
62
|
+
return $constants;
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
appendToBody: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: void 0
|
|
68
|
+
},
|
|
69
|
+
error: String,
|
|
70
|
+
for: String,
|
|
71
|
+
inlineMessage: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: void 0
|
|
74
|
+
},
|
|
75
|
+
messageType: String,
|
|
76
|
+
label: String,
|
|
77
|
+
labelWidth: String,
|
|
78
|
+
manual: Boolean,
|
|
79
|
+
popperOptions: {
|
|
80
|
+
type: Object,
|
|
81
|
+
default: function _default2() {
|
|
82
|
+
return {};
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
prop: String,
|
|
86
|
+
required: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
default: void 0
|
|
89
|
+
},
|
|
90
|
+
rules: [Object, Array],
|
|
91
|
+
showMessage: {
|
|
92
|
+
type: Boolean,
|
|
93
|
+
default: true
|
|
94
|
+
},
|
|
95
|
+
size: String,
|
|
96
|
+
validateDisabled: Boolean,
|
|
97
|
+
validateDebounce: Boolean,
|
|
98
|
+
validatePosition: String,
|
|
99
|
+
validateStatus: String,
|
|
100
|
+
validateType: String,
|
|
101
|
+
validateIcon: {
|
|
102
|
+
type: Object,
|
|
103
|
+
default: null
|
|
104
|
+
},
|
|
105
|
+
ellipsis: {
|
|
106
|
+
type: Boolean,
|
|
107
|
+
default: false
|
|
108
|
+
},
|
|
109
|
+
vertical: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: false
|
|
112
|
+
},
|
|
113
|
+
extra: String
|
|
114
|
+
}),
|
|
115
|
+
setup: function setup$1(props, context) {
|
|
116
|
+
return setup({
|
|
117
|
+
props,
|
|
118
|
+
context,
|
|
119
|
+
renderless,
|
|
120
|
+
api
|
|
121
|
+
});
|
|
122
|
+
},
|
|
123
|
+
render: function render() {
|
|
124
|
+
var _state$formInstance, _state$formInstance2, _state$formInstance3, _state$formInstance4, _this = this, _class, _class2, _class3, _class4, _class5;
|
|
125
|
+
var h = arguments[0];
|
|
126
|
+
var state = this.state, required = this.required, slots = this.slots, label = this.label, scopedSlots = this.scopedSlots, showMessage = this.showMessage; this.inlineMessage; var ellipsis = this.ellipsis, vertical = this.vertical, handleLabelMouseenter = this.handleLabelMouseenter, handleMouseleave = this.handleMouseleave;
|
|
127
|
+
var validateIcon = state.validateIcon, isErrorInline = state.isErrorInline, isErrorBlock = state.isErrorBlock, tooltipType = state.tooltipType;
|
|
128
|
+
var isMobile = state.mode === "mobile";
|
|
129
|
+
var classPrefix = isMobile ? "tiny-mobile-" : "tiny-";
|
|
130
|
+
var labelSlot = slots.label ? slots.label() : null;
|
|
131
|
+
var defaultSlots = slots.default ? slots.default() : null;
|
|
132
|
+
var errorSlot = scopedSlots.error && scopedSlots.error(state.validateMessage);
|
|
133
|
+
var formItemClass = classPrefix + "form-item--" + (state.sizeClass ? state.sizeClass : "default");
|
|
134
|
+
var isShowError = state.validateState === "error" && showMessage && state.form.showMessage;
|
|
135
|
+
var validateTag = (_state$formInstance = state.formInstance) == null ? void 0 : _state$formInstance.validateTag;
|
|
136
|
+
var wrapFragment = (_state$formInstance2 = state.formInstance) == null ? void 0 : _state$formInstance2.wrapFragment;
|
|
137
|
+
var validateMessage;
|
|
138
|
+
var formAppendToBody = (_state$formInstance3 = state.formInstance) == null ? void 0 : _state$formInstance3.appendToBody;
|
|
139
|
+
var appendToBody = typeof this.appendToBody === "boolean" ? this.appendToBody : typeof formAppendToBody === "boolean" ? formAppendToBody : true;
|
|
140
|
+
var validatePosition = this.validatePosition || ((_state$formInstance4 = state.formInstance) == null ? void 0 : _state$formInstance4.validatePosition) || "top-end";
|
|
141
|
+
var popperOptions = _extends({}, state.formInstance.popperOptions, this.popperOptions, {
|
|
142
|
+
forceAbsolute: !appendToBody,
|
|
143
|
+
onUpdate: function onUpdate(options) {
|
|
144
|
+
var popper = options.instance._popper;
|
|
145
|
+
var translate3d = popper.style.transform;
|
|
146
|
+
var matchTranslate = translate3d.match(/translate3d\((\w+)px, (\w+)px, (\w+)px\)/);
|
|
147
|
+
if (!Array.isArray(matchTranslate)) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
var _matchTranslate$slice = matchTranslate.slice(1), x = _matchTranslate$slice[0], y = _matchTranslate$slice[1], z = _matchTranslate$slice[2];
|
|
151
|
+
popper.style.transform = "translate3d(" + x + "px, " + parseInt(y, 10) + "px, " + z + "px)";
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
var validateIconNode = validateIcon ? h(validateIcon, {
|
|
155
|
+
class: "tooltip-validate-icon"
|
|
156
|
+
}) : null;
|
|
157
|
+
var ItemContent = defaultSlots ? defaultSlots.map(function(vnode) {
|
|
158
|
+
if (isVue2 && !vnode.componentOptions && !validateTag) return vnode;
|
|
159
|
+
var item = parseVnode(vnode);
|
|
160
|
+
item.props = item.props || {};
|
|
161
|
+
var _item = item, type = _item.type;
|
|
162
|
+
item.dynamicProps = item.dynamicProps || [];
|
|
163
|
+
if (!item.dynamicProps.includes("size")) {
|
|
164
|
+
item.dynamicProps.push("size");
|
|
165
|
+
}
|
|
166
|
+
Object.assign(item.props, {
|
|
167
|
+
size: state.formItemSize,
|
|
168
|
+
mini: state.formItemSize === "mini" || Boolean(item.props.mini)
|
|
169
|
+
});
|
|
170
|
+
if (type && type.name && type.name.toLowerCase().endsWith("button")) {
|
|
171
|
+
return item;
|
|
172
|
+
}
|
|
173
|
+
var propsData = item.props;
|
|
174
|
+
if (propsData) {
|
|
175
|
+
if (!state.isRequired) {
|
|
176
|
+
state.validationRequired = propsData.validation && !!propsData.validation.required;
|
|
177
|
+
}
|
|
178
|
+
if (propsData.validation) {
|
|
179
|
+
return item;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
if (isMobile) {
|
|
183
|
+
return h("div", {
|
|
184
|
+
class: classPrefix + "form-item__value",
|
|
185
|
+
style: state.valueStyle
|
|
186
|
+
}, [item]);
|
|
187
|
+
}
|
|
188
|
+
if (!isVue2) {
|
|
189
|
+
if (item.type === hooks.Fragment) {
|
|
190
|
+
if (wrapFragment) {
|
|
191
|
+
item = h(wrapFragment, [item]);
|
|
192
|
+
}
|
|
193
|
+
} else if (item.type === hooks.Text) {
|
|
194
|
+
item = h("span", [item]);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
var data;
|
|
198
|
+
if (isVue2) {
|
|
199
|
+
if (!item.data) {
|
|
200
|
+
item.data = {};
|
|
201
|
+
}
|
|
202
|
+
data = item.data;
|
|
203
|
+
} else {
|
|
204
|
+
if (!item.props) {
|
|
205
|
+
item.props = {};
|
|
206
|
+
}
|
|
207
|
+
data = item.props;
|
|
208
|
+
}
|
|
209
|
+
var mergeClass = "tiny-tooltip " + stringifyCssClass(data.class);
|
|
210
|
+
data.class = deduplicateCssClass(mergeClass);
|
|
211
|
+
return item;
|
|
212
|
+
}) : null;
|
|
213
|
+
state.isMultiple = (ItemContent == null ? void 0 : ItemContent.length) > 1;
|
|
214
|
+
var getFormItemContnet = function getFormItemContnet2() {
|
|
215
|
+
if (isMobile) {
|
|
216
|
+
var _validatePosition = _this.validatePosition || state.formInstance.validatePosition || "right";
|
|
217
|
+
validateMessage = state.validateMessage ? _validatePosition === "right" ? h("div", {
|
|
218
|
+
"class": "tiny-mobile-input-form__error align-right"
|
|
219
|
+
}, [state.validateMessage]) : h("div", {
|
|
220
|
+
"class": "tiny-mobile-input-form__error align-left"
|
|
221
|
+
}, [state.validateMessage]) : null;
|
|
222
|
+
return ItemContent;
|
|
223
|
+
}
|
|
224
|
+
return ItemContent;
|
|
225
|
+
};
|
|
226
|
+
var FormItemContnet = ItemContent ? getFormItemContnet() : null;
|
|
227
|
+
var ErrorContent = isShowError && state.getValidateType === "text" ? errorSlot || h("div", {
|
|
228
|
+
class: (_class = {}, _class[classPrefix + "form-item__error"] = true, _class[classPrefix + "form-item__error--inline"] = isErrorInline, _class[classPrefix + "form-item__error--block"] = isErrorBlock, _class),
|
|
229
|
+
attrs: {
|
|
230
|
+
title: [state.validateMessage]
|
|
231
|
+
}
|
|
232
|
+
}, [validateIcon ? h(validateIcon, {
|
|
233
|
+
class: "validate-icon"
|
|
234
|
+
}) : null, h("span", {
|
|
235
|
+
"class": classPrefix + "form-item__validate-message"
|
|
236
|
+
}, [state.validateMessage])]) : null;
|
|
237
|
+
var LabelContent = h("label-wrap", {
|
|
238
|
+
props: {
|
|
239
|
+
isAutoWidth: state.labelStyle && state.labelStyle.width === "auto",
|
|
240
|
+
updateAll: state.form.labelWidth === "auto",
|
|
241
|
+
isMobile: state.mode === "mobile"
|
|
242
|
+
}
|
|
243
|
+
}, [labelSlot || label ? h("label", {
|
|
244
|
+
class: (_class2 = {}, _class2[classPrefix + "form-item__label"] = true, _class2["is-ellipsis"] = isMobile && ellipsis, _class2),
|
|
245
|
+
style: state.labelStyle,
|
|
246
|
+
attrs: {
|
|
247
|
+
for: state.labelFor
|
|
248
|
+
},
|
|
249
|
+
on: {
|
|
250
|
+
mouseenter: handleLabelMouseenter,
|
|
251
|
+
mouseleave: handleMouseleave
|
|
252
|
+
}
|
|
253
|
+
}, labelSlot || label + state.form.labelSuffix) : null]);
|
|
254
|
+
var ExtraTip = this.extra ? h("div", {
|
|
255
|
+
class: (_class3 = {}, _class3[classPrefix + "form-item__extra-tip"] = true, _class3)
|
|
256
|
+
}, this.extra) : null;
|
|
257
|
+
return h("div", {
|
|
258
|
+
class: (_class4 = {}, _class4[classPrefix + "form-item"] = true, _class4[classPrefix + "form-item--feedback"] = state.formInstance && state.formInstance.statusIcon, _class4["is-error"] = state.validateState === "error", _class4["is-text"] = state.getValidateType === "text", _class4["is-validating"] = state.validateState === "validating", _class4["is-success"] = state.validateState === "success", _class4["is-required"] = state.isRequired || required, _class4["is-no-asterisk"] = state.hideRequiredAsterisk, _class4[formItemClass] = true, _class4)
|
|
259
|
+
}, [!isMobile ? LabelContent : null, this.showMessage && !isMobile && h("tooltip", {
|
|
260
|
+
props: {
|
|
261
|
+
popperClass: classPrefix + "form__valid",
|
|
262
|
+
arrowOffset: 0,
|
|
263
|
+
adjustArrow: true,
|
|
264
|
+
type: tooltipType,
|
|
265
|
+
disabled: state.getValidateType !== "tip",
|
|
266
|
+
placement: validatePosition,
|
|
267
|
+
manual: true,
|
|
268
|
+
appendToBody,
|
|
269
|
+
popperOptions,
|
|
270
|
+
modelValue: isShowError ? state.canShowTip : false,
|
|
271
|
+
zIndex: "relative",
|
|
272
|
+
renderContent: function renderContent() {
|
|
273
|
+
var h2 = this.$createElement;
|
|
274
|
+
var tooltipContent;
|
|
275
|
+
if (errorSlot) {
|
|
276
|
+
tooltipContent = [errorSlot];
|
|
277
|
+
} else {
|
|
278
|
+
tooltipContent = [validateIconNode, h2("span", {
|
|
279
|
+
"class": classPrefix + "form-item__validate-message"
|
|
280
|
+
}, [state.validateMessage])];
|
|
281
|
+
}
|
|
282
|
+
return tooltipContent;
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
on: {
|
|
286
|
+
"update:modelValue": function updateModelValue(value) {
|
|
287
|
+
state.canShowTip = value;
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
ref: "tooltip"
|
|
291
|
+
}), h("div", {
|
|
292
|
+
class: (_class5 = {}, _class5[classPrefix + "form-item__content"] = true, _class5["is-vertical"] = isMobile && vertical, _class5),
|
|
293
|
+
style: !isMobile && state.contentStyle,
|
|
294
|
+
ref: "content"
|
|
295
|
+
}, [isMobile ? LabelContent : null, FormItemContnet, isMobile ? validateMessage : null, h("transition", {
|
|
296
|
+
attrs: {
|
|
297
|
+
name: classPrefix + "zoom-in-top"
|
|
298
|
+
}
|
|
299
|
+
}, [ErrorContent]), isMobile ? null : ExtraTip])]);
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
var __vue2_render, __vue2_staticRenderFns;
|
|
303
|
+
var __cssModules = {};
|
|
304
|
+
var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, __vue2_render, __vue2_staticRenderFns, false, __vue2_injectStyles);
|
|
305
|
+
function __vue2_injectStyles(context) {
|
|
306
|
+
for (var o in __cssModules) {
|
|
307
|
+
this[o] = __cssModules[o];
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
var pc = /* @__PURE__ */ function() {
|
|
311
|
+
return __component__.exports;
|
|
312
|
+
}();
|
|
313
|
+
|
|
314
|
+
export { pc as default };
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@opentinyvue/vue-form-item",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "2.21.0",
|
|
5
|
+
"description": "",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"main": "./lib/index.js",
|
|
9
|
+
"module": "./lib/index.js",
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@opentinyvue/vue-common": "~2.21.0",
|
|
12
|
+
"@opentinyvue/vue-icon": "~2.21.0",
|
|
13
|
+
"@opentinyvue/vue-renderless": "~3.21.0",
|
|
14
|
+
"@opentinyvue/vue-tooltip": "~2.21.0"
|
|
15
|
+
},
|
|
16
|
+
"types": "index.d.ts",
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "pnpm -w build:ui $npm_package_name",
|
|
19
|
+
"//postversion": "pnpm build"
|
|
20
|
+
}
|
|
21
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export declare const $constants: {
|
|
2
|
+
FORM_NAME: string;
|
|
3
|
+
FORM_ITEM_NAME: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const formItemProps: {
|
|
6
|
+
_constants: {
|
|
7
|
+
type: ObjectConstructor;
|
|
8
|
+
default: () => {
|
|
9
|
+
FORM_NAME: string;
|
|
10
|
+
FORM_ITEM_NAME: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
appendToBody: {
|
|
14
|
+
type: BooleanConstructor;
|
|
15
|
+
default: undefined;
|
|
16
|
+
};
|
|
17
|
+
error: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
for: StringConstructor;
|
|
22
|
+
inlineMessage: {
|
|
23
|
+
type: BooleanConstructor;
|
|
24
|
+
default: undefined;
|
|
25
|
+
};
|
|
26
|
+
messageType: StringConstructor;
|
|
27
|
+
label: StringConstructor;
|
|
28
|
+
labelWidth: StringConstructor;
|
|
29
|
+
manual: BooleanConstructor;
|
|
30
|
+
popperOptions: {
|
|
31
|
+
type: ObjectConstructor;
|
|
32
|
+
default: () => {};
|
|
33
|
+
};
|
|
34
|
+
prop: StringConstructor;
|
|
35
|
+
required: {
|
|
36
|
+
type: BooleanConstructor;
|
|
37
|
+
default: undefined;
|
|
38
|
+
};
|
|
39
|
+
rules: (ArrayConstructor | ObjectConstructor)[];
|
|
40
|
+
showMessage: {
|
|
41
|
+
type: BooleanConstructor;
|
|
42
|
+
default: boolean;
|
|
43
|
+
};
|
|
44
|
+
size: StringConstructor;
|
|
45
|
+
tipContent: StringConstructor;
|
|
46
|
+
validateDisabled: BooleanConstructor;
|
|
47
|
+
validateDebounce: BooleanConstructor;
|
|
48
|
+
validatePosition: StringConstructor;
|
|
49
|
+
validateStatus: StringConstructor;
|
|
50
|
+
validateType: StringConstructor;
|
|
51
|
+
validateIcon: ObjectConstructor;
|
|
52
|
+
ellipsis: {
|
|
53
|
+
type: BooleanConstructor;
|
|
54
|
+
default: boolean;
|
|
55
|
+
};
|
|
56
|
+
vertical: {
|
|
57
|
+
type: BooleanConstructor;
|
|
58
|
+
default: boolean;
|
|
59
|
+
};
|
|
60
|
+
extra: StringConstructor;
|
|
61
|
+
tiny_mode: StringConstructor;
|
|
62
|
+
tiny_mode_root: BooleanConstructor;
|
|
63
|
+
tiny_template: (ObjectConstructor | FunctionConstructor)[];
|
|
64
|
+
tiny_renderless: FunctionConstructor;
|
|
65
|
+
tiny_theme: StringConstructor;
|
|
66
|
+
tiny_chart_theme: ObjectConstructor;
|
|
67
|
+
};
|
|
68
|
+
declare const _default: any;
|
|
69
|
+
export default _default;
|
package/src/pc.vue.d.ts
ADDED