@zscreate/form-component 1.1.238 → 1.1.239

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.
@@ -124486,7 +124486,9 @@ __webpack_require__.r(__webpack_exports__);
124486
124486
  /* harmony export */ filterObj: () => (/* binding */ filterObj),
124487
124487
  /* harmony export */ getImageSize: () => (/* binding */ getImageSize),
124488
124488
  /* harmony export */ getQueryParam: () => (/* binding */ getQueryParam),
124489
+ /* harmony export */ hexToRgb: () => (/* binding */ hexToRgb),
124489
124490
  /* harmony export */ isEmpty: () => (/* binding */ isEmpty),
124491
+ /* harmony export */ rgbToHex: () => (/* binding */ rgbToHex),
124490
124492
  /* harmony export */ toAwait: () => (/* binding */ toAwait)
124491
124493
  /* harmony export */ });
124492
124494
  /* harmony import */ var core_js_modules_es_error_cause_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1313);
@@ -124556,6 +124558,42 @@ function getImageSize(url) {
124556
124558
  image.src = url;
124557
124559
  });
124558
124560
  }
124561
+ /**
124562
+ * 将颜色值rgb格式转换为HEX的格式
124563
+ * @param {rgb} rgb 需要转换的rgb字符串
124564
+ * @return {string} ;
124565
+ */
124566
+ function rgbToHex(rgb) {
124567
+ let arr = rgb.replace("rgb", "").replace("(", "").replace(")", "").split(",");
124568
+ // 转十六进制
124569
+ let h = parseInt(arr[0]).toString(16);
124570
+ let e = parseInt(arr[1]).toString(16);
124571
+ let x = parseInt(arr[2]).toString(16);
124572
+ return "#" + h + e + x;
124573
+ }
124574
+
124575
+ /**
124576
+ * 将颜色值HEX格式转换为rgb的格式
124577
+ * @param {hex} hex 需要转换的rgb字符串
124578
+ * @return {string} ;
124579
+ */
124580
+ function hexToRgb(hex, transparent) {
124581
+ let str = hex.replace("#", "");
124582
+ if (str.length % 3) {
124583
+ return "hex格式不正确!";
124584
+ }
124585
+ //获取截取的字符长度
124586
+ let count = str.length / 3;
124587
+ //根据字符串的长度判断是否需要 进行幂次方
124588
+ let power = 6 / str.length;
124589
+ let r = parseInt("0x" + str.substring(0 * count, 1 * count)) ** power;
124590
+ let g = parseInt("0x" + str.substring(1 * count, 2 * count)) ** power;
124591
+ let b = parseInt("0x" + str.substring(2 * count)) ** power;
124592
+ if (transparent !== undefined) {
124593
+ return `rgba(${r}, ${g}, ${b}, ${transparent})`;
124594
+ }
124595
+ return `rgb(${r}, ${g}, ${b})`;
124596
+ }
124559
124597
 
124560
124598
  /***/ }),
124561
124599
 
@@ -147345,7 +147383,7 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
147345
147383
  /***/ ((module) => {
147346
147384
 
147347
147385
  "use strict";
147348
- module.exports = {"i8":"1.1.238"};
147386
+ module.exports = {"i8":"1.1.239"};
147349
147387
 
147350
147388
  /***/ })
147351
147389
 
@@ -160334,7 +160372,8 @@ if (typeof window !== 'undefined' && window.Vue) {
160334
160372
  MessageBox: components_MessageBox,
160335
160373
  useSsoStatus: useSsoStatus,
160336
160374
  useSsoStatusV2: useSsoStatusV2,
160337
- encrypt: encryption
160375
+ encrypt: encryption,
160376
+ $formUtils: utils_util
160338
160377
  });
160339
160378
  ;// CONCATENATED MODULE: ./node_modules/_@vue_cli-service@5.0.8@@vue/cli-service/lib/commands/build/entry-lib.js
160340
160379
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zscreate/form-component",
3
- "version": "1.1.238",
3
+ "version": "1.1.239",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "main": "dist/form-component.umd.js",