wargerm 0.4.9 → 0.4.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,22 @@
1
- import { FC } from 'react';
1
+ import React from 'react';
2
2
  import { ReactNode } from 'react';
3
+ interface IsliderTabs {
4
+ tabs: Array<string>;
5
+ direction: 'left' | 'right';
6
+ defaultValue?: number;
7
+ className?: string;
8
+ tabClassName?: string;
9
+ activeTabClassName?: string;
10
+ components: Array<ReactNode>;
11
+ }
3
12
  declare type Props = {
4
13
  title: ReactNode;
5
14
  className: string;
6
15
  headerTail?: ReactNode;
7
16
  headerCenter?: ReactNode;
8
17
  children?: ReactNode;
18
+ sliderTabs?: IsliderTabs;
9
19
  style?: Record<string, string>;
10
20
  };
11
- declare const Index: FC<Props>;
12
- export default Index;
21
+ declare const _default: React.ForwardRefExoticComponent<Props & React.RefAttributes<any>>;
22
+ export default _default;
package/dist/index.css CHANGED
@@ -1058,6 +1058,45 @@ button[data-prefers-color='dark'] .swiper-pagination-bullet {
1058
1058
  transform: translate(-124px, -63px);
1059
1059
  padding: 12px 6px;
1060
1060
  }
1061
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs {
1062
+ position: absolute;
1063
+ }
1064
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs.left {
1065
+ right: -22px;
1066
+ top: 80px;
1067
+ }
1068
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs.right {
1069
+ left: -22px;
1070
+ top: 80px;
1071
+ }
1072
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs.right .tab::before {
1073
+ transform: skewy(-45deg);
1074
+ }
1075
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs .tab {
1076
+ -ms-writing-mode: tb-lr;
1077
+ writing-mode: vertical-lr;
1078
+ position: relative;
1079
+ margin-bottom: 2px;
1080
+ cursor: pointer;
1081
+ padding: 10px 2px;
1082
+ }
1083
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs .tab::before {
1084
+ content: '';
1085
+ position: absolute;
1086
+ width: 100%;
1087
+ height: 100%;
1088
+ transform: skewy(45deg);
1089
+ left: 0;
1090
+ top: 0;
1091
+ background: rgba(81, 190, 246, 0.28);
1092
+ border: 2px solid #51bef6;
1093
+ transition: background 0.3s ease;
1094
+ z-index: -1;
1095
+ }
1096
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs .tab.active::before {
1097
+ background: #51bef6;
1098
+ border: none;
1099
+ }
1061
1100
  [data-prefers-color='dark'] .card-container .container-in::before {
1062
1101
  content: '';
1063
1102
  position: absolute;
@@ -1058,6 +1058,45 @@ button[data-prefers-color='dark'] .swiper-pagination-bullet {
1058
1058
  transform: translate(-124px, -63px);
1059
1059
  padding: 12px 6px;
1060
1060
  }
1061
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs {
1062
+ position: absolute;
1063
+ }
1064
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs.left {
1065
+ right: -22px;
1066
+ top: 80px;
1067
+ }
1068
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs.right {
1069
+ left: -22px;
1070
+ top: 80px;
1071
+ }
1072
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs.right .tab::before {
1073
+ transform: skewy(-45deg);
1074
+ }
1075
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs .tab {
1076
+ -ms-writing-mode: tb-lr;
1077
+ writing-mode: vertical-lr;
1078
+ position: relative;
1079
+ margin-bottom: 2px;
1080
+ cursor: pointer;
1081
+ padding: 10px 2px;
1082
+ }
1083
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs .tab::before {
1084
+ content: '';
1085
+ position: absolute;
1086
+ width: 100%;
1087
+ height: 100%;
1088
+ transform: skewy(45deg);
1089
+ left: 0;
1090
+ top: 0;
1091
+ background: rgba(81, 190, 246, 0.28);
1092
+ border: 2px solid #51bef6;
1093
+ transition: background 0.3s ease;
1094
+ z-index: -1;
1095
+ }
1096
+ [data-prefers-color='dark'] .card-container .container-in .sliderTabs .tab.active::before {
1097
+ background: #51bef6;
1098
+ border: none;
1099
+ }
1061
1100
  [data-prefers-color='dark'] .card-container .container-in::before {
1062
1101
  content: '';
1063
1102
  position: absolute;
package/dist/index.esm.js CHANGED
@@ -4,7 +4,7 @@ import 'antd/es/dropdown/style';
4
4
  import _Dropdown from 'antd/es/dropdown';
5
5
  import 'antd/es/menu/style';
6
6
  import _Menu from 'antd/es/menu';
7
- import React, { memo, useState, useEffect, useMemo, useImperativeHandle, useRef } from 'react';
7
+ import React, { memo, useState, useEffect, useMemo, useImperativeHandle, useRef, forwardRef } from 'react';
8
8
  import { createFromIconfontCN, SearchOutlined, ReloadOutlined, CloseCircleOutlined, PlusOutlined, EllipsisOutlined, ExclamationCircleOutlined, EyeOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons';
9
9
  import 'antd/es/input/style';
10
10
  import _Input from 'antd/es/input';
@@ -9575,9 +9575,9 @@ var Index$b = function Index(_ref) {
9575
9575
  }, props));
9576
9576
  };
