@douyinfe/semi-foundation 2.25.2 → 2.25.4
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/monthsGridFoundation.ts +36 -15
- package/lib/cjs/anchor/constants.js +1 -1
- package/lib/cjs/anchor/foundation.js +3 -3
- package/lib/cjs/autoComplete/constants.js +3 -3
- package/lib/cjs/avatar/constants.js +1 -1
- package/lib/cjs/backtop/constants.js +1 -1
- package/lib/cjs/badge/constants.js +1 -1
- package/lib/cjs/banner/constants.js +1 -1
- package/lib/cjs/breadcrumb/constants.js +1 -1
- package/lib/cjs/button/constants.js +1 -1
- package/lib/cjs/calendar/constants.js +1 -1
- package/lib/cjs/card/constants.js +1 -1
- package/lib/cjs/carousel/constants.js +9 -9
- package/lib/cjs/cascader/constants.js +2 -2
- package/lib/cjs/cascader/foundation.js +1 -1
- package/lib/cjs/cascader/util.js +2 -2
- package/lib/cjs/checkbox/constants.js +13 -13
- package/lib/cjs/collapse/constants.js +1 -1
- package/lib/cjs/collapsible/constants.js +1 -1
- package/lib/cjs/datePicker/_utils/getInsetInputFormatToken.js +1 -1
- package/lib/cjs/datePicker/_utils/getMonthTable.js +4 -4
- package/lib/cjs/datePicker/_utils/getMonthsInYear.js +1 -1
- package/lib/cjs/datePicker/constants.js +27 -27
- package/lib/cjs/datePicker/foundation.js +3 -3
- package/lib/cjs/datePicker/inputFoundation.js +2 -2
- package/lib/cjs/datePicker/monthsGridFoundation.d.ts +12 -7
- package/lib/cjs/datePicker/monthsGridFoundation.js +21 -4
- package/lib/cjs/descriptions/constants.js +1 -1
- package/lib/cjs/divider/constants.js +1 -1
- package/lib/cjs/dropdown/constants.js +3 -3
- package/lib/cjs/dropdown/menuFoundation.js +1 -1
- package/lib/cjs/empty/constants.js +1 -1
- package/lib/cjs/form/constants.js +1 -1
- package/lib/cjs/form/foundation.js +1 -1
- package/lib/cjs/form/utils.js +1 -1
- package/lib/cjs/grid/constants.js +1 -1
- package/lib/cjs/highlight/constants.js +1 -1
- package/lib/cjs/icons/constants.js +1 -1
- package/lib/cjs/image/constants.js +1 -1
- package/lib/cjs/input/constants.js +1 -1
- package/lib/cjs/input/textareaFoundation.js +1 -1
- package/lib/cjs/layout/constants.js +1 -1
- package/lib/cjs/list/constants.js +1 -1
- package/lib/cjs/modal/constants.js +1 -1
- package/lib/cjs/navigation/constants.js +1 -1
- package/lib/cjs/notification/constants.js +3 -3
- package/lib/cjs/pagination/constants.js +1 -1
- package/lib/cjs/popconfirm/constants.js +2 -2
- package/lib/cjs/popover/constants.js +2 -2
- package/lib/cjs/progress/constants.js +1 -1
- package/lib/cjs/progress/generates.js +14 -14
- package/lib/cjs/radio/constants.js +13 -13
- package/lib/cjs/rating/constants.js +1 -1
- package/lib/cjs/scrollList/constants.js +2 -2
- package/lib/cjs/select/constants.js +3 -3
- package/lib/cjs/select/foundation.js +2 -1
- package/lib/cjs/sideSheet/constants.js +2 -2
- package/lib/cjs/skeleton/constants.js +1 -1
- package/lib/cjs/slider/constants.js +7 -7
- package/lib/cjs/space/constants.js +1 -1
- package/lib/cjs/spin/constants.js +1 -1
- package/lib/cjs/steps/constants.js +2 -2
- package/lib/cjs/switch/constants.js +13 -13
- package/lib/cjs/table/constants.js +7 -7
- package/lib/cjs/table/utils.js +2 -2
- package/lib/cjs/tabs/constants.js +21 -21
- package/lib/cjs/tag/constants.js +1 -1
- package/lib/cjs/tagInput/constants.js +1 -1
- package/lib/cjs/timePicker/ComboxFoundation.js +2 -2
- package/lib/cjs/timePicker/constants.js +3 -3
- package/lib/cjs/timePicker/utils/index.js +3 -3
- package/lib/cjs/timeline/constants.js +2 -2
- package/lib/cjs/toast/constants.js +3 -3
- package/lib/cjs/tooltip/constants.js +1 -1
- package/lib/cjs/tooltip/foundation.js +13 -9
- package/lib/cjs/transfer/constants.js +1 -1
- package/lib/cjs/tree/constants.js +2 -2
- package/lib/cjs/tree/treeUtil.js +1 -1
- package/lib/cjs/treeSelect/constants.js +3 -3
- package/lib/cjs/typography/constants.js +1 -1
- package/lib/cjs/typography/formatNumeral.js +6 -6
- package/lib/cjs/upload/constants.js +2 -2
- package/lib/cjs/upload/foundation.js +1 -1
- package/lib/cjs/upload/utils.js +4 -4
- package/lib/cjs/utils/getMotionObjFromProps.js +2 -2
- package/lib/cjs/utils/touchPolyfill.js +1 -1
- package/lib/cjs/utils/uuid.js +2 -2
- package/lib/cjs/utils/warning.js +1 -1
- package/lib/es/anchor/constants.js +1 -1
- package/lib/es/anchor/foundation.js +3 -3
- package/lib/es/autoComplete/constants.js +3 -3
- package/lib/es/avatar/constants.js +1 -1
- package/lib/es/backtop/constants.js +1 -1
- package/lib/es/badge/constants.js +1 -1
- package/lib/es/banner/constants.js +1 -1
- package/lib/es/breadcrumb/constants.js +1 -1
- package/lib/es/button/constants.js +1 -1
- package/lib/es/calendar/constants.js +1 -1
- package/lib/es/card/constants.js +1 -1
- package/lib/es/carousel/constants.js +9 -9
- package/lib/es/cascader/constants.js +2 -2
- package/lib/es/cascader/foundation.js +1 -1
- package/lib/es/cascader/util.js +2 -2
- package/lib/es/checkbox/constants.js +13 -13
- package/lib/es/collapse/constants.js +1 -1
- package/lib/es/collapsible/constants.js +1 -1
- package/lib/es/datePicker/_utils/getInsetInputFormatToken.js +1 -1
- package/lib/es/datePicker/_utils/getMonthTable.js +4 -4
- package/lib/es/datePicker/_utils/getMonthsInYear.js +1 -1
- package/lib/es/datePicker/constants.js +27 -27
- package/lib/es/datePicker/foundation.js +3 -3
- package/lib/es/datePicker/inputFoundation.js +2 -2
- package/lib/es/datePicker/monthsGridFoundation.d.ts +12 -7
- package/lib/es/datePicker/monthsGridFoundation.js +21 -4
- package/lib/es/descriptions/constants.js +1 -1
- package/lib/es/divider/constants.js +1 -1
- package/lib/es/dropdown/constants.js +3 -3
- package/lib/es/dropdown/menuFoundation.js +1 -1
- package/lib/es/empty/constants.js +1 -1
- package/lib/es/form/constants.js +1 -1
- package/lib/es/form/foundation.js +1 -1
- package/lib/es/form/utils.js +1 -1
- package/lib/es/grid/constants.js +1 -1
- package/lib/es/highlight/constants.js +1 -1
- package/lib/es/icons/constants.js +1 -1
- package/lib/es/image/constants.js +1 -1
- package/lib/es/input/constants.js +1 -1
- package/lib/es/input/textareaFoundation.js +1 -1
- package/lib/es/layout/constants.js +1 -1
- package/lib/es/list/constants.js +1 -1
- package/lib/es/modal/constants.js +1 -1
- package/lib/es/navigation/constants.js +1 -1
- package/lib/es/notification/constants.js +3 -3
- package/lib/es/pagination/constants.js +1 -1
- package/lib/es/popconfirm/constants.js +2 -2
- package/lib/es/popover/constants.js +2 -2
- package/lib/es/progress/constants.js +1 -1
- package/lib/es/progress/generates.js +14 -14
- package/lib/es/radio/constants.js +13 -13
- package/lib/es/rating/constants.js +1 -1
- package/lib/es/scrollList/constants.js +2 -2
- package/lib/es/select/constants.js +3 -3
- package/lib/es/select/foundation.js +2 -1
- package/lib/es/sideSheet/constants.js +2 -2
- package/lib/es/skeleton/constants.js +1 -1
- package/lib/es/slider/constants.js +7 -7
- package/lib/es/space/constants.js +1 -1
- package/lib/es/spin/constants.js +1 -1
- package/lib/es/steps/constants.js +2 -2
- package/lib/es/switch/constants.js +13 -13
- package/lib/es/table/constants.js +7 -7
- package/lib/es/table/utils.js +2 -2
- package/lib/es/tabs/constants.js +21 -21
- package/lib/es/tag/constants.js +1 -1
- package/lib/es/tagInput/constants.js +1 -1
- package/lib/es/timePicker/ComboxFoundation.js +2 -2
- package/lib/es/timePicker/constants.js +3 -3
- package/lib/es/timePicker/utils/index.js +3 -3
- package/lib/es/timeline/constants.js +2 -2
- package/lib/es/toast/constants.js +3 -3
- package/lib/es/tooltip/constants.js +1 -1
- package/lib/es/tooltip/foundation.js +13 -9
- package/lib/es/transfer/constants.js +1 -1
- package/lib/es/tree/constants.js +2 -2
- package/lib/es/tree/treeUtil.js +1 -1
- package/lib/es/treeSelect/constants.js +3 -3
- package/lib/es/typography/constants.js +1 -1
- package/lib/es/typography/formatNumeral.js +6 -6
- package/lib/es/upload/constants.js +2 -2
- package/lib/es/upload/foundation.js +1 -1
- package/lib/es/upload/utils.js +4 -4
- package/lib/es/utils/getMotionObjFromProps.js +2 -2
- package/lib/es/utils/touchPolyfill.js +1 -1
- package/lib/es/utils/uuid.js +2 -2
- package/lib/es/utils/warning.js +1 -1
- package/package.json +2 -2
- package/tooltip/foundation.ts +6 -3
|
@@ -8,7 +8,7 @@ exports.strings = exports.cssClasses = void 0;
|
|
|
8
8
|
var _constants = require("../base/constants");
|
|
9
9
|
|
|
10
10
|
const cssClasses = {
|
|
11
|
-
PREFIX:
|
|
11
|
+
PREFIX: `${_constants.BASE_CLASS_PREFIX}-tagInput`
|
|
12
12
|
};
|
|
13
13
|
exports.cssClasses = cssClasses;
|
|
14
14
|
const strings = {
|
|
@@ -19,10 +19,10 @@ const HOUR = 1000 * 60 * 60;
|
|
|
19
19
|
const DAY = 24 * HOUR; // TODO: move to utils
|
|
20
20
|
|
|
21
21
|
const formatOption = (option, disabledOptions) => {
|
|
22
|
-
let value =
|
|
22
|
+
let value = `${option}`;
|
|
23
23
|
|
|
24
24
|
if (option < 10) {
|
|
25
|
-
value =
|
|
25
|
+
value = `0${option}`;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
let disabled = false;
|
|
@@ -14,9 +14,9 @@ const TYPE_TIME_RANGE_PICKER = 'timeRange';
|
|
|
14
14
|
const DEFAULT_RANGE_SEPARATOR = ' ~ ';
|
|
15
15
|
const DEFAULT_MULTIPLE_SEPARATOR = ',';
|
|
16
16
|
const cssClasses = {
|
|
17
|
-
PREFIX:
|
|
18
|
-
RANGE_PICKER:
|
|
19
|
-
RANGE_PANEL_LISTS:
|
|
17
|
+
PREFIX: `${_constants.BASE_CLASS_PREFIX}-timepicker`,
|
|
18
|
+
RANGE_PICKER: `${_constants.BASE_CLASS_PREFIX}-timepicker-range-panel`,
|
|
19
|
+
RANGE_PANEL_LISTS: `${_constants.BASE_CLASS_PREFIX}-timepicker-lists`
|
|
20
20
|
};
|
|
21
21
|
exports.cssClasses = cssClasses;
|
|
22
22
|
const strings = {
|
|
@@ -152,14 +152,14 @@ const isTimeFormatLike = (time, formatToken) => {
|
|
|
152
152
|
let isLike = true;
|
|
153
153
|
const dateFnsSupportFormatCh = 'BDEGHKLMOPQRSTXYabcehimopqstuwxyz'; // dateFns support format character
|
|
154
154
|
|
|
155
|
-
const formatSupportChReg = new RegExp(
|
|
156
|
-
const formatNotSupportChReg = new RegExp(
|
|
155
|
+
const formatSupportChReg = new RegExp(`[${dateFnsSupportFormatCh}]`, 'g');
|
|
156
|
+
const formatNotSupportChReg = new RegExp(`[^${dateFnsSupportFormatCh}]`, 'g');
|
|
157
157
|
const hmsReg = /[H|m|s]{1,2}/;
|
|
158
158
|
const formatSplitted = formatToken.split(formatNotSupportChReg); // => ['HH', 'mm'];
|
|
159
159
|
|
|
160
160
|
const timeSeparator = formatToken.replace(formatSupportChReg, ''); // => :
|
|
161
161
|
|
|
162
|
-
const timeReg = new RegExp(
|
|
162
|
+
const timeReg = new RegExp(`[${timeSeparator}]`, 'g'); // => /[:]/g
|
|
163
163
|
|
|
164
164
|
const timeSplitted = time.split(timeReg); // => ['12', '0]
|
|
165
165
|
|
|
@@ -8,8 +8,8 @@ exports.strings = exports.cssClasses = void 0;
|
|
|
8
8
|
var _constants = require("../base/constants");
|
|
9
9
|
|
|
10
10
|
const cssClasses = {
|
|
11
|
-
PREFIX:
|
|
12
|
-
ITEM:
|
|
11
|
+
PREFIX: `${_constants.BASE_CLASS_PREFIX}-timeline`,
|
|
12
|
+
ITEM: `${_constants.BASE_CLASS_PREFIX}-timeline-item`
|
|
13
13
|
};
|
|
14
14
|
exports.cssClasses = cssClasses;
|
|
15
15
|
const strings = {
|
|
@@ -7,11 +7,11 @@ exports.strings = exports.numbers = exports.cssClasses = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _constants = require("../base/constants");
|
|
9
9
|
|
|
10
|
-
const PREFIX =
|
|
10
|
+
const PREFIX = `${_constants.BASE_CLASS_PREFIX}-toast`;
|
|
11
11
|
const cssClasses = {
|
|
12
12
|
PREFIX,
|
|
13
|
-
WRAPPER:
|
|
14
|
-
LIST:
|
|
13
|
+
WRAPPER: `${PREFIX}-wrapper`,
|
|
14
|
+
LIST: `${PREFIX}-list`
|
|
15
15
|
};
|
|
16
16
|
exports.cssClasses = cssClasses;
|
|
17
17
|
const strings = {
|
|
@@ -8,7 +8,7 @@ exports.strings = exports.numbers = exports.cssClasses = void 0;
|
|
|
8
8
|
var _constants = require("../base/constants");
|
|
9
9
|
|
|
10
10
|
const cssClasses = {
|
|
11
|
-
PREFIX:
|
|
11
|
+
PREFIX: `${_constants.BASE_CLASS_PREFIX}-tooltip`
|
|
12
12
|
};
|
|
13
13
|
exports.cssClasses = cssClasses;
|
|
14
14
|
const strings = {
|
|
@@ -494,23 +494,23 @@ class Tooltip extends _foundation.default {
|
|
|
494
494
|
if (position && triggerRect && translateX != null && translateY != null) {
|
|
495
495
|
if (this.getProp('transformFromCenter')) {
|
|
496
496
|
if (['topLeft', 'bottomLeft'].includes(position)) {
|
|
497
|
-
return
|
|
497
|
+
return `${this._roundPixel(triggerRect.width / 2)}px ${-translateY * 100}%`;
|
|
498
498
|
}
|
|
499
499
|
|
|
500
500
|
if (['topRight', 'bottomRight'].includes(position)) {
|
|
501
|
-
return
|
|
501
|
+
return `calc(100% - ${this._roundPixel(triggerRect.width / 2)}px) ${-translateY * 100}%`;
|
|
502
502
|
}
|
|
503
503
|
|
|
504
504
|
if (['leftTop', 'rightTop'].includes(position)) {
|
|
505
|
-
return
|
|
505
|
+
return `${-translateX * 100}% ${this._roundPixel(triggerRect.height / 2)}px`;
|
|
506
506
|
}
|
|
507
507
|
|
|
508
508
|
if (['leftBottom', 'rightBottom'].includes(position)) {
|
|
509
|
-
return
|
|
509
|
+
return `${-translateX * 100}% calc(100% - ${this._roundPixel(triggerRect.height / 2)}px)`;
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
512
|
|
|
513
|
-
return
|
|
513
|
+
return `${-translateX * 100}% ${-translateY * 100}%`;
|
|
514
514
|
}
|
|
515
515
|
|
|
516
516
|
return null;
|
|
@@ -521,6 +521,9 @@ class Tooltip extends _foundation.default {
|
|
|
521
521
|
spacing,
|
|
522
522
|
isOverFlow
|
|
523
523
|
} = props;
|
|
524
|
+
const {
|
|
525
|
+
innerWidth
|
|
526
|
+
} = window;
|
|
524
527
|
const triggerRect = ((0, _isEmpty2.default)(props.triggerRect) ? props.triggerRect : this._adapter.getTriggerBounding()) || Object.assign({}, defaultRect);
|
|
525
528
|
const containerRect = ((0, _isEmpty2.default)(props.containerRect) ? props.containerRect : this._adapter.getPopupContainerRect()) || Object.assign({}, defaultRect);
|
|
526
529
|
const wrapperRect = ((0, _isEmpty2.default)(props.wrapperRect) ? props.wrapperRect : this._adapter.getWrapperBounding()) || Object.assign({}, defaultRect); // eslint-disable-next-line
|
|
@@ -559,6 +562,7 @@ class Tooltip extends _foundation.default {
|
|
|
559
562
|
const isWidthOverFlow = isOverFlow && isOverFlow[1];
|
|
560
563
|
const isTriggerNearLeft = middleX - containerRect.left < containerRect.right - middleX;
|
|
561
564
|
const isTriggerNearTop = middleY - containerRect.top < containerRect.bottom - middleY;
|
|
565
|
+
const isWrapperWidthOverflow = wrapperRect.width > innerWidth;
|
|
562
566
|
|
|
563
567
|
switch (position) {
|
|
564
568
|
case 'top':
|
|
@@ -573,7 +577,7 @@ class Tooltip extends _foundation.default {
|
|
|
573
577
|
case 'topLeft':
|
|
574
578
|
// left = pointAtCenter ? middleX - offsetXWithArrow : triggerRect.left;
|
|
575
579
|
// top = triggerRect.top - SPACING;
|
|
576
|
-
left = isWidthOverFlow ? containerRect.left : pointAtCenter ? middleX - offsetXWithArrow : triggerRect.left;
|
|
580
|
+
left = isWidthOverFlow ? isWrapperWidthOverflow ? containerRect.left : containerRect.right - wrapperRect.width : pointAtCenter ? middleX - offsetXWithArrow : triggerRect.left;
|
|
577
581
|
top = isHeightOverFlow ? containerRect.bottom + offsetHeight : triggerRect.top - SPACING;
|
|
578
582
|
translateY = -1;
|
|
579
583
|
break;
|
|
@@ -625,7 +629,7 @@ class Tooltip extends _foundation.default {
|
|
|
625
629
|
case 'bottomLeft':
|
|
626
630
|
// left = pointAtCenter ? middleX - offsetXWithArrow : triggerRect.left;
|
|
627
631
|
// top = triggerRect.bottom + SPACING;
|
|
628
|
-
left = isWidthOverFlow ? containerRect.left : pointAtCenter ? middleX - offsetXWithArrow : triggerRect.left;
|
|
632
|
+
left = isWidthOverFlow ? isWrapperWidthOverflow ? containerRect.left : containerRect.right - wrapperRect.width : pointAtCenter ? middleX - offsetXWithArrow : triggerRect.left;
|
|
629
633
|
top = isHeightOverFlow ? containerRect.top + offsetYWithArrow - SPACING : triggerRect.top + triggerRect.height + SPACING;
|
|
630
634
|
break;
|
|
631
635
|
|
|
@@ -733,7 +737,7 @@ class Tooltip extends _foundation.default {
|
|
|
733
737
|
let transform = ''; // eslint-disable-next-line
|
|
734
738
|
|
|
735
739
|
if (translateX != null) {
|
|
736
|
-
transform +=
|
|
740
|
+
transform += `translateX(${translateX * 100}%) `;
|
|
737
741
|
Object.defineProperty(style, 'translateX', {
|
|
738
742
|
enumerable: false,
|
|
739
743
|
value: translateX
|
|
@@ -742,7 +746,7 @@ class Tooltip extends _foundation.default {
|
|
|
742
746
|
|
|
743
747
|
|
|
744
748
|
if (translateY != null) {
|
|
745
|
-
transform +=
|
|
749
|
+
transform += `translateY(${translateY * 100}%) `;
|
|
746
750
|
Object.defineProperty(style, 'translateY', {
|
|
747
751
|
enumerable: false,
|
|
748
752
|
value: translateY
|
|
@@ -8,7 +8,7 @@ exports.strings = exports.numbers = exports.cssClasses = void 0;
|
|
|
8
8
|
var _constants = require("../base/constants");
|
|
9
9
|
|
|
10
10
|
const cssClasses = {
|
|
11
|
-
PREFIX:
|
|
11
|
+
PREFIX: `${_constants.BASE_CLASS_PREFIX}-transfer`
|
|
12
12
|
};
|
|
13
13
|
exports.cssClasses = cssClasses;
|
|
14
14
|
const strings = {
|
|
@@ -8,8 +8,8 @@ exports.strings = exports.numbers = exports.cssClasses = void 0;
|
|
|
8
8
|
var _constants = require("../base/constants");
|
|
9
9
|
|
|
10
10
|
const cssClasses = {
|
|
11
|
-
PREFIX:
|
|
12
|
-
PREFIX_OPTION:
|
|
11
|
+
PREFIX: `${_constants.BASE_CLASS_PREFIX}-tree`,
|
|
12
|
+
PREFIX_OPTION: `${_constants.BASE_CLASS_PREFIX}-tree-option`
|
|
13
13
|
};
|
|
14
14
|
exports.cssClasses = cssClasses;
|
|
15
15
|
const strings = {
|
package/lib/cjs/tree/treeUtil.js
CHANGED
|
@@ -55,7 +55,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
55
55
|
const DRAG_OFFSET = 0.45;
|
|
56
56
|
|
|
57
57
|
function getPosition(level, index) {
|
|
58
|
-
return
|
|
58
|
+
return `${level}-${index}`;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
function isValid(val) {
|
|
@@ -8,9 +8,9 @@ exports.strings = exports.numbers = exports.cssClasses = void 0;
|
|
|
8
8
|
var _constants = require("../base/constants");
|
|
9
9
|
|
|
10
10
|
const cssClasses = {
|
|
11
|
-
PREFIX:
|
|
12
|
-
PREFIX_TREE:
|
|
13
|
-
PREFIX_OPTION:
|
|
11
|
+
PREFIX: `${_constants.BASE_CLASS_PREFIX}-tree-select`,
|
|
12
|
+
PREFIX_TREE: `${_constants.BASE_CLASS_PREFIX}-tree`,
|
|
13
|
+
PREFIX_OPTION: `${_constants.BASE_CLASS_PREFIX}-tree-select-option`
|
|
14
14
|
};
|
|
15
15
|
exports.cssClasses = cssClasses;
|
|
16
16
|
const strings = {
|
|
@@ -8,7 +8,7 @@ exports.strings = exports.cssClasses = void 0;
|
|
|
8
8
|
var _constants = require("../base/constants");
|
|
9
9
|
|
|
10
10
|
const cssClasses = {
|
|
11
|
-
PREFIX:
|
|
11
|
+
PREFIX: `${_constants.BASE_CLASS_PREFIX}-typography`
|
|
12
12
|
};
|
|
13
13
|
exports.cssClasses = cssClasses;
|
|
14
14
|
const strings = {
|
|
@@ -18,7 +18,7 @@ class FormatNumeral {
|
|
|
18
18
|
i++;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
return
|
|
21
|
+
return `${this.truncatePrecision(value)} ${units[i]}`;
|
|
22
22
|
},
|
|
23
23
|
'bytes-binary': value => {
|
|
24
24
|
const units = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];
|
|
@@ -29,21 +29,21 @@ class FormatNumeral {
|
|
|
29
29
|
i++;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
return
|
|
32
|
+
return `${this.truncatePrecision(value)} ${units[i]}`;
|
|
33
33
|
},
|
|
34
34
|
percentages: value => {
|
|
35
35
|
const cArr = value.toString().split('.');
|
|
36
36
|
|
|
37
37
|
if (Number(cArr[0]) === 0) {
|
|
38
|
-
return
|
|
38
|
+
return `${this.truncatePrecision(value * 100)}%`;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
return
|
|
41
|
+
return `${this.truncatePrecision(value)}%`;
|
|
42
42
|
},
|
|
43
43
|
exponential: value => {
|
|
44
44
|
const vExponential = value.toExponential(this.precision + 2);
|
|
45
45
|
const vArr = vExponential.split('e');
|
|
46
|
-
return
|
|
46
|
+
return `${this.truncatePrecision(Number(vArr[0]))}e${vArr[1]}`;
|
|
47
47
|
}
|
|
48
48
|
}; // A collection of methods for truncating numbers; Methods key: Truncate (strings.Truncate);
|
|
49
49
|
|
|
@@ -93,7 +93,7 @@ class FormatNumeral {
|
|
|
93
93
|
const cTLength = cArr[1].length; // Fill in any missing `0` at the end.
|
|
94
94
|
|
|
95
95
|
if (cTLength < this.precision) {
|
|
96
|
-
return
|
|
96
|
+
return `${cArr[0]}.${cArr[1]}${'0'.repeat(this.precision - cTLength)}`;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
return cTruncated.toString();
|
|
@@ -7,14 +7,14 @@ exports.strings = exports.numbers = exports.cssClasses = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _constants = require("../base/constants");
|
|
9
9
|
|
|
10
|
-
const PREFIX =
|
|
10
|
+
const PREFIX = `${_constants.BASE_CLASS_PREFIX}-upload`;
|
|
11
11
|
const FILE_LIST_PIC = 'picture';
|
|
12
12
|
const FILE_LIST_DEFAULT = 'list';
|
|
13
13
|
const PROGRESS_COEFFICIENT = 0.95;
|
|
14
14
|
const cssClasses = {
|
|
15
15
|
PREFIX,
|
|
16
16
|
// WRAPPER: `${PREFIX}-wrapper`,
|
|
17
|
-
LIST:
|
|
17
|
+
LIST: `${PREFIX}-list`
|
|
18
18
|
};
|
|
19
19
|
exports.cssClasses = cssClasses;
|
|
20
20
|
const TRIGGER_AUTO = 'auto';
|
|
@@ -77,7 +77,7 @@ class UploadFoundation extends _foundation.default {
|
|
|
77
77
|
fileName
|
|
78
78
|
} = _ref;
|
|
79
79
|
const status = xhr ? xhr.status : 0;
|
|
80
|
-
const msg = message ||
|
|
80
|
+
const msg = message || `cannot post ${fileName} to ${action}, xhr status: ${status}'`;
|
|
81
81
|
const err = new Error(msg);
|
|
82
82
|
err.status = status;
|
|
83
83
|
err.method = 'post';
|
package/lib/cjs/upload/utils.js
CHANGED
|
@@ -48,11 +48,11 @@ exports.byteMB = byteMB;
|
|
|
48
48
|
|
|
49
49
|
function getFileSize(number) {
|
|
50
50
|
if (number < byteKB) {
|
|
51
|
-
return
|
|
51
|
+
return `${(number / byteKB).toFixed(2)}KB`;
|
|
52
52
|
} else if (number >= byteKB && number < byteMB) {
|
|
53
|
-
return
|
|
53
|
+
return `${(number / byteKB).toFixed(1)}KB`;
|
|
54
54
|
} else if (number >= byteMB) {
|
|
55
|
-
return
|
|
55
|
+
return `${(number / byteMB).toFixed(1)}MB`;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
return undefined;
|
|
@@ -125,7 +125,7 @@ function mapFileTree(items) {
|
|
|
125
125
|
|
|
126
126
|
for (let index = 0; index < entries.length; index++) {
|
|
127
127
|
const entry = entries[index];
|
|
128
|
-
yield _traverseFileTree(entry,
|
|
128
|
+
yield _traverseFileTree(entry, `${path}${item.name}/`);
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
});
|
|
@@ -28,7 +28,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
28
28
|
*/
|
|
29
29
|
function getMotionObjFromProps(props) {
|
|
30
30
|
if (typeof props !== 'object' || props === null) {
|
|
31
|
-
throw new TypeError(
|
|
31
|
+
throw new TypeError(`props should be object type, got ${typeof props}`);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
const MOTION_PROPS = ['willEnter', 'didEnter', 'willLeave', 'didLeave', 'onStart', 'onRest', 'state'];
|
|
@@ -52,7 +52,7 @@ function getMotionObjFromProps(props) {
|
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
} else {
|
|
55
|
-
(0, _warning.default)(true,
|
|
55
|
+
(0, _warning.default)(true, `[Semi] duplicate motion key '${key}' from motion prop and props`);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
} else if (typeof motionProp === 'function') {
|
|
@@ -30,7 +30,7 @@ const touchEventPolyfill = (touch, touchEvent) => {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
if (touch[key]) {
|
|
33
|
-
(0, _warning.default)(true, "
|
|
33
|
+
(0, _warning.default)(true, `"The key ${key}" exist in Touch.`);
|
|
34
34
|
} else {
|
|
35
35
|
touch[key] = value;
|
|
36
36
|
}
|
package/lib/cjs/utils/uuid.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.getUuidShort = getUuidShort;
|
|
|
8
8
|
exports.getUuidv4 = getUuidv4;
|
|
9
9
|
|
|
10
10
|
function getUuid(prefix) {
|
|
11
|
-
return
|
|
11
|
+
return `${prefix}-${new Date().getTime()}-${Math.random()}`;
|
|
12
12
|
} // https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript
|
|
13
13
|
|
|
14
14
|
|
|
@@ -49,5 +49,5 @@ function getUuidShort() {
|
|
|
49
49
|
randomId += characters.charAt(random);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
return prefix ?
|
|
52
|
+
return prefix ? `${prefix}-${randomId}` : randomId;
|
|
53
53
|
}
|
package/lib/cjs/utils/warning.js
CHANGED
|
@@ -43,12 +43,12 @@ export default class AnchorFoundation extends BaseFoundation {
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
this.setScrollHeight = () => {
|
|
46
|
-
const anchorWrapper =
|
|
46
|
+
const anchorWrapper = `.${prefixCls}-link-wrapper`;
|
|
47
47
|
|
|
48
48
|
const anchorNode = this._adapter.getAnchorNode(anchorWrapper);
|
|
49
49
|
|
|
50
50
|
if (anchorNode) {
|
|
51
|
-
const scrollHeight =
|
|
51
|
+
const scrollHeight = `${anchorNode.scrollHeight}px`;
|
|
52
52
|
|
|
53
53
|
this._adapter.setScrollHeight(scrollHeight);
|
|
54
54
|
}
|
|
@@ -233,7 +233,7 @@ export default class AnchorFoundation extends BaseFoundation {
|
|
|
233
233
|
};
|
|
234
234
|
|
|
235
235
|
this._setActiveSlide = () => {
|
|
236
|
-
const activeClass =
|
|
236
|
+
const activeClass = `.${cssClasses.PREFIX}-link-title-active`;
|
|
237
237
|
|
|
238
238
|
const linkNode = this._adapter.getAnchorNode(activeClass);
|
|
239
239
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { strings as tooltipStrings } from '../tooltip/constants';
|
|
2
2
|
import { BASE_CLASS_PREFIX, VALIDATE_STATUS } from '../base/constants';
|
|
3
3
|
const cssClasses = {
|
|
4
|
-
PREFIX:
|
|
5
|
-
PREFIX_OPTION:
|
|
6
|
-
PREFIX_GROUP:
|
|
4
|
+
PREFIX: `${BASE_CLASS_PREFIX}-autocomplete`,
|
|
5
|
+
PREFIX_OPTION: `${BASE_CLASS_PREFIX}-autoComplete-option`,
|
|
6
|
+
PREFIX_GROUP: `${BASE_CLASS_PREFIX}-autoComplete-group`
|
|
7
7
|
};
|
|
8
8
|
const strings = {
|
|
9
9
|
SIZE: ['small', 'large', 'default'],
|
package/lib/es/card/constants.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { BASE_CLASS_PREFIX } from '../base/constants';
|
|
2
2
|
const cssClasses = {
|
|
3
|
-
CAROUSEL:
|
|
4
|
-
CAROUSEL_INDICATOR:
|
|
5
|
-
CAROUSEL_INDICATOR_LINE:
|
|
6
|
-
CAROUSEL_INDICATOR_DOT:
|
|
7
|
-
CAROUSEL_INDICATOR_COLUMNAR:
|
|
8
|
-
CAROUSEL_INDICATOR_INACTIVE:
|
|
9
|
-
CAROUSEL_INDICATOR_ACTIVE:
|
|
10
|
-
CAROUSEL_CONTENT:
|
|
11
|
-
CAROUSEL_ARROW:
|
|
3
|
+
CAROUSEL: `${BASE_CLASS_PREFIX}-carousel`,
|
|
4
|
+
CAROUSEL_INDICATOR: `${BASE_CLASS_PREFIX}-carousel-indicator`,
|
|
5
|
+
CAROUSEL_INDICATOR_LINE: `${BASE_CLASS_PREFIX}-carousel-indicator-line`,
|
|
6
|
+
CAROUSEL_INDICATOR_DOT: `${BASE_CLASS_PREFIX}-carousel-indicator-dot`,
|
|
7
|
+
CAROUSEL_INDICATOR_COLUMNAR: `${BASE_CLASS_PREFIX}-carousel-indicator-columnar`,
|
|
8
|
+
CAROUSEL_INDICATOR_INACTIVE: `${BASE_CLASS_PREFIX}-carousel-indicator-inactive`,
|
|
9
|
+
CAROUSEL_INDICATOR_ACTIVE: `${BASE_CLASS_PREFIX}-carousel-indicator-active`,
|
|
10
|
+
CAROUSEL_CONTENT: `${BASE_CLASS_PREFIX}-carousel-content`,
|
|
11
|
+
CAROUSEL_ARROW: `${BASE_CLASS_PREFIX}-carousel-arrow`
|
|
12
12
|
};
|
|
13
13
|
const numbers = {
|
|
14
14
|
DEFAULT_ACTIVE_INDEX: 0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BASE_CLASS_PREFIX } from '../base/constants';
|
|
2
2
|
const cssClasses = {
|
|
3
|
-
PREFIX:
|
|
4
|
-
PREFIX_OPTION:
|
|
3
|
+
PREFIX: `${BASE_CLASS_PREFIX}-cascader`,
|
|
4
|
+
PREFIX_OPTION: `${BASE_CLASS_PREFIX}-cascader-option`
|
|
5
5
|
};
|
|
6
6
|
const strings = {
|
|
7
7
|
SIZE_SET: ['small', 'large', 'default'],
|
|
@@ -298,7 +298,7 @@ export default class CascaderFoundation extends BaseFoundation {
|
|
|
298
298
|
}
|
|
299
299
|
} else if (value && value.length) {
|
|
300
300
|
const val = valuePath[valuePath.length - 1];
|
|
301
|
-
const key =
|
|
301
|
+
const key = `not-exist-${val}`;
|
|
302
302
|
const optionNotExist = {
|
|
303
303
|
data: {
|
|
304
304
|
label: val,
|
package/lib/es/cascader/util.js
CHANGED
|
@@ -4,7 +4,7 @@ import _isNull from "lodash/isNull";
|
|
|
4
4
|
import { strings } from './constants';
|
|
5
5
|
|
|
6
6
|
function getPosition(level, index) {
|
|
7
|
-
return
|
|
7
|
+
return `${level}-${index}`;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export function isValid(val) {
|
|
@@ -27,7 +27,7 @@ function traverseDataNodes(treeNodes, callback) {
|
|
|
27
27
|
let item = null; // Process node if is not root
|
|
28
28
|
|
|
29
29
|
if (node) {
|
|
30
|
-
const key = parent ? getPosition(parent.key, ind) :
|
|
30
|
+
const key = parent ? getPosition(parent.key, ind) : `${ind}`;
|
|
31
31
|
item = {
|
|
32
32
|
data: Object.assign({}, node),
|
|
33
33
|
ind,
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { BASE_CLASS_PREFIX } from '../base/constants';
|
|
2
2
|
const checkboxClasses = {
|
|
3
|
-
PREFIX:
|
|
4
|
-
INNER:
|
|
5
|
-
TEXT:
|
|
6
|
-
INPUT:
|
|
7
|
-
CHECKED:
|
|
8
|
-
DISABLED:
|
|
9
|
-
BUTTON:
|
|
3
|
+
PREFIX: `${BASE_CLASS_PREFIX}-checkbox`,
|
|
4
|
+
INNER: `${BASE_CLASS_PREFIX}-checkbox-inner`,
|
|
5
|
+
TEXT: `${BASE_CLASS_PREFIX}-checkbox-text`,
|
|
6
|
+
INPUT: `${BASE_CLASS_PREFIX}-checkbox-input`,
|
|
7
|
+
CHECKED: `${BASE_CLASS_PREFIX}-checkbox-checked`,
|
|
8
|
+
DISABLED: `${BASE_CLASS_PREFIX}-checkbox-disabled`,
|
|
9
|
+
BUTTON: `${BASE_CLASS_PREFIX}-checkbox-button`,
|
|
10
10
|
WRAPPER: ''
|
|
11
11
|
};
|
|
12
12
|
const checkboxGroupClasses = {
|
|
13
|
-
PREFIX:
|
|
14
|
-
INNER:
|
|
15
|
-
TEXT:
|
|
16
|
-
INPUT:
|
|
17
|
-
CHECKED:
|
|
18
|
-
DISABLED:
|
|
13
|
+
PREFIX: `${BASE_CLASS_PREFIX}-checkboxGroup`,
|
|
14
|
+
INNER: `${BASE_CLASS_PREFIX}-checkboxGroup-inner`,
|
|
15
|
+
TEXT: `${BASE_CLASS_PREFIX}-checkboxGroup-text`,
|
|
16
|
+
INPUT: `${BASE_CLASS_PREFIX}-checkboxGroup-input`,
|
|
17
|
+
CHECKED: `${BASE_CLASS_PREFIX}-checkboxGroup-checked`,
|
|
18
|
+
DISABLED: `${BASE_CLASS_PREFIX}-checkboxGroup-disabled`
|
|
19
19
|
};
|
|
20
20
|
const strings = {
|
|
21
21
|
DIRECTION_SET: ['horizontal', 'vertical'],
|