@bagelink/vue 1.2.45 → 1.2.48
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/dist/components/AddressSearch.vue.d.ts.map +1 -1
- package/dist/components/Dropdown.vue.d.ts.map +1 -1
- package/dist/components/ListItem.vue.d.ts +3 -0
- package/dist/components/ListItem.vue.d.ts.map +1 -1
- package/dist/components/form/FieldArray.vue.d.ts +29 -21
- package/dist/components/form/FieldArray.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/ToggleInput.vue.d.ts +1 -1
- package/dist/components/form/inputs/ToggleInput.vue.d.ts.map +1 -1
- package/dist/index.cjs +80 -63
- package/dist/index.mjs +80 -63
- package/dist/style.css +32 -20
- package/package.json +2 -2
- package/src/components/ListItem.vue +24 -7
- package/src/components/Modal.vue +1 -1
- package/src/components/form/FieldArray.vue +31 -24
- package/src/components/form/inputs/ToggleInput.vue +1 -1
- package/src/styles/appearance.css +12 -0
- package/src/styles/modal.css +4 -4
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bagelink/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.48",
|
|
5
5
|
"description": "Bagel core sdk packages",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Neveh Allon",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
83
|
"date-fns": "^4.1.0",
|
|
84
|
-
"@vueuse/core": "^13.
|
|
84
|
+
"@vueuse/core": "^13.1.0",
|
|
85
85
|
"axios": "^1.8.4",
|
|
86
86
|
"floating-vue": "^5.2.2",
|
|
87
87
|
"libphonenumber-js": "1.12.6",
|
|
@@ -15,6 +15,8 @@ const props = defineProps<{
|
|
|
15
15
|
lead?: string
|
|
16
16
|
iconEnd?: IconType
|
|
17
17
|
target?: '_blank' | '_self'
|
|
18
|
+
thin?: boolean
|
|
19
|
+
fullWidth?: boolean
|
|
18
20
|
onClick?: () => void
|
|
19
21
|
}>()
|
|
20
22
|
|
|
@@ -25,6 +27,10 @@ const isComponent = $computed(() => {
|
|
|
25
27
|
return 'div'
|
|
26
28
|
})
|
|
27
29
|
|
|
30
|
+
const isClickable = $computed(() => {
|
|
31
|
+
return props.to || props.href || props.onClick
|
|
32
|
+
})
|
|
33
|
+
|
|
28
34
|
const bind = $computed(() => {
|
|
29
35
|
const obj: { [key: string]: any } = {}
|
|
30
36
|
if (props.to) obj.to = props.to
|
|
@@ -44,27 +50,36 @@ const bind = $computed(() => {
|
|
|
44
50
|
<component
|
|
45
51
|
:is="isComponent"
|
|
46
52
|
v-bind="bind"
|
|
53
|
+
v-ripple="isClickable"
|
|
47
54
|
class="flex gap-05 list-item"
|
|
55
|
+
:class="{ 'py-1': !props.thin,
|
|
56
|
+
'py-05': props.thin,
|
|
57
|
+
'px-1': !props.fullWidth,
|
|
58
|
+
'px-0': props.fullWidth,
|
|
59
|
+
}"
|
|
48
60
|
@click="onClick"
|
|
49
61
|
>
|
|
50
62
|
<Avatar v-if="src || showAvatar" style="flex-basis: 1;" :name="title" :src="src" :size="40" />
|
|
51
63
|
<Icon v-if="icon" size="1.2" class="color-primary" :icon="icon" />
|
|
52
64
|
|
|
53
|
-
<div>
|
|
54
|
-
<p v-if="lead" class="txt10
|
|
65
|
+
<div class="txt-start">
|
|
66
|
+
<p v-if="lead" class="txt10 m-0 p-0 txt-gray ellipsis">
|
|
55
67
|
{{ lead }}
|
|
56
68
|
<slot name="lead" />
|
|
57
69
|
</p>
|
|
58
|
-
<p class="
|
|
70
|
+
<p class="m-0 p-0 ellipsis-1 line-height-14 pb-025">
|
|
59
71
|
{{ title }}
|
|
60
72
|
<slot />
|
|
61
73
|
</p>
|
|
62
|
-
<p v-if="subtitle" class="txt12
|
|
74
|
+
<p v-if="subtitle" class="txt12 m-0 p-0 opacity-7 ellipsis-1">
|
|
63
75
|
{{ subtitle }}
|
|
64
76
|
<slot name="subtitle" />
|
|
65
77
|
</p>
|
|
66
78
|
</div>
|
|
67
|
-
<
|
|
79
|
+
<div class="flex-grow-1" />
|
|
80
|
+
<slot name="action">
|
|
81
|
+
<Icon v-if="iconEnd" :icon="iconEnd" class="transition-400" />
|
|
82
|
+
</slot>
|
|
68
83
|
</component>
|
|
69
84
|
</template>
|
|
70
85
|
|
|
@@ -83,7 +98,6 @@ button.list-item {
|
|
|
83
98
|
pointer-events: none;
|
|
84
99
|
}
|
|
85
100
|
.list-item {
|
|
86
|
-
padding: 0.6rem 1rem;
|
|
87
101
|
min-height: -webkit-fit-content;
|
|
88
102
|
min-height: -moz-fit-content;
|
|
89
103
|
min-height: fit-content;
|
|
@@ -94,6 +108,9 @@ button.list-item {
|
|
|
94
108
|
text-decoration: none;
|
|
95
109
|
position: relative;
|
|
96
110
|
}
|
|
111
|
+
.list-item > *{
|
|
112
|
+
margiin-bottom: 0;
|
|
113
|
+
}
|
|
97
114
|
|
|
98
115
|
.list-item::after {
|
|
99
116
|
content: '';
|
|
@@ -114,7 +131,7 @@ button.list-item {
|
|
|
114
131
|
|
|
115
132
|
.list-item:hover,
|
|
116
133
|
.list-item.router-link-active {
|
|
117
|
-
background-color: var(--bgl-primary-
|
|
134
|
+
background-color: var(--bgl-primary-tint);
|
|
118
135
|
}
|
|
119
136
|
.notClickable:hover{
|
|
120
137
|
background-color:unset;
|
package/src/components/Modal.vue
CHANGED
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
AttributeValue,
|
|
5
5
|
Attributes,
|
|
6
6
|
BagelFieldOptions,
|
|
7
|
+
BaseBagelField,
|
|
7
8
|
BglFormSchemaFnT,
|
|
8
9
|
Field,
|
|
9
10
|
Path
|
|
@@ -11,27 +12,33 @@ import type {
|
|
|
11
12
|
import { BagelForm, Btn, Loading, Icon } from '@bagelink/vue'
|
|
12
13
|
import { ref, onMounted, computed, watch } from 'vue'
|
|
13
14
|
|
|
15
|
+
export interface FieldArrayProps<T, P extends Path<T>> {
|
|
16
|
+
el?: any
|
|
17
|
+
id: string
|
|
18
|
+
label?: string
|
|
19
|
+
placeholder?: string
|
|
20
|
+
children?: Field<T>[]
|
|
21
|
+
class?: AttributeValue | AttributeFn<T, P>
|
|
22
|
+
attrs?: Attributes<T, P>
|
|
23
|
+
required?: boolean
|
|
24
|
+
disabled?: boolean
|
|
25
|
+
helptext?: string
|
|
26
|
+
options?: BagelFieldOptions<T>
|
|
27
|
+
defaultValue?: any
|
|
28
|
+
add?: boolean
|
|
29
|
+
delete?: boolean
|
|
30
|
+
transform?: (value: T) => T
|
|
31
|
+
schema?: BglFormSchemaFnT<T>
|
|
32
|
+
modelValue: T[]
|
|
33
|
+
type?: 'object' | 'number' | 'text'
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface PrimitiveArrFieldT extends BaseBagelField<{ value: string }, 'value'> {
|
|
37
|
+
type: FieldArrayProps<{ value: string }, 'value'>['type']
|
|
38
|
+
}
|
|
39
|
+
|
|
14
40
|
const props = withDefaults(
|
|
15
|
-
defineProps<
|
|
16
|
-
el?: any
|
|
17
|
-
id: string
|
|
18
|
-
label?: string
|
|
19
|
-
placeholder?: string
|
|
20
|
-
children?: Field<T>[]
|
|
21
|
-
class?: AttributeValue | AttributeFn<T, P>
|
|
22
|
-
attrs?: Attributes<T, P>
|
|
23
|
-
required?: boolean
|
|
24
|
-
disabled?: boolean
|
|
25
|
-
helptext?: string
|
|
26
|
-
options?: BagelFieldOptions<T>
|
|
27
|
-
defaultValue?: any
|
|
28
|
-
add?: boolean
|
|
29
|
-
delete?: boolean
|
|
30
|
-
transform?: (value: T) => T
|
|
31
|
-
schema?: BglFormSchemaFnT<T>
|
|
32
|
-
modelValue: T[]
|
|
33
|
-
type?: 'object' | 'number' | 'text'
|
|
34
|
-
}>(),
|
|
41
|
+
defineProps<FieldArrayProps<T, P>>(),
|
|
35
42
|
{
|
|
36
43
|
delete: true,
|
|
37
44
|
add: true,
|
|
@@ -54,18 +61,18 @@ watch(() => props.modelValue, (newValue) => {
|
|
|
54
61
|
}, { deep: true })
|
|
55
62
|
|
|
56
63
|
// Generate schema for primitive types
|
|
57
|
-
const primitiveSchema = computed(() => {
|
|
64
|
+
const primitiveSchema = computed<PrimitiveArrFieldT[]>(() => {
|
|
58
65
|
if (props.type === 'text') {
|
|
59
|
-
return [{ id: 'value', type: 'text', label: '' }]
|
|
66
|
+
return [{ id: 'value', type: 'text', label: '', $el: 'text' }]
|
|
60
67
|
} else if (props.type === 'number') {
|
|
61
|
-
return [{ id: 'value', type: 'number', label: '' }]
|
|
68
|
+
return [{ id: 'value', type: 'number', label: '', $el: 'number' }]
|
|
62
69
|
}
|
|
63
70
|
return []
|
|
64
71
|
})
|
|
65
72
|
|
|
66
73
|
// Resolve schema
|
|
67
74
|
async function resolveSchema() {
|
|
68
|
-
// For primitive types, use the predefined
|
|
75
|
+
// For primitive types, use the predefined schemaks
|
|
69
76
|
if (props.type !== 'object') {
|
|
70
77
|
resolvedSchemaData.value = primitiveSchema.value
|
|
71
78
|
schemaState.value = 'loaded'
|
|
@@ -173,6 +173,10 @@
|
|
|
173
173
|
background: var(--bgl-bg) !important;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
+
.bg-dark {
|
|
177
|
+
background: var(--bgl-dark-bg);
|
|
178
|
+
}
|
|
179
|
+
|
|
176
180
|
.color-bg {
|
|
177
181
|
color: var(--bgl-bg) !important;
|
|
178
182
|
}
|
|
@@ -1015,6 +1019,14 @@
|
|
|
1015
1019
|
background: var(--label-color) !important;
|
|
1016
1020
|
}
|
|
1017
1021
|
|
|
1022
|
+
.m_bg-bg {
|
|
1023
|
+
background: var(--bgl-bg) !important;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
.m_bg-dark {
|
|
1027
|
+
background: var(--bgl-dark-bg);
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1018
1030
|
.m_bg-gray-light {
|
|
1019
1031
|
background: var(--bgl-gray-light) !important;
|
|
1020
1032
|
}
|
package/src/styles/modal.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.bg-dark {
|
|
1
|
+
.bg-dark-modal {
|
|
2
2
|
position: fixed;
|
|
3
3
|
top: 0;
|
|
4
4
|
right: 0;
|
|
@@ -105,16 +105,16 @@
|
|
|
105
105
|
transform: translateX(0%);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
.bg-dark.is-active {
|
|
108
|
+
.bg-dark-modal.is-active {
|
|
109
109
|
opacity: 1;
|
|
110
110
|
pointer-events: all;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
body:has(.bg-dark.is-active) {
|
|
113
|
+
body:has(.bg-dark-modal.is-active) {
|
|
114
114
|
overflow: hidden;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
.is-side.bg-dark.is-active {
|
|
117
|
+
.is-side.bg-dark-modal.is-active {
|
|
118
118
|
opacity: 1;
|
|
119
119
|
align-items: stretch;
|
|
120
120
|
}
|