9577
9577
 
9578
- var _excluded$d = ["title", "className", "headerTail", "headerCenter"];
9578
+ var _excluded$d = ["title", "className", "headerTail", "headerCenter", "sliderTabs"];
9579
9579
 
9580
- var Index$c = function Index(_ref) {
9580
+ var Index$c = function Index(_ref, ref) {
9581
9581
  var _classNames;
9582
9582
 
9583
9583
  var title = _ref.title,
@@ -9585,8 +9585,20 @@ var Index$c = function Index(_ref) {
9585
9585
  className = _ref$className === void 0 ? 'default' : _ref$className,
9586
9586
  headerTail = _ref.headerTail,
9587
9587
  headerCenter = _ref.headerCenter,
9588
+ sliderTabs = _ref.sliderTabs,
9588
9589
  props = _objectWithoutProperties(_ref, _excluded$d);
9589
9590
 
9591
+ useImperativeHandle(ref, function () {
9592
+ return {
9593
+ activeTab: activeTab
9594
+ };
9595
+ });
9596
+
9597
+ var _useState = useState((sliderTabs === null || sliderTabs === void 0 ? void 0 : sliderTabs.defaultValue) || 0),
9598
+ _useState2 = _slicedToArray(_useState, 2),
9599
+ activeTab = _useState2[0],
9600
+ setActiveTab = _useState2[1];
9601
+
9590
9602
  return /*#__PURE__*/React.createElement("div", _objectSpread2({
9591
9603
  className: classnames((_classNames = {}, _defineProperty(_classNames, 'card-container', true), _defineProperty(_classNames, className, true), _classNames))
9592
9604
  }, props), /*#__PURE__*/React.createElement("div", {
@@ -9601,10 +9613,20 @@ var Index$c = function Index(_ref) {
9601
9613
  className: "dot"
9602
9614
  }), title), headerCenter, headerTail), /*#__PURE__*/React.createElement("div", {
9603
9615
  className: "body"
9604
- }, props.children))));
9616
+ }, sliderTabs ? sliderTabs.components[activeTab] : props.children)), sliderTabs && /*#__PURE__*/React.createElement("div", {
9617
+ className: "sliderTabs ".concat(sliderTabs.direction == 'left' ? "left ".concat(sliderTabs.className || '') : "right ".concat(sliderTabs.className || ''))
9618
+ }, sliderTabs.tabs.map(function (item, index) {
9619
+ return /*#__PURE__*/React.createElement("div", {
9620
+ className: "tab ".concat(index == activeTab ? 'active' : '', " ").concat(sliderTabs.tabClassName || '', " ").concat(sliderTabs.activeTabClassName || '')
9621
+ }, /*#__PURE__*/React.createElement("span", {
9622
+ onClick: function onClick() {
9623
+ return setActiveTab(index);
9624
+ }
9625
+ }, item));
9626
+ }))));
9605
9627
  };
