@saooti/octopus-sdk 40.2.19 → 41.0.0
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/index.ts +2 -1
- package/package.json +4 -3
- package/src/App.vue +71 -95
- package/src/components/composable/player/usePlayerLive.ts +13 -4
- package/src/components/composable/player/usePlayerLogic.ts +6 -6
- package/src/components/composable/player/usePlayerVast.ts +7 -7
- package/src/components/composable/podcasts/usePodcastView.ts +3 -3
- package/src/components/composable/route/useAdvancedParamInit.ts +1 -1
- package/src/components/composable/route/useRouteUpdateParams.ts +4 -4
- package/src/components/composable/route/useSimplePageParam.ts +15 -8
- package/src/components/composable/useInit.ts +2 -2
- package/src/components/composable/useMetaTitleWatch.ts +2 -2
- package/src/components/display/accessibility/AccessibilityModal.vue +56 -68
- package/src/components/display/categories/CategoryChooser.vue +144 -145
- package/src/components/display/categories/CategoryFilter.vue +172 -198
- package/src/components/display/categories/CategoryList.vue +122 -147
- package/src/components/display/comments/CommentInput.vue +100 -122
- package/src/components/display/comments/CommentList.vue +169 -191
- package/src/components/display/comments/CommentName.vue +35 -45
- package/src/components/display/comments/CommentParentInfo.vue +28 -34
- package/src/components/display/comments/CommentPlayer.vue +38 -50
- package/src/components/display/comments/CommentSection.vue +85 -103
- package/src/components/display/comments/item/CommentBasicView.vue +48 -61
- package/src/components/display/comments/item/CommentItem.vue +104 -115
- package/src/components/display/comments/item/CommentMoreActions.vue +174 -189
- package/src/components/display/comments/item/CommentMoreActionsAdmin.vue +1 -3
- package/src/components/display/comments/like/LikeButton.vue +36 -41
- package/src/components/display/comments/like/LikeSection.vue +128 -136
- package/src/components/display/comments/modal/CheckIdentityModal.vue +35 -40
- package/src/components/display/comments/modal/EditCommentModal.vue +72 -78
- package/src/components/display/comments/modal/RecaptchaModal.vue +58 -63
- package/src/components/display/comments/modal/ReportAbuseModal.vue +59 -66
- package/src/components/display/edit/EditBox.vue +9 -8
- package/src/components/display/edit/EditBoxRadio.vue +1 -5
- package/src/components/display/emission/EmissionInlineList.vue +82 -97
- package/src/components/display/emission/EmissionItem.vue +57 -69
- package/src/components/display/emission/EmissionList.vue +189 -218
- package/src/components/display/emission/EmissionPlayerItem.vue +47 -64
- package/src/components/display/emission/EmissionPresentationItem.vue +44 -54
- package/src/components/display/emission/EmissionPresentationList.vue +51 -61
- package/src/components/display/filter/AdvancedSearch.vue +151 -176
- package/src/components/display/filter/CategorySearchFilter.vue +43 -46
- package/src/components/display/filter/DateFilter.vue +76 -91
- package/src/components/display/filter/MonetizableFilter.vue +27 -30
- package/src/components/display/filter/ProductorSearch.vue +87 -90
- package/src/components/display/filter/RubriqueChoice.vue +58 -63
- package/src/components/display/filter/RubriqueFilter.vue +154 -169
- package/src/components/display/filter/SearchOrder.vue +35 -35
- package/src/components/display/list/ListPaginate.vue +72 -93
- package/src/components/display/list/PaginateParams.vue +36 -40
- package/src/components/display/list/PaginateSection.vue +113 -124
- package/src/components/display/list/SwiperList.vue +97 -109
- package/src/components/display/live/CountDown.vue +15 -9
- package/src/components/display/live/CountdownOctopus.vue +16 -10
- package/src/components/display/live/LiveHorizontalList.vue +95 -103
- package/src/components/display/live/LiveItem.vue +64 -73
- package/src/components/display/live/LiveList.vue +125 -137
- package/src/components/display/live/RadioCurrently.vue +66 -73
- package/src/components/display/live/RadioImage.vue +39 -50
- package/src/components/display/live/RadioItem.vue +9 -14
- package/src/components/display/live/RadioList.vue +39 -53
- package/src/components/display/live/RadioPlanning.vue +210 -222
- package/src/components/display/organisation/OrganisationChooser.vue +116 -122
- package/src/components/display/organisation/OrganisationChooserLight.vue +44 -52
- package/src/components/display/participant/ParticipantInlineList.vue +42 -58
- package/src/components/display/participant/ParticipantItem.vue +66 -74
- package/src/components/display/participant/ParticipantList.vue +116 -141
- package/src/components/display/playlist/PlaylistItem.vue +33 -46
- package/src/components/display/playlist/PlaylistList.vue +115 -144
- package/src/components/display/playlist/PodcastList.vue +90 -103
- package/src/components/display/playlist/PodcastPlaylistInlineList.vue +58 -70
- package/src/components/display/podcastmaker/PodcastmakerHeader.vue +21 -22
- package/src/components/display/podcasts/AnimatorsItem.vue +15 -16
- package/src/components/display/podcasts/DownloadPodcastButton.vue +21 -29
- package/src/components/display/podcasts/ParticipantDescription.vue +22 -24
- package/src/components/display/podcasts/PodcastFilterList.vue +62 -56
- package/src/components/display/podcasts/PodcastImage.vue +96 -99
- package/src/components/display/podcasts/PodcastInlineList.vue +30 -28
- package/src/components/display/podcasts/PodcastInlineListTemplate.vue +107 -114
- package/src/components/display/podcasts/PodcastIsPlaying.vue +4 -12
- package/src/components/display/podcasts/PodcastItem.vue +48 -63
- package/src/components/display/podcasts/PodcastItemInfo.vue +19 -35
- package/src/components/display/podcasts/PodcastList.vue +182 -206
- package/src/components/display/podcasts/PodcastModuleBox.vue +100 -137
- package/src/components/display/podcasts/PodcastPlannedSpinner.vue +4 -6
- package/src/components/display/podcasts/PodcastPlayBar.vue +50 -61
- package/src/components/display/podcasts/PodcastPlayBasicButton.vue +38 -41
- package/src/components/display/podcasts/PodcastPlayButton.vue +164 -175
- package/src/components/display/podcasts/PodcastRawTranscript.vue +69 -80
- package/src/components/display/podcasts/PodcastRubriqueList.vue +35 -38
- package/src/components/display/podcasts/PodcastSwiperList.vue +100 -110
- package/src/components/display/podcasts/TagList.vue +48 -50
- package/src/components/display/podcasts/VideoModuleBox.vue +13 -24
- package/src/components/display/rubriques/RubriqueChooser.vue +135 -140
- package/src/components/display/rubriques/RubriqueList.vue +140 -160
- package/src/components/display/sharing/ChooseEpisodesNumber.vue +34 -33
- package/src/components/display/sharing/FormatSwitch.vue +16 -11
- package/src/components/display/sharing/PlayerAnonymousModal.vue +24 -27
- package/src/components/display/sharing/PlayerCommonParameters.vue +20 -13
- package/src/components/display/sharing/PlayerParameters.vue +69 -71
- package/src/components/display/sharing/QrCode.vue +55 -67
- package/src/components/display/sharing/ShareAnonymous.vue +160 -178
- package/src/components/display/sharing/ShareDistribution.vue +103 -117
- package/src/components/display/sharing/ShareNewsletter.vue +154 -161
- package/src/components/display/sharing/SharePlayer.vue +273 -295
- package/src/components/display/sharing/SharePlayerColors.vue +25 -16
- package/src/components/display/sharing/SharePlayerRadio.vue +61 -69
- package/src/components/display/sharing/SharePlayerTypes.vue +176 -176
- package/src/components/display/sharing/ShareSocialsButtons.vue +63 -75
- package/src/components/display/sharing/SubscribeButtons.vue +184 -207
- package/src/components/display/studio/RecordingItemButton.vue +1 -4
- package/src/components/form/ClassicCheckbox.vue +26 -30
- package/src/components/form/ClassicContentEditable.vue +37 -33
- package/src/components/form/ClassicCopyButton.vue +40 -44
- package/src/components/form/ClassicDatePicker.vue +114 -114
- package/src/components/form/ClassicEmojiPicker.vue +20 -28
- package/src/components/form/ClassicInputText.vue +116 -120
- package/src/components/form/ClassicLoading.vue +7 -12
- package/src/components/form/ClassicMultiselect.vue +115 -117
- package/src/components/form/ClassicRadio.vue +21 -16
- package/src/components/form/ClassicRadioLabel.vue +23 -22
- package/src/components/form/ClassicSearch.vue +24 -19
- package/src/components/form/ClassicSelect.vue +47 -38
- package/src/components/form/ClassicWysiwyg.vue +116 -123
- package/src/components/icons/AmazonMusicIcon.vue +7 -10
- package/src/components/icons/ApplePodcastIcon.vue +7 -11
- package/src/components/icons/BlueSkyIcon.vue +8 -11
- package/src/components/icons/DeezerIcon.vue +8 -11
- package/src/components/icons/EditFtpIcon.vue +8 -11
- package/src/components/icons/IHeartIcon.vue +8 -11
- package/src/components/icons/PlayVideoIcon.vue +7 -10
- package/src/components/icons/PlayerFmIcon.vue +7 -10
- package/src/components/icons/PocketCastIcon.vue +8 -11
- package/src/components/icons/PodcastAddictIcon.vue +7 -10
- package/src/components/icons/RadiolineIcon.vue +8 -11
- package/src/components/icons/TuninIcon.vue +8 -11
- package/src/components/icons/XIcon.vue +7 -10
- package/src/components/misc/AcpmImage.vue +6 -7
- package/src/components/misc/ClassicAccordion.vue +26 -31
- package/src/components/misc/ClassicLazy.vue +86 -90
- package/src/components/misc/ClassicNav.vue +16 -20
- package/src/components/misc/ClassicPopover.vue +271 -282
- package/src/components/misc/ClassicSpinner.vue +5 -27
- package/src/components/misc/ErrorMessage.vue +11 -12
- package/src/components/misc/FooterGarSection.vue +33 -41
- package/src/components/misc/FooterSection.vue +94 -131
- package/src/components/misc/HomeDropdown.vue +83 -105
- package/src/components/misc/MobileMenu.vue +101 -111
- package/src/components/misc/ProgressBar.vue +53 -62
- package/src/components/misc/TopBar.vue +98 -120
- package/src/components/misc/TopBarMainContent.vue +114 -133
- package/src/components/misc/modal/ClassicModal.vue +40 -33
- package/src/components/misc/modal/ClassicModalInBody.vue +34 -28
- package/src/components/misc/modal/ClipboardModal.vue +27 -30
- package/src/components/misc/modal/ContractPreviewModal.vue +64 -62
- package/src/components/misc/modal/MessageModal.vue +50 -47
- package/src/components/misc/modal/NewsletterModal.vue +30 -31
- package/src/components/misc/modal/QrCodeModal.vue +21 -21
- package/src/components/misc/modal/ShareModalPlayer.vue +43 -52
- package/src/components/misc/player/PlayerCompact.vue +6 -4
- package/src/components/misc/player/PlayerComponent.vue +8 -9
- package/src/components/misc/player/PlayerLarge.vue +9 -8
- package/src/components/misc/player/ads/AdsProgressBar.vue +8 -11
- package/src/components/misc/player/ads/AdsSkipButton.vue +24 -30
- package/src/components/misc/player/chaptering/ChapteringModal.vue +44 -54
- package/src/components/misc/player/chaptering/PlayerChaptering.vue +50 -62
- package/src/components/misc/player/elements/PlayerImage.vue +51 -57
- package/src/components/misc/player/elements/PlayerPlayButton.vue +81 -92
- package/src/components/misc/player/elements/PlayerSpeedButton.vue +23 -27
- package/src/components/misc/player/elements/PlayerTitle.vue +85 -111
- package/src/components/misc/player/progressbar/PlayerProgressBar.vue +18 -29
- package/src/components/misc/player/progressbar/PodcastProgressBar.vue +45 -56
- package/src/components/misc/player/radio/RadioHistory.vue +80 -99
- package/src/components/misc/player/radio/RadioProgressBar.vue +43 -54
- package/src/components/misc/player/video/PlayerVideo.vue +27 -40
- package/src/components/misc/player/video/PlayerVideoDigiteka.vue +32 -37
- package/src/components/misc/player/video/PlayerVideoHls.vue +199 -198
- package/src/components/misc/player/video/PlayerYoutubeEmbed.vue +10 -12
- package/src/components/pages/CategoryPage.vue +28 -33
- package/src/components/pages/EmissionPage.vue +113 -132
- package/src/components/pages/EmissionsPage.vue +2 -0
- package/src/components/pages/Error403Page.vue +21 -20
- package/src/components/pages/HomePage.vue +91 -100
- package/src/components/pages/LivesPage.vue +35 -37
- package/src/components/pages/MapPage.vue +209 -241
- package/src/components/pages/PageLogout.vue +8 -11
- package/src/components/pages/PageNotFound.vue +9 -5
- package/src/components/pages/ParticipantPage.vue +96 -110
- package/src/components/pages/ParticipantsPage.vue +3 -0
- package/src/components/pages/PlaylistPage.vue +112 -117
- package/src/components/pages/PlaylistsPage.vue +9 -2
- package/src/components/pages/PodcastPage.vue +224 -238
- package/src/components/pages/PodcastsPage.vue +9 -2
- package/src/components/pages/RadioPage.vue +56 -70
- package/src/components/pages/RubriquePage.vue +7 -3
- package/src/components/pages/SearchPage.vue +31 -36
- package/src/components/pages/TagPage.vue +11 -9
- package/src/components/pages/VideoPage.vue +14 -11
- package/src/helper/displayHelper.ts +1 -1
- package/src/helper/loadScript.ts +4 -4
- package/src/i18n.ts +2 -2
- package/src/main.ts +1 -1
- package/src/router/router.ts +17 -4
- package/src/stores/AuthStore.ts +12 -12
- package/src/stores/FilterStore.ts +1 -1
- package/src/stores/VastStore.ts +2 -2
- package/src/stores/class/general/player.ts +1 -0
- package/public/css/fonts/icomoon.eot +0 -0
- package/public/css/fonts/icomoon.svg +0 -113
- package/public/css/fonts/icomoon.ttf +0 -0
- package/public/css/fonts/icomoon.woff +0 -0
- package/public/css/fonts/icomoon.woff2 +0 -0
- package/public/css/fonts/style.css +0 -352
- package/sonarqube-scanner.js +0 -10
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
:class="[classLabel, displayLabel ? '' : 'd-none']"
|
|
11
11
|
:for="isWysiwyg ? '': inputId"
|
|
12
12
|
>{{ label }}
|
|
13
|
-
<AsteriskIcon v-if="displayRequired" :size="10" class="ms-1 mb-2" :title="
|
|
13
|
+
<AsteriskIcon v-if="displayRequired" :size="10" class="ms-1 mb-2" :title="t('Mandatory input')"/>
|
|
14
14
|
</component>
|
|
15
15
|
<template v-if="popover">
|
|
16
16
|
<button
|
|
17
17
|
:id="'popover' + inputId"
|
|
18
|
-
:title="
|
|
18
|
+
:title="t('Help')"
|
|
19
19
|
class="btn-transparent"
|
|
20
20
|
>
|
|
21
21
|
<HelpCircleIcon :size="30" />
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
}"
|
|
52
52
|
:disabled="isDisable"
|
|
53
53
|
:required="!canBeNull"
|
|
54
|
-
:autocomplete="
|
|
54
|
+
:autocomplete="autocompleteType"
|
|
55
55
|
/>
|
|
56
56
|
<textarea
|
|
57
57
|
v-else-if="isTextarea"
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
@emoji-selected="addEmojiSelected"
|
|
88
88
|
/>
|
|
89
89
|
<div v-if="isWysiwyg" class="h6">
|
|
90
|
-
{{
|
|
90
|
+
{{ t("Characters number calculated over HTML code") }}
|
|
91
91
|
</div>
|
|
92
92
|
<div v-else-if="'' !== indicText" class="text-indic">
|
|
93
93
|
{{ indicText }}
|
|
@@ -110,10 +110,11 @@
|
|
|
110
110
|
</div>
|
|
111
111
|
</div>
|
|
112
112
|
</template>
|
|
113
|
-
<script lang="ts">
|
|
113
|
+
<script setup lang="ts">
|
|
114
114
|
import AsteriskIcon from "vue-material-design-icons/Asterisk.vue";
|
|
115
115
|
import HelpCircleIcon from "vue-material-design-icons/HelpCircle.vue";
|
|
116
|
-
import { defineAsyncComponent,
|
|
116
|
+
import { computed, defineAsyncComponent, onMounted, Ref, ref, useTemplateRef, watch } from "vue";
|
|
117
|
+
import { useI18n } from "vue-i18n";
|
|
117
118
|
const ClassicPopover = defineAsyncComponent(
|
|
118
119
|
() => import("../misc/ClassicPopover.vue"),
|
|
119
120
|
);
|
|
@@ -123,122 +124,117 @@ const ClassicWysiwyg = defineAsyncComponent(
|
|
|
123
124
|
const ClassicEmojiPicker = defineAsyncComponent(
|
|
124
125
|
() => import("./ClassicEmojiPicker.vue"),
|
|
125
126
|
);
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
return
|
|
181
|
-
},
|
|
182
|
-
valueTrimValid(): boolean {
|
|
183
|
-
if (!this.canBeNull) {
|
|
184
|
-
if (!this.textValue) {
|
|
185
|
-
return false;
|
|
186
|
-
}
|
|
187
|
-
return 0 !== this.textValue.trim().length;
|
|
188
|
-
}
|
|
189
|
-
return true;
|
|
190
|
-
},
|
|
191
|
-
valueLengthValid(): boolean {
|
|
192
|
-
if (0 === this.maxLength) {
|
|
193
|
-
return true;
|
|
194
|
-
}
|
|
195
|
-
return this.maxLength >= this.countValue;
|
|
196
|
-
},
|
|
197
|
-
valueRegexValid(): boolean {
|
|
198
|
-
if (this.regex === undefined) {
|
|
199
|
-
return true;
|
|
200
|
-
}
|
|
201
|
-
if (!this.textValue || "" === this.textValue) {
|
|
202
|
-
return this.canBeNull;
|
|
203
|
-
}
|
|
204
|
-
return this.textValue.match(this.regex) !== null;
|
|
205
|
-
},
|
|
206
|
-
},
|
|
207
|
-
watch: {
|
|
208
|
-
forceReload() {
|
|
209
|
-
if (this.textInit !== this.textValue) {
|
|
210
|
-
this.textValue = this.textInit;
|
|
211
|
-
}
|
|
212
|
-
},
|
|
213
|
-
isError() {
|
|
214
|
-
this.$emit("update:errorVariable", this.isError);
|
|
215
|
-
},
|
|
216
|
-
textValue() {
|
|
217
|
-
if (this.textInit !== this.textValue) {
|
|
218
|
-
this.$emit("update:textInit", this.textValue);
|
|
219
|
-
}
|
|
220
|
-
},
|
|
221
|
-
textInit() {
|
|
222
|
-
if (this.textInit !== this.textValue) {
|
|
223
|
-
this.textValue = this.textInit;
|
|
224
|
-
}
|
|
225
|
-
},
|
|
226
|
-
},
|
|
227
|
-
mounted() {
|
|
228
|
-
if (this.focus) {
|
|
229
|
-
(this.$refs.focusElement as HTMLElement)?.focus();
|
|
230
|
-
}
|
|
231
|
-
this.textValue = this.textInit;
|
|
232
|
-
if (this.errorVariable !== this.isError) {
|
|
233
|
-
this.$emit("update:errorVariable", this.isError);
|
|
127
|
+
|
|
128
|
+
//Props
|
|
129
|
+
const props = defineProps({
|
|
130
|
+
inputId: { default: "", type: String },
|
|
131
|
+
label: { default: "", type: String },
|
|
132
|
+
textInit: { default: undefined, type: String },
|
|
133
|
+
maxLength: { default: 0, type: Number },
|
|
134
|
+
errorText: { default: "", type: String },
|
|
135
|
+
isTextarea: { default: false, type: Boolean },
|
|
136
|
+
isWysiwyg: { default: false, type: Boolean },
|
|
137
|
+
regex: { default: undefined, type: RegExp },
|
|
138
|
+
canBeNull: { default: false, type: Boolean },
|
|
139
|
+
inputMaxLengthField: { default: undefined, type: Number },
|
|
140
|
+
errorVariable: { default: true, type: Boolean },
|
|
141
|
+
isDisable: { default: false, type: Boolean },
|
|
142
|
+
indicText: { default: "", type: String },
|
|
143
|
+
dataSelenium: { default: "", type: String },
|
|
144
|
+
placeholder: { default: "", type: String },
|
|
145
|
+
popover: { default: undefined, type: String },
|
|
146
|
+
readonly: { default: false, type: Boolean },
|
|
147
|
+
forceError: { default: false, type: Boolean },
|
|
148
|
+
displayLabel: { default: true, type: Boolean },
|
|
149
|
+
focus: { default: true, type: Boolean },
|
|
150
|
+
isEmojiPicker: { default: false, type: Boolean },
|
|
151
|
+
popoverRelativeClass: { default: undefined, type: String },
|
|
152
|
+
forceReload: { default: false, type: Boolean },
|
|
153
|
+
typeInput: { default: "text", type: String },
|
|
154
|
+
displayRequired: { default: false, type: Boolean },
|
|
155
|
+
classLabel: { default: "form-label", type: String },
|
|
156
|
+
showField: { default: true, type: Boolean },
|
|
157
|
+
autocompleteType: { default: "off", type: String },
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
//Emits
|
|
161
|
+
const emit = defineEmits(["update:textInit", "update:errorVariable"]);
|
|
162
|
+
|
|
163
|
+
//Data
|
|
164
|
+
const textValue : Ref<string | undefined>= ref(undefined);
|
|
165
|
+
const focusElementRef = useTemplateRef('focusElement');
|
|
166
|
+
|
|
167
|
+
//Composables
|
|
168
|
+
const { t } = useI18n();
|
|
169
|
+
|
|
170
|
+
//Computed
|
|
171
|
+
const isError = computed(() => !valueTrimValid.value || !valueLengthValid.value || !valueRegexValid.value);
|
|
172
|
+
const countValue = computed(() => {
|
|
173
|
+
if (textValue.value) {
|
|
174
|
+
return textValue.value.length;
|
|
175
|
+
}
|
|
176
|
+
return 0;
|
|
177
|
+
});
|
|
178
|
+
const valueTrimValid = computed(() => {
|
|
179
|
+
if (!props.canBeNull) {
|
|
180
|
+
if (!textValue.value) {
|
|
181
|
+
return false;
|
|
234
182
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
183
|
+
return 0 !== textValue.value.trim().length;
|
|
184
|
+
}
|
|
185
|
+
return true;
|
|
186
|
+
});
|
|
187
|
+
const valueLengthValid = computed(() => {
|
|
188
|
+
if (0 === props.maxLength) {
|
|
189
|
+
return true;
|
|
190
|
+
}
|
|
191
|
+
return props.maxLength >= countValue.value;
|
|
192
|
+
});
|
|
193
|
+
const valueRegexValid = computed(() => {
|
|
194
|
+
if (props.regex === undefined) {
|
|
195
|
+
return true;
|
|
196
|
+
}
|
|
197
|
+
if (!textValue.value || "" === textValue.value) {
|
|
198
|
+
return props.canBeNull;
|
|
199
|
+
}
|
|
200
|
+
return textValue.value.match(props.regex) !== null;
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
//Watch
|
|
204
|
+
watch(()=>props.forceReload, () => {
|
|
205
|
+
if (props.textInit !== textValue.value) {
|
|
206
|
+
textValue.value = props.textInit;
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
watch(isError, () => {
|
|
210
|
+
emit("update:errorVariable", isError.value);
|
|
241
211
|
});
|
|
212
|
+
watch(textValue, () => {
|
|
213
|
+
if (props.textInit !== textValue.value) {
|
|
214
|
+
emit("update:textInit", textValue.value);
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
watch(()=>props.textInit, () => {
|
|
218
|
+
if (props.textInit !== textValue.value) {
|
|
219
|
+
textValue.value = props.textInit;
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
onMounted(()=>{
|
|
225
|
+
if (props.focus) {
|
|
226
|
+
(focusElementRef?.value as HTMLElement)?.focus();
|
|
227
|
+
}
|
|
228
|
+
textValue.value = props.textInit;
|
|
229
|
+
if (props.errorVariable !== isError.value) {
|
|
230
|
+
emit("update:errorVariable", isError.value);
|
|
231
|
+
}
|
|
232
|
+
})
|
|
233
|
+
|
|
234
|
+
//Methods
|
|
235
|
+
function addEmojiSelected(emoji: string) {
|
|
236
|
+
textValue.value = (textValue.value ?? "") + emoji;
|
|
237
|
+
}
|
|
242
238
|
</script>
|
|
243
239
|
<style lang="scss">
|
|
244
240
|
.octopus-app .classic-input-text {
|
|
@@ -13,17 +13,12 @@
|
|
|
13
13
|
</div>
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
|
-
<script lang="ts">
|
|
16
|
+
<script setup lang="ts">
|
|
17
17
|
import ClassicSpinner from "../misc/ClassicSpinner.vue";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
props: {
|
|
25
|
-
loadingText: { default: undefined, type: String },
|
|
26
|
-
errorText: { default: undefined, type: String },
|
|
27
|
-
},
|
|
28
|
-
});
|
|
18
|
+
|
|
19
|
+
//Props
|
|
20
|
+
defineProps({
|
|
21
|
+
loadingText: { default: undefined, type: String },
|
|
22
|
+
errorText: { default: undefined, type: String },
|
|
23
|
+
})
|
|
29
24
|
</script>
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
'multiselect-no-deselect': noDeselect,
|
|
6
6
|
'form-margin': displayLabel,
|
|
7
7
|
}"
|
|
8
|
-
:style="{ width: width }"
|
|
8
|
+
:style="{ width: width, height: height }"
|
|
9
9
|
>
|
|
10
10
|
<label :class="displayLabel ? '' : 'd-none'" :for="id" class="form-label">{{
|
|
11
11
|
label
|
|
12
12
|
}}
|
|
13
|
-
<AsteriskIcon v-if="displayRequired" :size="10" class="ms-1 mb-2" :title="
|
|
13
|
+
<AsteriskIcon v-if="displayRequired" :size="10" class="ms-1 mb-2" :title="t('Mandatory input')"/>
|
|
14
14
|
</label>
|
|
15
15
|
<vSelect
|
|
16
16
|
v-model="optionSelected"
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"
|
|
29
29
|
:filter="fakeSearch"
|
|
30
30
|
:selectable="() => !maxOptionsSelected"
|
|
31
|
+
:style="{height: height }"
|
|
31
32
|
:class="{ 'border border-danger': textDanger?.length }"
|
|
32
33
|
@open="onSearch"
|
|
33
34
|
@search="onSearch"
|
|
@@ -46,14 +47,14 @@
|
|
|
46
47
|
</template>
|
|
47
48
|
<template #no-options="{ searching }">
|
|
48
49
|
<span v-if="searching">{{
|
|
49
|
-
|
|
50
|
+
t("No elements found. Consider changing the search query.")
|
|
50
51
|
}}</span>
|
|
51
|
-
<span v-else>{{
|
|
52
|
+
<span v-else>{{ t("List is empty") }}</span>
|
|
52
53
|
</template>
|
|
53
54
|
<template #list-footer>
|
|
54
55
|
<div v-if="remainingElements" class="vs__dropdown-option">
|
|
55
56
|
{{
|
|
56
|
-
|
|
57
|
+
t(
|
|
57
58
|
"Count more elements matched your query, please make a more specific search.",
|
|
58
59
|
{ count: remainingElements },
|
|
59
60
|
)
|
|
@@ -62,7 +63,7 @@
|
|
|
62
63
|
</template>
|
|
63
64
|
<template #list-header>
|
|
64
65
|
<div v-if="maxOptionsSelected" class="vs__dropdown-option">
|
|
65
|
-
{{
|
|
66
|
+
{{ t("Multiselect max options", { max: maxOptions }) }}
|
|
66
67
|
</div>
|
|
67
68
|
</template>
|
|
68
69
|
<template #open-indicator="{ attributes }">
|
|
@@ -75,120 +76,116 @@
|
|
|
75
76
|
</div>
|
|
76
77
|
</template>
|
|
77
78
|
|
|
78
|
-
<script lang="ts">
|
|
79
|
+
<script setup lang="ts">
|
|
80
|
+
import { computed, ref, Ref, watch } from "vue";
|
|
81
|
+
import { useI18n } from "vue-i18n";
|
|
79
82
|
import AsteriskIcon from "vue-material-design-icons/Asterisk.vue";
|
|
80
83
|
import ChevronDownIcon from "vue-material-design-icons/ChevronDown.vue";
|
|
81
84
|
import vSelect from "vue-select";
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
this.$emit("selected", this.optionSelected);
|
|
189
|
-
},
|
|
190
|
-
},
|
|
191
|
-
};
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
//Props
|
|
88
|
+
const props = defineProps({
|
|
89
|
+
id: { default: "", type: String },
|
|
90
|
+
label: { default: "", type: String },
|
|
91
|
+
placeholder: { default: "", type: String },
|
|
92
|
+
optionLabel: { default: "", type: String },
|
|
93
|
+
inModal: { default: false, type: Boolean },
|
|
94
|
+
multiple: { default: false, type: Boolean },
|
|
95
|
+
isDisabled: { default: false, type: Boolean },
|
|
96
|
+
width: { default: "100%", type: String },
|
|
97
|
+
height: { default: undefined, type: String },
|
|
98
|
+
maxElement: { default: 50, type: Number },
|
|
99
|
+
minSearchLength: { default: 3, type: Number },
|
|
100
|
+
optionChosen: { default: undefined, type: Object as () => unknown },
|
|
101
|
+
noDeselect: { default: true, type: Boolean },
|
|
102
|
+
optionCustomTemplating: { default: "", type: String },
|
|
103
|
+
optionSelectedCustomTemplating: { default: "", type: String },
|
|
104
|
+
displayLabel: { default: false, type: Boolean },
|
|
105
|
+
maxOptions: { default: null, type: Number },
|
|
106
|
+
allowEmpty: { default: true, type: Boolean },
|
|
107
|
+
textDanger :{ default: undefined, type: String },
|
|
108
|
+
displayRequired: { default: false, type: Boolean },
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
//Emits
|
|
112
|
+
const emit = defineEmits(["onSearch", "selected", "onClose"]);
|
|
113
|
+
|
|
114
|
+
//Data
|
|
115
|
+
const optionSelected : Ref<unknown>= ref(undefined);
|
|
116
|
+
const options : Ref<Array<unknown>>= ref([]);
|
|
117
|
+
const remainingElements = ref(0);
|
|
118
|
+
const isLoading = ref(false);
|
|
119
|
+
const searchInput = ref("");
|
|
120
|
+
|
|
121
|
+
//Composables
|
|
122
|
+
const { t } = useI18n();
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
//Computed
|
|
126
|
+
const maxOptionsSelected = computed(() => {
|
|
127
|
+
if (props.maxOptions !== null && props.multiple) {
|
|
128
|
+
return (
|
|
129
|
+
(optionSelected.value as Array<unknown>).length >= props.maxOptions
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
return false;
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
//Watch
|
|
136
|
+
watch(()=>props.optionChosen, () => {
|
|
137
|
+
optionSelected.value = props.optionChosen;
|
|
138
|
+
}, {deep: true, immediate: true});
|
|
139
|
+
watch(optionSelected, () => {
|
|
140
|
+
if (props.noDeselect || null !== optionSelected.value) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
emit("selected", undefined);
|
|
144
|
+
}, {deep: true});
|
|
145
|
+
|
|
146
|
+
//Methods
|
|
147
|
+
function fakeSearch(): Array<unknown> {
|
|
148
|
+
return options.value;
|
|
149
|
+
}
|
|
150
|
+
function onSearch(search?: string): void {
|
|
151
|
+
if (search && search.length < props.minSearchLength) {
|
|
152
|
+
return;
|
|
153
|
+
} else if (search) {
|
|
154
|
+
searchInput.value = search;
|
|
155
|
+
}
|
|
156
|
+
isLoading.value = true;
|
|
157
|
+
emit("onSearch", search);
|
|
158
|
+
}
|
|
159
|
+
function onClose() {
|
|
160
|
+
emit("onClose", searchInput.value);
|
|
161
|
+
searchInput.value = "";
|
|
162
|
+
}
|
|
163
|
+
function afterSearch(optionsFetched: Array<unknown>, count: number): void {
|
|
164
|
+
options.value = optionsFetched;
|
|
165
|
+
remainingElements.value = Math.max(0, count - props.maxElement);
|
|
166
|
+
isLoading.value = false;
|
|
167
|
+
}
|
|
168
|
+
function onOptionSelected(optionSelected: unknown): void {
|
|
169
|
+
emit("selected", optionSelected);
|
|
170
|
+
}
|
|
171
|
+
function onOptionDeselect(event: unknown): void {
|
|
172
|
+
if (!props.multiple) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
if (
|
|
176
|
+
!props.allowEmpty &&
|
|
177
|
+
0 === (optionSelected.value as Array<unknown>).length
|
|
178
|
+
) {
|
|
179
|
+
(optionSelected.value as Array<unknown>).push(event);
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
emit("selected", optionSelected.value);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
//Expose
|
|
186
|
+
defineExpose({
|
|
187
|
+
afterSearch
|
|
188
|
+
});
|
|
192
189
|
</script>
|
|
193
190
|
<style lang="scss">
|
|
194
191
|
@use "vue-select/dist/vue-select.css";
|
|
@@ -214,6 +211,7 @@ export default {
|
|
|
214
211
|
|
|
215
212
|
.vs__dropdown-toggle {
|
|
216
213
|
padding: 0;
|
|
214
|
+
height: 100%;
|
|
217
215
|
}
|
|
218
216
|
|
|
219
217
|
.vs__search:focus {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
:name="idRadio"
|
|
14
14
|
:value="option.value"
|
|
15
15
|
:disabled="isDisabled"
|
|
16
|
-
@input="
|
|
16
|
+
@input="onChange($event.target.value)"
|
|
17
17
|
/>
|
|
18
18
|
<label class="c-hand" :for="idRadio + option.value">{{
|
|
19
19
|
option.title
|
|
@@ -22,21 +22,26 @@
|
|
|
22
22
|
</div>
|
|
23
23
|
</template>
|
|
24
24
|
|
|
25
|
-
<script lang="ts">
|
|
26
|
-
import { defineComponent } from "vue";
|
|
27
|
-
export default defineComponent({
|
|
28
|
-
name: "ClassicRadio",
|
|
25
|
+
<script setup lang="ts">
|
|
29
26
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
textInit: { default: undefined, type: String },
|
|
38
|
-
isColumn: { default: true, type: Boolean },
|
|
27
|
+
//Props
|
|
28
|
+
defineProps({
|
|
29
|
+
idRadio: { default: "", type: String },
|
|
30
|
+
isDisabled: { default: false, type: Boolean },
|
|
31
|
+
options: {
|
|
32
|
+
default: () => [],
|
|
33
|
+
type: Array as () => Array<{ title: string; value: string | undefined }>,
|
|
39
34
|
},
|
|
40
|
-
|
|
41
|
-
}
|
|
35
|
+
textInit: { default: undefined, type: String },
|
|
36
|
+
isColumn: { default: true, type: Boolean },
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
//Emits
|
|
40
|
+
const emit = defineEmits(["update:textInit"]);
|
|
41
|
+
|
|
42
|
+
//Methods
|
|
43
|
+
function onChange(value:string){
|
|
44
|
+
emit('update:textInit', value)
|
|
45
|
+
}
|
|
46
|
+
|
|
42
47
|
</script>
|