@owocow/saber-ui 0.1.13 → 0.1.15

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.
Files changed (40) hide show
  1. package/dist/SaberAppLayout.vue_vue_type_script_setup_true_lang-Hr4TdNqR.js +487 -0
  2. package/dist/{SaberDictSelect.vue_vue_type_script_setup_true_lang-B8PTKNKX.js → SaberDictSelect.vue_vue_type_script_setup_true_lang-BKdOdlFX.js} +1 -1
  3. package/dist/SaberDistrictSelect.vue_vue_type_script_setup_true_lang-jkl2AOay.js +272 -0
  4. package/dist/{SaberInfo.vue_vue_type_script_setup_true_lang-B3W5VsGR.js → SaberInfo.vue_vue_type_script_setup_true_lang-B_1ugpqI.js} +1 -1
  5. package/dist/SaberPopSelect.vue_vue_type_script_setup_true_lang-eH8jkkzK.js +162 -0
  6. package/dist/SaberSwitchBar.vue_vue_type_script_setup_true_lang-CIbFBx5r.js +47 -0
  7. package/dist/components/SaberAppLayout.mjs +1 -1
  8. package/dist/components/SaberInfo.mjs +1 -1
  9. package/dist/components/SaberPagination.vue.d.ts +48 -0
  10. package/dist/components/SaberSwitchBar.mjs +1 -1
  11. package/dist/components/layout/SaberAppLayout.types.d.ts +8 -0
  12. package/dist/components/layout/SaberAppLayout.vue.d.ts +5 -0
  13. package/dist/composables/index.d.ts +1 -1
  14. package/dist/composables/use-page-header.d.ts +3 -1
  15. package/dist/composables/use-page-header.mjs +27 -15
  16. package/dist/composables/use-table.d.ts +1 -0
  17. package/dist/composables/use-table.mjs +45 -42
  18. package/dist/composables.mjs +22 -20
  19. package/dist/control-size.d.ts +33 -0
  20. package/dist/forms/components/SaberFilterBar.vue.d.ts +3 -0
  21. package/dist/forms/components/SaberFormModal.vue.d.ts +2 -0
  22. package/dist/forms/components/fields/SaberDistrictSelect.vue.d.ts +5 -0
  23. package/dist/forms/components/fields/SaberInput.vue.d.ts +5 -0
  24. package/dist/forms/components/fields/SaberInputNumber.vue.d.ts +10 -2
  25. package/dist/forms/components/fields/SaberPopSelect.vue.d.ts +4 -1
  26. package/dist/forms/components/fields/SaberSelect.vue.d.ts +10 -2
  27. package/dist/forms/dict-select.mjs +1 -1
  28. package/dist/forms/district-select.mjs +1 -1
  29. package/dist/forms/index.d.ts +1 -0
  30. package/dist/forms/pop-select.mjs +1 -1
  31. package/dist/forms.mjs +4 -4
  32. package/dist/index.d.ts +4 -1
  33. package/dist/index.mjs +175 -98
  34. package/dist/plugin-Cg7MKH3t.js +438 -0
  35. package/package.json +1 -1
  36. package/dist/SaberAppLayout.vue_vue_type_script_setup_true_lang-R7F5K7kj.js +0 -418
  37. package/dist/SaberDistrictSelect.vue_vue_type_script_setup_true_lang-BX8nLC35.js +0 -257
  38. package/dist/SaberPopSelect.vue_vue_type_script_setup_true_lang-BcS27NXI.js +0 -125
  39. package/dist/SaberSwitchBar.vue_vue_type_script_setup_true_lang-CDx3Dcas.js +0 -47
  40. package/dist/plugin-Dr3z0YFg.js +0 -396
