vue-amazing-ui 0.0.6 → 0.0.8

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
@@ -10,11 +10,17 @@ npm install vue-amazing-ui
10
10
  ## 引入并注册插件
11
11
 
12
12
  ```
13
+ // 全部引入
13
14
  import VueAmazingUI from 'vue-amazing-ui'
14
15
  import 'vue-amazing-ui/dist/style.css'
15
16
 
16
17
  app.use(VueAmazingUI)
17
18
 
19
+ // 按需引入
20
+ import Breadcrumb from 'vue-amazing-ui'
21
+ import 'vue-amazing-ui/dist/style.css'
22
+
23
+ app.use(Breadcrumb)
18
24
  ```
19
25
 
20
26
  ## 在项目中使用(示例)
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .m-pagination[data-v-c3c66db5]{margin:16px 0}.hidden[data-v-c3c66db5]{display:none}.left[data-v-c3c66db5]{text-align:left}.center[data-v-c3c66db5]{text-align:center}.right[data-v-c3c66db5]{text-align:right}.m-pagination-wrap[data-v-c3c66db5]{display:inline-block;height:32px;line-height:30px;font-size:14px;color:#000000a6;text-align:center}.m-pagination-wrap .mr8[data-v-c3c66db5]{margin-right:8px}.m-pagination-wrap .u-item[data-v-c3c66db5]{min-width:30px;height:30px;display:inline-block;user-select:none;border:1px solid #d9d9d9;border-radius:4px;cursor:pointer;transition:all .3s}.m-pagination-wrap .u-item[data-v-c3c66db5]:hover{font-weight:500;color:#1890ff;border-color:#1890ff}.m-pagination-wrap .u-item:hover .u-arrow[data-v-c3c66db5]{fill:#1890ff}.m-pagination-wrap .u-item .u-arrow[data-v-c3c66db5]{fill:#000000a6;width:12px;height:12px;transition:all .3s}.m-pagination-wrap .u-item[data-v-c3c66db5]:not(:last-child){margin-right:8px}.m-pagination-wrap .active[data-v-c3c66db5]{font-weight:500;color:#1890ff;border-color:#1890ff}.m-pagination-wrap .active .u-arrow[data-v-c3c66db5]{fill:#1890ff}.m-pagination-wrap .disabled[data-v-c3c66db5]{color:#00000040;background:#fff;border-color:#d9d9d9;cursor:not-allowed}.m-pagination-wrap .disabled[data-v-c3c66db5]:hover{font-weight:400;color:#000000a6;border-color:#d9d9d9}.m-pagination-wrap .disabled:hover .u-arrow[data-v-c3c66db5],.m-pagination-wrap .disabled .u-arrow[data-v-c3c66db5]{fill:#00000040}.m-pagination-wrap .m-arrow[data-v-c3c66db5]{display:inline-block;vertical-align:middle;margin-right:8px;min-width:32px;height:32px;letter-spacing:2px;font-size:12px;color:#00000040;transition:all .3s;cursor:pointer}.m-pagination-wrap .m-arrow .u-ellipsis[data-v-c3c66db5]{transition:all .3s}.m-pagination-wrap .m-arrow .u-icon[data-v-c3c66db5]{fill:#1890ff;width:12px;height:12px}.m-pagination-wrap .u-jump-page[data-v-c3c66db5]{margin-left:8px;line-height:32px;font-size:14px;color:#000000a6}.m-pagination-wrap .u-jump-page input[data-v-c3c66db5]{vertical-align:top;width:26px;height:20px;padding:5px 11px;margin:0 8px;border:1px solid #d9d9d9;border-radius:4px;background:transparent;text-align:left;outline:none;transition:all .3s}.m-pagination-wrap .u-jump-page input[data-v-c3c66db5]:hover{border-color:#1890ff}.m-pagination-wrap .u-jump-page input[data-v-c3c66db5]:focus{border-color:#1890ff;box-shadow:0 0 0 2px #1890ff33}.m-breadcrumb .m-bread[data-v-988f5a63]{display:inline-block;vertical-align:middle}.m-breadcrumb .m-bread .u-route[data-v-988f5a63]{height:22px;font-size:16px;font-weight:400;line-height:22px;color:#333;display:inline-block;vertical-align:middle;max-width:240px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:pointer}.m-breadcrumb .m-bread .u-route[data-v-988f5a63]:hover{color:#1890ff}.m-breadcrumb .m-bread .active[data-v-988f5a63]{color:#1890ff;cursor:default}.m-breadcrumb .m-bread .u-separator[data-v-988f5a63]{display:inline-block;vertical-align:middle;margin:0 6px}.m-breadcrumb .m-bread .u-arrow[data-v-988f5a63]{display:inline-block;vertical-align:middle;margin:0 5px;width:12px;height:12px}.m-breadcrumb .assist[data-v-988f5a63]{height:100%;width:0;display:inline-block;vertical-align:middle}
1
+ .m-pagination[data-v-0b4fe0d6]{margin:16px 0}.hidden[data-v-0b4fe0d6]{display:none}.left[data-v-0b4fe0d6]{text-align:left}.center[data-v-0b4fe0d6]{text-align:center}.right[data-v-0b4fe0d6]{text-align:right}.m-pagination-wrap[data-v-0b4fe0d6]{display:inline-block;height:32px;line-height:30px;font-size:14px;color:#000000a6;text-align:center}.m-pagination-wrap .mr8[data-v-0b4fe0d6]{margin-right:8px}.m-pagination-wrap .u-item[data-v-0b4fe0d6]{min-width:30px;height:30px;display:inline-block;user-select:none;border:1px solid #d9d9d9;border-radius:4px;cursor:pointer;transition:all .3s}.m-pagination-wrap .u-item[data-v-0b4fe0d6]:hover{font-weight:500;color:#1890ff;border-color:#1890ff}.m-pagination-wrap .u-item:hover .u-arrow[data-v-0b4fe0d6]{fill:#1890ff}.m-pagination-wrap .u-item .u-arrow[data-v-0b4fe0d6]{fill:#000000a6;width:12px;height:12px;transition:all .3s}.m-pagination-wrap .u-item[data-v-0b4fe0d6]:not(:last-child){margin-right:8px}.m-pagination-wrap .active[data-v-0b4fe0d6]{font-weight:500;color:#1890ff;border-color:#1890ff}.m-pagination-wrap .active .u-arrow[data-v-0b4fe0d6]{fill:#1890ff}.m-pagination-wrap .disabled[data-v-0b4fe0d6]{color:#00000040;background:#fff;border-color:#d9d9d9;cursor:not-allowed}.m-pagination-wrap .disabled[data-v-0b4fe0d6]:hover{font-weight:400;color:#000000a6;border-color:#d9d9d9}.m-pagination-wrap .disabled:hover .u-arrow[data-v-0b4fe0d6],.m-pagination-wrap .disabled .u-arrow[data-v-0b4fe0d6]{fill:#00000040}.m-pagination-wrap .m-arrow[data-v-0b4fe0d6]{display:inline-block;vertical-align:middle;margin-right:8px;min-width:32px;height:32px;letter-spacing:2px;font-size:12px;color:#00000040;transition:all .3s;cursor:pointer}.m-pagination-wrap .m-arrow .u-ellipsis[data-v-0b4fe0d6]{transition:all .3s}.m-pagination-wrap .m-arrow .u-icon[data-v-0b4fe0d6]{fill:#1890ff;width:12px;height:12px}.m-pagination-wrap .u-jump-page[data-v-0b4fe0d6]{margin-left:8px;line-height:32px;font-size:14px;color:#000000a6}.m-pagination-wrap .u-jump-page input[data-v-0b4fe0d6]{vertical-align:top;width:26px;height:20px;padding:5px 11px;margin:0 8px;border:1px solid #d9d9d9;border-radius:4px;background:transparent;text-align:left;outline:none;transition:all .3s}.m-pagination-wrap .u-jump-page input[data-v-0b4fe0d6]:hover{border-color:#1890ff}.m-pagination-wrap .u-jump-page input[data-v-0b4fe0d6]:focus{border-color:#1890ff;box-shadow:0 0 0 2px #1890ff33}.m-breadcrumb .m-bread[data-v-574bc864]{display:inline-block;vertical-align:middle}.m-breadcrumb .m-bread .u-route[data-v-574bc864]{height:22px;font-size:16px;font-weight:400;line-height:22px;color:#333;display:inline-block;vertical-align:middle;max-width:240px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:pointer}.m-breadcrumb .m-bread .u-route[data-v-574bc864]:hover{color:#1890ff}.m-breadcrumb .m-bread .active[data-v-574bc864]{color:#1890ff;cursor:default}.m-breadcrumb .m-bread .u-separator[data-v-574bc864]{display:inline-block;vertical-align:middle;margin:0 6px}.m-breadcrumb .m-bread .u-arrow[data-v-574bc864]{display:inline-block;vertical-align:middle;margin:0 5px;width:12px;height:12px}.m-breadcrumb .assist[data-v-574bc864]{height:100%;width:0;display:inline-block;vertical-align:middle}.m-countdown[data-v-186d410a]{display:inline-block}.m-countdown .u-title[data-v-186d410a]{margin-bottom:4px;color:#00000073;font-size:14px}.m-countdown .u-time[data-v-186d410a]{color:#000000d9;font-size:24px;line-height:1.5}
@@ -1,170 +1,12 @@
1
- import { openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createCommentVNode, withDirectives, vShow, Fragment, renderList, createTextVNode, vModelText, pushScopeId, popScopeId, normalizeStyle } from "vue";
2
- const Pagination_vue_vue_type_style_index_0_scoped_c3c66db5_lang = "";
3
- const _export_sfc = (sfc, props) => {
4
- const target = sfc.__vccOpts || sfc;
5
- for (const [key, val] of props) {
6
- target[key] = val;
7
- }
8
- return target;
9
- };
10
- const _sfc_main$1 = {
11
- name: "Pagination",
12
- props: {
13
- current: {
14
- // 当前页数
15
- type: Number,
16
- default: 1
17
- },
18
- pageSize: {
19
- // 每页条数
20
- type: Number,
21
- default: 10
22
- },
23
- total: {
24
- // 数据总数
25
- type: Number,
26
- default: 0
27
- },
28
- pageListNum: {
29
- // 显示的页码数组长度
30
- type: Number,
31
- default: 5
32
- },
33
- hideOnSinglePage: {
34
- // 只有一页时是否隐藏分页器
35
- type: Boolean,
36
- default: false
37
- },
38
- showQuickJumper: {
39
- // 是否可以快速跳转至某页
40
- type: Boolean,
41
- default: false
42
- },
43
- showTotal: {
44
- // 是否显示当前页数和数据总量
45
- type: Boolean,
46
- default: false
47
- },
48
- placement: {
49
- // 分页器展示位置,靠左,居中,靠右
50
- type: String,
51
- default: "right"
52
- }
53
- },
54
- data() {
55
- return {
56
- currentPage: this.current,
57
- // 当前页数
58
- jumpNumber: "",
59
- // 跳转的页码
60
- forwardMore: false,
61
- // 左省略号展示
62
- backwardMore: false,
63
- // 右省略号展示
64
- forwardArrow: false,
65
- // 左箭头展示
66
- backwardArrow: false
67
- // 右箭头展示
68
- };
69
- },
70
- computed: {
71
- totalPage() {
72
- return Math.ceil(this.total / this.pageSize);
73
- },
74
- pageList() {
75
- return this.dealPageList(this.currentPage).filter((n) => n !== 1 && n !== this.totalPage);
76
- }
77
- },
78
- watch: {
79
- current(to) {
80
- this.currentPage = to;
81
- },
82
- currentPage(to) {
83
- this.loading = true;
84
- console.log("change:", to);
85
- this.$emit("change", {
86
- page: to,
87
- pageSize: this.pageSize
88
- });
89
- }
90
- },
91
- created() {
92
- document.onkeydown = (e) => {
93
- const ev = e || window.event;
94
- if (ev && ev.keyCode === 13 && this.jumpNumber) {
95
- this.jumpPage(this.jumpNumber);
96
- }
97
- };
98
- },
99
- methods: {
100
- dealPageList(curPage) {
101
- var resList = [];
102
- var offset = Math.floor(this.pageListNum / 2);
103
- var pager = {
104
- start: curPage - offset,
105
- end: curPage + offset
106
- };
107
- if (pager.start < 1) {
108
- pager.end = pager.end + (1 - pager.start);
109
- pager.start = 1;
110
- }
111
- if (pager.end > this.totalPage) {
112
- pager.start = pager.start - (pager.end - this.totalPage);
113
- pager.end = this.totalPage;
114
- }
115
- if (pager.start < 1) {
116
- pager.start = 1;
117
- }
118
- if (pager.start > 1) {
119
- this.forwardMore = true;
120
- } else {
121
- this.forwardMore = false;
122
- }
123
- if (pager.end < this.totalPage) {
124
- this.backwardMore = true;
125
- } else {
126
- this.backwardMore = false;
127
- }
128
- for (let i = pager.start; i <= pager.end; i++) {
129
- resList.push(i);
130
- }
131
- return resList;
132
- },
133
- onForward() {
134
- this.currentPage = this.currentPage - this.pageListNum > 0 ? this.currentPage - this.pageListNum : 1;
135
- },
136
- onBackward() {
137
- this.currentPage = this.currentPage + this.pageListNum < this.totalPage ? this.currentPage + this.pageListNum : this.totalPage;
138
- },
139
- jumpPage(jumpNum) {
140
- if (Number(jumpNum)) {
141
- if (Number(jumpNum) < 1) {
142
- jumpNum = 1;
143
- }
144
- if (Number(jumpNum) > this.totalPage) {
145
- jumpNum = this.totalPage;
146
- }
147
- this.changePage(Number(jumpNum));
148
- }
149
- this.jumpNumber = "";
150
- },
151
- changePage(pageNum) {
152
- if (pageNum === 0 || pageNum === this.totalPage + 1) {
153
- return false;
154
- }
155
- if (this.currentPage !== pageNum) {
156
- this.currentPage = pageNum;
157
- }
158
- }
159
- }
160
- };
161
- const _withScopeId$1 = (n) => (pushScopeId("data-v-c3c66db5"), n = n(), popScopeId(), n);
162
- const _hoisted_1$1 = { class: "m-pagination-wrap" };
163
- const _hoisted_2$1 = {
1
+ import { defineComponent, ref, computed, watch, onMounted, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, unref, createCommentVNode, withDirectives, vShow, Fragment, renderList, createTextVNode, vModelText, pushScopeId, popScopeId, normalizeStyle, renderSlot } from "vue";
2
+ import { useRouter } from "vue-router";
3
+ const _withScopeId$1 = (n) => (pushScopeId("data-v-0b4fe0d6"), n = n(), popScopeId(), n);
4
+ const _hoisted_1$2 = { class: "m-pagination-wrap" };
5
+ const _hoisted_2$2 = {
164
6
  key: 0,
165
7
  class: "mr8"
166
8
  };
167
- const _hoisted_3$1 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("svg", {
9
+ const _hoisted_3$2 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("svg", {
168
10
  class: "u-arrow",
169
11
  viewBox: "64 64 896 896",
170
12
  "data-icon": "left",
@@ -173,8 +15,8 @@ const _hoisted_3$1 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ create
173
15
  }, [
174
16
  /* @__PURE__ */ createElementVNode("path", { d: "M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z" })
175
17
  ], -1));
176
- const _hoisted_4$1 = [
177
- _hoisted_3$1
18
+ const _hoisted_4$2 = [
19
+ _hoisted_3$2
178
20
  ];
179
21
  const _hoisted_5$1 = { class: "u-ellipsis" };
180
22
  const _hoisted_6$1 = {
@@ -217,127 +59,204 @@ const _hoisted_16 = {
217
59
  key: 1,
218
60
  class: "u-jump-page"
219
61
  };
220
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
221
- return openBlock(), createElementBlock("div", {
222
- class: normalizeClass([`m-pagination ${$props.placement}`, { hidden: $props.hideOnSinglePage && $props.total <= $props.pageSize }])
223
- }, [
224
- createElementVNode("div", _hoisted_1$1, [
225
- $props.showTotal ? (openBlock(), createElementBlock("span", _hoisted_2$1, "共 " + toDisplayString($options.totalPage) + " 页 / " + toDisplayString($props.total) + " 条", 1)) : createCommentVNode("", true),
226
- createElementVNode("span", {
227
- class: normalizeClass(["u-item", { disabled: $data.currentPage === 1 }]),
228
- onClick: _cache[0] || (_cache[0] = ($event) => $options.changePage($data.currentPage - 1))
229
- }, _hoisted_4$1, 2),
230
- createElementVNode("span", {
231
- class: normalizeClass(["u-item", { active: $data.currentPage === 1 }]),
232
- onClick: _cache[1] || (_cache[1] = ($event) => $options.changePage(1))
233
- }, "1", 2),
234
- withDirectives(createElementVNode("span", {
235
- class: "m-arrow",
236
- ref: "forward",
237
- onClick: _cache[2] || (_cache[2] = (...args) => $options.onForward && $options.onForward(...args)),
238
- onMouseenter: _cache[3] || (_cache[3] = ($event) => $data.forwardArrow = true),
239
- onMouseleave: _cache[4] || (_cache[4] = ($event) => $data.forwardArrow = false)
240
- }, [
241
- withDirectives(createElementVNode("span", _hoisted_5$1, "•••", 512), [
242
- [vShow, !$data.forwardArrow]
243
- ]),
244
- withDirectives((openBlock(), createElementBlock("svg", _hoisted_6$1, _hoisted_8, 512)), [
245
- [vShow, $data.forwardArrow]
246
- ])
247
- ], 544), [
248
- [vShow, $data.forwardMore && $options.pageList[0] - 1 > 1]
249
- ]),
250
- (openBlock(true), createElementBlock(Fragment, null, renderList($options.pageList, (page, index) => {
251
- return openBlock(), createElementBlock("span", {
252
- class: normalizeClass(["u-item", { active: $data.currentPage === page }]),
253
- key: index,
254
- onClick: ($event) => $options.changePage(page)
255
- }, toDisplayString(page), 11, _hoisted_9);
256
- }), 128)),
257
- withDirectives(createElementVNode("span", {
258
- class: "m-arrow",
259
- ref: "backward",
260
- onClick: _cache[5] || (_cache[5] = (...args) => $options.onBackward && $options.onBackward(...args)),
261
- onMouseenter: _cache[6] || (_cache[6] = ($event) => $data.backwardArrow = true),
262
- onMouseleave: _cache[7] || (_cache[7] = ($event) => $data.backwardArrow = false)
263
- }, [
264
- withDirectives(createElementVNode("span", _hoisted_10, "•••", 512), [
265
- [vShow, !$data.backwardArrow]
266
- ]),
267
- withDirectives((openBlock(), createElementBlock("svg", _hoisted_11, _hoisted_13, 512)), [
268
- [vShow, $data.backwardArrow]
269
- ])
270
- ], 544), [
271
- [vShow, $data.backwardMore && $options.pageList[$options.pageList.length - 1] + 1 < $options.totalPage]
272
- ]),
273
- withDirectives(createElementVNode("span", {
274
- class: normalizeClass(["u-item", { active: $data.currentPage === $options.totalPage }]),
275
- onClick: _cache[8] || (_cache[8] = ($event) => $options.changePage($options.totalPage))
276
- }, toDisplayString($options.totalPage), 3), [
277
- [vShow, $options.totalPage !== 1]
278
- ]),
279
- createElementVNode("span", {
280
- class: normalizeClass(["u-item", { disabled: $data.currentPage === $options.totalPage }]),
281
- onClick: _cache[9] || (_cache[9] = ($event) => $options.changePage($data.currentPage + 1))
282
- }, _hoisted_15, 2),
283
- $props.showQuickJumper ? (openBlock(), createElementBlock("span", _hoisted_16, [
284
- createTextVNode("跳至"),
285
- withDirectives(createElementVNode("input", {
286
- type: "text",
287
- "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => $data.jumpNumber = $event)
288
- }, null, 512), [
289
- [vModelText, $data.jumpNumber]
290
- ]),
291
- createTextVNode("页")
292
- ])) : createCommentVNode("", true)
293
- ])
294
- ], 2);
295
- }
296
- const Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-c3c66db5"]]);
297
- Pagination.install = (app) => {
298
- app.component(Pagination.name, Pagination);
299
- };
300
- const Breadcrumb_vue_vue_type_style_index_0_scoped_988f5a63_lang = "";
301
- const _sfc_main = {
302
- name: "Breadcrumb",
62
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
63
+ __name: "Pagination",
303
64
  props: {
304
- routes: {
305
- // router的路由数组
306
- type: Array,
307
- required: true,
308
- default: () => {
309
- return [];
65
+ current: { default: 1 },
66
+ pageSize: { default: 10 },
67
+ total: { default: 0 },
68
+ pageListNum: { default: 5 },
69
+ hideOnSinglePage: { type: Boolean, default: false },
70
+ showQuickJumper: { type: Boolean, default: false },
71
+ showTotal: { type: Boolean, default: false },
72
+ placement: { default: "right" }
73
+ },
74
+ emits: ["change"],
75
+ setup(__props, { emit }) {
76
+ const props = __props;
77
+ const currentPage = ref(props.current);
78
+ const jumpNumber = ref("");
79
+ const forwardMore = ref(false);
80
+ const backwardMore = ref(false);
81
+ const forwardArrow = ref(false);
82
+ const backwardArrow = ref(false);
83
+ const totalPage = computed(() => {
84
+ return Math.ceil(props.total / props.pageSize);
85
+ });
86
+ const pageList = computed(() => {
87
+ return dealPageList(currentPage.value).filter((n) => n !== 1 && n !== totalPage.value);
88
+ });
89
+ watch(currentPage, (to) => {
90
+ console.log("change:", to);
91
+ emit("change", {
92
+ page: to,
93
+ pageSize: props.pageSize
94
+ });
95
+ });
96
+ onMounted(() => {
97
+ document.onkeydown = (e) => {
98
+ const ev = e || window.event;
99
+ if (ev && ev.keyCode === 13 && jumpNumber.value) {
100
+ jumpPage(jumpNumber.value);
101
+ }
102
+ };
103
+ });
104
+ function dealPageList(curPage) {
105
+ var resList = [];
106
+ var offset = Math.floor(props.pageListNum / 2);
107
+ var pager = {
108
+ start: curPage - offset,
109
+ end: curPage + offset
110
+ };
111
+ if (pager.start < 1) {
112
+ pager.end = pager.end + (1 - pager.start);
113
+ pager.start = 1;
114
+ }
115
+ if (pager.end > totalPage.value) {
116
+ pager.start = pager.start - (pager.end - totalPage.value);
117
+ pager.end = totalPage.value;
118
+ }
119
+ if (pager.start < 1) {
120
+ pager.start = 1;
121
+ }
122
+ if (pager.start > 1) {
123
+ forwardMore.value = true;
124
+ } else {
125
+ forwardMore.value = false;
126
+ }
127
+ if (pager.end < totalPage.value) {
128
+ backwardMore.value = true;
129
+ } else {
130
+ backwardMore.value = false;
131
+ }
132
+ for (let i = pager.start; i <= pager.end; i++) {
133
+ resList.push(i);
310
134
  }
311
- },
312
- height: {
313
- // 面包屑高度
314
- type: Number,
315
- default: 60
316
- },
317
- separator: {
318
- // 自定义分隔符
319
- type: String,
320
- default: ""
135
+ return resList;
321
136
  }
322
- },
323
- computed: {
324
- len() {
325
- return this.routes.length;
137
+ function onForward() {
138
+ currentPage.value = currentPage.value - props.pageListNum > 0 ? currentPage.value - props.pageListNum : 1;
326
139
  }
327
- },
328
- methods: {
329
- goRouter(route) {
330
- this.$router.push({ path: route.path, query: route.query || {} });
140
+ function onBackward() {
141
+ currentPage.value = currentPage.value + props.pageListNum < totalPage.value ? currentPage.value + props.pageListNum : totalPage.value;
142
+ }
143
+ function jumpPage(jumpNum) {
144
+ if (Number(jumpNum)) {
145
+ if (Number(jumpNum) < 1) {
146
+ jumpNum = 1;
147
+ }
148
+ if (Number(jumpNum) > totalPage.value) {
149
+ jumpNum = totalPage.value;
150
+ }
151
+ changePage(Number(jumpNum));
152
+ }
153
+ jumpNumber.value = "";
154
+ }
155
+ function changePage(pageNum) {
156
+ if (pageNum === 0 || pageNum === totalPage.value + 1) {
157
+ return false;
158
+ }
159
+ if (currentPage.value !== pageNum) {
160
+ currentPage.value = pageNum;
161
+ }
331
162
  }
163
+ return (_ctx, _cache) => {
164
+ return openBlock(), createElementBlock("div", {
165
+ class: normalizeClass([`m-pagination ${__props.placement}`, { hidden: __props.hideOnSinglePage && __props.total <= __props.pageSize }])
166
+ }, [
167
+ createElementVNode("div", _hoisted_1$2, [
168
+ __props.showTotal ? (openBlock(), createElementBlock("span", _hoisted_2$2, "共 " + toDisplayString(unref(totalPage)) + " 页 / " + toDisplayString(__props.total) + " 条", 1)) : createCommentVNode("", true),
169
+ createElementVNode("span", {
170
+ class: normalizeClass(["u-item", { disabled: currentPage.value === 1 }]),
171
+ onClick: _cache[0] || (_cache[0] = ($event) => changePage(currentPage.value - 1))
172
+ }, _hoisted_4$2, 2),
173
+ createElementVNode("span", {
174
+ class: normalizeClass(["u-item", { active: currentPage.value === 1 }]),
175
+ onClick: _cache[1] || (_cache[1] = ($event) => changePage(1))
176
+ }, "1", 2),
177
+ withDirectives(createElementVNode("span", {
178
+ class: "m-arrow",
179
+ ref: "forward",
180
+ onClick: onForward,
181
+ onMouseenter: _cache[2] || (_cache[2] = ($event) => forwardArrow.value = true),
182
+ onMouseleave: _cache[3] || (_cache[3] = ($event) => forwardArrow.value = false)
183
+ }, [
184
+ withDirectives(createElementVNode("span", _hoisted_5$1, "•••", 512), [
185
+ [vShow, !forwardArrow.value]
186
+ ]),
187
+ withDirectives((openBlock(), createElementBlock("svg", _hoisted_6$1, _hoisted_8, 512)), [
188
+ [vShow, forwardArrow.value]
189
+ ])
190
+ ], 544), [
191
+ [vShow, forwardMore.value && unref(pageList)[0] - 1 > 1]
192
+ ]),
193
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(pageList), (page, index) => {
194
+ return openBlock(), createElementBlock("span", {
195
+ class: normalizeClass(["u-item", { active: currentPage.value === page }]),
196
+ key: index,
197
+ onClick: ($event) => changePage(page)
198
+ }, toDisplayString(page), 11, _hoisted_9);
199
+ }), 128)),
200
+ withDirectives(createElementVNode("span", {
201
+ class: "m-arrow",
202
+ ref: "backward",
203
+ onClick: onBackward,
204
+ onMouseenter: _cache[4] || (_cache[4] = ($event) => backwardArrow.value = true),
205
+ onMouseleave: _cache[5] || (_cache[5] = ($event) => backwardArrow.value = false)
206
+ }, [
207
+ withDirectives(createElementVNode("span", _hoisted_10, "•••", 512), [
208
+ [vShow, !backwardArrow.value]
209
+ ]),
210
+ withDirectives((openBlock(), createElementBlock("svg", _hoisted_11, _hoisted_13, 512)), [
211
+ [vShow, backwardArrow.value]
212
+ ])
213
+ ], 544), [
214
+ [vShow, backwardMore.value && unref(pageList)[unref(pageList).length - 1] + 1 < unref(totalPage)]
215
+ ]),
216
+ withDirectives(createElementVNode("span", {
217
+ class: normalizeClass(["u-item", { active: currentPage.value === unref(totalPage) }]),
218
+ onClick: _cache[6] || (_cache[6] = ($event) => changePage(unref(totalPage)))
219
+ }, toDisplayString(unref(totalPage)), 3), [
220
+ [vShow, unref(totalPage) !== 1]
221
+ ]),
222
+ createElementVNode("span", {
223
+ class: normalizeClass(["u-item", { disabled: currentPage.value === unref(totalPage) }]),
224
+ onClick: _cache[7] || (_cache[7] = ($event) => changePage(currentPage.value + 1))
225
+ }, _hoisted_15, 2),
226
+ __props.showQuickJumper ? (openBlock(), createElementBlock("span", _hoisted_16, [
227
+ createTextVNode("跳至"),
228
+ withDirectives(createElementVNode("input", {
229
+ type: "text",
230
+ "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => jumpNumber.value = $event)
231
+ }, null, 512), [
232
+ [vModelText, jumpNumber.value]
233
+ ]),
234
+ createTextVNode("页")
235
+ ])) : createCommentVNode("", true)
236
+ ])
237
+ ], 2);
238
+ };
332
239
  }
240
+ });
241
+ const Pagination_vue_vue_type_style_index_0_scoped_0b4fe0d6_lang = "";
242
+ const _export_sfc = (sfc, props) => {
243
+ const target = sfc.__vccOpts || sfc;
244
+ for (const [key, val] of props) {
245
+ target[key] = val;
246
+ }
247
+ return target;
248
+ };
249
+ const Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-0b4fe0d6"]]);
250
+ Pagination.install = (app) => {
251
+ app.component(Pagination.__name, Pagination);
333
252
  };
334
- const _withScopeId = (n) => (pushScopeId("data-v-988f5a63"), n = n(), popScopeId(), n);
335
- const _hoisted_1 = ["onClick", "title"];
336
- const _hoisted_2 = {
253
+ const _withScopeId = (n) => (pushScopeId("data-v-574bc864"), n = n(), popScopeId(), n);
254
+ const _hoisted_1$1 = ["onClick", "title"];
255
+ const _hoisted_2$1 = {
337
256
  key: 0,
338
257
  class: "u-separator"
339
258
  };
340
- const _hoisted_3 = {
259
+ const _hoisted_3$1 = {
341
260
  key: 1,
342
261
  class: "u-arrow",
343
262
  viewBox: "64 64 896 896",
@@ -345,48 +264,165 @@ const _hoisted_3 = {
345
264
  "aria-hidden": "true",
346
265
  focusable: "false"
347
266
  };
348
- const _hoisted_4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("path", { d: "M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z" }, null, -1));
267
+ const _hoisted_4$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("path", { d: "M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z" }, null, -1));
349
268
  const _hoisted_5 = [
350
- _hoisted_4
269
+ _hoisted_4$1
351
270
  ];
352
271
  const _hoisted_6 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "assist" }, null, -1));
353
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
354
- return openBlock(), createElementBlock("div", {
355
- class: "m-breadcrumb",
356
- style: normalizeStyle(`height: ${$props.height}px;`)
357
- }, [
358
- (openBlock(true), createElementBlock(Fragment, null, renderList($props.routes, (route, index) => {
272
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
273
+ __name: "Breadcrumb",
274
+ props: {
275
+ routes: { default: () => [] },
276
+ height: { default: 60 },
277
+ separator: { default: "" }
278
+ },
279
+ setup(__props) {
280
+ const props = __props;
281
+ const len = computed(() => {
282
+ return props.routes.length;
283
+ });
284
+ const router = useRouter();
285
+ function goRouter(route) {
286
+ router.push({ path: route.path, query: route.query || {} });
287
+ }
288
+ return (_ctx, _cache) => {
359
289
  return openBlock(), createElementBlock("div", {
360
- class: "m-bread",
361
- key: index
290
+ class: "m-breadcrumb",
291
+ style: normalizeStyle(`height: ${__props.height}px;`)
362
292
  }, [
363
- createElementVNode("a", {
364
- class: normalizeClass(["u-route", { active: index === $options.len - 1 }]),
365
- onClick: ($event) => index === $options.len - 1 ? (e) => e.preventDefault() : $options.goRouter(route),
366
- title: route.name
367
- }, toDisplayString(route.name || "--"), 11, _hoisted_1),
368
- index !== $options.len - 1 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
369
- $props.separator ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString($props.separator), 1)) : (openBlock(), createElementBlock("svg", _hoisted_3, _hoisted_5))
370
- ], 64)) : createCommentVNode("", true)
371
- ]);
372
- }), 128)),
373
- _hoisted_6
374
- ], 4);
375
- }
376
- const Breadcrumb = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-988f5a63"]]);
293
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.routes, (route, index) => {
294
+ return openBlock(), createElementBlock("div", {
295
+ class: "m-bread",
296
+ key: index
297
+ }, [
298
+ createElementVNode("a", {
299
+ class: normalizeClass(["u-route", { active: index === unref(len) - 1 }]),
300
+ onClick: ($event) => index === unref(len) - 1 ? (e) => e.preventDefault() : goRouter(route),
301
+ title: route.name
302
+ }, toDisplayString(route.name || "--"), 11, _hoisted_1$1),
303
+ index !== unref(len) - 1 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
304
+ __props.separator ? (openBlock(), createElementBlock("span", _hoisted_2$1, toDisplayString(__props.separator), 1)) : (openBlock(), createElementBlock("svg", _hoisted_3$1, _hoisted_5))
305
+ ], 64)) : createCommentVNode("", true)
306
+ ]);
307
+ }), 128)),
308
+ _hoisted_6
309
+ ], 4);
310
+ };
311
+ }
312
+ });
313
+ const Breadcrumb_vue_vue_type_style_index_0_scoped_574bc864_lang = "";
314
+ const Breadcrumb = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-574bc864"]]);
377
315
  Breadcrumb.install = (app) => {
378
- app.component(Breadcrumb.name, Breadcrumb);
316
+ app.component(Breadcrumb.__name, Breadcrumb);
317
+ };
318
+ const _hoisted_1 = { class: "m-countdown" };
319
+ const _hoisted_2 = { class: "u-title" };
320
+ const _hoisted_3 = { class: "u-time" };
321
+ const _hoisted_4 = { key: 2 };
322
+ const _sfc_main = /* @__PURE__ */ defineComponent({
323
+ __name: "Countdown",
324
+ props: {
325
+ countdown: { default: 0 },
326
+ title: { default: "Countdown" },
327
+ format: { default: "HH:mm:ss" },
328
+ prefix: { default: "" },
329
+ suffix: { default: "" },
330
+ finishedText: { default: "" }
331
+ },
332
+ emits: ["finish"],
333
+ setup(__props, { emit }) {
334
+ const props = __props;
335
+ const restTime = ref(props.countdown);
336
+ function fixedTwo(value) {
337
+ return value < 10 ? "0" + value : String(value);
338
+ }
339
+ function timeFormat(time) {
340
+ let showTime2 = props.format;
341
+ if (showTime2.includes("s")) {
342
+ var s = time;
343
+ } else {
344
+ var s = 0;
345
+ }
346
+ if (showTime2.includes("m")) {
347
+ s = s % 60;
348
+ var m = Math.floor((time - s) / 60);
349
+ } else {
350
+ var m = 0;
351
+ }
352
+ if (showTime2.includes("H")) {
353
+ m = m % 60;
354
+ var h = Math.floor((time - s - m * 60) / 60 / 60);
355
+ } else {
356
+ var h = 0;
357
+ }
358
+ if (showTime2.includes("D")) {
359
+ h = h % 24;
360
+ var d = Math.floor((time - s - m * 60 - h * 60 * 60) / 60 / 60 / 24);
361
+ } else {
362
+ var d = 0;
363
+ }
364
+ showTime2 = showTime2.includes("ss") ? showTime2.replace("ss", fixedTwo(s)) : showTime2.replace("s", String(s));
365
+ showTime2 = showTime2.includes("mm") ? showTime2.replace("mm", fixedTwo(m)) : showTime2.replace("m", String(m));
366
+ showTime2 = showTime2.includes("HH") ? showTime2.replace("HH", fixedTwo(h)) : showTime2.replace("H", String(h));
367
+ showTime2 = showTime2.includes("DD") ? showTime2.replace("DD", fixedTwo(d)) : showTime2.replace("D", String(d));
368
+ return showTime2;
369
+ }
370
+ const showTime = computed(() => {
371
+ return timeFormat(restTime.value);
372
+ });
373
+ function CountDown(restTime2) {
374
+ setTimeout(() => {
375
+ restTime2.value--;
376
+ if (restTime2.value > 0) {
377
+ CountDown(restTime2);
378
+ } else {
379
+ emit("finish");
380
+ }
381
+ }, 1e3);
382
+ }
383
+ onMounted(() => {
384
+ CountDown(restTime);
385
+ });
386
+ return (_ctx, _cache) => {
387
+ return openBlock(), createElementBlock("div", _hoisted_1, [
388
+ renderSlot(_ctx.$slots, "title", {}, () => [
389
+ createElementVNode("p", _hoisted_2, toDisplayString(props.title), 1)
390
+ ], true),
391
+ createElementVNode("div", _hoisted_3, [
392
+ restTime.value > 0 ? renderSlot(_ctx.$slots, "prefix", { key: 0 }, () => [
393
+ createTextVNode(toDisplayString(__props.prefix), 1)
394
+ ], true) : createCommentVNode("", true),
395
+ __props.finishedText && restTime.value === 0 ? renderSlot(_ctx.$slots, "finish", { key: 1 }, () => [
396
+ createTextVNode(toDisplayString(__props.finishedText), 1)
397
+ ], true) : (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(unref(showTime)), 1)),
398
+ restTime.value > 0 ? renderSlot(_ctx.$slots, "suffix", { key: 3 }, () => [
399
+ createTextVNode(toDisplayString(__props.suffix), 1)
400
+ ], true) : createCommentVNode("", true)
401
+ ])
402
+ ]);
403
+ };
404
+ }
405
+ });
406
+ const Countdown_vue_vue_type_style_index_0_scoped_186d410a_lang = "";
407
+ const Countdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-186d410a"]]);
408
+ Countdown.install = (app) => {
409
+ app.component(Countdown.__name, Countdown);
379
410
  };
