cosey 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.
@@ -6,7 +6,7 @@ import { MediaCard as _MediaCard } from '../../media-card/index.js';
6
6
  import { MediaCardGroup as _MediaCardGroup } from '../../media-card-group/index.js';
7
7
  import { isEmpty, isString } from '../../../utils/is.js';
8
8
  import { Scope } from '../../../utils/vue.js';
9
- import { formatAsDate, formatAsDateTime } from '../../../utils/date.js';
9
+ import { formatToDate, formatToDateTime } from '../../../utils/date.js';
10
10
  import { toArray } from '../../../utils/array.js';
11
11
 
12
12
  function _isSlot(s) {
@@ -41,9 +41,9 @@ function renderer({
41
41
  case "text":
42
42
  return cellValue;
43
43
  case "datetime":
44
- return formatAsDateTime(cellValue);
44
+ return formatToDateTime(cellValue);
45
45
  case "date":
46
- return formatAsDate(cellValue);
46
+ return formatToDate(cellValue);
47
47
  case "media":
48
48
  return cellValue ? createVNode(_MediaCard, mergeProps({
49
49
  "src": cellValue
@@ -135,9 +135,9 @@ function exportRenderer(row, column, cellValue, index) {
135
135
  case "mediagroup":
136
136
  return JSON.stringify(cellValue);
137
137
  case "datetime":
138
- return formatAsDateTime(cellValue);
138
+ return formatToDateTime(cellValue);
139
139
  case "date":
140
- return formatAsDate(cellValue);
140
+ return formatToDate(cellValue);
141
141
  case "tag":
142
142
  {
143
143
  const value = isEmpty(cellValue) ? [] : toArray(cellValue);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cosey",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "基于 Vue3 + vite 的后台管理系统框架",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/utils/date.d.ts CHANGED
@@ -11,11 +11,11 @@ export declare function getDayjs(date?: Parameters<typeof dayjs>[0]): dayjs.Dayj
11
11
  /**
12
12
  * 格式化为“年月日 时分秒”
13
13
  */
14
- export declare function formatAsDateTime(date?: Parameters<typeof dayjs>[0]): string;
14
+ export declare function formatToDateTime(date?: Parameters<typeof dayjs>[0]): string;
15
15
  /**
16
16
  * 格式化为“年月日”
17
17
  */
18
- export declare function formatAsDate(date?: Parameters<typeof dayjs>[0]): string;
18
+ export declare function formatToDate(date?: Parameters<typeof dayjs>[0]): string;
19
19
  /**
20
20
  * 格式化为基础格式的日期+时间,即未添加分隔符的格式
21
21
  */
package/utils/date.js CHANGED
@@ -11,14 +11,14 @@ function getDayjs(date) {
11
11
  }
12
12
  return dayjs(date);
13
13
  }
14
- function formatAsDateTime(date) {
14
+ function formatToDateTime(date) {
15
15
  return getDayjs(date).format(DATE_TIME_FORMAT);
16
16
  }
17
- function formatAsDate(date) {
17
+ function formatToDate(date) {
18
18
  return getDayjs(date).format(DATE_FORMAT);
19
19
  }
20
20
  function formatAsBasicDateTime(date) {
21
21
  return getDayjs(date).format("YYYYMMDDHHmmss");
22
22
  }
23
23
 
24
- export { DATE_FORMAT, DATE_TIME_FORMAT, MONTH_FORMAT, TIME_FORMAT, YEAR_FORMAT, formatAsBasicDateTime, formatAsDate, formatAsDateTime, getDayjs };
24
+ export { DATE_FORMAT, DATE_TIME_FORMAT, MONTH_FORMAT, TIME_FORMAT, YEAR_FORMAT, formatAsBasicDateTime, formatToDate, formatToDateTime, getDayjs };
package/utils/index.js CHANGED
@@ -3,7 +3,7 @@ export { getCssVarProp } from './bem.js';
3
3
  export { getControlKey } from './browser.js';
4
4
  export { getLabelByValue, getTreeLabelByValue } from './collection.js';
5
5
  export { addPxUnit, cssObjectToString, getContextBoxWidth, getDir, getStyle, setStyle } from './css.js';
6
- export { DATE_FORMAT, DATE_TIME_FORMAT, MONTH_FORMAT, TIME_FORMAT, YEAR_FORMAT, formatAsBasicDateTime, formatAsDate, formatAsDateTime, getDayjs } from './date.js';
6
+ export { DATE_FORMAT, DATE_TIME_FORMAT, MONTH_FORMAT, TIME_FORMAT, YEAR_FORMAT, formatAsBasicDateTime, formatToDate, formatToDateTime, getDayjs } from './date.js';
7
7
  export { exportExcel, flatColumns } from './excel/index.js';
8
8
  export { chooseFiles, downloadAttachment, getFileType, readAsArrayBuffer, readAsDataURL } from './file.js';
9
9
  export { isBoolean, isEmpty, isFunction, isNullish, isNumber, isObject, isPlainObject, isPrimitive, isString, isUndefined } from './is.js';