fit2cloud-ui-plus 0.0.1-beta.8 → 1.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/README.md +61 -9
  2. package/lib/fit2cloud-ui-plus.es.js +1438 -533
  3. package/lib/fit2cloud-ui-plus.umd.js +1 -1
  4. package/package.json +10 -5
  5. package/src/components/filter-bar/FuFilter.vue +36 -22
  6. package/src/components/filter-bar/FuFilterBar.vue +31 -17
  7. package/src/components/filter-bar/FuFilterInput.vue +48 -0
  8. package/src/components/filter-bar/filter-components/FuFilterDate.vue +13 -5
  9. package/src/components/filter-bar/filter-components/FuFilterDateTime.vue +17 -14
  10. package/src/components/filter-bar/filter-components/FuFilterSelect.vue +19 -13
  11. package/src/components/filter-bar/index.ts +11 -12
  12. package/src/components/icon-button/FuIconButton.vue +54 -0
  13. package/src/components/icon-button/index.ts +9 -0
  14. package/src/components/read-write-switch/FuSelectRwSwitch.vue +23 -10
  15. package/src/components/search-bar/FuComplexSearch.vue +104 -0
  16. package/src/components/search-bar/FuQuickSearch.vue +64 -0
  17. package/src/components/search-bar/FuSearchBar.vue +153 -0
  18. package/src/components/search-bar/FuSearchBarButton.vue +23 -0
  19. package/src/components/search-bar/FuSearchContions.vue +40 -0
  20. package/src/components/search-bar/complex-components/FuComplexDate.vue +70 -0
  21. package/src/components/search-bar/complex-components/FuComplexDateTime.vue +74 -0
  22. package/src/components/search-bar/complex-components/FuComplexInput.vue +57 -0
  23. package/src/components/search-bar/complex-components/FuComplexSelect.vue +93 -0
  24. package/src/components/search-bar/index.ts +20 -0
  25. package/src/components/search-bar/types.ts +23 -0
  26. package/src/components/speed-dial/FuSpeedDial.vue +71 -60
  27. package/src/components/speed-dial/FuSpeedDialActionButton.vue +55 -55
  28. package/src/components/speed-dial/FuSpeedDialButton.vue +14 -11
  29. package/src/components/speed-dial/FuSpeedDialItem.vue +9 -15
  30. package/src/components/speed-dial/types.ts +12 -0
  31. package/src/components/split-pane/FuSplitPane.vue +2 -2
  32. package/src/components/table/FuTable.vue +12 -13
  33. package/src/components/table/{table-column-dropdown/FuTableColumnDropdown.vue → FuTableColumnDropdown.vue} +0 -0
  34. package/src/components/table/index.ts +11 -7
  35. package/src/components/table/table-column-select/FuTableColumnSelectDialog.vue +3 -9
  36. package/src/components/table/table-column-select/FuTableColumnSelectPopover.vue +4 -3
  37. package/src/components/table/table-operations/FuTableButton.vue +1 -4
  38. package/src/components/table/table-operations/FuTableMoreButton.vue +1 -1
  39. package/src/components/table/table-operations/FuTableOperations.vue +1 -2
  40. package/src/components/table/types.ts +3 -0
  41. package/src/components/tabs/FuTabs.vue +4 -3
  42. package/src/hooks/index.ts +2 -1
  43. package/src/hooks/use-global-config/index.ts +25 -22
  44. package/src/hooks/use-locale/index.ts +1 -1
  45. package/src/hooks/use-size/index.ts +35 -0
  46. package/src/index.ts +5 -2
  47. package/src/styles/common/function.scss +14 -4
  48. package/src/styles/common/mixins.scss +9 -4
  49. package/src/styles/common/variables.scss +55 -18
  50. package/src/styles/components/filter-bar.scss +16 -16
  51. package/src/styles/components/icon-button.scss +66 -0
  52. package/src/styles/components/search-bar.scss +240 -0
  53. package/src/styles/components/speed-dial.scss +1 -51
  54. package/src/styles/components/table.scss +7 -9
  55. package/src/styles/index.scss +2 -0
  56. package/src/styles/themes/default.scss +91 -0
  57. package/src/tools/size.ts +6 -0
  58. package/src/tools/theme.ts +0 -12
  59. package/types/examples/App.vue.d.ts +2 -0
  60. package/types/examples/components/CodeExample.vue.d.ts +29 -0
  61. package/types/examples/components/DocumentTable.vue.d.ts +14 -0
  62. package/types/examples/components/Markdown.vue.d.ts +12 -0
  63. package/types/examples/layout/components/AppHeader.vue.d.ts +2 -0
  64. package/types/examples/layout/components/Sidebar.vue.d.ts +2 -0
  65. package/types/examples/layout/index.vue.d.ts +2 -0
  66. package/types/examples/main.d.ts +2 -0
  67. package/types/examples/pages/filter-bar/attributes.d.ts +63 -0
  68. package/types/examples/pages/filter-bar/demo/BaseFilterBar.vue.d.ts +2 -0
  69. package/types/examples/pages/filter-bar/demo/SetConditionsDemo.vue.d.ts +2 -0
  70. package/types/examples/pages/filter-bar/demo/SlotDemo.vue.d.ts +2 -0
  71. package/types/examples/pages/filter-bar/index.vue.d.ts +2 -0
  72. package/types/examples/pages/icon-button/attributes.d.ts +45 -0
  73. package/types/examples/pages/icon-button/demo/BaseIconButton.vue.d.ts +2 -0
  74. package/types/examples/pages/icon-button/demo/SlotDemo.vue.d.ts +2 -0
  75. package/types/examples/pages/icon-button/index.vue.d.ts +2 -0
  76. package/types/examples/pages/index.d.ts +3 -0
  77. package/types/examples/pages/read-write-switch/attributes.d.ts +63 -0
  78. package/types/examples/pages/read-write-switch/demo/BaseDemo.vue.d.ts +2 -0
  79. package/types/examples/pages/read-write-switch/demo/CustomContentDemo.vue.d.ts +2 -0
  80. package/types/examples/pages/read-write-switch/demo/InputRwSwitchDemo.vue.d.ts +2 -0
  81. package/types/examples/pages/read-write-switch/demo/ReadSwitchDemo.vue.d.ts +2 -0
  82. package/types/examples/pages/read-write-switch/demo/SelectRwSwitchDemo.vue.d.ts +2 -0
  83. package/types/examples/pages/read-write-switch/demo/TableInnerEditDemo.vue.d.ts +2 -0
  84. package/types/examples/pages/read-write-switch/demo/WriteSwitchDemo.vue.d.ts +2 -0
  85. package/types/examples/pages/read-write-switch/index.vue.d.ts +2 -0
  86. package/types/examples/pages/search/attributes.d.ts +57 -0
  87. package/types/examples/pages/search/demo/BaseSearchbar.vue.d.ts +66 -0
  88. package/types/examples/pages/search/demo/ComplexComponentsDemo.vue.d.ts +60 -0
  89. package/types/examples/pages/search/demo/ComplexSearchDemo.vue.d.ts +84 -0
  90. package/types/examples/pages/search/demo/CustomComponentsDemo.vue.d.ts +50 -0
  91. package/types/examples/pages/search/demo/EchoConditionsDemo.vue.d.ts +52 -0
  92. package/types/examples/pages/search/demo/QuickSearchDemo.vue.d.ts +18 -0
  93. package/types/examples/pages/search/demo/SearchBarButtonDemo.vue.d.ts +54 -0
  94. package/types/examples/pages/search/index.vue.d.ts +150 -0
  95. package/types/examples/pages/search-bar/attributes.d.ts +63 -0
  96. package/types/examples/pages/search-bar/demo/BaseSearchbar.vue.d.ts +31 -0
  97. package/types/examples/pages/search-bar/demo/ComplexSearchDemo.vue.d.ts +40 -0
  98. package/types/examples/pages/search-bar/demo/EchoConditionsDemo.vue.d.ts +32 -0
  99. package/types/examples/pages/search-bar/demo/QuickSearchDemo.vue.d.ts +7 -0
  100. package/types/examples/pages/search-bar/demo/SearchBarButtonDemo.vue.d.ts +32 -0
  101. package/types/examples/pages/search-bar/index.vue.d.ts +2 -0
  102. package/types/examples/pages/speed-dial/attributes.d.ts +63 -0
  103. package/types/examples/pages/speed-dial/demo/BaseSpeedDial.vue.d.ts +2 -0
  104. package/types/examples/pages/speed-dial/demo/SpeedDialCustom.vue.d.ts +2 -0
  105. package/types/examples/pages/speed-dial/demo/SpeedDialPosition.vue.d.ts +2 -0
  106. package/types/examples/pages/speed-dial/demo/SpeedDialTrigger.vue.d.ts +2 -0
  107. package/types/examples/pages/speed-dial/index.vue.d.ts +2 -0
  108. package/types/examples/pages/split-pane/attributes.d.ts +63 -0
  109. package/types/examples/pages/split-pane/demo/BaseSplit.vue.d.ts +2 -0
  110. package/types/examples/pages/split-pane/demo/CustomResizer.vue.d.ts +2 -0
  111. package/types/examples/pages/split-pane/demo/NestSplit.vue.d.ts +2 -0
  112. package/types/examples/pages/split-pane/demo/ResizerType.vue.d.ts +2 -0
  113. package/types/examples/pages/split-pane/index.vue.d.ts +2 -0
  114. package/types/examples/pages/table/attributes.d.ts +121 -0
  115. package/types/examples/pages/table/demo/BaseTable.vue.d.ts +2 -0
  116. package/types/examples/pages/table/demo/DropdownColumn.vue.d.ts +2 -0
  117. package/types/examples/pages/table/demo/DropdownColumnSlot.vue.d.ts +2 -0
  118. package/types/examples/pages/table/demo/SaveSelectColumn.vue.d.ts +2 -0
  119. package/types/examples/pages/table/demo/SelectColumn.vue.d.ts +2 -0
  120. package/types/examples/pages/table/demo/TableOperations.vue.d.ts +2 -0
  121. package/types/examples/pages/table/demo/TablePagination.vue.d.ts +2 -0
  122. package/types/examples/pages/table/index.vue.d.ts +2 -0
  123. package/types/examples/pages/tabs/attributes.d.ts +63 -0
  124. package/types/examples/pages/tabs/demo/AddCloseTab.vue.d.ts +2 -0
  125. package/types/examples/pages/tabs/index.vue.d.ts +2 -0
  126. package/types/examples/router/doc-routes.d.ts +12 -0
  127. package/types/examples/router/index.d.ts +4 -0
  128. package/types/examples/router/styles-routes.d.ts +12 -0
  129. package/types/examples/style-guide/button/BaseButton.vue.d.ts +2 -0
  130. package/types/examples/style-guide/button/IconButton.vue.d.ts +2 -0
  131. package/types/examples/style-guide/button/PlainButton.vue.d.ts +2 -0
  132. package/types/examples/style-guide/button/TextButton.vue.d.ts +2 -0
  133. package/types/examples/style-guide/button/index.vue.d.ts +2 -0
  134. package/types/examples/style-guide/input/BaseInput.vue.d.ts +2 -0
  135. package/types/examples/style-guide/input/SearchInput.vue.d.ts +2 -0
  136. package/types/examples/style-guide/input/Textarea.vue.d.ts +2 -0
  137. package/types/examples/style-guide/input/index.vue.d.ts +2 -0
  138. package/types/examples/style-guide/select/BaseSelect.vue.d.ts +2 -0
  139. package/types/examples/style-guide/select/index.vue.d.ts +2 -0
  140. package/types/plugins/example-transform.d.ts +5 -0
  141. package/types/src/components/filter-bar/FuFilter.vue.d.ts +42 -0
  142. package/types/src/components/filter-bar/FuFilterBar.vue.d.ts +33 -0
  143. package/types/src/components/filter-bar/FuFilterConditions.vue.d.ts +8 -0
  144. package/types/src/components/filter-bar/FuFilterInput.vue.d.ts +17 -0
  145. package/types/src/components/filter-bar/FuSearchInput.vue.d.ts +17 -0
  146. package/types/src/components/filter-bar/filter-components/FuFilterDate.vue.d.ts +36 -0
  147. package/types/src/components/filter-bar/filter-components/FuFilterDateTime.vue.d.ts +36 -0
  148. package/types/src/components/filter-bar/filter-components/FuFilterOption.vue.d.ts +24 -0
  149. package/types/src/components/filter-bar/filter-components/FuFilterSelect.vue.d.ts +66 -0
  150. package/types/src/components/filter-bar/index.d.ts +2 -0
  151. package/types/src/components/filter-bar/types.d.ts +22 -0
  152. package/types/src/components/icon-button/FuIconButton.vue.d.ts +43 -0
  153. package/types/src/components/icon-button/index.d.ts +2 -0
  154. package/types/src/components/read-write-switch/FuInputRwSwitch.vue.d.ts +21 -0
  155. package/types/src/components/read-write-switch/FuReadWriteSwitch.vue.d.ts +23 -0
  156. package/types/src/components/read-write-switch/FuSelectRwSwitch.vue.d.ts +43 -0
  157. package/types/src/components/read-write-switch/index.d.ts +2 -0
  158. package/types/src/components/read-write-switch/types.d.ts +4 -0
  159. package/types/src/components/search-bar/FuComplexSearch.vue.d.ts +22 -0
  160. package/types/src/components/search-bar/FuQuickSearch.vue.d.ts +29 -0
  161. package/types/src/components/search-bar/FuSearchBar.vue.d.ts +58 -0
  162. package/types/src/components/search-bar/FuSearchBarButton.vue.d.ts +14 -0
  163. package/types/src/components/search-bar/FuSearchContions.vue.d.ts +26 -0
  164. package/types/src/components/search-bar/complex-components/FuComplexDate.vue.d.ts +36 -0
  165. package/types/src/components/search-bar/complex-components/FuComplexDateTime.vue.d.ts +36 -0
  166. package/types/src/components/search-bar/complex-components/FuComplexInput.vue.d.ts +26 -0
  167. package/types/src/components/search-bar/complex-components/FuComplexSelect.vue.d.ts +50 -0
  168. package/types/src/components/search-bar/complex-components/index.d.ts +0 -0
  169. package/types/src/components/search-bar/complex-components/mixins.d.ts +6 -0
  170. package/types/src/components/search-bar/index.d.ts +2 -0
  171. package/types/src/components/search-bar/types.d.ts +17 -0
  172. package/types/src/components/speed-dial/FuSpeedDial.vue.d.ts +218 -0
  173. package/types/src/components/speed-dial/FuSpeedDialActionButton.vue.d.ts +32 -0
  174. package/types/src/components/speed-dial/FuSpeedDialButton.vue.d.ts +42 -0
  175. package/types/src/components/speed-dial/FuSpeedDialItem.vue.d.ts +12 -0
  176. package/types/src/components/speed-dial/index.d.ts +2 -0
  177. package/types/src/components/speed-dial/types.d.ts +8 -0
  178. package/types/src/components/split-pane/FuSplitPane.vue.d.ts +59 -0
  179. package/types/src/components/split-pane/index.d.ts +2 -0
  180. package/types/src/components/table/FuTable.vue.d.ts +18 -0
  181. package/types/src/components/table/FuTableBody.d.ts +3 -0
  182. package/types/src/components/table/FuTableColumnDropdown.vue.d.ts +50 -0
  183. package/types/src/components/table/FuTablePagination.vue.d.ts +47 -0
  184. package/types/src/components/table/index.d.ts +2 -0
  185. package/types/src/components/table/table-column-select/FuTableColumnSelect.vue.d.ts +10 -0
  186. package/types/src/components/table/table-column-select/FuTableColumnSelectDialog.vue.d.ts +23 -0
  187. package/types/src/components/table/table-column-select/FuTableColumnSelectPopover.vue.d.ts +34 -0
  188. package/types/src/components/table/table-column-select/utils.d.ts +8 -0
  189. package/types/src/components/table/table-operations/FuTableButton.vue.d.ts +13 -0
  190. package/types/src/components/table/table-operations/FuTableMoreButton.vue.d.ts +37 -0
  191. package/types/src/components/table/table-operations/FuTableOperations.vue.d.ts +46 -0
  192. package/types/src/components/table/types.d.ts +2 -0
  193. package/types/src/components/tabs/FuTabs.vue.d.ts +54 -0
  194. package/types/src/components/tabs/index.d.ts +2 -0
  195. package/types/src/hooks/index.d.ts +3 -0
  196. package/types/src/hooks/use-global-config/index.d.ts +9 -0
  197. package/types/src/hooks/use-locale/index.d.ts +14 -0
  198. package/types/src/hooks/use-size/index.d.ts +9 -0
  199. package/types/src/index.d.ts +8 -0
  200. package/types/src/locale/index.d.ts +10 -0
  201. package/types/src/locale/lang/en.d.ts +59 -0
  202. package/types/src/locale/lang/zh-cn.d.ts +59 -0
  203. package/types/src/locale/lang/zh-tw.d.ts +59 -0
  204. package/types/src/tools/size.d.ts +4 -0
  205. package/types/src/tools/theme.d.ts +1 -0
  206. package/types/src/tools/time.d.ts +2 -0
  207. package/types/src/tools/types.d.ts +8 -0
  208. package/types/src/tools/utils.d.ts +2 -0
  209. package/types/src/tools/vnode.d.ts +9 -0
  210. package/src/components/filter-bar/FuSearchInput.vue +0 -31
  211. package/src/components/steps/FuHorizontalNavigation.vue +0 -18
  212. package/src/components/steps/FuHorizontalSteps.vue +0 -94
  213. package/src/components/steps/FuStep.vue +0 -13
  214. package/src/components/steps/FuSteps.vue +0 -22
  215. package/src/components/steps/FuStepsFooter.ts +0 -79
  216. package/src/components/steps/FuVerticalNavigation.vue +0 -35
  217. package/src/components/steps/FuVerticalSteps.vue +0 -79
  218. package/src/components/steps/Stepper.ts +0 -188
  219. package/src/components/steps/index.ts +0 -11
  220. package/src/components/table/table-column-dropdown/index.ts +0 -7
  221. package/src/components/table/table-column-select/index.ts +0 -8
  222. package/src/components/table/table-operations/index.ts +0 -12
  223. package/src/components/virtual-scroller/FuVirtualHorizontalScroll.js +0 -96
  224. package/src/components/virtual-scroller/FuVirtualScroll.js +0 -15
  225. package/src/components/virtual-scroller/FuVirtualVerticalScroll.js +0 -95
  226. package/src/components/virtual-scroller/index.js +0 -10
