shineout 3.3.0-beta.11 → 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.11'
479
+ version: '3.3.0-beta.12'
480
480
  };
@@ -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.11');
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',
@@ -43270,24 +43287,34 @@ var Modal = function Modal(props) {
43270
43287
  }, []);
43271
43288
 
43272
43289
  // render
43273
-
43274
- 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));
43275
43292
  return /*#__PURE__*/(0,jsx_runtime.jsx)(alert_icon, {
43276
43293
  jssStyle: props.jssStyle,
43277
43294
  type: props.type,
43278
- className: modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.headerIcon
43295
+ className: iconRoot
43279
43296
  });
43280
43297
  };
43281
43298
  var renderHeader = function renderHeader() {
43282
- var showCloseIcon = maskCloseAble === null || !!maskCloseAble;
43299
+ var showCloseIcon = (maskCloseAble === null || !!maskCloseAble) && !props.hideClose;
43283
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
+ }
43284
43311
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
43285
- 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,
43286
43313
  onMouseDown: props.moveable ? moveInfo.handleMouseDown : undefined,
43287
43314
  children: [renderIcon(), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
43288
43315
  className: modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.headerTitle,
43289
43316
  children: props.title
43290
- }), showCloseIcon && !props.hideClose && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
43317
+ }), showCloseIcon && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
43291
43318
  className: modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.headerClose,
43292
43319
  onClick: handleClose,
43293
43320
  children: icons_config.modal.Close
@@ -55269,16 +55296,17 @@ var useTableLayout = function useTableLayout(props) {
55269
55296
  (_cancelFunc = cancelFunc) === null || _cancelFunc === void 0 || _cancelFunc();
55270
55297
  };
55271
55298
  }, [scrollRef.current]);
55272
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
55299
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
55273
55300
  if (adjust) {
55274
55301
  getColgroup(adjust === 'drag');
55275
55302
  setAdjust(false);
55276
55303
  } else {
55277
55304
  checkFloat();
55278
- checkScroll();
55305
+ // checkScroll();
55279
55306
  // 拖拽列会导致 scrollWidth 变化
55280
55307
  syncScrollWidth();
55281
55308
  }
55309
+ checkScroll();
55282
55310
  }, [colgroup]);
