z-vue-design 0.0.86 → 0.0.87

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 CHANGED
@@ -1,29 +1,196 @@
1
- # ai-report
1
+ ### useECharts 使用手册
2
2
 
3
- This template should help get you started developing with Vue 3 in Vite.
3
+ ### 安装
4
4
 
5
- ## Recommended IDE Setup
5
+ ```bash
6
+ npm install z-vue-design
7
+ ```
8
+
9
+ ### 引入
10
+
11
+ ```javascript
12
+ import { useECharts, ZECharts } from "@/utils/useECharts";
13
+ ```
14
+
15
+ ### 示例
16
+
17
+ ```vue
18
+ <template>
19
+ <ZECharts class="chart-container" @register="register"></ZECharts>
20
+ </template>
21
+
22
+ <script setup>
23
+ import { ref, onMounted } from "vue";
24
+ import { useECharts, ZECharts } from "@/utils/useECharts";
25
+
26
+ const [register, { setOptions, getInstance }] = useECharts();
27
+
28
+ onMounted(() => {});
29
+ </script>
30
+ ```
31
+
32
+ ### useForm 使用手册
33
+
34
+ ### 安装
35
+
36
+ ```bash
37
+ npm install z-vue-design
38
+ ```
39
+
40
+ ### 引入
6
41
 
