@pisell/materials 1.0.511 → 1.0.512

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.
@@ -65,7 +65,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
65
65
  useCustomAction: boolean;
66
66
  actionType: string;
67
67
  openMode: "modal" | "drawer";
68
- openContentSize: "small" | "middle" | "large";
68
+ openContentSize: "small" | "large" | "middle";
69
69
  openTitle: string;
70
70
  key: string;
71
71
  } | undefined;
@@ -1,5 +1,4 @@
1
1
  var _excluded = ["items", "getContainer", "className"];
2
- 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); }
3
2
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
3
  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."); }
5
4
  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); }
@@ -9,12 +8,10 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
9
8
  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; }
10
9
  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; }
11
10
  import React, { useRef, useState, useEffect } from 'react';
12
- import { Anchor, Button } from 'antd';
13
- import { LeftOutlined, RightOutlined } from '@ant-design/icons';
11
+ import { Anchor } from 'antd';
14
12
  import classNames from 'classnames';
15
13
  import "./index.less";
16
14
  var PisellAnchor = function PisellAnchor(props) {
17
- var _items$;
18
15
  var _props$items = props.items,
19
16
  items = _props$items === void 0 ? [] : _props$items,
20
17
  getContainer = props.getContainer,
@@ -86,40 +83,12 @@ var PisellAnchor = function PisellAnchor(props) {
86
83
  requestAnimationFrame(animation);
87
84
  };
88
85
  return /*#__PURE__*/React.createElement("div", {
89
- className: classNames('pisell-anchor-container', className)
90
- }, /*#__PURE__*/React.createElement("div", {
91
- className: "pisell-anchor-scroll",
92
- ref: scrollRef
93
- }, /*#__PURE__*/React.createElement(Anchor, _extends({
94
- className: "pisell-lowcode-anchor",
86
+ className: classNames('pisell-anchor-containers', className)
87
+ }, /*#__PURE__*/React.createElement(Anchor, {
88
+ direction: "horizontal",
95
89
  getContainer: getContainer,
96
90
  items: items,
97
- direction: "horizontal",
98
- replace: true,
99
- getCurrentAnchor: items === null || items === void 0 ? void 0 : (_items$ = items[0]) === null || _items$ === void 0 ? void 0 : _items$.href,
100
- showInkInFixed: true
101
- // targetOffset={40}
102
- // bounds={40}
103
- ,
104
- affix: false
105
- }, rest))), (canScrollRight || canScrollLeft) && /*#__PURE__*/React.createElement("div", {
106
- className: "pisell-anchor-buttons"
107
- }, /*#__PURE__*/React.createElement(Button, {
108
- className: classNames('scroll-button', {
109
- disabled: !canScrollLeft
110
- }),
111
- onClick: function onClick() {
112
- return handleScroll('left');
113
- },
114
- disabled: !canScrollLeft
115
- }, /*#__PURE__*/React.createElement(LeftOutlined, null)), /*#__PURE__*/React.createElement(Button, {
116
- className: classNames('scroll-button', {
117
- disabled: !canScrollRight
118
- }),
119
- onClick: function onClick() {
120
- return handleScroll('right');
121
- },
122
- disabled: !canScrollRight
123
- }, /*#__PURE__*/React.createElement(RightOutlined, null))));
91
+ targetOffset: 39
92
+ }));
124
93
  };
125
94
  export default PisellAnchor;
