bkui-vue 2.0.1-beta.94 → 2.0.1-beta.95

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.
package/lib/index.js CHANGED
@@ -4,5 +4,5 @@ export { default } from './preset';
4
4
  export * from './config-provider';
5
5
  export * from './directives';
6
6
  export * as plugins from './plugins';
7
- export const version = "2.0.1-beta.94";
7
+ export const version = "2.0.1-beta.95";
8
8
  window.__bkui_vue_version__ = version;
@@ -107,14 +107,23 @@ declare const BkMenu: {
107
107
  type: BooleanConstructor;
108
108
  default: boolean;
109
109
  };
110
+ disabled: {
111
+ type: BooleanConstructor;
112
+ default: boolean;
113
+ };
110
114
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
111
115
  needIcon: {
112
116
  type: BooleanConstructor;
113
117
  default: boolean;
114
118
  };
119
+ disabled: {
120
+ type: BooleanConstructor;
121
+ default: boolean;
122
+ };
115
123
  }>> & {
116
124
  onClick?: (...args: any[]) => any;
117
125
  }, {
126
+ disabled: boolean;
118
127
  needIcon: boolean;
119
128
  }, import("vue").SlotsType<{
120
129
  default?: () => HTMLElement;
package/lib/menu/index.js CHANGED
@@ -523,6 +523,10 @@ var menuProps = {
523
523
  needIcon: {
524
524
  type: Boolean,
525
525
  "default": true
526
+ },
527
+ disabled: {
528
+ type: Boolean,
529
+ "default": false
526
530
  }
527
531
  },
528
532
  emits: ['click'],
@@ -552,6 +556,9 @@ var menuProps = {
552
556
  parentKey: parentInfo === null || parentInfo === void 0 ? void 0 : parentInfo.key
553
557
  });
554
558
  var handleClick = function handleClick(e) {
559
+ if (props.disabled) {
560
+ return;
561
+ }
555
562
  handleActiveChange(key);
556
563
  emit('click', e);
557
564
  };
