shineout 3.3.0-beta.10 → 3.3.0-beta.12

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,8 +1,9 @@
1
1
  import { ModalProps } from '../modal/modal.type';
2
+ import { type } from '../utils';
2
3
  /**
3
4
  * @title Drawer
4
5
  */
5
- export interface DrawerProps extends Omit<ModalProps, 'moveable'> {
6
+ interface DrawerPropsOrgin extends Omit<ModalProps, 'moveable'> {
6
7
  /** *
7
8
  * @en 弹出位置
8
9
  * @cn Pop-up position
@@ -22,3 +23,5 @@ export interface DrawerProps extends Omit<ModalProps, 'moveable'> {
22
23
  */
23
24
  height?: number | string;
24
25
  }
26
+ export type DrawerProps = type.RequireAWithB<DrawerPropsOrgin, 'type', 'title'>;
27
+ export {};
package/cjs/index.js CHANGED
@@ -476,5 +476,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
476
476
  // 此文件由脚本自动生成,请勿直接修改。
477
477
  // This file was generated automatically by a script. Please do not modify it directly.
478
478
  var _default = exports.default = {
479
- version: '3.3.0-beta.10'
479
+ version: '3.3.0-beta.12'
480
480
  };
@@ -1 +1,2 @@
1
1
  export type { TabsProps as Props } from './tabs.type';
2
+ export type { TabsPanelProps as PanelProps } from './tabs-panel.type';
@@ -17,8 +17,9 @@ import normalizeWheel from './dom/normalizeWheel';
17
17
  import * as position from './dom/popover';
18
18
  import ready from './dom/ready';
19
19
  import isJson from './validate/isJson';
20
+ import * as type from './type';
20
21
  import accept from './accept';
21
22
  declare const validate: () => void;
22
23
  declare const cssAccessors: {};
23
24
  declare const cssInject: {};
24
- export { classname, clone, color, flat, func, hash, is, number, objects, shallowEqual, string, tree, detect, doc, element, normalizeWheel, position, ready, isJson, validate, cssAccessors, cssInject, accept, };
25
+ export { classname, clone, color, flat, func, hash, is, number, objects, shallowEqual, string, tree, detect, doc, element, normalizeWheel, position, ready, isJson, validate, cssAccessors, cssInject, type, accept, };
@@ -49,7 +49,7 @@ Object.defineProperty(exports, "shallowEqual", {
49
49
  return _shallowEqual.default;
50
50
  }
51
51
  });
52
- exports.validate = exports.tree = exports.string = void 0;
52
+ exports.validate = exports.type = exports.tree = exports.string = void 0;
53
53
  var _classname = _interopRequireDefault(require("./classname"));
54
54
  var clone = _interopRequireWildcard(require("./clone"));
55
55
  exports.clone = clone;
@@ -82,6 +82,8 @@ var position = _interopRequireWildcard(require("./dom/popover"));
82
82
  exports.position = position;
83
83
  var _ready = _interopRequireDefault(require("./dom/ready"));
84
84
  var _isJson = _interopRequireDefault(require("./validate/isJson"));
85
+ var type = _interopRequireWildcard(require("./type"));
86
+ exports.type = type;
85
87
  var _accept = _interopRequireDefault(require("./accept"));
86
88
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
87
89
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -0,0 +1,3 @@
1
+ export type RequireAWithB<T, A extends keyof T, B extends keyof T> = (Omit<T, A> & {
2
+ [K in A]?: never;
3
+ }) | (T & Required<Pick<T, B>>) | (T & Required<Pick<T, A | B>>);
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
package/dist/shineout.js CHANGED
@@ -338,6 +338,13 @@ return /******/ (function() { // webpackBootstrap
338
338
 
339
339
 
340
340
 
341
+ /***/ }),
342
+
343
+ /***/ 514:
344
+ /***/ (function() {
345
+
346
+
347
+
341
348
  /***/ }),
342
349
 
343
350
  /***/ 4689:
@@ -6568,6 +6575,7 @@ __webpack_require__.d(src_utils_namespaceObject, {
6568
6575
  shallowEqual: function() { return utils_shallowEqual; },
6569
6576
  string: function() { return strings_namespaceObject; },
6570
6577
  tree: function() { return src_utils_tree_namespaceObject; },
6578
+ type: function() { return type; },
6571
6579
  validate: function() { return src_utils_validate; }
6572
6580
  });
6573
6581
 
@@ -11960,7 +11968,7 @@ var handleStyle = function handleStyle(style) {
11960
11968
  };
