@pisell/date-picker 1.0.78 → 1.0.79
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/es/utils/index.d.ts +2 -2
- package/es/utils/index.js +2 -2
- package/lib/utils/index.d.ts +2 -2
- package/lib/utils/index.js +1 -1
- package/package.json +1 -1
package/es/utils/index.d.ts
CHANGED
|
@@ -33,10 +33,10 @@ export declare const getShortcutValue: (value: string, preset: any[]) => any;
|
|
|
33
33
|
* @param value
|
|
34
34
|
* @param preset
|
|
35
35
|
*/
|
|
36
|
-
export declare const getDatePickerValueByShortcut: (value: string, preset
|
|
36
|
+
export declare const getDatePickerValueByShortcut: (value: string, preset?: any[]) => any;
|
|
37
37
|
/**
|
|
38
38
|
* 获取datePicker 时间值 [dayjs,dayjs]
|
|
39
39
|
* @param value
|
|
40
40
|
* @param preset
|
|
41
41
|
*/
|
|
42
|
-
export declare const getDatePickerValue: (value: string | Dayjs[], preset
|
|
42
|
+
export declare const getDatePickerValue: (value: string | Dayjs[], preset?: any[]) => any;
|
package/es/utils/index.js
CHANGED
|
@@ -5,7 +5,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
5
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
6
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
7
|
import { isFunction, isMobile as isMobileUtils, isString } from "@pisell/utils";
|
|
8
|
-
import { presetDetailMap, presetValueArr } from "../constants";
|
|
8
|
+
import { defaultPresets, presetDetailMap, presetValueArr } from "../constants";
|
|
9
9
|
export var getCurrentLocale = function getCurrentLocale() {
|
|
10
10
|
var locale = localStorage.getItem("umi_locale") || "en-US";
|
|
11
11
|
//@ts-ignore
|
|
@@ -91,7 +91,7 @@ export var getShortcutValue = function getShortcutValue(value, preset) {
|
|
|
91
91
|
* @param preset
|
|
92
92
|
*/
|
|
93
93
|
export var getDatePickerValueByShortcut = function getDatePickerValueByShortcut(value, preset) {
|
|
94
|
-
var p = formatPresets(preset);
|
|
94
|
+
var p = formatPresets(preset || defaultPresets);
|
|
95
95
|
return getShortcutValue(value, p);
|
|
96
96
|
};
|
|
97
97
|
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -33,10 +33,10 @@ export declare const getShortcutValue: (value: string, preset: any[]) => any;
|
|
|
33
33
|
* @param value
|
|
34
34
|
* @param preset
|
|
35
35
|
*/
|
|
36
|
-
export declare const getDatePickerValueByShortcut: (value: string, preset
|
|
36
|
+
export declare const getDatePickerValueByShortcut: (value: string, preset?: any[]) => any;
|
|
37
37
|
/**
|
|
38
38
|
* 获取datePicker 时间值 [dayjs,dayjs]
|
|
39
39
|
* @param value
|
|
40
40
|
* @param preset
|
|
41
41
|
*/
|
|
42
|
-
export declare const getDatePickerValue: (value: string | Dayjs[], preset
|
|
42
|
+
export declare const getDatePickerValue: (value: string | Dayjs[], preset?: any[]) => any;
|
package/lib/utils/index.js
CHANGED
|
@@ -88,7 +88,7 @@ var getShortcutValue = (value, preset) => {
|
|
|
88
88
|
return ((_a = preset.find((item) => item.value === value || item.label === value)) == null ? void 0 : _a.getValue()) || [];
|
|
89
89
|
};
|
|
90
90
|
var getDatePickerValueByShortcut = (value, preset) => {
|
|
91
|
-
const p = formatPresets(preset);
|
|
91
|
+
const p = formatPresets(preset || import_constants.defaultPresets);
|
|
92
92
|
return getShortcutValue(value, p);
|
|
93
93
|
};
|
|
94
94
|
var getDatePickerValue = (value, preset) => {
|