@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/locales/index.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import { xss } from '@opentiny/vue-renderless/common';
|
|
3
|
+
export var getLocales = function getLocales(_ref) {
|
|
4
|
+
var api = _ref.api,
|
|
5
|
+
service = _ref.service,
|
|
6
|
+
state = _ref.state;
|
|
7
|
+
return function () {
|
|
8
|
+
Promise.all([service.getLocale(), service.getCurrentLocale()]).then(function (_ref2) {
|
|
9
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
10
|
+
locales = _ref3[0],
|
|
11
|
+
current = _ref3[1];
|
|
12
|
+
state.locales = locales || ['zhCN'];
|
|
13
|
+
state.current = (Array.isArray(current) ? current[0] : current) || 'zhCN';
|
|
14
|
+
api.setText(current);
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export var setText = function setText(state) {
|
|
19
|
+
return function () {
|
|
20
|
+
var current = state.current,
|
|
21
|
+
locales = state.locales;
|
|
22
|
+
var len = locales.length;
|
|
23
|
+
state.text = len === 2 ? locales.indexOf(current) === 0 ? locales[1] : locales[0] : current;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export var switchLanguage = function switchLanguage(_ref4) {
|
|
27
|
+
var api = _ref4.api,
|
|
28
|
+
state = _ref4.state,
|
|
29
|
+
service = _ref4.service;
|
|
30
|
+
return function (lang) {
|
|
31
|
+
var locales = state.locales,
|
|
32
|
+
current = state.current;
|
|
33
|
+
var domain = service.getDomain();
|
|
34
|
+
var hasMultiLocale = state.locales.length === 2;
|
|
35
|
+
state.current = hasMultiLocale ? state.current = locales.indexOf(current) === 0 ? locales[1] : locales[0] : lang;
|
|
36
|
+
var expires = new Date(new Date().getTime() + 3600000).toGMTString();
|
|
37
|
+
var currLang = state.current.substring(0, 2) === 'zh' ? 'zh' : 'en';
|
|
38
|
+
document.cookie = "lang=".concat(currLang, ";expires=").concat(expires, ";domain=").concat(domain, ";path=/");
|
|
39
|
+
api.setText();
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export var changeLocale = function changeLocale(_ref5) {
|
|
43
|
+
var props = _ref5.props,
|
|
44
|
+
service = _ref5.service,
|
|
45
|
+
vnode = _ref5.vnode;
|
|
46
|
+
return function (value, oldValue) {
|
|
47
|
+
if (!value || !oldValue) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
var local = props.local,
|
|
51
|
+
changeLang = props.changeLang;
|
|
52
|
+
if (typeof changeLang === 'function') {
|
|
53
|
+
changeLang(value);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (local) {
|
|
57
|
+
value.slice(0, 2) === 'zh' ? vnode.use(vnode.zhCN) : vnode.use(vnode.enUS);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
var _service$customized$c = service.customized.content,
|
|
61
|
+
content = _service$customized$c === void 0 ? '' : _service$customized$c;
|
|
62
|
+
service.getCustomized().then(function (data) {
|
|
63
|
+
data = data || [];
|
|
64
|
+
var setting = data.filter(function (item) {
|
|
65
|
+
return item.settingKey === vnode.constants.GLOBAL;
|
|
66
|
+
})[0] || {};
|
|
67
|
+
service.getChangeLocaleUrl(value).then(function (url) {
|
|
68
|
+
try {
|
|
69
|
+
var settingContent = JSON.parse(setting[content]);
|
|
70
|
+
settingContent.lang = value;
|
|
71
|
+
settingContent.common.lang = value;
|
|
72
|
+
setting[content] = JSON.stringify(settingContent);
|
|
73
|
+
service.pushCustomized(setting).then(function () {
|
|
74
|
+
window.location.href = xss.filterUrl(url);
|
|
75
|
+
});
|
|
76
|
+
} catch (error) {
|
|
77
|
+
window.location.href = xss.filterUrl(url);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
export var initService = function initService(_ref6) {
|
|
84
|
+
var props = _ref6.props,
|
|
85
|
+
service = _ref6.service;
|
|
86
|
+
var _ref7 = service || {},
|
|
87
|
+
_ref7$common = _ref7.common,
|
|
88
|
+
common = _ref7$common === void 0 ? {} : _ref7$common,
|
|
89
|
+
_ref7$utils = _ref7.utils,
|
|
90
|
+
utils = _ref7$utils === void 0 ? {} : _ref7$utils,
|
|
91
|
+
_ref7$setting = _ref7.setting,
|
|
92
|
+
setting = _ref7$setting === void 0 ? {} : _ref7$setting,
|
|
93
|
+
fetchSsoUpdate = _ref7.fetchSsoUpdate,
|
|
94
|
+
pushCustomized = _ref7.pushCustomized;
|
|
95
|
+
var _setting$options = setting.options,
|
|
96
|
+
options = _setting$options === void 0 ? {} : _setting$options;
|
|
97
|
+
var noopFnCreator = function noopFnCreator(propName) {
|
|
98
|
+
return function () {
|
|
99
|
+
if (propName) {
|
|
100
|
+
return Promise.reject(new Error("[AUI Error][Locale] Prop ".concat(propName, " is not configured")));
|
|
101
|
+
} else {
|
|
102
|
+
return Promise.resolve(null);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
return {
|
|
107
|
+
getLocale: props.getLocale || common.getLocale || noopFnCreator('getLocale'),
|
|
108
|
+
getCurrentLocale: props.getCurrentLocale || common.getCurrentLocale || noopFnCreator('getCurrentLocale'),
|
|
109
|
+
getChangeLocaleUrl: props.getChangeLocaleUrl || common.getChangeLocaleUrl || noopFnCreator('getChangeLocaleUrl'),
|
|
110
|
+
fetchSsoUpdate: props.fetchSsoUpdate || fetchSsoUpdate || noopFnCreator('fetchSsoUpdate'),
|
|
111
|
+
getDomain: props.getDomain || utils.getDomain || noopFnCreator('getDomain'),
|
|
112
|
+
getCustomized: common.getCustomized || noopFnCreator(),
|
|
113
|
+
pushCustomized: pushCustomized || noopFnCreator(),
|
|
114
|
+
customized: options.Customized || {}
|
|
115
|
+
};
|
|
116
|
+
};
|
package/locales/vue.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { getLocales, setText, switchLanguage, initService, changeLocale } from './index';
|
|
2
|
+
export var api = ['state', 'switchLanguage', 't', 'changeLocale'];
|
|
3
|
+
export var renderless = function renderless(props, _ref, _ref2, vnode) {
|
|
4
|
+
var reactive = _ref.reactive,
|
|
5
|
+
watch = _ref.watch;
|
|
6
|
+
var t = _ref2.t,
|
|
7
|
+
service = _ref2.service;
|
|
8
|
+
var api = {};
|
|
9
|
+
var $service = initService({
|
|
10
|
+
props: props,
|
|
11
|
+
service: service
|
|
12
|
+
});
|
|
13
|
+
var state = reactive({
|
|
14
|
+
current: '',
|
|
15
|
+
locales: [],
|
|
16
|
+
visible: false,
|
|
17
|
+
text: ''
|
|
18
|
+
});
|
|
19
|
+
Object.assign(api, {
|
|
20
|
+
t: t,
|
|
21
|
+
state: state,
|
|
22
|
+
setText: setText(state),
|
|
23
|
+
changeLocale: changeLocale({
|
|
24
|
+
props: props,
|
|
25
|
+
service: $service,
|
|
26
|
+
vnode: vnode
|
|
27
|
+
}),
|
|
28
|
+
switchLanguage: switchLanguage({
|
|
29
|
+
api: api,
|
|
30
|
+
service: $service,
|
|
31
|
+
state: state
|
|
32
|
+
}),
|
|
33
|
+
getLocales: getLocales({
|
|
34
|
+
api: api,
|
|
35
|
+
service: $service,
|
|
36
|
+
state: state
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
api.getLocales();
|
|
40
|
+
watch(function () {
|
|
41
|
+
return state.current;
|
|
42
|
+
}, api.changeLocale, {
|
|
43
|
+
immediate: true
|
|
44
|
+
});
|
|
45
|
+
return api;
|
|
46
|
+
};
|
|
@@ -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
|
+
getUserInfo().then(function (user) {
|
|
7
|
+
state.userName = user.userCN;
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export var initService = function initService(_ref2) {
|
|
12
|
+
var props = _ref2.props,
|
|
13
|
+
service = _ref2.service;
|
|
14
|
+
var _ref3 = service || {},
|
|
15
|
+
_ref3$base = _ref3.base,
|
|
16
|
+
base = _ref3$base === void 0 ? {} : _ref3$base;
|
|
17
|
+
var getUserInfoNoop = function getUserInfoNoop() {
|
|
18
|
+
return Promise.reject(new Error('[TINY Error][LogonUser] Prop getUserInfo is not configured'));
|
|
19
|
+
};
|
|
20
|
+
return {
|
|
21
|
+
getUserInfo: props.getUserInfo || base.getUserInfo || getUserInfoNoop
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { init, initService } from './index';
|
|
2
|
+
export var api = ['state'];
|
|
3
|
+
export var renderless = function renderless(props, _ref, _ref2) {
|
|
4
|
+
var reactive = _ref.reactive;
|
|
5
|
+
var service = _ref2.service;
|
|
6
|
+
var $service = initService({
|
|
7
|
+
props: props,
|
|
8
|
+
service: service
|
|
9
|
+
});
|
|
10
|
+
var state = reactive({
|
|
11
|
+
userName: ''
|
|
12
|
+
});
|
|
13
|
+
var api = {
|
|
14
|
+
state: state,
|
|
15
|
+
init: init({
|
|
16
|
+
service: $service,
|
|
17
|
+
state: state
|
|
18
|
+
})
|
|
19
|
+
};
|
|
20
|
+
api.init();
|
|
21
|
+
return api;
|
|
22
|
+
};
|
package/logout/index.js
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { xss } from '@opentiny/vue-renderless/common';
|
|
2
|
+
export var logout = function logout(_ref) {
|
|
3
|
+
var service = _ref.service,
|
|
4
|
+
state = _ref.state,
|
|
5
|
+
props = _ref.props;
|
|
6
|
+
return function () {
|
|
7
|
+
var isMock = service.isMock,
|
|
8
|
+
isLocal = service.isLocal,
|
|
9
|
+
_service$redirectUrl = service.redirectUrl,
|
|
10
|
+
redirectUrl = _service$redirectUrl === void 0 ? '' : _service$redirectUrl,
|
|
11
|
+
getLogoutUrl = service.getLogoutUrl,
|
|
12
|
+
showLogin = service.showLogin;
|
|
13
|
+
if (typeof props.beforeLogout === 'function') {
|
|
14
|
+
if (props.beforeLogout(redirectUrl) === false) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if (state.logout) {
|
|
19
|
+
showLogin();
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
var location = window.location;
|
|
23
|
+
if (redirectUrl) {
|
|
24
|
+
var isFullPath = redirectUrl.indexOf('//') > -1;
|
|
25
|
+
if (!isFullPath) {
|
|
26
|
+
redirectUrl.indexOf('#/') === 0 || (redirectUrl = '#/' + redirectUrl);
|
|
27
|
+
redirectUrl = location.protocol + '//' + location.host + location.pathname + redirectUrl;
|
|
28
|
+
}
|
|
29
|
+
} else {
|
|
30
|
+
redirectUrl = location.href;
|
|
31
|
+
}
|
|
32
|
+
redirectUrl = xss.filterUrl(redirectUrl);
|
|
33
|
+
if (!isMock || !isLocal) {
|
|
34
|
+
getLogoutUrl(redirectUrl).then(function (url) {
|
|
35
|
+
var temp = decodeURIComponent(url);
|
|
36
|
+
if (/%[a-fA-F0-9]{2}/.test(temp)) {
|
|
37
|
+
temp = decodeURIComponent(temp);
|
|
38
|
+
}
|
|
39
|
+
location.href = xss.filterUrl(temp);
|
|
40
|
+
});
|
|
41
|
+
} else {
|
|
42
|
+
location.href = xss.filterUrl(redirectUrl);
|
|
43
|
+
}
|
|
44
|
+
state.logout = true;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export var initService = function initService(_ref2) {
|
|
48
|
+
var props = _ref2.props,
|
|
49
|
+
service = _ref2.service;
|
|
50
|
+
var noopFnCreator = function noopFnCreator(propName) {
|
|
51
|
+
return function () {
|
|
52
|
+
if (propName) {
|
|
53
|
+
return Promise.reject(new Error("[TINY Error][Logout] Prop ".concat(propName, " is not configured")));
|
|
54
|
+
} else {
|
|
55
|
+
return Promise.reject(new Error('[TINY Error][Logout] This component depends on @opentiny/vue-service'));
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
var _ref3 = service || {},
|
|
60
|
+
_ref3$base = _ref3.base,
|
|
61
|
+
base = _ref3$base === void 0 ? {} : _ref3$base,
|
|
62
|
+
_ref3$common = _ref3.common,
|
|
63
|
+
common = _ref3$common === void 0 ? {} : _ref3$common,
|
|
64
|
+
_ref3$setting = _ref3.setting,
|
|
65
|
+
setting = _ref3$setting === void 0 ? {} : _ref3$setting,
|
|
66
|
+
_ref3$network = _ref3.network,
|
|
67
|
+
network = _ref3$network === void 0 ? {} : _ref3$network,
|
|
68
|
+
_ref3$ajax = _ref3.ajax,
|
|
69
|
+
ajax = _ref3$ajax === void 0 ? {} : _ref3$ajax,
|
|
70
|
+
_ref3$message = _ref3.message,
|
|
71
|
+
message = _ref3$message === void 0 ? {} : _ref3$message;
|
|
72
|
+
var _setting$options = setting.options,
|
|
73
|
+
options = _setting$options === void 0 ? {} : _setting$options,
|
|
74
|
+
_setting$services = setting.services,
|
|
75
|
+
services = _setting$services === void 0 ? {} : _setting$services,
|
|
76
|
+
_setting$redirectUrl = setting.redirectUrl,
|
|
77
|
+
redirectUrl = _setting$redirectUrl === void 0 ? '' : _setting$redirectUrl,
|
|
78
|
+
_setting$local = setting.local,
|
|
79
|
+
local = _setting$local === void 0 ? false : _setting$local;
|
|
80
|
+
var _network$isMock = network.isMock,
|
|
81
|
+
isMock = _network$isMock === void 0 ? function () {
|
|
82
|
+
return false;
|
|
83
|
+
} : _network$isMock;
|
|
84
|
+
var _base$getUserInfoSync = base.getUserInfoSync,
|
|
85
|
+
getUserInfoSync = _base$getUserInfoSync === void 0 ? noopFnCreator() : _base$getUserInfoSync;
|
|
86
|
+
var _ajax$config = ajax.config,
|
|
87
|
+
config = _ajax$config === void 0 ? noopFnCreator() : _ajax$config;
|
|
88
|
+
var _message$subscribe = message.subscribe,
|
|
89
|
+
subscribe = _message$subscribe === void 0 ? noopFnCreator() : _message$subscribe,
|
|
90
|
+
_message$publish = message.publish,
|
|
91
|
+
publish = _message$publish === void 0 ? noopFnCreator() : _message$publish;
|
|
92
|
+
return {
|
|
93
|
+
getLogoutUrl: props.getLogoutUrl || common.getLogoutUrl || noopFnCreator('getLogoutUrl'),
|
|
94
|
+
redirectUrl: props.redirectUrl || redirectUrl,
|
|
95
|
+
isLocal: props.isLocal || local,
|
|
96
|
+
network: props.network || network,
|
|
97
|
+
isMock: props.isMock || isMock(),
|
|
98
|
+
isGuestUser: props.isGuestUser || function () {
|
|
99
|
+
return getUserInfoSync().userAccount === props.guestRole;
|
|
100
|
+
},
|
|
101
|
+
showLogin: props.showLogin || function () {
|
|
102
|
+
window.document.domain = options.Domain;
|
|
103
|
+
var gateway = config();
|
|
104
|
+
subscribe({
|
|
105
|
+
topic: 'aurora.ui.closeLoginDialog',
|
|
106
|
+
callback: function callback() {
|
|
107
|
+
window.location.reload();
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
publish({
|
|
111
|
+
topic: 'aurora.ui.displayLoginDialog',
|
|
112
|
+
data: {
|
|
113
|
+
url: gateway.getRequestUrl(services.Framework.RebuildSession)
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
};
|
package/logout/vue.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { logout, initService } from './index';
|
|
2
|
+
export var api = ['state', 'logout'];
|
|
3
|
+
export var renderless = function renderless(props, _ref, _ref2) {
|
|
4
|
+
var reactive = _ref.reactive;
|
|
5
|
+
var service = _ref2.service;
|
|
6
|
+
var $service = initService({
|
|
7
|
+
props: props,
|
|
8
|
+
service: service
|
|
9
|
+
});
|
|
10
|
+
var state = reactive({
|
|
11
|
+
logout: $service.isGuestUser()
|
|
12
|
+
});
|
|
13
|
+
var api = {
|
|
14
|
+
state: state,
|
|
15
|
+
logout: logout({
|
|
16
|
+
service: $service,
|
|
17
|
+
state: state,
|
|
18
|
+
props: props
|
|
19
|
+
})
|
|
20
|
+
};
|
|
21
|
+
return api;
|
|
22
|
+
};
|
package/milestone/index.js
CHANGED
package/mini-picker/index.js
CHANGED
|
@@ -52,7 +52,7 @@ export var formatCascade = function formatCascade(_ref3) {
|
|
|
52
52
|
children: state.columns
|
|
53
53
|
};
|
|
54
54
|
while (cursor && cursor.children) {
|
|
55
|
-
var defaultIndex = cursor.defaultIndex ||
|
|
55
|
+
var defaultIndex = cursor.defaultIndex || Number(state.defaultIndex);
|
|
56
56
|
formatted.push({
|
|
57
57
|
values: cursor.children.map(function (item) {
|
|
58
58
|
return item[props.valueKey];
|
package/mini-picker/vue.js
CHANGED
|
@@ -8,7 +8,7 @@ var initState = function initState(_ref) {
|
|
|
8
8
|
var state = reactive({
|
|
9
9
|
columns: props.columns,
|
|
10
10
|
toggle: false,
|
|
11
|
-
itemHeight:
|
|
11
|
+
itemHeight: Number(props.itemHeight),
|
|
12
12
|
defaultIndex: props.defaultIndex,
|
|
13
13
|
visibleItemCount: props.visibleItemCount,
|
|
14
14
|
clumnsWrapHeight: null,
|
package/modal/index.js
CHANGED
|
@@ -199,7 +199,7 @@ export var updateStyle = function updateStyle(nextTick) {
|
|
|
199
199
|
MsgQueue.forEach(function (comp) {
|
|
200
200
|
offsetTop += parseFloat(comp.top);
|
|
201
201
|
comp.state.modalTop = offsetTop;
|
|
202
|
-
var modalBox = comp.$el.querySelector('.tiny-
|
|
202
|
+
var modalBox = comp.$el.querySelector('.tiny-modal__box');
|
|
203
203
|
offsetTop += modalBox.clientHeight;
|
|
204
204
|
});
|
|
205
205
|
});
|
|
@@ -770,7 +770,9 @@ var updateDelta = function updateDelta(_ref26) {
|
|
|
770
770
|
};
|
|
771
771
|
function _findFormComponent(vm, formList) {
|
|
772
772
|
var children = vm.$children;
|
|
773
|
-
if (children && children.length === 0)
|
|
773
|
+
if (children && children.length === 0) {
|
|
774
|
+
return;
|
|
775
|
+
}
|
|
774
776
|
children.forEach(function (child) {
|
|
775
777
|
var tag = child.$options.componentName;
|
|
776
778
|
if (/^Form$/.test(tag)) {
|
package/month-table/index.js
CHANGED
|
@@ -36,7 +36,7 @@ export var getRows = function getRows(_ref) {
|
|
|
36
36
|
maxDate = props.maxDate;
|
|
37
37
|
for (var i = 0; i < 3; i++) {
|
|
38
38
|
var row = tableRows[i];
|
|
39
|
-
var _loop = function _loop(
|
|
39
|
+
var _loop = function _loop() {
|
|
40
40
|
var cell = row[j];
|
|
41
41
|
if (!cell) {
|
|
42
42
|
cell = {
|
|
@@ -67,7 +67,7 @@ export var getRows = function getRows(_ref) {
|
|
|
67
67
|
vm.$set(row, j, cell);
|
|
68
68
|
};
|
|
69
69
|
for (var j = 0; j < 4; j++) {
|
|
70
|
-
_loop(
|
|
70
|
+
_loop();
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
return tableRows;
|
package/nav-menu/index.js
CHANGED
|
@@ -154,7 +154,7 @@ export var initData = function initData(_ref4) {
|
|
|
154
154
|
return /^(https?:\/\/|\/\/)[\s\S]+$/.test(url);
|
|
155
155
|
};
|
|
156
156
|
var buildData = function buildData(item) {
|
|
157
|
-
var router = item[urlField] || item
|
|
157
|
+
var router = item[urlField] || item.route;
|
|
158
158
|
return {
|
|
159
159
|
title: item[textField],
|
|
160
160
|
route: router ? router.replace(/^#\/?/, '') : null,
|
|
@@ -363,7 +363,7 @@ export var skip = function skip(_ref15) {
|
|
|
363
363
|
var _ref16 = fields || {},
|
|
364
364
|
_ref16$urlField = _ref16.urlField,
|
|
365
365
|
urlField = _ref16$urlField === void 0 ? 'url' : _ref16$urlField;
|
|
366
|
-
var _router = item[urlField] || item
|
|
366
|
+
var _router = item[urlField] || item.route;
|
|
367
367
|
return window.open(xss.filterUrl(_router)).opener = null;
|
|
368
368
|
}
|
|
369
369
|
var address = !item.route || !flag ? api.getUrl(item).replace(/^#/, '') : item.route.replace(/^\/+/, '/').replace('#/', '');
|
package/numeric/index.js
CHANGED
|
@@ -27,7 +27,9 @@ export var watchValue = function watchValue(_ref2) {
|
|
|
27
27
|
var api = _ref2.api,
|
|
28
28
|
state = _ref2.state;
|
|
29
29
|
return function (value) {
|
|
30
|
-
if (value === state.currentValue)
|
|
30
|
+
if (value === state.currentValue) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
31
33
|
api.setCurrentValue(value);
|
|
32
34
|
};
|
|
33
35
|
};
|
|
@@ -202,7 +204,7 @@ var getEmitValue = function getEmitValue(args) {
|
|
|
202
204
|
emitValue = api.getDecimal(emitValue).toString();
|
|
203
205
|
}
|
|
204
206
|
if (!stringMode) {
|
|
205
|
-
emitValue = emitValue
|
|
207
|
+
emitValue = Number(emitValue);
|
|
206
208
|
}
|
|
207
209
|
}
|
|
208
210
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/vue-renderless",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.7",
|
|
4
4
|
"description": "@opentiny/vue-renderless",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,12 +19,13 @@
|
|
|
19
19
|
"build": "babel --config-file ./build/babel.config.json src --out-dir dist",
|
|
20
20
|
"build:all": "npm run lint && npm run clean && npm run build && npm run build:version",
|
|
21
21
|
"build:version": "node build/build-version.js",
|
|
22
|
-
"release": "node
|
|
23
|
-
"format": "prettier --write src/**/* build/*.js ",
|
|
24
|
-
"lint": "eslint src/**/* build/*.js
|
|
22
|
+
"release": "node scripts/release.js",
|
|
23
|
+
"format": "prettier --write src/**/* build/*.js scripts/*.js",
|
|
24
|
+
"lint": "eslint src/**/* build/*.js scripts/*.js --fix",
|
|
25
|
+
"commit": "git-cz"
|
|
25
26
|
},
|
|
26
27
|
"dependencies": {
|
|
27
|
-
"@babel/runtime": "
|
|
28
|
+
"@babel/runtime": "7.18.3",
|
|
28
29
|
"xss": "1.0.11"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
@@ -32,148 +33,44 @@
|
|
|
32
33
|
"@babel/core": "^7.5.5",
|
|
33
34
|
"@babel/plugin-transform-runtime": "^7.10.1",
|
|
34
35
|
"@babel/preset-env": "^7.5.5",
|
|
36
|
+
"babel-eslint": "^10.1.0",
|
|
35
37
|
"eslint": "^6.1.0",
|
|
36
38
|
"eslint-config-standard": "^17.0.0",
|
|
37
39
|
"eslint-plugin-import": "^2.18.2",
|
|
38
40
|
"eslint-plugin-node": "^11.1.0 ",
|
|
39
41
|
"eslint-plugin-promise": "^4.2.1",
|
|
40
42
|
"eslint-plugin-standard": "^4.0.0",
|
|
43
|
+
"eslint-plugin-vue": "^9.7.0",
|
|
41
44
|
"fs-extra": "^10.1.0",
|
|
42
45
|
"prettier": "2.2.1",
|
|
43
|
-
"rimraf": "^3.0.2"
|
|
46
|
+
"rimraf": "^3.0.2",
|
|
47
|
+
"@commitlint/cli": "^17.3.0",
|
|
48
|
+
"@commitlint/config-conventional": "^17.3.0",
|
|
49
|
+
"commitizen": "^4.2.5",
|
|
50
|
+
"cz-conventional-changelog": "^3.3.0",
|
|
51
|
+
"eslint-config-prettier": "^8.5.0",
|
|
52
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
53
|
+
"glob": "^8.0.3",
|
|
54
|
+
"husky": "^8.0.2",
|
|
55
|
+
"lint-staged": "^13.0.3"
|
|
44
56
|
},
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"no-var": "error",
|
|
60
|
-
"no-tabs": "error",
|
|
61
|
-
"no-trailing-spaces": "error",
|
|
62
|
-
"no-mixed-spaces-and-tabs": "error",
|
|
63
|
-
"no-undef": "error",
|
|
64
|
-
"no-extra-semi": "error",
|
|
65
|
-
"no-empty": "error",
|
|
66
|
-
"no-console": "off",
|
|
67
|
-
"semi": [
|
|
68
|
-
2,
|
|
69
|
-
"never"
|
|
70
|
-
],
|
|
71
|
-
"indent": [
|
|
72
|
-
"warn",
|
|
73
|
-
2
|
|
74
|
-
],
|
|
75
|
-
"max-len": [
|
|
76
|
-
"warn",
|
|
77
|
-
{
|
|
78
|
-
"code": 160
|
|
79
|
-
}
|
|
80
|
-
],
|
|
81
|
-
"function-paren-newline": [
|
|
82
|
-
"warn",
|
|
83
|
-
"multiline"
|
|
84
|
-
],
|
|
85
|
-
"object-property-newline": [
|
|
86
|
-
"warn",
|
|
87
|
-
{
|
|
88
|
-
"allowAllPropertiesOnSameLine": true
|
|
89
|
-
}
|
|
90
|
-
],
|
|
91
|
-
"newline-per-chained-call": [
|
|
92
|
-
"warn",
|
|
93
|
-
{
|
|
94
|
-
"ignoreChainWithDepth": 4
|
|
95
|
-
}
|
|
96
|
-
],
|
|
97
|
-
"curly": "error",
|
|
98
|
-
"comma-dangle": [
|
|
99
|
-
"off",
|
|
100
|
-
"always-multiline"
|
|
101
|
-
],
|
|
102
|
-
"semi-style": [
|
|
103
|
-
"warn",
|
|
104
|
-
"last"
|
|
105
|
-
],
|
|
106
|
-
"max-lines": [
|
|
107
|
-
"error",
|
|
108
|
-
2000
|
|
109
|
-
],
|
|
110
|
-
"max-lines-per-function": [
|
|
111
|
-
"error",
|
|
112
|
-
50
|
|
113
|
-
],
|
|
114
|
-
"complexity": [
|
|
115
|
-
"error",
|
|
116
|
-
20
|
|
117
|
-
],
|
|
118
|
-
"max-depth": [
|
|
119
|
-
"warn",
|
|
120
|
-
4
|
|
121
|
-
],
|
|
122
|
-
"max-nested-callbacks": [
|
|
123
|
-
"error",
|
|
124
|
-
4
|
|
125
|
-
],
|
|
126
|
-
"no-multi-assign": "error",
|
|
127
|
-
"no-undef-init": "warn",
|
|
128
|
-
"no-shadow": "warn",
|
|
129
|
-
"max-params": [
|
|
130
|
-
"warn",
|
|
131
|
-
5
|
|
132
|
-
],
|
|
133
|
-
"no-param-reassign": "warn",
|
|
134
|
-
"prefer-rest-params": "warn",
|
|
135
|
-
"prefer-arrow-callback": "error",
|
|
136
|
-
"arrow-body-style": [
|
|
137
|
-
"warn",
|
|
138
|
-
"as-needed"
|
|
139
|
-
],
|
|
140
|
-
"no-this-before-super": "error",
|
|
141
|
-
"quotes": [
|
|
142
|
-
"warn",
|
|
143
|
-
"single"
|
|
144
|
-
],
|
|
145
|
-
"prefer-template": "warn",
|
|
146
|
-
"no-multi-str": "warn",
|
|
147
|
-
"object-shorthand": "warn",
|
|
148
|
-
"dot-notation": "error",
|
|
149
|
-
"accessor-pairs": "error",
|
|
150
|
-
"no-prototype-builtins": "error",
|
|
151
|
-
"guard-for-in": "error",
|
|
152
|
-
"eqeqeq": "warn",
|
|
153
|
-
"no-negated-condition": "warn",
|
|
154
|
-
"default-case": "error",
|
|
155
|
-
"no-fallthrough": "error",
|
|
156
|
-
"no-case-declarations": "error",
|
|
157
|
-
"no-unsafe-finally": "error",
|
|
158
|
-
"no-eval": "error",
|
|
159
|
-
"no-with": "error",
|
|
160
|
-
"no-implicit-coercion": [
|
|
161
|
-
"error",
|
|
162
|
-
{
|
|
163
|
-
"allow": [
|
|
164
|
-
"!!",
|
|
165
|
-
"~"
|
|
166
|
-
]
|
|
167
|
-
}
|
|
168
|
-
]
|
|
169
|
-
},
|
|
170
|
-
"parserOptions": {
|
|
171
|
-
"ecmaVersion": 2018,
|
|
172
|
-
"sourceType": "module",
|
|
173
|
-
"parser": "babel-eslint"
|
|
57
|
+
"husky": {
|
|
58
|
+
"hooks": {
|
|
59
|
+
"pre-commit": "lint-staged",
|
|
60
|
+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"lint-staged": {
|
|
64
|
+
"*.{js,ts,jsx,tsx,vue}": [
|
|
65
|
+
"prettier --write"
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
"config": {
|
|
69
|
+
"commitizen": {
|
|
70
|
+
"path": "cz-conventional-changelog"
|
|
174
71
|
}
|
|
175
72
|
},
|
|
176
73
|
"engines": {
|
|
177
|
-
"node": ">=
|
|
74
|
+
"node": ">=14.0.0"
|
|
178
75
|
}
|
|
179
76
|
}
|
package/pager-item/vue.js
CHANGED
|
@@ -37,14 +37,18 @@ export var renderless = function renderless(props, _ref, _ref2) {
|
|
|
37
37
|
watch(function () {
|
|
38
38
|
return state.showPrevMore;
|
|
39
39
|
}, function (value) {
|
|
40
|
-
if (!value)
|
|
40
|
+
if (!value) {
|
|
41
|
+
state.quickprevIconClass = props.popupIcon;
|
|
42
|
+
}
|
|
41
43
|
}, {
|
|
42
44
|
immediate: true
|
|
43
45
|
});
|
|
44
46
|
watch(function () {
|
|
45
47
|
return state.showNextMore;
|
|
46
48
|
}, function (value) {
|
|
47
|
-
if (!value)
|
|
49
|
+
if (!value) {
|
|
50
|
+
state.quicknextIconClass = props.popupIcon;
|
|
51
|
+
}
|
|
48
52
|
}, {
|
|
49
53
|
immediate: true
|
|
50
54
|
});
|