@douyinfe/semi-foundation 2.4.1 → 2.6.0-beta.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/button/button.scss +11 -0
- package/button/variables.scss +4 -0
- package/cascader/cascader.scss +3 -2
- package/cascader/foundation.ts +19 -0
- package/cascader/variables.scss +6 -3
- package/datePicker/foundation.ts +16 -4
- package/datePicker/inputFoundation.ts +0 -1
- package/datePicker/monthFoundation.ts +1 -0
- package/form/form.scss +7 -1
- package/form/foundation.ts +40 -36
- package/form/interface.ts +1 -1
- package/input/input.scss +2 -1
- package/lib/cjs/autoComplete/constants.d.ts +1 -1
- package/lib/cjs/button/button.css +9 -0
- package/lib/cjs/button/button.scss +11 -0
- package/lib/cjs/button/variables.scss +4 -0
- package/lib/cjs/cascader/cascader.css +2 -1
- package/lib/cjs/cascader/cascader.scss +3 -2
- package/lib/cjs/cascader/foundation.d.ts +19 -0
- package/lib/cjs/cascader/foundation.js +22 -0
- package/lib/cjs/cascader/variables.scss +6 -3
- package/lib/cjs/datePicker/foundation.d.ts +9 -4
- package/lib/cjs/datePicker/foundation.js +18 -0
- package/lib/cjs/datePicker/inputFoundation.d.ts +0 -1
- package/lib/cjs/datePicker/monthFoundation.d.ts +1 -0
- package/lib/cjs/dropdown/constants.d.ts +1 -1
- package/lib/cjs/form/form.css +4 -0
- package/lib/cjs/form/form.scss +7 -1
- package/lib/cjs/form/foundation.d.ts +6 -6
- package/lib/cjs/form/foundation.js +51 -52
- package/lib/cjs/form/interface.d.ts +1 -1
- package/lib/cjs/input/input.css +1 -0
- package/lib/cjs/input/input.scss +2 -1
- package/lib/cjs/select/constants.d.ts +1 -1
- package/lib/cjs/select/foundation.d.ts +1 -1
- package/lib/cjs/select/foundation.js +2 -1
- package/lib/cjs/select/optionFoundation.d.ts +1 -1
- package/lib/cjs/select/optionFoundation.js +3 -3
- package/lib/cjs/slider/foundation.js +2 -2
- package/lib/cjs/table/foundation.d.ts +2 -0
- package/lib/cjs/table/foundation.js +16 -4
- package/lib/cjs/table/table.css +1 -2
- package/lib/cjs/table/table.scss +4 -5
- package/lib/cjs/table/utils.js +4 -1
- package/lib/cjs/table/variables.scss +1 -0
- package/lib/cjs/tooltip/constants.d.ts +1 -1
- package/lib/cjs/tooltip/constants.js +1 -1
- package/lib/cjs/tooltip/foundation.js +65 -4
- package/lib/cjs/tree/foundation.d.ts +4 -1
- package/lib/cjs/tree/foundation.js +69 -20
- package/lib/cjs/treeSelect/foundation.d.ts +3 -3
- package/lib/cjs/treeSelect/foundation.js +103 -35
- package/lib/cjs/upload/upload.css +49 -27
- package/lib/cjs/upload/upload.scss +66 -41
- package/lib/cjs/upload/variables.scss +3 -1
- package/lib/es/autoComplete/constants.d.ts +1 -1
- package/lib/es/button/button.css +9 -0
- package/lib/es/button/button.scss +11 -0
- package/lib/es/button/variables.scss +4 -0
- package/lib/es/cascader/cascader.css +2 -1
- package/lib/es/cascader/cascader.scss +3 -2
- package/lib/es/cascader/foundation.d.ts +19 -0
- package/lib/es/cascader/foundation.js +22 -1
- package/lib/es/cascader/variables.scss +6 -3
- package/lib/es/datePicker/foundation.d.ts +9 -4
- package/lib/es/datePicker/foundation.js +18 -0
- package/lib/es/datePicker/inputFoundation.d.ts +0 -1
- package/lib/es/datePicker/monthFoundation.d.ts +1 -0
- package/lib/es/dropdown/constants.d.ts +1 -1
- package/lib/es/form/form.css +4 -0
- package/lib/es/form/form.scss +7 -1
- package/lib/es/form/foundation.d.ts +6 -6
- package/lib/es/form/foundation.js +51 -52
- package/lib/es/form/interface.d.ts +1 -1
- package/lib/es/input/input.css +1 -0
- package/lib/es/input/input.scss +2 -1
- package/lib/es/select/constants.d.ts +1 -1
- package/lib/es/select/foundation.d.ts +1 -1
- package/lib/es/select/foundation.js +2 -1
- package/lib/es/select/optionFoundation.d.ts +1 -1
- package/lib/es/select/optionFoundation.js +3 -3
- package/lib/es/slider/foundation.js +2 -2
- package/lib/es/table/foundation.d.ts +2 -0
- package/lib/es/table/foundation.js +16 -4
- package/lib/es/table/table.css +1 -2
- package/lib/es/table/table.scss +4 -5
- package/lib/es/table/utils.js +4 -1
- package/lib/es/table/variables.scss +1 -0
- package/lib/es/tooltip/constants.d.ts +1 -1
- package/lib/es/tooltip/constants.js +1 -1
- package/lib/es/tooltip/foundation.js +65 -4
- package/lib/es/tree/foundation.d.ts +4 -1
- package/lib/es/tree/foundation.js +69 -20
- package/lib/es/treeSelect/foundation.d.ts +3 -3
- package/lib/es/treeSelect/foundation.js +102 -35
- package/lib/es/upload/upload.css +49 -27
- package/lib/es/upload/upload.scss +66 -41
- package/lib/es/upload/variables.scss +3 -1
- package/package.json +3 -3
- package/select/foundation.ts +3 -2
- package/select/optionFoundation.ts +3 -3
- package/slider/foundation.ts +2 -2
- package/table/foundation.ts +23 -10
- package/table/table.scss +4 -5
- package/table/utils.ts +3 -1
- package/table/variables.scss +1 -0
- package/tooltip/constants.ts +2 -0
- package/tooltip/foundation.ts +52 -4
- package/tree/foundation.ts +56 -17
- package/treeSelect/foundation.ts +89 -41
- package/upload/upload.scss +66 -41
- package/upload/variables.scss +3 -1
|
@@ -486,7 +486,7 @@ export default class FormFoundation extends BaseFoundation {
|
|
|
486
486
|
} // update formState value
|
|
487
487
|
|
|
488
488
|
|
|
489
|
-
updateStateValue(field, value, opts) {
|
|
489
|
+
updateStateValue(field, value, opts, callback) {
|
|
490
490
|
const notNotify = opts && opts.notNotify;
|
|
491
491
|
const notUpdate = opts && opts.notUpdate;
|
|
492
492
|
const fieldAllowEmpty = opts && opts.fieldAllowEmpty;
|
|
@@ -518,7 +518,7 @@ export default class FormFoundation extends BaseFoundation {
|
|
|
518
518
|
}
|
|
519
519
|
|
|
520
520
|
if (!notUpdate) {
|
|
521
|
-
this._adapter.forceUpdate();
|
|
521
|
+
this._adapter.forceUpdate(callback);
|
|
522
522
|
}
|
|
523
523
|
} // get touched from formState
|
|
524
524
|
|
|
@@ -532,7 +532,7 @@ export default class FormFoundation extends BaseFoundation {
|
|
|
532
532
|
} // update formState touched
|
|
533
533
|
|
|
534
534
|
|
|
535
|
-
updateStateTouched(field, isTouched, opts) {
|
|
535
|
+
updateStateTouched(field, isTouched, opts, callback) {
|
|
536
536
|
const notNotify = opts && opts.notNotify;
|
|
537
537
|
const notUpdate = opts && opts.notUpdate;
|
|
538
538
|
ObjectUtil.set(this.data.touched, field, isTouched);
|
|
@@ -542,7 +542,7 @@ export default class FormFoundation extends BaseFoundation {
|
|
|
542
542
|
}
|
|
543
543
|
|
|
544
544
|
if (!notUpdate) {
|
|
545
|
-
this._adapter.forceUpdate();
|
|
545
|
+
this._adapter.forceUpdate(callback);
|
|
546
546
|
}
|
|
547
547
|
} // get error from formState
|
|
548
548
|
|
|
@@ -556,7 +556,7 @@ export default class FormFoundation extends BaseFoundation {
|
|
|
556
556
|
} // update formState error
|
|
557
557
|
|
|
558
558
|
|
|
559
|
-
updateStateError(field, error, opts) {
|
|
559
|
+
updateStateError(field, error, opts, callback) {
|
|
560
560
|
const notNotify = opts && opts.notNotify;
|
|
561
561
|
const notUpdate = opts && opts.notUpdate;
|
|
562
562
|
ObjectUtil.set(this.data.errors, field, error); // The setError caused by centralized validation does not need to trigger notify, otherwise it will be called too frequently, as many times as there are fields
|
|
@@ -567,7 +567,7 @@ export default class FormFoundation extends BaseFoundation {
|
|
|
567
567
|
}
|
|
568
568
|
|
|
569
569
|
if (!notUpdate) {
|
|
570
|
-
this._adapter.forceUpdate();
|
|
570
|
+
this._adapter.forceUpdate(callback);
|
|
571
571
|
}
|
|
572
572
|
} // For internal use in the FormApi Operating Field
|
|
573
573
|
|
|
@@ -586,22 +586,21 @@ export default class FormFoundation extends BaseFoundation {
|
|
|
586
586
|
// At this time, first modify formState directly, then find out the subordinate fields and drive them to update
|
|
587
587
|
// Eg: peoples: [0, 2, 3]. Each value of the peoples array corresponds to an Input Field
|
|
588
588
|
// When the user directly calls formA pi.set Value ('peoples', [2,3])
|
|
589
|
-
this.updateStateValue(field, newValue, opts)
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
}
|
|
603
|
-
} // If the reset happens to be, then update the updateKey corresponding to ArrayField to render it again
|
|
604
|
-
|
|
589
|
+
this.updateStateValue(field, newValue, opts, () => {
|
|
590
|
+
let nestedFields = this._getNestedField(field);
|
|
591
|
+
|
|
592
|
+
if (nestedFields.size) {
|
|
593
|
+
_forEachInstanceProperty(nestedFields).call(nestedFields, fieldStaff => {
|
|
594
|
+
let fieldPath = fieldStaff.field;
|
|
595
|
+
let newFieldVal = ObjectUtil.get(_valuesInstanceProperty(this.data), fieldPath);
|
|
596
|
+
let nestedBatchUpdateOpts = {
|
|
597
|
+
notNotify: true,
|
|
598
|
+
notUpdate: true
|
|
599
|
+
};
|
|
600
|
+
fieldStaff.fieldApi.setValue(newFieldVal, nestedBatchUpdateOpts);
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
}); // If the reset happens to be, then update the updateKey corresponding to ArrayField to render it again
|
|
605
604
|
|
|
606
605
|
if (this.getArrayField(field)) {
|
|
607
606
|
this.updateArrayField(field, {
|
|
@@ -619,21 +618,21 @@ export default class FormFoundation extends BaseFoundation {
|
|
|
619
618
|
if (fieldApi) {
|
|
620
619
|
fieldApi.setError(newError, opts);
|
|
621
620
|
} else {
|
|
622
|
-
this.updateStateError(field, newError, opts)
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
}
|
|
636
|
-
}
|
|
621
|
+
this.updateStateError(field, newError, opts, () => {
|
|
622
|
+
let nestedFields = this._getNestedField(field);
|
|
623
|
+
|
|
624
|
+
if (nestedFields.size) {
|
|
625
|
+
_forEachInstanceProperty(nestedFields).call(nestedFields, fieldStaff => {
|
|
626
|
+
let fieldPath = fieldStaff.field;
|
|
627
|
+
let newFieldError = ObjectUtil.get(this.data.errors, fieldPath);
|
|
628
|
+
let nestedBatchUpdateOpts = {
|
|
629
|
+
notNotify: true,
|
|
630
|
+
notUpdate: true
|
|
631
|
+
};
|
|
632
|
+
fieldStaff.fieldApi.setError(newFieldError, nestedBatchUpdateOpts);
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
});
|
|
637
636
|
|
|
638
637
|
if (this.getArrayField(field)) {
|
|
639
638
|
this.updateArrayField(field, {
|
|
@@ -649,21 +648,21 @@ export default class FormFoundation extends BaseFoundation {
|
|
|
649
648
|
if (fieldApi) {
|
|
650
649
|
fieldApi.setTouched(isTouched, opts);
|
|
651
650
|
} else {
|
|
652
|
-
this.updateStateTouched(field, isTouched, opts)
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
}
|
|
666
|
-
}
|
|
651
|
+
this.updateStateTouched(field, isTouched, opts, () => {
|
|
652
|
+
let nestedFields = this._getNestedField(field);
|
|
653
|
+
|
|
654
|
+
if (nestedFields.size) {
|
|
655
|
+
_forEachInstanceProperty(nestedFields).call(nestedFields, fieldStaff => {
|
|
656
|
+
let fieldPath = fieldStaff.field;
|
|
657
|
+
let newFieldTouch = ObjectUtil.get(this.data.touched, fieldPath);
|
|
658
|
+
let nestedBatchUpdateOpts = {
|
|
659
|
+
notNotify: true,
|
|
660
|
+
notUpdate: true
|
|
661
|
+
};
|
|
662
|
+
fieldStaff.fieldApi.setTouched(newFieldTouch, nestedBatchUpdateOpts);
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
});
|
|
667
666
|
|
|
668
667
|
if (this.getArrayField(field)) {
|
|
669
668
|
this.updateArrayField(field, {
|
|
@@ -7,7 +7,7 @@ export interface BaseFormAdapter<P = Record<string, any>, S = Record<string, any
|
|
|
7
7
|
cloneDeep: (val: any, ...rest: any[]) => any;
|
|
8
8
|
notifySubmit: (values: any) => void;
|
|
9
9
|
notifySubmitFail: (errors: Record<string, any>, values: any) => void;
|
|
10
|
-
forceUpdate: () => void;
|
|
10
|
+
forceUpdate: (callback?: () => void) => void;
|
|
11
11
|
notifyChange: (formState: FormState) => void;
|
|
12
12
|
notifyValueChange: (values: any, changedValues: any) => void;
|
|
13
13
|
notifyReset: () => void;
|
package/lib/es/input/input.css
CHANGED
|
@@ -278,6 +278,7 @@
|
|
|
278
278
|
cursor: not-allowed;
|
|
279
279
|
color: var(--semi-color-disabled-text);
|
|
280
280
|
background-color: var(--semi-color-disabled-fill);
|
|
281
|
+
-webkit-text-fill-color: var(--semi-color-disabled-text);
|
|
281
282
|
}
|
|
282
283
|
.semi-input-wrapper-disabled:hover {
|
|
283
284
|
background-color: var(--semi-color-disabled-fill);
|
package/lib/es/input/input.scss
CHANGED
|
@@ -382,7 +382,8 @@ $module: #{$prefix}-input;
|
|
|
382
382
|
// border: $border-thickness-control $color-input_disabled-border-default solid;
|
|
383
383
|
color: $color-input_disabled-text-default;
|
|
384
384
|
background-color: $color-input_disabled-bg-default;
|
|
385
|
-
|
|
385
|
+
// fix issue 670 in safari
|
|
386
|
+
-webkit-text-fill-color: $color-input_disabled-text-default;
|
|
386
387
|
&:hover {
|
|
387
388
|
background-color: $color-input_disabled-bg-default;
|
|
388
389
|
}
|
|
@@ -5,7 +5,7 @@ declare const cssClasses: {
|
|
|
5
5
|
};
|
|
6
6
|
declare const strings: {
|
|
7
7
|
readonly SIZE_SET: readonly ["small", "large", "default"];
|
|
8
|
-
readonly POSITION_SET: readonly ["top", "topLeft", "topRight", "left", "leftTop", "leftBottom", "right", "rightTop", "rightBottom", "bottom", "bottomLeft", "bottomRight", "leftTopOver", "rightTopOver"];
|
|
8
|
+
readonly POSITION_SET: readonly ["top", "topLeft", "topRight", "left", "leftTop", "leftBottom", "right", "rightTop", "rightBottom", "bottom", "bottomLeft", "bottomRight", "leftTopOver", "rightTopOver", "leftBottomOver", "rightBottomOver"];
|
|
9
9
|
readonly MODE_SELECT: "select";
|
|
10
10
|
readonly MODE_AUTOCOMPLETE: "autoComplete";
|
|
11
11
|
readonly STATUS: readonly ["default", "error", "warning", "success"];
|
|
@@ -36,7 +36,7 @@ export interface SelectAdapter<P = Record<string, any>, S = Record<string, any>>
|
|
|
36
36
|
notifyMouseLeave(event: any): void;
|
|
37
37
|
notifyMouseEnter(event: any): void;
|
|
38
38
|
updateHovering(isHover: boolean): void;
|
|
39
|
-
updateScrollTop(): void;
|
|
39
|
+
updateScrollTop(index?: number): void;
|
|
40
40
|
}
|
|
41
41
|
declare type LabelValue = string | number;
|
|
42
42
|
declare type PropValue = LabelValue | Record<string, any>;
|
|
@@ -916,8 +916,9 @@ export default class SelectFoundation extends BaseFoundation {
|
|
|
916
916
|
} // console.log('new:' + index);
|
|
917
917
|
|
|
918
918
|
|
|
919
|
-
this._adapter.updateFocusIndex(index);
|
|
919
|
+
this._adapter.updateFocusIndex(index);
|
|
920
920
|
|
|
921
|
+
this._adapter.updateScrollTop(index);
|
|
921
922
|
}
|
|
922
923
|
|
|
923
924
|
_handleArrowKeyDown(offset) {
|
|
@@ -12,14 +12,14 @@ export default class OptionFoundation extends BaseFoundation {
|
|
|
12
12
|
destroy() {}
|
|
13
13
|
|
|
14
14
|
onOptionClick(option) {
|
|
15
|
-
const
|
|
15
|
+
const isDisabled = this._isDisabled();
|
|
16
16
|
|
|
17
|
-
if (!
|
|
17
|
+
if (!isDisabled) {
|
|
18
18
|
this._adapter.notifyClick(option);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
_isDisabled() {
|
|
23
23
|
return this.getProp('disabled');
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -147,7 +147,7 @@ export default class SliderFoundation extends BaseFoundation {
|
|
|
147
147
|
|
|
148
148
|
const scroll = node => regex.test(style(node, 'overflow') + style(node, 'overflow-y') + style(node, 'overflow-x'));
|
|
149
149
|
|
|
150
|
-
const scrollParent = node => !node || node === document.body ? document.body : scroll(node) ? node : scrollParent(node.parentNode);
|
|
150
|
+
const scrollParent = node => !node || node === document.body || !(node instanceof Element) ? document.body : scroll(node) ? node : scrollParent(node.parentNode);
|
|
151
151
|
|
|
152
152
|
return scrollParent(el);
|
|
153
153
|
};
|
|
@@ -271,7 +271,7 @@ export default class SliderFoundation extends BaseFoundation {
|
|
|
271
271
|
}
|
|
272
272
|
|
|
273
273
|
if (step !== 1) {
|
|
274
|
-
// Find nearest step point
|
|
274
|
+
// Find nearest step point
|
|
275
275
|
stepValue = Math.round(stepValue / step) * step;
|
|
276
276
|
}
|
|
277
277
|
|
|
@@ -8,6 +8,7 @@ export interface BaseColumnProps<RecordType> {
|
|
|
8
8
|
className?: string;
|
|
9
9
|
colSpan?: number;
|
|
10
10
|
dataIndex?: string;
|
|
11
|
+
defaultFilteredValue?: any[];
|
|
11
12
|
defaultSortOrder?: BaseSortOrder;
|
|
12
13
|
filterChildrenRecord?: boolean;
|
|
13
14
|
filterDropdown?: any;
|
|
@@ -313,6 +314,7 @@ export interface BaseChangeInfoFilter<RecordType> {
|
|
|
313
314
|
filters?: BaseFilter[];
|
|
314
315
|
onFilter?: (filteredValue?: any, record?: RecordType) => boolean;
|
|
315
316
|
filteredValue?: any[];
|
|
317
|
+
defaultFilteredValue?: any[];
|
|
316
318
|
children?: BaseFilter[];
|
|
317
319
|
filterChildrenRecord?: boolean;
|
|
318
320
|
}
|
|
@@ -176,7 +176,17 @@ class TableFoundation extends BaseFoundation {
|
|
|
176
176
|
|
|
177
177
|
|
|
178
178
|
getFilteredSortedDataSource(dataSource, queries) {
|
|
179
|
-
const filteredDataSource = this.filterDataSource(dataSource, _filterInstanceProperty(queries).call(queries, query =>
|
|
179
|
+
const filteredDataSource = this.filterDataSource(dataSource, _filterInstanceProperty(queries).call(queries, query => {
|
|
180
|
+
/**
|
|
181
|
+
* 这里无需判断 filteredValue 是否为数组,初始化时它是 `undefined`,点击选择空时为 `[]`
|
|
182
|
+
* 初始化时我们应该用 `defaultFilteredValue`,点击后我们应该用 `filteredValue`
|
|
183
|
+
*
|
|
184
|
+
* There is no need to judge whether `filteredValue` is an array here, because it is `undefined` when initialized, and `[]` when you click to select empty
|
|
185
|
+
* When initializing we should use `defaultFilteredValue`, after clicking we should use `filteredValue`
|
|
186
|
+
*/
|
|
187
|
+
const currentFilteredValue = query.filteredValue ? query.filteredValue : query.defaultFilteredValue;
|
|
188
|
+
return _isFunction(query.onFilter) && _Array$isArray(query.filters) && query.filters.length && _Array$isArray(currentFilteredValue) && currentFilteredValue.length;
|
|
189
|
+
}));
|
|
180
190
|
const sortedDataSource = this.sortDataSource(filteredDataSource, _filterInstanceProperty(queries).call(queries, query => query && _isFunction(query.sorter)));
|
|
181
191
|
return sortedDataSource;
|
|
182
192
|
}
|
|
@@ -335,10 +345,12 @@ class TableFoundation extends BaseFoundation {
|
|
|
335
345
|
const {
|
|
336
346
|
onFilter,
|
|
337
347
|
filteredValue,
|
|
338
|
-
filterChildrenRecord
|
|
348
|
+
filterChildrenRecord,
|
|
349
|
+
defaultFilteredValue
|
|
339
350
|
} = filterObj;
|
|
351
|
+
const currentFilteredValue = _Array$isArray(filteredValue) ? filteredValue : defaultFilteredValue;
|
|
340
352
|
|
|
341
|
-
if (typeof onFilter === 'function' && _Array$isArray(
|
|
353
|
+
if (typeof onFilter === 'function' && _Array$isArray(currentFilteredValue) && currentFilteredValue.length) {
|
|
342
354
|
hasValidFilters = true;
|
|
343
355
|
|
|
344
356
|
if (filteredData === null) {
|
|
@@ -348,7 +360,7 @@ class TableFoundation extends BaseFoundation {
|
|
|
348
360
|
filteredData = new _Map();
|
|
349
361
|
}
|
|
350
362
|
|
|
351
|
-
_each(
|
|
363
|
+
_each(currentFilteredValue, value => {
|
|
352
364
|
_each(dataSource, record => {
|
|
353
365
|
const childrenRecords = _get(record, childrenRecordName);
|
|
354
366
|
|
package/lib/es/table/table.css
CHANGED
|
@@ -109,7 +109,6 @@
|
|
|
109
109
|
word-break: break-all;
|
|
110
110
|
word-wrap: break-word;
|
|
111
111
|
position: relative;
|
|
112
|
-
user-select: none;
|
|
113
112
|
}
|
|
114
113
|
.semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-cell-fixed-left, .semi-table-thead > .semi-table-row > .semi-table-row-head.semi-table-cell-fixed-right {
|
|
115
114
|
z-index: 101;
|
|
@@ -381,7 +380,7 @@
|
|
|
381
380
|
position: relative;
|
|
382
381
|
z-index: 1;
|
|
383
382
|
padding: 16px 12px;
|
|
384
|
-
color: var(--semi-color-
|
|
383
|
+
color: var(--semi-color-text-2);
|
|
385
384
|
font-size: 14px;
|
|
386
385
|
text-align: center;
|
|
387
386
|
background: transparent;
|
package/lib/es/table/table.scss
CHANGED
|
@@ -100,7 +100,6 @@ $module: #{$prefix}-table;
|
|
|
100
100
|
word-break: break-all;
|
|
101
101
|
word-wrap: break-word;
|
|
102
102
|
position: relative;
|
|
103
|
-
user-select: none;
|
|
104
103
|
|
|
105
104
|
&.#{$module}-cell-fixed {
|
|
106
105
|
|
|
@@ -199,11 +198,11 @@ $module: #{$prefix}-table;
|
|
|
199
198
|
background-color: $color-table_body-bg-hover;
|
|
200
199
|
|
|
201
200
|
&.#{$module}-cell-fixed {
|
|
202
|
-
|
|
201
|
+
|
|
203
202
|
&-left,
|
|
204
203
|
&-right {
|
|
205
204
|
background-color: $color-table_body-bg-default;
|
|
206
|
-
|
|
205
|
+
|
|
207
206
|
&::before {
|
|
208
207
|
background-color: $color-table_body-bg-hover;
|
|
209
208
|
content: "";
|
|
@@ -327,7 +326,7 @@ $module: #{$prefix}-table;
|
|
|
327
326
|
&-wrap {
|
|
328
327
|
// inline-flex vertical-align baseline 会导致父元素高度异常
|
|
329
328
|
display: inline-flex;
|
|
330
|
-
vertical-align: bottom;
|
|
329
|
+
vertical-align: bottom;
|
|
331
330
|
}
|
|
332
331
|
|
|
333
332
|
&-disabled {
|
|
@@ -467,7 +466,7 @@ $module: #{$prefix}-table;
|
|
|
467
466
|
position: relative;
|
|
468
467
|
z-index: 1;
|
|
469
468
|
padding: #{$spacing-table-paddingY} #{$spacing-table-paddingX};
|
|
470
|
-
color: $color-
|
|
469
|
+
color: $color-table_placeholder-text-default;
|
|
471
470
|
font-size: #{$font-table_base-fontSize};
|
|
472
471
|
text-align: center;
|
|
473
472
|
background: $color-table_pl-bg-default;
|
package/lib/es/table/utils.js
CHANGED
|
@@ -296,7 +296,10 @@ export function assignColumnKeys(columns) {
|
|
|
296
296
|
if (column.key == null) {
|
|
297
297
|
var _context4;
|
|
298
298
|
|
|
299
|
-
|
|
299
|
+
// if user give column a dataIndex, use it for backup
|
|
300
|
+
const _index = column.dataIndex || index;
|
|
301
|
+
|
|
302
|
+
column.key = _concatInstanceProperty(_context4 = "".concat(level, "-")).call(_context4, _index);
|
|
300
303
|
}
|
|
301
304
|
|
|
302
305
|
if (_Array$isArray(column[childrenColumnName]) && column[childrenColumnName].length) {
|
|
@@ -73,6 +73,7 @@ $color-table_sorter-text-hover: var(--semi-color-text-2); // 表格排序按钮
|
|
|
73
73
|
$color-table_page-text-default: var(--semi-color-text-2); // 表格翻页器文本颜色
|
|
74
74
|
$color-table_resizer-bg-default: var(--semi-color-primary); // 表格拉伸标示线颜色
|
|
75
75
|
$color-table_selection-bg-default: rgba(var(--semi-grey-0), 1); // 表格分组背景色
|
|
76
|
+
$color-table_placeholder-text-default: var(--semi-color-text-2); // 表格空数据文本颜色
|
|
76
77
|
|
|
77
78
|
// Other
|
|
78
79
|
$font-table_base-fontSize: 14px; // 表格默认文本字号
|
|
@@ -2,7 +2,7 @@ declare const cssClasses: {
|
|
|
2
2
|
readonly PREFIX: "semi-tooltip";
|
|
3
3
|
};
|
|
4
4
|
declare const strings: {
|
|
5
|
-
readonly POSITION_SET: readonly ["top", "topLeft", "topRight", "left", "leftTop", "leftBottom", "right", "rightTop", "rightBottom", "bottom", "bottomLeft", "bottomRight", "leftTopOver", "rightTopOver"];
|
|
5
|
+
readonly POSITION_SET: readonly ["top", "topLeft", "topRight", "left", "leftTop", "leftBottom", "right", "rightTop", "rightBottom", "bottom", "bottomLeft", "bottomRight", "leftTopOver", "rightTopOver", "leftBottomOver", "rightBottomOver"];
|
|
6
6
|
readonly TRIGGER_SET: readonly ["hover", "focus", "click", "custom"];
|
|
7
7
|
readonly STATUS_DISABLED: "disabled";
|
|
8
8
|
readonly STATUS_LOADING: "loading";
|
|
@@ -3,7 +3,7 @@ const cssClasses = {
|
|
|
3
3
|
PREFIX: "".concat(BASE_CLASS_PREFIX, "-tooltip")
|
|
4
4
|
};
|
|
5
5
|
const strings = {
|
|
6
|
-
POSITION_SET: ['top', 'topLeft', 'topRight', 'left', 'leftTop', 'leftBottom', 'right', 'rightTop', 'rightBottom', 'bottom', 'bottomLeft', 'bottomRight', 'leftTopOver', 'rightTopOver'],
|
|
6
|
+
POSITION_SET: ['top', 'topLeft', 'topRight', 'left', 'leftTop', 'leftBottom', 'right', 'rightTop', 'rightBottom', 'bottom', 'bottomLeft', 'bottomRight', 'leftTopOver', 'rightTopOver', 'leftBottomOver', 'rightBottomOver'],
|
|
7
7
|
TRIGGER_SET: ['hover', 'focus', 'click', 'custom'],
|
|
8
8
|
STATUS_DISABLED: 'disabled',
|
|
9
9
|
STATUS_LOADING: 'loading'
|
|
@@ -530,6 +530,19 @@ export default class Tooltip extends BaseFoundation {
|
|
|
530
530
|
translateX = -1;
|
|
531
531
|
break;
|
|
532
532
|
|
|
533
|
+
case 'leftBottomOver':
|
|
534
|
+
left = triggerRect.left;
|
|
535
|
+
top = triggerRect.bottom;
|
|
536
|
+
translateY = -1;
|
|
537
|
+
break;
|
|
538
|
+
|
|
539
|
+
case 'rightBottomOver':
|
|
540
|
+
left = triggerRect.right;
|
|
541
|
+
top = triggerRect.bottom;
|
|
542
|
+
translateX = -1;
|
|
543
|
+
translateY = -1;
|
|
544
|
+
break;
|
|
545
|
+
|
|
533
546
|
default:
|
|
534
547
|
break;
|
|
535
548
|
}
|
|
@@ -653,12 +666,16 @@ export default class Tooltip extends BaseFoundation {
|
|
|
653
666
|
|
|
654
667
|
const shouldReverseTop = clientTop < wrapperRect.height + spacing && restClientBottom > wrapperRect.height + spacing;
|
|
655
668
|
const shouldReverseLeft = clientLeft < wrapperRect.width + spacing && restClientRight > wrapperRect.width + spacing;
|
|
656
|
-
const
|
|
669
|
+
const shouldReverseBottom = restClientBottom < wrapperRect.height + spacing && clientTop > wrapperRect.height + spacing;
|
|
657
670
|
const shouldReverseRight = restClientRight < wrapperRect.width + spacing && clientLeft > wrapperRect.width + spacing;
|
|
671
|
+
const shouldReverseTopOver = restClientTop < wrapperRect.height + spacing && clientBottom > wrapperRect.height + spacing;
|
|
672
|
+
const shouldReverseBottomOver = clientBottom < wrapperRect.height + spacing && restClientTop > wrapperRect.height + spacing;
|
|
658
673
|
const shouldReverseTopSide = restClientTop < wrapperRect.height && clientBottom > wrapperRect.height;
|
|
659
674
|
const shouldReverseBottomSide = clientBottom < wrapperRect.height && restClientTop > wrapperRect.height;
|
|
660
675
|
const shouldReverseLeftSide = restClientLeft < wrapperRect.width && clientRight > wrapperRect.width;
|
|
661
676
|
const shouldReverseRightSide = clientRight < wrapperRect.width && restClientLeft > wrapperRect.width;
|
|
677
|
+
const shouldReverseLeftOver = restClientLeft < wrapperRect.width && clientRight > wrapperRect.width;
|
|
678
|
+
const shouldReverseRightOver = clientRight < wrapperRect.width && restClientLeft > wrapperRect.width;
|
|
662
679
|
|
|
663
680
|
switch (position) {
|
|
664
681
|
case 'top':
|
|
@@ -720,14 +737,14 @@ export default class Tooltip extends BaseFoundation {
|
|
|
720
737
|
break;
|
|
721
738
|
|
|
722
739
|
case 'bottom':
|
|
723
|
-
if (
|
|
740
|
+
if (shouldReverseBottom) {
|
|
724
741
|
position = this._reversePos(position, true);
|
|
725
742
|
}
|
|
726
743
|
|
|
727
744
|
break;
|
|
728
745
|
|
|
729
746
|
case 'bottomLeft':
|
|
730
|
-
if (
|
|
747
|
+
if (shouldReverseBottom) {
|
|
731
748
|
position = this._reversePos(position, true);
|
|
732
749
|
}
|
|
733
750
|
|
|
@@ -738,7 +755,7 @@ export default class Tooltip extends BaseFoundation {
|
|
|
738
755
|
break;
|
|
739
756
|
|
|
740
757
|
case 'bottomRight':
|
|
741
|
-
if (
|
|
758
|
+
if (shouldReverseBottom) {
|
|
742
759
|
position = this._reversePos(position, true);
|
|
743
760
|
}
|
|
744
761
|
|
|
@@ -777,6 +794,50 @@ export default class Tooltip extends BaseFoundation {
|
|
|
777
794
|
|
|
778
795
|
break;
|
|
779
796
|
|
|
797
|
+
case 'leftTopOver':
|
|
798
|
+
if (shouldReverseTopOver) {
|
|
799
|
+
position = this._reversePos(position, true);
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
if (shouldReverseLeftOver) {
|
|
803
|
+
position = this._reversePos(position);
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
break;
|
|
807
|
+
|
|
808
|
+
case 'leftBottomOver':
|
|
809
|
+
if (shouldReverseBottomOver) {
|
|
810
|
+
position = this._reversePos(position, true);
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
if (shouldReverseLeftOver) {
|
|
814
|
+
position = this._reversePos(position);
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
break;
|
|
818
|
+
|
|
819
|
+
case 'rightTopOver':
|
|
820
|
+
if (shouldReverseTopOver) {
|
|
821
|
+
position = this._reversePos(position, true);
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
if (shouldReverseRightOver) {
|
|
825
|
+
position = this._reversePos(position);
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
break;
|
|
829
|
+
|
|
830
|
+
case 'rightBottomOver':
|
|
831
|
+
if (shouldReverseBottomOver) {
|
|
832
|
+
position = this._reversePos(position, true);
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
if (shouldReverseRightOver) {
|
|
836
|
+
position = this._reversePos(position);
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
break;
|
|
840
|
+
|
|
780
841
|
default:
|
|
781
842
|
break;
|
|
782
843
|
}
|
|
@@ -128,6 +128,7 @@ export interface Virtualize {
|
|
|
128
128
|
height?: number | string;
|
|
129
129
|
width?: number | string;
|
|
130
130
|
}
|
|
131
|
+
export declare type CheckRelation = 'related' | 'unRelated';
|
|
131
132
|
export interface BasicTreeProps {
|
|
132
133
|
autoExpandParent?: boolean;
|
|
133
134
|
autoExpandWhenDragEnter?: boolean;
|
|
@@ -183,6 +184,7 @@ export interface BasicTreeProps {
|
|
|
183
184
|
value?: BasicValue;
|
|
184
185
|
virtualize?: Virtualize;
|
|
185
186
|
icon?: any;
|
|
187
|
+
checkRelation?: CheckRelation;
|
|
186
188
|
'aria-label'?: string;
|
|
187
189
|
}
|
|
188
190
|
export interface BasicTreeInnerData {
|
|
@@ -193,6 +195,7 @@ export interface BasicTreeInnerData {
|
|
|
193
195
|
selectedKeys: string[];
|
|
194
196
|
checkedKeys: Set<string>;
|
|
195
197
|
halfCheckedKeys: Set<string>;
|
|
198
|
+
realCheckedKeys: Set<string>;
|
|
196
199
|
motionKeys: Set<string>;
|
|
197
200
|
motionType: string;
|
|
198
201
|
expandedKeys: Set<string>;
|
|
@@ -242,7 +245,7 @@ export default class TreeFoundation extends BaseFoundation<TreeAdapter, BasicTre
|
|
|
242
245
|
getCopyFromState(items: string[] | string): Partial<BasicTreeInnerData>;
|
|
243
246
|
getTreeNodeProps(key: string): BasicTreeNodeProps;
|
|
244
247
|
notifyJsonChange(key: string[] | string, e: any): void;
|
|
245
|
-
notifyMultipleChange(key: string[]
|
|
248
|
+
notifyMultipleChange(key: string[], e: any): void;
|
|
246
249
|
notifyChange(key: string[] | string, e: any): void;
|
|
247
250
|
handleInputChange(sugInput: string): void;
|
|
248
251
|
handleNodeSelect(e: any, treeNode: BasicTreeNodeProps): void;
|