@farris/ui-vue 1.0.0-beta.5 → 1.0.0-beta.6

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 (93) hide show
  1. package/accordion/index.esm.js +2 -2
  2. package/accordion/package.json +1 -1
  3. package/avatar/index.esm.js +28 -1
  4. package/avatar/package.json +1 -1
  5. package/button/index.esm.js +111 -52
  6. package/button/index.umd.js +1 -1
  7. package/button/package.json +1 -1
  8. package/button-edit/index.esm.js +58 -4
  9. package/button-edit/index.umd.js +1 -1
  10. package/button-edit/package.json +1 -1
  11. package/checkbox/index.esm.js +38 -1
  12. package/checkbox/package.json +1 -1
  13. package/combo-list/index.esm.js +125 -5
  14. package/combo-list/package.json +1 -1
  15. package/data-grid/index.esm.js +235 -143
  16. package/data-grid/index.umd.js +1 -1
  17. package/data-grid/package.json +1 -1
  18. package/date-picker/index.esm.js +70 -13
  19. package/date-picker/index.umd.js +1 -1
  20. package/date-picker/package.json +1 -1
  21. package/farris.all.esm.js +1052 -533
  22. package/farris.all.umd.js +1 -1
  23. package/list-view/index.esm.js +3 -3
  24. package/list-view/index.umd.js +1 -1
  25. package/list-view/package.json +1 -1
  26. package/message-box/index.esm.js +35 -35
  27. package/message-box/index.umd.js +1 -1
  28. package/message-box/package.json +1 -1
  29. package/modal/index.esm.js +3 -3
  30. package/modal/index.umd.js +1 -1
  31. package/modal/package.json +1 -1
  32. package/notify/index.esm.js +2 -2
  33. package/notify/package.json +1 -1
  34. package/package.json +3 -2
  35. package/pagination/index.esm.js +4 -4
  36. package/pagination/index.umd.js +1 -1
  37. package/pagination/package.json +1 -1
  38. package/popover/index.esm.js +1 -1
  39. package/popover/package.json +1 -1
  40. package/radio-group/index.esm.js +28 -1
  41. package/radio-group/package.json +1 -1
  42. package/section/index.esm.js +1 -1
  43. package/section/package.json +1 -1
  44. package/switch/index.esm.js +4 -1
  45. package/switch/package.json +1 -1
  46. package/tabs/index.esm.js +6 -5
  47. package/tabs/index.umd.js +1 -1
  48. package/tabs/package.json +1 -1
  49. package/text/index.esm.js +4 -1
  50. package/text/package.json +1 -1
  51. package/tooltip/index.esm.js +1 -1
  52. package/tooltip/package.json +1 -1
  53. package/types/accordion/src/accordion.component.d.ts +4 -2
  54. package/types/accordion/src/components/accordion-item.component.d.ts +4 -2
  55. package/types/avatar/src/avatar.component.d.ts +4 -2
  56. package/types/button/index.d.ts +2 -1
  57. package/types/button/src/button-group.component.d.ts +4 -2
  58. package/types/button/src/button.component.d.ts +4 -2
  59. package/types/button-edit/src/button-edit.component.d.ts +141 -0
  60. package/types/checkbox/src/checkbox-group.component.d.ts +4 -2
  61. package/types/combo-list/src/combo-list.component.d.ts +232 -0
  62. package/types/combo-list/src/components/option.component.d.ts +4 -2
  63. package/types/combo-list/src/components/options.component.d.ts +4 -2
  64. package/types/combo-list/src/components/panel.component.d.ts +25 -0
  65. package/types/data-grid/src/components/editors/date-picker.component.d.ts +15 -0
  66. package/types/date-picker/src/components/calendar/calendar.component.d.ts +4 -2
  67. package/types/date-picker/src/components/calendar-navbar/calendar-navbar.component.d.ts +4 -2
  68. package/types/date-picker/src/components/date-picker-container/date-picker-container.component.d.ts +4 -2
  69. package/types/date-picker/src/components/month/month.component.d.ts +4 -2
  70. package/types/date-picker/src/components/year/year.component.d.ts +4 -2
  71. package/types/date-picker/src/date-picker.component.d.ts +336 -0
  72. package/types/list-view/src/components/list-view-checkbox.component.d.ts +4 -2
  73. package/types/list-view/src/list-view.component.d.ts +60 -0
  74. package/types/message-box/src/message-box.component.d.ts +4 -2
  75. package/types/message-box/src/message-box.service.d.ts +20 -0
  76. package/types/modal/src/modal.component.d.ts +4 -2
  77. package/types/notify/src/components/toast.component.d.ts +4 -2
  78. package/types/notify/src/notify.component.d.ts +130 -0
  79. package/types/notify/src/notify.service.d.ts +4 -0
  80. package/types/number-range/src/number-range.component.d.ts +4 -2
  81. package/types/number-spinner/src/number-spinner.component.d.ts +4 -2
  82. package/types/overlay/src/overlay.component.d.ts +4 -2
  83. package/types/pagination/src/pagination.components.d.ts +4 -2
  84. package/types/popover/src/popover.component.d.ts +4 -2
  85. package/types/radio-group/src/radio-group.component.d.ts +4 -2
  86. package/types/section/src/section.component.d.ts +4 -2
  87. package/types/switch/src/switch.component.d.ts +4 -2
  88. package/types/tabs/src/components/tab-page.component.d.ts +4 -2
  89. package/types/tabs/src/tabs.component.d.ts +4 -2
  90. package/types/text/src/text.component.d.ts +4 -2
  91. package/types/tooltip/src/composition/use-adjust-position.d.ts +15 -0
  92. package/types/tooltip/src/tooltip.component.d.ts +4 -2
  93. package/types/tooltip/src/tooltip.directive.d.ts +5 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "radio-group",
