md-iview 1.0.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. package/README.md +2 -0
  2. package/package.json +116 -0
  3. package/src/components/libs/util.js +117 -0
  4. package/src/components/md-error-page/403.less +92 -0
  5. package/src/components/md-error-page/403.vue +34 -0
  6. package/src/components/md-error-page/404.less +60 -0
  7. package/src/components/md-error-page/404.vue +34 -0
  8. package/src/components/md-error-page/500.less +73 -0
  9. package/src/components/md-error-page/500.vue +36 -0
  10. package/src/components/md-error-page/demo/index.less +22 -0
  11. package/src/components/md-error-page/demo/index.vue +97 -0
  12. package/src/components/md-form-item/index.js +3 -0
  13. package/src/components/md-icon/icon.vue +77 -0
  14. package/src/components/md-icon/icons.js +5 -0
  15. package/src/components/md-icon/index.js +11 -0
  16. package/src/components/md-icon/style/index.less +1 -0
  17. package/src/components/md-loading/index.js +55 -0
  18. package/src/components/md-loading/index.vue +53 -0
  19. package/src/components/md-loading/md-loading.js +38 -0
  20. package/src/components/md-print/demo/index.vue +260 -0
  21. package/src/components/md-print/index.js +123 -0
  22. package/src/components/md-rich-editor/index.vue +69 -0
  23. package/src/components/md-rich-editor/module/image-extend/index.js +216 -0
  24. package/src/components/md-scroll-bar/demo/index.vue +102 -0
  25. package/src/components/md-scroll-bar/index.js +3 -0
  26. package/src/components/md-scroll-bar/index.less +90 -0
  27. package/src/components/md-scroll-bar/index.vue +250 -0
  28. package/src/components/md-select/index.js +7 -0
  29. package/src/components/md-select/select.vue +841 -0
  30. package/src/components/md-shrinkable-menu/components/sidebarMenu.vue +167 -0
  31. package/src/components/md-shrinkable-menu/components/sidebarMenuShrink.vue +119 -0
  32. package/src/components/md-shrinkable-menu/demo/data/cachePage.js +1 -0
  33. package/src/components/md-shrinkable-menu/demo/data/currentPath.js +9 -0
  34. package/src/components/md-shrinkable-menu/demo/data/menu.js +575 -0
  35. package/src/components/md-shrinkable-menu/demo/data/menu2.js +1017 -0
  36. package/src/components/md-shrinkable-menu/demo/data/pageTagsList.js +153 -0
  37. package/src/components/md-shrinkable-menu/demo/index.less +297 -0
  38. package/src/components/md-shrinkable-menu/demo/index.vue +285 -0
  39. package/src/components/md-shrinkable-menu/index.vue +112 -0
  40. package/src/components/md-shrinkable-menu/sidebar.vue +195 -0
  41. package/src/components/md-shrinkable-menu/styles/menu.less +5 -0
  42. package/src/components/md-shrinkable-menu/styles/sidebar.less +363 -0
  43. package/src/components/md-split-pane/demo/index.vue +101 -0
  44. package/src/components/md-split-pane/index.js +3 -0
  45. package/src/components/md-split-pane/index.less +93 -0
  46. package/src/components/md-split-pane/index.vue +230 -0
  47. package/src/components/md-table/action-tooltip.vue +45 -0
  48. package/src/components/md-table/can-edit-v2.vue +823 -0
  49. package/src/components/md-table/can-edit.vue +723 -0
  50. package/src/components/md-table/custom-cell.vue +71 -0
  51. package/src/components/md-table/date-picker-cell-v2.vue +48 -0
  52. package/src/components/md-table/date-picker-cell.vue +39 -0
  53. package/src/components/md-table/demo/data/search.js +67 -0
  54. package/src/components/md-table/demo/data/table2csv.js +200 -0
  55. package/src/components/md-table/demo/data/table2excel.js +239 -0
  56. package/src/components/md-table/demo/data/table_data.js +251 -0
  57. package/src/components/md-table/demo/editable-table.vue +144 -0
  58. package/src/components/md-table/demo/exportable-table.vue +124 -0
  59. package/src/components/md-table/demo/widgets/header-search.vue +88 -0
  60. package/src/components/md-table/drop-down-cell-v2.vue +87 -0
  61. package/src/components/md-table/drop-down-cell.vue +81 -0
  62. package/src/components/md-table/editable-expand.vue +143 -0
  63. package/src/components/md-table/expand.vue +97 -0
  64. package/src/components/md-table/index.vue +53 -0
  65. package/src/components/md-table/iview-table/cell.vue +99 -0
  66. package/src/components/md-table/iview-table/expand.js +21 -0
  67. package/src/components/md-table/iview-table/export-csv.js +76 -0
  68. package/src/components/md-table/iview-table/header.js +16 -0
  69. package/src/components/md-table/iview-table/index.js +2 -0
  70. package/src/components/md-table/iview-table/mixin.js +31 -0
  71. package/src/components/md-table/iview-table/table-body.vue +101 -0
  72. package/src/components/md-table/iview-table/table-head.vue +311 -0
  73. package/src/components/md-table/iview-table/table-tr.vue +31 -0
  74. package/src/components/md-table/iview-table/table.vue +1026 -0
  75. package/src/components/md-table/iview-table/util.js +93 -0
  76. package/src/components/md-table/libs/table2excel.js +100 -0
  77. package/src/components/md-table/select-cell-v2.vue +64 -0
  78. package/src/components/md-table/select-cell.vue +46 -0
  79. package/src/components/md-table/table.less +76 -0
  80. package/src/components/md-toolbar/index.vue +171 -0
  81. package/src/components/md-tree/index.js +2 -0
  82. package/src/components/md-tree/node.vue +238 -0
  83. package/src/components/md-tree/render.js +17 -0
  84. package/src/components/md-tree/tree.vue +241 -0
  85. package/src/components/utilities/can.js +35 -0
  86. package/src/directives/index.js +34 -0
  87. package/src/directives/resize.js +27 -0
  88. package/src/directives/scroll.js +27 -0
  89. package/src/directives/style/bg-color.js +23 -0
  90. package/src/directives/style/color.js +23 -0
  91. package/src/directives/style/font-size.js +23 -0
  92. package/src/directives/style/height.js +23 -0
  93. package/src/directives/style/lineHeight.js +23 -0
  94. package/src/directives/style/margin.js +48 -0
  95. package/src/directives/style/opacity.js +23 -0
  96. package/src/directives/style/padding.js +48 -0
  97. package/src/directives/style/width.js +24 -0
  98. package/src/index.js +442 -0
  99. package/src/locale/lang.js +5 -0
  100. package/src/mixins/colorable.js +51 -0
  101. package/src/style/color/bezierEasing.less +110 -0
  102. package/src/style/color/colorPalette.less +75 -0
  103. package/src/style/color/colors.less +146 -0
  104. package/src/style/color/tinyColor.less +1184 -0
  105. package/src/style/common.less +72 -0
  106. package/src/style/components/_ripple.less +60 -0
  107. package/src/style/components/_shrinkable-menu.less +46 -0
  108. package/src/style/components/_toolbar.less +96 -0
  109. package/src/style/components/index.less +3 -0
  110. package/src/style/components/rich-editor.less +6 -0
  111. package/src/style/index.less +10 -0
  112. package/src/style/theme.less +155 -0
  113. package/src/utils/color.js +46 -0
  114. package/src/utils/console.js +105 -0
  115. package/src/utils/load.js +79 -0
  116. package/src/utils/mask.js +139 -0
  117. package/src/utils/mixins.js +5 -0
  118. package/src/utils/validate.js +271 -0
