@sdata/web-vue 1.0.0 → 1.1.0
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.
- package/README.md +4 -12
- package/es/_utils/date.js +15 -15
- package/es/statistic/countdown.vue_vue_type_script_lang.js +5 -5
- package/es/statistic/statistic.vue_vue_type_script_lang.js +2 -2
- package/json/vetur-attributes.json +1253 -1253
- package/json/vetur-tags.json +468 -468
- package/json/web-types.json +3148 -3148
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -10,15 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
<div align="center">
|
|
12
12
|
|
|
13
|
-
基于 [
|
|
14
|
-
|
|
15
|
-
[](https://github.com/liunnn1994/sd-design/blob/main/LICENSE)
|
|
16
|
-
|
|
17
|
-
</div>
|
|
18
|
-
|
|
19
|
-
<div align="center">
|
|
20
|
-
|
|
21
|
-
[English](./README.md) | 简体中文
|
|
13
|
+
基于 [Arco Design](https://arco.design/) 的 Vue UI 组件库。
|
|
22
14
|
|
|
23
15
|
</div>
|
|
24
16
|
|
|
@@ -32,8 +24,8 @@
|
|
|
32
24
|
|
|
33
25
|
海量的样式 tokens, 支持全局以及组件级别的主题配置。有以下 2 种方式可以定制主题:
|
|
34
26
|
|
|
35
|
-
- [Less-loader](https://
|
|
36
|
-
- [风格配置平台](https://
|
|
27
|
+
- [Less-loader](https://arco.design/vue/docs/theme)
|
|
28
|
+
- [风格配置平台](https://arco.design/themes) - 推荐!
|
|
37
29
|
|
|
38
30
|
## TypeScript 友好
|
|
39
31
|
|
|
@@ -140,4 +132,4 @@ pnpm --filter @sdata/web-vue run build
|
|
|
140
132
|
|
|
141
133
|
# License
|
|
142
134
|
|
|
143
|
-
[
|
|
135
|
+
[GNU Affero General Public License v3.0](../../LICENSE)
|
package/es/_utils/date.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.124.0/helpers/objectSpread2.js";
|
|
2
2
|
import { isArray, isDayjs, isQuarter } from "./is.js";
|
|
3
|
-
import
|
|
3
|
+
import dayjs from "dayjs";
|
|
4
4
|
import AdvancedFormat from "dayjs/plugin/advancedFormat";
|
|
5
5
|
import customParseFormat from "dayjs/plugin/customParseFormat";
|
|
6
6
|
import isBetween from "dayjs/plugin/isBetween";
|
|
@@ -26,14 +26,14 @@ var overwriteIsDayjs = (_, Dayjs, dayjs) => {
|
|
|
26
26
|
};
|
|
27
27
|
dayjs.isDayjs = isDayjs;
|
|
28
28
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var dayjs =
|
|
29
|
+
dayjs.extend(overwriteIsDayjs);
|
|
30
|
+
dayjs.extend(customParseFormat);
|
|
31
|
+
dayjs.extend(isBetween);
|
|
32
|
+
dayjs.extend(weekOfYear);
|
|
33
|
+
dayjs.extend(AdvancedFormat);
|
|
34
|
+
dayjs.extend(weekYear);
|
|
35
|
+
dayjs.extend(QuarterOfYear);
|
|
36
|
+
var dayjs$1 = dayjs;
|
|
37
37
|
var methods = {
|
|
38
38
|
add(time, value, unit) {
|
|
39
39
|
return time.add(value, unit);
|
|
@@ -66,7 +66,7 @@ var methods = {
|
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
function getNow() {
|
|
69
|
-
return dayjs();
|
|
69
|
+
return dayjs$1();
|
|
70
70
|
}
|
|
71
71
|
function getSortedDayjsArray(values) {
|
|
72
72
|
return [...values].sort((a, b) => a.valueOf() - b.valueOf());
|
|
@@ -97,10 +97,10 @@ function getDayjsValue(time, format) {
|
|
|
97
97
|
const formatValue = (value) => {
|
|
98
98
|
if (!value) return void 0;
|
|
99
99
|
if (typeof value === "string") {
|
|
100
|
-
if (isQuarter(format)) return dayjs(parseQuarterToMonth(value), format.replace(/\[Q]Q/, "MM"));
|
|
101
|
-
if (dayjs(value, format).isValid()) return dayjs(value, format);
|
|
100
|
+
if (isQuarter(format)) return dayjs$1(parseQuarterToMonth(value), format.replace(/\[Q]Q/, "MM"));
|
|
101
|
+
if (dayjs$1(value, format).isValid()) return dayjs$1(value, format);
|
|
102
102
|
}
|
|
103
|
-
return dayjs(value);
|
|
103
|
+
return dayjs$1(value);
|
|
104
104
|
};
|
|
105
105
|
if (isArray(time)) return time.map(formatValue);
|
|
106
106
|
return formatValue(time);
|
|
@@ -111,7 +111,7 @@ function getDateValue(value) {
|
|
|
111
111
|
return formatValue(value);
|
|
112
112
|
}
|
|
113
113
|
function initializeDateLocale(localeName, weekStart) {
|
|
114
|
-
dayjs.locale(_objectSpread2(_objectSpread2({}, dayjs.Ls[localeName.toLocaleLowerCase()]), {}, { weekStart }));
|
|
114
|
+
dayjs$1.locale(_objectSpread2(_objectSpread2({}, dayjs$1.Ls[localeName.toLocaleLowerCase()]), {}, { weekStart }));
|
|
115
115
|
}
|
|
116
116
|
function pickDataAttributes(obj) {
|
|
117
117
|
const clone = {};
|
|
@@ -123,4 +123,4 @@ function pickDataAttributes(obj) {
|
|
|
123
123
|
return clone;
|
|
124
124
|
}
|
|
125
125
|
//#endregion
|
|
126
|
-
export { dayjs, getDateValue, getDayjsValue, getNow, getSortedDayjsArray, initializeDateLocale, isValueChange, methods, pickDataAttributes };
|
|
126
|
+
export { dayjs$1 as dayjs, getDateValue, getDayjsValue, getNow, getSortedDayjsArray, initializeDateLocale, isValueChange, methods, pickDataAttributes };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getPrefixCls } from "../_utils/global-config.js";
|
|
2
2
|
import { getDateString } from "./utils.js";
|
|
3
3
|
import { defineComponent, onBeforeUnmount, onMounted, ref, toRefs, watch } from "vue";
|
|
4
|
-
import
|
|
4
|
+
import dayjs from "dayjs";
|
|
5
5
|
//#region components/statistic/countdown.vue?vue&type=script&lang.ts
|
|
6
6
|
var countdown_vue_vue_type_script_lang_default = defineComponent({
|
|
7
7
|
name: "Countdown",
|
|
@@ -29,13 +29,13 @@ var countdown_vue_vue_type_script_lang_default = defineComponent({
|
|
|
29
29
|
setup(props, { emit }) {
|
|
30
30
|
const prefixCls = getPrefixCls("statistic");
|
|
31
31
|
const { start, value, now, format } = toRefs(props);
|
|
32
|
-
const displayValue = ref(getDateString(Math.max(
|
|
32
|
+
const displayValue = ref(getDateString(Math.max(dayjs(props.value).diff(dayjs(props.now), "millisecond"), 0), props.format));
|
|
33
33
|
watch([
|
|
34
34
|
value,
|
|
35
35
|
now,
|
|
36
36
|
format
|
|
37
37
|
], () => {
|
|
38
|
-
const _value = getDateString(Math.max(
|
|
38
|
+
const _value = getDateString(Math.max(dayjs(props.value).diff(dayjs(props.now), "millisecond"), 0), props.format);
|
|
39
39
|
if (_value !== displayValue.value) displayValue.value = _value;
|
|
40
40
|
});
|
|
41
41
|
const timer = ref(0);
|
|
@@ -46,9 +46,9 @@ var countdown_vue_vue_type_script_lang_default = defineComponent({
|
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
const startTimer = () => {
|
|
49
|
-
if (
|
|
49
|
+
if (dayjs(props.value).valueOf() < Date.now()) return;
|
|
50
50
|
timer.value = window.setInterval(() => {
|
|
51
|
-
const _value =
|
|
51
|
+
const _value = dayjs(props.value).diff(dayjs(), "millisecond");
|
|
52
52
|
if (_value <= 0) {
|
|
53
53
|
stopTimer();
|
|
54
54
|
emit("finish");
|
|
@@ -2,7 +2,7 @@ import { getPrefixCls } from "../_utils/global-config.js";
|
|
|
2
2
|
import { isNumber, isUndefined } from "../_utils/is.js";
|
|
3
3
|
import { computed, defineComponent, onMounted, ref, toRefs, watch } from "vue";
|
|
4
4
|
import BTween from "b-tween";
|
|
5
|
-
import
|
|
5
|
+
import dayjs from "dayjs";
|
|
6
6
|
import NP from "number-precision";
|
|
7
7
|
//#region components/statistic/statistic.vue?vue&type=script&lang.ts
|
|
8
8
|
var statistic_vue_vue_type_script_lang_default = defineComponent({
|
|
@@ -83,7 +83,7 @@ var statistic_vue_vue_type_script_lang_default = defineComponent({
|
|
|
83
83
|
decimal: splitValue[1]
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
|
-
if (props.format) _value =
|
|
86
|
+
if (props.format) _value = dayjs(_value).format(props.format);
|
|
87
87
|
return {
|
|
88
88
|
isNumber: false,
|
|
89
89
|
value: _value
|