pixuireactcomponents 1.5.12 → 1.5.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.
package/index.d.ts CHANGED
@@ -18,5 +18,6 @@ export { tools } from "./src/components/tools/tools";
18
18
  export { PreloadImg } from "./src/components/react/app/preloadImg/PreloadImg";
19
19
  export { LoadChecker } from "./src/components/tools/LoadChecker";
20
20
  export { AntiRepeat } from "./src/components/tools/antiRepeat";
21
+ export { DragList } from "./src/components/react/app/listDrag/listDrag";
21
22
  export { Slider, SliderProps } from "./src/components/react/app/slider/Slider";
22
23
  export { ImgPreLoader_base64, PreLoadPic_base64 } from "./src/components/tools/ImgPreLoader";
package/index.js CHANGED
@@ -23,3 +23,4 @@ export { tools } from './src/components/tools/tools';
23
23
  export { PreloadImg } from './src/components/react/app/preloadImg/PreloadImg';
24
24
  export { LoadChecker } from './src/components/tools/LoadChecker';
25
25
  export { AntiRepeat } from './src/components/tools/antiRepeat';
26
+ export { DragList } from './src/components/react/app/listDrag/listDrag';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixuireactcomponents",
3
- "version": "1.5.12",
3
+ "version": "1.5.14",
4
4
  "description": "pixui react components",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -41,6 +41,7 @@
41
41
  "@types/jest": "25.2.1",
42
42
  "@types/node": "13.11.1",
43
43
  "ajv": "^8.14.0",
44
+ "arale-qrcode": "^3.0.5",
44
45
  "babel-loader": "^8.1.0",
45
46
  "babel-plugin-import": "^1.12.0",
46
47
  "babel-plugin-jsx-pragmatic": "^1.0.2",
@@ -14,7 +14,7 @@ interface DragListState {
14
14
  height: number;
15
15
  hoverIndex: number | null;
16
16
  }
17
- declare class DragList extends Component<DragListProps, DragListState> {
17
+ export declare class DragList extends Component<DragListProps, DragListState> {
18
18
  constructor(props: DragListProps);
19
19
  handleMouseDown: (index: number, e: MouseEvent) => void;
20
20
  handleMouseMove: (e: MouseEvent) => void;
@@ -24,4 +24,4 @@ declare class DragList extends Component<DragListProps, DragListState> {
24
24
  getDragOverIndex: (clientX: number, clientY: number) => number | null;
25
25
  render(): h.JSX.Element;
26
26
  }
27
- export default DragList;
27
+ export {};
@@ -147,4 +147,4 @@ var DragList = /** @class */ (function (_super) {
147
147
  };
148
148
  return DragList;
149
149
  }(Component));
150
- export default DragList;
150
+ export { DragList };
@@ -0,0 +1,18 @@
1
+ import { h } from 'preact';
2
+ /**
3
+ *
4
+ * @param rootId 根节点id
5
+ * @param rootClassName 根节点className
6
+ * @param size 组件尺寸
7
+ * @param srcUrl url链接
8
+ */
9
+ export declare let QRCode: (props: {
10
+ rootId?: string;
11
+ rootClassName?: string;
12
+ size: number;
13
+ srcUrl: string;
14
+ background?: string;
15
+ foreground?: string;
16
+ image?: string;
17
+ imageSize?: number;
18
+ }) => h.JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { useEffect, useRef } from 'preact/hooks';
2
+ import { h } from 'preact';
3
+ import AraleQRCode from 'arale-qrcode';
4
+ /**
5
+ *
6
+ * @param rootId 根节点id
7
+ * @param rootClassName 根节点className
8
+ * @param size 组件尺寸
9
+ * @param srcUrl url链接
10
+ */
11
+ export var QRCode = function (props) {
12
+ var qrcodeRef = useRef(null);
13
+ useEffect(function () {
14
+ var qrcode = new AraleQRCode({
15
+ text: props.srcUrl,
16
+ size: props.size ? props.size : 100,
17
+ render: 'canvas',
18
+ background: props.background ? props.background : "#fff",
19
+ foreground: props.background ? props.foreground : "#000",
20
+ correctLevel: 1,
21
+ });
22
+ if (qrcodeRef.current) {
23
+ qrcodeRef.current.appendChild(qrcode);
24
+ }
25
+ }, []);
26
+ return (h("div", { id: props.rootId, className: props.rootClassName, ref: qrcodeRef }));
27
+ };