@gmfe/react 2.14.30-alpha.0 → 2.14.31

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 (72) hide show
  1. package/README.md +295 -0
  2. package/package.json +4 -4
  3. package/src/component/affix/README.md +54 -0
  4. package/src/component/box/README.md +142 -0
  5. package/src/component/box/box_table.js +11 -18
  6. package/src/component/button/README.md +90 -0
  7. package/src/component/calendar/README.md +98 -0
  8. package/src/component/carousel/README.md +51 -0
  9. package/src/component/cascader/README.md +139 -0
  10. package/src/component/checkbox/README.md +120 -0
  11. package/src/component/collapse/README.md +80 -0
  12. package/src/component/color_picker/README.md +50 -0
  13. package/src/component/date_picker/README.md +144 -0
  14. package/src/component/date_range_picker/README.md +126 -0
  15. package/src/component/dialog/README.md +149 -0
  16. package/src/component/divider/README.md +41 -0
  17. package/src/component/drawer/README.md +83 -0
  18. package/src/component/drop_down/README.md +105 -0
  19. package/src/component/drop_select/README.md +146 -0
  20. package/src/component/dropper/README.md +55 -0
  21. package/src/component/editable_text/README.md +68 -0
  22. package/src/component/filter_select/README.md +104 -0
  23. package/src/component/flex/README.md +88 -0
  24. package/src/component/flip_number/README.md +53 -0
  25. package/src/component/form/README.md +199 -0
  26. package/src/component/function_set/README.md +93 -0
  27. package/src/component/grid/README.md +93 -0
  28. package/src/component/icon_down_up/README.md +43 -0
  29. package/src/component/image_preview/README.md +57 -0
  30. package/src/component/img_uploader/README.md +91 -0
  31. package/src/component/input/README.md +49 -0
  32. package/src/component/input_number/README.md +93 -0
  33. package/src/component/layout_root/README.md +181 -0
  34. package/src/component/lazy_img/README.md +59 -0
  35. package/src/component/level_list/README.md +75 -0
  36. package/src/component/level_select/README.md +78 -0
  37. package/src/component/list/README.md +96 -0
  38. package/src/component/loading/README.md +116 -0
  39. package/src/component/mask/README.md +62 -0
  40. package/src/component/modal/README.md +155 -0
  41. package/src/component/more_select/README.md +185 -0
  42. package/src/component/nav/README.md +101 -0
  43. package/src/component/nprogress/README.md +135 -0
  44. package/src/component/pagination/README.md +87 -0
  45. package/src/component/picture_preview/README.md +50 -0
  46. package/src/component/popover/README.md +146 -0
  47. package/src/component/popup/README.md +121 -0
  48. package/src/component/price/README.md +72 -0
  49. package/src/component/progress/README.md +98 -0
  50. package/src/component/progress_circle/README.md +92 -0
  51. package/src/component/radio/README.md +101 -0
  52. package/src/component/recommend_input/README.md +75 -0
  53. package/src/component/select/README.md +120 -0
  54. package/src/component/selection/README.md +87 -0
  55. package/src/component/sheet/README.md +176 -0
  56. package/src/component/steps/README.md +55 -0
  57. package/src/component/storage/README.md +83 -0
  58. package/src/component/switch/README.md +85 -0
  59. package/src/component/table_select/README.md +92 -0
  60. package/src/component/tabs/README.md +85 -0
  61. package/src/component/time_span/README.md +112 -0
  62. package/src/component/tip/README.md +105 -0
  63. package/src/component/tool_tip/README.md +84 -0
  64. package/src/component/transfer/README.md +98 -0
  65. package/src/component/transfer_v2/README.md +85 -0
  66. package/src/component/tree/README.md +99 -0
  67. package/src/component/tree/index.js +1 -1
  68. package/src/component/tree_v2/README.md +99 -0
  69. package/src/component/uploader/README.md +104 -0
  70. package/src/index.js +1 -3
  71. package/LICENSE +0 -16
  72. package/src/hoc/sticky_layout.js +0 -157
