inl-ui 0.1.143 → 0.1.145

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/README.md CHANGED
@@ -1,49 +1,49 @@
1
- # 工业PC ui库
2
-
3
- 前端通用库,包括组件、hooks、utils等。
4
-
5
- ### 运行
6
-
7
- + 开发模式 yarn dev
8
- + 生产打包 yarn build
9
- + 生成文档 yarn build:docs
10
- + 打包图扑工具 yarn buildtp
11
-
12
- ### 使用方法
13
-
14
- ```javascript
15
- import inl from 'inl-ui';
16
- import 'inl-ui/dist/style.css';
17
-
18
- vue.use(inl)
19
- ```
20
-
21
-
22
-
23
- ### 激活主题
24
-
25
- **vite.config.ts**
26
-
27
- ```javascript
28
- const additionalData = require("inl-ui/dist/theme").default;
29
-
30
- ...
31
-
32
- css: {
33
- preprocessorOptions: {
34
- less: {
35
- javascriptEnabled: true,
36
- additionalData,
37
- },
38
- },
39
- },
40
- ```
41
-
42
- ### 文档链接
43
-
44
- ##### [组件文档](./src/components/README.md)
45
-
46
- ##### [hooks文档](./src/hooks/README.md)
47
-
48
- ##### [Utils文档](./src/utils/README.md)
49
-
1
+ # 工业PC ui库
2
+
3
+ 前端通用库,包括组件、hooks、utils等。
4
+
5
+ ### 运行
6
+
7
+ + 开发模式 yarn dev
8
+ + 生产打包 yarn build
9
+ + 生成文档 yarn build:docs
10
+ + 打包图扑工具 yarn buildtp
11
+
12
+ ### 使用方法
13
+
14
+ ```javascript
15
+ import inl from 'inl-ui';
16
+ import 'inl-ui/dist/style.css';
17
+
18
+ vue.use(inl)
19
+ ```
20
+
21
+
22
+
23
+ ### 激活主题
24
+
25
+ **vite.config.ts**
26
+
27
+ ```javascript
28
+ const additionalData = require("inl-ui/dist/theme").default;
29
+
30
+ ...
31
+
32
+ css: {
33
+ preprocessorOptions: {
34
+ less: {
35
+ javascriptEnabled: true,
36
+ additionalData,
37
+ },
38
+ },
39
+ },
40
+ ```
41
+
42
+ ### 文档链接
43
+
44
+ ##### [组件文档](./src/components/README.md)
45
+
46
+ ##### [hooks文档](./src/hooks/README.md)
47
+
48
+ ##### [Utils文档](./src/utils/README.md)
49
+
@@ -17030,10 +17030,13 @@ class WebRtcMt {
17030
17030
  }
17031
17031
  // 重播
17032
17032
  rePlay(videoElm) {
17033
+ const dom = document.getElementById(videoElm);
17033
17034
  this.stopPlay();
17034
- setTimeout(() => {
17035
- this.init(this.opt);
17036
- }, 3e3);
17035
+ if (dom) {
17036
+ setTimeout(() => {
17037
+ this.init(this.opt);
17038
+ }, 3e3);
17039
+ }
17037
17040
  }
17038
17041
  // 播放
