@webitel/ui-sdk 3.2.111 → 3.2.113

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.111",
3
+ "version": "3.2.113",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve-lib": "vue-cli-service serve",
@@ -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;
@@ -6,8 +6,10 @@
6
6
  :icon="icon"
7
7
  :icon-prefix="iconPrefix"
8
8
  :size="size"
9
+ @click="$emit('click', $event)"
9
10
  @click.native="$emit('click', $event)"
10
11
  ></wt-icon>
12
+ <!-- @click for vue3, @click.native for v2-compatible -->
11
13
  </button>
12
14
  </div>
13
15
  </template>
@@ -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>
@@ -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
+ }