shineout 3.8.0-beta.8 → 3.8.0-beta.9

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,9 +1,14 @@
1
- import { FormFieldProps as UiFormFieldProps, FormFieldSetProps as UiFormFieldSetProps, FormItemProps as UiFormItemProps, FormProps as UiFormProps, ObjectType, FormFlowProps as UiFormFlowProps, FormRef as UiFormRef } from '@sheinx/base';
1
+ import { FormFieldProps as UiFormFieldProps, FormFieldSetProps as UiFormFieldSetProps, FormItemProps as UiFormItemProps, FormProps as UiFormProps, ObjectType, FormFlowProps as UiFormFlowProps, FormRef as UiFormRef, FormDatum as UiFormDatum } from '@sheinx/base';
2
2
  /**
3
3
  * @title FormRef
4
4
  * @sort 6
5
5
  */
6
6
  export type FormRef<T> = UiFormRef<T>;
7
+ /**
8
+ * @title FormDatum
9
+ * @sort 7
10
+ */
11
+ export type FormDatum = UiFormDatum;
7
12
  /**
8
13
  * @title Form
9
14
  * @sort 1
@@ -1,3 +1,3 @@
1
1
  export type { FormRef as Ref, FormFieldChildrenFunc as FieldChildrenFunc, FormFieldSetChildrenFunc as FieldSetChildrenFunc, } from '@sheinx/base';
2
- export type { FormProps as Props, FormItemProps as ItemProps, FormFieldProps as FieldProps, FormFieldSetProps as FieldSetProps, } from './form.type';
2
+ export type { FormProps as Props, FormItemProps as ItemProps, FormFieldProps as FieldProps, FormFieldSetProps as FieldSetProps, FormFlowProps as FlowProps, FormDatum as Datum, } from './form.type';
3
3
  export type { ButtonProps as SubmitProps, ButtonProps as ResetProps } from '../button/button.type';
package/cjs/index.js CHANGED
@@ -522,5 +522,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
522
522
  // 此文件由脚本自动生成,请勿直接修改。
523
523
  // This file was generated automatically by a script. Please do not modify it directly.
524
524
  var _default = exports.default = {
525
- version: '3.8.0-beta.8'
525
+ version: '3.8.0-beta.9'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12234,7 +12234,7 @@ var handleStyle = function handleStyle(style) {
12234
12234
  };
12235
12235
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12236
12236
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12237
- /* harmony default export */ var version = ('3.8.0-beta.8');
12237
+ /* harmony default export */ var version = ('3.8.0-beta.9');
12238
12238
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12239
12239
 
12240
12240
 