@@ -1,47 +1,49 @@
1
- .pisell-anchor-container {
2
- position: sticky;
3
- top: 0;
4
- z-index: 999;
5
- display: flex;
6
- align-items: center;
7
- background-color: #fff;
8
- height: 40px;
9
-
10
- .pisell-lowcode-anchor {
11
- height: 40px;
12
- border-bottom: none !important;
13
-
14
- .pisell-lowcode-anchor-ink {
1
+ .pisell-anchor-containers {
2
+ // display: flex;
3
+ // align-items: center;
4
+ // background-color: #fff;
5
+ // height: 40px;
6
+ .pisell-lowcode-anchor-wrapper {
7
+ &::before {
8
+ content: '';
15
9
  display: none;
16
10
  }
11
+ .pisell-lowcode-anchor {
12
+ height: 40px;
13
+ border-bottom: none !important;
14
+ background-color: #fff;
17
15
 
18
- .pisell-lowcode-anchor-link {
19
- height: 100%;
20
- padding: 0 16px;
21
- display: flex;
22
- align-items: center;
16
+ .pisell-lowcode-anchor-ink {
17
+ display: none;
18
+ }
19
+
20
+ .pisell-lowcode-anchor-link {
21
+ height: 100%;
22
+ padding: 0 16px;
23
+ display: flex;
24
+ align-items: center;
23
25
 
24
- &-title {
25
- color: var(--Gray-900, #101828);
26
- font-family: Inter;
27
- font-size: 16px;
28
- font-weight: 600;
29
- line-height: 40px;
26
+ &-title {
27
+ color: var(--Gray-900, #101828);
28
+ font-family: Inter;
29
+ font-size: 16px;
30
+ font-weight: 600;
31
+ line-height: 40px;
32
+ }
30
33
  }
31
- }
32
34
 
33
- .pisell-lowcode-anchor-link-active {
34
- border-radius: 100px;
35
- background: var(--theme-color, #7f56d9);
36
- height: 40px;
35
+ .pisell-lowcode-anchor-link-active {
36
+ border-radius: 100px;
37
+ background: var(--theme-color, #7f56d9);
38
+ height: 40px;
37
39
 
38
- .pisell-lowcode-anchor-link-title {
39
- color: var(--White, #fff);
40
- line-height: 40px;
40
+ .pisell-lowcode-anchor-link-title {
41
+ color: var(--White, #fff);
42
+ line-height: 40px;
43
+ }
41
44
  }
42
45
  }
43
46
  }
44
-
45
47
  .pisell-anchor-scroll {
46
48
  height: 40px;
47
49
  flex: 1;
@@ -65,7 +65,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
65
65
  useCustomAction: boolean;
66
66
  actionType: string;
67
67
  openMode: "modal" | "drawer";
68
- openContentSize: "small" | "middle" | "large";
68
+ openContentSize: "small" | "large" | "middle";
69
69
  openTitle: string;
70
70
  key: string;
71
71
  } | undefined;
@@ -34,11 +34,9 @@ __export(pisellAnchor_exports, {
34
34
  module.exports = __toCommonJS(pisellAnchor_exports);
35
35
  var import_react = __toESM(require("react"));
36
36
  var import_antd = require("antd");
37
- var import_icons = require("@ant-design/icons");
38
37
  var import_classnames = __toESM(require("classnames"));
39
38
  var import_index = require("./index.less");
40
39
  var PisellAnchor = (props) => {
41
- var _a;
42
40
  const { items = [], getContainer, className, ...rest } = props;
43
41
  const scrollRef = (0, import_react.useRef)(null);
44
42
  const [canScrollLeft, setCanScrollLeft] = (0, import_react.useState)(false);
@@ -51,13 +49,13 @@ var PisellAnchor = (props) => {
51
49
  }
52
50
  };
53
51
  (0, import_react.useEffect)(() => {
54
- var _a2;
52
+ var _a;
55
53
  document.body.id = "body";
56
54
  checkScroll();
57
- (_a2 = scrollRef.current) == null ? void 0 : _a2.addEventListener("scroll", checkScroll);
55
+ (_a = scrollRef.current) == null ? void 0 : _a.addEventListener("scroll", checkScroll);
58
56
  return () => {
59
- var _a3;
60
- (_a3 = scrollRef.current) == null ? void 0 : _a3.removeEventListener("scroll", checkScroll);
57
+ var _a2;
58
+ (_a2 = scrollRef.current) == null ? void 0 : _a2.removeEventListener("scroll", checkScroll);
61
59
  };
62
60
  }, []);
63
61
  const handleScroll = (direction) => {
@@ -90,39 +88,14 @@ var PisellAnchor = (props) => {
90
88
  };
91
89
  requestAnimationFrame(animation);
92
90
  };
93
- return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("pisell-anchor-container", className) }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-anchor-scroll", ref: scrollRef }, /* @__PURE__ */ import_react.default.createElement(
91
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("pisell-anchor-containers", className) }, /* @__PURE__ */ import_react.default.createElement(
94
92
  import_antd.Anchor,
95
93
  {
96
- className: "pisell-lowcode-anchor",
94
+ direction: "horizontal",
97
95
  getContainer,
98
96
  items,
99
- direction: "horizontal",
100
- replace: true,
101
- getCurrentAnchor: (_a = items == null ? void 0 : items[0]) == null ? void 0 : _a.href,
102
- showInkInFixed: true,
103
- affix: false,
104
- ...rest
97
+ targetOffset: 39
105
98
  }
106
- )), (canScrollRight || canScrollLeft) && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-anchor-buttons" }, /* @__PURE__ */ import_react.default.createElement(
107
- import_antd.Button,
108
- {
109
- className: (0, import_classnames.default)("scroll-button", {
110
- disabled: !canScrollLeft
111
- }),
112
- onClick: () => handleScroll("left"),
113
- disabled: !canScrollLeft
114
- },
115
- /* @__PURE__ */ import_react.default.createElement(import_icons.LeftOutlined, null)
116
- ), /* @__PURE__ */ import_react.default.createElement(
117
- import_antd.Button,
118
- {
119
- className: (0, import_classnames.default)("scroll-button", {
120
- disabled: !canScrollRight
121
- }),
122
- onClick: () => handleScroll("right"),
123
- disabled: !canScrollRight
124
- },
125
- /* @__PURE__ */ import_react.default.createElement(import_icons.RightOutlined, null)
126
- )));
99
+ ));
127
100
  };
128
101
  var pisellAnchor_default = PisellAnchor;
@@ -1,47 +1,49 @@
1
- .pisell-anchor-container {
2
- position: sticky;
3
- top: 0;
4
- z-index: 999;
5
- display: flex;
6
- align-items: center;
7
- background-color: #fff;
8
- height: 40px;
9
-
10
- .pisell-lowcode-anchor {
11
- height: 40px;
12
- border-bottom: none !important;
13
-
14
- .pisell-lowcode-anchor-ink {
1
+ .pisell-anchor-containers {
2
+ // display: flex;
3
+ // align-items: center;
4
+ // background-color: #fff;
5
+ // height: 40px;
6
+ .pisell-lowcode-anchor-wrapper {
7
+ &::before {
8
+ content: '';
15
9
  display: none;
16
10
  }
11
+ .pisell-lowcode-anchor {
12
+ height: 40px;
13
+ border-bottom: none !important;
14
+ background-color: #fff;
17
15
 
18
- .pisell-lowcode-anchor-link {
19
- height: 100%;
20
- padding: 0 16px;
21
- display: flex;
22
- align-items: center;
16
+ .pisell-lowcode-anchor-ink {
17
+ display: none;
18
+ }
19
+
20
+ .pisell-lowcode-anchor-link {
21
+ height: 100%;
22
+ padding: 0 16px;
23
+ display: flex;
24
+ align-items: center;
23
25
 
24
- &-title {
25
- color: var(--Gray-900, #101828);
26
- font-family: Inter;
27
- font-size: 16px;
28
- font-weight: 600;
29
- line-height: 40px;
26
+ &-title {
27
+ color: var(--Gray-900, #101828);
28
+ font-family: Inter;
29
+ font-size: 16px;
30
+ font-weight: 600;
31
+ line-height: 40px;
32
+ }
30
33
  }
31
- }
32
34
 
33
- .pisell-lowcode-anchor-link-active {
34
- border-radius: 100px;
35
- background: var(--theme-color, #7f56d9);
36
- height: 40px;
35
+ .pisell-lowcode-anchor-link-active {
36
+ border-radius: 100px;
37
+ background: var(--theme-color, #7f56d9);
38
+ height: 40px;
37
39
 
38
- .pisell-lowcode-anchor-link-title {
39
- color: var(--White, #fff);
40
- line-height: 40px;
40
+ .pisell-lowcode-anchor-link-title {
41
+ color: var(--White, #fff);
42
+ line-height: 40px;
43
+ }
41
44
  }
42
45
  }
43
46
  }
44
-
45
47
  .pisell-anchor-scroll {
46
48
  height: 40px;
47
49
  flex: 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.511",
3
+ "version": "1.0.512",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -68,9 +68,9 @@
68
68
  "styled-components": "^6.0.0-rc.3",
69
69
  "libphonenumber-js": "^1.11.17",
70
70
  "swiper": "^8.4.7",
71
- "@pisell/utils": "1.0.43",
72
71
  "@pisell/date-picker": "1.0.114",
73
- "@pisell/icon": "0.0.10"
72
+ "@pisell/icon": "0.0.10",
73
+ "@pisell/utils": "1.0.43"
74
74
  },
75
75
  "peerDependencies": {
76
76
  "react": "^18.0.0",