@akinon/ui-date-picker 1.2.1 → 1.3.1

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.
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { IDatePickerGroupProps } from './types';
2
+ import type { IDatePickerGroupProps } from './types';
3
3
  /**
4
4
  * DatePicker component for Akinon UI.
5
5
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEhD;;;;;;;;;;;;;;;;GAgBG;AAEH,eAAO,MAAM,UAAU,+GAQpB,qBAAqB,sBA4bvB,CAAC;AAEF,YAAY,EAAE,qBAAqB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD;;;;;;;;;;;;;;;;GAgBG;AAEH,eAAO,MAAM,UAAU,GAAI,4GAQxB,qBAAqB,sBA6bvB,CAAC;AAEF,YAAY,EAAE,qBAAqB,EAAE,CAAC"}
package/dist/cjs/index.js CHANGED
@@ -58,6 +58,7 @@ const DatePicker = (_a) => {
58
58
  return {
59
59
  [prefixCls]: {
60
60
  [`&${prefixClsWithoutHash}`]: {
61
+ width: customTokens.sizing.valueFull,
61
62
  background: customTokens.others.colorTransparent,
62
63
  border: customTokens.border.borderNone,
63
64
  boxShadow: customTokens.layout.displayNone,
@@ -7,6 +7,7 @@ import { ReactNode } from 'react';
7
7
  */
8
8
  export interface IDatePickerGroupProps
9
9
  extends DatePickerGeneralProps,
10
+ PickerValuesProps,
10
11
  React.HTMLAttributes<HTMLDivElement> {
11
12
  /**
12
13
  * Specifies the type of picker: 'date' for DatePicker or 'range' for RangePicker.
@@ -20,6 +21,23 @@ export interface IDatePickerGroupProps
20
21
  */
21
22
  theme?: 'light' | 'dark' | string;
22
23
 
24
+ /**
25
+ * To set default date, if start time or end time is null or undefined, the date range will be an open interval.
26
+ */
27
+ defaultValue?: dayjs;
28
+
29
+ /**
30
+ * To set date.
31
+ */
32
+ value?: dayjs;
33
+
34
+ /**
35
+ * Callback function, can be executed when the selected time is changing.
36
+ * @param {dayjs} date - The selected date.
37
+ * @param {string} dateString - The formatted date string.
38
+ */
39
+ onChange?: (date: dayjs, dateString: string) => void;
40
+
23
41
  /**
24
42
  * Customize clear button.
25
43
  * @default true
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { IDatePickerGroupProps } from './types';
2
+ import type { IDatePickerGroupProps } from './types';
3
3
  /**
4
4
  * DatePicker component for Akinon UI.
5
5
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEhD;;;;;;;;;;;;;;;;GAgBG;AAEH,eAAO,MAAM,UAAU,+GAQpB,qBAAqB,sBA4bvB,CAAC;AAEF,YAAY,EAAE,qBAAqB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD;;;;;;;;;;;;;;;;GAgBG;AAEH,eAAO,MAAM,UAAU,GAAI,4GAQxB,qBAAqB,sBA6bvB,CAAC;AAEF,YAAY,EAAE,qBAAqB,EAAE,CAAC"}
package/dist/esm/index.js CHANGED
@@ -55,6 +55,7 @@ export const DatePicker = (_a) => {
55
55
  return {
56
56
  [prefixCls]: {
57
57
  [`&${prefixClsWithoutHash}`]: {
58
+ width: customTokens.sizing.valueFull,
58
59
  background: customTokens.others.colorTransparent,
59
60
  border: customTokens.border.borderNone,
60
61
  boxShadow: customTokens.layout.displayNone,
@@ -7,6 +7,7 @@ import { ReactNode } from 'react';
7
7
  */
8
8
  export interface IDatePickerGroupProps
9
9
  extends DatePickerGeneralProps,
10
+ PickerValuesProps,
10
11
  React.HTMLAttributes<HTMLDivElement> {
11
12
  /**
12
13
  * Specifies the type of picker: 'date' for DatePicker or 'range' for RangePicker.
@@ -20,6 +21,23 @@ export interface IDatePickerGroupProps
20
21
  */
21
22
  theme?: 'light' | 'dark' | string;
22
23
 
24
+ /**
25
+ * To set default date, if start time or end time is null or undefined, the date range will be an open interval.
26
+ */
27
+ defaultValue?: dayjs;
28
+
29
+ /**
30
+ * To set date.
31
+ */
32
+ value?: dayjs;
33
+
34
+ /**
35
+ * Callback function, can be executed when the selected time is changing.
36
+ * @param {dayjs} date - The selected date.
37
+ * @param {string} dateString - The formatted date string.
38
+ */
39
+ onChange?: (date: dayjs, dateString: string) => void;
40
+
23
41
  /**
24
42
  * Customize clear button.
25
43
  * @default true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/ui-date-picker",
3
- "version": "1.2.1",
3
+ "version": "1.3.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/esm/index.js",
@@ -9,10 +9,12 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "antd": "5.22.6",
12
+ "@ant-design/cssinjs": "^1.24.0",
13
+ "antd": "^5.27.0",
14
+ "dayjs": "^1.11.13",
13
15
  "react-input-mask": "^2.0.4",
14
- "@akinon/icons": "1.0.1",
15
- "@akinon/ui-theme": "1.0.2"
16
+ "@akinon/icons": "1.1.0",
17
+ "@akinon/ui-theme": "1.1.1"
16
18
  },
17
19
  "devDependencies": {
18
20
  "@types/react-input-mask": "^3.0.6",
@@ -20,11 +22,11 @@
20
22
  "copyfiles": "^2.4.1",
21
23
  "rimraf": "^5.0.5",
22
24
  "typescript": "*",
23
- "@akinon/typescript-config": "1.0.1"
25
+ "@akinon/typescript-config": "1.1.0"
24
26
  },
25
27
  "peerDependencies": {
26
- "react": ">=18",
27
- "react-dom": ">=18"
28
+ "react": "^18 || ^19",
29
+ "react-dom": "^18 || ^19"
28
30
  },
29
31
  "clean-package": "../../../clean-package.config.json",
30
32
  "types": "dist/esm/index.d.ts",
@@ -38,10 +40,10 @@
38
40
  },
39
41
  "scripts": {
40
42
  "build": "pnpm run build:esm && pnpm run build:commonjs && pnpm run copy:files",
41
- "build:esm": "tsc --outDir dist/esm",
42
43
  "build:commonjs": "tsc --module commonjs --outDir dist/cjs",
43
- "copy:files": "copyfiles -u 1 \"src/**/*.!(ts|tsx)\" dist/esm && copyfiles -u 1 \"src/**/*.!(ts|tsx)\" dist/cjs",
44
+ "build:esm": "tsc --outDir dist/esm",
44
45
  "clean": "rimraf dist/",
46
+ "copy:files": "copyfiles -u 1 \"src/**/*.!(ts|tsx)\" dist/esm && copyfiles -u 1 \"src/**/*.!(ts|tsx)\" dist/cjs",
45
47
  "typecheck": "tsc --noEmit"
46
48
  }
47
49
  }