linkmore-design 1.0.59 → 1.0.60
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/CardTable/fns/index.d.ts +1 -0
- package/dist/Form/demos/error-tip.d.ts +2 -0
- package/dist/Form/index.d.ts +7 -2
- package/dist/LmEditTable/demos/sinleEdit.d.ts +2 -0
- package/dist/index.umd.js +71 -24
- package/dist/index.umd.min.js +6 -6
- package/es/CardTable/body/TableBodyCell.js +10 -5
- package/es/CardTable/fns/index.js +29 -2
- package/es/CardTable/table/TableRoot.js +46 -13
- package/es/Dropdown/index.js +2 -2
- package/es/Dropdown/style/index.css +19 -1
- package/es/Form/index.d.ts +7 -2
- package/es/Form/index.js +18 -2
- package/es/Form/style/index.css +81 -0
- package/es/IconFont/index.js +1 -1
- package/es/LmEditTable/EditTable.js +47 -17
- package/es/LmFilter/LmFilter.js +1 -1
- package/lib/CardTable/body/TableBodyCell.js +10 -5
- package/lib/CardTable/fns/index.js +29 -2
- package/lib/CardTable/table/TableRoot.js +46 -13
- package/lib/Dropdown/index.js +2 -2
- package/lib/Dropdown/style/index.css +19 -1
- package/lib/Form/index.d.ts +7 -2
- package/lib/Form/index.js +16 -1
- package/lib/Form/style/index.css +81 -0
- package/lib/IconFont/index.js +1 -1
- package/lib/LmEditTable/EditTable.js +47 -17
- package/lib/LmFilter/LmFilter.js +1 -1
- package/package.json +1 -1
package/dist/Form/index.d.ts
CHANGED
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Form as AntdForm, FormInstance, FormProps, List } from 'antd';
|
|
2
|
+
import { Form as AntdForm, FormInstance, FormProps, List, FormItemProps } from 'antd';
|
|
3
3
|
import useFormInstance from 'antd/lib/form/hooks/useFormInstance';
|
|
4
4
|
import { FormProvider } from 'antd/lib/form/context';
|
|
5
5
|
import { useForm, useWatch } from 'antd/lib/form/Form';
|
|
6
6
|
export interface LmFormProps extends FormProps {
|
|
7
7
|
responsive?: Boolean;
|
|
8
8
|
}
|
|
9
|
+
export interface LmFormItemProps extends FormItemProps {
|
|
10
|
+
useStatus: any;
|
|
11
|
+
errorPlacement?: string;
|
|
12
|
+
}
|
|
9
13
|
declare const Reform: <Values = any>(props: FormProps<Values> & {
|
|
10
14
|
children?: React.ReactNode;
|
|
11
15
|
} & {
|
|
12
16
|
ref?: React.Ref<FormInstance<Values>>;
|
|
13
17
|
}) => React.ReactElement;
|
|
18
|
+
declare const LMFormItem: (props: LmFormItemProps) => JSX.Element;
|
|
14
19
|
declare type InternalFormType = typeof Reform;
|
|
15
20
|
interface FormInterface extends InternalFormType {
|
|
16
21
|
useForm: typeof useForm;
|
|
17
22
|
useFormInstance: typeof useFormInstance;
|
|
18
23
|
useWatch: typeof useWatch;
|
|
19
|
-
Item: typeof
|
|
24
|
+
Item: typeof LMFormItem;
|
|
20
25
|
List: typeof List;
|
|
21
26
|
ErrorList: typeof AntdForm.ErrorList;
|
|
22
27
|
Provider: typeof FormProvider;
|
package/dist/index.umd.js
CHANGED
|
@@ -2770,7 +2770,7 @@
|
|
|
2770
2770
|
}
|
|
2771
2771
|
|
|
2772
2772
|
var IconFont = create({
|
|
2773
|
-
scriptUrl: '//at.alicdn.com/t/c/
|
|
2773
|
+
scriptUrl: '//at.alicdn.com/t/c/font_2966019_totaqlvhjak.js' // 在 iconfont.cn 上生成
|
|
2774
2774
|
// scriptUrl: require('./font/iconfont.js'),
|
|
2775
2775
|
|
|
2776
2776
|
});
|
|
@@ -33755,7 +33755,7 @@
|
|
|
33755
33755
|
type: 'lmweb-down'
|
|
33756
33756
|
}),
|
|
33757
33757
|
overlayClassName: classnames(props.overlayClassName, 'lm_dropdown_overlay'),
|
|
33758
|
-
className: classnames(props.className, 'lm_dropdown_button', props.disabled ? 'disabled' : '')
|
|
33758
|
+
className: classnames(props.className, 'lm_dropdown_button', props.disabled ? 'disabled' : '', props.type)
|
|
33759
33759
|
}));
|
|
33760
33760
|
}
|
|
33761
33761
|
|
|
@@ -33771,7 +33771,7 @@
|
|
|
33771
33771
|
overlayStyle: minwidth ? _objectSpread({
|
|
33772
33772
|
minWidth: minwidth
|
|
33773
33773
|
}, props.overlayStyle) : _objectSpread({}, props.overlayStyle),
|
|
33774
|
-
className: classnames(props.className, 'lm_dropdown_button', props.disabled ? 'disabled' : '')
|
|
33774
|
+
className: classnames(props.className, 'lm_dropdown_button', props.disabled ? 'disabled' : '', props.type)
|
|
33775
33775
|
})));
|
|
33776
33776
|
};
|
|
33777
33777
|
|
|
@@ -88459,7 +88459,9 @@
|
|
|
88459
88459
|
}, throttleSize());
|
|
88460
88460
|
};
|
|
88461
88461
|
|
|
88462
|
-
var _excluded$1s = ["children", "className", "responsive"]
|
|
88462
|
+
var _excluded$1s = ["children", "className", "responsive"],
|
|
88463
|
+
_excluded2$n = ["children", "className", "errorPlacement"];
|
|
88464
|
+
|
|
88463
88465
|
var classNamePrefix = 'lm_form';
|
|
88464
88466
|
|
|
88465
88467
|
var LMForm = function LMForm(props, ref) {
|
|
@@ -88486,8 +88488,23 @@
|
|
|
88486
88488
|
};
|
|
88487
88489
|
|
|
88488
88490
|
var Reform = /*#__PURE__*/React__default['default'].forwardRef(LMForm);
|
|
88491
|
+
|
|
88492
|
+
var LMFormItem = function LMFormItem(props) {
|
|
88493
|
+
var children = props.children,
|
|
88494
|
+
className = props.className,
|
|
88495
|
+
_props$errorPlacement = props.errorPlacement,
|
|
88496
|
+
errorPlacement = _props$errorPlacement === void 0 ? 'default' : _props$errorPlacement,
|
|
88497
|
+
restProps = _objectWithoutProperties(props, _excluded2$n);
|
|
88498
|
+
|
|
88499
|
+
var tipClassName = errorPlacement === 'default' ? '' : "lm_form-item-tip-error lm_form-item-tip-error-".concat(errorPlacement);
|
|
88500
|
+
var classes = classnames(className, tipClassName);
|
|
88501
|
+
return /*#__PURE__*/React__default['default'].createElement(_Form__default['default'].Item, _objectSpread({
|
|
88502
|
+
className: classes
|
|
88503
|
+
}, restProps), children);
|
|
88504
|
+
};
|
|
88505
|
+
|
|
88489
88506
|
var Form$1 = Reform;
|
|
88490
|
-
Form$1.Item =
|
|
88507
|
+
Form$1.Item = LMFormItem;
|
|
88491
88508
|
Form$1.List = _List__default['default'];
|
|
88492
88509
|
Form$1.ErrorList = _Form__default['default'].ErrorList;
|
|
88493
88510
|
Form$1.useForm = Form$2.useForm;
|
|
@@ -88590,9 +88607,9 @@
|
|
|
88590
88607
|
};
|
|
88591
88608
|
|
|
88592
88609
|
var _excluded$1u = ["index"],
|
|
88593
|
-
_excluded2$
|
|
88610
|
+
_excluded2$o = ["index"],
|
|
88594
88611
|
_excluded3$7 = ["value", "onChange"],
|
|
88595
|
-
_excluded4$3 = ["record", "rowKey", "isEdit", "col", "handleTableRowDelete", "handleTableRowAdd", "getLength", "isHoverEdit", "editEnum", "valueType", "children", "handleSave", "handleAdd", "handleDelete", "itemProps", "setValid", "reWriteOriginSource"],
|
|
88612
|
+
_excluded4$3 = ["record", "rowKey", "isEdit", "col", "handleTableRowDelete", "handleTableRowAdd", "getLength", "isHoverEdit", "editEnum", "valueType", "children", "handleSave", "handleAdd", "handleDelete", "handleCopy", "itemProps", "setValid", "reWriteOriginSource"],
|
|
88596
88613
|
_excluded5$2 = ["onMouseEnter", "onMouseLeave"],
|
|
88597
88614
|
_excluded6$1 = ["value", "columns", "isEdit", "isAdd", "onChange", "rowKey", "rowHoverEdit", "isUseForm", "isHoverEdit", "useQuickOpetate", "rowSelection", "sortOpen", "size"];
|
|
88598
88615
|
var UploadBtn$1 = UploadOss.UploadBtn;
|
|
@@ -88616,7 +88633,7 @@
|
|
|
88616
88633
|
|
|
88617
88634
|
var EditableSortRow = function EditableSortRow(_ref2) {
|
|
88618
88635
|
var index = _ref2.index,
|
|
88619
|
-
props = _objectWithoutProperties(_ref2, _excluded2$
|
|
88636
|
+
props = _objectWithoutProperties(_ref2, _excluded2$o);
|
|
88620
88637
|
|
|
88621
88638
|
var _Form$useForm3 = _Form__default['default'].useForm(),
|
|
88622
88639
|
_Form$useForm4 = _slicedToArray(_Form$useForm3, 1),
|
|
@@ -88769,6 +88786,7 @@
|
|
|
88769
88786
|
handleSave = props.handleSave,
|
|
88770
88787
|
handleAdd = props.handleAdd,
|
|
88771
88788
|
handleDelete = props.handleDelete,
|
|
88789
|
+
handleCopy = props.handleCopy,
|
|
88772
88790
|
itemProps = props.itemProps,
|
|
88773
88791
|
setValid = props.setValid,
|
|
88774
88792
|
reWriteOriginSource = props.reWriteOriginSource,
|
|
@@ -88796,44 +88814,45 @@
|
|
|
88796
88814
|
while (1) {
|
|
88797
88815
|
switch (_context.prev = _context.next) {
|
|
88798
88816
|
case 0:
|
|
88799
|
-
|
|
88800
|
-
_context.prev = 1;
|
|
88817
|
+
_context.prev = 0;
|
|
88801
88818
|
_context.t0 = row;
|
|
88802
88819
|
|
|
88803
88820
|
if (_context.t0) {
|
|
88804
|
-
_context.next =
|
|
88821
|
+
_context.next = 6;
|
|
88805
88822
|
break;
|
|
88806
88823
|
}
|
|
88807
88824
|
|
|
88808
|
-
_context.next =
|
|
88825
|
+
_context.next = 5;
|
|
88809
88826
|
return form.getFieldsValue();
|
|
88810
88827
|
|
|
88811
|
-
case
|
|
88828
|
+
case 5:
|
|
88812
88829
|
_context.t0 = _context.sent;
|
|
88813
88830
|
|
|
88814
|
-
case
|
|
88831
|
+
case 6:
|
|
88815
88832
|
values = _context.t0;
|
|
88816
|
-
console.log(_objectSpread(_objectSpread({
|
|
88833
|
+
console.log(_objectSpread(_objectSpread({
|
|
88834
|
+
record: record
|
|
88835
|
+
}, values), {}, _defineProperty({}, rowKey, record === null || record === void 0 ? void 0 : record[rowKey])), 'vvvv');
|
|
88817
88836
|
console.time('testForEach');
|
|
88818
|
-
handleSave(_objectSpread(_objectSpread({}, values), {}, _defineProperty({}, rowKey, record === null || record === void 0 ? void 0 : record[rowKey])));
|
|
88837
|
+
handleSave(_objectSpread(_objectSpread(_objectSpread({}, record), values), {}, _defineProperty({}, rowKey, record === null || record === void 0 ? void 0 : record[rowKey])));
|
|
88819
88838
|
console.timeEnd('testForEach');
|
|
88820
|
-
_context.next =
|
|
88839
|
+
_context.next = 13;
|
|
88821
88840
|
return form.validateFields();
|
|
88822
88841
|
|
|
88823
|
-
case
|
|
88824
|
-
_context.next =
|
|
88842
|
+
case 13:
|
|
88843
|
+
_context.next = 17;
|
|
88825
88844
|
break;
|
|
88826
88845
|
|
|
88827
|
-
case
|
|
88828
|
-
_context.prev =
|
|
88829
|
-
_context.t1 = _context["catch"](
|
|
88846
|
+
case 15:
|
|
88847
|
+
_context.prev = 15;
|
|
88848
|
+
_context.t1 = _context["catch"](0);
|
|
88830
88849
|
|
|
88831
|
-
case
|
|
88850
|
+
case 17:
|
|
88832
88851
|
case "end":
|
|
88833
88852
|
return _context.stop();
|
|
88834
88853
|
}
|
|
88835
88854
|
}
|
|
88836
|
-
}, _callee, null, [[
|
|
88855
|
+
}, _callee, null, [[0, 15]]);
|
|
88837
88856
|
}));
|
|
88838
88857
|
|
|
88839
88858
|
return function save(_x) {
|
|
@@ -88845,6 +88864,15 @@
|
|
|
88845
88864
|
var handleFormItemChange = function handleFormItemChange(e) {
|
|
88846
88865
|
save === null || save === void 0 ? void 0 : save();
|
|
88847
88866
|
};
|
|
88867
|
+
/** 快捷刷子,把当前的所有列的值,刷成当前的选中的列 */
|
|
88868
|
+
|
|
88869
|
+
|
|
88870
|
+
var copyKey = function copyKey(e) {
|
|
88871
|
+
e === null || e === void 0 ? void 0 : e.stopPropagation();
|
|
88872
|
+
console.log(rowKey, record[rowKey], 'fff');
|
|
88873
|
+
var dataIndex = col.dataIndex;
|
|
88874
|
+
handleCopy === null || handleCopy === void 0 ? void 0 : handleCopy(dataIndex, record[dataIndex]);
|
|
88875
|
+
};
|
|
88848
88876
|
|
|
88849
88877
|
var Control = function Control(con) {
|
|
88850
88878
|
switch (con) {
|
|
@@ -88866,6 +88894,10 @@
|
|
|
88866
88894
|
noStyle: true
|
|
88867
88895
|
}, /*#__PURE__*/React__default['default'].cloneElement(componentProps.addonAfter, {
|
|
88868
88896
|
onChange: handleFormItemChange
|
|
88897
|
+
})) : null,
|
|
88898
|
+
suffix: componentProps.quickcopy ? /*#__PURE__*/React__default['default'].createElement("span", null, /*#__PURE__*/React__default['default'].createElement(IconFont, {
|
|
88899
|
+
onClick: copyKey,
|
|
88900
|
+
type: 'lmweb-icon_m_brush'
|
|
88869
88901
|
})) : null
|
|
88870
88902
|
}));
|
|
88871
88903
|
|
|
@@ -89248,6 +89280,20 @@
|
|
|
89248
89280
|
}
|
|
89249
89281
|
};
|
|
89250
89282
|
|
|
89283
|
+
var handleCopy = function handleCopy(key, value) {
|
|
89284
|
+
var res = fn(dataSourceRef.current, function (draft) {
|
|
89285
|
+
draft.forEach(function (item) {
|
|
89286
|
+
return item[key] = value;
|
|
89287
|
+
});
|
|
89288
|
+
});
|
|
89289
|
+
|
|
89290
|
+
if (onChange) {
|
|
89291
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(res);
|
|
89292
|
+
} else {
|
|
89293
|
+
setDataSource(res);
|
|
89294
|
+
}
|
|
89295
|
+
};
|
|
89296
|
+
|
|
89251
89297
|
var resultColumns = React.useMemo(function () {
|
|
89252
89298
|
var localColumns = [sortOpen ? {
|
|
89253
89299
|
title: '',
|
|
@@ -89321,6 +89367,7 @@
|
|
|
89321
89367
|
isHoverEdit: isHoverEdit,
|
|
89322
89368
|
handleAdd: handleAdd,
|
|
89323
89369
|
handleDelete: handleDelete,
|
|
89370
|
+
handleCopy: handleCopy,
|
|
89324
89371
|
editEnum: typeof col.editEnum === 'function' ? col.editEnum(record) : col.editEnum,
|
|
89325
89372
|
valueType: typeof col.valueType === 'function' ? col.valueType(record) : col.valueType,
|
|
89326
89373
|
handleSave: handleSave,
|