@ftlab/one-vue3 0.4.5 → 0.4.6
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/CHANGELOG.md +6 -0
- package/dist/utils.js +14 -12
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [v0.4.6] - 2026-11-26
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- **`utils` 导出的 dayjs 丢失插件注册**:`utils/date.ts` 顶部原本是 6 条独立的 `dayjs.extend(utc/timezone/weekOfYear/isoWeek/duration/customParseFormat)` 语句,而 `package.json` 的 `sideEffects` 只列了 CSS 文件(等于声明所有 JS 无副作用),消费方打包器会把 `dist/utils.js` 折叠成 `dayjs` 的再导出并**连带丢掉这些 extend** → 消费方拿到没有 `tz`/`utc` 的裸 dayjs,日期组件报 `x.default.tz is not a function`(ccms-web 1.1.4 线上事故;只在"消费方仅从 utils 导入 `{ dayjs }`"时触发,dataview-web / oms-admin-web 未触发)
|
|
7
|
+
- 修法:注册移入 `withPlugins()` 并作为导出值的初始化(`const dayjs = withPlugins(baseDayjs)`),只要用到 `{ dayjs }` 注册必执行,不再依赖 sideEffects 与 tree-shaking 行为;同时把 `dist/utils*.js` 补进 `sideEffects`
|
|
8
|
+
|
|
3
9
|
## [v0.4.5] - 2026-11-26
|
|
4
10
|
|
|
5
11
|
### Fixed
|
package/dist/utils.js
CHANGED
|
@@ -538,21 +538,23 @@ var r = Object.create, i = Object.defineProperty, a = Object.getOwnPropertyDescr
|
|
|
538
538
|
};
|
|
539
539
|
}));
|
|
540
540
|
})), v = /* @__PURE__ */ d(f(), 1), y = /* @__PURE__ */ d(p(), 1), b = /* @__PURE__ */ d(m(), 1), x = /* @__PURE__ */ d(h(), 1), S = /* @__PURE__ */ d(g(), 1), C = /* @__PURE__ */ d(_(), 1);
|
|
541
|
-
|
|
542
|
-
|
|
541
|
+
function w(e) {
|
|
542
|
+
return e.extend(v.default), e.extend(y.default), e.extend(b.default), e.extend(x.default), e.extend(S.default), e.extend(C.default), e;
|
|
543
|
+
}
|
|
544
|
+
var T = w(n), E = "YYYY-MM-DD HH:mm:ss", D = (e) => {
|
|
543
545
|
let t = new Date(e);
|
|
544
546
|
if (!isNaN(t.getTime())) {
|
|
545
547
|
let e = t.getFullYear(), n = t.getMonth() + 1;
|
|
546
548
|
return t.getDate() === 29 && n === 2 ? e % 4 == 0 && e % 100 != 0 || e % 400 == 0 : !0;
|
|
547
549
|
}
|
|
548
550
|
return !isNaN(t.getTime());
|
|
549
|
-
},
|
|
550
|
-
if (!e || !
|
|
551
|
-
let
|
|
552
|
-
return
|
|
553
|
-
},
|
|
554
|
-
if (!e || !
|
|
555
|
-
let
|
|
556
|
-
return
|
|
557
|
-
},
|
|
558
|
-
export {
|
|
551
|
+
}, O = (e, t, n = "") => !e || !D(e) ? n : T(e).utc().tz("Asia/Shanghai").format(t || E), k = (e, t, n = "") => !e || !D(e) ? n : T(e).utc().tz("Europe/Paris").format(t || E), A = (e, t = "") => {
|
|
552
|
+
if (!e || !D(e)) return t;
|
|
553
|
+
let n = (new Date(T(e).format(E)).getTime() - new Date(T(e).utc().format(E)).getTime()) / 36e5;
|
|
554
|
+
return n > 0 ? T(e).utc().add(n, "hours").toDate() : T(e).utc().subtract(n, "hours").toDate();
|
|
555
|
+
}, j = (e, t) => {
|
|
556
|
+
if (!e || !D(e)) return "";
|
|
557
|
+
let n = T(e).utcOffset() - T(e).tz(t).utcOffset();
|
|
558
|
+
return n > 0 ? T(e).add(n, "minutes").toDate() : T(e).subtract(n, "minutes").toDate();
|
|
559
|
+
}, M = (e, t = "") => !e || !D(e) ? t : j(e, "Asia/Shanghai"), N = (e, t = "") => !e || !D(e) ? t : j(e, "Europe/Paris");
|
|
560
|
+
export { T as dayjs, t as debounce, D as isValidDate, M as local_cn_date, N as local_fr_date, j as local_tz_date, A as local_utc_date, e as storage, O as utc_cn, k as utc_fr };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ftlab/one-vue3",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"description": "One for Apps",
|
|
5
5
|
"main": "dist/ftlOne.js",
|
|
6
6
|
"type": "module",
|
|
@@ -106,7 +106,8 @@
|
|
|
106
106
|
"*.css",
|
|
107
107
|
"*.scss",
|
|
108
108
|
"dist/style.css",
|
|
109
|
-
"assets/**"
|
|
109
|
+
"assets/**",
|
|
110
|
+
"dist/utils*.js"
|
|
110
111
|
],
|
|
111
112
|
"peerDependencies": {
|
|
112
113
|
"@element-plus/icons-vue": "^2.0.0",
|