feffery_utils_components 0.0.13 → 0.0.14

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 (48) hide show
  1. package/DESCRIPTION +1 -1
  2. package/NAMESPACE +3 -0
  3. package/Project.toml +1 -1
  4. package/build/lib/feffery_utils_components/FefferyCaptcha.py +53 -0
  5. package/build/lib/feffery_utils_components/FefferyCircleColorPicker.py +47 -0
  6. package/build/lib/feffery_utils_components/FefferyColorPicker.py +37 -0
  7. package/build/lib/feffery_utils_components/FefferyDashboard.py +39 -0
  8. package/build/lib/feffery_utils_components/FefferyDiv.py +47 -0
  9. package/build/lib/feffery_utils_components/FefferyExecuteJs.py +35 -0
  10. package/build/lib/feffery_utils_components/FefferyExtraSpinner.py +49 -0
  11. package/build/lib/feffery_utils_components/FefferyGuide.py +71 -0
  12. package/build/lib/feffery_utils_components/FefferyPasteImage.py +56 -0
  13. package/build/lib/feffery_utils_components/FefferyResizable.py +39 -0
  14. package/build/lib/feffery_utils_components/FefferyScroll.py +57 -0
  15. package/build/lib/feffery_utils_components/FefferyScrollbars.py +51 -0
  16. package/build/lib/feffery_utils_components/FefferyShortcutPanel.py +53 -0
  17. package/build/lib/feffery_utils_components/FefferySplit.py +59 -0
  18. package/build/lib/feffery_utils_components/FefferySplitPane.py +50 -0
  19. package/build/lib/feffery_utils_components/FefferySyntaxHighlighter.py +54 -0
  20. package/build/lib/feffery_utils_components/FefferyTopProgress.py +70 -0
  21. package/build/lib/feffery_utils_components/FefferyUtilsComponents.py +40 -0
  22. package/build/lib/feffery_utils_components/FefferyWaterMark.py +64 -0
  23. package/build/lib/feffery_utils_components/__init__.py +89 -0
  24. package/build/lib/feffery_utils_components/_imports_.py +29 -0
  25. package/build/lib/feffery_utils_components/feffery_utils_components.min.js +429 -0
  26. package/build/lib/feffery_utils_components/metadata.json +1339 -0
  27. package/build/lib/feffery_utils_components/package-info.json +85 -0
  28. package/demo.py +117 -0
  29. package/feffery_utils_components/FefferyDiv.py +15 -3
  30. package/feffery_utils_components/FefferyLazyLoad.py +53 -0
  31. package/feffery_utils_components/FefferyLocation.py +52 -0
  32. package/feffery_utils_components/FefferyVirtualList.py +47 -0
  33. package/feffery_utils_components/_imports_.py +6 -0
  34. package/feffery_utils_components/feffery_utils_components.min.js +8 -8
  35. package/feffery_utils_components/metadata.json +328 -0
  36. package/feffery_utils_components/package-info.json +4 -2
  37. package/package.json +4 -2
  38. package/src/FefferyUtilsComponents.jl +6 -3
  39. package/src/jl/''_fefferydiv.jl +7 -1
  40. package/src/jl/''_fefferylazyload.jl +35 -0
  41. package/src/jl/''_fefferylocation.jl +26 -0
  42. package/src/jl/''_fefferyvirtuallist.jl +32 -0
  43. package/src/lib/components/FefferyDiv.react.js +52 -0
  44. package/src/lib/components/FefferyLazyLoad.react.js +100 -0
  45. package/src/lib/components/FefferyLocation.react.js +161 -0
  46. package/src/lib/components/FefferyVirtualList.react.js +84 -0
  47. package/src/lib/index.js +7 -1
  48. package/usage.py +10 -0
@@ -230,6 +230,74 @@
230
230
  "required": false,
231
231
  "description": ""
232
232
  },
