@touchvue/ui 0.0.1-alpha.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/README.md +70 -0
- package/es/components/article/index.js +66 -0
- package/es/components/article/index.js.map +1 -0
- package/es/components/box/index.js +98 -0
- package/es/components/box/index.js.map +1 -0
- package/es/components/button/index.js +96 -0
- package/es/components/button/index.js.map +1 -0
- package/es/components/calendar/index.js +44 -0
- package/es/components/calendar/index.js.map +1 -0
- package/es/components/card/index.js +290 -0
- package/es/components/card/index.js.map +1 -0
- package/es/components/checkbox/index.js +97 -0
- package/es/components/checkbox/index.js.map +1 -0
- package/es/components/datepicker/index.js +44 -0
- package/es/components/datepicker/index.js.map +1 -0
- package/es/components/form/index.js +303 -0
- package/es/components/form/index.js.map +1 -0
- package/es/components/grid/index.js +253 -0
- package/es/components/grid/index.js.map +1 -0
- package/es/components/header/index.js +233 -0
- package/es/components/header/index.js.map +1 -0
- package/es/components/icon/index.js +98 -0
- package/es/components/icon/index.js.map +1 -0
- package/es/components/input/index.js +436 -0
- package/es/components/input/index.js.map +1 -0
- package/es/components/line/index.js +100 -0
- package/es/components/line/index.js.map +1 -0
- package/es/components/msg/index.js +322 -0
- package/es/components/msg/index.js.map +1 -0
- package/es/components/padding/index.js +92 -0
- package/es/components/padding/index.js.map +1 -0
- package/es/components/page/index.js +334 -0
- package/es/components/page/index.js.map +1 -0
- package/es/components/select/index.js +218 -0
- package/es/components/select/index.js.map +1 -0
- package/es/components/space/index.js +88 -0
- package/es/components/space/index.js.map +1 -0
- package/es/components/step/index.js +127 -0
- package/es/components/step/index.js.map +1 -0
- package/es/components/switch/index.js +120 -0
- package/es/components/switch/index.js.map +1 -0
- package/es/components/tab/index.js +227 -0
- package/es/components/tab/index.js.map +1 -0
- package/es/components/table/index.js +893 -0
- package/es/components/table/index.js.map +1 -0
- package/es/directives/dis/index.js +32 -0
- package/es/directives/dis/index.js.map +1 -0
- package/es/directives/size/index.js +23 -0
- package/es/directives/size/index.js.map +1 -0
- package/es/hooks/index.js +2 -0
- package/es/hooks/index.js.map +1 -0
- package/es/index.js +4209 -0
- package/es/index.js.map +1 -0
- package/es/utils/index.js +90 -0
- package/es/utils/index.js.map +1 -0
- package/lib/components/article/index.js +70 -0
- package/lib/components/article/index.js.map +1 -0
- package/lib/components/box/index.js +102 -0
- package/lib/components/box/index.js.map +1 -0
- package/lib/components/button/index.js +98 -0
- package/lib/components/button/index.js.map +1 -0
- package/lib/components/calendar/index.js +46 -0
- package/lib/components/calendar/index.js.map +1 -0
- package/lib/components/card/index.js +292 -0
- package/lib/components/card/index.js.map +1 -0
- package/lib/components/checkbox/index.js +99 -0
- package/lib/components/checkbox/index.js.map +1 -0
- package/lib/components/datepicker/index.js +46 -0
- package/lib/components/datepicker/index.js.map +1 -0
- package/lib/components/form/index.js +306 -0
- package/lib/components/form/index.js.map +1 -0
- package/lib/components/grid/index.js +256 -0
- package/lib/components/grid/index.js.map +1 -0
- package/lib/components/header/index.js +235 -0
- package/lib/components/header/index.js.map +1 -0
- package/lib/components/icon/index.js +101 -0
- package/lib/components/icon/index.js.map +1 -0
- package/lib/components/input/index.js +438 -0
- package/lib/components/input/index.js.map +1 -0
- package/lib/components/line/index.js +102 -0
- package/lib/components/line/index.js.map +1 -0
- package/lib/components/msg/index.js +324 -0
- package/lib/components/msg/index.js.map +1 -0
- package/lib/components/padding/index.js +94 -0
- package/lib/components/padding/index.js.map +1 -0
- package/lib/components/page/index.js +336 -0
- package/lib/components/page/index.js.map +1 -0
- package/lib/components/select/index.js +220 -0
- package/lib/components/select/index.js.map +1 -0
- package/lib/components/space/index.js +90 -0
- package/lib/components/space/index.js.map +1 -0
- package/lib/components/step/index.js +129 -0
- package/lib/components/step/index.js.map +1 -0
- package/lib/components/switch/index.js +122 -0
- package/lib/components/switch/index.js.map +1 -0
- package/lib/components/tab/index.js +230 -0
- package/lib/components/tab/index.js.map +1 -0
- package/lib/components/table/index.js +898 -0
- package/lib/components/table/index.js.map +1 -0
- package/lib/directives/dis/index.js +34 -0
- package/lib/directives/dis/index.js.map +1 -0
- package/lib/directives/size/index.js +25 -0
- package/lib/directives/size/index.js.map +1 -0
- package/lib/hooks/index.js +3 -0
- package/lib/hooks/index.js.map +1 -0
- package/lib/index.js +4251 -0
- package/lib/index.js.map +1 -0
- package/lib/utils/index.js +99 -0
- package/lib/utils/index.js.map +1 -0
- package/package.json +35 -0
- package/theme/components/article/index.css +1 -0
- package/theme/components/box/index.css +1 -0
- package/theme/components/button/index.css +1 -0
- package/theme/components/calendar/index.css +0 -0
- package/theme/components/card/index.css +1 -0
- package/theme/components/checkbox/index.css +1 -0
- package/theme/components/datepicker/index.css +0 -0
- package/theme/components/form/index.css +1 -0
- package/theme/components/grid/index.css +1 -0
- package/theme/components/header/index.css +1 -0
- package/theme/components/icon/index.css +1 -0
- package/theme/components/input/index.css +1 -0
- package/theme/components/line/index.css +1 -0
- package/theme/components/msg/index.css +1 -0
- package/theme/components/padding/index.css +1 -0
- package/theme/components/space/index.css +1 -0
- package/theme/components/step/index.css +1 -0
- package/theme/components/switch/index.css +1 -0
- package/theme/components/tab/index.css +1 -0
- package/theme/components/table/index.css +1 -0
- package/theme/img/default.png +0 -0
- package/theme/img/icon-type-fill.ttf +0 -0
- package/theme/img/icon.ttf +0 -0
- package/theme/img/loading-in.png +0 -0
- package/theme/img/loading-out.png +0 -0
- package/theme/img/msg/error-bg.png +0 -0
- package/theme/img/msg/error-icon.png +0 -0
- package/theme/img/msg/success-bg.png +0 -0
- package/theme/img/msg/success-icon.png +0 -0
- package/theme/index.css +1 -0
- package/theme/skin/default.css +1 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import { defineComponent, ref, useSlots, computed, onMounted, onBeforeUnmount, getCurrentInstance, provide, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, normalizeStyle, createCommentVNode, unref, inject, toDisplayString } from 'vue';
|
|
2
|
+
|
|
3
|
+
var _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
4
|
+
...{
|
|
5
|
+
name: "ToForm"
|
|
6
|
+
},
|
|
7
|
+
__name: "form",
|
|
8
|
+
props: {
|
|
9
|
+
labelWidth: {
|
|
10
|
+
type: [Number, String],
|
|
11
|
+
default: ""
|
|
12
|
+
},
|
|
13
|
+
labelPosition: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: "left"
|
|
16
|
+
},
|
|
17
|
+
col: {
|
|
18
|
+
type: [Number, String],
|
|
19
|
+
default: 1
|
|
20
|
+
},
|
|
21
|
+
submitPosition: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: ""
|
|
24
|
+
},
|
|
25
|
+
type: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: ""
|
|
28
|
+
},
|
|
29
|
+
mode: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: ""
|
|
32
|
+
},
|
|
33
|
+
space: {
|
|
34
|
+
type: [Number, String],
|
|
35
|
+
default: (props) => props.type === "list" ? 0 : 0.5
|
|
36
|
+
},
|
|
37
|
+
spaceX: {
|
|
38
|
+
type: [Number, String],
|
|
39
|
+
default: ""
|
|
40
|
+
},
|
|
41
|
+
spaceY: {
|
|
42
|
+
type: [Number, String],
|
|
43
|
+
default: ""
|
|
44
|
+
},
|
|
45
|
+
valueWidth: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: ""
|
|
48
|
+
},
|
|
49
|
+
comparable: Boolean,
|
|
50
|
+
readonly: Boolean
|
|
51
|
+
},
|
|
52
|
+
setup(__props) {
|
|
53
|
+
const props = __props;
|
|
54
|
+
const toForm = ref(null);
|
|
55
|
+
const slots = useSlots();
|
|
56
|
+
const items = ref([]);
|
|
57
|
+
const setClass = computed(() => {
|
|
58
|
+
const arr = [];
|
|
59
|
+
if (props.col)
|
|
60
|
+
arr.push(`col-${props.col}`);
|
|
61
|
+
if (props.submitPosition)
|
|
62
|
+
arr.push(`submit-position-${props.submitPosition}`);
|
|
63
|
+
if (props.mode)
|
|
64
|
+
arr.push(`mode-${props.mode}`);
|
|
65
|
+
if (props.labelPosition)
|
|
66
|
+
arr.push(`label-position-${props.labelPosition}`);
|
|
67
|
+
if (props.valueWidth)
|
|
68
|
+
arr.push(`value-width-${props.valueWidth}`);
|
|
69
|
+
return arr;
|
|
70
|
+
});
|
|
71
|
+
const setSubmitStyle = computed(() => {
|
|
72
|
+
const obj = {};
|
|
73
|
+
const sp = props.space;
|
|
74
|
+
const spy = props.spaceY;
|
|
75
|
+
const pos = props.submitPosition;
|
|
76
|
+
if ((sp || sp === 0) && pos !== "right" && pos !== "follow" && props.type !== "list") {
|
|
77
|
+
obj.marginTop = `${sp}em`;
|
|
78
|
+
}
|
|
79
|
+
if ((sp || sp === 0) && (pos === "rightBottom" || pos === "item")) {
|
|
80
|
+
obj.paddingTop = `${sp}em`;
|
|
81
|
+
}
|
|
82
|
+
if ((spy || spy === 0) && pos !== "right" && pos !== "follow" && props.type !== "list") {
|
|
83
|
+
obj.marginTop = `${spy}em`;
|
|
84
|
+
}
|
|
85
|
+
if ((spy || spy === 0) && (pos === "rightBottom" || pos === "item")) {
|
|
86
|
+
obj.paddingTop = `${spy}em`;
|
|
87
|
+
}
|
|
88
|
+
return obj;
|
|
89
|
+
});
|
|
90
|
+
const setLiStyle = computed(() => {
|
|
91
|
+
const obj = {};
|
|
92
|
+
const pos = props.submitPosition;
|
|
93
|
+
if ((props.space || props.space === 0) && pos === "rightBottom") {
|
|
94
|
+
obj.marginTop = `${props.space}em`;
|
|
95
|
+
}
|
|
96
|
+
if ((props.spaceY || props.spaceY === 0) && pos === "rightBottom") {
|
|
97
|
+
obj.marginTop = `${props.spaceY}em`;
|
|
98
|
+
}
|
|
99
|
+
return obj;
|
|
100
|
+
});
|
|
101
|
+
const adjust = () => {
|
|
102
|
+
setTimeout(() => {
|
|
103
|
+
let maxWidth = 0;
|
|
104
|
+
items.value.forEach((item) => {
|
|
105
|
+
var _a;
|
|
106
|
+
if ((_a = item == null ? void 0 : item.$refs) == null ? void 0 : _a.label) {
|
|
107
|
+
item.$refs.label.style.width = "";
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
items.value.forEach((item) => {
|
|
111
|
+
var _a;
|
|
112
|
+
const labelText = (_a = item == null ? void 0 : item.$refs) == null ? void 0 : _a.labelText;
|
|
113
|
+
if (labelText && labelText.clientWidth > maxWidth) {
|
|
114
|
+
maxWidth = labelText.clientWidth;
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
items.value.forEach((item) => {
|
|
118
|
+
var _a;
|
|
119
|
+
if ((_a = item == null ? void 0 : item.$refs) == null ? void 0 : _a.label) {
|
|
120
|
+
item.$refs.label.style.width = `${maxWidth + 1}px`;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}, 200);
|
|
124
|
+
};
|
|
125
|
+
onMounted(() => {
|
|
126
|
+
if (props.labelWidth === "max") {
|
|
127
|
+
window.addEventListener("resize", adjust);
|
|
128
|
+
adjust();
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
onBeforeUnmount(() => {
|
|
132
|
+
if (props.labelWidth === "max") {
|
|
133
|
+
window.removeEventListener("resize", adjust);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
const instance = getCurrentInstance();
|
|
137
|
+
provide("ToForm", instance == null ? void 0 : instance.proxy);
|
|
138
|
+
return (_ctx, _cache) => {
|
|
139
|
+
return openBlock(), createElementBlock(
|
|
140
|
+
"div",
|
|
141
|
+
{
|
|
142
|
+
class: normalizeClass(["to-form", setClass.value])
|
|
143
|
+
},
|
|
144
|
+
[
|
|
145
|
+
createElementVNode(
|
|
146
|
+
"ul",
|
|
147
|
+
{
|
|
148
|
+
ref_key: "toForm",
|
|
149
|
+
ref: toForm,
|
|
150
|
+
class: "to-form-list"
|
|
151
|
+
},
|
|
152
|
+
[
|
|
153
|
+
renderSlot(_ctx.$slots, "default"),
|
|
154
|
+
props.submitPosition === "corner" ? (openBlock(), createElementBlock(
|
|
155
|
+
"li",
|
|
156
|
+
{
|
|
157
|
+
key: 0,
|
|
158
|
+
class: "to-form-item to-form-placeholder",
|
|
159
|
+
style: normalizeStyle(setLiStyle.value)
|
|
160
|
+
},
|
|
161
|
+
null,
|
|
162
|
+
4
|
|
163
|
+
/* STYLE */
|
|
164
|
+
)) : createCommentVNode("v-if", true),
|
|
165
|
+
unref(slots).submit ? (openBlock(), createElementBlock(
|
|
166
|
+
"li",
|
|
167
|
+
{
|
|
168
|
+
key: 1,
|
|
169
|
+
class: "to-form-submit",
|
|
170
|
+
style: normalizeStyle(setSubmitStyle.value.value)
|
|
171
|
+
},
|
|
172
|
+
[
|
|
173
|
+
renderSlot(_ctx.$slots, "submit")
|
|
174
|
+
],
|
|
175
|
+
4
|
|
176
|
+
/* STYLE */
|
|
177
|
+
)) : createCommentVNode("v-if", true)
|
|
178
|
+
],
|
|
179
|
+
512
|
|
180
|
+
/* NEED_PATCH */
|
|
181
|
+
)
|
|
182
|
+
],
|
|
183
|
+
2
|
|
184
|
+
/* CLASS */
|
|
185
|
+
);
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
var _export_sfc = (sfc, props) => {
|
|
191
|
+
const target = sfc.__vccOpts || sfc;
|
|
192
|
+
for (const [key, val] of props) {
|
|
193
|
+
target[key] = val;
|
|
194
|
+
}
|
|
195
|
+
return target;
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
var Form = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/form/src/form.vue"]]);
|
|
199
|
+
|
|
200
|
+
const _hoisted_1 = { class: "to-form-value" };
|
|
201
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
202
|
+
...{
|
|
203
|
+
name: "ToFormItem",
|
|
204
|
+
inheritAttrs: false
|
|
205
|
+
},
|
|
206
|
+
__name: "form-item",
|
|
207
|
+
props: {
|
|
208
|
+
label: { type: String, required: false },
|
|
209
|
+
labelTip: { type: String, required: false },
|
|
210
|
+
tip: { type: String, required: false },
|
|
211
|
+
labelWidth: { type: [Number, String], required: false },
|
|
212
|
+
required: { type: Boolean, required: false },
|
|
213
|
+
merge: { type: [Number, String, null], required: false },
|
|
214
|
+
link: { type: Boolean, required: false }
|
|
215
|
+
},
|
|
216
|
+
emits: ["click"],
|
|
217
|
+
setup(__props, { emit: __emit }) {
|
|
218
|
+
const emit = __emit;
|
|
219
|
+
const props = __props;
|
|
220
|
+
const labelV = ref(null);
|
|
221
|
+
const labelText = ref(null);
|
|
222
|
+
const ToForm = inject("ToForm", {
|
|
223
|
+
items: []
|
|
224
|
+
});
|
|
225
|
+
provide("ToFormItem", {});
|
|
226
|
+
const setClass = computed(() => {
|
|
227
|
+
const arr = [];
|
|
228
|
+
if (props.required)
|
|
229
|
+
arr.push("is-required");
|
|
230
|
+
if (props.link)
|
|
231
|
+
arr.push("link");
|
|
232
|
+
if (props.merge !== null && props.merge !== void 0)
|
|
233
|
+
arr.push(`merge-${props.merge}`);
|
|
234
|
+
return arr;
|
|
235
|
+
});
|
|
236
|
+
const setLabelStyle = computed(() => {
|
|
237
|
+
const style = {};
|
|
238
|
+
if (ToForm.labelWidth) {
|
|
239
|
+
style.width = ToForm.labelWidth + "em";
|
|
240
|
+
}
|
|
241
|
+
return style;
|
|
242
|
+
});
|
|
243
|
+
onMounted(() => {
|
|
244
|
+
var _a;
|
|
245
|
+
(_a = ToForm == null ? void 0 : ToForm.items) == null ? void 0 : _a.push({
|
|
246
|
+
$refs: {
|
|
247
|
+
label: labelV.value,
|
|
248
|
+
labelText: labelText.value
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
return (_ctx, _cache) => {
|
|
253
|
+
return openBlock(), createElementBlock(
|
|
254
|
+
"li",
|
|
255
|
+
{
|
|
256
|
+
class: normalizeClass(["to-form-item", setClass.value]),
|
|
257
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emit("click"))
|
|
258
|
+
},
|
|
259
|
+
[
|
|
260
|
+
createElementVNode(
|
|
261
|
+
"div",
|
|
262
|
+
{
|
|
263
|
+
class: "to-form-label",
|
|
264
|
+
style: normalizeStyle(setLabelStyle.value)
|
|
265
|
+
},
|
|
266
|
+
toDisplayString(props.label),
|
|
267
|
+
5
|
|
268
|
+
/* TEXT, STYLE */
|
|
269
|
+
),
|
|
270
|
+
createElementVNode("div", _hoisted_1, [
|
|
271
|
+
renderSlot(_ctx.$slots, "default")
|
|
272
|
+
])
|
|
273
|
+
],
|
|
274
|
+
2
|
|
275
|
+
/* CLASS */
|
|
276
|
+
);
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
var FormItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/form/src/form-item.vue"]]);
|
|
282
|
+
|
|
283
|
+
const withInstall = (main, extra) => {
|
|
284
|
+
main.install = (app) => {
|
|
285
|
+
for (const comp of [main, ...Object.values(extra != null ? extra : {})]) {
|
|
286
|
+
app.component(comp.name, comp);
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
if (extra) {
|
|
290
|
+
for (const [key, comp] of Object.entries(extra)) {
|
|
291
|
+
main[key] = comp;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
return main;
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
navigator.userAgent.toLowerCase();
|
|
298
|
+
|
|
299
|
+
const ToForm = withInstall(Form);
|
|
300
|
+
const ToFormItem = withInstall(FormItem);
|
|
301
|
+
|
|
302
|
+
export { ToForm, ToFormItem };
|
|
303
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../packages/components/form/src/form.vue","../../../../packages/components/form/src/form-item.vue","../../../../packages/utils/types.ts","../../../../packages/utils/ratio.ts","../../../../packages/components/form/index.ts"],"sourcesContent":["<template>\n <div class=\"to-form\" :class=\"setClass\">\n <ul ref=\"toForm\" class=\"to-form-list\">\n <slot></slot>\n <li\n v-if=\"props.submitPosition === 'corner'\"\n class=\"to-form-item to-form-placeholder\"\n :style=\"setLiStyle\"\n ></li>\n <li v-if=\"slots.submit\" class=\"to-form-submit\" :style=\"setSubmitStyle.value\">\n <slot name=\"submit\"></slot>\n </li>\n </ul>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n ref,\n computed,\n onMounted,\n onBeforeUnmount,\n provide,\n getCurrentInstance,\n useSlots,\n} from 'vue';\n\ndefineOptions({\n name: 'ToForm',\n});\nconst props = defineProps({\n labelWidth: {\n type: [Number, String],\n default: '',\n },\n labelPosition: {\n type: String,\n default: 'left',\n },\n col: {\n type: [Number, String],\n default: 1,\n },\n submitPosition: {\n type: String,\n default: '',\n },\n type: {\n type: String,\n default: '',\n },\n mode: {\n type: String,\n default: '',\n },\n space: {\n type: [Number, String],\n default: (props: any) => (props.type === 'list' ? 0 : 0.5),\n },\n spaceX: {\n type: [Number, String],\n default: '',\n },\n spaceY: {\n type: [Number, String],\n default: '',\n },\n valueWidth: {\n type: String,\n default: '',\n },\n comparable: Boolean,\n readonly: Boolean,\n});\n\nconst toForm = ref<HTMLElement | null>(null);\nconst slots = useSlots();\nconst items = ref<any[]>([]);\n\nconst setClass = computed(() => {\n const arr: string[] = [];\n if (props.col) arr.push(`col-${props.col}`);\n if (props.submitPosition) arr.push(`submit-position-${props.submitPosition}`);\n if (props.mode) arr.push(`mode-${props.mode}`);\n if (props.labelPosition) arr.push(`label-position-${props.labelPosition}`);\n if (props.valueWidth) arr.push(`value-width-${props.valueWidth}`);\n return arr;\n});\n\n// const setUlStyle = computed(() => {\n// \tconst obj: Record<string, string> = {}\n// \tif (props.space || props.space === 0) obj.marginTop = `-${props.space}em`\n// \tif (props.spaceY || props.spaceY === 0) obj.marginTop = `-${props.spaceY}em`\n// \treturn obj\n// })\n\nconst setSubmitStyle = computed(() => {\n const obj: Record<string, string> = {};\n const sp = props.space;\n const spy = props.spaceY;\n const pos = props.submitPosition;\n if ((sp || sp === 0) && pos !== 'right' && pos !== 'follow' && props.type !== 'list') {\n obj.marginTop = `${sp}em`;\n }\n if ((sp || sp === 0) && (pos === 'rightBottom' || pos === 'item')) {\n obj.paddingTop = `${sp}em`;\n }\n if ((spy || spy === 0) && pos !== 'right' && pos !== 'follow' && props.type !== 'list') {\n obj.marginTop = `${spy}em`;\n }\n if ((spy || spy === 0) && (pos === 'rightBottom' || pos === 'item')) {\n obj.paddingTop = `${spy}em`;\n }\n return obj;\n});\n\nconst setLiStyle = computed(() => {\n const obj: Record<string, string> = {};\n const pos = props.submitPosition;\n if ((props.space || props.space === 0) && pos === 'rightBottom') {\n obj.marginTop = `${props.space}em`;\n }\n if ((props.spaceY || props.spaceY === 0) && pos === 'rightBottom') {\n obj.marginTop = `${props.spaceY}em`;\n }\n return obj;\n});\n\nconst adjust = () => {\n setTimeout(() => {\n let maxWidth = 0;\n items.value.forEach(item => {\n if (item?.$refs?.label) {\n item.$refs.label.style.width = '';\n }\n });\n items.value.forEach(item => {\n const labelText = item?.$refs?.labelText;\n if (labelText && labelText.clientWidth > maxWidth) {\n maxWidth = labelText.clientWidth;\n }\n });\n items.value.forEach(item => {\n if (item?.$refs?.label) {\n item.$refs.label.style.width = `${maxWidth + 1}px`;\n }\n });\n }, 200);\n};\n\nonMounted(() => {\n if (props.labelWidth === 'max') {\n window.addEventListener('resize', adjust);\n adjust();\n }\n});\n\nonBeforeUnmount(() => {\n if (props.labelWidth === 'max') {\n window.removeEventListener('resize', adjust);\n }\n});\n\n// provide current instance\nconst instance = getCurrentInstance();\nprovide('ToForm', instance?.proxy);\n</script>\n","<template>\n <li class=\"to-form-item\" :class=\"setClass\" @click=\"emit('click')\">\n <div class=\"to-form-label\" :style=\"setLabelStyle\">{{ props.label }}</div>\n <div class=\"to-form-value\">\n <slot></slot>\n </div>\n </li>\n</template>\n\n<script lang=\"ts\" setup>\nimport { ref, computed, inject, provide, onMounted } from 'vue';\n\ninterface ToFormContext {\n type?: string;\n space?: number;\n spaceX?: number;\n spaceY?: number;\n labelWidth?: string | number;\n submitPosition?: string;\n items: any[];\n}\n\ndefineOptions({\n name: 'ToFormItem',\n inheritAttrs: false,\n});\n\nconst emit = defineEmits<{\n (e: 'click'): void;\n}>();\n\nconst props = defineProps<{\n label?: string;\n labelTip?: string;\n tip?: string;\n labelWidth?: number | string;\n required?: boolean;\n merge?: number | string | null;\n link?: boolean;\n}>();\n\nconst labelV = ref<HTMLElement | null>(null);\nconst labelText = ref<HTMLElement | null>(null);\n\nconst ToForm = inject<ToFormContext>('ToForm', {\n items: [],\n});\n\nprovide('ToFormItem', {});\n\nconst setClass = computed(() => {\n const arr: string[] = [];\n if (props.required) arr.push('is-required');\n if (props.link) arr.push('link');\n if (props.merge !== null && props.merge !== undefined) arr.push(`merge-${props.merge}`);\n return arr;\n});\n\n// const setLabelClass = computed(() => {\n// \tconst arr: string[] = []\n// \tif (props.labelWidth || props.labelWidth === 0) {\n// \t\tarr.push(`label-width-${props.labelWidth}`)\n// \t}\n// \treturn arr\n// })\n\nconst setLabelStyle = computed(() => {\n const style: Record<string, string> = {};\n if (ToForm.labelWidth) {\n style.width = ToForm.labelWidth + 'em';\n }\n return style;\n});\n\nonMounted(() => {\n ToForm?.items?.push({\n $refs: {\n label: labelV.value,\n labelText: labelText.value,\n },\n });\n});\n</script>\n","import type { App, Plugin } from 'vue';\n\n/* 生成install函数 */\n\nexport type SFCWithInstall<T> = T & Plugin;\n\nexport type SFCInstallWithContext<T> = SFCWithInstall<T> & {\n _context: App | null;\n};\n\nexport const withInstall = <T, E extends Record<string, any>>(main: T, extra?: E) => {\n (main as SFCWithInstall<T>).install = (app: App): void => {\n for (const comp of [main, ...Object.values(extra ?? {})]) {\n app.component(comp.name, comp);\n }\n };\n\n if (extra) {\n for (const [key, comp] of Object.entries(extra)) {\n (main as any)[key] = comp;\n }\n }\n return main as SFCWithInstall<T> & E;\n};\n\nexport const withInstallFunction = <T>(fn: T, name: string) => {\n (fn as SFCWithInstall<T>).install = (app: App) => {\n (fn as SFCInstallWithContext<T>)._context = app;\n app.config.globalProperties[name] = fn;\n };\n\n return fn as SFCInstallWithContext<T>;\n};\n","interface Options {\n ratio?: {\n base?: {\n pc?: number;\n pad?: number;\n phone?: number;\n };\n };\n}\n\nconst ua = navigator.userAgent.toLowerCase();\n\nexport function setRatio(options: Options = {}) {\n const ua = navigator.userAgent.toLowerCase();\n const base = options?.ratio?.base ?? {};\n\n const baseSize = /iphone|android.*mobile|windows phone|ipod/i.test(ua)\n ? (base.phone ?? 375)\n : /ipad|android(?!.*mobile)|tablet/i.test(ua)\n ? (base.pad ?? 1100)\n : (base.pc ?? 1366);\n\n const updateFontSize = () => {\n const width = window.innerWidth || document.documentElement.clientWidth;\n document.documentElement.style.fontSize = (width / baseSize) * 100 + 'px';\n };\n\n updateFontSize();\n window.addEventListener('resize', updateFontSize);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function getMedia(options: Options = {}) {\n const isMobile = /iphone|android.*mobile|windows phone|ipod/i.test(ua);\n const isTablet = /ipad|android(?!.*mobile)|tablet/i.test(ua);\n\n return isMobile ? 'phone' : isTablet ? 'pad' : 'pc';\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function setMedia(options: Options = {}) {\n const html = document.documentElement;\n const classList: string[] = [];\n\n // 判断操作系统\n if (/windows/i.test(ua)) {\n classList.push('os-windows');\n } else if (/macintosh|mac os x/i.test(ua)) {\n classList.push('os-macos');\n } else if (/android/i.test(ua)) {\n classList.push('os-android');\n } else if (/iphone|ipad|ipod/i.test(ua)) {\n classList.push('os-ios');\n }\n\n // 判断设备类型\n const media = getMedia();\n if (media === 'pad') {\n classList.push('media-pad');\n } else if (media === 'phone') {\n classList.push('media-phone');\n } else {\n classList.push('media-pc');\n }\n\n // 添加 class 到 <html>\n html.className += ' ' + classList.join(' ');\n}\n\nexport function getEm() {\n const el = document.createElement('div');\n el.style.width = '1em';\n el.style.height = '1em';\n el.style.position = 'absolute';\n document.body.appendChild(el);\n const size = el.getBoundingClientRect().height;\n document.body.removeChild(el);\n return size;\n}\n","import Form from './src/form.vue';\nimport FormItem from './src/form-item.vue';\nimport { SFCWithInstall, withInstall } from '@touchvue/utils';\n\nexport const ToForm: SFCWithInstall<typeof Form> = withInstall(Form);\nexport const ToFormItem: SFCWithInstall<typeof FormItem> = withInstall(FormItem);\n\nexport * from './src/instance';\n"],"names":["_createElementBlock","_normalizeClass","_createElementVNode","_renderSlot","_unref","_normalizeStyle","_toDisplayString"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AA6Cd,IAAM,MAAA,MAAA,GAAS,IAAwB,IAAI,CAAA,CAAA;AAC3C,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AACvB,IAAM,MAAA,KAAA,GAAQ,GAAW,CAAA,EAAE,CAAA,CAAA;AAE3B,IAAM,MAAA,QAAA,GAAW,SAAS,MAAM;AAC9B,MAAA,MAAM,MAAgB,EAAC,CAAA;AACvB,MAAA,IAAI,KAAM,CAAA,GAAA;AAAK,QAAI,GAAA,CAAA,IAAA,CAAK,CAAO,IAAA,EAAA,KAAA,CAAM,GAAK,CAAA,CAAA,CAAA,CAAA;AAC1C,MAAA,IAAI,KAAM,CAAA,cAAA;AAAgB,QAAI,GAAA,CAAA,IAAA,CAAK,CAAmB,gBAAA,EAAA,KAAA,CAAM,cAAgB,CAAA,CAAA,CAAA,CAAA;AAC5E,MAAA,IAAI,KAAM,CAAA,IAAA;AAAM,QAAI,GAAA,CAAA,IAAA,CAAK,CAAQ,KAAA,EAAA,KAAA,CAAM,IAAM,CAAA,CAAA,CAAA,CAAA;AAC7C,MAAA,IAAI,KA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AA;AAAA,YAAyE,KAAA;AAAA,YAAA;AAAA,cAApE,KAAM,EAAA,eAAA;AAAA,cAAiB,KAAA,gBAAO,CAAA,aAAA,CAAa,KAAA,CAAA;AAAA,aAAK;AAAA,YAAAI,eAAA,CAAA,MAAM,KAAK,CAAA;AAAA,YAAA,CAAA;AAAA;AAAA,WAAA;AAAA,UAChEJ,kBAAA,CAEM,OAFN,UAEM,EAAA;AAAA,YADJC,UAAA,CAAa,IAAA,CAAA,MAAA,EAAA,SAAA,CAAA;AAAA;;;;;;;;;;;ACMN,MAAA,WAAA,GAAc,CAAmC,IAAA,EAAS,KAAc,KAAA;AACnF,EAAC,IAAA,CAA2B,OAAU,GAAA,CAAC,GAAmB,KAAA;AACxD,IAAW,KAAA,MAAA,IAAA,IAAQ,CAAC,IAAA,EAAM,GAAG,MAAA,CAAO,OAAO,KAAS,IAAA,IAAA,GAAA,KAAA,GAAA,EAAE,CAAC,CAAG,EAAA;AACxD,MAAI,GAAA,CAAA,SAAA,CAAU,IAAK,CAAA,IAAA,EAAM,IAAI,CAAA,CAAA;AAAA,KAC/B;AAAA,GACF,CAAA;AAEA,EAAA,IAAI,KAAO,EAAA;AACT,IAAA,KAAA,MAAW,CAAC,GAAK,EAAA,IAAI,KAAK,MAAO,CAAA,OAAA,CAAQ,KAAK,CAAG,EAAA;AAC/C,MAAC,IAAA,CAAa,GAAG,CAAI,GAAA,IAAA,CAAA;AAAA,KACvB;AAAA,GACF;AACA,EAAO,OAAA,IAAA,CAAA;AACT,CAAA;;ACbW,SAAU,CAAA,SAAA,CAAU,WAAY;;ACN9B,MAAA,MAAA,GAAsC,YAAY,IAAI,EAAA;AACtD,MAAA,UAAA,GAA8C,YAAY,QAAQ;;;;"}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { defineComponent, provide, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, inject } from 'vue';
|
|
2
|
+
|
|
3
|
+
var _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
4
|
+
__name: "grid",
|
|
5
|
+
props: {
|
|
6
|
+
type: { type: String, required: false, default: "" },
|
|
7
|
+
mode: { type: String, required: false, default: "default" },
|
|
8
|
+
space: { type: [Number, String], required: false, default: 0 },
|
|
9
|
+
spaceX: { type: [Number, String], required: false, default: 0 },
|
|
10
|
+
spaceY: { type: [Number, String], required: false, default: 0 },
|
|
11
|
+
padding: { type: [Number, String], required: false, default: 0 },
|
|
12
|
+
paddingX: { type: [Number, String], required: false, default: 0 },
|
|
13
|
+
paddingY: { type: [Number, String], required: false, default: 0 },
|
|
14
|
+
paddingPosition: { type: String, required: false, default: "" },
|
|
15
|
+
col: { type: [Number, String], required: false, default: "" },
|
|
16
|
+
height: { type: [Number, String], required: false, default: "" },
|
|
17
|
+
verticalAlign: { type: String, required: false, default: "top" },
|
|
18
|
+
va: { type: String, required: false, default: "top" },
|
|
19
|
+
line: { type: Boolean, required: false, default: false },
|
|
20
|
+
wrap: { type: Boolean, required: false, default: true },
|
|
21
|
+
visible: { type: Boolean, required: false, default: false }
|
|
22
|
+
},
|
|
23
|
+
setup(__props) {
|
|
24
|
+
const props = __props;
|
|
25
|
+
provide("grid", props);
|
|
26
|
+
const setStyle = computed(() => {
|
|
27
|
+
const obj = {};
|
|
28
|
+
if (!props.paddingPosition) {
|
|
29
|
+
if (typeof props.padding === "string" && props.padding.includes(" ")) {
|
|
30
|
+
const arr = props.padding.split(" ").map((item) => isNaN(Number(item)) ? item : `${item}em`);
|
|
31
|
+
obj.padding = arr.join(" ");
|
|
32
|
+
} else {
|
|
33
|
+
if (!props.paddingX && !props.paddingY) {
|
|
34
|
+
obj.padding = isNaN(Number(props.padding)) ? String(props.padding) : `${props.padding}em`;
|
|
35
|
+
} else {
|
|
36
|
+
if (props.paddingX) {
|
|
37
|
+
const px = isNaN(Number(props.paddingX)) ? String(props.paddingX) : `${props.paddingX}em`;
|
|
38
|
+
obj.paddingLeft = px;
|
|
39
|
+
obj.paddingRight = px;
|
|
40
|
+
}
|
|
41
|
+
if (props.paddingY) {
|
|
42
|
+
const py = isNaN(Number(props.paddingY)) ? String(props.paddingY) : `${props.paddingY}em`;
|
|
43
|
+
obj.paddingTop = py;
|
|
44
|
+
obj.paddingBottom = py;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
} else {
|
|
49
|
+
const p = props.padding;
|
|
50
|
+
const position = props.paddingPosition;
|
|
51
|
+
if (["u", "n", "c", "left", "side"].includes(position)) {
|
|
52
|
+
obj.paddingLeft = isNaN(Number(p)) ? String(p) : `${p}em`;
|
|
53
|
+
}
|
|
54
|
+
if (["u", "n", "\u0254", "right", "side"].includes(position)) {
|
|
55
|
+
obj.paddingRight = isNaN(Number(p)) ? String(p) : `${p}em`;
|
|
56
|
+
}
|
|
57
|
+
if (["n", "c", "\u0254"].includes(position)) {
|
|
58
|
+
obj.paddingTop = isNaN(Number(p)) ? String(p) : `${p}em`;
|
|
59
|
+
}
|
|
60
|
+
if (["u", "c", "\u0254"].includes(position)) {
|
|
61
|
+
obj.paddingBottom = isNaN(Number(p)) ? String(p) : `${p}em`;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return obj;
|
|
65
|
+
});
|
|
66
|
+
const setContentStyle = computed(() => {
|
|
67
|
+
const obj = {};
|
|
68
|
+
if (props.space && props.type !== "v") {
|
|
69
|
+
obj.marginTop = `-${props.space}em`;
|
|
70
|
+
}
|
|
71
|
+
if (props.space) {
|
|
72
|
+
obj.marginLeft = `-${props.space}em`;
|
|
73
|
+
}
|
|
74
|
+
if (props.spaceY && props.type !== "v") {
|
|
75
|
+
obj.marginTop = `-${props.spaceY}em`;
|
|
76
|
+
}
|
|
77
|
+
if (props.spaceX) {
|
|
78
|
+
obj.marginLeft = `-${props.spaceX}em`;
|
|
79
|
+
}
|
|
80
|
+
if (String(props.space) === "-1") {
|
|
81
|
+
obj.paddingTop = "1px";
|
|
82
|
+
obj.paddingLeft = "1px";
|
|
83
|
+
}
|
|
84
|
+
if (String(props.spaceY) === "-1") {
|
|
85
|
+
obj.paddingTop = "1px";
|
|
86
|
+
}
|
|
87
|
+
if (String(props.spaceX) === "-1") {
|
|
88
|
+
obj.paddingLeft = "1px";
|
|
89
|
+
}
|
|
90
|
+
if (props.height && props.height !== "full") {
|
|
91
|
+
obj.height = isNaN(Number(props.height)) ? String(props.height) : `${props.height}em`;
|
|
92
|
+
}
|
|
93
|
+
return obj;
|
|
94
|
+
});
|
|
95
|
+
const setClass = computed(() => {
|
|
96
|
+
const classes = [];
|
|
97
|
+
if (props.col !== "")
|
|
98
|
+
classes.push(`col-${props.col}`);
|
|
99
|
+
if (props.line)
|
|
100
|
+
classes.push("is-line");
|
|
101
|
+
if (props.mode)
|
|
102
|
+
classes.push(`mode-${props.mode}`);
|
|
103
|
+
if (props.visible)
|
|
104
|
+
classes.push(`is-visible`);
|
|
105
|
+
if (!props.wrap)
|
|
106
|
+
classes.push("wrap-false");
|
|
107
|
+
if (props.type === "v")
|
|
108
|
+
classes.push("type-v");
|
|
109
|
+
if (props.height === "full")
|
|
110
|
+
classes.push("height-full");
|
|
111
|
+
if (props.verticalAlign === "center" || props.va === "center")
|
|
112
|
+
classes.push("va-center");
|
|
113
|
+
if (props.verticalAlign === "bottom" || props.va === "bottom")
|
|
114
|
+
classes.push("va-bottom");
|
|
115
|
+
return classes;
|
|
116
|
+
});
|
|
117
|
+
return (_ctx, _cache) => {
|
|
118
|
+
return openBlock(), createElementBlock(
|
|
119
|
+
"div",
|
|
120
|
+
{
|
|
121
|
+
class: normalizeClass(["to-grid", setClass.value]),
|
|
122
|
+
style: normalizeStyle(setStyle.value)
|
|
123
|
+
},
|
|
124
|
+
[
|
|
125
|
+
createElementVNode(
|
|
126
|
+
"div",
|
|
127
|
+
{
|
|
128
|
+
class: "to-grid-content",
|
|
129
|
+
style: normalizeStyle(setContentStyle.value)
|
|
130
|
+
},
|
|
131
|
+
[
|
|
132
|
+
renderSlot(_ctx.$slots, "default")
|
|
133
|
+
],
|
|
134
|
+
4
|
|
135
|
+
/* STYLE */
|
|
136
|
+
)
|
|
137
|
+
],
|
|
138
|
+
6
|
|
139
|
+
/* CLASS, STYLE */
|
|
140
|
+
);
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
var _export_sfc = (sfc, props) => {
|
|
146
|
+
const target = sfc.__vccOpts || sfc;
|
|
147
|
+
for (const [key, val] of props) {
|
|
148
|
+
target[key] = val;
|
|
149
|
+
}
|
|
150
|
+
return target;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
var Grid = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/grid/src/grid.vue"]]);
|
|
154
|
+
|
|
155
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
156
|
+
__name: "grid-item",
|
|
157
|
+
props: {
|
|
158
|
+
merge: { type: [Number, String], required: false, default: 1 },
|
|
159
|
+
width: { type: [Number, String], required: false, default: "" },
|
|
160
|
+
side: { type: Boolean, required: false, default: false }
|
|
161
|
+
},
|
|
162
|
+
setup(__props) {
|
|
163
|
+
const props = __props;
|
|
164
|
+
const grid = inject("grid", {});
|
|
165
|
+
function parseVal(val) {
|
|
166
|
+
return Number(val != null ? val : 0);
|
|
167
|
+
}
|
|
168
|
+
const setStyle = computed(() => {
|
|
169
|
+
const style = {};
|
|
170
|
+
const space = parseVal(grid == null ? void 0 : grid.space);
|
|
171
|
+
const spaceX = parseVal(grid == null ? void 0 : grid.spaceX);
|
|
172
|
+
const spaceY = parseVal(grid == null ? void 0 : grid.spaceY);
|
|
173
|
+
if (space > 0) {
|
|
174
|
+
style.paddingTop = `${space}em`;
|
|
175
|
+
style.paddingLeft = `${space}em`;
|
|
176
|
+
}
|
|
177
|
+
if (spaceY > 0) {
|
|
178
|
+
style.paddingTop = `${spaceY}em`;
|
|
179
|
+
}
|
|
180
|
+
if (spaceX > 0) {
|
|
181
|
+
style.paddingLeft = `${spaceX}em`;
|
|
182
|
+
}
|
|
183
|
+
if (space === -1) {
|
|
184
|
+
style.marginTop = "-1px";
|
|
185
|
+
style.marginLeft = "-1px";
|
|
186
|
+
}
|
|
187
|
+
if (spaceY === -1) {
|
|
188
|
+
style.marginTop = "-1px";
|
|
189
|
+
}
|
|
190
|
+
if (spaceX === -1) {
|
|
191
|
+
style.marginLeft = "-1px";
|
|
192
|
+
}
|
|
193
|
+
if (props.width) {
|
|
194
|
+
if (!isNaN(Number(props.width))) {
|
|
195
|
+
style.width = `${props.width}em`;
|
|
196
|
+
} else if (props.width === "full") {
|
|
197
|
+
style.width = "100%";
|
|
198
|
+
} else {
|
|
199
|
+
style.width = props.width.toString();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return style;
|
|
203
|
+
});
|
|
204
|
+
const setClass = computed(() => {
|
|
205
|
+
const arr = [];
|
|
206
|
+
if (Number(props.merge) > 1) {
|
|
207
|
+
arr.push(`merge-${props.merge}`);
|
|
208
|
+
}
|
|
209
|
+
if (props.side) {
|
|
210
|
+
arr.push("is-side");
|
|
211
|
+
}
|
|
212
|
+
return arr;
|
|
213
|
+
});
|
|
214
|
+
return (_ctx, _cache) => {
|
|
215
|
+
return openBlock(), createElementBlock(
|
|
216
|
+
"div",
|
|
217
|
+
{
|
|
218
|
+
class: normalizeClass(["to-grid-item", setClass.value]),
|
|
219
|
+
style: normalizeStyle(setStyle.value)
|
|
220
|
+
},
|
|
221
|
+
[
|
|
222
|
+
renderSlot(_ctx.$slots, "default")
|
|
223
|
+
],
|
|
224
|
+
6
|
|
225
|
+
/* CLASS, STYLE */
|
|
226
|
+
);
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
var GridItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/grid/src/grid-item.vue"]]);
|
|
232
|
+
|
|
233
|
+
const withInstall = (main, extra) => {
|
|
234
|
+
main.install = (app) => {
|
|
235
|
+
for (const comp of [main, ...Object.values(extra != null ? extra : {})]) {
|
|
236
|
+
app.component(comp.name, comp);
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
if (extra) {
|
|
240
|
+
for (const [key, comp] of Object.entries(extra)) {
|
|
241
|
+
main[key] = comp;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return main;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
navigator.userAgent.toLowerCase();
|
|
248
|
+
|
|
249
|
+
const ToGrid = withInstall(Grid);
|
|
250
|
+
const ToGridItem = withInstall(GridItem);
|
|
251
|
+
|
|
252
|
+
export { ToGrid, ToGridItem };
|
|
253
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../packages/components/grid/src/grid.vue","../../../../packages/components/grid/src/grid-item.vue","../../../../packages/utils/types.ts","../../../../packages/utils/ratio.ts","../../../../packages/components/grid/index.ts"],"sourcesContent":["<template>\n <div class=\"to-grid\" :class=\"setClass\" :style=\"setStyle\">\n <div class=\"to-grid-content\" :style=\"setContentStyle\">\n <slot></slot>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, provide } from 'vue';\n\ntype GridProps = {\n type?: string;\n mode?: string;\n space?: number | string;\n spaceX?: number | string;\n spaceY?: number | string;\n padding?: number | string;\n paddingX?: number | string;\n paddingY?: number | string;\n paddingPosition?: string;\n col?: number | string;\n height?: number | string;\n verticalAlign?: string;\n va?: string;\n line?: boolean;\n wrap?: boolean;\n visible?: boolean;\n};\n\n// 默认值\nconst props = withDefaults(defineProps<GridProps>(), {\n type: '',\n mode: 'default',\n space: 0,\n spaceX: 0,\n spaceY: 0,\n padding: 0,\n paddingX: 0,\n paddingY: 0,\n visible: false,\n paddingPosition: '',\n col: '',\n height: '',\n verticalAlign: 'top',\n va: 'top',\n line: false,\n wrap: true,\n});\n\nprovide('grid', props);\n\nconst setStyle = computed(() => {\n const obj: Record<string, string> = {};\n\n if (!props.paddingPosition) {\n if (typeof props.padding === 'string' && props.padding.includes(' ')) {\n const arr = props.padding.split(' ').map(item => (isNaN(Number(item)) ? item : `${item}em`));\n obj.padding = arr.join(' ');\n } else {\n if (!props.paddingX && !props.paddingY) {\n obj.padding = isNaN(Number(props.padding as string))\n ? String(props.padding)\n : `${props.padding}em`;\n } else {\n if (props.paddingX) {\n const px = isNaN(Number(props.paddingX as string))\n ? String(props.paddingX)\n : `${props.paddingX}em`;\n obj.paddingLeft = px;\n obj.paddingRight = px;\n }\n if (props.paddingY) {\n const py = isNaN(Number(props.paddingY as string))\n ? String(props.paddingY)\n : `${props.paddingY}em`;\n obj.paddingTop = py;\n obj.paddingBottom = py;\n }\n }\n }\n } else {\n const p = props.padding;\n const position = props.paddingPosition;\n if (['u', 'n', 'c', 'left', 'side'].includes(position)) {\n obj.paddingLeft = isNaN(Number(p as string)) ? String(p) : `${p}em`;\n }\n if (['u', 'n', 'ɔ', 'right', 'side'].includes(position)) {\n obj.paddingRight = isNaN(Number(p as string)) ? String(p) : `${p}em`;\n }\n if (['n', 'c', 'ɔ'].includes(position)) {\n obj.paddingTop = isNaN(Number(p as string)) ? String(p) : `${p}em`;\n }\n if (['u', 'c', 'ɔ'].includes(position)) {\n obj.paddingBottom = isNaN(Number(p as string)) ? String(p) : `${p}em`;\n }\n }\n\n return obj;\n});\n\nconst setContentStyle = computed(() => {\n const obj: Record<string, string> = {};\n\n if (props.space && props.type !== 'v') {\n obj.marginTop = `-${props.space}em`;\n }\n if (props.space) {\n obj.marginLeft = `-${props.space}em`;\n }\n if (props.spaceY && props.type !== 'v') {\n obj.marginTop = `-${props.spaceY}em`;\n }\n if (props.spaceX) {\n obj.marginLeft = `-${props.spaceX}em`;\n }\n\n if (String(props.space) === '-1') {\n obj.paddingTop = '1px';\n obj.paddingLeft = '1px';\n }\n if (String(props.spaceY) === '-1') {\n obj.paddingTop = '1px';\n }\n if (String(props.spaceX) === '-1') {\n obj.paddingLeft = '1px';\n }\n\n if (props.height && props.height !== 'full') {\n obj.height = isNaN(Number(props.height as string)) ? String(props.height) : `${props.height}em`;\n }\n\n return obj;\n});\n\nconst setClass = computed(() => {\n const classes: string[] = [];\n\n if (props.col !== '') classes.push(`col-${props.col}`);\n if (props.line) classes.push('is-line');\n if (props.mode) classes.push(`mode-${props.mode}`);\n if (props.visible) classes.push(`is-visible`);\n if (!props.wrap) classes.push('wrap-false');\n if (props.type === 'v') classes.push('type-v');\n if (props.height === 'full') classes.push('height-full');\n if (props.verticalAlign === 'center' || props.va === 'center') classes.push('va-center');\n if (props.verticalAlign === 'bottom' || props.va === 'bottom') classes.push('va-bottom');\n\n return classes;\n});\n</script>\n","<template>\n <div class=\"to-grid-item\" :style=\"setStyle\" :class=\"setClass\">\n <slot></slot>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject } from 'vue';\n\ninterface GridProps {\n space?: number | string;\n spaceX?: number | string;\n spaceY?: number | string;\n}\n\ninterface Props {\n merge?: number | string;\n width?: number | string;\n side?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n merge: 1,\n width: '',\n side: false,\n});\n\nconst grid = inject<GridProps>('grid', {});\n\nfunction parseVal(val: number | string | undefined): number {\n return Number(val ?? 0);\n}\n\nconst setStyle = computed(() => {\n const style: Record<string, string> = {};\n\n const space = parseVal(grid?.space);\n const spaceX = parseVal(grid?.spaceX);\n const spaceY = parseVal(grid?.spaceY);\n\n if (space > 0) {\n style.paddingTop = `${space}em`;\n style.paddingLeft = `${space}em`;\n }\n if (spaceY > 0) {\n style.paddingTop = `${spaceY}em`;\n }\n if (spaceX > 0) {\n style.paddingLeft = `${spaceX}em`;\n }\n\n if (space === -1) {\n style.marginTop = '-1px';\n style.marginLeft = '-1px';\n }\n if (spaceY === -1) {\n style.marginTop = '-1px';\n }\n if (spaceX === -1) {\n style.marginLeft = '-1px';\n }\n\n if (props.width) {\n if (!isNaN(Number(props.width))) {\n style.width = `${props.width}em`;\n } else if (props.width === 'full') {\n style.width = '100%';\n } else {\n style.width = props.width.toString();\n }\n }\n\n return style;\n});\n\nconst setClass = computed(() => {\n const arr: string[] = [];\n\n if (Number(props.merge) > 1) {\n arr.push(`merge-${props.merge}`);\n }\n if (props.side) {\n arr.push('is-side');\n }\n\n return arr;\n});\n</script>\n","import type { App, Plugin } from 'vue';\n\n/* 生成install函数 */\n\nexport type SFCWithInstall<T> = T & Plugin;\n\nexport type SFCInstallWithContext<T> = SFCWithInstall<T> & {\n _context: App | null;\n};\n\nexport const withInstall = <T, E extends Record<string, any>>(main: T, extra?: E) => {\n (main as SFCWithInstall<T>).install = (app: App): void => {\n for (const comp of [main, ...Object.values(extra ?? {})]) {\n app.component(comp.name, comp);\n }\n };\n\n if (extra) {\n for (const [key, comp] of Object.entries(extra)) {\n (main as any)[key] = comp;\n }\n }\n return main as SFCWithInstall<T> & E;\n};\n\nexport const withInstallFunction = <T>(fn: T, name: string) => {\n (fn as SFCWithInstall<T>).install = (app: App) => {\n (fn as SFCInstallWithContext<T>)._context = app;\n app.config.globalProperties[name] = fn;\n };\n\n return fn as SFCInstallWithContext<T>;\n};\n","interface Options {\n ratio?: {\n base?: {\n pc?: number;\n pad?: number;\n phone?: number;\n };\n };\n}\n\nconst ua = navigator.userAgent.toLowerCase();\n\nexport function setRatio(options: Options = {}) {\n const ua = navigator.userAgent.toLowerCase();\n const base = options?.ratio?.base ?? {};\n\n const baseSize = /iphone|android.*mobile|windows phone|ipod/i.test(ua)\n ? (base.phone ?? 375)\n : /ipad|android(?!.*mobile)|tablet/i.test(ua)\n ? (base.pad ?? 1100)\n : (base.pc ?? 1366);\n\n const updateFontSize = () => {\n const width = window.innerWidth || document.documentElement.clientWidth;\n document.documentElement.style.fontSize = (width / baseSize) * 100 + 'px';\n };\n\n updateFontSize();\n window.addEventListener('resize', updateFontSize);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function getMedia(options: Options = {}) {\n const isMobile = /iphone|android.*mobile|windows phone|ipod/i.test(ua);\n const isTablet = /ipad|android(?!.*mobile)|tablet/i.test(ua);\n\n return isMobile ? 'phone' : isTablet ? 'pad' : 'pc';\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function setMedia(options: Options = {}) {\n const html = document.documentElement;\n const classList: string[] = [];\n\n // 判断操作系统\n if (/windows/i.test(ua)) {\n classList.push('os-windows');\n } else if (/macintosh|mac os x/i.test(ua)) {\n classList.push('os-macos');\n } else if (/android/i.test(ua)) {\n classList.push('os-android');\n } else if (/iphone|ipad|ipod/i.test(ua)) {\n classList.push('os-ios');\n }\n\n // 判断设备类型\n const media = getMedia();\n if (media === 'pad') {\n classList.push('media-pad');\n } else if (media === 'phone') {\n classList.push('media-phone');\n } else {\n classList.push('media-pc');\n }\n\n // 添加 class 到 <html>\n html.className += ' ' + classList.join(' ');\n}\n\nexport function getEm() {\n const el = document.createElement('div');\n el.style.width = '1em';\n el.style.height = '1em';\n el.style.position = 'absolute';\n document.body.appendChild(el);\n const size = el.getBoundingClientRect().height;\n document.body.removeChild(el);\n return size;\n}\n","import Grid from './src/grid.vue';\nimport GridItem from './src/grid-item.vue';\nimport { SFCWithInstall, withInstall } from '@touchvue/utils';\n\nexport const ToGrid: SFCWithInstall<typeof Grid> = withInstall(Grid);\nexport const ToGridItem: SFCWithInstall<typeof GridItem> = withInstall(GridItem);\n\nexport * from './src/instance';\n"],"names":["_createElementBlock","_normalizeClass","_createElementVNode","_renderSlot"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AAmBd,IAAA,OAAA,CAAQ,QAAQ,KAAK,CAAA,CAAA;AAErB,IAAM,MAAA,QAAA,GAAW,SAAS,MAAM;AAC9B,MAAA,MAAM,MAA8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