380
411
  const components = [
381
412
  Pagination,
382
- Breadcrumb
413
+ Breadcrumb,
414
+ Countdown
383
415
  ];
416
+ console.log("components:", components);
384
417
  const install = (app) => {
385
- components.forEach((component) => app.component(component.name, component));
418
+ components.forEach((component) => app.component(component.__name, component));
386
419
  };
387
420
  const VueAmazingUI = {
388
421
  install
389
422
  };
390
423
  export {
424
+ Breadcrumb,
425
+ Countdown,
426
+ Pagination,
391
427
  VueAmazingUI as default
392
428
  };
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VueAmazingUI={},e.Vue)}(this,(function(e,t){"use strict";const a=(e,t)=>{const a=e.__vccOpts||e;for(const[r,o]of t)a[r]=o;return a},r={name:"Pagination",props:{current:{type:Number,default:1},pageSize:{type:Number,default:10},total:{type:Number,default:0},pageListNum:{type:Number,default:5},hideOnSinglePage:{type:Boolean,default:!1},showQuickJumper:{type:Boolean,default:!1},showTotal:{type:Boolean,default:!1},placement:{type:String,default:"right"}},data(){return{currentPage:this.current,jumpNumber:"",forwardMore:!1,backwardMore:!1,forwardArrow:!1,backwardArrow:!1}},computed:{totalPage(){return Math.ceil(this.total/this.pageSize)},pageList(){return this.dealPageList(this.currentPage).filter((e=>1!==e&&e!==this.totalPage))}},watch:{current(e){this.currentPage=e},currentPage(e){this.loading=!0,this.$emit("change",{page:e,pageSize:this.pageSize})}},created(){document.onkeydown=e=>{const t=e||window.event;t&&13===t.keyCode&&this.jumpNumber&&this.jumpPage(this.jumpNumber)}},methods:{dealPageList(e){var t=[],a=Math.floor(this.pageListNum/2),r={start:e-a,end:e+a};r.start<1&&(r.end=r.end+(1-r.start),r.start=1),r.end>this.totalPage&&(r.start=r.start-(r.end-this.totalPage),r.end=this.totalPage),r.start<1&&(r.start=1),r.start>1?this.forwardMore=!0:this.forwardMore=!1,r.end<this.totalPage?this.backwardMore=!0:this.backwardMore=!1;for(let o=r.start;o<=r.end;o++)t.push(o);return t},onForward(){this.currentPage=this.currentPage-this.pageListNum>0?this.currentPage-this.pageListNum:1},onBackward(){this.currentPage=this.currentPage+this.pageListNum<this.totalPage?this.currentPage+this.pageListNum:this.totalPage},jumpPage(e){Number(e)&&(Number(e)<1&&(e=1),Number(e)>this.totalPage&&(e=this.totalPage),this.changePage(Number(e))),this.jumpNumber=""},changePage(e){if(0===e||e===this.totalPage+1)return!1;this.currentPage!==e&&(this.currentPage=e)}}},o=e=>(t.pushScopeId("data-v-c3c66db5"),e=e(),t.popScopeId(),e),n={class:"m-pagination-wrap"},l={key:0,class:"mr8"},c=[o((()=>t.createElementVNode("svg",{class:"u-arrow",viewBox:"64 64 896 896","data-icon":"left","aria-hidden":"true",focusable:"false"},[t.createElementVNode("path",{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"})],-1)))],s={class:"u-ellipsis"},i={class:"u-icon",viewBox:"64 64 896 896","data-icon":"double-left","aria-hidden":"true",focusable:"false"},u=[o((()=>t.createElementVNode("path",{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 0 0 0 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 0 0 0 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"},null,-1)))],d=["onClick"],p={class:"u-ellipsis"},m={class:"u-icon",viewBox:"64 64 896 896","data-icon":"double-right","aria-hidden":"true",focusable:"false"},g=[o((()=>t.createElementVNode("path",{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 0 0 188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 0 0 492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"},null,-1)))],h=[o((()=>t.createElementVNode("svg",{class:"u-arrow",viewBox:"64 64 896 896","data-icon":"right","aria-hidden":"true",focusable:"false"},[t.createElementVNode("path",{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z"})],-1)))],w={key:1,class:"u-jump-page"};const f=a(r,[["render",function(e,a,r,o,f,k){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([`m-pagination ${r.placement}`,{hidden:r.hideOnSinglePage&&r.total<=r.pageSize}])},[t.createElementVNode("div",n,[r.showTotal?(t.openBlock(),t.createElementBlock("span",l,"共 "+t.toDisplayString(k.totalPage)+" 页 / "+t.toDisplayString(r.total)+" 条",1)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass(["u-item",{disabled:1===f.currentPage}]),onClick:a[0]||(a[0]=e=>k.changePage(f.currentPage-1))},c,2),t.createElementVNode("span",{class:t.normalizeClass(["u-item",{active:1===f.currentPage}]),onClick:a[1]||(a[1]=e=>k.changePage(1))},"1",2),t.withDirectives(t.createElementVNode("span",{class:"m-arrow",ref:"forward",onClick:a[2]||(a[2]=(...e)=>k.onForward&&k.onForward(...e)),onMouseenter:a[3]||(a[3]=e=>f.forwardArrow=!0),onMouseleave:a[4]||(a[4]=e=>f.forwardArrow=!1)},[t.withDirectives(t.createElementVNode("span",s,"•••",512),[[t.vShow,!f.forwardArrow]]),t.withDirectives((t.openBlock(),t.createElementBlock("svg",i,u,512)),[[t.vShow,f.forwardArrow]])],544),[[t.vShow,f.forwardMore&&k.pageList[0]-1>1]]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(k.pageList,((e,a)=>(t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(["u-item",{active:f.currentPage===e}]),key:a,onClick:t=>k.changePage(e)},t.toDisplayString(e),11,d)))),128)),t.withDirectives(t.createElementVNode("span",{class:"m-arrow",ref:"backward",onClick:a[5]||(a[5]=(...e)=>k.onBackward&&k.onBackward(...e)),onMouseenter:a[6]||(a[6]=e=>f.backwardArrow=!0),onMouseleave:a[7]||(a[7]=e=>f.backwardArrow=!1)},[t.withDirectives(t.createElementVNode("span",p,"•••",512),[[t.vShow,!f.backwardArrow]]),t.withDirectives((t.openBlock(),t.createElementBlock("svg",m,g,512)),[[t.vShow,f.backwardArrow]])],544),[[t.vShow,f.backwardMore&&k.pageList[k.pageList.length-1]+1<k.totalPage]]),t.withDirectives(t.createElementVNode("span",{class:t.normalizeClass(["u-item",{active:f.currentPage===k.totalPage}]),onClick:a[8]||(a[8]=e=>k.changePage(k.totalPage))},t.toDisplayString(k.totalPage),3),[[t.vShow,1!==k.totalPage]]),t.createElementVNode("span",{class:t.normalizeClass(["u-item",{disabled:f.currentPage===k.totalPage}]),onClick:a[9]||(a[9]=e=>k.changePage(f.currentPage+1))},h,2),r.showQuickJumper?(t.openBlock(),t.createElementBlock("span",w,[t.createTextVNode("跳至"),t.withDirectives(t.createElementVNode("input",{type:"text","onUpdate:modelValue":a[10]||(a[10]=e=>f.jumpNumber=e)},null,512),[[t.vModelText,f.jumpNumber]]),t.createTextVNode("页")])):t.createCommentVNode("",!0)])],2)}],["__scopeId","data-v-c3c66db5"]]);f.install=e=>{e.component(f.name,f)};const k={name:"Breadcrumb",props:{routes:{type:Array,required:!0,default:()=>[]},height:{type:Number,default:60},separator:{type:String,default:""}},computed:{len(){return this.routes.length}},methods:{goRouter(e){this.$router.push({path:e.path,query:e.query||{}})}}},v=e=>(t.pushScopeId("data-v-988f5a63"),e=e(),t.popScopeId(),e),P=["onClick","title"],b={key:0,class:"u-separator"},N={key:1,class:"u-arrow",viewBox:"64 64 896 896","data-icon":"right","aria-hidden":"true",focusable:"false"},B=[v((()=>t.createElementVNode("path",{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z"},null,-1)))],y=v((()=>t.createElementVNode("div",{class:"assist"},null,-1)));const E=a(k,[["render",function(e,a,r,o,n,l){return t.openBlock(),t.createElementBlock("div",{class:"m-breadcrumb",style:t.normalizeStyle(`height: ${r.height}px;`)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.routes,((e,a)=>(t.openBlock(),t.createElementBlock("div",{class:"m-bread",key:a},[t.createElementVNode("a",{class:t.normalizeClass(["u-route",{active:a===l.len-1}]),onClick:t=>a===l.len-1?e=>e.preventDefault():l.goRouter(e),title:e.name},t.toDisplayString(e.name||"--"),11,P),a!==l.len-1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[r.separator?(t.openBlock(),t.createElementBlock("span",b,t.toDisplayString(r.separator),1)):(t.openBlock(),t.createElementBlock("svg",N,B))],64)):t.createCommentVNode("",!0)])))),128)),y],4)}],["__scopeId","data-v-988f5a63"]]);E.install=e=>{e.component(E.name,E)};const V=[f,E],S={install:e=>{V.forEach((t=>e.component(t.name,t)))}};e.default=S,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("vue-router")):"function"==typeof define&&define.amd?define(["exports","vue","vue-router"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VueAmazingUI={},e.Vue,e.VueRouter)}(this,(function(e,t,a){"use strict";const l=e=>(t.pushScopeId("data-v-0b4fe0d6"),e=e(),t.popScopeId(),e),n={class:"m-pagination-wrap"},o={key:0,class:"mr8"},r=[l((()=>t.createElementVNode("svg",{class:"u-arrow",viewBox:"64 64 896 896","data-icon":"left","aria-hidden":"true",focusable:"false"},[t.createElementVNode("path",{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"})],-1)))],c={class:"u-ellipsis"},s={class:"u-icon",viewBox:"64 64 896 896","data-icon":"double-left","aria-hidden":"true",focusable:"false"},i=[l((()=>t.createElementVNode("path",{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 0 0 0 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 0 0 0 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"},null,-1)))],u=["onClick"],d={class:"u-ellipsis"},p={class:"u-icon",viewBox:"64 64 896 896","data-icon":"double-right","aria-hidden":"true",focusable:"false"},m=[l((()=>t.createElementVNode("path",{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 0 0 188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 0 0 492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"},null,-1)))],f=[l((()=>t.createElementVNode("svg",{class:"u-arrow",viewBox:"64 64 896 896","data-icon":"right","aria-hidden":"true",focusable:"false"},[t.createElementVNode("path",{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z"})],-1)))],v={key:1,class:"u-jump-page"},h=(e,t)=>{const a=e.__vccOpts||e;for(const[l,n]of t)a[l]=n;return a},g=h(t.defineComponent({__name:"Pagination",props:{current:{default:1},pageSize:{default:10},total:{default:0},pageListNum:{default:5},hideOnSinglePage:{type:Boolean,default:!1},showQuickJumper:{type:Boolean,default:!1},showTotal:{type:Boolean,default:!1},placement:{default:"right"}},emits:["change"],setup(e,{emit:a}){const l=e,h=t.ref(l.current),g=t.ref(""),k=t.ref(!1),w=t.ref(!1),N=t.ref(!1),S=t.ref(!1),B=t.computed((()=>Math.ceil(l.total/l.pageSize))),V=t.computed((()=>function(e){var t=[],a=Math.floor(l.pageListNum/2),n={start:e-a,end:e+a};n.start<1&&(n.end=n.end+(1-n.start),n.start=1);n.end>B.value&&(n.start=n.start-(n.end-B.value),n.end=B.value);n.start<1&&(n.start=1);n.start>1?k.value=!0:k.value=!1;n.end<B.value?w.value=!0:w.value=!1;for(let l=n.start;l<=n.end;l++)t.push(l);return t}(h.value).filter((e=>1!==e&&e!==B.value))));function y(){h.value=h.value-l.pageListNum>0?h.value-l.pageListNum:1}function E(){h.value=h.value+l.pageListNum<B.value?h.value+l.pageListNum:B.value}function C(e){if(0===e||e===B.value+1)return!1;h.value!==e&&(h.value=e)}return t.watch(h,(e=>{a("change",{page:e,pageSize:l.pageSize})})),t.onMounted((()=>{document.onkeydown=e=>{const t=e||window.event;t&&13===t.keyCode&&g.value&&function(e){Number(e)&&(Number(e)<1&&(e=1),Number(e)>B.value&&(e=B.value),C(Number(e)));g.value=""}(g.value)}})),(a,l)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([`m-pagination ${e.placement}`,{hidden:e.hideOnSinglePage&&e.total<=e.pageSize}])},[t.createElementVNode("div",n,[e.showTotal?(t.openBlock(),t.createElementBlock("span",o,"共 "+t.toDisplayString(t.unref(B))+" 页 / "+t.toDisplayString(e.total)+" 条",1)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass(["u-item",{disabled:1===h.value}]),onClick:l[0]||(l[0]=e=>C(h.value-1))},r,2),t.createElementVNode("span",{class:t.normalizeClass(["u-item",{active:1===h.value}]),onClick:l[1]||(l[1]=e=>C(1))},"1",2),t.withDirectives(t.createElementVNode("span",{class:"m-arrow",ref:"forward",onClick:y,onMouseenter:l[2]||(l[2]=e=>N.value=!0),onMouseleave:l[3]||(l[3]=e=>N.value=!1)},[t.withDirectives(t.createElementVNode("span",c,"•••",512),[[t.vShow,!N.value]]),t.withDirectives((t.openBlock(),t.createElementBlock("svg",s,i,512)),[[t.vShow,N.value]])],544),[[t.vShow,k.value&&t.unref(V)[0]-1>1]]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(V),((e,a)=>(t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(["u-item",{active:h.value===e}]),key:a,onClick:t=>C(e)},t.toDisplayString(e),11,u)))),128)),t.withDirectives(t.createElementVNode("span",{class:"m-arrow",ref:"backward",onClick:E,onMouseenter:l[4]||(l[4]=e=>S.value=!0),onMouseleave:l[5]||(l[5]=e=>S.value=!1)},[t.withDirectives(t.createElementVNode("span",d,"•••",512),[[t.vShow,!S.value]]),t.withDirectives((t.openBlock(),t.createElementBlock("svg",p,m,512)),[[t.vShow,S.value]])],544),[[t.vShow,w.value&&t.unref(V)[t.unref(V).length-1]+1<t.unref(B)]]),t.withDirectives(t.createElementVNode("span",{class:t.normalizeClass(["u-item",{active:h.value===t.unref(B)}]),onClick:l[6]||(l[6]=e=>C(t.unref(B)))},t.toDisplayString(t.unref(B)),3),[[t.vShow,1!==t.unref(B)]]),t.createElementVNode("span",{class:t.normalizeClass(["u-item",{disabled:h.value===t.unref(B)}]),onClick:l[7]||(l[7]=e=>C(h.value+1))},f,2),e.showQuickJumper?(t.openBlock(),t.createElementBlock("span",v,[t.createTextVNode("跳至"),t.withDirectives(t.createElementVNode("input",{type:"text","onUpdate:modelValue":l[8]||(l[8]=e=>g.value=e)},null,512),[[t.vModelText,g.value]]),t.createTextVNode("页")])):t.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-0b4fe0d6"]]);g.install=e=>{e.component(g.__name,g)};const k=e=>(t.pushScopeId("data-v-574bc864"),e=e(),t.popScopeId(),e),w=["onClick","title"],N={key:0,class:"u-separator"},S={key:1,class:"u-arrow",viewBox:"64 64 896 896","data-icon":"right","aria-hidden":"true",focusable:"false"},B=[k((()=>t.createElementVNode("path",{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z"},null,-1)))],V=k((()=>t.createElementVNode("div",{class:"assist"},null,-1))),y=h(t.defineComponent({__name:"Breadcrumb",props:{routes:{default:()=>[]},height:{default:60},separator:{default:""}},setup(e){const l=e,n=t.computed((()=>l.routes.length)),o=a.useRouter();return(a,l)=>(t.openBlock(),t.createElementBlock("div",{class:"m-breadcrumb",style:t.normalizeStyle(`height: ${e.height}px;`)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.routes,((a,l)=>(t.openBlock(),t.createElementBlock("div",{class:"m-bread",key:l},[t.createElementVNode("a",{class:t.normalizeClass(["u-route",{active:l===t.unref(n)-1}]),onClick:e=>l===t.unref(n)-1?e=>e.preventDefault():function(e){o.push({path:e.path,query:e.query||{}})}(a),title:a.name},t.toDisplayString(a.name||"--"),11,w),l!==t.unref(n)-1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[e.separator?(t.openBlock(),t.createElementBlock("span",N,t.toDisplayString(e.separator),1)):(t.openBlock(),t.createElementBlock("svg",S,B))],64)):t.createCommentVNode("",!0)])))),128)),V],4))}}),[["__scopeId","data-v-574bc864"]]);y.install=e=>{e.component(y.__name,y)};const E={class:"m-countdown"},C={class:"u-title"},b={class:"u-time"},D={key:2},x=h(t.defineComponent({__name:"Countdown",props:{countdown:{default:0},title:{default:"Countdown"},format:{default:"HH:mm:ss"},prefix:{default:""},suffix:{default:""},finishedText:{default:""}},emits:["finish"],setup(e,{emit:a}){const l=e,n=t.ref(l.countdown);function o(e){return e<10?"0"+e:String(e)}const r=t.computed((()=>function(e){let t=l.format;if(t.includes("s"))var a=e;else a=0;if(t.includes("m")){a%=60;var n=Math.floor((e-a)/60)}else n=0;if(t.includes("H")){n%=60;var r=Math.floor((e-a-60*n)/60/60)}else r=0;if(t.includes("D")){r%=24;var c=Math.floor((e-a-60*n-60*r*60)/60/60/24)}else c=0;return t=t.includes("ss")?t.replace("ss",o(a)):t.replace("s",String(a)),t=t.includes("mm")?t.replace("mm",o(n)):t.replace("m",String(n)),t=t.includes("HH")?t.replace("HH",o(r)):t.replace("H",String(r)),t=t.includes("DD")?t.replace("DD",o(c)):t.replace("D",String(c)),t}(n.value)));function c(e){setTimeout((()=>{e.value--,e.value>0?c(e):a("finish")}),1e3)}return t.onMounted((()=>{c(n)})),(a,o)=>(t.openBlock(),t.createElementBlock("div",E,[t.renderSlot(a.$slots,"title",{},(()=>[t.createElementVNode("p",C,t.toDisplayString(l.title),1)]),!0),t.createElementVNode("div",b,[n.value>0?t.renderSlot(a.$slots,"prefix",{key:0},(()=>[t.createTextVNode(t.toDisplayString(e.prefix),1)]),!0):t.createCommentVNode("",!0),e.finishedText&&0===n.value?t.renderSlot(a.$slots,"finish",{key:1},(()=>[t.createTextVNode(t.toDisplayString(e.finishedText),1)]),!0):(t.openBlock(),t.createElementBlock("span",D,t.toDisplayString(t.unref(r)),1)),n.value>0?t.renderSlot(a.$slots,"suffix",{key:3},(()=>[t.createTextVNode(t.toDisplayString(e.suffix),1)]),!0):t.createCommentVNode("",!0)])]))}}),[["__scopeId","data-v-186d410a"]]);x.install=e=>{e.component(x.__name,x)};const _=[g,y,x],z={install:e=>{_.forEach((t=>e.component(t.__name,t)))}};e.Breadcrumb=y,e.Countdown=x,e.Pagination=g,e.default=z,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-amazing-ui",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [