@utogether/udp-core 1.0.1-beta.3 → 1.0.1-beta.5

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 (94) hide show
  1. package/build/plugins.ts +39 -37
  2. package/dist/{403-BuP9jvH9.js → 403-CP2RkkAy.js} +10 -10
  3. package/dist/{404-DfQk8kKl.js → 404-DwK-0wNQ.js} +4 -4
  4. package/dist/{500-OgROWdiZ.js → 500-CLbJDqnd.js} +1 -1
  5. package/dist/{AuthorityInfo-q2ksfkWH.js → AuthorityInfo-Bi1_uhMu.js} +1 -1
  6. package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-Bwsf6lMH.js → AuthorityInfo.vue_vue_type_style_index_0_lang-RUhvzu76.js} +8 -9
  7. package/dist/{Company-DgqowAxc.js → Company-B--cokc6.js} +3 -3
  8. package/dist/{CompanyPanel-BNb1rUhD.js → CompanyPanel-B_gmcZ9L.js} +6 -6
  9. package/dist/{Department-Cl8CROSU.js → Department-DbKdyNzK.js} +3 -3
  10. package/dist/{DepartmentPanel-D5VkqKeP.js → DepartmentPanel-BmEttboJ.js} +23 -24
  11. package/dist/{DesignPanel-BGvEusHC.js → DesignPanel-LL68_36s.js} +1 -1
  12. package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-BQF1uQ7w.js → DesignPanel.vue_vue_type_style_index_0_lang-DWPmFegv.js} +8 -9
  13. package/dist/{DictView-BnxfaOBv.js → DictView-B8j-EWx5.js} +1 -1
  14. package/dist/{InvOrganization-5y79ZLdY.js → InvOrganization-DnGQlESM.js} +7 -8
  15. package/dist/Org-Dg9Xkd34.js +34 -0
  16. package/dist/{Preview-BaGmXH7r.js → Preview-yot4NBW5.js} +1 -1
  17. package/dist/{ReportDefine-DkQdBErt.js → ReportDefine-DHadqNYy.js} +1 -1
  18. package/dist/{ReportDesign-DzB_A_G6.js → ReportDesign-CBihGRth.js} +23 -24
  19. package/dist/{ReportQuery-DRcMb6ya.js → ReportQuery-CwHQ6LUU.js} +1 -1
  20. package/dist/{ReportQueryFrom-CeA9xhR4.js → ReportQueryFrom-ie6lQcGL.js} +1 -1
  21. package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-CgGtcs5V.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-B8LJNK0m.js} +1 -1
  22. package/dist/{ReportTemplate-qaiTMQuT.js → ReportTemplate-B2Smwo-z.js} +18 -18
  23. package/dist/{Role-DsFulAjq.js → Role-Cf7DB7uS.js} +3 -3
  24. package/dist/{RoleAssign-DMRdocpa.js → RoleAssign-upUnqs_i.js} +3 -3
  25. package/dist/{RolePanel-wXVysDHM.js → RolePanel-BBGDGK8V.js} +1 -1
  26. package/dist/{RolePanel-B9POS_pg.js → RolePanel-EXL_FLvM.js} +1 -1
  27. package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-t6S_0zmJ.js → RolePanel.vue_vue_type_script_setup_true_lang-BwfL_JVZ.js} +8 -9
  28. package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-CleVvkcY.js → RolePanel.vue_vue_type_script_setup_true_lang-DF8qJKwW.js} +9 -9
  29. package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-DlXUs0j9.js → ScrollPanel.vue_vue_type_style_index_0_lang-DbBGg32H.js} +13 -13
  30. package/dist/{Staff-Cq4V7ruC.js → Staff-DYu5ZEyR.js} +3 -3
  31. package/dist/{StaffInfo-CJDKMbud.js → StaffInfo-CHvNGjtz.js} +1 -1
  32. package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-DQ4DL1KY.js → StaffInfo.vue_vue_type_script_setup_true_lang-XRJVEJ-s.js} +14 -14
  33. package/dist/{StaffPanel-CG-uggdr.js → StaffPanel-C-ygEY65.js} +1 -1
  34. package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-DAgN7zN2.js → StaffPanel.vue_vue_type_script_setup_true_lang-BvLrF4Yw.js} +6 -6
  35. package/dist/{SysUser-kwnzRNdD.js → SysUser-BHk_szpK.js} +2 -2
  36. package/dist/{SysUserPanel-DTlZf3vk.js → SysUserPanel-DFvzA5d-.js} +1 -1
  37. package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-BW6PlGjM.js → SysUserPanel.vue_vue_type_script_setup_true_lang-B9zUXXwa.js} +24 -25
  38. package/dist/{SystemMenu-BVT0n-L2.js → SystemMenu-5TK9ZA11.js} +34 -35
  39. package/dist/{UserInfo-BbTQ9Zat.js → UserInfo-Bx3zQqHa.js} +1 -1
  40. package/dist/{UserInfo.vue_vue_type_style_index_0_lang-D_bpYDmI.js → UserInfo.vue_vue_type_style_index_0_lang-C2sqUQdg.js} +12 -13
  41. package/dist/{childView-BJbIhjmf.js → childView-BSUWnii7.js} +1 -1
  42. package/dist/{childView-DCsGFrG-.js → childView-CFC3gA_U.js} +1 -1
  43. package/dist/{childView.vue_vue_type_style_index_0_lang-CDtsalCm.js → childView.vue_vue_type_style_index_0_lang-EcT-Dux7.js} +48 -49
  44. package/dist/{childView.vue_vue_type_style_index_0_lang-BCDxpVoD.js → childView.vue_vue_type_style_index_0_lang-WQVLSJR8.js} +9 -10
  45. package/dist/{code-rule-DePU6cdp.js → code-rule-DybjhotB.js} +6 -8
  46. package/dist/core.es.js +14 -11
  47. package/dist/{cron-task-DUM1SIGL.js → cron-task-DGdknqaF.js} +7 -8
  48. package/dist/{frameView-CEUTDtSm.js → frameView-BOOZRv1S.js} +1 -1
  49. package/dist/index-BDE4-ZvN.js +5091 -0
  50. package/dist/{layoutView-PCjwVwkX.js → layoutView-BWeDLY9C.js} +11 -12
  51. package/dist/{login-B1CjWVKu.js → login-BcuCHhGE.js} +21 -21
  52. package/dist/{login-log-CvVnyGi3.js → login-log-kqKzKTto.js} +1 -1
  53. package/dist/{lov-view-D8wwkxFJ.js → lov-view-DDgzqYSW.js} +8 -9
  54. package/dist/{menuInfo-B5JKVwrB.js → menuInfo-B3MOxomU.js} +1 -1
  55. package/dist/{menuInfo.vue_vue_type_style_index_0_lang-CcM9WX4n.js → menuInfo.vue_vue_type_style_index_0_lang-BXMrNMUs.js} +19 -18
  56. package/dist/{pda-app-DIa1p1Ww.js → pda-app-Dy9WMHEG.js} +19 -20
  57. package/dist/{resource-CCQ7Dd-5.js → resource-BoCP7-dM.js} +8 -8
  58. package/dist/{su-welcome-CLp9YaJa.js → su-welcome-DXpI1MHr.js} +97 -98
  59. package/dist/{sys-config-BBmf_SqF.js → sys-config-BiUWzxGU.js} +19 -20
  60. package/dist/udp-core.css +2 -2
  61. package/dist/{utogether-Bkptx2lB.js → utogether-DXDcsKt7.js} +1 -1
  62. package/index.ts +40 -36
  63. package/package.json +1 -1
  64. package/src/App.vue +1 -1
  65. package/src/api/index.ts +1 -1
  66. package/src/components/udp/count-down.vue +536 -0
  67. package/src/components/udp/form.vue +107 -0
  68. package/src/components/udp/grid.vue +6 -1
  69. package/src/components/udp/index.ts +4 -1
  70. package/src/components/udp/modal-form.vue +9 -0
  71. package/src/components/udp/upload.vue +425 -0
  72. package/src/components/udp/utils.ts +72 -3
  73. package/src/directives/permission/index.ts +1 -1
  74. package/src/layout/components/lay-panel/index.vue +3 -3
  75. package/src/main.ts +111 -110
  76. package/src/plugins/vxe-table/index.ts +3 -3
  77. package/src/router/index.ts +187 -183
  78. package/src/router/modules/remaining.ts +58 -83
  79. package/src/style/vxetable.scss +30 -1
  80. package/src/utils/authority/index.ts +1 -1
  81. package/src/utils/{http → udp/http}/index.ts +8 -24
  82. package/src/utils/{http → udp/http}/types.d.ts +8 -5
  83. package/src/views/login/login-view.vue +1 -1
  84. package/src/views/system/menu/menuInfo.vue +7 -3
  85. package/src/views/system/sys/sys-config.vue +1 -1
  86. package/src/views/udev/dict/childView.vue +6 -1
  87. package/src/views/uhome/su-welcome.vue +1 -1
  88. package/src/views/ulogin/login.vue +3 -2
  89. package/src/views/upms/user/login-log.vue +1 -1
  90. package/src/views/urpt/design/ReportDesign.vue +3 -3
  91. package/types/global.d.ts +2 -1
  92. package/dist/Org-2oBAXN2r.js +0 -35
  93. package/dist/await-to-js.es5-BtRbN2QH.js +0 -10
  94. package/dist/index-ZdgOD7cF.js +0 -3399
