@@ -28,17 +28,36 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
28
28
</div>
29
29
<RepeatSummary class="property-repeat__summary__content"
30
30
:recurrence-rule="recurrence" />
31
+ <Actions>
32
+ <ActionButton @click="toggleOptions">
33
+ <template #icon>
34
+ <component :is="toggleIcon" :size="20" decorative />
35
+ </template>
36
+ {{ toggleTitle }}
37
+ </ActionButton>
38
+ </Actions>
39
+
40
+ <div v-if="showOptions" class="property-repeat__options">
41
+ options
42
+ </div>
31
43
</div>
32
44
</template>
33
45
34
46
<script>
35
47
36
48
import { translate as t } from '@nextcloud/l10n'
37
49
import RepeatSummary from './RepeatItem/RepeatSummary.vue'
50
+ import Pencil from 'vue-material-design-icons/Pencil.vue'
51
+ import Check from 'vue-material-design-icons/Check.vue'
52
+ import { NcActions as Actions, NcActionButton as ActionButton } from '@nextcloud/vue'
38
53
39
54
export default {
40
55
components: {
41
56
RepeatSummary,
57
+ Actions,
58
+ ActionButton,
59
+ Pencil,
60
+ Check,
42
61
},
43
62
props: {
44
63
recurrence: {
@@ -58,8 +77,43 @@ export default {
58
77
default: null,
59
78
},
60
79
},
80
+ data() {
81
+ return {
82
+ showOptions: false,
83
+ }
84
+ },
85
+ computed: {
86
+ /**
87
+ * The name of the icon for the toggle options button
88
+ *
89
+ * @return {string}
90
+ */
91
+ toggleIcon() {
92
+ if (this.showOptions) {
93
+ return 'Check'
94
+ }
95
+ return 'Pencil'
96
+ },
97
+ /**
98
+ * The text of the toggle options button
99
+ *
100
+ * @return {string}
101
+ */
102
+ toggleTitle() {
103
+ if (this.showOptions) {
104
+ return this.t('calendar', 'Save')
105
+ }
106
+ return this.t('calendar', 'Edit')
107
+ },
108
+ },
61
109
methods: {
62
110
t,
111
+ /**
112
+ * Toggle visibility of the options
113
+ */
114
+ toggleOptions() {
115
+ this.showOptions = !this.showOptions
116
+ },
63
117
},
64
118
}
65
119
</script>
@@ -80,10 +134,33 @@ export default {
80
134
flex-shrink: 0;
81
135
}
82
136
83
- .property-repeat__summary__content {
84
- display: flex;
85
- align-items: center;
86
- margin-bottom: 5px;
137
+ .property-repeat {
138
+ width: 100%;
139
+
140
+ &__summary {
141
+ display: flex;
142
+ align-items: center;
143
+ margin-bottom: 5px;
144
+
145
+ &__icon {
146
+ width: 34px;
147
+ height: 34px;
148
+ margin-left: -5px;
149
+ margin-right: 5px;
150
+ }
151
+
152
+ &__content {
153
+ flex: 1 auto;
154
+ padding: 0 7px;
155
+ overflow: hidden;
156
+ text-overflow: ellipsis;
157
+ white-space: nowrap;
158
+ }
159
+ }
160
+
161
+ &__options {
162
+ margin-bottom: 5px;
163
+ }
87
164
}
88
165
}
89
166
</style>
0 commit comments