@farris/ui-vue 1.0.0-beta.2 → 1.0.0-beta.4

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 (246) hide show
  1. package/accordion/index.esm.js +93 -0
  2. package/accordion/index.umd.js +1 -0
  3. package/accordion/package.json +8 -0
  4. package/accordion/style.css +1 -0
  5. package/avatar/index.esm.js +94 -0
  6. package/avatar/index.umd.js +1 -0
  7. package/avatar/package.json +8 -0
  8. package/avatar/style.css +1 -0
  9. package/button/index.esm.js +206 -0
  10. package/button/index.umd.js +1 -0
  11. package/button/package.json +8 -0
  12. package/button-edit/index.esm.js +300 -0
  13. package/button-edit/index.umd.js +1 -0
  14. package/button-edit/package.json +8 -0
  15. package/checkbox/index.esm.js +97 -0
  16. package/checkbox/index.umd.js +1 -0
  17. package/checkbox/package.json +8 -0
  18. package/combo-list/index.esm.js +457 -0
  19. package/combo-list/index.umd.js +1 -0
  20. package/combo-list/package.json +8 -0
  21. package/data-grid/index.esm.js +1535 -0
  22. package/data-grid/index.umd.js +1 -0
  23. package/data-grid/package.json +8 -0
  24. package/data-grid/style.css +1 -0
  25. package/date-picker/index.esm.js +1479 -0
  26. package/date-picker/index.umd.js +1 -0
  27. package/date-picker/package.json +8 -0
  28. package/date-picker/style.css +1 -0
  29. package/{src/index.esm.js → farris.all.esm.js} +1 -2
  30. package/farris.all.umd.js +1 -0
  31. package/list-view/index.esm.js +144 -0
  32. package/list-view/index.umd.js +1 -0
  33. package/list-view/package.json +8 -0
  34. package/list-view/style.css +1 -0
  35. package/message-box/index.esm.js +499 -0
  36. package/message-box/index.umd.js +1 -0
  37. package/message-box/package.json +8 -0
  38. package/modal/index.esm.js +165 -0
  39. package/modal/index.umd.js +1 -0
  40. package/modal/package.json +8 -0
  41. package/notify/index.esm.js +187 -0
  42. package/notify/index.umd.js +1 -0
  43. package/notify/package.json +8 -0
  44. package/notify/style.css +1 -0
  45. package/package.json +6 -5
  46. package/pagination/index.esm.js +334 -0
  47. package/pagination/index.umd.js +1 -0
  48. package/pagination/package.json +8 -0
  49. package/pagination/style.css +1 -0
  50. package/popover/index.esm.js +83 -0
  51. package/popover/index.umd.js +1 -0
  52. package/popover/package.json +8 -0
  53. package/popover/style.css +1 -0
  54. package/radio-group/index.esm.js +79 -0
  55. package/radio-group/index.umd.js +1 -0
  56. package/radio-group/package.json +8 -0
  57. package/section/index.esm.js +70 -0
  58. package/section/index.umd.js +1 -0
  59. package/section/package.json +8 -0
  60. package/switch/index.esm.js +78 -0
  61. package/switch/index.umd.js +1 -0
  62. package/switch/package.json +8 -0
  63. package/tabs/index.esm.js +385 -0
  64. package/tabs/index.umd.js +1 -0
  65. package/tabs/package.json +8 -0
  66. package/tabs/style.css +1 -0
  67. package/text/index.esm.js +33 -0
  68. package/text/index.umd.js +1 -0
  69. package/text/package.json +8 -0
  70. package/tooltip/index.esm.js +195 -0
  71. package/tooltip/index.umd.js +1 -0
  72. package/tooltip/package.json +8 -0
  73. package/tooltip/style.css +1 -0
  74. package/types/accordion/index.d.ts +25 -0
  75. package/types/accordion/src/accordion.component.d.ts +70 -0
  76. package/types/accordion/src/accordion.props.d.ts +50 -0
  77. package/types/accordion/src/components/accordion-item.component.d.ts +38 -0
  78. package/types/accordion/src/components/accordion-item.props.d.ts +34 -0
  79. package/types/avatar/index.d.ts +23 -0
  80. package/types/avatar/src/avatar.component.d.ts +109 -0
  81. package/types/avatar/src/avatar.props.d.ts +96 -0
  82. package/types/avatar/src/composition/types.d.ts +31 -0
  83. package/types/avatar/src/composition/use-image.d.ts +19 -0
  84. package/types/button/index.d.ts +24 -0
  85. package/types/button/src/button-group.component.d.ts +106 -0
  86. package/types/button/src/button-group.props.d.ts +106 -0
  87. package/types/button/src/button.component.d.ts +34 -0
  88. package/types/button/src/button.props.d.ts +47 -0
  89. package/types/button/src/composition/types-group.d.ts +24 -0
  90. package/types/button/src/composition/types.d.ts +24 -0
  91. package/types/button/src/composition/use-button-group.d.ts +19 -0
  92. package/types/button/src/composition/use-button.d.ts +19 -0
  93. package/types/button-edit/index.d.ts +23 -0
  94. package/types/button-edit/src/button-edit.props.d.ts +135 -0
  95. package/types/button-edit/src/composition/types.d.ts +118 -0
  96. package/types/button-edit/src/composition/use-button.d.ts +19 -0
  97. package/types/button-edit/src/composition/use-clear.d.ts +19 -0
  98. package/types/button-edit/src/composition/use-text-box.d.ts +19 -0
  99. package/types/checkbox/index.d.ts +23 -0
  100. package/types/checkbox/src/checkbox-group.component.d.ts +148 -0
  101. package/types/checkbox/src/checkbox-group.props.d.ts +123 -0
  102. package/types/checkbox/src/composition/types.d.ts +46 -0
  103. package/types/checkbox/src/composition/use-checkbox-group.d.ts +19 -0
  104. package/types/combo-list/index.d.ts +25 -0
  105. package/types/combo-list/src/combo-list.props.d.ts +290 -0
  106. package/types/combo-list/src/components/option.component.d.ts +39 -0
  107. package/types/combo-list/src/components/options.component.d.ts +10 -0
  108. package/types/combo-list/src/composition/index.d.ts +18 -0
  109. package/types/combo-list/src/composition/use-combo-list.d.ts +30 -0
  110. package/types/combo-list/src/composition/use-option.d.ts +19 -0
  111. package/types/combo-list/src/composition/use-options.d.ts +2 -0
  112. package/types/combo-list/src/composition/use-panel.d.ts +8 -0
  113. package/types/combo-list/src/const.d.ts +40 -0
  114. package/types/combo-list/src/types.d.ts +186 -0
  115. package/types/data-grid/index.d.ts +23 -0
  116. package/types/data-grid/src/components/data/data-area.component.d.ts +21 -0
  117. package/types/data-grid/src/components/editors/date-picker.component.d.ts +2 -0
  118. package/types/data-grid/src/components/editors/text-area-editor.component.d.ts +2 -0
  119. package/types/data-grid/src/components/editors/text-editor.component.d.ts +17 -0
  120. package/types/data-grid/src/components/header/data-grid-header.component.d.ts +22 -0
  121. package/types/data-grid/src/components/pagination/data-grid-pagination.component.d.ts +5 -0
  122. package/types/data-grid/src/components/scrollbar/horizontal-scrollbar.component.d.ts +21 -0
  123. package/types/data-grid/src/components/scrollbar/vertical-scrollbar.component.d.ts +21 -0
  124. package/types/data-grid/src/components/sidebar/data-grid-sidebar.component.d.ts +21 -0
  125. package/types/data-grid/src/components/summary/data-grid-summary.component.d.ts +5 -0
  126. package/types/data-grid/src/composition/types.d.ts +175 -0
  127. package/types/data-grid/src/composition/use-column.d.ts +17 -0
  128. package/types/data-grid/src/composition/use-data-view.d.ts +19 -0
  129. package/types/data-grid/src/composition/use-edit.d.ts +18 -0
  130. package/types/data-grid/src/composition/use-fit-column.d.ts +20 -0
  131. package/types/data-grid/src/composition/use-group-column.d.ts +22 -0
  132. package/types/data-grid/src/composition/use-group-data.d.ts +3 -0
  133. package/types/data-grid/src/composition/use-positon-style.d.ts +20 -0
  134. package/types/data-grid/src/composition/use-resize.d.ts +20 -0
  135. package/types/data-grid/src/composition/use-row.d.ts +3 -0
  136. package/types/data-grid/src/composition/use-sidebar.d.ts +3 -0
  137. package/types/data-grid/src/composition/use-virtual-scroll.d.ts +20 -0
  138. package/types/data-grid/src/composition/use-visual-data.d.ts +19 -0
  139. package/types/data-grid/src/data-grid.component.d.ts +278 -0
  140. package/types/data-grid/src/data-grid.props.d.ts +650 -0
  141. package/types/date-picker/index.d.ts +28 -0
  142. package/types/date-picker/src/components/calendar/calendar.component.d.ts +166 -0
  143. package/types/date-picker/src/components/calendar/calendar.props.d.ts +94 -0
  144. package/types/date-picker/src/components/calendar-navbar/calendar-navbar.component.d.ts +138 -0
  145. package/types/date-picker/src/components/calendar-navbar/calendar-navbar.props.d.ts +81 -0
  146. package/types/date-picker/src/components/date-picker-container/date-picker-container.component.d.ts +626 -0
  147. package/types/date-picker/src/components/date-picker-container/date-picker-container.props.d.ts +306 -0
  148. package/types/date-picker/src/components/month/month.component.d.ts +86 -0
  149. package/types/date-picker/src/components/month/month.props.d.ts +57 -0
  150. package/types/date-picker/src/components/year/year.component.d.ts +86 -0
  151. package/types/date-picker/src/components/year/year.props.d.ts +57 -0
  152. package/types/date-picker/src/composition/types.d.ts +102 -0
  153. package/types/date-picker/src/composition/use-calendar.d.ts +2 -0
  154. package/types/date-picker/src/composition/use-compare.d.ts +2 -0
  155. package/types/date-picker/src/composition/use-date.d.ts +2 -0
  156. package/types/date-picker/src/composition/use-disable-date.d.ts +18 -0
  157. package/types/date-picker/src/composition/use-disable-month.d.ts +2 -0
  158. package/types/date-picker/src/composition/use-event.d.ts +45 -0
  159. package/types/date-picker/src/composition/use-mark.d.ts +2 -0
  160. package/types/date-picker/src/composition/use-month.d.ts +2 -0
  161. package/types/date-picker/src/composition/use-number.d.ts +2 -0
  162. package/types/date-picker/src/composition/use-year.d.ts +2 -0
  163. package/types/date-picker/src/date-picker.props.d.ts +168 -0
  164. package/types/date-picker/src/types/calendar.d.ts +30 -0
  165. package/types/date-picker/src/types/common.d.ts +42 -0
  166. package/types/date-picker/src/types/date-model.d.ts +38 -0
  167. package/types/date-picker/src/types/month.d.ts +48 -0
  168. package/types/date-picker/src/types/year.d.ts +24 -0
  169. package/types/index.d.ts +20 -0
  170. package/types/list-view/index.d.ts +23 -0
  171. package/types/list-view/src/components/list-view-checkbox.component.d.ts +32 -0
  172. package/types/list-view/src/components/list-view-checkbox.props.d.ts +31 -0
  173. package/types/list-view/src/list-view.props.d.ts +44 -0
  174. package/types/message-box/index.d.ts +24 -0
  175. package/types/message-box/src/composition/types.d.ts +18 -0
  176. package/types/message-box/src/composition/use-copy.d.ts +18 -0
  177. package/types/message-box/src/message-box.component.d.ts +72 -0
  178. package/types/message-box/src/message-box.props.d.ts +52 -0
  179. package/types/modal/index.d.ts +23 -0
  180. package/types/modal/src/modal.component.d.ts +104 -0
  181. package/types/modal/src/modal.props.d.ts +72 -0
  182. package/types/notify/index.d.ts +26 -0
  183. package/types/notify/src/components/toast.component.d.ts +21 -0
  184. package/types/notify/src/components/toast.props.d.ts +27 -0
  185. package/types/notify/src/notify.props.d.ts +99 -0
  186. package/types/number-range/index.d.ts +23 -0
  187. package/types/number-range/src/composition/types.d.ts +52 -0
  188. package/types/number-range/src/composition/use-data.d.ts +19 -0
  189. package/types/number-range/src/composition/use-util.d.ts +19 -0
  190. package/types/number-range/src/number-range.component.d.ts +247 -0
  191. package/types/number-range/src/number-range.props.d.ts +216 -0
  192. package/types/number-spinner/index.d.ts +23 -0
  193. package/types/number-spinner/src/composition/types.d.ts +52 -0
  194. package/types/number-spinner/src/composition/use-data.d.ts +19 -0
  195. package/types/number-spinner/src/composition/use-util.d.ts +19 -0
  196. package/types/number-spinner/src/number-spinner.component.d.ts +202 -0
  197. package/types/number-spinner/src/number-spinner.props.d.ts +181 -0
  198. package/types/overlay/src/overlay.component.d.ts +20 -0
  199. package/types/overlay/src/overlay.props.d.ts +26 -0
  200. package/types/pagination/index.d.ts +23 -0
  201. package/types/pagination/src/components/buttons/goto-buttons.component.d.ts +19 -0
  202. package/types/pagination/src/components/buttons/next-buttons.component.d.ts +20 -0
  203. package/types/pagination/src/components/buttons/previous-buttons.component.d.ts +20 -0
  204. package/types/pagination/src/components/pages/page-info.component.d.ts +19 -0
  205. package/types/pagination/src/components/pages/page-list.component.d.ts +19 -0
  206. package/types/pagination/src/components/pages/page-number.component.d.ts +20 -0
  207. package/types/pagination/src/composition/types.d.ts +24 -0
  208. package/types/pagination/src/composition/use-pages.d.ts +18 -0
  209. package/types/pagination/src/pagination.components.d.ts +41 -0
  210. package/types/pagination/src/pagination.props.d.ts +36 -0
  211. package/types/popover/index.d.ts +24 -0
  212. package/types/popover/src/popover.component.d.ts +26 -0
  213. package/types/popover/src/popover.directive.d.ts +5 -0
  214. package/types/popover/src/popover.props.d.ts +30 -0
  215. package/types/radio-group/index.d.ts +23 -0
  216. package/types/radio-group/src/composition/change-radio.d.ts +19 -0
  217. package/types/radio-group/src/composition/types.d.ts +42 -0
  218. package/types/radio-group/src/radio-group.component.d.ts +91 -0
  219. package/types/radio-group/src/radio-group.props.d.ts +87 -0
  220. package/types/section/index.d.ts +23 -0
  221. package/types/section/src/section.component.d.ts +187 -0
  222. package/types/section/src/section.props.d.ts +117 -0
  223. package/types/switch/index.d.ts +23 -0
  224. package/types/switch/src/switch.component.d.ts +66 -0
  225. package/types/switch/src/switch.props.d.ts +52 -0
  226. package/types/tabs/index.d.ts +25 -0
  227. package/types/tabs/src/components/tab-page.component.d.ts +101 -0
  228. package/types/tabs/src/components/tab-page.props.d.ts +63 -0
  229. package/types/tabs/src/composition/types.d.ts +35 -0
  230. package/types/tabs/src/composition/use-tabs.d.ts +18 -0
  231. package/types/tabs/src/tabs.component.d.ts +149 -0
  232. package/types/tabs/src/tabs.props.d.ts +86 -0
  233. package/types/text/index.d.ts +23 -0
  234. package/types/text/src/text.component.d.ts +14 -0
  235. package/types/text/src/text.props.d.ts +26 -0
  236. package/types/tooltip/index.d.ts +24 -0
  237. package/types/tooltip/src/composition/types.d.ts +45 -0
  238. package/types/tooltip/src/composition/use-adjust-placement.d.ts +20 -0
  239. package/types/tooltip/src/composition/use-adjust-position.d.ts +6 -0
  240. package/types/tooltip/src/composition/use-calculate-position.d.ts +21 -0
  241. package/types/tooltip/src/composition/use-relative.d.ts +19 -0
  242. package/types/tooltip/src/composition/use-tooltip-position.d.ts +22 -0
  243. package/types/tooltip/src/tooltip.component.d.ts +56 -0
  244. package/types/tooltip/src/tooltip.props.d.ts +45 -0
  245. package/src/index.umd.js +0 -1
  246. /package/{src/style.css → style.css} +0 -0
