@opentiny/vue-renderless 3.13.2 → 3.14.1

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 (320) hide show
  1. package/action-sheet/index.js +20 -13
  2. package/action-sheet/vue.js +8 -7
  3. package/amount/index.js +100 -25
  4. package/amount/vue.js +102 -26
  5. package/anchor/index.js +1 -0
  6. package/area/index.js +8 -8
  7. package/area/vue.js +5 -5
  8. package/async-flowchart/index.js +16 -3
  9. package/autocomplete/index.js +58 -14
  10. package/autocomplete/vue.js +40 -12
  11. package/badge/index.js +12 -0
  12. package/badge/vue.js +6 -4
  13. package/breadcrumb/vue.js +3 -1
  14. package/breadcrumb-item/vue.js +6 -2
  15. package/button/index.js +5 -1
  16. package/calendar/index.js +2 -86
  17. package/calendar-bar/index.js +18 -4
  18. package/calendar-view/index.js +5 -1
  19. package/calendar-view/vue.js +16 -3
  20. package/card-group/vue.js +4 -2
  21. package/cascader/index.js +86 -34
  22. package/cascader/vue.js +61 -20
  23. package/cascader-menu/index.js +7 -7
  24. package/cascader-menu/vue.js +2 -3
  25. package/cascader-mobile/index.js +36 -23
  26. package/cascader-mobile/vue.js +6 -0
  27. package/cascader-node/index.js +13 -1
  28. package/cascader-node/vue.js +15 -4
  29. package/cascader-panel/index.js +1 -1
  30. package/cascader-select/column-index.js +150 -0
  31. package/cascader-select/column.js +120 -0
  32. package/cascader-select/index.js +29 -165
  33. package/cascader-select/usePicker.js +251 -0
  34. package/cascader-select/useTouch.js +65 -0
  35. package/cascader-select/vue.js +35 -47
  36. package/cell/vue.js +2 -1
  37. package/chart-bar/index.js +2 -3
  38. package/chart-core/deps/constants.js +43 -43
  39. package/chart-core/index.js +1 -1
  40. package/chart-gauge/index.js +2 -2
  41. package/chart-heatmap/index.js +17 -10
  42. package/chart-line/index.js +8 -9
  43. package/chart-tree/index.js +2 -2
  44. package/chart-waterfall/index.js +4 -6
  45. package/checkbox/index.js +18 -1
  46. package/checkbox/vue.js +15 -7
  47. package/checkbox-group/vue.js +1 -0
  48. package/col/vue.js +1 -1
  49. package/collapse/index.js +3 -3
  50. package/color-select-panel/vue.js +0 -7
  51. package/column-list-item/index.js +17 -1
  52. package/column-list-item/vue.js +8 -3
  53. package/common/bigInt.js +2 -2
  54. package/common/date.js +7 -5
  55. package/common/deps/clickoutside.js +6 -2
  56. package/common/deps/date-util.js +4 -2
  57. package/common/deps/dom.js +19 -4
  58. package/common/deps/popper.js +44 -11
  59. package/common/deps/resize-event.js +1 -0
  60. package/common/deps/touch-emulator.js +4 -1
  61. package/common/deps/tree-model/node.js +2 -2
  62. package/common/deps/tree-model/tree-store.js +2 -13
  63. package/common/deps/useRect.js +25 -0
  64. package/common/deps/vue-popper.js +38 -20
  65. package/common/index.js +2 -2
  66. package/common/runtime.js +1 -1
  67. package/common/string.js +2 -2
  68. package/common/type.js +2 -1
  69. package/common/validate/rules/enum.js +1 -1
  70. package/common/validate/rules/pattern.js +2 -2
  71. package/common/validate/rules/range.js +8 -5
  72. package/common/validate/rules/required.js +1 -1
  73. package/common/validate/rules/type.js +5 -5
  74. package/common/validate/rules/whitespace.js +1 -1
  75. package/common/validate/util.js +15 -16
  76. package/common/validate/validations/integer.js +1 -1
  77. package/common/validate/validations/method.js +1 -1
  78. package/currency/index.js +74 -7
  79. package/currency/vue.js +21 -5
  80. package/date-panel/index.js +16 -0
  81. package/date-panel/vue.js +8 -2
  82. package/date-picker-mobile/index.js +12 -0
  83. package/date-picker-mobile/vue.js +7 -1
  84. package/date-range/vue.js +15 -6
  85. package/date-table/index.js +35 -53
  86. package/date-table/vue.js +4 -2
  87. package/dialog-box/index.js +46 -14
  88. package/dialog-box/vue.js +30 -7
  89. package/dialog-select/index.js +6 -3
  90. package/dialog-select/vue.js +8 -4
  91. package/drawer/index.js +27 -5
  92. package/drawer/vue.js +14 -7
  93. package/dropdown/index.js +7 -7
  94. package/dropdown/vue.js +6 -2
  95. package/dropdown-item/index.js +9 -1
  96. package/dropdown-item/mf.js +6 -10
  97. package/dropdown-item/vue.js +20 -7
  98. package/dropdown-menu/index.js +20 -7
  99. package/dropdown-menu/vue.js +4 -3
  100. package/exception/index.js +2 -7
  101. package/exception/vue.js +7 -10
  102. package/fall-menu/index.js +5 -1
  103. package/fall-menu/vue.js +13 -2
  104. package/file-upload/index.js +68 -18
  105. package/file-upload/vue.js +38 -8
  106. package/filter-box/index.js +1 -0
  107. package/float-button/index.js +42 -0
  108. package/float-button/vue.js +101 -0
  109. package/floating-button/index.js +62 -16
  110. package/floating-button/vue.js +27 -9
  111. package/flowchart/index.js +134 -25
  112. package/flowchart/node.js +13 -4
  113. package/flowchart/vue.js +16 -4
  114. package/form/vue.js +8 -0
  115. package/form-item/index.js +5 -5
  116. package/form-item/vue.js +3 -1
  117. package/fullscreen/index.js +5 -5
  118. package/fullscreen/vue.js +3 -3
  119. package/grid/plugins/export.js +5 -2
  120. package/grid/utils/column.js +1 -0
  121. package/grid/utils/dom.js +7 -1
  122. package/image/index.js +6 -1
  123. package/image/vue.js +6 -3
  124. package/image-viewer/index.js +62 -51
  125. package/image-viewer/vue.js +17 -5
  126. package/input/index.js +81 -20
  127. package/input/vue.js +44 -18
  128. package/ip-address/index.js +61 -19
  129. package/ip-address/vue.js +22 -4
  130. package/link/vue.js +3 -1
  131. package/loading/index.js +2 -2
  132. package/loading/vue.js +8 -2
  133. package/logout/index.js +1 -1
  134. package/menu/index.js +15 -2
  135. package/menu/vue.js +22 -17
  136. package/mind-map/index.js +47 -0
  137. package/mind-map/vue.js +53 -0
  138. package/modal/index.js +44 -4
  139. package/modal/vue.js +18 -4
  140. package/multi-select/index.js +186 -11
  141. package/multi-select/vue.js +60 -15
  142. package/multi-select-item/index.js +23 -0
  143. package/multi-select-item/vue.js +31 -0
  144. package/numeric/index.js +48 -12
  145. package/numeric/vue.js +44 -19
  146. package/option/index.js +27 -9
  147. package/option/vue.js +37 -21
  148. package/option-group/index.js +3 -3
  149. package/package.json +1 -1
  150. package/pager/index.js +18 -4
  151. package/pager/vue.js +16 -5
  152. package/picker/index.js +290 -77
  153. package/picker/mb.js +42 -0
  154. package/picker/vue.js +76 -20
  155. package/picker-column/index.js +1 -1
  156. package/pop-upload/vue.js +3 -0
  157. package/popconfirm/index.js +3 -6
  158. package/popconfirm/vue.js +1 -1
  159. package/popeditor/index.js +73 -34
  160. package/popeditor/vue.js +15 -11
  161. package/popover/index.js +4 -4
  162. package/popover/vue.js +6 -6
  163. package/popup/index.js +3 -3
  164. package/popup/vue.js +5 -5
  165. package/pull-refresh/index.js +13 -13
  166. package/pull-refresh/vue.js +5 -4
  167. package/radio/index.js +0 -17
  168. package/radio/vue.js +4 -10
  169. package/rate/index.js +1 -1
  170. package/rate/vue.js +0 -2
  171. package/record/index.js +4 -1
  172. package/rich-text/clipboard.js +54 -0
  173. package/rich-text/index.js +192 -0
  174. package/rich-text/module/file-upload.js +107 -0
  175. package/rich-text/module/image-drop.js +63 -0
  176. package/rich-text/module/image-upload.js +89 -0
  177. package/rich-text/options.js +141 -0
  178. package/rich-text/table-module.js +382 -0
  179. package/rich-text/vue.js +102 -0
  180. package/{rich-text-edtior → rich-text-editor}/index.js +2 -2
  181. package/{rich-text-edtior → rich-text-editor}/vue.js +2 -5
  182. package/scrollbar/index.js +11 -11
  183. package/scrollbar/vue-bar.js +3 -3
  184. package/scrollbar/vue.js +5 -5
  185. package/search/index.js +9 -9
  186. package/search/vue.js +8 -6
  187. package/select/index.js +442 -393
  188. package/select/vue.js +278 -164
  189. package/select-dropdown/index.js +61 -3
  190. package/select-dropdown/vue.js +85 -8
  191. package/select-view/index.js +3 -1
  192. package/selected-box/index.js +2 -0
  193. package/selected-box/vue.js +6 -3
  194. package/signature/index.js +241 -0
  195. package/signature/vue.js +88 -0
  196. package/skeleton/index.js +14 -0
  197. package/skeleton/vue.js +15 -0
  198. package/skeleton-item/vue.js +15 -0
  199. package/slider/index.js +70 -17
  200. package/slider/vue.js +16 -7
  201. package/split/index.js +5 -3
  202. package/split/vue.js +4 -6
  203. package/standard-list-item/index.js +15 -1
  204. package/standard-list-item/vue.js +6 -5
  205. package/steps/index.js +25 -2
  206. package/steps/slide-bar.js +8 -1
  207. package/steps/vue.js +15 -3
  208. package/tab-item-mf/vue.js +14 -8
  209. package/tab-nav/index.js +30 -5
  210. package/tab-nav/vue.js +16 -4
  211. package/tabbar/vue.js +9 -3
  212. package/tabbar-item/vue.js +3 -2
  213. package/tabs/index.js +16 -4
  214. package/tabs/vue.js +2 -1
  215. package/tabs-mf/index.js +20 -6
  216. package/tabs-mf/vue-nav.js +26 -11
  217. package/tabs-mf/vue.js +7 -7
  218. package/tabs-mf/wheel.js +1 -0
  219. package/tag/index.js +1 -1
  220. package/tag-group/index.js +2 -1
  221. package/time/index.js +5 -2
  222. package/time/vue.js +1 -1
  223. package/time-line/index.js +3 -3
  224. package/time-line/vue.js +2 -2
  225. package/time-picker-mobile/index.js +24 -5
  226. package/time-picker-mobile/vue.js +17 -7
  227. package/time-range/index.js +2 -0
  228. package/timeline-item/vue.js +1 -1
  229. package/tooltip/index.js +6 -3
  230. package/tooltip/vue.js +4 -4
  231. package/transfer/index.js +20 -22
  232. package/transfer/vue.js +1 -6
  233. package/transfer-panel/vue.js +3 -5
  234. package/tree/index.js +21 -4
  235. package/tree/vue.js +10 -8
  236. package/tree-menu/index.js +29 -3
  237. package/tree-menu/vue.js +28 -15
  238. package/tree-node/index.js +18 -18
  239. package/tree-node/vue.js +6 -5
  240. package/types/action-sheet.type.d.ts +118 -1
  241. package/types/amount.type.d.ts +168 -1
  242. package/types/area.type.d.ts +134 -1
  243. package/types/async-flowchart.type.d.ts +72 -0
  244. package/types/autocomplete.type.d.ts +199 -1
  245. package/types/badge.type.d.ts +3 -1
  246. package/types/breadcrumb-item.type.d.ts +2 -0
  247. package/types/breadcrumb.type.d.ts +2 -0
  248. package/types/button-group.type.d.ts +3 -3
  249. package/types/button.type.d.ts +4 -0
  250. package/types/cascader-menu.type.d.ts +3 -4
  251. package/types/cascader-node.type.d.ts +5 -2
  252. package/types/cascader-panel.type-2bd03be3.d.ts +241 -0
  253. package/types/cascader-panel.type.d.ts +3 -241
  254. package/types/cascader.type.d.ts +329 -1
  255. package/types/checkbox.type.d.ts +6 -0
  256. package/types/collapse.type.d.ts +19 -2
  257. package/types/date-picker.type.d.ts +38 -1
  258. package/types/dialog-box.type.d.ts +13 -3
  259. package/types/drawer.type.d.ts +133 -1
  260. package/types/{dropdown-item.type-8ea6c633.d.ts → dropdown-item.type-8475a549.d.ts} +7 -13
  261. package/types/dropdown-item.type.d.ts +1 -1
  262. package/types/dropdown-menu.type.d.ts +1 -1
  263. package/types/dropdown.type.d.ts +1 -5
  264. package/types/fall-menu.type.d.ts +94 -1
  265. package/types/file-upload.type.d.ts +1 -1
  266. package/types/float-button.type.d.ts +123 -0
  267. package/types/form-item.type.d.ts +1 -1
  268. package/types/{form.type-d0fd42f3.d.ts → form.type-a2dc0099.d.ts} +4 -1
  269. package/types/form.type.d.ts +1 -1
  270. package/types/{index-e0250f63.d.ts → index-b012f687.d.ts} +9 -0
  271. package/types/input.type.d.ts +2 -6
  272. package/types/ip-address.type.d.ts +160 -1
  273. package/types/link.type.d.ts +6 -3
  274. package/types/loading.type.d.ts +7 -0
  275. package/types/mind-map.type.d.ts +20 -0
  276. package/types/modal.type.d.ts +29 -2
  277. package/types/numeric.type.d.ts +41 -10
  278. package/types/pager.type.d.ts +12 -0
  279. package/types/picker.type.d.ts +18 -0
  280. package/types/popconfirm.type.d.ts +86 -1
  281. package/types/popeditor.type.d.ts +4 -0
  282. package/types/popover.type.d.ts +3 -3
  283. package/types/progress.type.d.ts +2 -0
  284. package/types/radio.type.d.ts +0 -4
  285. package/types/rate.type.d.ts +236 -1
  286. package/types/search.type.d.ts +88 -1
  287. package/types/shared.type.d.ts +1 -1
  288. package/types/skeleton-item.type.d.ts +38 -0
  289. package/types/skeleton.type.d.ts +45 -0
  290. package/types/slider.type.d.ts +49 -10
  291. package/types/steps.type.d.ts +14 -3
  292. package/types/tab-bar.type.d.ts +1 -1
  293. package/types/tab-nav.type.d.ts +7 -2
  294. package/types/tabs.type.d.ts +9 -1
  295. package/types/tag-group.type.d.ts +64 -1
  296. package/types/{time-line.type-d7daa669.d.ts → time-line.type-b155cb4f.d.ts} +12 -0
  297. package/types/time-line.type.d.ts +1 -1
  298. package/types/timeline-item.type.d.ts +1 -1
  299. package/types/tooltip.type.d.ts +2 -2
  300. package/types/transfer.type.d.ts +185 -1
  301. package/types/tree-menu.type.d.ts +210 -1
  302. package/types/upload-dragger.type.d.ts +1 -1
  303. package/types/{upload-list.type-343e8c11.d.ts → upload-list.type-6d6e3d0e.d.ts} +35 -8
  304. package/types/upload-list.type.d.ts +1 -1
  305. package/types/upload.type.d.ts +1 -1
  306. package/types/user-head.type.d.ts +146 -1
  307. package/types/wizard.type.d.ts +1 -0
  308. package/upload/index.js +64 -34
  309. package/upload/vue.js +9 -5
  310. package/upload-dragger/index.js +22 -20
  311. package/upload-list/index.js +24 -18
  312. package/upload-list/vue.js +9 -4
  313. package/user/index.js +35 -26
  314. package/user/vue.js +1 -1
  315. package/user-head/index.js +3 -3
  316. package/watermark/index.js +11 -0
  317. package/wheel/index.js +3 -0
  318. package/wizard/vue.js +4 -2
  319. package/common/deps/modal-queue.js +0 -6
  320. package/common/deps/requestAnimationFrame.js +0 -25
