iov-design 2.15.44 → 2.15.46

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.
@@ -1,196 +1,196 @@
1
- <script>
2
- import TabNav from './tab-nav';
3
-
4
- export default {
5
- name: 'ElTabs',
6
-
7
- components: {
8
- TabNav
9
- },
10
-
11
- props: {
12
- type: String,
13
- size: String,
14
- activeName: String,
15
- closable: Boolean,
16
- addable: Boolean,
17
- value: {},
18
- editable: Boolean,
19
- tabPosition: {
20
- type: String,
21
- default: 'top'
22
- },
23
- beforeLeave: Function,
24
- stretch: Boolean
25
- },
26
-
27
- provide() {
28
- return {
29
- rootTabs: this
30
- };
31
- },
32
-
33
- data() {
34
- return {
35
- currentName: this.value || this.activeName,
36
- panes: []
37
- };
38
- },
39
-
40
- watch: {
41
- activeName(value) {
42
- this.setCurrentName(value);
43
- },
44
- value(value) {
45
- this.setCurrentName(value);
46
- },
47
- currentName(value) {
48
- if (this.$refs.nav) {
49
- this.$nextTick(() => {
50
- this.$refs.nav.$nextTick(_ => {
51
- this.$refs.nav.scrollToActiveTab();
52
- });
53
- });
54
- }
55
- }
56
- },
57
-
58
- methods: {
59
- calcPaneInstances(isForceUpdate = false) {
60
- if (this.$slots.default) {
61
- const paneSlots = this.$slots.default.filter(vnode => vnode.tag &&
62
- vnode.componentOptions && vnode.componentOptions.Ctor.options.name === 'ElTabPane');
63
- // update indeed
64
- const panes = paneSlots.map(({ componentInstance }) => componentInstance);
65
- const panesChanged = !(panes.length === this.panes.length && panes.every((pane, index) => pane === this.panes[index]));
66
- if (isForceUpdate || panesChanged) {
67
- this.panes = panes;
68
- }
69
- } else if (this.panes.length !== 0) {
70
- this.panes = [];
71
- }
72
- },
73
- handleTabClick(tab, tabName, event) {
74
- if (tab.disabled) return;
75
- this.setCurrentName(tabName);
76
- this.$emit('tab-click', tab, event);
77
- },
78
- handleTabRemove(pane, ev) {
79
- if (pane.disabled) return;
80
- ev.stopPropagation();
81
- this.$emit('edit', pane.name, 'remove');
82
- this.$emit('tab-remove', pane.name);
83
- },
84
- handleTabAdd() {
85
- this.$emit('edit', null, 'add');
86
- this.$emit('tab-add');
87
- },
88
- setCurrentName(value) {
89
- const changeCurrentName = () => {
90
- this.currentName = value;
91
- this.$emit('input', value);
92
- };
93
- if (this.currentName !== value && this.beforeLeave) {
94
- const before = this.beforeLeave(value, this.currentName);
95
- if (before && before.then) {
96
- before
97
- .then(() => {
98
- changeCurrentName();
99
- this.$refs.nav && this.$refs.nav.removeFocus();
100
- }, () => {
101
- // https://github.com/ElemeFE/element/pull/14816
102
- // ignore promise rejection in `before-leave` hook
103
- });
104
- } else if (before !== false) {
105
- changeCurrentName();
106
- }
107
- } else {
108
- changeCurrentName();
109
- }
110
- }
111
- },
112
-
113
- render(h) {
114
- let {
115
- type,
116
- size,
117
- handleTabClick,
118
- handleTabRemove,
119
- handleTabAdd,
120
- currentName,
121
- panes,
122
- editable,
123
- addable,
124
- tabPosition,
125
- stretch
126
- } = this;
127
-
128
- const newButton = editable || addable
129
- ? (
130
- <span
131
- class="el-tabs__new-tab"
132
- on-click={ handleTabAdd }
133
- tabindex="0"
134
- on-keydown={ (ev) => { if (ev.keyCode === 13) { handleTabAdd(); }} }
135
- >
136
- <i class="iov-icon-plus"></i>
137
- </span>
138
- )
139
- : null;
140
-
141
- const navData = {
142
- props: {
143
- currentName,
144
- onTabClick: handleTabClick,
145
- onTabRemove: handleTabRemove,
146
- editable,
147
- type,
148
- panes,
149
- stretch
150
- },
151
- ref: 'nav'
152
- };
153
- const header = (
154
- <div class={['el-tabs__header', `is-${tabPosition}`]}>
155
- {newButton}
156
- <tab-nav { ...navData }></tab-nav>
157
- </div>
158
- );
159
- const panels = (
160
- <div class="el-tabs__content">
161
- {this.$slots.default}
162
- </div>
163
- );
164
-
165
- return (
166
- <div class={{
167
- 'el-tabs': true,
168
- 'el-tabs--normal': !type,
169
- 'el-tabs--card': type === 'card',
170
- 'el-tabs--capsule': type === 'capsule',
171
- [`el-tabs--${size}`]: size,
172
- [`el-tabs--${tabPosition}`]: true,
173
- 'el-tabs--border-card': type === 'border-card'
174
- }}>
175
- { tabPosition !== 'bottom' ? [header, panels] : [panels, header] }
176
- </div>
177
- );
178
- },
179
-
180
- created() {
181
- if (!this.currentName) {
182
- this.setCurrentName('0');
183
- }
184
-
185
- this.$on('tab-nav-update', this.calcPaneInstances.bind(null, true));
186
- },
187
-
188
- mounted() {
189
- this.calcPaneInstances();
190
- },
191
-
192
- updated() {
193
- this.calcPaneInstances();
194
- }
195
- };
196
- </script>
1
+ <script>
2
+ import TabNav from './tab-nav';
3
+
4
+ export default {
5
+ name: 'ElTabs',
6
+
7
+ components: {
8
+ TabNav
9
+ },
10
+
11
+ props: {
12
+ type: String,
13
+ size: String,
14
+ activeName: String,
15
+ closable: Boolean,
16
+ addable: Boolean,
17
+ value: {},
18
+ editable: Boolean,
19
+ tabPosition: {
20
+ type: String,
21
+ default: 'top'
22
+ },
23
+ beforeLeave: Function,
24
+ stretch: Boolean
25
+ },
26
+
27
+ provide() {
28
+ return {
29
+ rootTabs: this
30
+ };
31
+ },
32
+
33
+ data() {
34
+ return {
35
+ currentName: this.value || this.activeName,
36
+ panes: []
37
+ };
38
+ },
39
+
40
+ watch: {
41
+ activeName(value) {
42
+ this.setCurrentName(value);
43
+ },
44
+ value(value) {
45
+ this.setCurrentName(value);
46
+ },
47
+ currentName(value) {
48
+ if (this.$refs.nav) {
49
+ this.$nextTick(() => {
50
+ this.$refs.nav.$nextTick(_ => {
51
+ this.$refs.nav.scrollToActiveTab();
52
+ });
53
+ });
54
+ }
55
+ }
56
+ },
57
+
58
+ methods: {
59
+ calcPaneInstances(isForceUpdate = false) {
60
+ if (this.$slots.default) {
61
+ const paneSlots = this.$slots.default.filter(vnode => vnode.tag &&
62
+ vnode.componentOptions && vnode.componentOptions.Ctor.options.name === 'ElTabPane');
63
+ // update indeed
64
+ const panes = paneSlots.map(({ componentInstance }) => componentInstance);
65
+ const panesChanged = !(panes.length === this.panes.length && panes.every((pane, index) => pane === this.panes[index]));
66
+ if (isForceUpdate || panesChanged) {
67
+ this.panes = panes;
68
+ }
69
+ } else if (this.panes.length !== 0) {
70
+ this.panes = [];
71
+ }
72
+ },
73
+ handleTabClick(tab, tabName, event) {
74
+ if (tab.disabled) return;
75
+ this.setCurrentName(tabName);
76
+ this.$emit('tab-click', tab, event);
77
+ },
78
+ handleTabRemove(pane, ev) {
79
+ if (pane.disabled) return;
80
+ ev.stopPropagation();
81
+ this.$emit('edit', pane.name, 'remove');
82
+ this.$emit('tab-remove', pane.name);
83
+ },
84
+ handleTabAdd() {
85
+ this.$emit('edit', null, 'add');
86
+ this.$emit('tab-add');
87
+ },
88
+ setCurrentName(value) {
89
+ const changeCurrentName = () => {
90
+ this.currentName = value;
91
+ this.$emit('input', value);
92
+ };
93
+ if (this.currentName !== value && this.beforeLeave) {
94
+ const before = this.beforeLeave(value, this.currentName);
95
+ if (before && before.then) {
96
+ before
97
+ .then(() => {
98
+ changeCurrentName();
99
+ this.$refs.nav && this.$refs.nav.removeFocus();
100
+ }, () => {
101
+ // https://github.com/ElemeFE/element/pull/14816
102
+ // ignore promise rejection in `before-leave` hook
103
+ });
104
+ } else if (before !== false) {
105
+ changeCurrentName();
106
+ }
107
+ } else {
108
+ changeCurrentName();
109
+ }
110
+ }
111
+ },
112
+
113
+ render(h) {
114
+ let {
115
+ type,
116
+ size,
117
+ handleTabClick,
118
+ handleTabRemove,
119
+ handleTabAdd,
120
+ currentName,
121
+ panes,
122
+ editable,
123
+ addable,
124
+ tabPosition,
125
+ stretch
126
+ } = this;
127
+
128
+ const newButton = editable || addable
129
+ ? (
130
+ <span
131
+ class="el-tabs__new-tab"
132
+ on-click={ handleTabAdd }
133
+ tabindex="0"
134
+ on-keydown={ (ev) => { if (ev.keyCode === 13) { handleTabAdd(); }} }
135
+ >
136
+ <i class="iov-icon-plus"></i>
137
+ </span>
138
+ )
139
+ : null;
140
+
141
+ const navData = {
142
+ props: {
143
+ currentName,
144
+ onTabClick: handleTabClick,
145
+ onTabRemove: handleTabRemove,
146
+ editable,
147
+ type,
148
+ panes,
149
+ stretch
150
+ },
151
+ ref: 'nav'
152
+ };
153
+ const header = (
154
+ <div class={['el-tabs__header', `is-${tabPosition}`]}>
155
+ {newButton}
156
+ <tab-nav { ...navData }></tab-nav>
157
+ </div>
158
+ );
159
+ const panels = (
160
+ <div class="el-tabs__content">
161
+ {this.$slots.default}
162
+ </div>
163
+ );
164
+
165
+ return (
166
+ <div class={{
167
+ 'el-tabs': true,
168
+ 'el-tabs--normal': !type,
169
+ 'el-tabs--card': type === 'card',
170
+ 'el-tabs--capsule': type === 'capsule',
171
+ [`el-tabs--${size}`]: size,
172
+ [`el-tabs--${tabPosition}`]: true,
173
+ 'el-tabs--border-card': type === 'border-card'
174
+ }}>
175
+ { tabPosition !== 'bottom' ? [header, panels] : [panels, header] }
176
+ </div>
177
+ );
178
+ },
179
+
180
+ created() {
181
+ if (!this.currentName) {
182
+ this.setCurrentName('0');
183
+ }
184
+
185
+ this.$on('tab-nav-update', this.calcPaneInstances.bind(null, true));
186
+ },
187
+
188
+ mounted() {
189
+ this.calcPaneInstances();
190
+ },
191
+
192
+ updated() {
193
+ this.calcPaneInstances();
194
+ }
195
+ };
196
+ </script>
@@ -3,12 +3,12 @@
3
3
 
