@pisell/materials 1.0.266 → 1.0.268
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 +1 -1
- package/build/lowcode/preview.js +6 -6
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +20 -20
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +18 -18
- package/es/components/drawer/index.js +50 -6
- package/es/components/drawer/index.less +3 -0
- package/es/components/filter/components/FilterButton/index.js +0 -1
- package/lib/components/drawer/index.js +52 -5
- package/lib/components/drawer/index.less +3 -0
- package/lib/components/filter/components/FilterButton/index.js +0 -1
- package/lowcode/drawer/meta.ts +19 -0
- package/package.json +1 -1
|
@@ -1,21 +1,43 @@
|
|
|
1
1
|
var _excluded = ["others"];
|
|
2
|
+
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
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
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
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."); }
|
|
6
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
7
|
+
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; }
|
|
8
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
9
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
3
10
|
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; }
|
|
4
11
|
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; }
|
|
5
|
-
|
|
12
|
+
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; }
|
|
13
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
14
|
+
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); }
|
|
15
|
+
import React, { useLayoutEffect, useMemo } from "react";
|
|
6
16
|
import { Drawer as OriginalDrawer } from "antd";
|
|
17
|
+
import { useControllableValue } from "ahooks";
|
|
18
|
+
import classNames from "classnames";
|
|
19
|
+
import { isBoolean, isUndefined } from "@pisell/utils";
|
|
7
20
|
import XClose from "@pisell/icon/es/XClose";
|
|
21
|
+
import Pin02 from "@pisell/icon/es/Pin02";
|
|
8
22
|
import "./index.less";
|
|
9
23
|
var prefix = "pisell-lowcode-";
|
|
10
24
|
var Title = function Title(props) {
|
|
11
25
|
var placement = props.placement,
|
|
12
|
-
onClose = props.onClose
|
|
26
|
+
onClose = props.onClose,
|
|
27
|
+
showPin = props.showPin,
|
|
28
|
+
persistentState = props.persistentState,
|
|
29
|
+
setPersistentState = props.setPersistentState;
|
|
13
30
|
return /*#__PURE__*/React.createElement("div", {
|
|
14
31
|
className: "".concat(prefix, "drawer-outside-wrap ").concat(prefix, "drawer-outside-wrap-").concat(placement)
|
|
15
32
|
}, /*#__PURE__*/React.createElement("div", {
|
|
16
33
|
className: "".concat(prefix, "drawer-outside-action-wrap"),
|
|
17
34
|
onClick: onClose
|
|
18
|
-
}, /*#__PURE__*/React.createElement(XClose, null))
|
|
35
|
+
}, /*#__PURE__*/React.createElement(XClose, null)), showPin && /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: classNames("".concat(prefix, "drawer-outside-action-wrap"), _defineProperty({}, "".concat(prefix, "drawer-outside-action-active"), persistentState)),
|
|
37
|
+
onClick: function onClick() {
|
|
38
|
+
return setPersistentState(!persistentState);
|
|
39
|
+
}
|
|
40
|
+
}, /*#__PURE__*/React.createElement(Pin02, null)));
|
|
19
41
|
};
|
|
20
42
|
var Drawer = function Drawer(props) {
|
|
21
43
|
var others = props.others,
|
|
@@ -23,12 +45,31 @@ var Drawer = function Drawer(props) {
|
|
|
23
45
|
var operateMode = props.operateMode,
|
|
24
46
|
headerStyle = props.headerStyle,
|
|
25
47
|
placement = props.placement,
|
|
26
|
-
onClose = props.onClose
|
|
48
|
+
onClose = props.onClose,
|
|
49
|
+
showPin = props.showPin,
|
|
50
|
+
width = props.width,
|
|
51
|
+
getContainer = props.getContainer,
|
|
52
|
+
open = props.open;
|
|
53
|
+
var _useControllableValue = useControllableValue(props, {
|
|
54
|
+
trigger: "onPersistentChange",
|
|
55
|
+
valuePropName: "persistent"
|
|
56
|
+
}),
|
|
57
|
+
_useControllableValue2 = _slicedToArray(_useControllableValue, 2),
|
|
58
|
+
persistentState = _useControllableValue2[0],
|
|
59
|
+
setPersistentState = _useControllableValue2[1];
|
|
27
60
|
var innerProps = {};
|
|
28
61
|
if (props.__designMode === "design") {
|
|
29
62
|
// 低代码编辑态中强制显示,将控制权交给引擎侧
|
|
30
63
|
innerProps.open = true;
|
|
31
64
|
}
|
|
65
|
+
useLayoutEffect(function () {
|
|
66
|
+
if (isBoolean(persistentState) && isUndefined(getContainer)) {
|
|
67
|
+
document.body.style["margin-".concat(placement)] = persistentState && open ? "".concat(width || 378, "px") : "0";
|
|
68
|
+
}
|
|
69
|
+
return function () {
|
|
70
|
+
document.body.style["margin-".concat(placement)] = "0";
|
|
71
|
+
};
|
|
72
|
+
}, [persistentState, width, showPin, placement, open]);
|
|
32
73
|
var otherProps = useMemo(function () {
|
|
33
74
|
if (operateMode === "outside") {
|
|
34
75
|
return {
|
|
@@ -39,12 +80,15 @@ var Drawer = function Drawer(props) {
|
|
|
39
80
|
},
|
|
40
81
|
title: /*#__PURE__*/React.createElement(Title, {
|
|
41
82
|
placement: placement,
|
|
42
|
-
onClose: onClose
|
|
83
|
+
onClose: onClose,
|
|
84
|
+
showPin: showPin,
|
|
85
|
+
persistentState: persistentState,
|
|
86
|
+
setPersistentState: setPersistentState
|
|
43
87
|
})
|
|
44
88
|
};
|
|
45
89
|
}
|
|
46
90
|
return headerStyle;
|
|
47
|
-
}, [operateMode, placement, onClose]);
|
|
91
|
+
}, [operateMode, placement, onClose, persistentState, setPersistentState]);
|
|
48
92
|
return /*#__PURE__*/React.createElement(OriginalDrawer, _extends({}, resetProps, innerProps, otherProps, others));
|
|
49
93
|
};
|
|
50
94
|
export default Drawer;
|
|
@@ -38,7 +38,6 @@ var Filter = function Filter(_ref) {
|
|
|
38
38
|
return /*#__PURE__*/React.createElement("div", {
|
|
39
39
|
ref: ref
|
|
40
40
|
}, /*#__PURE__*/React.createElement(Popover, {
|
|
41
|
-
trigger: "click",
|
|
42
41
|
content: content,
|
|
43
42
|
arrow: false,
|
|
44
43
|
getPopupContainer: function getPopupContainer() {
|
|
@@ -34,26 +34,64 @@ __export(drawer_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(drawer_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_antd = require("antd");
|
|
37
|
+
var import_ahooks = require("ahooks");
|
|
38
|
+
var import_classnames = __toESM(require("classnames"));
|
|
39
|
+
var import_utils = require("@pisell/utils");
|
|
37
40
|
var import_XClose = __toESM(require("@pisell/icon/es/XClose"));
|
|
41
|
+
var import_Pin02 = __toESM(require("@pisell/icon/es/Pin02"));
|
|
38
42
|
var import_index = require("./index.less");
|
|
39
43
|
var prefix = "pisell-lowcode-";
|
|
40
44
|
var Title = (props) => {
|
|
41
|
-
const { placement, onClose } = props;
|
|
45
|
+
const { placement, onClose, showPin, persistentState, setPersistentState } = props;
|
|
42
46
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
43
47
|
"div",
|
|
44
48
|
{
|
|
45
49
|
className: `${prefix}drawer-outside-wrap ${prefix}drawer-outside-wrap-${placement}`
|
|
46
50
|
},
|
|
47
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}drawer-outside-action-wrap`, onClick: onClose }, /* @__PURE__ */ import_react.default.createElement(import_XClose.default, null))
|
|
51
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}drawer-outside-action-wrap`, onClick: onClose }, /* @__PURE__ */ import_react.default.createElement(import_XClose.default, null)),
|
|
52
|
+
showPin && /* @__PURE__ */ import_react.default.createElement(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
className: (0, import_classnames.default)(`${prefix}drawer-outside-action-wrap`, {
|
|
56
|
+
[`${prefix}drawer-outside-action-active`]: persistentState
|
|
57
|
+
}),
|
|
58
|
+
onClick: () => setPersistentState(!persistentState)
|
|
59
|
+
},
|
|
60
|
+
/* @__PURE__ */ import_react.default.createElement(import_Pin02.default, null)
|
|
61
|
+
)
|
|
48
62
|
);
|
|
49
63
|
};
|
|
50
64
|
var Drawer = (props) => {
|
|
51
65
|
const { others, ...resetProps } = props;
|
|
52
|
-
const {
|
|
66
|
+
const {
|
|
67
|
+
operateMode,
|
|
68
|
+
headerStyle,
|
|
69
|
+
placement,
|
|
70
|
+
onClose,
|
|
71
|
+
showPin,
|
|
72
|
+
width,
|
|
73
|
+
getContainer,
|
|
74
|
+
open
|
|
75
|
+
} = props;
|
|
76
|
+
const [persistentState, setPersistentState] = (0, import_ahooks.useControllableValue)(
|
|
77
|
+
props,
|
|
78
|
+
{
|
|
79
|
+
trigger: "onPersistentChange",
|
|
80
|
+
valuePropName: "persistent"
|
|
81
|
+
}
|
|
82
|
+
);
|
|
53
83
|
const innerProps = {};
|
|
54
84
|
if (props.__designMode === "design") {
|
|
55
85
|
innerProps.open = true;
|
|
56
86
|
}
|
|
87
|
+
(0, import_react.useLayoutEffect)(() => {
|
|
88
|
+
if ((0, import_utils.isBoolean)(persistentState) && (0, import_utils.isUndefined)(getContainer)) {
|
|
89
|
+
document.body.style[`margin-${placement}`] = persistentState && open ? `${width || 378}px` : "0";
|
|
90
|
+
}
|
|
91
|
+
return () => {
|
|
92
|
+
document.body.style[`margin-${placement}`] = "0";
|
|
93
|
+
};
|
|
94
|
+
}, [persistentState, width, showPin, placement, open]);
|
|
57
95
|
const otherProps = (0, import_react.useMemo)(() => {
|
|
58
96
|
if (operateMode === "outside") {
|
|
59
97
|
return {
|
|
@@ -62,11 +100,20 @@ var Drawer = (props) => {
|
|
|
62
100
|
height: 0,
|
|
63
101
|
padding: 0
|
|
64
102
|
},
|
|
65
|
-
title: /* @__PURE__ */ import_react.default.createElement(
|
|
103
|
+
title: /* @__PURE__ */ import_react.default.createElement(
|
|
104
|
+
Title,
|
|
105
|
+
{
|
|
106
|
+
placement,
|
|
107
|
+
onClose,
|
|
108
|
+
showPin,
|
|
109
|
+
persistentState,
|
|
110
|
+
setPersistentState
|
|
111
|
+
}
|
|
112
|
+
)
|
|
66
113
|
};
|
|
67
114
|
}
|
|
68
115
|
return headerStyle;
|
|
69
|
-
}, [operateMode, placement, onClose]);
|
|
116
|
+
}, [operateMode, placement, onClose, persistentState, setPersistentState]);
|
|
70
117
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
71
118
|
import_antd.Drawer,
|
|
72
119
|
{
|
|
@@ -70,7 +70,6 @@ var Filter = ({
|
|
|
70
70
|
return /* @__PURE__ */ import_react.default.createElement("div", { ref }, /* @__PURE__ */ import_react.default.createElement(
|
|
71
71
|
import_antd.Popover,
|
|
72
72
|
{
|
|
73
|
-
trigger: "click",
|
|
74
73
|
content,
|
|
75
74
|
arrow: false,
|
|
76
75
|
getPopupContainer: () => ref.current
|
package/lowcode/drawer/meta.ts
CHANGED
|
@@ -222,6 +222,20 @@ export default {
|
|
|
222
222
|
defaultValue: false,
|
|
223
223
|
setter: 'BoolSetter',
|
|
224
224
|
},
|
|
225
|
+
{
|
|
226
|
+
name: 'showPin',
|
|
227
|
+
title: { label: '展示pin按钮', tip: 'showPin | 展示pin按钮, 点击可以展示和内容并列展示' },
|
|
228
|
+
propType: 'bool',
|
|
229
|
+
defaultValue: true,
|
|
230
|
+
setter: 'BoolSetter',
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
name: 'persistent',
|
|
234
|
+
title: { label: '固定状态', tip: 'persistent | 是否固定展示,false时视图zIndex在上' },
|
|
235
|
+
propType: 'bool',
|
|
236
|
+
defaultValue: undefined,
|
|
237
|
+
setter: 'BoolSetter',
|
|
238
|
+
},
|
|
225
239
|
],
|
|
226
240
|
},
|
|
227
241
|
{
|
|
@@ -443,6 +457,11 @@ export default {
|
|
|
443
457
|
template:
|
|
444
458
|
"afterOpenChange(open,${extParams}){\n// 切换抽屉时动画结束后的回调\nconsole.log('afterOpenChange',open);}",
|
|
445
459
|
},
|
|
460
|
+
{
|
|
461
|
+
name: 'onPersistentChange',
|
|
462
|
+
template:
|
|
463
|
+
"onPersistentChange(persistent){}",
|
|
464
|
+
},
|
|
446
465
|
],
|
|
447
466
|
},
|
|
448
467
|
},
|