@opentiny/vue-renderless 3.1.0-alpha.0 → 3.4.7
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/action-menu/index.js +10 -0
- package/action-menu/vue.js +26 -0
- package/amount/index.js +334 -0
- package/amount/vue.js +206 -0
- package/area/index.js +162 -0
- package/area/vue.js +68 -0
- package/autonavi-map/index.js +28 -0
- package/avatar/index.js +5 -1
- package/avatar/vue.js +2 -1
- package/baidu-map/index.js +28 -0
- package/breadcrumb/index.js +9 -0
- package/breadcrumb/vue.js +25 -3
- package/breadcrumb-item/index.js +26 -0
- package/breadcrumb-item/vue.js +20 -11
- package/bulletin-board/index.js +4 -1
- package/button-group/vue.js +1 -1
- package/calendar/index.js +14 -14
- package/card-template/index.js +1 -1
- package/cascader/index.js +21 -7
- package/cascader/vue.js +1 -2
- package/cascader-node/index.js +3 -1
- package/cascader-panel/index.js +12 -4
- package/cascader-panel/vue.js +1 -2
- package/chart-bar/index.js +533 -0
- package/chart-boxplot/index.js +270 -0
- package/chart-candle/index.js +428 -0
- package/chart-core/deps/constants.js +65 -0
- package/chart-core/deps/numerify.js +286 -0
- package/chart-core/deps/utils.js +205 -0
- package/chart-core/index.js +541 -0
- package/chart-core/modules/animation.js +10 -0
- package/chart-core/modules/extend.js +36 -0
- package/chart-core/modules/mark.js +7 -0
- package/chart-core/vue.js +128 -0
- package/chart-funnel/index.js +155 -0
- package/chart-gauge/index.js +153 -0
- package/chart-graph/index.js +38 -0
- package/chart-heatmap/index.js +407 -0
- package/chart-line/index.js +358 -0
- package/chart-liquidfill/index.js +119 -0
- package/chart-map/index.js +261 -0
- package/chart-pie/index.js +327 -0
- package/chart-radar/index.js +181 -0
- package/chart-sankey/index.js +166 -0
- package/chart-scatter/index.js +360 -0
- package/chart-sunburst/index.js +36 -0
- package/chart-tree/index.js +107 -0
- package/chart-waterfall/index.js +231 -0
- package/chart-wordcloud/index.js +109 -0
- package/checkbox/index.js +4 -4
- package/checkbox-button/index.js +3 -1
- package/common/bigInt.js +5 -2
- package/common/date.js +17 -17
- package/common/deps/date-util.js +15 -5
- package/common/deps/date.js +6 -6
- package/common/deps/dom.js +18 -6
- package/common/deps/eSpaceCtrl.js +286 -0
- package/common/deps/fullscreen/apis.js +22 -22
- package/common/deps/memorize.js +3 -3
- package/common/deps/modal-queue.js +2 -0
- package/common/deps/popper.js +12 -10
- package/common/deps/popup-manager.js +16 -5
- package/common/deps/resize-event.js +6 -2
- package/common/deps/scrollbar-width.js +6 -2
- package/common/deps/tree-model/node.js +30 -10
- package/common/deps/tree-model/tree-store.js +33 -21
- package/common/deps/tree-model/util.js +6 -2
- package/common/deps/upload-ajax.js +7 -1
- package/common/deps/vue-popper.js +2 -2
- package/common/string.js +1 -1
- package/company/index.js +56 -0
- package/company/vue.js +35 -0
- package/country/index.js +54 -0
- package/country/vue.js +35 -0
- package/credit-card-form/index.js +1 -0
- package/currency/index.js +78 -0
- package/currency/vue.js +39 -0
- package/date-panel/index.js +16 -6
- package/date-picker/index.js +9 -5
- package/date-range/index.js +28 -9
- package/date-table/index.js +3 -1
- package/dept/index.js +318 -0
- package/dept/vue.js +163 -0
- package/detail-page/index.js +4 -1
- package/dialog-box/index.js +14 -4
- package/dialog-box/vue.js +7 -3
- package/drop-roles/index.js +73 -0
- package/drop-roles/vue.js +38 -0
- package/dropdown/index.js +5 -4
- package/dropdown/vue.js +5 -3
- package/dropdown-item/index.js +15 -0
- package/dropdown-item/vue.js +27 -13
- package/espace/index.js +129 -0
- package/espace/vue.js +52 -0
- package/file-upload/index.js +336 -291
- package/form/index.js +3 -1
- package/form/vue.js +15 -0
- package/form-item/index.js +15 -5
- package/fullscreen/index.js +4 -4
- package/fullscreen/vue.js +3 -3
- package/grid/core/interceptor.js +4 -7
- package/grid/plugins/export.js +2 -2
- package/grid/plugins/exportExcel.js +28 -10
- package/grid/static/array/findTree.js +1 -1
- package/grid/static/base/helperCreateGetObjects.js +1 -1
- package/grid/static/base/helperEqualCompare.js +2 -2
- package/grid/static/base/helperGetHGSKeys.js +1 -1
- package/grid/static/base/uniqueId.js +1 -1
- package/grid/static/object/assign.js +3 -3
- package/grid/static/string/toString.js +3 -3
- package/hrapprover/index.js +118 -0
- package/hrapprover/vue.js +102 -0
- package/locales/index.js +116 -0
- package/locales/vue.js +46 -0
- package/logon-user/index.js +23 -0
- package/logon-user/vue.js +22 -0
- package/logout/index.js +118 -0
- package/logout/vue.js +22 -0
- package/milestone/index.js +2 -1
- package/mini-picker/index.js +1 -1
- package/mini-picker/vue.js +1 -1
- package/modal/index.js +4 -2
- package/month-table/index.js +2 -2
- package/nav-menu/index.js +2 -2
- package/numeric/index.js +4 -2
- package/package.json +33 -136
- package/pager-item/vue.js +6 -2
- package/picker/index.js +43 -17
- package/picker/timezone.js +2 -2
- package/picker-column/index.js +7 -3
- package/pop-upload/index.js +5 -3
- package/popeditor/index.js +15 -7
- package/popover/index.js +87 -54
- package/popover/vue.js +13 -9
- package/rate/index.js +2 -2
- package/rich-text/clipboard.js +77 -0
- package/rich-text/index.js +176 -0
- package/rich-text/module/file-upload.js +118 -0
- package/rich-text/module/image-drop.js +54 -0
- package/rich-text/module/image-upload.js +84 -0
- package/rich-text/options.js +187 -0
- package/rich-text/table-module.js +557 -0
- package/rich-text/vue.js +149 -0
- package/roles/index.js +87 -0
- package/roles/vue.js +39 -0
- package/search/index.js +32 -27
- package/search/vue.js +7 -2
- package/select/index.js +328 -304
- package/select/vue.js +19 -9
- package/select-dropdown/index.js +1 -1
- package/slider/index.js +9 -11
- package/slider/vue.js +3 -3
- package/split/vue.js +1 -1
- package/tab-nav/index.js +0 -6
- package/tab-nav/vue.js +0 -14
- package/table/index.js +1 -1
- package/text-popup/index.js +6 -4
- package/time/index.js +3 -1
- package/time-range/index.js +6 -2
- package/time-spinner/index.js +15 -5
- package/toggle-menu/index.js +11 -0
- package/toggle-menu/vue.js +2 -1
- package/tooltip/index.js +46 -35
- package/tooltip/vue.js +5 -1
- package/tree/index.js +57 -21
- package/tree-menu/index.js +3 -1
- package/tree-node/index.js +7 -3
- package/upload/index.js +14 -5
- package/user/index.js +634 -0
- package/user/vue.js +113 -0
- package/user-account/index.js +23 -0
- package/user-account/vue.js +25 -0
- package/user-contact/index.js +1 -4
- package/user-head/index.js +9 -11
- package/user-head/vue.js +2 -6
- package/user-link/index.js +43 -0
- package/user-link/vue.js +60 -0
package/roles/index.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { xss } from '@opentiny/vue-renderless/common';
|
|
2
|
+
export var showList = function showList(state) {
|
|
3
|
+
return function () {
|
|
4
|
+
return state.showPopover = true;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export var show = function show(state) {
|
|
8
|
+
return function () {
|
|
9
|
+
return state.showIcon = false;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export var hide = function hide(state) {
|
|
13
|
+
return function () {
|
|
14
|
+
return state.showIcon = true;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export var getRoleList = function getRoleList(_ref) {
|
|
18
|
+
var constants = _ref.constants,
|
|
19
|
+
service = _ref.service,
|
|
20
|
+
state = _ref.state;
|
|
21
|
+
return function () {
|
|
22
|
+
var envInfo = service.getEnvInfoSync() || {};
|
|
23
|
+
var userInfo = envInfo.user || {};
|
|
24
|
+
var validRols = userInfo.validRoles || [];
|
|
25
|
+
var currentRole = userInfo.currentRole || {};
|
|
26
|
+
state.currentRole = currentRole.roleName;
|
|
27
|
+
state.currentId = currentRole.roleId;
|
|
28
|
+
if (validRols.length > 2) {
|
|
29
|
+
validRols.filter(function (item) {
|
|
30
|
+
return item.roleName !== constants.AUTH || item.roleName !== constants.ANONYMOUS;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return validRols;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export var changeRole = function changeRole(_ref2) {
|
|
37
|
+
var constants = _ref2.constants,
|
|
38
|
+
emit = _ref2.emit,
|
|
39
|
+
props = _ref2.props,
|
|
40
|
+
service = _ref2.service,
|
|
41
|
+
state = _ref2.state;
|
|
42
|
+
return function (_ref3) {
|
|
43
|
+
var roleId = _ref3.roleId;
|
|
44
|
+
if (state.currentId === roleId) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
emit('change', roleId);
|
|
48
|
+
service.getCustomized().then(function (data) {
|
|
49
|
+
data = data || [];
|
|
50
|
+
var setting = data.filter(function (item) {
|
|
51
|
+
return item.settingKey === constants.GLOBAL;
|
|
52
|
+
})[0] || {};
|
|
53
|
+
var getRole = props.fetchRole ? props.fetchRole() : service.getChangeRoleUrl(roleId);
|
|
54
|
+
getRole.then(function (url) {
|
|
55
|
+
var keys = Object.keys(setting);
|
|
56
|
+
if (keys.indexOf(constants.ROLE) === -1) {
|
|
57
|
+
setting.lastRole = roleId;
|
|
58
|
+
service.pushCustomized(setting).then(function () {
|
|
59
|
+
window.location.href = xss.filterUrl(url);
|
|
60
|
+
});
|
|
61
|
+
} else {
|
|
62
|
+
window.location.href = xss.filterUrl(url);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
export var initService = function initService(service) {
|
|
69
|
+
var _ref4 = service || {},
|
|
70
|
+
_ref4$base = _ref4.base,
|
|
71
|
+
base = _ref4$base === void 0 ? {} : _ref4$base,
|
|
72
|
+
_ref4$common = _ref4.common,
|
|
73
|
+
common = _ref4$common === void 0 ? {} : _ref4$common,
|
|
74
|
+
pushCustomized = _ref4.pushCustomized;
|
|
75
|
+
var noopFn = function noopFn() {
|
|
76
|
+
return Promise.resolve(null);
|
|
77
|
+
};
|
|
78
|
+
var commonNoopFn = function commonNoopFn() {
|
|
79
|
+
return Promise.reject(new Error('[Tiny Error][Roles] This component depends on @opentiny/vue-service'));
|
|
80
|
+
};
|
|
81
|
+
return {
|
|
82
|
+
getEnvInfoSync: base.getEnvInfoSync || commonNoopFn,
|
|
83
|
+
getChangeRoleUrl: common.getChangeRoleUrl || commonNoopFn,
|
|
84
|
+
getCustomized: common.getCustomized || noopFn,
|
|
85
|
+
pushCustomized: pushCustomized || noopFn
|
|
86
|
+
};
|
|
87
|
+
};
|
package/roles/vue.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { showList, show, hide, getRoleList, changeRole, initService } from './index';
|
|
2
|
+
export var api = ['state', 'showList', 'show', 'hide', 'changeRole'];
|
|
3
|
+
export var renderless = function renderless(props, _ref, _ref2) {
|
|
4
|
+
var computed = _ref.computed,
|
|
5
|
+
reactive = _ref.reactive;
|
|
6
|
+
var emit = _ref2.emit,
|
|
7
|
+
service = _ref2.service,
|
|
8
|
+
constants = _ref2.constants;
|
|
9
|
+
var $service = initService(service);
|
|
10
|
+
var api = {};
|
|
11
|
+
var state = reactive({
|
|
12
|
+
currentRole: '',
|
|
13
|
+
currentId: '',
|
|
14
|
+
showPopover: true,
|
|
15
|
+
showIcon: true,
|
|
16
|
+
roleList: computed(function () {
|
|
17
|
+
return api.getRoleList();
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
api = {
|
|
21
|
+
state: state,
|
|
22
|
+
show: show(state),
|
|
23
|
+
hide: hide(state),
|
|
24
|
+
showList: showList(state),
|
|
25
|
+
getRoleList: getRoleList({
|
|
26
|
+
constants: constants,
|
|
27
|
+
service: $service,
|
|
28
|
+
state: state
|
|
29
|
+
}),
|
|
30
|
+
changeRole: changeRole({
|
|
31
|
+
constants: constants,
|
|
32
|
+
emit: emit,
|
|
33
|
+
props: props,
|
|
34
|
+
service: $service,
|
|
35
|
+
state: state
|
|
36
|
+
})
|
|
37
|
+
};
|
|
38
|
+
return api;
|
|
39
|
+
};
|
package/search/index.js
CHANGED
|
@@ -3,36 +3,41 @@ import PopupManager from '@opentiny/vue-renderless/common/deps/popup-manager';
|
|
|
3
3
|
import { isObject, typeOf } from '@opentiny/vue-renderless/common/type';
|
|
4
4
|
export var handleChange = function handleChange(_ref) {
|
|
5
5
|
var emit = _ref.emit,
|
|
6
|
-
props = _ref.props,
|
|
7
6
|
state = _ref.state;
|
|
8
7
|
return function (event) {
|
|
9
|
-
event.stopPropagation();
|
|
10
8
|
var value = event.target.value;
|
|
11
9
|
emit('change', state.searchValue, value);
|
|
12
|
-
props.modelValue !== undefined ? emit('update:modelValue', value) : emit('update:modelValue', value, state.searchValue);
|
|
13
10
|
};
|
|
14
11
|
};
|
|
15
|
-
export var
|
|
16
|
-
var
|
|
12
|
+
export var handleInput = function handleInput(_ref2) {
|
|
13
|
+
var emit = _ref2.emit,
|
|
17
14
|
state = _ref2.state;
|
|
15
|
+
return function (event) {
|
|
16
|
+
var value = event.target.value;
|
|
17
|
+
emit('update:modelValue', value, state.searchValue);
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export var showSelector = function showSelector(_ref3) {
|
|
21
|
+
var refs = _ref3.refs,
|
|
22
|
+
state = _ref3.state;
|
|
18
23
|
return function () {
|
|
19
|
-
refs
|
|
24
|
+
refs.selector.style.zIndex = PopupManager.nextZIndex();
|
|
20
25
|
state.show = true;
|
|
21
26
|
};
|
|
22
27
|
};
|
|
23
|
-
export var changeKey = function changeKey(
|
|
24
|
-
var emit =
|
|
25
|
-
state =
|
|
28
|
+
export var changeKey = function changeKey(_ref4) {
|
|
29
|
+
var emit = _ref4.emit,
|
|
30
|
+
state = _ref4.state;
|
|
26
31
|
return function (key) {
|
|
27
32
|
state.searchValue = key;
|
|
28
33
|
state.show = false;
|
|
29
34
|
emit('select', key);
|
|
30
35
|
};
|
|
31
36
|
};
|
|
32
|
-
export var searchClick = function searchClick(
|
|
33
|
-
var emit =
|
|
34
|
-
props =
|
|
35
|
-
state =
|
|
37
|
+
export var searchClick = function searchClick(_ref5) {
|
|
38
|
+
var emit = _ref5.emit,
|
|
39
|
+
props = _ref5.props,
|
|
40
|
+
state = _ref5.state;
|
|
36
41
|
return function () {
|
|
37
42
|
if (props.mini && state.collapse) {
|
|
38
43
|
state.collapse = false;
|
|
@@ -41,11 +46,11 @@ export var searchClick = function searchClick(_ref4) {
|
|
|
41
46
|
}
|
|
42
47
|
};
|
|
43
48
|
};
|
|
44
|
-
export var searchEnterKey = function searchEnterKey(
|
|
45
|
-
var api =
|
|
46
|
-
props =
|
|
47
|
-
refs =
|
|
48
|
-
nextTick =
|
|
49
|
+
export var searchEnterKey = function searchEnterKey(_ref6) {
|
|
50
|
+
var api = _ref6.api,
|
|
51
|
+
props = _ref6.props,
|
|
52
|
+
refs = _ref6.refs,
|
|
53
|
+
nextTick = _ref6.nextTick;
|
|
49
54
|
return function () {
|
|
50
55
|
if (props.isEnterSearch) {
|
|
51
56
|
api.searchClick();
|
|
@@ -55,10 +60,10 @@ export var searchEnterKey = function searchEnterKey(_ref5) {
|
|
|
55
60
|
}
|
|
56
61
|
};
|
|
57
62
|
};
|
|
58
|
-
export var clickOutside = function clickOutside(
|
|
59
|
-
var parent =
|
|
60
|
-
props =
|
|
61
|
-
state =
|
|
63
|
+
export var clickOutside = function clickOutside(_ref7) {
|
|
64
|
+
var parent = _ref7.parent,
|
|
65
|
+
props = _ref7.props,
|
|
66
|
+
state = _ref7.state;
|
|
62
67
|
return function (event) {
|
|
63
68
|
if (!parent.$el.contains(event.target)) {
|
|
64
69
|
state.show = false;
|
|
@@ -95,16 +100,16 @@ export var beforeDestroy = function beforeDestroy(api) {
|
|
|
95
100
|
off(document.body, 'click', api.clickOutside);
|
|
96
101
|
};
|
|
97
102
|
};
|
|
98
|
-
export var clear = function clear(
|
|
99
|
-
var emit =
|
|
100
|
-
refs =
|
|
101
|
-
state =
|
|
103
|
+
export var clear = function clear(_ref8) {
|
|
104
|
+
var emit = _ref8.emit,
|
|
105
|
+
refs = _ref8.refs,
|
|
106
|
+
state = _ref8.state;
|
|
102
107
|
return function () {
|
|
103
108
|
state.currentValue = '';
|
|
104
109
|
refs.input.focus();
|
|
105
110
|
state.focus = true;
|
|
106
111
|
emit('change', [], '');
|
|
107
|
-
emit('update:modelValue', '');
|
|
112
|
+
emit('update:modelValue', '', state.searchValue);
|
|
108
113
|
emit('clear');
|
|
109
114
|
};
|
|
110
115
|
};
|
package/search/vue.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
import { clear, handleChange, showSelector, changeKey, searchClick, clickOutside, beforeDestroy, mounted, formatSearchTypes, setDefaultType, searchEnterKey } from './index';
|
|
5
|
-
export var api = ['state', 'handleChange', 'showSelector', 'changeKey', 'searchClick', 'searchEnterKey', 'inputStyle', 'formatSearchTypes', 'setDefaultType', 'clear'];
|
|
4
|
+
import { clear, handleChange, handleInput, showSelector, changeKey, searchClick, clickOutside, beforeDestroy, mounted, formatSearchTypes, setDefaultType, searchEnterKey } from './index';
|
|
5
|
+
export var api = ['state', 'handleChange', 'handleInput', 'showSelector', 'changeKey', 'searchClick', 'searchEnterKey', 'inputStyle', 'formatSearchTypes', 'setDefaultType', 'clear'];
|
|
6
6
|
export var useFormatSearchTypes = function useFormatSearchTypes(_ref) {
|
|
7
7
|
var computed = _ref.computed,
|
|
8
8
|
props = _ref.props,
|
|
@@ -76,6 +76,11 @@ export var renderless = function renderless(props, _ref2, _ref3) {
|
|
|
76
76
|
state: state,
|
|
77
77
|
props: props
|
|
78
78
|
}),
|
|
79
|
+
handleInput: handleInput({
|
|
80
|
+
emit: emit,
|
|
81
|
+
state: state,
|
|
82
|
+
props: props
|
|
83
|
+
}),
|
|
79
84
|
showSelector: showSelector({
|
|
80
85
|
refs: refs,
|
|
81
86
|
state: state
|