vue-amazing-ui 0.0.6 → 0.0.7

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-90e9305f]{margin:16px 0}.hidden[data-v-90e9305f]{display:none}.left[data-v-90e9305f]{text-align:left}.center[data-v-90e9305f]{text-align:center}.right[data-v-90e9305f]{text-align:right}.m-pagination-wrap[data-v-90e9305f]{display:inline-block;height:32px;line-height:30px;font-size:14px;color:#000000a6;text-align:center}.m-pagination-wrap .mr8[data-v-90e9305f]{margin-right:8px}.m-pagination-wrap .u-item[data-v-90e9305f]{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-90e9305f]:hover{font-weight:500;color:#1890ff;border-color:#1890ff}.m-pagination-wrap .u-item:hover .u-arrow[data-v-90e9305f]{fill:#1890ff}.m-pagination-wrap .u-item .u-arrow[data-v-90e9305f]{fill:#000000a6;width:12px;height:12px;transition:all .3s}.m-pagination-wrap .u-item[data-v-90e9305f]:not(:last-child){margin-right:8px}.m-pagination-wrap .active[data-v-90e9305f]{font-weight:500;color:#1890ff;border-color:#1890ff}.m-pagination-wrap .active .u-arrow[data-v-90e9305f]{fill:#1890ff}.m-pagination-wrap .disabled[data-v-90e9305f]{color:#00000040;background:#fff;border-color:#d9d9d9;cursor:not-allowed}.m-pagination-wrap .disabled[data-v-90e9305f]:hover{font-weight:400;color:#000000a6;border-color:#d9d9d9}.m-pagination-wrap .disabled:hover .u-arrow[data-v-90e9305f],.m-pagination-wrap .disabled .u-arrow[data-v-90e9305f]{fill:#00000040}.m-pagination-wrap .m-arrow[data-v-90e9305f]{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-90e9305f]{transition:all .3s}.m-pagination-wrap .m-arrow .u-icon[data-v-90e9305f]{fill:#1890ff;width:12px;height:12px}.m-pagination-wrap .u-jump-page[data-v-90e9305f]{margin-left:8px;line-height:32px;font-size:14px;color:#000000a6}.m-pagination-wrap .u-jump-page input[data-v-90e9305f]{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-90e9305f]:hover{border-color:#1890ff}.m-pagination-wrap .u-jump-page input[data-v-90e9305f]:focus{border-color:#1890ff;box-shadow:0 0 0 2px #1890ff33}.m-breadcrumb .m-bread[data-v-e7eb3765]{display:inline-block;vertical-align:middle}.m-breadcrumb .m-bread .u-route[data-v-e7eb3765]{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-e7eb3765]:hover{color:#1890ff}.m-breadcrumb .m-bread .active[data-v-e7eb3765]{color:#1890ff;cursor:default}.m-breadcrumb .m-bread .u-separator[data-v-e7eb3765]{display:inline-block;vertical-align:middle;margin:0 6px}.m-breadcrumb .m-bread .u-arrow[data-v-e7eb3765]{display:inline-block;vertical-align:middle;margin:0 5px;width:12px;height:12px}.m-breadcrumb .assist[data-v-e7eb3765]{height:100%;width:0;display:inline-block;vertical-align:middle}
@@ -1,13 +1,6 @@
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 = {
1
+ import { defineComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createCommentVNode, withDirectives, vShow, Fragment, renderList, createTextVNode, vModelText, pushScopeId, popScopeId, computed, normalizeStyle, unref } from "vue";
2
+ import { useRouter } from "vue-router";
3
+ const _sfc_main$1 = defineComponent({
11
4
  name: "Pagination",
12
5
  props: {
13
6
  current: {
@@ -80,7 +73,6 @@ const _sfc_main$1 = {
80
73
  this.currentPage = to;
81
74
  },
82
75
  currentPage(to) {
83
- this.loading = true;
84
76
  console.log("change:", to);
85
77
  this.$emit("change", {
86
78
  page: to,
@@ -157,8 +149,16 @@ const _sfc_main$1 = {
157
149
  }
158
150
  }
159
151
  }
152
+ });
153
+ const Pagination_vue_vue_type_style_index_0_scoped_90e9305f_lang = "";
154
+ const _export_sfc = (sfc, props) => {
155
+ const target = sfc.__vccOpts || sfc;
156
+ for (const [key, val] of props) {
157
+ target[key] = val;
158
+ }
159
+ return target;
160
160
  };
161
- const _withScopeId$1 = (n) => (pushScopeId("data-v-c3c66db5"), n = n(), popScopeId(), n);
161
+ const _withScopeId$1 = (n) => (pushScopeId("data-v-90e9305f"), n = n(), popScopeId(), n);
162
162
  const _hoisted_1$1 = { class: "m-pagination-wrap" };
163
163
  const _hoisted_2$1 = {
164
164
  key: 0,
@@ -217,121 +217,87 @@ const _hoisted_16 = {
217
217
  key: 1,
218
218
  class: "u-jump-page"
219
219
  };
220
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
220
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
221
221
  return openBlock(), createElementBlock("div", {
222
- class: normalizeClass([`m-pagination ${$props.placement}`, { hidden: $props.hideOnSinglePage && $props.total <= $props.pageSize }])
222
+ class: normalizeClass([`m-pagination ${_ctx.placement}`, { hidden: _ctx.hideOnSinglePage && _ctx.total <= _ctx.pageSize }])
223
223
  }, [
224
224
  createElementVNode("div", _hoisted_1$1, [
225
- $props.showTotal ? (openBlock(), createElementBlock("span", _hoisted_2$1, "共 " + toDisplayString($options.totalPage) + " 页 / " + toDisplayString($props.total) + " 条", 1)) : createCommentVNode("", true),
225
+ _ctx.showTotal ? (openBlock(), createElementBlock("span", _hoisted_2$1, "共 " + toDisplayString(_ctx.totalPage) + " 页 / " + toDisplayString(_ctx.total) + " 条", 1)) : createCommentVNode("", true),
226
226
  createElementVNode("span", {
227
- class: normalizeClass(["u-item", { disabled: $data.currentPage === 1 }]),
228
- onClick: _cache[0] || (_cache[0] = ($event) => $options.changePage($data.currentPage - 1))
227
+ class: normalizeClass(["u-item", { disabled: _ctx.currentPage === 1 }]),
228
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.changePage(_ctx.currentPage - 1))
229
229
  }, _hoisted_4$1, 2),
230
230
  createElementVNode("span", {
231
- class: normalizeClass(["u-item", { active: $data.currentPage === 1 }]),
232
- onClick: _cache[1] || (_cache[1] = ($event) => $options.changePage(1))
231
+ class: normalizeClass(["u-item", { active: _ctx.currentPage === 1 }]),
232
+ onClick: _cache[1] || (_cache[1] = ($event) => _ctx.changePage(1))
233
233
  }, "1", 2),
234
234
  withDirectives(createElementVNode("span", {
235
235
  class: "m-arrow",
236
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)
237
+ onClick: _cache[2] || (_cache[2] = (...args) => _ctx.onForward && _ctx.onForward(...args)),
238
+ onMouseenter: _cache[3] || (_cache[3] = ($event) => _ctx.forwardArrow = true),
239
+ onMouseleave: _cache[4] || (_cache[4] = ($event) => _ctx.forwardArrow = false)
240
240
  }, [
241
241
  withDirectives(createElementVNode("span", _hoisted_5$1, "•••", 512), [
242
- [vShow, !$data.forwardArrow]
242
+ [vShow, !_ctx.forwardArrow]
243
243
  ]),
244
244
  withDirectives((openBlock(), createElementBlock("svg", _hoisted_6$1, _hoisted_8, 512)), [
245
- [vShow, $data.forwardArrow]
245
+ [vShow, _ctx.forwardArrow]
246
246
  ])
247
247
  ], 544), [
248
- [vShow, $data.forwardMore && $options.pageList[0] - 1 > 1]
248
+ [vShow, _ctx.forwardMore && _ctx.pageList[0] - 1 > 1]
249
249
  ]),
250
- (openBlock(true), createElementBlock(Fragment, null, renderList($options.pageList, (page, index) => {
250
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.pageList, (page, index) => {
251
251
  return openBlock(), createElementBlock("span", {
252
- class: normalizeClass(["u-item", { active: $data.currentPage === page }]),
252
+ class: normalizeClass(["u-item", { active: _ctx.currentPage === page }]),
253
253
  key: index,
254
- onClick: ($event) => $options.changePage(page)
254
+ onClick: ($event) => _ctx.changePage(page)
255
255
  }, toDisplayString(page), 11, _hoisted_9);
256
256
  }), 128)),
257
257
  withDirectives(createElementVNode("span", {
258
258
  class: "m-arrow",
259
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)
260
+ onClick: _cache[5] || (_cache[5] = (...args) => _ctx.onBackward && _ctx.onBackward(...args)),
261
+ onMouseenter: _cache[6] || (_cache[6] = ($event) => _ctx.backwardArrow = true),
262
+ onMouseleave: _cache[7] || (_cache[7] = ($event) => _ctx.backwardArrow = false)
263
263
  }, [
264
264
  withDirectives(createElementVNode("span", _hoisted_10, "•••", 512), [
265
- [vShow, !$data.backwardArrow]
265
+ [vShow, !_ctx.backwardArrow]
266
266
  ]),
267
267
  withDirectives((openBlock(), createElementBlock("svg", _hoisted_11, _hoisted_13, 512)), [
268
- [vShow, $data.backwardArrow]
268
+ [vShow, _ctx.backwardArrow]
269
269
  ])
270
270
  ], 544), [
271
- [vShow, $data.backwardMore && $options.pageList[$options.pageList.length - 1] + 1 < $options.totalPage]
271
+ [vShow, _ctx.backwardMore && _ctx.pageList[_ctx.pageList.length - 1] + 1 < _ctx.totalPage]
272
272
  ]),
273
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]
274
+ class: normalizeClass(["u-item", { active: _ctx.currentPage === _ctx.totalPage }]),
275
+ onClick: _cache[8] || (_cache[8] = ($event) => _ctx.changePage(_ctx.totalPage))
276
+ }, toDisplayString(_ctx.totalPage), 3), [
277
+ [vShow, _ctx.totalPage !== 1]
278
278
  ]),
279
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))
280
+ class: normalizeClass(["u-item", { disabled: _ctx.currentPage === _ctx.totalPage }]),
281
+ onClick: _cache[9] || (_cache[9] = ($event) => _ctx.changePage(_ctx.currentPage + 1))
282
282
  }, _hoisted_15, 2),