9606
9628
 
9607
- Index$c.defaultProps = {};
9629
+ var index$1 = /*#__PURE__*/forwardRef(Index$c);
9608
9630
 
9609
9631
  var controlShow = function controlShow(f1, f2, value, timer) {
9610
9632
  f1(value);
@@ -10776,7 +10798,7 @@ var TabelCard = function TabelCard(props, ref) {
10776
10798
  }, extraProps)));
10777
10799
  };
10778
10800
 
10779
- var index$1 = /*#__PURE__*/React.forwardRef(TabelCard);
10801
+ var index$2 = /*#__PURE__*/React.forwardRef(TabelCard);
10780
10802
 
10781
10803
  var WebsocketHeart = /*#__PURE__*/_createClass(function WebsocketHeart(_ref) {
10782
10804
  var _this = this;
@@ -10940,4 +10962,4 @@ var WebsocketHeart = /*#__PURE__*/_createClass(function WebsocketHeart(_ref) {
10940
10962
  this.heartCheck = null;
10941
10963
  });
10942
10964
 
10943
- export { Index$9 as AutoScroll, Index$b as Breadcrumb, WButton as Button, Index$c as Card, WCascader as Cascader, Index$3 as Checkbox, Index$8 as CountUp, Index$1 as DatePicker, index as IconFont, Index as Input, WInputNumber as InputNumber, Modal, ModalForm$1 as ModalForm, Modal$1 as ModalTips, Index$7 as Number, NumericInput, Index$2 as Radio, Select, Index$a as Swiper, WSwitch as Switch, index$1 as TabelCard, Table, Index$6 as TreeSelect, Index$5 as WDatePicker, WForm$1 as WForm, WebsocketHeart };
10965
+ export { Index$9 as AutoScroll, Index$b as Breadcrumb, WButton as Button, index$1 as Card, WCascader as Cascader, Index$3 as Checkbox, Index$8 as CountUp, Index$1 as DatePicker, index as IconFont, Index as Input, WInputNumber as InputNumber, Modal, ModalForm$1 as ModalForm, Modal$1 as ModalTips, Index$7 as Number, NumericInput, Index$2 as Radio, Select, Index$a as Swiper, WSwitch as Switch, index$2 as TabelCard, Table, Index$6 as TreeSelect, Index$5 as WDatePicker, WForm$1 as WForm, WebsocketHeart };
package/dist/index.js CHANGED
@@ -9610,9 +9610,9 @@ var Index$b = function Index(_ref) {
9610
9610
  }, props));
9611
9611
  };
9612
9612
 
9613
- var _excluded$d = ["title", "className", "headerTail", "headerCenter"];
9613
+ var _excluded$d = ["title", "className", "headerTail", "headerCenter", "sliderTabs"];
9614
9614
 
9615
- var Index$c = function Index(_ref) {
9615
+ var Index$c = function Index(_ref, ref) {
9616
9616
  var _classNames;
9617
9617
 
9618
9618
  var title = _ref.title,
@@ -9620,8 +9620,20 @@ var Index$c = function Index(_ref) {
9620
9620
  className = _ref$className === void 0 ? 'default' : _ref$className,
9621
9621
  headerTail = _ref.headerTail,
9622
9622
  headerCenter = _ref.headerCenter,
9623
+ sliderTabs = _ref.sliderTabs,
9623
9624
  props = _objectWithoutProperties(_ref, _excluded$d);
9624
9625
 
9626
+ React.useImperativeHandle(ref, function () {
9627
+ return {
9628
+ activeTab: activeTab
9629
+ };
9630
+ });
9631
+
9632
+ var _useState = React.useState((sliderTabs === null || sliderTabs === void 0 ? void 0 : sliderTabs.defaultValue) || 0),
9633
+ _useState2 = _slicedToArray(_useState, 2),
9634
+ activeTab = _useState2[0],
9635
+ setActiveTab = _useState2[1];
9636
+
9625
9637
  return /*#__PURE__*/React__default['default'].createElement("div", _objectSpread2({
9626
9638
  className: classnames__default['default']((_classNames = {}, _defineProperty(_classNames, 'card-container', true), _defineProperty(_classNames, className, true), _classNames))
9627
9639
  }, props), /*#__PURE__*/React__default['default'].createElement("div", {
@@ -9636,10 +9648,20 @@ var Index$c = function Index(_ref) {
9636
9648
  className: "dot"
9637
9649
  }), title), headerCenter, headerTail), /*#__PURE__*/React__default['default'].createElement("div", {
9638
9650
  className: "body"
9639
- }, props.children))));
9651
+ }, sliderTabs ? sliderTabs.components[activeTab] : props.children)), sliderTabs && /*#__PURE__*/React__default['default'].createElement("div", {
9652
+ className: "sliderTabs ".concat(sliderTabs.direction == 'left' ? "left ".concat(sliderTabs.className || '') : "right ".concat(sliderTabs.className || ''))
9653
+ }, sliderTabs.tabs.map(function (item, index) {
9654
+ return /*#__PURE__*/React__default['default'].createElement("div", {
9655
+ className: "tab ".concat(index == activeTab ? 'active' : '', " ").concat(sliderTabs.tabClassName || '', " ").concat(sliderTabs.activeTabClassName || '')
9656
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
9657
+ onClick: function onClick() {
9658
+ return setActiveTab(index);
9659
+ }
9660
+ }, item));
9661
+ }))));
9640
9662
  };
9641
9663
 
9642
- Index$c.defaultProps = {};
9664
+ var index$1 = /*#__PURE__*/React.forwardRef(Index$c);
9643
9665
 
9644
9666
  var controlShow = function controlShow(f1, f2, value, timer) {
9645
9667
  f1(value);
@@ -10811,7 +10833,7 @@ var TabelCard = function TabelCard(props, ref) {
10811
10833
  }, extraProps)));
10812
10834
  };
10813
10835
 
10814
- var index$1 = /*#__PURE__*/React__default['default'].forwardRef(TabelCard);
10836
+ var index$2 = /*#__PURE__*/React__default['default'].forwardRef(TabelCard);
10815
10837
 
10816
10838
  var WebsocketHeart = /*#__PURE__*/_createClass(function WebsocketHeart(_ref) {
10817
10839
  var _this = this;
@@ -10978,7 +11000,7 @@ var WebsocketHeart = /*#__PURE__*/_createClass(function WebsocketHeart(_ref) {
10978
11000
  exports.AutoScroll = Index$9;
10979
11001
  exports.Breadcrumb = Index$b;
10980
11002
  exports.Button = WButton;
10981
- exports.Card = Index$c;
11003
+ exports.Card = index$1;
10982
11004
  exports.Cascader = WCascader;
10983
11005
  exports.Checkbox = Index$3;
10984
11006
  exports.CountUp = Index$8;
@@ -10995,7 +11017,7 @@ exports.Radio = Index$2;
10995
11017
  exports.Select = Select;
10996
11018
  exports.Swiper = Index$a;
10997
11019
  exports.Switch = WSwitch;
10998
- exports.TabelCard = index$1;
11020
+ exports.TabelCard = index$2;
10999
11021
  exports.Table = Table;
11000
11022
  exports.TreeSelect = Index$6;
11001
11023
  exports.WDatePicker = Index$5;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "wargerm",
4
- "version": "0.4.9",
4
+ "version": "0.4.10",
5
5
  "scripts": {
6
6
  "dev": "dumi dev",
7
7
  "docs:build": "dumi build",