7
- [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
42
+ ```js
43
+ import { ZForm } from "z-vue-design";
44
+ ```
45
+
46
+ ### 示例
47
+
48
+ ```vue
49
+ <template>
50
+ <ZForm @register="register">
51
+ <!-- 自定义插槽的使用,插槽名为formItem项中的name属性, 数据绑定为formState[name],通过监听可以获取到插槽字段的数据变化 -->
52
+ <template #slotTest="{ formState, name, utilsAttr }">
53
+ <ZInput
54
+ v-model="formState[name]"
55
+ :placeholder="utilsAttr?.placeholder"
56
+ ></ZInput>
57
+ </template>
58
+ </ZForm>
59
+ </template>
60
+
61
+ <script setup>
62
+ import { ZForm, ZInput } from "z-vue-design";
63
+ import { ref } from "vue";
8
64
 
9
- ## Customize configuration
65
+ const formItems = ref([
66
+ {
67
+ label: "开关",
68
+ name: "switch",
69
+ type: "ZSwitch",
70
+ formAttr: {},
71
+ },
72
+ {
73
+ label: "密码",
74
+ name: "password",
75
+ type: "ZInput",
76
+ // 表单 formItem 需要配置的属性
77
+ formAttr: {
78
+ type: "password",
79
+ rules: [
80
+ {
81
+ required: true,
82
+ message: "请输入用户名",
83
+ trigger: "blur",
84
+ },
85
+ ],
86
+ },
87
+ // formItem 内部组件(例如 <Input v-bind="utilAttr" />)需要配置的属性
88
+ utilAttr: {
89
+ placeholder: "请输入密码",
90
+ },
91
+ },
92
+ {
93
+ name: "slotTest",
94
+ utilsAttr: {
95
+ placeholder: "请输入",
96
+ },
97
+ },
98
+ ]);
10
99
 
11
- See [Vite Configuration Reference](https://vite.dev/config/).
100
+ // 表单属性字节在 ZForm 标签上配置
101
+ const [register, { getForm, getFormState }] = useForm({
102
+ formItems: formItems.value,
103
+ });
104
+ </script>
105
+ ```
106
+
107
+ ### 联动方案
12
108
 
13
- ## Project Setup
109
+ 监听 formState 变化,当 formState 中某个被依赖的属性变化时,触发联动事件
14
110
 
15
- ```sh
16
- npm install
111
+ ```vue
112
+ <script setup>
113
+ const watchFormState = computed(() => getFormState.value);
114
+ watch(
115
+ () => watchFormState.value,
116
+ (n) => {
117
+ console.log(n);
118
+ },
119
+ { deep: true, immediate: true }
120
+ );
121
+ </script>
17
122
  ```
18
123
 
19
- ### Compile and Hot-Reload for Development
124
+ ### useTable 使用手册
20
125
 
21
- ```sh
22
- npm run dev
126
+ ### 安装
127
+
128
+ ```bash
129
+ npm install z-vue-design
23
130
  ```
24
131
 
25
- ### Compile and Minify for Production
132
+ ### 引入
133
+
134
+ ```javascript
135
+ import { useTable, ZTable } from "@/utils/useTable";
136
+ ```
137
+
138
+ ### 示例
139
+
140
+ ```vue
141
+ <template>
142
+ <ZTable class="table-container" @register="register"></ZTable>
143
+ </template>
144
+
145
+ <script setup>
146
+ import { ref, onMounted } from "vue";
147
+ import { useTable, ZTable } from "@/utils/useTable";
148
+
149
+ /**
150
+ * 表格属性
151
+ * @typedef {Object} TableProps
152
+ * @property {Array} columns - 表格列配置,参照vxe-table的columns配置
153
+ * @property {Object} pagination - 分页配置
154
+ * pagination: {
155
+ * total: 0,
156
+ * currentPage: 1,
157
+ * totalPage: 0,
158
+ * pageSize: 20,
159
+ * onPageChange: (page) => {
160
+ * setPagination({
161
+ * currentPage: page.currentPage,
162
+ * pageSize: page.pageSize,
163
+ * });
164
+ * },
165
+ * },
166
+ * @property {Object} props - 表格配置,参照vxe-table的tableProps配置
167
+ * @property {Object} columnProps - 表格列配置,参照vxe-table的columnProps配置
168
+ * @property {Array} handleButton - 头部左侧操作按钮配置
169
+ * handleButton = [{
170
+ * key: "update",
171
+ * label: "add",
172
+ * onClick: (props) => {}
173
+ * }]
174
+ * @property {Object} utils - 头部右侧工具栏设置, 目前只有reload(表格刷新,可以在click中调用数据,重新设置表格数据)、column(表格交互操作按钮,例如:列设置),
175
+ * utils = {
176
+ * reload: {
177
+ // label: "刷新",
178
+ // onClick: () => {
179
+ // console.log(123);
180
+ // setData([]);
181
+ // },
182
+ // },
183
+ // column: {
184
+ // label: "列设置",
185
+ // },
186
+ * }
187
+ */
188
+
189
+ const tableProps = {};
190
+
191
+ const [register, { getColumns, setColumns, setData, setPagination }] =
192
+ useTable();
26
193
 
27
- ```sh
28
- npm run build
194
+ onMounted(() => {});
195
+ </script>
29
196
  ```
@@ -0,0 +1,35 @@
1
+ import { createVNode as c } from "vue";
2
+ import { I as m } from "./index-NxjGmddr.mjs";
3
+ const u = () => {
4
+ if (typeof navigator > "u" || typeof window > "u")
5
+ return !1;
6
+ const e = navigator.userAgent || navigator.vendor || window.opera;
7
+ return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e == null ? void 0 : e.substring(0, 4));
8
+ };
9
+ var l = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z" } }] }, name: "down", theme: "outlined" };
10
+ function n(e) {
11
+ for (var t = 1; t < arguments.length; t++) {
12
+ var i = arguments[t] != null ? Object(arguments[t]) : {}, a = Object.keys(i);
13
+ typeof Object.getOwnPropertySymbols == "function" && (a = a.concat(Object.getOwnPropertySymbols(i).filter(function(o) {
14
+ return Object.getOwnPropertyDescriptor(i, o).enumerable;
15
+ }))), a.forEach(function(o) {
16
+ s(e, o, i[o]);
17
+ });
18
+ }
19
+ return e;
20
+ }
21
+ function s(e, t, i) {
22
+ return t in e ? Object.defineProperty(e, t, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = i, e;
23
+ }
24
+ var r = function(t, i) {
25
+ var a = n({}, t, i.attrs);
26
+ return c(m, n({}, a, {
27
+ icon: l
28
+ }), null);
29
+ };
30
+ r.displayName = "DownOutlined";
31
+ r.inheritAttrs = !1;
32
+ export {
33
+ r as D,
34
+ u as i
35
+ };
@@ -0,0 +1,234 @@
1
+ import { P as i, a as f, I as k } from "./index-NxjGmddr.mjs";
2
+ import { defineComponent as w, shallowRef as _, createVNode as b, ref as O, watch as D, computed as S } from "vue";
3
+ var K = function(n, r) {
4
+ var o = {};
5
+ for (var t in n) Object.prototype.hasOwnProperty.call(n, t) && r.indexOf(t) < 0 && (o[t] = n[t]);
6
+ if (n != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, t = Object.getOwnPropertySymbols(n); a < t.length; a++)
7
+ r.indexOf(t[a]) < 0 && Object.prototype.propertyIsEnumerable.call(n, t[a]) && (o[t[a]] = n[t[a]]);
8
+ return o;
9
+ };
10
+ const $ = w({
11
+ compatConfig: {
12
+ MODE: 3
13
+ },
14
+ // inheritAttrs: false,
15
+ props: {
16
+ disabled: i.looseBool,
17
+ type: i.string,
18
+ value: i.any,
19
+ tag: {
20
+ type: String,
21
+ default: "input"
22
+ },
23
+ size: i.string,
24
+ onChange: Function,
25
+ onInput: Function,
26
+ onBlur: Function,
27
+ onFocus: Function,
28
+ onKeydown: Function,
29
+ onCompositionstart: Function,
30
+ onCompositionend: Function,
31
+ onKeyup: Function,
32
+ onPaste: Function,
33
+ onMousedown: Function
34
+ },
35
+ emits: ["change", "input", "blur", "keydown", "focus", "compositionstart", "compositionend", "keyup", "paste", "mousedown"],
36
+ setup(n, r) {
37
+ let {
38
+ expose: o
39
+ } = r;
40
+ const t = _(null);
41
+ return o({
42
+ focus: () => {
43
+ t.value && t.value.focus();
44
+ },
45
+ blur: () => {
46
+ t.value && t.value.blur();
47
+ },
48
+ input: t,
49
+ setSelectionRange: (l, c, d) => {
50
+ var v;
51
+ (v = t.value) === null || v === void 0 || v.setSelectionRange(l, c, d);
52
+ },
53
+ select: () => {
54
+ var l;
55
+ (l = t.value) === null || l === void 0 || l.select();
56
+ },
57
+ getSelectionStart: () => {
58
+ var l;
59
+ return (l = t.value) === null || l === void 0 ? void 0 : l.selectionStart;
60
+ },
61
+ getSelectionEnd: () => {
62
+ var l;
63
+ return (l = t.value) === null || l === void 0 ? void 0 : l.selectionEnd;
64
+ },
65
+ getScrollTop: () => {
66
+ var l;
67
+ return (l = t.value) === null || l === void 0 ? void 0 : l.scrollTop;
68
+ }
69
+ }), () => {
70
+ const {
71
+ tag: l,
72
+ value: c
73
+ } = n, d = K(n, ["tag", "value"]);
74
+ return b(l, f(f({}, d), {}, {
75
+ ref: t,
76
+ value: c
77
+ }), null);
78
+ };
79
+ }
80
+ });
81
+ function V(n) {
82
+ return Object.keys(n).reduce((r, o) => {
83
+ const t = n[o];
84
+ return typeof t > "u" || t === null || (r += `${o}: ${n[o]};`), r;
85
+ }, "");
86
+ }
87
+ var A = function(n, r) {
88
+ var o = {};
89
+ for (var t in n) Object.prototype.hasOwnProperty.call(n, t) && r.indexOf(t) < 0 && (o[t] = n[t]);
90
+ if (n != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, t = Object.getOwnPropertySymbols(n); a < t.length; a++)
91
+ r.indexOf(t[a]) < 0 && Object.prototype.propertyIsEnumerable.call(n, t[a]) && (o[t[a]] = n[t[a]]);
92
+ return o;
93
+ };
94
+ const q = w({
95
+ compatConfig: {
96
+ MODE: 3
97
+ },
98
+ inheritAttrs: !1,
99
+ props: {
100
+ disabled: i.looseBool,
101
+ type: i.string,
102
+ value: i.any,
103
+ lazy: i.bool.def(!0),
104
+ tag: {
105
+ type: String,
106
+ default: "input"
107
+ },
108
+ size: i.string,
109
+ style: i.oneOfType([String, Object]),
110
+ class: i.string
111
+ },
112
+ emits: ["change", "input", "blur", "keydown", "focus", "compositionstart", "compositionend", "keyup", "paste", "mousedown"],
113
+ setup(n, r) {
114
+ let {
115
+ emit: o,
116
+ attrs: t,
117
+ expose: a
118
+ } = r;
119
+ const u = _(null), g = O(), s = O(!1);
120
+ D([() => n.value, s], () => {
121
+ s.value || (g.value = n.value);
122
+ }, {
123
+ immediate: !0
124
+ });
125
+ const l = (e) => {
126
+ o("change", e);
127
+ }, c = (e) => {
128
+ s.value = !0, e.target.composing = !0, o("compositionstart", e);
129
+ }, d = (e) => {
130
+ s.value = !1, e.target.composing = !1, o("compositionend", e);
131
+ const p = document.createEvent("HTMLEvents");
132
+ p.initEvent("input", !0, !0), e.target.dispatchEvent(p), l(e);
133
+ }, v = (e) => {
134
+ if (s.value && n.lazy) {
135
+ g.value = e.target.value;
136
+ return;
137
+ }
138
+ o("input", e);
139
+ }, P = (e) => {
140
+ o("blur", e);
141
+ }, j = (e) => {
142
+ o("focus", e);
143
+ }, E = () => {
144
+ u.value && u.value.focus();
145
+ }, F = () => {
146
+ u.value && u.value.blur();
147
+ }, I = (e) => {
148
+ o("keydown", e);
149
+ }, B = (e) => {
150
+ o("keyup", e);
151
+ }, T = (e, p, y) => {
152
+ var m;
153
+ (m = u.value) === null || m === void 0 || m.setSelectionRange(e, p, y);
154
+ }, x = () => {
155
+ var e;
156
+ (e = u.value) === null || e === void 0 || e.select();
157
+ };
158
+ a({
159
+ focus: E,
160
+ blur: F,
161
+ input: S(() => {
162
+ var e;
163
+ return (e = u.value) === null || e === void 0 ? void 0 : e.input;
164
+ }),
165
+ setSelectionRange: T,
166
+ select: x,
167
+ getSelectionStart: () => {
168
+ var e;
169
+ return (e = u.value) === null || e === void 0 ? void 0 : e.getSelectionStart();
170
+ },
171
+ getSelectionEnd: () => {
172
+ var e;
173
+ return (e = u.value) === null || e === void 0 ? void 0 : e.getSelectionEnd();
174
+ },
175
+ getScrollTop: () => {
176
+ var e;
177
+ return (e = u.value) === null || e === void 0 ? void 0 : e.getScrollTop();
178
+ }
179
+ });
180
+ const z = (e) => {
181
+ o("mousedown", e);
182
+ }, M = (e) => {
183
+ o("paste", e);
184
+ }, R = S(() => n.style && typeof n.style != "string" ? V(n.style) : n.style);
185
+ return () => {
186
+ const {
187
+ style: e,
188
+ lazy: p
189
+ } = n, y = A(n, ["style", "lazy"]);
190
+ return b($, f(f(f({}, y), t), {}, {
191
+ style: R.value,
192
+ onInput: v,
193
+ onChange: l,
194
+ onBlur: P,
195
+ onFocus: j,
196
+ ref: u,
197
+ value: g.value,
198
+ onCompositionstart: c,
199
+ onCompositionend: d,
200
+ onKeyup: B,
201
+ onKeydown: I,
202
+ onPaste: M,
203
+ onMousedown: z
204
+ }), null);
205
+ };
206
+ }
207
+ });
208
+ var L = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z" } }] }, name: "search", theme: "outlined" };
209
+ function h(n) {
210
+ for (var r = 1; r < arguments.length; r++) {
211
+ var o = arguments[r] != null ? Object(arguments[r]) : {}, t = Object.keys(o);
212
+ typeof Object.getOwnPropertySymbols == "function" && (t = t.concat(Object.getOwnPropertySymbols(o).filter(function(a) {
213
+ return Object.getOwnPropertyDescriptor(o, a).enumerable;
214
+ }))), t.forEach(function(a) {
215
+ N(n, a, o[a]);
216
+ });
217
+ }
218
+ return n;
219
+ }
220
+ function N(n, r, o) {
221
+ return r in n ? Object.defineProperty(n, r, { value: o, enumerable: !0, configurable: !0, writable: !0 }) : n[r] = o, n;
222
+ }
223
+ var C = function(r, o) {
224
+ var t = h({}, r, o.attrs);
225
+ return b(k, h({}, t, {
226
+ icon: L
227
+ }), null);
228
+ };
229
+ C.displayName = "SearchOutlined";
230
+ C.inheritAttrs = !1;
231
+ export {
232
+ q as B,
233
+ C as S
234
+ };
@@ -1,7 +1,7 @@
1
1
  import { createElementBlock as e, openBlock as t } from "vue";
2
- import { A as r } from "./index-BqCcUSZ_.mjs";
2
+ import { _ as r } from "./index-NxjGmddr.mjs";
3
3
  const c = {};
4
- function o(n, s) {
4
+ function o(n, _) {
5
5
  return t(), e("div", null, "工具组件不存在");
6
6
  }
7
7
  const l = /* @__PURE__ */ r(c, [["render", o]]);
@@ -1,7 +1,7 @@
1
1
  import { useModel as n, resolveComponent as a, createBlock as i, openBlock as p, unref as d, withCtx as m, createVNode as u, mergeProps as _ } from "vue";
2
- import { C as f, l as v } from "./zh_CN-Ci4SAGB1.mjs";
3
- import { A as k } from "./index-BqCcUSZ_.mjs";
4
- import { D as P } from "./dayjs-D0ij1LGv.mjs";
2
+ import { C as f, l as v } from "./zh_CN-DrSVSNzk.mjs";
3
+ import { _ as k } from "./index-NxjGmddr.mjs";
4
+ import { D as P } from "./dayjs-phjds8dp.mjs";
5
5
  const g = {
6
6
  name: "ZDatePicker",
7
7
  components: {