feffery_utils_components 0.0.22 → 0.0.24
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.
- package/DESCRIPTION +1 -1
- package/NAMESPACE +3 -0
- package/Project.toml +1 -1
- package/build/lib/feffery_utils_components/FefferyCountDown.py +50 -0
- package/build/lib/feffery_utils_components/FefferyDiv.py +1 -1
- package/build/lib/feffery_utils_components/_imports_.py +2 -0
- package/build/lib/feffery_utils_components/feffery_utils_components.min.js +1 -1
- package/build/lib/feffery_utils_components/metadata.json +79 -1
- package/build/lib/feffery_utils_components/package-info.json +2 -1
- package/feffery_utils_components/FefferyDiv.py +1 -1
- package/feffery_utils_components/FefferyExternalJs.py +48 -0
- package/feffery_utils_components/FefferySortableContainer.py +54 -0
- package/feffery_utils_components/FefferySortableItem.py +50 -0
- package/feffery_utils_components/_imports_.py +6 -0
- package/feffery_utils_components/feffery_utils_components.min.js +3 -3
- package/feffery_utils_components/metadata.json +255 -1
- package/feffery_utils_components/package-info.json +4 -1
- package/package.json +4 -1
- package/src/FefferyUtilsComponents.jl +6 -3
- package/src/jl/''_fefferydiv.jl +1 -1
- package/src/jl/''_fefferyexternaljs.jl +25 -0
- package/src/jl/''_fefferysortablecontainer.jl +34 -0
- package/src/jl/''_fefferysortableitem.jl +32 -0
- package/src/lib/components/dom/FefferyExternalJs.react.js +75 -0
- package/src/lib/components/listeners/FefferyDiv.react.js +11 -2
- package/src/lib/components/sortable/FefferySortableContainer.react.js +100 -0
- package/src/lib/components/sortable/FefferySortableItem.react.js +61 -0
- package/src/lib/components/styles.css +4 -0
- package/src/lib/index.js +7 -1
- package/tests/FefferyDivHoverTest/app.py +5 -1
- package/tests/SortableTest/app.py +46 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
|
|
4
|
+
// 定义排序项组件FefferySortableItem
|
|
5
|
+
const FefferySortableItem = (props) => {
|
|
6
|
+
const {
|
|
7
|
+
id,
|
|
8
|
+
children,
|
|
9
|
+
style,
|
|
10
|
+
className,
|
|
11
|
+
setProps,
|
|
12
|
+
loading_state
|
|
13
|
+
} = props;
|
|
14
|
+
|
|
15
|
+
return (<div
|
|
16
|
+
id={id}
|
|
17
|
+
style={style}
|
|
18
|
+
className={className}
|
|
19
|
+
data-dash-is-loading={
|
|
20
|
+
(loading_state && loading_state.is_loading) || undefined
|
|
21
|
+
} >{children}</div>);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// 定义参数或属性
|
|
25
|
+
FefferySortableItem.propTypes = {
|
|
26
|
+
|
|
27
|
+
children: PropTypes.node,
|
|
28
|
+
|
|
29
|
+
id: PropTypes.string,
|
|
30
|
+
|
|
31
|
+
style: PropTypes.object,
|
|
32
|
+
|
|
33
|
+
className: PropTypes.string,
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Dash-assigned callback that should be called to report property changes
|
|
37
|
+
* to Dash, to make them available for callbacks.
|
|
38
|
+
*/
|
|
39
|
+
setProps: PropTypes.func,
|
|
40
|
+
|
|
41
|
+
loading_state: PropTypes.shape({
|
|
42
|
+
/**
|
|
43
|
+
* Determines if the component is loading or not
|
|
44
|
+
*/
|
|
45
|
+
is_loading: PropTypes.bool,
|
|
46
|
+
/**
|
|
47
|
+
* Holds which property is loading
|
|
48
|
+
*/
|
|
49
|
+
prop_name: PropTypes.string,
|
|
50
|
+
/**
|
|
51
|
+
* Holds the name of the component that is loading
|
|
52
|
+
*/
|
|
53
|
+
component_name: PropTypes.string
|
|
54
|
+
})
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// 设置默认参数
|
|
58
|
+
FefferySortableItem.defaultProps = {
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export default React.memo(FefferySortableItem);
|
package/src/lib/index.js
CHANGED
|
@@ -25,6 +25,7 @@ import FefferyWheelColorPicker from "./components/colorPickers/FefferyWheelColor
|
|
|
25
25
|
import FefferyHighlightWords from "./components/FefferyHighlightWords.react";
|
|
26
26
|
import FefferyDocumentVisibility from "./components/listeners/FefferyDocumentVisibility.react";
|
|
27
27
|
import FefferyExternalCss from "./components/dom/FefferyExternalCss.react";
|
|
28
|
+
import FefferyExternalJs from "./components/dom/FefferyExternalJs.react";
|
|
28
29
|
import FefferySetTitle from "./components/dom/FefferySetTitle.react";
|
|
29
30
|
import FefferyResponsive from "./components/listeners/FefferyResponsive.react";
|
|
30
31
|
import FefferyGeolocation from "./components/listeners/FefferyGeolocation.react";
|
|
@@ -33,6 +34,8 @@ import FefferyWindowSize from "./components/listeners/FefferyWindowSize.react";
|
|
|
33
34
|
import FefferyKeyPress from "./components/listeners/FefferyKeyPress.react";
|
|
34
35
|
import FefferyTimeout from "./components/FefferyTimeout.react";
|
|
35
36
|
import FefferyCountDown from "./components/FefferyCountDown.react";
|
|
37
|
+
import FefferySortableItem from "./components/sortable/FefferySortableItem.react";
|
|
38
|
+
import FefferySortableContainer from "./components/sortable/FefferySortableContainer.react";
|
|
36
39
|
|
|
37
40
|
/*
|
|
38
41
|
忽略部分设计React中规范的console警告信息
|
|
@@ -83,6 +86,7 @@ export {
|
|
|
83
86
|
FefferyHighlightWords,
|
|
84
87
|
FefferyDocumentVisibility,
|
|
85
88
|
FefferyExternalCss,
|
|
89
|
+
FefferyExternalJs,
|
|
86
90
|
FefferySetTitle,
|
|
87
91
|
FefferyResponsive,
|
|
88
92
|
FefferyGeolocation,
|
|
@@ -90,5 +94,7 @@ export {
|
|
|
90
94
|
FefferyWindowSize,
|
|
91
95
|
FefferyKeyPress,
|
|
92
96
|
FefferyTimeout,
|
|
93
|
-
FefferyCountDown
|
|
97
|
+
FefferyCountDown,
|
|
98
|
+
FefferySortableItem,
|
|
99
|
+
FefferySortableContainer
|
|
94
100
|
};
|
|
@@ -14,10 +14,14 @@ app.layout = html.Div(
|
|
|
14
14
|
[
|
|
15
15
|
fuc.FefferyDiv(
|
|
16
16
|
id='div-demo',
|
|
17
|
+
className={
|
|
18
|
+
'&:hover': {
|
|
19
|
+
'background': 'lightgrey',
|
|
20
|
+
}
|
|
21
|
+
},
|
|
17
22
|
style={
|
|
18
23
|
'width': '200px',
|
|
19
24
|
'height': '100px',
|
|
20
|
-
'background': 'lightgrey',
|
|
21
25
|
'border': '1ox dashed black'
|
|
22
26
|
}
|
|
23
27
|
)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
if True:
|
|
2
|
+
import sys
|
|
3
|
+
sys.path.append('../..')
|
|
4
|
+
import dash
|
|
5
|
+
import json
|
|
6
|
+
from dash import html
|
|
7
|
+
import feffery_utils_components as fuc
|
|
8
|
+
from dash.dependencies import Input, Output
|
|
9
|
+
|
|
10
|
+
app = dash.Dash(__name__)
|
|
11
|
+
|
|
12
|
+
app.layout = html.Div(
|
|
13
|
+
[
|
|
14
|
+
fuc.FefferySortableContainer(
|
|
15
|
+
[
|
|
16
|
+
fuc.FefferySortableItem(
|
|
17
|
+
html.Div(
|
|
18
|
+
f'记录{i}',
|
|
19
|
+
style={
|
|
20
|
+
'height': '60px',
|
|
21
|
+
'borderBottom': '1px solid #efefef',
|
|
22
|
+
'display': 'flex',
|
|
23
|
+
'alignItems': 'center',
|
|
24
|
+
'paddingLeft': '25px',
|
|
25
|
+
'background': 'white'
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
)
|
|
29
|
+
for i in range(10)
|
|
30
|
+
],
|
|
31
|
+
style={
|
|
32
|
+
'border': '1px solid #efefef'
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
],
|
|
36
|
+
style={
|
|
37
|
+
'paddingTop': '50px',
|
|
38
|
+
'paddingBottom': '50px',
|
|
39
|
+
'width': '600px',
|
|
40
|
+
'margin': '0 auto'
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
if __name__ == '__main__':
|
|
46
|
+
app.run(debug=True)
|