@@ -2,12 +2,12 @@
2
2
  <div class="fu-speed-dial" :style="style" v-click-outside="outsideClickClose">
3
3
  <div class="fu-speed-dial__content">
4
4
  <slot name="fab">
5
- <fu-speed-dial-button v-bind="buttonProps" @click="click" @mousedown="mousedown" />
5
+ <fu-speed-dial-button v-bind="buttonProps" @click="click" @mousedown="mousedown"/>
6
6
  </slot>
7
7
  <div :style="contentPosition">
8
8
  <slot>
9
9
  <fu-speed-dial-item v-for="(item, index) in items" :index="index" :key="index" v-bind="item"
10
- @click="itemClick" />
10
+ @click="itemClick(index)"/>
11
11
  </slot>
12
12
  </div>
13
13
  </div>
@@ -16,24 +16,27 @@
16
16
 
17
17
 
18
18
  <script setup lang="ts">
19
- import { reactive, ref, watch, getCurrentInstance, onMounted, computed, provide, useSlots } from "vue";
20
- import type { CSSProperties } from 'vue'
21
- import { ClickOutside as vClickOutside } from 'element-plus'
19
+ import {ref, watch, getCurrentInstance, onMounted, computed, provide, useSlots, PropType} from "vue";
20
+ import type {CSSProperties} from 'vue'
21
+ import type {ZIndexProperty, PositionProperty} from 'csstype'
22
+ import {ClickOutside as vClickOutside} from 'element-plus'
22
23
  import FuSpeedDialButton from "@/components/speed-dial/FuSpeedDialButton.vue"