233
+ "mouseEnterCounts": {
234
+ "type": {
235
+ "name": "custom",
236
+ "raw": "PropTypes.number"
237
+ },
238
+ "required": false,
239
+ "description": "",
240
+ "defaultValue": {
241
+ "value": "0",
242
+ "computed": false
243
+ }
244
+ },
245
+ "mouseLeaveCounts": {
246
+ "type": {
247
+ "name": "custom",
248
+ "raw": "PropTypes.number"
249
+ },
250
+ "required": false,
251
+ "description": "",
252
+ "defaultValue": {
253
+ "value": "0",
254
+ "computed": false
255
+ }
256
+ },
257
+ "nClicks": {
258
+ "type": {
259
+ "name": "custom",
260
+ "raw": "PropTypes.number"
261
+ },
262
+ "required": false,
263
+ "description": "",
264
+ "defaultValue": {
265
+ "value": "0",
266
+ "computed": false
267
+ }
268
+ },
269
+ "nDoubleClicks": {
270
+ "type": {
271
+ "name": "custom",
272
+ "raw": "PropTypes.number"
273
+ },
274
+ "required": false,
275
+ "description": "",
276
+ "defaultValue": {
277
+ "value": "0",
278
+ "computed": false
279
+ }
280
+ },
281
+ "enableListenContextMenu": {
282
+ "type": {
283
+ "name": "custom",
284
+ "raw": "PropTypes.bool"
285
+ },
286
+ "required": false,
287
+ "description": "",
288
+ "defaultValue": {
289
+ "value": "false",
290
+ "computed": false
291
+ }
292
+ },
293
+ "contextMenuEvent": {
294
+ "type": {
295
+ "name": "custom",
296
+ "raw": "PropTypes.exact({\r\n // \u5728\u9875\u9762\u4e2d\u7684x\u5750\u6807\r\n pageX: PropTypes.number,\r\n // \u5728\u9875\u9762\u4e2d\u7684y\u5750\u6807\r\n pageY: PropTypes.number,\r\n // \u70b9\u51fb\u4e8b\u4ef6\u5bf9\u5e94\u7684\u65f6\u95f4\u6233\r\n timestamp: PropTypes.number\r\n})"
297
+ },
298
+ "required": false,
299
+ "description": ""
300
+ },
233
301
  "setProps": {
234
302
  "type": {
235
303
  "name": "custom",
@@ -561,6 +629,195 @@
561
629
  }
562
630
  }
563
631
  },