@@ -563,7 +570,7 @@ var menuProps = {
563
570
  return function () {
564
571
  var _slots$icon, _slots$default;
565
572
  return (0,external_vue_namespaceObject.createVNode)("li", {
566
- "class": _defineProperty(_defineProperty({}, "".concat(resolveClassName('menu-item')), true), 'is-active', isActive.value),
573
+ "class": _defineProperty(_defineProperty(_defineProperty({}, "".concat(resolveClassName('menu-item')), true), 'is-active', isActive.value), 'is-disabled', props.disabled),
567
574
  "onClick": handleClick
568
575
  }, [needIcon.value && (0,external_vue_namespaceObject.createVNode)("span", {
569
576
  "class": "item-icon"
@@ -4,14 +4,23 @@ declare const _default: import("vue").DefineComponent<{
4
4
  type: BooleanConstructor;
5
5
  default: boolean;
6
6
  };
7
+ disabled: {
8
+ type: BooleanConstructor;
9
+ default: boolean;
10
+ };
7
11
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
8
12
  needIcon: {
9
13
  type: BooleanConstructor;
10
14
  default: boolean;
11
15
  };
16
+ disabled: {
17
+ type: BooleanConstructor;
18
+ default: boolean;
19
+ };
12
20
  }>> & {
13
21
  onClick?: (...args: any[]) => any;
14
22
  }, {
23
+ disabled: boolean;
15
24
  needIcon: boolean;
16
25
  }, SlotsType<{
17
26
  default?: () => HTMLElement;
package/lib/menu/menu.css CHANGED
@@ -208,9 +208,9 @@
208
208
  }
209
209
  .bk-menu {
210
210
  display: flex;
211
+ flex-direction: column;
211
212
  width: var(--menu-width);
212
213
  background-color: var(--menu-bg-color);
213
- flex-direction: column;
214
214
  transition: width 0.3s ease-out;
215
215
  }
216
216
  .bk-menu.is-collapse {
@@ -219,10 +219,10 @@
219
219
  .bk-menu-submenu {
220
220
  display: flex;
221
221
  flex-direction: column;
222
+ align-items: center;
222
223
  overflow: hidden;
223
224
  text-overflow: clip;
224
225
  white-space: nowrap;
225
- align-items: center;
226
226
  transition: width 0.3s ease-out;
227
227
  }
228
228
  .bk-menu-submenu.is-opened {
@@ -234,9 +234,9 @@
234
234
  }
235
235
  .bk-menu-submenu .submenu-header {
236
236
  display: flex;
237
+ align-items: center;
237
238
  width: 100%;
238
239
  height: 40px;
239
- align-items: center;
240
240
  }
241
241
  .bk-menu-submenu .submenu-header.is-collapse {
242
242
  color: var(--menu-active-color);
@@ -244,11 +244,11 @@
244
244
  }
245
245
  .bk-menu-submenu .submenu-header-icon {
246
246
  display: flex;
247
- height: 100%;
248
- font-size: 18px;
249
247
  flex: 0 0 var(--menu-collapse-width);
250
248
  align-items: center;
251
249
  justify-content: center;
250
+ height: 100%;
251
+ font-size: 18px;
252
252
  }
253
253
  .bk-menu-submenu .submenu-header-icon .menu-icon {
254
254
  display: flex;
@@ -261,9 +261,9 @@
261
261
  }
262
262
  .bk-menu-submenu .submenu-header-content {
263
263
  display: flex;
264
- height: 100%;
265
- align-items: center;
266
264
  flex: 1;
265
+ align-items: center;
266
+ height: 100%;
267
267
  color: #acb9d1;
268
268
  }
269
269
  .bk-menu-submenu .submenu-header-collapse {
@@ -275,24 +275,25 @@
275
275
  justify-content: center;
276
276
  margin-right: 16px;
277
277
  color: #acb9d1;
278
- transform: rotate(-90deg);
279
278
  transition: transform 0.3s ease-out;
279
+ transform: rotate(-90deg);
280
280
  }
281
281
  .bk-menu-submenu .submenu-header-collapse.is-collapse {
282
282
  transform: rotate(0deg);
283
283
  }
284
284
  .bk-menu-submenu .submenu-list {
285
285
  display: flex;
286
+ flex: 1;
287
+ flex-direction: column;
286
288
  width: 100%;
287
289
  padding: 0;
288
290
  margin: 0;
289
- flex-direction: column;
290
- flex: 1;
291
291
  /* stylelint-disable-next-line declaration-no-important */
292
292
  transition-property: all !important;
293
293
  }
294
294
  .bk-menu-item {
295
295
  display: flex;
296
+ align-items: center;
296
297
  width: 100%;
297
298
  height: 40px;
298
299
  min-height: 40px;
@@ -302,7 +303,6 @@
302
303
  color: var(--menu-color);
303
304
  text-overflow: clip;
304
305
  white-space: nowrap;
305
- align-items: center;
306
306
  transition: width 0.3s ease-in-out;
307
307
  }
308
308
  .bk-menu-item:hover {
@@ -313,13 +313,25 @@
313
313
  color: var(--menu-active-color);
314
314
  background: var(--menu-active-bg-color);
315
315
  }
316
+ .bk-menu-item.is-disabled {
317
+ color: var(--menu-group-color);
318
+ cursor: not-allowed;
319
+ }
320
+ .bk-menu-item.is-disabled:hover {
321
+ color: var(--menu-group-color);
322
+ cursor: not-allowed;
323
+ background: none;
324
+ }
325
+ .bk-menu-item.is-disabled .default-icon {
326
+ opacity: 0.4;
327
+ }
316
328
  .bk-menu-item .item-icon {
317
329
  display: flex;
318
- height: 100%;
319
- font-size: 18px;
320
330
  flex: 0 0 var(--menu-collapse-width);
321
331
  align-items: center;
322
332
  justify-content: center;
333
+ height: 100%;
334
+ font-size: 18px;
323
335
  }
324
336
  .bk-menu-item .item-icon .default-icon {
325
337
  display: inline-block;
@@ -331,9 +343,9 @@
331
343
  }
332
344
  .bk-menu-item .item-content {
333
345
  display: flex;
334
- height: 100%;
335
- align-items: center;
336
346
  flex: 1;
347
+ align-items: center;
348
+ height: 100%;
337
349
  }
338
350
  .bk-menu-group {
339
351
  display: flex;
@@ -341,6 +353,8 @@
341
353
  }
342
354
  .bk-menu-group .group-name {
343
355
  display: flex;
356
+ flex-wrap: nowrap;
357
+ align-items: center;
344
358
  height: 40px;
345
359
  margin: 0 18px;
346
360
  overflow: hidden;
@@ -349,8 +363,6 @@
349
363
  color: var(--menu-group-color);
350
364
  text-overflow: clip;
351
365
  white-space: nowrap;
352
- flex-wrap: nowrap;
353
- align-items: center;
354
366
  }
355
367
  .bk-menu-group .group-wrap {
356
368
  display: flex;
@@ -11,9 +11,9 @@
11
11
 
12
12
  .@{bk-prefix}-menu {
13
13
  display: flex;
14
+ flex-direction: column;
14
15
  width: @menu-width;
15
16
  background-color: @menu-bg-color;
16
- flex-direction: column;
17
17
  transition: width .3s ease-out;
18
18
 
19
19
  &.is-collapse {
@@ -22,12 +22,12 @@
22
22
 
23
23
  &-submenu {
24
24
  display: flex;
25
- align-items: center;
26
25
  flex-direction: column;
26
+ align-items: center;
27
+ align-items: center;
27
28
  overflow: hidden;
28
29
  text-overflow: clip;
29
30
  white-space: nowrap;
30
- align-items: center;
31
31
  transition: width .3s ease-out;
32
32
 
33
33
  &.is-opened {
@@ -41,9 +41,9 @@
41
41
 
42
42
  .submenu-header {
43
43
  display: flex;
44
+ align-items: center;
44
45
  width: 100%;
45
46
  height: 40px;
46
- align-items: center;
47
47
 
48
48
  &.is-collapse {
49
49
  color: @menu-active-color;
@@ -52,11 +52,11 @@
52
52
 
53
53
  &-icon {
54
54
  display: flex;
55
- height: 100%;
56
- font-size: 18px;
57
55
  flex: 0 0 @menu-collapse-width;
58
56
  align-items: center;
59
57
  justify-content: center;
58
+ height: 100%;
59
+ font-size: 18px;
60
60
 
61
61
  .menu-icon {
62
62
  .icon-size(16px, 16px);
@@ -66,9 +66,9 @@
66
66
 
67
67
  &-content {
68
68
  display: flex;
69
- height: 100%;
70
- align-items: center;
71
69
  flex: 1;
70
+ align-items: center;
71
+ height: 100%;
72
72
  color: #acb9d1
73
73
  }
74
74
 
@@ -76,8 +76,8 @@
76
76
  .icon-size(16px, 16px);
77
77
  margin-right: 16px;
78
78
  color: #acb9d1;
79
- transform: rotate(-90deg);
80
79
  transition: transform .3s ease-out;
80
+ transform: rotate(-90deg);
81
81
 
82
82
  &.is-collapse {
83
83
  transform: rotate(0deg);
@@ -87,11 +87,11 @@
87
87
 
88
88
  .submenu-list {
89
89
  display: flex;
90
+ flex: 1;
91
+ flex-direction: column;
90
92
  width: 100%;
91
93
  padding: 0;
92
94
  margin: 0;
93
- flex-direction: column;
94
- flex: 1;
95
95
 
96
96
  /* stylelint-disable-next-line declaration-no-important */
97
97
  transition-property: all !important;
@@ -100,6 +100,7 @@
100
100
 
101
101
  &-item {
102
102
  display: flex;
103
+ align-items: center;
103
104
  width: 100%;
104
105
  height: 40px;
105
106
  min-height: 40px;
@@ -109,7 +110,6 @@
109
110
  color: @menu-color;
110
111
  text-overflow: clip;
111
112
  white-space: nowrap;
112
- align-items: center;
113
113
  transition: width .3s ease-in-out;
114
114
 
115
115
  &:hover {
@@ -122,13 +122,28 @@
122
122
  background: @menu-active-bg-color;
123
123
  }
124
124
 
125
+ &.is-disabled {
126
+ color: @menu-group-color;
127
+ cursor: not-allowed;
128
+
129
+ &:hover {
130
+ color: @menu-group-color;
131
+ cursor: not-allowed;
132
+ background: none;
133
+ }
134
+
135
+ .default-icon {
136
+ opacity: 0.4;
137
+ }
138
+ }
139
+
125
140
  .item-icon {
126
141
  display: flex;
127
- height: 100%;
128
- font-size: 18px;
129
142
  flex: 0 0 @menu-collapse-width;
130
143
  align-items: center;
131
144
  justify-content: center;
145
+ height: 100%;
146
+ font-size: 18px;
132
147
 
133
148
  .default-icon {
134
149
  display: inline-block;
@@ -142,9 +157,9 @@
142
157
 
143
158
  .item-content {
144
159
  display: flex;
145
- height: 100%;
146
- align-items: center;
147
160
  flex: 1;
161
+ align-items: center;
162
+ height: 100%;
148
163
  }
149
164
  }
150
165
 
@@ -154,6 +169,8 @@
154
169
 
155
170
  .group-name {
156
171
  display: flex;
172
+ flex-wrap: nowrap;
173
+ align-items: center;
157
174
  height: 40px;
158
175
  margin: 0 18px;
159
176
  overflow: hidden;
@@ -162,8 +179,6 @@
162
179
  color: @menu-group-color;
163
180
  text-overflow: clip;
164
181
  white-space: nowrap;
165
- flex-wrap: nowrap;
166
- align-items: center;
167
182
  }
168
183
 
169
184
  .group-wrap {
@@ -598,9 +598,9 @@
598
598
  }
599
599
  .bk-menu {
600
600
  display: flex;
601
+ flex-direction: column;
601
602
  width: var(--menu-width);
602
603
  background-color: var(--menu-bg-color);
603
- flex-direction: column;
604
604
  transition: width 0.3s ease-out;
605
605
  }
606
606
  .bk-menu.is-collapse {
@@ -609,10 +609,10 @@
609
609
  .bk-menu-submenu {
610
610
  display: flex;
611
611
  flex-direction: column;
612
+ align-items: center;
612
613
  overflow: hidden;
613
614
  text-overflow: clip;
614
615
  white-space: nowrap;
615
- align-items: center;
616
616
  transition: width 0.3s ease-out;
617
617
  }
618
618
  .bk-menu-submenu.is-opened {
@@ -624,9 +624,9 @@
624
624
  }
625
625
  .bk-menu-submenu .submenu-header {
626
626
  display: flex;
627
+ align-items: center;
627
628
  width: 100%;
628
629
  height: 40px;
629
- align-items: center;
630
630
  }
631
631
  .bk-menu-submenu .submenu-header.is-collapse {
632
632
  color: var(--menu-active-color);
@@ -634,11 +634,11 @@
634
634
  }
635
635
  .bk-menu-submenu .submenu-header-icon {
636
636
  display: flex;
637
- height: 100%;
638
- font-size: 18px;
639
637
  flex: 0 0 var(--menu-collapse-width);
640
638
  align-items: center;
641
639
  justify-content: center;
640
+ height: 100%;
641
+ font-size: 18px;
642
642
  }
643
643
  .bk-menu-submenu .submenu-header-icon .menu-icon {
644
644
  display: flex;
@@ -651,9 +651,9 @@
651
651
  }
652
652
  .bk-menu-submenu .submenu-header-content {
653
653
  display: flex;
654
- height: 100%;
655
- align-items: center;
656
654
  flex: 1;
655
+ align-items: center;
656
+ height: 100%;
657
657
  color: #acb9d1;
658
658
  }
659
659
  .bk-menu-submenu .submenu-header-collapse {
@@ -665,24 +665,25 @@
665
665
  justify-content: center;
666
666
  margin-right: 16px;
667
667
  color: #acb9d1;
668
- transform: rotate(-90deg);
669
668
  transition: transform 0.3s ease-out;
669
+ transform: rotate(-90deg);
670
670
  }
671
671
  .bk-menu-submenu .submenu-header-collapse.is-collapse {
672
672
  transform: rotate(0deg);
673
673
  }
674
674
  .bk-menu-submenu .submenu-list {
675
675
  display: flex;
676
+ flex: 1;
677
+ flex-direction: column;
676
678
  width: 100%;
677
679
  padding: 0;
678
680
  margin: 0;
679
- flex-direction: column;
680
- flex: 1;
681
681
  /* stylelint-disable-next-line declaration-no-important */
682
682
  transition-property: all !important;
683
683
  }
684
684
  .bk-menu-item {
685
685
  display: flex;
686
+ align-items: center;
686
687
  width: 100%;
687
688
  height: 40px;
688
689
  min-height: 40px;
@@ -692,7 +693,6 @@
692
693
  color: var(--menu-color);
693
694
  text-overflow: clip;
694
695
  white-space: nowrap;
695
- align-items: center;
696
696
  transition: width 0.3s ease-in-out;
697
697
  }
698
698
  .bk-menu-item:hover {
@@ -703,13 +703,25 @@
703
703
  color: var(--menu-active-color);
704
704
  background: var(--menu-active-bg-color);
705
705
  }
706
+ .bk-menu-item.is-disabled {
707
+ color: var(--menu-group-color);
708
+ cursor: not-allowed;
709
+ }
710
+ .bk-menu-item.is-disabled:hover {
711
+ color: var(--menu-group-color);
712
+ cursor: not-allowed;
713
+ background: none;
714
+ }
715
+ .bk-menu-item.is-disabled .default-icon {
716
+ opacity: 0.4;
717
+ }
706
718
  .bk-menu-item .item-icon {
707
719
  display: flex;
708
- height: 100%;
709
- font-size: 18px;
710
720
  flex: 0 0 var(--menu-collapse-width);
711
721
  align-items: center;
712
722
  justify-content: center;
723
+ height: 100%;
724
+ font-size: 18px;
713
725
  }
714
726
  .bk-menu-item .item-icon .default-icon {
715
727
  display: inline-block;
@@ -721,9 +733,9 @@
721
733
  }
722
734
  .bk-menu-item .item-content {
723
735
  display: flex;
724
- height: 100%;
725
- align-items: center;
726
736
  flex: 1;
737
+ align-items: center;
738
+ height: 100%;
727
739
  }
728
740
  .bk-menu-group {
729
741
  display: flex;
@@ -731,6 +743,8 @@
731
743
  }
732
744
  .bk-menu-group .group-name {
733
745
  display: flex;
746
+ flex-wrap: nowrap;
747
+ align-items: center;
734
748
  height: 40px;
735
749
  margin: 0 18px;
736
750
  overflow: hidden;
@@ -739,8 +753,6 @@
739
753
  color: var(--menu-group-color);
740
754
  text-overflow: clip;
741
755
  white-space: nowrap;
742
- flex-wrap: nowrap;
743
- align-items: center;
744
756
  }
745
757
  .bk-menu-group .group-wrap {
746
758
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkui-vue",
3
- "version": "2.0.1-beta.94",
3
+ "version": "2.0.1-beta.95",
4
4
  "workspaces": [
5
5
  "packages/**",
6
6
  "scripts/cli",