@bagelink/vue 0.0.188 → 0.0.192
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 -7
- package/dist/components/Btn.vue.d.ts.map +1 -1
- package/dist/components/ListView.vue.d.ts.map +1 -1
- package/dist/components/TableSchema.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DatePicker.vue.d.ts +20 -0
- package/dist/components/form/inputs/DatePicker.vue.d.ts.map +1 -0
- 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 +2 -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 +13151 -3614
- package/dist/index.mjs +13152 -3615
- package/dist/style.css +597 -366
- package/package.json +6 -2
- package/src/components/Btn.vue +165 -146
- package/src/components/ListView.vue +0 -1
- package/src/components/PersonPreview.vue +1 -1
- package/src/components/TableSchema.vue +79 -70
- package/src/components/form/inputs/DatePicker.vue +169 -0
- package/src/components/form/inputs/RadioPillsInput.vue +89 -0
- package/src/components/form/inputs/TextInput.vue +53 -11
- package/src/components/form/inputs/index.ts +2 -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/components/formkit/FileUploader.vue +4 -4
- package/src/styles/layout.css +83 -0
- package/src/styles/theme.css +45 -16
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="datetime-wrap">
|
|
3
|
+
<div class="date-wrap">
|
|
4
|
+
<VDatepicker
|
|
5
|
+
inline
|
|
6
|
+
week-start="0"
|
|
7
|
+
v-model="selectedDate"
|
|
8
|
+
:highlight-week-days="[6]"
|
|
9
|
+
:enable-time-picker="false"
|
|
10
|
+
:month-change-on-scroll="false"
|
|
11
|
+
v-bind="options"
|
|
12
|
+
>
|
|
13
|
+
<template #action-buttons />
|
|
14
|
+
<template #action-preview />
|
|
15
|
+
</VDatepicker>
|
|
16
|
+
</div>
|
|
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
|
+
>
|
|
32
|
+
<label :for="`${hr}_${name}`">{{ hr }}</label>
|
|
33
|
+
</template>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script setup lang="ts">
|
|
39
|
+
import VDatepicker from '@vuepic/vue-datepicker';
|
|
40
|
+
import '@vuepic/vue-datepicker/dist/main.css';
|
|
41
|
+
|
|
42
|
+
defineProps<{ name: string, options?: Record<string, any>, showTimeWrap?: boolean }>();
|
|
43
|
+
const selectedDate = $ref(null);
|
|
44
|
+
const selectedHour = $ref();
|
|
45
|
+
|
|
46
|
+
const hours = Array.from({ length: 18 }, (_, index) => {
|
|
47
|
+
const hour = Math.floor(index / 2) + 9;
|
|
48
|
+
const minute = index % 2 === 0 ? '00' : '30';
|
|
49
|
+
return `${hour}:${minute}`;
|
|
50
|
+
});
|
|
51
|
+
</script>
|
|
52
|
+
<style>
|
|
53
|
+
.datetime-wrap {
|
|
54
|
+
display: flex;
|
|
55
|
+
gap: 3rem;
|
|
56
|
+
padding: 1rem;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.time-wrap {
|
|
60
|
+
display: grid;
|
|
61
|
+
gap: 0.5rem;
|
|
62
|
+
grid-template-columns: 1fr 1fr;
|
|
63
|
+
width: 100%;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.time-wrap input {
|
|
67
|
+
display: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.time-wrap label {
|
|
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);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.time-wrap input[type="radio"]:checked+label {
|
|
84
|
+
background: var(--bgl-primary);
|
|
85
|
+
color: var(--bgl-white);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.time-wrap label:hover {
|
|
89
|
+
filter: var(--bgl-hover-filter);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.time-wrap label:active {
|
|
93
|
+
filter: var(--bgl-active-filter);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.dp__theme_light {
|
|
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);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
:root {
|
|
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*/
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.dp__calendar_header {
|
|
128
|
+
font-weight: 400;
|
|
129
|
+
padding: 10px 0 0;
|
|
130
|
+
margin-bottom: -10px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.dp__calendar_row>div:last-child {
|
|
134
|
+
pointer-events: none;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.dp__outer_menu_wrap.dp--menu-wrapper {
|
|
138
|
+
filter: drop-shadow(0 0 20px var(--bgl-shadow));
|
|
139
|
+
}
|
|
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%;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.dp__input:focus-visible {
|
|
152
|
+
outline: none;
|
|
153
|
+
box-shadow: inset 0 0 10px #00000012;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
@media screen and (max-width: 767px) {
|
|
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
|
+
}
|
|
168
|
+
}
|
|
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,61 @@ 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
|
+
.textInputIconWrap .icon-font {
|
|
142
|
+
position: absolute;
|
|
143
|
+
inset-inline-end: 0.7rem;
|
|
144
|
+
top:50%;
|
|
145
|
+
line-height: 0;
|
|
146
|
+
color: var(--bgl-gray);
|
|
147
|
+
}
|
|
148
|
+
.txtInputIconStart .iconStart{
|
|
149
|
+
position: absolute;
|
|
150
|
+
inset-inline-start: 0.7rem;
|
|
151
|
+
top:50%;
|
|
152
|
+
line-height: 0;
|
|
153
|
+
color: var(--bgl-gray);
|
|
154
|
+
}
|
|
155
|
+
.txtInputIconStart input{
|
|
156
|
+
padding-inline-start: 2rem;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.bagel-input:hover .toggleEditBtn,
|
|
160
|
+
.bagel-input.editMode .toggleEditBtn {
|
|
119
161
|
opacity: 1;
|
|
120
162
|
}
|
|
121
163
|
|
|
122
|
-
.bagel-input.small input{
|
|
164
|
+
.bagel-input.small input {
|
|
123
165
|
height: 30px;
|
|
124
166
|
}
|
|
125
167
|
</style>
|
|
@@ -20,3 +20,5 @@ export { default as Checkbox } from './Checkbox.vue';
|
|
|
20
20
|
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
|
+
export { default as DatePicker } from './DatePicker.vue';
|
|
24
|
+
export { default as RadioPillsInput } from './RadioPillsInput.vue';
|