632
+ "src/lib/components/FefferyLazyLoad.react.js": {
633
+ "description": "",
634
+ "displayName": "FefferyLazyLoad",
635
+ "methods": [],
636
+ "props": {
637
+ "id": {
638
+ "type": {
639
+ "name": "custom",
640
+ "raw": "PropTypes.string"
641
+ },
642
+ "required": false,
643
+ "description": ""
644
+ },
645
+ "children": {
646
+ "type": {
647
+ "name": "custom",
648
+ "raw": "PropTypes.node"
649
+ },
650
+ "required": false,
651
+ "description": ""
652
+ },
653
+ "style": {
654
+ "type": {
655
+ "name": "custom",
656
+ "raw": "PropTypes.object"
657
+ },
658
+ "required": false,
659
+ "description": ""
660
+ },
661
+ "className": {
662
+ "type": {
663
+ "name": "custom",
664
+ "raw": "PropTypes.string"
665
+ },
666
+ "required": false,
667
+ "description": ""
668
+ },
669
+ "height": {
670
+ "type": {
671
+ "name": "custom",
672
+ "raw": "PropTypes.oneOfType([\r\n PropTypes.number,\r\n PropTypes.string\r\n])"
673
+ },
674
+ "required": false,
675
+ "description": ""
676
+ },
677
+ "width": {
678
+ "type": {
679
+ "name": "custom",
680
+ "raw": "PropTypes.oneOfType([\r\n PropTypes.number,\r\n PropTypes.string\r\n])"
681
+ },
682
+ "required": false,
683
+ "description": ""
684
+ },
685
+ "offset": {
686
+ "type": {
687
+ "name": "custom",
688
+ "raw": "PropTypes.number"
689
+ },
690
+ "required": false,
691
+ "description": ""
692
+ },
693
+ "visible": {
694
+ "type": {
695
+ "name": "custom",
696
+ "raw": "PropTypes.bool"
697
+ },
698
+ "required": false,
699
+ "description": "",
700
+ "defaultValue": {
701
+ "value": "false",
702
+ "computed": false
703
+ }
704
+ },
705
+ "throttle": {
706
+ "type": {
707
+ "name": "custom",
708
+ "raw": "PropTypes.number"
709
+ },
710
+ "required": false,
711
+ "description": ""
712
+ },
713
+ "setProps": {
714
+ "type": {
715
+ "name": "custom",
716
+ "raw": "PropTypes.func"
717
+ },
718
+ "required": false,
719
+ "description": "Dash-assigned callback that should be called to report property changes\r\nto Dash, to make them available for callbacks."
720
+ },
721
+ "loading_state": {
722
+ "type": {
723
+ "name": "custom",
724
+ "raw": "PropTypes.shape({\r\n /**\r\n * Determines if the component is loading or not\r\n */\r\n is_loading: PropTypes.bool,\r\n /**\r\n * Holds which property is loading\r\n */\r\n prop_name: PropTypes.string,\r\n /**\r\n * Holds the name of the component that is loading\r\n */\r\n component_name: PropTypes.string\r\n})"
725
+ },
726
+ "required": false,
727
+ "description": ""
728
+ }
729
+ }
730
+ },
731
+ "src/lib/components/FefferyLocation.react.js": {
732
+ "description": "",
733
+ "displayName": "FefferyLocation",
734
+ "methods": [
735
+ {
736
+ "name": "updateLocation",
737
+ "docblock": null,
738
+ "modifiers": [],
739
+ "params": [
740
+ {
741
+ "name": "props",
742
+ "type": null
743
+ }
744
+ ],
745
+ "returns": null
746
+ },
747
+ {
748
+ "name": "onLocationChange",
749
+ "docblock": null,
750
+ "modifiers": [],
751
+ "params": [],
752
+ "returns": null
753
+ }
754
+ ],
755
+ "props": {
756
+ "id": {
757
+ "type": {
758
+ "name": "string"
759
+ },
760
+ "required": true,
761
+ "description": "The ID of this component, used to identify dash components\r\nin callbacks. The ID needs to be unique across all of the\r\ncomponents in an app."
762
+ },
763
+ "pathname": {
764
+ "type": {
765
+ "name": "string"
766
+ },
767
+ "required": false,
768
+ "description": "pathname in window.location - e.g., \"/my/full/pathname\""
769
+ },
770
+ "search": {
771
+ "type": {
772
+ "name": "string"
773
+ },
774
+ "required": false,
775
+ "description": "search in window.location - e.g., \"?myargument=1\""
776
+ },
777
+ "hash": {
778
+ "type": {
779
+ "name": "string"
780
+ },
781
+ "required": false,
782
+ "description": "hash in window.location - e.g., \"#myhash\""
783
+ },
784
+ "href": {
785
+ "type": {
786
+ "name": "string"
787
+ },
788
+ "required": false,
789
+ "description": "href in window.location - e.g., \"/my/full/pathname?myargument=1#myhash\""
790
+ },
791
+ "refresh": {
792
+ "type": {
793
+ "name": "bool"
794
+ },
795
+ "required": false,
796
+ "description": "Refresh the page when the location is updated?",
797
+ "defaultValue": {
798
+ "value": "true",
799
+ "computed": false
800
+ }
801
+ },
802
+ "includePathnames": {
803
+ "type": {
804
+ "name": "arrayOf",
805
+ "value": {
806
+ "name": "string"
807
+ }
808
+ },
809
+ "required": false,
810
+ "description": ""
811
+ },
812
+ "setProps": {
813
+ "type": {
814
+ "name": "func"
815
+ },
816
+ "required": false,
817
+ "description": "Dash-assigned callback that gets fired when the value changes."
818
+ }
819
+ }
820
+ },
564
821
  "src/lib/components/FefferyScroll.react.js": {
565
822
  "description": "",
566
823
  "displayName": "FefferyScroll",
@@ -1147,6 +1404,77 @@
1147
1404
  }
1148
1405
  }
1149
1406
  },
