@bagelink/vue 0.0.190 → 0.0.196
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/Btn.vue.d.ts +11 -8
- package/dist/components/Btn.vue.d.ts.map +1 -1
- package/dist/components/ListView.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DatePicker.vue.d.ts +4 -4
- package/dist/components/form/inputs/DatePicker.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RadioPillsInput.vue.d.ts +31 -0
- package/dist/components/form/inputs/RadioPillsInput.vue.d.ts.map +1 -0
- package/dist/components/form/inputs/TextInput.vue.d.ts +5 -0
- package/dist/components/form/inputs/TextInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/index.d.ts +1 -0
- package/dist/components/form/inputs/index.d.ts.map +1 -1
- package/dist/components/formkit/AddressArray.vue.d.ts.map +1 -1
- package/dist/components/formkit/BankDetailsArray.vue.d.ts.map +1 -1
- package/dist/components/formkit/ContactArrayFormKit.vue.d.ts.map +1 -1
- package/dist/index.cjs +13036 -3561
- package/dist/index.mjs +13037 -3562
- package/dist/style.css +479 -350
- package/dist/types/BtnOptions.d.ts +3 -2
- package/dist/types/BtnOptions.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Btn.vue +169 -146
- package/src/components/ListView.vue +0 -1
- package/src/components/PersonPreview.vue +1 -1
- package/src/components/form/inputs/DatePicker.vue +96 -80
- package/src/components/form/inputs/RadioPillsInput.vue +89 -0
- package/src/components/form/inputs/TextInput.vue +56 -11
- package/src/components/form/inputs/index.ts +1 -0
- package/src/components/formkit/AddressArray.vue +173 -150
- package/src/components/formkit/BankDetailsArray.vue +197 -174
- package/src/components/formkit/ContactArrayFormKit.vue +140 -123
- package/src/styles/layout.css +83 -0
- package/src/styles/theme.css +45 -16
- package/src/types/BtnOptions.ts +4 -2
- package/src/types/index.ts +2 -0
|
@@ -10,13 +10,25 @@
|
|
|
10
10
|
:month-change-on-scroll="false"
|
|
11
11
|
v-bind="options"
|
|
12
12
|
>
|
|
13
|
-
<template #action-buttons/>
|
|
14
|
-
<template #action-preview/>
|
|
13
|
+
<template #action-buttons />
|
|
14
|
+
<template #action-preview />
|
|
15
15
|
</VDatepicker>
|
|
16
16
|
</div>
|
|
17
|
-
<div
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
<div
|
|
18
|
+
class="time-wrap"
|
|
19
|
+
v-if="showTimeWrap"
|
|
20
|
+
>
|
|
21
|
+
<template
|
|
22
|
+
v-for="hr in hours"
|
|
23
|
+
:key="hr"
|
|
24
|
+
>
|
|
25
|
+
<input
|
|
26
|
+
type="radio"
|
|
27
|
+
:id="`${hr}_${name}`"
|
|
28
|
+
:name="name"
|
|
29
|
+
:value="hr"
|
|
30
|
+
v-model="selectedHour"
|
|
31
|
+
>
|
|
20
32
|
<label :for="`${hr}_${name}`">{{ hr }}</label>
|
|
21
33
|
</template>
|
|
22
34
|
</div>
|
|
@@ -27,7 +39,7 @@
|
|
|
27
39
|
import VDatepicker from '@vuepic/vue-datepicker';
|
|
28
40
|
import '@vuepic/vue-datepicker/dist/main.css';
|
|
29
41
|
|
|
30
|
-
defineProps<{ name: string, options
|
|
42
|
+
defineProps<{ name: string, options?: Record<string, any>, showTimeWrap?: boolean }>();
|
|
31
43
|
const selectedDate = $ref(null);
|
|
32
44
|
const selectedHour = $ref();
|
|
33
45
|
|
|
@@ -39,115 +51,119 @@ const hours = Array.from({ length: 18 }, (_, index) => {
|
|
|
39
51
|
</script>
|
|
40
52
|
<style>
|
|
41
53
|
.datetime-wrap {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
54
|
+
display: flex;
|
|
55
|
+
gap: 3rem;
|
|
56
|
+
padding: 1rem;
|
|
45
57
|
}
|
|
46
58
|
|
|
47
59
|
.time-wrap {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
60
|
+
display: grid;
|
|
61
|
+
gap: 0.5rem;
|
|
62
|
+
grid-template-columns: 1fr 1fr;
|
|
63
|
+
width: 100%;
|
|
52
64
|
}
|
|
53
65
|
|
|
54
66
|
.time-wrap input {
|
|
55
|
-
|
|
67
|
+
display: none;
|
|
56
68
|
}
|
|
57
69
|
|
|
58
70
|
.time-wrap label {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
background: var(--input-bg);
|
|
72
|
+
border-radius: var(--btn-border-radius);
|
|
73
|
+
line-height: calc(var(--btn-height) * 0.9);
|
|
74
|
+
display: block;
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
transition: var(--bgl-transition);
|
|
77
|
+
text-align: center;
|
|
78
|
+
font-size: 16px;
|
|
79
|
+
color: var(--bgl-primary);
|
|
80
|
+
border: 1px solid var(--bgl-primary);
|
|
69
81
|
}
|
|
70
82
|
|
|
71
83
|
.time-wrap input[type="radio"]:checked+label {
|
|
72
|
-
|
|
73
|
-
|
|
84
|
+
background: var(--bgl-primary);
|
|
85
|
+
color: var(--bgl-white);
|
|
74
86
|
}
|
|
75
87
|
|
|
76
88
|
.time-wrap label:hover {
|
|
77
|
-
|
|
89
|
+
filter: var(--bgl-hover-filter);
|
|
78
90
|
}
|
|
79
91
|
|
|
80
92
|
.time-wrap label:active {
|
|
81
|
-
|
|
93
|
+
filter: var(--bgl-active-filter);
|
|
82
94
|
}
|
|
83
95
|
|
|
84
96
|
.dp__theme_light {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
--dp-background-color: var(--bgl-white);
|
|
98
|
+
--dp-text-color: var(--bgl-black);
|
|
99
|
+
--dp-hover-color: var(--input-bg);
|
|
100
|
+
--dp-hover-text-color: var(--bgl-black);
|
|
101
|
+
--dp-hover-icon-color: var(--bgl-primary);
|
|
102
|
+
--dp-primary-color: var(--bgl-primary);
|
|
103
|
+
--dp-primary-disabled-color: var(--bgl-primary);
|
|
104
|
+
--dp-primary-text-color: var(--bgl-white);
|
|
105
|
+
--dp-secondary-color: var(--bgl-gray);
|
|
106
|
+
--dp-border-color: transparent;
|
|
107
|
+
--dp-menu-border-color: transparent;
|
|
108
|
+
--dp-scroll-bar-background: transparent;
|
|
109
|
+
--dp-scroll-bar-color: var(--bgl-gray);
|
|
110
|
+
--dp-icon-color: var(--bgl-gray);
|
|
111
|
+
--dp-highlight-color: var(--bgl-gray-light);
|
|
100
112
|
}
|
|
101
113
|
|
|
102
114
|
:root {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
115
|
+
--dp-font-family: inherit;
|
|
116
|
+
--dp-cell-border-radius: 100%;
|
|
117
|
+
--dp-common-transition: all 200s ease-in;
|
|
118
|
+
|
|
119
|
+
--dp-cell-size: 40px;
|
|
120
|
+
/*Width and height of calendar cell*/
|
|
121
|
+
--dp-menu-min-width: 280px;
|
|
122
|
+
/*Adjust the min width of the menu*/
|
|
123
|
+
--dp-row-margin: 8px 0;
|
|
124
|
+
/*Adjust the spacing between rows in the calendar*/
|
|
113
125
|
}
|
|
114
126
|
|
|
115
127
|
.dp__calendar_header {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
128
|
+
font-weight: 400;
|
|
129
|
+
padding: 10px 0 0;
|
|
130
|
+
margin-bottom: -10px;
|
|
119
131
|
}
|
|
120
132
|
|
|
121
133
|
.dp__calendar_row>div:last-child {
|
|
122
|
-
|
|
134
|
+
pointer-events: none;
|
|
123
135
|
}
|
|
124
|
-
|
|
125
|
-
|
|
136
|
+
|
|
137
|
+
.dp__outer_menu_wrap.dp--menu-wrapper {
|
|
138
|
+
filter: drop-shadow(0 0 20px var(--bgl-shadow));
|
|
126
139
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
140
|
+
|
|
141
|
+
.dp__input {
|
|
142
|
+
background: var(--input-bg);
|
|
143
|
+
border: none;
|
|
144
|
+
padding: 0.7rem;
|
|
145
|
+
border-radius: var(--input-border-radius);
|
|
146
|
+
color: var(--input-color);
|
|
147
|
+
min-width: calc(var(--input-height) * 3);
|
|
148
|
+
width: 100%;
|
|
135
149
|
}
|
|
150
|
+
|
|
136
151
|
.dp__input:focus-visible {
|
|
137
|
-
|
|
138
|
-
|
|
152
|
+
outline: none;
|
|
153
|
+
box-shadow: inset 0 0 10px #00000012;
|
|
139
154
|
}
|
|
155
|
+
|
|
140
156
|
@media screen and (max-width: 767px) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
157
|
+
.datetime-wrap {
|
|
158
|
+
flex-wrap: wrap;
|
|
159
|
+
padding: 0rem;
|
|
160
|
+
gap: 1rem;
|
|
161
|
+
justify-content: center;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
:root {
|
|
165
|
+
--dp-menu-min-width: 200px;
|
|
166
|
+
--dp-cell-size: 35px;
|
|
167
|
+
}
|
|
152
168
|
}
|
|
153
169
|
</style>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex gap-2 flex-wrap">
|
|
3
|
+
<div class="radio-pill" v-for="({id,label,value}, index) in cumputedOptions" :key="index">
|
|
4
|
+
<input
|
|
5
|
+
type="radio"
|
|
6
|
+
:id="id"
|
|
7
|
+
:name="name"
|
|
8
|
+
:value="value"
|
|
9
|
+
:checked="selectedValue === value"
|
|
10
|
+
@change="handleSelect"
|
|
11
|
+
>
|
|
12
|
+
<label :for="id">{{ label }}</label>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script setup lang="ts">
|
|
18
|
+
import { onMounted, watch } from 'vue';
|
|
19
|
+
|
|
20
|
+
interface RadioOption {
|
|
21
|
+
id: string;
|
|
22
|
+
label: string;
|
|
23
|
+
value: any;
|
|
24
|
+
}
|
|
25
|
+
const emits = defineEmits(['update:modelValue']);
|
|
26
|
+
|
|
27
|
+
const props = defineProps<{
|
|
28
|
+
options?: RadioOption[],
|
|
29
|
+
stringOptions: string[],
|
|
30
|
+
modelValue: any,
|
|
31
|
+
name: string,
|
|
32
|
+
}>();
|
|
33
|
+
|
|
34
|
+
const cumputedOptions = $computed(() => props.options || props.stringOptions.map((v) => ({
|
|
35
|
+
id: v,
|
|
36
|
+
label: v,
|
|
37
|
+
value: v,
|
|
38
|
+
})));
|
|
39
|
+
|
|
40
|
+
let selectedValue = $ref('');
|
|
41
|
+
|
|
42
|
+
function handleSelect(e: Event) {
|
|
43
|
+
const newVal = (e.target as any)?.value;
|
|
44
|
+
emits('update:modelValue', newVal);
|
|
45
|
+
selectedValue = newVal;
|
|
46
|
+
}
|
|
47
|
+
watch(
|
|
48
|
+
() => props.modelValue,
|
|
49
|
+
(newVal, oldVal) => {
|
|
50
|
+
if (newVal === oldVal || oldVal === undefined) return;
|
|
51
|
+
if (selectedValue !== newVal) selectedValue = newVal;
|
|
52
|
+
},
|
|
53
|
+
{ immediate: true },
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
onMounted(() => {
|
|
57
|
+
selectedValue = props.modelValue;
|
|
58
|
+
});
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<style scoped>
|
|
62
|
+
.radio-pill label {
|
|
63
|
+
color: var(--bgl-primary);
|
|
64
|
+
white-space: nowrap;
|
|
65
|
+
border-radius: calc(var(--btn-border-radius) * 2);
|
|
66
|
+
outline: 1px solid var(--bgl-primary);
|
|
67
|
+
padding-left: calc(var(--btn-padding) / 2);
|
|
68
|
+
padding-right: calc(var(--btn-padding) / 2);
|
|
69
|
+
padding-top: calc(var(--btn-padding) / 6);
|
|
70
|
+
padding-bottom: calc(var(--btn-padding) / 6);
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
transition: var(--bgl-transition);
|
|
73
|
+
background: var(--bgl-white);
|
|
74
|
+
user-select: none;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.radio-pill label:hover {
|
|
78
|
+
filter: var(--bgl-hover-filter);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.radio-pill input {
|
|
82
|
+
display: none;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.radio-pill input:checked~label {
|
|
86
|
+
background: var(--bgl-primary);
|
|
87
|
+
color: var(--bgl-white);
|
|
88
|
+
}
|
|
89
|
+
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
class="bagel-input"
|
|
4
|
-
:class="{ small, shrink, toggleEdit, editMode }"
|
|
4
|
+
:class="{ small, shrink, toggleEdit, editMode, textInputIconWrap: icon, txtInputIconStart: iconStart }"
|
|
5
5
|
:title="title"
|
|
6
6
|
>
|
|
7
7
|
<label :for="id">
|
|
@@ -20,9 +20,22 @@
|
|
|
20
20
|
@keydown.enter="toggleEditAction"
|
|
21
21
|
>
|
|
22
22
|
</label>
|
|
23
|
+
|
|
24
|
+
<MaterialIcon
|
|
25
|
+
class="iconStart"
|
|
26
|
+
v-if="iconStart"
|
|
27
|
+
:icon="iconStart"
|
|
28
|
+
/>
|
|
29
|
+
<MaterialIcon
|
|
30
|
+
v-if="icon"
|
|
31
|
+
:icon="icon"
|
|
32
|
+
/>
|
|
23
33
|
<Btn
|
|
24
34
|
class="toggleEditBtn"
|
|
25
|
-
v-if="toggleEdit"
|
|
35
|
+
v-if="toggleEdit"
|
|
36
|
+
thin
|
|
37
|
+
@click="toggleEditAction"
|
|
38
|
+
:icon="editMode ? 'check' : 'edit'"
|
|
26
39
|
flat
|
|
27
40
|
/>
|
|
28
41
|
</div>
|
|
@@ -30,7 +43,9 @@
|
|
|
30
43
|
|
|
31
44
|
<script setup lang="ts">
|
|
32
45
|
import { watch } from 'vue';
|
|
33
|
-
import {
|
|
46
|
+
import {
|
|
47
|
+
debounce, Btn, type MaterialIcons, MaterialIcon,
|
|
48
|
+
} from '@bagelink/vue';
|
|
34
49
|
|
|
35
50
|
const emit = defineEmits(['update:modelValue', 'debounce']);
|
|
36
51
|
const props = withDefaults(
|
|
@@ -47,6 +62,8 @@ const props = withDefaults(
|
|
|
47
62
|
toggleEdit?: boolean;
|
|
48
63
|
type?: string;
|
|
49
64
|
nativeInputAttrs?: Record<string, any>;
|
|
65
|
+
icon?: MaterialIcons;
|
|
66
|
+
iconStart?: MaterialIcons;
|
|
50
67
|
}>(),
|
|
51
68
|
{
|
|
52
69
|
type: 'text',
|
|
@@ -54,7 +71,7 @@ const props = withDefaults(
|
|
|
54
71
|
modelValue: '',
|
|
55
72
|
},
|
|
56
73
|
);
|
|
57
|
-
let inputVal = $ref<string|number>();
|
|
74
|
+
let inputVal = $ref<string | number>();
|
|
58
75
|
let editMode = $ref<boolean>(!props.toggleEdit);
|
|
59
76
|
|
|
60
77
|
const input = $ref<HTMLInputElement>();
|
|
@@ -90,36 +107,64 @@ watch(
|
|
|
90
107
|
</script>
|
|
91
108
|
|
|
92
109
|
<style>
|
|
93
|
-
.bagel-input.shrink,
|
|
110
|
+
.bagel-input.shrink,
|
|
111
|
+
.bagel-input.shrink input {
|
|
94
112
|
min-width: unset !important;
|
|
95
113
|
/* width: auto; */
|
|
96
114
|
}
|
|
97
115
|
</style>
|
|
98
116
|
|
|
99
117
|
<style scoped>
|
|
100
|
-
.bagel-input input[disabled]{
|
|
118
|
+
.bagel-input input[disabled] {
|
|
101
119
|
background: none;
|
|
102
120
|
}
|
|
103
121
|
|
|
104
122
|
.bagel-input.toggleEdit:hover {
|
|
105
123
|
background-color: var(--input-bg);
|
|
106
124
|
}
|
|
107
|
-
|
|
108
|
-
|
|
125
|
+
|
|
126
|
+
.bagel-input.small {
|
|
127
|
+
margin-bottom: 0;
|
|
109
128
|
height: 30px;
|
|
110
129
|
}
|
|
111
130
|
|
|
112
|
-
.toggleEditBtn{
|
|
131
|
+
.toggleEditBtn {
|
|
113
132
|
position: absolute;
|
|
114
133
|
right: -24px;
|
|
115
134
|
top: 4;
|
|
116
135
|
opacity: 0;
|
|
117
136
|
}
|
|
118
|
-
|
|
137
|
+
|
|
138
|
+
.textInputIconWrap {
|
|
139
|
+
position: relative;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.textInputIconWrap .icon-font {
|
|
143
|
+
position: absolute;
|
|
144
|
+
inset-inline-end: 0.7rem;
|
|
145
|
+
bottom: 50%;
|
|
146
|
+
line-height: 0;
|
|
147
|
+
color: var(--bgl-gray);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.txtInputIconStart .iconStart {
|
|
151
|
+
position: absolute;
|
|
152
|
+
inset-inline-start: 0.7rem;
|
|
153
|
+
top: 50%;
|
|
154
|
+
line-height: 0;
|
|
155
|
+
color: var(--bgl-gray);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.txtInputIconStart input {
|
|
159
|
+
padding-inline-start: 2rem;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.bagel-input:hover .toggleEditBtn,
|
|
163
|
+
.bagel-input.editMode .toggleEditBtn {
|
|
119
164
|
opacity: 1;
|
|
120
165
|
}
|
|
121
166
|
|
|
122
|
-
.bagel-input.small input{
|
|
167
|
+
.bagel-input.small input {
|
|
123
168
|
height: 30px;
|
|
124
169
|
}
|
|
125
170
|
</style>
|
|
@@ -21,3 +21,4 @@ export { default as ColorPicker } from './ColorPicker.vue';
|
|
|
21
21
|
export { default as DynamicLinkField } from './DynamicLinkField.vue';
|
|
22
22
|
export { default as PlainText } from './PlainText.vue';
|
|
23
23
|
export { default as DatePicker } from './DatePicker.vue';
|
|
24
|
+
export { default as RadioPillsInput } from './RadioPillsInput.vue';
|