wargerm 0.7.91 → 0.7.93

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.
@@ -1,9 +1,23 @@
1
1
  import React, { MutableRefObject } from 'react';
2
2
  import { FormInstance } from 'antd';
3
+ import { WFormProps } from '../WForm';
3
4
  export interface IFormInstance extends MutableRefObject<FormInstance> {
4
5
  handleSubmit?: () => void;
5
6
  resetFields?: () => void;
6
- setFieldsValue?: (record: Record<string, any>) => void;
7
+ setFieldsValue?: (record?: Record<string, any>) => void;
7
8
  }
8
- declare const _default: React.ForwardRefExoticComponent<Omit<Record<string, any>, "ref"> & React.RefAttributes<unknown>>;
9
+ interface IProps extends WFormProps {
10
+ open: boolean;
11
+ setOpen: (value: any) => void;
12
+ modalFormOpend?: (value: any) => void;
13
+ submitMethod?: (value: any, done: () => void) => Promise<void>;
14
+ onSubmitSuccess?: () => Promise<void>;
15
+ record?: Record<string, any>;
16
+ formItemChild?: () => React.ReactNode;
17
+ onCancel?: () => void;
18
+ modalHeaderSlot?: React.ReactNode;
19
+ modalFooterSlot?: React.ReactNode;
20
+ formProps?: Omit<WFormProps, 'columns'>;
21
+ }
22
+ declare const _default: React.ForwardRefExoticComponent<IProps & React.RefAttributes<unknown>>;
9
23
  export default _default;
@@ -1,3 +1,54 @@
1
- import React from 'react';
2
- declare const _default: React.ForwardRefExoticComponent<Omit<Record<string, any>, "ref"> & React.RefAttributes<unknown>>;
1
+ import React, { MutableRefObject } from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { ProTableProps } from '@ant-design/pro-table';
4
+ import { ColumnProps, Isearch } from '../WForm';
5
+ type CustomType = {
6
+ type: 'custom';
7
+ title: ReactNode;
8
+ icon: ReactNode;
9
+ key: string;
10
+ fetchInfo?: (record?: Record<string, any>) => Promise<any>;
11
+ actionMethod?: (values: Record<string, any>, done: () => void, record?: Record<string, any>) => Promise<any>;
12
+ };
13
+ type ItableAction = {
14
+ type: 'edit' | 'view' | 'delete' | 'extraAction';
15
+ formItemChild?: (record: Record<string, any>, actionRef: MutableRefObject<any>, index: number) => ReactNode;
16
+ actionMethod?: (values: Record<string, any>, done: () => void, record?: Record<string, any>) => Promise<any>;
17
+ fetchInfo?: (record?: Record<string, any>) => Promise<any>;
18
+ actionRender?: (record: Record<string, any>, actionRef: MutableRefObject<any>, onOk: () => void, index: number) => ReactNode;
19
+ };
20
+ interface ItableBar {
21
+ type: 'add' | 'extraAction';
22
+ actionMethod?: (values: Record<string, any>, done: () => void) => Promise<any>;
23
+ render?: (record: Record<string, any>) => ReactNode;
24
+ actionRender?: (record: Record<string, any>, onOk?: () => void) => ReactNode;
25
+ }
26
+ interface ItableBarCustom {
27
+ type: 'custom';
28
+ title: ReactNode;
29
+ icon: ReactNode;
30
+ key: string;
31
+ actionMethod?: (values: Record<string, any>, done: () => void) => Promise<any>;
32
+ }
33
+ interface IoptionColumnConfig extends ColumnProps {
34
+ showMoreNum?: number;
35
+ }
36
+ interface ITableCard extends ProTableProps<Record<string, any>[], Record<string, any>> {
37
+ modalFormSearch?: Isearch;
38
+ search?: Isearch;
39
+ modalConfig?: Record<string, any>;
40
+ searchFormConfig?: Record<string, any>;
41
+ optionColumnConfig?: IoptionColumnConfig;
42
+ request?: (params: Record<string, any>) => Promise<any>;
43
+ tableAction?: Array<ItableAction | CustomType>;
44
+ filterAction?: (record: Record<string, any>, item: Record<string, any>) => boolean;
45
+ renderTableBar?: Array<ItableBar | ItableBarCustom>;
46
+ renderTableBarDeps?: any;
47
+ extraColumns?: Array<any>;
48
+ onFormChange?: (changedValues: Record<string, any>, allValues: Record<string, any>, form: any) => void;
49
+ noBordered?: boolean;
50
+ searchTableSlot?: ReactNode;
51
+ showIndex?: boolean;
52
+ }
53
+ declare const _default: React.ForwardRefExoticComponent<ITableCard & React.RefAttributes<any>>;
3
54
  export default _default;
