@panpanzhao/component-ui 1.0.0 → 1.0.1
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/lib/component-ui.common.js +1845 -633
- package/lib/components/crud.js +547 -297
- package/lib/components/dialog.js +50 -19
- package/lib/components/drawer.js +14 -14
- package/lib/components/form-dialog.js +245 -146
- package/lib/components/form-drawer.js +115 -51
- package/lib/components/form-group.js +108 -43
- package/lib/components/form-input.js +804 -94
- package/lib/components/form-item.js +19 -8
- package/lib/components/form-query.js +53 -10
- package/lib/components/form-view-dialog.js +94 -33
- package/lib/components/form-view-group.js +75 -18
- package/lib/components/form-view.js +7 -2
- package/lib/components/form.js +20 -10
- package/lib/components/formula.js +25 -25
- package/lib/components/table-column.js +47 -47
- package/lib/components/table-editable.js +22 -23
- package/lib/components/table-operate.js +357 -197
- package/lib/components/table-search.js +28 -31
- package/lib/components/table.js +69 -56
- package/lib/components/tree-line.js +272 -0
- package/lib/index.js +1 -1
- package/lib/styles/component-ui.css +2 -2
- package/lib/styles/dialog.css +1 -1
- package/lib/styles/form-item.css +1 -0
- package/lib/styles/form-view.css +1 -0
- package/lib/styles/index.css +2 -2
- package/lib/styles/tree-line.css +1 -0
- package/lib/styles/upload-process.css +1 -0
- package/lib/utils/formula/doc.js +2 -3
- package/lib/utils/formula/evalutor.js +4 -3
- package/lib/utils/formula/filter.js +1 -2
- package/lib/utils/formula/function.js +1 -2
- package/lib/utils/formula/lexer.js +1 -4
- package/lib/utils/helper.js +3 -5
- package/package.json +5 -2
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
module.exports =
|
|
2
|
+
/******/ (function(modules) { // webpackBootstrap
|
|
3
|
+
/******/ // The module cache
|
|
4
|
+
/******/ var installedModules = {};
|
|
5
|
+
/******/
|
|
6
|
+
/******/ // The require function
|
|
7
|
+
/******/ function __webpack_require__(moduleId) {
|
|
8
|
+
/******/
|
|
9
|
+
/******/ // Check if module is in cache
|
|
10
|
+
/******/ if(installedModules[moduleId]) {
|
|
11
|
+
/******/ return installedModules[moduleId].exports;
|
|
12
|
+
/******/ }
|
|
13
|
+
/******/ // Create a new module (and put it into the cache)
|
|
14
|
+
/******/ var module = installedModules[moduleId] = {
|
|
15
|
+
/******/ i: moduleId,
|
|
16
|
+
/******/ l: false,
|
|
17
|
+
/******/ exports: {}
|
|
18
|
+
/******/ };
|
|
19
|
+
/******/
|
|
20
|
+
/******/ // Execute the module function
|
|
21
|
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
22
|
+
/******/
|
|
23
|
+
/******/ // Flag the module as loaded
|
|
24
|
+
/******/ module.l = true;
|
|
25
|
+
/******/
|
|
26
|
+
/******/ // Return the exports of the module
|
|
27
|
+
/******/ return module.exports;
|
|
28
|
+
/******/ }
|
|
29
|
+
/******/
|
|
30
|
+
/******/
|
|
31
|
+
/******/ // expose the modules object (__webpack_modules__)
|
|
32
|
+
/******/ __webpack_require__.m = modules;
|
|
33
|
+
/******/
|
|
34
|
+
/******/ // expose the module cache
|
|
35
|
+
/******/ __webpack_require__.c = installedModules;
|
|
36
|
+
/******/
|
|
37
|
+
/******/ // define getter function for harmony exports
|
|
38
|
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
39
|
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
40
|
+
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
41
|
+
/******/ }
|
|
42
|
+
/******/ };
|
|
43
|
+
/******/
|
|
44
|
+
/******/ // define __esModule on exports
|
|
45
|
+
/******/ __webpack_require__.r = function(exports) {
|
|
46
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
47
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
48
|
+
/******/ }
|
|
49
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
50
|
+
/******/ };
|
|
51
|
+
/******/
|
|
52
|
+
/******/ // create a fake namespace object
|
|
53
|
+
/******/ // mode & 1: value is a module id, require it
|
|
54
|
+
/******/ // mode & 2: merge all properties of value into the ns
|
|
55
|
+
/******/ // mode & 4: return value when already ns object
|
|
56
|
+
/******/ // mode & 8|1: behave like require
|
|
57
|
+
/******/ __webpack_require__.t = function(value, mode) {
|
|
58
|
+
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
59
|
+
/******/ if(mode & 8) return value;
|
|
60
|
+
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
61
|
+
/******/ var ns = Object.create(null);
|
|
62
|
+
/******/ __webpack_require__.r(ns);
|
|
63
|
+
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
64
|
+
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
65
|
+
/******/ return ns;
|
|
66
|
+
/******/ };
|
|
67
|
+
/******/
|
|
68
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
69
|
+
/******/ __webpack_require__.n = function(module) {
|
|
70
|
+
/******/ var getter = module && module.__esModule ?
|
|
71
|
+
/******/ function getDefault() { return module['default']; } :
|
|
72
|
+
/******/ function getModuleExports() { return module; };
|
|
73
|
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
74
|
+
/******/ return getter;
|
|
75
|
+
/******/ };
|
|
76
|
+
/******/
|
|
77
|
+
/******/ // Object.prototype.hasOwnProperty.call
|
|
78
|
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
79
|
+
/******/
|
|
80
|
+
/******/ // __webpack_public_path__
|
|
81
|
+
/******/ __webpack_require__.p = "/dist/";
|
|
82
|
+
/******/
|
|
83
|
+
/******/
|
|
84
|
+
/******/ // Load entry module and return exports
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 84);
|
|
86
|
+
/******/ })
|
|
87
|
+
/************************************************************************/
|
|
88
|
+
/******/ ({
|
|
89
|
+
|
|
90
|
+
/***/ 84:
|
|
91
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
92
|
+
|
|
93
|
+
"use strict";
|
|
94
|
+
// ESM COMPAT FLAG
|
|
95
|
+
__webpack_require__.r(__webpack_exports__);
|
|
96
|
+
|
|
97
|
+
// CONCATENATED MODULE: ./src/components/tree-line/src/index.js
|
|
98
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
99
|
+
function getComConfig(h) {
|
|
100
|
+
return {
|
|
101
|
+
name: 'TreeLine',
|
|
102
|
+
props: {
|
|
103
|
+
node: {
|
|
104
|
+
type: Object,
|
|
105
|
+
required: true
|
|
106
|
+
},
|
|
107
|
+
data: {
|
|
108
|
+
type: Object
|
|
109
|
+
},
|
|
110
|
+
treeData: {
|
|
111
|
+
type: Array
|
|
112
|
+
},
|
|
113
|
+
indent: {
|
|
114
|
+
type: Number,
|
|
115
|
+
default: function _default() {
|
|
116
|
+
return 14;
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
showLabelLine: {
|
|
120
|
+
type: Boolean,
|
|
121
|
+
default: false
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
render: function render(createElement) {
|
|
125
|
+
debugger;
|
|
126
|
+
var $createElement = h || createElement;
|
|
127
|
+
// 自定义整行节点label区域
|
|
128
|
+
var scopeSlotDefault = this.getScopedSlot('default');
|
|
129
|
+
// 显示横线时自定义节点label区域
|
|
130
|
+
var labelSlot = this.getScopedSlot('node-label');
|
|
131
|
+
// 显示横线时追加在横线右边的内容
|
|
132
|
+
var afterLabelSlot = this.getScopedSlot('after-node-label');
|
|
133
|
+
var labelNodes = scopeSlotDefault ? this.getScopedSlotValue(scopeSlotDefault, {
|
|
134
|
+
node: this.node,
|
|
135
|
+
data: this.data
|
|
136
|
+
}) : [labelSlot ? this.getScopedSlotValue(labelSlot, {
|
|
137
|
+
node: this.node,
|
|
138
|
+
data: this.data
|
|
139
|
+
}) : $createElement('span', {
|
|
140
|
+
class: 'element-tree-node-label'
|
|
141
|
+
}, this.node.label), this.showLabelLine ? $createElement('span', {
|
|
142
|
+
class: 'element-tree-node-label-line'
|
|
143
|
+
}) : null, this.getScopedSlotValue(afterLabelSlot, {
|
|
144
|
+
node: this.node,
|
|
145
|
+
data: this.data
|
|
146
|
+
})];
|
|
147
|
+
// 取得每一层的当前节点是不是在当前层级列表的最后一个
|
|
148
|
+
var lastnodeArr = [];
|
|
149
|
+
var currentNode = this.node;
|
|
150
|
+
while (currentNode) {
|
|
151
|
+
var parentNode = currentNode.parent;
|
|
152
|
+
// 兼容element-plus的 el-tree-v2 (Virtualized Tree 虚拟树)
|
|
153
|
+
if (currentNode.level === 1 && !currentNode.parent) {
|
|
154
|
+
// el-tree-v2的第一层node是没有parent的,必需 treeData 创建一个parent
|
|
155
|
+
if (!this.treeData || !Array.isArray(this.treeData)) {
|
|
156
|
+
throw Error('if you using el-tree-v2 (Virtualized Tree) of element-plus,element-tree-line required data.');
|
|
157
|
+
}
|
|
158
|
+
parentNode = {
|
|
159
|
+
children: Array.isArray(this.treeData) ? this.treeData.map(function (item) {
|
|
160
|
+
return _extends({}, item, {
|
|
161
|
+
key: item.id
|
|
162
|
+
});
|
|
163
|
+
}) : [],
|
|
164
|
+
level: 0,
|
|
165
|
+
key: 'node-0',
|
|
166
|
+
parent: null
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
if (parentNode) {
|
|
170
|
+
// element-plus的 el-tree-v2 使用的是children和key, 其他使用的是 childNodes和id
|
|
171
|
+
var index = (parentNode.children || parentNode.childNodes).findIndex(function (item) {
|
|
172
|
+
return (item.key || item.id) === (currentNode.key || currentNode.id);
|
|
173
|
+
});
|
|
174
|
+
lastnodeArr.unshift(index === (parentNode.children || parentNode.childNodes).length - 1);
|
|
175
|
+
}
|
|
176
|
+
currentNode = parentNode;
|
|
177
|
+
}
|
|
178
|
+
var lineNodes = [];
|
|
179
|
+
for (var i = 0; i < this.node.level; i++) {
|
|
180
|
+
if (lastnodeArr[i] && this.node.level - 1 !== i) {
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
lineNodes.push($createElement('span', {
|
|
184
|
+
class: {
|
|
185
|
+
'element-tree-node-line-ver': true,
|
|
186
|
+
'last-node-isLeaf-line': lastnodeArr[i] && this.node.level - 1 === i
|
|
187
|
+
},
|
|
188
|
+
style: {
|
|
189
|
+
left: this.indent * i + 'px'
|
|
190
|
+
}
|
|
191
|
+
}));
|
|
192
|
+
}
|
|
193
|
+
return $createElement('span', {
|
|
194
|
+
class: 'element-tree-node-label-wrapper'
|
|
195
|
+
}, [labelNodes].concat(lineNodes).concat([$createElement('span', {
|
|
196
|
+
class: 'element-tree-node-line-hor',
|
|
197
|
+
style: {
|
|
198
|
+
width: (this.node.isLeaf ? 24 : 8) + 'px',
|
|
199
|
+
left: (this.node.level - 1) * this.indent + 'px'
|
|
200
|
+
}
|
|
201
|
+
})]));
|
|
202
|
+
},
|
|
203
|
+
methods: {
|
|
204
|
+
getScopedSlot: function getScopedSlot(slotName) {
|
|
205
|
+
if (!slotName) {
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
var slotNameSplits = slotName.split('||');
|
|
209
|
+
var scopeSlot = null;
|
|
210
|
+
for (var index = 0; index < slotNameSplits.length; index++) {
|
|
211
|
+
var name = slotNameSplits[index];
|
|
212
|
+
var slot = (this.$slots || {})[name];
|
|
213
|
+
if (slot) {
|
|
214
|
+
scopeSlot = slot;
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
scopeSlot = (this.$scopedSlots || {})[name];
|
|
218
|
+
if (scopeSlot) {
|
|
219
|
+
break;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return scopeSlot;
|
|
223
|
+
},
|
|
224
|
+
getScopedSlotValue: function getScopedSlotValue(scopeSlot, scopedData, defaultNode) {
|
|
225
|
+
if (defaultNode === void 0) {
|
|
226
|
+
defaultNode = null;
|
|
227
|
+
}
|
|
228
|
+
if (typeof scopeSlot === 'function') {
|
|
229
|
+
return scopeSlot(scopedData) || defaultNode;
|
|
230
|
+
}
|
|
231
|
+
return scopeSlot || defaultNode;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
function getElementLabelLine(h) {
|
|
237
|
+
debugger;
|
|
238
|
+
var conf = getComConfig(h);
|
|
239
|
+
if (h) {
|
|
240
|
+
conf.methods.getScopedSlot = function getScopedSlot(slotName) {
|
|
241
|
+
if (!slotName) {
|
|
242
|
+
return null;
|
|
243
|
+
}
|
|
244
|
+
var slotNameSplits = slotName.split('||');
|
|
245
|
+
var scopeSlot = null;
|
|
246
|
+
for (var index = 0; index < slotNameSplits.length; index++) {
|
|
247
|
+
var name = slotNameSplits[index];
|
|
248
|
+
var slot = (this.$slots || {})[name];
|
|
249
|
+
if (slot) {
|
|
250
|
+
scopeSlot = slot;
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return scopeSlot;
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
return conf;
|
|
258
|
+
}
|
|
259
|
+
var ElementLabelLine = getElementLabelLine();
|
|
260
|
+
/* harmony default export */ var src = (ElementLabelLine);
|
|
261
|
+
// CONCATENATED MODULE: ./src/components/tree-line/index.js
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
/* istanbul ignore next */
|
|
265
|
+
src.install = function (Vue) {
|
|
266
|
+
Vue.component(src.name, src);
|
|
267
|
+
};
|
|
268
|
+
/* harmony default export */ var tree_line = __webpack_exports__["default"] = (src);
|
|
269
|
+
|
|
270
|
+
/***/ })
|
|
271
|
+
|
|
272
|
+
/******/ });
|