@panpanzhao/component-ui 1.0.0 → 1.0.2

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.
Files changed (36) hide show
  1. package/lib/component-ui.common.js +1844 -633
  2. package/lib/components/crud.js +547 -297
  3. package/lib/components/dialog.js +50 -19
  4. package/lib/components/drawer.js +14 -14
  5. package/lib/components/form-dialog.js +245 -146
  6. package/lib/components/form-drawer.js +115 -51
  7. package/lib/components/form-group.js +108 -43
  8. package/lib/components/form-input.js +804 -94
  9. package/lib/components/form-item.js +19 -8
  10. package/lib/components/form-query.js +53 -10
  11. package/lib/components/form-view-dialog.js +94 -33
  12. package/lib/components/form-view-group.js +75 -18
  13. package/lib/components/form-view.js +7 -2
  14. package/lib/components/form.js +20 -10
  15. package/lib/components/formula.js +25 -25
  16. package/lib/components/table-column.js +47 -47
  17. package/lib/components/table-editable.js +22 -23
  18. package/lib/components/table-operate.js +357 -197
  19. package/lib/components/table-search.js +28 -31
  20. package/lib/components/table.js +69 -56
  21. package/lib/components/tree-line.js +271 -0
  22. package/lib/index.js +1 -1
  23. package/lib/styles/component-ui.css +2 -2
  24. package/lib/styles/dialog.css +1 -1
  25. package/lib/styles/form-item.css +1 -0
  26. package/lib/styles/form-view.css +1 -0
  27. package/lib/styles/index.css +2 -2
  28. package/lib/styles/tree-line.css +1 -0
  29. package/lib/styles/upload-process.css +1 -0
  30. package/lib/utils/formula/doc.js +2 -3
  31. package/lib/utils/formula/evalutor.js +4 -3
  32. package/lib/utils/formula/filter.js +1 -2
  33. package/lib/utils/formula/function.js +1 -2
  34. package/lib/utils/formula/lexer.js +1 -4
  35. package/lib/utils/helper.js +3 -5
  36. package/package.json +5 -2
