@ccn-ui-kit/table 0.1.2

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 (79) hide show
  1. package/dist/index.cjs +1 -0
  2. package/dist/index.js +303 -0
  3. package/dist/packages/components/__tests__/loading.spec.d.ts +1 -0
  4. package/dist/packages/components/badge/index.d.ts +10 -0
  5. package/dist/packages/components/badge/src/badge.d.ts +25 -0
  6. package/dist/packages/components/breadcrumb/index.d.ts +12 -0
  7. package/dist/packages/components/breadcrumb/src/breadcrumb-item.d.ts +13 -0
  8. package/dist/packages/components/breadcrumb/src/breadcrumb.d.ts +10 -0
  9. package/dist/packages/components/button/index.d.ts +10 -0
  10. package/dist/packages/components/button/src/button.d.ts +25 -0
  11. package/dist/packages/components/date-picker/index.d.ts +10 -0
  12. package/dist/packages/components/date-picker/src/date-picker.d.ts +20 -0
  13. package/dist/packages/components/descriptions/index.d.ts +12 -0
  14. package/dist/packages/components/descriptions/src/descriptions-item.d.ts +13 -0
  15. package/dist/packages/components/descriptions/src/descriptions.d.ts +17 -0
  16. package/dist/packages/components/divider/index.d.ts +10 -0
  17. package/dist/packages/components/divider/src/divider.d.ts +20 -0
  18. package/dist/packages/components/dropdown/index.d.ts +12 -0
  19. package/dist/packages/components/dropdown/src/dropdown-item.d.ts +20 -0
  20. package/dist/packages/components/dropdown/src/dropdown.d.ts +46 -0
  21. package/dist/packages/components/form/index.d.ts +12 -0
  22. package/dist/packages/components/form/src/form-item.d.ts +45 -0
  23. package/dist/packages/components/form/src/form.d.ts +96 -0
  24. package/dist/packages/components/icon/index.d.ts +11 -0
  25. package/dist/packages/components/icon/src/icon.d.ts +18 -0
  26. package/dist/packages/components/icon/src/icons.d.ts +50 -0
  27. package/dist/packages/components/input/index.d.ts +10 -0
  28. package/dist/packages/components/input/src/input.d.ts +25 -0
  29. package/dist/packages/components/link/index.d.ts +10 -0
  30. package/dist/packages/components/link/src/link.d.ts +25 -0
  31. package/dist/packages/components/loading/index.d.ts +10 -0
  32. package/dist/packages/components/loading/src/loading.d.ts +15 -0
  33. package/dist/packages/components/menu/index.d.ts +14 -0
  34. package/dist/packages/components/menu/src/menu-item.d.ts +12 -0
  35. package/dist/packages/components/menu/src/menu.d.ts +40 -0
  36. package/dist/packages/components/menu/src/sub-menu.d.ts +12 -0
  37. package/dist/packages/components/message/index.d.ts +12 -0
  38. package/dist/packages/components/message/src/manager.d.ts +14 -0
  39. package/dist/packages/components/message/src/message.d.ts +28 -0
  40. package/dist/packages/components/modal/index.d.ts +10 -0
  41. package/dist/packages/components/modal/src/modal.d.ts +46 -0
  42. package/dist/packages/components/notification/index.d.ts +12 -0
  43. package/dist/packages/components/notification/src/manager.d.ts +14 -0
  44. package/dist/packages/components/notification/src/notification.d.ts +44 -0
  45. package/dist/packages/components/pagination/index.d.ts +10 -0
  46. package/dist/packages/components/pagination/src/pagination.d.ts +30 -0
  47. package/dist/packages/components/popconfirm/index.d.ts +10 -0
  48. package/dist/packages/components/popconfirm/src/popconfirm.d.ts +56 -0
  49. package/dist/packages/components/rich-editor/index.d.ts +10 -0
  50. package/dist/packages/components/rich-editor/src/rich-editor.d.ts +36 -0
  51. package/dist/packages/components/select/index.d.ts +10 -0
  52. package/dist/packages/components/select/src/select.d.ts +45 -0
  53. package/dist/packages/components/space/index.d.ts +10 -0
  54. package/dist/packages/components/space/src/space.d.ts +33 -0
  55. package/dist/packages/components/steps/index.d.ts +12 -0
  56. package/dist/packages/components/steps/src/step.d.ts +28 -0
  57. package/dist/packages/components/steps/src/steps.d.ts +46 -0
  58. package/dist/packages/components/table/index.d.ts +10 -0
  59. package/dist/packages/components/table/src/table.d.ts +56 -0
  60. package/dist/packages/components/table/src/table.vue.d.ts +77 -0
  61. package/dist/packages/components/tabs/index.d.ts +12 -0
  62. package/dist/packages/components/tabs/src/tab-pane.d.ts +22 -0
  63. package/dist/packages/components/tabs/src/tabs.d.ts +43 -0
  64. package/dist/packages/components/tree/index.d.ts +10 -0
  65. package/dist/packages/components/tree/src/tree.d.ts +134 -0
  66. package/dist/packages/components/upload/index.d.ts +10 -0
  67. package/dist/packages/components/upload/src/upload.d.ts +103 -0
  68. package/dist/packages/directives/index.d.ts +2 -0
  69. package/dist/packages/directives/loading/index.d.ts +11 -0
  70. package/dist/packages/directives/permission/index.d.ts +3 -0
  71. package/dist/packages/ui-kit/index.d.ts +34 -0
  72. package/dist/packages/utils/dom.d.ts +5 -0
  73. package/dist/packages/utils/index.d.ts +3 -0
  74. package/dist/packages/utils/types.d.ts +7 -0
  75. package/dist/packages/utils/vue-helper.d.ts +9 -0
  76. package/dist/play/main.d.ts +1 -0
  77. package/dist/play/vite.config.d.ts +2 -0
  78. package/package.json +27 -0
  79. package/style/index.scss +89 -0
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),z={name:{type:String,required:!0},size:{type:[Number,String],default:16},color:{type:String,default:""},spin:Boolean},b={search:'<circle cx="11" cy="11" r="8" /><line x1="21" y1="21" x2="16.65" y2="16.65" />',plus:'<line x1="12" y1="5" x2="12" y2="19" /><line x1="5" y1="12" x2="19" y2="12" />',minus:'<line x1="5" y1="12" x2="19" y2="12" />',close:'<line x1="18" y1="6" x2="6" y2="18" /><line x1="6" y1="6" x2="18" y2="18" />',check:'<polyline points="20 6 9 17 4 12" />',loading:'<path d="M21 12a9 9 0 1 1-6.219-8.56" />',refresh:'<polyline points="23 4 23 10 17 10" /><polyline points="1 20 1 14 7 14" /><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15" />',edit:'<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" /><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" />',delete:'<polyline points="3 6 5 6 21 6" /><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" /><line x1="10" y1="11" x2="10" y2="17" /><line x1="14" y1="11" x2="14" y2="17" />',download:'<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" /><polyline points="7 10 12 15 17 10" /><line x1="12" y1="15" x2="12" y2="3" />',upload:'<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" /><polyline points="17 8 12 3 7 8" /><line x1="12" y1="3" x2="12" y2="15" />',setting:'<circle cx="12" cy="12" r="3" /><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" />',user:'<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" /><circle cx="12" cy="7" r="4" />',home:'<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" /><polyline points="9 22 9 12 15 12 15 22" />',calendar:'<rect x="3" y="4" width="18" height="18" rx="2" ry="2" /><line x1="16" y1="2" x2="16" y2="6" /><line x1="8" y1="2" x2="8" y2="6" /><line x1="3" y1="10" x2="21" y2="10" />',clock:'<circle cx="12" cy="12" r="10" /><polyline points="12 6 12 12 16 14" />',star:'<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" />',heart:'<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" />',message:'<path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z" />',bell:'<path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9" /><path d="M13.73 21a2 2 0 0 1-3.46 0" />',mail:'<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z" /><polyline points="22,6 12,13 2,6" />',eye:'<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" /><circle cx="12" cy="12" r="3" />',lock:'<rect x="3" y="11" width="18" height="11" rx="2" ry="2" /><path d="M7 11V7a5 5 0 0 1 10 0v4" />',link:'<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" /><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" />',"arrow-up":'<line x1="12" y1="19" x2="12" y2="5" /><polyline points="5 12 12 5 19 12" />',"arrow-down":'<line x1="12" y1="5" x2="12" y2="19" /><polyline points="19 12 12 19 5 12" />',"arrow-left":'<line x1="19" y1="12" x2="5" y2="12" /><polyline points="12 19 5 12 12 5" />',"arrow-right":'<line x1="5" y1="12" x2="19" y2="12" /><polyline points="12 5 19 12 12 19" />',"chevron-up":'<polyline points="18 15 12 9 6 15" />',"chevron-down":'<polyline points="6 9 12 15 18 9" />',"chevron-left":'<polyline points="15 18 9 12 15 6" />',"chevron-right":'<polyline points="9 18 15 12 9 6" />',more:'<circle cx="12" cy="12" r="1" /><circle cx="19" cy="12" r="1" /><circle cx="5" cy="12" r="1" />',menu:'<line x1="3" y1="12" x2="21" y2="12" /><line x1="3" y1="6" x2="21" y2="6" /><line x1="3" y1="18" x2="21" y2="18" />',filter:'<polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" />',copy:'<rect x="9" y="9" width="13" height="13" rx="2" ry="2" /><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" />',"external-link":'<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" /><polyline points="15 3 21 3 21 9" /><line x1="10" y1="14" x2="21" y2="3" />',zap:'<polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" />',"log-out":'<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" /><polyline points="16 17 21 12 16 7" /><line x1="21" y1="12" x2="9" y2="12" />',grid:'<rect x="3" y="3" width="7" height="7" /><rect x="14" y="3" width="7" height="7" /><rect x="14" y="14" width="7" height="7" /><rect x="3" y="14" width="7" height="7" />',info:'<circle cx="12" cy="12" r="10" /><line x1="12" y1="16" x2="12" y2="12" /><line x1="12" y1="8" x2="12.01" y2="8" />',success:'<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14" /><polyline points="22 4 12 14.01 9 11.01" />',warning:'<path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" /><line x1="12" y1="9" x2="12" y2="13" /><line x1="12" y1="17" x2="12.01" y2="17" />',error:'<circle cx="12" cy="12" r="10" /><line x1="15" y1="9" x2="9" y2="15" /><line x1="9" y1="9" x2="15" y2="15" />',question:'<circle cx="12" cy="12" r="10" /><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" /><line x1="12" y1="17" x2="12.01" y2="17" />',"plus-circle":'<circle cx="12" cy="12" r="10" /><line x1="12" y1="8" x2="12" y2="16" /><line x1="8" y1="12" x2="16" y2="12" />'};function V(s){return s in b}const S={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},w=["innerHTML"],k=e.defineComponent({__name:"icon",props:z,setup(s){const i=s,c=e.computed(()=>V(i.name)?b[i.name]:""),y=e.computed(()=>({fontSize:typeof i.size=="number"?`${i.size}px`:i.size,...i.color?{color:i.color}:{}}));return(d,r)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["ui-icon",{"is-spin":d.spin}]),style:e.normalizeStyle(y.value),role:"img"},[(e.openBlock(),e.createElementBlock("svg",S,[e.createElementVNode("g",{innerHTML:c.value},null,8,w)]))],6))}}),f={data:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]},stripe:Boolean,border:Boolean,size:{type:String,default:"medium"},emptyText:{type:String,default:"暂无数据"}},_={"sort-change":s=>!0},H={class:"ui-table__inner"},L={class:"ui-table__head"},N=["aria-sort"],T=["onClick"],C={class:"ui-table__sort-label"},$={class:"ui-table__sort-icons"},A={key:2},D={class:"ui-table__body"},P={key:0},F=["colspan"],q=["innerHTML"],j={key:2},u=e.defineComponent({__name:"table",props:f,emits:_,setup(s,{emit:i}){const c=s,y=i,d=e.useSlots(),r=e.ref({column:null,prop:"",order:null}),h=e.computed(()=>{const{prop:t,order:l}=r.value;if(!t||!l)return c.data;const n=l==="ascending"?1:-1;return[...c.data].sort((a,o)=>{const p=a[t],g=o[t];return p===g?0:p>g?n:-n})});function B(t){return t.width?{width:typeof t.width=="number"?`${t.width}px`:t.width}:void 0}function m(t,l){return l.prop?t[l.prop]:""}function x(t){return!!t&&!!d[t]}function M(t){if(!t.sortable||!t.prop)return;let l;r.value.prop!==t.prop?l="ascending":l=r.value.order==="ascending"?"descending":null,r.value={column:t,prop:t.prop,order:l},y("sort-change",{column:t,prop:t.prop,order:l})}function v(t,l){return r.value.order===t&&r.value.prop===l.prop}function E(t){if(!(r.value.prop!==t.prop||!r.value.order))return r.value.order}return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ui-table",[`ui-table--${t.size}`,{"is-striped":t.stripe,"is-bordered":t.border}]])},[e.createElementVNode("table",H,[e.createElementVNode("colgroup",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,(n,a)=>(e.openBlock(),e.createElementBlock("col",{key:a,style:e.normalizeStyle(B(n))},null,4))),128))]),e.createElementVNode("thead",L,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,(n,a)=>(e.openBlock(),e.createElementBlock("th",{key:a,class:e.normalizeClass(["ui-table__cell",[`is-${n.align||"left"}`,{"is-sortable":n.sortable}]]),"aria-sort":E(n)},[x(n.headerSlot)?e.renderSlot(t.$slots,n.headerSlot,{column:n,index:a},void 0,void 0,0):n.sortable?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"ui-table__sort-btn",onClick:o=>M(n)},[e.createElementVNode("span",C,e.toDisplayString(n.label),1),e.createElementVNode("span",$,[e.createVNode(e.unref(k),{name:"chevron-up",size:12,class:e.normalizeClass({"is-active":v("ascending",n)})},null,8,["class"]),e.createVNode(e.unref(k),{name:"chevron-down",size:12,class:e.normalizeClass({"is-active":v("descending",n)})},null,8,["class"])])],8,T)):(e.openBlock(),e.createElementBlock("span",A,e.toDisplayString(n.label),1))],10,N))),128))])]),e.createElementVNode("tbody",D,[h.value.length===0?(e.openBlock(),e.createElementBlock("tr",P,[e.createElementVNode("td",{class:"ui-table__empty",colspan:t.columns.length||1},[e.renderSlot(t.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(t.emptyText),1)])],8,F)])):e.createCommentVNode("v-if",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(n,a)=>(e.openBlock(),e.createElementBlock("tr",{key:a},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,(o,p)=>(e.openBlock(),e.createElementBlock("td",{key:p,class:e.normalizeClass(["ui-table__cell",`is-${o.align||"left"}`])},[x(o.slot)?e.renderSlot(t.$slots,o.slot,{row:n,column:o,index:a},void 0,void 0,0):o.formatter?(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:o.formatter(n,o,m(n,o),a)},null,8,q)):(e.openBlock(),e.createElementBlock("span",j,e.toDisplayString(m(n,o)),1))],2))),128))]))),128))])])],2))}}),U={name:"UiTable",install(s){s.component("UiTable",u)}};exports.Table=u;exports.TablePlugin=U;exports.default=u;exports.tableEmits=_;exports.tableProps=f;
package/dist/index.js ADDED
@@ -0,0 +1,303 @@
1
+ import { defineComponent as L, computed as f, openBlock as n, createElementBlock as l, normalizeStyle as T, normalizeClass as y, createElementVNode as p, useSlots as N, ref as E, Fragment as h, renderList as x, renderSlot as b, toDisplayString as v, createVNode as H, unref as V, createTextVNode as q, createCommentVNode as D } from "vue";
2
+ const P = {
3
+ // 图标名称,见 ./icons 注册表
4
+ name: { type: String, required: !0 },
5
+ // 尺寸:数字按 px 处理,字符串作为 CSS 长度(如 '1.5em')
6
+ size: { type: [Number, String], default: 16 },
7
+ // 颜色:缺省时继承 currentColor
8
+ color: { type: String, default: "" },
9
+ // 是否旋转(用于 loading 等图标)
10
+ spin: Boolean
11
+ }, $ = {
12
+ search: '<circle cx="11" cy="11" r="8" /><line x1="21" y1="21" x2="16.65" y2="16.65" />',
13
+ plus: '<line x1="12" y1="5" x2="12" y2="19" /><line x1="5" y1="12" x2="19" y2="12" />',
14
+ minus: '<line x1="5" y1="12" x2="19" y2="12" />',
15
+ close: '<line x1="18" y1="6" x2="6" y2="18" /><line x1="6" y1="6" x2="18" y2="18" />',
16
+ check: '<polyline points="20 6 9 17 4 12" />',
17
+ loading: '<path d="M21 12a9 9 0 1 1-6.219-8.56" />',
18
+ refresh: '<polyline points="23 4 23 10 17 10" /><polyline points="1 20 1 14 7 14" /><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15" />',
19
+ edit: '<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" /><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" />',
20
+ delete: '<polyline points="3 6 5 6 21 6" /><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" /><line x1="10" y1="11" x2="10" y2="17" /><line x1="14" y1="11" x2="14" y2="17" />',
21
+ download: '<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" /><polyline points="7 10 12 15 17 10" /><line x1="12" y1="15" x2="12" y2="3" />',
22
+ upload: '<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" /><polyline points="17 8 12 3 7 8" /><line x1="12" y1="3" x2="12" y2="15" />',
23
+ setting: '<circle cx="12" cy="12" r="3" /><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" />',
24
+ user: '<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" /><circle cx="12" cy="7" r="4" />',
25
+ home: '<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" /><polyline points="9 22 9 12 15 12 15 22" />',
26
+ calendar: '<rect x="3" y="4" width="18" height="18" rx="2" ry="2" /><line x1="16" y1="2" x2="16" y2="6" /><line x1="8" y1="2" x2="8" y2="6" /><line x1="3" y1="10" x2="21" y2="10" />',
27
+ clock: '<circle cx="12" cy="12" r="10" /><polyline points="12 6 12 12 16 14" />',
28
+ star: '<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" />',
29
+ heart: '<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" />',
30
+ message: '<path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z" />',
31
+ bell: '<path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9" /><path d="M13.73 21a2 2 0 0 1-3.46 0" />',
32
+ mail: '<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z" /><polyline points="22,6 12,13 2,6" />',
33
+ eye: '<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" /><circle cx="12" cy="12" r="3" />',
34
+ lock: '<rect x="3" y="11" width="18" height="11" rx="2" ry="2" /><path d="M7 11V7a5 5 0 0 1 10 0v4" />',
35
+ link: '<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" /><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" />',
36
+ "arrow-up": '<line x1="12" y1="19" x2="12" y2="5" /><polyline points="5 12 12 5 19 12" />',
37
+ "arrow-down": '<line x1="12" y1="5" x2="12" y2="19" /><polyline points="19 12 12 19 5 12" />',
38
+ "arrow-left": '<line x1="19" y1="12" x2="5" y2="12" /><polyline points="12 19 5 12 12 5" />',
39
+ "arrow-right": '<line x1="5" y1="12" x2="19" y2="12" /><polyline points="12 5 19 12 12 19" />',
40
+ "chevron-up": '<polyline points="18 15 12 9 6 15" />',
41
+ "chevron-down": '<polyline points="6 9 12 15 18 9" />',
42
+ "chevron-left": '<polyline points="15 18 9 12 15 6" />',
43
+ "chevron-right": '<polyline points="9 18 15 12 9 6" />',
44
+ more: '<circle cx="12" cy="12" r="1" /><circle cx="19" cy="12" r="1" /><circle cx="5" cy="12" r="1" />',
45
+ menu: '<line x1="3" y1="12" x2="21" y2="12" /><line x1="3" y1="6" x2="21" y2="6" /><line x1="3" y1="18" x2="21" y2="18" />',
46
+ filter: '<polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" />',
47
+ copy: '<rect x="9" y="9" width="13" height="13" rx="2" ry="2" /><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" />',
48
+ "external-link": '<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" /><polyline points="15 3 21 3 21 9" /><line x1="10" y1="14" x2="21" y2="3" />',
49
+ zap: '<polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" />',
50
+ "log-out": '<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" /><polyline points="16 17 21 12 16 7" /><line x1="21" y1="12" x2="9" y2="12" />',
51
+ grid: '<rect x="3" y="3" width="7" height="7" /><rect x="14" y="3" width="7" height="7" /><rect x="14" y="14" width="7" height="7" /><rect x="3" y="14" width="7" height="7" />',
52
+ info: '<circle cx="12" cy="12" r="10" /><line x1="12" y1="16" x2="12" y2="12" /><line x1="12" y1="8" x2="12.01" y2="8" />',
53
+ success: '<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14" /><polyline points="22 4 12 14.01 9 11.01" />',
54
+ warning: '<path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" /><line x1="12" y1="9" x2="12" y2="13" /><line x1="12" y1="17" x2="12.01" y2="17" />',
55
+ error: '<circle cx="12" cy="12" r="10" /><line x1="15" y1="9" x2="9" y2="15" /><line x1="9" y1="9" x2="15" y2="15" />',
56
+ question: '<circle cx="12" cy="12" r="10" /><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" /><line x1="12" y1="17" x2="12.01" y2="17" />',
57
+ "plus-circle": '<circle cx="12" cy="12" r="10" /><line x1="12" y1="8" x2="12" y2="16" /><line x1="8" y1="12" x2="16" y2="12" />'
58
+ };
59
+ function U(c) {
60
+ return c in $;
61
+ }
62
+ const j = {
63
+ viewBox: "0 0 24 24",
64
+ fill: "none",
65
+ stroke: "currentColor",
66
+ "stroke-width": "2",
67
+ "stroke-linecap": "round",
68
+ "stroke-linejoin": "round"
69
+ }, F = ["innerHTML"], S = /* @__PURE__ */ L({
70
+ __name: "icon",
71
+ props: P,
72
+ setup(c) {
73
+ const s = c, d = f(() => U(s.name) ? $[s.name] : ""), m = f(() => ({
74
+ fontSize: typeof s.size == "number" ? `${s.size}px` : s.size,
75
+ ...s.color ? { color: s.color } : {}
76
+ }));
77
+ return (g, r) => (n(), l(
78
+ "span",
79
+ {
80
+ class: y(["ui-icon", { "is-spin": g.spin }]),
81
+ style: T(m.value),
82
+ role: "img"
83
+ },
84
+ [
85
+ (n(), l("svg", j, [
86
+ p("g", { innerHTML: d.value }, null, 8, F)
87
+ ]))
88
+ ],
89
+ 6
90
+ /* CLASS, STYLE */
91
+ ));
92
+ }
93
+ }), W = {
94
+ /** 表格数据 */
95
+ data: {
96
+ type: Array,
97
+ default: () => []
98
+ },
99
+ /** 列配置 */
100
+ columns: {
101
+ type: Array,
102
+ default: () => []
103
+ },
104
+ /** 斑马纹行 */
105
+ stripe: Boolean,
106
+ /** 纵向边框线 */
107
+ border: Boolean,
108
+ /** 尺寸:large / medium / small */
109
+ size: { type: String, default: "medium" },
110
+ /** 空数据文案 */
111
+ emptyText: { type: String, default: "暂无数据" }
112
+ }, G = {
113
+ /** 排序状态变化:order 为 ascending / descending / null(取消排序) */
114
+ "sort-change": (c) => !0
115
+ }, J = { class: "ui-table__inner" }, K = { class: "ui-table__head" }, O = ["aria-sort"], Q = ["onClick"], R = { class: "ui-table__sort-label" }, X = { class: "ui-table__sort-icons" }, Y = { key: 2 }, Z = { class: "ui-table__body" }, I = { key: 0 }, e1 = ["colspan"], t1 = ["innerHTML"], n1 = { key: 2 }, l1 = /* @__PURE__ */ L({
116
+ __name: "table",
117
+ props: W,
118
+ emits: G,
119
+ setup(c, { emit: s }) {
120
+ const d = c, m = s, g = N(), r = E({
121
+ column: null,
122
+ prop: "",
123
+ order: null
124
+ }), _ = f(() => {
125
+ const { prop: e, order: i } = r.value;
126
+ if (!e || !i) return d.data;
127
+ const t = i === "ascending" ? 1 : -1;
128
+ return [...d.data].sort((o, a) => {
129
+ const u = o[e], w = a[e];
130
+ return u === w ? 0 : u > w ? t : -t;
131
+ });
132
+ });
133
+ function A(e) {
134
+ return e.width ? { width: typeof e.width == "number" ? `${e.width}px` : e.width } : void 0;
135
+ }
136
+ function M(e, i) {
137
+ return i.prop ? e[i.prop] : "";
138
+ }
139
+ function k(e) {
140
+ return !!e && !!g[e];
141
+ }
142
+ function B(e) {
143
+ if (!e.sortable || !e.prop) return;
144
+ let i;
145
+ r.value.prop !== e.prop ? i = "ascending" : i = r.value.order === "ascending" ? "descending" : null, r.value = { column: e, prop: e.prop, order: i }, m("sort-change", { column: e, prop: e.prop, order: i });
146
+ }
147
+ function z(e, i) {
148
+ return r.value.order === e && r.value.prop === i.prop;
149
+ }
150
+ function C(e) {
151
+ if (!(r.value.prop !== e.prop || !r.value.order))
152
+ return r.value.order;
153
+ }
154
+ return (e, i) => (n(), l(
155
+ "div",
156
+ {
157
+ class: y(["ui-table", [`ui-table--${e.size}`, { "is-striped": e.stripe, "is-bordered": e.border }]])
158
+ },
159
+ [
160
+ p("table", J, [
161
+ p("colgroup", null, [
162
+ (n(!0), l(
163
+ h,
164
+ null,
165
+ x(e.columns, (t, o) => (n(), l(
166
+ "col",
167
+ {
168
+ key: o,
169
+ style: T(A(t))
170
+ },
171
+ null,
172
+ 4
173
+ /* STYLE */
174
+ ))),
175
+ 128
176
+ /* KEYED_FRAGMENT */
177
+ ))
178
+ ]),
179
+ p("thead", K, [
180
+ p("tr", null, [
181
+ (n(!0), l(
182
+ h,
183
+ null,
184
+ x(e.columns, (t, o) => (n(), l("th", {
185
+ key: o,
186
+ class: y(["ui-table__cell", [`is-${t.align || "left"}`, { "is-sortable": t.sortable }]]),
187
+ "aria-sort": C(t)
188
+ }, [
189
+ k(t.headerSlot) ? b(e.$slots, t.headerSlot, {
190
+ column: t,
191
+ index: o
192
+ }, void 0, void 0, 0) : t.sortable ? (n(), l("button", {
193
+ key: 1,
194
+ type: "button",
195
+ class: "ui-table__sort-btn",
196
+ onClick: (a) => B(t)
197
+ }, [
198
+ p(
199
+ "span",
200
+ R,
201
+ v(t.label),
202
+ 1
203
+ /* TEXT */
204
+ ),
205
+ p("span", X, [
206
+ H(V(S), {
207
+ name: "chevron-up",
208
+ size: 12,
209
+ class: y({ "is-active": z("ascending", t) })
210
+ }, null, 8, ["class"]),
211
+ H(V(S), {
212
+ name: "chevron-down",
213
+ size: 12,
214
+ class: y({ "is-active": z("descending", t) })
215
+ }, null, 8, ["class"])
216
+ ])
217
+ ], 8, Q)) : (n(), l(
218
+ "span",
219
+ Y,
220
+ v(t.label),
221
+ 1
222
+ /* TEXT */
223
+ ))
224
+ ], 10, O))),
225
+ 128
226
+ /* KEYED_FRAGMENT */
227
+ ))
228
+ ])
229
+ ]),
230
+ p("tbody", Z, [
231
+ _.value.length === 0 ? (n(), l("tr", I, [
232
+ p("td", {
233
+ class: "ui-table__empty",
234
+ colspan: e.columns.length || 1
235
+ }, [
236
+ b(e.$slots, "empty", {}, () => [
237
+ q(
238
+ v(e.emptyText),
239
+ 1
240
+ /* TEXT */
241
+ )
242
+ ])
243
+ ], 8, e1)
244
+ ])) : D("v-if", !0),
245
+ (n(!0), l(
246
+ h,
247
+ null,
248
+ x(_.value, (t, o) => (n(), l("tr", { key: o }, [
249
+ (n(!0), l(
250
+ h,
251
+ null,
252
+ x(e.columns, (a, u) => (n(), l(
253
+ "td",
254
+ {
255
+ key: u,
256
+ class: y(["ui-table__cell", `is-${a.align || "left"}`])
257
+ },
258
+ [
259
+ k(a.slot) ? b(e.$slots, a.slot, {
260
+ row: t,
261
+ column: a,
262
+ index: o
263
+ }, void 0, void 0, 0) : a.formatter ? (n(), l("span", {
264
+ key: 1,
265
+ innerHTML: a.formatter(t, a, M(t, a), o)
266
+ }, null, 8, t1)) : (n(), l(
267
+ "span",
268
+ n1,
269
+ v(M(t, a)),
270
+ 1
271
+ /* TEXT */
272
+ ))
273
+ ],
274
+ 2
275
+ /* CLASS */
276
+ ))),
277
+ 128
278
+ /* KEYED_FRAGMENT */
279
+ ))
280
+ ]))),
281
+ 128
282
+ /* KEYED_FRAGMENT */
283
+ ))
284
+ ])
285
+ ])
286
+ ],
287
+ 2
288
+ /* CLASS */
289
+ ));
290
+ }
291
+ }), a1 = {
292
+ name: "UiTable",
293
+ install(c) {
294
+ c.component("UiTable", l1);
295
+ }
296
+ };
297
+ export {
298
+ l1 as Table,
299
+ a1 as TablePlugin,
300
+ l1 as default,
301
+ G as tableEmits,
302
+ W as tableProps
303
+ };
@@ -0,0 +1,10 @@
1
+ import { App } from 'vue';
2
+ import { default as Badge } from './src/badge.vue';
3
+
4
+ export declare const BadgePlugin: {
5
+ name: string;
6
+ install(app: App): void;
7
+ };
8
+ export { Badge };
9
+ export default Badge;
10
+ export * from './src/badge';
@@ -0,0 +1,25 @@
1
+ import { ExtractPropTypes } from 'vue';
2
+
3
+ export declare const badgeProps: {
4
+ readonly value: {
5
+ readonly type: [NumberConstructor, StringConstructor];
6
+ readonly default: 0;
7
+ };
8
+ readonly max: {
9
+ readonly type: NumberConstructor;
10
+ readonly default: undefined;
11
+ };
12
+ readonly isDot: {
13
+ readonly type: BooleanConstructor;
14
+ readonly default: false;
15
+ };
16
+ readonly hidden: {
17
+ readonly type: BooleanConstructor;
18
+ readonly default: false;
19
+ };
20
+ readonly type: {
21
+ readonly type: StringConstructor;
22
+ readonly default: "danger";
23
+ };
24
+ };
25
+ export type BadgeProps = ExtractPropTypes<typeof badgeProps>;
@@ -0,0 +1,12 @@
1
+ import { App } from 'vue';
2
+ import { default as Breadcrumb } from './src/breadcrumb.vue';
3
+ import { default as BreadcrumbItem } from './src/breadcrumb-item.vue';
4
+
5
+ export declare const BreadcrumbPlugin: {
6
+ name: string;
7
+ install(app: App): void;
8
+ };
9
+ export { Breadcrumb, BreadcrumbItem };
10
+ export default Breadcrumb;
11
+ export * from './src/breadcrumb';
12
+ export * from './src/breadcrumb-item';
@@ -0,0 +1,13 @@
1
+ import { ExtractPropTypes } from 'vue';
2
+
3
+ export declare const breadcrumbItemProps: {
4
+ readonly to: {
5
+ readonly type: StringConstructor;
6
+ readonly default: "";
7
+ };
8
+ readonly replace: {
9
+ readonly type: BooleanConstructor;
10
+ readonly default: false;
11
+ };
12
+ };
13
+ export type BreadcrumbItemProps = ExtractPropTypes<typeof breadcrumbItemProps>;
@@ -0,0 +1,10 @@
1
+ import { ExtractPropTypes, InjectionKey } from 'vue';
2
+
3
+ export declare const breadcrumbProps: {
4
+ readonly separator: {
5
+ readonly type: StringConstructor;
6
+ readonly default: "/";
7
+ };
8
+ };
9
+ export type BreadcrumbProps = ExtractPropTypes<typeof breadcrumbProps>;
10
+ export declare const breadcrumbSeparatorKey: InjectionKey<string>;
@@ -0,0 +1,10 @@
1
+ import { App } from 'vue';
2
+ import { default as Button } from './src/button.vue';
3
+
4
+ export declare const ButtonPlugin: {
5
+ name: string;
6
+ install(app: App): void;
7
+ };
8
+ export { Button };
9
+ export default Button;
10
+ export * from './src/button';
@@ -0,0 +1,25 @@
1
+ import { ExtractPropTypes } from 'vue';
2
+
3
+ export declare const buttonProps: {
4
+ readonly type: {
5
+ readonly type: StringConstructor;
6
+ readonly default: "default";
7
+ };
8
+ readonly size: {
9
+ readonly type: StringConstructor;
10
+ readonly default: "medium";
11
+ };
12
+ readonly plain: BooleanConstructor;
13
+ readonly round: BooleanConstructor;
14
+ readonly disabled: BooleanConstructor;
15
+ readonly loading: BooleanConstructor;
16
+ /** 原生 button 的 type,默认 button(避免误触发表单提交) */
17
+ readonly 'native-type': {
18
+ readonly type: StringConstructor;
19
+ readonly default: "button";
20
+ };
21
+ };
22
+ export declare const buttonEmits: {
23
+ click: (e: MouseEvent) => boolean;
24
+ };
25
+ export type ButtonProps = ExtractPropTypes<typeof buttonProps>;
@@ -0,0 +1,10 @@
1
+ import { App } from 'vue';
2
+ import { default as DatePicker } from './src/date-picker.vue';
3
+
4
+ export declare const DatePickerPlugin: {
5
+ name: string;
6
+ install(app: App): void;
7
+ };
8
+ export { DatePicker };
9
+ export default DatePicker;
10
+ export * from './src/date-picker';
@@ -0,0 +1,20 @@
1
+ import { ExtractPropTypes } from 'vue';
2
+
3
+ export declare const datePickerProps: {
4
+ readonly modelValue: {
5
+ readonly type: StringConstructor;
6
+ readonly default: undefined;
7
+ };
8
+ readonly placeholder: {
9
+ readonly type: StringConstructor;
10
+ readonly default: "请选择日期";
11
+ };
12
+ readonly disabled: BooleanConstructor;
13
+ readonly clearable: BooleanConstructor;
14
+ };
15
+ export declare const datePickerEmits: {
16
+ 'update:modelValue': (val: string) => boolean;
17
+ change: (val: string) => boolean;
18
+ clear: () => boolean;
19
+ };
20
+ export type DatePickerProps = ExtractPropTypes<typeof datePickerProps>;
@@ -0,0 +1,12 @@
1
+ import { App } from 'vue';
2
+ import { default as Descriptions } from './src/descriptions.vue';
3
+ import { default as DescriptionsItem } from './src/descriptions-item.vue';
4
+
5
+ export declare const DescriptionsPlugin: {
6
+ name: string;
7
+ install(app: App): void;
8
+ };
9
+ export { Descriptions, DescriptionsItem };
10
+ export default Descriptions;
11
+ export * from './src/descriptions';
12
+ export * from './src/descriptions-item';
@@ -0,0 +1,13 @@
1
+ import { ExtractPropTypes } from 'vue';
2
+
3
+ export declare const descriptionsItemProps: {
4
+ readonly label: {
5
+ readonly type: StringConstructor;
6
+ readonly default: "";
7
+ };
8
+ readonly span: {
9
+ readonly type: NumberConstructor;
10
+ readonly default: 1;
11
+ };
12
+ };
13
+ export type DescriptionsItemProps = ExtractPropTypes<typeof descriptionsItemProps>;
@@ -0,0 +1,17 @@
1
+ import { ExtractPropTypes } from 'vue';
2
+
3
+ export declare const descriptionsProps: {
4
+ readonly title: {
5
+ readonly type: StringConstructor;
6
+ readonly default: "";
7
+ };
8
+ readonly column: {
9
+ readonly type: NumberConstructor;
10
+ readonly default: 3;
11
+ };
12
+ readonly border: {
13
+ readonly type: BooleanConstructor;
14
+ readonly default: false;
15
+ };
16
+ };
17
+ export type DescriptionsProps = ExtractPropTypes<typeof descriptionsProps>;
@@ -0,0 +1,10 @@
1
+ import { App } from 'vue';
2
+ import { default as Divider } from './src/divider.vue';
3
+
4
+ export declare const DividerPlugin: {
5
+ name: string;
6
+ install(app: App): void;
7
+ };
8
+ export { Divider };
9
+ export default Divider;
10
+ export * from './src/divider';
@@ -0,0 +1,20 @@
1
+ import { ExtractPropTypes } from 'vue';
2
+
3
+ export declare const dividerProps: {
4
+ /** 分割线方向 */
5
+ readonly direction: {
6
+ readonly type: StringConstructor;
7
+ readonly default: "horizontal";
8
+ };
9
+ /** 文案在分割线上的位置 */
10
+ readonly contentPosition: {
11
+ readonly type: StringConstructor;
12
+ readonly default: "center";
13
+ };
14
+ /** 是否使用虚线 */
15
+ readonly dashed: {
16
+ readonly type: BooleanConstructor;
17
+ readonly default: false;
18
+ };
19
+ };
20
+ export type DividerProps = ExtractPropTypes<typeof dividerProps>;
@@ -0,0 +1,12 @@
1
+ import { App } from 'vue';
2
+ import { default as Dropdown } from './src/dropdown.vue';
3
+ import { default as DropdownItem } from './src/dropdown-item.vue';
4
+
5
+ export declare const DropdownPlugin: {
6
+ name: string;
7
+ install(app: App): void;
8
+ };
9
+ export { Dropdown, DropdownItem };
10
+ export default Dropdown;
11
+ export * from './src/dropdown';
12
+ export * from './src/dropdown-item';
@@ -0,0 +1,20 @@
1
+ import { ExtractPropTypes } from 'vue';
2
+
3
+ export declare const dropdownItemProps: {
4
+ /** 点击时通过 command 事件回传的标识 */
5
+ readonly command: {
6
+ readonly type: [StringConstructor, NumberConstructor, ObjectConstructor, BooleanConstructor];
7
+ readonly default: undefined;
8
+ };
9
+ /** 是否禁用 */
10
+ readonly disabled: {
11
+ readonly type: BooleanConstructor;
12
+ readonly default: false;
13
+ };
14
+ /** 是否显示上方分隔线 */
15
+ readonly divided: {
16
+ readonly type: BooleanConstructor;
17
+ readonly default: false;
18
+ };
19
+ };
20
+ export type DropdownItemProps = ExtractPropTypes<typeof dropdownItemProps>;
@@ -0,0 +1,46 @@
1
+ import { ExtractPropTypes, InjectionKey } from 'vue';
2
+
3
+ export declare const dropdownProps: {
4
+ /** 触发方式:hover | click | contextmenu */
5
+ readonly trigger: {
6
+ readonly type: StringConstructor;
7
+ readonly default: "hover";
8
+ };
9
+ /** 面板弹出位置 */
10
+ readonly placement: {
11
+ readonly type: StringConstructor;
12
+ readonly default: "bottom-start";
13
+ };
14
+ /** 点击菜单项后是否自动关闭 */
15
+ readonly hideOnClick: {
16
+ readonly type: BooleanConstructor;
17
+ readonly default: true;
18
+ };
19
+ /** hover 打开延迟(ms) */
20
+ readonly showTimeout: {
21
+ readonly type: NumberConstructor;
22
+ readonly default: 150;
23
+ };
24
+ /** hover 关闭延迟(ms) */
25
+ readonly hideTimeout: {
26
+ readonly type: NumberConstructor;
27
+ readonly default: 150;
28
+ };
29
+ /** 是否禁用 */
30
+ readonly disabled: {
31
+ readonly type: BooleanConstructor;
32
+ readonly default: false;
33
+ };
34
+ };
35
+ export declare const dropdownEmits: {
36
+ /** 点击菜单项触发,参数为该项的 command */
37
+ command: (_command: unknown) => boolean;
38
+ /** 面板显隐变化 */
39
+ 'visible-change': (_visible: boolean) => boolean;
40
+ };
41
+ export type DropdownProps = ExtractPropTypes<typeof dropdownProps>;
42
+ /** 提供给 DropdownItem 的上下文 */
43
+ export interface DropdownContext {
44
+ handleItemClick: (command: unknown) => void;
45
+ }
46
+ export declare const dropdownContextKey: InjectionKey<DropdownContext>;