23
24
  import FuSpeedDialItem from "@/components/speed-dial/FuSpeedDialItem.vue"
24
- defineOptions({ name: "FuSpeedDial" });
25
+ import {SpeedDialKey} from "./types";
26
+
27
+ defineOptions({name: "FuSpeedDial"});
25
28
  const props = defineProps({
29
+ modelValue: Boolean,
26
30
  id: String,
27
- value: Boolean,
28
31
  type: {
29
32
  type: String,
30
33
  default: "primary"
31
34
  },
32
- items: Array,
35
+ items: Array as any,
33
36
  size: {
34
37
  type: String,
35
38
  default: "default",
36
- validator: (value: string) => ["big", "default", "medium", "small"].includes(value)
39
+ validator: (value: string) => ["large", "default", "small"].includes(value)
37
40
  },
38
41
  direction: {
39
42
  type: String,
@@ -42,18 +45,18 @@ const props = defineProps({
42
45
  },
43
46
  icon: {
44
47
  type: String,
45
- default: "el-icon-plus"
48
+ default: "Plus"
46
49
  },
47
50
  activeIcon: {
48
51
  type: String,
49
- default: "el-icon-close"
52
+ default: "Close"
50
53
  },
51
54
  movable: {
52
55
  type: Boolean,
53
56
  default: false
54
57
  },
55
58
  position: {
56
- type: String,
59
+ type: String as PropType<PositionProperty>,
57
60
  validator: (value: string) => ["absolute", "fixed"].includes(value)
58
61
  },
59
62
  left: String,
@@ -61,7 +64,7 @@ const props = defineProps({
61
64
  right: String,
62
65
  bottom: String,
63
66
  zIndex: {
64
- type: [String, Number],
67
+ type: ([String, Number]) as PropType<ZIndexProperty>,
65
68
  default: 99
66
69
  },
67
70
  itemClickClose: {
@@ -81,21 +84,17 @@ const props = defineProps({
81
84
  type: Object,
82
85
  default: () => {
83
86
  return {
84
- big: {
85
- fab: { size: 56, fontSize: "18px" },
86
- item: { size: 40, spacing: 0, titleFontSize: "14px", buttonFontSize: "18px" }
87
+ large: {
88
+ fab: {size: 56, fontSize: "18px"},
89
+ item: {size: 40, spacing: 0, titleFontSize: "14px", buttonFontSize: "18px"}
87
90
  },
88
91
  default: {
89
- fab: { size: 40, fontSize: "16px" },
90
- item: { size: 32, spacing: 0, titleFontSize: "14px", buttonFontSize: "16px" }
91
- },
92
- medium: {
93
- fab: { size: 36, fontSize: "14px" },
94
- item: { size: 28, spacing: 0, titleFontSize: "12px", buttonFontSize: "14px" }
92
+ fab: {size: 40, fontSize: "16px"},
93
+ item: {size: 32, spacing: 0, titleFontSize: "14px", buttonFontSize: "16px"}
95
94
  },
96
95
  small: {
97
- fab: { size: 32, fontSize: "12px" },
98
- item: { size: 24, spacing: 0, titleFontSize: "12px", buttonFontSize: "12px" }
96
+ fab: {size: 32, fontSize: "12px", padding: 0},
97
+ item: {size: 24, spacing: 0, titleFontSize: "12px", buttonFontSize: "12px"}
99
98
  },
100
99
  }
101
100
  }
@@ -107,26 +106,27 @@ const emit = defineEmits(["close", "outside-click", "click"])
107
106
  const slots = useSlots()
108
107
  const instance = getCurrentInstance()
109
108
 
110
- const { zIndex, position, left, top, right, bottom } = props
111
-
112
109
  const active = ref(false)
113
110
  const moving = ref(false)
114
- const style = reactive({ zIndex, position, left, top, right, bottom }) as any
115
- const updateStyle = function () {
116
- style.value = { zIndex, position, left, top, right, bottom }
117
- }
118
111
 
119
- provide("FuSpeedDial", instance)
112
+ const {zIndex, position, left, top, right, bottom} = props
113
+ const style = ref({zIndex, position, left, top, right, bottom})
120
114
 
121
- watch(() => props.value, (v) => {
115
+ watch(() => props.modelValue, (v) => {
122
116
  active.value = v
123
117
  })
124
- watch(() => props.position, updateStyle)
125
- watch(() => props.zIndex, updateStyle)
126
- watch(() => props.left, updateStyle)
127
- watch(() => props.right, updateStyle)
128
- watch(() => props.top, updateStyle)
129
- watch(() => props.bottom, updateStyle)
118
+ watch(() => props.position, () => updateStyle())
119
+ watch(() => props.zIndex, () => updateStyle())
120
+ watch(() => props.left, () => updateStyle())
121
+ watch(() => props.right, () => updateStyle())
122
+ watch(() => props.top, () => updateStyle())
123
+ watch(() => props.bottom, () => updateStyle())
124
+
125
+ function updateStyle() {
126
+ const {zIndex, position, left, top, right, bottom} = props
127
+ style.value = {zIndex, position, left, top, right, bottom}
128
+
129
+ }
130
130
 
131
131
  const saveKey = computed(() => {
132
132
  return "Fu-SD-" + props.localKey
@@ -141,13 +141,11 @@ const config = computed(() => {
141
141
  return props.sizeOptions[props.size] || props.sizeOptions["default"]
142
142
  })
143
143
  const buttonProps = computed(() => {
144
- let type = props.type
145
144
  let rotate = true
146
- let activeValue = active.value
147
145
  let size = config.value.fab.size + "px"
148
146
  let fontSize = config.value.fab.fontSize
149
147
  let icon = props.activeIcon === props.icon ? props.icon : active.value ? props.activeIcon : props.icon
150
- return { type, rotate, active: activeValue, size, fontSize, icon }
148
+ return {type: props.type, rotate, active: active.value, size, fontSize, icon}
151
149
  })
152
150
  const spacing = computed(() => {
153
151
  let spacing = config.value.item.spacing || 0
@@ -161,19 +159,20 @@ const contentPosition = computed(() => {
161
159
  position = -config.value.fab.size - spacing.value
162
160
  }
163
161
 
164
- let style: CSSProperties = { position: "absolute", zIndex: props.zIndex }
162
+ let positionStyle: CSSProperties = {position: "absolute", zIndex: props.zIndex}
165
163
  if (["top", "bottom"].includes(props.direction)) {
166
- style.top = position + "px"
164
+ positionStyle.top = position + "px"
167
165
  } else {
168
- style.top = 0
169
- style.left = position + "px"
166
+ positionStyle.top = 0
167
+ positionStyle.left = position + "px"
170
168
  }
171
- return style
169
+ return positionStyle
172
170
  })
173
171
 
174
- function toggle(active?: any) {
172
+
173
+ function toggle(bool?: any) {
175
174
  if (!moving.value && hashChildren.value) {
176
- active.value = active === undefined ? !active.value : active
175
+ active.value = bool === undefined ? !active.value : bool
177
176
  }
178
177
  }
179
178
 
@@ -183,22 +182,25 @@ function outsideClickClose() {
183
182
  }
184
183
  emit("outside-click", [props.id, active.value])
185
184
  }
185
+
186
186
  function click(e: Event) {
187
187
  if (!props.manual) {
188
188
  toggle()
189
189
  }
190
190
  emit("click", [props.id, active.value], e)
191
191
  }
192
+
192
193
  function mousedown() {
193
- if (moving.value) {
194
+ if (props.movable) {
194
195
  document.addEventListener('mousemove', mousemove)
195
196
  document.addEventListener('mouseup', mouseup)
196
197
  }
197
198
  }
199
+
198
200
  function mousemove(e: MouseEvent) {
199
201
  moving.value = true
200
202
  if (props.position === "fixed") {
201
- const el = instance.vnode.el as HTMLElement
203
+ const el = instance?.vnode.el as HTMLElement
202
204
  const rect = el.getBoundingClientRect()
203
205
  let left = e.clientX - rect.width / 2
204
206
  let top = e.clientY - rect.height / 2
@@ -207,11 +209,11 @@ function mousemove(e: MouseEvent) {
207
209
  delete style.value.right
208
210
  delete style.value.bottom
209
211
  }
210
-
211
212
  if (props.position === "absolute") {
212
- const { offsetLeft, offsetTop, clientWidth, clientHeight, offsetParent } = this.$el
213
- const maxWidth = offsetParent.clientWidth - clientWidth
214
- const maxHeight = offsetParent.clientHeight - clientHeight
213
+ const {offsetLeft, offsetTop, clientWidth, clientHeight, offsetParent} = instance?.vnode.el as HTMLElement
214
+
215
+ const maxWidth = offsetParent && offsetParent.clientWidth || 0 - clientWidth
216
+ const maxHeight = offsetParent && offsetParent.clientHeight || 0 - clientHeight
215
217
 
216
218
  let left = offsetLeft + e.movementX
217
219
  let top = offsetTop + e.movementY
@@ -225,17 +227,20 @@ function mousemove(e: MouseEvent) {
225
227
  }
226
228
  }
227
229
  }
230
+
228
231
  function mouseup() {
229
232
  writePosition()
230
233
  document.removeEventListener('mousemove', mousemove)
231
234
  document.removeEventListener('mouseup', mouseup)
232
235
  setTimeout(() => moving.value = false)
233
236
  }
237
+
234
238
  function writePosition() {
235
239
  if (props.localKey) {
236
240
  localStorage.setItem(saveKey.value, JSON.stringify(style.value))
237
241
  }
238
242
  }
243
+
239
244
  function readPosition() {
240
245
  // *******????
241
246
  // if (this.savePosition) {
@@ -250,12 +255,11 @@ function readPosition() {
250
255
  }
251
256
  // }
252
257
  }
253
- function itemClick(arg: any, e: any) {
254
- console.log(arg)
255
- const { index } = arg
258
+
259
+ function itemClick(index: any) {
256
260
  if (index !== undefined) {
257
- const item = props.items[index];
258
- if (item.click && typeof item.click === "function") return item.click(arg, e)
261
+ const item = props.items[index] as any;
262
+ if (item.click && typeof item.click === "function") return item.click(index)
259
263
  }
260
264
  }
261
265
 
@@ -266,11 +270,18 @@ function close() {
266
270
  emit("close", [props.id, active.value])
267
271
  }
268
272
 
273
+
274
+ provide(SpeedDialKey, {
275
+ config: config.value,
276
+ direction: computed(() => props.direction),
277
+ active: active,
278
+ close
279
+
280
+ })
269
281
  onMounted(() => {
270
282
  readPosition()
271
283
  })
272
284
 
273
-
274
285
  defineExpose({
275
286
  close
276
287
  })
@@ -2,13 +2,13 @@
2
2
  <div class="fu-speed-dial-action-button">
3
3
  <div v-if="title" class="fu-speed-dial-action-button__title" :style="titleSize">
4
4
  <slot name="title">
5
- <div class="fu-speed-dial-action-button__text" :class="titleClass" :style="titleStyle" @click="click">{{
6
- title }}
5
+ <div class="fu-speed-dial-action-button__text" :class="titleClass" :style="titleStyle" @click="click">{{ title
6
+ }}
7
7
  </div>
8
8
  </slot>
9
9
  </div>
10
10
  <slot>
11
- <fu-speed-dial-button :class="buttonClass" v-bind="buttonProps" :icon="icon" @click="click"/>
11
+ <fu-speed-dial-button :class="buttonClass" v-bind="buttonProps" :icon="icon" @click="click" />
12
12
  </slot>
13
13
  </div>
14
14
  </template>
@@ -17,72 +17,72 @@
17
17
  import { inject, computed } from 'vue'
18
18
  import type { CSSProperties } from 'vue'
19
19
  import FuSpeedDialButton from "@/components/speed-dial/FuSpeedDialButton.vue";
20
+ import { SpeedDialKey } from "./types";
20
21
 
21
22
  const props = defineProps({
22
- index: Number,
23
- icon: {
24
- type: String,
25
- default: "el-icon-plus"
26
- },
27
- titleClass: String,
28
- titleBgColor: String,
29
- titleColor: String,
30
- buttonClass: String,
31
- bgColor: String,
32
- color: String,
33
- title: [String, Number]
23
+ index: Number,
24
+ icon: {
25
+ type: String,
26
+ default: "Plus"
27
+ },
28
+ titleClass: String,
29
+ titleBgColor: String,
30
+ titleColor: String,
31
+ buttonClass: String,
32
+ bgColor: String,
33
+ color: String,
34
+ title: [String, Number]
34
35
  })
35
36
 
36
37
  const emit = defineEmits(["click"])
37
- const FuSpeedDial = inject('FuSpeedDial')
38
+ const speedDialKey = inject(SpeedDialKey)
38
39
 
39
- const config =computed(()=>{
40
- return FuSpeedDial.config;
40
+ const config = computed(() => {
41
+ return speedDialKey?.config;
41
42
  })
42
43
 
43
- const direction =computed(()=>{
44
- return FuSpeedDial.direction;
45
- })
46
- const clickClose =computed(()=>{
47
- return FuSpeedDial.clickClose;
44
+ const direction = computed(() => {
45
+ return speedDialKey?.direction.value || "";
48
46
  })
47
+ // const clickClose =computed(()=>{
48
+ // return FuSpeedDial.clickClose;
49
+ // })
49
50
 
50
- const titleSize =computed(()=>{
51
- let size = config.value.fab.size + "px";
52
- let style: CSSProperties = {position: "absolute", height: size};
53
- if (["top", "bottom"].includes(direction.value)) {
54
- style['text-align'] = "right"
55
- style['right'] = size
56
- } else {
57
- style['text-align'] = "center"
58
- style['min-width'] = size
59
- if (props.index % 2 === 0) {
60
- style.top = size
61
- } else {
62
- style.top = "-" + size
63
- }
64
- }
65
- return style;
51
+ const titleSize = computed(() => {
52
+ let size = config.value?.fab.size + "px";
53
+ let style: CSSProperties = { position: "absolute", height: size };
54
+ if (["top", "bottom"].includes(direction.value)) {
55
+ style['text-align'] = "right"
56
+ style['right'] = size
57
+ } else {
58
+ style['text-align'] = "center"
59
+ style['min-width'] = size
60
+ if (props.index || 0 % 2 === 0) {
61
+ style.top = size
62
+ } else {
63
+ style.top = "-" + size
64
+ }
65
+ }
66
+ return style;
66
67
  })
67
68
 
68
- const titleStyle =computed(()=>{
69
- let backgroundColor = props.titleBgColor;
70
- let color = props.titleColor
71
- let fontSize = config.value.item.titleFontSize
72
- return {backgroundColor, color, fontSize}
69
+ const titleStyle = computed(() => {
70
+ let backgroundColor = props.titleBgColor;
71
+ let color = props.titleColor
72
+ let fontSize = config.value?.item.titleFontSize
73
+ return { backgroundColor, color, fontSize }
73
74
  })
74
75
 
75
- const buttonProps =computed(()=>{
76
- let backgroundColor = props.bgColor;
77
- let color = props.color
78
- let fontSize = config.value.item.buttonFontSize
79
- let size = config.value.item.size + "px";
80
- return {backgroundColor, color, fontSize, size}
76
+ const buttonProps = computed(() => {
77
+ let backgroundColor = props.bgColor;
78
+ let color = props.color
79
+ let fontSize = config.value?.item.buttonFontSize
80
+ let size = config.value?.item.size + "px";
81
+ return { backgroundColor, color, fontSize, size }
81
82
  })
82
-
83
83
  function click(e: Event) {
84
- const {index, title} = props
85
- emit("click", {index, title}, e);
86
- FuSpeedDial.close();
87
- }
84
+ const { index, title } = props
85
+ emit("click", { index, title }, e);
86
+ speedDialKey?.close();
87
+ }
88
88
  </script>
@@ -1,27 +1,30 @@
1
1
  <template>
2
2
  <div :class="[
3
- 'fu-speed-dial-button',
4
- 'fu-speed-dial-button--' + type,
5
- {
6
- 'fu-speed-dial-button--rotate': rotate,
7
- 'is-disabled': disabled,
8
- 'is-active': active,
9
- }, ]"
10
- :style="{
3
+ 'fu-speed-dial-button',
4
+ 'el-button',
5
+ 'el-button--' + type,
6
+ {
7
+ 'fu-speed-dial-button--rotate': rotate,
8
+ 'is-disabled': disabled,
9
+ 'is-active': active,
10
+ },]" :style="{
11
11
  width: size,
12
12
  height: size,
13
13
  backgroundColor: backgroundColor,
14
14
  color: color,
15
- fontSize: fontSize }">
15
+ fontSize: fontSize
16
+ }">
16
17
  <slot>
17
- <i :class="icon" />
18
+ <el-icon>
19
+ <component :is="icon" />
20
+ </el-icon>
18
21
  </slot>
19
22
  </div>
20
23
  </template>
21
24
 
22
25
  <script setup lang="ts">
23
26
  import { validateType } from "@/tools/theme"
24
- const props = defineProps({
27
+ defineProps({
25
28
  type: {
26
29
  type: String,
27
30
  default: "default",
@@ -9,11 +9,9 @@
9
9
  </template>
10
10
 
11
11
  <script setup lang="ts">
12
- import {
13
- inject,
14
- computed
15
- } from 'vue'
12
+ import { inject, computed } from 'vue'
16
13
  import FuSpeedDialActionButton from "@/components/speed-dial/FuSpeedDialActionButton.vue";
14
+ import { SpeedDialKey } from "./types";
17
15
  defineOptions({ name: "FuSpeedDialItem" });
18
16
  const props = defineProps({
19
17
  index: {
@@ -21,21 +19,17 @@ const props = defineProps({
21
19
  required: true
22
20
  },
23
21
  })
24
- const FuSpeedDial = inject('FuSpeedDial')
22
+ const speedDialKey = inject(SpeedDialKey)
25
23
 
26
24
  const config = computed(() => {
27
- return FuSpeedDial.config;
25
+ return speedDialKey?.config;
28
26
  })
29
27
 
30
28
  const direction = computed(() => {
31
- return FuSpeedDial.direction;
29
+ return speedDialKey?.direction.value || "";
32
30
  })
33
31
  const isActive = computed(() => {
34
- return FuSpeedDial.active;
35
- })
36
-
37
- const size = computed(() => {
38
- return FuSpeedDial.size;
32
+ return speedDialKey?.active?.value;
39
33
  })
40
34
 
41
35
  const spacing = computed(() => {
@@ -44,13 +38,13 @@ const spacing = computed(() => {
44
38
 
45
39
  const directionPosition = computed(() => {
46
40
  if (["top", "left"].includes(direction.value)) {
47
- return -config.value.fab.size - spacing.value
41
+ return -config.value?.fab?.size - spacing.value
48
42
  }
49
- return config.value.fab.size + spacing.value
43
+ return config.value?.fab?.size + spacing.value
50
44
  })
51
45
 
52
46
  const itemSize = computed(() => {
53
- let size = config.value.fab.size + "px";
47
+ let size = config.value?.fab?.size + "px";
54
48
  return {
55
49
  width: size,
56
50
  height: size,
@@ -0,0 +1,12 @@
1
+ import {InjectionKey, ComputedRef, Ref} from "vue";
2
+
3
+ export interface SpeedDialContext {
4
+ config?: any,
5
+ direction: ComputedRef<string>,
6
+ active?: Ref<boolean>,
7
+ close(): void
8
+ }
9
+
10
+
11
+ export const SpeedDialKey: InjectionKey<SpeedDialContext> = Symbol('SpeedDialKey')
12
+
@@ -51,7 +51,7 @@ const props = defineProps({
51
51
  });
52
52
  const emit = defineEmits(["changeSplit"])
53
53
 
54
- const instance = getCurrentInstance()
54
+ const instance: any = getCurrentInstance()
55
55
 
56
56
  const active = ref(false)
57
57
  const usedValue = ref(0)
@@ -133,7 +133,7 @@ const resizerAttr = computed(() => {
133
133
  : isReverse.value
134
134
  ? "bottom"
135
135
  : "top" ;
136
- })
136
+ }) as any
137
137
  const saveKey = computed(() => {
138
138
  return "Fu-SP-" + props.localKey;
139
139
  })
@@ -1,17 +1,18 @@
1
1
  <template>
2
2
  <el-table class="fu-table" v-bind="$attrs" :key="key" header-row-class-name="fu-table-header">
3
3
  <fu-table-body name="table-body" :columns="columns">
4
- <slot/>
4
+ <slot />
5
5
  </fu-table-body>
6
6
  </el-table>
7
7
  </template>
8
8
 
9
9
  <script lang="ts" setup>
10
- import {onMounted, useSlots, ref, watch, computed, onUpdated, provide, VNodeNormalizedChildren, VNode} from "vue";
11
- import {isFix, getLabel, FuTableBody} from "@/components/table/FuTableBody";
12
- import {getChildren, isValidChildren} from "@/tools/vnode";
10
+ import { onMounted, useSlots, ref, watch, computed, onUpdated, provide, VNodeNormalizedChildren, VNode } from "vue";
11
+ import { isFix, getLabel, FuTableBody } from "@/components/table/FuTableBody";
12
+ import { isValidElementNode, getChildren, isValidChildren } from "@/tools/vnode";
13
+ import { LocalKey } from "@/components/table/types";
13
14
 
14
- defineOptions({name: "FuTable"});
15
+ defineOptions({ name: "FuTable" });
15
16
  const props = defineProps({
16
17
  columns: Array,
17
18
  refresh: {
@@ -34,8 +35,8 @@ const cleanColumns = (columns: any) => {
34
35
 
35
36
  const updateNodes = (nodes: any) => {
36
37
  nodes.forEach((node: any) => {
37
- if (!node.type.key) {
38
- node.type.key = getLabel(node)
38
+ if (isValidElementNode(node) && !(node.type as any).key) {
39
+ (node.type as any).key = getLabel(node)
39
40
  }
40
41
  })
41
42
  }
@@ -44,11 +45,11 @@ const initColumns = (nodes: any, columns: any) => {
44
45
  nodes.forEach((node: any) => {
45
46
  const label = getLabel(node)
46
47
  const fix = isFix(node);
47
- const {show} = node.props
48
+ const { show } = node.props
48
49
  if (!label && !fix) {
49
50
  throw new Error("unfixed column's label is required.")
50
51
  }
51
- columns.push({label, show, fix})
52
+ columns.push({ label, show, fix })
52
53
  })
53
54
  }
54
55
 
@@ -97,7 +98,7 @@ watch(() => props.columns,
97
98
  }
98
99
 
99
100
  },
100
- {deep: true}
101
+ { deep: true }
101
102
  )
102
103
  // 之前的created
103
104
  onMounted(() => {
@@ -126,9 +127,7 @@ onMounted(() => {
126
127
  }
127
128
  })
128
129
 
129
-
130
- provide("localKey", props.localKey)
131
-
130
+ provide(LocalKey, props.localKey)
132
131
  onUpdated(() => {
133
132
  updateNodes(children)
134
133
  updateColumns(children, props.columns)
@@ -1,15 +1,19 @@
1
1
  import FuTable from "./FuTable.vue"
2
- import FuTableColumnSelect from "./table-column-select"
2
+ import FuTableColumnSelect from "./table-column-select/FuTableColumnSelect.vue"
3
3
  import FuTablePagination from "./FuTablePagination.vue"
4
- import FuTableOperations from "./table-operations"
5
- import FuTableColumnDropdown from "./table-column-dropdown"
4
+ import FuTableOperations from "./table-operations/FuTableOperations.vue";
5
+ import FuTableButton from "./table-operations/FuTableButton.vue";
6
+ import FuTableMoreButton from "./table-operations/FuTableMoreButton.vue";
7
+ import FuTableColumnDropdown from "./FuTableColumnDropdown.vue"
6
8
 
7
9
  import type { App } from 'vue'
8
10
  FuTable.install = (app: App): void => {
9
11
  app.component(FuTable.name, FuTable);
10
12
  app.component(FuTablePagination.name, FuTablePagination)
11
- app.use(FuTableOperations.install)
12
- app.use(FuTableColumnSelect.install)
13
- app.use(FuTableColumnDropdown.install)
13
+ app.component(FuTableColumnSelect.name, FuTableColumnSelect);
14
+ app.component(FuTableColumnDropdown.name, FuTableColumnDropdown)
15
+ app.component(FuTableOperations.name, FuTableOperations);
16
+ app.component(FuTableButton.name, FuTableButton);
17
+ app.component(FuTableMoreButton.name, FuTableMoreButton);
14
18
  };
15
- export default FuTable;
19
+ export default FuTable;