@panpanzhao/component-ui 0.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 +5689 -0
- package/lib/components/crud.js +2276 -0
- package/lib/components/form-dialog.js +1198 -0
- package/lib/components/form-group.js +883 -0
- package/lib/components/form-input.js +1571 -0
- package/lib/components/form-item.js +284 -0
- package/lib/components/form-view-dialog.js +963 -0
- package/lib/components/form-view-group.js +687 -0
- package/lib/components/form-view.js +409 -0
- package/lib/components/form.js +495 -0
- package/lib/components/table-column.js +1053 -0
- package/lib/components/table-editable.js +954 -0
- package/lib/components/table-search.js +407 -0
- package/lib/components/table.js +659 -0
- package/lib/index.js +1 -0
- package/lib/styles/component-ui.css +1 -0
- package/lib/styles/fonts/element-icons.ttf +0 -0
- package/lib/styles/fonts/element-icons.woff +0 -0
- package/lib/styles/form.css +1 -0
- package/lib/styles/index.css +1 -0
- package/lib/styles/table-editable.css +1 -0
- package/lib/styles/table.css +1 -0
- package/lib/utils/formula/evalutor.js +1883 -0
- package/lib/utils/formula/filter.js +48 -0
- package/lib/utils/formula/function.js +12 -0
- package/lib/utils/formula/index.js +25 -0
- package/lib/utils/formula/lexer.js +590 -0
- package/lib/utils/formula/parser.js +734 -0
- package/package.json +67 -0
|
@@ -0,0 +1,284 @@
|
|
|
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 = 63);
|
|
86
|
+
/******/ })
|
|
87
|
+
/************************************************************************/
|
|
88
|
+
/******/ ({
|
|
89
|
+
|
|
90
|
+
/***/ 0:
|
|
91
|
+
/***/ (function(module, exports) {
|
|
92
|
+
|
|
93
|
+
module.exports = require("@vue/babel-helper-vue-jsx-merge-props");
|
|
94
|
+
|
|
95
|
+
/***/ }),
|
|
96
|
+
|
|
97
|
+
/***/ 21:
|
|
98
|
+
/***/ (function(module, exports) {
|
|
99
|
+
|
|
100
|
+
module.exports = require("component-ui/lib/components/form-input");
|
|
101
|
+
|
|
102
|
+
/***/ }),
|
|
103
|
+
|
|
104
|
+
/***/ 46:
|
|
105
|
+
/***/ (function(module, exports) {
|
|
106
|
+
|
|
107
|
+
module.exports = require("element-ui/lib/form-item");
|
|
108
|
+
|
|
109
|
+
/***/ }),
|
|
110
|
+
|
|
111
|
+
/***/ 63:
|
|
112
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
113
|
+
|
|
114
|
+
"use strict";
|
|
115
|
+
// ESM COMPAT FLAG
|
|
116
|
+
__webpack_require__.r(__webpack_exports__);
|
|
117
|
+
|
|
118
|
+
// EXTERNAL MODULE: external "@vue/babel-helper-vue-jsx-merge-props"
|
|
119
|
+
var babel_helper_vue_jsx_merge_props_ = __webpack_require__(0);
|
|
120
|
+
var babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(babel_helper_vue_jsx_merge_props_);
|
|
121
|
+
|
|
122
|
+
// EXTERNAL MODULE: external "element-ui/lib/form-item"
|
|
123
|
+
var form_item_ = __webpack_require__(46);
|
|
124
|
+
var form_item_default = /*#__PURE__*/__webpack_require__.n(form_item_);
|
|
125
|
+
|
|
126
|
+
// EXTERNAL MODULE: external "component-ui/lib/components/form-input"
|
|
127
|
+
var form_input_ = __webpack_require__(21);
|
|
128
|
+
var form_input_default = /*#__PURE__*/__webpack_require__.n(form_input_);
|
|
129
|
+
|
|
130
|
+
// CONCATENATED MODULE: ./src/components/form/src/form-item.js
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
/* harmony default export */ var form_item = ({
|
|
135
|
+
name: "FormItem",
|
|
136
|
+
components: {
|
|
137
|
+
elFormItem: form_item_default.a,
|
|
138
|
+
FormInput: form_input_default.a
|
|
139
|
+
},
|
|
140
|
+
inheritAttrs: false,
|
|
141
|
+
inject: ["form"],
|
|
142
|
+
props: {
|
|
143
|
+
prop: String,
|
|
144
|
+
value: [String, Number, Boolean, Object, Array, Date],
|
|
145
|
+
label: String,
|
|
146
|
+
rules: [Object, Array],
|
|
147
|
+
actions: Array,
|
|
148
|
+
on: Object,
|
|
149
|
+
config: Object,
|
|
150
|
+
render: Function
|
|
151
|
+
},
|
|
152
|
+
watch: {
|
|
153
|
+
value: function value(val) {
|
|
154
|
+
//监听form的formModel变化,处理config的value变化
|
|
155
|
+
this.config.value = val;
|
|
156
|
+
if (this.form && this.form.formModel) {
|
|
157
|
+
this.$emit("formItemChange", {
|
|
158
|
+
itemConfig: this.config,
|
|
159
|
+
itemProp: this.prop,
|
|
160
|
+
itemVal: val
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
computed: {
|
|
166
|
+
actionEventMap: function actionEventMap() {
|
|
167
|
+
var eventMap = {};
|
|
168
|
+
if (!this.actions) {
|
|
169
|
+
return eventMap;
|
|
170
|
+
}
|
|
171
|
+
this.actions.forEach(function (item) {
|
|
172
|
+
eventMap[item.event] = item;
|
|
173
|
+
});
|
|
174
|
+
return eventMap;
|
|
175
|
+
},
|
|
176
|
+
eventOn: function eventOn() {
|
|
177
|
+
var itemOn = {};
|
|
178
|
+
if (!this.on) {
|
|
179
|
+
return itemOn;
|
|
180
|
+
}
|
|
181
|
+
var that = this;
|
|
182
|
+
Object.keys(this.on).forEach(function (eventName) {
|
|
183
|
+
itemOn[eventName] = function () {
|
|
184
|
+
that.execEvent.apply(that, [eventName].concat(Array.prototype.slice.call(arguments)));
|
|
185
|
+
};
|
|
186
|
+
});
|
|
187
|
+
return itemOn;
|
|
188
|
+
},
|
|
189
|
+
actionEventOn: function actionEventOn() {
|
|
190
|
+
var relItemOn = {};
|
|
191
|
+
if (!this.actions) {
|
|
192
|
+
return relItemOn;
|
|
193
|
+
}
|
|
194
|
+
// 联动函数执行
|
|
195
|
+
var that = this;
|
|
196
|
+
this.actions.forEach(function (item) {
|
|
197
|
+
relItemOn[item.event] = function () {
|
|
198
|
+
that.execEvent.apply(that, [item.event].concat(Array.prototype.slice.call(arguments)));
|
|
199
|
+
};
|
|
200
|
+
});
|
|
201
|
+
return relItemOn;
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
methods: {
|
|
205
|
+
execEvent: function execEvent(eventName) {
|
|
206
|
+
var _this = this,
|
|
207
|
+
_itemEvent$exec;
|
|
208
|
+
for (var _len = arguments.length, arg = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
209
|
+
arg[_key - 1] = arguments[_key];
|
|
210
|
+
}
|
|
211
|
+
//默认事件
|
|
212
|
+
if (this.on && this.on[eventName]) {
|
|
213
|
+
this.$emit.apply(this, [eventName, {
|
|
214
|
+
trigger: this.form,
|
|
215
|
+
triggerForm: this.form.formModel,
|
|
216
|
+
triggerConfig: this.form.formItemLayout[this.prop]
|
|
217
|
+
}].concat(arg));
|
|
218
|
+
}
|
|
219
|
+
//联动配置事件
|
|
220
|
+
var itemEvent = this.actionEventMap[eventName];
|
|
221
|
+
if (!itemEvent) {
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
var targetConfig = {};
|
|
225
|
+
if (Array.isArray(itemEvent.target)) {
|
|
226
|
+
itemEvent.target.forEach(function (tarItem) {
|
|
227
|
+
targetConfig[tarItem] = _this.form.formItemLayout[tarItem];
|
|
228
|
+
});
|
|
229
|
+
} else if (typeof itemEvent.target === "string") {
|
|
230
|
+
targetConfig[itemEvent.target] = this.form.formItemLayout[itemEvent.target];
|
|
231
|
+
}
|
|
232
|
+
(_itemEvent$exec = itemEvent.exec).call.apply(_itemEvent$exec, [this, {
|
|
233
|
+
trigger: this.form,
|
|
234
|
+
triggerForm: this.form.formModel,
|
|
235
|
+
triggerConfig: this.form.formItemLayout[this.prop],
|
|
236
|
+
targetConfig: targetConfig
|
|
237
|
+
}].concat(arg));
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
render: function render(h) {
|
|
241
|
+
var _this2 = this;
|
|
242
|
+
if (typeof this.render === "function") {
|
|
243
|
+
return this.render(h, {
|
|
244
|
+
form: this.form,
|
|
245
|
+
config: this.config
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
var itemProp = {
|
|
249
|
+
attrs: Object.assign({}, this.config),
|
|
250
|
+
on: Object.assign({}, this.eventOn, this.actionEventOn, {
|
|
251
|
+
input: function input(val) {
|
|
252
|
+
_this2.execEvent("input", val);
|
|
253
|
+
if (_this2.form) {
|
|
254
|
+
_this2.form.formModel[_this2.prop] = val;
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
change: function change(val, selectOption) {
|
|
258
|
+
_this2.execEvent("change", val, selectOption);
|
|
259
|
+
if (_this2.form) {
|
|
260
|
+
_this2.form.formModel[_this2.prop] = val;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
})
|
|
264
|
+
};
|
|
265
|
+
return h("el-form-item", {
|
|
266
|
+
"attrs": {
|
|
267
|
+
"label": this.label,
|
|
268
|
+
"prop": this.prop,
|
|
269
|
+
"rules": this.rules
|
|
270
|
+
}
|
|
271
|
+
}, [h("form-input", babel_helper_vue_jsx_merge_props_default()([{}, itemProp]))]);
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
// CONCATENATED MODULE: ./src/components/form-item/index.js
|
|
275
|
+
|
|
276
|
+
/* istanbul ignore next */
|
|
277
|
+
form_item.install = function (Vue) {
|
|
278
|
+
Vue.component(form_item.name, form_item);
|
|
279
|
+
};
|
|
280
|
+
/* harmony default export */ var components_form_item = __webpack_exports__["default"] = (form_item);
|
|
281
|
+
|
|
282
|
+
/***/ })
|
|
283
|
+
|
|
284
|
+
/******/ });
|