@pisell/materials 1.0.65 → 1.0.67
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/es/components/table/Table/fields/index.d.ts +29 -0
- package/es/components/table/Table/fields/index.js +5 -2
- package/es/components/table/Table/fields/pSwitch/Config/index.d.ts +3 -0
- package/es/components/table/Table/fields/pSwitch/Config/index.js +4 -0
- package/es/components/table/Table/fields/pSwitch/Edit/index.d.ts +4 -0
- package/es/components/table/Table/fields/pSwitch/Edit/index.js +12 -0
- package/es/components/table/Table/fields/pSwitch/Show/index.d.ts +4 -0
- package/es/components/table/Table/fields/pSwitch/Show/index.js +24 -0
- package/es/components/table/Table/fields/pSwitch/Sort/index.d.ts +3 -0
- package/es/components/table/Table/fields/pSwitch/Sort/index.js +4 -0
- package/es/components/table/Table/fields/pSwitch/index.d.ts +14 -0
- package/es/components/table/Table/fields/pSwitch/index.js +17 -0
- package/es/components/table/Table/fields/types/index.d.ts +2 -1
- package/es/components/table/Table/index.js +2 -1
- package/es/components/table/Table/tableConfig/body/CellProvider/index.js +5 -1
- package/es/components/table/Table/tableConfig/body/index.d.ts +1 -0
- package/es/components/table/Table/tableConfig/body/index.js +2 -1
- package/es/components/table/TableFilter/stringFilter.js +2 -4
- package/lib/components/table/Table/fields/index.d.ts +29 -0
- package/lib/components/table/Table/fields/index.js +5 -2
- package/lib/components/table/Table/fields/pSwitch/Config/index.d.ts +3 -0
- package/lib/components/table/Table/fields/pSwitch/Config/index.js +28 -0
- package/lib/components/table/Table/fields/pSwitch/Edit/index.d.ts +4 -0
- package/lib/components/table/Table/fields/pSwitch/Edit/index.js +41 -0
- package/lib/components/table/Table/fields/pSwitch/Show/index.d.ts +4 -0
- package/lib/components/table/Table/fields/pSwitch/Show/index.js +58 -0
- package/lib/components/table/Table/fields/pSwitch/Sort/index.d.ts +3 -0
- package/lib/components/table/Table/fields/pSwitch/Sort/index.js +28 -0
- package/lib/components/table/Table/fields/pSwitch/index.d.ts +14 -0
- package/lib/components/table/Table/fields/pSwitch/index.js +51 -0
- package/lib/components/table/Table/fields/types/index.d.ts +2 -1
- package/lib/components/table/Table/index.js +2 -1
- package/lib/components/table/Table/tableConfig/body/CellProvider/index.js +5 -1
- package/lib/components/table/Table/tableConfig/body/index.d.ts +1 -0
- package/lib/components/table/Table/tableConfig/body/index.js +1 -0
- package/lib/components/table/TableFilter/stringFilter.js +2 -4
- package/package.json +2 -2
|
@@ -96,6 +96,18 @@ export declare const fieldMaps: {
|
|
|
96
96
|
sort: () => JSX.Element;
|
|
97
97
|
show: (props: import("./types").FieldPropsType) => JSX.Element;
|
|
98
98
|
};
|
|
99
|
+
pSwitch: {
|
|
100
|
+
field: {
|
|
101
|
+
field_icon: string;
|
|
102
|
+
field_name: string;
|
|
103
|
+
field_type: string;
|
|
104
|
+
default_value: boolean;
|
|
105
|
+
};
|
|
106
|
+
config: () => JSX.Element;
|
|
107
|
+
edit: import("react").ForwardRefExoticComponent<Omit<import("./types").EditPropsType, "ref"> & import("react").RefAttributes<any>>;
|
|
108
|
+
sort: () => JSX.Element;
|
|
109
|
+
show: (props: import("./types").FieldPropsType) => JSX.Element;
|
|
110
|
+
};
|
|
99
111
|
};
|
|
100
112
|
export declare const fieldList: ({
|
|
101
113
|
field_icon: string;
|
|
@@ -137,6 +149,11 @@ export declare const fieldList: ({
|
|
|
137
149
|
field_name: string;
|
|
138
150
|
field_type: string;
|
|
139
151
|
default_value: string;
|
|
152
|
+
} | {
|
|
153
|
+
field_icon: string;
|
|
154
|
+
field_name: string;
|
|
155
|
+
field_type: string;
|
|
156
|
+
default_value: boolean;
|
|
140
157
|
})[];
|
|
141
158
|
export declare const getFieldByType: (type: string) => {
|
|
142
159
|
field: {
|
|
@@ -247,5 +264,17 @@ declare const _default: {
|
|
|
247
264
|
sort: () => JSX.Element;
|
|
248
265
|
show: (props: import("./types").FieldPropsType) => JSX.Element;
|
|
249
266
|
};
|
|
267
|
+
pSwitch: {
|
|
268
|
+
field: {
|
|
269
|
+
field_icon: string;
|
|
270
|
+
field_name: string;
|
|
271
|
+
field_type: string;
|
|
272
|
+
default_value: boolean;
|
|
273
|
+
};
|
|
274
|
+
config: () => JSX.Element;
|
|
275
|
+
edit: import("react").ForwardRefExoticComponent<Omit<import("./types").EditPropsType, "ref"> & import("react").RefAttributes<any>>;
|
|
276
|
+
sort: () => JSX.Element;
|
|
277
|
+
show: (props: import("./types").FieldPropsType) => JSX.Element;
|
|
278
|
+
};
|
|
250
279
|
};
|
|
251
280
|
export default _default;
|
|
@@ -6,6 +6,7 @@ import text from "./text";
|
|
|
6
6
|
import image from "./image";
|
|
7
7
|
import rangePicker from "./rangePicker";
|
|
8
8
|
import search from "./search";
|
|
9
|
+
import pSwitch from "./pSwitch";
|
|
9
10
|
export var fieldMaps = {
|
|
10
11
|
text: text,
|
|
11
12
|
link: link,
|
|
@@ -14,7 +15,8 @@ export var fieldMaps = {
|
|
|
14
15
|
select: select,
|
|
15
16
|
image: image,
|
|
16
17
|
rangePicker: rangePicker,
|
|
17
|
-
search: search
|
|
18
|
+
search: search,
|
|
19
|
+
pSwitch: pSwitch
|
|
18
20
|
};
|
|
19
21
|
export var fieldList = Object.values(fieldMaps).map(function (d) {
|
|
20
22
|
return d.field;
|
|
@@ -30,5 +32,6 @@ export default {
|
|
|
30
32
|
select: select,
|
|
31
33
|
image: image,
|
|
32
34
|
rangePicker: rangePicker,
|
|
33
|
-
search: search
|
|
35
|
+
search: search,
|
|
36
|
+
pSwitch: pSwitch
|
|
34
37
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
var Edit = function Edit(props, ref) {
|
|
4
|
+
var value = props.value,
|
|
5
|
+
onChange = props.onChange,
|
|
6
|
+
onPressEnter = props.onPressEnter,
|
|
7
|
+
onBlur = props.onBlur,
|
|
8
|
+
style = props.style,
|
|
9
|
+
bordered = props.bordered;
|
|
10
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
11
|
+
};
|
|
12
|
+
export default /*#__PURE__*/forwardRef(Edit);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var _excluded = ["title", "editable", "dataIndex", "field_type", "record", "handleSave", "onChange"];
|
|
2
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
3
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
|
+
import { Switch } from "antd";
|
|
5
|
+
import React from "react";
|
|
6
|
+
var Show = function Show(props) {
|
|
7
|
+
var title = props.title,
|
|
8
|
+
editable = props.editable,
|
|
9
|
+
dataIndex = props.dataIndex,
|
|
10
|
+
field_type = props.field_type,
|
|
11
|
+
record = props.record,
|
|
12
|
+
handleSave = props.handleSave,
|
|
13
|
+
_onChange = props.onChange,
|
|
14
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
15
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
className: ""
|
|
17
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
18
|
+
checked: record[dataIndex],
|
|
19
|
+
onChange: function onChange(e) {
|
|
20
|
+
_onChange && _onChange(e, record);
|
|
21
|
+
}
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
export default Show;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const _default: {
|
|
3
|
+
field: {
|
|
4
|
+
field_icon: string;
|
|
5
|
+
field_name: string;
|
|
6
|
+
field_type: string;
|
|
7
|
+
default_value: boolean;
|
|
8
|
+
};
|
|
9
|
+
config: () => JSX.Element;
|
|
10
|
+
edit: import("react").ForwardRefExoticComponent<Omit<import("../types").EditPropsType, "ref"> & import("react").RefAttributes<any>>;
|
|
11
|
+
sort: () => JSX.Element;
|
|
12
|
+
show: (props: import("../types").FieldPropsType) => JSX.Element;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Config from "./Config";
|
|
2
|
+
import Edit from "./Edit";
|
|
3
|
+
import Show from "./Show";
|
|
4
|
+
import Sort from "./Sort";
|
|
5
|
+
var field = {
|
|
6
|
+
field_icon: "pi-a-Property3Singlelinetext",
|
|
7
|
+
field_name: "Switch",
|
|
8
|
+
field_type: "pSwitch",
|
|
9
|
+
default_value: false
|
|
10
|
+
};
|
|
11
|
+
export default {
|
|
12
|
+
field: field,
|
|
13
|
+
config: Config,
|
|
14
|
+
edit: Edit,
|
|
15
|
+
sort: Sort,
|
|
16
|
+
show: Show
|
|
17
|
+
};
|
|
@@ -10,8 +10,9 @@ export declare type FieldPropsType = {
|
|
|
10
10
|
label: string;
|
|
11
11
|
}[];
|
|
12
12
|
handleSave: () => void;
|
|
13
|
+
onChange: (value: any, record: any) => void;
|
|
13
14
|
};
|
|
14
|
-
export declare type FieldType =
|
|
15
|
+
export declare type FieldType = "text" | "image";
|
|
15
16
|
export declare type EditPropsType = {
|
|
16
17
|
value: any;
|
|
17
18
|
onChange: (v: any) => void;
|
|
@@ -29,7 +29,11 @@ var CellProvider = function CellProvider(props) {
|
|
|
29
29
|
dataIndex = props.dataIndex,
|
|
30
30
|
field_type = props.field_type,
|
|
31
31
|
record = props.record,
|
|
32
|
-
handleSave = props.handleSave
|
|
32
|
+
handleSave = props.handleSave,
|
|
33
|
+
render = props.render;
|
|
34
|
+
if (render) {
|
|
35
|
+
return children;
|
|
36
|
+
}
|
|
33
37
|
var _useState = useState(false),
|
|
34
38
|
_useState2 = _slicedToArray(_useState, 2),
|
|
35
39
|
editing = _useState2[0],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var _excluded = ["index"],
|
|
2
|
-
_excluded2 = ["title", "editable", "children", "dataIndex", "field_type", "record", "handleSave", "lock"];
|
|
2
|
+
_excluded2 = ["title", "editable", "children", "dataIndex", "field_type", "record", "handleSave", "lock", "render"];
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5
5
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -37,6 +37,7 @@ var EditableCell = function EditableCell(props) {
|
|
|
37
37
|
record = props.record,
|
|
38
38
|
handleSave = props.handleSave,
|
|
39
39
|
lock = props.lock,
|
|
40
|
+
render = props.render,
|
|
40
41
|
restProps = _objectWithoutProperties(props, _excluded2);
|
|
41
42
|
return /*#__PURE__*/React.createElement("td", _extends({}, restProps, {
|
|
42
43
|
className: classNames(restProps.className, "ant-table-cell", "materials-grid-table-cell")
|
|
@@ -41,15 +41,13 @@ var getColumnStringProps = function getColumnStringProps(_ref) {
|
|
|
41
41
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
42
42
|
onClick: function onClick() {
|
|
43
43
|
clearFilters && clearFilters();
|
|
44
|
-
confirm(
|
|
45
|
-
closeDropdown: false
|
|
46
|
-
});
|
|
44
|
+
confirm();
|
|
47
45
|
},
|
|
48
46
|
block: true,
|
|
49
47
|
style: {
|
|
50
48
|
flex: 1
|
|
51
49
|
}
|
|
52
|
-
}, "
|
|
50
|
+
}, "Clear"), /*#__PURE__*/React.createElement(Button, {
|
|
53
51
|
type: "primary",
|
|
54
52
|
onClick: function onClick() {
|
|
55
53
|
return confirm();
|
|
@@ -96,6 +96,18 @@ export declare const fieldMaps: {
|
|
|
96
96
|
sort: () => JSX.Element;
|
|
97
97
|
show: (props: import("./types").FieldPropsType) => JSX.Element;
|
|
98
98
|
};
|
|
99
|
+
pSwitch: {
|
|
100
|
+
field: {
|
|
101
|
+
field_icon: string;
|
|
102
|
+
field_name: string;
|
|
103
|
+
field_type: string;
|
|
104
|
+
default_value: boolean;
|
|
105
|
+
};
|
|
106
|
+
config: () => JSX.Element;
|
|
107
|
+
edit: import("react").ForwardRefExoticComponent<Omit<import("./types").EditPropsType, "ref"> & import("react").RefAttributes<any>>;
|
|
108
|
+
sort: () => JSX.Element;
|
|
109
|
+
show: (props: import("./types").FieldPropsType) => JSX.Element;
|
|
110
|
+
};
|
|
99
111
|
};
|
|
100
112
|
export declare const fieldList: ({
|
|
101
113
|
field_icon: string;
|
|
@@ -137,6 +149,11 @@ export declare const fieldList: ({
|
|
|
137
149
|
field_name: string;
|
|
138
150
|
field_type: string;
|
|
139
151
|
default_value: string;
|
|
152
|
+
} | {
|
|
153
|
+
field_icon: string;
|
|
154
|
+
field_name: string;
|
|
155
|
+
field_type: string;
|
|
156
|
+
default_value: boolean;
|
|
140
157
|
})[];
|
|
141
158
|
export declare const getFieldByType: (type: string) => {
|
|
142
159
|
field: {
|
|
@@ -247,5 +264,17 @@ declare const _default: {
|
|
|
247
264
|
sort: () => JSX.Element;
|
|
248
265
|
show: (props: import("./types").FieldPropsType) => JSX.Element;
|
|
249
266
|
};
|
|
267
|
+
pSwitch: {
|
|
268
|
+
field: {
|
|
269
|
+
field_icon: string;
|
|
270
|
+
field_name: string;
|
|
271
|
+
field_type: string;
|
|
272
|
+
default_value: boolean;
|
|
273
|
+
};
|
|
274
|
+
config: () => JSX.Element;
|
|
275
|
+
edit: import("react").ForwardRefExoticComponent<Omit<import("./types").EditPropsType, "ref"> & import("react").RefAttributes<any>>;
|
|
276
|
+
sort: () => JSX.Element;
|
|
277
|
+
show: (props: import("./types").FieldPropsType) => JSX.Element;
|
|
278
|
+
};
|
|
250
279
|
};
|
|
251
280
|
export default _default;
|
|
@@ -43,6 +43,7 @@ var import_text = __toESM(require("./text"));
|
|
|
43
43
|
var import_image = __toESM(require("./image"));
|
|
44
44
|
var import_rangePicker = __toESM(require("./rangePicker"));
|
|
45
45
|
var import_search = __toESM(require("./search"));
|
|
46
|
+
var import_pSwitch = __toESM(require("./pSwitch"));
|
|
46
47
|
var fieldMaps = {
|
|
47
48
|
text: import_text.default,
|
|
48
49
|
link: import_link.default,
|
|
@@ -51,7 +52,8 @@ var fieldMaps = {
|
|
|
51
52
|
select: import_select.default,
|
|
52
53
|
image: import_image.default,
|
|
53
54
|
rangePicker: import_rangePicker.default,
|
|
54
|
-
search: import_search.default
|
|
55
|
+
search: import_search.default,
|
|
56
|
+
pSwitch: import_pSwitch.default
|
|
55
57
|
};
|
|
56
58
|
var fieldList = Object.values(fieldMaps).map((d) => {
|
|
57
59
|
return d.field;
|
|
@@ -67,7 +69,8 @@ var fields_default = {
|
|
|
67
69
|
select: import_select.default,
|
|
68
70
|
image: import_image.default,
|
|
69
71
|
rangePicker: import_rangePicker.default,
|
|
70
|
-
search: import_search.default
|
|
72
|
+
search: import_search.default,
|
|
73
|
+
pSwitch: import_pSwitch.default
|
|
71
74
|
};
|
|
72
75
|
// Annotate the CommonJS export names for ESM import in node:
|
|
73
76
|
0 && (module.exports = {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/table/Table/fields/pSwitch/Config/index.tsx
|
|
20
|
+
var Config_exports = {};
|
|
21
|
+
__export(Config_exports, {
|
|
22
|
+
default: () => Config_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(Config_exports);
|
|
25
|
+
var Config = () => {
|
|
26
|
+
return /* @__PURE__ */ React.createElement("div", null);
|
|
27
|
+
};
|
|
28
|
+
var Config_default = Config;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/table/Table/fields/pSwitch/Edit/index.tsx
|
|
30
|
+
var Edit_exports = {};
|
|
31
|
+
__export(Edit_exports, {
|
|
32
|
+
default: () => Edit_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Edit_exports);
|
|
35
|
+
var import_react = require("react");
|
|
36
|
+
var import_react2 = __toESM(require("react"));
|
|
37
|
+
var Edit = (props, ref) => {
|
|
38
|
+
const { value, onChange, onPressEnter, onBlur, style, bordered } = props;
|
|
39
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null);
|
|
40
|
+
};
|
|
41
|
+
var Edit_default = (0, import_react.forwardRef)(Edit);
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/table/Table/fields/pSwitch/Show/index.tsx
|
|
30
|
+
var Show_exports = {};
|
|
31
|
+
__export(Show_exports, {
|
|
32
|
+
default: () => Show_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Show_exports);
|
|
35
|
+
var import_antd = require("antd");
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var Show = (props) => {
|
|
38
|
+
const {
|
|
39
|
+
title,
|
|
40
|
+
editable,
|
|
41
|
+
dataIndex,
|
|
42
|
+
field_type,
|
|
43
|
+
record,
|
|
44
|
+
handleSave,
|
|
45
|
+
onChange,
|
|
46
|
+
...restProps
|
|
47
|
+
} = props;
|
|
48
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "" }, /* @__PURE__ */ import_react.default.createElement(
|
|
49
|
+
import_antd.Switch,
|
|
50
|
+
{
|
|
51
|
+
checked: record[dataIndex],
|
|
52
|
+
onChange: (e) => {
|
|
53
|
+
onChange && onChange(e, record);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
));
|
|
57
|
+
};
|
|
58
|
+
var Show_default = Show;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/table/Table/fields/pSwitch/Sort/index.tsx
|
|
20
|
+
var Sort_exports = {};
|
|
21
|
+
__export(Sort_exports, {
|
|
22
|
+
default: () => Sort_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(Sort_exports);
|
|
25
|
+
var Sort = () => {
|
|
26
|
+
return /* @__PURE__ */ React.createElement("div", null);
|
|
27
|
+
};
|
|
28
|
+
var Sort_default = Sort;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const _default: {
|
|
3
|
+
field: {
|
|
4
|
+
field_icon: string;
|
|
5
|
+
field_name: string;
|
|
6
|
+
field_type: string;
|
|
7
|
+
default_value: boolean;
|
|
8
|
+
};
|
|
9
|
+
config: () => JSX.Element;
|
|
10
|
+
edit: import("react").ForwardRefExoticComponent<Omit<import("../types").EditPropsType, "ref"> & import("react").RefAttributes<any>>;
|
|
11
|
+
sort: () => JSX.Element;
|
|
12
|
+
show: (props: import("../types").FieldPropsType) => JSX.Element;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/table/Table/fields/pSwitch/index.tsx
|
|
30
|
+
var pSwitch_exports = {};
|
|
31
|
+
__export(pSwitch_exports, {
|
|
32
|
+
default: () => pSwitch_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(pSwitch_exports);
|
|
35
|
+
var import_Config = __toESM(require("./Config"));
|
|
36
|
+
var import_Edit = __toESM(require("./Edit"));
|
|
37
|
+
var import_Show = __toESM(require("./Show"));
|
|
38
|
+
var import_Sort = __toESM(require("./Sort"));
|
|
39
|
+
var field = {
|
|
40
|
+
field_icon: "pi-a-Property3Singlelinetext",
|
|
41
|
+
field_name: "Switch",
|
|
42
|
+
field_type: "pSwitch",
|
|
43
|
+
default_value: false
|
|
44
|
+
};
|
|
45
|
+
var pSwitch_default = {
|
|
46
|
+
field,
|
|
47
|
+
config: import_Config.default,
|
|
48
|
+
edit: import_Edit.default,
|
|
49
|
+
sort: import_Sort.default,
|
|
50
|
+
show: import_Show.default
|
|
51
|
+
};
|
|
@@ -10,8 +10,9 @@ export declare type FieldPropsType = {
|
|
|
10
10
|
label: string;
|
|
11
11
|
}[];
|
|
12
12
|
handleSave: () => void;
|
|
13
|
+
onChange: (value: any, record: any) => void;
|
|
13
14
|
};
|
|
14
|
-
export declare type FieldType =
|
|
15
|
+
export declare type FieldType = "text" | "image";
|
|
15
16
|
export declare type EditPropsType = {
|
|
16
17
|
value: any;
|
|
17
18
|
onChange: (v: any) => void;
|
|
@@ -49,8 +49,12 @@ var CellProvider = (props) => {
|
|
|
49
49
|
dataIndex,
|
|
50
50
|
field_type,
|
|
51
51
|
record,
|
|
52
|
-
handleSave
|
|
52
|
+
handleSave,
|
|
53
|
+
render
|
|
53
54
|
} = props;
|
|
55
|
+
if (render) {
|
|
56
|
+
return children;
|
|
57
|
+
}
|
|
54
58
|
const [editing, setEditing] = (0, import_react.useState)(false);
|
|
55
59
|
const inputRef = (0, import_react.useRef)(null);
|
|
56
60
|
const form = (0, import_hooks.useSharedState)(import__.EditableContext);
|
|
@@ -73,14 +73,12 @@ var getColumnStringProps = ({
|
|
|
73
73
|
{
|
|
74
74
|
onClick: () => {
|
|
75
75
|
clearFilters && clearFilters();
|
|
76
|
-
confirm(
|
|
77
|
-
closeDropdown: false
|
|
78
|
-
});
|
|
76
|
+
confirm();
|
|
79
77
|
},
|
|
80
78
|
block: true,
|
|
81
79
|
style: { flex: 1 }
|
|
82
80
|
},
|
|
83
|
-
"
|
|
81
|
+
"Clear"
|
|
84
82
|
),
|
|
85
83
|
/* @__PURE__ */ import_react.default.createElement(
|
|
86
84
|
import_antd.Button,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.67",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"@dnd-kit/sortable": "^7.0.2",
|
|
55
55
|
"@dnd-kit/utilities": "^3.2.1",
|
|
56
56
|
"ahooks": "^3.7.6",
|
|
57
|
+
"@pisell/utils": "1.0.4",
|
|
57
58
|
"@pisell/icon": "0.0.8",
|
|
58
|
-
"@pisell/utils": "1.0.3",
|
|
59
59
|
"@pisell/date-picker": "1.0.23"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|