ep-lib-ts 0.0.7 → 0.0.9
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/basics/EpBadge.vue.d.ts +38 -0
- package/dist/components/basics/EpBtn.vue.d.ts +108 -0
- package/dist/components/basics/EpCard.vue.d.ts +95 -0
- package/dist/components/basics/EpChip.vue.d.ts +72 -0
- package/dist/components/basics/EpDivider.vue.d.ts +51 -4
- package/dist/components/basics/EpFlex.vue.d.ts +9 -0
- package/dist/components/basics/EpIcon.vue.d.ts +37 -4
- package/dist/components/basics/EpImg.vue.d.ts +76 -0
- package/dist/components/basics/EpSection.vue.d.ts +84 -0
- package/dist/components/basics/EpSpinner.vue.d.ts +32 -0
- package/dist/components/basics/EpTable.vue.d.ts +24 -0
- package/dist/components/basics/EpText.vue.d.ts +30 -0
- package/dist/components/charts/EpBarChart.vue.d.ts +82 -0
- package/dist/components/charts/EpLineChart.vue.d.ts +82 -0
- package/dist/components/charts/EpPieChart.vue.d.ts +2 -0
- package/dist/components/educationals/EpEdu.vue.d.ts +80 -0
- package/dist/components/educationals/EpReading.vue.d.ts +151 -0
- package/dist/components/educationals/EpScope.vue.d.ts +14 -0
- package/dist/components/interactions/EpAccordeon.vue.d.ts +53 -4
- package/dist/components/interactions/EpContentSlider.vue.d.ts +2 -0
- package/dist/components/interactions/EpModal.vue.d.ts +70 -0
- package/dist/components/interactions/EpQuestion.vue.d.ts +2 -0
- package/dist/components/interactions/EpTabs.vue.d.ts +2 -0
- package/dist/components/medias/EpAudio.vue.d.ts +79 -0
- package/dist/components/medias/EpCarousel.vue.d.ts +32 -0
- package/dist/components/medias/EpIframe.vue.d.ts +58 -0
- package/dist/components/medias/EpKatex.vue.d.ts +52 -0
- package/dist/components/medias/EpLink.vue.d.ts +73 -0
- package/dist/components/medias/EpSoftware.vue.d.ts +88 -0
- package/dist/components/medias/EpSvg.vue.d.ts +2 -0
- package/dist/components/medias/EpTerm.vue.d.ts +80 -0
- package/dist/components/medias/EpTimeLine.vue.d.ts +2 -0
- package/dist/components/medias/EpVideo.vue.d.ts +64 -0
- package/dist/components/medias/EpVideoPanopto.vue.d.ts +64 -0
- package/dist/components/signages/EpAlert.vue.d.ts +63 -4
- package/dist/components/signages/EpHeader.vue.d.ts +101 -0
- package/dist/components/signages/EpQuote.vue.d.ts +39 -0
- package/dist/components/tools/BgAudio.vue.d.ts +14 -0
- package/dist/components/tools/DisplayBox.vue.d.ts +17 -0
- package/dist/ep-lib-ts.js +27411 -0
- package/dist/ep-lib-ts.umd.cjs +1005 -0
- package/dist/index.d.ts +37 -1
- package/dist/style.css +1 -0
- package/package.json +25 -23
- package/src/components/basics/EpBadge.vue +48 -0
- package/src/components/basics/EpBtn.vue +100 -0
- package/src/components/basics/EpCard.vue +95 -0
- package/src/components/basics/EpChip.vue +81 -0
- package/src/components/basics/EpDivider.vue +40 -0
- package/src/components/basics/EpFlex.vue +42 -0
- package/src/components/basics/EpIcon.vue +25 -0
- package/src/components/basics/EpImg.vue +59 -0
- package/src/components/basics/EpSection.vue +238 -0
- package/src/components/basics/EpSpinner.vue +47 -0
- package/src/components/basics/EpTable.vue +33 -0
- package/src/components/basics/EpText.vue +85 -0
- package/src/components/charts/EpBarChart.vue +82 -0
- package/src/components/charts/EpLineChart.vue +92 -0
- package/src/components/charts/EpPieChart.vue +8 -0
- package/src/components/educationals/EpEdu.vue +93 -0
- package/src/components/educationals/EpReading.vue +234 -0
- package/src/components/educationals/EpScope.vue +25 -0
- package/src/components/forms/EpCheckbox.vue +49 -0
- package/src/components/forms/EpInput.vue +178 -0
- package/src/components/forms/EpRadio.vue +72 -0
- package/src/components/forms/EpSelect.vue +145 -0
- package/src/components/forms/EpSwitch.vue +58 -0
- package/src/components/forms/EpTextarea.vue +79 -0
- package/src/components/forms/EpToggle.vue +97 -0
- package/src/components/interactions/EpAccordeon.vue +88 -0
- package/src/components/interactions/EpContentSlider.vue +12 -0
- package/src/components/interactions/EpModal.vue +117 -0
- package/src/components/interactions/EpQuestion.vue +8 -0
- package/src/components/interactions/EpTabs.vue +10 -0
- package/src/components/medias/EpAudio.vue +83 -0
- package/src/components/medias/EpCarousel.vue +84 -0
- package/src/components/medias/EpIframe.vue +57 -0
- package/src/components/medias/EpKatex.vue +75 -0
- package/src/components/medias/EpLink.vue +62 -0
- package/src/components/medias/EpSoftware.vue +89 -0
- package/src/components/medias/EpSvg.vue +8 -0
- package/src/components/medias/EpTerm.vue +145 -0
- package/src/components/medias/EpTimeLine.vue +8 -0
- package/src/components/medias/EpVideo.vue +77 -0
- package/src/components/medias/EpVideoPanopto.vue +62 -0
- package/src/components/signages/EpAlert.vue +70 -0
- package/src/components/signages/EpHeader.vue +223 -0
- package/src/components/signages/EpQuote.vue +48 -0
- package/src/components/tools/BgAudio.vue +51 -0
- package/src/components/tools/DisplayBox.vue +37 -0
- package/dist/components/basics/EpDivider.vue.d.ts.map +0 -1
- package/dist/components/basics/EpIcon.vue.d.ts.map +0 -1
- package/dist/components/index.d.ts +0 -38
- package/dist/components/interactions/EpAccordeon.vue.d.ts.map +0 -1
- package/dist/components/main.d.ts +0 -7
- package/dist/components/signages/EpAlert.vue.d.ts.map +0 -1
- package/dist/ep-lib-ts.cjs.js +0 -1
- package/dist/ep-lib-ts.es.js +0 -392
- package/dist/ep-lib-ts.umd.js +0 -2
- package/dist/index.css +0 -1
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { toRefs, computed } from "vue";
|
|
3
|
+
import EpIcon from "../basics/EpIcon.vue";
|
|
4
|
+
import EpBtn from "../basics/EpBtn.vue";
|
|
5
|
+
import DisplayBox from "../tools/DisplayBox.vue";
|
|
6
|
+
import EpEdu from "./EpEdu.vue";
|
|
7
|
+
import { MediaVariants } from "../../types/Medias";
|
|
8
|
+
import { useRenderText } from "../../composables/useRenderText";
|
|
9
|
+
import { mdiBookmarkBox } from "@mdi/js";
|
|
10
|
+
import { mdiBookOpenVariant } from "@mdi/js";
|
|
11
|
+
import { mdiBookOpenPageVariant } from "@mdi/js";
|
|
12
|
+
import { mdiOpenInNew } from "@mdi/js";
|
|
13
|
+
|
|
14
|
+
interface Props {
|
|
15
|
+
url?: string;
|
|
16
|
+
year?: string;
|
|
17
|
+
author?: string;
|
|
18
|
+
cover?: string;
|
|
19
|
+
title: string | null;
|
|
20
|
+
container?: string; /// is publication complete
|
|
21
|
+
editor?: string;
|
|
22
|
+
pages?: string;
|
|
23
|
+
mandateLevel?: string;
|
|
24
|
+
intentions?: string;
|
|
25
|
+
compact?: boolean;
|
|
26
|
+
more?: boolean;
|
|
27
|
+
version_link?: null;
|
|
28
|
+
hideCover?: boolean;
|
|
29
|
+
labelcard?: string;
|
|
30
|
+
labelBtb?: string;
|
|
31
|
+
labelIntentions?: string;
|
|
32
|
+
type?:MediaVariants;
|
|
33
|
+
hideIcon?:boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// type, taxonomyLevel, courseCode, courseTitle, title, subtitle, height, src, color, synchrone
|
|
37
|
+
|
|
38
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
39
|
+
title: null,
|
|
40
|
+
cover: "",
|
|
41
|
+
icon: "mdiBookmarkBox",
|
|
42
|
+
hideCover: false,
|
|
43
|
+
labelcard: "lecture",
|
|
44
|
+
labelBtb: "lire",
|
|
45
|
+
labelIntentions: "Intentions de lecture",
|
|
46
|
+
intentions: "",
|
|
47
|
+
compact: false,
|
|
48
|
+
type:"base",
|
|
49
|
+
hideIcon:false
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const old_image = "https://live.staticflickr.com/4868/45940268562_c5f7fdd06b_q.jpg";
|
|
53
|
+
|
|
54
|
+
const hasCover = computed(() => {
|
|
55
|
+
if (props.cover === old_image || props.cover.trim().length === 0) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
return true;
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const hasDetails = computed(() => {
|
|
62
|
+
if (props.author || props.editor || props.container || props.year) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
return false;
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const {
|
|
69
|
+
title,
|
|
70
|
+
intentions,
|
|
71
|
+
cover,
|
|
72
|
+
hideCover,
|
|
73
|
+
labelcard,
|
|
74
|
+
year,
|
|
75
|
+
author,
|
|
76
|
+
container,
|
|
77
|
+
editor,
|
|
78
|
+
pages,
|
|
79
|
+
type,
|
|
80
|
+
mandateLevel
|
|
81
|
+
} = toRefs(props);
|
|
82
|
+
</script>
|
|
83
|
+
|
|
84
|
+
<template>
|
|
85
|
+
<div class="flex rounded-lg overflow-hidden bg-white md:flex-row" v-if="!compact">
|
|
86
|
+
<template v-if="!hideCover">
|
|
87
|
+
<div
|
|
88
|
+
v-if="hasCover"
|
|
89
|
+
class="bg-primary h-96 w-full rounded-t-lg md:h-auto md:w-56 md:rounded-none md:rounded-l-lg flex justify-center items-center text-gray-300"
|
|
90
|
+
>
|
|
91
|
+
<img :src="cover" :alt="`image de la lecture ${title}`" />
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div
|
|
95
|
+
v-else
|
|
96
|
+
class="h-96 w-full rounded-t-lg md:h-auto md:w-56 md:rounded-none md:rounded-l-lg flex justify-center items-center text-gray-300"
|
|
97
|
+
>
|
|
98
|
+
<EpIcon :icon-path="mdiBookOpenPageVariant" size="95"></EpIcon>
|
|
99
|
+
</div>
|
|
100
|
+
</template>
|
|
101
|
+
<div class="flex flex-col w-full">
|
|
102
|
+
<EpEdu :title="labelcard" :icon="mdiBookOpenVariant" flat :type="type" :hideIcon="hideIcon" :mandateLevel="mandateLevel">
|
|
103
|
+
<template #intentions v-if="useRenderText(intentions)">
|
|
104
|
+
<div v-html="useRenderText(intentions)"></div>
|
|
105
|
+
</template>
|
|
106
|
+
<template #content>
|
|
107
|
+
<div class="w-full">
|
|
108
|
+
<h4 :class="`text-xl font-semibold ${hasDetails || pages ? 'border-b' : ''}`">
|
|
109
|
+
{{ title }}
|
|
110
|
+
</h4>
|
|
111
|
+
<div class="flex">
|
|
112
|
+
<div class="flex-1 py-2" v-if="hasDetails">
|
|
113
|
+
<p class="font-medium">
|
|
114
|
+
<span class="text-sm italic pr-1" v-if="author">par</span>
|
|
115
|
+
<span class="font-bold" v-if="author">{{ author }}</span>
|
|
116
|
+
<span v-if="year">({{ year }})</span>
|
|
117
|
+
<span v-if="year && editor">, </span>
|
|
118
|
+
<span v-if="editor">{{ editor }}</span>
|
|
119
|
+
</p>
|
|
120
|
+
<p v-if="container">
|
|
121
|
+
<span class="text-sm italic pr-1">dans</span>
|
|
122
|
+
<span class="">{{ container }}</span>
|
|
123
|
+
</p>
|
|
124
|
+
</div>
|
|
125
|
+
<div
|
|
126
|
+
:class="`flex-1 pt-2 pb-2 ${hasDetails ? 'border-l pl-2' : ''}`"
|
|
127
|
+
v-if="pages"
|
|
128
|
+
>
|
|
129
|
+
<EpIcon :size="24" :icon-path="mdiBookmarkBox"></EpIcon>
|
|
130
|
+
<span class="pl-2 align-middle">{{ pages }}</span>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
</template>
|
|
135
|
+
<template #actions>
|
|
136
|
+
<EpBtn :color="type=='base'?'text-gray-700':'text-white'" :type="type">LIRE</EpBtn>
|
|
137
|
+
</template>
|
|
138
|
+
</EpEdu>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
<!--compact mode-->
|
|
142
|
+
<EpEdu :title="labelcard" :icon="mdiBookOpenVariant" flat :type="type" :hideIcon="hideIcon" v-else>
|
|
143
|
+
<template #intentions v-if="useRenderText(intentions)">
|
|
144
|
+
<div v-html="useRenderText(intentions)"></div>
|
|
145
|
+
</template>
|
|
146
|
+
<template #content>
|
|
147
|
+
<div class="flex flex-row justify-between">
|
|
148
|
+
<div class="p-5">
|
|
149
|
+
<span
|
|
150
|
+
class="text-lg leading-6 font-semibold font-sans text-skin-inverted group-hover:text-skin-primary"
|
|
151
|
+
>{{ title }}</span
|
|
152
|
+
>
|
|
153
|
+
</div>
|
|
154
|
+
<div class="flex">
|
|
155
|
+
<div class="p-5">
|
|
156
|
+
<DisplayBox>
|
|
157
|
+
<template #default="{ open }">
|
|
158
|
+
<EpBtn text @click.stop="open"> détails </EpBtn>
|
|
159
|
+
</template>
|
|
160
|
+
<template #menu="{ close }">
|
|
161
|
+
<div class="w-[32rem]">
|
|
162
|
+
<div class="flex flex-col rounded-lg bg-white md:flex-row">
|
|
163
|
+
<template v-if="!hideCover">
|
|
164
|
+
<img
|
|
165
|
+
v-if="hasCover"
|
|
166
|
+
class="object-cover h-96 w-full rounded-t-lg object-cover md:h-auto md:w-56 md:rounded-none md:rounded-l-lg"
|
|
167
|
+
:src="cover"
|
|
168
|
+
:alt="`image de la lecture ${title}`"
|
|
169
|
+
/>
|
|
170
|
+
<div
|
|
171
|
+
v-else
|
|
172
|
+
class="h-96 border-l border-t border-b w-full rounded-t-lg md:h-auto md:w-56 md:rounded-none md:rounded-l-lg flex justify-center items-center text-gray-300"
|
|
173
|
+
>
|
|
174
|
+
<EpIcon :icon-path="mdiBookOpenPageVariant" size="95"></EpIcon>
|
|
175
|
+
</div>
|
|
176
|
+
</template>
|
|
177
|
+
<div class="flex flex-col justify-between w-full">
|
|
178
|
+
<div class="bg-neutral-100 text-left px-5 py-2">
|
|
179
|
+
<EpIcon :size="24" :icon-path="mdiBookOpenVariant"></EpIcon>
|
|
180
|
+
<span class="pl-2 align-middle">Lecture</span>
|
|
181
|
+
</div>
|
|
182
|
+
<div class="w-full px-5">
|
|
183
|
+
<h4
|
|
184
|
+
:class="`text-xl font-semibold py-4 ${
|
|
185
|
+
hasDetails || pages ? 'border-b' : ''
|
|
186
|
+
}`"
|
|
187
|
+
>
|
|
188
|
+
{{ title }}
|
|
189
|
+
</h4>
|
|
190
|
+
<div class="flex">
|
|
191
|
+
<div class="flex-1 py-2" v-if="hasDetails">
|
|
192
|
+
<p class="font-medium">
|
|
193
|
+
<span class="text-sm italic pr-1" v-if="author">par</span>
|
|
194
|
+
<span class="font-bold" v-if="author">{{ author }}</span>
|
|
195
|
+
<span v-if="year">({{ year }})</span>
|
|
196
|
+
<span v-if="year && editor">, </span>
|
|
197
|
+
<span v-if="editor">{{ editor }}</span>
|
|
198
|
+
</p>
|
|
199
|
+
<p v-if="container">
|
|
200
|
+
<span class="text-sm italic pr-1">dans</span>
|
|
201
|
+
<span class="">{{ container }}</span>
|
|
202
|
+
</p>
|
|
203
|
+
</div>
|
|
204
|
+
<div
|
|
205
|
+
:class="`flex-1 pt-2 pb-2 ${
|
|
206
|
+
hasDetails ? 'border-l pl-2' : ''
|
|
207
|
+
}`"
|
|
208
|
+
v-if="pages"
|
|
209
|
+
>
|
|
210
|
+
<EpIcon :size="24" :icon-path="mdiBookmarkBox"></EpIcon>
|
|
211
|
+
<span class="pl-2 align-middle">{{ pages }}</span>
|
|
212
|
+
</div>
|
|
213
|
+
</div>
|
|
214
|
+
</div>
|
|
215
|
+
<div class="bg-neutral-100 text-right pr-5">
|
|
216
|
+
<EpBtn text @click.stop="close"> Fermer </EpBtn>
|
|
217
|
+
</div>
|
|
218
|
+
</div>
|
|
219
|
+
</div>
|
|
220
|
+
</div>
|
|
221
|
+
</template>
|
|
222
|
+
</DisplayBox>
|
|
223
|
+
</div>
|
|
224
|
+
|
|
225
|
+
<div class="border-l p-5">
|
|
226
|
+
<EpBtn text>
|
|
227
|
+
<EpIcon :size="20" :icon-path="mdiOpenInNew"></EpIcon> Lire
|
|
228
|
+
</EpBtn>
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
232
|
+
</template>
|
|
233
|
+
</EpEdu>
|
|
234
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { toRefs } from "vue";
|
|
3
|
+
//types with capital letter, object styles in lowercase
|
|
4
|
+
import EpChip from "../basics/EpChip.vue";
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
title?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
11
|
+
title: "Essentiel", //[Enrichissement]
|
|
12
|
+
type: "base",
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
//controls
|
|
18
|
+
//const controls = useMediaControls(video, {src:props.src})
|
|
19
|
+
|
|
20
|
+
const { title } = toRefs(props);
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<EpChip size="small" type="base">{{ title }}</EpChip>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {toRefs } from "vue";
|
|
3
|
+
const name: string = "checkbox";
|
|
4
|
+
interface Props {
|
|
5
|
+
id?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
modelValue?: string;
|
|
8
|
+
type?: "checkbox" | "radio";
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
readonly?: boolean;
|
|
11
|
+
checked?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
15
|
+
id: "0",
|
|
16
|
+
label: "check",
|
|
17
|
+
modelValue: "",
|
|
18
|
+
type: "checkbox",
|
|
19
|
+
disabled: false,
|
|
20
|
+
readonly: false,
|
|
21
|
+
checked: false,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const emit = defineEmits<{
|
|
25
|
+
(e: "update:modelValue", modelValue: string): void;
|
|
26
|
+
}>();
|
|
27
|
+
|
|
28
|
+
const { id, label, type, modelValue, disabled, readonly, checked } =
|
|
29
|
+
toRefs(props);
|
|
30
|
+
</script>
|
|
31
|
+
<template>
|
|
32
|
+
<div>
|
|
33
|
+
<input
|
|
34
|
+
:id="id"
|
|
35
|
+
:type="type"
|
|
36
|
+
:value="modelValue"
|
|
37
|
+
class="form-checkbox rounded border-neutral-300 text-blue-600 h-[1.125rem] w-[1.125rem] mr-2 disabled:opacity-40 disabled:cursor-not-allowed"
|
|
38
|
+
:disabled="disabled"
|
|
39
|
+
:readonly="readonly"
|
|
40
|
+
:checked="checked"
|
|
41
|
+
/>
|
|
42
|
+
<label
|
|
43
|
+
:for="id"
|
|
44
|
+
class="disabled:opacity-40 hover:pointer-events-none"
|
|
45
|
+
:disabled="disabled"
|
|
46
|
+
>{{ label }}</label
|
|
47
|
+
>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { toRefs, toRef } from "vue";
|
|
3
|
+
import {useField} from 'vee-validate'
|
|
4
|
+
import EpIcon from "../basics/EpIcon.vue";
|
|
5
|
+
import EpBadge from "../basics/EpBadge.vue";
|
|
6
|
+
import { mdiLockOutline } from "@mdi/js";
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
name:string;
|
|
10
|
+
id?: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
modelValue?: string;
|
|
13
|
+
type?:
|
|
14
|
+
| "text"
|
|
15
|
+
| "email"
|
|
16
|
+
| "url"
|
|
17
|
+
| "password"
|
|
18
|
+
| "number"
|
|
19
|
+
| "date"
|
|
20
|
+
| "search"
|
|
21
|
+
| "tel"
|
|
22
|
+
| "time";
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
iconPath?: string | null;
|
|
25
|
+
iconSize?: string;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
readonly?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// text: mdiText
|
|
31
|
+
// email: mdiEmailOutline
|
|
32
|
+
// url: mdiLink
|
|
33
|
+
// password: mdiLockOutline
|
|
34
|
+
// number: mdiNumeric
|
|
35
|
+
// date: mdiCalendarMonthOutline
|
|
36
|
+
// search: mdiMagnify
|
|
37
|
+
// tel: mdiPhoneOutline
|
|
38
|
+
// time: mdiClockOutline
|
|
39
|
+
|
|
40
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
41
|
+
id: "0",
|
|
42
|
+
label: "label",
|
|
43
|
+
modelValue: "",
|
|
44
|
+
type: "text",
|
|
45
|
+
placeholder: "",
|
|
46
|
+
iconPath: "",
|
|
47
|
+
iconSize: "32",
|
|
48
|
+
disabled: false,
|
|
49
|
+
readonly: false,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const emit = defineEmits<{
|
|
53
|
+
(e: "update:modelValue", modelValue: string): void;
|
|
54
|
+
}>();
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
const {
|
|
58
|
+
id,
|
|
59
|
+
// name,
|
|
60
|
+
label,
|
|
61
|
+
type,
|
|
62
|
+
modelValue,
|
|
63
|
+
placeholder,
|
|
64
|
+
iconPath,
|
|
65
|
+
disabled,
|
|
66
|
+
readonly,
|
|
67
|
+
} = toRefs(props);
|
|
68
|
+
|
|
69
|
+
const name = toRef(props, 'name');
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
function validateField(value:string) {
|
|
73
|
+
if (!value) {
|
|
74
|
+
return 'this field is required';
|
|
75
|
+
}
|
|
76
|
+
if (value.length < 8) {
|
|
77
|
+
return 'this field must contain at least 8 characters';
|
|
78
|
+
}
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const {value, errorMessage, meta} = useField(name, validateField)
|
|
83
|
+
//($event.target as HTMLInputElement).value)
|
|
84
|
+
</script>
|
|
85
|
+
|
|
86
|
+
<template>
|
|
87
|
+
{{ meta }}
|
|
88
|
+
<!-- <div>
|
|
89
|
+
<label :for="id">{{ label }}</label>
|
|
90
|
+
<input
|
|
91
|
+
:id="id"
|
|
92
|
+
:type="type"
|
|
93
|
+
:placeholder="placeholder"
|
|
94
|
+
:disabled="disabled"
|
|
95
|
+
:readonly="readonly"
|
|
96
|
+
:value="modelValue"
|
|
97
|
+
@input="$emit('update:modelValue', $event.target.value)"
|
|
98
|
+
class="form-input p-2 border-solid border-gray-400 border-1 w-full rounded-md"
|
|
99
|
+
/>
|
|
100
|
+
</div> -->
|
|
101
|
+
|
|
102
|
+
<!-- <EpIcon
|
|
103
|
+
v-if="prependIcon"
|
|
104
|
+
:iconPath="prependIcon"
|
|
105
|
+
:size="iconSize"
|
|
106
|
+
extraClass="mr-2"
|
|
107
|
+
></EpIcon> -->
|
|
108
|
+
|
|
109
|
+
<!-- <label for="" class="text-xs px-1">
|
|
110
|
+
<span>First name</span>
|
|
111
|
+
<span class="text-xs font-semibold px-1">* requis</span>
|
|
112
|
+
<div class="flex">
|
|
113
|
+
<div
|
|
114
|
+
class="w-10 z-10 pl-1 text-center pointer-events-none text-gray-500 flex items-center justify-center"
|
|
115
|
+
>
|
|
116
|
+
<EpIcon
|
|
117
|
+
v-if="iconPath"
|
|
118
|
+
:iconPath="iconPath"
|
|
119
|
+
:size="iconSize"
|
|
120
|
+
extraClass="mr-2"
|
|
121
|
+
></EpIcon>
|
|
122
|
+
</div>
|
|
123
|
+
<input
|
|
124
|
+
type="text"
|
|
125
|
+
class="w-full -ml-10 pl-10 pr-3 py-2 rounded-lg border-2 border-gray-300 outline-none focus:border-blue-500"
|
|
126
|
+
placeholder="John"
|
|
127
|
+
/>
|
|
128
|
+
<input
|
|
129
|
+
type="text"
|
|
130
|
+
class="mt-0 block w-full px-0.5 border-0 border-b-2 border-gray-200 focus:ring-0 focus:border-black"
|
|
131
|
+
placeholder=""
|
|
132
|
+
/>
|
|
133
|
+
</div>
|
|
134
|
+
</label> -->
|
|
135
|
+
<div class="w-72">
|
|
136
|
+
<div class="relative h-10 w-full min-w-[200px]">
|
|
137
|
+
<div
|
|
138
|
+
class="absolute top-2/4 right-3 grid h-5 w-5 -translate-y-2/4 place-items-center text-neutral-400"
|
|
139
|
+
>
|
|
140
|
+
<!-- <EpIcon
|
|
141
|
+
v-if="iconPath"
|
|
142
|
+
:iconPath="iconPath"
|
|
143
|
+
:size="iconSize"
|
|
144
|
+
extraClass="mr-2"
|
|
145
|
+
></EpIcon> -->
|
|
146
|
+
</div>
|
|
147
|
+
<input
|
|
148
|
+
:id="id"
|
|
149
|
+
:type="type"
|
|
150
|
+
class="peer h-full w-full rounded-[7px] border border-blue-200 border-t-transparent bg-transparent px-3 py-2.5 !pr-9 font-sans text-sm font-normal text-neutral-700 outline outline-0 transition-all placeholder-shown:border placeholder-shown:border-neutral-200 placeholder-shown:border-t-neutral-200 focus:border-2 focus:border-blue-500 focus:border-t-transparent focus:outline-0 disabled:border-0 disabled:bg-neutral-100 disabled:cursor-not-allowed"
|
|
151
|
+
placeholder=" "
|
|
152
|
+
:disabled="disabled"
|
|
153
|
+
/>
|
|
154
|
+
<label
|
|
155
|
+
:for="id"
|
|
156
|
+
class="before:content[' '] after:content[' '] pointer-events-none absolute left-0 -top-1.5 flex h-full w-full select-none text-[11px] font-normal leading-tight text-neutral-400 transition-all before:pointer-events-none before:mt-[6.5px] before:mr-1 before:box-border before:block before:h-1.5 before:w-2.5 before:rounded-tl-md before:border-t before:border-l before:border-blue-200 before:transition-all after:pointer-events-none after:mt-[6.5px] after:ml-1 after:box-border after:block after:h-1.5 after:w-2.5 after:flex-grow after:rounded-tr-md after:border-t after:border-r after:border-blue-200 after:transition-all peer-placeholder-shown:text-sm peer-placeholder-shown:leading-[3.75] peer-placeholder-shown:text-neutral-700 peer-placeholder-shown:before:border-transparent peer-placeholder-shown:after:border-transparent peer-focus:text-[11px] peer-focus:leading-tight peer-focus:text-blue-500 peer-focus:before:border-t-2 peer-focus:before:border-l-2 peer-focus:before:border-blue-500 peer-focus:after:border-t-2 peer-focus:after:border-r-2 peer-focus:after:border-blue-500 peer-disabled:text-transparent peer-disabled:before:border-transparent peer-disabled:after:border-transparent peer-disabled:peer-placeholder-shown:text-neutral-500"
|
|
157
|
+
>
|
|
158
|
+
{{ label }}
|
|
159
|
+
</label>
|
|
160
|
+
<EpBadge :iconPath="mdiLockOutline" />
|
|
161
|
+
<!-- <span class="badge absolute -top-1 -right-1 flex h-3 w-3">
|
|
162
|
+
<span
|
|
163
|
+
class="animate-ping absolute inline-flex h-full w-full rounded-full bg-red-400 opacity-75"
|
|
164
|
+
></span>
|
|
165
|
+
<span
|
|
166
|
+
class="relative inline-flex rounded-full h-3 w-3 bg-red-500"
|
|
167
|
+
></span>
|
|
168
|
+
</span> -->
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
<div class="my-3">
|
|
172
|
+
{{ name }}
|
|
173
|
+
<input type="text" v-model="value" :name="name" :id="name">
|
|
174
|
+
<div v-if="errorMessage">{{ errorMessage }}</div>
|
|
175
|
+
|
|
176
|
+
</div>
|
|
177
|
+
</template>
|
|
178
|
+
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { toRefs, computed } from "vue";
|
|
3
|
+
import { RadioVariants, radioVariants } from "../../types/Radio";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
id?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
readonly?: boolean;
|
|
10
|
+
type?: RadioVariants;
|
|
11
|
+
value?: string;
|
|
12
|
+
modelValue?:string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
16
|
+
id: "01",
|
|
17
|
+
disabled: false,
|
|
18
|
+
readonly: false,
|
|
19
|
+
checked: false,
|
|
20
|
+
type: "base",
|
|
21
|
+
value:undefined,
|
|
22
|
+
modelValue:''
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const styleRadio = computed(() => {
|
|
26
|
+
return `${radioVariants[props.type]} mx-2 `;
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const isChecked = computed(() => {
|
|
30
|
+
return props.modelValue === props.value;
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const labelFor = computed(()=> {
|
|
34
|
+
if(props.label){
|
|
35
|
+
return props.label.trim().replace(/\s/g, '_')
|
|
36
|
+
}
|
|
37
|
+
return `label_${Math.round(Math.random()*100)}`
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
const { label, disabled, readonly, value } = toRefs(props);
|
|
41
|
+
|
|
42
|
+
const emit = defineEmits<{
|
|
43
|
+
(e:"update:modelValue", modelValue:string):void
|
|
44
|
+
}>()
|
|
45
|
+
|
|
46
|
+
const onChange = (event:Event) => {
|
|
47
|
+
const target = event.target as HTMLInputElement
|
|
48
|
+
emit('update:modelValue', target.value)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<span>
|
|
55
|
+
|
|
56
|
+
<input
|
|
57
|
+
type="radio"
|
|
58
|
+
:id="labelFor"
|
|
59
|
+
:name="labelFor"
|
|
60
|
+
:disabled="disabled"
|
|
61
|
+
:readonly="readonly"
|
|
62
|
+
:class="styleRadio"
|
|
63
|
+
:value="value"
|
|
64
|
+
:checked="isChecked"
|
|
65
|
+
@change="onChange"
|
|
66
|
+
/>
|
|
67
|
+
<label :for="labelFor" class="disabled:opacity-40">{{
|
|
68
|
+
label
|
|
69
|
+
}}</label>
|
|
70
|
+
|
|
71
|
+
</span>
|
|
72
|
+
</template>
|