package/LICENSE DELETED
@@ -1,16 +0,0 @@
1
- ISC License
2
-
3
- Copyright (c) 2020-present, gmfe contributors
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted, provided that the above
7
- copyright notice and this permission notice appear in all copies.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
-
@@ -1,157 +0,0 @@
1
- /**
2
- * @author: stanfer
3
- * @description:
4
- * @createDate: 2025/11/24 10:05
5
- * @Version: 1.0
6
- * @last modify time:
7
- **/
8
- import React, { useRef, useEffect } from 'react'
9
-
10
- function stickyLayout(Component) {
11
- const StickyLayout = ({ sticky, ...rest }) => {
12
- if (!sticky) { // 不传的话直接返回上个组件
13
- return <Component {...rest} />
14
- }
15
-
16
- const currentStickyRef = useRef(null);
17
- const topSentinelRef = useRef(null);
18
- const bottomSentinelRef = useRef(null);
19
- // 统一管理
20
- const observerRef = useRef(null);
21
-
22
- useEffect(() => {
23
- if (!currentStickyRef.current) return;
24
-
25
- const options = {
26
- root: null, // 相对于浏览器视口
27
- rootMargin: '0px',
28
- threshold: 0, // 只要有一个像素进入/离开视口就触发
29
- };
30
-
31
- observerRef.current = new IntersectionObserver((entries) => {
32
- entries.forEach((entry) => {
33
- const target = entry.target;
34
-
35
- if (target === topSentinelRef.current) {
36
- if (entry.isIntersecting) {
37
- // console.log('=======> 顶部进入');
38
- let heightSum = 0, tableRoot;
39
- const fullTab = document.querySelectorAll('.gm-framework-full-tabs')
40
- const commonStickyHeader = document.querySelectorAll('.common-sticky-header')
41
- const rtTable = document.querySelectorAll('.rt-table')
42
- const rtTheadHeader = document.querySelectorAll('.rt-thead')
43
- rtTheadHeader.forEach((el) => {
44
- el.style.position = 'sticky';
45
- el.style.top = 0;
46
- el.style.zIndex = 10;
47
- heightSum += el.offsetHeight + 10; // 元素本身高 + 上下 10 padding
48
- })
49
-
50
- commonStickyHeader.forEach((item, idx) => {
51
- if (fullTab.length) {
52
- currentStickyRef.current.style.zIndex = 101;
53
- }
54
- // console.log(item.className);
55
- if (item.className.includes('gm-box-table-header')) { // 表格筛选项
56
- heightSum += item.offsetHeight + 10; // 元素本身高 + 上 10 padding
57
- // console.log(idx, item.getBoundingClientRect(), 'gm-box-table-header: ', item.getBoundingClientRect().height + 20);
58
- }
59
- if (item.className.includes('gm-table-x-thead')) { //
60
- heightSum += item.offsetHeight + 8; // 元素本身高 + 上 8 padding
61
- tableRoot = item.parentElement.parentElement;
62
- // console.log(idx, item.getBoundingClientRect(), 'gm-table-x-thead: ', item.getBoundingClientRect().height + 16);
63
- }
64
- })
65
-
66
- if (rtTable.length) {
67
- rtTable.forEach((el) => {
68
- if (fullTab.length) {
69
- el.style.maxHeight = `calc(100vh - ${heightSum + (fullTab.length * 40) + 50}px)`; // +50 顶部导航栏
70
- return;
71
- }
72
- el.style.maxHeight = `calc(100vh - ${heightSum + 50}px)`; // +50 顶部导航栏
73
- })
74
- }
75
- if (tableRoot) {
76
- if (fullTab.length) {
77
- tableRoot.style.maxHeight = `calc(100vh - ${heightSum + (fullTab.length * 40) + 50}px)`; // +50 顶部导航栏
78
- return;
79
- }
80
- tableRoot.style.maxHeight = `calc(100vh - ${heightSum + 50}px)`; // +50 顶部导航栏
81
- }
82
- // currentStickyRef.current.style.maxHeight = 'unset';
83
- // console.log('currentStickyRef 实例:', currentStickyRef.current.style);
84
- return
85
- }
86
- currentStickyRef.current.style.maxHeight = '50%';
87
- // console.log('顶部离开 <========');
88
- return;
89
- }
90
- if (target === bottomSentinelRef.current) {
91
- if (entry.isIntersecting) {
92
- // console.log('=======> 底部进入');
93
- return;
94
- }
95
- // console.log('底部离开 <========');
96
- }
97
- });
98
- }, options);
99
-
100
- if (topSentinelRef.current) {
101
- observerRef.current.observe(topSentinelRef.current);
102
- }
103
- if (bottomSentinelRef.current) {
104
- observerRef.current.observe(bottomSentinelRef.current);
105
- }
106
-
107
- return () => {
108
- if (observerRef.current) {
109
- observerRef.current.disconnect();
110
- }
111
- };
112
- }, [])
113
-
114
- return (
115
- <div ref={currentStickyRef} className='common-sticky-layout'>
116
- <div
117
- ref={topSentinelRef}
118
- sentinel="topSentinel"
119
- style={{
120
- position: 'absolute',
121
- top: '0',
122
- left: '0',
123
- width: '100%',
124
- height: '1px',
125
- pointerEvents: 'none',
126
- backgroundColor: 'transparent',
127
- }}
128
- />
129
- <Component {...rest} />
130
- <div
131
- ref={bottomSentinelRef}
132
- sentinel="bottomSentinel"
133
- style={{
134
- position: 'absolute',
135
- bottom: '0',
136
- left: '0',
137
- width: '100%',
138
- height: '1px',
139
- pointerEvents: 'none',
140
- backgroundColor: 'transparent',
141
- }}
142
- />
143
- </div>
144
- )
145
- }
146
-
147
- StickyLayout.defaultProps = {
148
- // sticky: {
149
- // offsetHeight: 0,
150
- // },
151
- sticky: false
152
- }
153
-
154
- return StickyLayout
155
- }
156
-
157
- export default stickyLayout