17039
17042
  play(videoElm) {
@@ -17127,7 +17130,7 @@ const VideoPlayBack = vue.defineComponent({
17127
17130
  let timer;
17128
17131
  const videoRef = vue.ref();
17129
17132
  const cpnRef = vue.ref();
17130
- const dom = vue.computed(() => `${props.cameraId + props.cameraCode}`);
17133
+ const dom = vue.computed(() => `${props.cameraId + props.start}`);
17131
17134
  const isLoading = vue.ref(false);
17132
17135
  const isError = vue.ref(false);
17133
17136
  const player = vue.ref();
@@ -17237,8 +17240,8 @@ const VideoPlayBack = vue.defineComponent({
17237
17240
  };
17238
17241
  const stopStream = (video = dom.value) => {
17239
17242
  timer && clearInterval(timer);
17240
- player.value?.delStream(video);
17241
17243
  player.value?.stopPlay(video);
17244
+ player.value?.delStream(video);
17242
17245
  };
17243
17246
  const timeChange = () => {
17244
17247
  currentPlayPercent.value = 0;
@@ -17001,10 +17001,13 @@ class WebRtcMt {
17001
17001
  }
17002
17002
  // 重播
17003
17003
  rePlay(videoElm) {
17004
+ const dom = document.getElementById(videoElm);
17004
17005
  this.stopPlay();
17005
- setTimeout(() => {
17006
- this.init(this.opt);
17007
- }, 3e3);
17006
+ if (dom) {
17007
+ setTimeout(() => {
17008
+ this.init(this.opt);
17009
+ }, 3e3);
17010
+ }
17008
17011
  }
17009
17012
  // 播放
17010
17013
  play(videoElm) {
@@ -17098,7 +17101,7 @@ const VideoPlayBack = defineComponent({
17098
17101
  let timer;
17099
17102
  const videoRef = ref();
17100
17103
  const cpnRef = ref();
17101
- const dom = computed(() => `${props.cameraId + props.cameraCode}`);
17104
+ const dom = computed(() => `${props.cameraId + props.start}`);
17102
17105
  const isLoading = ref(false);
17103
17106
  const isError = ref(false);
17104
17107
  const player = ref();
@@ -17208,8 +17211,8 @@ const VideoPlayBack = defineComponent({
17208
17211
  };
17209
17212
  const stopStream = (video = dom.value) => {
17210
17213
  timer && clearInterval(timer);
17211
- player.value?.delStream(video);
17212
17214
  player.value?.stopPlay(video);
17215
+ player.value?.delStream(video);
17213
17216
  };
17214
17217
  const timeChange = () => {
17215
17218
  currentPlayPercent.value = 0;
package/dist/index.cjs CHANGED
@@ -45,7 +45,7 @@ var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
45
45
  var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
46
46
  var mqtt__default = /*#__PURE__*/_interopDefaultLegacy(mqtt);
47
47
 
48
- var version = "0.1.142";
48
+ var version = "0.1.144";
49
49
 
50
50
  const setTheme = theme => {
51
51
  if (theme === "dark") {
@@ -18016,10 +18016,13 @@ class WebRtcMt {
18016
18016
  }
18017
18017
  // 重播
18018
18018
  rePlay(videoElm) {
18019
+ const dom = document.getElementById(videoElm);
18019
18020
  this.stopPlay();
18020
- setTimeout(() => {
18021
- this.init(this.opt);
18022
- }, 3e3);
18021
+ if (dom) {
18022
+ setTimeout(() => {
18023
+ this.init(this.opt);
18024
+ }, 3e3);
18025
+ }
18023
18026
  }
18024
18027
  // 播放
18025
18028
  play(videoElm) {
@@ -18113,7 +18116,7 @@ const VideoPlayBack = vue.defineComponent({
18113
18116
  let timer;
18114
18117
  const videoRef = vue.ref();
18115
18118
  const cpnRef = vue.ref();
18116
- const dom = vue.computed(() => `${props.cameraId + props.cameraCode}`);
18119
+ const dom = vue.computed(() => `${props.cameraId + props.start}`);
18117
18120
  const isLoading = vue.ref(false);
18118
18121
  const isError = vue.ref(false);
18119
18122
  const player = vue.ref();
@@ -18223,8 +18226,8 @@ const VideoPlayBack = vue.defineComponent({
18223
18226
  };
18224
18227
  const stopStream = (video = dom.value) => {
18225
18228
  timer && clearInterval(timer);
18226
- player.value?.delStream(video);
18227
18229
  player.value?.stopPlay(video);
18230
+ player.value?.delStream(video);
18228
18231
  };
18229
18232
  const timeChange = () => {
18230
18233
  currentPlayPercent.value = 0;
package/dist/index.d.ts CHANGED
@@ -11,7 +11,7 @@ import { Key } from 'ant-design-vue/lib/table/interface';
11
11
  import * as vue_jsx_runtime from 'vue/jsx-runtime';
12
12
  import * as _ant_design_icons_vue_lib_components_IconFont from '@ant-design/icons-vue/lib/components/IconFont';
13
13
 
14
- var version = "0.1.142";
14
+ var version = "0.1.144";
15
15
 
16
16
  declare const _default$p: {
17
17
  set(theme: string): void;
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import { XPopup, CommentBlock, setAxiosOption } from '@sszj-temp/mobile';
14
14
  import { marked } from 'marked';
15
15
  import '@sszj-temp/mobile/style.css';
16
16
 
17
- var version = "0.1.142";
17
+ var version = "0.1.144";
18
18
 
19
19
  const setTheme = theme => {
20
20
  if (theme === "dark") {
@@ -17985,10 +17985,13 @@ class WebRtcMt {
17985
17985
  }
17986
17986
  // 重播
17987
17987
  rePlay(videoElm) {
17988
+ const dom = document.getElementById(videoElm);
17988
17989
  this.stopPlay();
17989
- setTimeout(() => {
17990
- this.init(this.opt);
17991
- }, 3e3);
17990
+ if (dom) {
17991
+ setTimeout(() => {
17992
+ this.init(this.opt);
17993
+ }, 3e3);
17994
+ }
17992
17995
  }
17993
17996
  // 播放
17994
17997
  play(videoElm) {
@@ -18082,7 +18085,7 @@ const VideoPlayBack = defineComponent({
18082
18085
  let timer;
18083
18086
  const videoRef = ref();
18084
18087
  const cpnRef = ref();
18085
- const dom = computed(() => `${props.cameraId + props.cameraCode}`);
18088
+ const dom = computed(() => `${props.cameraId + props.start}`);
18086
18089
  const isLoading = ref(false);
18087
18090
  const isError = ref(false);
18088
18091
  const player = ref();
@@ -18192,8 +18195,8 @@ const VideoPlayBack = defineComponent({
18192
18195
  };
18193
18196
  const stopStream = (video = dom.value) => {
18194
18197
  timer && clearInterval(timer);
18195
- player.value?.delStream(video);
18196
18198
  player.value?.stopPlay(video);
18199
+ player.value?.delStream(video);
18197
18200
  };
18198
18201
  const timeChange = () => {
18199
18202
  currentPlayPercent.value = 0;
@@ -1,70 +1,70 @@
1
- const less = require("less");
2
- const defaultVars = require("./scripts/default-vars");
3
-
4
- const dark = require("./scripts/dark-vars");
5
- const light = require("./scripts/light-vars");
6
-
7
- const path = require("path");
8
- const varDark = path.join(__dirname, ".", "style");
9
- const themeConfig = [
10
- {
11
- theme: "dark",
12
- htmlThemeAttr: "dark",
13
- modifyVars: {
14
- hack: `true;@import "${require.resolve(
15
- varDark + "/color/colorPalette.less"
16
- )}";@import "${require.resolve(varDark + "/themes/var-dark.less")}";`,
17
- ...defaultVars,
18
- ...dark,
19
- "root-entry-name": "dark",
20
- },
21
- },
22
- {
23
- theme: "light",
24
- htmlThemeAttr: "light",
25
- modifyVars: {
26
- // 引入除了变量外的其他内容
27
- hack: `true;@import "${require.resolve(
28
- varDark + "/color/colorPalette.less"
29
- )}";@import "${require.resolve(varDark + "/themes/var-default.less")}";`,
30
- ...defaultVars,
31
- ...light,
32
- "root-entry-name": "default",
33
- },
34
- },
35
- ];
36
- const additionalData = async (content, filename) => {
37
- const themePromises = themeConfig.map(async (t) => {
38
- const { htmlThemeAttr, modifyVars = {} } = t;
39
- const options = {
40
- javascriptEnabled: true,
41
- modifyVars,
42
- relativeUrls: true,
43
- filename,
44
- };
45
- try {
46
- const { css } = await less.render(content, options);
47
- let res = "";
48
- if (htmlThemeAttr && css) {
49
- res = `
50
- [data-doc-theme=${htmlThemeAttr}] {
51
- ${css}
52
- }
53
- `;
54
- }
55
- return Promise.resolve(res);
56
- } catch (error) {
57
- // eslint-disable-next-line no-console
58
- console.log(error);
59
- return Promise.reject(content);
60
- }
61
- });
62
- let res = content;
63
- for (const themePromise of themePromises) {
64
- const theme = await themePromise;
65
- res += theme;
66
- }
67
- return res;
68
- };
69
-
70
- exports.default = additionalData;
1
+ const less = require("less");
2
+ const defaultVars = require("./scripts/default-vars");
3
+
4
+ const dark = require("./scripts/dark-vars");
5
+ const light = require("./scripts/light-vars");
6
+
7
+ const path = require("path");
8
+ const varDark = path.join(__dirname, ".", "style");
9
+ const themeConfig = [
10
+ {
11
+ theme: "dark",
12
+ htmlThemeAttr: "dark",
13
+ modifyVars: {
14
+ hack: `true;@import "${require.resolve(
15
+ varDark + "/color/colorPalette.less"
16
+ )}";@import "${require.resolve(varDark + "/themes/var-dark.less")}";`,
17
+ ...defaultVars,
18
+ ...dark,
19
+ "root-entry-name": "dark",
20
+ },
21
+ },
22
+ {
23
+ theme: "light",
24
+ htmlThemeAttr: "light",
25
+ modifyVars: {
26
+ // 引入除了变量外的其他内容
27
+ hack: `true;@import "${require.resolve(
28
+ varDark + "/color/colorPalette.less"
29
+ )}";@import "${require.resolve(varDark + "/themes/var-default.less")}";`,
30
+ ...defaultVars,
31
+ ...light,
32
+ "root-entry-name": "default",
33
+ },
34
+ },
35
+ ];
36
+ const additionalData = async (content, filename) => {
37
+ const themePromises = themeConfig.map(async (t) => {
38
+ const { htmlThemeAttr, modifyVars = {} } = t;
39
+ const options = {
40
+ javascriptEnabled: true,
41
+ modifyVars,
42
+ relativeUrls: true,
43
+ filename,
44
+ };
45
+ try {
46
+ const { css } = await less.render(content, options);
47
+ let res = "";
48
+ if (htmlThemeAttr && css) {
49
+ res = `
50
+ [data-doc-theme=${htmlThemeAttr}] {
51
+ ${css}
52
+ }
53
+ `;
54
+ }
55
+ return Promise.resolve(res);
56
+ } catch (error) {
57
+ // eslint-disable-next-line no-console
58
+ console.log(error);
59
+ return Promise.reject(content);
60
+ }
61
+ });
62
+ let res = content;
63
+ for (const themePromise of themePromises) {
64
+ const theme = await themePromise;
65
+ res += theme;
66
+ }
67
+ return res;
68
+ };
69
+
70
+ exports.default = additionalData;
@@ -1,21 +1,21 @@
1
- /**
2
- * convert dark.less into js vars
3
- *
4
- * const darkVars = require('./dark-vars');
5
- */
6
- const fs = require("fs");
7
- const path = require("path");
8
- const lessToJs = require("less-vars-to-js");
9
-
10
- const stylePath = path.join(__dirname, "..", "style");
11
- const darkLess = fs.readFileSync(
12
- path.join(stylePath, "themes", "var-dark.less"),
13
- "utf8"
14
- );
15
-
16
- const darkPaletteLess = lessToJs(darkLess, {
17
- stripPrefix: true,
18
- resolveVariables: false,
19
- });
20
-
21
- module.exports = darkPaletteLess;
1
+ /**
2
+ * convert dark.less into js vars
3
+ *
4
+ * const darkVars = require('./dark-vars');
5
+ */
6
+ const fs = require("fs");
7
+ const path = require("path");
8
+ const lessToJs = require("less-vars-to-js");
9
+
10
+ const stylePath = path.join(__dirname, "..", "style");
11
+ const darkLess = fs.readFileSync(
12
+ path.join(stylePath, "themes", "var-dark.less"),
13
+ "utf8"
14
+ );
15
+
16
+ const darkPaletteLess = lessToJs(darkLess, {
17
+ stripPrefix: true,
18
+ resolveVariables: false,
19
+ });
20
+
21
+ module.exports = darkPaletteLess;
@@ -1,25 +1,25 @@
1
- /**
2
- * convert default.less into js vars
3
- *
4
- * const darkVars = require('./default-vars');
5
- */
6
- const fs = require("fs");
7
- const path = require("path");
8
- const lessToJs = require("less-vars-to-js");
9
-
10
- const stylePath = path.join(__dirname, "..", "style");
11
- const colorLess = fs.readFileSync(
12
- path.join(stylePath, "color", "colors.less"),
13
- "utf8"
14
- );
15
- const defaultLess = fs.readFileSync(
16
- path.join(stylePath, "themes", "default.less"),
17
- "utf8"
18
- );
19
-
20
- const defaultPaletteLess = lessToJs(`${colorLess}${defaultLess}`, {
21
- stripPrefix: true,
22
- resolveVariables: false,
23
- });
24
-
25
- module.exports = defaultPaletteLess;
1
+ /**
2
+ * convert default.less into js vars
3
+ *
4
+ * const darkVars = require('./default-vars');
5
+ */
6
+ const fs = require("fs");
7
+ const path = require("path");
8
+ const lessToJs = require("less-vars-to-js");
9
+
10
+ const stylePath = path.join(__dirname, "..", "style");
11
+ const colorLess = fs.readFileSync(
12
+ path.join(stylePath, "color", "colors.less"),
13
+ "utf8"
14
+ );
15
+ const defaultLess = fs.readFileSync(
16
+ path.join(stylePath, "themes", "default.less"),
17
+ "utf8"
18
+ );
19
+
20
+ const defaultPaletteLess = lessToJs(`${colorLess}${defaultLess}`, {
21
+ stripPrefix: true,
22
+ resolveVariables: false,
23
+ });
24
+
25
+ module.exports = defaultPaletteLess;
@@ -1,22 +1,22 @@
1
- /**
2
- * convert dark.less into js vars
3
- *
4
- * const darkVars = require('./dark-vars');
5
- */
6
- const fs = require("fs");
7
- const path = require("path");
8
- const lessToJs = require("less-vars-to-js");
9
-
10
- const stylePath = path.join(__dirname, "..", "style");
11
- const lightLess = fs.readFileSync(
12
- path.join(stylePath, "themes", "var-default.less"),
13
- "utf8"
14
- );
15
-
16
- // 注册变量,过滤其他内容
17
- const lightPaletteLess = lessToJs(lightLess, {
18
- stripPrefix: true,
19
- resolveVariables: false,
20
- });
21
-
22
- module.exports = lightPaletteLess;
1
+ /**
2
+ * convert dark.less into js vars
3
+ *
4
+ * const darkVars = require('./dark-vars');
5
+ */
6
+ const fs = require("fs");
7
+ const path = require("path");
8
+ const lessToJs = require("less-vars-to-js");
9
+
10
+ const stylePath = path.join(__dirname, "..", "style");
11
+ const lightLess = fs.readFileSync(
12
+ path.join(stylePath, "themes", "var-default.less"),
13
+ "utf8"
14
+ );
15
+
16
+ // 注册变量,过滤其他内容
17
+ const lightPaletteLess = lessToJs(lightLess, {
18
+ stripPrefix: true,
19
+ resolveVariables: false,
20
+ });
21
+
22
+ module.exports = lightPaletteLess;