yootd 0.0.31 → 0.0.33

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.
@@ -7,10 +7,12 @@ export type DateIntervalProps = AntdDatePickerProps & {
7
7
  label: string;
8
8
  value: PickerType;
9
9
  }[];
10
- value?: dayjs.Dayjs;
10
+ value?: {
11
+ date: dayjs.Dayjs;
12
+ type: string;
13
+ };
11
14
  onChange?: (record: {
12
15
  date: dayjs.Dayjs;
13
- dateString: string | string[];
14
16
  type: string;
15
17
  }) => void;
16
18
  };
@@ -20,17 +20,15 @@ export var DateInterval = function DateInterval(_ref) {
20
20
  _useState2 = _slicedToArray(_useState, 2),
21
21
  type = _useState2[0],
22
22
  setType = _useState2[1];
23
- var onChangeDate = function onChangeDate(date, dateString) {
23
+ var onChangeDate = function onChangeDate(date) {
24
24
  onChange === null || onChange === void 0 || onChange({
25
25
  date: date,
26
- dateString: dateString,
27
26
  type: type
28
27
  });
29
28
  };
30
- var onChangeTime = function onChangeTime(date, dateString) {
29
+ var onChangeTime = function onChangeTime(date) {
31
30
  onChange === null || onChange === void 0 || onChange({
32
31
  date: date,
33
- dateString: dateString,
34
32
  type: type
35
33
  });
36
34
  };
@@ -40,14 +38,14 @@ export var DateInterval = function DateInterval(_ref) {
40
38
  var datePickerMap = useMemo(function () {
41
39
  return {
42
40
  time: /*#__PURE__*/React.createElement(AntdDatePicker.TimePicker, _extends({}, props, {
43
- defaultValue: value,
41
+ defaultValue: value === null || value === void 0 ? void 0 : value.date,
44
42
  style: {
45
43
  width: 180
46
44
  },
47
45
  onChange: onChangeTime
48
46
  })),
49
47
  date: /*#__PURE__*/React.createElement(AntdDatePicker, _extends({}, props, {
50
- defaultValue: value,
48
+ defaultValue: value === null || value === void 0 ? void 0 : value.date,
51
49
  style: {
52
50
  width: 180
53
51
  },
@@ -56,7 +54,7 @@ export var DateInterval = function DateInterval(_ref) {
56
54
  week: /*#__PURE__*/React.createElement(AntdDatePicker, _extends({
57
55
  picker: "week"
58
56
  }, props, {
59
- defaultValue: value,
57
+ defaultValue: value === null || value === void 0 ? void 0 : value.date,
60
58
  style: {
61
59
  width: 180
62
60
  },
@@ -65,7 +63,7 @@ export var DateInterval = function DateInterval(_ref) {
65
63
  month: /*#__PURE__*/React.createElement(AntdDatePicker, _extends({
66
64
  picker: "month"
67
65
  }, props, {
68
- defaultValue: value,
66
+ defaultValue: value === null || value === void 0 ? void 0 : value.date,
69
67
  style: {
70
68
  width: 180
71
69
  },
@@ -74,7 +72,7 @@ export var DateInterval = function DateInterval(_ref) {
74
72
  quarter: /*#__PURE__*/React.createElement(AntdDatePicker, _extends({
75
73
  picker: "quarter"
76
74
  }, props, {
77
- defaultValue: value,
75
+ defaultValue: value === null || value === void 0 ? void 0 : value.date,
78
76
  style: {
79
77
  width: 180
80
78
  },
@@ -83,7 +81,7 @@ export var DateInterval = function DateInterval(_ref) {
83
81
  year: /*#__PURE__*/React.createElement(AntdDatePicker, _extends({
84
82
  picker: "year"
85
83
  }, props, {
86
- defaultValue: value,
84
+ defaultValue: value === null || value === void 0 ? void 0 : value.date,
87
85
  style: {
88
86
  width: 180
89
87
  },
@@ -7,10 +7,12 @@ export type DateRangeProps = RangePickerProps & {
7
7
  label: string;
8
8
  value: PickerType;
9
9
  }[];
10
- value?: [dayjs.Dayjs, dayjs.Dayjs];
10
+ value?: {
11
+ dates: [dayjs.Dayjs, dayjs.Dayjs];
12
+ type: PickerType;
13
+ };
11
14
  onChange?: (record: {
12
15
  dates: [dayjs.Dayjs, dayjs.Dayjs];
13
- dateStrings: [string, string];
14
16
  type: PickerType;
15
17
  }) => void;
16
18
  };
@@ -20,24 +20,23 @@ export var DateRange = function DateRange(_ref) {
20
20
  _useState2 = _slicedToArray(_useState, 2),
21
21
  type = _useState2[0],
22
22
  setType = _useState2[1];
23
- var onChangeDate = function onChangeDate(dates, dateStrings) {
23
+ var onChangeDate = function onChangeDate(dates) {
24
24
  onChange === null || onChange === void 0 || onChange({
25
25
  dates: dates,
26
- dateStrings: dateStrings,
27
26
  type: type
28
27
  });
29
28
  };
30
29
  var datePickerMap = useMemo(function () {
31
30
  return {
32
31
  time: /*#__PURE__*/React.createElement(TimePicker.RangePicker, _extends({}, props, {
33
- defaultValue: value,
32
+ defaultValue: value === null || value === void 0 ? void 0 : value.dates,
34
33
  style: {
35
34
  width: 244
36
35
  },
37
36
  onChange: onChangeDate
38
37
  })),
39
38
  date: /*#__PURE__*/React.createElement(DatePicker.RangePicker, _extends({}, props, {
40
- defaultValue: value,
39
+ defaultValue: value === null || value === void 0 ? void 0 : value.dates,
41
40
  style: {
42
41
  width: 244
43
42
  },
@@ -46,7 +45,7 @@ export var DateRange = function DateRange(_ref) {
46
45
  week: /*#__PURE__*/React.createElement(DatePicker.RangePicker, _extends({
47
46
  picker: "week"
48
47
  }, props, {
49
- defaultValue: value,
48
+ defaultValue: value === null || value === void 0 ? void 0 : value.dates,
50
49
  style: {
51
50
  width: 244
52
51
  },
@@ -55,7 +54,7 @@ export var DateRange = function DateRange(_ref) {
55
54
  month: /*#__PURE__*/React.createElement(DatePicker.RangePicker, _extends({
56
55
  picker: "month"
57
56
  }, props, {
58
- defaultValue: value,
57
+ defaultValue: value === null || value === void 0 ? void 0 : value.dates,
59
58
  style: {
60
59
  width: 244
61
60
  },
@@ -67,12 +66,13 @@ export var DateRange = function DateRange(_ref) {
67
66
  style: {
68
67
  width: 244
69
68
  },
70
- onChange: onChangeDate
69
+ onChange: onChangeDate,
70
+ defaultValue: value === null || value === void 0 ? void 0 : value.dates
71
71
  })),
72
72
  year: /*#__PURE__*/React.createElement(DatePicker.RangePicker, _extends({
73
73
  picker: "year"
74
74
  }, props, {
75
- defaultValue: value,
75
+ defaultValue: value === null || value === void 0 ? void 0 : value.dates,
76
76
  style: {
77
77
  width: 244
78
78
  },
package/package.json CHANGED
@@ -1,101 +1,101 @@
1
- {
2
- "name": "yootd",
3
- "version": "0.0.31",
4
- "description": "A react library developed with dumi",
5
- "license": "MIT",
6
- "module": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "files": [
9
- "dist"
10
- ],
11
- "scripts": {
12
- "build": "father build",
13
- "build:watch": "father dev",
14
- "dev": "dumi dev",
15
- "docs:build": "dumi build",
16
- "docs:preview": "dumi preview",
17
- "doctor": "father doctor",
18
- "lint": "npm run lint:es && npm run lint:css",
19
- "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
20
- "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
21
- "prepare": "husky install && dumi setup",
22
- "prepublishOnly": "father doctor && npm run build",
23
- "start": "npm run dev"
24
- },
25
- "commitlint": {
26
- "extends": [
27
- "@commitlint/config-conventional"
28
- ]
29
- },
30
- "lint-staged": {
31
- "*.{md,json}": [
32
- "prettier --write --no-error-on-unmatched-pattern"
33
- ],
34
- "*.{css,less}": [
35
- "stylelint --fix",
36
- "prettier --write"
37
- ],
38
- "*.{js,jsx}": [
39
- "eslint --fix",
40
- "prettier --write"
41
- ],
42
- "*.{ts,tsx}": [
43
- "eslint --fix",
44
- "prettier --parser=typescript --write"
45
- ]
46
- },
47
- "devDependencies": {
48
- "@commitlint/cli": "^17.1.2",
49
- "@commitlint/config-conventional": "^17.1.0",
50
- "@dnd-kit/core": "^6.1.0",
51
- "@dnd-kit/modifiers": "^7.0.0",
52
- "@dnd-kit/sortable": "^8.0.0",
53
- "@dnd-kit/utilities": "^3.2.2",
54
- "@tanstack/react-query": "^5.59.15",
55
- "@types/lodash": "^4.17.12",
56
- "@types/react": "^18.0.0",
57
- "@types/react-dom": "^18.0.0",
58
- "@umijs/lint": "^4.0.0",
59
- "@vladmandic/face-api": "^1.7.14",
60
- "antd": "^5.21.4",
61
- "axios": "^1.7.7",
62
- "dayjs": "^1.11.13",
63
- "dumi": "^2.3.0",
64
- "dumi-theme-antd": "^0.4.2",
65
- "eslint": "^8.23.0",
66
- "father": "^4.1.0",
67
- "husky": "^8.0.1",
68
- "lint-staged": "^13.0.3",
69
- "lodash": "^4.17.21",
70
- "nanoid": "^5.0.8",
71
- "prettier": "^2.7.1",
72
- "prettier-plugin-organize-imports": "^3.0.0",
73
- "prettier-plugin-packagejson": "^2.2.18",
74
- "react": "^18.0.0",
75
- "react-dom": "^18.0.0",
76
- "sass": "^1.80.0",
77
- "stylelint": "^14.9.1",
78
- "yootd-webrtc-sdk": "^1.0.1"
79
- },
80
- "peerDependencies": {
81
- "@dnd-kit/core": ">=6.1.0",
82
- "@dnd-kit/modifiers": ">=7.0.0",
83
- "@dnd-kit/sortable": ">=8.0.0",
84
- "@dnd-kit/utilities": ">=3.2.2",
85
- "@tanstack/react-query": ">=5.59.15",
86
- "@vladmandic/face-api": "^1.7.14",
87
- "@xyflow/react": ">=12.3.3",
88
- "antd": ">=5.21.4",
89
- "axios": ">=1.7.7",
90
- "dayjs": ">=1.11.13",
91
- "lodash": ">=4.17.21",
92
- "nanoid": ">=5.0.8",
93
- "react": ">=16.9.0",
94
- "react-dom": ">=16.9.0",
95
- "yootd-webrtc-sdk": "^1.0.1"
96
- },
97
- "publishConfig": {
98
- "access": "public"
99
- },
100
- "authors": []
101
- }
1
+ {
2
+ "name": "yootd",
3
+ "version": "0.0.33",
4
+ "description": "A react library developed with dumi",
5
+ "license": "MIT",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "scripts": {
12
+ "build": "father build",
13
+ "build:watch": "father dev",
14
+ "dev": "dumi dev",
15
+ "docs:build": "dumi build",
16
+ "docs:preview": "dumi preview",
17
+ "doctor": "father doctor",
18
+ "lint": "npm run lint:es && npm run lint:css",
19
+ "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
20
+ "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
21
+ "prepare": "husky install && dumi setup",
22
+ "prepublishOnly": "father doctor && npm run build",
23
+ "start": "npm run dev"
24
+ },
25
+ "commitlint": {
26
+ "extends": [
27
+ "@commitlint/config-conventional"
28
+ ]
29
+ },
30
+ "lint-staged": {
31
+ "*.{md,json}": [
32
+ "prettier --write --no-error-on-unmatched-pattern"
33
+ ],
34
+ "*.{css,less}": [
35
+ "stylelint --fix",
36
+ "prettier --write"
37
+ ],
38
+ "*.{js,jsx}": [
39
+ "eslint --fix",
40
+ "prettier --write"
41
+ ],
42
+ "*.{ts,tsx}": [
43
+ "eslint --fix",
44
+ "prettier --parser=typescript --write"
45
+ ]
46
+ },
47
+ "devDependencies": {
48
+ "@commitlint/cli": "^17.1.2",
49
+ "@commitlint/config-conventional": "^17.1.0",
50
+ "@dnd-kit/core": "^6.1.0",
51
+ "@dnd-kit/modifiers": "^7.0.0",
52
+ "@dnd-kit/sortable": "^8.0.0",
53
+ "@dnd-kit/utilities": "^3.2.2",
54
+ "@tanstack/react-query": "^5.59.15",
55
+ "@types/lodash": "^4.17.12",
56
+ "@types/react": "^18.0.0",
57
+ "@types/react-dom": "^18.0.0",
58
+ "@umijs/lint": "^4.0.0",
59
+ "@vladmandic/face-api": "^1.7.14",
60
+ "antd": "^5.21.4",
61
+ "axios": "^1.7.7",
62
+ "dayjs": "^1.11.13",
63
+ "dumi": "^2.3.0",
64
+ "dumi-theme-antd": "^0.4.2",
65
+ "eslint": "^8.23.0",
66
+ "father": "^4.1.0",
67
+ "husky": "^8.0.1",
68
+ "lint-staged": "^13.0.3",
69
+ "lodash": "^4.17.21",
70
+ "nanoid": "^5.0.8",
71
+ "prettier": "^2.7.1",
72
+ "prettier-plugin-organize-imports": "^3.0.0",
73
+ "prettier-plugin-packagejson": "^2.2.18",
74
+ "react": "^18.0.0",
75
+ "react-dom": "^18.0.0",
76
+ "sass": "^1.80.0",
77
+ "stylelint": "^14.9.1",
78
+ "yootd-webrtc-sdk": "^1.0.1"
79
+ },
80
+ "peerDependencies": {
81
+ "@dnd-kit/core": ">=6.1.0",
82
+ "@dnd-kit/modifiers": ">=7.0.0",
83
+ "@dnd-kit/sortable": ">=8.0.0",
84
+ "@dnd-kit/utilities": ">=3.2.2",
85
+ "@tanstack/react-query": ">=5.59.15",
86
+ "@vladmandic/face-api": "^1.7.14",
87
+ "@xyflow/react": ">=12.3.3",
88
+ "antd": ">=5.21.4",
89
+ "axios": ">=1.7.7",
90
+ "dayjs": ">=1.11.13",
91
+ "lodash": ">=4.17.21",
92
+ "nanoid": ">=5.0.8",
93
+ "react": ">=16.9.0",
94
+ "react-dom": ">=16.9.0",
95
+ "yootd-webrtc-sdk": "^1.0.1"
96
+ },
97
+ "publishConfig": {
98
+ "access": "public"
99
+ },
100
+ "authors": []
101
+ }