@saooti/octopus-sdk 1.0.0 → 1.1.1
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/README.md +261 -0
- package/index.d.ts +4 -0
- package/index.ts +55 -3
- package/package.json +53 -45
- package/public/config.ts +4 -0
- package/public/css/fonts/icomoon.eot +0 -0
- package/public/css/fonts/icomoon.svg +129 -0
- package/public/css/fonts/icomoon.ttf +0 -0
- package/public/css/fonts/icomoon.woff +0 -0
- package/public/css/fonts/style.css +186 -1224
- package/public/img/403.jpeg +0 -0
- package/public/img/404.svg +242 -0
- package/public/img/ACPM.png +0 -0
- package/public/img/ouest_france_logo.svg +12 -0
- package/src/App.vue +102 -31
- package/src/api/classicCrud.ts +34 -0
- package/src/api/initialize.ts +5 -2
- package/src/assets/bootstrap-diff.scss +197 -0
- package/src/assets/form.scss +77 -77
- package/src/assets/general.scss +284 -272
- package/src/assets/live.scss +39 -0
- package/src/assets/modal.scss +43 -50
- package/src/assets/multiselect.scss +522 -573
- package/src/assets/octopus-library.scss +18 -4
- package/src/assets/share.scss +243 -0
- package/src/assets/transition.scss +98 -2
- package/src/components/display/aggregator/RssSection.vue +3 -5
- package/src/components/display/categories/CategoryChooser.vue +151 -114
- package/src/components/display/categories/CategoryFilter.vue +162 -0
- package/src/components/display/categories/CategoryList.vue +149 -117
- package/src/components/display/comments/AddCommentModal.vue +103 -108
- package/src/components/display/comments/CommentBasicView.vue +95 -0
- package/src/components/display/comments/CommentInput.vue +195 -183
- package/src/components/display/comments/CommentItem.vue +170 -208
- package/src/components/display/comments/CommentList.vue +134 -228
- package/src/components/display/comments/CommentParentInfo.vue +28 -62
- package/src/components/display/comments/CommentPlayer.vue +53 -56
- package/src/components/display/comments/CommentSection.vue +52 -83
- package/src/components/display/edit/EditBox.vue +10 -4
- package/src/components/display/edit/EditCommentBox.vue +124 -38
- package/src/components/display/emission/EmissionChooser.vue +88 -108
- package/src/components/display/emission/EmissionInlineList.vue +156 -157
- package/src/components/display/emission/EmissionItem.vue +72 -226
- package/src/components/display/emission/EmissionList.vue +159 -201
- package/src/components/display/emission/EmissionPlayerItem.vue +203 -174
- package/src/components/display/filter/AdvancedSearch.vue +224 -432
- package/src/components/display/filter/CategoryFilter.vue +105 -0
- package/src/components/display/filter/MonetizableFilter.vue +18 -15
- package/src/components/display/filter/ProductorSearch.vue +153 -176
- package/src/components/display/filter/RubriqueChoice.vue +97 -0
- package/src/components/display/filter/RubriqueFilter.vue +232 -0
- package/src/components/display/list/ListPaginate.vue +145 -0
- package/src/components/display/list/Paginate.vue +218 -0
- package/src/components/display/live/CountDown.vue +31 -30
- package/src/components/display/live/LiveHorizontalList.vue +84 -62
- package/src/components/display/live/LiveItem.vue +161 -186
- package/src/components/display/live/LiveList.vue +184 -295
- package/src/components/display/organisation/OrganisationChooser.vue +124 -162
- package/src/components/display/organisation/OrganisationChooserLight.vue +53 -56
- package/src/components/display/participant/ParticipantItem.vue +91 -128
- package/src/components/display/participant/ParticipantList.vue +134 -121
- package/src/components/display/playlist/PlaylistItem.vue +60 -97
- package/src/components/display/playlist/PlaylistList.vue +99 -92
- package/src/components/display/playlist/PodcastList.vue +117 -132
- package/src/components/display/playlist/PodcastPlaylistInlineList.vue +191 -0
- package/src/components/display/podcasts/AnimatorsItem.vue +29 -37
- package/src/components/display/podcasts/ParticipantDescription.vue +82 -0
- package/src/components/display/podcasts/PodcastFilterList.vue +49 -102
- package/src/components/display/podcasts/PodcastImage.vue +208 -225
- package/src/components/display/podcasts/PodcastInlineList.vue +62 -355
- package/src/components/display/podcasts/PodcastInlineListClassic.vue +240 -0
- package/src/components/display/podcasts/PodcastInlineListTemplate.vue +167 -0
- package/src/components/display/podcasts/PodcastItem.vue +94 -218
- package/src/components/display/podcasts/PodcastItemInfo.vue +166 -0
- package/src/components/display/podcasts/PodcastList.vue +127 -178
- package/src/components/display/podcasts/PodcastModuleBox.vue +234 -0
- package/src/components/display/podcasts/PodcastPlayBar.vue +101 -0
- package/src/components/display/podcasts/PodcastSwiperList.vue +204 -0
- package/src/components/display/podcasts/TagList.vue +60 -38
- package/src/components/display/rubriques/RubriqueChooser.vue +144 -131
- package/src/components/display/rubriques/RubriqueList.vue +216 -0
- package/src/components/display/sharing/PlayerParameters.vue +111 -153
- package/src/components/display/sharing/QrCode.vue +96 -0
- package/src/components/display/sharing/ShareButtons.vue +63 -233
- package/src/components/display/sharing/ShareButtonsIntern.vue +225 -0
- package/src/components/display/sharing/ShareDistribution.vue +102 -166
- package/src/components/display/sharing/SharePlayer.vue +189 -353
- package/src/components/display/sharing/SharePlayerColors.vue +78 -0
- package/src/components/display/sharing/SharePlayerTypes.vue +112 -0
- package/src/components/display/sharing/SplitButton.vue +42 -0
- package/src/components/display/sharing/SubscribeButtons.vue +65 -118
- package/src/components/display/studio/RecordingItemButton.vue +3 -5
- package/src/components/form/ClassicCheckbox.vue +66 -0
- package/src/components/form/ClassicLoading.vue +28 -0
- package/src/components/form/ClassicRadio.vue +66 -0
- package/src/components/form/ClassicSearch.vue +86 -0
- package/src/components/form/ClassicSelect.vue +65 -0
- package/src/components/misc/ErrorMessage.vue +27 -18
- package/src/components/misc/Footer.vue +151 -108
- package/src/components/misc/HomeDropdown.vue +95 -154
- package/src/components/misc/LeftMenu.vue +137 -206
- package/src/components/misc/Popover.vue +118 -0
- package/src/components/misc/Snackbar.vue +73 -37
- package/src/components/misc/TopBar.vue +211 -314
- package/src/components/misc/modal/ClipboardModal.vue +34 -47
- package/src/components/misc/modal/MessageModal.vue +74 -53
- package/src/components/misc/modal/NewsletterModal.vue +272 -224
- package/src/components/misc/modal/QrCodeModal.vue +58 -0
- package/src/components/misc/modal/ShareModalPlayer.vue +140 -74
- package/src/components/misc/player/Player.vue +146 -0
- package/src/components/misc/player/PlayerCompact.vue +154 -0
- package/src/components/misc/player/PlayerLarge.vue +166 -0
- package/src/components/misc/player/PlayerProgressBar.vue +112 -0
- package/src/components/misc/player/PlayerTimeline.vue +61 -0
- package/src/components/mixins/functions.ts +21 -18
- package/src/components/mixins/handle403.ts +17 -0
- package/src/components/mixins/init.ts +24 -0
- package/src/components/mixins/orgaComputed.ts +15 -0
- package/src/components/mixins/organisationFilter.ts +41 -0
- package/src/components/mixins/player/playerComment.ts +98 -0
- package/src/components/mixins/player/playerDisplay.ts +113 -0
- package/src/components/mixins/player/playerLive.ts +111 -0
- package/src/components/mixins/player/playerLogic.ts +225 -0
- package/src/components/mixins/tagOfMixins.ts +19 -0
- package/src/components/pages/Category.vue +24 -28
- package/src/components/pages/Emission.vue +144 -177
- package/src/components/pages/Emissions.vue +94 -110
- package/src/components/pages/Error403Page.vue +60 -0
- package/src/components/pages/Home.vue +74 -21
- package/src/components/pages/Lives.vue +53 -58
- package/src/components/pages/PageNotFound.vue +55 -0
- package/src/components/pages/Participant.vue +113 -129
- package/src/components/pages/Participants.vue +25 -41
- package/src/components/pages/Playlist.vue +86 -86
- package/src/components/pages/Playlists.vue +33 -52
- package/src/components/pages/Podcast.vue +206 -478
- package/src/components/pages/Podcasts.vue +112 -156
- package/src/components/pages/Rubrique.vue +21 -27
- package/src/components/pages/Search.vue +37 -94
- package/src/helper/dom.ts +2 -2
- package/src/helper/duration.ts +18 -8
- package/src/helper/useEventListener.ts +18 -0
- package/src/i18n.ts +36 -0
- package/src/locale/de.ts +309 -0
- package/src/locale/educationen.ts +14 -0
- package/src/locale/en.ts +316 -1
- package/src/locale/es.ts +309 -0
- package/src/locale/fr.ts +47 -15
- package/src/locale/it.ts +307 -0
- package/src/locale/messages.ts +11 -2
- package/src/locale/sl.ts +309 -0
- package/src/main.ts +64 -55
- package/src/router/router.ts +192 -159
- package/src/sass/_variables.scss +10 -8
- package/src/shims-tsx.d.ts +15 -0
- package/src/shims-vue-recaptcha-v3.d.ts +9 -0
- package/src/shims-vue.d.ts +5 -6
- package/src/store/AppStore.ts +41 -173
- package/src/store/class/adserver/adserverConfig.ts +9 -0
- package/src/store/class/adserver/adserverOtherEmission.ts +13 -0
- package/src/store/class/adserver/adserverTiming.ts +10 -0
- package/src/store/class/cartouchier/cartouche.ts +15 -0
- package/src/store/class/cartouchier/cartouchier.ts +9 -0
- package/src/store/class/conference/conference.ts +35 -0
- package/src/store/class/conference/conferenceMessage.ts +10 -0
- package/src/store/class/conference/conferenceParticipant.ts +18 -0
- package/src/store/class/conference/pad.ts +15 -0
- package/src/store/class/conference/studioCall.ts +7 -0
- package/src/store/class/contract/contract.ts +7 -0
- package/src/store/class/contract/contractOrganisation.ts +7 -0
- package/src/store/class/ftp/ftpEmission.ts +41 -0
- package/src/store/class/ftp/ftpParam.ts +12 -0
- package/src/store/class/ftp/testFtpEmission.ts +5 -0
- package/src/store/class/general/audioView.ts +21 -0
- package/src/store/class/general/category.ts +10 -0
- package/src/store/class/general/comment.ts +16 -0
- package/src/store/class/general/customPlayer.ts +9 -0
- package/src/store/class/general/emission.ts +23 -0
- package/src/store/class/general/fetchParam.ts +3 -0
- package/src/store/class/general/initState.ts +25 -0
- package/src/store/class/general/interfacePageable.ts +16 -0
- package/src/store/class/general/ituneCategory.ts +5 -0
- package/src/store/class/general/media.ts +14 -0
- package/src/store/class/general/organisation.ts +20 -0
- package/src/store/class/general/pageable.ts +13 -0
- package/src/store/class/general/participant.ts +12 -0
- package/src/store/class/general/player.ts +14 -0
- package/src/store/class/general/playlist.ts +13 -0
- package/src/store/class/general/podcast.ts +43 -0
- package/src/store/class/general/sortPageable.ts +5 -0
- package/src/store/class/general/soundcastCategory.ts +8 -0
- package/src/store/class/ouestFrance/ofTag.ts +36 -0
- package/src/store/class/ouestFrance/ofTagInfo.ts +9 -0
- package/src/store/class/ouestFrance/ofTagPage.ts +7 -0
- package/src/store/class/ouestFrance/ofTagSeo.ts +7 -0
- package/src/store/class/ouestFrance/ofTagVente.ts +6 -0
- package/src/store/class/ouestFrance/ofTagWithParents.ts +26 -0
- package/src/store/class/rss/aggregator.ts +28 -0
- package/src/store/class/rss/rssEmission.ts +14 -0
- package/src/store/class/rss/rssInfo.ts +8 -0
- package/src/store/class/rubrique/rubriquage.ts +10 -0
- package/src/store/class/rubrique/rubriquageFilter.ts +6 -0
- package/src/store/class/rubrique/rubrique.ts +9 -0
- package/src/store/class/stat/statArrayIncome.ts +6 -0
- package/src/store/class/stat/statArrayObject.ts +34 -0
- package/src/store/class/stat/statGraph.ts +7 -0
- package/src/store/class/user/person.ts +15 -0
- package/src/store/class/user/profile.ts +12 -0
- package/src/store/class/user/userKeycloak.ts +24 -0
- package/src/store/paramStore.ts +222 -217
- package/src/store/typeAppStore.ts +186 -235
- package/src/vuex-shim.d.ts +8 -0
- package/tsconfig.json +4 -0
- package/vue.config.js +16 -0
- package/public/css/fonts/saooti-ui.eot +0 -0
- package/public/css/fonts/saooti-ui.svg +0 -829
- package/public/css/fonts/saooti-ui.ttf +0 -0
- package/public/css/fonts/saooti-ui.woff +0 -0
- package/public/css/fonts/stitcher-logo.svg +0 -83
- package/public/img/ACPM.PNG +0 -0
- package/src/api/comments.ts +0 -7
- package/src/api/emissions.ts +0 -7
- package/src/api/podcasts.ts +0 -7
- package/src/api/profile.ts +0 -8
- package/src/api/studio.ts +0 -1
- package/src/assets/bootstrap_scss/_alert.scss +0 -51
- package/src/assets/bootstrap_scss/_badge.scss +0 -54
- package/src/assets/bootstrap_scss/_breadcrumb.scss +0 -42
- package/src/assets/bootstrap_scss/_button-group.scss +0 -164
- package/src/assets/bootstrap_scss/_buttons.scss +0 -291
- package/src/assets/bootstrap_scss/_card.scss +0 -278
- package/src/assets/bootstrap_scss/_carousel.scss +0 -197
- package/src/assets/bootstrap_scss/_close.scss +0 -41
- package/src/assets/bootstrap_scss/_code.scss +0 -48
- package/src/assets/bootstrap_scss/_custom-forms.scss +0 -522
- package/src/assets/bootstrap_scss/_dropdown.scss +0 -201
- package/src/assets/bootstrap_scss/_forms.scss +0 -352
- package/src/assets/bootstrap_scss/_functions.scss +0 -134
- package/src/assets/bootstrap_scss/_grid.scss +0 -69
- package/src/assets/bootstrap_scss/_images.scss +0 -42
- package/src/assets/bootstrap_scss/_input-group.scss +0 -191
- package/src/assets/bootstrap_scss/_jumbotron.scss +0 -17
- package/src/assets/bootstrap_scss/_list-group.scss +0 -158
- package/src/assets/bootstrap_scss/_media.scss +0 -8
- package/src/assets/bootstrap_scss/_mixins.scss +0 -47
- package/src/assets/bootstrap_scss/_modal.scss +0 -243
- package/src/assets/bootstrap_scss/_nav.scss +0 -120
- package/src/assets/bootstrap_scss/_navbar.scss +0 -324
- package/src/assets/bootstrap_scss/_pagination.scss +0 -74
- package/src/assets/bootstrap_scss/_popover.scss +0 -170
- package/src/assets/bootstrap_scss/_print.scss +0 -141
- package/src/assets/bootstrap_scss/_progress.scss +0 -46
- package/src/assets/bootstrap_scss/_reboot.scss +0 -482
- package/src/assets/bootstrap_scss/_root.scss +0 -20
- package/src/assets/bootstrap_scss/_spinners.scss +0 -55
- package/src/assets/bootstrap_scss/_tables.scss +0 -185
- package/src/assets/bootstrap_scss/_toasts.scss +0 -44
- package/src/assets/bootstrap_scss/_tooltip.scss +0 -115
- package/src/assets/bootstrap_scss/_transitions.scss +0 -20
- package/src/assets/bootstrap_scss/_type.scss +0 -125
- package/src/assets/bootstrap_scss/_utilities.scss +0 -17
- package/src/assets/bootstrap_scss/_variables.scss +0 -1145
- package/src/assets/bootstrap_scss/bootstrap-grid.scss +0 -29
- package/src/assets/bootstrap_scss/bootstrap-reboot.scss +0 -12
- package/src/assets/bootstrap_scss/bootstrap.scss +0 -44
- package/src/assets/bootstrap_scss/mixins/_alert.scss +0 -13
- package/src/assets/bootstrap_scss/mixins/_background-variant.scss +0 -22
- package/src/assets/bootstrap_scss/mixins/_badge.scss +0 -17
- package/src/assets/bootstrap_scss/mixins/_border-radius.scss +0 -63
- package/src/assets/bootstrap_scss/mixins/_box-shadow.scss +0 -20
- package/src/assets/bootstrap_scss/mixins/_breakpoints.scss +0 -123
- package/src/assets/bootstrap_scss/mixins/_buttons.scss +0 -110
- package/src/assets/bootstrap_scss/mixins/_caret.scss +0 -62
- package/src/assets/bootstrap_scss/mixins/_clearfix.scss +0 -7
- package/src/assets/bootstrap_scss/mixins/_deprecate.scss +0 -10
- package/src/assets/bootstrap_scss/mixins/_float.scss +0 -14
- package/src/assets/bootstrap_scss/mixins/_forms.scss +0 -177
- package/src/assets/bootstrap_scss/mixins/_gradients.scss +0 -45
- package/src/assets/bootstrap_scss/mixins/_grid-framework.scss +0 -71
- package/src/assets/bootstrap_scss/mixins/_grid.scss +0 -69
- package/src/assets/bootstrap_scss/mixins/_hover.scss +0 -37
- package/src/assets/bootstrap_scss/mixins/_image.scss +0 -36
- package/src/assets/bootstrap_scss/mixins/_list-group.scss +0 -21
- package/src/assets/bootstrap_scss/mixins/_lists.scss +0 -7
- package/src/assets/bootstrap_scss/mixins/_nav-divider.scss +0 -11
- package/src/assets/bootstrap_scss/mixins/_pagination.scss +0 -22
- package/src/assets/bootstrap_scss/mixins/_reset-text.scss +0 -17
- package/src/assets/bootstrap_scss/mixins/_resize.scss +0 -6
- package/src/assets/bootstrap_scss/mixins/_screen-reader.scss +0 -34
- package/src/assets/bootstrap_scss/mixins/_size.scss +0 -7
- package/src/assets/bootstrap_scss/mixins/_table-row.scss +0 -39
- package/src/assets/bootstrap_scss/mixins/_text-emphasis.scss +0 -17
- package/src/assets/bootstrap_scss/mixins/_text-hide.scss +0 -11
- package/src/assets/bootstrap_scss/mixins/_text-truncate.scss +0 -8
- package/src/assets/bootstrap_scss/mixins/_transition.scss +0 -16
- package/src/assets/bootstrap_scss/mixins/_visibility.scss +0 -8
- package/src/assets/bootstrap_scss/utilities/_align.scss +0 -8
- package/src/assets/bootstrap_scss/utilities/_background.scss +0 -19
- package/src/assets/bootstrap_scss/utilities/_borders.scss +0 -75
- package/src/assets/bootstrap_scss/utilities/_clearfix.scss +0 -3
- package/src/assets/bootstrap_scss/utilities/_display.scss +0 -26
- package/src/assets/bootstrap_scss/utilities/_embed.scss +0 -39
- package/src/assets/bootstrap_scss/utilities/_flex.scss +0 -51
- package/src/assets/bootstrap_scss/utilities/_float.scss +0 -11
- package/src/assets/bootstrap_scss/utilities/_overflow.scss +0 -5
- package/src/assets/bootstrap_scss/utilities/_position.scss +0 -32
- package/src/assets/bootstrap_scss/utilities/_screenreaders.scss +0 -11
- package/src/assets/bootstrap_scss/utilities/_shadows.scss +0 -6
- package/src/assets/bootstrap_scss/utilities/_sizing.scss +0 -20
- package/src/assets/bootstrap_scss/utilities/_spacing.scss +0 -73
- package/src/assets/bootstrap_scss/utilities/_stretched-link.scss +0 -19
- package/src/assets/bootstrap_scss/utilities/_text.scss +0 -72
- package/src/assets/bootstrap_scss/utilities/_visibility.scss +0 -13
- package/src/assets/bootstrap_scss/vendor/_rfs.scss +0 -204
- package/src/components/misc/Player.vue +0 -792
- package/src/shims-vuex.d.ts +0 -7
- package/src/views/Home.vue +0 -18
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:id="id"
|
|
4
|
+
ref="element"
|
|
5
|
+
class="popover"
|
|
6
|
+
role="tooltip"
|
|
7
|
+
tabindex="-1"
|
|
8
|
+
>
|
|
9
|
+
<div ref="titleRef">
|
|
10
|
+
<slot name="title">
|
|
11
|
+
{{ title }}
|
|
12
|
+
</slot>
|
|
13
|
+
</div>
|
|
14
|
+
<div ref="contentRef">
|
|
15
|
+
<slot>
|
|
16
|
+
{{ content }}
|
|
17
|
+
</slot>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script lang="ts">
|
|
23
|
+
import {Popover} from 'bootstrap'
|
|
24
|
+
import {defineComponent, onMounted, PropType, ref} from 'vue'
|
|
25
|
+
import useEventListener from '../../helper/useEventListener'
|
|
26
|
+
export default defineComponent({
|
|
27
|
+
name: 'Popover',
|
|
28
|
+
props: {
|
|
29
|
+
content: {type: String, default: ''},
|
|
30
|
+
id: {type: String, default: ''},
|
|
31
|
+
noninteractive: {type: Boolean, default: false},
|
|
32
|
+
placement: {type: String as PropType<Popover.Options['placement']>, default: 'right'},
|
|
33
|
+
target: {type: String, required: true},
|
|
34
|
+
title: {type: String, default: ''},
|
|
35
|
+
show: {type: Boolean, default: false},
|
|
36
|
+
disable: {type: Boolean, default: false},
|
|
37
|
+
},
|
|
38
|
+
emits: ['show', 'shown', 'hide', 'hidden', 'inserted'],
|
|
39
|
+
setup(props, {emit}) {
|
|
40
|
+
const element = ref<HTMLElement>()
|
|
41
|
+
const target = ref<HTMLElement>()
|
|
42
|
+
const instance = ref<Popover>()
|
|
43
|
+
const titleRef = ref<HTMLElement>()
|
|
44
|
+
const contentRef = ref<HTMLElement>()
|
|
45
|
+
function initPopover(){
|
|
46
|
+
instance.value = new Popover(`#${props.target}`, {
|
|
47
|
+
container: 'body',
|
|
48
|
+
trigger: "hover focus",
|
|
49
|
+
placement: props.placement,
|
|
50
|
+
title: titleRef.value?.innerHTML || '',
|
|
51
|
+
content: contentRef.value?.innerHTML || '',
|
|
52
|
+
html: true,
|
|
53
|
+
})
|
|
54
|
+
if (document.getElementById(props.target)) {
|
|
55
|
+
target.value = document.getElementById(props.target) as HTMLElement
|
|
56
|
+
}
|
|
57
|
+
element.value?.parentNode?.removeChild(element.value)
|
|
58
|
+
if (props.show) {
|
|
59
|
+
instance.value.show()
|
|
60
|
+
}
|
|
61
|
+
if (props.disable) {
|
|
62
|
+
instance.value.disable()
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
onMounted(()=>{
|
|
66
|
+
initPopover();
|
|
67
|
+
})
|
|
68
|
+
useEventListener(target, 'show.bs.popover', () => emit('show'))
|
|
69
|
+
useEventListener(target, 'shown.bs.popover', () => emit('shown'))
|
|
70
|
+
useEventListener(target, 'hide.bs.popover', () => emit('hide'))
|
|
71
|
+
useEventListener(target, 'hidden.bs.popover', () => emit('hidden'))
|
|
72
|
+
useEventListener(target, 'inserted.bs.popover', () => emit('inserted'))
|
|
73
|
+
return {
|
|
74
|
+
element,
|
|
75
|
+
titleRef,
|
|
76
|
+
contentRef,
|
|
77
|
+
instance,
|
|
78
|
+
initPopover
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
watch:{
|
|
82
|
+
disable(){
|
|
83
|
+
if(!this.instance){ return; }
|
|
84
|
+
if (this.disable) {
|
|
85
|
+
this.instance.disable();
|
|
86
|
+
} else {
|
|
87
|
+
this.instance.enable();
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
content(){
|
|
91
|
+
if(!this.instance){ return; }
|
|
92
|
+
this.$nextTick(() => {
|
|
93
|
+
this.instance?.dispose();
|
|
94
|
+
this.initPopover();
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
title(){
|
|
98
|
+
if(!this.instance){ return; }
|
|
99
|
+
this.$nextTick(() => {
|
|
100
|
+
this.instance?.dispose();
|
|
101
|
+
this.initPopover();
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
})
|
|
107
|
+
</script>
|
|
108
|
+
<style lang="scss">
|
|
109
|
+
.octopus-app{
|
|
110
|
+
.popover{
|
|
111
|
+
max-height: 80vh;
|
|
112
|
+
overflow: auto;
|
|
113
|
+
hr{
|
|
114
|
+
width: 100px;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
</style>
|
|
@@ -1,33 +1,40 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
2
|
+
<div
|
|
3
|
+
class="snack-bar-wrap"
|
|
4
|
+
:style="style.wrap"
|
|
5
|
+
>
|
|
6
|
+
<template
|
|
7
|
+
v-for="(msg, i) in msgs"
|
|
8
|
+
:key="i"
|
|
9
|
+
>
|
|
4
10
|
<div
|
|
5
11
|
class="snack-bar"
|
|
6
12
|
:style="style.bar(msg.color)"
|
|
7
13
|
@click="pop(i)"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
>
|
|
15
|
+
{{ msg.msg.message || msg.msg }}
|
|
16
|
+
</div>
|
|
17
|
+
<br>
|
|
11
18
|
</template>
|
|
12
19
|
</div>
|
|
13
20
|
</template>
|
|
14
21
|
|
|
15
22
|
<script lang="ts">
|
|
16
|
-
|
|
23
|
+
const getStyle = (baseSize: string, position: { pos:string,textAlign: string}) => {
|
|
17
24
|
const c = (f: number) => `calc(${f} * ${baseSize})`;
|
|
18
25
|
const { pos, textAlign } = position;
|
|
19
26
|
return {
|
|
20
27
|
wrap: {
|
|
21
28
|
position: 'fixed',
|
|
22
29
|
left: 0,
|
|
23
|
-
|
|
30
|
+
pos:pos? pos: c(0.05),
|
|
24
31
|
zIndex: 9999,
|
|
25
32
|
width: '100%',
|
|
26
33
|
padding: `0 ${c(0.2)}`,
|
|
27
34
|
pointerEvents: 'none',
|
|
28
35
|
textAlign,
|
|
29
36
|
},
|
|
30
|
-
bar: (bg:
|
|
37
|
+
bar: (bg: string) => ({
|
|
31
38
|
display: 'inline-block',
|
|
32
39
|
width: 'auto',
|
|
33
40
|
minWidth: baseSize,
|
|
@@ -45,36 +52,32 @@
|
|
|
45
52
|
userSelect: 'none',
|
|
46
53
|
}),
|
|
47
54
|
};
|
|
48
|
-
};
|
|
49
|
-
import { defineComponent } from 'vue'
|
|
55
|
+
};
|
|
56
|
+
import { defineComponent } from 'vue'
|
|
50
57
|
export default defineComponent({
|
|
51
|
-
|
|
58
|
+
name: 'Snackbar',
|
|
52
59
|
props: {
|
|
53
|
-
colors: {
|
|
54
|
-
default() {
|
|
55
|
-
return {
|
|
60
|
+
colors: { default: ()=> ({
|
|
56
61
|
open: '#333',
|
|
57
62
|
info: '#3DBD7D',
|
|
58
63
|
error: '#FA7377',
|
|
59
64
|
warn: '#FF6600',
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
},
|
|
64
|
-
position: {
|
|
65
|
-
default: 'top-center',
|
|
66
|
-
type: String,
|
|
67
|
-
},
|
|
65
|
+
}), type: Object},
|
|
66
|
+
position: { default: 'top-center', type: String},
|
|
67
|
+
holdTime: {default:5000, type:Number}
|
|
68
68
|
},
|
|
69
69
|
data() {
|
|
70
70
|
return {
|
|
71
|
-
msgs: [] as
|
|
72
|
-
|
|
71
|
+
msgs: [] as Array<{
|
|
72
|
+
color: string,
|
|
73
|
+
msg:string,
|
|
74
|
+
timer: ReturnType<typeof setTimeout>|undefined,
|
|
75
|
+
}>,
|
|
73
76
|
baseSize: '5rem',
|
|
74
77
|
};
|
|
75
78
|
},
|
|
76
79
|
computed: {
|
|
77
|
-
$_position():
|
|
80
|
+
$_position(): { pos:string,textAlign: string} {
|
|
78
81
|
const [p, textAlign] = this.position.toString().split('-');
|
|
79
82
|
return {
|
|
80
83
|
pos: ['top', 'bottom'].includes(p) ? p : 'top',
|
|
@@ -83,35 +86,61 @@ export default defineComponent({
|
|
|
83
86
|
: 'center',
|
|
84
87
|
};
|
|
85
88
|
},
|
|
86
|
-
style() {
|
|
89
|
+
style(): {wrap: {
|
|
90
|
+
position: string,
|
|
91
|
+
left: number,
|
|
92
|
+
pos: string,
|
|
93
|
+
zIndex: number,
|
|
94
|
+
width: string,
|
|
95
|
+
padding: string,
|
|
96
|
+
pointerEvents: string,
|
|
97
|
+
textAlign:string,
|
|
98
|
+
},
|
|
99
|
+
bar: (bg:string) =>{
|
|
100
|
+
display: string,
|
|
101
|
+
width:string,
|
|
102
|
+
minWidth: string,
|
|
103
|
+
maxWidth:string,
|
|
104
|
+
padding: string,
|
|
105
|
+
margin: string,
|
|
106
|
+
borderRadius: string,
|
|
107
|
+
lineHeight: string,
|
|
108
|
+
color: string,
|
|
109
|
+
background: string,
|
|
110
|
+
boxShadow: string,
|
|
111
|
+
cursor: string,
|
|
112
|
+
textAlign: string,
|
|
113
|
+
pointerEvents: string,
|
|
114
|
+
userSelect: string,
|
|
115
|
+
}}{
|
|
87
116
|
return getStyle(this.baseSize, this.$_position);
|
|
88
117
|
},
|
|
89
118
|
},
|
|
90
119
|
methods: {
|
|
91
|
-
info(msg:
|
|
120
|
+
info(msg: string): boolean {
|
|
92
121
|
const color = this.colors.info;
|
|
93
122
|
this.open({ color, msg }, false);
|
|
94
123
|
return true;
|
|
95
124
|
},
|
|
96
|
-
error(msg:
|
|
125
|
+
error(msg: string): boolean {
|
|
97
126
|
const color = this.colors.error;
|
|
98
127
|
this.open({ color, msg }, false);
|
|
99
128
|
return false;
|
|
100
129
|
},
|
|
101
|
-
warn(msg:
|
|
130
|
+
warn(msg: string): boolean {
|
|
102
131
|
const color = this.colors.warn;
|
|
103
132
|
this.open({ color, msg }, false);
|
|
104
133
|
return true;
|
|
105
134
|
},
|
|
106
|
-
open(message: {
|
|
135
|
+
open(message: {color:string, msg:string}|string, isOpen = true): boolean {
|
|
107
136
|
let msg;
|
|
108
137
|
let color;
|
|
109
138
|
if (!isOpen) {
|
|
110
|
-
({
|
|
111
|
-
msg = message.msg;
|
|
139
|
+
color = (message as {color:string, msg:string}).color;
|
|
140
|
+
msg = (message as {color:string, msg:string}).msg;
|
|
112
141
|
} else {
|
|
113
142
|
color = this.colors.open;
|
|
114
|
-
msg = message;
|
|
143
|
+
msg = (message as string);
|
|
115
144
|
}
|
|
116
145
|
const msgObj = {
|
|
117
146
|
color,
|
|
@@ -123,10 +152,17 @@ export default defineComponent({
|
|
|
123
152
|
|
|
124
153
|
return true;
|
|
125
154
|
},
|
|
126
|
-
pop(i = 0) {
|
|
127
|
-
if (this.msgs[i]) clearTimeout(this.msgs[i].timer);
|
|
155
|
+
pop(i = 0): void {
|
|
156
|
+
if (this.msgs[i]) clearTimeout((this.msgs[i].timer as unknown as number));
|
|
128
157
|
this.msgs.splice(i, 1);
|
|
129
158
|
},
|
|
130
|
-
},
|
|
131
|
-
})
|
|
159
|
+
},
|
|
160
|
+
})
|
|
132
161
|
</script>
|
|
162
|
+
<style lang="scss">
|
|
163
|
+
.octopus-app{
|
|
164
|
+
.snack-bar-wrap{
|
|
165
|
+
bottom: 0px;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
</style>
|