@webitel/ui-sdk 3.2.112 → 3.2.114

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "3.2.112",
3
+ "version": "3.2.114",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve-lib": "vue-cli-service serve",
@@ -21,6 +21,9 @@
21
21
  >
22
22
  <!-- <a> click.prevent prevents redirect to # -->
23
23
  <a
24
+ :class="[
25
+ { 'wt-context-menu__option--disabled': option.disabled },
26
+ ]"
24
27
  class="wt-context-menu__option"
25
28
  href="#"
26
29
  @click.prevent="handleOptionClick({ option, index, hide })"
@@ -40,7 +43,7 @@ const props = defineProps({
40
43
  options: {
41
44
  type: Array,
42
45
  required: true,
43
- description: '[{ text }]',
46
+ description: '[{ text, disabled, ... anything you need }]',
44
47
  },
45
48
  visible: {
46
49
  type: Boolean,
@@ -100,16 +103,21 @@ function handleOptionClick({ option, index, hide }) {
100
103
  &:only-of-type {
101
104
  border-radius: var(--border-radius);
102
105
  }
103
-
104
- &:hover {
105
- background-color: var(--context-menu-option-color--hover);
106
- transition: var(--transition);
107
- }
108
106
  }
109
107
 
110
108
  .wt-context-menu__option {
111
109
  display: block;
112
110
  padding: var(--context-menu-option-padding);
113
111
  cursor: pointer;
112
+
113
+ &:hover {
114
+ background-color: var(--context-menu-option-color--hover);
115
+ transition: var(--transition);
116
+ }
117
+
118
+ &--disabled {
119
+ pointer-events: none;
120
+ color: var(--context-menu-option-color--disabled);
121
+ }
114
122
  }
115
123
  </style>
@@ -56,6 +56,8 @@ import WtTableColumnSelect from './organisms/wt-table-column-select/wt-table-col
56
56
  import WtIconAction from './atoms/wt-icon-action/wt-icon-action.vue';
57
57
  import WtPageHeader from './organisms/wt-page-header/wt-page-header.vue';
58
58
  import WtStepper from './organisms/wt-stepper/wt-stepper.vue';
59
+ import WtExpansionPanel
60
+ from './organisms/wt-expansion-panel/wt-expansion-panel.vue';
59
61
 
60
62
  const Components = {
61
63
  WtAvatar,
@@ -113,6 +115,7 @@ const Components = {
113
115
  WtItemLink,
114
116
  WtDummy,
115
117
  WtStepper,
118
+ WtExpansionPanel,
116
119
  };
117
120
 
118
121
  export default Components;
@@ -0,0 +1,9 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import WtExpansionPanel from '../wt-expansion-panel.vue';
3
+
4
+ describe('WtExpansionPanel', () => {
5
+ it('renders a component', () => {
6
+ const wrapper = shallowMount(WtExpansionPanel);
7
+ expect(wrapper.isVisible()).toBe(true);
8
+ });
9
+ });
@@ -0,0 +1,67 @@
1
+ <template>
2
+ <div
3
+ :class="[{'wt-expansion-panel--opened':open},
4
+ `wt-expansion-panel--${props.size}`]"
5
+ class="wt-expansion-panel"
6
+ >
7
+ <div
8
+ class="wt-expansion-panel-header"
9
+ tabindex="0"
10
+ @click="open = !open"
11
+ @keypress.enter="open = !open"
12
+ >
13
+ <slot name="title"></slot>
14
+ <wt-icon
15
+ icon="arrow-right"
16
+ ></wt-icon>
17
+ </div>
18
+ <wt-expand-transition>
19
+ <div v-show="open">
20
+ <slot></slot>
21
+ </div>
22
+ </wt-expand-transition>
23
+ </div>
24
+ </template>
25
+
26
+ <script setup>
27
+ import { ref } from 'vue';
28
+
29
+ const props = defineProps({
30
+ size: {
31
+ type: String,
32
+ default: 'md',
33
+ },
34
+ });
35
+
36
+ const open = ref(true);
37
+ </script>
38
+
39
+ <style lang="scss" scoped>
40
+ .wt-expansion-panel {
41
+ .wt-expansion-panel-header {
42
+ @extend %typo-subtitle-1;
43
+ display: flex;
44
+ align-items: center;
45
+ padding: var(--spacing-2xs) var(--spacing-xs);
46
+ cursor: pointer;
47
+ border-radius: var(--spacing-2xs);
48
+ background-color: var(--secondary-color-50);
49
+ }
50
+
51
+ .wt-icon {
52
+ margin-left: auto;
53
+ }
54
+
55
+ &--sm {
56
+ .wt-expansion-panel-header {
57
+ @extend %typo-subtitle-2;
58
+ }
59
+ }
60
+
61
+ &--opened {
62
+ .wt-icon {
63
+ transform: rotate(90deg);
64
+ }
65
+ }
66
+ }
67
+ </style>
@@ -4,4 +4,6 @@
4
4
  --context-menu-background-color: var(--main-color);
5
5
 
6
6
  --context-menu-option-padding: var(--spacing-xs);
7
+
8
+ --context-menu-option-color--disabled: var(--text--disabled-color);
7
9
  }
@@ -1,7 +1,7 @@
1
1
 
2
2
  :root {
3
- --input-info-min-height: 12px;
3
+ --input-info-min-height: var(--spacing-sm);
4
4
  --input-info-margin: 5px;
5
5
  --input-info-color: var(--form-label-color);
6
6
  --input-info--invalid-color: var(--false-color);
7
- }
7
+ }