283
- $props.showQuickJumper ? (openBlock(), createElementBlock("span", _hoisted_16, [
283
+ _ctx.showQuickJumper ? (openBlock(), createElementBlock("span", _hoisted_16, [
284
284
  createTextVNode("跳至"),
285
285
  withDirectives(createElementVNode("input", {
286
286
  type: "text",
287
- "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => $data.jumpNumber = $event)
287
+ "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => _ctx.jumpNumber = $event)
288
288
  }, null, 512), [
289
- [vModelText, $data.jumpNumber]
289
+ [vModelText, _ctx.jumpNumber]
290
290
  ]),
291
291
  createTextVNode("页")
292
292
  ])) : createCommentVNode("", true)
293
293
  ])
294
294
  ], 2);
295
295
  }
296
- const Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-c3c66db5"]]);
296
+ const Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__scopeId", "data-v-90e9305f"]]);
297
297
  Pagination.install = (app) => {
298
298
  app.component(Pagination.name, Pagination);
299
299
  };
300
- const Breadcrumb_vue_vue_type_style_index_0_scoped_988f5a63_lang = "";
301
- const _sfc_main = {
302
- name: "Breadcrumb",
303
- props: {
304
- routes: {
305
- // router的路由数组
306
- type: Array,
307
- required: true,
308
- default: () => {
309
- return [];
310
- }
311
- },
312
- height: {
313
- // 面包屑高度
314
- type: Number,
315
- default: 60
316
- },
317
- separator: {
318
- // 自定义分隔符
319
- type: String,
320
- default: ""
321
- }
322
- },
323
- computed: {
324
- len() {
325
- return this.routes.length;
326
- }
327
- },
328
- methods: {
329
- goRouter(route) {
330
- this.$router.push({ path: route.path, query: route.query || {} });
331
- }
332
- }
333
- };
334
- const _withScopeId = (n) => (pushScopeId("data-v-988f5a63"), n = n(), popScopeId(), n);
300
+ const _withScopeId = (n) => (pushScopeId("data-v-e7eb3765"), n = n(), popScopeId(), n);
335
301
  const _hoisted_1 = ["onClick", "title"];