11961
11969
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
11962
11970
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
11963
- /* harmony default export */ var version = ('3.3.0-beta.10');
11971
+ /* harmony default export */ var version = ('3.3.0-beta.12');
11964
11972
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11965
11973
 
11966
11974
 
@@ -20668,10 +20676,6 @@ var modalStyle = objectSpread2_default()(objectSpread2_default()({}, animationSt
20668
20676
  display: 'flex',
20669
20677
  marginBottom: src.modalPanelGap
20670
20678
  },
20671
- headerEmptyTitle: {
20672
- marginBottom: 0,
20673
- height: 0
20674
- },
20675
20679
  headerIcon: {
20676
20680
  '$wrapper &': {
20677
20681
  marginRight: src.modalHeaderIconMarginEnd,
@@ -20683,6 +20687,9 @@ var modalStyle = objectSpread2_default()(objectSpread2_default()({}, animationSt
20683
20687
  alignItems: 'center'
20684
20688
  }
20685
20689
  },
20690
+ emptyIcon: {
20691
+ position: 'absolute'
20692
+ },
20686
20693
  headerTitle: {
20687
20694
  flex: '1',
20688
20695
  minWidth: 0,
@@ -20717,6 +20724,16 @@ var modalStyle = objectSpread2_default()(objectSpread2_default()({}, animationSt
20717
20724
  })
20718
20725
  }
20719
20726
  },
20727
+ emptyClose: {
20728
+ position: 'absolute',
20729
+ top: 12,
20730
+ right: 12,
20731
+ marginTop: 0,
20732
+ '$wrapperDrawer &': {
20733
+ top: 4,
20734
+ right: 4
20735
+ }
20736
+ },
20720
20737
  body: {
20721
20738
  flex: '1 1 auto',
20722
20739
  minHeight: '1px',
@@ -24215,9 +24232,6 @@ var tableStyle = objectSpread2_default()(objectSpread2_default()({}, globalStyle
24215
24232
  background: src.tableTfootBackgroundColor,
24216
24233
  color: src.tableTfootFontColor,
24217
24234
  fontWeight: src.tableTfootFontWeight
24218
- },
24219
- '&bordered tr:last-child td': {
24220
- borderBottom: 'none'
24221
24235
  }
24222
24236
  }
24223
24237
  },
@@ -24268,6 +24282,17 @@ var tableStyle = objectSpread2_default()(objectSpread2_default()({}, globalStyle
24268
24282
  bordered: {
24269
24283
  border: "1px solid ".concat(src.tableCellBorderColor),
24270
24284
  borderBottom: 'none',
24285
+ borderTop: 'none',
24286
+ '&::before': {
24287
+ position: 'absolute',
24288
+ zIndex: 7,
24289
+ content: '""',
24290
+ display: 'block',
24291
+ top: 0,
24292
+ left: 0,
24293
+ right: 0,
24294
+ borderTop: "1px solid ".concat(src.tableCellBorderColor)
24295
+ },
24271
24296
  '&::after': {
24272
24297
  position: 'absolute',
24273
24298
  content: '""',
@@ -43262,24 +43287,34 @@ var Modal = function Modal(props) {
43262
43287
  }, []);
43263
43288
 
43264
43289
  // render
43265
-
43266
- var renderIcon = function renderIcon() {
43290
+ var renderIcon = function renderIcon(isEmptyTitle) {
43291
+ var iconRoot = classnames_default()(modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.headerIcon, isEmptyTitle && (modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.emptyIcon));
43267
43292
  return /*#__PURE__*/(0,jsx_runtime.jsx)(alert_icon, {
43268
43293
  jssStyle: props.jssStyle,
43269
43294
  type: props.type,
43270
- className: modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.headerIcon
43295
+ className: iconRoot
43271
43296
  });
43272
43297
  };
43273
43298
  var renderHeader = function renderHeader() {
43274
- var showCloseIcon = maskCloseAble === null || !!maskCloseAble;
43299
+ var showCloseIcon = (maskCloseAble === null || !!maskCloseAble) && !props.hideClose;
43275
43300
  var isEmptyTitle = !props.title && props.title !== 0;
43301
+ if (isEmptyTitle) {
43302
+ var closeRoot = classnames_default()(modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.headerClose, modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.emptyClose);
43303
+ return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
43304
+ children: [renderIcon(isEmptyTitle), showCloseIcon && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
43305
+ className: closeRoot,
43306
+ onClick: handleClose,
43307
+ children: icons_config.modal.Close
43308
+ })]
43309
+ });
43310
+ }
43276
43311
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
43277
- className: classnames_default()(modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.header, isEmptyTitle && (modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.headerEmptyTitle)),
43312
+ className: modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.header,
43278
43313
  onMouseDown: props.moveable ? moveInfo.handleMouseDown : undefined,
43279
43314
  children: [renderIcon(), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
43280
43315
  className: modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.headerTitle,
43281
43316
  children: props.title
43282
- }), showCloseIcon && !props.hideClose && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
43317
+ }), showCloseIcon && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
43283
43318
  className: modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.headerClose,