55283
55311
  return {
55284
55312
  isScrollX: !!isScrollX,
@@ -55545,7 +55573,6 @@ var useTableTree = function useTableTree(props) {
55545
55573
 
55546
55574
 
55547
55575
 
55548
-
55549
55576
  var useTableVirtual = function useTableVirtual(props) {
55550
55577
  var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
55551
55578
  _useState2 = slicedToArray_default()(_useState, 2),
@@ -55563,7 +55590,6 @@ var useTableVirtual = function useTableVirtual(props) {
55563
55590
  _useState8 = slicedToArray_default()(_useState7, 2),
55564
55591
  startIndex = _useState8[0],
55565
55592
  setStartIndex = _useState8[1];
55566
- var preIndex = usePrevious(startIndex);
55567
55593
  var _useState9 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
55568
55594
  _useState10 = slicedToArray_default()(_useState9, 2),
55569
55595
  offsetY = _useState10[0],
@@ -55576,7 +55602,8 @@ var useTableVirtual = function useTableVirtual(props) {
55576
55602
  rateTimer: null,
55577
55603
  topTimer: null,
55578
55604
  controlScrollRate: null,
55579
- heightCallback: null
55605
+ heightCallback: null,
55606
+ preIndex: null
55580
55607
  }),
55581
55608
  context = _useRef.current;
55582
55609
  var getTranslate = usePersistFn(function (left, top) {
@@ -55609,6 +55636,8 @@ var useTableVirtual = function useTableVirtual(props) {
55609
55636
  if (context.shouldUpdateHeight) {
55610
55637
  setHeight(getContentHeight(props.data.length - 1));
55611
55638
  }
55639
+ var preIndex = context.preIndex;
55640
+ // 解决: 从下往上滚 由于高度变化会导致滚动条跳动
55612
55641
  if (preIndex && preIndex > startIndex && startIndex === index) {
55613
55642
  // 发生在顶部
55614
55643
  if (context.heightCallback) return;
@@ -55713,6 +55742,16 @@ var useTableVirtual = function useTableVirtual(props) {
55713
55742
  props.scrollRef.current.scrollTop = beforeHeight;
55714
55743
  }
55715
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]);
55716
55755
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
55717
55756
  if (props.disabled) return;
55718
55757
  if (offsetY) {
@@ -57219,8 +57258,6 @@ var emptyRef = {
57219
57258
  jssStyle: props.jssStyle,
57220
57259
  colgroup: colgroup
57221
57260
  };
57222
- var headWrapperClass = classnames_default()(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.headWrapper, isScrollY && scrollBarWidth && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.scrollY));
57223
- var footWrapperClass = classnames_default()(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.footWrapper, isScrollY && scrollBarWidth && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.scrollY));
57224
57261
  var fixRightNum = (isRtl ? -1 * maxScrollLeft : maxScrollLeft) - virtualInfo.innerLeft;
57225
57262
  var Wrapper = props.sticky ? src_sticky_sticky : (external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment;
57226
57263
  var sticky = typeof_default()(props.sticky) === 'object' ? props.sticky : {
@@ -57233,7 +57270,10 @@ var emptyRef = {
57233
57270
  css: sticky === null || sticky === void 0 ? void 0 : sticky.css,
57234
57271
  parent: tableRef === null || tableRef === void 0 ? void 0 : tableRef.current
57235
57272
  };
57236
- 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) {
57237
57277
  return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
57238
57278
  ref: scrollRef,
57239
57279
  className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.bodyWrapper,
@@ -58305,6 +58345,7 @@ src_textarea_textarea_0.displayName = 'ShineoutTextarea';
58305
58345
 
58306
58346
 
58307
58347
 
58348
+ var defaultDelay = 0;
58308
58349
  var Tooltip = function Tooltip(props) {
58309
58350
  var _jssStyle$tooltip;
58310
58351
  var _props$trigger = props.trigger,
@@ -58324,11 +58365,13 @@ var Tooltip = function Tooltip(props) {
58324
58365
  var tooltipClasses = jssStyle === null || jssStyle === void 0 || (_jssStyle$tooltip = jssStyle.tooltip) === null || _jssStyle$tooltip === void 0 ? void 0 : _jssStyle$tooltip.call(jssStyle);
58325
58366
  var config = useConfig();
58326
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;
58327
58369
  var _usePopup = use_popup({
58328
58370
  position: popsitionProps,
58329
58371
  trigger: trigger,
58330
58372
  autoMode: 'popover',
58331
58373
  priorityDirection: priorityDirection,
58374
+ mouseEnterDelay: delay,
58332
58375
  targetEvents: disabledChild ? {} : childrenProps
58333
58376
  }),
58334
58377
  open = _usePopup.open,
@@ -63137,6 +63180,8 @@ var popover_getPosition = function getPosition(position, el) {
63137
63180
  return false;
63138
63181
  }
63139
63182
  }
63183
+ // EXTERNAL MODULE: ./src/utils/type.ts
63184
+ var type = __webpack_require__(514);
63140
63185
  ;// CONCATENATED MODULE: ./src/utils/accept.ts
63141
63186
  function accept_attrAccept(file, acceptedFiles) {
63142
63187
  if (file && acceptedFiles) {
@@ -63178,6 +63223,7 @@ function accept_attrAccept(file, acceptedFiles) {
63178
63223
 
63179
63224
 
63180
63225
 
63226
+
63181
63227
  // import validate from './validate';
63182
63228
 
63183
63229
 
@@ -63473,7 +63519,7 @@ var upload_interface = __webpack_require__(8821);
63473
63519
 
63474
63520
 
63475
63521
  /* harmony default export */ var src_0 = ({
63476
- version: '3.3.0-beta.11'
63522
+ version: '3.3.0-beta.12'
63477
63523
  });
63478
63524
  }();
63479
63525
  /******/ return __webpack_exports__;