feffery_utils_components 0.0.9 → 0.0.10
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 +2 -5
- package/Project.toml +1 -1
- package/feffery_utils_components/FefferyCircleColorPicker.py +45 -0
- package/{build/lib/feffery_utils_components/FefferyDashboard.py → feffery_utils_components/FefferyColorPicker.py} +9 -11
- package/feffery_utils_components/FefferyScroll.py +55 -0
- package/feffery_utils_components/_imports_.py +4 -4
- package/feffery_utils_components/feffery_utils_components.min.js +26 -26
- package/feffery_utils_components/metadata.json +148 -174
- package/feffery_utils_components/package-info.json +3 -2
- package/package.json +3 -2
- package/src/FefferyUtilsComponents.jl +5 -5
- package/src/jl/''_fefferycirclecolorpicker.jl +26 -0
- package/src/jl/''_fefferycolorpicker.jl +22 -0
- package/src/jl/''_fefferyscroll.jl +31 -0
- package/src/lib/components/FefferyCaptcha.react.js +6 -2
- package/src/lib/components/FefferyGuide.react.js +11 -4
- package/src/lib/components/FefferyScroll.react.js +170 -0
- package/src/lib/components/FefferyShortcutPanel.react.js +5 -1
- package/src/lib/components/FefferySyntaxHighlighter.react.js +6 -2
- package/src/lib/components/FefferyTopProgress.react.js +3 -3
- package/src/lib/components/colorPickers/FefferyCircleColorPicker.react.js +88 -0
- package/src/lib/components/nprogress.css +84 -0
- package/src/lib/components/styles.css +0 -4
- package/src/lib/index.js +5 -5
- package/usage.py +40 -32
- package/build/lib/feffery_utils_components/FefferyCaptcha.py +0 -51
- package/build/lib/feffery_utils_components/FefferyGuide.py +0 -69
- package/build/lib/feffery_utils_components/FefferyPasteImage.py +0 -56
- package/build/lib/feffery_utils_components/FefferyResizable.py +0 -39
- package/build/lib/feffery_utils_components/FefferyShortcutPanel.py +0 -51
- package/build/lib/feffery_utils_components/FefferySplit.py +0 -59
- package/build/lib/feffery_utils_components/FefferySplitPane.py +0 -48
- package/build/lib/feffery_utils_components/FefferySyntaxHighlighter.py +0 -52
- package/build/lib/feffery_utils_components/FefferyTopProgress.py +0 -68
- package/build/lib/feffery_utils_components/FefferyUtilsComponents.py +0 -40
- package/build/lib/feffery_utils_components/FefferyWaterMark.py +0 -64
- package/build/lib/feffery_utils_components/__init__.py +0 -89
- package/build/lib/feffery_utils_components/_imports_.py +0 -21
- package/build/lib/feffery_utils_components/feffery_utils_components.min.js +0 -407
- package/build/lib/feffery_utils_components/metadata.json +0 -1053
- package/build/lib/feffery_utils_components/package-info.json +0 -84
- package/src/lib/components/FefferyPasteImage.react.js +0 -168
- package/src/lib/components/FefferyWaterMark.react.js +0 -112
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { animateScroll as scroll, scroller } from 'react-scroll'
|
|
3
|
+
|
|
4
|
+
// 定义滚动操作组件FefferyScroll,api参数参考https://github.com/fisshy/react-scroll
|
|
5
|
+
const FefferyScroll = (props) => {
|
|
6
|
+
// 取得必要属性或参数
|
|
7
|
+
let {
|
|
8
|
+
id,
|
|
9
|
+
scrollMode,
|
|
10
|
+
executeScroll,
|
|
11
|
+
scrollTopOffset,
|
|
12
|
+
scrollRelativeOffset,
|
|
13
|
+
scrollTargetId,
|
|
14
|
+
duration,
|
|
15
|
+
smooth,
|
|
16
|
+
delay,
|
|
17
|
+
containerId,
|
|
18
|
+
offset,
|
|
19
|
+
setProps,
|
|
20
|
+
loading_state
|
|
21
|
+
} = props;
|
|
22
|
+
|
|
23
|
+
if (executeScroll && scrollMode) {
|
|
24
|
+
if (scrollMode === 'to-top') {
|
|
25
|
+
scroll.scrollToTop({
|
|
26
|
+
duration,
|
|
27
|
+
smooth,
|
|
28
|
+
delay,
|
|
29
|
+
containerId,
|
|
30
|
+
offset
|
|
31
|
+
})
|
|
32
|
+
} else if (scrollMode === 'to-bottom') {
|
|
33
|
+
scroll.scrollToBottom({
|
|
34
|
+
duration,
|
|
35
|
+
smooth,
|
|
36
|
+
delay,
|
|
37
|
+
containerId,
|
|
38
|
+
offset
|
|
39
|
+
})
|
|
40
|
+
} else if (scrollMode === 'top-offset') {
|
|
41
|
+
scroll.scrollTo(
|
|
42
|
+
scrollTopOffset,
|
|
43
|
+
{
|
|
44
|
+
duration,
|
|
45
|
+
smooth,
|
|
46
|
+
delay,
|
|
47
|
+
containerId,
|
|
48
|
+
offset
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
} else if (scrollMode === 'relative-offset') {
|
|
52
|
+
scroll.scrollMore(
|
|
53
|
+
scrollRelativeOffset,
|
|
54
|
+
{
|
|
55
|
+
duration,
|
|
56
|
+
smooth,
|
|
57
|
+
delay,
|
|
58
|
+
containerId,
|
|
59
|
+
offset
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
} else {
|
|
63
|
+
scroller.scrollTo(
|
|
64
|
+
scrollTargetId,
|
|
65
|
+
{
|
|
66
|
+
duration,
|
|
67
|
+
smooth,
|
|
68
|
+
delay,
|
|
69
|
+
containerId,
|
|
70
|
+
offset
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// 重置executeScroll为false
|
|
76
|
+
setProps({
|
|
77
|
+
executeScroll: false
|
|
78
|
+
})
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<div id={id}
|
|
83
|
+
data-dash-is-loading={
|
|
84
|
+
(loading_state && loading_state.is_loading) || undefined
|
|
85
|
+
} />
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// 定义参数或属性
|
|
90
|
+
FefferyScroll.propTypes = {
|
|
91
|
+
// 部件id
|
|
92
|
+
id: PropTypes.string,
|
|
93
|
+
|
|
94
|
+
// 设置页面滚动模式,可选的有'top'、'bottom'、'top-offset'、'relative-offset'、'target'
|
|
95
|
+
scrollMode: PropTypes.oneOf([
|
|
96
|
+
'to-top', 'to-bottom', 'top-offset', 'relative-offset', 'target'
|
|
97
|
+
]),
|
|
98
|
+
|
|
99
|
+
// 用于指示是否进行滚动操作,默认为false
|
|
100
|
+
// 在回调中可executeScroll参数Output为true从而触发新一次滚动
|
|
101
|
+
// 每次由executeScroll=true触发的滚动完成后,executeScroll会自动恢复为false
|
|
102
|
+
executeScroll: PropTypes.bool,
|
|
103
|
+
|
|
104
|
+
// 当scrollMode='top-offset'时,用于设置滚动终点距离页面顶端的像素
|
|
105
|
+
scrollTopOffset: PropTypes.number,
|
|
106
|
+
|
|
107
|
+
// 当scrollMode='relative-offset'时,用于设置相对滚动的像素距离,负数则为向上滚动
|
|
108
|
+
scrollRelativeOffset: PropTypes.number,
|
|
109
|
+
|
|
110
|
+
// 当scrollMode='target'时,用于设置滚动目标元素的id信息
|
|
111
|
+
scrollTargetId: PropTypes.string,
|
|
112
|
+
|
|
113
|
+
// 用于设置滚动过程耗时(单位:毫秒)
|
|
114
|
+
duration: PropTypes.number,
|
|
115
|
+
|
|
116
|
+
// 用于设置滚动过程动画模式
|
|
117
|
+
smooth: PropTypes.oneOf([
|
|
118
|
+
'linear',
|
|
119
|
+
'easeInQuad',
|
|
120
|
+
'easeOutQuad',
|
|
121
|
+
'easeInOutQuad',
|
|
122
|
+
'easeInCubic',
|
|
123
|
+
'easeOutCubic',
|
|
124
|
+
'easeInOutCubic',
|
|
125
|
+
'easeInQuart',
|
|
126
|
+
'easeOutQuart',
|
|
127
|
+
'easeInOutQuart',
|
|
128
|
+
'easeInQuint',
|
|
129
|
+
'easeOutQuint',
|
|
130
|
+
'easeInOutQuint'
|
|
131
|
+
]),
|
|
132
|
+
|
|
133
|
+
// 用于设置滚动延时(单位:毫秒)
|
|
134
|
+
delay: PropTypes.number,
|
|
135
|
+
|
|
136
|
+
// 当滚动目标位于局部滚动条内时,用于设置局部滚动条所在的容器id信息
|
|
137
|
+
containerId: PropTypes.string,
|
|
138
|
+
|
|
139
|
+
// 设置滚动过程的额外偏移像素距离
|
|
140
|
+
offset: PropTypes.number,
|
|
141
|
+
|
|
142
|
+
loading_state: PropTypes.shape({
|
|
143
|
+
/**
|
|
144
|
+
* Determines if the component is loading or not
|
|
145
|
+
*/
|
|
146
|
+
is_loading: PropTypes.bool,
|
|
147
|
+
/**
|
|
148
|
+
* Holds which property is loading
|
|
149
|
+
*/
|
|
150
|
+
prop_name: PropTypes.string,
|
|
151
|
+
/**
|
|
152
|
+
* Holds the name of the component that is loading
|
|
153
|
+
*/
|
|
154
|
+
component_name: PropTypes.string
|
|
155
|
+
}),
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Dash-assigned callback that should be called to report property changes
|
|
159
|
+
* to Dash, to make them available for callbacks.
|
|
160
|
+
*/
|
|
161
|
+
setProps: PropTypes.func
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
// 设置默认参数
|
|
165
|
+
FefferyScroll.defaultProps = {
|
|
166
|
+
executeScroll: false,
|
|
167
|
+
scrollMode: 'to-top'
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export default FefferyScroll;
|
|
@@ -89,6 +89,7 @@ const FefferyShortcutPanel = (props) => {
|
|
|
89
89
|
theme,
|
|
90
90
|
locale,
|
|
91
91
|
setProps,
|
|
92
|
+
loading_state
|
|
92
93
|
} = props;
|
|
93
94
|
|
|
94
95
|
data = data || [
|
|
@@ -180,7 +181,10 @@ const FefferyShortcutPanel = (props) => {
|
|
|
180
181
|
disableHotkeys={disableHotkeys}
|
|
181
182
|
openHotkey={openHotkey}
|
|
182
183
|
hotKeysJoinedView={true}
|
|
183
|
-
hideBreadcrumbs={true}
|
|
184
|
+
hideBreadcrumbs={true}
|
|
185
|
+
data-dash-is-loading={
|
|
186
|
+
(loading_state && loading_state.is_loading) || undefined
|
|
187
|
+
} >
|
|
184
188
|
{locale === 'en' ? footerHtmlEn : footerHtmlZh}
|
|
185
189
|
</ ninja-keys>
|
|
186
190
|
);
|
|
@@ -16,7 +16,8 @@ import {
|
|
|
16
16
|
okaidia,
|
|
17
17
|
prism,
|
|
18
18
|
solarizedlight,
|
|
19
|
-
twilight
|
|
19
|
+
twilight,
|
|
20
|
+
loading_state
|
|
20
21
|
} from 'react-syntax-highlighter/dist/esm/styles/prism';
|
|
21
22
|
|
|
22
23
|
import './styles.css'
|
|
@@ -53,7 +54,10 @@ const FefferySyntaxHighlighter = (props) => {
|
|
|
53
54
|
const [isCopied, setIsCopied] = useState(false);
|
|
54
55
|
|
|
55
56
|
return (
|
|
56
|
-
<div style={{ position: 'relative' }}
|
|
57
|
+
<div style={{ position: 'relative' }}
|
|
58
|
+
data-dash-is-loading={
|
|
59
|
+
(loading_state && loading_state.is_loading) || undefined
|
|
60
|
+
}>
|
|
57
61
|
<CopyToClipboard
|
|
58
62
|
onCopy={() => {
|
|
59
63
|
setIsCopied(true);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import NProgress from 'nprogress';
|
|
4
|
-
import 'nprogress
|
|
4
|
+
import './nprogress.css';
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
const parseChildrenToArray = children => {
|
|
@@ -24,12 +24,12 @@ const FefferyTopProgress = (props) => {
|
|
|
24
24
|
speed,
|
|
25
25
|
showSpinner,
|
|
26
26
|
spinning,
|
|
27
|
-
loading_state,
|
|
28
27
|
listenPropsMode,
|
|
29
28
|
excludeProps,
|
|
30
29
|
includeProps,
|
|
31
30
|
debug,
|
|
32
|
-
setProps
|
|
31
|
+
setProps,
|
|
32
|
+
loading_state
|
|
33
33
|
} = props;
|
|
34
34
|
|
|
35
35
|
// 配置NProgress参数信息
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import { CirclePicker } from 'react-color';
|
|
3
|
+
|
|
4
|
+
// 定义circle型取色器FefferyCircleColorPicker
|
|
5
|
+
export default class FefferyCircleColorPicker extends Component {
|
|
6
|
+
render() {
|
|
7
|
+
// 取得必要属性或参数
|
|
8
|
+
const {
|
|
9
|
+
id,
|
|
10
|
+
className,
|
|
11
|
+
style,
|
|
12
|
+
width,
|
|
13
|
+
colors,
|
|
14
|
+
circleSize,
|
|
15
|
+
circleSpacing,
|
|
16
|
+
color,
|
|
17
|
+
setProps,
|
|
18
|
+
loading_state
|
|
19
|
+
} = this.props;
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<CirclePicker id={id}
|
|
23
|
+
className={className}
|
|
24
|
+
style={style}
|
|
25
|
+
color={color}
|
|
26
|
+
width={width}
|
|
27
|
+
colors={colors}
|
|
28
|
+
circleSize={circleSize}
|
|
29
|
+
circleSpacing={circleSpacing}
|
|
30
|
+
onChangeComplete={(c, event) => {
|
|
31
|
+
setProps({
|
|
32
|
+
color: c.hex
|
|
33
|
+
})
|
|
34
|
+
}}
|
|
35
|
+
data-dash-is-loading={
|
|
36
|
+
(loading_state && loading_state.is_loading) || undefined
|
|
37
|
+
} />
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
// 定义参数或属性
|
|
44
|
+
FefferyCircleColorPicker.propTypes = {
|
|
45
|
+
// 部件id
|
|
46
|
+
id: PropTypes.string,
|
|
47
|
+
|
|
48
|
+
// css类名
|
|
49
|
+
className: PropTypes.string,
|
|
50
|
+
|
|
51
|
+
// 自定义css字典
|
|
52
|
+
style: PropTypes.object,
|
|
53
|
+
|
|
54
|
+
// 设置取色盘的宽度,默认为'252px'
|
|
55
|
+
width: PropTypes.string,
|
|
56
|
+
|
|
57
|
+
// 设置取色盘中供选择的色彩数组
|
|
58
|
+
// 默认值为["#f44336", "#e91e63", "#9c27b0", "#673ab7", "#3f51b5", "#2196f3", "#03a9f4", "#00bcd4", "#009688", "#4caf50", "#8bc34a", "#cddc39", "#ffeb3b", "#ffc107", "#ff9800", "#ff5722", "#795548", "#607d8b"]
|
|
59
|
+
colors: PropTypes.arrayOf(PropTypes.string),
|
|
60
|
+
|
|
61
|
+
// 设取色盘中的圆形像素尺寸,默认为28
|
|
62
|
+
circleSize: PropTypes.number,
|
|
63
|
+
|
|
64
|
+
// 设置取色盘中圆形之间的间隔像素大小,默认为14
|
|
65
|
+
circleSpacing: PropTypes.number,
|
|
66
|
+
|
|
67
|
+
// 对应当前选中的颜色
|
|
68
|
+
color: PropTypes.string,
|
|
69
|
+
|
|
70
|
+
loading_state: PropTypes.shape({
|
|
71
|
+
/**
|
|
72
|
+
* Determines if the component is loading or not
|
|
73
|
+
*/
|
|
74
|
+
is_loading: PropTypes.bool,
|
|
75
|
+
/**
|
|
76
|
+
* Holds which property is loading
|
|
77
|
+
*/
|
|
78
|
+
prop_name: PropTypes.string,
|
|
79
|
+
/**
|
|
80
|
+
* Holds the name of the component that is loading
|
|
81
|
+
*/
|
|
82
|
+
component_name: PropTypes.string
|
|
83
|
+
})
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
// 设置默认参数
|
|
87
|
+
FefferyCircleColorPicker.defaultProps = {
|
|
88
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/* Make clicks pass-through */
|
|
2
|
+
#nprogress {
|
|
3
|
+
pointer-events: none;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
#nprogress .bar {
|
|
7
|
+
background: #29d;
|
|
8
|
+
|
|
9
|
+
position: fixed;
|
|
10
|
+
z-index: 99999;
|
|
11
|
+
top: 0;
|
|
12
|
+
left: 0;
|
|
13
|
+
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 2px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Fancy blur effect */
|
|
19
|
+
#nprogress .peg {
|
|
20
|
+
display: block;
|
|
21
|
+
position: absolute;
|
|
22
|
+
right: 0px;
|
|
23
|
+
width: 100px;
|
|
24
|
+
height: 100%;
|
|
25
|
+
box-shadow: 0 0 10px #29d, 0 0 5px #29d;
|
|
26
|
+
opacity: 1.0;
|
|
27
|
+
|
|
28
|
+
-webkit-transform: rotate(3deg) translate(0px, -4px);
|
|
29
|
+
-ms-transform: rotate(3deg) translate(0px, -4px);
|
|
30
|
+
transform: rotate(3deg) translate(0px, -4px);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* Remove these to get rid of the spinner */
|
|
34
|
+
#nprogress .spinner {
|
|
35
|
+
display: block;
|
|
36
|
+
position: fixed;
|
|
37
|
+
z-index: 99999;
|
|
38
|
+
top: 15px;
|
|
39
|
+
right: 15px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#nprogress .spinner-icon {
|
|
43
|
+
width: 18px;
|
|
44
|
+
height: 18px;
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
|
|
47
|
+
border: solid 2px transparent;
|
|
48
|
+
border-top-color: #29d;
|
|
49
|
+
border-left-color: #29d;
|
|
50
|
+
border-radius: 50%;
|
|
51
|
+
|
|
52
|
+
-webkit-animation: nprogress-spinner 400ms linear infinite;
|
|
53
|
+
animation: nprogress-spinner 400ms linear infinite;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.nprogress-custom-parent {
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
position: relative;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.nprogress-custom-parent #nprogress .spinner,
|
|
62
|
+
.nprogress-custom-parent #nprogress .bar {
|
|
63
|
+
position: absolute;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@-webkit-keyframes nprogress-spinner {
|
|
67
|
+
0% {
|
|
68
|
+
-webkit-transform: rotate(0deg);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
100% {
|
|
72
|
+
-webkit-transform: rotate(360deg);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@keyframes nprogress-spinner {
|
|
77
|
+
0% {
|
|
78
|
+
transform: rotate(0deg);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
100% {
|
|
82
|
+
transform: rotate(360deg);
|
|
83
|
+
}
|
|
84
|
+
}
|
package/src/lib/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
/* eslint-disable import/prefer-default-export */
|
|
2
2
|
import FefferyCaptcha from "./components/FefferyCaptcha.react";
|
|
3
|
-
import FefferyWaterMark from "./components/FefferyWaterMark.react";
|
|
4
3
|
import FefferySyntaxHighlighter from "./components/FefferySyntaxHighlighter.react";
|
|
5
|
-
import FefferyPasteImage from "./components/FefferyPasteImage.react";
|
|
6
4
|
import FefferyTopProgress from "./components/FefferyTopProgress.react"
|
|
7
5
|
import FefferyShortcutPanel from "./components/FefferyShortcutPanel.react"
|
|
8
6
|
import FefferyGuide from "./components/FefferyGuide.react"
|
|
9
7
|
import FefferySplit from "./components/split/FefferySplit.react";
|
|
10
8
|
import FefferySplitPane from "./components/split/FefferySplitPane.react"
|
|
11
9
|
import FefferyExecuteJs from "./components/FefferyExecuteJs.react";
|
|
10
|
+
import FefferyCircleColorPicker from "./components/colorPickers/FefferyCircleColorPicker.react";
|
|
11
|
+
import FefferyScroll from "./components/FefferyScroll.react";
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
export {
|
|
15
15
|
FefferyCaptcha,
|
|
16
|
-
FefferyWaterMark,
|
|
17
16
|
FefferySyntaxHighlighter,
|
|
18
|
-
FefferyPasteImage,
|
|
19
17
|
FefferyTopProgress,
|
|
20
18
|
FefferyShortcutPanel,
|
|
21
19
|
FefferyGuide,
|
|
22
20
|
FefferySplit,
|
|
23
21
|
FefferySplitPane,
|
|
24
|
-
FefferyExecuteJs
|
|
22
|
+
FefferyExecuteJs,
|
|
23
|
+
FefferyCircleColorPicker,
|
|
24
|
+
FefferyScroll
|
|
25
25
|
};
|
package/usage.py
CHANGED
|
@@ -11,6 +11,33 @@ app.layout = html.Div(
|
|
|
11
11
|
fuc.FefferyTopProgress(
|
|
12
12
|
[
|
|
13
13
|
|
|
14
|
+
html.Div(
|
|
15
|
+
style={
|
|
16
|
+
'height': '2000px'
|
|
17
|
+
}
|
|
18
|
+
),
|
|
19
|
+
|
|
20
|
+
html.Div(
|
|
21
|
+
html.Button(
|
|
22
|
+
'scroll!',
|
|
23
|
+
id='scroll-trigger'
|
|
24
|
+
)
|
|
25
|
+
),
|
|
26
|
+
|
|
27
|
+
# 绑定滚动器
|
|
28
|
+
fuc.FefferyScroll(
|
|
29
|
+
id='scroll',
|
|
30
|
+
duration=3000,
|
|
31
|
+
smooth='easeInOutQuad',
|
|
32
|
+
scrollMode='target',
|
|
33
|
+
scrollTargetId='step3',
|
|
34
|
+
offset=-300
|
|
35
|
+
),
|
|
36
|
+
|
|
37
|
+
fuc.FefferyCircleColorPicker(
|
|
38
|
+
color='red'
|
|
39
|
+
),
|
|
40
|
+
|
|
14
41
|
fuc.FefferyExecuteJs(),
|
|
15
42
|
|
|
16
43
|
fuc.FefferySplit(
|
|
@@ -91,7 +118,7 @@ app.layout = html.Div(
|
|
|
91
118
|
# hotspot=True,
|
|
92
119
|
showPreviousBtn=True,
|
|
93
120
|
closable=True,
|
|
94
|
-
|
|
121
|
+
step=-1
|
|
95
122
|
),
|
|
96
123
|
|
|
97
124
|
html.H2('节点1', id='step1', style={'marginBottom': '200px'}),
|
|
@@ -140,16 +167,6 @@ app.layout = html.Div(
|
|
|
140
167
|
]
|
|
141
168
|
),
|
|
142
169
|
|
|
143
|
-
fuc.FefferyPasteImage(
|
|
144
|
-
id='test',
|
|
145
|
-
style={
|
|
146
|
-
'height': '500px',
|
|
147
|
-
'width': '800px',
|
|
148
|
-
'marginBottom': '100px'
|
|
149
|
-
}
|
|
150
|
-
),
|
|
151
|
-
html.Div(id='test-output'),
|
|
152
|
-
|
|
153
170
|
fuc.FefferyCaptcha(id='captcha-demo',
|
|
154
171
|
charNum=10,
|
|
155
172
|
width=300,
|
|
@@ -159,11 +176,6 @@ app.layout = html.Div(
|
|
|
159
176
|
html.Em(id='output-demo')
|
|
160
177
|
),
|
|
161
178
|
|
|
162
|
-
fuc.FefferyWaterMark(
|
|
163
|
-
content='fuc FefferyWaterMark',
|
|
164
|
-
fontSize=26
|
|
165
|
-
),
|
|
166
|
-
|
|
167
179
|
fuc.FefferySyntaxHighlighter(
|
|
168
180
|
id='syntax-highlighter-demo',
|
|
169
181
|
showLineNumbers=True,
|
|
@@ -222,22 +234,6 @@ def test(captcha):
|
|
|
222
234
|
|
|
223
235
|
return captcha
|
|
224
236
|
|
|
225
|
-
|
|
226
|
-
@app.callback(
|
|
227
|
-
Output('test-output', 'children'),
|
|
228
|
-
Input('test', 'currentPastedImages')
|
|
229
|
-
)
|
|
230
|
-
def test_(currentPastedImages):
|
|
231
|
-
|
|
232
|
-
if currentPastedImages:
|
|
233
|
-
return [
|
|
234
|
-
html.Img(
|
|
235
|
-
src=currentPastedImage
|
|
236
|
-
)
|
|
237
|
-
for currentPastedImage in currentPastedImages
|
|
238
|
-
]
|
|
239
|
-
|
|
240
|
-
|
|
241
237
|
@app.callback(
|
|
242
238
|
Output('shortcut-panel-demo', 'theme'),
|
|
243
239
|
Input('shortcut-panel-demo', 'triggeredHotkey'),
|
|
@@ -249,5 +245,17 @@ def shotycut_panel_demo(triggeredHotkey, theme):
|
|
|
249
245
|
return 'dark' if theme == 'light' else 'light'
|
|
250
246
|
|
|
251
247
|
|
|
248
|
+
@app.callback(
|
|
249
|
+
Output('scroll', 'executeScroll'),
|
|
250
|
+
Input('scroll-trigger', 'n_clicks')
|
|
251
|
+
)
|
|
252
|
+
def scroll_test(n_clicks):
|
|
253
|
+
|
|
254
|
+
if n_clicks:
|
|
255
|
+
return True
|
|
256
|
+
|
|
257
|
+
return False
|
|
258
|
+
|
|
259
|
+
|
|
252
260
|
if __name__ == '__main__':
|
|
253
261
|
app.run_server(debug=True)
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# AUTO GENERATED FILE - DO NOT EDIT
|
|
2
|
-
|
|
3
|
-
from dash.development.base_component import Component, _explicitize_args
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class FefferyCaptcha(Component):
|
|
7
|
-
"""A FefferyCaptcha component.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Keyword arguments:
|
|
11
|
-
|
|
12
|
-
- id (optional)
|
|
13
|
-
|
|
14
|
-
- bgColor (optional)
|
|
15
|
-
|
|
16
|
-
- captcha (optional)
|
|
17
|
-
|
|
18
|
-
- charNum (default 4)
|
|
19
|
-
|
|
20
|
-
- className (optional)
|
|
21
|
-
|
|
22
|
-
- fontSize (optional)
|
|
23
|
-
|
|
24
|
-
- height (optional)
|
|
25
|
-
|
|
26
|
-
- loading_state (optional)
|
|
27
|
-
|
|
28
|
-
- setProps (optional):
|
|
29
|
-
Dash-assigned callback that should be called to report property
|
|
30
|
-
changes to Dash, to make them available for callbacks.
|
|
31
|
-
|
|
32
|
-
- style (optional)
|
|
33
|
-
|
|
34
|
-
- width (optional)"""
|
|
35
|
-
@_explicitize_args
|
|
36
|
-
def __init__(self, id=Component.UNDEFINED, className=Component.UNDEFINED, style=Component.UNDEFINED, captcha=Component.UNDEFINED, charNum=Component.UNDEFINED, height=Component.UNDEFINED, width=Component.UNDEFINED, bgColor=Component.UNDEFINED, fontSize=Component.UNDEFINED, loading_state=Component.UNDEFINED, **kwargs):
|
|
37
|
-
self._prop_names = ['id', 'bgColor', 'captcha', 'charNum', 'className', 'fontSize', 'height', 'loading_state', 'setProps', 'style', 'width']
|
|
38
|
-
self._type = 'FefferyCaptcha'
|
|
39
|
-
self._namespace = 'feffery_utils_components'
|
|
40
|
-
self._valid_wildcard_attributes = []
|
|
41
|
-
self.available_properties = ['id', 'bgColor', 'captcha', 'charNum', 'className', 'fontSize', 'height', 'loading_state', 'setProps', 'style', 'width']
|
|
42
|
-
self.available_wildcard_properties = []
|
|
43
|
-
_explicit_args = kwargs.pop('_explicit_args')
|
|
44
|
-
_locals = locals()
|
|
45
|
-
_locals.update(kwargs) # For wildcard attrs
|
|
46
|
-
args = {k: _locals[k] for k in _explicit_args if k != 'children'}
|
|
47
|
-
for k in []:
|
|
48
|
-
if k not in args:
|
|
49
|
-
raise TypeError(
|
|
50
|
-
'Required argument `' + k + '` was not specified.')
|
|
51
|
-
super(FefferyCaptcha, self).__init__(**args)
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# AUTO GENERATED FILE - DO NOT EDIT
|
|
2
|
-
|
|
3
|
-
from dash.development.base_component import Component, _explicitize_args
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class FefferyGuide(Component):
|
|
7
|
-
"""A FefferyGuide component.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Keyword arguments:
|
|
11
|
-
|
|
12
|
-
- id (optional)
|
|
13
|
-
|
|
14
|
-
- arrow (optional)
|
|
15
|
-
|
|
16
|
-
- className (optional)
|
|
17
|
-
|
|
18
|
-
- closable (optional)
|
|
19
|
-
|
|
20
|
-
- hotspot (optional)
|
|
21
|
-
|
|
22
|
-
- loading_state (optional)
|
|
23
|
-
|
|
24
|
-
- localKey (optional)
|
|
25
|
-
|
|
26
|
-
- locale (default 'zh')
|
|
27
|
-
|
|
28
|
-
- mask (optional)
|
|
29
|
-
|
|
30
|
-
- maskClassName (optional)
|
|
31
|
-
|
|
32
|
-
- modalClassName (optional)
|
|
33
|
-
|
|
34
|
-
- nextText (optional)
|
|
35
|
-
|
|
36
|
-
- okText (optional)
|
|
37
|
-
|
|
38
|
-
- prevText (optional)
|
|
39
|
-
|
|
40
|
-
- setProps (optional):
|
|
41
|
-
Dash-assigned callback that should be called to report property
|
|
42
|
-
changes to Dash, to make them available for callbacks.
|
|
43
|
-
|
|
44
|
-
- showPreviousBtn (default True)
|
|
45
|
-
|
|
46
|
-
- step (optional)
|
|
47
|
-
|
|
48
|
-
- stepText (optional)
|
|
49
|
-
|
|
50
|
-
- steps (optional)
|
|
51
|
-
|
|
52
|
-
- style (optional)"""
|
|
53
|
-
@_explicitize_args
|
|
54
|
-
def __init__(self, id=Component.UNDEFINED, className=Component.UNDEFINED, style=Component.UNDEFINED, locale=Component.UNDEFINED, steps=Component.UNDEFINED, localKey=Component.UNDEFINED, closable=Component.UNDEFINED, modalClassName=Component.UNDEFINED, maskClassName=Component.UNDEFINED, mask=Component.UNDEFINED, arrow=Component.UNDEFINED, hotspot=Component.UNDEFINED, stepText=Component.UNDEFINED, nextText=Component.UNDEFINED, prevText=Component.UNDEFINED, showPreviousBtn=Component.UNDEFINED, okText=Component.UNDEFINED, step=Component.UNDEFINED, loading_state=Component.UNDEFINED, **kwargs):
|
|
55
|
-
self._prop_names = ['id', 'arrow', 'className', 'closable', 'hotspot', 'loading_state', 'localKey', 'locale', 'mask', 'maskClassName', 'modalClassName', 'nextText', 'okText', 'prevText', 'setProps', 'showPreviousBtn', 'step', 'stepText', 'steps', 'style']
|
|
56
|
-
self._type = 'FefferyGuide'
|
|
57
|
-
self._namespace = 'feffery_utils_components'
|
|
58
|
-
self._valid_wildcard_attributes = []
|
|
59
|
-
self.available_properties = ['id', 'arrow', 'className', 'closable', 'hotspot', 'loading_state', 'localKey', 'locale', 'mask', 'maskClassName', 'modalClassName', 'nextText', 'okText', 'prevText', 'setProps', 'showPreviousBtn', 'step', 'stepText', 'steps', 'style']
|
|
60
|
-
self.available_wildcard_properties = []
|
|
61
|
-
_explicit_args = kwargs.pop('_explicit_args')
|
|
62
|
-
_locals = locals()
|
|
63
|
-
_locals.update(kwargs) # For wildcard attrs
|
|
64
|
-
args = {k: _locals[k] for k in _explicit_args if k != 'children'}
|
|
65
|
-
for k in []:
|
|
66
|
-
if k not in args:
|
|
67
|
-
raise TypeError(
|
|
68
|
-
'Required argument `' + k + '` was not specified.')
|
|
69
|
-
super(FefferyGuide, self).__init__(**args)
|