336
302
  const _hoisted_2 = {
337
303
  key: 0,
@@ -350,30 +316,53 @@ const _hoisted_5 = [
350
316
  _hoisted_4
351
317
  ];
352
318
  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) => {
319
+ const __default__ = {
320
+ // 导出组件name
321
+ name: "Breadcrumb"
322
+ };
323
+ const _sfc_main = /* @__PURE__ */ defineComponent({
324
+ ...__default__,
325
+ props: {
326
+ routes: { default: () => [] },
327
+ height: { default: 60 },
328
+ separator: { default: "" }
329
+ },
330
+ setup(__props) {
331
+ const props = __props;
332
+ const len = computed(() => {
333
+ return props.routes.length;
334
+ });
335
+ const router = useRouter();
336
+ function goRouter(route) {
337
+ router.push({ path: route.path, query: route.query || {} });
338
+ }
339
+ return (_ctx, _cache) => {
359
340
  return openBlock(), createElementBlock("div", {
360
- class: "m-bread",
361
- key: index
341
+ class: "m-breadcrumb",
342
+ style: normalizeStyle(`height: ${__props.height}px;`)
362
343
  }, [
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"]]);
344
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.routes, (route, index) => {
345
+ return openBlock(), createElementBlock("div", {
346
+ class: "m-bread",
347
+ key: index
348
+ }, [
349
+ createElementVNode("a", {
350
+ class: normalizeClass(["u-route", { active: index === unref(len) - 1 }]),
351
+ onClick: ($event) => index === unref(len) - 1 ? (e) => e.preventDefault() : goRouter(route),
352
+ title: route.name
353
+ }, toDisplayString(route.name || "--"), 11, _hoisted_1),
354
+ index !== unref(len) - 1 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
355
+ __props.separator ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(__props.separator), 1)) : (openBlock(), createElementBlock("svg", _hoisted_3, _hoisted_5))
356
+ ], 64)) : createCommentVNode("", true)
357
+ ]);
358
+ }), 128)),
359
+ _hoisted_6
360
+ ], 4);
361
+ };
362
+ }
363
+ });
364
+ const Breadcrumb_vue_vue_type_style_index_0_scoped_e7eb3765_lang = "";
365
+ const Breadcrumb = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e7eb3765"]]);
377
366
  Breadcrumb.install = (app) => {
378
367
  app.component(Breadcrumb.name, Breadcrumb);
379
368
  };