4
4
  @include b(alert) {
5
5
  width: 100%;
6
- padding: $--alert-padding;
6
+ padding: 11px 12px;
7
7
  margin: 0;
8
8
  box-sizing: border-box;
9
- border-radius: $--alert-border-radius;
9
+ border-radius: 4px;
10
10
  position: relative;
11
- background-color: $--color-white;
11
+ background-color: #fff;
12
12
  overflow: hidden;
13
13
  opacity: 1;
14
14
  display: flex;
@@ -26,10 +26,10 @@
26
26
 
27
27
  @include when(dark) {
28
28
  .el-alert__closebtn {
29
- color: $--color-white;
29
+ color: #fff;
30
30
  }
31
31
  .el-alert__description {
32
- color: $--color-white;
32
+ color: #fff;
33
33
  }
34
34
  }
35
35
 
@@ -49,7 +49,7 @@
49
49
 
50
50
  &.is-dark {
51
51
  background-color: $--color-success-6;
52
- color: $--color-white;
52
+ color: #fff;
53
53
  }
54
54
  }
55
55
 
@@ -65,7 +65,7 @@
65
65
 
66
66
  &.is-dark {
67
67
  background-color: $--color-primary-6;
68
- color: $--color-white;
68
+ color: #fff;
69
69
  }