package/dist/index.mjs CHANGED
@@ -1,26 +1,28 @@
1
- import h from "@nuxt/ui/vue-plugin";
2
- import y from "@nuxt/ui/components/Badge.vue";
3
- import { defineComponent as _, computed as f, openBlock as s, createBlock as $, normalizeStyle as v, withCtx as C, createTextVNode as k, toDisplayString as b, createElementBlock as i, normalizeClass as B, createElementVNode as l, createVNode as I, createCommentVNode as m, renderSlot as u } from "vue";
4
- import N from "@nuxt/ui/runtime/vue/components/Icon.vue";
5
- import { _ as D } from "./SaberConfirmModal.vue_vue_type_script_setup_true_lang-Cqp9krYl.js";
6
- import { _ as M } from "./SaberConfirmProvider.vue_vue_type_script_setup_true_lang-DUJ6ftNJ.js";
7
- import { _ as w } from "./SaberInfo.vue_vue_type_script_setup_true_lang-B3W5VsGR.js";
8
- import { _ as A } from "./SaberInfoProvider.vue_vue_type_script_setup_true_lang-3rF6bSCn.js";
9
- import { _ as P } from "./SaberModalWithMobile.vue_vue_type_script_setup_true_lang-aQlToncY.js";
10
- import { _ as z } from "./SaberStatus.vue_vue_type_script_setup_true_lang-D9aRVCow.js";
11
- import { _ as F } from "./SaberSwitchBar.vue_vue_type_script_setup_true_lang-CDx3Dcas.js";
12
- import { _ as L } from "./SaberAppLayout.vue_vue_type_script_setup_true_lang-R7F5K7kj.js";
13
- import { _ as U } from "./SaberAppSidebar.vue_vue_type_script_setup_true_lang-Cwuj9VNi.js";
14
- import { _ as V } from "./SaberNavigationSearch.vue_vue_type_script_setup_true_lang-Bj96kMla.js";
15
- import { k as W } from "./plugin-Dr3z0YFg.js";
16
- import { _ as ue, a as Se, b as _e, c as pe, d as ge, e as xe } from "./plugin-Dr3z0YFg.js";
17
- import { _ as ye } from "./SaberModal.vue_vue_type_script_setup_true_lang-DJno3jA3.js";
18
- import { _ as ve } from "./SaberDictCheckbox.vue_vue_type_script_setup_true_lang-DUbzy_C6.js";
19
- import { _ as ke, a as Be } from "./SaberDictRadio.vue_vue_type_script_setup_true_lang-DR6-jSID.js";
20
- import { _ as Ne } from "./SaberDictSelect.vue_vue_type_script_setup_true_lang-B8PTKNKX.js";
21
- import { _ as Me } from "./SaberDistrictSelect.vue_vue_type_script_setup_true_lang-BX8nLC35.js";
22
- import { _ as Ae } from "./SaberPopSelect.vue_vue_type_script_setup_true_lang-BcS27NXI.js";
23
- const d = {
1
+ import M from "@nuxt/ui/vue-plugin";
2
+ import V from "@nuxt/ui/components/Badge.vue";
3
+ import { defineComponent as z, computed as p, openBlock as m, createBlock as A, normalizeStyle as F, withCtx as L, createTextVNode as x, toDisplayString as S, createElementBlock as d, normalizeClass as c, createElementVNode as u, createVNode as v, createCommentVNode as f, renderSlot as $ } from "vue";
4
+ import W from "@nuxt/ui/runtime/vue/components/Icon.vue";
5
+ import { _ as j } from "./SaberConfirmModal.vue_vue_type_script_setup_true_lang-Cqp9krYl.js";
6
+ import { _ as H } from "./SaberConfirmProvider.vue_vue_type_script_setup_true_lang-DUJ6ftNJ.js";
7
+ import { _ as R } from "./SaberInfo.vue_vue_type_script_setup_true_lang-B_1ugpqI.js";
8
+ import { _ as T } from "./SaberInfoProvider.vue_vue_type_script_setup_true_lang-3rF6bSCn.js";
9
+ import { _ as E } from "./SaberModalWithMobile.vue_vue_type_script_setup_true_lang-aQlToncY.js";
10
+ import O from "@nuxt/ui/components/Pagination.vue";
11
+ import G from "@nuxt/ui/components/Select.vue";
12
+ import { _ as K } from "./SaberStatus.vue_vue_type_script_setup_true_lang-D9aRVCow.js";
13
+ import { _ as q } from "./SaberSwitchBar.vue_vue_type_script_setup_true_lang-CIbFBx5r.js";
14
+ import { _ as J } from "./SaberAppLayout.vue_vue_type_script_setup_true_lang-Hr4TdNqR.js";
15
+ import { _ as Q } from "./SaberAppSidebar.vue_vue_type_script_setup_true_lang-Cwuj9VNi.js";
16
+ import { _ as X } from "./SaberNavigationSearch.vue_vue_type_script_setup_true_lang-Bj96kMla.js";
17
+ import { k as Y } from "./plugin-Cg7MKH3t.js";
18
+ import { _ as Ne, a as Pe, b as we, c as De, d as Me, e as Ve } from "./plugin-Cg7MKH3t.js";
19
+ import { _ as Fe } from "./SaberModal.vue_vue_type_script_setup_true_lang-DJno3jA3.js";
20
+ import { _ as We } from "./SaberDictCheckbox.vue_vue_type_script_setup_true_lang-DUbzy_C6.js";
21
+ import { _ as He, a as Re } from "./SaberDictRadio.vue_vue_type_script_setup_true_lang-DR6-jSID.js";
22
+ import { _ as Ee } from "./SaberDictSelect.vue_vue_type_script_setup_true_lang-BKdOdlFX.js";
23
+ import { _ as Ge } from "./SaberDistrictSelect.vue_vue_type_script_setup_true_lang-jkl2AOay.js";
24
+ import { _ as qe } from "./SaberPopSelect.vue_vue_type_script_setup_true_lang-eH8jkkzK.js";
25
+ const y = {
24
26
  red: { 500: "#ef4444", 600: "#dc2626" },
25
27
  orange: { 500: "#f97316", 600: "#ea580c" },
26
28
  amber: { 500: "#f59e0b", 600: "#d97706" },
@@ -43,16 +45,16 @@ const d = {
43
45
  zinc: { 500: "#71717a", 600: "#52525b" },
44
46
  neutral: { 500: "#737373", 600: "#525252" },
45
47
  stone: { 500: "#78716c", 600: "#57534e" }
46
- }, H = d.gray;
47
- function S(e, t) {
48
- var o, a;
49
- return ((o = d[e]) == null ? void 0 : o[t]) ?? ((a = d[e]) == null ? void 0 : a[500]) ?? H[500];
48
+ }, Z = y.gray;
49
+ function w(e, a) {
50
+ var t, s;
51
+ return ((t = y[e]) == null ? void 0 : t[a]) ?? ((s = y[e]) == null ? void 0 : s[500]) ?? Z[500];
50
52
  }
51
- function R(e, t) {
52
- const o = parseInt(e.slice(1, 3), 16), a = parseInt(e.slice(3, 5), 16), r = parseInt(e.slice(5, 7), 16);
53
- return `rgba(${o}, ${a}, ${r}, ${t / 100})`;
53
+ function ee(e, a) {
54
+ const t = parseInt(e.slice(1, 3), 16), s = parseInt(e.slice(3, 5), 16), n = parseInt(e.slice(5, 7), 16);
55
+ return `rgba(${t}, ${s}, ${n}, ${a / 100})`;
54
56
  }
55
- const T = /* @__PURE__ */ _({
57
+ const te = /* @__PURE__ */ z({
56
58
  __name: "BadgeStatus",
57
59
  props: {
58
60
  value: {},
@@ -61,40 +63,40 @@ const T = /* @__PURE__ */ _({
61
63
  textColorWeight: { default: 500 }
62
64
  },
63
65
  setup(e) {
64
- const t = e, o = f(() => {
65
- const r = String(t.value);
66
- for (const c of t.config) {
67
- const n = c.split(":");
68
- if (n.length < 2) continue;
69
- const p = n[0], g = n[1], x = n[2] || "gray";
70
- if (g === r)
71
- return { label: p, color: x };
66
+ const a = e, t = p(() => {
67
+ const n = String(a.value);
68
+ for (const l of a.config) {
69
+ const i = l.split(":");
70
+ if (i.length < 2) continue;
71
+ const g = i[0], o = i[1], r = i[2] || "gray";
72
+ if (o === n)
73
+ return { label: g, color: r };
72
74
  }
73
- return { label: r, color: "gray" };
74
- }), a = f(() => {
75
- const { color: r } = o.value, c = S(r, 500), n = S(r, t.textColorWeight);
75
+ return { label: n, color: "gray" };
76
+ }), s = p(() => {
77
+ const { color: n } = t.value, l = w(n, 500), i = w(n, a.textColorWeight);
76
78
  return {
77
- backgroundColor: R(c, t.bgOpacity),
78
- color: n
79
+ backgroundColor: ee(l, a.bgOpacity),
80
+ color: i
79
81
  };
80
82
  });
81
- return (r, c) => {
82
- const n = y;
83
- return s(), $(n, {
84
- style: v(a.value),
83
+ return (n, l) => {
84
+ const i = V;
85
+ return m(), A(i, {
86
+ style: F(s.value),
85
87
  class: "inline-flex items-center rounded-full border-0 pt-0.75 pb-0.75 px-2 text-xs font-medium"
86
88
  }, {
87
- default: C(() => [
88
- k(b(o.value.label), 1)
89
+ default: L(() => [
90
+ x(S(t.value.label), 1)
89
91
  ]),
90
92
  _: 1
91
93
  }, 8, ["style"]);
92
94
  };
93
95
  }
94
- }), E = { class: "rounded-md border border-accented p-3" }, O = { class: "flex flex-col gap-1" }, j = { class: "text-base font-semibold mb-2 text-highlighted w-60" }, G = {
96
+ }), ae = { class: "rounded-md border border-accented p-3" }, oe = { class: "flex flex-col gap-1" }, re = { class: "text-base font-semibold mb-2 text-highlighted w-60" }, se = {
95
97
  key: 0,
96
98
  class: "text-sm text-muted w-60"
97
- }, K = { key: 0 }, q = { key: 1 }, J = /* @__PURE__ */ _({
99
+ }, ne = { key: 0 }, ie = { key: 1 }, le = /* @__PURE__ */ z({
98
100
  name: "SaberNoData",
99
101
  __name: "SaberNoData",
100
102
  props: {
@@ -105,65 +107,140 @@ const T = /* @__PURE__ */ _({
105
107
  description: { default: "当前列表为空,还没有任何数据" }
106
108
  },
107
109
  setup(e) {
108
- return (t, o) => {
109
- const a = N;
110
- return s(), i("div", {
111
- class: B([
110
+ return (a, t) => {
111
+ const s = W;
112
+ return m(), d("div", {
113
+ class: c([
112
114
  "flex flex-col items-center justify-center gap-6 rounded-md p-10 text-center bg-default",
113
115
  e.border && "border border-accented",
114
- t.$props.class
116
+ a.$props.class
115
117
  ])
116
118
  }, [
117
- l("div", E, [
118
- I(a, {
119
+ u("div", ae, [
120
+ v(s, {
119
121
  name: e.icon,
120
122
  class: "size-5"
121
123
  }, null, 8, ["name"])
122
124
  ]),
123
- l("div", O, [
124
- l("h4", j, b(e.title), 1),
125
- e.description ? (s(), i("p", G, b(e.description), 1)) : m("", !0)
125
+ u("div", oe, [
126
+ u("h4", re, S(e.title), 1),
127
+ e.description ? (m(), d("p", se, S(e.description), 1)) : f("", !0)
126
128
  ]),
127
- t.$slots.default ? (s(), i("div", K, [
128
- u(t.$slots, "default")
129
- ])) : m("", !0),
130
- t.$slots.extra ? (s(), i("p", q, [
131
- u(t.$slots, "extra")
132
- ])) : m("", !0)
129
+ a.$slots.default ? (m(), d("div", ne, [
130
+ $(a.$slots, "default")
131
+ ])) : f("", !0),
132
+ a.$slots.extra ? (m(), d("p", ie, [
133
+ $(a.$slots, "extra")
134
+ ])) : f("", !0)
133
135
  ], 2);
134
136
  };
135
137
  }
136
- }), be = {
137
- install(e, t = {}) {
138
- e.use(h), e.component("SaberBadgeStatus", T), e.component("SaberNoData", J), e.component("SaberConfirmModal", D), e.component("SaberConfirmProvider", M), e.component("SaberInfo", w), e.component("SaberInfoProvider", A), e.component("SaberModalWithMobile", P), e.component("SaberStatus", z), e.component("SaberSwitchBar", F), e.component("SaberAppSidebar", U), e.component("SaberNavigationSearch", V), e.component("SaberAppLayout", L), W(e, t.forms);
138
+ }), ce = /* @__PURE__ */ z({
139
+ __name: "SaberPagination",
140
+ props: {
141
+ page: { default: 1 },
142
+ pageSize: { default: 10 },
143
+ total: {},
144
+ pageSizes: { default: () => [10, 20, 50, 100] },
145
+ size: { default: "sm" },
146
+ ui: {}
147
+ },
148
+ emits: ["update:page", "update:pageSize"],
149
+ setup(e, { emit: a }) {
150
+ const t = e, s = a, n = p({
151
+ get: () => t.page,
152
+ set: (o) => s("update:page", o)
153
+ }), l = p({
154
+ get: () => t.pageSize,
155
+ set: (o) => s("update:pageSize", o)
156
+ }), i = p(() => t.pageSizes.map((o) => ({ label: `${o} 条/页`, value: o }))), g = p(() => {
157
+ var o, r, b;
158
+ return {
159
+ ...(o = t.ui) == null ? void 0 : o.pageSizeUi,
160
+ base: ["text-sm rounded-sm h-auto saberButton", (b = (r = t.ui) == null ? void 0 : r.pageSizeUi) == null ? void 0 : b.base].filter(Boolean).join(" ")
161
+ };
162
+ });
163
+ return (o, r) => {
164
+ var h, B, k, C, I, U, N, P;
165
+ const b = G, D = O;
166
+ return m(), d("div", {
167
+ class: c(["flex w-full items-center justify-between", (h = t.ui) == null ? void 0 : h.root])
168
+ }, [
169
+ u("div", {
170
+ class: c(["flex flex-col gap-1", (B = t.ui) == null ? void 0 : B.info])
171
+ }, [
172
+ u("span", {
173
+ class: c(["text-xs mr-4", (k = t.ui) == null ? void 0 : k.total])
174
+ }, [
175
+ r[2] || (r[2] = x("总计 ", -1)),
176
+ u("b", null, S(t.total), 1),
177
+ r[3] || (r[3] = x(" 条", -1))
178
+ ], 2),
179
+ o.$slots.tips ? (m(), d("div", {
180
+ key: 0,
181
+ class: c((C = t.ui) == null ? void 0 : C.tips)
182
+ }, [
183
+ $(o.$slots, "tips")
184
+ ], 2)) : f("", !0)
185
+ ], 2),
186
+ u("div", {
187
+ class: c(["flex items-center gap-2", (I = t.ui) == null ? void 0 : I.controls])
188
+ }, [
189
+ v(b, {
190
+ modelValue: l.value,
191
+ "onUpdate:modelValue": r[0] || (r[0] = (_) => l.value = _),
192
+ items: i.value,
193
+ ui: g.value,
194
+ size: t.size,
195
+ class: c(["w-28 max-[768px]:hidden", (U = t.ui) == null ? void 0 : U.pageSize])
196
+ }, null, 8, ["modelValue", "items", "ui", "size", "class"]),
197
+ v(D, {
198
+ page: n.value,
199
+ "onUpdate:page": r[1] || (r[1] = (_) => n.value = _),
200
+ size: t.size,
201
+ "active-color": "primary",
202
+ "active-variant": "subtle",
203
+ total: t.total,
204
+ "items-per-page": l.value,
205
+ ui: (N = t.ui) == null ? void 0 : N.paginationUi,
206
+ class: c((P = t.ui) == null ? void 0 : P.pagination)
207
+ }, null, 8, ["page", "size", "total", "items-per-page", "ui", "class"])
208
+ ], 2)
209
+ ], 2);
210
+ };
211
+ }
212
+ }), Ce = {
213
+ install(e, a = {}) {
214
+ e.use(M), e.component("SaberBadgeStatus", te), e.component("SaberNoData", le), e.component("SaberConfirmModal", j), e.component("SaberConfirmProvider", H), e.component("SaberInfo", R), e.component("SaberInfoProvider", T), e.component("SaberModalWithMobile", E), e.component("SaberPagination", ce), e.component("SaberStatus", K), e.component("SaberSwitchBar", q), e.component("SaberAppSidebar", Q), e.component("SaberNavigationSearch", X), e.component("SaberAppLayout", J), Y(e, a.forms);
139
215
  }
140
216
  };
141
217
  export {
142
- L as SaberAppLayout,
143
- U as SaberAppSidebar,
144
- T as SaberBadgeStatus,
145
- D as SaberConfirmModal,
146
- M as SaberConfirmProvider,
147
- ve as SaberDictCheckbox,
148
- ke as SaberDictRadio,
149
- Ne as SaberDictSelect,
150
- Me as SaberDistrictSelect,
151
- ue as SaberFilterBar,
152
- Se as SaberFormModal,
153
- w as SaberInfo,
154
- A as SaberInfoProvider,
155
- _e as SaberInput,
156
- pe as SaberInputNumber,
157
- ye as SaberModal,
158
- P as SaberModalWithMobile,
159
- V as SaberNavigationSearch,
160
- J as SaberNoData,
161
- Ae as SaberPopSelect,
162
- Be as SaberRadioGroup,
163
- ge as SaberSelect,
164
- z as SaberStatus,
165
- F as SaberSwitchBar,
166
- xe as SaberTextarea,
167
- be as default,
168
- W as installSaberForms
218
+ J as SaberAppLayout,
219
+ Q as SaberAppSidebar,
220
+ te as SaberBadgeStatus,
221
+ j as SaberConfirmModal,
222
+ H as SaberConfirmProvider,
223
+ We as SaberDictCheckbox,
224
+ He as SaberDictRadio,
225
+ Ee as SaberDictSelect,
226
+ Ge as SaberDistrictSelect,
227
+ Ne as SaberFilterBar,
228
+ Pe as SaberFormModal,
229
+ R as SaberInfo,
230
+ T as SaberInfoProvider,
231
+ we as SaberInput,
232
+ De as SaberInputNumber,
233
+ Fe as SaberModal,
234
+ E as SaberModalWithMobile,
235
+ X as SaberNavigationSearch,
236
+ le as SaberNoData,
237
+ ce as SaberPagination,
238
+ qe as SaberPopSelect,
239
+ Re as SaberRadioGroup,
240
+ Me as SaberSelect,
241
+ K as SaberStatus,
242
+ q as SaberSwitchBar,
243
+ Ve as SaberTextarea,
244
+ Ce as default,
245
+ Y as installSaberForms
169
246
  };