@douyinfe/semi-ui 2.43.0-beta.0 → 2.43.1-alpha.1
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/dist/umd/semi-ui.js +44 -27
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/lib/cjs/calendar/monthCalendar.js +5 -1
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/image/preview.js +1 -1
- package/lib/cjs/modal/confirm.d.ts +3 -3
- package/lib/cjs/popover/index.d.ts +1 -1
- package/lib/cjs/tree/interface.d.ts +1 -1
- package/lib/cjs/treeSelect/index.d.ts +1 -1
- package/lib/es/calendar/monthCalendar.js +5 -1
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/image/preview.js +1 -1
- package/lib/es/modal/confirm.d.ts +3 -3
- package/lib/es/popover/index.d.ts +1 -1
- package/lib/es/tree/interface.d.ts +1 -1
- package/lib/es/treeSelect/index.d.ts +1 -1
- package/package.json +8 -8
package/dist/umd/semi-ui.js
CHANGED
|
@@ -22267,7 +22267,7 @@ const popover_constants_cssClasses = {
|
|
|
22267
22267
|
};
|
|
22268
22268
|
const popover_constants_strings = {
|
|
22269
22269
|
POSITION_SET: ['top', 'topLeft', 'topRight', 'left', 'leftTop', 'leftBottom', 'right', 'rightTop', 'rightBottom', 'bottom', 'bottomLeft', 'bottomRight', 'leftTopOver', 'rightTopOver'],
|
|
22270
|
-
TRIGGER_SET: ['hover', 'focus', 'click', 'custom'],
|
|
22270
|
+
TRIGGER_SET: ['hover', 'focus', 'click', 'custom', 'contextMenu'],
|
|
22271
22271
|
DEFAULT_ARROW_STYLE: {
|
|
22272
22272
|
borderOpacity: '1',
|
|
22273
22273
|
backgroundColor: 'var(--semi-color-bg-3)',
|
|
@@ -33061,7 +33061,11 @@ const filterEvents = (events, start, end) => {
|
|
|
33061
33061
|
const item = events.get(day);
|
|
33062
33062
|
const date = new Date(day);
|
|
33063
33063
|
if (isDateInRange(date, start, end)) {
|
|
33064
|
-
res.
|
|
33064
|
+
if (res.has(day)) {
|
|
33065
|
+
res.set(day, [...res.get(day), ...item]);
|
|
33066
|
+
} else {
|
|
33067
|
+
res.set(day, item);
|
|
33068
|
+
}
|
|
33065
33069
|
} else if (isBefore(end, date)) {
|
|
33066
33070
|
// do nothing
|
|
33067
33071
|
} else {
|
|
@@ -33393,13 +33397,13 @@ class CalendarFoundation extends foundation {
|
|
|
33393
33397
|
}
|
|
33394
33398
|
convertMapToArray(weekMap, weekStart) {
|
|
33395
33399
|
const eventArray = [];
|
|
33400
|
+
const map = new Map();
|
|
33396
33401
|
for (const entry of weekMap.entries()) {
|
|
33397
33402
|
const [key, value] = entry;
|
|
33398
|
-
const map = new Map();
|
|
33399
33403
|
map.set(key, value);
|
|
33400
|
-
const weekEvents = this._parseWeeklyEvents(map, weekStart);
|
|
33401
|
-
eventArray.push(...weekEvents);
|
|
33402
33404
|
}
|
|
33405
|
+
const weekEvents = this._parseWeeklyEvents(map, weekStart);
|
|
33406
|
+
eventArray.push(...weekEvents);
|
|
33403
33407
|
return eventArray;
|
|
33404
33408
|
}
|
|
33405
33409
|
getParseMonthlyEvents(itemLimit) {
|
|
@@ -34295,6 +34299,9 @@ class monthCalendar extends BaseComponent {
|
|
|
34295
34299
|
}))));
|
|
34296
34300
|
};
|
|
34297
34301
|
this.renderEvents = events => {
|
|
34302
|
+
const {
|
|
34303
|
+
itemLimit
|
|
34304
|
+
} = this.state;
|
|
34298
34305
|
if (!events) {
|
|
34299
34306
|
return undefined;
|
|
34300
34307
|
}
|
|
@@ -34311,11 +34318,12 @@ class monthCalendar extends BaseComponent {
|
|
|
34311
34318
|
width: monthCalendar_toPercent(width),
|
|
34312
34319
|
top: `${topInd}em`
|
|
34313
34320
|
};
|
|
34314
|
-
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
|
|
34321
|
+
if (topInd < itemLimit) return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("li", {
|
|
34315
34322
|
className: `${calendar_constants_cssClasses.PREFIX}-event-item ${calendar_constants_cssClasses.PREFIX}-event-month`,
|
|
34316
34323
|
key: key || `${ind}-monthevent`,
|
|
34317
34324
|
style: style
|
|
34318
34325
|
}, children);
|
|
34326
|
+
return null;
|
|
34319
34327
|
});
|
|
34320
34328
|
return list;
|
|
34321
34329
|
};
|
|
@@ -39223,10 +39231,15 @@ class TagInputFoundation extends foundation {
|
|
|
39223
39231
|
}
|
|
39224
39232
|
};
|
|
39225
39233
|
this.handleInputCompositionStart = e => {
|
|
39234
|
+
const {
|
|
39235
|
+
maxLength
|
|
39236
|
+
} = this.getProps();
|
|
39237
|
+
if (!isNumber_default()(maxLength)) {
|
|
39238
|
+
return;
|
|
39239
|
+
}
|
|
39226
39240
|
this._adapter.setEntering(true);
|
|
39227
39241
|
};
|
|
39228
39242
|
this.handleInputCompositionEnd = e => {
|
|
39229
|
-
this._adapter.setEntering(false);
|
|
39230
39243
|
const {
|
|
39231
39244
|
value
|
|
39232
39245
|
} = e.target;
|
|
@@ -39235,27 +39248,31 @@ class TagInputFoundation extends foundation {
|
|
|
39235
39248
|
onInputExceed,
|
|
39236
39249
|
separator
|
|
39237
39250
|
} = this.getProps();
|
|
39251
|
+
if (!isNumber_default()(maxLength)) {
|
|
39252
|
+
return;
|
|
39253
|
+
}
|
|
39254
|
+
this._adapter.setEntering(false);
|
|
39238
39255
|
let allowChange = true;
|
|
39239
|
-
const
|
|
39240
|
-
|
|
39241
|
-
|
|
39242
|
-
|
|
39243
|
-
|
|
39244
|
-
|
|
39245
|
-
|
|
39246
|
-
if (inputArr[index].length > maxLength) {
|
|
39247
|
-
allowChange = false;
|
|
39248
|
-
isFunction_default()(onInputExceed) && onInputExceed(value);
|
|
39249
|
-
break;
|
|
39250
|
-
}
|
|
39256
|
+
const inputArr = utils_getSplitedArray(value, separator);
|
|
39257
|
+
let index = 0;
|
|
39258
|
+
for (; index < inputArr.length; index++) {
|
|
39259
|
+
if (inputArr[index].length > maxLength) {
|
|
39260
|
+
allowChange = false;
|
|
39261
|
+
isFunction_default()(onInputExceed) && onInputExceed(value);
|
|
39262
|
+
break;
|
|
39251
39263
|
}
|
|
39252
|
-
|
|
39253
|
-
|
|
39254
|
-
|
|
39255
|
-
|
|
39256
|
-
|
|
39257
|
-
this._adapter.setInputValue(newInputArr.join(separator));
|
|
39264
|
+
}
|
|
39265
|
+
if (!allowChange) {
|
|
39266
|
+
const newInputArr = inputArr.slice(0, index);
|
|
39267
|
+
if (index < inputArr.length) {
|
|
39268
|
+
newInputArr.push(inputArr[index].slice(0, maxLength));
|
|
39258
39269
|
}
|
|
39270
|
+
this._adapter.setInputValue(newInputArr.join(separator));
|
|
39271
|
+
} else {
|
|
39272
|
+
// Why does it need to be updated here instead of in onChange when the value meets the maxLength limit?
|
|
39273
|
+
// Because in firefox, the state change in InputCompositionEnd causes onChange to not be triggered after
|
|
39274
|
+
// the composition input completes input.
|
|
39275
|
+
this._adapter.setInputValue(value);
|
|
39259
39276
|
}
|
|
39260
39277
|
};
|
|
39261
39278
|
/**
|
|
@@ -60264,7 +60281,7 @@ const dropdown_constants_cssClasses = {
|
|
|
60264
60281
|
};
|
|
60265
60282
|
const dropdown_constants_strings = {
|
|
60266
60283
|
POSITION_SET: tooltip_constants_strings.POSITION_SET,
|
|
60267
|
-
TRIGGER_SET: ['hover', 'focus', 'click', 'custom'],
|
|
60284
|
+
TRIGGER_SET: ['hover', 'focus', 'click', 'custom', 'contextMenu'],
|
|
60268
60285
|
DEFAULT_LEAVE_DELAY: 100,
|
|
60269
60286
|
ITEM_TYPE: ['primary', 'secondary', 'tertiary', 'warning', 'danger']
|
|
60270
60287
|
};
|
|
@@ -100796,8 +100813,8 @@ class Preview extends BaseComponent {
|
|
|
100796
100813
|
if (item.isIntersecting && src) {
|
|
100797
100814
|
item.target.src = src;
|
|
100798
100815
|
item.target.removeAttribute("data-src");
|
|
100816
|
+
this.previewObserver.unobserve(item.target);
|
|
100799
100817
|
}
|
|
100800
|
-
this.previewObserver.unobserve(item.target);
|
|
100801
100818
|
});
|
|
100802
100819
|
}, {
|
|
100803
100820
|
root: document.querySelector(`#${this.previewGroupId}`),
|