@@ -0,0 +1,230 @@
1
+ <!--<style lang="less">-->
2
+ <!-- @import 'index.less';-->
3
+ <!--</style>-->
4
+
5
+ <template>
6
+ <div
7
+ :class="wraperClasses"
8
+ ref="wraper"
9
+ @mouseup="handleMouseup"
10
+ @mousemove="handleMousemove"
11
+ @mouseleave="handleMouseout">
12
+ <div v-if="direction === 'horizontal'" :class="`${prefix}-container`">
13
+ <div :class="`${prefix}-left-area`" :style="{width: leftSize}">
14
+ <slot name="left"></slot>
15
+ </div>
16
+ <slot name="trigger">
17
+ <div
18
+ :class="`${prefix}-trigger`"
19
+ ref="trigger"
20
+ :style="horizontalTriggerStyle"
21
+ @mousedown="handleMousedown"
22
+ unselectable="on">
23
+ <div class="trigger-middle-point"><p></p><p></p><p></p><p></p><p></p><p></p></div>
24
+ </div>
25
+ </slot>
26
+ <div :class="`${prefix}-right-area`" :style="{width: rightSize}">
27
+ <slot name="right"></slot>
28
+ </div>
29
+ </div>
30
+
31
+ <div v-else :class="`${prefix}-container`">
32
+ <div :class="`${prefix}-top-area`" :style="{height: leftSize}">
33
+ <slot name="top"></slot>
34
+ </div>
35
+ <slot name="trigger">
36
+ <div
37
+ :class="`${prefix}-trigger`"
38
+ ref="trigger"
39
+ :style="verticalTriggerStyle"
40
+ @mousedown="handleMousedown"
41
+ unselectable="on">
42
+ <div class="trigger-middle-point"><p></p><p></p><p></p><p></p><p></p><p></p></div>
43
+ </div>
44
+ </slot>
45
+ <div :class="`${prefix}-bottom-area`" :style="{height: rightSize}">
46
+ <slot name="bottom"></slot>
47
+ </div>
48
+ </div>
49
+ </div>
50
+ </template>
51
+
52
+ <script>
53
+ const oneOf = function (ele, targetArr) {
54
+ if (targetArr.indexOf(ele) >= 0) {
55
+ return true;
56
+ } else {
57
+ return false;
58
+ }
59
+ };
60
+ export default {
61
+ name: 'splitPane',
62
+ props: {
63
+ value: {
64
+ type: [Number, String],
65
+ default: 50
66
+ },
67
+ direction: {
68
+ type: String,
69
+ default: 'horizontal',
70
+ validator (val) {
71
+ return oneOf(val, ['vertical', 'horizontal']);
72
+ }
73
+ },
74
+ min: {
75
+ type: [Number, String],
76
+ default: 3
77
+ },
78
+ max: {
79
+ type: [Number, String],
80
+ default: 97
81
+ },
82
+ maxRight: {
83
+ type: Boolean,
84
+ default: false
85
+ },
86
+ right: {
87
+ type: Boolean,
88
+ default: false
89
+ },
90
+ triggerStyle: {
91
+ type: Object,
92
+ default () {
93
+ if (this.direction === 'horizontal') {
94
+ return {
95
+ width: '4px',
96
+ background: '#BDBDBD'
97
+ };
98
+ } else {
99
+ return {
100
+ height: '4px',
101
+ background: '#BDBDBD'
102
+ };
103
+ }
104
+ }
105
+ }
106
+ },
107
+ data () {
108
+ return {
109
+ prefix: 'split-pane',
110
+ canMove: false,
111
+ triggerOffset: 50,
112
+ triggerOldOffset: 50,
113
+ offset: {},
114
+ atMin: false,
115
+ atMax: false,
116
+ directionMark: 0
117
+ };
118
+ },
119
+ computed: {
120
+ wraperClasses () {
121
+ return [
122
+ this.prefix,
123
+ this.direction === 'vertical' ? `${this.prefix}-vertical` : `${this.prefix}-horizontal`
124
+ ];
125
+ },
126
+ leftSize () {
127
+ return this.right ? `${100 - this.triggerOffset}%` : `${this.triggerOffset}%`;
128
+ },
129
+ rightSize () {
130
+ return this.right ? `${this.triggerOffset}%` : `${100 - this.triggerOffset}%`;
131
+ },
132
+ triggerLeft () {
133
+ return this.right ? `${100 - this.triggerOffset}%` : `${this.triggerOffset}%`;
134
+ },
135
+ minTransed () {
136
+ return this.transValue(this.min);
137
+ },
138
+ maxTransed () {
139
+ let max = this.right ? (100 - this.transValue(this.max)) : this.transValue(this.max);
140
+ return this.maxRight ? 100 - max : max;
141
+ },
142
+ horizontalTriggerStyle () {
143
+ return Object.assign({left: this.triggerLeft}, this.triggerStyle);
144
+ },
145
+ verticalTriggerStyle () {
146
+ return Object.assign({top: this.triggerLeft}, this.triggerStyle);
147
+ }
148
+ },
149
+ methods: {
150
+ handleMouseup (e) {
151
+ this.canMove = false;
152
+ this.$emit('on-resizing-end', e);
153
+ },
154
+ transValue (val) {
155
+ return (typeof val === 'number') ? val : Math.floor(((parseFloat(val) / this.$refs.wraper.offsetWidth) * 10000)) / 100;
156
+ },
157
+ handleMousedown (e) {
158
+ this.canMove = true;
159
+ this.triggerOldOffset = this.triggerOffset;
160
+ this.offset = {
161
+ x: e.pageX,
162
+ y: e.pageY
163
+ };
164
+ this.$emit('on-resizing-start', e);
165
+ e.preventDefault();
166
+ },
167
+ handleMouseout () {
168
+ this.canMove = false;
169
+ },
170
+ handleMousemove (e) {
171
+ if (this.canMove) {
172
+ let offset;
173
+ let moveSize = 0;
174
+ if (this.direction === 'horizontal') {
175
+ moveSize = Math.floor(((e.clientX - this.offset.x) / this.$refs.wraper.offsetWidth) * 10000) / 100;
176
+ offset = this.triggerOldOffset + (this.right ? -moveSize : moveSize);
177
+ } else {
178
+ moveSize = Math.floor(((e.clientY - this.offset.y) / this.$refs.wraper.offsetHeight) * 10000) / 100;
179
+ offset = this.triggerOldOffset + (this.right ? -moveSize : moveSize);
180
+ }
181
+ if (this.right) {
182
+ let offsetHandle = 100 - offset;
183
+ if (offsetHandle <= this.minTransed) {
184
+ this.triggerOffset = 100 - Math.max(offsetHandle, this.minTransed);
185
+ } else {
186
+ this.triggerOffset = 100 - Math.min(offsetHandle, this.maxTransed);
187
+ }
188
+ } else {
189
+ if (offset <= this.minTransed) {
190
+ this.triggerOffset = Math.max(offset, this.minTransed);
191
+ } else {
192
+ this.triggerOffset = Math.min(offset, this.maxTransed);
193
+ }
194
+ }
195
+ e.atMin = (100 - offset) <= this.minTransed;
196
+ e.atMax = (100 - offset) >= this.maxTransed;
197
+ if (e.pageX > this.directionMark) {
198
+ e.direction = 1;
199
+ } else {
200
+ e.direction = 0;
201
+ }
202
+ this.directionMark = e.pageX;
203
+ this.$emit('input', this.triggerOffset);
204
+ this.$emit('on-resizing', e);
205
+ }
206
+ },
207
+ setTriggerOffset (offset) {
208
+ this.$nextTick(() => {
209
+ this.triggerOffset = (typeof offset === 'number') ? offset : Math.floor(((parseInt(offset) / this.$refs.wraper.offsetWidth) * 10000)) / 100;
210
+ this.$emit('input', this.triggerOffset);
211
+ });
212
+ }
213
+ },
214
+ watch: {
215
+ value (val) {
216
+ this.$nextTick(() => {
217
+ this.triggerOffset = (typeof val === 'number') ? val : Math.floor(((parseInt(val) / this.$refs.wraper.offsetWidth) * 10000)) / 100;
218
+ });
219
+ }
220
+ },
221
+ mounted () {
222
+ if (this.value !== undefined) {
223
+ this.$nextTick(() => {
224
+ this.triggerOffset = (typeof this.value === 'number') ? this.value : Math.floor(((parseInt(this.value) / this.$refs.wraper.offsetWidth) * 10000)) / 100;
225
+ });
226
+ this.triggerOffset = (typeof this.value === 'number') ? this.value : Math.floor(((parseInt(this.value) / this.$refs.wraper.offsetWidth) * 10000)) / 100;
227
+ }
228
+ }
229
+ };
230
+ </script>
@@ -0,0 +1,45 @@
1
+ <template>
2
+ <!--<Poptip trigger="hover" content="content" class="action-poptip">-->
3
+ <Tooltip placement="bottom" class="action-tooltip">
4
+ <!--<template v-if="iconStyle == 'iview'">-->
5
+ <!--<Icon :type="iconType" size="16"/>-->
6
+ <!--</template>-->
7
+ <!--<template v-else>-->
8
+ <!--<v-icon color="#000" size="16">{{iconType}}</v-icon>-->
9
+ <!--</template>-->
10
+ <md-icon :type="iconType" :size="size"/>
11
+ <span slot="content">{{text}}</span>
12
+ </Tooltip>
13
+ <!--</Poptip>-->
14
+ </template>
15
+
16
+ <script>
17
+ export default {
18
+ name: "action-poptip",
19
+ props:{
20
+ // type:String,
21
+ text:String,
22
+ iconType:String,
23
+ // iconStyle:{
24
+ // type:String,
25
+ // default:'iview',// vuetify
26
+ // },
27
+ size:{
28
+ type:Number|String,
29
+ default:16,
30
+ },
31
+ },
32
+ created() {
33
+ console.log(this.iconStyle);
34
+ }
35
+ }
36
+ </script>
37
+
38
+ <style lang="less" scoped>
39
+ .action-tooltip {
40
+ cursor:pointer;
41
+ /*.ivu-icon {*/
42
+ /*cursor:pointer;*/
43
+ /*}*/
44
+ }
45
+ </style>