70
70
  }
71
71
 
@@ -81,7 +81,7 @@
81
81
 
82
82
  &.is-dark {
83
83
  background-color: $--color-warning-6;
84
- color: $--color-white;
84
+ color: #fff;
85
85
  }
86
86
  }
87
87
 
@@ -97,7 +97,7 @@
97
97
 
98
98
  &.is-dark {
99
99
  background-color: $--color-danger-6;
100
- color: $--color-white;
100
+ color: #fff;
101
101
  }
102
102
  }
103
103
 
@@ -107,30 +107,33 @@
107
107
 
108
108
  @include e(icon) {
109
109
  margin-right: 8px;
110
- font-size: $--alert-icon-size;
111
- width: $--alert-icon-size;
110
+ font-size: 16px;
111
+ width: 16px;
112
112
  @include when(big) {
113
- font-size: $--alert-icon-large-size;
114
- width: $--alert-icon-large-size;
113
+ font-size: 16px;
114
+ width: 16px;
115
+ align-self: flex-start;
115
116
  }
116
117
  }
117
118
 
118
119
  @include e(title) {
119
- font-size: $--alert-title-font-size;
120
+ font-size: 12px;
121
+ line-height: 16px;
122
+ display: block;
120
123
  @include when(bold) {
121
124
  font-weight: 500;
122
125
  }
123
126
  }
