feffery_utils_components 0.0.9 → 0.0.13
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 +5 -5
- package/Project.toml +1 -1
- package/feffery_utils_components/FefferyCaptcha.py +5 -3
- package/feffery_utils_components/FefferyCircleColorPicker.py +47 -0
- package/{build/lib/feffery_utils_components/FefferyDashboard.py → feffery_utils_components/FefferyColorPicker.py} +9 -11
- package/feffery_utils_components/FefferyDiv.py +47 -0
- package/feffery_utils_components/FefferyExecuteJs.py +5 -3
- package/feffery_utils_components/FefferyExtraSpinner.py +49 -0
- package/feffery_utils_components/FefferyGuide.py +5 -3
- package/feffery_utils_components/FefferyScroll.py +57 -0
- package/feffery_utils_components/FefferyScrollbars.py +51 -0
- package/feffery_utils_components/FefferyShortcutPanel.py +5 -3
- package/feffery_utils_components/FefferySplit.py +8 -8
- package/feffery_utils_components/FefferySplitPane.py +5 -3
- package/feffery_utils_components/FefferySyntaxHighlighter.py +5 -3
- package/feffery_utils_components/FefferyTopProgress.py +5 -3
- package/feffery_utils_components/_imports_.py +10 -4
- package/feffery_utils_components/feffery_utils_components.min.js +50 -28
- package/feffery_utils_components/metadata.json +457 -202
- package/feffery_utils_components/package-info.json +7 -6
- package/package.json +7 -6
- package/src/FefferyUtilsComponents.jl +8 -5
- package/src/jl/''_fefferycirclecolorpicker.jl +26 -0
- package/src/jl/''_fefferycolorpicker.jl +22 -0
- package/src/jl/''_fefferydiv.jl +32 -0
- package/src/jl/''_fefferyextraspinner.jl +27 -0
- package/src/jl/''_fefferyscroll.jl +31 -0
- package/src/jl/''_fefferyscrollbars.jl +34 -0
- package/src/jl/''_fefferysplit.jl +1 -2
- package/src/lib/components/FefferyCaptcha.react.js +6 -2
- package/src/lib/components/FefferyDiv.react.js +85 -0
- package/src/lib/components/FefferyExecuteJs.react.js +21 -12
- package/src/lib/components/FefferyExtraSpinner.react.js +373 -0
- package/src/lib/components/FefferyGuide.react.js +11 -4
- package/src/lib/components/FefferyScroll.react.js +170 -0
- package/src/lib/components/FefferyScrollbars.react.js +104 -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/split/FefferySplit.react.js +28 -42
- package/src/lib/components/styles.css +32 -8
- package/src/lib/index.js +11 -6
- package/usage.py +107 -39
- 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
|
@@ -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
|
+
}
|
|
@@ -33,15 +33,6 @@ const resolveChildProps = child => {
|
|
|
33
33
|
// 定义分割面板组件FefferySplit,api参数参考https://github.com/nathancahill/split/tree/master/packages/splitjs
|
|
34
34
|
export default class FefferySplit extends Component {
|
|
35
35
|
|
|
36
|
-
constructor(props) {
|
|
37
|
-
super(props)
|
|
38
|
-
// 初始化value
|
|
39
|
-
if (props.defaultSizes) {
|
|
40
|
-
// 当defaultSizes不为空时,为sizes初始化defaultSizes对应的sizes值
|
|
41
|
-
props.setProps({ sizes: props.defaultSizes })
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
36
|
render() {
|
|
46
37
|
// 取得必要属性或参数
|
|
47
38
|
let {
|
|
@@ -50,7 +41,6 @@ export default class FefferySplit extends Component {
|
|
|
50
41
|
className,
|
|
51
42
|
style,
|
|
52
43
|
sizes,
|
|
53
|
-
defaultSizes,
|
|
54
44
|
minSize,
|
|
55
45
|
maxSize,
|
|
56
46
|
expandToMin,
|
|
@@ -64,40 +54,39 @@ export default class FefferySplit extends Component {
|
|
|
64
54
|
|
|
65
55
|
children = parseChildrenToArray(children)
|
|
66
56
|
|
|
67
|
-
const splitPanes = children.map(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
)
|
|
57
|
+
// const splitPanes = children.map(
|
|
58
|
+
// (child) => {
|
|
59
|
+
// let childProps = resolveChildProps(child)
|
|
60
|
+
|
|
61
|
+
// const {
|
|
62
|
+
// id,
|
|
63
|
+
// className,
|
|
64
|
+
// style,
|
|
65
|
+
// loading_state,
|
|
66
|
+
// ...otherProps
|
|
67
|
+
// } = childProps;
|
|
68
|
+
|
|
69
|
+
// return (
|
|
70
|
+
// <div
|
|
71
|
+
// id={id}
|
|
72
|
+
// className={className}
|
|
73
|
+
// style={style}
|
|
74
|
+
// loading_state={loading_state}
|
|
75
|
+
// {...omit(
|
|
76
|
+
// ['setProps', 'persistence', 'persistence_type', 'persisted_props'],
|
|
77
|
+
// otherProps
|
|
78
|
+
// )}>
|
|
79
|
+
// </div>
|
|
80
|
+
// );
|
|
81
|
+
// }
|
|
82
|
+
// )
|
|
94
83
|
|
|
95
84
|
// 返回向页面注入的快捷键监听
|
|
96
85
|
return (
|
|
97
86
|
<Split id={id}
|
|
98
87
|
className={className ? `feffery-split-${direction}` + ' ' + className : `feffery-split-${direction}`}
|
|
99
88
|
style={style}
|
|
100
|
-
sizes={
|
|
89
|
+
sizes={sizes}
|
|
101
90
|
minSize={minSize}
|
|
102
91
|
maxSize={maxSize}
|
|
103
92
|
expandToMin={expandToMin}
|
|
@@ -113,7 +102,7 @@ export default class FefferySplit extends Component {
|
|
|
113
102
|
(loading_state && loading_state.is_loading) || undefined
|
|
114
103
|
}
|
|
115
104
|
>
|
|
116
|
-
{
|
|
105
|
+
{children}
|
|
117
106
|
</Split>
|
|
118
107
|
);
|
|
119
108
|
}
|
|
@@ -133,9 +122,6 @@ FefferySplit.propTypes = {
|
|
|
133
122
|
// 自定义css字典
|
|
134
123
|
style: PropTypes.object,
|
|
135
124
|
|
|
136
|
-
// 以数组的形式,分别为每个子元素盒子设置百分比尺寸
|
|
137
|
-
defaultSizes: PropTypes.arrayOf(PropTypes.number),
|
|
138
|
-
|
|
139
125
|
// 记录当前最新的sizes变动情况,分别为每个子元素盒子设置百分比尺寸
|
|
140
126
|
sizes: PropTypes.arrayOf(PropTypes.number),
|
|
141
127
|
|
|
@@ -51,10 +51,6 @@
|
|
|
51
51
|
opacity: 0.7;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
html {
|
|
55
|
-
overflow: auto !important;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
54
|
.feffery-split-vertical {
|
|
59
55
|
border: none;
|
|
60
56
|
}
|
|
@@ -65,19 +61,47 @@ html {
|
|
|
65
61
|
}
|
|
66
62
|
|
|
67
63
|
.gutter {
|
|
68
|
-
|
|
69
|
-
background-repeat: no-repeat;
|
|
70
|
-
background-position: 50%;
|
|
64
|
+
position: relative;
|
|
71
65
|
}
|
|
72
66
|
|
|
73
67
|
.gutter:hover {
|
|
74
|
-
background-color: #42a5f5;
|
|
68
|
+
/* background-color: #42a5f5; */
|
|
75
69
|
}
|
|
76
70
|
|
|
77
71
|
.gutter.gutter-horizontal {
|
|
78
72
|
cursor: col-resize;
|
|
79
73
|
}
|
|
80
74
|
|
|
75
|
+
.gutter.gutter-horizontal:after {
|
|
76
|
+
content: "";
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
border-right: 1px solid #e6e6e6;
|
|
79
|
+
inset: 0;
|
|
80
|
+
position: absolute;
|
|
81
|
+
transform: translateX(-50%);
|
|
82
|
+
left: 1px;
|
|
83
|
+
}
|
|
84
|
+
|
|
81
85
|
.gutter.gutter-vertical {
|
|
82
86
|
cursor: row-resize;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.gutter.gutter-horizontal:after {
|
|
90
|
+
content: "";
|
|
91
|
+
box-sizing: border-box;
|
|
92
|
+
border-right: 1px solid #e6e6e6;
|
|
93
|
+
inset: 0;
|
|
94
|
+
position: absolute;
|
|
95
|
+
transform: translateX(-50%);
|
|
96
|
+
left: 1px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.gutter.gutter-vertical:after {
|
|
100
|
+
content: '';
|
|
101
|
+
box-sizing: border-box;
|
|
102
|
+
border-bottom: 1px solid #e6e6e6;
|
|
103
|
+
inset: 0;
|
|
104
|
+
transform: translateY(-50%);
|
|
105
|
+
position: absolute;
|
|
106
|
+
top: 1px;
|
|
83
107
|
}
|
package/src/lib/index.js
CHANGED
|
@@ -1,25 +1,30 @@
|
|
|
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";
|
|
12
|
-
|
|
10
|
+
import FefferyCircleColorPicker from "./components/colorPickers/FefferyCircleColorPicker.react";
|
|
11
|
+
import FefferyScroll from "./components/FefferyScroll.react";
|
|
12
|
+
import FefferyScrollbars from "./components/FefferyScrollbars.react";
|
|
13
|
+
import FefferyExtraSpinner from "./components/FefferyExtraSpinner.react";
|
|
14
|
+
import FefferyDiv from "./components/FefferyDiv.react";
|
|
13
15
|
|
|
14
16
|
export {
|
|
15
17
|
FefferyCaptcha,
|
|
16
|
-
FefferyWaterMark,
|
|
17
18
|
FefferySyntaxHighlighter,
|
|
18
|
-
FefferyPasteImage,
|
|
19
19
|
FefferyTopProgress,
|
|
20
20
|
FefferyShortcutPanel,
|
|
21
21
|
FefferyGuide,
|
|
22
22
|
FefferySplit,
|
|
23
23
|
FefferySplitPane,
|
|
24
|
-
FefferyExecuteJs
|
|
24
|
+
FefferyExecuteJs,
|
|
25
|
+
FefferyCircleColorPicker,
|
|
26
|
+
FefferyScroll,
|
|
27
|
+
FefferyScrollbars,
|
|
28
|
+
FefferyExtraSpinner,
|
|
29
|
+
FefferyDiv
|
|
25
30
|
};
|
package/usage.py
CHANGED
|
@@ -7,12 +7,19 @@ import uuid
|
|
|
7
7
|
app = dash.Dash(__name__)
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
@app.callback(
|
|
11
|
+
Output('execute-js-demo-output', 'jsString'),
|
|
12
|
+
Input('execute-js-demo', 'n_clicks')
|
|
13
|
+
)
|
|
14
|
+
def execute_js_demo(n_clicks):
|
|
15
|
+
|
|
16
|
+
if n_clicks:
|
|
17
|
+
return f'console.log({n_clicks});window.open("https://www.baidu.com/")'
|
|
18
|
+
|
|
19
|
+
|
|
10
20
|
app.layout = html.Div(
|
|
11
21
|
fuc.FefferyTopProgress(
|
|
12
22
|
[
|
|
13
|
-
|
|
14
|
-
fuc.FefferyExecuteJs(),
|
|
15
|
-
|
|
16
23
|
fuc.FefferySplit(
|
|
17
24
|
[
|
|
18
25
|
fuc.FefferySplitPane(
|
|
@@ -22,8 +29,8 @@ app.layout = html.Div(
|
|
|
22
29
|
html.Div(
|
|
23
30
|
'a',
|
|
24
31
|
style={
|
|
25
|
-
'width': '
|
|
26
|
-
'height': '
|
|
32
|
+
'width': '100%',
|
|
33
|
+
'height': '100%',
|
|
27
34
|
'border': '1px solid red'
|
|
28
35
|
}
|
|
29
36
|
)
|
|
@@ -31,9 +38,9 @@ app.layout = html.Div(
|
|
|
31
38
|
fuc.FefferySplitPane('b'),
|
|
32
39
|
fuc.FefferySplitPane('c'),
|
|
33
40
|
],
|
|
34
|
-
|
|
41
|
+
sizes=[20, 40, 40],
|
|
35
42
|
minSize=20,
|
|
36
|
-
gutterSize=
|
|
43
|
+
gutterSize=10,
|
|
37
44
|
# dragInterval=1,
|
|
38
45
|
# direction='vertical',
|
|
39
46
|
style={
|
|
@@ -47,7 +54,7 @@ app.layout = html.Div(
|
|
|
47
54
|
fuc.FefferySplitPane('b'),
|
|
48
55
|
fuc.FefferySplitPane('c'),
|
|
49
56
|
],
|
|
50
|
-
|
|
57
|
+
sizes=[20, 40, 40],
|
|
51
58
|
minSize=20,
|
|
52
59
|
gutterSize=3,
|
|
53
60
|
# dragInterval=1,
|
|
@@ -58,6 +65,85 @@ app.layout = html.Div(
|
|
|
58
65
|
}
|
|
59
66
|
),
|
|
60
67
|
|
|
68
|
+
|
|
69
|
+
html.Div(
|
|
70
|
+
[
|
|
71
|
+
html.Div(
|
|
72
|
+
[
|
|
73
|
+
html.H5(_type),
|
|
74
|
+
fuc.FefferyExtraSpinner(
|
|
75
|
+
type=_type,
|
|
76
|
+
style={
|
|
77
|
+
'marginBottom': '25px'
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
]
|
|
81
|
+
)
|
|
82
|
+
for _type in [
|
|
83
|
+
"ball", "swap", "bars", "grid", "wave", "push", "firework",
|
|
84
|
+
"stage", "ring", "heart", "guard", "rotate", "spiral", "pulse",
|
|
85
|
+
"swish", "sequence", "impulse", "cube", "magic", "flag", "fill",
|
|
86
|
+
"sphere", "domino", "goo", "comb", "pong", "rainbow", "hoop",
|
|
87
|
+
"flapper", "jellyfish", "trace", "classic", "whisper", "metro"
|
|
88
|
+
]
|
|
89
|
+
],
|
|
90
|
+
style={
|
|
91
|
+
'marginBottom': '100px'
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
|
|
95
|
+
fuc.FefferyScrollbars(
|
|
96
|
+
html.Div(
|
|
97
|
+
'测试'*5000,
|
|
98
|
+
style={
|
|
99
|
+
'padding': '50px'
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
scrollbarMaxSize=50,
|
|
103
|
+
style={
|
|
104
|
+
'height': '500px',
|
|
105
|
+
'border': '1px solid black'
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
|
|
109
|
+
html.Button(
|
|
110
|
+
'跳转',
|
|
111
|
+
id='execute-js-demo'
|
|
112
|
+
),
|
|
113
|
+
|
|
114
|
+
fuc.FefferyExecuteJs(
|
|
115
|
+
id='execute-js-demo-output',
|
|
116
|
+
),
|
|
117
|
+
|
|
118
|
+
html.Div(
|
|
119
|
+
style={
|
|
120
|
+
'height': '2000px'
|
|
121
|
+
}
|
|
122
|
+
),
|
|
123
|
+
|
|
124
|
+
html.Div(
|
|
125
|
+
html.Button(
|
|
126
|
+
'scroll!',
|
|
127
|
+
id='scroll-trigger'
|
|
128
|
+
)
|
|
129
|
+
),
|
|
130
|
+
|
|
131
|
+
# 绑定滚动器
|
|
132
|
+
fuc.FefferyScroll(
|
|
133
|
+
id='scroll',
|
|
134
|
+
duration=3000,
|
|
135
|
+
smooth='easeInOutQuad',
|
|
136
|
+
scrollMode='target',
|
|
137
|
+
scrollTargetId='step3',
|
|
138
|
+
offset=-300
|
|
139
|
+
),
|
|
140
|
+
|
|
141
|
+
fuc.FefferyCircleColorPicker(
|
|
142
|
+
color='red'
|
|
143
|
+
),
|
|
144
|
+
|
|
145
|
+
fuc.FefferyExecuteJs(),
|
|
146
|
+
|
|
61
147
|
fuc.FefferyGuide(
|
|
62
148
|
steps=[
|
|
63
149
|
{
|
|
@@ -91,7 +177,7 @@ app.layout = html.Div(
|
|
|
91
177
|
# hotspot=True,
|
|
92
178
|
showPreviousBtn=True,
|
|
93
179
|
closable=True,
|
|
94
|
-
|
|
180
|
+
step=-1
|
|
95
181
|
),
|
|
96
182
|
|
|
97
183
|
html.H2('节点1', id='step1', style={'marginBottom': '200px'}),
|
|
@@ -140,16 +226,6 @@ app.layout = html.Div(
|
|
|
140
226
|
]
|
|
141
227
|
),
|
|
142
228
|
|
|
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
229
|
fuc.FefferyCaptcha(id='captcha-demo',
|
|
154
230
|
charNum=10,
|
|
155
231
|
width=300,
|
|
@@ -159,11 +235,6 @@ app.layout = html.Div(
|
|
|
159
235
|
html.Em(id='output-demo')
|
|
160
236
|
),
|
|
161
237
|
|
|
162
|
-
fuc.FefferyWaterMark(
|
|
163
|
-
content='fuc FefferyWaterMark',
|
|
164
|
-
fontSize=26
|
|
165
|
-
),
|
|
166
|
-
|
|
167
238
|
fuc.FefferySyntaxHighlighter(
|
|
168
239
|
id='syntax-highlighter-demo',
|
|
169
240
|
showLineNumbers=True,
|
|
@@ -223,21 +294,6 @@ def test(captcha):
|
|
|
223
294
|
return captcha
|
|
224
295
|
|
|
225
296
|
|
|
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
297
|
@app.callback(
|
|
242
298
|
Output('shortcut-panel-demo', 'theme'),
|
|
243
299
|
Input('shortcut-panel-demo', 'triggeredHotkey'),
|
|
@@ -249,5 +305,17 @@ def shotycut_panel_demo(triggeredHotkey, theme):
|
|
|
249
305
|
return 'dark' if theme == 'light' else 'light'
|
|
250
306
|
|
|
251
307
|
|
|
308
|
+
@app.callback(
|
|
309
|
+
Output('scroll', 'executeScroll'),
|
|
310
|
+
Input('scroll-trigger', 'n_clicks')
|
|
311
|
+
)
|
|
312
|
+
def scroll_test(n_clicks):
|
|
313
|
+
|
|
314
|
+
if n_clicks:
|
|
315
|
+
return True
|
|
316
|
+
|
|
317
|
+
return False
|
|
318
|
+
|
|
319
|
+
|
|
252
320
|
if __name__ == '__main__':
|
|
253
321
|
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)
|