xianniu-ui 0.1.1

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 (43) hide show
  1. package/README.md +1 -0
  2. package/lib/demo.html +10 -0
  3. package/lib/style/index.css +1 -0
  4. package/lib/style/page.css +1 -0
  5. package/lib/style/table.css +1 -0
  6. package/lib/xn-ui.common.js +20159 -0
  7. package/lib/xn-ui.umd.js +20169 -0
  8. package/lib/xn-ui.umd.min.js +9 -0
  9. package/package.json +62 -0
  10. package/packages/dialog/index.js +7 -0
  11. package/packages/dialog/main.vue +123 -0
  12. package/packages/page/index.js +7 -0
  13. package/packages/page/main.vue +100 -0
  14. package/packages/style/lib/index.css +1 -0
  15. package/packages/style/lib/page.css +1 -0
  16. package/packages/style/lib/table.css +1 -0
  17. package/packages/style/package.json +22 -0
  18. package/packages/style/src/index.scss +2 -0
  19. package/packages/style/src/page.scss +7 -0
  20. package/packages/style/src/table.scss +9 -0
  21. package/packages/table/column.vue +111 -0
  22. package/packages/table/index.js +7 -0
  23. package/packages/table/main.vue +104 -0
  24. package/public/favicon.ico +0 -0
  25. package/public/index.html +18 -0
  26. package/src/area/index.js +12890 -0
  27. package/src/index.js +44 -0
  28. package/src/plugins/index.js +6 -0
  29. package/src/theme/element-variables.scss +28 -0
  30. package/src/theme/index.scss +1 -0
  31. package/src/theme/mixin.scss +270 -0
  32. package/src/theme/sidebar.scss +271 -0
  33. package/src/theme/transition.scss +52 -0
  34. package/src/theme/variables.scss +36 -0
  35. package/src/utils/dayjs.js +2 -0
  36. package/src/utils/format.js +122 -0
  37. package/src/utils/index.js +21 -0
  38. package/src/utils/lodash.js +2 -0
  39. package/src/utils/package.json +8 -0
  40. package/src/utils/reg.js +8 -0
  41. package/src/utils/scroll-to.js +59 -0
  42. package/src/utils/storage.js +2 -0
  43. package/src/utils/utils.js +20 -0