@@ -0,0 +1,144 @@
1
+ import { defineComponent as V, ref as s, createVNode as a, withDirectives as U, vModelCheckbox as W, computed as v } from "vue";
2
+ const $ = {
3
+ data: { type: Array, default: [] },
4
+ multiSelect: { Type: Boolean, default: !1 },
5
+ cardView: { Type: Boolean, default: !1 }
6
+ }, q = {
7
+ checked: { Type: Boolean, default: !1 },
8
+ id: { Type: String, default: "" },
9
+ disabled: { Type: Boolean, default: !1 }
10
+ }, x = V({
11
+ name: "FListViewCheckBox",
12
+ props: q,
13
+ emits: ["change"],
14
+ setup(i, l) {
15
+ const o = s(i.checked), p = s(i.disabled), k = s(i.id);
16
+ function w(n) {
17
+ n.stopPropagation(), o.value = !o.value, p.value || l.emit("change", {
18
+ originalEvent: n,
19
+ checked: !o.value
20
+ });
21
+ }
22
+ return () => a("div", {
23
+ class: "custom-control custom-checkbox custom-control-inline listview-checkbox"
24
+ }, [U(a("input", {
25
+ title: k.value,
26
+ type: "checkbox",
27
+ class: "custom-control-input",
28
+ "onUpdate:modelValue": (n) => o.value = n
29
+ }, null), [[W, o.value]]), a("label", {
30
+ class: "custom-control-label",
31
+ onClick: (n) => w(n)
32
+ }, null)]);
33
+ }
34
+ });
35
+ const y = V({
36
+ name: "FListView",
37
+ props: $,
38
+ emits: ["checkValuesChange", "clickItem", "selectChange"],
39
+ setup(i, l) {
40
+ return () => {
41
+ const o = s(i.multiSelect), p = s(i.cardView), k = s(""), w = s(!0), n = s({}), S = s("\u6682\u65E0\u6570\u636E"), L = s(!0), B = s(!1), D = [], b = s("id");
42
+ let u = [];
43
+ const m = s(i.data), P = s(i.data), O = v(() => ({
44
+ "f-list-view": !0,
45
+ "f-list-view-multiple": o.value
46
+ })), T = v(() => ({
47
+ "f-list-view-group": !0,
48
+ "d-flex": p.value,
49
+ "flex-wrap": p.value
50
+ })), j = v(() => !!m.value && m.value.length > 0);
51
+ function A(e) {
52
+ return !1;
53
+ }
54
+ const F = (e) => {
55
+ const t = {
56
+ "f-list-view-group-item": !0,
57
+ "f-un-click": !!e.unClick,
58
+ "f-un-select": !!e.selectDisable,
59
+ "f-listview-active": A()
60
+ };
61
+ return k.value.split(" ").reduce((r, C) => (r[C] = !0, r), t), t;
62
+ }, I = v(() => m.value.length === 0), M = v(() => I.value && !l.slots.empty), G = v(() => !!l.slots.footer || w.value);
63
+ function f(e, t) {
64
+ return "";
65
+ }
66
+ function N(e) {
67
+ l.emit("checkValuesChange", e);
68
+ }
69
+ function g(e, t, c, r = !1) {
70
+ const C = typeof event == "boolean";
71
+ if (!(t.unClick || t.selectDisable)) {
72
+ if (l.emit("selectChange", {
73
+ listdata: t,
74
+ index: c
75
+ }), o.value)
76
+ if (t.checked) {
77
+ if (!L.value || C) {
78
+ const h = u.findIndex((d, K) => f() === f());
79
+ u.splice(h, 1), t.checked = !1;
80
+ }
81
+ } else
82
+ u.find((d, K) => f() === f()) || (u.unshift(t), t.checked = !0);
83
+ else
84
+ u = [], u.push(t);
85
+ if (r || (n.value = t), l.emit("clickItem", {
86
+ data: u,
87
+ index: c,
88
+ checkChangeEvent: r
89
+ }), o.value) {
90
+ let h = P.value.filter((d) => !!d.checked).map((d) => d[b.value]);
91
+ B.value && (h = D.map((d) => d[b.value])), N(h);
92
+ }
93
+ }
94
+ }
95
+ function E(e, t, c) {
96
+ const r = e.checked;
97
+ g(r, t, c, !0);
98
+ }
99
+ return a("div", {
100
+ class: O.value
101
+ }, [l.slots.header && a("div", {
102
+ class: "f-list-view-header"
103
+ }, [l.slots.header()]), a("div", {
104
+ class: "f-list-view-content"
105
+ }, [a("ul", {
106
+ class: T.value,
107
+ style: "list-style: none;"
108
+ }, [j.value && m.value.map((e, t) => a("li", {
109
+ class: F(e),
110
+ id: f(),
111
+ onClick: (c) => g(c, e, t)
112
+ }, [o.value && a("div", {
113
+ class: "f-list-select",
114
+ onClick: (c) => c.stopPropagation()
115
+ }, [a(x, {
116
+ id: "list-" + f(),
117
+ disabled: e.selectDisable || e.unClick,
118
+ checked: e.checked,
119
+ onChange: (c) => E(c, e, t)
120
+ }, null)]), a("div", {
121
+ class: "f-list-content"
122
+ }, [l.slots.content && l.slots.content({
123
+ item: e,
124
+ index: t,
125
+ selectedItem: n
126
+ })])])), M.value && a("div", {
127
+ class: "f-list-view-emptydata"
128
+ }, [a("p", {
129
+ class: "f-empty-title"
130
+ }, [S.value])]), l.slots.empty && l.slots.empty()])]), G.value && a("div", {
131
+ class: "f-list-view-footer"
132
+ }, [l.slots.footer && l.slots.footer()])]);
133
+ };
134
+ }
135
+ }), H = {
136
+ install(i) {
137
+ i.component(y.name, y);
138
+ }
139
+ };
140
+ export {
141
+ y as ListView,
142
+ H as default,
143
+ $ as listViewProps
144
+ };
@@ -0,0 +1 @@
1
+ (function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(o=typeof globalThis<"u"?globalThis:o||self,e(o["list-view"]={},o.Vue))})(this,function(o,e){"use strict";const b={data:{type:Array,default:[]},multiSelect:{Type:Boolean,default:!1},cardView:{Type:Boolean,default:!1}},g={checked:{Type:Boolean,default:!1},id:{Type:String,default:""},disabled:{Type:Boolean,default:!1}},N=e.defineComponent({name:"FListViewCheckBox",props:g,emits:["change"],setup(a,s){const i=e.ref(a.checked),h=e.ref(a.disabled),k=e.ref(a.id);function w(n){n.stopPropagation(),i.value=!i.value,h.value||s.emit("change",{originalEvent:n,checked:!i.value})}return()=>e.createVNode("div",{class:"custom-control custom-checkbox custom-control-inline listview-checkbox"},[e.withDirectives(e.createVNode("input",{title:k.value,type:"checkbox",class:"custom-control-input","onUpdate:modelValue":n=>i.value=n},null),[[e.vModelCheckbox,i.value]]),e.createVNode("label",{class:"custom-control-label",onClick:n=>w(n)},null)])}}),U="",V=e.defineComponent({name:"FListView",props:b,emits:["checkValuesChange","clickItem","selectChange"],setup(a,s){return()=>{const i=e.ref(a.multiSelect),h=e.ref(a.cardView),k=e.ref(""),w=e.ref(!0),n=e.ref({}),L=e.ref("\u6682\u65E0\u6570\u636E"),P=e.ref(!0),T=e.ref(!1),j=[],y=e.ref("id");let r=[];const m=e.ref(a.data),B=e.ref(a.data),D=e.computed(()=>({"f-list-view":!0,"f-list-view-multiple":i.value})),O=e.computed(()=>({"f-list-view-group":!0,"d-flex":h.value,"flex-wrap":h.value})),M=e.computed(()=>!!m.value&&m.value.length>0);function A(t){return!1}const F=t=>{const l={"f-list-view-group-item":!0,"f-un-click":!!t.unClick,"f-un-select":!!t.selectDisable,"f-listview-active":A()};return k.value.split(" ").reduce((d,C)=>(d[C]=!0,d),l),l},I=e.computed(()=>m.value.length===0),G=e.computed(()=>I.value&&!s.slots.empty),E=e.computed(()=>!!s.slots.footer||w.value);function f(t,l){return""}function _(t){s.emit("checkValuesChange",t)}function v(t,l,c,d=!1){const C=typeof event=="boolean";if(!(l.unClick||l.selectDisable)){if(s.emit("selectChange",{listdata:l,index:c}),i.value)if(l.checked){if(!P.value||C){const p=r.findIndex((u,K)=>f()===f());r.splice(p,1),l.checked=!1}}else r.find((u,K)=>f()===f())||(r.unshift(l),l.checked=!0);else r=[],r.push(l);if(d||(n.value=l),s.emit("clickItem",{data:r,index:c,checkChangeEvent:d}),i.value){let p=B.value.filter(u=>!!u.checked).map(u=>u[y.value]);T.value&&(p=j.map(u=>u[y.value])),_(p)}}}function q(t,l,c){const d=t.checked;v(d,l,c,!0)}return e.createVNode("div",{class:D.value},[s.slots.header&&e.createVNode("div",{class:"f-list-view-header"},[s.slots.header()]),e.createVNode("div",{class:"f-list-view-content"},[e.createVNode("ul",{class:O.value,style:"list-style: none;"},[M.value&&m.value.map((t,l)=>e.createVNode("li",{class:F(t),id:f(),onClick:c=>v(c,t,l)},[i.value&&e.createVNode("div",{class:"f-list-select",onClick:c=>c.stopPropagation()},[e.createVNode(N,{id:"list-"+f(),disabled:t.selectDisable||t.unClick,checked:t.checked,onChange:c=>q(c,t,l)},null)]),e.createVNode("div",{class:"f-list-content"},[s.slots.content&&s.slots.content({item:t,index:l,selectedItem:n})])])),G.value&&e.createVNode("div",{class:"f-list-view-emptydata"},[e.createVNode("p",{class:"f-empty-title"},[L.value])]),s.slots.empty&&s.slots.empty()])]),E.value&&e.createVNode("div",{class:"f-list-view-footer"},[s.slots.footer&&s.slots.footer()])])}}}),S={install(a){a.component(V.name,V)}};o.ListView=V,o.default=S,o.listViewProps=b,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "list-view",
3
+ "version": "1.0.0-beta.5",
4
+ "main": "index.umd.js",
5
+ "module": "index.es.js",
6
+ "style": "style.css",
7
+ "types": "../types/list-view/index.d.ts"
8
+ }
@@ -0,0 +1 @@
1
+ .f-listview-fill{flex-grow:1;flex-shrink:1;flex-basis:0;overflow:hidden}.f-listview-fill .f-list-view{height:100%}.f-listview-fill .f-list-view .f-list-view-header,.f-listview-fill .f-list-view .f-list-view-footer{flex-shrink:0}.f-listview-fill .f-list-view .f-list-view-content{overflow-y:auto;flex-grow:1;flex-shrink:1;flex-basis:0}.f-list-view{display:flex;flex-direction:column}.f-list-view .f-paging-wrapper{padding:14px 0}.f-list-view-group-item{display:flex;align-items:center}.f-list-view-group-item.f-none-border{border-bottom:0}.f-list-view-group-item .f-list-content{flex:1 1 auto;width:100%}.f-list-select{padding:0 14px}.f-list-view-emptydata .f-empty-title{font-size:14px;line-height:22px;color:#999;padding:20px 0;text-align:center}
@@ -0,0 +1,499 @@
1
+ import { defineComponent as Z, ref as t, computed as s, createVNode as e, createTextVNode as re, Fragment as ie, watch as de, Teleport as pe, reactive as g, createApp as ve, onUnmounted as me, mergeProps as ye } from "vue";
2
+ const fe = {
3
+ type: { Type: String, default: "info" },
4
+ title: { Type: String, default: "" },
5
+ detail: { Type: String, default: "" },
6
+ okButtonText: { Type: String, default: "\u786E\u5B9A" },
7
+ cancelButtonText: { Type: String, default: "\u53D6\u6D88" },
8
+ exceptionInfo: { Type: Object, default: { date: "", message: "", detail: "" } }
9
+ };
10
+ function K() {
11
+ return new DOMException("The request is not allowed", "NotAllowedError");
12
+ }
13
+ async function he(l) {
14
+ if (!navigator.clipboard)
15
+ throw K();
16
+ return navigator.clipboard.writeText(l);
17
+ }
18
+ async function ge(l) {
19
+ const n = document.createElement("span");
20
+ n.textContent = l, n.style.whiteSpace = "pre", n.style.webkitUserSelect = "auto", n.style.userSelect = "all", document.body.appendChild(n);
21
+ const a = window.getSelection(), c = window.document.createRange();
22
+ a == null || a.removeAllRanges(), c.selectNode(n), a == null || a.addRange(c);
23
+ let i = !1;
24
+ try {
25
+ i = window.document.execCommand("copy");
26
+ } finally {
27
+ a == null || a.removeAllRanges(), window.document.body.removeChild(n);
28
+ }
29
+ if (!i)
30
+ throw K();
31
+ }
32
+ async function xe(l) {
33
+ try {
34
+ await he(l);
35
+ } catch (n) {
36
+ try {
37
+ await ge(l);
38
+ } catch (a) {
39
+ throw a || n || K();
40
+ }
41
+ }
42
+ }
43
+ function be(l, n) {
44
+ async function a(c) {
45
+ await xe(c);
46
+ }
47
+ return { onCopy: a };
48
+ }
49
+ const J = Z({
50
+ name: "FMessageBox",
51
+ props: fe,
52
+ emits: ["accept", "reject", "close"],
53
+ setup(l, n) {
54
+ const a = t(l.type), c = t(l.title), i = t(l.detail), r = t(l.exceptionInfo);
55
+ t("");
56
+ const B = t(14), p = t(140);
57
+ t(""), t("");
58
+ const h = t(!1), x = t(""), S = t(i.value.length), m = t([]), T = t(l.okButtonText), b = t(l.cancelButtonText), A = t(!0), $ = t(!0), H = t(!0), j = t("\u590D\u5236\u8BE6\u7EC6\u4FE1\u606F"), w = t(3), D = t(480), C = s(() => {
59
+ const o = {
60
+ "modal-tips": !0,
61
+ "d-flex": !0,
62
+ "flex-row": !0
63
+ }, v = `messager-type-${a.value}`;
64
+ return o[v] = !0, o;
65
+ }), M = s(() => {
66
+ const o = {};
67
+ return a.value === "prompt" ? o.padding = "0.5rem 0.5rem 1rem 1.5rem" : a.value === "error" && (o.padding = "0.5rem 1.5rem 1rem 1.5rem"), o;
68
+ }), z = s(() => {
69
+ const o = {
70
+ "f-icon": !0
71
+ }, v = `f-icon-${a.value}`;
72
+ return o[v] = !0, o;
73
+ }), V = s(() => c.value || r.value && r.value.message), O = s(() => i.value), I = s(() => !!i.value), R = s(() => !!r.value), N = s(() => !!r.value && !!r.value.date), q = s(() => `\u53D1\u751F\u65F6\u95F4 : ${r.value && r.value.date || ""}`), L = s(() => !!r.value && !!r.value.detail), _ = s(() => {
74
+ const o = `${D.value}px`;
75
+ return {
76
+ overflow: "hidden",
77
+ "text-overflow": "ellipsis",
78
+ display: "-webkit-box",
79
+ "-webkit-box-orient": "vertical",
80
+ "-webkit-line-clamp": w.value,
81
+ "max-height": o
82
+ };
83
+ }), F = s(() => r.value && r.value.detail || ""), P = s(() => !0), y = t(!1), U = t("\u5C55\u5F00"), W = t("\u6536\u8D77"), G = s(() => {
84
+ const o = {
85
+ display: "block",
86
+ color: "#2A87FF"
87
+ };
88
+ return o["text-align"] = y.value ? "" : "right", o;
89
+ });
90
+ function u(o, v) {
91
+ y.value = !y.value, w.value = y.value ? 20 : 3;
92
+ }
93
+ function f(o) {
94
+ return u();
95
+ }
96
+ function d(o) {
97
+ return u();
98
+ }
99
+ const k = s(() => ({
100
+ "font-size": `${B.value}px`,
101
+ height: "100%"
102
+ }));
103
+ function ee(o) {
104
+ if (o.currentTarget) {
105
+ const v = o.currentTarget.value || "";
106
+ S.value = v.length;
107
+ }
108
+ }
109
+ s(() => h.value && p.value);
110
+ const te = s(() => !(m.value && m.value.length) && (T.value || b.value));
111
+ s(() => a.value === "prompt" && A.value);
112
+ const ae = s(() => $.value && b.value), le = s(() => H.value && T.value);
113
+ function oe(o) {
114
+ a.value === "question" && n.emit("reject"), n.emit("close");
115
+ }
116
+ function se(o) {
117
+ a.value === "question" && n.emit("accept"), n.emit("close");
118
+ }
119
+ const ne = s(() => !!(m.value && m.value.length)), Q = s(() => r.value && r.value.date && r.value.message && r.value.detail), {
120
+ onCopy: ce
121
+ } = be(), X = t("\u590D\u5236\u6210\u529F"), E = t(!1);
122
+ function Y(o) {
123
+ ce(F.value).catch((v) => {
124
+ X.value = "\u590D\u5236\u5931\u8D25";
125
+ }).finally(() => {
126
+ E.value = !0, setTimeout(() => {
127
+ E.value = !1;
128
+ }, 700);
129
+ });
130
+ }
131
+ const ue = s(() => {
132
+ const o = {
133
+ position: "absolute",
134
+ left: "50%",
135
+ top: "50%",
136
+ width: "100px",
137
+ height: "40px",
138
+ background: "#303C53",
139
+ "line-height": "40px",
140
+ "text-align": "center",
141
+ "margin-left": "-30px",
142
+ "margin-top": "-50px",
143
+ "border-radius": "10px",
144
+ "box-shadow": "0px 2px 8px 0px",
145
+ color: "#fff",
146
+ transition: "all .3s ease"
147
+ };
148
+ return o.opacity = E.value ? "0.8" : "0", o.display = E.value ? "" : "none", o;
149
+ });
150
+ return () => e("div", {
151
+ class: "farris-messager"
152
+ }, [a.value !== "prompt" && e("section", {
153
+ class: C.value,
154
+ style: M.value
155
+ }, [e("div", {
156
+ class: "float-left modal-tips-iconwrap"
157
+ }, [e("span", {
158
+ class: z.value
159
+ }, null)]), e("div", {
160
+ class: "modal-tips-content"
161
+ }, [e("p", {
162
+ class: "toast-msg-title",
163
+ innerHTML: V.value
164
+ }, null), I.value && e("p", {
165
+ class: "toast-msg-detail",
166
+ innerHTML: O.value
167
+ }, null), R.value && e("div", {
168
+ class: "toast-msg-detail"
169
+ }, [N.value && e("div", null, [q.value]), L.value && e("div", {
170
+ id: "exception_error_msg",
171
+ ref: "exceptionMessageRef",
172
+ style: _.value
173
+ }, [re("\u8BE6\u7EC6\u4FE1\u606F : "), e("span", {
174
+ innerHTML: F.value
175
+ }, null)]), P.value && e("span", {
176
+ style: G.value
177
+ }, [y.value && e("span", {
178
+ onClick: f,
179
+ style: "cursor: pointer;"
180
+ }, [W.value]), !y.value && e("span", {
181
+ onClick: d,
182
+ style: "cursor: pointer;"
183
+ }, [U.value])])])])]), a.value === "prompt" && e(ie, null, [e("section", {
184
+ class: C.value,
185
+ style: M.value
186
+ }, [e("div", {
187
+ class: "flex-fill fixdiv mb-1 mr-3"
188
+ }, [e("textarea", {
189
+ title: "promptMessage",
190
+ name: "promptMessage",
191
+ class: "form-control",
192
+ style: k.value,
193
+ rows: "4",
194
+ maxlength: p.value,
195
+ onInput: (o) => ee(o)
196
+ }, [O.value])])]), e("span", {
197
+ class: "textarea-wordcount",
198
+ title: x.value,
199
+ style: "position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"
200
+ }, [S.value + " / " + p.value])]), te.value && e("div", {
201
+ class: "modal-footer"
202
+ }, [Q.value && e("span", {
203
+ style: "width: 100%;color: #2A87FF;padding-left: 37px;"
204
+ }, [e("span", {
205
+ onClick: Y,
206
+ style: "cursor: pointer;"
207
+ }, [j.value])]), ae.value && e("button", {
208
+ type: "button",
209
+ class: "btn btn-secondary btn-lg",
210
+ onClick: oe
211
+ }, [b.value]), le.value && e("button", {
212
+ type: "button",
213
+ class: "btn btn-primary btn-lg",
214
+ onClick: se
215
+ }, [T.value])]), ne.value && e("div", {
216
+ class: "modal-footer"
217
+ }, [Q.value && e("span", {
218
+ style: "width: 100%;color: #2A87FF;padding-left: 37px;"
219
+ }, [e("span", {
220
+ onClick: Y,
221
+ style: "cursor: pointer;"
222
+ }, [j.value])]), m.value.length && m.value.map((o) => e("button", {
223
+ type: "button",
224
+ onClick: o.handle,
225
+ class: o.class
226
+ }, [o.iconClass && e("span", {
227
+ class: o.iconClass
228
+ }, null), o.text]))]), e("div", {
229
+ style: ue.value
230
+ }, [X.value])]);
231
+ }
232
+ }), we = {
233
+ class: { type: String, default: "" },
234
+ title: { type: String, default: "" },
235
+ width: { type: Number, default: 500 },
236
+ height: { type: Number, default: 320 },
237
+ buttons: {
238
+ type: Array,
239
+ default: []
240
+ },
241
+ modelValue: { type: Boolean, default: !1 },
242
+ showHeader: { type: Boolean, default: !0 },
243
+ showButtons: { type: Boolean, default: !0 }
244
+ }, Ce = Z({
245
+ name: "FModal",
246
+ props: we,
247
+ emits: ["update:modelValue"],
248
+ setup(l, n) {
249
+ const a = t(l.width), c = t(l.height), i = t(l.modelValue), r = t(""), B = t(l.class), p = t(!0), h = t(l.showHeader), x = t(""), S = t(!0), m = t(!1), T = t(!1), b = t(""), A = t(""), $ = t(""), H = t(l.showButtons), j = t(l.title);
250
+ function w(u, f) {
251
+ i.value = !1, n.emit("update:modelValue", !1);
252
+ }
253
+ const D = [{
254
+ text: "\u53D6\u6D88",
255
+ class: "btn btn-light",
256
+ handle: (u) => {
257
+ w();
258
+ }
259
+ }, {
260
+ text: "\u786E\u5B9A",
261
+ class: "btn btn-primary",
262
+ handle: (u) => {
263
+ w();
264
+ }
265
+ }], C = t(l.buttons && l.buttons.length ? l.buttons : D), M = s(() => !!x.value), z = s(() => !!H.value && !!C.value);
266
+ t(), t(), de(() => l.modelValue, () => {
267
+ i.value = l.modelValue;
268
+ });
269
+ const V = t(!1), O = s(() => i.value), I = s(() => {
270
+ const u = {
271
+ modal: !0,
272
+ "farris-modal": !0
273
+ };
274
+ return u["f-modal-fitContent"] = p.value, u;
275
+ }), R = s(() => ({
276
+ display: O.value ? "block" : "none !important"
277
+ })), N = s(() => {
278
+ const u = {
279
+ "modal-dialog": !0
280
+ };
281
+ return B.value.split(" ").reduce((d, k) => (d[k] = !0, d), u), u;
282
+ }), q = s(() => ({
283
+ position: "absolute",
284
+ top: "50%",
285
+ left: "50%",
286
+ width: `${a.value}px`,
287
+ height: p.value ? "auto" : `${c.value}px`,
288
+ "margin-left": `${0 - a.value / 2}px`,
289
+ "margin-top": p.value ? "auto" : `${0 - c.value / 2}px`
290
+ })), L = s(() => ({
291
+ "modal-content": !0,
292
+ "modal-content-has-header": h.value
293
+ })), _ = s(() => ({
294
+ display: h.value ? "" : "none"
295
+ })), F = s(() => ({
296
+ "f-icon": !0,
297
+ modal_maximize: !0,
298
+ modalrevert: V.value
299
+ })), P = s(() => ({
300
+ height: "10px",
301
+ "z-index": 1,
302
+ display: h.value ? "none" : ""
303
+ })), y = s(() => ({
304
+ "modal-body": !0,
305
+ "f-utils-flex-column": b.value === "iframe"
306
+ }));
307
+ function U() {
308
+ return {};
309
+ }
310
+ const W = s(() => {
311
+ const u = {
312
+ textAlgin: $.value
313
+ }, f = U();
314
+ return Object.assign(u, f);
315
+ });
316
+ function G(u) {
317
+ }
318
+ return () => e(pe, {
319
+ to: "body"
320
+ }, {
321
+ default: () => {
322
+ var u, f;
323
+ return [e("div", {
324
+ class: I.value,
325
+ style: R.value
326
+ }, [e("div", {
327
+ id: r.value,
328
+ class: N.value,
329
+ style: q.value
330
+ }, [e("div", {
331
+ class: L.value
332
+ }, [e("div", {
333
+ ref: "modalHeaderRef",
334
+ class: "modal-header",
335
+ style: _.value
336
+ }, [e("div", {
337
+ class: "modal-title"
338
+ }, [M.value && e("span", {
339
+ class: x.value,
340
+ style: "margin-right: 8px"
341
+ }, null), e("span", {
342
+ class: "modal-title-label"
343
+ }, [j.value])]), e("div", {
344
+ class: "actions"
345
+ }, [e("ul", null, [T.value && e("li", {
346
+ class: "f-btn-icon f-bare"
347
+ }, [e("span", {
348
+ class: "f-icon modal_minimize"
349
+ }, null)]), m.value && e("li", {
350
+ onClick: G,
351
+ class: "f-btn-icon f-bare"
352
+ }, [e("span", {
353
+ class: F.value
354
+ }, null)]), S.value && e("li", {
355
+ class: "f-btn-icon f-bare",
356
+ onClick: (d) => w()
357
+ }, [e("span", {
358
+ class: "f-icon modal_close"
359
+ }, null)])])])]), e("div", {
360
+ ref: "dragableElementRef",
361
+ class: "f-utils-absolute-all",
362
+ style: P.value
363
+ }, null), e("div", {
364
+ class: y.value
365
+ }, [(f = (u = n.slots).default) == null ? void 0 : f.call(u), b.value === "iframe" && e("iframe", {
366
+ title: r.value,
367
+ class: "f-utils-fill",
368
+ width: "100%",
369
+ frameborder: "0",
370
+ src: A.value
371
+ }, null)]), z.value && e("div", {
372
+ class: "modal-footer",
373
+ style: W.value
374
+ }, [C.value && C.value.map((d) => e("button", {
375
+ type: "button",
376
+ class: d.class,
377
+ onClick: (k) => {
378
+ d.handle && d.handle(k);
379
+ }
380
+ }, [!!d.iconClass && e("span", {
381
+ class: d.iconClass
382
+ }, [d.text]), !d.iconClass && e("span", null, [d.text])]))])])])])];
383
+ }
384
+ });
385
+ }
386
+ });
387
+ function Be(l, n) {
388
+ const a = document.createElement("div");
389
+ a.style.display = "contents";
390
+ const c = ve({
391
+ setup() {
392
+ me(() => {
393
+ document.body.removeChild(a);
394
+ });
395
+ const i = t(!0), r = l.type === "error" || l.type === "prompt", B = l.type === "error" ? "\u9519\u8BEF\u63D0\u793A" : l.type === "prompt" ? l.title : "", p = l.acceptCallback || (() => {
396
+ }), h = l.rejectCallback || (() => {
397
+ });
398
+ return () => e(Ce, {
399
+ class: "modal-message modal-message-type-info",
400
+ title: B,
401
+ modelValue: i.value,
402
+ "onUpdate:modelValue": (x) => i.value = x,
403
+ "show-header": r,
404
+ "show-buttons": !1
405
+ }, {
406
+ default: () => [e(J, ye(l, {
407
+ onAccept: p,
408
+ onReject: h,
409
+ onClose: c.unmount
410
+ }), null)]
411
+ });
412
+ }
413
+ });
414
+ return document.body.appendChild(a), c.mount(a), c;
415
+ }
416
+ class Te {
417
+ static show(n) {
418
+ const a = g({
419
+ ...n
420
+ });
421
+ Be(a);
422
+ }
423
+ static info(n, a) {
424
+ const c = g({
425
+ type: "info",
426
+ title: n,
427
+ detail: a,
428
+ okButtonText: "\u77E5\u9053\u4E86",
429
+ cancelButtonText: ""
430
+ });
431
+ this.show(c);
432
+ }
433
+ static warning(n, a) {
434
+ const c = g({
435
+ type: "warning",
436
+ title: n,
437
+ detail: a,
438
+ okButtonText: "\u77E5\u9053\u4E86",
439
+ cancelButtonText: ""
440
+ });
441
+ this.show(c);
442
+ }
443
+ static success(n, a) {
444
+ const c = g({
445
+ type: "success",
446
+ title: n,
447
+ detail: a,
448
+ okButtonText: "\u5173\u95ED",
449
+ cancelButtonText: ""
450
+ });
451
+ this.show(c);
452
+ }
453
+ static error(n, a, c) {
454
+ const i = g({
455
+ type: "error",
456
+ okButtonText: "\u5173\u95ED",
457
+ cancelButtonText: "",
458
+ exceptionInfo: {
459
+ date: c,
460
+ message: n,
461
+ detail: a
462
+ }
463
+ });
464
+ this.show(i);
465
+ }
466
+ static prompt(n, a) {
467
+ const c = g({
468
+ type: "prompt",
469
+ title: n,
470
+ detail: a,
471
+ okButtonText: "\u786E\u5B9A",
472
+ cancelButtonText: "\u53D6\u6D88"
473
+ });
474
+ this.show(c);
475
+ }
476
+ static question(n, a, c, i) {
477
+ const r = g({
478
+ type: "question",
479
+ title: n,
480
+ detail: a,
481
+ okButtonText: "\u786E\u5B9A",
482
+ cancelButtonText: "\u53D6\u6D88",
483
+ acceptCallback: c,
484
+ rejectCallback: i
485
+ });
486
+ this.show(r);
487
+ }
488
+ }
489
+ const Se = {
490
+ install(l) {
491
+ l.component(J.name, J), l.provide("MessageBoxService", Te);
492
+ }
493
+ };
494
+ export {
495
+ J as FMessageBox,
496
+ Te as MessageBoxService,
497
+ Se as default,
498
+ fe as messageBoxProps
499
+ };