@@ -19625,6 +19625,11 @@ var formItemStyle = objectSpread2_default()(objectSpread2_default()({
19625
19625
  top: '2px'
19626
19626
  }
19627
19627
  },
19628
+ wrapperHideRequired: {
19629
+ '& $label::before': {
19630
+ display: 'none'
19631
+ }
19632
+ },
19628
19633
  wrapperKeepHeight: {
19629
19634
  marginBottom: src.formItemTipMinHeight,
19630
19635
  '&$wrapperTip': {
@@ -22169,7 +22174,9 @@ var setToken = function setToken(options) {
22169
22174
  attributes = _ref.attributes,
22170
22175
  onlyExtra = _ref.onlyExtra,
22171
22176
  update = _ref.update,
22172
- customExtraToken = _ref.extraToken;
22177
+ customExtraToken = _ref.extraToken,
22178
+ _ref$ignoreExtra = _ref.ignoreExtra,
22179
+ ignoreExtra = _ref$ignoreExtra === void 0 ? false : _ref$ignoreExtra;
22173
22180
  var _getConfig = getConfig(),
22174
22181
  prefix = _getConfig.prefix;
22175
22182
  if (typeof window === 'undefined') return;
@@ -22208,7 +22215,7 @@ var setToken = function setToken(options) {
22208
22215
  tag.setAttribute('data-token', tokenName || '');
22209
22216
  tag.setAttribute('data-token-id', id);
22210
22217
  tag.setAttribute('data-token-selector', selector);
22211
- tag.innerHTML = "".concat(selector, " {").concat(tokens.concat(extraToken).join(';'), "}");
22218
+ tag.innerHTML = ignoreExtra ? "".concat(selector, " {").concat(tokens.join(';'), "}") : "".concat(selector, " {").concat(tokens.concat(extraToken).join(';'), "}");
22212
22219
  if (!target) {
22213
22220
  document.head.appendChild(tag);
22214
22221
  return;
@@ -30832,14 +30839,14 @@ var useCheckElementBorderWidth = function useCheckElementBorderWidth(elementRef)
30832
30839
 
30833
30840
  // 获取指定方向上的border宽度之和
30834
30841
  var getBorderWidth = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(function () {
30835
- if (elementRef.current) {
30842
+ if (elementRef.current && options.enable) {
30836
30843
  var _options$direction = options.direction,
30837
30844
  direction = _options$direction === void 0 ? 'horizontal' : _options$direction;
30838
30845
  var style = window.getComputedStyle(elementRef.current);
30839
30846
  var _borderWidth = direction === 'horizontal' ? parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth) : parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
30840
30847
  setBorderWidth(_borderWidth);
30841
30848
  }
30842
- }, [elementRef]);
30849
+ }, [elementRef, options.enable]);
30843
30850
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
30844
30851
  getBorderWidth();
30845
30852
  }, [getBorderWidth]);
@@ -31100,7 +31107,8 @@ var usePositionStyle = function usePositionStyle(config) {
31100
31107
  enable: show && adjust
31101
31108
  });
31102
31109
  var parentElBorderWidth = useCheckElementBorderWidth(parentElRef, {
31103
- direction: 'horizontal'
31110
+ direction: 'horizontal',
31111
+ enable: show
31104
31112
  });
31105
31113
  var popupElSize = useCheckElementSize(popupElRef, {
31106
31114
  enable: show
@@ -31279,16 +31287,18 @@ var usePositionStyle = function usePositionStyle(config) {
31279
31287
  };
31280
31288
  };
31281
31289
  var getAbsoluteStyle = function getAbsoluteStyle(position) {
31282
- var _scrollElRef$current;
31290
+ var _scrollElRef$current, _scrollElRef$current2, _scrollElRef$current3;
31283
31291
  if (!parentElRef.current) return {
31284
31292
  style: hideStyle
31285
31293
  };
31286
31294
  var rect = context.parentRect;
31287
31295
  var needCheck = !show || !shallow_equal(context.prevParentPosition, parentElNewPosition);
31288
- if (needCheck && scrollElRef !== null && scrollElRef !== void 0 && scrollElRef.current && (_scrollElRef$current = scrollElRef.current) !== null && _scrollElRef$current !== void 0 && _scrollElRef$current.contains(parentElRef.current)) {
31289
- var _scrollElRef$current2;
31290
- var visibleRect = ((_scrollElRef$current2 = scrollElRef.current) === null || _scrollElRef$current2 === void 0 ? void 0 : _scrollElRef$current2.getBoundingClientRect()) || {};
31291
- if (rect.bottom < visibleRect.top || rect.top > visibleRect.bottom || rect.right < visibleRect.left || rect.left > visibleRect.right) {
31296
+ var scrollTop = (scrollElRef === null || scrollElRef === void 0 || (_scrollElRef$current = scrollElRef.current) === null || _scrollElRef$current === void 0 ? void 0 : _scrollElRef$current.scrollTop) || 0;
31297
+ var scrollLeft = (scrollElRef === null || scrollElRef === void 0 || (_scrollElRef$current2 = scrollElRef.current) === null || _scrollElRef$current2 === void 0 ? void 0 : _scrollElRef$current2.scrollLeft) || 0;
31298
+ if (needCheck && scrollElRef !== null && scrollElRef !== void 0 && scrollElRef.current && (_scrollElRef$current3 = scrollElRef.current) !== null && _scrollElRef$current3 !== void 0 && _scrollElRef$current3.contains(parentElRef.current)) {
31299
+ var _scrollElRef$current4;
31300
+ var visibleRect = ((_scrollElRef$current4 = scrollElRef.current) === null || _scrollElRef$current4 === void 0 ? void 0 : _scrollElRef$current4.getBoundingClientRect()) || {};
31301
+ if (rect.bottom < visibleRect.top || rect.top > visibleRect.bottom + scrollTop || rect.right < visibleRect.left || rect.left > visibleRect.right + scrollLeft) {
31292
31302
  return {
31293
31303
  style: hideStyle
31294
31304
  };
@@ -32043,12 +32053,12 @@ var AbsoluteList = function AbsoluteList(props) {
32043
32053
  return scrollElRefProp || scrollElRefContext || closestScrollContainerRef;
32044
32054
  }, [scrollElRefProp, scrollElRefContext]);
32045
32055
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
32046
- if (scrollElRefProp || scrollElRefContext) return;
32056
+ if (scrollElRefProp || scrollElRefContext || !focus) return;
32047
32057
  var closestScrollContainer = getClosestScrollContainer(parentElRef.current);
32048
32058
  if (closestScrollContainer) {
32049
32059
  closestScrollContainerRef.current = closestScrollContainer;
32050
32060
  }
32051
- }, [parentElRef, scrollElRefProp, scrollElRefContext]);
32061
+ }, [parentElRef, scrollElRefProp, scrollElRefContext, focus]);
32052
32062
  var _usePositionStyle = usePositionStyle({
32053
32063
  getContainer: getRoot,
32054
32064
  position: position,
@@ -47751,7 +47761,7 @@ var DatePicker = function DatePicker(props0) {
47751
47761
  setFocused(false);
47752
47762
  (_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 || _props$onBlur.call(props, e, index);
47753
47763
  if (props.needConfirm) return;
47754
- if (props.inputable && index !== undefined) {
47764
+ if (props.inputable && !props.quickSelect && index !== undefined) {
47755
47765
  func.handleInputBlur(e.target.value, index);
47756
47766
  }
47757
47767
 
@@ -51001,13 +51011,14 @@ var useForm = function useForm(props) {
51001
51011
  /* harmony default export */ var use_form = (useForm);
51002
51012
  ;// CONCATENATED MODULE: ../hooks/src/components/use-form/use-form-context.ts
51003
51013
 
51014
+
51004
51015
  var FormContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createContext({});
51005
51016
  function useFormRef() {
51006
- var ref = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef({});
51007
- var setFormRef = function setFormRef(formRef) {
51008
- ref.current = formRef;
51009
- };
51010
- return [ref.current, setFormRef];
51017
+ var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState({}),
51018
+ _React$useState2 = slicedToArray_default()(_React$useState, 2),
51019
+ formRef = _React$useState2[0],
51020
+ setFormRef = _React$useState2[1];
51021
+ return [formRef, setFormRef];
51011
51022
  }
51012
51023
  function useFormInstance() {
51013
51024
  var formCtx = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useContext(FormContext);
@@ -51448,7 +51459,7 @@ var FormItem = function FormItem(props) {
51448
51459
  });
51449
51460
  };
51450
51461
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", objectSpread2_default()(objectSpread2_default()({
51451
- className: classnames_default()(className, formItemClasses === null || formItemClasses === void 0 ? void 0 : formItemClasses.wrapper, defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()({}, formItemClasses === null || formItemClasses === void 0 ? void 0 : formItemClasses.wrapperLabelTop, labelAlign === 'top'), formItemClasses === null || formItemClasses === void 0 ? void 0 : formItemClasses.wrapperLabelVerticalMiddle, labelAlign !== 'top' && labelVerticalAlign === 'middle'), formItemClasses === null || formItemClasses === void 0 ? void 0 : formItemClasses.wrapperLabelVerticalBottom, labelAlign !== 'top' && labelVerticalAlign === 'bottom'), formItemClasses === null || formItemClasses === void 0 ? void 0 : formItemClasses.wrapperInline, inline), formItemClasses === null || formItemClasses === void 0 ? void 0 : formItemClasses.wrapperKeepHeight, keepErrorHeight), formItemClasses === null || formItemClasses === void 0 ? void 0 : formItemClasses.wrapperRequired, required), formItemClasses === null || formItemClasses === void 0 ? void 0 : formItemClasses.wrapperTip, showError || tip))
51462
+ className: classnames_default()(className, formItemClasses === null || formItemClasses === void 0 ? void 0 : formItemClasses.wrapper, defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()({}, formItemClasses === null || formItemClasses === void 0 ? void 0 : formItemClasses.wrapperLabelTop, labelAlign === 'top'), formItemClasses === null || formItemClasses === void 0 ? void 0 : formItemClasses.wrapperLabelVerticalMiddle, labelAlign !== 'top' && labelVerticalAlign === 'middle'), formItemClasses === null || formItemClasses === void 0 ? void 0 : formItemClasses.wrapperLabelVerticalBottom, labelAlign !== 'top' && labelVerticalAlign === 'bottom'), formItemClasses === null || formItemClasses === void 0 ? void 0 : formItemClasses.wrapperInline, inline), formItemClasses === null || formItemClasses === void 0 ? void 0 : formItemClasses.wrapperKeepHeight, keepErrorHeight), formItemClasses === null || formItemClasses === void 0 ? void 0 : formItemClasses.wrapperRequired, required), formItemClasses === null || formItemClasses === void 0 ? void 0 : formItemClasses.wrapperHideRequired, required === false), formItemClasses === null || formItemClasses === void 0 ? void 0 : formItemClasses.wrapperTip, showError || tip))
51452
51463
  }, attributes), {}, {
51453
51464
  style: style,
51454
51465
  children: [label !== undefined ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
@@ -56334,7 +56345,9 @@ function Select(props0) {
56334
56345
  noCache = props.noCache,
56335
56346
  highlight = props.highlight,
56336
56347
  _props$trigger = props.trigger,
56337
- trigger = _props$trigger === void 0 ? 'click' : _props$trigger;
56348
+ trigger = _props$trigger === void 0 ? 'click' : _props$trigger,
56349
+ _props$preventEnterSe = props.preventEnterSelect,
56350
+ preventEnterSelect = _props$preventEnterSe === void 0 ? false : _props$preventEnterSe;
56338
56351
  var hasFilter = isFunc(props.onAdvancedFilter || onFilterProp);
56339
56352
  var showInput = hasFilter || isFunc(onCreateProp) || onCreateProp === true;
56340
56353
  var positionProp = props.position || (direction === 'rtl' ? 'bottom-right' : 'bottom-left');
@@ -56558,6 +56571,11 @@ function Select(props0) {
56558
56571
  return;
56559
56572
  }
56560
56573
  }
56574
+
56575
+ // 当开启 preventEnterSelect 且存在 onCreate 功能时,阻止选中已有选项
56576
+ if (preventEnterSelect && onCreate && !createdData) {
56577
+ return;
56578
+ }
56561
56579
  var currentDataItem = filterData === null || filterData === void 0 ? void 0 : filterData[hoverIndex];
56562
56580
  if (currentDataItem && !currentDataItem[groupKey]) {
56563
56581
  handleChange(currentDataItem);
@@ -63968,19 +63986,8 @@ function useComponentMemo(getValue, condition, shouldUpdate) {
63968
63986
 
63969
63987
 
63970
63988
 
63971
-
63972
63989
  function Td(props) {
63973
- var _React$useState = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(),
63974
- _React$useState2 = slicedToArray_default()(_React$useState, 2),
63975
- style = _React$useState2[0],
63976
- setStyle = _React$useState2[1];
63977
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
63978
- if (!props.style) return;
63979
- if (shallowEqual(props.style, style)) {
63980
- return;
63981
- }
63982
- setStyle(props.style);
63983
- }, [props.style]);
63990
+ var _props$style, _props$style2;
63984
63991
  var col = props.col,
63985
63992
  colSpan = props.colSpan,
63986
63993
  rowSpan = props.rowSpan,
@@ -64000,13 +64007,13 @@ function Td(props) {
64000
64007
  onMouseEnter: onMouseEnter,
64001
64008
  onMouseLeave: onMouseLeave,
64002
64009
  className: className,
64003
- style: style,
64010
+ style: props.style,
64004
64011
  dir: direction,
64005
64012
  "data-role": role,
64006
64013
  onClick: onClick,
64007
64014
  children: content
64008
64015
  }, col.key);
64009
- }, [data, className, style, col.type, col.treeColumnsName], props.virtual === 'lazy' ? function (prev, next) {
64016
+ }, [data, className, (_props$style = props.style) === null || _props$style === void 0 ? void 0 : _props$style.left, (_props$style2 = props.style) === null || _props$style2 === void 0 ? void 0 : _props$style2.right, col.type, col.treeColumnsName], props.virtual === 'lazy' ? function (prev, next) {
64010
64017
  if (col.type || col.treeColumnsName) {
64011
64018
  return true;
64012
64019
  }
@@ -64909,6 +64916,10 @@ var emptyRef = {
64909
64916
  return null;
64910
64917
  };
64911
64918
  var $empty = renderEmpty();
64919
+ var tableStyle = {
64920
+ width: width,
64921
+ borderSpacing: 0
64922
+ };
64912
64923
  var renderTable = function renderTable() {
64913
64924
  var _props$summary, _sticky$top, _props$data2;
64914
64925
  var Group = /*#__PURE__*/(0,jsx_runtime.jsx)(table_colgroup, {
@@ -65079,9 +65090,7 @@ var emptyRef = {
65079
65090
  role: theadIdRef.current
65080
65091
  })), {}, {
65081
65092
  children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
65082
- style: {
65083
- width: width
65084
- },
65093
+ style: tableStyle,
65085
65094
  ref: theadRef,
65086
65095
  children: [Group, /*#__PURE__*/(0,jsx_runtime.jsx)(thead, objectSpread2_default()({}, headCommonProps))]
65087
65096
  })
@@ -65110,10 +65119,9 @@ var emptyRef = {
65110
65119
  tableRef: tableRef,
65111
65120
  setFakeVirtual: setFakeVirtual,
65112
65121
  children: [!props.hideHeader && !props.sticky && $headTable, !!((_props$data3 = props.data) !== null && _props$data3 !== void 0 && _props$data3.length) && /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
65113
- style: {
65114
- width: width,
65122
+ style: objectSpread2_default()(objectSpread2_default()({}, tableStyle), {}, {
65115
65123
  transform: virtualInfo.translateStyle
65116
- },
65124
+ }),
65117
65125
  ref: tbodyRef,
65118
65126
  children: [Group, /*#__PURE__*/(0,jsx_runtime.jsx)(tbody, objectSpread2_default()(objectSpread2_default()({}, bodyCommonProps), {}, {
65119
65127
  currentIndex: virtualInfo.startIndex,
@@ -65124,9 +65132,7 @@ var emptyRef = {
65124
65132
  }), showFoot ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
65125
65133
  className: footWrapperClass,
65126
65134
  children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
65127
- style: {
65128
- width: width
65129
- },
65135
+ style: tableStyle,
65130
65136
  ref: tfootRef,
65131
65137
  children: [Group, /*#__PURE__*/(0,jsx_runtime.jsx)(tfoot, objectSpread2_default()({}, footCommonProps))]
65132
65138
  })
@@ -65140,9 +65146,7 @@ var emptyRef = {
65140
65146
  className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.bodyWrapper,
65141
65147
  onScroll: handleBodyScroll,
65142
65148
  children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
65143
- style: {
65144
- width: width
65145
- },
65149
+ style: tableStyle,
65146
65150
  ref: tbodyRef,
65147
65151
  children: [Group, !props.hideHeader && /*#__PURE__*/(0,jsx_runtime.jsx)(thead, objectSpread2_default()({}, headCommonProps)), bodyCommonProps.data.length === 0 ? /*#__PURE__*/(0,jsx_runtime.jsx)(TbodyEmpty, {
65148
65152
  children: renderEmpty()
@@ -65231,9 +65235,7 @@ var emptyRef = {
65231
65235
  }, props.style),
65232
65236
  dir: config.direction,
65233
65237
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("table", {
65234
- style: {
65235
- width: width
65236
- },
65238
+ style: tableStyle,
65237
65239
  children: props.children
65238
65240
  })
65239
65241
  });
@@ -71715,7 +71717,7 @@ var upload_interface = __webpack_require__(8821);
71715
71717
 
71716
71718
 
71717
71719
  /* harmony default export */ var src_0 = ({
71718
- version: '3.8.0-beta.8'
71720
+ version: '3.8.0-beta.9'
71719
71721
  });
71720
71722
  }();
71721
71723
  /******/ return __webpack_exports__;