gi-component 0.0.43 → 0.0.44

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,7 +1,7 @@
1
1
  {
2
2
  "name": "gi-component",
3
3
  "type": "module",
4
- "version": "0.0.43",
4
+ "version": "0.0.44",
5
5
  "description": "Vue3中基于Element Plus二次封装基础组件库",
6
6
  "author": "lin",
7
7
  "license": "MIT",
@@ -32,7 +32,7 @@
32
32
  import type { VNode } from 'vue'
33
33
  import type { DrawerProps } from './type'
34
34
  import { ElButton, ElDrawer, ElSpace } from 'element-plus'
35
- import { computed, defineProps, defineSlots, ref } from 'vue'
35
+ import { computed, ref } from 'vue'
36
36
  import { useBemClass } from '../../../hooks'
37
37
 
38
38
  const visible = defineModel('modelValue', {
@@ -20,21 +20,15 @@ const props = withDefaults(defineProps<FlexProps>(), {
20
20
 
21
21
  const { b } = useBemClass()
22
22
 
23
- const classNames = computed(() => [b('flex')])
23
+ const classNames = computed(() => [b('flex'), b(`flex__size--${props.gap}`)])
24
24
 
25
- const gapMap: Record<string, string> = {
26
- small: '8px',
27
- middle: '12px',
28
- large: '16px'
29
- }
25
+ const SIZE_MAP = ['small', 'middle', 'large']
30
26
 
31
27
  const resolvedGap = computed(() => {
32
- if (props.gap === undefined || props.gap === null || props.gap === '')
28
+ if (props.gap === undefined || props.gap === null || props.gap === '' || SIZE_MAP.includes(props.gap as string))
33
29
  return undefined
34
30
  if (typeof props.gap === 'number')
35
31
  return `${props.gap}px`
36
- if (gapMap[props.gap])
37
- return gapMap[props.gap]
38
32
  return String(props.gap)
39
33
  })
40
34
 
@@ -66,7 +60,23 @@ const style = computed<CSSProperties>(() => {
66
60
  </script>
67
61
 
68
62
  <style scoped lang="scss">
63
+ @use '../../../styles/var.scss' as a;
64
+
69
65
  :deep(.el-button+.el-button) {
70
66
  margin-left: 0;
71
67
  }
68
+
69
+ .#{a.$prefix}-flex {
70
+ &__size--small {
71
+ gap: 8px;
72
+ }
73
+
74
+ &__size--middle {
75
+ gap: 12px;
76
+ }
77
+
78
+ &__size--large {
79
+ gap: 16px;
80
+ }
81
+ }
72
82
  </style>
@@ -79,4 +79,12 @@
79
79
  padding-bottom: 12px;
80
80
  border-top: 1px solid var(--el-border-color);
81
81
  }
82
+ }
83
+
84
+ .#{a.$prefix}-table .el-table {
85
+ --el-table-header-bg-color: var(--el-fill-color-lighter);
86
+ }
87
+
88
+ .#{a.$prefix}-table .el-table thead.is-group th.el-table__cell {
89
+ background: var(--el-fill-color-lighter);
82
90
  }
@@ -7,16 +7,8 @@ body {
7
7
  --margin: 14px;
8
8
  }
9
9
 
10
- .gi-table .el-table {
11
- --el-table-header-bg-color: var(--el-fill-color-lighter);
12
- }
13
-
14
- .gi-table .el-table thead.is-group th.el-table__cell {
15
- background: var(--el-fill-color-lighter);
16
- }
17
-
18
- .gi-card-title {
19
- .gi-card-header__title {
10
+ .g-card-title {
11
+ .#{a.$prefix}-card-header__title {
20
12
  padding-left: 8px;
21
13
  position: relative;
22
14
 
@@ -34,44 +26,44 @@ body {
34
26
  }
35
27
  }
36
28
 
37
- .gi-w-full {
29
+ .g-w-full {
38
30
  width: 100%;
39
31
  }
40
32
 
41
- .gi-h-full {
33
+ .g-h-full {
42
34
  height: 100%;
43
35
  }
44
36
 
45
- .gi-line-1 {
37
+ .g-line-1 {
46
38
  overflow: hidden;
47
39
  white-space: nowrap;
48
40
  text-overflow: ellipsis;
49
41
  }
50
42
 
51
- .gi-line-2 {
43
+ .g-line-2 {
52
44
  line-clamp: 2;
53
45
  -webkit-line-clamp: 2;
54
46
  }
55
47
 
56
- .gi-line-3 {
48
+ .g-line-3 {
57
49
  line-clamp: 3;
58
50
  -webkit-line-clamp: 3;
59
51
  }
60
52
 
61
- .gi-line-4 {
53
+ .g-line-4 {
62
54
  line-clamp: 4;
63
55
  -webkit-line-clamp: 4;
64
56
  }
65
57
 
66
- .gi-line-5 {
58
+ .g-line-5 {
67
59
  line-clamp: 5;
68
60
  -webkit-line-clamp: 5;
69
61
  }
70
62
 
71
- .gi-line-2,
72
- .gi-line-3,
73
- .gi-line-4,
74
- .gi-line-5 {
63
+ .g-line-2,
64
+ .g-line-3,
65
+ .g-line-4,
66
+ .g-line-5 {
75
67
  overflow: hidden;
76
68
  word-break: break-all;
77
69
  text-overflow: ellipsis;
@@ -79,70 +71,71 @@ body {
79
71
  -webkit-box-orient: vertical; // 设置伸缩盒子元素排列方式
80
72
  }
81
73
 
82
- .gi-mt {
74
+ .g-mt {
83
75
  margin-top: var(--margin);
84
76
  }
85
77
 
86
- .gi-mb {
78
+ .g-mb {
87
79
  margin-bottom: var(--margin);
88
80
  }
89
81
 
90
- .gi-ml {
82
+ .g-ml {
91
83
  margin-left: var(--margin);
92
84
  }
93
85
 
94
- .gi-mr {
86
+ .g-mr {
95
87
  margin-right: var(--margin);
96
88
  }
97
89
 
98
- .gi-mx {
90
+ .g-mx {
99
91
  margin-left: var(--margin);
100
92
  margin-right: var(--margin);
101
93
  }
102
94
 
103
- .gi-my {
95
+ .g-my {
104
96
  margin-top: var(--margin);
105
97
  margin-bottom: var(--margin);
106
98
  }
107
99
 
108
- .gi-m0 {
100
+ .g-m0 {
109
101
  margin: 0 !important;
110
102
  }
111
103
 
112
- .gi-pt {
104
+ .g-pt {
113
105
  padding-top: var(--padding);
114
106
  }
115
107
 
116
- .gi-pb {
108
+ .g-pb {
117
109
  padding-bottom: var(--padding);
118
110
  }
119
111
 
120
- .gi-pl {
112
+ .g-pl {
121
113
  padding-left: var(--padding);
122
114
  }
123
115
 
124
- .gi-pr {
116
+ .g-pr {
125
117
  padding-right: var(--padding);
126
118
  }
127
119
 
128
- .gi-px {
120
+ .g-px {
129
121
  padding-left: var(--padding);
130
122
  padding-right: var(--padding);
131
123
  }
132
124
 
133
- .gi-py {
125
+ .g-py {
134
126
  padding-top: var(--padding);
135
127
  padding-bottom: var(--padding);
136
128
  }
137
129
 
138
- .gi-p0 {
130
+ .g-p0 {
139
131
  padding: 0 !important;
140
132
  }
141
133
 
142
- .gi-flex-column {
134
+ // 主要作用在el-row组件
135
+ .g-flex-column {
143
136
  flex-direction: column;
144
137
  }
145
138
 
146
- .gi-tool {
139
+ .g-tool {
147
140
  gap: 8px;
148
141
  }
@@ -40,7 +40,7 @@ export const createSelectDialog = <T, Q extends DefaultOption = DefaultOption>(
40
40
  const { component, componentProps: componentPropsFromParams, tip, ...restParams } = params
41
41
 
42
42
  Dialog.open({
43
- bodyClass: 'gi-p0',
43
+ bodyClass: 'g-p0',
44
44
  ...restParams,
45
45
  title: params.title || options.title,
46
46
  content: () =>