@@ -0,0 +1 @@
1
+ .el-tree .el-tree-node__content{position:relative}.element-tree-node-label-wrapper{-webkit-box-flex:1;-ms-flex:1;flex:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.element-tree-node-label{font-size:12px}.element-tree-node-line-ver{display:block;position:absolute;top:0;left:0;height:100%;border-left:1px dashed #dcdfe6}.element-tree-node-line-ver.last-node-isLeaf-line{height:50%}.element-tree-node-line-hor{display:block;position:absolute;top:50%;left:0;height:0;border-bottom:1px dashed #dcdfe6}.element-tree-node-label-line{-webkit-box-flex:1;-ms-flex:1;flex:1;border-top:1px dashed #dcdfe6;-ms-flex-item-align:center;align-self:center;margin:0 10px}
@@ -0,0 +1 @@
1
+ .upload-process .file-desc span{padding-left:5px}.upload-process .file-desc span b{padding:0 2px}.upload-process .file-list{list-style:none;margin:0;padding:0}.upload-process .file-list__item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-transition:all .5s cubic-bezier(.55,0,.1,1);transition:all .5s cubic-bezier(.55,0,.1,1);font-size:14px;color:#606266;line-height:1.8;margin-top:10px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;width:100%;padding:2px}.upload-process .file-list__item-name{-webkit-box-flex:1;-ms-flex:1;flex:1;color:#606266;display:block;margin-right:5px;overflow:hidden;padding-left:4px;text-overflow:ellipsis;-webkit-transition:color .3s;transition:color .3s;white-space:nowrap}.upload-process .file-list__item-state{white-space:nowrap}.upload-process .file-list__item-tool{position:absolute;width:100%;height:100%;left:0;top:0;cursor:default;text-align:center;color:#fff;opacity:0;font-size:18px;background-color:rgba(0,0,0,.3);-webkit-transition:opacity .3s;transition:opacity .3s;border-radius:4px;padding:5px 2px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.upload-process .file-list__item-tool:hover{opacity:1}
@@ -5,7 +5,7 @@ exports.default = void 0;
5
5
  /**
6
6
  * 公式文档 请运行 `npm run genDoc` 自动生成
7
7
  */
8
- var _default = [{
8
+ var _default = exports.default = [{
9
9
  name: "IF",
10
10
  description: "示例:IF(A, B, C)\n\n如果满足条件A,则返回B,否则返回C,支持多层嵌套IF函数。\n\n也可以用表达式如:A ? B : C",
11
11
  example: "IF(condition, consequent, alternate)",
@@ -1543,5 +1543,4 @@ var _default = [{
1543
1543
  description: "结果"
1544
1544
  },
1545
1545
  namespace: "其他"
1546
- }];
1547
- exports.default = _default;
1546
+ }];
@@ -16,8 +16,10 @@ var _isPlainObject = _interopRequireDefault(require("lodash/isPlainObject"));
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
17
  function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
18
18
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
19
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
20
- var Evaluator = /*#__PURE__*/function () {
19
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } /**
20
+ * @file 公式内置函数
21
+ */
22
+ var Evaluator = exports.Evaluator = /*#__PURE__*/function () {
21
23
  function Evaluator(context, options) {
22
24
  if (options === void 0) {
23
25
  options = {
@@ -1835,7 +1837,6 @@ var Evaluator = /*#__PURE__*/function () {
1835
1837
  };
1836
1838
  return Evaluator;
1837
1839
  }();
1838
- exports.Evaluator = Evaluator;
1839
1840
  Evaluator.defaultFilters = {};
1840
1841
  Evaluator.defaultFunctions = {};
1841
1842
  function getCookie(name) {
@@ -23,7 +23,7 @@ var escapeHtml = function escapeHtml(str) {
23
23
  * filter 是历史包袱,不建议使用。因为这是之前的语法,所以在公式解析里面做了兼容。
24
24
  * 建议用 ${ LEFT(xxx) } 这种函数调用语法。
25
25
  */
26
- var filters = {
26
+ var filters = exports.filters = {
27
27
  raw: function raw(input) {
28
28
  return input;
29
29
  },
@@ -34,7 +34,6 @@ var filters = {
34
34
  return escapeHtml(input);
35
35
  }
36
36
  };
37
- exports.filters = filters;
38
37
  function registerFilter(name, fn) {
39
38
  filters[name] = fn;
40
39
  _evalutor.Evaluator.setDefaultFilters(filters);
@@ -4,8 +4,7 @@ exports.__esModule = true;
4
4
  exports.functions = void 0;
5
5
  exports.registerFunction = registerFunction;
6
6
  var _evalutor = require("./evalutor");
7
- var functions = {};
8
- exports.functions = functions;
7
+ var functions = exports.functions = {};
9
8
  function registerFunction(name, fn) {
10
9
  functions["fn" + name] = fn;
11
10
  _evalutor.Evaluator.setDefaultFunctions(functions);
@@ -3,8 +3,7 @@
3
3
  exports.__esModule = true;
4
4
  exports.TokenName = void 0;
5
5
  exports.lexer = lexer;
6
- var TokenName = {};
7
- exports.TokenName = TokenName;
6
+ var TokenName = exports.TokenName = {};
8
7
  TokenName[1 /* BooleanLiteral */] = 'Boolean';
9
8
  TokenName[2 /* RAW */] = 'Raw';
10
9
  TokenName[3 /* Variable */] = 'Variable';
@@ -65,7 +64,6 @@ var escapes = {
65
64
  't': 7,
66
65
  'u': 8 // 4 hexadecimal digits
67
66
  };
68
-
69
67
  function isDigit1to9(char) {
70
68
  return char >= '1' && char <= '9';
71
69
  }
@@ -552,7 +550,6 @@ function lexer(input, options) {
552
550
  var reg = (options === null || options === void 0 ? void 0 : options.variableMode) ? /^[\u4e00-\u9fa5A-Za-z0-9_$@][\u4e00-\u9fa5A-Za-z0-9_\-$@]*/ : /^(?:[\u4e00-\u9fa5A-Za-z_$@]([\u4e00-\u9fa5A-Za-z0-9_\-$@]|\\(?:\.|\[|\]|\(|\)|\{|\}|\s|=|!|>|<|\||&|\+|-|\*|\/|\^|~|%|&|\?|:|;|,))*|\d+[\u4e00-\u9fa5A-Za-z_$@](?:[\u4e00-\u9fa5A-Za-z0-9_\-$@]|\\(?:\.|\[|\]|\(|\)|\{|\}|\s|=|!|>|<|\||&|\+|-|\*|\/|\^|~|%|&|\?|:|;|,))*)/;
553
551
  var match = reg.exec(input.substring(index, index + 256) // 变量长度不能超过 256
554
552
  );
555
-
556
553
  if (match) {
557
554
  return {
558
555
  type: TokenName[7 /* Identifier */],
@@ -7,7 +7,7 @@ exports.uuid = exports.isPermission = void 0;
7
7
  var str = function str() {
8
8
  return ('00000000000000000' + (Math.random() * 0xffffffffffffffff).toString(16)).slice(-16);
9
9
  };
10
- var uuid = function uuid() {
10
+ var uuid = exports.uuid = function uuid() {
11
11
  var a = str();
12
12
  var b = str();
13
13
  return a.slice(0, 8) + '-' + a.slice(8, 12) + '-4' + a.slice(13) + '-a' + b.slice(1, 4) + '-' + b.slice(4);
@@ -17,17 +17,15 @@ var uuid = function uuid() {
17
17
  *
18
18
  * @return {string} 8位随机数字
19
19
  */
20
- exports.uuid = uuid;
21
20
  function guid() {
22
21
  function s4() {
23
22
  return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
24
23
  }
25
24
  return s4() + s4() + s4();
26
25
  }
27
- var isPermission = function isPermission(code, permission) {
26
+ var isPermission = exports.isPermission = function isPermission(code, permission) {
28
27
  if (!code || !permission) {
29
28
  return true;
30
29
  }
31
30
  return permission.includes(code);
32
- };
33
- exports.isPermission = isPermission;
31
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panpanzhao/component-ui",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "A Component Library for Vue.js.",
5
5
  "main": "lib/component-ui.common.js",
6
6
  "unpkg": "lib/index.js",
@@ -30,12 +30,14 @@
30
30
  "author": "ppzhao",
31
31
  "license": "ISC",
32
32
  "peerDependencies": {
33
+ "element-ui": "^2.15.14",
33
34
  "vue": "^2.6.14"
34
35
  },
35
36
  "devDependencies": {
36
37
  "@babel/cli": "^7.21.0",
37
38
  "@babel/core": "^7.21.0",
38
39
  "@babel/preset-env": "^7.18.10",
40
+ "@vue/babel-helper-vue-jsx-merge-props": "^1.4.0",
39
41
  "@vue/babel-preset-jsx": "^1.2.4",
40
42
  "babel-loader": "^8.2.5",
41
43
  "babel-plugin-module-resolver": "^5.0.0",
@@ -48,6 +50,7 @@
48
50
  "gulp-sass": "^5.1.0",
49
51
  "node-sass": "^7.0.1",
50
52
  "progress-bar-webpack-plugin": "^1.11.0",
53
+ "rimraf": "^5.0.5",
51
54
  "style-loader": "^0.23.1",
52
55
  "vue": "^2.6.14",
53
56
  "vue-loader": "^15.7.0",
@@ -61,7 +64,7 @@
61
64
  "async-validator": "^4.2.5",
62
65
  "codemirror": "^5.63.0",
63
66
  "dayjs": "^1.11.7",
64
- "element-ui": "^2.15.13",
67
+ "element-ui": "^2.15.14",
65
68
  "lodash": "^4.17.21"
66
69
  }
67
70
  }