@dative-gpi/foundation-core-components 1.0.194-dynamic-v-node → 1.0.194-playlists-02

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.
@@ -34,7 +34,7 @@
34
34
  :bottomColor="item.colors"
35
35
  :address="item.address.placeLabel"
36
36
  :selectable="$props.selectable"
37
- :singleSelect="singleSelect"
37
+ :singleSelect="$props.singleSelect"
38
38
  :modelValue="isSelected(item.id)"
39
39
  :to="$props.itemTo && $props.itemTo(item)"
40
40
  @update:modelValue="toggleSelect(item)"
@@ -0,0 +1,93 @@
1
+ <template>
2
+ <FSTileList
3
+ :items="playlists"
4
+ :loading="fetching"
5
+ :selectable="$props.selectable"
6
+ :singleSelect="$props.singleSelect"
7
+ :modelValue="$props.modelValue"
8
+ @update:modelValue="$emit('update:modelValue', $event)"
9
+ v-bind="$attrs"
10
+ >
11
+ <template
12
+ v-for="(_, name) in $slots"
13
+ v-slot:[name]="slotData"
14
+ >
15
+ <slot
16
+ :name="name"
17
+ v-bind="slotData"
18
+ />
19
+ </template>
20
+ <template
21
+ #item.tile="{ item, toggleSelect, direction }"
22
+ >
23
+ <FSPlaylistTileUI
24
+ :dashboardsCount="item.dashboards.length"
25
+ :selectable="$props.selectable"
26
+ :singleSelect="$props.singleSelect"
27
+ :modelValue="($props.modelValue ?? []).includes(item.id)"
28
+ :width="direction === ListDirections.Column ? 'fill' : undefined"
29
+ @update:modelValue="toggleSelect(item)"
30
+ v-bind="item"
31
+ />
32
+ </template>
33
+ </FSTileList>
34
+ </template>
35
+
36
+ <script lang="ts">
37
+ import type { PropType} from "vue";
38
+ import { defineComponent, watch } from "vue";
39
+
40
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
41
+ import { ListDirections } from "@dative-gpi/foundation-shared-domain/enums";
42
+
43
+ import type { PlaylistFilters } from "@dative-gpi/foundation-core-domain/models";
44
+ import { usePlaylists } from "@dative-gpi/foundation-core-services/composables";
45
+
46
+ import FSPlaylistTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSPlaylistTileUI.vue";
47
+ import FSTileList from "@dative-gpi/foundation-shared-components/components/lists/FSTileList.vue";
48
+
49
+
50
+ export default defineComponent({
51
+ title: "FSTilePlaylistsList",
52
+ components: {
53
+ FSPlaylistTileUI,
54
+ FSTileList
55
+ },
56
+ props: {
57
+ playlistFilters: {
58
+ type: Object as PropType<PlaylistFilters>,
59
+ required: true
60
+ },
61
+ modelValue: {
62
+ type: Array as PropType<string[]>,
63
+ required: false,
64
+ default: () => []
65
+ },
66
+ selectable: {
67
+ type: Boolean,
68
+ required: false,
69
+ default: false
70
+ },
71
+ singleSelect: {
72
+ type: Boolean,
73
+ required: false,
74
+ default: false
75
+ },
76
+ },
77
+ setup(props) {
78
+ const { entities: playlists, getMany, fetching } = usePlaylists();
79
+
80
+ const fetch = () => {
81
+ getMany(props.playlistFilters);
82
+ };
83
+
84
+ watch(() => props.playlistFilters, fetch, { immediate: true });
85
+ return {
86
+ ListDirections,
87
+ playlists,
88
+ ColorEnum,
89
+ fetching
90
+ };
91
+ }
92
+ });
93
+ </script>
@@ -0,0 +1,78 @@
1
+ <template>
2
+ <FSLoadTile
3
+ v-if="getting"
4
+ :selectable="$props.selectable"
5
+ :modelValue="$props.modelValue"
6
+ @update:modelValue="$emit('update:modelValue', $event)"
7
+ />
8
+ <PlaylistTileUI
9
+ v-else-if="entity"
10
+ :dashboardsCount="entity.dashboards?.length ?? 0"
11
+ :looped="entity.looped"
12
+ :delay="entity.delay"
13
+ :label="entity.label"
14
+ :code="entity.code"
15
+ :selectable="$props.selectable"
16
+ :modelValue="$props.modelValue"
17
+ @update:modelValue="$emit('update:modelValue', $event)"
18
+ v-bind="$attrs"
19
+ >
20
+ <template
21
+ v-for="(_, name) in $slots"
22
+ v-slot:[name]="slotData"
23
+ >
24
+ <slot
25
+ :name="name"
26
+ v-bind="slotData"
27
+ />
28
+ </template>
29
+ </PlaylistTileUI>
30
+ </template>
31
+
32
+ <script lang="ts">
33
+ import { defineComponent, onMounted, watch } from "vue";
34
+
35
+ import { usePlaylist } from "@dative-gpi/foundation-core-services/composables";
36
+
37
+ import PlaylistTileUI from "@dative-gpi/foundation-shared-components/components/tiles/FSPlaylistTileUI.vue";
38
+
39
+ export default defineComponent({
40
+ name: "FSPlaylistTile",
41
+ components: {
42
+ PlaylistTileUI
43
+ },
44
+ props: {
45
+ playlistId: {
46
+ type: String,
47
+ required: true
48
+ },
49
+ modelValue: {
50
+ type: Boolean,
51
+ required: false,
52
+ default: false
53
+ },
54
+ selectable: {
55
+ type: Boolean,
56
+ required: false,
57
+ default: false
58
+ },
59
+ },
60
+ emits: ["update:modelValue"],
61
+ setup(props) {
62
+ const { get, getting, entity } = usePlaylist();
63
+
64
+ onMounted(() => {
65
+ get(props.playlistId);
66
+ });
67
+
68
+ watch(() => props.playlistId, () => {
69
+ get(props.playlistId);
70
+ });
71
+
72
+ return {
73
+ getting,
74
+ entity
75
+ };
76
+ }
77
+ });
78
+ </script>
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "url": "https://github.com/Dative-GPI/foundation-shared-ui.git"
5
5
  },
