@bagelink/vue 1.4.85 → 1.4.89

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.
@@ -1,144 +1,140 @@
1
1
  .bgl_btn,
2
2
  .bgl_flatBtn,
3
3
  .bgl_btn-icon {
4
- font-family: inherit;
5
- white-space: nowrap;
6
- cursor: pointer;
7
- box-sizing: border-box;
8
- user-select: none;
9
- border: none;
10
- transition: var(--bgl-transition);
11
- border-radius: var(--btn-border-radius);
12
- line-height: var(--btn-height);
13
- font-size: var(--input-font-size);
14
- display: inline-block;
15
- height: var(--btn-height);
16
- padding: 0;
4
+ font-family: inherit;
5
+ white-space: nowrap;
6
+ cursor: pointer;
7
+ box-sizing: border-box;
8
+ user-select: none;
9
+ border: none;
10
+ transition: var(--bgl-transition);
11
+ border-radius: var(--btn-border-radius);
12
+ line-height: var(--btn-height);
13
+ font-size: var(--input-font-size);
14
+ display: inline-block;
15
+ height: var(--btn-height);
16
+ padding: 0;
17
17
  }
18
18
 
19
19
  .btn-close {
20
- margin-top: -20px;
21
- margin-inline-end: -20px;
22
- margin-inline-start: auto;
23
- margin-bottom: 15px;
24
- transition: var(--bgl-transition);
25
- height: 30px;
26
- width: 30px;
27
- opacity: 0.6;
28
- cursor: pointer;
29
- border-radius: 100%;
30
- outline: 2px solid transparent;
31
- display: flex;
32
- align-items: center;
33
- justify-content: center;
20
+ margin-top: -20px;
21
+ margin-inline-end: -20px;
22
+ margin-inline-start: auto;
23
+ margin-bottom: 15px;
24
+ transition: var(--bgl-transition);
25
+ height: 30px;
26
+ width: 30px;
27
+ opacity: 0.6;
28
+ cursor: pointer;
29
+ border-radius: 100%;
30
+ outline: 2px solid transparent;
31
+ display: flex;
32
+ align-items: center;
33
+ justify-content: center;
34
34
  }
35
35
 
36
36
  .btn-close:hover {
37
- background: var(--bgl-gray-light);
38
- opacity: 1;
37
+ background: var(--bgl-gray-light);
38
+ opacity: 1;
39
39
  }
40
40
 
41
41
  .btn-close:active {
42
- background: var(--bgl-gray);
42
+ background: var(--bgl-gray);
43
43
  }
44
44
 
45
45
  .btn-close::before {
46
- content: 'close';
47
- font-family: 'Material Symbols Outlined', serif;
46
+ content: 'close';
47
+ font-family: 'Material Symbols Outlined', serif;
48
48
  }
49
49
 
50
- .bgl_btn.thin {
51
- height: calc(var(--btn-height) * 0.7);
52
- line-height: calc(var(--btn-height) * 0.7);
53
- }
54
50
 
55
51
  .hover {
56
- cursor: pointer;
57
- transition: all 400ms ease;
52
+ cursor: pointer;
53
+ transition: all 400ms ease;
58
54
  }
59
55
 
60
56
  .hover:hover {
61
- filter: brightness(90%);
57
+ filter: brightness(90%);
62
58
  }
63
59
 
64
60
  .hover:active {
65
- filter: brightness(80%);
61
+ filter: brightness(80%);
66
62
  }
67
63
 
68
64
  .border {
69
- border: 1px solid var(--border-color);
65
+ border: 1px solid var(--border-color);
70
66
  }
71
67
 
72
68
  .border-primary {
73
- border: 1px solid var(--bgl-primary);
69
+ border: 1px solid var(--bgl-primary);
74
70
  }
75
71
 
76
72
  .outline {
77
- outline: 1px solid var(--border-color);
73
+ outline: 1px solid var(--border-color);
78
74
  }
79
75
 