3
- "version": "1.0.0-beta.6",
3
+ "version": "1.0.0-beta.7",
4
4
  "main": "index.umd.js",
5
5
  "module": "index.es.js",
6
6
  "style": "style.css",
@@ -18,7 +18,7 @@ const v = {
18
18
  showToolbarMoreButton: { type: Boolean, default: !0 },
19
19
  clickThrottleTime: { type: Number, default: 350 },
20
20
  headerClass: { type: String, default: "" }
21
- }, i = C({
21
+ }, i = /* @__PURE__ */ C({
22
22
  name: "FSection",
23
23
  props: v,
24
24
  emits: [],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "section",
3
- "version": "1.0.0-beta.6",
3
+ "version": "1.0.0-beta.7",
4
4
  "main": "index.umd.js",
5
5
  "module": "index.es.js",
6
6
  "style": "style.css",
@@ -1,5 +1,8 @@
1
1
  import { defineComponent as y, toRefs as C, ref as k, computed as a, createVNode as l } from "vue";
2
2
  const b = {
3
+ /**
4
+ * 组件值
5
+ */
3
6
  modelValue: { type: Boolean, default: !1 },
4
7
  disable: { type: Boolean },
5
8
  onBackground: { type: String },
@@ -9,7 +12,7 @@ const b = {
9
12
  onLabel: { type: String },
10
13
  offLabel: { type: String },
11
14
  size: { type: String, default: "medium" }
12
- }, r = y({
15
+ }, r = /* @__PURE__ */ y({
13
16
  name: "FSwitch",
14
17
  props: b,
15
18
  emits: ["update:modelValue"],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "switch",
3
- "version": "1.0.0-beta.6",
3
+ "version": "1.0.0-beta.7",
4
4
  "main": "index.umd.js",
5
5
  "module": "index.es.js",
6
6
  "style": "style.css",
package/tabs/index.esm.js CHANGED
@@ -53,7 +53,7 @@ function be(t, m, o) {
53
53
  if (t.autoTitleWidth)
54
54
  return;
55
55
  const f = (g = u.value) == null ? void 0 : g.querySelectorAll(".st-tab-text");
56
- if (!!f)
56
+ if (f)
57
57
  for (let y = 0; y < f.length; y++) {
58
58
  const k = f[y].parentNode;
59
59
  f[y].scrollWidth > k.offsetWidth ? f[y].classList.contains("farris-title-text-custom") || f[y].classList.add("farris-title-text-custom") : f[y].classList.remove("farris-title-text-custom");
@@ -76,7 +76,7 @@ function be(t, m, o) {
76
76
  selectTabByTabId: B
77
77
  };
78
78
  }
79
- const V = H({
79
+ const V = /* @__PURE__ */ H({
80
80
  name: "FTabs",
81
81
  props: pe,
82
82
  emits: ["tabChange", "tabRemove"],
@@ -203,6 +203,7 @@ const V = H({
203
203
  }), te = p(() => ({
204
204
  spacer: !0,
205
205
  "f-utils-fill": !0,
206
+ // 'spacer-sides': !hideButtons.value && hideDropDown.value,
206
207
  "spacer-sides-dropdown": !b.value
207
208
  })), le = p(() => ({
208
209
  nav: !0,
@@ -314,7 +315,7 @@ const V = H({
314
315
  class: "dropdown-title"
315
316
  }, [d.props.title])]))]) : s("div", {
316
317
  class: "dropdown-no-data"
317
- }, [re("\u6CA1\u6709\u76F8\u5173\u6570\u636E")])])])]), T.value && s("div", {
318
+ }, [re("没有相关数据")])])])]), T.value && s("div", {
318
319
  class: "farris-tabs-toolbar"
319
320
  }, [(l = (e = T.value) == null ? void 0 : e.toolbarExtra) == null ? void 0 : l.call(e)])]), s("div", {
320
321
  class: "farris-tabs-content"
@@ -333,7 +334,7 @@ const V = H({
333
334
  show: { type: Boolean, default: !0 },
334
335
  toolbar: { type: Object },
335
336
  toolbarPosition: { type: String, default: "inContent" }
336
- }, F = H({
337
+ }, F = /* @__PURE__ */ H({
337
338
  name: "FTabPage",
338
339
  props: he,
339
340
  emits: [],
@@ -346,7 +347,7 @@ const V = H({
346
347
  };
347
348
  M(() => {
348
349
  const a = o == null ? void 0 : o.tabs.value.findIndex((c) => c.props.id === t.id);
349
- !a || a === -1 ? o == null || o.addTab(b) : a > -1 && (i.value = !1, console.warn(`\u5DF2\u7ECF\u5B58\u5728id\u4E3A${t.id}\u7684\u9875\u7B7E\u5566`));
350
+ !a || a === -1 ? o == null || o.addTab(b) : a > -1 && (i.value = !1, console.warn(`已经存在id为${t.id}的页签啦`));
350
351
  }), fe(() => {
351
352
  });
352
353
  function h() {
package/tabs/index.umd.js CHANGED
@@ -1 +1 @@
1
- (function(b,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(b=typeof globalThis<"u"?globalThis:b||self,e(b.tabs={},b.Vue))})(this,function(b,e){"use strict";const L={tabType:{type:String,default:"default"},autoTitleWidth:{type:Boolean,default:!1},titleLength:{type:Number,default:7},position:{type:String,default:"top"},showDropDwon:{type:Boolean,default:!1},showTooltips:{type:Boolean,default:!1},scrollStep:{type:Number,default:10},autoResize:{type:Boolean,default:!1},closeable:{type:Boolean,default:!1},selectedTab:{type:String,default:""},width:{type:Number},height:{type:Number},searchBoxVisible:{type:Boolean,default:!0},titleWidth:{type:Number,default:0},customClass:{type:String,default:""},activeId:{type:String},fill:{type:Boolean,default:!1}},oe="";function M(l,h,n){function i(r){const f=r.value.findIndex(g=>g.props.show!==!1&&!n.value&&!g.props.disabled);!n.value&&f!==-1&&(n.value=r.value[f].props.id)}function m(r){return{width:`${r.tabWidth}px`}}function v(r){return{"nav-item":!0,"d-none":r.show!==void 0?!r.show:!1,"f-state-active":r.id===n.value,"f-state-disable":r.disabled}}function o(r){return{"nav-link":!0,"tabs-text-truncate":!0,active:r.id===n.value,disabled:r.disabled}}function u(r){return{"st-tab-text":!0,"farris-title-auto":l.autoTitleWidth}}function y(r){var g;if(l.autoTitleWidth)return;const f=(g=r.value)==null?void 0:g.querySelectorAll(".st-tab-text");if(!!f)for(let T=0;T<f.length;T++){const k=f[T].parentNode;f[T].scrollWidth>k.offsetWidth?f[T].classList.contains("farris-title-text-custom")||f[T].classList.add("farris-title-text-custom"):f[T].classList.remove("farris-title-text-custom")}}function C(r,f){const g=n.value;n.value=f,h.emit("tabChange",{prevId:g,nextId:n.value}),r.preventDefault(),r.stopPropagation()}return{setActiveId:i,getTabStyle:m,getTabClass:v,getTabNavLinkClass:o,getTabTextClass:u,changeTitleStyle:y,selectTabByTabId:C}}const S=e.defineComponent({name:"FTabs",props:L,emits:["tabChange","tabRemove"],setup(l,h){const n=e.shallowRef(),i=e.shallowRef(),m=e.ref(!0),v=e.ref(!0),o=e.ref([]),u=e.ref(l.activeId),y=e.computed(()=>{const t=o.value.find(a=>a.props.id===u.value);return t==null?void 0:t.slots}),C=e.computed(()=>{const t=o.value.find(s=>s.props.id===u.value);return(t==null?void 0:t.props.toolbarPosition)==="inHead"}),r=e.ref("atuo"),f=e.ref(""),{setActiveId:g,getTabStyle:T,getTabClass:k,getTabNavLinkClass:H,getTabTextClass:j,changeTitleStyle:P,selectTabByTabId:E}=M(l,h,u),x=()=>{var a;const t=(a=i.value)==null?void 0:a.parentElement;!t||!i.value||(t.offsetWidth<i.value.scrollWidth?m.value=!1:m.value=!0)},I=t=>{t.preventDefault(),t.stopPropagation()},V=(t,a)=>{if(!i.value)return;const s=i.value.scrollLeft,d=i.value.scrollWidth-i.value.offsetWidth;if(a>0){if(i.value.scrollLeft>=d)return;i.value.scrollLeft=s+l.scrollStep+t}else if(a<0){if(i.value.scrollLeft<=0)return;i.value.scrollLeft=s-l.scrollStep-t}},R=t=>{if(m.value||!i.value)return;const a=i.value.querySelectorAll(".nav-item"),{parentElement:s}=i.value,d=a[t];if(d&&s){const c=s.getBoundingClientRect().left,p=s.getBoundingClientRect().right,N=d.getBoundingClientRect().left,w=d.getBoundingClientRect().right;N<c?V(c-N,-1):p<w&&V(w-p,1)}},q=t=>{o.value.findIndex(s=>s.props.id===t.props.id)===-1&&o.value.push(t),e.nextTick(()=>{x()})},U=t=>{o.value.findIndex(s=>s.props.id===t.props.id)!==-1&&(o.value.forEach(s=>{s.props.id===t.props.id&&(s=t)}),e.nextTick(()=>{P(i),x()}))};function A(t,a,s=!1){o.value.findIndex(d=>d.props.id===a),o.value=o.value.filter(d=>d.props.id!==a),u.value===a&&(u.value="",g(o)),I(t),e.nextTick(()=>{P(i),x(),s&&(v.value=!0);const d=o.value.findIndex(c=>c.props.id===u.value);R(d),h.emit("tabRemove",{removeIndex:d,removeId:a,activeId:u.value})})}e.provide("tabs",{activeId:u,addTab:q,updateTab:U,tabs:o});const _=e.computed(()=>l.fill||l.tabType==="fill"),O=e.computed(()=>l.tabType==="pills"),z=e.computed(()=>({"farris-tabs-header":!0,"farris-tabs-inHead":C.value,"farris-tabs-inContent":!C.value,"farris-tabs-nav-fill":_.value,"farris-tabs-nav-pills":O.value})),$=e.computed(()=>({width:C.value&&l.titleWidth?`${l.titleWidth}%`:""})),G=e.computed(()=>({btn:!0,"sc-nav-btn":!0,"px-1":!0,"sc-nav-lr":!0,"d-none":m.value})),J=e.computed(()=>({"btn-group":!0,"sc-nav-btn":!0,dropdown:!0,"d-none":m.value})),K=e.computed(()=>({"dropdown-menu":!0,"tabs-pt28":l.searchBoxVisible,show:!v.value})),Q=e.computed(()=>({btn:!0,"sc-nav-rg":!0,"d-none":m.value})),X=()=>({width:r.value}),Y=t=>({"dropdown-item":!0,"text-truncate":!0,"px-2":!0,disabled:t.props.disabled,active:t.props.id===u.value,"d-none":t.props.show!==!0}),Z=(t,a)=>{if(a.disabled)return;E(t,a.id);const s=o.value.findIndex(d=>d.props.id===a.id);v.value=!0,e.nextTick(()=>{x(),R(s)})},D=e.computed(()=>{var a,s;let t=[];return l.searchBoxVisible?t=(a=o.value)==null?void 0:a.filter(d=>d.props.title.includes(f.value)):t=(s=o.value)==null?void 0:s.slice(),t}),ee=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":!m.value})),te=e.computed(()=>({nav:!0,"farris-nav-tabs":!0,"flex-nowrap":!0,"nav-fill":l.fill||l.tabType==="fill","nav-pills":l.tabType==="pills","flex-row":l.position==="top"||l.position==="bottom","flex-column":l.position==="left"||l.position==="right"})),le=e.computed(()=>({"farris-tabs":!0,"flex-column":l.position==="top","flex-column-reverse":l.position==="bottom","flex-row":l.position==="left","flex-row-reverse":l.position==="right"})),ae=(t,a)=>{E(t,a),e.nextTick(()=>{x()})};return e.onMounted(()=>{e.nextTick(()=>{P(i),window.addEventListener("click",t=>{var a;v.value||(a=n.value)!=null&&a.contains(t.target)||(v.value=!0)}),window.addEventListener("resize",t=>{x()})})}),()=>{var t,a,s,d;return e.createVNode(e.Fragment,null,[e.createVNode("div",{class:le.value,ref:n},[e.createVNode("div",{class:z.value},[e.createVNode("div",{class:"farris-tabs-title scroll-tabs",style:$.value},[e.createVNode("button",{title:"left-arrow-button",type:"button",class:G.value,onClick:()=>{V(0,-1)}},null),e.createVNode("div",{class:ee.value,style:"width:100%"},[e.createVNode("ul",{class:te.value,ref:i},[o.value.map(c=>{const p=c.props,N=c.slots.title;return e.createVNode("li",{class:k(p),style:T(p)},[e.createVNode("a",{class:H(p),onClick:w=>ae(w,p.id)},[N?N():e.createVNode("span",{class:j(p),title:p.title},[p.title]),p.removeable&&e.createVNode("span",{class:"st-drop-close",onClick:w=>A(w,p.id)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)])])])})])]),e.createVNode("div",{class:J.value},[e.createVNode("button",{title:"right-arrow-button",type:"button",class:Q.value,onClick:()=>{V(0,1)}},null),e.createVNode("button",{title:"toggle-button",class:"btn dropdown-toggle-split dropdown-toggle",onClick:()=>{v.value=!1}},null),e.createVNode("div",{class:K.value},[l.searchBoxVisible&&e.createVNode("div",{onClick:c=>I(c),class:"pb-1 tabs-li-absolute"},[e.withDirectives(e.createVNode("input",{title:"search-box",type:"text",class:"form-control k-textbox","onUpdate:modelValue":c=>f.value=c},null),[[e.vModelText,f.value]]),e.createVNode("span",{class:"f-icon f-icon-page-title-query tabs-icon-search"},null)]),D.value.length?e.createVNode("ul",{class:"tab-dropdown-menu--items",style:X()},[D.value.map(c=>e.createVNode("li",{class:Y(c),onClick:p=>Z(p,c.props)},[c.props.removeable&&e.createVNode("span",{class:"float-right st-drop-close",onClick:p=>A(p,c.props.id,!0)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)]),e.createVNode("a",{class:"dropdown-title"},[c.props.title])]))]):e.createVNode("div",{class:"dropdown-no-data"},[e.createTextVNode("\u6CA1\u6709\u76F8\u5173\u6570\u636E")])])])]),y.value&&e.createVNode("div",{class:"farris-tabs-toolbar"},[(a=(t=y.value)==null?void 0:t.toolbarExtra)==null?void 0:a.call(t)])]),e.createVNode("div",{class:"farris-tabs-content"},[(d=(s=h.slots).default)==null?void 0:d.call(s)])])])}}}),W={tabWidth:{type:Number,default:-1},id:{type:String,default:""},customTitleClass:{type:String,default:""},titleOverflow:{type:Boolean,default:!1},title:{type:String,default:""},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},removeable:{type:Boolean,default:!1},show:{type:Boolean,default:!0},toolbar:{type:Object},toolbarPosition:{type:String,default:"inContent"}},B=e.defineComponent({name:"FTabPage",props:W,emits:[],setup(l,h){const n=e.inject("tabs");e.getCurrentInstance();const i=e.ref(!0),m={slots:h.slots,props:l};e.onMounted(()=>{const o=n==null?void 0:n.tabs.value.findIndex(u=>u.props.id===l.id);!o||o===-1?n==null||n.addTab(m):o>-1&&(i.value=!1,console.warn(`\u5DF2\u7ECF\u5B58\u5728id\u4E3A${l.id}\u7684\u9875\u7B7E\u5566`))}),e.onUnmounted(()=>{});function v(){return{display:(l==null?void 0:l.id)===(n==null?void 0:n.activeId.value)?"":"none"}}return e.watch(()=>l,o=>{n==null||n.updateTab({props:o,slots:h.slots})},{immediate:!0,deep:!0}),()=>{var u,y;const o=(y=(u=h.slots).default)==null?void 0:y.call(u);return i.value?e.createVNode("div",{class:"farris-tab-page",style:v()},[o]):null}}}),F={install(l){l.component(S.name,S),l.component(B.name,B)}};b.TabPage=B,b.Tabs=S,b.default=F,b.tabPageProps=W,b.tabsProps=L,Object.defineProperties(b,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(b,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(b=typeof globalThis<"u"?globalThis:b||self,e(b.tabs={},b.Vue))})(this,function(b,e){"use strict";const L={tabType:{type:String,default:"default"},autoTitleWidth:{type:Boolean,default:!1},titleLength:{type:Number,default:7},position:{type:String,default:"top"},showDropDwon:{type:Boolean,default:!1},showTooltips:{type:Boolean,default:!1},scrollStep:{type:Number,default:10},autoResize:{type:Boolean,default:!1},closeable:{type:Boolean,default:!1},selectedTab:{type:String,default:""},width:{type:Number},height:{type:Number},searchBoxVisible:{type:Boolean,default:!0},titleWidth:{type:Number,default:0},customClass:{type:String,default:""},activeId:{type:String},fill:{type:Boolean,default:!1}},oe="";function M(l,h,n){function i(r){const f=r.value.findIndex(g=>g.props.show!==!1&&!n.value&&!g.props.disabled);!n.value&&f!==-1&&(n.value=r.value[f].props.id)}function m(r){return{width:`${r.tabWidth}px`}}function v(r){return{"nav-item":!0,"d-none":r.show!==void 0?!r.show:!1,"f-state-active":r.id===n.value,"f-state-disable":r.disabled}}function o(r){return{"nav-link":!0,"tabs-text-truncate":!0,active:r.id===n.value,disabled:r.disabled}}function u(r){return{"st-tab-text":!0,"farris-title-auto":l.autoTitleWidth}}function y(r){var g;if(l.autoTitleWidth)return;const f=(g=r.value)==null?void 0:g.querySelectorAll(".st-tab-text");if(f)for(let T=0;T<f.length;T++){const k=f[T].parentNode;f[T].scrollWidth>k.offsetWidth?f[T].classList.contains("farris-title-text-custom")||f[T].classList.add("farris-title-text-custom"):f[T].classList.remove("farris-title-text-custom")}}function C(r,f){const g=n.value;n.value=f,h.emit("tabChange",{prevId:g,nextId:n.value}),r.preventDefault(),r.stopPropagation()}return{setActiveId:i,getTabStyle:m,getTabClass:v,getTabNavLinkClass:o,getTabTextClass:u,changeTitleStyle:y,selectTabByTabId:C}}const S=e.defineComponent({name:"FTabs",props:L,emits:["tabChange","tabRemove"],setup(l,h){const n=e.shallowRef(),i=e.shallowRef(),m=e.ref(!0),v=e.ref(!0),o=e.ref([]),u=e.ref(l.activeId),y=e.computed(()=>{const t=o.value.find(a=>a.props.id===u.value);return t==null?void 0:t.slots}),C=e.computed(()=>{const t=o.value.find(s=>s.props.id===u.value);return(t==null?void 0:t.props.toolbarPosition)==="inHead"}),r=e.ref("atuo"),f=e.ref(""),{setActiveId:g,getTabStyle:T,getTabClass:k,getTabNavLinkClass:H,getTabTextClass:j,changeTitleStyle:P,selectTabByTabId:E}=M(l,h,u),x=()=>{var a;const t=(a=i.value)==null?void 0:a.parentElement;!t||!i.value||(t.offsetWidth<i.value.scrollWidth?m.value=!1:m.value=!0)},I=t=>{t.preventDefault(),t.stopPropagation()},V=(t,a)=>{if(!i.value)return;const s=i.value.scrollLeft,d=i.value.scrollWidth-i.value.offsetWidth;if(a>0){if(i.value.scrollLeft>=d)return;i.value.scrollLeft=s+l.scrollStep+t}else if(a<0){if(i.value.scrollLeft<=0)return;i.value.scrollLeft=s-l.scrollStep-t}},R=t=>{if(m.value||!i.value)return;const a=i.value.querySelectorAll(".nav-item"),{parentElement:s}=i.value,d=a[t];if(d&&s){const c=s.getBoundingClientRect().left,p=s.getBoundingClientRect().right,N=d.getBoundingClientRect().left,w=d.getBoundingClientRect().right;N<c?V(c-N,-1):p<w&&V(w-p,1)}},q=t=>{o.value.findIndex(s=>s.props.id===t.props.id)===-1&&o.value.push(t),e.nextTick(()=>{x()})},U=t=>{o.value.findIndex(s=>s.props.id===t.props.id)!==-1&&(o.value.forEach(s=>{s.props.id===t.props.id&&(s=t)}),e.nextTick(()=>{P(i),x()}))};function A(t,a,s=!1){o.value.findIndex(d=>d.props.id===a),o.value=o.value.filter(d=>d.props.id!==a),u.value===a&&(u.value="",g(o)),I(t),e.nextTick(()=>{P(i),x(),s&&(v.value=!0);const d=o.value.findIndex(c=>c.props.id===u.value);R(d),h.emit("tabRemove",{removeIndex:d,removeId:a,activeId:u.value})})}e.provide("tabs",{activeId:u,addTab:q,updateTab:U,tabs:o});const _=e.computed(()=>l.fill||l.tabType==="fill"),O=e.computed(()=>l.tabType==="pills"),z=e.computed(()=>({"farris-tabs-header":!0,"farris-tabs-inHead":C.value,"farris-tabs-inContent":!C.value,"farris-tabs-nav-fill":_.value,"farris-tabs-nav-pills":O.value})),$=e.computed(()=>({width:C.value&&l.titleWidth?`${l.titleWidth}%`:""})),G=e.computed(()=>({btn:!0,"sc-nav-btn":!0,"px-1":!0,"sc-nav-lr":!0,"d-none":m.value})),J=e.computed(()=>({"btn-group":!0,"sc-nav-btn":!0,dropdown:!0,"d-none":m.value})),K=e.computed(()=>({"dropdown-menu":!0,"tabs-pt28":l.searchBoxVisible,show:!v.value})),Q=e.computed(()=>({btn:!0,"sc-nav-rg":!0,"d-none":m.value})),X=()=>({width:r.value}),Y=t=>({"dropdown-item":!0,"text-truncate":!0,"px-2":!0,disabled:t.props.disabled,active:t.props.id===u.value,"d-none":t.props.show!==!0}),Z=(t,a)=>{if(a.disabled)return;E(t,a.id);const s=o.value.findIndex(d=>d.props.id===a.id);v.value=!0,e.nextTick(()=>{x(),R(s)})},D=e.computed(()=>{var a,s;let t=[];return l.searchBoxVisible?t=(a=o.value)==null?void 0:a.filter(d=>d.props.title.includes(f.value)):t=(s=o.value)==null?void 0:s.slice(),t}),ee=e.computed(()=>({spacer:!0,"f-utils-fill":!0,"spacer-sides-dropdown":!m.value})),te=e.computed(()=>({nav:!0,"farris-nav-tabs":!0,"flex-nowrap":!0,"nav-fill":l.fill||l.tabType==="fill","nav-pills":l.tabType==="pills","flex-row":l.position==="top"||l.position==="bottom","flex-column":l.position==="left"||l.position==="right"})),le=e.computed(()=>({"farris-tabs":!0,"flex-column":l.position==="top","flex-column-reverse":l.position==="bottom","flex-row":l.position==="left","flex-row-reverse":l.position==="right"})),ae=(t,a)=>{E(t,a),e.nextTick(()=>{x()})};return e.onMounted(()=>{e.nextTick(()=>{P(i),window.addEventListener("click",t=>{var a;v.value||(a=n.value)!=null&&a.contains(t.target)||(v.value=!0)}),window.addEventListener("resize",t=>{x()})})}),()=>{var t,a,s,d;return e.createVNode(e.Fragment,null,[e.createVNode("div",{class:le.value,ref:n},[e.createVNode("div",{class:z.value},[e.createVNode("div",{class:"farris-tabs-title scroll-tabs",style:$.value},[e.createVNode("button",{title:"left-arrow-button",type:"button",class:G.value,onClick:()=>{V(0,-1)}},null),e.createVNode("div",{class:ee.value,style:"width:100%"},[e.createVNode("ul",{class:te.value,ref:i},[o.value.map(c=>{const p=c.props,N=c.slots.title;return e.createVNode("li",{class:k(p),style:T(p)},[e.createVNode("a",{class:H(p),onClick:w=>ae(w,p.id)},[N?N():e.createVNode("span",{class:j(p),title:p.title},[p.title]),p.removeable&&e.createVNode("span",{class:"st-drop-close",onClick:w=>A(w,p.id)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)])])])})])]),e.createVNode("div",{class:J.value},[e.createVNode("button",{title:"right-arrow-button",type:"button",class:Q.value,onClick:()=>{V(0,1)}},null),e.createVNode("button",{title:"toggle-button",class:"btn dropdown-toggle-split dropdown-toggle",onClick:()=>{v.value=!1}},null),e.createVNode("div",{class:K.value},[l.searchBoxVisible&&e.createVNode("div",{onClick:c=>I(c),class:"pb-1 tabs-li-absolute"},[e.withDirectives(e.createVNode("input",{title:"search-box",type:"text",class:"form-control k-textbox","onUpdate:modelValue":c=>f.value=c},null),[[e.vModelText,f.value]]),e.createVNode("span",{class:"f-icon f-icon-page-title-query tabs-icon-search"},null)]),D.value.length?e.createVNode("ul",{class:"tab-dropdown-menu--items",style:X()},[D.value.map(c=>e.createVNode("li",{class:Y(c),onClick:p=>Z(p,c.props)},[c.props.removeable&&e.createVNode("span",{class:"float-right st-drop-close",onClick:p=>A(p,c.props.id,!0)},[e.createVNode("i",{class:"f-icon f-icon-close"},null)]),e.createVNode("a",{class:"dropdown-title"},[c.props.title])]))]):e.createVNode("div",{class:"dropdown-no-data"},[e.createTextVNode("没有相关数据")])])])]),y.value&&e.createVNode("div",{class:"farris-tabs-toolbar"},[(a=(t=y.value)==null?void 0:t.toolbarExtra)==null?void 0:a.call(t)])]),e.createVNode("div",{class:"farris-tabs-content"},[(d=(s=h.slots).default)==null?void 0:d.call(s)])])])}}}),W={tabWidth:{type:Number,default:-1},id:{type:String,default:""},customTitleClass:{type:String,default:""},titleOverflow:{type:Boolean,default:!1},title:{type:String,default:""},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},removeable:{type:Boolean,default:!1},show:{type:Boolean,default:!0},toolbar:{type:Object},toolbarPosition:{type:String,default:"inContent"}},B=e.defineComponent({name:"FTabPage",props:W,emits:[],setup(l,h){const n=e.inject("tabs");e.getCurrentInstance();const i=e.ref(!0),m={slots:h.slots,props:l};e.onMounted(()=>{const o=n==null?void 0:n.tabs.value.findIndex(u=>u.props.id===l.id);!o||o===-1?n==null||n.addTab(m):o>-1&&(i.value=!1,console.warn(`已经存在id为${l.id}的页签啦`))}),e.onUnmounted(()=>{});function v(){return{display:(l==null?void 0:l.id)===(n==null?void 0:n.activeId.value)?"":"none"}}return e.watch(()=>l,o=>{n==null||n.updateTab({props:o,slots:h.slots})},{immediate:!0,deep:!0}),()=>{var u,y;const o=(y=(u=h.slots).default)==null?void 0:y.call(u);return i.value?e.createVNode("div",{class:"farris-tab-page",style:v()},[o]):null}}}),F={install(l){l.component(S.name,S),l.component(B.name,B)}};b.TabPage=B,b.Tabs=S,b.default=F,b.tabPageProps=W,b.tabsProps=L,Object.defineProperties(b,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/tabs/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tabs",
3
- "version": "1.0.0-beta.6",
3
+ "version": "1.0.0-beta.7",
4
4
  "main": "index.umd.js",
5
5
  "module": "index.es.js",
6
6
  "style": "style.css",
package/text/index.esm.js CHANGED
@@ -1,7 +1,10 @@
1
1
  import { defineComponent as i, ref as e, computed as l, createVNode as p } from "vue";
2
2
  const v = {
3
+ /**
4
+ * 组件值
5
+ */
3
6
  modelValue: { type: String, default: "" }
4
- }, s = i({
7
+ }, s = /* @__PURE__ */ i({
5
8
  name: "FText",
6
9
  props: v,
7
10
  emits: ["update:modelValue"],
package/text/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "text",
3
- "version": "1.0.0-beta.6",
3
+ "version": "1.0.0-beta.7",
4
4
  "main": "index.umd.js",
5
5
  "module": "index.es.js",
6
6
  "style": "style.css",
@@ -91,7 +91,7 @@ function G(i, m, p, l, f, s) {
91
91
  });
92
92
  return { tooltipPlacement: u, tooltipPosition: n };
93
93
  }
94
- const S = L({
94
+ const S = /* @__PURE__ */ L({
95
95
  name: "FTooltip",
96
96
  props: C,
97
97
  emits: ["click"],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tooltip",
3
- "version": "1.0.0-beta.6",
3
+ "version": "1.0.0-beta.7",
4
4
  "main": "index.umd.js",
5
5
  "module": "index.es.js",
6
6
  "style": "style.css",
@@ -30,7 +30,7 @@ declare const _default: import("vue").DefineComponent<{
30
30
  type: BooleanConstructor;
31
31
  default: boolean;
32
32
  };
33
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
33
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
34
34
  customClass: {
35
35
  type: {
36
36
  (arrayLength: number): string[];
@@ -62,7 +62,9 @@ declare const _default: import("vue").DefineComponent<{
62
62
  type: BooleanConstructor;
63
63
  default: boolean;
64
64
  };
65
- }>>, {
65
+ }>> & {
66
+ [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
67
+ }, {
66
68
  customClass: string[];
67
69
  enableFold: boolean;
68
70
  expanded: boolean;
@@ -14,7 +14,7 @@ declare const _default: import("vue").DefineComponent<{
14
14
  type: BooleanConstructor;
15
15
  default: boolean;
16
16
  };
17
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
17
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
18
18
  width: {
19
19
  type: NumberConstructor;
20
20
  };
@@ -30,7 +30,9 @@ declare const _default: import("vue").DefineComponent<{
30
30
  type: BooleanConstructor;
31
31
  default: boolean;
32
32
  };
33
- }>>, {
33
+ }>> & {
34
+ [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
35
+ }, {
34
36
  height: number;
35
37
  title: string;
36
38
  disable: boolean;
@@ -47,7 +47,7 @@ declare const _default: import("vue").DefineComponent<{
47
47
  };
48
48
  default: never[];
49
49
  };
50
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "change" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
50
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
51
51
  avatarWidth: {
52
52
  type: NumberConstructor;
53
53
  default: number;
@@ -96,7 +96,9 @@ declare const _default: import("vue").DefineComponent<{
96
96
  };
97
97
  default: never[];
98
98
  };
99
- }>>, {
99
+ }>> & {
100
+ [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
101
+ }, {
100
102
  type: string[];
101
103
  avatarWidth: number;
102
104
  avatarHeight: number;
@@ -15,9 +15,10 @@
15
15
  */
16
16
  import type { App } from 'vue';
17
17
  import FButton from './src/button.component';
18
+ import FButtonGroup from './src/button-group.component';
18
19
  export * from './src/button.props';
19
20
  export * from './src/button-group.props';
20
- export { FButton };
21
+ export { FButton, FButtonGroup };
21
22
  declare const _default: {
22
23
  install(app: App): void;
23
24
  };
@@ -45,7 +45,7 @@ declare const _default: import("vue").DefineComponent<{
45
45
  type: BooleanConstructor;
46
46
  default: boolean;
47
47
  };
48
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "change" | "click" | "changeState" | "clickMenuOut", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
48
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
49
49
  id: StringConstructor;
50
50
  rectifyReferenceH: {
51
51
  type: ObjectConstructor;
@@ -92,7 +92,9 @@ declare const _default: import("vue").DefineComponent<{
92
92
  type: BooleanConstructor;
93
93
  default: boolean;
94
94
  };
95
- }>>, {
95
+ }>> & {
96
+ [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
97
+ }, {
96
98
  type: string;
97
99
  size: string;
98
100
  autoRectify: boolean;
@@ -12,7 +12,7 @@ declare const _default: import("vue").DefineComponent<{
12
12
  type: import("vue").PropType<"small" | "large">;
13
13
  default: string;
14
14
  };
15
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
15
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
16
16
  id: StringConstructor;
17
17
  type: {
18
18
  type: import("vue").PropType<"link" | "primary" | "warning" | "danger" | "success" | "secondary">;
@@ -26,7 +26,9 @@ declare const _default: import("vue").DefineComponent<{
26
26
  type: import("vue").PropType<"small" | "large">;
27
27
  default: string;
28
28
  };
29
- }>>, {
29
+ }>> & {
30
+ [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
31
+ }, {
30
32
  type: "link" | "primary" | "warning" | "danger" | "success" | "secondary";
31
33
  disabled: boolean;
32
34
  size: "small" | "large";
@@ -0,0 +1,141 @@
1
+ declare const _default: import("vue").DefineComponent<{
2
+ id: StringConstructor;
3
+ buttonContent: {
4
+ type: StringConstructor;
5
+ default: string;
6
+ };
7
+ autoComplete: {
8
+ type: BooleanConstructor;
9
+ default: boolean;
10
+ };
11
+ customClass: {
12
+ type: StringConstructor;
13
+ default: string;
14
+ };
15
+ disable: {
16
+ type: BooleanConstructor;
17
+ default: boolean;
18
+ };
19
+ editable: {
20
+ type: BooleanConstructor;
21
+ default: boolean;
22
+ };
23
+ enableClear: {
24
+ type: BooleanConstructor;
25
+ default: boolean;
26
+ };
27
+ modelValue: {
28
+ type: StringConstructor;
29
+ default: string;
30
+ };
31
+ readonly: {
32
+ type: BooleanConstructor;
33
+ default: boolean;
34
+ };
35
+ textAlign: {
36
+ type: import("vue").PropType<"left" | "right" | "center">;
37
+ default: string;
38
+ };
39
+ showButtonWhenDisabled: {
40
+ type: BooleanConstructor;
41
+ default: boolean;
42
+ };
43
+ enableTitle: {
44
+ type: BooleanConstructor;
45
+ default: boolean;
46
+ };
47
+ inputType: {
48
+ type: StringConstructor;
49
+ default: string;
50
+ };
51
+ forcePlaceholder: {
52
+ type: BooleanConstructor;
53
+ default: boolean;
54
+ };
55
+ placeholder: {
56
+ type: StringConstructor;
57
+ default: string;
58
+ };
59
+ minLength: NumberConstructor;
60
+ maxLength: NumberConstructor;
61
+ tabIndex: NumberConstructor;
62
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
63
+ id: StringConstructor;
64
+ buttonContent: {
65
+ type: StringConstructor;
66
+ default: string;
67
+ };
68
+ autoComplete: {
69
+ type: BooleanConstructor;
70
+ default: boolean;
71
+ };
72
+ customClass: {
73
+ type: StringConstructor;
74
+ default: string;
75
+ };
76
+ disable: {
77
+ type: BooleanConstructor;
78
+ default: boolean;
79
+ };
80
+ editable: {
81
+ type: BooleanConstructor;
82
+ default: boolean;
83
+ };
84
+ enableClear: {
85
+ type: BooleanConstructor;
86
+ default: boolean;
87
+ };
88
+ modelValue: {
89
+ type: StringConstructor;
90
+ default: string;
91
+ };
92
+ readonly: {
93
+ type: BooleanConstructor;
94
+ default: boolean;
95
+ };
96
+ textAlign: {
97
+ type: import("vue").PropType<"left" | "right" | "center">;
98
+ default: string;
99
+ };
100
+ showButtonWhenDisabled: {
101
+ type: BooleanConstructor;
102
+ default: boolean;
103
+ };
104
+ enableTitle: {
105
+ type: BooleanConstructor;
106
+ default: boolean;
107
+ };
108
+ inputType: {
109
+ type: StringConstructor;
110
+ default: string;
111
+ };
112
+ forcePlaceholder: {
113
+ type: BooleanConstructor;
114
+ default: boolean;
115
+ };
116
+ placeholder: {
117
+ type: StringConstructor;
118
+ default: string;
119
+ };
120
+ minLength: NumberConstructor;
121
+ maxLength: NumberConstructor;
122
+ tabIndex: NumberConstructor;
123
+ }>> & {
124
+ [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
125
+ }, {
126
+ customClass: string;
127
+ disable: boolean;
128
+ readonly: boolean;
129
+ modelValue: string;
130
+ buttonContent: string;
131
+ autoComplete: boolean;
132
+ editable: boolean;
133
+ enableClear: boolean;
134
+ textAlign: "left" | "right" | "center";
135
+ showButtonWhenDisabled: boolean;
136
+ enableTitle: boolean;
137
+ inputType: string;
138
+ forcePlaceholder: boolean;
139
+ placeholder: string;
140
+ }>;
141
+ export default _default;
@@ -66,7 +66,7 @@ declare const _default: import("vue").DefineComponent<{
66
66
  loadData: {
67
67
  type: FunctionConstructor;
68
68
  };
69
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "update:modelValue" | "changeValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
69
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
70
70
  id: StringConstructor;
71
71
  name: {
72
72
  type: StringConstructor;
@@ -134,7 +134,9 @@ declare const _default: import("vue").DefineComponent<{
134
134
  loadData: {
135
135
  type: FunctionConstructor;
136
136
  };
137
- }>>, {
137
+ }>> & {
138
+ [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
139
+ }, {
138
140
  name: string;
139
141
  disable: boolean;
140
142
  tabIndex: number;