@@ -388,5 +377,7 @@ const VueAmazingUI = {
388
377
  install
389
378
  };
390
379
  export {
380
+ Breadcrumb,
381
+ Pagination,
391
382
  VueAmazingUI as default
392
383
  };
@@ -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 r=t.defineComponent({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.$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)=>{const a=e.__vccOpts||e;for(const[r,o]of t)a[r]=o;return a},n=e=>(t.pushScopeId("data-v-90e9305f"),e=e(),t.popScopeId(),e),l={class:"m-pagination-wrap"},c={key:0,class:"mr8"},s=[n((()=>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)))],i={class:"u-ellipsis"},u={class:"u-icon",viewBox:"64 64 896 896","data-icon":"double-left","aria-hidden":"true",focusable:"false"},d=[n((()=>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)))],p=["onClick"],m={class:"u-ellipsis"},g={class:"u-icon",viewBox:"64 64 896 896","data-icon":"double-right","aria-hidden":"true",focusable:"false"},h=[n((()=>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)))],w=[n((()=>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)))],f={key:1,class:"u-jump-page"};const k=o(r,[["render",function(e,a,r,o,n,k){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([`m-pagination ${e.placement}`,{hidden:e.hideOnSinglePage&&e.total<=e.pageSize}])},[t.createElementVNode("div",l,[e.showTotal?(t.openBlock(),t.createElementBlock("span",c,"共 "+t.toDisplayString(e.totalPage)+" 页 / "+t.toDisplayString(e.total)+" 条",1)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass(["u-item",{disabled:1===e.currentPage}]),onClick:a[0]||(a[0]=t=>e.changePage(e.currentPage-1))},s,2),t.createElementVNode("span",{class:t.normalizeClass(["u-item",{active:1===e.currentPage}]),onClick:a[1]||(a[1]=t=>e.changePage(1))},"1",2),t.withDirectives(t.createElementVNode("span",{class:"m-arrow",ref:"forward",onClick:a[2]||(a[2]=(...t)=>e.onForward&&e.onForward(...t)),onMouseenter:a[3]||(a[3]=t=>e.forwardArrow=!0),onMouseleave:a[4]||(a[4]=t=>e.forwardArrow=!1)},[t.withDirectives(t.createElementVNode("span",i,"•••",512),[[t.vShow,!e.forwardArrow]]),t.withDirectives((t.openBlock(),t.createElementBlock("svg",u,d,512)),[[t.vShow,e.forwardArrow]])],544),[[t.vShow,e.forwardMore&&e.pageList[0]-1>1]]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.pageList,((a,r)=>(t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(["u-item",{active:e.currentPage===a}]),key:r,onClick:t=>e.changePage(a)},t.toDisplayString(a),11,p)))),128)),t.withDirectives(t.createElementVNode("span",{class:"m-arrow",ref:"backward",onClick:a[5]||(a[5]=(...t)=>e.onBackward&&e.onBackward(...t)),onMouseenter:a[6]||(a[6]=t=>e.backwardArrow=!0),onMouseleave:a[7]||(a[7]=t=>e.backwardArrow=!1)},[t.withDirectives(t.createElementVNode("span",m,"•••",512),[[t.vShow,!e.backwardArrow]]),t.withDirectives((t.openBlock(),t.createElementBlock("svg",g,h,512)),[[t.vShow,e.backwardArrow]])],544),[[t.vShow,e.backwardMore&&e.pageList[e.pageList.length-1]+1<e.totalPage]]),t.withDirectives(t.createElementVNode("span",{class:t.normalizeClass(["u-item",{active:e.currentPage===e.totalPage}]),onClick:a[8]||(a[8]=t=>e.changePage(e.totalPage))},t.toDisplayString(e.totalPage),3),[[t.vShow,1!==e.totalPage]]),t.createElementVNode("span",{class:t.normalizeClass(["u-item",{disabled:e.currentPage===e.totalPage}]),onClick:a[9]||(a[9]=t=>e.changePage(e.currentPage+1))},w,2),e.showQuickJumper?(t.openBlock(),t.createElementBlock("span",f,[t.createTextVNode("跳至"),t.withDirectives(t.createElementVNode("input",{type:"text","onUpdate:modelValue":a[10]||(a[10]=t=>e.jumpNumber=t)},null,512),[[t.vModelText,e.jumpNumber]]),t.createTextVNode("页")])):t.createCommentVNode("",!0)])],2)}],["__scopeId","data-v-90e9305f"]]);k.install=e=>{e.component(k.name,k)};const v=e=>(t.pushScopeId("data-v-e7eb3765"),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))),E=o(t.defineComponent({name:"Breadcrumb",props:{routes:{default:()=>[]},height:{default:60},separator:{default:""}},setup(e){const r=e,o=t.computed((()=>r.routes.length)),n=a.useRouter();return(a,r)=>(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,r)=>(t.openBlock(),t.createElementBlock("div",{class:"m-bread",key:r},[t.createElementVNode("a",{class:t.normalizeClass(["u-route",{active:r===t.unref(o)-1}]),onClick:e=>r===t.unref(o)-1?e=>e.preventDefault():function(e){n.push({path:e.path,query:e.query||{}})}(a),title:a.name},t.toDisplayString(a.name||"--"),11,P),r!==t.unref(o)-1?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[e.separator?(t.openBlock(),t.createElementBlock("span",b,t.toDisplayString(e.separator),1)):(t.openBlock(),t.createElementBlock("svg",N,B))],64)):t.createCommentVNode("",!0)])))),128)),y],4))}}),[["__scopeId","data-v-e7eb3765"]]);E.install=e=>{e.component(E.name,E)};const V=[k,E],S={install:e=>{V.forEach((t=>e.component(t.name,t)))}};e.Breadcrumb=E,e.Pagination=k,e.default=S,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.7",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [