@pisell/materials 1.0.261 → 1.0.263
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.js +4 -4
- package/build/lowcode/view.js +4 -4
- package/es/components/auto-complete-number/index.d.ts +10 -0
- package/es/components/auto-complete-number/index.js +28 -0
- package/es/components/picker-view/index.d.ts +2 -0
- package/es/components/picker-view/index.js +2 -0
- package/es/components/sort/index.js +1 -1
- package/es/components/sort/types.d.ts +1 -0
- package/es/components/table/Gallery/index.js +6 -2
- package/es/components/table/Gallery/types.d.ts +2 -1
- package/es/components/table/Table/fields/rangePicker/Edit/index.js +8 -7
- package/es/components/table/Table/index.js +6 -2
- package/es/components/table/View/index.js +7 -4
- package/es/components/table/hooks/useTransSortSetting.js +4 -1
- package/es/components/table/hooks/useTriggerValuesChange.js +24 -2
- package/es/components/table/types.d.ts +5 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/es/locales/en-US.d.ts +7 -0
- package/es/locales/en-US.js +8 -1
- package/es/locales/zh-CN.d.ts +7 -0
- package/es/locales/zh-CN.js +8 -1
- package/es/locales/zh-TW.d.ts +7 -0
- package/es/locales/zh-TW.js +8 -1
- package/lib/components/auto-complete-number/index.d.ts +10 -0
- package/lib/components/auto-complete-number/index.js +48 -0
- package/lib/components/picker-view/index.d.ts +2 -0
- package/lib/components/picker-view/index.js +36 -0
- package/lib/components/sort/index.js +1 -1
- package/lib/components/sort/types.d.ts +1 -0
- package/lib/components/table/Gallery/index.js +4 -1
- package/lib/components/table/Gallery/types.d.ts +2 -1
- package/lib/components/table/Table/fields/rangePicker/Edit/index.js +8 -7
- package/lib/components/table/Table/index.js +4 -1
- package/lib/components/table/View/index.js +12 -2
- package/lib/components/table/hooks/useTransSortSetting.js +3 -1
- package/lib/components/table/hooks/useTriggerValuesChange.js +18 -3
- package/lib/components/table/types.d.ts +5 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -0
- package/lib/locales/en-US.d.ts +7 -0
- package/lib/locales/en-US.js +8 -1
- package/lib/locales/zh-CN.d.ts +7 -0
- package/lib/locales/zh-CN.js +8 -1
- package/lib/locales/zh-TW.d.ts +7 -0
- package/lib/locales/zh-TW.js +8 -1
- package/lowcode/table/meta.ts +4 -0
- package/package.json +2 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { AutoCompleteProps, InputNumberProps } from "antd";
|
|
3
|
+
interface AutoCompleteNumberProps {
|
|
4
|
+
autoCompleteProps: AutoCompleteProps;
|
|
5
|
+
inputNumberProps: InputNumberProps;
|
|
6
|
+
value?: any;
|
|
7
|
+
onChange?: any;
|
|
8
|
+
}
|
|
9
|
+
declare const AutoCompleteNumber: (props: AutoCompleteNumberProps) => React.JSX.Element;
|
|
10
|
+
export default AutoCompleteNumber;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var _excluded = ["autoCompleteProps", "inputNumberProps"];
|
|
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
|
+
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); }
|
|
5
|
+
import React, { forwardRef } from "react";
|
|
6
|
+
import { AutoComplete, InputNumber as AntdInputNumber } from "antd";
|
|
7
|
+
var InputNumber = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
8
|
+
var onChange = function onChange(e) {
|
|
9
|
+
// 转换格式, AutoComplete缺陷, 只识别 e.target.value的值
|
|
10
|
+
var _val = e === null || e === undefined ? "" : e + "";
|
|
11
|
+
props.onChange && props.onChange({
|
|
12
|
+
target: {
|
|
13
|
+
value: _val
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
return /*#__PURE__*/React.createElement(AntdInputNumber, _extends({}, props, {
|
|
18
|
+
onChange: onChange,
|
|
19
|
+
ref: ref
|
|
20
|
+
}));
|
|
21
|
+
});
|
|
22
|
+
var AutoCompleteNumber = function AutoCompleteNumber(props) {
|
|
23
|
+
var autoCompleteProps = props.autoCompleteProps,
|
|
24
|
+
inputNumberProps = props.inputNumberProps,
|
|
25
|
+
resetProps = _objectWithoutProperties(props, _excluded);
|
|
26
|
+
return /*#__PURE__*/React.createElement(AutoComplete, _extends({}, resetProps, autoCompleteProps), /*#__PURE__*/React.createElement(InputNumber, inputNumberProps));
|
|
27
|
+
};
|
|
28
|
+
export default AutoCompleteNumber;
|
|
@@ -86,7 +86,7 @@ var Sort = function Sort(_ref2) {
|
|
|
86
86
|
return {
|
|
87
87
|
key: d.name,
|
|
88
88
|
label: d.label,
|
|
89
|
-
children: sortChildrenMap[d.type](d.name, !!
|
|
89
|
+
children: sortChildrenMap[d.type](d.name, !!(d !== null && d !== void 0 && d.localFilter)),
|
|
90
90
|
popupClassName: "".concat(prefix, "sort-sub-menu-popup-wrap")
|
|
91
91
|
};
|
|
92
92
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { memo, useCallback, useMemo } from "react";
|
|
1
|
+
import React, { memo, useCallback, useEffect, useMemo } from "react";
|
|
2
2
|
import { Form, Spin } from "antd";
|
|
3
3
|
import { isFunction } from "@pisell/utils";
|
|
4
4
|
import useTransDataSource from "../hooks/useTransDataSource";
|
|
@@ -14,7 +14,8 @@ var Gallery = function Gallery(props) {
|
|
|
14
14
|
filter = props.filter,
|
|
15
15
|
pagination = props.pagination,
|
|
16
16
|
rowKey = props.rowKey,
|
|
17
|
-
loading = props.loading
|
|
17
|
+
loading = props.loading,
|
|
18
|
+
onDataSourceChange = props.onDataSourceChange;
|
|
18
19
|
var _ref = gallery || {},
|
|
19
20
|
horizontalGutter = _ref.horizontalGutter,
|
|
20
21
|
verticalGutter = _ref.verticalGutter,
|
|
@@ -47,6 +48,9 @@ var Gallery = function Gallery(props) {
|
|
|
47
48
|
rowKey: rowKey,
|
|
48
49
|
filter: filter
|
|
49
50
|
});
|
|
51
|
+
useEffect(function () {
|
|
52
|
+
onDataSourceChange === null || onDataSourceChange === void 0 ? void 0 : onDataSourceChange(dataSource);
|
|
53
|
+
}, [JSON.stringify(dataSource)]);
|
|
50
54
|
var columnsMap = useMemo(function () {
|
|
51
55
|
return new Map(originColumns.map(function (item) {
|
|
52
56
|
return [item.key, item];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GallerySettingType } from "../types";
|
|
1
|
+
import { GallerySettingType, GridViewProps } from "../types";
|
|
2
2
|
import { FilterType } from "../../filter/types";
|
|
3
3
|
export declare type GalleryProps = {
|
|
4
4
|
gallery: GallerySettingType;
|
|
@@ -6,4 +6,5 @@ export declare type GalleryProps = {
|
|
|
6
6
|
pagination: any;
|
|
7
7
|
rowKey: ((record: Record<string, any>) => string) | string;
|
|
8
8
|
loading: boolean;
|
|
9
|
+
onDataSourceChange: GridViewProps['onDataSourceChange'];
|
|
9
10
|
};
|
|
@@ -12,6 +12,7 @@ import { isArr, isBoolean, isString } from "@pisell/utils";
|
|
|
12
12
|
import dayjs from "dayjs";
|
|
13
13
|
import React, { forwardRef, useMemo } from "react";
|
|
14
14
|
import DatePicker from "../../../../../date-picker";
|
|
15
|
+
import { getText } from "../../../../../../locales";
|
|
15
16
|
var RangePicker = DatePicker.RangePicker;
|
|
16
17
|
var defaultFormat = "YYYY-MM-DD HH:mm:ss";
|
|
17
18
|
var Edit = function Edit(props, ref) {
|
|
@@ -42,25 +43,25 @@ var Edit = function Edit(props, ref) {
|
|
|
42
43
|
return value;
|
|
43
44
|
}, [value]);
|
|
44
45
|
var rangePresets = [{
|
|
45
|
-
label: "
|
|
46
|
+
label: getText("table-action-range-picker-presets-today"),
|
|
46
47
|
value: [dayjs().startOf("day"), dayjs().endOf("day")]
|
|
47
48
|
}, {
|
|
48
|
-
label: "
|
|
49
|
+
label: getText("table-action-range-picker-presets-yesterday"),
|
|
49
50
|
value: [dayjs().add(-1, "d").startOf("day"), dayjs().add(-1, "d").endOf("day")]
|
|
50
51
|
}, {
|
|
51
|
-
label: "
|
|
52
|
+
label: getText("table-action-range-picker-presets-last-3-day"),
|
|
52
53
|
value: [dayjs().add(-3, "d").startOf("day"), dayjs().endOf("day")]
|
|
53
54
|
}, {
|
|
54
|
-
label: "
|
|
55
|
+
label: getText("table-action-range-picker-presets-last-7-day"),
|
|
55
56
|
value: [dayjs().add(-7, "d").startOf("day"), dayjs().endOf("day")]
|
|
56
57
|
}, {
|
|
57
|
-
label: "
|
|
58
|
+
label: getText("table-action-range-picker-presets-last-14-day"),
|
|
58
59
|
value: [dayjs().add(-14, "d").startOf("day"), dayjs().endOf("day")]
|
|
59
60
|
}, {
|
|
60
|
-
label: "
|
|
61
|
+
label: getText("table-action-range-picker-presets-last-30-day"),
|
|
61
62
|
value: [dayjs().add(-30, "d").startOf("day"), dayjs().endOf("day")]
|
|
62
63
|
}, {
|
|
63
|
-
label: "
|
|
64
|
+
label: getText("table-action-range-picker-presets-last-90-day"),
|
|
64
65
|
value: [dayjs().add(-90, "d").startOf("day"), dayjs().endOf("day")]
|
|
65
66
|
}];
|
|
66
67
|
var _showTime = useMemo(function () {
|
|
@@ -11,7 +11,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
11
11
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
12
12
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
13
13
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
14
|
-
import React, { memo, useCallback, useMemo, useRef } from "react";
|
|
14
|
+
import React, { memo, useCallback, useEffect, useMemo, useRef } from "react";
|
|
15
15
|
import { Form } from "antd";
|
|
16
16
|
// import { Access } from '@umijs/max';
|
|
17
17
|
import { useMemoizedFn, useSize } from "ahooks";
|
|
@@ -31,7 +31,8 @@ var GridViewTable = function GridViewTable(_ref) {
|
|
|
31
31
|
var _tableProps$paginatio, _tableProps$paginatio2;
|
|
32
32
|
var tableProps = _ref.tableProps,
|
|
33
33
|
filter = _ref.filter,
|
|
34
|
-
setTableSetting = _ref.setTableSetting
|
|
34
|
+
setTableSetting = _ref.setTableSetting,
|
|
35
|
+
onDataSourceChange = _ref.onDataSourceChange;
|
|
35
36
|
var responsive = useResponsive();
|
|
36
37
|
var _useSharedState = useSharedState(Context),
|
|
37
38
|
state = _useSharedState.state,
|
|
@@ -85,6 +86,9 @@ var GridViewTable = function GridViewTable(_ref) {
|
|
|
85
86
|
rowKey: tableProps.rowKey,
|
|
86
87
|
filter: filter
|
|
87
88
|
});
|
|
89
|
+
useEffect(function () {
|
|
90
|
+
onDataSourceChange === null || onDataSourceChange === void 0 ? void 0 : onDataSourceChange(dataSource);
|
|
91
|
+
}, [JSON.stringify(dataSource)]);
|
|
88
92
|
var components = useGenTableComponents({
|
|
89
93
|
form: form
|
|
90
94
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var _excluded = ["dataSource", "columns", "dispatch", "style", "filter", "sort", "buttons", "actionButtons", "title", "summary", "onValuesChange", "columnSetting", "dataSourceGroup", "view", "gallery", "setTableSetting"];
|
|
1
|
+
var _excluded = ["dataSource", "columns", "dispatch", "style", "filter", "sort", "buttons", "actionButtons", "title", "summary", "onValuesChange", "columnSetting", "dataSourceGroup", "view", "gallery", "setTableSetting", "onDataSourceChange"];
|
|
2
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
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
4
|
import React from "react";
|
|
5
|
-
import { Form } from
|
|
5
|
+
import { Form } from "antd";
|
|
6
6
|
import GridViewTable from "../Table";
|
|
7
7
|
import Gallery from "../Gallery";
|
|
8
8
|
var View = function View(props) {
|
|
@@ -22,6 +22,7 @@ var View = function View(props) {
|
|
|
22
22
|
view = props.view,
|
|
23
23
|
gallery = props.gallery,
|
|
24
24
|
setTableSetting = props.setTableSetting,
|
|
25
|
+
onDataSourceChange = props.onDataSourceChange,
|
|
25
26
|
other = _objectWithoutProperties(props, _excluded);
|
|
26
27
|
var form = Form.useFormInstance();
|
|
27
28
|
var viewMode = Form.useWatch("view_mode", {
|
|
@@ -31,13 +32,15 @@ var View = function View(props) {
|
|
|
31
32
|
return /*#__PURE__*/React.createElement(React.Fragment, null, viewMode === "grid" && /*#__PURE__*/React.createElement(GridViewTable, {
|
|
32
33
|
tableProps: other,
|
|
33
34
|
filter: filter,
|
|
34
|
-
setTableSetting: setTableSetting
|
|
35
|
+
setTableSetting: setTableSetting,
|
|
36
|
+
onDataSourceChange: onDataSourceChange
|
|
35
37
|
}), viewMode === "gallery" && /*#__PURE__*/React.createElement(Gallery, {
|
|
36
38
|
loading: other === null || other === void 0 ? void 0 : other.loading,
|
|
37
39
|
gallery: gallery,
|
|
38
40
|
pagination: other.pagination,
|
|
39
41
|
filter: filter,
|
|
40
|
-
rowKey: other.rowKey
|
|
42
|
+
rowKey: other.rowKey,
|
|
43
|
+
onDataSourceChange: onDataSourceChange
|
|
41
44
|
}));
|
|
42
45
|
};
|
|
43
46
|
export default View;
|
|
@@ -5,6 +5,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
5
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
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); }
|
|
7
7
|
import { useMemo } from "react";
|
|
8
|
+
import { isBoolean } from "@pisell/utils";
|
|
8
9
|
var useTransSortSetting = function useTransSortSetting(params) {
|
|
9
10
|
var sort = params.sort,
|
|
10
11
|
originColumnsMap = params.originColumnsMap;
|
|
@@ -15,13 +16,15 @@ var useTransSortSetting = function useTransSortSetting(params) {
|
|
|
15
16
|
var name = item.name,
|
|
16
17
|
label = item.label,
|
|
17
18
|
columnKey = item.columnKey,
|
|
18
|
-
isCustom = item.isCustom
|
|
19
|
+
isCustom = item.isCustom,
|
|
20
|
+
localFilter = item.localFilter;
|
|
19
21
|
if (!isCustom && columnKey && originColumnsMap.has(columnKey)) {
|
|
20
22
|
var column = originColumnsMap.get(columnKey);
|
|
21
23
|
name = column.dataIndex || name;
|
|
22
24
|
label = column.title || label;
|
|
23
25
|
}
|
|
24
26
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
27
|
+
localFilter: isBoolean(localFilter) ? localFilter : true,
|
|
25
28
|
name: name,
|
|
26
29
|
label: label
|
|
27
30
|
});
|
|
@@ -14,6 +14,9 @@ var useTriggerValuesChange = function useTriggerValuesChange(params) {
|
|
|
14
14
|
var _ref = filter || {},
|
|
15
15
|
list = _ref.list,
|
|
16
16
|
show = _ref.show;
|
|
17
|
+
var _ref2 = sort || {},
|
|
18
|
+
sortList = _ref2.list,
|
|
19
|
+
sortShow = _ref2.show;
|
|
17
20
|
var getIsTriggerValuesChange = useCallback(function (changedValues, values) {
|
|
18
21
|
var keys = getSettingKeyArrByMode({
|
|
19
22
|
filter: filter,
|
|
@@ -27,10 +30,28 @@ var useTriggerValuesChange = function useTriggerValuesChange(params) {
|
|
|
27
30
|
if (changedKey === "pagination") {
|
|
28
31
|
return true;
|
|
29
32
|
}
|
|
30
|
-
if (changedKey ===
|
|
33
|
+
if (changedKey === "view_mode") {
|
|
31
34
|
return false;
|
|
32
35
|
}
|
|
33
36
|
|
|
37
|
+
/**
|
|
38
|
+
* 排序变化时,如果排序有远程接口排序,则触发值变化
|
|
39
|
+
*/
|
|
40
|
+
if (changedKey === "order_by") {
|
|
41
|
+
if (sortShow && sortList !== null && sortList !== void 0 && sortList.length) {
|
|
42
|
+
var _value$split, _value$split$call;
|
|
43
|
+
var value = changedValues[changedKey];
|
|
44
|
+
var sortField = (value === null || value === void 0 ? void 0 : (_value$split = value.split) === null || _value$split === void 0 ? void 0 : (_value$split$call = _value$split.call(value, ":")) === null || _value$split$call === void 0 ? void 0 : _value$split$call[0]) || "";
|
|
45
|
+
var remoteSortKeys = sortList.filter(function (item) {
|
|
46
|
+
return !item.localFilter;
|
|
47
|
+
}).map(function (item) {
|
|
48
|
+
var _item$name;
|
|
49
|
+
return (_item$name = item.name) === null || _item$name === void 0 ? void 0 : _item$name.toString();
|
|
50
|
+
});
|
|
51
|
+
return remoteSortKeys.includes(sortField);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
34
55
|
/**
|
|
35
56
|
* 过滤器变化时,如果过滤器有远程过滤,则触发值变化
|
|
36
57
|
*/
|
|
@@ -41,7 +62,8 @@ var useTriggerValuesChange = function useTriggerValuesChange(params) {
|
|
|
41
62
|
var remoteFilterKeys = list.filter(function (item) {
|
|
42
63
|
return !item.localFilter;
|
|
43
64
|
}).map(function (item) {
|
|
44
|
-
|
|
65
|
+
var _item$name2;
|
|
66
|
+
return (_item$name2 = item.name) === null || _item$name2 === void 0 ? void 0 : _item$name2.toString();
|
|
45
67
|
});
|
|
46
68
|
return remoteFilterKeys.includes(filterKey);
|
|
47
69
|
}
|
|
@@ -192,5 +192,10 @@ export declare type GridViewProps = {
|
|
|
192
192
|
* 当前本地配置的key 用此hash是否改变用来判断是否清空本地配置 不填默认使用columns数据生成hash
|
|
193
193
|
*/
|
|
194
194
|
currentSettingKey?: "";
|
|
195
|
+
/**
|
|
196
|
+
* 当前表格中数据发生变化事件 包含本地筛选和外部传入数据变化
|
|
197
|
+
* @param currentDataSource
|
|
198
|
+
*/
|
|
199
|
+
onDataSourceChange?: (currentDataSource: Record<string, any>[]) => void;
|
|
195
200
|
};
|
|
196
201
|
export {};
|
package/es/index.d.ts
CHANGED
|
@@ -72,4 +72,6 @@ export { default as List } from "./components/list";
|
|
|
72
72
|
export { default as Sort } from "./components/sort";
|
|
73
73
|
export { default as InputNumberRange } from "./components/input-number-range";
|
|
74
74
|
export { default as LowCodePage } from "./components/lowCodePage";
|
|
75
|
+
export { default as PickerView } from "./components/picker-view";
|
|
75
76
|
export { default as Segmented } from "./components/segmented";
|
|
77
|
+
export { default as AutoCompleteNumber } from "./components/auto-complete-number";
|
package/es/index.js
CHANGED
|
@@ -92,4 +92,6 @@ export { default as List } from "./components/list";
|
|
|
92
92
|
export { default as Sort } from "./components/sort";
|
|
93
93
|
export { default as InputNumberRange } from "./components/input-number-range";
|
|
94
94
|
export { default as LowCodePage } from "./components/lowCodePage";
|
|
95
|
-
export { default as
|
|
95
|
+
export { default as PickerView } from "./components/picker-view";
|
|
96
|
+
export { default as Segmented } from "./components/segmented";
|
|
97
|
+
export { default as AutoCompleteNumber } from "./components/auto-complete-number";
|
package/es/locales/en-US.d.ts
CHANGED
|
@@ -28,5 +28,12 @@ declare const _default: {
|
|
|
28
28
|
"table-column-group-records": string;
|
|
29
29
|
"table-column-drag-sort-disabled-tip": string;
|
|
30
30
|
"table-action-filter-no-filter": string;
|
|
31
|
+
"table-action-range-picker-presets-today": string;
|
|
32
|
+
"table-action-range-picker-presets-yesterday": string;
|
|
33
|
+
"table-action-range-picker-presets-last-3-day": string;
|
|
34
|
+
"table-action-range-picker-presets-last-7-day": string;
|
|
35
|
+
"table-action-range-picker-presets-last-14-day": string;
|
|
36
|
+
"table-action-range-picker-presets-last-30-day": string;
|
|
37
|
+
"table-action-range-picker-presets-last-90-day": string;
|
|
31
38
|
};
|
|
32
39
|
export default _default;
|
package/es/locales/en-US.js
CHANGED
|
@@ -33,5 +33,12 @@ export default {
|
|
|
33
33
|
"table-action-column-title": "Header settings",
|
|
34
34
|
"table-column-group-records": "records",
|
|
35
35
|
"table-column-drag-sort-disabled-tip": "Automatic sorting is enabled, manual dragging is disabled.",
|
|
36
|
-
"table-action-filter-no-filter": "No filter options available."
|
|
36
|
+
"table-action-filter-no-filter": "No filter options available.",
|
|
37
|
+
"table-action-range-picker-presets-today": "Today",
|
|
38
|
+
"table-action-range-picker-presets-yesterday": "Yesterday",
|
|
39
|
+
"table-action-range-picker-presets-last-3-day": "Last 3 Days",
|
|
40
|
+
"table-action-range-picker-presets-last-7-day": "Last 7 Days",
|
|
41
|
+
"table-action-range-picker-presets-last-14-day": "Last 14 Days",
|
|
42
|
+
"table-action-range-picker-presets-last-30-day": "Last 30 Days",
|
|
43
|
+
"table-action-range-picker-presets-last-90-day": "Last 90 Days"
|
|
37
44
|
};
|
package/es/locales/zh-CN.d.ts
CHANGED
|
@@ -28,5 +28,12 @@ declare const _default: {
|
|
|
28
28
|
"table-column-group-records": string;
|
|
29
29
|
"table-column-drag-sort-disabled-tip": string;
|
|
30
30
|
"table-action-filter-no-filter": string;
|
|
31
|
+
"table-action-range-picker-presets-today": string;
|
|
32
|
+
"table-action-range-picker-presets-yesterday": string;
|
|
33
|
+
"table-action-range-picker-presets-last-3-day": string;
|
|
34
|
+
"table-action-range-picker-presets-last-7-day": string;
|
|
35
|
+
"table-action-range-picker-presets-last-14-day": string;
|
|
36
|
+
"table-action-range-picker-presets-last-30-day": string;
|
|
37
|
+
"table-action-range-picker-presets-last-90-day": string;
|
|
31
38
|
};
|
|
32
39
|
export default _default;
|
package/es/locales/zh-CN.js
CHANGED
|
@@ -33,5 +33,12 @@ export default {
|
|
|
33
33
|
"table-action-column-title": "表头设置",
|
|
34
34
|
"table-column-group-records": "条记录",
|
|
35
35
|
"table-column-drag-sort-disabled-tip": "已开启自动排序,无法手动拖拽",
|
|
36
|
-
"table-action-filter-no-filter": "没有可用的筛选器。"
|
|
36
|
+
"table-action-filter-no-filter": "没有可用的筛选器。",
|
|
37
|
+
"table-action-range-picker-presets-today": "今天",
|
|
38
|
+
"table-action-range-picker-presets-yesterday": "昨天",
|
|
39
|
+
"table-action-range-picker-presets-last-3-day": "过去3天",
|
|
40
|
+
"table-action-range-picker-presets-last-7-day": "过去7天",
|
|
41
|
+
"table-action-range-picker-presets-last-14-day": "过去14天",
|
|
42
|
+
"table-action-range-picker-presets-last-30-day": "过去30天",
|
|
43
|
+
"table-action-range-picker-presets-last-90-day": "过去90天"
|
|
37
44
|
};
|
package/es/locales/zh-TW.d.ts
CHANGED
|
@@ -28,5 +28,12 @@ declare const _default: {
|
|
|
28
28
|
"table-column-group-records": string;
|
|
29
29
|
"table-column-drag-sort-disabled-tip": string;
|
|
30
30
|
"table-action-filter-no-filter": string;
|
|
31
|
+
"table-action-range-picker-presets-today": string;
|
|
32
|
+
"table-action-range-picker-presets-yesterday": string;
|
|
33
|
+
"table-action-range-picker-presets-last-3-day": string;
|
|
34
|
+
"table-action-range-picker-presets-last-7-day": string;
|
|
35
|
+
"table-action-range-picker-presets-last-14-day": string;
|
|
36
|
+
"table-action-range-picker-presets-last-30-day": string;
|
|
37
|
+
"table-action-range-picker-presets-last-90-day": string;
|
|
31
38
|
};
|
|
32
39
|
export default _default;
|
package/es/locales/zh-TW.js
CHANGED
|
@@ -33,5 +33,12 @@ export default {
|
|
|
33
33
|
"table-action-column-title": "表頭設置",
|
|
34
34
|
"table-column-group-records": "條記錄",
|
|
35
35
|
"table-column-drag-sort-disabled-tip": "已開啟自動排序,無法手動拖曳",
|
|
36
|
-
"table-action-filter-no-filter": "沒有可用的篩選器。"
|
|
36
|
+
"table-action-filter-no-filter": "沒有可用的篩選器。",
|
|
37
|
+
"table-action-range-picker-presets-today": "今天",
|
|
38
|
+
"table-action-range-picker-presets-yesterday": "昨天",
|
|
39
|
+
"table-action-range-picker-presets-last-3-day": "過去3天",
|
|
40
|
+
"table-action-range-picker-presets-last-7-day": "過去7天",
|
|
41
|
+
"table-action-range-picker-presets-last-14-day": "過去14天",
|
|
42
|
+
"table-action-range-picker-presets-last-30-day": "過去30天",
|
|
43
|
+
"table-action-range-picker-presets-last-90-day": "過去90天"
|
|
37
44
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { AutoCompleteProps, InputNumberProps } from "antd";
|
|
3
|
+
interface AutoCompleteNumberProps {
|
|
4
|
+
autoCompleteProps: AutoCompleteProps;
|
|
5
|
+
inputNumberProps: InputNumberProps;
|
|
6
|
+
value?: any;
|
|
7
|
+
onChange?: any;
|
|
8
|
+
}
|
|
9
|
+
declare const AutoCompleteNumber: (props: AutoCompleteNumberProps) => React.JSX.Element;
|
|
10
|
+
export default AutoCompleteNumber;
|
|
@@ -0,0 +1,48 @@
|
|
|
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/auto-complete-number/index.tsx
|
|
30
|
+
var auto_complete_number_exports = {};
|
|
31
|
+
__export(auto_complete_number_exports, {
|
|
32
|
+
default: () => auto_complete_number_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(auto_complete_number_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var InputNumber = (0, import_react.forwardRef)((props, ref) => {
|
|
38
|
+
const onChange = (e) => {
|
|
39
|
+
let _val = e === null || e === void 0 ? "" : e + "";
|
|
40
|
+
props.onChange && props.onChange({ target: { value: _val } });
|
|
41
|
+
};
|
|
42
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.InputNumber, { ...props, onChange, ref });
|
|
43
|
+
});
|
|
44
|
+
var AutoCompleteNumber = (props) => {
|
|
45
|
+
const { autoCompleteProps, inputNumberProps, ...resetProps } = props;
|
|
46
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.AutoComplete, { ...resetProps, ...autoCompleteProps }, /* @__PURE__ */ import_react.default.createElement(InputNumber, { ...inputNumberProps }));
|
|
47
|
+
};
|
|
48
|
+
var auto_complete_number_default = AutoCompleteNumber;
|
|
@@ -0,0 +1,36 @@
|
|
|
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/picker-view/index.tsx
|
|
30
|
+
var picker_view_exports = {};
|
|
31
|
+
__export(picker_view_exports, {
|
|
32
|
+
default: () => picker_view_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(picker_view_exports);
|
|
35
|
+
var import_picker_view = __toESM(require("antd-mobile/es/components/picker-view"));
|
|
36
|
+
var picker_view_default = import_picker_view.default;
|
|
@@ -101,7 +101,7 @@ var Sort = ({
|
|
|
101
101
|
return {
|
|
102
102
|
key: d.name,
|
|
103
103
|
label: d.label,
|
|
104
|
-
children: sortChildrenMap[d.type](d.name, !!
|
|
104
|
+
children: sortChildrenMap[d.type](d.name, !!(d == null ? void 0 : d.localFilter)),
|
|
105
105
|
popupClassName: `${prefix}sort-sub-menu-popup-wrap`
|
|
106
106
|
};
|
|
107
107
|
});
|
|
@@ -44,7 +44,7 @@ var import_constant = require("./constant");
|
|
|
44
44
|
var import_index = require("./index.less");
|
|
45
45
|
var prefix = "pisell-lowcode-";
|
|
46
46
|
var Gallery = (props) => {
|
|
47
|
-
const { gallery, filter, pagination, rowKey, loading } = props;
|
|
47
|
+
const { gallery, filter, pagination, rowKey, loading, onDataSourceChange } = props;
|
|
48
48
|
const {
|
|
49
49
|
horizontalGutter,
|
|
50
50
|
verticalGutter,
|
|
@@ -73,6 +73,9 @@ var Gallery = (props) => {
|
|
|
73
73
|
rowKey,
|
|
74
74
|
filter
|
|
75
75
|
});
|
|
76
|
+
(0, import_react.useEffect)(() => {
|
|
77
|
+
onDataSourceChange == null ? void 0 : onDataSourceChange(dataSource);
|
|
78
|
+
}, [JSON.stringify(dataSource)]);
|
|
76
79
|
const columnsMap = (0, import_react.useMemo)(() => {
|
|
77
80
|
return new Map(originColumns.map((item) => [item.key, item]));
|
|
78
81
|
}, [originColumns]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GallerySettingType } from "../types";
|
|
1
|
+
import { GallerySettingType, GridViewProps } from "../types";
|
|
2
2
|
import { FilterType } from "../../filter/types";
|
|
3
3
|
export declare type GalleryProps = {
|
|
4
4
|
gallery: GallerySettingType;
|
|
@@ -6,4 +6,5 @@ export declare type GalleryProps = {
|
|
|
6
6
|
pagination: any;
|
|
7
7
|
rowKey: ((record: Record<string, any>) => string) | string;
|
|
8
8
|
loading: boolean;
|
|
9
|
+
onDataSourceChange: GridViewProps['onDataSourceChange'];
|
|
9
10
|
};
|
|
@@ -36,6 +36,7 @@ var import_utils = require("@pisell/utils");
|
|
|
36
36
|
var import_dayjs = __toESM(require("dayjs"));
|
|
37
37
|
var import_react = __toESM(require("react"));
|
|
38
38
|
var import_date_picker = __toESM(require("../../../../../date-picker"));
|
|
39
|
+
var import_locales = require("../../../../../../locales");
|
|
39
40
|
var { RangePicker } = import_date_picker.default;
|
|
40
41
|
var defaultFormat = "YYYY-MM-DD HH:mm:ss";
|
|
41
42
|
var Edit = (props, ref) => {
|
|
@@ -64,32 +65,32 @@ var Edit = (props, ref) => {
|
|
|
64
65
|
return value;
|
|
65
66
|
}, [value]);
|
|
66
67
|
const rangePresets = [
|
|
67
|
-
{ label: "
|
|
68
|
+
{ label: (0, import_locales.getText)("table-action-range-picker-presets-today"), value: [(0, import_dayjs.default)().startOf("day"), (0, import_dayjs.default)().endOf("day")] },
|
|
68
69
|
{
|
|
69
|
-
label: "
|
|
70
|
+
label: (0, import_locales.getText)("table-action-range-picker-presets-yesterday"),
|
|
70
71
|
value: [
|
|
71
72
|
(0, import_dayjs.default)().add(-1, "d").startOf("day"),
|
|
72
73
|
(0, import_dayjs.default)().add(-1, "d").endOf("day")
|
|
73
74
|
]
|
|
74
75
|
},
|
|
75
76
|
{
|
|
76
|
-
label: "
|
|
77
|
+
label: (0, import_locales.getText)("table-action-range-picker-presets-last-3-day"),
|
|
77
78
|
value: [(0, import_dayjs.default)().add(-3, "d").startOf("day"), (0, import_dayjs.default)().endOf("day")]
|
|
78
79
|
},
|
|
79
80
|
{
|
|
80
|
-
label: "
|
|
81
|
+
label: (0, import_locales.getText)("table-action-range-picker-presets-last-7-day"),
|
|
81
82
|
value: [(0, import_dayjs.default)().add(-7, "d").startOf("day"), (0, import_dayjs.default)().endOf("day")]
|
|
82
83
|
},
|
|
83
84
|
{
|
|
84
|
-
label: "
|
|
85
|
+
label: (0, import_locales.getText)("table-action-range-picker-presets-last-14-day"),
|
|
85
86
|
value: [(0, import_dayjs.default)().add(-14, "d").startOf("day"), (0, import_dayjs.default)().endOf("day")]
|
|
86
87
|
},
|
|
87
88
|
{
|
|
88
|
-
label: "
|
|
89
|
+
label: (0, import_locales.getText)("table-action-range-picker-presets-last-30-day"),
|
|
89
90
|
value: [(0, import_dayjs.default)().add(-30, "d").startOf("day"), (0, import_dayjs.default)().endOf("day")]
|
|
90
91
|
},
|
|
91
92
|
{
|
|
92
|
-
label: "
|
|
93
|
+
label: (0, import_locales.getText)("table-action-range-picker-presets-last-90-day"),
|
|
93
94
|
value: [(0, import_dayjs.default)().add(-90, "d").startOf("day"), (0, import_dayjs.default)().endOf("day")]
|
|
94
95
|
}
|
|
95
96
|
];
|
|
@@ -46,7 +46,7 @@ var import_useGenTableComponents = __toESM(require("../hooks/useGenTableComponen
|
|
|
46
46
|
var import_useGenScroll = __toESM(require("../hooks/useGenScroll"));
|
|
47
47
|
var import_hooks = require("../../../hooks");
|
|
48
48
|
var import_index = require("./index.less");
|
|
49
|
-
var GridViewTable = ({ tableProps, filter, setTableSetting }) => {
|
|
49
|
+
var GridViewTable = ({ tableProps, filter, setTableSetting, onDataSourceChange }) => {
|
|
50
50
|
var _a, _b;
|
|
51
51
|
const responsive = (0, import_hooks.useResponsive)();
|
|
52
52
|
const { state, dispatch } = (0, import_hooks.useSharedState)(import_model.Context);
|
|
@@ -92,6 +92,9 @@ var GridViewTable = ({ tableProps, filter, setTableSetting }) => {
|
|
|
92
92
|
rowKey: tableProps.rowKey,
|
|
93
93
|
filter
|
|
94
94
|
});
|
|
95
|
+
(0, import_react.useEffect)(() => {
|
|
96
|
+
onDataSourceChange == null ? void 0 : onDataSourceChange(dataSource);
|
|
97
|
+
}, [JSON.stringify(dataSource)]);
|
|
95
98
|
const components = (0, import_useGenTableComponents.default)({
|
|
96
99
|
form
|
|
97
100
|
});
|