@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
@@ -6,7 +6,7 @@ const C = {
6
6
  enableFold: { type: Boolean, default: !0 },
7
7
  expanded: { type: Boolean, default: !1 }
8
8
  };
9
- const h = f({
9
+ const h = /* @__PURE__ */ f({
10
10
  name: "FAccordion",
11
11
  props: C,
12
12
  emits: [],
@@ -32,7 +32,7 @@ const h = f({
32
32
  title: { type: String, default: "" },
33
33
  disable: { type: Boolean, default: !1 }
34
34
  };
35
- const m = f({
35
+ const m = /* @__PURE__ */ f({
36
36
  name: "FAccordionItem",
37
37
  props: g,
38
38
  emits: [],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "accordion",
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,13 +1,40 @@
1
1
  import { ref as s, computed as n, defineComponent as m, createVNode as t } from "vue";
2
2
  const C = {
3
+ /**
4
+ * 头像宽度
5
+ */
3
6
  avatarWidth: { type: Number, default: 100 },
7
+ /**
8
+ * 头像高度
9
+ */
4
10
  avatarHeight: { type: Number, default: 100 },
11
+ /**
12
+ * 组件标识
13
+ */
5
14
  cover: { type: String },
15
+ /**
16
+ * 只读
17
+ */
6
18
  readonly: { type: Boolean, default: !1 },
19
+ /**
20
+ * 头像形状
21
+ */
7
22
  shape: { type: String, default: "circle" },
23
+ /**
24
+ * 头像最大尺寸, 单位MB
25
+ */
8
26
  maxSize: { type: Number, default: 1 },
27
+ /**
28
+ * 组件值
29
+ */
9
30
  modelValue: { type: String, default: "" },
31
+ /**
32
+ * 头像标题
33
+ */
10
34
  tile: { type: String, default: "" },
35
+ /**
36
+ * 支持的头像类型
37
+ */
11
38
  type: { type: Array, default: [] }
12
39
  };
13
40
  function Q(A, y, a, r) {
@@ -35,7 +62,7 @@ function Q(A, y, a, r) {
35
62
  }
36
63
  return { acceptTypes: c, imageSource: i, imageTitle: f, onClickImage: H };
37
64
  }
38
- const v = m({
65
+ const v = /* @__PURE__ */ m({
39
66
  name: "FAvatar",
40
67
  props: C,
41
68
  emits: ["change", "update:modelValue"],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "avatar",
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,11 +1,23 @@
1
- import { defineComponent as x, createVNode as i, ref as b, nextTick as E } from "vue";
2
- const V = {
1
+ import { defineComponent as C, ref as p, computed as E, createVNode as i, nextTick as V } from "vue";
2
+ const G = {
3
+ /**
4
+ * 组件标识
5
+ */
3
6
  id: String,
7
+ /**
8
+ * 设置按钮类型
9
+ */
4
10
  type: { type: String, default: "primary" },
11
+ /**
12
+ * 是否禁用
13
+ */
5
14
  disabled: { type: Boolean, default: !1 },
15
+ /**
16
+ * 按钮尺寸
17
+ */
6
18
  size: { type: String, default: "small" }
7
19
  };
8
- function G(n, u) {
20
+ function j(n, u) {
9
21
  function c(f) {
10
22
  f.stopPropagation(), n.disabled || u.emit("click", f);
11
23
  }
@@ -13,92 +25,138 @@ function G(n, u) {
13
25
  onClickButton: c
14
26
  };
15
27
  }
16
- const R = x({
28
+ const R = /* @__PURE__ */ C({
17
29
  name: "FButton",
18
- props: V,
30
+ props: G,
19
31
  emits: ["click"],
20
32
  setup(n, u) {
21
33
  const {
22
34
  onClickButton: c
23
- } = G(n, u);
35
+ } = j(n, u), f = p(n.size), r = p(n.type), d = p(n.disabled), a = E(() => {
36
+ const s = {
37
+ btn: !0,
38
+ "btn-lg": f.value === "large",
39
+ "btn-sm": f.value !== "large"
40
+ };
41
+ return r.value && (s[`btn-${r.value}`] = !0), s;
42
+ });
24
43
  return () => i("button", {
25
- class: (n.size === "large" ? "btn-lg " : "btn-sm ") + "btn " + (n.type ? "btn-" + n.type + " " : ""),
26
- disabled: n.disabled,
27
- onClick: (f) => c(f)
44
+ class: a.value,
45
+ disabled: d.value,
46
+ onClick: (s) => c(s)
28
47
  }, [u.slots.default && u.slots.default()]);
29
48
  }
30
49
  }), L = {
50
+ /**
51
+ * 组件标识
52
+ */
31
53
  id: String,
54
+ /**
55
+ * 横向纠正的参照
56
+ */
32
57
  rectifyReferenceH: { type: Object },
58
+ /**
59
+ * 纵向纠正的参照
60
+ */
33
61
  rectifyReferenceV: { type: Object },
62
+ /**
63
+ * 是否自动纠正位置
64
+ */
34
65
  autoRectify: { type: Boolean, default: !1 },
66
+ /**
67
+ * 计算方向的真正placement
68
+ */
35
69
  realPlacement: { type: String, default: "bottom-right" },
70
+ /**
71
+ * 重新计算后的placement
72
+ */
36
73
  rectifyPlacement: { type: String, default: "bottom-right" },
74
+ /**
75
+ * 按钮信息
76
+ */
37
77
  data: { type: Array },
78
+ /**
79
+ * 显示的按钮数量 默认为2
80
+ */
38
81
  count: { type: Number, default: 2 },
82
+ /**
83
+ * 按钮大小
84
+ */
39
85
  size: { type: String, default: "small" },
86
+ /**
87
+ * 按钮样式
88
+ */
40
89
  type: { type: String, default: "primary" },
90
+ /**
91
+ * 按钮展示位置
92
+ */
41
93
  placement: { type: String, default: "bottom" },
94
+ /**
95
+ * 下拉面板显示
96
+ */
42
97
  showPanel: { type: Boolean, default: !1 },
98
+ /**
99
+ * 下拉面板显示标志
100
+ */
43
101
  dpFlag: { type: Boolean, default: !1 }
44
102
  };
45
- function j(n, u, c, f) {
103
+ function $(n, u, c, f) {
46
104
  let r = 0, d = 0;
47
- const a = b(n.showPanel);
48
- let p = b(n.realPlacement), s = !1;
105
+ const a = p(n.showPanel), s = p(n.realPlacement);
106
+ let g = !1;
49
107
  function h() {
50
108
  c.value && document.body.appendChild(c.value);
51
109
  }
52
110
  function k() {
53
111
  a.value = !0;
54
112
  }
55
- function y() {
113
+ function b() {
56
114
  a.value = !1;
57
115
  }
58
116
  function P() {
59
- a.value && !s && setTimeout(() => {
60
- a.value && !s && (y(), s = !1);
117
+ a.value && !g && setTimeout(() => {
118
+ a.value && !g && (b(), g = !1);
61
119
  }, 1e3);
62
120
  }
63
121
  function e() {
64
122
  setTimeout(() => {
65
- a.value && (y(), s = !1);
123
+ a.value && (b(), g = !1);
66
124
  }, 1e3);
67
125
  }
68
- function g() {
69
- k(), s = !0;
126
+ function m() {
127
+ k(), g = !0;
70
128
  }
71
- function B() {
129
+ function x() {
72
130
  e();
73
131
  }
74
- function C() {
75
- let l = document.documentElement.clientWidth, t = document.documentElement.clientHeight, o = 0, v = 0;
132
+ function O() {
133
+ let l = document.documentElement.clientWidth, t = document.documentElement.clientHeight, o = 0, y = 0;
76
134
  if (n.rectifyReferenceH) {
77
- const m = document.querySelector("props.rectifyReferenceH");
78
- m && (l = m.getBoundingClientRect().right, v = m.getBoundingClientRect().left);
135
+ const v = document.querySelector("props.rectifyReferenceH");
136
+ v && (l = v.getBoundingClientRect().right, y = v.getBoundingClientRect().left);
79
137
  }
80
138
  if (n.rectifyReferenceV) {
81
- const m = document.querySelector("props.rectifyReferenceV");
82
- m && (t = m.getBoundingClientRect().bottom, o = m.getBoundingClientRect().top);
139
+ const v = document.querySelector("props.rectifyReferenceV");
140
+ v && (t = v.getBoundingClientRect().bottom, o = v.getBoundingClientRect().top);
83
141
  }
84
- return { top: o, left: v, right: l, bottom: t };
142
+ return { top: o, left: y, right: l, bottom: t };
85
143
  }
86
- function M(l) {
144
+ function B(l) {
87
145
  if (!n.autoRectify)
88
146
  return;
89
- const t = C(), o = p;
90
- o.value.indexOf("bottom") > -1 ? d > t.bottom - l.bottom && (o.value = o.value.replace("bottom", "top")) : o.value.indexOf("top") > -1 && d > l.top - t.top && (o.value = o.value.replace("top", "bottom")), o.value.indexOf("left") > -1 ? r > l.left - t.left && (o.value = o.value.replace("left", "right")) : o.value.indexOf("right") > -1 && r > t.right - l.right && (o.value = o.value.replace("right", "left")), p = o;
147
+ const t = O(), o = s;
148
+ o.value.indexOf("bottom") > -1 ? d > t.bottom - l.bottom && (o.value = o.value.replace("bottom", "top")) : o.value.indexOf("top") > -1 && d > l.top - t.top && (o.value = o.value.replace("top", "bottom")), o.value.indexOf("left") > -1 ? r > l.left - t.left && (o.value = o.value.replace("left", "right")) : o.value.indexOf("right") > -1 && r > t.right - l.right && (o.value = o.value.replace("right", "left")), s.value = o.value;
91
149
  }
92
- function O(l) {
150
+ function M(l) {
93
151
  let t = "";
94
- n.autoRectify ? t = n.rectifyPlacement : t = p.value;
95
- let o = 0, v = 0;
96
- t.indexOf("top") > -1 ? o = l.top - d : t.indexOf("bottom") > -1 && (o = l.bottom), t.indexOf("right") > -1 ? v = l.right : t.indexOf("left") > -1 && (v = l.left - r), t.indexOf("-top") > -1 ? o -= l.height : t.indexOf("-bottom") > -1 && (o += l.height), c.value.style.top = o + "px", c.value.style.left = v + "px";
152
+ n.autoRectify ? t = n.rectifyPlacement : t = s.value;
153
+ let o = 0, y = 0;
154
+ t.indexOf("top") > -1 ? o = l.top - d : t.indexOf("bottom") > -1 && (o = l.bottom), t.indexOf("right") > -1 ? y = l.right : t.indexOf("left") > -1 && (y = l.left - r), t.indexOf("-top") > -1 ? o -= l.height : t.indexOf("-bottom") > -1 && (o += l.height), c.value.style.top = o + "px", c.value.style.left = y + "px";
97
155
  }
98
156
  async function F() {
99
- await E();
157
+ await V();
100
158
  const l = f.value.getBoundingClientRect(), t = c.value.getBoundingClientRect();
101
- d = t.height, r = t.width, n.autoRectify && M(l), O(l);
159
+ d = t.height, r = t.width, n.autoRectify && B(l), M(l);
102
160
  }
103
161
  function T(l) {
104
162
  l.stopPropagation(), a.value = !a.value, a.value && (h(), F()), u.emit("changeState", a.value);
@@ -124,32 +182,32 @@ function j(n, u, c, f) {
124
182
  default:
125
183
  t = l;
126
184
  }
127
- p.value = t;
185
+ s.value = t;
128
186
  }
129
187
  return {
130
188
  showPanel: a,
131
189
  clickEvent: T,
132
190
  toggle: H,
133
191
  getRealPlacement: S,
134
- bindMenuMouseenter: g,
192
+ bindMenuMouseenter: m,
135
193
  unbindMenuMouseleave: P,
136
- bindMenuMouseleave: B
194
+ bindMenuMouseleave: x
137
195
  };
138
196
  }
139
- const w = x({
197
+ const w = /* @__PURE__ */ C({
140
198
  name: "FButtonGroup",
141
199
  props: L,
142
200
  emits: ["click", "changeState", "change", "clickMenuOut"],
143
201
  setup(n, u) {
144
- const c = n.data && n.data.slice(0, n.count) || [], f = n.data && n.data.slice(n.count) || [], r = b(), d = b(), {
202
+ const c = n.data && n.data.slice(0, n.count) || [], f = n.data && n.data.slice(n.count) || [], r = p(), d = p(), {
145
203
  showPanel: a,
146
- clickEvent: p,
147
- toggle: s,
204
+ clickEvent: s,
205
+ toggle: g,
148
206
  getRealPlacement: h,
149
207
  bindMenuMouseenter: k,
150
- unbindMenuMouseleave: y,
208
+ unbindMenuMouseleave: b,
151
209
  bindMenuMouseleave: P
152
- } = j(n, u, r, d);
210
+ } = $(n, u, r, d);
153
211
  return h(n.placement), () => i("div", {
154
212
  class: "f-btn-group"
155
213
  }, [i("div", {
@@ -159,22 +217,22 @@ const w = x({
159
217
  id: e.id,
160
218
  title: e.id,
161
219
  class: "btn btn-link btn-icontext" + (e.disabled ? " disabled" : ""),
162
- onClick: (g) => s(g, e)
220
+ onClick: (m) => g(m, e)
163
221
  }, [i("i", {
164
- class: "'f-icon '+ btn.icon?btn.icon:''"
222
+ class: `f-icon ${e.icon ? e.icon : ""}`
165
223
  }, null)]), !e.icon && i("button", {
166
224
  id: e.id,
167
225
  class: "btn " + (e.type ? "btn-" + e.type : "btn-link") + " " + (e.type && e.type !== "link" ? "f-btn-ml" : "") + (e.disabled ? " disabled" : ""),
168
- onClick: (g) => s(g, e)
226
+ onClick: (m) => g(m, e)
169
227
  }, [e == null ? void 0 : e.text])]))]), f.length ? i("div", {
170
228
  class: "btn-group f-btn-group-dropdown",
171
- onMouseleave: (e) => y()
229
+ onMouseleave: (e) => b()
172
230
  }, [i("button", {
173
231
  title: "button",
174
232
  ref: d,
175
233
  type: "button",
176
234
  class: "f-btn-dropdown",
177
- onClick: (e) => p(e)
235
+ onClick: (e) => s(e)
178
236
  }, [i("span", {
179
237
  class: "f-icon f-icon-lookup"
180
238
  }, null)]), i("div", {
@@ -186,9 +244,9 @@ const w = x({
186
244
  }, [f.map((e) => i("div", null, [i("div", null, [e.divider && i("div", {
187
245
  class: "dropdown-divider"
188
246
  }, null), i("li", {
189
- id: "dpBtn.id",
247
+ id: e.id,
190
248
  class: "dropdown-item" + (e.disabled ? " disabled" : ""),
191
- onClick: (g) => s(g, e)
249
+ onClick: (m) => g(m, e)
192
250
  }, [e.icon && i("i", {
193
251
  class: "f-icon dropdown-item-icon" + e.icon
194
252
  }, null), i("span", null, [e == null ? void 0 : e.text])])])]))])]) : ""]);
@@ -200,7 +258,8 @@ const w = x({
200
258
  };
201
259
  export {
202
260
  R as FButton,
261
+ w as FButtonGroup,
203
262
  L as buttonGroupProps,
204
- V as buttonProps,
263
+ G as buttonProps,
205
264
  N as default
206
265
  };
@@ -1 +1 @@
1
- (function(f,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(f=typeof globalThis<"u"?globalThis:f||self,o(f.button={},f.Vue))})(this,function(f,o){"use strict";const R={id:String,type:{type:String,default:"primary"},disabled:{type:Boolean,default:!1},size:{type:String,default:"small"}};function B(n,c){function u(d){d.stopPropagation(),n.disabled||c.emit("click",d)}return{onClickButton:u}}const v=o.defineComponent({name:"FButton",props:R,emits:["click"],setup(n,c){const{onClickButton:u}=B(n,c);return()=>o.createVNode("button",{class:(n.size==="large"?"btn-lg ":"btn-sm ")+"btn "+(n.type?"btn-"+n.type+" ":""),disabled:n.disabled,onClick:d=>u(d)},[c.slots.default&&c.slots.default()])}}),N={id:String,rectifyReferenceH:{type:Object},rectifyReferenceV:{type:Object},autoRectify:{type:Boolean,default:!1},realPlacement:{type:String,default:"bottom-right"},rectifyPlacement:{type:String,default:"bottom-right"},data:{type:Array},count:{type:Number,default:2},size:{type:String,default:"small"},type:{type:String,default:"primary"},placement:{type:String,default:"bottom"},showPanel:{type:Boolean,default:!1},dpFlag:{type:Boolean,default:!1}};function C(n,c,u,d){let s=0,m=0;const a=o.ref(n.showPanel);let b=o.ref(n.realPlacement),r=!1;function P(){u.value&&document.body.appendChild(u.value)}function k(){a.value=!0}function h(){a.value=!1}function V(){a.value&&!r&&setTimeout(()=>{a.value&&!r&&(h(),r=!1)},1e3)}function e(){setTimeout(()=>{a.value&&(h(),r=!1)},1e3)}function g(){k(),r=!0}function O(){e()}function x(){let i=document.documentElement.clientWidth,t=document.documentElement.clientHeight,l=0,y=0;if(n.rectifyReferenceH){const p=document.querySelector("props.rectifyReferenceH");p&&(i=p.getBoundingClientRect().right,y=p.getBoundingClientRect().left)}if(n.rectifyReferenceV){const p=document.querySelector("props.rectifyReferenceV");p&&(t=p.getBoundingClientRect().bottom,l=p.getBoundingClientRect().top)}return{top:l,left:y,right:i,bottom:t}}function T(i){if(!n.autoRectify)return;const t=x(),l=b;l.value.indexOf("bottom")>-1?m>t.bottom-i.bottom&&(l.value=l.value.replace("bottom","top")):l.value.indexOf("top")>-1&&m>i.top-t.top&&(l.value=l.value.replace("top","bottom")),l.value.indexOf("left")>-1?s>i.left-t.left&&(l.value=l.value.replace("left","right")):l.value.indexOf("right")>-1&&s>t.right-i.right&&(l.value=l.value.replace("right","left")),b=l}function F(i){let t="";n.autoRectify?t=n.rectifyPlacement:t=b.value;let l=0,y=0;t.indexOf("top")>-1?l=i.top-m:t.indexOf("bottom")>-1&&(l=i.bottom),t.indexOf("right")>-1?y=i.right:t.indexOf("left")>-1&&(y=i.left-s),t.indexOf("-top")>-1?l-=i.height:t.indexOf("-bottom")>-1&&(l+=i.height),u.value.style.top=l+"px",u.value.style.left=y+"px"}async function S(){await o.nextTick();const i=d.value.getBoundingClientRect(),t=u.value.getBoundingClientRect();m=t.height,s=t.width,n.autoRectify&&T(i),F(i)}function H(i){i.stopPropagation(),a.value=!a.value,a.value&&(P(),S()),c.emit("changeState",a.value)}function E(i,t){i.stopPropagation(),!t.disabled&&(a.value=!1,c.emit("change",t.id),c.emit("click",t))}function G(i){let t="bottom-right";switch(i){case"top":t="top-right";break;case"left":t="left-bottom";break;case"right":t="right-bottom";break;case"bottom":t="bottom-right";break;default:t=i}b.value=t}return{showPanel:a,clickEvent:H,toggle:E,getRealPlacement:G,bindMenuMouseenter:g,unbindMenuMouseleave:V,bindMenuMouseleave:O}}const w=o.defineComponent({name:"FButtonGroup",props:N,emits:["click","changeState","change","clickMenuOut"],setup(n,c){const u=n.data&&n.data.slice(0,n.count)||[],d=n.data&&n.data.slice(n.count)||[],s=o.ref(),m=o.ref(),{showPanel:a,clickEvent:b,toggle:r,getRealPlacement:P,bindMenuMouseenter:k,unbindMenuMouseleave:h,bindMenuMouseleave:V}=C(n,c,s,m);return P(n.placement),()=>o.createVNode("div",{class:"f-btn-group"},[o.createVNode("div",{class:(n.size==="large"?"btn-group-lg":"btn-group-sm")+" btn-group f-btn-group-links"},[u.map(e=>o.createVNode("div",null,[e.icon&&o.createVNode("button",{type:"button",id:e.id,title:e.id,class:"btn btn-link btn-icontext"+(e.disabled?" disabled":""),onClick:g=>r(g,e)},[o.createVNode("i",{class:"'f-icon '+ btn.icon?btn.icon:''"},null)]),!e.icon&&o.createVNode("button",{id:e.id,class:"btn "+(e.type?"btn-"+e.type:"btn-link")+" "+(e.type&&e.type!=="link"?"f-btn-ml":"")+(e.disabled?" disabled":""),onClick:g=>r(g,e)},[e==null?void 0:e.text])]))]),d.length?o.createVNode("div",{class:"btn-group f-btn-group-dropdown",onMouseleave:e=>h()},[o.createVNode("button",{title:"button",ref:m,type:"button",class:"f-btn-dropdown",onClick:e=>b(e)},[o.createVNode("span",{class:"f-icon f-icon-lookup"},null)]),o.createVNode("div",{ref:s,class:"dropdown-menu f-btn-group-dropdown-menu"+(a.value?" show":""),style:"position:fixed;",onMouseenter:e=>k(),onMouseleave:e=>V()},[d.map(e=>o.createVNode("div",null,[o.createVNode("div",null,[e.divider&&o.createVNode("div",{class:"dropdown-divider"},null),o.createVNode("li",{id:"dpBtn.id",class:"dropdown-item"+(e.disabled?" disabled":""),onClick:g=>r(g,e)},[e.icon&&o.createVNode("i",{class:"f-icon dropdown-item-icon"+e.icon},null),o.createVNode("span",null,[e==null?void 0:e.text])])])]))])]):""])}}),M={install(n){n.component(v.name,v),n.component(w.name,w)}};f.FButton=v,f.buttonGroupProps=N,f.buttonProps=R,f.default=M,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(c,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(c=typeof globalThis<"u"?globalThis:c||self,t(c.button={},c.Vue))})(this,function(c,t){"use strict";const N={id:String,type:{type:String,default:"primary"},disabled:{type:Boolean,default:!1},size:{type:String,default:"small"}};function w(o,u){function f(s){s.stopPropagation(),o.disabled||u.emit("click",s)}return{onClickButton:f}}const v=t.defineComponent({name:"FButton",props:N,emits:["click"],setup(o,u){const{onClickButton:f}=w(o,u),s=t.ref(o.size),d=t.ref(o.type),m=t.ref(o.disabled),a=t.computed(()=>{const r={btn:!0,"btn-lg":s.value==="large","btn-sm":s.value!=="large"};return d.value&&(r[`btn-${d.value}`]=!0),r});return()=>t.createVNode("button",{class:a.value,disabled:m.value,onClick:r=>f(r)},[u.slots.default&&u.slots.default()])}}),C={id:String,rectifyReferenceH:{type:Object},rectifyReferenceV:{type:Object},autoRectify:{type:Boolean,default:!1},realPlacement:{type:String,default:"bottom-right"},rectifyPlacement:{type:String,default:"bottom-right"},data:{type:Array},count:{type:Number,default:2},size:{type:String,default:"small"},type:{type:String,default:"primary"},placement:{type:String,default:"bottom"},showPanel:{type:Boolean,default:!1},dpFlag:{type:Boolean,default:!1}};function B(o,u,f,s){let d=0,m=0;const a=t.ref(o.showPanel),r=t.ref(o.realPlacement);let g=!1;function k(){f.value&&document.body.appendChild(f.value)}function V(){a.value=!0}function h(){a.value=!1}function R(){a.value&&!g&&setTimeout(()=>{a.value&&!g&&(h(),g=!1)},1e3)}function e(){setTimeout(()=>{a.value&&(h(),g=!1)},1e3)}function p(){V(),g=!0}function O(){e()}function x(){let l=document.documentElement.clientWidth,n=document.documentElement.clientHeight,i=0,b=0;if(o.rectifyReferenceH){const y=document.querySelector("props.rectifyReferenceH");y&&(l=y.getBoundingClientRect().right,b=y.getBoundingClientRect().left)}if(o.rectifyReferenceV){const y=document.querySelector("props.rectifyReferenceV");y&&(n=y.getBoundingClientRect().bottom,i=y.getBoundingClientRect().top)}return{top:i,left:b,right:l,bottom:n}}function T(l){if(!o.autoRectify)return;const n=x(),i=r;i.value.indexOf("bottom")>-1?m>n.bottom-l.bottom&&(i.value=i.value.replace("bottom","top")):i.value.indexOf("top")>-1&&m>l.top-n.top&&(i.value=i.value.replace("top","bottom")),i.value.indexOf("left")>-1?d>l.left-n.left&&(i.value=i.value.replace("left","right")):i.value.indexOf("right")>-1&&d>n.right-l.right&&(i.value=i.value.replace("right","left")),r.value=i.value}function F(l){let n="";o.autoRectify?n=o.rectifyPlacement:n=r.value;let i=0,b=0;n.indexOf("top")>-1?i=l.top-m:n.indexOf("bottom")>-1&&(i=l.bottom),n.indexOf("right")>-1?b=l.right:n.indexOf("left")>-1&&(b=l.left-d),n.indexOf("-top")>-1?i-=l.height:n.indexOf("-bottom")>-1&&(i+=l.height),f.value.style.top=i+"px",f.value.style.left=b+"px"}async function S(){await t.nextTick();const l=s.value.getBoundingClientRect(),n=f.value.getBoundingClientRect();m=n.height,d=n.width,o.autoRectify&&T(l),F(l)}function G(l){l.stopPropagation(),a.value=!a.value,a.value&&(k(),S()),u.emit("changeState",a.value)}function H(l,n){l.stopPropagation(),!n.disabled&&(a.value=!1,u.emit("change",n.id),u.emit("click",n))}function j(l){let n="bottom-right";switch(l){case"top":n="top-right";break;case"left":n="left-bottom";break;case"right":n="right-bottom";break;case"bottom":n="bottom-right";break;default:n=l}r.value=n}return{showPanel:a,clickEvent:G,toggle:H,getRealPlacement:j,bindMenuMouseenter:p,unbindMenuMouseleave:R,bindMenuMouseleave:O}}const P=t.defineComponent({name:"FButtonGroup",props:C,emits:["click","changeState","change","clickMenuOut"],setup(o,u){const f=o.data&&o.data.slice(0,o.count)||[],s=o.data&&o.data.slice(o.count)||[],d=t.ref(),m=t.ref(),{showPanel:a,clickEvent:r,toggle:g,getRealPlacement:k,bindMenuMouseenter:V,unbindMenuMouseleave:h,bindMenuMouseleave:R}=B(o,u,d,m);return k(o.placement),()=>t.createVNode("div",{class:"f-btn-group"},[t.createVNode("div",{class:(o.size==="large"?"btn-group-lg":"btn-group-sm")+" btn-group f-btn-group-links"},[f.map(e=>t.createVNode("div",null,[e.icon&&t.createVNode("button",{type:"button",id:e.id,title:e.id,class:"btn btn-link btn-icontext"+(e.disabled?" disabled":""),onClick:p=>g(p,e)},[t.createVNode("i",{class:`f-icon ${e.icon?e.icon:""}`},null)]),!e.icon&&t.createVNode("button",{id:e.id,class:"btn "+(e.type?"btn-"+e.type:"btn-link")+" "+(e.type&&e.type!=="link"?"f-btn-ml":"")+(e.disabled?" disabled":""),onClick:p=>g(p,e)},[e==null?void 0:e.text])]))]),s.length?t.createVNode("div",{class:"btn-group f-btn-group-dropdown",onMouseleave:e=>h()},[t.createVNode("button",{title:"button",ref:m,type:"button",class:"f-btn-dropdown",onClick:e=>r(e)},[t.createVNode("span",{class:"f-icon f-icon-lookup"},null)]),t.createVNode("div",{ref:d,class:"dropdown-menu f-btn-group-dropdown-menu"+(a.value?" show":""),style:"position:fixed;",onMouseenter:e=>V(),onMouseleave:e=>R()},[s.map(e=>t.createVNode("div",null,[t.createVNode("div",null,[e.divider&&t.createVNode("div",{class:"dropdown-divider"},null),t.createVNode("li",{id:e.id,class:"dropdown-item"+(e.disabled?" disabled":""),onClick:p=>g(p,e)},[e.icon&&t.createVNode("i",{class:"f-icon dropdown-item-icon"+e.icon},null),t.createVNode("span",null,[e==null?void 0:e.text])])])]))])]):""])}}),M={install(o){o.component(v.name,v),o.component(P.name,P)}};c.FButton=v,c.FButtonGroup=P,c.buttonGroupProps=C,c.buttonProps=N,c.default=M,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "button",
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,22 +1,76 @@
1
1
  import { computed as d, watch as P, ref as g, defineComponent as E, createVNode as f, Teleport as H, Fragment as _, mergeProps as q, withDirectives as z, vShow as J } from "vue";
2
2
  const Q = {
3
+ /**
4
+ * 组件标识
5
+ */
3
6
  id: String,
7
+ /**
8
+ * 扩展按钮显示内容,这是一段现在扩展按钮中的html标签
9
+ */
4
10
  buttonContent: { type: String, default: '<i class="f-icon f-icon-lookup"></i>' },
11
+ /**
12
+ * 启用输入框自动完成功能
13
+ */
5
14
  autoComplete: { type: Boolean, default: !1 },
15
+ /**
16
+ * 组件自定义样式
17
+ */
6
18
  customClass: { type: String, default: "" },
19
+ /**
20
+ * 禁用组件,既不允许在输入框中录入,也不允许点击扩展按钮。
21
+ */
7
22
  disable: { type: Boolean, default: !1 },
23
+ /**
24
+ * 允许在输入框中录入文本。
25
+ */
8
26
  editable: { type: Boolean, default: !0 },
27
+ /**
28
+ * 显示清空文本按钮
29
+ */
9
30
  enableClear: { type: Boolean, default: !1 },
31
+ /**
32
+ * 组件值
33
+ */
10
34
  modelValue: { type: String, default: "" },
35
+ /**
36
+ * 将组件设置为只读,既不允许在输入框中录入,也不允许点击扩展按钮,但是允许复制输入框中的内容。
37
+ */
11
38
  readonly: { type: Boolean, default: !1 },
39
+ /**
40
+ * 文本对齐方式
41
+ */
12
42
  textAlign: { type: String, default: "left" },
43
+ /**
44
+ * 禁用组件时,是否显示扩展按钮
45
+ */
13
46
  showButtonWhenDisabled: { type: Boolean, default: !1 },
47
+ /**
48
+ * 显示输入框的标签
49
+ */
14
50
  enableTitle: { type: Boolean, default: !1 },
51
+ /**
52
+ * 输入框类型
53
+ */
15
54
  inputType: { type: String, default: "text" },
55
+ /**
56
+ * 显示输入框提示信息
57
+ */
16
58
  forcePlaceholder: { type: Boolean, default: !1 },
59
+ /**
60
+ * 输入框提示文本
61
+ */
17
62
  placeholder: { type: String, default: "" },
63
+ /**
64
+ * 输入框最小长度
65
+ */
18
66
  minLength: Number,
67
+ /**
68
+ * 输入框最大长度
69
+ */
19
70
  maxLength: Number,
71
+ /**
72
+ * 输入框Tab键索引
73
+ */
20
74
  tabIndex: Number
21
75
  };
22
76
  function X(e, n, o) {
@@ -124,7 +178,7 @@ function Y(e, n, o, r, a) {
124
178
  v.stopPropagation(), (y || b) && (s("", !1), c(!l.value), n.emit("clear"));
125
179
  }
126
180
  function B(v) {
127
- if (!!u.value) {
181
+ if (u.value) {
128
182
  if (!o.value) {
129
183
  c(!1);
130
184
  return;
@@ -133,7 +187,7 @@ function Y(e, n, o, r, a) {
133
187
  }
134
188
  }
135
189
  function m(v) {
136
- !u.value || c(!1);
190
+ u.value && c(!1);
137
191
  }
138
192
  return {
139
193
  enableClearButton: u,
@@ -145,7 +199,7 @@ function Y(e, n, o, r, a) {
145
199
  }
146
200
  const Z = {
147
201
  popupContentPosition: { type: Object, default: { left: 0, top: 0 } }
148
- }, $ = E({
202
+ }, $ = /* @__PURE__ */ E({
149
203
  name: "FOverlay",
150
204
  props: Z,
151
205
  emits: ["click"],
@@ -174,7 +228,7 @@ const Z = {
174
228
  }
175
229
  });
176
230
  }
177
- }), M = E({
231
+ }), M = /* @__PURE__ */ E({
178
232
  name: "FButtonEdit",
179
233
  props: Q,
180
234
  emits: ["updateExtendInfo", "clear", "change", "click", "clickButton", "blur", "focus", "mouseEnterIcon", "mouseLeaveIcon", "keyup", "keydown", "inputClick", "input", "update:modelValue"],
@@ -1 +1 @@
1
- (function(m,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(m=typeof globalThis<"u"?globalThis:m||self,t(m["button-edit"]={},m.Vue))})(this,function(m,t){"use strict";const w={id:String,buttonContent:{type:String,default:'<i class="f-icon f-icon-lookup"></i>'},autoComplete:{type:Boolean,default:!1},customClass:{type:String,default:""},disable:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},enableClear:{type:Boolean,default:!1},modelValue:{type:String,default:""},readonly:{type:Boolean,default:!1},textAlign:{type:String,default:"left"},showButtonWhenDisabled:{type:Boolean,default:!1},enableTitle:{type:Boolean,default:!1},inputType:{type:String,default:"text"},forcePlaceholder:{type:Boolean,default:!1},placeholder:{type:String,default:""},minLength:Number,maxLength:Number,tabIndex:Number};function P(e,o,l){const f=t.computed(()=>({"input-group-append":!0,"append-force-show":e.showButtonWhenDisabled&&(e.readonly||e.disable)})),u=t.computed(()=>e.showButtonWhenDisabled||(!e.editable||!e.readonly)&&!e.disable);function a(c){u.value&&(l.value=!0,o.emit("clickButton",{origin:c,value:e.modelValue})),c.stopPropagation()}function i(c){o.emit("mouseEnterIcon",c)}function s(c){o.emit("mouseLeaveIcon",c)}function d(){o.emit("mouseOverButton")}return{buttonClass:f,onClickButton:a,onMouseEnterButton:i,onMouseLeaveButton:s,onMouseOverButton:d}}function M(e,o,l,f){const u=t.computed(()=>e.enableTitle?l.value:""),a=t.computed(()=>(e.disable||e.readonly)&&!e.forcePlaceholder?"":e.placeholder),i=t.computed(()=>e.readonly||!e.editable);let s=!1;const d=t.computed(()=>!e.disable&&s),c=t.computed(()=>({"text-left":e.textAlign==="left","text-center":e.textAlign==="center","text-right":e.textAlign==="right","form-control":!0,"f-utils-fill":!0}));function x(n,r=!0){l.value!==n&&(l.value=n,r&&o.emit("change",n),o.emit("update:modelValue",n))}t.watch(()=>e.modelValue,n=>{l.value=n,o.emit("change",n)});function g(n){s=!1,o.emit("blur",n),n.stopPropagation()}function B(n){o.emit("click",n)}function b(n){if(e.disable){s=!0;return}s=!0,i.value||o.emit("focus",n)}function y(n){o.emit("input",n.target.value);const r=n.target.value;f.value=r,l.value!==r&&x(r,!1)}function T(n){n.target.tagName!=="INPUT"&&n.preventDefault(),n.stopPropagation()}function v(n){o.emit("keydown",n)}function k(n){o.emit("keyup",n)}function V(n){const r=n.target.value;x(r)}return{hasFocusedTextBox:d,isTextBoxReadonly:i,textBoxClass:c,textBoxPlaceholder:a,textBoxTitle:u,changeTextBoxValue:x,onBlurTextBox:g,onClickTextBox:B,onFocusTextBox:b,onInput:y,onKeyDownTextBox:v,onKeyUpTextBox:k,onMouseDownTextBox:T,onTextBoxValueChange:V}}function N(e,o,l,f,u){const a=t.ref(!1),i=t.computed(()=>e.enableClear&&!e.readonly&&!e.disable),{changeTextBoxValue:s}=M(e,o,l,u);function d(B){a.value=B}t.watch(u,()=>{f.value?d(!!u.value):d(!1)});function c(B){const b=!e.readonly&&!e.disable&&e.editable,y=!e.editable;B.stopPropagation(),(b||y)&&(s("",!1),d(!a.value),o.emit("clear"))}function x(B){if(!!i.value){if(!l.value){d(!1);return}(!e.editable||!e.readonly)&&!e.disable&&d(!0)}}function g(B){!i.value||d(!1)}return{enableClearButton:i,showClearButton:a,onClearValue:c,onMouseEnterTextBox:x,onMouseLeaveTextBox:g}}const E={popupContentPosition:{type:Object,default:{left:0,top:0}}},S=t.defineComponent({name:"FOverlay",props:E,emits:["click"],setup(e,o){const l=t.ref(e.popupContentPosition);function f(a){o.emit("click"),a.preventDefault(),a.stopPropagation()}const u=t.computed(()=>({position:"relative",left:`${l.value.left}px`,top:`${l.value.top}px`}));return()=>t.createVNode(t.Teleport,{to:"body"},{default:()=>{var a,i;return[t.createVNode("div",{class:"overlay-container",style:"pointer-events: auto;",onClick:s=>f(s)},[t.createVNode("div",{style:u.value},[(i=(a=o.slots).default)==null?void 0:i.call(a)])])]}})}}),p=t.defineComponent({name:"FButtonEdit",props:w,emits:["updateExtendInfo","clear","change","click","clickButton","blur","focus","mouseEnterIcon","mouseLeaveIcon","keyup","keydown","inputClick","input","update:modelValue"],setup(e,o){const l=t.ref(),f=t.ref(e.modelValue),u=t.ref(!1),{buttonClass:a,onClickButton:i,onMouseEnterButton:s,onMouseLeaveButton:d}=P(e,o,u),c=t.ref(""),{hasFocusedTextBox:x,isTextBoxReadonly:g,textBoxClass:B,textBoxPlaceholder:b,textBoxTitle:y,onBlurTextBox:T,onClickTextBox:v,onFocusTextBox:k,onInput:V,onKeyDownTextBox:n,onKeyUpTextBox:r,onMouseDownTextBox:L,onTextBoxValueChange:O}=M(e,o,f,c),{enableClearButton:D,showClearButton:F,onClearValue:K,onMouseEnterTextBox:j,onMouseLeaveTextBox:A}=N(e,o,f,x,c),R=t.computed(()=>({"input-group":!0,"f-state-disable":e.disable,"f-state-editable":e.editable&&!e.disable&&!e.readonly,"f-state-readonly":e.readonly&&!e.disable,"f-state-focus":x}));function U(){u.value=!1}const W=t.computed(()=>u.value),_=()=>{if(l.value){const C=l.value.getBoundingClientRect(),{left:h,top:G,height:H}=C;return{left:h,top:G+H}}return{left:0,top:0}};function q(C){u.value=!1}return o.expose({commitValue:q}),()=>t.createVNode(t.Fragment,null,[t.createVNode("div",t.mergeProps(o.attrs,{ref:l,class:"f-cmp-inputgroup",id:e.id}),[t.createVNode("div",{class:[e.customClass,R.value],onMouseenter:j,onMouseleave:A},[t.createVNode("input",{name:"input-group-value",autocomplete:""+e.autoComplete,class:B.value,disabled:e.disable,maxlength:e.maxLength,minlength:e.minLength,placeholder:b.value,readonly:g.value,tabindex:e.tabIndex,title:y.value,type:e.inputType,value:f.value,onBlur:T,onChange:O,onClick:v,onFocus:k,onInput:V,onKeydown:n,onKeyup:r,onMousedown:L},null),t.createVNode("div",{class:a.value},[D.value&&t.withDirectives(t.createVNode("span",{class:"input-group-text input-group-clear",onClick:K},[t.createVNode("i",{class:"f-icon modal_close"},null)]),[[t.vShow,F.value]]),e.buttonContent&&t.createVNode("span",{class:"input-group-text input-group-append-button",onClick:i,onMouseenter:s,onMouseleave:d,innerHTML:e.buttonContent},null)])])]),W.value&&t.createVNode(S,{"popup-content-position":_(),onClick:U},{default:()=>{var C,h;return[(h=(C=o.slots).default)==null?void 0:h.call(C)]}})])}}),I={install(e){e.component(p.name,p)}};m.ButtonEdit=p,m.buttonEditProps=w,m.default=I,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(m,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(m=typeof globalThis<"u"?globalThis:m||self,t(m["button-edit"]={},m.Vue))})(this,function(m,t){"use strict";const w={id:String,buttonContent:{type:String,default:'<i class="f-icon f-icon-lookup"></i>'},autoComplete:{type:Boolean,default:!1},customClass:{type:String,default:""},disable:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},enableClear:{type:Boolean,default:!1},modelValue:{type:String,default:""},readonly:{type:Boolean,default:!1},textAlign:{type:String,default:"left"},showButtonWhenDisabled:{type:Boolean,default:!1},enableTitle:{type:Boolean,default:!1},inputType:{type:String,default:"text"},forcePlaceholder:{type:Boolean,default:!1},placeholder:{type:String,default:""},minLength:Number,maxLength:Number,tabIndex:Number};function P(e,o,l){const f=t.computed(()=>({"input-group-append":!0,"append-force-show":e.showButtonWhenDisabled&&(e.readonly||e.disable)})),u=t.computed(()=>e.showButtonWhenDisabled||(!e.editable||!e.readonly)&&!e.disable);function a(c){u.value&&(l.value=!0,o.emit("clickButton",{origin:c,value:e.modelValue})),c.stopPropagation()}function i(c){o.emit("mouseEnterIcon",c)}function s(c){o.emit("mouseLeaveIcon",c)}function d(){o.emit("mouseOverButton")}return{buttonClass:f,onClickButton:a,onMouseEnterButton:i,onMouseLeaveButton:s,onMouseOverButton:d}}function M(e,o,l,f){const u=t.computed(()=>e.enableTitle?l.value:""),a=t.computed(()=>(e.disable||e.readonly)&&!e.forcePlaceholder?"":e.placeholder),i=t.computed(()=>e.readonly||!e.editable);let s=!1;const d=t.computed(()=>!e.disable&&s),c=t.computed(()=>({"text-left":e.textAlign==="left","text-center":e.textAlign==="center","text-right":e.textAlign==="right","form-control":!0,"f-utils-fill":!0}));function x(n,r=!0){l.value!==n&&(l.value=n,r&&o.emit("change",n),o.emit("update:modelValue",n))}t.watch(()=>e.modelValue,n=>{l.value=n,o.emit("change",n)});function g(n){s=!1,o.emit("blur",n),n.stopPropagation()}function B(n){o.emit("click",n)}function b(n){if(e.disable){s=!0;return}s=!0,i.value||o.emit("focus",n)}function y(n){o.emit("input",n.target.value);const r=n.target.value;f.value=r,l.value!==r&&x(r,!1)}function T(n){n.target.tagName!=="INPUT"&&n.preventDefault(),n.stopPropagation()}function v(n){o.emit("keydown",n)}function k(n){o.emit("keyup",n)}function V(n){const r=n.target.value;x(r)}return{hasFocusedTextBox:d,isTextBoxReadonly:i,textBoxClass:c,textBoxPlaceholder:a,textBoxTitle:u,changeTextBoxValue:x,onBlurTextBox:g,onClickTextBox:B,onFocusTextBox:b,onInput:y,onKeyDownTextBox:v,onKeyUpTextBox:k,onMouseDownTextBox:T,onTextBoxValueChange:V}}function N(e,o,l,f,u){const a=t.ref(!1),i=t.computed(()=>e.enableClear&&!e.readonly&&!e.disable),{changeTextBoxValue:s}=M(e,o,l,u);function d(B){a.value=B}t.watch(u,()=>{f.value?d(!!u.value):d(!1)});function c(B){const b=!e.readonly&&!e.disable&&e.editable,y=!e.editable;B.stopPropagation(),(b||y)&&(s("",!1),d(!a.value),o.emit("clear"))}function x(B){if(i.value){if(!l.value){d(!1);return}(!e.editable||!e.readonly)&&!e.disable&&d(!0)}}function g(B){i.value&&d(!1)}return{enableClearButton:i,showClearButton:a,onClearValue:c,onMouseEnterTextBox:x,onMouseLeaveTextBox:g}}const E={popupContentPosition:{type:Object,default:{left:0,top:0}}},S=t.defineComponent({name:"FOverlay",props:E,emits:["click"],setup(e,o){const l=t.ref(e.popupContentPosition);function f(a){o.emit("click"),a.preventDefault(),a.stopPropagation()}const u=t.computed(()=>({position:"relative",left:`${l.value.left}px`,top:`${l.value.top}px`}));return()=>t.createVNode(t.Teleport,{to:"body"},{default:()=>{var a,i;return[t.createVNode("div",{class:"overlay-container",style:"pointer-events: auto;",onClick:s=>f(s)},[t.createVNode("div",{style:u.value},[(i=(a=o.slots).default)==null?void 0:i.call(a)])])]}})}}),p=t.defineComponent({name:"FButtonEdit",props:w,emits:["updateExtendInfo","clear","change","click","clickButton","blur","focus","mouseEnterIcon","mouseLeaveIcon","keyup","keydown","inputClick","input","update:modelValue"],setup(e,o){const l=t.ref(),f=t.ref(e.modelValue),u=t.ref(!1),{buttonClass:a,onClickButton:i,onMouseEnterButton:s,onMouseLeaveButton:d}=P(e,o,u),c=t.ref(""),{hasFocusedTextBox:x,isTextBoxReadonly:g,textBoxClass:B,textBoxPlaceholder:b,textBoxTitle:y,onBlurTextBox:T,onClickTextBox:v,onFocusTextBox:k,onInput:V,onKeyDownTextBox:n,onKeyUpTextBox:r,onMouseDownTextBox:L,onTextBoxValueChange:O}=M(e,o,f,c),{enableClearButton:D,showClearButton:F,onClearValue:K,onMouseEnterTextBox:j,onMouseLeaveTextBox:A}=N(e,o,f,x,c),R=t.computed(()=>({"input-group":!0,"f-state-disable":e.disable,"f-state-editable":e.editable&&!e.disable&&!e.readonly,"f-state-readonly":e.readonly&&!e.disable,"f-state-focus":x}));function U(){u.value=!1}const W=t.computed(()=>u.value),_=()=>{if(l.value){const C=l.value.getBoundingClientRect(),{left:h,top:G,height:H}=C;return{left:h,top:G+H}}return{left:0,top:0}};function q(C){u.value=!1}return o.expose({commitValue:q}),()=>t.createVNode(t.Fragment,null,[t.createVNode("div",t.mergeProps(o.attrs,{ref:l,class:"f-cmp-inputgroup",id:e.id}),[t.createVNode("div",{class:[e.customClass,R.value],onMouseenter:j,onMouseleave:A},[t.createVNode("input",{name:"input-group-value",autocomplete:""+e.autoComplete,class:B.value,disabled:e.disable,maxlength:e.maxLength,minlength:e.minLength,placeholder:b.value,readonly:g.value,tabindex:e.tabIndex,title:y.value,type:e.inputType,value:f.value,onBlur:T,onChange:O,onClick:v,onFocus:k,onInput:V,onKeydown:n,onKeyup:r,onMousedown:L},null),t.createVNode("div",{class:a.value},[D.value&&t.withDirectives(t.createVNode("span",{class:"input-group-text input-group-clear",onClick:K},[t.createVNode("i",{class:"f-icon modal_close"},null)]),[[t.vShow,F.value]]),e.buttonContent&&t.createVNode("span",{class:"input-group-text input-group-append-button",onClick:i,onMouseenter:s,onMouseleave:d,innerHTML:e.buttonContent},null)])])]),W.value&&t.createVNode(S,{"popup-content-position":_(),onClick:U},{default:()=>{var C,h;return[(h=(C=o.slots).default)==null?void 0:h.call(C)]}})])}}),I={install(e){e.component(p.name,p)}};m.ButtonEdit=p,m.buttonEditProps=w,m.default=I,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "button-edit",
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,16 +1,53 @@
1
1
  import { computed as x, ref as v, defineComponent as p, createVNode as m } from "vue";
2
2
  const V = {
3
+ /**
4
+ * 组件标识
5
+ */
3
6
  id: String,
7
+ /**
8
+ * 组件名称
9
+ */
4
10
  name: { type: String, default: "" },
11
+ /**
12
+ * 单选组枚举数组
13
+ */
5
14
  enumData: { type: Array, default: [] },
15
+ /**
16
+ * 枚举数组中展示文本的key值。
17
+ */
6
18
  textField: { type: String, default: "name" },
19
+ /**
20
+ * 枚举数组中枚举值的key值。
21
+ */
7
22
  valueField: { type: String, default: "value" },
23
+ /**
24
+ * 组件是否水平排列
25
+ */
8
26
  horizontal: { type: Boolean, default: !1 },
27
+ /**
28
+ * 禁用组件,不允许切换单选值
29
+ */
9
30
  disable: { type: Boolean, default: !1 },
31
+ /**
32
+ * 组件值,字符串或者数组
33
+ */
10
34
  modelValue: [String, Array],
35
+ /**
36
+ * 输入框Tab键索引
37
+ */
11
38
  tabIndex: { type: Number, default: 0 },
39
+ /**
40
+ * 分隔符,默认逗号
41
+ */
12
42
  separator: { type: String, default: "," },
43
+ /**
44
+ * 值类型是否为字符串
45
+ */
13
46
  isStringValue: { type: Boolean, default: !0 },
47
+ /**
48
+ * 异步获取枚举数组方法
49
+ */
50
+ // loadData: () => Observable < { data: Array<Checkbox> } >
14
51
  loadData: { type: Function }
15
52
  };
16
53
  function y(e, i, l) {
@@ -48,7 +85,7 @@ function y(e, i, l) {
48
85
  onClickCheckbox: b
49
86
  };
50
87
  }
51
- const k = p({
88
+ const k = /* @__PURE__ */ p({
52
89
  name: "FCheckboxGroup",
53
90
  props: V,
54
91
  emits: ["changeValue", "update:modelValue"],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "checkbox",
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",