80
76
  .outline-dashed {
81
- outline: 2px dashed var(--border-color);
77
+ outline: 2px dashed var(--border-color);
82
78
  }
83
79
 
84
80
  .outline-primary {
85
- outline: 1px solid var(--bgl-primary);
81
+ outline: 1px solid var(--bgl-primary);
86
82
  }
87
83
 
88
84
  .rotate-270 {
89
- transform: rotate(270deg);
85
+ transform: rotate(270deg);
90
86
  }
91
87
 
92
88
  .rotate-180 {
93
- transform: rotate(180deg);
89
+ transform: rotate(180deg);
94
90
  }
95
91
 
96
92
  .rotate-90 {
97
- transform: rotate(90deg);
93
+ transform: rotate(90deg);
98
94
  }
99
95
 
100
96
  .rotate-0 {
101
- transform: rotate(0deg) !important;
97
+ transform: rotate(0deg) !important;
102
98
  }
103
99
 
104
100
  @media screen and (max-width: 910px) {
105
- .bgl_btn {
106
- padding: 0 20px;
107
- }
101
+ .bgl_btn {
102
+ padding: 0 20px;
103
+ }
108
104
 
109
- .m_border {
110
- border: 1px solid var(--border-color);
111
- }
105
+ .m_border {
106
+ border: 1px solid var(--border-color);
107
+ }
112
108
 
113
- .m_rotate-270 {
114
- transform: rotate(270deg);
115
- }
109
+ .m_rotate-270 {
110
+ transform: rotate(270deg);
111
+ }
116
112
 
117
- .m_rotate-180 {
118
- transform: rotate(180deg);
119
- }
113
+ .m_rotate-180 {
114
+ transform: rotate(180deg);
115
+ }
120
116
 
121
- .m_rotate-90 {
122
- transform: rotate(90deg);
123
- }
117
+ .m_rotate-90 {
118
+ transform: rotate(90deg);
119
+ }
124
120
 
125
- .m_rotate-0 {
126
- transform: rotate(0deg) !important;
127
- }
121
+ .m_rotate-0 {
122
+ transform: rotate(0deg) !important;
123
+ }
128
124
  }
129
125
 
130
126
  .ripple {
131
- position: absolute;
132
- border-radius: 50%;
133
- transform: scale(0);
134
- background: rgba(0, 0, 0, 0.3);
135
- pointer-events: none;
136
- animation: rippleEffect 0.6s ease-out;
127
+ position: absolute;
128
+ border-radius: 50%;
129
+ transform: scale(0);
130
+ background: rgba(0, 0, 0, 0.3);
131
+ pointer-events: none;
132
+ animation: rippleEffect 0.6s ease-out;
137
133
  }
138
134
 
139
135
  @keyframes rippleEffect {
140
- to {
141
- transform: scale(4);
142
- opacity: 0;
143
- }
144
- }
136
+ to {
137
+ transform: scale(4);
138
+ opacity: 0;
139
+ }
140
+ }
File without changes
@@ -73,11 +73,25 @@ export type VNodeFn<T, P extends Path<T>> = (props: {
73
73
  field: BaseBagelField<T, P>
74
74
  }) => VNode
75
75
 
76
+ export interface ElementField<
77
+ T,
78
+ PO extends PathsOptions = DefaultPathsOptions,
79
+ > {
80
+ $el: string
81
+ id?: Path<T, PO> | string
82
+ class?: any
83
+ vIf?: any
84
+ style?: Record<string, any>
85
+ attrs?: Record<string, any>
86
+ onClick?: () => void
87
+ children?: ElementField<T, PO>[]
88
+ }
89
+
76
90
  export type SchemaChild<
77
91
  T,
78
92
  P extends Path<T, PO>,
79
93
  PO extends PathsOptions = DefaultPathsOptions,
80
- > = Field<T, PO> | VNode | VNodeFn<T, P> | string
94
+ > = Field<T, PO> | ElementField<T, PO> | VNode | VNodeFn<T, P> | string
81
95
 
