@saooti/octopus-sdk 36.0.5 → 36.0.6

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.
Files changed (36) hide show
  1. package/index.ts +1 -2
  2. package/package.json +3 -2
  3. package/src/assets/bootstrap.scss +11 -1
  4. package/src/components/display/categories/CategoryChooser.vue +79 -171
  5. package/src/components/display/categories/CategoryFilter.vue +10 -4
  6. package/src/components/display/emission/EmissionPlayerItem.vue +4 -1
  7. package/src/components/display/filter/CategorySearchFilter.vue +1 -1
  8. package/src/components/display/filter/ProductorSearch.vue +6 -16
  9. package/src/components/display/filter/RubriqueChoice.vue +1 -1
  10. package/src/components/display/filter/RubriqueFilter.vue +2 -1
  11. package/src/components/display/list/Paginate.vue +4 -1
  12. package/src/components/display/organisation/OrganisationChooser.vue +72 -200
  13. package/src/components/display/podcasts/PodcastFilterList.vue +5 -3
  14. package/src/components/display/podcasts/PodcastImage.vue +3 -1
  15. package/src/components/display/podcasts/PodcastModuleBox.vue +17 -5
  16. package/src/components/display/podcasts/TagList.vue +2 -2
  17. package/src/components/display/rubriques/RubriqueChooser.vue +87 -181
  18. package/src/components/display/rubriques/RubriqueList.vue +8 -5
  19. package/src/components/display/sharing/PlayerParameters.vue +3 -1
  20. package/src/components/display/sharing/ShareButtons.vue +5 -3
  21. package/src/components/display/sharing/ShareButtonsIntern.vue +24 -8
  22. package/src/components/display/sharing/ShareDistribution.vue +3 -1
  23. package/src/components/display/sharing/SharePlayer.vue +3 -1
  24. package/src/components/display/sharing/SharePlayerColors.vue +6 -2
  25. package/src/components/form/ClassicCheckbox.vue +1 -1
  26. package/src/components/form/ClassicMultiselect.vue +155 -0
  27. package/src/components/misc/TopBar.vue +8 -4
  28. package/src/components/misc/modal/NewsletterModal.vue +1 -1
  29. package/src/components/pages/Emission.vue +5 -2
  30. package/src/components/pages/Home.vue +3 -3
  31. package/src/components/pages/Playlist.vue +4 -1
  32. package/src/components/pages/Podcast.vue +4 -1
  33. package/src/stores/ParamSdkStore.ts +13 -13
  34. package/src/stores/class/general/organisation.ts +8 -0
  35. package/src/assets/multiselect.scss +0 -518
  36. package/src/components/display/emission/EmissionChooser.vue +0 -187