1407
+ "src/lib/components/FefferyVirtualList.react.js": {
1408
+ "description": "",
1409
+ "displayName": "FefferyVirtualList",
1410
+ "methods": [],
1411
+ "props": {
1412
+ "id": {
1413
+ "type": {
1414
+ "name": "custom",
1415
+ "raw": "PropTypes.string"
1416
+ },
1417
+ "required": false,
1418
+ "description": ""
1419
+ },
1420
+ "children": {
1421
+ "type": {
1422
+ "name": "custom",
1423
+ "raw": "PropTypes.node"
1424
+ },
1425
+ "required": false,
1426
+ "description": ""
1427
+ },
1428
+ "style": {
1429
+ "type": {
1430
+ "name": "custom",
1431
+ "raw": "PropTypes.object"
1432
+ },
1433
+ "required": false,
1434
+ "description": ""
1435
+ },
1436
+ "className": {
1437
+ "type": {
1438
+ "name": "custom",
1439
+ "raw": "PropTypes.string"
1440
+ },
1441
+ "required": false,
1442
+ "description": ""
1443
+ },
1444
+ "height": {
1445
+ "type": {
1446
+ "name": "custom",
1447
+ "raw": "PropTypes.number.isRequired"
1448
+ },
1449
+ "required": false,
1450
+ "description": ""
1451
+ },
1452
+ "itemHeight": {
1453
+ "type": {
1454
+ "name": "custom",
1455
+ "raw": "PropTypes.number.isRequired"
1456
+ },
1457
+ "required": false,
1458
+ "description": ""
1459
+ },
1460
+ "setProps": {
1461
+ "type": {
1462
+ "name": "custom",
1463
+ "raw": "PropTypes.func"
1464
+ },
1465
+ "required": false,
1466
+ "description": "Dash-assigned callback that should be called to report property changes\r\nto Dash, to make them available for callbacks."
1467
+ },
1468
+ "loading_state": {
1469
+ "type": {
1470
+ "name": "custom",
1471
+ "raw": "PropTypes.shape({\r\n /**\r\n * Determines if the component is loading or not\r\n */\r\n is_loading: PropTypes.bool,\r\n /**\r\n * Holds which property is loading\r\n */\r\n prop_name: PropTypes.string,\r\n /**\r\n * Holds the name of the component that is loading\r\n */\r\n component_name: PropTypes.string\r\n})"
1472
+ },
1473
+ "required": false,
1474
+ "description": ""
1475
+ }
1476
+ }
1477
+ },
1150
1478
  "src/lib/components/split/FefferySplit.react.js": {
1151
1479
  "description": "",
1152
1480
  "displayName": "FefferySplit",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "feffery_utils_components",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "Utility augments components of Dash!",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,10 +30,12 @@
30
30
  "ninja-keys": "^1.1.12",
31
31
  "nprogress": "^0.2.0",
32
32
  "ramda": "^0.26.1",
33
+ "rc-virtual-list": "^3.4.8",
33
34
  "react-captcha-code": "^1.0.7",
34
35
  "react-color": "^2.19.3",
35
36
  "react-copy-to-clipboard": "^5.0.4",
36
37
  "react-icons": "^4.3.1",
38
+ "react-lazy-load": "^3.1.14",
37
39
  "react-resize-detector": "^7.1.2",
38
40
  "react-scroll": "^1.8.6",
39
41
  "react-spinners-kit": "^1.9.1",
@@ -46,7 +48,7 @@
46
48
  "@babel/plugin-proposal-object-rest-spread": "^7.5.4",
47
49
  "@babel/preset-env": "^7.5.4",
48
50
  "@babel/preset-react": "^7.0.0",
49
- "@plotly/dash-component-plugins": "^1.2.0",
51
+ "@plotly/dash-component-plugins": "^1.2.3",
50
52
  "@plotly/webpack-dash-dynamic-import": "^1.2.0",
51
53
  "babel-eslint": "^10.0.2",
52
54
  "babel-loader": "^8.0.6",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "feffery_utils_components",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "Utility augments components of Dash!",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,10 +30,12 @@
30
30
  "ninja-keys": "^1.1.12",
31
31
  "nprogress": "^0.2.0",
32
32
  "ramda": "^0.26.1",
33
+ "rc-virtual-list": "^3.4.8",
33
34
  "react-captcha-code": "^1.0.7",
34
35
  "react-color": "^2.19.3",
35
36
  "react-copy-to-clipboard": "^5.0.4",
36
37
  "react-icons": "^4.3.1",
38
+ "react-lazy-load": "^3.1.14",
37
39
  "react-resize-detector": "^7.1.2",
38
40
  "react-scroll": "^1.8.6",
39
41
  "react-spinners-kit": "^1.9.1",
@@ -46,7 +48,7 @@
46
48
  "@babel/plugin-proposal-object-rest-spread": "^7.5.4",
47
49
  "@babel/preset-env": "^7.5.4",
48
50
  "@babel/preset-react": "^7.0.0",
49
- "@plotly/dash-component-plugins": "^1.2.0",
51
+ "@plotly/dash-component-plugins": "^1.2.3",
50
52
  "@plotly/webpack-dash-dynamic-import": "^1.2.0",
51
53
  "babel-eslint": "^10.0.2",
52
54
  "babel-loader": "^8.0.6",
@@ -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.0.13"
6
+ const version = "0.0.14"
7
7
 
8
8
  include("jl/''_fefferycirclecolorpicker.jl")
9
9
  include("jl/''_fefferycaptcha.jl")
@@ -11,11 +11,14 @@ include("jl/''_fefferydiv.jl")
11
11
  include("jl/''_fefferyexecutejs.jl")
12
12
  include("jl/''_fefferyextraspinner.jl")
13
13
  include("jl/''_fefferyguide.jl")
14
+ include("jl/''_fefferylazyload.jl")
15
+ include("jl/''_fefferylocation.jl")
14
16
  include("jl/''_fefferyscroll.jl")
15
17
  include("jl/''_fefferyscrollbars.jl")
16
18
  include("jl/''_fefferyshortcutpanel.jl")
17
19
  include("jl/''_fefferysyntaxhighlighter.jl")
18
20
  include("jl/''_fefferytopprogress.jl")
21
+ include("jl/''_fefferyvirtuallist.jl")
19
22
  include("jl/''_fefferysplit.jl")
20
23
  include("jl/''_fefferysplitpane.jl")
21
24
 
@@ -28,14 +31,14 @@ function __init__()
28
31
  [
29
32
  DashBase.Resource(
30
33
  relative_package_path = "feffery_utils_components.min.js",
31
- external_url = "https://unpkg.com/feffery_utils_components@0.0.13/feffery_utils_components/feffery_utils_components.min.js",
34
+ external_url = "https://unpkg.com/feffery_utils_components@0.0.14/feffery_utils_components/feffery_utils_components.min.js",
32
35
  dynamic = nothing,
33
36
  async = nothing,
34
37
  type = :js
35
38
  ),
36
39
  DashBase.Resource(
37
40
  relative_package_path = "feffery_utils_components.min.js.map",
38
- external_url = "https://unpkg.com/feffery_utils_components@0.0.13/feffery_utils_components/feffery_utils_components.min.js.map",
41
+ external_url = "https://unpkg.com/feffery_utils_components@0.0.14/feffery_utils_components/feffery_utils_components.min.js.map",
39
42
  dynamic = true,
40
43
  async = nothing,
41
44
  type = :js
@@ -16,13 +16,19 @@ Keyword arguments:
16
16
  - `_height` (optional)
17
17
  - `_width` (optional)
18
18
  - `className` (optional)
19
+ - `contextMenuEvent` (optional)
20
+ - `enableListenContextMenu` (optional)
19
21
  - `loading_state` (optional)
22
+ - `mouseEnterCounts` (optional)
23
+ - `mouseLeaveCounts` (optional)
24
+ - `nClicks` (optional)
25
+ - `nDoubleClicks` (optional)
20
26
  - `setProps` (optional): Dash-assigned callback that should be called to report property changes
21
27
  to Dash, to make them available for callbacks.
22
28
  - `style` (optional)
23
29
  """
24
30
  function ''_fefferydiv(; kwargs...)
25
- available_props = Symbol[:children, :id, :_height, :_width, :className, :loading_state, :style]
31
+ available_props = Symbol[:children, :id, :_height, :_width, :className, :contextMenuEvent, :enableListenContextMenu, :loading_state, :mouseEnterCounts, :mouseLeaveCounts, :nClicks, :nDoubleClicks, :style]
26
32
  wild_props = Symbol[]
27
33
  return Component("''_fefferydiv", "FefferyDiv", "feffery_utils_components", available_props, wild_props; kwargs...)
28
34
  end
@@ -0,0 +1,35 @@
1
+ # AUTO GENERATED FILE - DO NOT EDIT
2
+
3
+ export ''_fefferylazyload
4
+
5
+ """
6
+ ''_fefferylazyload(;kwargs...)
7
+ ''_fefferylazyload(children::Any;kwargs...)
8
+ ''_fefferylazyload(children_maker::Function;kwargs...)
9
+
10
+
11
+ A FefferyLazyLoad component.
12
+
13
+ Keyword arguments:
14
+ - `children` (optional)
15
+ - `id` (optional)
16
+ - `className` (optional)
17
+ - `height` (optional)
18
+ - `loading_state` (optional)
19
+ - `offset` (optional)
20
+ - `setProps` (optional): Dash-assigned callback that should be called to report property changes
21
+ to Dash, to make them available for callbacks.
22
+ - `style` (optional)
23
+ - `throttle` (optional)
24
+ - `visible` (optional)
25
+ - `width` (optional)
26
+ """
27
+ function ''_fefferylazyload(; kwargs...)
28
+ available_props = Symbol[:children, :id, :className, :height, :loading_state, :offset, :style, :throttle, :visible, :width]
29
+ wild_props = Symbol[]
30
+ return Component("''_fefferylazyload", "FefferyLazyLoad", "feffery_utils_components", available_props, wild_props; kwargs...)
31
+ end
32
+
33
+ ''_fefferylazyload(children::Any; kwargs...) = ''_fefferylazyload(;kwargs..., children = children)
34
+ ''_fefferylazyload(children_maker::Function; kwargs...) = ''_fefferylazyload(children_maker(); kwargs...)
35
+
@@ -0,0 +1,26 @@
1
+ # AUTO GENERATED FILE - DO NOT EDIT
2
+
3
+ export ''_fefferylocation
4
+
5
+ """
6
+ ''_fefferylocation(;kwargs...)
7
+
8
+ A FefferyLocation component.
9
+
10
+ Keyword arguments:
11
+ - `id` (String; required): The ID of this component, used to identify dash components
12
+ in callbacks. The ID needs to be unique across all of the
13
+ components in an app.
14
+ - `hash` (String; optional): hash in window.location - e.g., "#myhash"
15
+ - `href` (String; optional): href in window.location - e.g., "/my/full/pathname?myargument=1#myhash"
16
+ - `includePathnames` (Array of Strings; optional)
17
+ - `pathname` (String; optional): pathname in window.location - e.g., "/my/full/pathname"
18
+ - `refresh` (Bool; optional): Refresh the page when the location is updated?
19
+ - `search` (String; optional): search in window.location - e.g., "?myargument=1"
20
+ """
21
+ function ''_fefferylocation(; kwargs...)
22
+ available_props = Symbol[:id, :hash, :href, :includePathnames, :pathname, :refresh, :search]
23
+ wild_props = Symbol[]
24
+ return Component("''_fefferylocation", "FefferyLocation", "feffery_utils_components", available_props, wild_props; kwargs...)
25
+ end
26
+
@@ -0,0 +1,32 @@
1
+ # AUTO GENERATED FILE - DO NOT EDIT
2
+
3
+ export ''_fefferyvirtuallist
4
+
5
+ """
6
+ ''_fefferyvirtuallist(;kwargs...)
7
+ ''_fefferyvirtuallist(children::Any;kwargs...)
8
+ ''_fefferyvirtuallist(children_maker::Function;kwargs...)
9
+
10
+
11
+ A FefferyVirtualList component.
12
+
13
+ Keyword arguments:
14
+ - `children` (optional)
15
+ - `id` (optional)
16
+ - `className` (optional)
17
+ - `height` (optional)
18
+ - `itemHeight` (optional)
19
+ - `loading_state` (optional)
20
+ - `setProps` (optional): Dash-assigned callback that should be called to report property changes
21
+ to Dash, to make them available for callbacks.
22
+ - `style` (optional)
23
+ """
24
+ function ''_fefferyvirtuallist(; kwargs...)
25
+ available_props = Symbol[:children, :id, :className, :height, :itemHeight, :loading_state, :style]
26
+ wild_props = Symbol[]
27
+ return Component("''_fefferyvirtuallist", "FefferyVirtualList", "feffery_utils_components", available_props, wild_props; kwargs...)
28
+ end
29
+
30
+ ''_fefferyvirtuallist(children::Any; kwargs...) = ''_fefferyvirtuallist(;kwargs..., children = children)
31
+ ''_fefferyvirtuallist(children_maker::Function; kwargs...) = ''_fefferyvirtuallist(children_maker(); kwargs...)
32
+
@@ -9,6 +9,11 @@ const FefferyDiv = (props) => {
9
9
  children,
10
10
  style,
11
11
  className,
12
+ mouseEnterCounts,
13
+ mouseLeaveCounts,
14
+ nClicks,
15
+ nDoubleClicks,
16
+ enableListenContextMenu,
12
17
  setProps,
13
18
  loading_state
14
19
  } = props;
@@ -31,6 +36,22 @@ const FefferyDiv = (props) => {
31
36
  style={style}
32
37
  className={className}
33
38
  ref={ref}
39
+ onClick={() => setProps({ nClicks: nClicks + 1 })}
40
+ onDoubleClick={() => setProps({ nDoubleClicks: nDoubleClicks + 1 })}
41
+ onContextMenu={(e) => {
42
+ if (enableListenContextMenu) {
43
+ e.preventDefault()
44
+ setProps({
45
+ contextMenuEvent: {
46
+ pageX: e.pageX,
47
+ pageY: e.pageY,
48
+ timestamp: Date.now()
49
+ }
50
+ })
51
+ }
52
+ }}
53
+ onMouseEnter={() => setProps({ mouseEnterCounts: mouseEnterCounts + 1 })}
54
+ onMouseLeave={() => setProps({ mouseLeaveCounts: mouseLeaveCounts + 1 })}
34
55
  data-dash-is-loading={
35
56
  (loading_state && loading_state.is_loading) || undefined
36
57
  } >
@@ -56,6 +77,32 @@ FefferyDiv.propTypes = {
56
77
  // 监听容器像素高度变化
57
78
  _height: PropTypes.number,
58
79
 
80
+ // 监听鼠标移入事件次数,初始化为0
81
+ mouseEnterCounts: PropTypes.number,
82
+
83
+ // 监听鼠标移出事件次数,初始化为0
84
+ mouseLeaveCounts: PropTypes.number,
85
+
86
+ // 监听单击事件次数,初始化为0
87
+ nClicks: PropTypes.number,
88
+
89
+ // 监听双击事件次数,初始化为0
90
+ nDoubleClicks: PropTypes.number,
91
+
92
+ // 设置是否针对当前div监听右键点击事件,开启后会强制关闭当前div内的默认右键菜单弹出
93
+ // 默认为false
94
+ enableListenContextMenu: PropTypes.bool,
95
+
96
+ // 监听右键事件
97
+ contextMenuEvent: PropTypes.exact({
98
+ // 在页面中的x坐标
99
+ pageX: PropTypes.number,
100
+ // 在页面中的y坐标
101
+ pageY: PropTypes.number,
102
+ // 点击事件对应的时间戳
103
+ timestamp: PropTypes.number
104
+ }),
105
+
59
106
  /**
60
107
  * Dash-assigned callback that should be called to report property changes
61
108
  * to Dash, to make them available for callbacks.
@@ -80,6 +127,11 @@ FefferyDiv.propTypes = {
80
127
 
81
128
  // 设置默认参数
82
129
  FefferyDiv.defaultProps = {
130
+ mouseEnterCounts: 0,
131
+ mouseLeaveCounts: 0,
132
+ nClicks: 0,
133
+ nDoubleClicks: 0,
134
+ enableListenContextMenu: false
83
135
  }
84
136
 
85
137
  export default FefferyDiv;