@dative-gpi/foundation-shared-components 1.0.165 → 1.0.167
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.
|
@@ -35,6 +35,8 @@
|
|
|
35
35
|
:step="$props.stepTime"
|
|
36
36
|
:min="startTimestamp"
|
|
37
37
|
:max="endTimestamp"
|
|
38
|
+
:hideHeader="true"
|
|
39
|
+
:maxWidth="null"
|
|
38
40
|
:ticks="ticks"
|
|
39
41
|
showTicks="always"
|
|
40
42
|
:modelValue="$props.modelValue"
|
|
@@ -78,7 +80,7 @@
|
|
|
78
80
|
</template>
|
|
79
81
|
|
|
80
82
|
<script lang="ts">
|
|
81
|
-
import { computed, defineComponent, ref, watch } from "vue";
|
|
83
|
+
import { computed, defineComponent, ref, watch, type PropType } from "vue";
|
|
82
84
|
|
|
83
85
|
import { useBreakpoints, useColors } from '@dative-gpi/foundation-shared-components/composables';
|
|
84
86
|
import { useDateFormat, useDateExpression } from "@dative-gpi/foundation-shared-services/composables";
|
|
@@ -164,7 +166,7 @@ export default defineComponent({
|
|
|
164
166
|
}
|
|
165
167
|
},
|
|
166
168
|
emits: ['update:modelValue', 'update:startDate', 'update:endDate'],
|
|
167
|
-
setup(props, { emit }) {
|
|
169
|
+
setup(props, { emit, expose }) {
|
|
168
170
|
const { epochToShortTimeOnlyFormat, epochToShortDateFormat, epochToDayMonthShortOnly, epochToISO, epochToMonthShortTimeFormat } = useDateFormat();
|
|
169
171
|
const { convert : convertTermToEpoch } = useDateExpression();
|
|
170
172
|
const { isMobileSized, isExtraSmall } = useBreakpoints();
|
|
@@ -173,9 +175,8 @@ export default defineComponent({
|
|
|
173
175
|
const lightColors = getColors(ColorEnum.Light);
|
|
174
176
|
const playing = ref(false);
|
|
175
177
|
const playingInterval = ref();
|
|
176
|
-
|
|
177
|
-
const
|
|
178
|
-
const endTimestamp = computed(() => convertTermToEpoch(props.endDate));
|
|
178
|
+
const startTimestamp = ref(convertTermToEpoch(props.startDate));
|
|
179
|
+
const endTimestamp = ref(convertTermToEpoch(props.endDate));
|
|
179
180
|
|
|
180
181
|
const tickCount = computed(() => {
|
|
181
182
|
if (isExtraSmall.value) { return 3; }
|
|
@@ -198,6 +199,11 @@ export default defineComponent({
|
|
|
198
199
|
precision: tickPrecision.value
|
|
199
200
|
}));
|
|
200
201
|
|
|
202
|
+
const refresh = () => {
|
|
203
|
+
startTimestamp.value = convertTermToEpoch(props.startDate);
|
|
204
|
+
endTimestamp.value = convertTermToEpoch(props.endDate);
|
|
205
|
+
};
|
|
206
|
+
|
|
201
207
|
const onPlayingChange = (value: boolean) => {
|
|
202
208
|
playing.value = value;
|
|
203
209
|
};
|
|
@@ -216,6 +222,10 @@ export default defineComponent({
|
|
|
216
222
|
}
|
|
217
223
|
}, { immediate: true });
|
|
218
224
|
|
|
225
|
+
watch([() => props.startDate, () => props.endDate], () => {
|
|
226
|
+
refresh();
|
|
227
|
+
}, { immediate: true });
|
|
228
|
+
|
|
219
229
|
watch(playing, (value) => {
|
|
220
230
|
if(!value && playingInterval.value) {
|
|
221
231
|
clearInterval(playingInterval.value);
|
|
@@ -231,6 +241,10 @@ export default defineComponent({
|
|
|
231
241
|
}
|
|
232
242
|
});
|
|
233
243
|
|
|
244
|
+
expose({
|
|
245
|
+
refresh,
|
|
246
|
+
});
|
|
247
|
+
|
|
234
248
|
return {
|
|
235
249
|
ticks,
|
|
236
250
|
playing,
|
|
@@ -36,6 +36,8 @@
|
|
|
36
36
|
:step="$props.stepTime"
|
|
37
37
|
:min="startTimestamp"
|
|
38
38
|
:max="endTimestamp"
|
|
39
|
+
:hideHeader="true"
|
|
40
|
+
:maxWidth="null"
|
|
39
41
|
:ticks="ticks"
|
|
40
42
|
showTicks="always"
|
|
41
43
|
:modelValue="$props.modelValue"
|
|
@@ -169,7 +171,7 @@ export default defineComponent({
|
|
|
169
171
|
}
|
|
170
172
|
},
|
|
171
173
|
emits: ['update:modelValue', 'update:startDate', 'update:endDate'],
|
|
172
|
-
setup(props, { emit }) {
|
|
174
|
+
setup(props, { emit, expose }) {
|
|
173
175
|
const { epochToShortTimeOnlyFormat, epochToShortDateFormat, epochToDayMonthShortOnly, epochToISO, epochToMonthShortTimeFormat } = useDateFormat();
|
|
174
176
|
const { convert : convertTermToEpoch } = useDateExpression();
|
|
175
177
|
const { isMobileSized, isExtraSmall } = useBreakpoints();
|
|
@@ -178,9 +180,8 @@ export default defineComponent({
|
|
|
178
180
|
const lightColors = getColors(ColorEnum.Light);
|
|
179
181
|
const playing = ref(false);
|
|
180
182
|
const playingInterval = ref();
|
|
181
|
-
|
|
182
|
-
const
|
|
183
|
-
const endTimestamp = computed(() => convertTermToEpoch(props.endDate));
|
|
183
|
+
const startTimestamp = ref(convertTermToEpoch(props.startDate));
|
|
184
|
+
const endTimestamp = ref(convertTermToEpoch(props.endDate));
|
|
184
185
|
|
|
185
186
|
const tickCount = computed(() => {
|
|
186
187
|
if (isExtraSmall.value) { return 3; }
|
|
@@ -203,6 +204,11 @@ export default defineComponent({
|
|
|
203
204
|
precision: tickPrecision.value
|
|
204
205
|
}));
|
|
205
206
|
|
|
207
|
+
const refresh = () => {
|
|
208
|
+
startTimestamp.value = convertTermToEpoch(props.startDate);
|
|
209
|
+
endTimestamp.value = convertTermToEpoch(props.endDate);
|
|
210
|
+
};
|
|
211
|
+
|
|
206
212
|
const onPlayingChange = (value: boolean) => {
|
|
207
213
|
playing.value = value;
|
|
208
214
|
};
|
|
@@ -223,6 +229,10 @@ export default defineComponent({
|
|
|
223
229
|
}
|
|
224
230
|
}, { immediate: true });
|
|
225
231
|
|
|
232
|
+
watch([() => props.startDate, () => props.endDate], () => {
|
|
233
|
+
refresh();
|
|
234
|
+
}, { immediate: true });
|
|
235
|
+
|
|
226
236
|
watch(playing, (value) => {
|
|
227
237
|
if(!value && playingInterval.value) {
|
|
228
238
|
clearInterval(playingInterval.value);
|
|
@@ -238,6 +248,10 @@ export default defineComponent({
|
|
|
238
248
|
}, props.playingStepDuration);
|
|
239
249
|
});
|
|
240
250
|
|
|
251
|
+
expose({
|
|
252
|
+
refresh,
|
|
253
|
+
});
|
|
254
|
+
|
|
241
255
|
return {
|
|
242
256
|
ticks,
|
|
243
257
|
playing,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-shared-components",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.167",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@dative-gpi/foundation-shared-domain": "1.0.
|
|
14
|
-
"@dative-gpi/foundation-shared-services": "1.0.
|
|
13
|
+
"@dative-gpi/foundation-shared-domain": "1.0.167",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "1.0.167"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@dative-gpi/bones-ui": "^1.0.0",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"sass": "1.71.1",
|
|
36
36
|
"sass-loader": "13.3.2"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "a4466335234a8b4151405d01a1c21801b1f2563d"
|
|
39
39
|
}
|