@pisell/date-picker 1.0.78 → 1.0.80
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/PisellDateRangePicker/index.js +1 -1
- package/es/Toolbar/index.js +1 -1
- package/es/internals/utils/date-fields-utils.d.ts +1 -1
- package/es/utils/index.d.ts +2 -2
- package/es/utils/index.js +2 -2
- package/lib/PisellDateRangePicker/index.js +1 -1
- package/lib/Toolbar/index.js +1 -1
- package/lib/internals/utils/date-fields-utils.d.ts +1 -1
- package/lib/utils/index.d.ts +2 -2
- package/lib/utils/index.js +1 -1
- package/package.json +1 -1
|
@@ -114,7 +114,7 @@ var PisellDateRangePicker = function PisellDateRangePicker(props) {
|
|
|
114
114
|
var getVal = function getVal() {
|
|
115
115
|
var val = _value;
|
|
116
116
|
if (returnShortcutString) {
|
|
117
|
-
val = currentShortcut;
|
|
117
|
+
val = currentShortcut || val;
|
|
118
118
|
} else if (currentShortcut) {
|
|
119
119
|
val = getShortcutValue(currentShortcut, _presets);
|
|
120
120
|
}
|
package/es/Toolbar/index.js
CHANGED
|
@@ -88,7 +88,7 @@ var Toolbar = function Toolbar(props) {
|
|
|
88
88
|
}]);
|
|
89
89
|
}
|
|
90
90
|
return presetItems;
|
|
91
|
-
}, [presetItems]);
|
|
91
|
+
}, [presetItems, currentShortcut]);
|
|
92
92
|
return /*#__PURE__*/React.createElement("div", {
|
|
93
93
|
className: "date-picker-toolbar"
|
|
94
94
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -5,7 +5,7 @@ export declare const splitDateRangeSections: (sections: RangeFieldSection[]) =>
|
|
|
5
5
|
};
|
|
6
6
|
export declare const removeLastSeparator: (dateSections: RangeFieldSection[]) => (RangeFieldSection | {
|
|
7
7
|
separator: null;
|
|
8
|
-
dateName: "
|
|
8
|
+
dateName: "end" | "start";
|
|
9
9
|
value: string;
|
|
10
10
|
format: string;
|
|
11
11
|
maxLength: number | null;
|
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
|
|
|
@@ -120,7 +120,7 @@ var PisellDateRangePicker = (props) => {
|
|
|
120
120
|
const getVal = () => {
|
|
121
121
|
let val = _value;
|
|
122
122
|
if (returnShortcutString) {
|
|
123
|
-
val = currentShortcut;
|
|
123
|
+
val = currentShortcut || val;
|
|
124
124
|
} else if (currentShortcut) {
|
|
125
125
|
val = (0, import_utils2.getShortcutValue)(currentShortcut, _presets);
|
|
126
126
|
}
|
package/lib/Toolbar/index.js
CHANGED
|
@@ -108,7 +108,7 @@ var Toolbar = (props) => {
|
|
|
108
108
|
]);
|
|
109
109
|
}
|
|
110
110
|
return presetItems;
|
|
111
|
-
}, [presetItems]);
|
|
111
|
+
}, [presetItems, currentShortcut]);
|
|
112
112
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: "date-picker-toolbar" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "date-picker-content-top" }, /* @__PURE__ */ import_react.default.createElement("span", null, (0, import_locales.getText)("toolbar-date-range-shortcut-date-range")), /* @__PURE__ */ import_react.default.createElement(
|
|
113
113
|
import_browserSelect.default,
|
|
114
114
|
{
|
|
@@ -5,7 +5,7 @@ export declare const splitDateRangeSections: (sections: RangeFieldSection[]) =>
|
|
|
5
5
|
};
|
|
6
6
|
export declare const removeLastSeparator: (dateSections: RangeFieldSection[]) => (RangeFieldSection | {
|
|
7
7
|
separator: null;
|
|
8
|
-
dateName: "
|
|
8
|
+
dateName: "end" | "start";
|
|
9
9
|
value: string;
|
|
10
10
|
format: string;
|
|
11
11
|
maxLength: number | null;
|
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) => {
|