@zhenliang/sheet 0.1.3 → 0.1.4
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SheetType } from "../../../type";
|
|
2
|
+
import { SelectProps } from 'antd';
|
|
2
3
|
import 'antd/es/select/style/index.css';
|
|
3
4
|
import './index.less';
|
|
4
|
-
export declare const getSelectEditor: (options: SheetType.Options[], valueKey?: string, extra?: React.ReactNode) => SheetType.CellEditor;
|
|
5
|
+
export declare const getSelectEditor: (options: SheetType.Options[], valueKey?: string, extra?: React.ReactNode, selectProps?: Partial<SelectProps>) => SheetType.CellEditor;
|
|
5
6
|
export default getSelectEditor;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
1
7
|
/* eslint-disable eqeqeq */
|
|
2
8
|
|
|
3
9
|
import { Select } from 'antd';
|
|
@@ -10,6 +16,7 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
10
16
|
export var getSelectEditor = function getSelectEditor(options) {
|
|
11
17
|
var valueKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'value';
|
|
12
18
|
var extra = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : /*#__PURE__*/_jsx(_Fragment, {});
|
|
19
|
+
var selectProps = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
13
20
|
var SelectEditor = function SelectEditor(props) {
|
|
14
21
|
var value = props.value,
|
|
15
22
|
onConfirm = props.onConfirm;
|
|
@@ -28,7 +35,7 @@ export var getSelectEditor = function getSelectEditor(options) {
|
|
|
28
35
|
children: [menu, extra]
|
|
29
36
|
});
|
|
30
37
|
};
|
|
31
|
-
return /*#__PURE__*/_jsx(Select, {
|
|
38
|
+
return /*#__PURE__*/_jsx(Select, _objectSpread(_objectSpread({}, selectProps), {}, {
|
|
32
39
|
autoFocus: true,
|
|
33
40
|
className: "select-editor",
|
|
34
41
|
defaultOpen: true,
|
|
@@ -43,7 +50,7 @@ export var getSelectEditor = function getSelectEditor(options) {
|
|
|
43
50
|
options: options,
|
|
44
51
|
popupClassName: 'excelTablePopupClassName',
|
|
45
52
|
dropdownRender: dropdown
|
|
46
|
-
});
|
|
53
|
+
}));
|
|
47
54
|
};
|
|
48
55
|
SelectEditor.checker = function (value) {
|
|
49
56
|
if (isNil(value)) return true;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { SheetType } from "../../type";
|
|
3
2
|
import './draggableShell/index.less';
|
|
4
3
|
export declare const TableShell: ({ columns, className, showGroup, showSelect, controlProps, controlWidth, }: SheetType.SheetShell) => import("react").FC<{
|