@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/user/vue.js
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { initUser, handleBlur, updateOptions, useSortable, userChange, suggestUser, autoSelect, searchMethod, setSelected, getUsers, updateCache, saveCache, cacheUser, visibleChange, initService, filter } from './index';
|
|
2
|
+
export var api = ['state', 'handleBlur', 'searchMethod', 'userChange', 'visibleChange', 'useSortable', 'filter'];
|
|
3
|
+
export var renderless = function renderless(props, _ref, _ref2) {
|
|
4
|
+
var reactive = _ref.reactive,
|
|
5
|
+
watch = _ref.watch;
|
|
6
|
+
var emit = _ref2.emit,
|
|
7
|
+
nextTick = _ref2.nextTick,
|
|
8
|
+
refs = _ref2.refs,
|
|
9
|
+
service = _ref2.service,
|
|
10
|
+
constants = _ref2.constants,
|
|
11
|
+
dispatch = _ref2.dispatch;
|
|
12
|
+
var api = {};
|
|
13
|
+
var $service = initService({
|
|
14
|
+
props: props,
|
|
15
|
+
service: service
|
|
16
|
+
});
|
|
17
|
+
var state = reactive({
|
|
18
|
+
loading: false,
|
|
19
|
+
options: [],
|
|
20
|
+
hisOptions: [],
|
|
21
|
+
user: props.multiple ? [] : '',
|
|
22
|
+
selected: [],
|
|
23
|
+
visible: false,
|
|
24
|
+
lastValue: null,
|
|
25
|
+
type: props.valueField,
|
|
26
|
+
sortable: null,
|
|
27
|
+
overflow: false,
|
|
28
|
+
addevnet: false,
|
|
29
|
+
batch: props.batch === false ? false : props.batch || $service.batch
|
|
30
|
+
});
|
|
31
|
+
Object.assign(api, {
|
|
32
|
+
state: state,
|
|
33
|
+
fetchW3Accounts: $service.fetchW3Accounts,
|
|
34
|
+
fetchSuggestUser: $service.fetchSuggestUser,
|
|
35
|
+
fetchUserByUserId: $service.fetchUserByUserId,
|
|
36
|
+
visibleChange: visibleChange({
|
|
37
|
+
state: state,
|
|
38
|
+
emit: emit
|
|
39
|
+
}),
|
|
40
|
+
saveCache: saveCache({
|
|
41
|
+
props: props
|
|
42
|
+
}),
|
|
43
|
+
updateCache: updateCache({
|
|
44
|
+
props: props,
|
|
45
|
+
state: state
|
|
46
|
+
}),
|
|
47
|
+
autoSelect: autoSelect({
|
|
48
|
+
props: props,
|
|
49
|
+
state: state,
|
|
50
|
+
nextTick: nextTick
|
|
51
|
+
}),
|
|
52
|
+
updateOptions: updateOptions({
|
|
53
|
+
props: props,
|
|
54
|
+
state: state,
|
|
55
|
+
nextTick: nextTick
|
|
56
|
+
}),
|
|
57
|
+
handleBlur: handleBlur({
|
|
58
|
+
constants: constants,
|
|
59
|
+
dispatch: dispatch,
|
|
60
|
+
state: state
|
|
61
|
+
}),
|
|
62
|
+
filter: filter({
|
|
63
|
+
props: props,
|
|
64
|
+
state: state
|
|
65
|
+
}),
|
|
66
|
+
suggestUser: suggestUser(api),
|
|
67
|
+
cacheUser: cacheUser({
|
|
68
|
+
api: api,
|
|
69
|
+
props: props,
|
|
70
|
+
service: $service
|
|
71
|
+
}),
|
|
72
|
+
initUser: initUser({
|
|
73
|
+
api: api,
|
|
74
|
+
props: props,
|
|
75
|
+
state: state
|
|
76
|
+
}),
|
|
77
|
+
getUsers: getUsers({
|
|
78
|
+
api: api,
|
|
79
|
+
props: props,
|
|
80
|
+
state: state
|
|
81
|
+
}),
|
|
82
|
+
setSelected: setSelected({
|
|
83
|
+
api: api,
|
|
84
|
+
props: props,
|
|
85
|
+
state: state
|
|
86
|
+
}),
|
|
87
|
+
searchMethod: searchMethod({
|
|
88
|
+
api: api,
|
|
89
|
+
props: props,
|
|
90
|
+
state: state,
|
|
91
|
+
emit: emit
|
|
92
|
+
}),
|
|
93
|
+
userChange: userChange({
|
|
94
|
+
api: api,
|
|
95
|
+
emit: emit,
|
|
96
|
+
props: props,
|
|
97
|
+
state: state
|
|
98
|
+
}),
|
|
99
|
+
useSortable: useSortable({
|
|
100
|
+
api: api,
|
|
101
|
+
props: props,
|
|
102
|
+
state: state,
|
|
103
|
+
refs: refs
|
|
104
|
+
})
|
|
105
|
+
});
|
|
106
|
+
props.cache && api.updateCache();
|
|
107
|
+
watch(function () {
|
|
108
|
+
return props.modelValue;
|
|
109
|
+
}, api.initUser, {
|
|
110
|
+
immediate: true
|
|
111
|
+
});
|
|
112
|
+
return api;
|
|
113
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export var init = function init(_ref) {
|
|
2
|
+
var service = _ref.service,
|
|
3
|
+
state = _ref.state;
|
|
4
|
+
return function () {
|
|
5
|
+
var getUserInfo = service.getUserInfo,
|
|
6
|
+
getUserImageUrl = service.getUserImageUrl,
|
|
7
|
+
getLangData = service.getLangData;
|
|
8
|
+
getLangData().then(function (langData) {
|
|
9
|
+
getUserInfo().then(function (user) {
|
|
10
|
+
getUserImageUrl(user.employeeNumber).then(function (url) {
|
|
11
|
+
var _langData$locale = langData.locale,
|
|
12
|
+
locale = _langData$locale === void 0 ? 'zhCN' : _langData$locale;
|
|
13
|
+
var displayNameCn = user.displayNameCn,
|
|
14
|
+
displayNameEn = user.displayNameEn,
|
|
15
|
+
userCN = user.userCN;
|
|
16
|
+
var displayName = locale === 'zhCN' ? displayNameCn || userCN : displayNameEn || userCN;
|
|
17
|
+
state.imgUrl = url;
|
|
18
|
+
state.userName = displayName;
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { initService } from '@opentiny/vue-renderless/user';
|
|
2
|
+
import { init } from './index';
|
|
3
|
+
export var api = ['state'];
|
|
4
|
+
export var renderless = function renderless(props, _ref, _ref2) {
|
|
5
|
+
var reactive = _ref.reactive;
|
|
6
|
+
var service = _ref2.service;
|
|
7
|
+
var $service = initService({
|
|
8
|
+
props: props,
|
|
9
|
+
service: service
|
|
10
|
+
});
|
|
11
|
+
var state = reactive({
|
|
12
|
+
imgUrl: '',
|
|
13
|
+
userName: '',
|
|
14
|
+
roleNumber: ''
|
|
15
|
+
});
|
|
16
|
+
var api = {
|
|
17
|
+
state: state,
|
|
18
|
+
init: init({
|
|
19
|
+
service: $service,
|
|
20
|
+
state: state
|
|
21
|
+
})
|
|
22
|
+
};
|
|
23
|
+
api.init();
|
|
24
|
+
return api;
|
|
25
|
+
};
|
package/user-contact/index.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
export var getUserHref = function getUserHref(_ref) {
|
|
2
|
-
var
|
|
3
|
-
props = _ref.props;
|
|
2
|
+
var props = _ref.props;
|
|
4
3
|
return function () {
|
|
5
4
|
var href = 'javascript:;';
|
|
6
5
|
if (!props.isNewImMode) {
|
|
7
|
-
var data = props.data;
|
|
8
|
-
var userDescription = data.userDescription ? data.userDescription.toLocaleLowerCase() : '';
|
|
9
6
|
href = 'javascript:;';
|
|
10
7
|
}
|
|
11
8
|
return href;
|
package/user-head/index.js
CHANGED
|
@@ -10,8 +10,7 @@ export var computedStyle = function computedStyle(_ref) {
|
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
-
export var computedMessage = function computedMessage(
|
|
14
|
-
var props = _ref2.props;
|
|
13
|
+
export var computedMessage = function computedMessage(props) {
|
|
15
14
|
return function () {
|
|
16
15
|
var result = '';
|
|
17
16
|
var total = Math.floor(props.messageTotal);
|
|
@@ -24,9 +23,9 @@ export var computedMessage = function computedMessage(_ref2) {
|
|
|
24
23
|
return result;
|
|
25
24
|
};
|
|
26
25
|
};
|
|
27
|
-
export var computedFontSize = function computedFontSize(
|
|
28
|
-
var props =
|
|
29
|
-
state =
|
|
26
|
+
export var computedFontSize = function computedFontSize(_ref2) {
|
|
27
|
+
var props = _ref2.props,
|
|
28
|
+
state = _ref2.state;
|
|
30
29
|
return function () {
|
|
31
30
|
var fontSize = '';
|
|
32
31
|
if (props.type === 'label' && state.label && !props.min) {
|
|
@@ -46,17 +45,16 @@ export var computedFontSize = function computedFontSize(_ref3) {
|
|
|
46
45
|
};
|
|
47
46
|
};
|
|
48
47
|
};
|
|
49
|
-
export var computedLabel = function computedLabel(
|
|
50
|
-
var state =
|
|
51
|
-
props =
|
|
48
|
+
export var computedLabel = function computedLabel(_ref3) {
|
|
49
|
+
var state = _ref3.state,
|
|
50
|
+
props = _ref3.props;
|
|
52
51
|
return function () {
|
|
53
52
|
return props.min ? state.internalValue.substr(0, 2) : state.internalValue.substr(0, 6);
|
|
54
53
|
};
|
|
55
54
|
};
|
|
56
|
-
export var getInternalValue = function getInternalValue(
|
|
57
|
-
var props = _ref5.props;
|
|
55
|
+
export var getInternalValue = function getInternalValue(props) {
|
|
58
56
|
return function () {
|
|
59
|
-
if (props.modelValue
|
|
57
|
+
if (!props.modelValue) {
|
|
60
58
|
var result = '';
|
|
61
59
|
if (props.type === 'icon') {
|
|
62
60
|
result = 'icon-user';
|
package/user-head/vue.js
CHANGED
|
@@ -4,12 +4,8 @@ export var renderless = function renderless(props, _ref) {
|
|
|
4
4
|
var reactive = _ref.reactive,
|
|
5
5
|
computed = _ref.computed;
|
|
6
6
|
var api = {
|
|
7
|
-
computedMessage: computedMessage(
|
|
8
|
-
|
|
9
|
-
}),
|
|
10
|
-
getInternalValue: getInternalValue({
|
|
11
|
-
props: props
|
|
12
|
-
})
|
|
7
|
+
computedMessage: computedMessage(props),
|
|
8
|
+
getInternalValue: getInternalValue(props)
|
|
13
9
|
};
|
|
14
10
|
var state = reactive({
|
|
15
11
|
internalValue: computed(function () {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export var initUser = function initUser(_ref) {
|
|
2
|
+
var api = _ref.api,
|
|
3
|
+
props = _ref.props,
|
|
4
|
+
state = _ref.state;
|
|
5
|
+
return function (value) {
|
|
6
|
+
if (!value) {
|
|
7
|
+
state.user = value;
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
api.getUsers(value).then(function (info) {
|
|
11
|
+
info.sort(function (a, b) {
|
|
12
|
+
return value.indexOf(String(a[props.valueField])) > value.indexOf(String(b[props.valueField])) ? 1 : -1;
|
|
13
|
+
});
|
|
14
|
+
var list = info.map(function (user) {
|
|
15
|
+
return user[props.valueField];
|
|
16
|
+
});
|
|
17
|
+
state.options = info;
|
|
18
|
+
state.user = props.multiple ? list : list[0];
|
|
19
|
+
props.cache && api.cacheUser(info);
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export var showCard = function showCard(_ref2) {
|
|
24
|
+
var api = _ref2.api,
|
|
25
|
+
service = _ref2.service,
|
|
26
|
+
state = _ref2.state;
|
|
27
|
+
return function (user) {
|
|
28
|
+
state.spinner = true;
|
|
29
|
+
state.expand = false;
|
|
30
|
+
service.fetchUser(user.employeeNumber).then(function (data) {
|
|
31
|
+
state.data = data;
|
|
32
|
+
state.spinner = false;
|
|
33
|
+
});
|
|
34
|
+
api.getUserImageUrl(user.employeeNumber).then(function (url) {
|
|
35
|
+
state.imgUrl = url;
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export var showDetail = function showDetail(state) {
|
|
40
|
+
return function () {
|
|
41
|
+
state.expand = !state.expand;
|
|
42
|
+
};
|
|
43
|
+
};
|
package/user-link/vue.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { getUsers, cacheUser, saveCache, initService } from '@opentiny/vue-renderless/user';
|
|
2
|
+
import { initUser, showCard, showDetail } from './index';
|
|
3
|
+
export var api = ['state', 'showCard', 'showDetail'];
|
|
4
|
+
export var renderless = function renderless(props, _ref, _ref2) {
|
|
5
|
+
var reactive = _ref.reactive,
|
|
6
|
+
watch = _ref.watch;
|
|
7
|
+
var service = _ref2.service;
|
|
8
|
+
service = initService({
|
|
9
|
+
props: props,
|
|
10
|
+
service: service
|
|
11
|
+
});
|
|
12
|
+
var api = {};
|
|
13
|
+
var state = reactive({
|
|
14
|
+
options: [],
|
|
15
|
+
user: [],
|
|
16
|
+
selected: [],
|
|
17
|
+
type: props.valueField,
|
|
18
|
+
expand: false,
|
|
19
|
+
data: {},
|
|
20
|
+
spinner: true,
|
|
21
|
+
imgUrl: '',
|
|
22
|
+
batch: props.batch === false ? false : props.batch || service.batch
|
|
23
|
+
});
|
|
24
|
+
Object.assign(api, {
|
|
25
|
+
state: state,
|
|
26
|
+
showDetail: showDetail(state),
|
|
27
|
+
saveCache: saveCache({
|
|
28
|
+
props: props
|
|
29
|
+
}),
|
|
30
|
+
cacheUser: cacheUser({
|
|
31
|
+
api: api,
|
|
32
|
+
props: props,
|
|
33
|
+
service: service
|
|
34
|
+
}),
|
|
35
|
+
initUser: initUser({
|
|
36
|
+
api: api,
|
|
37
|
+
props: props,
|
|
38
|
+
state: state
|
|
39
|
+
}),
|
|
40
|
+
getUsers: getUsers({
|
|
41
|
+
api: api,
|
|
42
|
+
props: props,
|
|
43
|
+
state: state
|
|
44
|
+
}),
|
|
45
|
+
showCard: showCard({
|
|
46
|
+
api: api,
|
|
47
|
+
service: service,
|
|
48
|
+
state: state
|
|
49
|
+
}),
|
|
50
|
+
getUserImageUrl: service.getUserImageUrl,
|
|
51
|
+
fetchW3Accounts: service.fetchW3Accounts,
|
|
52
|
+
fetchUserByUserId: service.fetchUserByUserId
|
|
53
|
+
});
|
|
54
|
+
watch(function () {
|
|
55
|
+
return props.modelValue;
|
|
56
|
+
}, api.initUser, {
|
|
57
|
+
immediate: true
|
|
58
|
+
});
|
|
59
|
+
return api;
|
|
60
|
+
};
|