@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.
Files changed (177) hide show
  1. package/action-menu/index.js +10 -0
  2. package/action-menu/vue.js +26 -0
  3. package/amount/index.js +334 -0
  4. package/amount/vue.js +206 -0
  5. package/area/index.js +162 -0
  6. package/area/vue.js +68 -0
  7. package/autonavi-map/index.js +28 -0
  8. package/avatar/index.js +5 -1
  9. package/avatar/vue.js +2 -1
  10. package/baidu-map/index.js +28 -0
  11. package/breadcrumb/index.js +9 -0
  12. package/breadcrumb/vue.js +25 -3
  13. package/breadcrumb-item/index.js +26 -0
  14. package/breadcrumb-item/vue.js +20 -11
  15. package/bulletin-board/index.js +4 -1
  16. package/button-group/vue.js +1 -1
  17. package/calendar/index.js +14 -14
  18. package/card-template/index.js +1 -1
  19. package/cascader/index.js +21 -7
  20. package/cascader/vue.js +1 -2
  21. package/cascader-node/index.js +3 -1
  22. package/cascader-panel/index.js +12 -4
  23. package/cascader-panel/vue.js +1 -2
  24. package/chart-bar/index.js +533 -0
  25. package/chart-boxplot/index.js +270 -0
  26. package/chart-candle/index.js +428 -0
  27. package/chart-core/deps/constants.js +65 -0
  28. package/chart-core/deps/numerify.js +286 -0
  29. package/chart-core/deps/utils.js +205 -0
  30. package/chart-core/index.js +541 -0
  31. package/chart-core/modules/animation.js +10 -0
  32. package/chart-core/modules/extend.js +36 -0
  33. package/chart-core/modules/mark.js +7 -0
  34. package/chart-core/vue.js +128 -0
  35. package/chart-funnel/index.js +155 -0
  36. package/chart-gauge/index.js +153 -0
  37. package/chart-graph/index.js +38 -0
  38. package/chart-heatmap/index.js +407 -0
  39. package/chart-line/index.js +358 -0
  40. package/chart-liquidfill/index.js +119 -0
  41. package/chart-map/index.js +261 -0
  42. package/chart-pie/index.js +327 -0
  43. package/chart-radar/index.js +181 -0
  44. package/chart-sankey/index.js +166 -0
  45. package/chart-scatter/index.js +360 -0
  46. package/chart-sunburst/index.js +36 -0
  47. package/chart-tree/index.js +107 -0
  48. package/chart-waterfall/index.js +231 -0
  49. package/chart-wordcloud/index.js +109 -0
  50. package/checkbox/index.js +4 -4
  51. package/checkbox-button/index.js +3 -1
  52. package/common/bigInt.js +5 -2
  53. package/common/date.js +17 -17
  54. package/common/deps/date-util.js +15 -5
  55. package/common/deps/date.js +6 -6
  56. package/common/deps/dom.js +18 -6
  57. package/common/deps/eSpaceCtrl.js +286 -0
  58. package/common/deps/fullscreen/apis.js +22 -22
  59. package/common/deps/memorize.js +3 -3
  60. package/common/deps/modal-queue.js +2 -0
  61. package/common/deps/popper.js +12 -10
  62. package/common/deps/popup-manager.js +16 -5
  63. package/common/deps/resize-event.js +6 -2
  64. package/common/deps/scrollbar-width.js +6 -2
  65. package/common/deps/tree-model/node.js +30 -10
  66. package/common/deps/tree-model/tree-store.js +33 -21
  67. package/common/deps/tree-model/util.js +6 -2
  68. package/common/deps/upload-ajax.js +7 -1
  69. package/common/deps/vue-popper.js +2 -2
  70. package/common/string.js +1 -1
  71. package/company/index.js +56 -0
  72. package/company/vue.js +35 -0
  73. package/country/index.js +54 -0
  74. package/country/vue.js +35 -0
  75. package/credit-card-form/index.js +1 -0
  76. package/currency/index.js +78 -0
  77. package/currency/vue.js +39 -0
  78. package/date-panel/index.js +16 -6
  79. package/date-picker/index.js +9 -5
  80. package/date-range/index.js +28 -9
  81. package/date-table/index.js +3 -1
  82. package/dept/index.js +318 -0
  83. package/dept/vue.js +163 -0
  84. package/detail-page/index.js +4 -1
  85. package/dialog-box/index.js +14 -4
  86. package/dialog-box/vue.js +7 -3
  87. package/drop-roles/index.js +73 -0
  88. package/drop-roles/vue.js +38 -0
  89. package/dropdown/index.js +5 -4
  90. package/dropdown/vue.js +5 -3
  91. package/dropdown-item/index.js +15 -0
  92. package/dropdown-item/vue.js +27 -13
  93. package/espace/index.js +129 -0
  94. package/espace/vue.js +52 -0
  95. package/file-upload/index.js +336 -291
  96. package/form/index.js +3 -1
  97. package/form/vue.js +15 -0
  98. package/form-item/index.js +15 -5
  99. package/fullscreen/index.js +4 -4
  100. package/fullscreen/vue.js +3 -3
  101. package/grid/core/interceptor.js +4 -7
  102. package/grid/plugins/export.js +2 -2
  103. package/grid/plugins/exportExcel.js +28 -10
  104. package/grid/static/array/findTree.js +1 -1
  105. package/grid/static/base/helperCreateGetObjects.js +1 -1
  106. package/grid/static/base/helperEqualCompare.js +2 -2
  107. package/grid/static/base/helperGetHGSKeys.js +1 -1
  108. package/grid/static/base/uniqueId.js +1 -1
  109. package/grid/static/object/assign.js +3 -3
  110. package/grid/static/string/toString.js +3 -3
  111. package/hrapprover/index.js +118 -0
  112. package/hrapprover/vue.js +102 -0
  113. package/locales/index.js +116 -0
  114. package/locales/vue.js +46 -0
  115. package/logon-user/index.js +23 -0
  116. package/logon-user/vue.js +22 -0
  117. package/logout/index.js +118 -0
  118. package/logout/vue.js +22 -0
  119. package/milestone/index.js +2 -1
  120. package/mini-picker/index.js +1 -1
  121. package/mini-picker/vue.js +1 -1
  122. package/modal/index.js +4 -2
  123. package/month-table/index.js +2 -2
  124. package/nav-menu/index.js +2 -2
  125. package/numeric/index.js +4 -2
  126. package/package.json +33 -136
  127. package/pager-item/vue.js +6 -2
  128. package/picker/index.js +43 -17
  129. package/picker/timezone.js +2 -2
  130. package/picker-column/index.js +7 -3
  131. package/pop-upload/index.js +5 -3
  132. package/popeditor/index.js +15 -7
  133. package/popover/index.js +87 -54
  134. package/popover/vue.js +13 -9
  135. package/rate/index.js +2 -2
  136. package/rich-text/clipboard.js +77 -0
  137. package/rich-text/index.js +176 -0
  138. package/rich-text/module/file-upload.js +118 -0
  139. package/rich-text/module/image-drop.js +54 -0
  140. package/rich-text/module/image-upload.js +84 -0
  141. package/rich-text/options.js +187 -0
  142. package/rich-text/table-module.js +557 -0
  143. package/rich-text/vue.js +149 -0
  144. package/roles/index.js +87 -0
  145. package/roles/vue.js +39 -0
  146. package/search/index.js +32 -27
  147. package/search/vue.js +7 -2
  148. package/select/index.js +328 -304
  149. package/select/vue.js +19 -9
  150. package/select-dropdown/index.js +1 -1
  151. package/slider/index.js +9 -11
  152. package/slider/vue.js +3 -3
  153. package/split/vue.js +1 -1
  154. package/tab-nav/index.js +0 -6
  155. package/tab-nav/vue.js +0 -14
  156. package/table/index.js +1 -1
  157. package/text-popup/index.js +6 -4
  158. package/time/index.js +3 -1
  159. package/time-range/index.js +6 -2
  160. package/time-spinner/index.js +15 -5
  161. package/toggle-menu/index.js +11 -0
  162. package/toggle-menu/vue.js +2 -1
  163. package/tooltip/index.js +46 -35
  164. package/tooltip/vue.js +5 -1
  165. package/tree/index.js +57 -21
  166. package/tree-menu/index.js +3 -1
  167. package/tree-node/index.js +7 -3
  168. package/upload/index.js +14 -5
  169. package/user/index.js +634 -0
  170. package/user/vue.js +113 -0
  171. package/user-account/index.js +23 -0
  172. package/user-account/vue.js +25 -0
  173. package/user-contact/index.js +1 -4
  174. package/user-head/index.js +9 -11
  175. package/user-head/vue.js +2 -6
  176. package/user-link/index.js +43 -0
  177. 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 showSelector = function showSelector(_ref2) {
16
- var refs = _ref2.refs,
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['selector'].style.zIndex = PopupManager.nextZIndex();
24
+ refs.selector.style.zIndex = PopupManager.nextZIndex();
20
25
  state.show = true;
21
26
  };
22
27
  };
23
- export var changeKey = function changeKey(_ref3) {
24
- var emit = _ref3.emit,
25
- state = _ref3.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(_ref4) {
33
- var emit = _ref4.emit,
34
- props = _ref4.props,
35
- state = _ref4.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(_ref5) {
45
- var api = _ref5.api,
46
- props = _ref5.props,
47
- refs = _ref5.refs,
48
- nextTick = _ref5.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(_ref6) {
59
- var parent = _ref6.parent,
60
- props = _ref6.props,
61
- state = _ref6.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(_ref7) {
99
- var emit = _ref7.emit,
100
- refs = _ref7.refs,
101
- state = _ref7.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