gi-component 0.0.19 → 0.0.21

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/README.md CHANGED
@@ -35,8 +35,6 @@ pnpm install gi-component
35
35
  pnpm whoami
36
36
 
37
37
  npm login
38
- #或
39
- npm login --registry=https://nexusx.cyberwing.cn/repository/judp-npm-test/
40
38
 
41
39
  npm version patch
42
40
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gi-component",
3
3
  "type": "module",
4
- "version": "0.0.19",
4
+ "version": "0.0.21",
5
5
  "description": "Vue3中基于Element Plus二次封装基础组件库",
6
6
  "author": "lin",
7
7
  "license": "MIT",
@@ -17,11 +17,9 @@ import {
17
17
  Upload
18
18
  } from '@element-plus/icons-vue'
19
19
  import { ElButton } from 'element-plus'
20
- import { computed, defineOptions, useAttrs } from 'vue'
20
+ import { computed, useAttrs } from 'vue'
21
21
  import { useBemClass } from '../../../hooks'
22
22
 
23
- defineOptions({ components: { ElButton } })
24
-
25
23
  const props = withDefaults(defineProps<ButtonProps>(), {
26
24
  type: ''
27
25
  })
@@ -0,0 +1,5 @@
1
+ import Dot from './src/dot.vue'
2
+
3
+ export type DotInstance = InstanceType<typeof Dot>
4
+ export * from './src/type'
5
+ export default Dot
@@ -0,0 +1,107 @@
1
+ <template>
2
+ <span :class="getClass" :style="getStyle"></span>
3
+ </template>
4
+
5
+ <script setup lang="ts">
6
+ import type { CSSProperties } from 'vue'
7
+ import type { DotProps } from './type.ts'
8
+ import { computed } from 'vue'
9
+ import { useBemClass } from '../../../hooks'
10
+
11
+ const props = withDefaults(defineProps<DotProps>(), {
12
+ type: 'circle',
13
+ size: 7,
14
+ color: 'primary'
15
+ })
16
+
17
+ const { b } = useBemClass()
18
+
19
+ const getClass = computed(() => {
20
+ const arr = [b('dot'), b(`dot--${props.type}`)]
21
+ if (['primary', 'success', 'danger', 'warning', 'info'].includes(props.color)) {
22
+ arr.push(b(`dot--${props.color}`))
23
+ }
24
+ if (props.animation) {
25
+ arr.push(b('dot--animation'))
26
+ }
27
+ return arr.join(' ')
28
+ })
29
+
30
+ const getStyle = computed(() => {
31
+ const obj: CSSProperties = {}
32
+ if (props.color && !['primary', 'success', 'danger', 'warning', 'info'].includes(props.color)) {
33
+ obj.backgroundColor = props.color
34
+ }
35
+ if (props.size) {
36
+ obj.width = `${props.size}px`
37
+ obj.height = `${props.size}px`
38
+ }
39
+ return obj
40
+ })
41
+ </script>
42
+
43
+ <style scoped lang="scss">
44
+ @use '../../../styles/var.scss' as a;
45
+
46
+ .#{a.$prefix}-dot {
47
+ display: inline-flex;
48
+ border-radius: 100px;
49
+ background-color: var(--el-color-info);
50
+ }
51
+
52
+ .#{a.$prefix}-dot--square {
53
+ border-radius: 0;
54
+ }
55
+
56
+ .#{a.$prefix}-dot--primary {
57
+ background-color: var(--el-color-primary);
58
+ }
59
+
60
+ .#{a.$prefix}-dot--success {
61
+ background-color: var(--el-color-success);
62
+ }
63
+
64
+ .#{a.$prefix}-dot--danger {
65
+ background-color: var(--el-color-danger);
66
+ }
67
+
68
+ .#{a.$prefix}-dot--warning {
69
+ background-color: var(--el-color-warning);
70
+ }
71
+
72
+ .#{a.$prefix}-dot--info {
73
+ background-color: var(--el-color-info);
74
+ }
75
+
76
+ .#{a.$prefix}-dot--animation {
77
+ position: relative;
78
+
79
+ &::after {
80
+ position: absolute;
81
+ top: 0;
82
+ left: 0;
83
+ width: 100%;
84
+ height: 100%;
85
+ content: '';
86
+ background: inherit;
87
+ border-radius: 50%;
88
+ animation: dot-animation 1.2s ease-in-out infinite;
89
+ }
90
+ }
91
+
92
+ @keyframes dot-animation {
93
+ 0% {
94
+ opacity: 1;
95
+ transform: scale(0.5);
96
+ }
97
+
98
+ 30% {
99
+ opacity: 0.7;
100
+ }
101
+
102
+ 100% {
103
+ opacity: 0;
104
+ transform: scale(2.5);
105
+ }
106
+ }
107
+ </style>
@@ -0,0 +1,6 @@
1
+ export interface DotProps {
2
+ type?: 'circle' | 'square'
3
+ size?: number
4
+ color?: string | 'primary' | 'success' | 'warning' | 'danger' | 'info'
5
+ animation?: boolean
6
+ }
@@ -57,7 +57,7 @@ export interface FormColumnItem<F = any> {
57
57
  labelRender?: () => VNode
58
58
  field: string
59
59
  fieldName?: string
60
- span?: number
60
+ span?: number | GridItemProps['span']
61
61
  props?: FormColumnProps
62
62
  formItemProps?: El.FormItemProps
63
63
  gridItemProps?: any
@@ -12,6 +12,7 @@ declare module 'vue' {
12
12
  GiCard: typeof import('./components/card/src/card.vue')['default']
13
13
  GiDialog: typeof import('./components/dialog/src/dialog.vue')['default']
14
14
  GiDrawer: typeof import('./components/drawer/src/drawer.vue')['default']
15
+ GiDot: typeof import('./components/dot/src/dot.vue')['default']
15
16
  GiEditTable: typeof import('./components/edit-table/src/edit-table.vue')['default']
16
17
  GiForm: typeof import('./components/form/src/form.vue')['default']
17
18
  GiGrid: typeof import('./components/grid/src/grid.vue')['default']
package/packages/index.ts CHANGED
@@ -3,6 +3,7 @@ import type { App } from 'vue'
3
3
  import Button from './components/button'
4
4
  import Card from './components/card'
5
5
  import Dialog from './components/dialog'
6
+ import Dot from './components/dot'
6
7
  import Drawer from './components/drawer'
7
8
  import EditTable from './components/edit-table'
8
9
  import Form from './components/form'
@@ -29,6 +30,7 @@ const components = {
29
30
  Button,
30
31
  Card,
31
32
  Drawer,
33
+ Dot,
32
34
  Tabs,
33
35
  InputGroup,
34
36
  InputSearch,
@@ -46,6 +48,7 @@ const components = {
46
48
  export const GiButton: typeof Button = Button
47
49
  export const GiCard: typeof Card = Card
48
50
  export const GiDrawer: typeof Drawer = Drawer
51
+ export const GiDot: typeof Dot = Dot
49
52
  export const GiTabs: typeof Tabs = Tabs
50
53
  export const GiInputGroup: typeof InputGroup = InputGroup
51
54
  export const GiInputSearch: typeof InputSearch = InputSearch
@@ -9,21 +9,6 @@ body {
9
9
  --padding-y-small: 8px;
10
10
  }
11
11
 
12
- .el-table__body-wrapper tr td.el-table-fixed-column--left,
13
- .el-table__body-wrapper tr td.el-table-fixed-column--right,
14
- .el-table__body-wrapper tr th.el-table-fixed-column--left,
15
- .el-table__body-wrapper tr th.el-table-fixed-column--right,
16
- .el-table__footer-wrapper tr td.el-table-fixed-column--left,
17
- .el-table__footer-wrapper tr td.el-table-fixed-column--right,
18
- .el-table__footer-wrapper tr th.el-table-fixed-column--left,
19
- .el-table__footer-wrapper tr th.el-table-fixed-column--right,
20
- .el-table__header-wrapper tr td.el-table-fixed-column--left,
21
- .el-table__header-wrapper tr td.el-table-fixed-column--right,
22
- .el-table__header-wrapper tr th.el-table-fixed-column--left,
23
- .el-table__header-wrapper tr th.el-table-fixed-column--right {
24
- background: var(--el-bg-color);
25
- }
26
-
27
12
  .gi-table .el-table {
28
13
  --el-table-header-bg-color: var(--el-fill-color-lighter);
29
14
  }
@@ -177,6 +162,12 @@ body {
177
162
  display: flex;
178
163
  align-items: center;
179
164
  border-bottom: 1px solid var(--el-border-color);
165
+
166
+ .el-dialog__headerbtn {
167
+ display: flex;
168
+ justify-content: center;
169
+ align-items: center;
170
+ }
180
171
  }
181
172
 
182
173
  .el-dialog__body {