124
127
 
125
128
  & .el-alert__description {
126
- font-size: $--alert-description-font-size;
127
- margin: 5px 0 0 0;
129
+ font-size: 12px;
130
+ margin: 4px 0 0 0;
128
131
  color: $--color-text-6;
129
132
  font-weight: 400;
130
133
  }
131
134
 
132
135
  @include e(closebtn) {
133
- font-size: $--alert-close-font-size;
136
+ font-size: 14px;
134
137
  opacity: 1;
135
138
  position: absolute;
136
139
  top: 12px;
@@ -139,7 +142,7 @@
139
142
 
140
143
  @include when(customed) {
141
144
  font-style: normal;
142
- font-size: $--alert-close-customed-font-size;
145
+ font-size: 12px;
143
146
  top: 11px;
144
147
  }
145
148
  }
@@ -280,44 +280,11 @@ $--select-dropdown-border: solid 0.5px $--color-line-2 !default;
280
280
 
281
281
  /* Alert
282
282
  -------------------------- */
283
- $--alert-padding: 11px 12px !default;
284
- $--alert-border-radius: 4px !default;
285
- $--alert-title-font-size: 12px !default;
286
- $--alert-description-font-size: 12px !default;
287
- $--alert-close-font-size: 14px !default;
288
- $--alert-close-customed-font-size: 12px !default;
289
-
290
- $--alert-success-color: $--color-success-lighter !default;
291
- $--alert-info-color: $--color-info-lighter !default;
292
- $--alert-warning-color: $--color-warning-lighter !default;
293
- $--alert-danger-color: $--color-danger-lighter !default;
294
-
295
- $--alert-icon-size: 16px !default;
296
- $--alert-icon-large-size: 28px !default;
297
283
 