@@ -1,6 +1,6 @@
1
1
  import { computed as W, ref as L } from "vue";
2
2
  import { useGlobal as g, storageLocal as u, deviceDetection as H, cookies as C, storageSession as M } from "@utogether/utils";
3
- import { y as P, j as E, s as j, g as h, v as d, z as J, l as K, m as R, n as V, u as S, r as G, o as O, A as x, B as Z } from "./index-ZdgOD7cF.js";
3
+ import { z as P, j as E, s as j, g as h, w as d, A as J, l as K, m as R, n as V, u as S, r as G, o as O, B as x, C as Z } from "./index-BDE4-ZvN.js";
4
4
  import { useI18n as f } from "vue-i18n";
5
5
  import { defineStore as v } from "pinia";
6
6
  function I() {
package/index.ts CHANGED
@@ -1,36 +1,40 @@
1
- /*
2
- * @Author: levi7754 levi7754@163.com
3
- * @Date: 2024-04-14 19:10:28
4
- * @LastEditors: wei.li
5
- * @LastEditTime: 2024-06-26 17:08:49
6
- * @FilePath: /udp-front/packages/udp-core/index.ts
7
- * @Description:
8
- */
9
-
10
- import UInit from './src/main';
11
- export default UInit;
12
-
13
- import { store } from './src/store';
14
- import hasAuthority from './src/utils/authority';
15
-
16
- import { useSystemStoreHook as useSystemStore } from './src/store/modules/system';
17
- import { useMultiTagsStoreHook as useMultiTagsStore } from './src/store/modules/multiTags';
18
- import { usePermissionStoreHook as usePermissionStore } from './src/store/modules/permission';
19
-
20
- import { handleAliveRoute, delCurrentRoute } from './src/router/utils';
21
-
22
- import { lifeCycleEvent } from './src/utils/lifecycle';
23
-
24
- import { getServiceApi } from './src/api';
25
-
26
- export {
27
- store,
28
- hasAuthority,
29
- useSystemStore,
30
- useMultiTagsStore,
31
- usePermissionStore,
32
- delCurrentRoute,
33
- handleAliveRoute,
34
- getServiceApi,
35
- lifeCycleEvent
36
- };
1
+ /*
2
+ * @Author: levi7754 levi7754@163.com
3
+ * @Date: 2024-04-14 19:10:28
4
+ * @LastEditors: levi7754 levi7754@163.com
5
+ * @LastEditTime: 2025-07-27 11:04:41
6
+ * @FilePath: /udp-front/packages/udp-core/index.ts
7
+ * @Description:
8
+ */
9
+
10
+ import UInit from './src/main';
11
+ export default UInit;
12
+
13
+ import { store } from './src/store';
14
+ import hasAuthority from './src/utils/authority';
15
+
16
+ import { useSystemStoreHook as useSystemStore } from './src/store/modules/system';
17
+ import { useMultiTagsStoreHook as useMultiTagsStore } from './src/store/modules/multiTags';
18
+ import { usePermissionStoreHook as usePermissionStore } from './src/store/modules/permission';
19
+
20
+ import { handleAliveRoute, delCurrentRoute } from './src/router/utils';
21
+ import { constantRoutes, remainingRouters, routerBefore } from './src/router';
22
+
23
+ import { lifeCycleEvent } from './src/utils/lifecycle';
24
+
25
+ import { getServiceApi } from './src/api';
26
+
27
+ export {
28
+ store,
29
+ hasAuthority,
30
+ useSystemStore,
31
+ useMultiTagsStore,
32
+ usePermissionStore,
33
+ delCurrentRoute,
34
+ handleAliveRoute,
35
+ getServiceApi,
36
+ lifeCycleEvent,
37
+ routerBefore,
38
+ constantRoutes,
39
+ remainingRouters
40
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@utogether/udp-core",
3
3
  "private": false,
4
- "version": "1.0.1-beta.3",
4
+ "version": "1.0.1-beta.5",
5
5
  "description": "",
6
6
  "type": "module",
7
7
  "main1": "index.ts",
package/src/App.vue CHANGED
@@ -6,7 +6,7 @@
6
6
  * @Description: file content
7
7
  -->
8
8
  <template>
9
- <el-config-provider size="small" :z-index="12000" :locale="currentLocale">
9
+ <el-config-provider size="small" :z-index="5555" :locale="currentLocale">
10
10
  <router-view />
11
11
  </el-config-provider>
12
12
  </template>
package/src/api/index.ts CHANGED
@@ -6,6 +6,7 @@
6
6
  * @Description: API封装
7
7
  */
8
8
  import { http } from '@utogether/utils';
9
+ // import { http } from '../utils/udp/http';
9
10
  import { getEnv } from '../config';
10
11
 
11
12
  // 路由相关服务
@@ -20,7 +21,6 @@ export const getServiceApi = () => {
20
21
 
21
22
  export const setRouter = router => {
22
23
  http.setRouter(router);
23
- console.log('====url', getBaseURL());
24
24
  // http.setBaseUrl(getBaseURL());
25
25
  };
26
26
 
@@ -0,0 +1,536 @@
1
+ <template>
2
+ <div class="flip-clock">
3
+ <template v-for="data in timeData" :key="data.label">
4
+ <span v-show="data.show" :id="data.elementId" class="flip-clock__piece">
5
+ <div v-if="flipAnimation">
6
+ <span
7
+ class="flip-clock__card flip-card"
8
+ :style="countdownSize ? `font-size:${countdownSize}` : ''"
9
+ >
10
+ <b class="flip-card__top">{{ twoDigits(data.current) }}</b>
11
+ <b class="flip-card__bottom" :data-value="twoDigits(data.current)" />
12
+ <b class="flip-card__back" :data-value="twoDigits(data.previous)" />
13
+ <b class="flip-card__back-bottom" :data-value="twoDigits(data.previous)" />
14
+ </span>
15
+ </div>
16
+ <div v-else>
17
+ <span class="no-animation__card">{{ twoDigits(data.current) }}</span>
18
+ </div>
19
+ <span
20
+ v-if="showLabels"
21
+ class="flip-clock__slot"
22
+ :style="labelSize ? `font-size:${labelSize}` : ''"
23
+ >{{ data.label }}</span
24
+ >
25
+ </span>
26
+ </template>
27
+ </div>
28
+ </template>
29
+
30
+ <script lang="ts">
31
+ export default {
32
+ name: 'SuCountdown'
33
+ };
34
+ </script>
35
+
36
+ <script setup lang="ts">
37
+ import { computed, onBeforeMount, onMounted, onUnmounted, ref, watch } from 'vue';
38
+ import dayjs from 'dayjs';
39
+
40
+ const props = defineProps({
41
+ countdown: {
42
+ type: Boolean,
43
+ default: false
44
+ },
45
+ deadline: {
46
+ type: String,
47
+ required: false,
48
+ default: dayjs().add(5, 'days').format('YYYY-MM-DD HH:mm:ss')
49
+ },
50
+ deadlineISO: {
51
+ type: String,
52
+ required: false
53
+ },
54
+ deadlineDate: {
55
+ type: Date,
56
+ required: false
57
+ },
58
+ countdownSize: {
59
+ type: String,
60
+ required: false
61
+ // default:"2.2rem"
62
+ },
63
+
64
+ labelSize: {
65
+ type: String,
66
+ required: false
67
+ // default:"2.2rem"
68
+ },
69
+ stop: {
70
+ type: Boolean,
71
+ required: false
72
+ },
73
+ flipAnimation: {
74
+ type: Boolean,
75
+ required: false,
76
+ default: true
77
+ },
78
+ showDays: {
79
+ type: Boolean,
80
+ required: false,
81
+ default: true
82
+ },
83
+ showHours: {
84
+ type: Boolean,
85
+ required: false,
86
+ default: true
87
+ },
88
+ showMinutes: {
89
+ type: Boolean,
90
+ required: false,
91
+ default: true
92
+ },
93
+ showSeconds: {
94
+ type: Boolean,
95
+ required: false,
96
+ default: true
97
+ },
98
+ showLabels: {
99
+ type: Boolean,
100
+ required: false,
101
+ default: true
102
+ },
103
+ labels: {
104
+ type: Object,
105
+ required: false,
106
+ default: function () {
107
+ return {
108
+ days: 'Days',
109
+ hours: 'Hours',
110
+ minutes: 'Minutes',
111
+ seconds: 'Seconds'
112
+ };
113
+ }
114
+ },
115
+ mainColor: {
116
+ type: String,
117
+ default: '#EC685C'
118
+ },
119
+ secondFlipColor: {
120
+ type: String,
121
+ default: props => props.mainColor
122
+ },
123
+ mainFlipBackgroundColor: {
124
+ type: String,
125
+ default: '#222222'
126
+ },
127
+ secondFlipBackgroundColor: {
128
+ type: String,
129
+ default: '#393939'
130
+ },
131
+ labelColor: {
132
+ type: String,
133
+ default: '#222222'
134
+ }
135
+ });
136
+
137
+ const now = ref(Math.trunc(new Date().getTime() / 1000));
138
+ const date = ref<number>(0);
139
+ const interval = ref();
140
+ const diff = ref(0);
141
+ const show = ref(false);
142
+ const timeData = ref([
143
+ {
144
+ current: 0,
145
+ previous: 0,
146
+ label: props.labels.days,
147
+ elementId: 'flip-card-days-' + Date.now(),
148
+ show: props.showDays
149
+ },
150
+ {
151
+ current: 0,
152
+ previous: 0,
153
+ label: props.labels.hours,
154
+ elementId: 'flip-card-hours-' + Date.now(),
155
+ show: props.showHours
156
+ },
157
+ {
158
+ current: 0,
159
+ previous: 0,
160
+ label: props.labels.minutes,
161
+ elementId: 'flip-card-minutes-' + Date.now(),
162
+ show: props.showMinutes
163
+ },
164
+ {
165
+ current: 0,
166
+ previous: 0,
167
+ label: props.labels.seconds,
168
+ elementId: 'flip-card-seconds-' + Date.now(),
169
+ show: props.showSeconds
170
+ }
171
+ ]);
172
+
173
+ const updateAllCards = () => {
174
+ updateTime(0, days);
175
+ updateTime(1, hours);
176
+ updateTime(2, minutes);
177
+ updateTime(3, seconds);
178
+ };
179
+
180
+ const twoDigits = value => {
181
+ if (value != undefined) {
182
+ if (value.toString().length <= 1) {
183
+ return '0' + value.toString();
184
+ }
185
+ return value.toString();
186
+ } else {
187
+ return '00';
188
+ }
189
+ };
190
+
191
+ const updateTime = (idx, newValue) => {
192
+ if (idx >= timeData.value.length || newValue === undefined) {
193
+ return;
194
+ }
195
+
196
+ // if (window['requestAnimationFrame']) {
197
+ // frame = requestAnimationFrame(updateTime.bind(this));
198
+ // }
199
+
200
+ const d = timeData.value[idx];
201
+ const val = newValue.value < 0 ? 0 : newValue.value;
202
+ const el = document.querySelector(`#${d.elementId}`);
203
+
204
+ if (val !== d.current) {
205
+ d.previous = d.current;
206
+ d.current = val;
207
+
208
+ if (el) {
209
+ el.classList.remove('flip');
210
+ // @ts-ignore
211
+ void el.offsetWidth;
212
+ el.classList.add('flip');
213
+ }
214
+
215
+ if (idx === 0) {
216
+ const els = el!.querySelectorAll('span b');
217
+ if (els) {
218
+ //@ts-ignore
219
+ for (const e of els) {
220
+ const cls = e.classList[0];
221
+ if (newValue.value / 1000 >= 1) {
222
+ if (!cls.includes('-4digits')) {
223
+ const newCls = cls + '-4digits';
224
+ e.classList.add(newCls);
225
+ e.classList.remove(cls);
226
+ }
227
+ } else {
228
+ if (cls.includes('-4digits')) {
229
+ const newCls = cls.replace('-4digits', '');
230
+ e.classList.add(newCls);
231
+ e.classList.remove(cls);
232
+ }
233
+ }
234
+ }
235
+ } else {
236
+ console.log('....');
237
+ }
238
+ }
239
+ }
240
+ };
241
+
242
+ const seconds = computed(() => {
243
+ if (props.countdown) {
244
+ return Math.trunc(diff.value) % 60;
245
+ }
246
+ return Math.trunc(now.value) % 60;
247
+ });
248
+
249
+ const minutes = computed(() => {
250
+ if (props.countdown) {
251
+ return Math.trunc(diff.value / 60) % 60;
252
+ }
253
+ return Math.trunc(now.value / 60) % 60;
254
+ });
255
+ const hours = computed(() => {
256
+ if (props.countdown) {
257
+ return Math.trunc(diff.value / 60 / 60) % 24;
258
+ }
259
+ return new Date(now.value * 1000).getHours();
260
+ // return Math.trunc(now.value / 60 / 60) % 24;
261
+ });
262
+ const days = computed(() => {
263
+ if (props.countdown) {
264
+ return Math.trunc(diff.value / 60 / 60 / 24);
265
+ }
266
+ return Math.trunc(now.value / 60 / 60 / 24);
267
+ });
268
+
269
+ watch(
270
+ () => props.deadline,
271
+ newVal => {
272
+ const endTime = newVal as unknown as String;
273
+ date.value = Math.trunc(Date.parse(endTime.replace(/-/g, '/')) / 1000);
274
+ if (!date.value) {
275
+ throw new Error("Invalid props value, correct the 'deadline'");
276
+ }
277
+ }
278
+ );
279
+
280
+ watch(now, () => {
281
+ if (props.countdown) {
282
+ diff.value = date.value - now.value;
283
+ if (diff.value <= 0 || props.stop) {
284
+ diff.value = 0;
285
+ updateTime(3, 0);
286
+ } else {
287
+ updateAllCards();
288
+ }
289
+ } else {
290
+ updateAllCards();
291
+ }
292
+ });
293
+
294
+ watch(diff, newVal => {
295
+ if (newVal == 0) {
296
+ // emit('timeElapsed');
297
+ updateAllCards();
298
+ }
299
+ });
300
+
301
+ onMounted(() => {
302
+ if (diff.value !== 0) {
303
+ show.value = true;
304
+ }
305
+ });
306
+
307
+ onBeforeMount(() => {
308
+ if (props.countdown) {
309
+ if (!props.deadline) {
310
+ throw new Error("Missing props 'deadline'");
311
+ }
312
+ const endTime = props.deadline;
313
+ let epoch = Date.parse(endTime.replace(/-/g, '/'));
314
+ if (props.deadlineDate != null) {
315
+ epoch = Date.parse(props.deadlineDate.toDateString());
316
+ }
317
+ if (props.deadlineISO) {
318
+ epoch = Date.parse(props.deadlineISO);
319
+ }
320
+ date.value = Math.trunc(epoch / 1000);
321
+ if (!date.value) {
322
+ throw new Error("Invalid props value, correct the 'deadline'");
323
+ }
324
+ }
325
+ interval.value = setInterval(() => {
326
+ now.value = Math.trunc(new Date().getTime() / 1000);
327
+ }, 1000);
328
+ });
329
+
330
+ onUnmounted(() => {
331
+ // if (window['cancelAnimationFrame']) {
332
+ // cancelAnimationFrame(frame);
333
+ // }
334
+ clearInterval(interval.value);
335
+ });
336
+ </script>
337
+
338
+ <style lang="scss">
339
+ .no-animation__card {
340
+ font-weight: 500;
341
+ font-size: 2rem;
342
+ line-height: 1.5;
343
+ display: block;
344
+ color: v-bind(mainColor);
345
+ }
346
+
347
+ .flip-clock {
348
+ text-align: center;
349
+ perspective: 600px;
350
+ margin: 0 auto;
351
+
352
+ *,
353
+ *:before,
354
+ *:after {
355
+ box-sizing: border-box;
356
+ }
357
+ }
358
+
359
+ .flip-clock__piece {
360
+ display: inline-block;
361
+ margin: 0 0.2vw;
362
+
363
+ @media (min-width: 1000px) {
364
+ margin: 0 5px;
365
+ }
366
+ }
367
+
368
+ .flip-clock__slot {
369
+ font-size: 1rem;
370
+ line-height: 1.5;
371
+ display: block;
372
+ color: v-bind(labelColor);
373
+ }
374
+
375
+ $halfHeight: 0.72em;
376
+ $borderRadius: 0.15em;
377
+
378
+ .flip-card {
379
+ display: block;
380
+ position: relative;
381
+ padding-bottom: $halfHeight;
382
+ font-size: 2.25rem;
383
+ line-height: 0.95;
384
+ }
385
+
386
+ @media (min-width: 1000px) {
387
+ .flip-clock__slot {
388
+ font-size: 1.2rem;
389
+ }
390
+
391
+ .flip-card {
392
+ font-size: 3rem;
393
+ }
394
+ }
395
+
396
+ .flip-card__top,
397
+ .flip-card__bottom,
398
+ .flip-card__back-bottom,
399
+ .flip-card__back::before,
400
+ .flip-card__back::after {
401
+ display: block;
402
+ height: $halfHeight;
403
+ color: v-bind(mainColor);
404
+ background: v-bind(mainFlipBackgroundColor);
405
+ padding: 0.23em 0.15em 0.4em;
406
+ border-radius: $borderRadius $borderRadius 0 0;
407
+ backface-visibility: hidden;
408
+ -webkit-backface-visibility: hidden;
409
+ transform-style: preserve-3d;
410
+ width: 2.1em;
411
+ height: $halfHeight;
412
+ }
413
+
414
+ .flip-card__top-4digits,
415
+ .flip-card__bottom-4digits,
416
+ .flip-card__back-bottom-4digits,
417
+ .flip-card__back-4digits::before,
418
+ .flip-card__back-4digits::after {
419
+ display: block;
420
+ height: $halfHeight;
421
+ color: v-bind(mainColor);
422
+ background: v-bind(mainFlipBackgroundColor);
423
+ padding: 0.23em 0.15em 0.4em;
424
+ border-radius: $borderRadius $borderRadius 0 0;
425
+ backface-visibility: hidden;
426
+ -webkit-backface-visibility: hidden;
427
+ transform-style: preserve-3d;
428
+ width: 2.65em;
429
+ height: $halfHeight;
430
+ }
431
+
432
+ .flip-card__bottom,
433
+ .flip-card__back-bottom,
434
+ .flip-card__bottom-4digits,
435
+ .flip-card__back-bottom-4digits {
436
+ color: v-bind(secondFlipColor);
437
+ position: absolute;
438
+ top: 50%;
439
+ left: 0;
440
+ border-top: solid 1px #000;
441
+ background: v-bind(secondFlipBackgroundColor);
442
+ border-radius: 0 0 $borderRadius $borderRadius;
443
+ pointer-events: none;
444
+ overflow: hidden;
445
+ z-index: 2;
446
+ }
447
+
448
+ .flip-card__back-bottom,
449
+ .flip-card__back-bottom-4digits {
450
+ z-index: 1;
451
+ }
452
+
453
+ .flip-card__bottom::after,
454
+ .flip-card__back-bottom::after,
455
+ .flip-card__bottom-4digits::after,
456
+ .flip-card__back-bottom-4digits::after {
457
+ display: block;
458
+ margin-top: -$halfHeight;
459
+ }
460
+
461
+ .flip-card__back::before,
462
+ .flip-card__bottom::after,
463
+ .flip-card__back-bottom::after,
464
+ .flip-card__back-4digits::before,
465
+ .flip-card__bottom-4digits::after,
466
+ .flip-card__back-bottom-4digits::after {
467
+ content: attr(data-value);
468
+ }
469
+
470
+ .flip-card__back,
471
+ .flip-card__back-4digits {
472
+ position: absolute;
473
+ top: 0;
474
+ height: 100%;
475
+ left: 0%;
476
+ pointer-events: none;
477
+ }
478
+
479
+ .flip-card__back::before,
480
+ .flip-card__back-4digits::before {
481
+ position: relative;
482
+ overflow: hidden;
483
+ z-index: -1;
484
+ }
485
+
486
+ .flip .flip-card__back::before,
487
+ .flip .flip-card__back-4digits::before {
488
+ z-index: 1;
489
+ animation: flipTop 0.3s cubic-bezier(0.37, 0.01, 0.94, 0.35);
490
+ animation-fill-mode: both;
491
+ transform-origin: center bottom;
492
+ }
493
+
494
+ .flip .flip-card__bottom,
495
+ .flip .flip-card__bottom-4digits {
496
+ transform-origin: center top;
497
+ animation-fill-mode: both;
498
+ animation: flipBottom 0.6s cubic-bezier(0.15, 0.45, 0.28, 1);
499
+ }
500
+
501
+ @keyframes flipTop {
502
+ 0% {
503
+ transform: rotateX(0deg);
504
+ z-index: 2;
505
+ }
506
+
507
+ 0%,
508
+ 99% {
509
+ opacity: 1;
510
+ }
511
+
512
+ 100% {
513
+ transform: rotateX(-90deg);
514
+ opacity: 0;
515
+ }
516
+ }
517
+
518
+ @keyframes flipBottom {
519
+ 0%,
520
+ 50% {
521
+ z-index: -1;
522
+ transform: rotateX(90deg);
523
+ opacity: 0;
524
+ }
525
+
526
+ 51% {
527
+ opacity: 1;
528
+ }
529
+
530
+ 100% {
531
+ opacity: 1;
532
+ transform: rotateX(0deg);
533
+ z-index: 5;
534
+ }
535
+ }
536
+ </style>