@douyinfe/semi-foundation 2.19.0-alpha.8 → 2.19.0
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/anchor/anchor.scss +1 -8
- package/anchor/rtl.scss +0 -1
- package/anchor/variables.scss +1 -0
- package/calendar/eventUtil.ts +8 -7
- package/calendar/foundation.ts +14 -14
- package/datePicker/monthsGridFoundation.ts +10 -3
- package/dropdown/foundation.ts +2 -1
- package/dropdown/menuFoundation.ts +2 -1
- package/getBabelConfig.js +0 -12
- package/lib/cjs/anchor/anchor.css +1 -10
- package/lib/cjs/anchor/anchor.scss +1 -8
- package/lib/cjs/anchor/constants.js +1 -4
- package/lib/cjs/anchor/foundation.js +5 -12
- package/lib/cjs/anchor/linkFoundation.js +4 -9
- package/lib/cjs/anchor/rtl.scss +0 -1
- package/lib/cjs/anchor/variables.scss +1 -0
- package/lib/cjs/autoComplete/constants.js +1 -4
- package/lib/cjs/autoComplete/foundation.js +14 -33
- package/lib/cjs/autoComplete/optionFoundation.js +4 -9
- package/lib/cjs/avatar/constants.js +1 -4
- package/lib/cjs/avatar/foundation.js +4 -9
- package/lib/cjs/backtop/constants.js +1 -4
- package/lib/cjs/backtop/foundation.js +4 -9
- package/lib/cjs/badge/constants.js +1 -4
- package/lib/cjs/banner/constants.js +1 -4
- package/lib/cjs/banner/foundation.js +4 -9
- package/lib/cjs/base/constants.js +2 -6
- package/lib/cjs/base/env.js +1 -4
- package/lib/cjs/base/foundation.js +5 -10
- package/lib/cjs/base/index.js +3 -6
- package/lib/cjs/breadcrumb/constants.js +1 -4
- package/lib/cjs/breadcrumb/foundation.js +6 -13
- package/lib/cjs/breadcrumb/itemFoundation.js +4 -9
- package/lib/cjs/button/constants.js +1 -4
- package/lib/cjs/calendar/constants.js +1 -4
- package/lib/cjs/calendar/eventUtil.d.ts +3 -3
- package/lib/cjs/calendar/eventUtil.js +28 -53
- package/lib/cjs/calendar/foundation.js +63 -85
- package/lib/cjs/card/constants.js +1 -4
- package/lib/cjs/carousel/constants.js +1 -4
- package/lib/cjs/carousel/foundation.js +5 -12
- package/lib/cjs/cascader/constants.js +1 -4
- package/lib/cjs/cascader/foundation.js +55 -100
- package/lib/cjs/cascader/util.js +9 -30
- package/lib/cjs/checkbox/checkboxFoundation.js +6 -13
- package/lib/cjs/checkbox/checkboxGroupFoundation.js +9 -18
- package/lib/cjs/checkbox/constants.js +1 -4
- package/lib/cjs/collapse/constants.js +1 -4
- package/lib/cjs/collapse/foundation.js +9 -20
- package/lib/cjs/collapsible/constants.js +1 -4
- package/lib/cjs/datePicker/_utils/formatter.js +3 -12
- package/lib/cjs/datePicker/_utils/getDayOfWeek.js +1 -4
- package/lib/cjs/datePicker/_utils/getDefaultFormatToken.js +1 -4
- package/lib/cjs/datePicker/_utils/getDefaultPickerDate.js +5 -10
- package/lib/cjs/datePicker/_utils/getFullDateOffset.js +3 -6
- package/lib/cjs/datePicker/_utils/getInsetInputFormatToken.js +2 -11
- package/lib/cjs/datePicker/_utils/getInsetInputValueFromInsetInputStr.js +1 -4
- package/lib/cjs/datePicker/_utils/getMonthTable.js +2 -11
- package/lib/cjs/datePicker/_utils/getMonthsInYear.js +3 -16
- package/lib/cjs/datePicker/_utils/getYears.js +2 -9
- package/lib/cjs/datePicker/_utils/index.js +16 -30
- package/lib/cjs/datePicker/_utils/isAfter.js +3 -6
- package/lib/cjs/datePicker/_utils/isBefore.js +3 -6
- package/lib/cjs/datePicker/_utils/isBetween.js +3 -6
- package/lib/cjs/datePicker/_utils/isDate.js +1 -4
- package/lib/cjs/datePicker/_utils/isSameDay.js +3 -6
- package/lib/cjs/datePicker/_utils/isTimestamp.js +3 -6
- package/lib/cjs/datePicker/_utils/isUnixTimestamp.js +3 -6
- package/lib/cjs/datePicker/_utils/isValidDate.js +1 -4
- package/lib/cjs/datePicker/_utils/isWithinInterval.js +3 -6
- package/lib/cjs/datePicker/_utils/parser.js +1 -4
- package/lib/cjs/datePicker/constants.js +3 -10
- package/lib/cjs/datePicker/foundation.js +42 -85
- package/lib/cjs/datePicker/inputFoundation.js +7 -20
- package/lib/cjs/datePicker/monthFoundation.js +5 -12
- package/lib/cjs/datePicker/monthsGridFoundation.js +47 -68
- package/lib/cjs/datePicker/yearAndMonthFoundation.js +4 -9
- package/lib/cjs/descriptions/constants.js +1 -4
- package/lib/cjs/divider/constants.js +1 -4
- package/lib/cjs/dropdown/constants.js +1 -4
- package/lib/cjs/dropdown/foundation.js +7 -15
- package/lib/cjs/dropdown/menuFoundation.js +11 -31
- package/lib/cjs/empty/constants.js +1 -4
- package/lib/cjs/form/constants.js +1 -4
- package/lib/cjs/form/foundation.js +64 -104
- package/lib/cjs/form/interface.js +1 -3
- package/lib/cjs/form/utils.js +14 -29
- package/lib/cjs/grid/constants.js +1 -4
- package/lib/cjs/icons/constants.js +1 -4
- package/lib/cjs/input/constants.js +1 -4
- package/lib/cjs/input/foundation.js +7 -18
- package/lib/cjs/input/textareaFoundation.js +6 -13
- package/lib/cjs/input/util/calculateNodeHeight.js +3 -17
- package/lib/cjs/input/util/getSizingData.js +5 -10
- package/lib/cjs/inputNumber/constants.js +4 -11
- package/lib/cjs/inputNumber/foundation.js +11 -30
- package/lib/cjs/layout/constants.js +1 -4
- package/lib/cjs/list/constants.js +1 -4
- package/lib/cjs/modal/constants.js +1 -4
- package/lib/cjs/modal/modalContentFoundation.js +4 -9
- package/lib/cjs/modal/modalFoundation.js +4 -9
- package/lib/cjs/navigation/NavItem.js +6 -21
- package/lib/cjs/navigation/constants.js +1 -4
- package/lib/cjs/navigation/foundation.js +22 -37
- package/lib/cjs/navigation/itemFoundation.js +4 -9
- package/lib/cjs/navigation/subNavFoundation.js +10 -21
- package/lib/cjs/notification/constants.js +1 -4
- package/lib/cjs/notification/notificationFoundation.js +5 -12
- package/lib/cjs/notification/notificationListFoundation.js +4 -9
- package/lib/cjs/overflowList/constants.js +3 -10
- package/lib/cjs/overflowList/foundation.js +12 -29
- package/lib/cjs/pagination/constants.js +1 -4
- package/lib/cjs/pagination/foundation.js +18 -37
- package/lib/cjs/popconfirm/constants.js +1 -4
- package/lib/cjs/popconfirm/popconfirm.css +1 -7
- package/lib/cjs/popconfirm/popconfirm.scss +1 -11
- package/lib/cjs/popconfirm/popconfirmFoundation.js +3 -6
- package/lib/cjs/popover/constants.js +2 -9
- package/lib/cjs/progress/constants.js +1 -4
- package/lib/cjs/radio/constants.js +1 -4
- package/lib/cjs/radio/radioFoundation.js +3 -6
- package/lib/cjs/radio/radioGroupFoundation.js +6 -11
- package/lib/cjs/radio/radioInnerFoundation.js +5 -10
- package/lib/cjs/rating/constants.js +1 -4
- package/lib/cjs/rating/foundation.js +7 -20
- package/lib/cjs/scrollList/constants.js +1 -4
- package/lib/cjs/scrollList/foundation.js +3 -6
- package/lib/cjs/scrollList/itemFoundation.js +8 -21
- package/lib/cjs/scrollList/scrollTo.js +1 -4
- package/lib/cjs/select/constants.js +1 -4
- package/lib/cjs/select/foundation.js +56 -98
- package/lib/cjs/select/optionFoundation.js +4 -9
- package/lib/cjs/sideSheet/constants.js +1 -4
- package/lib/cjs/sideSheet/sideSheet.css +1 -0
- package/lib/cjs/sideSheet/sideSheet.scss +1 -0
- package/lib/cjs/sideSheet/sideSheetFoundation.js +6 -15
- package/lib/cjs/skeleton/constants.js +1 -4
- package/lib/cjs/slider/constants.js +1 -4
- package/lib/cjs/slider/foundation.js +32 -33
- package/lib/cjs/space/constants.js +1 -4
- package/lib/cjs/spin/constants.js +1 -4
- package/lib/cjs/spin/foundation.js +5 -12
- package/lib/cjs/steps/constants.js +1 -4
- package/lib/cjs/switch/constants.js +1 -4
- package/lib/cjs/switch/foundation.js +4 -9
- package/lib/cjs/table/bodyFoundation.js +9 -22
- package/lib/cjs/table/cellFoundation.js +3 -6
- package/lib/cjs/table/constants.js +1 -4
- package/lib/cjs/table/foundation.js +76 -117
- package/lib/cjs/table/mixin.scss +2 -2
- package/lib/cjs/table/rtl.scss +8 -8
- package/lib/cjs/table/table.scss +16 -16
- package/lib/cjs/table/tableRowFoundation.js +3 -6
- package/lib/cjs/table/tableSelectionCellFoundation.js +3 -6
- package/lib/cjs/table/utils.js +42 -71
- package/lib/cjs/table/variables.scss +0 -3
- package/lib/cjs/tabs/constants.js +1 -4
- package/lib/cjs/tabs/foundation.js +8 -23
- package/lib/cjs/tag/constants.js +1 -4
- package/lib/cjs/tagInput/constants.js +1 -4
- package/lib/cjs/tagInput/foundation.js +12 -31
- package/lib/cjs/tagInput/utils/getSplitedArray.js +3 -6
- package/lib/cjs/timePicker/ComboxFoundation.js +10 -29
- package/lib/cjs/timePicker/constants.js +1 -4
- package/lib/cjs/timePicker/foundation.js +26 -45
- package/lib/cjs/timePicker/inputFoundation.js +4 -9
- package/lib/cjs/timePicker/utils/index.js +7 -14
- package/lib/cjs/timePicker/utils/localeDate.js +2 -9
- package/lib/cjs/timeline/constants.js +1 -4
- package/lib/cjs/toast/constants.js +1 -4
- package/lib/cjs/toast/toastFoundation.js +5 -12
- package/lib/cjs/toast/toastListFoundation.js +5 -12
- package/lib/cjs/tooltip/constants.js +1 -4
- package/lib/cjs/tooltip/foundation.js +29 -56
- package/lib/cjs/transfer/constants.js +1 -4
- package/lib/cjs/transfer/foundation.js +24 -47
- package/lib/cjs/transfer/transferUtils.js +16 -45
- package/lib/cjs/tree/constants.js +1 -4
- package/lib/cjs/tree/foundation.js +41 -76
- package/lib/cjs/tree/tree.css +3 -0
- package/lib/cjs/tree/tree.scss +4 -0
- package/lib/cjs/tree/treeUtil.d.ts +1 -1
- package/lib/cjs/tree/treeUtil.js +60 -107
- package/lib/cjs/treeSelect/constants.js +1 -4
- package/lib/cjs/treeSelect/foundation.js +49 -82
- package/lib/cjs/typography/constants.js +1 -4
- package/lib/cjs/upload/constants.d.ts +1 -1
- package/lib/cjs/upload/constants.js +1 -4
- package/lib/cjs/upload/foundation.js +56 -112
- package/lib/cjs/upload/utils.js +13 -32
- package/lib/cjs/utils/Event.js +9 -23
- package/lib/cjs/utils/FocusHandle.js +6 -15
- package/lib/cjs/utils/Logger.js +1 -4
- package/lib/cjs/utils/Store.js +5 -20
- package/lib/cjs/utils/a11y.js +8 -13
- package/lib/cjs/utils/array.js +6 -15
- package/lib/cjs/utils/arrayMove.js +3 -12
- package/lib/cjs/utils/classnames.js +6 -15
- package/lib/cjs/utils/date-fns-extra.js +7 -18
- package/lib/cjs/utils/dom.js +5 -12
- package/lib/cjs/utils/function.js +1 -4
- package/lib/cjs/utils/getDataAttr.js +2 -13
- package/lib/cjs/utils/getHighlight.js +7 -22
- package/lib/cjs/utils/getMotionObjFromProps.js +4 -9
- package/lib/cjs/utils/index.js +5 -15
- package/lib/cjs/utils/isBothNaN.js +1 -4
- package/lib/cjs/utils/isElement.js +1 -4
- package/lib/cjs/utils/isEnterPress.js +3 -6
- package/lib/cjs/utils/isEscPress.js +3 -6
- package/lib/cjs/utils/isNullOrUndefined.js +1 -4
- package/lib/cjs/utils/isNumber.js +1 -4
- package/lib/cjs/utils/isObject.js +1 -4
- package/lib/cjs/utils/isPromise.js +3 -6
- package/lib/cjs/utils/isString.js +1 -4
- package/lib/cjs/utils/keyCode.js +1 -4
- package/lib/cjs/utils/log.js +3 -6
- package/lib/cjs/utils/number.js +1 -4
- package/lib/cjs/utils/object.js +10 -27
- package/lib/cjs/utils/set.js +4 -9
- package/lib/cjs/utils/shallowEqualObjects.js +3 -10
- package/lib/cjs/utils/touchPolyfill.js +5 -12
- package/lib/cjs/utils/type.js +1 -3
- package/lib/cjs/utils/uuid.js +3 -14
- package/lib/cjs/utils/warning.js +1 -4
- package/lib/es/anchor/anchor.css +1 -10
- package/lib/es/anchor/anchor.scss +1 -8
- package/lib/es/anchor/foundation.js +2 -4
- package/lib/es/anchor/linkFoundation.js +1 -2
- package/lib/es/anchor/rtl.scss +0 -1
- package/lib/es/anchor/variables.scss +1 -0
- package/lib/es/autoComplete/foundation.js +11 -26
- package/lib/es/autoComplete/optionFoundation.js +1 -2
- package/lib/es/avatar/foundation.js +1 -2
- package/lib/es/backtop/foundation.js +1 -2
- package/lib/es/banner/foundation.js +1 -2
- package/lib/es/base/foundation.js +2 -3
- package/lib/es/breadcrumb/foundation.js +3 -6
- package/lib/es/breadcrumb/itemFoundation.js +1 -2
- package/lib/es/calendar/eventUtil.d.ts +3 -3
- package/lib/es/calendar/eventUtil.js +27 -56
- package/lib/es/calendar/foundation.js +60 -90
- package/lib/es/carousel/foundation.js +2 -4
- package/lib/es/cascader/foundation.js +49 -94
- package/lib/es/cascader/util.js +6 -21
- package/lib/es/checkbox/checkboxFoundation.js +3 -6
- package/lib/es/checkbox/checkboxGroupFoundation.js +6 -9
- package/lib/es/collapse/foundation.js +6 -10
- package/lib/es/datePicker/_utils/formatter.js +2 -5
- package/lib/es/datePicker/_utils/getDefaultPickerDate.js +2 -3
- package/lib/es/datePicker/_utils/getInsetInputFormatToken.js +1 -4
- package/lib/es/datePicker/_utils/getMonthTable.js +1 -5
- package/lib/es/datePicker/_utils/getMonthsInYear.js +2 -9
- package/lib/es/datePicker/_utils/getYears.js +1 -3
- package/lib/es/datePicker/constants.js +2 -7
- package/lib/es/datePicker/foundation.js +39 -70
- package/lib/es/datePicker/inputFoundation.js +4 -11
- package/lib/es/datePicker/monthFoundation.js +2 -4
- package/lib/es/datePicker/monthsGridFoundation.js +40 -55
- package/lib/es/datePicker/yearAndMonthFoundation.js +1 -2
- package/lib/es/dropdown/foundation.js +4 -7
- package/lib/es/dropdown/menuFoundation.js +8 -21
- package/lib/es/form/foundation.js +59 -91
- package/lib/es/form/utils.js +11 -19
- package/lib/es/input/foundation.js +4 -9
- package/lib/es/input/textareaFoundation.js +3 -5
- package/lib/es/input/util/calculateNodeHeight.js +2 -10
- package/lib/es/input/util/getSizingData.js +2 -5
- package/lib/es/inputNumber/constants.js +3 -8
- package/lib/es/inputNumber/foundation.js +8 -18
- package/lib/es/modal/modalContentFoundation.js +1 -2
- package/lib/es/modal/modalFoundation.js +1 -2
- package/lib/es/navigation/NavItem.js +5 -11
- package/lib/es/navigation/foundation.js +19 -25
- package/lib/es/navigation/itemFoundation.js +1 -3
- package/lib/es/navigation/subNavFoundation.js +7 -13
- package/lib/es/notification/notificationFoundation.js +2 -4
- package/lib/es/notification/notificationListFoundation.js +1 -3
- package/lib/es/overflowList/constants.js +2 -3
- package/lib/es/overflowList/foundation.js +9 -23
- package/lib/es/pagination/foundation.js +15 -28
- package/lib/es/popconfirm/popconfirm.css +1 -7
- package/lib/es/popconfirm/popconfirm.scss +1 -11
- package/lib/es/popover/constants.js +1 -2
- package/lib/es/radio/radioGroupFoundation.js +3 -4
- package/lib/es/radio/radioInnerFoundation.js +2 -3
- package/lib/es/rating/foundation.js +4 -13
- package/lib/es/scrollList/itemFoundation.js +5 -13
- package/lib/es/select/foundation.js +50 -88
- package/lib/es/select/optionFoundation.js +1 -2
- package/lib/es/sideSheet/sideSheet.css +1 -0
- package/lib/es/sideSheet/sideSheet.scss +1 -0
- package/lib/es/sideSheet/sideSheetFoundation.js +3 -7
- package/lib/es/slider/foundation.js +29 -25
- package/lib/es/spin/foundation.js +2 -4
- package/lib/es/switch/foundation.js +1 -2
- package/lib/es/table/bodyFoundation.js +6 -11
- package/lib/es/table/foundation.js +67 -93
- package/lib/es/table/mixin.scss +2 -2
- package/lib/es/table/rtl.scss +8 -8
- package/lib/es/table/table.scss +16 -16
- package/lib/es/table/utils.js +33 -51
- package/lib/es/table/variables.scss +0 -3
- package/lib/es/tabs/foundation.js +5 -18
- package/lib/es/tagInput/foundation.js +9 -21
- package/lib/es/timePicker/ComboxFoundation.js +7 -16
- package/lib/es/timePicker/foundation.js +23 -37
- package/lib/es/timePicker/inputFoundation.js +1 -2
- package/lib/es/timePicker/utils/index.js +4 -6
- package/lib/es/timePicker/utils/localeDate.js +1 -2
- package/lib/es/toast/toastFoundation.js +2 -4
- package/lib/es/toast/toastListFoundation.js +2 -4
- package/lib/es/tooltip/foundation.js +26 -46
- package/lib/es/transfer/foundation.js +21 -43
- package/lib/es/transfer/transferUtils.js +13 -33
- package/lib/es/tree/foundation.js +38 -70
- package/lib/es/tree/tree.css +3 -0
- package/lib/es/tree/tree.scss +4 -0
- package/lib/es/tree/treeUtil.d.ts +1 -1
- package/lib/es/tree/treeUtil.js +57 -109
- package/lib/es/treeSelect/foundation.js +45 -73
- package/lib/es/upload/constants.d.ts +1 -1
- package/lib/es/upload/foundation.js +52 -118
- package/lib/es/upload/utils.js +12 -25
- package/lib/es/utils/Event.js +5 -12
- package/lib/es/utils/FocusHandle.js +3 -7
- package/lib/es/utils/Store.js +4 -12
- package/lib/es/utils/a11y.js +5 -6
- package/lib/es/utils/array.js +3 -5
- package/lib/es/utils/arrayMove.js +2 -6
- package/lib/es/utils/classnames.js +3 -6
- package/lib/es/utils/date-fns-extra.js +6 -14
- package/lib/es/utils/dom.js +1 -2
- package/lib/es/utils/getDataAttr.js +1 -5
- package/lib/es/utils/getHighlight.js +4 -14
- package/lib/es/utils/getMotionObjFromProps.js +1 -2
- package/lib/es/utils/object.js +7 -15
- package/lib/es/utils/set.js +1 -2
- package/lib/es/utils/shallowEqualObjects.js +2 -5
- package/lib/es/utils/touchPolyfill.js +2 -6
- package/lib/es/utils/uuid.js +2 -7
- package/package.json +2 -4
- package/popconfirm/popconfirm.scss +1 -11
- package/select/foundation.ts +2 -2
- package/sideSheet/sideSheet.scss +1 -0
- package/slider/foundation.ts +15 -8
- package/table/mixin.scss +2 -2
- package/table/rtl.scss +8 -8
- package/table/table.scss +16 -16
- package/table/variables.scss +0 -3
- package/tree/tree.scss +4 -0
|
@@ -1,31 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = void 0;
|
|
12
7
|
|
|
13
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
14
|
-
|
|
15
|
-
var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
|
|
16
|
-
|
|
17
|
-
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
18
|
-
|
|
19
|
-
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
20
|
-
|
|
21
|
-
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
|
22
|
-
|
|
23
|
-
var _trim = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/trim"));
|
|
24
|
-
|
|
25
|
-
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
26
|
-
|
|
27
|
-
var _splice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/splice"));
|
|
28
|
-
|
|
29
8
|
var _isUndefined2 = _interopRequireDefault(require("lodash/isUndefined"));
|
|
30
9
|
|
|
31
10
|
var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
|
|
@@ -44,9 +23,11 @@ var _isEnterPress = _interopRequireDefault(require("../utils/isEnterPress"));
|
|
|
44
23
|
|
|
45
24
|
var _arrayMove = _interopRequireDefault(require("../utils/arrayMove"));
|
|
46
25
|
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
+
|
|
47
28
|
class TagInputFoundation extends _foundation.default {
|
|
48
29
|
constructor(adapter) {
|
|
49
|
-
super(
|
|
30
|
+
super(Object.assign({}, adapter));
|
|
50
31
|
/**
|
|
51
32
|
* handler of input change
|
|
52
33
|
*/
|
|
@@ -124,7 +105,7 @@ class TagInputFoundation extends _foundation.default {
|
|
|
124
105
|
} = tagsArray;
|
|
125
106
|
|
|
126
107
|
if (code === _keyCode.default.BACKSPACE && inputValue === '' && length > 0) {
|
|
127
|
-
const newTagList =
|
|
108
|
+
const newTagList = tagsArray.slice(0, length - 1);
|
|
128
109
|
const removedTag = tagsArray[length - 1];
|
|
129
110
|
|
|
130
111
|
this._onRemove(newTagList, removedTag, length - 1);
|
|
@@ -148,23 +129,23 @@ class TagInputFoundation extends _foundation.default {
|
|
|
148
129
|
} = this._adapter.getStates();
|
|
149
130
|
|
|
150
131
|
let addTags = (0, _getSplitedArray.default)(inputValue, separator);
|
|
151
|
-
addTags =
|
|
132
|
+
addTags = addTags.filter((item, idx) => {
|
|
152
133
|
// If allowDuplicates is false, then filter duplicates
|
|
153
134
|
if (!allowDuplicates) {
|
|
154
|
-
if (
|
|
135
|
+
if (tagsArray.includes(item) || addTags.indexOf(item) !== idx) {
|
|
155
136
|
return false;
|
|
156
137
|
}
|
|
157
138
|
} // Filter empty strings and pure space strings in new items
|
|
158
139
|
|
|
159
140
|
|
|
160
|
-
return (0, _isString2.default)(item) &&
|
|
141
|
+
return (0, _isString2.default)(item) && item.trim() !== '';
|
|
161
142
|
});
|
|
162
|
-
let newTagList =
|
|
143
|
+
let newTagList = tagsArray.concat(addTags);
|
|
163
144
|
|
|
164
145
|
if ((0, _isNumber2.default)(max) && newTagList.length > max) {
|
|
165
146
|
(0, _isFunction2.default)(onExceed) && onExceed(newTagList);
|
|
166
|
-
newTagList =
|
|
167
|
-
addTags =
|
|
147
|
+
newTagList = newTagList.slice(0, max);
|
|
148
|
+
addTags = addTags.slice(0, max - tagsArray.length);
|
|
168
149
|
}
|
|
169
150
|
|
|
170
151
|
if (addTags.length > 0) {
|
|
@@ -232,7 +213,7 @@ class TagInputFoundation extends _foundation.default {
|
|
|
232
213
|
} = this._adapter.getStates();
|
|
233
214
|
|
|
234
215
|
const newTagList = [...tagsArray];
|
|
235
|
-
|
|
216
|
+
newTagList.splice(index, 1);
|
|
236
217
|
const removedTag = tagsArray[index];
|
|
237
218
|
|
|
238
219
|
this._onRemove(newTagList, removedTag, index);
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = void 0;
|
|
12
7
|
|
|
13
8
|
var _isNumber2 = _interopRequireDefault(require("lodash/isNumber"));
|
|
@@ -16,6 +11,8 @@ var _isArray2 = _interopRequireDefault(require("lodash/isArray"));
|
|
|
16
11
|
|
|
17
12
|
var _isString2 = _interopRequireDefault(require("lodash/isString"));
|
|
18
13
|
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
19
16
|
/**
|
|
20
17
|
* Get the splited array.
|
|
21
18
|
* We expect separators to be string | string[] | null, but users
|
|
@@ -1,29 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.formatOption = exports.default = void 0;
|
|
12
7
|
|
|
13
|
-
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
|
14
|
-
|
|
15
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
16
|
-
|
|
17
|
-
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
18
|
-
|
|
19
|
-
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
20
|
-
|
|
21
|
-
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
22
|
-
|
|
23
|
-
var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/parse-int"));
|
|
24
|
-
|
|
25
|
-
var _now = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/date/now"));
|
|
26
|
-
|
|
27
8
|
var _constants = require("./constants");
|
|
28
9
|
|
|
29
10
|
var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
@@ -32,6 +13,8 @@ var _index = require("../datePicker/_utils/index");
|
|
|
32
13
|
|
|
33
14
|
var _isNullOrUndefined = _interopRequireDefault(require("../utils/isNullOrUndefined"));
|
|
34
15
|
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
35
18
|
const HOUR = 1000 * 60 * 60;
|
|
36
19
|
const DAY = 24 * HOUR; // TODO: move to utils
|
|
37
20
|
|
|
@@ -44,7 +27,7 @@ const formatOption = (option, disabledOptions) => {
|
|
|
44
27
|
|
|
45
28
|
let disabled = false;
|
|
46
29
|
|
|
47
|
-
if (disabledOptions &&
|
|
30
|
+
if (disabledOptions && disabledOptions.indexOf(option) >= 0) {
|
|
48
31
|
disabled = true;
|
|
49
32
|
}
|
|
50
33
|
|
|
@@ -61,7 +44,7 @@ function generateOptions(length, disabledOptions, hideDisabledOptions) {
|
|
|
61
44
|
const arr = [];
|
|
62
45
|
|
|
63
46
|
for (let value = 0; value < length; value += step) {
|
|
64
|
-
if (!disabledOptions ||
|
|
47
|
+
if (!disabledOptions || disabledOptions.indexOf(value) < 0 || !hideDisabledOptions) {
|
|
65
48
|
arr.push(value);
|
|
66
49
|
}
|
|
67
50
|
}
|
|
@@ -71,7 +54,7 @@ function generateOptions(length, disabledOptions, hideDisabledOptions) {
|
|
|
71
54
|
|
|
72
55
|
class ComboboxFoundation extends _foundation.default {
|
|
73
56
|
constructor(adapter) {
|
|
74
|
-
super(
|
|
57
|
+
super(Object.assign({}, adapter));
|
|
75
58
|
}
|
|
76
59
|
|
|
77
60
|
isAM() {
|
|
@@ -131,13 +114,11 @@ class ComboboxFoundation extends _foundation.default {
|
|
|
131
114
|
} = this.getProps();
|
|
132
115
|
let disabledOptions = disabledHours && disabledHours();
|
|
133
116
|
|
|
134
|
-
if (use12Hours &&
|
|
117
|
+
if (use12Hours && Array.isArray(disabledOptions)) {
|
|
135
118
|
if (this.isAM()) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
disabledOptions = (0, _map.default)(_context = (0, _filter.default)(disabledOptions).call(disabledOptions, h => h < 12)).call(_context, h => h === 0 ? 12 : h);
|
|
119
|
+
disabledOptions = disabledOptions.filter(h => h < 12).map(h => h === 0 ? 12 : h);
|
|
139
120
|
} else {
|
|
140
|
-
disabledOptions =
|
|
121
|
+
disabledOptions = disabledOptions.map(h => h === 12 ? 12 : h - 12);
|
|
141
122
|
}
|
|
142
123
|
}
|
|
143
124
|
|
|
@@ -184,7 +165,7 @@ class ComboboxFoundation extends _foundation.default {
|
|
|
184
165
|
|
|
185
166
|
|
|
186
167
|
createDateDefault() {
|
|
187
|
-
return new Date((
|
|
168
|
+
return new Date(parseInt(String(Date.now() / DAY), 10) * DAY - 8 * HOUR);
|
|
188
169
|
}
|
|
189
170
|
|
|
190
171
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
|
|
9
6
|
exports.strings = exports.numbers = exports.cssClasses = void 0;
|
|
10
7
|
|
|
11
8
|
var _constants = require("../base/constants");
|
|
@@ -1,27 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = void 0;
|
|
12
7
|
|
|
13
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
14
|
-
|
|
15
|
-
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
16
|
-
|
|
17
|
-
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
18
|
-
|
|
19
|
-
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
20
|
-
|
|
21
|
-
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
22
|
-
|
|
23
|
-
var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
|
|
24
|
-
|
|
25
8
|
var _split2 = _interopRequireDefault(require("lodash/split"));
|
|
26
9
|
|
|
27
10
|
var _constants = require("./constants");
|
|
@@ -36,11 +19,13 @@ var _dateFnsExtra = require("../utils/date-fns-extra");
|
|
|
36
19
|
|
|
37
20
|
var _isNullOrUndefined = _interopRequireDefault(require("../utils/isNullOrUndefined"));
|
|
38
21
|
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
39
24
|
/* eslint-disable max-len */
|
|
40
25
|
// TODO: split, timePicker different components cannot share a foundation
|
|
41
26
|
class TimePickerFoundation extends _foundation.default {
|
|
42
27
|
constructor(adapter) {
|
|
43
|
-
super(
|
|
28
|
+
super(Object.assign({}, adapter));
|
|
44
29
|
}
|
|
45
30
|
|
|
46
31
|
init() {
|
|
@@ -81,11 +66,9 @@ class TimePickerFoundation extends _foundation.default {
|
|
|
81
66
|
}
|
|
82
67
|
|
|
83
68
|
isValidTimeZone(timeZone) {
|
|
84
|
-
var _context;
|
|
85
|
-
|
|
86
69
|
const _timeZone = timeZone === undefined ? this.getProp('timeZone') : timeZone;
|
|
87
70
|
|
|
88
|
-
return
|
|
71
|
+
return ['string', 'number'].includes(typeof _timeZone) && _timeZone !== '';
|
|
89
72
|
}
|
|
90
73
|
|
|
91
74
|
getDefaultFormatIfNeed() {
|
|
@@ -113,13 +96,13 @@ class TimePickerFoundation extends _foundation.default {
|
|
|
113
96
|
} = this.getProps();
|
|
114
97
|
value = value || defaultValue;
|
|
115
98
|
|
|
116
|
-
if (!
|
|
99
|
+
if (!Array.isArray(value)) {
|
|
117
100
|
value = value ? [value] : [];
|
|
118
101
|
}
|
|
119
102
|
|
|
120
103
|
const parsedValues = [];
|
|
121
104
|
let invalid = false;
|
|
122
|
-
|
|
105
|
+
value.forEach(v => {
|
|
123
106
|
const pv = (0, _utils.parseToDate)(v, formatToken, dateFnsLocale);
|
|
124
107
|
|
|
125
108
|
if (!isNaN(pv.getTime())) {
|
|
@@ -127,7 +110,7 @@ class TimePickerFoundation extends _foundation.default {
|
|
|
127
110
|
}
|
|
128
111
|
});
|
|
129
112
|
const isAM = [true, false];
|
|
130
|
-
|
|
113
|
+
parsedValues.map((item, idx) => {
|
|
131
114
|
isAM[idx] = (0, _dateFns.getHours)(item) < 12;
|
|
132
115
|
});
|
|
133
116
|
|
|
@@ -144,7 +127,7 @@ class TimePickerFoundation extends _foundation.default {
|
|
|
144
127
|
let inputValue = '';
|
|
145
128
|
|
|
146
129
|
if (!invalid) {
|
|
147
|
-
inputValue =
|
|
130
|
+
inputValue = value.map(v => (0, _utils.formatToString)(v, formatToken, dateFnsLocale)).join(rangeSeparator);
|
|
148
131
|
}
|
|
149
132
|
|
|
150
133
|
this.setState({
|
|
@@ -220,7 +203,7 @@ class TimePickerFoundation extends _foundation.default {
|
|
|
220
203
|
|
|
221
204
|
if (!invalid) {
|
|
222
205
|
if (this.isValidTimeZone(timeZone)) {
|
|
223
|
-
dates =
|
|
206
|
+
dates = dates.map(date => (0, _dateFnsExtra.utcToZonedTime)(this.isValidTimeZone(__prevTimeZone) ? (0, _dateFnsExtra.zonedTimeToUtc)(date, __prevTimeZone) : date, timeZone));
|
|
224
207
|
}
|
|
225
208
|
|
|
226
209
|
const inputValue = this.formatValue(dates);
|
|
@@ -296,7 +279,7 @@ class TimePickerFoundation extends _foundation.default {
|
|
|
296
279
|
* -when emptying, the input is "', at this time you need to skip isTimeFormatLike judgment
|
|
297
280
|
*/
|
|
298
281
|
|
|
299
|
-
if (input !== '' &&
|
|
282
|
+
if (input !== '' && inputValues.some(time => !(0, _utils.isTimeFormatLike)(time, formatToken))) {
|
|
300
283
|
return;
|
|
301
284
|
}
|
|
302
285
|
|
|
@@ -327,7 +310,7 @@ class TimePickerFoundation extends _foundation.default {
|
|
|
327
310
|
doValidate(args) {
|
|
328
311
|
if (typeof args === 'string') {
|
|
329
312
|
return this.validateStr(args);
|
|
330
|
-
} else if (
|
|
313
|
+
} else if (Array.isArray(args)) {
|
|
331
314
|
return this.validateDates(args);
|
|
332
315
|
}
|
|
333
316
|
|
|
@@ -342,10 +325,10 @@ class TimePickerFoundation extends _foundation.default {
|
|
|
342
325
|
|
|
343
326
|
validateDates() {
|
|
344
327
|
let dates = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
345
|
-
let invalid =
|
|
328
|
+
let invalid = dates.some(d => isNaN(Number(d)));
|
|
346
329
|
|
|
347
330
|
if (!invalid) {
|
|
348
|
-
invalid =
|
|
331
|
+
invalid = dates.some(d => this.isDisabledHMS({
|
|
349
332
|
hours: d.getHours(),
|
|
350
333
|
minutes: d.getMinutes(),
|
|
351
334
|
seconds: d.getSeconds()
|
|
@@ -386,12 +369,12 @@ class TimePickerFoundation extends _foundation.default {
|
|
|
386
369
|
const dateFnsLocale = this.getProp('dateFnsLocale');
|
|
387
370
|
let _dates = dates;
|
|
388
371
|
|
|
389
|
-
if (_dates && !
|
|
372
|
+
if (_dates && !Array.isArray(_dates)) {
|
|
390
373
|
_dates = _dates[_dates];
|
|
391
374
|
}
|
|
392
375
|
|
|
393
|
-
if (_dates &&
|
|
394
|
-
return
|
|
376
|
+
if (_dates && Array.isArray(_dates)) {
|
|
377
|
+
return _dates.map(date => (0, _utils.formatToString)(date, validFormat, dateFnsLocale)).join(rangeSeparator);
|
|
395
378
|
}
|
|
396
379
|
|
|
397
380
|
return undefined;
|
|
@@ -403,9 +386,7 @@ class TimePickerFoundation extends _foundation.default {
|
|
|
403
386
|
const dateFnsLocale = this.getProp('dateFnsLocale');
|
|
404
387
|
|
|
405
388
|
if (str && typeof str === 'string') {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
return (0, _map.default)(_context2 = (0, _split2.default)(str, rangeSeparator)).call(_context2, v => (0, _utils.parseToDate)(v, validFormat, dateFnsLocale));
|
|
389
|
+
return (0, _split2.default)(str, rangeSeparator).map(v => (0, _utils.parseToDate)(v, validFormat, dateFnsLocale));
|
|
409
390
|
}
|
|
410
391
|
|
|
411
392
|
return [];
|
|
@@ -417,12 +398,12 @@ class TimePickerFoundation extends _foundation.default {
|
|
|
417
398
|
const dateFnsLocale = this.getProp('dateFnsLocale');
|
|
418
399
|
let _value = value;
|
|
419
400
|
|
|
420
|
-
if (!
|
|
401
|
+
if (!Array.isArray(_value)) {
|
|
421
402
|
_value = _value ? [_value] : [];
|
|
422
403
|
}
|
|
423
404
|
|
|
424
|
-
if (
|
|
425
|
-
return
|
|
405
|
+
if (Array.isArray(_value)) {
|
|
406
|
+
return _value.map(v => (0, _utils.parseToDate)(v, formatToken, dateFnsLocale));
|
|
426
407
|
}
|
|
427
408
|
|
|
428
409
|
return [];
|
|
@@ -437,15 +418,15 @@ class TimePickerFoundation extends _foundation.default {
|
|
|
437
418
|
const rangeSeparator = this.getProp('rangeSeparator');
|
|
438
419
|
str = (0, _split2.default)(inputValue, rangeSeparator);
|
|
439
420
|
} else {
|
|
440
|
-
_value =
|
|
421
|
+
_value = Array.isArray(_value) ? _value[0] : _value;
|
|
441
422
|
}
|
|
442
423
|
|
|
443
424
|
if (this.isValidTimeZone() && _value) {
|
|
444
425
|
const formatToken = this.getValidFormat();
|
|
445
426
|
|
|
446
|
-
if (
|
|
447
|
-
_value =
|
|
448
|
-
str =
|
|
427
|
+
if (Array.isArray(_value)) {
|
|
428
|
+
_value = _value.map(v => (0, _dateFnsExtra.zonedTimeToUtc)(v, timeZone));
|
|
429
|
+
str = _value.map(v => (0, _dateFns.format)(v, formatToken));
|
|
449
430
|
} else {
|
|
450
431
|
_value = (0, _dateFnsExtra.zonedTimeToUtc)(_value, timeZone);
|
|
451
432
|
str = (0, _dateFns.format)(_value, formatToken);
|
|
@@ -466,7 +447,7 @@ class TimePickerFoundation extends _foundation.default {
|
|
|
466
447
|
let oldDates = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
467
448
|
const formatToken = this.getValidFormat();
|
|
468
449
|
const dateFnsLocale = this.getProp('dateFnsLocale');
|
|
469
|
-
return dates.length !== oldDates.length ||
|
|
450
|
+
return dates.length !== oldDates.length || dates.some((date, index) => {
|
|
470
451
|
const oldDate = oldDates[index];
|
|
471
452
|
|
|
472
453
|
if ((0, _dateFns.isValid)(date) && (0, _dateFns.isValid)(oldDate) && (0, _utils.formatToString)(date, formatToken, dateFnsLocale) === (0, _utils.formatToString)(oldDate, formatToken, dateFnsLocale)) {
|
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = void 0;
|
|
12
7
|
|
|
13
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
14
|
-
|
|
15
8
|
var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
16
9
|
|
|
17
10
|
var _isNullOrUndefined = _interopRequireDefault(require("../utils/isNullOrUndefined"));
|
|
18
11
|
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
19
14
|
class TimePickerFoundation extends _foundation.default {
|
|
20
15
|
constructor(adapter) {
|
|
21
|
-
super(
|
|
16
|
+
super(Object.assign({}, adapter));
|
|
22
17
|
} // eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
23
18
|
|
|
24
19
|
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.transformToArray = exports.secondIsDisabled = exports.parseToTimestamp = exports.parseToDate = exports.minuteIsDisabled = exports.isTimeFormatLike = exports.hourIsDisabled = exports.formatToString = void 0;
|
|
12
7
|
|
|
13
|
-
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
14
|
-
|
|
15
|
-
var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
|
|
16
|
-
|
|
17
8
|
var _toNumber2 = _interopRequireDefault(require("lodash/toNumber"));
|
|
18
9
|
|
|
19
10
|
var _dateFns = require("date-fns");
|
|
@@ -24,6 +15,8 @@ var _isNullOrUndefined = _interopRequireDefault(require("../../utils/isNullOrUnd
|
|
|
24
15
|
|
|
25
16
|
var _locale = require("date-fns/locale");
|
|
26
17
|
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
27
20
|
/* eslint-disable max-len */
|
|
28
21
|
|
|
29
22
|
/**
|
|
@@ -91,7 +84,7 @@ const hourIsDisabled = (disabledHours, hour) => {
|
|
|
91
84
|
if (typeof disabledHours === 'function') {
|
|
92
85
|
const disabledOptions = disabledHours();
|
|
93
86
|
|
|
94
|
-
if (
|
|
87
|
+
if (Array.isArray(disabledOptions) && !(0, _isNullOrUndefined.default)(hour) && disabledOptions.some(v => (0, _toNumber2.default)(v) === (0, _toNumber2.default)(hour))) {
|
|
95
88
|
return true;
|
|
96
89
|
}
|
|
97
90
|
}
|
|
@@ -105,7 +98,7 @@ const minuteIsDisabled = (disabledMinutes, hour, minute) => {
|
|
|
105
98
|
if (typeof disabledMinutes === 'function') {
|
|
106
99
|
const disabledOptions = disabledMinutes(hour);
|
|
107
100
|
|
|
108
|
-
if (
|
|
101
|
+
if (Array.isArray(disabledOptions) && !(0, _isNullOrUndefined.default)(hour) && !(0, _isNullOrUndefined.default)(minute) && disabledOptions.some(v => (0, _toNumber2.default)(v) === (0, _toNumber2.default)(minute))) {
|
|
109
102
|
return true;
|
|
110
103
|
}
|
|
111
104
|
}
|
|
@@ -119,7 +112,7 @@ const secondIsDisabled = (disabledSeconds, hour, minute, second) => {
|
|
|
119
112
|
if (typeof disabledSeconds === 'function') {
|
|
120
113
|
const disabledOptions = disabledSeconds(hour, minute);
|
|
121
114
|
|
|
122
|
-
if (
|
|
115
|
+
if (Array.isArray(disabledOptions) && !(0, _isNullOrUndefined.default)(hour) && !(0, _isNullOrUndefined.default)(minute) && !(0, _isNullOrUndefined.default)(second) && disabledOptions.some(v => (0, _toNumber2.default)(v) === (0, _toNumber2.default)(second))) {
|
|
123
116
|
return true;
|
|
124
117
|
}
|
|
125
118
|
}
|
|
@@ -130,7 +123,7 @@ const secondIsDisabled = (disabledSeconds, hour, minute, second) => {
|
|
|
130
123
|
exports.secondIsDisabled = secondIsDisabled;
|
|
131
124
|
|
|
132
125
|
const transformToArray = value => {
|
|
133
|
-
if (!
|
|
126
|
+
if (!Array.isArray(value)) {
|
|
134
127
|
return [];
|
|
135
128
|
} else {
|
|
136
129
|
return [...value];
|
|
@@ -1,25 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.localeFormat = localeFormat;
|
|
12
7
|
exports.localeParse = localeParse;
|
|
13
8
|
|
|
14
|
-
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
15
|
-
|
|
16
9
|
var _dateFns = require("date-fns");
|
|
17
10
|
|
|
18
11
|
/* istanbul ignore next */
|
|
19
12
|
const replace = function replace(str, replacements) {
|
|
20
13
|
let _str = str;
|
|
21
14
|
|
|
22
|
-
for (const key of
|
|
15
|
+
for (const key of Object.keys(replacements)) {
|
|
23
16
|
if (typeof replacements[key] === 'string') {
|
|
24
17
|
_str = _str.replace(key, replacements[key]);
|
|
25
18
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
|
|
9
6
|
exports.strings = exports.cssClasses = void 0;
|
|
10
7
|
|
|
11
8
|
var _constants = require("../base/constants");
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
|
|
9
6
|
exports.strings = exports.numbers = exports.cssClasses = void 0;
|
|
10
7
|
|
|
11
8
|
var _constants = require("../base/constants");
|
|
@@ -1,26 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = void 0;
|
|
12
7
|
|
|
13
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
14
|
-
|
|
15
|
-
var _setTimeout2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set-timeout"));
|
|
16
|
-
|
|
17
8
|
var _isNumber2 = _interopRequireDefault(require("lodash/isNumber"));
|
|
18
9
|
|
|
19
10
|
var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
20
11
|
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
21
14
|
class ToastFoundation extends _foundation.default {
|
|
22
15
|
constructor(adapter) {
|
|
23
|
-
super(
|
|
16
|
+
super(Object.assign(Object.assign({}, ToastFoundation.defaultAdapter), adapter));
|
|
24
17
|
this._timer = null;
|
|
25
18
|
this._id = null; // cache id
|
|
26
19
|
}
|
|
@@ -39,7 +32,7 @@ class ToastFoundation extends _foundation.default {
|
|
|
39
32
|
const duration = this._adapter.getProp('duration');
|
|
40
33
|
|
|
41
34
|
if (duration && (0, _isNumber2.default)(duration)) {
|
|
42
|
-
this._timer = (
|
|
35
|
+
this._timer = setTimeout(() => {
|
|
43
36
|
this.close(); // call parent to remove itself
|
|
44
37
|
}, duration * 1000);
|
|
45
38
|
}
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
4
|
value: true
|
|
9
5
|
});
|
|
10
|
-
|
|
11
6
|
exports.default = void 0;
|
|
12
7
|
|
|
13
|
-
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
14
|
-
|
|
15
|
-
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
16
|
-
|
|
17
8
|
var _foundation = _interopRequireDefault(require("../base/foundation"));
|
|
18
9
|
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
19
12
|
class ToastListFoundation extends _foundation.default {
|
|
20
13
|
constructor(adapter) {
|
|
21
|
-
super(
|
|
14
|
+
super(Object.assign(Object.assign({}, ToastListFoundation.defaultAdapter), adapter));
|
|
22
15
|
}
|
|
23
16
|
|
|
24
17
|
addToast(toastOpts) {
|
|
@@ -37,7 +30,7 @@ class ToastListFoundation extends _foundation.default {
|
|
|
37
30
|
let toastList = this._adapter.getState('list');
|
|
38
31
|
|
|
39
32
|
const removedItems = [];
|
|
40
|
-
toastList =
|
|
33
|
+
toastList = toastList.filter(toastOpts => {
|
|
41
34
|
if (toastOpts.id === id) {
|
|
42
35
|
removedItems.push(toastOpts);
|
|
43
36
|
return false;
|