298
284
  /* MessageBox
299
285
 
300
286
  /* Message
301
287
  -------------------------- */
302
- $--message-shadow: $--box-shadow-base !default;
303
- $--message-min-width: 380px !default;
304
- $--message-background-color: #edf2fc !default;
305
- $--message-padding: 15px 15px 15px 20px !default;
306
- /// color||Color|0
307
- $--message-close-icon-color: $--color-text-placeholder !default;
308
- /// height||Other|4
309
- $--message-close-size: 16px !default;
310
- /// color||Color|0
311
- $--message-close-hover-color: $--color-text-secondary !default;
312
-
313
- /// color||Color|0
314
- $--message-success-font-color: $--color-success !default;
315
- /// color||Color|0
316
- $--message-info-font-color: $--color-info !default;
317
- /// color||Color|0
318
- $--message-warning-font-color: $--color-warning !default;
319
- /// color||Color|0
320
- $--message-danger-font-color: $--color-danger !default;
321
288
 
322
289
  /* Notification
323
290
  -------------------------- */
@@ -329,7 +296,7 @@ $--notification-shadow: $--box-shadow-light !default;
329
296
  /// color||Color|0
330
297
  $--notification-border-color: $--border-color-lighter !default;
331
298
  $--notification-icon-size: 24px !default;
332
- $--notification-close-font-size: $--message-close-size !default;
299
+ $--notification-close-font-size: 14px !default;
333
300
  $--notification-group-margin-left: 13px !default;
334
301
  $--notification-group-margin-right: 8px !default;
335
302
  /// fontSize||Font|1
@@ -10,13 +10,22 @@
10
10
  border-radius: 8px;
11
11
  box-sizing: border-box;
12
12
  width: 50%;
13
+ transform: translateY(-50%);
13
14
 
14
15
  @include when(fullscreen) {
15
16
  width: 100%;
16
- margin-top: 0;
17
+ top: 0;
17
18
  margin-bottom: 0;
18
19
  height: 100%;
19
20
  overflow: auto;
21
+ transform: none;
22
+ display: flex;
23
+ flex-direction: column;
24
+ justify-content: space-between;
25
+ .el-dialog__body {
26
+ flex: 1;
27
+ max-height: none;
28
+ }
20
29
  }
21
30
 
22
31
  @include e(wrapper) {
@@ -79,22 +88,23 @@
79
88
  }
80
89
 
81
90
  @include e(footer) {
82
- padding: 16px 24px 20px 0;
91
+ padding: 16px 24px 20px;
83
92
  text-align: right;
84
93
  box-sizing: border-box;
85
94
  font-size: 0;
95
+ &.el-dialog__footer--shadow {
96
+ box-shadow: 0 0 12px 0 rgba(196, 198, 207, 0.21);
97
+ }
86
98
  }
87
99
 
88
- // 内容居中布局
89
100
  @include m(center) {
90
- text-align: center;
91
101
 
92
102
  @include e(body) {
93
- text-align: initial;
103
+ text-align: left;
94
104
  }
95
105
 
96
106
  @include e(footer) {
97
- text-align: inherit;
107
+ text-align: center;
98
108
  }
99
109
  }
100
110
  }