@douyinfe/semi-foundation 2.70.2-alpha.0 → 2.70.2
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/datePicker/_utils/getYearAndMonth.ts +12 -0
- package/datePicker/_utils/index.ts +3 -1
- package/lib/cjs/datePicker/_utils/getYearAndMonth.d.ts +16 -0
- package/lib/cjs/datePicker/_utils/getYearAndMonth.js +22 -0
- package/lib/cjs/datePicker/_utils/index.d.ts +2 -1
- package/lib/cjs/datePicker/_utils/index.js +7 -0
- package/lib/cjs/tooltip/foundation.js +1 -1
- package/lib/cjs/tree/treeUtil.d.ts +1 -1
- package/lib/cjs/upload/constants.d.ts +1 -1
- package/lib/es/datePicker/_utils/getYearAndMonth.d.ts +16 -0
- package/lib/es/datePicker/_utils/getYearAndMonth.js +16 -0
- package/lib/es/datePicker/_utils/index.d.ts +2 -1
- package/lib/es/datePicker/_utils/index.js +2 -1
- package/lib/es/tooltip/foundation.js +1 -1
- package/lib/es/tree/treeUtil.d.ts +1 -1
- package/lib/es/upload/constants.d.ts +1 -1
- package/package.json +3 -3
- package/tooltip/foundation.ts +2 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default function getYearAndMonth(year: { left: number; right: number }, month: { left: number; right: number }) {
|
|
2
|
+
const nowYear = new Date().getFullYear();
|
|
3
|
+
const nowMonth = new Date().getMonth();
|
|
4
|
+
|
|
5
|
+
const rightMonth = month.right || (nowMonth + 2);
|
|
6
|
+
const rightYear = year.right || (rightMonth <= 12 ? nowYear : nowYear + 1);
|
|
7
|
+
|
|
8
|
+
return {
|
|
9
|
+
year: { left: year.left || nowYear, right: rightYear },
|
|
10
|
+
month: { left: month.left || nowMonth + 1, right: rightMonth <= 12 ? rightMonth : 1 },
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -11,6 +11,7 @@ import getDefaultFormatToken from './getDefaultFormatToken';
|
|
|
11
11
|
import getYears from './getYears';
|
|
12
12
|
import getMonthsInYear from './getMonthsInYear';
|
|
13
13
|
import getFullDateOffset from './getFullDateOffset';
|
|
14
|
+
import getYearAndMonth from './getYearAndMonth';
|
|
14
15
|
|
|
15
16
|
export {
|
|
16
17
|
isAfter,
|
|
@@ -24,5 +25,6 @@ export {
|
|
|
24
25
|
getDefaultFormatToken,
|
|
25
26
|
getYears,
|
|
26
27
|
getMonthsInYear,
|
|
27
|
-
getFullDateOffset
|
|
28
|
+
getFullDateOffset,
|
|
29
|
+
getYearAndMonth
|
|
28
30
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = getYearAndMonth;
|
|
7
|
+
function getYearAndMonth(year, month) {
|
|
8
|
+
const nowYear = new Date().getFullYear();
|
|
9
|
+
const nowMonth = new Date().getMonth();
|
|
10
|
+
const rightMonth = month.right || nowMonth + 2;
|
|
11
|
+
const rightYear = year.right || (rightMonth <= 12 ? nowYear : nowYear + 1);
|
|
12
|
+
return {
|
|
13
|
+
year: {
|
|
14
|
+
left: year.left || nowYear,
|
|
15
|
+
right: rightYear
|
|
16
|
+
},
|
|
17
|
+
month: {
|
|
18
|
+
left: month.left || nowMonth + 1,
|
|
19
|
+
right: rightMonth <= 12 ? rightMonth : 1
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -10,4 +10,5 @@ import getDefaultFormatToken from './getDefaultFormatToken';
|
|
|
10
10
|
import getYears from './getYears';
|
|
11
11
|
import getMonthsInYear from './getMonthsInYear';
|
|
12
12
|
import getFullDateOffset from './getFullDateOffset';
|
|
13
|
-
|
|
13
|
+
import getYearAndMonth from './getYearAndMonth';
|
|
14
|
+
export { isAfter, isBefore, isBetween, isWithinInterval, isSameDay, isTimestamp, isUnixTimestamp, isValidDate, getDefaultFormatToken, getYears, getMonthsInYear, getFullDateOffset, getYearAndMonth };
|
|
@@ -21,6 +21,12 @@ Object.defineProperty(exports, "getMonthsInYear", {
|
|
|
21
21
|
return _getMonthsInYear.default;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
+
Object.defineProperty(exports, "getYearAndMonth", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _getYearAndMonth.default;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
24
30
|
Object.defineProperty(exports, "getYears", {
|
|
25
31
|
enumerable: true,
|
|
26
32
|
get: function () {
|
|
@@ -87,4 +93,5 @@ var _getDefaultFormatToken = _interopRequireDefault(require("./getDefaultFormatT
|
|
|
87
93
|
var _getYears = _interopRequireDefault(require("./getYears"));
|
|
88
94
|
var _getMonthsInYear = _interopRequireDefault(require("./getMonthsInYear"));
|
|
89
95
|
var _getFullDateOffset = _interopRequireDefault(require("./getFullDateOffset"));
|
|
96
|
+
var _getYearAndMonth = _interopRequireDefault(require("./getYearAndMonth"));
|
|
90
97
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -246,7 +246,7 @@ class Tooltip extends _foundation.default {
|
|
|
246
246
|
} = this._generateEvent(trigger);
|
|
247
247
|
this._bindTriggerEvent(triggerEventSet);
|
|
248
248
|
this._bindPortalEvent(portalEventSet);
|
|
249
|
-
|
|
249
|
+
this._bindResizeEvent();
|
|
250
250
|
}
|
|
251
251
|
unBindEvent() {
|
|
252
252
|
this._adapter.unregisterClickOutsideHandler();
|
|
@@ -83,6 +83,6 @@ export declare function getValueOrKey(data: any, keyMaps?: KeyMapProps): any;
|
|
|
83
83
|
export declare function normalizeValue(value: any, withObject: boolean, keyMaps?: KeyMapProps): any;
|
|
84
84
|
export declare function updateKeys(keySet: Set<string> | string[], keyEntities: KeyEntities): string[];
|
|
85
85
|
export declare function calcDisabledKeys(keyEntities: KeyEntities, keyMaps?: KeyMapProps): Set<string>;
|
|
86
|
-
export declare function calcDropRelativePosition(event: any, treeNode: any):
|
|
86
|
+
export declare function calcDropRelativePosition(event: any, treeNode: any): 1 | -1 | 0;
|
|
87
87
|
export declare function getDragNodesKeys(key: string, keyEntities: KeyEntities): string[];
|
|
88
88
|
export declare function calcDropActualPosition(pos: string, relativeDropPos: any): any;
|
|
@@ -18,7 +18,7 @@ declare const strings: {
|
|
|
18
18
|
DRAG_AREA_ILLEGAL: string;
|
|
19
19
|
TRIGGER_AUTO: "auto";
|
|
20
20
|
TRIGGER_CUSTOM: "custom";
|
|
21
|
-
UPLOAD_TRIGGER: ("
|
|
21
|
+
UPLOAD_TRIGGER: ("auto" | "custom")[];
|
|
22
22
|
VALIDATE_STATUS: readonly ["default", "error", "warning", "success"];
|
|
23
23
|
PROMPT_POSITION: readonly ["left", "right", "bottom"];
|
|
24
24
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default function getYearAndMonth(year, month) {
|
|
2
|
+
const nowYear = new Date().getFullYear();
|
|
3
|
+
const nowMonth = new Date().getMonth();
|
|
4
|
+
const rightMonth = month.right || nowMonth + 2;
|
|
5
|
+
const rightYear = year.right || (rightMonth <= 12 ? nowYear : nowYear + 1);
|
|
6
|
+
return {
|
|
7
|
+
year: {
|
|
8
|
+
left: year.left || nowYear,
|
|
9
|
+
right: rightYear
|
|
10
|
+
},
|
|
11
|
+
month: {
|
|
12
|
+
left: month.left || nowMonth + 1,
|
|
13
|
+
right: rightMonth <= 12 ? rightMonth : 1
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -10,4 +10,5 @@ import getDefaultFormatToken from './getDefaultFormatToken';
|
|
|
10
10
|
import getYears from './getYears';
|
|
11
11
|
import getMonthsInYear from './getMonthsInYear';
|
|
12
12
|
import getFullDateOffset from './getFullDateOffset';
|
|
13
|
-
|
|
13
|
+
import getYearAndMonth from './getYearAndMonth';
|
|
14
|
+
export { isAfter, isBefore, isBetween, isWithinInterval, isSameDay, isTimestamp, isUnixTimestamp, isValidDate, getDefaultFormatToken, getYears, getMonthsInYear, getFullDateOffset, getYearAndMonth };
|
|
@@ -10,4 +10,5 @@ import getDefaultFormatToken from './getDefaultFormatToken';
|
|
|
10
10
|
import getYears from './getYears';
|
|
11
11
|
import getMonthsInYear from './getMonthsInYear';
|
|
12
12
|
import getFullDateOffset from './getFullDateOffset';
|
|
13
|
-
|
|
13
|
+
import getYearAndMonth from './getYearAndMonth';
|
|
14
|
+
export { isAfter, isBefore, isBetween, isWithinInterval, isSameDay, isTimestamp, isUnixTimestamp, isValidDate, getDefaultFormatToken, getYears, getMonthsInYear, getFullDateOffset, getYearAndMonth };
|
|
@@ -239,7 +239,7 @@ export default class Tooltip extends BaseFoundation {
|
|
|
239
239
|
} = this._generateEvent(trigger);
|
|
240
240
|
this._bindTriggerEvent(triggerEventSet);
|
|
241
241
|
this._bindPortalEvent(portalEventSet);
|
|
242
|
-
|
|
242
|
+
this._bindResizeEvent();
|
|
243
243
|
}
|
|
244
244
|
unBindEvent() {
|
|
245
245
|
this._adapter.unregisterClickOutsideHandler();
|
|
@@ -83,6 +83,6 @@ export declare function getValueOrKey(data: any, keyMaps?: KeyMapProps): any;
|
|
|
83
83
|
export declare function normalizeValue(value: any, withObject: boolean, keyMaps?: KeyMapProps): any;
|
|
84
84
|
export declare function updateKeys(keySet: Set<string> | string[], keyEntities: KeyEntities): string[];
|
|
85
85
|
export declare function calcDisabledKeys(keyEntities: KeyEntities, keyMaps?: KeyMapProps): Set<string>;
|
|
86
|
-
export declare function calcDropRelativePosition(event: any, treeNode: any):
|
|
86
|
+
export declare function calcDropRelativePosition(event: any, treeNode: any): 1 | -1 | 0;
|
|
87
87
|
export declare function getDragNodesKeys(key: string, keyEntities: KeyEntities): string[];
|
|
88
88
|
export declare function calcDropActualPosition(pos: string, relativeDropPos: any): any;
|
|
@@ -18,7 +18,7 @@ declare const strings: {
|
|
|
18
18
|
DRAG_AREA_ILLEGAL: string;
|
|
19
19
|
TRIGGER_AUTO: "auto";
|
|
20
20
|
TRIGGER_CUSTOM: "custom";
|
|
21
|
-
UPLOAD_TRIGGER: ("
|
|
21
|
+
UPLOAD_TRIGGER: ("auto" | "custom")[];
|
|
22
22
|
VALIDATE_STATUS: readonly ["default", "error", "warning", "success"];
|
|
23
23
|
PROMPT_POSITION: readonly ["left", "right", "bottom"];
|
|
24
24
|
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-foundation",
|
|
3
|
-
"version": "2.70.2
|
|
3
|
+
"version": "2.70.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build:lib": "node ./scripts/compileLib.js",
|
|
7
7
|
"prepublishOnly": "npm run build:lib"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@douyinfe/semi-animation": "2.70.2
|
|
10
|
+
"@douyinfe/semi-animation": "2.70.2",
|
|
11
11
|
"@mdx-js/mdx": "^3.0.1",
|
|
12
12
|
"async-validator": "^3.5.0",
|
|
13
13
|
"classnames": "^2.2.6",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"*.scss",
|
|
29
29
|
"*.css"
|
|
30
30
|
],
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "a8e64240b3a6ae65066e911580b3410725b033e1",
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
34
34
|
"@babel/preset-env": "^7.15.8",
|
package/tooltip/foundation.ts
CHANGED
|
@@ -108,7 +108,7 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
|
|
|
108
108
|
const { triggerEventSet, portalEventSet } = this._generateEvent(trigger);
|
|
109
109
|
this._bindTriggerEvent(triggerEventSet);
|
|
110
110
|
this._bindPortalEvent(portalEventSet);
|
|
111
|
-
|
|
111
|
+
this._bindResizeEvent();
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
unBindEvent() {
|
|
@@ -191,7 +191,7 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
|
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
updateStateIfCursorOnTrigger = (trigger: HTMLElement)
|
|
194
|
+
updateStateIfCursorOnTrigger = (trigger: HTMLElement)=>{
|
|
195
195
|
if (trigger?.matches?.(":hover")) {
|
|
196
196
|
const eventNames = this._adapter.getEventName();
|
|
197
197
|
const triggerEventSet = this.getState("triggerEventSet");
|