@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/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
+ };
@@ -1,11 +1,8 @@
1
1
  export var getUserHref = function getUserHref(_ref) {
2
- var api = _ref.api,
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;
@@ -10,8 +10,7 @@ export var computedStyle = function computedStyle(_ref) {
10
10
  };
11
11
  };
12
12
  };
13
- export var computedMessage = function computedMessage(_ref2) {
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(_ref3) {
28
- var props = _ref3.props,
29
- state = _ref3.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(_ref4) {
50
- var state = _ref4.state,
51
- props = _ref4.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(_ref5) {
57
- var props = _ref5.props;
55
+ export var getInternalValue = function getInternalValue(props) {
58
56
  return function () {
59
- if (props.modelValue === null) {
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
- props: props
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
+ };
@@ -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
+ };