82
96
  export interface BaseBagelField<
83
97
  T,
@@ -94,8 +108,8 @@ export interface BaseBagelField<
94
108
  'disabled'?: boolean
95
109
  'helptext'?: string
96
110
  'options'?: BagelFieldOptions<T, P>
97
- 'children'?: SchemaChild<T, P, PO>[]
98
- 'slots'?: { [key: string]: SchemaChild<T, P, PO>[] }
111
+ 'children'?: SchemaChild<T, Path<T, PO>, PO>[]
112
+ 'slots'?: { [key: string]: SchemaChild<T, Path<T, PO>, PO>[] }
99
113
  'defaultValue'?: any
100
114
  'vIf'?: VIfType<T, P>
101
115
  'v-if'?: VIfType<T, P>
@@ -133,15 +147,20 @@ export type BglFieldT<
133
147
  PO extends PathsOptions = DefaultPathsOptions,
134
148
  > = Field<T, PO>
135
149
 
150
+ export type SchemaField<
151
+ T,
152
+ PO extends PathsOptions = DefaultPathsOptions,
153
+ > = Field<T, PO> | ElementField<T, PO>
154
+
136
155
  export type BglFormSchemaT<
137
156
  T,
138
157
  PO extends PathsOptions = DefaultPathsOptions,
139
- > = Field<T, PO>[]
158
+ > = SchemaField<T, PO>[]
140
159
 
141
160
  export type ShallowBglFormSchemaT<
142
161
  T,
143
162
  PO extends PathsOptions = ShallowPathsOptions,
144
- > = Field<T, PO>[]
163
+ > = SchemaField<T, PO>[]
145
164
 
146
165
  export interface InputBagelField<
147
166
  T,
@@ -1,21 +1,9 @@
1
- import type { BaseBagelField, IconType, Option, Path } from '@bagelink/vue'
1
+ import type { IconType, Option, Path, ElementField } from '@bagelink/vue'
2
2
 
3
3
  export type DefaultPathsOptions = Record<string, any>
4
4
  export type PathsOptions = Record<string, any>
5
5
 
6
- export interface BaseElementField<
7
- T,
8
- PO extends PathsOptions = DefaultPathsOptions
9
- > extends Partial<BaseBagelField<T, any, PO>> {
10
- $el: string
11
- id?: any
12
- class?: string
13
- vIf?: boolean | (() => boolean)
14
- style?: Record<string, any>
15
- attrs?: Record<string, any>
16
- onClick?: () => void
17
- children?: BaseElementField<T, PO>[]
18
- }
6
+ export type BaseElementField<T, PO extends PathsOptions = DefaultPathsOptions> = ElementField<T, PO>
19
7
 
20
8
  export interface BtnElementOptions<
21
9
  T = any,
@@ -151,7 +139,7 @@ export function btn<
151
139
  // btn(options)
152
140
  finalOptions = idOrOptions
153
141
  const { id: optionId, text: optionText, icon: optionIcon } = finalOptions
154
- id = optionId
142
+ id = optionId as Path<T, PO> | undefined
155
143
  text = optionText ?? ''
156
144
  icon = optionIcon
157
145
  } else {
@@ -284,7 +272,7 @@ export function txt<
284
272
  // txt(options)
285
273
  finalOptions = idOrOptions
286
274
  const { id: optionId } = finalOptions
287
- id = optionId
275
+ id = optionId as Path<T, PO> | undefined
288
276
  } else {
289
277
  // txt(id, ...) patterns
290
278
  id = idOrOptions
@@ -360,7 +348,7 @@ export function img<
360
348
  // img(options)
361
349
  finalOptions = idOrOptions
362
350
  const { id: optionId, src: optionSrc } = finalOptions
363
- id = optionId
351
+ id = optionId as Path<T, PO> | undefined
364
352
  finalSrc = optionSrc ?? ''
365
353
  } else {
366
354
  // img(id, ...) patterns