@@ -0,0 +1,241 @@
1
+ import { VNode } from 'vue';
2
+ import { ISharedRenderlessFunctionParams, ISharedRenderlessParamUtils } from './shared.type.js';
3
+
4
+ /**
5
+ * Copyright (c) 2022 - present TinyVue Authors.
6
+ * Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
7
+ *
8
+ * Use of this source code is governed by an MIT-style license.
9
+ *
10
+ * THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
11
+ * BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
12
+ * A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
13
+ *
14
+ */
15
+
16
+ declare class Node {
17
+ parent: Node | null;
18
+ level: number;
19
+ data: ICascaderPanelData;
20
+ config: ICascaderPanelConfig;
21
+ uid: number;
22
+ value: ICascaderPanelNodeValue;
23
+ label: string;
24
+ pathNodes: Node[];
25
+ path: ICascaderPanelNodeValue[];
26
+ pathLabels: string[];
27
+ loaded: boolean;
28
+ loading: boolean;
29
+ hasChildren: boolean;
30
+ children: Node[];
31
+ checked?: boolean;
32
+ indeterminate?: boolean;
33
+ root?: boolean;
34
+ constructor(data: ICascaderPanelData, config: ICascaderPanelConfig, parentNode?: Node | null);
35
+ initState(): void;
36
+ initChildren(): void;
37
+ get isLeaf(): boolean;
38
+ /**
39
+ * 当前节点是否被disable
40
+ */
41
+ get isDisabled(): boolean;
42
+ calculatePathNodes(): Node[];
43
+ getValue(): ICascaderPanelNodeValue;
44
+ getPath(): ICascaderPanelNodeValue[];
45
+ getValueByOption(): ICascaderPanelNodePropValue;
46
+ /**
47
+ *
48
+ * @param allLevels 输入框中是否显示选中值的完整路径
49
+ * @param separator 分割符
50
+ * @returns 选中值的路径
51
+ */
52
+ getText(allLevels: boolean, separator: string): string;
53
+ isSameNode(checkedValue: ICascaderPanelNodePropValue): boolean;
54
+ emit(eventName: string, ...args: any[]): void;
55
+ broadcast(eventName: string, ...args: any[]): void;
56
+ onParentCheck(checked: boolean): void;
57
+ onChildCheck(): void;
58
+ syncCheckState(checkedValue: ICascaderPanelNodePropValue): void;
59
+ setCheckState(checked: boolean): void;
60
+ doCheck(isChecked: boolean): void;
61
+ }
62
+
63
+ /**
64
+ * Copyright (c) 2022 - present TinyVue Authors.
65
+ * Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
66
+ *
67
+ * Use of this source code is governed by an MIT-style license.
68
+ *
69
+ * THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
70
+ * BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
71
+ * A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
72
+ *
73
+ */
74
+
75
+ declare class Store {
76
+ config: ICascaderPanelConfig;
77
+ nodes: ICascaderPanelNode[];
78
+ flattedNodes: ICascaderPanelNode[];
79
+ leafNodes: ICascaderPanelNode[];
80
+ constructor(data: ICascaderPanelData | ICascaderPanelData[], config: ICascaderPanelConfig);
81
+ getNodes(): Node[];
82
+ initNodes(data: ICascaderPanelData | ICascaderPanelData[]): void;
83
+ /**
84
+ * 添加节点到parentNode
85
+ */
86
+ appendNode(nodeData: ICascaderPanelData, parentNode?: ICascaderPanelNode | null): void;
87
+ /**
88
+ * 添加节点到parentNode
89
+ */
90
+ appendNodes(nodeDataList: ICascaderPanelData[], parentNode?: ICascaderPanelNode | null): void;
91
+ /**
92
+ * 获取节点值
93
+ * @param leafOnly 只包含叶子节点
94
+ * @param cached 取缓存(flattedNodes或者leafNodes)中的数据
95
+ * @returns
96
+ */
97
+ getFlattedNodes(leafOnly: boolean, cached?: boolean): Node[];
98
+ /**
99
+ * 通过节点值获取Node节点
100
+ * @param value
101
+ * @returns
102
+ */
103
+ getNodeByValue(value: ICascaderPanelNodePropValue | null): Node | null;
104
+ }
105
+
106
+ /**
107
+ * Copyright (c) 2022 - present TinyVue Authors.
108
+ * Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
109
+ *
110
+ * Use of this source code is governed by an MIT-style license.
111
+ *
112
+ * THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
113
+ * BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
114
+ * A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
115
+ *
116
+ */
117
+
118
+ declare const watchCheckedValue: ({ api, emit, props, state }: Pick<ICascaderPanelRenderlessParams, 'api' | 'emit' | 'props' | 'state'>) => (value: ICascaderPanelNodePropValue | null) => void;
119
+ declare const initStore: ({ api, props, state, Store }: Pick<ICascaderPanelRenderlessParams, 'api' | 'props' | 'state' | 'Store'>) => () => void;
120
+ declare const syncCheckedValue: ({ api, props, state }: Pick<ICascaderPanelRenderlessParams, 'api' | 'props' | 'state'>) => () => void;
121
+ declare const syncMenuState: ({ api, nextTick, state }: Pick<ICascaderPanelRenderlessParams, 'api' | 'nextTick' | 'state'>) => () => void;
122
+ declare const syncMultiCheckState: ({ api, state }: Pick<ICascaderPanelRenderlessParams, 'api' | 'state'>) => () => void;
123
+ declare const syncActivePath: ({ api, state }: Pick<ICascaderPanelRenderlessParams, 'api' | 'state'>) => () => void;
124
+ declare const expandNodes: (api: ICascaderPanelApi) => (nodes: ICascaderPanelNode[]) => void;
125
+ declare const calculateCheckedNodePaths: ({ api, state }: Pick<ICascaderPanelRenderlessParams, 'api' | 'state'>) => () => void;
126
+ declare const focusNode: (api: ICascaderPanelApi) => (el: HTMLElement | null) => void;
127
+ declare const getMenuIndex: () => (el: Element) => number | undefined;
128
+ declare const checkNode: (api: ICascaderPanelApi) => (el: HTMLElement) => void;
129
+ declare const handleKeyDown: ({ api, emit, menus }: Pick<ICascaderPanelRenderlessParams, 'api' | 'emit' | 'menus'>) => (event: KeyboardEvent) => void;
130
+ declare const handleExpand: ({ emit, state }: Pick<ICascaderPanelRenderlessParams, 'emit' | 'state'>) => (node: ICascaderPanelNode, silent?: boolean) => void;
131
+ declare const handleCheckChange: (state: ICascaderPanelState) => (value: ICascaderPanelNodePropValue) => void;
132
+ declare const lazyLoad: ({ api, $parent, state, Store }: Pick<ICascaderPanelRenderlessParams, 'api' | '$parent' | 'state' | 'Store'>) => (currentNode?: ICascaderPanelNode, onFullfiled?: ((dataList: ICascaderPanelData[]) => void) | undefined) => void;
133
+ declare const calculateMultiCheckedValue: ({ api, state }: Pick<ICascaderPanelRenderlessParams, 'api' | 'state'>) => () => void;
134
+ declare const scrollIntoView: ({ menus }: Pick<ICascaderPanelRenderlessParams, 'menus'>) => () => void;
135
+ declare const getNodeByValue: (state: ICascaderPanelState) => (val: ICascaderPanelNodePropValue | null) => ICascaderPanelNode | null;
136
+ declare const getFlattedNodes: (state: ICascaderPanelState) => (leafOnly: boolean) => ICascaderPanelNode[];
137
+ declare const getCheckedNodes: ({ api, state }: Pick<ICascaderPanelRenderlessParams, 'api' | 'state'>) => (leafOnly: boolean, cascaderCheckedValue?: ICascaderPanelNodePropValue) => ICascaderPanelNode[];
138
+ declare const clearCheckedNodes: ({ api, state }: Pick<ICascaderPanelRenderlessParams, 'api' | 'state'>) => () => void;
139
+ declare const isLeaf: () => (el: Element) => boolean;
140
+
141
+ /** CascaderPanel的节点 */
142
+ type ICascaderPanelNode = Node;
143
+ /** CascaderPanel的Store,用来操作ICascaderPanelNode */
144
+ type ICascaderPanelStore = Store;
145
+ type ICascaderPanelNodeValue = string | Object | number;
146
+ /** 值的类型(是数组还是值)由ICascaderPanelConfig的emitPath和multiple决定 */
147
+ type ICascaderPanelNodePropValue = ICascaderPanelNodeValue | ICascaderPanelNodeValue[] | ICascaderPanelNodeValue[][];
148
+ /** 懒加载时,提供给用户的根节点的node */
149
+ interface ICascaderPanelLazyLoadNode {
150
+ root: boolean;
151
+ level: number;
152
+ loading?: boolean;
153
+ loaded?: boolean;
154
+ }
155
+ /** CascaderPanel的配置 */
156
+ interface ICascaderPanelConfig {
157
+ emitPath: boolean;
158
+ expandTrigger: 'click' | 'hover';
159
+ hoverThreshold: number;
160
+ checkStrictly?: boolean;
161
+ multiple?: boolean;
162
+ lazy: boolean;
163
+ lazyLoad: (node: ICascaderPanelNode | ICascaderPanelLazyLoadNode, resolve: (dataList: ICascaderPanelData[]) => void) => void;
164
+ value: string;
165
+ label: string;
166
+ children: string;
167
+ disabled: string;
168
+ leaf: string;
169
+ }
170
+ /**
171
+ * ICascaderPanelData的结构里的key名由ICascaderPanelConfig的value、label、children、disabled、leaf的值决定
172
+ */
173
+ interface ICascaderPanelData {
174
+ value?: ICascaderPanelNodeValue;
175
+ label?: string;
176
+ children?: ICascaderPanelData[];
177
+ disabled?: boolean;
178
+ leaf?: boolean;
179
+ [key: string]: ICascaderPanelNodeValue | ICascaderPanelData[] | string | boolean | undefined;
180
+ }
181
+ type IRenderLabelFunction = (arg1: {
182
+ node: ICascaderPanelNode;
183
+ data: ICascaderPanelData;
184
+ }) => VNode;
185
+ interface ICascaderPanelProps {
186
+ modelValue: ICascaderPanelNodePropValue;
187
+ options: ICascaderPanelData[];
188
+ props: ICascaderPanelConfig;
189
+ border: boolean;
190
+ renderLabel?: IRenderLabelFunction;
191
+ }
192
+ interface ICascaderPanelState {
193
+ checkedValue: ICascaderPanelNodePropValue | null;
194
+ checkedNodePaths: ICascaderPanelNode[][];
195
+ store: ICascaderPanelStore;
196
+ menus: ICascaderPanelNode[][];
197
+ activePath: ICascaderPanelNode[];
198
+ loadCount: number;
199
+ multiple?: boolean;
200
+ checkStrictly?: boolean;
201
+ leafOnly: boolean;
202
+ isHoverMenu: boolean;
203
+ renderLabelFn?: IRenderLabelFunction;
204
+ config: ICascaderPanelConfig & ICascaderPanelProps;
205
+ }
206
+ interface ICascaderPanelApi {
207
+ state: ICascaderPanelState;
208
+ isLeaf: ReturnType<typeof isLeaf>;
209
+ getMenuIndex: ReturnType<typeof getMenuIndex>;
210
+ getNodeByValue: ReturnType<typeof getNodeByValue>;
211
+ getFlattedNodes: ReturnType<typeof getFlattedNodes>;
212
+ handleCheckChange: ReturnType<typeof handleCheckChange>;
213
+ scrollIntoView: ReturnType<typeof scrollIntoView>;
214
+ syncActivePath: ReturnType<typeof syncActivePath>;
215
+ initStore: ReturnType<typeof initStore>;
216
+ syncMenuState: ReturnType<typeof syncMenuState>;
217
+ syncMultiCheckState: ReturnType<typeof syncMultiCheckState>;
218
+ calculateCheckedNodePaths: ReturnType<typeof calculateCheckedNodePaths>;
219
+ lazyLoad: ReturnType<typeof lazyLoad>;
220
+ syncCheckedValue: ReturnType<typeof syncCheckedValue>;
221
+ focusNode: ReturnType<typeof focusNode>;
222
+ checkNode: ReturnType<typeof checkNode>;
223
+ expandNodes: ReturnType<typeof expandNodes>;
224
+ handleExpand: ReturnType<typeof handleExpand>;
225
+ getCheckedNodes: ReturnType<typeof getCheckedNodes>;
226
+ clearCheckedNodes: ReturnType<typeof clearCheckedNodes>;
227
+ calculateMultiCheckedValue: ReturnType<typeof calculateMultiCheckedValue>;
228
+ watchCheckedValue: ReturnType<typeof watchCheckedValue>;
229
+ handleKeyDown: ReturnType<typeof handleKeyDown>;
230
+ }
231
+ type ICascaderPanelRenderlessParams = ISharedRenderlessFunctionParams<never> & {
232
+ state: ICascaderPanelState;
233
+ props: ICascaderPanelProps;
234
+ api: ICascaderPanelApi;
235
+ Store: typeof Store;
236
+ $parent: ICascaderPanelRenderlessParams['parent'];
237
+ menus: ICascaderPanelRenderlessParams['vm'][];
238
+ };
239
+ type ICascaderPanelRenderlessParamUtils = ISharedRenderlessParamUtils<never>;
240
+
241
+ export { ICascaderPanelNode as I, Node as N, ICascaderPanelApi as a, ICascaderPanelConfig as b, ICascaderPanelNodeValue as c, ICascaderPanelNodePropValue as d, ICascaderPanelStore as e, ICascaderPanelLazyLoadNode as f, ICascaderPanelData as g, ICascaderPanelProps as h, ICascaderPanelState as i, ICascaderPanelRenderlessParams as j, ICascaderPanelRenderlessParamUtils as k };
@@ -1,241 +1,3 @@
1
- import { VNode } from 'vue';
2
- import { ISharedRenderlessFunctionParams, ISharedRenderlessParamUtils } from './shared.type.js';
3
-
4
- /**
5
- * Copyright (c) 2022 - present TinyVue Authors.
6
- * Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
7
- *
8
- * Use of this source code is governed by an MIT-style license.
9
- *
10
- * THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
11
- * BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
12
- * A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
13
- *
14
- */
15
-
16
- declare class Node {
17
- parent: Node | null;
18
- level: number;
19
- data: ICascaderPanelData;
20
- config: ICascaderPanelConfig;
21
- uid: number;
22
- value: ICascaderPanelNodeValue;
23
- label: string;
24
- pathNodes: Node[];
25
- path: ICascaderPanelNodeValue[];
26
- pathLabels: string[];
27
- loaded: boolean;
28
- loading: boolean;
29
- hasChildren: boolean;
30
- children: Node[];
31
- checked?: boolean;
32
- indeterminate?: boolean;
33
- root?: boolean;
34
- constructor(data: ICascaderPanelData, config: ICascaderPanelConfig, parentNode?: Node | null);
35
- initState(): void;
36
- initChildren(): void;
37
- get isLeaf(): boolean;
38
- /**
39
- * 当前节点是否被disable
40
- */
41
- get isDisabled(): boolean;
42
- calculatePathNodes(): Node[];
43
- getValue(): ICascaderPanelNodeValue;
44
- getPath(): ICascaderPanelNodeValue[];
45
- getValueByOption(): ICascaderPanelNodePropValue;
46
- /**
47
- *
48
- * @param allLevels 输入框中是否显示选中值的完整路径
49
- * @param separator 分割符
50
- * @returns 选中值的路径
51
- */
52
- getText(allLevels: boolean, separator: string): string;
53
- isSameNode(checkedValue: ICascaderPanelNodePropValue): boolean;
54
- emit(eventName: string, ...args: any[]): void;
55
- broadcast(eventName: string, ...args: any[]): void;
56
- onParentCheck(checked: boolean): void;
57
- onChildCheck(): void;
58
- syncCheckState(checkedValue: ICascaderPanelNodePropValue): void;
59
- setCheckState(checked: boolean): void;
60
- doCheck(isChecked: boolean): void;
61
- }
62
-
63
- /**
64
- * Copyright (c) 2022 - present TinyVue Authors.
65
- * Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
66
- *
67
- * Use of this source code is governed by an MIT-style license.
68
- *
69
- * THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
70
- * BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
71
- * A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
72
- *
73
- */
74
-
75
- declare class Store {
76
- config: ICascaderPanelConfig;
77
- nodes: ICascaderPanelNode[];
78
- flattedNodes: ICascaderPanelNode[];
79
- leafNodes: ICascaderPanelNode[];
80
- constructor(data: ICascaderPanelData | ICascaderPanelData[], config: ICascaderPanelConfig);
81
- getNodes(): Node[];
82
- initNodes(data: ICascaderPanelData | ICascaderPanelData[]): void;
83
- /**
84
- * 添加节点到parentNode
85
- */
86
- appendNode(nodeData: ICascaderPanelData, parentNode?: ICascaderPanelNode | null): void;
87
- /**
88
- * 添加节点到parentNode
89
- */
90
- appendNodes(nodeDataList: ICascaderPanelData[], parentNode?: ICascaderPanelNode | null): void;
91
- /**
92
- * 获取节点值
93
- * @param leafOnly 只包含叶子节点
94
- * @param cached 取缓存(flattedNodes或者leafNodes)中的数据
95
- * @returns
96
- */
97
- getFlattedNodes(leafOnly: boolean, cached?: boolean): Node[];
98
- /**
99
- * 通过节点值获取Node节点
100
- * @param value
101
- * @returns
102
- */
103
- getNodeByValue(value: ICascaderPanelNodePropValue | null): Node | null;
104
- }
105
-
106
- /**
107
- * Copyright (c) 2022 - present TinyVue Authors.
108
- * Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
109
- *
110
- * Use of this source code is governed by an MIT-style license.
111
- *
112
- * THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
113
- * BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
114
- * A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
115
- *
116
- */
117
-
118
- declare const watchCheckedValue: ({ api, emit, props, state }: Pick<ICascaderPanelRenderlessParams, 'api' | 'emit' | 'props' | 'state'>) => (value: ICascaderPanelNodePropValue | null) => void;
119
- declare const initStore: ({ api, props, state, Store }: Pick<ICascaderPanelRenderlessParams, 'api' | 'props' | 'state' | 'Store'>) => () => void;
120
- declare const syncCheckedValue: ({ api, props, state }: Pick<ICascaderPanelRenderlessParams, 'api' | 'props' | 'state'>) => () => void;
121
- declare const syncMenuState: ({ api, nextTick, state }: Pick<ICascaderPanelRenderlessParams, 'api' | 'nextTick' | 'state'>) => () => void;
122
- declare const syncMultiCheckState: ({ api, state }: Pick<ICascaderPanelRenderlessParams, 'api' | 'state'>) => () => void;
123
- declare const syncActivePath: ({ api, state }: Pick<ICascaderPanelRenderlessParams, 'api' | 'state'>) => () => void;
124
- declare const expandNodes: (api: ICascaderPanelApi) => (nodes: ICascaderPanelNode[]) => void;
125
- declare const calculateCheckedNodePaths: ({ api, state }: Pick<ICascaderPanelRenderlessParams, 'api' | 'state'>) => () => void;
126
- declare const focusNode: (api: ICascaderPanelApi) => (el: HTMLElement | null) => void;
127
- declare const getMenuIndex: () => (el: Element) => number | undefined;
128
- declare const checkNode: (api: ICascaderPanelApi) => (el: HTMLElement) => void;
129
- declare const handleKeyDown: ({ api, emit, menus }: Pick<ICascaderPanelRenderlessParams, 'api' | 'emit' | 'menus'>) => (event: KeyboardEvent) => void;
130
- declare const handleExpand: ({ emit, state }: Pick<ICascaderPanelRenderlessParams, 'emit' | 'state'>) => (node: ICascaderPanelNode, silent?: boolean) => void;
131
- declare const handleCheckChange: (state: ICascaderPanelState) => (value: ICascaderPanelNodePropValue) => void;
132
- declare const lazyLoad: ({ api, $parent, state, Store }: Pick<ICascaderPanelRenderlessParams, 'api' | '$parent' | 'state' | 'Store'>) => (currentNode?: ICascaderPanelNode, onFullfiled?: ((dataList: ICascaderPanelData[]) => void) | undefined) => void;
133
- declare const calculateMultiCheckedValue: ({ api, state }: Pick<ICascaderPanelRenderlessParams, 'api' | 'state'>) => () => void;
134
- declare const scrollIntoView: ({ menus }: Pick<ICascaderPanelRenderlessParams, 'menus'>) => () => void;
135
- declare const getNodeByValue: (state: ICascaderPanelState) => (val: ICascaderPanelNodePropValue | null) => ICascaderPanelNode | null;
136
- declare const getFlattedNodes: (state: ICascaderPanelState) => (leafOnly: boolean) => ICascaderPanelNode[];
137
- declare const getCheckedNodes: ({ api, state }: Pick<ICascaderPanelRenderlessParams, 'api' | 'state'>) => (leafOnly: boolean, cascaderCheckedValue?: ICascaderPanelNodePropValue) => ICascaderPanelNode[];
138
- declare const clearCheckedNodes: ({ api, state }: Pick<ICascaderPanelRenderlessParams, 'api' | 'state'>) => () => void;
139
- declare const isLeaf: () => (el: Element) => boolean;
140
-
141
- /** CascaderPanel的节点 */
142
- type ICascaderPanelNode = Node;
143
- /** CascaderPanel的Store,用来操作ICascaderPanelNode */
144
- type ICascaderPanelStore = Store;
145
- type ICascaderPanelNodeValue = string | Object | number;
146
- /** 值的类型(是数组还是值)由ICascaderPanelConfig的emitPath和multiple决定 */
147
- type ICascaderPanelNodePropValue = ICascaderPanelNodeValue | ICascaderPanelNodeValue[] | ICascaderPanelNodeValue[][];
148
- /** 懒加载时,提供给用户的根节点的node */
149
- interface ICascaderPanelLazyLoadNode {
150
- root: boolean;
151
- level: number;
152
- loading?: boolean;
153
- loaded?: boolean;
154
- }
155
- /** CascaderPanel的配置 */
156
- interface ICascaderPanelConfig {
157
- emitPath: boolean;
158
- expandTrigger: 'click' | 'hover';
159
- hoverThreshold: number;
160
- checkStrictly?: boolean;
161
- multiple?: boolean;
162
- lazy: boolean;
163
- lazyLoad: (node: ICascaderPanelNode | ICascaderPanelLazyLoadNode, resolve: (dataList: ICascaderPanelData[]) => void) => void;
164
- value: string;
165
- label: string;
166
- children: string;
167
- disabled: string;
168
- leaf: string;
169
- }
170
- /**
171
- * ICascaderPanelData的结构里的key名由ICascaderPanelConfig的value、label、children、disabled、leaf的值决定
172
- */
173
- interface ICascaderPanelData {
174
- value?: ICascaderPanelNodeValue;
175
- label?: string;
176
- children?: ICascaderPanelData[];
177
- disabled?: boolean;
178
- leaf?: boolean;
179
- [key: string]: ICascaderPanelNodeValue | ICascaderPanelData[] | string | boolean | undefined;
180
- }
181
- type IRenderLabelFunction = (arg1: {
182
- node: ICascaderPanelNode;
183
- data: ICascaderPanelData;
184
- }) => VNode;
185
- interface ICascaderPanelProps {
186
- modelValue: ICascaderPanelNodePropValue;
187
- options: ICascaderPanelData[];
188
- props: ICascaderPanelConfig;
189
- border: boolean;
190
- renderLabel?: IRenderLabelFunction;
191
- }
192
- interface ICascaderPanelState {
193
- checkedValue: ICascaderPanelNodePropValue | null;
194
- checkedNodePaths: ICascaderPanelNode[][];
195
- store: ICascaderPanelStore;
196
- menus: ICascaderPanelNode[][];
197
- activePath: ICascaderPanelNode[];
198
- loadCount: number;
199
- multiple?: boolean;
200
- checkStrictly?: boolean;
201
- leafOnly: boolean;
202
- isHoverMenu: boolean;
203
- renderLabelFn?: IRenderLabelFunction;
204
- config: ICascaderPanelConfig & ICascaderPanelProps;
205
- }
206
- interface ICascaderPanelApi {
207
- state: ICascaderPanelState;
208
- isLeaf: ReturnType<typeof isLeaf>;
209
- getMenuIndex: ReturnType<typeof getMenuIndex>;
210
- getNodeByValue: ReturnType<typeof getNodeByValue>;
211
- getFlattedNodes: ReturnType<typeof getFlattedNodes>;
212
- handleCheckChange: ReturnType<typeof handleCheckChange>;
213
- scrollIntoView: ReturnType<typeof scrollIntoView>;
214
- syncActivePath: ReturnType<typeof syncActivePath>;
215
- initStore: ReturnType<typeof initStore>;
216
- syncMenuState: ReturnType<typeof syncMenuState>;
217
- syncMultiCheckState: ReturnType<typeof syncMultiCheckState>;
218
- calculateCheckedNodePaths: ReturnType<typeof calculateCheckedNodePaths>;
219
- lazyLoad: ReturnType<typeof lazyLoad>;
220
- syncCheckedValue: ReturnType<typeof syncCheckedValue>;
221
- focusNode: ReturnType<typeof focusNode>;
222
- checkNode: ReturnType<typeof checkNode>;
223
- expandNodes: ReturnType<typeof expandNodes>;
224
- handleExpand: ReturnType<typeof handleExpand>;
225
- getCheckedNodes: ReturnType<typeof getCheckedNodes>;
226
- clearCheckedNodes: ReturnType<typeof clearCheckedNodes>;
227
- calculateMultiCheckedValue: ReturnType<typeof calculateMultiCheckedValue>;
228
- watchCheckedValue: ReturnType<typeof watchCheckedValue>;
229
- handleKeyDown: ReturnType<typeof handleKeyDown>;
230
- }
231
- type ICascaderPanelRenderlessParams = ISharedRenderlessFunctionParams<never> & {
232
- state: ICascaderPanelState;
233
- props: ICascaderPanelProps;
234
- api: ICascaderPanelApi;
235
- Store: typeof Store;
236
- $parent: ICascaderPanelRenderlessParams['parent'];
237
- menus: ICascaderPanelRenderlessParams['vm'][];
238
- };
239
- type ICascaderPanelRenderlessParamUtils = ISharedRenderlessParamUtils<never>;
240
-
241
- export { ICascaderPanelApi, ICascaderPanelConfig, ICascaderPanelData, ICascaderPanelLazyLoadNode, ICascaderPanelNode, ICascaderPanelNodePropValue, ICascaderPanelNodeValue, ICascaderPanelProps, ICascaderPanelRenderlessParamUtils, ICascaderPanelRenderlessParams, ICascaderPanelState, ICascaderPanelStore };
1
+ import 'vue';
2
+ export { a as ICascaderPanelApi, b as ICascaderPanelConfig, g as ICascaderPanelData, f as ICascaderPanelLazyLoadNode, I as ICascaderPanelNode, d as ICascaderPanelNodePropValue, c as ICascaderPanelNodeValue, h as ICascaderPanelProps, k as ICascaderPanelRenderlessParamUtils, j as ICascaderPanelRenderlessParams, i as ICascaderPanelState, e as ICascaderPanelStore } from './cascader-panel.type-2bd03be3.js';
3
+ import './shared.type.js';