mvframe 1.0.4

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.
@@ -0,0 +1,55 @@
1
+ import { getCurrentInstance as _, inject as p, computed as i, openBlock as o, createElementBlock as r, createElementVNode as s, renderSlot as a, unref as g, Fragment as h, toDisplayString as d, createCommentVNode as n } from "vue";
2
+ /* empty css */
3
+ import { _ as f } from "../vendor.js";
4
+ const m = { class: "MvcPage" }, b = {
5
+ key: 0,
6
+ class: "PageHeader"
7
+ }, v = { class: "PageHeaderLeft" }, y = { class: "PageHeaderTitle" }, P = { class: "PageHeaderSubTitle" }, H = { class: "PageHeaderRight" }, S = { class: "PageBody" }, k = /* @__PURE__ */ Object.assign({
8
+ name: "MvcPage",
9
+ inheritAttrs: !1
10
+ }, {
11
+ __name: "index",
12
+ props: {
13
+ title: {
14
+ type: String,
15
+ default: ""
16
+ },
17
+ subtitle: {
18
+ type: String,
19
+ default: ""
20
+ },
21
+ noheader: {
22
+ type: Boolean,
23
+ default: !1
24
+ }
25
+ },
26
+ setup(l) {
27
+ const e = l, { proxy: $ } = _(), c = p("store").tab(), u = i(() => e.title || e.subtitle);
28
+ return i(() => c.useTab ? {
29
+ minHeight: "calc(100vh - 48px - 36px)"
30
+ } : {
31
+ minHeight: "calc(100vh - 48px)"
32
+ }), (t, x) => (o(), r("div", m, [
33
+ e.noheader ? n("", !0) : (o(), r("div", b, [
34
+ s("div", v, [
35
+ t.$slots.header ? a(t.$slots, "header", { key: 0 }, void 0, !0) : g(u) ? (o(), r(h, { key: 1 }, [
36
+ s("h3", y, d(e.title), 1),
37
+ s("p", P, d(e.subtitle), 1)
38
+ ], 64)) : n("", !0)
39
+ ]),
40
+ s("div", H, [
41
+ t.$slots.right ? a(t.$slots, "right", { key: 0 }, void 0, !0) : n("", !0)
42
+ ])
43
+ ])),
44
+ s("div", S, [
45
+ a(t.$slots, "default", {}, void 0, !0)
46
+ ])
47
+ ]));
48
+ }
49
+ }), T = /* @__PURE__ */ f(k, [["__scopeId", "data-v-7d18d3b1"]]), C = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
50
+ __proto__: null,
51
+ default: T
52
+ }, Symbol.toStringTag, { value: "Module" }));
53
+ export {
54
+ C as _
55
+ };
@@ -0,0 +1,186 @@
1
+ import { ref as c, computed as r, useAttrs as U, watch as C, resolveComponent as b, openBlock as A, createBlock as T, mergeProps as F, unref as u, createSlots as W, withCtx as i, renderSlot as $, createElementVNode as V, isRef as q, createTextVNode as w, toDisplayString as v, createElementBlock as G, createVNode as H } from "vue";
2
+ const I = { class: "flexMode hb vc" }, L = { key: 1 }, Q = { class: "tag" }, X = { class: "flexMode hr" }, Y = /* @__PURE__ */ Object.assign({
3
+ name: "MvcSelect",
4
+ inheritAttrs: !1
5
+ }, {
6
+ __name: "index",
7
+ props: {
8
+ modelValue: {
9
+ type: [String, Number, Array],
10
+ default: void 0
11
+ },
12
+ multiple: {
13
+ type: Boolean,
14
+ default: !1
15
+ },
16
+ filterable: {
17
+ type: Boolean,
18
+ default: !1
19
+ },
20
+ options: {
21
+ type: Array,
22
+ default: () => []
23
+ },
24
+ valueKey: {
25
+ type: String,
26
+ default: "value"
27
+ },
28
+ labelKey: {
29
+ type: String,
30
+ default: "label"
31
+ },
32
+ selectAllTxt: {
33
+ type: String,
34
+ default: "All"
35
+ },
36
+ confirmTxt: {
37
+ type: String,
38
+ default: "Confirm"
39
+ },
40
+ nowrap: {
41
+ type: Boolean,
42
+ default: !1
43
+ }
44
+ },
45
+ emits: ["update:modelValue", "change"],
46
+ setup(g, { emit: O }) {
47
+ const l = g, h = c(null), a = c([]), s = c(!1), p = c(!1), _ = c(!1), f = O, B = (e) => {
48
+ l.multiple ? (a.value = Array.isArray(e) ? [...e] : [], m()) : (f("update:modelValue", e), f("change", e));
49
+ }, M = (e) => {
50
+ if (s.value = e, e && l.multiple) {
51
+ const t = l.modelValue;
52
+ a.value = Array.isArray(t) ? [...t] : t ? [t] : [], m();
53
+ }
54
+ }, d = () => {
55
+ var o;
56
+ if (!l.filterable || !s.value) return S();
57
+ const e = h.value, t = ((o = e == null ? void 0 : e.optionsArray) == null ? void 0 : o.value) ?? (e == null ? void 0 : e.optionsArray) ?? [];
58
+ return Array.isArray(t) ? t.filter((n) => n.visible && !n.isDisabled).map((n) => n.value) : S();
59
+ }, N = (e) => {
60
+ _.value = !1;
61
+ const t = d();
62
+ if (e)
63
+ a.value = [.../* @__PURE__ */ new Set([...a.value, ...t])];
64
+ else {
65
+ const o = new Set(t);
66
+ a.value = a.value.filter((n) => !o.has(n));
67
+ }
68
+ }, K = () => {
69
+ var e, t;
70
+ l.multiple && (f("update:modelValue", a.value), f("change", a.value), (t = (e = h.value) == null ? void 0 : e.blur) == null || t.call(e));
71
+ }, S = () => {
72
+ const e = l.valueKey;
73
+ return (l.options || []).map((t) => typeof t == "object" ? t[e] : t);
74
+ }, m = () => {
75
+ const e = d(), t = new Set(a.value ?? []), o = e.filter((y) => t.has(y)).length, n = e.length;
76
+ p.value = n > 0 && o === n, _.value = o > 0 && o < n;
77
+ }, j = r(() => l.multiple && s.value ? a.value : l.modelValue), P = r(() => {
78
+ const {
79
+ modelValue: e,
80
+ valueKey: t,
81
+ labelKey: o,
82
+ selectAllTxt: n,
83
+ confirmTxt: y,
84
+ nowrap: x,
85
+ ...k
86
+ } = l, J = k.props ?? {};
87
+ return {
88
+ ...k,
89
+ props: {
90
+ ...J,
91
+ value: t,
92
+ label: o
93
+ }
94
+ };
95
+ }), R = r(
96
+ () => l.nowrap ? {
97
+ collapseTags: !0,
98
+ collapseTagsTooltip: !0,
99
+ maxCollapseTags: 1,
100
+ tagTooltip: { popperStyle: { maxWidth: "400px" } }
101
+ } : {}
102
+ ), z = r(() => ({
103
+ ...R.value,
104
+ ...U(),
105
+ ...P.value
106
+ })), D = r(() => {
107
+ const e = l.multiple && s.value ? a.value : l.modelValue, t = Array.isArray(e) ? e : e ? [e] : [];
108
+ if (!l.filterable || !s.value) return t.length;
109
+ const o = d();
110
+ return t.filter((n) => o.includes(n)).length;
111
+ }), E = r(() => d().length);
112
+ return C(a, () => m(), { deep: !0 }), C(
113
+ () => l.modelValue,
114
+ (e) => {
115
+ if (l.multiple && s.value) {
116
+ const t = Array.isArray(e) ? [...e] : e ? [e] : [];
117
+ JSON.stringify(t) !== JSON.stringify(a.value) && (a.value = t, m());
118
+ }
119
+ }
120
+ ), (e, t) => {
121
+ const o = b("el-checkbox"), n = b("el-button"), y = b("el-select");
122
+ return A(), T(y, F({
123
+ ref_key: "selectRef",
124
+ ref: h,
125
+ "model-value": u(j),
126
+ "tag-effect": "plain",
127
+ class: "MvcSelect"
128
+ }, u(z), {
129
+ "onUpdate:modelValue": B,
130
+ onVisibleChange: M
131
+ }), W({
132
+ default: i(() => [
133
+ $(e.$slots, "default")
134
+ ]),
135
+ _: 2
136
+ }, [
137
+ l.filterable ? {
138
+ name: "header",
139
+ fn: i(() => [
140
+ V("div", I, [
141
+ l.multiple ? (A(), T(o, {
142
+ key: 0,
143
+ modelValue: u(p),
144
+ "onUpdate:modelValue": t[0] || (t[0] = (x) => q(p) ? p.value = x : null),
145
+ indeterminate: u(_),
146
+ class: "h24",
147
+ onChange: N
148
+ }, {
149
+ default: i(() => [
150
+ w(v(g.selectAllTxt), 1)
151
+ ]),
152
+ _: 1
153
+ }, 8, ["modelValue", "indeterminate"])) : (A(), G("span", L)),
154
+ V("span", Q, v(u(D)) + "/" + v(u(E)), 1)
155
+ ])
156
+ ]),
157
+ key: "0"
158
+ } : void 0,
159
+ l.multiple ? {
160
+ name: "footer",
161
+ fn: i(() => [
162
+ V("div", X, [
163
+ H(n, {
164
+ type: "primary",
165
+ size: "small",
166
+ onClick: K
167
+ }, {
168
+ default: i(() => [
169
+ w(v(g.confirmTxt), 1)
170
+ ]),
171
+ _: 1
172
+ })
173
+ ])
174
+ ]),
175
+ key: "1"
176
+ } : void 0
177
+ ]), 1040, ["model-value"]);
178
+ };
179
+ }
180
+ }), ee = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
181
+ __proto__: null,
182
+ default: Y
183
+ }, Symbol.toStringTag, { value: "Module" }));
184
+ export {
185
+ ee as _
186
+ };
@@ -0,0 +1,189 @@
1
+ import { ref as i, computed as u, useAttrs as $, watch as C, resolveComponent as A, openBlock as V, createBlock as T, mergeProps as D, unref as c, createSlots as F, withCtx as p, createElementVNode as S, isRef as G, createTextVNode as O, toDisplayString as g, createElementBlock as W, renderSlot as q, normalizeProps as H, guardReactiveProps as I, createVNode as L } from "vue";
2
+ const Q = { class: "flexMode hb vc" }, X = { key: 1 }, Y = { class: "tag" }, Z = { class: "flexMode hr" }, ee = /* @__PURE__ */ Object.assign({
3
+ name: "MvcSelectV2",
4
+ inheritAttrs: !1
5
+ }, {
6
+ __name: "index",
7
+ props: {
8
+ modelValue: {
9
+ type: [String, Number, Array],
10
+ default: void 0
11
+ },
12
+ multiple: {
13
+ type: Boolean,
14
+ default: !1
15
+ },
16
+ filterable: {
17
+ type: Boolean,
18
+ default: !1
19
+ },
20
+ options: {
21
+ type: Array,
22
+ default: () => []
23
+ },
24
+ valueKey: {
25
+ type: String,
26
+ default: "value"
27
+ },
28
+ labelKey: {
29
+ type: String,
30
+ default: "label"
31
+ },
32
+ selectAllTxt: {
33
+ type: String,
34
+ default: "All"
35
+ },
36
+ confirmTxt: {
37
+ type: String,
38
+ default: "Confirm"
39
+ },
40
+ nowrap: {
41
+ type: Boolean,
42
+ default: !1
43
+ }
44
+ },
45
+ emits: ["update:modelValue", "change"],
46
+ setup(h, { emit: w }) {
47
+ const l = h, _ = i(null), n = i([]), r = i(!1), d = i(!1), b = i(!1), f = w, B = (e) => {
48
+ l.multiple ? (n.value = Array.isArray(e) ? [...e] : [], y()) : (f("update:modelValue", e), f("change", e));
49
+ }, K = (e) => {
50
+ if (r.value = e, e && l.multiple) {
51
+ const t = l.modelValue;
52
+ n.value = Array.isArray(t) ? [...t] : t ? [t] : [], y();
53
+ }
54
+ }, m = () => {
55
+ var o;
56
+ if (!l.filterable || !r.value) return k();
57
+ const e = _.value, t = ((o = e == null ? void 0 : e.filteredOptions) == null ? void 0 : o.value) ?? (e == null ? void 0 : e.filteredOptions) ?? [];
58
+ if (!Array.isArray(t)) return k();
59
+ const a = l.valueKey;
60
+ return t.filter((s) => s.type !== "Group" && !s.disabled).map((s) => typeof s == "object" ? s[a] : s);
61
+ }, M = (e) => {
62
+ b.value = !1;
63
+ const t = m();
64
+ if (e)
65
+ n.value = [.../* @__PURE__ */ new Set([...n.value, ...t])];
66
+ else {
67
+ const a = new Set(t);
68
+ n.value = n.value.filter((o) => !a.has(o));
69
+ }
70
+ }, N = () => {
71
+ var e, t;
72
+ l.multiple && (f("update:modelValue", n.value), f("change", n.value), (t = (e = _.value) == null ? void 0 : e.blur) == null || t.call(e));
73
+ }, k = () => {
74
+ const e = l.valueKey;
75
+ return (l.options || []).map((t) => typeof t == "object" ? t[e] : t);
76
+ }, y = () => {
77
+ const e = m(), t = new Set(n.value ?? []), a = e.filter((s) => t.has(s)).length, o = e.length;
78
+ d.value = o > 0 && a === o, b.value = a > 0 && a < o;
79
+ }, j = u(() => l.multiple && r.value ? n.value : l.modelValue), P = u(() => {
80
+ const {
81
+ modelValue: e,
82
+ valueKey: t,
83
+ labelKey: a,
84
+ selectAllTxt: o,
85
+ confirmTxt: s,
86
+ nowrap: v,
87
+ ...x
88
+ } = l, U = x.props ?? {};
89
+ return {
90
+ ...x,
91
+ props: {
92
+ ...U,
93
+ value: t,
94
+ label: a
95
+ }
96
+ };
97
+ }), R = u(
98
+ () => l.nowrap ? {
99
+ collapseTags: !0,
100
+ collapseTagsTooltip: !0,
101
+ maxCollapseTags: 1,
102
+ tagTooltip: { popperStyle: { maxWidth: "400px" } }
103
+ } : {}
104
+ ), z = u(() => ({
105
+ ...R.value,
106
+ ...$(),
107
+ ...P.value
108
+ })), E = u(() => {
109
+ const e = l.multiple && r.value ? n.value : l.modelValue, t = Array.isArray(e) ? e : e ? [e] : [];
110
+ if (!l.filterable || !r.value) return t.length;
111
+ const a = m();
112
+ return t.filter((o) => a.includes(o)).length;
113
+ }), J = u(() => m().length);
114
+ return C(n, () => y(), { deep: !0 }), C(
115
+ () => l.modelValue,
116
+ (e) => {
117
+ if (l.multiple && r.value) {
118
+ const t = Array.isArray(e) ? [...e] : e ? [e] : [];
119
+ JSON.stringify(t) !== JSON.stringify(n.value) && (n.value = t, y());
120
+ }
121
+ }
122
+ ), (e, t) => {
123
+ const a = A("el-checkbox"), o = A("el-button"), s = A("el-select-v2");
124
+ return V(), T(s, D({
125
+ ref_key: "selectRef",
126
+ ref: _,
127
+ "model-value": c(j),
128
+ class: "MvcSelectV2"
129
+ }, c(z), {
130
+ "onUpdate:modelValue": B,
131
+ onVisibleChange: K
132
+ }), F({ _: 2 }, [
133
+ l.filterable ? {
134
+ name: "header",
135
+ fn: p(() => [
136
+ S("div", Q, [
137
+ l.multiple ? (V(), T(a, {
138
+ key: 0,
139
+ modelValue: c(d),
140
+ "onUpdate:modelValue": t[0] || (t[0] = (v) => G(d) ? d.value = v : null),
141
+ indeterminate: c(b),
142
+ class: "h24",
143
+ onChange: M
144
+ }, {
145
+ default: p(() => [
146
+ O(g(h.selectAllTxt), 1)
147
+ ]),
148
+ _: 1
149
+ }, 8, ["modelValue", "indeterminate"])) : (V(), W("span", X)),
150
+ S("span", Y, g(c(E)) + "/" + g(c(J)), 1)
151
+ ])
152
+ ]),
153
+ key: "0"
154
+ } : void 0,
155
+ e.$slots.default ? {
156
+ name: "default",
157
+ fn: p((v) => [
158
+ q(e.$slots, "default", H(I(v)))
159
+ ]),
160
+ key: "1"
161
+ } : void 0,
162
+ l.multiple ? {
163
+ name: "footer",
164
+ fn: p(() => [
165
+ S("div", Z, [
166
+ L(o, {
167
+ type: "primary",
168
+ size: "small",
169
+ onClick: N
170
+ }, {
171
+ default: p(() => [
172
+ O(g(h.confirmTxt), 1)
173
+ ]),
174
+ _: 1
175
+ })
176
+ ])
177
+ ]),
178
+ key: "2"
179
+ } : void 0
180
+ ]), 1040, ["model-value"]);
181
+ };
182
+ }
183
+ }), le = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
184
+ __proto__: null,
185
+ default: ee
186
+ }, Symbol.toStringTag, { value: "Module" }));
187
+ export {
188
+ le as _
189
+ };