43284
43319
  onClick: handleClose,
43285
43320
  children: icons_config.modal.Close
@@ -50996,6 +51031,9 @@ var usePagination = function usePagination(props) {
50996
51031
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
50997
51032
  if (pageSizeProp !== pageSize) setPageSize(pageSizeProp);
50998
51033
  }, [pageSizeProp]);
51034
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
51035
+ if (currentProp !== undefined && currentProp !== current) setCurrent(currentProp);
51036
+ }, [currentProp]);
50999
51037
  var handleChange = usePersistFn(function (c, size) {
51000
51038
  if (c === current && size === undefined) return;
51001
51039
  setCurrent(c);
@@ -51015,7 +51053,7 @@ var usePagination = function usePagination(props) {
51015
51053
  return objectSpread2_default()({}, mergedEventHandlers);
51016
51054
  };
51017
51055
  return {
51018
- current: currentProp !== undefined ? currentProp : current,
51056
+ current: current,
51019
51057
  pageSize: pageSize,
51020
51058
  total: total,
51021
51059
  onChange: handleChange,
@@ -55264,10 +55302,11 @@ var useTableLayout = function useTableLayout(props) {
55264
55302
  setAdjust(false);
55265
55303
  } else {
55266
55304
  checkFloat();
55267
- checkScroll();
55305
+ // checkScroll();
55268
55306
  // 拖拽列会导致 scrollWidth 变化
55269
55307
  syncScrollWidth();
55270
55308
  }
55309
+ checkScroll();
55271
55310
  }, [colgroup]);
55272
55311
  return {
55273
55312
  isScrollX: !!isScrollX,
@@ -55534,7 +55573,6 @@ var useTableTree = function useTableTree(props) {
55534
55573
 
55535
55574
 
55536
55575
 
55537
-
55538
55576
  var useTableVirtual = function useTableVirtual(props) {
55539
55577
  var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
55540
55578
  _useState2 = slicedToArray_default()(_useState, 2),
@@ -55552,7 +55590,6 @@ var useTableVirtual = function useTableVirtual(props) {
55552
55590
  _useState8 = slicedToArray_default()(_useState7, 2),
55553
55591
  startIndex = _useState8[0],
55554
55592
  setStartIndex = _useState8[1];
55555
- var preIndex = usePrevious(startIndex);
55556
55593
  var _useState9 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
55557
55594
  _useState10 = slicedToArray_default()(_useState9, 2),
55558
55595
  offsetY = _useState10[0],
@@ -55565,7 +55602,8 @@ var useTableVirtual = function useTableVirtual(props) {
55565
55602
  rateTimer: null,
55566
55603
  topTimer: null,
55567
55604
  controlScrollRate: null,
55568
- heightCallback: null
55605
+ heightCallback: null,
55606
+ preIndex: null
55569
55607
  }),
55570
55608
  context = _useRef.current;
55571
55609
  var getTranslate = usePersistFn(function (left, top) {
@@ -55598,6 +55636,8 @@ var useTableVirtual = function useTableVirtual(props) {
55598
55636
  if (context.shouldUpdateHeight) {
55599
55637
  setHeight(getContentHeight(props.data.length - 1));
55600
55638
  }
55639
+ var preIndex = context.preIndex;
55640
+ // 解决: 从下往上滚 由于高度变化会导致滚动条跳动
55601
55641
  if (preIndex && preIndex > startIndex && startIndex === index) {
55602
55642
  // 发生在顶部
55603
55643
  if (context.heightCallback) return;
@@ -55702,6 +55742,16 @@ var useTableVirtual = function useTableVirtual(props) {
55702
55742
  props.scrollRef.current.scrollTop = beforeHeight;
55703
55743
  }
55704
55744
  });
55745
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
55746
+ // 记录preIndex
55747
+ context.preIndex = startIndex;
55748
+ }, [startIndex]);
55749
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
55750
+ // 数据变化的时候清空掉 preIndex, 如果之前有缓存的index, setRowHeight 会有问题
55751
+ return function () {
55752
+ context.preIndex = null;
55753
+ };
55754
+ }, [props.data]);
55705
55755
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
55706
55756
  if (props.disabled) return;
55707
55757
  if (offsetY) {
@@ -57208,8 +57258,6 @@ var emptyRef = {
57208
57258
  jssStyle: props.jssStyle,
57209
57259
  colgroup: colgroup
57210
57260
  };
57211
- var headWrapperClass = classnames_default()(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.headWrapper, isScrollY && scrollBarWidth && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.scrollY));
57212
- var footWrapperClass = classnames_default()(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.footWrapper, isScrollY && scrollBarWidth && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.scrollY));
57213
57261
  var fixRightNum = (isRtl ? -1 * maxScrollLeft : maxScrollLeft) - virtualInfo.innerLeft;
57214
57262
  var Wrapper = props.sticky ? src_sticky_sticky : (external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment;
57215
57263
  var sticky = typeof_default()(props.sticky) === 'object' ? props.sticky : {
@@ -57222,7 +57270,10 @@ var emptyRef = {
57222
57270
  css: sticky === null || sticky === void 0 ? void 0 : sticky.css,
57223
57271
  parent: tableRef === null || tableRef === void 0 ? void 0 : tableRef.current
57224
57272
  };
57225
- if (!virtual && !isScrollY && !props.sticky && (_props$data3 = props.data) !== null && _props$data3 !== void 0 && _props$data3.length) {
57273
+ var isRenderBaseTable = !virtual && !isScrollY && !props.sticky && ((_props$data3 = props.data) === null || _props$data3 === void 0 ? void 0 : _props$data3.length);
57274
+ var headWrapperClass = classnames_default()(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.headWrapper, (isScrollY && scrollBarWidth || isRenderBaseTable) && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.scrollY));
57275
+ var footWrapperClass = classnames_default()(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.footWrapper, (isScrollY && scrollBarWidth || isRenderBaseTable) && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.scrollY));
57276
+ if (isRenderBaseTable) {
57226
57277
  return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
57227
57278
  ref: scrollRef,
57228
57279
  className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.bodyWrapper,
@@ -58294,6 +58345,7 @@ src_textarea_textarea_0.displayName = 'ShineoutTextarea';
58294
58345
 
58295
58346
 
58296
58347
 
58348
+ var defaultDelay = 0;
58297
58349
  var Tooltip = function Tooltip(props) {
58298
58350
  var _jssStyle$tooltip;
58299
58351
  var _props$trigger = props.trigger,
@@ -58313,11 +58365,13 @@ var Tooltip = function Tooltip(props) {
58313
58365
  var tooltipClasses = jssStyle === null || jssStyle === void 0 || (_jssStyle$tooltip = jssStyle.tooltip) === null || _jssStyle$tooltip === void 0 ? void 0 : _jssStyle$tooltip.call(jssStyle);
58314
58366
  var config = useConfig();
58315
58367
  var childrenProps = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement)(children) ? children === null || children === void 0 ? void 0 : children.props : {};
58368
+ var delay = props.delay || props.mouseEnterDelay || defaultDelay;
58316
58369
  var _usePopup = use_popup({
58317
58370
  position: popsitionProps,
58318
58371
  trigger: trigger,
58319
58372
  autoMode: 'popover',
58320
58373
  priorityDirection: priorityDirection,
58374
+ mouseEnterDelay: delay,
58321
58375
  targetEvents: disabledChild ? {} : childrenProps
58322
58376
  }),
58323
58377
  open = _usePopup.open,
@@ -63126,6 +63180,8 @@ var popover_getPosition = function getPosition(position, el) {
63126
63180
  return false;
63127
63181
  }
63128
63182
  }
63183
+ // EXTERNAL MODULE: ./src/utils/type.ts
63184
+ var type = __webpack_require__(514);
63129
63185
  ;// CONCATENATED MODULE: ./src/utils/accept.ts
63130
63186
  function accept_attrAccept(file, acceptedFiles) {
63131
63187
  if (file && acceptedFiles) {
@@ -63167,6 +63223,7 @@ function accept_attrAccept(file, acceptedFiles) {
63167
63223
 
63168
63224
 
63169
63225
 
63226
+
63170
63227
  // import validate from './validate';
63171
63228
 
63172
63229
 
@@ -63462,7 +63519,7 @@ var upload_interface = __webpack_require__(8821);
63462
63519
 
63463
63520
 
63464
63521
  /* harmony default export */ var src_0 = ({
63465
- version: '3.3.0-beta.10'
63522
+ version: '3.3.0-beta.12'
63466
63523
  });
63467
63524
  }();
63468
63525
  /******/ return __webpack_exports__;