@indfnd/utils 0.1.9 → 0.1.10
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 +10 -0
- package/dist/ind-utils.es.js +24 -6
- package/dist/ind-utils.umd.cjs +8 -8
- package/package.json +1 -1
- package/src/utils/enum.ts +4 -0
- package/src/utils/half-year.ts +19 -4
- package/src/utils/table.ts +3 -3
- package/types/utils/enum.d.ts.map +1 -1
- package/types/utils/half-year.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.1.10](http://git.inspur.com/imp-ec/ind-front/ind-utils/compare/v0.1.9...v0.1.10) (2024-05-27)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* 更新依赖 ([283e6b2](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/283e6b21cfda4dfc252f80b26482a811a92f3de7))
|
|
11
|
+
* **enum:** 表格enum处理支持多行表头 ([d3256e6](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/d3256e688d3702a5435777d6bdf748159a30bdbb))
|
|
12
|
+
* **half-year:** 半年公共方法支持全年 ([6cab2e7](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/6cab2e7a00cd08c791fb585dcd2062be39f080c1))
|
|
13
|
+
* **table:** row2column有的人不维护key ([14b6968](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/14b696814d8053d0662e410b9a00e7c53e5d824f))
|
|
14
|
+
|
|
5
15
|
### [0.1.9](http://git.inspur.com/imp-ec/ind-front/ind-utils/compare/v0.1.8...v0.1.9) (2024-04-30)
|
|
6
16
|
|
|
7
17
|
|
package/dist/ind-utils.es.js
CHANGED
|
@@ -9814,6 +9814,9 @@ function renderColumnEnums(columns = [], enumRelation = {}) {
|
|
|
9814
9814
|
column.cellRendererParams.datas = enums;
|
|
9815
9815
|
}
|
|
9816
9816
|
}
|
|
9817
|
+
if (column.children && column.children.length) {
|
|
9818
|
+
column.children = renderColumnEnums(column.children, enumRelation);
|
|
9819
|
+
}
|
|
9817
9820
|
});
|
|
9818
9821
|
return rlt;
|
|
9819
9822
|
}
|
|
@@ -10347,12 +10350,15 @@ function preventDefault(event, isStopPropagation) {
|
|
|
10347
10350
|
}
|
|
10348
10351
|
}
|
|
10349
10352
|
function getHalfYear(date) {
|
|
10350
|
-
if (!date || date.length <
|
|
10353
|
+
if (!date || date.length < 4) {
|
|
10351
10354
|
return "";
|
|
10352
10355
|
}
|
|
10353
10356
|
const year = date.substring(0, 4);
|
|
10354
10357
|
const month = date.substring(4, 6);
|
|
10355
10358
|
const halfYear = getHalfYearNum(parseInt(month));
|
|
10359
|
+
if (!month) {
|
|
10360
|
+
return `${year}`;
|
|
10361
|
+
}
|
|
10356
10362
|
return `${year}H${halfYear}`;
|
|
10357
10363
|
}
|
|
10358
10364
|
function getHalfYearNum(month) {
|
|
@@ -10364,29 +10370,41 @@ function getHalfYearNum(month) {
|
|
|
10364
10370
|
return month <= 6 ? 1 : 2;
|
|
10365
10371
|
}
|
|
10366
10372
|
function formatHalfYear(halfYear) {
|
|
10367
|
-
if (!halfYear || halfYear.length <
|
|
10373
|
+
if (!halfYear || halfYear.length < 4) {
|
|
10368
10374
|
return halfYear;
|
|
10369
10375
|
}
|
|
10370
10376
|
const year = halfYear.substring(0, 4);
|
|
10377
|
+
const month = halfYear.substring(4, 6);
|
|
10378
|
+
if (!month) {
|
|
10379
|
+
return `${year}\u5168\u5E74`;
|
|
10380
|
+
}
|
|
10371
10381
|
const halfYearNum = parseInt(halfYear.substring(5));
|
|
10372
10382
|
const halfStr = halfYearNum === 1 ? "\u4E0A\u534A\u5E74" : "\u4E0B\u534A\u5E74";
|
|
10373
10383
|
return `${year}${halfStr}`;
|
|
10374
10384
|
}
|
|
10375
10385
|
function getHalfYearBeginMonth(halfYear) {
|
|
10376
|
-
if (!halfYear || halfYear.length <
|
|
10386
|
+
if (!halfYear || halfYear.length < 4) {
|
|
10377
10387
|
return halfYear;
|
|
10378
10388
|
}
|
|
10379
10389
|
const year = halfYear.substring(0, 4);
|
|
10390
|
+
const month = halfYear.substring(4, 6);
|
|
10391
|
+
if (!month) {
|
|
10392
|
+
return `${year}01`;
|
|
10393
|
+
}
|
|
10380
10394
|
const halfYearNum = parseInt(halfYear.substring(5));
|
|
10381
10395
|
const beginMonth = halfYearNum * 6 - 5;
|
|
10382
10396
|
const monthStr = beginMonth < 10 ? `0${beginMonth}` : `${beginMonth}`;
|
|
10383
10397
|
return `${year}${monthStr}`;
|
|
10384
10398
|
}
|
|
10385
10399
|
function getHalfYearEndMonth(halfYear) {
|
|
10386
|
-
if (!halfYear || halfYear.length <
|
|
10400
|
+
if (!halfYear || halfYear.length < 4) {
|
|
10387
10401
|
return halfYear;
|
|
10388
10402
|
}
|
|
10389
10403
|
const year = halfYear.substring(0, 4);
|
|
10404
|
+
const month = halfYear.substring(4, 6);
|
|
10405
|
+
if (!month) {
|
|
10406
|
+
return `${year}12`;
|
|
10407
|
+
}
|
|
10390
10408
|
const halfYearNum = parseInt(halfYear.substring(5));
|
|
10391
10409
|
const endMonth = halfYearNum * 2;
|
|
10392
10410
|
const monthStr = endMonth < 10 ? `0${endMonth}` : `${endMonth}`;
|
|
@@ -10709,7 +10727,7 @@ function renderColumnTree(data, columnGroup, option = {}) {
|
|
|
10709
10727
|
title
|
|
10710
10728
|
});
|
|
10711
10729
|
if (children && children.length) {
|
|
10712
|
-
const prefix = `${keyPrefix}${key}`;
|
|
10730
|
+
const prefix = `${keyPrefix}${key || ""}`;
|
|
10713
10731
|
const columnChildren = children.map((child) => {
|
|
10714
10732
|
return renderColumnTree(data, child, __spreadProps(__spreadValues({}, option), { keyPrefix: prefix }));
|
|
10715
10733
|
});
|
|
@@ -10720,7 +10738,7 @@ function renderColumnTree(data, columnGroup, option = {}) {
|
|
|
10720
10738
|
});
|
|
10721
10739
|
}
|
|
10722
10740
|
return __spreadProps(__spreadValues({}, args), {
|
|
10723
|
-
[keyPropName]: `${keyPrefix}${key}`,
|
|
10741
|
+
[keyPropName]: `${keyPrefix}${key || ""}`,
|
|
10724
10742
|
[titlePropName]: title,
|
|
10725
10743
|
headerTooltip: headerTooltipText
|
|
10726
10744
|
});
|