6
6
  "sideEffects": false,
7
- "version": "1.0.194-dynamic-v-node",
7
+ "version": "1.0.194-playlists-02",
8
8
  "description": "",
9
9
  "publishConfig": {
10
10
  "access": "public"
@@ -13,11 +13,11 @@
13
13
  "author": "",
14
14
  "license": "ISC",
15
15
  "dependencies": {
16
- "@dative-gpi/foundation-core-domain": "1.0.194-dynamic-v-node",
17
- "@dative-gpi/foundation-core-services": "1.0.194-dynamic-v-node",
18
- "@dative-gpi/foundation-shared-components": "1.0.194-dynamic-v-node",
19
- "@dative-gpi/foundation-shared-domain": "1.0.194-dynamic-v-node",
20
- "@dative-gpi/foundation-shared-services": "1.0.194-dynamic-v-node"
16
+ "@dative-gpi/foundation-core-domain": "1.0.194-playlists-02",
17
+ "@dative-gpi/foundation-core-services": "1.0.194-playlists-02",
18
+ "@dative-gpi/foundation-shared-components": "1.0.194-playlists-02",
19
+ "@dative-gpi/foundation-shared-domain": "1.0.194-playlists-02",
20
+ "@dative-gpi/foundation-shared-services": "1.0.194-playlists-02"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "@dative-gpi/bones-ui": "^1.0.0",
@@ -29,5 +29,5 @@
29
29
  "sass": "1.71.1",
30
30
  "sass-loader": "13.3.2"
31
31
  },
32
- "gitHead": "bae28f289de25e748becbaf3e7d5f6c9bdc12934"
32
+ "gitHead": "aadd89bd31e3423781f48a258c89ababbbcb00cb"
33
33
  }