@douyinfe/semi-foundation 2.30.0-alpha.0 → 2.30.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/datePicker/monthsGridFoundation.ts +9 -3
- 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.js +15 -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/popconfirm/popconfirmFoundation.d.ts +4 -0
- package/lib/cjs/popconfirm/popconfirmFoundation.js +21 -1
- 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/select/select.css +1 -0
- package/lib/cjs/select/select.scss +1 -0
- package/lib/cjs/select/variables.scss +1 -0
- 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/bacisSteps.scss +238 -286
- package/lib/cjs/steps/constants.js +2 -2
- package/lib/cjs/steps/fillSteps.scss +142 -148
- package/lib/cjs/steps/navSteps.scss +40 -60
- package/lib/cjs/steps/steps.css +14 -377
- 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/tag/tag.css +9 -2
- package/lib/cjs/tag/tag.scss +13 -4
- 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.d.ts +1 -1
- package/lib/cjs/tooltip/foundation.js +15 -12
- package/lib/cjs/transfer/constants.js +1 -1
- package/lib/cjs/tree/constants.js +2 -2
- package/lib/cjs/tree/treeUtil.d.ts +1 -1
- package/lib/cjs/tree/treeUtil.js +1 -1
- package/lib/cjs/treeSelect/constants.js +3 -3
- package/lib/cjs/treeSelect/foundation.d.ts +5 -2
- package/lib/cjs/treeSelect/foundation.js +42 -17
- package/lib/cjs/treeSelect/treeSelect.css +5 -1
- package/lib/cjs/treeSelect/treeSelect.scss +6 -0
- package/lib/cjs/treeSelect/variables.scss +1 -1
- package/lib/cjs/typography/constants.js +1 -1
- package/lib/cjs/typography/formatNumeral.js +6 -11
- package/lib/cjs/upload/constants.d.ts +1 -1
- 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.js +15 -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/popconfirm/popconfirmFoundation.d.ts +4 -0
- package/lib/es/popconfirm/popconfirmFoundation.js +20 -1
- 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/select/select.css +1 -0
- package/lib/es/select/select.scss +1 -0
- package/lib/es/select/variables.scss +1 -0
- 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/bacisSteps.scss +238 -286
- package/lib/es/steps/constants.js +2 -2
- package/lib/es/steps/fillSteps.scss +142 -148
- package/lib/es/steps/navSteps.scss +40 -60
- package/lib/es/steps/steps.css +14 -377
- 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/tag/tag.css +9 -2
- package/lib/es/tag/tag.scss +13 -4
- 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.d.ts +1 -1
- package/lib/es/tooltip/foundation.js +15 -12
- package/lib/es/transfer/constants.js +1 -1
- package/lib/es/tree/constants.js +2 -2
- package/lib/es/tree/treeUtil.d.ts +1 -1
- package/lib/es/tree/treeUtil.js +1 -1
- package/lib/es/treeSelect/constants.js +3 -3
- package/lib/es/treeSelect/foundation.d.ts +5 -2
- package/lib/es/treeSelect/foundation.js +42 -17
- package/lib/es/treeSelect/treeSelect.css +5 -1
- package/lib/es/treeSelect/treeSelect.scss +6 -0
- package/lib/es/treeSelect/variables.scss +1 -1
- package/lib/es/typography/constants.js +1 -1
- package/lib/es/typography/formatNumeral.js +6 -11
- package/lib/es/upload/constants.d.ts +1 -1
- 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 +3 -3
- package/popconfirm/popconfirmFoundation.ts +20 -1
- package/select/select.scss +1 -0
- package/select/variables.scss +1 -0
- package/steps/bacisSteps.scss +238 -286
- package/steps/fillSteps.scss +142 -148
- package/steps/navSteps.scss +40 -60
- package/tag/tag.scss +13 -4
- package/tooltip/foundation.ts +8 -5
- package/treeSelect/foundation.ts +39 -15
- package/treeSelect/treeSelect.scss +6 -0
- package/treeSelect/variables.scss +1 -1
- package/typography/formatNumeral.ts +2 -5
|
@@ -228,12 +228,13 @@ export default class MonthsGridFoundation extends BaseFoundation<MonthsGridAdapt
|
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
_initDatePickerFromValue(values: Date[], refreshPicker = true) {
|
|
231
|
-
const monthLeft = this.
|
|
231
|
+
const { monthLeft } = this._adapter.getStates();
|
|
232
232
|
const newMonthLeft = { ...monthLeft };
|
|
233
233
|
// REMOVE:
|
|
234
234
|
this._adapter.updateMonthOnLeft(newMonthLeft);
|
|
235
235
|
const newSelected = new Set<string>();
|
|
236
|
-
|
|
236
|
+
const isMultiple = this._isMultiple();
|
|
237
|
+
if (!isMultiple) {
|
|
237
238
|
values[0] && newSelected.add(format(values[0] as Date, strings.FORMAT_FULL_DATE));
|
|
238
239
|
} else {
|
|
239
240
|
values.forEach(date => {
|
|
@@ -241,7 +242,12 @@ export default class MonthsGridFoundation extends BaseFoundation<MonthsGridAdapt
|
|
|
241
242
|
});
|
|
242
243
|
}
|
|
243
244
|
if (refreshPicker) {
|
|
244
|
-
|
|
245
|
+
if (isMultiple) {
|
|
246
|
+
const leftPickerDateInSelected = values?.some(item => item && differenceInCalendarMonths(item, monthLeft.pickerDate) === 0);
|
|
247
|
+
!leftPickerDateInSelected && this.handleShowDateAndTime(strings.PANEL_TYPE_LEFT, values[0] || newMonthLeft.pickerDate);
|
|
248
|
+
} else {
|
|
249
|
+
this.handleShowDateAndTime(strings.PANEL_TYPE_LEFT, values[0] || newMonthLeft.pickerDate);
|
|
250
|
+
}
|
|
245
251
|
} else {
|
|
246
252
|
// FIXME:
|
|
247
253
|
this.handleShowDateAndTime(strings.PANEL_TYPE_LEFT, newMonthLeft.pickerDate);
|
|
@@ -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}-anchor`
|
|
12
12
|
};
|
|
13
13
|
exports.cssClasses = cssClasses;
|
|
14
14
|
const strings = {
|
|
@@ -58,12 +58,12 @@ class AnchorFoundation extends _foundation.default {
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
this.setScrollHeight = () => {
|
|
61
|
-
const anchorWrapper =
|
|
61
|
+
const anchorWrapper = `.${prefixCls}-link-wrapper`;
|
|
62
62
|
|
|
63
63
|
const anchorNode = this._adapter.getAnchorNode(anchorWrapper);
|
|
64
64
|
|
|
65
65
|
if (anchorNode) {
|
|
66
|
-
const scrollHeight =
|
|
66
|
+
const scrollHeight = `${anchorNode.scrollHeight}px`;
|
|
67
67
|
|
|
68
68
|
this._adapter.setScrollHeight(scrollHeight);
|
|
69
69
|
}
|
|
@@ -246,7 +246,7 @@ class AnchorFoundation extends _foundation.default {
|
|
|
246
246
|
};
|
|
247
247
|
|
|
248
248
|
this._setActiveSlide = () => {
|
|
249
|
-
const activeClass =
|
|
249
|
+
const activeClass = `.${_constants.cssClasses.PREFIX}-link-title-active`;
|
|
250
250
|
|
|
251
251
|
const linkNode = this._adapter.getAnchorNode(activeClass);
|
|
252
252
|
|
|
@@ -10,9 +10,9 @@ var _constants = require("../tooltip/constants");
|
|
|
10
10
|
var _constants2 = require("../base/constants");
|
|
11
11
|
|
|
12
12
|
const cssClasses = {
|
|
13
|
-
PREFIX:
|
|
14
|
-
PREFIX_OPTION:
|
|
15
|
-
PREFIX_GROUP:
|
|
13
|
+
PREFIX: `${_constants2.BASE_CLASS_PREFIX}-autocomplete`,
|
|
14
|
+
PREFIX_OPTION: `${_constants2.BASE_CLASS_PREFIX}-autoComplete-option`,
|
|
15
|
+
PREFIX_GROUP: `${_constants2.BASE_CLASS_PREFIX}-autoComplete-group`
|
|
16
16
|
};
|
|
17
17
|
exports.cssClasses = cssClasses;
|
|
18
18
|
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}-avatar`
|
|
12
12
|
};
|
|
13
13
|
exports.cssClasses = cssClasses;
|
|
14
14
|
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}-backtop`
|
|
12
12
|
};
|
|
13
13
|
exports.cssClasses = cssClasses;
|
|
14
14
|
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}-badge`
|
|
12
12
|
};
|
|
13
13
|
exports.cssClasses = cssClasses;
|
|
14
14
|
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}-banner`
|
|
12
12
|
};
|
|
13
13
|
exports.cssClasses = cssClasses;
|
|
14
14
|
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}-breadcrumb`
|
|
12
12
|
};
|
|
13
13
|
exports.cssClasses = cssClasses;
|
|
14
14
|
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}-button`
|
|
12
12
|
};
|
|
13
13
|
exports.cssClasses = cssClasses;
|
|
14
14
|
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}-calendar`
|
|
12
12
|
};
|
|
13
13
|
exports.cssClasses = cssClasses;
|
|
14
14
|
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}-card`
|
|
12
12
|
};
|
|
13
13
|
exports.cssClasses = cssClasses;
|
|
14
14
|
const strings = {
|
|
@@ -8,15 +8,15 @@ exports.strings = exports.numbers = exports.cssClasses = void 0;
|
|
|
8
8
|
var _constants = require("../base/constants");
|
|
9
9
|
|
|
10
10
|
const cssClasses = {
|
|
11
|
-
CAROUSEL:
|
|
12
|
-
CAROUSEL_INDICATOR:
|
|
13
|
-
CAROUSEL_INDICATOR_LINE:
|
|
14
|
-
CAROUSEL_INDICATOR_DOT:
|
|
15
|
-
CAROUSEL_INDICATOR_COLUMNAR:
|
|
16
|
-
CAROUSEL_INDICATOR_INACTIVE:
|
|
17
|
-
CAROUSEL_INDICATOR_ACTIVE:
|
|
18
|
-
CAROUSEL_CONTENT:
|
|
19
|
-
CAROUSEL_ARROW:
|
|
11
|
+
CAROUSEL: `${_constants.BASE_CLASS_PREFIX}-carousel`,
|
|
12
|
+
CAROUSEL_INDICATOR: `${_constants.BASE_CLASS_PREFIX}-carousel-indicator`,
|
|
13
|
+
CAROUSEL_INDICATOR_LINE: `${_constants.BASE_CLASS_PREFIX}-carousel-indicator-line`,
|
|
14
|
+
CAROUSEL_INDICATOR_DOT: `${_constants.BASE_CLASS_PREFIX}-carousel-indicator-dot`,
|
|
15
|
+
CAROUSEL_INDICATOR_COLUMNAR: `${_constants.BASE_CLASS_PREFIX}-carousel-indicator-columnar`,
|
|
16
|
+
CAROUSEL_INDICATOR_INACTIVE: `${_constants.BASE_CLASS_PREFIX}-carousel-indicator-inactive`,
|
|
17
|
+
CAROUSEL_INDICATOR_ACTIVE: `${_constants.BASE_CLASS_PREFIX}-carousel-indicator-active`,
|
|
18
|
+
CAROUSEL_CONTENT: `${_constants.BASE_CLASS_PREFIX}-carousel-content`,
|
|
19
|
+
CAROUSEL_ARROW: `${_constants.BASE_CLASS_PREFIX}-carousel-arrow`
|
|
20
20
|
};
|
|
21
21
|
exports.cssClasses = cssClasses;
|
|
22
22
|
const numbers = {
|
|
@@ -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}-cascader`,
|
|
12
|
+
PREFIX_OPTION: `${_constants.BASE_CLASS_PREFIX}-cascader-option`
|
|
13
13
|
};
|
|
14
14
|
exports.cssClasses = cssClasses;
|
|
15
15
|
const strings = {
|
|
@@ -323,7 +323,7 @@ class CascaderFoundation extends _foundation.default {
|
|
|
323
323
|
}
|
|
324
324
|
} else if (value && value.length) {
|
|
325
325
|
const val = valuePath[valuePath.length - 1];
|
|
326
|
-
const key =
|
|
326
|
+
const key = `not-exist-${val}`;
|
|
327
327
|
const optionNotExist = {
|
|
328
328
|
data: {
|
|
329
329
|
label: val,
|
package/lib/cjs/cascader/util.js
CHANGED
|
@@ -20,7 +20,7 @@ var _constants = require("./constants");
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
|
|
22
22
|
function getPosition(level, index) {
|
|
23
|
-
return
|
|
23
|
+
return `${level}-${index}`;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
function isValid(val) {
|
|
@@ -45,7 +45,7 @@ function traverseDataNodes(treeNodes, callback) {
|
|
|
45
45
|
let item = null; // Process node if is not root
|
|
46
46
|
|
|
47
47
|
if (node) {
|
|
48
|
-
const key = parent ? getPosition(parent.key, ind) :
|
|
48
|
+
const key = parent ? getPosition(parent.key, ind) : `${ind}`;
|
|
49
49
|
item = {
|
|
50
50
|
data: Object.assign({}, node),
|
|
51
51
|
ind,
|
|
@@ -8,23 +8,23 @@ exports.strings = exports.numbers = exports.checkboxGroupClasses = exports.check
|
|
|
8
8
|
var _constants = require("../base/constants");
|
|
9
9
|
|
|
10
10
|
const checkboxClasses = {
|
|
11
|
-
PREFIX:
|
|
12
|
-
INNER:
|
|
13
|
-
TEXT:
|
|
14
|
-
INPUT:
|
|
15
|
-
CHECKED:
|
|
16
|
-
DISABLED:
|
|
17
|
-
BUTTON:
|
|
11
|
+
PREFIX: `${_constants.BASE_CLASS_PREFIX}-checkbox`,
|
|
12
|
+
INNER: `${_constants.BASE_CLASS_PREFIX}-checkbox-inner`,
|
|
13
|
+
TEXT: `${_constants.BASE_CLASS_PREFIX}-checkbox-text`,
|
|
14
|
+
INPUT: `${_constants.BASE_CLASS_PREFIX}-checkbox-input`,
|
|
15
|
+
CHECKED: `${_constants.BASE_CLASS_PREFIX}-checkbox-checked`,
|
|
16
|
+
DISABLED: `${_constants.BASE_CLASS_PREFIX}-checkbox-disabled`,
|
|
17
|
+
BUTTON: `${_constants.BASE_CLASS_PREFIX}-checkbox-button`,
|
|
18
18
|
WRAPPER: ''
|
|
19
19
|
};
|
|
20
20
|
exports.checkboxClasses = checkboxClasses;
|
|
21
21
|
const checkboxGroupClasses = {
|
|
22
|
-
PREFIX:
|
|
23
|
-
INNER:
|
|
24
|
-
TEXT:
|
|
25
|
-
INPUT:
|
|
26
|
-
CHECKED:
|
|
27
|
-
DISABLED:
|
|
22
|
+
PREFIX: `${_constants.BASE_CLASS_PREFIX}-checkboxGroup`,
|
|
23
|
+
INNER: `${_constants.BASE_CLASS_PREFIX}-checkboxGroup-inner`,
|
|
24
|
+
TEXT: `${_constants.BASE_CLASS_PREFIX}-checkboxGroup-text`,
|
|
25
|
+
INPUT: `${_constants.BASE_CLASS_PREFIX}-checkboxGroup-input`,
|
|
26
|
+
CHECKED: `${_constants.BASE_CLASS_PREFIX}-checkboxGroup-checked`,
|
|
27
|
+
DISABLED: `${_constants.BASE_CLASS_PREFIX}-checkboxGroup-disabled`
|
|
28
28
|
};
|
|
29
29
|
exports.checkboxGroupClasses = checkboxGroupClasses;
|
|
30
30
|
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}-collapse`
|
|
12
12
|
};
|
|
13
13
|
exports.cssClasses = cssClasses;
|
|
14
14
|
const strings = {
|
|
@@ -8,6 +8,6 @@ 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}-collapsible`
|
|
12
12
|
};
|
|
13
13
|
exports.cssClasses = cssClasses;
|
|
@@ -36,7 +36,7 @@ function getInsetInputFormatToken(options) {
|
|
|
36
36
|
case 'dateTime':
|
|
37
37
|
case 'dateTimeRange':
|
|
38
38
|
const dateTimeResult = dateTimeReg.exec(format);
|
|
39
|
-
insetInputFormat = dateTimeResult && dateTimeResult[1] && dateTimeResult[2] ?
|
|
39
|
+
insetInputFormat = dateTimeResult && dateTimeResult[1] && dateTimeResult[2] ? `${dateTimeResult[1]} ${dateTimeResult[2]}` : defaultToken;
|
|
40
40
|
break;
|
|
41
41
|
|
|
42
42
|
case 'date':
|
|
@@ -17,9 +17,9 @@ function formatFullDate() {
|
|
|
17
17
|
let month = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
18
18
|
let day = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
19
19
|
let dateStr = '';
|
|
20
|
-
const monthFull = typeof month === 'number' && month < 10 ?
|
|
21
|
-
const dayNumberFull = typeof day === 'number' && day < 10 ?
|
|
22
|
-
dateStr =
|
|
20
|
+
const monthFull = typeof month === 'number' && month < 10 ? `0${month}` : month.toString();
|
|
21
|
+
const dayNumberFull = typeof day === 'number' && day < 10 ? `0${day}` : day.toString();
|
|
22
|
+
dateStr = `${String(year)}-${monthFull}-${dayNumberFull}`;
|
|
23
23
|
return dateStr;
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -53,7 +53,7 @@ function getWeeks(date) {
|
|
|
53
53
|
|
|
54
54
|
for (let d = 0; d < daysInMonth; d++) {
|
|
55
55
|
const dayNumber = d + 1;
|
|
56
|
-
const dayNumberFull = dayNumber < 10 ?
|
|
56
|
+
const dayNumberFull = dayNumber < 10 ? `0${dayNumber}` : dayNumber.toString();
|
|
57
57
|
const fullDate = formatFullDate(year, month, dayNumber);
|
|
58
58
|
week.push({
|
|
59
59
|
dayNumber,
|
|
@@ -10,35 +10,35 @@ var _constants = require("../base/constants");
|
|
|
10
10
|
var _constants2 = require("../popover/constants");
|
|
11
11
|
|
|
12
12
|
const dayItemClasses = {
|
|
13
|
-
DAY_TODAY:
|
|
14
|
-
DAY_IN_RANGE:
|
|
15
|
-
DAY_HOVER:
|
|
16
|
-
DAY_SELECTED:
|
|
17
|
-
DAY_SELECTED_START:
|
|
18
|
-
DAY_SELECTED_END:
|
|
19
|
-
DAY_DISABLED:
|
|
20
|
-
DAY_HOVER_DAY:
|
|
21
|
-
DAY_HOVER_DAY_OFFSET:
|
|
22
|
-
DAY_IN_OFFSET_RANGE:
|
|
23
|
-
DAY_SELECTED_RANGE_HOVER:
|
|
24
|
-
DAY_OFFSET_RANGE_START:
|
|
25
|
-
DAY_OFFSET_RANGE_END:
|
|
26
|
-
DAY_SELECTED_START_AFTER_HOVER:
|
|
27
|
-
DAY_SELECTED_END_BEFORE_HOVER:
|
|
28
|
-
DAY_HOVER_DAY_BEFORE_RANGE:
|
|
29
|
-
DAY_HOVER_DAY_AFTER_RANGE:
|
|
30
|
-
DAY_HOVER_DAY_IN_RANGE:
|
|
31
|
-
DAY_HOVER_DAY_AROUND_SINGLE_SELECTED:
|
|
13
|
+
DAY_TODAY: `${_constants.BASE_CLASS_PREFIX}-datepicker-day-today`,
|
|
14
|
+
DAY_IN_RANGE: `${_constants.BASE_CLASS_PREFIX}-datepicker-day-inrange`,
|
|
15
|
+
DAY_HOVER: `${_constants.BASE_CLASS_PREFIX}-datepicker-day-inhover`,
|
|
16
|
+
DAY_SELECTED: `${_constants.BASE_CLASS_PREFIX}-datepicker-day-selected`,
|
|
17
|
+
DAY_SELECTED_START: `${_constants.BASE_CLASS_PREFIX}-datepicker-day-selected-start`,
|
|
18
|
+
DAY_SELECTED_END: `${_constants.BASE_CLASS_PREFIX}-datepicker-day-selected-end`,
|
|
19
|
+
DAY_DISABLED: `${_constants.BASE_CLASS_PREFIX}-datepicker-day-disabled`,
|
|
20
|
+
DAY_HOVER_DAY: `${_constants.BASE_CLASS_PREFIX}-datepicker-day-hoverday`,
|
|
21
|
+
DAY_HOVER_DAY_OFFSET: `${_constants.BASE_CLASS_PREFIX}-datepicker-day-hoverday-offset`,
|
|
22
|
+
DAY_IN_OFFSET_RANGE: `${_constants.BASE_CLASS_PREFIX}-datepicker-day-inoffsetrange`,
|
|
23
|
+
DAY_SELECTED_RANGE_HOVER: `${_constants.BASE_CLASS_PREFIX}-datepicker-day-selectedrange-hover`,
|
|
24
|
+
DAY_OFFSET_RANGE_START: `${_constants.BASE_CLASS_PREFIX}-datepicker-day-offsetrange-start`,
|
|
25
|
+
DAY_OFFSET_RANGE_END: `${_constants.BASE_CLASS_PREFIX}-datepicker-day-offsetrange-end`,
|
|
26
|
+
DAY_SELECTED_START_AFTER_HOVER: `${_constants.BASE_CLASS_PREFIX}-datepicker-day-selected-start-afterhover`,
|
|
27
|
+
DAY_SELECTED_END_BEFORE_HOVER: `${_constants.BASE_CLASS_PREFIX}-datepicker-day-selected-end-beforehover`,
|
|
28
|
+
DAY_HOVER_DAY_BEFORE_RANGE: `${_constants.BASE_CLASS_PREFIX}-datepicker-day-hoverday-beforerange`,
|
|
29
|
+
DAY_HOVER_DAY_AFTER_RANGE: `${_constants.BASE_CLASS_PREFIX}-datepicker-day-hoverday-afterrange`,
|
|
30
|
+
DAY_HOVER_DAY_IN_RANGE: `${_constants.BASE_CLASS_PREFIX}-datepicker-day-hoverday-inrange`,
|
|
31
|
+
DAY_HOVER_DAY_AROUND_SINGLE_SELECTED: `${_constants.BASE_CLASS_PREFIX}-datepicker-day-hoverday-around-singleselected`
|
|
32
32
|
};
|
|
33
33
|
const cssClasses = Object.assign({
|
|
34
|
-
PREFIX:
|
|
35
|
-
NAVIGATION:
|
|
36
|
-
PANEL_YAM:
|
|
37
|
-
MONTH:
|
|
38
|
-
WEEKDAY:
|
|
39
|
-
WEEKS:
|
|
40
|
-
WEEK:
|
|
41
|
-
DAY:
|
|
34
|
+
PREFIX: `${_constants.BASE_CLASS_PREFIX}-datepicker`,
|
|
35
|
+
NAVIGATION: `${_constants.BASE_CLASS_PREFIX}-datepicker-navigation`,
|
|
36
|
+
PANEL_YAM: `${_constants.BASE_CLASS_PREFIX}-datepicker-panel-yam`,
|
|
37
|
+
MONTH: `${_constants.BASE_CLASS_PREFIX}-datepicker-month`,
|
|
38
|
+
WEEKDAY: `${_constants.BASE_CLASS_PREFIX}-datepicker-weekday`,
|
|
39
|
+
WEEKS: `${_constants.BASE_CLASS_PREFIX}-datepicker-weeks`,
|
|
40
|
+
WEEK: `${_constants.BASE_CLASS_PREFIX}-datepicker-week`,
|
|
41
|
+
DAY: `${_constants.BASE_CLASS_PREFIX}-datepicker-day`
|
|
42
42
|
}, dayItemClasses);
|
|
43
43
|
exports.cssClasses = cssClasses;
|
|
44
44
|
const formatToken = {
|
|
@@ -844,12 +844,12 @@ class DatePickerFoundation extends _foundation.default {
|
|
|
844
844
|
const endIsTruthy = !(0, _isNullOrUndefined.default)(dates[1]);
|
|
845
845
|
|
|
846
846
|
if (startIsTruthy && endIsTruthy) {
|
|
847
|
-
str =
|
|
847
|
+
str = `${this.localeFormat(dates[0], formatToken)}${rangeSeparator}${this.localeFormat(dates[1], formatToken)}`;
|
|
848
848
|
} else {
|
|
849
849
|
if (startIsTruthy) {
|
|
850
|
-
str =
|
|
850
|
+
str = `${this.localeFormat(dates[0], formatToken)}${rangeSeparator}`;
|
|
851
851
|
} else if (endIsTruthy) {
|
|
852
|
-
str =
|
|
852
|
+
str = `${rangeSeparator}${this.localeFormat(dates[1], formatToken)}`;
|
|
853
853
|
}
|
|
854
854
|
}
|
|
855
855
|
|
|
@@ -321,7 +321,7 @@ class InputFoundation extends _foundation.default {
|
|
|
321
321
|
date,
|
|
322
322
|
time
|
|
323
323
|
} = _ref2;
|
|
324
|
-
return
|
|
324
|
+
return `${date} ${time}`;
|
|
325
325
|
}
|
|
326
326
|
|
|
327
327
|
concatInsetDateRange(_ref3) {
|
|
@@ -334,7 +334,7 @@ class InputFoundation extends _foundation.default {
|
|
|
334
334
|
rangeSeparator
|
|
335
335
|
} = this._adapter.getProps();
|
|
336
336
|
|
|
337
|
-
return
|
|
337
|
+
return `${rangeStart}${rangeSeparator}${rangeEnd}`;
|
|
338
338
|
}
|
|
339
339
|
|
|
340
340
|
concatInsetInputValue(_ref4) {
|
|
@@ -154,14 +154,20 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
154
154
|
|
|
155
155
|
_initDatePickerFromValue(values) {
|
|
156
156
|
let refreshPicker = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
157
|
-
|
|
157
|
+
|
|
158
|
+
const {
|
|
159
|
+
monthLeft
|
|
160
|
+
} = this._adapter.getStates();
|
|
161
|
+
|
|
158
162
|
const newMonthLeft = Object.assign({}, monthLeft); // REMOVE:
|
|
159
163
|
|
|
160
164
|
this._adapter.updateMonthOnLeft(newMonthLeft);
|
|
161
165
|
|
|
162
166
|
const newSelected = new Set();
|
|
163
167
|
|
|
164
|
-
|
|
168
|
+
const isMultiple = this._isMultiple();
|
|
169
|
+
|
|
170
|
+
if (!isMultiple) {
|
|
165
171
|
values[0] && newSelected.add((0, _dateFns.format)(values[0], _constants.strings.FORMAT_FULL_DATE));
|
|
166
172
|
} else {
|
|
167
173
|
values.forEach(date => {
|
|
@@ -170,7 +176,12 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
170
176
|
}
|
|
171
177
|
|
|
172
178
|
if (refreshPicker) {
|
|
173
|
-
|
|
179
|
+
if (isMultiple) {
|
|
180
|
+
const leftPickerDateInSelected = values === null || values === void 0 ? void 0 : values.some(item => item && (0, _dateFns.differenceInCalendarMonths)(item, monthLeft.pickerDate) === 0);
|
|
181
|
+
!leftPickerDateInSelected && this.handleShowDateAndTime(_constants.strings.PANEL_TYPE_LEFT, values[0] || newMonthLeft.pickerDate);
|
|
182
|
+
} else {
|
|
183
|
+
this.handleShowDateAndTime(_constants.strings.PANEL_TYPE_LEFT, values[0] || newMonthLeft.pickerDate);
|
|
184
|
+
}
|
|
174
185
|
} else {
|
|
175
186
|
// FIXME:
|
|
176
187
|
this.handleShowDateAndTime(_constants.strings.PANEL_TYPE_LEFT, newMonthLeft.pickerDate);
|
|
@@ -721,7 +732,7 @@ class MonthsGridFoundation extends _foundation.default {
|
|
|
721
732
|
const dateStr = (0, _dateFns.format)((0, _index.isValidDate)(date) ? date : (0, _parser.compatibleParse)(date, _constants.strings.FORMAT_FULL_DATE, undefined, dateFnsLocale), _constants.strings.FORMAT_FULL_DATE);
|
|
722
733
|
const timeStr = (0, _dateFns.format)((0, _index.isValidDate)(time) ? time : (0, _parser.compatibleParse)(time, _constants.strings.FORMAT_TIME_PICKER, undefined, dateFnsLocale), _constants.strings.FORMAT_TIME_PICKER);
|
|
723
734
|
const timeFormat = this.getValidTimeFormat();
|
|
724
|
-
return (0, _parser.compatibleParse)(
|
|
735
|
+
return (0, _parser.compatibleParse)(`${dateStr} ${timeStr}`, timeFormat, undefined, dateFnsLocale);
|
|
725
736
|
}
|
|
726
737
|
|
|
727
738
|
handleRangeSelected(day) {
|
|
@@ -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}-descriptions`
|
|
12
12
|
};
|
|
13
13
|
exports.cssClasses = cssClasses;
|
|
14
14
|
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}`
|
|
12
12
|
};
|
|
13
13
|
exports.cssClasses = cssClasses;
|
|
14
14
|
const strings = {
|
|
@@ -10,9 +10,9 @@ var _constants = require("../tooltip/constants");
|
|
|
10
10
|
var _constants2 = require("../base/constants");
|
|
11
11
|
|
|
12
12
|
const cssClasses = {
|
|
13
|
-
PREFIX:
|
|
14
|
-
SELECTED:
|
|
15
|
-
DISABLED:
|
|
13
|
+
PREFIX: `${_constants2.BASE_CLASS_PREFIX}-dropdown`,
|
|
14
|
+
SELECTED: `${_constants2.BASE_CLASS_PREFIX}-dropdown-item-selected`,
|
|
15
|
+
DISABLED: `${_constants2.BASE_CLASS_PREFIX}-dropdown-item-disabled`
|
|
16
16
|
};
|
|
17
17
|
exports.cssClasses = cssClasses;
|
|
18
18
|
const strings = {
|
|
@@ -22,7 +22,7 @@ class DropdownMenuFoundation extends _foundation.default {
|
|
|
22
22
|
const trigger = this._adapter.getContext('trigger');
|
|
23
23
|
|
|
24
24
|
if (trigger === 'custom') {
|
|
25
|
-
const menuButton = menu && (0, _a11y.getMenuButton)(document.querySelectorAll(
|
|
25
|
+
const menuButton = menu && (0, _a11y.getMenuButton)(document.querySelectorAll(`[data-popupid]`), menu.id);
|
|
26
26
|
menuButton.focus();
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -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}-empty`
|
|
12
12
|
};
|
|
13
13
|
exports.cssClasses = cssClasses;
|
|
14
14
|
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}-form`
|
|
12
12
|
};
|
|
13
13
|
exports.cssClasses = cssClasses;
|
|
14
14
|
const strings = {
|
|
@@ -130,7 +130,7 @@ class FormFoundation extends _foundation.default {
|
|
|
130
130
|
ObjectUtil.remove(this.data.touched, field);
|
|
131
131
|
}
|
|
132
132
|
} catch (error) {
|
|
133
|
-
console.error(
|
|
133
|
+
console.error(`some thing wrong when unregister field:${field}`);
|
|
134
134
|
} // delete field
|
|
135
135
|
|
|
136
136
|
|
package/lib/cjs/form/utils.js
CHANGED
|
@@ -39,7 +39,7 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
39
39
|
*/
|
|
40
40
|
function getDisplayName(WrappedComponent) {
|
|
41
41
|
const originName = WrappedComponent.displayName || WrappedComponent.name;
|
|
42
|
-
return originName ?
|
|
42
|
+
return originName ? `SemiField${originName}` : 'SemiField';
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
function generateValidatesFromRules(field) {
|
|
@@ -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}-icon`
|
|
12
12
|
};
|
|
13
13
|
exports.cssClasses = cssClasses;
|
|
14
14
|
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}-input`
|
|
12
12
|
};
|
|
13
13
|
exports.cssClasses = cssClasses;
|
|
14
14
|
const strings = {
|