@@ -11,6 +11,7 @@ type propsType = {
11
11
  layoutIndex?: number;
12
12
  config?: Record<any, any>;
13
13
  url?: string[];
14
+ type?: string;
14
15
  };
15
16
  declare const _default: React.ForwardRefExoticComponent<propsType & React.RefAttributes<unknown>>;
16
17
  export default _default;
package/dist/index.esm.js CHANGED
@@ -6944,7 +6944,7 @@ var ModalForm = function ModalForm(props, ref) {
6944
6944
  setFormIntance(form);
6945
6945
  };
6946
6946
  useEffect(function () {
6947
- if (formIntance) {
6947
+ if (formIntance && record) {
6948
6948
  setFieldsValue(record);
6949
6949
  }
6950
6950
  }, [open, record, formIntance]);
@@ -8514,7 +8514,9 @@ HlsJsPlayer.HlsJs = Hls;
8514
8514
  function Xgplay(_ref, fRef) {
8515
8515
  var config = _ref.config,
8516
8516
  type = _ref.type,
8517
- setRef = _ref.setRef;
8517
+ setRef = _ref.setRef,
8518
+ _ref$blobType = _ref.blobType,
8519
+ blobType = _ref$blobType === void 0 ? 'm3u8' : _ref$blobType;
8518
8520
  var ref = useRef(null);
8519
8521
  var playerRef = useRef(null);
8520
8522
  useEffect(function () {
@@ -8522,7 +8524,7 @@ function Xgplay(_ref, fRef) {
8522
8524
  config.onRequestFullscreen && config.onRequestFullscreen();
8523
8525
  };
8524
8526
  if (ref.current) {
8525
- if ((type === null || type === void 0 ? void 0 : type.indexOf('m3u8')) !== -1) {
8527
+ if (blobType == 'm3u8') {
8526
8528
  playerRef.current = new HlsJsPlayer(_objectSpread2({
8527
8529
  el: ref.current,
8528
8530
  width: '100%',
@@ -8532,7 +8534,7 @@ function Xgplay(_ref, fRef) {
8532
8534
  autoplayMuted: true
8533
8535
  }, config));
8534
8536
  setRef(playerRef.current);
8535
- } else if ((type === null || type === void 0 ? void 0 : type.indexOf('flv')) !== -1) {
8537
+ } else if (blobType == 'flv') {
8536
8538
  playerRef.current = new FlvPlayer(_objectSpread2({
8537
8539
  el: ref.current,
8538
8540
  width: '100%',
@@ -8553,7 +8555,7 @@ function Xgplay(_ref, fRef) {
8553
8555
  }
8554
8556
  }, config));
8555
8557
  setRef(playerRef.current);
8556
- } else if ((type === null || type === void 0 ? void 0 : type.indexOf('mp4')) !== -1) {
8558
+ } else if (blobType == 'mp4') {
8557
8559
  playerRef.current = new Player(_objectSpread2({
8558
8560
  el: ref.current,
8559
8561
  width: '100%',
@@ -8635,6 +8637,7 @@ function VideoPlayer$1(_ref, ref) {
8635
8637
  url = _ref$url === void 0 ? [] : _ref$url,
8636
8638
  onPlayerClose = _ref.onPlayerClose,
8637
8639
  onChange = _ref.onChange,
8640
+ type = _ref.type,
8638
8641
  _ref$layouts = _ref.layouts,
8639
8642
  layouts = _ref$layouts === void 0 ? basicLayouts : _ref$layouts;
8640
8643
  var allLayouts = layouts;
@@ -8700,6 +8703,7 @@ function VideoPlayer$1(_ref, ref) {
8700
8703
  return players;
8701
8704
  });
8702
8705
  },
8706
+ blobType: type,
8703
8707
  type: urls[index],
8704
8708
  config: _objectSpread2(_objectSpread2({
8705
8709
  url: urls[index],
package/dist/index.js CHANGED
@@ -6987,7 +6987,7 @@ var ModalForm = function ModalForm(props, ref) {
6987
6987
  setFormIntance(form);
6988
6988
  };
6989
6989
  React.useEffect(function () {
6990
- if (formIntance) {
6990
+ if (formIntance && record) {
6991
6991
  setFieldsValue(record);
6992
6992
  }
6993
6993
  }, [open, record, formIntance]);
@@ -8557,7 +8557,9 @@ HlsJsPlayer.HlsJs = Hls__default['default'];
8557
8557
  function Xgplay(_ref, fRef) {
8558
8558
  var config = _ref.config,
8559
8559
  type = _ref.type,
8560
- setRef = _ref.setRef;
8560
+ setRef = _ref.setRef,
8561
+ _ref$blobType = _ref.blobType,
8562
+ blobType = _ref$blobType === void 0 ? 'm3u8' : _ref$blobType;
8561
8563
  var ref = React.useRef(null);
8562
8564
  var playerRef = React.useRef(null);
8563
8565
  React.useEffect(function () {
@@ -8565,7 +8567,7 @@ function Xgplay(_ref, fRef) {
8565
8567
  config.onRequestFullscreen && config.onRequestFullscreen();
8566
8568
  };
8567
8569
  if (ref.current) {
8568
- if ((type === null || type === void 0 ? void 0 : type.indexOf('m3u8')) !== -1) {
8570
+ if (blobType == 'm3u8') {
8569
8571
  playerRef.current = new HlsJsPlayer(_objectSpread2({
8570
8572
  el: ref.current,
8571
8573
  width: '100%',
@@ -8575,7 +8577,7 @@ function Xgplay(_ref, fRef) {
8575
8577
  autoplayMuted: true
8576
8578
  }, config));
8577
8579
  setRef(playerRef.current);
8578
- } else if ((type === null || type === void 0 ? void 0 : type.indexOf('flv')) !== -1) {
8580
+ } else if (blobType == 'flv') {
8579
8581
  playerRef.current = new FlvPlayer__default['default'](_objectSpread2({
8580
8582
  el: ref.current,
8581
8583
  width: '100%',
@@ -8596,7 +8598,7 @@ function Xgplay(_ref, fRef) {
8596
8598
  }
8597
8599
  }, config));
8598
8600
  setRef(playerRef.current);
8599
- } else if ((type === null || type === void 0 ? void 0 : type.indexOf('mp4')) !== -1) {
8601
+ } else if (blobType == 'mp4') {
8600
8602
  playerRef.current = new Player__default['default'](_objectSpread2({
8601
8603
  el: ref.current,
8602
8604
  width: '100%',
@@ -8678,6 +8680,7 @@ function VideoPlayer$1(_ref, ref) {
8678
8680
  url = _ref$url === void 0 ? [] : _ref$url,
8679
8681
  onPlayerClose = _ref.onPlayerClose,
8680
8682
  onChange = _ref.onChange,
8683
+ type = _ref.type,
8681
8684
  _ref$layouts = _ref.layouts,
8682
8685
  layouts = _ref$layouts === void 0 ? basicLayouts : _ref$layouts;
8683
8686
  var allLayouts = layouts;
@@ -8743,6 +8746,7 @@ function VideoPlayer$1(_ref, ref) {
8743
8746
  return players;
8744
8747
  });
8745
8748
  },
8749
+ blobType: type,
8746
8750
  type: urls[index],
8747
8751
  config: _objectSpread2(_objectSpread2({
8748
8752
  url: urls[index],
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "wargerm",
4
- "version": "0.7.91",
4
+ "version": "0.7.93",
5
5
  "scripts": {
6
- "dev": "export NODE_OPTIONS=--openssl-legacy-provider && dumi dev",
7
- "docs:build": "export NODE_OPTIONS=--openssl-legacy-provider && dumi build",
8
- "docs:deploy": "gh-pages -d docs-dist",
6
+ "dev": "dumi dev",
7
+ "docs:build": "dumi build",
8
+ "docs:deploy": "export NODE_OPTIONS=--openssl-legacy-provider && gh-pages -d docs-dist",
9
9
  "build": "father-build",
10
10
  "deploy": "npm run docs:build && npm run docs:deploy",
11
11
  "release": "npm run build && npm publish",