linkmore-design 1.0.64 → 1.0.66
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/README.md +1 -1
- package/dist/Approval/demos/basic.d.ts +2 -0
- package/dist/Approval/index.d.ts +24 -0
- package/dist/Approval/style/index.d.ts +1 -0
- package/dist/Form/index.d.ts +1 -1
- package/dist/LmEditTable/EditTable.d.ts +1 -0
- package/dist/LmFilter/filterFns/index.d.ts +5 -0
- package/dist/index.umd.js +82 -17
- package/dist/index.umd.min.js +1 -1
- package/es/Approval/index.d.ts +24 -0
- package/es/Approval/index.js +210 -0
- package/es/Approval/style/index.css +592 -0
- package/es/Approval/style/index.d.ts +1 -0
- package/es/Approval/style/index.js +1 -0
- package/es/Form/container.js +17 -1
- package/es/Form/index.d.ts +1 -1
- package/es/Form/index.js +5 -2
- package/es/Form/style/index.css +18 -3
- package/es/LmEditTable/EditTable.d.ts +1 -0
- package/es/LmEditTable/EditTable.js +56 -10
- package/es/LmFilter/components/DropdownFIlter.js +0 -1
- package/es/LmFilter/filterFns/index.js +6 -0
- package/lib/Approval/index.d.ts +24 -0
- package/lib/Approval/index.js +223 -0
- package/lib/Approval/style/index.css +592 -0
- package/lib/Approval/style/index.d.ts +1 -0
- package/lib/Approval/style/index.js +3 -0
- package/lib/Form/container.js +17 -1
- package/lib/Form/index.d.ts +1 -1
- package/lib/Form/index.js +5 -2
- package/lib/Form/style/index.css +18 -3
- package/lib/LmEditTable/EditTable.d.ts +1 -0
- package/lib/LmEditTable/EditTable.js +56 -10
- package/lib/LmFilter/components/DropdownFIlter.js +0 -1
- package/lib/LmFilter/filterFns/index.js +6 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -53,7 +53,7 @@ npm install git+http://git.codefr.com/UFX/UFX.SCM.linkDesign.git --save
|
|
|
53
53
|
```
|
|
54
54
|
├── style // 样式目录
|
|
55
55
|
│ ├──index.js // 负责引入其他样式
|
|
56
|
-
│ ├──
|
|
56
|
+
│ ├── index.less // 主要样式
|
|
57
57
|
│ └── other.less // 其他样式(例如组件子组件样式)
|
|
58
58
|
├── index.js // 组件
|
|
59
59
|
├── demos // 组件调试demo(在README.md中引入)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type VoidFunction = () => void;
|
|
3
|
+
export interface IApprovalItemProps {
|
|
4
|
+
avator?: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
time?: string;
|
|
7
|
+
type?: 'start' | 'comment' | 'carbonCopy' | 'agree' | 'refuse';
|
|
8
|
+
[prop: string]: any;
|
|
9
|
+
}
|
|
10
|
+
export interface IApprovalProps {
|
|
11
|
+
visible?: boolean;
|
|
12
|
+
title?: string;
|
|
13
|
+
close?: () => void;
|
|
14
|
+
className?: string;
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
userType?: 'self' | 'approver';
|
|
17
|
+
status?: number;
|
|
18
|
+
steps?: [];
|
|
19
|
+
onComment: VoidFunction;
|
|
20
|
+
onRefuse: VoidFunction;
|
|
21
|
+
onAgree: VoidFunction;
|
|
22
|
+
}
|
|
23
|
+
declare const LMApproval: React.FC<IApprovalProps>;
|
|
24
|
+
export default LMApproval;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.less';
|
package/dist/Form/index.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ export interface LmFormProps extends FormProps {
|
|
|
7
7
|
responsive?: Boolean;
|
|
8
8
|
}
|
|
9
9
|
export interface LmFormItemProps extends FormItemProps {
|
|
10
|
-
useStatus?: any;
|
|
11
10
|
errorPlacement?: string;
|
|
11
|
+
responsive?: boolean;
|
|
12
12
|
}
|
|
13
13
|
declare const Reform: <Values = any>(props: FormProps<Values> & {
|
|
14
14
|
children?: React.ReactNode;
|
|
@@ -20,6 +20,11 @@ declare function useCoreOptions({ state, dispatch, props }: {
|
|
|
20
20
|
getFilterValue: ({ field, type }: any) => any;
|
|
21
21
|
getFilterQuery: (originData?: any) => {
|
|
22
22
|
basicFilter: {};
|
|
23
|
+
globalQuery: {
|
|
24
|
+
filters: {
|
|
25
|
+
conditions: any[];
|
|
26
|
+
}[];
|
|
27
|
+
};
|
|
23
28
|
filterQuery: {
|
|
24
29
|
filters: {
|
|
25
30
|
conditions: any[];
|
package/dist/index.umd.js
CHANGED
|
@@ -95308,7 +95308,6 @@
|
|
|
95308
95308
|
|
|
95309
95309
|
var classes = classnames(className, prefixCls$c, responsiveCls, lm_col);
|
|
95310
95310
|
return /*#__PURE__*/React__default['default'].createElement("div", _objectSpread(_objectSpread({
|
|
95311
|
-
ref: containerWrapRef,
|
|
95312
95311
|
className: classes
|
|
95313
95312
|
}, others), {}, {
|
|
95314
95313
|
style: {
|
|
@@ -95321,6 +95320,23 @@
|
|
|
95321
95320
|
var changeSize = function changeSize() {
|
|
95322
95321
|
var _containerWrapRef$cur;
|
|
95323
95322
|
|
|
95323
|
+
var index = 1;
|
|
95324
|
+
containerWrapRef.current.querySelectorAll('.ant-form-item').forEach(function (el) {
|
|
95325
|
+
if (el.classList.contains('ant-form-item-responsive')) {
|
|
95326
|
+
if (index % 3 === 0) {
|
|
95327
|
+
el.classList.add('nth-three');
|
|
95328
|
+
} else if (index % 4 === 0) {
|
|
95329
|
+
el.classList.add('nth-four');
|
|
95330
|
+
} else if (index % 5 === 0) {
|
|
95331
|
+
el.classList.add('nth-five');
|
|
95332
|
+
}
|
|
95333
|
+
|
|
95334
|
+
index++;
|
|
95335
|
+
} else {
|
|
95336
|
+
index = 1;
|
|
95337
|
+
}
|
|
95338
|
+
});
|
|
95339
|
+
|
|
95324
95340
|
var _ref = ((_containerWrapRef$cur = containerWrapRef.current) === null || _containerWrapRef$cur === void 0 ? void 0 : _containerWrapRef$cur.getBoundingClientRect()) || {},
|
|
95325
95341
|
_ref$width = _ref.width,
|
|
95326
95342
|
width = _ref$width === void 0 ? '100%' : _ref$width;
|
|
@@ -95352,7 +95368,7 @@
|
|
|
95352
95368
|
};
|
|
95353
95369
|
|
|
95354
95370
|
var _excluded$1t = ["children", "className", "responsive"],
|
|
95355
|
-
_excluded2$n = ["children", "className", "errorPlacement"];
|
|
95371
|
+
_excluded2$n = ["children", "className", "responsive", "errorPlacement"];
|
|
95356
95372
|
|
|
95357
95373
|
var classNamePrefix = 'lm_form';
|
|
95358
95374
|
|
|
@@ -95384,12 +95400,15 @@
|
|
|
95384
95400
|
var LMFormItem = function LMFormItem(props) {
|
|
95385
95401
|
var children = props.children,
|
|
95386
95402
|
className = props.className,
|
|
95403
|
+
_props$responsive = props.responsive,
|
|
95404
|
+
responsive = _props$responsive === void 0 ? false : _props$responsive,
|
|
95387
95405
|
_props$errorPlacement = props.errorPlacement,
|
|
95388
95406
|
errorPlacement = _props$errorPlacement === void 0 ? 'default' : _props$errorPlacement,
|
|
95389
95407
|
restProps = _objectWithoutProperties(props, _excluded2$n);
|
|
95390
95408
|
|
|
95391
95409
|
var tipClassName = errorPlacement === 'default' ? '' : "lm_form-item-tip-error lm_form-item-tip-error-".concat(errorPlacement);
|
|
95392
|
-
var
|
|
95410
|
+
var resCls = responsive ? 'ant-form-item-responsive' : '';
|
|
95411
|
+
var classes = classnames(className, tipClassName, resCls);
|
|
95393
95412
|
return /*#__PURE__*/React__default['default'].createElement(_Form__default['default'].Item, _objectSpread({
|
|
95394
95413
|
className: classes
|
|
95395
95414
|
}, restProps), children);
|
|
@@ -95894,6 +95913,7 @@
|
|
|
95894
95913
|
return ((_option$children = option.children) === null || _option$children === void 0 ? void 0 : (_option$children$toLo = _option$children.toLowerCase()) === null || _option$children$toLo === void 0 ? void 0 : _option$children$toLo.indexOf(input.toLowerCase())) >= 0;
|
|
95895
95914
|
}
|
|
95896
95915
|
}, componentProps), {}, {
|
|
95916
|
+
// open={true}
|
|
95897
95917
|
onChange: handleFormItemChange
|
|
95898
95918
|
}));
|
|
95899
95919
|
|
|
@@ -96292,8 +96312,60 @@
|
|
|
96292
96312
|
setDataSource(res);
|
|
96293
96313
|
}
|
|
96294
96314
|
};
|
|
96315
|
+
/** 判断columne中有没有带optionOnly参数 */
|
|
96316
|
+
|
|
96317
|
+
|
|
96318
|
+
var hasDisableOptions = React.useMemo(function () {
|
|
96319
|
+
var hasOnlyOptionsDatas = columns.filter(function (item) {
|
|
96320
|
+
var _item$componentProps;
|
|
96321
|
+
|
|
96322
|
+
return item === null || item === void 0 ? void 0 : (_item$componentProps = item.componentProps) === null || _item$componentProps === void 0 ? void 0 : _item$componentProps.optionOnly;
|
|
96323
|
+
});
|
|
96324
|
+
|
|
96325
|
+
if (hasOnlyOptionsDatas.length) {
|
|
96326
|
+
return hasOnlyOptionsDatas.map(function (item) {
|
|
96327
|
+
return item.dataIndex;
|
|
96328
|
+
});
|
|
96329
|
+
}
|
|
96330
|
+
|
|
96331
|
+
return false;
|
|
96332
|
+
}, [columns]);
|
|
96333
|
+
/** 动态获取disabled的props数据源 */
|
|
96334
|
+
|
|
96335
|
+
var DisableOptions = React.useMemo(function () {
|
|
96336
|
+
var newColumns = columns === null || columns === void 0 ? void 0 : columns.map(function (item) {
|
|
96337
|
+
var _ref6 = item.componentProps || {},
|
|
96338
|
+
optionOnly = _ref6.optionOnly,
|
|
96339
|
+
options = _ref6.options;
|
|
96340
|
+
|
|
96341
|
+
if (optionOnly && options) {
|
|
96342
|
+
var dataIndex = item.dataIndex;
|
|
96343
|
+
var dataIndexData = dataSource.map(function (d) {
|
|
96344
|
+
return d[dataIndex];
|
|
96345
|
+
});
|
|
96346
|
+
var newOptions = options.map(function (o) {
|
|
96347
|
+
return _objectSpread(_objectSpread({}, o), {}, {
|
|
96348
|
+
disabled: dataIndexData.includes(o === null || o === void 0 ? void 0 : o.value) ? true : false
|
|
96349
|
+
});
|
|
96350
|
+
});
|
|
96351
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
96352
|
+
componentProps: _objectSpread(_objectSpread({}, item.componentProps), {}, {
|
|
96353
|
+
options: newOptions
|
|
96354
|
+
})
|
|
96355
|
+
});
|
|
96356
|
+
} else {
|
|
96357
|
+
return item;
|
|
96358
|
+
}
|
|
96359
|
+
});
|
|
96360
|
+
return newColumns;
|
|
96361
|
+
}, [columns, dataSource]);
|
|
96362
|
+
var memoOptions = React.useMemo(function () {
|
|
96363
|
+
return hasDisableOptions ? [DisableOptions] : [];
|
|
96364
|
+
}, [hasDisableOptions, DisableOptions]);
|
|
96365
|
+
/** 组装之后的最终columns */
|
|
96295
96366
|
|
|
96296
96367
|
var resultColumns = React.useMemo(function () {
|
|
96368
|
+
var rColumns = hasDisableOptions ? DisableOptions : columns;
|
|
96297
96369
|
var localColumns = [sortOpen ? {
|
|
96298
96370
|
title: '',
|
|
96299
96371
|
dataIndex: 'sort',
|
|
@@ -96304,7 +96376,7 @@
|
|
|
96304
96376
|
id: record[_rowKey] || record.id
|
|
96305
96377
|
});
|
|
96306
96378
|
}
|
|
96307
|
-
} : null].concat(_toConsumableArray(
|
|
96379
|
+
} : null].concat(_toConsumableArray(rColumns), [useQuickOpetate ? {
|
|
96308
96380
|
title: '操作',
|
|
96309
96381
|
dataIndex: 'lm_edit_opetate',
|
|
96310
96382
|
width: 68,
|
|
@@ -96345,18 +96417,12 @@
|
|
|
96345
96417
|
shouldCellUpdate: function shouldCellUpdate(record, prevRecord) {
|
|
96346
96418
|
var dataIndex = col.dataIndex;
|
|
96347
96419
|
|
|
96348
|
-
if (col === null || col === void 0 ? void 0 : col.fixed) {
|
|
96420
|
+
if ((col === null || col === void 0 ? void 0 : col.fixed) || hasDisableOptions && hasDisableOptions.includes(dataIndex)) {
|
|
96349
96421
|
return true;
|
|
96350
96422
|
}
|
|
96351
96423
|
|
|
96352
96424
|
return record[dataIndex] === prevRecord[dataIndex] ? false : true;
|
|
96353
96425
|
},
|
|
96354
|
-
// render: (text: string, record: Record<string, any>, index: number) => {
|
|
96355
|
-
// const { editable, render } = record
|
|
96356
|
-
// if (!editable && render) {
|
|
96357
|
-
// return render?.(text, record ,index)
|
|
96358
|
-
// }
|
|
96359
|
-
// },
|
|
96360
96426
|
onCell: function onCell(record) {
|
|
96361
96427
|
return {
|
|
96362
96428
|
getLength: function getLength() {
|
|
@@ -96384,13 +96450,12 @@
|
|
|
96384
96450
|
}
|
|
96385
96451
|
});
|
|
96386
96452
|
});
|
|
96387
|
-
console.log(res, '---res');
|
|
96388
96453
|
return res;
|
|
96389
|
-
}, [columns, isAdd, sortOpen, useQuickOpetate, sortEditTable]);
|
|
96390
|
-
var DraggableContainer = React.useCallback(function (
|
|
96454
|
+
}, [columns, isAdd, sortOpen, useQuickOpetate, sortEditTable, _toConsumableArray(memoOptions)]);
|
|
96455
|
+
var DraggableContainer = React.useCallback(function (_ref7) {
|
|
96391
96456
|
var _dataSourceRef$curren;
|
|
96392
96457
|
|
|
96393
|
-
var props = _extends({},
|
|
96458
|
+
var props = _extends({}, _ref7);
|
|
96394
96459
|
|
|
96395
96460
|
return /*#__PURE__*/React__default['default'].createElement(DndContainer$1, {
|
|
96396
96461
|
move: onSortEnd
|
|
@@ -96400,8 +96465,8 @@
|
|
|
96400
96465
|
})
|
|
96401
96466
|
}, /*#__PURE__*/React__default['default'].createElement("tbody", _objectSpread({}, props))));
|
|
96402
96467
|
}, [sortEditTable]);
|
|
96403
|
-
var colDraggableContainer = React.useCallback(function (
|
|
96404
|
-
var props = _extends({},
|
|
96468
|
+
var colDraggableContainer = React.useCallback(function (_ref8) {
|
|
96469
|
+
var props = _extends({}, _ref8);
|
|
96405
96470
|
|
|
96406
96471
|
return /*#__PURE__*/React__default['default'].createElement("tr", null, React__default['default'].Children.map(props.children, function (child) {
|
|
96407
96472
|
var _child$props, _child$props$column;
|