package/index.ts CHANGED
@@ -35,7 +35,6 @@ export const getClassicModal = () => import("./src/components/misc/modal/Classic
35
35
  export const getCategoryChooser = () => import("./src/components/display/categories/CategoryChooser.vue");
36
36
  export const getCategoryList = () => import("./src/components/display/categories/CategoryList.vue");
37
37
  export const getCategoryFilter = () => import("./src/components/display/categories/CategoryFilter.vue");
38
- export const getEmissionChooser = () => import("./src/components/display/emission/EmissionChooser.vue");
39
38
  export const getEmissionList = () => import("./src/components/display/emission/EmissionList.vue");
40
39
  export const getOrganisationChooser = () => import("./src/components/display/organisation/OrganisationChooser.vue");
41
40
  export const getPodcastFilterList = () => import("./src/components/display/podcasts/PodcastFilterList.vue");
@@ -64,7 +63,7 @@ export const getClassicSelect = () => import("./src/components/form/ClassicSelec
64
63
  export const getClassicDatePicker = () => import("./src/components/form/ClassicDatePicker.vue");
65
64
  export const getPaginate = () => import("./src/components/display/list/Paginate.vue");
66
65
  export const getListPaginate = () => import("./src/components/display/list/ListPaginate.vue");
67
-
66
+ export const getClassicMultiselect = () => import("./src/components/form/ClassicMultiselect.vue");
68
67
 
69
68
  //mixins
70
69
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "36.0.5",
3
+ "version": "36.0.6",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -37,14 +37,15 @@
37
37
  "vite": "^3.2.5",
38
38
  "vue": "^3.2.45",
39
39
  "vue-i18n": "^9.2.2",
40
- "vue-multiselect": "^3.0.0-beta.1",
41
40
  "vue-recaptcha": "^2.0.3",
42
41
  "vue-router": "^4.1.6",
42
+ "vue-select": "^4.0.0-beta.6",
43
43
  "vue3-lazyload": "^0.3.6",
44
44
  "vue3-swatches": "1.0.10"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/jquery": "^3.5.16",
48
+ "@types/vue-select": "^3.16.2",
48
49
  "@typescript-eslint/eslint-plugin": "^5.57.0",
49
50
  "@typescript-eslint/parser": "^5.57.0",
50
51
  "@vitejs/plugin-vue": "^3.2.0",
@@ -4,7 +4,7 @@
4
4
  box-sizing: border-box;
5
5
  }
6
6
  .octopus-app{
7
- input, button, select, optgroup, textarea {
7
+ input:not([class^="vs__"]), button:not([class^="vs__"]), select:not([class^="vs__"]), optgroup, textarea {
8
8
  margin: 0;
9
9
  font-family: inherit;
10
10
  font-size: inherit;
@@ -240,6 +240,16 @@
240
240
  .bg-secondary{
241
241
  background: #eee !important;
242
242
  }
243
+ .w-50-responsive{
244
+ display: flex;
245
+ align-items: center;
246
+ flex-grow: 1;
247
+ width: 50%;
248
+ @media (max-width: 960px) {
249
+ width:100%;
250
+ padding: 0 !important;
251
+ }
252
+ }
243
253
  }
244
254
 
245
255
 
@@ -1,106 +1,49 @@
1
1
  <template>
2
- <div
3
- class="default-multiselect-width"
4
- :style="{ width: width }"
5
- >
6
- <label
7
- :for="id"
8
- class="hid"
9
- >{{ $t('Type string to filter by categories') }}</label>
10
- <VueMultiselect
11
- :id="id"
12
- ref="multiselectRef"
13
- v-model="model"
14
- :disabled="isDisabled"
15
- label="name"
16
- track-by="id"
17
- :aria-expanded="false"
18
- :placeholder="$t('Type string to filter by categories')"
19
- :options="categories"
20
- :multiple="multiple"
21
- :searchable="true"
22
- :loading="isLoading"
23
- :internal-search="false"
24
- :clear-on-select="false"
25
- :close-on-select="true"
26
- :options-limit="200"
27
- :max-height="600"
28
- :show-no-results="true"
29
- :hide-selected="true"
30
- :show-labels="false"
31
- @open="onOpen"
32
- @search-change="onSearchCategory"
33
- @select="onCategorySelected"
34
- >
35
- <template #singleLabel="{ option }">
36
- <div class="multiselect-octopus-proposition">
37
- <span class="option__title">
38
- {{ option.name }}
39
- </span>
40
- </div>
41
- </template>
42
- <template #option="{ option }">
43
- <div class="multiselect-octopus-proposition">
44
- <span class="option__title">{{ option.name }}</span>
45
- </div>
46
- </template>
47
- <template #noOptions="">
48
- {{ $t('List is empty') }}
49
- </template>
50
- <template #noResult="">
51
- <span>
52
- {{ $t('No elements found. Consider changing the search query.') }}
53
- </span>
54
- </template>
55
- <template #caret="">
56
- <div class="position-relative">
57
- <span
58
- class="saooti-down octopus-arrow-down-absolute"
59
- />
60
- </div>
61
- </template>
62
- </VueMultiselect>
63
- </div>
2
+ <ClassicMultiselect
3
+ :id="idClassicMultiselect"
4
+ ref="selectCategory"
5
+ :option-chosen="model"
6
+ option-label="name"
7
+ :label="$t('By category')"
8
+ :placeholder="$t('Type string to filter by categories')"
9
+ :max-element="maxElement"
10
+ :in-modal="inModal"
11
+ :multiple="multiple"
12
+ :min-search-length="1"
13
+ :width="width"
14
+ :is-disabled="isDisabled"
15
+ @onSearch="onSearchCategory"
16
+ @selected="onCategorySelected"
17
+ />
64
18
  </template>
65
19
 
66
20
  <script lang="ts">
67
- //@ts-ignore
68
- import VueMultiselect from 'vue-multiselect';
69
-
70
- const getDefaultCategory = (defaultName: string) => {
71
- if ('' === defaultName){
72
- return undefined;
73
- }
74
- return { name: defaultName, id: 0 };
75
- };
76
21
  import { useGeneralStore } from '@/stores/GeneralStore';
77
22
  import { mapState } from 'pinia';
23
+ import ClassicMultiselect from '../../form/ClassicMultiselect.vue';
78
24
  import { Category } from '@/stores/class/general/category';
79
25
  import { defineComponent } from 'vue'
80
26
  export default defineComponent({
81
27
  components: {
82
- VueMultiselect
28
+ ClassicMultiselect
83
29
  },
84
30
  props: {
85
- width: { default: '100%', type: String },
86
31
  defaultanswer: { default: '', type: String },
87
- categorySelected: { default: undefined, type: Number },
32
+ width: { default: '100%', type: String },
88
33
  multiple: { default: false, type: Boolean },
89
- categoryArray: { default: undefined, type: Array as ()=>Array<number> },
90
- displayAllCategories: { default: false, type: Boolean },
91
34
  isDisabled: { default: false, type: Boolean },
92
35
  initCategories: { default: undefined, type: Array as ()=>Array<Category> },
36
+ displayAllCategories: { default: false, type: Boolean },
37
+ categorySelected: { default: undefined, type: Number },
38
+ categorySelectedArray: { default: undefined, type: Array as ()=>Array<number> },
39
+ inModal:{default: false, type: Boolean},
93
40
  },
94
- emits: ['update:categorySelected','selected'],
41
+ emits: ['update:categorySelected','update:categorySelectedArray','selected'],
95
42
  data() {
96
43
  return {
97
- categories: [] as Array<Category>,
98
- category: getDefaultCategory(this.defaultanswer) as Category|undefined,
99
- categoryForArray: [getDefaultCategory(this.defaultanswer)] as Array<Category>|undefined,
100
- isLoading: false as boolean,
101
- totalCategories: [] as Array<Category>,
102
- init: true as boolean,
103
- initArray: false as boolean,
44
+ maxElement: 50 as number,
45
+ category: undefined as Category|undefined,
46
+ categoryForArray: [] as Array<Category>|undefined,
104
47
  };
105
48
  },
106
49
 
@@ -113,26 +56,39 @@ export default defineComponent({
113
56
  }
114
57
  return this.storedCategories;
115
58
  },
116
- allCategories(): Array<Category> {
117
- return [...this.categoriesChosen].sort((a: Category, b: Category) =>
59
+ categoriesOrdered(): Array<Category> {
60
+ let allCategoriesOrdered = [...this.categoriesChosen].sort((a: Category, b: Category) =>
118
61
  a.name > b.name ? 1 : -1
119
- );
62
+ )
63
+ if(!this.displayAllCategories){
64
+ allCategoriesOrdered = allCategoriesOrdered.filter((c: Category) => {
65
+ return c.podcastCount;
66
+ });
67
+ }
68
+ if (this.getDefaultCategory) {
69
+ allCategoriesOrdered.unshift(this.getDefaultCategory);
70
+ }
71
+ return allCategoriesOrdered;
72
+ },
73
+ getDefaultCategory(): Category|undefined{
74
+ if(''===this.defaultanswer){
75
+ return undefined;
76
+ }
77
+ return {id: 0, name: this.defaultanswer};
120
78
  },
121
- id(): string {
79
+ idClassicMultiselect(): string {
122
80
  if (this.multiple) return 'categoryChooser' + this.multiple;
123
81
  return 'categoryChooser';
124
82
  },
83
+
125
84
  model: {
126
85
  get(): Category| Array<Category>|undefined{
127
- if(false===this.initArray){
128
- return this.category;
129
- }
130
- return this.categoryForArray;
86
+ return this.multiple ? this.categoryForArray:this.category;
131
87
  },
132
88
  set(value: Category| Array<Category>|undefined): void{
133
- if(false===this.initArray){
89
+ if(!this.multiple){
134
90
  this.category = (value as Category|undefined);
135
- return
91
+ return;
136
92
  }
137
93
  this.categoryForArray = (value as Array<Category>|undefined);
138
94
  }
@@ -140,101 +96,53 @@ export default defineComponent({
140
96
  }
141
97
  },
142
98
  watch: {
143
- categorySelected(): void {
144
- if(this.categorySelected){
145
- this.initCategorySelected(this.categorySelected);
146
- }
147
- },
148
- model: {
149
- deep: true,
99
+ categorySelected: {
100
+ immediate:true,
150
101
  handler(){
151
- if(undefined===this.categoryArray ||undefined === this.categoryForArray){
152
- return;
102
+ if(this.categorySelected){
103
+ this.initCategorySelected();
104
+ }else{
105
+ this.category = this.getDefaultCategory;
153
106
  }
154
- const idsArray: Array<number> = [];
155
- this.categoryForArray.forEach((el: Category) => {
156
- idsArray.push(el.id);
157
- });
158
- this.$emit('selected', idsArray);
159
107
  }
160
- },
108
+ }
161
109
  },
162
110
 
163
111
  mounted() {
164
- if (undefined !== this.categorySelected) {
165
- this.initCategorySelected(this.categorySelected);
166
- }
167
- if (undefined !== this.categoryArray) {
168
- this.initCategoryArray(this.categoryArray);
169
- this.initArray=true;
170
- }
112
+ this.initCategoryArray();
171
113
  },
172
114
  methods: {
173
- onOpen(): void {
174
- (this.$refs.multiselectRef as VueMultiselect).$refs.search.setAttribute(
175
- 'autocomplete',
176
- 'off'
177
- );
178
- if (
179
- undefined !== this.categorySelected ||
180
- undefined !== this.categoryArray ||
181
- this.displayAllCategories
182
- ) {
183
- this.totalCategories = this.allCategories;
184
- } else {
185
- this.totalCategories = this.allCategories.filter((c: Category) => {
186
- return c.podcastCount;
187
- });
188
- }
189
- if ('' !== this.defaultanswer) {
190
- const categoryDefault = getDefaultCategory(this.defaultanswer);
191
- if(categoryDefault){
192
- this.categories = [categoryDefault].concat(
193
- this.totalCategories
194
- );
195
- }
196
- } else {
197
- this.categories = this.totalCategories;
198
- }
199
- },
200
- onSearchCategory(query: string): void {
201
- this.isLoading = true;
202
- const categoryDefault = getDefaultCategory(this.defaultanswer);
203
- if(categoryDefault){
204
- let list: Array<Category> = [categoryDefault].concat(
205
- this.totalCategories
206
- );
207
- if ('' === this.defaultanswer) {
208
- list = this.totalCategories;
209
- }
210
- this.categories = list.filter((item: Category) => {
115
+ async onSearchCategory(query?: string): Promise<void> {
116
+ let categories = this.categoriesOrdered;
117
+ if(query){
118
+ categories = categories.filter((item: Category) => {
211
119
  return item.name.toUpperCase().includes(query.toUpperCase());
212
120
  });
213
121
  }
214
- this.isLoading = false;
122
+ (this.$refs.selectCategory as InstanceType<typeof ClassicMultiselect>).afterSearch(categories,categories.length);
215
123
  },
216
- onCategorySelected(category: Category): void {
124
+ onCategorySelected(category: Category| Array<Category>): void {
217
125
  if (undefined !== this.categorySelected) {
218
- this.$emit('update:categorySelected', category.id);
219
- } else if (undefined === this.categoryArray) {
126
+ this.$emit('update:categorySelected', (category as Category).id);
127
+ } else if (undefined !== this.categorySelectedArray) {
128
+ const idsArray: Array<number> = [];
129
+ (category as Array<Category>).forEach((el: Category) => {
130
+ idsArray.push(el.id);
131
+ });
132
+ this.$emit('update:categorySelectedArray', idsArray);
133
+ }else{
220
134
  this.$emit('selected', category);
221
135
  }
222
136
  },
223
- initCategorySelected(val: number): void {
224
- let categorySelected = this.categoriesChosen.find((el: Category) => {
225
- return el.id === val;
226
- });
227
- if(!categorySelected){
228
- categorySelected = getDefaultCategory(this.defaultanswer);
229
- }
230
- this.category = categorySelected;
137
+ initCategorySelected(): void {
138
+ this.category = this.categoriesChosen.find((el: Category) => {
139
+ return el.id === this.categorySelected;
140
+ }) ?? this.getDefaultCategory;
231
141
  },
232
- initCategoryArray(val: Array<number>): void {
233
- if(!this.categoryForArray){
234
- return;
235
- }
142
+ initCategoryArray(): void {
143
+ if(!this.categoryForArray || !this.categorySelectedArray){return; }
236
144
  this.categoryForArray.length = 0;
237
- val.forEach((element: number) => {
145
+ this.categorySelectedArray.forEach((element: number) => {
238
146
  const item = this.categoriesChosen.find((el: Category) => {
239
147
  return el.id === element;
240
148
  });
@@ -4,8 +4,11 @@
4
4
  class="header-img flex-column justify-content-end"
5
5
  :style="backgroundDisplay"
6
6
  >
7
- <h1>{{titleDisplay}}</h1>
8
- <div v-show="isDisplay" class="d-flex flex-column justify-content-end">
7
+ <h1>{{ titleDisplay }}</h1>
8
+ <div
9
+ v-show="isDisplay"
10
+ class="d-flex flex-column justify-content-end"
11
+ >
9
12
  <ol
10
13
  v-if="filterIab || filterRubrique.length"
11
14
  class="octopus-breadcrumb d-flex align-items-center justify-content-center flex-wrap"
@@ -33,7 +36,10 @@
33
36
  href="#"
34
37
  @click="removeFilter(index,$event)"
35
38
  >{{ filter.nameRubriquage }}</a>
36
- <div class="fw-bold" v-else>
39
+ <div
40
+ v-else
41
+ class="fw-bold"
42
+ >
37
43
  {{ filter.nameRubriquage }}
38
44
  </div>
39
45
  <div class="mx-1">
@@ -46,7 +52,7 @@
46
52
  :rubriquage-id="filter.rubriquageId"
47
53
  :rubrique-selected="filter.rubriqueId"
48
54
  :all-rubriques="getRubriques(filter.rubriquageId)"
49
- :cannot-be-undefined="true"
55
+ :no-deselect="true"
50
56
  width="auto"
51
57
  @selected="onRubriqueSelected(index,$event)"
52
58
  />
@@ -93,7 +93,10 @@
93
93
  <!-- eslint-enable -->
94
94
  </div>
95
95
  </router-link>
96
- <PodcastPlayBar :podcast-id="p.podcastId" :duration="p.duration" />
96
+ <PodcastPlayBar
97
+ :podcast-id="p.podcastId"
98
+ :duration="p.duration"
99
+ />
97
100
  </div>
98
101
  <button
99
102
  v-if="
@@ -8,7 +8,7 @@
8
8
  />
9
9
  <CategoryChooser
10
10
  v-model:categorySelected="iabId"
11
- width="auto"
11
+ width="100%"
12
12
  :defaultanswer="$t('No category filter')"
13
13
  />
14
14
  </div>
@@ -1,17 +1,17 @@
1
1
  <template>
2
- <div class="d-flex align-items-center my-3">
2
+ <div class="d-flex-column align-items-center my-3">
3
3
  <div
4
4
  v-if="!isPodcastmaker && !filterOrgaId"
5
- class="filter-organisation-chooser"
5
+ class="w-50-responsive pe-3 position-relative"
6
6
  >
7
7
  <OrganisationChooser
8
8
  :defaultanswer="$t('No organisation filter')"
9
- :value="organisationId"
9
+ :orga-id-selected="organisationId"
10
10
  @selected="onOrganisationSelected"
11
11
  />
12
12
  <ClassicCheckbox
13
- v-if="!!organisationId"
14
13
  v-model:textInit="keepOrganisation"
14
+ :class="!!organisationId? '' : 'invisible'"
15
15
  class="m-3"
16
16
  :label="$t('check this box if you want to keep this filter for the rest of your visit')"
17
17
  :display-label="false"
@@ -19,7 +19,7 @@
19
19
  @clickAction="onKeepOrganisation"
20
20
  />
21
21
  <div
22
- v-if="showBubble"
22
+ :class="showBubble? '' : 'invisible'"
23
23
  class="filter-speech-bubble"
24
24
  >
25
25
  {{
@@ -31,7 +31,7 @@
31
31
  </div>
32
32
  <ClassicSearch
33
33
  :text-init="searchPattern"
34
- class="d-flex align-items-center flex-grow-1"
34
+ class="w-50-responsive"
35
35
  :autofocus="true"
36
36
  id-search="productor-search-input"
37
37
  :label="searchText"
@@ -190,15 +190,5 @@ export default defineComponent({
190
190
  opacity: 1;
191
191
  }
192
192
  }
193
- .filter-organisation-chooser {
194
- display: flex;
195
- align-items: center;
196
- flex-grow: 1;
197
- margin-right: 10%;
198
- position: relative;
199
- @media (max-width: 500px) {
200
- margin-right: 0;
201
- }
202
- }
203
193
  }
204
194
  </style>
@@ -30,7 +30,7 @@
30
30
  :defaultanswer="$t('No rubric filter')"
31
31
  :reset="reset"
32
32
  :without-rubrique="true"
33
- width="auto"
33
+ :no-deselect="true"
34
34
  @selected="onRubriqueSelected"
35
35
  />
36
36
  </template>
@@ -11,7 +11,7 @@
11
11
  />
12
12
  <div
13
13
  v-if="isRubriquage"
14
- class="d-flex flex-column mb-2"
14
+ class="d-flex flex-column mb-2 flex-grow-1"
15
15
  >
16
16
  <RubriqueChoice
17
17
  v-for="(filter, index) in arrayFilter"
@@ -21,6 +21,7 @@
21
21
  :rubriquage-display="getRubriquage(index)"
22
22
  :rubrique-id-selected="filter.rubriqueId"
23
23
  :rubriquage-id-selected="filter.rubriquageId"
24
+ :no-deselect="true"
24
25
  @updateRubrique="updateRubrique"
25
26
  @updateRubriquage="updateRubriquage"
26
27
  @deleteRubriqueChoice="deleteRubriqueChoice(index)"
@@ -1,5 +1,8 @@
1
1
  <template>
2
- <div class="paginate-fixed" :style="'bottom:'+playerHeight">
2
+ <div
3
+ class="paginate-fixed"
4
+ :style="'bottom:'+playerHeight"
5
+ >
3
6
  <div class="mx-2">
4
7
  {{ $t('Showing items number', {page: (page+1), totalPage: totalPage}) }}
5
8
  </div>