wargerm 0.6.21 → 0.6.23

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/dist/index.esm.js CHANGED
@@ -7,7 +7,7 @@ import 'antd/es/dropdown/style';
7
7
  import _Dropdown from 'antd/es/dropdown';
8
8
  import 'antd/es/menu/style';
9
9
  import _Menu from 'antd/es/menu';
10
- import { createFromIconfontCN, PlusOutlined, SearchOutlined, ReloadOutlined, CloseCircleOutlined, EllipsisOutlined, ExclamationCircleOutlined, EyeOutlined, EditOutlined, DeleteOutlined, LeftOutlined, RightOutlined } from '@ant-design/icons';
10
+ import { createFromIconfontCN, PlusOutlined, SearchOutlined, ReloadOutlined, CloseCircleOutlined, EllipsisOutlined, ExclamationCircleOutlined, EyeOutlined, EditOutlined, DeleteOutlined, LeftOutlined, RightOutlined, CloseOutlined } from '@ant-design/icons';
11
11
  import 'antd/es/input/style';
12
12
  import _Input from 'antd/es/input';
13
13
  import 'antd/es/modal/style';
@@ -740,6 +740,34 @@ wmox.config = function (_ref) {
740
740
  run$1 = batch;
741
741
  };
742
742
 
743
+ var useStateWithCall = function useStateWithCall(initValue) {
744
+ var ref = useRef(0);
745
+ var callFRef = useRef();
746
+ var setFuncRef = useRef();
747
+
748
+ var _useState = useState(initValue),
749
+ _useState2 = _slicedToArray(_useState, 2),
750
+ state = _useState2[0],
751
+ setState = _useState2[1];
752
+
753
+ if (!ref.current) {
754
+ ref.current = 1;
755
+
756
+ setFuncRef.current = function (newData, callF) {
757
+ callFRef.current = callF;
758
+ setState(newData);
759
+ return Promise.resolve(newData);
760
+ };
761
+ }
762
+
763
+ useEffect(function () {
764
+ var _callFRef$current;
765
+
766
+ (_callFRef$current = callFRef.current) === null || _callFRef$current === void 0 ? void 0 : _callFRef$current.call(callFRef, state);
767
+ }, [state]);
768
+ return [state, setFuncRef.current];
769
+ };
770
+
743
771
  /**
744
772
  * 补全字符
745
773
  * @param {*} num 初始值
@@ -3049,10 +3077,13 @@ var WDatePicker$1 = function WDatePicker(props) {
3049
3077
  _onChange = props.onChange,
3050
3078
  extraProps = _objectWithoutProperties(props, _excluded$6);
3051
3079
 
3052
- return /*#__PURE__*/React.createElement(_DatePicker, _objectSpread2({
3080
+ return /*#__PURE__*/React.createElement(_DatePicker, _objectSpread2(_objectSpread2({
3053
3081
  locale: zhCN,
3054
3082
  defaultValue: momentValue(defaultValue),
3055
- value: momentValue(value),
3083
+ value: momentValue(value)
3084
+ }, format ? {
3085
+ format: format
3086
+ } : {}), {}, {
3056
3087
  onChange: function onChange(v) {
3057
3088
  var _momentValue2, _momentValue3;
3058
3089
 
@@ -8322,11 +8353,24 @@ function VideoPlayer(_ref, ref) {
8322
8353
  return arr.map(function (item, index) {
8323
8354
  return /*#__PURE__*/React.createElement("div", {
8324
8355
  key: index,
8325
- className: "camera ".concat(currentPlayerIndex == index && arr.length > 1 ? 'activeCamera' : 'noneborder'),
8356
+ className: "camera pr ".concat(currentPlayerIndex == index && arr.length > 1 ? 'activeCamera' : 'noneborder'),
8326
8357
  onClickCapture: function onClickCapture() {
8327
8358
  setCurrentPlayerIndex(index);
8328
8359
  }
8329
- }, urls[index] ? /*#__PURE__*/React.createElement(Xgplay$1, {
8360
+ }, urls[index] ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
8361
+ className: "pa t5 l0 z99 w100p flex jc-sb pl10 pr10",
8362
+ style: {
8363
+ color: 'white'
8364
+ }
8365
+ }, /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement("div", {
8366
+ className: "cp delete",
8367
+ onClick: function onClick() {
8368
+ var arr = _toConsumableArray(urls);
8369
+
8370
+ arr.splice(index, 1, '');
8371
+ setUrls(arr);
8372
+ }
8373
+ }, /*#__PURE__*/React.createElement(CloseOutlined, null))), /*#__PURE__*/React.createElement(Xgplay$1, {
8330
8374
  setRef: function setRef(ref) {
8331
8375
  return setPlayers(function (players) {
8332
8376
  players[index] = ref;
@@ -8344,7 +8388,7 @@ function VideoPlayer(_ref, ref) {
8344
8388
  config.onRequestFullscreen && config.onRequestFullscreen(index);
8345
8389
  }
8346
8390
  })
8347
- }) : /*#__PURE__*/React.createElement("div", {
8391
+ })) : /*#__PURE__*/React.createElement("div", {
8348
8392
  className: "empty",
8349
8393
  onDoubleClick: function onDoubleClick() {
8350
8394
  var _domRef$current;
@@ -8352,7 +8396,7 @@ function VideoPlayer(_ref, ref) {
8352
8396
  var fullscreenElement = document.fullscreenElement;
8353
8397
  fullscreenElement ? exitFullscreen() : requestFullScreen(domRef === null || domRef === void 0 ? void 0 : (_domRef$current = domRef.current) === null || _domRef$current === void 0 ? void 0 : _domRef$current.childNodes[index]);
8354
8398
  }
8355
- }));
8399
+ }, "\u6682\u65E0\u64AD\u653E\u6E90"));
8356
8400
  });
8357
8401
  }, [currentLayoutIndex, currentPlayerIndex, playerRef, urls]);
8358
8402
 
@@ -10061,17 +10105,17 @@ function WaterLevelCharts(config) {
10061
10105
  /*
10062
10106
  * @Author: lijin
10063
10107
  * @Date: 2021-09-09 11:02:54
10064
- * @LastEditTime: 2022-12-15 17:52:15
10108
+ * @LastEditTime: 2023-02-02 09:42:57
10065
10109
  * @LastEditors: lijin
10066
10110
  * @Description:
10067
- * @FilePath: \wargerm-components\src\index.ts
10111
+ * @FilePath: \wargerm\src\index.ts
10068
10112
  * 可以输入预定的版权声明、个性签名、空行等
10069
10113
  */
10070
10114
  console.log(REACT_APP_ENV, 'REACT_APP_ENV');
10071
10115
 
10072
10116
  if (REACT_APP_ENV == 'development') {
10073
10117
  var COLOR_ATTR_NAME = 'data-prefers-color';
10074
- document.documentElement.setAttribute(COLOR_ATTR_NAME, 'nt');
10118
+ document.documentElement.setAttribute(COLOR_ATTR_NAME, 'sd');
10075
10119
  }
10076
10120
 
10077
- export { Index$b as AutoScroll, Index$d as Breadcrumb, WButton as Button, index$5 as Calendar, index$3 as Card, WCascader as Cascader, Index$4 as Checkbox, Index$a as CountUp, Index$2 as DatePicker, DragBox, index as IconFont, Index as Input, WInputNumber as InputNumber, LineEcharts, Modal, ModalForm$1 as ModalForm, Modal$1 as ModalTips, index$8 as NtTable, Index$9 as Number, NumericInput, Index$3 as Radio, index$2 as RequestRenderDom, Select, Index$c as Swiper, WSwitch as Switch, index$4 as TabelCard, index$1 as Table, Index$7 as TreeSelect, Upload, index$7 as Video, index$6 as VideoPlayer, Index$6 as WDatePicker, WForm$1 as WForm, WaterLevelCharts, WebsocketHeart, useEventEmitter, wTracing, create as whox, wmox };
10121
+ export { Index$b as AutoScroll, Index$d as Breadcrumb, WButton as Button, index$5 as Calendar, index$3 as Card, WCascader as Cascader, Index$4 as Checkbox, Index$a as CountUp, Index$2 as DatePicker, DragBox, index as IconFont, Index as Input, WInputNumber as InputNumber, LineEcharts, Modal, ModalForm$1 as ModalForm, Modal$1 as ModalTips, index$8 as NtTable, Index$9 as Number, NumericInput, Index$3 as Radio, index$2 as RequestRenderDom, Select, Index$c as Swiper, WSwitch as Switch, index$4 as TabelCard, index$1 as Table, Index$7 as TreeSelect, Upload, index$7 as Video, index$6 as VideoPlayer, Index$6 as WDatePicker, WForm$1 as WForm, WaterLevelCharts, WebsocketHeart, useEventEmitter, useStateWithCall, wTracing, create as whox, wmox };
package/dist/index.js CHANGED
@@ -805,6 +805,34 @@ wmox.config = function (_ref) {
805
805
  run$1 = batch;
806
806
  };
807
807
 
808
+ var useStateWithCall = function useStateWithCall(initValue) {
809
+ var ref = React.useRef(0);
810
+ var callFRef = React.useRef();
811
+ var setFuncRef = React.useRef();
812
+
813
+ var _useState = React.useState(initValue),
814
+ _useState2 = _slicedToArray(_useState, 2),
815
+ state = _useState2[0],
816
+ setState = _useState2[1];
817
+
818
+ if (!ref.current) {
819
+ ref.current = 1;
820
+
821
+ setFuncRef.current = function (newData, callF) {
822
+ callFRef.current = callF;
823
+ setState(newData);
824
+ return Promise.resolve(newData);
825
+ };
826
+ }
827
+
828
+ React.useEffect(function () {
829
+ var _callFRef$current;
830
+
831
+ (_callFRef$current = callFRef.current) === null || _callFRef$current === void 0 ? void 0 : _callFRef$current.call(callFRef, state);
832
+ }, [state]);
833
+ return [state, setFuncRef.current];
834
+ };
835
+
808
836
  /**
809
837
  * 补全字符
810
838
  * @param {*} num 初始值
@@ -3114,10 +3142,13 @@ var WDatePicker$1 = function WDatePicker(props) {
3114
3142
  _onChange = props.onChange,
3115
3143
  extraProps = _objectWithoutProperties(props, _excluded$6);
3116
3144
 
3117
- return /*#__PURE__*/React__default['default'].createElement(_DatePicker__default['default'], _objectSpread2({
3145
+ return /*#__PURE__*/React__default['default'].createElement(_DatePicker__default['default'], _objectSpread2(_objectSpread2({
3118
3146
  locale: zhCN__default['default'],
3119
3147
  defaultValue: momentValue(defaultValue),
3120
- value: momentValue(value),
3148
+ value: momentValue(value)
3149
+ }, format ? {
3150
+ format: format
3151
+ } : {}), {}, {
3121
3152
  onChange: function onChange(v) {
3122
3153
  var _momentValue2, _momentValue3;
3123
3154
 
@@ -8387,11 +8418,24 @@ function VideoPlayer(_ref, ref) {
8387
8418
  return arr.map(function (item, index) {
8388
8419
  return /*#__PURE__*/React__default['default'].createElement("div", {
8389
8420
  key: index,
8390
- className: "camera ".concat(currentPlayerIndex == index && arr.length > 1 ? 'activeCamera' : 'noneborder'),
8421
+ className: "camera pr ".concat(currentPlayerIndex == index && arr.length > 1 ? 'activeCamera' : 'noneborder'),
8391
8422
  onClickCapture: function onClickCapture() {
8392
8423
  setCurrentPlayerIndex(index);
8393
8424
  }
8394
- }, urls[index] ? /*#__PURE__*/React__default['default'].createElement(Xgplay$1, {
8425
+ }, urls[index] ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
8426
+ className: "pa t5 l0 z99 w100p flex jc-sb pl10 pr10",
8427
+ style: {
8428
+ color: 'white'
8429
+ }
8430
+ }, /*#__PURE__*/React__default['default'].createElement("div", null), /*#__PURE__*/React__default['default'].createElement("div", {
8431
+ className: "cp delete",
8432
+ onClick: function onClick() {
8433
+ var arr = _toConsumableArray(urls);
8434
+
8435
+ arr.splice(index, 1, '');
8436
+ setUrls(arr);
8437
+ }
8438
+ }, /*#__PURE__*/React__default['default'].createElement(icons.CloseOutlined, null))), /*#__PURE__*/React__default['default'].createElement(Xgplay$1, {
8395
8439
  setRef: function setRef(ref) {
8396
8440
  return setPlayers(function (players) {
8397
8441
  players[index] = ref;
@@ -8409,7 +8453,7 @@ function VideoPlayer(_ref, ref) {
8409
8453
  config.onRequestFullscreen && config.onRequestFullscreen(index);
8410
8454
  }
8411
8455
  })
8412
- }) : /*#__PURE__*/React__default['default'].createElement("div", {
8456
+ })) : /*#__PURE__*/React__default['default'].createElement("div", {
8413
8457
  className: "empty",
8414
8458
  onDoubleClick: function onDoubleClick() {
8415
8459
  var _domRef$current;
@@ -8417,7 +8461,7 @@ function VideoPlayer(_ref, ref) {
8417
8461
  var fullscreenElement = document.fullscreenElement;
8418
8462
  fullscreenElement ? exitFullscreen() : requestFullScreen(domRef === null || domRef === void 0 ? void 0 : (_domRef$current = domRef.current) === null || _domRef$current === void 0 ? void 0 : _domRef$current.childNodes[index]);
8419
8463
  }
8420
- }));
8464
+ }, "\u6682\u65E0\u64AD\u653E\u6E90"));
8421
8465
  });
8422
8466
  }, [currentLayoutIndex, currentPlayerIndex, playerRef, urls]);
8423
8467
 
@@ -10126,17 +10170,17 @@ function WaterLevelCharts(config) {
10126
10170
  /*
10127
10171
  * @Author: lijin
10128
10172
  * @Date: 2021-09-09 11:02:54
10129
- * @LastEditTime: 2022-12-15 17:52:15
10173
+ * @LastEditTime: 2023-02-02 09:42:57
10130
10174
  * @LastEditors: lijin
10131
10175
  * @Description:
10132
- * @FilePath: \wargerm-components\src\index.ts
10176
+ * @FilePath: \wargerm\src\index.ts
10133
10177
  * 可以输入预定的版权声明、个性签名、空行等
10134
10178
  */
10135
10179
  console.log(REACT_APP_ENV, 'REACT_APP_ENV');
10136
10180
 
10137
10181
  if (REACT_APP_ENV == 'development') {
10138
10182
  var COLOR_ATTR_NAME = 'data-prefers-color';
10139
- document.documentElement.setAttribute(COLOR_ATTR_NAME, 'nt');
10183
+ document.documentElement.setAttribute(COLOR_ATTR_NAME, 'sd');
10140
10184
  }
10141
10185
 
10142
10186
  exports.AutoScroll = Index$b;
@@ -10175,6 +10219,7 @@ exports.WForm = WForm$1;
10175
10219
  exports.WaterLevelCharts = WaterLevelCharts;
10176
10220
  exports.WebsocketHeart = WebsocketHeart;
10177
10221
  exports.useEventEmitter = useEventEmitter;
10222
+ exports.useStateWithCall = useStateWithCall;
10178
10223
  exports.wTracing = wTracing;
10179
10224
  exports.whox = create;
10180
10225
  exports.wmox = wmox;
package/package.json CHANGED
@@ -1,92 +1,92 @@
1
- {
2
- "private": false,
3
- "name": "wargerm",
4
- "version": "0.6.21",
5
- "scripts": {
6
- "dev": "dumi dev",
7
- "docs:build": "dumi build",
8
- "docs:deploy": "gh-pages -d docs-dist",
9
- "build": "father-build",
10
- "deploy": "npm run docs:build && npm run docs:deploy",
11
- "release": "npm run build && npm publish",
12
- "prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
13
- "test": "umi-test",
14
- "test:coverage": "umi-test --coverage"
15
- },
16
- "main": "dist/index.js",
17
- "module": "dist/index.esm.js",
18
- "unpkg": "dist/index.umd.min.js",
19
- "typings": "dist/index.d.ts",
20
- "author": "jinly2",
21
- "license": "MIT",
22
- "keywords": [
23
- "React",
24
- "Component"
25
- ],
26
- "gitHooks": {
27
- "pre-commit": "lint-staged"
28
- },
29
- "repository": {
30
- "type": "git",
31
- "url": "http://code.eblssmart.com/platform/web/wargerm-components.git",
32
- "branch": "main"
33
- },
34
- "files": [
35
- "dist",
36
- "es",
37
- "lib",
38
- "index.css"
39
- ],
40
- "lint-staged": {
41
- "*.{js,jsx,less,md,json}": [
42
- "prettier --write"
43
- ],
44
- "*.ts?(x)": [
45
- "prettier --parser=typescript --write"
46
- ]
47
- },
48
- "dependencies": {
49
- "@ant-design/pro-table": "^2.79.0",
50
- "animate.css": "^4.1.1",
51
- "echarts": "^5.2.2",
52
- "echarts-for-react": "^3.0.2",
53
- "lodash-es": "^4.17.21",
54
- "moment": "^2.29.4",
55
- "react-countup": "^6.0.0",
56
- "react-dom": "^17.0.2",
57
- "react-file-viewer": "^1.2.1",
58
- "swiper": "^6.7.0",
59
- "use-sync-external-store": "^1.2.0",
60
- "xgplayer": "^2.31.6",
61
- "xgplayer-flv": "^2.5.1",
62
- "xgplayer-flv.js": "^2.3.0",
63
- "xgplayer-hls": "^2.5.2",
64
- "xgplayer-hls.js": "^2.6.1"
65
- },
66
- "peerDependencies": {
67
- "@ant-design/icons": ">=4.2.0",
68
- "antd": ">=4.7.0",
69
- "classnames": ">=2.2.0",
70
- "echarts": "^5.2.2",
71
- "echarts-for-react": "^3.0.2",
72
- "lodash-es": ">=4.17.21",
73
- "react": ">=17.0.0"
74
- },
75
- "devDependencies": {
76
- "@ant-design/icons": "^4.6.4",
77
- "@types/lodash-es": "^4.17.6",
78
- "@types/react-dom": "^17.0.11",
79
- "@types/use-sync-external-store": "^0.0.3",
80
- "@umijs/test": "^3.0.5",
81
- "antd": "^4.16.13",
82
- "babel-plugin-import": "^1.13.3",
83
- "classnames": "^2.3.1",
84
- "dumi": "^1.1.31",
85
- "father-build": "^1.19.1",
86
- "gh-pages": "^3.0.0",
87
- "lint-staged": "^10.0.7",
88
- "prettier": "^1.19.1",
89
- "react": "^16.12.0",
90
- "yorkie": "^2.0.0"
91
- }
92
- }
1
+ {
2
+ "private": false,
3
+ "name": "wargerm",
4
+ "version": "0.6.23",
5
+ "scripts": {
6
+ "dev": "dumi dev",
7
+ "docs:build": "dumi build",
8
+ "docs:deploy": "gh-pages -d docs-dist",
9
+ "build": "father-build",
10
+ "deploy": "npm run docs:build && npm run docs:deploy",
11
+ "release": "npm run build && npm publish",
12
+ "prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
13
+ "test": "umi-test",
14
+ "test:coverage": "umi-test --coverage"
15
+ },
16
+ "main": "dist/index.js",
17
+ "module": "dist/index.esm.js",
18
+ "unpkg": "dist/index.umd.min.js",
19
+ "typings": "dist/index.d.ts",
20
+ "author": "jinly2",
21
+ "license": "MIT",
22
+ "keywords": [
23
+ "React",
24
+ "Component"
25
+ ],
26
+ "gitHooks": {
27
+ "pre-commit": "lint-staged"
28
+ },
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "http://code.eblssmart.com/platform/web/wargerm-components.git",
32
+ "branch": "main"
33
+ },
34
+ "files": [
35
+ "dist",
36
+ "es",
37
+ "lib",
38
+ "index.css"
39
+ ],
40
+ "lint-staged": {
41
+ "*.{js,jsx,less,md,json}": [
42
+ "prettier --write"
43
+ ],
44
+ "*.ts?(x)": [
45
+ "prettier --parser=typescript --write"
46
+ ]
47
+ },
48
+ "dependencies": {
49
+ "@ant-design/pro-table": "2.80.2",
50
+ "animate.css": "^4.1.1",
51
+ "echarts": "^5.2.2",
52
+ "echarts-for-react": "^3.0.2",
53
+ "lodash-es": "^4.17.21",
54
+ "moment": "^2.29.4",
55
+ "react-countup": "^6.0.0",
56
+ "react-dom": "^17.0.2",
57
+ "react-file-viewer": "^1.2.1",
58
+ "swiper": "^6.7.0",
59
+ "use-sync-external-store": "^1.2.0",
60
+ "xgplayer": "^2.31.6",
61
+ "xgplayer-flv": "^2.5.1",
62
+ "xgplayer-flv.js": "^2.3.0",
63
+ "xgplayer-hls": "^2.5.2",
64
+ "xgplayer-hls.js": "^2.6.1"
65
+ },
66
+ "peerDependencies": {
67
+ "@ant-design/icons": ">=4.2.0",
68
+ "antd": ">=4.7.0",
69
+ "classnames": ">=2.2.0",
70
+ "echarts": "^5.2.2",
71
+ "echarts-for-react": "^3.0.2",
72
+ "lodash-es": ">=4.17.21",
73
+ "react": ">=17.0.0"
74
+ },
75
+ "devDependencies": {
76
+ "@ant-design/icons": "^4.6.4",
77
+ "@types/lodash-es": "^4.17.6",
78
+ "@types/react-dom": "^17.0.11",
79
+ "@types/use-sync-external-store": "^0.0.3",
80
+ "@umijs/test": "^3.0.5",
81
+ "antd": "^4.16.13",
82
+ "babel-plugin-import": "^1.13.3",
83
+ "classnames": "^2.3.1",
84
+ "dumi": "^1.1.31",
85
+ "father-build": "^1.19.1",
86
+ "gh-pages": "^3.0.0",
87
+ "lint-staged": "^10.0.7",
88
+ "prettier": "^1.19.1",
89
+ "react": "^16.12.0",
90
+ "yorkie": "^2.0.0"
91
+ }
92
+ }