package/src/index.js ADDED
@@ -0,0 +1,44 @@
1
+
2
+ import XnDialog from '../packages/dialog/index'
3
+ import XnTable from '../packages/table/index'
4
+ import XnPage from '../packages/page/index'
5
+
6
+ import Utils from 'xn-ui/src/utils/index'
7
+ const components = [
8
+ XnDialog,
9
+ XnTable,
10
+ XnPage
11
+ ]
12
+ const version = require('../package.json').version
13
+
14
+ const install = function (Vue) {
15
+ console.log(Vue.prototype);
16
+ if (install.installed) return
17
+ if (!Vue.prototype.$ELEMENT) throw new Error('缺失 element-ui,请进行安装')
18
+ install.installed = true
19
+ components.map(component => {
20
+ Vue.component(component.name, component)
21
+ })
22
+
23
+ Vue.prototype.$XN = {
24
+ uploadUrl: ''
25
+ }
26
+ Vue.prototype.$utils = Utils.$utils
27
+ Vue.prototype.$reg = Utils.$reg
28
+ Vue.prototype.$format = Utils.$format
29
+ Vue.prototype.$dayjs = Utils.$dayjs
30
+ Vue.prototype.$lodash = Utils.$lodash
31
+ Vue.prototype.$storage = Utils.$storage
32
+
33
+ }
34
+ if (typeof window !== 'undefined' && window.Vue) {
35
+ install(window.Vue)
36
+ }
37
+
38
+ export default {
39
+ version,
40
+ install,
41
+ XnDialog,
42
+ XnTable,
43
+ XnPage
44
+ }
@@ -0,0 +1,6 @@
1
+ import Vue from 'vue'
2
+ import Element from 'element-ui'
3
+ import '@/theme/index.scss'
4
+ Vue.use(Element, {
5
+ size: 'small'
6
+ })
@@ -0,0 +1,28 @@
1
+
2
+ /* theme color */
3
+ $--color-primary: #FF745C;
4
+ $--color-success: #52C41A;
5
+ $--color-warning: #FAAD14;
6
+ $--color-danger: #FF4D4F;
7
+ $--button-font-weight: 400;
8
+
9
+ $--border-color-light: #dfe4ed;
10
+ $--border-color-lighter: #e6ebf5;
11
+
12
+ $--table-border: 1px solid #dfe6ec;
13
+
14
+ $--box-shadow-light: none;
15
+ $--fade-linear-transition:none;
16
+ $--fade-transition:none;
17
+ // $--table-border-color:#f00;
18
+ $--table-border:1px solid #f0f0f0;
19
+ // $--table-header-background-color: #fafafa;
20
+
21
+ $--font-path: "~element-ui/lib/theme-chalk/fonts";
22
+
23
+ @import "element-ui/packages/theme-chalk/src/index";
24
+
25
+
26
+ :export {
27
+ theme: $--color-primary;
28
+ }
@@ -0,0 +1 @@
1
+ @import './element-variables.scss';
@@ -0,0 +1,270 @@
1
+ @mixin clearfix {
2
+ &:after {
3
+ content: "";
4
+ display: table;
5
+ clear: both;
6
+ }
7
+ }
8
+
9
+ @mixin scrollBar {
10
+ &::-webkit-scrollbar-track-piece {
11
+ background: #d3dce6;
12
+ }
13
+
14
+ &::-webkit-scrollbar {
15
+ width: 6px;
16
+ }
17
+
18
+ &::-webkit-scrollbar-thumb {
19
+ background: #99a9bf;
20
+ border-radius: 20px;
21
+ }
22
+ }
23
+
24
+ @mixin relative {
25
+ position: relative;
26
+ width: 100%;
27
+ height: 100%;
28
+ }
29
+
30
+ @mixin pct($pct) {
31
+ width: #{$pct};
32
+ position: relative;
33
+ margin: 0 auto;
34
+ }
35
+
36
+ @mixin triangle($width, $height, $color, $direction) {
37
+ $width: $width/2;
38
+ $color-border-style: $height solid $color;
39
+ $transparent-border-style: $width solid transparent;
40
+ height: 0;
41
+ width: 0;
42
+
43
+ @if $direction==up {
44
+ border-bottom: $color-border-style;
45
+ border-left: $transparent-border-style;
46
+ border-right: $transparent-border-style;
47
+ }
48
+
49
+ @else if $direction==right {
50
+ border-left: $color-border-style;
51
+ border-top: $transparent-border-style;
52
+ border-bottom: $transparent-border-style;
53
+ }
54
+
55
+ @else if $direction==down {
56
+ border-top: $color-border-style;
57
+ border-left: $transparent-border-style;
58
+ border-right: $transparent-border-style;
59
+ }
60
+
61
+ @else if $direction==left {
62
+ border-right: $color-border-style;
63
+ border-top: $transparent-border-style;
64
+ border-bottom: $transparent-border-style;
65
+ }
66
+ }
67
+
68
+
69
+
70
+ // flex
71
+ // @ref http://w3.org/tr/css3-flexbox/#flex-containers
72
+ @mixin flex($display: block) {
73
+ @if ($display == block) {
74
+ display: -webkit-box;
75
+ display: -moz-box;
76
+ display: -webkit-flexbox;
77
+ display: -ms-flexbox;
78
+ display: -webkit-flex;
79
+ display: flex;
80
+ } @else {
81
+ display: -webkit-inline-flex;
82
+ display: inline-flex;
83
+ }
84
+ }
85
+
86
+ //----------------------------------------------------------------------
87
+
88
+ // flex 方向
89
+ // 取值: row | row-reverse | column | column-reverse
90
+ // 默认:row
91
+ @mixin flex-direction($flex-direction: row) {
92
+ $box-orient: horizontal;
93
+ $box-direction: inherit;
94
+
95
+ @if ($flex-direction == column) {
96
+ $box-orient: vertical;
97
+ $box-direction: inherit;
98
+ } @else if ($flex-direction == column-reverse) {
99
+ $box-orient: vertical;
100
+ $box-direction: reverse;
101
+ } @else if ($flex-direction == row-reverse) {
102
+ $box-orient: horizontal;
103
+ $box-direction: reverse;
104
+ } @else {
105
+ $direction: row;
106
+ }
107
+
108
+ -webkit-box-orient: $box-orient;
109
+ -moz-box-orient: $box-orient;
110
+ -webkit-box-direction: $box-direction;
111
+ -moz-box-direction: $box-direction;
112
+ -webkit-flex-direction: $flex-direction;
113
+ -moz-flex-direction: $flex-direction;
114
+ -ms-flex-direction: $flex-direction;
115
+ flex-direction: $flex-direction;
116
+ }
117
+
118
+ //----------------------------------------------------------------------
119
+
120
+ // flex 换行
121
+ // 取值: nowrap | wrap | wrap-reverse
122
+ // 默认: nowrap
123
+ @mixin flex-wrap($value: nowrap) {
124
+ -webkit-flex-wrap: $value;
125
+ -moz-flex-wrap: $value;
126
+
127
+ @if ($value == nowrap) {
128
+ -ms-flex-wrap: none;
129
+ } @else {
130
+ -ms-flex-wrap: $value;
131
+ }
132
+
133
+ flex-wrap: $value;
134
+ }
135
+
136
+ //----------------------------------------------------------------------
137
+
138
+ // 扩展收缩基准值
139
+ // 默认: auto,数值
140
+ @mixin flex-basis($value: auto) {
141
+ -webkit-flex-basis: $value;
142
+ -moz-flex-basis: $value;
143
+ -ms-flex-preferred-size: $value;
144
+ flex-basis: $value;
145
+ }
146
+
147
+ //----------------------------------------------------------------------
148
+
149
+ // flex 扩展值
150
+ // 默认: 0
151
+ @mixin flex-grow($int: 0) {
152
+ -webkit-box-flex: $int;
153
+ -webkit-flex-grow: $int;
154
+ -moz-flex-grow: $int;
155
+ -ms-flex-positive: $int;
156
+ flex-grow: $int;
157
+ }
158
+
159
+ //----------------------------------------------------------------------
160
+
161
+ // flex 收缩值
162
+ // 默认: 1
163
+ @mixin flex-shrink($int: 1) {
164
+ -webkit-flex-shrink: $int;
165
+ -moz-flex-shrink: $int;
166
+ -ms-flex-negative: $int;
167
+ flex-shrink: $int;
168
+ }
169
+
170
+ //----------------------------------------------------------------------
171
+
172
+ // flex 排序
173
+ // 默认: 0
174
+ @mixin order($int: 0) {
175
+ -webkit-box-ordinal-group: $int + 1;
176
+ -webkit-order: $int;
177
+ -moz-order: $int;
178
+ -ms-flex-order: $int;
179
+ order: $int;
180
+ }
181
+
182
+ //----------------------------------------------------------------------
183
+
184
+ // flex 主轴对齐
185
+ // 取值: flex-start | flex-end | center | space-between | space-around
186
+ // 默认: flex-start
187
+ @mixin justify-content($value: flex-start) {
188
+ @if ($value == flex-start) {
189
+ -webkit-box-pack: start;
190
+ -ms-flex-pack: start;
191
+ } @else if ($value == flex-end) {
192
+ -webkit-box-pack: end;
193
+ -ms-flex-pack: end;
194
+ } @else if ($value == space-between) {
195
+ -webkit-box-pack: justify;
196
+ -ms-flex-pack: justify;
197
+ } @else if ($value == space-around) {
198
+ -ms-flex-pack: distribute;
199
+ } @else {
200
+ -webkit-box-pack: $value;
201
+ -ms-flex-pack: $value;
202
+ }
203
+
204
+ -webkit-justify-content: $value;
205
+ -moz-justify-content: $value;
206
+ justify-content: $value;
207
+ }
208
+
209
+ //----------------------------------------------------------------------
210
+
211
+ // flex 交叉轴对齐方式
212
+ // 取值:flex-start | flex-end | center | baseline | stretch
213
+ // 默认:stretch
214
+ @mixin align-items($value: stretch) {
215
+ @if ($value == flex-start) {
216
+ -webkit-box-align: start;
217
+ -ms-flex-align: start;
218
+ } @else if ($value == flex-end) {
219
+ -webkit-box-align: end;
220
+ -ms-flex-align: end;
221
+ } @else {
222
+ -webkit-box-align: $value;
223
+ -ms-flex-align: $value;
224
+ }
225
+
226
+ -webkit-align-items: $value;
227
+ -moz-align-items: $value;
228
+ align-items: $value;
229
+ }
230
+
231
+ //----------------------------------------------------------------------
232
+
233
+ // flex 自身在交叉轴对齐方式
234
+ //
235
+ // 取值:auto | flex-start | flex-end | center | baseline | stretch
236
+ // 默认:auto
237
+ @mixin align-self($value: auto) {
238
+ -webkit-align-self: $value;
239
+ -moz-align-self: $value;
240
+
241
+ @if ($value == flex-start) {
242
+ -ms-flex-item-align: start;
243
+ } @else if ($value == flex-end) {
244
+ -ms-flex-item-align: end;
245
+ } @else {
246
+ -ms-flex-item-align: $value;
247
+ }
248
+
249
+ align-self: $value;
250
+ }
251
+
252
+ //----------------------------------------------------------------------
253
+
254
+ // flex 内容在交叉轴上的对齐方式
255
+ // 取值:flex-start | flex-end | center | space-between | space-around | stretch
256
+ // 默认:stretch
257
+ @mixin align-content($value: stretch) {
258
+ -webkit-align-content: $value;
259
+ -moz-align-content: $value;
260
+
261
+ @if ($value == flex-start) {
262
+ -ms-flex-line-pack: start;
263
+ } @else if $value == (flex-end) {
264
+ -ms-flex-line-pack: end;
265
+ } @else {
266
+ -ms-flex-line-pack: $value;
267
+ }
268
+
269
+ align-content: $value;
270
+ }
@@ -0,0 +1,271 @@
1
+ #app {
2
+
3
+ .main-container {
4
+ min-height: 100%;
5
+ transition: margin-left .28s;
6
+ margin-left: $sideBarWidth;
7
+ position: relative;
8
+ background-color: #f3f3f3;
9
+ }
10
+
11
+ .sidebar-container {
12
+ transition: width 0.28s;
13
+ width: $sideBarWidth !important;
14
+ background-color: $menuBg;
15
+ height: 100%;
16
+ position: fixed;
17
+ font-size: 0px;
18
+ top: 0;
19
+ bottom: 0;
20
+ left: 0;
21
+ z-index: 1001;
22
+ overflow: hidden;
23
+
24
+ // reset element-ui css
25
+ .horizontal-collapse-transition {
26
+ transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
27
+ }
28
+
29
+ .scrollbar-wrapper {
30
+ overflow-x: hidden !important;
31
+ }
32
+
33
+ .el-scrollbar__bar.is-vertical {
34
+ right: 0px;
35
+ }
36
+
37
+ .el-scrollbar {
38
+ height: 100%
39
+ }
40
+
41
+ &.has-logo {
42
+ .el-scrollbar {
43
+ // height: calc(100% - 100px);
44
+ height: 100%;
45
+ }
46
+ }
47
+
48
+ .is-horizontal {
49
+ display: none;
50
+ }
51
+
52
+ a {
53
+ display: inline-block;
54
+ width: 100%;
55
+ overflow: hidden;
56
+ }
57
+
58
+ .svg-icon {
59
+ margin-right: 16px;
60
+ }
61
+
62
+ .sub-el-icon {
63
+ margin-right: 12px;
64
+ margin-left: -2px;
65
+ }
66
+
67
+ .el-menu {
68
+ border: none;
69
+ height: 100%;
70
+ width: 100% !important;
71
+ &-item{
72
+ position: relative;
73
+ &::before{
74
+ content:"";
75
+ position: absolute;
76
+ left: 0;
77
+ height: 100%;
78
+ width: 3px;
79
+ background-color: transparent;
80
+ transition: all .3s ease-in-out;
81
+ }
82
+ &.is-active.submenu-title-noDropdown{
83
+ background-color: $subMenuActiveBg !important;
84
+ &::before{
85
+ background-color: $menuActiveText !important;
86
+ z-index: 1;
87
+ }
88
+ }
89
+ }
90
+ }
91
+
92
+ // menu hover
93
+ .submenu-title-noDropdown,
94
+ .el-submenu__title {
95
+ &:hover {
96
+ background-color: $menuHover !important;
97
+ color: $menuActiveText !important;
98
+ }
99
+ }
100
+
101
+ .is-active>.el-submenu__title {
102
+ color: $subMenuActiveText !important;
103
+ background-color: $subMenuActiveBg !important;
104
+ }
105
+ .el-submenu{
106
+ // border-left: 3px solid transparent;
107
+ position: relative;
108
+ &::before{
109
+ content:"";
110
+ position: absolute;
111
+ left: 0;
112
+ height: 100%;
113
+ width: 3px;
114
+ background-color: transparent;
115
+ transition: all .3s ease-in-out;
116
+ }
117
+ &.is-active.is-opened{
118
+ // border-left-color: $menuActiveText;
119
+ &::before{
120
+ background-color: $menuActiveText !important;
121
+ z-index: 1;
122
+ }
123
+ // border-left: 3px solid $menuActiveText;
124
+ }
125
+ }
126
+ & .nest-menu .el-submenu>.el-submenu__title,
127
+ & .el-submenu .el-menu-item {
128
+ min-width: $sideBarWidth !important;
129
+ background-color: $subMenuBg !important;
130
+ &:hover {
131
+ background-color: $subMenuHover !important;
132
+ color: $menuActiveText !important;
133
+ }
134
+
135
+ }
136
+ }
137
+
138
+ .hideSidebar {
139
+ .sidebar-container {
140
+ width: 54px !important;
141
+ }
142
+
143
+ .main-container {
144
+ margin-left: 54px;
145
+ }
146
+
147
+ .submenu-title-noDropdown {
148
+ padding: 0 !important;
149
+ position: relative;
150
+
151
+ .el-tooltip {
152
+ padding: 0 !important;
153
+
154
+ .svg-icon {
155
+ margin-left: 20px;
156
+ }
157
+
158
+ .sub-el-icon {
159
+ margin-left: 19px;
160
+ }
161
+ }
162
+ }
163
+
164
+ .el-submenu {
165
+ overflow: hidden;
166
+
167
+ &>.el-submenu__title {
168
+ padding: 0 !important;
169
+
170
+ .svg-icon {
171
+ margin-left: 20px;
172
+ }
173
+
174
+ .sub-el-icon {
175
+ margin-left: 19px;
176
+ }
177
+
178
+ .el-submenu__icon-arrow {
179
+ display: none;
180
+ }
181
+ }
182
+ }
183
+
184
+ .el-menu--collapse {
185
+ .el-submenu {
186
+ &>.el-submenu__title {
187
+ &>span {
188
+ height: 0;
189
+ width: 0;
190
+ overflow: hidden;
191
+ visibility: hidden;
192
+ display: inline-block;
193
+ }
194
+ }
195
+ }
196
+ }
197
+ }
198
+
199
+ .el-menu--collapse .el-menu .el-submenu {
200
+ min-width: $sideBarWidth !important;
201
+ }
202
+
203
+ // mobile responsive
204
+ .mobile {
205
+ .main-container {
206
+ margin-left: 0px;
207
+ }
208
+
209
+ .sidebar-container {
210
+ transition: transform .28s;
211
+ width: $sideBarWidth !important;
212
+ }
213
+
214
+ &.hideSidebar {
215
+ .sidebar-container {
216
+ pointer-events: none;
217
+ transition-duration: 0.3s;
218
+ transform: translate3d(-$sideBarWidth, 0, 0);
219
+ }
220
+ }
221
+ }
222
+
223
+ .withoutAnimation {
224
+
225
+ .main-container,
226
+ .sidebar-container {
227
+ transition: none;
228
+ }
229
+ }
230
+ }
231
+
232
+ // when menu collapsed
233
+ .el-menu--vertical {
234
+ &>.el-menu {
235
+ .svg-icon {
236
+ margin-right: 16px;
237
+ }
238
+ .sub-el-icon {
239
+ margin-right: 12px;
240
+ margin-left: -2px;
241
+ }
242
+ }
243
+
244
+ .nest-menu .el-submenu>.el-submenu__title,
245
+ .el-menu-item {
246
+ &:hover {
247
+ // you can use $subMenuHover
248
+ background-color: $menuHover !important;
249
+ }
250
+ }
251
+
252
+ // the scroll bar appears when the subMenu is too long
253
+ >.el-menu--popup {
254
+ max-height: 100vh;
255
+ overflow-y: auto;
256
+
257
+ &::-webkit-scrollbar-track-piece {
258
+ background: #d3dce6;
259
+ }
260
+
261
+ &::-webkit-scrollbar {
262
+ width: 6px;
263
+ }
264
+
265
+ &::-webkit-scrollbar-thumb {
266
+ background: #99a9bf;
267
+ border-radius: 20px;
268
+ }
269
+ }
270
+ }
271
+
@@ -0,0 +1,52 @@
1
+ // global transition css
2
+
3
+ /* fade */
4
+ .fade-enter-active,
5
+ .fade-leave-active {
6
+ transition: opacity 0.28s;
7
+ }
8
+
9
+ .fade-enter,
10
+ .fade-leave-active {
11
+ opacity: 0;
12
+ }
13
+
14
+ /* fade-transform */
15
+ .fade-transform-leave-active,
16
+ .fade-transform-enter-active {
17
+ transition: all .3s;
18
+ }
19
+
20
+ .fade-transform-enter {
21
+ opacity: 0;
22
+ transform: translateX(-30px);
23
+ }
24
+
25
+ .fade-transform-leave-to {
26
+ opacity: 0;
27
+ transform: translateX(30px);
28
+ }
29
+
30
+ /* breadcrumb transition */
31
+ .breadcrumb-enter-active,
32
+ .breadcrumb-leave-active {
33
+ transition: all .3s;
34
+ }
35
+
36
+ .breadcrumb-enter,
37
+ .breadcrumb-leave-active {
38
+ opacity: 0;
39
+ transform: translateX(20px);
40
+ }
41
+
42
+ .breadcrumb-move {
43
+ transition: all .3s;
44
+ }
45
+
46
+ .breadcrumb-leave-active {
47
+ position: absolute;
48
+ }
49
+ .el-list-enter-active,
50
+ .el-list-leave-active {
51
+ transition: none !important;
52
+ }
@@ -0,0 +1,36 @@
1
+ // base color
2
+ $blue:#324157;
3
+ $light-blue:#3A71A8;
4
+ $red:#C03639;
5
+ $pink: #E65D6E;
6
+ $green: #30B08F;
7
+ $tiffany: #4AB7BD;
8
+ $yellow:#FEC171;
9
+ $panGreen: #30B08F;
10
+
11
+ // sidebar
12
+ $menuText:#4A4A53;
13
+ $menuActiveText:#FF745C;
14
+ $subMenuActiveText:#FF745C;
15
+ $subMenuActiveBg:#FFEDEA;
16
+
17
+ $menuBg:#fff;
18
+ $menuHover:#FFEDEA;
19
+
20
+ $subMenuBg:#fff;
21
+ $subMenuHover:#FFEDEA;
22
+
23
+ $sideBarWidth: 200px;
24
+
25
+ // the :export directive is the magic sauce for webpack
26
+ // https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
27
+ :export {
28
+ menuText: $menuText;
29
+ menuActiveText: $menuActiveText;
30
+ subMenuActiveText: $subMenuActiveText;
31
+ menuBg: $menuBg;
32
+ menuHover: $menuHover;
33
+ subMenuBg: $subMenuBg;
34
+ subMenuHover: $subMenuHover;
35
+ sideBarWidth: $sideBarWidth;
36
+ }
@@ -0,0 +1,2 @@
1
+ import dayjs from 'dayjs'
2
+ export default dayjs