@zohodesk/i18n 1.0.0-beta.4 → 1.0.0-beta.41-murphy
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/README.md +130 -4
- package/docs/murphy/01-MURPHY_OVERVIEW.md +148 -0
- package/docs/murphy/02-MURPHY_ARCHITECTURE.md +283 -0
- package/docs/murphy/03-MURPHY_BACKEND_CONFIG.md +337 -0
- package/docs/murphy/04-MURPHY_FRONTEND_INIT.md +437 -0
- package/docs/murphy/05-MURPHY_DESK_CLIENT_USAGE.md +467 -0
- package/docs/murphy/06-MURPHY_I18N_INTEGRATION.md +402 -0
- package/docs/murphy/07-MURPHY_WHY_I18N_APPROACH.md +391 -0
- package/es/I18NContext.js +1 -2
- package/es/components/DateTimeDiffFormat.js +185 -209
- package/es/components/FormatText.js +7 -27
- package/es/components/HOCI18N.js +35 -58
- package/es/components/I18N.js +48 -74
- package/es/components/I18NProvider.js +59 -93
- package/es/components/PluralFormat.js +28 -51
- package/es/components/UserTimeDiffFormat.js +66 -81
- package/es/components/__tests__/DateTimeDiffFormat.spec.js +810 -663
- package/es/components/__tests__/FormatText.spec.js +22 -19
- package/es/components/__tests__/HOCI18N.spec.js +19 -25
- package/es/components/__tests__/I18N.spec.js +23 -21
- package/es/components/__tests__/I18NProvider.spec.js +38 -47
- package/es/components/__tests__/PluralFormat.spec.js +23 -20
- package/es/components/__tests__/UserTimeDiffFormat.spec.js +1259 -1110
- package/es/index.js +13 -15
- package/es/utils/__tests__/jsxTranslations.spec.js +170 -0
- package/es/utils/errorReporter.js +41 -0
- package/es/utils/index.js +543 -0
- package/es/utils/jsxTranslations.js +185 -0
- package/lib/I18NContext.js +5 -10
- package/lib/components/DateTimeDiffFormat.js +131 -146
- package/lib/components/FormatText.js +29 -42
- package/lib/components/HOCI18N.js +34 -45
- package/lib/components/I18N.js +46 -57
- package/lib/components/I18NProvider.js +72 -95
- package/lib/components/PluralFormat.js +39 -55
- package/lib/components/UserTimeDiffFormat.js +76 -84
- package/lib/components/__tests__/DateTimeDiffFormat.spec.js +751 -635
- package/lib/components/__tests__/FormatText.spec.js +21 -30
- package/lib/components/__tests__/HOCI18N.spec.js +22 -41
- package/lib/components/__tests__/I18N.spec.js +20 -33
- package/lib/components/__tests__/I18NProvider.spec.js +40 -63
- package/lib/components/__tests__/PluralFormat.spec.js +23 -35
- package/lib/components/__tests__/UserTimeDiffFormat.spec.js +1195 -1046
- package/lib/index.js +83 -104
- package/lib/utils/__tests__/jsxTranslations.spec.js +172 -0
- package/lib/utils/errorReporter.js +49 -0
- package/lib/utils/index.js +583 -0
- package/lib/utils/jsxTranslations.js +216 -0
- package/package.json +4 -3
- package/src/components/DateTimeDiffFormat.js +84 -55
- package/src/components/I18N.js +2 -0
- package/src/components/I18NProvider.js +44 -33
- package/src/components/UserTimeDiffFormat.js +22 -18
- package/src/index.js +12 -9
- package/src/utils/__tests__/jsxTranslations.spec.js +213 -0
- package/src/utils/errorReporter.js +48 -0
- package/src/utils/index.js +644 -0
- package/src/utils/jsxTranslations.js +199 -0
- package/es/components/NewDateFormat.js +0 -50
- package/es/offset.js +0 -629
- package/es/timezones.js +0 -118
- package/es/utils.js +0 -621
- package/lib/components/NewDateFormat.js +0 -68
- package/lib/offset.js +0 -634
- package/lib/timezones.js +0 -129
- package/lib/utils.js +0 -651
- package/src/components/NewDateFormat.js +0 -60
- package/src/offset.js +0 -629
- package/src/timezones.js +0 -113
- package/src/utils.js +0 -648
|
@@ -1,53 +1,43 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
26
|
-
|
|
27
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
28
|
-
|
|
29
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
30
|
-
|
|
31
|
-
var PluralFormat = function (_React$Component) {
|
|
32
|
-
_inherits(PluralFormat, _React$Component);
|
|
33
|
-
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _FormatText = _interopRequireDefault(require("./FormatText"));
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
13
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
14
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
15
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
19
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
20
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
21
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
23
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
24
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
25
|
+
var PluralFormat = exports["default"] = /*#__PURE__*/function (_React$Component) {
|
|
34
26
|
function PluralFormat() {
|
|
35
27
|
_classCallCheck(this, PluralFormat);
|
|
36
|
-
|
|
37
|
-
return _possibleConstructorReturn(this, (PluralFormat.__proto__ || Object.getPrototypeOf(PluralFormat)).apply(this, arguments));
|
|
28
|
+
return _callSuper(this, PluralFormat, arguments);
|
|
38
29
|
}
|
|
39
|
-
|
|
40
|
-
_createClass(PluralFormat, [{
|
|
41
|
-
key:
|
|
30
|
+
_inherits(PluralFormat, _React$Component);
|
|
31
|
+
return _createClass(PluralFormat, [{
|
|
32
|
+
key: "render",
|
|
42
33
|
value: function render() {
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
34
|
+
var _this$props = this.props,
|
|
35
|
+
one = _this$props.one,
|
|
36
|
+
many = _this$props.many,
|
|
37
|
+
zero = _this$props.zero,
|
|
38
|
+
value = _this$props.value;
|
|
49
39
|
var key = '',
|
|
50
|
-
|
|
40
|
+
values = '';
|
|
51
41
|
if (value > 1) {
|
|
52
42
|
key = many;
|
|
53
43
|
} else if (value == 1) {
|
|
@@ -55,9 +45,8 @@ var PluralFormat = function (_React$Component) {
|
|
|
55
45
|
} else if (value == 0) {
|
|
56
46
|
key = zero;
|
|
57
47
|
}
|
|
58
|
-
values =
|
|
59
|
-
|
|
60
|
-
return _react2.default.createElement(_FormatText2.default, _extends({}, this.props, {
|
|
48
|
+
values = "".concat(value);
|
|
49
|
+
return /*#__PURE__*/_react["default"].createElement(_FormatText["default"], _extends({}, this.props, {
|
|
61
50
|
i18NKey: key,
|
|
62
51
|
values: values,
|
|
63
52
|
one: null,
|
|
@@ -66,16 +55,11 @@ var PluralFormat = function (_React$Component) {
|
|
|
66
55
|
}));
|
|
67
56
|
}
|
|
68
57
|
}]);
|
|
69
|
-
|
|
70
|
-
return PluralFormat;
|
|
71
|
-
}(_react2.default.Component);
|
|
72
|
-
|
|
73
|
-
exports.default = PluralFormat;
|
|
74
|
-
|
|
58
|
+
}(_react["default"].Component);
|
|
75
59
|
PluralFormat.propTypes = {
|
|
76
|
-
many:
|
|
77
|
-
one:
|
|
78
|
-
tag:
|
|
79
|
-
value:
|
|
80
|
-
zero:
|
|
60
|
+
many: _propTypes["default"].string,
|
|
61
|
+
one: _propTypes["default"].string,
|
|
62
|
+
tag: _propTypes["default"].string,
|
|
63
|
+
value: _propTypes["default"].number,
|
|
64
|
+
zero: _propTypes["default"].string
|
|
81
65
|
};
|
|
@@ -1,87 +1,79 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
28
|
-
|
|
29
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
30
|
-
|
|
31
|
-
var UserTimeDiffFormat = function (_Component) {
|
|
32
|
-
_inherits(UserTimeDiffFormat, _Component);
|
|
33
|
-
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _DateTimeDiffFormat = _interopRequireDefault(require("./DateTimeDiffFormat"));
|
|
11
|
+
var _I18NContext = require("../I18NContext");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
15
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
16
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
17
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
20
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
21
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
22
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
23
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
24
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
25
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
26
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
27
|
+
var UserTimeDiffFormat = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
34
28
|
function UserTimeDiffFormat() {
|
|
35
29
|
_classCallCheck(this, UserTimeDiffFormat);
|
|
36
|
-
|
|
37
|
-
return _possibleConstructorReturn(this, (UserTimeDiffFormat.__proto__ || Object.getPrototypeOf(UserTimeDiffFormat)).apply(this, arguments));
|
|
30
|
+
return _callSuper(this, UserTimeDiffFormat, arguments);
|
|
38
31
|
}
|
|
39
|
-
|
|
40
|
-
_createClass(UserTimeDiffFormat, [{
|
|
41
|
-
key:
|
|
32
|
+
_inherits(UserTimeDiffFormat, _Component);
|
|
33
|
+
return _createClass(UserTimeDiffFormat, [{
|
|
34
|
+
key: "render",
|
|
42
35
|
value: function render() {
|
|
43
36
|
var currentTime = new Date();
|
|
44
37
|
var currentTimeUTCString = currentTime.toISOString();
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
38
|
+
var _this$props = this.props,
|
|
39
|
+
type = _this$props.type,
|
|
40
|
+
page = _this$props.page,
|
|
41
|
+
isNeedTime = _this$props.isNeedTime,
|
|
42
|
+
to = _this$props.to,
|
|
43
|
+
today = _this$props.today,
|
|
44
|
+
yesterday = _this$props.yesterday,
|
|
45
|
+
tomorrow = _this$props.tomorrow,
|
|
46
|
+
others = _this$props.others,
|
|
47
|
+
ago = _this$props.ago,
|
|
48
|
+
later = _this$props.later,
|
|
49
|
+
format = _this$props.format,
|
|
50
|
+
title = _this$props.title,
|
|
51
|
+
className = _this$props.className,
|
|
52
|
+
displayType = _this$props.displayType,
|
|
53
|
+
dataId = _this$props.dataId,
|
|
54
|
+
isOverdue = _this$props.isOverdue,
|
|
55
|
+
isDateField = _this$props.isDateField;
|
|
62
56
|
var _ref = this.context || {},
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
timeZone = _ref.timeZone;
|
|
68
|
-
|
|
57
|
+
tzData = _ref.tzData,
|
|
58
|
+
timeFormat = _ref.timeFormat,
|
|
59
|
+
datePattern = _ref.datePattern,
|
|
60
|
+
isEnabledCurrentYear = _ref.isEnabledCurrentYear;
|
|
69
61
|
if (!format && !others) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
62
|
+
format = function format(_ref2) {
|
|
63
|
+
var dateTimeFormat = _ref2.dateTimeFormat,
|
|
64
|
+
dateFormat = _ref2.dateFormat,
|
|
65
|
+
timeFormat = _ref2.timeFormat;
|
|
66
|
+
displayType === 'dateTime' ? dateTimeFormat : displayType === 'date' ? dateFormat : timeFormat;
|
|
73
67
|
};
|
|
74
68
|
}
|
|
75
|
-
|
|
76
|
-
var tz = tzData || timeZone;
|
|
77
|
-
|
|
78
|
-
return _react2.default.createElement(_DateTimeDiffFormat2.default, {
|
|
69
|
+
return /*#__PURE__*/_react["default"].createElement(_DateTimeDiffFormat["default"], {
|
|
79
70
|
type: type,
|
|
80
71
|
page: page,
|
|
72
|
+
isNeedTime: isNeedTime,
|
|
81
73
|
from: currentTimeUTCString,
|
|
82
|
-
fromTzData:
|
|
74
|
+
fromTzData: tzData,
|
|
83
75
|
to: to,
|
|
84
|
-
toTzData:
|
|
76
|
+
toTzData: tzData,
|
|
85
77
|
today: today,
|
|
86
78
|
yesterday: yesterday,
|
|
87
79
|
tomorrow: tomorrow,
|
|
@@ -92,28 +84,28 @@ var UserTimeDiffFormat = function (_Component) {
|
|
|
92
84
|
title: title,
|
|
93
85
|
className: className,
|
|
94
86
|
dataId: dataId,
|
|
95
|
-
isOverdue: isOverdue
|
|
87
|
+
isOverdue: isOverdue,
|
|
88
|
+
timeFormat: timeFormat,
|
|
89
|
+
datePattern: datePattern,
|
|
90
|
+
isEnabledCurrentYear: isEnabledCurrentYear,
|
|
91
|
+
isDateField: isDateField
|
|
96
92
|
});
|
|
97
93
|
}
|
|
98
94
|
}]);
|
|
99
|
-
|
|
100
|
-
return UserTimeDiffFormat;
|
|
101
95
|
}(_react.Component);
|
|
102
|
-
|
|
103
|
-
exports.default = UserTimeDiffFormat;
|
|
104
|
-
|
|
105
96
|
UserTimeDiffFormat.propTypes = {
|
|
106
|
-
ago:
|
|
107
|
-
className:
|
|
108
|
-
dataId:
|
|
109
|
-
displayType:
|
|
110
|
-
format:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
97
|
+
ago: _propTypes["default"].string,
|
|
98
|
+
className: _propTypes["default"].string,
|
|
99
|
+
dataId: _propTypes["default"].string,
|
|
100
|
+
displayType: _propTypes["default"].oneOf(['date', 'time', 'dateTime']),
|
|
101
|
+
format: _propTypes["default"].func,
|
|
102
|
+
isDateField: _propTypes["default"].bool,
|
|
103
|
+
later: _propTypes["default"].string,
|
|
104
|
+
others: _propTypes["default"].func,
|
|
105
|
+
title: _propTypes["default"].string,
|
|
106
|
+
to: _propTypes["default"].string,
|
|
107
|
+
today: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].object, _propTypes["default"].func]),
|
|
108
|
+
tomorrow: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].object, _propTypes["default"].func]),
|
|
109
|
+
yesterday: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].object, _propTypes["default"].func])
|
|
118
110
|
};
|
|
119
111
|
UserTimeDiffFormat.contextType = _I18NContext.I18NContext;
|