feffery_utils_components 0.1.21 → 0.1.22
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 +1 -0
- package/Project.toml +1 -1
- package/build/lib/feffery_utils_components/FefferyCountUp.py +68 -0
- package/build/lib/feffery_utils_components/FefferyDiv.py +13 -25
- package/build/lib/feffery_utils_components/FefferyMotion.py +5 -3
- package/build/lib/feffery_utils_components/_imports_.py +2 -0
- package/build/lib/feffery_utils_components/feffery_utils_components.min.js +4 -4
- package/build/lib/feffery_utils_components/metadata.json +164 -39
- package/build/lib/feffery_utils_components/package-info.json +3 -2
- package/feffery_utils_components/FefferyCountUp.py +68 -0
- package/feffery_utils_components/FefferyDiv.py +13 -25
- package/feffery_utils_components/FefferyMotion.py +5 -3
- package/feffery_utils_components/_imports_.py +2 -0
- package/feffery_utils_components/feffery_utils_components.min.js +4 -4
- package/feffery_utils_components/metadata.json +164 -39
- package/feffery_utils_components/package-info.json +3 -2
- package/package.json +3 -2
- package/src/FefferyUtilsComponents.jl +4 -3
- package/src/jl/''_fefferycountup.jl +34 -0
- package/src/jl/''_fefferydiv.jl +6 -12
- package/src/jl/''_fefferymotion.jl +2 -1
- package/src/lib/components/FefferyCountUp.react.js +116 -0
- package/src/lib/components/FefferyDiv.react.js +10 -69
- package/src/lib/components/animations/FefferyMotion.react.js +4 -0
- package/src/lib/index.js +3 -1
- package/usage.py +17 -100
|
@@ -120,6 +120,13 @@
|
|
|
120
120
|
"required": false,
|
|
121
121
|
"description": ""
|
|
122
122
|
},
|
|
123
|
+
"key": {
|
|
124
|
+
"type": {
|
|
125
|
+
"name": "string"
|
|
126
|
+
},
|
|
127
|
+
"required": false,
|
|
128
|
+
"description": ""
|
|
129
|
+
},
|
|
123
130
|
"initial": {
|
|
124
131
|
"type": {
|
|
125
132
|
"name": "union",
|
|
@@ -1797,9 +1804,9 @@
|
|
|
1797
1804
|
}
|
|
1798
1805
|
}
|
|
1799
1806
|
},
|
|
1800
|
-
"src/lib/components/
|
|
1807
|
+
"src/lib/components/FefferyCountUp.react.js": {
|
|
1801
1808
|
"description": "",
|
|
1802
|
-
"displayName": "
|
|
1809
|
+
"displayName": "FefferyCountUp",
|
|
1803
1810
|
"methods": [],
|
|
1804
1811
|
"props": {
|
|
1805
1812
|
"id": {
|
|
@@ -1809,13 +1816,111 @@
|
|
|
1809
1816
|
"required": false,
|
|
1810
1817
|
"description": ""
|
|
1811
1818
|
},
|
|
1812
|
-
"
|
|
1819
|
+
"className": {
|
|
1820
|
+
"type": {
|
|
1821
|
+
"name": "string"
|
|
1822
|
+
},
|
|
1823
|
+
"required": false,
|
|
1824
|
+
"description": ""
|
|
1825
|
+
},
|
|
1826
|
+
"style": {
|
|
1813
1827
|
"type": {
|
|
1814
1828
|
"name": "object"
|
|
1815
1829
|
},
|
|
1816
1830
|
"required": false,
|
|
1817
1831
|
"description": ""
|
|
1818
1832
|
},
|
|
1833
|
+
"key": {
|
|
1834
|
+
"type": {
|
|
1835
|
+
"name": "string"
|
|
1836
|
+
},
|
|
1837
|
+
"required": false,
|
|
1838
|
+
"description": ""
|
|
1839
|
+
},
|
|
1840
|
+
"end": {
|
|
1841
|
+
"type": {
|
|
1842
|
+
"name": "number"
|
|
1843
|
+
},
|
|
1844
|
+
"required": true,
|
|
1845
|
+
"description": ""
|
|
1846
|
+
},
|
|
1847
|
+
"start": {
|
|
1848
|
+
"type": {
|
|
1849
|
+
"name": "number"
|
|
1850
|
+
},
|
|
1851
|
+
"required": false,
|
|
1852
|
+
"description": "",
|
|
1853
|
+
"defaultValue": {
|
|
1854
|
+
"value": "0",
|
|
1855
|
+
"computed": false
|
|
1856
|
+
}
|
|
1857
|
+
},
|
|
1858
|
+
"duration": {
|
|
1859
|
+
"type": {
|
|
1860
|
+
"name": "number"
|
|
1861
|
+
},
|
|
1862
|
+
"required": false,
|
|
1863
|
+
"description": "",
|
|
1864
|
+
"defaultValue": {
|
|
1865
|
+
"value": "2",
|
|
1866
|
+
"computed": false
|
|
1867
|
+
}
|
|
1868
|
+
},
|
|
1869
|
+
"decimals": {
|
|
1870
|
+
"type": {
|
|
1871
|
+
"name": "number"
|
|
1872
|
+
},
|
|
1873
|
+
"required": false,
|
|
1874
|
+
"description": "",
|
|
1875
|
+
"defaultValue": {
|
|
1876
|
+
"value": "0",
|
|
1877
|
+
"computed": false
|
|
1878
|
+
}
|
|
1879
|
+
},
|
|
1880
|
+
"enableScrollSpy": {
|
|
1881
|
+
"type": {
|
|
1882
|
+
"name": "bool"
|
|
1883
|
+
},
|
|
1884
|
+
"required": false,
|
|
1885
|
+
"description": "",
|
|
1886
|
+
"defaultValue": {
|
|
1887
|
+
"value": "true",
|
|
1888
|
+
"computed": false
|
|
1889
|
+
}
|
|
1890
|
+
},
|
|
1891
|
+
"scrollSpyDelay": {
|
|
1892
|
+
"type": {
|
|
1893
|
+
"name": "number"
|
|
1894
|
+
},
|
|
1895
|
+
"required": false,
|
|
1896
|
+
"description": "",
|
|
1897
|
+
"defaultValue": {
|
|
1898
|
+
"value": "0",
|
|
1899
|
+
"computed": false
|
|
1900
|
+
}
|
|
1901
|
+
},
|
|
1902
|
+
"scrollSpyOnce": {
|
|
1903
|
+
"type": {
|
|
1904
|
+
"name": "bool"
|
|
1905
|
+
},
|
|
1906
|
+
"required": false,
|
|
1907
|
+
"description": "",
|
|
1908
|
+
"defaultValue": {
|
|
1909
|
+
"value": "true",
|
|
1910
|
+
"computed": false
|
|
1911
|
+
}
|
|
1912
|
+
},
|
|
1913
|
+
"separator": {
|
|
1914
|
+
"type": {
|
|
1915
|
+
"name": "string"
|
|
1916
|
+
},
|
|
1917
|
+
"required": false,
|
|
1918
|
+
"description": "",
|
|
1919
|
+
"defaultValue": {
|
|
1920
|
+
"value": "','",
|
|
1921
|
+
"computed": false
|
|
1922
|
+
}
|
|
1923
|
+
},
|
|
1819
1924
|
"loading_state": {
|
|
1820
1925
|
"type": {
|
|
1821
1926
|
"name": "shape",
|
|
@@ -1849,9 +1954,9 @@
|
|
|
1849
1954
|
}
|
|
1850
1955
|
}
|
|
1851
1956
|
},
|
|
1852
|
-
"src/lib/components/
|
|
1957
|
+
"src/lib/components/FefferyCssVar.react.js": {
|
|
1853
1958
|
"description": "",
|
|
1854
|
-
"displayName": "
|
|
1959
|
+
"displayName": "FefferyCssVar",
|
|
1855
1960
|
"methods": [],
|
|
1856
1961
|
"props": {
|
|
1857
1962
|
"id": {
|
|
@@ -1861,64 +1966,68 @@
|
|
|
1861
1966
|
"required": false,
|
|
1862
1967
|
"description": ""
|
|
1863
1968
|
},
|
|
1864
|
-
"
|
|
1969
|
+
"cssVars": {
|
|
1865
1970
|
"type": {
|
|
1866
|
-
"name": "
|
|
1971
|
+
"name": "object"
|
|
1867
1972
|
},
|
|
1868
1973
|
"required": false,
|
|
1869
1974
|
"description": ""
|
|
1870
1975
|
},
|
|
1871
|
-
"
|
|
1976
|
+
"loading_state": {
|
|
1872
1977
|
"type": {
|
|
1873
|
-
"name": "
|
|
1978
|
+
"name": "shape",
|
|
1979
|
+
"value": {
|
|
1980
|
+
"is_loading": {
|
|
1981
|
+
"name": "bool",
|
|
1982
|
+
"description": "Determines if the component is loading or not",
|
|
1983
|
+
"required": false
|
|
1984
|
+
},
|
|
1985
|
+
"prop_name": {
|
|
1986
|
+
"name": "string",
|
|
1987
|
+
"description": "Holds which property is loading",
|
|
1988
|
+
"required": false
|
|
1989
|
+
},
|
|
1990
|
+
"component_name": {
|
|
1991
|
+
"name": "string",
|
|
1992
|
+
"description": "Holds the name of the component that is loading",
|
|
1993
|
+
"required": false
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1874
1996
|
},
|
|
1875
1997
|
"required": false,
|
|
1876
1998
|
"description": ""
|
|
1877
1999
|
},
|
|
1878
|
-
"
|
|
2000
|
+
"setProps": {
|
|
1879
2001
|
"type": {
|
|
1880
|
-
"name": "
|
|
2002
|
+
"name": "func"
|
|
1881
2003
|
},
|
|
1882
2004
|
"required": false,
|
|
1883
|
-
"description": ""
|
|
1884
|
-
}
|
|
1885
|
-
|
|
2005
|
+
"description": "Dash-assigned callback that should be called to report property changes\r\nto Dash, to make them available for callbacks."
|
|
2006
|
+
}
|
|
2007
|
+
}
|
|
2008
|
+
},
|
|
2009
|
+
"src/lib/components/FefferyDiv.react.js": {
|
|
2010
|
+
"description": "",
|
|
2011
|
+
"displayName": "FefferyDiv",
|
|
2012
|
+
"methods": [],
|
|
2013
|
+
"props": {
|
|
2014
|
+
"id": {
|
|
1886
2015
|
"type": {
|
|
1887
|
-
"name": "
|
|
1888
|
-
"value": {
|
|
1889
|
-
"index": {
|
|
1890
|
-
"name": "number",
|
|
1891
|
-
"required": false
|
|
1892
|
-
},
|
|
1893
|
-
"element": {
|
|
1894
|
-
"name": "node",
|
|
1895
|
-
"required": false
|
|
1896
|
-
}
|
|
1897
|
-
}
|
|
2016
|
+
"name": "string"
|
|
1898
2017
|
},
|
|
1899
2018
|
"required": false,
|
|
1900
2019
|
"description": ""
|
|
1901
2020
|
},
|
|
1902
|
-
"
|
|
2021
|
+
"key": {
|
|
1903
2022
|
"type": {
|
|
1904
|
-
"name": "
|
|
1905
|
-
"value": {
|
|
1906
|
-
"index": {
|
|
1907
|
-
"name": "number",
|
|
1908
|
-
"required": false
|
|
1909
|
-
},
|
|
1910
|
-
"element": {
|
|
1911
|
-
"name": "node",
|
|
1912
|
-
"required": false
|
|
1913
|
-
}
|
|
1914
|
-
}
|
|
2023
|
+
"name": "string"
|
|
1915
2024
|
},
|
|
1916
2025
|
"required": false,
|
|
1917
2026
|
"description": ""
|
|
1918
2027
|
},
|
|
1919
|
-
"
|
|
2028
|
+
"children": {
|
|
1920
2029
|
"type": {
|
|
1921
|
-
"name": "
|
|
2030
|
+
"name": "node"
|
|
1922
2031
|
},
|
|
1923
2032
|
"required": false,
|
|
1924
2033
|
"description": ""
|
|
@@ -2037,6 +2146,22 @@
|
|
|
2037
2146
|
"name": "number",
|
|
2038
2147
|
"required": false
|
|
2039
2148
|
},
|
|
2149
|
+
"clientX": {
|
|
2150
|
+
"name": "number",
|
|
2151
|
+
"required": false
|
|
2152
|
+
},
|
|
2153
|
+
"clientY": {
|
|
2154
|
+
"name": "number",
|
|
2155
|
+
"required": false
|
|
2156
|
+
},
|
|
2157
|
+
"screenX": {
|
|
2158
|
+
"name": "number",
|
|
2159
|
+
"required": false
|
|
2160
|
+
},
|
|
2161
|
+
"screenY": {
|
|
2162
|
+
"name": "number",
|
|
2163
|
+
"required": false
|
|
2164
|
+
},
|
|
2040
2165
|
"timestamp": {
|
|
2041
2166
|
"name": "number",
|
|
2042
2167
|
"required": false
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "feffery_utils_components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"description": "Build more utility components for Plotly Dash.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"react-color": "^2.19.3",
|
|
45
45
|
"react-colorful": "^5.6.1",
|
|
46
46
|
"react-copy-to-clipboard": "^5.0.4",
|
|
47
|
+
"react-countup": "^6.4.2",
|
|
47
48
|
"react-device-detect": "^2.2.2",
|
|
48
49
|
"react-flip-numbers": "^3.0.7",
|
|
49
50
|
"react-grid-layout": "^1.3.4",
|
|
@@ -114,4 +115,4 @@
|
|
|
114
115
|
"node": ">=8.11.0",
|
|
115
116
|
"npm": ">=6.1.0"
|
|
116
117
|
}
|
|
117
|
-
}
|
|
118
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "feffery_utils_components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"description": "Build more utility components for Plotly Dash.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"react-color": "^2.19.3",
|
|
45
45
|
"react-colorful": "^5.6.1",
|
|
46
46
|
"react-copy-to-clipboard": "^5.0.4",
|
|
47
|
+
"react-countup": "^6.4.2",
|
|
47
48
|
"react-device-detect": "^2.2.2",
|
|
48
49
|
"react-flip-numbers": "^3.0.7",
|
|
49
50
|
"react-grid-layout": "^1.3.4",
|
|
@@ -114,4 +115,4 @@
|
|
|
114
115
|
"node": ">=8.11.0",
|
|
115
116
|
"npm": ">=6.1.0"
|
|
116
117
|
}
|
|
117
|
-
}
|
|
118
|
+
}
|
|
@@ -3,7 +3,7 @@ module FefferyUtilsComponents
|
|
|
3
3
|
using Dash
|
|
4
4
|
|
|
5
5
|
const resources_path = realpath(joinpath( @__DIR__, "..", "deps"))
|
|
6
|
-
const version = "0.1.
|
|
6
|
+
const version = "0.1.22"
|
|
7
7
|
|
|
8
8
|
include("jl/''_fefferyautoanimate.jl")
|
|
9
9
|
include("jl/''_fefferymotion.jl")
|
|
@@ -19,6 +19,7 @@ include("jl/''_fefferygrid.jl")
|
|
|
19
19
|
include("jl/''_fefferygriditem.jl")
|
|
20
20
|
include("jl/''_fefferycaptcha.jl")
|
|
21
21
|
include("jl/''_fefferycountdown.jl")
|
|
22
|
+
include("jl/''_fefferycountup.jl")
|
|
22
23
|
include("jl/''_fefferycssvar.jl")
|
|
23
24
|
include("jl/''_fefferydiv.jl")
|
|
24
25
|
include("jl/''_fefferyexecutejs.jl")
|
|
@@ -71,14 +72,14 @@ function __init__()
|
|
|
71
72
|
[
|
|
72
73
|
DashBase.Resource(
|
|
73
74
|
relative_package_path = "feffery_utils_components.min.js",
|
|
74
|
-
external_url = "https://unpkg.com/feffery_utils_components@0.1.
|
|
75
|
+
external_url = "https://unpkg.com/feffery_utils_components@0.1.22/feffery_utils_components/feffery_utils_components.min.js",
|
|
75
76
|
dynamic = nothing,
|
|
76
77
|
async = nothing,
|
|
77
78
|
type = :js
|
|
78
79
|
),
|
|
79
80
|
DashBase.Resource(
|
|
80
81
|
relative_package_path = "feffery_utils_components.min.js.map",
|
|
81
|
-
external_url = "https://unpkg.com/feffery_utils_components@0.1.
|
|
82
|
+
external_url = "https://unpkg.com/feffery_utils_components@0.1.22/feffery_utils_components/feffery_utils_components.min.js.map",
|
|
82
83
|
dynamic = true,
|
|
83
84
|
async = nothing,
|
|
84
85
|
type = :js
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# AUTO GENERATED FILE - DO NOT EDIT
|
|
2
|
+
|
|
3
|
+
export ''_fefferycountup
|
|
4
|
+
|
|
5
|
+
"""
|
|
6
|
+
''_fefferycountup(;kwargs...)
|
|
7
|
+
|
|
8
|
+
A FefferyCountUp component.
|
|
9
|
+
|
|
10
|
+
Keyword arguments:
|
|
11
|
+
- `id` (String; optional)
|
|
12
|
+
- `className` (String; optional)
|
|
13
|
+
- `decimals` (Real; optional)
|
|
14
|
+
- `duration` (Real; optional)
|
|
15
|
+
- `enableScrollSpy` (Bool; optional)
|
|
16
|
+
- `end` (Real; required)
|
|
17
|
+
- `key` (String; optional)
|
|
18
|
+
- `loading_state` (optional): . loading_state has the following type: lists containing elements 'is_loading', 'prop_name', 'component_name'.
|
|
19
|
+
Those elements have the following types:
|
|
20
|
+
- `is_loading` (Bool; optional): Determines if the component is loading or not
|
|
21
|
+
- `prop_name` (String; optional): Holds which property is loading
|
|
22
|
+
- `component_name` (String; optional): Holds the name of the component that is loading
|
|
23
|
+
- `scrollSpyDelay` (Real; optional)
|
|
24
|
+
- `scrollSpyOnce` (Bool; optional)
|
|
25
|
+
- `separator` (String; optional)
|
|
26
|
+
- `start` (Real; optional)
|
|
27
|
+
- `style` (Dict; optional)
|
|
28
|
+
"""
|
|
29
|
+
function ''_fefferycountup(; kwargs...)
|
|
30
|
+
available_props = Symbol[:id, :className, :decimals, :duration, :enableScrollSpy, :key, :loading_state, :scrollSpyDelay, :scrollSpyOnce, :separator, :start, :style]
|
|
31
|
+
wild_props = Symbol[]
|
|
32
|
+
return Component("''_fefferycountup", "FefferyCountUp", "feffery_utils_components", available_props, wild_props; kwargs...)
|
|
33
|
+
end
|
|
34
|
+
|
package/src/jl/''_fefferydiv.jl
CHANGED
|
@@ -15,22 +15,20 @@ Keyword arguments:
|
|
|
15
15
|
- `id` (String; optional)
|
|
16
16
|
- `_height` (Real; optional)
|
|
17
17
|
- `_width` (Real; optional)
|
|
18
|
-
- `appendChild` (a list of or a singular dash component, string or number; optional)
|
|
19
18
|
- `className` (String | Dict; optional)
|
|
20
19
|
- `clickAwayCount` (Real; optional)
|
|
21
|
-
- `contextMenuEvent` (optional): . contextMenuEvent has the following type: lists containing elements 'pageX', 'pageY', 'timestamp'.
|
|
20
|
+
- `contextMenuEvent` (optional): . contextMenuEvent has the following type: lists containing elements 'pageX', 'pageY', 'clientX', 'clientY', 'screenX', 'screenY', 'timestamp'.
|
|
22
21
|
Those elements have the following types:
|
|
23
22
|
- `pageX` (Real; optional)
|
|
24
23
|
- `pageY` (Real; optional)
|
|
24
|
+
- `clientX` (Real; optional)
|
|
25
|
+
- `clientY` (Real; optional)
|
|
26
|
+
- `screenX` (Real; optional)
|
|
27
|
+
- `screenY` (Real; optional)
|
|
25
28
|
- `timestamp` (Real; optional)
|
|
26
29
|
- `debounceWait` (Real; optional)
|
|
27
|
-
- `deleteChildIndex` (Real; optional)
|
|
28
30
|
- `enableClickAway` (Bool; optional)
|
|
29
31
|
- `enableListenContextMenu` (Bool; optional)
|
|
30
|
-
- `insertChild` (optional): . insertChild has the following type: lists containing elements 'index', 'element'.
|
|
31
|
-
Those elements have the following types:
|
|
32
|
-
- `index` (Real; optional)
|
|
33
|
-
- `element` (a list of or a singular dash component, string or number; optional)
|
|
34
32
|
- `isHovering` (Bool; optional)
|
|
35
33
|
- `key` (String; optional)
|
|
36
34
|
- `loading_state` (optional): . loading_state has the following type: lists containing elements 'is_loading', 'prop_name', 'component_name'.
|
|
@@ -42,16 +40,12 @@ Those elements have the following types:
|
|
|
42
40
|
- `mouseLeaveCount` (Real; optional)
|
|
43
41
|
- `nClicks` (Real; optional)
|
|
44
42
|
- `nDoubleClicks` (Real; optional)
|
|
45
|
-
- `replaceChild` (optional): . replaceChild has the following type: lists containing elements 'index', 'element'.
|
|
46
|
-
Those elements have the following types:
|
|
47
|
-
- `index` (Real; optional)
|
|
48
|
-
- `element` (a list of or a singular dash component, string or number; optional)
|
|
49
43
|
- `scrollbar` (a value equal to: 'default', 'simple', 'hidden'; optional)
|
|
50
44
|
- `shadow` (a value equal to: 'no-shadow', 'hover-shadow', 'always-shadow'; optional)
|
|
51
45
|
- `style` (Dict; optional)
|
|
52
46
|
"""
|
|
53
47
|
function ''_fefferydiv(; kwargs...)
|
|
54
|
-
available_props = Symbol[:children, :id, :_height, :_width, :
|
|
48
|
+
available_props = Symbol[:children, :id, :_height, :_width, :className, :clickAwayCount, :contextMenuEvent, :debounceWait, :enableClickAway, :enableListenContextMenu, :isHovering, :key, :loading_state, :mouseEnterCount, :mouseLeaveCount, :nClicks, :nDoubleClicks, :scrollbar, :shadow, :style]
|
|
55
49
|
wild_props = Symbol[]
|
|
56
50
|
return Component("''_fefferydiv", "FefferyDiv", "feffery_utils_components", available_props, wild_props; kwargs...)
|
|
57
51
|
end
|
|
@@ -17,6 +17,7 @@ Keyword arguments:
|
|
|
17
17
|
- `className` (String; optional)
|
|
18
18
|
- `exit` (Dict | String; optional)
|
|
19
19
|
- `initial` (Dict | Bool | String; optional)
|
|
20
|
+
- `key` (String; optional)
|
|
20
21
|
- `loading_state` (optional): . loading_state has the following type: lists containing elements 'is_loading', 'prop_name', 'component_name'.
|
|
21
22
|
Those elements have the following types:
|
|
22
23
|
- `is_loading` (Bool; optional): Determines if the component is loading or not
|
|
@@ -44,7 +45,7 @@ Those elements have the following types:
|
|
|
44
45
|
- `whileTap` (Dict | String; optional)
|
|
45
46
|
"""
|
|
46
47
|
function ''_fefferymotion(; kwargs...)
|
|
47
|
-
available_props = Symbol[:children, :id, :animate, :className, :exit, :initial, :loading_state, :style, :transition, :variants, :viewport, :whileHover, :whileInView, :whileTap]
|
|
48
|
+
available_props = Symbol[:children, :id, :animate, :className, :exit, :initial, :key, :loading_state, :style, :transition, :variants, :viewport, :whileHover, :whileInView, :whileTap]
|
|
48
49
|
wild_props = Symbol[]
|
|
49
50
|
return Component("''_fefferymotion", "FefferyMotion", "feffery_utils_components", available_props, wild_props; kwargs...)
|
|
50
51
|
end
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import CountUp from 'react-countup';
|
|
3
|
+
|
|
4
|
+
// 定义数字递增组件FefferyCountUp
|
|
5
|
+
const FefferyCountUp = (props) => {
|
|
6
|
+
// 取得必要属性或参数
|
|
7
|
+
const {
|
|
8
|
+
id,
|
|
9
|
+
className,
|
|
10
|
+
style,
|
|
11
|
+
key,
|
|
12
|
+
end,
|
|
13
|
+
start,
|
|
14
|
+
duration,
|
|
15
|
+
decimals,
|
|
16
|
+
enableScrollSpy,
|
|
17
|
+
scrollSpyDelay,
|
|
18
|
+
scrollSpyOnce,
|
|
19
|
+
separator,
|
|
20
|
+
setProps,
|
|
21
|
+
loading_state
|
|
22
|
+
} = props;
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<CountUp
|
|
26
|
+
id={id}
|
|
27
|
+
className={className}
|
|
28
|
+
style={style}
|
|
29
|
+
key={key}
|
|
30
|
+
end={end}
|
|
31
|
+
start={start}
|
|
32
|
+
duration={duration}
|
|
33
|
+
decimals={decimals}
|
|
34
|
+
enableScrollSpy={enableScrollSpy}
|
|
35
|
+
scrollSpyDelay={scrollSpyDelay}
|
|
36
|
+
scrollSpyOnce={scrollSpyOnce}
|
|
37
|
+
separator={separator}
|
|
38
|
+
data-dash-is-loading={
|
|
39
|
+
(loading_state && loading_state.is_loading) || undefined
|
|
40
|
+
} />
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
// 定义参数或属性
|
|
46
|
+
FefferyCountUp.propTypes = {
|
|
47
|
+
// 部件id
|
|
48
|
+
id: PropTypes.string,
|
|
49
|
+
|
|
50
|
+
className: PropTypes.string,
|
|
51
|
+
|
|
52
|
+
style: PropTypes.object,
|
|
53
|
+
|
|
54
|
+
key: PropTypes.string,
|
|
55
|
+
|
|
56
|
+
// 设置数字递增目标,必填
|
|
57
|
+
// 对此参数的更新会重新触发递增动画
|
|
58
|
+
end: PropTypes.number.isRequired,
|
|
59
|
+
|
|
60
|
+
// 设置数字递增起点,默认为0
|
|
61
|
+
// 对此参数的更新会重新触发递增动画
|
|
62
|
+
start: PropTypes.number,
|
|
63
|
+
|
|
64
|
+
// 设置数字递增动画耗时,单位:秒,默认为2
|
|
65
|
+
// 对此参数的更新会重新触发递增动画
|
|
66
|
+
duration: PropTypes.number,
|
|
67
|
+
|
|
68
|
+
// 设置小数精度,默认为0
|
|
69
|
+
decimals: PropTypes.number,
|
|
70
|
+
|
|
71
|
+
// 设置是否在当前元素进入视口后才开始执行递增动画,默认为true
|
|
72
|
+
enableScrollSpy: PropTypes.bool,
|
|
73
|
+
|
|
74
|
+
// 当enableScrollSpy为true时,设置当前元素进入视口后延时多久开始执行递增动画,单位:毫秒,默认为0
|
|
75
|
+
scrollSpyDelay: PropTypes.number,
|
|
76
|
+
|
|
77
|
+
// 设置是否仅进行一次视口出现后启用动画行为,默认为true
|
|
78
|
+
scrollSpyOnce: PropTypes.bool,
|
|
79
|
+
|
|
80
|
+
// 设置自定义千分符,默认为','
|
|
81
|
+
separator: PropTypes.string,
|
|
82
|
+
|
|
83
|
+
loading_state: PropTypes.shape({
|
|
84
|
+
/**
|
|
85
|
+
* Determines if the component is loading or not
|
|
86
|
+
*/
|
|
87
|
+
is_loading: PropTypes.bool,
|
|
88
|
+
/**
|
|
89
|
+
* Holds which property is loading
|
|
90
|
+
*/
|
|
91
|
+
prop_name: PropTypes.string,
|
|
92
|
+
/**
|
|
93
|
+
* Holds the name of the component that is loading
|
|
94
|
+
*/
|
|
95
|
+
component_name: PropTypes.string
|
|
96
|
+
}),
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Dash-assigned callback that should be called to report property changes
|
|
100
|
+
* to Dash, to make them available for callbacks.
|
|
101
|
+
*/
|
|
102
|
+
setProps: PropTypes.func,
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
// 设置默认参数
|
|
106
|
+
FefferyCountUp.defaultProps = {
|
|
107
|
+
start: 0,
|
|
108
|
+
duration: 2,
|
|
109
|
+
decimals: 0,
|
|
110
|
+
enableScrollSpy: true,
|
|
111
|
+
scrollSpyDelay: 0,
|
|
112
|
+
scrollSpyOnce: true,
|
|
113
|
+
separator: ','
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export default FefferyCountUp;
|
|
@@ -74,10 +74,6 @@ const FefferyDiv = (props) => {
|
|
|
74
74
|
enableListenContextMenu,
|
|
75
75
|
debounceWait,
|
|
76
76
|
clickAwayCount,
|
|
77
|
-
appendChild,
|
|
78
|
-
insertChild,
|
|
79
|
-
replaceChild,
|
|
80
|
-
deleteChildIndex,
|
|
81
77
|
shadow,
|
|
82
78
|
scrollbar,
|
|
83
79
|
enableClickAway,
|
|
@@ -89,46 +85,6 @@ const FefferyDiv = (props) => {
|
|
|
89
85
|
const size = useSize(ref);
|
|
90
86
|
const _isHovering = useHover(ref);
|
|
91
87
|
|
|
92
|
-
// 快捷children数组增删操作
|
|
93
|
-
useEffect(() => {
|
|
94
|
-
if (children && appendChild) {
|
|
95
|
-
setProps({
|
|
96
|
-
children: children.concat(appendChild),
|
|
97
|
-
appendChild: null // 重置
|
|
98
|
-
})
|
|
99
|
-
}
|
|
100
|
-
}, [appendChild])
|
|
101
|
-
|
|
102
|
-
useEffect(() => {
|
|
103
|
-
if (children && insertChild && insertChild.index && insertChild.element) {
|
|
104
|
-
setProps({
|
|
105
|
-
children: children.slice(0, insertChild.index)
|
|
106
|
-
.concat([insertChild.element])
|
|
107
|
-
.concat(children.slice(insertChild.index)),
|
|
108
|
-
insertChild: null // 重置
|
|
109
|
-
})
|
|
110
|
-
}
|
|
111
|
-
}, [insertChild])
|
|
112
|
-
|
|
113
|
-
useEffect(() => {
|
|
114
|
-
if (children && replaceChild && replaceChild.index && replaceChild.element) {
|
|
115
|
-
children[replaceChild.index] = replaceChild.element
|
|
116
|
-
setProps({
|
|
117
|
-
children: children,
|
|
118
|
-
replaceChild: null // 重置
|
|
119
|
-
})
|
|
120
|
-
}
|
|
121
|
-
}, [replaceChild])
|
|
122
|
-
|
|
123
|
-
useEffect(() => {
|
|
124
|
-
if (children && (deleteChildIndex || deleteChildIndex === 0)) {
|
|
125
|
-
setProps({
|
|
126
|
-
children: children.filter((_, i) => i !== deleteChildIndex),
|
|
127
|
-
deleteChildIndex: null // 重置
|
|
128
|
-
})
|
|
129
|
-
}
|
|
130
|
-
}, [deleteChildIndex])
|
|
131
|
-
|
|
132
88
|
// 防抖更新容器尺寸
|
|
133
89
|
const { run: updateWidthHeight } = useRequest(
|
|
134
90
|
(e) => {
|
|
@@ -259,29 +215,6 @@ FefferyDiv.propTypes = {
|
|
|
259
215
|
|
|
260
216
|
children: PropTypes.node,
|
|
261
217
|
|
|
262
|
-
// 快捷children数组增删参数,在有效值传入促使组件更新后会自动重置为undefined
|
|
263
|
-
// 用于快捷向children数组末尾追加新元素
|
|
264
|
-
appendChild: PropTypes.node,
|
|
265
|
-
|
|
266
|
-
// 用于快捷在原children数组第index个位置插入新元素
|
|
267
|
-
insertChild: PropTypes.exact({
|
|
268
|
-
// 要插入的位序
|
|
269
|
-
index: PropTypes.number,
|
|
270
|
-
// 要插入的元素
|
|
271
|
-
element: PropTypes.node
|
|
272
|
-
}),
|
|
273
|
-
|
|
274
|
-
// 用于快捷对children数组第index个位置的元素进行替换
|
|
275
|
-
replaceChild: PropTypes.exact({
|
|
276
|
-
// 要替换元素的位序
|
|
277
|
-
index: PropTypes.number,
|
|
278
|
-
// 要替换的新元素
|
|
279
|
-
element: PropTypes.node
|
|
280
|
-
}),
|
|
281
|
-
|
|
282
|
-
// 用于快捷删除原children第index个位置的元素
|
|
283
|
-
deleteChildIndex: PropTypes.number,
|
|
284
|
-
|
|
285
218
|
style: PropTypes.object,
|
|
286
219
|
|
|
287
220
|
className: PropTypes.oneOfType([
|
|
@@ -316,10 +249,18 @@ FefferyDiv.propTypes = {
|
|
|
316
249
|
|
|
317
250
|
// 监听右键事件
|
|
318
251
|
contextMenuEvent: PropTypes.exact({
|
|
319
|
-
//
|
|
252
|
+
// 以页面整体左上角为原点,记录x坐标
|
|
320
253
|
pageX: PropTypes.number,
|
|
321
|
-
//
|
|
254
|
+
// 以页面整体左上角为原点,记录y坐标
|
|
322
255
|
pageY: PropTypes.number,
|
|
256
|
+
// 以浏览器窗口左上角为原点,记录x坐标
|
|
257
|
+
clientX: PropTypes.number,
|
|
258
|
+
// 以浏览器窗口左上角为原点,记录y坐标
|
|
259
|
+
clientY: PropTypes.number,
|
|
260
|
+
// 以屏幕左上角为原点,记录x坐标
|
|
261
|
+
screenX: PropTypes.number,
|
|
262
|
+
// 以屏幕左上角为原点,记录y坐标
|
|
263
|
+
screenY: PropTypes.number,
|
|
323
264
|
// 点击事件对应的时间戳
|
|
324
265
|
timestamp: PropTypes.number
|
|
325
266
|
}),
|